Version Description
12/03/2020 =
- Fix: Don't show Store Setup link on home screen #5801
- Fix: Don't show the Orders panel on the homescreen with the Task List (#5552)
Download this release
Release Info
| Developer | ilyasfoo |
| Plugin | |
| Version | 1.7.3 |
| Comparing to | |
| See all releases | |
Code changes from version 2.1.5 to 1.7.3
- dist/app/index.js +17460 -8118
dist/app/index.js
CHANGED
|
@@ -35,7 +35,7 @@ this["wc"] = this["wc"] || {}; this["wc"]["app"] =
|
|
| 35 |
/******/
|
| 36 |
/******/ // object to store loaded CSS chunks
|
| 37 |
/******/ var installedCssChunks = {
|
| 38 |
-
/******/
|
| 39 |
/******/ }
|
| 40 |
/******/ var isCssRtlEnabled = function() {
|
| 41 |
/******/ return document.dir === 'rtl';
|
|
@@ -45,14 +45,14 @@ this["wc"] = this["wc"] || {}; this["wc"]["app"] =
|
|
| 45 |
/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
|
| 46 |
/******/ // Promise = chunk loading, 0 = chunk loaded
|
| 47 |
/******/ var installedChunks = {
|
| 48 |
-
/******/
|
| 49 |
/******/ };
|
| 50 |
/******/
|
| 51 |
/******/
|
| 52 |
/******/
|
| 53 |
/******/ // script path function
|
| 54 |
/******/ function webpackJsonpScriptSrc(chunkId) {
|
| 55 |
-
/******/ return __webpack_require__.p + "chunks/" + ({"
|
| 56 |
/******/ }
|
| 57 |
/******/
|
| 58 |
/******/ function jsonpScriptSrc(chunkId) {
|
|
@@ -95,7 +95,7 @@ this["wc"] = this["wc"] || {}; this["wc"]["app"] =
|
|
| 95 |
/******/
|
| 96 |
/******/
|
| 97 |
/******/ // mini-css-extract-plugin CSS loading
|
| 98 |
-
/******/ var cssChunks = {"0":1,"
|
| 99 |
/******/ if(installedCssChunks[chunkId]) promises.push(installedCssChunks[chunkId]);
|
| 100 |
/******/ else if(installedCssChunks[chunkId] !== 0 && cssChunks[chunkId]) {
|
| 101 |
/******/ promises.push(installedCssChunks[chunkId] = new Promise(function(resolve, reject) {
|
|
@@ -259,7 +259,7 @@ this["wc"] = this["wc"] || {}; this["wc"]["app"] =
|
|
| 259 |
/******/
|
| 260 |
/******/
|
| 261 |
/******/ // Load entry module and return exports
|
| 262 |
-
/******/ return __webpack_require__(__webpack_require__.s =
|
| 263 |
/******/ })
|
| 264 |
/************************************************************************/
|
| 265 |
/******/ ({
|
|
@@ -284,2266 +284,2481 @@ this["wc"] = this["wc"] || {}; this["wc"]["app"] =
|
|
| 284 |
if (false) { var throwOnDirectAccess, ReactIs; } else {
|
| 285 |
// By explicitly using `prop-types` you are opting into new production behavior.
|
| 286 |
// http://fb.me/prop-types-in-prod
|
| 287 |
-
module.exports = __webpack_require__(
|
| 288 |
}
|
| 289 |
|
| 290 |
|
| 291 |
/***/ }),
|
| 292 |
|
| 293 |
/***/ 10:
|
| 294 |
-
/***/ (function(module,
|
| 295 |
|
| 296 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 297 |
|
| 298 |
/***/ }),
|
| 299 |
|
| 300 |
-
/***/
|
| 301 |
/***/ (function(module, exports) {
|
| 302 |
|
| 303 |
-
(function() { module.exports = this["
|
| 304 |
|
| 305 |
/***/ }),
|
| 306 |
|
| 307 |
-
/***/
|
| 308 |
-
/***/ (function(module,
|
| 309 |
|
| 310 |
-
|
| 311 |
|
| 312 |
-
|
|
|
|
| 313 |
|
| 314 |
-
|
| 315 |
-
|
| 316 |
|
| 317 |
-
|
| 318 |
-
|
| 319 |
-
|
|
|
|
|
|
|
|
|
|
| 320 |
}
|
|
|
|
|
|
|
| 321 |
}
|
|
|
|
| 322 |
|
| 323 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 324 |
|
| 325 |
/***/ }),
|
| 326 |
|
| 327 |
-
/***/
|
| 328 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
| 329 |
|
| 330 |
"use strict";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 331 |
|
| 332 |
-
|
| 333 |
-
__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ build_module_focus; });
|
| 334 |
-
|
| 335 |
-
// UNUSED EXPORTS: isHorizontalEdge, isVerticalEdge, getRectangleFromRange, computeCaretRect, placeCaretAtHorizontalEdge, placeCaretAtVerticalEdge, isTextField, isNumberInput, documentHasTextSelection, documentHasUncollapsedSelection, documentHasSelection, isEntirelySelected, getScrollContainer, getOffsetParent, replace, remove, insertAfter, unwrap, replaceTag, wrap, __unstableStripHTML, isEmpty, removeInvalidHTML, getPhrasingContentSchema, isPhrasingContent, isTextContent, getFilesFromDataTransfer
|
| 336 |
|
| 337 |
-
// NAMESPACE OBJECT: ./node_modules/@wordpress/dom/build-module/focusable.js
|
| 338 |
-
var focusable_namespaceObject = {};
|
| 339 |
-
__webpack_require__.r(focusable_namespaceObject);
|
| 340 |
-
__webpack_require__.d(focusable_namespaceObject, "find", function() { return find; });
|
| 341 |
|
| 342 |
-
|
| 343 |
-
var tabbable_namespaceObject = {};
|
| 344 |
-
__webpack_require__.r(tabbable_namespaceObject);
|
| 345 |
-
__webpack_require__.d(tabbable_namespaceObject, "isTabbableIndex", function() { return isTabbableIndex; });
|
| 346 |
-
__webpack_require__.d(tabbable_namespaceObject, "find", function() { return tabbable_find; });
|
| 347 |
-
__webpack_require__.d(tabbable_namespaceObject, "findPrevious", function() { return findPrevious; });
|
| 348 |
-
__webpack_require__.d(tabbable_namespaceObject, "findNext", function() { return findNext; });
|
| 349 |
|
| 350 |
-
|
| 351 |
-
|
| 352 |
-
* References:
|
| 353 |
-
*
|
| 354 |
-
* Focusable:
|
| 355 |
-
* - https://www.w3.org/TR/html5/editing.html#focus-management
|
| 356 |
-
*
|
| 357 |
-
* Sequential focus navigation:
|
| 358 |
-
* - https://www.w3.org/TR/html5/editing.html#sequential-focus-navigation-and-the-tabindex-attribute
|
| 359 |
-
*
|
| 360 |
-
* Disabled elements:
|
| 361 |
-
* - https://www.w3.org/TR/html5/disabled-elements.html#disabled-elements
|
| 362 |
-
*
|
| 363 |
-
* getClientRects algorithm (requiring layout box):
|
| 364 |
-
* - https://www.w3.org/TR/cssom-view-1/#extension-to-the-element-interface
|
| 365 |
-
*
|
| 366 |
-
* AREA elements associated with an IMG:
|
| 367 |
-
* - https://w3c.github.io/html/editing.html#data-model
|
| 368 |
-
*/
|
| 369 |
-
var SELECTOR = ['[tabindex]', 'a[href]', 'button:not([disabled])', 'input:not([type="hidden"]):not([disabled])', 'select:not([disabled])', 'textarea:not([disabled])', 'iframe', 'object', 'embed', 'area[href]', '[contenteditable]:not([contenteditable=false])'].join(',');
|
| 370 |
-
/**
|
| 371 |
-
* Returns true if the specified element is visible (i.e. neither display: none
|
| 372 |
-
* nor visibility: hidden).
|
| 373 |
-
*
|
| 374 |
-
* @param {Element} element DOM element to test.
|
| 375 |
-
*
|
| 376 |
-
* @return {boolean} Whether element is visible.
|
| 377 |
-
*/
|
| 378 |
|
| 379 |
-
|
| 380 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 381 |
}
|
| 382 |
-
/**
|
| 383 |
-
* Returns true if the specified element should be skipped from focusable elements.
|
| 384 |
-
* For now it rather specific for `iframes` and if tabindex attribute is set to -1.
|
| 385 |
-
*
|
| 386 |
-
* @param {Element} element DOM element to test.
|
| 387 |
-
*
|
| 388 |
-
* @return {boolean} Whether element should be skipped from focusable elements.
|
| 389 |
-
*/
|
| 390 |
|
|
|
|
| 391 |
|
| 392 |
-
function skipFocus(element) {
|
| 393 |
-
return element.nodeName.toLowerCase() === 'iframe' && element.getAttribute('tabindex') === '-1';
|
| 394 |
-
}
|
| 395 |
-
/**
|
| 396 |
-
* Returns true if the specified area element is a valid focusable element, or
|
| 397 |
-
* false otherwise. Area is only focusable if within a map where a named map
|
| 398 |
-
* referenced by an image somewhere in the document.
|
| 399 |
-
*
|
| 400 |
-
* @param {Element} element DOM area element to test.
|
| 401 |
-
*
|
| 402 |
-
* @return {boolean} Whether area element is valid for focus.
|
| 403 |
-
*/
|
| 404 |
|
|
|
|
| 405 |
|
| 406 |
-
|
| 407 |
-
|
| 408 |
|
| 409 |
-
|
| 410 |
-
|
|
|
|
| 411 |
}
|
| 412 |
|
| 413 |
-
|
| 414 |
-
return !!img && isVisible(img);
|
| 415 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 416 |
/**
|
| 417 |
-
*
|
| 418 |
-
|
| 419 |
-
|
|
|
|
|
|
|
| 420 |
*
|
| 421 |
-
* @
|
|
|
|
| 422 |
*/
|
| 423 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 424 |
|
| 425 |
-
function
|
| 426 |
-
|
| 427 |
-
|
| 428 |
-
if (!isVisible(element) || skipFocus(element)) {
|
| 429 |
-
return false;
|
| 430 |
}
|
| 431 |
|
| 432 |
-
var
|
| 433 |
-
|
| 434 |
-
|
| 435 |
-
return isValidFocusableArea(element);
|
| 436 |
-
}
|
| 437 |
|
| 438 |
-
|
| 439 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 440 |
}
|
| 441 |
-
//# sourceMappingURL=
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 442 |
// EXTERNAL MODULE: external "lodash"
|
| 443 |
-
var external_lodash_ = __webpack_require__(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 444 |
|
| 445 |
-
// CONCATENATED MODULE: ./node_modules/@wordpress/dom/build-module/tabbable.js
|
| 446 |
-
/**
|
| 447 |
-
* External dependencies
|
| 448 |
-
*/
|
| 449 |
|
| 450 |
-
/**
|
| 451 |
-
* Internal dependencies
|
| 452 |
-
*/
|
| 453 |
|
| 454 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 455 |
/**
|
| 456 |
-
*
|
| 457 |
-
* property, this normalizes the default (0) to avoid browser inconsistencies,
|
| 458 |
-
* operating under the assumption that this function is only ever called with a
|
| 459 |
-
* focusable node.
|
| 460 |
-
*
|
| 461 |
-
* @see https://bugzilla.mozilla.org/show_bug.cgi?id=1190261
|
| 462 |
-
*
|
| 463 |
-
* @param {Element} element Element from which to retrieve.
|
| 464 |
-
*
|
| 465 |
-
* @return {?number} Tab index of element (default 0).
|
| 466 |
*/
|
| 467 |
|
| 468 |
-
function getTabIndex(element) {
|
| 469 |
-
var tabIndex = element.getAttribute('tabindex');
|
| 470 |
-
return tabIndex === null ? 0 : parseInt(tabIndex, 10);
|
| 471 |
-
}
|
| 472 |
/**
|
| 473 |
-
*
|
| 474 |
-
*
|
| 475 |
-
* @param {Element} element Element to test.
|
| 476 |
-
*
|
| 477 |
-
* @return {boolean} Whether element is tabbable.
|
| 478 |
*/
|
| 479 |
|
| 480 |
|
| 481 |
-
function isTabbableIndex(element) {
|
| 482 |
-
return getTabIndex(element) !== -1;
|
| 483 |
-
}
|
| 484 |
/**
|
| 485 |
-
*
|
| 486 |
-
* tabbable elements, where at most one radio input is selected for a given
|
| 487 |
-
* name, giving priority to checked input, falling back to the first
|
| 488 |
-
* encountered.
|
| 489 |
-
*
|
| 490 |
-
* @return {Function} Radio group collapse reducer.
|
| 491 |
*/
|
| 492 |
|
| 493 |
-
function createStatefulCollapseRadioGroup() {
|
| 494 |
-
var CHOSEN_RADIO_BY_NAME = {};
|
| 495 |
-
return function collapseRadioGroup(result, element) {
|
| 496 |
-
var nodeName = element.nodeName,
|
| 497 |
-
type = element.type,
|
| 498 |
-
checked = element.checked,
|
| 499 |
-
name = element.name; // For all non-radio tabbables, construct to array by concatenating.
|
| 500 |
|
| 501 |
-
if (nodeName !== 'INPUT' || type !== 'radio' || !name) {
|
| 502 |
-
return result.concat(element);
|
| 503 |
-
}
|
| 504 |
|
| 505 |
-
|
|
|
|
| 506 |
|
| 507 |
-
|
| 508 |
|
| 509 |
-
|
| 510 |
-
|
| 511 |
-
|
| 512 |
-
|
| 513 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 514 |
|
| 515 |
|
| 516 |
-
if (hasChosen) {
|
| 517 |
-
var hadChosenElement = CHOSEN_RADIO_BY_NAME[name];
|
| 518 |
-
result = Object(external_lodash_["without"])(result, hadChosenElement);
|
| 519 |
-
}
|
| 520 |
|
| 521 |
-
CHOSEN_RADIO_BY_NAME[name] = element;
|
| 522 |
-
return result.concat(element);
|
| 523 |
-
};
|
| 524 |
-
}
|
| 525 |
/**
|
| 526 |
-
*
|
| 527 |
-
* array index location as properties. This is used to emulate a proper stable
|
| 528 |
-
* sort where equal tabIndex should be left in order of their occurrence in the
|
| 529 |
-
* document.
|
| 530 |
-
*
|
| 531 |
-
* @param {Element} element Element.
|
| 532 |
-
* @param {number} index Array index of element.
|
| 533 |
-
*
|
| 534 |
-
* @return {Object} Mapped object with element, index.
|
| 535 |
*/
|
| 536 |
|
| 537 |
-
|
| 538 |
-
function mapElementToObjectTabbable(element, index) {
|
| 539 |
-
return {
|
| 540 |
-
element: element,
|
| 541 |
-
index: index
|
| 542 |
-
};
|
| 543 |
-
}
|
| 544 |
/**
|
| 545 |
-
*
|
| 546 |
-
* element value.
|
| 547 |
-
*
|
| 548 |
-
* @param {Object} object Mapped object with index.
|
| 549 |
-
*
|
| 550 |
-
* @return {Element} Mapped object element.
|
| 551 |
*/
|
| 552 |
|
| 553 |
|
| 554 |
-
function mapObjectTabbableToElement(object) {
|
| 555 |
-
return object.element;
|
| 556 |
-
}
|
| 557 |
/**
|
| 558 |
-
*
|
| 559 |
-
*
|
| 560 |
-
* @see mapElementToObjectTabbable
|
| 561 |
-
*
|
| 562 |
-
* @param {Object} a First object to compare.
|
| 563 |
-
* @param {Object} b Second object to compare.
|
| 564 |
-
*
|
| 565 |
-
* @return {number} Comparator result.
|
| 566 |
*/
|
| 567 |
|
| 568 |
|
| 569 |
-
|
| 570 |
-
var aTabIndex = getTabIndex(a.element);
|
| 571 |
-
var bTabIndex = getTabIndex(b.element);
|
| 572 |
|
| 573 |
-
|
| 574 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 575 |
}
|
| 576 |
|
| 577 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 578 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 579 |
/**
|
| 580 |
-
*
|
| 581 |
-
*
|
| 582 |
-
* @param {Array} focusables Focusable elements to filter.
|
| 583 |
-
*
|
| 584 |
-
* @return {Array} Tabbable elements.
|
| 585 |
*/
|
| 586 |
|
|
|
|
|
|
|
|
|
|
| 587 |
|
| 588 |
-
function filterTabbable(focusables) {
|
| 589 |
-
return focusables.filter(isTabbableIndex).map(mapElementToObjectTabbable).sort(compareObjectTabbables).map(mapObjectTabbableToElement).reduce(createStatefulCollapseRadioGroup(), []);
|
| 590 |
-
}
|
| 591 |
|
| 592 |
-
function
|
| 593 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 594 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 595 |
/**
|
| 596 |
-
*
|
| 597 |
-
*
|
| 598 |
-
* @param {Element} element The focusable element before which to look. Defaults
|
| 599 |
-
* to the active element.
|
| 600 |
*/
|
| 601 |
|
| 602 |
-
function findPrevious(element) {
|
| 603 |
-
var focusables = find(element.ownerDocument.body);
|
| 604 |
-
var index = focusables.indexOf(element); // Remove all focusables after and including `element`.
|
| 605 |
-
|
| 606 |
-
focusables.length = index;
|
| 607 |
-
return Object(external_lodash_["last"])(filterTabbable(focusables));
|
| 608 |
-
}
|
| 609 |
/**
|
| 610 |
-
*
|
| 611 |
-
*
|
| 612 |
-
* @param {Element} element The focusable element after which to look. Defaults
|
| 613 |
-
* to the active element.
|
| 614 |
*/
|
| 615 |
|
| 616 |
-
function findNext(element) {
|
| 617 |
-
var focusables = find(element.ownerDocument.body);
|
| 618 |
-
var index = focusables.indexOf(element); // Remove all focusables before and inside `element`.
|
| 619 |
|
| 620 |
-
|
| 621 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 622 |
});
|
| 623 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 624 |
}
|
| 625 |
-
//# sourceMappingURL=
|
| 626 |
-
// CONCATENATED MODULE: ./node_modules/@wordpress/
|
|
|
|
|
|
|
|
|
|
|
|
|
| 627 |
/**
|
| 628 |
* Internal dependencies
|
| 629 |
*/
|
| 630 |
|
| 631 |
|
| 632 |
-
/**
|
| 633 |
-
* Object grouping `focusable` and `tabbable` utils
|
| 634 |
-
* under the keys with the same name.
|
| 635 |
-
*/
|
| 636 |
|
| 637 |
-
var build_module_focus = {
|
| 638 |
-
focusable: focusable_namespaceObject,
|
| 639 |
-
tabbable: tabbable_namespaceObject
|
| 640 |
-
};
|
| 641 |
|
| 642 |
|
| 643 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 644 |
//# sourceMappingURL=index.js.map
|
| 645 |
|
| 646 |
/***/ }),
|
| 647 |
|
| 648 |
-
/***/
|
| 649 |
/***/ (function(module, exports, __webpack_require__) {
|
| 650 |
|
| 651 |
"use strict";
|
| 652 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 653 |
|
| 654 |
|
| 655 |
/***/ }),
|
| 656 |
|
| 657 |
-
/***/
|
| 658 |
/***/ (function(module, exports) {
|
| 659 |
|
| 660 |
-
|
| 661 |
-
|
|
|
|
| 662 |
|
| 663 |
-
|
| 664 |
-
// don't break things. But we need to wrap it in a try catch in case it is
|
| 665 |
-
// wrapped in strict mode code which doesn't define any globals. It's inside a
|
| 666 |
-
// function because try/catches deoptimize in certain engines.
|
| 667 |
|
| 668 |
-
|
| 669 |
-
var cachedClearTimeout;
|
| 670 |
|
| 671 |
-
|
| 672 |
-
|
| 673 |
-
|
| 674 |
-
function
|
| 675 |
-
|
| 676 |
-
|
| 677 |
-
|
| 678 |
-
|
| 679 |
-
|
| 680 |
-
cachedSetTimeout = setTimeout;
|
| 681 |
-
} else {
|
| 682 |
-
cachedSetTimeout = defaultSetTimout;
|
| 683 |
-
}
|
| 684 |
-
} catch (e) {
|
| 685 |
-
cachedSetTimeout = defaultSetTimout;
|
| 686 |
-
}
|
| 687 |
-
try {
|
| 688 |
-
if (typeof clearTimeout === 'function') {
|
| 689 |
-
cachedClearTimeout = clearTimeout;
|
| 690 |
-
} else {
|
| 691 |
-
cachedClearTimeout = defaultClearTimeout;
|
| 692 |
-
}
|
| 693 |
-
} catch (e) {
|
| 694 |
-
cachedClearTimeout = defaultClearTimeout;
|
| 695 |
-
}
|
| 696 |
-
} ())
|
| 697 |
-
function runTimeout(fun) {
|
| 698 |
-
if (cachedSetTimeout === setTimeout) {
|
| 699 |
-
//normal enviroments in sane situations
|
| 700 |
-
return setTimeout(fun, 0);
|
| 701 |
-
}
|
| 702 |
-
// if setTimeout wasn't available but was latter defined
|
| 703 |
-
if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
|
| 704 |
-
cachedSetTimeout = setTimeout;
|
| 705 |
-
return setTimeout(fun, 0);
|
| 706 |
-
}
|
| 707 |
-
try {
|
| 708 |
-
// when when somebody has screwed with setTimeout but no I.E. maddness
|
| 709 |
-
return cachedSetTimeout(fun, 0);
|
| 710 |
-
} catch(e){
|
| 711 |
-
try {
|
| 712 |
-
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
|
| 713 |
-
return cachedSetTimeout.call(null, fun, 0);
|
| 714 |
-
} catch(e){
|
| 715 |
-
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
|
| 716 |
-
return cachedSetTimeout.call(this, fun, 0);
|
| 717 |
-
}
|
| 718 |
-
}
|
| 719 |
|
|
|
|
|
|
|
|
|
|
| 720 |
|
| 721 |
-
|
| 722 |
-
function runClearTimeout(marker) {
|
| 723 |
-
if (cachedClearTimeout === clearTimeout) {
|
| 724 |
-
//normal enviroments in sane situations
|
| 725 |
-
return clearTimeout(marker);
|
| 726 |
-
}
|
| 727 |
-
// if clearTimeout wasn't available but was latter defined
|
| 728 |
-
if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
|
| 729 |
-
cachedClearTimeout = clearTimeout;
|
| 730 |
-
return clearTimeout(marker);
|
| 731 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
| 732 |
try {
|
| 733 |
-
|
| 734 |
-
|
| 735 |
-
|
| 736 |
-
try {
|
| 737 |
-
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
|
| 738 |
-
return cachedClearTimeout.call(null, marker);
|
| 739 |
-
} catch (e){
|
| 740 |
-
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
|
| 741 |
-
// Some versions of I.E. have different rules for clearTimeout vs setTimeout
|
| 742 |
-
return cachedClearTimeout.call(this, marker);
|
| 743 |
-
}
|
| 744 |
}
|
|
|
|
| 745 |
|
| 746 |
-
|
| 747 |
-
|
| 748 |
}
|
| 749 |
-
var queue = [];
|
| 750 |
-
var draining = false;
|
| 751 |
-
var currentQueue;
|
| 752 |
-
var queueIndex = -1;
|
| 753 |
|
| 754 |
-
|
| 755 |
-
if (!draining || !currentQueue) {
|
| 756 |
-
return;
|
| 757 |
-
}
|
| 758 |
-
draining = false;
|
| 759 |
-
if (currentQueue.length) {
|
| 760 |
-
queue = currentQueue.concat(queue);
|
| 761 |
-
} else {
|
| 762 |
-
queueIndex = -1;
|
| 763 |
-
}
|
| 764 |
-
if (queue.length) {
|
| 765 |
-
drainQueue();
|
| 766 |
-
}
|
| 767 |
-
}
|
| 768 |
|
| 769 |
-
|
| 770 |
-
if (draining) {
|
| 771 |
-
return;
|
| 772 |
-
}
|
| 773 |
-
var timeout = runTimeout(cleanUpNextTick);
|
| 774 |
-
draining = true;
|
| 775 |
|
| 776 |
-
|
| 777 |
-
|
| 778 |
-
|
| 779 |
-
|
| 780 |
-
|
| 781 |
-
if (currentQueue) {
|
| 782 |
-
currentQueue[queueIndex].run();
|
| 783 |
-
}
|
| 784 |
-
}
|
| 785 |
-
queueIndex = -1;
|
| 786 |
-
len = queue.length;
|
| 787 |
-
}
|
| 788 |
-
currentQueue = null;
|
| 789 |
-
draining = false;
|
| 790 |
-
runClearTimeout(timeout);
|
| 791 |
}
|
| 792 |
|
| 793 |
-
|
| 794 |
-
var args = new Array(arguments.length - 1);
|
| 795 |
-
if (arguments.length > 1) {
|
| 796 |
-
for (var i = 1; i < arguments.length; i++) {
|
| 797 |
-
args[i - 1] = arguments[i];
|
| 798 |
-
}
|
| 799 |
-
}
|
| 800 |
-
queue.push(new Item(fun, args));
|
| 801 |
-
if (queue.length === 1 && !draining) {
|
| 802 |
-
runTimeout(drainQueue);
|
| 803 |
-
}
|
| 804 |
-
};
|
| 805 |
|
| 806 |
-
|
| 807 |
-
function Item(fun, array) {
|
| 808 |
-
this.fun = fun;
|
| 809 |
-
this.array = array;
|
| 810 |
-
}
|
| 811 |
-
Item.prototype.run = function () {
|
| 812 |
-
this.fun.apply(null, this.array);
|
| 813 |
-
};
|
| 814 |
-
process.title = 'browser';
|
| 815 |
-
process.browser = true;
|
| 816 |
-
process.env = {};
|
| 817 |
-
process.argv = [];
|
| 818 |
-
process.version = ''; // empty string to avoid regexp issues
|
| 819 |
-
process.versions = {};
|
| 820 |
|
| 821 |
-
|
|
|
|
| 822 |
|
| 823 |
-
|
| 824 |
-
|
| 825 |
-
|
| 826 |
-
process.off = noop;
|
| 827 |
-
process.removeListener = noop;
|
| 828 |
-
process.removeAllListeners = noop;
|
| 829 |
-
process.emit = noop;
|
| 830 |
-
process.prependListener = noop;
|
| 831 |
-
process.prependOnceListener = noop;
|
| 832 |
|
| 833 |
-
|
|
|
|
|
|
|
|
|
|
| 834 |
|
| 835 |
-
|
| 836 |
-
|
| 837 |
-
};
|
| 838 |
|
| 839 |
-
|
| 840 |
-
|
| 841 |
-
|
| 842 |
-
|
| 843 |
-
|
|
|
|
|
|
|
| 844 |
|
|
|
|
|
|
|
| 845 |
|
| 846 |
/***/ }),
|
| 847 |
|
| 848 |
-
/***/
|
| 849 |
/***/ (function(module, exports, __webpack_require__) {
|
| 850 |
|
| 851 |
-
"
|
|
|
|
| 852 |
|
| 853 |
|
| 854 |
-
|
| 855 |
-
module.exports = __webpack_require__(152);
|
| 856 |
-
} else {}
|
| 857 |
|
|
|
|
|
|
|
| 858 |
|
| 859 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 860 |
|
| 861 |
-
/***/ 13:
|
| 862 |
-
/***/ (function(module, exports) {
|
| 863 |
|
| 864 |
-
function _defineProperties(target, props) {
|
| 865 |
-
for (var i = 0; i < props.length; i++) {
|
| 866 |
-
var descriptor = props[i];
|
| 867 |
-
descriptor.enumerable = descriptor.enumerable || false;
|
| 868 |
-
descriptor.configurable = true;
|
| 869 |
-
if ("value" in descriptor) descriptor.writable = true;
|
| 870 |
-
Object.defineProperty(target, descriptor.key, descriptor);
|
| 871 |
-
}
|
| 872 |
-
}
|
| 873 |
|
| 874 |
-
|
| 875 |
-
|
| 876 |
-
|
| 877 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 878 |
}
|
| 879 |
|
| 880 |
-
|
|
|
|
| 881 |
|
| 882 |
/***/ }),
|
| 883 |
|
| 884 |
-
/***/
|
| 885 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
| 886 |
|
| 887 |
"use strict";
|
| 888 |
-
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
|
| 889 |
-
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
|
| 890 |
-
/* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(43);
|
| 891 |
-
/* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_1__);
|
| 892 |
-
/* harmony import */ var _woocommerce_wc_admin_settings__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(25);
|
| 893 |
-
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(0);
|
| 894 |
-
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__);
|
| 895 |
-
/**
|
| 896 |
-
* External dependencies
|
| 897 |
-
*/
|
| 898 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 899 |
|
|
|
|
| 900 |
|
|
|
|
|
|
|
| 901 |
|
| 902 |
-
|
| 903 |
-
|
| 904 |
-
|
| 905 |
-
|
| 906 |
-
*/
|
| 907 |
-
|
| 908 |
-
var RevenueReport = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["lazy"])(function () {
|
| 909 |
-
return Promise.all(/* import() | analytics-report-revenue */[__webpack_require__.e(0), __webpack_require__.e(16)]).then(__webpack_require__.bind(null, 487));
|
| 910 |
-
});
|
| 911 |
-
var ProductsReport = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["lazy"])(function () {
|
| 912 |
-
return Promise.all(/* import() | analytics-report-products */[__webpack_require__.e(0), __webpack_require__.e(3), __webpack_require__.e(15)]).then(__webpack_require__.bind(null, 483));
|
| 913 |
-
});
|
| 914 |
-
var VariationsReport = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["lazy"])(function () {
|
| 915 |
-
return Promise.all(/* import() | analytics-report-variations */[__webpack_require__.e(0), __webpack_require__.e(19)]).then(__webpack_require__.bind(null, 488));
|
| 916 |
-
});
|
| 917 |
-
var OrdersReport = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["lazy"])(function () {
|
| 918 |
-
return Promise.all(/* import() | analytics-report-orders */[__webpack_require__.e(0), __webpack_require__.e(6), __webpack_require__.e(14)]).then(__webpack_require__.bind(null, 489));
|
| 919 |
-
});
|
| 920 |
-
var CategoriesReport = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["lazy"])(function () {
|
| 921 |
-
return Promise.all(/* import() | analytics-report-categories */[__webpack_require__.e(0), __webpack_require__.e(3), __webpack_require__.e(10)]).then(__webpack_require__.bind(null, 485));
|
| 922 |
-
});
|
| 923 |
-
var CouponsReport = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["lazy"])(function () {
|
| 924 |
-
return Promise.all(/* import() | analytics-report-coupons */[__webpack_require__.e(0), __webpack_require__.e(11)]).then(__webpack_require__.bind(null, 490));
|
| 925 |
-
});
|
| 926 |
-
var TaxesReport = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["lazy"])(function () {
|
| 927 |
-
return Promise.all(/* import() | analytics-report-taxes */[__webpack_require__.e(0), __webpack_require__.e(18)]).then(__webpack_require__.bind(null, 491));
|
| 928 |
-
});
|
| 929 |
-
var DownloadsReport = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["lazy"])(function () {
|
| 930 |
-
return Promise.all(/* import() | analytics-report-downloads */[__webpack_require__.e(0), __webpack_require__.e(13)]).then(__webpack_require__.bind(null, 492));
|
| 931 |
-
});
|
| 932 |
-
var StockReport = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["lazy"])(function () {
|
| 933 |
-
return Promise.all(/* import() | analytics-report-stock */[__webpack_require__.e(0), __webpack_require__.e(17)]).then(__webpack_require__.bind(null, 484));
|
| 934 |
-
});
|
| 935 |
-
var CustomersReport = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["lazy"])(function () {
|
| 936 |
-
return Promise.all(/* import() | analytics-report-customers */[__webpack_require__.e(0), __webpack_require__.e(12)]).then(__webpack_require__.bind(null, 486));
|
| 937 |
-
});
|
| 938 |
-
/* harmony default export */ __webpack_exports__["a"] = (function () {
|
| 939 |
-
var reports = [{
|
| 940 |
-
report: 'revenue',
|
| 941 |
-
title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Revenue', 'woocommerce-admin'),
|
| 942 |
-
component: RevenueReport,
|
| 943 |
-
navArgs: {
|
| 944 |
-
id: 'woocommerce-analytics-revenue'
|
| 945 |
-
}
|
| 946 |
-
}, {
|
| 947 |
-
report: 'products',
|
| 948 |
-
title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Products', 'woocommerce-admin'),
|
| 949 |
-
component: ProductsReport,
|
| 950 |
-
navArgs: {
|
| 951 |
-
id: 'woocommerce-analytics-products'
|
| 952 |
-
}
|
| 953 |
-
}, {
|
| 954 |
-
report: 'variations',
|
| 955 |
-
title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Variations', 'woocommerce-admin'),
|
| 956 |
-
component: VariationsReport,
|
| 957 |
-
navArgs: {
|
| 958 |
-
id: 'woocommerce-analytics-variations'
|
| 959 |
-
}
|
| 960 |
-
}, {
|
| 961 |
-
report: 'orders',
|
| 962 |
-
title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Orders', 'woocommerce-admin'),
|
| 963 |
-
component: OrdersReport,
|
| 964 |
-
navArgs: {
|
| 965 |
-
id: 'woocommerce-analytics-orders'
|
| 966 |
-
}
|
| 967 |
-
}, {
|
| 968 |
-
report: 'categories',
|
| 969 |
-
title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Categories', 'woocommerce-admin'),
|
| 970 |
-
component: CategoriesReport,
|
| 971 |
-
navArgs: {
|
| 972 |
-
id: 'woocommerce-analytics-categories'
|
| 973 |
-
}
|
| 974 |
-
}, {
|
| 975 |
-
report: 'coupons',
|
| 976 |
-
title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Coupons', 'woocommerce-admin'),
|
| 977 |
-
component: CouponsReport,
|
| 978 |
-
navArgs: {
|
| 979 |
-
id: 'woocommerce-analytics-coupons'
|
| 980 |
-
}
|
| 981 |
-
}, {
|
| 982 |
-
report: 'taxes',
|
| 983 |
-
title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Taxes', 'woocommerce-admin'),
|
| 984 |
-
component: TaxesReport,
|
| 985 |
-
navArgs: {
|
| 986 |
-
id: 'woocommerce-analytics-taxes'
|
| 987 |
-
}
|
| 988 |
-
}, manageStock === 'yes' ? {
|
| 989 |
-
report: 'stock',
|
| 990 |
-
title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Stock', 'woocommerce-admin'),
|
| 991 |
-
component: StockReport,
|
| 992 |
-
navArgs: {
|
| 993 |
-
id: 'woocommerce-analytics-stock'
|
| 994 |
-
}
|
| 995 |
-
} : null, {
|
| 996 |
-
report: 'customers',
|
| 997 |
-
title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Customers', 'woocommerce-admin'),
|
| 998 |
-
component: CustomersReport
|
| 999 |
-
}, {
|
| 1000 |
-
report: 'downloads',
|
| 1001 |
-
title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Downloads', 'woocommerce-admin'),
|
| 1002 |
-
component: DownloadsReport,
|
| 1003 |
-
navArgs: {
|
| 1004 |
-
id: 'woocommerce-analytics-downloads'
|
| 1005 |
-
}
|
| 1006 |
-
}].filter(Boolean);
|
| 1007 |
-
return Object(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_1__["applyFilters"])(REPORTS_FILTER, reports);
|
| 1008 |
-
});
|
| 1009 |
-
|
| 1010 |
-
/***/ }),
|
| 1011 |
-
|
| 1012 |
-
/***/ 138:
|
| 1013 |
-
/***/ (function(module, exports, __webpack_require__) {
|
| 1014 |
-
|
| 1015 |
-
"use strict";
|
| 1016 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1017 |
|
| 1018 |
-
|
|
|
|
| 1019 |
|
| 1020 |
-
|
| 1021 |
-
|
| 1022 |
-
|
| 1023 |
-
*/
|
| 1024 |
-
var REACT_STATICS = {
|
| 1025 |
-
childContextTypes: true,
|
| 1026 |
-
contextType: true,
|
| 1027 |
-
contextTypes: true,
|
| 1028 |
-
defaultProps: true,
|
| 1029 |
-
displayName: true,
|
| 1030 |
-
getDefaultProps: true,
|
| 1031 |
-
getDerivedStateFromError: true,
|
| 1032 |
-
getDerivedStateFromProps: true,
|
| 1033 |
-
mixins: true,
|
| 1034 |
-
propTypes: true,
|
| 1035 |
-
type: true
|
| 1036 |
-
};
|
| 1037 |
-
var KNOWN_STATICS = {
|
| 1038 |
-
name: true,
|
| 1039 |
-
length: true,
|
| 1040 |
-
prototype: true,
|
| 1041 |
-
caller: true,
|
| 1042 |
-
callee: true,
|
| 1043 |
-
arguments: true,
|
| 1044 |
-
arity: true
|
| 1045 |
-
};
|
| 1046 |
-
var FORWARD_REF_STATICS = {
|
| 1047 |
-
'$$typeof': true,
|
| 1048 |
-
render: true,
|
| 1049 |
-
defaultProps: true,
|
| 1050 |
-
displayName: true,
|
| 1051 |
-
propTypes: true
|
| 1052 |
-
};
|
| 1053 |
-
var MEMO_STATICS = {
|
| 1054 |
-
'$$typeof': true,
|
| 1055 |
-
compare: true,
|
| 1056 |
-
defaultProps: true,
|
| 1057 |
-
displayName: true,
|
| 1058 |
-
propTypes: true,
|
| 1059 |
-
type: true
|
| 1060 |
-
};
|
| 1061 |
-
var TYPE_STATICS = {};
|
| 1062 |
-
TYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS;
|
| 1063 |
-
TYPE_STATICS[reactIs.Memo] = MEMO_STATICS;
|
| 1064 |
|
| 1065 |
-
|
| 1066 |
-
|
| 1067 |
-
if (reactIs.isMemo(component)) {
|
| 1068 |
-
return MEMO_STATICS;
|
| 1069 |
-
} // React v16.12 and above
|
| 1070 |
|
|
|
|
|
|
|
|
|
|
| 1071 |
|
| 1072 |
-
|
| 1073 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1074 |
|
| 1075 |
-
|
| 1076 |
-
var getOwnPropertyNames = Object.getOwnPropertyNames;
|
| 1077 |
-
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
| 1078 |
-
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
| 1079 |
-
var getPrototypeOf = Object.getPrototypeOf;
|
| 1080 |
-
var objectPrototype = Object.prototype;
|
| 1081 |
-
function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {
|
| 1082 |
-
if (typeof sourceComponent !== 'string') {
|
| 1083 |
-
// don't hoist over string (html) components
|
| 1084 |
-
if (objectPrototype) {
|
| 1085 |
-
var inheritedComponent = getPrototypeOf(sourceComponent);
|
| 1086 |
|
| 1087 |
-
|
| 1088 |
-
|
| 1089 |
-
|
| 1090 |
-
|
|
|
|
|
|
|
|
|
|
| 1091 |
|
| 1092 |
-
|
|
|
|
|
|
|
| 1093 |
|
| 1094 |
-
if (
|
| 1095 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1096 |
}
|
|
|
|
| 1097 |
|
| 1098 |
-
|
| 1099 |
-
var sourceStatics = getStatics(sourceComponent);
|
| 1100 |
|
| 1101 |
-
|
| 1102 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1103 |
|
| 1104 |
-
|
| 1105 |
-
var descriptor = getOwnPropertyDescriptor(sourceComponent, key);
|
| 1106 |
|
| 1107 |
-
|
| 1108 |
-
// Avoid failures from read-only properties
|
| 1109 |
-
defineProperty(targetComponent, key, descriptor);
|
| 1110 |
-
} catch (e) {}
|
| 1111 |
-
}
|
| 1112 |
-
}
|
| 1113 |
-
}
|
| 1114 |
|
| 1115 |
-
return
|
| 1116 |
}
|
| 1117 |
|
| 1118 |
-
|
| 1119 |
-
|
| 1120 |
|
| 1121 |
-
|
|
|
|
|
|
|
|
|
|
| 1122 |
|
| 1123 |
-
|
| 1124 |
-
|
|
|
|
| 1125 |
|
| 1126 |
-
|
|
|
|
| 1127 |
|
| 1128 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1129 |
|
| 1130 |
-
|
| 1131 |
-
|
|
|
|
| 1132 |
|
| 1133 |
-
|
| 1134 |
|
| 1135 |
-
|
| 1136 |
-
|
| 1137 |
-
|
| 1138 |
}
|
| 1139 |
|
| 1140 |
-
|
| 1141 |
-
constructor: {
|
| 1142 |
-
value: subClass,
|
| 1143 |
-
writable: true,
|
| 1144 |
-
configurable: true
|
| 1145 |
-
}
|
| 1146 |
-
});
|
| 1147 |
-
if (superClass) setPrototypeOf(subClass, superClass);
|
| 1148 |
}
|
| 1149 |
|
| 1150 |
-
|
| 1151 |
|
| 1152 |
-
|
|
|
|
| 1153 |
|
| 1154 |
-
|
| 1155 |
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
| 1156 |
|
| 1157 |
-
"use strict";
|
| 1158 |
|
| 1159 |
-
// EXPORTS
|
| 1160 |
-
__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ speak; });
|
| 1161 |
|
| 1162 |
-
// UNUSED EXPORTS: setup
|
| 1163 |
|
| 1164 |
-
// EXTERNAL MODULE: ./node_modules/@wordpress/dom-ready/build-module/index.js
|
| 1165 |
-
var build_module = __webpack_require__(54);
|
| 1166 |
|
| 1167 |
-
// EXTERNAL MODULE: external {"this":["wp","i18n"]}
|
| 1168 |
-
var external_this_wp_i18n_ = __webpack_require__(2);
|
| 1169 |
|
| 1170 |
-
|
| 1171 |
-
|
| 1172 |
-
|
| 1173 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1174 |
|
| 1175 |
-
|
| 1176 |
-
|
| 1177 |
-
|
| 1178 |
-
|
| 1179 |
-
* HTML attribute which is then removed once a message fills the aria-live regions.
|
| 1180 |
-
*
|
| 1181 |
-
* @return {HTMLParagraphElement} The explanatory text HTML element.
|
| 1182 |
-
*/
|
| 1183 |
|
| 1184 |
-
|
| 1185 |
-
var introText = document.createElement('p');
|
| 1186 |
-
introText.id = 'a11y-speak-intro-text';
|
| 1187 |
-
introText.className = 'a11y-speak-intro-text';
|
| 1188 |
-
introText.textContent = Object(external_this_wp_i18n_["__"])('Notifications');
|
| 1189 |
-
introText.setAttribute('style', 'position: absolute;' + 'margin: -1px;' + 'padding: 0;' + 'height: 1px;' + 'width: 1px;' + 'overflow: hidden;' + 'clip: rect(1px, 1px, 1px, 1px);' + '-webkit-clip-path: inset(50%);' + 'clip-path: inset(50%);' + 'border: 0;' + 'word-wrap: normal !important;');
|
| 1190 |
-
introText.setAttribute('hidden', 'hidden');
|
| 1191 |
-
var _document = document,
|
| 1192 |
-
body = _document.body;
|
| 1193 |
|
| 1194 |
-
if (
|
| 1195 |
-
|
|
|
|
| 1196 |
}
|
| 1197 |
|
| 1198 |
-
return
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1199 |
}
|
| 1200 |
-
//# sourceMappingURL=add-intro-text.js.map
|
| 1201 |
-
// CONCATENATED MODULE: ./node_modules/@wordpress/a11y/build-module/add-container.js
|
| 1202 |
-
/**
|
| 1203 |
-
* Build the live regions markup.
|
| 1204 |
-
*
|
| 1205 |
-
* @param {string} [ariaLive] Value for the 'aria-live' attribute; default: 'polite'.
|
| 1206 |
-
*
|
| 1207 |
-
* @return {HTMLDivElement} The ARIA live region HTML element.
|
| 1208 |
-
*/
|
| 1209 |
-
function addContainer() {
|
| 1210 |
-
var ariaLive = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'polite';
|
| 1211 |
-
var container = document.createElement('div');
|
| 1212 |
-
container.id = "a11y-speak-".concat(ariaLive);
|
| 1213 |
-
container.className = 'a11y-speak-region';
|
| 1214 |
-
container.setAttribute('style', 'position: absolute;' + 'margin: -1px;' + 'padding: 0;' + 'height: 1px;' + 'width: 1px;' + 'overflow: hidden;' + 'clip: rect(1px, 1px, 1px, 1px);' + '-webkit-clip-path: inset(50%);' + 'clip-path: inset(50%);' + 'border: 0;' + 'word-wrap: normal !important;');
|
| 1215 |
-
container.setAttribute('aria-live', ariaLive);
|
| 1216 |
-
container.setAttribute('aria-relevant', 'additions text');
|
| 1217 |
-
container.setAttribute('aria-atomic', 'true');
|
| 1218 |
-
var _document = document,
|
| 1219 |
-
body = _document.body;
|
| 1220 |
|
| 1221 |
-
|
| 1222 |
-
|
| 1223 |
-
}
|
| 1224 |
|
| 1225 |
-
|
| 1226 |
-
|
| 1227 |
-
|
| 1228 |
-
|
| 1229 |
-
|
| 1230 |
-
|
| 1231 |
-
*/
|
| 1232 |
-
|
| 1233 |
-
var regions = document.getElementsByClassName('a11y-speak-region');
|
| 1234 |
-
var introText = document.getElementById('a11y-speak-intro-text');
|
| 1235 |
|
| 1236 |
-
|
| 1237 |
-
|
| 1238 |
-
|
|
|
|
|
|
|
| 1239 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1240 |
|
| 1241 |
-
|
| 1242 |
-
introText.setAttribute('hidden', 'hidden');
|
| 1243 |
}
|
| 1244 |
-
}
|
| 1245 |
-
//# sourceMappingURL=clear.js.map
|
| 1246 |
-
// CONCATENATED MODULE: ./node_modules/@wordpress/a11y/build-module/filter-message.js
|
| 1247 |
-
var previousMessage = '';
|
| 1248 |
-
/**
|
| 1249 |
-
* Filter the message to be announced to the screenreader.
|
| 1250 |
-
*
|
| 1251 |
-
* @param {string} message The message to be announced.
|
| 1252 |
-
*
|
| 1253 |
-
* @return {string} The filtered message.
|
| 1254 |
-
*/
|
| 1255 |
|
| 1256 |
-
|
| 1257 |
-
|
| 1258 |
-
|
| 1259 |
-
|
| 1260 |
-
|
| 1261 |
-
|
| 1262 |
-
|
| 1263 |
-
|
| 1264 |
-
|
| 1265 |
-
/*
|
| 1266 |
-
* Safari + VoiceOver don't announce repeated, identical strings. We use
|
| 1267 |
-
* a `no-break space` to force them to think identical strings are different.
|
| 1268 |
-
*/
|
| 1269 |
|
| 1270 |
-
if (
|
| 1271 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1272 |
}
|
| 1273 |
|
| 1274 |
-
|
| 1275 |
-
|
|
|
|
|
|
|
| 1276 |
}
|
| 1277 |
-
//# sourceMappingURL=filter-message.js.map
|
| 1278 |
-
// CONCATENATED MODULE: ./node_modules/@wordpress/a11y/build-module/index.js
|
| 1279 |
-
/**
|
| 1280 |
-
* WordPress dependencies
|
| 1281 |
-
*/
|
| 1282 |
|
| 1283 |
-
|
| 1284 |
-
|
| 1285 |
-
*/
|
| 1286 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1287 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1288 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1289 |
|
|
|
|
| 1290 |
|
| 1291 |
-
|
| 1292 |
-
|
| 1293 |
-
*/
|
| 1294 |
|
| 1295 |
-
function
|
| 1296 |
-
|
| 1297 |
-
|
| 1298 |
-
var containerPolite = document.getElementById('a11y-speak-polite');
|
| 1299 |
|
| 1300 |
-
|
| 1301 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1302 |
}
|
| 1303 |
|
| 1304 |
-
|
| 1305 |
-
|
| 1306 |
-
|
|
|
|
| 1307 |
|
| 1308 |
-
|
| 1309 |
-
|
|
|
|
| 1310 |
}
|
| 1311 |
-
}
|
| 1312 |
-
/**
|
| 1313 |
-
* Run setup on domReady.
|
| 1314 |
-
*/
|
| 1315 |
|
| 1316 |
-
|
| 1317 |
-
|
| 1318 |
-
|
| 1319 |
-
|
| 1320 |
-
|
| 1321 |
-
|
| 1322 |
-
|
| 1323 |
-
|
| 1324 |
-
|
| 1325 |
-
|
| 1326 |
-
|
| 1327 |
-
|
| 1328 |
-
|
| 1329 |
-
*
|
| 1330 |
*
|
| 1331 |
-
*
|
| 1332 |
-
*
|
| 1333 |
-
*
|
| 1334 |
*/
|
| 1335 |
|
| 1336 |
-
function
|
| 1337 |
-
|
| 1338 |
-
|
| 1339 |
-
|
| 1340 |
-
*/
|
| 1341 |
-
clear();
|
| 1342 |
-
message = filterMessage(message);
|
| 1343 |
-
var introText = document.getElementById('a11y-speak-intro-text');
|
| 1344 |
-
var containerAssertive = document.getElementById('a11y-speak-assertive');
|
| 1345 |
-
var containerPolite = document.getElementById('a11y-speak-polite');
|
| 1346 |
-
|
| 1347 |
-
if (containerAssertive && ariaLive === 'assertive') {
|
| 1348 |
-
containerAssertive.textContent = message;
|
| 1349 |
-
} else if (containerPolite) {
|
| 1350 |
-
containerPolite.textContent = message;
|
| 1351 |
-
}
|
| 1352 |
-
/*
|
| 1353 |
-
* Make the explanatory text available to assistive technologies by removing
|
| 1354 |
-
* the 'hidden' HTML attribute.
|
| 1355 |
-
*/
|
| 1356 |
-
|
| 1357 |
-
|
| 1358 |
-
if (introText) {
|
| 1359 |
-
introText.removeAttribute('hidden');
|
| 1360 |
-
}
|
| 1361 |
}
|
| 1362 |
-
|
|
|
|
|
|
|
|
|
|
| 1363 |
|
| 1364 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1365 |
|
| 1366 |
-
|
| 1367 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1368 |
|
| 1369 |
-
|
|
|
|
|
|
|
| 1370 |
|
| 1371 |
-
|
| 1372 |
-
|
| 1373 |
-
__webpack_require__.d(__webpack_exports__, "b", function() { return /* binding */ PageLayout; });
|
| 1374 |
-
__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ EmbedLayout; });
|
| 1375 |
|
| 1376 |
-
|
| 1377 |
-
|
| 1378 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1379 |
|
| 1380 |
-
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/objectWithoutProperties.js
|
| 1381 |
-
var objectWithoutProperties = __webpack_require__(34);
|
| 1382 |
-
var objectWithoutProperties_default = /*#__PURE__*/__webpack_require__.n(objectWithoutProperties);
|
| 1383 |
|
| 1384 |
-
|
| 1385 |
-
|
| 1386 |
-
|
|
|
|
| 1387 |
|
| 1388 |
-
|
| 1389 |
-
var
|
| 1390 |
-
var
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1391 |
|
| 1392 |
-
|
| 1393 |
-
var
|
| 1394 |
-
|
|
|
|
| 1395 |
|
| 1396 |
-
|
| 1397 |
-
|
| 1398 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1399 |
|
| 1400 |
-
|
| 1401 |
-
|
| 1402 |
-
|
| 1403 |
|
| 1404 |
-
|
| 1405 |
-
var getPrototypeOf = __webpack_require__(7);
|
| 1406 |
-
var getPrototypeOf_default = /*#__PURE__*/__webpack_require__.n(getPrototypeOf);
|
| 1407 |
|
| 1408 |
-
|
| 1409 |
-
|
| 1410 |
|
| 1411 |
-
|
| 1412 |
-
|
|
|
|
| 1413 |
|
| 1414 |
-
|
| 1415 |
-
|
|
|
|
|
|
|
|
|
|
| 1416 |
|
| 1417 |
-
|
| 1418 |
-
|
|
|
|
| 1419 |
|
| 1420 |
-
|
| 1421 |
-
var external_React_ = __webpack_require__(10);
|
| 1422 |
-
var external_React_default = /*#__PURE__*/__webpack_require__.n(external_React_);
|
| 1423 |
|
| 1424 |
-
|
| 1425 |
-
|
| 1426 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1427 |
|
| 1428 |
-
|
| 1429 |
-
var
|
|
|
|
|
|
|
| 1430 |
|
| 1431 |
-
|
| 1432 |
-
|
|
|
|
|
|
|
|
|
|
| 1433 |
|
| 1434 |
-
|
| 1435 |
-
|
|
|
|
|
|
|
|
|
|
| 1436 |
|
| 1437 |
-
|
| 1438 |
-
var
|
| 1439 |
|
| 1440 |
-
|
| 1441 |
-
|
| 1442 |
-
|
| 1443 |
|
| 1444 |
-
|
| 1445 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1446 |
|
| 1447 |
-
|
| 1448 |
-
|
|
|
|
|
|
|
|
|
|
| 1449 |
|
| 1450 |
-
|
| 1451 |
-
|
| 1452 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1453 |
|
| 1454 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1455 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1456 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1457 |
|
|
|
|
|
|
|
|
|
|
| 1458 |
|
|
|
|
|
|
|
|
|
|
| 1459 |
|
|
|
|
|
|
|
|
|
|
| 1460 |
|
|
|
|
| 1461 |
|
|
|
|
|
|
|
| 1462 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1463 |
|
|
|
|
| 1464 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1465 |
|
|
|
|
| 1466 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1467 |
|
| 1468 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1469 |
|
| 1470 |
-
|
| 1471 |
-
|
| 1472 |
-
|
| 1473 |
-
return context;
|
| 1474 |
-
};
|
| 1475 |
|
| 1476 |
-
|
| 1477 |
-
|
| 1478 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1479 |
|
| 1480 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1481 |
|
| 1482 |
-
var
|
| 1483 |
-
|
| 1484 |
-
|
| 1485 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1486 |
};
|
| 1487 |
|
| 1488 |
-
|
| 1489 |
-
|
| 1490 |
-
|
|
|
|
| 1491 |
|
| 1492 |
-
|
| 1493 |
-
|
| 1494 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1495 |
|
| 1496 |
-
|
| 1497 |
-
|
| 1498 |
-
|
| 1499 |
-
Object(inheritsLoose["a" /* default */])(Router, _React$Component);
|
| 1500 |
|
| 1501 |
-
|
| 1502 |
-
|
| 1503 |
-
|
| 1504 |
-
url: "/",
|
| 1505 |
-
params: {},
|
| 1506 |
-
isExact: pathname === "/"
|
| 1507 |
-
};
|
| 1508 |
-
};
|
| 1509 |
|
| 1510 |
-
|
| 1511 |
-
|
|
|
|
|
|
|
| 1512 |
|
| 1513 |
-
|
| 1514 |
-
|
| 1515 |
-
|
| 1516 |
-
|
| 1517 |
-
|
| 1518 |
-
|
| 1519 |
-
|
| 1520 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1521 |
|
| 1522 |
-
|
| 1523 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1524 |
|
| 1525 |
-
|
| 1526 |
-
|
| 1527 |
-
|
| 1528 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1529 |
location: location
|
| 1530 |
});
|
| 1531 |
} else {
|
| 1532 |
-
|
| 1533 |
}
|
| 1534 |
});
|
| 1535 |
}
|
| 1536 |
-
|
| 1537 |
-
return _this;
|
| 1538 |
}
|
| 1539 |
|
| 1540 |
-
|
|
|
|
|
|
|
|
|
|
| 1541 |
|
| 1542 |
-
|
| 1543 |
-
|
|
|
|
|
|
|
|
|
|
| 1544 |
|
| 1545 |
-
if (
|
| 1546 |
-
|
| 1547 |
-
|
| 1548 |
-
});
|
| 1549 |
}
|
| 1550 |
-
}
|
| 1551 |
-
|
| 1552 |
-
_proto.componentWillUnmount = function componentWillUnmount() {
|
| 1553 |
-
if (this.unlisten) this.unlisten();
|
| 1554 |
-
};
|
| 1555 |
-
|
| 1556 |
-
_proto.render = function render() {
|
| 1557 |
-
return external_React_default.a.createElement(react_router_context.Provider, {
|
| 1558 |
-
value: {
|
| 1559 |
-
history: this.props.history,
|
| 1560 |
-
location: this.state.location,
|
| 1561 |
-
match: Router.computeRootMatch(this.state.location.pathname),
|
| 1562 |
-
staticContext: this.props.staticContext
|
| 1563 |
-
}
|
| 1564 |
-
}, external_React_default.a.createElement(historyContext.Provider, {
|
| 1565 |
-
children: this.props.children || null,
|
| 1566 |
-
value: this.props.history
|
| 1567 |
-
}));
|
| 1568 |
-
};
|
| 1569 |
-
|
| 1570 |
-
return Router;
|
| 1571 |
-
}(external_React_default.a.Component);
|
| 1572 |
-
|
| 1573 |
-
if (false) {}
|
| 1574 |
|
| 1575 |
-
/**
|
| 1576 |
-
* The public API for a <Router> that stores location in memory.
|
| 1577 |
-
*/
|
| 1578 |
|
| 1579 |
-
var
|
| 1580 |
-
|
| 1581 |
-
|
| 1582 |
-
|
|
|
|
| 1583 |
|
| 1584 |
-
function
|
| 1585 |
-
var
|
|
|
|
| 1586 |
|
| 1587 |
-
|
| 1588 |
-
|
| 1589 |
}
|
| 1590 |
|
| 1591 |
-
|
| 1592 |
-
_this.history = Object(esm_history["c" /* createMemoryHistory */])(_this.props);
|
| 1593 |
-
return _this;
|
| 1594 |
}
|
| 1595 |
|
| 1596 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1597 |
|
| 1598 |
-
|
| 1599 |
-
|
| 1600 |
-
|
| 1601 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1602 |
});
|
| 1603 |
-
}
|
| 1604 |
|
| 1605 |
-
|
| 1606 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1607 |
|
| 1608 |
-
if (
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1609 |
|
| 1610 |
-
var
|
| 1611 |
-
|
| 1612 |
-
|
| 1613 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1614 |
|
| 1615 |
-
function
|
| 1616 |
-
|
|
|
|
| 1617 |
}
|
| 1618 |
|
| 1619 |
-
|
|
|
|
|
|
|
| 1620 |
|
| 1621 |
-
|
| 1622 |
-
|
| 1623 |
-
}
|
| 1624 |
|
| 1625 |
-
|
| 1626 |
-
if (this.props.onUpdate) this.props.onUpdate.call(this, this, prevProps);
|
| 1627 |
-
};
|
| 1628 |
|
| 1629 |
-
|
| 1630 |
-
|
| 1631 |
-
};
|
| 1632 |
|
| 1633 |
-
|
| 1634 |
-
|
| 1635 |
-
|
|
|
|
|
|
|
|
|
|
| 1636 |
|
| 1637 |
-
|
| 1638 |
-
}(external_React_default.a.Component);
|
| 1639 |
|
| 1640 |
-
|
| 1641 |
-
|
| 1642 |
-
|
|
|
|
| 1643 |
|
| 1644 |
-
|
| 1645 |
-
var message = _ref.message,
|
| 1646 |
-
_ref$when = _ref.when,
|
| 1647 |
-
when = _ref$when === void 0 ? true : _ref$when;
|
| 1648 |
-
return external_React_default.a.createElement(react_router_context.Consumer, null, function (context) {
|
| 1649 |
-
!context ? false ? undefined : Object(tiny_invariant_esm["a" /* default */])(false) : void 0;
|
| 1650 |
-
if (!when || context.staticContext) return null;
|
| 1651 |
-
var method = context.history.block;
|
| 1652 |
-
return external_React_default.a.createElement(react_router_Lifecycle, {
|
| 1653 |
-
onMount: function onMount(self) {
|
| 1654 |
-
self.release = method(message);
|
| 1655 |
-
},
|
| 1656 |
-
onUpdate: function onUpdate(self, prevProps) {
|
| 1657 |
-
if (prevProps.message !== message) {
|
| 1658 |
-
self.release();
|
| 1659 |
-
self.release = method(message);
|
| 1660 |
-
}
|
| 1661 |
-
},
|
| 1662 |
-
onUnmount: function onUnmount(self) {
|
| 1663 |
-
self.release();
|
| 1664 |
-
},
|
| 1665 |
-
message: message
|
| 1666 |
-
});
|
| 1667 |
-
});
|
| 1668 |
-
}
|
| 1669 |
|
| 1670 |
-
if (
|
|
|
|
|
|
|
|
|
|
| 1671 |
|
| 1672 |
-
|
| 1673 |
-
|
| 1674 |
-
|
|
|
|
|
|
|
| 1675 |
|
| 1676 |
-
|
| 1677 |
-
|
| 1678 |
-
|
| 1679 |
|
| 1680 |
-
|
| 1681 |
-
|
| 1682 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1683 |
}
|
| 1684 |
|
| 1685 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1686 |
}
|
| 1687 |
/**
|
| 1688 |
-
*
|
| 1689 |
*/
|
| 1690 |
|
| 1691 |
|
| 1692 |
-
function
|
| 1693 |
-
if (
|
| 1694 |
-
|
| 1695 |
}
|
| 1696 |
|
| 1697 |
-
|
| 1698 |
-
|
| 1699 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1700 |
|
| 1701 |
-
|
| 1702 |
-
|
| 1703 |
-
});
|
| 1704 |
-
}
|
| 1705 |
-
|
| 1706 |
-
/**
|
| 1707 |
-
* The public API for navigating programmatically with a component.
|
| 1708 |
-
*/
|
| 1709 |
|
| 1710 |
-
|
| 1711 |
-
|
| 1712 |
-
|
| 1713 |
-
_ref$push = _ref.push,
|
| 1714 |
-
push = _ref$push === void 0 ? false : _ref$push;
|
| 1715 |
-
return external_React_default.a.createElement(react_router_context.Consumer, null, function (context) {
|
| 1716 |
-
!context ? false ? undefined : Object(tiny_invariant_esm["a" /* default */])(false) : void 0;
|
| 1717 |
-
var history = context.history,
|
| 1718 |
-
staticContext = context.staticContext;
|
| 1719 |
-
var method = push ? history.push : history.replace;
|
| 1720 |
-
var location = Object(esm_history["b" /* createLocation */])(computedMatch ? typeof to === "string" ? generatePath(to, computedMatch.params) : Object(esm_extends["a" /* default */])({}, to, {
|
| 1721 |
-
pathname: generatePath(to.pathname, computedMatch.params)
|
| 1722 |
-
}) : to); // When rendering in a static context,
|
| 1723 |
-
// set the new location immediately.
|
| 1724 |
|
| 1725 |
-
|
| 1726 |
-
|
| 1727 |
-
|
| 1728 |
-
}
|
| 1729 |
|
| 1730 |
-
|
| 1731 |
-
|
| 1732 |
-
|
| 1733 |
-
|
| 1734 |
-
onUpdate: function onUpdate(self, prevProps) {
|
| 1735 |
-
var prevLocation = Object(esm_history["b" /* createLocation */])(prevProps.to);
|
| 1736 |
|
| 1737 |
-
|
| 1738 |
-
key: prevLocation.key
|
| 1739 |
-
}))) {
|
| 1740 |
-
method(location);
|
| 1741 |
-
}
|
| 1742 |
-
},
|
| 1743 |
-
to: to
|
| 1744 |
-
});
|
| 1745 |
-
});
|
| 1746 |
-
}
|
| 1747 |
|
| 1748 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1749 |
|
| 1750 |
-
|
| 1751 |
-
|
| 1752 |
-
|
|
|
|
|
|
|
| 1753 |
|
| 1754 |
-
|
| 1755 |
-
|
| 1756 |
-
|
| 1757 |
-
|
| 1758 |
-
|
| 1759 |
-
|
| 1760 |
-
|
| 1761 |
-
|
| 1762 |
-
keys: keys
|
| 1763 |
-
};
|
| 1764 |
|
| 1765 |
-
|
| 1766 |
-
|
| 1767 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1768 |
}
|
| 1769 |
|
| 1770 |
-
|
| 1771 |
-
|
| 1772 |
-
|
| 1773 |
-
|
| 1774 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1775 |
|
|
|
|
|
|
|
|
|
|
| 1776 |
|
| 1777 |
-
function
|
| 1778 |
-
|
| 1779 |
-
options = {};
|
| 1780 |
}
|
| 1781 |
|
| 1782 |
-
|
| 1783 |
-
|
| 1784 |
-
|
| 1785 |
-
};
|
| 1786 |
}
|
| 1787 |
|
| 1788 |
-
|
| 1789 |
-
|
| 1790 |
-
|
| 1791 |
-
|
| 1792 |
-
_options$strict = _options.strict,
|
| 1793 |
-
strict = _options$strict === void 0 ? false : _options$strict,
|
| 1794 |
-
_options$sensitive = _options.sensitive,
|
| 1795 |
-
sensitive = _options$sensitive === void 0 ? false : _options$sensitive;
|
| 1796 |
-
var paths = [].concat(path);
|
| 1797 |
-
return paths.reduce(function (matched, path) {
|
| 1798 |
-
if (!path && path !== "") return null;
|
| 1799 |
-
if (matched) return matched;
|
| 1800 |
|
| 1801 |
-
|
| 1802 |
-
|
| 1803 |
-
strict: strict,
|
| 1804 |
-
sensitive: sensitive
|
| 1805 |
-
}),
|
| 1806 |
-
regexp = _compilePath.regexp,
|
| 1807 |
-
keys = _compilePath.keys;
|
| 1808 |
|
| 1809 |
-
|
| 1810 |
-
|
| 1811 |
-
|
| 1812 |
-
values = match.slice(1);
|
| 1813 |
-
var isExact = pathname === url;
|
| 1814 |
-
if (exact && !isExact) return null;
|
| 1815 |
-
return {
|
| 1816 |
-
path: path,
|
| 1817 |
-
// the path used to match
|
| 1818 |
-
url: path === "/" && url === "" ? "/" : url,
|
| 1819 |
-
// the matched portion of the URL
|
| 1820 |
-
isExact: isExact,
|
| 1821 |
-
// whether or not we matched exactly
|
| 1822 |
-
params: keys.reduce(function (memo, key, index) {
|
| 1823 |
-
memo[key.name] = values[index];
|
| 1824 |
-
return memo;
|
| 1825 |
-
}, {})
|
| 1826 |
-
};
|
| 1827 |
-
}, null);
|
| 1828 |
-
}
|
| 1829 |
|
| 1830 |
-
|
| 1831 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1832 |
}
|
| 1833 |
|
| 1834 |
-
function evalChildrenDev(children, props, path) {
|
| 1835 |
-
var value = children(props);
|
| 1836 |
-
false ? undefined : void 0;
|
| 1837 |
-
return value || null;
|
| 1838 |
-
}
|
| 1839 |
-
/**
|
| 1840 |
-
* The public API for matching a single path and rendering.
|
| 1841 |
-
*/
|
| 1842 |
|
| 1843 |
|
| 1844 |
-
var react_router_Route =
|
| 1845 |
-
/*#__PURE__*/
|
| 1846 |
-
function (_React$Component) {
|
| 1847 |
-
Object(inheritsLoose["a" /* default */])(Route, _React$Component);
|
| 1848 |
|
| 1849 |
-
|
| 1850 |
-
return _React$Component.apply(this, arguments) || this;
|
| 1851 |
-
}
|
| 1852 |
|
| 1853 |
-
|
|
|
|
| 1854 |
|
| 1855 |
-
|
| 1856 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1857 |
|
| 1858 |
-
return external_React_default.a.createElement(react_router_context.Consumer, null, function (context$1) {
|
| 1859 |
-
!context$1 ? false ? undefined : Object(tiny_invariant_esm["a" /* default */])(false) : void 0;
|
| 1860 |
-
var location = _this.props.location || context$1.location;
|
| 1861 |
-
var match = _this.props.computedMatch ? _this.props.computedMatch // <Switch> already computed the match for us
|
| 1862 |
-
: _this.props.path ? matchPath(location.pathname, _this.props) : context$1.match;
|
| 1863 |
|
| 1864 |
-
var props = Object(esm_extends["a" /* default */])({}, context$1, {
|
| 1865 |
-
location: location,
|
| 1866 |
-
match: match
|
| 1867 |
-
});
|
| 1868 |
|
| 1869 |
-
var _this$props = _this.props,
|
| 1870 |
-
children = _this$props.children,
|
| 1871 |
-
component = _this$props.component,
|
| 1872 |
-
render = _this$props.render; // Preact uses an empty array as children by
|
| 1873 |
-
// default, so use null if that's the case.
|
| 1874 |
|
| 1875 |
-
if (Array.isArray(children) && children.length === 0) {
|
| 1876 |
-
children = null;
|
| 1877 |
-
}
|
| 1878 |
|
| 1879 |
-
return external_React_default.a.createElement(react_router_context.Provider, {
|
| 1880 |
-
value: props
|
| 1881 |
-
}, props.match ? children ? typeof children === "function" ? false ? undefined : children(props) : children : component ? external_React_default.a.createElement(component, props) : render ? render(props) : null : typeof children === "function" ? false ? undefined : children(props) : null);
|
| 1882 |
-
});
|
| 1883 |
-
};
|
| 1884 |
|
| 1885 |
-
return Route;
|
| 1886 |
-
}(external_React_default.a.Component);
|
| 1887 |
|
| 1888 |
-
if (false) {}
|
| 1889 |
|
| 1890 |
-
function
|
| 1891 |
-
return path.charAt(0) === "/" ? path : "/" + path;
|
| 1892 |
-
}
|
| 1893 |
|
| 1894 |
-
function
|
| 1895 |
-
if (!basename) return location;
|
| 1896 |
-
return Object(esm_extends["a" /* default */])({}, location, {
|
| 1897 |
-
pathname: addLeadingSlash(basename) + location.pathname
|
| 1898 |
-
});
|
| 1899 |
-
}
|
| 1900 |
|
| 1901 |
-
|
| 1902 |
-
|
| 1903 |
-
|
| 1904 |
-
if (location.pathname.indexOf(base) !== 0) return location;
|
| 1905 |
-
return Object(esm_extends["a" /* default */])({}, location, {
|
| 1906 |
-
pathname: location.pathname.substr(base.length)
|
| 1907 |
-
});
|
| 1908 |
-
}
|
| 1909 |
|
| 1910 |
-
function createURL(location) {
|
| 1911 |
-
return typeof location === "string" ? location : Object(esm_history["d" /* createPath */])(location);
|
| 1912 |
-
}
|
| 1913 |
|
| 1914 |
-
function staticHandler(methodName) {
|
| 1915 |
-
return function () {
|
| 1916 |
-
false ? undefined : Object(tiny_invariant_esm["a" /* default */])(false) ;
|
| 1917 |
-
};
|
| 1918 |
-
}
|
| 1919 |
|
| 1920 |
-
function noop() {}
|
| 1921 |
-
/**
|
| 1922 |
-
* The public top-level API for a "static" <Router>, so-called because it
|
| 1923 |
-
* can't actually change the current location. Instead, it just records
|
| 1924 |
-
* location changes in a context object. Useful mainly in testing and
|
| 1925 |
-
* server-rendering scenarios.
|
| 1926 |
-
*/
|
| 1927 |
|
|
|
|
|
|
|
|
|
|
| 1928 |
|
| 1929 |
-
var
|
| 1930 |
-
/*#__PURE__*/
|
| 1931 |
-
function (_React$Component) {
|
| 1932 |
-
Object(inheritsLoose["a" /* default */])(StaticRouter, _React$Component);
|
| 1933 |
|
| 1934 |
-
|
| 1935 |
-
|
| 1936 |
|
| 1937 |
-
|
| 1938 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1939 |
}
|
| 1940 |
|
| 1941 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1942 |
|
| 1943 |
-
|
| 1944 |
-
return _this.navigateTo(location, "PUSH");
|
| 1945 |
-
};
|
| 1946 |
|
| 1947 |
-
|
| 1948 |
-
|
| 1949 |
-
|
| 1950 |
|
| 1951 |
-
|
| 1952 |
-
|
| 1953 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1954 |
|
| 1955 |
-
|
| 1956 |
-
|
| 1957 |
-
|
|
|
|
|
|
|
| 1958 |
|
| 1959 |
-
|
| 1960 |
-
}
|
| 1961 |
|
| 1962 |
-
|
|
|
|
| 1963 |
|
| 1964 |
-
|
| 1965 |
-
|
| 1966 |
-
|
| 1967 |
-
|
| 1968 |
-
|
| 1969 |
-
|
| 1970 |
-
context.action = action;
|
| 1971 |
-
context.location = addBasename(basename, Object(esm_history["b" /* createLocation */])(location));
|
| 1972 |
-
context.url = createURL(context.location);
|
| 1973 |
-
};
|
| 1974 |
|
| 1975 |
-
|
| 1976 |
-
|
| 1977 |
-
_this$props2$basename = _this$props2.basename,
|
| 1978 |
-
basename = _this$props2$basename === void 0 ? "" : _this$props2$basename,
|
| 1979 |
-
_this$props2$context = _this$props2.context,
|
| 1980 |
-
context = _this$props2$context === void 0 ? {} : _this$props2$context,
|
| 1981 |
-
_this$props2$location = _this$props2.location,
|
| 1982 |
-
location = _this$props2$location === void 0 ? "/" : _this$props2$location,
|
| 1983 |
-
rest = Object(objectWithoutPropertiesLoose["a" /* default */])(_this$props2, ["basename", "context", "location"]);
|
| 1984 |
|
| 1985 |
-
|
| 1986 |
-
createHref: function createHref(path) {
|
| 1987 |
-
return addLeadingSlash(basename + createURL(path));
|
| 1988 |
-
},
|
| 1989 |
-
action: "POP",
|
| 1990 |
-
location: stripBasename(basename, Object(esm_history["b" /* createLocation */])(location)),
|
| 1991 |
-
push: this.handlePush,
|
| 1992 |
-
replace: this.handleReplace,
|
| 1993 |
-
go: staticHandler("go"),
|
| 1994 |
-
goBack: staticHandler("goBack"),
|
| 1995 |
-
goForward: staticHandler("goForward"),
|
| 1996 |
-
listen: this.handleListen,
|
| 1997 |
-
block: this.handleBlock
|
| 1998 |
-
};
|
| 1999 |
-
return external_React_default.a.createElement(react_router_Router, Object(esm_extends["a" /* default */])({}, rest, {
|
| 2000 |
-
history: history,
|
| 2001 |
-
staticContext: context
|
| 2002 |
-
}));
|
| 2003 |
-
};
|
| 2004 |
|
| 2005 |
-
|
| 2006 |
-
|
| 2007 |
|
| 2008 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2009 |
|
| 2010 |
-
/**
|
| 2011 |
-
* The public API for rendering the first <Route> that matches.
|
| 2012 |
-
*/
|
| 2013 |
|
| 2014 |
-
var react_router_Switch =
|
| 2015 |
-
/*#__PURE__*/
|
| 2016 |
-
function (_React$Component) {
|
| 2017 |
-
Object(inheritsLoose["a" /* default */])(Switch, _React$Component);
|
| 2018 |
|
| 2019 |
-
function Switch() {
|
| 2020 |
-
return _React$Component.apply(this, arguments) || this;
|
| 2021 |
-
}
|
| 2022 |
|
| 2023 |
-
var _proto = Switch.prototype;
|
| 2024 |
|
| 2025 |
-
_proto.render = function render() {
|
| 2026 |
-
var _this = this;
|
| 2027 |
|
| 2028 |
-
return external_React_default.a.createElement(react_router_context.Consumer, null, function (context) {
|
| 2029 |
-
!context ? false ? undefined : Object(tiny_invariant_esm["a" /* default */])(false) : void 0;
|
| 2030 |
-
var location = _this.props.location || context.location;
|
| 2031 |
-
var element, match; // We use React.Children.forEach instead of React.Children.toArray().find()
|
| 2032 |
-
// here because toArray adds keys to all child elements and we do not want
|
| 2033 |
-
// to trigger an unmount/remount for two <Route>s that render the same
|
| 2034 |
-
// component at different URLs.
|
| 2035 |
|
| 2036 |
-
external_React_default.a.Children.forEach(_this.props.children, function (child) {
|
| 2037 |
-
if (match == null && external_React_default.a.isValidElement(child)) {
|
| 2038 |
-
element = child;
|
| 2039 |
-
var path = child.props.path || child.props.from;
|
| 2040 |
-
match = path ? matchPath(location.pathname, Object(esm_extends["a" /* default */])({}, child.props, {
|
| 2041 |
-
path: path
|
| 2042 |
-
})) : context.match;
|
| 2043 |
-
}
|
| 2044 |
-
});
|
| 2045 |
-
return match ? external_React_default.a.cloneElement(element, {
|
| 2046 |
-
location: location,
|
| 2047 |
-
computedMatch: match
|
| 2048 |
-
}) : null;
|
| 2049 |
-
});
|
| 2050 |
-
};
|
| 2051 |
|
| 2052 |
-
return Switch;
|
| 2053 |
-
}(external_React_default.a.Component);
|
| 2054 |
|
| 2055 |
-
if (
|
|
|
|
|
|
|
| 2056 |
|
| 2057 |
/**
|
| 2058 |
-
*
|
| 2059 |
*/
|
| 2060 |
|
| 2061 |
-
|
| 2062 |
-
|
|
|
|
| 2063 |
|
| 2064 |
-
var C = function C(props) {
|
| 2065 |
-
var wrappedComponentRef = props.wrappedComponentRef,
|
| 2066 |
-
remainingProps = Object(objectWithoutPropertiesLoose["a" /* default */])(props, ["wrappedComponentRef"]);
|
| 2067 |
|
| 2068 |
-
return external_React_default.a.createElement(react_router_context.Consumer, null, function (context) {
|
| 2069 |
-
!context ? false ? undefined : Object(tiny_invariant_esm["a" /* default */])(false) : void 0;
|
| 2070 |
-
return external_React_default.a.createElement(Component, Object(esm_extends["a" /* default */])({}, remainingProps, context, {
|
| 2071 |
-
ref: wrappedComponentRef
|
| 2072 |
-
}));
|
| 2073 |
-
});
|
| 2074 |
-
};
|
| 2075 |
|
| 2076 |
-
|
| 2077 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2078 |
|
| 2079 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2080 |
|
| 2081 |
-
|
| 2082 |
-
|
|
|
|
|
|
|
|
|
|
| 2083 |
|
| 2084 |
-
|
| 2085 |
-
|
| 2086 |
-
|
| 2087 |
|
| 2088 |
-
return
|
| 2089 |
}
|
| 2090 |
-
function useLocation() {
|
| 2091 |
-
if (false) {}
|
| 2092 |
|
| 2093 |
-
|
| 2094 |
-
|
| 2095 |
-
|
| 2096 |
-
if (false) {}
|
| 2097 |
|
| 2098 |
-
|
| 2099 |
-
return match ? match.params : {};
|
| 2100 |
-
}
|
| 2101 |
-
function useRouteMatch(path) {
|
| 2102 |
-
if (false) {}
|
| 2103 |
|
| 2104 |
-
|
| 2105 |
-
|
| 2106 |
-
return path ? matchPath(location.pathname, path) : match;
|
| 2107 |
-
}
|
| 2108 |
|
| 2109 |
-
|
| 2110 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2111 |
|
| 2112 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2113 |
|
| 2114 |
-
//
|
| 2115 |
-
|
|
|
|
| 2116 |
|
| 2117 |
-
|
| 2118 |
-
|
|
|
|
| 2119 |
|
| 2120 |
-
|
| 2121 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2122 |
|
| 2123 |
-
|
| 2124 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2125 |
|
| 2126 |
-
|
| 2127 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2128 |
|
| 2129 |
-
|
| 2130 |
-
|
|
|
|
|
|
|
| 2131 |
|
| 2132 |
-
|
| 2133 |
-
var external_this_wc_tracks_ = __webpack_require__(27);
|
| 2134 |
|
| 2135 |
-
|
| 2136 |
-
|
| 2137 |
|
| 2138 |
-
|
| 2139 |
-
var
|
|
|
|
|
|
|
|
|
|
| 2140 |
|
| 2141 |
-
// EXTERNAL MODULE: external {"this":["wp","i18n"]}
|
| 2142 |
-
var external_this_wp_i18n_ = __webpack_require__(2);
|
| 2143 |
|
| 2144 |
-
// EXTERNAL MODULE: ./client/analytics/report/get-reports.js
|
| 2145 |
-
var get_reports = __webpack_require__(137);
|
| 2146 |
|
| 2147 |
-
// EXTERNAL MODULE: ./client/dashboard/utils.js
|
| 2148 |
-
var utils = __webpack_require__(95);
|
| 2149 |
|
| 2150 |
-
|
|
|
|
|
|
|
| 2151 |
|
| 2152 |
|
|
|
|
|
|
|
|
|
|
| 2153 |
|
|
|
|
|
|
|
|
|
|
| 2154 |
|
|
|
|
|
|
|
| 2155 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2156 |
|
|
|
|
| 2157 |
|
| 2158 |
-
|
|
|
|
| 2159 |
|
| 2160 |
-
|
| 2161 |
|
| 2162 |
-
|
| 2163 |
-
* External dependencies
|
| 2164 |
-
*/
|
| 2165 |
|
|
|
|
|
|
|
| 2166 |
|
|
|
|
|
|
|
| 2167 |
|
|
|
|
|
|
|
| 2168 |
|
|
|
|
|
|
|
| 2169 |
|
|
|
|
|
|
|
| 2170 |
|
|
|
|
|
|
|
| 2171 |
|
|
|
|
|
|
|
| 2172 |
|
| 2173 |
-
|
| 2174 |
-
|
| 2175 |
-
*/
|
| 2176 |
|
|
|
|
|
|
|
| 2177 |
|
|
|
|
|
|
|
| 2178 |
|
| 2179 |
-
|
| 2180 |
-
return __webpack_require__.e(/* import() | analytics-report */ 9).then(__webpack_require__.bind(null, 589));
|
| 2181 |
-
});
|
| 2182 |
-
var AnalyticsSettings = Object(external_this_wp_element_["lazy"])(function () {
|
| 2183 |
-
return __webpack_require__.e(/* import() | analytics-settings */ 20).then(__webpack_require__.bind(null, 608));
|
| 2184 |
-
});
|
| 2185 |
-
var Dashboard = Object(external_this_wp_element_["lazy"])(function () {
|
| 2186 |
-
return __webpack_require__.e(/* import() | dashboard */ 28).then(__webpack_require__.bind(null, 590));
|
| 2187 |
-
});
|
| 2188 |
-
var Homescreen = Object(external_this_wp_element_["lazy"])(function () {
|
| 2189 |
-
return Promise.all(/* import() | homescreen */[__webpack_require__.e(1), __webpack_require__.e(2), __webpack_require__.e(52), __webpack_require__.e(4), __webpack_require__.e(32)]).then(__webpack_require__.bind(null, 605));
|
| 2190 |
-
});
|
| 2191 |
-
var MarketingOverview = Object(external_this_wp_element_["lazy"])(function () {
|
| 2192 |
-
return Promise.all(/* import() | marketing-overview */[__webpack_require__.e(2), __webpack_require__.e(36)]).then(__webpack_require__.bind(null, 609));
|
| 2193 |
-
});
|
| 2194 |
-
var ProfileWizard = Object(external_this_wp_element_["lazy"])(function () {
|
| 2195 |
-
return Promise.all(/* import() | profile-wizard */[__webpack_require__.e(53), __webpack_require__.e(46)]).then(__webpack_require__.bind(null, 606));
|
| 2196 |
-
});
|
| 2197 |
-
var SettingsGroup = Object(external_this_wp_element_["lazy"])(function () {
|
| 2198 |
-
return Promise.all(/* import() | profile-wizard */[__webpack_require__.e(53), __webpack_require__.e(46)]).then(__webpack_require__.bind(null, 601));
|
| 2199 |
-
});
|
| 2200 |
-
var PAGES_FILTER = 'woocommerce_admin_pages_list';
|
| 2201 |
-
var controller_getPages = function getPages() {
|
| 2202 |
-
var pages = [];
|
| 2203 |
-
var initialBreadcrumbs = [['', wcSettings.woocommerceTranslation]];
|
| 2204 |
-
pages.push({
|
| 2205 |
-
container: Homescreen,
|
| 2206 |
-
path: '/',
|
| 2207 |
-
breadcrumbs: [].concat(initialBreadcrumbs, [Object(external_this_wp_i18n_["__"])('Home', 'woocommerce-admin')]),
|
| 2208 |
-
wpOpenMenu: 'toplevel_page_woocommerce',
|
| 2209 |
-
navArgs: {
|
| 2210 |
-
id: 'woocommerce-home'
|
| 2211 |
-
},
|
| 2212 |
-
capability: 'manage_woocommerce'
|
| 2213 |
-
});
|
| 2214 |
|
| 2215 |
-
if (window.wcAdminFeatures.analytics) {
|
| 2216 |
-
pages.push({
|
| 2217 |
-
container: Dashboard,
|
| 2218 |
-
path: '/analytics/overview',
|
| 2219 |
-
breadcrumbs: [].concat(initialBreadcrumbs, [['/analytics/overview', Object(external_this_wp_i18n_["__"])('Analytics', 'woocommerce-admin')], Object(external_this_wp_i18n_["__"])('Overview', 'woocommerce-admin')]),
|
| 2220 |
-
wpOpenMenu: 'toplevel_page_wc-admin-path--analytics-overview',
|
| 2221 |
-
navArgs: {
|
| 2222 |
-
id: 'woocommerce-analytics-overview'
|
| 2223 |
-
},
|
| 2224 |
-
capability: 'view_woocommerce_reports'
|
| 2225 |
-
});
|
| 2226 |
-
pages.push({
|
| 2227 |
-
container: AnalyticsSettings,
|
| 2228 |
-
path: '/analytics/settings',
|
| 2229 |
-
breadcrumbs: [].concat(initialBreadcrumbs, [['/analytics/revenue', Object(external_this_wp_i18n_["__"])('Analytics', 'woocommerce-admin')], Object(external_this_wp_i18n_["__"])('Settings', 'woocommerce-admin')]),
|
| 2230 |
-
wpOpenMenu: 'toplevel_page_wc-admin-path--analytics-overview',
|
| 2231 |
-
navArgs: {
|
| 2232 |
-
id: 'woocommerce-analytics-settings'
|
| 2233 |
-
},
|
| 2234 |
-
capability: 'view_woocommerce_reports'
|
| 2235 |
-
});
|
| 2236 |
-
pages.push({
|
| 2237 |
-
container: AnalyticsReport,
|
| 2238 |
-
path: '/customers',
|
| 2239 |
-
breadcrumbs: [].concat(initialBreadcrumbs, [Object(external_this_wp_i18n_["__"])('Customers', 'woocommerce-admin')]),
|
| 2240 |
-
wpOpenMenu: 'toplevel_page_woocommerce',
|
| 2241 |
-
navArgs: {
|
| 2242 |
-
id: 'woocommerce-analytics-customers'
|
| 2243 |
-
},
|
| 2244 |
-
capability: 'view_woocommerce_reports'
|
| 2245 |
-
});
|
| 2246 |
-
pages.push({
|
| 2247 |
-
container: AnalyticsReport,
|
| 2248 |
-
path: '/analytics/:report',
|
| 2249 |
-
breadcrumbs: function breadcrumbs(_ref) {
|
| 2250 |
-
var match = _ref.match;
|
| 2251 |
-
var report = Object(external_lodash_["find"])(Object(get_reports["a" /* default */])(), {
|
| 2252 |
-
report: match.params.report
|
| 2253 |
-
});
|
| 2254 |
|
| 2255 |
-
if (!report) {
|
| 2256 |
-
return [];
|
| 2257 |
-
}
|
| 2258 |
|
| 2259 |
-
return [].concat(initialBreadcrumbs, [['/analytics/revenue', Object(external_this_wp_i18n_["__"])('Analytics', 'woocommerce-admin')], report.title]);
|
| 2260 |
-
},
|
| 2261 |
-
wpOpenMenu: 'toplevel_page_wc-admin-path--analytics-overview',
|
| 2262 |
-
capability: 'view_woocommerce_reports'
|
| 2263 |
-
});
|
| 2264 |
-
}
|
| 2265 |
|
| 2266 |
-
if (window.wcAdminFeatures.marketing) {
|
| 2267 |
-
pages.push({
|
| 2268 |
-
container: MarketingOverview,
|
| 2269 |
-
path: '/marketing',
|
| 2270 |
-
breadcrumbs: [].concat(initialBreadcrumbs, [['/marketing', Object(external_this_wp_i18n_["__"])('Marketing', 'woocommerce-admin')], Object(external_this_wp_i18n_["__"])('Overview', 'woocommerce-admin')]),
|
| 2271 |
-
wpOpenMenu: 'toplevel_page_woocommerce-marketing',
|
| 2272 |
-
navArgs: {
|
| 2273 |
-
id: 'woocommerce-marketing-overview'
|
| 2274 |
-
},
|
| 2275 |
-
capability: 'view_woocommerce_reports'
|
| 2276 |
-
});
|
| 2277 |
-
}
|
| 2278 |
|
| 2279 |
-
if (window.wcAdminFeatures.onboarding) {
|
| 2280 |
-
pages.push({
|
| 2281 |
-
container: ProfileWizard,
|
| 2282 |
-
path: '/setup-wizard',
|
| 2283 |
-
breadcrumbs: [].concat(initialBreadcrumbs, [['/setup-wizard', Object(external_this_wp_i18n_["__"])('Setup Wizard', 'woocommerce-admin')]]),
|
| 2284 |
-
capability: 'manage_woocommerce'
|
| 2285 |
-
});
|
| 2286 |
-
}
|
| 2287 |
|
| 2288 |
-
if (window.wcAdminFeatures.settings) {
|
| 2289 |
-
pages.push({
|
| 2290 |
-
container: SettingsGroup,
|
| 2291 |
-
path: '/settings/:page',
|
| 2292 |
-
breadcrumbs: function breadcrumbs(_ref2) {
|
| 2293 |
-
var match = _ref2.match;
|
| 2294 |
-
// @todo This might need to be refactored to retreive groups via data store.
|
| 2295 |
-
var settingsPages = Object(wc_admin_settings["g" /* getSetting */])('settingsPages');
|
| 2296 |
-
var page = settingsPages[match.params.page];
|
| 2297 |
-
|
| 2298 |
-
if (!page) {
|
| 2299 |
-
return [];
|
| 2300 |
-
}
|
| 2301 |
|
| 2302 |
-
return [].concat(initialBreadcrumbs, [[settingsPages.general ? '/settings/general' : "/settings/".concat(Object.keys(settingsPages)[0]), Object(external_this_wp_i18n_["__"])('Settings', 'woocommerce-admin')], page]);
|
| 2303 |
-
},
|
| 2304 |
-
wpOpenMenu: 'toplevel_page_woocommerce',
|
| 2305 |
-
capability: 'manage_woocommerce'
|
| 2306 |
-
});
|
| 2307 |
-
}
|
| 2308 |
|
| 2309 |
-
return Object(external_this_wp_hooks_["applyFilters"])(PAGES_FILTER, pages);
|
| 2310 |
-
};
|
| 2311 |
-
var controller_Controller = /*#__PURE__*/function (_Component) {
|
| 2312 |
-
inherits_default()(Controller, _Component);
|
| 2313 |
|
| 2314 |
-
|
| 2315 |
|
| 2316 |
-
|
| 2317 |
-
classCallCheck_default()(this, Controller);
|
| 2318 |
|
| 2319 |
-
|
| 2320 |
-
|
|
|
|
| 2321 |
|
| 2322 |
-
|
| 2323 |
-
|
| 2324 |
-
|
| 2325 |
-
window.document.documentElement.scrollTop = 0;
|
| 2326 |
-
window.document.body.classList.remove('woocommerce-admin-is-loading');
|
| 2327 |
-
}
|
| 2328 |
-
}, {
|
| 2329 |
-
key: "componentDidUpdate",
|
| 2330 |
-
value: function componentDidUpdate(prevProps) {
|
| 2331 |
-
var prevBaseQuery = Object(external_lodash_["omit"])(prevProps.query, 'chartType', 'filter', 'paged');
|
| 2332 |
-
var baseQuery = Object(external_lodash_["omit"])(this.props.query, 'chartType', 'filter', 'paged');
|
| 2333 |
|
| 2334 |
-
if (prevProps.query.paged > 1 && !Object(external_lodash_["isEqual"])(prevBaseQuery, baseQuery)) {
|
| 2335 |
-
Object(external_this_wc_navigation_["getHistory"])().replace(Object(external_this_wc_navigation_["getNewPath"])({
|
| 2336 |
-
paged: 1
|
| 2337 |
-
}));
|
| 2338 |
-
}
|
| 2339 |
|
| 2340 |
-
if (prevProps.match.url !== this.props.match.url) {
|
| 2341 |
-
window.document.documentElement.scrollTop = 0;
|
| 2342 |
-
}
|
| 2343 |
-
}
|
| 2344 |
-
}, {
|
| 2345 |
-
key: "render",
|
| 2346 |
-
value: function render() {
|
| 2347 |
-
var _this$props = this.props,
|
| 2348 |
-
page = _this$props.page,
|
| 2349 |
-
match = _this$props.match,
|
| 2350 |
-
query = _this$props.query;
|
| 2351 |
-
var url = match.url,
|
| 2352 |
-
params = match.params;
|
| 2353 |
-
window.wpNavMenuUrlUpdate(query);
|
| 2354 |
-
window.wpNavMenuClassChange(page, url);
|
| 2355 |
-
return Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Suspense"], {
|
| 2356 |
-
fallback: Object(external_this_wp_element_["createElement"])(external_this_wc_components_["Spinner"], null)
|
| 2357 |
-
}, Object(external_this_wp_element_["createElement"])(page.container, {
|
| 2358 |
-
params: params,
|
| 2359 |
-
path: url,
|
| 2360 |
-
pathMatch: page.path,
|
| 2361 |
-
query: query
|
| 2362 |
-
}));
|
| 2363 |
-
}
|
| 2364 |
-
}]);
|
| 2365 |
|
| 2366 |
-
|
| 2367 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2368 |
/**
|
| 2369 |
-
*
|
| 2370 |
-
*
|
| 2371 |
*
|
| 2372 |
-
* @
|
| 2373 |
-
* @param {Object} nextQuery - A query object to be added to updated hrefs.
|
| 2374 |
-
* @param {Array} excludedScreens - wc-admin screens to avoid updating.
|
| 2375 |
*/
|
| 2376 |
|
| 2377 |
-
|
| 2378 |
-
if (Object(utils["f" /* isWCAdmin */])(item.href)) {
|
| 2379 |
-
var search = Object(external_lodash_["last"])(item.href.split('?'));
|
| 2380 |
-
var query = Object(lib["parse"])(search);
|
| 2381 |
-
var path = query.path || 'homescreen';
|
| 2382 |
-
var screen = Object(external_this_wc_navigation_["getScreenFromPath"])(path);
|
| 2383 |
-
var isExcludedScreen = excludedScreens.includes(screen);
|
| 2384 |
-
var href = 'admin.php?' + Object(lib["stringify"])(Object.assign(query, isExcludedScreen ? {} : nextQuery)); // Replace the href so you can see the url on hover.
|
| 2385 |
-
|
| 2386 |
-
item.href = href;
|
| 2387 |
|
| 2388 |
-
|
| 2389 |
-
|
| 2390 |
-
Object(external_this_wc_navigation_["getHistory"])().push(href);
|
| 2391 |
-
};
|
| 2392 |
-
}
|
| 2393 |
-
} // Update's wc-admin links in wp-admin menu
|
| 2394 |
|
| 2395 |
-
|
| 2396 |
-
var nextQuery = Object(external_this_wc_navigation_["getPersistedQuery"])(query);
|
| 2397 |
-
var excludedScreens = Object(external_this_wc_navigation_["getQueryExcludedScreens"])();
|
| 2398 |
-
Array.from(document.querySelectorAll('#adminmenu a')).forEach(function (item) {
|
| 2399 |
-
return updateLinkHref(item, nextQuery, excludedScreens);
|
| 2400 |
-
});
|
| 2401 |
-
}; // When the route changes, we need to update wp-admin's menu with the correct section & current link
|
| 2402 |
|
|
|
|
|
|
|
| 2403 |
|
| 2404 |
-
|
| 2405 |
-
Array.from(document.getElementsByClassName('current')).forEach(function (item) {
|
| 2406 |
-
item.classList.remove('current');
|
| 2407 |
-
});
|
| 2408 |
-
var submenu = Array.from(document.querySelectorAll('.wp-has-current-submenu'));
|
| 2409 |
-
submenu.forEach(function (element) {
|
| 2410 |
-
element.classList.remove('wp-has-current-submenu');
|
| 2411 |
-
element.classList.remove('wp-menu-open');
|
| 2412 |
-
element.classList.remove('selected');
|
| 2413 |
-
element.classList.add('wp-not-current-submenu');
|
| 2414 |
-
element.classList.add('menu-top');
|
| 2415 |
-
});
|
| 2416 |
-
var pageUrl = url === '/' ? 'admin.php?page=wc-admin' : 'admin.php?page=wc-admin&path=' + encodeURIComponent(url);
|
| 2417 |
-
var currentItemsSelector = url === '/' ? "li > a[href$=\"".concat(pageUrl, "\"], li > a[href*=\"").concat(pageUrl, "?\"]") : "li > a[href*=\"".concat(pageUrl, "\"]");
|
| 2418 |
-
var currentItems = document.querySelectorAll(currentItemsSelector);
|
| 2419 |
-
Array.from(currentItems).forEach(function (item) {
|
| 2420 |
-
item.parentElement.classList.add('current');
|
| 2421 |
-
});
|
| 2422 |
|
| 2423 |
-
|
| 2424 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2425 |
|
| 2426 |
-
|
| 2427 |
-
|
| 2428 |
-
|
| 2429 |
-
|
| 2430 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2431 |
}
|
| 2432 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2433 |
|
| 2434 |
-
|
| 2435 |
-
|
| 2436 |
-
};
|
| 2437 |
-
// EXTERNAL MODULE: ./node_modules/classnames/index.js
|
| 2438 |
-
var classnames = __webpack_require__(6);
|
| 2439 |
-
var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
|
| 2440 |
|
| 2441 |
-
|
| 2442 |
-
var external_this_wp_htmlEntities_ = __webpack_require__(41);
|
| 2443 |
|
| 2444 |
-
|
| 2445 |
-
|
| 2446 |
|
| 2447 |
-
// EXTERNAL MODULE: ./client/header/style.scss
|
| 2448 |
-
var header_style = __webpack_require__(299);
|
| 2449 |
|
| 2450 |
-
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/slicedToArray.js
|
| 2451 |
-
var slicedToArray = __webpack_require__(18);
|
| 2452 |
-
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
|
| 2453 |
|
| 2454 |
-
// EXTERNAL MODULE: external {"this":["wp","components"]}
|
| 2455 |
-
var external_this_wp_components_ = __webpack_require__(4);
|
| 2456 |
|
| 2457 |
-
// EXTERNAL MODULE: ./node_modules/gridicons/dist/cross-small.js
|
| 2458 |
-
var cross_small = __webpack_require__(122);
|
| 2459 |
-
var cross_small_default = /*#__PURE__*/__webpack_require__.n(cross_small);
|
| 2460 |
|
| 2461 |
-
// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/icon/index.js
|
| 2462 |
-
var build_module_icon = __webpack_require__(198);
|
| 2463 |
|
| 2464 |
-
// EXTERNAL MODULE: ./node_modules/@wordpress/primitives/build-module/svg/index.js
|
| 2465 |
-
var svg = __webpack_require__(67);
|
| 2466 |
|
| 2467 |
-
// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/inbox.js
|
| 2468 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2469 |
|
| 2470 |
/**
|
| 2471 |
* WordPress dependencies
|
| 2472 |
*/
|
| 2473 |
|
| 2474 |
-
var inbox_inbox = Object(external_this_wp_element_["createElement"])(svg["b" /* SVG */], {
|
| 2475 |
-
xmlns: "http://www.w3.org/2000/svg",
|
| 2476 |
-
viewBox: "0 0 24 24"
|
| 2477 |
-
}, Object(external_this_wp_element_["createElement"])(svg["a" /* Path */], {
|
| 2478 |
-
fillRule: "evenodd",
|
| 2479 |
-
d: "M6 5.5h12a.5.5 0 01.5.5v7H14a2 2 0 11-4 0H5.5V6a.5.5 0 01.5-.5zm-.5 9V18a.5.5 0 00.5.5h12a.5.5 0 00.5-.5v-3.5h-3.337a3.5 3.5 0 01-6.326 0H5.5zM4 13V6a2 2 0 012-2h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2v-5z",
|
| 2480 |
-
clipRule: "evenodd"
|
| 2481 |
-
}));
|
| 2482 |
-
/* harmony default export */ var library_inbox = (inbox_inbox);
|
| 2483 |
-
//# sourceMappingURL=inbox.js.map
|
| 2484 |
-
// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/help.js
|
| 2485 |
|
| 2486 |
|
| 2487 |
/**
|
| 2488 |
-
*
|
| 2489 |
*/
|
| 2490 |
|
| 2491 |
-
var help_help = Object(external_this_wp_element_["createElement"])(svg["b" /* SVG */], {
|
| 2492 |
-
xmlns: "http://www.w3.org/2000/svg",
|
| 2493 |
-
viewBox: "0 0 24 24"
|
| 2494 |
-
}, Object(external_this_wp_element_["createElement"])(svg["a" /* Path */], {
|
| 2495 |
-
d: "M12 4.75a7.25 7.25 0 100 14.5 7.25 7.25 0 000-14.5zM3.25 12a8.75 8.75 0 1117.5 0 8.75 8.75 0 01-17.5 0zM12 8.75a1.5 1.5 0 01.167 2.99c-.465.052-.917.44-.917 1.01V14h1.5v-.845A3 3 0 109 10.25h1.5a1.5 1.5 0 011.5-1.5zM11.25 15v1.5h1.5V15h-1.5z"
|
| 2496 |
-
}));
|
| 2497 |
-
/* harmony default export */ var library_help = (help_help);
|
| 2498 |
-
//# sourceMappingURL=help.js.map
|
| 2499 |
-
// EXTERNAL MODULE: ./client/header/activity-panel/style.scss
|
| 2500 |
-
var activity_panel_style = __webpack_require__(300);
|
| 2501 |
-
|
| 2502 |
-
// CONCATENATED MODULE: ./client/header/activity-panel/toggle-bubble.js
|
| 2503 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2504 |
|
|
|
|
|
|
|
|
|
|
| 2505 |
/**
|
| 2506 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2507 |
*/
|
| 2508 |
|
| 2509 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2510 |
|
| 2511 |
-
var
|
| 2512 |
-
|
| 2513 |
-
|
| 2514 |
-
|
| 2515 |
-
|
| 2516 |
-
_ref$hasUnread = _ref.hasUnread,
|
| 2517 |
-
hasUnread = _ref$hasUnread === void 0 ? false : _ref$hasUnread;
|
| 2518 |
-
var classes = classnames_default()('woocommerce-layout__activity-panel-toggle-bubble', {
|
| 2519 |
-
'has-unread': hasUnread
|
| 2520 |
-
});
|
| 2521 |
-
/* eslint-disable max-len */
|
| 2522 |
|
| 2523 |
-
|
| 2524 |
-
className: classes
|
| 2525 |
-
}, Object(external_this_wp_element_["createElement"])("svg", {
|
| 2526 |
-
height: height,
|
| 2527 |
-
width: width,
|
| 2528 |
-
viewBox: "0 0 24 24"
|
| 2529 |
-
}, Object(external_this_wp_element_["createElement"])("path", {
|
| 2530 |
-
d: "M18.9 2H5.1C3.4 2 2 3.4 2 5.1v10.7C2 17.6 3.4 19 5.1 19H9l6 3-1-3h4.9c1.7 0 3.1-1.4 3.1-3.1V5.1C22 3.4 20.6 2 18.9 2zm-1.5 4.5c-.4.8-.8 2.1-1 3.9-.3 1.8-.4 3.1-.3 4.1 0 .3 0 .5-.1.7-.1.2-.3.4-.6.4s-.6-.1-.9-.4c-1-1-1.8-2.6-2.4-4.6-.7 1.4-1.2 2.4-1.6 3.1-.6 1.2-1.2 1.8-1.6 1.9-.3 0-.5-.2-.8-.7-.5-1.4-1.1-4.2-1.7-8.2 0-.3 0-.5.2-.7.1-.2.4-.3.7-.4.5 0 .9.2.9.8.3 2.3.7 4.2 1.1 5.7l2.4-4.5c.2-.4.4-.6.8-.6.5 0 .8.3.9.9.3 1.4.6 2.6 1 3.7.3-2.7.8-4.7 1.4-5.9.2-.3.4-.5.7-.5.2 0 .5.1.7.2.2.2.3.4.3.6 0 .2 0 .4-.1.5z"
|
| 2531 |
-
})));
|
| 2532 |
-
/* eslint-enable max-len */
|
| 2533 |
-
};
|
| 2534 |
|
| 2535 |
-
|
| 2536 |
-
|
| 2537 |
-
|
| 2538 |
-
|
| 2539 |
-
|
| 2540 |
-
|
| 2541 |
-
|
| 2542 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2543 |
|
| 2544 |
-
// CONCATENATED MODULE: ./client/header/activity-panel/unread-indicators.js
|
| 2545 |
/**
|
| 2546 |
-
*
|
| 2547 |
*/
|
| 2548 |
|
| 2549 |
|
|
@@ -2552,83 +2767,75 @@ var inbox_panel_utils = __webpack_require__(197);
|
|
| 2552 |
*/
|
| 2553 |
|
| 2554 |
|
| 2555 |
-
var UNREAD_NOTES_QUERY = {
|
| 2556 |
-
page: 1,
|
| 2557 |
-
per_page: external_this_wc_data_["QUERY_DEFAULTS"].pageSize,
|
| 2558 |
-
status: 'unactioned',
|
| 2559 |
-
type: external_this_wc_data_["QUERY_DEFAULTS"].noteTypes,
|
| 2560 |
-
orderby: 'date',
|
| 2561 |
-
order: 'desc'
|
| 2562 |
-
};
|
| 2563 |
-
function getUnreadNotes(select) {
|
| 2564 |
-
var _select = select(external_this_wc_data_["NOTES_STORE_NAME"]),
|
| 2565 |
-
getNotes = _select.getNotes,
|
| 2566 |
-
getNotesError = _select.getNotesError,
|
| 2567 |
-
isResolving = _select.isResolving;
|
| 2568 |
|
| 2569 |
-
|
| 2570 |
-
|
|
|
|
|
|
|
|
|
|
| 2571 |
|
| 2572 |
-
|
| 2573 |
-
var
|
| 2574 |
|
| 2575 |
-
if (
|
| 2576 |
-
return
|
|
|
|
|
|
|
|
|
|
| 2577 |
}
|
| 2578 |
|
| 2579 |
-
|
| 2580 |
-
|
| 2581 |
-
|
|
|
|
|
|
|
| 2582 |
|
| 2583 |
-
|
| 2584 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2585 |
}
|
| 2586 |
|
| 2587 |
-
|
| 2588 |
-
|
| 2589 |
-
|
| 2590 |
-
|
| 2591 |
-
|
| 2592 |
-
return Object(wc_admin_settings["g" /* getSetting */])('lowStockCount', 0);
|
| 2593 |
-
}
|
| 2594 |
-
// CONCATENATED MODULE: ./client/header/activity-panel/tab/index.js
|
| 2595 |
|
|
|
|
|
|
|
| 2596 |
|
| 2597 |
-
|
| 2598 |
-
|
| 2599 |
-
|
|
|
|
|
|
|
| 2600 |
|
|
|
|
|
|
|
| 2601 |
|
|
|
|
|
|
|
| 2602 |
|
| 2603 |
-
|
| 2604 |
-
|
| 2605 |
-
|
| 2606 |
-
|
| 2607 |
-
unread = _ref.unread,
|
| 2608 |
-
selected = _ref.selected,
|
| 2609 |
-
isPanelOpen = _ref.isPanelOpen,
|
| 2610 |
-
onTabClick = _ref.onTabClick;
|
| 2611 |
-
var className = classnames_default()('woocommerce-layout__activity-panel-tab', {
|
| 2612 |
-
'is-active': isPanelOpen && selected,
|
| 2613 |
-
'has-unread': unread
|
| 2614 |
-
});
|
| 2615 |
-
var tabKey = "activity-panel-tab-".concat(name);
|
| 2616 |
-
return Object(external_this_wp_element_["createElement"])(external_this_wp_components_["Button"], {
|
| 2617 |
-
role: "tab",
|
| 2618 |
-
className: className,
|
| 2619 |
-
"aria-selected": selected,
|
| 2620 |
-
"aria-controls": "activity-panel-".concat(name),
|
| 2621 |
-
key: tabKey,
|
| 2622 |
-
id: tabKey,
|
| 2623 |
-
onClick: function onClick() {
|
| 2624 |
-
onTabClick(name);
|
| 2625 |
-
}
|
| 2626 |
-
}, icon, title, ' ', unread && Object(external_this_wp_element_["createElement"])("span", {
|
| 2627 |
-
className: "screen-reader-text"
|
| 2628 |
-
}, Object(external_this_wp_i18n_["__"])('unread activity', 'woocommerce-admin')));
|
| 2629 |
-
};
|
| 2630 |
-
// CONCATENATED MODULE: ./client/header/activity-panel/tabs/index.js
|
| 2631 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2632 |
|
| 2633 |
|
| 2634 |
|
|
@@ -2637,734 +2844,654 @@ var tab_Tab = function Tab(_ref) {
|
|
| 2637 |
*/
|
| 2638 |
|
| 2639 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2640 |
|
| 2641 |
-
|
| 2642 |
-
|
| 2643 |
-
*/
|
| 2644 |
|
|
|
|
|
|
|
| 2645 |
|
| 2646 |
-
var
|
| 2647 |
-
|
| 2648 |
-
|
| 2649 |
-
|
| 2650 |
-
|
| 2651 |
-
tabOpen = _ref$tabOpen === void 0 ? false : _ref$tabOpen;
|
| 2652 |
|
| 2653 |
-
|
| 2654 |
-
|
| 2655 |
-
|
| 2656 |
-
}
|
| 2657 |
-
_useState2 = slicedToArray_default()(_useState, 2),
|
| 2658 |
-
_useState2$ = _useState2[0],
|
| 2659 |
-
tabIsOpenState = _useState2$.tabOpen,
|
| 2660 |
-
currentTab = _useState2$.currentTab,
|
| 2661 |
-
setTabState = _useState2[1]; // Keep state synced with props
|
| 2662 |
|
|
|
|
|
|
|
|
|
|
| 2663 |
|
| 2664 |
-
|
| 2665 |
-
|
| 2666 |
-
tabOpen: tabOpen,
|
| 2667 |
-
currentTab: selectedTabName
|
| 2668 |
});
|
| 2669 |
-
}
|
| 2670 |
-
return Object(external_this_wp_element_["createElement"])(external_this_wp_components_["NavigableMenu"], {
|
| 2671 |
-
role: "tablist",
|
| 2672 |
-
orientation: "horizontal",
|
| 2673 |
-
className: "woocommerce-layout__activity-panel-tabs"
|
| 2674 |
-
}, tabs && tabs.map(function (tab, i) {
|
| 2675 |
-
if (tab.component) {
|
| 2676 |
-
var Comp = tab.component,
|
| 2677 |
-
options = tab.options;
|
| 2678 |
-
return Object(external_this_wp_element_["createElement"])(Comp, extends_default()({
|
| 2679 |
-
key: i
|
| 2680 |
-
}, options));
|
| 2681 |
-
}
|
| 2682 |
|
| 2683 |
-
|
| 2684 |
-
|
| 2685 |
-
|
| 2686 |
-
|
| 2687 |
-
|
| 2688 |
-
}, tab, {
|
| 2689 |
-
onTabClick: function onTabClick() {
|
| 2690 |
-
var isTabOpen = currentTab === tab.name || currentTab === '' ? !tabIsOpenState : true; // If a panel is being opened, or if an existing panel is already open and a different one is being opened, record a track.
|
| 2691 |
|
| 2692 |
-
|
| 2693 |
-
|
| 2694 |
-
tab: tab.name
|
| 2695 |
-
});
|
| 2696 |
-
}
|
| 2697 |
|
| 2698 |
-
|
| 2699 |
-
|
| 2700 |
-
currentTab: tab.name
|
| 2701 |
-
});
|
| 2702 |
|
| 2703 |
-
|
| 2704 |
-
}
|
| 2705 |
-
}));
|
| 2706 |
-
}));
|
| 2707 |
-
};
|
| 2708 |
-
// CONCATENATED MODULE: ./client/header/activity-panel/setup-progress.js
|
| 2709 |
|
| 2710 |
-
|
| 2711 |
-
|
| 2712 |
-
|
| 2713 |
-
|
| 2714 |
-
|
| 2715 |
-
|
| 2716 |
-
|
| 2717 |
-
|
| 2718 |
-
}, Object(external_this_wp_element_["createElement"])("path", {
|
| 2719 |
-
d: "M12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20Z",
|
| 2720 |
-
stroke: "#DCDCDE",
|
| 2721 |
-
strokeWidth: "2"
|
| 2722 |
-
}), Object(external_this_wp_element_["createElement"])("path", {
|
| 2723 |
-
d: "M4 12V12C4 16.4183 7.58172 20 12 20V20C16.4183 20 20 16.4183 20 12V12C20 7.58172 16.4183 4 12 4V4",
|
| 2724 |
-
strokeWidth: "2",
|
| 2725 |
-
strokeLinecap: "round"
|
| 2726 |
-
}));
|
| 2727 |
-
};
|
| 2728 |
-
// CONCATENATED MODULE: ./client/header/activity-panel/display-options/icons/display.js
|
| 2729 |
|
| 2730 |
|
| 2731 |
/**
|
| 2732 |
* External dependencies
|
| 2733 |
*/
|
| 2734 |
|
| 2735 |
-
var display_DisplayIcon = function DisplayIcon() {
|
| 2736 |
-
return Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, Object(external_this_wp_element_["createElement"])("svg", {
|
| 2737 |
-
className: "woocommerce-layout__activity-panel-tab-icon",
|
| 2738 |
-
width: "24",
|
| 2739 |
-
height: "24",
|
| 2740 |
-
viewBox: "3 3 24 24",
|
| 2741 |
-
fill: "none",
|
| 2742 |
-
xmlns: "http://www.w3.org/2000/svg"
|
| 2743 |
-
}, Object(external_this_wp_element_["createElement"])("path", {
|
| 2744 |
-
d: "M13.8053 15.3982C13.8053 15.7965 13.4867 16.1947 13.0089 16.1947H6.79646C6.55752 16.1947 6.39823 16.115 6.23894 15.9558C6.07965 15.7965 6 15.6372 6 15.3982V6.79646C6 6.63717 6.15929 6.39823 6.23894 6.23894C6.39823 6.07965 6.55752 6 6.79646 6H13.0089C13.4071 6 13.8053 6.31858 13.8053 6.79646V15.3982Z",
|
| 2745 |
-
strokeWidth: "1.5",
|
| 2746 |
-
strokeLinecap: "round",
|
| 2747 |
-
strokeLinejoin: "round"
|
| 2748 |
-
}), Object(external_this_wp_element_["createElement"])("path", {
|
| 2749 |
-
d: "M23.9203 10.6195C23.9203 11.0177 23.6017 11.4159 23.1238 11.4159H16.9115C16.6725 11.4159 16.5132 11.3363 16.3539 11.177C16.1946 11.0177 16.115 10.8584 16.115 10.6195V6.79646C16.115 6.39823 16.4336 6 16.9115 6H23.1238C23.5221 6 23.9203 6.31858 23.9203 6.79646V10.6195Z",
|
| 2750 |
-
strokeWidth: "1.5",
|
| 2751 |
-
strokeLinecap: "round",
|
| 2752 |
-
strokeLinejoin: "round"
|
| 2753 |
-
}), Object(external_this_wp_element_["createElement"])("path", {
|
| 2754 |
-
d: "M13.8053 23.2035C13.8053 23.4424 13.7257 23.6017 13.5664 23.761C13.4071 23.9203 13.2478 23.9999 13.0089 23.9999H6.79646C6.39823 23.9999 6 23.6813 6 23.2035V19.3804C6 19.1415 6.07965 18.9822 6.23894 18.8229C6.39823 18.6636 6.55752 18.584 6.79646 18.584H13.0089C13.4071 18.584 13.8053 18.9026 13.8053 19.3804V23.2035Z",
|
| 2755 |
-
strokeWidth: "1.5",
|
| 2756 |
-
strokeLinecap: "round",
|
| 2757 |
-
strokeLinejoin: "round"
|
| 2758 |
-
}), Object(external_this_wp_element_["createElement"])("path", {
|
| 2759 |
-
d: "M16.9912 23.9999C16.7522 23.9999 16.5929 23.9202 16.4336 23.7609C16.2743 23.6016 16.1947 23.4423 16.1947 23.2034V14.6016C16.1947 14.3627 16.2743 14.2034 16.4336 14.0441C16.5929 13.8848 16.7522 13.8052 16.9912 13.8052H23.2036C23.4425 13.8052 23.6018 13.8848 23.7611 14.0441C23.9204 14.2034 24 14.3627 24 14.6016V23.2034C24 23.6016 23.6814 23.9999 23.2036 23.9999H16.9912Z",
|
| 2760 |
-
strokeWidth: "1.5",
|
| 2761 |
-
strokeLinecap: "round",
|
| 2762 |
-
strokeLinejoin: "round"
|
| 2763 |
-
})), Object(external_this_wp_i18n_["__"])('Display', 'woocommerce-admin'));
|
| 2764 |
-
};
|
| 2765 |
-
// CONCATENATED MODULE: ./client/header/activity-panel/display-options/icons/single-column.js
|
| 2766 |
|
| 2767 |
-
|
| 2768 |
-
|
| 2769 |
-
|
| 2770 |
-
width: "12",
|
| 2771 |
-
height: "14",
|
| 2772 |
-
viewBox: "0 0 12 14",
|
| 2773 |
-
fill: "none",
|
| 2774 |
-
xmlns: "http://www.w3.org/2000/svg"
|
| 2775 |
-
}, Object(external_this_wp_element_["createElement"])("rect", {
|
| 2776 |
-
x: "0.5",
|
| 2777 |
-
y: "0.5",
|
| 2778 |
-
width: "11",
|
| 2779 |
-
height: "13",
|
| 2780 |
-
strokeWidth: "1"
|
| 2781 |
-
}));
|
| 2782 |
-
};
|
| 2783 |
-
// CONCATENATED MODULE: ./client/header/activity-panel/display-options/icons/two-columns.js
|
| 2784 |
|
| 2785 |
-
|
| 2786 |
-
|
| 2787 |
-
|
| 2788 |
-
width: "18",
|
| 2789 |
-
height: "14",
|
| 2790 |
-
viewBox: "0 0 18 14",
|
| 2791 |
-
fill: "none",
|
| 2792 |
-
xmlns: "http://www.w3.org/2000/svg"
|
| 2793 |
-
}, Object(external_this_wp_element_["createElement"])("rect", {
|
| 2794 |
-
x: "0.5",
|
| 2795 |
-
y: "0.5",
|
| 2796 |
-
width: "7",
|
| 2797 |
-
height: "13",
|
| 2798 |
-
strokeWidth: "1"
|
| 2799 |
-
}), Object(external_this_wp_element_["createElement"])("rect", {
|
| 2800 |
-
x: "9.5",
|
| 2801 |
-
y: "0.5",
|
| 2802 |
-
width: "7",
|
| 2803 |
-
height: "13",
|
| 2804 |
-
strokeWidth: "1"
|
| 2805 |
-
}));
|
| 2806 |
-
};
|
| 2807 |
-
// CONCATENATED MODULE: ./client/header/activity-panel/display-options/index.js
|
| 2808 |
|
|
|
|
|
|
|
| 2809 |
|
| 2810 |
-
|
| 2811 |
-
|
| 2812 |
-
|
| 2813 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2814 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2815 |
|
|
|
|
|
|
|
| 2816 |
|
|
|
|
| 2817 |
|
| 2818 |
-
|
| 2819 |
-
|
| 2820 |
-
*/
|
| 2821 |
|
|
|
|
| 2822 |
|
|
|
|
|
|
|
| 2823 |
|
|
|
|
|
|
|
| 2824 |
|
| 2825 |
-
|
| 2826 |
-
|
| 2827 |
-
label: Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, Object(external_this_wp_element_["createElement"])(single_column_SingleColumnIcon, null), Object(external_this_wp_i18n_["__"])('Single column', 'woocommerce-admin'))
|
| 2828 |
-
}, {
|
| 2829 |
-
value: 'two_columns',
|
| 2830 |
-
label: Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, Object(external_this_wp_element_["createElement"])(two_columns_TwoColumnsIcon, null), Object(external_this_wp_i18n_["__"])('Two columns', 'woocommerce-admin'))
|
| 2831 |
-
}];
|
| 2832 |
-
var display_options_DisplayOptions = function DisplayOptions() {
|
| 2833 |
-
var defaultHomescreenLayout = Object(external_this_wp_data_["useSelect"])(function (select) {
|
| 2834 |
-
var _select = select(external_this_wc_data_["OPTIONS_STORE_NAME"]),
|
| 2835 |
-
getOption = _select.getOption;
|
| 2836 |
|
| 2837 |
-
|
| 2838 |
-
|
| 2839 |
|
| 2840 |
-
|
| 2841 |
-
|
| 2842 |
-
|
| 2843 |
|
| 2844 |
-
|
| 2845 |
-
|
| 2846 |
-
/* translators: button label text should, if possible, be under 16 characters. */
|
| 2847 |
-
,
|
| 2848 |
-
label: Object(external_this_wp_i18n_["__"])('Display options', 'woocommerce-admin'),
|
| 2849 |
-
toggleProps: {
|
| 2850 |
-
className: 'woocommerce-layout__activity-panel-tab display-options',
|
| 2851 |
-
onClick: function onClick() {
|
| 2852 |
-
return Object(external_this_wc_tracks_["recordEvent"])('homescreen_display_click');
|
| 2853 |
-
}
|
| 2854 |
-
},
|
| 2855 |
-
popoverProps: {
|
| 2856 |
-
className: 'woocommerce-layout__activity-panel-popover'
|
| 2857 |
-
}
|
| 2858 |
-
}, function (_ref) {
|
| 2859 |
-
var onClose = _ref.onClose;
|
| 2860 |
-
return Object(external_this_wp_element_["createElement"])(external_this_wp_components_["MenuGroup"], {
|
| 2861 |
-
className: "woocommerce-layout__homescreen-display-options",
|
| 2862 |
-
label: Object(external_this_wp_i18n_["__"])('Layout', 'woocommerce-admin')
|
| 2863 |
-
}, Object(external_this_wp_element_["createElement"])(external_this_wp_components_["MenuItemsChoice"], {
|
| 2864 |
-
choices: LAYOUTS,
|
| 2865 |
-
onSelect: function onSelect(newLayout) {
|
| 2866 |
-
updateUserPreferences({
|
| 2867 |
-
homepage_layout: newLayout
|
| 2868 |
-
});
|
| 2869 |
-
onClose();
|
| 2870 |
-
Object(external_this_wc_tracks_["recordEvent"])('homescreen_display_option', {
|
| 2871 |
-
display_option: newLayout
|
| 2872 |
-
});
|
| 2873 |
-
},
|
| 2874 |
-
value: layout || defaultHomescreenLayout
|
| 2875 |
-
}));
|
| 2876 |
-
});
|
| 2877 |
-
};
|
| 2878 |
-
// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/close.js
|
| 2879 |
-
var library_close = __webpack_require__(498);
|
| 2880 |
|
| 2881 |
-
// EXTERNAL MODULE: ./
|
| 2882 |
-
var
|
| 2883 |
|
| 2884 |
-
//
|
|
|
|
| 2885 |
|
|
|
|
|
|
|
| 2886 |
|
|
|
|
|
|
|
| 2887 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2888 |
/**
|
| 2889 |
* External dependencies
|
| 2890 |
*/
|
| 2891 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2892 |
|
| 2893 |
|
| 2894 |
|
|
|
|
| 2895 |
|
|
|
|
| 2896 |
|
| 2897 |
/**
|
| 2898 |
-
*
|
| 2899 |
*/
|
| 2900 |
|
|
|
|
|
|
|
|
|
|
| 2901 |
|
| 2902 |
-
var
|
| 2903 |
|
| 2904 |
-
|
| 2905 |
-
|
| 2906 |
-
|
| 2907 |
-
|
| 2908 |
-
|
| 2909 |
-
|
| 2910 |
-
|
| 2911 |
-
|
| 2912 |
-
|
| 2913 |
-
|
| 2914 |
-
|
| 2915 |
-
|
| 2916 |
-
|
|
|
|
|
|
|
| 2917 |
|
| 2918 |
-
|
| 2919 |
-
|
| 2920 |
-
|
| 2921 |
-
setShowHighlight = _useState2[1];
|
| 2922 |
|
| 2923 |
-
|
| 2924 |
-
|
| 2925 |
-
|
| 2926 |
-
|
|
|
|
| 2927 |
|
| 2928 |
-
|
| 2929 |
-
|
| 2930 |
-
|
| 2931 |
-
|
|
|
|
| 2932 |
|
| 2933 |
-
Object(external_this_wp_element_["useEffect"])(function () {
|
| 2934 |
-
var element = document.getElementById(id);
|
| 2935 |
-
var container, parent;
|
| 2936 |
|
| 2937 |
-
|
| 2938 |
-
|
| 2939 |
-
|
| 2940 |
-
|
| 2941 |
-
|
| 2942 |
-
|
| 2943 |
-
document.body.appendChild(parent);
|
| 2944 |
-
}
|
| 2945 |
|
| 2946 |
-
|
| 2947 |
-
|
| 2948 |
-
|
| 2949 |
-
|
| 2950 |
-
|
| 2951 |
|
| 2952 |
-
|
| 2953 |
-
return function () {
|
| 2954 |
-
if (container) {
|
| 2955 |
-
var parentElement = container.parentElement;
|
| 2956 |
-
parentElement.removeChild(container);
|
| 2957 |
|
| 2958 |
-
|
| 2959 |
-
|
| 2960 |
-
|
| 2961 |
-
|
|
|
|
| 2962 |
|
| 2963 |
-
|
| 2964 |
-
|
| 2965 |
-
|
| 2966 |
-
|
| 2967 |
-
|
| 2968 |
-
|
| 2969 |
-
|
| 2970 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2971 |
}
|
| 2972 |
-
}
|
| 2973 |
-
Object(external_this_wp_element_["useEffect"])(function () {
|
| 2974 |
-
if (show !== showHighlight && showHighlight !== null && node) {
|
| 2975 |
-
setShowHighlight(show);
|
| 2976 |
|
| 2977 |
-
|
| 2978 |
-
node.classList.remove(SHOW_CLASS);
|
| 2979 |
-
} else if (node) {
|
| 2980 |
-
triggerShowTooltip(node);
|
| 2981 |
-
}
|
| 2982 |
-
}
|
| 2983 |
-
}, [show]);
|
| 2984 |
-
Object(external_this_wp_element_["useLayoutEffect"])(function () {
|
| 2985 |
-
window.addEventListener('resize', updateSize);
|
| 2986 |
-
return function () {
|
| 2987 |
-
return window.removeEventListener('resize', updateSize);
|
| 2988 |
-
};
|
| 2989 |
-
}, []);
|
| 2990 |
|
| 2991 |
-
|
| 2992 |
-
|
| 2993 |
-
|
| 2994 |
-
|
| 2995 |
-
|
|
|
|
| 2996 |
}
|
| 2997 |
|
| 2998 |
-
|
| 2999 |
-
var
|
| 3000 |
-
|
| 3001 |
-
|
| 3002 |
-
timeoutId = setTimeout(function () {
|
| 3003 |
-
timeoutId = null;
|
| 3004 |
-
showTooltip(container);
|
| 3005 |
-
}, delay);
|
| 3006 |
-
} else if (!showHighlight) {
|
| 3007 |
-
showTooltip(container);
|
| 3008 |
-
}
|
| 3009 |
|
| 3010 |
-
|
|
|
|
|
|
|
|
|
|
| 3011 |
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3012 |
|
| 3013 |
-
|
| 3014 |
-
|
| 3015 |
|
| 3016 |
-
|
| 3017 |
-
|
| 3018 |
-
|
|
|
|
| 3019 |
|
| 3020 |
-
if (
|
| 3021 |
-
|
|
|
|
|
|
|
|
|
|
| 3022 |
}
|
|
|
|
| 3023 |
|
| 3024 |
-
setShowHighlight(true);
|
| 3025 |
-
onShow();
|
| 3026 |
-
};
|
| 3027 |
|
| 3028 |
-
var
|
| 3029 |
-
setShowHighlight(false);
|
| 3030 |
|
| 3031 |
-
|
| 3032 |
-
|
| 3033 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3034 |
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3035 |
|
| 3036 |
-
|
| 3037 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3038 |
}
|
| 3039 |
|
| 3040 |
-
return
|
| 3041 |
-
|
| 3042 |
-
|
| 3043 |
-
|
| 3044 |
-
}
|
| 3045 |
-
|
| 3046 |
-
|
| 3047 |
-
|
| 3048 |
-
|
| 3049 |
-
|
| 3050 |
-
|
| 3051 |
-
|
| 3052 |
-
|
| 3053 |
-
|
| 3054 |
-
|
| 3055 |
-
|
| 3056 |
-
|
| 3057 |
-
|
| 3058 |
-
|
| 3059 |
-
|
| 3060 |
-
|
| 3061 |
-
|
| 3062 |
-
|
| 3063 |
-
|
| 3064 |
-
HighlightTooltip.propTypes = {
|
| 3065 |
-
/**
|
| 3066 |
-
* The id of the element it should highlight, should be unique per HighlightTooltip.
|
| 3067 |
-
*/
|
| 3068 |
-
id: prop_types_default.a.string.isRequired,
|
| 3069 |
|
| 3070 |
-
|
| 3071 |
-
|
| 3072 |
-
|
| 3073 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3074 |
|
| 3075 |
-
|
| 3076 |
-
|
| 3077 |
-
*/
|
| 3078 |
-
closeButtonText: prop_types_default.a.string.isRequired,
|
| 3079 |
|
| 3080 |
-
|
| 3081 |
-
|
| 3082 |
-
*/
|
| 3083 |
-
content: prop_types_default.a.oneOfType([prop_types_default.a.string, prop_types_default.a.node]),
|
| 3084 |
|
| 3085 |
-
|
| 3086 |
-
|
| 3087 |
-
*/
|
| 3088 |
-
show: prop_types_default.a.bool,
|
| 3089 |
|
| 3090 |
-
|
| 3091 |
-
|
| 3092 |
-
|
| 3093 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3094 |
|
| 3095 |
-
/**
|
| 3096 |
-
* This will delay the popup from appearing by the number of ms.
|
| 3097 |
-
*/
|
| 3098 |
-
delay: prop_types_default.a.number,
|
| 3099 |
|
| 3100 |
-
/**
|
| 3101 |
-
* A callback for when the tooltip is shown.
|
| 3102 |
-
*/
|
| 3103 |
-
onShow: prop_types_default.a.func,
|
| 3104 |
|
| 3105 |
-
/**
|
| 3106 |
-
* useAnchor, will append the tooltip to the body tag, and make use of the anchorRect to display the tooltip.
|
| 3107 |
-
* Defaults to false.
|
| 3108 |
-
*/
|
| 3109 |
-
useAnchor: prop_types_default.a.bool
|
| 3110 |
-
};
|
| 3111 |
|
| 3112 |
-
// EXTERNAL MODULE: ./node_modules/@wordpress/dom/build-module/index.js + 2 modules
|
| 3113 |
-
var dom_build_module = __webpack_require__(121);
|
| 3114 |
|
| 3115 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3116 |
/**
|
| 3117 |
-
*
|
| 3118 |
-
* to avoid its absence in older versions of WordPress.
|
| 3119 |
-
*
|
| 3120 |
-
* This can be removed once the minimum supported version of WordPress includes this hook.
|
| 3121 |
*/
|
| 3122 |
|
| 3123 |
/**
|
| 3124 |
-
*
|
| 3125 |
*/
|
| 3126 |
|
| 3127 |
|
| 3128 |
-
/**
|
| 3129 |
-
* Hook used to focus the first tabbable element on mount.
|
| 3130 |
-
*
|
| 3131 |
-
* @param {boolean|string} focusOnMount Focus on mount mode.
|
| 3132 |
-
* @return {Function} Ref callback.
|
| 3133 |
-
*
|
| 3134 |
-
* @example
|
| 3135 |
-
* ```js
|
| 3136 |
-
* import { useFocusOnMount } from '@wordpress/compose';
|
| 3137 |
-
*
|
| 3138 |
-
* const WithFocusOnMount = () => {
|
| 3139 |
-
* const ref = useFocusOnMount()
|
| 3140 |
-
* return (
|
| 3141 |
-
* <div ref={ ref }>
|
| 3142 |
-
* <Button />
|
| 3143 |
-
* <Button />
|
| 3144 |
-
* </div>
|
| 3145 |
-
* );
|
| 3146 |
-
* }
|
| 3147 |
-
* ```
|
| 3148 |
-
*/
|
| 3149 |
|
| 3150 |
-
function
|
| 3151 |
-
|
| 3152 |
-
var focusOnMountRef = Object(external_this_wp_element_["useRef"])(focusOnMount);
|
| 3153 |
-
Object(external_this_wp_element_["useEffect"])(function () {
|
| 3154 |
-
focusOnMountRef.current = focusOnMount;
|
| 3155 |
-
}, [focusOnMount]);
|
| 3156 |
-
return Object(external_this_wp_element_["useCallback"])(function (node) {
|
| 3157 |
-
if (!node || focusOnMountRef.current === false) {
|
| 3158 |
-
return;
|
| 3159 |
-
}
|
| 3160 |
|
| 3161 |
-
|
| 3162 |
-
return;
|
| 3163 |
-
}
|
| 3164 |
|
| 3165 |
-
|
|
|
|
| 3166 |
|
| 3167 |
-
|
| 3168 |
-
|
| 3169 |
|
| 3170 |
-
|
| 3171 |
-
|
| 3172 |
-
|
|
|
|
| 3173 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3174 |
|
| 3175 |
-
|
| 3176 |
-
|
| 3177 |
-
}
|
| 3178 |
-
// CONCATENATED MODULE: ./client/hooks/useFocusOutside.js
|
| 3179 |
-
/**
|
| 3180 |
-
* External dependencies
|
| 3181 |
-
*/
|
| 3182 |
-
|
| 3183 |
-
|
| 3184 |
-
/**
|
| 3185 |
-
* Input types which are classified as button types, for use in considering
|
| 3186 |
-
* whether element is a (focus-normalized) button.
|
| 3187 |
-
*
|
| 3188 |
-
* @type {string[]}
|
| 3189 |
-
*/
|
| 3190 |
-
|
| 3191 |
-
var INPUT_BUTTON_TYPES = ['button', 'submit'];
|
| 3192 |
-
/**
|
| 3193 |
-
* @typedef {HTMLButtonElement | HTMLLinkElement | HTMLInputElement} FocusNormalizedButton
|
| 3194 |
-
*/
|
| 3195 |
-
// Disable reason: Rule doesn't support predicate return types
|
| 3196 |
-
|
| 3197 |
-
/* eslint-disable jsdoc/valid-types */
|
| 3198 |
|
| 3199 |
-
|
| 3200 |
-
|
| 3201 |
-
|
| 3202 |
-
|
| 3203 |
-
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#Clicking_and_focus
|
| 3204 |
-
*
|
| 3205 |
-
* @param {EventTarget} eventTarget The target from a mouse or touch event.
|
| 3206 |
-
*
|
| 3207 |
-
* @return {eventTarget is FocusNormalizedButton} Whether element is a button.
|
| 3208 |
-
*/
|
| 3209 |
|
| 3210 |
-
|
| 3211 |
-
if (!(eventTarget instanceof window.HTMLElement)) {
|
| 3212 |
-
return false;
|
| 3213 |
-
}
|
| 3214 |
|
| 3215 |
-
switch (eventTarget.nodeName) {
|
| 3216 |
-
case 'A':
|
| 3217 |
-
case 'BUTTON':
|
| 3218 |
-
return true;
|
| 3219 |
|
| 3220 |
-
case 'INPUT':
|
| 3221 |
-
return Object(external_lodash_["includes"])(INPUT_BUTTON_TYPES,
|
| 3222 |
-
/** @type {HTMLInputElement} */
|
| 3223 |
-
eventTarget.type);
|
| 3224 |
-
}
|
| 3225 |
|
| 3226 |
-
return false;
|
| 3227 |
-
}
|
| 3228 |
-
/* eslint-enable jsdoc/valid-types */
|
| 3229 |
|
| 3230 |
-
/**
|
| 3231 |
-
* @typedef {import('react').SyntheticEvent} SyntheticEvent
|
| 3232 |
-
*/
|
| 3233 |
|
| 3234 |
-
/**
|
| 3235 |
-
* @callback EventCallback
|
| 3236 |
-
* @param {SyntheticEvent} event input related event.
|
| 3237 |
-
*/
|
| 3238 |
|
| 3239 |
-
|
| 3240 |
-
* @typedef FocusOutsideReactElement
|
| 3241 |
-
* @property {EventCallback} handleFocusOutside callback for a focus outside event.
|
| 3242 |
-
*/
|
| 3243 |
|
| 3244 |
-
|
| 3245 |
-
* @typedef {import('react').MutableRefObject<FocusOutsideReactElement | undefined>} FocusOutsideRef
|
| 3246 |
-
*/
|
| 3247 |
|
| 3248 |
/**
|
| 3249 |
-
*
|
| 3250 |
-
* @property {EventCallback} onFocus An event handler for focus events.
|
| 3251 |
-
* @property {EventCallback} onBlur An event handler for blur events.
|
| 3252 |
-
* @property {EventCallback} onMouseDown An event handler for mouse down events.
|
| 3253 |
-
* @property {EventCallback} onMouseUp An event handler for mouse up events.
|
| 3254 |
-
* @property {EventCallback} onTouchStart An event handler for touch start events.
|
| 3255 |
-
* @property {EventCallback} onTouchEnd An event handler for touch end events.
|
| 3256 |
*/
|
| 3257 |
|
| 3258 |
/**
|
| 3259 |
-
*
|
| 3260 |
-
* element the event handlers are bound to.
|
| 3261 |
*
|
| 3262 |
-
*
|
| 3263 |
-
*
|
| 3264 |
*
|
| 3265 |
-
* @
|
| 3266 |
-
*
|
| 3267 |
-
*
|
|
|
|
| 3268 |
*/
|
| 3269 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3270 |
|
| 3271 |
-
|
| 3272 |
-
|
| 3273 |
-
|
| 3274 |
-
|
| 3275 |
-
|
| 3276 |
-
|
| 3277 |
-
|
| 3278 |
-
* @type {import('react').MutableRefObject<number | undefined>}
|
| 3279 |
*/
|
| 3280 |
|
| 3281 |
-
var
|
| 3282 |
/**
|
| 3283 |
-
*
|
|
|
|
|
|
|
| 3284 |
*/
|
| 3285 |
|
| 3286 |
-
|
| 3287 |
-
|
| 3288 |
-
}, []); // Cancel blur checks on unmount.
|
| 3289 |
|
| 3290 |
-
|
| 3291 |
-
|
| 3292 |
-
|
| 3293 |
-
};
|
| 3294 |
-
}, []); // Cancel a blur check if the callback or ref is no longer provided.
|
| 3295 |
|
| 3296 |
-
|
| 3297 |
-
|
| 3298 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3299 |
}
|
| 3300 |
-
}
|
| 3301 |
/**
|
| 3302 |
-
*
|
| 3303 |
-
* unassign a flag for preventing blur check on button elements. Some
|
| 3304 |
-
* browsers, namely Firefox and Safari, do not emit a focus event on
|
| 3305 |
-
* button elements when clicked, while others do. The logic here
|
| 3306 |
-
* intends to normalize this as treating click on buttons as focus.
|
| 3307 |
*
|
| 3308 |
-
*
|
| 3309 |
-
*
|
| 3310 |
-
*
|
| 3311 |
*/
|
| 3312 |
|
| 3313 |
-
var normalizeButtonFocus = Object(external_this_wp_element_["useCallback"])(function (event) {
|
| 3314 |
-
var type = event.type,
|
| 3315 |
-
target = event.target;
|
| 3316 |
-
var isInteractionEnd = Object(external_lodash_["includes"])(['mouseup', 'touchend'], type);
|
| 3317 |
|
| 3318 |
-
|
| 3319 |
-
|
| 3320 |
-
|
| 3321 |
-
preventBlurCheck.current = true;
|
| 3322 |
}
|
| 3323 |
-
|
|
|
|
|
|
|
| 3324 |
/**
|
| 3325 |
-
*
|
| 3326 |
-
* is bound to.
|
| 3327 |
*
|
| 3328 |
-
*
|
| 3329 |
-
*
|
| 3330 |
-
*
|
| 3331 |
-
* @param {SyntheticEvent} event Blur event.
|
| 3332 |
*/
|
| 3333 |
|
| 3334 |
-
var queueBlurCheck = Object(external_this_wp_element_["useCallback"])(function (event) {
|
| 3335 |
-
// React does not allow using an event reference asynchronously
|
| 3336 |
-
// due to recycling behavior, except when explicitly persisted.
|
| 3337 |
-
event.persist(); // Skip blur check if clicking button. See `normalizeButtonFocus`.
|
| 3338 |
|
| 3339 |
-
|
| 3340 |
-
|
|
|
|
| 3341 |
}
|
| 3342 |
|
| 3343 |
-
|
| 3344 |
-
|
| 3345 |
-
|
| 3346 |
-
|
| 3347 |
-
|
| 3348 |
-
|
| 3349 |
-
|
| 3350 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3351 |
}
|
|
|
|
|
|
|
|
|
|
| 3352 |
|
| 3353 |
-
|
| 3354 |
-
|
|
|
|
|
|
|
| 3355 |
}
|
| 3356 |
-
|
| 3357 |
-
|
| 3358 |
-
|
| 3359 |
-
|
| 3360 |
-
|
| 3361 |
-
|
| 3362 |
-
|
| 3363 |
-
|
| 3364 |
-
|
| 3365 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3366 |
}
|
| 3367 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3368 |
|
| 3369 |
|
| 3370 |
|
|
@@ -3372,6 +3499,14 @@ function useFocusOutside(onFocusOutside) {
|
|
| 3372 |
* External dependencies
|
| 3373 |
*/
|
| 3374 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3375 |
|
| 3376 |
|
| 3377 |
/**
|
|
@@ -3380,1879 +3515,2473 @@ function useFocusOutside(onFocusOutside) {
|
|
| 3380 |
|
| 3381 |
|
| 3382 |
|
| 3383 |
-
var panel_Panel = function Panel(_ref) {
|
| 3384 |
-
var content = _ref.content,
|
| 3385 |
-
isPanelOpen = _ref.isPanelOpen,
|
| 3386 |
-
isPanelSwitching = _ref.isPanelSwitching,
|
| 3387 |
-
currentTab = _ref.currentTab,
|
| 3388 |
-
tab = _ref.tab,
|
| 3389 |
-
closePanel = _ref.closePanel,
|
| 3390 |
-
clearPanel = _ref.clearPanel;
|
| 3391 |
|
| 3392 |
-
var handleFocusOutside = function handleFocusOutside(event) {
|
| 3393 |
-
var isClickOnModalOrSnackbar = event.target.closest('.woocommerce-inbox-dismiss-confirmation_modal') || event.target.closest('.components-snackbar__action');
|
| 3394 |
|
| 3395 |
-
if (isPanelOpen && !isClickOnModalOrSnackbar) {
|
| 3396 |
-
closePanel();
|
| 3397 |
-
}
|
| 3398 |
-
};
|
| 3399 |
|
| 3400 |
-
var possibleFocusPanel = function possibleFocusPanel() {
|
| 3401 |
-
if (!containerRef.current || !isPanelOpen || !tab) {
|
| 3402 |
-
return;
|
| 3403 |
-
}
|
| 3404 |
|
| 3405 |
-
focusOnMountRef(containerRef.current);
|
| 3406 |
-
};
|
| 3407 |
|
| 3408 |
-
var finishTransition = function finishTransition(e) {
|
| 3409 |
-
if (e && e.propertyName === 'transform') {
|
| 3410 |
-
clearPanel();
|
| 3411 |
-
possibleFocusPanel();
|
| 3412 |
-
}
|
| 3413 |
-
};
|
| 3414 |
|
| 3415 |
-
var focusOnMountRef = useFocusOnMount();
|
| 3416 |
-
var useFocusOutsideProps = useFocusOutside(handleFocusOutside);
|
| 3417 |
-
var containerRef = Object(external_this_wp_element_["useRef"])(null);
|
| 3418 |
-
var mergedContainerRef = Object(external_this_wp_element_["useCallback"])(function (node) {
|
| 3419 |
-
containerRef.current = node;
|
| 3420 |
-
focusOnMountRef(node);
|
| 3421 |
-
}, []);
|
| 3422 |
|
| 3423 |
-
|
| 3424 |
-
|
| 3425 |
-
|
| 3426 |
-
|
| 3427 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3428 |
|
| 3429 |
-
|
| 3430 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3431 |
}
|
| 3432 |
|
| 3433 |
-
|
| 3434 |
-
|
| 3435 |
-
|
| 3436 |
-
|
| 3437 |
-
return Object(external_this_wp_element_["createElement"])("div", extends_default()({
|
| 3438 |
-
className: classNames,
|
| 3439 |
-
tabIndex: 0,
|
| 3440 |
-
role: "tabpanel",
|
| 3441 |
-
"aria-label": tab.title,
|
| 3442 |
-
onTransitionEnd: finishTransition
|
| 3443 |
-
}, useFocusOutsideProps, {
|
| 3444 |
-
ref: mergedContainerRef
|
| 3445 |
-
}), Object(external_this_wp_element_["createElement"])("div", {
|
| 3446 |
-
className: "woocommerce-layout__activity-panel-content",
|
| 3447 |
-
key: 'activity-panel-' + currentTab,
|
| 3448 |
-
id: 'activity-panel-' + currentTab
|
| 3449 |
-
}, Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Suspense"], {
|
| 3450 |
-
fallback: Object(external_this_wp_element_["createElement"])(external_this_wc_components_["Spinner"], null)
|
| 3451 |
-
}, content)));
|
| 3452 |
-
};
|
| 3453 |
-
/* harmony default export */ var panel = (panel_Panel);
|
| 3454 |
-
// CONCATENATED MODULE: ./client/header/activity-panel/index.js
|
| 3455 |
|
|
|
|
|
|
|
| 3456 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3457 |
|
| 3458 |
-
|
| 3459 |
-
|
| 3460 |
-
|
| 3461 |
|
|
|
|
|
|
|
| 3462 |
|
|
|
|
|
|
|
|
|
|
| 3463 |
|
|
|
|
|
|
|
| 3464 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3465 |
|
|
|
|
| 3466 |
|
|
|
|
|
|
|
|
|
|
| 3467 |
|
|
|
|
|
|
|
| 3468 |
|
|
|
|
|
|
|
|
|
|
| 3469 |
|
|
|
|
|
|
|
| 3470 |
|
|
|
|
|
|
|
|
|
|
| 3471 |
|
|
|
|
|
|
|
| 3472 |
|
|
|
|
|
|
|
|
|
|
| 3473 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3474 |
/**
|
| 3475 |
-
*
|
|
|
|
|
|
|
|
|
|
| 3476 |
*/
|
| 3477 |
|
| 3478 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3479 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3480 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3481 |
|
|
|
|
|
|
|
| 3482 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3483 |
|
| 3484 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3485 |
|
| 3486 |
|
| 3487 |
-
|
| 3488 |
-
|
| 3489 |
-
});
|
| 3490 |
-
var InboxPanel = Object(external_this_wp_element_["lazy"])(function () {
|
| 3491 |
-
return Promise.all(/* import() | activity-panels-inbox */[__webpack_require__.e(1), __webpack_require__.e(2), __webpack_require__.e(4), __webpack_require__.e(8)]).then(__webpack_require__.bind(null, 587));
|
| 3492 |
-
});
|
| 3493 |
-
var activity_panel_ActivityPanel = function ActivityPanel(_ref) {
|
| 3494 |
-
var isEmbedded = _ref.isEmbedded,
|
| 3495 |
-
query = _ref.query,
|
| 3496 |
-
userPreferencesData = _ref.userPreferencesData;
|
| 3497 |
-
|
| 3498 |
-
var _useState = Object(external_this_wp_element_["useState"])(''),
|
| 3499 |
-
_useState2 = slicedToArray_default()(_useState, 2),
|
| 3500 |
-
currentTab = _useState2[0],
|
| 3501 |
-
setCurrentTab = _useState2[1];
|
| 3502 |
|
| 3503 |
-
|
| 3504 |
-
|
| 3505 |
-
|
| 3506 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3507 |
|
| 3508 |
-
var _useState5 = Object(external_this_wp_element_["useState"])(false),
|
| 3509 |
-
_useState6 = slicedToArray_default()(_useState5, 2),
|
| 3510 |
-
isPanelSwitching = _useState6[0],
|
| 3511 |
-
setIsPanelSwitching = _useState6[1];
|
| 3512 |
|
| 3513 |
-
|
| 3514 |
-
|
| 3515 |
-
|
| 3516 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3517 |
|
| 3518 |
-
|
| 3519 |
-
|
| 3520 |
-
|
| 3521 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3522 |
|
| 3523 |
-
|
| 3524 |
-
|
| 3525 |
-
|
| 3526 |
-
|
| 3527 |
-
setupTaskListHidden: getOption('woocommerce_task_list_hidden') === 'yes',
|
| 3528 |
-
trackedCompletedTasks: getOption('woocommerce_task_list_tracked_completed_tasks') || []
|
| 3529 |
-
};
|
| 3530 |
-
}),
|
| 3531 |
-
hasUnreadNotes = _useSelect.hasUnreadNotes,
|
| 3532 |
-
requestingTaskListOptions = _useSelect.requestingTaskListOptions,
|
| 3533 |
-
setupTaskListComplete = _useSelect.setupTaskListComplete,
|
| 3534 |
-
setupTaskListHidden = _useSelect.setupTaskListHidden,
|
| 3535 |
-
trackedCompletedTasks = _useSelect.trackedCompletedTasks;
|
| 3536 |
|
| 3537 |
-
|
| 3538 |
-
updateOptions = _useDispatch.updateOptions;
|
| 3539 |
|
| 3540 |
-
|
| 3541 |
-
|
|
|
|
| 3542 |
|
| 3543 |
-
|
| 3544 |
-
|
| 3545 |
-
|
| 3546 |
-
|
| 3547 |
-
|
| 3548 |
-
|
| 3549 |
-
|
| 3550 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3551 |
|
| 3552 |
-
|
| 3553 |
-
setIsPanelOpen(false);
|
| 3554 |
-
};
|
| 3555 |
|
| 3556 |
-
|
| 3557 |
-
|
| 3558 |
-
setIsPanelSwitching(false);
|
| 3559 |
-
setCurrentTab('');
|
| 3560 |
-
}
|
| 3561 |
-
}; // On smaller screen, the panel buttons are hidden behind a toggle.
|
| 3562 |
|
|
|
|
|
|
|
| 3563 |
|
| 3564 |
-
|
| 3565 |
-
var tabs = getTabs();
|
| 3566 |
-
setCurrentTab(mobileOpen ? '' : tabs[0].name);
|
| 3567 |
-
setMobileOpen(!mobileOpen);
|
| 3568 |
-
setIsPanelOpen(!mobileOpen);
|
| 3569 |
-
};
|
| 3570 |
|
| 3571 |
-
|
| 3572 |
-
|
| 3573 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3574 |
|
| 3575 |
-
|
| 3576 |
-
|
| 3577 |
-
|
|
|
|
| 3578 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3579 |
|
| 3580 |
-
|
| 3581 |
-
|
| 3582 |
-
|
| 3583 |
-
|
| 3584 |
-
|
| 3585 |
-
|
| 3586 |
-
|
| 3587 |
-
|
| 3588 |
-
|
|
|
|
|
|
|
| 3589 |
};
|
| 3590 |
-
var setup = {
|
| 3591 |
-
name: 'setup',
|
| 3592 |
-
title: Object(external_this_wp_i18n_["__"])('Store Setup', 'woocommerce-admin'),
|
| 3593 |
-
icon: Object(external_this_wp_element_["createElement"])(setup_progress_SetupProgress, null),
|
| 3594 |
-
onClick: function onClick() {
|
| 3595 |
-
var currentLocation = window.location.href;
|
| 3596 |
-
var homescreenLocation = Object(wc_admin_settings["f" /* getAdminLink */])('admin.php?page=wc-admin'); // Don't navigate if we're already on the homescreen, this will cause an infinite loop
|
| 3597 |
|
| 3598 |
-
|
| 3599 |
-
|
| 3600 |
-
|
| 3601 |
-
|
| 3602 |
-
|
| 3603 |
-
|
| 3604 |
-
|
| 3605 |
-
|
| 3606 |
-
|
| 3607 |
-
|
| 3608 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3609 |
|
| 3610 |
-
|
| 3611 |
-
|
| 3612 |
-
|
| 3613 |
-
|
| 3614 |
-
|
| 3615 |
-
|
| 3616 |
-
|
| 3617 |
-
|
| 3618 |
-
|
| 3619 |
-
}
|
| 3620 |
-
visible: isHomescreen() && !isEmbedded || isPerformingSetupTask()
|
| 3621 |
-
};
|
| 3622 |
-
var displayOptions = {
|
| 3623 |
-
component: display_options_DisplayOptions,
|
| 3624 |
-
visible: !isEmbedded && isHomescreen() && !isPerformingSetupTask()
|
| 3625 |
};
|
| 3626 |
-
|
| 3627 |
-
|
| 3628 |
-
});
|
| 3629 |
-
};
|
| 3630 |
-
|
| 3631 |
-
var getPanelContent = function getPanelContent(tab) {
|
| 3632 |
-
var task = query.task;
|
| 3633 |
|
| 3634 |
-
|
| 3635 |
-
|
| 3636 |
-
|
|
|
|
|
|
|
|
|
|
| 3637 |
|
| 3638 |
-
case 'help':
|
| 3639 |
-
return Object(external_this_wp_element_["createElement"])(HelpPanel, {
|
| 3640 |
-
taskName: task
|
| 3641 |
-
});
|
| 3642 |
|
| 3643 |
-
|
| 3644 |
-
|
| 3645 |
}
|
| 3646 |
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3647 |
|
| 3648 |
-
var redirectToHomeScreen = function redirectToHomeScreen() {
|
| 3649 |
-
if (Object(utils["f" /* isWCAdmin */])(window.location.href)) {
|
| 3650 |
-
Object(external_this_wc_navigation_["getHistory"])().push(Object(external_this_wc_navigation_["getNewPath"])({}, '/', {}));
|
| 3651 |
-
} else {
|
| 3652 |
-
window.location.href = Object(wc_admin_settings["f" /* getAdminLink */])('admin.php?page=wc-admin');
|
| 3653 |
-
}
|
| 3654 |
-
};
|
| 3655 |
|
| 3656 |
-
|
| 3657 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3658 |
|
| 3659 |
-
|
| 3660 |
-
|
| 3661 |
-
|
| 3662 |
-
});
|
| 3663 |
-
}
|
| 3664 |
-
};
|
| 3665 |
|
| 3666 |
-
var shouldShowHelpTooltip = function shouldShowHelpTooltip() {
|
| 3667 |
-
var task = query.task;
|
| 3668 |
-
var startedTasks = userPreferencesData && userPreferencesData.task_list_tracked_started_tasks;
|
| 3669 |
-
var highlightShown = userPreferencesData && userPreferencesData.help_panel_highlight_shown;
|
| 3670 |
|
| 3671 |
-
|
| 3672 |
-
return true;
|
| 3673 |
-
}
|
| 3674 |
|
| 3675 |
-
|
| 3676 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3677 |
|
| 3678 |
-
|
| 3679 |
-
|
| 3680 |
-
|
| 3681 |
-
'is-mobile-open': mobileOpen
|
| 3682 |
-
});
|
| 3683 |
-
var showHelpHighlightTooltip = shouldShowHelpTooltip();
|
| 3684 |
-
var hasUnread = tabs.some(function (tab) {
|
| 3685 |
-
return tab.unread;
|
| 3686 |
-
});
|
| 3687 |
-
var viewLabel = hasUnread ? Object(external_this_wp_i18n_["__"])('View Activity Panel, you have unread activity', 'woocommerce-admin') : Object(external_this_wp_i18n_["__"])('View Activity Panel', 'woocommerce-admin');
|
| 3688 |
-
return Object(external_this_wp_element_["createElement"])("div", null, Object(external_this_wp_element_["createElement"])(external_this_wc_components_["H"], {
|
| 3689 |
-
id: headerId,
|
| 3690 |
-
className: "screen-reader-text"
|
| 3691 |
-
}, Object(external_this_wp_i18n_["__"])('Store Activity', 'woocommerce-admin')), Object(external_this_wp_element_["createElement"])(external_this_wc_components_["Section"], {
|
| 3692 |
-
component: "aside",
|
| 3693 |
-
id: "woocommerce-activity-panel",
|
| 3694 |
-
"aria-labelledby": headerId
|
| 3695 |
-
}, Object(external_this_wp_element_["createElement"])(external_this_wp_components_["Button"], {
|
| 3696 |
-
onClick: function onClick() {
|
| 3697 |
-
toggleMobile();
|
| 3698 |
-
},
|
| 3699 |
-
label: mobileOpen ? Object(external_this_wp_i18n_["__"])('Close Activity Panel', 'woocommerce-admin') : viewLabel,
|
| 3700 |
-
"aria-expanded": mobileOpen,
|
| 3701 |
-
className: "woocommerce-layout__activity-panel-mobile-toggle"
|
| 3702 |
-
}, mobileOpen ? Object(external_this_wp_element_["createElement"])(cross_small_default.a, null) : Object(external_this_wp_element_["createElement"])(toggle_bubble, {
|
| 3703 |
-
hasUnread: hasUnread
|
| 3704 |
-
})), Object(external_this_wp_element_["createElement"])("div", {
|
| 3705 |
-
className: panelClasses
|
| 3706 |
-
}, Object(external_this_wp_element_["createElement"])(tabs_Tabs, {
|
| 3707 |
-
tabs: tabs,
|
| 3708 |
-
tabOpen: isPanelOpen,
|
| 3709 |
-
selectedTab: currentTab,
|
| 3710 |
-
onTabClick: function onTabClick(tab, tabOpen) {
|
| 3711 |
-
if (tab.onClick) {
|
| 3712 |
-
tab.onClick();
|
| 3713 |
-
return;
|
| 3714 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3715 |
|
| 3716 |
-
|
| 3717 |
-
|
| 3718 |
-
|
| 3719 |
-
|
| 3720 |
-
|
| 3721 |
-
|
| 3722 |
-
|
| 3723 |
-
name: currentTab
|
| 3724 |
-
}),
|
| 3725 |
-
content: getPanelContent(currentTab),
|
| 3726 |
-
closePanel: function closePanel() {
|
| 3727 |
-
return _closePanel();
|
| 3728 |
-
},
|
| 3729 |
-
clearPanel: function clearPanel() {
|
| 3730 |
-
return _clearPanel();
|
| 3731 |
-
}
|
| 3732 |
-
}))), showHelpHighlightTooltip ? Object(external_this_wp_element_["createElement"])(HighlightTooltip, {
|
| 3733 |
-
delay: 1000,
|
| 3734 |
-
useAnchor: true,
|
| 3735 |
-
title: Object(external_this_wp_i18n_["__"])("We're here for help", 'woocommerce-admin'),
|
| 3736 |
-
content: Object(external_this_wp_i18n_["__"])('If you have any questions, feel free to explore the WooCommerce docs listed here.', 'woocommerce-admin'),
|
| 3737 |
-
closeButtonText: Object(external_this_wp_i18n_["__"])('Got it', 'woocommerce-admin'),
|
| 3738 |
-
id: "activity-panel-tab-help",
|
| 3739 |
-
onClose: function onClose() {
|
| 3740 |
-
return closedHelpPanelHighlight();
|
| 3741 |
-
},
|
| 3742 |
-
onShow: function onShow() {
|
| 3743 |
-
return Object(external_this_wc_tracks_["recordEvent"])('help_tooltip_view');
|
| 3744 |
}
|
| 3745 |
-
}
|
| 3746 |
-
|
| 3747 |
-
|
| 3748 |
-
|
| 3749 |
-
|
| 3750 |
-
|
| 3751 |
-
|
| 3752 |
-
|
| 3753 |
-
|
| 3754 |
-
|
| 3755 |
-
|
| 3756 |
-
|
| 3757 |
-
|
| 3758 |
-
|
| 3759 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3760 |
|
| 3761 |
-
|
| 3762 |
-
|
| 3763 |
-
return IOS_PLATFORM;
|
| 3764 |
-
} else if (/Android/i.test(window.navigator.userAgent)) {
|
| 3765 |
-
return ANDROID_PLATFORM;
|
| 3766 |
}
|
| 3767 |
|
| 3768 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3769 |
};
|
| 3770 |
-
// CONCATENATED MODULE: ./client/mobile-banner/app-icon.js
|
| 3771 |
|
| 3772 |
-
var
|
| 3773 |
-
|
| 3774 |
-
|
| 3775 |
-
|
| 3776 |
-
|
| 3777 |
-
|
| 3778 |
-
|
| 3779 |
-
|
| 3780 |
-
|
| 3781 |
-
|
| 3782 |
-
rx: "21.3953",
|
| 3783 |
-
fill: "#7F54B3"
|
| 3784 |
-
}), Object(external_this_wp_element_["createElement"])("path", {
|
| 3785 |
-
fillRule: "evenodd",
|
| 3786 |
-
clipRule: "evenodd",
|
| 3787 |
-
d: "M72.5937 28.043H19.8094C16.4781 28.0459 13.7783 30.7705 13.7754 34.1324V54.4501C13.7783 57.812 16.4781 60.5366 19.8094 60.5395H44.8229L56.2573 66.9607L53.6672 60.5395H72.599C74.2009 60.5402 75.7374 59.8983 76.8702 58.7552C78.0029 57.612 78.639 56.0614 78.6383 54.4447V34.1324C78.6376 32.5157 78.0002 30.9657 76.8664 29.8235C75.7327 28.6814 74.1956 28.0408 72.5937 28.043ZM19.1057 32.4208C18.4658 32.4324 17.8646 32.7359 17.467 33.2482C17.0888 33.7635 16.9404 34.4175 17.058 35.0502C18.5962 45.0986 20.0338 51.8757 21.371 55.3816C21.8779 56.658 22.4896 57.2703 23.2063 57.2185C24.3075 57.1489 25.6263 55.5968 27.1627 52.5621C27.9964 50.8412 29.2602 48.2662 30.9539 44.837C32.3785 49.88 34.309 53.6787 36.7456 56.2331C37.4291 56.9436 38.1204 57.2748 38.8195 57.2266C39.4185 57.1931 39.953 56.8315 40.217 56.2813C40.4753 55.7358 40.5806 55.1278 40.5211 54.5248C40.3516 52.0703 40.5919 48.667 41.2421 44.3149C41.9081 39.8057 42.7523 36.5818 43.7749 34.6432C43.9822 34.2526 44.0733 33.8087 44.037 33.366C44.0039 32.7587 43.7116 32.1969 43.2374 31.829C42.7745 31.4367 42.1799 31.2446 41.5803 31.2935C40.8334 31.3325 40.1682 31.7885 39.8499 32.4797C38.2331 35.5019 37.0812 40.4109 36.3943 47.2068C35.2823 44.2394 34.4509 41.1703 33.9114 38.0412C33.623 36.4613 32.9037 35.7125 31.7536 35.7946C30.9592 35.8589 30.3063 36.3944 29.7819 37.4012L24.0348 48.5643C23.0997 44.6692 22.2205 39.9289 21.3972 34.3433C21.1997 32.9652 20.4358 32.3244 19.1057 32.4208ZM69.9089 34.6877C71.6969 35.0381 73.2407 36.2 74.1186 37.8559C74.9693 39.3247 75.3946 41.1161 75.3946 43.23C75.4148 45.9567 74.7062 48.6357 73.3477 50.9687C71.7778 53.7023 69.7195 55.0691 67.1727 55.0691C66.6933 55.0668 66.2153 55.0128 65.7467 54.9078C63.9584 54.5581 62.4143 53.396 61.5371 51.7396C60.6864 50.2452 60.261 48.4411 60.261 46.3272C60.2357 43.6127 60.945 40.9454 62.3079 38.6295C63.9023 35.8959 65.9607 34.5291 68.4829 34.5291C68.9623 34.5304 69.4402 34.5836 69.9089 34.6877ZM68.7937 49.4848C69.7707 48.5773 70.4399 47.2269 70.8012 45.4337V45.4419C70.9315 44.7826 70.9959 44.1112 70.9933 43.4382C70.986 42.5849 70.8291 41.74 70.5302 40.9452C70.1443 39.901 69.6304 39.3124 68.9884 39.1793C68.0378 38.9643 67.1239 39.5256 66.2469 40.8632C65.5812 41.8393 65.109 42.9432 64.8577 44.1106C64.7276 44.7708 64.6632 45.4432 64.6657 46.1171C64.6739 46.9677 64.8308 47.8096 65.1287 48.6019C65.5146 49.6388 66.0294 50.2274 66.6731 50.3678C67.3169 50.5081 68.0237 50.2138 68.7937 49.4848ZM57.9079 37.8559C57.0291 36.2008 55.4854 35.0392 53.6976 34.6877C53.2279 34.5837 52.749 34.5306 52.2687 34.5291C49.7443 34.5291 47.6856 35.8959 46.0927 38.6295C44.7295 40.9454 44.0201 43.6127 44.0454 46.3272C44.0454 48.4411 44.4699 50.2452 45.319 51.7396C46.1976 53.3949 47.7414 54.5566 49.5294 54.9078C49.999 55.0126 50.4779 55.0667 50.9582 55.0691C53.5055 55.0691 55.5642 53.7023 57.1343 50.9687C58.4922 48.6355 59.2001 45.9565 59.1789 43.23C59.1789 41.1161 58.7544 39.3247 57.9053 37.8559H57.9079ZM54.5903 45.4337C54.2307 47.2269 53.5614 48.5773 52.5825 49.4848C51.8115 50.2065 51.101 50.5017 50.4589 50.3678C49.8169 50.2338 49.3011 49.6461 48.9169 48.6019C48.6181 47.8097 48.4603 46.9678 48.4511 46.1171C48.4495 45.4431 48.5148 44.7707 48.6459 44.1106C48.8971 42.9432 49.3694 41.8393 50.0353 40.8632C50.9124 39.5256 51.8264 38.9643 52.7773 39.1793C53.4193 39.3124 53.9333 39.901 54.3193 40.9452C54.617 41.7404 54.7739 42.585 54.7824 43.4382C54.785 44.1112 54.7207 44.7826 54.5903 45.4419V45.4337Z",
|
| 3788 |
-
fill: "white"
|
| 3789 |
-
}));
|
| 3790 |
};
|
| 3791 |
-
// EXTERNAL MODULE: ./client/mobile-banner/style.scss
|
| 3792 |
-
var mobile_banner_style = __webpack_require__(302);
|
| 3793 |
|
| 3794 |
-
|
| 3795 |
-
|
| 3796 |
-
// It is nearly impossible to fake navigation in JSDOM 16, so exposing this link for mocking allows us to
|
| 3797 |
-
// avoid triggering a navigation.
|
| 3798 |
-
var PLAY_STORE_LINK = 'https://play.google.com/store/apps/details?id=com.woocommerce.android';
|
| 3799 |
-
var TRACKING_EVENT_NAME = 'wcadmin_mobile_android_banner_click';
|
| 3800 |
-
// CONCATENATED MODULE: ./client/mobile-banner/index.js
|
| 3801 |
|
|
|
|
| 3802 |
|
|
|
|
|
|
|
| 3803 |
|
| 3804 |
/**
|
| 3805 |
-
*
|
|
|
|
|
|
|
|
|
|
| 3806 |
*/
|
| 3807 |
|
|
|
|
|
|
|
| 3808 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3809 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3810 |
|
| 3811 |
-
|
| 3812 |
-
|
| 3813 |
-
|
|
|
|
|
|
|
| 3814 |
|
|
|
|
|
|
|
|
|
|
| 3815 |
|
|
|
|
|
|
|
|
|
|
| 3816 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3817 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3818 |
|
| 3819 |
-
|
| 3820 |
-
|
| 3821 |
-
var
|
| 3822 |
-
onDismiss = _ref.onDismiss;
|
| 3823 |
-
Object(external_this_wp_element_["useEffect"])(function () {
|
| 3824 |
-
var layout = document.getElementsByClassName('woocommerce-layout')[0];
|
| 3825 |
|
| 3826 |
-
|
| 3827 |
-
|
| 3828 |
-
|
| 3829 |
-
|
| 3830 |
-
|
| 3831 |
-
|
| 3832 |
-
|
| 3833 |
-
}
|
| 3834 |
|
| 3835 |
-
|
| 3836 |
-
|
| 3837 |
-
|
| 3838 |
-
|
| 3839 |
-
|
| 3840 |
-
}
|
| 3841 |
|
| 3842 |
-
var
|
| 3843 |
-
|
| 3844 |
-
|
| 3845 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3846 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3847 |
|
| 3848 |
-
|
| 3849 |
-
|
| 3850 |
-
|
| 3851 |
-
|
| 3852 |
-
|
| 3853 |
-
|
| 3854 |
-
|
| 3855 |
-
|
| 3856 |
-
setDismissed(true);
|
| 3857 |
-
Object(external_this_wc_tracks_["recordEvent"])(TRACKING_EVENT_NAME, {
|
| 3858 |
-
action: 'dismiss'
|
| 3859 |
-
});
|
| 3860 |
-
}
|
| 3861 |
-
}), Object(external_this_wp_element_["createElement"])(app_icon_AppIcon, null), Object(external_this_wp_element_["createElement"])("div", {
|
| 3862 |
-
className: "woocommerce-mobile-app-banner__description"
|
| 3863 |
-
}, Object(external_this_wp_element_["createElement"])("p", {
|
| 3864 |
-
className: "woocommerce-mobile-app-banner__description__text"
|
| 3865 |
-
}, Object(external_this_wp_i18n_["__"])('Run your store from anywhere', 'woocommerce-admin')), Object(external_this_wp_element_["createElement"])("p", {
|
| 3866 |
-
className: "woocommerce-mobile-app-banner__description__text"
|
| 3867 |
-
}, Object(external_this_wp_i18n_["__"])('Download the WooCommerce app', 'woocommerce-admin'))), Object(external_this_wp_element_["createElement"])(external_this_wp_components_["Button"], {
|
| 3868 |
-
href: PLAY_STORE_LINK,
|
| 3869 |
-
isSecondary: true,
|
| 3870 |
-
onClick: function onClick() {
|
| 3871 |
-
onInstall();
|
| 3872 |
-
setDismissed(true);
|
| 3873 |
-
Object(external_this_wc_tracks_["recordEvent"])(TRACKING_EVENT_NAME, {
|
| 3874 |
-
action: 'install'
|
| 3875 |
-
});
|
| 3876 |
-
}
|
| 3877 |
-
}, Object(external_this_wp_i18n_["__"])('Install', 'woocommerce-admin')));
|
| 3878 |
}
|
| 3879 |
|
| 3880 |
-
|
| 3881 |
-
|
| 3882 |
-
|
| 3883 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3884 |
|
| 3885 |
-
|
| 3886 |
-
|
| 3887 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3888 |
|
| 3889 |
-
function
|
| 3890 |
-
|
| 3891 |
-
|
| 3892 |
-
|
| 3893 |
-
|
|
|
|
|
|
|
| 3894 |
|
| 3895 |
-
|
| 3896 |
-
|
| 3897 |
-
|
| 3898 |
-
|
| 3899 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3900 |
|
| 3901 |
-
|
| 3902 |
-
|
| 3903 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3904 |
|
| 3905 |
-
|
| 3906 |
-
return function () {
|
| 3907 |
-
window.removeEventListener('scroll', scrollListener);
|
| 3908 |
-
window.cancelAnimationFrame(rafHandle.current);
|
| 3909 |
-
};
|
| 3910 |
-
}, []);
|
| 3911 |
-
return isScrolled;
|
| 3912 |
-
}
|
| 3913 |
-
// EXTERNAL MODULE: external {"this":["wp","plugins"]}
|
| 3914 |
-
var external_this_wp_plugins_ = __webpack_require__(139);
|
| 3915 |
|
| 3916 |
-
|
| 3917 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3918 |
|
| 3919 |
-
|
| 3920 |
-
|
| 3921 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3922 |
|
| 3923 |
-
//
|
|
|
|
|
|
|
|
|
|
| 3924 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3925 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3926 |
|
| 3927 |
-
|
|
|
|
|
|
|
|
|
|
| 3928 |
|
| 3929 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3930 |
|
| 3931 |
-
|
| 3932 |
-
|
| 3933 |
-
*/
|
| 3934 |
|
| 3935 |
-
|
| 3936 |
-
|
| 3937 |
-
|
| 3938 |
-
|
| 3939 |
-
* @return {string} Full URL
|
| 3940 |
-
*/
|
| 3941 |
|
| 3942 |
-
|
| 3943 |
-
|
| 3944 |
-
|
| 3945 |
-
|
| 3946 |
-
search = _window$location.search;
|
| 3947 |
|
| 3948 |
-
|
| 3949 |
-
|
| 3950 |
-
|
|
|
|
| 3951 |
|
| 3952 |
-
|
| 3953 |
-
|
| 3954 |
-
}
|
| 3955 |
|
| 3956 |
-
|
| 3957 |
-
|
| 3958 |
-
|
| 3959 |
-
|
| 3960 |
-
|
| 3961 |
-
|
| 3962 |
-
|
| 3963 |
-
|
| 3964 |
-
|
| 3965 |
-
*/
|
| 3966 |
|
| 3967 |
-
|
| 3968 |
-
|
|
|
|
|
|
|
| 3969 |
|
| 3970 |
-
|
| 3971 |
-
|
| 3972 |
-
|
|
|
|
|
|
|
| 3973 |
|
| 3974 |
-
|
| 3975 |
-
var href = location.href; // Return highest possible score for exact match.
|
| 3976 |
|
| 3977 |
-
|
| 3978 |
-
|
| 3979 |
-
|
| 3980 |
|
| 3981 |
-
|
| 3982 |
-
var regexp = new RegExp(itemExpression || defaultExpression, 'i');
|
| 3983 |
-
return (decodeURIComponent(href).match(regexp) || []).length;
|
| 3984 |
-
};
|
| 3985 |
-
/**
|
| 3986 |
-
* Get a default expression to match the path and provided params.
|
| 3987 |
-
*
|
| 3988 |
-
* @param {string} url URL to match.
|
| 3989 |
-
* @return {string} Regex expression.
|
| 3990 |
-
*/
|
| 3991 |
|
| 3992 |
-
var
|
| 3993 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3994 |
|
| 3995 |
-
|
| 3996 |
-
|
| 3997 |
-
|
| 3998 |
-
args = _escapedUrl$split2[1],
|
| 3999 |
-
hash = _escapedUrl$split2[2];
|
| 4000 |
|
| 4001 |
-
|
| 4002 |
-
|
| 4003 |
-
|
| 4004 |
-
|
| 4005 |
-
return '^' + path + argsExpression + hashExpression;
|
| 4006 |
-
};
|
| 4007 |
-
/**
|
| 4008 |
-
* Adds a listener that runs on history change.
|
| 4009 |
-
*
|
| 4010 |
-
* @param {Function} listener Listener to add on history change.
|
| 4011 |
-
* @return {Function} Function to remove listeners.
|
| 4012 |
-
*/
|
| 4013 |
|
| 4014 |
-
|
| 4015 |
-
|
| 4016 |
-
|
| 4017 |
-
|
| 4018 |
-
|
| 4019 |
-
|
| 4020 |
-
|
|
|
|
|
|
|
|
|
|
| 4021 |
|
| 4022 |
-
|
| 4023 |
-
|
| 4024 |
-
|
| 4025 |
-
|
| 4026 |
-
|
| 4027 |
-
|
| 4028 |
-
|
| 4029 |
-
|
| 4030 |
-
|
| 4031 |
-
|
| 4032 |
-
state: state
|
| 4033 |
-
});
|
| 4034 |
-
window.dispatchEvent(replaceStateEvent);
|
| 4035 |
-
return replaceState.apply(history, arguments);
|
| 4036 |
-
};
|
| 4037 |
|
| 4038 |
-
|
| 4039 |
-
|
| 4040 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4041 |
|
| 4042 |
-
|
| 4043 |
-
|
| 4044 |
-
|
| 4045 |
-
|
| 4046 |
-
|
| 4047 |
-
|
| 4048 |
-
window.removeEventListener('replacestate', listener);
|
| 4049 |
-
};
|
| 4050 |
-
};
|
| 4051 |
-
/**
|
| 4052 |
-
* Get the closest matching item.
|
| 4053 |
-
*
|
| 4054 |
-
* @param {Array} items An array of items to match against.
|
| 4055 |
-
*/
|
| 4056 |
|
| 4057 |
-
|
| 4058 |
-
|
| 4059 |
-
|
| 4060 |
-
|
| 4061 |
-
var score = getMatchScore(window.location, Object(wc_admin_settings["f" /* getAdminLink */])(item.url), item.matchExpression);
|
| 4062 |
|
| 4063 |
-
|
| 4064 |
-
highestMatchScore = score;
|
| 4065 |
-
matchedItem = item;
|
| 4066 |
}
|
| 4067 |
-
});
|
| 4068 |
-
return matchedItem || null;
|
| 4069 |
-
};
|
| 4070 |
-
/**
|
| 4071 |
-
* Available menu IDs.
|
| 4072 |
-
*/
|
| 4073 |
|
| 4074 |
-
var
|
| 4075 |
-
/**
|
| 4076 |
-
* Default categories for the menu.
|
| 4077 |
-
*/
|
| 4078 |
-
|
| 4079 |
-
var defaultCategories = {
|
| 4080 |
-
woocommerce: {
|
| 4081 |
-
id: 'woocommerce',
|
| 4082 |
-
isCategory: true,
|
| 4083 |
-
menuId: 'primary',
|
| 4084 |
-
migrate: true,
|
| 4085 |
-
order: 10,
|
| 4086 |
-
parent: '',
|
| 4087 |
-
title: 'WooCommerce'
|
| 4088 |
-
}
|
| 4089 |
-
};
|
| 4090 |
-
/**
|
| 4091 |
-
* Sort an array of menu items by their order property.
|
| 4092 |
-
*
|
| 4093 |
-
* @param {Array} menuItems Array of menu items.
|
| 4094 |
-
* @return {Array} Sorted menu items.
|
| 4095 |
-
*/
|
| 4096 |
|
| 4097 |
-
|
| 4098 |
-
|
| 4099 |
-
|
| 4100 |
-
|
|
|
|
| 4101 |
}
|
| 4102 |
|
| 4103 |
-
|
| 4104 |
-
});
|
| 4105 |
-
};
|
| 4106 |
-
/**
|
| 4107 |
-
* Get a flat tree structure of all Categories and thier children grouped by menuId
|
| 4108 |
-
*
|
| 4109 |
-
* @param {Array} menuItems Array of menu items.
|
| 4110 |
-
* @param {Function} currentUserCan Callback method passed the capability to determine if a menu item is visible.
|
| 4111 |
-
* @return {Object} Mapped menu items and categories.
|
| 4112 |
-
*/
|
| 4113 |
|
| 4114 |
-
|
| 4115 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4116 |
|
| 4117 |
-
|
|
|
|
|
|
|
|
|
|
| 4118 |
|
| 4119 |
-
|
| 4120 |
-
|
| 4121 |
-
if (!acc[item.parent]) {
|
| 4122 |
-
acc[item.parent] = {};
|
| 4123 |
-
menuIds.forEach(function (menuId) {
|
| 4124 |
-
acc[item.parent][menuId] = [];
|
| 4125 |
-
});
|
| 4126 |
-
} // Incorrect menu ID.
|
| 4127 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4128 |
|
| 4129 |
-
|
| 4130 |
-
|
| 4131 |
-
|
|
|
|
| 4132 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4133 |
|
| 4134 |
-
|
| 4135 |
-
|
| 4136 |
-
|
| 4137 |
|
|
|
|
| 4138 |
|
| 4139 |
-
|
| 4140 |
-
|
| 4141 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4142 |
|
| 4143 |
-
|
| 4144 |
-
return
|
| 4145 |
-
}, {});
|
| 4146 |
-
return {
|
| 4147 |
-
items: items,
|
| 4148 |
-
categories: categories
|
| 4149 |
};
|
| 4150 |
-
};
|
| 4151 |
-
// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/wordpress.js
|
| 4152 |
|
|
|
|
|
|
|
| 4153 |
|
| 4154 |
-
|
| 4155 |
-
|
| 4156 |
-
|
| 4157 |
|
| 4158 |
-
|
| 4159 |
-
|
| 4160 |
-
|
| 4161 |
-
}
|
| 4162 |
-
d: "M20 10c0-5.51-4.49-10-10-10C4.48 0 0 4.49 0 10c0 5.52 4.48 10 10 10 5.51 0 10-4.48 10-10zM7.78 15.37L4.37 6.22c.55-.02 1.17-.08 1.17-.08.5-.06.44-1.13-.06-1.11 0 0-1.45.11-2.37.11-.18 0-.37 0-.58-.01C4.12 2.69 6.87 1.11 10 1.11c2.33 0 4.45.87 6.05 2.34-.68-.11-1.65.39-1.65 1.58 0 .74.45 1.36.9 2.1.35.61.55 1.36.55 2.46 0 1.49-1.4 5-1.4 5l-3.03-8.37c.54-.02.82-.17.82-.17.5-.05.44-1.25-.06-1.22 0 0-1.44.12-2.38.12-.87 0-2.33-.12-2.33-.12-.5-.03-.56 1.2-.06 1.22l.92.08 1.26 3.41zM17.41 10c.24-.64.74-1.87.43-4.25.7 1.29 1.05 2.71 1.05 4.25 0 3.29-1.73 6.24-4.4 7.78.97-2.59 1.94-5.2 2.92-7.78zM6.1 18.09C3.12 16.65 1.11 13.53 1.11 10c0-1.3.23-2.48.72-3.59C3.25 10.3 4.67 14.2 6.1 18.09zm4.03-6.63l2.58 6.98c-.86.29-1.76.45-2.71.45-.79 0-1.57-.11-2.29-.33.81-2.38 1.62-4.74 2.42-7.1z"
|
| 4163 |
-
}));
|
| 4164 |
-
/* harmony default export */ var library_wordpress = (wordpress);
|
| 4165 |
-
//# sourceMappingURL=wordpress.js.map
|
| 4166 |
-
// CONCATENATED MODULE: ./client/navigation/components/header/index.js
|
| 4167 |
|
|
|
|
|
|
|
| 4168 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4169 |
|
| 4170 |
-
|
| 4171 |
-
|
| 4172 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4173 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4174 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4175 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4176 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4177 |
|
|
|
|
|
|
|
|
|
|
| 4178 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4179 |
|
|
|
|
|
|
|
| 4180 |
|
|
|
|
|
|
|
| 4181 |
|
| 4182 |
-
|
| 4183 |
-
|
| 4184 |
-
|
| 4185 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4186 |
|
|
|
|
|
|
|
|
|
|
| 4187 |
|
|
|
|
|
|
|
| 4188 |
|
| 4189 |
-
|
| 4190 |
-
|
| 4191 |
-
|
| 4192 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4193 |
|
| 4194 |
-
|
| 4195 |
-
|
| 4196 |
-
isFolded = _useState2[0],
|
| 4197 |
-
setIsFolded = _useState2[1];
|
| 4198 |
|
| 4199 |
-
|
| 4200 |
-
folded: 'is-wc-nav-folded',
|
| 4201 |
-
expanded: 'is-wc-nav-expanded'
|
| 4202 |
-
};
|
| 4203 |
-
|
| 4204 |
-
var foldNav = function foldNav() {
|
| 4205 |
-
document.body.classList.add(navClasses.folded);
|
| 4206 |
-
document.body.classList.remove(navClasses.expanded);
|
| 4207 |
-
setIsFolded(true);
|
| 4208 |
-
};
|
| 4209 |
|
| 4210 |
-
|
| 4211 |
-
|
| 4212 |
-
|
| 4213 |
-
|
| 4214 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4215 |
|
| 4216 |
-
|
| 4217 |
-
|
| 4218 |
-
expandNav();
|
| 4219 |
-
} else {
|
| 4220 |
-
foldNav();
|
| 4221 |
-
}
|
| 4222 |
-
};
|
| 4223 |
|
| 4224 |
-
|
| 4225 |
-
|
|
|
|
|
|
|
|
|
|
| 4226 |
|
| 4227 |
-
|
| 4228 |
-
|
| 4229 |
-
} else {
|
| 4230 |
-
expandNav();
|
| 4231 |
-
}
|
| 4232 |
-
};
|
| 4233 |
|
| 4234 |
-
|
| 4235 |
-
|
| 4236 |
-
|
| 4237 |
-
eventName: 'orientationchange',
|
| 4238 |
-
handler: function handler(e) {
|
| 4239 |
-
return foldOnMobile(e.target.screen.availWidth);
|
| 4240 |
}
|
| 4241 |
-
}, {
|
| 4242 |
-
eventName: 'resize',
|
| 4243 |
-
handler: Object(external_lodash_["debounce"])(function () {
|
| 4244 |
-
return foldOnMobile();
|
| 4245 |
-
}, 200)
|
| 4246 |
-
}];
|
| 4247 |
-
|
| 4248 |
-
for (var _i = 0, _foldEvents = foldEvents; _i < _foldEvents.length; _i++) {
|
| 4249 |
-
var _foldEvents$_i = _foldEvents[_i],
|
| 4250 |
-
eventName = _foldEvents$_i.eventName,
|
| 4251 |
-
handler = _foldEvents$_i.handler;
|
| 4252 |
-
window.addEventListener(eventName, handler, false);
|
| 4253 |
-
}
|
| 4254 |
|
| 4255 |
-
|
| 4256 |
-
|
| 4257 |
-
|
| 4258 |
-
|
| 4259 |
-
|
| 4260 |
-
size: "36px",
|
| 4261 |
-
icon: library_wordpress
|
| 4262 |
-
});
|
| 4263 |
|
| 4264 |
-
|
| 4265 |
-
|
| 4266 |
-
|
|
|
|
|
|
|
|
|
|
| 4267 |
|
| 4268 |
-
|
| 4269 |
-
|
| 4270 |
|
| 4271 |
-
|
| 4272 |
-
|
| 4273 |
-
|
| 4274 |
-
siteIconUrl: siteData.siteIconUrl
|
| 4275 |
-
};
|
| 4276 |
-
}),
|
| 4277 |
-
isRequestingSiteIcon = _useSelect.isRequestingSiteIcon,
|
| 4278 |
-
siteIconUrl = _useSelect.siteIconUrl;
|
| 4279 |
|
| 4280 |
-
|
| 4281 |
-
|
| 4282 |
-
|
| 4283 |
-
|
| 4284 |
-
|
| 4285 |
-
|
| 4286 |
-
buttonIcon = null;
|
| 4287 |
-
}
|
| 4288 |
|
| 4289 |
-
|
| 4290 |
-
|
| 4291 |
-
|
| 4292 |
-
return Object(external_this_wp_element_["createElement"])("div", {
|
| 4293 |
-
className: className
|
| 4294 |
-
}, Object(external_this_wp_element_["createElement"])(external_this_wp_components_["Button"], {
|
| 4295 |
-
onClick: function onClick() {
|
| 4296 |
-
return toggleFolded();
|
| 4297 |
-
},
|
| 4298 |
-
className: "woocommerce-navigation-header__site-icon",
|
| 4299 |
-
"aria-label": "Fold navigation",
|
| 4300 |
-
role: "switch",
|
| 4301 |
-
"aria-checked": isFolded ? 'true' : 'false'
|
| 4302 |
-
}, buttonIcon), Object(external_this_wp_element_["createElement"])(external_this_wp_components_["Button"], {
|
| 4303 |
-
href: homeUrl,
|
| 4304 |
-
className: "woocommerce-navigation-header__site-title",
|
| 4305 |
-
as: "span"
|
| 4306 |
-
}, Object(external_this_wp_htmlEntities_["decodeEntities"])(siteTitle)));
|
| 4307 |
-
};
|
| 4308 |
|
| 4309 |
-
|
| 4310 |
-
|
| 4311 |
-
|
|
|
|
|
|
|
|
|
|
| 4312 |
|
| 4313 |
-
|
| 4314 |
-
|
|
|
|
|
|
|
| 4315 |
|
| 4316 |
-
|
|
|
|
|
|
|
|
|
|
| 4317 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4318 |
|
| 4319 |
-
|
| 4320 |
-
|
| 4321 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4322 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4323 |
|
|
|
|
|
|
|
|
|
|
| 4324 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4325 |
|
|
|
|
|
|
|
| 4326 |
|
| 4327 |
-
|
| 4328 |
-
|
| 4329 |
-
|
|
|
|
| 4330 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4331 |
|
| 4332 |
-
|
| 4333 |
-
|
| 4334 |
|
| 4335 |
-
|
| 4336 |
-
|
| 4337 |
-
|
| 4338 |
-
|
| 4339 |
-
|
| 4340 |
-
|
| 4341 |
-
|
| 4342 |
-
|
|
|
|
|
|
|
| 4343 |
|
| 4344 |
-
|
| 4345 |
-
|
| 4346 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4347 |
|
| 4348 |
-
|
|
|
|
|
|
|
|
|
|
| 4349 |
|
| 4350 |
-
|
| 4351 |
-
|
| 4352 |
-
|
| 4353 |
-
|
| 4354 |
-
|
| 4355 |
-
|
| 4356 |
-
});
|
| 4357 |
-
};
|
| 4358 |
|
| 4359 |
-
|
| 4360 |
-
|
| 4361 |
-
|
|
|
|
|
|
|
| 4362 |
|
| 4363 |
-
|
| 4364 |
-
|
| 4365 |
-
|
| 4366 |
-
isTertiary: true,
|
| 4367 |
-
onClick: toggleFavorite,
|
| 4368 |
-
icon: isFavorited ? 'star-filled' : 'star-empty',
|
| 4369 |
-
"aria-label": isFavorited ? Object(external_this_wp_i18n_["__"])('Add this item to your favorites.', 'woocommerce-admin') : Object(external_this_wp_i18n_["__"])('Remove this item from your favorites.', 'woocommerce-admin')
|
| 4370 |
-
});
|
| 4371 |
-
};
|
| 4372 |
-
/* harmony default export */ var favorite_button = (favorite_button_FavoriteButton);
|
| 4373 |
-
// CONCATENATED MODULE: ./client/navigation/components/favorites-tooltip/index.js
|
| 4374 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4375 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4376 |
|
| 4377 |
-
/**
|
| 4378 |
-
* External dependencies
|
| 4379 |
-
*/
|
| 4380 |
|
|
|
|
| 4381 |
|
|
|
|
|
|
|
| 4382 |
|
|
|
|
| 4383 |
/**
|
| 4384 |
-
*
|
|
|
|
|
|
|
|
|
|
| 4385 |
*/
|
| 4386 |
|
| 4387 |
|
| 4388 |
-
var tooltipHiddenOption = 'woocommerce_navigation_favorites_tooltip_hidden';
|
| 4389 |
-
var favorites_tooltip_FavoritesTooltip = function FavoritesTooltip() {
|
| 4390 |
-
var _useSelect = Object(external_this_wp_data_["useSelect"])(function (select) {
|
| 4391 |
-
var _select = select(external_this_wc_data_["OPTIONS_STORE_NAME"]),
|
| 4392 |
-
getOption = _select.getOption,
|
| 4393 |
-
isResolving = _select.isResolving;
|
| 4394 |
|
| 4395 |
-
|
| 4396 |
-
isFavoritesResolving: select(external_this_wc_data_["NAVIGATION_STORE_NAME"]).isResolving('getFavorites'),
|
| 4397 |
-
isOptionResolving: isResolving('getOption', [tooltipHiddenOption]),
|
| 4398 |
-
isTooltipHidden: getOption(tooltipHiddenOption) === 'yes'
|
| 4399 |
-
};
|
| 4400 |
-
}),
|
| 4401 |
-
isFavoritesResolving = _useSelect.isFavoritesResolving,
|
| 4402 |
-
isOptionResolving = _useSelect.isOptionResolving,
|
| 4403 |
-
isTooltipHidden = _useSelect.isTooltipHidden;
|
| 4404 |
|
| 4405 |
-
|
| 4406 |
-
|
|
|
|
| 4407 |
|
| 4408 |
-
|
| 4409 |
-
|
| 4410 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4411 |
|
| 4412 |
-
|
| 4413 |
-
|
| 4414 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4415 |
|
| 4416 |
-
|
| 4417 |
-
|
| 4418 |
-
|
| 4419 |
-
|
| 4420 |
-
|
| 4421 |
-
|
| 4422 |
-
|
| 4423 |
-
return updateOptions(defineProperty_default()({}, tooltipHiddenOption, 'yes'));
|
| 4424 |
-
},
|
| 4425 |
-
useAnchor: true
|
| 4426 |
-
});
|
| 4427 |
};
|
| 4428 |
-
/* harmony default export */ var favorites_tooltip = (favorites_tooltip_FavoritesTooltip);
|
| 4429 |
-
// CONCATENATED MODULE: ./client/navigation/components/category-title/index.js
|
| 4430 |
|
| 4431 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4432 |
/**
|
| 4433 |
-
*
|
|
|
|
|
|
|
|
|
|
| 4434 |
*/
|
| 4435 |
|
| 4436 |
|
| 4437 |
|
| 4438 |
-
var
|
| 4439 |
-
var category = _ref.category;
|
| 4440 |
-
var id = category.id,
|
| 4441 |
-
title = category.title;
|
| 4442 |
-
var className = 'woocommerce-navigation-category-title';
|
| 4443 |
|
| 4444 |
-
|
| 4445 |
-
return Object(external_this_wp_element_["createElement"])("span", {
|
| 4446 |
-
className: className
|
| 4447 |
-
}, Object(external_this_wp_element_["createElement"])("span", {
|
| 4448 |
-
className: "".concat(className, "__text")
|
| 4449 |
-
}, title), Object(external_this_wp_element_["createElement"])(favorite_button_FavoriteButton, {
|
| 4450 |
-
id: id
|
| 4451 |
-
}), Object(external_this_wp_element_["createElement"])(favorites_tooltip_FavoritesTooltip, null));
|
| 4452 |
-
}
|
| 4453 |
|
| 4454 |
-
return Object(external_this_wp_element_["createElement"])("span", {
|
| 4455 |
-
className: className
|
| 4456 |
-
}, title);
|
| 4457 |
-
};
|
| 4458 |
-
/* harmony default export */ var category_title = (category_title_CategoryTitle);
|
| 4459 |
-
// CONCATENATED MODULE: ./client/navigation/components/Item/index.js
|
| 4460 |
|
|
|
|
| 4461 |
|
| 4462 |
-
|
| 4463 |
-
|
| 4464 |
-
*/
|
| 4465 |
|
|
|
|
| 4466 |
|
| 4467 |
|
|
|
|
| 4468 |
|
| 4469 |
-
|
| 4470 |
-
|
| 4471 |
-
var slot = Object(external_this_wc_navigation_["useNavSlot"])('woocommerce_navigation_' + item.id);
|
| 4472 |
-
var hasFills = Boolean(slot.fills && slot.fills.length);
|
| 4473 |
|
| 4474 |
-
|
| 4475 |
-
Object(external_this_wc_tracks_["recordEvent"])('navigation_click', {
|
| 4476 |
-
menu_item: id
|
| 4477 |
-
});
|
| 4478 |
-
}; // Disable reason: The div wrapping the slot item is used for tracking purposes
|
| 4479 |
-
// and should not be a tabbable element.
|
| 4480 |
|
| 4481 |
-
|
| 4482 |
-
|
|
|
|
| 4483 |
|
|
|
|
| 4484 |
|
| 4485 |
-
|
| 4486 |
-
return Object(external_this_wp_element_["createElement"])(build_module["c" /* NavigationItem */], {
|
| 4487 |
-
key: item.id,
|
| 4488 |
-
item: item.id
|
| 4489 |
-
}, Object(external_this_wp_element_["createElement"])("div", {
|
| 4490 |
-
onClick: function onClick() {
|
| 4491 |
-
return trackClick(item.id);
|
| 4492 |
-
}
|
| 4493 |
-
}, Object(external_this_wp_element_["createElement"])(external_this_wc_navigation_["WooNavigationItem"].Slot, {
|
| 4494 |
-
name: item.id
|
| 4495 |
-
})));
|
| 4496 |
-
}
|
| 4497 |
|
| 4498 |
-
|
| 4499 |
-
|
| 4500 |
-
item: item.id,
|
| 4501 |
-
title: item.title,
|
| 4502 |
-
href: item.url,
|
| 4503 |
-
navigateToMenu: !item.url && item.id,
|
| 4504 |
-
onClick: function onClick() {
|
| 4505 |
-
return trackClick(item.id);
|
| 4506 |
-
},
|
| 4507 |
-
hideIfTargetMenuEmpty: true
|
| 4508 |
-
});
|
| 4509 |
-
/* eslint-enable jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */
|
| 4510 |
-
};
|
| 4511 |
|
| 4512 |
-
|
| 4513 |
-
|
|
|
|
| 4514 |
|
|
|
|
| 4515 |
|
| 4516 |
-
|
| 4517 |
-
* External dependencies
|
| 4518 |
-
*/
|
| 4519 |
|
|
|
|
|
|
|
| 4520 |
|
| 4521 |
-
|
| 4522 |
-
|
| 4523 |
-
|
| 4524 |
|
|
|
|
| 4525 |
|
|
|
|
| 4526 |
|
| 4527 |
-
|
| 4528 |
-
|
| 4529 |
-
onBackClick = _ref.onBackClick,
|
| 4530 |
-
pluginItems = _ref.pluginItems,
|
| 4531 |
-
primaryItems = _ref.primaryItems;
|
| 4532 |
|
| 4533 |
-
|
| 4534 |
-
return null;
|
| 4535 |
-
}
|
| 4536 |
|
| 4537 |
-
var _window$wcNavigation = window.wcNavigation,
|
| 4538 |
-
rootBackLabel = _window$wcNavigation.rootBackLabel,
|
| 4539 |
-
rootBackUrl = _window$wcNavigation.rootBackUrl;
|
| 4540 |
-
var isRootBackVisible = category.id === 'woocommerce' && rootBackUrl;
|
| 4541 |
-
return Object(external_this_wp_element_["createElement"])(build_module["d" /* NavigationMenu */], {
|
| 4542 |
-
title: Object(external_this_wp_element_["createElement"])(category_title, {
|
| 4543 |
-
category: category
|
| 4544 |
-
}),
|
| 4545 |
-
menu: category.id,
|
| 4546 |
-
parentMenu: category.parent,
|
| 4547 |
-
backButtonLabel: isRootBackVisible ? rootBackLabel : category.backButtonLabel || null,
|
| 4548 |
-
onBackButtonClick: isRootBackVisible ? function () {
|
| 4549 |
-
onBackClick('woocommerce');
|
| 4550 |
-
window.location = rootBackUrl;
|
| 4551 |
-
} : function () {
|
| 4552 |
-
return onBackClick(category.id);
|
| 4553 |
-
}
|
| 4554 |
-
}, !!primaryItems.length && Object(external_this_wp_element_["createElement"])(build_module["b" /* NavigationGroup */], null, primaryItems.map(function (item) {
|
| 4555 |
-
return Object(external_this_wp_element_["createElement"])(components_Item, {
|
| 4556 |
-
key: item.id,
|
| 4557 |
-
item: item
|
| 4558 |
-
});
|
| 4559 |
-
})), !!pluginItems.length && Object(external_this_wp_element_["createElement"])(build_module["b" /* NavigationGroup */], {
|
| 4560 |
-
title: category.id === 'woocommerce' ? Object(external_this_wp_i18n_["__"])('Extensions', 'woocommerce-admin') : null
|
| 4561 |
-
}, pluginItems.map(function (item) {
|
| 4562 |
-
return Object(external_this_wp_element_["createElement"])(components_Item, {
|
| 4563 |
-
key: item.id,
|
| 4564 |
-
item: item
|
| 4565 |
-
});
|
| 4566 |
-
})));
|
| 4567 |
-
};
|
| 4568 |
-
// CONCATENATED MODULE: ./client/navigation/components/container/secondary-menu.js
|
| 4569 |
|
|
|
|
| 4570 |
|
| 4571 |
/**
|
| 4572 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4573 |
*/
|
|
|
|
|
|
|
| 4574 |
|
| 4575 |
-
|
| 4576 |
-
|
| 4577 |
-
|
| 4578 |
|
|
|
|
|
|
|
| 4579 |
|
|
|
|
|
|
|
|
|
|
| 4580 |
|
| 4581 |
-
|
| 4582 |
-
|
| 4583 |
-
|
| 4584 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4585 |
|
| 4586 |
-
|
| 4587 |
-
|
| 4588 |
-
}
|
| 4589 |
|
| 4590 |
-
|
| 4591 |
-
|
| 4592 |
-
className: "components-navigation__menu-secondary",
|
| 4593 |
-
title: !isRoot && Object(external_this_wp_element_["createElement"])(category_title, {
|
| 4594 |
-
category: category
|
| 4595 |
-
}),
|
| 4596 |
-
menu: category.id,
|
| 4597 |
-
parentMenu: category.parent,
|
| 4598 |
-
backButtonLabel: category.backButtonLabel || null,
|
| 4599 |
-
onBackButtonClick: isRoot ? null : function () {
|
| 4600 |
-
return onBackClick(category.id);
|
| 4601 |
-
}
|
| 4602 |
-
}, Object(external_this_wp_element_["createElement"])(build_module["b" /* NavigationGroup */], {
|
| 4603 |
-
onBackButtonClick: function onBackButtonClick() {
|
| 4604 |
-
return onBackClick(category.id);
|
| 4605 |
-
}
|
| 4606 |
-
}, items.map(function (item) {
|
| 4607 |
-
return Object(external_this_wp_element_["createElement"])(components_Item, {
|
| 4608 |
-
key: item.id,
|
| 4609 |
-
item: item
|
| 4610 |
-
});
|
| 4611 |
-
})));
|
| 4612 |
-
};
|
| 4613 |
-
// CONCATENATED MODULE: ./client/navigation/components/container/index.js
|
| 4614 |
|
|
|
|
| 4615 |
|
| 4616 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4617 |
|
| 4618 |
/**
|
| 4619 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4620 |
*/
|
|
|
|
|
|
|
| 4621 |
|
|
|
|
|
|
|
|
|
|
| 4622 |
|
|
|
|
|
|
|
|
|
|
| 4623 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4624 |
|
|
|
|
|
|
|
| 4625 |
|
|
|
|
| 4626 |
|
| 4627 |
|
| 4628 |
-
|
| 4629 |
-
* Internal dependencies
|
| 4630 |
-
*/
|
| 4631 |
|
|
|
|
|
|
|
| 4632 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4633 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4634 |
|
|
|
|
| 4635 |
|
|
|
|
| 4636 |
|
| 4637 |
-
|
| 4638 |
-
|
| 4639 |
-
Object(external_this_wp_element_["useEffect"])(function () {
|
| 4640 |
-
// Collapse the original WP Menu.
|
| 4641 |
-
document.documentElement.classList.remove('wp-toolbar');
|
| 4642 |
-
document.body.classList.add('has-woocommerce-navigation');
|
| 4643 |
-
var adminMenu = document.getElementById('adminmenumain');
|
| 4644 |
|
| 4645 |
-
|
| 4646 |
-
|
| 4647 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4648 |
|
| 4649 |
-
|
| 4650 |
-
|
|
|
|
| 4651 |
|
| 4652 |
-
var _useState = Object(external_this_wp_element_["useState"])('woocommerce-home'),
|
| 4653 |
-
_useState2 = slicedToArray_default()(_useState, 2),
|
| 4654 |
-
activeItem = _useState2[0],
|
| 4655 |
-
setActiveItem = _useState2[1];
|
| 4656 |
|
| 4657 |
-
var _useState3 = Object(external_this_wp_element_["useState"])('woocommerce'),
|
| 4658 |
-
_useState4 = slicedToArray_default()(_useState3, 2),
|
| 4659 |
-
activeLevel = _useState4[0],
|
| 4660 |
-
setActiveLevel = _useState4[1];
|
| 4661 |
|
| 4662 |
-
|
| 4663 |
-
|
| 4664 |
-
|
| 4665 |
-
|
| 4666 |
-
|
| 4667 |
-
|
| 4668 |
-
|
| 4669 |
-
|
| 4670 |
-
|
| 4671 |
-
|
| 4672 |
-
|
| 4673 |
-
|
| 4674 |
-
|
| 4675 |
-
setActiveItem(matchedItem);
|
| 4676 |
-
}
|
| 4677 |
-
}, 0);
|
| 4678 |
-
});
|
| 4679 |
-
return removeListener;
|
| 4680 |
-
}, [menuItems]);
|
| 4681 |
|
| 4682 |
-
var _useUser = Object(external_this_wc_data_["useUser"])(),
|
| 4683 |
-
currentUserCan = _useUser.currentUserCan;
|
| 4684 |
|
| 4685 |
-
|
| 4686 |
-
|
| 4687 |
-
|
| 4688 |
-
|
| 4689 |
-
|
|
|
|
|
|
|
| 4690 |
|
| 4691 |
-
|
|
|
|
|
|
|
| 4692 |
|
| 4693 |
-
|
| 4694 |
-
|
| 4695 |
-
|
| 4696 |
-
});
|
| 4697 |
-
};
|
| 4698 |
|
| 4699 |
-
|
| 4700 |
-
|
| 4701 |
-
|
| 4702 |
-
|
| 4703 |
-
|
| 4704 |
-
|
| 4705 |
-
}, Object(external_this_wp_element_["createElement"])(header, null), Object(external_this_wp_element_["createElement"])("div", {
|
| 4706 |
-
className: "woocommerce-navigation__wrapper",
|
| 4707 |
-
ref: navDomRef
|
| 4708 |
-
}, Object(external_this_wp_element_["createElement"])(build_module["a" /* Navigation */], {
|
| 4709 |
-
activeItem: activeItem ? activeItem.id : null,
|
| 4710 |
-
activeMenu: activeLevel,
|
| 4711 |
-
onActivateMenu: function onActivateMenu() {
|
| 4712 |
-
if (navDomRef && navDomRef.current) {
|
| 4713 |
-
navDomRef.current.scrollTop = 0;
|
| 4714 |
-
}
|
| 4715 |
|
| 4716 |
-
setActiveLevel.apply(void 0, arguments);
|
| 4717 |
-
}
|
| 4718 |
-
}, Object.values(categories).map(function (category) {
|
| 4719 |
-
var categoryItems = items[category.id];
|
| 4720 |
-
return !!categoryItems && [Object(external_this_wp_element_["createElement"])(primary_menu_PrimaryMenu, {
|
| 4721 |
-
key: category.id,
|
| 4722 |
-
category: category,
|
| 4723 |
-
onBackClick: onBackClick,
|
| 4724 |
-
primaryItems: [].concat(toConsumableArray_default()(categoryItems.primary), toConsumableArray_default()(categoryItems.favorites)),
|
| 4725 |
-
pluginItems: categoryItems.plugins
|
| 4726 |
-
}), Object(external_this_wp_element_["createElement"])(secondary_menu_SecondaryMenu, {
|
| 4727 |
-
key: "secondary/".concat(category.id),
|
| 4728 |
-
category: category,
|
| 4729 |
-
onBackClick: onBackClick,
|
| 4730 |
-
items: categoryItems.secondary
|
| 4731 |
-
})];
|
| 4732 |
-
}))));
|
| 4733 |
-
};
|
| 4734 |
-
|
| 4735 |
-
/* harmony default export */ var container = (Object(external_this_wp_compose_["compose"])(Object(external_this_wp_data_["withSelect"])(function (select) {
|
| 4736 |
-
var _select = select(external_this_wc_data_["NAVIGATION_STORE_NAME"]),
|
| 4737 |
-
getActiveItem = _select.getActiveItem,
|
| 4738 |
-
getMenuItems = _select.getMenuItems;
|
| 4739 |
|
| 4740 |
-
|
| 4741 |
-
|
| 4742 |
-
|
| 4743 |
-
};
|
| 4744 |
-
}))(container_Container));
|
| 4745 |
-
// CONCATENATED MODULE: ./client/navigation/index.js
|
| 4746 |
|
| 4747 |
|
|
|
|
|
|
|
| 4748 |
/**
|
| 4749 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4750 |
*/
|
| 4751 |
|
| 4752 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4753 |
|
| 4754 |
-
|
| 4755 |
-
|
| 4756 |
-
|
| 4757 |
-
|
| 4758 |
|
|
|
|
|
|
|
| 4759 |
|
|
|
|
|
|
|
|
|
|
| 4760 |
|
| 4761 |
-
var
|
| 4762 |
-
|
| 4763 |
-
|
| 4764 |
|
| 4765 |
-
|
| 4766 |
-
|
| 4767 |
-
|
| 4768 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4769 |
|
|
|
|
|
|
|
|
|
|
| 4770 |
|
|
|
|
| 4771 |
|
| 4772 |
-
|
|
|
|
|
|
|
| 4773 |
|
| 4774 |
-
|
|
|
|
|
|
|
| 4775 |
|
| 4776 |
-
|
| 4777 |
-
|
| 4778 |
-
|
| 4779 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4780 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4781 |
|
|
|
|
|
|
|
|
|
|
| 4782 |
|
|
|
|
|
|
|
|
|
|
| 4783 |
|
| 4784 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4785 |
|
| 4786 |
-
|
| 4787 |
-
|
| 4788 |
-
|
| 4789 |
|
|
|
|
|
|
|
|
|
|
| 4790 |
|
|
|
|
|
|
|
| 4791 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4792 |
|
| 4793 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4794 |
|
| 4795 |
-
|
| 4796 |
-
|
| 4797 |
-
|
| 4798 |
-
|
| 4799 |
-
|
| 4800 |
-
|
| 4801 |
-
|
| 4802 |
-
|
| 4803 |
-
|
|
|
|
| 4804 |
|
| 4805 |
-
|
| 4806 |
-
|
| 4807 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4808 |
|
| 4809 |
-
var
|
| 4810 |
-
|
| 4811 |
-
var
|
| 4812 |
-
'is-scrolled': isScrolled
|
| 4813 |
-
});
|
| 4814 |
-
Object(external_this_wp_element_["useLayoutEffect"])(function () {
|
| 4815 |
-
updateBodyMargin();
|
| 4816 |
-
window.addEventListener('resize', updateBodyMargin);
|
| 4817 |
-
return function () {
|
| 4818 |
-
window.removeEventListener('resize', updateBodyMargin);
|
| 4819 |
-
var wpBody = document.querySelector('#wpbody');
|
| 4820 |
|
| 4821 |
-
|
| 4822 |
-
|
| 4823 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4824 |
|
| 4825 |
-
|
| 4826 |
-
|
| 4827 |
-
|
|
|
|
|
|
|
| 4828 |
|
| 4829 |
-
|
| 4830 |
-
|
| 4831 |
-
debounceTimer = setTimeout(function () {
|
| 4832 |
-
var wpBody = document.querySelector('#wpbody');
|
| 4833 |
|
| 4834 |
-
|
| 4835 |
-
|
| 4836 |
-
|
|
|
|
|
|
|
| 4837 |
|
| 4838 |
-
|
| 4839 |
-
|
| 4840 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4841 |
|
| 4842 |
-
|
| 4843 |
-
|
| 4844 |
-
|
| 4845 |
-
return Array.isArray(section) ? section[1] : section;
|
| 4846 |
-
}).reverse().join(' ‹ ');
|
| 4847 |
-
var decodedTitle = Object(external_this_wp_htmlEntities_["decodeEntities"])(Object(external_this_wp_i18n_["sprintf"])(
|
| 4848 |
-
/* translators: 1: document title. 2: page title */
|
| 4849 |
-
Object(external_this_wp_i18n_["__"])('%1$s ‹ %2$s — WooCommerce', 'woocommerce-admin'), documentTitle, siteTitle));
|
| 4850 |
|
| 4851 |
-
|
| 4852 |
-
|
| 4853 |
-
|
| 4854 |
-
}
|
| 4855 |
-
}, [isEmbedded, sections, siteTitle]);
|
| 4856 |
|
| 4857 |
-
|
| 4858 |
-
|
| 4859 |
-
|
| 4860 |
-
|
| 4861 |
-
|
|
|
|
|
|
|
|
|
|
| 4862 |
|
| 4863 |
-
|
| 4864 |
-
|
| 4865 |
-
|
| 4866 |
-
}
|
| 4867 |
-
onDismiss: dismissHandler,
|
| 4868 |
-
onInstall: dismissHandler
|
| 4869 |
-
}), Object(external_this_wp_element_["createElement"])("div", {
|
| 4870 |
-
className: "woocommerce-layout__header-wrapper"
|
| 4871 |
-
}, window.wcAdminFeatures.navigation && Object(external_this_wp_element_["createElement"])(navigation, null), Object(external_this_wp_element_["createElement"])(build_module["e" /* Text */], {
|
| 4872 |
-
className: "woocommerce-layout__header-heading",
|
| 4873 |
-
as: "h1",
|
| 4874 |
-
variant: "subtitle.small"
|
| 4875 |
-
}, Object(external_this_wp_htmlEntities_["decodeEntities"])(pageTitle)), window.wcAdminFeatures['activity-panels'] && Object(external_this_wp_element_["createElement"])(activity_panel, {
|
| 4876 |
-
isEmbedded: isEmbedded,
|
| 4877 |
-
query: query,
|
| 4878 |
-
userPreferencesData: header_objectSpread(header_objectSpread({}, userData), {}, {
|
| 4879 |
-
updateUserPreferences: updateUserPreferences
|
| 4880 |
-
})
|
| 4881 |
-
})));
|
| 4882 |
-
};
|
| 4883 |
-
// CONCATENATED MODULE: ./client/layout/notices.js
|
| 4884 |
|
|
|
|
|
|
|
| 4885 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4886 |
|
|
|
|
|
|
|
| 4887 |
|
|
|
|
| 4888 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4889 |
|
| 4890 |
|
| 4891 |
-
|
|
|
|
| 4892 |
|
| 4893 |
-
|
|
|
|
|
|
|
| 4894 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4895 |
/**
|
| 4896 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4897 |
*/
|
| 4898 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4899 |
|
| 4900 |
-
|
| 4901 |
-
|
| 4902 |
-
|
| 4903 |
-
var _super = notices_createSuper(Notices);
|
| 4904 |
-
|
| 4905 |
-
function Notices() {
|
| 4906 |
-
classCallCheck_default()(this, Notices);
|
| 4907 |
-
|
| 4908 |
-
return _super.apply(this, arguments);
|
| 4909 |
}
|
| 4910 |
|
| 4911 |
-
|
| 4912 |
-
|
| 4913 |
-
value: function render() {
|
| 4914 |
-
return Object(external_this_wp_element_["createElement"])("div", {
|
| 4915 |
-
id: "woocommerce-layout__notice-list",
|
| 4916 |
-
className: "woocommerce-layout__notice-list"
|
| 4917 |
-
});
|
| 4918 |
-
}
|
| 4919 |
-
}]);
|
| 4920 |
|
| 4921 |
-
|
| 4922 |
-
|
|
|
|
| 4923 |
|
| 4924 |
-
|
| 4925 |
-
|
| 4926 |
-
|
| 4927 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4928 |
|
| 4929 |
-
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/asyncToGenerator.js
|
| 4930 |
-
var asyncToGenerator = __webpack_require__(44);
|
| 4931 |
-
var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);
|
| 4932 |
|
| 4933 |
-
|
| 4934 |
-
var
|
|
|
|
| 4935 |
|
| 4936 |
-
|
| 4937 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4938 |
|
| 4939 |
-
// CONCATENATED MODULE: ./client/layout/transient-notices/snackbar/list.js
|
| 4940 |
|
|
|
|
|
|
|
| 4941 |
|
|
|
|
|
|
|
|
|
|
| 4942 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4943 |
|
|
|
|
|
|
|
|
|
|
| 4944 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4945 |
|
|
|
|
|
|
|
|
|
|
| 4946 |
/**
|
| 4947 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4948 |
*/
|
| 4949 |
|
| 4950 |
-
|
| 4951 |
-
|
| 4952 |
-
|
| 4953 |
-
|
|
|
|
|
|
|
| 4954 |
/**
|
| 4955 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4956 |
*/
|
| 4957 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4958 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4959 |
/**
|
| 4960 |
-
*
|
|
|
|
| 4961 |
*
|
| 4962 |
-
*
|
| 4963 |
-
*
|
| 4964 |
-
*
|
| 4965 |
-
*
|
| 4966 |
-
*
|
| 4967 |
-
* @param
|
| 4968 |
-
*
|
|
|
|
| 4969 |
*/
|
| 4970 |
|
| 4971 |
-
function
|
| 4972 |
-
|
| 4973 |
-
|
| 4974 |
-
|
| 4975 |
-
_ref$onRemove = _ref.onRemove,
|
| 4976 |
-
onRemove = _ref$onRemove === void 0 ? external_lodash_["noop"] : _ref$onRemove,
|
| 4977 |
-
_ref$onRemove2 = _ref.onRemove2,
|
| 4978 |
-
onRemove2 = _ref$onRemove2 === void 0 ? external_lodash_["noop"] : _ref$onRemove2;
|
| 4979 |
-
var isReducedMotion = Object(external_this_wp_compose_["useReducedMotion"])();
|
| 4980 |
|
| 4981 |
-
|
| 4982 |
-
|
| 4983 |
-
|
| 4984 |
-
|
| 4985 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4986 |
|
| 4987 |
-
var transitions = Object(web_cjs["useTransition"])(notices, function (notice) {
|
| 4988 |
-
return notice.id;
|
| 4989 |
-
}, {
|
| 4990 |
-
from: {
|
| 4991 |
-
opacity: 0,
|
| 4992 |
-
height: 0
|
| 4993 |
-
},
|
| 4994 |
-
enter: function enter(item) {
|
| 4995 |
-
return /*#__PURE__*/function () {
|
| 4996 |
-
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regenerator_default.a.mark(function _callee(next) {
|
| 4997 |
-
return regenerator_default.a.wrap(function _callee$(_context) {
|
| 4998 |
-
while (1) {
|
| 4999 |
-
switch (_context.prev = _context.next) {
|
| 5000 |
-
case 0:
|
| 5001 |
-
_context.next = 2;
|
| 5002 |
-
return next({
|
| 5003 |
-
opacity: 1,
|
| 5004 |
-
height: refMap.get(item).offsetHeight
|
| 5005 |
-
});
|
| 5006 |
|
| 5007 |
-
|
| 5008 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5009 |
|
| 5010 |
-
|
| 5011 |
-
|
| 5012 |
-
|
| 5013 |
-
|
| 5014 |
-
|
| 5015 |
-
|
| 5016 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5017 |
|
| 5018 |
-
|
| 5019 |
-
|
| 5020 |
-
|
| 5021 |
-
|
| 5022 |
-
},
|
| 5023 |
-
leave: function leave() {
|
| 5024 |
-
return /*#__PURE__*/function () {
|
| 5025 |
-
var _ref3 = asyncToGenerator_default()( /*#__PURE__*/regenerator_default.a.mark(function _callee2(next) {
|
| 5026 |
-
return regenerator_default.a.wrap(function _callee2$(_context2) {
|
| 5027 |
-
while (1) {
|
| 5028 |
-
switch (_context2.prev = _context2.next) {
|
| 5029 |
-
case 0:
|
| 5030 |
-
_context2.next = 2;
|
| 5031 |
-
return next({
|
| 5032 |
-
opacity: 0
|
| 5033 |
-
});
|
| 5034 |
|
| 5035 |
-
|
| 5036 |
-
|
| 5037 |
-
|
| 5038 |
-
height: 0
|
| 5039 |
-
});
|
| 5040 |
|
| 5041 |
-
|
| 5042 |
-
|
| 5043 |
-
|
| 5044 |
-
|
| 5045 |
-
}
|
| 5046 |
-
}, _callee2);
|
| 5047 |
-
}));
|
| 5048 |
|
| 5049 |
-
|
| 5050 |
-
|
| 5051 |
-
|
| 5052 |
-
}();
|
| 5053 |
-
},
|
| 5054 |
-
immediate: isReducedMotion
|
| 5055 |
-
});
|
| 5056 |
-
className = classnames_default()('components-snackbar-list', className);
|
| 5057 |
|
| 5058 |
-
var
|
| 5059 |
-
|
| 5060 |
-
|
|
|
|
| 5061 |
|
| 5062 |
-
|
| 5063 |
-
|
| 5064 |
-
}
|
| 5065 |
|
| 5066 |
-
|
| 5067 |
-
|
| 5068 |
-
|
| 5069 |
-
var notice = _ref4.item,
|
| 5070 |
-
key = _ref4.key,
|
| 5071 |
-
style = _ref4.props;
|
| 5072 |
-
return Object(external_this_wp_element_["createElement"])(web_cjs["animated"].div, {
|
| 5073 |
-
key: key,
|
| 5074 |
-
style: style
|
| 5075 |
-
}, Object(external_this_wp_element_["createElement"])("div", {
|
| 5076 |
-
className: "components-snackbar-list__notice-container",
|
| 5077 |
-
ref: function ref(_ref5) {
|
| 5078 |
-
return _ref5 && refMap.set(notice, _ref5);
|
| 5079 |
-
}
|
| 5080 |
-
}, Object(external_this_wp_element_["createElement"])(snackbar["a" /* default */], extends_default()({}, Object(external_lodash_["omit"])(notice, ['content']), {
|
| 5081 |
-
onRemove: removeNotice(notice)
|
| 5082 |
-
}), notice.content)));
|
| 5083 |
-
}));
|
| 5084 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5085 |
|
| 5086 |
-
|
| 5087 |
-
|
| 5088 |
-
|
|
|
|
| 5089 |
|
| 5090 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5091 |
|
| 5092 |
|
|
|
|
|
|
|
| 5093 |
/**
|
| 5094 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5095 |
*/
|
| 5096 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5097 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5098 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5099 |
/**
|
| 5100 |
-
*
|
|
|
|
|
|
|
|
|
|
| 5101 |
*/
|
| 5102 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5103 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5104 |
|
|
|
|
|
|
|
| 5105 |
|
| 5106 |
-
|
| 5107 |
-
|
| 5108 |
-
|
| 5109 |
|
| 5110 |
-
|
| 5111 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5112 |
|
| 5113 |
-
|
| 5114 |
-
|
| 5115 |
-
// to Gutenberg this needs to be changed back to just core/notices.
|
| 5116 |
-
var notices = select('core/notices').getNotices();
|
| 5117 |
-
var notices2 = select('core/notices2').getNotices();
|
| 5118 |
-
return {
|
| 5119 |
-
notices: notices,
|
| 5120 |
-
notices2: notices2
|
| 5121 |
-
};
|
| 5122 |
-
});
|
| 5123 |
-
/**
|
| 5124 |
-
* Combines the two notices in the component vs in the useSelect, as we don't want to
|
| 5125 |
-
* create new object references on each useSelect call.
|
| 5126 |
-
*/
|
| 5127 |
|
| 5128 |
-
|
| 5129 |
-
|
| 5130 |
-
|
| 5131 |
-
notices2 = _noticeData$notices === void 0 ? [] : _noticeData$notices;
|
| 5132 |
-
return notices.concat(notices2);
|
| 5133 |
-
};
|
| 5134 |
|
| 5135 |
-
|
| 5136 |
-
|
| 5137 |
-
var notices = getNotices();
|
| 5138 |
-
return Object(external_this_wp_element_["createElement"])(list, {
|
| 5139 |
-
notices: notices,
|
| 5140 |
-
className: classes,
|
| 5141 |
-
onRemove: onRemove,
|
| 5142 |
-
onRemove2: onRemove2
|
| 5143 |
-
});
|
| 5144 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5145 |
|
| 5146 |
-
|
| 5147 |
-
|
| 5148 |
-
|
| 5149 |
-
|
| 5150 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5151 |
|
| 5152 |
-
|
| 5153 |
-
|
| 5154 |
-
|
| 5155 |
-
|
| 5156 |
-
|
| 5157 |
-
|
| 5158 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5159 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5160 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5161 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5162 |
|
| 5163 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5164 |
|
| 5165 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5166 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5167 |
/**
|
| 5168 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5169 |
*/
|
| 5170 |
|
| 5171 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5172 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5173 |
|
|
|
|
|
|
|
| 5174 |
|
|
|
|
|
|
|
|
|
|
| 5175 |
/**
|
| 5176 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5177 |
*/
|
| 5178 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5179 |
|
|
|
|
| 5180 |
|
|
|
|
|
|
|
| 5181 |
|
| 5182 |
-
|
| 5183 |
-
|
| 5184 |
-
var
|
| 5185 |
-
|
| 5186 |
-
|
| 5187 |
-
|
| 5188 |
-
|
| 5189 |
-
|
| 5190 |
-
|
| 5191 |
-
|
| 5192 |
-
|
| 5193 |
-
|
| 5194 |
-
|
| 5195 |
-
Object(external_this_wp_element_["useEffect"])(function () {
|
| 5196 |
-
return addHistoryListener(function () {
|
| 5197 |
-
setTimeout(function () {
|
| 5198 |
-
if (pathIsExcluded()) {
|
| 5199 |
-
return;
|
| 5200 |
-
}
|
| 5201 |
-
|
| 5202 |
-
setPersistedQuery(Object(external_this_wc_navigation_["getPersistedQuery"])());
|
| 5203 |
-
}, 0);
|
| 5204 |
-
});
|
| 5205 |
-
}, []);
|
| 5206 |
-
/**
|
| 5207 |
-
* If the current page is embedded, stay with the default urls
|
| 5208 |
-
* provided by Navigation because the router isn't present to
|
| 5209 |
-
* respond to <Link /> component's manipulation of the url.
|
| 5210 |
-
*/
|
| 5211 |
-
|
| 5212 |
-
if (!Object(utils["f" /* isWCAdmin */])(window.location.href)) {
|
| 5213 |
-
return null;
|
| 5214 |
-
}
|
| 5215 |
-
|
| 5216 |
-
var reports = Object(get_reports["a" /* default */])().filter(function (item) {
|
| 5217 |
-
return item.navArgs;
|
| 5218 |
-
});
|
| 5219 |
-
var pages = controller_getPages().filter(function (page) {
|
| 5220 |
-
return page.navArgs;
|
| 5221 |
-
}).map(function (page) {
|
| 5222 |
-
if (page.path === '/analytics/settings') {
|
| 5223 |
-
return navigation_objectSpread(navigation_objectSpread({}, page), {}, {
|
| 5224 |
-
breadcrumbs: [Object(external_this_wp_i18n_["__"])('Analytics', 'woocommerce-admin')]
|
| 5225 |
-
});
|
| 5226 |
-
}
|
| 5227 |
-
|
| 5228 |
-
return page;
|
| 5229 |
-
});
|
| 5230 |
-
return Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, pages.map(function (page) {
|
| 5231 |
-
return Object(external_this_wp_element_["createElement"])(external_this_wc_navigation_["WooNavigationItem"], {
|
| 5232 |
-
item: page.navArgs.id,
|
| 5233 |
-
key: page.navArgs.id
|
| 5234 |
-
}, Object(external_this_wp_element_["createElement"])(external_this_wc_components_["Link"], {
|
| 5235 |
-
className: "components-button",
|
| 5236 |
-
href: Object(external_this_wc_navigation_["getNewPath"])(pathIsExcluded(page.path) ? {} : persistedQuery, page.path, {}),
|
| 5237 |
-
type: "wc-admin"
|
| 5238 |
-
}, page.breadcrumbs[page.breadcrumbs.length - 1]));
|
| 5239 |
-
}), reports.map(function (item) {
|
| 5240 |
-
return Object(external_this_wp_element_["createElement"])(external_this_wc_navigation_["WooNavigationItem"], {
|
| 5241 |
-
item: item.navArgs.id,
|
| 5242 |
-
key: item.navArgs.id
|
| 5243 |
-
}, Object(external_this_wp_element_["createElement"])(external_this_wc_components_["Link"], {
|
| 5244 |
-
className: "components-button",
|
| 5245 |
-
href: Object(external_this_wc_navigation_["getNewPath"])(pathIsExcluded(item.report) ? {} : persistedQuery, "/analytics/".concat(item.report), {}),
|
| 5246 |
-
type: "wc-admin"
|
| 5247 |
-
}, item.title));
|
| 5248 |
-
}));
|
| 5249 |
-
};
|
| 5250 |
-
|
| 5251 |
-
Object(external_this_wp_plugins_["registerPlugin"])('wc-admin-navigation', {
|
| 5252 |
-
render: navigation_NavigationPlugin
|
| 5253 |
-
});
|
| 5254 |
-
// CONCATENATED MODULE: ./client/layout/index.js
|
| 5255 |
-
|
| 5256 |
|
| 5257 |
|
| 5258 |
|
|
@@ -5260,29 +5989,17 @@ Object(external_this_wp_plugins_["registerPlugin"])('wc-admin-navigation', {
|
|
| 5260 |
|
| 5261 |
|
| 5262 |
|
|
|
|
| 5263 |
|
| 5264 |
-
|
| 5265 |
-
function layout_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
| 5266 |
-
|
| 5267 |
-
function layout_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { layout_ownKeys(Object(source), true).forEach(function (key) { defineProperty_default()(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { layout_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
| 5268 |
-
|
| 5269 |
-
function layout_createSuper(Derived) { var hasNativeReflectConstruct = layout_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = getPrototypeOf_default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = getPrototypeOf_default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return possibleConstructorReturn_default()(this, result); }; }
|
| 5270 |
-
|
| 5271 |
-
function layout_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
| 5272 |
|
| 5273 |
/**
|
| 5274 |
* External dependencies
|
| 5275 |
*/
|
| 5276 |
|
| 5277 |
-
|
| 5278 |
-
|
| 5279 |
-
|
| 5280 |
-
|
| 5281 |
-
|
| 5282 |
-
|
| 5283 |
-
|
| 5284 |
-
|
| 5285 |
-
|
| 5286 |
|
| 5287 |
|
| 5288 |
/**
|
|
@@ -5291,2019 +6008,8885 @@ function layout_isNativeReflectConstruct() { if (typeof Reflect === "undefined"
|
|
| 5291 |
|
| 5292 |
|
| 5293 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5294 |
|
|
|
|
| 5295 |
|
|
|
|
|
|
|
| 5296 |
|
|
|
|
| 5297 |
|
| 5298 |
-
|
| 5299 |
-
|
| 5300 |
-
});
|
| 5301 |
-
var WCPayUsageModal = Object(external_this_wp_element_["lazy"])(function () {
|
| 5302 |
-
return __webpack_require__.e(/* import() | wcpay-usage-modal */ 51).then(__webpack_require__.bind(null, 510));
|
| 5303 |
-
});
|
| 5304 |
-
var layout_PrimaryLayout = /*#__PURE__*/function (_Component) {
|
| 5305 |
-
inherits_default()(PrimaryLayout, _Component);
|
| 5306 |
-
|
| 5307 |
-
var _super = layout_createSuper(PrimaryLayout);
|
| 5308 |
-
|
| 5309 |
-
function PrimaryLayout() {
|
| 5310 |
-
classCallCheck_default()(this, PrimaryLayout);
|
| 5311 |
-
|
| 5312 |
-
return _super.apply(this, arguments);
|
| 5313 |
-
}
|
| 5314 |
-
|
| 5315 |
-
createClass_default()(PrimaryLayout, [{
|
| 5316 |
-
key: "render",
|
| 5317 |
-
value: function render() {
|
| 5318 |
-
var children = this.props.children;
|
| 5319 |
-
return Object(external_this_wp_element_["createElement"])("div", {
|
| 5320 |
-
className: "woocommerce-layout__primary",
|
| 5321 |
-
id: "woocommerce-layout__primary"
|
| 5322 |
-
}, window.wcAdminFeatures['store-alerts'] && Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Suspense"], {
|
| 5323 |
-
fallback: Object(external_this_wp_element_["createElement"])(external_this_wc_components_["Spinner"], null)
|
| 5324 |
-
}, Object(external_this_wp_element_["createElement"])(StoreAlerts, null)), Object(external_this_wp_element_["createElement"])(layout_notices, null), children);
|
| 5325 |
-
}
|
| 5326 |
-
}]);
|
| 5327 |
-
|
| 5328 |
-
return PrimaryLayout;
|
| 5329 |
-
}(external_this_wp_element_["Component"]);
|
| 5330 |
-
|
| 5331 |
-
var layout_Layout = /*#__PURE__*/function (_Component2) {
|
| 5332 |
-
inherits_default()(_Layout, _Component2);
|
| 5333 |
-
|
| 5334 |
-
var _super2 = layout_createSuper(_Layout);
|
| 5335 |
|
| 5336 |
-
|
| 5337 |
-
classCallCheck_default()(this, _Layout);
|
| 5338 |
|
| 5339 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5340 |
}
|
| 5341 |
|
| 5342 |
-
|
| 5343 |
-
key: "
|
| 5344 |
-
value: function
|
| 5345 |
-
this.
|
|
|
|
| 5346 |
}
|
| 5347 |
}, {
|
| 5348 |
-
key: "
|
| 5349 |
-
value: function
|
| 5350 |
-
var
|
| 5351 |
-
var currentPath = Object(external_lodash_["get"])(this.props, 'location.pathname');
|
| 5352 |
|
| 5353 |
-
if (
|
| 5354 |
return;
|
| 5355 |
}
|
| 5356 |
|
| 5357 |
-
|
| 5358 |
-
|
|
|
|
|
|
|
| 5359 |
}
|
| 5360 |
}
|
| 5361 |
}, {
|
| 5362 |
-
key: "
|
| 5363 |
-
value: function
|
| 5364 |
-
var
|
| 5365 |
-
activePlugins = _this$props.activePlugins,
|
| 5366 |
-
installedPlugins = _this$props.installedPlugins,
|
| 5367 |
-
isEmbedded = _this$props.isEmbedded,
|
| 5368 |
-
isJetpackConnected = _this$props.isJetpackConnected;
|
| 5369 |
-
var navigationFlag = {
|
| 5370 |
-
has_navigation: !!window.wcNavigation
|
| 5371 |
-
};
|
| 5372 |
|
| 5373 |
-
|
| 5374 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5375 |
|
| 5376 |
-
Object(external_this_wc_tracks_["recordPageView"])(_path, layout_objectSpread({
|
| 5377 |
-
is_embedded: true
|
| 5378 |
-
}, navigationFlag));
|
| 5379 |
-
return;
|
| 5380 |
-
}
|
| 5381 |
|
| 5382 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5383 |
|
| 5384 |
-
if (!pathname) {
|
| 5385 |
-
return;
|
| 5386 |
-
} // Remove leading slash, and camel case remaining pathname
|
| 5387 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5388 |
|
| 5389 |
-
var path = pathname.substring(1).replace(/\//g, '_'); // When pathname is `/` we are on the home screen.
|
| 5390 |
|
| 5391 |
-
|
| 5392 |
-
path = 'home_screen';
|
| 5393 |
-
}
|
| 5394 |
|
| 5395 |
-
|
| 5396 |
-
jetpack_installed: installedPlugins.includes('jetpack'),
|
| 5397 |
-
jetpack_active: activePlugins.includes('jetpack'),
|
| 5398 |
-
jetpack_connected: isJetpackConnected
|
| 5399 |
-
}, navigationFlag));
|
| 5400 |
-
}
|
| 5401 |
-
}, {
|
| 5402 |
-
key: "getQuery",
|
| 5403 |
-
value: function getQuery(searchString) {
|
| 5404 |
-
if (!searchString) {
|
| 5405 |
-
return {};
|
| 5406 |
-
}
|
| 5407 |
|
| 5408 |
-
|
| 5409 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5410 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5411 |
}, {
|
| 5412 |
-
key: "
|
| 5413 |
-
value: function
|
| 5414 |
-
var
|
| 5415 |
-
|
| 5416 |
-
|
| 5417 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5418 |
|
| 5419 |
-
|
|
|
|
|
|
|
|
|
|
| 5420 |
}
|
| 5421 |
}, {
|
| 5422 |
key: "render",
|
| 5423 |
value: function render() {
|
| 5424 |
-
var _this$
|
| 5425 |
-
|
| 5426 |
-
|
| 5427 |
-
|
| 5428 |
-
|
| 5429 |
-
location = _this$props3.location,
|
| 5430 |
-
page = _this$props3.page;
|
| 5431 |
-
var breadcrumbs = page.breadcrumbs;
|
| 5432 |
-
var query = this.getQuery(location && location.search);
|
| 5433 |
-
return Object(external_this_wp_element_["createElement"])("div", {
|
| 5434 |
-
className: "woocommerce-layout"
|
| 5435 |
-
}, Object(external_this_wp_element_["createElement"])(client_header_Header, {
|
| 5436 |
-
sections: Object(external_lodash_["isFunction"])(breadcrumbs) ? breadcrumbs(this.props) : breadcrumbs,
|
| 5437 |
-
isEmbedded: isEmbedded,
|
| 5438 |
-
query: query
|
| 5439 |
-
}), Object(external_this_wp_element_["createElement"])(transient_notices, null), !isEmbedded && Object(external_this_wp_element_["createElement"])(layout_PrimaryLayout, null, Object(external_this_wp_element_["createElement"])("div", {
|
| 5440 |
-
className: "woocommerce-layout__main"
|
| 5441 |
-
}, Object(external_this_wp_element_["createElement"])(controller_Controller, extends_default()({}, restProps, {
|
| 5442 |
-
query: query
|
| 5443 |
-
})))), isEmbedded && this.isWCPaySettingsPage() && Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Suspense"], {
|
| 5444 |
-
fallback: null
|
| 5445 |
-
}, Object(external_this_wp_element_["createElement"])(WCPayUsageModal, null)));
|
| 5446 |
-
}
|
| 5447 |
-
}]);
|
| 5448 |
-
|
| 5449 |
-
return _Layout;
|
| 5450 |
-
}(external_this_wp_element_["Component"]);
|
| 5451 |
-
|
| 5452 |
-
layout_Layout.propTypes = {
|
| 5453 |
-
isEmbedded: prop_types_default.a.bool,
|
| 5454 |
-
page: prop_types_default.a.shape({
|
| 5455 |
-
container: prop_types_default.a.oneOfType([prop_types_default.a.func, prop_types_default.a.object // Support React.lazy
|
| 5456 |
-
]),
|
| 5457 |
-
path: prop_types_default.a.string,
|
| 5458 |
-
breadcrumbs: prop_types_default.a.oneOfType([prop_types_default.a.func, prop_types_default.a.arrayOf(prop_types_default.a.oneOfType([prop_types_default.a.arrayOf(prop_types_default.a.string), prop_types_default.a.string]))]).isRequired,
|
| 5459 |
-
wpOpenMenu: prop_types_default.a.string
|
| 5460 |
-
}).isRequired
|
| 5461 |
-
};
|
| 5462 |
-
var Layout = Object(external_this_wp_compose_["compose"])(Object(external_this_wc_data_["withPluginsHydration"])(layout_objectSpread(layout_objectSpread({}, window.wcSettings.plugins || {}), {}, {
|
| 5463 |
-
jetpackStatus: window.wcSettings.dataEndpoints && window.wcSettings.dataEndpoints.jetpackStatus || false
|
| 5464 |
-
})), Object(external_this_wp_data_["withSelect"])(function (select, _ref) {
|
| 5465 |
-
var isEmbedded = _ref.isEmbedded;
|
| 5466 |
-
|
| 5467 |
-
// Embedded pages don't send plugin info to Tracks.
|
| 5468 |
-
if (isEmbedded) {
|
| 5469 |
-
return;
|
| 5470 |
-
}
|
| 5471 |
-
|
| 5472 |
-
var _select = select(external_this_wc_data_["PLUGINS_STORE_NAME"]),
|
| 5473 |
-
getActivePlugins = _select.getActivePlugins,
|
| 5474 |
-
getInstalledPlugins = _select.getInstalledPlugins,
|
| 5475 |
-
isJetpackConnected = _select.isJetpackConnected;
|
| 5476 |
-
|
| 5477 |
-
return {
|
| 5478 |
-
activePlugins: getActivePlugins(),
|
| 5479 |
-
isJetpackConnected: isJetpackConnected(),
|
| 5480 |
-
installedPlugins: getInstalledPlugins()
|
| 5481 |
-
};
|
| 5482 |
-
}))(layout_Layout);
|
| 5483 |
|
| 5484 |
-
|
| 5485 |
-
|
| 5486 |
-
currentUserCan = _useUser.currentUserCan;
|
| 5487 |
|
| 5488 |
-
|
| 5489 |
-
history: Object(external_this_wc_navigation_["getHistory"])()
|
| 5490 |
-
}, Object(external_this_wp_element_["createElement"])(react_router_Switch, null, controller_getPages().filter(function (page) {
|
| 5491 |
-
return !page.capability || currentUserCan(page.capability);
|
| 5492 |
-
}).map(function (page) {
|
| 5493 |
-
return Object(external_this_wp_element_["createElement"])(react_router_Route, {
|
| 5494 |
-
key: page.path,
|
| 5495 |
-
path: page.path,
|
| 5496 |
-
exact: true,
|
| 5497 |
-
render: function render(props) {
|
| 5498 |
-
return Object(external_this_wp_element_["createElement"])(Layout, extends_default()({
|
| 5499 |
-
page: page
|
| 5500 |
-
}, props));
|
| 5501 |
}
|
| 5502 |
-
});
|
| 5503 |
-
})));
|
| 5504 |
-
};
|
| 5505 |
|
| 5506 |
-
var
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5507 |
|
| 5508 |
-
|
| 5509 |
-
|
| 5510 |
-
page: {
|
| 5511 |
-
breadcrumbs: Object(wc_admin_settings["g" /* getSetting */])('embedBreadcrumbs', [])
|
| 5512 |
-
},
|
| 5513 |
-
isEmbedded: true
|
| 5514 |
-
});
|
| 5515 |
-
};
|
| 5516 |
|
| 5517 |
-
|
|
|
|
| 5518 |
|
| 5519 |
/***/ }),
|
| 5520 |
|
| 5521 |
-
/***/
|
| 5522 |
/***/ (function(module, exports) {
|
| 5523 |
|
| 5524 |
-
(function() { module.exports = this["
|
| 5525 |
|
| 5526 |
/***/ }),
|
| 5527 |
|
| 5528 |
-
/***/
|
| 5529 |
/***/ (function(module, exports, __webpack_require__) {
|
| 5530 |
|
| 5531 |
-
|
|
|
|
|
|
|
| 5532 |
|
| 5533 |
-
|
| 5534 |
|
| 5535 |
-
|
| 5536 |
-
|
| 5537 |
-
|
| 5538 |
-
|
|
|
|
|
|
|
|
|
|
| 5539 |
|
| 5540 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5541 |
}
|
| 5542 |
|
| 5543 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5544 |
|
| 5545 |
-
|
|
|
|
|
|
|
| 5546 |
|
| 5547 |
-
|
| 5548 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5549 |
|
| 5550 |
-
|
| 5551 |
-
|
| 5552 |
-
|
| 5553 |
-
|
| 5554 |
-
|
| 5555 |
-
|
| 5556 |
-
|
| 5557 |
-
|
| 5558 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5559 |
|
| 5560 |
-
|
| 5561 |
-
|
| 5562 |
-
|
| 5563 |
-
|
| 5564 |
-
|
| 5565 |
-
exports.isValidElementType=function(a){return"string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||"object"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};exports.typeOf=z;
|
| 5566 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5567 |
|
| 5568 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5569 |
|
| 5570 |
-
|
| 5571 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5572 |
|
| 5573 |
-
(
|
|
|
|
| 5574 |
|
| 5575 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5576 |
|
| 5577 |
-
|
| 5578 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5579 |
|
| 5580 |
-
(
|
|
|
|
|
|
|
|
|
|
| 5581 |
|
| 5582 |
-
|
| 5583 |
|
| 5584 |
-
|
| 5585 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5586 |
|
| 5587 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5588 |
|
| 5589 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5590 |
|
| 5591 |
-
|
|
|
|
|
|
|
| 5592 |
|
| 5593 |
-
var
|
|
|
|
| 5594 |
|
| 5595 |
-
|
| 5596 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5597 |
}
|
| 5598 |
|
| 5599 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5600 |
|
| 5601 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5602 |
|
| 5603 |
-
|
| 5604 |
-
|
| 5605 |
|
| 5606 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5607 |
|
|
|
|
|
|
|
|
|
|
| 5608 |
|
| 5609 |
-
|
|
|
|
| 5610 |
|
| 5611 |
-
|
|
|
|
| 5612 |
|
| 5613 |
-
|
| 5614 |
-
|
| 5615 |
-
|
| 5616 |
-
|
| 5617 |
-
|
| 5618 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5619 |
|
| 5620 |
-
|
| 5621 |
-
|
| 5622 |
-
|
| 5623 |
-
|
| 5624 |
-
|
| 5625 |
-
|
| 5626 |
-
|
| 5627 |
-
|
| 5628 |
-
|
| 5629 |
-
|
| 5630 |
-
|
| 5631 |
-
|
| 5632 |
-
|
| 5633 |
-
|
| 5634 |
-
|
| 5635 |
-
|
| 5636 |
-
|
| 5637 |
-
|
| 5638 |
-
|
| 5639 |
-
|
| 5640 |
-
|
| 5641 |
-
|
| 5642 |
-
},
|
| 5643 |
-
map: function map(a) {
|
| 5644 |
-
return a instanceof Map;
|
| 5645 |
-
},
|
| 5646 |
-
equ: function equ(a, b) {
|
| 5647 |
-
if (typeof a !== typeof b) return false;
|
| 5648 |
-
if (is.str(a) || is.num(a)) return a === b;
|
| 5649 |
-
if (is.obj(a) && is.obj(b) && Object.keys(a).length + Object.keys(b).length === 0) return true;
|
| 5650 |
-
var i;
|
| 5651 |
|
| 5652 |
-
|
| 5653 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5654 |
}
|
| 5655 |
|
| 5656 |
-
|
| 5657 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5658 |
}
|
| 5659 |
|
| 5660 |
-
return
|
| 5661 |
-
|
| 5662 |
-
};
|
| 5663 |
-
function merge(target, lowercase) {
|
| 5664 |
-
if (lowercase === void 0) {
|
| 5665 |
-
lowercase = true;
|
| 5666 |
-
}
|
| 5667 |
|
| 5668 |
-
|
| 5669 |
-
|
| 5670 |
-
|
| 5671 |
-
|
| 5672 |
-
|
| 5673 |
-
|
| 5674 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5675 |
}
|
| 5676 |
-
function useForceUpdate() {
|
| 5677 |
-
var _useState = React.useState(false),
|
| 5678 |
-
f = _useState[1];
|
| 5679 |
|
| 5680 |
-
|
| 5681 |
-
|
| 5682 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5683 |
});
|
| 5684 |
-
|
| 5685 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5686 |
}
|
| 5687 |
-
|
| 5688 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5689 |
}
|
| 5690 |
-
|
| 5691 |
-
|
|
|
|
| 5692 |
}
|
| 5693 |
-
function callProp(obj) {
|
| 5694 |
-
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
| 5695 |
-
args[_key - 1] = arguments[_key];
|
| 5696 |
-
}
|
| 5697 |
|
| 5698 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5699 |
}
|
| 5700 |
|
| 5701 |
-
function
|
| 5702 |
-
|
| 5703 |
-
|
| 5704 |
-
|
| 5705 |
-
|
| 5706 |
-
|
| 5707 |
-
|
| 5708 |
-
|
| 5709 |
-
reset = props.reset,
|
| 5710 |
-
reverse = props.reverse,
|
| 5711 |
-
force = props.force,
|
| 5712 |
-
immediate = props.immediate,
|
| 5713 |
-
delay = props.delay,
|
| 5714 |
-
attach = props.attach,
|
| 5715 |
-
destroyed = props.destroyed,
|
| 5716 |
-
interpolateTo = props.interpolateTo,
|
| 5717 |
-
ref = props.ref,
|
| 5718 |
-
lazy = props.lazy,
|
| 5719 |
-
forward = _objectWithoutPropertiesLoose(props, ["to", "from", "config", "onStart", "onRest", "onFrame", "children", "reset", "reverse", "force", "immediate", "delay", "attach", "destroyed", "interpolateTo", "ref", "lazy"]);
|
| 5720 |
|
| 5721 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5722 |
}
|
| 5723 |
|
| 5724 |
-
|
| 5725 |
-
|
| 5726 |
-
|
| 5727 |
-
|
| 5728 |
-
|
| 5729 |
-
|
| 5730 |
-
|
|
|
|
| 5731 |
|
| 5732 |
-
|
| 5733 |
-
|
| 5734 |
-
|
| 5735 |
-
|
| 5736 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5737 |
}
|
| 5738 |
-
function handleRef(ref, forward) {
|
| 5739 |
-
if (forward) {
|
| 5740 |
-
// If it's a function, assume it's a ref callback
|
| 5741 |
-
if (is.fun(forward)) forward(ref);else if (is.obj(forward)) {
|
| 5742 |
-
forward.current = ref;
|
| 5743 |
-
}
|
| 5744 |
-
}
|
| 5745 |
|
| 5746 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5747 |
}
|
| 5748 |
|
| 5749 |
-
|
| 5750 |
-
|
| 5751 |
-
|
| 5752 |
-
|
| 5753 |
-
|
| 5754 |
-
|
| 5755 |
-
|
| 5756 |
-
|
| 5757 |
-
|
|
|
|
| 5758 |
|
| 5759 |
-
|
| 5760 |
-
|
| 5761 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5762 |
|
| 5763 |
-
|
| 5764 |
-
|
| 5765 |
-
|
| 5766 |
|
| 5767 |
-
|
|
|
|
|
|
|
| 5768 |
|
| 5769 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5770 |
|
| 5771 |
-
|
| 5772 |
-
|
| 5773 |
-
|
|
|
|
|
|
|
|
|
|
| 5774 |
|
| 5775 |
-
|
| 5776 |
-
|
| 5777 |
-
|
| 5778 |
-
|
| 5779 |
|
| 5780 |
-
|
| 5781 |
-
|
| 5782 |
-
this.children.splice(index, 1);
|
| 5783 |
-
if (this.children.length === 0) this.detach();
|
| 5784 |
-
};
|
| 5785 |
|
| 5786 |
-
|
| 5787 |
-
|
| 5788 |
-
var AnimatedArray =
|
| 5789 |
-
/*#__PURE__*/
|
| 5790 |
-
function (_Animated) {
|
| 5791 |
-
_inheritsLoose(AnimatedArray, _Animated);
|
| 5792 |
|
| 5793 |
-
|
| 5794 |
-
|
| 5795 |
|
| 5796 |
-
|
| 5797 |
-
|
| 5798 |
-
}
|
| 5799 |
|
| 5800 |
-
|
| 5801 |
-
_this.payload = [];
|
| 5802 |
|
| 5803 |
-
|
| 5804 |
-
|
| 5805 |
-
|
| 5806 |
-
|
|
|
|
| 5807 |
};
|
| 5808 |
|
| 5809 |
-
|
| 5810 |
-
|
| 5811 |
-
return p instanceof Animated && p.removeChild(_assertThisInitialized(_this));
|
| 5812 |
-
});
|
| 5813 |
-
};
|
| 5814 |
|
| 5815 |
-
return _this;
|
| 5816 |
-
}
|
| 5817 |
|
| 5818 |
-
|
| 5819 |
-
|
| 5820 |
-
|
| 5821 |
-
/*#__PURE__*/
|
| 5822 |
-
function (_Animated2) {
|
| 5823 |
-
_inheritsLoose(AnimatedObject, _Animated2);
|
| 5824 |
|
| 5825 |
-
|
| 5826 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5827 |
|
| 5828 |
-
|
| 5829 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5830 |
}
|
|
|
|
| 5831 |
|
| 5832 |
-
|
| 5833 |
-
_this2.payload = {};
|
| 5834 |
|
| 5835 |
-
|
| 5836 |
-
|
| 5837 |
-
|
| 5838 |
-
|
| 5839 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5840 |
|
| 5841 |
-
|
| 5842 |
-
|
| 5843 |
-
|
| 5844 |
-
|
| 5845 |
-
|
|
|
|
|
|
|
|
|
|
| 5846 |
|
| 5847 |
-
return _this2;
|
| 5848 |
-
}
|
| 5849 |
|
| 5850 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5851 |
|
| 5852 |
-
|
| 5853 |
-
|
| 5854 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5855 |
}
|
|
|
|
|
|
|
| 5856 |
|
| 5857 |
-
|
|
|
|
|
|
|
| 5858 |
|
| 5859 |
-
|
| 5860 |
-
|
| 5861 |
-
if (animated && !(value instanceof Animated)) continue;
|
| 5862 |
-
payload[_key4] = value instanceof Animated ? value[animated ? 'getAnimatedValue' : 'getValue']() : value;
|
| 5863 |
}
|
| 5864 |
|
| 5865 |
-
return
|
| 5866 |
-
|
| 5867 |
|
| 5868 |
-
|
| 5869 |
-
|
| 5870 |
-
|
| 5871 |
|
| 5872 |
-
|
| 5873 |
-
|
| 5874 |
|
| 5875 |
-
|
| 5876 |
-
|
| 5877 |
-
|
| 5878 |
-
|
| 5879 |
-
|
| 5880 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5881 |
}
|
| 5882 |
-
|
| 5883 |
-
|
| 5884 |
-
|
|
|
|
| 5885 |
}
|
| 5886 |
-
|
| 5887 |
-
|
| 5888 |
-
|
| 5889 |
-
|
| 5890 |
-
typeof window !== 'undefined' && window.cancelAnimationFrame(id);
|
| 5891 |
-
};
|
| 5892 |
-
function injectFrame(raf, caf) {
|
| 5893 |
-
requestFrame = raf;
|
| 5894 |
-
cancelFrame = caf;
|
| 5895 |
}
|
| 5896 |
-
|
| 5897 |
-
|
| 5898 |
-
|
|
|
|
|
|
|
| 5899 |
}
|
| 5900 |
-
|
| 5901 |
-
|
| 5902 |
-
|
| 5903 |
-
|
| 5904 |
-
now = nowFn;
|
| 5905 |
}
|
| 5906 |
-
|
| 5907 |
-
|
| 5908 |
-
|
|
|
|
| 5909 |
}
|
| 5910 |
-
|
| 5911 |
-
|
| 5912 |
-
|
| 5913 |
-
|
| 5914 |
-
|
|
|
|
|
|
|
|
|
|
| 5915 |
}
|
| 5916 |
-
|
| 5917 |
-
|
| 5918 |
-
|
|
|
|
| 5919 |
}
|
| 5920 |
-
|
| 5921 |
-
function
|
| 5922 |
-
|
| 5923 |
}
|
| 5924 |
|
| 5925 |
-
var
|
| 5926 |
-
get applyAnimatedValues () { return applyAnimatedValues; },
|
| 5927 |
-
injectApplyAnimatedValues: injectApplyAnimatedValues,
|
| 5928 |
-
get colorNames () { return colorNames; },
|
| 5929 |
-
injectColorNames: injectColorNames,
|
| 5930 |
-
get requestFrame () { return requestFrame; },
|
| 5931 |
-
get cancelFrame () { return cancelFrame; },
|
| 5932 |
-
injectFrame: injectFrame,
|
| 5933 |
-
get interpolation () { return interpolation; },
|
| 5934 |
-
injectStringInterpolator: injectStringInterpolator,
|
| 5935 |
-
get now () { return now; },
|
| 5936 |
-
injectNow: injectNow,
|
| 5937 |
-
get defaultElement () { return defaultElement; },
|
| 5938 |
-
injectDefaultElement: injectDefaultElement,
|
| 5939 |
-
get animatedApi () { return animatedApi; },
|
| 5940 |
-
injectAnimatedApi: injectAnimatedApi,
|
| 5941 |
-
get createAnimatedStyle () { return createAnimatedStyle; },
|
| 5942 |
-
injectCreateAnimatedStyle: injectCreateAnimatedStyle,
|
| 5943 |
-
get manualFrameloop () { return manualFrameloop; },
|
| 5944 |
-
injectManualFrameloop: injectManualFrameloop
|
| 5945 |
-
});
|
| 5946 |
|
| 5947 |
-
|
| 5948 |
-
|
| 5949 |
-
*/
|
| 5950 |
|
| 5951 |
-
|
| 5952 |
-
|
| 5953 |
-
function (_AnimatedObject) {
|
| 5954 |
-
_inheritsLoose(AnimatedProps, _AnimatedObject);
|
| 5955 |
|
| 5956 |
-
|
| 5957 |
-
var
|
| 5958 |
|
| 5959 |
-
|
| 5960 |
-
|
| 5961 |
-
|
| 5962 |
-
|
| 5963 |
-
|
| 5964 |
-
_this.update = callback;
|
| 5965 |
|
| 5966 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5967 |
|
| 5968 |
-
|
| 5969 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5970 |
|
| 5971 |
-
|
| 5972 |
-
|
|
|
|
|
|
|
| 5973 |
|
| 5974 |
-
|
| 5975 |
-
|
| 5976 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5977 |
|
| 5978 |
-
|
| 5979 |
-
|
| 5980 |
-
|
| 5981 |
-
|
| 5982 |
-
var
|
| 5983 |
-
|
| 5984 |
-
|
| 5985 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5986 |
|
| 5987 |
-
|
| 5988 |
-
|
| 5989 |
|
| 5990 |
-
|
| 5991 |
-
|
| 5992 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5993 |
|
| 5994 |
-
|
| 5995 |
-
|
| 5996 |
-
|
| 5997 |
-
|
| 5998 |
-
|
| 5999 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6000 |
|
| 6001 |
-
|
| 6002 |
-
oldPropsAnimated && oldPropsAnimated.detach();
|
| 6003 |
-
}, []);
|
| 6004 |
-
React.useEffect(function () {
|
| 6005 |
-
return function () {
|
| 6006 |
-
mounted.current = false;
|
| 6007 |
-
propsAnimated.current && propsAnimated.current.detach();
|
| 6008 |
-
};
|
| 6009 |
-
}, []);
|
| 6010 |
-
React.useImperativeHandle(ref, function () {
|
| 6011 |
-
return animatedApi(node, mounted, forceUpdate);
|
| 6012 |
-
});
|
| 6013 |
-
attachProps(props);
|
| 6014 |
|
| 6015 |
-
var _getValue = propsAnimated.current.getValue(),
|
| 6016 |
-
scrollTop = _getValue.scrollTop,
|
| 6017 |
-
scrollLeft = _getValue.scrollLeft,
|
| 6018 |
-
animatedProps = _objectWithoutPropertiesLoose(_getValue, ["scrollTop", "scrollLeft"]); // Functions cannot have refs, see:
|
| 6019 |
-
// See: https://github.com/react-spring/react-spring/issues/569
|
| 6020 |
|
|
|
|
| 6021 |
|
| 6022 |
-
|
| 6023 |
-
|
| 6024 |
-
};
|
| 6025 |
-
return React__default.createElement(Component, _extends({}, animatedProps, {
|
| 6026 |
-
ref: refFn
|
| 6027 |
-
}));
|
| 6028 |
-
});
|
| 6029 |
-
return AnimatedComponent;
|
| 6030 |
-
};
|
| 6031 |
|
| 6032 |
-
|
| 6033 |
-
|
|
|
|
|
|
|
|
|
|
| 6034 |
|
| 6035 |
-
|
| 6036 |
-
|
| 6037 |
-
var time = now();
|
| 6038 |
|
| 6039 |
-
|
| 6040 |
-
var _ref;
|
| 6041 |
|
| 6042 |
-
|
| 6043 |
-
if (_i >= _iterator.length) break;
|
| 6044 |
-
_ref = _iterator[_i++];
|
| 6045 |
-
} else {
|
| 6046 |
-
_i = _iterator.next();
|
| 6047 |
-
if (_i.done) break;
|
| 6048 |
-
_ref = _i.value;
|
| 6049 |
-
}
|
| 6050 |
|
| 6051 |
-
|
| 6052 |
-
|
| 6053 |
|
| 6054 |
-
|
| 6055 |
-
var config = controller.configs[configIdx];
|
| 6056 |
-
var endOfAnimation = void 0,
|
| 6057 |
-
lastTime = void 0;
|
| 6058 |
|
| 6059 |
-
for (var valIdx = 0; valIdx < config.animatedValues.length; valIdx++) {
|
| 6060 |
-
var animation = config.animatedValues[valIdx]; // If an animation is done, skip, until all of them conclude
|
| 6061 |
|
| 6062 |
-
|
| 6063 |
-
|
| 6064 |
-
|
| 6065 |
-
var position = animation.lastPosition;
|
| 6066 |
-
var isAnimated = to instanceof Animated;
|
| 6067 |
-
var velocity = Array.isArray(config.initialVelocity) ? config.initialVelocity[valIdx] : config.initialVelocity;
|
| 6068 |
-
if (isAnimated) to = to.getValue(); // Conclude animation if it's either immediate, or from-values match end-state
|
| 6069 |
|
| 6070 |
-
|
| 6071 |
-
|
| 6072 |
-
|
| 6073 |
-
|
| 6074 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6075 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6076 |
|
| 6077 |
-
|
| 6078 |
-
animation.setValue(to);
|
| 6079 |
-
animation.done = true;
|
| 6080 |
-
continue;
|
| 6081 |
-
}
|
| 6082 |
|
| 6083 |
-
|
| 6084 |
-
|
| 6085 |
-
|
| 6086 |
-
|
| 6087 |
-
|
| 6088 |
-
|
| 6089 |
-
|
| 6090 |
-
|
| 6091 |
-
|
| 6092 |
-
|
| 6093 |
-
|
| 6094 |
-
|
| 6095 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6096 |
|
| 6097 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6098 |
|
| 6099 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6100 |
|
| 6101 |
-
|
| 6102 |
-
|
| 6103 |
-
|
| 6104 |
-
|
| 6105 |
-
velocity = velocity + acceleration * 1 / 1000;
|
| 6106 |
-
position = position + velocity * 1 / 1000;
|
| 6107 |
-
} // Conditions for stopping the spring animation
|
| 6108 |
|
|
|
|
|
|
|
| 6109 |
|
| 6110 |
-
|
| 6111 |
-
|
| 6112 |
-
|
| 6113 |
-
|
| 6114 |
-
|
| 6115 |
-
|
| 6116 |
-
|
| 6117 |
|
|
|
|
| 6118 |
|
| 6119 |
-
|
|
|
|
|
|
|
| 6120 |
|
| 6121 |
-
|
| 6122 |
-
|
| 6123 |
-
|
| 6124 |
-
|
| 6125 |
-
|
|
|
|
|
|
|
| 6126 |
|
| 6127 |
-
|
| 6128 |
-
|
| 6129 |
-
|
| 6130 |
|
|
|
|
|
|
|
|
|
|
| 6131 |
|
| 6132 |
-
|
| 6133 |
-
|
|
|
|
| 6134 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6135 |
|
| 6136 |
-
|
|
|
|
| 6137 |
|
| 6138 |
-
|
| 6139 |
-
|
| 6140 |
-
|
| 6141 |
}
|
| 6142 |
-
} // Loop over as long as there are controllers ...
|
| 6143 |
|
|
|
|
|
|
|
|
|
|
| 6144 |
|
| 6145 |
-
|
| 6146 |
-
if (
|
| 6147 |
-
|
| 6148 |
-
|
| 6149 |
-
}
|
| 6150 |
|
| 6151 |
-
|
| 6152 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6153 |
|
| 6154 |
-
var
|
| 6155 |
-
|
|
|
|
|
|
|
| 6156 |
|
| 6157 |
-
|
| 6158 |
-
|
| 6159 |
-
|
| 6160 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6161 |
};
|
| 6162 |
|
| 6163 |
-
|
| 6164 |
-
|
| 6165 |
-
|
| 6166 |
|
| 6167 |
-
|
| 6168 |
-
|
| 6169 |
-
return range;
|
| 6170 |
-
}
|
| 6171 |
|
| 6172 |
-
|
| 6173 |
-
|
| 6174 |
-
|
| 6175 |
-
|
| 6176 |
-
|
| 6177 |
-
|
| 6178 |
-
|
| 6179 |
|
| 6180 |
-
|
| 6181 |
-
return interpolation(range);
|
| 6182 |
-
}
|
| 6183 |
|
| 6184 |
-
|
| 6185 |
-
|
| 6186 |
-
|
| 6187 |
-
var extrapolateLeft = config.extrapolateLeft || config.extrapolate || 'extend';
|
| 6188 |
-
var extrapolateRight = config.extrapolateRight || config.extrapolate || 'extend';
|
| 6189 |
|
| 6190 |
-
|
| 6191 |
-
|
| 6192 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6193 |
|
| 6194 |
-
|
| 6195 |
-
var range = findRange(input, inputRange);
|
| 6196 |
-
return interpolate(input, inputRange[range], inputRange[range + 1], outputRange[range], outputRange[range + 1], easing, extrapolateLeft, extrapolateRight, config.map);
|
| 6197 |
-
};
|
| 6198 |
-
}
|
| 6199 |
|
| 6200 |
-
|
| 6201 |
-
|
|
|
|
| 6202 |
|
| 6203 |
-
|
| 6204 |
-
|
| 6205 |
-
|
| 6206 |
|
| 6207 |
-
|
| 6208 |
-
|
| 6209 |
-
}
|
| 6210 |
|
| 6211 |
-
|
| 6212 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6213 |
|
| 6214 |
-
|
|
|
|
| 6215 |
|
| 6216 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6217 |
|
| 6218 |
-
|
| 6219 |
-
|
| 6220 |
-
}
|
| 6221 |
|
| 6222 |
-
function findRange(input, inputRange) {
|
| 6223 |
-
for (var i = 1; i < inputRange.length - 1; ++i) {
|
| 6224 |
-
if (inputRange[i] >= input) break;
|
| 6225 |
-
}
|
| 6226 |
|
| 6227 |
-
|
| 6228 |
-
}
|
| 6229 |
|
| 6230 |
-
|
| 6231 |
-
|
| 6232 |
-
function (_AnimatedArray) {
|
| 6233 |
-
_inheritsLoose(AnimatedInterpolation, _AnimatedArray);
|
| 6234 |
|
| 6235 |
-
|
| 6236 |
-
var _this;
|
| 6237 |
|
| 6238 |
-
_this = _AnimatedArray.call(this) || this;
|
| 6239 |
-
_this.calc = void 0;
|
| 6240 |
-
_this.payload = parents instanceof AnimatedArray && !(parents instanceof AnimatedInterpolation) ? parents.getPayload() : Array.isArray(parents) ? parents : [parents];
|
| 6241 |
-
_this.calc = createInterpolator(range, output, extrapolate);
|
| 6242 |
-
return _this;
|
| 6243 |
-
}
|
| 6244 |
|
| 6245 |
-
|
| 6246 |
|
| 6247 |
-
|
| 6248 |
-
|
| 6249 |
-
return value.getValue();
|
| 6250 |
-
}));
|
| 6251 |
-
};
|
| 6252 |
|
| 6253 |
-
|
| 6254 |
-
|
| 6255 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6256 |
|
| 6257 |
-
|
| 6258 |
-
return
|
| 6259 |
-
|
|
|
|
|
|
|
| 6260 |
|
| 6261 |
-
|
| 6262 |
-
|
|
|
|
|
|
|
| 6263 |
|
| 6264 |
-
|
| 6265 |
-
return parents && new AnimatedInterpolation(parents, range, output);
|
| 6266 |
};
|
| 6267 |
|
| 6268 |
-
|
| 6269 |
-
|
| 6270 |
-
|
| 6271 |
-
|
| 6272 |
-
|
| 6273 |
-
|
| 6274 |
-
tension: 120,
|
| 6275 |
-
friction: 14
|
| 6276 |
-
},
|
| 6277 |
-
wobbly: {
|
| 6278 |
-
tension: 180,
|
| 6279 |
-
friction: 12
|
| 6280 |
-
},
|
| 6281 |
-
stiff: {
|
| 6282 |
-
tension: 210,
|
| 6283 |
-
friction: 20
|
| 6284 |
-
},
|
| 6285 |
-
slow: {
|
| 6286 |
-
tension: 280,
|
| 6287 |
-
friction: 60
|
| 6288 |
-
},
|
| 6289 |
-
molasses: {
|
| 6290 |
-
tension: 280,
|
| 6291 |
-
friction: 120
|
| 6292 |
-
}
|
| 6293 |
-
};
|
| 6294 |
-
|
| 6295 |
-
/** API
|
| 6296 |
-
* useChain(references, timeSteps, timeFrame)
|
| 6297 |
-
*/
|
| 6298 |
|
| 6299 |
-
|
| 6300 |
-
|
| 6301 |
-
timeFrame = 1000;
|
| 6302 |
-
}
|
| 6303 |
|
| 6304 |
-
|
| 6305 |
-
|
| 6306 |
-
|
| 6307 |
-
|
| 6308 |
-
|
| 6309 |
-
|
| 6310 |
-
|
| 6311 |
-
var current = _ref2.current;
|
| 6312 |
|
| 6313 |
-
|
| 6314 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6315 |
|
| 6316 |
-
|
| 6317 |
-
|
| 6318 |
-
|
| 6319 |
-
ctrl.queue = ctrl.queue.map(function (e) {
|
| 6320 |
-
return _extends({}, e, {
|
| 6321 |
-
delay: e.delay + t
|
| 6322 |
-
});
|
| 6323 |
-
});
|
| 6324 |
-
ctrl.start();
|
| 6325 |
-
});
|
| 6326 |
-
}
|
| 6327 |
}
|
| 6328 |
-
|
| 6329 |
-
} else refs.reduce(function (q, _ref3, rI) {
|
| 6330 |
-
var current = _ref3.current;
|
| 6331 |
-
return q = q.then(function () {
|
| 6332 |
-
return current.start();
|
| 6333 |
-
});
|
| 6334 |
-
}, Promise.resolve());
|
| 6335 |
-
previous.current = refs;
|
| 6336 |
-
});
|
| 6337 |
-
}
|
| 6338 |
|
| 6339 |
-
|
| 6340 |
-
|
| 6341 |
-
* transparently when you render your Animated components.
|
| 6342 |
-
*
|
| 6343 |
-
* new Animated.Value(0)
|
| 6344 |
-
* .interpolate() .interpolate() new Animated.Value(1)
|
| 6345 |
-
* opacity translateY scale
|
| 6346 |
-
* style transform
|
| 6347 |
-
* View#234 style
|
| 6348 |
-
* View#123
|
| 6349 |
-
*
|
| 6350 |
-
* A) Top Down phase
|
| 6351 |
-
* When an AnimatedValue is updated, we recursively go down through this
|
| 6352 |
-
* graph in order to find leaf nodes: the views that we flag as needing
|
| 6353 |
-
* an update.
|
| 6354 |
-
*
|
| 6355 |
-
* B) Bottom Up phase
|
| 6356 |
-
* When a view is flagged as needing an update, we recursively go back up
|
| 6357 |
-
* in order to build the new value that it needs. The reason why we need
|
| 6358 |
-
* this two-phases process is to deal with composite props such as
|
| 6359 |
-
* transform which can receive values from multiple parents.
|
| 6360 |
-
*/
|
| 6361 |
-
function addAnimatedStyles(node, styles) {
|
| 6362 |
-
if ('update' in node) {
|
| 6363 |
-
styles.add(node);
|
| 6364 |
-
} else {
|
| 6365 |
-
node.getChildren().forEach(function (child) {
|
| 6366 |
-
return addAnimatedStyles(child, styles);
|
| 6367 |
-
});
|
| 6368 |
-
}
|
| 6369 |
-
}
|
| 6370 |
|
| 6371 |
-
var
|
| 6372 |
-
|
| 6373 |
-
|
| 6374 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6375 |
|
| 6376 |
-
|
| 6377 |
-
|
|
|
|
| 6378 |
|
| 6379 |
-
|
| 6380 |
-
|
| 6381 |
-
|
| 6382 |
-
_this.startPosition = void 0;
|
| 6383 |
-
_this.lastPosition = void 0;
|
| 6384 |
-
_this.lastVelocity = void 0;
|
| 6385 |
-
_this.startTime = void 0;
|
| 6386 |
-
_this.lastTime = void 0;
|
| 6387 |
-
_this.done = false;
|
| 6388 |
|
| 6389 |
-
|
| 6390 |
-
|
| 6391 |
-
|
| 6392 |
-
|
|
|
|
|
|
|
| 6393 |
|
| 6394 |
-
|
| 6395 |
-
|
| 6396 |
-
};
|
| 6397 |
|
| 6398 |
-
|
| 6399 |
-
|
| 6400 |
-
_this.lastPosition = _value;
|
| 6401 |
-
return _this;
|
| 6402 |
-
}
|
| 6403 |
|
| 6404 |
-
|
|
|
|
|
|
|
| 6405 |
|
| 6406 |
-
|
| 6407 |
-
|
| 6408 |
-
|
| 6409 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6410 |
|
| 6411 |
-
|
| 6412 |
-
|
| 6413 |
-
});
|
| 6414 |
-
};
|
| 6415 |
|
| 6416 |
-
|
| 6417 |
-
|
| 6418 |
-
};
|
| 6419 |
|
| 6420 |
-
|
| 6421 |
-
|
| 6422 |
-
|
|
|
|
| 6423 |
|
| 6424 |
-
|
| 6425 |
-
|
| 6426 |
-
};
|
| 6427 |
|
| 6428 |
-
|
| 6429 |
-
}(Animated);
|
| 6430 |
|
| 6431 |
-
var
|
| 6432 |
-
|
| 6433 |
-
function (_AnimatedArray) {
|
| 6434 |
-
_inheritsLoose(AnimatedValueArray, _AnimatedArray);
|
| 6435 |
|
| 6436 |
-
|
| 6437 |
-
var _this;
|
| 6438 |
|
| 6439 |
-
|
| 6440 |
-
|
| 6441 |
-
return new AnimatedValue(n);
|
| 6442 |
-
});
|
| 6443 |
-
return _this;
|
| 6444 |
-
}
|
| 6445 |
|
| 6446 |
-
|
| 6447 |
|
| 6448 |
-
|
| 6449 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6450 |
|
| 6451 |
-
|
| 6452 |
-
flush = true;
|
| 6453 |
}
|
| 6454 |
|
| 6455 |
-
|
| 6456 |
-
|
| 6457 |
-
|
| 6458 |
-
|
| 6459 |
-
|
| 6460 |
-
|
| 6461 |
-
|
| 6462 |
-
|
| 6463 |
-
|
| 6464 |
-
|
|
|
|
| 6465 |
}
|
| 6466 |
-
};
|
| 6467 |
|
| 6468 |
-
|
| 6469 |
-
return this.payload.map(function (v) {
|
| 6470 |
-
return v.getValue();
|
| 6471 |
-
});
|
| 6472 |
-
};
|
| 6473 |
|
| 6474 |
-
|
| 6475 |
-
|
| 6476 |
-
|
| 6477 |
|
| 6478 |
-
|
| 6479 |
-
}
|
| 6480 |
|
| 6481 |
-
var
|
|
|
|
|
|
|
|
|
|
| 6482 |
|
| 6483 |
-
|
| 6484 |
-
|
| 6485 |
-
|
| 6486 |
-
function Controller() {
|
| 6487 |
-
var _this = this;
|
| 6488 |
|
| 6489 |
-
|
| 6490 |
-
|
| 6491 |
-
|
| 6492 |
-
|
| 6493 |
-
this.local = 0;
|
| 6494 |
-
this.props = {};
|
| 6495 |
-
this.merged = {};
|
| 6496 |
-
this.animations = {};
|
| 6497 |
-
this.interpolations = {};
|
| 6498 |
-
this.values = {};
|
| 6499 |
-
this.configs = [];
|
| 6500 |
-
this.listeners = [];
|
| 6501 |
-
this.queue = [];
|
| 6502 |
-
this.localQueue = void 0;
|
| 6503 |
|
| 6504 |
-
|
| 6505 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6506 |
};
|
|
|
|
| 6507 |
|
| 6508 |
-
|
| 6509 |
-
|
| 6510 |
-
/** update(props)
|
| 6511 |
-
* This function filters input props and creates an array of tasks which are executed in .start()
|
| 6512 |
-
* Each task is allowed to carry a delay, which means it can execute asnychroneously */
|
| 6513 |
-
|
| 6514 |
-
|
| 6515 |
-
var _proto = Controller.prototype;
|
| 6516 |
|
| 6517 |
-
|
| 6518 |
-
|
| 6519 |
-
|
| 6520 |
|
| 6521 |
-
var
|
| 6522 |
-
|
| 6523 |
-
delay = _ref$delay === void 0 ? 0 : _ref$delay,
|
| 6524 |
-
to = _ref.to,
|
| 6525 |
-
props = _objectWithoutPropertiesLoose(_ref, ["delay", "to"]);
|
| 6526 |
|
| 6527 |
-
|
| 6528 |
-
// If config is either a function or an array queue it up as is
|
| 6529 |
-
this.queue.push(_extends({}, props, {
|
| 6530 |
-
delay: delay,
|
| 6531 |
-
to: to
|
| 6532 |
-
}));
|
| 6533 |
-
} else if (to) {
|
| 6534 |
-
// Otherwise go through each key since it could be delayed individually
|
| 6535 |
-
var ops = {};
|
| 6536 |
-
Object.entries(to).forEach(function (_ref2) {
|
| 6537 |
-
var _to;
|
| 6538 |
|
| 6539 |
-
|
| 6540 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6541 |
|
| 6542 |
-
|
| 6543 |
-
|
| 6544 |
-
to: (_to = {}, _to[k] = v, _to),
|
| 6545 |
-
delay: callProp(delay, k)
|
| 6546 |
-
}, props);
|
| 6547 |
|
| 6548 |
-
var previous = ops[entry.delay] && ops[entry.delay].to;
|
| 6549 |
-
ops[entry.delay] = _extends({}, ops[entry.delay], entry, {
|
| 6550 |
-
to: _extends({}, previous, entry.to)
|
| 6551 |
-
});
|
| 6552 |
-
});
|
| 6553 |
-
this.queue = Object.values(ops);
|
| 6554 |
-
} // Sort queue, so that async calls go last
|
| 6555 |
|
|
|
|
| 6556 |
|
| 6557 |
-
|
| 6558 |
-
|
| 6559 |
-
}); // Diff the reduced props immediately (they'll contain the from-prop and some config)
|
| 6560 |
|
| 6561 |
-
|
| 6562 |
-
|
|
|
|
| 6563 |
}
|
| 6564 |
-
|
| 6565 |
-
* This function either executes a queue, if present, or starts the frameloop, which animates */
|
| 6566 |
-
;
|
| 6567 |
-
|
| 6568 |
-
_proto.start = function start$$1(onEnd) {
|
| 6569 |
-
var _this2 = this;
|
| 6570 |
|
| 6571 |
-
|
| 6572 |
-
if (this.queue.length) {
|
| 6573 |
-
this.idle = false; // Updates can interrupt trailing queues, in that case we just merge values
|
| 6574 |
|
| 6575 |
-
|
| 6576 |
-
this.localQueue.forEach(function (_ref3) {
|
| 6577 |
-
var _ref3$from = _ref3.from,
|
| 6578 |
-
from = _ref3$from === void 0 ? {} : _ref3$from,
|
| 6579 |
-
_ref3$to = _ref3.to,
|
| 6580 |
-
to = _ref3$to === void 0 ? {} : _ref3$to;
|
| 6581 |
-
if (is.obj(from)) _this2.merged = _extends({}, from, _this2.merged);
|
| 6582 |
-
if (is.obj(to)) _this2.merged = _extends({}, _this2.merged, to);
|
| 6583 |
-
});
|
| 6584 |
-
} // The guid helps us tracking frames, a new queue over an old one means an override
|
| 6585 |
-
// We discard async calls in that caseÍ
|
| 6586 |
|
|
|
|
|
|
|
| 6587 |
|
| 6588 |
-
|
| 6589 |
-
var queue = this.localQueue = this.queue;
|
| 6590 |
-
this.queue = []; // Go through each entry and execute it
|
| 6591 |
|
| 6592 |
-
|
| 6593 |
-
|
| 6594 |
-
|
|
|
|
| 6595 |
|
| 6596 |
-
|
| 6597 |
-
|
| 6598 |
-
|
| 6599 |
-
|
| 6600 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6601 |
|
| 6602 |
-
|
| 6603 |
-
}; // Entries can be delayed, ansyc or immediate
|
| 6604 |
|
|
|
|
| 6605 |
|
| 6606 |
-
|
|
|
|
| 6607 |
|
| 6608 |
-
|
| 6609 |
-
setTimeout(function () {
|
| 6610 |
-
if (local === _this2.guid) {
|
| 6611 |
-
if (async) _this2.runAsync(props, cb);else _this2.diff(props).start(cb);
|
| 6612 |
-
}
|
| 6613 |
-
}, delay);
|
| 6614 |
-
} else if (async) _this2.runAsync(props, cb);else _this2.diff(props).start(cb);
|
| 6615 |
-
});
|
| 6616 |
-
} // Otherwise we kick of the frameloop
|
| 6617 |
-
else {
|
| 6618 |
-
if (is.fun(onEnd)) this.listeners.push(onEnd);
|
| 6619 |
-
if (this.props.onStart) this.props.onStart();
|
| 6620 |
|
| 6621 |
-
|
| 6622 |
-
|
| 6623 |
|
| 6624 |
-
|
| 6625 |
-
};
|
| 6626 |
|
| 6627 |
-
|
| 6628 |
-
|
| 6629 |
-
return onEnd(finished);
|
| 6630 |
-
});
|
| 6631 |
-
this.listeners = [];
|
| 6632 |
-
return this;
|
| 6633 |
-
}
|
| 6634 |
-
/** Pause sets onEnd listeners free, but also removes the controller from the frameloop */
|
| 6635 |
-
;
|
| 6636 |
|
| 6637 |
-
|
| 6638 |
-
|
| 6639 |
-
if (finished) stop(this);
|
| 6640 |
-
return this;
|
| 6641 |
-
};
|
| 6642 |
|
| 6643 |
-
|
| 6644 |
-
|
|
|
|
|
|
|
| 6645 |
|
| 6646 |
-
|
| 6647 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6648 |
|
| 6649 |
-
|
| 6650 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6651 |
|
| 6652 |
-
|
|
|
|
|
|
|
| 6653 |
|
| 6654 |
-
|
| 6655 |
-
|
| 6656 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6657 |
|
| 6658 |
-
|
|
|
|
|
|
|
| 6659 |
|
| 6660 |
-
|
| 6661 |
-
|
| 6662 |
-
|
| 6663 |
-
|
| 6664 |
-
|
| 6665 |
-
|
| 6666 |
-
|
| 6667 |
-
|
|
|
|
|
|
|
| 6668 |
|
| 6669 |
-
|
| 6670 |
-
|
| 6671 |
-
|
| 6672 |
-
} else if (is.fun(props.to)) {
|
| 6673 |
-
var index = 0;
|
| 6674 |
-
var last;
|
| 6675 |
-
queue = queue.then(function () {
|
| 6676 |
-
return props.to( // next(props)
|
| 6677 |
-
function (p) {
|
| 6678 |
-
var fresh = _extends({}, props, interpolateTo(p));
|
| 6679 |
|
| 6680 |
-
if (is.arr(fresh.config)) fresh.config = fresh.config[index];
|
| 6681 |
-
index++; //this.stop()
|
| 6682 |
|
| 6683 |
-
|
| 6684 |
-
|
| 6685 |
-
|
| 6686 |
-
|
| 6687 |
-
|
| 6688 |
-
|
| 6689 |
-
|
| 6690 |
-
|
| 6691 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6692 |
|
| 6693 |
-
|
| 6694 |
-
|
| 6695 |
-
|
| 6696 |
-
|
| 6697 |
-
|
| 6698 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6699 |
|
| 6700 |
-
|
| 6701 |
-
|
|
|
|
| 6702 |
|
| 6703 |
-
|
| 6704 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6705 |
|
| 6706 |
-
|
| 6707 |
-
|
| 6708 |
-
|
| 6709 |
-
from = _this$props$from === void 0 ? {} : _this$props$from,
|
| 6710 |
-
_this$props$to = _this$props.to,
|
| 6711 |
-
to = _this$props$to === void 0 ? {} : _this$props$to,
|
| 6712 |
-
_this$props$config = _this$props.config,
|
| 6713 |
-
config = _this$props$config === void 0 ? {} : _this$props$config,
|
| 6714 |
-
reverse = _this$props.reverse,
|
| 6715 |
-
attach = _this$props.attach,
|
| 6716 |
-
reset = _this$props.reset,
|
| 6717 |
-
immediate = _this$props.immediate; // Reverse values when requested
|
| 6718 |
|
| 6719 |
-
if (reverse) {
|
| 6720 |
-
var _ref6 = [to, from];
|
| 6721 |
-
from = _ref6[0];
|
| 6722 |
-
to = _ref6[1];
|
| 6723 |
-
} // This will collect all props that were ever set, reset merged props when necessary
|
| 6724 |
|
| 6725 |
|
| 6726 |
-
this.merged = _extends({}, from, this.merged, to);
|
| 6727 |
-
this.hasChanged = false; // Attachment handling, trailed springs can "attach" themselves to a previous spring
|
| 6728 |
|
| 6729 |
-
var target = attach && attach(this); // Reduces input { name: value } pairs into animated values
|
| 6730 |
|
| 6731 |
-
|
| 6732 |
-
|
| 6733 |
-
|
| 6734 |
-
// Issue cached entries, except on reset
|
| 6735 |
-
var entry = acc[name] || {}; // Figure out what the value is supposed to be
|
| 6736 |
|
| 6737 |
-
|
| 6738 |
-
|
| 6739 |
-
|
| 6740 |
-
|
| 6741 |
-
var fromValue = !is.und(from[name]) ? from[name] : value;
|
| 6742 |
-
var toValue = isNumber || isArray ? value : isString ? value : 1;
|
| 6743 |
-
var toConfig = callProp(config, name);
|
| 6744 |
-
if (target) toValue = target.animations[name].parent;
|
| 6745 |
-
var parent = entry.parent,
|
| 6746 |
-
interpolation$$1 = entry.interpolation,
|
| 6747 |
-
toValues = toArray(target ? toValue.getPayload() : toValue),
|
| 6748 |
-
animatedValues;
|
| 6749 |
-
var newValue = value;
|
| 6750 |
-
if (isInterpolation) newValue = interpolation({
|
| 6751 |
-
range: [0, 1],
|
| 6752 |
-
output: [value, value]
|
| 6753 |
-
})(1);
|
| 6754 |
-
var currentValue = interpolation$$1 && interpolation$$1.getValue(); // Change detection flags
|
| 6755 |
|
| 6756 |
-
|
| 6757 |
-
|
| 6758 |
-
|
| 6759 |
-
});
|
| 6760 |
-
var currentValueDiffersFromGoal = !is.equ(newValue, currentValue);
|
| 6761 |
-
var hasNewGoal = !is.equ(newValue, entry.previous);
|
| 6762 |
-
var hasNewConfig = !is.equ(toConfig, entry.config); // Change animation props when props indicate a new goal (new value differs from previous one)
|
| 6763 |
-
// and current values differ from it. Config changes trigger a new update as well (though probably shouldn't?)
|
| 6764 |
|
| 6765 |
-
|
| 6766 |
-
|
|
|
|
| 6767 |
|
| 6768 |
-
|
| 6769 |
-
|
| 6770 |
-
|
| 6771 |
-
|
|
|
|
|
|
|
|
|
|
| 6772 |
|
| 6773 |
-
|
| 6774 |
-
|
| 6775 |
-
|
| 6776 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6777 |
|
| 6778 |
-
|
| 6779 |
-
|
| 6780 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6781 |
|
| 6782 |
-
|
| 6783 |
-
|
| 6784 |
-
|
| 6785 |
-
|
| 6786 |
-
|
| 6787 |
-
|
| 6788 |
-
|
| 6789 |
-
|
| 6790 |
-
|
| 6791 |
|
| 6792 |
-
animatedValues.forEach(function (value) {
|
| 6793 |
-
value.startPosition = value.value;
|
| 6794 |
-
value.lastPosition = value.value;
|
| 6795 |
-
value.lastVelocity = isActive ? value.lastVelocity : undefined;
|
| 6796 |
-
value.lastTime = isActive ? value.lastTime : undefined;
|
| 6797 |
-
value.startTime = now();
|
| 6798 |
-
value.done = false;
|
| 6799 |
-
value.animatedStyles.clear();
|
| 6800 |
-
}); // Set immediate values
|
| 6801 |
|
| 6802 |
-
|
| 6803 |
-
|
| 6804 |
-
|
|
|
|
|
|
|
| 6805 |
|
| 6806 |
-
|
| 6807 |
-
name: name,
|
| 6808 |
-
parent: parent,
|
| 6809 |
-
interpolation: interpolation$$1,
|
| 6810 |
-
animatedValues: animatedValues,
|
| 6811 |
-
toValues: toValues,
|
| 6812 |
-
previous: newValue,
|
| 6813 |
-
config: toConfig,
|
| 6814 |
-
fromValues: toArray(parent.getValue()),
|
| 6815 |
-
immediate: callProp(immediate, name),
|
| 6816 |
-
initialVelocity: withDefault(toConfig.velocity, 0),
|
| 6817 |
-
clamp: withDefault(toConfig.clamp, false),
|
| 6818 |
-
precision: withDefault(toConfig.precision, 0.01),
|
| 6819 |
-
tension: withDefault(toConfig.tension, 170),
|
| 6820 |
-
friction: withDefault(toConfig.friction, 26),
|
| 6821 |
-
mass: withDefault(toConfig.mass, 1),
|
| 6822 |
-
duration: toConfig.duration,
|
| 6823 |
-
easing: withDefault(toConfig.easing, function (t) {
|
| 6824 |
-
return t;
|
| 6825 |
-
}),
|
| 6826 |
-
decay: toConfig.decay
|
| 6827 |
-
}), _extends2));
|
| 6828 |
-
} else {
|
| 6829 |
-
if (!currentValueDiffersFromGoal) {
|
| 6830 |
-
var _extends3;
|
| 6831 |
|
| 6832 |
-
|
| 6833 |
-
|
| 6834 |
-
// In order to resolve this without causing an animation update we silently flag the animation as done,
|
| 6835 |
-
// which it technically is. Interpolations also needs a config update with their target set to 1.
|
| 6836 |
-
if (isInterpolation) {
|
| 6837 |
-
parent.setValue(1, false);
|
| 6838 |
-
interpolation$$1.updateConfig({
|
| 6839 |
-
output: [newValue, newValue]
|
| 6840 |
-
});
|
| 6841 |
-
}
|
| 6842 |
|
| 6843 |
-
|
| 6844 |
-
_this4.hasChanged = true;
|
| 6845 |
-
return _extends({}, acc, (_extends3 = {}, _extends3[name] = _extends({}, acc[name], {
|
| 6846 |
-
previous: newValue
|
| 6847 |
-
}), _extends3));
|
| 6848 |
-
}
|
| 6849 |
|
| 6850 |
-
|
| 6851 |
-
}
|
| 6852 |
-
}, this.animations);
|
| 6853 |
|
| 6854 |
-
|
| 6855 |
-
|
| 6856 |
-
|
| 6857 |
-
|
| 6858 |
-
this.interpolations = {};
|
| 6859 |
|
| 6860 |
-
|
| 6861 |
-
|
| 6862 |
-
this.values[key] = this.animations[key].interpolation.getValue();
|
| 6863 |
-
}
|
| 6864 |
-
}
|
| 6865 |
|
| 6866 |
-
|
| 6867 |
-
};
|
| 6868 |
|
| 6869 |
-
|
| 6870 |
-
this.stop();
|
| 6871 |
-
this.props = {};
|
| 6872 |
-
this.merged = {};
|
| 6873 |
-
this.animations = {};
|
| 6874 |
-
this.interpolations = {};
|
| 6875 |
-
this.values = {};
|
| 6876 |
-
this.configs = [];
|
| 6877 |
-
this.local = 0;
|
| 6878 |
-
};
|
| 6879 |
|
| 6880 |
-
|
| 6881 |
-
|
| 6882 |
|
| 6883 |
-
|
| 6884 |
-
* const props = useSprings(number, [{ ... }, { ... }, ...])
|
| 6885 |
-
* const [props, set] = useSprings(number, (i, controller) => ({ ... }))
|
| 6886 |
-
*/
|
| 6887 |
|
| 6888 |
-
|
| 6889 |
-
|
| 6890 |
-
var ctrl = React.useRef();
|
| 6891 |
-
var isFn = is.fun(props); // The controller maintains the animation values, starts and stops animations
|
| 6892 |
|
| 6893 |
-
|
| 6894 |
-
|
| 6895 |
-
if (ctrl.current) {
|
| 6896 |
-
ctrl.current.map(function (c) {
|
| 6897 |
-
return c.destroy();
|
| 6898 |
-
});
|
| 6899 |
-
ctrl.current = undefined;
|
| 6900 |
-
}
|
| 6901 |
|
| 6902 |
-
|
| 6903 |
-
|
| 6904 |
-
|
| 6905 |
-
|
| 6906 |
-
|
| 6907 |
-
ctrl.update(newProps);
|
| 6908 |
-
if (!ref) ctrl.start();
|
| 6909 |
-
return ctrl;
|
| 6910 |
-
}), ref];
|
| 6911 |
-
}, [length]),
|
| 6912 |
-
controllers = _useMemo[0],
|
| 6913 |
-
ref = _useMemo[1];
|
| 6914 |
|
| 6915 |
-
|
|
|
|
|
|
|
|
|
|
| 6916 |
|
| 6917 |
-
|
| 6918 |
-
|
| 6919 |
-
|
| 6920 |
-
return Promise.all(ctrl.current.map(function (c) {
|
| 6921 |
-
return new Promise(function (r) {
|
| 6922 |
-
return c.start(r);
|
| 6923 |
-
});
|
| 6924 |
-
}));
|
| 6925 |
-
},
|
| 6926 |
-
stop: function stop(finished) {
|
| 6927 |
-
return ctrl.current.forEach(function (c) {
|
| 6928 |
-
return c.stop(finished);
|
| 6929 |
-
});
|
| 6930 |
-
},
|
| 6931 |
|
| 6932 |
-
get controllers() {
|
| 6933 |
-
return ctrl.current;
|
| 6934 |
-
}
|
| 6935 |
|
| 6936 |
-
|
| 6937 |
-
|
| 6938 |
|
| 6939 |
-
|
| 6940 |
-
return
|
| 6941 |
-
|
| 6942 |
-
c.update(isFn ? callProp(updateProps, i, c) : updateProps[i]);
|
| 6943 |
-
if (!ref) c.start();
|
| 6944 |
-
});
|
| 6945 |
-
};
|
| 6946 |
-
}, [length]); // Update controller if props aren't functional
|
| 6947 |
|
| 6948 |
-
|
| 6949 |
-
|
| 6950 |
-
if (!isFn) updateCtrl(props);
|
| 6951 |
-
} else if (!ref) ctrl.current.forEach(function (c) {
|
| 6952 |
-
return c.start();
|
| 6953 |
-
});
|
| 6954 |
-
}); // Update mounted flag and destroy controller on unmount
|
| 6955 |
|
| 6956 |
-
|
| 6957 |
-
|
| 6958 |
-
return ctrl.current.forEach(function (c) {
|
| 6959 |
-
return c.destroy();
|
| 6960 |
-
});
|
| 6961 |
-
};
|
| 6962 |
-
}, []); // Return animated props, or, anim-props + the update-setter above
|
| 6963 |
|
| 6964 |
-
|
| 6965 |
-
return
|
| 6966 |
-
}
|
| 6967 |
-
return isFn ? [propValues, updateCtrl, function (finished) {
|
| 6968 |
-
return ctrl.current.forEach(function (c) {
|
| 6969 |
-
return c.pause(finished);
|
| 6970 |
-
});
|
| 6971 |
-
}] : propValues;
|
| 6972 |
-
};
|
| 6973 |
|
| 6974 |
-
|
| 6975 |
-
|
| 6976 |
-
* const [props, set] = useSpring(() => ({ ... }))
|
| 6977 |
-
*/
|
| 6978 |
|
| 6979 |
-
|
| 6980 |
-
var
|
| 6981 |
|
| 6982 |
-
|
| 6983 |
-
|
| 6984 |
-
|
| 6985 |
-
pause = _useSprings[2];
|
| 6986 |
|
| 6987 |
-
return
|
| 6988 |
-
}
|
| 6989 |
|
| 6990 |
-
|
| 6991 |
-
|
| 6992 |
-
* const [trails, set] = useTrail(number, () => ({ ... }))
|
| 6993 |
-
*/
|
| 6994 |
|
| 6995 |
-
|
| 6996 |
-
|
| 6997 |
-
|
| 6998 |
-
var updateProps = callProp(props);
|
| 6999 |
-
var instances = React.useRef();
|
| 7000 |
|
| 7001 |
-
|
| 7002 |
-
|
| 7003 |
-
instances.current.push(ctrl);
|
| 7004 |
-
return _extends({}, updateProps, {
|
| 7005 |
-
config: callProp(updateProps.config, i),
|
| 7006 |
-
attach: i > 0 && function () {
|
| 7007 |
-
return instances.current[i - 1];
|
| 7008 |
-
}
|
| 7009 |
-
});
|
| 7010 |
-
}),
|
| 7011 |
-
result = _useSprings[0],
|
| 7012 |
-
set = _useSprings[1],
|
| 7013 |
-
pause = _useSprings[2]; // Set up function to update controller
|
| 7014 |
|
|
|
|
|
|
|
| 7015 |
|
| 7016 |
-
|
| 7017 |
-
return
|
| 7018 |
-
|
| 7019 |
-
var last = props.reverse ? i === 0 : length - 1 === i;
|
| 7020 |
-
var attachIdx = props.reverse ? i + 1 : i - 1;
|
| 7021 |
-
var attachController = instances.current[attachIdx];
|
| 7022 |
-
return _extends({}, props, {
|
| 7023 |
-
config: callProp(props.config || updateProps.config, i),
|
| 7024 |
-
attach: attachController && function () {
|
| 7025 |
-
return attachController;
|
| 7026 |
-
}
|
| 7027 |
-
});
|
| 7028 |
-
});
|
| 7029 |
-
};
|
| 7030 |
-
}, [length, updateProps.reverse]); // Update controller if props aren't functional
|
| 7031 |
|
| 7032 |
-
|
| 7033 |
-
|
| 7034 |
-
}); // Update mounted flag and destroy controller on unmount
|
| 7035 |
|
| 7036 |
-
|
| 7037 |
-
|
| 7038 |
-
}, []);
|
| 7039 |
-
return isFn ? [result, updateCtrl, pause] : result;
|
| 7040 |
-
};
|
| 7041 |
|
| 7042 |
-
|
| 7043 |
-
|
| 7044 |
-
|
| 7045 |
-
*/
|
| 7046 |
|
| 7047 |
-
|
| 7048 |
-
|
| 7049 |
-
var LEAVE = 'leave';
|
| 7050 |
-
var UPDATE = 'update';
|
| 7051 |
|
| 7052 |
-
|
| 7053 |
-
|
| 7054 |
-
};
|
| 7055 |
|
| 7056 |
-
|
| 7057 |
-
|
| 7058 |
-
|
| 7059 |
-
keys = _props$keys === void 0 ? function (item) {
|
| 7060 |
-
return item;
|
| 7061 |
-
} : _props$keys,
|
| 7062 |
-
rest = _objectWithoutPropertiesLoose(props, ["items", "keys"]);
|
| 7063 |
|
| 7064 |
-
|
| 7065 |
-
|
| 7066 |
-
items: items,
|
| 7067 |
-
keys: mapKeys(items, keys)
|
| 7068 |
-
}, rest);
|
| 7069 |
-
};
|
| 7070 |
|
| 7071 |
-
function
|
| 7072 |
-
var
|
| 7073 |
-
items: input,
|
| 7074 |
-
keys: keyTransform || function (i) {
|
| 7075 |
-
return i;
|
| 7076 |
-
}
|
| 7077 |
-
}, config);
|
| 7078 |
|
| 7079 |
-
|
| 7080 |
-
|
| 7081 |
-
|
| 7082 |
-
_get$unique = _get.unique,
|
| 7083 |
-
_get$reset = _get.reset,
|
| 7084 |
-
reset = _get$reset === void 0 ? false : _get$reset,
|
| 7085 |
-
enter = _get.enter,
|
| 7086 |
-
leave = _get.leave,
|
| 7087 |
-
update = _get.update,
|
| 7088 |
-
onDestroyed = _get.onDestroyed,
|
| 7089 |
-
keys = _get.keys,
|
| 7090 |
-
items = _get.items,
|
| 7091 |
-
onFrame = _get.onFrame,
|
| 7092 |
-
_onRest = _get.onRest,
|
| 7093 |
-
onStart = _get.onStart,
|
| 7094 |
-
ref = _get.ref,
|
| 7095 |
-
extra = _objectWithoutPropertiesLoose(_get, ["lazy", "unique", "reset", "enter", "leave", "update", "onDestroyed", "keys", "items", "onFrame", "onRest", "onStart", "ref"]);
|
| 7096 |
|
| 7097 |
-
|
| 7098 |
-
|
| 7099 |
-
var state = React.useRef({
|
| 7100 |
-
mounted: false,
|
| 7101 |
-
first: true,
|
| 7102 |
-
deleted: [],
|
| 7103 |
-
current: {},
|
| 7104 |
-
transitions: [],
|
| 7105 |
-
prevProps: {},
|
| 7106 |
-
paused: !!props.ref,
|
| 7107 |
-
instances: !mounted.current && new Map(),
|
| 7108 |
-
forceUpdate: forceUpdate
|
| 7109 |
-
});
|
| 7110 |
-
React.useImperativeHandle(props.ref, function () {
|
| 7111 |
-
return {
|
| 7112 |
-
start: function start() {
|
| 7113 |
-
return Promise.all(Array.from(state.current.instances).map(function (_ref) {
|
| 7114 |
-
var c = _ref[1];
|
| 7115 |
-
return new Promise(function (r) {
|
| 7116 |
-
return c.start(r);
|
| 7117 |
-
});
|
| 7118 |
-
}));
|
| 7119 |
-
},
|
| 7120 |
-
stop: function stop(finished) {
|
| 7121 |
-
return Array.from(state.current.instances).forEach(function (_ref2) {
|
| 7122 |
-
var c = _ref2[1];
|
| 7123 |
-
return c.stop(finished);
|
| 7124 |
-
});
|
| 7125 |
-
},
|
| 7126 |
|
| 7127 |
-
|
| 7128 |
-
|
| 7129 |
-
var c = _ref3[1];
|
| 7130 |
-
return c;
|
| 7131 |
-
});
|
| 7132 |
-
}
|
| 7133 |
|
| 7134 |
-
|
| 7135 |
-
|
|
|
|
| 7136 |
|
| 7137 |
-
|
|
|
|
| 7138 |
|
| 7139 |
-
|
| 7140 |
-
|
| 7141 |
-
|
| 7142 |
-
var slot = transition.slot,
|
| 7143 |
-
from = transition.from,
|
| 7144 |
-
to = transition.to,
|
| 7145 |
-
config = transition.config,
|
| 7146 |
-
trail = transition.trail,
|
| 7147 |
-
key = transition.key,
|
| 7148 |
-
item = transition.item;
|
| 7149 |
-
if (!state.current.instances.has(key)) state.current.instances.set(key, new Controller()); // update the map object
|
| 7150 |
|
| 7151 |
-
var ctrl = state.current.instances.get(key);
|
| 7152 |
|
| 7153 |
-
|
| 7154 |
-
|
| 7155 |
-
|
| 7156 |
-
|
| 7157 |
-
|
| 7158 |
-
|
| 7159 |
-
|
| 7160 |
-
|
| 7161 |
-
|
| 7162 |
-
|
| 7163 |
-
|
| 7164 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7165 |
|
|
|
|
|
|
|
|
|
|
| 7166 |
|
| 7167 |
-
|
| 7168 |
-
|
| 7169 |
-
var c = _ref4[1];
|
| 7170 |
-
return !c.idle;
|
| 7171 |
-
});
|
| 7172 |
-
if (!active && (ref || lazy) && state.current.deleted.length > 0) cleanUp(state);
|
| 7173 |
-
if (_onRest) _onRest(item, slot, values);
|
| 7174 |
-
}
|
| 7175 |
-
},
|
| 7176 |
-
onStart: onStart && function () {
|
| 7177 |
-
return onStart(item, slot);
|
| 7178 |
-
},
|
| 7179 |
-
onFrame: onFrame && function (values) {
|
| 7180 |
-
return onFrame(item, slot, values);
|
| 7181 |
-
},
|
| 7182 |
-
delay: trail,
|
| 7183 |
-
reset: reset && slot === ENTER // Update controller
|
| 7184 |
|
| 7185 |
-
|
|
|
|
|
|
|
| 7186 |
|
| 7187 |
-
|
| 7188 |
-
|
| 7189 |
-
});
|
| 7190 |
-
}
|
| 7191 |
|
| 7192 |
-
|
| 7193 |
-
|
| 7194 |
-
return function () {
|
| 7195 |
-
state.current.mounted = mounted.current = false;
|
| 7196 |
-
Array.from(state.current.instances).map(function (_ref5) {
|
| 7197 |
-
var c = _ref5[1];
|
| 7198 |
-
return c.destroy();
|
| 7199 |
-
});
|
| 7200 |
-
state.current.instances.clear();
|
| 7201 |
-
};
|
| 7202 |
-
}, []);
|
| 7203 |
-
return state.current.transitions.map(function (_ref6) {
|
| 7204 |
-
var item = _ref6.item,
|
| 7205 |
-
slot = _ref6.slot,
|
| 7206 |
-
key = _ref6.key;
|
| 7207 |
-
return {
|
| 7208 |
-
item: item,
|
| 7209 |
-
key: key,
|
| 7210 |
-
state: slot,
|
| 7211 |
-
props: state.current.instances.get(key).getValues()
|
| 7212 |
-
};
|
| 7213 |
-
});
|
| 7214 |
-
}
|
| 7215 |
|
| 7216 |
-
|
| 7217 |
-
|
| 7218 |
|
| 7219 |
-
|
| 7220 |
-
|
| 7221 |
-
if (_i >= _iterator.length) return "break";
|
| 7222 |
-
_ref8 = _iterator[_i++];
|
| 7223 |
-
} else {
|
| 7224 |
-
_i = _iterator.next();
|
| 7225 |
-
if (_i.done) return "break";
|
| 7226 |
-
_ref8 = _i.value;
|
| 7227 |
-
}
|
| 7228 |
|
| 7229 |
-
|
| 7230 |
-
|
| 7231 |
|
| 7232 |
-
|
| 7233 |
-
return
|
| 7234 |
-
};
|
| 7235 |
|
| 7236 |
-
|
| 7237 |
-
|
| 7238 |
-
state.current.transitions = state.current.transitions.filter(filter);
|
| 7239 |
-
state.current.deleted = state.current.deleted.filter(filter);
|
| 7240 |
-
}
|
| 7241 |
-
};
|
| 7242 |
|
| 7243 |
-
|
| 7244 |
-
|
| 7245 |
|
| 7246 |
-
|
|
|
|
| 7247 |
|
| 7248 |
-
|
|
|
|
| 7249 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7250 |
|
| 7251 |
-
|
| 7252 |
-
}
|
|
|
|
| 7253 |
|
| 7254 |
-
function diffItems(_ref9, props) {
|
| 7255 |
-
var first = _ref9.first,
|
| 7256 |
-
prevProps = _ref9.prevProps,
|
| 7257 |
-
state = _objectWithoutPropertiesLoose(_ref9, ["first", "prevProps"]);
|
| 7258 |
|
| 7259 |
-
|
| 7260 |
-
|
| 7261 |
-
|
| 7262 |
-
|
| 7263 |
-
|
| 7264 |
-
enter = _get2.enter,
|
| 7265 |
-
leave = _get2.leave,
|
| 7266 |
-
update = _get2.update,
|
| 7267 |
-
_get2$trail = _get2.trail,
|
| 7268 |
-
trail = _get2$trail === void 0 ? 0 : _get2$trail,
|
| 7269 |
-
unique = _get2.unique,
|
| 7270 |
-
config = _get2.config,
|
| 7271 |
-
_get2$order = _get2.order,
|
| 7272 |
-
order = _get2$order === void 0 ? [ENTER, LEAVE, UPDATE] : _get2$order;
|
| 7273 |
|
| 7274 |
-
var _get3 = get(prevProps),
|
| 7275 |
-
_keys = _get3.keys,
|
| 7276 |
-
_items = _get3.items;
|
| 7277 |
|
| 7278 |
-
|
|
|
|
|
|
|
| 7279 |
|
| 7280 |
-
var deleted = [].concat(state.deleted); // Compare next keys with current keys
|
| 7281 |
|
| 7282 |
-
|
| 7283 |
-
|
| 7284 |
-
|
| 7285 |
-
|
| 7286 |
-
return !currentSet.has(item);
|
| 7287 |
-
});
|
| 7288 |
-
var removed = state.transitions.filter(function (item) {
|
| 7289 |
-
return !item.destroyed && !nextSet.has(item.originalKey);
|
| 7290 |
-
}).map(function (i) {
|
| 7291 |
-
return i.originalKey;
|
| 7292 |
-
});
|
| 7293 |
-
var updated = keys.filter(function (item) {
|
| 7294 |
-
return currentSet.has(item);
|
| 7295 |
-
});
|
| 7296 |
-
var delay = -trail;
|
| 7297 |
|
| 7298 |
-
|
| 7299 |
-
|
| 7300 |
|
| 7301 |
-
|
| 7302 |
-
|
| 7303 |
-
|
| 7304 |
-
|
| 7305 |
-
|
| 7306 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7307 |
return d.originalKey === key;
|
| 7308 |
})) deleted = deleted.filter(function (t) {
|
| 7309 |
return t.originalKey !== key;
|
|
@@ -7322,2220 +14905,3673 @@ function diffItems(_ref9, props) {
|
|
| 7322 |
to: callProp(enter, item)
|
| 7323 |
};
|
| 7324 |
});
|
| 7325 |
-
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7326 |
}
|
|
|
|
|
|
|
| 7327 |
|
| 7328 |
-
|
| 7329 |
-
|
| 7330 |
-
|
| 7331 |
-
var keyIndex = _keys.indexOf(key);
|
| 7332 |
|
| 7333 |
-
|
| 7334 |
-
|
| 7335 |
-
|
| 7336 |
-
|
| 7337 |
-
|
| 7338 |
-
|
| 7339 |
-
|
| 7340 |
-
|
| 7341 |
-
|
| 7342 |
-
|
| 7343 |
-
|
| 7344 |
-
|
| 7345 |
-
|
| 7346 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7347 |
}
|
| 7348 |
|
| 7349 |
-
|
| 7350 |
-
|
| 7351 |
-
|
| 7352 |
-
|
| 7353 |
-
|
| 7354 |
-
|
| 7355 |
-
|
| 7356 |
-
|
| 7357 |
-
|
| 7358 |
-
|
| 7359 |
-
|
| 7360 |
-
|
| 7361 |
-
|
| 7362 |
-
|
| 7363 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7364 |
}
|
| 7365 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7366 |
}
|
| 7367 |
|
| 7368 |
-
var
|
| 7369 |
-
return current[key];
|
| 7370 |
-
}); // This tries to restore order for deleted items by finding their last known siblings
|
| 7371 |
-
// only using the left sibling to keep order placement consistent for all deleted items
|
| 7372 |
|
| 7373 |
-
|
| 7374 |
-
var left = _ref10.left,
|
| 7375 |
-
right = _ref10.right,
|
| 7376 |
-
item = _objectWithoutPropertiesLoose(_ref10, ["left", "right"]);
|
| 7377 |
|
| 7378 |
-
|
|
|
|
| 7379 |
|
| 7380 |
-
|
| 7381 |
-
|
| 7382 |
-
})) !== -1) pos += 1; // And if nothing else helps, move it to the start ¯\_(ツ)_/¯
|
| 7383 |
|
| 7384 |
-
|
| 7385 |
-
|
| 7386 |
-
|
| 7387 |
-
|
| 7388 |
-
|
| 7389 |
-
|
| 7390 |
-
|
| 7391 |
-
|
| 7392 |
-
|
| 7393 |
-
|
| 7394 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7395 |
}
|
| 7396 |
|
| 7397 |
-
var
|
| 7398 |
-
|
| 7399 |
-
|
| 7400 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7401 |
|
| 7402 |
-
function AnimatedStyle(style) {
|
| 7403 |
-
var _this;
|
| 7404 |
|
| 7405 |
-
if (style === void 0) {
|
| 7406 |
-
style = {};
|
| 7407 |
-
}
|
| 7408 |
|
| 7409 |
-
|
| 7410 |
|
| 7411 |
-
|
| 7412 |
-
|
| 7413 |
-
}
|
| 7414 |
|
| 7415 |
-
|
| 7416 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7417 |
}
|
| 7418 |
|
| 7419 |
-
return
|
| 7420 |
-
}
|
| 7421 |
|
| 7422 |
-
|
| 7423 |
-
var colors = {
|
| 7424 |
-
transparent: 0x00000000,
|
| 7425 |
-
aliceblue: 0xf0f8ffff,
|
| 7426 |
-
antiquewhite: 0xfaebd7ff,
|
| 7427 |
-
aqua: 0x00ffffff,
|
| 7428 |
-
aquamarine: 0x7fffd4ff,
|
| 7429 |
-
azure: 0xf0ffffff,
|
| 7430 |
-
beige: 0xf5f5dcff,
|
| 7431 |
-
bisque: 0xffe4c4ff,
|
| 7432 |
-
black: 0x000000ff,
|
| 7433 |
-
blanchedalmond: 0xffebcdff,
|
| 7434 |
-
blue: 0x0000ffff,
|
| 7435 |
-
blueviolet: 0x8a2be2ff,
|
| 7436 |
-
brown: 0xa52a2aff,
|
| 7437 |
-
burlywood: 0xdeb887ff,
|
| 7438 |
-
burntsienna: 0xea7e5dff,
|
| 7439 |
-
cadetblue: 0x5f9ea0ff,
|
| 7440 |
-
chartreuse: 0x7fff00ff,
|
| 7441 |
-
chocolate: 0xd2691eff,
|
| 7442 |
-
coral: 0xff7f50ff,
|
| 7443 |
-
cornflowerblue: 0x6495edff,
|
| 7444 |
-
cornsilk: 0xfff8dcff,
|
| 7445 |
-
crimson: 0xdc143cff,
|
| 7446 |
-
cyan: 0x00ffffff,
|
| 7447 |
-
darkblue: 0x00008bff,
|
| 7448 |
-
darkcyan: 0x008b8bff,
|
| 7449 |
-
darkgoldenrod: 0xb8860bff,
|
| 7450 |
-
darkgray: 0xa9a9a9ff,
|
| 7451 |
-
darkgreen: 0x006400ff,
|
| 7452 |
-
darkgrey: 0xa9a9a9ff,
|
| 7453 |
-
darkkhaki: 0xbdb76bff,
|
| 7454 |
-
darkmagenta: 0x8b008bff,
|
| 7455 |
-
darkolivegreen: 0x556b2fff,
|
| 7456 |
-
darkorange: 0xff8c00ff,
|
| 7457 |
-
darkorchid: 0x9932ccff,
|
| 7458 |
-
darkred: 0x8b0000ff,
|
| 7459 |
-
darksalmon: 0xe9967aff,
|
| 7460 |
-
darkseagreen: 0x8fbc8fff,
|
| 7461 |
-
darkslateblue: 0x483d8bff,
|
| 7462 |
-
darkslategray: 0x2f4f4fff,
|
| 7463 |
-
darkslategrey: 0x2f4f4fff,
|
| 7464 |
-
darkturquoise: 0x00ced1ff,
|
| 7465 |
-
darkviolet: 0x9400d3ff,
|
| 7466 |
-
deeppink: 0xff1493ff,
|
| 7467 |
-
deepskyblue: 0x00bfffff,
|
| 7468 |
-
dimgray: 0x696969ff,
|
| 7469 |
-
dimgrey: 0x696969ff,
|
| 7470 |
-
dodgerblue: 0x1e90ffff,
|
| 7471 |
-
firebrick: 0xb22222ff,
|
| 7472 |
-
floralwhite: 0xfffaf0ff,
|
| 7473 |
-
forestgreen: 0x228b22ff,
|
| 7474 |
-
fuchsia: 0xff00ffff,
|
| 7475 |
-
gainsboro: 0xdcdcdcff,
|
| 7476 |
-
ghostwhite: 0xf8f8ffff,
|
| 7477 |
-
gold: 0xffd700ff,
|
| 7478 |
-
goldenrod: 0xdaa520ff,
|
| 7479 |
-
gray: 0x808080ff,
|
| 7480 |
-
green: 0x008000ff,
|
| 7481 |
-
greenyellow: 0xadff2fff,
|
| 7482 |
-
grey: 0x808080ff,
|
| 7483 |
-
honeydew: 0xf0fff0ff,
|
| 7484 |
-
hotpink: 0xff69b4ff,
|
| 7485 |
-
indianred: 0xcd5c5cff,
|
| 7486 |
-
indigo: 0x4b0082ff,
|
| 7487 |
-
ivory: 0xfffff0ff,
|
| 7488 |
-
khaki: 0xf0e68cff,
|
| 7489 |
-
lavender: 0xe6e6faff,
|
| 7490 |
-
lavenderblush: 0xfff0f5ff,
|
| 7491 |
-
lawngreen: 0x7cfc00ff,
|
| 7492 |
-
lemonchiffon: 0xfffacdff,
|
| 7493 |
-
lightblue: 0xadd8e6ff,
|
| 7494 |
-
lightcoral: 0xf08080ff,
|
| 7495 |
-
lightcyan: 0xe0ffffff,
|
| 7496 |
-
lightgoldenrodyellow: 0xfafad2ff,
|
| 7497 |
-
lightgray: 0xd3d3d3ff,
|
| 7498 |
-
lightgreen: 0x90ee90ff,
|
| 7499 |
-
lightgrey: 0xd3d3d3ff,
|
| 7500 |
-
lightpink: 0xffb6c1ff,
|
| 7501 |
-
lightsalmon: 0xffa07aff,
|
| 7502 |
-
lightseagreen: 0x20b2aaff,
|
| 7503 |
-
lightskyblue: 0x87cefaff,
|
| 7504 |
-
lightslategray: 0x778899ff,
|
| 7505 |
-
lightslategrey: 0x778899ff,
|
| 7506 |
-
lightsteelblue: 0xb0c4deff,
|
| 7507 |
-
lightyellow: 0xffffe0ff,
|
| 7508 |
-
lime: 0x00ff00ff,
|
| 7509 |
-
limegreen: 0x32cd32ff,
|
| 7510 |
-
linen: 0xfaf0e6ff,
|
| 7511 |
-
magenta: 0xff00ffff,
|
| 7512 |
-
maroon: 0x800000ff,
|
| 7513 |
-
mediumaquamarine: 0x66cdaaff,
|
| 7514 |
-
mediumblue: 0x0000cdff,
|
| 7515 |
-
mediumorchid: 0xba55d3ff,
|
| 7516 |
-
mediumpurple: 0x9370dbff,
|
| 7517 |
-
mediumseagreen: 0x3cb371ff,
|
| 7518 |
-
mediumslateblue: 0x7b68eeff,
|
| 7519 |
-
mediumspringgreen: 0x00fa9aff,
|
| 7520 |
-
mediumturquoise: 0x48d1ccff,
|
| 7521 |
-
mediumvioletred: 0xc71585ff,
|
| 7522 |
-
midnightblue: 0x191970ff,
|
| 7523 |
-
mintcream: 0xf5fffaff,
|
| 7524 |
-
mistyrose: 0xffe4e1ff,
|
| 7525 |
-
moccasin: 0xffe4b5ff,
|
| 7526 |
-
navajowhite: 0xffdeadff,
|
| 7527 |
-
navy: 0x000080ff,
|
| 7528 |
-
oldlace: 0xfdf5e6ff,
|
| 7529 |
-
olive: 0x808000ff,
|
| 7530 |
-
olivedrab: 0x6b8e23ff,
|
| 7531 |
-
orange: 0xffa500ff,
|
| 7532 |
-
orangered: 0xff4500ff,
|
| 7533 |
-
orchid: 0xda70d6ff,
|
| 7534 |
-
palegoldenrod: 0xeee8aaff,
|
| 7535 |
-
palegreen: 0x98fb98ff,
|
| 7536 |
-
paleturquoise: 0xafeeeeff,
|
| 7537 |
-
palevioletred: 0xdb7093ff,
|
| 7538 |
-
papayawhip: 0xffefd5ff,
|
| 7539 |
-
peachpuff: 0xffdab9ff,
|
| 7540 |
-
peru: 0xcd853fff,
|
| 7541 |
-
pink: 0xffc0cbff,
|
| 7542 |
-
plum: 0xdda0ddff,
|
| 7543 |
-
powderblue: 0xb0e0e6ff,
|
| 7544 |
-
purple: 0x800080ff,
|
| 7545 |
-
rebeccapurple: 0x663399ff,
|
| 7546 |
-
red: 0xff0000ff,
|
| 7547 |
-
rosybrown: 0xbc8f8fff,
|
| 7548 |
-
royalblue: 0x4169e1ff,
|
| 7549 |
-
saddlebrown: 0x8b4513ff,
|
| 7550 |
-
salmon: 0xfa8072ff,
|
| 7551 |
-
sandybrown: 0xf4a460ff,
|
| 7552 |
-
seagreen: 0x2e8b57ff,
|
| 7553 |
-
seashell: 0xfff5eeff,
|
| 7554 |
-
sienna: 0xa0522dff,
|
| 7555 |
-
silver: 0xc0c0c0ff,
|
| 7556 |
-
skyblue: 0x87ceebff,
|
| 7557 |
-
slateblue: 0x6a5acdff,
|
| 7558 |
-
slategray: 0x708090ff,
|
| 7559 |
-
slategrey: 0x708090ff,
|
| 7560 |
-
snow: 0xfffafaff,
|
| 7561 |
-
springgreen: 0x00ff7fff,
|
| 7562 |
-
steelblue: 0x4682b4ff,
|
| 7563 |
-
tan: 0xd2b48cff,
|
| 7564 |
-
teal: 0x008080ff,
|
| 7565 |
-
thistle: 0xd8bfd8ff,
|
| 7566 |
-
tomato: 0xff6347ff,
|
| 7567 |
-
turquoise: 0x40e0d0ff,
|
| 7568 |
-
violet: 0xee82eeff,
|
| 7569 |
-
wheat: 0xf5deb3ff,
|
| 7570 |
-
white: 0xffffffff,
|
| 7571 |
-
whitesmoke: 0xf5f5f5ff,
|
| 7572 |
-
yellow: 0xffff00ff,
|
| 7573 |
-
yellowgreen: 0x9acd32ff
|
| 7574 |
-
};
|
| 7575 |
|
| 7576 |
-
|
| 7577 |
-
var NUMBER = '[-+]?\\d*\\.?\\d+';
|
| 7578 |
-
var PERCENTAGE = NUMBER + '%';
|
| 7579 |
|
| 7580 |
-
|
| 7581 |
-
|
| 7582 |
-
parts[_key] = arguments[_key];
|
| 7583 |
-
}
|
| 7584 |
|
| 7585 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7586 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7587 |
|
| 7588 |
-
|
| 7589 |
-
var
|
| 7590 |
-
var hsl = new RegExp('hsl' + call(NUMBER, PERCENTAGE, PERCENTAGE));
|
| 7591 |
-
var hsla = new RegExp('hsla' + call(NUMBER, PERCENTAGE, PERCENTAGE, NUMBER));
|
| 7592 |
-
var hex3 = /^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/;
|
| 7593 |
-
var hex4 = /^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/;
|
| 7594 |
-
var hex6 = /^#([0-9a-fA-F]{6})$/;
|
| 7595 |
-
var hex8 = /^#([0-9a-fA-F]{8})$/;
|
| 7596 |
|
| 7597 |
-
|
| 7598 |
-
|
| 7599 |
|
| 7600 |
-
|
|
|
|
|
|
|
|
|
|
| 7601 |
|
| 7602 |
-
Copyright (c) 2016, React Community
|
| 7603 |
-
All rights reserved.
|
| 7604 |
|
| 7605 |
-
Redistribution and use in source and binary forms, with or without
|
| 7606 |
-
modification, are permitted provided that the following conditions are met:
|
| 7607 |
|
| 7608 |
-
* Redistributions of source code must retain the above copyright notice, this
|
| 7609 |
-
list of conditions and the following disclaimer.
|
| 7610 |
|
| 7611 |
-
|
| 7612 |
-
this list of conditions and the following disclaimer in the documentation
|
| 7613 |
-
and/or other materials provided with the distribution.
|
| 7614 |
|
| 7615 |
-
|
| 7616 |
-
|
| 7617 |
-
this software without specific prior written permission.
|
| 7618 |
|
| 7619 |
-
|
| 7620 |
-
|
| 7621 |
-
|
| 7622 |
-
|
| 7623 |
-
|
| 7624 |
-
|
| 7625 |
-
|
| 7626 |
-
|
| 7627 |
-
|
| 7628 |
-
|
| 7629 |
-
|
| 7630 |
-
|
| 7631 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7632 |
|
| 7633 |
-
|
| 7634 |
-
|
| 7635 |
-
|
| 7636 |
|
|
|
|
|
|
|
| 7637 |
|
| 7638 |
-
|
| 7639 |
-
|
| 7640 |
|
| 7641 |
-
|
| 7642 |
-
|
| 7643 |
-
parse255(match[2]) << 16 | // g
|
| 7644 |
-
parse255(match[3]) << 8 | // b
|
| 7645 |
-
0x000000ff) >>> // a
|
| 7646 |
-
0;
|
| 7647 |
-
}
|
| 7648 |
|
| 7649 |
-
|
| 7650 |
-
|
| 7651 |
-
parse255(match[2]) << 16 | // g
|
| 7652 |
-
parse255(match[3]) << 8 | // b
|
| 7653 |
-
parse1(match[4])) >>> // a
|
| 7654 |
-
0;
|
| 7655 |
-
}
|
| 7656 |
|
| 7657 |
-
|
| 7658 |
-
|
| 7659 |
-
match[2] + match[2] + // g
|
| 7660 |
-
match[3] + match[3] + // b
|
| 7661 |
-
'ff', // a
|
| 7662 |
-
16) >>> 0;
|
| 7663 |
-
} // https://drafts.csswg.org/css-color-4/#hex-notation
|
| 7664 |
|
|
|
|
|
|
|
| 7665 |
|
| 7666 |
-
|
|
|
|
| 7667 |
|
| 7668 |
-
|
| 7669 |
-
|
| 7670 |
-
match[2] + match[2] + // g
|
| 7671 |
-
match[3] + match[3] + // b
|
| 7672 |
-
match[4] + match[4], // a
|
| 7673 |
-
16) >>> 0;
|
| 7674 |
-
}
|
| 7675 |
|
| 7676 |
-
|
| 7677 |
-
|
| 7678 |
-
parsePercentage(match[2]), // s
|
| 7679 |
-
parsePercentage(match[3]) // l
|
| 7680 |
-
) | 0x000000ff) >>> // a
|
| 7681 |
-
0;
|
| 7682 |
-
}
|
| 7683 |
|
| 7684 |
-
|
| 7685 |
-
|
| 7686 |
-
parsePercentage(match[2]), // s
|
| 7687 |
-
parsePercentage(match[3]) // l
|
| 7688 |
-
) | parse1(match[4])) >>> // a
|
| 7689 |
-
0;
|
| 7690 |
-
}
|
| 7691 |
|
| 7692 |
-
|
| 7693 |
-
|
| 7694 |
|
| 7695 |
-
|
| 7696 |
-
|
| 7697 |
-
if (t > 1) t -= 1;
|
| 7698 |
-
if (t < 1 / 6) return p + (q - p) * 6 * t;
|
| 7699 |
-
if (t < 1 / 2) return q;
|
| 7700 |
-
if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6;
|
| 7701 |
-
return p;
|
| 7702 |
-
}
|
| 7703 |
|
| 7704 |
-
|
| 7705 |
-
|
| 7706 |
-
var p = 2 * l - q;
|
| 7707 |
-
var r = hue2rgb(p, q, h + 1 / 3);
|
| 7708 |
-
var g = hue2rgb(p, q, h);
|
| 7709 |
-
var b = hue2rgb(p, q, h - 1 / 3);
|
| 7710 |
-
return Math.round(r * 255) << 24 | Math.round(g * 255) << 16 | Math.round(b * 255) << 8;
|
| 7711 |
-
}
|
| 7712 |
|
| 7713 |
-
|
| 7714 |
-
|
| 7715 |
-
|
| 7716 |
-
if (int > 255) return 255;
|
| 7717 |
-
return int;
|
| 7718 |
-
}
|
| 7719 |
|
| 7720 |
-
|
| 7721 |
-
|
| 7722 |
-
return (int % 360 + 360) % 360 / 360;
|
| 7723 |
-
}
|
| 7724 |
|
| 7725 |
-
|
| 7726 |
-
var num = parseFloat(str);
|
| 7727 |
-
if (num < 0) return 0;
|
| 7728 |
-
if (num > 1) return 255;
|
| 7729 |
-
return Math.round(num * 255);
|
| 7730 |
-
}
|
| 7731 |
|
| 7732 |
-
function parsePercentage(str) {
|
| 7733 |
-
// parseFloat conveniently ignores the final %
|
| 7734 |
-
var int = parseFloat(str);
|
| 7735 |
-
if (int < 0) return 0;
|
| 7736 |
-
if (int > 100) return 1;
|
| 7737 |
-
return int / 100;
|
| 7738 |
-
}
|
| 7739 |
|
| 7740 |
-
function colorToRgba(input) {
|
| 7741 |
-
var int32Color = normalizeColor(input);
|
| 7742 |
-
if (int32Color === null) return input;
|
| 7743 |
-
int32Color = int32Color || 0;
|
| 7744 |
-
var r = (int32Color & 0xff000000) >>> 24;
|
| 7745 |
-
var g = (int32Color & 0x00ff0000) >>> 16;
|
| 7746 |
-
var b = (int32Color & 0x0000ff00) >>> 8;
|
| 7747 |
-
var a = (int32Color & 0x000000ff) / 255;
|
| 7748 |
-
return "rgba(" + r + ", " + g + ", " + b + ", " + a + ")";
|
| 7749 |
-
} // Problem: https://github.com/animatedjs/animated/pull/102
|
| 7750 |
-
// Solution: https://stackoverflow.com/questions/638565/parsing-scientific-notation-sensibly/658662
|
| 7751 |
|
| 7752 |
|
| 7753 |
-
var stringShapeRegex = /[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g; // Covers rgb, rgba, hsl, hsla
|
| 7754 |
-
// Taken from https://gist.github.com/olmokramer/82ccce673f86db7cda5e
|
| 7755 |
|
| 7756 |
-
var colorRegex = /(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi; // Covers color names (transparent, blue, etc.)
|
| 7757 |
|
| 7758 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7759 |
/**
|
| 7760 |
-
*
|
| 7761 |
-
* and recombines those values into new strings of the same shape. Supports
|
| 7762 |
-
* things like:
|
| 7763 |
-
*
|
| 7764 |
-
* rgba(123, 42, 99, 0.36) // colors
|
| 7765 |
-
* -45deg // values with units
|
| 7766 |
-
* 0 2px 2px 0px rgba(0, 0, 0, 0.12) // box shadows
|
| 7767 |
*/
|
| 7768 |
|
| 7769 |
-
|
| 7770 |
-
|
| 7771 |
-
|
| 7772 |
-
|
| 7773 |
-
|
| 7774 |
-
|
| 7775 |
-
|
| 7776 |
-
|
| 7777 |
-
|
| 7778 |
-
|
| 7779 |
-
|
| 7780 |
-
|
| 7781 |
-
|
| 7782 |
-
|
| 7783 |
-
|
| 7784 |
-
|
| 7785 |
-
|
| 7786 |
-
|
| 7787 |
-
|
| 7788 |
-
|
| 7789 |
-
|
| 7790 |
-
|
| 7791 |
-
|
| 7792 |
-
|
| 7793 |
-
|
| 7794 |
-
.replace(stringShapeRegex, function () {
|
| 7795 |
-
return interpolations[i++](input);
|
| 7796 |
-
}) // rgba requires that the r,g,b are integers.... so we want to round them, but we *dont* want to
|
| 7797 |
-
// round the opacity (4th column).
|
| 7798 |
-
.replace(/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi, function (_, p1, p2, p3, p4) {
|
| 7799 |
-
return "rgba(" + Math.round(p1) + ", " + Math.round(p2) + ", " + Math.round(p3) + ", " + p4 + ")";
|
| 7800 |
});
|
| 7801 |
-
};
|
| 7802 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7803 |
|
| 7804 |
-
var isUnitlessNumber = {
|
| 7805 |
-
animationIterationCount: true,
|
| 7806 |
-
borderImageOutset: true,
|
| 7807 |
-
borderImageSlice: true,
|
| 7808 |
-
borderImageWidth: true,
|
| 7809 |
-
boxFlex: true,
|
| 7810 |
-
boxFlexGroup: true,
|
| 7811 |
-
boxOrdinalGroup: true,
|
| 7812 |
-
columnCount: true,
|
| 7813 |
-
columns: true,
|
| 7814 |
-
flex: true,
|
| 7815 |
-
flexGrow: true,
|
| 7816 |
-
flexPositive: true,
|
| 7817 |
-
flexShrink: true,
|
| 7818 |
-
flexNegative: true,
|
| 7819 |
-
flexOrder: true,
|
| 7820 |
-
gridRow: true,
|
| 7821 |
-
gridRowEnd: true,
|
| 7822 |
-
gridRowSpan: true,
|
| 7823 |
-
gridRowStart: true,
|
| 7824 |
-
gridColumn: true,
|
| 7825 |
-
gridColumnEnd: true,
|
| 7826 |
-
gridColumnSpan: true,
|
| 7827 |
-
gridColumnStart: true,
|
| 7828 |
-
fontWeight: true,
|
| 7829 |
-
lineClamp: true,
|
| 7830 |
-
lineHeight: true,
|
| 7831 |
-
opacity: true,
|
| 7832 |
-
order: true,
|
| 7833 |
-
orphans: true,
|
| 7834 |
-
tabSize: true,
|
| 7835 |
-
widows: true,
|
| 7836 |
-
zIndex: true,
|
| 7837 |
-
zoom: true,
|
| 7838 |
-
// SVG-related properties
|
| 7839 |
-
fillOpacity: true,
|
| 7840 |
-
floodOpacity: true,
|
| 7841 |
-
stopOpacity: true,
|
| 7842 |
-
strokeDasharray: true,
|
| 7843 |
-
strokeDashoffset: true,
|
| 7844 |
-
strokeMiterlimit: true,
|
| 7845 |
-
strokeOpacity: true,
|
| 7846 |
-
strokeWidth: true
|
| 7847 |
-
};
|
| 7848 |
|
| 7849 |
-
|
| 7850 |
-
|
| 7851 |
-
}
|
| 7852 |
|
| 7853 |
-
|
| 7854 |
-
|
| 7855 |
-
|
| 7856 |
-
|
| 7857 |
-
|
| 7858 |
-
return acc;
|
| 7859 |
-
}, isUnitlessNumber);
|
| 7860 |
|
| 7861 |
-
|
| 7862 |
-
|
| 7863 |
-
|
| 7864 |
|
| 7865 |
-
|
| 7866 |
-
|
|
|
|
| 7867 |
|
| 7868 |
-
|
| 7869 |
-
|
| 7870 |
-
|
| 7871 |
-
|
| 7872 |
-
|
| 7873 |
-
|
| 7874 |
-
|
| 7875 |
-
|
| 7876 |
-
|
| 7877 |
-
|
| 7878 |
-
|
| 7879 |
-
|
| 7880 |
-
|
| 7881 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7882 |
|
| 7883 |
-
|
| 7884 |
-
|
| 7885 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7886 |
|
| 7887 |
-
if (children !== void 0) instance.textContent = children; // Set styles ...
|
| 7888 |
|
| 7889 |
-
for (var styleName in style) {
|
| 7890 |
-
if (!style.hasOwnProperty(styleName)) continue;
|
| 7891 |
-
var isCustomProperty = styleName.indexOf('--') === 0;
|
| 7892 |
-
var styleValue = dangerousStyleValue(styleName, style[styleName], isCustomProperty);
|
| 7893 |
-
if (styleName === 'float') styleName = 'cssFloat';
|
| 7894 |
-
if (isCustomProperty) instance.style.setProperty(styleName, styleValue);else instance.style[styleName] = styleValue;
|
| 7895 |
-
} // Set attributes ...
|
| 7896 |
|
| 7897 |
|
| 7898 |
-
for (var name in attributes) {
|
| 7899 |
-
// Attributes are written in dash case
|
| 7900 |
-
var dashCase = filter ? name : attributeCache[name] || (attributeCache[name] = name.replace(/([A-Z])/g, function (n) {
|
| 7901 |
-
return '-' + n.toLowerCase();
|
| 7902 |
-
}));
|
| 7903 |
-
if (typeof instance.getAttribute(dashCase) !== 'undefined') instance.setAttribute(dashCase, attributes[name]);
|
| 7904 |
-
}
|
| 7905 |
|
| 7906 |
-
return;
|
| 7907 |
-
} else return false;
|
| 7908 |
-
}, function (style) {
|
| 7909 |
-
return style;
|
| 7910 |
-
});
|
| 7911 |
|
| 7912 |
-
var domElements = ['a', 'abbr', 'address', 'area', 'article', 'aside', 'audio', 'b', 'base', 'bdi', 'bdo', 'big', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'cite', 'code', 'col', 'colgroup', 'data', 'datalist', 'dd', 'del', 'details', 'dfn', 'dialog', 'div', 'dl', 'dt', 'em', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'iframe', 'img', 'input', 'ins', 'kbd', 'keygen', 'label', 'legend', 'li', 'link', 'main', 'map', 'mark', 'menu', 'menuitem', 'meta', 'meter', 'nav', 'noscript', 'object', 'ol', 'optgroup', 'option', 'output', 'p', 'param', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'script', 'section', 'select', 'small', 'source', 'span', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'textarea', 'tfoot', 'th', 'thead', 'time', 'title', 'tr', 'track', 'u', 'ul', 'var', 'video', 'wbr', // SVG
|
| 7913 |
-
'circle', 'clipPath', 'defs', 'ellipse', 'foreignObject', 'g', 'image', 'line', 'linearGradient', 'mask', 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'stop', 'svg', 'text', 'tspan'];
|
| 7914 |
-
// Extend animated with all the available THREE elements
|
| 7915 |
-
var apply = merge(createAnimatedComponent, false);
|
| 7916 |
-
var extendedAnimated = apply(domElements);
|
| 7917 |
|
| 7918 |
-
exports.apply = apply;
|
| 7919 |
-
exports.config = config;
|
| 7920 |
-
exports.update = update;
|
| 7921 |
-
exports.animated = extendedAnimated;
|
| 7922 |
-
exports.a = extendedAnimated;
|
| 7923 |
-
exports.interpolate = interpolate$1;
|
| 7924 |
-
exports.Globals = Globals;
|
| 7925 |
-
exports.useSpring = useSpring;
|
| 7926 |
-
exports.useTrail = useTrail;
|
| 7927 |
-
exports.useTransition = useTransition;
|
| 7928 |
-
exports.useChain = useChain;
|
| 7929 |
-
exports.useSprings = useSprings;
|
| 7930 |
|
| 7931 |
|
| 7932 |
-
/***/ }),
|
| 7933 |
|
| 7934 |
-
|
| 7935 |
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
| 7936 |
|
| 7937 |
-
"
|
| 7938 |
-
/* WEBPACK VAR INJECTION */(function(global) {/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(10);
|
| 7939 |
-
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
| 7940 |
-
/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(38);
|
| 7941 |
-
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1);
|
| 7942 |
-
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_2__);
|
| 7943 |
|
|
|
|
|
|
|
|
|
|
| 7944 |
|
|
|
|
|
|
|
|
|
|
| 7945 |
|
| 7946 |
|
|
|
|
|
|
|
|
|
|
| 7947 |
|
| 7948 |
-
var MAX_SIGNED_31_BIT_INT = 1073741823;
|
| 7949 |
-
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : {};
|
| 7950 |
|
| 7951 |
-
|
| 7952 |
-
|
| 7953 |
-
|
| 7954 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7955 |
|
| 7956 |
-
function
|
| 7957 |
-
|
| 7958 |
-
|
| 7959 |
-
|
| 7960 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7961 |
}
|
| 7962 |
-
}
|
| 7963 |
|
| 7964 |
-
|
| 7965 |
-
|
| 7966 |
-
|
| 7967 |
-
|
| 7968 |
-
|
| 7969 |
-
|
| 7970 |
-
|
| 7971 |
-
|
| 7972 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7973 |
});
|
| 7974 |
-
}
|
| 7975 |
-
|
| 7976 |
-
|
| 7977 |
-
|
| 7978 |
-
|
| 7979 |
-
|
| 7980 |
-
|
| 7981 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7982 |
});
|
| 7983 |
}
|
| 7984 |
-
}
|
| 7985 |
-
|
|
|
|
|
|
|
| 7986 |
|
| 7987 |
-
|
| 7988 |
-
|
| 7989 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7990 |
|
| 7991 |
-
|
| 7992 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7993 |
|
| 7994 |
-
var contextProp = '__create-react-context-' + getUniqueId() + '__';
|
| 7995 |
|
| 7996 |
-
|
| 7997 |
-
|
|
|
|
|
|
|
| 7998 |
|
| 7999 |
-
|
| 8000 |
-
|
|
|
|
|
|
|
| 8001 |
|
| 8002 |
-
|
| 8003 |
-
|
| 8004 |
-
|
| 8005 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8006 |
|
| 8007 |
-
|
| 8008 |
|
| 8009 |
-
|
| 8010 |
-
var _ref;
|
| 8011 |
|
| 8012 |
-
|
| 8013 |
-
|
| 8014 |
|
| 8015 |
-
|
| 8016 |
-
if (this.props.value !== nextProps.value) {
|
| 8017 |
-
var oldValue = this.props.value;
|
| 8018 |
-
var newValue = nextProps.value;
|
| 8019 |
-
var changedBits;
|
| 8020 |
|
| 8021 |
-
if (objectIs(oldValue, newValue)) {
|
| 8022 |
-
changedBits = 0;
|
| 8023 |
-
} else {
|
| 8024 |
-
changedBits = typeof calculateChangedBits === 'function' ? calculateChangedBits(oldValue, newValue) : MAX_SIGNED_31_BIT_INT;
|
| 8025 |
|
| 8026 |
-
|
| 8027 |
|
| 8028 |
-
|
| 8029 |
|
| 8030 |
-
|
| 8031 |
-
this.emitter.set(nextProps.value, changedBits);
|
| 8032 |
-
}
|
| 8033 |
-
}
|
| 8034 |
-
}
|
| 8035 |
-
};
|
| 8036 |
|
| 8037 |
-
|
| 8038 |
-
return this.props.children;
|
| 8039 |
-
};
|
| 8040 |
|
| 8041 |
-
|
| 8042 |
-
}(react__WEBPACK_IMPORTED_MODULE_0__["Component"]);
|
| 8043 |
|
| 8044 |
-
|
| 8045 |
|
| 8046 |
-
|
| 8047 |
-
|
|
|
|
| 8048 |
|
| 8049 |
-
|
| 8050 |
-
|
| 8051 |
|
| 8052 |
-
|
| 8053 |
-
|
| 8054 |
-
value: _this2.getValue()
|
| 8055 |
-
};
|
| 8056 |
|
| 8057 |
-
|
| 8058 |
-
|
| 8059 |
|
| 8060 |
-
|
| 8061 |
-
_this2.setState({
|
| 8062 |
-
value: _this2.getValue()
|
| 8063 |
-
});
|
| 8064 |
-
}
|
| 8065 |
-
};
|
| 8066 |
|
| 8067 |
-
|
|
|
|
| 8068 |
}
|
| 8069 |
|
| 8070 |
-
|
| 8071 |
-
|
| 8072 |
-
|
| 8073 |
-
|
| 8074 |
-
|
| 8075 |
-
}
|
| 8076 |
-
|
| 8077 |
-
|
| 8078 |
-
|
| 8079 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8080 |
}
|
|
|
|
| 8081 |
|
| 8082 |
-
|
| 8083 |
-
|
| 8084 |
-
};
|
| 8085 |
|
| 8086 |
-
|
| 8087 |
-
if (this.context[contextProp]) {
|
| 8088 |
-
this.context[contextProp].off(this.onUpdate);
|
| 8089 |
-
}
|
| 8090 |
-
};
|
| 8091 |
|
| 8092 |
-
|
| 8093 |
-
|
| 8094 |
-
return this.context[contextProp].get();
|
| 8095 |
-
} else {
|
| 8096 |
-
return defaultValue;
|
| 8097 |
-
}
|
| 8098 |
-
};
|
| 8099 |
|
| 8100 |
-
|
| 8101 |
-
return onlyChild(this.props.children)(this.state.value);
|
| 8102 |
-
};
|
| 8103 |
|
| 8104 |
-
|
| 8105 |
-
|
| 8106 |
|
| 8107 |
-
|
| 8108 |
-
|
| 8109 |
-
Provider: Provider,
|
| 8110 |
-
Consumer: Consumer
|
| 8111 |
-
};
|
| 8112 |
-
}
|
| 8113 |
|
| 8114 |
-
var index = react__WEBPACK_IMPORTED_MODULE_0___default.a.createContext || createReactContext;
|
| 8115 |
|
| 8116 |
-
|
|
|
|
|
|
|
|
|
|
| 8117 |
|
| 8118 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8119 |
|
| 8120 |
-
/***/ }),
|
| 8121 |
|
| 8122 |
-
/***/ 184:
|
| 8123 |
-
/***/ (function(module, exports, __webpack_require__) {
|
| 8124 |
|
| 8125 |
-
var isarray = __webpack_require__(308)
|
| 8126 |
|
| 8127 |
/**
|
| 8128 |
-
*
|
| 8129 |
*/
|
| 8130 |
-
module.exports = pathToRegexp
|
| 8131 |
-
module.exports.parse = parse
|
| 8132 |
-
module.exports.compile = compile
|
| 8133 |
-
module.exports.tokensToFunction = tokensToFunction
|
| 8134 |
-
module.exports.tokensToRegExp = tokensToRegExp
|
| 8135 |
|
| 8136 |
/**
|
| 8137 |
-
*
|
| 8138 |
-
*
|
| 8139 |
-
* @type {RegExp}
|
| 8140 |
*/
|
| 8141 |
-
|
| 8142 |
-
// Match escaped characters that would otherwise appear in future matches.
|
| 8143 |
-
// This allows the user to escape special characters that won't transform.
|
| 8144 |
-
'(\\\\.)',
|
| 8145 |
-
// Match Express-style parameters and un-named parameters with a prefix
|
| 8146 |
-
// and optional suffixes. Matches appear as:
|
| 8147 |
-
//
|
| 8148 |
-
// "/:test(\\d+)?" => ["/", "test", "\d+", undefined, "?", undefined]
|
| 8149 |
-
// "/route(\\d+)" => [undefined, undefined, undefined, "\d+", undefined, undefined]
|
| 8150 |
-
// "/*" => ["/", undefined, undefined, undefined, undefined, "*"]
|
| 8151 |
-
'([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))'
|
| 8152 |
-
].join('|'), 'g')
|
| 8153 |
|
| 8154 |
/**
|
| 8155 |
-
*
|
| 8156 |
-
*
|
| 8157 |
-
* @param {string} str
|
| 8158 |
-
* @param {Object=} options
|
| 8159 |
-
* @return {!Array}
|
| 8160 |
*/
|
| 8161 |
-
function parse (str, options) {
|
| 8162 |
-
var tokens = []
|
| 8163 |
-
var key = 0
|
| 8164 |
-
var index = 0
|
| 8165 |
-
var path = ''
|
| 8166 |
-
var defaultDelimiter = options && options.delimiter || '/'
|
| 8167 |
-
var res
|
| 8168 |
|
| 8169 |
-
while ((res = PATH_REGEXP.exec(str)) != null) {
|
| 8170 |
-
var m = res[0]
|
| 8171 |
-
var escaped = res[1]
|
| 8172 |
-
var offset = res.index
|
| 8173 |
-
path += str.slice(index, offset)
|
| 8174 |
-
index = offset + m.length
|
| 8175 |
|
| 8176 |
-
// Ignore already escaped sequences.
|
| 8177 |
-
if (escaped) {
|
| 8178 |
-
path += escaped[1]
|
| 8179 |
-
continue
|
| 8180 |
-
}
|
| 8181 |
|
| 8182 |
-
|
| 8183 |
-
|
| 8184 |
-
|
| 8185 |
-
|
| 8186 |
-
|
| 8187 |
-
var modifier = res[6]
|
| 8188 |
-
var asterisk = res[7]
|
| 8189 |
|
| 8190 |
-
|
| 8191 |
-
|
| 8192 |
-
|
| 8193 |
-
|
|
|
|
| 8194 |
}
|
|
|
|
|
|
|
| 8195 |
|
| 8196 |
-
|
| 8197 |
-
|
| 8198 |
-
|
| 8199 |
-
|
| 8200 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8201 |
|
| 8202 |
-
|
| 8203 |
-
|
| 8204 |
-
|
| 8205 |
-
|
| 8206 |
-
|
| 8207 |
-
|
| 8208 |
-
|
| 8209 |
-
|
| 8210 |
-
|
| 8211 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8212 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8213 |
|
| 8214 |
-
|
| 8215 |
-
|
| 8216 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8217 |
}
|
| 8218 |
|
| 8219 |
-
|
| 8220 |
-
|
| 8221 |
-
|
|
|
|
|
|
|
|
|
|
| 8222 |
}
|
| 8223 |
|
| 8224 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8225 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8226 |
|
| 8227 |
-
/**
|
| 8228 |
-
* Compile a string to a template function for the path.
|
| 8229 |
-
*
|
| 8230 |
-
* @param {string} str
|
| 8231 |
-
* @param {Object=} options
|
| 8232 |
-
* @return {!function(Object=, Object=)}
|
| 8233 |
-
*/
|
| 8234 |
-
function compile (str, options) {
|
| 8235 |
-
return tokensToFunction(parse(str, options), options)
|
| 8236 |
-
}
|
| 8237 |
|
| 8238 |
/**
|
| 8239 |
-
*
|
| 8240 |
-
*
|
| 8241 |
-
* @param {string}
|
| 8242 |
-
* @return {string}
|
| 8243 |
*/
|
| 8244 |
-
|
| 8245 |
-
return encodeURI(str).replace(/[\/?#]/g, function (c) {
|
| 8246 |
-
return '%' + c.charCodeAt(0).toString(16).toUpperCase()
|
| 8247 |
-
})
|
| 8248 |
-
}
|
| 8249 |
|
| 8250 |
/**
|
| 8251 |
-
*
|
| 8252 |
-
*
|
| 8253 |
-
* @param {string}
|
| 8254 |
-
* @return {string}
|
| 8255 |
*/
|
| 8256 |
-
|
| 8257 |
-
|
| 8258 |
-
|
| 8259 |
-
|
| 8260 |
-
}
|
| 8261 |
|
| 8262 |
/**
|
| 8263 |
-
*
|
| 8264 |
*/
|
| 8265 |
-
function tokensToFunction (tokens, options) {
|
| 8266 |
-
// Compile all the tokens into regexps.
|
| 8267 |
-
var matches = new Array(tokens.length)
|
| 8268 |
|
| 8269 |
-
// Compile all the patterns before compilation.
|
| 8270 |
-
for (var i = 0; i < tokens.length; i++) {
|
| 8271 |
-
if (typeof tokens[i] === 'object') {
|
| 8272 |
-
matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$', flags(options))
|
| 8273 |
-
}
|
| 8274 |
-
}
|
| 8275 |
|
| 8276 |
-
|
| 8277 |
-
|
| 8278 |
-
var data = obj || {}
|
| 8279 |
-
var options = opts || {}
|
| 8280 |
-
var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent
|
| 8281 |
|
| 8282 |
-
|
| 8283 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8284 |
|
| 8285 |
-
|
| 8286 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8287 |
|
| 8288 |
-
|
| 8289 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8290 |
|
| 8291 |
-
|
| 8292 |
-
|
|
|
|
| 8293 |
|
| 8294 |
-
|
| 8295 |
-
|
| 8296 |
-
// Prepend partial segment prefixes.
|
| 8297 |
-
if (token.partial) {
|
| 8298 |
-
path += token.prefix
|
| 8299 |
-
}
|
| 8300 |
|
| 8301 |
-
|
| 8302 |
-
|
| 8303 |
-
|
| 8304 |
-
|
| 8305 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8306 |
|
| 8307 |
-
|
| 8308 |
-
|
| 8309 |
-
throw new TypeError('Expected "' + token.name + '" to not repeat, but received `' + JSON.stringify(value) + '`')
|
| 8310 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8311 |
|
| 8312 |
-
|
| 8313 |
-
|
| 8314 |
-
|
| 8315 |
-
} else {
|
| 8316 |
-
throw new TypeError('Expected "' + token.name + '" to not be empty')
|
| 8317 |
-
}
|
| 8318 |
-
}
|
| 8319 |
|
| 8320 |
-
|
| 8321 |
-
segment = encode(value[j])
|
| 8322 |
|
| 8323 |
-
|
| 8324 |
-
|
| 8325 |
-
}
|
| 8326 |
|
| 8327 |
-
|
| 8328 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8329 |
|
| 8330 |
-
continue
|
| 8331 |
-
}
|
| 8332 |
|
| 8333 |
-
segment = token.asterisk ? encodeAsterisk(value) : encode(value)
|
| 8334 |
|
| 8335 |
-
if (!matches[i].test(segment)) {
|
| 8336 |
-
throw new TypeError('Expected "' + token.name + '" to match "' + token.pattern + '", but received "' + segment + '"')
|
| 8337 |
-
}
|
| 8338 |
|
| 8339 |
-
path += token.prefix + segment
|
| 8340 |
-
}
|
| 8341 |
|
| 8342 |
-
|
| 8343 |
-
|
| 8344 |
-
}
|
| 8345 |
|
| 8346 |
-
|
| 8347 |
-
|
| 8348 |
-
|
| 8349 |
-
* @param {string} str
|
| 8350 |
-
* @return {string}
|
| 8351 |
-
*/
|
| 8352 |
-
function escapeString (str) {
|
| 8353 |
-
return str.replace(/([.+*?=^!:${}()[\]|\/\\])/g, '\\$1')
|
| 8354 |
}
|
| 8355 |
|
| 8356 |
-
|
| 8357 |
-
|
| 8358 |
-
|
| 8359 |
-
|
| 8360 |
-
|
| 8361 |
-
|
| 8362 |
-
function escapeGroup (group) {
|
| 8363 |
-
return group.replace(/([=!:$\/()])/g, '\\$1')
|
| 8364 |
}
|
| 8365 |
|
| 8366 |
-
|
| 8367 |
-
|
| 8368 |
-
|
| 8369 |
-
|
| 8370 |
-
|
| 8371 |
-
|
| 8372 |
-
|
| 8373 |
-
|
| 8374 |
-
|
| 8375 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8376 |
}
|
| 8377 |
|
| 8378 |
-
|
| 8379 |
-
|
| 8380 |
-
*
|
| 8381 |
-
* @param {Object} options
|
| 8382 |
-
* @return {string}
|
| 8383 |
-
*/
|
| 8384 |
-
function flags (options) {
|
| 8385 |
-
return options && options.sensitive ? '' : 'i'
|
| 8386 |
}
|
| 8387 |
|
| 8388 |
-
|
| 8389 |
-
|
| 8390 |
-
*
|
| 8391 |
-
* @param {!RegExp} path
|
| 8392 |
-
* @param {!Array} keys
|
| 8393 |
-
* @return {!RegExp}
|
| 8394 |
-
*/
|
| 8395 |
-
function regexpToRegexp (path, keys) {
|
| 8396 |
-
// Use a negative lookahead to match only capturing groups.
|
| 8397 |
-
var groups = path.source.match(/\((?!\?)/g)
|
| 8398 |
|
| 8399 |
-
|
| 8400 |
-
|
| 8401 |
-
|
| 8402 |
-
|
| 8403 |
-
|
| 8404 |
-
|
| 8405 |
-
|
| 8406 |
-
|
| 8407 |
-
|
| 8408 |
-
|
| 8409 |
-
|
| 8410 |
-
})
|
| 8411 |
}
|
| 8412 |
-
}
|
| 8413 |
|
| 8414 |
-
|
| 8415 |
-
}
|
| 8416 |
|
| 8417 |
-
|
| 8418 |
-
|
| 8419 |
-
*
|
| 8420 |
-
* @param {!Array} path
|
| 8421 |
-
* @param {Array} keys
|
| 8422 |
-
* @param {!Object} options
|
| 8423 |
-
* @return {!RegExp}
|
| 8424 |
-
*/
|
| 8425 |
-
function arrayToRegexp (path, keys, options) {
|
| 8426 |
-
var parts = []
|
| 8427 |
|
| 8428 |
-
|
| 8429 |
-
|
| 8430 |
-
}
|
| 8431 |
|
| 8432 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8433 |
|
| 8434 |
-
|
| 8435 |
-
|
|
|
|
|
|
|
| 8436 |
|
| 8437 |
-
|
| 8438 |
-
* Create a path regexp from string input.
|
| 8439 |
-
*
|
| 8440 |
-
* @param {string} path
|
| 8441 |
-
* @param {!Array} keys
|
| 8442 |
-
* @param {!Object} options
|
| 8443 |
-
* @return {!RegExp}
|
| 8444 |
-
*/
|
| 8445 |
-
function stringToRegexp (path, keys, options) {
|
| 8446 |
-
return tokensToRegExp(parse(path, options), keys, options)
|
| 8447 |
-
}
|
| 8448 |
|
| 8449 |
-
|
| 8450 |
-
* Expose a function for taking tokens and returning a RegExp.
|
| 8451 |
-
*
|
| 8452 |
-
* @param {!Array} tokens
|
| 8453 |
-
* @param {(Array|Object)=} keys
|
| 8454 |
-
* @param {Object=} options
|
| 8455 |
-
* @return {!RegExp}
|
| 8456 |
-
*/
|
| 8457 |
-
function tokensToRegExp (tokens, keys, options) {
|
| 8458 |
-
if (!isarray(keys)) {
|
| 8459 |
-
options = /** @type {!Object} */ (keys || options)
|
| 8460 |
-
keys = []
|
| 8461 |
-
}
|
| 8462 |
|
| 8463 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8464 |
|
| 8465 |
-
|
| 8466 |
-
|
| 8467 |
-
|
| 8468 |
|
| 8469 |
-
|
| 8470 |
-
|
| 8471 |
-
var token = tokens[i]
|
| 8472 |
|
| 8473 |
-
|
| 8474 |
-
route += escapeString(token)
|
| 8475 |
-
} else {
|
| 8476 |
-
var prefix = escapeString(token.prefix)
|
| 8477 |
-
var capture = '(?:' + token.pattern + ')'
|
| 8478 |
|
| 8479 |
-
|
|
|
|
| 8480 |
|
| 8481 |
-
|
| 8482 |
-
|
| 8483 |
-
}
|
| 8484 |
|
| 8485 |
-
|
| 8486 |
-
|
| 8487 |
-
|
| 8488 |
-
|
| 8489 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8490 |
}
|
| 8491 |
-
}
|
| 8492 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8493 |
}
|
| 8494 |
|
| 8495 |
-
|
| 8496 |
-
|
| 8497 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8498 |
|
| 8499 |
-
|
| 8500 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8501 |
|
| 8502 |
-
|
| 8503 |
-
|
| 8504 |
-
|
| 8505 |
-
// in non-ending mode, where "/test/" shouldn't match "/test//route".
|
| 8506 |
-
if (!strict) {
|
| 8507 |
-
route = (endsWithDelimiter ? route.slice(0, -delimiter.length) : route) + '(?:' + delimiter + '(?=$))?'
|
| 8508 |
-
}
|
| 8509 |
|
| 8510 |
-
|
| 8511 |
-
|
| 8512 |
-
} else {
|
| 8513 |
-
// In non-ending mode, we need the capturing groups to match as much as
|
| 8514 |
-
// possible by using a positive lookahead to the end or next path segment.
|
| 8515 |
-
route += strict && endsWithDelimiter ? '' : '(?=' + delimiter + '|$)'
|
| 8516 |
-
}
|
| 8517 |
|
| 8518 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8519 |
}
|
| 8520 |
|
| 8521 |
-
|
| 8522 |
-
* Normalize the given path string, returning a regular expression.
|
| 8523 |
-
*
|
| 8524 |
-
* An empty array can be passed in for the keys, which will hold the
|
| 8525 |
-
* placeholder key descriptions. For example, using `/user/:id`, `keys` will
|
| 8526 |
-
* contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`.
|
| 8527 |
-
*
|
| 8528 |
-
* @param {(string|RegExp|Array)} path
|
| 8529 |
-
* @param {(Array|Object)=} keys
|
| 8530 |
-
* @param {Object=} options
|
| 8531 |
-
* @return {!RegExp}
|
| 8532 |
-
*/
|
| 8533 |
-
function pathToRegexp (path, keys, options) {
|
| 8534 |
-
if (!isarray(keys)) {
|
| 8535 |
-
options = /** @type {!Object} */ (keys || options)
|
| 8536 |
-
keys = []
|
| 8537 |
-
}
|
| 8538 |
|
| 8539 |
-
|
| 8540 |
|
| 8541 |
-
|
| 8542 |
-
return regexpToRegexp(path, /** @type {!Array} */ (keys))
|
| 8543 |
-
}
|
| 8544 |
|
| 8545 |
-
|
| 8546 |
-
return arrayToRegexp(/** @type {!Array} */ (path), /** @type {!Array} */ (keys), options)
|
| 8547 |
-
}
|
| 8548 |
|
| 8549 |
-
|
| 8550 |
-
|
| 8551 |
|
|
|
|
| 8552 |
|
| 8553 |
/***/ }),
|
| 8554 |
|
| 8555 |
-
/***/
|
| 8556 |
-
/***/ (function(module,
|
| 8557 |
-
|
| 8558 |
-
var arrayWithoutHoles = __webpack_require__(57);
|
| 8559 |
|
| 8560 |
-
|
| 8561 |
|
| 8562 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8563 |
|
| 8564 |
-
|
| 8565 |
|
| 8566 |
-
|
| 8567 |
-
|
| 8568 |
-
}
|
| 8569 |
|
| 8570 |
-
|
|
|
|
| 8571 |
|
| 8572 |
-
|
|
|
|
| 8573 |
|
| 8574 |
-
|
| 8575 |
-
|
| 8576 |
|
| 8577 |
-
|
| 8578 |
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getUnreadNotesCount; });
|
| 8579 |
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return hasValidNotes; });
|
| 8580 |
-
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3);
|
| 8581 |
-
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__);
|
| 8582 |
/**
|
| 8583 |
* External dependencies
|
| 8584 |
*/
|
| 8585 |
|
| 8586 |
/**
|
| 8587 |
-
*
|
| 8588 |
*
|
| 8589 |
-
* @param {
|
| 8590 |
-
* @param {number} lastRead - The timestamp that the user read a note.
|
| 8591 |
-
* @return {number} - Unread notes count.
|
| 8592 |
-
*/
|
| 8593 |
-
|
| 8594 |
-
function getUnreadNotesCount(notes, lastRead) {
|
| 8595 |
-
var unreadNotes = Object(lodash__WEBPACK_IMPORTED_MODULE_0__["filter"])(notes, function (note) {
|
| 8596 |
-
var isDeleted = note.is_deleted,
|
| 8597 |
-
dateCreatedGmt = note.date_created_gmt,
|
| 8598 |
-
status = note.status;
|
| 8599 |
-
|
| 8600 |
-
if (!isDeleted) {
|
| 8601 |
-
var unread = !lastRead || !dateCreatedGmt || new Date(dateCreatedGmt + 'Z').getTime() > lastRead;
|
| 8602 |
-
return unread && status === 'unactioned';
|
| 8603 |
-
}
|
| 8604 |
-
});
|
| 8605 |
-
return unreadNotes.length;
|
| 8606 |
-
}
|
| 8607 |
-
/**
|
| 8608 |
-
* Verifies if there are any valid notes in the list.
|
| 8609 |
*
|
| 8610 |
-
* @
|
| 8611 |
-
* @return {boolean} - Whether there are valid notes or not.
|
| 8612 |
*/
|
| 8613 |
|
| 8614 |
-
function
|
| 8615 |
-
var
|
| 8616 |
-
var isDeleted = note.is_deleted;
|
| 8617 |
-
return !isDeleted;
|
| 8618 |
-
});
|
| 8619 |
-
return validNotes.length > 0;
|
| 8620 |
-
}
|
| 8621 |
-
|
| 8622 |
-
/***/ }),
|
| 8623 |
-
|
| 8624 |
-
/***/ 198:
|
| 8625 |
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
| 8626 |
|
| 8627 |
-
|
| 8628 |
-
|
| 8629 |
-
|
| 8630 |
-
|
| 8631 |
-
|
| 8632 |
|
| 8633 |
|
| 8634 |
|
| 8635 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8636 |
|
| 8637 |
-
|
|
|
|
|
|
|
| 8638 |
|
| 8639 |
/**
|
| 8640 |
* WordPress dependencies
|
| 8641 |
*/
|
| 8642 |
|
| 8643 |
-
/** @typedef {{icon: JSX.Element, size?: number} & import('@wordpress/primitives').SVGProps} IconProps */
|
| 8644 |
|
| 8645 |
/**
|
| 8646 |
-
*
|
| 8647 |
-
*
|
| 8648 |
-
* @param {IconProps} props icon is the SVG component to render
|
| 8649 |
-
* size is a number specifiying the icon size in pixels
|
| 8650 |
-
* Other props will be passed to wrapped SVG component
|
| 8651 |
-
*
|
| 8652 |
-
* @return {JSX.Element} Icon component
|
| 8653 |
*/
|
| 8654 |
|
| 8655 |
-
function Icon(_ref) {
|
| 8656 |
-
var icon = _ref.icon,
|
| 8657 |
-
_ref$size = _ref.size,
|
| 8658 |
-
size = _ref$size === void 0 ? 24 : _ref$size,
|
| 8659 |
-
props = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(_ref, ["icon", "size"]);
|
| 8660 |
|
| 8661 |
-
|
| 8662 |
-
|
| 8663 |
-
|
| 8664 |
-
}, props));
|
| 8665 |
-
}
|
| 8666 |
|
| 8667 |
-
|
| 8668 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8669 |
|
| 8670 |
-
|
|
|
|
|
|
|
| 8671 |
|
| 8672 |
-
|
| 8673 |
-
|
|
|
|
|
|
|
| 8674 |
|
| 8675 |
-
|
|
|
|
|
|
|
|
|
|
| 8676 |
|
| 8677 |
-
|
|
|
|
|
|
|
|
|
|
| 8678 |
|
| 8679 |
-
|
| 8680 |
-
|
|
|
|
|
|
|
| 8681 |
|
| 8682 |
-
|
|
|
|
|
|
|
|
|
|
| 8683 |
|
| 8684 |
-
|
|
|
|
|
|
|
|
|
|
| 8685 |
|
| 8686 |
-
|
| 8687 |
-
|
|
|
|
|
|
|
| 8688 |
|
| 8689 |
-
|
|
|
|
|
|
|
|
|
|
| 8690 |
|
| 8691 |
-
|
|
|
|
|
|
|
|
|
|
| 8692 |
|
| 8693 |
-
|
| 8694 |
-
|
|
|
|
|
|
|
| 8695 |
|
| 8696 |
-
|
|
|
|
|
|
|
|
|
|
| 8697 |
|
| 8698 |
-
|
|
|
|
|
|
|
|
|
|
| 8699 |
|
| 8700 |
-
|
| 8701 |
-
|
|
|
|
|
|
|
| 8702 |
|
| 8703 |
-
|
|
|
|
|
|
|
|
|
|
| 8704 |
|
| 8705 |
-
|
|
|
|
|
|
|
|
|
|
| 8706 |
|
| 8707 |
-
|
| 8708 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8709 |
|
| 8710 |
-
|
| 8711 |
-
|
| 8712 |
-
|
| 8713 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8714 |
|
| 8715 |
-
|
| 8716 |
-
|
| 8717 |
-
|
| 8718 |
-
}
|
| 8719 |
-
}
|
| 8720 |
-
}
|
| 8721 |
|
| 8722 |
-
return
|
| 8723 |
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8724 |
|
| 8725 |
-
|
| 8726 |
-
|
| 8727 |
-
|
| 8728 |
-
module.exports = _extends;
|
| 8729 |
|
| 8730 |
-
|
| 8731 |
|
| 8732 |
-
|
| 8733 |
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
| 8734 |
|
| 8735 |
-
"
|
| 8736 |
-
|
| 8737 |
-
|
| 8738 |
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return CURRENCY; });
|
| 8739 |
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return LOCALE; });
|
| 8740 |
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return ORDER_STATUSES; });
|
| 8741 |
-
/* unused harmony export SITE_TITLE */
|
| 8742 |
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return WC_ASSET_URL; });
|
| 8743 |
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return getSetting; });
|
| 8744 |
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return setSetting; });
|
| 8745 |
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return getAdminLink; });
|
| 8746 |
-
/* harmony import */ var _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(31);
|
| 8747 |
-
/* harmony import */ var _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__);
|
| 8748 |
-
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2);
|
| 8749 |
-
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
|
| 8750 |
|
|
|
|
|
|
|
|
|
|
| 8751 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8752 |
/**
|
| 8753 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8754 |
*/
|
| 8755 |
-
// Remove mutable data from settings object to prevent access. Data stores should be used instead.
|
| 8756 |
|
| 8757 |
-
var
|
| 8758 |
-
|
| 8759 |
-
var
|
| 8760 |
-
if (!mutableSources.includes(key)) {
|
| 8761 |
-
source[key] = settings[key];
|
| 8762 |
-
}
|
| 8763 |
|
| 8764 |
-
|
| 8765 |
-
}
|
| 8766 |
-
|
| 8767 |
-
var COUNTRIES = SOURCE.countries;
|
| 8768 |
-
var CURRENCY = SOURCE.currency;
|
| 8769 |
-
var LOCALE = SOURCE.locale;
|
| 8770 |
-
var ORDER_STATUSES = SOURCE.orderStatuses;
|
| 8771 |
-
var SITE_TITLE = SOURCE.siteTitle;
|
| 8772 |
-
var WC_ASSET_URL = SOURCE.wcAssetUrl;
|
| 8773 |
/**
|
| 8774 |
-
*
|
| 8775 |
-
*
|
| 8776 |
-
* @param {string} name The identifier for the setting.
|
| 8777 |
-
* @param {*} [fallback=false] The value to use as a fallback
|
| 8778 |
-
* if the setting is not in the
|
| 8779 |
-
* state.
|
| 8780 |
-
* @param {Function} [filter=( val ) => val] A callback for filtering the
|
| 8781 |
-
* value before it's returned.
|
| 8782 |
-
* Receives both the found value
|
| 8783 |
-
* (if it exists for the key) and
|
| 8784 |
-
* the provided fallback arg.
|
| 8785 |
*
|
| 8786 |
-
* @
|
| 8787 |
-
*
|
| 8788 |
*/
|
| 8789 |
|
| 8790 |
-
function
|
| 8791 |
-
|
| 8792 |
-
|
| 8793 |
-
return val;
|
| 8794 |
-
};
|
| 8795 |
|
| 8796 |
-
|
| 8797 |
-
throw new Error(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__["__"])('Mutable settings should be accessed via data store.'));
|
| 8798 |
-
}
|
| 8799 |
|
| 8800 |
-
|
| 8801 |
-
|
| 8802 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8803 |
/**
|
| 8804 |
-
*
|
| 8805 |
-
*
|
| 8806 |
-
* NOTE: This feature is to be removed in favour of data stores when a full migration
|
| 8807 |
-
* is complete.
|
| 8808 |
*
|
| 8809 |
-
* @
|
| 8810 |
*
|
| 8811 |
-
* @
|
| 8812 |
-
* setting being mutated.
|
| 8813 |
-
* @param {*} value The value to set.
|
| 8814 |
-
* @param {Function} [filter=( val ) => val] Allows for providing a callback
|
| 8815 |
-
* to sanitize the setting (eg.
|
| 8816 |
-
* ensure it's a number)
|
| 8817 |
*/
|
| 8818 |
|
| 8819 |
-
function
|
| 8820 |
-
|
| 8821 |
-
return
|
| 8822 |
-
};
|
| 8823 |
-
|
| 8824 |
-
if (mutableSources.includes(name)) {
|
| 8825 |
-
throw new Error(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__["__"])('Mutable settings should be mutated via data store.'));
|
| 8826 |
-
}
|
| 8827 |
-
|
| 8828 |
-
SOURCE[name] = filter(value);
|
| 8829 |
}
|
| 8830 |
/**
|
| 8831 |
-
*
|
|
|
|
|
|
|
|
|
|
| 8832 |
*
|
| 8833 |
-
* @
|
| 8834 |
-
* @return {string} Full admin URL.
|
| 8835 |
*/
|
| 8836 |
|
| 8837 |
-
function getAdminLink(path) {
|
| 8838 |
-
return (ADMIN_URL || '') + path;
|
| 8839 |
-
}
|
| 8840 |
-
|
| 8841 |
-
/***/ }),
|
| 8842 |
|
| 8843 |
-
|
| 8844 |
-
|
|
|
|
| 8845 |
|
| 8846 |
-
|
|
|
|
| 8847 |
|
| 8848 |
-
|
|
|
|
|
|
|
| 8849 |
|
| 8850 |
-
|
| 8851 |
-
|
|
|
|
| 8852 |
|
| 8853 |
-
|
|
|
|
|
|
|
|
|
|
| 8854 |
|
| 8855 |
/***/ }),
|
| 8856 |
|
| 8857 |
-
/***/
|
| 8858 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
| 8859 |
|
| 8860 |
"use strict";
|
| 8861 |
-
/* WEBPACK VAR INJECTION */(function(process) {/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
|
| 8862 |
-
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
|
| 8863 |
-
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3);
|
| 8864 |
-
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__);
|
| 8865 |
-
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6);
|
| 8866 |
-
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
|
| 8867 |
-
/* harmony import */ var _wordpress_a11y__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(140);
|
| 8868 |
-
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(2);
|
| 8869 |
-
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__);
|
| 8870 |
-
/* harmony import */ var _wordpress_warning__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(279);
|
| 8871 |
-
/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(4);
|
| 8872 |
-
/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_6__);
|
| 8873 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8874 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8875 |
/**
|
| 8876 |
* External dependencies
|
| 8877 |
*/
|
| 8878 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8879 |
|
|
|
|
|
|
|
|
|
|
| 8880 |
|
| 8881 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8882 |
|
|
|
|
|
|
|
| 8883 |
|
|
|
|
|
|
|
| 8884 |
|
| 8885 |
-
|
| 8886 |
-
|
| 8887 |
|
|
|
|
| 8888 |
/**
|
| 8889 |
-
*
|
| 8890 |
-
* valid message is provided.
|
| 8891 |
*
|
| 8892 |
-
* @param {string
|
| 8893 |
-
* @
|
| 8894 |
*/
|
|
|
|
|
|
|
|
|
|
| 8895 |
|
| 8896 |
-
|
| 8897 |
-
|
| 8898 |
-
|
| 8899 |
-
|
| 8900 |
-
Object(_wordpress_a11y__WEBPACK_IMPORTED_MODULE_3__[/* speak */ "a"])(spokenMessage, politeness);
|
| 8901 |
-
}
|
| 8902 |
-
}, [spokenMessage, politeness]);
|
| 8903 |
-
}
|
| 8904 |
-
|
| 8905 |
-
function Snackbar(_ref, ref) {
|
| 8906 |
-
var className = _ref.className,
|
| 8907 |
-
children = _ref.children,
|
| 8908 |
-
_ref$spokenMessage = _ref.spokenMessage,
|
| 8909 |
-
spokenMessage = _ref$spokenMessage === void 0 ? children : _ref$spokenMessage,
|
| 8910 |
-
_ref$politeness = _ref.politeness,
|
| 8911 |
-
politeness = _ref$politeness === void 0 ? 'polite' : _ref$politeness,
|
| 8912 |
-
_ref$actions = _ref.actions,
|
| 8913 |
-
actions = _ref$actions === void 0 ? [] : _ref$actions,
|
| 8914 |
-
_ref$onRemove = _ref.onRemove,
|
| 8915 |
-
onRemove = _ref$onRemove === void 0 ? lodash__WEBPACK_IMPORTED_MODULE_1__["noop"] : _ref$onRemove,
|
| 8916 |
-
_ref$icon = _ref.icon,
|
| 8917 |
-
icon = _ref$icon === void 0 ? null : _ref$icon,
|
| 8918 |
-
_ref$explicitDismiss = _ref.explicitDismiss,
|
| 8919 |
-
explicitDismiss = _ref$explicitDismiss === void 0 ? false : _ref$explicitDismiss,
|
| 8920 |
-
_ref$onDismiss = _ref.onDismiss,
|
| 8921 |
-
onDismiss = _ref$onDismiss === void 0 ? null : _ref$onDismiss;
|
| 8922 |
-
onDismiss = onDismiss || lodash__WEBPACK_IMPORTED_MODULE_1__["noop"];
|
| 8923 |
|
| 8924 |
-
|
| 8925 |
-
|
| 8926 |
-
|
| 8927 |
-
}
|
| 8928 |
|
| 8929 |
-
|
| 8930 |
-
|
| 8931 |
}
|
| 8932 |
|
| 8933 |
-
|
| 8934 |
-
|
| 8935 |
-
|
|
|
|
| 8936 |
|
| 8937 |
-
if (onClick) {
|
| 8938 |
-
onClick(event);
|
| 8939 |
-
}
|
| 8940 |
-
}
|
| 8941 |
|
| 8942 |
-
|
| 8943 |
|
| 8944 |
-
|
| 8945 |
-
|
| 8946 |
-
|
| 8947 |
-
onDismiss();
|
| 8948 |
-
onRemove();
|
| 8949 |
-
}
|
| 8950 |
-
}, NOTICE_TIMEOUT);
|
| 8951 |
-
return function () {
|
| 8952 |
-
return clearTimeout(timeoutHandle);
|
| 8953 |
-
};
|
| 8954 |
-
}, [explicitDismiss, onDismiss, onRemove]);
|
| 8955 |
-
var classes = classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, 'components-snackbar', {
|
| 8956 |
-
'components-snackbar-explicit-dismiss': !!explicitDismiss
|
| 8957 |
-
});
|
| 8958 |
|
| 8959 |
-
if (actions && actions.length > 1) {
|
| 8960 |
-
// we need to inform developers that snackbar only accepts 1 action
|
| 8961 |
-
typeof process !== "undefined" && process.env && "production" !== "production" ? Object(_wordpress_warning__WEBPACK_IMPORTED_MODULE_5__[/* default */ "a"])('Snackbar can only have 1 action, use Notice if your message require many messages') : void 0; // return first element only while keeping it inside an array
|
| 8962 |
|
| 8963 |
-
actions = [actions[0]];
|
| 8964 |
-
}
|
| 8965 |
|
| 8966 |
-
var snackbarContentClassnames = classnames__WEBPACK_IMPORTED_MODULE_2___default()('components-snackbar__content', {
|
| 8967 |
-
'components-snackbar__content-with-icon': !!icon
|
| 8968 |
-
});
|
| 8969 |
-
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", {
|
| 8970 |
-
ref: ref,
|
| 8971 |
-
className: classes,
|
| 8972 |
-
onClick: !explicitDismiss ? dismissMe : lodash__WEBPACK_IMPORTED_MODULE_1__["noop"],
|
| 8973 |
-
tabIndex: "0",
|
| 8974 |
-
role: !explicitDismiss ? 'button' : '',
|
| 8975 |
-
onKeyPress: !explicitDismiss ? dismissMe : lodash__WEBPACK_IMPORTED_MODULE_1__["noop"],
|
| 8976 |
-
"aria-label": !explicitDismiss ? Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__["__"])('Dismiss this notice') : ''
|
| 8977 |
-
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", {
|
| 8978 |
-
className: snackbarContentClassnames
|
| 8979 |
-
}, icon && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", {
|
| 8980 |
-
className: "components-snackbar__icon"
|
| 8981 |
-
}, icon), children, actions.map(function (_ref2, index) {
|
| 8982 |
-
var label = _ref2.label,
|
| 8983 |
-
_onClick = _ref2.onClick,
|
| 8984 |
-
url = _ref2.url;
|
| 8985 |
-
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_6__["Button"], {
|
| 8986 |
-
key: index,
|
| 8987 |
-
href: url,
|
| 8988 |
-
isTertiary: true,
|
| 8989 |
-
onClick: function onClick(event) {
|
| 8990 |
-
return onActionClick(event, _onClick);
|
| 8991 |
-
},
|
| 8992 |
-
className: "components-snackbar__action"
|
| 8993 |
-
}, label);
|
| 8994 |
-
}), explicitDismiss && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("span", {
|
| 8995 |
-
role: "button",
|
| 8996 |
-
"aria-label": "Dismiss this notice",
|
| 8997 |
-
tabIndex: "0",
|
| 8998 |
-
className: "components-snackbar__dismiss-button",
|
| 8999 |
-
onClick: dismissMe,
|
| 9000 |
-
onKeyPress: dismissMe
|
| 9001 |
-
}, "\u2715")));
|
| 9002 |
-
}
|
| 9003 |
|
| 9004 |
-
|
| 9005 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9006 |
|
| 9007 |
-
/***/ }),
|
| 9008 |
|
| 9009 |
-
/***/ 279:
|
| 9010 |
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
| 9011 |
|
| 9012 |
-
|
| 9013 |
-
|
| 9014 |
-
function
|
| 9015 |
-
|
| 9016 |
-
}
|
| 9017 |
/**
|
| 9018 |
-
*
|
| 9019 |
-
*
|
| 9020 |
-
* @param {string} message Message to show in the warning.
|
| 9021 |
-
*
|
| 9022 |
-
* @example
|
| 9023 |
-
* ```js
|
| 9024 |
-
* import warning from '@wordpress/warning';
|
| 9025 |
-
*
|
| 9026 |
-
* function MyComponent( props ) {
|
| 9027 |
-
* if ( ! props.title ) {
|
| 9028 |
-
* warning( '`props.title` was not passed' );
|
| 9029 |
-
* }
|
| 9030 |
-
* ...
|
| 9031 |
-
* }
|
| 9032 |
-
* ```
|
| 9033 |
*/
|
| 9034 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9035 |
|
| 9036 |
-
function
|
| 9037 |
-
|
| 9038 |
-
|
| 9039 |
-
|
|
|
|
| 9040 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9041 |
|
| 9042 |
-
|
| 9043 |
-
|
| 9044 |
-
|
|
|
|
|
|
|
|
|
|
| 9045 |
|
| 9046 |
-
|
| 9047 |
-
|
| 9048 |
-
|
| 9049 |
-
|
| 9050 |
-
|
| 9051 |
-
//# sourceMappingURL=index.js.map
|
| 9052 |
-
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(125)))
|
| 9053 |
|
| 9054 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9055 |
|
| 9056 |
-
/***/ 280:
|
| 9057 |
-
/***/ (function(module, exports) {
|
| 9058 |
|
| 9059 |
-
(function() { module.exports = this["wc"]["customerEffortScore"]; }());
|
| 9060 |
|
| 9061 |
-
/***/ }),
|
| 9062 |
|
| 9063 |
-
|
| 9064 |
-
|
|
|
|
| 9065 |
|
| 9066 |
-
"use strict";
|
| 9067 |
|
| 9068 |
-
|
| 9069 |
-
|
|
|
|
| 9070 |
|
| 9071 |
-
// UNUSED EXPORTS: CustomerEffortScoreTracks
|
| 9072 |
|
| 9073 |
-
|
| 9074 |
-
|
| 9075 |
-
|
| 9076 |
-
__webpack_require__.d(actions_namespaceObject, "setCesSurveyQueue", function() { return setCesSurveyQueue; });
|
| 9077 |
-
__webpack_require__.d(actions_namespaceObject, "addCesSurvey", function() { return addCesSurvey; });
|
| 9078 |
-
__webpack_require__.d(actions_namespaceObject, "addCesSurveyForAnalytics", function() { return addCesSurveyForAnalytics; });
|
| 9079 |
|
| 9080 |
-
// NAMESPACE OBJECT: ./client/customer-effort-score-tracks/data/resolvers.js
|
| 9081 |
-
var resolvers_namespaceObject = {};
|
| 9082 |
-
__webpack_require__.r(resolvers_namespaceObject);
|
| 9083 |
-
__webpack_require__.d(resolvers_namespaceObject, "getCesSurveyQueue", function() { return resolvers_getCesSurveyQueue; });
|
| 9084 |
|
| 9085 |
-
// NAMESPACE OBJECT: ./client/customer-effort-score-tracks/data/selectors.js
|
| 9086 |
-
var selectors_namespaceObject = {};
|
| 9087 |
-
__webpack_require__.r(selectors_namespaceObject);
|
| 9088 |
-
__webpack_require__.d(selectors_namespaceObject, "getCesSurveyQueue", function() { return selectors_getCesSurveyQueue; });
|
| 9089 |
|
| 9090 |
-
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/toConsumableArray.js
|
| 9091 |
-
var toConsumableArray = __webpack_require__(19);
|
| 9092 |
-
var toConsumableArray_default = /*#__PURE__*/__webpack_require__.n(toConsumableArray);
|
| 9093 |
|
| 9094 |
-
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/defineProperty.js
|
| 9095 |
-
var defineProperty = __webpack_require__(5);
|
| 9096 |
-
var defineProperty_default = /*#__PURE__*/__webpack_require__.n(defineProperty);
|
| 9097 |
|
| 9098 |
-
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/slicedToArray.js
|
| 9099 |
-
var slicedToArray = __webpack_require__(18);
|
| 9100 |
-
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
|
| 9101 |
|
| 9102 |
-
|
| 9103 |
-
var
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9104 |
|
| 9105 |
-
|
| 9106 |
-
|
| 9107 |
-
|
|
|
|
| 9108 |
|
| 9109 |
-
|
| 9110 |
-
|
|
|
|
|
|
|
| 9111 |
|
| 9112 |
-
|
| 9113 |
-
var external_this_wc_customerEffortScore_ = __webpack_require__(280);
|
| 9114 |
-
var external_this_wc_customerEffortScore_default = /*#__PURE__*/__webpack_require__.n(external_this_wc_customerEffortScore_);
|
| 9115 |
|
| 9116 |
-
|
| 9117 |
-
var
|
| 9118 |
|
| 9119 |
-
|
| 9120 |
-
|
|
|
|
| 9121 |
|
| 9122 |
-
|
| 9123 |
-
|
|
|
|
|
|
|
| 9124 |
|
| 9125 |
-
// EXTERNAL MODULE: external {"this":["wp","i18n"]}
|
| 9126 |
-
var external_this_wp_i18n_ = __webpack_require__(2);
|
| 9127 |
|
| 9128 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9129 |
|
|
|
|
|
|
|
| 9130 |
|
|
|
|
| 9131 |
|
| 9132 |
|
|
|
|
|
|
|
|
|
|
| 9133 |
|
| 9134 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9135 |
|
| 9136 |
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { defineProperty_default()(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
| 9137 |
|
| 9138 |
/**
|
| 9139 |
* External dependencies
|
| 9140 |
*/
|
| 9141 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9142 |
|
| 9143 |
|
|
|
|
|
|
|
|
|
|
| 9144 |
|
| 9145 |
|
| 9146 |
|
|
|
|
|
|
|
| 9147 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9148 |
|
| 9149 |
-
var
|
| 9150 |
-
|
| 9151 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9152 |
/**
|
| 9153 |
-
*
|
| 9154 |
-
* customer effort score.
|
| 9155 |
-
*
|
| 9156 |
-
* @param {Object} props Component props.
|
| 9157 |
-
* @param {string} props.action The action name sent to Tracks.
|
| 9158 |
-
* @param {Object} props.trackProps Additional props sent to Tracks.
|
| 9159 |
-
* @param {string} props.label The label displayed in the modal.
|
| 9160 |
-
* @param {string} props.onSubmitLabel The label displayed upon survey submission.
|
| 9161 |
-
* @param {Array} props.cesShownForActions The array of actions that the CES modal has been shown for.
|
| 9162 |
-
* @param {boolean} props.allowTracking Whether tracking is allowed or not.
|
| 9163 |
-
* @param {boolean} props.resolving Are values still being resolved.
|
| 9164 |
-
* @param {number} props.storeAgeInWeeks The age of the store in weeks.
|
| 9165 |
-
* @param {Function} props.updateOptions Function to update options.
|
| 9166 |
-
* @param {Function} props.createNotice Function to create a snackbar.
|
| 9167 |
*/
|
| 9168 |
|
| 9169 |
-
|
| 9170 |
-
|
| 9171 |
-
|
| 9172 |
-
|
| 9173 |
-
|
| 9174 |
-
|
| 9175 |
-
|
| 9176 |
-
|
| 9177 |
-
|
| 9178 |
-
storeAgeInWeeks = _ref.storeAgeInWeeks,
|
| 9179 |
-
updateOptions = _ref.updateOptions,
|
| 9180 |
-
createNotice = _ref.createNotice;
|
| 9181 |
|
| 9182 |
-
var _useState = Object(external_this_wp_element_["useState"])(false),
|
| 9183 |
-
_useState2 = slicedToArray_default()(_useState, 2),
|
| 9184 |
-
modalShown = _useState2[0],
|
| 9185 |
-
setModalShown = _useState2[1];
|
| 9186 |
|
| 9187 |
-
|
| 9188 |
-
return null;
|
| 9189 |
-
} // Don't show if tracking is disallowed.
|
| 9190 |
|
|
|
|
| 9191 |
|
| 9192 |
-
|
| 9193 |
-
|
| 9194 |
-
|
| 9195 |
-
// for this action *before* this component was initially instantiated.
|
| 9196 |
-
//
|
| 9197 |
-
// We want to make sure we still render CustomerEffortScore below
|
| 9198 |
-
// (we don't want to return null early), if the modal was shown for this
|
| 9199 |
-
// instantiation, so that the component doesn't go away while we are
|
| 9200 |
-
// still showing it.
|
| 9201 |
|
|
|
|
|
|
|
|
|
|
| 9202 |
|
| 9203 |
-
if (cesShownForActions.indexOf(action) !== -1 && !modalShown) {
|
| 9204 |
-
return null;
|
| 9205 |
-
}
|
| 9206 |
|
| 9207 |
-
var onNoticeShown = function onNoticeShown() {
|
| 9208 |
-
Object(external_this_wc_tracks_["recordEvent"])('ces_snackbar_view', _objectSpread({
|
| 9209 |
-
action: action,
|
| 9210 |
-
store_age: storeAgeInWeeks
|
| 9211 |
-
}, trackProps));
|
| 9212 |
-
};
|
| 9213 |
|
| 9214 |
-
|
| 9215 |
-
|
| 9216 |
-
|
|
|
|
|
|
|
| 9217 |
|
| 9218 |
-
var
|
| 9219 |
-
|
| 9220 |
-
|
| 9221 |
-
|
| 9222 |
-
}
|
| 9223 |
-
|
| 9224 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9225 |
|
| 9226 |
-
var onModalShown = function onModalShown() {
|
| 9227 |
-
setModalShown(true);
|
| 9228 |
-
Object(external_this_wc_tracks_["recordEvent"])('ces_view', _objectSpread({
|
| 9229 |
-
action: action,
|
| 9230 |
-
store_age: storeAgeInWeeks
|
| 9231 |
-
}, trackProps));
|
| 9232 |
-
addActionToShownOption();
|
| 9233 |
-
};
|
| 9234 |
|
| 9235 |
-
|
| 9236 |
-
|
| 9237 |
-
|
| 9238 |
-
score: score,
|
| 9239 |
-
comments: comments || '',
|
| 9240 |
-
store_age: storeAgeInWeeks
|
| 9241 |
-
}, trackProps));
|
| 9242 |
-
createNotice('success', onSubmitLabel);
|
| 9243 |
-
};
|
| 9244 |
|
| 9245 |
-
|
| 9246 |
-
|
| 9247 |
-
|
| 9248 |
-
onNoticeShownCallback: onNoticeShown,
|
| 9249 |
-
onNoticeDismissedCallback: onNoticeDismissed,
|
| 9250 |
-
onModalShownCallback: onModalShown,
|
| 9251 |
-
icon: Object(external_this_wp_element_["createElement"])("span", {
|
| 9252 |
-
style: {
|
| 9253 |
-
height: 21,
|
| 9254 |
-
width: 21
|
| 9255 |
-
},
|
| 9256 |
-
role: "img",
|
| 9257 |
-
"aria-label": Object(external_this_wp_i18n_["__"])('Pencil icon', 'woocommerce-admin')
|
| 9258 |
-
}, "\u270F\uFE0F")
|
| 9259 |
-
});
|
| 9260 |
-
}
|
| 9261 |
|
| 9262 |
-
CustomerEffortScoreTracks.propTypes = {
|
| 9263 |
-
/**
|
| 9264 |
-
* The action name sent to Tracks.
|
| 9265 |
-
*/
|
| 9266 |
-
action: prop_types_default.a.string.isRequired,
|
| 9267 |
|
| 9268 |
-
/**
|
| 9269 |
-
* Additional props sent to Tracks.
|
| 9270 |
-
*/
|
| 9271 |
-
trackProps: prop_types_default.a.object,
|
| 9272 |
|
| 9273 |
-
/**
|
| 9274 |
-
* The label displayed in the modal.
|
| 9275 |
-
*/
|
| 9276 |
-
label: prop_types_default.a.string.isRequired,
|
| 9277 |
|
| 9278 |
-
/**
|
| 9279 |
-
* The label for the snackbar that appears upon survey submission.
|
| 9280 |
-
*/
|
| 9281 |
-
onSubmitLabel: prop_types_default.a.string,
|
| 9282 |
|
| 9283 |
-
/**
|
| 9284 |
-
* The array of actions that the CES modal has been shown for.
|
| 9285 |
-
*/
|
| 9286 |
-
cesShownForActions: prop_types_default.a.arrayOf(prop_types_default.a.string).isRequired,
|
| 9287 |
|
| 9288 |
-
/**
|
| 9289 |
-
* Whether tracking is allowed or not.
|
| 9290 |
-
*/
|
| 9291 |
-
allowTracking: prop_types_default.a.bool,
|
| 9292 |
|
| 9293 |
-
|
| 9294 |
-
|
| 9295 |
-
|
| 9296 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9297 |
|
| 9298 |
-
|
| 9299 |
-
|
| 9300 |
-
|
| 9301 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9302 |
|
| 9303 |
-
/**
|
| 9304 |
-
* Function to update options.
|
| 9305 |
-
*/
|
| 9306 |
-
updateOptions: prop_types_default.a.func,
|
| 9307 |
|
| 9308 |
-
|
| 9309 |
-
|
| 9310 |
-
|
| 9311 |
-
createNotice: prop_types_default.a.func
|
| 9312 |
-
};
|
| 9313 |
|
| 9314 |
-
|
| 9315 |
-
|
| 9316 |
-
|
| 9317 |
-
} // Date.now() is ms since Unix epoch, adminInstallTimestamp is in
|
| 9318 |
-
// seconds since Unix epoch.
|
| 9319 |
|
| 9320 |
|
| 9321 |
-
var storeAgeInMs = Date.now() - adminInstallTimestamp * 1000;
|
| 9322 |
-
var storeAgeInWeeks = Math.round(storeAgeInMs / external_this_wc_data_["WEEK"]);
|
| 9323 |
-
return storeAgeInWeeks;
|
| 9324 |
-
}
|
| 9325 |
|
| 9326 |
-
|
| 9327 |
-
var
|
| 9328 |
-
|
| 9329 |
-
|
| 9330 |
|
| 9331 |
-
var
|
| 9332 |
-
|
| 9333 |
-
var storeAgeInWeeks = getStoreAgeInWeeks(adminInstallTimestamp);
|
| 9334 |
-
var allowTrackingOption = getOption(ALLOW_TRACKING_OPTION_NAME) || 'no';
|
| 9335 |
-
var allowTracking = allowTrackingOption === 'yes';
|
| 9336 |
-
var resolving = isResolving('getOption', [SHOWN_FOR_ACTIONS_OPTION_NAME]) || storeAgeInWeeks === null || isResolving('getOption', [ADMIN_INSTALL_TIMESTAMP_OPTION_NAME]) || isResolving('getOption', [ALLOW_TRACKING_OPTION_NAME]);
|
| 9337 |
-
return {
|
| 9338 |
-
cesShownForActions: cesShownForActions,
|
| 9339 |
-
allowTracking: allowTracking,
|
| 9340 |
-
storeAgeInWeeks: storeAgeInWeeks,
|
| 9341 |
-
resolving: resolving
|
| 9342 |
-
};
|
| 9343 |
-
}), Object(external_this_wp_data_["withDispatch"])(function (dispatch) {
|
| 9344 |
-
var _dispatch = dispatch(external_this_wc_data_["OPTIONS_STORE_NAME"]),
|
| 9345 |
-
updateOptions = _dispatch.updateOptions;
|
| 9346 |
|
| 9347 |
-
var _dispatch2 = dispatch('core/notices'),
|
| 9348 |
-
createNotice = _dispatch2.createNotice;
|
| 9349 |
|
| 9350 |
-
|
| 9351 |
-
|
| 9352 |
-
|
| 9353 |
-
|
| 9354 |
-
|
| 9355 |
-
|
| 9356 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9357 |
|
| 9358 |
-
// EXTERNAL MODULE: external {"this":["wp","
|
| 9359 |
-
var
|
| 9360 |
|
| 9361 |
-
// CONCATENATED MODULE: ./client/
|
| 9362 |
-
var TYPES = {
|
| 9363 |
-
SET_CES_SURVEY_QUEUE: 'SET_CES_SURVEY_QUEUE',
|
| 9364 |
-
ADD_CES_SURVEY: 'ADD_CES_SURVEY'
|
| 9365 |
-
};
|
| 9366 |
-
/* harmony default export */ var action_types = (TYPES);
|
| 9367 |
-
// CONCATENATED MODULE: ./client/customer-effort-score-tracks/data/actions.js
|
| 9368 |
/**
|
| 9369 |
* External dependencies
|
| 9370 |
*/
|
| 9371 |
|
| 9372 |
/**
|
| 9373 |
-
*
|
|
|
|
|
|
|
|
|
|
| 9374 |
*/
|
| 9375 |
|
|
|
|
|
|
|
| 9376 |
|
| 9377 |
-
|
| 9378 |
-
|
| 9379 |
-
|
| 9380 |
-
|
| 9381 |
-
|
| 9382 |
|
| 9383 |
-
|
| 9384 |
-
|
| 9385 |
-
type: action_types.SET_CES_SURVEY_QUEUE,
|
| 9386 |
-
queue: queue
|
| 9387 |
-
};
|
| 9388 |
-
}
|
| 9389 |
/**
|
| 9390 |
-
*
|
| 9391 |
*
|
| 9392 |
-
* @param {string}
|
| 9393 |
-
* @
|
| 9394 |
-
* @param {string} pageNow value of window.pagenow
|
| 9395 |
-
* @param {string} adminPage value of window.adminpage
|
| 9396 |
-
* @param {string} onsubmit_label label for the snackback onsubmit
|
| 9397 |
-
*/
|
| 9398 |
-
|
| 9399 |
-
function addCesSurvey(action, label) {
|
| 9400 |
-
var pageNow = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : window.pagenow;
|
| 9401 |
-
var adminPage = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : window.adminpage;
|
| 9402 |
-
var onsubmit_label = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : undefined;
|
| 9403 |
-
return {
|
| 9404 |
-
type: action_types.ADD_CES_SURVEY,
|
| 9405 |
-
action: action,
|
| 9406 |
-
label: label,
|
| 9407 |
-
pageNow: pageNow,
|
| 9408 |
-
adminPage: adminPage,
|
| 9409 |
-
onsubmit_label: onsubmit_label
|
| 9410 |
-
};
|
| 9411 |
-
}
|
| 9412 |
-
/**
|
| 9413 |
-
* Add a new CES survey track for the pages in Analytics menu
|
| 9414 |
*/
|
| 9415 |
|
| 9416 |
-
function
|
| 9417 |
-
|
| 9418 |
-
|
| 9419 |
-
|
| 9420 |
-
|
| 9421 |
-
var regenerator_default = /*#__PURE__*/__webpack_require__.n(regenerator);
|
| 9422 |
-
|
| 9423 |
-
// CONCATENATED MODULE: ./client/customer-effort-score-tracks/data/resolvers.js
|
| 9424 |
-
|
| 9425 |
|
| 9426 |
-
|
|
|
|
|
|
|
| 9427 |
|
| 9428 |
-
|
| 9429 |
-
|
| 9430 |
-
|
| 9431 |
|
|
|
|
|
|
|
| 9432 |
/**
|
| 9433 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9434 |
*/
|
| 9435 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9436 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9437 |
|
| 9438 |
-
|
| 9439 |
-
|
| 9440 |
-
|
| 9441 |
-
while (1) {
|
| 9442 |
-
switch (_context.prev = _context.next) {
|
| 9443 |
-
case 0:
|
| 9444 |
-
_context.next = 2;
|
| 9445 |
-
return Object(external_this_wp_dataControls_["apiFetch"])({
|
| 9446 |
-
path: "".concat(constants["a" /* API_NAMESPACE */], "/options?options=").concat(constants["b" /* QUEUE_OPTION_NAME */])
|
| 9447 |
-
});
|
| 9448 |
|
| 9449 |
-
case 2:
|
| 9450 |
-
response = _context.sent;
|
| 9451 |
|
| 9452 |
-
|
| 9453 |
-
|
| 9454 |
-
|
| 9455 |
-
}
|
| 9456 |
|
| 9457 |
-
|
| 9458 |
-
return setCesSurveyQueue(response[constants["b" /* QUEUE_OPTION_NAME */]] || []);
|
| 9459 |
|
| 9460 |
-
|
| 9461 |
-
|
| 9462 |
-
|
| 9463 |
|
| 9464 |
-
case 8:
|
| 9465 |
-
throw new Error();
|
| 9466 |
|
| 9467 |
-
|
| 9468 |
-
|
| 9469 |
-
|
| 9470 |
-
|
|
|
|
| 9471 |
}
|
| 9472 |
-
}
|
| 9473 |
-
|
| 9474 |
-
|
| 9475 |
-
|
| 9476 |
-
|
| 9477 |
-
|
| 9478 |
-
|
|
|
|
|
|
|
| 9479 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9480 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9481 |
|
| 9482 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9483 |
|
| 9484 |
-
|
|
|
|
|
|
|
| 9485 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9486 |
/**
|
| 9487 |
-
*
|
|
|
|
|
|
|
| 9488 |
*/
|
| 9489 |
|
| 9490 |
-
var
|
| 9491 |
-
|
| 9492 |
-
|
|
|
|
|
|
|
| 9493 |
|
| 9494 |
-
|
| 9495 |
-
|
| 9496 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9497 |
|
| 9498 |
-
|
| 9499 |
-
case action_types.SET_CES_SURVEY_QUEUE:
|
| 9500 |
-
return reducer_objectSpread(reducer_objectSpread({}, state), {}, {
|
| 9501 |
-
queue: action.queue
|
| 9502 |
-
});
|
| 9503 |
|
| 9504 |
-
case action_types.ADD_CES_SURVEY:
|
| 9505 |
-
// Prevent duplicate
|
| 9506 |
-
var hasDuplicate = state.queue.filter(function (track) {
|
| 9507 |
-
return track.action === action.action;
|
| 9508 |
-
});
|
| 9509 |
|
| 9510 |
-
|
| 9511 |
-
|
| 9512 |
-
|
| 9513 |
|
| 9514 |
-
|
| 9515 |
-
|
| 9516 |
-
|
| 9517 |
-
|
| 9518 |
-
|
| 9519 |
-
|
| 9520 |
-
|
| 9521 |
-
|
| 9522 |
-
|
| 9523 |
-
|
| 9524 |
|
| 9525 |
-
|
| 9526 |
-
|
| 9527 |
-
}
|
| 9528 |
-
};
|
| 9529 |
|
| 9530 |
-
|
| 9531 |
-
// CONCATENATED MODULE: ./client/customer-effort-score-tracks/data/index.js
|
| 9532 |
-
/**
|
| 9533 |
-
* External dependencies
|
| 9534 |
-
*/
|
| 9535 |
|
| 9536 |
|
| 9537 |
/**
|
| 9538 |
-
*
|
| 9539 |
*/
|
| 9540 |
|
| 9541 |
|
|
@@ -9543,144 +18579,159 @@ var reducer_reducer = function reducer() {
|
|
| 9543 |
|
| 9544 |
|
| 9545 |
|
| 9546 |
-
/* harmony default export */ var data = (Object(external_this_wp_data_["registerStore"])(constants["c" /* STORE_KEY */], {
|
| 9547 |
-
actions: actions_namespaceObject,
|
| 9548 |
-
selectors: selectors_namespaceObject,
|
| 9549 |
-
resolvers: resolvers_namespaceObject,
|
| 9550 |
-
controls: external_this_wp_dataControls_["controls"],
|
| 9551 |
-
reducer: data_reducer
|
| 9552 |
-
}));
|
| 9553 |
-
// CONCATENATED MODULE: ./client/customer-effort-score-tracks/customer-effort-score-tracks-container.js
|
| 9554 |
|
| 9555 |
|
| 9556 |
/**
|
| 9557 |
-
*
|
| 9558 |
*/
|
| 9559 |
|
| 9560 |
|
| 9561 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9562 |
|
| 9563 |
-
|
| 9564 |
-
|
| 9565 |
-
|
| 9566 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9567 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9568 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9569 |
|
| 9570 |
-
|
| 9571 |
-
|
| 9572 |
-
|
| 9573 |
-
* however this is designed to be flexible if multiple surveys per page are
|
| 9574 |
-
* added in the future.
|
| 9575 |
-
*
|
| 9576 |
-
* @param {Object} props Component props.
|
| 9577 |
-
* @param {Array} props.queue The queue of surveys.
|
| 9578 |
-
* @param {boolean} props.resolving Whether the queue is resolving.
|
| 9579 |
-
* @param {Function} props.clearQueue Sets up clearing of the queue on the next page load.
|
| 9580 |
-
*/
|
| 9581 |
|
| 9582 |
-
|
| 9583 |
-
|
| 9584 |
-
resolving = _ref.resolving,
|
| 9585 |
-
clearQueue = _ref.clearQueue;
|
| 9586 |
|
| 9587 |
-
|
| 9588 |
-
return
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9589 |
}
|
| 9590 |
|
| 9591 |
-
var
|
| 9592 |
-
|
| 9593 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9594 |
|
| 9595 |
-
|
| 9596 |
-
|
| 9597 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9598 |
|
| 9599 |
-
return Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, queueForPage.map(function (item, index) {
|
| 9600 |
-
return Object(external_this_wp_element_["createElement"])(customer_effort_score_tracks, {
|
| 9601 |
-
key: index,
|
| 9602 |
-
action: item.action,
|
| 9603 |
-
label: item.label,
|
| 9604 |
-
onSubmitLabel: item.onsubmit_label,
|
| 9605 |
-
trackProps: item.props || {}
|
| 9606 |
-
});
|
| 9607 |
-
}));
|
| 9608 |
-
}
|
| 9609 |
|
| 9610 |
-
|
| 9611 |
-
|
| 9612 |
-
|
| 9613 |
-
*/
|
| 9614 |
-
queue: prop_types_default.a.arrayOf(prop_types_default.a.object),
|
| 9615 |
|
| 9616 |
-
|
| 9617 |
-
|
| 9618 |
-
|
| 9619 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9620 |
|
| 9621 |
-
/**
|
| 9622 |
-
* Set up clearing the queue on the next page load.
|
| 9623 |
-
*/
|
| 9624 |
-
clearQueue: prop_types_default.a.func
|
| 9625 |
-
};
|
| 9626 |
-
/* harmony default export */ var customer_effort_score_tracks_container = (Object(external_this_wp_compose_["compose"])(Object(external_this_wp_data_["withSelect"])(function (select) {
|
| 9627 |
-
var _select = select(constants["c" /* STORE_KEY */]),
|
| 9628 |
-
getCesSurveyQueue = _select.getCesSurveyQueue,
|
| 9629 |
-
isResolving = _select.isResolving;
|
| 9630 |
|
| 9631 |
-
|
| 9632 |
-
var resolving = isResolving('getOption', [constants["b" /* QUEUE_OPTION_NAME */]]);
|
| 9633 |
-
return {
|
| 9634 |
-
queue: queue,
|
| 9635 |
-
resolving: resolving
|
| 9636 |
-
};
|
| 9637 |
-
}), Object(external_this_wp_data_["withDispatch"])(function (dispatch) {
|
| 9638 |
-
var _dispatch = dispatch(external_this_wc_data_["OPTIONS_STORE_NAME"]),
|
| 9639 |
-
updateOptions = _dispatch.updateOptions;
|
| 9640 |
|
| 9641 |
-
|
| 9642 |
-
clearQueue: function clearQueue() {
|
| 9643 |
-
// This sets an option that should be used on the next page
|
| 9644 |
-
// load to clear the CES tracks queue for the current page (see
|
| 9645 |
-
// CustomerEffortScoreTracks.php) - clearing the queue
|
| 9646 |
-
// directly puts this into an infinite loop which is picked
|
| 9647 |
-
// up by React.
|
| 9648 |
-
updateOptions({
|
| 9649 |
-
woocommerce_clear_ces_tracks_queue_for_page: {
|
| 9650 |
-
pagenow: window.pagenow,
|
| 9651 |
-
adminpage: window.adminpage
|
| 9652 |
-
}
|
| 9653 |
-
});
|
| 9654 |
-
}
|
| 9655 |
-
};
|
| 9656 |
-
}))(CustomerEffortScoreTracksContainer));
|
| 9657 |
-
// CONCATENATED MODULE: ./client/customer-effort-score-tracks/index.js
|
| 9658 |
|
|
|
|
|
|
|
|
|
|
| 9659 |
|
|
|
|
|
|
|
|
|
|
| 9660 |
|
| 9661 |
-
/***/ }),
|
| 9662 |
|
| 9663 |
-
/***/ 29:
|
| 9664 |
-
/***/ (function(module, exports) {
|
| 9665 |
|
| 9666 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9667 |
|
| 9668 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9669 |
|
| 9670 |
-
/***/ 295:
|
| 9671 |
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
| 9672 |
|
| 9673 |
-
"use strict";
|
| 9674 |
-
__webpack_require__.r(__webpack_exports__);
|
| 9675 |
-
/* WEBPACK VAR INJECTION */(function(global) {/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
|
| 9676 |
-
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
|
| 9677 |
-
/* harmony import */ var _wordpress_notices__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(470);
|
| 9678 |
-
/* harmony import */ var _woocommerce_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(22);
|
| 9679 |
-
/* harmony import */ var _woocommerce_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_woocommerce_data__WEBPACK_IMPORTED_MODULE_2__);
|
| 9680 |
-
/* harmony import */ var _stylesheets_index_scss__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(297);
|
| 9681 |
-
/* harmony import */ var _stylesheets_index_scss__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_stylesheets_index_scss__WEBPACK_IMPORTED_MODULE_3__);
|
| 9682 |
-
/* harmony import */ var _layout__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(141);
|
| 9683 |
-
/* harmony import */ var _customer_effort_score_tracks__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(287);
|
| 9684 |
|
| 9685 |
|
| 9686 |
/**
|
|
@@ -9688,6 +18739,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
| 9688 |
*/
|
| 9689 |
|
| 9690 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9691 |
|
| 9692 |
/**
|
| 9693 |
* Internal dependencies
|
|
@@ -9695,4460 +18750,4886 @@ __webpack_require__.r(__webpack_exports__);
|
|
| 9695 |
|
| 9696 |
|
| 9697 |
|
| 9698 |
-
// Modify webpack pubilcPath at runtime based on location of WordPress Plugin.
|
| 9699 |
-
// eslint-disable-next-line no-undef,camelcase
|
| 9700 |
|
| 9701 |
-
__webpack_require__.p = global.wcAdminAssets.path;
|
| 9702 |
-
var appRoot = document.getElementById('root');
|
| 9703 |
-
var embeddedRoot = document.getElementById('woocommerce-embedded-root');
|
| 9704 |
-
var settingsGroup = 'wc_admin';
|
| 9705 |
-
var hydrateUser = window.wcSettings.currentUserData;
|
| 9706 |
|
| 9707 |
-
if (appRoot) {
|
| 9708 |
-
var HydratedPageLayout = Object(_woocommerce_data__WEBPACK_IMPORTED_MODULE_2__["withSettingsHydration"])(settingsGroup, window.wcSettings)(_layout__WEBPACK_IMPORTED_MODULE_4__[/* PageLayout */ "b"]);
|
| 9709 |
-
var hydrateSettings = window.wcSettings.preloadSettings && window.wcSettings.preloadSettings.general;
|
| 9710 |
|
| 9711 |
-
|
| 9712 |
-
|
| 9713 |
-
|
| 9714 |
-
|
| 9715 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9716 |
|
| 9717 |
-
|
| 9718 |
-
HydratedPageLayout = Object(_woocommerce_data__WEBPACK_IMPORTED_MODULE_2__["withCurrentUserHydration"])(hydrateUser)(HydratedPageLayout);
|
| 9719 |
-
}
|
| 9720 |
|
| 9721 |
-
|
| 9722 |
-
|
| 9723 |
-
|
| 9724 |
|
| 9725 |
-
|
| 9726 |
-
|
| 9727 |
-
|
|
|
|
| 9728 |
|
| 9729 |
|
| 9730 |
-
|
| 9731 |
-
|
|
|
|
| 9732 |
|
| 9733 |
-
var
|
| 9734 |
-
|
| 9735 |
-
|
| 9736 |
-
|
| 9737 |
-
|
| 9738 |
-
|
| 9739 |
-
|
| 9740 |
-
|
| 9741 |
|
|
|
|
|
|
|
| 9742 |
|
| 9743 |
-
|
| 9744 |
-
|
| 9745 |
-
(
|
| 9746 |
-
|
| 9747 |
-
|
| 9748 |
-
})()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9749 |
}
|
| 9750 |
-
|
|
|
|
| 9751 |
|
| 9752 |
-
/***/ }),
|
| 9753 |
|
| 9754 |
-
|
| 9755 |
-
|
|
|
|
| 9756 |
|
| 9757 |
-
// extracted by mini-css-extract-plugin
|
| 9758 |
|
| 9759 |
-
/***/ }),
|
| 9760 |
|
| 9761 |
-
|
| 9762 |
-
|
|
|
|
|
|
|
| 9763 |
|
| 9764 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9765 |
|
| 9766 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9767 |
|
| 9768 |
-
|
| 9769 |
-
|
| 9770 |
|
| 9771 |
-
// extracted by mini-css-extract-plugin
|
| 9772 |
|
| 9773 |
-
/***/ }),
|
| 9774 |
|
| 9775 |
-
|
| 9776 |
-
|
|
|
|
|
|
|
|
|
|
| 9777 |
|
| 9778 |
-
(function() { module.exports = this["lodash"]; }());
|
| 9779 |
|
| 9780 |
-
/***/ }),
|
| 9781 |
|
| 9782 |
-
/***/ 30:
|
| 9783 |
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
| 9784 |
|
| 9785 |
-
"use strict";
|
| 9786 |
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Navigation; });
|
| 9787 |
-
/* unused harmony export NavigationBackButton */
|
| 9788 |
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return NavigationGroup; });
|
| 9789 |
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return NavigationMenu; });
|
| 9790 |
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return NavigationItem; });
|
| 9791 |
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return Text; });
|
| 9792 |
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return useSlot; });
|
| 9793 |
-
/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4);
|
| 9794 |
-
/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__);
|
| 9795 |
-
/**
|
| 9796 |
-
* External dependencies
|
| 9797 |
-
*/
|
| 9798 |
|
| 9799 |
/**
|
| 9800 |
-
*
|
| 9801 |
*/
|
| 9802 |
|
| 9803 |
-
var Navigation = _wordpress_components__WEBPACK_IMPORTED_MODULE_0__["Navigation"] || _wordpress_components__WEBPACK_IMPORTED_MODULE_0__["__experimentalNavigation"];
|
| 9804 |
-
var NavigationBackButton = _wordpress_components__WEBPACK_IMPORTED_MODULE_0__["NavigationBackButton"] || _wordpress_components__WEBPACK_IMPORTED_MODULE_0__["__experimentalNavigationBackButton"];
|
| 9805 |
-
var NavigationGroup = _wordpress_components__WEBPACK_IMPORTED_MODULE_0__["NavigationGroup"] || _wordpress_components__WEBPACK_IMPORTED_MODULE_0__["__experimentalNavigationGroup"];
|
| 9806 |
-
var NavigationMenu = _wordpress_components__WEBPACK_IMPORTED_MODULE_0__["NavigationMenu"] || _wordpress_components__WEBPACK_IMPORTED_MODULE_0__["__experimentalNavigationMenu"];
|
| 9807 |
-
var NavigationItem = _wordpress_components__WEBPACK_IMPORTED_MODULE_0__["NavigationItem"] || _wordpress_components__WEBPACK_IMPORTED_MODULE_0__["__experimentalNavigationItem"];
|
| 9808 |
-
var Text = _wordpress_components__WEBPACK_IMPORTED_MODULE_0__["Text"] || _wordpress_components__WEBPACK_IMPORTED_MODULE_0__["__experimentalText"];
|
| 9809 |
-
var useSlot = _wordpress_components__WEBPACK_IMPORTED_MODULE_0__["useSlot"] || _wordpress_components__WEBPACK_IMPORTED_MODULE_0__["__experimentalUseSlot"];
|
| 9810 |
|
| 9811 |
-
/***/ }),
|
| 9812 |
|
| 9813 |
-
/***/ 300:
|
| 9814 |
-
/***/ (function(module, exports, __webpack_require__) {
|
| 9815 |
|
| 9816 |
-
// extracted by mini-css-extract-plugin
|
| 9817 |
|
| 9818 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9819 |
|
| 9820 |
-
|
| 9821 |
-
|
|
|
|
|
|
|
| 9822 |
|
| 9823 |
-
|
|
|
|
|
|
|
|
|
|
| 9824 |
|
| 9825 |
-
|
|
|
|
| 9826 |
|
| 9827 |
-
|
| 9828 |
-
|
|
|
|
|
|
|
| 9829 |
|
| 9830 |
-
|
|
|
|
|
|
|
| 9831 |
|
| 9832 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9833 |
|
| 9834 |
-
|
| 9835 |
-
|
|
|
|
|
|
|
|
|
|
| 9836 |
|
| 9837 |
-
|
| 9838 |
|
| 9839 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9840 |
|
| 9841 |
-
|
| 9842 |
-
|
|
|
|
|
|
|
| 9843 |
|
| 9844 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9845 |
|
| 9846 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9847 |
|
| 9848 |
-
/***/ 305:
|
| 9849 |
-
/***/ (function(module, exports, __webpack_require__) {
|
| 9850 |
|
| 9851 |
-
|
|
|
|
|
|
|
| 9852 |
|
| 9853 |
-
/***/ }),
|
| 9854 |
|
| 9855 |
-
/***/ 306:
|
| 9856 |
-
/***/ (function(module, exports, __webpack_require__) {
|
| 9857 |
|
| 9858 |
-
|
|
|
|
|
|
|
| 9859 |
|
| 9860 |
-
function _inheritsLoose(subClass, superClass) {
|
| 9861 |
-
subClass.prototype = Object.create(superClass.prototype);
|
| 9862 |
-
subClass.prototype.constructor = subClass;
|
| 9863 |
-
setPrototypeOf(subClass, superClass);
|
| 9864 |
-
}
|
| 9865 |
|
| 9866 |
-
module.exports = _inheritsLoose;
|
| 9867 |
|
| 9868 |
-
/***/ }),
|
| 9869 |
|
| 9870 |
-
|
| 9871 |
-
|
|
|
|
| 9872 |
|
| 9873 |
-
|
|
|
|
| 9874 |
|
| 9875 |
/***/ }),
|
| 9876 |
|
| 9877 |
-
/***/
|
| 9878 |
-
/***/ (function(module,
|
| 9879 |
|
| 9880 |
-
|
| 9881 |
-
return Object.prototype.toString.call(arr) == '[object Array]';
|
| 9882 |
-
};
|
| 9883 |
|
|
|
|
|
|
|
| 9884 |
|
| 9885 |
-
|
| 9886 |
|
| 9887 |
-
|
| 9888 |
-
|
|
|
|
| 9889 |
|
| 9890 |
-
|
| 9891 |
-
|
|
|
|
| 9892 |
|
| 9893 |
-
|
| 9894 |
-
|
| 9895 |
-
|
| 9896 |
-
};
|
| 9897 |
-
} else {
|
| 9898 |
-
module.exports = _typeof = function _typeof(obj) {
|
| 9899 |
-
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
| 9900 |
-
};
|
| 9901 |
-
}
|
| 9902 |
|
| 9903 |
-
|
| 9904 |
-
|
| 9905 |
|
| 9906 |
-
|
|
|
|
|
|
|
| 9907 |
|
| 9908 |
-
|
|
|
|
| 9909 |
|
| 9910 |
-
|
| 9911 |
-
|
|
|
|
| 9912 |
|
| 9913 |
-
|
| 9914 |
-
|
| 9915 |
-
function _extends() {
|
| 9916 |
-
_extends = Object.assign || function (target) {
|
| 9917 |
-
for (var i = 1; i < arguments.length; i++) {
|
| 9918 |
-
var source = arguments[i];
|
| 9919 |
|
| 9920 |
-
|
| 9921 |
-
|
| 9922 |
-
target[key] = source[key];
|
| 9923 |
-
}
|
| 9924 |
-
}
|
| 9925 |
-
}
|
| 9926 |
|
| 9927 |
-
|
| 9928 |
-
|
| 9929 |
|
| 9930 |
-
|
| 9931 |
-
}
|
| 9932 |
|
| 9933 |
-
/***/ }),
|
| 9934 |
|
| 9935 |
-
/***/ 34:
|
| 9936 |
-
/***/ (function(module, exports, __webpack_require__) {
|
| 9937 |
|
| 9938 |
-
var objectWithoutPropertiesLoose = __webpack_require__(97);
|
| 9939 |
|
| 9940 |
-
function _objectWithoutProperties(source, excluded) {
|
| 9941 |
-
if (source == null) return {};
|
| 9942 |
-
var target = objectWithoutPropertiesLoose(source, excluded);
|
| 9943 |
-
var key, i;
|
| 9944 |
|
| 9945 |
-
|
| 9946 |
-
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
| 9947 |
|
| 9948 |
-
|
| 9949 |
-
key = sourceSymbolKeys[i];
|
| 9950 |
-
if (excluded.indexOf(key) >= 0) continue;
|
| 9951 |
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
| 9952 |
-
target[key] = source[key];
|
| 9953 |
-
}
|
| 9954 |
-
}
|
| 9955 |
|
| 9956 |
-
|
| 9957 |
-
|
|
|
|
| 9958 |
|
| 9959 |
-
module.exports = _objectWithoutProperties;
|
| 9960 |
|
| 9961 |
-
/***/ }),
|
| 9962 |
|
| 9963 |
-
/***/ 36:
|
| 9964 |
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
| 9965 |
|
| 9966 |
-
"use strict";
|
| 9967 |
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _defineProperty; });
|
| 9968 |
-
function _defineProperty(obj, key, value) {
|
| 9969 |
-
if (key in obj) {
|
| 9970 |
-
Object.defineProperty(obj, key, {
|
| 9971 |
-
value: value,
|
| 9972 |
-
enumerable: true,
|
| 9973 |
-
configurable: true,
|
| 9974 |
-
writable: true
|
| 9975 |
-
});
|
| 9976 |
-
} else {
|
| 9977 |
-
obj[key] = value;
|
| 9978 |
-
}
|
| 9979 |
|
| 9980 |
-
return obj;
|
| 9981 |
-
}
|
| 9982 |
|
| 9983 |
-
/***/ }),
|
| 9984 |
|
| 9985 |
-
|
| 9986 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9987 |
|
| 9988 |
-
function
|
| 9989 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9990 |
|
| 9991 |
-
|
| 9992 |
-
|
| 9993 |
-
|
|
|
|
| 9994 |
|
| 9995 |
-
|
| 9996 |
-
|
|
|
|
| 9997 |
|
| 9998 |
-
module.exports = _arrayLikeToArray;
|
| 9999 |
|
| 10000 |
-
|
|
|
|
|
|
|
| 10001 |
|
| 10002 |
-
|
| 10003 |
-
|
|
|
|
| 10004 |
|
| 10005 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10006 |
|
| 10007 |
-
|
| 10008 |
-
|
|
|
|
| 10009 |
|
| 10010 |
-
|
| 10011 |
-
|
| 10012 |
-
|
| 10013 |
-
|
| 10014 |
-
|
|
|
|
| 10015 |
};
|
| 10016 |
|
| 10017 |
-
return
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10018 |
}
|
| 10019 |
-
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js
|
| 10020 |
|
| 10021 |
-
|
| 10022 |
-
|
| 10023 |
-
|
| 10024 |
-
|
| 10025 |
-
|
| 10026 |
|
| 10027 |
-
|
|
|
|
|
|
|
|
|
|
| 10028 |
|
| 10029 |
-
|
| 10030 |
-
|
|
|
|
|
|
|
| 10031 |
|
| 10032 |
-
|
|
|
|
|
|
|
|
|
|
| 10033 |
|
| 10034 |
-
|
|
|
|
|
|
|
|
|
|
| 10035 |
|
| 10036 |
-
|
| 10037 |
-
|
|
|
|
|
|
|
| 10038 |
|
| 10039 |
-
|
|
|
|
|
|
|
|
|
|
| 10040 |
|
| 10041 |
-
|
| 10042 |
-
|
| 10043 |
-
|
| 10044 |
-
|
| 10045 |
-
|
| 10046 |
-
|
| 10047 |
-
|
| 10048 |
-
|
|
|
|
| 10049 |
|
| 10050 |
-
|
|
|
|
|
|
|
| 10051 |
|
| 10052 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10053 |
|
| 10054 |
-
|
| 10055 |
-
|
|
|
|
|
|
|
|
|
|
| 10056 |
|
| 10057 |
-
(function() { module.exports = this["wp"]["htmlEntities"]; }());
|
| 10058 |
|
| 10059 |
-
|
|
|
|
|
|
|
| 10060 |
|
| 10061 |
-
/***/ 42:
|
| 10062 |
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
| 10063 |
|
| 10064 |
-
"use strict";
|
| 10065 |
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _objectWithoutPropertiesLoose; });
|
| 10066 |
-
function _objectWithoutPropertiesLoose(source, excluded) {
|
| 10067 |
-
if (source == null) return {};
|
| 10068 |
-
var target = {};
|
| 10069 |
-
var sourceKeys = Object.keys(source);
|
| 10070 |
-
var key, i;
|
| 10071 |
|
| 10072 |
-
for (i = 0; i < sourceKeys.length; i++) {
|
| 10073 |
-
key = sourceKeys[i];
|
| 10074 |
-
if (excluded.indexOf(key) >= 0) continue;
|
| 10075 |
-
target[key] = source[key];
|
| 10076 |
-
}
|
| 10077 |
|
| 10078 |
-
|
| 10079 |
-
|
|
|
|
| 10080 |
|
| 10081 |
-
/***/ }),
|
| 10082 |
|
| 10083 |
-
|
| 10084 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10085 |
|
| 10086 |
-
|
|
|
|
|
|
|
|
|
|
| 10087 |
|
| 10088 |
-
|
|
|
|
|
|
|
| 10089 |
|
| 10090 |
-
|
| 10091 |
-
|
|
|
|
| 10092 |
|
| 10093 |
-
|
| 10094 |
-
|
| 10095 |
-
var info = gen[key](arg);
|
| 10096 |
-
var value = info.value;
|
| 10097 |
-
} catch (error) {
|
| 10098 |
-
reject(error);
|
| 10099 |
-
return;
|
| 10100 |
}
|
| 10101 |
|
| 10102 |
-
|
| 10103 |
-
|
| 10104 |
-
|
| 10105 |
-
|
| 10106 |
-
|
|
|
|
|
|
|
|
|
|
| 10107 |
}
|
| 10108 |
|
| 10109 |
-
|
| 10110 |
-
|
| 10111 |
-
|
| 10112 |
-
|
| 10113 |
-
|
| 10114 |
-
var gen = fn.apply(self, args);
|
| 10115 |
|
| 10116 |
-
|
| 10117 |
-
|
| 10118 |
-
|
|
|
|
| 10119 |
|
| 10120 |
-
|
| 10121 |
-
|
| 10122 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10123 |
|
| 10124 |
-
|
| 10125 |
-
|
|
|
|
|
|
|
|
|
|
| 10126 |
};
|
| 10127 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10128 |
|
| 10129 |
-
module.exports = _asyncToGenerator;
|
| 10130 |
|
| 10131 |
/***/ }),
|
| 10132 |
|
| 10133 |
-
/***/
|
| 10134 |
/***/ (function(module, exports) {
|
| 10135 |
|
| 10136 |
-
(function() { module.exports = this["
|
| 10137 |
|
| 10138 |
/***/ }),
|
| 10139 |
|
| 10140 |
-
/***/
|
| 10141 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
| 10142 |
|
| 10143 |
"use strict";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10144 |
|
| 10145 |
-
|
| 10146 |
-
var actions_namespaceObject = {};
|
| 10147 |
-
__webpack_require__.r(actions_namespaceObject);
|
| 10148 |
-
__webpack_require__.d(actions_namespaceObject, "createNotice", function() { return createNotice; });
|
| 10149 |
-
__webpack_require__.d(actions_namespaceObject, "createSuccessNotice", function() { return createSuccessNotice; });
|
| 10150 |
-
__webpack_require__.d(actions_namespaceObject, "createInfoNotice", function() { return createInfoNotice; });
|
| 10151 |
-
__webpack_require__.d(actions_namespaceObject, "createErrorNotice", function() { return createErrorNotice; });
|
| 10152 |
-
__webpack_require__.d(actions_namespaceObject, "createWarningNotice", function() { return createWarningNotice; });
|
| 10153 |
-
__webpack_require__.d(actions_namespaceObject, "removeNotice", function() { return removeNotice; });
|
| 10154 |
|
| 10155 |
-
|
| 10156 |
-
|
| 10157 |
-
__webpack_require__.r(selectors_namespaceObject);
|
| 10158 |
-
__webpack_require__.d(selectors_namespaceObject, "getNotices", function() { return getNotices; });
|
| 10159 |
|
| 10160 |
-
|
| 10161 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10162 |
|
| 10163 |
-
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js + 3 modules
|
| 10164 |
-
var toConsumableArray = __webpack_require__(82);
|
| 10165 |
|
| 10166 |
-
|
| 10167 |
-
|
|
|
|
| 10168 |
|
| 10169 |
-
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
|
| 10170 |
-
var defineProperty = __webpack_require__(36);
|
| 10171 |
|
| 10172 |
-
// CONCATENATED MODULE: ./node_modules/@wordpress/notices/build-module/store/utils/on-sub-key.js
|
| 10173 |
|
|
|
|
|
|
|
|
|
|
| 10174 |
|
| 10175 |
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
| 10176 |
|
| 10177 |
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
| 10178 |
|
| 10179 |
-
/**
|
| 10180 |
-
* Higher-order reducer creator which creates a combined reducer object, keyed
|
| 10181 |
-
* by a property on the action object.
|
| 10182 |
-
*
|
| 10183 |
-
* @param {string} actionProperty Action property by which to key object.
|
| 10184 |
-
*
|
| 10185 |
-
* @return {Function} Higher-order reducer.
|
| 10186 |
-
*/
|
| 10187 |
-
var on_sub_key_onSubKey = function onSubKey(actionProperty) {
|
| 10188 |
-
return function (reducer) {
|
| 10189 |
-
return function () {
|
| 10190 |
-
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
| 10191 |
-
var action = arguments.length > 1 ? arguments[1] : undefined;
|
| 10192 |
-
// Retrieve subkey from action. Do not track if undefined; useful for cases
|
| 10193 |
-
// where reducer is scoped by action shape.
|
| 10194 |
-
var key = action[actionProperty];
|
| 10195 |
|
| 10196 |
-
|
| 10197 |
-
|
| 10198 |
-
} // Avoid updating state if unchanged. Note that this also accounts for a
|
| 10199 |
-
// reducer which returns undefined on a key which is not yet tracked.
|
| 10200 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10201 |
|
| 10202 |
-
|
|
|
|
|
|
|
| 10203 |
|
| 10204 |
-
|
| 10205 |
-
|
| 10206 |
-
|
|
|
|
|
|
|
| 10207 |
|
| 10208 |
-
|
| 10209 |
-
|
| 10210 |
-
}
|
| 10211 |
-
};
|
| 10212 |
-
/* harmony default export */ var on_sub_key = (on_sub_key_onSubKey);
|
| 10213 |
-
//# sourceMappingURL=on-sub-key.js.map
|
| 10214 |
-
// CONCATENATED MODULE: ./node_modules/@wordpress/notices/build-module/store/reducer.js
|
| 10215 |
|
|
|
|
|
|
|
|
|
|
| 10216 |
|
| 10217 |
-
|
| 10218 |
-
|
| 10219 |
-
|
| 10220 |
|
| 10221 |
-
|
| 10222 |
-
|
| 10223 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10224 |
|
| 10225 |
|
| 10226 |
-
|
| 10227 |
-
|
| 10228 |
-
|
| 10229 |
-
|
| 10230 |
-
|
| 10231 |
-
* @param {Object} action Dispatched action.
|
| 10232 |
-
*
|
| 10233 |
-
* @return {Object} Updated state.
|
| 10234 |
-
*/
|
| 10235 |
|
| 10236 |
-
|
| 10237 |
-
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
| 10238 |
-
var action = arguments.length > 1 ? arguments[1] : undefined;
|
| 10239 |
|
| 10240 |
-
|
| 10241 |
-
|
| 10242 |
-
// Avoid duplicates on ID.
|
| 10243 |
-
return [].concat(Object(toConsumableArray["a" /* default */])(Object(external_lodash_["reject"])(state, {
|
| 10244 |
-
id: action.notice.id
|
| 10245 |
-
})), [action.notice]);
|
| 10246 |
|
| 10247 |
-
|
| 10248 |
-
return Object(external_lodash_["reject"])(state, {
|
| 10249 |
-
id: action.id
|
| 10250 |
-
});
|
| 10251 |
-
}
|
| 10252 |
|
| 10253 |
-
|
| 10254 |
-
});
|
| 10255 |
-
/* harmony default export */ var store_reducer = (notices);
|
| 10256 |
-
//# sourceMappingURL=reducer.js.map
|
| 10257 |
-
// EXTERNAL MODULE: ./node_modules/@babel/runtime/regenerator/index.js
|
| 10258 |
-
var regenerator = __webpack_require__(8);
|
| 10259 |
-
var regenerator_default = /*#__PURE__*/__webpack_require__.n(regenerator);
|
| 10260 |
|
| 10261 |
-
|
| 10262 |
-
|
| 10263 |
-
* Default context to use for notice grouping when not otherwise specified. Its
|
| 10264 |
-
* specific value doesn't hold much meaning, but it must be reasonably unique
|
| 10265 |
-
* and, more importantly, referenced consistently in the store implementation.
|
| 10266 |
-
*
|
| 10267 |
-
* @type {string}
|
| 10268 |
-
*/
|
| 10269 |
-
var DEFAULT_CONTEXT = 'global';
|
| 10270 |
-
/**
|
| 10271 |
-
* Default notice status.
|
| 10272 |
-
*
|
| 10273 |
-
* @type {string}
|
| 10274 |
-
*/
|
| 10275 |
|
| 10276 |
-
|
| 10277 |
-
//# sourceMappingURL=constants.js.map
|
| 10278 |
-
// CONCATENATED MODULE: ./node_modules/@wordpress/notices/build-module/store/actions.js
|
| 10279 |
|
|
|
|
| 10280 |
|
| 10281 |
-
|
| 10282 |
-
|
| 10283 |
-
regenerator_default.a.mark(createNotice);
|
| 10284 |
|
| 10285 |
-
|
| 10286 |
-
* External dependencies
|
| 10287 |
-
*/
|
| 10288 |
|
| 10289 |
-
|
| 10290 |
-
* Internal dependencies
|
| 10291 |
-
*/
|
| 10292 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10293 |
|
| 10294 |
-
/**
|
| 10295 |
-
* @typedef {Object} WPNoticeAction Object describing a user action option associated with a notice.
|
| 10296 |
-
*
|
| 10297 |
-
* @property {string} label Message to use as action label.
|
| 10298 |
-
* @property {?string} url Optional URL of resource if action incurs
|
| 10299 |
-
* browser navigation.
|
| 10300 |
-
* @property {?Function} onClick Optional function to invoke when action is
|
| 10301 |
-
* triggered by user.
|
| 10302 |
-
*
|
| 10303 |
-
*/
|
| 10304 |
|
| 10305 |
/**
|
| 10306 |
-
*
|
| 10307 |
-
*
|
| 10308 |
-
* @param {string} [status='info'] Notice status.
|
| 10309 |
-
* @param {string} content Notice message.
|
| 10310 |
-
* @param {Object} [options] Notice options.
|
| 10311 |
-
* @param {string} [options.context='global'] Context under which to
|
| 10312 |
-
* group notice.
|
| 10313 |
-
* @param {string} [options.id] Identifier for notice.
|
| 10314 |
-
* Automatically assigned
|
| 10315 |
-
* if not specified.
|
| 10316 |
-
* @param {boolean} [options.isDismissible=true] Whether the notice can
|
| 10317 |
-
* be dismissed by user.
|
| 10318 |
-
* @param {string} [options.type='default'] Type of notice, one of
|
| 10319 |
-
* `default`, or `snackbar`.
|
| 10320 |
-
* @param {boolean} [options.speak=true] Whether the notice
|
| 10321 |
-
* content should be
|
| 10322 |
-
* announced to screen
|
| 10323 |
-
* readers.
|
| 10324 |
-
* @param {Array<WPNoticeAction>} [options.actions] User actions to be
|
| 10325 |
-
* presented with notice.
|
| 10326 |
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10327 |
|
| 10328 |
-
|
| 10329 |
-
|
| 10330 |
-
|
| 10331 |
-
|
| 10332 |
-
|
| 10333 |
-
|
| 10334 |
-
|
| 10335 |
-
|
| 10336 |
-
|
| 10337 |
-
context,
|
| 10338 |
-
_options$id,
|
| 10339 |
-
id,
|
| 10340 |
-
_options$actions,
|
| 10341 |
-
actions,
|
| 10342 |
-
_options$type,
|
| 10343 |
-
type,
|
| 10344 |
-
__unstableHTML,
|
| 10345 |
-
_args = arguments;
|
| 10346 |
|
| 10347 |
-
|
| 10348 |
-
|
| 10349 |
-
|
| 10350 |
-
|
| 10351 |
-
|
| 10352 |
-
|
| 10353 |
-
options = _args.length > 2 && _args[2] !== undefined ? _args[2] : {};
|
| 10354 |
-
_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, _options$type = options.type, type = _options$type === void 0 ? 'default' : _options$type, __unstableHTML = options.__unstableHTML; // The supported value shape of content is currently limited to plain text
|
| 10355 |
-
// strings. To avoid setting expectation that e.g. a WPElement could be
|
| 10356 |
-
// supported, cast to a string.
|
| 10357 |
|
| 10358 |
-
|
|
|
|
| 10359 |
|
| 10360 |
-
|
| 10361 |
-
|
| 10362 |
-
|
| 10363 |
-
|
|
|
|
|
|
|
| 10364 |
|
| 10365 |
-
|
| 10366 |
-
return {
|
| 10367 |
-
type: 'SPEAK',
|
| 10368 |
-
message: content,
|
| 10369 |
-
ariaLive: type === 'snackbar' ? 'polite' : 'assertive'
|
| 10370 |
-
};
|
| 10371 |
|
| 10372 |
-
|
| 10373 |
-
|
| 10374 |
-
|
| 10375 |
-
|
| 10376 |
-
|
| 10377 |
-
|
| 10378 |
-
|
| 10379 |
-
|
| 10380 |
-
|
| 10381 |
-
|
| 10382 |
-
|
| 10383 |
-
actions: actions,
|
| 10384 |
-
type: type
|
| 10385 |
}
|
| 10386 |
-
|
| 10387 |
|
| 10388 |
-
|
| 10389 |
-
case "end":
|
| 10390 |
-
return _context.stop();
|
| 10391 |
-
}
|
| 10392 |
}
|
| 10393 |
-
|
|
|
|
| 10394 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10395 |
/**
|
| 10396 |
-
*
|
| 10397 |
-
* created. Refer to `createNotice` for options documentation.
|
| 10398 |
-
*
|
| 10399 |
-
* @see createNotice
|
| 10400 |
-
*
|
| 10401 |
-
* @param {string} content Notice message.
|
| 10402 |
-
* @param {Object} [options] Optional notice options.
|
| 10403 |
-
*
|
| 10404 |
-
* @return {Object} Action object.
|
| 10405 |
*/
|
| 10406 |
|
| 10407 |
-
function createSuccessNotice(content, options) {
|
| 10408 |
-
return createNotice('success', content, options);
|
| 10409 |
-
}
|
| 10410 |
/**
|
| 10411 |
-
*
|
| 10412 |
-
*
|
| 10413 |
-
*
|
| 10414 |
-
* @see createNotice
|
| 10415 |
-
*
|
| 10416 |
-
* @param {string} content Notice message.
|
| 10417 |
-
* @param {Object} [options] Optional notice options.
|
| 10418 |
*
|
| 10419 |
-
* @
|
| 10420 |
*/
|
| 10421 |
|
| 10422 |
-
|
| 10423 |
-
return createNotice('info', content, options);
|
| 10424 |
-
}
|
| 10425 |
/**
|
| 10426 |
-
*
|
| 10427 |
-
* created. Refer to `createNotice` for options documentation.
|
| 10428 |
*
|
| 10429 |
-
* @
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10430 |
*
|
| 10431 |
-
* @
|
| 10432 |
-
*
|
|
|
|
| 10433 |
*
|
| 10434 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10435 |
*/
|
| 10436 |
|
| 10437 |
-
function
|
| 10438 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10439 |
}
|
| 10440 |
-
|
| 10441 |
-
|
| 10442 |
-
|
| 10443 |
-
|
| 10444 |
-
|
| 10445 |
-
|
| 10446 |
-
|
| 10447 |
-
|
| 10448 |
-
|
| 10449 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10450 |
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10451 |
|
| 10452 |
-
function createWarningNotice(content, options) {
|
| 10453 |
-
return createNotice('warning', content, options);
|
| 10454 |
-
}
|
| 10455 |
/**
|
| 10456 |
-
*
|
| 10457 |
*
|
| 10458 |
-
* @param {
|
| 10459 |
-
*
|
| 10460 |
-
*
|
| 10461 |
*
|
| 10462 |
-
* @return {
|
| 10463 |
*/
|
| 10464 |
|
| 10465 |
-
function
|
| 10466 |
-
var
|
| 10467 |
-
|
| 10468 |
-
|
| 10469 |
-
|
| 10470 |
-
|
| 10471 |
-
|
|
|
|
|
|
|
|
|
|
| 10472 |
}
|
| 10473 |
-
//# sourceMappingURL=actions.js.map
|
| 10474 |
-
// CONCATENATED MODULE: ./node_modules/@wordpress/notices/build-module/store/selectors.js
|
| 10475 |
-
/**
|
| 10476 |
-
* Internal dependencies
|
| 10477 |
-
*/
|
| 10478 |
|
| 10479 |
-
|
|
|
|
| 10480 |
|
| 10481 |
-
|
| 10482 |
-
|
| 10483 |
-
|
| 10484 |
-
|
| 10485 |
-
|
| 10486 |
-
|
| 10487 |
-
|
| 10488 |
-
|
| 10489 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10490 |
|
| 10491 |
-
var DEFAULT_NOTICES = [];
|
| 10492 |
/**
|
| 10493 |
-
*
|
| 10494 |
-
*
|
| 10495 |
-
* @property {string} id Unique identifier of notice.
|
| 10496 |
-
* @property {string} status Status of notice, one of `success`,
|
| 10497 |
-
* `info`, `error`, or `warning`. Defaults
|
| 10498 |
-
* to `info`.
|
| 10499 |
-
* @property {string} content Notice message.
|
| 10500 |
-
* @property {string} __unstableHTML Notice message as raw HTML. Intended to
|
| 10501 |
-
* serve primarily for compatibility of
|
| 10502 |
-
* server-rendered notices, and SHOULD NOT
|
| 10503 |
-
* be used for notices. It is subject to
|
| 10504 |
-
* removal without notice.
|
| 10505 |
-
* @property {boolean} isDismissible Whether the notice can be dismissed by
|
| 10506 |
-
* user. Defaults to `true`.
|
| 10507 |
-
* @property {string} type Type of notice, one of `default`,
|
| 10508 |
-
* or `snackbar`. Defaults to `default`.
|
| 10509 |
-
* @property {boolean} speak Whether the notice content should be
|
| 10510 |
-
* announced to screen readers. Defaults to
|
| 10511 |
-
* `true`.
|
| 10512 |
-
* @property {WPNoticeAction[]} actions User actions to present with notice.
|
| 10513 |
-
*
|
| 10514 |
*/
|
| 10515 |
|
|
|
|
|
|
|
| 10516 |
/**
|
| 10517 |
-
*
|
| 10518 |
-
* the global context.
|
| 10519 |
*
|
| 10520 |
-
* @param {
|
| 10521 |
-
*
|
|
|
|
| 10522 |
*
|
| 10523 |
-
* @return {
|
| 10524 |
*/
|
| 10525 |
|
| 10526 |
-
function
|
| 10527 |
-
var
|
| 10528 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10529 |
}
|
| 10530 |
-
//# sourceMappingURL=selectors.js.map
|
| 10531 |
-
// EXTERNAL MODULE: ./node_modules/@wordpress/a11y/build-module/index.js + 4 modules
|
| 10532 |
-
var build_module = __webpack_require__(140);
|
| 10533 |
|
| 10534 |
-
|
| 10535 |
-
|
| 10536 |
-
* WordPress dependencies
|
| 10537 |
-
*/
|
| 10538 |
|
| 10539 |
-
|
| 10540 |
-
|
| 10541 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10542 |
}
|
| 10543 |
-
});
|
| 10544 |
-
//# sourceMappingURL=controls.js.map
|
| 10545 |
-
// CONCATENATED MODULE: ./node_modules/@wordpress/notices/build-module/store/index.js
|
| 10546 |
-
/**
|
| 10547 |
-
* WordPress dependencies
|
| 10548 |
-
*/
|
| 10549 |
|
| 10550 |
-
|
| 10551 |
-
|
| 10552 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10553 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10554 |
|
|
|
|
|
|
|
|
|
|
| 10555 |
|
|
|
|
|
|
|
| 10556 |
|
|
|
|
| 10557 |
|
| 10558 |
-
|
| 10559 |
-
|
| 10560 |
-
|
| 10561 |
-
|
| 10562 |
-
|
| 10563 |
-
})
|
| 10564 |
-
|
| 10565 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10566 |
/**
|
| 10567 |
-
*
|
| 10568 |
*/
|
| 10569 |
|
| 10570 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10571 |
|
| 10572 |
/***/ }),
|
| 10573 |
|
| 10574 |
-
/***/
|
| 10575 |
/***/ (function(module, exports) {
|
| 10576 |
|
| 10577 |
-
(function() { module.exports = this["wc"]["
|
| 10578 |
|
| 10579 |
/***/ }),
|
| 10580 |
|
| 10581 |
-
/***/
|
| 10582 |
-
/***/ (function(module,
|
| 10583 |
|
| 10584 |
"use strict";
|
| 10585 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10586 |
|
| 10587 |
-
|
| 10588 |
-
var parse = __webpack_require__(91);
|
| 10589 |
-
var formats = __webpack_require__(52);
|
| 10590 |
|
| 10591 |
-
|
| 10592 |
-
|
| 10593 |
-
parse: parse,
|
| 10594 |
-
stringify: stringify
|
| 10595 |
-
};
|
| 10596 |
|
|
|
|
|
|
|
| 10597 |
|
| 10598 |
-
|
|
|
|
| 10599 |
|
| 10600 |
-
|
| 10601 |
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
| 10602 |
|
| 10603 |
-
|
| 10604 |
-
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
|
| 10605 |
-
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
|
| 10606 |
-
/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(67);
|
| 10607 |
|
|
|
|
|
|
|
| 10608 |
|
| 10609 |
-
|
| 10610 |
-
* WordPress dependencies
|
| 10611 |
-
*/
|
| 10612 |
|
| 10613 |
-
|
| 10614 |
-
xmlns: "http://www.w3.org/2000/svg",
|
| 10615 |
-
viewBox: "0 0 24 24"
|
| 10616 |
-
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__[/* Path */ "a"], {
|
| 10617 |
-
d: "M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"
|
| 10618 |
-
}));
|
| 10619 |
-
/* harmony default export */ __webpack_exports__["a"] = (close);
|
| 10620 |
-
//# sourceMappingURL=close.js.map
|
| 10621 |
|
| 10622 |
-
|
| 10623 |
|
| 10624 |
-
|
| 10625 |
-
|
| 10626 |
|
| 10627 |
-
|
| 10628 |
-
|
| 10629 |
-
|
| 10630 |
-
|
| 10631 |
-
|
| 10632 |
-
|
| 10633 |
-
|
| 10634 |
-
|
| 10635 |
-
|
| 10636 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10637 |
}
|
| 10638 |
|
| 10639 |
-
|
|
|
|
| 10640 |
}
|
| 10641 |
|
| 10642 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10643 |
|
| 10644 |
-
|
| 10645 |
|
| 10646 |
-
|
| 10647 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10648 |
|
| 10649 |
-
|
| 10650 |
|
| 10651 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10652 |
|
| 10653 |
-
|
| 10654 |
-
|
|
|
|
| 10655 |
|
| 10656 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10657 |
|
|
|
|
|
|
|
| 10658 |
|
| 10659 |
-
|
| 10660 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10661 |
|
| 10662 |
-
|
| 10663 |
-
|
| 10664 |
-
RFC3986: 'RFC3986'
|
| 10665 |
-
};
|
| 10666 |
|
| 10667 |
-
module.exports = {
|
| 10668 |
-
'default': Format.RFC3986,
|
| 10669 |
-
formatters: {
|
| 10670 |
-
RFC1738: function (value) {
|
| 10671 |
-
return replace.call(value, percentTwenties, '+');
|
| 10672 |
-
},
|
| 10673 |
-
RFC3986: function (value) {
|
| 10674 |
-
return String(value);
|
| 10675 |
-
}
|
| 10676 |
-
},
|
| 10677 |
-
RFC1738: Format.RFC1738,
|
| 10678 |
-
RFC3986: Format.RFC3986
|
| 10679 |
-
};
|
| 10680 |
|
| 10681 |
|
| 10682 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10683 |
|
| 10684 |
-
|
| 10685 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10686 |
|
| 10687 |
-
|
| 10688 |
-
|
| 10689 |
-
|
| 10690 |
-
* @typedef {() => void} Callback
|
| 10691 |
-
*
|
| 10692 |
-
* TODO: Remove this typedef and inline `() => void` type.
|
| 10693 |
-
*
|
| 10694 |
-
* This typedef is used so that a descriptive type is provided in our
|
| 10695 |
-
* automatically generated documentation.
|
| 10696 |
-
*
|
| 10697 |
-
* An in-line type `() => void` would be preferable, but the generated
|
| 10698 |
-
* documentation is `null` in that case.
|
| 10699 |
-
*
|
| 10700 |
-
* @see https://github.com/WordPress/gutenberg/issues/18045
|
| 10701 |
-
*/
|
| 10702 |
|
| 10703 |
-
|
| 10704 |
-
|
| 10705 |
-
*
|
| 10706 |
-
* @param {Callback} callback A function to execute after the DOM is ready.
|
| 10707 |
-
*
|
| 10708 |
-
* @example
|
| 10709 |
-
* ```js
|
| 10710 |
-
* import domReady from '@wordpress/dom-ready';
|
| 10711 |
-
*
|
| 10712 |
-
* domReady( function() {
|
| 10713 |
-
* //do something after DOM loads.
|
| 10714 |
-
* } );
|
| 10715 |
-
* ```
|
| 10716 |
-
*
|
| 10717 |
-
* @return {void}
|
| 10718 |
-
*/
|
| 10719 |
-
function domReady(callback) {
|
| 10720 |
-
if (document.readyState === 'complete' || // DOMContentLoaded + Images/Styles/etc loaded, so we call directly.
|
| 10721 |
-
document.readyState === 'interactive' // DOMContentLoaded fires at this point, so we call directly.
|
| 10722 |
-
) {
|
| 10723 |
-
return void callback();
|
| 10724 |
-
} // DOMContentLoaded has not fired yet, delay callback until then.
|
| 10725 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10726 |
|
| 10727 |
-
|
| 10728 |
-
|
| 10729 |
-
|
|
|
|
|
|
|
| 10730 |
|
| 10731 |
-
|
|
|
|
|
|
|
| 10732 |
|
| 10733 |
-
|
| 10734 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10735 |
|
| 10736 |
-
|
| 10737 |
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _objectWithoutProperties; });
|
| 10738 |
-
/* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(42);
|
| 10739 |
|
| 10740 |
-
|
| 10741 |
-
|
| 10742 |
-
|
| 10743 |
-
|
|
|
|
| 10744 |
|
| 10745 |
-
|
| 10746 |
-
|
| 10747 |
|
| 10748 |
-
|
| 10749 |
-
|
| 10750 |
-
if (excluded.indexOf(key) >= 0) continue;
|
| 10751 |
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
| 10752 |
-
target[key] = source[key];
|
| 10753 |
-
}
|
| 10754 |
-
}
|
| 10755 |
|
| 10756 |
-
|
| 10757 |
-
}
|
| 10758 |
|
| 10759 |
-
|
| 10760 |
|
| 10761 |
-
|
| 10762 |
-
|
| 10763 |
|
| 10764 |
-
"use strict";
|
| 10765 |
-
var isProduction
|
| 35 |
/******/
|
| 36 |
/******/ // object to store loaded CSS chunks
|
| 37 |
/******/ var installedCssChunks = {
|
| 38 |
+
/******/ 25: 0
|
| 39 |
/******/ }
|
| 40 |
/******/ var isCssRtlEnabled = function() {
|
| 41 |
/******/ return document.dir === 'rtl';
|
| 45 |
/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
|
| 46 |
/******/ // Promise = chunk loading, 0 = chunk loaded
|
| 47 |
/******/ var installedChunks = {
|
| 48 |
+
/******/ 25: 0
|
| 49 |
/******/ };
|
| 50 |
/******/
|
| 51 |
/******/
|
| 52 |
/******/
|
| 53 |
/******/ // script path function
|
| 54 |
/******/ function webpackJsonpScriptSrc(chunkId) {
|
| 55 |
+
/******/ return __webpack_require__.p + "chunks/" + ({"10":"activity-panels-help","11":"activity-panels-inbox","12":"activity-panels-stock","13":"analytics-report","14":"analytics-report-categories","15":"analytics-report-coupons","16":"analytics-report-customers","17":"analytics-report-downloads","18":"analytics-report-orders","19":"analytics-report-products","20":"analytics-report-revenue","21":"analytics-report-stock","22":"analytics-report-taxes","23":"analytics-report-variations","24":"analytics-settings","30":"customizable-dashboard","31":"dashboard","32":"dashboard-charts","35":"homescreen","37":"leaderboards","39":"marketing-overview","47":"profile-wizard","48":"store-alerts","49":"store-performance","50":"task-list"}[chunkId]||chunkId) + ".js"
|
| 56 |
/******/ }
|
| 57 |
/******/
|
| 58 |
/******/ function jsonpScriptSrc(chunkId) {
|
| 95 |
/******/
|
| 96 |
/******/
|
| 97 |
/******/ // mini-css-extract-plugin CSS loading
|
| 98 |
+
/******/ var cssChunks = {"0":1,"7":1,"10":1,"11":1,"12":1,"13":1,"18":1,"24":1,"31":1,"32":1,"35":1,"37":1,"39":1,"47":1,"48":1,"49":1};
|
| 99 |
/******/ if(installedCssChunks[chunkId]) promises.push(installedCssChunks[chunkId]);
|
| 100 |
/******/ else if(installedCssChunks[chunkId] !== 0 && cssChunks[chunkId]) {
|
| 101 |
/******/ promises.push(installedCssChunks[chunkId] = new Promise(function(resolve, reject) {
|
| 259 |
/******/
|
| 260 |
/******/
|
| 261 |
/******/ // Load entry module and return exports
|
| 262 |
+
/******/ return __webpack_require__(__webpack_require__.s = 561);
|
| 263 |
/******/ })
|
| 264 |
/************************************************************************/
|
| 265 |
/******/ ({
|
| 284 |
if (false) { var throwOnDirectAccess, ReactIs; } else {
|
| 285 |
// By explicitly using `prop-types` you are opting into new production behavior.
|
| 286 |
// http://fb.me/prop-types-in-prod
|
| 287 |
+
module.exports = __webpack_require__(138)();
|
| 288 |
}
|
| 289 |
|
| 290 |
|
| 291 |
/***/ }),
|
| 292 |
|
| 293 |
/***/ 10:
|
| 294 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
| 295 |
|
| 296 |
+
"use strict";
|
| 297 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _getPrototypeOf; });
|
| 298 |
+
function _getPrototypeOf(o) {
|
| 299 |
+
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
|
| 300 |
+
return o.__proto__ || Object.getPrototypeOf(o);
|
| 301 |
+
};
|
| 302 |
+
return _getPrototypeOf(o);
|
| 303 |
+
}
|
| 304 |
|
| 305 |
/***/ }),
|
| 306 |
|
| 307 |
+
/***/ 100:
|
| 308 |
/***/ (function(module, exports) {
|
| 309 |
|
| 310 |
+
(function() { module.exports = this["ReactDOM"]; }());
|
| 311 |
|
| 312 |
/***/ }),
|
| 313 |
|
| 314 |
+
/***/ 101:
|
| 315 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
| 316 |
|
| 317 |
+
"use strict";
|
| 318 |
|
| 319 |
+
// EXPORTS
|
| 320 |
+
__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ get_get; });
|
| 321 |
|
| 322 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js
|
| 323 |
+
var getPrototypeOf = __webpack_require__(10);
|
| 324 |
|
| 325 |
+
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/superPropBase.js
|
| 326 |
+
|
| 327 |
+
function _superPropBase(object, property) {
|
| 328 |
+
while (!Object.prototype.hasOwnProperty.call(object, property)) {
|
| 329 |
+
object = Object(getPrototypeOf["a" /* default */])(object);
|
| 330 |
+
if (object === null) break;
|
| 331 |
}
|
| 332 |
+
|
| 333 |
+
return object;
|
| 334 |
}
|
| 335 |
+
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/get.js
|
| 336 |
|
| 337 |
+
function get_get(target, property, receiver) {
|
| 338 |
+
if (typeof Reflect !== "undefined" && Reflect.get) {
|
| 339 |
+
get_get = Reflect.get;
|
| 340 |
+
} else {
|
| 341 |
+
get_get = function _get(target, property, receiver) {
|
| 342 |
+
var base = _superPropBase(target, property);
|
| 343 |
+
if (!base) return;
|
| 344 |
+
var desc = Object.getOwnPropertyDescriptor(base, property);
|
| 345 |
+
|
| 346 |
+
if (desc.get) {
|
| 347 |
+
return desc.get.call(receiver);
|
| 348 |
+
}
|
| 349 |
+
|
| 350 |
+
return desc.value;
|
| 351 |
+
};
|
| 352 |
+
}
|
| 353 |
+
|
| 354 |
+
return get_get(target, property, receiver || target);
|
| 355 |
+
}
|
| 356 |
|
| 357 |
/***/ }),
|
| 358 |
|
| 359 |
+
/***/ 102:
|
| 360 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
| 361 |
|
| 362 |
"use strict";
|
| 363 |
+
function memoize(fn) {
|
| 364 |
+
var cache = {};
|
| 365 |
+
return function (arg) {
|
| 366 |
+
if (cache[arg] === undefined) cache[arg] = fn(arg);
|
| 367 |
+
return cache[arg];
|
| 368 |
+
};
|
| 369 |
+
}
|
| 370 |
|
| 371 |
+
/* harmony default export */ __webpack_exports__["a"] = (memoize);
|
|
|
|
|
|
|
|
|
|
| 372 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 373 |
|
| 374 |
+
/***/ }),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 375 |
|
| 376 |
+
/***/ 103:
|
| 377 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 378 |
|
| 379 |
+
"use strict";
|
| 380 |
+
var isProduction = "production" === 'production';
|
| 381 |
+
var prefix = 'Invariant failed';
|
| 382 |
+
function invariant(condition, message) {
|
| 383 |
+
if (condition) {
|
| 384 |
+
return;
|
| 385 |
+
}
|
| 386 |
+
if (isProduction) {
|
| 387 |
+
throw new Error(prefix);
|
| 388 |
+
}
|
| 389 |
+
throw new Error(prefix + ": " + (message || ''));
|
| 390 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 391 |
|
| 392 |
+
/* harmony default export */ __webpack_exports__["a"] = (invariant);
|
| 393 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 394 |
|
| 395 |
+
/***/ }),
|
| 396 |
|
| 397 |
+
/***/ 11:
|
| 398 |
+
/***/ (function(module, exports) {
|
| 399 |
|
| 400 |
+
function _assertThisInitialized(self) {
|
| 401 |
+
if (self === void 0) {
|
| 402 |
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
| 403 |
}
|
| 404 |
|
| 405 |
+
return self;
|
|
|
|
| 406 |
}
|
| 407 |
+
|
| 408 |
+
module.exports = _assertThisInitialized;
|
| 409 |
+
|
| 410 |
+
/***/ }),
|
| 411 |
+
|
| 412 |
+
/***/ 112:
|
| 413 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
| 414 |
+
|
| 415 |
+
"use strict";
|
| 416 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return useMediaQuery; });
|
| 417 |
+
/* harmony import */ var _babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(26);
|
| 418 |
+
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(0);
|
| 419 |
+
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);
|
| 420 |
+
|
| 421 |
+
|
| 422 |
/**
|
| 423 |
+
* WordPress dependencies
|
| 424 |
+
*/
|
| 425 |
+
|
| 426 |
+
/**
|
| 427 |
+
* Runs a media query and returns its value when it changes.
|
| 428 |
*
|
| 429 |
+
* @param {string} [query] Media Query.
|
| 430 |
+
* @return {boolean} return value of the media query.
|
| 431 |
*/
|
| 432 |
|
| 433 |
+
function useMediaQuery(query) {
|
| 434 |
+
var _useState = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["useState"])(query && window.matchMedia(query).matches),
|
| 435 |
+
_useState2 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(_useState, 2),
|
| 436 |
+
match = _useState2[0],
|
| 437 |
+
setMatch = _useState2[1];
|
| 438 |
|
| 439 |
+
Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["useEffect"])(function () {
|
| 440 |
+
if (!query) {
|
| 441 |
+
return;
|
|
|
|
|
|
|
| 442 |
}
|
| 443 |
|
| 444 |
+
var updateMatch = function updateMatch() {
|
| 445 |
+
return setMatch(window.matchMedia(query).matches);
|
| 446 |
+
};
|
|
|
|
|
|
|
| 447 |
|
| 448 |
+
updateMatch();
|
| 449 |
+
var list = window.matchMedia(query);
|
| 450 |
+
list.addListener(updateMatch);
|
| 451 |
+
return function () {
|
| 452 |
+
list.removeListener(updateMatch);
|
| 453 |
+
};
|
| 454 |
+
}, [query]);
|
| 455 |
+
return query && match;
|
| 456 |
}
|
| 457 |
+
//# sourceMappingURL=index.js.map
|
| 458 |
+
|
| 459 |
+
/***/ }),
|
| 460 |
+
|
| 461 |
+
/***/ 114:
|
| 462 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
| 463 |
+
|
| 464 |
+
"use strict";
|
| 465 |
+
|
| 466 |
+
// EXPORTS
|
| 467 |
+
__webpack_require__.d(__webpack_exports__, "b", function() { return /* binding */ slot_fill_Slot; });
|
| 468 |
+
__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ slot_fill_Fill; });
|
| 469 |
+
|
| 470 |
+
// UNUSED EXPORTS: createSlotFill, useSlot, Provider
|
| 471 |
+
|
| 472 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
|
| 473 |
+
var esm_extends = __webpack_require__(7);
|
| 474 |
+
|
| 475 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js
|
| 476 |
+
var objectWithoutProperties = __webpack_require__(12);
|
| 477 |
+
|
| 478 |
+
// EXTERNAL MODULE: external {"this":["wp","element"]}
|
| 479 |
+
var external_this_wp_element_ = __webpack_require__(0);
|
| 480 |
+
|
| 481 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js
|
| 482 |
+
var classCallCheck = __webpack_require__(21);
|
| 483 |
+
|
| 484 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/createClass.js
|
| 485 |
+
var createClass = __webpack_require__(22);
|
| 486 |
+
|
| 487 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js
|
| 488 |
+
var assertThisInitialized = __webpack_require__(13);
|
| 489 |
+
|
| 490 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/get.js + 1 modules
|
| 491 |
+
var get = __webpack_require__(101);
|
| 492 |
+
|
| 493 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/inherits.js + 1 modules
|
| 494 |
+
var inherits = __webpack_require__(23);
|
| 495 |
+
|
| 496 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js
|
| 497 |
+
var possibleConstructorReturn = __webpack_require__(24);
|
| 498 |
+
|
| 499 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js
|
| 500 |
+
var getPrototypeOf = __webpack_require__(10);
|
| 501 |
+
|
| 502 |
// EXTERNAL MODULE: external "lodash"
|
| 503 |
+
var external_lodash_ = __webpack_require__(2);
|
| 504 |
+
|
| 505 |
+
// EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/context.js + 1 modules
|
| 506 |
+
var context = __webpack_require__(53);
|
| 507 |
+
|
| 508 |
+
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/slot.js
|
| 509 |
+
|
| 510 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 511 |
|
|
|
|
|
|
|
|
|
|
| 512 |
|
| 513 |
|
| 514 |
+
|
| 515 |
+
|
| 516 |
+
|
| 517 |
+
|
| 518 |
+
|
| 519 |
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Object(getPrototypeOf["a" /* default */])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Object(getPrototypeOf["a" /* default */])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Object(possibleConstructorReturn["a" /* default */])(this, result); }; }
|
| 520 |
+
|
| 521 |
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
| 522 |
+
|
| 523 |
/**
|
| 524 |
+
* External dependencies
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 525 |
*/
|
| 526 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 527 |
/**
|
| 528 |
+
* WordPress dependencies
|
|
|
|
|
|
|
|
|
|
|
|
|
| 529 |
*/
|
| 530 |
|
| 531 |
|
|
|
|
|
|
|
|
|
|
| 532 |
/**
|
| 533 |
+
* Internal dependencies
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 534 |
*/
|
| 535 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 536 |
|
|
|
|
|
|
|
|
|
|
| 537 |
|
| 538 |
+
var slot_SlotComponent = /*#__PURE__*/function (_Component) {
|
| 539 |
+
Object(inherits["a" /* default */])(SlotComponent, _Component);
|
| 540 |
|
| 541 |
+
var _super = _createSuper(SlotComponent);
|
| 542 |
|
| 543 |
+
function SlotComponent() {
|
| 544 |
+
var _this;
|
| 545 |
+
|
| 546 |
+
Object(classCallCheck["a" /* default */])(this, SlotComponent);
|
| 547 |
+
|
| 548 |
+
_this = _super.apply(this, arguments);
|
| 549 |
+
_this.isUnmounted = false;
|
| 550 |
+
_this.bindNode = _this.bindNode.bind(Object(assertThisInitialized["a" /* default */])(_this));
|
| 551 |
+
return _this;
|
| 552 |
+
}
|
| 553 |
+
|
| 554 |
+
Object(createClass["a" /* default */])(SlotComponent, [{
|
| 555 |
+
key: "componentDidMount",
|
| 556 |
+
value: function componentDidMount() {
|
| 557 |
+
var registerSlot = this.props.registerSlot;
|
| 558 |
+
registerSlot(this.props.name, this);
|
| 559 |
+
}
|
| 560 |
+
}, {
|
| 561 |
+
key: "componentWillUnmount",
|
| 562 |
+
value: function componentWillUnmount() {
|
| 563 |
+
var unregisterSlot = this.props.unregisterSlot;
|
| 564 |
+
this.isUnmounted = true;
|
| 565 |
+
unregisterSlot(this.props.name, this);
|
| 566 |
+
}
|
| 567 |
+
}, {
|
| 568 |
+
key: "componentDidUpdate",
|
| 569 |
+
value: function componentDidUpdate(prevProps) {
|
| 570 |
+
var _this$props = this.props,
|
| 571 |
+
name = _this$props.name,
|
| 572 |
+
unregisterSlot = _this$props.unregisterSlot,
|
| 573 |
+
registerSlot = _this$props.registerSlot;
|
| 574 |
+
|
| 575 |
+
if (prevProps.name !== name) {
|
| 576 |
+
unregisterSlot(prevProps.name);
|
| 577 |
+
registerSlot(name, this);
|
| 578 |
+
}
|
| 579 |
+
}
|
| 580 |
+
}, {
|
| 581 |
+
key: "bindNode",
|
| 582 |
+
value: function bindNode(node) {
|
| 583 |
+
this.node = node;
|
| 584 |
+
}
|
| 585 |
+
}, {
|
| 586 |
+
key: "forceUpdate",
|
| 587 |
+
value: function forceUpdate() {
|
| 588 |
+
if (this.isUnmounted) {
|
| 589 |
+
return;
|
| 590 |
+
}
|
| 591 |
+
|
| 592 |
+
Object(get["a" /* default */])(Object(getPrototypeOf["a" /* default */])(SlotComponent.prototype), "forceUpdate", this).call(this);
|
| 593 |
+
}
|
| 594 |
+
}, {
|
| 595 |
+
key: "render",
|
| 596 |
+
value: function render() {
|
| 597 |
+
var _this$props2 = this.props,
|
| 598 |
+
children = _this$props2.children,
|
| 599 |
+
name = _this$props2.name,
|
| 600 |
+
_this$props2$fillProp = _this$props2.fillProps,
|
| 601 |
+
fillProps = _this$props2$fillProp === void 0 ? {} : _this$props2$fillProp,
|
| 602 |
+
getFills = _this$props2.getFills;
|
| 603 |
+
var fills = Object(external_lodash_["map"])(getFills(name, this), function (fill) {
|
| 604 |
+
var fillKey = fill.occurrence;
|
| 605 |
+
var fillChildren = Object(external_lodash_["isFunction"])(fill.children) ? fill.children(fillProps) : fill.children;
|
| 606 |
+
return external_this_wp_element_["Children"].map(fillChildren, function (child, childIndex) {
|
| 607 |
+
if (!child || Object(external_lodash_["isString"])(child)) {
|
| 608 |
+
return child;
|
| 609 |
+
}
|
| 610 |
+
|
| 611 |
+
var childKey = "".concat(fillKey, "---").concat(child.key || childIndex);
|
| 612 |
+
return Object(external_this_wp_element_["cloneElement"])(child, {
|
| 613 |
+
key: childKey
|
| 614 |
+
});
|
| 615 |
+
});
|
| 616 |
+
}).filter( // In some cases fills are rendered only when some conditions apply.
|
| 617 |
+
// This ensures that we only use non-empty fills when rendering, i.e.,
|
| 618 |
+
// it allows us to render wrappers only when the fills are actually present.
|
| 619 |
+
Object(external_lodash_["negate"])(external_this_wp_element_["isEmptyElement"]));
|
| 620 |
+
return Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, Object(external_lodash_["isFunction"])(children) ? children(fills) : fills);
|
| 621 |
+
}
|
| 622 |
+
}]);
|
| 623 |
+
|
| 624 |
+
return SlotComponent;
|
| 625 |
+
}(external_this_wp_element_["Component"]);
|
| 626 |
+
|
| 627 |
+
var slot_Slot = function Slot(props) {
|
| 628 |
+
return Object(external_this_wp_element_["createElement"])(context["a" /* Consumer */], null, function (_ref) {
|
| 629 |
+
var registerSlot = _ref.registerSlot,
|
| 630 |
+
unregisterSlot = _ref.unregisterSlot,
|
| 631 |
+
getFills = _ref.getFills;
|
| 632 |
+
return Object(external_this_wp_element_["createElement"])(slot_SlotComponent, Object(esm_extends["a" /* default */])({}, props, {
|
| 633 |
+
registerSlot: registerSlot,
|
| 634 |
+
unregisterSlot: unregisterSlot,
|
| 635 |
+
getFills: getFills
|
| 636 |
+
}));
|
| 637 |
+
});
|
| 638 |
+
};
|
| 639 |
+
|
| 640 |
+
/* harmony default export */ var slot_fill_slot = (slot_Slot);
|
| 641 |
+
//# sourceMappingURL=slot.js.map
|
| 642 |
+
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/fill.js
|
| 643 |
|
| 644 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 645 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 646 |
/**
|
| 647 |
+
* External dependencies
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 648 |
*/
|
| 649 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 650 |
/**
|
| 651 |
+
* WordPress dependencies
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 652 |
*/
|
| 653 |
|
| 654 |
|
|
|
|
|
|
|
|
|
|
| 655 |
/**
|
| 656 |
+
* Internal dependencies
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 657 |
*/
|
| 658 |
|
| 659 |
|
| 660 |
+
var occurrences = 0;
|
|
|
|
|
|
|
| 661 |
|
| 662 |
+
function fill_FillComponent(_ref) {
|
| 663 |
+
var name = _ref.name,
|
| 664 |
+
children = _ref.children,
|
| 665 |
+
registerFill = _ref.registerFill,
|
| 666 |
+
unregisterFill = _ref.unregisterFill;
|
| 667 |
+
var slot = Object(context["c" /* useSlot */])(name);
|
| 668 |
+
var ref = Object(external_this_wp_element_["useRef"])({
|
| 669 |
+
name: name,
|
| 670 |
+
children: children
|
| 671 |
+
});
|
| 672 |
+
|
| 673 |
+
if (!ref.current.occurrence) {
|
| 674 |
+
ref.current.occurrence = ++occurrences;
|
| 675 |
}
|
| 676 |
|
| 677 |
+
Object(external_this_wp_element_["useLayoutEffect"])(function () {
|
| 678 |
+
registerFill(name, ref.current);
|
| 679 |
+
return function () {
|
| 680 |
+
return unregisterFill(name, ref.current);
|
| 681 |
+
};
|
| 682 |
+
}, []);
|
| 683 |
+
Object(external_this_wp_element_["useLayoutEffect"])(function () {
|
| 684 |
+
ref.current.children = children;
|
| 685 |
+
|
| 686 |
+
if (slot) {
|
| 687 |
+
slot.forceUpdate();
|
| 688 |
+
}
|
| 689 |
+
}, [children]);
|
| 690 |
+
Object(external_this_wp_element_["useLayoutEffect"])(function () {
|
| 691 |
+
if (name === ref.current.name) {
|
| 692 |
+
// ignore initial effect
|
| 693 |
+
return;
|
| 694 |
+
}
|
| 695 |
+
|
| 696 |
+
unregisterFill(ref.current.name, ref.current);
|
| 697 |
+
ref.current.name = name;
|
| 698 |
+
registerFill(name, ref.current);
|
| 699 |
+
}, [name]);
|
| 700 |
+
|
| 701 |
+
if (!slot || !slot.node) {
|
| 702 |
+
return null;
|
| 703 |
+
} // If a function is passed as a child, provide it with the fillProps.
|
| 704 |
+
|
| 705 |
+
|
| 706 |
+
if (Object(external_lodash_["isFunction"])(children)) {
|
| 707 |
+
children = children(slot.props.fillProps);
|
| 708 |
+
}
|
| 709 |
+
|
| 710 |
+
return Object(external_this_wp_element_["createPortal"])(children, slot.node);
|
| 711 |
}
|
| 712 |
+
|
| 713 |
+
var fill_Fill = function Fill(props) {
|
| 714 |
+
return Object(external_this_wp_element_["createElement"])(context["a" /* Consumer */], null, function (_ref2) {
|
| 715 |
+
var registerFill = _ref2.registerFill,
|
| 716 |
+
unregisterFill = _ref2.unregisterFill;
|
| 717 |
+
return Object(external_this_wp_element_["createElement"])(fill_FillComponent, Object(esm_extends["a" /* default */])({}, props, {
|
| 718 |
+
registerFill: registerFill,
|
| 719 |
+
unregisterFill: unregisterFill
|
| 720 |
+
}));
|
| 721 |
+
});
|
| 722 |
+
};
|
| 723 |
+
|
| 724 |
+
/* harmony default export */ var slot_fill_fill = (fill_Fill);
|
| 725 |
+
//# sourceMappingURL=fill.js.map
|
| 726 |
+
// EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/bubbles-virtually/slot-fill-context.js
|
| 727 |
+
var slot_fill_context = __webpack_require__(63);
|
| 728 |
+
|
| 729 |
+
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/bubbles-virtually/slot.js
|
| 730 |
+
|
| 731 |
+
|
| 732 |
+
|
| 733 |
+
|
| 734 |
/**
|
| 735 |
+
* WordPress dependencies
|
|
|
|
|
|
|
|
|
|
|
|
|
| 736 |
*/
|
| 737 |
|
| 738 |
+
/**
|
| 739 |
+
* Internal dependencies
|
| 740 |
+
*/
|
| 741 |
|
|
|
|
|
|
|
|
|
|
| 742 |
|
| 743 |
+
function bubbles_virtually_slot_Slot(_ref) {
|
| 744 |
+
var name = _ref.name,
|
| 745 |
+
_ref$fillProps = _ref.fillProps,
|
| 746 |
+
fillProps = _ref$fillProps === void 0 ? {} : _ref$fillProps,
|
| 747 |
+
_ref$as = _ref.as,
|
| 748 |
+
Component = _ref$as === void 0 ? 'div' : _ref$as,
|
| 749 |
+
props = Object(objectWithoutProperties["a" /* default */])(_ref, ["name", "fillProps", "as"]);
|
| 750 |
+
|
| 751 |
+
var registry = Object(external_this_wp_element_["useContext"])(slot_fill_context["a" /* default */]);
|
| 752 |
+
var ref = Object(external_this_wp_element_["useRef"])();
|
| 753 |
+
Object(external_this_wp_element_["useLayoutEffect"])(function () {
|
| 754 |
+
registry.registerSlot(name, ref, fillProps);
|
| 755 |
+
return function () {
|
| 756 |
+
registry.unregisterSlot(name, ref);
|
| 757 |
+
}; // We are not including fillProps in the deps because we don't want to
|
| 758 |
+
// unregister and register the slot whenever fillProps change, which would
|
| 759 |
+
// cause the fill to be re-mounted. We are only considering the initial value
|
| 760 |
+
// of fillProps.
|
| 761 |
+
}, [registry.registerSlot, registry.unregisterSlot, name]); // fillProps may be an update that interacts with the layout, so we
|
| 762 |
+
// useLayoutEffect
|
| 763 |
+
|
| 764 |
+
Object(external_this_wp_element_["useLayoutEffect"])(function () {
|
| 765 |
+
registry.updateSlot(name, fillProps);
|
| 766 |
+
});
|
| 767 |
+
return Object(external_this_wp_element_["createElement"])(Component, Object(esm_extends["a" /* default */])({
|
| 768 |
+
ref: ref
|
| 769 |
+
}, props));
|
| 770 |
}
|
| 771 |
+
//# sourceMappingURL=slot.js.map
|
| 772 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js + 3 modules
|
| 773 |
+
var slicedToArray = __webpack_require__(26);
|
| 774 |
+
|
| 775 |
+
// EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/bubbles-virtually/use-slot.js
|
| 776 |
+
var use_slot = __webpack_require__(76);
|
| 777 |
+
|
| 778 |
+
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/bubbles-virtually/fill.js
|
| 779 |
+
|
| 780 |
+
|
| 781 |
/**
|
| 782 |
+
* WordPress dependencies
|
|
|
|
|
|
|
|
|
|
| 783 |
*/
|
| 784 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 785 |
/**
|
| 786 |
+
* Internal dependencies
|
|
|
|
|
|
|
|
|
|
| 787 |
*/
|
| 788 |
|
|
|
|
|
|
|
|
|
|
| 789 |
|
| 790 |
+
|
| 791 |
+
function useForceUpdate() {
|
| 792 |
+
var _useState = Object(external_this_wp_element_["useState"])({}),
|
| 793 |
+
_useState2 = Object(slicedToArray["a" /* default */])(_useState, 2),
|
| 794 |
+
setState = _useState2[1];
|
| 795 |
+
|
| 796 |
+
return function () {
|
| 797 |
+
return setState({});
|
| 798 |
+
};
|
| 799 |
+
}
|
| 800 |
+
|
| 801 |
+
function bubbles_virtually_fill_Fill(_ref) {
|
| 802 |
+
var name = _ref.name,
|
| 803 |
+
children = _ref.children;
|
| 804 |
+
var slot = Object(use_slot["a" /* default */])(name);
|
| 805 |
+
var ref = Object(external_this_wp_element_["useRef"])({
|
| 806 |
+
rerender: useForceUpdate()
|
| 807 |
});
|
| 808 |
+
Object(external_this_wp_element_["useEffect"])(function () {
|
| 809 |
+
// We register fills so we can keep track of their existance.
|
| 810 |
+
// Some Slot implementations need to know if there're already fills
|
| 811 |
+
// registered so they can choose to render themselves or not.
|
| 812 |
+
slot.registerFill(ref);
|
| 813 |
+
return function () {
|
| 814 |
+
slot.unregisterFill(ref);
|
| 815 |
+
};
|
| 816 |
+
}, [slot.registerFill, slot.unregisterFill]);
|
| 817 |
+
|
| 818 |
+
if (!slot.ref || !slot.ref.current) {
|
| 819 |
+
return null;
|
| 820 |
+
}
|
| 821 |
+
|
| 822 |
+
if (typeof children === 'function') {
|
| 823 |
+
children = children(slot.fillProps);
|
| 824 |
+
}
|
| 825 |
+
|
| 826 |
+
return Object(external_this_wp_element_["createPortal"])(children, slot.ref.current);
|
| 827 |
}
|
| 828 |
+
//# sourceMappingURL=fill.js.map
|
| 829 |
+
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/index.js
|
| 830 |
+
|
| 831 |
+
|
| 832 |
+
|
| 833 |
+
|
| 834 |
/**
|
| 835 |
* Internal dependencies
|
| 836 |
*/
|
| 837 |
|
| 838 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 839 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 840 |
|
| 841 |
|
| 842 |
|
| 843 |
+
function slot_fill_Slot(_ref) {
|
| 844 |
+
var bubblesVirtually = _ref.bubblesVirtually,
|
| 845 |
+
props = Object(objectWithoutProperties["a" /* default */])(_ref, ["bubblesVirtually"]);
|
| 846 |
+
|
| 847 |
+
if (bubblesVirtually) {
|
| 848 |
+
return Object(external_this_wp_element_["createElement"])(bubbles_virtually_slot_Slot, props);
|
| 849 |
+
}
|
| 850 |
+
|
| 851 |
+
return Object(external_this_wp_element_["createElement"])(slot_fill_slot, props);
|
| 852 |
+
}
|
| 853 |
+
function slot_fill_Fill(props) {
|
| 854 |
+
// We're adding both Fills here so they can register themselves before
|
| 855 |
+
// their respective slot has been registered. Only the Fill that has a slot
|
| 856 |
+
// will render. The other one will return null.
|
| 857 |
+
return Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, Object(external_this_wp_element_["createElement"])(slot_fill_fill, props), Object(external_this_wp_element_["createElement"])(bubbles_virtually_fill_Fill, props));
|
| 858 |
+
}
|
| 859 |
+
function createSlotFill(name) {
|
| 860 |
+
var FillComponent = function FillComponent(props) {
|
| 861 |
+
return Object(external_this_wp_element_["createElement"])(slot_fill_Fill, Object(esm_extends["a" /* default */])({
|
| 862 |
+
name: name
|
| 863 |
+
}, props));
|
| 864 |
+
};
|
| 865 |
+
|
| 866 |
+
FillComponent.displayName = name + 'Fill';
|
| 867 |
+
|
| 868 |
+
var SlotComponent = function SlotComponent(props) {
|
| 869 |
+
return Object(external_this_wp_element_["createElement"])(slot_fill_Slot, Object(esm_extends["a" /* default */])({
|
| 870 |
+
name: name
|
| 871 |
+
}, props));
|
| 872 |
+
};
|
| 873 |
+
|
| 874 |
+
SlotComponent.displayName = name + 'Slot';
|
| 875 |
+
return {
|
| 876 |
+
Fill: FillComponent,
|
| 877 |
+
Slot: SlotComponent
|
| 878 |
+
};
|
| 879 |
+
}
|
| 880 |
+
|
| 881 |
//# sourceMappingURL=index.js.map
|
| 882 |
|
| 883 |
/***/ }),
|
| 884 |
|
| 885 |
+
/***/ 115:
|
| 886 |
/***/ (function(module, exports, __webpack_require__) {
|
| 887 |
|
| 888 |
"use strict";
|
| 889 |
+
|
| 890 |
+
|
| 891 |
+
var replace = String.prototype.replace;
|
| 892 |
+
var percentTwenties = /%20/g;
|
| 893 |
+
|
| 894 |
+
var util = __webpack_require__(92);
|
| 895 |
+
|
| 896 |
+
var Format = {
|
| 897 |
+
RFC1738: 'RFC1738',
|
| 898 |
+
RFC3986: 'RFC3986'
|
| 899 |
+
};
|
| 900 |
+
|
| 901 |
+
module.exports = util.assign(
|
| 902 |
+
{
|
| 903 |
+
'default': Format.RFC3986,
|
| 904 |
+
formatters: {
|
| 905 |
+
RFC1738: function (value) {
|
| 906 |
+
return replace.call(value, percentTwenties, '+');
|
| 907 |
+
},
|
| 908 |
+
RFC3986: function (value) {
|
| 909 |
+
return String(value);
|
| 910 |
+
}
|
| 911 |
+
}
|
| 912 |
+
},
|
| 913 |
+
Format
|
| 914 |
+
);
|
| 915 |
|
| 916 |
|
| 917 |
/***/ }),
|
| 918 |
|
| 919 |
+
/***/ 116:
|
| 920 |
/***/ (function(module, exports) {
|
| 921 |
|
| 922 |
+
function _arrayWithHoles(arr) {
|
| 923 |
+
if (Array.isArray(arr)) return arr;
|
| 924 |
+
}
|
| 925 |
|
| 926 |
+
module.exports = _arrayWithHoles;
|
|
|
|
|
|
|
|
|
|
| 927 |
|
| 928 |
+
/***/ }),
|
|
|
|
| 929 |
|
| 930 |
+
/***/ 117:
|
| 931 |
+
/***/ (function(module, exports) {
|
| 932 |
+
|
| 933 |
+
function _iterableToArrayLimit(arr, i) {
|
| 934 |
+
if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;
|
| 935 |
+
var _arr = [];
|
| 936 |
+
var _n = true;
|
| 937 |
+
var _d = false;
|
| 938 |
+
var _e = undefined;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 939 |
|
| 940 |
+
try {
|
| 941 |
+
for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
|
| 942 |
+
_arr.push(_s.value);
|
| 943 |
|
| 944 |
+
if (i && _arr.length === i) break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 945 |
}
|
| 946 |
+
} catch (err) {
|
| 947 |
+
_d = true;
|
| 948 |
+
_e = err;
|
| 949 |
+
} finally {
|
| 950 |
try {
|
| 951 |
+
if (!_n && _i["return"] != null) _i["return"]();
|
| 952 |
+
} finally {
|
| 953 |
+
if (_d) throw _e;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 954 |
}
|
| 955 |
+
}
|
| 956 |
|
| 957 |
+
return _arr;
|
|
|
|
| 958 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
| 959 |
|
| 960 |
+
module.exports = _iterableToArrayLimit;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 961 |
|
| 962 |
+
/***/ }),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 963 |
|
| 964 |
+
/***/ 118:
|
| 965 |
+
/***/ (function(module, exports) {
|
| 966 |
+
|
| 967 |
+
function _nonIterableRest() {
|
| 968 |
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 969 |
}
|
| 970 |
|
| 971 |
+
module.exports = _nonIterableRest;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 972 |
|
| 973 |
+
/***/ }),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 974 |
|
| 975 |
+
/***/ 12:
|
| 976 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
| 977 |
|
| 978 |
+
"use strict";
|
| 979 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _objectWithoutProperties; });
|
| 980 |
+
/* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(58);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 981 |
|
| 982 |
+
function _objectWithoutProperties(source, excluded) {
|
| 983 |
+
if (source == null) return {};
|
| 984 |
+
var target = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(source, excluded);
|
| 985 |
+
var key, i;
|
| 986 |
|
| 987 |
+
if (Object.getOwnPropertySymbols) {
|
| 988 |
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
|
|
| 989 |
|
| 990 |
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
| 991 |
+
key = sourceSymbolKeys[i];
|
| 992 |
+
if (excluded.indexOf(key) >= 0) continue;
|
| 993 |
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
| 994 |
+
target[key] = source[key];
|
| 995 |
+
}
|
| 996 |
+
}
|
| 997 |
|
| 998 |
+
return target;
|
| 999 |
+
}
|
| 1000 |
|
| 1001 |
/***/ }),
|
| 1002 |
|
| 1003 |
+
/***/ 125:
|
| 1004 |
/***/ (function(module, exports, __webpack_require__) {
|
| 1005 |
|
| 1006 |
+
var e=__webpack_require__(6),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]};
|
| 1007 |
+
//# sourceMappingURL=index.js.map
|
| 1008 |
|
| 1009 |
|
| 1010 |
+
/***/ }),
|
|
|
|
|
|
|
| 1011 |
|
| 1012 |
+
/***/ 126:
|
| 1013 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
| 1014 |
|
| 1015 |
+
"use strict";
|
| 1016 |
+
/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7);
|
| 1017 |
+
/* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(12);
|
| 1018 |
+
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(0);
|
| 1019 |
+
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__);
|
| 1020 |
|
|
|
|
|
|
|
| 1021 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1022 |
|
| 1023 |
+
|
| 1024 |
+
function Dashicon(_ref) {
|
| 1025 |
+
var icon = _ref.icon,
|
| 1026 |
+
_ref$size = _ref.size,
|
| 1027 |
+
size = _ref$size === void 0 ? 20 : _ref$size,
|
| 1028 |
+
className = _ref.className,
|
| 1029 |
+
extraProps = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(_ref, ["icon", "size", "className"]);
|
| 1030 |
+
|
| 1031 |
+
var iconClass = ['dashicon', 'dashicons', 'dashicons-' + icon, className].filter(Boolean).join(' ');
|
| 1032 |
+
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])("span", Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])({
|
| 1033 |
+
className: iconClass,
|
| 1034 |
+
width: size,
|
| 1035 |
+
height: size
|
| 1036 |
+
}, extraProps));
|
| 1037 |
}
|
| 1038 |
|
| 1039 |
+
/* harmony default export */ __webpack_exports__["a"] = (Dashicon);
|
| 1040 |
+
//# sourceMappingURL=index.js.map
|
| 1041 |
|
| 1042 |
/***/ }),
|
| 1043 |
|
| 1044 |
+
/***/ 127:
|
| 1045 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
| 1046 |
|
| 1047 |
"use strict";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1048 |
|
| 1049 |
+
// EXPORTS
|
| 1050 |
+
__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ createBrowserHistory; });
|
| 1051 |
+
__webpack_require__.d(__webpack_exports__, "c", function() { return /* binding */ createMemoryHistory; });
|
| 1052 |
+
__webpack_require__.d(__webpack_exports__, "b", function() { return /* binding */ createLocation; });
|
| 1053 |
+
__webpack_require__.d(__webpack_exports__, "e", function() { return /* binding */ locationsAreEqual; });
|
| 1054 |
+
__webpack_require__.d(__webpack_exports__, "d", function() { return /* binding */ createPath; });
|
| 1055 |
|
| 1056 |
+
// UNUSED EXPORTS: createHashHistory, parsePath
|
| 1057 |
|
| 1058 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
|
| 1059 |
+
var esm_extends = __webpack_require__(7);
|
| 1060 |
|
| 1061 |
+
// CONCATENATED MODULE: ./node_modules/resolve-pathname/esm/resolve-pathname.js
|
| 1062 |
+
function isAbsolute(pathname) {
|
| 1063 |
+
return pathname.charAt(0) === '/';
|
| 1064 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1065 |
|
| 1066 |
+
// About 1.5x faster than the two-arg version of Array#splice()
|
| 1067 |
+
function spliceOne(list, index) {
|
| 1068 |
+
for (var i = index, k = i + 1, n = list.length; k < n; i += 1, k += 1) {
|
| 1069 |
+
list[i] = list[k];
|
| 1070 |
+
}
|
| 1071 |
|
| 1072 |
+
list.pop();
|
| 1073 |
+
}
|
| 1074 |
|
| 1075 |
+
// This implementation is based heavily on node's url.parse
|
| 1076 |
+
function resolvePathname(to, from) {
|
| 1077 |
+
if (from === undefined) from = '';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1078 |
|
| 1079 |
+
var toParts = (to && to.split('/')) || [];
|
| 1080 |
+
var fromParts = (from && from.split('/')) || [];
|
|
|
|
|
|
|
|
|
|
| 1081 |
|
| 1082 |
+
var isToAbs = to && isAbsolute(to);
|
| 1083 |
+
var isFromAbs = from && isAbsolute(from);
|
| 1084 |
+
var mustEndAbs = isToAbs || isFromAbs;
|
| 1085 |
|
| 1086 |
+
if (to && isAbsolute(to)) {
|
| 1087 |
+
// to is absolute
|
| 1088 |
+
fromParts = toParts;
|
| 1089 |
+
} else if (toParts.length) {
|
| 1090 |
+
// to is relative, drop the filename
|
| 1091 |
+
fromParts.pop();
|
| 1092 |
+
fromParts = fromParts.concat(toParts);
|
| 1093 |
+
}
|
| 1094 |
|
| 1095 |
+
if (!fromParts.length) return '/';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1096 |
|
| 1097 |
+
var hasTrailingSlash;
|
| 1098 |
+
if (fromParts.length) {
|
| 1099 |
+
var last = fromParts[fromParts.length - 1];
|
| 1100 |
+
hasTrailingSlash = last === '.' || last === '..' || last === '';
|
| 1101 |
+
} else {
|
| 1102 |
+
hasTrailingSlash = false;
|
| 1103 |
+
}
|
| 1104 |
|
| 1105 |
+
var up = 0;
|
| 1106 |
+
for (var i = fromParts.length; i >= 0; i--) {
|
| 1107 |
+
var part = fromParts[i];
|
| 1108 |
|
| 1109 |
+
if (part === '.') {
|
| 1110 |
+
spliceOne(fromParts, i);
|
| 1111 |
+
} else if (part === '..') {
|
| 1112 |
+
spliceOne(fromParts, i);
|
| 1113 |
+
up++;
|
| 1114 |
+
} else if (up) {
|
| 1115 |
+
spliceOne(fromParts, i);
|
| 1116 |
+
up--;
|
| 1117 |
}
|
| 1118 |
+
}
|
| 1119 |
|
| 1120 |
+
if (!mustEndAbs) for (; up--; up) fromParts.unshift('..');
|
|
|
|
| 1121 |
|
| 1122 |
+
if (
|
| 1123 |
+
mustEndAbs &&
|
| 1124 |
+
fromParts[0] !== '' &&
|
| 1125 |
+
(!fromParts[0] || !isAbsolute(fromParts[0]))
|
| 1126 |
+
)
|
| 1127 |
+
fromParts.unshift('');
|
| 1128 |
|
| 1129 |
+
var result = fromParts.join('/');
|
|
|
|
| 1130 |
|
| 1131 |
+
if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1132 |
|
| 1133 |
+
return result;
|
| 1134 |
}
|
| 1135 |
|
| 1136 |
+
/* harmony default export */ var resolve_pathname = (resolvePathname);
|
|
|
|
| 1137 |
|
| 1138 |
+
// CONCATENATED MODULE: ./node_modules/value-equal/esm/value-equal.js
|
| 1139 |
+
function value_equal_valueOf(obj) {
|
| 1140 |
+
return obj.valueOf ? obj.valueOf() : Object.prototype.valueOf.call(obj);
|
| 1141 |
+
}
|
| 1142 |
|
| 1143 |
+
function valueEqual(a, b) {
|
| 1144 |
+
// Test for strict equality first.
|
| 1145 |
+
if (a === b) return true;
|
| 1146 |
|
| 1147 |
+
// Otherwise, if either of them == null they are not equal.
|
| 1148 |
+
if (a == null || b == null) return false;
|
| 1149 |
|
| 1150 |
+
if (Array.isArray(a)) {
|
| 1151 |
+
return (
|
| 1152 |
+
Array.isArray(b) &&
|
| 1153 |
+
a.length === b.length &&
|
| 1154 |
+
a.every(function(item, index) {
|
| 1155 |
+
return valueEqual(item, b[index]);
|
| 1156 |
+
})
|
| 1157 |
+
);
|
| 1158 |
+
}
|
| 1159 |
|
| 1160 |
+
if (typeof a === 'object' || typeof b === 'object') {
|
| 1161 |
+
var aValue = value_equal_valueOf(a);
|
| 1162 |
+
var bValue = value_equal_valueOf(b);
|
| 1163 |
|
| 1164 |
+
if (aValue !== a || bValue !== b) return valueEqual(aValue, bValue);
|
| 1165 |
|
| 1166 |
+
return Object.keys(Object.assign({}, a, b)).every(function(key) {
|
| 1167 |
+
return valueEqual(a[key], b[key]);
|
| 1168 |
+
});
|
| 1169 |
}
|
| 1170 |
|
| 1171 |
+
return false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1172 |
}
|
| 1173 |
|
| 1174 |
+
/* harmony default export */ var value_equal = (valueEqual);
|
| 1175 |
|
| 1176 |
+
// EXTERNAL MODULE: ./node_modules/tiny-invariant/dist/tiny-invariant.esm.js
|
| 1177 |
+
var tiny_invariant_esm = __webpack_require__(103);
|
| 1178 |
|
| 1179 |
+
// CONCATENATED MODULE: ./node_modules/history/esm/history.js
|
|
|
|
| 1180 |
|
|
|
|
| 1181 |
|
|
|
|
|
|
|
| 1182 |
|
|
|
|
| 1183 |
|
|
|
|
|
|
|
| 1184 |
|
|
|
|
|
|
|
| 1185 |
|
| 1186 |
+
function addLeadingSlash(path) {
|
| 1187 |
+
return path.charAt(0) === '/' ? path : '/' + path;
|
| 1188 |
+
}
|
| 1189 |
+
function stripLeadingSlash(path) {
|
| 1190 |
+
return path.charAt(0) === '/' ? path.substr(1) : path;
|
| 1191 |
+
}
|
| 1192 |
+
function hasBasename(path, prefix) {
|
| 1193 |
+
return path.toLowerCase().indexOf(prefix.toLowerCase()) === 0 && '/?#'.indexOf(path.charAt(prefix.length)) !== -1;
|
| 1194 |
+
}
|
| 1195 |
+
function stripBasename(path, prefix) {
|
| 1196 |
+
return hasBasename(path, prefix) ? path.substr(prefix.length) : path;
|
| 1197 |
+
}
|
| 1198 |
+
function stripTrailingSlash(path) {
|
| 1199 |
+
return path.charAt(path.length - 1) === '/' ? path.slice(0, -1) : path;
|
| 1200 |
+
}
|
| 1201 |
+
function parsePath(path) {
|
| 1202 |
+
var pathname = path || '/';
|
| 1203 |
+
var search = '';
|
| 1204 |
+
var hash = '';
|
| 1205 |
+
var hashIndex = pathname.indexOf('#');
|
| 1206 |
|
| 1207 |
+
if (hashIndex !== -1) {
|
| 1208 |
+
hash = pathname.substr(hashIndex);
|
| 1209 |
+
pathname = pathname.substr(0, hashIndex);
|
| 1210 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1211 |
|
| 1212 |
+
var searchIndex = pathname.indexOf('?');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1213 |
|
| 1214 |
+
if (searchIndex !== -1) {
|
| 1215 |
+
search = pathname.substr(searchIndex);
|
| 1216 |
+
pathname = pathname.substr(0, searchIndex);
|
| 1217 |
}
|
| 1218 |
|
| 1219 |
+
return {
|
| 1220 |
+
pathname: pathname,
|
| 1221 |
+
search: search === '?' ? '' : search,
|
| 1222 |
+
hash: hash === '#' ? '' : hash
|
| 1223 |
+
};
|
| 1224 |
+
}
|
| 1225 |
+
function createPath(location) {
|
| 1226 |
+
var pathname = location.pathname,
|
| 1227 |
+
search = location.search,
|
| 1228 |
+
hash = location.hash;
|
| 1229 |
+
var path = pathname || '/';
|
| 1230 |
+
if (search && search !== '?') path += search.charAt(0) === '?' ? search : "?" + search;
|
| 1231 |
+
if (hash && hash !== '#') path += hash.charAt(0) === '#' ? hash : "#" + hash;
|
| 1232 |
+
return path;
|
| 1233 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1234 |
|
| 1235 |
+
function createLocation(path, state, key, currentLocation) {
|
| 1236 |
+
var location;
|
|
|
|
| 1237 |
|
| 1238 |
+
if (typeof path === 'string') {
|
| 1239 |
+
// Two-arg form: push(path, state)
|
| 1240 |
+
location = parsePath(path);
|
| 1241 |
+
location.state = state;
|
| 1242 |
+
} else {
|
| 1243 |
+
// One-arg form: push(location)
|
| 1244 |
+
location = Object(esm_extends["a" /* default */])({}, path);
|
| 1245 |
+
if (location.pathname === undefined) location.pathname = '';
|
|
|
|
|
|
|
| 1246 |
|
| 1247 |
+
if (location.search) {
|
| 1248 |
+
if (location.search.charAt(0) !== '?') location.search = '?' + location.search;
|
| 1249 |
+
} else {
|
| 1250 |
+
location.search = '';
|
| 1251 |
+
}
|
| 1252 |
|
| 1253 |
+
if (location.hash) {
|
| 1254 |
+
if (location.hash.charAt(0) !== '#') location.hash = '#' + location.hash;
|
| 1255 |
+
} else {
|
| 1256 |
+
location.hash = '';
|
| 1257 |
+
}
|
| 1258 |
|
| 1259 |
+
if (state !== undefined && location.state === undefined) location.state = state;
|
|
|
|
| 1260 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1261 |
|
| 1262 |
+
try {
|
| 1263 |
+
location.pathname = decodeURI(location.pathname);
|
| 1264 |
+
} catch (e) {
|
| 1265 |
+
if (e instanceof URIError) {
|
| 1266 |
+
throw new URIError('Pathname "' + location.pathname + '" could not be decoded. ' + 'This is likely caused by an invalid percent-encoding.');
|
| 1267 |
+
} else {
|
| 1268 |
+
throw e;
|
| 1269 |
+
}
|
| 1270 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1271 |
|
| 1272 |
+
if (key) location.key = key;
|
| 1273 |
+
|
| 1274 |
+
if (currentLocation) {
|
| 1275 |
+
// Resolve incomplete/relative pathname relative to current location.
|
| 1276 |
+
if (!location.pathname) {
|
| 1277 |
+
location.pathname = currentLocation.pathname;
|
| 1278 |
+
} else if (location.pathname.charAt(0) !== '/') {
|
| 1279 |
+
location.pathname = resolve_pathname(location.pathname, currentLocation.pathname);
|
| 1280 |
+
}
|
| 1281 |
+
} else {
|
| 1282 |
+
// When there is no prior location and pathname is empty, set it to /
|
| 1283 |
+
if (!location.pathname) {
|
| 1284 |
+
location.pathname = '/';
|
| 1285 |
+
}
|
| 1286 |
}
|
| 1287 |
|
| 1288 |
+
return location;
|
| 1289 |
+
}
|
| 1290 |
+
function locationsAreEqual(a, b) {
|
| 1291 |
+
return a.pathname === b.pathname && a.search === b.search && a.hash === b.hash && a.key === b.key && value_equal(a.state, b.state);
|
| 1292 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1293 |
|
| 1294 |
+
function createTransitionManager() {
|
| 1295 |
+
var prompt = null;
|
|
|
|
| 1296 |
|
| 1297 |
+
function setPrompt(nextPrompt) {
|
| 1298 |
+
false ? undefined : void 0;
|
| 1299 |
+
prompt = nextPrompt;
|
| 1300 |
+
return function () {
|
| 1301 |
+
if (prompt === nextPrompt) prompt = null;
|
| 1302 |
+
};
|
| 1303 |
+
}
|
| 1304 |
|
| 1305 |
+
function confirmTransitionTo(location, action, getUserConfirmation, callback) {
|
| 1306 |
+
// TODO: If another transition starts while we're still confirming
|
| 1307 |
+
// the previous one, we may end up in a weird state. Figure out the
|
| 1308 |
+
// best way to handle this.
|
| 1309 |
+
if (prompt != null) {
|
| 1310 |
+
var result = typeof prompt === 'function' ? prompt(location, action) : prompt;
|
| 1311 |
|
| 1312 |
+
if (typeof result === 'string') {
|
| 1313 |
+
if (typeof getUserConfirmation === 'function') {
|
| 1314 |
+
getUserConfirmation(result, callback);
|
| 1315 |
+
} else {
|
| 1316 |
+
false ? undefined : void 0;
|
| 1317 |
+
callback(true);
|
| 1318 |
+
}
|
| 1319 |
+
} else {
|
| 1320 |
+
// Return false from a transition hook to cancel the transition.
|
| 1321 |
+
callback(result !== false);
|
| 1322 |
+
}
|
| 1323 |
+
} else {
|
| 1324 |
+
callback(true);
|
| 1325 |
+
}
|
| 1326 |
+
}
|
| 1327 |
|
| 1328 |
+
var listeners = [];
|
| 1329 |
|
| 1330 |
+
function appendListener(fn) {
|
| 1331 |
+
var isActive = true;
|
|
|
|
| 1332 |
|
| 1333 |
+
function listener() {
|
| 1334 |
+
if (isActive) fn.apply(void 0, arguments);
|
| 1335 |
+
}
|
|
|
|
| 1336 |
|
| 1337 |
+
listeners.push(listener);
|
| 1338 |
+
return function () {
|
| 1339 |
+
isActive = false;
|
| 1340 |
+
listeners = listeners.filter(function (item) {
|
| 1341 |
+
return item !== listener;
|
| 1342 |
+
});
|
| 1343 |
+
};
|
| 1344 |
}
|
| 1345 |
|
| 1346 |
+
function notifyListeners() {
|
| 1347 |
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
| 1348 |
+
args[_key] = arguments[_key];
|
| 1349 |
+
}
|
| 1350 |
|
| 1351 |
+
listeners.forEach(function (listener) {
|
| 1352 |
+
return listener.apply(void 0, args);
|
| 1353 |
+
});
|
| 1354 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1355 |
|
| 1356 |
+
return {
|
| 1357 |
+
setPrompt: setPrompt,
|
| 1358 |
+
confirmTransitionTo: confirmTransitionTo,
|
| 1359 |
+
appendListener: appendListener,
|
| 1360 |
+
notifyListeners: notifyListeners
|
| 1361 |
+
};
|
| 1362 |
+
}
|
| 1363 |
+
|
| 1364 |
+
var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
|
| 1365 |
+
function getConfirmation(message, callback) {
|
| 1366 |
+
callback(window.confirm(message)); // eslint-disable-line no-alert
|
| 1367 |
+
}
|
| 1368 |
+
/**
|
| 1369 |
+
* Returns true if the HTML5 history API is supported. Taken from Modernizr.
|
| 1370 |
*
|
| 1371 |
+
* https://github.com/Modernizr/Modernizr/blob/master/LICENSE
|
| 1372 |
+
* https://github.com/Modernizr/Modernizr/blob/master/feature-detects/history.js
|
| 1373 |
+
* changed to avoid false negatives for Windows Phones: https://github.com/reactjs/react-router/issues/586
|
| 1374 |
*/
|
| 1375 |
|
| 1376 |
+
function supportsHistory() {
|
| 1377 |
+
var ua = window.navigator.userAgent;
|
| 1378 |
+
if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) return false;
|
| 1379 |
+
return window.history && 'pushState' in window.history;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1380 |
}
|
| 1381 |
+
/**
|
| 1382 |
+
* Returns true if browser fires popstate on hash change.
|
| 1383 |
+
* IE10 and IE11 do not.
|
| 1384 |
+
*/
|
| 1385 |
|
| 1386 |
+
function supportsPopStateOnHashChange() {
|
| 1387 |
+
return window.navigator.userAgent.indexOf('Trident') === -1;
|
| 1388 |
+
}
|
| 1389 |
+
/**
|
| 1390 |
+
* Returns false if using go(n) with hash history causes a full page reload.
|
| 1391 |
+
*/
|
| 1392 |
|
| 1393 |
+
function supportsGoWithoutReloadUsingHash() {
|
| 1394 |
+
return window.navigator.userAgent.indexOf('Firefox') === -1;
|
| 1395 |
+
}
|
| 1396 |
+
/**
|
| 1397 |
+
* Returns true if a given popstate event is an extraneous WebKit event.
|
| 1398 |
+
* Accounts for the fact that Chrome on iOS fires real popstate events
|
| 1399 |
+
* containing undefined state when pressing the back button.
|
| 1400 |
+
*/
|
| 1401 |
|
| 1402 |
+
function isExtraneousPopstateEvent(event) {
|
| 1403 |
+
return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;
|
| 1404 |
+
}
|
| 1405 |
|
| 1406 |
+
var PopStateEvent = 'popstate';
|
| 1407 |
+
var HashChangeEvent = 'hashchange';
|
|
|
|
|
|
|
| 1408 |
|
| 1409 |
+
function getHistoryState() {
|
| 1410 |
+
try {
|
| 1411 |
+
return window.history.state || {};
|
| 1412 |
+
} catch (e) {
|
| 1413 |
+
// IE 11 sometimes throws when accessing window.history.state
|
| 1414 |
+
// See https://github.com/ReactTraining/history/pull/289
|
| 1415 |
+
return {};
|
| 1416 |
+
}
|
| 1417 |
+
}
|
| 1418 |
+
/**
|
| 1419 |
+
* Creates a history object that uses the HTML5 history API including
|
| 1420 |
+
* pushState, replaceState, and the popstate event.
|
| 1421 |
+
*/
|
| 1422 |
|
|
|
|
|
|
|
|
|
|
| 1423 |
|
| 1424 |
+
function createBrowserHistory(props) {
|
| 1425 |
+
if (props === void 0) {
|
| 1426 |
+
props = {};
|
| 1427 |
+
}
|
| 1428 |
|
| 1429 |
+
!canUseDOM ? false ? undefined : Object(tiny_invariant_esm["a" /* default */])(false) : void 0;
|
| 1430 |
+
var globalHistory = window.history;
|
| 1431 |
+
var canUseHistory = supportsHistory();
|
| 1432 |
+
var needsHashChangeListener = !supportsPopStateOnHashChange();
|
| 1433 |
+
var _props = props,
|
| 1434 |
+
_props$forceRefresh = _props.forceRefresh,
|
| 1435 |
+
forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,
|
| 1436 |
+
_props$getUserConfirm = _props.getUserConfirmation,
|
| 1437 |
+
getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,
|
| 1438 |
+
_props$keyLength = _props.keyLength,
|
| 1439 |
+
keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;
|
| 1440 |
+
var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';
|
| 1441 |
|
| 1442 |
+
function getDOMLocation(historyState) {
|
| 1443 |
+
var _ref = historyState || {},
|
| 1444 |
+
key = _ref.key,
|
| 1445 |
+
state = _ref.state;
|
| 1446 |
|
| 1447 |
+
var _window$location = window.location,
|
| 1448 |
+
pathname = _window$location.pathname,
|
| 1449 |
+
search = _window$location.search,
|
| 1450 |
+
hash = _window$location.hash;
|
| 1451 |
+
var path = pathname + search + hash;
|
| 1452 |
+
false ? undefined : void 0;
|
| 1453 |
+
if (basename) path = stripBasename(path, basename);
|
| 1454 |
+
return createLocation(path, state, key);
|
| 1455 |
+
}
|
| 1456 |
|
| 1457 |
+
function createKey() {
|
| 1458 |
+
return Math.random().toString(36).substr(2, keyLength);
|
| 1459 |
+
}
|
| 1460 |
|
| 1461 |
+
var transitionManager = createTransitionManager();
|
|
|
|
|
|
|
| 1462 |
|
| 1463 |
+
function setState(nextState) {
|
| 1464 |
+
Object(esm_extends["a" /* default */])(history, nextState);
|
| 1465 |
|
| 1466 |
+
history.length = globalHistory.length;
|
| 1467 |
+
transitionManager.notifyListeners(history.location, history.action);
|
| 1468 |
+
}
|
| 1469 |
|
| 1470 |
+
function handlePopState(event) {
|
| 1471 |
+
// Ignore extraneous popstate events in WebKit.
|
| 1472 |
+
if (isExtraneousPopstateEvent(event)) return;
|
| 1473 |
+
handlePop(getDOMLocation(event.state));
|
| 1474 |
+
}
|
| 1475 |
|
| 1476 |
+
function handleHashChange() {
|
| 1477 |
+
handlePop(getDOMLocation(getHistoryState()));
|
| 1478 |
+
}
|
| 1479 |
|
| 1480 |
+
var forceNextPop = false;
|
|
|
|
|
|
|
| 1481 |
|
| 1482 |
+
function handlePop(location) {
|
| 1483 |
+
if (forceNextPop) {
|
| 1484 |
+
forceNextPop = false;
|
| 1485 |
+
setState();
|
| 1486 |
+
} else {
|
| 1487 |
+
var action = 'POP';
|
| 1488 |
+
transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
|
| 1489 |
+
if (ok) {
|
| 1490 |
+
setState({
|
| 1491 |
+
action: action,
|
| 1492 |
+
location: location
|
| 1493 |
+
});
|
| 1494 |
+
} else {
|
| 1495 |
+
revertPop(location);
|
| 1496 |
+
}
|
| 1497 |
+
});
|
| 1498 |
+
}
|
| 1499 |
+
}
|
| 1500 |
|
| 1501 |
+
function revertPop(fromLocation) {
|
| 1502 |
+
var toLocation = history.location; // TODO: We could probably make this more reliable by
|
| 1503 |
+
// keeping a list of keys we've seen in sessionStorage.
|
| 1504 |
+
// Instead, we just default to 0 for keys we don't know.
|
| 1505 |
|
| 1506 |
+
var toIndex = allKeys.indexOf(toLocation.key);
|
| 1507 |
+
if (toIndex === -1) toIndex = 0;
|
| 1508 |
+
var fromIndex = allKeys.indexOf(fromLocation.key);
|
| 1509 |
+
if (fromIndex === -1) fromIndex = 0;
|
| 1510 |
+
var delta = toIndex - fromIndex;
|
| 1511 |
|
| 1512 |
+
if (delta) {
|
| 1513 |
+
forceNextPop = true;
|
| 1514 |
+
go(delta);
|
| 1515 |
+
}
|
| 1516 |
+
}
|
| 1517 |
|
| 1518 |
+
var initialLocation = getDOMLocation(getHistoryState());
|
| 1519 |
+
var allKeys = [initialLocation.key]; // Public interface
|
| 1520 |
|
| 1521 |
+
function createHref(location) {
|
| 1522 |
+
return basename + createPath(location);
|
| 1523 |
+
}
|
| 1524 |
|
| 1525 |
+
function push(path, state) {
|
| 1526 |
+
false ? undefined : void 0;
|
| 1527 |
+
var action = 'PUSH';
|
| 1528 |
+
var location = createLocation(path, state, createKey(), history.location);
|
| 1529 |
+
transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
|
| 1530 |
+
if (!ok) return;
|
| 1531 |
+
var href = createHref(location);
|
| 1532 |
+
var key = location.key,
|
| 1533 |
+
state = location.state;
|
| 1534 |
|
| 1535 |
+
if (canUseHistory) {
|
| 1536 |
+
globalHistory.pushState({
|
| 1537 |
+
key: key,
|
| 1538 |
+
state: state
|
| 1539 |
+
}, null, href);
|
| 1540 |
|
| 1541 |
+
if (forceRefresh) {
|
| 1542 |
+
window.location.href = href;
|
| 1543 |
+
} else {
|
| 1544 |
+
var prevIndex = allKeys.indexOf(history.location.key);
|
| 1545 |
+
var nextKeys = allKeys.slice(0, prevIndex + 1);
|
| 1546 |
+
nextKeys.push(location.key);
|
| 1547 |
+
allKeys = nextKeys;
|
| 1548 |
+
setState({
|
| 1549 |
+
action: action,
|
| 1550 |
+
location: location
|
| 1551 |
+
});
|
| 1552 |
+
}
|
| 1553 |
+
} else {
|
| 1554 |
+
false ? undefined : void 0;
|
| 1555 |
+
window.location.href = href;
|
| 1556 |
+
}
|
| 1557 |
+
});
|
| 1558 |
+
}
|
| 1559 |
|
| 1560 |
+
function replace(path, state) {
|
| 1561 |
+
false ? undefined : void 0;
|
| 1562 |
+
var action = 'REPLACE';
|
| 1563 |
+
var location = createLocation(path, state, createKey(), history.location);
|
| 1564 |
+
transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
|
| 1565 |
+
if (!ok) return;
|
| 1566 |
+
var href = createHref(location);
|
| 1567 |
+
var key = location.key,
|
| 1568 |
+
state = location.state;
|
| 1569 |
|
| 1570 |
+
if (canUseHistory) {
|
| 1571 |
+
globalHistory.replaceState({
|
| 1572 |
+
key: key,
|
| 1573 |
+
state: state
|
| 1574 |
+
}, null, href);
|
| 1575 |
|
| 1576 |
+
if (forceRefresh) {
|
| 1577 |
+
window.location.replace(href);
|
| 1578 |
+
} else {
|
| 1579 |
+
var prevIndex = allKeys.indexOf(history.location.key);
|
| 1580 |
+
if (prevIndex !== -1) allKeys[prevIndex] = location.key;
|
| 1581 |
+
setState({
|
| 1582 |
+
action: action,
|
| 1583 |
+
location: location
|
| 1584 |
+
});
|
| 1585 |
+
}
|
| 1586 |
+
} else {
|
| 1587 |
+
false ? undefined : void 0;
|
| 1588 |
+
window.location.replace(href);
|
| 1589 |
+
}
|
| 1590 |
+
});
|
| 1591 |
+
}
|
| 1592 |
|
| 1593 |
+
function go(n) {
|
| 1594 |
+
globalHistory.go(n);
|
| 1595 |
+
}
|
| 1596 |
|
| 1597 |
+
function goBack() {
|
| 1598 |
+
go(-1);
|
| 1599 |
+
}
|
| 1600 |
|
| 1601 |
+
function goForward() {
|
| 1602 |
+
go(1);
|
| 1603 |
+
}
|
| 1604 |
|
| 1605 |
+
var listenerCount = 0;
|
| 1606 |
|
| 1607 |
+
function checkDOMListeners(delta) {
|
| 1608 |
+
listenerCount += delta;
|
| 1609 |
|
| 1610 |
+
if (listenerCount === 1 && delta === 1) {
|
| 1611 |
+
window.addEventListener(PopStateEvent, handlePopState);
|
| 1612 |
+
if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);
|
| 1613 |
+
} else if (listenerCount === 0) {
|
| 1614 |
+
window.removeEventListener(PopStateEvent, handlePopState);
|
| 1615 |
+
if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);
|
| 1616 |
+
}
|
| 1617 |
+
}
|
| 1618 |
|
| 1619 |
+
var isBlocked = false;
|
| 1620 |
|
| 1621 |
+
function block(prompt) {
|
| 1622 |
+
if (prompt === void 0) {
|
| 1623 |
+
prompt = false;
|
| 1624 |
+
}
|
| 1625 |
|
| 1626 |
+
var unblock = transitionManager.setPrompt(prompt);
|
| 1627 |
|
| 1628 |
+
if (!isBlocked) {
|
| 1629 |
+
checkDOMListeners(1);
|
| 1630 |
+
isBlocked = true;
|
| 1631 |
+
}
|
| 1632 |
|
| 1633 |
+
return function () {
|
| 1634 |
+
if (isBlocked) {
|
| 1635 |
+
isBlocked = false;
|
| 1636 |
+
checkDOMListeners(-1);
|
| 1637 |
+
}
|
| 1638 |
|
| 1639 |
+
return unblock();
|
| 1640 |
+
};
|
| 1641 |
+
}
|
|
|
|
|
|
|
| 1642 |
|
| 1643 |
+
function listen(listener) {
|
| 1644 |
+
var unlisten = transitionManager.appendListener(listener);
|
| 1645 |
+
checkDOMListeners(1);
|
| 1646 |
+
return function () {
|
| 1647 |
+
checkDOMListeners(-1);
|
| 1648 |
+
unlisten();
|
| 1649 |
+
};
|
| 1650 |
+
}
|
| 1651 |
|
| 1652 |
+
var history = {
|
| 1653 |
+
length: globalHistory.length,
|
| 1654 |
+
action: 'POP',
|
| 1655 |
+
location: initialLocation,
|
| 1656 |
+
createHref: createHref,
|
| 1657 |
+
push: push,
|
| 1658 |
+
replace: replace,
|
| 1659 |
+
go: go,
|
| 1660 |
+
goBack: goBack,
|
| 1661 |
+
goForward: goForward,
|
| 1662 |
+
block: block,
|
| 1663 |
+
listen: listen
|
| 1664 |
+
};
|
| 1665 |
+
return history;
|
| 1666 |
+
}
|
| 1667 |
|
| 1668 |
+
var HashChangeEvent$1 = 'hashchange';
|
| 1669 |
+
var HashPathCoders = {
|
| 1670 |
+
hashbang: {
|
| 1671 |
+
encodePath: function encodePath(path) {
|
| 1672 |
+
return path.charAt(0) === '!' ? path : '!/' + stripLeadingSlash(path);
|
| 1673 |
+
},
|
| 1674 |
+
decodePath: function decodePath(path) {
|
| 1675 |
+
return path.charAt(0) === '!' ? path.substr(1) : path;
|
| 1676 |
+
}
|
| 1677 |
+
},
|
| 1678 |
+
noslash: {
|
| 1679 |
+
encodePath: stripLeadingSlash,
|
| 1680 |
+
decodePath: addLeadingSlash
|
| 1681 |
+
},
|
| 1682 |
+
slash: {
|
| 1683 |
+
encodePath: addLeadingSlash,
|
| 1684 |
+
decodePath: addLeadingSlash
|
| 1685 |
+
}
|
| 1686 |
};
|
| 1687 |
|
| 1688 |
+
function stripHash(url) {
|
| 1689 |
+
var hashIndex = url.indexOf('#');
|
| 1690 |
+
return hashIndex === -1 ? url : url.slice(0, hashIndex);
|
| 1691 |
+
}
|
| 1692 |
|
| 1693 |
+
function getHashPath() {
|
| 1694 |
+
// We can't use window.location.hash here because it's not
|
| 1695 |
+
// consistent across browsers - Firefox will pre-decode it!
|
| 1696 |
+
var href = window.location.href;
|
| 1697 |
+
var hashIndex = href.indexOf('#');
|
| 1698 |
+
return hashIndex === -1 ? '' : href.substring(hashIndex + 1);
|
| 1699 |
+
}
|
| 1700 |
|
| 1701 |
+
function pushHashPath(path) {
|
| 1702 |
+
window.location.hash = path;
|
| 1703 |
+
}
|
|
|
|
| 1704 |
|
| 1705 |
+
function replaceHashPath(path) {
|
| 1706 |
+
window.location.replace(stripHash(window.location.href) + '#' + path);
|
| 1707 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1708 |
|
| 1709 |
+
function createHashHistory(props) {
|
| 1710 |
+
if (props === void 0) {
|
| 1711 |
+
props = {};
|
| 1712 |
+
}
|
| 1713 |
|
| 1714 |
+
!canUseDOM ? false ? undefined : Object(tiny_invariant_esm["a" /* default */])(false) : void 0;
|
| 1715 |
+
var globalHistory = window.history;
|
| 1716 |
+
var canGoWithoutReload = supportsGoWithoutReloadUsingHash();
|
| 1717 |
+
var _props = props,
|
| 1718 |
+
_props$getUserConfirm = _props.getUserConfirmation,
|
| 1719 |
+
getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,
|
| 1720 |
+
_props$hashType = _props.hashType,
|
| 1721 |
+
hashType = _props$hashType === void 0 ? 'slash' : _props$hashType;
|
| 1722 |
+
var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';
|
| 1723 |
+
var _HashPathCoders$hashT = HashPathCoders[hashType],
|
| 1724 |
+
encodePath = _HashPathCoders$hashT.encodePath,
|
| 1725 |
+
decodePath = _HashPathCoders$hashT.decodePath;
|
| 1726 |
|
| 1727 |
+
function getDOMLocation() {
|
| 1728 |
+
var path = decodePath(getHashPath());
|
| 1729 |
+
false ? undefined : void 0;
|
| 1730 |
+
if (basename) path = stripBasename(path, basename);
|
| 1731 |
+
return createLocation(path);
|
| 1732 |
+
}
|
| 1733 |
|
| 1734 |
+
var transitionManager = createTransitionManager();
|
| 1735 |
+
|
| 1736 |
+
function setState(nextState) {
|
| 1737 |
+
Object(esm_extends["a" /* default */])(history, nextState);
|
| 1738 |
+
|
| 1739 |
+
history.length = globalHistory.length;
|
| 1740 |
+
transitionManager.notifyListeners(history.location, history.action);
|
| 1741 |
+
}
|
| 1742 |
+
|
| 1743 |
+
var forceNextPop = false;
|
| 1744 |
+
var ignorePath = null;
|
| 1745 |
+
|
| 1746 |
+
function locationsAreEqual$$1(a, b) {
|
| 1747 |
+
return a.pathname === b.pathname && a.search === b.search && a.hash === b.hash;
|
| 1748 |
+
}
|
| 1749 |
+
|
| 1750 |
+
function handleHashChange() {
|
| 1751 |
+
var path = getHashPath();
|
| 1752 |
+
var encodedPath = encodePath(path);
|
| 1753 |
+
|
| 1754 |
+
if (path !== encodedPath) {
|
| 1755 |
+
// Ensure we always have a properly-encoded hash.
|
| 1756 |
+
replaceHashPath(encodedPath);
|
| 1757 |
+
} else {
|
| 1758 |
+
var location = getDOMLocation();
|
| 1759 |
+
var prevLocation = history.location;
|
| 1760 |
+
if (!forceNextPop && locationsAreEqual$$1(prevLocation, location)) return; // A hashchange doesn't always == location change.
|
| 1761 |
+
|
| 1762 |
+
if (ignorePath === createPath(location)) return; // Ignore this change; we already setState in push/replace.
|
| 1763 |
+
|
| 1764 |
+
ignorePath = null;
|
| 1765 |
+
handlePop(location);
|
| 1766 |
+
}
|
| 1767 |
+
}
|
| 1768 |
+
|
| 1769 |
+
function handlePop(location) {
|
| 1770 |
+
if (forceNextPop) {
|
| 1771 |
+
forceNextPop = false;
|
| 1772 |
+
setState();
|
| 1773 |
+
} else {
|
| 1774 |
+
var action = 'POP';
|
| 1775 |
+
transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
|
| 1776 |
+
if (ok) {
|
| 1777 |
+
setState({
|
| 1778 |
+
action: action,
|
| 1779 |
location: location
|
| 1780 |
});
|
| 1781 |
} else {
|
| 1782 |
+
revertPop(location);
|
| 1783 |
}
|
| 1784 |
});
|
| 1785 |
}
|
|
|
|
|
|
|
| 1786 |
}
|
| 1787 |
|
| 1788 |
+
function revertPop(fromLocation) {
|
| 1789 |
+
var toLocation = history.location; // TODO: We could probably make this more reliable by
|
| 1790 |
+
// keeping a list of paths we've seen in sessionStorage.
|
| 1791 |
+
// Instead, we just default to 0 for paths we don't know.
|
| 1792 |
|
| 1793 |
+
var toIndex = allPaths.lastIndexOf(createPath(toLocation));
|
| 1794 |
+
if (toIndex === -1) toIndex = 0;
|
| 1795 |
+
var fromIndex = allPaths.lastIndexOf(createPath(fromLocation));
|
| 1796 |
+
if (fromIndex === -1) fromIndex = 0;
|
| 1797 |
+
var delta = toIndex - fromIndex;
|
| 1798 |
|
| 1799 |
+
if (delta) {
|
| 1800 |
+
forceNextPop = true;
|
| 1801 |
+
go(delta);
|
|
|
|
| 1802 |
}
|
| 1803 |
+
} // Ensure the hash is encoded properly before doing anything else.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1804 |
|
|
|
|
|
|
|
|
|
|
| 1805 |
|
| 1806 |
+
var path = getHashPath();
|
| 1807 |
+
var encodedPath = encodePath(path);
|
| 1808 |
+
if (path !== encodedPath) replaceHashPath(encodedPath);
|
| 1809 |
+
var initialLocation = getDOMLocation();
|
| 1810 |
+
var allPaths = [createPath(initialLocation)]; // Public interface
|
| 1811 |
|
| 1812 |
+
function createHref(location) {
|
| 1813 |
+
var baseTag = document.querySelector('base');
|
| 1814 |
+
var href = '';
|
| 1815 |
|
| 1816 |
+
if (baseTag && baseTag.getAttribute('href')) {
|
| 1817 |
+
href = stripHash(window.location.href);
|
| 1818 |
}
|
| 1819 |
|
| 1820 |
+
return href + '#' + encodePath(basename + createPath(location));
|
|
|
|
|
|
|
| 1821 |
}
|
| 1822 |
|
| 1823 |
+
function push(path, state) {
|
| 1824 |
+
false ? undefined : void 0;
|
| 1825 |
+
var action = 'PUSH';
|
| 1826 |
+
var location = createLocation(path, undefined, undefined, history.location);
|
| 1827 |
+
transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
|
| 1828 |
+
if (!ok) return;
|
| 1829 |
+
var path = createPath(location);
|
| 1830 |
+
var encodedPath = encodePath(basename + path);
|
| 1831 |
+
var hashChanged = getHashPath() !== encodedPath;
|
| 1832 |
|
| 1833 |
+
if (hashChanged) {
|
| 1834 |
+
// We cannot tell if a hashchange was caused by a PUSH, so we'd
|
| 1835 |
+
// rather setState here and ignore the hashchange. The caveat here
|
| 1836 |
+
// is that other hash histories in the page will consider it a POP.
|
| 1837 |
+
ignorePath = path;
|
| 1838 |
+
pushHashPath(encodedPath);
|
| 1839 |
+
var prevIndex = allPaths.lastIndexOf(createPath(history.location));
|
| 1840 |
+
var nextPaths = allPaths.slice(0, prevIndex + 1);
|
| 1841 |
+
nextPaths.push(path);
|
| 1842 |
+
allPaths = nextPaths;
|
| 1843 |
+
setState({
|
| 1844 |
+
action: action,
|
| 1845 |
+
location: location
|
| 1846 |
+
});
|
| 1847 |
+
} else {
|
| 1848 |
+
false ? undefined : void 0;
|
| 1849 |
+
setState();
|
| 1850 |
+
}
|
| 1851 |
});
|
| 1852 |
+
}
|
| 1853 |
|
| 1854 |
+
function replace(path, state) {
|
| 1855 |
+
false ? undefined : void 0;
|
| 1856 |
+
var action = 'REPLACE';
|
| 1857 |
+
var location = createLocation(path, undefined, undefined, history.location);
|
| 1858 |
+
transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
|
| 1859 |
+
if (!ok) return;
|
| 1860 |
+
var path = createPath(location);
|
| 1861 |
+
var encodedPath = encodePath(basename + path);
|
| 1862 |
+
var hashChanged = getHashPath() !== encodedPath;
|
| 1863 |
|
| 1864 |
+
if (hashChanged) {
|
| 1865 |
+
// We cannot tell if a hashchange was caused by a REPLACE, so we'd
|
| 1866 |
+
// rather setState here and ignore the hashchange. The caveat here
|
| 1867 |
+
// is that other hash histories in the page will consider it a POP.
|
| 1868 |
+
ignorePath = path;
|
| 1869 |
+
replaceHashPath(encodedPath);
|
| 1870 |
+
}
|
| 1871 |
|
| 1872 |
+
var prevIndex = allPaths.indexOf(createPath(history.location));
|
| 1873 |
+
if (prevIndex !== -1) allPaths[prevIndex] = path;
|
| 1874 |
+
setState({
|
| 1875 |
+
action: action,
|
| 1876 |
+
location: location
|
| 1877 |
+
});
|
| 1878 |
+
});
|
| 1879 |
+
}
|
| 1880 |
|
| 1881 |
+
function go(n) {
|
| 1882 |
+
false ? undefined : void 0;
|
| 1883 |
+
globalHistory.go(n);
|
| 1884 |
}
|
| 1885 |
|
| 1886 |
+
function goBack() {
|
| 1887 |
+
go(-1);
|
| 1888 |
+
}
|
| 1889 |
|
| 1890 |
+
function goForward() {
|
| 1891 |
+
go(1);
|
| 1892 |
+
}
|
| 1893 |
|
| 1894 |
+
var listenerCount = 0;
|
|
|
|
|
|
|
| 1895 |
|
| 1896 |
+
function checkDOMListeners(delta) {
|
| 1897 |
+
listenerCount += delta;
|
|
|
|
| 1898 |
|
| 1899 |
+
if (listenerCount === 1 && delta === 1) {
|
| 1900 |
+
window.addEventListener(HashChangeEvent$1, handleHashChange);
|
| 1901 |
+
} else if (listenerCount === 0) {
|
| 1902 |
+
window.removeEventListener(HashChangeEvent$1, handleHashChange);
|
| 1903 |
+
}
|
| 1904 |
+
}
|
| 1905 |
|
| 1906 |
+
var isBlocked = false;
|
|
|
|
| 1907 |
|
| 1908 |
+
function block(prompt) {
|
| 1909 |
+
if (prompt === void 0) {
|
| 1910 |
+
prompt = false;
|
| 1911 |
+
}
|
| 1912 |
|
| 1913 |
+
var unblock = transitionManager.setPrompt(prompt);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1914 |
|
| 1915 |
+
if (!isBlocked) {
|
| 1916 |
+
checkDOMListeners(1);
|
| 1917 |
+
isBlocked = true;
|
| 1918 |
+
}
|
| 1919 |
|
| 1920 |
+
return function () {
|
| 1921 |
+
if (isBlocked) {
|
| 1922 |
+
isBlocked = false;
|
| 1923 |
+
checkDOMListeners(-1);
|
| 1924 |
+
}
|
| 1925 |
|
| 1926 |
+
return unblock();
|
| 1927 |
+
};
|
| 1928 |
+
}
|
| 1929 |
|
| 1930 |
+
function listen(listener) {
|
| 1931 |
+
var unlisten = transitionManager.appendListener(listener);
|
| 1932 |
+
checkDOMListeners(1);
|
| 1933 |
+
return function () {
|
| 1934 |
+
checkDOMListeners(-1);
|
| 1935 |
+
unlisten();
|
| 1936 |
+
};
|
| 1937 |
}
|
| 1938 |
|
| 1939 |
+
var history = {
|
| 1940 |
+
length: globalHistory.length,
|
| 1941 |
+
action: 'POP',
|
| 1942 |
+
location: initialLocation,
|
| 1943 |
+
createHref: createHref,
|
| 1944 |
+
push: push,
|
| 1945 |
+
replace: replace,
|
| 1946 |
+
go: go,
|
| 1947 |
+
goBack: goBack,
|
| 1948 |
+
goForward: goForward,
|
| 1949 |
+
block: block,
|
| 1950 |
+
listen: listen
|
| 1951 |
+
};
|
| 1952 |
+
return history;
|
| 1953 |
+
}
|
| 1954 |
+
|
| 1955 |
+
function clamp(n, lowerBound, upperBound) {
|
| 1956 |
+
return Math.min(Math.max(n, lowerBound), upperBound);
|
| 1957 |
}
|
| 1958 |
/**
|
| 1959 |
+
* Creates a history object that stores locations in memory.
|
| 1960 |
*/
|
| 1961 |
|
| 1962 |
|
| 1963 |
+
function createMemoryHistory(props) {
|
| 1964 |
+
if (props === void 0) {
|
| 1965 |
+
props = {};
|
| 1966 |
}
|
| 1967 |
|
| 1968 |
+
var _props = props,
|
| 1969 |
+
getUserConfirmation = _props.getUserConfirmation,
|
| 1970 |
+
_props$initialEntries = _props.initialEntries,
|
| 1971 |
+
initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,
|
| 1972 |
+
_props$initialIndex = _props.initialIndex,
|
| 1973 |
+
initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,
|
| 1974 |
+
_props$keyLength = _props.keyLength,
|
| 1975 |
+
keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;
|
| 1976 |
+
var transitionManager = createTransitionManager();
|
| 1977 |
|
| 1978 |
+
function setState(nextState) {
|
| 1979 |
+
Object(esm_extends["a" /* default */])(history, nextState);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1980 |
|
| 1981 |
+
history.length = history.entries.length;
|
| 1982 |
+
transitionManager.notifyListeners(history.location, history.action);
|
| 1983 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1984 |
|
| 1985 |
+
function createKey() {
|
| 1986 |
+
return Math.random().toString(36).substr(2, keyLength);
|
| 1987 |
+
}
|
|
|
|
| 1988 |
|
| 1989 |
+
var index = clamp(initialIndex, 0, initialEntries.length - 1);
|
| 1990 |
+
var entries = initialEntries.map(function (entry) {
|
| 1991 |
+
return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());
|
| 1992 |
+
}); // Public interface
|
|
|
|
|
|
|
| 1993 |
|
| 1994 |
+
var createHref = createPath;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1995 |
|
| 1996 |
+
function push(path, state) {
|
| 1997 |
+
false ? undefined : void 0;
|
| 1998 |
+
var action = 'PUSH';
|
| 1999 |
+
var location = createLocation(path, state, createKey(), history.location);
|
| 2000 |
+
transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
|
| 2001 |
+
if (!ok) return;
|
| 2002 |
+
var prevIndex = history.index;
|
| 2003 |
+
var nextIndex = prevIndex + 1;
|
| 2004 |
+
var nextEntries = history.entries.slice(0);
|
| 2005 |
|
| 2006 |
+
if (nextEntries.length > nextIndex) {
|
| 2007 |
+
nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);
|
| 2008 |
+
} else {
|
| 2009 |
+
nextEntries.push(location);
|
| 2010 |
+
}
|
| 2011 |
|
| 2012 |
+
setState({
|
| 2013 |
+
action: action,
|
| 2014 |
+
location: location,
|
| 2015 |
+
index: nextIndex,
|
| 2016 |
+
entries: nextEntries
|
| 2017 |
+
});
|
| 2018 |
+
});
|
| 2019 |
+
}
|
|
|
|
|
|
|
| 2020 |
|
| 2021 |
+
function replace(path, state) {
|
| 2022 |
+
false ? undefined : void 0;
|
| 2023 |
+
var action = 'REPLACE';
|
| 2024 |
+
var location = createLocation(path, state, createKey(), history.location);
|
| 2025 |
+
transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
|
| 2026 |
+
if (!ok) return;
|
| 2027 |
+
history.entries[history.index] = location;
|
| 2028 |
+
setState({
|
| 2029 |
+
action: action,
|
| 2030 |
+
location: location
|
| 2031 |
+
});
|
| 2032 |
+
});
|
| 2033 |
}
|
| 2034 |
|
| 2035 |
+
function go(n) {
|
| 2036 |
+
var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);
|
| 2037 |
+
var action = 'POP';
|
| 2038 |
+
var location = history.entries[nextIndex];
|
| 2039 |
+
transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
|
| 2040 |
+
if (ok) {
|
| 2041 |
+
setState({
|
| 2042 |
+
action: action,
|
| 2043 |
+
location: location,
|
| 2044 |
+
index: nextIndex
|
| 2045 |
+
});
|
| 2046 |
+
} else {
|
| 2047 |
+
// Mimic the behavior of DOM histories by
|
| 2048 |
+
// causing a render after a cancelled POP.
|
| 2049 |
+
setState();
|
| 2050 |
+
}
|
| 2051 |
+
});
|
| 2052 |
+
}
|
| 2053 |
|
| 2054 |
+
function goBack() {
|
| 2055 |
+
go(-1);
|
| 2056 |
+
}
|
| 2057 |
|
| 2058 |
+
function goForward() {
|
| 2059 |
+
go(1);
|
|
|
|
| 2060 |
}
|
| 2061 |
|
| 2062 |
+
function canGo(n) {
|
| 2063 |
+
var nextIndex = history.index + n;
|
| 2064 |
+
return nextIndex >= 0 && nextIndex < history.entries.length;
|
|
|
|
| 2065 |
}
|
| 2066 |
|
| 2067 |
+
function block(prompt) {
|
| 2068 |
+
if (prompt === void 0) {
|
| 2069 |
+
prompt = false;
|
| 2070 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2071 |
|
| 2072 |
+
return transitionManager.setPrompt(prompt);
|
| 2073 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2074 |
|
| 2075 |
+
function listen(listener) {
|
| 2076 |
+
return transitionManager.appendListener(listener);
|
| 2077 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2078 |
|
| 2079 |
+
var history = {
|
| 2080 |
+
length: entries.length,
|
| 2081 |
+
action: 'POP',
|
| 2082 |
+
location: entries[index],
|
| 2083 |
+
index: index,
|
| 2084 |
+
entries: entries,
|
| 2085 |
+
createHref: createHref,
|
| 2086 |
+
push: push,
|
| 2087 |
+
replace: replace,
|
| 2088 |
+
go: go,
|
| 2089 |
+
goBack: goBack,
|
| 2090 |
+
goForward: goForward,
|
| 2091 |
+
canGo: canGo,
|
| 2092 |
+
block: block,
|
| 2093 |
+
listen: listen
|
| 2094 |
+
};
|
| 2095 |
+
return history;
|
| 2096 |
}
|
| 2097 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2098 |
|
| 2099 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2100 |
|
| 2101 |
+
/***/ }),
|
|
|
|
|
|
|
| 2102 |
|
| 2103 |
+
/***/ 129:
|
| 2104 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
| 2105 |
|
| 2106 |
+
"use strict";
|
| 2107 |
+
/* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(21);
|
| 2108 |
+
/* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(22);
|
| 2109 |
+
/* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(13);
|
| 2110 |
+
/* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(23);
|
| 2111 |
+
/* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(24);
|
| 2112 |
+
/* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(10);
|
| 2113 |
+
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(0);
|
| 2114 |
+
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__);
|
| 2115 |
+
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(96);
|
| 2116 |
+
/* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(54);
|
| 2117 |
+
/* harmony import */ var _wordpress_dom__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(73);
|
| 2118 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2119 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2120 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2121 |
|
|
|
|
|
|
|
|
|
|
| 2122 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2123 |
|
|
|
|
|
|
|
| 2124 |
|
|
|
|
| 2125 |
|
| 2126 |
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__[/* default */ "a"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__[/* default */ "a"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__[/* default */ "a"])(this, result); }; }
|
|
|
|
|
|
|
| 2127 |
|
| 2128 |
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2129 |
|
| 2130 |
+
/**
|
| 2131 |
+
* WordPress dependencies
|
| 2132 |
+
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2133 |
|
|
|
|
|
|
|
|
|
|
| 2134 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2135 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2136 |
|
| 2137 |
+
var withConstrainedTabbing = Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_7__[/* default */ "a"])(function (WrappedComponent) {
|
| 2138 |
+
return /*#__PURE__*/function (_Component) {
|
| 2139 |
+
Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"])(_class, _Component);
|
| 2140 |
|
| 2141 |
+
var _super = _createSuper(_class);
|
|
|
|
|
|
|
|
|
|
| 2142 |
|
| 2143 |
+
function _class() {
|
| 2144 |
+
var _this;
|
| 2145 |
|
| 2146 |
+
Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(this, _class);
|
| 2147 |
+
|
| 2148 |
+
_this = _super.apply(this, arguments);
|
| 2149 |
+
_this.focusContainRef = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createRef"])();
|
| 2150 |
+
_this.handleTabBehaviour = _this.handleTabBehaviour.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"])(_this));
|
| 2151 |
+
return _this;
|
| 2152 |
}
|
| 2153 |
|
| 2154 |
+
Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(_class, [{
|
| 2155 |
+
key: "handleTabBehaviour",
|
| 2156 |
+
value: function handleTabBehaviour(event) {
|
| 2157 |
+
if (event.keyCode !== _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_8__[/* TAB */ "e"]) {
|
| 2158 |
+
return;
|
| 2159 |
+
}
|
| 2160 |
|
| 2161 |
+
var tabbables = _wordpress_dom__WEBPACK_IMPORTED_MODULE_9__[/* focus */ "a"].tabbable.find(this.focusContainRef.current);
|
|
|
|
|
|
|
| 2162 |
|
| 2163 |
+
if (!tabbables.length) {
|
| 2164 |
+
return;
|
| 2165 |
+
}
|
| 2166 |
|
| 2167 |
+
var firstTabbable = tabbables[0];
|
| 2168 |
+
var lastTabbable = tabbables[tabbables.length - 1];
|
| 2169 |
+
|
| 2170 |
+
if (event.shiftKey && event.target === firstTabbable) {
|
| 2171 |
+
event.preventDefault();
|
| 2172 |
+
lastTabbable.focus();
|
| 2173 |
+
} else if (!event.shiftKey && event.target === lastTabbable) {
|
| 2174 |
+
event.preventDefault();
|
| 2175 |
+
firstTabbable.focus();
|
| 2176 |
+
/*
|
| 2177 |
+
* When pressing Tab and none of the tabbables has focus, the keydown
|
| 2178 |
+
* event happens on the wrapper div: move focus on the first tabbable.
|
| 2179 |
+
*/
|
| 2180 |
+
} else if (!tabbables.includes(event.target)) {
|
| 2181 |
+
event.preventDefault();
|
| 2182 |
+
firstTabbable.focus();
|
| 2183 |
+
}
|
| 2184 |
+
}
|
| 2185 |
+
}, {
|
| 2186 |
+
key: "render",
|
| 2187 |
+
value: function render() {
|
| 2188 |
+
// Disable reason: this component is non-interactive, but must capture
|
| 2189 |
+
// events from the wrapped component to determine when the Tab key is used.
|
| 2190 |
+
|
| 2191 |
+
/* eslint-disable jsx-a11y/no-static-element-interactions */
|
| 2192 |
+
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("div", {
|
| 2193 |
+
onKeyDown: this.handleTabBehaviour,
|
| 2194 |
+
ref: this.focusContainRef,
|
| 2195 |
+
tabIndex: "-1"
|
| 2196 |
+
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(WrappedComponent, this.props));
|
| 2197 |
+
/* eslint-enable jsx-a11y/no-static-element-interactions */
|
| 2198 |
+
}
|
| 2199 |
+
}]);
|
| 2200 |
|
| 2201 |
+
return _class;
|
| 2202 |
+
}(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Component"]);
|
| 2203 |
+
}, 'withConstrainedTabbing');
|
| 2204 |
+
/* harmony default export */ __webpack_exports__["a"] = (withConstrainedTabbing);
|
| 2205 |
+
//# sourceMappingURL=index.js.map
|
| 2206 |
|
| 2207 |
+
/***/ }),
|
|
|
|
| 2208 |
|
| 2209 |
+
/***/ 13:
|
| 2210 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
| 2211 |
|
| 2212 |
+
"use strict";
|
| 2213 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _assertThisInitialized; });
|
| 2214 |
+
function _assertThisInitialized(self) {
|
| 2215 |
+
if (self === void 0) {
|
| 2216 |
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
| 2217 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2218 |
|
| 2219 |
+
return self;
|
| 2220 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2221 |
|
| 2222 |
+
/***/ }),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2223 |
|
| 2224 |
+
/***/ 130:
|
| 2225 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
| 2226 |
|
| 2227 |
+
"use strict";
|
| 2228 |
+
/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7);
|
| 2229 |
+
/* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(21);
|
| 2230 |
+
/* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(22);
|
| 2231 |
+
/* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(13);
|
| 2232 |
+
/* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(23);
|
| 2233 |
+
/* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(24);
|
| 2234 |
+
/* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(10);
|
| 2235 |
+
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(0);
|
| 2236 |
+
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__);
|
| 2237 |
+
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(2);
|
| 2238 |
+
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_8__);
|
| 2239 |
+
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(96);
|
| 2240 |
|
|
|
|
|
|
|
|
|
|
| 2241 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2242 |
|
|
|
|
|
|
|
|
|
|
| 2243 |
|
|
|
|
| 2244 |
|
|
|
|
|
|
|
| 2245 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2246 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2247 |
|
|
|
|
|
|
|
| 2248 |
|
| 2249 |
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6__[/* default */ "a"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6__[/* default */ "a"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5__[/* default */ "a"])(this, result); }; }
|
| 2250 |
+
|
| 2251 |
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
| 2252 |
|
| 2253 |
/**
|
| 2254 |
+
* External dependencies
|
| 2255 |
*/
|
| 2256 |
|
| 2257 |
+
/**
|
| 2258 |
+
* WordPress dependencies
|
| 2259 |
+
*/
|
| 2260 |
|
|
|
|
|
|
|
|
|
|
| 2261 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2262 |
|
| 2263 |
+
/**
|
| 2264 |
+
* Input types which are classified as button types, for use in considering
|
| 2265 |
+
* whether element is a (focus-normalized) button.
|
| 2266 |
+
*
|
| 2267 |
+
* @type {string[]}
|
| 2268 |
+
*/
|
| 2269 |
|
| 2270 |
+
var INPUT_BUTTON_TYPES = ['button', 'submit'];
|
| 2271 |
+
/**
|
| 2272 |
+
* Returns true if the given element is a button element subject to focus
|
| 2273 |
+
* normalization, or false otherwise.
|
| 2274 |
+
*
|
| 2275 |
+
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#Clicking_and_focus
|
| 2276 |
+
*
|
| 2277 |
+
* @param {Element} element Element to test.
|
| 2278 |
+
*
|
| 2279 |
+
* @return {boolean} Whether element is a button.
|
| 2280 |
+
*/
|
| 2281 |
|
| 2282 |
+
function isFocusNormalizedButton(element) {
|
| 2283 |
+
switch (element.nodeName) {
|
| 2284 |
+
case 'A':
|
| 2285 |
+
case 'BUTTON':
|
| 2286 |
+
return true;
|
| 2287 |
|
| 2288 |
+
case 'INPUT':
|
| 2289 |
+
return Object(lodash__WEBPACK_IMPORTED_MODULE_8__["includes"])(INPUT_BUTTON_TYPES, element.type);
|
| 2290 |
+
}
|
| 2291 |
|
| 2292 |
+
return false;
|
| 2293 |
}
|
|
|
|
|
|
|
| 2294 |
|
| 2295 |
+
/* harmony default export */ __webpack_exports__["a"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_9__[/* default */ "a"])(function (WrappedComponent) {
|
| 2296 |
+
return /*#__PURE__*/function (_Component) {
|
| 2297 |
+
Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__[/* default */ "a"])(_class, _Component);
|
|
|
|
| 2298 |
|
| 2299 |
+
var _super = _createSuper(_class);
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2300 |
|
| 2301 |
+
function _class() {
|
| 2302 |
+
var _this;
|
|
|
|
|
|
|
| 2303 |
|
| 2304 |
+
Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(this, _class);
|
| 2305 |
|
| 2306 |
+
_this = _super.apply(this, arguments);
|
| 2307 |
+
_this.bindNode = _this.bindNode.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"])(_this));
|
| 2308 |
+
_this.cancelBlurCheck = _this.cancelBlurCheck.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"])(_this));
|
| 2309 |
+
_this.queueBlurCheck = _this.queueBlurCheck.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"])(_this));
|
| 2310 |
+
_this.normalizeButtonFocus = _this.normalizeButtonFocus.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"])(_this));
|
| 2311 |
+
return _this;
|
| 2312 |
+
}
|
| 2313 |
|
| 2314 |
+
Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"])(_class, [{
|
| 2315 |
+
key: "componentWillUnmount",
|
| 2316 |
+
value: function componentWillUnmount() {
|
| 2317 |
+
this.cancelBlurCheck();
|
| 2318 |
+
}
|
| 2319 |
+
}, {
|
| 2320 |
+
key: "bindNode",
|
| 2321 |
+
value: function bindNode(node) {
|
| 2322 |
+
if (node) {
|
| 2323 |
+
this.node = node;
|
| 2324 |
+
} else {
|
| 2325 |
+
delete this.node;
|
| 2326 |
+
this.cancelBlurCheck();
|
| 2327 |
+
}
|
| 2328 |
+
}
|
| 2329 |
+
}, {
|
| 2330 |
+
key: "queueBlurCheck",
|
| 2331 |
+
value: function queueBlurCheck(event) {
|
| 2332 |
+
var _this2 = this;
|
| 2333 |
|
| 2334 |
+
// React does not allow using an event reference asynchronously
|
| 2335 |
+
// due to recycling behavior, except when explicitly persisted.
|
| 2336 |
+
event.persist(); // Skip blur check if clicking button. See `normalizeButtonFocus`.
|
| 2337 |
|
| 2338 |
+
if (this.preventBlurCheck) {
|
| 2339 |
+
return;
|
| 2340 |
+
}
|
| 2341 |
|
| 2342 |
+
this.blurCheckTimeout = setTimeout(function () {
|
| 2343 |
+
// If document is not focused then focus should remain
|
| 2344 |
+
// inside the wrapped component and therefore we cancel
|
| 2345 |
+
// this blur event thereby leaving focus in place.
|
| 2346 |
+
// https://developer.mozilla.org/en-US/docs/Web/API/Document/hasFocus.
|
| 2347 |
+
if (!document.hasFocus()) {
|
| 2348 |
+
event.preventDefault();
|
| 2349 |
+
return;
|
| 2350 |
+
}
|
| 2351 |
|
| 2352 |
+
if ('function' === typeof _this2.node.handleFocusOutside) {
|
| 2353 |
+
_this2.node.handleFocusOutside(event);
|
| 2354 |
+
}
|
| 2355 |
+
}, 0);
|
| 2356 |
+
}
|
| 2357 |
+
}, {
|
| 2358 |
+
key: "cancelBlurCheck",
|
| 2359 |
+
value: function cancelBlurCheck() {
|
| 2360 |
+
clearTimeout(this.blurCheckTimeout);
|
| 2361 |
+
}
|
| 2362 |
+
/**
|
| 2363 |
+
* Handles a mousedown or mouseup event to respectively assign and
|
| 2364 |
+
* unassign a flag for preventing blur check on button elements. Some
|
| 2365 |
+
* browsers, namely Firefox and Safari, do not emit a focus event on
|
| 2366 |
+
* button elements when clicked, while others do. The logic here
|
| 2367 |
+
* intends to normalize this as treating click on buttons as focus.
|
| 2368 |
+
*
|
| 2369 |
+
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#Clicking_and_focus
|
| 2370 |
+
*
|
| 2371 |
+
* @param {MouseEvent} event Event for mousedown or mouseup.
|
| 2372 |
+
*/
|
| 2373 |
|
| 2374 |
+
}, {
|
| 2375 |
+
key: "normalizeButtonFocus",
|
| 2376 |
+
value: function normalizeButtonFocus(event) {
|
| 2377 |
+
var type = event.type,
|
| 2378 |
+
target = event.target;
|
| 2379 |
+
var isInteractionEnd = Object(lodash__WEBPACK_IMPORTED_MODULE_8__["includes"])(['mouseup', 'touchend'], type);
|
| 2380 |
+
|
| 2381 |
+
if (isInteractionEnd) {
|
| 2382 |
+
this.preventBlurCheck = false;
|
| 2383 |
+
} else if (isFocusNormalizedButton(target)) {
|
| 2384 |
+
this.preventBlurCheck = true;
|
| 2385 |
+
}
|
| 2386 |
+
}
|
| 2387 |
+
}, {
|
| 2388 |
+
key: "render",
|
| 2389 |
+
value: function render() {
|
| 2390 |
+
// Disable reason: See `normalizeButtonFocus` for browser-specific
|
| 2391 |
+
// focus event normalization.
|
| 2392 |
+
|
| 2393 |
+
/* eslint-disable jsx-a11y/no-static-element-interactions */
|
| 2394 |
+
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])("div", {
|
| 2395 |
+
onFocus: this.cancelBlurCheck,
|
| 2396 |
+
onMouseDown: this.normalizeButtonFocus,
|
| 2397 |
+
onMouseUp: this.normalizeButtonFocus,
|
| 2398 |
+
onTouchStart: this.normalizeButtonFocus,
|
| 2399 |
+
onTouchEnd: this.normalizeButtonFocus,
|
| 2400 |
+
onBlur: this.queueBlurCheck
|
| 2401 |
+
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(WrappedComponent, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])({
|
| 2402 |
+
ref: this.bindNode
|
| 2403 |
+
}, this.props)));
|
| 2404 |
+
/* eslint-enable jsx-a11y/no-static-element-interactions */
|
| 2405 |
+
}
|
| 2406 |
+
}]);
|
| 2407 |
|
| 2408 |
+
return _class;
|
| 2409 |
+
}(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["Component"]);
|
| 2410 |
+
}, 'withFocusOutside'));
|
| 2411 |
+
//# sourceMappingURL=index.js.map
|
| 2412 |
|
| 2413 |
+
/***/ }),
|
|
|
|
| 2414 |
|
| 2415 |
+
/***/ 131:
|
| 2416 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
| 2417 |
|
| 2418 |
+
"use strict";
|
| 2419 |
+
/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7);
|
| 2420 |
+
/* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(12);
|
| 2421 |
+
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(0);
|
| 2422 |
+
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__);
|
| 2423 |
|
|
|
|
|
|
|
| 2424 |
|
|
|
|
|
|
|
| 2425 |
|
|
|
|
|
|
|
| 2426 |
|
| 2427 |
+
/**
|
| 2428 |
+
* WordPress dependencies
|
| 2429 |
+
*/
|
| 2430 |
|
| 2431 |
|
| 2432 |
+
function stopPropagation(event) {
|
| 2433 |
+
event.stopPropagation();
|
| 2434 |
+
}
|
| 2435 |
|
| 2436 |
+
/* harmony default export */ __webpack_exports__["a"] = (Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["forwardRef"])(function (_ref, ref) {
|
| 2437 |
+
var children = _ref.children,
|
| 2438 |
+
props = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(_ref, ["children"]);
|
| 2439 |
|
| 2440 |
+
// Disable reason: this stops certain events from propagating outside of the component.
|
| 2441 |
+
// - onMouseDown is disabled as this can cause interactions with other DOM elements
|
| 2442 |
|
| 2443 |
+
/* eslint-disable jsx-a11y/no-static-element-interactions */
|
| 2444 |
+
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])("div", Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])({}, props, {
|
| 2445 |
+
ref: ref,
|
| 2446 |
+
onMouseDown: stopPropagation
|
| 2447 |
+
}), children);
|
| 2448 |
+
/* eslint-enable jsx-a11y/no-static-element-interactions */
|
| 2449 |
+
}));
|
| 2450 |
+
//# sourceMappingURL=index.js.map
|
| 2451 |
|
| 2452 |
+
/***/ }),
|
| 2453 |
|
| 2454 |
+
/***/ 132:
|
| 2455 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
| 2456 |
|
| 2457 |
+
"use strict";
|
| 2458 |
|
| 2459 |
+
// UNUSED EXPORTS: Provider
|
|
|
|
|
|
|
| 2460 |
|
| 2461 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js + 3 modules
|
| 2462 |
+
var toConsumableArray = __webpack_require__(27);
|
| 2463 |
|
| 2464 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js
|
| 2465 |
+
var classCallCheck = __webpack_require__(21);
|
| 2466 |
|
| 2467 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/createClass.js
|
| 2468 |
+
var createClass = __webpack_require__(22);
|
| 2469 |
|
| 2470 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/inherits.js + 1 modules
|
| 2471 |
+
var inherits = __webpack_require__(23);
|
| 2472 |
|
| 2473 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js
|
| 2474 |
+
var possibleConstructorReturn = __webpack_require__(24);
|
| 2475 |
|
| 2476 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js
|
| 2477 |
+
var getPrototypeOf = __webpack_require__(10);
|
| 2478 |
|
| 2479 |
+
// EXTERNAL MODULE: external {"this":["wp","element"]}
|
| 2480 |
+
var external_this_wp_element_ = __webpack_require__(0);
|
| 2481 |
|
| 2482 |
+
// EXTERNAL MODULE: external "lodash"
|
| 2483 |
+
var external_lodash_ = __webpack_require__(2);
|
|
|
|
| 2484 |
|
| 2485 |
+
// EXTERNAL MODULE: ./node_modules/@wordpress/compose/build-module/utils/create-higher-order-component/index.js
|
| 2486 |
+
var create_higher_order_component = __webpack_require__(96);
|
| 2487 |
|
| 2488 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js
|
| 2489 |
+
var assertThisInitialized = __webpack_require__(13);
|
| 2490 |
|
| 2491 |
+
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/higher-order/with-focus-return/context.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2492 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2493 |
|
|
|
|
|
|
|
|
|
|
| 2494 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2495 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2496 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2497 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2498 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2499 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2500 |
|
| 2501 |
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Object(getPrototypeOf["a" /* default */])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Object(getPrototypeOf["a" /* default */])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Object(possibleConstructorReturn["a" /* default */])(this, result); }; }
|
| 2502 |
|
| 2503 |
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
|
|
|
| 2504 |
|
| 2505 |
+
/**
|
| 2506 |
+
* External dependencies
|
| 2507 |
+
*/
|
| 2508 |
|
| 2509 |
+
/**
|
| 2510 |
+
* WordPress dependencies
|
| 2511 |
+
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2512 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2513 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2514 |
|
| 2515 |
+
var _createContext = Object(external_this_wp_element_["createContext"])({
|
| 2516 |
+
focusHistory: []
|
| 2517 |
+
}),
|
| 2518 |
+
Provider = _createContext.Provider,
|
| 2519 |
+
Consumer = _createContext.Consumer;
|
| 2520 |
+
|
| 2521 |
+
Provider.displayName = 'FocusReturnProvider';
|
| 2522 |
+
Consumer.displayName = 'FocusReturnConsumer';
|
| 2523 |
/**
|
| 2524 |
+
* The maximum history length to capture for the focus stack. When exceeded,
|
| 2525 |
+
* items should be shifted from the stack for each consecutive push.
|
| 2526 |
*
|
| 2527 |
+
* @type {number}
|
|
|
|
|
|
|
| 2528 |
*/
|
| 2529 |
|
| 2530 |
+
var MAX_STACK_LENGTH = 100;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2531 |
|
| 2532 |
+
var context_FocusReturnProvider = /*#__PURE__*/function (_Component) {
|
| 2533 |
+
Object(inherits["a" /* default */])(FocusReturnProvider, _Component);
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2534 |
|
| 2535 |
+
var _super = _createSuper(FocusReturnProvider);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2536 |
|
| 2537 |
+
function FocusReturnProvider() {
|
| 2538 |
+
var _this;
|
| 2539 |
|
| 2540 |
+
Object(classCallCheck["a" /* default */])(this, FocusReturnProvider);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2541 |
|
| 2542 |
+
_this = _super.apply(this, arguments);
|
| 2543 |
+
_this.onFocus = _this.onFocus.bind(Object(assertThisInitialized["a" /* default */])(_this));
|
| 2544 |
+
_this.state = {
|
| 2545 |
+
focusHistory: []
|
| 2546 |
+
};
|
| 2547 |
+
return _this;
|
| 2548 |
+
}
|
| 2549 |
|
| 2550 |
+
Object(createClass["a" /* default */])(FocusReturnProvider, [{
|
| 2551 |
+
key: "onFocus",
|
| 2552 |
+
value: function onFocus(event) {
|
| 2553 |
+
var focusHistory = this.state.focusHistory; // Push the focused element to the history stack, keeping only unique
|
| 2554 |
+
// members but preferring the _last_ occurrence of any duplicates.
|
| 2555 |
+
// Lodash's `uniq` behavior favors the first occurrence, so the array
|
| 2556 |
+
// is temporarily reversed prior to it being called upon. Uniqueness
|
| 2557 |
+
// helps avoid situations where, such as in a constrained tabbing area,
|
| 2558 |
+
// the user changes focus enough within a transient element that the
|
| 2559 |
+
// stack may otherwise only consist of members pending destruction, at
|
| 2560 |
+
// which point focus might have been lost.
|
| 2561 |
+
|
| 2562 |
+
var nextFocusHistory = Object(external_lodash_["uniq"])([].concat(Object(toConsumableArray["a" /* default */])(focusHistory), [event.target]).slice(-1 * MAX_STACK_LENGTH).reverse()).reverse();
|
| 2563 |
+
this.setState({
|
| 2564 |
+
focusHistory: nextFocusHistory
|
| 2565 |
+
});
|
| 2566 |
}
|
| 2567 |
+
}, {
|
| 2568 |
+
key: "render",
|
| 2569 |
+
value: function render() {
|
| 2570 |
+
var _this$props = this.props,
|
| 2571 |
+
children = _this$props.children,
|
| 2572 |
+
className = _this$props.className;
|
| 2573 |
+
return Object(external_this_wp_element_["createElement"])(Provider, {
|
| 2574 |
+
value: this.state
|
| 2575 |
+
}, Object(external_this_wp_element_["createElement"])("div", {
|
| 2576 |
+
onFocus: this.onFocus,
|
| 2577 |
+
className: className
|
| 2578 |
+
}, children));
|
| 2579 |
+
}
|
| 2580 |
+
}]);
|
| 2581 |
|
| 2582 |
+
return FocusReturnProvider;
|
| 2583 |
+
}(external_this_wp_element_["Component"]);
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2584 |
|
| 2585 |
+
/* harmony default export */ var with_focus_return_context = (context_FocusReturnProvider);
|
|
|
|
| 2586 |
|
| 2587 |
+
//# sourceMappingURL=context.js.map
|
| 2588 |
+
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/higher-order/with-focus-return/index.js
|
| 2589 |
|
|
|
|
|
|
|
| 2590 |
|
|
|
|
|
|
|
|
|
|
| 2591 |
|
|
|
|
|
|
|
| 2592 |
|
|
|
|
|
|
|
|
|
|
| 2593 |
|
|
|
|
|
|
|
| 2594 |
|
|
|
|
|
|
|
| 2595 |
|
|
|
|
| 2596 |
|
| 2597 |
+
function with_focus_return_createSuper(Derived) { var hasNativeReflectConstruct = with_focus_return_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Object(getPrototypeOf["a" /* default */])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Object(getPrototypeOf["a" /* default */])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Object(possibleConstructorReturn["a" /* default */])(this, result); }; }
|
| 2598 |
+
|
| 2599 |
+
function with_focus_return_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
| 2600 |
+
|
| 2601 |
+
/**
|
| 2602 |
+
* External dependencies
|
| 2603 |
+
*/
|
| 2604 |
|
| 2605 |
/**
|
| 2606 |
* WordPress dependencies
|
| 2607 |
*/
|
| 2608 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2609 |
|
| 2610 |
|
| 2611 |
/**
|
| 2612 |
+
* Internal dependencies
|
| 2613 |
*/
|
| 2614 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2615 |
|
| 2616 |
+
/**
|
| 2617 |
+
* Returns true if the given object is component-like. An object is component-
|
| 2618 |
+
* like if it is an instance of wp.element.Component, or is a function.
|
| 2619 |
+
*
|
| 2620 |
+
* @param {*} object Object to test.
|
| 2621 |
+
*
|
| 2622 |
+
* @return {boolean} Whether object is component-like.
|
| 2623 |
+
*/
|
| 2624 |
|
| 2625 |
+
function isComponentLike(object) {
|
| 2626 |
+
return object instanceof external_this_wp_element_["Component"] || typeof object === 'function';
|
| 2627 |
+
}
|
| 2628 |
/**
|
| 2629 |
+
* Higher Order Component used to be used to wrap disposable elements like
|
| 2630 |
+
* sidebars, modals, dropdowns. When mounting the wrapped component, we track a
|
| 2631 |
+
* reference to the current active element so we know where to restore focus
|
| 2632 |
+
* when the component is unmounted.
|
| 2633 |
+
*
|
| 2634 |
+
* @param {(WPComponent|Object)} options The component to be enhanced with
|
| 2635 |
+
* focus return behavior, or an object
|
| 2636 |
+
* describing the component and the
|
| 2637 |
+
* focus return characteristics.
|
| 2638 |
+
*
|
| 2639 |
+
* @return {WPComponent} Component with the focus restauration behaviour.
|
| 2640 |
*/
|
| 2641 |
|
| 2642 |
|
| 2643 |
+
function withFocusReturn(options) {
|
| 2644 |
+
// Normalize as overloaded form `withFocusReturn( options )( Component )`
|
| 2645 |
+
// or as `withFocusReturn( Component )`.
|
| 2646 |
+
if (isComponentLike(options)) {
|
| 2647 |
+
var WrappedComponent = options;
|
| 2648 |
+
return withFocusReturn({})(WrappedComponent);
|
| 2649 |
+
}
|
| 2650 |
|
| 2651 |
+
var _options$onFocusRetur = options.onFocusReturn,
|
| 2652 |
+
onFocusReturn = _options$onFocusRetur === void 0 ? external_lodash_["stubTrue"] : _options$onFocusRetur;
|
| 2653 |
+
return function (WrappedComponent) {
|
| 2654 |
+
var FocusReturn = /*#__PURE__*/function (_Component) {
|
| 2655 |
+
Object(inherits["a" /* default */])(FocusReturn, _Component);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2656 |
|
| 2657 |
+
var _super = with_focus_return_createSuper(FocusReturn);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2658 |
|
| 2659 |
+
function FocusReturn() {
|
| 2660 |
+
var _this;
|
| 2661 |
+
|
| 2662 |
+
Object(classCallCheck["a" /* default */])(this, FocusReturn);
|
| 2663 |
+
|
| 2664 |
+
_this = _super.apply(this, arguments);
|
| 2665 |
+
_this.ownFocusedElements = new Set();
|
| 2666 |
+
_this.activeElementOnMount = document.activeElement;
|
| 2667 |
+
|
| 2668 |
+
_this.setIsFocusedFalse = function () {
|
| 2669 |
+
return _this.isFocused = false;
|
| 2670 |
+
};
|
| 2671 |
+
|
| 2672 |
+
_this.setIsFocusedTrue = function (event) {
|
| 2673 |
+
_this.ownFocusedElements.add(event.target);
|
| 2674 |
+
|
| 2675 |
+
_this.isFocused = true;
|
| 2676 |
+
};
|
| 2677 |
+
|
| 2678 |
+
return _this;
|
| 2679 |
+
}
|
| 2680 |
+
|
| 2681 |
+
Object(createClass["a" /* default */])(FocusReturn, [{
|
| 2682 |
+
key: "componentWillUnmount",
|
| 2683 |
+
value: function componentWillUnmount() {
|
| 2684 |
+
var activeElementOnMount = this.activeElementOnMount,
|
| 2685 |
+
isFocused = this.isFocused,
|
| 2686 |
+
ownFocusedElements = this.ownFocusedElements;
|
| 2687 |
+
|
| 2688 |
+
if (!isFocused) {
|
| 2689 |
+
return;
|
| 2690 |
+
} // Defer to the component's own explicit focus return behavior,
|
| 2691 |
+
// if specified. The function should return `false` to prevent
|
| 2692 |
+
// the default behavior otherwise occurring here. This allows
|
| 2693 |
+
// for support that the `onFocusReturn` decides to allow the
|
| 2694 |
+
// default behavior to occur under some conditions.
|
| 2695 |
+
|
| 2696 |
+
|
| 2697 |
+
if (onFocusReturn() === false) {
|
| 2698 |
+
return;
|
| 2699 |
+
}
|
| 2700 |
+
|
| 2701 |
+
var stack = [].concat(Object(toConsumableArray["a" /* default */])(external_lodash_["without"].apply(void 0, [this.props.focus.focusHistory].concat(Object(toConsumableArray["a" /* default */])(ownFocusedElements)))), [activeElementOnMount]);
|
| 2702 |
+
var candidate;
|
| 2703 |
+
|
| 2704 |
+
while (candidate = stack.pop()) {
|
| 2705 |
+
if (document.body.contains(candidate)) {
|
| 2706 |
+
candidate.focus();
|
| 2707 |
+
return;
|
| 2708 |
+
}
|
| 2709 |
+
}
|
| 2710 |
+
}
|
| 2711 |
+
}, {
|
| 2712 |
+
key: "render",
|
| 2713 |
+
value: function render() {
|
| 2714 |
+
return Object(external_this_wp_element_["createElement"])("div", {
|
| 2715 |
+
onFocus: this.setIsFocusedTrue,
|
| 2716 |
+
onBlur: this.setIsFocusedFalse
|
| 2717 |
+
}, Object(external_this_wp_element_["createElement"])(WrappedComponent, this.props.childProps));
|
| 2718 |
+
}
|
| 2719 |
+
}]);
|
| 2720 |
+
|
| 2721 |
+
return FocusReturn;
|
| 2722 |
+
}(external_this_wp_element_["Component"]);
|
| 2723 |
+
|
| 2724 |
+
return function (props) {
|
| 2725 |
+
return Object(external_this_wp_element_["createElement"])(Consumer, null, function (context) {
|
| 2726 |
+
return Object(external_this_wp_element_["createElement"])(FocusReturn, {
|
| 2727 |
+
childProps: props,
|
| 2728 |
+
focus: context
|
| 2729 |
+
});
|
| 2730 |
+
});
|
| 2731 |
+
};
|
| 2732 |
+
};
|
| 2733 |
+
}
|
| 2734 |
+
|
| 2735 |
+
/* harmony default export */ var with_focus_return = __webpack_exports__["a"] = (Object(create_higher_order_component["a" /* default */])(withFocusReturn, 'withFocusReturn'));
|
| 2736 |
+
|
| 2737 |
+
//# sourceMappingURL=index.js.map
|
| 2738 |
+
|
| 2739 |
+
/***/ }),
|
| 2740 |
+
|
| 2741 |
+
/***/ 133:
|
| 2742 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
| 2743 |
+
|
| 2744 |
+
"use strict";
|
| 2745 |
+
/* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8);
|
| 2746 |
+
/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7);
|
| 2747 |
+
/* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(12);
|
| 2748 |
+
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(0);
|
| 2749 |
+
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__);
|
| 2750 |
+
/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(88);
|
| 2751 |
+
/* harmony import */ var _dashicon__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(126);
|
| 2752 |
+
|
| 2753 |
+
|
| 2754 |
+
|
| 2755 |
+
|
| 2756 |
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
| 2757 |
+
|
| 2758 |
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
| 2759 |
|
|
|
|
| 2760 |
/**
|
| 2761 |
+
* WordPress dependencies
|
| 2762 |
*/
|
| 2763 |
|
| 2764 |
|
| 2767 |
*/
|
| 2768 |
|
| 2769 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2770 |
|
| 2771 |
+
function Icon(_ref) {
|
| 2772 |
+
var _ref$icon = _ref.icon,
|
| 2773 |
+
icon = _ref$icon === void 0 ? null : _ref$icon,
|
| 2774 |
+
size = _ref.size,
|
| 2775 |
+
additionalProps = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"])(_ref, ["icon", "size"]);
|
| 2776 |
|
| 2777 |
+
// Dashicons should be 20x20 by default.
|
| 2778 |
+
var dashiconSize = size || 20;
|
| 2779 |
|
| 2780 |
+
if ('string' === typeof icon) {
|
| 2781 |
+
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])(_dashicon__WEBPACK_IMPORTED_MODULE_5__[/* default */ "a"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])({
|
| 2782 |
+
icon: icon,
|
| 2783 |
+
size: dashiconSize
|
| 2784 |
+
}, additionalProps));
|
| 2785 |
}
|
| 2786 |
|
| 2787 |
+
if (icon && _dashicon__WEBPACK_IMPORTED_MODULE_5__[/* default */ "a"] === icon.type) {
|
| 2788 |
+
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["cloneElement"])(icon, _objectSpread({
|
| 2789 |
+
size: dashiconSize
|
| 2790 |
+
}, additionalProps));
|
| 2791 |
+
} // Icons should be 24x24 by default.
|
| 2792 |
|
| 2793 |
+
|
| 2794 |
+
var iconSize = size || 24;
|
| 2795 |
+
|
| 2796 |
+
if ('function' === typeof icon) {
|
| 2797 |
+
if (icon.prototype instanceof _wordpress_element__WEBPACK_IMPORTED_MODULE_3__["Component"]) {
|
| 2798 |
+
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])(icon, _objectSpread({
|
| 2799 |
+
size: iconSize
|
| 2800 |
+
}, additionalProps));
|
| 2801 |
+
}
|
| 2802 |
+
|
| 2803 |
+
return icon(_objectSpread({
|
| 2804 |
+
size: iconSize
|
| 2805 |
+
}, additionalProps));
|
| 2806 |
}
|
| 2807 |
|
| 2808 |
+
if (icon && (icon.type === 'svg' || icon.type === _wordpress_primitives__WEBPACK_IMPORTED_MODULE_4__[/* SVG */ "c"])) {
|
| 2809 |
+
var appliedProps = _objectSpread(_objectSpread({
|
| 2810 |
+
width: iconSize,
|
| 2811 |
+
height: iconSize
|
| 2812 |
+
}, icon.props), additionalProps);
|
|
|
|
|
|
|
|
|
|
| 2813 |
|
| 2814 |
+
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_4__[/* SVG */ "c"], appliedProps);
|
| 2815 |
+
}
|
| 2816 |
|
| 2817 |
+
if (Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["isValidElement"])(icon)) {
|
| 2818 |
+
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["cloneElement"])(icon, _objectSpread({
|
| 2819 |
+
size: iconSize
|
| 2820 |
+
}, additionalProps));
|
| 2821 |
+
}
|
| 2822 |
|
| 2823 |
+
return icon;
|
| 2824 |
+
}
|
| 2825 |
|
| 2826 |
+
/* harmony default export */ __webpack_exports__["a"] = (Icon);
|
| 2827 |
+
//# sourceMappingURL=index.js.map
|
| 2828 |
|
| 2829 |
+
/***/ }),
|
| 2830 |
+
|
| 2831 |
+
/***/ 134:
|
| 2832 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2833 |
|
| 2834 |
+
"use strict";
|
| 2835 |
+
/* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8);
|
| 2836 |
+
/* harmony import */ var _babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(26);
|
| 2837 |
+
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4);
|
| 2838 |
+
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
|
| 2839 |
|
| 2840 |
|
| 2841 |
|
| 2844 |
*/
|
| 2845 |
|
| 2846 |
|
| 2847 |
+
function Animate(_ref) {
|
| 2848 |
+
var type = _ref.type,
|
| 2849 |
+
_ref$options = _ref.options,
|
| 2850 |
+
options = _ref$options === void 0 ? {} : _ref$options,
|
| 2851 |
+
children = _ref.children;
|
| 2852 |
|
| 2853 |
+
if (type === 'appear') {
|
| 2854 |
+
var _classnames;
|
|
|
|
| 2855 |
|
| 2856 |
+
var _options$origin = options.origin,
|
| 2857 |
+
origin = _options$origin === void 0 ? 'top' : _options$origin;
|
| 2858 |
|
| 2859 |
+
var _origin$split = origin.split(' '),
|
| 2860 |
+
_origin$split2 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(_origin$split, 2),
|
| 2861 |
+
yAxis = _origin$split2[0],
|
| 2862 |
+
_origin$split2$ = _origin$split2[1],
|
| 2863 |
+
xAxis = _origin$split2$ === void 0 ? 'center' : _origin$split2$;
|
|
|
|
| 2864 |
|
| 2865 |
+
return children({
|
| 2866 |
+
className: classnames__WEBPACK_IMPORTED_MODULE_2___default()('components-animate__appear', (_classnames = {}, Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(_classnames, 'is-from-' + xAxis, xAxis !== 'center'), Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(_classnames, 'is-from-' + yAxis, yAxis !== 'middle'), _classnames))
|
| 2867 |
+
});
|
| 2868 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2869 |
|
| 2870 |
+
if (type === 'slide-in') {
|
| 2871 |
+
var _options$origin2 = options.origin,
|
| 2872 |
+
_origin = _options$origin2 === void 0 ? 'left' : _options$origin2;
|
| 2873 |
|
| 2874 |
+
return children({
|
| 2875 |
+
className: classnames__WEBPACK_IMPORTED_MODULE_2___default()('components-animate__slide-in', 'is-from-' + _origin)
|
|
|
|
|
|
|
| 2876 |
});
|
| 2877 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2878 |
|
| 2879 |
+
if (type === 'loading') {
|
| 2880 |
+
return children({
|
| 2881 |
+
className: classnames__WEBPACK_IMPORTED_MODULE_2___default()('components-animate__loading')
|
| 2882 |
+
});
|
| 2883 |
+
}
|
|
|
|
|
|
|
|
|
|
| 2884 |
|
| 2885 |
+
return children({});
|
| 2886 |
+
}
|
|
|
|
|
|
|
|
|
|
| 2887 |
|
| 2888 |
+
/* harmony default export */ __webpack_exports__["a"] = (Animate);
|
| 2889 |
+
//# sourceMappingURL=index.js.map
|
|
|
|
|
|
|
| 2890 |
|
| 2891 |
+
/***/ }),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2892 |
|
| 2893 |
+
/***/ 135:
|
| 2894 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
| 2895 |
+
|
| 2896 |
+
"use strict";
|
| 2897 |
+
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
|
| 2898 |
+
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
|
| 2899 |
+
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2);
|
| 2900 |
+
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2901 |
|
| 2902 |
|
| 2903 |
/**
|
| 2904 |
* External dependencies
|
| 2905 |
*/
|
| 2906 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2907 |
|
| 2908 |
+
function Shortcut(_ref) {
|
| 2909 |
+
var shortcut = _ref.shortcut,
|
| 2910 |
+
className = _ref.className;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2911 |
|
| 2912 |
+
if (!shortcut) {
|
| 2913 |
+
return null;
|
| 2914 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2915 |
|
| 2916 |
+
var displayText;
|
| 2917 |
+
var ariaLabel;
|
| 2918 |
|
| 2919 |
+
if (Object(lodash__WEBPACK_IMPORTED_MODULE_1__["isString"])(shortcut)) {
|
| 2920 |
+
displayText = shortcut;
|
| 2921 |
+
}
|
| 2922 |
|
| 2923 |
+
if (Object(lodash__WEBPACK_IMPORTED_MODULE_1__["isObject"])(shortcut)) {
|
| 2924 |
+
displayText = shortcut.display;
|
| 2925 |
+
ariaLabel = shortcut.ariaLabel;
|
| 2926 |
+
}
|
| 2927 |
|
| 2928 |
+
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("span", {
|
| 2929 |
+
className: className,
|
| 2930 |
+
"aria-label": ariaLabel
|
| 2931 |
+
}, displayText);
|
| 2932 |
+
}
|
| 2933 |
|
| 2934 |
+
/* harmony default export */ __webpack_exports__["a"] = (Shortcut);
|
| 2935 |
+
//# sourceMappingURL=index.js.map
|
| 2936 |
|
| 2937 |
+
/***/ }),
|
| 2938 |
|
| 2939 |
+
/***/ 136:
|
| 2940 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
| 2941 |
|
| 2942 |
+
"use strict";
|
| 2943 |
|
| 2944 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
|
| 2945 |
+
var esm_extends = __webpack_require__(7);
|
| 2946 |
|
| 2947 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js + 3 modules
|
| 2948 |
+
var slicedToArray = __webpack_require__(26);
|
| 2949 |
|
| 2950 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js
|
| 2951 |
+
var objectWithoutProperties = __webpack_require__(12);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2952 |
|
| 2953 |
+
// EXTERNAL MODULE: external {"this":["wp","element"]}
|
| 2954 |
+
var external_this_wp_element_ = __webpack_require__(0);
|
| 2955 |
|
| 2956 |
+
// EXTERNAL MODULE: ./node_modules/classnames/index.js
|
| 2957 |
+
var classnames = __webpack_require__(4);
|
| 2958 |
+
var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
|
| 2959 |
|
| 2960 |
+
// EXTERNAL MODULE: ./node_modules/@wordpress/components/node_modules/@wordpress/dom/build-module/dom.js
|
| 2961 |
+
var dom = __webpack_require__(156);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2962 |
|
| 2963 |
+
// EXTERNAL MODULE: ./node_modules/@wordpress/components/node_modules/@wordpress/dom/build-module/index.js + 2 modules
|
| 2964 |
+
var build_module = __webpack_require__(73);
|
| 2965 |
|
| 2966 |
+
// EXTERNAL MODULE: ./node_modules/@wordpress/components/node_modules/@wordpress/keycodes/build-module/index.js + 1 modules
|
| 2967 |
+
var keycodes_build_module = __webpack_require__(54);
|
| 2968 |
|
| 2969 |
+
// EXTERNAL MODULE: ./node_modules/@wordpress/deprecated/build-module/index.js
|
| 2970 |
+
var deprecated_build_module = __webpack_require__(57);
|
| 2971 |
|
| 2972 |
+
// EXTERNAL MODULE: ./node_modules/@wordpress/compose/build-module/hooks/use-viewport-match/index.js
|
| 2973 |
+
var use_viewport_match = __webpack_require__(306);
|
| 2974 |
|
| 2975 |
+
// EXTERNAL MODULE: ./node_modules/react-resize-aware/dist/index.js
|
| 2976 |
+
var dist = __webpack_require__(125);
|
| 2977 |
+
var dist_default = /*#__PURE__*/__webpack_require__.n(dist);
|
| 2978 |
+
|
| 2979 |
+
// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/hooks/use-resize-observer/index.js
|
| 2980 |
/**
|
| 2981 |
* External dependencies
|
| 2982 |
*/
|
| 2983 |
|
| 2984 |
+
/**
|
| 2985 |
+
* Hook which allows to listen the resize event of any target element when it changes sizes.
|
| 2986 |
+
* _Note: `useResizeObserver` will report `null` until after first render_
|
| 2987 |
+
*
|
| 2988 |
+
* @return {Array} An array of {Element} `resizeListener` and {?Object} `sizes` with properties `width` and `height`
|
| 2989 |
+
*
|
| 2990 |
+
* @example
|
| 2991 |
+
*
|
| 2992 |
+
* ```js
|
| 2993 |
+
* const App = () => {
|
| 2994 |
+
* const [ resizeListener, sizes ] = useResizeObserver();
|
| 2995 |
+
*
|
| 2996 |
+
* return (
|
| 2997 |
+
* <div>
|
| 2998 |
+
* { resizeListener }
|
| 2999 |
+
* Your content here
|
| 3000 |
+
* </div>
|
| 3001 |
+
* );
|
| 3002 |
+
* };
|
| 3003 |
+
* ```
|
| 3004 |
+
*
|
| 3005 |
+
*/
|
| 3006 |
+
|
| 3007 |
+
/* harmony default export */ var use_resize_observer = (dist_default.a);
|
| 3008 |
+
//# sourceMappingURL=index.js.map
|
| 3009 |
+
// EXTERNAL MODULE: ./node_modules/@wordpress/components/node_modules/@wordpress/icons/build-module/library/close.js
|
| 3010 |
+
var library_close = __webpack_require__(451);
|
| 3011 |
+
|
| 3012 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
|
| 3013 |
+
var defineProperty = __webpack_require__(8);
|
| 3014 |
+
|
| 3015 |
+
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/popover/utils.js
|
| 3016 |
|
| 3017 |
|
| 3018 |
|
| 3019 |
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
| 3020 |
|
| 3021 |
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
| 3022 |
|
| 3023 |
/**
|
| 3024 |
+
* WordPress dependencies
|
| 3025 |
*/
|
| 3026 |
|
| 3027 |
+
/**
|
| 3028 |
+
* Module constants
|
| 3029 |
+
*/
|
| 3030 |
|
| 3031 |
+
var HEIGHT_OFFSET = 10; // used by the arrow and a bit of empty space
|
| 3032 |
|
| 3033 |
+
/**
|
| 3034 |
+
* Utility used to compute the popover position over the xAxis
|
| 3035 |
+
*
|
| 3036 |
+
* @param {Object} anchorRect Anchor Rect.
|
| 3037 |
+
* @param {Object} contentSize Content Size.
|
| 3038 |
+
* @param {string} xAxis Desired xAxis.
|
| 3039 |
+
* @param {string} corner Desired corner.
|
| 3040 |
+
* @param {boolean} sticky Whether or not to stick the popover to the
|
| 3041 |
+
* scroll container edge when part of the anchor
|
| 3042 |
+
* leaves view.
|
| 3043 |
+
* @param {string} chosenYAxis yAxis to be used.
|
| 3044 |
+
* @param {Element} boundaryElement Boundary element.
|
| 3045 |
+
*
|
| 3046 |
+
* @return {Object} Popover xAxis position and constraints.
|
| 3047 |
+
*/
|
| 3048 |
|
| 3049 |
+
function computePopoverXAxisPosition(anchorRect, contentSize, xAxis, corner, sticky, chosenYAxis, boundaryElement) {
|
| 3050 |
+
var width = contentSize.width;
|
| 3051 |
+
var isRTL = document.documentElement.dir === 'rtl'; // Correct xAxis for RTL support
|
|
|
|
| 3052 |
|
| 3053 |
+
if (xAxis === 'left' && isRTL) {
|
| 3054 |
+
xAxis = 'right';
|
| 3055 |
+
} else if (xAxis === 'right' && isRTL) {
|
| 3056 |
+
xAxis = 'left';
|
| 3057 |
+
}
|
| 3058 |
|
| 3059 |
+
if (corner === 'left' && isRTL) {
|
| 3060 |
+
corner = 'right';
|
| 3061 |
+
} else if (corner === 'right' && isRTL) {
|
| 3062 |
+
corner = 'left';
|
| 3063 |
+
} // x axis alignment choices
|
| 3064 |
|
|
|
|
|
|
|
|
|
|
| 3065 |
|
| 3066 |
+
var anchorMidPoint = Math.round(anchorRect.left + anchorRect.width / 2);
|
| 3067 |
+
var centerAlignment = {
|
| 3068 |
+
popoverLeft: anchorMidPoint,
|
| 3069 |
+
contentWidth: (anchorMidPoint - width / 2 > 0 ? width / 2 : anchorMidPoint) + (anchorMidPoint + width / 2 > window.innerWidth ? window.innerWidth - anchorMidPoint : width / 2)
|
| 3070 |
+
};
|
| 3071 |
+
var leftAlignmentX = anchorRect.left;
|
|
|
|
|
|
|
| 3072 |
|
| 3073 |
+
if (corner === 'right') {
|
| 3074 |
+
leftAlignmentX = anchorRect.right;
|
| 3075 |
+
} else if (chosenYAxis !== 'middle') {
|
| 3076 |
+
leftAlignmentX = anchorMidPoint;
|
| 3077 |
+
}
|
| 3078 |
|
| 3079 |
+
var rightAlignmentX = anchorRect.right;
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3080 |
|
| 3081 |
+
if (corner === 'left') {
|
| 3082 |
+
rightAlignmentX = anchorRect.left;
|
| 3083 |
+
} else if (chosenYAxis !== 'middle') {
|
| 3084 |
+
rightAlignmentX = anchorMidPoint;
|
| 3085 |
+
}
|
| 3086 |
|
| 3087 |
+
var leftAlignment = {
|
| 3088 |
+
popoverLeft: leftAlignmentX,
|
| 3089 |
+
contentWidth: leftAlignmentX - width > 0 ? width : leftAlignmentX
|
| 3090 |
+
};
|
| 3091 |
+
var rightAlignment = {
|
| 3092 |
+
popoverLeft: rightAlignmentX,
|
| 3093 |
+
contentWidth: rightAlignmentX + width > window.innerWidth ? window.innerWidth - rightAlignmentX : width
|
| 3094 |
+
}; // Choosing the x axis
|
| 3095 |
+
|
| 3096 |
+
var chosenXAxis = xAxis;
|
| 3097 |
+
var contentWidth = null;
|
| 3098 |
+
|
| 3099 |
+
if (!sticky) {
|
| 3100 |
+
if (xAxis === 'center' && centerAlignment.contentWidth === width) {
|
| 3101 |
+
chosenXAxis = 'center';
|
| 3102 |
+
} else if (xAxis === 'left' && leftAlignment.contentWidth === width) {
|
| 3103 |
+
chosenXAxis = 'left';
|
| 3104 |
+
} else if (xAxis === 'right' && rightAlignment.contentWidth === width) {
|
| 3105 |
+
chosenXAxis = 'right';
|
| 3106 |
+
} else {
|
| 3107 |
+
chosenXAxis = leftAlignment.contentWidth > rightAlignment.contentWidth ? 'left' : 'right';
|
| 3108 |
+
var chosenWidth = chosenXAxis === 'left' ? leftAlignment.contentWidth : rightAlignment.contentWidth;
|
| 3109 |
+
contentWidth = chosenWidth !== width ? chosenWidth : null;
|
| 3110 |
}
|
| 3111 |
+
}
|
|
|
|
|
|
|
|
|
|
| 3112 |
|
| 3113 |
+
var popoverLeft;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3114 |
|
| 3115 |
+
if (chosenXAxis === 'center') {
|
| 3116 |
+
popoverLeft = centerAlignment.popoverLeft;
|
| 3117 |
+
} else if (chosenXAxis === 'left') {
|
| 3118 |
+
popoverLeft = leftAlignment.popoverLeft;
|
| 3119 |
+
} else {
|
| 3120 |
+
popoverLeft = rightAlignment.popoverLeft;
|
| 3121 |
}
|
| 3122 |
|
| 3123 |
+
if (boundaryElement) {
|
| 3124 |
+
var boundaryRect = boundaryElement.getBoundingClientRect();
|
| 3125 |
+
popoverLeft = Math.min(popoverLeft, boundaryRect.right - width);
|
| 3126 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3127 |
|
| 3128 |
+
return {
|
| 3129 |
+
xAxis: chosenXAxis,
|
| 3130 |
+
popoverLeft: popoverLeft,
|
| 3131 |
+
contentWidth: contentWidth
|
| 3132 |
};
|
| 3133 |
+
}
|
| 3134 |
+
/**
|
| 3135 |
+
* Utility used to compute the popover position over the yAxis
|
| 3136 |
+
*
|
| 3137 |
+
* @param {Object} anchorRect Anchor Rect.
|
| 3138 |
+
* @param {Object} contentSize Content Size.
|
| 3139 |
+
* @param {string} yAxis Desired yAxis.
|
| 3140 |
+
* @param {string} corner Desired corner.
|
| 3141 |
+
* @param {boolean} sticky Whether or not to stick the popover to the
|
| 3142 |
+
* scroll container edge when part of the
|
| 3143 |
+
* anchor leaves view.
|
| 3144 |
+
* @param {Element} anchorRef The anchor element.
|
| 3145 |
+
* @param {Element} relativeOffsetTop If applicable, top offset of the relative
|
| 3146 |
+
* positioned parent container.
|
| 3147 |
+
*
|
| 3148 |
+
* @return {Object} Popover xAxis position and constraints.
|
| 3149 |
+
*/
|
| 3150 |
|
| 3151 |
+
function computePopoverYAxisPosition(anchorRect, contentSize, yAxis, corner, sticky, anchorRef, relativeOffsetTop) {
|
| 3152 |
+
var height = contentSize.height;
|
| 3153 |
|
| 3154 |
+
if (sticky) {
|
| 3155 |
+
var scrollContainerEl = Object(dom["b" /* getScrollContainer */])(anchorRef) || document.body;
|
| 3156 |
+
var scrollRect = scrollContainerEl.getBoundingClientRect();
|
| 3157 |
+
var stickyPosition = scrollRect.top + height - relativeOffsetTop;
|
| 3158 |
|
| 3159 |
+
if (anchorRect.top <= stickyPosition) {
|
| 3160 |
+
return {
|
| 3161 |
+
yAxis: yAxis,
|
| 3162 |
+
popoverTop: Math.min(anchorRect.bottom, stickyPosition)
|
| 3163 |
+
};
|
| 3164 |
}
|
| 3165 |
+
} // y axis alignment choices
|
| 3166 |
|
|
|
|
|
|
|
|
|
|
| 3167 |
|
| 3168 |
+
var anchorMidPoint = anchorRect.top + anchorRect.height / 2;
|
|
|
|
| 3169 |
|
| 3170 |
+
if (corner === 'bottom') {
|
| 3171 |
+
anchorMidPoint = anchorRect.bottom;
|
| 3172 |
+
} else if (corner === 'top') {
|
| 3173 |
+
anchorMidPoint = anchorRect.top;
|
| 3174 |
+
}
|
| 3175 |
+
|
| 3176 |
+
var middleAlignment = {
|
| 3177 |
+
popoverTop: anchorMidPoint,
|
| 3178 |
+
contentHeight: (anchorMidPoint - height / 2 > 0 ? height / 2 : anchorMidPoint) + (anchorMidPoint + height / 2 > window.innerHeight ? window.innerHeight - anchorMidPoint : height / 2)
|
| 3179 |
+
};
|
| 3180 |
+
var topAlignment = {
|
| 3181 |
+
popoverTop: anchorRect.top,
|
| 3182 |
+
contentHeight: anchorRect.top - HEIGHT_OFFSET - height > 0 ? height : anchorRect.top - HEIGHT_OFFSET
|
| 3183 |
};
|
| 3184 |
+
var bottomAlignment = {
|
| 3185 |
+
popoverTop: anchorRect.bottom,
|
| 3186 |
+
contentHeight: anchorRect.bottom + HEIGHT_OFFSET + height > window.innerHeight ? window.innerHeight - HEIGHT_OFFSET - anchorRect.bottom : height
|
| 3187 |
+
}; // Choosing the y axis
|
| 3188 |
+
|
| 3189 |
+
var chosenYAxis = yAxis;
|
| 3190 |
+
var contentHeight = null;
|
| 3191 |
+
|
| 3192 |
+
if (!sticky) {
|
| 3193 |
+
if (yAxis === 'middle' && middleAlignment.contentHeight === height) {
|
| 3194 |
+
chosenYAxis = 'middle';
|
| 3195 |
+
} else if (yAxis === 'top' && topAlignment.contentHeight === height) {
|
| 3196 |
+
chosenYAxis = 'top';
|
| 3197 |
+
} else if (yAxis === 'bottom' && bottomAlignment.contentHeight === height) {
|
| 3198 |
+
chosenYAxis = 'bottom';
|
| 3199 |
+
} else {
|
| 3200 |
+
chosenYAxis = topAlignment.contentHeight > bottomAlignment.contentHeight ? 'top' : 'bottom';
|
| 3201 |
+
var chosenHeight = chosenYAxis === 'top' ? topAlignment.contentHeight : bottomAlignment.contentHeight;
|
| 3202 |
+
contentHeight = chosenHeight !== height ? chosenHeight : null;
|
| 3203 |
+
}
|
| 3204 |
+
}
|
| 3205 |
|
| 3206 |
+
var popoverTop;
|
| 3207 |
+
|
| 3208 |
+
if (chosenYAxis === 'middle') {
|
| 3209 |
+
popoverTop = middleAlignment.popoverTop;
|
| 3210 |
+
} else if (chosenYAxis === 'top') {
|
| 3211 |
+
popoverTop = topAlignment.popoverTop;
|
| 3212 |
+
} else {
|
| 3213 |
+
popoverTop = bottomAlignment.popoverTop;
|
| 3214 |
}
|
| 3215 |
|
| 3216 |
+
return {
|
| 3217 |
+
yAxis: chosenYAxis,
|
| 3218 |
+
popoverTop: popoverTop,
|
| 3219 |
+
contentHeight: contentHeight
|
| 3220 |
+
};
|
| 3221 |
+
}
|
| 3222 |
+
/**
|
| 3223 |
+
* Utility used to compute the popover position and the content max width/height
|
| 3224 |
+
* for a popover given its anchor rect and its content size.
|
| 3225 |
+
*
|
| 3226 |
+
* @param {Object} anchorRect Anchor Rect.
|
| 3227 |
+
* @param {Object} contentSize Content Size.
|
| 3228 |
+
* @param {string} position Position.
|
| 3229 |
+
* @param {boolean} sticky Whether or not to stick the popover to the
|
| 3230 |
+
* scroll container edge when part of the
|
| 3231 |
+
* anchor leaves view.
|
| 3232 |
+
* @param {Element} anchorRef The anchor element.
|
| 3233 |
+
* @param {number} relativeOffsetTop If applicable, top offset of the relative
|
| 3234 |
+
* positioned parent container.
|
| 3235 |
+
* @param {Element} boundaryElement Boundary element.
|
| 3236 |
+
*
|
| 3237 |
+
* @return {Object} Popover position and constraints.
|
| 3238 |
+
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3239 |
|
| 3240 |
+
function computePopoverPosition(anchorRect, contentSize) {
|
| 3241 |
+
var position = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'top';
|
| 3242 |
+
var sticky = arguments.length > 3 ? arguments[3] : undefined;
|
| 3243 |
+
var anchorRef = arguments.length > 4 ? arguments[4] : undefined;
|
| 3244 |
+
var relativeOffsetTop = arguments.length > 5 ? arguments[5] : undefined;
|
| 3245 |
+
var boundaryElement = arguments.length > 6 ? arguments[6] : undefined;
|
| 3246 |
+
|
| 3247 |
+
var _position$split = position.split(' '),
|
| 3248 |
+
_position$split2 = Object(slicedToArray["a" /* default */])(_position$split, 3),
|
| 3249 |
+
yAxis = _position$split2[0],
|
| 3250 |
+
_position$split2$ = _position$split2[1],
|
| 3251 |
+
xAxis = _position$split2$ === void 0 ? 'center' : _position$split2$,
|
| 3252 |
+
corner = _position$split2[2];
|
| 3253 |
+
|
| 3254 |
+
var yAxisPosition = computePopoverYAxisPosition(anchorRect, contentSize, yAxis, corner, sticky, anchorRef, relativeOffsetTop);
|
| 3255 |
+
var xAxisPosition = computePopoverXAxisPosition(anchorRect, contentSize, xAxis, corner, sticky, yAxisPosition.yAxis, boundaryElement);
|
| 3256 |
+
return _objectSpread(_objectSpread({}, xAxisPosition), yAxisPosition);
|
| 3257 |
+
}
|
| 3258 |
+
//# sourceMappingURL=utils.js.map
|
| 3259 |
+
// EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/higher-order/with-focus-return/index.js + 1 modules
|
| 3260 |
+
var with_focus_return = __webpack_require__(132);
|
| 3261 |
|
| 3262 |
+
// EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/higher-order/with-constrained-tabbing/index.js
|
| 3263 |
+
var with_constrained_tabbing = __webpack_require__(129);
|
|
|
|
|
|
|
| 3264 |
|
| 3265 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js
|
| 3266 |
+
var classCallCheck = __webpack_require__(21);
|
|
|
|
|
|
|
| 3267 |
|
| 3268 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/createClass.js
|
| 3269 |
+
var createClass = __webpack_require__(22);
|
|
|
|
|
|
|
| 3270 |
|
| 3271 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/inherits.js + 1 modules
|
| 3272 |
+
var inherits = __webpack_require__(23);
|
| 3273 |
+
|
| 3274 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js
|
| 3275 |
+
var possibleConstructorReturn = __webpack_require__(24);
|
| 3276 |
+
|
| 3277 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js
|
| 3278 |
+
var getPrototypeOf = __webpack_require__(10);
|
| 3279 |
+
|
| 3280 |
+
// EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/higher-order/with-focus-outside/index.js
|
| 3281 |
+
var with_focus_outside = __webpack_require__(130);
|
| 3282 |
+
|
| 3283 |
+
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/popover/detect-outside.js
|
| 3284 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3285 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3286 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3287 |
|
|
|
|
|
|
|
| 3288 |
|
| 3289 |
+
|
| 3290 |
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Object(getPrototypeOf["a" /* default */])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Object(getPrototypeOf["a" /* default */])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Object(possibleConstructorReturn["a" /* default */])(this, result); }; }
|
| 3291 |
+
|
| 3292 |
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
| 3293 |
+
|
| 3294 |
/**
|
| 3295 |
+
* WordPress dependencies
|
|
|
|
|
|
|
|
|
|
| 3296 |
*/
|
| 3297 |
|
| 3298 |
/**
|
| 3299 |
+
* Internal dependencies
|
| 3300 |
*/
|
| 3301 |
|
| 3302 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3303 |
|
| 3304 |
+
var detect_outside_PopoverDetectOutside = /*#__PURE__*/function (_Component) {
|
| 3305 |
+
Object(inherits["a" /* default */])(PopoverDetectOutside, _Component);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3306 |
|
| 3307 |
+
var _super = _createSuper(PopoverDetectOutside);
|
|
|
|
|
|
|
| 3308 |
|
| 3309 |
+
function PopoverDetectOutside() {
|
| 3310 |
+
Object(classCallCheck["a" /* default */])(this, PopoverDetectOutside);
|
| 3311 |
|
| 3312 |
+
return _super.apply(this, arguments);
|
| 3313 |
+
}
|
| 3314 |
|
| 3315 |
+
Object(createClass["a" /* default */])(PopoverDetectOutside, [{
|
| 3316 |
+
key: "handleFocusOutside",
|
| 3317 |
+
value: function handleFocusOutside(event) {
|
| 3318 |
+
this.props.onFocusOutside(event);
|
| 3319 |
}
|
| 3320 |
+
}, {
|
| 3321 |
+
key: "render",
|
| 3322 |
+
value: function render() {
|
| 3323 |
+
return this.props.children;
|
| 3324 |
+
}
|
| 3325 |
+
}]);
|
| 3326 |
|
| 3327 |
+
return PopoverDetectOutside;
|
| 3328 |
+
}(external_this_wp_element_["Component"]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3329 |
|
| 3330 |
+
/* harmony default export */ var detect_outside = (Object(with_focus_outside["a" /* default */])(detect_outside_PopoverDetectOutside));
|
| 3331 |
+
//# sourceMappingURL=detect-outside.js.map
|
| 3332 |
+
// EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/button/index.js
|
| 3333 |
+
var build_module_button = __webpack_require__(72);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3334 |
|
| 3335 |
+
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/scroll-lock/index.js
|
|
|
|
|
|
|
|
|
|
| 3336 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3337 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3338 |
|
|
|
|
|
|
|
|
|
|
| 3339 |
|
|
|
|
|
|
|
|
|
|
| 3340 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3341 |
|
| 3342 |
+
function scroll_lock_createSuper(Derived) { var hasNativeReflectConstruct = scroll_lock_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Object(getPrototypeOf["a" /* default */])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Object(getPrototypeOf["a" /* default */])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Object(possibleConstructorReturn["a" /* default */])(this, result); }; }
|
|
|
|
|
|
|
|
|
|
| 3343 |
|
| 3344 |
+
function scroll_lock_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
|
|
|
|
|
|
| 3345 |
|
| 3346 |
/**
|
| 3347 |
+
* WordPress dependencies
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3348 |
*/
|
| 3349 |
|
| 3350 |
/**
|
| 3351 |
+
* Creates a ScrollLock component bound to the specified document.
|
|
|
|
| 3352 |
*
|
| 3353 |
+
* This function creates a ScrollLock component for the specified document
|
| 3354 |
+
* and is exposed so we can create an isolated component for unit testing.
|
| 3355 |
*
|
| 3356 |
+
* @param {Object} args Keyword args.
|
| 3357 |
+
* @param {HTMLDocument} args.htmlDocument The document to lock the scroll for.
|
| 3358 |
+
* @param {string} args.className The name of the class used to lock scrolling.
|
| 3359 |
+
* @return {WPComponent} The bound ScrollLock component.
|
| 3360 |
*/
|
| 3361 |
|
| 3362 |
+
function createScrollLockComponent() {
|
| 3363 |
+
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
| 3364 |
+
_ref$htmlDocument = _ref.htmlDocument,
|
| 3365 |
+
htmlDocument = _ref$htmlDocument === void 0 ? document : _ref$htmlDocument,
|
| 3366 |
+
_ref$className = _ref.className,
|
| 3367 |
+
className = _ref$className === void 0 ? 'lockscroll' : _ref$className;
|
| 3368 |
|
| 3369 |
+
var lockCounter = 0;
|
| 3370 |
+
/*
|
| 3371 |
+
* Setting `overflow: hidden` on html and body elements resets body scroll in iOS.
|
| 3372 |
+
* Save scroll top so we can restore it after locking scroll.
|
| 3373 |
+
*
|
| 3374 |
+
* NOTE: It would be cleaner and possibly safer to find a localized solution such
|
| 3375 |
+
* as preventing default on certain touchmove events.
|
|
|
|
| 3376 |
*/
|
| 3377 |
|
| 3378 |
+
var previousScrollTop = 0;
|
| 3379 |
/**
|
| 3380 |
+
* Locks and unlocks scroll depending on the boolean argument.
|
| 3381 |
+
*
|
| 3382 |
+
* @param {boolean} locked Whether or not scroll should be locked.
|
| 3383 |
*/
|
| 3384 |
|
| 3385 |
+
function setLocked(locked) {
|
| 3386 |
+
var scrollingElement = htmlDocument.scrollingElement || htmlDocument.body;
|
|
|
|
| 3387 |
|
| 3388 |
+
if (locked) {
|
| 3389 |
+
previousScrollTop = scrollingElement.scrollTop;
|
| 3390 |
+
}
|
|
|
|
|
|
|
| 3391 |
|
| 3392 |
+
var methodName = locked ? 'add' : 'remove';
|
| 3393 |
+
scrollingElement.classList[methodName](className); // Adding the class to the document element seems to be necessary in iOS.
|
| 3394 |
+
|
| 3395 |
+
htmlDocument.documentElement.classList[methodName](className);
|
| 3396 |
+
|
| 3397 |
+
if (!locked) {
|
| 3398 |
+
scrollingElement.scrollTop = previousScrollTop;
|
| 3399 |
}
|
| 3400 |
+
}
|
| 3401 |
/**
|
| 3402 |
+
* Requests scroll lock.
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3403 |
*
|
| 3404 |
+
* This function tracks requests for scroll lock. It locks scroll on the first
|
| 3405 |
+
* request and counts each request so `releaseLock` can unlock scroll when
|
| 3406 |
+
* all requests have been released.
|
| 3407 |
*/
|
| 3408 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3409 |
|
| 3410 |
+
function requestLock() {
|
| 3411 |
+
if (lockCounter === 0) {
|
| 3412 |
+
setLocked(true);
|
|
|
|
| 3413 |
}
|
| 3414 |
+
|
| 3415 |
+
++lockCounter;
|
| 3416 |
+
}
|
| 3417 |
/**
|
| 3418 |
+
* Releases a request for scroll lock.
|
|
|
|
| 3419 |
*
|
| 3420 |
+
* This function tracks released requests for scroll lock. When all requests
|
| 3421 |
+
* have been released, it unlocks scroll.
|
|
|
|
|
|
|
| 3422 |
*/
|
| 3423 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3424 |
|
| 3425 |
+
function releaseLock() {
|
| 3426 |
+
if (lockCounter === 1) {
|
| 3427 |
+
setLocked(false);
|
| 3428 |
}
|
| 3429 |
|
| 3430 |
+
--lockCounter;
|
| 3431 |
+
}
|
| 3432 |
+
|
| 3433 |
+
return /*#__PURE__*/function (_Component) {
|
| 3434 |
+
Object(inherits["a" /* default */])(ScrollLock, _Component);
|
| 3435 |
+
|
| 3436 |
+
var _super = scroll_lock_createSuper(ScrollLock);
|
| 3437 |
+
|
| 3438 |
+
function ScrollLock() {
|
| 3439 |
+
Object(classCallCheck["a" /* default */])(this, ScrollLock);
|
| 3440 |
+
|
| 3441 |
+
return _super.apply(this, arguments);
|
| 3442 |
+
}
|
| 3443 |
+
|
| 3444 |
+
Object(createClass["a" /* default */])(ScrollLock, [{
|
| 3445 |
+
key: "componentDidMount",
|
| 3446 |
+
|
| 3447 |
+
/**
|
| 3448 |
+
* Requests scroll lock on mount.
|
| 3449 |
+
*/
|
| 3450 |
+
value: function componentDidMount() {
|
| 3451 |
+
requestLock();
|
| 3452 |
}
|
| 3453 |
+
/**
|
| 3454 |
+
* Releases scroll lock before unmount.
|
| 3455 |
+
*/
|
| 3456 |
|
| 3457 |
+
}, {
|
| 3458 |
+
key: "componentWillUnmount",
|
| 3459 |
+
value: function componentWillUnmount() {
|
| 3460 |
+
releaseLock();
|
| 3461 |
}
|
| 3462 |
+
/**
|
| 3463 |
+
* Render nothing as this component is merely a way to declare scroll lock.
|
| 3464 |
+
*
|
| 3465 |
+
* @return {null} Render nothing by returning `null`.
|
| 3466 |
+
*/
|
| 3467 |
+
|
| 3468 |
+
}, {
|
| 3469 |
+
key: "render",
|
| 3470 |
+
value: function render() {
|
| 3471 |
+
return null;
|
| 3472 |
+
}
|
| 3473 |
+
}]);
|
| 3474 |
+
|
| 3475 |
+
return ScrollLock;
|
| 3476 |
+
}(external_this_wp_element_["Component"]);
|
| 3477 |
}
|
| 3478 |
+
/* harmony default export */ var scroll_lock = (createScrollLockComponent());
|
| 3479 |
+
//# sourceMappingURL=index.js.map
|
| 3480 |
+
// EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/isolated-event-container/index.js
|
| 3481 |
+
var isolated_event_container = __webpack_require__(131);
|
| 3482 |
+
|
| 3483 |
+
// EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/bubbles-virtually/use-slot.js
|
| 3484 |
+
var use_slot = __webpack_require__(76);
|
| 3485 |
+
|
| 3486 |
+
// EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/index.js + 4 modules
|
| 3487 |
+
var slot_fill = __webpack_require__(114);
|
| 3488 |
+
|
| 3489 |
+
// EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/animate/index.js
|
| 3490 |
+
var build_module_animate = __webpack_require__(134);
|
| 3491 |
+
|
| 3492 |
+
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/popover/index.js
|
| 3493 |
+
|
| 3494 |
+
|
| 3495 |
|
| 3496 |
|
| 3497 |
|
| 3499 |
* External dependencies
|
| 3500 |
*/
|
| 3501 |
|
| 3502 |
+
/**
|
| 3503 |
+
* WordPress dependencies
|
| 3504 |
+
*/
|
| 3505 |
+
|
| 3506 |
+
|
| 3507 |
+
|
| 3508 |
+
|
| 3509 |
+
|
| 3510 |
|
| 3511 |
|
| 3512 |
/**
|
| 3515 |
|
| 3516 |
|
| 3517 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3518 |
|
|
|
|
|
|
|
| 3519 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3520 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3521 |
|
|
|
|
|
|
|
| 3522 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3523 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3524 |
|
| 3525 |
+
var FocusManaged = Object(with_constrained_tabbing["a" /* default */])(Object(with_focus_return["a" /* default */])(function (_ref) {
|
| 3526 |
+
var children = _ref.children;
|
| 3527 |
+
return children;
|
| 3528 |
+
}));
|
| 3529 |
+
/**
|
| 3530 |
+
* Name of slot in which popover should fill.
|
| 3531 |
+
*
|
| 3532 |
+
* @type {string}
|
| 3533 |
+
*/
|
| 3534 |
|
| 3535 |
+
var SLOT_NAME = 'Popover';
|
| 3536 |
+
|
| 3537 |
+
function computeAnchorRect(anchorRefFallback, anchorRect, getAnchorRect) {
|
| 3538 |
+
var anchorRef = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
| 3539 |
+
var shouldAnchorIncludePadding = arguments.length > 4 ? arguments[4] : undefined;
|
| 3540 |
+
|
| 3541 |
+
if (anchorRect) {
|
| 3542 |
+
return anchorRect;
|
| 3543 |
}
|
| 3544 |
|
| 3545 |
+
if (getAnchorRect) {
|
| 3546 |
+
if (!anchorRefFallback.current) {
|
| 3547 |
+
return;
|
| 3548 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3549 |
|
| 3550 |
+
return getAnchorRect(anchorRefFallback.current);
|
| 3551 |
+
}
|
| 3552 |
|
| 3553 |
+
if (anchorRef !== false) {
|
| 3554 |
+
if (!anchorRef || !window.Range || !window.Element || !window.DOMRect) {
|
| 3555 |
+
return;
|
| 3556 |
+
}
|
| 3557 |
|
| 3558 |
+
if (anchorRef instanceof window.Range) {
|
| 3559 |
+
return Object(dom["a" /* getRectangleFromRange */])(anchorRef);
|
| 3560 |
+
}
|
| 3561 |
|
| 3562 |
+
if (anchorRef instanceof window.Element) {
|
| 3563 |
+
var _rect2 = anchorRef.getBoundingClientRect();
|
| 3564 |
|
| 3565 |
+
if (shouldAnchorIncludePadding) {
|
| 3566 |
+
return _rect2;
|
| 3567 |
+
}
|
| 3568 |
|
| 3569 |
+
return withoutPadding(_rect2, anchorRef);
|
| 3570 |
+
}
|
| 3571 |
|
| 3572 |
+
var top = anchorRef.top,
|
| 3573 |
+
bottom = anchorRef.bottom;
|
| 3574 |
+
var topRect = top.getBoundingClientRect();
|
| 3575 |
+
var bottomRect = bottom.getBoundingClientRect();
|
| 3576 |
|
| 3577 |
+
var _rect = new window.DOMRect(topRect.left, topRect.top, topRect.width, bottomRect.bottom - topRect.top);
|
| 3578 |
|
| 3579 |
+
if (shouldAnchorIncludePadding) {
|
| 3580 |
+
return _rect;
|
| 3581 |
+
}
|
| 3582 |
|
| 3583 |
+
return withoutPadding(_rect, anchorRef);
|
| 3584 |
+
}
|
| 3585 |
|
| 3586 |
+
if (!anchorRefFallback.current) {
|
| 3587 |
+
return;
|
| 3588 |
+
}
|
| 3589 |
|
| 3590 |
+
var parentNode = anchorRefFallback.current.parentNode;
|
| 3591 |
+
var rect = parentNode.getBoundingClientRect();
|
| 3592 |
|
| 3593 |
+
if (shouldAnchorIncludePadding) {
|
| 3594 |
+
return rect;
|
| 3595 |
+
}
|
| 3596 |
|
| 3597 |
+
return withoutPadding(rect, parentNode);
|
| 3598 |
+
}
|
| 3599 |
|
| 3600 |
+
function getComputedStyle(node) {
|
| 3601 |
+
return node.ownerDocument.defaultView.getComputedStyle(node);
|
| 3602 |
+
}
|
| 3603 |
|
| 3604 |
+
function withoutPadding(rect, element) {
|
| 3605 |
+
var _getComputedStyle = getComputedStyle(element),
|
| 3606 |
+
paddingTop = _getComputedStyle.paddingTop,
|
| 3607 |
+
paddingBottom = _getComputedStyle.paddingBottom,
|
| 3608 |
+
paddingLeft = _getComputedStyle.paddingLeft,
|
| 3609 |
+
paddingRight = _getComputedStyle.paddingRight;
|
| 3610 |
+
|
| 3611 |
+
var top = paddingTop ? parseInt(paddingTop, 10) : 0;
|
| 3612 |
+
var bottom = paddingBottom ? parseInt(paddingBottom, 10) : 0;
|
| 3613 |
+
var left = paddingLeft ? parseInt(paddingLeft, 10) : 0;
|
| 3614 |
+
var right = paddingRight ? parseInt(paddingRight, 10) : 0;
|
| 3615 |
+
return {
|
| 3616 |
+
x: rect.left + left,
|
| 3617 |
+
y: rect.top + top,
|
| 3618 |
+
width: rect.width - left - right,
|
| 3619 |
+
height: rect.height - top - bottom,
|
| 3620 |
+
left: rect.left + left,
|
| 3621 |
+
right: rect.right - right,
|
| 3622 |
+
top: rect.top + top,
|
| 3623 |
+
bottom: rect.bottom - bottom
|
| 3624 |
+
};
|
| 3625 |
+
}
|
| 3626 |
/**
|
| 3627 |
+
* Hook used to focus the first tabbable element on mount.
|
| 3628 |
+
*
|
| 3629 |
+
* @param {boolean|string} focusOnMount Focus on mount mode.
|
| 3630 |
+
* @param {Object} contentRef Reference to the popover content element.
|
| 3631 |
*/
|
| 3632 |
|
| 3633 |
|
| 3634 |
+
function useFocusContentOnMount(focusOnMount, contentRef) {
|
| 3635 |
+
// Focus handling
|
| 3636 |
+
Object(external_this_wp_element_["useEffect"])(function () {
|
| 3637 |
+
/*
|
| 3638 |
+
* Without the setTimeout, the dom node is not being focused. Related:
|
| 3639 |
+
* https://stackoverflow.com/questions/35522220/react-ref-with-focus-doesnt-work-without-settimeout-my-example
|
| 3640 |
+
*
|
| 3641 |
+
* TODO: Treat the cause, not the symptom.
|
| 3642 |
+
*/
|
| 3643 |
+
var focusTimeout = setTimeout(function () {
|
| 3644 |
+
if (!focusOnMount || !contentRef.current) {
|
| 3645 |
+
return;
|
| 3646 |
+
}
|
| 3647 |
|
| 3648 |
+
if (focusOnMount === 'firstElement') {
|
| 3649 |
+
// Find first tabbable node within content and shift focus, falling
|
| 3650 |
+
// back to the popover panel itself.
|
| 3651 |
+
var firstTabbable = build_module["a" /* focus */].tabbable.find(contentRef.current)[0];
|
| 3652 |
|
| 3653 |
+
if (firstTabbable) {
|
| 3654 |
+
firstTabbable.focus();
|
| 3655 |
+
} else {
|
| 3656 |
+
contentRef.current.focus();
|
| 3657 |
+
}
|
| 3658 |
|
| 3659 |
+
return;
|
| 3660 |
+
}
|
| 3661 |
|
| 3662 |
+
if (focusOnMount === 'container') {
|
| 3663 |
+
// Focus the popover panel itself so items in the popover are easily
|
| 3664 |
+
// accessed via keyboard navigation.
|
| 3665 |
+
contentRef.current.focus();
|
| 3666 |
+
}
|
| 3667 |
+
}, 0);
|
| 3668 |
+
return function () {
|
| 3669 |
+
return clearTimeout(focusTimeout);
|
| 3670 |
+
};
|
| 3671 |
+
}, []);
|
| 3672 |
+
}
|
| 3673 |
+
/**
|
| 3674 |
+
* Sets or removes an element attribute.
|
| 3675 |
+
*
|
| 3676 |
+
* @param {Element} element The element to modify.
|
| 3677 |
+
* @param {string} name The attribute name to set or remove.
|
| 3678 |
+
* @param {?string} value The value to set. A falsy value will remove the
|
| 3679 |
+
* attribute.
|
| 3680 |
+
*/
|
| 3681 |
|
| 3682 |
|
| 3683 |
+
function setAttribute(element, name, value) {
|
| 3684 |
+
if (!value) {
|
| 3685 |
+
if (element.hasAttribute(name)) {
|
| 3686 |
+
element.removeAttribute(name);
|
| 3687 |
+
}
|
| 3688 |
+
} else if (element.getAttribute(name) !== value) {
|
| 3689 |
+
element.setAttribute(name, value);
|
| 3690 |
+
}
|
| 3691 |
+
}
|
| 3692 |
+
/**
|
| 3693 |
+
* Sets or removes an element style property.
|
| 3694 |
+
*
|
| 3695 |
+
* @param {Element} element The element to modify.
|
| 3696 |
+
* @param {string} property The property to set or remove.
|
| 3697 |
+
* @param {?string} value The value to set. A falsy value will remove the
|
| 3698 |
+
* property.
|
| 3699 |
+
*/
|
| 3700 |
|
| 3701 |
|
| 3702 |
+
function setStyle(element, property) {
|
| 3703 |
+
var value = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3704 |
|
| 3705 |
+
if (element.style[property] !== value) {
|
| 3706 |
+
element.style[property] = value;
|
| 3707 |
+
}
|
| 3708 |
+
}
|
| 3709 |
+
/**
|
| 3710 |
+
* Sets or removes an element class.
|
| 3711 |
+
*
|
| 3712 |
+
* @param {Element} element The element to modify.
|
| 3713 |
+
* @param {string} name The class to set or remove.
|
| 3714 |
+
* @param {boolean} toggle True to set the class, false to remove.
|
| 3715 |
+
*/
|
| 3716 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3717 |
|
| 3718 |
+
function setClass(element, name, toggle) {
|
| 3719 |
+
if (toggle) {
|
| 3720 |
+
if (!element.classList.contains(name)) {
|
| 3721 |
+
element.classList.add(name);
|
| 3722 |
+
}
|
| 3723 |
+
} else if (element.classList.contains(name)) {
|
| 3724 |
+
element.classList.remove(name);
|
| 3725 |
+
}
|
| 3726 |
+
}
|
| 3727 |
|
| 3728 |
+
var popover_Popover = function Popover(_ref2) {
|
| 3729 |
+
var headerTitle = _ref2.headerTitle,
|
| 3730 |
+
onClose = _ref2.onClose,
|
| 3731 |
+
onKeyDown = _ref2.onKeyDown,
|
| 3732 |
+
children = _ref2.children,
|
| 3733 |
+
className = _ref2.className,
|
| 3734 |
+
_ref2$noArrow = _ref2.noArrow,
|
| 3735 |
+
noArrow = _ref2$noArrow === void 0 ? true : _ref2$noArrow,
|
| 3736 |
+
isAlternate = _ref2.isAlternate,
|
| 3737 |
+
_ref2$position = _ref2.position,
|
| 3738 |
+
position = _ref2$position === void 0 ? 'bottom right' : _ref2$position,
|
| 3739 |
+
range = _ref2.range,
|
| 3740 |
+
_ref2$focusOnMount = _ref2.focusOnMount,
|
| 3741 |
+
focusOnMount = _ref2$focusOnMount === void 0 ? 'firstElement' : _ref2$focusOnMount,
|
| 3742 |
+
anchorRef = _ref2.anchorRef,
|
| 3743 |
+
shouldAnchorIncludePadding = _ref2.shouldAnchorIncludePadding,
|
| 3744 |
+
anchorRect = _ref2.anchorRect,
|
| 3745 |
+
getAnchorRect = _ref2.getAnchorRect,
|
| 3746 |
+
expandOnMobile = _ref2.expandOnMobile,
|
| 3747 |
+
_ref2$animate = _ref2.animate,
|
| 3748 |
+
animate = _ref2$animate === void 0 ? true : _ref2$animate,
|
| 3749 |
+
onClickOutside = _ref2.onClickOutside,
|
| 3750 |
+
onFocusOutside = _ref2.onFocusOutside,
|
| 3751 |
+
__unstableSticky = _ref2.__unstableSticky,
|
| 3752 |
+
_ref2$__unstableSlotN = _ref2.__unstableSlotName,
|
| 3753 |
+
__unstableSlotName = _ref2$__unstableSlotN === void 0 ? SLOT_NAME : _ref2$__unstableSlotN,
|
| 3754 |
+
__unstableObserveElement = _ref2.__unstableObserveElement,
|
| 3755 |
+
__unstableBoundaryParent = _ref2.__unstableBoundaryParent,
|
| 3756 |
+
contentProps = Object(objectWithoutProperties["a" /* default */])(_ref2, ["headerTitle", "onClose", "onKeyDown", "children", "className", "noArrow", "isAlternate", "position", "range", "focusOnMount", "anchorRef", "shouldAnchorIncludePadding", "anchorRect", "getAnchorRect", "expandOnMobile", "animate", "onClickOutside", "onFocusOutside", "__unstableSticky", "__unstableSlotName", "__unstableObserveElement", "__unstableBoundaryParent"]);
|
| 3757 |
+
|
| 3758 |
+
var anchorRefFallback = Object(external_this_wp_element_["useRef"])(null);
|
| 3759 |
+
var contentRef = Object(external_this_wp_element_["useRef"])(null);
|
| 3760 |
+
var containerRef = Object(external_this_wp_element_["useRef"])();
|
| 3761 |
+
var isMobileViewport = Object(use_viewport_match["a" /* default */])('medium', '<');
|
| 3762 |
+
|
| 3763 |
+
var _useState = Object(external_this_wp_element_["useState"])(),
|
| 3764 |
+
_useState2 = Object(slicedToArray["a" /* default */])(_useState, 2),
|
| 3765 |
+
animateOrigin = _useState2[0],
|
| 3766 |
+
setAnimateOrigin = _useState2[1];
|
| 3767 |
+
|
| 3768 |
+
var slot = Object(use_slot["a" /* default */])(__unstableSlotName);
|
| 3769 |
+
var isExpanded = expandOnMobile && isMobileViewport;
|
| 3770 |
+
|
| 3771 |
+
var _useResizeObserver = use_resize_observer(),
|
| 3772 |
+
_useResizeObserver2 = Object(slicedToArray["a" /* default */])(_useResizeObserver, 2),
|
| 3773 |
+
containerResizeListener = _useResizeObserver2[0],
|
| 3774 |
+
contentSize = _useResizeObserver2[1];
|
| 3775 |
+
|
| 3776 |
+
noArrow = isExpanded || noArrow;
|
| 3777 |
+
Object(external_this_wp_element_["useLayoutEffect"])(function () {
|
| 3778 |
+
if (isExpanded) {
|
| 3779 |
+
setClass(containerRef.current, 'is-without-arrow', noArrow);
|
| 3780 |
+
setClass(containerRef.current, 'is-alternate', isAlternate);
|
| 3781 |
+
setAttribute(containerRef.current, 'data-x-axis');
|
| 3782 |
+
setAttribute(containerRef.current, 'data-y-axis');
|
| 3783 |
+
setStyle(containerRef.current, 'top');
|
| 3784 |
+
setStyle(containerRef.current, 'left');
|
| 3785 |
+
setStyle(contentRef.current, 'maxHeight');
|
| 3786 |
+
setStyle(contentRef.current, 'maxWidth');
|
| 3787 |
+
return;
|
| 3788 |
+
}
|
| 3789 |
|
| 3790 |
+
var refresh = function refresh() {
|
| 3791 |
+
if (!containerRef.current || !contentRef.current) {
|
| 3792 |
+
return;
|
| 3793 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3794 |
|
| 3795 |
+
var anchor = computeAnchorRect(anchorRefFallback, anchorRect, getAnchorRect, anchorRef, shouldAnchorIncludePadding);
|
|
|
|
| 3796 |
|
| 3797 |
+
if (!anchor) {
|
| 3798 |
+
return;
|
| 3799 |
+
}
|
| 3800 |
|
| 3801 |
+
var _containerRef$current = containerRef.current,
|
| 3802 |
+
offsetParent = _containerRef$current.offsetParent,
|
| 3803 |
+
ownerDocument = _containerRef$current.ownerDocument;
|
| 3804 |
+
var relativeOffsetTop = 0; // If there is a positioned ancestor element that is not the body,
|
| 3805 |
+
// subtract the position from the anchor rect. If the position of
|
| 3806 |
+
// the popover is fixed, the offset parent is null or the body
|
| 3807 |
+
// element, in which case the position is relative to the viewport.
|
| 3808 |
+
// See https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/offsetParent
|
| 3809 |
+
|
| 3810 |
+
if (offsetParent && offsetParent !== ownerDocument.body) {
|
| 3811 |
+
var offsetParentRect = offsetParent.getBoundingClientRect();
|
| 3812 |
+
relativeOffsetTop = offsetParentRect.top;
|
| 3813 |
+
anchor = new window.DOMRect(anchor.left - offsetParentRect.left, anchor.top - offsetParentRect.top, anchor.width, anchor.height);
|
| 3814 |
+
}
|
| 3815 |
|
| 3816 |
+
var boundaryElement;
|
|
|
|
|
|
|
| 3817 |
|
| 3818 |
+
if (__unstableBoundaryParent) {
|
| 3819 |
+
var _containerRef$current2;
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3820 |
|
| 3821 |
+
boundaryElement = (_containerRef$current2 = containerRef.current.closest('.popover-slot')) === null || _containerRef$current2 === void 0 ? void 0 : _containerRef$current2.parentNode;
|
| 3822 |
+
}
|
| 3823 |
|
| 3824 |
+
var usedContentSize = !contentSize.height ? contentRef.current.getBoundingClientRect() : contentSize;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3825 |
|
| 3826 |
+
var _computePopoverPositi = computePopoverPosition(anchor, usedContentSize, position, __unstableSticky, containerRef.current, relativeOffsetTop, boundaryElement),
|
| 3827 |
+
popoverTop = _computePopoverPositi.popoverTop,
|
| 3828 |
+
popoverLeft = _computePopoverPositi.popoverLeft,
|
| 3829 |
+
xAxis = _computePopoverPositi.xAxis,
|
| 3830 |
+
yAxis = _computePopoverPositi.yAxis,
|
| 3831 |
+
contentHeight = _computePopoverPositi.contentHeight,
|
| 3832 |
+
contentWidth = _computePopoverPositi.contentWidth;
|
| 3833 |
|
| 3834 |
+
if (typeof popoverTop === 'number' && typeof popoverLeft === 'number') {
|
| 3835 |
+
setStyle(containerRef.current, 'top', popoverTop + 'px');
|
| 3836 |
+
setStyle(containerRef.current, 'left', popoverLeft + 'px');
|
| 3837 |
+
}
|
| 3838 |
|
| 3839 |
+
setClass(containerRef.current, 'is-without-arrow', noArrow || xAxis === 'center' && yAxis === 'middle');
|
| 3840 |
+
setClass(containerRef.current, 'is-alternate', isAlternate);
|
| 3841 |
+
setAttribute(containerRef.current, 'data-x-axis', xAxis);
|
| 3842 |
+
setAttribute(containerRef.current, 'data-y-axis', yAxis);
|
| 3843 |
+
setStyle(contentRef.current, 'maxHeight', typeof contentHeight === 'number' ? contentHeight + 'px' : '');
|
| 3844 |
+
setStyle(contentRef.current, 'maxWidth', typeof contentWidth === 'number' ? contentWidth + 'px' : ''); // Compute the animation position
|
| 3845 |
|
| 3846 |
+
var yAxisMapping = {
|
| 3847 |
+
top: 'bottom',
|
| 3848 |
+
bottom: 'top'
|
| 3849 |
+
};
|
| 3850 |
+
var xAxisMapping = {
|
| 3851 |
+
left: 'right',
|
| 3852 |
+
right: 'left'
|
| 3853 |
+
};
|
| 3854 |
+
var animateYAxis = yAxisMapping[yAxis] || 'middle';
|
| 3855 |
+
var animateXAxis = xAxisMapping[xAxis] || 'center';
|
| 3856 |
+
setAnimateOrigin(animateXAxis + ' ' + animateYAxis);
|
| 3857 |
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3858 |
|
| 3859 |
+
refresh();
|
| 3860 |
+
/*
|
| 3861 |
+
* There are sometimes we need to reposition or resize the popover that
|
| 3862 |
+
* are not handled by the resize/scroll window events (i.e. CSS changes
|
| 3863 |
+
* in the layout that changes the position of the anchor).
|
| 3864 |
+
*
|
| 3865 |
+
* For these situations, we refresh the popover every 0.5s
|
| 3866 |
+
*/
|
| 3867 |
+
|
| 3868 |
+
var intervalHandle = window.setInterval(refresh, 500);
|
| 3869 |
+
var rafId;
|
| 3870 |
+
|
| 3871 |
+
var refreshOnAnimationFrame = function refreshOnAnimationFrame() {
|
| 3872 |
+
window.cancelAnimationFrame(rafId);
|
| 3873 |
+
rafId = window.requestAnimationFrame(refresh);
|
| 3874 |
+
}; // Sometimes a click trigger a layout change that affects the popover
|
| 3875 |
+
// position. This is an opportunity to immediately refresh rather than
|
| 3876 |
+
// at the interval.
|
| 3877 |
+
|
| 3878 |
+
|
| 3879 |
+
window.addEventListener('click', refreshOnAnimationFrame);
|
| 3880 |
+
window.addEventListener('resize', refresh);
|
| 3881 |
+
window.addEventListener('scroll', refresh, true);
|
| 3882 |
+
var observer;
|
| 3883 |
+
|
| 3884 |
+
if (__unstableObserveElement) {
|
| 3885 |
+
observer = new window.MutationObserver(refresh);
|
| 3886 |
+
observer.observe(__unstableObserveElement, {
|
| 3887 |
+
attributes: true
|
| 3888 |
+
});
|
| 3889 |
+
}
|
| 3890 |
|
| 3891 |
+
return function () {
|
| 3892 |
+
window.clearInterval(intervalHandle);
|
| 3893 |
+
window.removeEventListener('resize', refresh);
|
| 3894 |
+
window.removeEventListener('scroll', refresh, true);
|
| 3895 |
+
window.removeEventListener('click', refreshOnAnimationFrame);
|
| 3896 |
+
window.cancelAnimationFrame(rafId);
|
| 3897 |
+
|
| 3898 |
+
if (observer) {
|
| 3899 |
+
observer.disconnect();
|
| 3900 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3901 |
};
|
| 3902 |
+
}, [isExpanded, anchorRect, getAnchorRect, anchorRef, shouldAnchorIncludePadding, position, contentSize, __unstableSticky, __unstableObserveElement, __unstableBoundaryParent]);
|
| 3903 |
+
useFocusContentOnMount(focusOnMount, contentRef); // Event handlers
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3904 |
|
| 3905 |
+
var maybeClose = function maybeClose(event) {
|
| 3906 |
+
// Close on escape
|
| 3907 |
+
if (event.keyCode === keycodes_build_module["b" /* ESCAPE */] && onClose) {
|
| 3908 |
+
event.stopPropagation();
|
| 3909 |
+
onClose();
|
| 3910 |
+
} // Preserve original content prop behavior
|
| 3911 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3912 |
|
| 3913 |
+
if (onKeyDown) {
|
| 3914 |
+
onKeyDown(event);
|
| 3915 |
}
|
| 3916 |
};
|
| 3917 |
+
/**
|
| 3918 |
+
* Shims an onFocusOutside callback to be compatible with a deprecated
|
| 3919 |
+
* onClickOutside prop function, if provided.
|
| 3920 |
+
*
|
| 3921 |
+
* @param {FocusEvent} event Focus event from onFocusOutside.
|
| 3922 |
+
*/
|
| 3923 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3924 |
|
| 3925 |
+
function handleOnFocusOutside(event) {
|
| 3926 |
+
// Defer to given `onFocusOutside` if specified. Call `onClose` only if
|
| 3927 |
+
// both `onFocusOutside` and `onClickOutside` are unspecified. Doing so
|
| 3928 |
+
// assures backwards-compatibility for prior `onClickOutside` default.
|
| 3929 |
+
if (onFocusOutside) {
|
| 3930 |
+
onFocusOutside(event);
|
| 3931 |
+
return;
|
| 3932 |
+
} else if (!onClickOutside) {
|
| 3933 |
+
if (onClose) {
|
| 3934 |
+
onClose();
|
| 3935 |
+
}
|
| 3936 |
|
| 3937 |
+
return;
|
| 3938 |
+
} // Simulate MouseEvent using FocusEvent#relatedTarget as emulated click
|
| 3939 |
+
// target. MouseEvent constructor is unsupported in Internet Explorer.
|
|
|
|
|
|
|
|
|
|
| 3940 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3941 |
|
| 3942 |
+
var clickEvent;
|
|
|
|
|
|
|
| 3943 |
|
| 3944 |
+
try {
|
| 3945 |
+
clickEvent = new window.MouseEvent('click');
|
| 3946 |
+
} catch (error) {
|
| 3947 |
+
clickEvent = document.createEvent('MouseEvent');
|
| 3948 |
+
clickEvent.initMouseEvent('click', true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
|
| 3949 |
+
}
|
| 3950 |
|
| 3951 |
+
Object.defineProperty(clickEvent, 'target', {
|
| 3952 |
+
get: function get() {
|
| 3953 |
+
return event.relatedTarget;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3954 |
}
|
| 3955 |
+
});
|
| 3956 |
+
Object(deprecated_build_module["a" /* default */])('Popover onClickOutside prop', {
|
| 3957 |
+
alternative: 'onFocusOutside'
|
| 3958 |
+
});
|
| 3959 |
+
onClickOutside(clickEvent);
|
| 3960 |
+
} // Disable reason: We care to capture the _bubbled_ events from inputs
|
| 3961 |
+
// within popover as inferring close intent.
|
| 3962 |
|
| 3963 |
+
|
| 3964 |
+
var content = Object(external_this_wp_element_["createElement"])(detect_outside, {
|
| 3965 |
+
onFocusOutside: handleOnFocusOutside
|
| 3966 |
+
}, Object(external_this_wp_element_["createElement"])(build_module_animate["a" /* default */], {
|
| 3967 |
+
type: animate && animateOrigin ? 'appear' : null,
|
| 3968 |
+
options: {
|
| 3969 |
+
origin: animateOrigin
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3970 |
}
|
| 3971 |
+
}, function (_ref3) {
|
| 3972 |
+
var animateClassName = _ref3.className;
|
| 3973 |
+
return Object(external_this_wp_element_["createElement"])(isolated_event_container["a" /* default */], Object(esm_extends["a" /* default */])({
|
| 3974 |
+
className: classnames_default()('components-popover', className, animateClassName, {
|
| 3975 |
+
'is-expanded': isExpanded,
|
| 3976 |
+
'is-without-arrow': noArrow,
|
| 3977 |
+
'is-alternate': isAlternate
|
| 3978 |
+
})
|
| 3979 |
+
}, contentProps, {
|
| 3980 |
+
onKeyDown: maybeClose,
|
| 3981 |
+
ref: containerRef
|
| 3982 |
+
}), isExpanded && Object(external_this_wp_element_["createElement"])(scroll_lock, null), isExpanded && Object(external_this_wp_element_["createElement"])("div", {
|
| 3983 |
+
className: "components-popover__header"
|
| 3984 |
+
}, Object(external_this_wp_element_["createElement"])("span", {
|
| 3985 |
+
className: "components-popover__header-title"
|
| 3986 |
+
}, headerTitle), Object(external_this_wp_element_["createElement"])(build_module_button["a" /* default */], {
|
| 3987 |
+
className: "components-popover__close",
|
| 3988 |
+
icon: library_close["a" /* default */],
|
| 3989 |
+
onClick: onClose
|
| 3990 |
+
})), Object(external_this_wp_element_["createElement"])("div", {
|
| 3991 |
+
ref: contentRef,
|
| 3992 |
+
className: "components-popover__content",
|
| 3993 |
+
tabIndex: "-1"
|
| 3994 |
+
}, Object(external_this_wp_element_["createElement"])("div", {
|
| 3995 |
+
style: {
|
| 3996 |
+
position: 'relative'
|
| 3997 |
+
}
|
| 3998 |
+
}, containerResizeListener, children)));
|
| 3999 |
+
})); // Apply focus to element as long as focusOnMount is truthy; false is
|
| 4000 |
+
// the only "disabled" value.
|
| 4001 |
|
| 4002 |
+
if (focusOnMount) {
|
| 4003 |
+
content = Object(external_this_wp_element_["createElement"])(FocusManaged, null, content);
|
|
|
|
|
|
|
|
|
|
| 4004 |
}
|
| 4005 |
|
| 4006 |
+
if (slot.ref) {
|
| 4007 |
+
content = Object(external_this_wp_element_["createElement"])(slot_fill["a" /* Fill */], {
|
| 4008 |
+
name: __unstableSlotName
|
| 4009 |
+
}, content);
|
| 4010 |
+
}
|
| 4011 |
+
|
| 4012 |
+
if (anchorRef || anchorRect) {
|
| 4013 |
+
return content;
|
| 4014 |
+
}
|
| 4015 |
+
|
| 4016 |
+
return Object(external_this_wp_element_["createElement"])("span", {
|
| 4017 |
+
ref: anchorRefFallback
|
| 4018 |
+
}, content);
|
| 4019 |
};
|
|
|
|
| 4020 |
|
| 4021 |
+
var PopoverContainer = popover_Popover;
|
| 4022 |
+
|
| 4023 |
+
PopoverContainer.Slot = function (_ref4) {
|
| 4024 |
+
var _ref4$name = _ref4.name,
|
| 4025 |
+
name = _ref4$name === void 0 ? SLOT_NAME : _ref4$name;
|
| 4026 |
+
return Object(external_this_wp_element_["createElement"])(slot_fill["b" /* Slot */], {
|
| 4027 |
+
bubblesVirtually: true,
|
| 4028 |
+
name: name,
|
| 4029 |
+
className: "popover-slot"
|
| 4030 |
+
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4031 |
};
|
|
|
|
|
|
|
| 4032 |
|
| 4033 |
+
/* harmony default export */ var popover = __webpack_exports__["a"] = (PopoverContainer);
|
| 4034 |
+
//# sourceMappingURL=index.js.map
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4035 |
|
| 4036 |
+
/***/ }),
|
| 4037 |
|
| 4038 |
+
/***/ 137:
|
| 4039 |
+
/***/ (function(module, exports, __webpack_require__) {
|
| 4040 |
|
| 4041 |
/**
|
| 4042 |
+
* Copyright (c) 2014-present, Facebook, Inc.
|
| 4043 |
+
*
|
| 4044 |
+
* This source code is licensed under the MIT license found in the
|
| 4045 |
+
* LICENSE file in the root directory of this source tree.
|
| 4046 |
*/
|
| 4047 |
|
| 4048 |
+
var runtime = (function (exports) {
|
| 4049 |
+
"use strict";
|
| 4050 |
|
| 4051 |
+
var Op = Object.prototype;
|
| 4052 |
+
var hasOwn = Op.hasOwnProperty;
|
| 4053 |
+
var undefined; // More compressible than void 0.
|
| 4054 |
+
var $Symbol = typeof Symbol === "function" ? Symbol : {};
|
| 4055 |
+
var iteratorSymbol = $Symbol.iterator || "@@iterator";
|
| 4056 |
+
var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
|
| 4057 |
+
var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
|
| 4058 |
|
| 4059 |
+
function define(obj, key, value) {
|
| 4060 |
+
Object.defineProperty(obj, key, {
|
| 4061 |
+
value: value,
|
| 4062 |
+
enumerable: true,
|
| 4063 |
+
configurable: true,
|
| 4064 |
+
writable: true
|
| 4065 |
+
});
|
| 4066 |
+
return obj[key];
|
| 4067 |
+
}
|
| 4068 |
+
try {
|
| 4069 |
+
// IE 8 has a broken Object.defineProperty that only works on DOM objects.
|
| 4070 |
+
define({}, "");
|
| 4071 |
+
} catch (err) {
|
| 4072 |
+
define = function(obj, key, value) {
|
| 4073 |
+
return obj[key] = value;
|
| 4074 |
+
};
|
| 4075 |
+
}
|
| 4076 |
|
| 4077 |
+
function wrap(innerFn, outerFn, self, tryLocsList) {
|
| 4078 |
+
// If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
|
| 4079 |
+
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
|
| 4080 |
+
var generator = Object.create(protoGenerator.prototype);
|
| 4081 |
+
var context = new Context(tryLocsList || []);
|
| 4082 |
|
| 4083 |
+
// The ._invoke method unifies the implementations of the .next,
|
| 4084 |
+
// .throw, and .return methods.
|
| 4085 |
+
generator._invoke = makeInvokeMethod(innerFn, self, context);
|
| 4086 |
|
| 4087 |
+
return generator;
|
| 4088 |
+
}
|
| 4089 |
+
exports.wrap = wrap;
|
| 4090 |
|
| 4091 |
+
// Try/catch helper to minimize deoptimizations. Returns a completion
|
| 4092 |
+
// record like context.tryEntries[i].completion. This interface could
|
| 4093 |
+
// have been (and was previously) designed to take a closure to be
|
| 4094 |
+
// invoked without arguments, but in all the cases we care about we
|
| 4095 |
+
// already have an existing method we want to call, so there's no need
|
| 4096 |
+
// to create a new function object. We can even get away with assuming
|
| 4097 |
+
// the method takes exactly one argument, since that happens to be true
|
| 4098 |
+
// in every case, so we don't have to touch the arguments object. The
|
| 4099 |
+
// only additional allocation required is the completion record, which
|
| 4100 |
+
// has a stable shape and so hopefully should be cheap to allocate.
|
| 4101 |
+
function tryCatch(fn, obj, arg) {
|
| 4102 |
+
try {
|
| 4103 |
+
return { type: "normal", arg: fn.call(obj, arg) };
|
| 4104 |
+
} catch (err) {
|
| 4105 |
+
return { type: "throw", arg: err };
|
| 4106 |
+
}
|
| 4107 |
+
}
|
| 4108 |
|
| 4109 |
+
var GenStateSuspendedStart = "suspendedStart";
|
| 4110 |
+
var GenStateSuspendedYield = "suspendedYield";
|
| 4111 |
+
var GenStateExecuting = "executing";
|
| 4112 |
+
var GenStateCompleted = "completed";
|
| 4113 |
|
| 4114 |
+
// Returning this object from the innerFn has the same effect as
|
| 4115 |
+
// breaking out of the dispatch switch statement.
|
| 4116 |
+
var ContinueSentinel = {};
|
|
|
|
|
|
|
|
|
|
| 4117 |
|
| 4118 |
+
// Dummy constructor functions that we use as the .constructor and
|
| 4119 |
+
// .constructor.prototype properties for functions that return Generator
|
| 4120 |
+
// objects. For full spec compliance, you may wish to configure your
|
| 4121 |
+
// minifier not to mangle the names of these two functions.
|
| 4122 |
+
function Generator() {}
|
| 4123 |
+
function GeneratorFunction() {}
|
| 4124 |
+
function GeneratorFunctionPrototype() {}
|
|
|
|
| 4125 |
|
| 4126 |
+
// This is a polyfill for %IteratorPrototype% for environments that
|
| 4127 |
+
// don't natively support it.
|
| 4128 |
+
var IteratorPrototype = {};
|
| 4129 |
+
IteratorPrototype[iteratorSymbol] = function () {
|
| 4130 |
+
return this;
|
| 4131 |
+
};
|
| 4132 |
|
| 4133 |
+
var getProto = Object.getPrototypeOf;
|
| 4134 |
+
var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
|
| 4135 |
+
if (NativeIteratorPrototype &&
|
| 4136 |
+
NativeIteratorPrototype !== Op &&
|
| 4137 |
+
hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
|
| 4138 |
+
// This environment has a native %IteratorPrototype%; use it instead
|
| 4139 |
+
// of the polyfill.
|
| 4140 |
+
IteratorPrototype = NativeIteratorPrototype;
|
| 4141 |
+
}
|
| 4142 |
|
| 4143 |
+
var Gp = GeneratorFunctionPrototype.prototype =
|
| 4144 |
+
Generator.prototype = Object.create(IteratorPrototype);
|
| 4145 |
+
GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
|
| 4146 |
+
GeneratorFunctionPrototype.constructor = GeneratorFunction;
|
| 4147 |
+
GeneratorFunction.displayName = define(
|
| 4148 |
+
GeneratorFunctionPrototype,
|
| 4149 |
+
toStringTagSymbol,
|
| 4150 |
+
"GeneratorFunction"
|
| 4151 |
+
);
|
| 4152 |
|
| 4153 |
+
// Helper for defining the .next, .throw, and .return methods of the
|
| 4154 |
+
// Iterator interface in terms of a single ._invoke method.
|
| 4155 |
+
function defineIteratorMethods(prototype) {
|
| 4156 |
+
["next", "throw", "return"].forEach(function(method) {
|
| 4157 |
+
define(prototype, method, function(arg) {
|
| 4158 |
+
return this._invoke(method, arg);
|
| 4159 |
+
});
|
| 4160 |
+
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4161 |
}
|
| 4162 |
|
| 4163 |
+
exports.isGeneratorFunction = function(genFun) {
|
| 4164 |
+
var ctor = typeof genFun === "function" && genFun.constructor;
|
| 4165 |
+
return ctor
|
| 4166 |
+
? ctor === GeneratorFunction ||
|
| 4167 |
+
// For the native GeneratorFunction constructor, the best we can
|
| 4168 |
+
// do is to check its .name property.
|
| 4169 |
+
(ctor.displayName || ctor.name) === "GeneratorFunction"
|
| 4170 |
+
: false;
|
| 4171 |
+
};
|
| 4172 |
|
| 4173 |
+
exports.mark = function(genFun) {
|
| 4174 |
+
if (Object.setPrototypeOf) {
|
| 4175 |
+
Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
|
| 4176 |
+
} else {
|
| 4177 |
+
genFun.__proto__ = GeneratorFunctionPrototype;
|
| 4178 |
+
define(genFun, toStringTagSymbol, "GeneratorFunction");
|
| 4179 |
+
}
|
| 4180 |
+
genFun.prototype = Object.create(Gp);
|
| 4181 |
+
return genFun;
|
| 4182 |
+
};
|
| 4183 |
|
| 4184 |
+
// Within the body of any async function, `await x` is transformed to
|
| 4185 |
+
// `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
|
| 4186 |
+
// `hasOwn.call(value, "__await")` to determine if the yielded value is
|
| 4187 |
+
// meant to be awaited.
|
| 4188 |
+
exports.awrap = function(arg) {
|
| 4189 |
+
return { __await: arg };
|
| 4190 |
+
};
|
| 4191 |
|
| 4192 |
+
function AsyncIterator(generator, PromiseImpl) {
|
| 4193 |
+
function invoke(method, arg, resolve, reject) {
|
| 4194 |
+
var record = tryCatch(generator[method], generator, arg);
|
| 4195 |
+
if (record.type === "throw") {
|
| 4196 |
+
reject(record.arg);
|
| 4197 |
+
} else {
|
| 4198 |
+
var result = record.arg;
|
| 4199 |
+
var value = result.value;
|
| 4200 |
+
if (value &&
|
| 4201 |
+
typeof value === "object" &&
|
| 4202 |
+
hasOwn.call(value, "__await")) {
|
| 4203 |
+
return PromiseImpl.resolve(value.__await).then(function(value) {
|
| 4204 |
+
invoke("next", value, resolve, reject);
|
| 4205 |
+
}, function(err) {
|
| 4206 |
+
invoke("throw", err, resolve, reject);
|
| 4207 |
+
});
|
| 4208 |
+
}
|
| 4209 |
|
| 4210 |
+
return PromiseImpl.resolve(value).then(function(unwrapped) {
|
| 4211 |
+
// When a yielded Promise is resolved, its final value becomes
|
| 4212 |
+
// the .value of the Promise<{value,done}> result for the
|
| 4213 |
+
// current iteration.
|
| 4214 |
+
result.value = unwrapped;
|
| 4215 |
+
resolve(result);
|
| 4216 |
+
}, function(error) {
|
| 4217 |
+
// If a rejected Promise was yielded, throw the rejection back
|
| 4218 |
+
// into the async generator function so it can be handled there.
|
| 4219 |
+
return invoke("throw", error, resolve, reject);
|
| 4220 |
+
});
|
| 4221 |
+
}
|
| 4222 |
+
}
|
| 4223 |
|
| 4224 |
+
var previousPromise;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4225 |
|
| 4226 |
+
function enqueue(method, arg) {
|
| 4227 |
+
function callInvokeWithMethodAndArg() {
|
| 4228 |
+
return new PromiseImpl(function(resolve, reject) {
|
| 4229 |
+
invoke(method, arg, resolve, reject);
|
| 4230 |
+
});
|
| 4231 |
+
}
|
| 4232 |
|
| 4233 |
+
return previousPromise =
|
| 4234 |
+
// If enqueue has been called before, then we want to wait until
|
| 4235 |
+
// all previous Promises have been resolved before calling invoke,
|
| 4236 |
+
// so that results are always delivered in the correct order. If
|
| 4237 |
+
// enqueue has not been called before, then it is important to
|
| 4238 |
+
// call invoke immediately, without waiting on a callback to fire,
|
| 4239 |
+
// so that the async generator function has the opportunity to do
|
| 4240 |
+
// any necessary setup in a predictable way. This predictability
|
| 4241 |
+
// is why the Promise constructor synchronously invokes its
|
| 4242 |
+
// executor callback, and why async functions synchronously
|
| 4243 |
+
// execute code before the first await. Since we implement simple
|
| 4244 |
+
// async functions in terms of async generators, it is especially
|
| 4245 |
+
// important to get this right, even though it requires care.
|
| 4246 |
+
previousPromise ? previousPromise.then(
|
| 4247 |
+
callInvokeWithMethodAndArg,
|
| 4248 |
+
// Avoid propagating failures to Promises returned by later
|
| 4249 |
+
// invocations of the iterator.
|
| 4250 |
+
callInvokeWithMethodAndArg
|
| 4251 |
+
) : callInvokeWithMethodAndArg();
|
| 4252 |
+
}
|
| 4253 |
|
| 4254 |
+
// Define the unified helper method that is used to implement .next,
|
| 4255 |
+
// .throw, and .return (see defineIteratorMethods).
|
| 4256 |
+
this._invoke = enqueue;
|
| 4257 |
+
}
|
| 4258 |
|
| 4259 |
+
defineIteratorMethods(AsyncIterator.prototype);
|
| 4260 |
+
AsyncIterator.prototype[asyncIteratorSymbol] = function () {
|
| 4261 |
+
return this;
|
| 4262 |
+
};
|
| 4263 |
+
exports.AsyncIterator = AsyncIterator;
|
| 4264 |
|
| 4265 |
+
// Note that simple async functions are implemented on top of
|
| 4266 |
+
// AsyncIterator objects; they just return a Promise for the value of
|
| 4267 |
+
// the final result produced by the iterator.
|
| 4268 |
+
exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {
|
| 4269 |
+
if (PromiseImpl === void 0) PromiseImpl = Promise;
|
| 4270 |
|
| 4271 |
+
var iter = new AsyncIterator(
|
| 4272 |
+
wrap(innerFn, outerFn, self, tryLocsList),
|
| 4273 |
+
PromiseImpl
|
| 4274 |
+
);
|
| 4275 |
|
| 4276 |
+
return exports.isGeneratorFunction(outerFn)
|
| 4277 |
+
? iter // If outerFn is a generator, return the full iterator.
|
| 4278 |
+
: iter.next().then(function(result) {
|
| 4279 |
+
return result.done ? result.value : iter.next();
|
| 4280 |
+
});
|
| 4281 |
+
};
|
| 4282 |
|
| 4283 |
+
function makeInvokeMethod(innerFn, self, context) {
|
| 4284 |
+
var state = GenStateSuspendedStart;
|
|
|
|
| 4285 |
|
| 4286 |
+
return function invoke(method, arg) {
|
| 4287 |
+
if (state === GenStateExecuting) {
|
| 4288 |
+
throw new Error("Generator is already running");
|
| 4289 |
+
}
|
|
|
|
|
|
|
| 4290 |
|
| 4291 |
+
if (state === GenStateCompleted) {
|
| 4292 |
+
if (method === "throw") {
|
| 4293 |
+
throw arg;
|
| 4294 |
+
}
|
|
|
|
| 4295 |
|
| 4296 |
+
// Be forgiving, per 25.3.3.3.3 of the spec:
|
| 4297 |
+
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
|
| 4298 |
+
return doneResult();
|
| 4299 |
+
}
|
| 4300 |
|
| 4301 |
+
context.method = method;
|
| 4302 |
+
context.arg = arg;
|
|
|
|
| 4303 |
|
| 4304 |
+
while (true) {
|
| 4305 |
+
var delegate = context.delegate;
|
| 4306 |
+
if (delegate) {
|
| 4307 |
+
var delegateResult = maybeInvokeDelegate(delegate, context);
|
| 4308 |
+
if (delegateResult) {
|
| 4309 |
+
if (delegateResult === ContinueSentinel) continue;
|
| 4310 |
+
return delegateResult;
|
| 4311 |
+
}
|
| 4312 |
+
}
|
|
|
|
| 4313 |
|
| 4314 |
+
if (context.method === "next") {
|
| 4315 |
+
// Setting context._sent for legacy support of Babel's
|
| 4316 |
+
// function.sent implementation.
|
| 4317 |
+
context.sent = context._sent = context.arg;
|
| 4318 |
|
| 4319 |
+
} else if (context.method === "throw") {
|
| 4320 |
+
if (state === GenStateSuspendedStart) {
|
| 4321 |
+
state = GenStateCompleted;
|
| 4322 |
+
throw context.arg;
|
| 4323 |
+
}
|
| 4324 |
|
| 4325 |
+
context.dispatchException(context.arg);
|
|
|
|
| 4326 |
|
| 4327 |
+
} else if (context.method === "return") {
|
| 4328 |
+
context.abrupt("return", context.arg);
|
| 4329 |
+
}
|
| 4330 |
|
| 4331 |
+
state = GenStateExecuting;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4332 |
|
| 4333 |
+
var record = tryCatch(innerFn, self, context);
|
| 4334 |
+
if (record.type === "normal") {
|
| 4335 |
+
// If an exception is thrown from innerFn, we leave state ===
|
| 4336 |
+
// GenStateExecuting and loop back for another invocation.
|
| 4337 |
+
state = context.done
|
| 4338 |
+
? GenStateCompleted
|
| 4339 |
+
: GenStateSuspendedYield;
|
| 4340 |
|
| 4341 |
+
if (record.arg === ContinueSentinel) {
|
| 4342 |
+
continue;
|
| 4343 |
+
}
|
|
|
|
|
|
|
| 4344 |
|
| 4345 |
+
return {
|
| 4346 |
+
value: record.arg,
|
| 4347 |
+
done: context.done
|
| 4348 |
+
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4349 |
|
| 4350 |
+
} else if (record.type === "throw") {
|
| 4351 |
+
state = GenStateCompleted;
|
| 4352 |
+
// Dispatch the exception by looping back around to the
|
| 4353 |
+
// context.dispatchException(context.arg) call above.
|
| 4354 |
+
context.method = "throw";
|
| 4355 |
+
context.arg = record.arg;
|
| 4356 |
+
}
|
| 4357 |
+
}
|
| 4358 |
+
};
|
| 4359 |
+
}
|
| 4360 |
|
| 4361 |
+
// Call delegate.iterator[context.method](context.arg) and handle the
|
| 4362 |
+
// result, either by returning a { value, done } result from the
|
| 4363 |
+
// delegate iterator, or by modifying context.method and context.arg,
|
| 4364 |
+
// setting context.delegate to null, and returning the ContinueSentinel.
|
| 4365 |
+
function maybeInvokeDelegate(delegate, context) {
|
| 4366 |
+
var method = delegate.iterator[context.method];
|
| 4367 |
+
if (method === undefined) {
|
| 4368 |
+
// A .throw or .return when the delegate iterator has no .throw
|
| 4369 |
+
// method always terminates the yield* loop.
|
| 4370 |
+
context.delegate = null;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4371 |
|
| 4372 |
+
if (context.method === "throw") {
|
| 4373 |
+
// Note: ["return"] must be used for ES3 parsing compatibility.
|
| 4374 |
+
if (delegate.iterator["return"]) {
|
| 4375 |
+
// If the delegate iterator has a return method, give it a
|
| 4376 |
+
// chance to clean up.
|
| 4377 |
+
context.method = "return";
|
| 4378 |
+
context.arg = undefined;
|
| 4379 |
+
maybeInvokeDelegate(delegate, context);
|
| 4380 |
|
| 4381 |
+
if (context.method === "throw") {
|
| 4382 |
+
// If maybeInvokeDelegate(context) changed context.method from
|
| 4383 |
+
// "return" to "throw", let that override the TypeError below.
|
| 4384 |
+
return ContinueSentinel;
|
| 4385 |
+
}
|
| 4386 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4387 |
|
| 4388 |
+
context.method = "throw";
|
| 4389 |
+
context.arg = new TypeError(
|
| 4390 |
+
"The iterator does not provide a 'throw' method");
|
| 4391 |
+
}
|
|
|
|
| 4392 |
|
| 4393 |
+
return ContinueSentinel;
|
|
|
|
|
|
|
| 4394 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4395 |
|
| 4396 |
+
var record = tryCatch(method, delegate.iterator, context.arg);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4397 |
|
| 4398 |
+
if (record.type === "throw") {
|
| 4399 |
+
context.method = "throw";
|
| 4400 |
+
context.arg = record.arg;
|
| 4401 |
+
context.delegate = null;
|
| 4402 |
+
return ContinueSentinel;
|
| 4403 |
}
|
| 4404 |
|
| 4405 |
+
var info = record.arg;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4406 |
|
| 4407 |
+
if (! info) {
|
| 4408 |
+
context.method = "throw";
|
| 4409 |
+
context.arg = new TypeError("iterator result is not an object");
|
| 4410 |
+
context.delegate = null;
|
| 4411 |
+
return ContinueSentinel;
|
| 4412 |
+
}
|
| 4413 |
|
| 4414 |
+
if (info.done) {
|
| 4415 |
+
// Assign the result of the finished delegate to the temporary
|
| 4416 |
+
// variable specified by delegate.resultName (see delegateYield).
|
| 4417 |
+
context[delegate.resultName] = info.value;
|
| 4418 |
|
| 4419 |
+
// Resume execution at the desired location (see delegateYield).
|
| 4420 |
+
context.next = delegate.nextLoc;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4421 |
|
| 4422 |
+
// If context.method was "throw" but the delegate handled the
|
| 4423 |
+
// exception, let the outer generator proceed normally. If
|
| 4424 |
+
// context.method was "next", forget context.arg since it has been
|
| 4425 |
+
// "consumed" by the delegate iterator. If context.method was
|
| 4426 |
+
// "return", allow the original .return call to continue in the
|
| 4427 |
+
// outer generator.
|
| 4428 |
+
if (context.method !== "return") {
|
| 4429 |
+
context.method = "next";
|
| 4430 |
+
context.arg = undefined;
|
| 4431 |
+
}
|
| 4432 |
|
| 4433 |
+
} else {
|
| 4434 |
+
// Re-yield the result returned by the delegate method.
|
| 4435 |
+
return info;
|
| 4436 |
+
}
|
| 4437 |
|
| 4438 |
+
// The delegate iterator is finished, so forget it and continue with
|
| 4439 |
+
// the outer generator.
|
| 4440 |
+
context.delegate = null;
|
| 4441 |
+
return ContinueSentinel;
|
| 4442 |
+
}
|
| 4443 |
|
| 4444 |
+
// Define Generator.prototype.{next,throw,return} in terms of the
|
| 4445 |
+
// unified ._invoke helper method.
|
| 4446 |
+
defineIteratorMethods(Gp);
|
| 4447 |
|
| 4448 |
+
define(Gp, toStringTagSymbol, "Generator");
|
| 4449 |
|
| 4450 |
+
// A Generator should always return itself as the iterator object when the
|
| 4451 |
+
// @@iterator function is called on it. Some browsers' implementations of the
|
| 4452 |
+
// iterator prototype chain incorrectly implement this, causing the Generator
|
| 4453 |
+
// object to not be returned from this call. This ensures that doesn't happen.
|
| 4454 |
+
// See https://github.com/facebook/regenerator/issues/274 for more details.
|
| 4455 |
+
Gp[iteratorSymbol] = function() {
|
| 4456 |
+
return this;
|
| 4457 |
+
};
|
| 4458 |
|
| 4459 |
+
Gp.toString = function() {
|
| 4460 |
+
return "[object Generator]";
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4461 |
};
|
|
|
|
|
|
|
| 4462 |
|
| 4463 |
+
function pushTryEntry(locs) {
|
| 4464 |
+
var entry = { tryLoc: locs[0] };
|
| 4465 |
|
| 4466 |
+
if (1 in locs) {
|
| 4467 |
+
entry.catchLoc = locs[1];
|
| 4468 |
+
}
|
| 4469 |
|
| 4470 |
+
if (2 in locs) {
|
| 4471 |
+
entry.finallyLoc = locs[2];
|
| 4472 |
+
entry.afterLoc = locs[3];
|
| 4473 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4474 |
|
| 4475 |
+
this.tryEntries.push(entry);
|
| 4476 |
+
}
|
| 4477 |
|
| 4478 |
+
function resetTryEntry(entry) {
|
| 4479 |
+
var record = entry.completion || {};
|
| 4480 |
+
record.type = "normal";
|
| 4481 |
+
delete record.arg;
|
| 4482 |
+
entry.completion = record;
|
| 4483 |
+
}
|
| 4484 |
|
| 4485 |
+
function Context(tryLocsList) {
|
| 4486 |
+
// The root entry object (effectively a try statement without a catch
|
| 4487 |
+
// or a finally block) gives us a place to store values thrown from
|
| 4488 |
+
// locations where there is no enclosing try statement.
|
| 4489 |
+
this.tryEntries = [{ tryLoc: "root" }];
|
| 4490 |
+
tryLocsList.forEach(pushTryEntry, this);
|
| 4491 |
+
this.reset(true);
|
| 4492 |
+
}
|
| 4493 |
|
| 4494 |
+
exports.keys = function(object) {
|
| 4495 |
+
var keys = [];
|
| 4496 |
+
for (var key in object) {
|
| 4497 |
+
keys.push(key);
|
| 4498 |
+
}
|
| 4499 |
+
keys.reverse();
|
| 4500 |
|
| 4501 |
+
// Rather than returning an object with a next method, we keep
|
| 4502 |
+
// things simple and return the next function itself.
|
| 4503 |
+
return function next() {
|
| 4504 |
+
while (keys.length) {
|
| 4505 |
+
var key = keys.pop();
|
| 4506 |
+
if (key in object) {
|
| 4507 |
+
next.value = key;
|
| 4508 |
+
next.done = false;
|
| 4509 |
+
return next;
|
| 4510 |
+
}
|
| 4511 |
+
}
|
| 4512 |
|
| 4513 |
+
// To avoid creating an additional object, we just hang the .value
|
| 4514 |
+
// and .done properties off the next function object itself. This
|
| 4515 |
+
// also ensures that the minifier will not anonymize the function.
|
| 4516 |
+
next.done = true;
|
| 4517 |
+
return next;
|
| 4518 |
+
};
|
| 4519 |
+
};
|
| 4520 |
|
| 4521 |
+
function values(iterable) {
|
| 4522 |
+
if (iterable) {
|
| 4523 |
+
var iteratorMethod = iterable[iteratorSymbol];
|
| 4524 |
+
if (iteratorMethod) {
|
| 4525 |
+
return iteratorMethod.call(iterable);
|
| 4526 |
+
}
|
| 4527 |
|
| 4528 |
+
if (typeof iterable.next === "function") {
|
| 4529 |
+
return iterable;
|
| 4530 |
+
}
|
| 4531 |
|
| 4532 |
+
if (!isNaN(iterable.length)) {
|
| 4533 |
+
var i = -1, next = function next() {
|
| 4534 |
+
while (++i < iterable.length) {
|
| 4535 |
+
if (hasOwn.call(iterable, i)) {
|
| 4536 |
+
next.value = iterable[i];
|
| 4537 |
+
next.done = false;
|
| 4538 |
+
return next;
|
| 4539 |
+
}
|
| 4540 |
+
}
|
| 4541 |
|
| 4542 |
+
next.value = undefined;
|
| 4543 |
+
next.done = true;
|
| 4544 |
|
| 4545 |
+
return next;
|
| 4546 |
+
};
|
| 4547 |
|
| 4548 |
+
return next.next = next;
|
| 4549 |
+
}
|
| 4550 |
+
}
|
| 4551 |
|
| 4552 |
+
// Return an iterator with no values.
|
| 4553 |
+
return { next: doneResult };
|
| 4554 |
+
}
|
| 4555 |
+
exports.values = values;
|
| 4556 |
|
| 4557 |
+
function doneResult() {
|
| 4558 |
+
return { value: undefined, done: true };
|
| 4559 |
+
}
|
| 4560 |
|
| 4561 |
+
Context.prototype = {
|
| 4562 |
+
constructor: Context,
|
| 4563 |
|
| 4564 |
+
reset: function(skipTempReset) {
|
| 4565 |
+
this.prev = 0;
|
| 4566 |
+
this.next = 0;
|
| 4567 |
+
// Resetting context._sent for legacy support of Babel's
|
| 4568 |
+
// function.sent implementation.
|
| 4569 |
+
this.sent = this._sent = undefined;
|
| 4570 |
+
this.done = false;
|
| 4571 |
+
this.delegate = null;
|
| 4572 |
|
| 4573 |
+
this.method = "next";
|
| 4574 |
+
this.arg = undefined;
|
|
|
|
|
|
|
| 4575 |
|
| 4576 |
+
this.tryEntries.forEach(resetTryEntry);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4577 |
|
| 4578 |
+
if (!skipTempReset) {
|
| 4579 |
+
for (var name in this) {
|
| 4580 |
+
// Not sure about the optimal order of these conditions:
|
| 4581 |
+
if (name.charAt(0) === "t" &&
|
| 4582 |
+
hasOwn.call(this, name) &&
|
| 4583 |
+
!isNaN(+name.slice(1))) {
|
| 4584 |
+
this[name] = undefined;
|
| 4585 |
+
}
|
| 4586 |
+
}
|
| 4587 |
+
}
|
| 4588 |
+
},
|
| 4589 |
|
| 4590 |
+
stop: function() {
|
| 4591 |
+
this.done = true;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4592 |
|
| 4593 |
+
var rootEntry = this.tryEntries[0];
|
| 4594 |
+
var rootRecord = rootEntry.completion;
|
| 4595 |
+
if (rootRecord.type === "throw") {
|
| 4596 |
+
throw rootRecord.arg;
|
| 4597 |
+
}
|
| 4598 |
|
| 4599 |
+
return this.rval;
|
| 4600 |
+
},
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4601 |
|
| 4602 |
+
dispatchException: function(exception) {
|
| 4603 |
+
if (this.done) {
|
| 4604 |
+
throw exception;
|
|
|
|
|
|
|
|
|
|
| 4605 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4606 |
|
| 4607 |
+
var context = this;
|
| 4608 |
+
function handle(loc, caught) {
|
| 4609 |
+
record.type = "throw";
|
| 4610 |
+
record.arg = exception;
|
| 4611 |
+
context.next = loc;
|
|
|
|
|
|
|
|
|
|
| 4612 |
|
| 4613 |
+
if (caught) {
|
| 4614 |
+
// If the dispatched exception was caught by a catch block,
|
| 4615 |
+
// then let that catch block handle the exception normally.
|
| 4616 |
+
context.method = "next";
|
| 4617 |
+
context.arg = undefined;
|
| 4618 |
+
}
|
| 4619 |
|
| 4620 |
+
return !! caught;
|
| 4621 |
+
}
|
| 4622 |
|
| 4623 |
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
| 4624 |
+
var entry = this.tryEntries[i];
|
| 4625 |
+
var record = entry.completion;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4626 |
|
| 4627 |
+
if (entry.tryLoc === "root") {
|
| 4628 |
+
// Exception thrown outside of any try block that could handle
|
| 4629 |
+
// it, so set the completion value of the entire function to
|
| 4630 |
+
// throw the exception.
|
| 4631 |
+
return handle("end");
|
| 4632 |
+
}
|
|
|
|
|
|
|
| 4633 |
|
| 4634 |
+
if (entry.tryLoc <= this.prev) {
|
| 4635 |
+
var hasCatch = hasOwn.call(entry, "catchLoc");
|
| 4636 |
+
var hasFinally = hasOwn.call(entry, "finallyLoc");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4637 |
|
| 4638 |
+
if (hasCatch && hasFinally) {
|
| 4639 |
+
if (this.prev < entry.catchLoc) {
|
| 4640 |
+
return handle(entry.catchLoc, true);
|
| 4641 |
+
} else if (this.prev < entry.finallyLoc) {
|
| 4642 |
+
return handle(entry.finallyLoc);
|
| 4643 |
+
}
|
| 4644 |
|
| 4645 |
+
} else if (hasCatch) {
|
| 4646 |
+
if (this.prev < entry.catchLoc) {
|
| 4647 |
+
return handle(entry.catchLoc, true);
|
| 4648 |
+
}
|
| 4649 |
|
| 4650 |
+
} else if (hasFinally) {
|
| 4651 |
+
if (this.prev < entry.finallyLoc) {
|
| 4652 |
+
return handle(entry.finallyLoc);
|
| 4653 |
+
}
|
| 4654 |
|
| 4655 |
+
} else {
|
| 4656 |
+
throw new Error("try statement without catch or finally");
|
| 4657 |
+
}
|
| 4658 |
+
}
|
| 4659 |
+
}
|
| 4660 |
+
},
|
| 4661 |
|
| 4662 |
+
abrupt: function(type, arg) {
|
| 4663 |
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
| 4664 |
+
var entry = this.tryEntries[i];
|
| 4665 |
+
if (entry.tryLoc <= this.prev &&
|
| 4666 |
+
hasOwn.call(entry, "finallyLoc") &&
|
| 4667 |
+
this.prev < entry.finallyLoc) {
|
| 4668 |
+
var finallyEntry = entry;
|
| 4669 |
+
break;
|
| 4670 |
+
}
|
| 4671 |
+
}
|
| 4672 |
|
| 4673 |
+
if (finallyEntry &&
|
| 4674 |
+
(type === "break" ||
|
| 4675 |
+
type === "continue") &&
|
| 4676 |
+
finallyEntry.tryLoc <= arg &&
|
| 4677 |
+
arg <= finallyEntry.finallyLoc) {
|
| 4678 |
+
// Ignore the finally entry if control is not jumping to a
|
| 4679 |
+
// location outside the try/catch block.
|
| 4680 |
+
finallyEntry = null;
|
| 4681 |
+
}
|
| 4682 |
|
| 4683 |
+
var record = finallyEntry ? finallyEntry.completion : {};
|
| 4684 |
+
record.type = type;
|
| 4685 |
+
record.arg = arg;
|
| 4686 |
|
| 4687 |
+
if (finallyEntry) {
|
| 4688 |
+
this.method = "next";
|
| 4689 |
+
this.next = finallyEntry.finallyLoc;
|
| 4690 |
+
return ContinueSentinel;
|
| 4691 |
+
}
|
| 4692 |
|
| 4693 |
+
return this.complete(record);
|
| 4694 |
+
},
|
| 4695 |
|
| 4696 |
+
complete: function(record, afterLoc) {
|
| 4697 |
+
if (record.type === "throw") {
|
| 4698 |
+
throw record.arg;
|
| 4699 |
+
}
|
| 4700 |
|
| 4701 |
+
if (record.type === "break" ||
|
| 4702 |
+
record.type === "continue") {
|
| 4703 |
+
this.next = record.arg;
|
| 4704 |
+
} else if (record.type === "return") {
|
| 4705 |
+
this.rval = this.arg = record.arg;
|
| 4706 |
+
this.method = "return";
|
| 4707 |
+
this.next = "end";
|
| 4708 |
+
} else if (record.type === "normal" && afterLoc) {
|
| 4709 |
+
this.next = afterLoc;
|
| 4710 |
+
}
|
| 4711 |
|
| 4712 |
+
return ContinueSentinel;
|
| 4713 |
+
},
|
| 4714 |
|
| 4715 |
+
finish: function(finallyLoc) {
|
| 4716 |
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
| 4717 |
+
var entry = this.tryEntries[i];
|
| 4718 |
+
if (entry.finallyLoc === finallyLoc) {
|
| 4719 |
+
this.complete(entry.completion, entry.afterLoc);
|
| 4720 |
+
resetTryEntry(entry);
|
| 4721 |
+
return ContinueSentinel;
|
| 4722 |
+
}
|
| 4723 |
+
}
|
| 4724 |
+
},
|
| 4725 |
|
| 4726 |
+
"catch": function(tryLoc) {
|
| 4727 |
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
| 4728 |
+
var entry = this.tryEntries[i];
|
| 4729 |
+
if (entry.tryLoc === tryLoc) {
|
| 4730 |
+
var record = entry.completion;
|
| 4731 |
+
if (record.type === "throw") {
|
| 4732 |
+
var thrown = record.arg;
|
| 4733 |
+
resetTryEntry(entry);
|
| 4734 |
+
}
|
| 4735 |
+
return thrown;
|
| 4736 |
+
}
|
| 4737 |
+
}
|
| 4738 |
|
| 4739 |
+
// The context.catch method must only be called with a location
|
| 4740 |
+
// argument that corresponds to a known catch block.
|
| 4741 |
+
throw new Error("illegal catch attempt");
|
| 4742 |
+
},
|
| 4743 |
|
| 4744 |
+
delegateYield: function(iterable, resultName, nextLoc) {
|
| 4745 |
+
this.delegate = {
|
| 4746 |
+
iterator: values(iterable),
|
| 4747 |
+
resultName: resultName,
|
| 4748 |
+
nextLoc: nextLoc
|
| 4749 |
+
};
|
|
|
|
|
|
|
| 4750 |
|
| 4751 |
+
if (this.method === "next") {
|
| 4752 |
+
// Deliberately forget the last sent value so that we don't
|
| 4753 |
+
// accidentally pass it on to the delegate.
|
| 4754 |
+
this.arg = undefined;
|
| 4755 |
+
}
|
| 4756 |
|
| 4757 |
+
return ContinueSentinel;
|
| 4758 |
+
}
|
| 4759 |
+
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4760 |
|
| 4761 |
+
// Regardless of whether this script is executing as a CommonJS module
|
| 4762 |
+
// or not, return the runtime object so that we can declare the variable
|
| 4763 |
+
// regeneratorRuntime in the outer scope, which allows this module to be
|
| 4764 |
+
// injected easily by `bin/regenerator --include-runtime script.js`.
|
| 4765 |
+
return exports;
|
| 4766 |
|
| 4767 |
+
}(
|
| 4768 |
+
// If this script is executing as a CommonJS module, use module.exports
|
| 4769 |
+
// as the regeneratorRuntime namespace. Otherwise create a new empty
|
| 4770 |
+
// object. Either way, the resulting object will be used to initialize
|
| 4771 |
+
// the regeneratorRuntime variable at the top of this file.
|
| 4772 |
+
true ? module.exports : undefined
|
| 4773 |
+
));
|
| 4774 |
+
|
| 4775 |
+
try {
|
| 4776 |
+
regeneratorRuntime = runtime;
|
| 4777 |
+
} catch (accidentalStrictMode) {
|
| 4778 |
+
// This module should not be running in strict mode, so the above
|
| 4779 |
+
// assignment should always work unless something is misconfigured. Just
|
| 4780 |
+
// in case runtime.js accidentally runs in strict mode, we can escape
|
| 4781 |
+
// strict mode using a global Function call. This could conceivably fail
|
| 4782 |
+
// if a Content Security Policy forbids using Function, but in that case
|
| 4783 |
+
// the proper solution is to fix the accidental strict mode problem. If
|
| 4784 |
+
// you've misconfigured your bundler to force strict mode and applied a
|
| 4785 |
+
// CSP to forbid Function, and you're not willing to fix either of those
|
| 4786 |
+
// problems, please detail your unique predicament in a GitHub issue.
|
| 4787 |
+
Function("r", "regeneratorRuntime = r")(runtime);
|
| 4788 |
+
}
|
| 4789 |
|
|
|
|
|
|
|
|
|
|
| 4790 |
|
| 4791 |
+
/***/ }),
|
| 4792 |
|
| 4793 |
+
/***/ 138:
|
| 4794 |
+
/***/ (function(module, exports, __webpack_require__) {
|
| 4795 |
|
| 4796 |
+
"use strict";
|
| 4797 |
/**
|
| 4798 |
+
* Copyright (c) 2013-present, Facebook, Inc.
|
| 4799 |
+
*
|
| 4800 |
+
* This source code is licensed under the MIT license found in the
|
| 4801 |
+
* LICENSE file in the root directory of this source tree.
|
| 4802 |
*/
|
| 4803 |
|
| 4804 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4805 |
|
| 4806 |
+
var ReactPropTypesSecret = __webpack_require__(139);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4807 |
|
| 4808 |
+
function emptyFunction() {}
|
| 4809 |
+
function emptyFunctionWithReset() {}
|
| 4810 |
+
emptyFunctionWithReset.resetWarningCache = emptyFunction;
|
| 4811 |
|
| 4812 |
+
module.exports = function() {
|
| 4813 |
+
function shim(props, propName, componentName, location, propFullName, secret) {
|
| 4814 |
+
if (secret === ReactPropTypesSecret) {
|
| 4815 |
+
// It is still safe when called from React.
|
| 4816 |
+
return;
|
| 4817 |
+
}
|
| 4818 |
+
var err = new Error(
|
| 4819 |
+
'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
|
| 4820 |
+
'Use PropTypes.checkPropTypes() to call them. ' +
|
| 4821 |
+
'Read more at http://fb.me/use-check-prop-types'
|
| 4822 |
+
);
|
| 4823 |
+
err.name = 'Invariant Violation';
|
| 4824 |
+
throw err;
|
| 4825 |
+
};
|
| 4826 |
+
shim.isRequired = shim;
|
| 4827 |
+
function getShim() {
|
| 4828 |
+
return shim;
|
| 4829 |
+
};
|
| 4830 |
+
// Important!
|
| 4831 |
+
// Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
|
| 4832 |
+
var ReactPropTypes = {
|
| 4833 |
+
array: shim,
|
| 4834 |
+
bool: shim,
|
| 4835 |
+
func: shim,
|
| 4836 |
+
number: shim,
|
| 4837 |
+
object: shim,
|
| 4838 |
+
string: shim,
|
| 4839 |
+
symbol: shim,
|
| 4840 |
|
| 4841 |
+
any: shim,
|
| 4842 |
+
arrayOf: getShim,
|
| 4843 |
+
element: shim,
|
| 4844 |
+
elementType: shim,
|
| 4845 |
+
instanceOf: getShim,
|
| 4846 |
+
node: shim,
|
| 4847 |
+
objectOf: getShim,
|
| 4848 |
+
oneOf: getShim,
|
| 4849 |
+
oneOfType: getShim,
|
| 4850 |
+
shape: getShim,
|
| 4851 |
+
exact: getShim,
|
| 4852 |
|
| 4853 |
+
checkPropTypes: emptyFunctionWithReset,
|
| 4854 |
+
resetWarningCache: emptyFunction
|
| 4855 |
+
};
|
| 4856 |
+
|
| 4857 |
+
ReactPropTypes.PropTypes = ReactPropTypes;
|
| 4858 |
+
|
| 4859 |
+
return ReactPropTypes;
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4860 |
};
|
|
|
|
|
|
|
| 4861 |
|
| 4862 |
|
| 4863 |
+
/***/ }),
|
| 4864 |
+
|
| 4865 |
+
/***/ 139:
|
| 4866 |
+
/***/ (function(module, exports, __webpack_require__) {
|
| 4867 |
+
|
| 4868 |
+
"use strict";
|
| 4869 |
/**
|
| 4870 |
+
* Copyright (c) 2013-present, Facebook, Inc.
|
| 4871 |
+
*
|
| 4872 |
+
* This source code is licensed under the MIT license found in the
|
| 4873 |
+
* LICENSE file in the root directory of this source tree.
|
| 4874 |
*/
|
| 4875 |
|
| 4876 |
|
| 4877 |
|
| 4878 |
+
var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4879 |
|
| 4880 |
+
module.exports = ReactPropTypesSecret;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4881 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4882 |
|
| 4883 |
+
/***/ }),
|
| 4884 |
|
| 4885 |
+
/***/ 14:
|
| 4886 |
+
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
| 4887 |
|
| 4888 |
+
module.exports = __webpack_require__(137);
|
| 4889 |
|
| 4890 |
|
| 4891 |
+
/***/ }),
|
| 4892 |
|
| 4893 |
+
/***/ 140:
|
| 4894 |
+
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
|
| 4895 |
|
| 4896 |
+
var arrayLikeToArray = __webpack_require__(79);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4897 |
|
| 4898 |
+
function _arrayWithoutHoles(arr) {
|
| 4899 |
+
if (Array.isArray(arr)) return arrayLikeToArray(arr);
|
| 4900 |
+
}
|
| 4901 |
|
| 4902 |
+
module.exports = _arrayWithoutHoles;
|
| 4903 |
|
| 4904 |
+
/***/ }),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4905 |
|
| 4906 |
+
/***/ 141:
|
| 4907 |
+
/***/ (function(module, exports) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4908 |
|
| 4909 |
+
function _iterableToArray(iter) {
|
| 4910 |
+
if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
|
| 4911 |
+
}
|
| 4912 |
|
| 4913 |
+
module.exports = _iterableToArray;
|
| 4914 |
|
| 4915 |
+
/***/ }),
|
|
|
|
|
|
|
| 4916 |
|
| 4917 |
+
/***/ 142:
|
| 4918 |
+
/***/ (function(module, exports) {
|
| 4919 |
|
| 4920 |
+
function _nonIterableSpread() {
|
| 4921 |
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
| 4922 |
+
}
|
| 4923 |
|
| 4924 |
+
module.exports = _nonIterableSpread;
|
| 4925 |
|
| 4926 |
+
/***/ }),
|
| 4927 |
|
| 4928 |
+
/***/ 143:
|
| 4929 |
+
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
| 4930 |
|
| 4931 |
+
"use strict";
|
|
|
|
|
|
|
| 4932 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4933 |
|
| 4934 |
+
var keys = Object.keys;
|
| 4935 |
|
| 4936 |
/**
|
| 4937 |
+
* Returns true if the two objects are shallow equal, or false otherwise.
|
| 4938 |
+
*
|
| 4939 |
+
* @param {import('.').ComparableObject} a First object to compare.
|
| 4940 |
+
* @param {import('.').ComparableObject} b Second object to compare.
|
| 4941 |
+
*
|
| 4942 |
+
* @return {boolean} Whether the two objects are shallow equal.
|
| 4943 |
*/
|
| 4944 |
+
function isShallowEqualObjects( a, b ) {
|
| 4945 |
+
var aKeys, bKeys, i, key, aValue;
|
| 4946 |
|
| 4947 |
+
if ( a === b ) {
|
| 4948 |
+
return true;
|
| 4949 |
+
}
|
| 4950 |
|
| 4951 |
+
aKeys = keys( a );
|
| 4952 |
+
bKeys = keys( b );
|
| 4953 |
|
| 4954 |
+
if ( aKeys.length !== bKeys.length ) {
|
| 4955 |
+
return false;
|
| 4956 |
+
}
|
| 4957 |
|
| 4958 |
+
i = 0;
|
| 4959 |
+
|
| 4960 |
+
while ( i < aKeys.length ) {
|
| 4961 |
+
key = aKeys[ i ];
|
| 4962 |
+
aValue = a[ key ];
|
| 4963 |
+
|
| 4964 |
+
if (
|
| 4965 |
+
// In iterating only the keys of the first object after verifying
|
| 4966 |
+
// equal lengths, account for the case that an explicit `undefined`
|
| 4967 |
+
// value in the first is implicitly undefined in the second.
|
| 4968 |
+
//
|
| 4969 |
+
// Example: isShallowEqualObjects( { a: undefined }, { b: 5 } )
|
| 4970 |
+
( aValue === undefined && ! b.hasOwnProperty( key ) ) ||
|
| 4971 |
+
aValue !== b[ key ]
|
| 4972 |
+
) {
|
| 4973 |
+
return false;
|
| 4974 |
+
}
|
| 4975 |
|
| 4976 |
+
i++;
|
| 4977 |
+
}
|
|
|
|
| 4978 |
|
| 4979 |
+
return true;
|
| 4980 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4981 |
|
| 4982 |
+
module.exports = isShallowEqualObjects;
|
| 4983 |
|
| 4984 |
|
| 4985 |
+
/***/ }),
|
| 4986 |
+
|
| 4987 |
+
/***/ 144:
|
| 4988 |
+
/***/ (function(module, exports, __webpack_require__) {
|
| 4989 |
+
|
| 4990 |
+
"use strict";
|
| 4991 |
+
|
| 4992 |
|
| 4993 |
/**
|
| 4994 |
+
* Returns true if the two arrays are shallow equal, or false otherwise.
|
| 4995 |
+
*
|
| 4996 |
+
* @param {any[]} a First array to compare.
|
| 4997 |
+
* @param {any[]} b Second array to compare.
|
| 4998 |
+
*
|
| 4999 |
+
* @return {boolean} Whether the two arrays are shallow equal.
|
| 5000 |
*/
|
| 5001 |
+
function isShallowEqualArrays( a, b ) {
|
| 5002 |
+
var i;
|
| 5003 |
|
| 5004 |
+
if ( a === b ) {
|
| 5005 |
+
return true;
|
| 5006 |
+
}
|
| 5007 |
|
| 5008 |
+
if ( a.length !== b.length ) {
|
| 5009 |
+
return false;
|
| 5010 |
+
}
|
| 5011 |
|
| 5012 |
+
for ( i = 0; i < a.length; i++ ) {
|
| 5013 |
+
if ( a[ i ] !== b[ i ] ) {
|
| 5014 |
+
return false;
|
| 5015 |
+
}
|
| 5016 |
+
}
|
| 5017 |
|
| 5018 |
+
return true;
|
| 5019 |
+
}
|
| 5020 |
|
| 5021 |
+
module.exports = isShallowEqualArrays;
|
| 5022 |
|
| 5023 |
|
| 5024 |
+
/***/ }),
|
|
|
|
|
|
|
| 5025 |
|
| 5026 |
+
/***/ 15:
|
| 5027 |
+
/***/ (function(module, exports) {
|
| 5028 |
|
| 5029 |
+
function _defineProperties(target, props) {
|
| 5030 |
+
for (var i = 0; i < props.length; i++) {
|
| 5031 |
+
var descriptor = props[i];
|
| 5032 |
+
descriptor.enumerable = descriptor.enumerable || false;
|
| 5033 |
+
descriptor.configurable = true;
|
| 5034 |
+
if ("value" in descriptor) descriptor.writable = true;
|
| 5035 |
+
Object.defineProperty(target, descriptor.key, descriptor);
|
| 5036 |
+
}
|
| 5037 |
+
}
|
| 5038 |
|
| 5039 |
+
function _createClass(Constructor, protoProps, staticProps) {
|
| 5040 |
+
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
| 5041 |
+
if (staticProps) _defineProperties(Constructor, staticProps);
|
| 5042 |
+
return Constructor;
|
| 5043 |
+
}
|
| 5044 |
|
| 5045 |
+
module.exports = _createClass;
|
| 5046 |
|
| 5047 |
+
/***/ }),
|
| 5048 |
|
| 5049 |
+
/***/ 156:
|
| 5050 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5051 |
|
| 5052 |
+
"use strict";
|
| 5053 |
+
/* unused harmony export isHorizontalEdge */
|
| 5054 |
+
/* unused harmony export isVerticalEdge */
|
| 5055 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getRectangleFromRange; });
|
| 5056 |
+
/* unused harmony export computeCaretRect */
|
| 5057 |
+
/* unused harmony export placeCaretAtHorizontalEdge */
|
| 5058 |
+
/* unused harmony export placeCaretAtVerticalEdge */
|
| 5059 |
+
/* unused harmony export isTextField */
|
| 5060 |
+
/* unused harmony export isNumberInput */
|
| 5061 |
+
/* unused harmony export documentHasTextSelection */
|
| 5062 |
+
/* unused harmony export documentHasUncollapsedSelection */
|
| 5063 |
+
/* unused harmony export documentHasSelection */
|
| 5064 |
+
/* unused harmony export isEntirelySelected */
|
| 5065 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getScrollContainer; });
|
| 5066 |
+
/* unused harmony export getOffsetParent */
|
| 5067 |
+
/* unused harmony export replace */
|
| 5068 |
+
/* unused harmony export remove */
|
| 5069 |
+
/* unused harmony export insertAfter */
|
| 5070 |
+
/* unused harmony export unwrap */
|
| 5071 |
+
/* unused harmony export replaceTag */
|
| 5072 |
+
/* unused harmony export wrap */
|
| 5073 |
+
/* unused harmony export __unstableStripHTML */
|
| 5074 |
+
/* unused harmony export isEmpty */
|
| 5075 |
+
/* unused harmony export removeInvalidHTML */
|
| 5076 |
+
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
|
| 5077 |
+
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__);
|
| 5078 |
+
/* harmony import */ var _phrasing_content__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(74);
|
| 5079 |
+
/**
|
| 5080 |
+
* External dependencies
|
| 5081 |
+
*/
|
| 5082 |
|
| 5083 |
+
/**
|
| 5084 |
+
* Internal dependencies
|
| 5085 |
+
*/
|
| 5086 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5087 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5088 |
|
| 5089 |
+
function getComputedStyle(node) {
|
| 5090 |
+
return node.ownerDocument.defaultView.getComputedStyle(node);
|
| 5091 |
+
}
|
| 5092 |
+
/**
|
| 5093 |
+
* Returns true if the given selection object is in the forward direction, or
|
| 5094 |
+
* false otherwise.
|
| 5095 |
+
*
|
| 5096 |
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/Node/compareDocumentPosition
|
| 5097 |
+
*
|
| 5098 |
+
* @param {Selection} selection Selection object to check.
|
| 5099 |
+
*
|
| 5100 |
+
* @return {boolean} Whether the selection is forward.
|
| 5101 |
+
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5102 |
|
|
|
|
|
|
|
| 5103 |
|
| 5104 |
+
function isSelectionForward(selection) {
|
| 5105 |
+
var anchorNode = selection.anchorNode,
|
| 5106 |
+
focusNode = selection.focusNode,
|
| 5107 |
+
anchorOffset = selection.anchorOffset,
|
| 5108 |
+
focusOffset = selection.focusOffset;
|
| 5109 |
+
var position = anchorNode.compareDocumentPosition(focusNode); // Disable reason: `Node#compareDocumentPosition` returns a bitmask value,
|
| 5110 |
+
// so bitwise operators are intended.
|
| 5111 |
|
| 5112 |
+
/* eslint-disable no-bitwise */
|
| 5113 |
+
// Compare whether anchor node precedes focus node. If focus node (where
|
| 5114 |
+
// end of selection occurs) is after the anchor node, it is forward.
|
| 5115 |
|
| 5116 |
+
if (position & anchorNode.DOCUMENT_POSITION_PRECEDING) {
|
| 5117 |
+
return false;
|
| 5118 |
+
}
|
|
|
|
|
|
|
| 5119 |
|
| 5120 |
+
if (position & anchorNode.DOCUMENT_POSITION_FOLLOWING) {
|
| 5121 |
+
return true;
|
| 5122 |
+
}
|
| 5123 |
+
/* eslint-enable no-bitwise */
|
| 5124 |
+
// `compareDocumentPosition` returns 0 when passed the same node, in which
|
| 5125 |
+
// case compare offsets.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5126 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5127 |
|
| 5128 |
+
if (position === 0) {
|
| 5129 |
+
return anchorOffset <= focusOffset;
|
| 5130 |
+
} // This should never be reached, but return true as default case.
|
|
|
|
|
|
|
|
|
|
| 5131 |
|
| 5132 |
|
| 5133 |
+
return true;
|
| 5134 |
+
}
|
| 5135 |
/**
|
| 5136 |
+
* Check whether the selection is at the edge of the container. Checks for
|
| 5137 |
+
* horizontal position by default. Set `onlyVertical` to true to check only
|
| 5138 |
+
* vertically.
|
| 5139 |
+
*
|
| 5140 |
+
* @param {Element} container Focusable element.
|
| 5141 |
+
* @param {boolean} isReverse Set to true to check left, false to check right.
|
| 5142 |
+
* @param {boolean} onlyVertical Set to true to check only vertical position.
|
| 5143 |
+
*
|
| 5144 |
+
* @return {boolean} True if at the edge, false if not.
|
| 5145 |
*/
|
| 5146 |
|
| 5147 |
|
| 5148 |
+
function isEdge(container, isReverse, onlyVertical) {
|
| 5149 |
+
if (Object(lodash__WEBPACK_IMPORTED_MODULE_0__["includes"])(['INPUT', 'TEXTAREA'], container.tagName)) {
|
| 5150 |
+
if (container.selectionStart !== container.selectionEnd) {
|
| 5151 |
+
return false;
|
| 5152 |
+
}
|
| 5153 |
|
| 5154 |
+
if (isReverse) {
|
| 5155 |
+
return container.selectionStart === 0;
|
| 5156 |
+
}
|
|
|
|
| 5157 |
|
| 5158 |
+
return container.value.length === container.selectionStart;
|
| 5159 |
+
}
|
| 5160 |
|
| 5161 |
+
if (!container.isContentEditable) {
|
| 5162 |
+
return true;
|
| 5163 |
+
}
|
| 5164 |
|
| 5165 |
+
var ownerDocument = container.ownerDocument;
|
| 5166 |
+
var defaultView = ownerDocument.defaultView;
|
| 5167 |
+
var selection = defaultView.getSelection();
|
| 5168 |
|
| 5169 |
+
if (!selection.rangeCount) {
|
| 5170 |
+
return false;
|
| 5171 |
+
}
|
| 5172 |
|
| 5173 |
+
var originalRange = selection.getRangeAt(0);
|
| 5174 |
+
var range = originalRange.cloneRange();
|
| 5175 |
+
var isForward = isSelectionForward(selection);
|
| 5176 |
+
var isCollapsed = selection.isCollapsed; // Collapse in direction of selection.
|
| 5177 |
|
| 5178 |
+
if (!isCollapsed) {
|
| 5179 |
+
range.collapse(!isForward);
|
| 5180 |
+
}
|
| 5181 |
|
| 5182 |
+
var rangeRect = getRectangleFromRange(range);
|
| 5183 |
|
| 5184 |
+
if (!rangeRect) {
|
| 5185 |
+
return false;
|
| 5186 |
+
}
|
| 5187 |
|
| 5188 |
+
var computedStyle = getComputedStyle(container);
|
| 5189 |
+
var lineHeight = parseInt(computedStyle.lineHeight, 10) || 0; // Only consider the multiline selection at the edge if the direction is
|
| 5190 |
+
// towards the edge.
|
| 5191 |
|
| 5192 |
+
if (!isCollapsed && rangeRect.height > lineHeight && isForward === isReverse) {
|
| 5193 |
+
return false;
|
| 5194 |
+
}
|
| 5195 |
|
| 5196 |
+
var padding = parseInt(computedStyle["padding".concat(isReverse ? 'Top' : 'Bottom')], 10) || 0; // Calculate a buffer that is half the line height. In some browsers, the
|
| 5197 |
+
// selection rectangle may not fill the entire height of the line, so we add
|
| 5198 |
+
// 3/4 the line height to the selection rectangle to ensure that it is well
|
| 5199 |
+
// over its line boundary.
|
| 5200 |
|
| 5201 |
+
var buffer = 3 * parseInt(lineHeight, 10) / 4;
|
| 5202 |
+
var containerRect = container.getBoundingClientRect();
|
| 5203 |
+
var originalRangeRect = getRectangleFromRange(originalRange);
|
| 5204 |
+
var verticalEdge = isReverse ? containerRect.top + padding > originalRangeRect.top - buffer : containerRect.bottom - padding < originalRangeRect.bottom + buffer;
|
| 5205 |
|
| 5206 |
+
if (!verticalEdge) {
|
| 5207 |
+
return false;
|
| 5208 |
+
}
|
| 5209 |
|
| 5210 |
+
if (onlyVertical) {
|
| 5211 |
+
return true;
|
| 5212 |
+
} // In the case of RTL scripts, the horizontal edge is at the opposite side.
|
| 5213 |
|
| 5214 |
|
| 5215 |
+
var direction = computedStyle.direction;
|
| 5216 |
+
var isReverseDir = direction === 'rtl' ? !isReverse : isReverse; // To calculate the horizontal position, we insert a test range and see if
|
| 5217 |
+
// this test range has the same horizontal position. This method proves to
|
| 5218 |
+
// be better than a DOM-based calculation, because it ignores empty text
|
| 5219 |
+
// nodes and a trailing line break element. In other words, we need to check
|
| 5220 |
+
// visual positioning, not DOM positioning.
|
| 5221 |
|
| 5222 |
+
var x = isReverseDir ? containerRect.left + 1 : containerRect.right - 1;
|
| 5223 |
+
var y = isReverse ? containerRect.top + buffer : containerRect.bottom - buffer;
|
| 5224 |
+
var testRange = hiddenCaretRangeFromPoint(ownerDocument, x, y, container);
|
| 5225 |
|
| 5226 |
+
if (!testRange) {
|
| 5227 |
+
return false;
|
| 5228 |
+
}
|
| 5229 |
|
| 5230 |
+
var side = isReverseDir ? 'left' : 'right';
|
| 5231 |
+
var testRect = getRectangleFromRange(testRange); // Allow the position to be 1px off.
|
| 5232 |
|
| 5233 |
+
return Math.abs(testRect[side] - rangeRect[side]) <= 1;
|
| 5234 |
+
}
|
| 5235 |
+
/**
|
| 5236 |
+
* Check whether the selection is horizontally at the edge of the container.
|
| 5237 |
+
*
|
| 5238 |
+
* @param {Element} container Focusable element.
|
| 5239 |
+
* @param {boolean} isReverse Set to true to check left, false for right.
|
| 5240 |
+
*
|
| 5241 |
+
* @return {boolean} True if at the horizontal edge, false if not.
|
| 5242 |
+
*/
|
| 5243 |
|
| 5244 |
|
| 5245 |
+
function isHorizontalEdge(container, isReverse) {
|
| 5246 |
+
return isEdge(container, isReverse);
|
| 5247 |
+
}
|
| 5248 |
+
/**
|
| 5249 |
+
* Check whether the selection is vertically at the edge of the container.
|
| 5250 |
+
*
|
| 5251 |
+
* @param {Element} container Focusable element.
|
| 5252 |
+
* @param {boolean} isReverse Set to true to check top, false for bottom.
|
| 5253 |
+
*
|
| 5254 |
+
* @return {boolean} True if at the vertical edge, false if not.
|
| 5255 |
+
*/
|
| 5256 |
|
| 5257 |
+
function isVerticalEdge(container, isReverse) {
|
| 5258 |
+
return isEdge(container, isReverse, true);
|
| 5259 |
+
}
|
| 5260 |
+
/**
|
| 5261 |
+
* Get the rectangle of a given Range.
|
| 5262 |
+
*
|
| 5263 |
+
* @param {Range} range The range.
|
| 5264 |
+
*
|
| 5265 |
+
* @return {DOMRect} The rectangle.
|
| 5266 |
+
*/
|
| 5267 |
|
| 5268 |
+
function getRectangleFromRange(range) {
|
| 5269 |
+
// For uncollapsed ranges, get the rectangle that bounds the contents of the
|
| 5270 |
+
// range; this a rectangle enclosing the union of the bounding rectangles
|
| 5271 |
+
// for all the elements in the range.
|
| 5272 |
+
if (!range.collapsed) {
|
| 5273 |
+
return range.getBoundingClientRect();
|
| 5274 |
+
}
|
| 5275 |
|
| 5276 |
+
var _range = range,
|
| 5277 |
+
startContainer = _range.startContainer;
|
| 5278 |
+
var ownerDocument = startContainer.ownerDocument; // Correct invalid "BR" ranges. The cannot contain any children.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5279 |
|
| 5280 |
+
if (startContainer.nodeName === 'BR') {
|
| 5281 |
+
var parentNode = startContainer.parentNode;
|
| 5282 |
+
var index = Array.from(parentNode.childNodes).indexOf(startContainer);
|
| 5283 |
+
range = ownerDocument.createRange();
|
| 5284 |
+
range.setStart(parentNode, index);
|
| 5285 |
+
range.setEnd(parentNode, index);
|
| 5286 |
+
}
|
| 5287 |
|
| 5288 |
+
var rect = range.getClientRects()[0]; // If the collapsed range starts (and therefore ends) at an element node,
|
| 5289 |
+
// `getClientRects` can be empty in some browsers. This can be resolved
|
| 5290 |
+
// by adding a temporary text node with zero-width space to the range.
|
| 5291 |
+
//
|
| 5292 |
+
// See: https://stackoverflow.com/a/6847328/995445
|
| 5293 |
|
| 5294 |
+
if (!rect) {
|
| 5295 |
+
var padNode = ownerDocument.createTextNode("\u200B"); // Do not modify the live range.
|
|
|
|
|
|
|
| 5296 |
|
| 5297 |
+
range = range.cloneRange();
|
| 5298 |
+
range.insertNode(padNode);
|
| 5299 |
+
rect = range.getClientRects()[0];
|
| 5300 |
+
padNode.parentNode.removeChild(padNode);
|
| 5301 |
+
}
|
| 5302 |
|
| 5303 |
+
return rect;
|
| 5304 |
+
}
|
| 5305 |
+
/**
|
| 5306 |
+
* Get the rectangle for the selection in a container.
|
| 5307 |
+
*
|
| 5308 |
+
* @param {Window} win The window of the selection.
|
| 5309 |
+
*
|
| 5310 |
+
* @return {?DOMRect} The rectangle.
|
| 5311 |
+
*/
|
| 5312 |
|
| 5313 |
+
function computeCaretRect(win) {
|
| 5314 |
+
var selection = win.getSelection();
|
| 5315 |
+
var range = selection.rangeCount ? selection.getRangeAt(0) : null;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5316 |
|
| 5317 |
+
if (!range) {
|
| 5318 |
+
return;
|
| 5319 |
+
}
|
|
|
|
|
|
|
| 5320 |
|
| 5321 |
+
return getRectangleFromRange(range);
|
| 5322 |
+
}
|
| 5323 |
+
/**
|
| 5324 |
+
* Places the caret at start or end of a given element.
|
| 5325 |
+
*
|
| 5326 |
+
* @param {Element} container Focusable element.
|
| 5327 |
+
* @param {boolean} isReverse True for end, false for start.
|
| 5328 |
+
*/
|
| 5329 |
|
| 5330 |
+
function placeCaretAtHorizontalEdge(container, isReverse) {
|
| 5331 |
+
if (!container) {
|
| 5332 |
+
return;
|
| 5333 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5334 |
|
| 5335 |
+
if (Object(lodash__WEBPACK_IMPORTED_MODULE_0__["includes"])(['INPUT', 'TEXTAREA'], container.tagName)) {
|
| 5336 |
+
container.focus();
|
| 5337 |
|
| 5338 |
+
if (isReverse) {
|
| 5339 |
+
container.selectionStart = container.value.length;
|
| 5340 |
+
container.selectionEnd = container.value.length;
|
| 5341 |
+
} else {
|
| 5342 |
+
container.selectionStart = 0;
|
| 5343 |
+
container.selectionEnd = 0;
|
| 5344 |
+
}
|
| 5345 |
|
| 5346 |
+
return;
|
| 5347 |
+
}
|
| 5348 |
|
| 5349 |
+
container.focus();
|
| 5350 |
|
| 5351 |
+
if (!container.isContentEditable) {
|
| 5352 |
+
return;
|
| 5353 |
+
} // Select on extent child of the container, not the container itself. This
|
| 5354 |
+
// avoids the selection always being `endOffset` of 1 when placed at end,
|
| 5355 |
+
// where `startContainer`, `endContainer` would always be container itself.
|
| 5356 |
|
| 5357 |
|
| 5358 |
+
var rangeTarget = container[isReverse ? 'lastChild' : 'firstChild']; // If no range target, it implies that the container is empty. Focusing is
|
| 5359 |
+
// sufficient for caret to be placed correctly.
|
| 5360 |
|
| 5361 |
+
if (!rangeTarget) {
|
| 5362 |
+
return;
|
| 5363 |
+
}
|
| 5364 |
|
| 5365 |
+
var ownerDocument = container.ownerDocument;
|
| 5366 |
+
var defaultView = ownerDocument.defaultView;
|
| 5367 |
+
var selection = defaultView.getSelection();
|
| 5368 |
+
var range = ownerDocument.createRange();
|
| 5369 |
+
range.selectNodeContents(rangeTarget);
|
| 5370 |
+
range.collapse(!isReverse);
|
| 5371 |
+
selection.removeAllRanges();
|
| 5372 |
+
selection.addRange(range);
|
| 5373 |
+
}
|
| 5374 |
/**
|
| 5375 |
+
* Polyfill.
|
| 5376 |
+
* Get a collapsed range for a given point.
|
| 5377 |
+
*
|
| 5378 |
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/Document/caretRangeFromPoint
|
| 5379 |
+
*
|
| 5380 |
+
* @param {Document} doc The document of the range.
|
| 5381 |
+
* @param {number} x Horizontal position within the current viewport.
|
| 5382 |
+
* @param {number} y Vertical position within the current viewport.
|
| 5383 |
+
*
|
| 5384 |
+
* @return {?Range} The best range for the given point.
|
| 5385 |
*/
|
| 5386 |
|
| 5387 |
+
function caretRangeFromPoint(doc, x, y) {
|
| 5388 |
+
if (doc.caretRangeFromPoint) {
|
| 5389 |
+
return doc.caretRangeFromPoint(x, y);
|
| 5390 |
+
}
|
| 5391 |
|
| 5392 |
+
if (!doc.caretPositionFromPoint) {
|
| 5393 |
+
return null;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5394 |
}
|
| 5395 |
|
| 5396 |
+
var point = doc.caretPositionFromPoint(x, y); // If x or y are negative, outside viewport, or there is no text entry node.
|
| 5397 |
+
// https://developer.mozilla.org/en-US/docs/Web/API/Document/caretRangeFromPoint
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5398 |
|
| 5399 |
+
if (!point) {
|
| 5400 |
+
return null;
|
| 5401 |
+
}
|
| 5402 |
|
| 5403 |
+
var range = doc.createRange();
|
| 5404 |
+
range.setStart(point.offsetNode, point.offset);
|
| 5405 |
+
range.collapse(true);
|
| 5406 |
+
return range;
|
| 5407 |
+
}
|
| 5408 |
+
/**
|
| 5409 |
+
* Get a collapsed range for a given point.
|
| 5410 |
+
* Gives the container a temporary high z-index (above any UI).
|
| 5411 |
+
* This is preferred over getting the UI nodes and set styles there.
|
| 5412 |
+
*
|
| 5413 |
+
* @param {Document} doc The document of the range.
|
| 5414 |
+
* @param {number} x Horizontal position within the current viewport.
|
| 5415 |
+
* @param {number} y Vertical position within the current viewport.
|
| 5416 |
+
* @param {Element} container Container in which the range is expected to be found.
|
| 5417 |
+
*
|
| 5418 |
+
* @return {?Range} The best range for the given point.
|
| 5419 |
+
*/
|
| 5420 |
|
|
|
|
|
|
|
|
|
|
| 5421 |
|
| 5422 |
+
function hiddenCaretRangeFromPoint(doc, x, y, container) {
|
| 5423 |
+
var originalZIndex = container.style.zIndex;
|
| 5424 |
+
var originalPosition = container.style.position; // A z-index only works if the element position is not static.
|
| 5425 |
|
| 5426 |
+
container.style.zIndex = '10000';
|
| 5427 |
+
container.style.position = 'relative';
|
| 5428 |
+
var range = caretRangeFromPoint(doc, x, y);
|
| 5429 |
+
container.style.zIndex = originalZIndex;
|
| 5430 |
+
container.style.position = originalPosition;
|
| 5431 |
+
return range;
|
| 5432 |
+
}
|
| 5433 |
+
/**
|
| 5434 |
+
* Places the caret at the top or bottom of a given element.
|
| 5435 |
+
*
|
| 5436 |
+
* @param {Element} container Focusable element.
|
| 5437 |
+
* @param {boolean} isReverse True for bottom, false for top.
|
| 5438 |
+
* @param {DOMRect} [rect] The rectangle to position the caret with.
|
| 5439 |
+
* @param {boolean} [mayUseScroll=true] True to allow scrolling, false to disallow.
|
| 5440 |
+
*/
|
| 5441 |
|
|
|
|
| 5442 |
|
| 5443 |
+
function placeCaretAtVerticalEdge(container, isReverse, rect) {
|
| 5444 |
+
var mayUseScroll = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
|
| 5445 |
|
| 5446 |
+
if (!container) {
|
| 5447 |
+
return;
|
| 5448 |
+
}
|
| 5449 |
|
| 5450 |
+
if (!rect || !container.isContentEditable) {
|
| 5451 |
+
placeCaretAtHorizontalEdge(container, isReverse);
|
| 5452 |
+
return;
|
| 5453 |
+
} // Offset by a buffer half the height of the caret rect. This is needed
|
| 5454 |
+
// because caretRangeFromPoint may default to the end of the selection if
|
| 5455 |
+
// offset is too close to the edge. It's unclear how to precisely calculate
|
| 5456 |
+
// this threshold; it may be the padded area of some combination of line
|
| 5457 |
+
// height, caret height, and font size. The buffer offset is effectively
|
| 5458 |
+
// equivalent to a point at half the height of a line of text.
|
| 5459 |
+
|
| 5460 |
+
|
| 5461 |
+
var buffer = rect.height / 2;
|
| 5462 |
+
var editableRect = container.getBoundingClientRect();
|
| 5463 |
+
var x = rect.left;
|
| 5464 |
+
var y = isReverse ? editableRect.bottom - buffer : editableRect.top + buffer;
|
| 5465 |
+
var ownerDocument = container.ownerDocument;
|
| 5466 |
+
var defaultView = ownerDocument.defaultView;
|
| 5467 |
+
var range = hiddenCaretRangeFromPoint(ownerDocument, x, y, container);
|
| 5468 |
+
|
| 5469 |
+
if (!range || !container.contains(range.startContainer)) {
|
| 5470 |
+
if (mayUseScroll && (!range || !range.startContainer || !range.startContainer.contains(container))) {
|
| 5471 |
+
// Might be out of view.
|
| 5472 |
+
// Easier than attempting to calculate manually.
|
| 5473 |
+
container.scrollIntoView(isReverse);
|
| 5474 |
+
placeCaretAtVerticalEdge(container, isReverse, rect, false);
|
| 5475 |
+
return;
|
| 5476 |
+
}
|
| 5477 |
|
| 5478 |
+
placeCaretAtHorizontalEdge(container, isReverse);
|
| 5479 |
+
return;
|
| 5480 |
+
}
|
| 5481 |
|
| 5482 |
+
var selection = defaultView.getSelection();
|
| 5483 |
+
selection.removeAllRanges();
|
| 5484 |
+
selection.addRange(range);
|
| 5485 |
+
container.focus(); // Editable was already focussed, it goes back to old range...
|
| 5486 |
+
// This fixes it.
|
| 5487 |
|
| 5488 |
+
selection.removeAllRanges();
|
| 5489 |
+
selection.addRange(range);
|
| 5490 |
+
}
|
| 5491 |
/**
|
| 5492 |
+
* Check whether the given element is a text field, where text field is defined
|
| 5493 |
+
* by the ability to select within the input, or that it is contenteditable.
|
| 5494 |
+
*
|
| 5495 |
+
* See: https://html.spec.whatwg.org/#textFieldSelection
|
| 5496 |
+
*
|
| 5497 |
+
* @param {HTMLElement} element The HTML element.
|
| 5498 |
+
*
|
| 5499 |
+
* @return {boolean} True if the element is an text field, false if not.
|
| 5500 |
*/
|
| 5501 |
|
| 5502 |
+
function isTextField(element) {
|
| 5503 |
+
var nodeName = element.nodeName,
|
| 5504 |
+
contentEditable = element.contentEditable;
|
| 5505 |
+
var nonTextInputs = ['button', 'checkbox', 'hidden', 'file', 'radio', 'image', 'range', 'reset', 'submit', 'number'];
|
| 5506 |
+
return nodeName === 'INPUT' && !nonTextInputs.includes(element.type) || nodeName === 'TEXTAREA' || contentEditable === 'true';
|
| 5507 |
+
}
|
| 5508 |
/**
|
| 5509 |
+
* Check whether the given element is an input field of type number
|
| 5510 |
+
* and has a valueAsNumber
|
| 5511 |
+
*
|
| 5512 |
+
* @param {HTMLElement} element The HTML element.
|
| 5513 |
+
*
|
| 5514 |
+
* @return {boolean} True if the element is input and holds a number.
|
| 5515 |
*/
|
| 5516 |
|
| 5517 |
+
function isNumberInput(element) {
|
| 5518 |
+
var nodeName = element.nodeName,
|
| 5519 |
+
type = element.type,
|
| 5520 |
+
valueAsNumber = element.valueAsNumber;
|
| 5521 |
+
return nodeName === 'INPUT' && type === 'number' && !!valueAsNumber;
|
| 5522 |
+
}
|
| 5523 |
+
/**
|
| 5524 |
+
* Check whether the current document has selected text. This applies to ranges
|
| 5525 |
+
* of text in the document, and not selection inside <input> and <textarea>
|
| 5526 |
+
* elements.
|
| 5527 |
+
*
|
| 5528 |
+
* See: https://developer.mozilla.org/en-US/docs/Web/API/Window/getSelection#Related_objects.
|
| 5529 |
+
*
|
| 5530 |
+
* @param {Document} doc The document to check.
|
| 5531 |
+
*
|
| 5532 |
+
* @return {boolean} True if there is selection, false if not.
|
| 5533 |
+
*/
|
| 5534 |
|
| 5535 |
+
function documentHasTextSelection(doc) {
|
| 5536 |
+
var selection = doc.defaultView.getSelection();
|
| 5537 |
+
var range = selection.rangeCount ? selection.getRangeAt(0) : null;
|
| 5538 |
+
return range && !range.collapsed;
|
| 5539 |
+
}
|
| 5540 |
/**
|
| 5541 |
+
* Check whether the given element, assumed an input field or textarea,
|
| 5542 |
+
* contains a (uncollapsed) selection of text.
|
| 5543 |
*
|
| 5544 |
+
* Note: this is perhaps an abuse of the term "selection", since these elements
|
| 5545 |
+
* manage selection differently and aren't covered by Selection#collapsed.
|
| 5546 |
+
*
|
| 5547 |
+
* See: https://developer.mozilla.org/en-US/docs/Web/API/Window/getSelection#Related_objects.
|
| 5548 |
+
*
|
| 5549 |
+
* @param {HTMLElement} element The HTML element.
|
| 5550 |
+
*
|
| 5551 |
+
* @return {boolean} Whether the input/textareaa element has some "selection".
|
| 5552 |
*/
|
| 5553 |
|
| 5554 |
+
function inputFieldHasUncollapsedSelection(element) {
|
| 5555 |
+
if (!isTextField(element) && !isNumberInput(element)) {
|
| 5556 |
+
return false;
|
| 5557 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5558 |
|
| 5559 |
+
try {
|
| 5560 |
+
var selectionStart = element.selectionStart,
|
| 5561 |
+
selectionEnd = element.selectionEnd;
|
| 5562 |
+
return selectionStart !== null && selectionStart !== selectionEnd;
|
| 5563 |
+
} catch (error) {
|
| 5564 |
+
// Safari throws an exception when trying to get `selectionStart`
|
| 5565 |
+
// on non-text <input> elements (which, understandably, don't
|
| 5566 |
+
// have the text selection API). We catch this via a try/catch
|
| 5567 |
+
// block, as opposed to a more explicit check of the element's
|
| 5568 |
+
// input types, because of Safari's non-standard behavior. This
|
| 5569 |
+
// also means we don't have to worry about the list of input
|
| 5570 |
+
// types that support `selectionStart` changing as the HTML spec
|
| 5571 |
+
// evolves over time.
|
| 5572 |
+
return false;
|
| 5573 |
+
}
|
| 5574 |
+
}
|
| 5575 |
+
/**
|
| 5576 |
+
* Check whether the current document has any sort of selection. This includes
|
| 5577 |
+
* ranges of text across elements and any selection inside <input> and
|
| 5578 |
+
* <textarea> elements.
|
| 5579 |
+
*
|
| 5580 |
+
* @param {Document} doc The document to check.
|
| 5581 |
+
*
|
| 5582 |
+
* @return {boolean} Whether there is any sort of "selection" in the document.
|
| 5583 |
+
*/
|
| 5584 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5585 |
|
| 5586 |
+
function documentHasUncollapsedSelection(doc) {
|
| 5587 |
+
return documentHasTextSelection(doc) || inputFieldHasUncollapsedSelection(doc.activeElement);
|
| 5588 |
+
}
|
| 5589 |
+
/**
|
| 5590 |
+
* Check whether the current document has a selection. This checks for both
|
| 5591 |
+
* focus in an input field and general text selection.
|
| 5592 |
+
*
|
| 5593 |
+
* @param {Document} doc The document to check.
|
| 5594 |
+
*
|
| 5595 |
+
* @return {boolean} True if there is selection, false if not.
|
| 5596 |
+
*/
|
| 5597 |
|
| 5598 |
+
function documentHasSelection(doc) {
|
| 5599 |
+
return isTextField(doc.activeElement) || isNumberInput(doc.activeElement) || documentHasTextSelection(doc);
|
| 5600 |
+
}
|
| 5601 |
+
/**
|
| 5602 |
+
* Check whether the contents of the element have been entirely selected.
|
| 5603 |
+
* Returns true if there is no possibility of selection.
|
| 5604 |
+
*
|
| 5605 |
+
* @param {Element} element The element to check.
|
| 5606 |
+
*
|
| 5607 |
+
* @return {boolean} True if entirely selected, false if not.
|
| 5608 |
+
*/
|
| 5609 |
|
| 5610 |
+
function isEntirelySelected(element) {
|
| 5611 |
+
if (Object(lodash__WEBPACK_IMPORTED_MODULE_0__["includes"])(['INPUT', 'TEXTAREA'], element.nodeName)) {
|
| 5612 |
+
return element.selectionStart === 0 && element.value.length === element.selectionEnd;
|
| 5613 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5614 |
|
| 5615 |
+
if (!element.isContentEditable) {
|
| 5616 |
+
return true;
|
| 5617 |
+
}
|
|
|
|
|
|
|
| 5618 |
|
| 5619 |
+
var ownerDocument = element.ownerDocument;
|
| 5620 |
+
var defaultView = ownerDocument.defaultView;
|
| 5621 |
+
var selection = defaultView.getSelection();
|
| 5622 |
+
var range = selection.rangeCount ? selection.getRangeAt(0) : null;
|
|
|
|
|
|
|
|
|
|
| 5623 |
|
| 5624 |
+
if (!range) {
|
| 5625 |
+
return true;
|
| 5626 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5627 |
|
| 5628 |
+
var startContainer = range.startContainer,
|
| 5629 |
+
endContainer = range.endContainer,
|
| 5630 |
+
startOffset = range.startOffset,
|
| 5631 |
+
endOffset = range.endOffset;
|
| 5632 |
|
| 5633 |
+
if (startContainer === element && endContainer === element && startOffset === 0 && endOffset === element.childNodes.length) {
|
| 5634 |
+
return true;
|
| 5635 |
+
}
|
| 5636 |
|
| 5637 |
+
var lastChild = element.lastChild;
|
| 5638 |
+
var lastChildContentLength = lastChild.nodeType === lastChild.TEXT_NODE ? lastChild.data.length : lastChild.childNodes.length;
|
| 5639 |
+
return startContainer === element.firstChild && endContainer === element.lastChild && startOffset === 0 && endOffset === lastChildContentLength;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5640 |
}
|
| 5641 |
+
/**
|
| 5642 |
+
* Given a DOM node, finds the closest scrollable container node.
|
| 5643 |
+
*
|
| 5644 |
+
* @param {Element} node Node from which to start.
|
| 5645 |
+
*
|
| 5646 |
+
* @return {?Element} Scrollable container node, if found.
|
| 5647 |
+
*/
|
| 5648 |
|
| 5649 |
+
function getScrollContainer(node) {
|
| 5650 |
+
if (!node) {
|
| 5651 |
+
return;
|
| 5652 |
+
} // Scrollable if scrollable height exceeds displayed...
|
| 5653 |
|
| 5654 |
+
|
| 5655 |
+
if (node.scrollHeight > node.clientHeight) {
|
| 5656 |
+
// ...except when overflow is defined to be hidden or visible
|
| 5657 |
+
var _getComputedStyle = getComputedStyle(node),
|
| 5658 |
+
overflowY = _getComputedStyle.overflowY;
|
| 5659 |
+
|
| 5660 |
+
if (/(auto|scroll)/.test(overflowY)) {
|
| 5661 |
+
return node;
|
| 5662 |
+
}
|
| 5663 |
+
} // Continue traversing
|
| 5664 |
|
| 5665 |
|
| 5666 |
+
return getScrollContainer(node.parentNode);
|
| 5667 |
+
}
|
| 5668 |
/**
|
| 5669 |
+
* Returns the closest positioned element, or null under any of the conditions
|
| 5670 |
+
* of the offsetParent specification. Unlike offsetParent, this function is not
|
| 5671 |
+
* limited to HTMLElement and accepts any Node (e.g. Node.TEXT_NODE).
|
| 5672 |
+
*
|
| 5673 |
+
* @see https://drafts.csswg.org/cssom-view/#dom-htmlelement-offsetparent
|
| 5674 |
+
*
|
| 5675 |
+
* @param {Node} node Node from which to find offset parent.
|
| 5676 |
+
*
|
| 5677 |
+
* @return {?Node} Offset parent.
|
| 5678 |
*/
|
| 5679 |
|
| 5680 |
+
function getOffsetParent(node) {
|
| 5681 |
+
// Cannot retrieve computed style or offset parent only anything other than
|
| 5682 |
+
// an element node, so find the closest element node.
|
| 5683 |
+
var closestElement;
|
| 5684 |
+
|
| 5685 |
+
while (closestElement = node.parentNode) {
|
| 5686 |
+
if (closestElement.nodeType === closestElement.ELEMENT_NODE) {
|
| 5687 |
+
break;
|
| 5688 |
+
}
|
| 5689 |
+
}
|
| 5690 |
+
|
| 5691 |
+
if (!closestElement) {
|
| 5692 |
+
return null;
|
| 5693 |
+
} // If the closest element is already positioned, return it, as offsetParent
|
| 5694 |
+
// does not otherwise consider the node itself.
|
| 5695 |
+
|
| 5696 |
+
|
| 5697 |
+
if (getComputedStyle(closestElement).position !== 'static') {
|
| 5698 |
+
return closestElement;
|
| 5699 |
+
}
|
| 5700 |
|
| 5701 |
+
return closestElement.offsetParent;
|
| 5702 |
+
}
|
| 5703 |
+
/**
|
| 5704 |
+
* Given two DOM nodes, replaces the former with the latter in the DOM.
|
| 5705 |
+
*
|
| 5706 |
+
* @param {Element} processedNode Node to be removed.
|
| 5707 |
+
* @param {Element} newNode Node to be inserted in its place.
|
| 5708 |
+
* @return {void}
|
| 5709 |
+
*/
|
| 5710 |
|
| 5711 |
+
function replace(processedNode, newNode) {
|
| 5712 |
+
insertAfter(newNode, processedNode.parentNode);
|
| 5713 |
+
remove(processedNode);
|
| 5714 |
+
}
|
| 5715 |
/**
|
| 5716 |
+
* Given a DOM node, removes it from the DOM.
|
| 5717 |
+
*
|
| 5718 |
+
* @param {Element} node Node to be removed.
|
| 5719 |
+
* @return {void}
|
| 5720 |
*/
|
| 5721 |
|
| 5722 |
+
function remove(node) {
|
| 5723 |
+
node.parentNode.removeChild(node);
|
| 5724 |
+
}
|
| 5725 |
+
/**
|
| 5726 |
+
* Given two DOM nodes, inserts the former in the DOM as the next sibling of
|
| 5727 |
+
* the latter.
|
| 5728 |
+
*
|
| 5729 |
+
* @param {Element} newNode Node to be inserted.
|
| 5730 |
+
* @param {Element} referenceNode Node after which to perform the insertion.
|
| 5731 |
+
* @return {void}
|
| 5732 |
+
*/
|
| 5733 |
|
| 5734 |
+
function insertAfter(newNode, referenceNode) {
|
| 5735 |
+
referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling);
|
| 5736 |
+
}
|
| 5737 |
+
/**
|
| 5738 |
+
* Unwrap the given node. This means any child nodes are moved to the parent.
|
| 5739 |
+
*
|
| 5740 |
+
* @param {Node} node The node to unwrap.
|
| 5741 |
+
*
|
| 5742 |
+
* @return {void}
|
| 5743 |
+
*/
|
| 5744 |
|
| 5745 |
+
function unwrap(node) {
|
| 5746 |
+
var parent = node.parentNode;
|
| 5747 |
|
| 5748 |
+
while (node.firstChild) {
|
| 5749 |
+
parent.insertBefore(node.firstChild, node);
|
| 5750 |
+
}
|
| 5751 |
|
| 5752 |
+
parent.removeChild(node);
|
| 5753 |
+
}
|
| 5754 |
+
/**
|
| 5755 |
+
* Replaces the given node with a new node with the given tag name.
|
| 5756 |
+
*
|
| 5757 |
+
* @param {Element} node The node to replace
|
| 5758 |
+
* @param {string} tagName The new tag name.
|
| 5759 |
+
*
|
| 5760 |
+
* @return {Element} The new node.
|
| 5761 |
+
*/
|
| 5762 |
|
| 5763 |
+
function replaceTag(node, tagName) {
|
| 5764 |
+
var newNode = node.ownerDocument.createElement(tagName);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5765 |
|
| 5766 |
+
while (node.firstChild) {
|
| 5767 |
+
newNode.appendChild(node.firstChild);
|
| 5768 |
+
}
|
|
|
|
|
|
|
|
|
|
| 5769 |
|
| 5770 |
+
node.parentNode.replaceChild(newNode, node);
|
| 5771 |
+
return newNode;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5772 |
}
|
| 5773 |
+
/**
|
| 5774 |
+
* Wraps the given node with a new node with the given tag name.
|
| 5775 |
+
*
|
| 5776 |
+
* @param {Element} newNode The node to insert.
|
| 5777 |
+
* @param {Element} referenceNode The node to wrap.
|
| 5778 |
+
*/
|
| 5779 |
|
| 5780 |
+
function wrap(newNode, referenceNode) {
|
| 5781 |
+
referenceNode.parentNode.insertBefore(newNode, referenceNode);
|
| 5782 |
+
newNode.appendChild(referenceNode);
|
| 5783 |
+
}
|
| 5784 |
+
/**
|
| 5785 |
+
* Removes any HTML tags from the provided string.
|
| 5786 |
+
*
|
| 5787 |
+
* @param {string} html The string containing html.
|
| 5788 |
+
*
|
| 5789 |
+
* @return {string} The text content with any html removed.
|
| 5790 |
+
*/
|
| 5791 |
|
| 5792 |
+
function __unstableStripHTML(html) {
|
| 5793 |
+
var document = new window.DOMParser().parseFromString(html, 'text/html');
|
| 5794 |
+
return document.body.textContent || '';
|
| 5795 |
+
}
|
| 5796 |
+
/**
|
| 5797 |
+
* Given a schema, unwraps or removes nodes, attributes and classes on a node
|
| 5798 |
+
* list.
|
| 5799 |
+
*
|
| 5800 |
+
* @param {NodeList} nodeList The nodeList to filter.
|
| 5801 |
+
* @param {Document} doc The document of the nodeList.
|
| 5802 |
+
* @param {Object} schema An array of functions that can mutate with the provided node.
|
| 5803 |
+
* @param {Object} inline Whether to clean for inline mode.
|
| 5804 |
+
*/
|
| 5805 |
|
| 5806 |
+
function cleanNodeList(nodeList, doc, schema, inline) {
|
| 5807 |
+
Array.from(nodeList).forEach(function (node) {
|
| 5808 |
+
var tag = node.nodeName.toLowerCase(); // It's a valid child, if the tag exists in the schema without an isMatch
|
| 5809 |
+
// function, or with an isMatch function that matches the node.
|
| 5810 |
+
|
| 5811 |
+
if (schema.hasOwnProperty(tag) && (!schema[tag].isMatch || schema[tag].isMatch(node))) {
|
| 5812 |
+
if (node.nodeType === node.ELEMENT_NODE) {
|
| 5813 |
+
var _schema$tag = schema[tag],
|
| 5814 |
+
_schema$tag$attribute = _schema$tag.attributes,
|
| 5815 |
+
attributes = _schema$tag$attribute === void 0 ? [] : _schema$tag$attribute,
|
| 5816 |
+
_schema$tag$classes = _schema$tag.classes,
|
| 5817 |
+
classes = _schema$tag$classes === void 0 ? [] : _schema$tag$classes,
|
| 5818 |
+
children = _schema$tag.children,
|
| 5819 |
+
_schema$tag$require = _schema$tag.require,
|
| 5820 |
+
require = _schema$tag$require === void 0 ? [] : _schema$tag$require,
|
| 5821 |
+
allowEmpty = _schema$tag.allowEmpty; // If the node is empty and it's supposed to have children,
|
| 5822 |
+
// remove the node.
|
| 5823 |
+
|
| 5824 |
+
|
| 5825 |
+
if (children && !allowEmpty && isEmpty(node)) {
|
| 5826 |
+
remove(node);
|
| 5827 |
+
return;
|
| 5828 |
+
}
|
| 5829 |
|
| 5830 |
+
if (node.hasAttributes()) {
|
| 5831 |
+
// Strip invalid attributes.
|
| 5832 |
+
Array.from(node.attributes).forEach(function (_ref) {
|
| 5833 |
+
var name = _ref.name;
|
| 5834 |
|
| 5835 |
+
if (name !== 'class' && !Object(lodash__WEBPACK_IMPORTED_MODULE_0__["includes"])(attributes, name)) {
|
| 5836 |
+
node.removeAttribute(name);
|
| 5837 |
+
}
|
| 5838 |
+
}); // Strip invalid classes.
|
| 5839 |
+
// In jsdom-jscore, 'node.classList' can be undefined.
|
| 5840 |
+
// TODO: Explore patching this in jsdom-jscore.
|
| 5841 |
+
|
| 5842 |
+
if (node.classList && node.classList.length) {
|
| 5843 |
+
var mattchers = classes.map(function (item) {
|
| 5844 |
+
if (typeof item === 'string') {
|
| 5845 |
+
return function (className) {
|
| 5846 |
+
return className === item;
|
| 5847 |
+
};
|
| 5848 |
+
} else if (item instanceof RegExp) {
|
| 5849 |
+
return function (className) {
|
| 5850 |
+
return item.test(className);
|
| 5851 |
+
};
|
| 5852 |
+
}
|
| 5853 |
|
| 5854 |
+
return lodash__WEBPACK_IMPORTED_MODULE_0__["noop"];
|
| 5855 |
+
});
|
| 5856 |
+
Array.from(node.classList).forEach(function (name) {
|
| 5857 |
+
if (!mattchers.some(function (isMatch) {
|
| 5858 |
+
return isMatch(name);
|
| 5859 |
+
})) {
|
| 5860 |
+
node.classList.remove(name);
|
| 5861 |
+
}
|
| 5862 |
+
});
|
| 5863 |
|
| 5864 |
+
if (!node.classList.length) {
|
| 5865 |
+
node.removeAttribute('class');
|
| 5866 |
+
}
|
| 5867 |
+
}
|
| 5868 |
+
}
|
| 5869 |
+
|
| 5870 |
+
if (node.hasChildNodes()) {
|
| 5871 |
+
// Do not filter any content.
|
| 5872 |
+
if (children === '*') {
|
| 5873 |
+
return;
|
| 5874 |
+
} // Continue if the node is supposed to have children.
|
| 5875 |
+
|
| 5876 |
+
|
| 5877 |
+
if (children) {
|
| 5878 |
+
// If a parent requires certain children, but it does
|
| 5879 |
+
// not have them, drop the parent and continue.
|
| 5880 |
+
if (require.length && !node.querySelector(require.join(','))) {
|
| 5881 |
+
cleanNodeList(node.childNodes, doc, schema, inline);
|
| 5882 |
+
unwrap(node); // If the node is at the top, phrasing content, and
|
| 5883 |
+
// contains children that are block content, unwrap
|
| 5884 |
+
// the node because it is invalid.
|
| 5885 |
+
} else if (node.parentNode.nodeName === 'BODY' && Object(_phrasing_content__WEBPACK_IMPORTED_MODULE_1__[/* isPhrasingContent */ "a"])(node)) {
|
| 5886 |
+
cleanNodeList(node.childNodes, doc, schema, inline);
|
| 5887 |
+
|
| 5888 |
+
if (Array.from(node.childNodes).some(function (child) {
|
| 5889 |
+
return !Object(_phrasing_content__WEBPACK_IMPORTED_MODULE_1__[/* isPhrasingContent */ "a"])(child);
|
| 5890 |
+
})) {
|
| 5891 |
+
unwrap(node);
|
| 5892 |
+
}
|
| 5893 |
+
} else {
|
| 5894 |
+
cleanNodeList(node.childNodes, doc, children, inline);
|
| 5895 |
+
} // Remove children if the node is not supposed to have any.
|
| 5896 |
+
|
| 5897 |
+
} else {
|
| 5898 |
+
while (node.firstChild) {
|
| 5899 |
+
remove(node.firstChild);
|
| 5900 |
+
}
|
| 5901 |
+
}
|
| 5902 |
+
}
|
| 5903 |
+
} // Invalid child. Continue with schema at the same place and unwrap.
|
| 5904 |
+
|
| 5905 |
+
} else {
|
| 5906 |
+
cleanNodeList(node.childNodes, doc, schema, inline); // For inline mode, insert a line break when unwrapping nodes that
|
| 5907 |
+
// are not phrasing content.
|
| 5908 |
|
| 5909 |
+
if (inline && !Object(_phrasing_content__WEBPACK_IMPORTED_MODULE_1__[/* isPhrasingContent */ "a"])(node) && node.nextElementSibling) {
|
| 5910 |
+
insertAfter(doc.createElement('br'), node);
|
| 5911 |
+
}
|
| 5912 |
+
|
| 5913 |
+
unwrap(node);
|
| 5914 |
+
}
|
| 5915 |
+
});
|
| 5916 |
+
}
|
| 5917 |
/**
|
| 5918 |
+
* Recursively checks if an element is empty. An element is not empty if it
|
| 5919 |
+
* contains text or contains elements with attributes such as images.
|
| 5920 |
+
*
|
| 5921 |
+
* @param {Element} element The element to check.
|
| 5922 |
+
*
|
| 5923 |
+
* @return {boolean} Wether or not the element is empty.
|
| 5924 |
*/
|
| 5925 |
|
| 5926 |
|
| 5927 |
+
function isEmpty(element) {
|
| 5928 |
+
if (!element.hasChildNodes()) {
|
| 5929 |
+
return true;
|
| 5930 |
+
}
|
| 5931 |
+
|
| 5932 |
+
return Array.from(element.childNodes).every(function (node) {
|
| 5933 |
+
if (node.nodeType === node.TEXT_NODE) {
|
| 5934 |
+
return !node.nodeValue.trim();
|
| 5935 |
+
}
|
| 5936 |
|
| 5937 |
+
if (node.nodeType === node.ELEMENT_NODE) {
|
| 5938 |
+
if (node.nodeName === 'BR') {
|
| 5939 |
+
return true;
|
| 5940 |
+
} else if (node.hasAttributes()) {
|
| 5941 |
+
return false;
|
| 5942 |
+
}
|
| 5943 |
|
| 5944 |
+
return isEmpty(node);
|
| 5945 |
+
}
|
| 5946 |
|
| 5947 |
+
return true;
|
| 5948 |
+
});
|
| 5949 |
+
}
|
| 5950 |
/**
|
| 5951 |
+
* Given a schema, unwraps or removes nodes, attributes and classes on HTML.
|
| 5952 |
+
*
|
| 5953 |
+
* @param {string} HTML The HTML to clean up.
|
| 5954 |
+
* @param {Object} schema Schema for the HTML.
|
| 5955 |
+
* @param {Object} inline Whether to clean for inline mode.
|
| 5956 |
+
*
|
| 5957 |
+
* @return {string} The cleaned up HTML.
|
| 5958 |
*/
|
| 5959 |
|
| 5960 |
+
function removeInvalidHTML(HTML, schema, inline) {
|
| 5961 |
+
var doc = document.implementation.createHTMLDocument('');
|
| 5962 |
+
doc.body.innerHTML = HTML;
|
| 5963 |
+
cleanNodeList(doc.body.childNodes, doc, schema, inline);
|
| 5964 |
+
return doc.body.innerHTML;
|
| 5965 |
+
}
|
| 5966 |
+
//# sourceMappingURL=dom.js.map
|
| 5967 |
|
| 5968 |
+
/***/ }),
|
| 5969 |
|
| 5970 |
+
/***/ 159:
|
| 5971 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
| 5972 |
|
| 5973 |
+
"use strict";
|
| 5974 |
+
/* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(21);
|
| 5975 |
+
/* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(22);
|
| 5976 |
+
/* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(23);
|
| 5977 |
+
/* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(24);
|
| 5978 |
+
/* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(10);
|
| 5979 |
+
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(0);
|
| 5980 |
+
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__);
|
| 5981 |
+
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2);
|
| 5982 |
+
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_6__);
|
| 5983 |
+
/* harmony import */ var _popover__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(136);
|
| 5984 |
+
/* harmony import */ var _shortcut__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(135);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5985 |
|
| 5986 |
|
| 5987 |
|
| 5989 |
|
| 5990 |
|
| 5991 |
|
| 5992 |
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__[/* default */ "a"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__[/* default */ "a"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"])(this, result); }; }
|
| 5993 |
|
| 5994 |
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5995 |
|
| 5996 |
/**
|
| 5997 |
* External dependencies
|
| 5998 |
*/
|
| 5999 |
|
| 6000 |
+
/**
|
| 6001 |
+
* WordPress dependencies
|
| 6002 |
+
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6003 |
|
| 6004 |
|
| 6005 |
/**
|
| 6008 |
|
| 6009 |
|
| 6010 |
|
| 6011 |
+
/**
|
| 6012 |
+
* Time over children to wait before showing tooltip
|
| 6013 |
+
*
|
| 6014 |
+
* @type {number}
|
| 6015 |
+
*/
|
| 6016 |
|
| 6017 |
+
var TOOLTIP_DELAY = 700;
|
| 6018 |
|
| 6019 |
+
var Tooltip = /*#__PURE__*/function (_Component) {
|
| 6020 |
+
Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"])(Tooltip, _Component);
|
| 6021 |
|
| 6022 |
+
var _super = _createSuper(Tooltip);
|
| 6023 |
|
| 6024 |
+
function Tooltip() {
|
| 6025 |
+
var _this;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6026 |
|
| 6027 |
+
Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(this, Tooltip);
|
|
|
|
| 6028 |
|
| 6029 |
+
_this = _super.apply(this, arguments);
|
| 6030 |
+
_this.delayedSetIsOver = Object(lodash__WEBPACK_IMPORTED_MODULE_6__["debounce"])(function (isOver) {
|
| 6031 |
+
return _this.setState({
|
| 6032 |
+
isOver: isOver
|
| 6033 |
+
});
|
| 6034 |
+
}, TOOLTIP_DELAY);
|
| 6035 |
+
/**
|
| 6036 |
+
* Prebound `isInMouseDown` handler, created as a constant reference to
|
| 6037 |
+
* assure ability to remove in component unmount.
|
| 6038 |
+
*
|
| 6039 |
+
* @type {Function}
|
| 6040 |
+
*/
|
| 6041 |
+
|
| 6042 |
+
_this.cancelIsMouseDown = _this.createSetIsMouseDown(false);
|
| 6043 |
+
/**
|
| 6044 |
+
* Whether a the mouse is currently pressed, used in determining whether
|
| 6045 |
+
* to handle a focus event as displaying the tooltip immediately.
|
| 6046 |
+
*
|
| 6047 |
+
* @type {boolean}
|
| 6048 |
+
*/
|
| 6049 |
+
|
| 6050 |
+
_this.isInMouseDown = false;
|
| 6051 |
+
_this.state = {
|
| 6052 |
+
isOver: false
|
| 6053 |
+
};
|
| 6054 |
+
return _this;
|
| 6055 |
}
|
| 6056 |
|
| 6057 |
+
Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(Tooltip, [{
|
| 6058 |
+
key: "componentWillUnmount",
|
| 6059 |
+
value: function componentWillUnmount() {
|
| 6060 |
+
this.delayedSetIsOver.cancel();
|
| 6061 |
+
document.removeEventListener('mouseup', this.cancelIsMouseDown);
|
| 6062 |
}
|
| 6063 |
}, {
|
| 6064 |
+
key: "emitToChild",
|
| 6065 |
+
value: function emitToChild(eventName, event) {
|
| 6066 |
+
var children = this.props.children;
|
|
|
|
| 6067 |
|
| 6068 |
+
if (_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["Children"].count(children) !== 1) {
|
| 6069 |
return;
|
| 6070 |
}
|
| 6071 |
|
| 6072 |
+
var child = _wordpress_element__WEBPACK_IMPORTED_MODULE_5__["Children"].only(children);
|
| 6073 |
+
|
| 6074 |
+
if (typeof child.props[eventName] === 'function') {
|
| 6075 |
+
child.props[eventName](event);
|
| 6076 |
}
|
| 6077 |
}
|
| 6078 |
}, {
|
| 6079 |
+
key: "createToggleIsOver",
|
| 6080 |
+
value: function createToggleIsOver(eventName, isDelayed) {
|
| 6081 |
+
var _this2 = this;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6082 |
|
| 6083 |
+
return function (event) {
|
| 6084 |
+
// Preserve original child callback behavior
|
| 6085 |
+
_this2.emitToChild(eventName, event); // Mouse events behave unreliably in React for disabled elements,
|
| 6086 |
+
// firing on mouseenter but not mouseleave. Further, the default
|
| 6087 |
+
// behavior for disabled elements in some browsers is to ignore
|
| 6088 |
+
// mouse events. Don't bother trying to to handle them.
|
| 6089 |
+
//
|
| 6090 |
+
// See: https://github.com/facebook/react/issues/4251
|
| 6091 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6092 |
|
| 6093 |
+
if (event.currentTarget.disabled) {
|
| 6094 |
+
return;
|
| 6095 |
+
} // A focus event will occur as a result of a mouse click, but it
|
| 6096 |
+
// should be disambiguated between interacting with the button and
|
| 6097 |
+
// using an explicit focus shift as a cue to display the tooltip.
|
| 6098 |
|
|
|
|
|
|
|
|
|
|
| 6099 |
|
| 6100 |
+
if ('focus' === event.type && _this2.isInMouseDown) {
|
| 6101 |
+
return;
|
| 6102 |
+
} // Needed in case unsetting is over while delayed set pending, i.e.
|
| 6103 |
+
// quickly blur/mouseleave before delayedSetIsOver is called
|
| 6104 |
|
|
|
|
| 6105 |
|
| 6106 |
+
_this2.delayedSetIsOver.cancel();
|
|
|
|
|
|
|
| 6107 |
|
| 6108 |
+
var isOver = Object(lodash__WEBPACK_IMPORTED_MODULE_6__["includes"])(['focus', 'mouseenter'], event.type);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6109 |
|
| 6110 |
+
if (isOver === _this2.state.isOver) {
|
| 6111 |
+
return;
|
| 6112 |
+
}
|
| 6113 |
+
|
| 6114 |
+
if (isDelayed) {
|
| 6115 |
+
_this2.delayedSetIsOver(isOver);
|
| 6116 |
+
} else {
|
| 6117 |
+
_this2.setState({
|
| 6118 |
+
isOver: isOver
|
| 6119 |
+
});
|
| 6120 |
+
}
|
| 6121 |
+
};
|
| 6122 |
}
|
| 6123 |
+
/**
|
| 6124 |
+
* Creates an event callback to handle assignment of the `isInMouseDown`
|
| 6125 |
+
* instance property in response to a `mousedown` or `mouseup` event.
|
| 6126 |
+
*
|
| 6127 |
+
* @param {boolean} isMouseDown Whether handler is to be created for the
|
| 6128 |
+
* `mousedown` event, as opposed to `mouseup`.
|
| 6129 |
+
*
|
| 6130 |
+
* @return {Function} Event callback handler.
|
| 6131 |
+
*/
|
| 6132 |
+
|
| 6133 |
}, {
|
| 6134 |
+
key: "createSetIsMouseDown",
|
| 6135 |
+
value: function createSetIsMouseDown(isMouseDown) {
|
| 6136 |
+
var _this3 = this;
|
| 6137 |
+
|
| 6138 |
+
return function (event) {
|
| 6139 |
+
// Preserve original child callback behavior
|
| 6140 |
+
_this3.emitToChild(isMouseDown ? 'onMouseDown' : 'onMouseUp', event); // On mouse down, the next `mouseup` should revert the value of the
|
| 6141 |
+
// instance property and remove its own event handler. The bind is
|
| 6142 |
+
// made on the document since the `mouseup` might not occur within
|
| 6143 |
+
// the bounds of the element.
|
| 6144 |
|
| 6145 |
+
|
| 6146 |
+
document[isMouseDown ? 'addEventListener' : 'removeEventListener']('mouseup', _this3.cancelIsMouseDown);
|
| 6147 |
+
_this3.isInMouseDown = isMouseDown;
|
| 6148 |
+
};
|
| 6149 |
}
|
| 6150 |
}, {
|
| 6151 |
key: "render",
|
| 6152 |
value: function render() {
|
| 6153 |
+
var _this$props = this.props,
|
| 6154 |
+
children = _this$props.children,
|
| 6155 |
+
position = _this$props.position,
|
| 6156 |
+
text = _this$props.text,
|
| 6157 |
+
shortcut = _this$props.shortcut;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6158 |
|
| 6159 |
+
if (_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["Children"].count(children) !== 1) {
|
| 6160 |
+
if (false) {}
|
|
|
|
| 6161 |
|
| 6162 |
+
return children;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6163 |
}
|
|
|
|
|
|
|
|
|
|
| 6164 |
|
| 6165 |
+
var child = _wordpress_element__WEBPACK_IMPORTED_MODULE_5__["Children"].only(children);
|
| 6166 |
+
var isOver = this.state.isOver;
|
| 6167 |
+
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["cloneElement"])(child, {
|
| 6168 |
+
onMouseEnter: this.createToggleIsOver('onMouseEnter', true),
|
| 6169 |
+
onMouseLeave: this.createToggleIsOver('onMouseLeave'),
|
| 6170 |
+
onClick: this.createToggleIsOver('onClick'),
|
| 6171 |
+
onFocus: this.createToggleIsOver('onFocus'),
|
| 6172 |
+
onBlur: this.createToggleIsOver('onBlur'),
|
| 6173 |
+
onMouseDown: this.createSetIsMouseDown(true),
|
| 6174 |
+
children: Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["concatChildren"])(child.props.children, isOver && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["createElement"])(_popover__WEBPACK_IMPORTED_MODULE_7__[/* default */ "a"], {
|
| 6175 |
+
focusOnMount: false,
|
| 6176 |
+
position: position,
|
| 6177 |
+
className: "components-tooltip",
|
| 6178 |
+
"aria-hidden": "true",
|
| 6179 |
+
animate: false,
|
| 6180 |
+
noArrow: true
|
| 6181 |
+
}, text, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["createElement"])(_shortcut__WEBPACK_IMPORTED_MODULE_8__[/* default */ "a"], {
|
| 6182 |
+
className: "components-tooltip__shortcut",
|
| 6183 |
+
shortcut: shortcut
|
| 6184 |
+
})))
|
| 6185 |
+
});
|
| 6186 |
+
}
|
| 6187 |
+
}]);
|
| 6188 |
|
| 6189 |
+
return Tooltip;
|
| 6190 |
+
}(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["Component"]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6191 |
|
| 6192 |
+
/* harmony default export */ __webpack_exports__["a"] = (Tooltip);
|
| 6193 |
+
//# sourceMappingURL=index.js.map
|
| 6194 |
|
| 6195 |
/***/ }),
|
| 6196 |
|
| 6197 |
+
/***/ 16:
|
| 6198 |
/***/ (function(module, exports) {
|
| 6199 |
|
| 6200 |
+
(function() { module.exports = this["moment"]; }());
|
| 6201 |
|
| 6202 |
/***/ }),
|
| 6203 |
|
| 6204 |
+
/***/ 160:
|
| 6205 |
/***/ (function(module, exports, __webpack_require__) {
|
| 6206 |
|
| 6207 |
+
// TinyColor v1.4.2
|
| 6208 |
+
// https://github.com/bgrins/TinyColor
|
| 6209 |
+
// Brian Grinstead, MIT License
|
| 6210 |
|
| 6211 |
+
(function(Math) {
|
| 6212 |
|
| 6213 |
+
var trimLeft = /^\s+/,
|
| 6214 |
+
trimRight = /\s+$/,
|
| 6215 |
+
tinyCounter = 0,
|
| 6216 |
+
mathRound = Math.round,
|
| 6217 |
+
mathMin = Math.min,
|
| 6218 |
+
mathMax = Math.max,
|
| 6219 |
+
mathRandom = Math.random;
|
| 6220 |
|
| 6221 |
+
function tinycolor (color, opts) {
|
| 6222 |
+
|
| 6223 |
+
color = (color) ? color : '';
|
| 6224 |
+
opts = opts || { };
|
| 6225 |
+
|
| 6226 |
+
// If input is already a tinycolor, return itself
|
| 6227 |
+
if (color instanceof tinycolor) {
|
| 6228 |
+
return color;
|
| 6229 |
+
}
|
| 6230 |
+
// If we are called as a function, call using new instead
|
| 6231 |
+
if (!(this instanceof tinycolor)) {
|
| 6232 |
+
return new tinycolor(color, opts);
|
| 6233 |
+
}
|
| 6234 |
+
|
| 6235 |
+
var rgb = inputToRGB(color);
|
| 6236 |
+
this._originalInput = color,
|
| 6237 |
+
this._r = rgb.r,
|
| 6238 |
+
this._g = rgb.g,
|
| 6239 |
+
this._b = rgb.b,
|
| 6240 |
+
this._a = rgb.a,
|
| 6241 |
+
this._roundA = mathRound(100*this._a) / 100,
|
| 6242 |
+
this._format = opts.format || rgb.format;
|
| 6243 |
+
this._gradientType = opts.gradientType;
|
| 6244 |
+
|
| 6245 |
+
// Don't let the range of [0,255] come back in [0,1].
|
| 6246 |
+
// Potentially lose a little bit of precision here, but will fix issues where
|
| 6247 |
+
// .5 gets interpreted as half of the total, instead of half of 1
|
| 6248 |
+
// If it was supposed to be 128, this was already taken care of by `inputToRgb`
|
| 6249 |
+
if (this._r < 1) { this._r = mathRound(this._r); }
|
| 6250 |
+
if (this._g < 1) { this._g = mathRound(this._g); }
|
| 6251 |
+
if (this._b < 1) { this._b = mathRound(this._b); }
|
| 6252 |
+
|
| 6253 |
+
this._ok = rgb.ok;
|
| 6254 |
+
this._tc_id = tinyCounter++;
|
| 6255 |
}
|
| 6256 |
|
| 6257 |
+
tinycolor.prototype = {
|
| 6258 |
+
isDark: function() {
|
| 6259 |
+
return this.getBrightness() < 128;
|
| 6260 |
+
},
|
| 6261 |
+
isLight: function() {
|
| 6262 |
+
return !this.isDark();
|
| 6263 |
+
},
|
| 6264 |
+
isValid: function() {
|
| 6265 |
+
return this._ok;
|
| 6266 |
+
},
|
| 6267 |
+
getOriginalInput: function() {
|
| 6268 |
+
return this._originalInput;
|
| 6269 |
+
},
|
| 6270 |
+
getFormat: function() {
|
| 6271 |
+
return this._format;
|
| 6272 |
+
},
|
| 6273 |
+
getAlpha: function() {
|
| 6274 |
+
return this._a;
|
| 6275 |
+
},
|
| 6276 |
+
getBrightness: function() {
|
| 6277 |
+
//http://www.w3.org/TR/AERT#color-contrast
|
| 6278 |
+
var rgb = this.toRgb();
|
| 6279 |
+
return (rgb.r * 299 + rgb.g * 587 + rgb.b * 114) / 1000;
|
| 6280 |
+
},
|
| 6281 |
+
getLuminance: function() {
|
| 6282 |
+
//http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef
|
| 6283 |
+
var rgb = this.toRgb();
|
| 6284 |
+
var RsRGB, GsRGB, BsRGB, R, G, B;
|
| 6285 |
+
RsRGB = rgb.r/255;
|
| 6286 |
+
GsRGB = rgb.g/255;
|
| 6287 |
+
BsRGB = rgb.b/255;
|
| 6288 |
+
|
| 6289 |
+
if (RsRGB <= 0.03928) {R = RsRGB / 12.92;} else {R = Math.pow(((RsRGB + 0.055) / 1.055), 2.4);}
|
| 6290 |
+
if (GsRGB <= 0.03928) {G = GsRGB / 12.92;} else {G = Math.pow(((GsRGB + 0.055) / 1.055), 2.4);}
|
| 6291 |
+
if (BsRGB <= 0.03928) {B = BsRGB / 12.92;} else {B = Math.pow(((BsRGB + 0.055) / 1.055), 2.4);}
|
| 6292 |
+
return (0.2126 * R) + (0.7152 * G) + (0.0722 * B);
|
| 6293 |
+
},
|
| 6294 |
+
setAlpha: function(value) {
|
| 6295 |
+
this._a = boundAlpha(value);
|
| 6296 |
+
this._roundA = mathRound(100*this._a) / 100;
|
| 6297 |
+
return this;
|
| 6298 |
+
},
|
| 6299 |
+
toHsv: function() {
|
| 6300 |
+
var hsv = rgbToHsv(this._r, this._g, this._b);
|
| 6301 |
+
return { h: hsv.h * 360, s: hsv.s, v: hsv.v, a: this._a };
|
| 6302 |
+
},
|
| 6303 |
+
toHsvString: function() {
|
| 6304 |
+
var hsv = rgbToHsv(this._r, this._g, this._b);
|
| 6305 |
+
var h = mathRound(hsv.h * 360), s = mathRound(hsv.s * 100), v = mathRound(hsv.v * 100);
|
| 6306 |
+
return (this._a == 1) ?
|
| 6307 |
+
"hsv(" + h + ", " + s + "%, " + v + "%)" :
|
| 6308 |
+
"hsva(" + h + ", " + s + "%, " + v + "%, "+ this._roundA + ")";
|
| 6309 |
+
},
|
| 6310 |
+
toHsl: function() {
|
| 6311 |
+
var hsl = rgbToHsl(this._r, this._g, this._b);
|
| 6312 |
+
return { h: hsl.h * 360, s: hsl.s, l: hsl.l, a: this._a };
|
| 6313 |
+
},
|
| 6314 |
+
toHslString: function() {
|
| 6315 |
+
var hsl = rgbToHsl(this._r, this._g, this._b);
|
| 6316 |
+
var h = mathRound(hsl.h * 360), s = mathRound(hsl.s * 100), l = mathRound(hsl.l * 100);
|
| 6317 |
+
return (this._a == 1) ?
|
| 6318 |
+
"hsl(" + h + ", " + s + "%, " + l + "%)" :
|
| 6319 |
+
"hsla(" + h + ", " + s + "%, " + l + "%, "+ this._roundA + ")";
|
| 6320 |
+
},
|
| 6321 |
+
toHex: function(allow3Char) {
|
| 6322 |
+
return rgbToHex(this._r, this._g, this._b, allow3Char);
|
| 6323 |
+
},
|
| 6324 |
+
toHexString: function(allow3Char) {
|
| 6325 |
+
return '#' + this.toHex(allow3Char);
|
| 6326 |
+
},
|
| 6327 |
+
toHex8: function(allow4Char) {
|
| 6328 |
+
return rgbaToHex(this._r, this._g, this._b, this._a, allow4Char);
|
| 6329 |
+
},
|
| 6330 |
+
toHex8String: function(allow4Char) {
|
| 6331 |
+
return '#' + this.toHex8(allow4Char);
|
| 6332 |
+
},
|
| 6333 |
+
toRgb: function() {
|
| 6334 |
+
return { r: mathRound(this._r), g: mathRound(this._g), b: mathRound(this._b), a: this._a };
|
| 6335 |
+
},
|
| 6336 |
+
toRgbString: function() {
|
| 6337 |
+
return (this._a == 1) ?
|
| 6338 |
+
"rgb(" + mathRound(this._r) + ", " + mathRound(this._g) + ", " + mathRound(this._b) + ")" :
|
| 6339 |
+
"rgba(" + mathRound(this._r) + ", " + mathRound(this._g) + ", " + mathRound(this._b) + ", " + this._roundA + ")";
|
| 6340 |
+
},
|
| 6341 |
+
toPercentageRgb: function() {
|
| 6342 |
+
return { r: mathRound(bound01(this._r, 255) * 100) + "%", g: mathRound(bound01(this._g, 255) * 100) + "%", b: mathRound(bound01(this._b, 255) * 100) + "%", a: this._a };
|
| 6343 |
+
},
|
| 6344 |
+
toPercentageRgbString: function() {
|
| 6345 |
+
return (this._a == 1) ?
|
| 6346 |
+
"rgb(" + mathRound(bound01(this._r, 255) * 100) + "%, " + mathRound(bound01(this._g, 255) * 100) + "%, " + mathRound(bound01(this._b, 255) * 100) + "%)" :
|
| 6347 |
+
"rgba(" + mathRound(bound01(this._r, 255) * 100) + "%, " + mathRound(bound01(this._g, 255) * 100) + "%, " + mathRound(bound01(this._b, 255) * 100) + "%, " + this._roundA + ")";
|
| 6348 |
+
},
|
| 6349 |
+
toName: function() {
|
| 6350 |
+
if (this._a === 0) {
|
| 6351 |
+
return "transparent";
|
| 6352 |
+
}
|
| 6353 |
|
| 6354 |
+
if (this._a < 1) {
|
| 6355 |
+
return false;
|
| 6356 |
+
}
|
| 6357 |
|
| 6358 |
+
return hexNames[rgbToHex(this._r, this._g, this._b, true)] || false;
|
| 6359 |
+
},
|
| 6360 |
+
toFilter: function(secondColor) {
|
| 6361 |
+
var hex8String = '#' + rgbaToArgbHex(this._r, this._g, this._b, this._a);
|
| 6362 |
+
var secondHex8String = hex8String;
|
| 6363 |
+
var gradientType = this._gradientType ? "GradientType = 1, " : "";
|
| 6364 |
+
|
| 6365 |
+
if (secondColor) {
|
| 6366 |
+
var s = tinycolor(secondColor);
|
| 6367 |
+
secondHex8String = '#' + rgbaToArgbHex(s._r, s._g, s._b, s._a);
|
| 6368 |
+
}
|
| 6369 |
|
| 6370 |
+
return "progid:DXImageTransform.Microsoft.gradient("+gradientType+"startColorstr="+hex8String+",endColorstr="+secondHex8String+")";
|
| 6371 |
+
},
|
| 6372 |
+
toString: function(format) {
|
| 6373 |
+
var formatSet = !!format;
|
| 6374 |
+
format = format || this._format;
|
| 6375 |
+
|
| 6376 |
+
var formattedString = false;
|
| 6377 |
+
var hasAlpha = this._a < 1 && this._a >= 0;
|
| 6378 |
+
var needsAlphaFormat = !formatSet && hasAlpha && (format === "hex" || format === "hex6" || format === "hex3" || format === "hex4" || format === "hex8" || format === "name");
|
| 6379 |
+
|
| 6380 |
+
if (needsAlphaFormat) {
|
| 6381 |
+
// Special case for "transparent", all other non-alpha formats
|
| 6382 |
+
// will return rgba when there is transparency.
|
| 6383 |
+
if (format === "name" && this._a === 0) {
|
| 6384 |
+
return this.toName();
|
| 6385 |
+
}
|
| 6386 |
+
return this.toRgbString();
|
| 6387 |
+
}
|
| 6388 |
+
if (format === "rgb") {
|
| 6389 |
+
formattedString = this.toRgbString();
|
| 6390 |
+
}
|
| 6391 |
+
if (format === "prgb") {
|
| 6392 |
+
formattedString = this.toPercentageRgbString();
|
| 6393 |
+
}
|
| 6394 |
+
if (format === "hex" || format === "hex6") {
|
| 6395 |
+
formattedString = this.toHexString();
|
| 6396 |
+
}
|
| 6397 |
+
if (format === "hex3") {
|
| 6398 |
+
formattedString = this.toHexString(true);
|
| 6399 |
+
}
|
| 6400 |
+
if (format === "hex4") {
|
| 6401 |
+
formattedString = this.toHex8String(true);
|
| 6402 |
+
}
|
| 6403 |
+
if (format === "hex8") {
|
| 6404 |
+
formattedString = this.toHex8String();
|
| 6405 |
+
}
|
| 6406 |
+
if (format === "name") {
|
| 6407 |
+
formattedString = this.toName();
|
| 6408 |
+
}
|
| 6409 |
+
if (format === "hsl") {
|
| 6410 |
+
formattedString = this.toHslString();
|
| 6411 |
+
}
|
| 6412 |
+
if (format === "hsv") {
|
| 6413 |
+
formattedString = this.toHsvString();
|
| 6414 |
+
}
|
| 6415 |
|
| 6416 |
+
return formattedString || this.toHexString();
|
| 6417 |
+
},
|
| 6418 |
+
clone: function() {
|
| 6419 |
+
return tinycolor(this.toString());
|
| 6420 |
+
},
|
|
|
|
| 6421 |
|
| 6422 |
+
_applyModification: function(fn, args) {
|
| 6423 |
+
var color = fn.apply(null, [this].concat([].slice.call(args)));
|
| 6424 |
+
this._r = color._r;
|
| 6425 |
+
this._g = color._g;
|
| 6426 |
+
this._b = color._b;
|
| 6427 |
+
this.setAlpha(color._a);
|
| 6428 |
+
return this;
|
| 6429 |
+
},
|
| 6430 |
+
lighten: function() {
|
| 6431 |
+
return this._applyModification(lighten, arguments);
|
| 6432 |
+
},
|
| 6433 |
+
brighten: function() {
|
| 6434 |
+
return this._applyModification(brighten, arguments);
|
| 6435 |
+
},
|
| 6436 |
+
darken: function() {
|
| 6437 |
+
return this._applyModification(darken, arguments);
|
| 6438 |
+
},
|
| 6439 |
+
desaturate: function() {
|
| 6440 |
+
return this._applyModification(desaturate, arguments);
|
| 6441 |
+
},
|
| 6442 |
+
saturate: function() {
|
| 6443 |
+
return this._applyModification(saturate, arguments);
|
| 6444 |
+
},
|
| 6445 |
+
greyscale: function() {
|
| 6446 |
+
return this._applyModification(greyscale, arguments);
|
| 6447 |
+
},
|
| 6448 |
+
spin: function() {
|
| 6449 |
+
return this._applyModification(spin, arguments);
|
| 6450 |
+
},
|
| 6451 |
|
| 6452 |
+
_applyCombination: function(fn, args) {
|
| 6453 |
+
return fn.apply(null, [this].concat([].slice.call(args)));
|
| 6454 |
+
},
|
| 6455 |
+
analogous: function() {
|
| 6456 |
+
return this._applyCombination(analogous, arguments);
|
| 6457 |
+
},
|
| 6458 |
+
complement: function() {
|
| 6459 |
+
return this._applyCombination(complement, arguments);
|
| 6460 |
+
},
|
| 6461 |
+
monochromatic: function() {
|
| 6462 |
+
return this._applyCombination(monochromatic, arguments);
|
| 6463 |
+
},
|
| 6464 |
+
splitcomplement: function() {
|
| 6465 |
+
return this._applyCombination(splitcomplement, arguments);
|
| 6466 |
+
},
|
| 6467 |
+
triad: function() {
|
| 6468 |
+
return this._applyCombination(triad, arguments);
|
| 6469 |
+
},
|
| 6470 |
+
tetrad: function() {
|
| 6471 |
+
return this._applyCombination(tetrad, arguments);
|
| 6472 |
+
}
|
| 6473 |
+
};
|
| 6474 |
|
| 6475 |
+
// If input is an object, force 1 into "1.0" to handle ratios properly
|
| 6476 |
+
// String input requires "1.0" as input, so 1 will be treated as 1
|
| 6477 |
+
tinycolor.fromRatio = function(color, opts) {
|
| 6478 |
+
if (typeof color == "object") {
|
| 6479 |
+
var newColor = {};
|
| 6480 |
+
for (var i in color) {
|
| 6481 |
+
if (color.hasOwnProperty(i)) {
|
| 6482 |
+
if (i === "a") {
|
| 6483 |
+
newColor[i] = color[i];
|
| 6484 |
+
}
|
| 6485 |
+
else {
|
| 6486 |
+
newColor[i] = convertToPercentage(color[i]);
|
| 6487 |
+
}
|
| 6488 |
+
}
|
| 6489 |
+
}
|
| 6490 |
+
color = newColor;
|
| 6491 |
+
}
|
| 6492 |
|
| 6493 |
+
return tinycolor(color, opts);
|
| 6494 |
+
};
|
| 6495 |
|
| 6496 |
+
// Given a string or object, convert that input to RGB
|
| 6497 |
+
// Possible string inputs:
|
| 6498 |
+
//
|
| 6499 |
+
// "red"
|
| 6500 |
+
// "#f00" or "f00"
|
| 6501 |
+
// "#ff0000" or "ff0000"
|
| 6502 |
+
// "#ff000000" or "ff000000"
|
| 6503 |
+
// "rgb 255 0 0" or "rgb (255, 0, 0)"
|
| 6504 |
+
// "rgb 1.0 0 0" or "rgb (1, 0, 0)"
|
| 6505 |
+
// "rgba (255, 0, 0, 1)" or "rgba 255, 0, 0, 1"
|
| 6506 |
+
// "rgba (1.0, 0, 0, 1)" or "rgba 1.0, 0, 0, 1"
|
| 6507 |
+
// "hsl(0, 100%, 50%)" or "hsl 0 100% 50%"
|
| 6508 |
+
// "hsla(0, 100%, 50%, 1)" or "hsla 0 100% 50%, 1"
|
| 6509 |
+
// "hsv(0, 100%, 100%)" or "hsv 0 100% 100%"
|
| 6510 |
+
//
|
| 6511 |
+
function inputToRGB(color) {
|
| 6512 |
+
|
| 6513 |
+
var rgb = { r: 0, g: 0, b: 0 };
|
| 6514 |
+
var a = 1;
|
| 6515 |
+
var s = null;
|
| 6516 |
+
var v = null;
|
| 6517 |
+
var l = null;
|
| 6518 |
+
var ok = false;
|
| 6519 |
+
var format = false;
|
| 6520 |
+
|
| 6521 |
+
if (typeof color == "string") {
|
| 6522 |
+
color = stringInputToObject(color);
|
| 6523 |
+
}
|
| 6524 |
|
| 6525 |
+
if (typeof color == "object") {
|
| 6526 |
+
if (isValidCSSUnit(color.r) && isValidCSSUnit(color.g) && isValidCSSUnit(color.b)) {
|
| 6527 |
+
rgb = rgbToRgb(color.r, color.g, color.b);
|
| 6528 |
+
ok = true;
|
| 6529 |
+
format = String(color.r).substr(-1) === "%" ? "prgb" : "rgb";
|
| 6530 |
+
}
|
| 6531 |
+
else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.v)) {
|
| 6532 |
+
s = convertToPercentage(color.s);
|
| 6533 |
+
v = convertToPercentage(color.v);
|
| 6534 |
+
rgb = hsvToRgb(color.h, s, v);
|
| 6535 |
+
ok = true;
|
| 6536 |
+
format = "hsv";
|
| 6537 |
+
}
|
| 6538 |
+
else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.l)) {
|
| 6539 |
+
s = convertToPercentage(color.s);
|
| 6540 |
+
l = convertToPercentage(color.l);
|
| 6541 |
+
rgb = hslToRgb(color.h, s, l);
|
| 6542 |
+
ok = true;
|
| 6543 |
+
format = "hsl";
|
| 6544 |
+
}
|
| 6545 |
|
| 6546 |
+
if (color.hasOwnProperty("a")) {
|
| 6547 |
+
a = color.a;
|
| 6548 |
+
}
|
| 6549 |
+
}
|
| 6550 |
|
| 6551 |
+
a = boundAlpha(a);
|
| 6552 |
|
| 6553 |
+
return {
|
| 6554 |
+
ok: ok,
|
| 6555 |
+
format: color.format || format,
|
| 6556 |
+
r: mathMin(255, mathMax(rgb.r, 0)),
|
| 6557 |
+
g: mathMin(255, mathMax(rgb.g, 0)),
|
| 6558 |
+
b: mathMin(255, mathMax(rgb.b, 0)),
|
| 6559 |
+
a: a
|
| 6560 |
+
};
|
| 6561 |
+
}
|
| 6562 |
+
|
| 6563 |
+
|
| 6564 |
+
// Conversion Functions
|
| 6565 |
+
// --------------------
|
| 6566 |
+
|
| 6567 |
+
// `rgbToHsl`, `rgbToHsv`, `hslToRgb`, `hsvToRgb` modified from:
|
| 6568 |
+
// <http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript>
|
| 6569 |
|
| 6570 |
+
// `rgbToRgb`
|
| 6571 |
+
// Handle bounds / percentage checking to conform to CSS color spec
|
| 6572 |
+
// <http://www.w3.org/TR/css3-color/>
|
| 6573 |
+
// *Assumes:* r, g, b in [0, 255] or [0, 1]
|
| 6574 |
+
// *Returns:* { r, g, b } in [0, 255]
|
| 6575 |
+
function rgbToRgb(r, g, b){
|
| 6576 |
+
return {
|
| 6577 |
+
r: bound01(r, 255) * 255,
|
| 6578 |
+
g: bound01(g, 255) * 255,
|
| 6579 |
+
b: bound01(b, 255) * 255
|
| 6580 |
+
};
|
| 6581 |
+
}
|
| 6582 |
|
| 6583 |
+
// `rgbToHsl`
|
| 6584 |
+
// Converts an RGB color value to HSL.
|
| 6585 |
+
// *Assumes:* r, g, and b are contained in [0, 255] or [0, 1]
|
| 6586 |
+
// *Returns:* { h, s, l } in [0,1]
|
| 6587 |
+
function rgbToHsl(r, g, b) {
|
| 6588 |
|
| 6589 |
+
r = bound01(r, 255);
|
| 6590 |
+
g = bound01(g, 255);
|
| 6591 |
+
b = bound01(b, 255);
|
| 6592 |
|
| 6593 |
+
var max = mathMax(r, g, b), min = mathMin(r, g, b);
|
| 6594 |
+
var h, s, l = (max + min) / 2;
|
| 6595 |
|
| 6596 |
+
if(max == min) {
|
| 6597 |
+
h = s = 0; // achromatic
|
| 6598 |
+
}
|
| 6599 |
+
else {
|
| 6600 |
+
var d = max - min;
|
| 6601 |
+
s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
|
| 6602 |
+
switch(max) {
|
| 6603 |
+
case r: h = (g - b) / d + (g < b ? 6 : 0); break;
|
| 6604 |
+
case g: h = (b - r) / d + 2; break;
|
| 6605 |
+
case b: h = (r - g) / d + 4; break;
|
| 6606 |
+
}
|
| 6607 |
+
|
| 6608 |
+
h /= 6;
|
| 6609 |
+
}
|
| 6610 |
+
|
| 6611 |
+
return { h: h, s: s, l: l };
|
| 6612 |
}
|
| 6613 |
|
| 6614 |
+
// `hslToRgb`
|
| 6615 |
+
// Converts an HSL color value to RGB.
|
| 6616 |
+
// *Assumes:* h is contained in [0, 1] or [0, 360] and s and l are contained [0, 1] or [0, 100]
|
| 6617 |
+
// *Returns:* { r, g, b } in the set [0, 255]
|
| 6618 |
+
function hslToRgb(h, s, l) {
|
| 6619 |
+
var r, g, b;
|
| 6620 |
+
|
| 6621 |
+
h = bound01(h, 360);
|
| 6622 |
+
s = bound01(s, 100);
|
| 6623 |
+
l = bound01(l, 100);
|
| 6624 |
+
|
| 6625 |
+
function hue2rgb(p, q, t) {
|
| 6626 |
+
if(t < 0) t += 1;
|
| 6627 |
+
if(t > 1) t -= 1;
|
| 6628 |
+
if(t < 1/6) return p + (q - p) * 6 * t;
|
| 6629 |
+
if(t < 1/2) return q;
|
| 6630 |
+
if(t < 2/3) return p + (q - p) * (2/3 - t) * 6;
|
| 6631 |
+
return p;
|
| 6632 |
+
}
|
| 6633 |
|
| 6634 |
+
if(s === 0) {
|
| 6635 |
+
r = g = b = l; // achromatic
|
| 6636 |
+
}
|
| 6637 |
+
else {
|
| 6638 |
+
var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
|
| 6639 |
+
var p = 2 * l - q;
|
| 6640 |
+
r = hue2rgb(p, q, h + 1/3);
|
| 6641 |
+
g = hue2rgb(p, q, h);
|
| 6642 |
+
b = hue2rgb(p, q, h - 1/3);
|
| 6643 |
+
}
|
| 6644 |
|
| 6645 |
+
return { r: r * 255, g: g * 255, b: b * 255 };
|
| 6646 |
+
}
|
| 6647 |
|
| 6648 |
+
// `rgbToHsv`
|
| 6649 |
+
// Converts an RGB color value to HSV
|
| 6650 |
+
// *Assumes:* r, g, and b are contained in the set [0, 255] or [0, 1]
|
| 6651 |
+
// *Returns:* { h, s, v } in [0,1]
|
| 6652 |
+
function rgbToHsv(r, g, b) {
|
| 6653 |
|
| 6654 |
+
r = bound01(r, 255);
|
| 6655 |
+
g = bound01(g, 255);
|
| 6656 |
+
b = bound01(b, 255);
|
| 6657 |
|
| 6658 |
+
var max = mathMax(r, g, b), min = mathMin(r, g, b);
|
| 6659 |
+
var h, s, v = max;
|
| 6660 |
|
| 6661 |
+
var d = max - min;
|
| 6662 |
+
s = max === 0 ? 0 : d / max;
|
| 6663 |
|
| 6664 |
+
if(max == min) {
|
| 6665 |
+
h = 0; // achromatic
|
| 6666 |
+
}
|
| 6667 |
+
else {
|
| 6668 |
+
switch(max) {
|
| 6669 |
+
case r: h = (g - b) / d + (g < b ? 6 : 0); break;
|
| 6670 |
+
case g: h = (b - r) / d + 2; break;
|
| 6671 |
+
case b: h = (r - g) / d + 4; break;
|
| 6672 |
+
}
|
| 6673 |
+
h /= 6;
|
| 6674 |
+
}
|
| 6675 |
+
return { h: h, s: s, v: v };
|
| 6676 |
+
}
|
| 6677 |
|
| 6678 |
+
// `hsvToRgb`
|
| 6679 |
+
// Converts an HSV color value to RGB.
|
| 6680 |
+
// *Assumes:* h is contained in [0, 1] or [0, 360] and s and v are contained in [0, 1] or [0, 100]
|
| 6681 |
+
// *Returns:* { r, g, b } in the set [0, 255]
|
| 6682 |
+
function hsvToRgb(h, s, v) {
|
| 6683 |
+
|
| 6684 |
+
h = bound01(h, 360) * 6;
|
| 6685 |
+
s = bound01(s, 100);
|
| 6686 |
+
v = bound01(v, 100);
|
| 6687 |
+
|
| 6688 |
+
var i = Math.floor(h),
|
| 6689 |
+
f = h - i,
|
| 6690 |
+
p = v * (1 - s),
|
| 6691 |
+
q = v * (1 - f * s),
|
| 6692 |
+
t = v * (1 - (1 - f) * s),
|
| 6693 |
+
mod = i % 6,
|
| 6694 |
+
r = [v, q, p, p, t, v][mod],
|
| 6695 |
+
g = [t, v, v, q, p, p][mod],
|
| 6696 |
+
b = [p, p, t, v, v, q][mod];
|
| 6697 |
+
|
| 6698 |
+
return { r: r * 255, g: g * 255, b: b * 255 };
|
| 6699 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6700 |
|
| 6701 |
+
// `rgbToHex`
|
| 6702 |
+
// Converts an RGB color to hex
|
| 6703 |
+
// Assumes r, g, and b are contained in the set [0, 255]
|
| 6704 |
+
// Returns a 3 or 6 character hex
|
| 6705 |
+
function rgbToHex(r, g, b, allow3Char) {
|
| 6706 |
+
|
| 6707 |
+
var hex = [
|
| 6708 |
+
pad2(mathRound(r).toString(16)),
|
| 6709 |
+
pad2(mathRound(g).toString(16)),
|
| 6710 |
+
pad2(mathRound(b).toString(16))
|
| 6711 |
+
];
|
| 6712 |
+
|
| 6713 |
+
// Return a 3 character hex if possible
|
| 6714 |
+
if (allow3Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1)) {
|
| 6715 |
+
return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0);
|
| 6716 |
}
|
| 6717 |
|
| 6718 |
+
return hex.join("");
|
| 6719 |
+
}
|
| 6720 |
+
|
| 6721 |
+
// `rgbaToHex`
|
| 6722 |
+
// Converts an RGBA color plus alpha transparency to hex
|
| 6723 |
+
// Assumes r, g, b are contained in the set [0, 255] and
|
| 6724 |
+
// a in [0, 1]. Returns a 4 or 8 character rgba hex
|
| 6725 |
+
function rgbaToHex(r, g, b, a, allow4Char) {
|
| 6726 |
+
|
| 6727 |
+
var hex = [
|
| 6728 |
+
pad2(mathRound(r).toString(16)),
|
| 6729 |
+
pad2(mathRound(g).toString(16)),
|
| 6730 |
+
pad2(mathRound(b).toString(16)),
|
| 6731 |
+
pad2(convertDecimalToHex(a))
|
| 6732 |
+
];
|
| 6733 |
+
|
| 6734 |
+
// Return a 4 character hex if possible
|
| 6735 |
+
if (allow4Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1) && hex[3].charAt(0) == hex[3].charAt(1)) {
|
| 6736 |
+
return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) + hex[3].charAt(0);
|
| 6737 |
}
|
| 6738 |
|
| 6739 |
+
return hex.join("");
|
| 6740 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6741 |
|
| 6742 |
+
// `rgbaToArgbHex`
|
| 6743 |
+
// Converts an RGBA color to an ARGB Hex8 string
|
| 6744 |
+
// Rarely used, but required for "toFilter()"
|
| 6745 |
+
function rgbaToArgbHex(r, g, b, a) {
|
| 6746 |
+
|
| 6747 |
+
var hex = [
|
| 6748 |
+
pad2(convertDecimalToHex(a)),
|
| 6749 |
+
pad2(mathRound(r).toString(16)),
|
| 6750 |
+
pad2(mathRound(g).toString(16)),
|
| 6751 |
+
pad2(mathRound(b).toString(16))
|
| 6752 |
+
];
|
| 6753 |
+
|
| 6754 |
+
return hex.join("");
|
| 6755 |
}
|
|
|
|
|
|
|
|
|
|
| 6756 |
|
| 6757 |
+
// `equals`
|
| 6758 |
+
// Can be called with any tinycolor input
|
| 6759 |
+
tinycolor.equals = function (color1, color2) {
|
| 6760 |
+
if (!color1 || !color2) { return false; }
|
| 6761 |
+
return tinycolor(color1).toRgbString() == tinycolor(color2).toRgbString();
|
| 6762 |
+
};
|
| 6763 |
+
|
| 6764 |
+
tinycolor.random = function() {
|
| 6765 |
+
return tinycolor.fromRatio({
|
| 6766 |
+
r: mathRandom(),
|
| 6767 |
+
g: mathRandom(),
|
| 6768 |
+
b: mathRandom()
|
| 6769 |
});
|
| 6770 |
+
};
|
| 6771 |
+
|
| 6772 |
+
|
| 6773 |
+
// Modification Functions
|
| 6774 |
+
// ----------------------
|
| 6775 |
+
// Thanks to less.js for some of the basics here
|
| 6776 |
+
// <https://github.com/cloudhead/less.js/blob/master/lib/less/functions.js>
|
| 6777 |
+
|
| 6778 |
+
function desaturate(color, amount) {
|
| 6779 |
+
amount = (amount === 0) ? 0 : (amount || 10);
|
| 6780 |
+
var hsl = tinycolor(color).toHsl();
|
| 6781 |
+
hsl.s -= amount / 100;
|
| 6782 |
+
hsl.s = clamp01(hsl.s);
|
| 6783 |
+
return tinycolor(hsl);
|
| 6784 |
}
|
| 6785 |
+
|
| 6786 |
+
function saturate(color, amount) {
|
| 6787 |
+
amount = (amount === 0) ? 0 : (amount || 10);
|
| 6788 |
+
var hsl = tinycolor(color).toHsl();
|
| 6789 |
+
hsl.s += amount / 100;
|
| 6790 |
+
hsl.s = clamp01(hsl.s);
|
| 6791 |
+
return tinycolor(hsl);
|
| 6792 |
}
|
| 6793 |
+
|
| 6794 |
+
function greyscale(color) {
|
| 6795 |
+
return tinycolor(color).desaturate(100);
|
| 6796 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6797 |
|
| 6798 |
+
function lighten (color, amount) {
|
| 6799 |
+
amount = (amount === 0) ? 0 : (amount || 10);
|
| 6800 |
+
var hsl = tinycolor(color).toHsl();
|
| 6801 |
+
hsl.l += amount / 100;
|
| 6802 |
+
hsl.l = clamp01(hsl.l);
|
| 6803 |
+
return tinycolor(hsl);
|
| 6804 |
}
|
| 6805 |
|
| 6806 |
+
function brighten(color, amount) {
|
| 6807 |
+
amount = (amount === 0) ? 0 : (amount || 10);
|
| 6808 |
+
var rgb = tinycolor(color).toRgb();
|
| 6809 |
+
rgb.r = mathMax(0, mathMin(255, rgb.r - mathRound(255 * - (amount / 100))));
|
| 6810 |
+
rgb.g = mathMax(0, mathMin(255, rgb.g - mathRound(255 * - (amount / 100))));
|
| 6811 |
+
rgb.b = mathMax(0, mathMin(255, rgb.b - mathRound(255 * - (amount / 100))));
|
| 6812 |
+
return tinycolor(rgb);
|
| 6813 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6814 |
|
| 6815 |
+
function darken (color, amount) {
|
| 6816 |
+
amount = (amount === 0) ? 0 : (amount || 10);
|
| 6817 |
+
var hsl = tinycolor(color).toHsl();
|
| 6818 |
+
hsl.l -= amount / 100;
|
| 6819 |
+
hsl.l = clamp01(hsl.l);
|
| 6820 |
+
return tinycolor(hsl);
|
| 6821 |
}
|
| 6822 |
|
| 6823 |
+
// Spin takes a positive or negative amount within [-360, 360] indicating the change of hue.
|
| 6824 |
+
// Values outside of this range will be wrapped into this range.
|
| 6825 |
+
function spin(color, amount) {
|
| 6826 |
+
var hsl = tinycolor(color).toHsl();
|
| 6827 |
+
var hue = (hsl.h + amount) % 360;
|
| 6828 |
+
hsl.h = hue < 0 ? 360 + hue : hue;
|
| 6829 |
+
return tinycolor(hsl);
|
| 6830 |
+
}
|
| 6831 |
|
| 6832 |
+
// Combination Functions
|
| 6833 |
+
// ---------------------
|
| 6834 |
+
// Thanks to jQuery xColor for some of the ideas behind these
|
| 6835 |
+
// <https://github.com/infusion/jQuery-xcolor/blob/master/jquery.xcolor.js>
|
| 6836 |
+
|
| 6837 |
+
function complement(color) {
|
| 6838 |
+
var hsl = tinycolor(color).toHsl();
|
| 6839 |
+
hsl.h = (hsl.h + 180) % 360;
|
| 6840 |
+
return tinycolor(hsl);
|
| 6841 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6842 |
|
| 6843 |
+
function triad(color) {
|
| 6844 |
+
var hsl = tinycolor(color).toHsl();
|
| 6845 |
+
var h = hsl.h;
|
| 6846 |
+
return [
|
| 6847 |
+
tinycolor(color),
|
| 6848 |
+
tinycolor({ h: (h + 120) % 360, s: hsl.s, l: hsl.l }),
|
| 6849 |
+
tinycolor({ h: (h + 240) % 360, s: hsl.s, l: hsl.l })
|
| 6850 |
+
];
|
| 6851 |
}
|
| 6852 |
|
| 6853 |
+
function tetrad(color) {
|
| 6854 |
+
var hsl = tinycolor(color).toHsl();
|
| 6855 |
+
var h = hsl.h;
|
| 6856 |
+
return [
|
| 6857 |
+
tinycolor(color),
|
| 6858 |
+
tinycolor({ h: (h + 90) % 360, s: hsl.s, l: hsl.l }),
|
| 6859 |
+
tinycolor({ h: (h + 180) % 360, s: hsl.s, l: hsl.l }),
|
| 6860 |
+
tinycolor({ h: (h + 270) % 360, s: hsl.s, l: hsl.l })
|
| 6861 |
+
];
|
| 6862 |
+
}
|
| 6863 |
|
| 6864 |
+
function splitcomplement(color) {
|
| 6865 |
+
var hsl = tinycolor(color).toHsl();
|
| 6866 |
+
var h = hsl.h;
|
| 6867 |
+
return [
|
| 6868 |
+
tinycolor(color),
|
| 6869 |
+
tinycolor({ h: (h + 72) % 360, s: hsl.s, l: hsl.l}),
|
| 6870 |
+
tinycolor({ h: (h + 216) % 360, s: hsl.s, l: hsl.l})
|
| 6871 |
+
];
|
| 6872 |
+
}
|
| 6873 |
|
| 6874 |
+
function analogous(color, results, slices) {
|
| 6875 |
+
results = results || 6;
|
| 6876 |
+
slices = slices || 30;
|
| 6877 |
|
| 6878 |
+
var hsl = tinycolor(color).toHsl();
|
| 6879 |
+
var part = 360 / slices;
|
| 6880 |
+
var ret = [tinycolor(color)];
|
| 6881 |
|
| 6882 |
+
for (hsl.h = ((hsl.h - (part * results >> 1)) + 720) % 360; --results; ) {
|
| 6883 |
+
hsl.h = (hsl.h + part) % 360;
|
| 6884 |
+
ret.push(tinycolor(hsl));
|
| 6885 |
+
}
|
| 6886 |
+
return ret;
|
| 6887 |
+
}
|
| 6888 |
|
| 6889 |
+
function monochromatic(color, results) {
|
| 6890 |
+
results = results || 6;
|
| 6891 |
+
var hsv = tinycolor(color).toHsv();
|
| 6892 |
+
var h = hsv.h, s = hsv.s, v = hsv.v;
|
| 6893 |
+
var ret = [];
|
| 6894 |
+
var modification = 1 / results;
|
| 6895 |
|
| 6896 |
+
while (results--) {
|
| 6897 |
+
ret.push(tinycolor({ h: h, s: s, v: v}));
|
| 6898 |
+
v = (v + modification) % 1;
|
| 6899 |
+
}
|
| 6900 |
|
| 6901 |
+
return ret;
|
| 6902 |
+
}
|
|
|
|
|
|
|
|
|
|
| 6903 |
|
| 6904 |
+
// Utility Functions
|
| 6905 |
+
// ---------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6906 |
|
| 6907 |
+
tinycolor.mix = function(color1, color2, amount) {
|
| 6908 |
+
amount = (amount === 0) ? 0 : (amount || 50);
|
| 6909 |
|
| 6910 |
+
var rgb1 = tinycolor(color1).toRgb();
|
| 6911 |
+
var rgb2 = tinycolor(color2).toRgb();
|
|
|
|
| 6912 |
|
| 6913 |
+
var p = amount / 100;
|
|
|
|
| 6914 |
|
| 6915 |
+
var rgba = {
|
| 6916 |
+
r: ((rgb2.r - rgb1.r) * p) + rgb1.r,
|
| 6917 |
+
g: ((rgb2.g - rgb1.g) * p) + rgb1.g,
|
| 6918 |
+
b: ((rgb2.b - rgb1.b) * p) + rgb1.b,
|
| 6919 |
+
a: ((rgb2.a - rgb1.a) * p) + rgb1.a
|
| 6920 |
};
|
| 6921 |
|
| 6922 |
+
return tinycolor(rgba);
|
| 6923 |
+
};
|
|
|
|
|
|
|
|
|
|
| 6924 |
|
|
|
|
|
|
|
| 6925 |
|
| 6926 |
+
// Readability Functions
|
| 6927 |
+
// ---------------------
|
| 6928 |
+
// <http://www.w3.org/TR/2008/REC-WCAG20-20081211/#contrast-ratiodef (WCAG Version 2)
|
|
|
|
|
|
|
|
|
|
| 6929 |
|
| 6930 |
+
// `contrast`
|
| 6931 |
+
// Analyze the 2 colors and returns the color contrast defined by (WCAG Version 2)
|
| 6932 |
+
tinycolor.readability = function(color1, color2) {
|
| 6933 |
+
var c1 = tinycolor(color1);
|
| 6934 |
+
var c2 = tinycolor(color2);
|
| 6935 |
+
return (Math.max(c1.getLuminance(),c2.getLuminance())+0.05) / (Math.min(c1.getLuminance(),c2.getLuminance())+0.05);
|
| 6936 |
+
};
|
| 6937 |
|
| 6938 |
+
// `isReadable`
|
| 6939 |
+
// Ensure that foreground and background color combinations meet WCAG2 guidelines.
|
| 6940 |
+
// The third argument is an optional Object.
|
| 6941 |
+
// the 'level' property states 'AA' or 'AAA' - if missing or invalid, it defaults to 'AA';
|
| 6942 |
+
// the 'size' property states 'large' or 'small' - if missing or invalid, it defaults to 'small'.
|
| 6943 |
+
// If the entire object is absent, isReadable defaults to {level:"AA",size:"small"}.
|
| 6944 |
+
|
| 6945 |
+
// *Example*
|
| 6946 |
+
// tinycolor.isReadable("#000", "#111") => false
|
| 6947 |
+
// tinycolor.isReadable("#000", "#111",{level:"AA",size:"large"}) => false
|
| 6948 |
+
tinycolor.isReadable = function(color1, color2, wcag2) {
|
| 6949 |
+
var readability = tinycolor.readability(color1, color2);
|
| 6950 |
+
var wcag2Parms, out;
|
| 6951 |
+
|
| 6952 |
+
out = false;
|
| 6953 |
+
|
| 6954 |
+
wcag2Parms = validateWCAG2Parms(wcag2);
|
| 6955 |
+
switch (wcag2Parms.level + wcag2Parms.size) {
|
| 6956 |
+
case "AAsmall":
|
| 6957 |
+
case "AAAlarge":
|
| 6958 |
+
out = readability >= 4.5;
|
| 6959 |
+
break;
|
| 6960 |
+
case "AAlarge":
|
| 6961 |
+
out = readability >= 3;
|
| 6962 |
+
break;
|
| 6963 |
+
case "AAAsmall":
|
| 6964 |
+
out = readability >= 7;
|
| 6965 |
+
break;
|
| 6966 |
}
|
| 6967 |
+
return out;
|
| 6968 |
|
| 6969 |
+
};
|
|
|
|
| 6970 |
|
| 6971 |
+
// `mostReadable`
|
| 6972 |
+
// Given a base color and a list of possible foreground or background
|
| 6973 |
+
// colors for that base, returns the most readable color.
|
| 6974 |
+
// Optionally returns Black or White if the most readable color is unreadable.
|
| 6975 |
+
// *Example*
|
| 6976 |
+
// tinycolor.mostReadable(tinycolor.mostReadable("#123", ["#124", "#125"],{includeFallbackColors:false}).toHexString(); // "#112255"
|
| 6977 |
+
// tinycolor.mostReadable(tinycolor.mostReadable("#123", ["#124", "#125"],{includeFallbackColors:true}).toHexString(); // "#ffffff"
|
| 6978 |
+
// tinycolor.mostReadable("#a8015a", ["#faf3f3"],{includeFallbackColors:true,level:"AAA",size:"large"}).toHexString(); // "#faf3f3"
|
| 6979 |
+
// tinycolor.mostReadable("#a8015a", ["#faf3f3"],{includeFallbackColors:true,level:"AAA",size:"small"}).toHexString(); // "#ffffff"
|
| 6980 |
+
tinycolor.mostReadable = function(baseColor, colorList, args) {
|
| 6981 |
+
var bestColor = null;
|
| 6982 |
+
var bestScore = 0;
|
| 6983 |
+
var readability;
|
| 6984 |
+
var includeFallbackColors, level, size ;
|
| 6985 |
+
args = args || {};
|
| 6986 |
+
includeFallbackColors = args.includeFallbackColors ;
|
| 6987 |
+
level = args.level;
|
| 6988 |
+
size = args.size;
|
| 6989 |
+
|
| 6990 |
+
for (var i= 0; i < colorList.length ; i++) {
|
| 6991 |
+
readability = tinycolor.readability(baseColor, colorList[i]);
|
| 6992 |
+
if (readability > bestScore) {
|
| 6993 |
+
bestScore = readability;
|
| 6994 |
+
bestColor = tinycolor(colorList[i]);
|
| 6995 |
+
}
|
| 6996 |
+
}
|
| 6997 |
|
| 6998 |
+
if (tinycolor.isReadable(baseColor, bestColor, {"level":level,"size":size}) || !includeFallbackColors) {
|
| 6999 |
+
return bestColor;
|
| 7000 |
+
}
|
| 7001 |
+
else {
|
| 7002 |
+
args.includeFallbackColors=false;
|
| 7003 |
+
return tinycolor.mostReadable(baseColor,["#fff", "#000"],args);
|
| 7004 |
+
}
|
| 7005 |
+
};
|
| 7006 |
|
|
|
|
|
|
|
| 7007 |
|
| 7008 |
+
// Big List of Colors
|
| 7009 |
+
// ------------------
|
| 7010 |
+
// <http://www.w3.org/TR/css3-color/#svg-color>
|
| 7011 |
+
var names = tinycolor.names = {
|
| 7012 |
+
aliceblue: "f0f8ff",
|
| 7013 |
+
antiquewhite: "faebd7",
|
| 7014 |
+
aqua: "0ff",
|
| 7015 |
+
aquamarine: "7fffd4",
|
| 7016 |
+
azure: "f0ffff",
|
| 7017 |
+
beige: "f5f5dc",
|
| 7018 |
+
bisque: "ffe4c4",
|
| 7019 |
+
black: "000",
|
| 7020 |
+
blanchedalmond: "ffebcd",
|
| 7021 |
+
blue: "00f",
|
| 7022 |
+
blueviolet: "8a2be2",
|
| 7023 |
+
brown: "a52a2a",
|
| 7024 |
+
burlywood: "deb887",
|
| 7025 |
+
burntsienna: "ea7e5d",
|
| 7026 |
+
cadetblue: "5f9ea0",
|
| 7027 |
+
chartreuse: "7fff00",
|
| 7028 |
+
chocolate: "d2691e",
|
| 7029 |
+
coral: "ff7f50",
|
| 7030 |
+
cornflowerblue: "6495ed",
|
| 7031 |
+
cornsilk: "fff8dc",
|
| 7032 |
+
crimson: "dc143c",
|
| 7033 |
+
cyan: "0ff",
|
| 7034 |
+
darkblue: "00008b",
|
| 7035 |
+
darkcyan: "008b8b",
|
| 7036 |
+
darkgoldenrod: "b8860b",
|
| 7037 |
+
darkgray: "a9a9a9",
|
| 7038 |
+
darkgreen: "006400",
|
| 7039 |
+
darkgrey: "a9a9a9",
|
| 7040 |
+
darkkhaki: "bdb76b",
|
| 7041 |
+
darkmagenta: "8b008b",
|
| 7042 |
+
darkolivegreen: "556b2f",
|
| 7043 |
+
darkorange: "ff8c00",
|
| 7044 |
+
darkorchid: "9932cc",
|
| 7045 |
+
darkred: "8b0000",
|
| 7046 |
+
darksalmon: "e9967a",
|
| 7047 |
+
darkseagreen: "8fbc8f",
|
| 7048 |
+
darkslateblue: "483d8b",
|
| 7049 |
+
darkslategray: "2f4f4f",
|
| 7050 |
+
darkslategrey: "2f4f4f",
|
| 7051 |
+
darkturquoise: "00ced1",
|
| 7052 |
+
darkviolet: "9400d3",
|
| 7053 |
+
deeppink: "ff1493",
|
| 7054 |
+
deepskyblue: "00bfff",
|
| 7055 |
+
dimgray: "696969",
|
| 7056 |
+
dimgrey: "696969",
|
| 7057 |
+
dodgerblue: "1e90ff",
|
| 7058 |
+
firebrick: "b22222",
|
| 7059 |
+
floralwhite: "fffaf0",
|
| 7060 |
+
forestgreen: "228b22",
|
| 7061 |
+
fuchsia: "f0f",
|
| 7062 |
+
gainsboro: "dcdcdc",
|
| 7063 |
+
ghostwhite: "f8f8ff",
|
| 7064 |
+
gold: "ffd700",
|
| 7065 |
+
goldenrod: "daa520",
|
| 7066 |
+
gray: "808080",
|
| 7067 |
+
green: "008000",
|
| 7068 |
+
greenyellow: "adff2f",
|
| 7069 |
+
grey: "808080",
|
| 7070 |
+
honeydew: "f0fff0",
|
| 7071 |
+
hotpink: "ff69b4",
|
| 7072 |
+
indianred: "cd5c5c",
|
| 7073 |
+
indigo: "4b0082",
|
| 7074 |
+
ivory: "fffff0",
|
| 7075 |
+
khaki: "f0e68c",
|
| 7076 |
+
lavender: "e6e6fa",
|
| 7077 |
+
lavenderblush: "fff0f5",
|
| 7078 |
+
lawngreen: "7cfc00",
|
| 7079 |
+
lemonchiffon: "fffacd",
|
| 7080 |
+
lightblue: "add8e6",
|
| 7081 |
+
lightcoral: "f08080",
|
| 7082 |
+
lightcyan: "e0ffff",
|
| 7083 |
+
lightgoldenrodyellow: "fafad2",
|
| 7084 |
+
lightgray: "d3d3d3",
|
| 7085 |
+
lightgreen: "90ee90",
|
| 7086 |
+
lightgrey: "d3d3d3",
|
| 7087 |
+
lightpink: "ffb6c1",
|
| 7088 |
+
lightsalmon: "ffa07a",
|
| 7089 |
+
lightseagreen: "20b2aa",
|
| 7090 |
+
lightskyblue: "87cefa",
|
| 7091 |
+
lightslategray: "789",
|
| 7092 |
+
lightslategrey: "789",
|
| 7093 |
+
lightsteelblue: "b0c4de",
|
| 7094 |
+
lightyellow: "ffffe0",
|
| 7095 |
+
lime: "0f0",
|
| 7096 |
+
limegreen: "32cd32",
|
| 7097 |
+
linen: "faf0e6",
|
| 7098 |
+
magenta: "f0f",
|
| 7099 |
+
maroon: "800000",
|
| 7100 |
+
mediumaquamarine: "66cdaa",
|
| 7101 |
+
mediumblue: "0000cd",
|
| 7102 |
+
mediumorchid: "ba55d3",
|
| 7103 |
+
mediumpurple: "9370db",
|
| 7104 |
+
mediumseagreen: "3cb371",
|
| 7105 |
+
mediumslateblue: "7b68ee",
|
| 7106 |
+
mediumspringgreen: "00fa9a",
|
| 7107 |
+
mediumturquoise: "48d1cc",
|
| 7108 |
+
mediumvioletred: "c71585",
|
| 7109 |
+
midnightblue: "191970",
|
| 7110 |
+
mintcream: "f5fffa",
|
| 7111 |
+
mistyrose: "ffe4e1",
|
| 7112 |
+
moccasin: "ffe4b5",
|
| 7113 |
+
navajowhite: "ffdead",
|
| 7114 |
+
navy: "000080",
|
| 7115 |
+
oldlace: "fdf5e6",
|
| 7116 |
+
olive: "808000",
|
| 7117 |
+
olivedrab: "6b8e23",
|
| 7118 |
+
orange: "ffa500",
|
| 7119 |
+
orangered: "ff4500",
|
| 7120 |
+
orchid: "da70d6",
|
| 7121 |
+
palegoldenrod: "eee8aa",
|
| 7122 |
+
palegreen: "98fb98",
|
| 7123 |
+
paleturquoise: "afeeee",
|
| 7124 |
+
palevioletred: "db7093",
|
| 7125 |
+
papayawhip: "ffefd5",
|
| 7126 |
+
peachpuff: "ffdab9",
|
| 7127 |
+
peru: "cd853f",
|
| 7128 |
+
pink: "ffc0cb",
|
| 7129 |
+
plum: "dda0dd",
|
| 7130 |
+
powderblue: "b0e0e6",
|
| 7131 |
+
purple: "800080",
|
| 7132 |
+
rebeccapurple: "663399",
|
| 7133 |
+
red: "f00",
|
| 7134 |
+
rosybrown: "bc8f8f",
|
| 7135 |
+
royalblue: "4169e1",
|
| 7136 |
+
saddlebrown: "8b4513",
|
| 7137 |
+
salmon: "fa8072",
|
| 7138 |
+
sandybrown: "f4a460",
|
| 7139 |
+
seagreen: "2e8b57",
|
| 7140 |
+
seashell: "fff5ee",
|
| 7141 |
+
sienna: "a0522d",
|
| 7142 |
+
silver: "c0c0c0",
|
| 7143 |
+
skyblue: "87ceeb",
|
| 7144 |
+
slateblue: "6a5acd",
|
| 7145 |
+
slategray: "708090",
|
| 7146 |
+
slategrey: "708090",
|
| 7147 |
+
snow: "fffafa",
|
| 7148 |
+
springgreen: "00ff7f",
|
| 7149 |
+
steelblue: "4682b4",
|
| 7150 |
+
tan: "d2b48c",
|
| 7151 |
+
teal: "008080",
|
| 7152 |
+
thistle: "d8bfd8",
|
| 7153 |
+
tomato: "ff6347",
|
| 7154 |
+
turquoise: "40e0d0",
|
| 7155 |
+
violet: "ee82ee",
|
| 7156 |
+
wheat: "f5deb3",
|
| 7157 |
+
white: "fff",
|
| 7158 |
+
whitesmoke: "f5f5f5",
|
| 7159 |
+
yellow: "ff0",
|
| 7160 |
+
yellowgreen: "9acd32"
|
| 7161 |
+
};
|
| 7162 |
|
| 7163 |
+
// Make it easy to access colors via `hexNames[hex]`
|
| 7164 |
+
var hexNames = tinycolor.hexNames = flip(names);
|
| 7165 |
+
|
| 7166 |
+
|
| 7167 |
+
// Utilities
|
| 7168 |
+
// ---------
|
| 7169 |
+
|
| 7170 |
+
// `{ 'name1': 'val1' }` becomes `{ 'val1': 'name1' }`
|
| 7171 |
+
function flip(o) {
|
| 7172 |
+
var flipped = { };
|
| 7173 |
+
for (var i in o) {
|
| 7174 |
+
if (o.hasOwnProperty(i)) {
|
| 7175 |
+
flipped[o[i]] = i;
|
| 7176 |
+
}
|
| 7177 |
}
|
| 7178 |
+
return flipped;
|
| 7179 |
+
}
|
| 7180 |
|
| 7181 |
+
// Return a valid alpha value [0,1] with all invalid values being set to 1
|
| 7182 |
+
function boundAlpha(a) {
|
| 7183 |
+
a = parseFloat(a);
|
| 7184 |
|
| 7185 |
+
if (isNaN(a) || a < 0 || a > 1) {
|
| 7186 |
+
a = 1;
|
|
|
|
|
|
|
| 7187 |
}
|
| 7188 |
|
| 7189 |
+
return a;
|
| 7190 |
+
}
|
| 7191 |
|
| 7192 |
+
// Take input from [0, n] and return it as [0, 1]
|
| 7193 |
+
function bound01(n, max) {
|
| 7194 |
+
if (isOnePointZero(n)) { n = "100%"; }
|
| 7195 |
|
| 7196 |
+
var processPercent = isPercentage(n);
|
| 7197 |
+
n = mathMin(max, mathMax(0, parseFloat(n)));
|
| 7198 |
|
| 7199 |
+
// Automatically convert percentage into number
|
| 7200 |
+
if (processPercent) {
|
| 7201 |
+
n = parseInt(n * max, 10) / 100;
|
| 7202 |
+
}
|
| 7203 |
+
|
| 7204 |
+
// Handle floating point rounding errors
|
| 7205 |
+
if ((Math.abs(n - max) < 0.000001)) {
|
| 7206 |
+
return 1;
|
| 7207 |
+
}
|
| 7208 |
+
|
| 7209 |
+
// Convert into [0, 1] range if it isn't already
|
| 7210 |
+
return (n % max) / parseFloat(max);
|
| 7211 |
}
|
| 7212 |
+
|
| 7213 |
+
// Force a number between 0 and 1
|
| 7214 |
+
function clamp01(val) {
|
| 7215 |
+
return mathMin(1, mathMax(0, val));
|
| 7216 |
}
|
| 7217 |
+
|
| 7218 |
+
// Parse a base-16 hex value into a base-10 integer
|
| 7219 |
+
function parseIntFromHex(val) {
|
| 7220 |
+
return parseInt(val, 16);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7221 |
}
|
| 7222 |
+
|
| 7223 |
+
// Need to handle 1.0 as 100%, since once it is a number, there is no difference between it and 1
|
| 7224 |
+
// <http://stackoverflow.com/questions/7422072/javascript-how-to-detect-number-as-a-decimal-including-1-0>
|
| 7225 |
+
function isOnePointZero(n) {
|
| 7226 |
+
return typeof n == "string" && n.indexOf('.') != -1 && parseFloat(n) === 1;
|
| 7227 |
}
|
| 7228 |
+
|
| 7229 |
+
// Check to see if string passed in is a percentage
|
| 7230 |
+
function isPercentage(n) {
|
| 7231 |
+
return typeof n === "string" && n.indexOf('%') != -1;
|
|
|
|
| 7232 |
}
|
| 7233 |
+
|
| 7234 |
+
// Force a hex value to have 2 characters
|
| 7235 |
+
function pad2(c) {
|
| 7236 |
+
return c.length == 1 ? '0' + c : '' + c;
|
| 7237 |
}
|
| 7238 |
+
|
| 7239 |
+
// Replace a decimal with it's percentage value
|
| 7240 |
+
function convertToPercentage(n) {
|
| 7241 |
+
if (n <= 1) {
|
| 7242 |
+
n = (n * 100) + "%";
|
| 7243 |
+
}
|
| 7244 |
+
|
| 7245 |
+
return n;
|
| 7246 |
}
|
| 7247 |
+
|
| 7248 |
+
// Converts a decimal to a hex value
|
| 7249 |
+
function convertDecimalToHex(d) {
|
| 7250 |
+
return Math.round(parseFloat(d) * 255).toString(16);
|
| 7251 |
}
|
| 7252 |
+
// Converts a hex value to a decimal
|
| 7253 |
+
function convertHexToDecimal(h) {
|
| 7254 |
+
return (parseIntFromHex(h) / 255);
|
| 7255 |
}
|
| 7256 |
|
| 7257 |
+
var matchers = (function() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7258 |
|
| 7259 |
+
// <http://www.w3.org/TR/css3-values/#integers>
|
| 7260 |
+
var CSS_INTEGER = "[-\\+]?\\d+%?";
|
|
|
|
| 7261 |
|
| 7262 |
+
// <http://www.w3.org/TR/css3-values/#number-value>
|
| 7263 |
+
var CSS_NUMBER = "[-\\+]?\\d*\\.\\d+%?";
|
|
|
|
|
|
|
| 7264 |
|
| 7265 |
+
// Allow positive/negative integer/number. Don't capture the either/or, just the entire outcome.
|
| 7266 |
+
var CSS_UNIT = "(?:" + CSS_NUMBER + ")|(?:" + CSS_INTEGER + ")";
|
| 7267 |
|
| 7268 |
+
// Actual matching.
|
| 7269 |
+
// Parentheses and commas are optional, but not required.
|
| 7270 |
+
// Whitespace can take the place of commas or opening paren
|
| 7271 |
+
var PERMISSIVE_MATCH3 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?";
|
| 7272 |
+
var PERMISSIVE_MATCH4 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?";
|
|
|
|
| 7273 |
|
| 7274 |
+
return {
|
| 7275 |
+
CSS_UNIT: new RegExp(CSS_UNIT),
|
| 7276 |
+
rgb: new RegExp("rgb" + PERMISSIVE_MATCH3),
|
| 7277 |
+
rgba: new RegExp("rgba" + PERMISSIVE_MATCH4),
|
| 7278 |
+
hsl: new RegExp("hsl" + PERMISSIVE_MATCH3),
|
| 7279 |
+
hsla: new RegExp("hsla" + PERMISSIVE_MATCH4),
|
| 7280 |
+
hsv: new RegExp("hsv" + PERMISSIVE_MATCH3),
|
| 7281 |
+
hsva: new RegExp("hsva" + PERMISSIVE_MATCH4),
|
| 7282 |
+
hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
|
| 7283 |
+
hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
|
| 7284 |
+
hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
|
| 7285 |
+
hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/
|
| 7286 |
+
};
|
| 7287 |
+
})();
|
| 7288 |
|
| 7289 |
+
// `isValidCSSUnit`
|
| 7290 |
+
// Take in a single string / number and check to see if it looks like a CSS unit
|
| 7291 |
+
// (see `matchers` above for definition).
|
| 7292 |
+
function isValidCSSUnit(color) {
|
| 7293 |
+
return !!matchers.CSS_UNIT.exec(color);
|
| 7294 |
+
}
|
| 7295 |
|
| 7296 |
+
// `stringInputToObject`
|
| 7297 |
+
// Permissive string parsing. Take in a number of formats, and output an object
|
| 7298 |
+
// based on detected format. Returns `{ r, g, b }` or `{ h, s, l }` or `{ h, s, v}`
|
| 7299 |
+
function stringInputToObject(color) {
|
| 7300 |
|
| 7301 |
+
color = color.replace(trimLeft,'').replace(trimRight, '').toLowerCase();
|
| 7302 |
+
var named = false;
|
| 7303 |
+
if (names[color]) {
|
| 7304 |
+
color = names[color];
|
| 7305 |
+
named = true;
|
| 7306 |
+
}
|
| 7307 |
+
else if (color == 'transparent') {
|
| 7308 |
+
return { r: 0, g: 0, b: 0, a: 0, format: "name" };
|
| 7309 |
+
}
|
| 7310 |
|
| 7311 |
+
// Try to match string input using regular expressions.
|
| 7312 |
+
// Keep most of the number bounding out of this function - don't worry about [0,1] or [0,100] or [0,360]
|
| 7313 |
+
// Just return an object and let the conversion functions handle that.
|
| 7314 |
+
// This way the result will be the same whether the tinycolor is initialized with string or object.
|
| 7315 |
+
var match;
|
| 7316 |
+
if ((match = matchers.rgb.exec(color))) {
|
| 7317 |
+
return { r: match[1], g: match[2], b: match[3] };
|
| 7318 |
+
}
|
| 7319 |
+
if ((match = matchers.rgba.exec(color))) {
|
| 7320 |
+
return { r: match[1], g: match[2], b: match[3], a: match[4] };
|
| 7321 |
+
}
|
| 7322 |
+
if ((match = matchers.hsl.exec(color))) {
|
| 7323 |
+
return { h: match[1], s: match[2], l: match[3] };
|
| 7324 |
+
}
|
| 7325 |
+
if ((match = matchers.hsla.exec(color))) {
|
| 7326 |
+
return { h: match[1], s: match[2], l: match[3], a: match[4] };
|
| 7327 |
+
}
|
| 7328 |
+
if ((match = matchers.hsv.exec(color))) {
|
| 7329 |
+
return { h: match[1], s: match[2], v: match[3] };
|
| 7330 |
+
}
|
| 7331 |
+
if ((match = matchers.hsva.exec(color))) {
|
| 7332 |
+
return { h: match[1], s: match[2], v: match[3], a: match[4] };
|
| 7333 |
+
}
|
| 7334 |
+
if ((match = matchers.hex8.exec(color))) {
|
| 7335 |
+
return {
|
| 7336 |
+
r: parseIntFromHex(match[1]),
|
| 7337 |
+
g: parseIntFromHex(match[2]),
|
| 7338 |
+
b: parseIntFromHex(match[3]),
|
| 7339 |
+
a: convertHexToDecimal(match[4]),
|
| 7340 |
+
format: named ? "name" : "hex8"
|
| 7341 |
+
};
|
| 7342 |
+
}
|
| 7343 |
+
if ((match = matchers.hex6.exec(color))) {
|
| 7344 |
+
return {
|
| 7345 |
+
r: parseIntFromHex(match[1]),
|
| 7346 |
+
g: parseIntFromHex(match[2]),
|
| 7347 |
+
b: parseIntFromHex(match[3]),
|
| 7348 |
+
format: named ? "name" : "hex"
|
| 7349 |
+
};
|
| 7350 |
+
}
|
| 7351 |
+
if ((match = matchers.hex4.exec(color))) {
|
| 7352 |
+
return {
|
| 7353 |
+
r: parseIntFromHex(match[1] + '' + match[1]),
|
| 7354 |
+
g: parseIntFromHex(match[2] + '' + match[2]),
|
| 7355 |
+
b: parseIntFromHex(match[3] + '' + match[3]),
|
| 7356 |
+
a: convertHexToDecimal(match[4] + '' + match[4]),
|
| 7357 |
+
format: named ? "name" : "hex8"
|
| 7358 |
+
};
|
| 7359 |
+
}
|
| 7360 |
+
if ((match = matchers.hex3.exec(color))) {
|
| 7361 |
+
return {
|
| 7362 |
+
r: parseIntFromHex(match[1] + '' + match[1]),
|
| 7363 |
+
g: parseIntFromHex(match[2] + '' + match[2]),
|
| 7364 |
+
b: parseIntFromHex(match[3] + '' + match[3]),
|
| 7365 |
+
format: named ? "name" : "hex"
|
| 7366 |
+
};
|
| 7367 |
+
}
|
| 7368 |
|
| 7369 |
+
return false;
|
| 7370 |
+
}
|
| 7371 |
|
| 7372 |
+
function validateWCAG2Parms(parms) {
|
| 7373 |
+
// return valid WCAG2 parms for isReadable.
|
| 7374 |
+
// If input parms are invalid, return {"level":"AA", "size":"small"}
|
| 7375 |
+
var level, size;
|
| 7376 |
+
parms = parms || {"level":"AA", "size":"small"};
|
| 7377 |
+
level = (parms.level || "AA").toUpperCase();
|
| 7378 |
+
size = (parms.size || "small").toLowerCase();
|
| 7379 |
+
if (level !== "AA" && level !== "AAA") {
|
| 7380 |
+
level = "AA";
|
| 7381 |
+
}
|
| 7382 |
+
if (size !== "small" && size !== "large") {
|
| 7383 |
+
size = "small";
|
| 7384 |
+
}
|
| 7385 |
+
return {"level":level, "size":size};
|
| 7386 |
+
}
|
| 7387 |
|
| 7388 |
+
// Node: Export function
|
| 7389 |
+
if ( true && module.exports) {
|
| 7390 |
+
module.exports = tinycolor;
|
| 7391 |
+
}
|
| 7392 |
+
// AMD/requirejs: Define the module
|
| 7393 |
+
else if (typeof define === 'function' && define.amd) {
|
| 7394 |
+
define(function () {return tinycolor;});
|
| 7395 |
+
}
|
| 7396 |
+
// Browser: Expose to window
|
| 7397 |
+
else {
|
| 7398 |
+
window.tinycolor = tinycolor;
|
| 7399 |
+
}
|
| 7400 |
|
| 7401 |
+
})(Math);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7402 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7403 |
|
| 7404 |
+
/***/ }),
|
| 7405 |
|
| 7406 |
+
/***/ 162:
|
| 7407 |
+
/***/ (function(module, exports) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7408 |
|
| 7409 |
+
function _setPrototypeOf(o, p) {
|
| 7410 |
+
module.exports = _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
|
| 7411 |
+
o.__proto__ = p;
|
| 7412 |
+
return o;
|
| 7413 |
+
};
|
| 7414 |
|
| 7415 |
+
return _setPrototypeOf(o, p);
|
| 7416 |
+
}
|
|
|
|
| 7417 |
|
| 7418 |
+
module.exports = _setPrototypeOf;
|
|
|
|
| 7419 |
|
| 7420 |
+
/***/ }),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7421 |
|
| 7422 |
+
/***/ 163:
|
| 7423 |
+
/***/ (function(module, exports, __webpack_require__) {
|
| 7424 |
|
| 7425 |
+
"use strict";
|
|
|
|
|
|
|
|
|
|
| 7426 |
|
|
|
|
|
|
|
| 7427 |
|
| 7428 |
+
var utils = __webpack_require__(92);
|
| 7429 |
+
var formats = __webpack_require__(115);
|
| 7430 |
+
var has = Object.prototype.hasOwnProperty;
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7431 |
|
| 7432 |
+
var arrayPrefixGenerators = {
|
| 7433 |
+
brackets: function brackets(prefix) {
|
| 7434 |
+
return prefix + '[]';
|
| 7435 |
+
},
|
| 7436 |
+
comma: 'comma',
|
| 7437 |
+
indices: function indices(prefix, key) {
|
| 7438 |
+
return prefix + '[' + key + ']';
|
| 7439 |
+
},
|
| 7440 |
+
repeat: function repeat(prefix) {
|
| 7441 |
+
return prefix;
|
| 7442 |
+
}
|
| 7443 |
+
};
|
| 7444 |
|
| 7445 |
+
var isArray = Array.isArray;
|
| 7446 |
+
var push = Array.prototype.push;
|
| 7447 |
+
var pushToArray = function (arr, valueOrArray) {
|
| 7448 |
+
push.apply(arr, isArray(valueOrArray) ? valueOrArray : [valueOrArray]);
|
| 7449 |
+
};
|
| 7450 |
|
| 7451 |
+
var toISO = Date.prototype.toISOString;
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7452 |
|
| 7453 |
+
var defaultFormat = formats['default'];
|
| 7454 |
+
var defaults = {
|
| 7455 |
+
addQueryPrefix: false,
|
| 7456 |
+
allowDots: false,
|
| 7457 |
+
charset: 'utf-8',
|
| 7458 |
+
charsetSentinel: false,
|
| 7459 |
+
delimiter: '&',
|
| 7460 |
+
encode: true,
|
| 7461 |
+
encoder: utils.encode,
|
| 7462 |
+
encodeValuesOnly: false,
|
| 7463 |
+
format: defaultFormat,
|
| 7464 |
+
formatter: formats.formatters[defaultFormat],
|
| 7465 |
+
// deprecated
|
| 7466 |
+
indices: false,
|
| 7467 |
+
serializeDate: function serializeDate(date) {
|
| 7468 |
+
return toISO.call(date);
|
| 7469 |
+
},
|
| 7470 |
+
skipNulls: false,
|
| 7471 |
+
strictNullHandling: false
|
| 7472 |
+
};
|
| 7473 |
|
| 7474 |
+
var isNonNullishPrimitive = function isNonNullishPrimitive(v) {
|
| 7475 |
+
return typeof v === 'string'
|
| 7476 |
+
|| typeof v === 'number'
|
| 7477 |
+
|| typeof v === 'boolean'
|
| 7478 |
+
|| typeof v === 'symbol'
|
| 7479 |
+
|| typeof v === 'bigint';
|
| 7480 |
+
};
|
| 7481 |
|
| 7482 |
+
var stringify = function stringify(
|
| 7483 |
+
object,
|
| 7484 |
+
prefix,
|
| 7485 |
+
generateArrayPrefix,
|
| 7486 |
+
strictNullHandling,
|
| 7487 |
+
skipNulls,
|
| 7488 |
+
encoder,
|
| 7489 |
+
filter,
|
| 7490 |
+
sort,
|
| 7491 |
+
allowDots,
|
| 7492 |
+
serializeDate,
|
| 7493 |
+
formatter,
|
| 7494 |
+
encodeValuesOnly,
|
| 7495 |
+
charset
|
| 7496 |
+
) {
|
| 7497 |
+
var obj = object;
|
| 7498 |
+
if (typeof filter === 'function') {
|
| 7499 |
+
obj = filter(prefix, obj);
|
| 7500 |
+
} else if (obj instanceof Date) {
|
| 7501 |
+
obj = serializeDate(obj);
|
| 7502 |
+
} else if (generateArrayPrefix === 'comma' && isArray(obj)) {
|
| 7503 |
+
obj = utils.maybeMap(obj, function (value) {
|
| 7504 |
+
if (value instanceof Date) {
|
| 7505 |
+
return serializeDate(value);
|
| 7506 |
+
}
|
| 7507 |
+
return value;
|
| 7508 |
+
}).join(',');
|
| 7509 |
+
}
|
| 7510 |
|
| 7511 |
+
if (obj === null) {
|
| 7512 |
+
if (strictNullHandling) {
|
| 7513 |
+
return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder, charset, 'key') : prefix;
|
| 7514 |
+
}
|
|
|
|
|
|
|
|
|
|
| 7515 |
|
| 7516 |
+
obj = '';
|
| 7517 |
+
}
|
| 7518 |
|
| 7519 |
+
if (isNonNullishPrimitive(obj) || utils.isBuffer(obj)) {
|
| 7520 |
+
if (encoder) {
|
| 7521 |
+
var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder, charset, 'key');
|
| 7522 |
+
return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder, charset, 'value'))];
|
| 7523 |
+
}
|
| 7524 |
+
return [formatter(prefix) + '=' + formatter(String(obj))];
|
| 7525 |
+
}
|
| 7526 |
|
| 7527 |
+
var values = [];
|
| 7528 |
|
| 7529 |
+
if (typeof obj === 'undefined') {
|
| 7530 |
+
return values;
|
| 7531 |
+
}
|
| 7532 |
|
| 7533 |
+
var objKeys;
|
| 7534 |
+
if (isArray(filter)) {
|
| 7535 |
+
objKeys = filter;
|
| 7536 |
+
} else {
|
| 7537 |
+
var keys = Object.keys(obj);
|
| 7538 |
+
objKeys = sort ? keys.sort(sort) : keys;
|
| 7539 |
+
}
|
| 7540 |
|
| 7541 |
+
for (var i = 0; i < objKeys.length; ++i) {
|
| 7542 |
+
var key = objKeys[i];
|
| 7543 |
+
var value = obj[key];
|
| 7544 |
|
| 7545 |
+
if (skipNulls && value === null) {
|
| 7546 |
+
continue;
|
| 7547 |
+
}
|
| 7548 |
|
| 7549 |
+
var keyPrefix = isArray(obj)
|
| 7550 |
+
? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(prefix, key) : prefix
|
| 7551 |
+
: prefix + (allowDots ? '.' + key : '[' + key + ']');
|
| 7552 |
|
| 7553 |
+
pushToArray(values, stringify(
|
| 7554 |
+
value,
|
| 7555 |
+
keyPrefix,
|
| 7556 |
+
generateArrayPrefix,
|
| 7557 |
+
strictNullHandling,
|
| 7558 |
+
skipNulls,
|
| 7559 |
+
encoder,
|
| 7560 |
+
filter,
|
| 7561 |
+
sort,
|
| 7562 |
+
allowDots,
|
| 7563 |
+
serializeDate,
|
| 7564 |
+
formatter,
|
| 7565 |
+
encodeValuesOnly,
|
| 7566 |
+
charset
|
| 7567 |
+
));
|
| 7568 |
+
}
|
| 7569 |
|
| 7570 |
+
return values;
|
| 7571 |
+
};
|
| 7572 |
|
| 7573 |
+
var normalizeStringifyOptions = function normalizeStringifyOptions(opts) {
|
| 7574 |
+
if (!opts) {
|
| 7575 |
+
return defaults;
|
| 7576 |
}
|
|
|
|
| 7577 |
|
| 7578 |
+
if (opts.encoder !== null && opts.encoder !== undefined && typeof opts.encoder !== 'function') {
|
| 7579 |
+
throw new TypeError('Encoder has to be a function.');
|
| 7580 |
+
}
|
| 7581 |
|
| 7582 |
+
var charset = opts.charset || defaults.charset;
|
| 7583 |
+
if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {
|
| 7584 |
+
throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');
|
| 7585 |
+
}
|
|
|
|
| 7586 |
|
| 7587 |
+
var format = formats['default'];
|
| 7588 |
+
if (typeof opts.format !== 'undefined') {
|
| 7589 |
+
if (!has.call(formats.formatters, opts.format)) {
|
| 7590 |
+
throw new TypeError('Unknown format option provided.');
|
| 7591 |
+
}
|
| 7592 |
+
format = opts.format;
|
| 7593 |
+
}
|
| 7594 |
+
var formatter = formats.formatters[format];
|
| 7595 |
|
| 7596 |
+
var filter = defaults.filter;
|
| 7597 |
+
if (typeof opts.filter === 'function' || isArray(opts.filter)) {
|
| 7598 |
+
filter = opts.filter;
|
| 7599 |
+
}
|
| 7600 |
|
| 7601 |
+
return {
|
| 7602 |
+
addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults.addQueryPrefix,
|
| 7603 |
+
allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots,
|
| 7604 |
+
charset: charset,
|
| 7605 |
+
charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,
|
| 7606 |
+
delimiter: typeof opts.delimiter === 'undefined' ? defaults.delimiter : opts.delimiter,
|
| 7607 |
+
encode: typeof opts.encode === 'boolean' ? opts.encode : defaults.encode,
|
| 7608 |
+
encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults.encoder,
|
| 7609 |
+
encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults.encodeValuesOnly,
|
| 7610 |
+
filter: filter,
|
| 7611 |
+
formatter: formatter,
|
| 7612 |
+
serializeDate: typeof opts.serializeDate === 'function' ? opts.serializeDate : defaults.serializeDate,
|
| 7613 |
+
skipNulls: typeof opts.skipNulls === 'boolean' ? opts.skipNulls : defaults.skipNulls,
|
| 7614 |
+
sort: typeof opts.sort === 'function' ? opts.sort : null,
|
| 7615 |
+
strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling
|
| 7616 |
+
};
|
| 7617 |
};
|
| 7618 |
|
| 7619 |
+
module.exports = function (object, opts) {
|
| 7620 |
+
var obj = object;
|
| 7621 |
+
var options = normalizeStringifyOptions(opts);
|
| 7622 |
|
| 7623 |
+
var objKeys;
|
| 7624 |
+
var filter;
|
|
|
|
|
|
|
| 7625 |
|
| 7626 |
+
if (typeof options.filter === 'function') {
|
| 7627 |
+
filter = options.filter;
|
| 7628 |
+
obj = filter('', obj);
|
| 7629 |
+
} else if (isArray(options.filter)) {
|
| 7630 |
+
filter = options.filter;
|
| 7631 |
+
objKeys = filter;
|
| 7632 |
+
}
|
| 7633 |
|
| 7634 |
+
var keys = [];
|
|
|
|
|
|
|
| 7635 |
|
| 7636 |
+
if (typeof obj !== 'object' || obj === null) {
|
| 7637 |
+
return '';
|
| 7638 |
+
}
|
|
|
|
|
|
|
| 7639 |
|
| 7640 |
+
var arrayFormat;
|
| 7641 |
+
if (opts && opts.arrayFormat in arrayPrefixGenerators) {
|
| 7642 |
+
arrayFormat = opts.arrayFormat;
|
| 7643 |
+
} else if (opts && 'indices' in opts) {
|
| 7644 |
+
arrayFormat = opts.indices ? 'indices' : 'repeat';
|
| 7645 |
+
} else {
|
| 7646 |
+
arrayFormat = 'indices';
|
| 7647 |
+
}
|
| 7648 |
|
| 7649 |
+
var generateArrayPrefix = arrayPrefixGenerators[arrayFormat];
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7650 |
|
| 7651 |
+
if (!objKeys) {
|
| 7652 |
+
objKeys = Object.keys(obj);
|
| 7653 |
+
}
|
| 7654 |
|
| 7655 |
+
if (options.sort) {
|
| 7656 |
+
objKeys.sort(options.sort);
|
| 7657 |
+
}
|
| 7658 |
|
| 7659 |
+
for (var i = 0; i < objKeys.length; ++i) {
|
| 7660 |
+
var key = objKeys[i];
|
|
|
|
| 7661 |
|
| 7662 |
+
if (options.skipNulls && obj[key] === null) {
|
| 7663 |
+
continue;
|
| 7664 |
+
}
|
| 7665 |
+
pushToArray(keys, stringify(
|
| 7666 |
+
obj[key],
|
| 7667 |
+
key,
|
| 7668 |
+
generateArrayPrefix,
|
| 7669 |
+
options.strictNullHandling,
|
| 7670 |
+
options.skipNulls,
|
| 7671 |
+
options.encode ? options.encoder : null,
|
| 7672 |
+
options.filter,
|
| 7673 |
+
options.sort,
|
| 7674 |
+
options.allowDots,
|
| 7675 |
+
options.serializeDate,
|
| 7676 |
+
options.formatter,
|
| 7677 |
+
options.encodeValuesOnly,
|
| 7678 |
+
options.charset
|
| 7679 |
+
));
|
| 7680 |
+
}
|
| 7681 |
|
| 7682 |
+
var joined = keys.join(options.delimiter);
|
| 7683 |
+
var prefix = options.addQueryPrefix === true ? '?' : '';
|
| 7684 |
|
| 7685 |
+
if (options.charsetSentinel) {
|
| 7686 |
+
if (options.charset === 'iso-8859-1') {
|
| 7687 |
+
// encodeURIComponent('✓'), the "numeric entity" representation of a checkmark
|
| 7688 |
+
prefix += 'utf8=%26%2310003%3B&';
|
| 7689 |
+
} else {
|
| 7690 |
+
// encodeURIComponent('✓')
|
| 7691 |
+
prefix += 'utf8=%E2%9C%93&';
|
| 7692 |
+
}
|
| 7693 |
+
}
|
| 7694 |
|
| 7695 |
+
return joined.length > 0 ? prefix + joined : '';
|
| 7696 |
+
};
|
|
|
|
| 7697 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7698 |
|
| 7699 |
+
/***/ }),
|
|
|
|
| 7700 |
|
| 7701 |
+
/***/ 164:
|
| 7702 |
+
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
|
| 7703 |
|
| 7704 |
+
"use strict";
|
|
|
|
| 7705 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7706 |
|
| 7707 |
+
var utils = __webpack_require__(92);
|
| 7708 |
|
| 7709 |
+
var has = Object.prototype.hasOwnProperty;
|
| 7710 |
+
var isArray = Array.isArray;
|
|
|
|
|
|
|
|
|
|
| 7711 |
|
| 7712 |
+
var defaults = {
|
| 7713 |
+
allowDots: false,
|
| 7714 |
+
allowPrototypes: false,
|
| 7715 |
+
arrayLimit: 20,
|
| 7716 |
+
charset: 'utf-8',
|
| 7717 |
+
charsetSentinel: false,
|
| 7718 |
+
comma: false,
|
| 7719 |
+
decoder: utils.decode,
|
| 7720 |
+
delimiter: '&',
|
| 7721 |
+
depth: 5,
|
| 7722 |
+
ignoreQueryPrefix: false,
|
| 7723 |
+
interpretNumericEntities: false,
|
| 7724 |
+
parameterLimit: 1000,
|
| 7725 |
+
parseArrays: true,
|
| 7726 |
+
plainObjects: false,
|
| 7727 |
+
strictNullHandling: false
|
| 7728 |
+
};
|
| 7729 |
|
| 7730 |
+
var interpretNumericEntities = function (str) {
|
| 7731 |
+
return str.replace(/&#(\d+);/g, function ($0, numberStr) {
|
| 7732 |
+
return String.fromCharCode(parseInt(numberStr, 10));
|
| 7733 |
+
});
|
| 7734 |
+
};
|
| 7735 |
|
| 7736 |
+
var parseArrayValue = function (val, options) {
|
| 7737 |
+
if (val && typeof val === 'string' && options.comma && val.indexOf(',') > -1) {
|
| 7738 |
+
return val.split(',');
|
| 7739 |
+
}
|
| 7740 |
|
| 7741 |
+
return val;
|
|
|
|
| 7742 |
};
|
| 7743 |
|
| 7744 |
+
// This is what browsers will submit when the ✓ character occurs in an
|
| 7745 |
+
// application/x-www-form-urlencoded body and the encoding of the page containing
|
| 7746 |
+
// the form is iso-8859-1, or when the submitted form has an accept-charset
|
| 7747 |
+
// attribute of iso-8859-1. Presumably also with other charsets that do not contain
|
| 7748 |
+
// the ✓ character, such as us-ascii.
|
| 7749 |
+
var isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('✓')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7750 |
|
| 7751 |
+
// These are the percent-encoded utf-8 octets representing a checkmark, indicating that the request actually is utf-8 encoded.
|
| 7752 |
+
var charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓')
|
|
|
|
|
|
|
| 7753 |
|
| 7754 |
+
var parseValues = function parseQueryStringValues(str, options) {
|
| 7755 |
+
var obj = {};
|
| 7756 |
+
var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str;
|
| 7757 |
+
var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;
|
| 7758 |
+
var parts = cleanStr.split(options.delimiter, limit);
|
| 7759 |
+
var skipIndex = -1; // Keep track of where the utf8 sentinel was found
|
| 7760 |
+
var i;
|
|
|
|
| 7761 |
|
| 7762 |
+
var charset = options.charset;
|
| 7763 |
+
if (options.charsetSentinel) {
|
| 7764 |
+
for (i = 0; i < parts.length; ++i) {
|
| 7765 |
+
if (parts[i].indexOf('utf8=') === 0) {
|
| 7766 |
+
if (parts[i] === charsetSentinel) {
|
| 7767 |
+
charset = 'utf-8';
|
| 7768 |
+
} else if (parts[i] === isoSentinel) {
|
| 7769 |
+
charset = 'iso-8859-1';
|
| 7770 |
+
}
|
| 7771 |
+
skipIndex = i;
|
| 7772 |
+
i = parts.length; // The eslint settings do not allow break;
|
| 7773 |
+
}
|
| 7774 |
+
}
|
| 7775 |
+
}
|
| 7776 |
|
| 7777 |
+
for (i = 0; i < parts.length; ++i) {
|
| 7778 |
+
if (i === skipIndex) {
|
| 7779 |
+
continue;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7780 |
}
|
| 7781 |
+
var part = parts[i];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7782 |
|
| 7783 |
+
var bracketEqualsPos = part.indexOf(']=');
|
| 7784 |
+
var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7785 |
|
| 7786 |
+
var key, val;
|
| 7787 |
+
if (pos === -1) {
|
| 7788 |
+
key = options.decoder(part, defaults.decoder, charset, 'key');
|
| 7789 |
+
val = options.strictNullHandling ? null : '';
|
| 7790 |
+
} else {
|
| 7791 |
+
key = options.decoder(part.slice(0, pos), defaults.decoder, charset, 'key');
|
| 7792 |
+
val = utils.maybeMap(
|
| 7793 |
+
parseArrayValue(part.slice(pos + 1), options),
|
| 7794 |
+
function (encodedVal) {
|
| 7795 |
+
return options.decoder(encodedVal, defaults.decoder, charset, 'value');
|
| 7796 |
+
}
|
| 7797 |
+
);
|
| 7798 |
+
}
|
| 7799 |
|
| 7800 |
+
if (val && options.interpretNumericEntities && charset === 'iso-8859-1') {
|
| 7801 |
+
val = interpretNumericEntities(val);
|
| 7802 |
+
}
|
| 7803 |
|
| 7804 |
+
if (part.indexOf('[]=') > -1) {
|
| 7805 |
+
val = isArray(val) ? [val] : val;
|
| 7806 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7807 |
|
| 7808 |
+
if (has.call(obj, key)) {
|
| 7809 |
+
obj[key] = utils.combine(obj[key], val);
|
| 7810 |
+
} else {
|
| 7811 |
+
obj[key] = val;
|
| 7812 |
+
}
|
| 7813 |
+
}
|
| 7814 |
|
| 7815 |
+
return obj;
|
| 7816 |
+
};
|
|
|
|
| 7817 |
|
| 7818 |
+
var parseObject = function (chain, val, options, valuesParsed) {
|
| 7819 |
+
var leaf = valuesParsed ? val : parseArrayValue(val, options);
|
|
|
|
|
|
|
|
|
|
| 7820 |
|
| 7821 |
+
for (var i = chain.length - 1; i >= 0; --i) {
|
| 7822 |
+
var obj;
|
| 7823 |
+
var root = chain[i];
|
| 7824 |
|
| 7825 |
+
if (root === '[]' && options.parseArrays) {
|
| 7826 |
+
obj = [].concat(leaf);
|
| 7827 |
+
} else {
|
| 7828 |
+
obj = options.plainObjects ? Object.create(null) : {};
|
| 7829 |
+
var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;
|
| 7830 |
+
var index = parseInt(cleanRoot, 10);
|
| 7831 |
+
if (!options.parseArrays && cleanRoot === '') {
|
| 7832 |
+
obj = { 0: leaf };
|
| 7833 |
+
} else if (
|
| 7834 |
+
!isNaN(index)
|
| 7835 |
+
&& root !== cleanRoot
|
| 7836 |
+
&& String(index) === cleanRoot
|
| 7837 |
+
&& index >= 0
|
| 7838 |
+
&& (options.parseArrays && index <= options.arrayLimit)
|
| 7839 |
+
) {
|
| 7840 |
+
obj = [];
|
| 7841 |
+
obj[index] = leaf;
|
| 7842 |
+
} else {
|
| 7843 |
+
obj[cleanRoot] = leaf;
|
| 7844 |
+
}
|
| 7845 |
+
}
|
| 7846 |
|
| 7847 |
+
leaf = obj; // eslint-disable-line no-param-reassign
|
| 7848 |
+
}
|
|
|
|
|
|
|
| 7849 |
|
| 7850 |
+
return leaf;
|
| 7851 |
+
};
|
|
|
|
| 7852 |
|
| 7853 |
+
var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) {
|
| 7854 |
+
if (!givenKey) {
|
| 7855 |
+
return;
|
| 7856 |
+
}
|
| 7857 |
|
| 7858 |
+
// Transform dot notation to bracket notation
|
| 7859 |
+
var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey;
|
|
|
|
| 7860 |
|
| 7861 |
+
// The regex chunks
|
|
|
|
| 7862 |
|
| 7863 |
+
var brackets = /(\[[^[\]]*])/;
|
| 7864 |
+
var child = /(\[[^[\]]*])/g;
|
|
|
|
|
|
|
| 7865 |
|
| 7866 |
+
// Get the parent
|
|
|
|
| 7867 |
|
| 7868 |
+
var segment = options.depth > 0 && brackets.exec(key);
|
| 7869 |
+
var parent = segment ? key.slice(0, segment.index) : key;
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7870 |
|
| 7871 |
+
// Stash the parent if it exists
|
| 7872 |
|
| 7873 |
+
var keys = [];
|
| 7874 |
+
if (parent) {
|
| 7875 |
+
// If we aren't using plain objects, optionally prefix keys that would overwrite object prototype properties
|
| 7876 |
+
if (!options.plainObjects && has.call(Object.prototype, parent)) {
|
| 7877 |
+
if (!options.allowPrototypes) {
|
| 7878 |
+
return;
|
| 7879 |
+
}
|
| 7880 |
+
}
|
| 7881 |
|
| 7882 |
+
keys.push(parent);
|
|
|
|
| 7883 |
}
|
| 7884 |
|
| 7885 |
+
// Loop through children appending to the array until we hit depth
|
| 7886 |
+
|
| 7887 |
+
var i = 0;
|
| 7888 |
+
while (options.depth > 0 && (segment = child.exec(key)) !== null && i < options.depth) {
|
| 7889 |
+
i += 1;
|
| 7890 |
+
if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) {
|
| 7891 |
+
if (!options.allowPrototypes) {
|
| 7892 |
+
return;
|
| 7893 |
+
}
|
| 7894 |
+
}
|
| 7895 |
+
keys.push(segment[1]);
|
| 7896 |
}
|
|
|
|
| 7897 |
|
| 7898 |
+
// If there's a remainder, just add whatever is left
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7899 |
|
| 7900 |
+
if (segment) {
|
| 7901 |
+
keys.push('[' + key.slice(segment.index) + ']');
|
| 7902 |
+
}
|
| 7903 |
|
| 7904 |
+
return parseObject(keys, val, options, valuesParsed);
|
| 7905 |
+
};
|
| 7906 |
|
| 7907 |
+
var normalizeParseOptions = function normalizeParseOptions(opts) {
|
| 7908 |
+
if (!opts) {
|
| 7909 |
+
return defaults;
|
| 7910 |
+
}
|
| 7911 |
|
| 7912 |
+
if (opts.decoder !== null && opts.decoder !== undefined && typeof opts.decoder !== 'function') {
|
| 7913 |
+
throw new TypeError('Decoder has to be a function.');
|
| 7914 |
+
}
|
|
|
|
|
|
|
| 7915 |
|
| 7916 |
+
if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {
|
| 7917 |
+
throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');
|
| 7918 |
+
}
|
| 7919 |
+
var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7920 |
|
| 7921 |
+
return {
|
| 7922 |
+
allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots,
|
| 7923 |
+
allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes,
|
| 7924 |
+
arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit,
|
| 7925 |
+
charset: charset,
|
| 7926 |
+
charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,
|
| 7927 |
+
comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma,
|
| 7928 |
+
decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder,
|
| 7929 |
+
delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter,
|
| 7930 |
+
// eslint-disable-next-line no-implicit-coercion, no-extra-parens
|
| 7931 |
+
depth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults.depth,
|
| 7932 |
+
ignoreQueryPrefix: opts.ignoreQueryPrefix === true,
|
| 7933 |
+
interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities,
|
| 7934 |
+
parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit,
|
| 7935 |
+
parseArrays: opts.parseArrays !== false,
|
| 7936 |
+
plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects,
|
| 7937 |
+
strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling
|
| 7938 |
};
|
| 7939 |
+
};
|
| 7940 |
|
| 7941 |
+
module.exports = function (str, opts) {
|
| 7942 |
+
var options = normalizeParseOptions(opts);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7943 |
|
| 7944 |
+
if (str === '' || str === null || typeof str === 'undefined') {
|
| 7945 |
+
return options.plainObjects ? Object.create(null) : {};
|
| 7946 |
+
}
|
| 7947 |
|
| 7948 |
+
var tempObj = typeof str === 'string' ? parseValues(str, options) : str;
|
| 7949 |
+
var obj = options.plainObjects ? Object.create(null) : {};
|
|
|
|
|
|
|
|
|
|
| 7950 |
|
| 7951 |
+
// Iterate over the keys and setup the new object
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7952 |
|
| 7953 |
+
var keys = Object.keys(tempObj);
|
| 7954 |
+
for (var i = 0; i < keys.length; ++i) {
|
| 7955 |
+
var key = keys[i];
|
| 7956 |
+
var newObj = parseKeys(key, tempObj[key], options, typeof str === 'string');
|
| 7957 |
+
obj = utils.merge(obj, newObj, options);
|
| 7958 |
+
}
|
| 7959 |
|
| 7960 |
+
return utils.compact(obj);
|
| 7961 |
+
};
|
|
|
|
|
|
|
|
|
|
| 7962 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7963 |
|
| 7964 |
+
/***/ }),
|
| 7965 |
|
| 7966 |
+
/***/ 17:
|
| 7967 |
+
/***/ (function(module, exports) {
|
|
|
|
| 7968 |
|
| 7969 |
+
function _classCallCheck(instance, Constructor) {
|
| 7970 |
+
if (!(instance instanceof Constructor)) {
|
| 7971 |
+
throw new TypeError("Cannot call a class as a function");
|
| 7972 |
}
|
| 7973 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7974 |
|
| 7975 |
+
module.exports = _classCallCheck;
|
|
|
|
|
|
|
| 7976 |
|
| 7977 |
+
/***/ }),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7978 |
|
| 7979 |
+
/***/ 18:
|
| 7980 |
+
/***/ (function(module, exports, __webpack_require__) {
|
| 7981 |
|
| 7982 |
+
var setPrototypeOf = __webpack_require__(162);
|
|
|
|
|
|
|
| 7983 |
|
| 7984 |
+
function _inherits(subClass, superClass) {
|
| 7985 |
+
if (typeof superClass !== "function" && superClass !== null) {
|
| 7986 |
+
throw new TypeError("Super expression must either be null or a function");
|
| 7987 |
+
}
|
| 7988 |
|
| 7989 |
+
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
| 7990 |
+
constructor: {
|
| 7991 |
+
value: subClass,
|
| 7992 |
+
writable: true,
|
| 7993 |
+
configurable: true
|
| 7994 |
+
}
|
| 7995 |
+
});
|
| 7996 |
+
if (superClass) setPrototypeOf(subClass, superClass);
|
| 7997 |
+
}
|
| 7998 |
|
| 7999 |
+
module.exports = _inherits;
|
|
|
|
| 8000 |
|
| 8001 |
+
/***/ }),
|
| 8002 |
|
| 8003 |
+
/***/ 189:
|
| 8004 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
| 8005 |
|
| 8006 |
+
"use strict";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8007 |
|
| 8008 |
+
// EXPORTS
|
| 8009 |
+
__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ speak; });
|
| 8010 |
|
| 8011 |
+
// UNUSED EXPORTS: setup
|
|
|
|
| 8012 |
|
| 8013 |
+
// EXTERNAL MODULE: ./node_modules/@wordpress/dom-ready/build-module/index.js
|
| 8014 |
+
var build_module = __webpack_require__(86);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8015 |
|
| 8016 |
+
// EXTERNAL MODULE: external {"this":["wp","i18n"]}
|
| 8017 |
+
var external_this_wp_i18n_ = __webpack_require__(3);
|
|
|
|
|
|
|
|
|
|
| 8018 |
|
| 8019 |
+
// CONCATENATED MODULE: ./node_modules/@wordpress/a11y/build-module/add-intro-text.js
|
| 8020 |
+
/**
|
| 8021 |
+
* WordPress dependencies
|
| 8022 |
+
*/
|
| 8023 |
|
| 8024 |
+
/**
|
| 8025 |
+
* Build the explanatory text to be placed before the aria live regions.
|
| 8026 |
+
*
|
| 8027 |
+
* This text is initially hidden from assistive technologies by using a `hidden`
|
| 8028 |
+
* HTML attribute which is then removed once a message fills the aria-live regions.
|
| 8029 |
+
*
|
| 8030 |
+
* @return {HTMLParagraphElement} The explanatory text HTML element.
|
| 8031 |
+
*/
|
| 8032 |
|
| 8033 |
+
function addIntroText() {
|
| 8034 |
+
var introText = document.createElement('p');
|
| 8035 |
+
introText.id = 'a11y-speak-intro-text';
|
| 8036 |
+
introText.className = 'a11y-speak-intro-text';
|
| 8037 |
+
introText.textContent = Object(external_this_wp_i18n_["__"])('Notifications');
|
| 8038 |
+
introText.setAttribute('style', 'position: absolute;' + 'margin: -1px;' + 'padding: 0;' + 'height: 1px;' + 'width: 1px;' + 'overflow: hidden;' + 'clip: rect(1px, 1px, 1px, 1px);' + '-webkit-clip-path: inset(50%);' + 'clip-path: inset(50%);' + 'border: 0;' + 'word-wrap: normal !important;');
|
| 8039 |
+
introText.setAttribute('hidden', 'hidden');
|
| 8040 |
+
var _document = document,
|
| 8041 |
+
body = _document.body;
|
| 8042 |
|
| 8043 |
+
if (body) {
|
| 8044 |
+
body.appendChild(introText);
|
| 8045 |
+
}
|
| 8046 |
|
| 8047 |
+
return introText;
|
| 8048 |
+
}
|
| 8049 |
+
//# sourceMappingURL=add-intro-text.js.map
|
| 8050 |
+
// CONCATENATED MODULE: ./node_modules/@wordpress/a11y/build-module/add-container.js
|
| 8051 |
+
/**
|
| 8052 |
+
* Build the live regions markup.
|
| 8053 |
+
*
|
| 8054 |
+
* @param {string} [ariaLive] Value for the 'aria-live' attribute; default: 'polite'.
|
| 8055 |
+
*
|
| 8056 |
+
* @return {HTMLDivElement} The ARIA live region HTML element.
|
| 8057 |
+
*/
|
| 8058 |
+
function addContainer() {
|
| 8059 |
+
var ariaLive = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'polite';
|
| 8060 |
+
var container = document.createElement('div');
|
| 8061 |
+
container.id = "a11y-speak-".concat(ariaLive);
|
| 8062 |
+
container.className = 'a11y-speak-region';
|
| 8063 |
+
container.setAttribute('style', 'position: absolute;' + 'margin: -1px;' + 'padding: 0;' + 'height: 1px;' + 'width: 1px;' + 'overflow: hidden;' + 'clip: rect(1px, 1px, 1px, 1px);' + '-webkit-clip-path: inset(50%);' + 'clip-path: inset(50%);' + 'border: 0;' + 'word-wrap: normal !important;');
|
| 8064 |
+
container.setAttribute('aria-live', ariaLive);
|
| 8065 |
+
container.setAttribute('aria-relevant', 'additions text');
|
| 8066 |
+
container.setAttribute('aria-atomic', 'true');
|
| 8067 |
+
var _document = document,
|
| 8068 |
+
body = _document.body;
|
| 8069 |
|
| 8070 |
+
if (body) {
|
| 8071 |
+
body.appendChild(container);
|
| 8072 |
+
}
|
| 8073 |
|
| 8074 |
+
return container;
|
| 8075 |
+
}
|
| 8076 |
+
//# sourceMappingURL=add-container.js.map
|
| 8077 |
+
// CONCATENATED MODULE: ./node_modules/@wordpress/a11y/build-module/clear.js
|
| 8078 |
+
/**
|
| 8079 |
+
* Clears the a11y-speak-region elements and hides the explanatory text.
|
| 8080 |
+
*/
|
| 8081 |
+
function clear() {
|
| 8082 |
+
var regions = document.getElementsByClassName('a11y-speak-region');
|
| 8083 |
+
var introText = document.getElementById('a11y-speak-intro-text');
|
| 8084 |
|
| 8085 |
+
for (var i = 0; i < regions.length; i++) {
|
| 8086 |
+
regions[i].textContent = '';
|
| 8087 |
+
} // Make sure the explanatory text is hidden from assistive technologies.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8088 |
|
|
|
|
|
|
|
| 8089 |
|
| 8090 |
+
if (introText) {
|
| 8091 |
+
introText.setAttribute('hidden', 'hidden');
|
| 8092 |
+
}
|
| 8093 |
+
}
|
| 8094 |
+
//# sourceMappingURL=clear.js.map
|
| 8095 |
+
// CONCATENATED MODULE: ./node_modules/@wordpress/a11y/build-module/filter-message.js
|
| 8096 |
+
var previousMessage = '';
|
| 8097 |
+
/**
|
| 8098 |
+
* Filter the message to be announced to the screenreader.
|
| 8099 |
+
*
|
| 8100 |
+
* @param {string} message The message to be announced.
|
| 8101 |
+
*
|
| 8102 |
+
* @return {string} The filtered message.
|
| 8103 |
+
*/
|
| 8104 |
|
| 8105 |
+
function filterMessage(message) {
|
| 8106 |
+
/*
|
| 8107 |
+
* Strip HTML tags (if any) from the message string. Ideally, messages should
|
| 8108 |
+
* be simple strings, carefully crafted for specific use with A11ySpeak.
|
| 8109 |
+
* When re-using already existing strings this will ensure simple HTML to be
|
| 8110 |
+
* stripped out and replaced with a space. Browsers will collapse multiple
|
| 8111 |
+
* spaces natively.
|
| 8112 |
+
*/
|
| 8113 |
+
message = message.replace(/<[^<>]+>/g, ' ');
|
| 8114 |
+
/*
|
| 8115 |
+
* Safari + VoiceOver don't announce repeated, identical strings. We use
|
| 8116 |
+
* a `no-break space` to force them to think identical strings are different.
|
| 8117 |
+
*/
|
| 8118 |
|
| 8119 |
+
if (previousMessage === message) {
|
| 8120 |
+
message += "\xA0";
|
| 8121 |
+
}
|
| 8122 |
|
| 8123 |
+
previousMessage = message;
|
| 8124 |
+
return message;
|
| 8125 |
+
}
|
| 8126 |
+
//# sourceMappingURL=filter-message.js.map
|
| 8127 |
+
// CONCATENATED MODULE: ./node_modules/@wordpress/a11y/build-module/index.js
|
| 8128 |
+
/**
|
| 8129 |
+
* WordPress dependencies
|
| 8130 |
+
*/
|
| 8131 |
|
| 8132 |
+
/**
|
| 8133 |
+
* Internal dependencies
|
| 8134 |
+
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8135 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8136 |
|
| 8137 |
|
|
|
|
|
|
|
| 8138 |
|
|
|
|
| 8139 |
|
| 8140 |
+
/**
|
| 8141 |
+
* Create the live regions.
|
| 8142 |
+
*/
|
|
|
|
|
|
|
| 8143 |
|
| 8144 |
+
function setup() {
|
| 8145 |
+
var introText = document.getElementById('a11y-speak-intro-text');
|
| 8146 |
+
var containerAssertive = document.getElementById('a11y-speak-assertive');
|
| 8147 |
+
var containerPolite = document.getElementById('a11y-speak-polite');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8148 |
|
| 8149 |
+
if (introText === null) {
|
| 8150 |
+
addIntroText();
|
| 8151 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8152 |
|
| 8153 |
+
if (containerAssertive === null) {
|
| 8154 |
+
addContainer('assertive');
|
| 8155 |
+
}
|
| 8156 |
|
| 8157 |
+
if (containerPolite === null) {
|
| 8158 |
+
addContainer('polite');
|
| 8159 |
+
}
|
| 8160 |
+
}
|
| 8161 |
+
/**
|
| 8162 |
+
* Run setup on domReady.
|
| 8163 |
+
*/
|
| 8164 |
|
| 8165 |
+
Object(build_module["a" /* default */])(setup);
|
| 8166 |
+
/**
|
| 8167 |
+
* Allows you to easily announce dynamic interface updates to screen readers using ARIA live regions.
|
| 8168 |
+
* This module is inspired by the `speak` function in `wp-a11y.js`.
|
| 8169 |
+
*
|
| 8170 |
+
* @param {string} message The message to be announced by assistive technologies.
|
| 8171 |
+
* @param {string} [ariaLive] The politeness level for aria-live; default: 'polite'.
|
| 8172 |
+
*
|
| 8173 |
+
* @example
|
| 8174 |
+
* ```js
|
| 8175 |
+
* import { speak } from '@wordpress/a11y';
|
| 8176 |
+
*
|
| 8177 |
+
* // For polite messages that shouldn't interrupt what screen readers are currently announcing.
|
| 8178 |
+
* speak( 'The message you want to send to the ARIA live region' );
|
| 8179 |
+
*
|
| 8180 |
+
* // For assertive messages that should interrupt what screen readers are currently announcing.
|
| 8181 |
+
* speak( 'The message you want to send to the ARIA live region', 'assertive' );
|
| 8182 |
+
* ```
|
| 8183 |
+
*/
|
| 8184 |
|
| 8185 |
+
function speak(message, ariaLive) {
|
| 8186 |
+
/*
|
| 8187 |
+
* Clear previous messages to allow repeated strings being read out and hide
|
| 8188 |
+
* the explanatory text from assistive technologies.
|
| 8189 |
+
*/
|
| 8190 |
+
clear();
|
| 8191 |
+
message = filterMessage(message);
|
| 8192 |
+
var introText = document.getElementById('a11y-speak-intro-text');
|
| 8193 |
+
var containerAssertive = document.getElementById('a11y-speak-assertive');
|
| 8194 |
+
var containerPolite = document.getElementById('a11y-speak-polite');
|
| 8195 |
|
| 8196 |
+
if (containerAssertive && ariaLive === 'assertive') {
|
| 8197 |
+
containerAssertive.textContent = message;
|
| 8198 |
+
} else if (containerPolite) {
|
| 8199 |
+
containerPolite.textContent = message;
|
| 8200 |
+
}
|
| 8201 |
+
/*
|
| 8202 |
+
* Make the explanatory text available to assistive technologies by removing
|
| 8203 |
+
* the 'hidden' HTML attribute.
|
| 8204 |
+
*/
|
| 8205 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8206 |
|
| 8207 |
+
if (introText) {
|
| 8208 |
+
introText.removeAttribute('hidden');
|
| 8209 |
+
}
|
| 8210 |
+
}
|
| 8211 |
+
//# sourceMappingURL=index.js.map
|
| 8212 |
|
| 8213 |
+
/***/ }),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8214 |
|
| 8215 |
+
/***/ 19:
|
| 8216 |
+
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8217 |
|
| 8218 |
+
var _typeof = __webpack_require__(48);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8219 |
|
| 8220 |
+
var assertThisInitialized = __webpack_require__(11);
|
|
|
|
|
|
|
| 8221 |
|
| 8222 |
+
function _possibleConstructorReturn(self, call) {
|
| 8223 |
+
if (call && (_typeof(call) === "object" || typeof call === "function")) {
|
| 8224 |
+
return call;
|
| 8225 |
+
}
|
|
|
|
| 8226 |
|
| 8227 |
+
return assertThisInitialized(self);
|
| 8228 |
+
}
|
|
|
|
|
|
|
|
|
|
| 8229 |
|
| 8230 |
+
module.exports = _possibleConstructorReturn;
|
|
|
|
| 8231 |
|
| 8232 |
+
/***/ }),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8233 |
|
| 8234 |
+
/***/ 190:
|
| 8235 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
| 8236 |
|
| 8237 |
+
"use strict";
|
|
|
|
|
|
|
|
|
|
| 8238 |
|
| 8239 |
+
// EXTERNAL MODULE: ./node_modules/@emotion/styled-base/dist/styled-base.browser.esm.js + 1 modules
|
| 8240 |
+
var styled_base_browser_esm = __webpack_require__(41);
|
|
|
|
|
|
|
| 8241 |
|
| 8242 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/taggedTemplateLiteral.js
|
| 8243 |
+
var taggedTemplateLiteral = __webpack_require__(51);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8244 |
|
| 8245 |
+
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/text/styles/font-family.js
|
| 8246 |
+
var fontFamily = "font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto,\nOxygen-Sans, Ubuntu, Cantarell, \"Helvetica Neue\", sans-serif;";
|
| 8247 |
+
//# sourceMappingURL=font-family.js.map
|
| 8248 |
+
// EXTERNAL MODULE: ./node_modules/@emotion/core/dist/core.browser.esm.js + 6 modules
|
| 8249 |
+
var core_browser_esm = __webpack_require__(67);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8250 |
|
| 8251 |
+
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/text/styles/emotion-css.js
|
| 8252 |
+
/**
|
| 8253 |
+
* External dependencies
|
| 8254 |
+
*/
|
| 8255 |
|
| 8256 |
+
/* harmony default export */ var emotion_css = (core_browser_esm["b" /* css */]);
|
| 8257 |
+
//# sourceMappingURL=emotion-css.js.map
|
| 8258 |
+
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/text/styles/text-mixins.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8259 |
|
|
|
|
|
|
|
|
|
|
| 8260 |
|
| 8261 |
+
function _templateObject9() {
|
| 8262 |
+
var data = Object(taggedTemplateLiteral["a" /* default */])(["\n\t", "\n\t", "\n"]);
|
| 8263 |
|
| 8264 |
+
_templateObject9 = function _templateObject9() {
|
| 8265 |
+
return data;
|
| 8266 |
+
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8267 |
|
| 8268 |
+
return data;
|
| 8269 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8270 |
|
| 8271 |
+
function _templateObject8() {
|
| 8272 |
+
var data = Object(taggedTemplateLiteral["a" /* default */])(["\n\t\t\t\t", "\n\t\t\t\t", "\n\t\t\t"]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8273 |
|
| 8274 |
+
_templateObject8 = function _templateObject8() {
|
| 8275 |
+
return data;
|
| 8276 |
+
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8277 |
|
| 8278 |
+
return data;
|
| 8279 |
+
}
|
|
|
|
|
|
|
| 8280 |
|
| 8281 |
+
function _templateObject7() {
|
| 8282 |
+
var data = Object(taggedTemplateLiteral["a" /* default */])(["\n\t\t\t\t", "\n\t\t\t\t", "\n\t\t\t"]);
|
| 8283 |
|
| 8284 |
+
_templateObject7 = function _templateObject7() {
|
| 8285 |
+
return data;
|
| 8286 |
+
};
|
|
|
|
| 8287 |
|
| 8288 |
+
return data;
|
| 8289 |
+
}
|
| 8290 |
|
| 8291 |
+
function _templateObject6() {
|
| 8292 |
+
var data = Object(taggedTemplateLiteral["a" /* default */])(["\n\t\t\t\t", "\n\t\t\t"]);
|
|
|
|
|
|
|
| 8293 |
|
| 8294 |
+
_templateObject6 = function _templateObject6() {
|
| 8295 |
+
return data;
|
| 8296 |
+
};
|
|
|
|
|
|
|
| 8297 |
|
| 8298 |
+
return data;
|
| 8299 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8300 |
|
| 8301 |
+
function _templateObject5() {
|
| 8302 |
+
var data = Object(taggedTemplateLiteral["a" /* default */])(["\n\t\t\t\t", "\n\t\t\t\t", "\n\t\t\t"]);
|
| 8303 |
|
| 8304 |
+
_templateObject5 = function _templateObject5() {
|
| 8305 |
+
return data;
|
| 8306 |
+
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8307 |
|
| 8308 |
+
return data;
|
| 8309 |
+
}
|
|
|
|
| 8310 |
|
| 8311 |
+
function _templateObject4() {
|
| 8312 |
+
var data = Object(taggedTemplateLiteral["a" /* default */])(["\n\t\t\t\t", "\n\t\t\t\t", "\n\t\t\t"]);
|
|
|
|
|
|
|
|
|
|
| 8313 |
|
| 8314 |
+
_templateObject4 = function _templateObject4() {
|
| 8315 |
+
return data;
|
| 8316 |
+
};
|
|
|
|
| 8317 |
|
| 8318 |
+
return data;
|
| 8319 |
+
}
|
|
|
|
|
|
|
| 8320 |
|
| 8321 |
+
function _templateObject3() {
|
| 8322 |
+
var data = Object(taggedTemplateLiteral["a" /* default */])(["\n\t\t\t\t", "\n\t\t\t\t", "\n\t\t\t"]);
|
|
|
|
| 8323 |
|
| 8324 |
+
_templateObject3 = function _templateObject3() {
|
| 8325 |
+
return data;
|
| 8326 |
+
};
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8327 |
|
| 8328 |
+
return data;
|
| 8329 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8330 |
|
| 8331 |
+
function _templateObject2() {
|
| 8332 |
+
var data = Object(taggedTemplateLiteral["a" /* default */])(["\n\t\t\t\t", "\n\t\t\t\t", "\n\t\t\t"]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8333 |
|
| 8334 |
+
_templateObject2 = function _templateObject2() {
|
| 8335 |
+
return data;
|
| 8336 |
+
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8337 |
|
| 8338 |
+
return data;
|
| 8339 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8340 |
|
| 8341 |
+
function _templateObject() {
|
| 8342 |
+
var data = Object(taggedTemplateLiteral["a" /* default */])(["\n\t\t\t\t", "\n\t\t\t\t", "\n\t\t\t"]);
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8343 |
|
| 8344 |
+
_templateObject = function _templateObject() {
|
| 8345 |
+
return data;
|
| 8346 |
+
};
|
| 8347 |
|
| 8348 |
+
return data;
|
| 8349 |
+
}
|
| 8350 |
|
| 8351 |
+
/**
|
| 8352 |
+
* Internal dependencies
|
| 8353 |
+
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8354 |
|
|
|
|
| 8355 |
|
| 8356 |
+
var fontWeightNormal = "font-weight: 400;";
|
| 8357 |
+
var fontWeightSemibold = "font-weight: 600;";
|
| 8358 |
+
var title = "\n ".concat(fontWeightNormal, "\n");
|
| 8359 |
+
var titleLarge = "\n\tfont-size: 32px;\n\tline-height: 40px;\n";
|
| 8360 |
+
var titleMedium = "\n\tfont-size: 24px;\n\tline-height: 32px;\n";
|
| 8361 |
+
var titleSmall = "\n\tfont-size: 20px;\n\tline-height: 28px;\n";
|
| 8362 |
+
var subtitle = "\n\t".concat(fontWeightSemibold, "\n\tfont-size: 14px;\n\tline-height: 20px;\n");
|
| 8363 |
+
var subtitleLarge = "\n\tfont-size: 16px;\n\tline-height: 24px;\n";
|
| 8364 |
+
var subtitleSmall = "\n\tfont-size: 14px;\n\tline-height: 20px;\n";
|
| 8365 |
+
var body = "\n\t".concat(fontWeightNormal, "\n");
|
| 8366 |
+
var bodyLarge = "\n\tfont-size: 16px;\n\tline-height: 24px;\n";
|
| 8367 |
+
var bodySmall = "\n\tfont-size: 14px;\n\tline-height: 20px;\n";
|
| 8368 |
+
var text_mixins_button = "\n ".concat(fontWeightSemibold, "\n font-size: 14px;\n line-height: 20px;\n");
|
| 8369 |
+
var caption = "\n\t".concat(fontWeightNormal, "\n\tfont-size: 12px;\n\tline-height: 16px;\n");
|
| 8370 |
+
var label = "\n\t".concat(fontWeightSemibold, "\n\tfont-size: 12px;\n\tline-height: 16px;\n");
|
| 8371 |
+
/**
|
| 8372 |
+
* @typedef {'title.large'|'title.medium'|'title.small'|'subtitle'|'subtitle.small'|'body'|'body.large'|'body.small'|'button'|'caption'|'label'} TextVariant
|
| 8373 |
+
*/
|
| 8374 |
|
| 8375 |
+
/**
|
| 8376 |
+
* @param {TextVariant} variantName
|
| 8377 |
+
*/
|
| 8378 |
|
| 8379 |
+
var text_mixins_variant = function variant() {
|
| 8380 |
+
var variantName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'body';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8381 |
|
| 8382 |
+
switch (variantName) {
|
| 8383 |
+
case 'title.large':
|
| 8384 |
+
return emotion_css(_templateObject(), title, titleLarge);
|
| 8385 |
|
| 8386 |
+
case 'title.medium':
|
| 8387 |
+
return emotion_css(_templateObject2(), title, titleMedium);
|
|
|
|
|
|
|
| 8388 |
|
| 8389 |
+
case 'title.small':
|
| 8390 |
+
return emotion_css(_templateObject3(), title, titleSmall);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8391 |
|
| 8392 |
+
case 'subtitle':
|
| 8393 |
+
return emotion_css(_templateObject4(), subtitle, subtitleLarge);
|
| 8394 |
|
| 8395 |
+
case 'subtitle.small':
|
| 8396 |
+
return emotion_css(_templateObject5(), subtitle, subtitleSmall);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8397 |
|
| 8398 |
+
case 'body':
|
| 8399 |
+
return emotion_css(_templateObject6(), body);
|
| 8400 |
|
| 8401 |
+
case 'body.large':
|
| 8402 |
+
return emotion_css(_templateObject7(), body, bodyLarge);
|
|
|
|
| 8403 |
|
| 8404 |
+
case 'body.small':
|
| 8405 |
+
return emotion_css(_templateObject8(), body, bodySmall);
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8406 |
|
| 8407 |
+
case 'button':
|
| 8408 |
+
return text_mixins_button;
|
| 8409 |
|
| 8410 |
+
case 'caption':
|
| 8411 |
+
return caption;
|
| 8412 |
|
| 8413 |
+
case 'label':
|
| 8414 |
+
return label;
|
| 8415 |
}
|
| 8416 |
+
};
|
| 8417 |
+
/**
|
| 8418 |
+
* @typedef {Object} TextProps
|
| 8419 |
+
* @property {TextVariant} variant one of TextVariant to be used
|
| 8420 |
+
*/
|
| 8421 |
|
| 8422 |
+
/**
|
| 8423 |
+
* @param {TextProps} props
|
| 8424 |
+
*/
|
| 8425 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8426 |
|
| 8427 |
+
var text_mixins_text = function text(props) {
|
| 8428 |
+
return emotion_css(_templateObject9(), fontFamily, text_mixins_variant(props.variant));
|
| 8429 |
+
};
|
| 8430 |
+
//# sourceMappingURL=text-mixins.js.map
|
| 8431 |
+
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/text/index.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8432 |
|
|
|
|
|
|
|
|
|
|
| 8433 |
|
| 8434 |
+
/**
|
| 8435 |
+
* Internal dependencies
|
| 8436 |
+
*/
|
| 8437 |
|
|
|
|
| 8438 |
|
| 8439 |
+
var Text = Object(styled_base_browser_esm["a" /* default */])("p", {
|
| 8440 |
+
target: "e15wbhsk0",
|
| 8441 |
+
label: "Text"
|
| 8442 |
+
})("\n\tbox-sizing: border-box;\n\tmargin: 0;\n", text_mixins_text, true ? "" : undefined);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8443 |
|
| 8444 |
+
/* harmony default export */ var build_module_text = __webpack_exports__["a"] = (Text);
|
| 8445 |
+
//# sourceMappingURL=index.js.map
|
| 8446 |
|
| 8447 |
+
/***/ }),
|
| 8448 |
+
|
| 8449 |
+
/***/ 191:
|
| 8450 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
| 8451 |
+
|
| 8452 |
+
"use strict";
|
| 8453 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getCountryCode; });
|
| 8454 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return getCurrencyRegion; });
|
| 8455 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return getProductIdsForCart; });
|
| 8456 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getCategorizedOnboardingProducts; });
|
| 8457 |
+
/* unused harmony export getProductList */
|
| 8458 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return getPriceValue; });
|
| 8459 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return isWCAdmin; });
|
| 8460 |
+
/* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(30);
|
| 8461 |
+
/* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__);
|
| 8462 |
+
/* harmony import */ var _wordpress_html_entities__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(81);
|
| 8463 |
+
/* harmony import */ var _wordpress_html_entities__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_1__);
|
| 8464 |
+
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2);
|
| 8465 |
+
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_2__);
|
| 8466 |
+
/* harmony import */ var _woocommerce_wc_admin_settings__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(36);
|
| 8467 |
+
|
| 8468 |
+
|
| 8469 |
+
/**
|
| 8470 |
+
* External dependencies
|
| 8471 |
+
*/
|
| 8472 |
+
|
| 8473 |
+
|
| 8474 |
+
|
| 8475 |
+
/**
|
| 8476 |
+
* Gets the country code from a country:state value string.
|
| 8477 |
+
*
|
| 8478 |
+
* @param {string} countryState Country state string, e.g. US:GA.
|
| 8479 |
+
* @return {string} Country string.
|
| 8480 |
+
*/
|
| 8481 |
+
|
| 8482 |
+
function getCountryCode(countryState) {
|
| 8483 |
+
if (!countryState) {
|
| 8484 |
+
return null;
|
| 8485 |
+
}
|
| 8486 |
+
|
| 8487 |
+
return countryState.split(':')[0];
|
| 8488 |
+
}
|
| 8489 |
+
function getCurrencyRegion(countryState) {
|
| 8490 |
+
var region = getCountryCode(countryState);
|
| 8491 |
+
var euCountries = Object(lodash__WEBPACK_IMPORTED_MODULE_2__["without"])(Object(_woocommerce_wc_admin_settings__WEBPACK_IMPORTED_MODULE_3__[/* getSetting */ "g"])('onboarding', {
|
| 8492 |
+
euCountries: []
|
| 8493 |
+
}).euCountries, 'GB');
|
| 8494 |
+
|
| 8495 |
+
if (euCountries.includes(region)) {
|
| 8496 |
+
region = 'EU';
|
| 8497 |
+
}
|
| 8498 |
+
|
| 8499 |
+
return region;
|
| 8500 |
+
}
|
| 8501 |
+
/**
|
| 8502 |
+
* Gets the product IDs for items based on the product types and theme selected in the onboarding profiler.
|
| 8503 |
+
*
|
| 8504 |
+
* @param {Object} profileItems Onboarding profile.
|
| 8505 |
+
* @param {boolean} includeInstalledItems Include installed items in returned product IDs.
|
| 8506 |
+
* @param {Array} installedPlugins Installed plugins.
|
| 8507 |
+
* @return {Array} Product Ids.
|
| 8508 |
+
*/
|
| 8509 |
+
|
| 8510 |
+
function getProductIdsForCart(profileItems) {
|
| 8511 |
+
var includeInstalledItems = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
| 8512 |
+
var installedPlugins = arguments.length > 2 ? arguments[2] : undefined;
|
| 8513 |
+
var productList = getProductList(profileItems, includeInstalledItems, installedPlugins);
|
| 8514 |
+
var productIds = productList.map(function (product) {
|
| 8515 |
+
return product.id || product.product;
|
| 8516 |
+
});
|
| 8517 |
+
return productIds;
|
| 8518 |
+
}
|
| 8519 |
+
/**
|
| 8520 |
+
* Gets the labeled/categorized product names and types for items based on the product types and theme selected in the onboarding profiler.
|
| 8521 |
+
*
|
| 8522 |
+
* @param {Object} profileItems Onboarding profile.
|
| 8523 |
+
* @param {Array} installedPlugins Installed plugins.
|
| 8524 |
+
* @return {Array} Objects with labeled/categorized product names and types.
|
| 8525 |
+
*/
|
| 8526 |
+
|
| 8527 |
+
function getCategorizedOnboardingProducts(profileItems, installedPlugins) {
|
| 8528 |
+
var productList = {};
|
| 8529 |
+
productList.products = getProductList(profileItems, true, installedPlugins);
|
| 8530 |
+
productList.remainingProducts = getProductList(profileItems, false, installedPlugins);
|
| 8531 |
+
|
| 8532 |
+
var uniqueItemsList = _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default()(new Set([].concat(_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default()(productList.products), _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default()(productList.remainingProducts))));
|
| 8533 |
+
|
| 8534 |
+
productList.uniqueItemsList = uniqueItemsList.map(function (product) {
|
| 8535 |
+
var cleanedProduct;
|
| 8536 |
+
|
| 8537 |
+
if (product.label) {
|
| 8538 |
+
cleanedProduct = {
|
| 8539 |
+
type: 'extension',
|
| 8540 |
+
name: product.label
|
| 8541 |
+
};
|
| 8542 |
+
} else {
|
| 8543 |
+
cleanedProduct = {
|
| 8544 |
+
type: 'theme',
|
| 8545 |
+
name: product.title
|
| 8546 |
+
};
|
| 8547 |
+
}
|
| 8548 |
+
|
| 8549 |
+
return cleanedProduct;
|
| 8550 |
+
});
|
| 8551 |
+
return productList;
|
| 8552 |
+
}
|
| 8553 |
+
/**
|
| 8554 |
+
* Gets a product list for items based on the product types and theme selected in the onboarding profiler.
|
| 8555 |
+
*
|
| 8556 |
+
* @param {Object} profileItems Onboarding profile.
|
| 8557 |
+
* @param {boolean} includeInstalledItems Include installed items in returned product list.
|
| 8558 |
+
* @param {Array} installedPlugins Installed plugins.
|
| 8559 |
+
* @return {Array} Products.
|
| 8560 |
+
*/
|
| 8561 |
+
|
| 8562 |
+
function getProductList(profileItems) {
|
| 8563 |
+
var includeInstalledItems = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
| 8564 |
+
var installedPlugins = arguments.length > 2 ? arguments[2] : undefined;
|
| 8565 |
+
var onboarding = Object(_woocommerce_wc_admin_settings__WEBPACK_IMPORTED_MODULE_3__[/* getSetting */ "g"])('onboarding', {});
|
| 8566 |
+
var productList = []; // The population of onboarding.productTypes only happens if the task list should be shown
|
| 8567 |
+
// so bail early if it isn't present.
|
| 8568 |
+
|
| 8569 |
+
if (!onboarding.productTypes) {
|
| 8570 |
+
return productList;
|
| 8571 |
+
}
|
| 8572 |
+
|
| 8573 |
+
var productTypes = profileItems.product_types || [];
|
| 8574 |
+
productTypes.forEach(function (productType) {
|
| 8575 |
+
if (onboarding.productTypes[productType] && onboarding.productTypes[productType].product && (includeInstalledItems || !installedPlugins.includes(onboarding.productTypes[productType].slug))) {
|
| 8576 |
+
productList.push(onboarding.productTypes[productType]);
|
| 8577 |
+
}
|
| 8578 |
+
});
|
| 8579 |
+
var theme = onboarding.themes.find(function (themeData) {
|
| 8580 |
+
return themeData.slug === profileItems.theme;
|
| 8581 |
+
});
|
| 8582 |
+
|
| 8583 |
+
if (theme && theme.id && getPriceValue(theme.price) > 0 && (includeInstalledItems || !theme.is_installed)) {
|
| 8584 |
+
productList.push(theme);
|
| 8585 |
+
}
|
| 8586 |
+
|
| 8587 |
+
return productList;
|
| 8588 |
+
}
|
| 8589 |
+
/**
|
| 8590 |
+
* Get the value of a price from a string, removing any non-numeric characters.
|
| 8591 |
+
*
|
| 8592 |
+
* @param {string} string Price string.
|
| 8593 |
+
* @return {number} Number value.
|
| 8594 |
+
*/
|
| 8595 |
+
|
| 8596 |
+
function getPriceValue(string) {
|
| 8597 |
+
return Number(Object(_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_1__["decodeEntities"])(string).replace(/[^0-9.-]+/g, ''));
|
| 8598 |
+
}
|
| 8599 |
+
/**
|
| 8600 |
+
* Determines if a URL is a WC admin url.
|
| 8601 |
+
*
|
| 8602 |
+
* @param {*} url - the url to test
|
| 8603 |
+
* @return {boolean} true if the url is a wc-admin URL
|
| 8604 |
+
*/
|
| 8605 |
+
|
| 8606 |
+
function isWCAdmin(url) {
|
| 8607 |
+
return /admin.php\?page=wc-admin/.test(url);
|
| 8608 |
+
}
|
| 8609 |
+
|
| 8610 |
+
/***/ }),
|
| 8611 |
+
|
| 8612 |
+
/***/ 197:
|
| 8613 |
+
/***/ (function(module, exports) {
|
| 8614 |
+
|
| 8615 |
+
function _inheritsLoose(subClass, superClass) {
|
| 8616 |
+
subClass.prototype = Object.create(superClass.prototype);
|
| 8617 |
+
subClass.prototype.constructor = subClass;
|
| 8618 |
+
subClass.__proto__ = superClass;
|
| 8619 |
+
}
|
| 8620 |
+
|
| 8621 |
+
module.exports = _inheritsLoose;
|
| 8622 |
+
|
| 8623 |
+
/***/ }),
|
| 8624 |
+
|
| 8625 |
+
/***/ 2:
|
| 8626 |
+
/***/ (function(module, exports) {
|
| 8627 |
+
|
| 8628 |
+
(function() { module.exports = this["lodash"]; }());
|
| 8629 |
+
|
| 8630 |
+
/***/ }),
|
| 8631 |
+
|
| 8632 |
+
/***/ 20:
|
| 8633 |
+
/***/ (function(module, exports) {
|
| 8634 |
+
|
| 8635 |
+
(function() { module.exports = this["wp"]["data"]; }());
|
| 8636 |
+
|
| 8637 |
+
/***/ }),
|
| 8638 |
+
|
| 8639 |
+
/***/ 21:
|
| 8640 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
| 8641 |
+
|
| 8642 |
+
"use strict";
|
| 8643 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _classCallCheck; });
|
| 8644 |
+
function _classCallCheck(instance, Constructor) {
|
| 8645 |
+
if (!(instance instanceof Constructor)) {
|
| 8646 |
+
throw new TypeError("Cannot call a class as a function");
|
| 8647 |
+
}
|
| 8648 |
+
}
|
| 8649 |
+
|
| 8650 |
+
/***/ }),
|
| 8651 |
+
|
| 8652 |
+
/***/ 214:
|
| 8653 |
+
/***/ (function(module, exports) {
|
| 8654 |
+
|
| 8655 |
+
(function() { module.exports = this["wc"]["currency"]; }());
|
| 8656 |
+
|
| 8657 |
+
/***/ }),
|
| 8658 |
+
|
| 8659 |
+
/***/ 22:
|
| 8660 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
| 8661 |
+
|
| 8662 |
+
"use strict";
|
| 8663 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _createClass; });
|
| 8664 |
+
function _defineProperties(target, props) {
|
| 8665 |
+
for (var i = 0; i < props.length; i++) {
|
| 8666 |
+
var descriptor = props[i];
|
| 8667 |
+
descriptor.enumerable = descriptor.enumerable || false;
|
| 8668 |
+
descriptor.configurable = true;
|
| 8669 |
+
if ("value" in descriptor) descriptor.writable = true;
|
| 8670 |
+
Object.defineProperty(target, descriptor.key, descriptor);
|
| 8671 |
+
}
|
| 8672 |
+
}
|
| 8673 |
+
|
| 8674 |
+
function _createClass(Constructor, protoProps, staticProps) {
|
| 8675 |
+
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
| 8676 |
+
if (staticProps) _defineProperties(Constructor, staticProps);
|
| 8677 |
+
return Constructor;
|
| 8678 |
+
}
|
| 8679 |
+
|
| 8680 |
+
/***/ }),
|
| 8681 |
+
|
| 8682 |
+
/***/ 23:
|
| 8683 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
| 8684 |
+
|
| 8685 |
+
"use strict";
|
| 8686 |
+
|
| 8687 |
+
// EXPORTS
|
| 8688 |
+
__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ _inherits; });
|
| 8689 |
+
|
| 8690 |
+
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js
|
| 8691 |
+
function _setPrototypeOf(o, p) {
|
| 8692 |
+
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
|
| 8693 |
+
o.__proto__ = p;
|
| 8694 |
+
return o;
|
| 8695 |
+
};
|
| 8696 |
+
|
| 8697 |
+
return _setPrototypeOf(o, p);
|
| 8698 |
+
}
|
| 8699 |
+
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/inherits.js
|
| 8700 |
+
|
| 8701 |
+
function _inherits(subClass, superClass) {
|
| 8702 |
+
if (typeof superClass !== "function" && superClass !== null) {
|
| 8703 |
+
throw new TypeError("Super expression must either be null or a function");
|
| 8704 |
+
}
|
| 8705 |
+
|
| 8706 |
+
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
| 8707 |
+
constructor: {
|
| 8708 |
+
value: subClass,
|
| 8709 |
+
writable: true,
|
| 8710 |
+
configurable: true
|
| 8711 |
+
}
|
| 8712 |
+
});
|
| 8713 |
+
if (superClass) _setPrototypeOf(subClass, superClass);
|
| 8714 |
+
}
|
| 8715 |
+
|
| 8716 |
+
/***/ }),
|
| 8717 |
+
|
| 8718 |
+
/***/ 24:
|
| 8719 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
| 8720 |
+
|
| 8721 |
+
"use strict";
|
| 8722 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _possibleConstructorReturn; });
|
| 8723 |
+
/* harmony import */ var _babel_runtime_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(47);
|
| 8724 |
+
/* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(13);
|
| 8725 |
+
|
| 8726 |
+
|
| 8727 |
+
function _possibleConstructorReturn(self, call) {
|
| 8728 |
+
if (call && (Object(_babel_runtime_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(call) === "object" || typeof call === "function")) {
|
| 8729 |
+
return call;
|
| 8730 |
+
}
|
| 8731 |
+
|
| 8732 |
+
return Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(self);
|
| 8733 |
+
}
|
| 8734 |
+
|
| 8735 |
+
/***/ }),
|
| 8736 |
+
|
| 8737 |
+
/***/ 26:
|
| 8738 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
| 8739 |
+
|
| 8740 |
+
"use strict";
|
| 8741 |
+
|
| 8742 |
+
// EXPORTS
|
| 8743 |
+
__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ _slicedToArray; });
|
| 8744 |
+
|
| 8745 |
+
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js
|
| 8746 |
+
function _arrayWithHoles(arr) {
|
| 8747 |
+
if (Array.isArray(arr)) return arr;
|
| 8748 |
+
}
|
| 8749 |
+
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js
|
| 8750 |
+
function _iterableToArrayLimit(arr, i) {
|
| 8751 |
+
if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;
|
| 8752 |
+
var _arr = [];
|
| 8753 |
+
var _n = true;
|
| 8754 |
+
var _d = false;
|
| 8755 |
+
var _e = undefined;
|
| 8756 |
+
|
| 8757 |
+
try {
|
| 8758 |
+
for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
|
| 8759 |
+
_arr.push(_s.value);
|
| 8760 |
+
|
| 8761 |
+
if (i && _arr.length === i) break;
|
| 8762 |
+
}
|
| 8763 |
+
} catch (err) {
|
| 8764 |
+
_d = true;
|
| 8765 |
+
_e = err;
|
| 8766 |
+
} finally {
|
| 8767 |
+
try {
|
| 8768 |
+
if (!_n && _i["return"] != null) _i["return"]();
|
| 8769 |
+
} finally {
|
| 8770 |
+
if (_d) throw _e;
|
| 8771 |
+
}
|
| 8772 |
+
}
|
| 8773 |
+
|
| 8774 |
+
return _arr;
|
| 8775 |
+
}
|
| 8776 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
|
| 8777 |
+
var unsupportedIterableToArray = __webpack_require__(68);
|
| 8778 |
+
|
| 8779 |
+
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js
|
| 8780 |
+
function _nonIterableRest() {
|
| 8781 |
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
| 8782 |
+
}
|
| 8783 |
+
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js
|
| 8784 |
+
|
| 8785 |
+
|
| 8786 |
+
|
| 8787 |
+
|
| 8788 |
+
function _slicedToArray(arr, i) {
|
| 8789 |
+
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || Object(unsupportedIterableToArray["a" /* default */])(arr, i) || _nonIterableRest();
|
| 8790 |
+
}
|
| 8791 |
+
|
| 8792 |
+
/***/ }),
|
| 8793 |
+
|
| 8794 |
+
/***/ 27:
|
| 8795 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
| 8796 |
+
|
| 8797 |
+
"use strict";
|
| 8798 |
+
|
| 8799 |
+
// EXPORTS
|
| 8800 |
+
__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ _toConsumableArray; });
|
| 8801 |
+
|
| 8802 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
|
| 8803 |
+
var arrayLikeToArray = __webpack_require__(59);
|
| 8804 |
+
|
| 8805 |
+
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js
|
| 8806 |
+
|
| 8807 |
+
function _arrayWithoutHoles(arr) {
|
| 8808 |
+
if (Array.isArray(arr)) return Object(arrayLikeToArray["a" /* default */])(arr);
|
| 8809 |
+
}
|
| 8810 |
+
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArray.js
|
| 8811 |
+
function _iterableToArray(iter) {
|
| 8812 |
+
if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
|
| 8813 |
+
}
|
| 8814 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
|
| 8815 |
+
var unsupportedIterableToArray = __webpack_require__(68);
|
| 8816 |
+
|
| 8817 |
+
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js
|
| 8818 |
+
function _nonIterableSpread() {
|
| 8819 |
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
| 8820 |
+
}
|
| 8821 |
+
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js
|
| 8822 |
+
|
| 8823 |
+
|
| 8824 |
+
|
| 8825 |
+
|
| 8826 |
+
function _toConsumableArray(arr) {
|
| 8827 |
+
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || Object(unsupportedIterableToArray["a" /* default */])(arr) || _nonIterableSpread();
|
| 8828 |
+
}
|
| 8829 |
+
|
| 8830 |
+
/***/ }),
|
| 8831 |
+
|
| 8832 |
+
/***/ 277:
|
| 8833 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
| 8834 |
+
|
| 8835 |
+
"use strict";
|
| 8836 |
+
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
|
| 8837 |
+
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__);
|
| 8838 |
+
/**
|
| 8839 |
+
* External dependencies
|
| 8840 |
+
*/
|
| 8841 |
+
|
| 8842 |
+
/**
|
| 8843 |
+
* Composes multiple higher-order components into a single higher-order component. Performs right-to-left function
|
| 8844 |
+
* composition, where each successive invocation is supplied the return value of the previous.
|
| 8845 |
+
*
|
| 8846 |
+
* @param {...Function} hocs The HOC functions to invoke.
|
| 8847 |
+
*
|
| 8848 |
+
* @return {Function} Returns the new composite function.
|
| 8849 |
+
*/
|
| 8850 |
+
|
| 8851 |
+
/* harmony default export */ __webpack_exports__["a"] = (lodash__WEBPACK_IMPORTED_MODULE_0__["flowRight"]);
|
| 8852 |
+
//# sourceMappingURL=compose.js.map
|
| 8853 |
+
|
| 8854 |
+
/***/ }),
|
| 8855 |
+
|
| 8856 |
+
/***/ 280:
|
| 8857 |
+
/***/ (function(module, exports) {
|
| 8858 |
+
|
| 8859 |
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
| 8860 |
+
if (source == null) return {};
|
| 8861 |
+
var target = {};
|
| 8862 |
+
var sourceKeys = Object.keys(source);
|
| 8863 |
+
var key, i;
|
| 8864 |
+
|
| 8865 |
+
for (i = 0; i < sourceKeys.length; i++) {
|
| 8866 |
+
key = sourceKeys[i];
|
| 8867 |
+
if (excluded.indexOf(key) >= 0) continue;
|
| 8868 |
+
target[key] = source[key];
|
| 8869 |
+
}
|
| 8870 |
+
|
| 8871 |
+
return target;
|
| 8872 |
+
}
|
| 8873 |
+
|
| 8874 |
+
module.exports = _objectWithoutPropertiesLoose;
|
| 8875 |
+
|
| 8876 |
+
/***/ }),
|
| 8877 |
+
|
| 8878 |
+
/***/ 281:
|
| 8879 |
+
/***/ (function(module, exports, __webpack_require__) {
|
| 8880 |
+
|
| 8881 |
+
"use strict";
|
| 8882 |
+
|
| 8883 |
+
|
| 8884 |
+
if (true) {
|
| 8885 |
+
module.exports = __webpack_require__(307);
|
| 8886 |
+
} else {}
|
| 8887 |
+
|
| 8888 |
+
|
| 8889 |
+
/***/ }),
|
| 8890 |
+
|
| 8891 |
+
/***/ 29:
|
| 8892 |
+
/***/ (function(module, exports) {
|
| 8893 |
+
|
| 8894 |
+
(function() { module.exports = this["wp"]["dataControls"]; }());
|
| 8895 |
+
|
| 8896 |
+
/***/ }),
|
| 8897 |
+
|
| 8898 |
+
/***/ 292:
|
| 8899 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
| 8900 |
+
|
| 8901 |
+
"use strict";
|
| 8902 |
+
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3);
|
| 8903 |
+
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
|
| 8904 |
+
/* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(55);
|
| 8905 |
+
/* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_1__);
|
| 8906 |
+
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(0);
|
| 8907 |
+
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__);
|
| 8908 |
+
/* harmony import */ var _settings__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(36);
|
| 8909 |
+
/**
|
| 8910 |
+
* External dependencies
|
| 8911 |
+
*/
|
| 8912 |
+
|
| 8913 |
+
|
| 8914 |
+
|
| 8915 |
+
/**
|
| 8916 |
+
* Internal dependencies
|
| 8917 |
+
*/
|
| 8918 |
+
|
| 8919 |
+
|
| 8920 |
+
var manageStock = Object(_settings__WEBPACK_IMPORTED_MODULE_3__[/* getSetting */ "g"])('manageStock', 'no');
|
| 8921 |
+
var REPORTS_FILTER = 'woocommerce_admin_reports_list';
|
| 8922 |
+
/**
|
| 8923 |
+
* Internal dependencies
|
| 8924 |
+
*/
|
| 8925 |
+
|
| 8926 |
+
var RevenueReport = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["lazy"])(function () {
|
| 8927 |
+
return Promise.all(/* import() | analytics-report-revenue */[__webpack_require__.e(1), __webpack_require__.e(0), __webpack_require__.e(20)]).then(__webpack_require__.bind(null, 745));
|
| 8928 |
+
});
|
| 8929 |
+
var ProductsReport = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["lazy"])(function () {
|
| 8930 |
+
return Promise.all(/* import() | analytics-report-products */[__webpack_require__.e(1), __webpack_require__.e(0), __webpack_require__.e(7), __webpack_require__.e(19)]).then(__webpack_require__.bind(null, 741));
|
| 8931 |
+
});
|
| 8932 |
+
var VariationsReport = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["lazy"])(function () {
|
| 8933 |
+
return Promise.all(/* import() | analytics-report-variations */[__webpack_require__.e(1), __webpack_require__.e(0), __webpack_require__.e(23)]).then(__webpack_require__.bind(null, 746));
|
| 8934 |
+
});
|
| 8935 |
+
var OrdersReport = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["lazy"])(function () {
|
| 8936 |
+
return Promise.all(/* import() | analytics-report-orders */[__webpack_require__.e(1), __webpack_require__.e(0), __webpack_require__.e(8), __webpack_require__.e(18)]).then(__webpack_require__.bind(null, 747));
|
| 8937 |
+
});
|
| 8938 |
+
var CategoriesReport = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["lazy"])(function () {
|
| 8939 |
+
return Promise.all(/* import() | analytics-report-categories */[__webpack_require__.e(1), __webpack_require__.e(0), __webpack_require__.e(7), __webpack_require__.e(14)]).then(__webpack_require__.bind(null, 743));
|
| 8940 |
+
});
|
| 8941 |
+
var CouponsReport = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["lazy"])(function () {
|
| 8942 |
+
return Promise.all(/* import() | analytics-report-coupons */[__webpack_require__.e(1), __webpack_require__.e(0), __webpack_require__.e(15)]).then(__webpack_require__.bind(null, 748));
|
| 8943 |
+
});
|
| 8944 |
+
var TaxesReport = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["lazy"])(function () {
|
| 8945 |
+
return Promise.all(/* import() | analytics-report-taxes */[__webpack_require__.e(1), __webpack_require__.e(0), __webpack_require__.e(22)]).then(__webpack_require__.bind(null, 749));
|
| 8946 |
+
});
|
| 8947 |
+
var DownloadsReport = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["lazy"])(function () {
|
| 8948 |
+
return Promise.all(/* import() | analytics-report-downloads */[__webpack_require__.e(1), __webpack_require__.e(0), __webpack_require__.e(17)]).then(__webpack_require__.bind(null, 750));
|
| 8949 |
+
});
|
| 8950 |
+
var StockReport = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["lazy"])(function () {
|
| 8951 |
+
return Promise.all(/* import() | analytics-report-stock */[__webpack_require__.e(0), __webpack_require__.e(21)]).then(__webpack_require__.bind(null, 742));
|
| 8952 |
+
});
|
| 8953 |
+
var CustomersReport = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["lazy"])(function () {
|
| 8954 |
+
return Promise.all(/* import() | analytics-report-customers */[__webpack_require__.e(0), __webpack_require__.e(16)]).then(__webpack_require__.bind(null, 744));
|
| 8955 |
+
});
|
| 8956 |
+
/* harmony default export */ __webpack_exports__["a"] = (function () {
|
| 8957 |
+
var reports = [{
|
| 8958 |
+
report: 'revenue',
|
| 8959 |
+
title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Revenue', 'woocommerce-admin'),
|
| 8960 |
+
component: RevenueReport,
|
| 8961 |
+
id: 'woocommerce-analytics-revenue'
|
| 8962 |
+
}, {
|
| 8963 |
+
report: 'products',
|
| 8964 |
+
title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Products', 'woocommerce-admin'),
|
| 8965 |
+
component: ProductsReport,
|
| 8966 |
+
id: 'woocommerce-analytics-products'
|
| 8967 |
+
}, {
|
| 8968 |
+
report: 'variations',
|
| 8969 |
+
title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Variations', 'woocommerce-admin'),
|
| 8970 |
+
component: VariationsReport,
|
| 8971 |
+
id: 'woocommerce-analytics-variations'
|
| 8972 |
+
}, {
|
| 8973 |
+
report: 'orders',
|
| 8974 |
+
title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Orders', 'woocommerce-admin'),
|
| 8975 |
+
component: OrdersReport,
|
| 8976 |
+
id: 'woocommerce-analytics-orders'
|
| 8977 |
+
}, {
|
| 8978 |
+
report: 'categories',
|
| 8979 |
+
title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Categories', 'woocommerce-admin'),
|
| 8980 |
+
component: CategoriesReport,
|
| 8981 |
+
id: 'woocommerce-analytics-categories'
|
| 8982 |
+
}, {
|
| 8983 |
+
report: 'coupons',
|
| 8984 |
+
title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Coupons', 'woocommerce-admin'),
|
| 8985 |
+
component: CouponsReport,
|
| 8986 |
+
id: 'woocommerce-analytics-coupons'
|
| 8987 |
+
}, {
|
| 8988 |
+
report: 'taxes',
|
| 8989 |
+
title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Taxes', 'woocommerce-admin'),
|
| 8990 |
+
component: TaxesReport,
|
| 8991 |
+
id: 'woocommerce-analytics-taxes'
|
| 8992 |
+
}, manageStock === 'yes' ? {
|
| 8993 |
+
report: 'stock',
|
| 8994 |
+
title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Stock', 'woocommerce-admin'),
|
| 8995 |
+
component: StockReport,
|
| 8996 |
+
id: 'woocommerce-analytics-stock'
|
| 8997 |
+
} : null, {
|
| 8998 |
+
report: 'customers',
|
| 8999 |
+
title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Customers', 'woocommerce-admin'),
|
| 9000 |
+
component: CustomersReport,
|
| 9001 |
+
id: null
|
| 9002 |
+
}, {
|
| 9003 |
+
report: 'downloads',
|
| 9004 |
+
title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Downloads', 'woocommerce-admin'),
|
| 9005 |
+
component: DownloadsReport,
|
| 9006 |
+
id: 'woocommerce-analytics-downloads'
|
| 9007 |
+
}].filter(Boolean);
|
| 9008 |
+
return Object(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_1__["applyFilters"])(REPORTS_FILTER, reports);
|
| 9009 |
+
});
|
| 9010 |
+
|
| 9011 |
+
/***/ }),
|
| 9012 |
+
|
| 9013 |
+
/***/ 293:
|
| 9014 |
+
/***/ (function(module, exports, __webpack_require__) {
|
| 9015 |
+
|
| 9016 |
+
"use strict";
|
| 9017 |
+
|
| 9018 |
+
|
| 9019 |
+
var reactIs = __webpack_require__(281);
|
| 9020 |
+
|
| 9021 |
+
/**
|
| 9022 |
+
* Copyright 2015, Yahoo! Inc.
|
| 9023 |
+
* Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
|
| 9024 |
+
*/
|
| 9025 |
+
var REACT_STATICS = {
|
| 9026 |
+
childContextTypes: true,
|
| 9027 |
+
contextType: true,
|
| 9028 |
+
contextTypes: true,
|
| 9029 |
+
defaultProps: true,
|
| 9030 |
+
displayName: true,
|
| 9031 |
+
getDefaultProps: true,
|
| 9032 |
+
getDerivedStateFromError: true,
|
| 9033 |
+
getDerivedStateFromProps: true,
|
| 9034 |
+
mixins: true,
|
| 9035 |
+
propTypes: true,
|
| 9036 |
+
type: true
|
| 9037 |
+
};
|
| 9038 |
+
var KNOWN_STATICS = {
|
| 9039 |
+
name: true,
|
| 9040 |
+
length: true,
|
| 9041 |
+
prototype: true,
|
| 9042 |
+
caller: true,
|
| 9043 |
+
callee: true,
|
| 9044 |
+
arguments: true,
|
| 9045 |
+
arity: true
|
| 9046 |
+
};
|
| 9047 |
+
var FORWARD_REF_STATICS = {
|
| 9048 |
+
'$$typeof': true,
|
| 9049 |
+
render: true,
|
| 9050 |
+
defaultProps: true,
|
| 9051 |
+
displayName: true,
|
| 9052 |
+
propTypes: true
|
| 9053 |
+
};
|
| 9054 |
+
var MEMO_STATICS = {
|
| 9055 |
+
'$$typeof': true,
|
| 9056 |
+
compare: true,
|
| 9057 |
+
defaultProps: true,
|
| 9058 |
+
displayName: true,
|
| 9059 |
+
propTypes: true,
|
| 9060 |
+
type: true
|
| 9061 |
+
};
|
| 9062 |
+
var TYPE_STATICS = {};
|
| 9063 |
+
TYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS;
|
| 9064 |
+
TYPE_STATICS[reactIs.Memo] = MEMO_STATICS;
|
| 9065 |
+
|
| 9066 |
+
function getStatics(component) {
|
| 9067 |
+
// React v16.11 and below
|
| 9068 |
+
if (reactIs.isMemo(component)) {
|
| 9069 |
+
return MEMO_STATICS;
|
| 9070 |
+
} // React v16.12 and above
|
| 9071 |
+
|
| 9072 |
+
|
| 9073 |
+
return TYPE_STATICS[component['$$typeof']] || REACT_STATICS;
|
| 9074 |
+
}
|
| 9075 |
+
|
| 9076 |
+
var defineProperty = Object.defineProperty;
|
| 9077 |
+
var getOwnPropertyNames = Object.getOwnPropertyNames;
|
| 9078 |
+
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
| 9079 |
+
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
| 9080 |
+
var getPrototypeOf = Object.getPrototypeOf;
|
| 9081 |
+
var objectPrototype = Object.prototype;
|
| 9082 |
+
function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {
|
| 9083 |
+
if (typeof sourceComponent !== 'string') {
|
| 9084 |
+
// don't hoist over string (html) components
|
| 9085 |
+
if (objectPrototype) {
|
| 9086 |
+
var inheritedComponent = getPrototypeOf(sourceComponent);
|
| 9087 |
+
|
| 9088 |
+
if (inheritedComponent && inheritedComponent !== objectPrototype) {
|
| 9089 |
+
hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);
|
| 9090 |
+
}
|
| 9091 |
+
}
|
| 9092 |
+
|
| 9093 |
+
var keys = getOwnPropertyNames(sourceComponent);
|
| 9094 |
+
|
| 9095 |
+
if (getOwnPropertySymbols) {
|
| 9096 |
+
keys = keys.concat(getOwnPropertySymbols(sourceComponent));
|
| 9097 |
+
}
|
| 9098 |
+
|
| 9099 |
+
var targetStatics = getStatics(targetComponent);
|
| 9100 |
+
var sourceStatics = getStatics(sourceComponent);
|
| 9101 |
+
|
| 9102 |
+
for (var i = 0; i < keys.length; ++i) {
|
| 9103 |
+
var key = keys[i];
|
| 9104 |
+
|
| 9105 |
+
if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) {
|
| 9106 |
+
var descriptor = getOwnPropertyDescriptor(sourceComponent, key);
|
| 9107 |
+
|
| 9108 |
+
try {
|
| 9109 |
+
// Avoid failures from read-only properties
|
| 9110 |
+
defineProperty(targetComponent, key, descriptor);
|
| 9111 |
+
} catch (e) {}
|
| 9112 |
+
}
|
| 9113 |
+
}
|
| 9114 |
+
}
|
| 9115 |
+
|
| 9116 |
+
return targetComponent;
|
| 9117 |
+
}
|
| 9118 |
+
|
| 9119 |
+
module.exports = hoistNonReactStatics;
|
| 9120 |
+
|
| 9121 |
+
|
| 9122 |
+
/***/ }),
|
| 9123 |
+
|
| 9124 |
+
/***/ 295:
|
| 9125 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
| 9126 |
+
|
| 9127 |
+
"use strict";
|
| 9128 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return useIsScrolled; });
|
| 9129 |
+
/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(34);
|
| 9130 |
+
/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0__);
|
| 9131 |
+
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(0);
|
| 9132 |
+
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);
|
| 9133 |
+
|
| 9134 |
+
|
| 9135 |
+
/**
|
| 9136 |
+
* External dependencies
|
| 9137 |
+
*/
|
| 9138 |
+
|
| 9139 |
+
function useIsScrolled() {
|
| 9140 |
+
var _useState = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["useState"])(false),
|
| 9141 |
+
_useState2 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0___default()(_useState, 2),
|
| 9142 |
+
isScrolled = _useState2[0],
|
| 9143 |
+
setIsScrolled = _useState2[1];
|
| 9144 |
+
|
| 9145 |
+
var rafHandle = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["useRef"])(null);
|
| 9146 |
+
Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["useEffect"])(function () {
|
| 9147 |
+
var updateIsScrolled = function updateIsScrolled() {
|
| 9148 |
+
setIsScrolled(window.pageYOffset > 20);
|
| 9149 |
+
};
|
| 9150 |
+
|
| 9151 |
+
var scrollListener = function scrollListener() {
|
| 9152 |
+
rafHandle.current = window.requestAnimationFrame(updateIsScrolled);
|
| 9153 |
+
};
|
| 9154 |
+
|
| 9155 |
+
window.addEventListener('scroll', scrollListener);
|
| 9156 |
+
return function () {
|
| 9157 |
+
window.removeEventListener('scroll', scrollListener);
|
| 9158 |
+
window.cancelAnimationFrame(rafHandle.current);
|
| 9159 |
+
};
|
| 9160 |
+
}, []);
|
| 9161 |
+
return isScrolled;
|
| 9162 |
+
}
|
| 9163 |
+
|
| 9164 |
+
/***/ }),
|
| 9165 |
+
|
| 9166 |
+
/***/ 296:
|
| 9167 |
+
/***/ (function(module, exports) {
|
| 9168 |
+
|
| 9169 |
+
(function() { module.exports = this["wp"]["plugins"]; }());
|
| 9170 |
+
|
| 9171 |
+
/***/ }),
|
| 9172 |
+
|
| 9173 |
+
/***/ 297:
|
| 9174 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
| 9175 |
+
|
| 9176 |
+
"use strict";
|
| 9177 |
+
|
| 9178 |
+
// EXPORTS
|
| 9179 |
+
__webpack_require__.d(__webpack_exports__, "c", function() { return /* binding */ layout_PrimaryLayout; });
|
| 9180 |
+
__webpack_require__.d(__webpack_exports__, "b", function() { return /* binding */ PageLayout; });
|
| 9181 |
+
__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ EmbedLayout; });
|
| 9182 |
+
|
| 9183 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/extends.js
|
| 9184 |
+
var helpers_extends = __webpack_require__(38);
|
| 9185 |
+
var extends_default = /*#__PURE__*/__webpack_require__.n(helpers_extends);
|
| 9186 |
+
|
| 9187 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/objectWithoutProperties.js
|
| 9188 |
+
var objectWithoutProperties = __webpack_require__(62);
|
| 9189 |
+
var objectWithoutProperties_default = /*#__PURE__*/__webpack_require__.n(objectWithoutProperties);
|
| 9190 |
+
|
| 9191 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/defineProperty.js
|
| 9192 |
+
var defineProperty = __webpack_require__(5);
|
| 9193 |
+
var defineProperty_default = /*#__PURE__*/__webpack_require__.n(defineProperty);
|
| 9194 |
+
|
| 9195 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/classCallCheck.js
|
| 9196 |
+
var classCallCheck = __webpack_require__(17);
|
| 9197 |
+
var classCallCheck_default = /*#__PURE__*/__webpack_require__.n(classCallCheck);
|
| 9198 |
+
|
| 9199 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/createClass.js
|
| 9200 |
+
var createClass = __webpack_require__(15);
|
| 9201 |
+
var createClass_default = /*#__PURE__*/__webpack_require__.n(createClass);
|
| 9202 |
+
|
| 9203 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/inherits.js
|
| 9204 |
+
var inherits = __webpack_require__(18);
|
| 9205 |
+
var inherits_default = /*#__PURE__*/__webpack_require__.n(inherits);
|
| 9206 |
+
|
| 9207 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js
|
| 9208 |
+
var possibleConstructorReturn = __webpack_require__(19);
|
| 9209 |
+
var possibleConstructorReturn_default = /*#__PURE__*/__webpack_require__.n(possibleConstructorReturn);
|
| 9210 |
+
|
| 9211 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/getPrototypeOf.js
|
| 9212 |
+
var getPrototypeOf = __webpack_require__(9);
|
| 9213 |
+
var getPrototypeOf_default = /*#__PURE__*/__webpack_require__.n(getPrototypeOf);
|
| 9214 |
+
|
| 9215 |
+
// EXTERNAL MODULE: external {"this":["wp","element"]}
|
| 9216 |
+
var external_this_wp_element_ = __webpack_require__(0);
|
| 9217 |
+
|
| 9218 |
+
// EXTERNAL MODULE: ./node_modules/@wordpress/compose/build-module/higher-order/compose.js
|
| 9219 |
+
var compose = __webpack_require__(277);
|
| 9220 |
+
|
| 9221 |
+
// EXTERNAL MODULE: external {"this":["wp","data"]}
|
| 9222 |
+
var external_this_wp_data_ = __webpack_require__(20);
|
| 9223 |
+
|
| 9224 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js
|
| 9225 |
+
var inheritsLoose = __webpack_require__(56);
|
| 9226 |
+
|
| 9227 |
+
// EXTERNAL MODULE: external "React"
|
| 9228 |
+
var external_React_ = __webpack_require__(6);
|
| 9229 |
+
var external_React_default = /*#__PURE__*/__webpack_require__.n(external_React_);
|
| 9230 |
+
|
| 9231 |
+
// EXTERNAL MODULE: ./node_modules/prop-types/index.js
|
| 9232 |
+
var prop_types = __webpack_require__(1);
|
| 9233 |
+
var prop_types_default = /*#__PURE__*/__webpack_require__.n(prop_types);
|
| 9234 |
+
|
| 9235 |
+
// EXTERNAL MODULE: ./node_modules/history/esm/history.js + 2 modules
|
| 9236 |
+
var esm_history = __webpack_require__(127);
|
| 9237 |
+
|
| 9238 |
+
// EXTERNAL MODULE: ./node_modules/mini-create-react-context/dist/esm/index.js
|
| 9239 |
+
var esm = __webpack_require__(537);
|
| 9240 |
+
|
| 9241 |
+
// EXTERNAL MODULE: ./node_modules/tiny-invariant/dist/tiny-invariant.esm.js
|
| 9242 |
+
var tiny_invariant_esm = __webpack_require__(103);
|
| 9243 |
+
|
| 9244 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
|
| 9245 |
+
var esm_extends = __webpack_require__(7);
|
| 9246 |
+
|
| 9247 |
+
// EXTERNAL MODULE: ./node_modules/path-to-regexp/index.js
|
| 9248 |
+
var path_to_regexp = __webpack_require__(437);
|
| 9249 |
+
var path_to_regexp_default = /*#__PURE__*/__webpack_require__.n(path_to_regexp);
|
| 9250 |
+
|
| 9251 |
+
// EXTERNAL MODULE: ./node_modules/react-is/index.js
|
| 9252 |
+
var react_is = __webpack_require__(281);
|
| 9253 |
+
|
| 9254 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js
|
| 9255 |
+
var objectWithoutPropertiesLoose = __webpack_require__(58);
|
| 9256 |
+
|
| 9257 |
+
// EXTERNAL MODULE: ./node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js
|
| 9258 |
+
var hoist_non_react_statics_cjs = __webpack_require__(293);
|
| 9259 |
+
var hoist_non_react_statics_cjs_default = /*#__PURE__*/__webpack_require__.n(hoist_non_react_statics_cjs);
|
| 9260 |
+
|
| 9261 |
+
// CONCATENATED MODULE: ./node_modules/react-router/esm/react-router.js
|
| 9262 |
+
|
| 9263 |
+
|
| 9264 |
+
|
| 9265 |
+
|
| 9266 |
+
|
| 9267 |
+
|
| 9268 |
+
|
| 9269 |
+
|
| 9270 |
+
|
| 9271 |
+
|
| 9272 |
+
|
| 9273 |
+
|
| 9274 |
+
|
| 9275 |
+
// TODO: Replace with React.createContext once we can assume React 16+
|
| 9276 |
+
|
| 9277 |
+
var react_router_createNamedContext = function createNamedContext(name) {
|
| 9278 |
+
var context = Object(esm["a" /* default */])();
|
| 9279 |
+
context.displayName = name;
|
| 9280 |
+
return context;
|
| 9281 |
+
};
|
| 9282 |
+
|
| 9283 |
+
var react_router_context =
|
| 9284 |
+
/*#__PURE__*/
|
| 9285 |
+
react_router_createNamedContext("Router");
|
| 9286 |
+
|
| 9287 |
+
/**
|
| 9288 |
+
* The public API for putting history on context.
|
| 9289 |
+
*/
|
| 9290 |
+
|
| 9291 |
+
var react_router_Router =
|
| 9292 |
+
/*#__PURE__*/
|
| 9293 |
+
function (_React$Component) {
|
| 9294 |
+
Object(inheritsLoose["a" /* default */])(Router, _React$Component);
|
| 9295 |
+
|
| 9296 |
+
Router.computeRootMatch = function computeRootMatch(pathname) {
|
| 9297 |
+
return {
|
| 9298 |
+
path: "/",
|
| 9299 |
+
url: "/",
|
| 9300 |
+
params: {},
|
| 9301 |
+
isExact: pathname === "/"
|
| 9302 |
+
};
|
| 9303 |
+
};
|
| 9304 |
+
|
| 9305 |
+
function Router(props) {
|
| 9306 |
+
var _this;
|
| 9307 |
+
|
| 9308 |
+
_this = _React$Component.call(this, props) || this;
|
| 9309 |
+
_this.state = {
|
| 9310 |
+
location: props.history.location
|
| 9311 |
+
}; // This is a bit of a hack. We have to start listening for location
|
| 9312 |
+
// changes here in the constructor in case there are any <Redirect>s
|
| 9313 |
+
// on the initial render. If there are, they will replace/push when
|
| 9314 |
+
// they mount and since cDM fires in children before parents, we may
|
| 9315 |
+
// get a new location before the <Router> is mounted.
|
| 9316 |
+
|
| 9317 |
+
_this._isMounted = false;
|
| 9318 |
+
_this._pendingLocation = null;
|
| 9319 |
+
|
| 9320 |
+
if (!props.staticContext) {
|
| 9321 |
+
_this.unlisten = props.history.listen(function (location) {
|
| 9322 |
+
if (_this._isMounted) {
|
| 9323 |
+
_this.setState({
|
| 9324 |
+
location: location
|
| 9325 |
+
});
|
| 9326 |
+
} else {
|
| 9327 |
+
_this._pendingLocation = location;
|
| 9328 |
+
}
|
| 9329 |
+
});
|
| 9330 |
+
}
|
| 9331 |
+
|
| 9332 |
+
return _this;
|
| 9333 |
+
}
|
| 9334 |
+
|
| 9335 |
+
var _proto = Router.prototype;
|
| 9336 |
+
|
| 9337 |
+
_proto.componentDidMount = function componentDidMount() {
|
| 9338 |
+
this._isMounted = true;
|
| 9339 |
+
|
| 9340 |
+
if (this._pendingLocation) {
|
| 9341 |
+
this.setState({
|
| 9342 |
+
location: this._pendingLocation
|
| 9343 |
+
});
|
| 9344 |
+
}
|
| 9345 |
+
};
|
| 9346 |
+
|
| 9347 |
+
_proto.componentWillUnmount = function componentWillUnmount() {
|
| 9348 |
+
if (this.unlisten) this.unlisten();
|
| 9349 |
+
};
|
| 9350 |
+
|
| 9351 |
+
_proto.render = function render() {
|
| 9352 |
+
return external_React_default.a.createElement(react_router_context.Provider, {
|
| 9353 |
+
children: this.props.children || null,
|
| 9354 |
+
value: {
|
| 9355 |
+
history: this.props.history,
|
| 9356 |
+
location: this.state.location,
|
| 9357 |
+
match: Router.computeRootMatch(this.state.location.pathname),
|
| 9358 |
+
staticContext: this.props.staticContext
|
| 9359 |
+
}
|
| 9360 |
+
});
|
| 9361 |
+
};
|
| 9362 |
+
|
| 9363 |
+
return Router;
|
| 9364 |
+
}(external_React_default.a.Component);
|
| 9365 |
+
|
| 9366 |
+
if (false) {}
|
| 9367 |
+
|
| 9368 |
+
/**
|
| 9369 |
+
* The public API for a <Router> that stores location in memory.
|
| 9370 |
+
*/
|
| 9371 |
+
|
| 9372 |
+
var react_router_MemoryRouter =
|
| 9373 |
+
/*#__PURE__*/
|
| 9374 |
+
function (_React$Component) {
|
| 9375 |
+
Object(inheritsLoose["a" /* default */])(MemoryRouter, _React$Component);
|
| 9376 |
+
|
| 9377 |
+
function MemoryRouter() {
|
| 9378 |
+
var _this;
|
| 9379 |
+
|
| 9380 |
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
| 9381 |
+
args[_key] = arguments[_key];
|
| 9382 |
+
}
|
| 9383 |
+
|
| 9384 |
+
_this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
|
| 9385 |
+
_this.history = Object(esm_history["c" /* createMemoryHistory */])(_this.props);
|
| 9386 |
+
return _this;
|
| 9387 |
+
}
|
| 9388 |
+
|
| 9389 |
+
var _proto = MemoryRouter.prototype;
|
| 9390 |
+
|
| 9391 |
+
_proto.render = function render() {
|
| 9392 |
+
return external_React_default.a.createElement(react_router_Router, {
|
| 9393 |
+
history: this.history,
|
| 9394 |
+
children: this.props.children
|
| 9395 |
+
});
|
| 9396 |
+
};
|
| 9397 |
+
|
| 9398 |
+
return MemoryRouter;
|
| 9399 |
+
}(external_React_default.a.Component);
|
| 9400 |
+
|
| 9401 |
+
if (false) {}
|
| 9402 |
+
|
| 9403 |
+
var react_router_Lifecycle =
|
| 9404 |
+
/*#__PURE__*/
|
| 9405 |
+
function (_React$Component) {
|
| 9406 |
+
Object(inheritsLoose["a" /* default */])(Lifecycle, _React$Component);
|
| 9407 |
+
|
| 9408 |
+
function Lifecycle() {
|
| 9409 |
+
return _React$Component.apply(this, arguments) || this;
|
| 9410 |
+
}
|
| 9411 |
+
|
| 9412 |
+
var _proto = Lifecycle.prototype;
|
| 9413 |
+
|
| 9414 |
+
_proto.componentDidMount = function componentDidMount() {
|
| 9415 |
+
if (this.props.onMount) this.props.onMount.call(this, this);
|
| 9416 |
+
};
|
| 9417 |
+
|
| 9418 |
+
_proto.componentDidUpdate = function componentDidUpdate(prevProps) {
|
| 9419 |
+
if (this.props.onUpdate) this.props.onUpdate.call(this, this, prevProps);
|
| 9420 |
+
};
|
| 9421 |
+
|
| 9422 |
+
_proto.componentWillUnmount = function componentWillUnmount() {
|
| 9423 |
+
if (this.props.onUnmount) this.props.onUnmount.call(this, this);
|
| 9424 |
+
};
|
| 9425 |
+
|
| 9426 |
+
_proto.render = function render() {
|
| 9427 |
+
return null;
|
| 9428 |
+
};
|
| 9429 |
+
|
| 9430 |
+
return Lifecycle;
|
| 9431 |
+
}(external_React_default.a.Component);
|
| 9432 |
+
|
| 9433 |
+
/**
|
| 9434 |
+
* The public API for prompting the user before navigating away from a screen.
|
| 9435 |
+
*/
|
| 9436 |
+
|
| 9437 |
+
function Prompt(_ref) {
|
| 9438 |
+
var message = _ref.message,
|
| 9439 |
+
_ref$when = _ref.when,
|
| 9440 |
+
when = _ref$when === void 0 ? true : _ref$when;
|
| 9441 |
+
return external_React_default.a.createElement(react_router_context.Consumer, null, function (context) {
|
| 9442 |
+
!context ? false ? undefined : Object(tiny_invariant_esm["a" /* default */])(false) : void 0;
|
| 9443 |
+
if (!when || context.staticContext) return null;
|
| 9444 |
+
var method = context.history.block;
|
| 9445 |
+
return external_React_default.a.createElement(react_router_Lifecycle, {
|
| 9446 |
+
onMount: function onMount(self) {
|
| 9447 |
+
self.release = method(message);
|
| 9448 |
+
},
|
| 9449 |
+
onUpdate: function onUpdate(self, prevProps) {
|
| 9450 |
+
if (prevProps.message !== message) {
|
| 9451 |
+
self.release();
|
| 9452 |
+
self.release = method(message);
|
| 9453 |
+
}
|
| 9454 |
+
},
|
| 9455 |
+
onUnmount: function onUnmount(self) {
|
| 9456 |
+
self.release();
|
| 9457 |
+
},
|
| 9458 |
+
message: message
|
| 9459 |
+
});
|
| 9460 |
+
});
|
| 9461 |
+
}
|
| 9462 |
+
|
| 9463 |
+
if (false) { var messageType; }
|
| 9464 |
+
|
| 9465 |
+
var cache = {};
|
| 9466 |
+
var cacheLimit = 10000;
|
| 9467 |
+
var cacheCount = 0;
|
| 9468 |
+
|
| 9469 |
+
function compilePath(path) {
|
| 9470 |
+
if (cache[path]) return cache[path];
|
| 9471 |
+
var generator = path_to_regexp_default.a.compile(path);
|
| 9472 |
+
|
| 9473 |
+
if (cacheCount < cacheLimit) {
|
| 9474 |
+
cache[path] = generator;
|
| 9475 |
+
cacheCount++;
|
| 9476 |
+
}
|
| 9477 |
+
|
| 9478 |
+
return generator;
|
| 9479 |
+
}
|
| 9480 |
+
/**
|
| 9481 |
+
* Public API for generating a URL pathname from a path and parameters.
|
| 9482 |
+
*/
|
| 9483 |
+
|
| 9484 |
+
|
| 9485 |
+
function generatePath(path, params) {
|
| 9486 |
+
if (path === void 0) {
|
| 9487 |
+
path = "/";
|
| 9488 |
+
}
|
| 9489 |
+
|
| 9490 |
+
if (params === void 0) {
|
| 9491 |
+
params = {};
|
| 9492 |
+
}
|
| 9493 |
+
|
| 9494 |
+
return path === "/" ? path : compilePath(path)(params, {
|
| 9495 |
+
pretty: true
|
| 9496 |
+
});
|
| 9497 |
+
}
|
| 9498 |
+
|
| 9499 |
+
/**
|
| 9500 |
+
* The public API for navigating programmatically with a component.
|
| 9501 |
+
*/
|
| 9502 |
+
|
| 9503 |
+
function Redirect(_ref) {
|
| 9504 |
+
var computedMatch = _ref.computedMatch,
|
| 9505 |
+
to = _ref.to,
|
| 9506 |
+
_ref$push = _ref.push,
|
| 9507 |
+
push = _ref$push === void 0 ? false : _ref$push;
|
| 9508 |
+
return external_React_default.a.createElement(react_router_context.Consumer, null, function (context) {
|
| 9509 |
+
!context ? false ? undefined : Object(tiny_invariant_esm["a" /* default */])(false) : void 0;
|
| 9510 |
+
var history = context.history,
|
| 9511 |
+
staticContext = context.staticContext;
|
| 9512 |
+
var method = push ? history.push : history.replace;
|
| 9513 |
+
var location = Object(esm_history["b" /* createLocation */])(computedMatch ? typeof to === "string" ? generatePath(to, computedMatch.params) : Object(esm_extends["a" /* default */])({}, to, {
|
| 9514 |
+
pathname: generatePath(to.pathname, computedMatch.params)
|
| 9515 |
+
}) : to); // When rendering in a static context,
|
| 9516 |
+
// set the new location immediately.
|
| 9517 |
+
|
| 9518 |
+
if (staticContext) {
|
| 9519 |
+
method(location);
|
| 9520 |
+
return null;
|
| 9521 |
+
}
|
| 9522 |
+
|
| 9523 |
+
return external_React_default.a.createElement(react_router_Lifecycle, {
|
| 9524 |
+
onMount: function onMount() {
|
| 9525 |
+
method(location);
|
| 9526 |
+
},
|
| 9527 |
+
onUpdate: function onUpdate(self, prevProps) {
|
| 9528 |
+
var prevLocation = Object(esm_history["b" /* createLocation */])(prevProps.to);
|
| 9529 |
+
|
| 9530 |
+
if (!Object(esm_history["e" /* locationsAreEqual */])(prevLocation, Object(esm_extends["a" /* default */])({}, location, {
|
| 9531 |
+
key: prevLocation.key
|
| 9532 |
+
}))) {
|
| 9533 |
+
method(location);
|
| 9534 |
+
}
|
| 9535 |
+
},
|
| 9536 |
+
to: to
|
| 9537 |
+
});
|
| 9538 |
+
});
|
| 9539 |
+
}
|
| 9540 |
+
|
| 9541 |
+
if (false) {}
|
| 9542 |
+
|
| 9543 |
+
var cache$1 = {};
|
| 9544 |
+
var cacheLimit$1 = 10000;
|
| 9545 |
+
var cacheCount$1 = 0;
|
| 9546 |
+
|
| 9547 |
+
function compilePath$1(path, options) {
|
| 9548 |
+
var cacheKey = "" + options.end + options.strict + options.sensitive;
|
| 9549 |
+
var pathCache = cache$1[cacheKey] || (cache$1[cacheKey] = {});
|
| 9550 |
+
if (pathCache[path]) return pathCache[path];
|
| 9551 |
+
var keys = [];
|
| 9552 |
+
var regexp = path_to_regexp_default()(path, keys, options);
|
| 9553 |
+
var result = {
|
| 9554 |
+
regexp: regexp,
|
| 9555 |
+
keys: keys
|
| 9556 |
+
};
|
| 9557 |
+
|
| 9558 |
+
if (cacheCount$1 < cacheLimit$1) {
|
| 9559 |
+
pathCache[path] = result;
|
| 9560 |
+
cacheCount$1++;
|
| 9561 |
+
}
|
| 9562 |
+
|
| 9563 |
+
return result;
|
| 9564 |
+
}
|
| 9565 |
+
/**
|
| 9566 |
+
* Public API for matching a URL pathname to a path.
|
| 9567 |
+
*/
|
| 9568 |
+
|
| 9569 |
+
|
| 9570 |
+
function matchPath(pathname, options) {
|
| 9571 |
+
if (options === void 0) {
|
| 9572 |
+
options = {};
|
| 9573 |
+
}
|
| 9574 |
+
|
| 9575 |
+
if (typeof options === "string" || Array.isArray(options)) {
|
| 9576 |
+
options = {
|
| 9577 |
+
path: options
|
| 9578 |
+
};
|
| 9579 |
+
}
|
| 9580 |
+
|
| 9581 |
+
var _options = options,
|
| 9582 |
+
path = _options.path,
|
| 9583 |
+
_options$exact = _options.exact,
|
| 9584 |
+
exact = _options$exact === void 0 ? false : _options$exact,
|
| 9585 |
+
_options$strict = _options.strict,
|
| 9586 |
+
strict = _options$strict === void 0 ? false : _options$strict,
|
| 9587 |
+
_options$sensitive = _options.sensitive,
|
| 9588 |
+
sensitive = _options$sensitive === void 0 ? false : _options$sensitive;
|
| 9589 |
+
var paths = [].concat(path);
|
| 9590 |
+
return paths.reduce(function (matched, path) {
|
| 9591 |
+
if (!path && path !== "") return null;
|
| 9592 |
+
if (matched) return matched;
|
| 9593 |
+
|
| 9594 |
+
var _compilePath = compilePath$1(path, {
|
| 9595 |
+
end: exact,
|
| 9596 |
+
strict: strict,
|
| 9597 |
+
sensitive: sensitive
|
| 9598 |
+
}),
|
| 9599 |
+
regexp = _compilePath.regexp,
|
| 9600 |
+
keys = _compilePath.keys;
|
| 9601 |
+
|
| 9602 |
+
var match = regexp.exec(pathname);
|
| 9603 |
+
if (!match) return null;
|
| 9604 |
+
var url = match[0],
|
| 9605 |
+
values = match.slice(1);
|
| 9606 |
+
var isExact = pathname === url;
|
| 9607 |
+
if (exact && !isExact) return null;
|
| 9608 |
+
return {
|
| 9609 |
+
path: path,
|
| 9610 |
+
// the path used to match
|
| 9611 |
+
url: path === "/" && url === "" ? "/" : url,
|
| 9612 |
+
// the matched portion of the URL
|
| 9613 |
+
isExact: isExact,
|
| 9614 |
+
// whether or not we matched exactly
|
| 9615 |
+
params: keys.reduce(function (memo, key, index) {
|
| 9616 |
+
memo[key.name] = values[index];
|
| 9617 |
+
return memo;
|
| 9618 |
+
}, {})
|
| 9619 |
+
};
|
| 9620 |
+
}, null);
|
| 9621 |
+
}
|
| 9622 |
+
|
| 9623 |
+
function isEmptyChildren(children) {
|
| 9624 |
+
return external_React_default.a.Children.count(children) === 0;
|
| 9625 |
+
}
|
| 9626 |
+
|
| 9627 |
+
function evalChildrenDev(children, props, path) {
|
| 9628 |
+
var value = children(props);
|
| 9629 |
+
false ? undefined : void 0;
|
| 9630 |
+
return value || null;
|
| 9631 |
+
}
|
| 9632 |
+
/**
|
| 9633 |
+
* The public API for matching a single path and rendering.
|
| 9634 |
+
*/
|
| 9635 |
+
|
| 9636 |
+
|
| 9637 |
+
var react_router_Route =
|
| 9638 |
+
/*#__PURE__*/
|
| 9639 |
+
function (_React$Component) {
|
| 9640 |
+
Object(inheritsLoose["a" /* default */])(Route, _React$Component);
|
| 9641 |
+
|
| 9642 |
+
function Route() {
|
| 9643 |
+
return _React$Component.apply(this, arguments) || this;
|
| 9644 |
+
}
|
| 9645 |
+
|
| 9646 |
+
var _proto = Route.prototype;
|
| 9647 |
+
|
| 9648 |
+
_proto.render = function render() {
|
| 9649 |
+
var _this = this;
|
| 9650 |
+
|
| 9651 |
+
return external_React_default.a.createElement(react_router_context.Consumer, null, function (context$1) {
|
| 9652 |
+
!context$1 ? false ? undefined : Object(tiny_invariant_esm["a" /* default */])(false) : void 0;
|
| 9653 |
+
var location = _this.props.location || context$1.location;
|
| 9654 |
+
var match = _this.props.computedMatch ? _this.props.computedMatch // <Switch> already computed the match for us
|
| 9655 |
+
: _this.props.path ? matchPath(location.pathname, _this.props) : context$1.match;
|
| 9656 |
+
|
| 9657 |
+
var props = Object(esm_extends["a" /* default */])({}, context$1, {
|
| 9658 |
+
location: location,
|
| 9659 |
+
match: match
|
| 9660 |
+
});
|
| 9661 |
+
|
| 9662 |
+
var _this$props = _this.props,
|
| 9663 |
+
children = _this$props.children,
|
| 9664 |
+
component = _this$props.component,
|
| 9665 |
+
render = _this$props.render; // Preact uses an empty array as children by
|
| 9666 |
+
// default, so use null if that's the case.
|
| 9667 |
+
|
| 9668 |
+
if (Array.isArray(children) && children.length === 0) {
|
| 9669 |
+
children = null;
|
| 9670 |
+
}
|
| 9671 |
+
|
| 9672 |
+
return external_React_default.a.createElement(react_router_context.Provider, {
|
| 9673 |
+
value: props
|
| 9674 |
+
}, props.match ? children ? typeof children === "function" ? false ? undefined : children(props) : children : component ? external_React_default.a.createElement(component, props) : render ? render(props) : null : typeof children === "function" ? false ? undefined : children(props) : null);
|
| 9675 |
+
});
|
| 9676 |
+
};
|
| 9677 |
+
|
| 9678 |
+
return Route;
|
| 9679 |
+
}(external_React_default.a.Component);
|
| 9680 |
+
|
| 9681 |
+
if (false) {}
|
| 9682 |
+
|
| 9683 |
+
function addLeadingSlash(path) {
|
| 9684 |
+
return path.charAt(0) === "/" ? path : "/" + path;
|
| 9685 |
+
}
|
| 9686 |
+
|
| 9687 |
+
function addBasename(basename, location) {
|
| 9688 |
+
if (!basename) return location;
|
| 9689 |
+
return Object(esm_extends["a" /* default */])({}, location, {
|
| 9690 |
+
pathname: addLeadingSlash(basename) + location.pathname
|
| 9691 |
+
});
|
| 9692 |
+
}
|
| 9693 |
+
|
| 9694 |
+
function stripBasename(basename, location) {
|
| 9695 |
+
if (!basename) return location;
|
| 9696 |
+
var base = addLeadingSlash(basename);
|
| 9697 |
+
if (location.pathname.indexOf(base) !== 0) return location;
|
| 9698 |
+
return Object(esm_extends["a" /* default */])({}, location, {
|
| 9699 |
+
pathname: location.pathname.substr(base.length)
|
| 9700 |
+
});
|
| 9701 |
+
}
|
| 9702 |
+
|
| 9703 |
+
function createURL(location) {
|
| 9704 |
+
return typeof location === "string" ? location : Object(esm_history["d" /* createPath */])(location);
|
| 9705 |
+
}
|
| 9706 |
+
|
| 9707 |
+
function staticHandler(methodName) {
|
| 9708 |
+
return function () {
|
| 9709 |
+
false ? undefined : Object(tiny_invariant_esm["a" /* default */])(false) ;
|
| 9710 |
+
};
|
| 9711 |
+
}
|
| 9712 |
+
|
| 9713 |
+
function noop() {}
|
| 9714 |
+
/**
|
| 9715 |
+
* The public top-level API for a "static" <Router>, so-called because it
|
| 9716 |
+
* can't actually change the current location. Instead, it just records
|
| 9717 |
+
* location changes in a context object. Useful mainly in testing and
|
| 9718 |
+
* server-rendering scenarios.
|
| 9719 |
+
*/
|
| 9720 |
+
|
| 9721 |
+
|
| 9722 |
+
var react_router_StaticRouter =
|
| 9723 |
+
/*#__PURE__*/
|
| 9724 |
+
function (_React$Component) {
|
| 9725 |
+
Object(inheritsLoose["a" /* default */])(StaticRouter, _React$Component);
|
| 9726 |
+
|
| 9727 |
+
function StaticRouter() {
|
| 9728 |
+
var _this;
|
| 9729 |
+
|
| 9730 |
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
| 9731 |
+
args[_key] = arguments[_key];
|
| 9732 |
+
}
|
| 9733 |
+
|
| 9734 |
+
_this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
|
| 9735 |
+
|
| 9736 |
+
_this.handlePush = function (location) {
|
| 9737 |
+
return _this.navigateTo(location, "PUSH");
|
| 9738 |
+
};
|
| 9739 |
+
|
| 9740 |
+
_this.handleReplace = function (location) {
|
| 9741 |
+
return _this.navigateTo(location, "REPLACE");
|
| 9742 |
+
};
|
| 9743 |
+
|
| 9744 |
+
_this.handleListen = function () {
|
| 9745 |
+
return noop;
|
| 9746 |
+
};
|
| 9747 |
+
|
| 9748 |
+
_this.handleBlock = function () {
|
| 9749 |
+
return noop;
|
| 9750 |
+
};
|
| 9751 |
+
|
| 9752 |
+
return _this;
|
| 9753 |
+
}
|
| 9754 |
+
|
| 9755 |
+
var _proto = StaticRouter.prototype;
|
| 9756 |
+
|
| 9757 |
+
_proto.navigateTo = function navigateTo(location, action) {
|
| 9758 |
+
var _this$props = this.props,
|
| 9759 |
+
_this$props$basename = _this$props.basename,
|
| 9760 |
+
basename = _this$props$basename === void 0 ? "" : _this$props$basename,
|
| 9761 |
+
_this$props$context = _this$props.context,
|
| 9762 |
+
context = _this$props$context === void 0 ? {} : _this$props$context;
|
| 9763 |
+
context.action = action;
|
| 9764 |
+
context.location = addBasename(basename, Object(esm_history["b" /* createLocation */])(location));
|
| 9765 |
+
context.url = createURL(context.location);
|
| 9766 |
+
};
|
| 9767 |
+
|
| 9768 |
+
_proto.render = function render() {
|
| 9769 |
+
var _this$props2 = this.props,
|
| 9770 |
+
_this$props2$basename = _this$props2.basename,
|
| 9771 |
+
basename = _this$props2$basename === void 0 ? "" : _this$props2$basename,
|
| 9772 |
+
_this$props2$context = _this$props2.context,
|
| 9773 |
+
context = _this$props2$context === void 0 ? {} : _this$props2$context,
|
| 9774 |
+
_this$props2$location = _this$props2.location,
|
| 9775 |
+
location = _this$props2$location === void 0 ? "/" : _this$props2$location,
|
| 9776 |
+
rest = Object(objectWithoutPropertiesLoose["a" /* default */])(_this$props2, ["basename", "context", "location"]);
|
| 9777 |
+
|
| 9778 |
+
var history = {
|
| 9779 |
+
createHref: function createHref(path) {
|
| 9780 |
+
return addLeadingSlash(basename + createURL(path));
|
| 9781 |
+
},
|
| 9782 |
+
action: "POP",
|
| 9783 |
+
location: stripBasename(basename, Object(esm_history["b" /* createLocation */])(location)),
|
| 9784 |
+
push: this.handlePush,
|
| 9785 |
+
replace: this.handleReplace,
|
| 9786 |
+
go: staticHandler("go"),
|
| 9787 |
+
goBack: staticHandler("goBack"),
|
| 9788 |
+
goForward: staticHandler("goForward"),
|
| 9789 |
+
listen: this.handleListen,
|
| 9790 |
+
block: this.handleBlock
|
| 9791 |
+
};
|
| 9792 |
+
return external_React_default.a.createElement(react_router_Router, Object(esm_extends["a" /* default */])({}, rest, {
|
| 9793 |
+
history: history,
|
| 9794 |
+
staticContext: context
|
| 9795 |
+
}));
|
| 9796 |
+
};
|
| 9797 |
+
|
| 9798 |
+
return StaticRouter;
|
| 9799 |
+
}(external_React_default.a.Component);
|
| 9800 |
+
|
| 9801 |
+
if (false) {}
|
| 9802 |
+
|
| 9803 |
+
/**
|
| 9804 |
+
* The public API for rendering the first <Route> that matches.
|
| 9805 |
+
*/
|
| 9806 |
+
|
| 9807 |
+
var react_router_Switch =
|
| 9808 |
+
/*#__PURE__*/
|
| 9809 |
+
function (_React$Component) {
|
| 9810 |
+
Object(inheritsLoose["a" /* default */])(Switch, _React$Component);
|
| 9811 |
+
|
| 9812 |
+
function Switch() {
|
| 9813 |
+
return _React$Component.apply(this, arguments) || this;
|
| 9814 |
+
}
|
| 9815 |
+
|
| 9816 |
+
var _proto = Switch.prototype;
|
| 9817 |
+
|
| 9818 |
+
_proto.render = function render() {
|
| 9819 |
+
var _this = this;
|
| 9820 |
+
|
| 9821 |
+
return external_React_default.a.createElement(react_router_context.Consumer, null, function (context) {
|
| 9822 |
+
!context ? false ? undefined : Object(tiny_invariant_esm["a" /* default */])(false) : void 0;
|
| 9823 |
+
var location = _this.props.location || context.location;
|
| 9824 |
+
var element, match; // We use React.Children.forEach instead of React.Children.toArray().find()
|
| 9825 |
+
// here because toArray adds keys to all child elements and we do not want
|
| 9826 |
+
// to trigger an unmount/remount for two <Route>s that render the same
|
| 9827 |
+
// component at different URLs.
|
| 9828 |
+
|
| 9829 |
+
external_React_default.a.Children.forEach(_this.props.children, function (child) {
|
| 9830 |
+
if (match == null && external_React_default.a.isValidElement(child)) {
|
| 9831 |
+
element = child;
|
| 9832 |
+
var path = child.props.path || child.props.from;
|
| 9833 |
+
match = path ? matchPath(location.pathname, Object(esm_extends["a" /* default */])({}, child.props, {
|
| 9834 |
+
path: path
|
| 9835 |
+
})) : context.match;
|
| 9836 |
+
}
|
| 9837 |
+
});
|
| 9838 |
+
return match ? external_React_default.a.cloneElement(element, {
|
| 9839 |
+
location: location,
|
| 9840 |
+
computedMatch: match
|
| 9841 |
+
}) : null;
|
| 9842 |
+
});
|
| 9843 |
+
};
|
| 9844 |
+
|
| 9845 |
+
return Switch;
|
| 9846 |
+
}(external_React_default.a.Component);
|
| 9847 |
+
|
| 9848 |
+
if (false) {}
|
| 9849 |
+
|
| 9850 |
+
/**
|
| 9851 |
+
* A public higher-order component to access the imperative API
|
| 9852 |
+
*/
|
| 9853 |
+
|
| 9854 |
+
function withRouter(Component) {
|
| 9855 |
+
var displayName = "withRouter(" + (Component.displayName || Component.name) + ")";
|
| 9856 |
+
|
| 9857 |
+
var C = function C(props) {
|
| 9858 |
+
var wrappedComponentRef = props.wrappedComponentRef,
|
| 9859 |
+
remainingProps = Object(objectWithoutPropertiesLoose["a" /* default */])(props, ["wrappedComponentRef"]);
|
| 9860 |
+
|
| 9861 |
+
return external_React_default.a.createElement(react_router_context.Consumer, null, function (context) {
|
| 9862 |
+
!context ? false ? undefined : Object(tiny_invariant_esm["a" /* default */])(false) : void 0;
|
| 9863 |
+
return external_React_default.a.createElement(Component, Object(esm_extends["a" /* default */])({}, remainingProps, context, {
|
| 9864 |
+
ref: wrappedComponentRef
|
| 9865 |
+
}));
|
| 9866 |
+
});
|
| 9867 |
+
};
|
| 9868 |
+
|
| 9869 |
+
C.displayName = displayName;
|
| 9870 |
+
C.WrappedComponent = Component;
|
| 9871 |
+
|
| 9872 |
+
if (false) {}
|
| 9873 |
+
|
| 9874 |
+
return hoist_non_react_statics_cjs_default()(C, Component);
|
| 9875 |
+
}
|
| 9876 |
+
|
| 9877 |
+
var useContext = external_React_default.a.useContext;
|
| 9878 |
+
function useHistory() {
|
| 9879 |
+
if (false) {}
|
| 9880 |
+
|
| 9881 |
+
return useContext(react_router_context).history;
|
| 9882 |
+
}
|
| 9883 |
+
function useLocation() {
|
| 9884 |
+
if (false) {}
|
| 9885 |
+
|
| 9886 |
+
return useContext(react_router_context).location;
|
| 9887 |
+
}
|
| 9888 |
+
function useParams() {
|
| 9889 |
+
if (false) {}
|
| 9890 |
+
|
| 9891 |
+
var match = useContext(react_router_context).match;
|
| 9892 |
+
return match ? match.params : {};
|
| 9893 |
+
}
|
| 9894 |
+
function useRouteMatch(path) {
|
| 9895 |
+
if (false) {}
|
| 9896 |
+
|
| 9897 |
+
return path ? matchPath(useLocation().pathname, path) : useContext(react_router_context).match;
|
| 9898 |
+
}
|
| 9899 |
+
|
| 9900 |
+
if (false) { var secondaryBuildName, initialBuildName, buildNames, react_router_key, global; }
|
| 9901 |
+
|
| 9902 |
+
|
| 9903 |
+
//# sourceMappingURL=react-router.js.map
|
| 9904 |
+
|
| 9905 |
+
// EXTERNAL MODULE: external "lodash"
|
| 9906 |
+
var external_lodash_ = __webpack_require__(2);
|
| 9907 |
+
|
| 9908 |
+
// EXTERNAL MODULE: ./node_modules/qs/lib/index.js
|
| 9909 |
+
var lib = __webpack_require__(87);
|
| 9910 |
+
|
| 9911 |
+
// EXTERNAL MODULE: external {"this":["wc","components"]}
|
| 9912 |
+
var external_this_wc_components_ = __webpack_require__(77);
|
| 9913 |
+
|
| 9914 |
+
// EXTERNAL MODULE: external {"this":["wc","navigation"]}
|
| 9915 |
+
var external_this_wc_navigation_ = __webpack_require__(32);
|
| 9916 |
+
|
| 9917 |
+
// EXTERNAL MODULE: ./client/settings/index.js
|
| 9918 |
+
var settings = __webpack_require__(36);
|
| 9919 |
+
|
| 9920 |
+
// EXTERNAL MODULE: external {"this":["wc","data"]}
|
| 9921 |
+
var external_this_wc_data_ = __webpack_require__(35);
|
| 9922 |
+
|
| 9923 |
+
// EXTERNAL MODULE: external {"this":["wc","tracks"]}
|
| 9924 |
+
var external_this_wc_tracks_ = __webpack_require__(64);
|
| 9925 |
+
|
| 9926 |
+
// EXTERNAL MODULE: ./client/layout/style.scss
|
| 9927 |
+
var layout_style = __webpack_require__(566);
|
| 9928 |
+
|
| 9929 |
+
// EXTERNAL MODULE: external {"this":["wp","hooks"]}
|
| 9930 |
+
var external_this_wp_hooks_ = __webpack_require__(55);
|
| 9931 |
+
|
| 9932 |
+
// EXTERNAL MODULE: external {"this":["wp","i18n"]}
|
| 9933 |
+
var external_this_wp_i18n_ = __webpack_require__(3);
|
| 9934 |
+
|
| 9935 |
+
// EXTERNAL MODULE: ./client/analytics/report/get-reports.js
|
| 9936 |
+
var get_reports = __webpack_require__(292);
|
| 9937 |
+
|
| 9938 |
+
// EXTERNAL MODULE: ./client/dashboard/utils.js
|
| 9939 |
+
var utils = __webpack_require__(191);
|
| 9940 |
+
|
| 9941 |
+
// CONCATENATED MODULE: ./client/layout/controller.js
|
| 9942 |
+
|
| 9943 |
+
|
| 9944 |
+
|
| 9945 |
+
|
| 9946 |
+
|
| 9947 |
+
|
| 9948 |
+
|
| 9949 |
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = getPrototypeOf_default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = getPrototypeOf_default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return possibleConstructorReturn_default()(this, result); }; }
|
| 9950 |
+
|
| 9951 |
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
| 9952 |
+
|
| 9953 |
+
/**
|
| 9954 |
+
* External dependencies
|
| 9955 |
+
*/
|
| 9956 |
+
|
| 9957 |
+
|
| 9958 |
+
|
| 9959 |
+
|
| 9960 |
+
|
| 9961 |
+
|
| 9962 |
+
|
| 9963 |
+
/**
|
| 9964 |
+
* Internal dependencies
|
| 9965 |
+
*/
|
| 9966 |
+
|
| 9967 |
+
|
| 9968 |
+
|
| 9969 |
+
var AnalyticsReport = Object(external_this_wp_element_["lazy"])(function () {
|
| 9970 |
+
return __webpack_require__.e(/* import() | analytics-report */ 13).then(__webpack_require__.bind(null, 840));
|
| 9971 |
+
});
|
| 9972 |
+
var AnalyticsSettings = Object(external_this_wp_element_["lazy"])(function () {
|
| 9973 |
+
return Promise.all(/* import() | analytics-settings */[__webpack_require__.e(3), __webpack_require__.e(24)]).then(__webpack_require__.bind(null, 850));
|
| 9974 |
+
});
|
| 9975 |
+
var Dashboard = Object(external_this_wp_element_["lazy"])(function () {
|
| 9976 |
+
return __webpack_require__.e(/* import() | dashboard */ 31).then(__webpack_require__.bind(null, 841));
|
| 9977 |
+
});
|
| 9978 |
+
var Homescreen = Object(external_this_wp_element_["lazy"])(function () {
|
| 9979 |
+
return Promise.all(/* import() | homescreen */[__webpack_require__.e(2), __webpack_require__.e(4), __webpack_require__.e(5), __webpack_require__.e(6), __webpack_require__.e(35)]).then(__webpack_require__.bind(null, 847));
|
| 9980 |
+
});
|
| 9981 |
+
var MarketingOverview = Object(external_this_wp_element_["lazy"])(function () {
|
| 9982 |
+
return Promise.all(/* import() | marketing-overview */[__webpack_require__.e(2), __webpack_require__.e(5), __webpack_require__.e(6), __webpack_require__.e(39)]).then(__webpack_require__.bind(null, 852));
|
| 9983 |
+
});
|
| 9984 |
+
var ProfileWizard = Object(external_this_wp_element_["lazy"])(function () {
|
| 9985 |
+
return Promise.all(/* import() | profile-wizard */[__webpack_require__.e(2), __webpack_require__.e(5), __webpack_require__.e(53), __webpack_require__.e(47)]).then(__webpack_require__.bind(null, 848));
|
| 9986 |
+
});
|
| 9987 |
+
var TIME_EXCLUDED_SCREENS_FILTER = 'woocommerce_admin_time_excluded_screens';
|
| 9988 |
+
var PAGES_FILTER = 'woocommerce_admin_pages_list';
|
| 9989 |
+
var controller_getPages = function getPages() {
|
| 9990 |
+
var pages = [];
|
| 9991 |
+
var initialBreadcrumbs = [['', wcSettings.woocommerceTranslation]];
|
| 9992 |
+
pages.push({
|
| 9993 |
+
container: Homescreen,
|
| 9994 |
+
path: '/',
|
| 9995 |
+
breadcrumbs: [].concat(initialBreadcrumbs, [Object(external_this_wp_i18n_["__"])('Home', 'woocommerce-admin')]),
|
| 9996 |
+
wpOpenMenu: 'toplevel_page_woocommerce',
|
| 9997 |
+
id: 'home'
|
| 9998 |
+
});
|
| 9999 |
+
|
| 10000 |
+
if (window.wcAdminFeatures.analytics) {
|
| 10001 |
+
pages.push({
|
| 10002 |
+
container: Dashboard,
|
| 10003 |
+
path: '/analytics/overview',
|
| 10004 |
+
breadcrumbs: [].concat(initialBreadcrumbs, [['/analytics/overview', Object(external_this_wp_i18n_["__"])('Analytics', 'woocommerce-admin')], Object(external_this_wp_i18n_["__"])('Overview', 'woocommerce-admin')]),
|
| 10005 |
+
wpOpenMenu: 'toplevel_page_wc-admin-path--analytics-overview',
|
| 10006 |
+
id: 'woocommerce-analytics-overview'
|
| 10007 |
+
});
|
| 10008 |
+
pages.push({
|
| 10009 |
+
container: AnalyticsSettings,
|
| 10010 |
+
path: '/analytics/settings',
|
| 10011 |
+
breadcrumbs: [].concat(initialBreadcrumbs, [['/analytics/revenue', Object(external_this_wp_i18n_["__"])('Analytics', 'woocommerce-admin')], Object(external_this_wp_i18n_["__"])('Settings', 'woocommerce-admin')]),
|
| 10012 |
+
wpOpenMenu: 'toplevel_page_wc-admin-path--analytics-overview',
|
| 10013 |
+
id: 'woocommerce-analytics-settings'
|
| 10014 |
+
});
|
| 10015 |
+
pages.push({
|
| 10016 |
+
container: AnalyticsReport,
|
| 10017 |
+
path: '/customers',
|
| 10018 |
+
breadcrumbs: [].concat(initialBreadcrumbs, [Object(external_this_wp_i18n_["__"])('Customers', 'woocommerce-admin')]),
|
| 10019 |
+
wpOpenMenu: 'toplevel_page_woocommerce',
|
| 10020 |
+
id: 'woocommerce-analytics-customers'
|
| 10021 |
+
});
|
| 10022 |
+
pages.push({
|
| 10023 |
+
container: AnalyticsReport,
|
| 10024 |
+
path: '/analytics/:report',
|
| 10025 |
+
breadcrumbs: function breadcrumbs(_ref) {
|
| 10026 |
+
var match = _ref.match;
|
| 10027 |
+
var report = Object(external_lodash_["find"])(Object(get_reports["a" /* default */])(), {
|
| 10028 |
+
report: match.params.report
|
| 10029 |
+
});
|
| 10030 |
+
|
| 10031 |
+
if (!report) {
|
| 10032 |
+
return [];
|
| 10033 |
+
}
|
| 10034 |
+
|
| 10035 |
+
return [].concat(initialBreadcrumbs, [['/analytics/revenue', Object(external_this_wp_i18n_["__"])('Analytics', 'woocommerce-admin')], report.title]);
|
| 10036 |
+
},
|
| 10037 |
+
wpOpenMenu: 'toplevel_page_wc-admin-path--analytics-overview'
|
| 10038 |
+
});
|
| 10039 |
+
}
|
| 10040 |
+
|
| 10041 |
+
if (window.wcAdminFeatures.marketing) {
|
| 10042 |
+
pages.push({
|
| 10043 |
+
container: MarketingOverview,
|
| 10044 |
+
path: '/marketing',
|
| 10045 |
+
breadcrumbs: [].concat(initialBreadcrumbs, [['/marketing', Object(external_this_wp_i18n_["__"])('Marketing', 'woocommerce-admin')], Object(external_this_wp_i18n_["__"])('Overview', 'woocommerce-admin')]),
|
| 10046 |
+
wpOpenMenu: 'toplevel_page_woocommerce-marketing',
|
| 10047 |
+
id: 'woocommerce-marketing'
|
| 10048 |
+
});
|
| 10049 |
+
}
|
| 10050 |
+
|
| 10051 |
+
if (window.wcAdminFeatures.onboarding) {
|
| 10052 |
+
pages.push({
|
| 10053 |
+
container: ProfileWizard,
|
| 10054 |
+
path: '/setup-wizard',
|
| 10055 |
+
breadcrumbs: [].concat(initialBreadcrumbs, [['/setup-wizard', Object(external_this_wp_i18n_["__"])('Setup Wizard', 'woocommerce-admin')]])
|
| 10056 |
+
});
|
| 10057 |
+
}
|
| 10058 |
+
|
| 10059 |
+
return Object(external_this_wp_hooks_["applyFilters"])(PAGES_FILTER, pages);
|
| 10060 |
+
};
|
| 10061 |
+
var controller_Controller = /*#__PURE__*/function (_Component) {
|
| 10062 |
+
inherits_default()(Controller, _Component);
|
| 10063 |
+
|
| 10064 |
+
var _super = _createSuper(Controller);
|
| 10065 |
+
|
| 10066 |
+
function Controller() {
|
| 10067 |
+
classCallCheck_default()(this, Controller);
|
| 10068 |
+
|
| 10069 |
+
return _super.apply(this, arguments);
|
| 10070 |
+
}
|
| 10071 |
+
|
| 10072 |
+
createClass_default()(Controller, [{
|
| 10073 |
+
key: "componentDidMount",
|
| 10074 |
+
value: function componentDidMount() {
|
| 10075 |
+
window.document.documentElement.scrollTop = 0;
|
| 10076 |
+
window.document.body.classList.remove('woocommerce-admin-is-loading');
|
| 10077 |
+
}
|
| 10078 |
+
}, {
|
| 10079 |
+
key: "componentDidUpdate",
|
| 10080 |
+
value: function componentDidUpdate(prevProps) {
|
| 10081 |
+
var prevBaseQuery = Object(external_lodash_["omit"])(prevProps.query, 'chartType', 'filter', 'paged');
|
| 10082 |
+
var baseQuery = Object(external_lodash_["omit"])(this.props.query, 'chartType', 'filter', 'paged');
|
| 10083 |
+
|
| 10084 |
+
if (prevProps.query.paged > 1 && !Object(external_lodash_["isEqual"])(prevBaseQuery, baseQuery)) {
|
| 10085 |
+
Object(external_this_wc_navigation_["getHistory"])().replace(Object(external_this_wc_navigation_["getNewPath"])({
|
| 10086 |
+
paged: 1
|
| 10087 |
+
}));
|
| 10088 |
+
}
|
| 10089 |
+
|
| 10090 |
+
if (prevProps.match.url !== this.props.match.url) {
|
| 10091 |
+
window.document.documentElement.scrollTop = 0;
|
| 10092 |
+
}
|
| 10093 |
+
}
|
| 10094 |
+
}, {
|
| 10095 |
+
key: "render",
|
| 10096 |
+
value: function render() {
|
| 10097 |
+
var _this$props = this.props,
|
| 10098 |
+
page = _this$props.page,
|
| 10099 |
+
match = _this$props.match,
|
| 10100 |
+
query = _this$props.query;
|
| 10101 |
+
var url = match.url,
|
| 10102 |
+
params = match.params;
|
| 10103 |
+
window.wpNavMenuUrlUpdate(query);
|
| 10104 |
+
window.wpNavMenuClassChange(page, url);
|
| 10105 |
+
return Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Suspense"], {
|
| 10106 |
+
fallback: Object(external_this_wp_element_["createElement"])(external_this_wc_components_["Spinner"], null)
|
| 10107 |
+
}, Object(external_this_wp_element_["createElement"])(page.container, {
|
| 10108 |
+
params: params,
|
| 10109 |
+
path: url,
|
| 10110 |
+
pathMatch: page.path,
|
| 10111 |
+
query: query
|
| 10112 |
+
}));
|
| 10113 |
+
}
|
| 10114 |
+
}]);
|
| 10115 |
+
|
| 10116 |
+
return Controller;
|
| 10117 |
+
}(external_this_wp_element_["Component"]);
|
| 10118 |
+
/**
|
| 10119 |
+
* Update an anchor's link in sidebar to include persisted queries. Leave excluded screens
|
| 10120 |
+
* as is.
|
| 10121 |
+
*
|
| 10122 |
+
* @param {HTMLElement} item - Sidebar anchor link.
|
| 10123 |
+
* @param {Object} nextQuery - A query object to be added to updated hrefs.
|
| 10124 |
+
* @param {Array} excludedScreens - wc-admin screens to avoid updating.
|
| 10125 |
+
*/
|
| 10126 |
+
|
| 10127 |
+
function updateLinkHref(item, nextQuery, excludedScreens) {
|
| 10128 |
+
if (Object(utils["f" /* isWCAdmin */])(item.href)) {
|
| 10129 |
+
var search = Object(external_lodash_["last"])(item.href.split('?'));
|
| 10130 |
+
var query = Object(lib["parse"])(search);
|
| 10131 |
+
var path = query.path || 'homescreen';
|
| 10132 |
+
var screen = path.replace('/analytics', '').replace('/', '');
|
| 10133 |
+
var isExcludedScreen = excludedScreens.includes(screen);
|
| 10134 |
+
var href = 'admin.php?' + Object(lib["stringify"])(Object.assign(query, isExcludedScreen ? {} : nextQuery)); // Replace the href so you can see the url on hover.
|
| 10135 |
+
|
| 10136 |
+
item.href = href;
|
| 10137 |
+
|
| 10138 |
+
item.onclick = function (e) {
|
| 10139 |
+
e.preventDefault();
|
| 10140 |
+
Object(external_this_wc_navigation_["getHistory"])().push(href);
|
| 10141 |
+
};
|
| 10142 |
+
}
|
| 10143 |
+
} // Update's wc-admin links in wp-admin menu
|
| 10144 |
+
|
| 10145 |
+
window.wpNavMenuUrlUpdate = function (query) {
|
| 10146 |
+
var excludedScreens = Object(external_this_wp_hooks_["applyFilters"])(TIME_EXCLUDED_SCREENS_FILTER, ['stock', 'settings', 'customers', 'homescreen']);
|
| 10147 |
+
var nextQuery = Object(external_this_wc_navigation_["getPersistedQuery"])(query);
|
| 10148 |
+
Array.from(document.querySelectorAll('#adminmenu a')).forEach(function (item) {
|
| 10149 |
+
return updateLinkHref(item, nextQuery, excludedScreens);
|
| 10150 |
+
});
|
| 10151 |
+
}; // When the route changes, we need to update wp-admin's menu with the correct section & current link
|
| 10152 |
+
|
| 10153 |
+
|
| 10154 |
+
window.wpNavMenuClassChange = function (page, url) {
|
| 10155 |
+
Array.from(document.getElementsByClassName('current')).forEach(function (item) {
|
| 10156 |
+
item.classList.remove('current');
|
| 10157 |
+
});
|
| 10158 |
+
var submenu = Array.from(document.querySelectorAll('.wp-has-current-submenu'));
|
| 10159 |
+
submenu.forEach(function (element) {
|
| 10160 |
+
element.classList.remove('wp-has-current-submenu');
|
| 10161 |
+
element.classList.remove('wp-menu-open');
|
| 10162 |
+
element.classList.remove('selected');
|
| 10163 |
+
element.classList.add('wp-not-current-submenu');
|
| 10164 |
+
element.classList.add('menu-top');
|
| 10165 |
+
});
|
| 10166 |
+
var pageUrl = url === '/' ? 'admin.php?page=wc-admin' : 'admin.php?page=wc-admin&path=' + encodeURIComponent(url);
|
| 10167 |
+
var currentItemsSelector = url === '/' ? "li > a[href$=\"".concat(pageUrl, "\"], li > a[href*=\"").concat(pageUrl, "?\"]") : "li > a[href*=\"".concat(pageUrl, "\"]");
|
| 10168 |
+
var currentItems = document.querySelectorAll(currentItemsSelector);
|
| 10169 |
+
Array.from(currentItems).forEach(function (item) {
|
| 10170 |
+
item.parentElement.classList.add('current');
|
| 10171 |
+
});
|
| 10172 |
+
|
| 10173 |
+
if (page.wpOpenMenu) {
|
| 10174 |
+
var currentMenu = document.querySelector('#' + page.wpOpenMenu);
|
| 10175 |
+
|
| 10176 |
+
if (currentMenu) {
|
| 10177 |
+
currentMenu.classList.remove('wp-not-current-submenu');
|
| 10178 |
+
currentMenu.classList.add('wp-has-current-submenu');
|
| 10179 |
+
currentMenu.classList.add('wp-menu-open');
|
| 10180 |
+
currentMenu.classList.add('current');
|
| 10181 |
+
}
|
| 10182 |
+
}
|
| 10183 |
+
|
| 10184 |
+
var wpWrap = document.querySelector('#wpwrap');
|
| 10185 |
+
wpWrap.classList.remove('wp-responsive-open');
|
| 10186 |
+
};
|
| 10187 |
+
// EXTERNAL MODULE: ./node_modules/classnames/index.js
|
| 10188 |
+
var classnames = __webpack_require__(4);
|
| 10189 |
+
var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
|
| 10190 |
+
|
| 10191 |
+
// EXTERNAL MODULE: external {"this":["wp","htmlEntities"]}
|
| 10192 |
+
var external_this_wp_htmlEntities_ = __webpack_require__(81);
|
| 10193 |
+
|
| 10194 |
+
// EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/text/index.js + 3 modules
|
| 10195 |
+
var build_module_text = __webpack_require__(190);
|
| 10196 |
+
|
| 10197 |
+
// EXTERNAL MODULE: ./client/header/style.scss
|
| 10198 |
+
var header_style = __webpack_require__(567);
|
| 10199 |
+
|
| 10200 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/toConsumableArray.js
|
| 10201 |
+
var toConsumableArray = __webpack_require__(30);
|
| 10202 |
+
var toConsumableArray_default = /*#__PURE__*/__webpack_require__.n(toConsumableArray);
|
| 10203 |
+
|
| 10204 |
+
// EXTERNAL MODULE: ./node_modules/react-click-outside/dist/index.js
|
| 10205 |
+
var dist = __webpack_require__(533);
|
| 10206 |
+
var dist_default = /*#__PURE__*/__webpack_require__.n(dist);
|
| 10207 |
+
|
| 10208 |
+
// EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/button/index.js
|
| 10209 |
+
var build_module_button = __webpack_require__(72);
|
| 10210 |
+
|
| 10211 |
+
// EXTERNAL MODULE: ./node_modules/gridicons/dist/cross-small.js
|
| 10212 |
+
var cross_small = __webpack_require__(534);
|
| 10213 |
+
var cross_small_default = /*#__PURE__*/__webpack_require__.n(cross_small);
|
| 10214 |
+
|
| 10215 |
+
// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/icon/index.js
|
| 10216 |
+
var build_module_icon = __webpack_require__(570);
|
| 10217 |
+
|
| 10218 |
+
// EXTERNAL MODULE: ./node_modules/@wordpress/primitives/build-module/svg/index.js
|
| 10219 |
+
var svg = __webpack_require__(88);
|
| 10220 |
+
|
| 10221 |
+
// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/lifesaver.js
|
| 10222 |
+
|
| 10223 |
+
|
| 10224 |
+
/**
|
| 10225 |
+
* WordPress dependencies
|
| 10226 |
+
*/
|
| 10227 |
+
|
| 10228 |
+
var lifesaver = Object(external_this_wp_element_["createElement"])(svg["c" /* SVG */], {
|
| 10229 |
+
xmlns: "http://www.w3.org/2000/svg",
|
| 10230 |
+
viewBox: "0 0 24 24"
|
| 10231 |
+
}, Object(external_this_wp_element_["createElement"])(svg["b" /* Path */], {
|
| 10232 |
+
fillRule: "evenodd",
|
| 10233 |
+
d: "M17.375 15.656A6.47 6.47 0 0018.5 12a6.47 6.47 0 00-.943-3.374l-1.262.813c.448.749.705 1.625.705 2.561a4.977 4.977 0 01-.887 2.844l1.262.813zm-1.951 1.87l-.813-1.261A4.976 4.976 0 0112 17c-.958 0-1.852-.27-2.613-.736l-.812 1.261A6.47 6.47 0 0012 18.5a6.47 6.47 0 003.424-.974zm-8.8-1.87A6.47 6.47 0 015.5 12c0-1.235.344-2.39.943-3.373l1.261.812A4.977 4.977 0 007 12c0 1.056.328 2.036.887 2.843l-1.262.813zm2.581-7.803A4.977 4.977 0 0112 7c1.035 0 1.996.314 2.794.853l.812-1.262A6.47 6.47 0 0012 5.5a6.47 6.47 0 00-3.607 1.092l.812 1.261zM12 20a8 8 0 100-16 8 8 0 000 16zm0-4.5a3.5 3.5 0 100-7 3.5 3.5 0 000 7z",
|
| 10234 |
+
clipRule: "evenodd"
|
| 10235 |
+
}));
|
| 10236 |
+
/* harmony default export */ var library_lifesaver = (lifesaver);
|
| 10237 |
+
//# sourceMappingURL=lifesaver.js.map
|
| 10238 |
+
// EXTERNAL MODULE: ./client/header/activity-panel/style.scss
|
| 10239 |
+
var activity_panel_style = __webpack_require__(569);
|
| 10240 |
+
|
| 10241 |
+
// CONCATENATED MODULE: ./client/header/activity-panel/toggle-bubble.js
|
| 10242 |
+
|
| 10243 |
+
|
| 10244 |
+
/**
|
| 10245 |
+
* External dependencies
|
| 10246 |
+
*/
|
| 10247 |
+
|
| 10248 |
+
|
| 10249 |
+
|
| 10250 |
+
var toggle_bubble_ActivityPanelToggleBubble = function ActivityPanelToggleBubble(_ref) {
|
| 10251 |
+
var _ref$height = _ref.height,
|
| 10252 |
+
height = _ref$height === void 0 ? 24 : _ref$height,
|
| 10253 |
+
_ref$width = _ref.width,
|
| 10254 |
+
width = _ref$width === void 0 ? 24 : _ref$width,
|
| 10255 |
+
_ref$hasUnread = _ref.hasUnread,
|
| 10256 |
+
hasUnread = _ref$hasUnread === void 0 ? false : _ref$hasUnread;
|
| 10257 |
+
var classes = classnames_default()('woocommerce-layout__activity-panel-toggle-bubble', {
|
| 10258 |
+
'has-unread': hasUnread
|
| 10259 |
+
});
|
| 10260 |
+
/* eslint-disable max-len */
|
| 10261 |
+
|
| 10262 |
+
return Object(external_this_wp_element_["createElement"])("div", {
|
| 10263 |
+
className: classes
|
| 10264 |
+
}, Object(external_this_wp_element_["createElement"])("svg", {
|
| 10265 |
+
height: height,
|
| 10266 |
+
width: width,
|
| 10267 |
+
viewBox: "0 0 24 24"
|
| 10268 |
+
}, Object(external_this_wp_element_["createElement"])("path", {
|
| 10269 |
+
d: "M18.9 2H5.1C3.4 2 2 3.4 2 5.1v10.7C2 17.6 3.4 19 5.1 19H9l6 3-1-3h4.9c1.7 0 3.1-1.4 3.1-3.1V5.1C22 3.4 20.6 2 18.9 2zm-1.5 4.5c-.4.8-.8 2.1-1 3.9-.3 1.8-.4 3.1-.3 4.1 0 .3 0 .5-.1.7-.1.2-.3.4-.6.4s-.6-.1-.9-.4c-1-1-1.8-2.6-2.4-4.6-.7 1.4-1.2 2.4-1.6 3.1-.6 1.2-1.2 1.8-1.6 1.9-.3 0-.5-.2-.8-.7-.5-1.4-1.1-4.2-1.7-8.2 0-.3 0-.5.2-.7.1-.2.4-.3.7-.4.5 0 .9.2.9.8.3 2.3.7 4.2 1.1 5.7l2.4-4.5c.2-.4.4-.6.8-.6.5 0 .8.3.9.9.3 1.4.6 2.6 1 3.7.3-2.7.8-4.7 1.4-5.9.2-.3.4-.5.7-.5.2 0 .5.1.7.2.2.2.3.4.3.6 0 .2 0 .4-.1.5z"
|
| 10270 |
+
})));
|
| 10271 |
+
/* eslint-enable max-len */
|
| 10272 |
+
};
|
| 10273 |
+
|
| 10274 |
+
toggle_bubble_ActivityPanelToggleBubble.propTypes = {
|
| 10275 |
+
height: prop_types_default.a.number,
|
| 10276 |
+
width: prop_types_default.a.number,
|
| 10277 |
+
hasUnread: prop_types_default.a.bool
|
| 10278 |
+
};
|
| 10279 |
+
/* harmony default export */ var toggle_bubble = (toggle_bubble_ActivityPanelToggleBubble);
|
| 10280 |
+
// EXTERNAL MODULE: ./client/inbox-panel/utils.js
|
| 10281 |
+
var inbox_panel_utils = __webpack_require__(446);
|
| 10282 |
+
|
| 10283 |
+
// CONCATENATED MODULE: ./client/header/activity-panel/unread-indicators.js
|
| 10284 |
+
/**
|
| 10285 |
+
* External dependencies
|
| 10286 |
+
*/
|
| 10287 |
+
|
| 10288 |
+
|
| 10289 |
+
/**
|
| 10290 |
+
* Internal dependencies
|
| 10291 |
+
*/
|
| 10292 |
+
|
| 10293 |
+
|
| 10294 |
+
function getUnreadNotes(select) {
|
| 10295 |
+
var _select = select(external_this_wc_data_["NOTES_STORE_NAME"]),
|
| 10296 |
+
getNotes = _select.getNotes,
|
| 10297 |
+
getNotesError = _select.getNotesError,
|
| 10298 |
+
isResolving = _select.isResolving;
|
| 10299 |
+
|
| 10300 |
+
var _select2 = select(external_this_wc_data_["USER_STORE_NAME"]),
|
| 10301 |
+
getCurrentUser = _select2.getCurrentUser;
|
| 10302 |
+
|
| 10303 |
+
var userData = getCurrentUser();
|
| 10304 |
+
var lastRead = parseInt(userData && userData.woocommerce_meta && userData.woocommerce_meta.activity_panel_inbox_last_read, 10);
|
| 10305 |
+
|
| 10306 |
+
if (!lastRead) {
|
| 10307 |
+
return null;
|
| 10308 |
+
} // @todo This method would be more performant if we ask only for 1 item per page with status "unactioned".
|
| 10309 |
+
// This change should be applied after having pagination implemented.
|
| 10310 |
+
|
| 10311 |
+
|
| 10312 |
+
var notesQuery = {
|
| 10313 |
+
page: 1,
|
| 10314 |
+
per_page: external_this_wc_data_["QUERY_DEFAULTS"].pageSize,
|
| 10315 |
+
status: 'unactioned',
|
| 10316 |
+
type: external_this_wc_data_["QUERY_DEFAULTS"].noteTypes,
|
| 10317 |
+
orderby: 'date',
|
| 10318 |
+
order: 'desc'
|
| 10319 |
+
}; // Disable eslint rule requiring `latestNotes` to be defined below because the next two statements
|
| 10320 |
+
// depend on `getNotes` to have been called.
|
| 10321 |
+
// eslint-disable-next-line @wordpress/no-unused-vars-before-return
|
| 10322 |
+
|
| 10323 |
+
var latestNotes = getNotes(notesQuery);
|
| 10324 |
+
var isError = Boolean(getNotesError('getNotes', [notesQuery]));
|
| 10325 |
+
var isRequesting = isResolving('getNotes', [notesQuery]);
|
| 10326 |
+
|
| 10327 |
+
if (isError || isRequesting) {
|
| 10328 |
+
return null;
|
| 10329 |
+
}
|
| 10330 |
+
|
| 10331 |
+
var unreadNotesCount = Object(inbox_panel_utils["a" /* getUnreadNotesCount */])(latestNotes, lastRead);
|
| 10332 |
+
return unreadNotesCount > 0;
|
| 10333 |
+
}
|
| 10334 |
+
function getUnapprovedReviews(select) {
|
| 10335 |
+
var _select3 = select(external_this_wc_data_["REVIEWS_STORE_NAME"]),
|
| 10336 |
+
getReviewsTotalCount = _select3.getReviewsTotalCount,
|
| 10337 |
+
getReviewsError = _select3.getReviewsError,
|
| 10338 |
+
isResolving = _select3.isResolving;
|
| 10339 |
+
|
| 10340 |
+
var reviewsEnabled = Object(settings["g" /* getSetting */])('reviewsEnabled');
|
| 10341 |
+
|
| 10342 |
+
if (reviewsEnabled === 'yes') {
|
| 10343 |
+
var actionableReviewsQuery = {
|
| 10344 |
+
page: 1,
|
| 10345 |
+
// @todo we are not using this review, so when the endpoint supports it,
|
| 10346 |
+
// it could be replaced with `per_page: 0`
|
| 10347 |
+
per_page: 1,
|
| 10348 |
+
status: 'hold'
|
| 10349 |
+
};
|
| 10350 |
+
var totalActionableReviews = getReviewsTotalCount(actionableReviewsQuery);
|
| 10351 |
+
var isActionableReviewsError = Boolean(getReviewsError(actionableReviewsQuery));
|
| 10352 |
+
var isActionableReviewsRequesting = isResolving('getReviewsTotalCount', [actionableReviewsQuery]);
|
| 10353 |
+
|
| 10354 |
+
if (!isActionableReviewsError && !isActionableReviewsRequesting) {
|
| 10355 |
+
return totalActionableReviews > 0;
|
| 10356 |
+
}
|
| 10357 |
+
}
|
| 10358 |
+
|
| 10359 |
+
return false;
|
| 10360 |
+
}
|
| 10361 |
+
function getUnreadStock() {
|
| 10362 |
+
return Object(settings["g" /* getSetting */])('hasLowStock', false);
|
| 10363 |
+
}
|
| 10364 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/slicedToArray.js
|
| 10365 |
+
var slicedToArray = __webpack_require__(34);
|
| 10366 |
+
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
|
| 10367 |
+
|
| 10368 |
+
// EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/navigable-container/menu.js + 1 modules
|
| 10369 |
+
var menu = __webpack_require__(761);
|
| 10370 |
+
|
| 10371 |
+
// CONCATENATED MODULE: ./client/header/activity-panel/tab/index.js
|
| 10372 |
+
|
| 10373 |
+
|
| 10374 |
+
/**
|
| 10375 |
+
* External dependencies
|
| 10376 |
+
*/
|
| 10377 |
+
|
| 10378 |
+
|
| 10379 |
+
|
| 10380 |
+
var tab_Tab = function Tab(_ref) {
|
| 10381 |
+
var icon = _ref.icon,
|
| 10382 |
+
title = _ref.title,
|
| 10383 |
+
name = _ref.name,
|
| 10384 |
+
unread = _ref.unread,
|
| 10385 |
+
selected = _ref.selected,
|
| 10386 |
+
isPanelOpen = _ref.isPanelOpen,
|
| 10387 |
+
onTabClick = _ref.onTabClick,
|
| 10388 |
+
index = _ref.index;
|
| 10389 |
+
var className = classnames_default()('woocommerce-layout__activity-panel-tab', {
|
| 10390 |
+
'is-active': isPanelOpen && selected,
|
| 10391 |
+
'has-unread': unread
|
| 10392 |
+
});
|
| 10393 |
+
var tabIndex = -1; // Only make this item tabbable if it is the currently selected item, or the panel is closed and the item is the first item.
|
| 10394 |
+
|
| 10395 |
+
if (selected || !isPanelOpen && index === 0) {
|
| 10396 |
+
tabIndex = null;
|
| 10397 |
+
}
|
| 10398 |
+
|
| 10399 |
+
var tabKey = "activity-panel-tab-".concat(name);
|
| 10400 |
+
return Object(external_this_wp_element_["createElement"])(build_module_button["a" /* default */], {
|
| 10401 |
+
role: "tab",
|
| 10402 |
+
className: className,
|
| 10403 |
+
tabIndex: tabIndex,
|
| 10404 |
+
"aria-selected": selected,
|
| 10405 |
+
"aria-controls": "activity-panel-".concat(name),
|
| 10406 |
+
key: tabKey,
|
| 10407 |
+
id: tabKey,
|
| 10408 |
+
onClick: function onClick() {
|
| 10409 |
+
onTabClick(name);
|
| 10410 |
+
}
|
| 10411 |
+
}, icon, title, ' ', unread && Object(external_this_wp_element_["createElement"])("span", {
|
| 10412 |
+
className: "screen-reader-text"
|
| 10413 |
+
}, Object(external_this_wp_i18n_["__"])('unread activity', 'woocommerce-admin')));
|
| 10414 |
+
};
|
| 10415 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
|
| 10416 |
+
var esm_defineProperty = __webpack_require__(8);
|
| 10417 |
+
|
| 10418 |
+
// EXTERNAL MODULE: ./node_modules/@wordpress/components/node_modules/@wordpress/keycodes/build-module/index.js + 1 modules
|
| 10419 |
+
var build_module = __webpack_require__(54);
|
| 10420 |
+
|
| 10421 |
+
// EXTERNAL MODULE: ./node_modules/@wordpress/deprecated/build-module/index.js
|
| 10422 |
+
var deprecated_build_module = __webpack_require__(57);
|
| 10423 |
+
|
| 10424 |
+
// EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/dropdown/index.js
|
| 10425 |
+
var dropdown = __webpack_require__(535);
|
| 10426 |
+
|
| 10427 |
+
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/dropdown-menu/index.js
|
| 10428 |
+
|
| 10429 |
+
|
| 10430 |
+
|
| 10431 |
+
|
| 10432 |
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
| 10433 |
+
|
| 10434 |
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { Object(esm_defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
| 10435 |
+
|
| 10436 |
+
/**
|
| 10437 |
+
* External dependencies
|
| 10438 |
+
*/
|
| 10439 |
+
|
| 10440 |
+
|
| 10441 |
+
/**
|
| 10442 |
+
* WordPress dependencies
|
| 10443 |
+
*/
|
| 10444 |
+
|
| 10445 |
+
|
| 10446 |
+
|
| 10447 |
+
/**
|
| 10448 |
+
* Internal dependencies
|
| 10449 |
+
*/
|
| 10450 |
+
|
| 10451 |
+
|
| 10452 |
+
|
| 10453 |
+
|
| 10454 |
+
|
| 10455 |
+
function mergeProps() {
|
| 10456 |
+
var defaultProps = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
| 10457 |
+
var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
| 10458 |
+
|
| 10459 |
+
var mergedProps = _objectSpread(_objectSpread({}, defaultProps), props);
|
| 10460 |
+
|
| 10461 |
+
if (props.className && defaultProps.className) {
|
| 10462 |
+
mergedProps.className = classnames_default()(props.className, defaultProps.className);
|
| 10463 |
+
}
|
| 10464 |
+
|
| 10465 |
+
return mergedProps;
|
| 10466 |
+
}
|
| 10467 |
+
|
| 10468 |
+
function DropdownMenu(_ref) {
|
| 10469 |
+
var children = _ref.children,
|
| 10470 |
+
className = _ref.className,
|
| 10471 |
+
controls = _ref.controls,
|
| 10472 |
+
_ref$icon = _ref.icon,
|
| 10473 |
+
icon = _ref$icon === void 0 ? 'menu' : _ref$icon,
|
| 10474 |
+
label = _ref.label,
|
| 10475 |
+
popoverProps = _ref.popoverProps,
|
| 10476 |
+
toggleProps = _ref.toggleProps,
|
| 10477 |
+
menuProps = _ref.menuProps,
|
| 10478 |
+
_ref$disableOpenOnArr = _ref.disableOpenOnArrowDown,
|
| 10479 |
+
disableOpenOnArrowDown = _ref$disableOpenOnArr === void 0 ? false : _ref$disableOpenOnArr,
|
| 10480 |
+
menuLabel = _ref.menuLabel,
|
| 10481 |
+
position = _ref.position,
|
| 10482 |
+
noIcons = _ref.noIcons;
|
| 10483 |
+
|
| 10484 |
+
if (menuLabel) {
|
| 10485 |
+
Object(deprecated_build_module["a" /* default */])('`menuLabel` prop in `DropdownComponent`', {
|
| 10486 |
+
alternative: '`menuProps` object and its `aria-label` property',
|
| 10487 |
+
plugin: 'Gutenberg'
|
| 10488 |
+
});
|
| 10489 |
+
}
|
| 10490 |
+
|
| 10491 |
+
if (position) {
|
| 10492 |
+
Object(deprecated_build_module["a" /* default */])('`position` prop in `DropdownComponent`', {
|
| 10493 |
+
alternative: '`popoverProps` object and its `position` property',
|
| 10494 |
+
plugin: 'Gutenberg'
|
| 10495 |
+
});
|
| 10496 |
+
}
|
| 10497 |
+
|
| 10498 |
+
if (Object(external_lodash_["isEmpty"])(controls) && !Object(external_lodash_["isFunction"])(children)) {
|
| 10499 |
+
return null;
|
| 10500 |
+
} // Normalize controls to nested array of objects (sets of controls)
|
| 10501 |
+
|
| 10502 |
+
|
| 10503 |
+
var controlSets;
|
| 10504 |
+
|
| 10505 |
+
if (!Object(external_lodash_["isEmpty"])(controls)) {
|
| 10506 |
+
controlSets = controls;
|
| 10507 |
+
|
| 10508 |
+
if (!Array.isArray(controlSets[0])) {
|
| 10509 |
+
controlSets = [controlSets];
|
| 10510 |
+
}
|
| 10511 |
+
}
|
| 10512 |
+
|
| 10513 |
+
var mergedPopoverProps = mergeProps({
|
| 10514 |
+
className: 'components-dropdown-menu__popover',
|
| 10515 |
+
position: position
|
| 10516 |
+
}, popoverProps);
|
| 10517 |
+
return Object(external_this_wp_element_["createElement"])(dropdown["a" /* default */], {
|
| 10518 |
+
className: classnames_default()('components-dropdown-menu', className),
|
| 10519 |
+
popoverProps: mergedPopoverProps,
|
| 10520 |
+
renderToggle: function renderToggle(_ref2) {
|
| 10521 |
+
var _toggleProps$showTool;
|
| 10522 |
+
|
| 10523 |
+
var isOpen = _ref2.isOpen,
|
| 10524 |
+
onToggle = _ref2.onToggle;
|
| 10525 |
+
|
| 10526 |
+
var openOnArrowDown = function openOnArrowDown(event) {
|
| 10527 |
+
if (disableOpenOnArrowDown) {
|
| 10528 |
+
return;
|
| 10529 |
+
}
|
| 10530 |
+
|
| 10531 |
+
if (!isOpen && event.keyCode === build_module["a" /* DOWN */]) {
|
| 10532 |
+
event.preventDefault();
|
| 10533 |
+
event.stopPropagation();
|
| 10534 |
+
onToggle();
|
| 10535 |
+
}
|
| 10536 |
+
};
|
| 10537 |
+
|
| 10538 |
+
var mergedToggleProps = mergeProps({
|
| 10539 |
+
className: classnames_default()('components-dropdown-menu__toggle', {
|
| 10540 |
+
'is-opened': isOpen
|
| 10541 |
+
})
|
| 10542 |
+
}, toggleProps);
|
| 10543 |
+
return Object(external_this_wp_element_["createElement"])(build_module_button["a" /* default */], Object(esm_extends["a" /* default */])({}, mergedToggleProps, {
|
| 10544 |
+
icon: icon,
|
| 10545 |
+
onClick: function onClick(event) {
|
| 10546 |
+
onToggle(event);
|
| 10547 |
+
|
| 10548 |
+
if (mergedToggleProps.onClick) {
|
| 10549 |
+
mergedToggleProps.onClick(event);
|
| 10550 |
+
}
|
| 10551 |
+
},
|
| 10552 |
+
onKeyDown: function onKeyDown(event) {
|
| 10553 |
+
openOnArrowDown(event);
|
| 10554 |
+
|
| 10555 |
+
if (mergedToggleProps.onKeyDown) {
|
| 10556 |
+
mergedToggleProps.onKeyDown(event);
|
| 10557 |
+
}
|
| 10558 |
+
},
|
| 10559 |
+
"aria-haspopup": "true",
|
| 10560 |
+
"aria-expanded": isOpen,
|
| 10561 |
+
label: label,
|
| 10562 |
+
showTooltip: (_toggleProps$showTool = toggleProps === null || toggleProps === void 0 ? void 0 : toggleProps.showTooltip) !== null && _toggleProps$showTool !== void 0 ? _toggleProps$showTool : true
|
| 10563 |
+
}), mergedToggleProps.children);
|
| 10564 |
+
},
|
| 10565 |
+
renderContent: function renderContent(props) {
|
| 10566 |
+
var mergedMenuProps = mergeProps({
|
| 10567 |
+
'aria-label': menuLabel || label,
|
| 10568 |
+
className: classnames_default()('components-dropdown-menu__menu', {
|
| 10569 |
+
'no-icons': noIcons
|
| 10570 |
+
})
|
| 10571 |
+
}, menuProps);
|
| 10572 |
+
return Object(external_this_wp_element_["createElement"])(menu["a" /* default */], Object(esm_extends["a" /* default */])({}, mergedMenuProps, {
|
| 10573 |
+
role: "menu"
|
| 10574 |
+
}), Object(external_lodash_["isFunction"])(children) ? children(props) : null, Object(external_lodash_["flatMap"])(controlSets, function (controlSet, indexOfSet) {
|
| 10575 |
+
return controlSet.map(function (control, indexOfControl) {
|
| 10576 |
+
return Object(external_this_wp_element_["createElement"])(build_module_button["a" /* default */], {
|
| 10577 |
+
key: [indexOfSet, indexOfControl].join(),
|
| 10578 |
+
onClick: function onClick(event) {
|
| 10579 |
+
event.stopPropagation();
|
| 10580 |
+
props.onClose();
|
| 10581 |
+
|
| 10582 |
+
if (control.onClick) {
|
| 10583 |
+
control.onClick();
|
| 10584 |
+
}
|
| 10585 |
+
},
|
| 10586 |
+
className: classnames_default()('components-dropdown-menu__menu-item', {
|
| 10587 |
+
'has-separator': indexOfSet > 0 && indexOfControl === 0,
|
| 10588 |
+
'is-active': control.isActive
|
| 10589 |
+
}),
|
| 10590 |
+
icon: control.icon,
|
| 10591 |
+
"aria-checked": control.role === 'menuitemcheckbox' || control.role === 'menuitemradio' ? control.isActive : undefined,
|
| 10592 |
+
role: control.role === 'menuitemcheckbox' || control.role === 'menuitemradio' ? control.role : 'menuitem',
|
| 10593 |
+
disabled: control.isDisabled
|
| 10594 |
+
}, control.title);
|
| 10595 |
+
});
|
| 10596 |
+
}));
|
| 10597 |
+
}
|
| 10598 |
+
});
|
| 10599 |
+
}
|
| 10600 |
+
|
| 10601 |
+
/* harmony default export */ var dropdown_menu = (DropdownMenu);
|
| 10602 |
+
//# sourceMappingURL=index.js.map
|
| 10603 |
+
// EXTERNAL MODULE: ./node_modules/@wordpress/compose/build-module/hooks/use-instance-id/index.js
|
| 10604 |
+
var use_instance_id = __webpack_require__(300);
|
| 10605 |
+
|
| 10606 |
+
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/menu-group/index.js
|
| 10607 |
+
|
| 10608 |
+
|
| 10609 |
+
/**
|
| 10610 |
+
* External dependencies
|
| 10611 |
+
*/
|
| 10612 |
+
|
| 10613 |
+
/**
|
| 10614 |
+
* WordPress dependencies
|
| 10615 |
+
*/
|
| 10616 |
+
|
| 10617 |
+
|
| 10618 |
+
|
| 10619 |
+
function MenuGroup(_ref) {
|
| 10620 |
+
var children = _ref.children,
|
| 10621 |
+
_ref$className = _ref.className,
|
| 10622 |
+
className = _ref$className === void 0 ? '' : _ref$className,
|
| 10623 |
+
label = _ref.label;
|
| 10624 |
+
var instanceId = Object(use_instance_id["a" /* default */])(MenuGroup);
|
| 10625 |
+
|
| 10626 |
+
if (!external_this_wp_element_["Children"].count(children)) {
|
| 10627 |
+
return null;
|
| 10628 |
+
}
|
| 10629 |
+
|
| 10630 |
+
var labelId = "components-menu-group-label-".concat(instanceId);
|
| 10631 |
+
var classNames = classnames_default()(className, 'components-menu-group');
|
| 10632 |
+
return Object(external_this_wp_element_["createElement"])("div", {
|
| 10633 |
+
className: classNames
|
| 10634 |
+
}, label && Object(external_this_wp_element_["createElement"])("div", {
|
| 10635 |
+
className: "components-menu-group__label",
|
| 10636 |
+
id: labelId,
|
| 10637 |
+
"aria-hidden": "true"
|
| 10638 |
+
}, label), Object(external_this_wp_element_["createElement"])("div", {
|
| 10639 |
+
role: "group",
|
| 10640 |
+
"aria-labelledby": label ? labelId : null
|
| 10641 |
+
}, children));
|
| 10642 |
+
}
|
| 10643 |
+
/* harmony default export */ var menu_group = (MenuGroup);
|
| 10644 |
+
//# sourceMappingURL=index.js.map
|
| 10645 |
+
// EXTERNAL MODULE: ./node_modules/@wordpress/components/node_modules/@wordpress/icons/build-module/library/check.js
|
| 10646 |
+
var check = __webpack_require__(759);
|
| 10647 |
+
|
| 10648 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js
|
| 10649 |
+
var esm_objectWithoutProperties = __webpack_require__(12);
|
| 10650 |
+
|
| 10651 |
+
// EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/shortcut/index.js
|
| 10652 |
+
var build_module_shortcut = __webpack_require__(135);
|
| 10653 |
+
|
| 10654 |
+
// EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/icon/index.js
|
| 10655 |
+
var components_build_module_icon = __webpack_require__(133);
|
| 10656 |
+
|
| 10657 |
+
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/menu-item/index.js
|
| 10658 |
+
|
| 10659 |
+
|
| 10660 |
+
|
| 10661 |
+
|
| 10662 |
+
/**
|
| 10663 |
+
* External dependencies
|
| 10664 |
+
*/
|
| 10665 |
+
|
| 10666 |
+
|
| 10667 |
+
/**
|
| 10668 |
+
* WordPress dependencies
|
| 10669 |
+
*/
|
| 10670 |
+
|
| 10671 |
+
|
| 10672 |
+
/**
|
| 10673 |
+
* Internal dependencies
|
| 10674 |
+
*/
|
| 10675 |
+
|
| 10676 |
+
|
| 10677 |
+
|
| 10678 |
+
|
| 10679 |
+
/**
|
| 10680 |
+
* Renders a generic menu item for use inside the more menu.
|
| 10681 |
+
*
|
| 10682 |
+
* @param {Object} props Component props.
|
| 10683 |
+
* @param {WPElement} props.children Element to render as child of button.
|
| 10684 |
+
* @param {string} props.info Text to use as description for button text.
|
| 10685 |
+
* @param {string} props.className Class to set on the container.
|
| 10686 |
+
* @param {WPIcon} props.icon Button's `icon` prop.
|
| 10687 |
+
* @param {string|Object} props.shortcut Shortcut's `shortcut` prop.
|
| 10688 |
+
* @param {boolean} props.isSelected Whether or not the menu item is currently selected.
|
| 10689 |
+
* @param {string} [props.role="menuitem"] ARIA role of the menu item.
|
| 10690 |
+
* @param {Object} ref React Element ref.
|
| 10691 |
+
*
|
| 10692 |
+
* @return {WPComponent} The component to be rendered.
|
| 10693 |
+
*/
|
| 10694 |
+
|
| 10695 |
+
function MenuItem(_ref, ref) {
|
| 10696 |
+
var children = _ref.children,
|
| 10697 |
+
info = _ref.info,
|
| 10698 |
+
className = _ref.className,
|
| 10699 |
+
icon = _ref.icon,
|
| 10700 |
+
shortcut = _ref.shortcut,
|
| 10701 |
+
isSelected = _ref.isSelected,
|
| 10702 |
+
_ref$role = _ref.role,
|
| 10703 |
+
role = _ref$role === void 0 ? 'menuitem' : _ref$role,
|
| 10704 |
+
props = Object(esm_objectWithoutProperties["a" /* default */])(_ref, ["children", "info", "className", "icon", "shortcut", "isSelected", "role"]);
|
| 10705 |
+
|
| 10706 |
+
className = classnames_default()('components-menu-item__button', className);
|
| 10707 |
+
|
| 10708 |
+
if (info) {
|
| 10709 |
+
children = Object(external_this_wp_element_["createElement"])("span", {
|
| 10710 |
+
className: "components-menu-item__info-wrapper"
|
| 10711 |
+
}, children, Object(external_this_wp_element_["createElement"])("span", {
|
| 10712 |
+
className: "components-menu-item__info"
|
| 10713 |
+
}, info));
|
| 10714 |
+
}
|
| 10715 |
+
|
| 10716 |
+
if (icon && !Object(external_lodash_["isString"])(icon)) {
|
| 10717 |
+
icon = Object(external_this_wp_element_["cloneElement"])(icon, {
|
| 10718 |
+
className: 'components-menu-items__item-icon'
|
| 10719 |
+
});
|
| 10720 |
+
}
|
| 10721 |
+
|
| 10722 |
+
return Object(external_this_wp_element_["createElement"])(build_module_button["a" /* default */], Object(esm_extends["a" /* default */])({
|
| 10723 |
+
ref: ref // Make sure aria-checked matches spec https://www.w3.org/TR/wai-aria-1.1/#aria-checked
|
| 10724 |
+
,
|
| 10725 |
+
"aria-checked": role === 'menuitemcheckbox' || role === 'menuitemradio' ? isSelected : undefined,
|
| 10726 |
+
role: role,
|
| 10727 |
+
className: className
|
| 10728 |
+
}, props), children, Object(external_this_wp_element_["createElement"])(build_module_shortcut["a" /* default */], {
|
| 10729 |
+
className: "components-menu-item__shortcut",
|
| 10730 |
+
shortcut: shortcut
|
| 10731 |
+
}), icon && Object(external_this_wp_element_["createElement"])(components_build_module_icon["a" /* default */], {
|
| 10732 |
+
icon: icon
|
| 10733 |
+
}));
|
| 10734 |
+
}
|
| 10735 |
+
/* harmony default export */ var menu_item = (Object(external_this_wp_element_["forwardRef"])(MenuItem));
|
| 10736 |
+
//# sourceMappingURL=index.js.map
|
| 10737 |
+
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/menu-items-choice/index.js
|
| 10738 |
+
|
| 10739 |
+
|
| 10740 |
+
/**
|
| 10741 |
+
* External dependencies
|
| 10742 |
+
*/
|
| 10743 |
+
|
| 10744 |
+
/**
|
| 10745 |
+
* WordPress dependencies
|
| 10746 |
+
*/
|
| 10747 |
+
|
| 10748 |
+
|
| 10749 |
+
/**
|
| 10750 |
+
* Internal dependencies
|
| 10751 |
+
*/
|
| 10752 |
+
|
| 10753 |
+
|
| 10754 |
+
function MenuItemsChoice(_ref) {
|
| 10755 |
+
var _ref$choices = _ref.choices,
|
| 10756 |
+
choices = _ref$choices === void 0 ? [] : _ref$choices,
|
| 10757 |
+
_ref$onHover = _ref.onHover,
|
| 10758 |
+
onHover = _ref$onHover === void 0 ? external_lodash_["noop"] : _ref$onHover,
|
| 10759 |
+
onSelect = _ref.onSelect,
|
| 10760 |
+
value = _ref.value;
|
| 10761 |
+
return choices.map(function (item) {
|
| 10762 |
+
var isSelected = value === item.value;
|
| 10763 |
+
return Object(external_this_wp_element_["createElement"])(menu_item, {
|
| 10764 |
+
key: item.value,
|
| 10765 |
+
role: "menuitemradio",
|
| 10766 |
+
icon: isSelected && check["a" /* default */],
|
| 10767 |
+
isSelected: isSelected,
|
| 10768 |
+
shortcut: item.shortcut,
|
| 10769 |
+
className: "components-menu-items-choice",
|
| 10770 |
+
onClick: function onClick() {
|
| 10771 |
+
if (!isSelected) {
|
| 10772 |
+
onSelect(item.value);
|
| 10773 |
+
}
|
| 10774 |
+
},
|
| 10775 |
+
onMouseEnter: function onMouseEnter() {
|
| 10776 |
+
return onHover(item.value);
|
| 10777 |
+
},
|
| 10778 |
+
onMouseLeave: function onMouseLeave() {
|
| 10779 |
+
return onHover(null);
|
| 10780 |
+
}
|
| 10781 |
+
}, item.label);
|
| 10782 |
+
});
|
| 10783 |
+
}
|
| 10784 |
+
//# sourceMappingURL=index.js.map
|
| 10785 |
+
// CONCATENATED MODULE: ./client/header/activity-panel/display-options/icons/display.js
|
| 10786 |
+
|
| 10787 |
+
|
| 10788 |
+
/**
|
| 10789 |
+
* External dependencies
|
| 10790 |
+
*/
|
| 10791 |
+
|
| 10792 |
+
var display_DisplayIcon = function DisplayIcon() {
|
| 10793 |
+
return Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, Object(external_this_wp_element_["createElement"])("svg", {
|
| 10794 |
+
className: "woocommerce-layout__activity-panel-tab-icon",
|
| 10795 |
+
width: "24",
|
| 10796 |
+
height: "24",
|
| 10797 |
+
viewBox: "3 3 24 24",
|
| 10798 |
+
fill: "none",
|
| 10799 |
+
xmlns: "http://www.w3.org/2000/svg"
|
| 10800 |
+
}, Object(external_this_wp_element_["createElement"])("path", {
|
| 10801 |
+
d: "M13.8053 15.3982C13.8053 15.7965 13.4867 16.1947 13.0089 16.1947H6.79646C6.55752 16.1947 6.39823 16.115 6.23894 15.9558C6.07965 15.7965 6 15.6372 6 15.3982V6.79646C6 6.63717 6.15929 6.39823 6.23894 6.23894C6.39823 6.07965 6.55752 6 6.79646 6H13.0089C13.4071 6 13.8053 6.31858 13.8053 6.79646V15.3982Z",
|
| 10802 |
+
strokeWidth: "1.5",
|
| 10803 |
+
strokeLinecap: "round",
|
| 10804 |
+
strokeLinejoin: "round"
|
| 10805 |
+
}), Object(external_this_wp_element_["createElement"])("path", {
|
| 10806 |
+
d: "M23.9203 10.6195C23.9203 11.0177 23.6017 11.4159 23.1238 11.4159H16.9115C16.6725 11.4159 16.5132 11.3363 16.3539 11.177C16.1946 11.0177 16.115 10.8584 16.115 10.6195V6.79646C16.115 6.39823 16.4336 6 16.9115 6H23.1238C23.5221 6 23.9203 6.31858 23.9203 6.79646V10.6195Z",
|
| 10807 |
+
strokeWidth: "1.5",
|
| 10808 |
+
strokeLinecap: "round",
|
| 10809 |
+
strokeLinejoin: "round"
|
| 10810 |
+
}), Object(external_this_wp_element_["createElement"])("path", {
|
| 10811 |
+
d: "M13.8053 23.2035C13.8053 23.4424 13.7257 23.6017 13.5664 23.761C13.4071 23.9203 13.2478 23.9999 13.0089 23.9999H6.79646C6.39823 23.9999 6 23.6813 6 23.2035V19.3804C6 19.1415 6.07965 18.9822 6.23894 18.8229C6.39823 18.6636 6.55752 18.584 6.79646 18.584H13.0089C13.4071 18.584 13.8053 18.9026 13.8053 19.3804V23.2035Z",
|
| 10812 |
+
strokeWidth: "1.5",
|
| 10813 |
+
strokeLinecap: "round",
|
| 10814 |
+
strokeLinejoin: "round"
|
| 10815 |
+
}), Object(external_this_wp_element_["createElement"])("path", {
|
| 10816 |
+
d: "M16.9912 23.9999C16.7522 23.9999 16.5929 23.9202 16.4336 23.7609C16.2743 23.6016 16.1947 23.4423 16.1947 23.2034V14.6016C16.1947 14.3627 16.2743 14.2034 16.4336 14.0441C16.5929 13.8848 16.7522 13.8052 16.9912 13.8052H23.2036C23.4425 13.8052 23.6018 13.8848 23.7611 14.0441C23.9204 14.2034 24 14.3627 24 14.6016V23.2034C24 23.6016 23.6814 23.9999 23.2036 23.9999H16.9912Z",
|
| 10817 |
+
strokeWidth: "1.5",
|
| 10818 |
+
strokeLinecap: "round",
|
| 10819 |
+
strokeLinejoin: "round"
|
| 10820 |
+
})), Object(external_this_wp_i18n_["__"])('Display', 'woocommerce-admin'));
|
| 10821 |
+
};
|
| 10822 |
+
// CONCATENATED MODULE: ./client/header/activity-panel/display-options/icons/single-column.js
|
| 10823 |
+
|
| 10824 |
+
var single_column_SingleColumnIcon = function SingleColumnIcon() {
|
| 10825 |
+
return Object(external_this_wp_element_["createElement"])("svg", {
|
| 10826 |
+
className: "woocommerce-layout__activity-panel-tab-icon",
|
| 10827 |
+
width: "12",
|
| 10828 |
+
height: "14",
|
| 10829 |
+
viewBox: "0 0 12 14",
|
| 10830 |
+
fill: "none",
|
| 10831 |
+
xmlns: "http://www.w3.org/2000/svg"
|
| 10832 |
+
}, Object(external_this_wp_element_["createElement"])("rect", {
|
| 10833 |
+
x: "0.5",
|
| 10834 |
+
y: "0.5",
|
| 10835 |
+
width: "11",
|
| 10836 |
+
height: "13",
|
| 10837 |
+
strokeWidth: "1"
|
| 10838 |
+
}));
|
| 10839 |
+
};
|
| 10840 |
+
// CONCATENATED MODULE: ./client/header/activity-panel/display-options/icons/two-columns.js
|
| 10841 |
+
|
| 10842 |
+
var two_columns_TwoColumnsIcon = function TwoColumnsIcon() {
|
| 10843 |
+
return Object(external_this_wp_element_["createElement"])("svg", {
|
| 10844 |
+
className: "woocommerce-layout__activity-panel-tab-icon",
|
| 10845 |
+
width: "18",
|
| 10846 |
+
height: "14",
|
| 10847 |
+
viewBox: "0 0 18 14",
|
| 10848 |
+
fill: "none",
|
| 10849 |
+
xmlns: "http://www.w3.org/2000/svg"
|
| 10850 |
+
}, Object(external_this_wp_element_["createElement"])("rect", {
|
| 10851 |
+
x: "0.5",
|
| 10852 |
+
y: "0.5",
|
| 10853 |
+
width: "7",
|
| 10854 |
+
height: "13",
|
| 10855 |
+
strokeWidth: "1"
|
| 10856 |
+
}), Object(external_this_wp_element_["createElement"])("rect", {
|
| 10857 |
+
x: "9.5",
|
| 10858 |
+
y: "0.5",
|
| 10859 |
+
width: "7",
|
| 10860 |
+
height: "13",
|
| 10861 |
+
strokeWidth: "1"
|
| 10862 |
+
}));
|
| 10863 |
+
};
|
| 10864 |
+
// CONCATENATED MODULE: ./client/header/activity-panel/display-options/index.js
|
| 10865 |
+
|
| 10866 |
+
|
| 10867 |
+
/**
|
| 10868 |
+
* External dependencies
|
| 10869 |
+
*/
|
| 10870 |
+
|
| 10871 |
+
|
| 10872 |
+
|
| 10873 |
+
|
| 10874 |
+
|
| 10875 |
+
/**
|
| 10876 |
+
* Internal dependencies
|
| 10877 |
+
*/
|
| 10878 |
+
|
| 10879 |
+
|
| 10880 |
+
|
| 10881 |
+
|
| 10882 |
+
var LAYOUTS = [{
|
| 10883 |
+
value: 'single_column',
|
| 10884 |
+
label: Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, Object(external_this_wp_element_["createElement"])(single_column_SingleColumnIcon, null), Object(external_this_wp_i18n_["__"])('Single column', 'woocommerce-admin'))
|
| 10885 |
+
}, {
|
| 10886 |
+
value: 'two_columns',
|
| 10887 |
+
label: Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, Object(external_this_wp_element_["createElement"])(two_columns_TwoColumnsIcon, null), Object(external_this_wp_i18n_["__"])('Two columns', 'woocommerce-admin'))
|
| 10888 |
+
}];
|
| 10889 |
+
var display_options_DisplayOptions = function DisplayOptions() {
|
| 10890 |
+
var defaultHomescreenLayout = Object(external_this_wp_data_["useSelect"])(function (select) {
|
| 10891 |
+
var _select = select(external_this_wc_data_["OPTIONS_STORE_NAME"]),
|
| 10892 |
+
getOption = _select.getOption;
|
| 10893 |
+
|
| 10894 |
+
return getOption('woocommerce_default_homepage_layout') || 'single_column';
|
| 10895 |
+
});
|
| 10896 |
+
|
| 10897 |
+
var _useUserPreferences = Object(external_this_wc_data_["useUserPreferences"])(),
|
| 10898 |
+
updateUserPreferences = _useUserPreferences.updateUserPreferences,
|
| 10899 |
+
layout = _useUserPreferences.homepage_layout;
|
| 10900 |
+
|
| 10901 |
+
return Object(external_this_wp_element_["createElement"])(dropdown_menu, {
|
| 10902 |
+
icon: Object(external_this_wp_element_["createElement"])(display_DisplayIcon, null)
|
| 10903 |
+
/* translators: button label text should, if possible, be under 16 characters. */
|
| 10904 |
+
,
|
| 10905 |
+
label: Object(external_this_wp_i18n_["__"])('Display options', 'woocommerce-admin'),
|
| 10906 |
+
toggleProps: {
|
| 10907 |
+
className: 'woocommerce-layout__activity-panel-tab display-options',
|
| 10908 |
+
onClick: function onClick() {
|
| 10909 |
+
return Object(external_this_wc_tracks_["recordEvent"])('homescreen_display_click');
|
| 10910 |
+
}
|
| 10911 |
+
},
|
| 10912 |
+
popoverProps: {
|
| 10913 |
+
className: 'woocommerce-layout__activity-panel-popover'
|
| 10914 |
+
}
|
| 10915 |
+
}, function (_ref) {
|
| 10916 |
+
var onClose = _ref.onClose;
|
| 10917 |
+
return Object(external_this_wp_element_["createElement"])(menu_group, {
|
| 10918 |
+
className: "woocommerce-layout__homescreen-display-options",
|
| 10919 |
+
label: Object(external_this_wp_i18n_["__"])('Layout', 'woocommerce-admin')
|
| 10920 |
+
}, Object(external_this_wp_element_["createElement"])(MenuItemsChoice, {
|
| 10921 |
+
choices: LAYOUTS,
|
| 10922 |
+
onSelect: function onSelect(newLayout) {
|
| 10923 |
+
updateUserPreferences({
|
| 10924 |
+
homepage_layout: newLayout
|
| 10925 |
+
});
|
| 10926 |
+
onClose();
|
| 10927 |
+
Object(external_this_wc_tracks_["recordEvent"])('homescreen_display_option', {
|
| 10928 |
+
display_option: newLayout
|
| 10929 |
+
});
|
| 10930 |
+
},
|
| 10931 |
+
value: layout || defaultHomescreenLayout
|
| 10932 |
+
}));
|
| 10933 |
+
});
|
| 10934 |
+
};
|
| 10935 |
+
// CONCATENATED MODULE: ./client/header/activity-panel/tabs/index.js
|
| 10936 |
+
|
| 10937 |
+
|
| 10938 |
+
|
| 10939 |
+
|
| 10940 |
+
/**
|
| 10941 |
+
* External dependencies
|
| 10942 |
+
*/
|
| 10943 |
+
|
| 10944 |
+
|
| 10945 |
+
|
| 10946 |
+
/**
|
| 10947 |
+
* Internal dependencies
|
| 10948 |
+
*/
|
| 10949 |
+
|
| 10950 |
+
|
| 10951 |
+
|
| 10952 |
+
var tabs_Tabs = function Tabs(_ref) {
|
| 10953 |
+
var tabs = _ref.tabs,
|
| 10954 |
+
_onTabClick = _ref.onTabClick,
|
| 10955 |
+
selectedTabName = _ref.selectedTab,
|
| 10956 |
+
showDisplayOptions = _ref.showDisplayOptions,
|
| 10957 |
+
_ref$tabOpen = _ref.tabOpen,
|
| 10958 |
+
tabOpen = _ref$tabOpen === void 0 ? false : _ref$tabOpen;
|
| 10959 |
+
|
| 10960 |
+
var _useState = Object(external_this_wp_element_["useState"])({
|
| 10961 |
+
tabOpen: tabOpen,
|
| 10962 |
+
currentTab: selectedTabName
|
| 10963 |
+
}),
|
| 10964 |
+
_useState2 = slicedToArray_default()(_useState, 2),
|
| 10965 |
+
_useState2$ = _useState2[0],
|
| 10966 |
+
tabIsOpenState = _useState2$.tabOpen,
|
| 10967 |
+
currentTab = _useState2$.currentTab,
|
| 10968 |
+
setTabState = _useState2[1]; // Keep state synced with props
|
| 10969 |
+
|
| 10970 |
+
|
| 10971 |
+
Object(external_this_wp_element_["useEffect"])(function () {
|
| 10972 |
+
setTabState({
|
| 10973 |
+
tabOpen: tabOpen,
|
| 10974 |
+
currentTab: selectedTabName
|
| 10975 |
+
});
|
| 10976 |
+
}, [tabOpen, selectedTabName]);
|
| 10977 |
+
return Object(external_this_wp_element_["createElement"])(menu["a" /* default */], {
|
| 10978 |
+
role: "tablist",
|
| 10979 |
+
orientation: "horizontal",
|
| 10980 |
+
className: "woocommerce-layout__activity-panel-tabs"
|
| 10981 |
+
}, tabs && tabs.map(function (tab, i) {
|
| 10982 |
+
return Object(external_this_wp_element_["createElement"])(tab_Tab, extends_default()({
|
| 10983 |
+
key: i,
|
| 10984 |
+
index: i,
|
| 10985 |
+
isPanelOpen: tabIsOpenState,
|
| 10986 |
+
selected: currentTab === tab.name
|
| 10987 |
+
}, tab, {
|
| 10988 |
+
onTabClick: function onTabClick() {
|
| 10989 |
+
var isTabOpen = currentTab === tab.name || currentTab === '' ? !tabIsOpenState : true; // If a panel is being opened, or if an existing panel is already open and a different one is being opened, record a track.
|
| 10990 |
+
|
| 10991 |
+
if (!isTabOpen || currentTab !== tab.name) {
|
| 10992 |
+
Object(external_this_wc_tracks_["recordEvent"])('activity_panel_open', {
|
| 10993 |
+
tab: tab.name
|
| 10994 |
+
});
|
| 10995 |
+
}
|
| 10996 |
+
|
| 10997 |
+
setTabState({
|
| 10998 |
+
tabOpen: isTabOpen,
|
| 10999 |
+
currentTab: tab.name
|
| 11000 |
+
});
|
| 11001 |
+
|
| 11002 |
+
_onTabClick(tab, isTabOpen);
|
| 11003 |
+
}
|
| 11004 |
+
}));
|
| 11005 |
+
}), showDisplayOptions && Object(external_this_wp_element_["createElement"])(display_options_DisplayOptions, null));
|
| 11006 |
+
};
|
| 11007 |
+
// CONCATENATED MODULE: ./client/header/activity-panel/setup-progress.js
|
| 11008 |
+
|
| 11009 |
+
var setup_progress_SetupProgress = function SetupProgress() {
|
| 11010 |
+
return Object(external_this_wp_element_["createElement"])("svg", {
|
| 11011 |
+
className: "woocommerce-layout__activity-panel-tab-icon setup-progress",
|
| 11012 |
+
width: "18",
|
| 11013 |
+
height: "18",
|
| 11014 |
+
viewBox: "0 0 24 24",
|
| 11015 |
+
fill: "none",
|
| 11016 |
+
xmlns: "http://www.w3.org/2000/svg"
|
| 11017 |
+
}, Object(external_this_wp_element_["createElement"])("path", {
|
| 11018 |
+
d: "M12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20Z",
|
| 11019 |
+
stroke: "#DCDCDE",
|
| 11020 |
+
strokeWidth: "2"
|
| 11021 |
+
}), Object(external_this_wp_element_["createElement"])("path", {
|
| 11022 |
+
d: "M4 12V12C4 16.4183 7.58172 20 12 20V20C16.4183 20 20 16.4183 20 12V12C20 7.58172 16.4183 4 12 4V4",
|
| 11023 |
+
strokeWidth: "2",
|
| 11024 |
+
strokeLinecap: "round"
|
| 11025 |
+
}));
|
| 11026 |
+
};
|
| 11027 |
+
// CONCATENATED MODULE: ./client/header/activity-panel/index.js
|
| 11028 |
+
|
| 11029 |
+
|
| 11030 |
+
|
| 11031 |
+
|
| 11032 |
+
|
| 11033 |
+
|
| 11034 |
+
|
| 11035 |
+
|
| 11036 |
+
function activity_panel_createSuper(Derived) { var hasNativeReflectConstruct = activity_panel_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = getPrototypeOf_default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = getPrototypeOf_default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return possibleConstructorReturn_default()(this, result); }; }
|
| 11037 |
+
|
| 11038 |
+
function activity_panel_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
| 11039 |
+
|
| 11040 |
+
/**
|
| 11041 |
+
* External dependencies
|
| 11042 |
+
*/
|
| 11043 |
+
|
| 11044 |
+
|
| 11045 |
+
|
| 11046 |
+
|
| 11047 |
+
|
| 11048 |
+
|
| 11049 |
+
|
| 11050 |
+
|
| 11051 |
+
|
| 11052 |
+
|
| 11053 |
+
|
| 11054 |
+
|
| 11055 |
+
|
| 11056 |
+
|
| 11057 |
+
/**
|
| 11058 |
+
* Internal dependencies
|
| 11059 |
+
*/
|
| 11060 |
+
|
| 11061 |
+
|
| 11062 |
+
|
| 11063 |
+
|
| 11064 |
+
|
| 11065 |
+
|
| 11066 |
+
|
| 11067 |
+
var HelpPanel = Object(external_this_wp_element_["lazy"])(function () {
|
| 11068 |
+
return Promise.all(/* import() | activity-panels-help */[__webpack_require__.e(52), __webpack_require__.e(9), __webpack_require__.e(10)]).then(__webpack_require__.bind(null, 843));
|
| 11069 |
+
});
|
| 11070 |
+
var InboxPanel = Object(external_this_wp_element_["lazy"])(function () {
|
| 11071 |
+
return Promise.all(/* import() | activity-panels-inbox */[__webpack_require__.e(2), __webpack_require__.e(4), __webpack_require__.e(6), __webpack_require__.e(54), __webpack_require__.e(11)]).then(__webpack_require__.bind(null, 798));
|
| 11072 |
+
});
|
| 11073 |
+
var StockPanel = Object(external_this_wp_element_["lazy"])(function () {
|
| 11074 |
+
return Promise.all(/* import() | activity-panels-stock */[__webpack_require__.e(2), __webpack_require__.e(12)]).then(__webpack_require__.bind(null, 856));
|
| 11075 |
+
});
|
| 11076 |
+
var ReviewsPanel = Object(external_this_wp_element_["lazy"])(function () {
|
| 11077 |
+
return Promise.all(/* import() | activity-panels-inbox */[__webpack_require__.e(2), __webpack_require__.e(4), __webpack_require__.e(6), __webpack_require__.e(54), __webpack_require__.e(11)]).then(__webpack_require__.bind(null, 845));
|
| 11078 |
+
});
|
| 11079 |
+
var manageStock = Object(settings["g" /* getSetting */])('manageStock', 'no');
|
| 11080 |
+
var activity_panel_reviewsEnabled = Object(settings["g" /* getSetting */])('reviewsEnabled', 'no');
|
| 11081 |
+
var activity_panel_ActivityPanel = /*#__PURE__*/function (_Component) {
|
| 11082 |
+
inherits_default()(ActivityPanel, _Component);
|
| 11083 |
+
|
| 11084 |
+
var _super = activity_panel_createSuper(ActivityPanel);
|
| 11085 |
+
|
| 11086 |
+
function ActivityPanel(props) {
|
| 11087 |
+
var _this;
|
| 11088 |
+
|
| 11089 |
+
classCallCheck_default()(this, ActivityPanel);
|
| 11090 |
+
|
| 11091 |
+
_this = _super.call(this, props);
|
| 11092 |
+
_this.state = {
|
| 11093 |
+
isPanelOpen: false,
|
| 11094 |
+
mobileOpen: false,
|
| 11095 |
+
currentTab: '',
|
| 11096 |
+
isPanelSwitching: false
|
| 11097 |
+
};
|
| 11098 |
+
return _this;
|
| 11099 |
+
}
|
| 11100 |
+
|
| 11101 |
+
createClass_default()(ActivityPanel, [{
|
| 11102 |
+
key: "togglePanel",
|
| 11103 |
+
value: function togglePanel(_ref, isTabOpen) {
|
| 11104 |
+
var tabName = _ref.name;
|
| 11105 |
+
this.setState(function (state) {
|
| 11106 |
+
var isPanelSwitching = tabName !== state.currentTab && state.currentTab !== '' && isTabOpen && state.isPanelOpen;
|
| 11107 |
+
return {
|
| 11108 |
+
isPanelOpen: isTabOpen,
|
| 11109 |
+
mobileOpen: isTabOpen,
|
| 11110 |
+
currentTab: tabName,
|
| 11111 |
+
isPanelSwitching: isPanelSwitching
|
| 11112 |
+
};
|
| 11113 |
+
});
|
| 11114 |
+
}
|
| 11115 |
+
}, {
|
| 11116 |
+
key: "closePanel",
|
| 11117 |
+
value: function closePanel() {
|
| 11118 |
+
this.setState(function () {
|
| 11119 |
+
return {
|
| 11120 |
+
isPanelOpen: false,
|
| 11121 |
+
currentTab: ''
|
| 11122 |
+
};
|
| 11123 |
+
});
|
| 11124 |
+
}
|
| 11125 |
+
}, {
|
| 11126 |
+
key: "clearPanel",
|
| 11127 |
+
value: function clearPanel() {
|
| 11128 |
+
this.setState(function () {
|
| 11129 |
+
return {
|
| 11130 |
+
isPanelSwitching: false
|
| 11131 |
+
};
|
| 11132 |
+
});
|
| 11133 |
+
} // On smaller screen, the panel buttons are hidden behind a toggle.
|
| 11134 |
+
|
| 11135 |
+
}, {
|
| 11136 |
+
key: "toggleMobile",
|
| 11137 |
+
value: function toggleMobile() {
|
| 11138 |
+
var tabs = this.getTabs();
|
| 11139 |
+
this.setState(function (state) {
|
| 11140 |
+
return {
|
| 11141 |
+
mobileOpen: !state.mobileOpen,
|
| 11142 |
+
currentTab: state.mobileOpen ? '' : tabs[0].name,
|
| 11143 |
+
isPanelOpen: !state.mobileOpen
|
| 11144 |
+
};
|
| 11145 |
+
});
|
| 11146 |
+
}
|
| 11147 |
+
}, {
|
| 11148 |
+
key: "handleClickOutside",
|
| 11149 |
+
value: function handleClickOutside(event) {
|
| 11150 |
+
var isPanelOpen = this.state.isPanelOpen;
|
| 11151 |
+
var isClickOnModalOrSnackbar = event.target.closest('.woocommerce-inbox-dismiss-confirmation_modal') || event.target.closest('.components-snackbar__action');
|
| 11152 |
+
|
| 11153 |
+
if (isPanelOpen && !isClickOnModalOrSnackbar) {
|
| 11154 |
+
this.closePanel();
|
| 11155 |
+
}
|
| 11156 |
+
}
|
| 11157 |
+
}, {
|
| 11158 |
+
key: "isHomescreen",
|
| 11159 |
+
value: function isHomescreen() {
|
| 11160 |
+
var _this$props$getHistor = this.props.getHistory(),
|
| 11161 |
+
location = _this$props$getHistor.location;
|
| 11162 |
+
|
| 11163 |
+
return location.pathname === '/';
|
| 11164 |
+
}
|
| 11165 |
+
}, {
|
| 11166 |
+
key: "isPerformingSetupTask",
|
| 11167 |
+
value: function isPerformingSetupTask() {
|
| 11168 |
+
var _this$props = this.props,
|
| 11169 |
+
requestingTaskListOptions = _this$props.requestingTaskListOptions,
|
| 11170 |
+
taskListComplete = _this$props.taskListComplete,
|
| 11171 |
+
taskListHidden = _this$props.taskListHidden,
|
| 11172 |
+
query = _this$props.query;
|
| 11173 |
+
var isPerformingSetupTask = query.task && !query.path && (requestingTaskListOptions === true || taskListHidden === false && taskListComplete === false);
|
| 11174 |
+
return isPerformingSetupTask;
|
| 11175 |
+
} // @todo Pull in dynamic unread status/count
|
| 11176 |
+
|
| 11177 |
+
}, {
|
| 11178 |
+
key: "getTabs",
|
| 11179 |
+
value: function getTabs() {
|
| 11180 |
+
var _this$props2 = this.props,
|
| 11181 |
+
hasUnreadNotes = _this$props2.hasUnreadNotes,
|
| 11182 |
+
hasUnapprovedReviews = _this$props2.hasUnapprovedReviews,
|
| 11183 |
+
hasUnreadStock = _this$props2.hasUnreadStock,
|
| 11184 |
+
isEmbedded = _this$props2.isEmbedded,
|
| 11185 |
+
taskListComplete = _this$props2.taskListComplete,
|
| 11186 |
+
taskListHidden = _this$props2.taskListHidden;
|
| 11187 |
+
var isPerformingSetupTask = this.isPerformingSetupTask(); // Don't show the inbox on the Home screen.
|
| 11188 |
+
|
| 11189 |
+
var showInbox = (isEmbedded || !this.isHomescreen()) && !isPerformingSetupTask;
|
| 11190 |
+
var showStockAndReviews = (taskListComplete || taskListHidden) && !isPerformingSetupTask;
|
| 11191 |
+
var showStoreSetup = !taskListComplete && !taskListHidden && !isPerformingSetupTask && (!this.isHomescreen() || isEmbedded);
|
| 11192 |
+
var inbox = showInbox ? {
|
| 11193 |
+
name: 'inbox',
|
| 11194 |
+
title: Object(external_this_wp_i18n_["__"])('Inbox', 'woocommerce-admin'),
|
| 11195 |
+
icon: Object(external_this_wp_element_["createElement"])("i", {
|
| 11196 |
+
className: "material-icons-outlined"
|
| 11197 |
+
}, "inbox"),
|
| 11198 |
+
unread: hasUnreadNotes
|
| 11199 |
+
} : null;
|
| 11200 |
+
var setup = showStoreSetup ? {
|
| 11201 |
+
name: 'setup',
|
| 11202 |
+
title: Object(external_this_wp_i18n_["__"])('Store Setup', 'woocommerce-admin'),
|
| 11203 |
+
icon: Object(external_this_wp_element_["createElement"])(setup_progress_SetupProgress, null)
|
| 11204 |
+
} : null;
|
| 11205 |
+
var stockAndReviews = showStockAndReviews ? [manageStock === 'yes' && {
|
| 11206 |
+
name: 'stock',
|
| 11207 |
+
title: Object(external_this_wp_i18n_["__"])('Stock', 'woocommerce-admin'),
|
| 11208 |
+
icon: Object(external_this_wp_element_["createElement"])("i", {
|
| 11209 |
+
className: "material-icons-outlined"
|
| 11210 |
+
}, "widgets"),
|
| 11211 |
+
unread: hasUnreadStock
|
| 11212 |
+
}, activity_panel_reviewsEnabled === 'yes' && {
|
| 11213 |
+
name: 'reviews',
|
| 11214 |
+
title: Object(external_this_wp_i18n_["__"])('Reviews', 'woocommerce-admin'),
|
| 11215 |
+
icon: Object(external_this_wp_element_["createElement"])("i", {
|
| 11216 |
+
className: "material-icons-outlined"
|
| 11217 |
+
}, "star_border"),
|
| 11218 |
+
unread: hasUnapprovedReviews
|
| 11219 |
+
}].filter(Boolean) : [];
|
| 11220 |
+
var help = isPerformingSetupTask ? {
|
| 11221 |
+
name: 'help',
|
| 11222 |
+
title: Object(external_this_wp_i18n_["__"])('Help', 'woocommerce-admin'),
|
| 11223 |
+
icon: Object(external_this_wp_element_["createElement"])(build_module_icon["a" /* default */], {
|
| 11224 |
+
icon: library_lifesaver
|
| 11225 |
+
})
|
| 11226 |
+
} : null;
|
| 11227 |
+
return [inbox].concat(toConsumableArray_default()(stockAndReviews), [setup, help]).filter(Boolean);
|
| 11228 |
+
}
|
| 11229 |
+
}, {
|
| 11230 |
+
key: "getPanelContent",
|
| 11231 |
+
value: function getPanelContent(tab) {
|
| 11232 |
+
var _this$props3 = this.props,
|
| 11233 |
+
query = _this$props3.query,
|
| 11234 |
+
hasUnapprovedReviews = _this$props3.hasUnapprovedReviews;
|
| 11235 |
+
var task = query.task;
|
| 11236 |
+
|
| 11237 |
+
switch (tab) {
|
| 11238 |
+
case 'inbox':
|
| 11239 |
+
return Object(external_this_wp_element_["createElement"])(InboxPanel, null);
|
| 11240 |
+
|
| 11241 |
+
case 'stock':
|
| 11242 |
+
return Object(external_this_wp_element_["createElement"])(StockPanel, null);
|
| 11243 |
+
|
| 11244 |
+
case 'reviews':
|
| 11245 |
+
return Object(external_this_wp_element_["createElement"])(ReviewsPanel, {
|
| 11246 |
+
hasUnapprovedReviews: hasUnapprovedReviews
|
| 11247 |
+
});
|
| 11248 |
+
|
| 11249 |
+
case 'help':
|
| 11250 |
+
return Object(external_this_wp_element_["createElement"])(HelpPanel, {
|
| 11251 |
+
taskName: task
|
| 11252 |
+
});
|
| 11253 |
+
|
| 11254 |
+
default:
|
| 11255 |
+
return null;
|
| 11256 |
+
}
|
| 11257 |
+
}
|
| 11258 |
+
}, {
|
| 11259 |
+
key: "renderPanel",
|
| 11260 |
+
value: function renderPanel() {
|
| 11261 |
+
var _this2 = this;
|
| 11262 |
+
|
| 11263 |
+
var _this$props4 = this.props,
|
| 11264 |
+
updateOptions = _this$props4.updateOptions,
|
| 11265 |
+
taskListHidden = _this$props4.taskListHidden;
|
| 11266 |
+
var _this$state = this.state,
|
| 11267 |
+
isPanelOpen = _this$state.isPanelOpen,
|
| 11268 |
+
currentTab = _this$state.currentTab,
|
| 11269 |
+
isPanelSwitching = _this$state.isPanelSwitching;
|
| 11270 |
+
var tab = Object(external_lodash_["find"])(this.getTabs(), {
|
| 11271 |
+
name: currentTab
|
| 11272 |
+
});
|
| 11273 |
+
|
| 11274 |
+
if (!tab) {
|
| 11275 |
+
return Object(external_this_wp_element_["createElement"])("div", {
|
| 11276 |
+
className: "woocommerce-layout__activity-panel-wrapper"
|
| 11277 |
+
});
|
| 11278 |
+
}
|
| 11279 |
+
|
| 11280 |
+
var clearPanel = function clearPanel() {
|
| 11281 |
+
_this2.clearPanel();
|
| 11282 |
+
};
|
| 11283 |
+
|
| 11284 |
+
if (currentTab === 'display-options') {
|
| 11285 |
+
return null;
|
| 11286 |
+
}
|
| 11287 |
+
|
| 11288 |
+
if (currentTab === 'setup') {
|
| 11289 |
+
var currentLocation = window.location.href;
|
| 11290 |
+
var homescreenLocation = Object(settings["f" /* getAdminLink */])('admin.php?page=wc-admin'); // Don't navigate if we're already on the homescreen, this will cause an infinite loop
|
| 11291 |
+
|
| 11292 |
+
if (currentLocation !== homescreenLocation) {
|
| 11293 |
+
// Ensure that if the user is trying to get to the task list they can see it even if
|
| 11294 |
+
// it was dismissed.
|
| 11295 |
+
if (taskListHidden === 'no') {
|
| 11296 |
+
this.redirectToHomeScreen();
|
| 11297 |
+
} else {
|
| 11298 |
+
updateOptions({
|
| 11299 |
+
woocommerce_task_list_hidden: 'no'
|
| 11300 |
+
}).then(this.redirectToHomeScreen);
|
| 11301 |
+
}
|
| 11302 |
+
}
|
| 11303 |
+
|
| 11304 |
+
return null;
|
| 11305 |
+
}
|
| 11306 |
+
|
| 11307 |
+
var classNames = classnames_default()('woocommerce-layout__activity-panel-wrapper', {
|
| 11308 |
+
'is-open': isPanelOpen,
|
| 11309 |
+
'is-switching': isPanelSwitching
|
| 11310 |
+
});
|
| 11311 |
+
return Object(external_this_wp_element_["createElement"])("div", {
|
| 11312 |
+
className: classNames,
|
| 11313 |
+
tabIndex: 0,
|
| 11314 |
+
role: "tabpanel",
|
| 11315 |
+
"aria-label": tab.title,
|
| 11316 |
+
onTransitionEnd: clearPanel,
|
| 11317 |
+
onAnimationEnd: clearPanel
|
| 11318 |
+
}, Object(external_this_wp_element_["createElement"])("div", {
|
| 11319 |
+
className: "woocommerce-layout__activity-panel-content",
|
| 11320 |
+
key: 'activity-panel-' + currentTab,
|
| 11321 |
+
id: 'activity-panel-' + currentTab
|
| 11322 |
+
}, Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Suspense"], {
|
| 11323 |
+
fallback: Object(external_this_wp_element_["createElement"])(external_this_wc_components_["Spinner"], null)
|
| 11324 |
+
}, this.getPanelContent(currentTab))));
|
| 11325 |
+
}
|
| 11326 |
+
}, {
|
| 11327 |
+
key: "redirectToHomeScreen",
|
| 11328 |
+
value: function redirectToHomeScreen() {
|
| 11329 |
+
if (Object(utils["f" /* isWCAdmin */])(window.location.href)) {
|
| 11330 |
+
Object(external_this_wc_navigation_["getHistory"])().push(Object(external_this_wc_navigation_["getNewPath"])({}, '/', {}));
|
| 11331 |
+
} else {
|
| 11332 |
+
window.location.href = Object(settings["f" /* getAdminLink */])('admin.php?page=wc-admin');
|
| 11333 |
+
}
|
| 11334 |
+
}
|
| 11335 |
+
}, {
|
| 11336 |
+
key: "render",
|
| 11337 |
+
value: function render() {
|
| 11338 |
+
var _this3 = this;
|
| 11339 |
+
|
| 11340 |
+
var tabs = this.getTabs();
|
| 11341 |
+
var isEmbedded = this.props.isEmbedded;
|
| 11342 |
+
var _this$state2 = this.state,
|
| 11343 |
+
mobileOpen = _this$state2.mobileOpen,
|
| 11344 |
+
currentTab = _this$state2.currentTab,
|
| 11345 |
+
isPanelOpen = _this$state2.isPanelOpen;
|
| 11346 |
+
var headerId = Object(external_lodash_["uniqueId"])('activity-panel-header_');
|
| 11347 |
+
var panelClasses = classnames_default()('woocommerce-layout__activity-panel', {
|
| 11348 |
+
'is-mobile-open': this.state.mobileOpen
|
| 11349 |
+
});
|
| 11350 |
+
var hasUnread = tabs.some(function (tab) {
|
| 11351 |
+
return tab.unread;
|
| 11352 |
+
});
|
| 11353 |
+
var viewLabel = hasUnread ? Object(external_this_wp_i18n_["__"])('View Activity Panel, you have unread activity', 'woocommerce-admin') : Object(external_this_wp_i18n_["__"])('View Activity Panel', 'woocommerce-admin');
|
| 11354 |
+
var isPerformingSetupTask = this.isPerformingSetupTask();
|
| 11355 |
+
var showDisplayOptions = !isEmbedded && this.isHomescreen() && !isPerformingSetupTask;
|
| 11356 |
+
return Object(external_this_wp_element_["createElement"])("div", null, Object(external_this_wp_element_["createElement"])(external_this_wc_components_["H"], {
|
| 11357 |
+
id: headerId,
|
| 11358 |
+
className: "screen-reader-text"
|
| 11359 |
+
}, Object(external_this_wp_i18n_["__"])('Store Activity', 'woocommerce-admin')), Object(external_this_wp_element_["createElement"])(external_this_wc_components_["Section"], {
|
| 11360 |
+
component: "aside",
|
| 11361 |
+
id: "woocommerce-activity-panel",
|
| 11362 |
+
"aria-labelledby": headerId
|
| 11363 |
+
}, Object(external_this_wp_element_["createElement"])(build_module_button["a" /* default */], {
|
| 11364 |
+
onClick: function onClick() {
|
| 11365 |
+
_this3.toggleMobile();
|
| 11366 |
+
},
|
| 11367 |
+
label: mobileOpen ? Object(external_this_wp_i18n_["__"])('Close Activity Panel', 'woocommerce-admin') : viewLabel,
|
| 11368 |
+
"aria-expanded": mobileOpen,
|
| 11369 |
+
className: "woocommerce-layout__activity-panel-mobile-toggle"
|
| 11370 |
+
}, mobileOpen ? Object(external_this_wp_element_["createElement"])(cross_small_default.a, null) : Object(external_this_wp_element_["createElement"])(toggle_bubble, {
|
| 11371 |
+
hasUnread: hasUnread
|
| 11372 |
+
})), Object(external_this_wp_element_["createElement"])("div", {
|
| 11373 |
+
className: panelClasses
|
| 11374 |
+
}, Object(external_this_wp_element_["createElement"])(tabs_Tabs, {
|
| 11375 |
+
tabs: tabs,
|
| 11376 |
+
tabOpen: isPanelOpen,
|
| 11377 |
+
selectedTab: currentTab,
|
| 11378 |
+
onTabClick: function onTabClick(tab, tabOpen) {
|
| 11379 |
+
_this3.togglePanel(tab, tabOpen);
|
| 11380 |
+
},
|
| 11381 |
+
showDisplayOptions: showDisplayOptions
|
| 11382 |
+
}), this.renderPanel())));
|
| 11383 |
+
}
|
| 11384 |
+
}]);
|
| 11385 |
+
|
| 11386 |
+
return ActivityPanel;
|
| 11387 |
+
}(external_this_wp_element_["Component"]);
|
| 11388 |
+
activity_panel_ActivityPanel.defaultProps = {
|
| 11389 |
+
getHistory: external_this_wc_navigation_["getHistory"]
|
| 11390 |
+
};
|
| 11391 |
+
/* harmony default export */ var activity_panel = (Object(compose["a" /* default */])(Object(external_this_wp_data_["withSelect"])(function (select) {
|
| 11392 |
+
var hasUnreadNotes = getUnreadNotes(select);
|
| 11393 |
+
var hasUnreadStock = getUnreadStock();
|
| 11394 |
+
var hasUnapprovedReviews = getUnapprovedReviews(select);
|
| 11395 |
+
|
| 11396 |
+
var _select = select(external_this_wc_data_["OPTIONS_STORE_NAME"]),
|
| 11397 |
+
getOption = _select.getOption,
|
| 11398 |
+
isResolving = _select.isResolving;
|
| 11399 |
+
|
| 11400 |
+
var taskListComplete = getOption('woocommerce_task_list_complete') === 'yes';
|
| 11401 |
+
var taskListHidden = getOption('woocommerce_task_list_hidden') === 'yes';
|
| 11402 |
+
var requestingTaskListOptions = isResolving('getOption', ['woocommerce_task_list_complete']) || isResolving('getOption', ['woocommerce_task_list_hidden']);
|
| 11403 |
+
return {
|
| 11404 |
+
hasUnreadNotes: hasUnreadNotes,
|
| 11405 |
+
hasUnreadStock: hasUnreadStock,
|
| 11406 |
+
hasUnapprovedReviews: hasUnapprovedReviews,
|
| 11407 |
+
requestingTaskListOptions: requestingTaskListOptions,
|
| 11408 |
+
taskListComplete: taskListComplete,
|
| 11409 |
+
taskListHidden: taskListHidden
|
| 11410 |
+
};
|
| 11411 |
+
}), Object(external_this_wp_data_["withDispatch"])(function (dispatch) {
|
| 11412 |
+
return {
|
| 11413 |
+
updateOptions: dispatch(external_this_wc_data_["OPTIONS_STORE_NAME"]).updateOptions
|
| 11414 |
+
};
|
| 11415 |
+
}), dist_default.a)(activity_panel_ActivityPanel));
|
| 11416 |
+
// CONCATENATED MODULE: ./client/lib/platform/index.js
|
| 11417 |
+
var ANDROID_PLATFORM = 'android';
|
| 11418 |
+
var IOS_PLATFORM = 'ios';
|
| 11419 |
+
var UNKNOWN_PLATFORM = 'unknown';
|
| 11420 |
+
/**
|
| 11421 |
+
* Provide basic detection of platform based on user agent. This is not
|
| 11422 |
+
* a robust check for browser features or the like. You should only use
|
| 11423 |
+
* this for non-critical display logic.
|
| 11424 |
+
*/
|
| 11425 |
+
|
| 11426 |
+
var platform = function platform() {
|
| 11427 |
+
if (/iPhone|iPad|iPod/i.test(window.navigator.userAgent)) {
|
| 11428 |
+
return IOS_PLATFORM;
|
| 11429 |
+
} else if (/Android/i.test(window.navigator.userAgent)) {
|
| 11430 |
+
return ANDROID_PLATFORM;
|
| 11431 |
+
}
|
| 11432 |
+
|
| 11433 |
+
return UNKNOWN_PLATFORM;
|
| 11434 |
+
};
|
| 11435 |
+
// CONCATENATED MODULE: ./client/mobile-banner/app-icon.js
|
| 11436 |
+
|
| 11437 |
+
var app_icon_AppIcon = function AppIcon() {
|
| 11438 |
+
return Object(external_this_wp_element_["createElement"])("svg", {
|
| 11439 |
+
width: "37",
|
| 11440 |
+
height: "37",
|
| 11441 |
+
viewBox: "0 0 92 92",
|
| 11442 |
+
fill: "none",
|
| 11443 |
+
xmlns: "http://www.w3.org/2000/svg"
|
| 11444 |
+
}, Object(external_this_wp_element_["createElement"])("rect", {
|
| 11445 |
+
width: "92",
|
| 11446 |
+
height: "92",
|
| 11447 |
+
rx: "21.3953",
|
| 11448 |
+
fill: "#7F54B3"
|
| 11449 |
+
}), Object(external_this_wp_element_["createElement"])("path", {
|
| 11450 |
+
fillRule: "evenodd",
|
| 11451 |
+
clipRule: "evenodd",
|
| 11452 |
+
d: "M72.5937 28.043H19.8094C16.4781 28.0459 13.7783 30.7705 13.7754 34.1324V54.4501C13.7783 57.812 16.4781 60.5366 19.8094 60.5395H44.8229L56.2573 66.9607L53.6672 60.5395H72.599C74.2009 60.5402 75.7374 59.8983 76.8702 58.7552C78.0029 57.612 78.639 56.0614 78.6383 54.4447V34.1324C78.6376 32.5157 78.0002 30.9657 76.8664 29.8235C75.7327 28.6814 74.1956 28.0408 72.5937 28.043ZM19.1057 32.4208C18.4658 32.4324 17.8646 32.7359 17.467 33.2482C17.0888 33.7635 16.9404 34.4175 17.058 35.0502C18.5962 45.0986 20.0338 51.8757 21.371 55.3816C21.8779 56.658 22.4896 57.2703 23.2063 57.2185C24.3075 57.1489 25.6263 55.5968 27.1627 52.5621C27.9964 50.8412 29.2602 48.2662 30.9539 44.837C32.3785 49.88 34.309 53.6787 36.7456 56.2331C37.4291 56.9436 38.1204 57.2748 38.8195 57.2266C39.4185 57.1931 39.953 56.8315 40.217 56.2813C40.4753 55.7358 40.5806 55.1278 40.5211 54.5248C40.3516 52.0703 40.5919 48.667 41.2421 44.3149C41.9081 39.8057 42.7523 36.5818 43.7749 34.6432C43.9822 34.2526 44.0733 33.8087 44.037 33.366C44.0039 32.7587 43.7116 32.1969 43.2374 31.829C42.7745 31.4367 42.1799 31.2446 41.5803 31.2935C40.8334 31.3325 40.1682 31.7885 39.8499 32.4797C38.2331 35.5019 37.0812 40.4109 36.3943 47.2068C35.2823 44.2394 34.4509 41.1703 33.9114 38.0412C33.623 36.4613 32.9037 35.7125 31.7536 35.7946C30.9592 35.8589 30.3063 36.3944 29.7819 37.4012L24.0348 48.5643C23.0997 44.6692 22.2205 39.9289 21.3972 34.3433C21.1997 32.9652 20.4358 32.3244 19.1057 32.4208ZM69.9089 34.6877C71.6969 35.0381 73.2407 36.2 74.1186 37.8559C74.9693 39.3247 75.3946 41.1161 75.3946 43.23C75.4148 45.9567 74.7062 48.6357 73.3477 50.9687C71.7778 53.7023 69.7195 55.0691 67.1727 55.0691C66.6933 55.0668 66.2153 55.0128 65.7467 54.9078C63.9584 54.5581 62.4143 53.396 61.5371 51.7396C60.6864 50.2452 60.261 48.4411 60.261 46.3272C60.2357 43.6127 60.945 40.9454 62.3079 38.6295C63.9023 35.8959 65.9607 34.5291 68.4829 34.5291C68.9623 34.5304 69.4402 34.5836 69.9089 34.6877ZM68.7937 49.4848C69.7707 48.5773 70.4399 47.2269 70.8012 45.4337V45.4419C70.9315 44.7826 70.9959 44.1112 70.9933 43.4382C70.986 42.5849 70.8291 41.74 70.5302 40.9452C70.1443 39.901 69.6304 39.3124 68.9884 39.1793C68.0378 38.9643 67.1239 39.5256 66.2469 40.8632C65.5812 41.8393 65.109 42.9432 64.8577 44.1106C64.7276 44.7708 64.6632 45.4432 64.6657 46.1171C64.6739 46.9677 64.8308 47.8096 65.1287 48.6019C65.5146 49.6388 66.0294 50.2274 66.6731 50.3678C67.3169 50.5081 68.0237 50.2138 68.7937 49.4848ZM57.9079 37.8559C57.0291 36.2008 55.4854 35.0392 53.6976 34.6877C53.2279 34.5837 52.749 34.5306 52.2687 34.5291C49.7443 34.5291 47.6856 35.8959 46.0927 38.6295C44.7295 40.9454 44.0201 43.6127 44.0454 46.3272C44.0454 48.4411 44.4699 50.2452 45.319 51.7396C46.1976 53.3949 47.7414 54.5566 49.5294 54.9078C49.999 55.0126 50.4779 55.0667 50.9582 55.0691C53.5055 55.0691 55.5642 53.7023 57.1343 50.9687C58.4922 48.6355 59.2001 45.9565 59.1789 43.23C59.1789 41.1161 58.7544 39.3247 57.9053 37.8559H57.9079ZM54.5903 45.4337C54.2307 47.2269 53.5614 48.5773 52.5825 49.4848C51.8115 50.2065 51.101 50.5017 50.4589 50.3678C49.8169 50.2338 49.3011 49.6461 48.9169 48.6019C48.6181 47.8097 48.4603 46.9678 48.4511 46.1171C48.4495 45.4431 48.5148 44.7707 48.6459 44.1106C48.8971 42.9432 49.3694 41.8393 50.0353 40.8632C50.9124 39.5256 51.8264 38.9643 52.7773 39.1793C53.4193 39.3124 53.9333 39.901 54.3193 40.9452C54.617 41.7404 54.7739 42.585 54.7824 43.4382C54.785 44.1112 54.7207 44.7826 54.5903 45.4419V45.4337Z",
|
| 11453 |
+
fill: "white"
|
| 11454 |
+
}));
|
| 11455 |
+
};
|
| 11456 |
+
// EXTERNAL MODULE: ./client/mobile-banner/style.scss
|
| 11457 |
+
var mobile_banner_style = __webpack_require__(571);
|
| 11458 |
+
|
| 11459 |
+
// CONCATENATED MODULE: ./client/mobile-banner/constants.js
|
| 11460 |
+
// The Play Store link is defined as an exported constant mainly for the sake of testing the Mobile App Banner.
|
| 11461 |
+
// It is nearly impossible to fake navigation in JSDOM 16, so exposing this link for mocking allows us to
|
| 11462 |
+
// avoid triggering a navigation.
|
| 11463 |
+
var PLAY_STORE_LINK = 'https://play.google.com/store/apps/details?id=com.woocommerce.android';
|
| 11464 |
+
var TRACKING_EVENT_NAME = 'wcadmin_mobile_android_banner_click';
|
| 11465 |
+
// CONCATENATED MODULE: ./client/mobile-banner/index.js
|
| 11466 |
+
|
| 11467 |
+
|
| 11468 |
+
|
| 11469 |
+
/**
|
| 11470 |
+
* External dependencies
|
| 11471 |
+
*/
|
| 11472 |
+
|
| 11473 |
+
|
| 11474 |
+
|
| 11475 |
+
|
| 11476 |
+
/**
|
| 11477 |
+
* Internal dependencies
|
| 11478 |
+
*/
|
| 11479 |
+
|
| 11480 |
+
|
| 11481 |
+
|
| 11482 |
+
|
| 11483 |
+
|
| 11484 |
+
var SHOW_APP_BANNER_MODIFIER_CLASS = 'woocommerce-layout__show-app-banner';
|
| 11485 |
+
var mobile_banner_MobileAppBanner = function MobileAppBanner(_ref) {
|
| 11486 |
+
var onInstall = _ref.onInstall,
|
| 11487 |
+
onDismiss = _ref.onDismiss;
|
| 11488 |
+
Object(external_this_wp_element_["useEffect"])(function () {
|
| 11489 |
+
var layout = document.getElementsByClassName('woocommerce-layout')[0];
|
| 11490 |
+
|
| 11491 |
+
if (platform() === ANDROID_PLATFORM) {
|
| 11492 |
+
if (layout) {
|
| 11493 |
+
// This is a hack to allow the mobile banner to work in the context of the header which is
|
| 11494 |
+
// position fixed. This can be refactored away when we move away from the activity panel
|
| 11495 |
+
// in future.
|
| 11496 |
+
layout.classList.add(SHOW_APP_BANNER_MODIFIER_CLASS);
|
| 11497 |
+
}
|
| 11498 |
+
}
|
| 11499 |
+
|
| 11500 |
+
return function () {
|
| 11501 |
+
if (layout) {
|
| 11502 |
+
layout.classList.remove(SHOW_APP_BANNER_MODIFIER_CLASS);
|
| 11503 |
+
}
|
| 11504 |
+
};
|
| 11505 |
+
}, []);
|
| 11506 |
+
|
| 11507 |
+
var _useState = Object(external_this_wp_element_["useState"])(false),
|
| 11508 |
+
_useState2 = slicedToArray_default()(_useState, 2),
|
| 11509 |
+
isDismissed = _useState2[0],
|
| 11510 |
+
setDismissed = _useState2[1]; // On iOS the "Smart App Banner" meta tag is used so only display this on Android.
|
| 11511 |
+
|
| 11512 |
+
|
| 11513 |
+
if (platform() === ANDROID_PLATFORM && !isDismissed) {
|
| 11514 |
+
return Object(external_this_wp_element_["createElement"])("div", {
|
| 11515 |
+
className: "woocommerce-mobile-app-banner"
|
| 11516 |
+
}, Object(external_this_wp_element_["createElement"])(components_build_module_icon["a" /* default */], {
|
| 11517 |
+
icon: "no-alt",
|
| 11518 |
+
"data-testid": "dismiss-btn",
|
| 11519 |
+
onClick: function onClick() {
|
| 11520 |
+
onDismiss();
|
| 11521 |
+
setDismissed(true);
|
| 11522 |
+
Object(external_this_wc_tracks_["recordEvent"])(TRACKING_EVENT_NAME, {
|
| 11523 |
+
action: 'dismiss'
|
| 11524 |
+
});
|
| 11525 |
+
}
|
| 11526 |
+
}), Object(external_this_wp_element_["createElement"])(app_icon_AppIcon, null), Object(external_this_wp_element_["createElement"])("div", {
|
| 11527 |
+
className: "woocommerce-mobile-app-banner__description"
|
| 11528 |
+
}, Object(external_this_wp_element_["createElement"])("p", {
|
| 11529 |
+
className: "woocommerce-mobile-app-banner__description__text"
|
| 11530 |
+
}, Object(external_this_wp_i18n_["__"])('Run your store from anywhere', 'woocommerce-admin')), Object(external_this_wp_element_["createElement"])("p", {
|
| 11531 |
+
className: "woocommerce-mobile-app-banner__description__text"
|
| 11532 |
+
}, Object(external_this_wp_i18n_["__"])('Download the WooCommerce app', 'woocommerce-admin'))), Object(external_this_wp_element_["createElement"])(build_module_button["a" /* default */], {
|
| 11533 |
+
href: PLAY_STORE_LINK,
|
| 11534 |
+
isSecondary: true,
|
| 11535 |
+
onClick: function onClick() {
|
| 11536 |
+
onInstall();
|
| 11537 |
+
setDismissed(true);
|
| 11538 |
+
Object(external_this_wc_tracks_["recordEvent"])(TRACKING_EVENT_NAME, {
|
| 11539 |
+
action: 'install'
|
| 11540 |
+
});
|
| 11541 |
+
}
|
| 11542 |
+
}, Object(external_this_wp_i18n_["__"])('Install', 'woocommerce-admin')));
|
| 11543 |
+
}
|
| 11544 |
+
|
| 11545 |
+
return null;
|
| 11546 |
+
};
|
| 11547 |
+
// EXTERNAL MODULE: ./client/hooks/useIsScrolled.js
|
| 11548 |
+
var useIsScrolled = __webpack_require__(295);
|
| 11549 |
+
|
| 11550 |
+
// CONCATENATED MODULE: ./client/header/index.js
|
| 11551 |
+
|
| 11552 |
+
|
| 11553 |
+
|
| 11554 |
+
/**
|
| 11555 |
+
* External dependencies
|
| 11556 |
+
*/
|
| 11557 |
+
|
| 11558 |
+
|
| 11559 |
+
|
| 11560 |
+
|
| 11561 |
+
|
| 11562 |
+
|
| 11563 |
+
|
| 11564 |
+
/**
|
| 11565 |
+
* Internal dependencies
|
| 11566 |
+
*/
|
| 11567 |
+
|
| 11568 |
+
|
| 11569 |
+
|
| 11570 |
+
|
| 11571 |
+
|
| 11572 |
+
var header_Header = function Header(_ref) {
|
| 11573 |
+
var sections = _ref.sections,
|
| 11574 |
+
_ref$isEmbedded = _ref.isEmbedded,
|
| 11575 |
+
isEmbedded = _ref$isEmbedded === void 0 ? false : _ref$isEmbedded,
|
| 11576 |
+
query = _ref.query;
|
| 11577 |
+
var headerElement = Object(external_this_wp_element_["useRef"])(null);
|
| 11578 |
+
var siteTitle = Object(settings["g" /* getSetting */])('siteTitle', '');
|
| 11579 |
+
var pageTitle = sections.slice(-1)[0];
|
| 11580 |
+
var isScrolled = Object(useIsScrolled["a" /* default */])();
|
| 11581 |
+
|
| 11582 |
+
var _useUserPreferences = Object(external_this_wc_data_["useUserPreferences"])(),
|
| 11583 |
+
updateUserPreferences = _useUserPreferences.updateUserPreferences,
|
| 11584 |
+
userData = objectWithoutProperties_default()(_useUserPreferences, ["updateUserPreferences"]);
|
| 11585 |
+
|
| 11586 |
+
var isModalDismissed = userData.android_app_banner_dismissed === 'yes';
|
| 11587 |
+
var className = classnames_default()('woocommerce-layout__header', {
|
| 11588 |
+
'is-scrolled': isScrolled
|
| 11589 |
+
});
|
| 11590 |
+
Object(external_this_wp_element_["useEffect"])(function () {
|
| 11591 |
+
if (!isEmbedded) {
|
| 11592 |
+
var documentTitle = sections.map(function (section) {
|
| 11593 |
+
return Array.isArray(section) ? section[1] : section;
|
| 11594 |
+
}).reverse().join(' ‹ ');
|
| 11595 |
+
var decodedTitle = Object(external_this_wp_htmlEntities_["decodeEntities"])(Object(external_this_wp_i18n_["sprintf"])(
|
| 11596 |
+
/* translators: 1: document title. 2: page title */
|
| 11597 |
+
Object(external_this_wp_i18n_["__"])('%1$s ‹ %2$s — WooCommerce', 'woocommerce-admin'), documentTitle, siteTitle));
|
| 11598 |
+
|
| 11599 |
+
if (document.title !== decodedTitle) {
|
| 11600 |
+
document.title = decodedTitle;
|
| 11601 |
+
}
|
| 11602 |
+
}
|
| 11603 |
+
}, [isEmbedded, sections, siteTitle]);
|
| 11604 |
+
|
| 11605 |
+
var dismissHandler = function dismissHandler() {
|
| 11606 |
+
updateUserPreferences({
|
| 11607 |
+
android_app_banner_dismissed: 'yes'
|
| 11608 |
+
});
|
| 11609 |
+
};
|
| 11610 |
+
|
| 11611 |
+
return Object(external_this_wp_element_["createElement"])("div", {
|
| 11612 |
+
className: className,
|
| 11613 |
+
ref: headerElement
|
| 11614 |
+
}, !isModalDismissed && Object(external_this_wp_element_["createElement"])(mobile_banner_MobileAppBanner, {
|
| 11615 |
+
onDismiss: dismissHandler,
|
| 11616 |
+
onInstall: dismissHandler
|
| 11617 |
+
}), Object(external_this_wp_element_["createElement"])(build_module_text["a" /* default */], {
|
| 11618 |
+
className: "woocommerce-layout__header-heading",
|
| 11619 |
+
as: "h1",
|
| 11620 |
+
variant: "subtitle.small"
|
| 11621 |
+
}, Object(external_this_wp_htmlEntities_["decodeEntities"])(pageTitle)), window.wcAdminFeatures['activity-panels'] && Object(external_this_wp_element_["createElement"])(activity_panel, {
|
| 11622 |
+
isEmbedded: isEmbedded,
|
| 11623 |
+
query: query
|
| 11624 |
+
}));
|
| 11625 |
+
};
|
| 11626 |
+
// CONCATENATED MODULE: ./client/layout/notices.js
|
| 11627 |
+
|
| 11628 |
+
|
| 11629 |
+
|
| 11630 |
+
|
| 11631 |
+
|
| 11632 |
+
|
| 11633 |
+
|
| 11634 |
+
function notices_createSuper(Derived) { var hasNativeReflectConstruct = notices_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = getPrototypeOf_default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = getPrototypeOf_default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return possibleConstructorReturn_default()(this, result); }; }
|
| 11635 |
+
|
| 11636 |
+
function notices_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
| 11637 |
+
|
| 11638 |
+
/**
|
| 11639 |
+
* External dependencies
|
| 11640 |
+
*/
|
| 11641 |
+
|
| 11642 |
+
|
| 11643 |
+
var notices_Notices = /*#__PURE__*/function (_Component) {
|
| 11644 |
+
inherits_default()(Notices, _Component);
|
| 11645 |
+
|
| 11646 |
+
var _super = notices_createSuper(Notices);
|
| 11647 |
+
|
| 11648 |
+
function Notices() {
|
| 11649 |
+
classCallCheck_default()(this, Notices);
|
| 11650 |
+
|
| 11651 |
+
return _super.apply(this, arguments);
|
| 11652 |
+
}
|
| 11653 |
+
|
| 11654 |
+
createClass_default()(Notices, [{
|
| 11655 |
+
key: "render",
|
| 11656 |
+
value: function render() {
|
| 11657 |
+
return Object(external_this_wp_element_["createElement"])("div", {
|
| 11658 |
+
id: "woocommerce-layout__notice-list",
|
| 11659 |
+
className: "woocommerce-layout__notice-list"
|
| 11660 |
+
});
|
| 11661 |
+
}
|
| 11662 |
+
}]);
|
| 11663 |
+
|
| 11664 |
+
return Notices;
|
| 11665 |
+
}(external_this_wp_element_["Component"]);
|
| 11666 |
+
|
| 11667 |
+
/* harmony default export */ var layout_notices = (notices_Notices);
|
| 11668 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/regenerator/index.js
|
| 11669 |
+
var regenerator = __webpack_require__(14);
|
| 11670 |
+
var regenerator_default = /*#__PURE__*/__webpack_require__.n(regenerator);
|
| 11671 |
+
|
| 11672 |
+
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js
|
| 11673 |
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
| 11674 |
+
try {
|
| 11675 |
+
var info = gen[key](arg);
|
| 11676 |
+
var value = info.value;
|
| 11677 |
+
} catch (error) {
|
| 11678 |
+
reject(error);
|
| 11679 |
+
return;
|
| 11680 |
+
}
|
| 11681 |
+
|
| 11682 |
+
if (info.done) {
|
| 11683 |
+
resolve(value);
|
| 11684 |
+
} else {
|
| 11685 |
+
Promise.resolve(value).then(_next, _throw);
|
| 11686 |
+
}
|
| 11687 |
+
}
|
| 11688 |
+
|
| 11689 |
+
function _asyncToGenerator(fn) {
|
| 11690 |
+
return function () {
|
| 11691 |
+
var self = this,
|
| 11692 |
+
args = arguments;
|
| 11693 |
+
return new Promise(function (resolve, reject) {
|
| 11694 |
+
var gen = fn.apply(self, args);
|
| 11695 |
+
|
| 11696 |
+
function _next(value) {
|
| 11697 |
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
| 11698 |
+
}
|
| 11699 |
+
|
| 11700 |
+
function _throw(err) {
|
| 11701 |
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
| 11702 |
+
}
|
| 11703 |
+
|
| 11704 |
+
_next(undefined);
|
| 11705 |
+
});
|
| 11706 |
+
};
|
| 11707 |
+
}
|
| 11708 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js + 3 modules
|
| 11709 |
+
var esm_slicedToArray = __webpack_require__(26);
|
| 11710 |
+
|
| 11711 |
+
// EXTERNAL MODULE: ./node_modules/react-spring/web.cjs.js
|
| 11712 |
+
var web_cjs = __webpack_require__(436);
|
| 11713 |
+
|
| 11714 |
+
// EXTERNAL MODULE: ./node_modules/@wordpress/compose/build-module/hooks/use-reduced-motion/index.js
|
| 11715 |
+
var use_reduced_motion = __webpack_require__(760);
|
| 11716 |
+
|
| 11717 |
+
// EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/snackbar/index.js
|
| 11718 |
+
var snackbar = __webpack_require__(536);
|
| 11719 |
+
|
| 11720 |
+
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/snackbar/list.js
|
| 11721 |
+
|
| 11722 |
+
|
| 11723 |
+
|
| 11724 |
+
|
| 11725 |
+
|
| 11726 |
+
|
| 11727 |
+
/**
|
| 11728 |
+
* External dependencies
|
| 11729 |
+
*/
|
| 11730 |
+
|
| 11731 |
+
|
| 11732 |
+
|
| 11733 |
+
/**
|
| 11734 |
+
* WordPress dependencies
|
| 11735 |
+
*/
|
| 11736 |
+
|
| 11737 |
+
|
| 11738 |
+
|
| 11739 |
+
/**
|
| 11740 |
+
* Internal dependencies
|
| 11741 |
+
*/
|
| 11742 |
+
|
| 11743 |
+
|
| 11744 |
+
/**
|
| 11745 |
+
* Renders a list of notices.
|
| 11746 |
+
*
|
| 11747 |
+
* @param {Object} $0 Props passed to the component.
|
| 11748 |
+
* @param {Array} $0.notices Array of notices to render.
|
| 11749 |
+
* @param {Function} $0.onRemove Function called when a notice should be removed / dismissed.
|
| 11750 |
+
* @param {Object} $0.className Name of the class used by the component.
|
| 11751 |
+
* @param {Object} $0.children Array of children to be rendered inside the notice list.
|
| 11752 |
+
* @return {Object} The rendered notices list.
|
| 11753 |
+
*/
|
| 11754 |
+
|
| 11755 |
+
function SnackbarList(_ref) {
|
| 11756 |
+
var notices = _ref.notices,
|
| 11757 |
+
className = _ref.className,
|
| 11758 |
+
children = _ref.children,
|
| 11759 |
+
_ref$onRemove = _ref.onRemove,
|
| 11760 |
+
onRemove = _ref$onRemove === void 0 ? external_lodash_["noop"] : _ref$onRemove;
|
| 11761 |
+
var isReducedMotion = Object(use_reduced_motion["a" /* default */])();
|
| 11762 |
+
|
| 11763 |
+
var _useState = Object(external_this_wp_element_["useState"])(function () {
|
| 11764 |
+
return new WeakMap();
|
| 11765 |
+
}),
|
| 11766 |
+
_useState2 = Object(esm_slicedToArray["a" /* default */])(_useState, 1),
|
| 11767 |
+
refMap = _useState2[0];
|
| 11768 |
+
|
| 11769 |
+
var transitions = Object(web_cjs["useTransition"])(notices, function (notice) {
|
| 11770 |
+
return notice.id;
|
| 11771 |
+
}, {
|
| 11772 |
+
from: {
|
| 11773 |
+
opacity: 0,
|
| 11774 |
+
height: 0
|
| 11775 |
+
},
|
| 11776 |
+
enter: function enter(item) {
|
| 11777 |
+
return /*#__PURE__*/function () {
|
| 11778 |
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/regenerator_default.a.mark(function _callee(next) {
|
| 11779 |
+
return regenerator_default.a.wrap(function _callee$(_context) {
|
| 11780 |
+
while (1) {
|
| 11781 |
+
switch (_context.prev = _context.next) {
|
| 11782 |
+
case 0:
|
| 11783 |
+
_context.next = 2;
|
| 11784 |
+
return next({
|
| 11785 |
+
opacity: 1,
|
| 11786 |
+
height: refMap.get(item).offsetHeight
|
| 11787 |
+
});
|
| 11788 |
+
|
| 11789 |
+
case 2:
|
| 11790 |
+
return _context.abrupt("return", _context.sent);
|
| 11791 |
+
|
| 11792 |
+
case 3:
|
| 11793 |
+
case "end":
|
| 11794 |
+
return _context.stop();
|
| 11795 |
+
}
|
| 11796 |
+
}
|
| 11797 |
+
}, _callee);
|
| 11798 |
+
}));
|
| 11799 |
+
|
| 11800 |
+
return function (_x) {
|
| 11801 |
+
return _ref2.apply(this, arguments);
|
| 11802 |
+
};
|
| 11803 |
+
}();
|
| 11804 |
+
},
|
| 11805 |
+
leave: function leave() {
|
| 11806 |
+
return /*#__PURE__*/function () {
|
| 11807 |
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/regenerator_default.a.mark(function _callee2(next) {
|
| 11808 |
+
return regenerator_default.a.wrap(function _callee2$(_context2) {
|
| 11809 |
+
while (1) {
|
| 11810 |
+
switch (_context2.prev = _context2.next) {
|
| 11811 |
+
case 0:
|
| 11812 |
+
_context2.next = 2;
|
| 11813 |
+
return next({
|
| 11814 |
+
opacity: 0
|
| 11815 |
+
});
|
| 11816 |
+
|
| 11817 |
+
case 2:
|
| 11818 |
+
_context2.next = 4;
|
| 11819 |
+
return next({
|
| 11820 |
+
height: 0
|
| 11821 |
+
});
|
| 11822 |
+
|
| 11823 |
+
case 4:
|
| 11824 |
+
case "end":
|
| 11825 |
+
return _context2.stop();
|
| 11826 |
+
}
|
| 11827 |
+
}
|
| 11828 |
+
}, _callee2);
|
| 11829 |
+
}));
|
| 11830 |
+
|
| 11831 |
+
return function (_x2) {
|
| 11832 |
+
return _ref3.apply(this, arguments);
|
| 11833 |
+
};
|
| 11834 |
+
}();
|
| 11835 |
+
},
|
| 11836 |
+
immediate: isReducedMotion
|
| 11837 |
+
});
|
| 11838 |
+
className = classnames_default()('components-snackbar-list', className);
|
| 11839 |
+
|
| 11840 |
+
var removeNotice = function removeNotice(notice) {
|
| 11841 |
+
return function () {
|
| 11842 |
+
return onRemove(notice.id);
|
| 11843 |
+
};
|
| 11844 |
+
};
|
| 11845 |
+
|
| 11846 |
+
return Object(external_this_wp_element_["createElement"])("div", {
|
| 11847 |
+
className: className
|
| 11848 |
+
}, children, transitions.map(function (_ref4) {
|
| 11849 |
+
var notice = _ref4.item,
|
| 11850 |
+
key = _ref4.key,
|
| 11851 |
+
style = _ref4.props;
|
| 11852 |
+
return Object(external_this_wp_element_["createElement"])(web_cjs["animated"].div, {
|
| 11853 |
+
key: key,
|
| 11854 |
+
style: style
|
| 11855 |
+
}, Object(external_this_wp_element_["createElement"])("div", {
|
| 11856 |
+
className: "components-snackbar-list__notice-container",
|
| 11857 |
+
ref: function ref(_ref5) {
|
| 11858 |
+
return _ref5 && refMap.set(notice, _ref5);
|
| 11859 |
+
}
|
| 11860 |
+
}, Object(external_this_wp_element_["createElement"])(snackbar["a" /* default */], Object(esm_extends["a" /* default */])({}, Object(external_lodash_["omit"])(notice, ['content']), {
|
| 11861 |
+
onRemove: removeNotice(notice)
|
| 11862 |
+
}), notice.content)));
|
| 11863 |
+
}));
|
| 11864 |
+
}
|
| 11865 |
+
|
| 11866 |
+
/* harmony default export */ var list = (SnackbarList);
|
| 11867 |
+
//# sourceMappingURL=list.js.map
|
| 11868 |
+
// EXTERNAL MODULE: ./client/layout/transient-notices/style.scss
|
| 11869 |
+
var transient_notices_style = __webpack_require__(572);
|
| 11870 |
+
|
| 11871 |
+
// CONCATENATED MODULE: ./client/layout/transient-notices/index.js
|
| 11872 |
+
|
| 11873 |
+
|
| 11874 |
+
|
| 11875 |
+
|
| 11876 |
+
|
| 11877 |
+
|
| 11878 |
+
|
| 11879 |
+
function transient_notices_createSuper(Derived) { var hasNativeReflectConstruct = transient_notices_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = getPrototypeOf_default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = getPrototypeOf_default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return possibleConstructorReturn_default()(this, result); }; }
|
| 11880 |
+
|
| 11881 |
+
function transient_notices_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
| 11882 |
+
|
| 11883 |
+
/**
|
| 11884 |
+
* External dependencies
|
| 11885 |
+
*/
|
| 11886 |
+
|
| 11887 |
+
|
| 11888 |
+
|
| 11889 |
+
|
| 11890 |
+
|
| 11891 |
+
|
| 11892 |
+
/**
|
| 11893 |
+
* Internal dependencies
|
| 11894 |
+
*/
|
| 11895 |
+
|
| 11896 |
+
|
| 11897 |
+
|
| 11898 |
+
var transient_notices_TransientNotices = /*#__PURE__*/function (_Component) {
|
| 11899 |
+
inherits_default()(TransientNotices, _Component);
|
| 11900 |
+
|
| 11901 |
+
var _super = transient_notices_createSuper(TransientNotices);
|
| 11902 |
+
|
| 11903 |
+
function TransientNotices() {
|
| 11904 |
+
classCallCheck_default()(this, TransientNotices);
|
| 11905 |
+
|
| 11906 |
+
return _super.apply(this, arguments);
|
| 11907 |
+
}
|
| 11908 |
+
|
| 11909 |
+
createClass_default()(TransientNotices, [{
|
| 11910 |
+
key: "render",
|
| 11911 |
+
value: function render() {
|
| 11912 |
+
var _this$props = this.props,
|
| 11913 |
+
className = _this$props.className,
|
| 11914 |
+
notices = _this$props.notices,
|
| 11915 |
+
onRemove = _this$props.onRemove;
|
| 11916 |
+
var classes = classnames_default()('woocommerce-transient-notices', 'components-notices__snackbar', className);
|
| 11917 |
+
return Object(external_this_wp_element_["createElement"])(list, {
|
| 11918 |
+
notices: notices,
|
| 11919 |
+
className: classes,
|
| 11920 |
+
onRemove: onRemove
|
| 11921 |
+
});
|
| 11922 |
+
}
|
| 11923 |
+
}]);
|
| 11924 |
+
|
| 11925 |
+
return TransientNotices;
|
| 11926 |
+
}(external_this_wp_element_["Component"]);
|
| 11927 |
+
|
| 11928 |
+
transient_notices_TransientNotices.propTypes = {
|
| 11929 |
+
/**
|
| 11930 |
+
* Additional class name to style the component.
|
| 11931 |
+
*/
|
| 11932 |
+
className: prop_types_default.a.string,
|
| 11933 |
+
|
| 11934 |
+
/**
|
| 11935 |
+
* Array of notices to be displayed.
|
| 11936 |
+
*/
|
| 11937 |
+
notices: prop_types_default.a.array
|
| 11938 |
+
};
|
| 11939 |
+
/* harmony default export */ var transient_notices = (Object(compose["a" /* default */])(Object(external_this_wp_data_["withSelect"])(function (select) {
|
| 11940 |
+
var notices = select('core/notices').getNotices();
|
| 11941 |
+
return {
|
| 11942 |
+
notices: notices
|
| 11943 |
+
};
|
| 11944 |
+
}), Object(external_this_wp_data_["withDispatch"])(function (dispatch) {
|
| 11945 |
+
return {
|
| 11946 |
+
onRemove: dispatch('core/notices').removeNotice
|
| 11947 |
+
};
|
| 11948 |
+
}))(transient_notices_TransientNotices));
|
| 11949 |
+
// EXTERNAL MODULE: external {"this":["wp","plugins"]}
|
| 11950 |
+
var external_this_wp_plugins_ = __webpack_require__(296);
|
| 11951 |
+
|
| 11952 |
+
// CONCATENATED MODULE: ./client/layout/navigation.js
|
| 11953 |
+
|
| 11954 |
+
|
| 11955 |
+
|
| 11956 |
+
function navigation_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
| 11957 |
+
|
| 11958 |
+
function navigation_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { navigation_ownKeys(Object(source), true).forEach(function (key) { defineProperty_default()(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { navigation_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
| 11959 |
+
|
| 11960 |
+
/**
|
| 11961 |
+
* External dependencies
|
| 11962 |
+
*/
|
| 11963 |
+
|
| 11964 |
+
|
| 11965 |
+
|
| 11966 |
+
|
| 11967 |
+
/**
|
| 11968 |
+
* Internal dependencies
|
| 11969 |
+
*/
|
| 11970 |
+
|
| 11971 |
+
|
| 11972 |
+
|
| 11973 |
+
|
| 11974 |
+
|
| 11975 |
+
var navigation_NavigationPlugin = function NavigationPlugin() {
|
| 11976 |
+
/**
|
| 11977 |
+
* If the current page is embedded, stay with the default urls
|
| 11978 |
+
* provided by Navigation because the router isn't present to
|
| 11979 |
+
* respond to <Link /> component's manipulation of the url.
|
| 11980 |
+
*/
|
| 11981 |
+
if (!Object(utils["f" /* isWCAdmin */])(window.location.href)) {
|
| 11982 |
+
return null;
|
| 11983 |
+
}
|
| 11984 |
+
|
| 11985 |
+
var reports = Object(get_reports["a" /* default */])();
|
| 11986 |
+
var pages = controller_getPages().filter(function (page) {
|
| 11987 |
+
return page.id;
|
| 11988 |
+
}).map(function (page) {
|
| 11989 |
+
if (page.id === 'woocommerce-analytics-settings') {
|
| 11990 |
+
return navigation_objectSpread(navigation_objectSpread({}, page), {}, {
|
| 11991 |
+
breadcrumbs: [Object(external_this_wp_i18n_["__"])('Analytics', 'woocommerce-admin')]
|
| 11992 |
+
});
|
| 11993 |
+
}
|
| 11994 |
+
|
| 11995 |
+
return page;
|
| 11996 |
+
});
|
| 11997 |
+
var persistedQuery = Object(external_this_wc_navigation_["getPersistedQuery"])({});
|
| 11998 |
+
return Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, pages.map(function (page) {
|
| 11999 |
+
return Object(external_this_wp_element_["createElement"])(external_this_wc_navigation_["WooNavigationItem"], {
|
| 12000 |
+
item: page.id,
|
| 12001 |
+
key: page.id
|
| 12002 |
+
}, Object(external_this_wp_element_["createElement"])(external_this_wc_components_["Link"], {
|
| 12003 |
+
className: "components-button",
|
| 12004 |
+
href: Object(external_this_wc_navigation_["getNewPath"])(persistedQuery, page.path, {}),
|
| 12005 |
+
type: "wc-admin"
|
| 12006 |
+
}, page.breadcrumbs[page.breadcrumbs.length - 1]));
|
| 12007 |
+
}), reports.map(function (item) {
|
| 12008 |
+
return Object(external_this_wp_element_["createElement"])(external_this_wc_navigation_["WooNavigationItem"], {
|
| 12009 |
+
item: item.id,
|
| 12010 |
+
key: item.report
|
| 12011 |
+
}, Object(external_this_wp_element_["createElement"])(external_this_wc_components_["Link"], {
|
| 12012 |
+
className: "components-button",
|
| 12013 |
+
href: Object(external_this_wc_navigation_["getNewPath"])(persistedQuery, "/analytics/".concat(item.report), {}),
|
| 12014 |
+
type: "wc-admin"
|
| 12015 |
+
}, item.title));
|
| 12016 |
+
}));
|
| 12017 |
+
};
|
| 12018 |
+
|
| 12019 |
+
Object(external_this_wp_plugins_["registerPlugin"])('wc-admin-navigation', {
|
| 12020 |
+
render: navigation_NavigationPlugin
|
| 12021 |
+
});
|
| 12022 |
+
// CONCATENATED MODULE: ./client/layout/index.js
|
| 12023 |
+
|
| 12024 |
+
|
| 12025 |
+
|
| 12026 |
+
|
| 12027 |
+
|
| 12028 |
+
|
| 12029 |
+
|
| 12030 |
+
|
| 12031 |
+
|
| 12032 |
+
|
| 12033 |
+
function layout_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
| 12034 |
+
|
| 12035 |
+
function layout_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { layout_ownKeys(Object(source), true).forEach(function (key) { defineProperty_default()(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { layout_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
| 12036 |
+
|
| 12037 |
+
function layout_createSuper(Derived) { var hasNativeReflectConstruct = layout_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = getPrototypeOf_default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = getPrototypeOf_default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return possibleConstructorReturn_default()(this, result); }; }
|
| 12038 |
+
|
| 12039 |
+
function layout_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
| 12040 |
+
|
| 12041 |
+
/**
|
| 12042 |
+
* External dependencies
|
| 12043 |
+
*/
|
| 12044 |
+
|
| 12045 |
+
|
| 12046 |
+
|
| 12047 |
+
|
| 12048 |
+
|
| 12049 |
+
|
| 12050 |
+
|
| 12051 |
+
|
| 12052 |
+
|
| 12053 |
+
|
| 12054 |
+
|
| 12055 |
+
|
| 12056 |
+
/**
|
| 12057 |
+
* Internal dependencies
|
| 12058 |
+
*/
|
| 12059 |
+
|
| 12060 |
+
|
| 12061 |
+
|
| 12062 |
+
|
| 12063 |
+
|
| 12064 |
+
|
| 12065 |
+
|
| 12066 |
+
var StoreAlerts = Object(external_this_wp_element_["lazy"])(function () {
|
| 12067 |
+
return Promise.all(/* import() | store-alerts */[__webpack_require__.e(3), __webpack_require__.e(4), __webpack_require__.e(48)]).then(__webpack_require__.bind(null, 853));
|
| 12068 |
+
});
|
| 12069 |
+
var layout_PrimaryLayout = /*#__PURE__*/function (_Component) {
|
| 12070 |
+
inherits_default()(PrimaryLayout, _Component);
|
| 12071 |
+
|
| 12072 |
+
var _super = layout_createSuper(PrimaryLayout);
|
| 12073 |
+
|
| 12074 |
+
function PrimaryLayout() {
|
| 12075 |
+
classCallCheck_default()(this, PrimaryLayout);
|
| 12076 |
+
|
| 12077 |
+
return _super.apply(this, arguments);
|
| 12078 |
+
}
|
| 12079 |
+
|
| 12080 |
+
createClass_default()(PrimaryLayout, [{
|
| 12081 |
+
key: "render",
|
| 12082 |
+
value: function render() {
|
| 12083 |
+
var children = this.props.children;
|
| 12084 |
+
return Object(external_this_wp_element_["createElement"])("div", {
|
| 12085 |
+
className: "woocommerce-layout__primary",
|
| 12086 |
+
id: "woocommerce-layout__primary"
|
| 12087 |
+
}, window.wcAdminFeatures['store-alerts'] && Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Suspense"], {
|
| 12088 |
+
fallback: Object(external_this_wp_element_["createElement"])(external_this_wc_components_["Spinner"], null)
|
| 12089 |
+
}, Object(external_this_wp_element_["createElement"])(StoreAlerts, null)), Object(external_this_wp_element_["createElement"])(layout_notices, null), children);
|
| 12090 |
+
}
|
| 12091 |
+
}]);
|
| 12092 |
+
|
| 12093 |
+
return PrimaryLayout;
|
| 12094 |
+
}(external_this_wp_element_["Component"]);
|
| 12095 |
+
|
| 12096 |
+
var layout_Layout = /*#__PURE__*/function (_Component2) {
|
| 12097 |
+
inherits_default()(_Layout, _Component2);
|
| 12098 |
+
|
| 12099 |
+
var _super2 = layout_createSuper(_Layout);
|
| 12100 |
+
|
| 12101 |
+
function _Layout() {
|
| 12102 |
+
classCallCheck_default()(this, _Layout);
|
| 12103 |
+
|
| 12104 |
+
return _super2.apply(this, arguments);
|
| 12105 |
+
}
|
| 12106 |
+
|
| 12107 |
+
createClass_default()(_Layout, [{
|
| 12108 |
+
key: "componentDidMount",
|
| 12109 |
+
value: function componentDidMount() {
|
| 12110 |
+
this.recordPageViewTrack();
|
| 12111 |
+
}
|
| 12112 |
+
}, {
|
| 12113 |
+
key: "componentDidUpdate",
|
| 12114 |
+
value: function componentDidUpdate(prevProps) {
|
| 12115 |
+
var previousPath = Object(external_lodash_["get"])(prevProps, 'location.pathname');
|
| 12116 |
+
var currentPath = Object(external_lodash_["get"])(this.props, 'location.pathname');
|
| 12117 |
+
|
| 12118 |
+
if (!previousPath || !currentPath) {
|
| 12119 |
+
return;
|
| 12120 |
+
}
|
| 12121 |
+
|
| 12122 |
+
if (previousPath !== currentPath) {
|
| 12123 |
+
this.recordPageViewTrack();
|
| 12124 |
+
}
|
| 12125 |
+
}
|
| 12126 |
+
}, {
|
| 12127 |
+
key: "recordPageViewTrack",
|
| 12128 |
+
value: function recordPageViewTrack() {
|
| 12129 |
+
var _this$props = this.props,
|
| 12130 |
+
activePlugins = _this$props.activePlugins,
|
| 12131 |
+
installedPlugins = _this$props.installedPlugins,
|
| 12132 |
+
isEmbedded = _this$props.isEmbedded,
|
| 12133 |
+
isJetpackConnected = _this$props.isJetpackConnected;
|
| 12134 |
+
var navigationFlag = {
|
| 12135 |
+
has_navigation: !!window.wcNavigation
|
| 12136 |
+
};
|
| 12137 |
+
|
| 12138 |
+
if (isEmbedded) {
|
| 12139 |
+
var _path = document.location.pathname + document.location.search;
|
| 12140 |
+
|
| 12141 |
+
Object(external_this_wc_tracks_["recordPageView"])(_path, layout_objectSpread({
|
| 12142 |
+
is_embedded: true
|
| 12143 |
+
}, navigationFlag));
|
| 12144 |
+
return;
|
| 12145 |
+
}
|
| 12146 |
+
|
| 12147 |
+
var pathname = Object(external_lodash_["get"])(this.props, 'location.pathname');
|
| 12148 |
+
|
| 12149 |
+
if (!pathname) {
|
| 12150 |
+
return;
|
| 12151 |
+
} // Remove leading slash, and camel case remaining pathname
|
| 12152 |
+
|
| 12153 |
+
|
| 12154 |
+
var path = pathname.substring(1).replace(/\//g, '_'); // When pathname is `/` we are on the home screen.
|
| 12155 |
+
|
| 12156 |
+
if (path.length === 0) {
|
| 12157 |
+
path = 'home_screen';
|
| 12158 |
+
}
|
| 12159 |
+
|
| 12160 |
+
Object(external_this_wc_tracks_["recordPageView"])(path, layout_objectSpread({
|
| 12161 |
+
jetpack_installed: installedPlugins.includes('jetpack'),
|
| 12162 |
+
jetpack_active: activePlugins.includes('jetpack'),
|
| 12163 |
+
jetpack_connected: isJetpackConnected
|
| 12164 |
+
}, navigationFlag));
|
| 12165 |
+
}
|
| 12166 |
+
}, {
|
| 12167 |
+
key: "getQuery",
|
| 12168 |
+
value: function getQuery(searchString) {
|
| 12169 |
+
if (!searchString) {
|
| 12170 |
+
return {};
|
| 12171 |
+
}
|
| 12172 |
+
|
| 12173 |
+
var search = searchString.substring(1);
|
| 12174 |
+
return Object(lib["parse"])(search);
|
| 12175 |
+
}
|
| 12176 |
+
}, {
|
| 12177 |
+
key: "render",
|
| 12178 |
+
value: function render() {
|
| 12179 |
+
var _this$props2 = this.props,
|
| 12180 |
+
isEmbedded = _this$props2.isEmbedded,
|
| 12181 |
+
restProps = objectWithoutProperties_default()(_this$props2, ["isEmbedded"]);
|
| 12182 |
+
|
| 12183 |
+
var _this$props3 = this.props,
|
| 12184 |
+
location = _this$props3.location,
|
| 12185 |
+
page = _this$props3.page;
|
| 12186 |
+
var breadcrumbs = page.breadcrumbs;
|
| 12187 |
+
var query = this.getQuery(location && location.search);
|
| 12188 |
+
return Object(external_this_wp_element_["createElement"])("div", {
|
| 12189 |
+
className: "woocommerce-layout"
|
| 12190 |
+
}, Object(external_this_wp_element_["createElement"])(header_Header, {
|
| 12191 |
+
sections: Object(external_lodash_["isFunction"])(breadcrumbs) ? breadcrumbs(this.props) : breadcrumbs,
|
| 12192 |
+
isEmbedded: isEmbedded,
|
| 12193 |
+
query: query
|
| 12194 |
+
}), Object(external_this_wp_element_["createElement"])(transient_notices, null), !isEmbedded && Object(external_this_wp_element_["createElement"])(layout_PrimaryLayout, null, Object(external_this_wp_element_["createElement"])("div", {
|
| 12195 |
+
className: "woocommerce-layout__main"
|
| 12196 |
+
}, Object(external_this_wp_element_["createElement"])(controller_Controller, extends_default()({}, restProps, {
|
| 12197 |
+
query: query
|
| 12198 |
+
})))));
|
| 12199 |
+
}
|
| 12200 |
+
}]);
|
| 12201 |
+
|
| 12202 |
+
return _Layout;
|
| 12203 |
+
}(external_this_wp_element_["Component"]);
|
| 12204 |
+
|
| 12205 |
+
layout_Layout.propTypes = {
|
| 12206 |
+
isEmbedded: prop_types_default.a.bool,
|
| 12207 |
+
page: prop_types_default.a.shape({
|
| 12208 |
+
container: prop_types_default.a.oneOfType([prop_types_default.a.func, prop_types_default.a.object // Support React.lazy
|
| 12209 |
+
]),
|
| 12210 |
+
path: prop_types_default.a.string,
|
| 12211 |
+
breadcrumbs: prop_types_default.a.oneOfType([prop_types_default.a.func, prop_types_default.a.arrayOf(prop_types_default.a.oneOfType([prop_types_default.a.arrayOf(prop_types_default.a.string), prop_types_default.a.string]))]).isRequired,
|
| 12212 |
+
wpOpenMenu: prop_types_default.a.string
|
| 12213 |
+
}).isRequired
|
| 12214 |
+
};
|
| 12215 |
+
var Layout = Object(compose["a" /* default */])(Object(external_this_wc_data_["withPluginsHydration"])(layout_objectSpread(layout_objectSpread({}, window.wcSettings.plugins || {}), {}, {
|
| 12216 |
+
jetpackStatus: window.wcSettings.dataEndpoints && window.wcSettings.dataEndpoints.jetpackStatus || false
|
| 12217 |
+
})), Object(external_this_wp_data_["withSelect"])(function (select, _ref) {
|
| 12218 |
+
var isEmbedded = _ref.isEmbedded;
|
| 12219 |
+
|
| 12220 |
+
// Embedded pages don't send plugin info to Tracks.
|
| 12221 |
+
if (isEmbedded) {
|
| 12222 |
+
return;
|
| 12223 |
+
}
|
| 12224 |
+
|
| 12225 |
+
var _select = select(external_this_wc_data_["PLUGINS_STORE_NAME"]),
|
| 12226 |
+
getActivePlugins = _select.getActivePlugins,
|
| 12227 |
+
getInstalledPlugins = _select.getInstalledPlugins,
|
| 12228 |
+
isJetpackConnected = _select.isJetpackConnected;
|
| 12229 |
+
|
| 12230 |
+
return {
|
| 12231 |
+
activePlugins: getActivePlugins(),
|
| 12232 |
+
isJetpackConnected: isJetpackConnected(),
|
| 12233 |
+
installedPlugins: getInstalledPlugins()
|
| 12234 |
+
};
|
| 12235 |
+
}))(layout_Layout);
|
| 12236 |
+
|
| 12237 |
+
var layout_PageLayout = /*#__PURE__*/function (_Component3) {
|
| 12238 |
+
inherits_default()(_PageLayout, _Component3);
|
| 12239 |
+
|
| 12240 |
+
var _super3 = layout_createSuper(_PageLayout);
|
| 12241 |
+
|
| 12242 |
+
function _PageLayout() {
|
| 12243 |
+
classCallCheck_default()(this, _PageLayout);
|
| 12244 |
+
|
| 12245 |
+
return _super3.apply(this, arguments);
|
| 12246 |
+
}
|
| 12247 |
+
|
| 12248 |
+
createClass_default()(_PageLayout, [{
|
| 12249 |
+
key: "render",
|
| 12250 |
+
value: function render() {
|
| 12251 |
+
return Object(external_this_wp_element_["createElement"])(react_router_Router, {
|
| 12252 |
+
history: Object(external_this_wc_navigation_["getHistory"])()
|
| 12253 |
+
}, Object(external_this_wp_element_["createElement"])(react_router_Switch, null, controller_getPages().map(function (page) {
|
| 12254 |
+
return Object(external_this_wp_element_["createElement"])(react_router_Route, {
|
| 12255 |
+
key: page.path,
|
| 12256 |
+
path: page.path,
|
| 12257 |
+
exact: true,
|
| 12258 |
+
render: function render(props) {
|
| 12259 |
+
return Object(external_this_wp_element_["createElement"])(Layout, extends_default()({
|
| 12260 |
+
page: page
|
| 12261 |
+
}, props));
|
| 12262 |
+
}
|
| 12263 |
+
});
|
| 12264 |
+
})));
|
| 12265 |
+
}
|
| 12266 |
+
}]);
|
| 12267 |
+
|
| 12268 |
+
return _PageLayout;
|
| 12269 |
+
}(external_this_wp_element_["Component"]);
|
| 12270 |
+
|
| 12271 |
+
var PageLayout = Object(compose["a" /* default */])(window.wcSettings.preloadOptions ? Object(external_this_wc_data_["withOptionsHydration"])(layout_objectSpread({}, window.wcSettings.preloadOptions)) : external_lodash_["identity"])(layout_PageLayout);
|
| 12272 |
+
|
| 12273 |
+
var layout_EmbedLayout = function _EmbedLayout() {
|
| 12274 |
+
return Object(external_this_wp_element_["createElement"])(Layout, {
|
| 12275 |
+
page: {
|
| 12276 |
+
breadcrumbs: Object(settings["g" /* getSetting */])('embedBreadcrumbs', [])
|
| 12277 |
+
},
|
| 12278 |
+
isEmbedded: true
|
| 12279 |
+
});
|
| 12280 |
+
};
|
| 12281 |
+
|
| 12282 |
+
var EmbedLayout = Object(compose["a" /* default */])(window.wcSettings.preloadOptions ? Object(external_this_wc_data_["withOptionsHydration"])(layout_objectSpread({}, window.wcSettings.preloadOptions)) : external_lodash_["identity"])(layout_EmbedLayout);
|
| 12283 |
+
|
| 12284 |
+
/***/ }),
|
| 12285 |
+
|
| 12286 |
+
/***/ 298:
|
| 12287 |
+
/***/ (function(module, exports) {
|
| 12288 |
+
|
| 12289 |
+
(function() { module.exports = this["wc"]["number"]; }());
|
| 12290 |
+
|
| 12291 |
+
/***/ }),
|
| 12292 |
+
|
| 12293 |
+
/***/ 3:
|
| 12294 |
+
/***/ (function(module, exports) {
|
| 12295 |
+
|
| 12296 |
+
(function() { module.exports = this["wp"]["i18n"]; }());
|
| 12297 |
+
|
| 12298 |
+
/***/ }),
|
| 12299 |
+
|
| 12300 |
+
/***/ 30:
|
| 12301 |
+
/***/ (function(module, exports, __webpack_require__) {
|
| 12302 |
+
|
| 12303 |
+
var arrayWithoutHoles = __webpack_require__(140);
|
| 12304 |
+
|
| 12305 |
+
var iterableToArray = __webpack_require__(141);
|
| 12306 |
+
|
| 12307 |
+
var unsupportedIterableToArray = __webpack_require__(83);
|
| 12308 |
+
|
| 12309 |
+
var nonIterableSpread = __webpack_require__(142);
|
| 12310 |
+
|
| 12311 |
+
function _toConsumableArray(arr) {
|
| 12312 |
+
return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();
|
| 12313 |
+
}
|
| 12314 |
+
|
| 12315 |
+
module.exports = _toConsumableArray;
|
| 12316 |
+
|
| 12317 |
+
/***/ }),
|
| 12318 |
+
|
| 12319 |
+
/***/ 300:
|
| 12320 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
| 12321 |
+
|
| 12322 |
+
"use strict";
|
| 12323 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return useInstanceId; });
|
| 12324 |
+
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
|
| 12325 |
+
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
|
| 12326 |
+
/**
|
| 12327 |
+
* WordPress dependencies
|
| 12328 |
+
*/
|
| 12329 |
+
|
| 12330 |
+
var instanceMap = new WeakMap();
|
| 12331 |
+
/**
|
| 12332 |
+
* Creates a new id for a given object.
|
| 12333 |
+
*
|
| 12334 |
+
* @param {Object} object Object reference to create an id for.
|
| 12335 |
+
*/
|
| 12336 |
+
|
| 12337 |
+
function createId(object) {
|
| 12338 |
+
var instances = instanceMap.get(object) || 0;
|
| 12339 |
+
instanceMap.set(object, instances + 1);
|
| 12340 |
+
return instances;
|
| 12341 |
+
}
|
| 12342 |
+
/**
|
| 12343 |
+
* Provides a unique instance ID.
|
| 12344 |
+
*
|
| 12345 |
+
* @param {Object} object Object reference to create an id for.
|
| 12346 |
+
* @param {string} prefix Prefix for the unique id.
|
| 12347 |
+
*/
|
| 12348 |
+
|
| 12349 |
+
|
| 12350 |
+
function useInstanceId(object, prefix) {
|
| 12351 |
+
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["useMemo"])(function () {
|
| 12352 |
+
var id = createId(object);
|
| 12353 |
+
return prefix ? "".concat(prefix, "-").concat(id) : id;
|
| 12354 |
+
}, [object]);
|
| 12355 |
+
}
|
| 12356 |
+
//# sourceMappingURL=index.js.map
|
| 12357 |
+
|
| 12358 |
+
/***/ }),
|
| 12359 |
+
|
| 12360 |
+
/***/ 306:
|
| 12361 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
| 12362 |
+
|
| 12363 |
+
"use strict";
|
| 12364 |
+
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
|
| 12365 |
+
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
|
| 12366 |
+
/* harmony import */ var _use_media_query__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(112);
|
| 12367 |
+
/**
|
| 12368 |
+
* WordPress dependencies
|
| 12369 |
+
*/
|
| 12370 |
+
|
| 12371 |
+
/**
|
| 12372 |
+
* Internal dependencies
|
| 12373 |
+
*/
|
| 12374 |
+
|
| 12375 |
+
|
| 12376 |
+
/**
|
| 12377 |
+
* @typedef {"huge"|"wide"|"large"|"medium"|"small"|"mobile"} WPBreakpoint
|
| 12378 |
+
*/
|
| 12379 |
+
|
| 12380 |
+
/**
|
| 12381 |
+
* Hash of breakpoint names with pixel width at which it becomes effective.
|
| 12382 |
+
*
|
| 12383 |
+
* @see _breakpoints.scss
|
| 12384 |
+
*
|
| 12385 |
+
* @type {Object<WPBreakpoint,number>}
|
| 12386 |
+
*/
|
| 12387 |
+
|
| 12388 |
+
var BREAKPOINTS = {
|
| 12389 |
+
huge: 1440,
|
| 12390 |
+
wide: 1280,
|
| 12391 |
+
large: 960,
|
| 12392 |
+
medium: 782,
|
| 12393 |
+
small: 600,
|
| 12394 |
+
mobile: 480
|
| 12395 |
+
};
|
| 12396 |
+
/**
|
| 12397 |
+
* @typedef {">="|"<"} WPViewportOperator
|
| 12398 |
+
*/
|
| 12399 |
+
|
| 12400 |
+
/**
|
| 12401 |
+
* Object mapping media query operators to the condition to be used.
|
| 12402 |
+
*
|
| 12403 |
+
* @type {Object<WPViewportOperator,string>}
|
| 12404 |
+
*/
|
| 12405 |
+
|
| 12406 |
+
var CONDITIONS = {
|
| 12407 |
+
'>=': 'min-width',
|
| 12408 |
+
'<': 'max-width'
|
| 12409 |
+
};
|
| 12410 |
+
/**
|
| 12411 |
+
* Object mapping media query operators to a function that given a breakpointValue and a width evaluates if the operator matches the values.
|
| 12412 |
+
*
|
| 12413 |
+
* @type {Object<WPViewportOperator,Function>}
|
| 12414 |
+
*/
|
| 12415 |
+
|
| 12416 |
+
var OPERATOR_EVALUATORS = {
|
| 12417 |
+
'>=': function _(breakpointValue, width) {
|
| 12418 |
+
return width >= breakpointValue;
|
| 12419 |
+
},
|
| 12420 |
+
'<': function _(breakpointValue, width) {
|
| 12421 |
+
return width < breakpointValue;
|
| 12422 |
+
}
|
| 12423 |
+
};
|
| 12424 |
+
var ViewportMatchWidthContext = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createContext"])(null);
|
| 12425 |
+
/**
|
| 12426 |
+
* Returns true if the viewport matches the given query, or false otherwise.
|
| 12427 |
+
*
|
| 12428 |
+
* @param {WPBreakpoint} breakpoint Breakpoint size name.
|
| 12429 |
+
* @param {WPViewportOperator} [operator=">="] Viewport operator.
|
| 12430 |
+
*
|
| 12431 |
+
* @example
|
| 12432 |
+
*
|
| 12433 |
+
* ```js
|
| 12434 |
+
* useViewportMatch( 'huge', '<' );
|
| 12435 |
+
* useViewportMatch( 'medium' );
|
| 12436 |
+
* ```
|
| 12437 |
+
*
|
| 12438 |
+
* @return {boolean} Whether viewport matches query.
|
| 12439 |
+
*/
|
| 12440 |
+
|
| 12441 |
+
var useViewportMatch = function useViewportMatch(breakpoint) {
|
| 12442 |
+
var operator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '>=';
|
| 12443 |
+
var simulatedWidth = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["useContext"])(ViewportMatchWidthContext);
|
| 12444 |
+
var mediaQuery = !simulatedWidth && "(".concat(CONDITIONS[operator], ": ").concat(BREAKPOINTS[breakpoint], "px)");
|
| 12445 |
+
var mediaQueryResult = Object(_use_media_query__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(mediaQuery);
|
| 12446 |
+
|
| 12447 |
+
if (simulatedWidth) {
|
| 12448 |
+
return OPERATOR_EVALUATORS[operator](BREAKPOINTS[breakpoint], simulatedWidth);
|
| 12449 |
+
}
|
| 12450 |
+
|
| 12451 |
+
return mediaQueryResult;
|
| 12452 |
+
};
|
| 12453 |
+
|
| 12454 |
+
useViewportMatch.__experimentalWidthProvider = ViewportMatchWidthContext.Provider;
|
| 12455 |
+
/* harmony default export */ __webpack_exports__["a"] = (useViewportMatch);
|
| 12456 |
+
//# sourceMappingURL=index.js.map
|
| 12457 |
+
|
| 12458 |
+
/***/ }),
|
| 12459 |
+
|
| 12460 |
+
/***/ 307:
|
| 12461 |
+
/***/ (function(module, exports, __webpack_require__) {
|
| 12462 |
+
|
| 12463 |
+
"use strict";
|
| 12464 |
+
/** @license React v16.13.1
|
| 12465 |
+
* react-is.production.min.js
|
| 12466 |
+
*
|
| 12467 |
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
| 12468 |
+
*
|
| 12469 |
+
* This source code is licensed under the MIT license found in the
|
| 12470 |
+
* LICENSE file in the root directory of this source tree.
|
| 12471 |
+
*/
|
| 12472 |
+
|
| 12473 |
+
var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,q=b?
|
| 12474 |
+
Symbol.for("react.suspense_list"):60120,r=b?Symbol.for("react.memo"):60115,t=b?Symbol.for("react.lazy"):60116,v=b?Symbol.for("react.block"):60121,w=b?Symbol.for("react.fundamental"):60117,x=b?Symbol.for("react.responder"):60118,y=b?Symbol.for("react.scope"):60119;
|
| 12475 |
+
function z(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}exports.AsyncMode=l;exports.ConcurrentMode=m;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=n;exports.Fragment=e;exports.Lazy=t;exports.Memo=r;exports.Portal=d;
|
| 12476 |
+
exports.Profiler=g;exports.StrictMode=f;exports.Suspense=p;exports.isAsyncMode=function(a){return A(a)||z(a)===l};exports.isConcurrentMode=A;exports.isContextConsumer=function(a){return z(a)===k};exports.isContextProvider=function(a){return z(a)===h};exports.isElement=function(a){return"object"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return z(a)===n};exports.isFragment=function(a){return z(a)===e};exports.isLazy=function(a){return z(a)===t};
|
| 12477 |
+
exports.isMemo=function(a){return z(a)===r};exports.isPortal=function(a){return z(a)===d};exports.isProfiler=function(a){return z(a)===g};exports.isStrictMode=function(a){return z(a)===f};exports.isSuspense=function(a){return z(a)===p};
|
| 12478 |
+
exports.isValidElementType=function(a){return"string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||"object"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};exports.typeOf=z;
|
| 12479 |
+
|
| 12480 |
+
|
| 12481 |
+
/***/ }),
|
| 12482 |
+
|
| 12483 |
+
/***/ 31:
|
| 12484 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
| 12485 |
+
|
| 12486 |
+
"use strict";
|
| 12487 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return rgba; });
|
| 12488 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return color; });
|
| 12489 |
+
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
|
| 12490 |
+
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__);
|
| 12491 |
+
/* harmony import */ var tinycolor2__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(160);
|
| 12492 |
+
/* harmony import */ var tinycolor2__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(tinycolor2__WEBPACK_IMPORTED_MODULE_1__);
|
| 12493 |
+
/* harmony import */ var _colors_values__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(91);
|
| 12494 |
+
/**
|
| 12495 |
+
* External dependencies
|
| 12496 |
+
*/
|
| 12497 |
+
|
| 12498 |
+
|
| 12499 |
+
/**
|
| 12500 |
+
* Internal dependencies
|
| 12501 |
+
*/
|
| 12502 |
+
|
| 12503 |
+
|
| 12504 |
+
/**
|
| 12505 |
+
* Generating a CSS complient rgba() color value.
|
| 12506 |
+
*
|
| 12507 |
+
* @param {string} hexValue The hex value to convert to rgba().
|
| 12508 |
+
* @param {number} alpha The alpha value for opacity.
|
| 12509 |
+
* @return {string} The converted rgba() color value.
|
| 12510 |
+
*
|
| 12511 |
+
* @example
|
| 12512 |
+
* rgba( '#000000', 0.5 )
|
| 12513 |
+
* // rgba(0, 0, 0, 0.5)
|
| 12514 |
+
*/
|
| 12515 |
+
|
| 12516 |
+
function rgba() {
|
| 12517 |
+
var hexValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
| 12518 |
+
var alpha = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
| 12519 |
+
|
| 12520 |
+
var _tinycolor$toRgb = tinycolor2__WEBPACK_IMPORTED_MODULE_1___default()(hexValue).toRgb(),
|
| 12521 |
+
r = _tinycolor$toRgb.r,
|
| 12522 |
+
g = _tinycolor$toRgb.g,
|
| 12523 |
+
b = _tinycolor$toRgb.b;
|
| 12524 |
+
|
| 12525 |
+
return "rgba(".concat(r, ", ").concat(g, ", ").concat(b, ", ").concat(alpha, ")");
|
| 12526 |
+
}
|
| 12527 |
+
/**
|
| 12528 |
+
* Retrieves a color from the color palette.
|
| 12529 |
+
*
|
| 12530 |
+
* @param {string} value The value to retrieve.
|
| 12531 |
+
* @return {string} The color (or fallback, if not found).
|
| 12532 |
+
*
|
| 12533 |
+
* @example
|
| 12534 |
+
* color( 'blue.wordpress.700' )
|
| 12535 |
+
* // #00669b
|
| 12536 |
+
*/
|
| 12537 |
+
|
| 12538 |
+
function color(value) {
|
| 12539 |
+
var fallbackColor = '#000';
|
| 12540 |
+
return Object(lodash__WEBPACK_IMPORTED_MODULE_0__["get"])(_colors_values__WEBPACK_IMPORTED_MODULE_2__[/* COLORS */ "a"], value, fallbackColor);
|
| 12541 |
+
}
|
| 12542 |
+
//# sourceMappingURL=colors.js.map
|
| 12543 |
+
|
| 12544 |
+
/***/ }),
|
| 12545 |
+
|
| 12546 |
+
/***/ 32:
|
| 12547 |
+
/***/ (function(module, exports) {
|
| 12548 |
+
|
| 12549 |
+
(function() { module.exports = this["wc"]["navigation"]; }());
|
| 12550 |
+
|
| 12551 |
+
/***/ }),
|
| 12552 |
+
|
| 12553 |
+
/***/ 33:
|
| 12554 |
+
/***/ (function(module, exports) {
|
| 12555 |
+
|
| 12556 |
+
// shim for using process in browser
|
| 12557 |
+
var process = module.exports = {};
|
| 12558 |
+
|
| 12559 |
+
// cached from whatever global is present so that test runners that stub it
|
| 12560 |
+
// don't break things. But we need to wrap it in a try catch in case it is
|
| 12561 |
+
// wrapped in strict mode code which doesn't define any globals. It's inside a
|
| 12562 |
+
// function because try/catches deoptimize in certain engines.
|
| 12563 |
+
|
| 12564 |
+
var cachedSetTimeout;
|
| 12565 |
+
var cachedClearTimeout;
|
| 12566 |
+
|
| 12567 |
+
function defaultSetTimout() {
|
| 12568 |
+
throw new Error('setTimeout has not been defined');
|
| 12569 |
+
}
|
| 12570 |
+
function defaultClearTimeout () {
|
| 12571 |
+
throw new Error('clearTimeout has not been defined');
|
| 12572 |
+
}
|
| 12573 |
+
(function () {
|
| 12574 |
+
try {
|
| 12575 |
+
if (typeof setTimeout === 'function') {
|
| 12576 |
+
cachedSetTimeout = setTimeout;
|
| 12577 |
+
} else {
|
| 12578 |
+
cachedSetTimeout = defaultSetTimout;
|
| 12579 |
+
}
|
| 12580 |
+
} catch (e) {
|
| 12581 |
+
cachedSetTimeout = defaultSetTimout;
|
| 12582 |
+
}
|
| 12583 |
+
try {
|
| 12584 |
+
if (typeof clearTimeout === 'function') {
|
| 12585 |
+
cachedClearTimeout = clearTimeout;
|
| 12586 |
+
} else {
|
| 12587 |
+
cachedClearTimeout = defaultClearTimeout;
|
| 12588 |
+
}
|
| 12589 |
+
} catch (e) {
|
| 12590 |
+
cachedClearTimeout = defaultClearTimeout;
|
| 12591 |
+
}
|
| 12592 |
+
} ())
|
| 12593 |
+
function runTimeout(fun) {
|
| 12594 |
+
if (cachedSetTimeout === setTimeout) {
|
| 12595 |
+
//normal enviroments in sane situations
|
| 12596 |
+
return setTimeout(fun, 0);
|
| 12597 |
+
}
|
| 12598 |
+
// if setTimeout wasn't available but was latter defined
|
| 12599 |
+
if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
|
| 12600 |
+
cachedSetTimeout = setTimeout;
|
| 12601 |
+
return setTimeout(fun, 0);
|
| 12602 |
+
}
|
| 12603 |
+
try {
|
| 12604 |
+
// when when somebody has screwed with setTimeout but no I.E. maddness
|
| 12605 |
+
return cachedSetTimeout(fun, 0);
|
| 12606 |
+
} catch(e){
|
| 12607 |
+
try {
|
| 12608 |
+
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
|
| 12609 |
+
return cachedSetTimeout.call(null, fun, 0);
|
| 12610 |
+
} catch(e){
|
| 12611 |
+
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
|
| 12612 |
+
return cachedSetTimeout.call(this, fun, 0);
|
| 12613 |
+
}
|
| 12614 |
+
}
|
| 12615 |
+
|
| 12616 |
+
|
| 12617 |
+
}
|
| 12618 |
+
function runClearTimeout(marker) {
|
| 12619 |
+
if (cachedClearTimeout === clearTimeout) {
|
| 12620 |
+
//normal enviroments in sane situations
|
| 12621 |
+
return clearTimeout(marker);
|
| 12622 |
+
}
|
| 12623 |
+
// if clearTimeout wasn't available but was latter defined
|
| 12624 |
+
if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
|
| 12625 |
+
cachedClearTimeout = clearTimeout;
|
| 12626 |
+
return clearTimeout(marker);
|
| 12627 |
+
}
|
| 12628 |
+
try {
|
| 12629 |
+
// when when somebody has screwed with setTimeout but no I.E. maddness
|
| 12630 |
+
return cachedClearTimeout(marker);
|
| 12631 |
+
} catch (e){
|
| 12632 |
+
try {
|
| 12633 |
+
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
|
| 12634 |
+
return cachedClearTimeout.call(null, marker);
|
| 12635 |
+
} catch (e){
|
| 12636 |
+
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
|
| 12637 |
+
// Some versions of I.E. have different rules for clearTimeout vs setTimeout
|
| 12638 |
+
return cachedClearTimeout.call(this, marker);
|
| 12639 |
+
}
|
| 12640 |
+
}
|
| 12641 |
+
|
| 12642 |
+
|
| 12643 |
+
|
| 12644 |
+
}
|
| 12645 |
+
var queue = [];
|
| 12646 |
+
var draining = false;
|
| 12647 |
+
var currentQueue;
|
| 12648 |
+
var queueIndex = -1;
|
| 12649 |
+
|
| 12650 |
+
function cleanUpNextTick() {
|
| 12651 |
+
if (!draining || !currentQueue) {
|
| 12652 |
+
return;
|
| 12653 |
+
}
|
| 12654 |
+
draining = false;
|
| 12655 |
+
if (currentQueue.length) {
|
| 12656 |
+
queue = currentQueue.concat(queue);
|
| 12657 |
+
} else {
|
| 12658 |
+
queueIndex = -1;
|
| 12659 |
+
}
|
| 12660 |
+
if (queue.length) {
|
| 12661 |
+
drainQueue();
|
| 12662 |
+
}
|
| 12663 |
+
}
|
| 12664 |
+
|
| 12665 |
+
function drainQueue() {
|
| 12666 |
+
if (draining) {
|
| 12667 |
+
return;
|
| 12668 |
+
}
|
| 12669 |
+
var timeout = runTimeout(cleanUpNextTick);
|
| 12670 |
+
draining = true;
|
| 12671 |
+
|
| 12672 |
+
var len = queue.length;
|
| 12673 |
+
while(len) {
|
| 12674 |
+
currentQueue = queue;
|
| 12675 |
+
queue = [];
|
| 12676 |
+
while (++queueIndex < len) {
|
| 12677 |
+
if (currentQueue) {
|
| 12678 |
+
currentQueue[queueIndex].run();
|
| 12679 |
+
}
|
| 12680 |
+
}
|
| 12681 |
+
queueIndex = -1;
|
| 12682 |
+
len = queue.length;
|
| 12683 |
+
}
|
| 12684 |
+
currentQueue = null;
|
| 12685 |
+
draining = false;
|
| 12686 |
+
runClearTimeout(timeout);
|
| 12687 |
+
}
|
| 12688 |
+
|
| 12689 |
+
process.nextTick = function (fun) {
|
| 12690 |
+
var args = new Array(arguments.length - 1);
|
| 12691 |
+
if (arguments.length > 1) {
|
| 12692 |
+
for (var i = 1; i < arguments.length; i++) {
|
| 12693 |
+
args[i - 1] = arguments[i];
|
| 12694 |
+
}
|
| 12695 |
+
}
|
| 12696 |
+
queue.push(new Item(fun, args));
|
| 12697 |
+
if (queue.length === 1 && !draining) {
|
| 12698 |
+
runTimeout(drainQueue);
|
| 12699 |
+
}
|
| 12700 |
+
};
|
| 12701 |
+
|
| 12702 |
+
// v8 likes predictible objects
|
| 12703 |
+
function Item(fun, array) {
|
| 12704 |
+
this.fun = fun;
|
| 12705 |
+
this.array = array;
|
| 12706 |
+
}
|
| 12707 |
+
Item.prototype.run = function () {
|
| 12708 |
+
this.fun.apply(null, this.array);
|
| 12709 |
+
};
|
| 12710 |
+
process.title = 'browser';
|
| 12711 |
+
process.browser = true;
|
| 12712 |
+
process.env = {};
|
| 12713 |
+
process.argv = [];
|
| 12714 |
+
process.version = ''; // empty string to avoid regexp issues
|
| 12715 |
+
process.versions = {};
|
| 12716 |
+
|
| 12717 |
+
function noop() {}
|
| 12718 |
+
|
| 12719 |
+
process.on = noop;
|
| 12720 |
+
process.addListener = noop;
|
| 12721 |
+
process.once = noop;
|
| 12722 |
+
process.off = noop;
|
| 12723 |
+
process.removeListener = noop;
|
| 12724 |
+
process.removeAllListeners = noop;
|
| 12725 |
+
process.emit = noop;
|
| 12726 |
+
process.prependListener = noop;
|
| 12727 |
+
process.prependOnceListener = noop;
|
| 12728 |
+
|
| 12729 |
+
process.listeners = function (name) { return [] }
|
| 12730 |
+
|
| 12731 |
+
process.binding = function (name) {
|
| 12732 |
+
throw new Error('process.binding is not supported');
|
| 12733 |
+
};
|
| 12734 |
+
|
| 12735 |
+
process.cwd = function () { return '/' };
|
| 12736 |
+
process.chdir = function (dir) {
|
| 12737 |
+
throw new Error('process.chdir is not supported');
|
| 12738 |
+
};
|
| 12739 |
+
process.umask = function() { return 0; };
|
| 12740 |
+
|
| 12741 |
+
|
| 12742 |
+
/***/ }),
|
| 12743 |
+
|
| 12744 |
+
/***/ 34:
|
| 12745 |
+
/***/ (function(module, exports, __webpack_require__) {
|
| 12746 |
+
|
| 12747 |
+
var arrayWithHoles = __webpack_require__(116);
|
| 12748 |
+
|
| 12749 |
+
var iterableToArrayLimit = __webpack_require__(117);
|
| 12750 |
+
|
| 12751 |
+
var unsupportedIterableToArray = __webpack_require__(83);
|
| 12752 |
+
|
| 12753 |
+
var nonIterableRest = __webpack_require__(118);
|
| 12754 |
+
|
| 12755 |
+
function _slicedToArray(arr, i) {
|
| 12756 |
+
return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();
|
| 12757 |
+
}
|
| 12758 |
+
|
| 12759 |
+
module.exports = _slicedToArray;
|
| 12760 |
+
|
| 12761 |
+
/***/ }),
|
| 12762 |
+
|
| 12763 |
+
/***/ 35:
|
| 12764 |
+
/***/ (function(module, exports) {
|
| 12765 |
+
|
| 12766 |
+
(function() { module.exports = this["wc"]["data"]; }());
|
| 12767 |
+
|
| 12768 |
+
/***/ }),
|
| 12769 |
+
|
| 12770 |
+
/***/ 36:
|
| 12771 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
| 12772 |
+
|
| 12773 |
+
"use strict";
|
| 12774 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ADMIN_URL; });
|
| 12775 |
+
/* unused harmony export COUNTRIES */
|
| 12776 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return CURRENCY; });
|
| 12777 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return LOCALE; });
|
| 12778 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return ORDER_STATUSES; });
|
| 12779 |
+
/* unused harmony export SITE_TITLE */
|
| 12780 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return WC_ASSET_URL; });
|
| 12781 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return getSetting; });
|
| 12782 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return setSetting; });
|
| 12783 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return getAdminLink; });
|
| 12784 |
+
/* harmony import */ var _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(48);
|
| 12785 |
+
/* harmony import */ var _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__);
|
| 12786 |
+
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3);
|
| 12787 |
+
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
|
| 12788 |
+
|
| 12789 |
+
|
| 12790 |
+
/**
|
| 12791 |
+
* External dependencies
|
| 12792 |
+
*/
|
| 12793 |
+
// Remove mutable data from settings object to prevent access. Data stores should be used instead.
|
| 12794 |
+
|
| 12795 |
+
var mutableSources = ['wcAdminSettings', 'preloadSettings'];
|
| 12796 |
+
var settings = (typeof wcSettings === "undefined" ? "undefined" : _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default()(wcSettings)) === 'object' ? wcSettings : {};
|
| 12797 |
+
var SOURCE = Object.keys(settings).reduce(function (source, key) {
|
| 12798 |
+
if (!mutableSources.includes(key)) {
|
| 12799 |
+
source[key] = settings[key];
|
| 12800 |
+
}
|
| 12801 |
+
|
| 12802 |
+
return source;
|
| 12803 |
+
}, {});
|
| 12804 |
+
var ADMIN_URL = SOURCE.adminUrl;
|
| 12805 |
+
var COUNTRIES = SOURCE.countries;
|
| 12806 |
+
var CURRENCY = SOURCE.currency;
|
| 12807 |
+
var LOCALE = SOURCE.locale;
|
| 12808 |
+
var ORDER_STATUSES = SOURCE.orderStatuses;
|
| 12809 |
+
var SITE_TITLE = SOURCE.siteTitle;
|
| 12810 |
+
var WC_ASSET_URL = SOURCE.wcAssetUrl;
|
| 12811 |
+
/**
|
| 12812 |
+
* Retrieves a setting value from the setting state.
|
| 12813 |
+
*
|
| 12814 |
+
* @param {string} name The identifier for the setting.
|
| 12815 |
+
* @param {*} [fallback=false] The value to use as a fallback
|
| 12816 |
+
* if the setting is not in the
|
| 12817 |
+
* state.
|
| 12818 |
+
* @param {Function} [filter=( val ) => val] A callback for filtering the
|
| 12819 |
+
* value before it's returned.
|
| 12820 |
+
* Receives both the found value
|
| 12821 |
+
* (if it exists for the key) and
|
| 12822 |
+
* the provided fallback arg.
|
| 12823 |
+
*
|
| 12824 |
+
* @return {*} The value present in the settings state for the given
|
| 12825 |
+
* name.
|
| 12826 |
+
*/
|
| 12827 |
+
|
| 12828 |
+
function getSetting(name) {
|
| 12829 |
+
var fallback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
| 12830 |
+
var filter = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : function (val) {
|
| 12831 |
+
return val;
|
| 12832 |
+
};
|
| 12833 |
+
|
| 12834 |
+
if (mutableSources.includes(name)) {
|
| 12835 |
+
throw new Error(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__["__"])('Mutable settings should be accessed via data store.'));
|
| 12836 |
+
}
|
| 12837 |
+
|
| 12838 |
+
var value = SOURCE.hasOwnProperty(name) ? SOURCE[name] : fallback;
|
| 12839 |
+
return filter(value, fallback);
|
| 12840 |
+
}
|
| 12841 |
+
/**
|
| 12842 |
+
* Sets a value to a property on the settings state.
|
| 12843 |
+
*
|
| 12844 |
+
* NOTE: This feature is to be removed in favour of data stores when a full migration
|
| 12845 |
+
* is complete.
|
| 12846 |
+
*
|
| 12847 |
+
* @deprecated
|
| 12848 |
+
*
|
| 12849 |
+
* @param {string} name The setting property key for the
|
| 12850 |
+
* setting being mutated.
|
| 12851 |
+
* @param {*} value The value to set.
|
| 12852 |
+
* @param {Function} [filter=( val ) => val] Allows for providing a callback
|
| 12853 |
+
* to sanitize the setting (eg.
|
| 12854 |
+
* ensure it's a number)
|
| 12855 |
+
*/
|
| 12856 |
+
|
| 12857 |
+
function setSetting(name, value) {
|
| 12858 |
+
var filter = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : function (val) {
|
| 12859 |
+
return val;
|
| 12860 |
+
};
|
| 12861 |
+
|
| 12862 |
+
if (mutableSources.includes(name)) {
|
| 12863 |
+
throw new Error(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__["__"])('Mutable settings should be mutated via data store.'));
|
| 12864 |
+
}
|
| 12865 |
+
|
| 12866 |
+
SOURCE[name] = filter(value);
|
| 12867 |
+
}
|
| 12868 |
+
/**
|
| 12869 |
+
* Returns a string with the site's wp-admin URL appended. JS version of `admin_url`.
|
| 12870 |
+
*
|
| 12871 |
+
* @param {string} path Relative path.
|
| 12872 |
+
* @return {string} Full admin URL.
|
| 12873 |
+
*/
|
| 12874 |
+
|
| 12875 |
+
function getAdminLink(path) {
|
| 12876 |
+
return (ADMIN_URL || '') + path;
|
| 12877 |
+
}
|
| 12878 |
+
|
| 12879 |
+
/***/ }),
|
| 12880 |
+
|
| 12881 |
+
/***/ 37:
|
| 12882 |
+
/***/ (function(module, exports) {
|
| 12883 |
+
|
| 12884 |
+
(function() { module.exports = this["wp"]["url"]; }());
|
| 12885 |
+
|
| 12886 |
+
/***/ }),
|
| 12887 |
+
|
| 12888 |
+
/***/ 38:
|
| 12889 |
+
/***/ (function(module, exports) {
|
| 12890 |
+
|
| 12891 |
+
function _extends() {
|
| 12892 |
+
module.exports = _extends = Object.assign || function (target) {
|
| 12893 |
+
for (var i = 1; i < arguments.length; i++) {
|
| 12894 |
+
var source = arguments[i];
|
| 12895 |
+
|
| 12896 |
+
for (var key in source) {
|
| 12897 |
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
| 12898 |
+
target[key] = source[key];
|
| 12899 |
+
}
|
| 12900 |
+
}
|
| 12901 |
+
}
|
| 12902 |
+
|
| 12903 |
+
return target;
|
| 12904 |
+
};
|
| 12905 |
+
|
| 12906 |
+
return _extends.apply(this, arguments);
|
| 12907 |
+
}
|
| 12908 |
+
|
| 12909 |
+
module.exports = _extends;
|
| 12910 |
+
|
| 12911 |
+
/***/ }),
|
| 12912 |
+
|
| 12913 |
+
/***/ 4:
|
| 12914 |
+
/***/ (function(module, exports, __webpack_require__) {
|
| 12915 |
+
|
| 12916 |
+
/*!
|
| 12917 |
+
Copyright (c) 2017 Jed Watson.
|
| 12918 |
+
Licensed under the MIT License (MIT), see
|
| 12919 |
+
http://jedwatson.github.io/classnames
|
| 12920 |
+
*/
|
| 12921 |
+
/* global define */
|
| 12922 |
+
|
| 12923 |
+
(function () {
|
| 12924 |
+
'use strict';
|
| 12925 |
+
|
| 12926 |
+
var hasOwn = {}.hasOwnProperty;
|
| 12927 |
+
|
| 12928 |
+
function classNames () {
|
| 12929 |
+
var classes = [];
|
| 12930 |
+
|
| 12931 |
+
for (var i = 0; i < arguments.length; i++) {
|
| 12932 |
+
var arg = arguments[i];
|
| 12933 |
+
if (!arg) continue;
|
| 12934 |
+
|
| 12935 |
+
var argType = typeof arg;
|
| 12936 |
+
|
| 12937 |
+
if (argType === 'string' || argType === 'number') {
|
| 12938 |
+
classes.push(arg);
|
| 12939 |
+
} else if (Array.isArray(arg) && arg.length) {
|
| 12940 |
+
var inner = classNames.apply(null, arg);
|
| 12941 |
+
if (inner) {
|
| 12942 |
+
classes.push(inner);
|
| 12943 |
+
}
|
| 12944 |
+
} else if (argType === 'object') {
|
| 12945 |
+
for (var key in arg) {
|
| 12946 |
+
if (hasOwn.call(arg, key) && arg[key]) {
|
| 12947 |
+
classes.push(key);
|
| 12948 |
+
}
|
| 12949 |
+
}
|
| 12950 |
+
}
|
| 12951 |
+
}
|
| 12952 |
+
|
| 12953 |
+
return classes.join(' ');
|
| 12954 |
+
}
|
| 12955 |
+
|
| 12956 |
+
if ( true && module.exports) {
|
| 12957 |
+
classNames.default = classNames;
|
| 12958 |
+
module.exports = classNames;
|
| 12959 |
+
} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {
|
| 12960 |
+
// register as 'classnames', consistent with npm package name
|
| 12961 |
+
define('classnames', [], function () {
|
| 12962 |
+
return classNames;
|
| 12963 |
+
});
|
| 12964 |
+
} else {
|
| 12965 |
+
window.classNames = classNames;
|
| 12966 |
+
}
|
| 12967 |
+
}());
|
| 12968 |
+
|
| 12969 |
+
|
| 12970 |
+
/***/ }),
|
| 12971 |
+
|
| 12972 |
+
/***/ 40:
|
| 12973 |
+
/***/ (function(module, exports) {
|
| 12974 |
+
|
| 12975 |
+
(function() { module.exports = this["wc"]["date"]; }());
|
| 12976 |
+
|
| 12977 |
+
/***/ }),
|
| 12978 |
+
|
| 12979 |
+
/***/ 41:
|
| 12980 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
| 12981 |
+
|
| 12982 |
+
"use strict";
|
| 12983 |
+
|
| 12984 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/defineProperty.js
|
| 12985 |
+
var defineProperty = __webpack_require__(5);
|
| 12986 |
+
var defineProperty_default = /*#__PURE__*/__webpack_require__.n(defineProperty);
|
| 12987 |
+
|
| 12988 |
+
// EXTERNAL MODULE: external "React"
|
| 12989 |
+
var external_React_ = __webpack_require__(6);
|
| 12990 |
+
|
| 12991 |
+
// EXTERNAL MODULE: ./node_modules/@emotion/memoize/dist/memoize.browser.esm.js
|
| 12992 |
+
var memoize_browser_esm = __webpack_require__(102);
|
| 12993 |
+
|
| 12994 |
+
// CONCATENATED MODULE: ./node_modules/@emotion/is-prop-valid/dist/is-prop-valid.browser.esm.js
|
| 12995 |
+
|
| 12996 |
+
|
| 12997 |
+
var reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23
|
| 12998 |
+
|
| 12999 |
+
var index = Object(memoize_browser_esm["a" /* default */])(function (prop) {
|
| 13000 |
+
return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111
|
| 13001 |
+
/* o */
|
| 13002 |
+
&& prop.charCodeAt(1) === 110
|
| 13003 |
+
/* n */
|
| 13004 |
+
&& prop.charCodeAt(2) < 91;
|
| 13005 |
+
}
|
| 13006 |
+
/* Z+1 */
|
| 13007 |
+
);
|
| 13008 |
+
|
| 13009 |
+
/* harmony default export */ var is_prop_valid_browser_esm = (index);
|
| 13010 |
+
|
| 13011 |
+
// EXTERNAL MODULE: ./node_modules/@emotion/core/dist/core.browser.esm.js + 6 modules
|
| 13012 |
+
var core_browser_esm = __webpack_require__(67);
|
| 13013 |
+
|
| 13014 |
+
// EXTERNAL MODULE: ./node_modules/@emotion/utils/dist/utils.browser.esm.js
|
| 13015 |
+
var utils_browser_esm = __webpack_require__(50);
|
| 13016 |
+
|
| 13017 |
+
// EXTERNAL MODULE: ./node_modules/@emotion/serialize/dist/serialize.browser.esm.js + 2 modules
|
| 13018 |
+
var serialize_browser_esm = __webpack_require__(49);
|
| 13019 |
+
|
| 13020 |
+
// CONCATENATED MODULE: ./node_modules/@emotion/styled-base/dist/styled-base.browser.esm.js
|
| 13021 |
+
|
| 13022 |
+
|
| 13023 |
+
|
| 13024 |
+
|
| 13025 |
+
|
| 13026 |
+
|
| 13027 |
+
|
| 13028 |
+
var testOmitPropsOnStringTag = is_prop_valid_browser_esm;
|
| 13029 |
+
|
| 13030 |
+
var testOmitPropsOnComponent = function testOmitPropsOnComponent(key) {
|
| 13031 |
+
return key !== 'theme' && key !== 'innerRef';
|
| 13032 |
+
};
|
| 13033 |
+
|
| 13034 |
+
var getDefaultShouldForwardProp = function getDefaultShouldForwardProp(tag) {
|
| 13035 |
+
return typeof tag === 'string' && // 96 is one less than the char code
|
| 13036 |
+
// for "a" so this is checking that
|
| 13037 |
+
// it's a lowercase character
|
| 13038 |
+
tag.charCodeAt(0) > 96 ? testOmitPropsOnStringTag : testOmitPropsOnComponent;
|
| 13039 |
+
};
|
| 13040 |
+
|
| 13041 |
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
| 13042 |
+
|
| 13043 |
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { defineProperty_default()(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
| 13044 |
+
var ILLEGAL_ESCAPE_SEQUENCE_ERROR = "You have illegal escape sequence in your template literal, most likely inside content's property value.\nBecause you write your CSS inside a JavaScript string you actually have to do double escaping, so for example \"content: '\\00d7';\" should become \"content: '\\\\00d7';\".\nYou can read more about this here:\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences";
|
| 13045 |
+
|
| 13046 |
+
var styled_base_browser_esm_createStyled = function createStyled(tag, options) {
|
| 13047 |
+
if (false) {}
|
| 13048 |
+
|
| 13049 |
+
var identifierName;
|
| 13050 |
+
var shouldForwardProp;
|
| 13051 |
+
var targetClassName;
|
| 13052 |
+
|
| 13053 |
+
if (options !== undefined) {
|
| 13054 |
+
identifierName = options.label;
|
| 13055 |
+
targetClassName = options.target;
|
| 13056 |
+
shouldForwardProp = tag.__emotion_forwardProp && options.shouldForwardProp ? function (propName) {
|
| 13057 |
+
return tag.__emotion_forwardProp(propName) && // $FlowFixMe
|
| 13058 |
+
options.shouldForwardProp(propName);
|
| 13059 |
+
} : options.shouldForwardProp;
|
| 13060 |
+
}
|
| 13061 |
+
|
| 13062 |
+
var isReal = tag.__emotion_real === tag;
|
| 13063 |
+
var baseTag = isReal && tag.__emotion_base || tag;
|
| 13064 |
+
|
| 13065 |
+
if (typeof shouldForwardProp !== 'function' && isReal) {
|
| 13066 |
+
shouldForwardProp = tag.__emotion_forwardProp;
|
| 13067 |
+
}
|
| 13068 |
+
|
| 13069 |
+
var defaultShouldForwardProp = shouldForwardProp || getDefaultShouldForwardProp(baseTag);
|
| 13070 |
+
var shouldUseAs = !defaultShouldForwardProp('as');
|
| 13071 |
+
return function () {
|
| 13072 |
+
var args = arguments;
|
| 13073 |
+
var styles = isReal && tag.__emotion_styles !== undefined ? tag.__emotion_styles.slice(0) : [];
|
| 13074 |
+
|
| 13075 |
+
if (identifierName !== undefined) {
|
| 13076 |
+
styles.push("label:" + identifierName + ";");
|
| 13077 |
+
}
|
| 13078 |
+
|
| 13079 |
+
if (args[0] == null || args[0].raw === undefined) {
|
| 13080 |
+
styles.push.apply(styles, args);
|
| 13081 |
+
} else {
|
| 13082 |
+
if (false) {}
|
| 13083 |
+
|
| 13084 |
+
styles.push(args[0][0]);
|
| 13085 |
+
var len = args.length;
|
| 13086 |
+
var i = 1;
|
| 13087 |
+
|
| 13088 |
+
for (; i < len; i++) {
|
| 13089 |
+
if (false) {}
|
| 13090 |
+
|
| 13091 |
+
styles.push(args[i], args[0][i]);
|
| 13092 |
+
}
|
| 13093 |
+
} // $FlowFixMe: we need to cast StatelessFunctionalComponent to our PrivateStyledComponent class
|
| 13094 |
+
|
| 13095 |
+
|
| 13096 |
+
var Styled = Object(core_browser_esm["c" /* withEmotionCache */])(function (props, context, ref) {
|
| 13097 |
+
return Object(external_React_["createElement"])(core_browser_esm["a" /* ThemeContext */].Consumer, null, function (theme) {
|
| 13098 |
+
var finalTag = shouldUseAs && props.as || baseTag;
|
| 13099 |
+
var className = '';
|
| 13100 |
+
var classInterpolations = [];
|
| 13101 |
+
var mergedProps = props;
|
| 13102 |
+
|
| 13103 |
+
if (props.theme == null) {
|
| 13104 |
+
mergedProps = {};
|
| 13105 |
+
|
| 13106 |
+
for (var key in props) {
|
| 13107 |
+
mergedProps[key] = props[key];
|
| 13108 |
+
}
|
| 13109 |
+
|
| 13110 |
+
mergedProps.theme = theme;
|
| 13111 |
+
}
|
| 13112 |
+
|
| 13113 |
+
if (typeof props.className === 'string') {
|
| 13114 |
+
className = Object(utils_browser_esm["a" /* getRegisteredStyles */])(context.registered, classInterpolations, props.className);
|
| 13115 |
+
} else if (props.className != null) {
|
| 13116 |
+
className = props.className + " ";
|
| 13117 |
+
}
|
| 13118 |
+
|
| 13119 |
+
var serialized = Object(serialize_browser_esm["a" /* serializeStyles */])(styles.concat(classInterpolations), context.registered, mergedProps);
|
| 13120 |
+
var rules = Object(utils_browser_esm["b" /* insertStyles */])(context, serialized, typeof finalTag === 'string');
|
| 13121 |
+
className += context.key + "-" + serialized.name;
|
| 13122 |
+
|
| 13123 |
+
if (targetClassName !== undefined) {
|
| 13124 |
+
className += " " + targetClassName;
|
| 13125 |
+
}
|
| 13126 |
+
|
| 13127 |
+
var finalShouldForwardProp = shouldUseAs && shouldForwardProp === undefined ? getDefaultShouldForwardProp(finalTag) : defaultShouldForwardProp;
|
| 13128 |
+
var newProps = {};
|
| 13129 |
+
|
| 13130 |
+
for (var _key in props) {
|
| 13131 |
+
if (shouldUseAs && _key === 'as') continue;
|
| 13132 |
+
|
| 13133 |
+
if ( // $FlowFixMe
|
| 13134 |
+
finalShouldForwardProp(_key)) {
|
| 13135 |
+
newProps[_key] = props[_key];
|
| 13136 |
+
}
|
| 13137 |
+
}
|
| 13138 |
+
|
| 13139 |
+
newProps.className = className;
|
| 13140 |
+
newProps.ref = ref || props.innerRef;
|
| 13141 |
+
|
| 13142 |
+
if (false) {}
|
| 13143 |
+
|
| 13144 |
+
var ele = Object(external_React_["createElement"])(finalTag, newProps);
|
| 13145 |
+
|
| 13146 |
+
return ele;
|
| 13147 |
+
});
|
| 13148 |
+
});
|
| 13149 |
+
Styled.displayName = identifierName !== undefined ? identifierName : "Styled(" + (typeof baseTag === 'string' ? baseTag : baseTag.displayName || baseTag.name || 'Component') + ")";
|
| 13150 |
+
Styled.defaultProps = tag.defaultProps;
|
| 13151 |
+
Styled.__emotion_real = Styled;
|
| 13152 |
+
Styled.__emotion_base = baseTag;
|
| 13153 |
+
Styled.__emotion_styles = styles;
|
| 13154 |
+
Styled.__emotion_forwardProp = shouldForwardProp;
|
| 13155 |
+
Object.defineProperty(Styled, 'toString', {
|
| 13156 |
+
value: function value() {
|
| 13157 |
+
if (targetClassName === undefined && "production" !== 'production') {
|
| 13158 |
+
return 'NO_COMPONENT_SELECTOR';
|
| 13159 |
+
} // $FlowFixMe: coerce undefined to string
|
| 13160 |
+
|
| 13161 |
+
|
| 13162 |
+
return "." + targetClassName;
|
| 13163 |
+
}
|
| 13164 |
+
});
|
| 13165 |
+
|
| 13166 |
+
Styled.withComponent = function (nextTag, nextOptions) {
|
| 13167 |
+
return createStyled(nextTag, nextOptions !== undefined ? _objectSpread({}, options || {}, {}, nextOptions) : options).apply(void 0, styles);
|
| 13168 |
+
};
|
| 13169 |
+
|
| 13170 |
+
return Styled;
|
| 13171 |
+
};
|
| 13172 |
+
};
|
| 13173 |
+
|
| 13174 |
+
/* harmony default export */ var styled_base_browser_esm = __webpack_exports__["a"] = (styled_base_browser_esm_createStyled);
|
| 13175 |
+
|
| 13176 |
+
|
| 13177 |
+
/***/ }),
|
| 13178 |
+
|
| 13179 |
+
/***/ 43:
|
| 13180 |
+
/***/ (function(module, exports) {
|
| 13181 |
+
|
| 13182 |
+
(function() { module.exports = this["wp"]["apiFetch"]; }());
|
| 13183 |
+
|
| 13184 |
+
/***/ }),
|
| 13185 |
+
|
| 13186 |
+
/***/ 436:
|
| 13187 |
+
/***/ (function(module, exports, __webpack_require__) {
|
| 13188 |
+
|
| 13189 |
+
"use strict";
|
| 13190 |
+
|
| 13191 |
+
|
| 13192 |
+
Object.defineProperty(exports, '__esModule', { value: true });
|
| 13193 |
+
|
| 13194 |
+
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
|
| 13195 |
+
|
| 13196 |
+
var _extends = _interopDefault(__webpack_require__(38));
|
| 13197 |
+
var _objectWithoutPropertiesLoose = _interopDefault(__webpack_require__(280));
|
| 13198 |
+
var React = __webpack_require__(6);
|
| 13199 |
+
var React__default = _interopDefault(React);
|
| 13200 |
+
var _inheritsLoose = _interopDefault(__webpack_require__(197));
|
| 13201 |
+
var _assertThisInitialized = _interopDefault(__webpack_require__(11));
|
| 13202 |
+
|
| 13203 |
+
var is = {
|
| 13204 |
+
arr: Array.isArray,
|
| 13205 |
+
obj: function obj(a) {
|
| 13206 |
+
return Object.prototype.toString.call(a) === '[object Object]';
|
| 13207 |
+
},
|
| 13208 |
+
fun: function fun(a) {
|
| 13209 |
+
return typeof a === 'function';
|
| 13210 |
+
},
|
| 13211 |
+
str: function str(a) {
|
| 13212 |
+
return typeof a === 'string';
|
| 13213 |
+
},
|
| 13214 |
+
num: function num(a) {
|
| 13215 |
+
return typeof a === 'number';
|
| 13216 |
+
},
|
| 13217 |
+
und: function und(a) {
|
| 13218 |
+
return a === void 0;
|
| 13219 |
+
},
|
| 13220 |
+
nul: function nul(a) {
|
| 13221 |
+
return a === null;
|
| 13222 |
+
},
|
| 13223 |
+
set: function set(a) {
|
| 13224 |
+
return a instanceof Set;
|
| 13225 |
+
},
|
| 13226 |
+
map: function map(a) {
|
| 13227 |
+
return a instanceof Map;
|
| 13228 |
+
},
|
| 13229 |
+
equ: function equ(a, b) {
|
| 13230 |
+
if (typeof a !== typeof b) return false;
|
| 13231 |
+
if (is.str(a) || is.num(a)) return a === b;
|
| 13232 |
+
if (is.obj(a) && is.obj(b) && Object.keys(a).length + Object.keys(b).length === 0) return true;
|
| 13233 |
+
var i;
|
| 13234 |
+
|
| 13235 |
+
for (i in a) {
|
| 13236 |
+
if (!(i in b)) return false;
|
| 13237 |
+
}
|
| 13238 |
+
|
| 13239 |
+
for (i in b) {
|
| 13240 |
+
if (a[i] !== b[i]) return false;
|
| 13241 |
+
}
|
| 13242 |
+
|
| 13243 |
+
return is.und(i) ? a === b : true;
|
| 13244 |
+
}
|
| 13245 |
+
};
|
| 13246 |
+
function merge(target, lowercase) {
|
| 13247 |
+
if (lowercase === void 0) {
|
| 13248 |
+
lowercase = true;
|
| 13249 |
+
}
|
| 13250 |
+
|
| 13251 |
+
return function (object) {
|
| 13252 |
+
return (is.arr(object) ? object : Object.keys(object)).reduce(function (acc, element) {
|
| 13253 |
+
var key = lowercase ? element[0].toLowerCase() + element.substring(1) : element;
|
| 13254 |
+
acc[key] = target(key);
|
| 13255 |
+
return acc;
|
| 13256 |
+
}, target);
|
| 13257 |
+
};
|
| 13258 |
+
}
|
| 13259 |
+
function useForceUpdate() {
|
| 13260 |
+
var _useState = React.useState(false),
|
| 13261 |
+
f = _useState[1];
|
| 13262 |
+
|
| 13263 |
+
var forceUpdate = React.useCallback(function () {
|
| 13264 |
+
return f(function (v) {
|
| 13265 |
+
return !v;
|
| 13266 |
+
});
|
| 13267 |
+
}, []);
|
| 13268 |
+
return forceUpdate;
|
| 13269 |
+
}
|
| 13270 |
+
function withDefault(value, defaultValue) {
|
| 13271 |
+
return is.und(value) || is.nul(value) ? defaultValue : value;
|
| 13272 |
+
}
|
| 13273 |
+
function toArray(a) {
|
| 13274 |
+
return !is.und(a) ? is.arr(a) ? a : [a] : [];
|
| 13275 |
+
}
|
| 13276 |
+
function callProp(obj) {
|
| 13277 |
+
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
| 13278 |
+
args[_key - 1] = arguments[_key];
|
| 13279 |
+
}
|
| 13280 |
+
|
| 13281 |
+
return is.fun(obj) ? obj.apply(void 0, args) : obj;
|
| 13282 |
+
}
|
| 13283 |
+
|
| 13284 |
+
function getForwardProps(props) {
|
| 13285 |
+
var to = props.to,
|
| 13286 |
+
from = props.from,
|
| 13287 |
+
config = props.config,
|
| 13288 |
+
onStart = props.onStart,
|
| 13289 |
+
onRest = props.onRest,
|
| 13290 |
+
onFrame = props.onFrame,
|
| 13291 |
+
children = props.children,
|
| 13292 |
+
reset = props.reset,
|
| 13293 |
+
reverse = props.reverse,
|
| 13294 |
+
force = props.force,
|
| 13295 |
+
immediate = props.immediate,
|
| 13296 |
+
delay = props.delay,
|
| 13297 |
+
attach = props.attach,
|
| 13298 |
+
destroyed = props.destroyed,
|
| 13299 |
+
interpolateTo = props.interpolateTo,
|
| 13300 |
+
ref = props.ref,
|
| 13301 |
+
lazy = props.lazy,
|
| 13302 |
+
forward = _objectWithoutPropertiesLoose(props, ["to", "from", "config", "onStart", "onRest", "onFrame", "children", "reset", "reverse", "force", "immediate", "delay", "attach", "destroyed", "interpolateTo", "ref", "lazy"]);
|
| 13303 |
+
|
| 13304 |
+
return forward;
|
| 13305 |
+
}
|
| 13306 |
+
|
| 13307 |
+
function interpolateTo(props) {
|
| 13308 |
+
var forward = getForwardProps(props);
|
| 13309 |
+
if (is.und(forward)) return _extends({
|
| 13310 |
+
to: forward
|
| 13311 |
+
}, props);
|
| 13312 |
+
var rest = Object.keys(props).reduce(function (a, k) {
|
| 13313 |
+
var _extends2;
|
| 13314 |
+
|
| 13315 |
+
return !is.und(forward[k]) ? a : _extends({}, a, (_extends2 = {}, _extends2[k] = props[k], _extends2));
|
| 13316 |
+
}, {});
|
| 13317 |
+
return _extends({
|
| 13318 |
+
to: forward
|
| 13319 |
+
}, rest);
|
| 13320 |
+
}
|
| 13321 |
+
function handleRef(ref, forward) {
|
| 13322 |
+
if (forward) {
|
| 13323 |
+
// If it's a function, assume it's a ref callback
|
| 13324 |
+
if (is.fun(forward)) forward(ref);else if (is.obj(forward)) {
|
| 13325 |
+
forward.current = ref;
|
| 13326 |
+
}
|
| 13327 |
+
}
|
| 13328 |
+
|
| 13329 |
+
return ref;
|
| 13330 |
+
}
|
| 13331 |
+
|
| 13332 |
+
var Animated =
|
| 13333 |
+
/*#__PURE__*/
|
| 13334 |
+
function () {
|
| 13335 |
+
function Animated() {
|
| 13336 |
+
this.payload = void 0;
|
| 13337 |
+
this.children = [];
|
| 13338 |
+
}
|
| 13339 |
+
|
| 13340 |
+
var _proto = Animated.prototype;
|
| 13341 |
+
|
| 13342 |
+
_proto.getAnimatedValue = function getAnimatedValue() {
|
| 13343 |
+
return this.getValue();
|
| 13344 |
+
};
|
| 13345 |
+
|
| 13346 |
+
_proto.getPayload = function getPayload() {
|
| 13347 |
+
return this.payload || this;
|
| 13348 |
+
};
|
| 13349 |
+
|
| 13350 |
+
_proto.attach = function attach() {};
|
| 13351 |
+
|
| 13352 |
+
_proto.detach = function detach() {};
|
| 13353 |
+
|
| 13354 |
+
_proto.getChildren = function getChildren() {
|
| 13355 |
+
return this.children;
|
| 13356 |
+
};
|
| 13357 |
+
|
| 13358 |
+
_proto.addChild = function addChild(child) {
|
| 13359 |
+
if (this.children.length === 0) this.attach();
|
| 13360 |
+
this.children.push(child);
|
| 13361 |
+
};
|
| 13362 |
+
|
| 13363 |
+
_proto.removeChild = function removeChild(child) {
|
| 13364 |
+
var index = this.children.indexOf(child);
|
| 13365 |
+
this.children.splice(index, 1);
|
| 13366 |
+
if (this.children.length === 0) this.detach();
|
| 13367 |
+
};
|
| 13368 |
+
|
| 13369 |
+
return Animated;
|
| 13370 |
+
}();
|
| 13371 |
+
var AnimatedArray =
|
| 13372 |
+
/*#__PURE__*/
|
| 13373 |
+
function (_Animated) {
|
| 13374 |
+
_inheritsLoose(AnimatedArray, _Animated);
|
| 13375 |
+
|
| 13376 |
+
function AnimatedArray() {
|
| 13377 |
+
var _this;
|
| 13378 |
+
|
| 13379 |
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
| 13380 |
+
args[_key] = arguments[_key];
|
| 13381 |
+
}
|
| 13382 |
+
|
| 13383 |
+
_this = _Animated.call.apply(_Animated, [this].concat(args)) || this;
|
| 13384 |
+
_this.payload = [];
|
| 13385 |
+
|
| 13386 |
+
_this.attach = function () {
|
| 13387 |
+
return _this.payload.forEach(function (p) {
|
| 13388 |
+
return p instanceof Animated && p.addChild(_assertThisInitialized(_this));
|
| 13389 |
+
});
|
| 13390 |
+
};
|
| 13391 |
+
|
| 13392 |
+
_this.detach = function () {
|
| 13393 |
+
return _this.payload.forEach(function (p) {
|
| 13394 |
+
return p instanceof Animated && p.removeChild(_assertThisInitialized(_this));
|
| 13395 |
+
});
|
| 13396 |
+
};
|
| 13397 |
+
|
| 13398 |
+
return _this;
|
| 13399 |
+
}
|
| 13400 |
+
|
| 13401 |
+
return AnimatedArray;
|
| 13402 |
+
}(Animated);
|
| 13403 |
+
var AnimatedObject =
|
| 13404 |
+
/*#__PURE__*/
|
| 13405 |
+
function (_Animated2) {
|
| 13406 |
+
_inheritsLoose(AnimatedObject, _Animated2);
|
| 13407 |
+
|
| 13408 |
+
function AnimatedObject() {
|
| 13409 |
+
var _this2;
|
| 13410 |
+
|
| 13411 |
+
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
| 13412 |
+
args[_key3] = arguments[_key3];
|
| 13413 |
+
}
|
| 13414 |
+
|
| 13415 |
+
_this2 = _Animated2.call.apply(_Animated2, [this].concat(args)) || this;
|
| 13416 |
+
_this2.payload = {};
|
| 13417 |
+
|
| 13418 |
+
_this2.attach = function () {
|
| 13419 |
+
return Object.values(_this2.payload).forEach(function (s) {
|
| 13420 |
+
return s instanceof Animated && s.addChild(_assertThisInitialized(_this2));
|
| 13421 |
+
});
|
| 13422 |
+
};
|
| 13423 |
+
|
| 13424 |
+
_this2.detach = function () {
|
| 13425 |
+
return Object.values(_this2.payload).forEach(function (s) {
|
| 13426 |
+
return s instanceof Animated && s.removeChild(_assertThisInitialized(_this2));
|
| 13427 |
+
});
|
| 13428 |
+
};
|
| 13429 |
+
|
| 13430 |
+
return _this2;
|
| 13431 |
+
}
|
| 13432 |
+
|
| 13433 |
+
var _proto2 = AnimatedObject.prototype;
|
| 13434 |
+
|
| 13435 |
+
_proto2.getValue = function getValue(animated) {
|
| 13436 |
+
if (animated === void 0) {
|
| 13437 |
+
animated = false;
|
| 13438 |
+
}
|
| 13439 |
+
|
| 13440 |
+
var payload = {};
|
| 13441 |
+
|
| 13442 |
+
for (var _key4 in this.payload) {
|
| 13443 |
+
var value = this.payload[_key4];
|
| 13444 |
+
if (animated && !(value instanceof Animated)) continue;
|
| 13445 |
+
payload[_key4] = value instanceof Animated ? value[animated ? 'getAnimatedValue' : 'getValue']() : value;
|
| 13446 |
+
}
|
| 13447 |
+
|
| 13448 |
+
return payload;
|
| 13449 |
+
};
|
| 13450 |
+
|
| 13451 |
+
_proto2.getAnimatedValue = function getAnimatedValue() {
|
| 13452 |
+
return this.getValue(true);
|
| 13453 |
+
};
|
| 13454 |
+
|
| 13455 |
+
return AnimatedObject;
|
| 13456 |
+
}(Animated);
|
| 13457 |
+
|
| 13458 |
+
var applyAnimatedValues;
|
| 13459 |
+
function injectApplyAnimatedValues(fn, transform) {
|
| 13460 |
+
applyAnimatedValues = {
|
| 13461 |
+
fn: fn,
|
| 13462 |
+
transform: transform
|
| 13463 |
+
};
|
| 13464 |
+
}
|
| 13465 |
+
var colorNames;
|
| 13466 |
+
function injectColorNames(names) {
|
| 13467 |
+
colorNames = names;
|
| 13468 |
+
}
|
| 13469 |
+
var requestFrame = function requestFrame(cb) {
|
| 13470 |
+
return typeof window !== 'undefined' ? window.requestAnimationFrame(cb) : -1;
|
| 13471 |
+
};
|
| 13472 |
+
var cancelFrame = function cancelFrame(id) {
|
| 13473 |
+
typeof window !== 'undefined' && window.cancelAnimationFrame(id);
|
| 13474 |
+
};
|
| 13475 |
+
function injectFrame(raf, caf) {
|
| 13476 |
+
requestFrame = raf;
|
| 13477 |
+
cancelFrame = caf;
|
| 13478 |
+
}
|
| 13479 |
+
var interpolation;
|
| 13480 |
+
function injectStringInterpolator(fn) {
|
| 13481 |
+
interpolation = fn;
|
| 13482 |
+
}
|
| 13483 |
+
var now = function now() {
|
| 13484 |
+
return Date.now();
|
| 13485 |
+
};
|
| 13486 |
+
function injectNow(nowFn) {
|
| 13487 |
+
now = nowFn;
|
| 13488 |
+
}
|
| 13489 |
+
var defaultElement;
|
| 13490 |
+
function injectDefaultElement(el) {
|
| 13491 |
+
defaultElement = el;
|
| 13492 |
+
}
|
| 13493 |
+
var animatedApi = function animatedApi(node) {
|
| 13494 |
+
return node.current;
|
| 13495 |
+
};
|
| 13496 |
+
function injectAnimatedApi(fn) {
|
| 13497 |
+
animatedApi = fn;
|
| 13498 |
+
}
|
| 13499 |
+
var createAnimatedStyle;
|
| 13500 |
+
function injectCreateAnimatedStyle(factory) {
|
| 13501 |
+
createAnimatedStyle = factory;
|
| 13502 |
+
}
|
| 13503 |
+
var manualFrameloop;
|
| 13504 |
+
function injectManualFrameloop(callback) {
|
| 13505 |
+
manualFrameloop = callback;
|
| 13506 |
+
}
|
| 13507 |
+
|
| 13508 |
+
var Globals = /*#__PURE__*/Object.freeze({
|
| 13509 |
+
get applyAnimatedValues () { return applyAnimatedValues; },
|
| 13510 |
+
injectApplyAnimatedValues: injectApplyAnimatedValues,
|
| 13511 |
+
get colorNames () { return colorNames; },
|
| 13512 |
+
injectColorNames: injectColorNames,
|
| 13513 |
+
get requestFrame () { return requestFrame; },
|
| 13514 |
+
get cancelFrame () { return cancelFrame; },
|
| 13515 |
+
injectFrame: injectFrame,
|
| 13516 |
+
get interpolation () { return interpolation; },
|
| 13517 |
+
injectStringInterpolator: injectStringInterpolator,
|
| 13518 |
+
get now () { return now; },
|
| 13519 |
+
injectNow: injectNow,
|
| 13520 |
+
get defaultElement () { return defaultElement; },
|
| 13521 |
+
injectDefaultElement: injectDefaultElement,
|
| 13522 |
+
get animatedApi () { return animatedApi; },
|
| 13523 |
+
injectAnimatedApi: injectAnimatedApi,
|
| 13524 |
+
get createAnimatedStyle () { return createAnimatedStyle; },
|
| 13525 |
+
injectCreateAnimatedStyle: injectCreateAnimatedStyle,
|
| 13526 |
+
get manualFrameloop () { return manualFrameloop; },
|
| 13527 |
+
injectManualFrameloop: injectManualFrameloop
|
| 13528 |
+
});
|
| 13529 |
+
|
| 13530 |
+
/**
|
| 13531 |
+
* Wraps the `style` property with `AnimatedStyle`.
|
| 13532 |
+
*/
|
| 13533 |
+
|
| 13534 |
+
var AnimatedProps =
|
| 13535 |
+
/*#__PURE__*/
|
| 13536 |
+
function (_AnimatedObject) {
|
| 13537 |
+
_inheritsLoose(AnimatedProps, _AnimatedObject);
|
| 13538 |
+
|
| 13539 |
+
function AnimatedProps(props, callback) {
|
| 13540 |
+
var _this;
|
| 13541 |
+
|
| 13542 |
+
_this = _AnimatedObject.call(this) || this;
|
| 13543 |
+
_this.update = void 0;
|
| 13544 |
+
_this.payload = !props.style ? props : _extends({}, props, {
|
| 13545 |
+
style: createAnimatedStyle(props.style)
|
| 13546 |
+
});
|
| 13547 |
+
_this.update = callback;
|
| 13548 |
+
|
| 13549 |
+
_this.attach();
|
| 13550 |
+
|
| 13551 |
+
return _this;
|
| 13552 |
+
}
|
| 13553 |
+
|
| 13554 |
+
return AnimatedProps;
|
| 13555 |
+
}(AnimatedObject);
|
| 13556 |
+
|
| 13557 |
+
var isFunctionComponent = function isFunctionComponent(val) {
|
| 13558 |
+
return is.fun(val) && !(val.prototype instanceof React__default.Component);
|
| 13559 |
+
};
|
| 13560 |
+
|
| 13561 |
+
var createAnimatedComponent = function createAnimatedComponent(Component) {
|
| 13562 |
+
var AnimatedComponent = React.forwardRef(function (props, ref) {
|
| 13563 |
+
var forceUpdate = useForceUpdate();
|
| 13564 |
+
var mounted = React.useRef(true);
|
| 13565 |
+
var propsAnimated = React.useRef(null);
|
| 13566 |
+
var node = React.useRef(null);
|
| 13567 |
+
var attachProps = React.useCallback(function (props) {
|
| 13568 |
+
var oldPropsAnimated = propsAnimated.current;
|
| 13569 |
+
|
| 13570 |
+
var callback = function callback() {
|
| 13571 |
+
var didUpdate = false;
|
| 13572 |
+
|
| 13573 |
+
if (node.current) {
|
| 13574 |
+
didUpdate = applyAnimatedValues.fn(node.current, propsAnimated.current.getAnimatedValue());
|
| 13575 |
+
}
|
| 13576 |
+
|
| 13577 |
+
if (!node.current || didUpdate === false) {
|
| 13578 |
+
// If no referenced node has been found, or the update target didn't have a
|
| 13579 |
+
// native-responder, then forceUpdate the animation ...
|
| 13580 |
+
forceUpdate();
|
| 13581 |
+
}
|
| 13582 |
+
};
|
| 13583 |
+
|
| 13584 |
+
propsAnimated.current = new AnimatedProps(props, callback);
|
| 13585 |
+
oldPropsAnimated && oldPropsAnimated.detach();
|
| 13586 |
+
}, []);
|
| 13587 |
+
React.useEffect(function () {
|
| 13588 |
+
return function () {
|
| 13589 |
+
mounted.current = false;
|
| 13590 |
+
propsAnimated.current && propsAnimated.current.detach();
|
| 13591 |
+
};
|
| 13592 |
+
}, []);
|
| 13593 |
+
React.useImperativeHandle(ref, function () {
|
| 13594 |
+
return animatedApi(node, mounted, forceUpdate);
|
| 13595 |
+
});
|
| 13596 |
+
attachProps(props);
|
| 13597 |
+
|
| 13598 |
+
var _getValue = propsAnimated.current.getValue(),
|
| 13599 |
+
scrollTop = _getValue.scrollTop,
|
| 13600 |
+
scrollLeft = _getValue.scrollLeft,
|
| 13601 |
+
animatedProps = _objectWithoutPropertiesLoose(_getValue, ["scrollTop", "scrollLeft"]); // Functions cannot have refs, see:
|
| 13602 |
+
// See: https://github.com/react-spring/react-spring/issues/569
|
| 13603 |
+
|
| 13604 |
+
|
| 13605 |
+
var refFn = isFunctionComponent(Component) ? undefined : function (childRef) {
|
| 13606 |
+
return node.current = handleRef(childRef, ref);
|
| 13607 |
+
};
|
| 13608 |
+
return React__default.createElement(Component, _extends({}, animatedProps, {
|
| 13609 |
+
ref: refFn
|
| 13610 |
+
}));
|
| 13611 |
+
});
|
| 13612 |
+
return AnimatedComponent;
|
| 13613 |
+
};
|
| 13614 |
+
|
| 13615 |
+
var active = false;
|
| 13616 |
+
var controllers = new Set();
|
| 13617 |
+
|
| 13618 |
+
var update = function update() {
|
| 13619 |
+
if (!active) return false;
|
| 13620 |
+
var time = now();
|
| 13621 |
+
|
| 13622 |
+
for (var _iterator = controllers, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
|
| 13623 |
+
var _ref;
|
| 13624 |
+
|
| 13625 |
+
if (_isArray) {
|
| 13626 |
+
if (_i >= _iterator.length) break;
|
| 13627 |
+
_ref = _iterator[_i++];
|
| 13628 |
+
} else {
|
| 13629 |
+
_i = _iterator.next();
|
| 13630 |
+
if (_i.done) break;
|
| 13631 |
+
_ref = _i.value;
|
| 13632 |
+
}
|
| 13633 |
+
|
| 13634 |
+
var controller = _ref;
|
| 13635 |
+
var isActive = false;
|
| 13636 |
+
|
| 13637 |
+
for (var configIdx = 0; configIdx < controller.configs.length; configIdx++) {
|
| 13638 |
+
var config = controller.configs[configIdx];
|
| 13639 |
+
var endOfAnimation = void 0,
|
| 13640 |
+
lastTime = void 0;
|
| 13641 |
+
|
| 13642 |
+
for (var valIdx = 0; valIdx < config.animatedValues.length; valIdx++) {
|
| 13643 |
+
var animation = config.animatedValues[valIdx]; // If an animation is done, skip, until all of them conclude
|
| 13644 |
+
|
| 13645 |
+
if (animation.done) continue;
|
| 13646 |
+
var from = config.fromValues[valIdx];
|
| 13647 |
+
var to = config.toValues[valIdx];
|
| 13648 |
+
var position = animation.lastPosition;
|
| 13649 |
+
var isAnimated = to instanceof Animated;
|
| 13650 |
+
var velocity = Array.isArray(config.initialVelocity) ? config.initialVelocity[valIdx] : config.initialVelocity;
|
| 13651 |
+
if (isAnimated) to = to.getValue(); // Conclude animation if it's either immediate, or from-values match end-state
|
| 13652 |
+
|
| 13653 |
+
if (config.immediate) {
|
| 13654 |
+
animation.setValue(to);
|
| 13655 |
+
animation.done = true;
|
| 13656 |
+
continue;
|
| 13657 |
+
} // Break animation when string values are involved
|
| 13658 |
+
|
| 13659 |
+
|
| 13660 |
+
if (typeof from === 'string' || typeof to === 'string') {
|
| 13661 |
+
animation.setValue(to);
|
| 13662 |
+
animation.done = true;
|
| 13663 |
+
continue;
|
| 13664 |
+
}
|
| 13665 |
+
|
| 13666 |
+
if (config.duration !== void 0) {
|
| 13667 |
+
/** Duration easing */
|
| 13668 |
+
position = from + config.easing((time - animation.startTime) / config.duration) * (to - from);
|
| 13669 |
+
endOfAnimation = time >= animation.startTime + config.duration;
|
| 13670 |
+
} else if (config.decay) {
|
| 13671 |
+
/** Decay easing */
|
| 13672 |
+
position = from + velocity / (1 - 0.998) * (1 - Math.exp(-(1 - 0.998) * (time - animation.startTime)));
|
| 13673 |
+
endOfAnimation = Math.abs(animation.lastPosition - position) < 0.1;
|
| 13674 |
+
if (endOfAnimation) to = position;
|
| 13675 |
+
} else {
|
| 13676 |
+
/** Spring easing */
|
| 13677 |
+
lastTime = animation.lastTime !== void 0 ? animation.lastTime : time;
|
| 13678 |
+
velocity = animation.lastVelocity !== void 0 ? animation.lastVelocity : config.initialVelocity; // If we lost a lot of frames just jump to the end.
|
| 13679 |
+
|
| 13680 |
+
if (time > lastTime + 64) lastTime = time; // http://gafferongames.com/game-physics/fix-your-timestep/
|
| 13681 |
+
|
| 13682 |
+
var numSteps = Math.floor(time - lastTime);
|
| 13683 |
+
|
| 13684 |
+
for (var i = 0; i < numSteps; ++i) {
|
| 13685 |
+
var force = -config.tension * (position - to);
|
| 13686 |
+
var damping = -config.friction * velocity;
|
| 13687 |
+
var acceleration = (force + damping) / config.mass;
|
| 13688 |
+
velocity = velocity + acceleration * 1 / 1000;
|
| 13689 |
+
position = position + velocity * 1 / 1000;
|
| 13690 |
+
} // Conditions for stopping the spring animation
|
| 13691 |
+
|
| 13692 |
+
|
| 13693 |
+
var isOvershooting = config.clamp && config.tension !== 0 ? from < to ? position > to : position < to : false;
|
| 13694 |
+
var isVelocity = Math.abs(velocity) <= config.precision;
|
| 13695 |
+
var isDisplacement = config.tension !== 0 ? Math.abs(to - position) <= config.precision : true;
|
| 13696 |
+
endOfAnimation = isOvershooting || isVelocity && isDisplacement;
|
| 13697 |
+
animation.lastVelocity = velocity;
|
| 13698 |
+
animation.lastTime = time;
|
| 13699 |
+
} // Trails aren't done until their parents conclude
|
| 13700 |
+
|
| 13701 |
+
|
| 13702 |
+
if (isAnimated && !config.toValues[valIdx].done) endOfAnimation = false;
|
| 13703 |
+
|
| 13704 |
+
if (endOfAnimation) {
|
| 13705 |
+
// Ensure that we end up with a round value
|
| 13706 |
+
if (animation.value !== to) position = to;
|
| 13707 |
+
animation.done = true;
|
| 13708 |
+
} else isActive = true;
|
| 13709 |
+
|
| 13710 |
+
animation.setValue(position);
|
| 13711 |
+
animation.lastPosition = position;
|
| 13712 |
+
} // Keep track of updated values only when necessary
|
| 13713 |
+
|
| 13714 |
+
|
| 13715 |
+
if (controller.props.onFrame) controller.values[config.name] = config.interpolation.getValue();
|
| 13716 |
+
} // Update callbacks in the end of the frame
|
| 13717 |
+
|
| 13718 |
+
|
| 13719 |
+
if (controller.props.onFrame) controller.props.onFrame(controller.values); // Either call onEnd or next frame
|
| 13720 |
+
|
| 13721 |
+
if (!isActive) {
|
| 13722 |
+
controllers.delete(controller);
|
| 13723 |
+
controller.stop(true);
|
| 13724 |
+
}
|
| 13725 |
+
} // Loop over as long as there are controllers ...
|
| 13726 |
+
|
| 13727 |
+
|
| 13728 |
+
if (controllers.size) {
|
| 13729 |
+
if (manualFrameloop) manualFrameloop();else requestFrame(update);
|
| 13730 |
+
} else {
|
| 13731 |
+
active = false;
|
| 13732 |
+
}
|
| 13733 |
+
|
| 13734 |
+
return active;
|
| 13735 |
+
};
|
| 13736 |
+
|
| 13737 |
+
var start = function start(controller) {
|
| 13738 |
+
if (!controllers.has(controller)) controllers.add(controller);
|
| 13739 |
+
|
| 13740 |
+
if (!active) {
|
| 13741 |
+
active = true;
|
| 13742 |
+
if (manualFrameloop) requestFrame(manualFrameloop);else requestFrame(update);
|
| 13743 |
+
}
|
| 13744 |
+
};
|
| 13745 |
+
|
| 13746 |
+
var stop = function stop(controller) {
|
| 13747 |
+
if (controllers.has(controller)) controllers.delete(controller);
|
| 13748 |
+
};
|
| 13749 |
+
|
| 13750 |
+
function createInterpolator(range, output, extrapolate) {
|
| 13751 |
+
if (typeof range === 'function') {
|
| 13752 |
+
return range;
|
| 13753 |
+
}
|
| 13754 |
+
|
| 13755 |
+
if (Array.isArray(range)) {
|
| 13756 |
+
return createInterpolator({
|
| 13757 |
+
range: range,
|
| 13758 |
+
output: output,
|
| 13759 |
+
extrapolate: extrapolate
|
| 13760 |
+
});
|
| 13761 |
+
}
|
| 13762 |
+
|
| 13763 |
+
if (interpolation && typeof range.output[0] === 'string') {
|
| 13764 |
+
return interpolation(range);
|
| 13765 |
+
}
|
| 13766 |
+
|
| 13767 |
+
var config = range;
|
| 13768 |
+
var outputRange = config.output;
|
| 13769 |
+
var inputRange = config.range || [0, 1];
|
| 13770 |
+
var extrapolateLeft = config.extrapolateLeft || config.extrapolate || 'extend';
|
| 13771 |
+
var extrapolateRight = config.extrapolateRight || config.extrapolate || 'extend';
|
| 13772 |
+
|
| 13773 |
+
var easing = config.easing || function (t) {
|
| 13774 |
+
return t;
|
| 13775 |
+
};
|
| 13776 |
+
|
| 13777 |
+
return function (input) {
|
| 13778 |
+
var range = findRange(input, inputRange);
|
| 13779 |
+
return interpolate(input, inputRange[range], inputRange[range + 1], outputRange[range], outputRange[range + 1], easing, extrapolateLeft, extrapolateRight, config.map);
|
| 13780 |
+
};
|
| 13781 |
+
}
|
| 13782 |
+
|
| 13783 |
+
function interpolate(input, inputMin, inputMax, outputMin, outputMax, easing, extrapolateLeft, extrapolateRight, map) {
|
| 13784 |
+
var result = map ? map(input) : input; // Extrapolate
|
| 13785 |
+
|
| 13786 |
+
if (result < inputMin) {
|
| 13787 |
+
if (extrapolateLeft === 'identity') return result;else if (extrapolateLeft === 'clamp') result = inputMin;
|
| 13788 |
+
}
|
| 13789 |
+
|
| 13790 |
+
if (result > inputMax) {
|
| 13791 |
+
if (extrapolateRight === 'identity') return result;else if (extrapolateRight === 'clamp') result = inputMax;
|
| 13792 |
+
}
|
| 13793 |
+
|
| 13794 |
+
if (outputMin === outputMax) return outputMin;
|
| 13795 |
+
if (inputMin === inputMax) return input <= inputMin ? outputMin : outputMax; // Input Range
|
| 13796 |
+
|
| 13797 |
+
if (inputMin === -Infinity) result = -result;else if (inputMax === Infinity) result = result - inputMin;else result = (result - inputMin) / (inputMax - inputMin); // Easing
|
| 13798 |
+
|
| 13799 |
+
result = easing(result); // Output Range
|
| 13800 |
+
|
| 13801 |
+
if (outputMin === -Infinity) result = -result;else if (outputMax === Infinity) result = result + outputMin;else result = result * (outputMax - outputMin) + outputMin;
|
| 13802 |
+
return result;
|
| 13803 |
+
}
|
| 13804 |
+
|
| 13805 |
+
function findRange(input, inputRange) {
|
| 13806 |
+
for (var i = 1; i < inputRange.length - 1; ++i) {
|
| 13807 |
+
if (inputRange[i] >= input) break;
|
| 13808 |
+
}
|
| 13809 |
+
|
| 13810 |
+
return i - 1;
|
| 13811 |
+
}
|
| 13812 |
+
|
| 13813 |
+
var AnimatedInterpolation =
|
| 13814 |
+
/*#__PURE__*/
|
| 13815 |
+
function (_AnimatedArray) {
|
| 13816 |
+
_inheritsLoose(AnimatedInterpolation, _AnimatedArray);
|
| 13817 |
+
|
| 13818 |
+
function AnimatedInterpolation(parents, range, output, extrapolate) {
|
| 13819 |
+
var _this;
|
| 13820 |
+
|
| 13821 |
+
_this = _AnimatedArray.call(this) || this;
|
| 13822 |
+
_this.calc = void 0;
|
| 13823 |
+
_this.payload = parents instanceof AnimatedArray && !(parents instanceof AnimatedInterpolation) ? parents.getPayload() : Array.isArray(parents) ? parents : [parents];
|
| 13824 |
+
_this.calc = createInterpolator(range, output, extrapolate);
|
| 13825 |
+
return _this;
|
| 13826 |
+
}
|
| 13827 |
+
|
| 13828 |
+
var _proto = AnimatedInterpolation.prototype;
|
| 13829 |
+
|
| 13830 |
+
_proto.getValue = function getValue() {
|
| 13831 |
+
return this.calc.apply(this, this.payload.map(function (value) {
|
| 13832 |
+
return value.getValue();
|
| 13833 |
+
}));
|
| 13834 |
+
};
|
| 13835 |
+
|
| 13836 |
+
_proto.updateConfig = function updateConfig(range, output, extrapolate) {
|
| 13837 |
+
this.calc = createInterpolator(range, output, extrapolate);
|
| 13838 |
+
};
|
| 13839 |
+
|
| 13840 |
+
_proto.interpolate = function interpolate(range, output, extrapolate) {
|
| 13841 |
+
return new AnimatedInterpolation(this, range, output, extrapolate);
|
| 13842 |
+
};
|
| 13843 |
+
|
| 13844 |
+
return AnimatedInterpolation;
|
| 13845 |
+
}(AnimatedArray);
|
| 13846 |
+
|
| 13847 |
+
var interpolate$1 = function interpolate(parents, range, output) {
|
| 13848 |
+
return parents && new AnimatedInterpolation(parents, range, output);
|
| 13849 |
+
};
|
| 13850 |
+
|
| 13851 |
+
var config = {
|
| 13852 |
+
default: {
|
| 13853 |
+
tension: 170,
|
| 13854 |
+
friction: 26
|
| 13855 |
+
},
|
| 13856 |
+
gentle: {
|
| 13857 |
+
tension: 120,
|
| 13858 |
+
friction: 14
|
| 13859 |
+
},
|
| 13860 |
+
wobbly: {
|
| 13861 |
+
tension: 180,
|
| 13862 |
+
friction: 12
|
| 13863 |
+
},
|
| 13864 |
+
stiff: {
|
| 13865 |
+
tension: 210,
|
| 13866 |
+
friction: 20
|
| 13867 |
+
},
|
| 13868 |
+
slow: {
|
| 13869 |
+
tension: 280,
|
| 13870 |
+
friction: 60
|
| 13871 |
+
},
|
| 13872 |
+
molasses: {
|
| 13873 |
+
tension: 280,
|
| 13874 |
+
friction: 120
|
| 13875 |
+
}
|
| 13876 |
+
};
|
| 13877 |
+
|
| 13878 |
+
/** API
|
| 13879 |
+
* useChain(references, timeSteps, timeFrame)
|
| 13880 |
+
*/
|
| 13881 |
+
|
| 13882 |
+
function useChain(refs, timeSteps, timeFrame) {
|
| 13883 |
+
if (timeFrame === void 0) {
|
| 13884 |
+
timeFrame = 1000;
|
| 13885 |
+
}
|
| 13886 |
+
|
| 13887 |
+
var previous = React.useRef();
|
| 13888 |
+
React.useEffect(function () {
|
| 13889 |
+
if (is.equ(refs, previous.current)) refs.forEach(function (_ref) {
|
| 13890 |
+
var current = _ref.current;
|
| 13891 |
+
return current && current.start();
|
| 13892 |
+
});else if (timeSteps) {
|
| 13893 |
+
refs.forEach(function (_ref2, index) {
|
| 13894 |
+
var current = _ref2.current;
|
| 13895 |
+
|
| 13896 |
+
if (current) {
|
| 13897 |
+
var ctrls = current.controllers;
|
| 13898 |
+
|
| 13899 |
+
if (ctrls.length) {
|
| 13900 |
+
var t = timeFrame * timeSteps[index];
|
| 13901 |
+
ctrls.forEach(function (ctrl) {
|
| 13902 |
+
ctrl.queue = ctrl.queue.map(function (e) {
|
| 13903 |
+
return _extends({}, e, {
|
| 13904 |
+
delay: e.delay + t
|
| 13905 |
+
});
|
| 13906 |
+
});
|
| 13907 |
+
ctrl.start();
|
| 13908 |
+
});
|
| 13909 |
+
}
|
| 13910 |
+
}
|
| 13911 |
+
});
|
| 13912 |
+
} else refs.reduce(function (q, _ref3, rI) {
|
| 13913 |
+
var current = _ref3.current;
|
| 13914 |
+
return q = q.then(function () {
|
| 13915 |
+
return current.start();
|
| 13916 |
+
});
|
| 13917 |
+
}, Promise.resolve());
|
| 13918 |
+
previous.current = refs;
|
| 13919 |
+
});
|
| 13920 |
+
}
|
| 13921 |
+
|
| 13922 |
+
/**
|
| 13923 |
+
* Animated works by building a directed acyclic graph of dependencies
|
| 13924 |
+
* transparently when you render your Animated components.
|
| 13925 |
+
*
|
| 13926 |
+
* new Animated.Value(0)
|
| 13927 |
+
* .interpolate() .interpolate() new Animated.Value(1)
|
| 13928 |
+
* opacity translateY scale
|
| 13929 |
+
* style transform
|
| 13930 |
+
* View#234 style
|
| 13931 |
+
* View#123
|
| 13932 |
+
*
|
| 13933 |
+
* A) Top Down phase
|
| 13934 |
+
* When an AnimatedValue is updated, we recursively go down through this
|
| 13935 |
+
* graph in order to find leaf nodes: the views that we flag as needing
|
| 13936 |
+
* an update.
|
| 13937 |
+
*
|
| 13938 |
+
* B) Bottom Up phase
|
| 13939 |
+
* When a view is flagged as needing an update, we recursively go back up
|
| 13940 |
+
* in order to build the new value that it needs. The reason why we need
|
| 13941 |
+
* this two-phases process is to deal with composite props such as
|
| 13942 |
+
* transform which can receive values from multiple parents.
|
| 13943 |
+
*/
|
| 13944 |
+
function addAnimatedStyles(node, styles) {
|
| 13945 |
+
if ('update' in node) {
|
| 13946 |
+
styles.add(node);
|
| 13947 |
+
} else {
|
| 13948 |
+
node.getChildren().forEach(function (child) {
|
| 13949 |
+
return addAnimatedStyles(child, styles);
|
| 13950 |
+
});
|
| 13951 |
+
}
|
| 13952 |
+
}
|
| 13953 |
+
|
| 13954 |
+
var AnimatedValue =
|
| 13955 |
+
/*#__PURE__*/
|
| 13956 |
+
function (_Animated) {
|
| 13957 |
+
_inheritsLoose(AnimatedValue, _Animated);
|
| 13958 |
+
|
| 13959 |
+
function AnimatedValue(_value) {
|
| 13960 |
+
var _this;
|
| 13961 |
+
|
| 13962 |
+
_this = _Animated.call(this) || this;
|
| 13963 |
+
_this.animatedStyles = new Set();
|
| 13964 |
+
_this.value = void 0;
|
| 13965 |
+
_this.startPosition = void 0;
|
| 13966 |
+
_this.lastPosition = void 0;
|
| 13967 |
+
_this.lastVelocity = void 0;
|
| 13968 |
+
_this.startTime = void 0;
|
| 13969 |
+
_this.lastTime = void 0;
|
| 13970 |
+
_this.done = false;
|
| 13971 |
+
|
| 13972 |
+
_this.setValue = function (value, flush) {
|
| 13973 |
+
if (flush === void 0) {
|
| 13974 |
+
flush = true;
|
| 13975 |
+
}
|
| 13976 |
+
|
| 13977 |
+
_this.value = value;
|
| 13978 |
+
if (flush) _this.flush();
|
| 13979 |
+
};
|
| 13980 |
+
|
| 13981 |
+
_this.value = _value;
|
| 13982 |
+
_this.startPosition = _value;
|
| 13983 |
+
_this.lastPosition = _value;
|
| 13984 |
+
return _this;
|
| 13985 |
+
}
|
| 13986 |
+
|
| 13987 |
+
var _proto = AnimatedValue.prototype;
|
| 13988 |
+
|
| 13989 |
+
_proto.flush = function flush() {
|
| 13990 |
+
if (this.animatedStyles.size === 0) {
|
| 13991 |
+
addAnimatedStyles(this, this.animatedStyles);
|
| 13992 |
+
}
|
| 13993 |
+
|
| 13994 |
+
this.animatedStyles.forEach(function (animatedStyle) {
|
| 13995 |
+
return animatedStyle.update();
|
| 13996 |
+
});
|
| 13997 |
+
};
|
| 13998 |
+
|
| 13999 |
+
_proto.clearStyles = function clearStyles() {
|
| 14000 |
+
this.animatedStyles.clear();
|
| 14001 |
+
};
|
| 14002 |
+
|
| 14003 |
+
_proto.getValue = function getValue() {
|
| 14004 |
+
return this.value;
|
| 14005 |
+
};
|
| 14006 |
+
|
| 14007 |
+
_proto.interpolate = function interpolate(range, output, extrapolate) {
|
| 14008 |
+
return new AnimatedInterpolation(this, range, output, extrapolate);
|
| 14009 |
+
};
|
| 14010 |
+
|
| 14011 |
+
return AnimatedValue;
|
| 14012 |
+
}(Animated);
|
| 14013 |
+
|
| 14014 |
+
var AnimatedValueArray =
|
| 14015 |
+
/*#__PURE__*/
|
| 14016 |
+
function (_AnimatedArray) {
|
| 14017 |
+
_inheritsLoose(AnimatedValueArray, _AnimatedArray);
|
| 14018 |
+
|
| 14019 |
+
function AnimatedValueArray(values) {
|
| 14020 |
+
var _this;
|
| 14021 |
+
|
| 14022 |
+
_this = _AnimatedArray.call(this) || this;
|
| 14023 |
+
_this.payload = values.map(function (n) {
|
| 14024 |
+
return new AnimatedValue(n);
|
| 14025 |
+
});
|
| 14026 |
+
return _this;
|
| 14027 |
+
}
|
| 14028 |
+
|
| 14029 |
+
var _proto = AnimatedValueArray.prototype;
|
| 14030 |
+
|
| 14031 |
+
_proto.setValue = function setValue(value, flush) {
|
| 14032 |
+
var _this2 = this;
|
| 14033 |
+
|
| 14034 |
+
if (flush === void 0) {
|
| 14035 |
+
flush = true;
|
| 14036 |
+
}
|
| 14037 |
+
|
| 14038 |
+
if (Array.isArray(value)) {
|
| 14039 |
+
if (value.length === this.payload.length) {
|
| 14040 |
+
value.forEach(function (v, i) {
|
| 14041 |
+
return _this2.payload[i].setValue(v, flush);
|
| 14042 |
+
});
|
| 14043 |
+
}
|
| 14044 |
+
} else {
|
| 14045 |
+
this.payload.forEach(function (p) {
|
| 14046 |
+
return p.setValue(value, flush);
|
| 14047 |
+
});
|
| 14048 |
+
}
|
| 14049 |
+
};
|
| 14050 |
+
|
| 14051 |
+
_proto.getValue = function getValue() {
|
| 14052 |
+
return this.payload.map(function (v) {
|
| 14053 |
+
return v.getValue();
|
| 14054 |
+
});
|
| 14055 |
+
};
|
| 14056 |
+
|
| 14057 |
+
_proto.interpolate = function interpolate(range, output) {
|
| 14058 |
+
return new AnimatedInterpolation(this, range, output);
|
| 14059 |
+
};
|
| 14060 |
+
|
| 14061 |
+
return AnimatedValueArray;
|
| 14062 |
+
}(AnimatedArray);
|
| 14063 |
+
|
| 14064 |
+
var G = 0;
|
| 14065 |
+
|
| 14066 |
+
var Controller =
|
| 14067 |
+
/*#__PURE__*/
|
| 14068 |
+
function () {
|
| 14069 |
+
function Controller() {
|
| 14070 |
+
var _this = this;
|
| 14071 |
+
|
| 14072 |
+
this.id = void 0;
|
| 14073 |
+
this.idle = true;
|
| 14074 |
+
this.hasChanged = false;
|
| 14075 |
+
this.guid = 0;
|
| 14076 |
+
this.local = 0;
|
| 14077 |
+
this.props = {};
|
| 14078 |
+
this.merged = {};
|
| 14079 |
+
this.animations = {};
|
| 14080 |
+
this.interpolations = {};
|
| 14081 |
+
this.values = {};
|
| 14082 |
+
this.configs = [];
|
| 14083 |
+
this.listeners = [];
|
| 14084 |
+
this.queue = [];
|
| 14085 |
+
this.localQueue = void 0;
|
| 14086 |
+
|
| 14087 |
+
this.getValues = function () {
|
| 14088 |
+
return _this.interpolations;
|
| 14089 |
+
};
|
| 14090 |
+
|
| 14091 |
+
this.id = G++;
|
| 14092 |
+
}
|
| 14093 |
+
/** update(props)
|
| 14094 |
+
* This function filters input props and creates an array of tasks which are executed in .start()
|
| 14095 |
+
* Each task is allowed to carry a delay, which means it can execute asnychroneously */
|
| 14096 |
+
|
| 14097 |
+
|
| 14098 |
+
var _proto = Controller.prototype;
|
| 14099 |
+
|
| 14100 |
+
_proto.update = function update$$1(args) {
|
| 14101 |
+
//this._id = n + this.id
|
| 14102 |
+
if (!args) return this; // Extract delay and the to-prop from props
|
| 14103 |
+
|
| 14104 |
+
var _ref = interpolateTo(args),
|
| 14105 |
+
_ref$delay = _ref.delay,
|
| 14106 |
+
delay = _ref$delay === void 0 ? 0 : _ref$delay,
|
| 14107 |
+
to = _ref.to,
|
| 14108 |
+
props = _objectWithoutPropertiesLoose(_ref, ["delay", "to"]);
|
| 14109 |
+
|
| 14110 |
+
if (is.arr(to) || is.fun(to)) {
|
| 14111 |
+
// If config is either a function or an array queue it up as is
|
| 14112 |
+
this.queue.push(_extends({}, props, {
|
| 14113 |
+
delay: delay,
|
| 14114 |
+
to: to
|
| 14115 |
+
}));
|
| 14116 |
+
} else if (to) {
|
| 14117 |
+
// Otherwise go through each key since it could be delayed individually
|
| 14118 |
+
var ops = {};
|
| 14119 |
+
Object.entries(to).forEach(function (_ref2) {
|
| 14120 |
+
var _to;
|
| 14121 |
+
|
| 14122 |
+
var k = _ref2[0],
|
| 14123 |
+
v = _ref2[1];
|
| 14124 |
+
|
| 14125 |
+
// Fetch delay and create an entry, consisting of the to-props, the delay, and basic props
|
| 14126 |
+
var entry = _extends({
|
| 14127 |
+
to: (_to = {}, _to[k] = v, _to),
|
| 14128 |
+
delay: callProp(delay, k)
|
| 14129 |
+
}, props);
|
| 14130 |
+
|
| 14131 |
+
var previous = ops[entry.delay] && ops[entry.delay].to;
|
| 14132 |
+
ops[entry.delay] = _extends({}, ops[entry.delay], entry, {
|
| 14133 |
+
to: _extends({}, previous, entry.to)
|
| 14134 |
+
});
|
| 14135 |
+
});
|
| 14136 |
+
this.queue = Object.values(ops);
|
| 14137 |
+
} // Sort queue, so that async calls go last
|
| 14138 |
+
|
| 14139 |
+
|
| 14140 |
+
this.queue = this.queue.sort(function (a, b) {
|
| 14141 |
+
return a.delay - b.delay;
|
| 14142 |
+
}); // Diff the reduced props immediately (they'll contain the from-prop and some config)
|
| 14143 |
+
|
| 14144 |
+
this.diff(props);
|
| 14145 |
+
return this;
|
| 14146 |
+
}
|
| 14147 |
+
/** start(onEnd)
|
| 14148 |
+
* This function either executes a queue, if present, or starts the frameloop, which animates */
|
| 14149 |
+
;
|
| 14150 |
+
|
| 14151 |
+
_proto.start = function start$$1(onEnd) {
|
| 14152 |
+
var _this2 = this;
|
| 14153 |
+
|
| 14154 |
+
// If a queue is present we must excecute it
|
| 14155 |
+
if (this.queue.length) {
|
| 14156 |
+
this.idle = false; // Updates can interrupt trailing queues, in that case we just merge values
|
| 14157 |
+
|
| 14158 |
+
if (this.localQueue) {
|
| 14159 |
+
this.localQueue.forEach(function (_ref3) {
|
| 14160 |
+
var _ref3$from = _ref3.from,
|
| 14161 |
+
from = _ref3$from === void 0 ? {} : _ref3$from,
|
| 14162 |
+
_ref3$to = _ref3.to,
|
| 14163 |
+
to = _ref3$to === void 0 ? {} : _ref3$to;
|
| 14164 |
+
if (is.obj(from)) _this2.merged = _extends({}, from, _this2.merged);
|
| 14165 |
+
if (is.obj(to)) _this2.merged = _extends({}, _this2.merged, to);
|
| 14166 |
+
});
|
| 14167 |
+
} // The guid helps us tracking frames, a new queue over an old one means an override
|
| 14168 |
+
// We discard async calls in that caseÍ
|
| 14169 |
+
|
| 14170 |
+
|
| 14171 |
+
var local = this.local = ++this.guid;
|
| 14172 |
+
var queue = this.localQueue = this.queue;
|
| 14173 |
+
this.queue = []; // Go through each entry and execute it
|
| 14174 |
+
|
| 14175 |
+
queue.forEach(function (_ref4, index) {
|
| 14176 |
+
var delay = _ref4.delay,
|
| 14177 |
+
props = _objectWithoutPropertiesLoose(_ref4, ["delay"]);
|
| 14178 |
+
|
| 14179 |
+
var cb = function cb(finished) {
|
| 14180 |
+
if (index === queue.length - 1 && local === _this2.guid && finished) {
|
| 14181 |
+
_this2.idle = true;
|
| 14182 |
+
if (_this2.props.onRest) _this2.props.onRest(_this2.merged);
|
| 14183 |
+
}
|
| 14184 |
+
|
| 14185 |
+
if (onEnd) onEnd();
|
| 14186 |
+
}; // Entries can be delayed, ansyc or immediate
|
| 14187 |
+
|
| 14188 |
+
|
| 14189 |
+
var async = is.arr(props.to) || is.fun(props.to);
|
| 14190 |
+
|
| 14191 |
+
if (delay) {
|
| 14192 |
+
setTimeout(function () {
|
| 14193 |
+
if (local === _this2.guid) {
|
| 14194 |
+
if (async) _this2.runAsync(props, cb);else _this2.diff(props).start(cb);
|
| 14195 |
+
}
|
| 14196 |
+
}, delay);
|
| 14197 |
+
} else if (async) _this2.runAsync(props, cb);else _this2.diff(props).start(cb);
|
| 14198 |
+
});
|
| 14199 |
+
} // Otherwise we kick of the frameloop
|
| 14200 |
+
else {
|
| 14201 |
+
if (is.fun(onEnd)) this.listeners.push(onEnd);
|
| 14202 |
+
if (this.props.onStart) this.props.onStart();
|
| 14203 |
+
|
| 14204 |
+
start(this);
|
| 14205 |
+
}
|
| 14206 |
+
|
| 14207 |
+
return this;
|
| 14208 |
+
};
|
| 14209 |
+
|
| 14210 |
+
_proto.stop = function stop$$1(finished) {
|
| 14211 |
+
this.listeners.forEach(function (onEnd) {
|
| 14212 |
+
return onEnd(finished);
|
| 14213 |
+
});
|
| 14214 |
+
this.listeners = [];
|
| 14215 |
+
return this;
|
| 14216 |
+
}
|
| 14217 |
+
/** Pause sets onEnd listeners free, but also removes the controller from the frameloop */
|
| 14218 |
+
;
|
| 14219 |
+
|
| 14220 |
+
_proto.pause = function pause(finished) {
|
| 14221 |
+
this.stop(true);
|
| 14222 |
+
if (finished) stop(this);
|
| 14223 |
+
return this;
|
| 14224 |
+
};
|
| 14225 |
+
|
| 14226 |
+
_proto.runAsync = function runAsync(_ref5, onEnd) {
|
| 14227 |
+
var _this3 = this;
|
| 14228 |
+
|
| 14229 |
+
var delay = _ref5.delay,
|
| 14230 |
+
props = _objectWithoutPropertiesLoose(_ref5, ["delay"]);
|
| 14231 |
+
|
| 14232 |
+
var local = this.local; // If "to" is either a function or an array it will be processed async, therefor "to" should be empty right now
|
| 14233 |
+
// If the view relies on certain values "from" has to be present
|
| 14234 |
+
|
| 14235 |
+
var queue = Promise.resolve(undefined);
|
| 14236 |
+
|
| 14237 |
+
if (is.arr(props.to)) {
|
| 14238 |
+
var _loop = function _loop(i) {
|
| 14239 |
+
var index = i;
|
| 14240 |
+
|
| 14241 |
+
var fresh = _extends({}, props, interpolateTo(props.to[index]));
|
| 14242 |
+
|
| 14243 |
+
if (is.arr(fresh.config)) fresh.config = fresh.config[index];
|
| 14244 |
+
queue = queue.then(function () {
|
| 14245 |
+
//this.stop()
|
| 14246 |
+
if (local === _this3.guid) return new Promise(function (r) {
|
| 14247 |
+
return _this3.diff(fresh).start(r);
|
| 14248 |
+
});
|
| 14249 |
+
});
|
| 14250 |
+
};
|
| 14251 |
+
|
| 14252 |
+
for (var i = 0; i < props.to.length; i++) {
|
| 14253 |
+
_loop(i);
|
| 14254 |
+
}
|
| 14255 |
+
} else if (is.fun(props.to)) {
|
| 14256 |
+
var index = 0;
|
| 14257 |
+
var last;
|
| 14258 |
+
queue = queue.then(function () {
|
| 14259 |
+
return props.to( // next(props)
|
| 14260 |
+
function (p) {
|
| 14261 |
+
var fresh = _extends({}, props, interpolateTo(p));
|
| 14262 |
+
|
| 14263 |
+
if (is.arr(fresh.config)) fresh.config = fresh.config[index];
|
| 14264 |
+
index++; //this.stop()
|
| 14265 |
+
|
| 14266 |
+
if (local === _this3.guid) return last = new Promise(function (r) {
|
| 14267 |
+
return _this3.diff(fresh).start(r);
|
| 14268 |
+
});
|
| 14269 |
+
return;
|
| 14270 |
+
}, // cancel()
|
| 14271 |
+
function (finished) {
|
| 14272 |
+
if (finished === void 0) {
|
| 14273 |
+
finished = true;
|
| 14274 |
+
}
|
| 14275 |
+
|
| 14276 |
+
return _this3.stop(finished);
|
| 14277 |
+
}).then(function () {
|
| 14278 |
+
return last;
|
| 14279 |
+
});
|
| 14280 |
+
});
|
| 14281 |
+
}
|
| 14282 |
+
|
| 14283 |
+
queue.then(onEnd);
|
| 14284 |
+
};
|
| 14285 |
+
|
| 14286 |
+
_proto.diff = function diff(props) {
|
| 14287 |
+
var _this4 = this;
|
| 14288 |
+
|
| 14289 |
+
this.props = _extends({}, this.props, props);
|
| 14290 |
+
var _this$props = this.props,
|
| 14291 |
+
_this$props$from = _this$props.from,
|
| 14292 |
+
from = _this$props$from === void 0 ? {} : _this$props$from,
|
| 14293 |
+
_this$props$to = _this$props.to,
|
| 14294 |
+
to = _this$props$to === void 0 ? {} : _this$props$to,
|
| 14295 |
+
_this$props$config = _this$props.config,
|
| 14296 |
+
config = _this$props$config === void 0 ? {} : _this$props$config,
|
| 14297 |
+
reverse = _this$props.reverse,
|
| 14298 |
+
attach = _this$props.attach,
|
| 14299 |
+
reset = _this$props.reset,
|
| 14300 |
+
immediate = _this$props.immediate; // Reverse values when requested
|
| 14301 |
+
|
| 14302 |
+
if (reverse) {
|
| 14303 |
+
var _ref6 = [to, from];
|
| 14304 |
+
from = _ref6[0];
|
| 14305 |
+
to = _ref6[1];
|
| 14306 |
+
} // This will collect all props that were ever set, reset merged props when necessary
|
| 14307 |
+
|
| 14308 |
+
|
| 14309 |
+
this.merged = _extends({}, from, this.merged, to);
|
| 14310 |
+
this.hasChanged = false; // Attachment handling, trailed springs can "attach" themselves to a previous spring
|
| 14311 |
+
|
| 14312 |
+
var target = attach && attach(this); // Reduces input { name: value } pairs into animated values
|
| 14313 |
+
|
| 14314 |
+
this.animations = Object.entries(this.merged).reduce(function (acc, _ref7) {
|
| 14315 |
+
var name = _ref7[0],
|
| 14316 |
+
value = _ref7[1];
|
| 14317 |
+
// Issue cached entries, except on reset
|
| 14318 |
+
var entry = acc[name] || {}; // Figure out what the value is supposed to be
|
| 14319 |
+
|
| 14320 |
+
var isNumber = is.num(value);
|
| 14321 |
+
var isString = is.str(value) && !value.startsWith('#') && !/\d/.test(value) && !colorNames[value];
|
| 14322 |
+
var isArray = is.arr(value);
|
| 14323 |
+
var isInterpolation = !isNumber && !isArray && !isString;
|
| 14324 |
+
var fromValue = !is.und(from[name]) ? from[name] : value;
|
| 14325 |
+
var toValue = isNumber || isArray ? value : isString ? value : 1;
|
| 14326 |
+
var toConfig = callProp(config, name);
|
| 14327 |
+
if (target) toValue = target.animations[name].parent;
|
| 14328 |
+
var parent = entry.parent,
|
| 14329 |
+
interpolation$$1 = entry.interpolation,
|
| 14330 |
+
toValues = toArray(target ? toValue.getPayload() : toValue),
|
| 14331 |
+
animatedValues;
|
| 14332 |
+
var newValue = value;
|
| 14333 |
+
if (isInterpolation) newValue = interpolation({
|
| 14334 |
+
range: [0, 1],
|
| 14335 |
+
output: [value, value]
|
| 14336 |
+
})(1);
|
| 14337 |
+
var currentValue = interpolation$$1 && interpolation$$1.getValue(); // Change detection flags
|
| 14338 |
+
|
| 14339 |
+
var isFirst = is.und(parent);
|
| 14340 |
+
var isActive = !isFirst && entry.animatedValues.some(function (v) {
|
| 14341 |
+
return !v.done;
|
| 14342 |
+
});
|
| 14343 |
+
var currentValueDiffersFromGoal = !is.equ(newValue, currentValue);
|
| 14344 |
+
var hasNewGoal = !is.equ(newValue, entry.previous);
|
| 14345 |
+
var hasNewConfig = !is.equ(toConfig, entry.config); // Change animation props when props indicate a new goal (new value differs from previous one)
|
| 14346 |
+
// and current values differ from it. Config changes trigger a new update as well (though probably shouldn't?)
|
| 14347 |
+
|
| 14348 |
+
if (reset || hasNewGoal && currentValueDiffersFromGoal || hasNewConfig) {
|
| 14349 |
+
var _extends2;
|
| 14350 |
+
|
| 14351 |
+
// Convert regular values into animated values, ALWAYS re-use if possible
|
| 14352 |
+
if (isNumber || isString) parent = interpolation$$1 = entry.parent || new AnimatedValue(fromValue);else if (isArray) parent = interpolation$$1 = entry.parent || new AnimatedValueArray(fromValue);else if (isInterpolation) {
|
| 14353 |
+
var prev = entry.interpolation && entry.interpolation.calc(entry.parent.value);
|
| 14354 |
+
prev = prev !== void 0 && !reset ? prev : fromValue;
|
| 14355 |
+
|
| 14356 |
+
if (entry.parent) {
|
| 14357 |
+
parent = entry.parent;
|
| 14358 |
+
parent.setValue(0, false);
|
| 14359 |
+
} else parent = new AnimatedValue(0);
|
| 14360 |
+
|
| 14361 |
+
var range = {
|
| 14362 |
+
output: [prev, value]
|
| 14363 |
+
};
|
| 14364 |
+
|
| 14365 |
+
if (entry.interpolation) {
|
| 14366 |
+
interpolation$$1 = entry.interpolation;
|
| 14367 |
+
entry.interpolation.updateConfig(range);
|
| 14368 |
+
} else interpolation$$1 = parent.interpolate(range);
|
| 14369 |
+
}
|
| 14370 |
+
toValues = toArray(target ? toValue.getPayload() : toValue);
|
| 14371 |
+
animatedValues = toArray(parent.getPayload());
|
| 14372 |
+
if (reset && !isInterpolation) parent.setValue(fromValue, false);
|
| 14373 |
+
_this4.hasChanged = true; // Reset animated values
|
| 14374 |
+
|
| 14375 |
+
animatedValues.forEach(function (value) {
|
| 14376 |
+
value.startPosition = value.value;
|
| 14377 |
+
value.lastPosition = value.value;
|
| 14378 |
+
value.lastVelocity = isActive ? value.lastVelocity : undefined;
|
| 14379 |
+
value.lastTime = isActive ? value.lastTime : undefined;
|
| 14380 |
+
value.startTime = now();
|
| 14381 |
+
value.done = false;
|
| 14382 |
+
value.animatedStyles.clear();
|
| 14383 |
+
}); // Set immediate values
|
| 14384 |
+
|
| 14385 |
+
if (callProp(immediate, name)) {
|
| 14386 |
+
parent.setValue(isInterpolation ? toValue : value, false);
|
| 14387 |
+
}
|
| 14388 |
+
|
| 14389 |
+
return _extends({}, acc, (_extends2 = {}, _extends2[name] = _extends({}, entry, {
|
| 14390 |
+
name: name,
|
| 14391 |
+
parent: parent,
|
| 14392 |
+
interpolation: interpolation$$1,
|
| 14393 |
+
animatedValues: animatedValues,
|
| 14394 |
+
toValues: toValues,
|
| 14395 |
+
previous: newValue,
|
| 14396 |
+
config: toConfig,
|
| 14397 |
+
fromValues: toArray(parent.getValue()),
|
| 14398 |
+
immediate: callProp(immediate, name),
|
| 14399 |
+
initialVelocity: withDefault(toConfig.velocity, 0),
|
| 14400 |
+
clamp: withDefault(toConfig.clamp, false),
|
| 14401 |
+
precision: withDefault(toConfig.precision, 0.01),
|
| 14402 |
+
tension: withDefault(toConfig.tension, 170),
|
| 14403 |
+
friction: withDefault(toConfig.friction, 26),
|
| 14404 |
+
mass: withDefault(toConfig.mass, 1),
|
| 14405 |
+
duration: toConfig.duration,
|
| 14406 |
+
easing: withDefault(toConfig.easing, function (t) {
|
| 14407 |
+
return t;
|
| 14408 |
+
}),
|
| 14409 |
+
decay: toConfig.decay
|
| 14410 |
+
}), _extends2));
|
| 14411 |
+
} else {
|
| 14412 |
+
if (!currentValueDiffersFromGoal) {
|
| 14413 |
+
var _extends3;
|
| 14414 |
+
|
| 14415 |
+
// So ... the current target value (newValue) appears to be different from the previous value,
|
| 14416 |
+
// which normally constitutes an update, but the actual value (currentValue) matches the target!
|
| 14417 |
+
// In order to resolve this without causing an animation update we silently flag the animation as done,
|
| 14418 |
+
// which it technically is. Interpolations also needs a config update with their target set to 1.
|
| 14419 |
+
if (isInterpolation) {
|
| 14420 |
+
parent.setValue(1, false);
|
| 14421 |
+
interpolation$$1.updateConfig({
|
| 14422 |
+
output: [newValue, newValue]
|
| 14423 |
+
});
|
| 14424 |
+
}
|
| 14425 |
+
|
| 14426 |
+
parent.done = true;
|
| 14427 |
+
_this4.hasChanged = true;
|
| 14428 |
+
return _extends({}, acc, (_extends3 = {}, _extends3[name] = _extends({}, acc[name], {
|
| 14429 |
+
previous: newValue
|
| 14430 |
+
}), _extends3));
|
| 14431 |
+
}
|
| 14432 |
+
|
| 14433 |
+
return acc;
|
| 14434 |
+
}
|
| 14435 |
+
}, this.animations);
|
| 14436 |
+
|
| 14437 |
+
if (this.hasChanged) {
|
| 14438 |
+
// Make animations available to frameloop
|
| 14439 |
+
this.configs = Object.values(this.animations);
|
| 14440 |
+
this.values = {};
|
| 14441 |
+
this.interpolations = {};
|
| 14442 |
+
|
| 14443 |
+
for (var key in this.animations) {
|
| 14444 |
+
this.interpolations[key] = this.animations[key].interpolation;
|
| 14445 |
+
this.values[key] = this.animations[key].interpolation.getValue();
|
| 14446 |
+
}
|
| 14447 |
+
}
|
| 14448 |
+
|
| 14449 |
+
return this;
|
| 14450 |
+
};
|
| 14451 |
+
|
| 14452 |
+
_proto.destroy = function destroy() {
|
| 14453 |
+
this.stop();
|
| 14454 |
+
this.props = {};
|
| 14455 |
+
this.merged = {};
|
| 14456 |
+
this.animations = {};
|
| 14457 |
+
this.interpolations = {};
|
| 14458 |
+
this.values = {};
|
| 14459 |
+
this.configs = [];
|
| 14460 |
+
this.local = 0;
|
| 14461 |
+
};
|
| 14462 |
+
|
| 14463 |
+
return Controller;
|
| 14464 |
+
}();
|
| 14465 |
+
|
| 14466 |
+
/** API
|
| 14467 |
+
* const props = useSprings(number, [{ ... }, { ... }, ...])
|
| 14468 |
+
* const [props, set] = useSprings(number, (i, controller) => ({ ... }))
|
| 14469 |
+
*/
|
| 14470 |
+
|
| 14471 |
+
var useSprings = function useSprings(length, props) {
|
| 14472 |
+
var mounted = React.useRef(false);
|
| 14473 |
+
var ctrl = React.useRef();
|
| 14474 |
+
var isFn = is.fun(props); // The controller maintains the animation values, starts and stops animations
|
| 14475 |
+
|
| 14476 |
+
var _useMemo = React.useMemo(function () {
|
| 14477 |
+
// Remove old controllers
|
| 14478 |
+
if (ctrl.current) {
|
| 14479 |
+
ctrl.current.map(function (c) {
|
| 14480 |
+
return c.destroy();
|
| 14481 |
+
});
|
| 14482 |
+
ctrl.current = undefined;
|
| 14483 |
+
}
|
| 14484 |
+
|
| 14485 |
+
var ref;
|
| 14486 |
+
return [new Array(length).fill().map(function (_, i) {
|
| 14487 |
+
var ctrl = new Controller();
|
| 14488 |
+
var newProps = isFn ? callProp(props, i, ctrl) : props[i];
|
| 14489 |
+
if (i === 0) ref = newProps.ref;
|
| 14490 |
+
ctrl.update(newProps);
|
| 14491 |
+
if (!ref) ctrl.start();
|
| 14492 |
+
return ctrl;
|
| 14493 |
+
}), ref];
|
| 14494 |
+
}, [length]),
|
| 14495 |
+
controllers = _useMemo[0],
|
| 14496 |
+
ref = _useMemo[1];
|
| 14497 |
+
|
| 14498 |
+
ctrl.current = controllers; // The hooks reference api gets defined here ...
|
| 14499 |
+
|
| 14500 |
+
var api = React.useImperativeHandle(ref, function () {
|
| 14501 |
+
return {
|
| 14502 |
+
start: function start() {
|
| 14503 |
+
return Promise.all(ctrl.current.map(function (c) {
|
| 14504 |
+
return new Promise(function (r) {
|
| 14505 |
+
return c.start(r);
|
| 14506 |
+
});
|
| 14507 |
+
}));
|
| 14508 |
+
},
|
| 14509 |
+
stop: function stop(finished) {
|
| 14510 |
+
return ctrl.current.forEach(function (c) {
|
| 14511 |
+
return c.stop(finished);
|
| 14512 |
+
});
|
| 14513 |
+
},
|
| 14514 |
+
|
| 14515 |
+
get controllers() {
|
| 14516 |
+
return ctrl.current;
|
| 14517 |
+
}
|
| 14518 |
+
|
| 14519 |
+
};
|
| 14520 |
+
}); // This function updates the controllers
|
| 14521 |
+
|
| 14522 |
+
var updateCtrl = React.useMemo(function () {
|
| 14523 |
+
return function (updateProps) {
|
| 14524 |
+
return ctrl.current.map(function (c, i) {
|
| 14525 |
+
c.update(isFn ? callProp(updateProps, i, c) : updateProps[i]);
|
| 14526 |
+
if (!ref) c.start();
|
| 14527 |
+
});
|
| 14528 |
+
};
|
| 14529 |
+
}, [length]); // Update controller if props aren't functional
|
| 14530 |
+
|
| 14531 |
+
React.useEffect(function () {
|
| 14532 |
+
if (mounted.current) {
|
| 14533 |
+
if (!isFn) updateCtrl(props);
|
| 14534 |
+
} else if (!ref) ctrl.current.forEach(function (c) {
|
| 14535 |
+
return c.start();
|
| 14536 |
+
});
|
| 14537 |
+
}); // Update mounted flag and destroy controller on unmount
|
| 14538 |
+
|
| 14539 |
+
React.useEffect(function () {
|
| 14540 |
+
return mounted.current = true, function () {
|
| 14541 |
+
return ctrl.current.forEach(function (c) {
|
| 14542 |
+
return c.destroy();
|
| 14543 |
+
});
|
| 14544 |
+
};
|
| 14545 |
+
}, []); // Return animated props, or, anim-props + the update-setter above
|
| 14546 |
+
|
| 14547 |
+
var propValues = ctrl.current.map(function (c) {
|
| 14548 |
+
return c.getValues();
|
| 14549 |
+
});
|
| 14550 |
+
return isFn ? [propValues, updateCtrl, function (finished) {
|
| 14551 |
+
return ctrl.current.forEach(function (c) {
|
| 14552 |
+
return c.pause(finished);
|
| 14553 |
+
});
|
| 14554 |
+
}] : propValues;
|
| 14555 |
+
};
|
| 14556 |
+
|
| 14557 |
+
/** API
|
| 14558 |
+
* const props = useSpring({ ... })
|
| 14559 |
+
* const [props, set] = useSpring(() => ({ ... }))
|
| 14560 |
+
*/
|
| 14561 |
+
|
| 14562 |
+
var useSpring = function useSpring(props) {
|
| 14563 |
+
var isFn = is.fun(props);
|
| 14564 |
+
|
| 14565 |
+
var _useSprings = useSprings(1, isFn ? props : [props]),
|
| 14566 |
+
result = _useSprings[0],
|
| 14567 |
+
set = _useSprings[1],
|
| 14568 |
+
pause = _useSprings[2];
|
| 14569 |
+
|
| 14570 |
+
return isFn ? [result[0], set, pause] : result;
|
| 14571 |
+
};
|
| 14572 |
+
|
| 14573 |
+
/** API
|
| 14574 |
+
* const trails = useTrail(number, { ... })
|
| 14575 |
+
* const [trails, set] = useTrail(number, () => ({ ... }))
|
| 14576 |
+
*/
|
| 14577 |
+
|
| 14578 |
+
var useTrail = function useTrail(length, props) {
|
| 14579 |
+
var mounted = React.useRef(false);
|
| 14580 |
+
var isFn = is.fun(props);
|
| 14581 |
+
var updateProps = callProp(props);
|
| 14582 |
+
var instances = React.useRef();
|
| 14583 |
+
|
| 14584 |
+
var _useSprings = useSprings(length, function (i, ctrl) {
|
| 14585 |
+
if (i === 0) instances.current = [];
|
| 14586 |
+
instances.current.push(ctrl);
|
| 14587 |
+
return _extends({}, updateProps, {
|
| 14588 |
+
config: callProp(updateProps.config, i),
|
| 14589 |
+
attach: i > 0 && function () {
|
| 14590 |
+
return instances.current[i - 1];
|
| 14591 |
+
}
|
| 14592 |
+
});
|
| 14593 |
+
}),
|
| 14594 |
+
result = _useSprings[0],
|
| 14595 |
+
set = _useSprings[1],
|
| 14596 |
+
pause = _useSprings[2]; // Set up function to update controller
|
| 14597 |
+
|
| 14598 |
+
|
| 14599 |
+
var updateCtrl = React.useMemo(function () {
|
| 14600 |
+
return function (props) {
|
| 14601 |
+
return set(function (i, ctrl) {
|
| 14602 |
+
var last = props.reverse ? i === 0 : length - 1 === i;
|
| 14603 |
+
var attachIdx = props.reverse ? i + 1 : i - 1;
|
| 14604 |
+
var attachController = instances.current[attachIdx];
|
| 14605 |
+
return _extends({}, props, {
|
| 14606 |
+
config: callProp(props.config || updateProps.config, i),
|
| 14607 |
+
attach: attachController && function () {
|
| 14608 |
+
return attachController;
|
| 14609 |
+
}
|
| 14610 |
+
});
|
| 14611 |
+
});
|
| 14612 |
+
};
|
| 14613 |
+
}, [length, updateProps.reverse]); // Update controller if props aren't functional
|
| 14614 |
+
|
| 14615 |
+
React.useEffect(function () {
|
| 14616 |
+
return void (mounted.current && !isFn && updateCtrl(props));
|
| 14617 |
+
}); // Update mounted flag and destroy controller on unmount
|
| 14618 |
+
|
| 14619 |
+
React.useEffect(function () {
|
| 14620 |
+
return void (mounted.current = true);
|
| 14621 |
+
}, []);
|
| 14622 |
+
return isFn ? [result, updateCtrl, pause] : result;
|
| 14623 |
+
};
|
| 14624 |
+
|
| 14625 |
+
/** API
|
| 14626 |
+
* const transitions = useTransition(items, itemKeys, { ... })
|
| 14627 |
+
* const [transitions, update] = useTransition(items, itemKeys, () => ({ ... }))
|
| 14628 |
+
*/
|
| 14629 |
+
|
| 14630 |
+
var guid = 0;
|
| 14631 |
+
var ENTER = 'enter';
|
| 14632 |
+
var LEAVE = 'leave';
|
| 14633 |
+
var UPDATE = 'update';
|
| 14634 |
+
|
| 14635 |
+
var mapKeys = function mapKeys(items, keys) {
|
| 14636 |
+
return (typeof keys === 'function' ? items.map(keys) : toArray(keys)).map(String);
|
| 14637 |
+
};
|
| 14638 |
+
|
| 14639 |
+
var get = function get(props) {
|
| 14640 |
+
var items = props.items,
|
| 14641 |
+
_props$keys = props.keys,
|
| 14642 |
+
keys = _props$keys === void 0 ? function (item) {
|
| 14643 |
+
return item;
|
| 14644 |
+
} : _props$keys,
|
| 14645 |
+
rest = _objectWithoutPropertiesLoose(props, ["items", "keys"]);
|
| 14646 |
+
|
| 14647 |
+
items = toArray(items !== void 0 ? items : null);
|
| 14648 |
+
return _extends({
|
| 14649 |
+
items: items,
|
| 14650 |
+
keys: mapKeys(items, keys)
|
| 14651 |
+
}, rest);
|
| 14652 |
+
};
|
| 14653 |
+
|
| 14654 |
+
function useTransition(input, keyTransform, config) {
|
| 14655 |
+
var props = _extends({
|
| 14656 |
+
items: input,
|
| 14657 |
+
keys: keyTransform || function (i) {
|
| 14658 |
+
return i;
|
| 14659 |
+
}
|
| 14660 |
+
}, config);
|
| 14661 |
+
|
| 14662 |
+
var _get = get(props),
|
| 14663 |
+
_get$lazy = _get.lazy,
|
| 14664 |
+
lazy = _get$lazy === void 0 ? false : _get$lazy,
|
| 14665 |
+
_get$unique = _get.unique,
|
| 14666 |
+
_get$reset = _get.reset,
|
| 14667 |
+
reset = _get$reset === void 0 ? false : _get$reset,
|
| 14668 |
+
enter = _get.enter,
|
| 14669 |
+
leave = _get.leave,
|
| 14670 |
+
update = _get.update,
|
| 14671 |
+
onDestroyed = _get.onDestroyed,
|
| 14672 |
+
keys = _get.keys,
|
| 14673 |
+
items = _get.items,
|
| 14674 |
+
onFrame = _get.onFrame,
|
| 14675 |
+
_onRest = _get.onRest,
|
| 14676 |
+
onStart = _get.onStart,
|
| 14677 |
+
ref = _get.ref,
|
| 14678 |
+
extra = _objectWithoutPropertiesLoose(_get, ["lazy", "unique", "reset", "enter", "leave", "update", "onDestroyed", "keys", "items", "onFrame", "onRest", "onStart", "ref"]);
|
| 14679 |
+
|
| 14680 |
+
var forceUpdate = useForceUpdate();
|
| 14681 |
+
var mounted = React.useRef(false);
|
| 14682 |
+
var state = React.useRef({
|
| 14683 |
+
mounted: false,
|
| 14684 |
+
first: true,
|
| 14685 |
+
deleted: [],
|
| 14686 |
+
current: {},
|
| 14687 |
+
transitions: [],
|
| 14688 |
+
prevProps: {},
|
| 14689 |
+
paused: !!props.ref,
|
| 14690 |
+
instances: !mounted.current && new Map(),
|
| 14691 |
+
forceUpdate: forceUpdate
|
| 14692 |
+
});
|
| 14693 |
+
React.useImperativeHandle(props.ref, function () {
|
| 14694 |
+
return {
|
| 14695 |
+
start: function start() {
|
| 14696 |
+
return Promise.all(Array.from(state.current.instances).map(function (_ref) {
|
| 14697 |
+
var c = _ref[1];
|
| 14698 |
+
return new Promise(function (r) {
|
| 14699 |
+
return c.start(r);
|
| 14700 |
+
});
|
| 14701 |
+
}));
|
| 14702 |
+
},
|
| 14703 |
+
stop: function stop(finished) {
|
| 14704 |
+
return Array.from(state.current.instances).forEach(function (_ref2) {
|
| 14705 |
+
var c = _ref2[1];
|
| 14706 |
+
return c.stop(finished);
|
| 14707 |
+
});
|
| 14708 |
+
},
|
| 14709 |
+
|
| 14710 |
+
get controllers() {
|
| 14711 |
+
return Array.from(state.current.instances).map(function (_ref3) {
|
| 14712 |
+
var c = _ref3[1];
|
| 14713 |
+
return c;
|
| 14714 |
+
});
|
| 14715 |
+
}
|
| 14716 |
+
|
| 14717 |
+
};
|
| 14718 |
+
}); // Update state
|
| 14719 |
+
|
| 14720 |
+
state.current = diffItems(state.current, props);
|
| 14721 |
+
|
| 14722 |
+
if (state.current.changed) {
|
| 14723 |
+
// Update state
|
| 14724 |
+
state.current.transitions.forEach(function (transition) {
|
| 14725 |
+
var slot = transition.slot,
|
| 14726 |
+
from = transition.from,
|
| 14727 |
+
to = transition.to,
|
| 14728 |
+
config = transition.config,
|
| 14729 |
+
trail = transition.trail,
|
| 14730 |
+
key = transition.key,
|
| 14731 |
+
item = transition.item;
|
| 14732 |
+
if (!state.current.instances.has(key)) state.current.instances.set(key, new Controller()); // update the map object
|
| 14733 |
+
|
| 14734 |
+
var ctrl = state.current.instances.get(key);
|
| 14735 |
+
|
| 14736 |
+
var newProps = _extends({}, extra, {
|
| 14737 |
+
to: to,
|
| 14738 |
+
from: from,
|
| 14739 |
+
config: config,
|
| 14740 |
+
ref: ref,
|
| 14741 |
+
onRest: function onRest(values) {
|
| 14742 |
+
if (state.current.mounted) {
|
| 14743 |
+
if (transition.destroyed) {
|
| 14744 |
+
// If no ref is given delete destroyed items immediately
|
| 14745 |
+
if (!ref && !lazy) cleanUp(state, key);
|
| 14746 |
+
if (onDestroyed) onDestroyed(item);
|
| 14747 |
+
} // A transition comes to rest once all its springs conclude
|
| 14748 |
+
|
| 14749 |
+
|
| 14750 |
+
var curInstances = Array.from(state.current.instances);
|
| 14751 |
+
var active = curInstances.some(function (_ref4) {
|
| 14752 |
+
var c = _ref4[1];
|
| 14753 |
+
return !c.idle;
|
| 14754 |
+
});
|
| 14755 |
+
if (!active && (ref || lazy) && state.current.deleted.length > 0) cleanUp(state);
|
| 14756 |
+
if (_onRest) _onRest(item, slot, values);
|
| 14757 |
+
}
|
| 14758 |
+
},
|
| 14759 |
+
onStart: onStart && function () {
|
| 14760 |
+
return onStart(item, slot);
|
| 14761 |
+
},
|
| 14762 |
+
onFrame: onFrame && function (values) {
|
| 14763 |
+
return onFrame(item, slot, values);
|
| 14764 |
+
},
|
| 14765 |
+
delay: trail,
|
| 14766 |
+
reset: reset && slot === ENTER // Update controller
|
| 14767 |
+
|
| 14768 |
+
});
|
| 14769 |
+
|
| 14770 |
+
ctrl.update(newProps);
|
| 14771 |
+
if (!state.current.paused) ctrl.start();
|
| 14772 |
+
});
|
| 14773 |
+
}
|
| 14774 |
+
|
| 14775 |
+
React.useEffect(function () {
|
| 14776 |
+
state.current.mounted = mounted.current = true;
|
| 14777 |
+
return function () {
|
| 14778 |
+
state.current.mounted = mounted.current = false;
|
| 14779 |
+
Array.from(state.current.instances).map(function (_ref5) {
|
| 14780 |
+
var c = _ref5[1];
|
| 14781 |
+
return c.destroy();
|
| 14782 |
+
});
|
| 14783 |
+
state.current.instances.clear();
|
| 14784 |
+
};
|
| 14785 |
+
}, []);
|
| 14786 |
+
return state.current.transitions.map(function (_ref6) {
|
| 14787 |
+
var item = _ref6.item,
|
| 14788 |
+
slot = _ref6.slot,
|
| 14789 |
+
key = _ref6.key;
|
| 14790 |
+
return {
|
| 14791 |
+
item: item,
|
| 14792 |
+
key: key,
|
| 14793 |
+
state: slot,
|
| 14794 |
+
props: state.current.instances.get(key).getValues()
|
| 14795 |
+
};
|
| 14796 |
+
});
|
| 14797 |
+
}
|
| 14798 |
+
|
| 14799 |
+
function cleanUp(state, filterKey) {
|
| 14800 |
+
var deleted = state.current.deleted;
|
| 14801 |
+
|
| 14802 |
+
var _loop = function _loop() {
|
| 14803 |
+
if (_isArray) {
|
| 14804 |
+
if (_i >= _iterator.length) return "break";
|
| 14805 |
+
_ref8 = _iterator[_i++];
|
| 14806 |
+
} else {
|
| 14807 |
+
_i = _iterator.next();
|
| 14808 |
+
if (_i.done) return "break";
|
| 14809 |
+
_ref8 = _i.value;
|
| 14810 |
+
}
|
| 14811 |
+
|
| 14812 |
+
var _ref7 = _ref8;
|
| 14813 |
+
var key = _ref7.key;
|
| 14814 |
+
|
| 14815 |
+
var filter = function filter(t) {
|
| 14816 |
+
return t.key !== key;
|
| 14817 |
+
};
|
| 14818 |
+
|
| 14819 |
+
if (is.und(filterKey) || filterKey === key) {
|
| 14820 |
+
state.current.instances.delete(key);
|
| 14821 |
+
state.current.transitions = state.current.transitions.filter(filter);
|
| 14822 |
+
state.current.deleted = state.current.deleted.filter(filter);
|
| 14823 |
+
}
|
| 14824 |
+
};
|
| 14825 |
+
|
| 14826 |
+
for (var _iterator = deleted, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
|
| 14827 |
+
var _ref8;
|
| 14828 |
+
|
| 14829 |
+
var _ret = _loop();
|
| 14830 |
+
|
| 14831 |
+
if (_ret === "break") break;
|
| 14832 |
+
}
|
| 14833 |
+
|
| 14834 |
+
state.current.forceUpdate();
|
| 14835 |
+
}
|
| 14836 |
+
|
| 14837 |
+
function diffItems(_ref9, props) {
|
| 14838 |
+
var first = _ref9.first,
|
| 14839 |
+
prevProps = _ref9.prevProps,
|
| 14840 |
+
state = _objectWithoutPropertiesLoose(_ref9, ["first", "prevProps"]);
|
| 14841 |
+
|
| 14842 |
+
var _get2 = get(props),
|
| 14843 |
+
items = _get2.items,
|
| 14844 |
+
keys = _get2.keys,
|
| 14845 |
+
initial = _get2.initial,
|
| 14846 |
+
from = _get2.from,
|
| 14847 |
+
enter = _get2.enter,
|
| 14848 |
+
leave = _get2.leave,
|
| 14849 |
+
update = _get2.update,
|
| 14850 |
+
_get2$trail = _get2.trail,
|
| 14851 |
+
trail = _get2$trail === void 0 ? 0 : _get2$trail,
|
| 14852 |
+
unique = _get2.unique,
|
| 14853 |
+
config = _get2.config,
|
| 14854 |
+
_get2$order = _get2.order,
|
| 14855 |
+
order = _get2$order === void 0 ? [ENTER, LEAVE, UPDATE] : _get2$order;
|
| 14856 |
+
|
| 14857 |
+
var _get3 = get(prevProps),
|
| 14858 |
+
_keys = _get3.keys,
|
| 14859 |
+
_items = _get3.items;
|
| 14860 |
+
|
| 14861 |
+
var current = _extends({}, state.current);
|
| 14862 |
+
|
| 14863 |
+
var deleted = [].concat(state.deleted); // Compare next keys with current keys
|
| 14864 |
+
|
| 14865 |
+
var currentKeys = Object.keys(current);
|
| 14866 |
+
var currentSet = new Set(currentKeys);
|
| 14867 |
+
var nextSet = new Set(keys);
|
| 14868 |
+
var added = keys.filter(function (item) {
|
| 14869 |
+
return !currentSet.has(item);
|
| 14870 |
+
});
|
| 14871 |
+
var removed = state.transitions.filter(function (item) {
|
| 14872 |
+
return !item.destroyed && !nextSet.has(item.originalKey);
|
| 14873 |
+
}).map(function (i) {
|
| 14874 |
+
return i.originalKey;
|
| 14875 |
+
});
|
| 14876 |
+
var updated = keys.filter(function (item) {
|
| 14877 |
+
return currentSet.has(item);
|
| 14878 |
+
});
|
| 14879 |
+
var delay = -trail;
|
| 14880 |
+
|
| 14881 |
+
while (order.length) {
|
| 14882 |
+
var changeType = order.shift();
|
| 14883 |
+
|
| 14884 |
+
switch (changeType) {
|
| 14885 |
+
case ENTER:
|
| 14886 |
+
{
|
| 14887 |
+
added.forEach(function (key, index) {
|
| 14888 |
+
// In unique mode, remove fading out transitions if their key comes in again
|
| 14889 |
+
if (unique && deleted.find(function (d) {
|
| 14890 |
return d.originalKey === key;
|
| 14891 |
})) deleted = deleted.filter(function (t) {
|
| 14892 |
return t.originalKey !== key;
|
| 14905 |
to: callProp(enter, item)
|
| 14906 |
};
|
| 14907 |
});
|
| 14908 |
+
break;
|
| 14909 |
+
}
|
| 14910 |
+
|
| 14911 |
+
case LEAVE:
|
| 14912 |
+
{
|
| 14913 |
+
removed.forEach(function (key) {
|
| 14914 |
+
var keyIndex = _keys.indexOf(key);
|
| 14915 |
+
|
| 14916 |
+
var item = _items[keyIndex];
|
| 14917 |
+
var slot = LEAVE;
|
| 14918 |
+
deleted.unshift(_extends({}, current[key], {
|
| 14919 |
+
slot: slot,
|
| 14920 |
+
destroyed: true,
|
| 14921 |
+
left: _keys[Math.max(0, keyIndex - 1)],
|
| 14922 |
+
right: _keys[Math.min(_keys.length, keyIndex + 1)],
|
| 14923 |
+
trail: delay = delay + trail,
|
| 14924 |
+
config: callProp(config, item, slot),
|
| 14925 |
+
to: callProp(leave, item)
|
| 14926 |
+
}));
|
| 14927 |
+
delete current[key];
|
| 14928 |
+
});
|
| 14929 |
+
break;
|
| 14930 |
+
}
|
| 14931 |
+
|
| 14932 |
+
case UPDATE:
|
| 14933 |
+
{
|
| 14934 |
+
updated.forEach(function (key) {
|
| 14935 |
+
var keyIndex = keys.indexOf(key);
|
| 14936 |
+
var item = items[keyIndex];
|
| 14937 |
+
var slot = UPDATE;
|
| 14938 |
+
current[key] = _extends({}, current[key], {
|
| 14939 |
+
item: item,
|
| 14940 |
+
slot: slot,
|
| 14941 |
+
trail: delay = delay + trail,
|
| 14942 |
+
config: callProp(config, item, slot),
|
| 14943 |
+
to: callProp(update, item)
|
| 14944 |
+
});
|
| 14945 |
+
});
|
| 14946 |
+
break;
|
| 14947 |
+
}
|
| 14948 |
+
}
|
| 14949 |
+
}
|
| 14950 |
+
|
| 14951 |
+
var out = keys.map(function (key) {
|
| 14952 |
+
return current[key];
|
| 14953 |
+
}); // This tries to restore order for deleted items by finding their last known siblings
|
| 14954 |
+
// only using the left sibling to keep order placement consistent for all deleted items
|
| 14955 |
+
|
| 14956 |
+
deleted.forEach(function (_ref10) {
|
| 14957 |
+
var left = _ref10.left,
|
| 14958 |
+
right = _ref10.right,
|
| 14959 |
+
item = _objectWithoutPropertiesLoose(_ref10, ["left", "right"]);
|
| 14960 |
+
|
| 14961 |
+
var pos; // Was it the element on the left, if yes, move there ...
|
| 14962 |
+
|
| 14963 |
+
if ((pos = out.findIndex(function (t) {
|
| 14964 |
+
return t.originalKey === left;
|
| 14965 |
+
})) !== -1) pos += 1; // And if nothing else helps, move it to the start ¯\_(ツ)_/¯
|
| 14966 |
+
|
| 14967 |
+
pos = Math.max(0, pos);
|
| 14968 |
+
out = [].concat(out.slice(0, pos), [item], out.slice(pos));
|
| 14969 |
+
});
|
| 14970 |
+
return _extends({}, state, {
|
| 14971 |
+
changed: added.length || removed.length || updated.length,
|
| 14972 |
+
first: first && added.length === 0,
|
| 14973 |
+
transitions: out,
|
| 14974 |
+
current: current,
|
| 14975 |
+
deleted: deleted,
|
| 14976 |
+
prevProps: props
|
| 14977 |
+
});
|
| 14978 |
+
}
|
| 14979 |
+
|
| 14980 |
+
var AnimatedStyle =
|
| 14981 |
+
/*#__PURE__*/
|
| 14982 |
+
function (_AnimatedObject) {
|
| 14983 |
+
_inheritsLoose(AnimatedStyle, _AnimatedObject);
|
| 14984 |
+
|
| 14985 |
+
function AnimatedStyle(style) {
|
| 14986 |
+
var _this;
|
| 14987 |
+
|
| 14988 |
+
if (style === void 0) {
|
| 14989 |
+
style = {};
|
| 14990 |
+
}
|
| 14991 |
+
|
| 14992 |
+
_this = _AnimatedObject.call(this) || this;
|
| 14993 |
+
|
| 14994 |
+
if (style.transform && !(style.transform instanceof Animated)) {
|
| 14995 |
+
style = applyAnimatedValues.transform(style);
|
| 14996 |
+
}
|
| 14997 |
+
|
| 14998 |
+
_this.payload = style;
|
| 14999 |
+
return _this;
|
| 15000 |
+
}
|
| 15001 |
+
|
| 15002 |
+
return AnimatedStyle;
|
| 15003 |
+
}(AnimatedObject);
|
| 15004 |
+
|
| 15005 |
+
// http://www.w3.org/TR/css3-color/#svg-color
|
| 15006 |
+
var colors = {
|
| 15007 |
+
transparent: 0x00000000,
|
| 15008 |
+
aliceblue: 0xf0f8ffff,
|
| 15009 |
+
antiquewhite: 0xfaebd7ff,
|
| 15010 |
+
aqua: 0x00ffffff,
|
| 15011 |
+
aquamarine: 0x7fffd4ff,
|
| 15012 |
+
azure: 0xf0ffffff,
|
| 15013 |
+
beige: 0xf5f5dcff,
|
| 15014 |
+
bisque: 0xffe4c4ff,
|
| 15015 |
+
black: 0x000000ff,
|
| 15016 |
+
blanchedalmond: 0xffebcdff,
|
| 15017 |
+
blue: 0x0000ffff,
|
| 15018 |
+
blueviolet: 0x8a2be2ff,
|
| 15019 |
+
brown: 0xa52a2aff,
|
| 15020 |
+
burlywood: 0xdeb887ff,
|
| 15021 |
+
burntsienna: 0xea7e5dff,
|
| 15022 |
+
cadetblue: 0x5f9ea0ff,
|
| 15023 |
+
chartreuse: 0x7fff00ff,
|
| 15024 |
+
chocolate: 0xd2691eff,
|
| 15025 |
+
coral: 0xff7f50ff,
|
| 15026 |
+
cornflowerblue: 0x6495edff,
|
| 15027 |
+
cornsilk: 0xfff8dcff,
|
| 15028 |
+
crimson: 0xdc143cff,
|
| 15029 |
+
cyan: 0x00ffffff,
|
| 15030 |
+
darkblue: 0x00008bff,
|
| 15031 |
+
darkcyan: 0x008b8bff,
|
| 15032 |
+
darkgoldenrod: 0xb8860bff,
|
| 15033 |
+
darkgray: 0xa9a9a9ff,
|
| 15034 |
+
darkgreen: 0x006400ff,
|
| 15035 |
+
darkgrey: 0xa9a9a9ff,
|
| 15036 |
+
darkkhaki: 0xbdb76bff,
|
| 15037 |
+
darkmagenta: 0x8b008bff,
|
| 15038 |
+
darkolivegreen: 0x556b2fff,
|
| 15039 |
+
darkorange: 0xff8c00ff,
|
| 15040 |
+
darkorchid: 0x9932ccff,
|
| 15041 |
+
darkred: 0x8b0000ff,
|
| 15042 |
+
darksalmon: 0xe9967aff,
|
| 15043 |
+
darkseagreen: 0x8fbc8fff,
|
| 15044 |
+
darkslateblue: 0x483d8bff,
|
| 15045 |
+
darkslategray: 0x2f4f4fff,
|
| 15046 |
+
darkslategrey: 0x2f4f4fff,
|
| 15047 |
+
darkturquoise: 0x00ced1ff,
|
| 15048 |
+
darkviolet: 0x9400d3ff,
|
| 15049 |
+
deeppink: 0xff1493ff,
|
| 15050 |
+
deepskyblue: 0x00bfffff,
|
| 15051 |
+
dimgray: 0x696969ff,
|
| 15052 |
+
dimgrey: 0x696969ff,
|
| 15053 |
+
dodgerblue: 0x1e90ffff,
|
| 15054 |
+
firebrick: 0xb22222ff,
|
| 15055 |
+
floralwhite: 0xfffaf0ff,
|
| 15056 |
+
forestgreen: 0x228b22ff,
|
| 15057 |
+
fuchsia: 0xff00ffff,
|
| 15058 |
+
gainsboro: 0xdcdcdcff,
|
| 15059 |
+
ghostwhite: 0xf8f8ffff,
|
| 15060 |
+
gold: 0xffd700ff,
|
| 15061 |
+
goldenrod: 0xdaa520ff,
|
| 15062 |
+
gray: 0x808080ff,
|
| 15063 |
+
green: 0x008000ff,
|
| 15064 |
+
greenyellow: 0xadff2fff,
|
| 15065 |
+
grey: 0x808080ff,
|
| 15066 |
+
honeydew: 0xf0fff0ff,
|
| 15067 |
+
hotpink: 0xff69b4ff,
|
| 15068 |
+
indianred: 0xcd5c5cff,
|
| 15069 |
+
indigo: 0x4b0082ff,
|
| 15070 |
+
ivory: 0xfffff0ff,
|
| 15071 |
+
khaki: 0xf0e68cff,
|
| 15072 |
+
lavender: 0xe6e6faff,
|
| 15073 |
+
lavenderblush: 0xfff0f5ff,
|
| 15074 |
+
lawngreen: 0x7cfc00ff,
|
| 15075 |
+
lemonchiffon: 0xfffacdff,
|
| 15076 |
+
lightblue: 0xadd8e6ff,
|
| 15077 |
+
lightcoral: 0xf08080ff,
|
| 15078 |
+
lightcyan: 0xe0ffffff,
|
| 15079 |
+
lightgoldenrodyellow: 0xfafad2ff,
|
| 15080 |
+
lightgray: 0xd3d3d3ff,
|
| 15081 |
+
lightgreen: 0x90ee90ff,
|
| 15082 |
+
lightgrey: 0xd3d3d3ff,
|
| 15083 |
+
lightpink: 0xffb6c1ff,
|
| 15084 |
+
lightsalmon: 0xffa07aff,
|
| 15085 |
+
lightseagreen: 0x20b2aaff,
|
| 15086 |
+
lightskyblue: 0x87cefaff,
|
| 15087 |
+
lightslategray: 0x778899ff,
|
| 15088 |
+
lightslategrey: 0x778899ff,
|
| 15089 |
+
lightsteelblue: 0xb0c4deff,
|
| 15090 |
+
lightyellow: 0xffffe0ff,
|
| 15091 |
+
lime: 0x00ff00ff,
|
| 15092 |
+
limegreen: 0x32cd32ff,
|
| 15093 |
+
linen: 0xfaf0e6ff,
|
| 15094 |
+
magenta: 0xff00ffff,
|
| 15095 |
+
maroon: 0x800000ff,
|
| 15096 |
+
mediumaquamarine: 0x66cdaaff,
|
| 15097 |
+
mediumblue: 0x0000cdff,
|
| 15098 |
+
mediumorchid: 0xba55d3ff,
|
| 15099 |
+
mediumpurple: 0x9370dbff,
|
| 15100 |
+
mediumseagreen: 0x3cb371ff,
|
| 15101 |
+
mediumslateblue: 0x7b68eeff,
|
| 15102 |
+
mediumspringgreen: 0x00fa9aff,
|
| 15103 |
+
mediumturquoise: 0x48d1ccff,
|
| 15104 |
+
mediumvioletred: 0xc71585ff,
|
| 15105 |
+
midnightblue: 0x191970ff,
|
| 15106 |
+
mintcream: 0xf5fffaff,
|
| 15107 |
+
mistyrose: 0xffe4e1ff,
|
| 15108 |
+
moccasin: 0xffe4b5ff,
|
| 15109 |
+
navajowhite: 0xffdeadff,
|
| 15110 |
+
navy: 0x000080ff,
|
| 15111 |
+
oldlace: 0xfdf5e6ff,
|
| 15112 |
+
olive: 0x808000ff,
|
| 15113 |
+
olivedrab: 0x6b8e23ff,
|
| 15114 |
+
orange: 0xffa500ff,
|
| 15115 |
+
orangered: 0xff4500ff,
|
| 15116 |
+
orchid: 0xda70d6ff,
|
| 15117 |
+
palegoldenrod: 0xeee8aaff,
|
| 15118 |
+
palegreen: 0x98fb98ff,
|
| 15119 |
+
paleturquoise: 0xafeeeeff,
|
| 15120 |
+
palevioletred: 0xdb7093ff,
|
| 15121 |
+
papayawhip: 0xffefd5ff,
|
| 15122 |
+
peachpuff: 0xffdab9ff,
|
| 15123 |
+
peru: 0xcd853fff,
|
| 15124 |
+
pink: 0xffc0cbff,
|
| 15125 |
+
plum: 0xdda0ddff,
|
| 15126 |
+
powderblue: 0xb0e0e6ff,
|
| 15127 |
+
purple: 0x800080ff,
|
| 15128 |
+
rebeccapurple: 0x663399ff,
|
| 15129 |
+
red: 0xff0000ff,
|
| 15130 |
+
rosybrown: 0xbc8f8fff,
|
| 15131 |
+
royalblue: 0x4169e1ff,
|
| 15132 |
+
saddlebrown: 0x8b4513ff,
|
| 15133 |
+
salmon: 0xfa8072ff,
|
| 15134 |
+
sandybrown: 0xf4a460ff,
|
| 15135 |
+
seagreen: 0x2e8b57ff,
|
| 15136 |
+
seashell: 0xfff5eeff,
|
| 15137 |
+
sienna: 0xa0522dff,
|
| 15138 |
+
silver: 0xc0c0c0ff,
|
| 15139 |
+
skyblue: 0x87ceebff,
|
| 15140 |
+
slateblue: 0x6a5acdff,
|
| 15141 |
+
slategray: 0x708090ff,
|
| 15142 |
+
slategrey: 0x708090ff,
|
| 15143 |
+
snow: 0xfffafaff,
|
| 15144 |
+
springgreen: 0x00ff7fff,
|
| 15145 |
+
steelblue: 0x4682b4ff,
|
| 15146 |
+
tan: 0xd2b48cff,
|
| 15147 |
+
teal: 0x008080ff,
|
| 15148 |
+
thistle: 0xd8bfd8ff,
|
| 15149 |
+
tomato: 0xff6347ff,
|
| 15150 |
+
turquoise: 0x40e0d0ff,
|
| 15151 |
+
violet: 0xee82eeff,
|
| 15152 |
+
wheat: 0xf5deb3ff,
|
| 15153 |
+
white: 0xffffffff,
|
| 15154 |
+
whitesmoke: 0xf5f5f5ff,
|
| 15155 |
+
yellow: 0xffff00ff,
|
| 15156 |
+
yellowgreen: 0x9acd32ff
|
| 15157 |
+
};
|
| 15158 |
+
|
| 15159 |
+
// const INTEGER = '[-+]?\\d+';
|
| 15160 |
+
var NUMBER = '[-+]?\\d*\\.?\\d+';
|
| 15161 |
+
var PERCENTAGE = NUMBER + '%';
|
| 15162 |
+
|
| 15163 |
+
function call() {
|
| 15164 |
+
for (var _len = arguments.length, parts = new Array(_len), _key = 0; _key < _len; _key++) {
|
| 15165 |
+
parts[_key] = arguments[_key];
|
| 15166 |
+
}
|
| 15167 |
+
|
| 15168 |
+
return '\\(\\s*(' + parts.join(')\\s*,\\s*(') + ')\\s*\\)';
|
| 15169 |
+
}
|
| 15170 |
+
|
| 15171 |
+
var rgb = new RegExp('rgb' + call(NUMBER, NUMBER, NUMBER));
|
| 15172 |
+
var rgba = new RegExp('rgba' + call(NUMBER, NUMBER, NUMBER, NUMBER));
|
| 15173 |
+
var hsl = new RegExp('hsl' + call(NUMBER, PERCENTAGE, PERCENTAGE));
|
| 15174 |
+
var hsla = new RegExp('hsla' + call(NUMBER, PERCENTAGE, PERCENTAGE, NUMBER));
|
| 15175 |
+
var hex3 = /^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/;
|
| 15176 |
+
var hex4 = /^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/;
|
| 15177 |
+
var hex6 = /^#([0-9a-fA-F]{6})$/;
|
| 15178 |
+
var hex8 = /^#([0-9a-fA-F]{8})$/;
|
| 15179 |
+
|
| 15180 |
+
/*
|
| 15181 |
+
https://github.com/react-community/normalize-css-color
|
| 15182 |
+
|
| 15183 |
+
BSD 3-Clause License
|
| 15184 |
+
|
| 15185 |
+
Copyright (c) 2016, React Community
|
| 15186 |
+
All rights reserved.
|
| 15187 |
+
|
| 15188 |
+
Redistribution and use in source and binary forms, with or without
|
| 15189 |
+
modification, are permitted provided that the following conditions are met:
|
| 15190 |
+
|
| 15191 |
+
* Redistributions of source code must retain the above copyright notice, this
|
| 15192 |
+
list of conditions and the following disclaimer.
|
| 15193 |
+
|
| 15194 |
+
* Redistributions in binary form must reproduce the above copyright notice,
|
| 15195 |
+
this list of conditions and the following disclaimer in the documentation
|
| 15196 |
+
and/or other materials provided with the distribution.
|
| 15197 |
+
|
| 15198 |
+
* Neither the name of the copyright holder nor the names of its
|
| 15199 |
+
contributors may be used to endorse or promote products derived from
|
| 15200 |
+
this software without specific prior written permission.
|
| 15201 |
+
|
| 15202 |
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
| 15203 |
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
| 15204 |
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
| 15205 |
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
| 15206 |
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
| 15207 |
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
| 15208 |
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
| 15209 |
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
| 15210 |
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
| 15211 |
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
| 15212 |
+
*/
|
| 15213 |
+
function normalizeColor(color) {
|
| 15214 |
+
var match;
|
| 15215 |
+
|
| 15216 |
+
if (typeof color === 'number') {
|
| 15217 |
+
return color >>> 0 === color && color >= 0 && color <= 0xffffffff ? color : null;
|
| 15218 |
+
} // Ordered based on occurrences on Facebook codebase
|
| 15219 |
+
|
| 15220 |
+
|
| 15221 |
+
if (match = hex6.exec(color)) return parseInt(match[1] + 'ff', 16) >>> 0;
|
| 15222 |
+
if (colors.hasOwnProperty(color)) return colors[color];
|
| 15223 |
+
|
| 15224 |
+
if (match = rgb.exec(color)) {
|
| 15225 |
+
return (parse255(match[1]) << 24 | // r
|
| 15226 |
+
parse255(match[2]) << 16 | // g
|
| 15227 |
+
parse255(match[3]) << 8 | // b
|
| 15228 |
+
0x000000ff) >>> // a
|
| 15229 |
+
0;
|
| 15230 |
+
}
|
| 15231 |
+
|
| 15232 |
+
if (match = rgba.exec(color)) {
|
| 15233 |
+
return (parse255(match[1]) << 24 | // r
|
| 15234 |
+
parse255(match[2]) << 16 | // g
|
| 15235 |
+
parse255(match[3]) << 8 | // b
|
| 15236 |
+
parse1(match[4])) >>> // a
|
| 15237 |
+
0;
|
| 15238 |
+
}
|
| 15239 |
+
|
| 15240 |
+
if (match = hex3.exec(color)) {
|
| 15241 |
+
return parseInt(match[1] + match[1] + // r
|
| 15242 |
+
match[2] + match[2] + // g
|
| 15243 |
+
match[3] + match[3] + // b
|
| 15244 |
+
'ff', // a
|
| 15245 |
+
16) >>> 0;
|
| 15246 |
+
} // https://drafts.csswg.org/css-color-4/#hex-notation
|
| 15247 |
+
|
| 15248 |
+
|
| 15249 |
+
if (match = hex8.exec(color)) return parseInt(match[1], 16) >>> 0;
|
| 15250 |
+
|
| 15251 |
+
if (match = hex4.exec(color)) {
|
| 15252 |
+
return parseInt(match[1] + match[1] + // r
|
| 15253 |
+
match[2] + match[2] + // g
|
| 15254 |
+
match[3] + match[3] + // b
|
| 15255 |
+
match[4] + match[4], // a
|
| 15256 |
+
16) >>> 0;
|
| 15257 |
+
}
|
| 15258 |
+
|
| 15259 |
+
if (match = hsl.exec(color)) {
|
| 15260 |
+
return (hslToRgb(parse360(match[1]), // h
|
| 15261 |
+
parsePercentage(match[2]), // s
|
| 15262 |
+
parsePercentage(match[3]) // l
|
| 15263 |
+
) | 0x000000ff) >>> // a
|
| 15264 |
+
0;
|
| 15265 |
+
}
|
| 15266 |
+
|
| 15267 |
+
if (match = hsla.exec(color)) {
|
| 15268 |
+
return (hslToRgb(parse360(match[1]), // h
|
| 15269 |
+
parsePercentage(match[2]), // s
|
| 15270 |
+
parsePercentage(match[3]) // l
|
| 15271 |
+
) | parse1(match[4])) >>> // a
|
| 15272 |
+
0;
|
| 15273 |
+
}
|
| 15274 |
+
|
| 15275 |
+
return null;
|
| 15276 |
+
}
|
| 15277 |
+
|
| 15278 |
+
function hue2rgb(p, q, t) {
|
| 15279 |
+
if (t < 0) t += 1;
|
| 15280 |
+
if (t > 1) t -= 1;
|
| 15281 |
+
if (t < 1 / 6) return p + (q - p) * 6 * t;
|
| 15282 |
+
if (t < 1 / 2) return q;
|
| 15283 |
+
if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6;
|
| 15284 |
+
return p;
|
| 15285 |
+
}
|
| 15286 |
+
|
| 15287 |
+
function hslToRgb(h, s, l) {
|
| 15288 |
+
var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
|
| 15289 |
+
var p = 2 * l - q;
|
| 15290 |
+
var r = hue2rgb(p, q, h + 1 / 3);
|
| 15291 |
+
var g = hue2rgb(p, q, h);
|
| 15292 |
+
var b = hue2rgb(p, q, h - 1 / 3);
|
| 15293 |
+
return Math.round(r * 255) << 24 | Math.round(g * 255) << 16 | Math.round(b * 255) << 8;
|
| 15294 |
+
}
|
| 15295 |
+
|
| 15296 |
+
function parse255(str) {
|
| 15297 |
+
var int = parseInt(str, 10);
|
| 15298 |
+
if (int < 0) return 0;
|
| 15299 |
+
if (int > 255) return 255;
|
| 15300 |
+
return int;
|
| 15301 |
+
}
|
| 15302 |
+
|
| 15303 |
+
function parse360(str) {
|
| 15304 |
+
var int = parseFloat(str);
|
| 15305 |
+
return (int % 360 + 360) % 360 / 360;
|
| 15306 |
+
}
|
| 15307 |
+
|
| 15308 |
+
function parse1(str) {
|
| 15309 |
+
var num = parseFloat(str);
|
| 15310 |
+
if (num < 0) return 0;
|
| 15311 |
+
if (num > 1) return 255;
|
| 15312 |
+
return Math.round(num * 255);
|
| 15313 |
+
}
|
| 15314 |
+
|
| 15315 |
+
function parsePercentage(str) {
|
| 15316 |
+
// parseFloat conveniently ignores the final %
|
| 15317 |
+
var int = parseFloat(str);
|
| 15318 |
+
if (int < 0) return 0;
|
| 15319 |
+
if (int > 100) return 1;
|
| 15320 |
+
return int / 100;
|
| 15321 |
+
}
|
| 15322 |
+
|
| 15323 |
+
function colorToRgba(input) {
|
| 15324 |
+
var int32Color = normalizeColor(input);
|
| 15325 |
+
if (int32Color === null) return input;
|
| 15326 |
+
int32Color = int32Color || 0;
|
| 15327 |
+
var r = (int32Color & 0xff000000) >>> 24;
|
| 15328 |
+
var g = (int32Color & 0x00ff0000) >>> 16;
|
| 15329 |
+
var b = (int32Color & 0x0000ff00) >>> 8;
|
| 15330 |
+
var a = (int32Color & 0x000000ff) / 255;
|
| 15331 |
+
return "rgba(" + r + ", " + g + ", " + b + ", " + a + ")";
|
| 15332 |
+
} // Problem: https://github.com/animatedjs/animated/pull/102
|
| 15333 |
+
// Solution: https://stackoverflow.com/questions/638565/parsing-scientific-notation-sensibly/658662
|
| 15334 |
+
|
| 15335 |
+
|
| 15336 |
+
var stringShapeRegex = /[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g; // Covers rgb, rgba, hsl, hsla
|
| 15337 |
+
// Taken from https://gist.github.com/olmokramer/82ccce673f86db7cda5e
|
| 15338 |
+
|
| 15339 |
+
var colorRegex = /(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi; // Covers color names (transparent, blue, etc.)
|
| 15340 |
+
|
| 15341 |
+
var colorNamesRegex = new RegExp("(" + Object.keys(colors).join('|') + ")", 'g');
|
| 15342 |
+
/**
|
| 15343 |
+
* Supports string shapes by extracting numbers so new values can be computed,
|
| 15344 |
+
* and recombines those values into new strings of the same shape. Supports
|
| 15345 |
+
* things like:
|
| 15346 |
+
*
|
| 15347 |
+
* rgba(123, 42, 99, 0.36) // colors
|
| 15348 |
+
* -45deg // values with units
|
| 15349 |
+
* 0 2px 2px 0px rgba(0, 0, 0, 0.12) // box shadows
|
| 15350 |
+
*/
|
| 15351 |
+
|
| 15352 |
+
var createStringInterpolator = function createStringInterpolator(config) {
|
| 15353 |
+
// Replace colors with rgba
|
| 15354 |
+
var outputRange = config.output.map(function (rangeValue) {
|
| 15355 |
+
return rangeValue.replace(colorRegex, colorToRgba);
|
| 15356 |
+
}).map(function (rangeValue) {
|
| 15357 |
+
return rangeValue.replace(colorNamesRegex, colorToRgba);
|
| 15358 |
+
});
|
| 15359 |
+
var outputRanges = outputRange[0].match(stringShapeRegex).map(function () {
|
| 15360 |
+
return [];
|
| 15361 |
+
});
|
| 15362 |
+
outputRange.forEach(function (value) {
|
| 15363 |
+
value.match(stringShapeRegex).forEach(function (number, i) {
|
| 15364 |
+
return outputRanges[i].push(+number);
|
| 15365 |
+
});
|
| 15366 |
+
});
|
| 15367 |
+
var interpolations = outputRange[0].match(stringShapeRegex).map(function (_value, i) {
|
| 15368 |
+
return createInterpolator(_extends({}, config, {
|
| 15369 |
+
output: outputRanges[i]
|
| 15370 |
+
}));
|
| 15371 |
+
});
|
| 15372 |
+
return function (input) {
|
| 15373 |
+
var i = 0;
|
| 15374 |
+
return outputRange[0] // 'rgba(0, 100, 200, 0)'
|
| 15375 |
+
// ->
|
| 15376 |
+
// 'rgba(${interpolations[0](input)}, ${interpolations[1](input)}, ...'
|
| 15377 |
+
.replace(stringShapeRegex, function () {
|
| 15378 |
+
return interpolations[i++](input);
|
| 15379 |
+
}) // rgba requires that the r,g,b are integers.... so we want to round them, but we *dont* want to
|
| 15380 |
+
// round the opacity (4th column).
|
| 15381 |
+
.replace(/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi, function (_, p1, p2, p3, p4) {
|
| 15382 |
+
return "rgba(" + Math.round(p1) + ", " + Math.round(p2) + ", " + Math.round(p3) + ", " + p4 + ")";
|
| 15383 |
+
});
|
| 15384 |
+
};
|
| 15385 |
+
};
|
| 15386 |
+
|
| 15387 |
+
var isUnitlessNumber = {
|
| 15388 |
+
animationIterationCount: true,
|
| 15389 |
+
borderImageOutset: true,
|
| 15390 |
+
borderImageSlice: true,
|
| 15391 |
+
borderImageWidth: true,
|
| 15392 |
+
boxFlex: true,
|
| 15393 |
+
boxFlexGroup: true,
|
| 15394 |
+
boxOrdinalGroup: true,
|
| 15395 |
+
columnCount: true,
|
| 15396 |
+
columns: true,
|
| 15397 |
+
flex: true,
|
| 15398 |
+
flexGrow: true,
|
| 15399 |
+
flexPositive: true,
|
| 15400 |
+
flexShrink: true,
|
| 15401 |
+
flexNegative: true,
|
| 15402 |
+
flexOrder: true,
|
| 15403 |
+
gridRow: true,
|
| 15404 |
+
gridRowEnd: true,
|
| 15405 |
+
gridRowSpan: true,
|
| 15406 |
+
gridRowStart: true,
|
| 15407 |
+
gridColumn: true,
|
| 15408 |
+
gridColumnEnd: true,
|
| 15409 |
+
gridColumnSpan: true,
|
| 15410 |
+
gridColumnStart: true,
|
| 15411 |
+
fontWeight: true,
|
| 15412 |
+
lineClamp: true,
|
| 15413 |
+
lineHeight: true,
|
| 15414 |
+
opacity: true,
|
| 15415 |
+
order: true,
|
| 15416 |
+
orphans: true,
|
| 15417 |
+
tabSize: true,
|
| 15418 |
+
widows: true,
|
| 15419 |
+
zIndex: true,
|
| 15420 |
+
zoom: true,
|
| 15421 |
+
// SVG-related properties
|
| 15422 |
+
fillOpacity: true,
|
| 15423 |
+
floodOpacity: true,
|
| 15424 |
+
stopOpacity: true,
|
| 15425 |
+
strokeDasharray: true,
|
| 15426 |
+
strokeDashoffset: true,
|
| 15427 |
+
strokeMiterlimit: true,
|
| 15428 |
+
strokeOpacity: true,
|
| 15429 |
+
strokeWidth: true
|
| 15430 |
+
};
|
| 15431 |
+
|
| 15432 |
+
var prefixKey = function prefixKey(prefix, key) {
|
| 15433 |
+
return prefix + key.charAt(0).toUpperCase() + key.substring(1);
|
| 15434 |
+
};
|
| 15435 |
+
|
| 15436 |
+
var prefixes = ['Webkit', 'Ms', 'Moz', 'O'];
|
| 15437 |
+
isUnitlessNumber = Object.keys(isUnitlessNumber).reduce(function (acc, prop) {
|
| 15438 |
+
prefixes.forEach(function (prefix) {
|
| 15439 |
+
return acc[prefixKey(prefix, prop)] = acc[prop];
|
| 15440 |
+
});
|
| 15441 |
+
return acc;
|
| 15442 |
+
}, isUnitlessNumber);
|
| 15443 |
+
|
| 15444 |
+
function dangerousStyleValue(name, value, isCustomProperty) {
|
| 15445 |
+
if (value == null || typeof value === 'boolean' || value === '') return '';
|
| 15446 |
+
if (!isCustomProperty && typeof value === 'number' && value !== 0 && !(isUnitlessNumber.hasOwnProperty(name) && isUnitlessNumber[name])) return value + 'px'; // Presumes implicit 'px' suffix for unitless numbers
|
| 15447 |
+
|
| 15448 |
+
return ('' + value).trim();
|
| 15449 |
+
}
|
| 15450 |
+
|
| 15451 |
+
var attributeCache = {};
|
| 15452 |
+
injectCreateAnimatedStyle(function (style) {
|
| 15453 |
+
return new AnimatedStyle(style);
|
| 15454 |
+
});
|
| 15455 |
+
injectDefaultElement('div');
|
| 15456 |
+
injectStringInterpolator(createStringInterpolator);
|
| 15457 |
+
injectColorNames(colors);
|
| 15458 |
+
injectApplyAnimatedValues(function (instance, props) {
|
| 15459 |
+
if (instance.nodeType && instance.setAttribute !== undefined) {
|
| 15460 |
+
var style = props.style,
|
| 15461 |
+
children = props.children,
|
| 15462 |
+
scrollTop = props.scrollTop,
|
| 15463 |
+
scrollLeft = props.scrollLeft,
|
| 15464 |
+
attributes = _objectWithoutPropertiesLoose(props, ["style", "children", "scrollTop", "scrollLeft"]);
|
| 15465 |
+
|
| 15466 |
+
var filter = instance.nodeName === 'filter' || instance.parentNode && instance.parentNode.nodeName === 'filter';
|
| 15467 |
+
if (scrollTop !== void 0) instance.scrollTop = scrollTop;
|
| 15468 |
+
if (scrollLeft !== void 0) instance.scrollLeft = scrollLeft; // Set textContent, if children is an animatable value
|
| 15469 |
+
|
| 15470 |
+
if (children !== void 0) instance.textContent = children; // Set styles ...
|
| 15471 |
+
|
| 15472 |
+
for (var styleName in style) {
|
| 15473 |
+
if (!style.hasOwnProperty(styleName)) continue;
|
| 15474 |
+
var isCustomProperty = styleName.indexOf('--') === 0;
|
| 15475 |
+
var styleValue = dangerousStyleValue(styleName, style[styleName], isCustomProperty);
|
| 15476 |
+
if (styleName === 'float') styleName = 'cssFloat';
|
| 15477 |
+
if (isCustomProperty) instance.style.setProperty(styleName, styleValue);else instance.style[styleName] = styleValue;
|
| 15478 |
+
} // Set attributes ...
|
| 15479 |
+
|
| 15480 |
+
|
| 15481 |
+
for (var name in attributes) {
|
| 15482 |
+
// Attributes are written in dash case
|
| 15483 |
+
var dashCase = filter ? name : attributeCache[name] || (attributeCache[name] = name.replace(/([A-Z])/g, function (n) {
|
| 15484 |
+
return '-' + n.toLowerCase();
|
| 15485 |
+
}));
|
| 15486 |
+
if (typeof instance.getAttribute(dashCase) !== 'undefined') instance.setAttribute(dashCase, attributes[name]);
|
| 15487 |
+
}
|
| 15488 |
+
|
| 15489 |
+
return;
|
| 15490 |
+
} else return false;
|
| 15491 |
+
}, function (style) {
|
| 15492 |
+
return style;
|
| 15493 |
+
});
|
| 15494 |
+
|
| 15495 |
+
var domElements = ['a', 'abbr', 'address', 'area', 'article', 'aside', 'audio', 'b', 'base', 'bdi', 'bdo', 'big', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'cite', 'code', 'col', 'colgroup', 'data', 'datalist', 'dd', 'del', 'details', 'dfn', 'dialog', 'div', 'dl', 'dt', 'em', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'iframe', 'img', 'input', 'ins', 'kbd', 'keygen', 'label', 'legend', 'li', 'link', 'main', 'map', 'mark', 'menu', 'menuitem', 'meta', 'meter', 'nav', 'noscript', 'object', 'ol', 'optgroup', 'option', 'output', 'p', 'param', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'script', 'section', 'select', 'small', 'source', 'span', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'textarea', 'tfoot', 'th', 'thead', 'time', 'title', 'tr', 'track', 'u', 'ul', 'var', 'video', 'wbr', // SVG
|
| 15496 |
+
'circle', 'clipPath', 'defs', 'ellipse', 'foreignObject', 'g', 'image', 'line', 'linearGradient', 'mask', 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'stop', 'svg', 'text', 'tspan'];
|
| 15497 |
+
// Extend animated with all the available THREE elements
|
| 15498 |
+
var apply = merge(createAnimatedComponent, false);
|
| 15499 |
+
var extendedAnimated = apply(domElements);
|
| 15500 |
+
|
| 15501 |
+
exports.apply = apply;
|
| 15502 |
+
exports.config = config;
|
| 15503 |
+
exports.update = update;
|
| 15504 |
+
exports.animated = extendedAnimated;
|
| 15505 |
+
exports.a = extendedAnimated;
|
| 15506 |
+
exports.interpolate = interpolate$1;
|
| 15507 |
+
exports.Globals = Globals;
|
| 15508 |
+
exports.useSpring = useSpring;
|
| 15509 |
+
exports.useTrail = useTrail;
|
| 15510 |
+
exports.useTransition = useTransition;
|
| 15511 |
+
exports.useChain = useChain;
|
| 15512 |
+
exports.useSprings = useSprings;
|
| 15513 |
+
|
| 15514 |
+
|
| 15515 |
+
/***/ }),
|
| 15516 |
+
|
| 15517 |
+
/***/ 437:
|
| 15518 |
+
/***/ (function(module, exports, __webpack_require__) {
|
| 15519 |
+
|
| 15520 |
+
var isarray = __webpack_require__(573)
|
| 15521 |
+
|
| 15522 |
+
/**
|
| 15523 |
+
* Expose `pathToRegexp`.
|
| 15524 |
+
*/
|
| 15525 |
+
module.exports = pathToRegexp
|
| 15526 |
+
module.exports.parse = parse
|
| 15527 |
+
module.exports.compile = compile
|
| 15528 |
+
module.exports.tokensToFunction = tokensToFunction
|
| 15529 |
+
module.exports.tokensToRegExp = tokensToRegExp
|
| 15530 |
+
|
| 15531 |
+
/**
|
| 15532 |
+
* The main path matching regexp utility.
|
| 15533 |
+
*
|
| 15534 |
+
* @type {RegExp}
|
| 15535 |
+
*/
|
| 15536 |
+
var PATH_REGEXP = new RegExp([
|
| 15537 |
+
// Match escaped characters that would otherwise appear in future matches.
|
| 15538 |
+
// This allows the user to escape special characters that won't transform.
|
| 15539 |
+
'(\\\\.)',
|
| 15540 |
+
// Match Express-style parameters and un-named parameters with a prefix
|
| 15541 |
+
// and optional suffixes. Matches appear as:
|
| 15542 |
+
//
|
| 15543 |
+
// "/:test(\\d+)?" => ["/", "test", "\d+", undefined, "?", undefined]
|
| 15544 |
+
// "/route(\\d+)" => [undefined, undefined, undefined, "\d+", undefined, undefined]
|
| 15545 |
+
// "/*" => ["/", undefined, undefined, undefined, undefined, "*"]
|
| 15546 |
+
'([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))'
|
| 15547 |
+
].join('|'), 'g')
|
| 15548 |
+
|
| 15549 |
+
/**
|
| 15550 |
+
* Parse a string for the raw tokens.
|
| 15551 |
+
*
|
| 15552 |
+
* @param {string} str
|
| 15553 |
+
* @param {Object=} options
|
| 15554 |
+
* @return {!Array}
|
| 15555 |
+
*/
|
| 15556 |
+
function parse (str, options) {
|
| 15557 |
+
var tokens = []
|
| 15558 |
+
var key = 0
|
| 15559 |
+
var index = 0
|
| 15560 |
+
var path = ''
|
| 15561 |
+
var defaultDelimiter = options && options.delimiter || '/'
|
| 15562 |
+
var res
|
| 15563 |
+
|
| 15564 |
+
while ((res = PATH_REGEXP.exec(str)) != null) {
|
| 15565 |
+
var m = res[0]
|
| 15566 |
+
var escaped = res[1]
|
| 15567 |
+
var offset = res.index
|
| 15568 |
+
path += str.slice(index, offset)
|
| 15569 |
+
index = offset + m.length
|
| 15570 |
+
|
| 15571 |
+
// Ignore already escaped sequences.
|
| 15572 |
+
if (escaped) {
|
| 15573 |
+
path += escaped[1]
|
| 15574 |
+
continue
|
| 15575 |
+
}
|
| 15576 |
+
|
| 15577 |
+
var next = str[index]
|
| 15578 |
+
var prefix = res[2]
|
| 15579 |
+
var name = res[3]
|
| 15580 |
+
var capture = res[4]
|
| 15581 |
+
var group = res[5]
|
| 15582 |
+
var modifier = res[6]
|
| 15583 |
+
var asterisk = res[7]
|
| 15584 |
+
|
| 15585 |
+
// Push the current path onto the tokens.
|
| 15586 |
+
if (path) {
|
| 15587 |
+
tokens.push(path)
|
| 15588 |
+
path = ''
|
| 15589 |
+
}
|
| 15590 |
+
|
| 15591 |
+
var partial = prefix != null && next != null && next !== prefix
|
| 15592 |
+
var repeat = modifier === '+' || modifier === '*'
|
| 15593 |
+
var optional = modifier === '?' || modifier === '*'
|
| 15594 |
+
var delimiter = res[2] || defaultDelimiter
|
| 15595 |
+
var pattern = capture || group
|
| 15596 |
+
|
| 15597 |
+
tokens.push({
|
| 15598 |
+
name: name || key++,
|
| 15599 |
+
prefix: prefix || '',
|
| 15600 |
+
delimiter: delimiter,
|
| 15601 |
+
optional: optional,
|
| 15602 |
+
repeat: repeat,
|
| 15603 |
+
partial: partial,
|
| 15604 |
+
asterisk: !!asterisk,
|
| 15605 |
+
pattern: pattern ? escapeGroup(pattern) : (asterisk ? '.*' : '[^' + escapeString(delimiter) + ']+?')
|
| 15606 |
+
})
|
| 15607 |
+
}
|
| 15608 |
+
|
| 15609 |
+
// Match any characters still remaining.
|
| 15610 |
+
if (index < str.length) {
|
| 15611 |
+
path += str.substr(index)
|
| 15612 |
+
}
|
| 15613 |
+
|
| 15614 |
+
// If the path exists, push it onto the end.
|
| 15615 |
+
if (path) {
|
| 15616 |
+
tokens.push(path)
|
| 15617 |
+
}
|
| 15618 |
+
|
| 15619 |
+
return tokens
|
| 15620 |
+
}
|
| 15621 |
+
|
| 15622 |
+
/**
|
| 15623 |
+
* Compile a string to a template function for the path.
|
| 15624 |
+
*
|
| 15625 |
+
* @param {string} str
|
| 15626 |
+
* @param {Object=} options
|
| 15627 |
+
* @return {!function(Object=, Object=)}
|
| 15628 |
+
*/
|
| 15629 |
+
function compile (str, options) {
|
| 15630 |
+
return tokensToFunction(parse(str, options), options)
|
| 15631 |
+
}
|
| 15632 |
+
|
| 15633 |
+
/**
|
| 15634 |
+
* Prettier encoding of URI path segments.
|
| 15635 |
+
*
|
| 15636 |
+
* @param {string}
|
| 15637 |
+
* @return {string}
|
| 15638 |
+
*/
|
| 15639 |
+
function encodeURIComponentPretty (str) {
|
| 15640 |
+
return encodeURI(str).replace(/[\/?#]/g, function (c) {
|
| 15641 |
+
return '%' + c.charCodeAt(0).toString(16).toUpperCase()
|
| 15642 |
+
})
|
| 15643 |
+
}
|
| 15644 |
+
|
| 15645 |
+
/**
|
| 15646 |
+
* Encode the asterisk parameter. Similar to `pretty`, but allows slashes.
|
| 15647 |
+
*
|
| 15648 |
+
* @param {string}
|
| 15649 |
+
* @return {string}
|
| 15650 |
+
*/
|
| 15651 |
+
function encodeAsterisk (str) {
|
| 15652 |
+
return encodeURI(str).replace(/[?#]/g, function (c) {
|
| 15653 |
+
return '%' + c.charCodeAt(0).toString(16).toUpperCase()
|
| 15654 |
+
})
|
| 15655 |
+
}
|
| 15656 |
+
|
| 15657 |
+
/**
|
| 15658 |
+
* Expose a method for transforming tokens into the path function.
|
| 15659 |
+
*/
|
| 15660 |
+
function tokensToFunction (tokens, options) {
|
| 15661 |
+
// Compile all the tokens into regexps.
|
| 15662 |
+
var matches = new Array(tokens.length)
|
| 15663 |
+
|
| 15664 |
+
// Compile all the patterns before compilation.
|
| 15665 |
+
for (var i = 0; i < tokens.length; i++) {
|
| 15666 |
+
if (typeof tokens[i] === 'object') {
|
| 15667 |
+
matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$', flags(options))
|
| 15668 |
+
}
|
| 15669 |
+
}
|
| 15670 |
+
|
| 15671 |
+
return function (obj, opts) {
|
| 15672 |
+
var path = ''
|
| 15673 |
+
var data = obj || {}
|
| 15674 |
+
var options = opts || {}
|
| 15675 |
+
var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent
|
| 15676 |
+
|
| 15677 |
+
for (var i = 0; i < tokens.length; i++) {
|
| 15678 |
+
var token = tokens[i]
|
| 15679 |
+
|
| 15680 |
+
if (typeof token === 'string') {
|
| 15681 |
+
path += token
|
| 15682 |
+
|
| 15683 |
+
continue
|
| 15684 |
+
}
|
| 15685 |
+
|
| 15686 |
+
var value = data[token.name]
|
| 15687 |
+
var segment
|
| 15688 |
+
|
| 15689 |
+
if (value == null) {
|
| 15690 |
+
if (token.optional) {
|
| 15691 |
+
// Prepend partial segment prefixes.
|
| 15692 |
+
if (token.partial) {
|
| 15693 |
+
path += token.prefix
|
| 15694 |
+
}
|
| 15695 |
+
|
| 15696 |
+
continue
|
| 15697 |
+
} else {
|
| 15698 |
+
throw new TypeError('Expected "' + token.name + '" to be defined')
|
| 15699 |
+
}
|
| 15700 |
+
}
|
| 15701 |
+
|
| 15702 |
+
if (isarray(value)) {
|
| 15703 |
+
if (!token.repeat) {
|
| 15704 |
+
throw new TypeError('Expected "' + token.name + '" to not repeat, but received `' + JSON.stringify(value) + '`')
|
| 15705 |
+
}
|
| 15706 |
+
|
| 15707 |
+
if (value.length === 0) {
|
| 15708 |
+
if (token.optional) {
|
| 15709 |
+
continue
|
| 15710 |
+
} else {
|
| 15711 |
+
throw new TypeError('Expected "' + token.name + '" to not be empty')
|
| 15712 |
+
}
|
| 15713 |
+
}
|
| 15714 |
+
|
| 15715 |
+
for (var j = 0; j < value.length; j++) {
|
| 15716 |
+
segment = encode(value[j])
|
| 15717 |
+
|
| 15718 |
+
if (!matches[i].test(segment)) {
|
| 15719 |
+
throw new TypeError('Expected all "' + token.name + '" to match "' + token.pattern + '", but received `' + JSON.stringify(segment) + '`')
|
| 15720 |
+
}
|
| 15721 |
+
|
| 15722 |
+
path += (j === 0 ? token.prefix : token.delimiter) + segment
|
| 15723 |
+
}
|
| 15724 |
+
|
| 15725 |
+
continue
|
| 15726 |
+
}
|
| 15727 |
+
|
| 15728 |
+
segment = token.asterisk ? encodeAsterisk(value) : encode(value)
|
| 15729 |
+
|
| 15730 |
+
if (!matches[i].test(segment)) {
|
| 15731 |
+
throw new TypeError('Expected "' + token.name + '" to match "' + token.pattern + '", but received "' + segment + '"')
|
| 15732 |
+
}
|
| 15733 |
+
|
| 15734 |
+
path += token.prefix + segment
|
| 15735 |
+
}
|
| 15736 |
+
|
| 15737 |
+
return path
|
| 15738 |
+
}
|
| 15739 |
+
}
|
| 15740 |
+
|
| 15741 |
+
/**
|
| 15742 |
+
* Escape a regular expression string.
|
| 15743 |
+
*
|
| 15744 |
+
* @param {string} str
|
| 15745 |
+
* @return {string}
|
| 15746 |
+
*/
|
| 15747 |
+
function escapeString (str) {
|
| 15748 |
+
return str.replace(/([.+*?=^!:${}()[\]|\/\\])/g, '\\$1')
|
| 15749 |
+
}
|
| 15750 |
+
|
| 15751 |
+
/**
|
| 15752 |
+
* Escape the capturing group by escaping special characters and meaning.
|
| 15753 |
+
*
|
| 15754 |
+
* @param {string} group
|
| 15755 |
+
* @return {string}
|
| 15756 |
+
*/
|
| 15757 |
+
function escapeGroup (group) {
|
| 15758 |
+
return group.replace(/([=!:$\/()])/g, '\\$1')
|
| 15759 |
+
}
|
| 15760 |
+
|
| 15761 |
+
/**
|
| 15762 |
+
* Attach the keys as a property of the regexp.
|
| 15763 |
+
*
|
| 15764 |
+
* @param {!RegExp} re
|
| 15765 |
+
* @param {Array} keys
|
| 15766 |
+
* @return {!RegExp}
|
| 15767 |
+
*/
|
| 15768 |
+
function attachKeys (re, keys) {
|
| 15769 |
+
re.keys = keys
|
| 15770 |
+
return re
|
| 15771 |
+
}
|
| 15772 |
+
|
| 15773 |
+
/**
|
| 15774 |
+
* Get the flags for a regexp from the options.
|
| 15775 |
+
*
|
| 15776 |
+
* @param {Object} options
|
| 15777 |
+
* @return {string}
|
| 15778 |
+
*/
|
| 15779 |
+
function flags (options) {
|
| 15780 |
+
return options && options.sensitive ? '' : 'i'
|
| 15781 |
+
}
|
| 15782 |
+
|
| 15783 |
+
/**
|
| 15784 |
+
* Pull out keys from a regexp.
|
| 15785 |
+
*
|
| 15786 |
+
* @param {!RegExp} path
|
| 15787 |
+
* @param {!Array} keys
|
| 15788 |
+
* @return {!RegExp}
|
| 15789 |
+
*/
|
| 15790 |
+
function regexpToRegexp (path, keys) {
|
| 15791 |
+
// Use a negative lookahead to match only capturing groups.
|
| 15792 |
+
var groups = path.source.match(/\((?!\?)/g)
|
| 15793 |
+
|
| 15794 |
+
if (groups) {
|
| 15795 |
+
for (var i = 0; i < groups.length; i++) {
|
| 15796 |
+
keys.push({
|
| 15797 |
+
name: i,
|
| 15798 |
+
prefix: null,
|
| 15799 |
+
delimiter: null,
|
| 15800 |
+
optional: false,
|
| 15801 |
+
repeat: false,
|
| 15802 |
+
partial: false,
|
| 15803 |
+
asterisk: false,
|
| 15804 |
+
pattern: null
|
| 15805 |
+
})
|
| 15806 |
+
}
|
| 15807 |
+
}
|
| 15808 |
+
|
| 15809 |
+
return attachKeys(path, keys)
|
| 15810 |
+
}
|
| 15811 |
+
|
| 15812 |
+
/**
|
| 15813 |
+
* Transform an array into a regexp.
|
| 15814 |
+
*
|
| 15815 |
+
* @param {!Array} path
|
| 15816 |
+
* @param {Array} keys
|
| 15817 |
+
* @param {!Object} options
|
| 15818 |
+
* @return {!RegExp}
|
| 15819 |
+
*/
|
| 15820 |
+
function arrayToRegexp (path, keys, options) {
|
| 15821 |
+
var parts = []
|
| 15822 |
+
|
| 15823 |
+
for (var i = 0; i < path.length; i++) {
|
| 15824 |
+
parts.push(pathToRegexp(path[i], keys, options).source)
|
| 15825 |
+
}
|
| 15826 |
+
|
| 15827 |
+
var regexp = new RegExp('(?:' + parts.join('|') + ')', flags(options))
|
| 15828 |
+
|
| 15829 |
+
return attachKeys(regexp, keys)
|
| 15830 |
+
}
|
| 15831 |
+
|
| 15832 |
+
/**
|
| 15833 |
+
* Create a path regexp from string input.
|
| 15834 |
+
*
|
| 15835 |
+
* @param {string} path
|
| 15836 |
+
* @param {!Array} keys
|
| 15837 |
+
* @param {!Object} options
|
| 15838 |
+
* @return {!RegExp}
|
| 15839 |
+
*/
|
| 15840 |
+
function stringToRegexp (path, keys, options) {
|
| 15841 |
+
return tokensToRegExp(parse(path, options), keys, options)
|
| 15842 |
+
}
|
| 15843 |
+
|
| 15844 |
+
/**
|
| 15845 |
+
* Expose a function for taking tokens and returning a RegExp.
|
| 15846 |
+
*
|
| 15847 |
+
* @param {!Array} tokens
|
| 15848 |
+
* @param {(Array|Object)=} keys
|
| 15849 |
+
* @param {Object=} options
|
| 15850 |
+
* @return {!RegExp}
|
| 15851 |
+
*/
|
| 15852 |
+
function tokensToRegExp (tokens, keys, options) {
|
| 15853 |
+
if (!isarray(keys)) {
|
| 15854 |
+
options = /** @type {!Object} */ (keys || options)
|
| 15855 |
+
keys = []
|
| 15856 |
+
}
|
| 15857 |
+
|
| 15858 |
+
options = options || {}
|
| 15859 |
+
|
| 15860 |
+
var strict = options.strict
|
| 15861 |
+
var end = options.end !== false
|
| 15862 |
+
var route = ''
|
| 15863 |
+
|
| 15864 |
+
// Iterate over the tokens and create our regexp string.
|
| 15865 |
+
for (var i = 0; i < tokens.length; i++) {
|
| 15866 |
+
var token = tokens[i]
|
| 15867 |
+
|
| 15868 |
+
if (typeof token === 'string') {
|
| 15869 |
+
route += escapeString(token)
|
| 15870 |
+
} else {
|
| 15871 |
+
var prefix = escapeString(token.prefix)
|
| 15872 |
+
var capture = '(?:' + token.pattern + ')'
|
| 15873 |
+
|
| 15874 |
+
keys.push(token)
|
| 15875 |
+
|
| 15876 |
+
if (token.repeat) {
|
| 15877 |
+
capture += '(?:' + prefix + capture + ')*'
|
| 15878 |
+
}
|
| 15879 |
+
|
| 15880 |
+
if (token.optional) {
|
| 15881 |
+
if (!token.partial) {
|
| 15882 |
+
capture = '(?:' + prefix + '(' + capture + '))?'
|
| 15883 |
+
} else {
|
| 15884 |
+
capture = prefix + '(' + capture + ')?'
|
| 15885 |
+
}
|
| 15886 |
+
} else {
|
| 15887 |
+
capture = prefix + '(' + capture + ')'
|
| 15888 |
+
}
|
| 15889 |
+
|
| 15890 |
+
route += capture
|
| 15891 |
+
}
|
| 15892 |
+
}
|
| 15893 |
+
|
| 15894 |
+
var delimiter = escapeString(options.delimiter || '/')
|
| 15895 |
+
var endsWithDelimiter = route.slice(-delimiter.length) === delimiter
|
| 15896 |
+
|
| 15897 |
+
// In non-strict mode we allow a slash at the end of match. If the path to
|
| 15898 |
+
// match already ends with a slash, we remove it for consistency. The slash
|
| 15899 |
+
// is valid at the end of a path match, not in the middle. This is important
|
| 15900 |
+
// in non-ending mode, where "/test/" shouldn't match "/test//route".
|
| 15901 |
+
if (!strict) {
|
| 15902 |
+
route = (endsWithDelimiter ? route.slice(0, -delimiter.length) : route) + '(?:' + delimiter + '(?=$))?'
|
| 15903 |
+
}
|
| 15904 |
+
|
| 15905 |
+
if (end) {
|
| 15906 |
+
route += '$'
|
| 15907 |
+
} else {
|
| 15908 |
+
// In non-ending mode, we need the capturing groups to match as much as
|
| 15909 |
+
// possible by using a positive lookahead to the end or next path segment.
|
| 15910 |
+
route += strict && endsWithDelimiter ? '' : '(?=' + delimiter + '|$)'
|
| 15911 |
+
}
|
| 15912 |
+
|
| 15913 |
+
return attachKeys(new RegExp('^' + route, flags(options)), keys)
|
| 15914 |
+
}
|
| 15915 |
+
|
| 15916 |
+
/**
|
| 15917 |
+
* Normalize the given path string, returning a regular expression.
|
| 15918 |
+
*
|
| 15919 |
+
* An empty array can be passed in for the keys, which will hold the
|
| 15920 |
+
* placeholder key descriptions. For example, using `/user/:id`, `keys` will
|
| 15921 |
+
* contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`.
|
| 15922 |
+
*
|
| 15923 |
+
* @param {(string|RegExp|Array)} path
|
| 15924 |
+
* @param {(Array|Object)=} keys
|
| 15925 |
+
* @param {Object=} options
|
| 15926 |
+
* @return {!RegExp}
|
| 15927 |
+
*/
|
| 15928 |
+
function pathToRegexp (path, keys, options) {
|
| 15929 |
+
if (!isarray(keys)) {
|
| 15930 |
+
options = /** @type {!Object} */ (keys || options)
|
| 15931 |
+
keys = []
|
| 15932 |
+
}
|
| 15933 |
+
|
| 15934 |
+
options = options || {}
|
| 15935 |
+
|
| 15936 |
+
if (path instanceof RegExp) {
|
| 15937 |
+
return regexpToRegexp(path, /** @type {!Array} */ (keys))
|
| 15938 |
+
}
|
| 15939 |
+
|
| 15940 |
+
if (isarray(path)) {
|
| 15941 |
+
return arrayToRegexp(/** @type {!Array} */ (path), /** @type {!Array} */ (keys), options)
|
| 15942 |
+
}
|
| 15943 |
+
|
| 15944 |
+
return stringToRegexp(/** @type {string} */ (path), /** @type {!Array} */ (keys), options)
|
| 15945 |
+
}
|
| 15946 |
+
|
| 15947 |
+
|
| 15948 |
+
/***/ }),
|
| 15949 |
+
|
| 15950 |
+
/***/ 446:
|
| 15951 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
| 15952 |
+
|
| 15953 |
+
"use strict";
|
| 15954 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getUnreadNotesCount; });
|
| 15955 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return hasValidNotes; });
|
| 15956 |
+
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
|
| 15957 |
+
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__);
|
| 15958 |
+
/**
|
| 15959 |
+
* External dependencies
|
| 15960 |
+
*/
|
| 15961 |
+
|
| 15962 |
+
/**
|
| 15963 |
+
* Get the count of the unread notes from the received list.
|
| 15964 |
+
*
|
| 15965 |
+
* @param {Array} notes - List of notes, contains read and unread notes.
|
| 15966 |
+
* @param {number} lastRead - The timestamp that the user read a note.
|
| 15967 |
+
* @return {number} - Unread notes count.
|
| 15968 |
+
*/
|
| 15969 |
+
|
| 15970 |
+
function getUnreadNotesCount(notes, lastRead) {
|
| 15971 |
+
var unreadNotes = Object(lodash__WEBPACK_IMPORTED_MODULE_0__["filter"])(notes, function (note) {
|
| 15972 |
+
var isDeleted = note.is_deleted,
|
| 15973 |
+
dateCreatedGmt = note.date_created_gmt,
|
| 15974 |
+
status = note.status;
|
| 15975 |
+
|
| 15976 |
+
if (!isDeleted) {
|
| 15977 |
+
var unread = !lastRead || !dateCreatedGmt || new Date(dateCreatedGmt + 'Z').getTime() > lastRead;
|
| 15978 |
+
return unread && status === 'unactioned';
|
| 15979 |
+
}
|
| 15980 |
+
});
|
| 15981 |
+
return unreadNotes.length;
|
| 15982 |
+
}
|
| 15983 |
+
/**
|
| 15984 |
+
* Verifies if there are any valid notes in the list.
|
| 15985 |
+
*
|
| 15986 |
+
* @param {Array} notes - List of notes, contains read and unread notes.
|
| 15987 |
+
* @return {boolean} - Whether there are valid notes or not.
|
| 15988 |
+
*/
|
| 15989 |
+
|
| 15990 |
+
function hasValidNotes(notes) {
|
| 15991 |
+
var validNotes = Object(lodash__WEBPACK_IMPORTED_MODULE_0__["filter"])(notes, function (note) {
|
| 15992 |
+
var isDeleted = note.is_deleted;
|
| 15993 |
+
return !isDeleted;
|
| 15994 |
+
});
|
| 15995 |
+
return validNotes.length > 0;
|
| 15996 |
+
}
|
| 15997 |
+
|
| 15998 |
+
/***/ }),
|
| 15999 |
+
|
| 16000 |
+
/***/ 451:
|
| 16001 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
| 16002 |
+
|
| 16003 |
+
"use strict";
|
| 16004 |
+
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
|
| 16005 |
+
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
|
| 16006 |
+
/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(88);
|
| 16007 |
+
|
| 16008 |
+
|
| 16009 |
+
/**
|
| 16010 |
+
* WordPress dependencies
|
| 16011 |
+
*/
|
| 16012 |
+
|
| 16013 |
+
var close = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__[/* SVG */ "c"], {
|
| 16014 |
+
xmlns: "http://www.w3.org/2000/svg",
|
| 16015 |
+
viewBox: "0 0 24 24"
|
| 16016 |
+
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__[/* Path */ "b"], {
|
| 16017 |
+
d: "M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"
|
| 16018 |
+
}));
|
| 16019 |
+
/* harmony default export */ __webpack_exports__["a"] = (close);
|
| 16020 |
+
//# sourceMappingURL=close.js.map
|
| 16021 |
+
|
| 16022 |
+
/***/ }),
|
| 16023 |
+
|
| 16024 |
+
/***/ 46:
|
| 16025 |
+
/***/ (function(module, exports) {
|
| 16026 |
+
|
| 16027 |
+
var g;
|
| 16028 |
+
|
| 16029 |
+
// This works in non-strict mode
|
| 16030 |
+
g = (function() {
|
| 16031 |
+
return this;
|
| 16032 |
+
})();
|
| 16033 |
+
|
| 16034 |
+
try {
|
| 16035 |
+
// This works if eval is allowed (see CSP)
|
| 16036 |
+
g = g || new Function("return this")();
|
| 16037 |
+
} catch (e) {
|
| 16038 |
+
// This works if the window reference is available
|
| 16039 |
+
if (typeof window === "object") g = window;
|
| 16040 |
+
}
|
| 16041 |
+
|
| 16042 |
+
// g can still be undefined, but nothing to do about it...
|
| 16043 |
+
// We return undefined, instead of nothing here, so it's
|
| 16044 |
+
// easier to handle this case. if(!global) { ...}
|
| 16045 |
+
|
| 16046 |
+
module.exports = g;
|
| 16047 |
+
|
| 16048 |
+
|
| 16049 |
+
/***/ }),
|
| 16050 |
+
|
| 16051 |
+
/***/ 47:
|
| 16052 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
| 16053 |
+
|
| 16054 |
+
"use strict";
|
| 16055 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _typeof; });
|
| 16056 |
+
function _typeof(obj) {
|
| 16057 |
+
"@babel/helpers - typeof";
|
| 16058 |
+
|
| 16059 |
+
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
| 16060 |
+
_typeof = function _typeof(obj) {
|
| 16061 |
+
return typeof obj;
|
| 16062 |
+
};
|
| 16063 |
+
} else {
|
| 16064 |
+
_typeof = function _typeof(obj) {
|
| 16065 |
+
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
| 16066 |
+
};
|
| 16067 |
+
}
|
| 16068 |
+
|
| 16069 |
+
return _typeof(obj);
|
| 16070 |
+
}
|
| 16071 |
+
|
| 16072 |
+
/***/ }),
|
| 16073 |
+
|
| 16074 |
+
/***/ 48:
|
| 16075 |
+
/***/ (function(module, exports) {
|
| 16076 |
+
|
| 16077 |
+
function _typeof(obj) {
|
| 16078 |
+
"@babel/helpers - typeof";
|
| 16079 |
+
|
| 16080 |
+
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
| 16081 |
+
module.exports = _typeof = function _typeof(obj) {
|
| 16082 |
+
return typeof obj;
|
| 16083 |
+
};
|
| 16084 |
+
} else {
|
| 16085 |
+
module.exports = _typeof = function _typeof(obj) {
|
| 16086 |
+
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
| 16087 |
+
};
|
| 16088 |
+
}
|
| 16089 |
+
|
| 16090 |
+
return _typeof(obj);
|
| 16091 |
+
}
|
| 16092 |
+
|
| 16093 |
+
module.exports = _typeof;
|
| 16094 |
+
|
| 16095 |
+
/***/ }),
|
| 16096 |
+
|
| 16097 |
+
/***/ 49:
|
| 16098 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
| 16099 |
+
|
| 16100 |
+
"use strict";
|
| 16101 |
+
|
| 16102 |
+
// EXPORTS
|
| 16103 |
+
__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ serialize_browser_esm_serializeStyles; });
|
| 16104 |
+
|
| 16105 |
+
// CONCATENATED MODULE: ./node_modules/@emotion/hash/dist/hash.browser.esm.js
|
| 16106 |
+
/* eslint-disable */
|
| 16107 |
+
// Inspired by https://github.com/garycourt/murmurhash-js
|
| 16108 |
+
// Ported from https://github.com/aappleby/smhasher/blob/61a0530f28277f2e850bfc39600ce61d02b518de/src/MurmurHash2.cpp#L37-L86
|
| 16109 |
+
function murmur2(str) {
|
| 16110 |
+
// 'm' and 'r' are mixing constants generated offline.
|
| 16111 |
+
// They're not really 'magic', they just happen to work well.
|
| 16112 |
+
// const m = 0x5bd1e995;
|
| 16113 |
+
// const r = 24;
|
| 16114 |
+
// Initialize the hash
|
| 16115 |
+
var h = 0; // Mix 4 bytes at a time into the hash
|
| 16116 |
+
|
| 16117 |
+
var k,
|
| 16118 |
+
i = 0,
|
| 16119 |
+
len = str.length;
|
| 16120 |
+
|
| 16121 |
+
for (; len >= 4; ++i, len -= 4) {
|
| 16122 |
+
k = str.charCodeAt(i) & 0xff | (str.charCodeAt(++i) & 0xff) << 8 | (str.charCodeAt(++i) & 0xff) << 16 | (str.charCodeAt(++i) & 0xff) << 24;
|
| 16123 |
+
k =
|
| 16124 |
+
/* Math.imul(k, m): */
|
| 16125 |
+
(k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16);
|
| 16126 |
+
k ^=
|
| 16127 |
+
/* k >>> r: */
|
| 16128 |
+
k >>> 24;
|
| 16129 |
+
h =
|
| 16130 |
+
/* Math.imul(k, m): */
|
| 16131 |
+
(k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16) ^
|
| 16132 |
+
/* Math.imul(h, m): */
|
| 16133 |
+
(h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);
|
| 16134 |
+
} // Handle the last few bytes of the input array
|
| 16135 |
+
|
| 16136 |
+
|
| 16137 |
+
switch (len) {
|
| 16138 |
+
case 3:
|
| 16139 |
+
h ^= (str.charCodeAt(i + 2) & 0xff) << 16;
|
| 16140 |
+
|
| 16141 |
+
case 2:
|
| 16142 |
+
h ^= (str.charCodeAt(i + 1) & 0xff) << 8;
|
| 16143 |
+
|
| 16144 |
+
case 1:
|
| 16145 |
+
h ^= str.charCodeAt(i) & 0xff;
|
| 16146 |
+
h =
|
| 16147 |
+
/* Math.imul(h, m): */
|
| 16148 |
+
(h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);
|
| 16149 |
+
} // Do a few final mixes of the hash to ensure the last few
|
| 16150 |
+
// bytes are well-incorporated.
|
| 16151 |
+
|
| 16152 |
+
|
| 16153 |
+
h ^= h >>> 13;
|
| 16154 |
+
h =
|
| 16155 |
+
/* Math.imul(h, m): */
|
| 16156 |
+
(h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);
|
| 16157 |
+
return ((h ^ h >>> 15) >>> 0).toString(36);
|
| 16158 |
+
}
|
| 16159 |
+
|
| 16160 |
+
/* harmony default export */ var hash_browser_esm = (murmur2);
|
| 16161 |
+
|
| 16162 |
+
// CONCATENATED MODULE: ./node_modules/@emotion/unitless/dist/unitless.browser.esm.js
|
| 16163 |
+
var unitlessKeys = {
|
| 16164 |
+
animationIterationCount: 1,
|
| 16165 |
+
borderImageOutset: 1,
|
| 16166 |
+
borderImageSlice: 1,
|
| 16167 |
+
borderImageWidth: 1,
|
| 16168 |
+
boxFlex: 1,
|
| 16169 |
+
boxFlexGroup: 1,
|
| 16170 |
+
boxOrdinalGroup: 1,
|
| 16171 |
+
columnCount: 1,
|
| 16172 |
+
columns: 1,
|
| 16173 |
+
flex: 1,
|
| 16174 |
+
flexGrow: 1,
|
| 16175 |
+
flexPositive: 1,
|
| 16176 |
+
flexShrink: 1,
|
| 16177 |
+
flexNegative: 1,
|
| 16178 |
+
flexOrder: 1,
|
| 16179 |
+
gridRow: 1,
|
| 16180 |
+
gridRowEnd: 1,
|
| 16181 |
+
gridRowSpan: 1,
|
| 16182 |
+
gridRowStart: 1,
|
| 16183 |
+
gridColumn: 1,
|
| 16184 |
+
gridColumnEnd: 1,
|
| 16185 |
+
gridColumnSpan: 1,
|
| 16186 |
+
gridColumnStart: 1,
|
| 16187 |
+
msGridRow: 1,
|
| 16188 |
+
msGridRowSpan: 1,
|
| 16189 |
+
msGridColumn: 1,
|
| 16190 |
+
msGridColumnSpan: 1,
|
| 16191 |
+
fontWeight: 1,
|
| 16192 |
+
lineHeight: 1,
|
| 16193 |
+
opacity: 1,
|
| 16194 |
+
order: 1,
|
| 16195 |
+
orphans: 1,
|
| 16196 |
+
tabSize: 1,
|
| 16197 |
+
widows: 1,
|
| 16198 |
+
zIndex: 1,
|
| 16199 |
+
zoom: 1,
|
| 16200 |
+
WebkitLineClamp: 1,
|
| 16201 |
+
// SVG-related properties
|
| 16202 |
+
fillOpacity: 1,
|
| 16203 |
+
floodOpacity: 1,
|
| 16204 |
+
stopOpacity: 1,
|
| 16205 |
+
strokeDasharray: 1,
|
| 16206 |
+
strokeDashoffset: 1,
|
| 16207 |
+
strokeMiterlimit: 1,
|
| 16208 |
+
strokeOpacity: 1,
|
| 16209 |
+
strokeWidth: 1
|
| 16210 |
+
};
|
| 16211 |
+
|
| 16212 |
+
/* harmony default export */ var unitless_browser_esm = (unitlessKeys);
|
| 16213 |
+
|
| 16214 |
+
// EXTERNAL MODULE: ./node_modules/@emotion/memoize/dist/memoize.browser.esm.js
|
| 16215 |
+
var memoize_browser_esm = __webpack_require__(102);
|
| 16216 |
+
|
| 16217 |
+
// CONCATENATED MODULE: ./node_modules/@emotion/serialize/dist/serialize.browser.esm.js
|
| 16218 |
+
|
| 16219 |
+
|
| 16220 |
+
|
| 16221 |
+
|
| 16222 |
+
var ILLEGAL_ESCAPE_SEQUENCE_ERROR = "You have illegal escape sequence in your template literal, most likely inside content's property value.\nBecause you write your CSS inside a JavaScript string you actually have to do double escaping, so for example \"content: '\\00d7';\" should become \"content: '\\\\00d7';\".\nYou can read more about this here:\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences";
|
| 16223 |
+
var UNDEFINED_AS_OBJECT_KEY_ERROR = "You have passed in falsy value as style object's key (can happen when in example you pass unexported component as computed key).";
|
| 16224 |
+
var hyphenateRegex = /[A-Z]|^ms/g;
|
| 16225 |
+
var animationRegex = /_EMO_([^_]+?)_([^]*?)_EMO_/g;
|
| 16226 |
+
|
| 16227 |
+
var isCustomProperty = function isCustomProperty(property) {
|
| 16228 |
+
return property.charCodeAt(1) === 45;
|
| 16229 |
+
};
|
| 16230 |
+
|
| 16231 |
+
var isProcessableValue = function isProcessableValue(value) {
|
| 16232 |
+
return value != null && typeof value !== 'boolean';
|
| 16233 |
+
};
|
| 16234 |
+
|
| 16235 |
+
var processStyleName = Object(memoize_browser_esm["a" /* default */])(function (styleName) {
|
| 16236 |
+
return isCustomProperty(styleName) ? styleName : styleName.replace(hyphenateRegex, '-$&').toLowerCase();
|
| 16237 |
+
});
|
| 16238 |
+
|
| 16239 |
+
var serialize_browser_esm_processStyleValue = function processStyleValue(key, value) {
|
| 16240 |
+
switch (key) {
|
| 16241 |
+
case 'animation':
|
| 16242 |
+
case 'animationName':
|
| 16243 |
+
{
|
| 16244 |
+
if (typeof value === 'string') {
|
| 16245 |
+
return value.replace(animationRegex, function (match, p1, p2) {
|
| 16246 |
+
cursor = {
|
| 16247 |
+
name: p1,
|
| 16248 |
+
styles: p2,
|
| 16249 |
+
next: cursor
|
| 16250 |
+
};
|
| 16251 |
+
return p1;
|
| 16252 |
+
});
|
| 16253 |
}
|
| 16254 |
+
}
|
| 16255 |
+
}
|
| 16256 |
|
| 16257 |
+
if (unitless_browser_esm[key] !== 1 && !isCustomProperty(key) && typeof value === 'number' && value !== 0) {
|
| 16258 |
+
return value + 'px';
|
| 16259 |
+
}
|
|
|
|
| 16260 |
|
| 16261 |
+
return value;
|
| 16262 |
+
};
|
| 16263 |
+
|
| 16264 |
+
if (false) { var hyphenatedCache, hyphenPattern, msPattern, oldProcessStyleValue, contentValues, contentValuePattern; }
|
| 16265 |
+
|
| 16266 |
+
var shouldWarnAboutInterpolatingClassNameFromCss = true;
|
| 16267 |
+
|
| 16268 |
+
function handleInterpolation(mergedProps, registered, interpolation, couldBeSelectorInterpolation) {
|
| 16269 |
+
if (interpolation == null) {
|
| 16270 |
+
return '';
|
| 16271 |
+
}
|
| 16272 |
+
|
| 16273 |
+
if (interpolation.__emotion_styles !== undefined) {
|
| 16274 |
+
if (false) {}
|
| 16275 |
+
|
| 16276 |
+
return interpolation;
|
| 16277 |
+
}
|
| 16278 |
+
|
| 16279 |
+
switch (typeof interpolation) {
|
| 16280 |
+
case 'boolean':
|
| 16281 |
+
{
|
| 16282 |
+
return '';
|
| 16283 |
+
}
|
| 16284 |
+
|
| 16285 |
+
case 'object':
|
| 16286 |
+
{
|
| 16287 |
+
if (interpolation.anim === 1) {
|
| 16288 |
+
cursor = {
|
| 16289 |
+
name: interpolation.name,
|
| 16290 |
+
styles: interpolation.styles,
|
| 16291 |
+
next: cursor
|
| 16292 |
+
};
|
| 16293 |
+
return interpolation.name;
|
| 16294 |
}
|
| 16295 |
|
| 16296 |
+
if (interpolation.styles !== undefined) {
|
| 16297 |
+
var next = interpolation.next;
|
| 16298 |
+
|
| 16299 |
+
if (next !== undefined) {
|
| 16300 |
+
// not the most efficient thing ever but this is a pretty rare case
|
| 16301 |
+
// and there will be very few iterations of this generally
|
| 16302 |
+
while (next !== undefined) {
|
| 16303 |
+
cursor = {
|
| 16304 |
+
name: next.name,
|
| 16305 |
+
styles: next.styles,
|
| 16306 |
+
next: cursor
|
| 16307 |
+
};
|
| 16308 |
+
next = next.next;
|
| 16309 |
+
}
|
| 16310 |
+
}
|
| 16311 |
+
|
| 16312 |
+
var styles = interpolation.styles + ";";
|
| 16313 |
+
|
| 16314 |
+
if (false) {}
|
| 16315 |
+
|
| 16316 |
+
return styles;
|
| 16317 |
}
|
| 16318 |
+
|
| 16319 |
+
return createStringFromObject(mergedProps, registered, interpolation);
|
| 16320 |
+
}
|
| 16321 |
+
|
| 16322 |
+
case 'function':
|
| 16323 |
+
{
|
| 16324 |
+
if (mergedProps !== undefined) {
|
| 16325 |
+
var previousCursor = cursor;
|
| 16326 |
+
var result = interpolation(mergedProps);
|
| 16327 |
+
cursor = previousCursor;
|
| 16328 |
+
return handleInterpolation(mergedProps, registered, result, couldBeSelectorInterpolation);
|
| 16329 |
+
} else if (false) {}
|
| 16330 |
+
|
| 16331 |
+
break;
|
| 16332 |
+
}
|
| 16333 |
+
|
| 16334 |
+
case 'string':
|
| 16335 |
+
if (false) { var replaced, matched; }
|
| 16336 |
+
|
| 16337 |
+
break;
|
| 16338 |
+
} // finalize string values (regular strings and functions interpolated into css calls)
|
| 16339 |
+
|
| 16340 |
+
|
| 16341 |
+
if (registered == null) {
|
| 16342 |
+
return interpolation;
|
| 16343 |
}
|
| 16344 |
|
| 16345 |
+
var cached = registered[interpolation];
|
|
|
|
|
|
|
|
|
|
| 16346 |
|
| 16347 |
+
if (false) {}
|
|
|
|
|
|
|
|
|
|
| 16348 |
|
| 16349 |
+
return cached !== undefined && !couldBeSelectorInterpolation ? cached : interpolation;
|
| 16350 |
+
}
|
| 16351 |
|
| 16352 |
+
function createStringFromObject(mergedProps, registered, obj) {
|
| 16353 |
+
var string = '';
|
|
|
|
| 16354 |
|
| 16355 |
+
if (Array.isArray(obj)) {
|
| 16356 |
+
for (var i = 0; i < obj.length; i++) {
|
| 16357 |
+
string += handleInterpolation(mergedProps, registered, obj[i], false);
|
| 16358 |
+
}
|
| 16359 |
+
} else {
|
| 16360 |
+
for (var _key in obj) {
|
| 16361 |
+
var value = obj[_key];
|
| 16362 |
+
|
| 16363 |
+
if (typeof value !== 'object') {
|
| 16364 |
+
if (registered != null && registered[value] !== undefined) {
|
| 16365 |
+
string += _key + "{" + registered[value] + "}";
|
| 16366 |
+
} else if (isProcessableValue(value)) {
|
| 16367 |
+
string += processStyleName(_key) + ":" + serialize_browser_esm_processStyleValue(_key, value) + ";";
|
| 16368 |
+
}
|
| 16369 |
+
} else {
|
| 16370 |
+
if (_key === 'NO_COMPONENT_SELECTOR' && "production" !== 'production') {
|
| 16371 |
+
throw new Error('Component selectors can only be used in conjunction with babel-plugin-emotion.');
|
| 16372 |
+
}
|
| 16373 |
+
|
| 16374 |
+
if (Array.isArray(value) && typeof value[0] === 'string' && (registered == null || registered[value[0]] === undefined)) {
|
| 16375 |
+
for (var _i = 0; _i < value.length; _i++) {
|
| 16376 |
+
if (isProcessableValue(value[_i])) {
|
| 16377 |
+
string += processStyleName(_key) + ":" + serialize_browser_esm_processStyleValue(_key, value[_i]) + ";";
|
| 16378 |
+
}
|
| 16379 |
+
}
|
| 16380 |
+
} else {
|
| 16381 |
+
var interpolated = handleInterpolation(mergedProps, registered, value, false);
|
| 16382 |
+
|
| 16383 |
+
switch (_key) {
|
| 16384 |
+
case 'animation':
|
| 16385 |
+
case 'animationName':
|
| 16386 |
+
{
|
| 16387 |
+
string += processStyleName(_key) + ":" + interpolated + ";";
|
| 16388 |
+
break;
|
| 16389 |
+
}
|
| 16390 |
+
|
| 16391 |
+
default:
|
| 16392 |
+
{
|
| 16393 |
+
if (false) {}
|
| 16394 |
+
|
| 16395 |
+
string += _key + "{" + interpolated + "}";
|
| 16396 |
+
}
|
| 16397 |
+
}
|
| 16398 |
+
}
|
| 16399 |
+
}
|
| 16400 |
+
}
|
| 16401 |
+
}
|
| 16402 |
+
|
| 16403 |
+
return string;
|
| 16404 |
}
|
| 16405 |
|
| 16406 |
+
var labelPattern = /label:\s*([^\s;\n{]+)\s*;/g;
|
| 16407 |
+
var sourceMapPattern;
|
| 16408 |
+
|
| 16409 |
+
if (false) {} // this is the cursor for keyframes
|
| 16410 |
+
// keyframes are stored on the SerializedStyles object as a linked list
|
| 16411 |
+
|
| 16412 |
+
|
| 16413 |
+
var cursor;
|
| 16414 |
+
var serialize_browser_esm_serializeStyles = function serializeStyles(args, registered, mergedProps) {
|
| 16415 |
+
if (args.length === 1 && typeof args[0] === 'object' && args[0] !== null && args[0].styles !== undefined) {
|
| 16416 |
+
return args[0];
|
| 16417 |
+
}
|
| 16418 |
+
|
| 16419 |
+
var stringMode = true;
|
| 16420 |
+
var styles = '';
|
| 16421 |
+
cursor = undefined;
|
| 16422 |
+
var strings = args[0];
|
| 16423 |
+
|
| 16424 |
+
if (strings == null || strings.raw === undefined) {
|
| 16425 |
+
stringMode = false;
|
| 16426 |
+
styles += handleInterpolation(mergedProps, registered, strings, false);
|
| 16427 |
+
} else {
|
| 16428 |
+
if (false) {}
|
| 16429 |
+
|
| 16430 |
+
styles += strings[0];
|
| 16431 |
+
} // we start at 1 since we've already handled the first arg
|
| 16432 |
+
|
| 16433 |
+
|
| 16434 |
+
for (var i = 1; i < args.length; i++) {
|
| 16435 |
+
styles += handleInterpolation(mergedProps, registered, args[i], styles.charCodeAt(styles.length - 1) === 46);
|
| 16436 |
+
|
| 16437 |
+
if (stringMode) {
|
| 16438 |
+
if (false) {}
|
| 16439 |
+
|
| 16440 |
+
styles += strings[i];
|
| 16441 |
+
}
|
| 16442 |
+
}
|
| 16443 |
+
|
| 16444 |
+
var sourceMap;
|
| 16445 |
+
|
| 16446 |
+
if (false) {} // using a global regex with .exec is stateful so lastIndex has to be reset each time
|
| 16447 |
+
|
| 16448 |
+
|
| 16449 |
+
labelPattern.lastIndex = 0;
|
| 16450 |
+
var identifierName = '';
|
| 16451 |
+
var match; // https://esbench.com/bench/5b809c2cf2949800a0f61fb5
|
| 16452 |
+
|
| 16453 |
+
while ((match = labelPattern.exec(styles)) !== null) {
|
| 16454 |
+
identifierName += '-' + // $FlowFixMe we know it's not null
|
| 16455 |
+
match[1];
|
| 16456 |
+
}
|
| 16457 |
+
|
| 16458 |
+
var name = hash_browser_esm(styles) + identifierName;
|
| 16459 |
+
|
| 16460 |
+
if (false) {}
|
| 16461 |
+
|
| 16462 |
+
return {
|
| 16463 |
+
name: name,
|
| 16464 |
+
styles: styles,
|
| 16465 |
+
next: cursor
|
| 16466 |
+
};
|
| 16467 |
+
};
|
| 16468 |
+
|
| 16469 |
|
|
|
|
|
|
|
| 16470 |
|
|
|
|
|
|
|
|
|
|
| 16471 |
|
| 16472 |
+
/***/ }),
|
| 16473 |
|
| 16474 |
+
/***/ 5:
|
| 16475 |
+
/***/ (function(module, exports) {
|
|
|
|
| 16476 |
|
| 16477 |
+
function _defineProperty(obj, key, value) {
|
| 16478 |
+
if (key in obj) {
|
| 16479 |
+
Object.defineProperty(obj, key, {
|
| 16480 |
+
value: value,
|
| 16481 |
+
enumerable: true,
|
| 16482 |
+
configurable: true,
|
| 16483 |
+
writable: true
|
| 16484 |
+
});
|
| 16485 |
+
} else {
|
| 16486 |
+
obj[key] = value;
|
| 16487 |
}
|
| 16488 |
|
| 16489 |
+
return obj;
|
| 16490 |
+
}
|
| 16491 |
|
| 16492 |
+
module.exports = _defineProperty;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16493 |
|
| 16494 |
+
/***/ }),
|
|
|
|
|
|
|
| 16495 |
|
| 16496 |
+
/***/ 50:
|
| 16497 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
| 16498 |
|
| 16499 |
+
"use strict";
|
| 16500 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getRegisteredStyles; });
|
| 16501 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return insertStyles; });
|
| 16502 |
+
var isBrowser = "object" !== 'undefined';
|
| 16503 |
+
function getRegisteredStyles(registered, registeredStyles, classNames) {
|
| 16504 |
+
var rawClassName = '';
|
| 16505 |
+
classNames.split(' ').forEach(function (className) {
|
| 16506 |
+
if (registered[className] !== undefined) {
|
| 16507 |
+
registeredStyles.push(registered[className]);
|
| 16508 |
+
} else {
|
| 16509 |
+
rawClassName += className + " ";
|
| 16510 |
+
}
|
| 16511 |
+
});
|
| 16512 |
+
return rawClassName;
|
| 16513 |
}
|
| 16514 |
+
var insertStyles = function insertStyles(cache, serialized, isStringTag) {
|
| 16515 |
+
var className = cache.key + "-" + serialized.name;
|
| 16516 |
+
|
| 16517 |
+
if ( // we only need to add the styles to the registered cache if the
|
| 16518 |
+
// class name could be used further down
|
| 16519 |
+
// the tree but if it's a string tag, we know it won't
|
| 16520 |
+
// so we don't have to add it to registered cache.
|
| 16521 |
+
// this improves memory usage since we can avoid storing the whole style string
|
| 16522 |
+
(isStringTag === false || // we need to always store it if we're in compat mode and
|
| 16523 |
+
// in node since emotion-server relies on whether a style is in
|
| 16524 |
+
// the registered cache to know whether a style is global or not
|
| 16525 |
+
// also, note that this check will be dead code eliminated in the browser
|
| 16526 |
+
isBrowser === false && cache.compat !== undefined) && cache.registered[className] === undefined) {
|
| 16527 |
+
cache.registered[className] = serialized.styles;
|
| 16528 |
+
}
|
| 16529 |
|
| 16530 |
+
if (cache.inserted[serialized.name] === undefined) {
|
| 16531 |
+
var current = serialized;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16532 |
|
| 16533 |
+
do {
|
| 16534 |
+
var maybeStyles = cache.insert("." + className, current, cache.sheet, true);
|
| 16535 |
|
| 16536 |
+
current = current.next;
|
| 16537 |
+
} while (current !== undefined);
|
| 16538 |
+
}
|
| 16539 |
+
};
|
| 16540 |
|
|
|
|
|
|
|
| 16541 |
|
|
|
|
|
|
|
| 16542 |
|
|
|
|
|
|
|
| 16543 |
|
| 16544 |
+
/***/ }),
|
|
|
|
|
|
|
| 16545 |
|
| 16546 |
+
/***/ 51:
|
| 16547 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
| 16548 |
|
| 16549 |
+
"use strict";
|
| 16550 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _taggedTemplateLiteral; });
|
| 16551 |
+
function _taggedTemplateLiteral(strings, raw) {
|
| 16552 |
+
if (!raw) {
|
| 16553 |
+
raw = strings.slice(0);
|
| 16554 |
+
}
|
| 16555 |
+
|
| 16556 |
+
return Object.freeze(Object.defineProperties(strings, {
|
| 16557 |
+
raw: {
|
| 16558 |
+
value: Object.freeze(raw)
|
| 16559 |
+
}
|
| 16560 |
+
}));
|
| 16561 |
+
}
|
| 16562 |
+
|
| 16563 |
+
/***/ }),
|
| 16564 |
+
|
| 16565 |
+
/***/ 53:
|
| 16566 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
| 16567 |
+
|
| 16568 |
+
"use strict";
|
| 16569 |
|
| 16570 |
+
// EXPORTS
|
| 16571 |
+
__webpack_require__.d(__webpack_exports__, "c", function() { return /* binding */ context_useSlot; });
|
| 16572 |
+
__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ Consumer; });
|
| 16573 |
|
| 16574 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js + 3 modules
|
| 16575 |
+
var slicedToArray = __webpack_require__(26);
|
| 16576 |
|
| 16577 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js + 3 modules
|
| 16578 |
+
var toConsumableArray = __webpack_require__(27);
|
| 16579 |
|
| 16580 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js
|
| 16581 |
+
var classCallCheck = __webpack_require__(21);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16582 |
|
| 16583 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/createClass.js
|
| 16584 |
+
var createClass = __webpack_require__(22);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16585 |
|
| 16586 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js
|
| 16587 |
+
var assertThisInitialized = __webpack_require__(13);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16588 |
|
| 16589 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/inherits.js + 1 modules
|
| 16590 |
+
var inherits = __webpack_require__(23);
|
| 16591 |
|
| 16592 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js
|
| 16593 |
+
var possibleConstructorReturn = __webpack_require__(24);
|
| 16594 |
|
| 16595 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js
|
| 16596 |
+
var getPrototypeOf = __webpack_require__(10);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16597 |
|
| 16598 |
+
// EXTERNAL MODULE: external {"this":["wp","element"]}
|
| 16599 |
+
var external_this_wp_element_ = __webpack_require__(0);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16600 |
|
| 16601 |
+
// EXTERNAL MODULE: external "lodash"
|
| 16602 |
+
var external_lodash_ = __webpack_require__(2);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16603 |
|
| 16604 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/typeof.js
|
| 16605 |
+
var esm_typeof = __webpack_require__(47);
|
| 16606 |
|
| 16607 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js
|
| 16608 |
+
var objectWithoutProperties = __webpack_require__(12);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16609 |
|
| 16610 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
|
| 16611 |
+
var defineProperty = __webpack_require__(8);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16612 |
|
| 16613 |
+
// EXTERNAL MODULE: ./node_modules/@wordpress/is-shallow-equal/lib/index.js
|
| 16614 |
+
var lib = __webpack_require__(82);
|
| 16615 |
+
var lib_default = /*#__PURE__*/__webpack_require__.n(lib);
|
|
|
|
|
|
|
|
|
|
| 16616 |
|
| 16617 |
+
// EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/bubbles-virtually/slot-fill-context.js
|
| 16618 |
+
var slot_fill_context = __webpack_require__(63);
|
|
|
|
|
|
|
| 16619 |
|
| 16620 |
+
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16621 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16622 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16623 |
|
| 16624 |
|
|
|
|
|
|
|
| 16625 |
|
|
|
|
| 16626 |
|
| 16627 |
+
|
| 16628 |
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return Object(esm_typeof["a" /* default */])(key) === "symbol" ? key : String(key); }
|
| 16629 |
+
|
| 16630 |
+
function _toPrimitive(input, hint) { if (Object(esm_typeof["a" /* default */])(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (Object(esm_typeof["a" /* default */])(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
| 16631 |
+
|
| 16632 |
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
| 16633 |
+
|
| 16634 |
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
| 16635 |
+
|
| 16636 |
/**
|
| 16637 |
+
* WordPress dependencies
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16638 |
*/
|
| 16639 |
|
| 16640 |
+
|
| 16641 |
+
/**
|
| 16642 |
+
* Internal dependencies
|
| 16643 |
+
*/
|
| 16644 |
+
|
| 16645 |
+
|
| 16646 |
+
|
| 16647 |
+
function useSlotRegistry() {
|
| 16648 |
+
var _useState = Object(external_this_wp_element_["useState"])({}),
|
| 16649 |
+
_useState2 = Object(slicedToArray["a" /* default */])(_useState, 2),
|
| 16650 |
+
slots = _useState2[0],
|
| 16651 |
+
setSlots = _useState2[1];
|
| 16652 |
+
|
| 16653 |
+
var _useState3 = Object(external_this_wp_element_["useState"])({}),
|
| 16654 |
+
_useState4 = Object(slicedToArray["a" /* default */])(_useState3, 2),
|
| 16655 |
+
fills = _useState4[0],
|
| 16656 |
+
setFills = _useState4[1];
|
| 16657 |
+
|
| 16658 |
+
var registerSlot = Object(external_this_wp_element_["useCallback"])(function (name, ref, fillProps) {
|
| 16659 |
+
setSlots(function (prevSlots) {
|
| 16660 |
+
var slot = prevSlots[name] || {};
|
| 16661 |
+
return _objectSpread(_objectSpread({}, prevSlots), {}, Object(defineProperty["a" /* default */])({}, name, _objectSpread(_objectSpread({}, slot), {}, {
|
| 16662 |
+
ref: ref || slot.ref,
|
| 16663 |
+
fillProps: fillProps || slot.fillProps || {}
|
| 16664 |
+
})));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16665 |
});
|
| 16666 |
+
}, []);
|
| 16667 |
+
var unregisterSlot = Object(external_this_wp_element_["useCallback"])(function (name, ref) {
|
| 16668 |
+
setSlots(function (prevSlots) {
|
| 16669 |
+
var slot = prevSlots[name],
|
| 16670 |
+
nextSlots = Object(objectWithoutProperties["a" /* default */])(prevSlots, [name].map(_toPropertyKey)); // Make sure we're not unregistering a slot registered by another element
|
| 16671 |
+
// See https://github.com/WordPress/gutenberg/pull/19242#issuecomment-590295412
|
| 16672 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16673 |
|
| 16674 |
+
if ((slot === null || slot === void 0 ? void 0 : slot.ref) === ref) {
|
| 16675 |
+
return nextSlots;
|
| 16676 |
+
}
|
| 16677 |
|
| 16678 |
+
return prevSlots;
|
| 16679 |
+
});
|
| 16680 |
+
}, []);
|
| 16681 |
+
var updateSlot = Object(external_this_wp_element_["useCallback"])(function (name, fillProps) {
|
| 16682 |
+
var slot = slots[name];
|
|
|
|
|
|
|
| 16683 |
|
| 16684 |
+
if (!slot) {
|
| 16685 |
+
return;
|
| 16686 |
+
}
|
| 16687 |
|
| 16688 |
+
if (!lib_default()(slot.fillProps, fillProps)) {
|
| 16689 |
+
slot.fillProps = fillProps;
|
| 16690 |
+
var slotFills = fills[name];
|
| 16691 |
|
| 16692 |
+
if (slotFills) {
|
| 16693 |
+
// Force update fills
|
| 16694 |
+
slotFills.map(function (fill) {
|
| 16695 |
+
return fill.current.rerender();
|
| 16696 |
+
});
|
| 16697 |
+
}
|
| 16698 |
+
}
|
| 16699 |
+
}, [slots, fills]);
|
| 16700 |
+
var registerFill = Object(external_this_wp_element_["useCallback"])(function (name, ref) {
|
| 16701 |
+
setFills(function (prevFills) {
|
| 16702 |
+
return _objectSpread(_objectSpread({}, prevFills), {}, Object(defineProperty["a" /* default */])({}, name, [].concat(Object(toConsumableArray["a" /* default */])(prevFills[name] || []), [ref])));
|
| 16703 |
+
});
|
| 16704 |
+
}, []);
|
| 16705 |
+
var unregisterFill = Object(external_this_wp_element_["useCallback"])(function (name, ref) {
|
| 16706 |
+
setFills(function (prevFills) {
|
| 16707 |
+
if (prevFills[name]) {
|
| 16708 |
+
return _objectSpread(_objectSpread({}, prevFills), {}, Object(defineProperty["a" /* default */])({}, name, prevFills[name].filter(function (fillRef) {
|
| 16709 |
+
return fillRef !== ref;
|
| 16710 |
+
})));
|
| 16711 |
+
}
|
| 16712 |
+
|
| 16713 |
+
return prevFills;
|
| 16714 |
+
});
|
| 16715 |
+
}, []); // Memoizing the return value so it can be directly passed to Provider value
|
| 16716 |
+
|
| 16717 |
+
var registry = Object(external_this_wp_element_["useMemo"])(function () {
|
| 16718 |
+
return {
|
| 16719 |
+
slots: slots,
|
| 16720 |
+
fills: fills,
|
| 16721 |
+
registerSlot: registerSlot,
|
| 16722 |
+
updateSlot: updateSlot,
|
| 16723 |
+
unregisterSlot: unregisterSlot,
|
| 16724 |
+
registerFill: registerFill,
|
| 16725 |
+
unregisterFill: unregisterFill
|
| 16726 |
+
};
|
| 16727 |
+
}, [slots, fills, registerSlot, updateSlot, unregisterSlot, registerFill, unregisterFill]);
|
| 16728 |
+
return registry;
|
| 16729 |
+
}
|
| 16730 |
|
| 16731 |
+
function slot_fill_provider_SlotFillProvider(_ref) {
|
| 16732 |
+
var children = _ref.children;
|
| 16733 |
+
var registry = useSlotRegistry();
|
| 16734 |
+
return Object(external_this_wp_element_["createElement"])(slot_fill_context["a" /* default */].Provider, {
|
| 16735 |
+
value: registry
|
| 16736 |
+
}, children);
|
| 16737 |
+
}
|
| 16738 |
+
//# sourceMappingURL=slot-fill-provider.js.map
|
| 16739 |
+
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/context.js
|
| 16740 |
|
|
|
|
| 16741 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16742 |
|
| 16743 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16744 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16745 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16746 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16747 |
|
| 16748 |
|
|
|
|
| 16749 |
|
| 16750 |
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Object(getPrototypeOf["a" /* default */])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Object(getPrototypeOf["a" /* default */])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Object(possibleConstructorReturn["a" /* default */])(this, result); }; }
|
|
|
|
| 16751 |
|
| 16752 |
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16753 |
|
| 16754 |
+
/**
|
| 16755 |
+
* External dependencies
|
| 16756 |
+
*/
|
| 16757 |
|
| 16758 |
+
/**
|
| 16759 |
+
* WordPress dependencies
|
| 16760 |
+
*/
|
| 16761 |
|
| 16762 |
|
| 16763 |
+
/**
|
| 16764 |
+
* Internal dependencies
|
| 16765 |
+
*/
|
| 16766 |
|
|
|
|
|
|
|
| 16767 |
|
| 16768 |
+
var SlotFillContext = Object(external_this_wp_element_["createContext"])({
|
| 16769 |
+
registerSlot: function registerSlot() {},
|
| 16770 |
+
unregisterSlot: function unregisterSlot() {},
|
| 16771 |
+
registerFill: function registerFill() {},
|
| 16772 |
+
unregisterFill: function unregisterFill() {},
|
| 16773 |
+
getSlot: function getSlot() {},
|
| 16774 |
+
getFills: function getFills() {},
|
| 16775 |
+
subscribe: function subscribe() {}
|
| 16776 |
+
});
|
| 16777 |
+
var Provider = SlotFillContext.Provider,
|
| 16778 |
+
Consumer = SlotFillContext.Consumer;
|
| 16779 |
|
| 16780 |
+
var context_SlotFillProvider = /*#__PURE__*/function (_Component) {
|
| 16781 |
+
Object(inherits["a" /* default */])(SlotFillProvider, _Component);
|
| 16782 |
+
|
| 16783 |
+
var _super = _createSuper(SlotFillProvider);
|
| 16784 |
+
|
| 16785 |
+
function SlotFillProvider() {
|
| 16786 |
+
var _this;
|
| 16787 |
+
|
| 16788 |
+
Object(classCallCheck["a" /* default */])(this, SlotFillProvider);
|
| 16789 |
+
|
| 16790 |
+
_this = _super.apply(this, arguments);
|
| 16791 |
+
_this.registerSlot = _this.registerSlot.bind(Object(assertThisInitialized["a" /* default */])(_this));
|
| 16792 |
+
_this.registerFill = _this.registerFill.bind(Object(assertThisInitialized["a" /* default */])(_this));
|
| 16793 |
+
_this.unregisterSlot = _this.unregisterSlot.bind(Object(assertThisInitialized["a" /* default */])(_this));
|
| 16794 |
+
_this.unregisterFill = _this.unregisterFill.bind(Object(assertThisInitialized["a" /* default */])(_this));
|
| 16795 |
+
_this.getSlot = _this.getSlot.bind(Object(assertThisInitialized["a" /* default */])(_this));
|
| 16796 |
+
_this.getFills = _this.getFills.bind(Object(assertThisInitialized["a" /* default */])(_this));
|
| 16797 |
+
_this.hasFills = _this.hasFills.bind(Object(assertThisInitialized["a" /* default */])(_this));
|
| 16798 |
+
_this.subscribe = _this.subscribe.bind(Object(assertThisInitialized["a" /* default */])(_this));
|
| 16799 |
+
_this.slots = {};
|
| 16800 |
+
_this.fills = {};
|
| 16801 |
+
_this.listeners = [];
|
| 16802 |
+
_this.contextValue = {
|
| 16803 |
+
registerSlot: _this.registerSlot,
|
| 16804 |
+
unregisterSlot: _this.unregisterSlot,
|
| 16805 |
+
registerFill: _this.registerFill,
|
| 16806 |
+
unregisterFill: _this.unregisterFill,
|
| 16807 |
+
getSlot: _this.getSlot,
|
| 16808 |
+
getFills: _this.getFills,
|
| 16809 |
+
hasFills: _this.hasFills,
|
| 16810 |
+
subscribe: _this.subscribe
|
| 16811 |
+
};
|
| 16812 |
+
return _this;
|
| 16813 |
}
|
|
|
|
| 16814 |
|
| 16815 |
+
Object(createClass["a" /* default */])(SlotFillProvider, [{
|
| 16816 |
+
key: "registerSlot",
|
| 16817 |
+
value: function registerSlot(name, slot) {
|
| 16818 |
+
var previousSlot = this.slots[name];
|
| 16819 |
+
this.slots[name] = slot;
|
| 16820 |
+
this.triggerListeners(); // Sometimes the fills are registered after the initial render of slot
|
| 16821 |
+
// But before the registerSlot call, we need to rerender the slot
|
| 16822 |
+
|
| 16823 |
+
this.forceUpdateSlot(name); // If a new instance of a slot is being mounted while another with the
|
| 16824 |
+
// same name exists, force its update _after_ the new slot has been
|
| 16825 |
+
// assigned into the instance, such that its own rendering of children
|
| 16826 |
+
// will be empty (the new Slot will subsume all fills for this name).
|
| 16827 |
+
|
| 16828 |
+
if (previousSlot) {
|
| 16829 |
+
previousSlot.forceUpdate();
|
| 16830 |
+
}
|
| 16831 |
+
}
|
| 16832 |
+
}, {
|
| 16833 |
+
key: "registerFill",
|
| 16834 |
+
value: function registerFill(name, instance) {
|
| 16835 |
+
this.fills[name] = [].concat(Object(toConsumableArray["a" /* default */])(this.fills[name] || []), [instance]);
|
| 16836 |
+
this.forceUpdateSlot(name);
|
| 16837 |
+
}
|
| 16838 |
+
}, {
|
| 16839 |
+
key: "unregisterSlot",
|
| 16840 |
+
value: function unregisterSlot(name, instance) {
|
| 16841 |
+
// If a previous instance of a Slot by this name unmounts, do nothing,
|
| 16842 |
+
// as the slot and its fills should only be removed for the current
|
| 16843 |
+
// known instance.
|
| 16844 |
+
if (this.slots[name] !== instance) {
|
| 16845 |
+
return;
|
| 16846 |
+
}
|
| 16847 |
+
|
| 16848 |
+
delete this.slots[name];
|
| 16849 |
+
this.triggerListeners();
|
| 16850 |
+
}
|
| 16851 |
+
}, {
|
| 16852 |
+
key: "unregisterFill",
|
| 16853 |
+
value: function unregisterFill(name, instance) {
|
| 16854 |
+
this.fills[name] = Object(external_lodash_["without"])(this.fills[name], instance);
|
| 16855 |
+
this.resetFillOccurrence(name);
|
| 16856 |
+
this.forceUpdateSlot(name);
|
| 16857 |
+
}
|
| 16858 |
+
}, {
|
| 16859 |
+
key: "getSlot",
|
| 16860 |
+
value: function getSlot(name) {
|
| 16861 |
+
return this.slots[name];
|
| 16862 |
+
}
|
| 16863 |
+
}, {
|
| 16864 |
+
key: "getFills",
|
| 16865 |
+
value: function getFills(name, slotInstance) {
|
| 16866 |
+
// Fills should only be returned for the current instance of the slot
|
| 16867 |
+
// in which they occupy.
|
| 16868 |
+
if (this.slots[name] !== slotInstance) {
|
| 16869 |
+
return [];
|
| 16870 |
+
}
|
| 16871 |
+
|
| 16872 |
+
return Object(external_lodash_["sortBy"])(this.fills[name], 'occurrence');
|
| 16873 |
+
}
|
| 16874 |
+
}, {
|
| 16875 |
+
key: "hasFills",
|
| 16876 |
+
value: function hasFills(name) {
|
| 16877 |
+
return this.fills[name] && !!this.fills[name].length;
|
| 16878 |
+
}
|
| 16879 |
+
}, {
|
| 16880 |
+
key: "resetFillOccurrence",
|
| 16881 |
+
value: function resetFillOccurrence(name) {
|
| 16882 |
+
Object(external_lodash_["forEach"])(this.fills[name], function (instance) {
|
| 16883 |
+
instance.occurrence = undefined;
|
| 16884 |
});
|
| 16885 |
+
}
|
| 16886 |
+
}, {
|
| 16887 |
+
key: "forceUpdateSlot",
|
| 16888 |
+
value: function forceUpdateSlot(name) {
|
| 16889 |
+
var slot = this.getSlot(name);
|
| 16890 |
+
|
| 16891 |
+
if (slot) {
|
| 16892 |
+
slot.forceUpdate();
|
| 16893 |
+
}
|
| 16894 |
+
}
|
| 16895 |
+
}, {
|
| 16896 |
+
key: "triggerListeners",
|
| 16897 |
+
value: function triggerListeners() {
|
| 16898 |
+
this.listeners.forEach(function (listener) {
|
| 16899 |
+
return listener();
|
| 16900 |
});
|
| 16901 |
}
|
| 16902 |
+
}, {
|
| 16903 |
+
key: "subscribe",
|
| 16904 |
+
value: function subscribe(listener) {
|
| 16905 |
+
var _this2 = this;
|
| 16906 |
|
| 16907 |
+
this.listeners.push(listener);
|
| 16908 |
+
return function () {
|
| 16909 |
+
_this2.listeners = Object(external_lodash_["without"])(_this2.listeners, listener);
|
| 16910 |
+
};
|
| 16911 |
+
}
|
| 16912 |
+
}, {
|
| 16913 |
+
key: "render",
|
| 16914 |
+
value: function render() {
|
| 16915 |
+
return Object(external_this_wp_element_["createElement"])(Provider, {
|
| 16916 |
+
value: this.contextValue
|
| 16917 |
+
}, Object(external_this_wp_element_["createElement"])(slot_fill_provider_SlotFillProvider, null, this.props.children));
|
| 16918 |
+
}
|
| 16919 |
+
}]);
|
| 16920 |
|
| 16921 |
+
return SlotFillProvider;
|
| 16922 |
+
}(external_this_wp_element_["Component"]);
|
| 16923 |
+
/**
|
| 16924 |
+
* React hook returning the active slot given a name.
|
| 16925 |
+
*
|
| 16926 |
+
* @param {string} name Slot name.
|
| 16927 |
+
* @return {Object} Slot object.
|
| 16928 |
+
*/
|
| 16929 |
|
|
|
|
| 16930 |
|
| 16931 |
+
var context_useSlot = function useSlot(name) {
|
| 16932 |
+
var _useContext = Object(external_this_wp_element_["useContext"])(SlotFillContext),
|
| 16933 |
+
getSlot = _useContext.getSlot,
|
| 16934 |
+
subscribe = _useContext.subscribe;
|
| 16935 |
|
| 16936 |
+
var _useState = Object(external_this_wp_element_["useState"])(getSlot(name)),
|
| 16937 |
+
_useState2 = Object(slicedToArray["a" /* default */])(_useState, 2),
|
| 16938 |
+
slot = _useState2[0],
|
| 16939 |
+
setSlot = _useState2[1];
|
| 16940 |
|
| 16941 |
+
Object(external_this_wp_element_["useEffect"])(function () {
|
| 16942 |
+
setSlot(getSlot(name));
|
| 16943 |
+
var unsubscribe = subscribe(function () {
|
| 16944 |
+
setSlot(getSlot(name));
|
| 16945 |
+
});
|
| 16946 |
+
return unsubscribe;
|
| 16947 |
+
}, [name]);
|
| 16948 |
+
return slot;
|
| 16949 |
+
};
|
| 16950 |
+
/* harmony default export */ var context = __webpack_exports__["b"] = (context_SlotFillProvider);
|
| 16951 |
|
| 16952 |
+
//# sourceMappingURL=context.js.map
|
| 16953 |
|
| 16954 |
+
/***/ }),
|
|
|
|
| 16955 |
|
| 16956 |
+
/***/ 533:
|
| 16957 |
+
/***/ (function(module, exports, __webpack_require__) {
|
| 16958 |
|
| 16959 |
+
"use strict";
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16960 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16961 |
|
| 16962 |
+
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
| 16963 |
|
| 16964 |
+
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
| 16965 |
|
| 16966 |
+
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16967 |
|
| 16968 |
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
|
|
|
|
|
| 16969 |
|
| 16970 |
+
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
|
|
|
| 16971 |
|
| 16972 |
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
| 16973 |
|
| 16974 |
+
var hoistNonReactStatic = __webpack_require__(568);
|
| 16975 |
+
var React = __webpack_require__(6);
|
| 16976 |
+
var ReactDOM = __webpack_require__(100);
|
| 16977 |
|
| 16978 |
+
module.exports = function enhanceWithClickOutside(WrappedComponent) {
|
| 16979 |
+
var componentName = WrappedComponent.displayName || WrappedComponent.name;
|
| 16980 |
|
| 16981 |
+
var EnhancedComponent = function (_React$Component) {
|
| 16982 |
+
_inherits(EnhancedComponent, _React$Component);
|
|
|
|
|
|
|
| 16983 |
|
| 16984 |
+
function EnhancedComponent(props) {
|
| 16985 |
+
_classCallCheck(this, EnhancedComponent);
|
| 16986 |
|
| 16987 |
+
var _this = _possibleConstructorReturn(this, (EnhancedComponent.__proto__ || Object.getPrototypeOf(EnhancedComponent)).call(this, props));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16988 |
|
| 16989 |
+
_this.handleClickOutside = _this.handleClickOutside.bind(_this);
|
| 16990 |
+
return _this;
|
| 16991 |
}
|
| 16992 |
|
| 16993 |
+
_createClass(EnhancedComponent, [{
|
| 16994 |
+
key: 'componentDidMount',
|
| 16995 |
+
value: function componentDidMount() {
|
| 16996 |
+
document.addEventListener('click', this.handleClickOutside, true);
|
| 16997 |
+
}
|
| 16998 |
+
}, {
|
| 16999 |
+
key: 'componentWillUnmount',
|
| 17000 |
+
value: function componentWillUnmount() {
|
| 17001 |
+
document.removeEventListener('click', this.handleClickOutside, true);
|
| 17002 |
+
}
|
| 17003 |
+
}, {
|
| 17004 |
+
key: 'handleClickOutside',
|
| 17005 |
+
value: function handleClickOutside(e) {
|
| 17006 |
+
var domNode = this.__domNode;
|
| 17007 |
+
if ((!domNode || !domNode.contains(e.target)) && this.__wrappedInstance && typeof this.__wrappedInstance.handleClickOutside === 'function') {
|
| 17008 |
+
this.__wrappedInstance.handleClickOutside(e);
|
| 17009 |
+
}
|
| 17010 |
+
}
|
| 17011 |
+
}, {
|
| 17012 |
+
key: 'render',
|
| 17013 |
+
value: function render() {
|
| 17014 |
+
var _this2 = this;
|
| 17015 |
+
|
| 17016 |
+
var _props = this.props,
|
| 17017 |
+
wrappedRef = _props.wrappedRef,
|
| 17018 |
+
rest = _objectWithoutProperties(_props, ['wrappedRef']);
|
| 17019 |
+
|
| 17020 |
+
return React.createElement(WrappedComponent, _extends({}, rest, {
|
| 17021 |
+
ref: function ref(c) {
|
| 17022 |
+
_this2.__wrappedInstance = c;
|
| 17023 |
+
_this2.__domNode = ReactDOM.findDOMNode(c);
|
| 17024 |
+
wrappedRef && wrappedRef(c);
|
| 17025 |
+
}
|
| 17026 |
+
}));
|
| 17027 |
}
|
| 17028 |
+
}]);
|
| 17029 |
|
| 17030 |
+
return EnhancedComponent;
|
| 17031 |
+
}(React.Component);
|
|
|
|
| 17032 |
|
| 17033 |
+
EnhancedComponent.displayName = 'clickOutside(' + componentName + ')';
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17034 |
|
| 17035 |
+
return hoistNonReactStatic(EnhancedComponent, WrappedComponent);
|
| 17036 |
+
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17037 |
|
| 17038 |
+
/***/ }),
|
|
|
|
|
|
|
| 17039 |
|
| 17040 |
+
/***/ 534:
|
| 17041 |
+
/***/ (function(module, exports, __webpack_require__) {
|
| 17042 |
|
| 17043 |
+
"use strict";
|
| 17044 |
+
var _extends=Object.assign||function(a){for(var c,b=1;b<arguments.length;b++)for(var d in c=arguments[b],c)Object.prototype.hasOwnProperty.call(c,d)&&(a[d]=c[d]);return a};Object.defineProperty(exports,'__esModule',{value:!0});exports.default=function(a){var b=a.size,c=b===void 0?24:b,d=a.onClick,e=a.icon,f=a.className,g=_objectWithoutProperties(a,['size','onClick','icon','className']),j=['gridicon','gridicons-cross-small',f,!1,!1,!1].filter(Boolean).join(' ');return _react2.default.createElement('svg',_extends({className:j,height:c,width:c,onClick:d},g,{xmlns:'http://www.w3.org/2000/svg',viewBox:'0 0 24 24'}),_react2.default.createElement('g',null,_react2.default.createElement('path',{d:'M17.705 7.705l-1.41-1.41L12 10.59 7.705 6.295l-1.41 1.41L10.59 12l-4.295 4.295 1.41 1.41L12 13.41l4.295 4.295 1.41-1.41L13.41 12l4.295-4.295z'})))};var _react=__webpack_require__(6),_react2=_interopRequireDefault(_react);function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}function _objectWithoutProperties(a,b){var d={};for(var c in a)0<=b.indexOf(c)||Object.prototype.hasOwnProperty.call(a,c)&&(d[c]=a[c]);return d}module.exports=exports['default'];
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17045 |
|
|
|
|
| 17046 |
|
| 17047 |
+
/***/ }),
|
| 17048 |
+
|
| 17049 |
+
/***/ 535:
|
| 17050 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
| 17051 |
|
| 17052 |
+
"use strict";
|
| 17053 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Dropdown; });
|
| 17054 |
+
/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7);
|
| 17055 |
+
/* harmony import */ var _babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(26);
|
| 17056 |
+
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(0);
|
| 17057 |
+
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__);
|
| 17058 |
+
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(4);
|
| 17059 |
+
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_3__);
|
| 17060 |
+
/* harmony import */ var _popover__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(136);
|
| 17061 |
|
|
|
|
| 17062 |
|
|
|
|
|
|
|
| 17063 |
|
|
|
|
| 17064 |
|
| 17065 |
/**
|
| 17066 |
+
* External dependencies
|
| 17067 |
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17068 |
|
| 17069 |
/**
|
| 17070 |
+
* WordPress dependencies
|
|
|
|
|
|
|
| 17071 |
*/
|
| 17072 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17073 |
|
| 17074 |
/**
|
| 17075 |
+
* Internal dependencies
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17076 |
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17077 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17078 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17079 |
|
| 17080 |
+
function useObservableState(initialState, onStateChange) {
|
| 17081 |
+
var _useState = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["useState"])(initialState),
|
| 17082 |
+
_useState2 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(_useState, 2),
|
| 17083 |
+
state = _useState2[0],
|
| 17084 |
+
setState = _useState2[1];
|
|
|
|
|
|
|
| 17085 |
|
| 17086 |
+
return [state, function (value) {
|
| 17087 |
+
setState(value);
|
| 17088 |
+
|
| 17089 |
+
if (onStateChange) {
|
| 17090 |
+
onStateChange(value);
|
| 17091 |
}
|
| 17092 |
+
}];
|
| 17093 |
+
}
|
| 17094 |
|
| 17095 |
+
function Dropdown(_ref) {
|
| 17096 |
+
var renderContent = _ref.renderContent,
|
| 17097 |
+
renderToggle = _ref.renderToggle,
|
| 17098 |
+
_ref$position = _ref.position,
|
| 17099 |
+
position = _ref$position === void 0 ? 'bottom right' : _ref$position,
|
| 17100 |
+
className = _ref.className,
|
| 17101 |
+
contentClassName = _ref.contentClassName,
|
| 17102 |
+
expandOnMobile = _ref.expandOnMobile,
|
| 17103 |
+
headerTitle = _ref.headerTitle,
|
| 17104 |
+
focusOnMount = _ref.focusOnMount,
|
| 17105 |
+
popoverProps = _ref.popoverProps,
|
| 17106 |
+
onClose = _ref.onClose,
|
| 17107 |
+
onToggle = _ref.onToggle;
|
| 17108 |
+
var containerRef = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["useRef"])();
|
| 17109 |
|
| 17110 |
+
var _useObservableState = useObservableState(false, onToggle),
|
| 17111 |
+
_useObservableState2 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(_useObservableState, 2),
|
| 17112 |
+
isOpen = _useObservableState2[0],
|
| 17113 |
+
setIsOpen = _useObservableState2[1];
|
| 17114 |
+
|
| 17115 |
+
Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["useEffect"])(function () {
|
| 17116 |
+
return function () {
|
| 17117 |
+
if (onToggle) {
|
| 17118 |
+
onToggle(false);
|
| 17119 |
+
}
|
| 17120 |
+
};
|
| 17121 |
+
}, []);
|
| 17122 |
+
|
| 17123 |
+
function toggle() {
|
| 17124 |
+
setIsOpen(!isOpen);
|
| 17125 |
}
|
| 17126 |
+
/**
|
| 17127 |
+
* Closes the dropdown if a focus leaves the dropdown wrapper. This is
|
| 17128 |
+
* intentionally distinct from `onClose` since focus loss from the popover
|
| 17129 |
+
* is expected to occur when using the Dropdown's toggle button, in which
|
| 17130 |
+
* case the correct behavior is to keep the dropdown closed. The same applies
|
| 17131 |
+
* in case when focus is moved to the modal dialog.
|
| 17132 |
+
*/
|
| 17133 |
|
| 17134 |
+
|
| 17135 |
+
function closeIfFocusOutside() {
|
| 17136 |
+
var ownerDocument = containerRef.current.ownerDocument;
|
| 17137 |
+
|
| 17138 |
+
if (!containerRef.current.contains(ownerDocument.activeElement) && !ownerDocument.activeElement.closest('[role="dialog"]')) {
|
| 17139 |
+
close();
|
| 17140 |
+
}
|
| 17141 |
}
|
| 17142 |
|
| 17143 |
+
function close() {
|
| 17144 |
+
if (onClose) {
|
| 17145 |
+
onClose();
|
| 17146 |
+
}
|
| 17147 |
+
|
| 17148 |
+
setIsOpen(false);
|
| 17149 |
}
|
| 17150 |
|
| 17151 |
+
var args = {
|
| 17152 |
+
isOpen: isOpen,
|
| 17153 |
+
onToggle: toggle,
|
| 17154 |
+
onClose: close
|
| 17155 |
+
};
|
| 17156 |
+
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])("div", {
|
| 17157 |
+
className: classnames__WEBPACK_IMPORTED_MODULE_3___default()('components-dropdown', className),
|
| 17158 |
+
ref: containerRef
|
| 17159 |
+
}, renderToggle(args), isOpen && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])(_popover__WEBPACK_IMPORTED_MODULE_4__[/* default */ "a"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])({
|
| 17160 |
+
position: position,
|
| 17161 |
+
onClose: close,
|
| 17162 |
+
onFocusOutside: closeIfFocusOutside,
|
| 17163 |
+
expandOnMobile: expandOnMobile,
|
| 17164 |
+
headerTitle: headerTitle,
|
| 17165 |
+
focusOnMount: focusOnMount
|
| 17166 |
+
}, popoverProps, {
|
| 17167 |
+
anchorRef: containerRef.current,
|
| 17168 |
+
className: classnames__WEBPACK_IMPORTED_MODULE_3___default()('components-dropdown__content', popoverProps ? popoverProps.className : undefined, contentClassName)
|
| 17169 |
+
}), renderContent(args)));
|
| 17170 |
}
|
| 17171 |
+
//# sourceMappingURL=index.js.map
|
| 17172 |
+
|
| 17173 |
+
/***/ }),
|
| 17174 |
+
|
| 17175 |
+
/***/ 536:
|
| 17176 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
| 17177 |
+
|
| 17178 |
+
"use strict";
|
| 17179 |
+
/* WEBPACK VAR INJECTION */(function(process) {/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
|
| 17180 |
+
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
|
| 17181 |
+
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2);
|
| 17182 |
+
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__);
|
| 17183 |
+
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4);
|
| 17184 |
+
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
|
| 17185 |
+
/* harmony import */ var _wordpress_a11y__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(189);
|
| 17186 |
+
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(3);
|
| 17187 |
+
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__);
|
| 17188 |
+
/* harmony import */ var _wordpress_warning__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(90);
|
| 17189 |
+
/* harmony import */ var ___WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(72);
|
| 17190 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17191 |
|
| 17192 |
/**
|
| 17193 |
+
* External dependencies
|
|
|
|
|
|
|
|
|
|
| 17194 |
*/
|
| 17195 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17196 |
|
| 17197 |
/**
|
| 17198 |
+
* WordPress dependencies
|
|
|
|
|
|
|
|
|
|
| 17199 |
*/
|
| 17200 |
+
|
| 17201 |
+
|
| 17202 |
+
|
| 17203 |
+
|
|
|
|
| 17204 |
|
| 17205 |
/**
|
| 17206 |
+
* Internal dependencies
|
| 17207 |
*/
|
|
|
|
|
|
|
|
|
|
| 17208 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17209 |
|
| 17210 |
+
var NOTICE_TIMEOUT = 10000;
|
| 17211 |
+
/** @typedef {import('@wordpress/element').WPElement} WPElement */
|
|
|
|
|
|
|
|
|
|
| 17212 |
|
| 17213 |
+
/**
|
| 17214 |
+
* Custom hook which announces the message with the given politeness, if a
|
| 17215 |
+
* valid message is provided.
|
| 17216 |
+
*
|
| 17217 |
+
* @param {string|WPElement} [message] Message to announce.
|
| 17218 |
+
* @param {'polite'|'assertive'} politeness Politeness to announce.
|
| 17219 |
+
*/
|
| 17220 |
|
| 17221 |
+
function useSpokenMessage(message, politeness) {
|
| 17222 |
+
var spokenMessage = typeof message === 'string' ? message : Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["renderToString"])(message);
|
| 17223 |
+
Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["useEffect"])(function () {
|
| 17224 |
+
if (spokenMessage) {
|
| 17225 |
+
Object(_wordpress_a11y__WEBPACK_IMPORTED_MODULE_3__[/* speak */ "a"])(spokenMessage, politeness);
|
| 17226 |
+
}
|
| 17227 |
+
}, [spokenMessage, politeness]);
|
| 17228 |
+
}
|
| 17229 |
|
| 17230 |
+
function Snackbar(_ref, ref) {
|
| 17231 |
+
var className = _ref.className,
|
| 17232 |
+
children = _ref.children,
|
| 17233 |
+
_ref$spokenMessage = _ref.spokenMessage,
|
| 17234 |
+
spokenMessage = _ref$spokenMessage === void 0 ? children : _ref$spokenMessage,
|
| 17235 |
+
_ref$politeness = _ref.politeness,
|
| 17236 |
+
politeness = _ref$politeness === void 0 ? 'polite' : _ref$politeness,
|
| 17237 |
+
_ref$actions = _ref.actions,
|
| 17238 |
+
actions = _ref$actions === void 0 ? [] : _ref$actions,
|
| 17239 |
+
_ref$onRemove = _ref.onRemove,
|
| 17240 |
+
onRemove = _ref$onRemove === void 0 ? lodash__WEBPACK_IMPORTED_MODULE_1__["noop"] : _ref$onRemove;
|
| 17241 |
+
useSpokenMessage(spokenMessage, politeness);
|
| 17242 |
+
Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["useEffect"])(function () {
|
| 17243 |
+
var timeoutHandle = setTimeout(function () {
|
| 17244 |
+
onRemove();
|
| 17245 |
+
}, NOTICE_TIMEOUT);
|
| 17246 |
+
return function () {
|
| 17247 |
+
return clearTimeout(timeoutHandle);
|
| 17248 |
+
};
|
| 17249 |
+
}, []);
|
| 17250 |
+
var classes = classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, 'components-snackbar');
|
| 17251 |
|
| 17252 |
+
if (actions && actions.length > 1) {
|
| 17253 |
+
// we need to inform developers that snackbar only accepts 1 action
|
| 17254 |
+
typeof process !== "undefined" && process.env && "production" !== "production" ? Object(_wordpress_warning__WEBPACK_IMPORTED_MODULE_5__[/* default */ "a"])('Snackbar can only have 1 action, use Notice if your message require many messages') : void 0; // return first element only while keeping it inside an array
|
| 17255 |
|
| 17256 |
+
actions = [actions[0]];
|
| 17257 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17258 |
|
| 17259 |
+
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", {
|
| 17260 |
+
ref: ref,
|
| 17261 |
+
className: classes,
|
| 17262 |
+
onClick: onRemove,
|
| 17263 |
+
tabIndex: "0",
|
| 17264 |
+
role: "button",
|
| 17265 |
+
onKeyPress: onRemove,
|
| 17266 |
+
"aria-label": Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__["__"])('Dismiss this notice')
|
| 17267 |
+
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", {
|
| 17268 |
+
className: "components-snackbar__content"
|
| 17269 |
+
}, children, actions.map(function (_ref2, index) {
|
| 17270 |
+
var label = _ref2.label,
|
| 17271 |
+
_onClick = _ref2.onClick,
|
| 17272 |
+
url = _ref2.url;
|
| 17273 |
+
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(___WEBPACK_IMPORTED_MODULE_6__[/* default */ "a"], {
|
| 17274 |
+
key: index,
|
| 17275 |
+
href: url,
|
| 17276 |
+
isTertiary: true,
|
| 17277 |
+
onClick: function onClick(event) {
|
| 17278 |
+
event.stopPropagation();
|
| 17279 |
|
| 17280 |
+
if (_onClick) {
|
| 17281 |
+
_onClick(event);
|
|
|
|
| 17282 |
}
|
| 17283 |
+
},
|
| 17284 |
+
className: "components-snackbar__action"
|
| 17285 |
+
}, label);
|
| 17286 |
+
})));
|
| 17287 |
+
}
|
| 17288 |
|
| 17289 |
+
/* harmony default export */ __webpack_exports__["a"] = (Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["forwardRef"])(Snackbar));
|
| 17290 |
+
//# sourceMappingURL=index.js.map
|
| 17291 |
+
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(33)))
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17292 |
|
| 17293 |
+
/***/ }),
|
|
|
|
| 17294 |
|
| 17295 |
+
/***/ 537:
|
| 17296 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
| 17297 |
|
| 17298 |
+
"use strict";
|
| 17299 |
+
/* WEBPACK VAR INJECTION */(function(global) {/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6);
|
| 17300 |
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
| 17301 |
+
/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(56);
|
| 17302 |
+
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1);
|
| 17303 |
+
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_2__);
|
| 17304 |
|
|
|
|
|
|
|
| 17305 |
|
|
|
|
| 17306 |
|
|
|
|
|
|
|
|
|
|
| 17307 |
|
|
|
|
|
|
|
| 17308 |
|
| 17309 |
+
var MAX_SIGNED_31_BIT_INT = 1073741823;
|
| 17310 |
+
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : {};
|
|
|
|
| 17311 |
|
| 17312 |
+
function getUniqueId() {
|
| 17313 |
+
var key = '__global_unique_id__';
|
| 17314 |
+
return commonjsGlobal[key] = (commonjsGlobal[key] || 0) + 1;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17315 |
}
|
| 17316 |
|
| 17317 |
+
function objectIs(x, y) {
|
| 17318 |
+
if (x === y) {
|
| 17319 |
+
return x !== 0 || 1 / x === 1 / y;
|
| 17320 |
+
} else {
|
| 17321 |
+
return x !== x && y !== y;
|
| 17322 |
+
}
|
|
|
|
|
|
|
| 17323 |
}
|
| 17324 |
|
| 17325 |
+
function createEventEmitter(value) {
|
| 17326 |
+
var handlers = [];
|
| 17327 |
+
return {
|
| 17328 |
+
on: function on(handler) {
|
| 17329 |
+
handlers.push(handler);
|
| 17330 |
+
},
|
| 17331 |
+
off: function off(handler) {
|
| 17332 |
+
handlers = handlers.filter(function (h) {
|
| 17333 |
+
return h !== handler;
|
| 17334 |
+
});
|
| 17335 |
+
},
|
| 17336 |
+
get: function get() {
|
| 17337 |
+
return value;
|
| 17338 |
+
},
|
| 17339 |
+
set: function set(newValue, changedBits) {
|
| 17340 |
+
value = newValue;
|
| 17341 |
+
handlers.forEach(function (handler) {
|
| 17342 |
+
return handler(value, changedBits);
|
| 17343 |
+
});
|
| 17344 |
+
}
|
| 17345 |
+
};
|
| 17346 |
}
|
| 17347 |
|
| 17348 |
+
function onlyChild(children) {
|
| 17349 |
+
return Array.isArray(children) ? children[0] : children;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17350 |
}
|
| 17351 |
|
| 17352 |
+
function createReactContext(defaultValue, calculateChangedBits) {
|
| 17353 |
+
var _Provider$childContex, _Consumer$contextType;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17354 |
|
| 17355 |
+
var contextProp = '__create-react-context-' + getUniqueId() + '__';
|
| 17356 |
+
|
| 17357 |
+
var Provider = /*#__PURE__*/function (_Component) {
|
| 17358 |
+
Object(_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(Provider, _Component);
|
| 17359 |
+
|
| 17360 |
+
function Provider() {
|
| 17361 |
+
var _this;
|
| 17362 |
+
|
| 17363 |
+
_this = _Component.apply(this, arguments) || this;
|
| 17364 |
+
_this.emitter = createEventEmitter(_this.props.value);
|
| 17365 |
+
return _this;
|
|
|
|
| 17366 |
}
|
|
|
|
| 17367 |
|
| 17368 |
+
var _proto = Provider.prototype;
|
|
|
|
| 17369 |
|
| 17370 |
+
_proto.getChildContext = function getChildContext() {
|
| 17371 |
+
var _ref;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17372 |
|
| 17373 |
+
return _ref = {}, _ref[contextProp] = this.emitter, _ref;
|
| 17374 |
+
};
|
|
|
|
| 17375 |
|
| 17376 |
+
_proto.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
|
| 17377 |
+
if (this.props.value !== nextProps.value) {
|
| 17378 |
+
var oldValue = this.props.value;
|
| 17379 |
+
var newValue = nextProps.value;
|
| 17380 |
+
var changedBits;
|
| 17381 |
|
| 17382 |
+
if (objectIs(oldValue, newValue)) {
|
| 17383 |
+
changedBits = 0;
|
| 17384 |
+
} else {
|
| 17385 |
+
changedBits = typeof calculateChangedBits === 'function' ? calculateChangedBits(oldValue, newValue) : MAX_SIGNED_31_BIT_INT;
|
| 17386 |
|
| 17387 |
+
if (false) {}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17388 |
|
| 17389 |
+
changedBits |= 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17390 |
|
| 17391 |
+
if (changedBits !== 0) {
|
| 17392 |
+
this.emitter.set(nextProps.value, changedBits);
|
| 17393 |
+
}
|
| 17394 |
+
}
|
| 17395 |
+
}
|
| 17396 |
+
};
|
| 17397 |
|
| 17398 |
+
_proto.render = function render() {
|
| 17399 |
+
return this.props.children;
|
| 17400 |
+
};
|
| 17401 |
|
| 17402 |
+
return Provider;
|
| 17403 |
+
}(react__WEBPACK_IMPORTED_MODULE_0__["Component"]);
|
|
|
|
| 17404 |
|
| 17405 |
+
Provider.childContextTypes = (_Provider$childContex = {}, _Provider$childContex[contextProp] = prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.object.isRequired, _Provider$childContex);
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17406 |
|
| 17407 |
+
var Consumer = /*#__PURE__*/function (_Component2) {
|
| 17408 |
+
Object(_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(Consumer, _Component2);
|
| 17409 |
|
| 17410 |
+
function Consumer() {
|
| 17411 |
+
var _this2;
|
|
|
|
| 17412 |
|
| 17413 |
+
_this2 = _Component2.apply(this, arguments) || this;
|
| 17414 |
+
_this2.state = {
|
| 17415 |
+
value: _this2.getValue()
|
| 17416 |
+
};
|
| 17417 |
+
|
| 17418 |
+
_this2.onUpdate = function (newValue, changedBits) {
|
| 17419 |
+
var observedBits = _this2.observedBits | 0;
|
| 17420 |
+
|
| 17421 |
+
if ((observedBits & changedBits) !== 0) {
|
| 17422 |
+
_this2.setState({
|
| 17423 |
+
value: _this2.getValue()
|
| 17424 |
+
});
|
| 17425 |
}
|
| 17426 |
+
};
|
| 17427 |
+
|
| 17428 |
+
return _this2;
|
| 17429 |
+
}
|
| 17430 |
+
|
| 17431 |
+
var _proto2 = Consumer.prototype;
|
| 17432 |
+
|
| 17433 |
+
_proto2.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
|
| 17434 |
+
var observedBits = nextProps.observedBits;
|
| 17435 |
+
this.observedBits = observedBits === undefined || observedBits === null ? MAX_SIGNED_31_BIT_INT : observedBits;
|
| 17436 |
+
};
|
| 17437 |
+
|
| 17438 |
+
_proto2.componentDidMount = function componentDidMount() {
|
| 17439 |
+
if (this.context[contextProp]) {
|
| 17440 |
+
this.context[contextProp].on(this.onUpdate);
|
| 17441 |
}
|
| 17442 |
|
| 17443 |
+
var observedBits = this.props.observedBits;
|
| 17444 |
+
this.observedBits = observedBits === undefined || observedBits === null ? MAX_SIGNED_31_BIT_INT : observedBits;
|
| 17445 |
+
};
|
| 17446 |
+
|
| 17447 |
+
_proto2.componentWillUnmount = function componentWillUnmount() {
|
| 17448 |
+
if (this.context[contextProp]) {
|
| 17449 |
+
this.context[contextProp].off(this.onUpdate);
|
| 17450 |
+
}
|
| 17451 |
+
};
|
| 17452 |
|
| 17453 |
+
_proto2.getValue = function getValue() {
|
| 17454 |
+
if (this.context[contextProp]) {
|
| 17455 |
+
return this.context[contextProp].get();
|
| 17456 |
+
} else {
|
| 17457 |
+
return defaultValue;
|
| 17458 |
+
}
|
| 17459 |
+
};
|
| 17460 |
|
| 17461 |
+
_proto2.render = function render() {
|
| 17462 |
+
return onlyChild(this.props.children)(this.state.value);
|
| 17463 |
+
};
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17464 |
|
| 17465 |
+
return Consumer;
|
| 17466 |
+
}(react__WEBPACK_IMPORTED_MODULE_0__["Component"]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17467 |
|
| 17468 |
+
Consumer.contextTypes = (_Consumer$contextType = {}, _Consumer$contextType[contextProp] = prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.object, _Consumer$contextType);
|
| 17469 |
+
return {
|
| 17470 |
+
Provider: Provider,
|
| 17471 |
+
Consumer: Consumer
|
| 17472 |
+
};
|
| 17473 |
}
|
| 17474 |
|
| 17475 |
+
var index = react__WEBPACK_IMPORTED_MODULE_0___default.a.createContext || createReactContext;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17476 |
|
| 17477 |
+
/* harmony default export */ __webpack_exports__["a"] = (index);
|
| 17478 |
|
| 17479 |
+
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(46)))
|
|
|
|
|
|
|
| 17480 |
|
| 17481 |
+
/***/ }),
|
|
|
|
|
|
|
| 17482 |
|
| 17483 |
+
/***/ 538:
|
| 17484 |
+
/***/ (function(module, exports) {
|
| 17485 |
|
| 17486 |
+
(function() { module.exports = this["wc"]["customerEffortScore"]; }());
|
| 17487 |
|
| 17488 |
/***/ }),
|
| 17489 |
|
| 17490 |
+
/***/ 54:
|
| 17491 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
| 17492 |
|
| 17493 |
+
"use strict";
|
| 17494 |
|
| 17495 |
+
// EXPORTS
|
| 17496 |
+
__webpack_require__.d(__webpack_exports__, "e", function() { return /* binding */ TAB; });
|
| 17497 |
+
__webpack_require__.d(__webpack_exports__, "b", function() { return /* binding */ ESCAPE; });
|
| 17498 |
+
__webpack_require__.d(__webpack_exports__, "c", function() { return /* binding */ LEFT; });
|
| 17499 |
+
__webpack_require__.d(__webpack_exports__, "f", function() { return /* binding */ UP; });
|
| 17500 |
+
__webpack_require__.d(__webpack_exports__, "d", function() { return /* binding */ RIGHT; });
|
| 17501 |
+
__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ DOWN; });
|
| 17502 |
|
| 17503 |
+
// UNUSED EXPORTS: BACKSPACE, ENTER, SPACE, DELETE, F10, ALT, CTRL, COMMAND, SHIFT, ZERO, modifiers, rawShortcut, displayShortcutList, displayShortcut, shortcutAriaLabel, isKeyboardEvent
|
| 17504 |
|
| 17505 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
|
| 17506 |
+
var defineProperty = __webpack_require__(8);
|
|
|
|
| 17507 |
|
| 17508 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js + 3 modules
|
| 17509 |
+
var toConsumableArray = __webpack_require__(27);
|
| 17510 |
|
| 17511 |
+
// EXTERNAL MODULE: external "lodash"
|
| 17512 |
+
var external_lodash_ = __webpack_require__(2);
|
| 17513 |
|
| 17514 |
+
// EXTERNAL MODULE: external {"this":["wp","i18n"]}
|
| 17515 |
+
var external_this_wp_i18n_ = __webpack_require__(3);
|
| 17516 |
|
| 17517 |
+
// CONCATENATED MODULE: ./node_modules/@wordpress/components/node_modules/@wordpress/keycodes/build-module/platform.js
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17518 |
/**
|
| 17519 |
* External dependencies
|
| 17520 |
*/
|
| 17521 |
|
| 17522 |
/**
|
| 17523 |
+
* Return true if platform is MacOS.
|
| 17524 |
*
|
| 17525 |
+
* @param {Object} _window window object by default; used for DI testing.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17526 |
*
|
| 17527 |
+
* @return {boolean} True if MacOS; false otherwise.
|
|
|
|
| 17528 |
*/
|
| 17529 |
|
| 17530 |
+
function isAppleOS() {
|
| 17531 |
+
var _window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17532 |
|
| 17533 |
+
var platform = _window.navigator.platform;
|
| 17534 |
+
return platform.indexOf('Mac') !== -1 || Object(external_lodash_["includes"])(['iPad', 'iPhone'], platform);
|
| 17535 |
+
}
|
| 17536 |
+
//# sourceMappingURL=platform.js.map
|
| 17537 |
+
// CONCATENATED MODULE: ./node_modules/@wordpress/components/node_modules/@wordpress/keycodes/build-module/index.js
|
| 17538 |
|
| 17539 |
|
| 17540 |
|
| 17541 |
+
/**
|
| 17542 |
+
* Note: The order of the modifier keys in many of the [foo]Shortcut()
|
| 17543 |
+
* functions in this file are intentional and should not be changed. They're
|
| 17544 |
+
* designed to fit with the standard menu keyboard shortcuts shown in the
|
| 17545 |
+
* user's platform.
|
| 17546 |
+
*
|
| 17547 |
+
* For example, on MacOS menu shortcuts will place Shift before Command, but
|
| 17548 |
+
* on Windows Control will usually come first. So don't provide your own
|
| 17549 |
+
* shortcut combos directly to keyboardShortcut().
|
| 17550 |
+
*/
|
| 17551 |
|
| 17552 |
+
/**
|
| 17553 |
+
* External dependencies
|
| 17554 |
+
*/
|
| 17555 |
|
| 17556 |
/**
|
| 17557 |
* WordPress dependencies
|
| 17558 |
*/
|
| 17559 |
|
|
|
|
| 17560 |
|
| 17561 |
/**
|
| 17562 |
+
* Internal dependencies
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17563 |
*/
|
| 17564 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17565 |
|
| 17566 |
+
/**
|
| 17567 |
+
* @typedef {'primary'|'primaryShift'|'primaryAlt'|'secondary'|'access'|'ctrl'|'alt'|'ctrlShift'|'shift'|'shiftAlt'} WPKeycodeModifier
|
| 17568 |
+
*/
|
|
|
|
|
|
|
| 17569 |
|
| 17570 |
+
/**
|
| 17571 |
+
* An object of handler functions for each of the possible modifier
|
| 17572 |
+
* combinations. A handler will return a value for a given key.
|
| 17573 |
+
*
|
| 17574 |
+
* @typedef {Record<WPKeycodeModifier, (key:string)=>any>} WPKeycodeHandlerByModifier
|
| 17575 |
+
*/
|
| 17576 |
|
| 17577 |
+
/**
|
| 17578 |
+
* Keycode for BACKSPACE key.
|
| 17579 |
+
*/
|
| 17580 |
|
| 17581 |
+
var BACKSPACE = 8;
|
| 17582 |
+
/**
|
| 17583 |
+
* Keycode for TAB key.
|
| 17584 |
+
*/
|
| 17585 |
|
| 17586 |
+
var TAB = 9;
|
| 17587 |
+
/**
|
| 17588 |
+
* Keycode for ENTER key.
|
| 17589 |
+
*/
|
| 17590 |
|
| 17591 |
+
var ENTER = 13;
|
| 17592 |
+
/**
|
| 17593 |
+
* Keycode for ESCAPE key.
|
| 17594 |
+
*/
|
| 17595 |
|
| 17596 |
+
var ESCAPE = 27;
|
| 17597 |
+
/**
|
| 17598 |
+
* Keycode for SPACE key.
|
| 17599 |
+
*/
|
| 17600 |
|
| 17601 |
+
var SPACE = 32;
|
| 17602 |
+
/**
|
| 17603 |
+
* Keycode for LEFT key.
|
| 17604 |
+
*/
|
| 17605 |
|
| 17606 |
+
var LEFT = 37;
|
| 17607 |
+
/**
|
| 17608 |
+
* Keycode for UP key.
|
| 17609 |
+
*/
|
| 17610 |
|
| 17611 |
+
var UP = 38;
|
| 17612 |
+
/**
|
| 17613 |
+
* Keycode for RIGHT key.
|
| 17614 |
+
*/
|
| 17615 |
|
| 17616 |
+
var RIGHT = 39;
|
| 17617 |
+
/**
|
| 17618 |
+
* Keycode for DOWN key.
|
| 17619 |
+
*/
|
| 17620 |
|
| 17621 |
+
var DOWN = 40;
|
| 17622 |
+
/**
|
| 17623 |
+
* Keycode for DELETE key.
|
| 17624 |
+
*/
|
| 17625 |
|
| 17626 |
+
var DELETE = 46;
|
| 17627 |
+
/**
|
| 17628 |
+
* Keycode for F10 key.
|
| 17629 |
+
*/
|
| 17630 |
|
| 17631 |
+
var F10 = 121;
|
| 17632 |
+
/**
|
| 17633 |
+
* Keycode for ALT key.
|
| 17634 |
+
*/
|
| 17635 |
|
| 17636 |
+
var ALT = 'alt';
|
| 17637 |
+
/**
|
| 17638 |
+
* Keycode for CTRL key.
|
| 17639 |
+
*/
|
| 17640 |
|
| 17641 |
+
var CTRL = 'ctrl';
|
| 17642 |
+
/**
|
| 17643 |
+
* Keycode for COMMAND/META key.
|
| 17644 |
+
*/
|
| 17645 |
|
| 17646 |
+
var COMMAND = 'meta';
|
| 17647 |
+
/**
|
| 17648 |
+
* Keycode for SHIFT key.
|
| 17649 |
+
*/
|
| 17650 |
|
| 17651 |
+
var SHIFT = 'shift';
|
| 17652 |
+
/**
|
| 17653 |
+
* Keycode for ZERO key.
|
| 17654 |
+
*/
|
| 17655 |
|
| 17656 |
+
var ZERO = 48;
|
| 17657 |
+
/**
|
| 17658 |
+
* Object that contains functions that return the available modifier
|
| 17659 |
+
* depending on platform.
|
| 17660 |
+
*
|
| 17661 |
+
* - `primary`: takes a isApple function as a parameter.
|
| 17662 |
+
* - `primaryShift`: takes a isApple function as a parameter.
|
| 17663 |
+
* - `primaryAlt`: takes a isApple function as a parameter.
|
| 17664 |
+
* - `secondary`: takes a isApple function as a parameter.
|
| 17665 |
+
* - `access`: takes a isApple function as a parameter.
|
| 17666 |
+
* - `ctrl`
|
| 17667 |
+
* - `alt`
|
| 17668 |
+
* - `ctrlShift`
|
| 17669 |
+
* - `shift`
|
| 17670 |
+
* - `shiftAlt`
|
| 17671 |
+
*/
|
| 17672 |
|
| 17673 |
+
var modifiers = {
|
| 17674 |
+
primary: function primary(_isApple) {
|
| 17675 |
+
return _isApple() ? [COMMAND] : [CTRL];
|
| 17676 |
+
},
|
| 17677 |
+
primaryShift: function primaryShift(_isApple) {
|
| 17678 |
+
return _isApple() ? [SHIFT, COMMAND] : [CTRL, SHIFT];
|
| 17679 |
+
},
|
| 17680 |
+
primaryAlt: function primaryAlt(_isApple) {
|
| 17681 |
+
return _isApple() ? [ALT, COMMAND] : [CTRL, ALT];
|
| 17682 |
+
},
|
| 17683 |
+
secondary: function secondary(_isApple) {
|
| 17684 |
+
return _isApple() ? [SHIFT, ALT, COMMAND] : [CTRL, SHIFT, ALT];
|
| 17685 |
+
},
|
| 17686 |
+
access: function access(_isApple) {
|
| 17687 |
+
return _isApple() ? [CTRL, ALT] : [SHIFT, ALT];
|
| 17688 |
+
},
|
| 17689 |
+
ctrl: function ctrl() {
|
| 17690 |
+
return [CTRL];
|
| 17691 |
+
},
|
| 17692 |
+
alt: function alt() {
|
| 17693 |
+
return [ALT];
|
| 17694 |
+
},
|
| 17695 |
+
ctrlShift: function ctrlShift() {
|
| 17696 |
+
return [CTRL, SHIFT];
|
| 17697 |
+
},
|
| 17698 |
+
shift: function shift() {
|
| 17699 |
+
return [SHIFT];
|
| 17700 |
+
},
|
| 17701 |
+
shiftAlt: function shiftAlt() {
|
| 17702 |
+
return [SHIFT, ALT];
|
| 17703 |
+
}
|
| 17704 |
+
};
|
| 17705 |
+
/**
|
| 17706 |
+
* An object that contains functions to get raw shortcuts.
|
| 17707 |
+
* E.g. rawShortcut.primary( 'm' ) will return 'meta+m' on Mac.
|
| 17708 |
+
* These are intended for user with the KeyboardShortcuts component or TinyMCE.
|
| 17709 |
+
*
|
| 17710 |
+
* @type {WPKeycodeHandlerByModifier} Keyed map of functions to raw shortcuts.
|
| 17711 |
+
*/
|
| 17712 |
|
| 17713 |
+
var rawShortcut = Object(external_lodash_["mapValues"])(modifiers, function (modifier) {
|
| 17714 |
+
return function (character) {
|
| 17715 |
+
var _isApple = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : isAppleOS;
|
|
|
|
|
|
|
|
|
|
| 17716 |
|
| 17717 |
+
return [].concat(Object(toConsumableArray["a" /* default */])(modifier(_isApple)), [character.toLowerCase()]).join('+');
|
| 17718 |
};
|
| 17719 |
+
});
|
| 17720 |
+
/**
|
| 17721 |
+
* Return an array of the parts of a keyboard shortcut chord for display
|
| 17722 |
+
* E.g displayShortcutList.primary( 'm' ) will return [ '⌘', 'M' ] on Mac.
|
| 17723 |
+
*
|
| 17724 |
+
* @type {WPKeycodeHandlerByModifier} Keyed map of functions to shortcut
|
| 17725 |
+
* sequences.
|
| 17726 |
+
*/
|
| 17727 |
|
| 17728 |
+
var displayShortcutList = Object(external_lodash_["mapValues"])(modifiers, function (modifier) {
|
| 17729 |
+
return function (character) {
|
| 17730 |
+
var _replacementKeyMap;
|
|
|
|
| 17731 |
|
| 17732 |
+
var _isApple = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : isAppleOS;
|
| 17733 |
|
| 17734 |
+
var isApple = _isApple();
|
|
|
|
| 17735 |
|
| 17736 |
+
var replacementKeyMap = (_replacementKeyMap = {}, Object(defineProperty["a" /* default */])(_replacementKeyMap, ALT, isApple ? '⌥' : 'Alt'), Object(defineProperty["a" /* default */])(_replacementKeyMap, CTRL, isApple ? '⌃' : 'Ctrl'), Object(defineProperty["a" /* default */])(_replacementKeyMap, COMMAND, '⌘'), Object(defineProperty["a" /* default */])(_replacementKeyMap, SHIFT, isApple ? '⇧' : 'Shift'), _replacementKeyMap);
|
| 17737 |
+
var modifierKeys = modifier(_isApple).reduce(function (accumulator, key) {
|
| 17738 |
+
var replacementKey = Object(external_lodash_["get"])(replacementKeyMap, key, key); // If on the Mac, adhere to platform convention and don't show plus between keys.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17739 |
|
| 17740 |
+
if (isApple) {
|
| 17741 |
+
return [].concat(Object(toConsumableArray["a" /* default */])(accumulator), [replacementKey]);
|
| 17742 |
+
}
|
| 17743 |
|
| 17744 |
+
return [].concat(Object(toConsumableArray["a" /* default */])(accumulator), [replacementKey, '+']);
|
| 17745 |
+
}, []);
|
| 17746 |
+
var capitalizedCharacter = Object(external_lodash_["capitalize"])(character);
|
| 17747 |
+
return [].concat(Object(toConsumableArray["a" /* default */])(modifierKeys), [capitalizedCharacter]);
|
| 17748 |
+
};
|
| 17749 |
+
});
|
| 17750 |
/**
|
| 17751 |
+
* An object that contains functions to display shortcuts.
|
| 17752 |
+
* E.g. displayShortcut.primary( 'm' ) will return '⌘M' on Mac.
|
| 17753 |
+
*
|
| 17754 |
+
* @type {WPKeycodeHandlerByModifier} Keyed map of functions to display
|
| 17755 |
+
* shortcuts.
|
| 17756 |
*/
|
|
|
|
| 17757 |
|
| 17758 |
+
var displayShortcut = Object(external_lodash_["mapValues"])(displayShortcutList, function (shortcutList) {
|
| 17759 |
+
return function (character) {
|
| 17760 |
+
var _isApple = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : isAppleOS;
|
|
|
|
|
|
|
|
|
|
| 17761 |
|
| 17762 |
+
return shortcutList(character, _isApple).join('');
|
| 17763 |
+
};
|
| 17764 |
+
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17765 |
/**
|
| 17766 |
+
* An object that contains functions to return an aria label for a keyboard shortcut.
|
| 17767 |
+
* E.g. shortcutAriaLabel.primary( '.' ) will return 'Command + Period' on Mac.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17768 |
*
|
| 17769 |
+
* @type {WPKeycodeHandlerByModifier} Keyed map of functions to shortcut ARIA
|
| 17770 |
+
* labels.
|
| 17771 |
*/
|
| 17772 |
|
| 17773 |
+
var shortcutAriaLabel = Object(external_lodash_["mapValues"])(modifiers, function (modifier) {
|
| 17774 |
+
return function (character) {
|
| 17775 |
+
var _replacementKeyMap2;
|
|
|
|
|
|
|
| 17776 |
|
| 17777 |
+
var _isApple = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : isAppleOS;
|
|
|
|
|
|
|
| 17778 |
|
| 17779 |
+
var isApple = _isApple();
|
| 17780 |
+
|
| 17781 |
+
var replacementKeyMap = (_replacementKeyMap2 = {}, Object(defineProperty["a" /* default */])(_replacementKeyMap2, SHIFT, 'Shift'), Object(defineProperty["a" /* default */])(_replacementKeyMap2, COMMAND, isApple ? 'Command' : 'Control'), Object(defineProperty["a" /* default */])(_replacementKeyMap2, CTRL, 'Control'), Object(defineProperty["a" /* default */])(_replacementKeyMap2, ALT, isApple ? 'Option' : 'Alt'), Object(defineProperty["a" /* default */])(_replacementKeyMap2, ',', Object(external_this_wp_i18n_["__"])('Comma')), Object(defineProperty["a" /* default */])(_replacementKeyMap2, '.', Object(external_this_wp_i18n_["__"])('Period')), Object(defineProperty["a" /* default */])(_replacementKeyMap2, '`', Object(external_this_wp_i18n_["__"])('Backtick')), _replacementKeyMap2);
|
| 17782 |
+
return [].concat(Object(toConsumableArray["a" /* default */])(modifier(_isApple)), [character]).map(function (key) {
|
| 17783 |
+
return Object(external_lodash_["capitalize"])(Object(external_lodash_["get"])(replacementKeyMap, key, key));
|
| 17784 |
+
}).join(isApple ? ' ' : ' + ');
|
| 17785 |
+
};
|
| 17786 |
+
});
|
| 17787 |
/**
|
| 17788 |
+
* From a given KeyboardEvent, returns an array of active modifier constants for
|
| 17789 |
+
* the event.
|
|
|
|
|
|
|
| 17790 |
*
|
| 17791 |
+
* @param {KeyboardEvent} event Keyboard event.
|
| 17792 |
*
|
| 17793 |
+
* @return {Array<ALT|CTRL|COMMAND|SHIFT>} Active modifier constants.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17794 |
*/
|
| 17795 |
|
| 17796 |
+
function getEventModifiers(event) {
|
| 17797 |
+
return [ALT, CTRL, COMMAND, SHIFT].filter(function (key) {
|
| 17798 |
+
return event["".concat(key, "Key")];
|
| 17799 |
+
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17800 |
}
|
| 17801 |
/**
|
| 17802 |
+
* An object that contains functions to check if a keyboard event matches a
|
| 17803 |
+
* predefined shortcut combination.
|
| 17804 |
+
* E.g. isKeyboardEvent.primary( event, 'm' ) will return true if the event
|
| 17805 |
+
* signals pressing ⌘M.
|
| 17806 |
*
|
| 17807 |
+
* @type {WPKeycodeHandlerByModifier} Keyed map of functions to match events.
|
|
|
|
| 17808 |
*/
|
| 17809 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17810 |
|
| 17811 |
+
var isKeyboardEvent = Object(external_lodash_["mapValues"])(modifiers, function (getModifiers) {
|
| 17812 |
+
return function (event, character) {
|
| 17813 |
+
var _isApple = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : isAppleOS;
|
| 17814 |
|
| 17815 |
+
var mods = getModifiers(_isApple);
|
| 17816 |
+
var eventMods = getEventModifiers(event);
|
| 17817 |
|
| 17818 |
+
if (Object(external_lodash_["xor"])(mods, eventMods).length) {
|
| 17819 |
+
return false;
|
| 17820 |
+
}
|
| 17821 |
|
| 17822 |
+
if (!character) {
|
| 17823 |
+
return Object(external_lodash_["includes"])(mods, event.key.toLowerCase());
|
| 17824 |
+
}
|
| 17825 |
|
| 17826 |
+
return event.key === character;
|
| 17827 |
+
};
|
| 17828 |
+
});
|
| 17829 |
+
//# sourceMappingURL=index.js.map
|
| 17830 |
|
| 17831 |
/***/ }),
|
| 17832 |
|
| 17833 |
+
/***/ 543:
|
| 17834 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
| 17835 |
|
| 17836 |
"use strict";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17837 |
|
| 17838 |
+
// EXTERNAL MODULE: external {"this":["wp","element"]}
|
| 17839 |
+
var external_this_wp_element_ = __webpack_require__(0);
|
| 17840 |
+
|
| 17841 |
+
// EXTERNAL MODULE: external {"this":["wp","plugins"]}
|
| 17842 |
+
var external_this_wp_plugins_ = __webpack_require__(296);
|
| 17843 |
+
|
| 17844 |
+
// EXTERNAL MODULE: external {"this":["wc","navigation"]}
|
| 17845 |
+
var external_this_wc_navigation_ = __webpack_require__(32);
|
| 17846 |
+
|
| 17847 |
+
// EXTERNAL MODULE: external {"this":["wc","data"]}
|
| 17848 |
+
var external_this_wc_data_ = __webpack_require__(35);
|
| 17849 |
+
|
| 17850 |
+
// EXTERNAL MODULE: ./client/navigation/style.scss
|
| 17851 |
+
var style = __webpack_require__(574);
|
| 17852 |
+
|
| 17853 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/slicedToArray.js
|
| 17854 |
+
var slicedToArray = __webpack_require__(34);
|
| 17855 |
+
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
|
| 17856 |
+
|
| 17857 |
+
// EXTERNAL MODULE: external {"this":["wp","i18n"]}
|
| 17858 |
+
var external_this_wp_i18n_ = __webpack_require__(3);
|
| 17859 |
+
|
| 17860 |
+
// EXTERNAL MODULE: ./node_modules/@wordpress/compose/build-module/higher-order/compose.js
|
| 17861 |
+
var compose = __webpack_require__(277);
|
| 17862 |
+
|
| 17863 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
|
| 17864 |
+
var defineProperty = __webpack_require__(8);
|
| 17865 |
+
|
| 17866 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js + 3 modules
|
| 17867 |
+
var esm_slicedToArray = __webpack_require__(26);
|
| 17868 |
+
|
| 17869 |
+
// EXTERNAL MODULE: ./node_modules/classnames/index.js
|
| 17870 |
+
var classnames = __webpack_require__(4);
|
| 17871 |
+
var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
|
| 17872 |
+
|
| 17873 |
+
// EXTERNAL MODULE: external "lodash"
|
| 17874 |
+
var external_lodash_ = __webpack_require__(2);
|
| 17875 |
|
| 17876 |
+
// EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/animate/index.js
|
| 17877 |
+
var animate = __webpack_require__(134);
|
| 17878 |
+
|
| 17879 |
+
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigation/constants.js
|
| 17880 |
+
var ROOT_MENU = 'root';
|
| 17881 |
+
//# sourceMappingURL=constants.js.map
|
| 17882 |
+
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigation/context.js
|
| 17883 |
/**
|
| 17884 |
* External dependencies
|
| 17885 |
*/
|
| 17886 |
|
| 17887 |
+
/**
|
| 17888 |
+
* WordPress dependencies
|
| 17889 |
+
*/
|
| 17890 |
+
|
| 17891 |
|
| 17892 |
+
/**
|
| 17893 |
+
* Internal dependencies
|
| 17894 |
+
*/
|
| 17895 |
|
| 17896 |
|
| 17897 |
+
var NavigationContext = Object(external_this_wp_element_["createContext"])({
|
| 17898 |
+
activeItem: undefined,
|
| 17899 |
+
activeMenu: ROOT_MENU,
|
| 17900 |
+
setActiveMenu: external_lodash_["noop"],
|
| 17901 |
+
navigationTree: {
|
| 17902 |
+
items: {},
|
| 17903 |
+
getItem: external_lodash_["noop"],
|
| 17904 |
+
addItem: external_lodash_["noop"],
|
| 17905 |
+
removeItem: external_lodash_["noop"],
|
| 17906 |
+
menus: {},
|
| 17907 |
+
getMenu: external_lodash_["noop"],
|
| 17908 |
+
addMenu: external_lodash_["noop"],
|
| 17909 |
+
removeMenu: external_lodash_["noop"]
|
| 17910 |
+
}
|
| 17911 |
+
});
|
| 17912 |
+
var context_useNavigationContext = function useNavigationContext() {
|
| 17913 |
+
return Object(external_this_wp_element_["useContext"])(NavigationContext);
|
| 17914 |
+
};
|
| 17915 |
+
//# sourceMappingURL=context.js.map
|
| 17916 |
+
// EXTERNAL MODULE: ./node_modules/@emotion/styled-base/dist/styled-base.browser.esm.js + 1 modules
|
| 17917 |
+
var styled_base_browser_esm = __webpack_require__(41);
|
| 17918 |
|
| 17919 |
+
// EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/utils/colors-values.js
|
| 17920 |
+
var colors_values = __webpack_require__(91);
|
| 17921 |
|
| 17922 |
+
// EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/button/index.js
|
| 17923 |
+
var build_module_button = __webpack_require__(72);
|
| 17924 |
|
| 17925 |
+
// EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/text/index.js + 3 modules
|
| 17926 |
+
var build_module_text = __webpack_require__(190);
|
| 17927 |
|
| 17928 |
+
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/utils/reduce-motion.js
|
| 17929 |
/**
|
| 17930 |
+
* Allows users to opt-out of animations via OS-level preferences.
|
|
|
|
| 17931 |
*
|
| 17932 |
+
* @param {string} prop CSS Property name
|
| 17933 |
+
* @return {string} Generated CSS code for the reduced style
|
| 17934 |
*/
|
| 17935 |
+
function reduceMotion() {
|
| 17936 |
+
var prop = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'transition';
|
| 17937 |
+
var style;
|
| 17938 |
|
| 17939 |
+
switch (prop) {
|
| 17940 |
+
case 'transition':
|
| 17941 |
+
style = 'transition-duration: 0ms;';
|
| 17942 |
+
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17943 |
|
| 17944 |
+
case 'animation':
|
| 17945 |
+
style = 'animation-duration: 1ms;';
|
| 17946 |
+
break;
|
|
|
|
| 17947 |
|
| 17948 |
+
default:
|
| 17949 |
+
style = "\n\t\t\t\tanimation-duration: 1ms;\n\t\t\t\ttransition-duration: 0ms;\n\t\t\t";
|
| 17950 |
}
|
| 17951 |
|
| 17952 |
+
return "\n\t\t@media ( prefers-reduced-motion: reduce ) {\n\t\t\t".concat(style, ";\n\t\t}\n\t");
|
| 17953 |
+
}
|
| 17954 |
+
//# sourceMappingURL=reduce-motion.js.map
|
| 17955 |
+
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigation/styles/navigation-styles.js
|
| 17956 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17957 |
|
| 17958 |
+
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
| 17959 |
|
| 17960 |
+
/**
|
| 17961 |
+
* Internal dependencies
|
| 17962 |
+
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17963 |
|
|
|
|
|
|
|
|
|
|
| 17964 |
|
|
|
|
|
|
|
| 17965 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17966 |
|
| 17967 |
+
var NavigationUI = Object(styled_base_browser_esm["a" /* default */])("div", {
|
| 17968 |
+
target: "ejwewyf0",
|
| 17969 |
+
label: "NavigationUI"
|
| 17970 |
+
})("width:100%;background-color:", colors_values["b" /* G2 */].darkGray.primary, ";color:#f0f0f0;padding:0 8px;overflow:hidden;" + ( true ? "" : undefined));
|
| 17971 |
+
var MenuUI = Object(styled_base_browser_esm["a" /* default */])("div", {
|
| 17972 |
+
target: "ejwewyf1",
|
| 17973 |
+
label: "MenuUI"
|
| 17974 |
+
})( true ? {
|
| 17975 |
+
name: "1wlvkgj",
|
| 17976 |
+
styles: "margin-top:24px;margin-bottom:24px;display:flex;flex-direction:column;ul{padding:0;margin:0;list-style:none;}.components-navigation__back-button{margin-bottom:24px;}"
|
| 17977 |
+
} : undefined);
|
| 17978 |
+
var MenuBackButtonUI = /*#__PURE__*/Object(styled_base_browser_esm["a" /* default */])(build_module_button["a" /* default */], {
|
| 17979 |
+
target: "ejwewyf2",
|
| 17980 |
+
label: "MenuBackButtonUI"
|
| 17981 |
+
})("&.is-tertiary{color:", colors_values["b" /* G2 */].lightGray.ui, ";&:hover:not(:disabled ){color:#ddd;box-shadow:none;}&:active:not(:disabled ){background:transparent;color:#ddd;}}" + ( true ? "" : undefined));
|
| 17982 |
+
var MenuTitleUI = /*#__PURE__*/Object(styled_base_browser_esm["a" /* default */])(build_module_text["a" /* default */], {
|
| 17983 |
+
target: "ejwewyf3",
|
| 17984 |
+
label: "MenuTitleUI"
|
| 17985 |
+
})("padding:4px 0 4px 16px;margin-bottom:8px;color:", colors_values["b" /* G2 */].gray[100], ";" + ( true ? "" : undefined));
|
| 17986 |
+
var GroupTitleUI = /*#__PURE__*/Object(styled_base_browser_esm["a" /* default */])(build_module_text["a" /* default */], {
|
| 17987 |
+
target: "ejwewyf4",
|
| 17988 |
+
label: "GroupTitleUI"
|
| 17989 |
+
})("margin-top:8px;padding:4px 0 4px 16px;text-transform:uppercase;color:", colors_values["b" /* G2 */].gray[100], ";" + ( true ? "" : undefined));
|
| 17990 |
+
var ItemUI = Object(styled_base_browser_esm["a" /* default */])("li", {
|
| 17991 |
+
target: "ejwewyf5",
|
| 17992 |
+
label: "ItemUI"
|
| 17993 |
+
})("border-radius:2px;color:", colors_values["b" /* G2 */].lightGray.ui, ";button,a{margin:0;font-weight:400;font-size:14px;line-height:20px;padding-left:16px;padding-right:16px;width:100%;color:", colors_values["b" /* G2 */].lightGray.ui, ";&:hover,&:focus:not( [aria-disabled='true'] ):active,&:active:not( [aria-disabled='true'] ):active{color:#ddd;}}&.is-active{background-color:", colors_values["c" /* UI */].theme, ";color:", colors_values["c" /* UI */].textDark, ";button,a{color:", colors_values["c" /* UI */].textDark, ";}}svg path{color:", colors_values["b" /* G2 */].lightGray.ui, ";}" + ( true ? "" : undefined));
|
| 17994 |
+
var ItemBadgeUI = Object(styled_base_browser_esm["a" /* default */])("span", {
|
| 17995 |
+
target: "ejwewyf6",
|
| 17996 |
+
label: "ItemBadgeUI"
|
| 17997 |
+
})("margin-left:8px;display:inline-flex;padding:4px 12px;border-radius:2px;animation:fade-in 250ms ease-out;@keyframes fade-in{from{opacity:0;}to{opacity:1;}}", reduceMotion('animation'), ";" + ( true ? "" : undefined));
|
| 17998 |
+
var ItemTitleUI = /*#__PURE__*/Object(styled_base_browser_esm["a" /* default */])(build_module_text["a" /* default */], {
|
| 17999 |
+
target: "ejwewyf7",
|
| 18000 |
+
label: "ItemTitleUI"
|
| 18001 |
+
})( true ? {
|
| 18002 |
+
name: "zs804i",
|
| 18003 |
+
styles: "margin-right:auto;text-align:left;"
|
| 18004 |
+
} : undefined);
|
| 18005 |
+
//# sourceMappingURL=navigation-styles.js.map
|
| 18006 |
+
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigation/use-navigation-tree-nodes.js
|
| 18007 |
|
|
|
|
| 18008 |
|
|
|
|
|
|
|
| 18009 |
|
| 18010 |
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
| 18011 |
+
|
| 18012 |
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
| 18013 |
+
|
|
|
|
| 18014 |
/**
|
| 18015 |
+
* External dependencies
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18016 |
*/
|
| 18017 |
|
| 18018 |
+
/**
|
| 18019 |
+
* WordPress dependencies
|
| 18020 |
+
*/
|
| 18021 |
+
|
| 18022 |
+
|
| 18023 |
+
var use_navigation_tree_nodes_useNavigationTreeNodes = function useNavigationTreeNodes() {
|
| 18024 |
+
var _useState = Object(external_this_wp_element_["useState"])({}),
|
| 18025 |
+
_useState2 = Object(esm_slicedToArray["a" /* default */])(_useState, 2),
|
| 18026 |
+
nodes = _useState2[0],
|
| 18027 |
+
setNodes = _useState2[1];
|
| 18028 |
+
|
| 18029 |
+
var getNode = function getNode(key) {
|
| 18030 |
+
return nodes[key];
|
| 18031 |
+
};
|
| 18032 |
+
|
| 18033 |
+
var addNode = function addNode(key, value) {
|
| 18034 |
+
return setNodes(function (original) {
|
| 18035 |
+
return _objectSpread(_objectSpread({}, original), {}, Object(defineProperty["a" /* default */])({}, key, Object(external_lodash_["omit"])(value, 'children')));
|
| 18036 |
+
});
|
| 18037 |
+
};
|
| 18038 |
|
| 18039 |
+
var removeNode = function removeNode(key) {
|
| 18040 |
+
return setNodes(function (original) {
|
| 18041 |
+
return Object(external_lodash_["omit"])(original, key);
|
| 18042 |
+
});
|
| 18043 |
+
};
|
| 18044 |
|
| 18045 |
+
return {
|
| 18046 |
+
nodes: nodes,
|
| 18047 |
+
getNode: getNode,
|
| 18048 |
+
addNode: addNode,
|
| 18049 |
+
removeNode: removeNode
|
| 18050 |
+
};
|
| 18051 |
+
};
|
| 18052 |
+
//# sourceMappingURL=use-navigation-tree-nodes.js.map
|
| 18053 |
+
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigation/use-create-navigation-tree.js
|
| 18054 |
+
/**
|
| 18055 |
+
* Internal dependencies
|
| 18056 |
+
*/
|
| 18057 |
|
| 18058 |
+
var use_create_navigation_tree_useCreateNavigationTree = function useCreateNavigationTree() {
|
| 18059 |
+
var _useNavigationTreeNod = use_navigation_tree_nodes_useNavigationTreeNodes(),
|
| 18060 |
+
items = _useNavigationTreeNod.nodes,
|
| 18061 |
+
getItem = _useNavigationTreeNod.getNode,
|
| 18062 |
+
addItem = _useNavigationTreeNod.addNode,
|
| 18063 |
+
removeItem = _useNavigationTreeNod.removeNode;
|
| 18064 |
|
| 18065 |
+
var _useNavigationTreeNod2 = use_navigation_tree_nodes_useNavigationTreeNodes(),
|
| 18066 |
+
menus = _useNavigationTreeNod2.nodes,
|
| 18067 |
+
getMenu = _useNavigationTreeNod2.getNode,
|
| 18068 |
+
addMenu = _useNavigationTreeNod2.addNode,
|
| 18069 |
+
removeMenu = _useNavigationTreeNod2.removeNode;
|
|
|
|
|
|
|
| 18070 |
|
| 18071 |
+
return {
|
| 18072 |
+
items: items,
|
| 18073 |
+
getItem: getItem,
|
| 18074 |
+
addItem: addItem,
|
| 18075 |
+
removeItem: removeItem,
|
| 18076 |
+
menus: menus,
|
| 18077 |
+
getMenu: getMenu,
|
| 18078 |
+
addMenu: addMenu,
|
| 18079 |
+
removeMenu: removeMenu
|
| 18080 |
+
};
|
| 18081 |
+
};
|
| 18082 |
+
//# sourceMappingURL=use-create-navigation-tree.js.map
|
| 18083 |
+
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigation/index.js
|
| 18084 |
|
|
|
|
|
|
|
| 18085 |
|
|
|
|
| 18086 |
|
|
|
|
| 18087 |
|
| 18088 |
+
/**
|
| 18089 |
+
* External dependencies
|
| 18090 |
+
*/
|
| 18091 |
|
|
|
|
| 18092 |
|
| 18093 |
+
/**
|
| 18094 |
+
* WordPress dependencies
|
| 18095 |
+
*/
|
| 18096 |
|
|
|
|
| 18097 |
|
| 18098 |
+
/**
|
| 18099 |
+
* Internal dependencies
|
| 18100 |
+
*/
|
|
|
|
|
|
|
|
|
|
| 18101 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18102 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18103 |
|
|
|
|
|
|
|
|
|
|
| 18104 |
|
|
|
|
|
|
|
|
|
|
| 18105 |
|
|
|
|
|
|
|
|
|
|
| 18106 |
|
| 18107 |
+
function navigation_Navigation(_ref) {
|
| 18108 |
+
var activeItem = _ref.activeItem,
|
| 18109 |
+
_ref$activeMenu = _ref.activeMenu,
|
| 18110 |
+
activeMenu = _ref$activeMenu === void 0 ? ROOT_MENU : _ref$activeMenu,
|
| 18111 |
+
children = _ref.children,
|
| 18112 |
+
className = _ref.className,
|
| 18113 |
+
_ref$onActivateMenu = _ref.onActivateMenu,
|
| 18114 |
+
onActivateMenu = _ref$onActivateMenu === void 0 ? external_lodash_["noop"] : _ref$onActivateMenu;
|
| 18115 |
|
| 18116 |
+
var _useState = Object(external_this_wp_element_["useState"])(activeMenu),
|
| 18117 |
+
_useState2 = Object(esm_slicedToArray["a" /* default */])(_useState, 2),
|
| 18118 |
+
menu = _useState2[0],
|
| 18119 |
+
setMenu = _useState2[1];
|
| 18120 |
|
| 18121 |
+
var _useState3 = Object(external_this_wp_element_["useState"])(),
|
| 18122 |
+
_useState4 = Object(esm_slicedToArray["a" /* default */])(_useState3, 2),
|
| 18123 |
+
slideOrigin = _useState4[0],
|
| 18124 |
+
setSlideOrigin = _useState4[1];
|
| 18125 |
|
| 18126 |
+
var navigationTree = use_create_navigation_tree_useCreateNavigationTree();
|
|
|
|
|
|
|
| 18127 |
|
| 18128 |
+
var setActiveMenu = function setActiveMenu(menuId) {
|
| 18129 |
+
var slideInOrigin = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'left';
|
| 18130 |
|
| 18131 |
+
if (!navigationTree.getMenu(menuId)) {
|
| 18132 |
+
return;
|
| 18133 |
+
}
|
| 18134 |
|
| 18135 |
+
setSlideOrigin(slideInOrigin);
|
| 18136 |
+
setMenu(menuId);
|
| 18137 |
+
onActivateMenu(menuId);
|
| 18138 |
+
}; // Used to prevent the sliding animation on mount
|
| 18139 |
|
|
|
|
|
|
|
| 18140 |
|
| 18141 |
+
var isMounted = Object(external_this_wp_element_["useRef"])(false);
|
| 18142 |
+
Object(external_this_wp_element_["useEffect"])(function () {
|
| 18143 |
+
if (!isMounted.current) {
|
| 18144 |
+
isMounted.current = true;
|
| 18145 |
+
}
|
| 18146 |
+
}, []);
|
| 18147 |
+
Object(external_this_wp_element_["useEffect"])(function () {
|
| 18148 |
+
if (activeMenu !== menu) {
|
| 18149 |
+
setActiveMenu(activeMenu);
|
| 18150 |
+
}
|
| 18151 |
+
}, [activeMenu]);
|
| 18152 |
+
var context = {
|
| 18153 |
+
activeItem: activeItem,
|
| 18154 |
+
activeMenu: menu,
|
| 18155 |
+
setActiveMenu: setActiveMenu,
|
| 18156 |
+
navigationTree: navigationTree
|
| 18157 |
+
};
|
| 18158 |
+
var classes = classnames_default()('components-navigation', className);
|
| 18159 |
+
return Object(external_this_wp_element_["createElement"])(NavigationUI, {
|
| 18160 |
+
className: classes
|
| 18161 |
+
}, Object(external_this_wp_element_["createElement"])(animate["a" /* default */], {
|
| 18162 |
+
key: menu,
|
| 18163 |
+
type: "slide-in",
|
| 18164 |
+
options: {
|
| 18165 |
+
origin: slideOrigin
|
| 18166 |
+
}
|
| 18167 |
+
}, function (_ref2) {
|
| 18168 |
+
var animateClassName = _ref2.className;
|
| 18169 |
+
return Object(external_this_wp_element_["createElement"])("div", {
|
| 18170 |
+
className: classnames_default()(Object(defineProperty["a" /* default */])({}, animateClassName, isMounted.current && slideOrigin))
|
| 18171 |
+
}, Object(external_this_wp_element_["createElement"])(NavigationContext.Provider, {
|
| 18172 |
+
value: context
|
| 18173 |
+
}, children));
|
| 18174 |
+
}));
|
| 18175 |
+
}
|
| 18176 |
+
//# sourceMappingURL=index.js.map
|
| 18177 |
+
// EXTERNAL MODULE: ./node_modules/@wordpress/components/node_modules/@wordpress/icons/build-module/icon/index.js
|
| 18178 |
+
var icon = __webpack_require__(575);
|
| 18179 |
|
| 18180 |
+
// EXTERNAL MODULE: ./node_modules/@wordpress/primitives/build-module/svg/index.js
|
| 18181 |
+
var svg = __webpack_require__(88);
|
| 18182 |
|
| 18183 |
+
// CONCATENATED MODULE: ./node_modules/@wordpress/components/node_modules/@wordpress/icons/build-module/library/chevron-left.js
|
| 18184 |
|
| 18185 |
|
| 18186 |
+
/**
|
| 18187 |
+
* WordPress dependencies
|
| 18188 |
+
*/
|
| 18189 |
|
| 18190 |
+
var chevronLeft = Object(external_this_wp_element_["createElement"])(svg["c" /* SVG */], {
|
| 18191 |
+
xmlns: "http://www.w3.org/2000/svg",
|
| 18192 |
+
viewBox: "0 0 24 24"
|
| 18193 |
+
}, Object(external_this_wp_element_["createElement"])(svg["b" /* Path */], {
|
| 18194 |
+
d: "M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"
|
| 18195 |
+
}));
|
| 18196 |
+
/* harmony default export */ var chevron_left = (chevronLeft);
|
| 18197 |
+
//# sourceMappingURL=chevron-left.js.map
|
| 18198 |
+
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigation/back-button/index.js
|
| 18199 |
|
|
|
|
| 18200 |
|
| 18201 |
/**
|
| 18202 |
* External dependencies
|
| 18203 |
*/
|
| 18204 |
|
| 18205 |
+
/**
|
| 18206 |
+
* WordPress dependencies
|
| 18207 |
+
*/
|
| 18208 |
+
|
| 18209 |
|
| 18210 |
|
| 18211 |
+
/**
|
| 18212 |
+
* Internal dependencies
|
| 18213 |
+
*/
|
| 18214 |
|
| 18215 |
|
| 18216 |
|
| 18217 |
+
function NavigationBackButton(_ref) {
|
| 18218 |
+
var _navigationTree$getMe;
|
| 18219 |
|
| 18220 |
+
var backButtonLabel = _ref.backButtonLabel,
|
| 18221 |
+
className = _ref.className,
|
| 18222 |
+
href = _ref.href,
|
| 18223 |
+
_onClick = _ref.onClick,
|
| 18224 |
+
parentMenu = _ref.parentMenu;
|
| 18225 |
|
| 18226 |
+
var _useNavigationContext = context_useNavigationContext(),
|
| 18227 |
+
setActiveMenu = _useNavigationContext.setActiveMenu,
|
| 18228 |
+
navigationTree = _useNavigationContext.navigationTree;
|
| 18229 |
+
|
| 18230 |
+
var classes = classnames_default()('components-navigation__back-button', className);
|
| 18231 |
+
var parentMenuTitle = (_navigationTree$getMe = navigationTree.getMenu(parentMenu)) === null || _navigationTree$getMe === void 0 ? void 0 : _navigationTree$getMe.title;
|
| 18232 |
+
return Object(external_this_wp_element_["createElement"])(MenuBackButtonUI, {
|
| 18233 |
+
className: classes,
|
| 18234 |
+
isTertiary: true,
|
| 18235 |
+
href: href,
|
| 18236 |
+
onClick: function onClick() {
|
| 18237 |
+
return parentMenu ? setActiveMenu(parentMenu, 'right') : _onClick;
|
| 18238 |
+
}
|
| 18239 |
+
}, Object(external_this_wp_element_["createElement"])(icon["a" /* default */], {
|
| 18240 |
+
icon: chevron_left
|
| 18241 |
+
}), backButtonLabel || parentMenuTitle || Object(external_this_wp_i18n_["__"])('Back'));
|
| 18242 |
+
}
|
| 18243 |
+
//# sourceMappingURL=index.js.map
|
| 18244 |
+
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigation/menu/context.js
|
| 18245 |
/**
|
| 18246 |
+
* WordPress dependencies
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18247 |
*/
|
| 18248 |
|
| 18249 |
+
var NavigationMenuContext = Object(external_this_wp_element_["createContext"])({
|
| 18250 |
+
menu: undefined,
|
| 18251 |
+
isActive: false
|
| 18252 |
+
});
|
| 18253 |
+
var context_useNavigationMenuContext = function useNavigationMenuContext() {
|
| 18254 |
+
return Object(external_this_wp_element_["useContext"])(NavigationMenuContext);
|
| 18255 |
+
};
|
| 18256 |
+
//# sourceMappingURL=context.js.map
|
| 18257 |
+
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigation/menu/use-navigation-tree-menu.js
|
|
|
|
|
|
|
|
|
|
| 18258 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18259 |
|
| 18260 |
+
function use_navigation_tree_menu_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
|
|
|
|
|
| 18261 |
|
| 18262 |
+
function use_navigation_tree_menu_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { use_navigation_tree_menu_ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { use_navigation_tree_menu_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
| 18263 |
|
| 18264 |
+
/**
|
| 18265 |
+
* WordPress dependencies
|
| 18266 |
+
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18267 |
|
| 18268 |
+
/**
|
| 18269 |
+
* Internal dependencies
|
| 18270 |
+
*/
|
| 18271 |
|
|
|
|
|
|
|
|
|
|
| 18272 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18273 |
|
| 18274 |
+
var use_navigation_tree_menu_useNavigationTreeMenu = function useNavigationTreeMenu(props) {
|
| 18275 |
+
var _useNavigationContext = context_useNavigationContext(),
|
| 18276 |
+
_useNavigationContext2 = _useNavigationContext.navigationTree,
|
| 18277 |
+
addMenu = _useNavigationContext2.addMenu,
|
| 18278 |
+
removeMenu = _useNavigationContext2.removeMenu;
|
| 18279 |
|
| 18280 |
+
var key = props.menu || ROOT_MENU;
|
| 18281 |
+
Object(external_this_wp_element_["useEffect"])(function () {
|
| 18282 |
+
addMenu(key, use_navigation_tree_menu_objectSpread(use_navigation_tree_menu_objectSpread({}, props), {}, {
|
| 18283 |
+
menu: key
|
| 18284 |
+
}));
|
| 18285 |
+
return function () {
|
| 18286 |
+
removeMenu(key);
|
| 18287 |
+
};
|
| 18288 |
+
}, []);
|
| 18289 |
+
};
|
| 18290 |
+
//# sourceMappingURL=use-navigation-tree-menu.js.map
|
| 18291 |
+
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigation/menu/index.js
|
| 18292 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18293 |
|
| 18294 |
+
/**
|
| 18295 |
+
* External dependencies
|
| 18296 |
+
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18297 |
|
| 18298 |
+
/**
|
| 18299 |
+
* Internal dependencies
|
| 18300 |
+
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18301 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18302 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18303 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18304 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18305 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18306 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18307 |
|
| 18308 |
+
function NavigationMenu(props) {
|
| 18309 |
+
var backButtonLabel = props.backButtonLabel,
|
| 18310 |
+
children = props.children,
|
| 18311 |
+
className = props.className,
|
| 18312 |
+
_props$menu = props.menu,
|
| 18313 |
+
menu = _props$menu === void 0 ? ROOT_MENU : _props$menu,
|
| 18314 |
+
parentMenu = props.parentMenu,
|
| 18315 |
+
title = props.title;
|
| 18316 |
+
use_navigation_tree_menu_useNavigationTreeMenu(props);
|
| 18317 |
+
|
| 18318 |
+
var _useNavigationContext = context_useNavigationContext(),
|
| 18319 |
+
activeMenu = _useNavigationContext.activeMenu;
|
| 18320 |
+
|
| 18321 |
+
var isActive = activeMenu === menu;
|
| 18322 |
+
var classes = classnames_default()('components-navigation__menu', className);
|
| 18323 |
+
var context = {
|
| 18324 |
+
menu: menu,
|
| 18325 |
+
isActive: isActive
|
| 18326 |
+
}; // Keep the children rendered to make sure inactive items are included in the navigation tree
|
| 18327 |
+
|
| 18328 |
+
if (!isActive) {
|
| 18329 |
+
return Object(external_this_wp_element_["createElement"])(NavigationMenuContext.Provider, {
|
| 18330 |
+
value: context
|
| 18331 |
+
}, children);
|
| 18332 |
+
}
|
| 18333 |
|
| 18334 |
+
return Object(external_this_wp_element_["createElement"])(NavigationMenuContext.Provider, {
|
| 18335 |
+
value: context
|
| 18336 |
+
}, Object(external_this_wp_element_["createElement"])(MenuUI, {
|
| 18337 |
+
className: classes
|
| 18338 |
+
}, parentMenu && Object(external_this_wp_element_["createElement"])(NavigationBackButton, {
|
| 18339 |
+
backButtonLabel: backButtonLabel,
|
| 18340 |
+
parentMenu: parentMenu
|
| 18341 |
+
}), title && Object(external_this_wp_element_["createElement"])(MenuTitleUI, {
|
| 18342 |
+
as: "h2",
|
| 18343 |
+
className: "components-navigation__menu-title",
|
| 18344 |
+
variant: "subtitle"
|
| 18345 |
+
}, title), Object(external_this_wp_element_["createElement"])("ul", null, children)));
|
| 18346 |
+
}
|
| 18347 |
+
//# sourceMappingURL=index.js.map
|
| 18348 |
+
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigation/group/index.js
|
| 18349 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18350 |
|
| 18351 |
+
/**
|
| 18352 |
+
* External dependencies
|
| 18353 |
+
*/
|
|
|
|
|
|
|
| 18354 |
|
| 18355 |
+
/**
|
| 18356 |
+
* Internal dependencies
|
| 18357 |
+
*/
|
|
|
|
|
|
|
| 18358 |
|
| 18359 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18360 |
|
| 18361 |
+
function NavigationGroup(_ref) {
|
| 18362 |
+
var children = _ref.children,
|
| 18363 |
+
className = _ref.className,
|
| 18364 |
+
title = _ref.title;
|
| 18365 |
|
| 18366 |
+
var _useNavigationMenuCon = context_useNavigationMenuContext(),
|
| 18367 |
+
isActive = _useNavigationMenuCon.isActive; // Keep the children rendered to make sure inactive items are included in the navigation tree
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18368 |
|
|
|
|
|
|
|
| 18369 |
|
| 18370 |
+
if (!isActive) {
|
| 18371 |
+
return children;
|
| 18372 |
+
}
|
| 18373 |
+
|
| 18374 |
+
var classes = classnames_default()('components-navigation__group', className);
|
| 18375 |
+
return Object(external_this_wp_element_["createElement"])("li", {
|
| 18376 |
+
className: classes
|
| 18377 |
+
}, title && Object(external_this_wp_element_["createElement"])(GroupTitleUI, {
|
| 18378 |
+
as: "h3",
|
| 18379 |
+
className: "components-navigation__group-title",
|
| 18380 |
+
variant: "caption"
|
| 18381 |
+
}, title), Object(external_this_wp_element_["createElement"])("ul", null, children));
|
| 18382 |
+
}
|
| 18383 |
+
//# sourceMappingURL=index.js.map
|
| 18384 |
+
// EXTERNAL MODULE: ./client/settings/index.js
|
| 18385 |
+
var settings = __webpack_require__(36);
|
| 18386 |
|
| 18387 |
+
// EXTERNAL MODULE: external {"this":["wp","data"]}
|
| 18388 |
+
var external_this_wp_data_ = __webpack_require__(20);
|
| 18389 |
|
| 18390 |
+
// CONCATENATED MODULE: ./client/navigation/utils.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18391 |
/**
|
| 18392 |
* External dependencies
|
| 18393 |
*/
|
| 18394 |
|
| 18395 |
/**
|
| 18396 |
+
* Get the params from a location as a key/value pair object.
|
| 18397 |
+
*
|
| 18398 |
+
* @param {Object} location Window location
|
| 18399 |
+
* @return {Object} Params
|
| 18400 |
*/
|
| 18401 |
|
| 18402 |
+
var getParams = function getParams(location) {
|
| 18403 |
+
var params = {};
|
| 18404 |
|
| 18405 |
+
if (location.search) {
|
| 18406 |
+
new URLSearchParams(location.search.substring(1)).forEach(function (value, key) {
|
| 18407 |
+
params[key] = value;
|
| 18408 |
+
});
|
| 18409 |
+
}
|
| 18410 |
|
| 18411 |
+
return params;
|
| 18412 |
+
};
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18413 |
/**
|
| 18414 |
+
* Get the full URL if a relative path is passed.
|
| 18415 |
*
|
| 18416 |
+
* @param {string} url URL
|
| 18417 |
+
* @return {string} Full URL
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18418 |
*/
|
| 18419 |
|
| 18420 |
+
var getFullUrl = function getFullUrl(url) {
|
| 18421 |
+
var _window$location = window.location,
|
| 18422 |
+
origin = _window$location.origin,
|
| 18423 |
+
pathname = _window$location.pathname,
|
| 18424 |
+
search = _window$location.search;
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18425 |
|
| 18426 |
+
if (url.indexOf('#') === 0) {
|
| 18427 |
+
return origin + pathname + search + url;
|
| 18428 |
+
}
|
| 18429 |
|
| 18430 |
+
if (url.indexOf('http') === 0) {
|
| 18431 |
+
return url;
|
| 18432 |
+
}
|
| 18433 |
|
| 18434 |
+
return origin + url;
|
| 18435 |
+
};
|
| 18436 |
/**
|
| 18437 |
+
* Check to see if a URL matches a given window location.
|
| 18438 |
+
*
|
| 18439 |
+
* @param {Object} location Window location
|
| 18440 |
+
* @param {string} url URL to compare
|
| 18441 |
+
* @return {number} Number of matches or 0 if not matched.
|
| 18442 |
*/
|
| 18443 |
|
| 18444 |
+
var getMatchScore = function getMatchScore(location, url) {
|
| 18445 |
+
if (!url) {
|
| 18446 |
+
return;
|
| 18447 |
+
}
|
| 18448 |
|
| 18449 |
+
var fullUrl = getFullUrl(url);
|
| 18450 |
+
var urlLocation = new URL(fullUrl);
|
| 18451 |
+
var urlOrigin = urlLocation.origin,
|
| 18452 |
+
urlPathname = urlLocation.pathname;
|
| 18453 |
+
var hash = location.hash,
|
| 18454 |
+
origin = location.origin,
|
| 18455 |
+
pathname = location.pathname,
|
| 18456 |
+
search = location.search; // Exact match found.
|
| 18457 |
|
| 18458 |
+
if (origin + pathname + search + hash === fullUrl) {
|
| 18459 |
+
return Number.MAX_SAFE_INTEGER;
|
| 18460 |
+
} // Matched URL without hash.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18461 |
|
|
|
|
|
|
|
| 18462 |
|
| 18463 |
+
if (hash.length && origin + pathname + search === fullUrl) {
|
| 18464 |
+
return Number.MAX_SAFE_INTEGER - 1;
|
| 18465 |
+
}
|
|
|
|
| 18466 |
|
| 18467 |
+
var urlParams = getParams(urlLocation); // Post type match.
|
|
|
|
| 18468 |
|
| 18469 |
+
if (window.wcNavigation.postType === urlParams.post_type && urlPathname.indexOf('edit.php') >= 0 && origin === urlOrigin) {
|
| 18470 |
+
return Number.MAX_SAFE_INTEGER - 2;
|
| 18471 |
+
} // Add points for each matching param.
|
| 18472 |
|
|
|
|
|
|
|
| 18473 |
|
| 18474 |
+
var matchingParamCount = 0;
|
| 18475 |
+
var locationParams = getParams(location);
|
| 18476 |
+
Object.keys(urlParams).forEach(function (key) {
|
| 18477 |
+
if (urlParams[key] === locationParams[key]) {
|
| 18478 |
+
matchingParamCount++;
|
| 18479 |
}
|
| 18480 |
+
});
|
| 18481 |
+
return origin === urlOrigin && pathname === urlPathname ? matchingParamCount : 0;
|
| 18482 |
+
};
|
| 18483 |
+
/**
|
| 18484 |
+
* Adds a listener that runs on history change.
|
| 18485 |
+
*
|
| 18486 |
+
* @param {Function} listener Listener to add on history change.
|
| 18487 |
+
* @return {Function} Function to remove listeners.
|
| 18488 |
+
*/
|
| 18489 |
|
| 18490 |
+
var addHistoryListener = function addHistoryListener(listener) {
|
| 18491 |
+
// Monkey patch pushState to allow trigger the pushstate event listener.
|
| 18492 |
+
if (!window.wcNavigation.historyPatched) {
|
| 18493 |
+
(function (history) {
|
| 18494 |
+
/* global CustomEvent */
|
| 18495 |
+
var pushState = history.pushState;
|
| 18496 |
+
var replaceState = history.replaceState;
|
| 18497 |
|
| 18498 |
+
history.pushState = function (state) {
|
| 18499 |
+
var pushStateEvent = new CustomEvent('pushstate', {
|
| 18500 |
+
state: state
|
| 18501 |
+
});
|
| 18502 |
+
window.dispatchEvent(pushStateEvent);
|
| 18503 |
+
return pushState.apply(history, arguments);
|
| 18504 |
+
};
|
| 18505 |
|
| 18506 |
+
history.replaceState = function (state) {
|
| 18507 |
+
var replaceStateEvent = new CustomEvent('replacestate', {
|
| 18508 |
+
state: state
|
| 18509 |
+
});
|
| 18510 |
+
window.dispatchEvent(replaceStateEvent);
|
| 18511 |
+
return replaceState.apply(history, arguments);
|
| 18512 |
+
};
|
| 18513 |
|
| 18514 |
+
window.wcNavigation.historyPatched = true;
|
| 18515 |
+
})(window.history);
|
| 18516 |
+
}
|
| 18517 |
|
| 18518 |
+
window.addEventListener('popstate', listener);
|
| 18519 |
+
window.addEventListener('pushstate', listener);
|
| 18520 |
+
window.addEventListener('replacestate', listener);
|
| 18521 |
+
return function () {
|
| 18522 |
+
window.removeEventListener('popstate', listener);
|
| 18523 |
+
window.removeEventListener('pushstate', listener);
|
| 18524 |
+
window.removeEventListener('replacestate', listener);
|
| 18525 |
+
};
|
| 18526 |
+
};
|
| 18527 |
/**
|
| 18528 |
+
* Get the closest matching item.
|
| 18529 |
+
*
|
| 18530 |
+
* @param {Array} items An array of items to match against.
|
| 18531 |
*/
|
| 18532 |
|
| 18533 |
+
var utils_getMatchingItem = function getMatchingItem(items) {
|
| 18534 |
+
var matchedItem = null;
|
| 18535 |
+
var highestMatch = 0;
|
| 18536 |
+
items.forEach(function (item) {
|
| 18537 |
+
var score = getMatchScore(window.location, Object(settings["f" /* getAdminLink */])(item.url));
|
| 18538 |
|
| 18539 |
+
if (score >= highestMatch && score > 0) {
|
| 18540 |
+
matchedItem = item;
|
| 18541 |
+
highestMatch = score;
|
| 18542 |
+
}
|
| 18543 |
+
});
|
| 18544 |
+
return matchedItem || null;
|
| 18545 |
+
};
|
| 18546 |
+
// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/icon/index.js
|
| 18547 |
+
var build_module_icon = __webpack_require__(570);
|
| 18548 |
|
| 18549 |
+
// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/wordpress.js
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18550 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18551 |
|
| 18552 |
+
/**
|
| 18553 |
+
* WordPress dependencies
|
| 18554 |
+
*/
|
| 18555 |
|
| 18556 |
+
var wordpress = Object(external_this_wp_element_["createElement"])(svg["c" /* SVG */], {
|
| 18557 |
+
xmlns: "http://www.w3.org/2000/svg",
|
| 18558 |
+
viewBox: "-2 -2 24 24"
|
| 18559 |
+
}, Object(external_this_wp_element_["createElement"])(svg["b" /* Path */], {
|
| 18560 |
+
d: "M20 10c0-5.51-4.49-10-10-10C4.48 0 0 4.49 0 10c0 5.52 4.48 10 10 10 5.51 0 10-4.48 10-10zM7.78 15.37L4.37 6.22c.55-.02 1.17-.08 1.17-.08.5-.06.44-1.13-.06-1.11 0 0-1.45.11-2.37.11-.18 0-.37 0-.58-.01C4.12 2.69 6.87 1.11 10 1.11c2.33 0 4.45.87 6.05 2.34-.68-.11-1.65.39-1.65 1.58 0 .74.45 1.36.9 2.1.35.61.55 1.36.55 2.46 0 1.49-1.4 5-1.4 5l-3.03-8.37c.54-.02.82-.17.82-.17.5-.05.44-1.25-.06-1.22 0 0-1.44.12-2.38.12-.87 0-2.33-.12-2.33-.12-.5-.03-.56 1.2-.06 1.22l.92.08 1.26 3.41zM17.41 10c.24-.64.74-1.87.43-4.25.7 1.29 1.05 2.71 1.05 4.25 0 3.29-1.73 6.24-4.4 7.78.97-2.59 1.94-5.2 2.92-7.78zM6.1 18.09C3.12 16.65 1.11 13.53 1.11 10c0-1.3.23-2.48.72-3.59C3.25 10.3 4.67 14.2 6.1 18.09zm4.03-6.63l2.58 6.98c-.86.29-1.76.45-2.71.45-.79 0-1.57-.11-2.29-.33.81-2.38 1.62-4.74 2.42-7.1z"
|
| 18561 |
+
}));
|
| 18562 |
+
/* harmony default export */ var library_wordpress = (wordpress);
|
| 18563 |
+
//# sourceMappingURL=wordpress.js.map
|
| 18564 |
+
// EXTERNAL MODULE: external "React"
|
| 18565 |
+
var external_React_ = __webpack_require__(6);
|
| 18566 |
|
| 18567 |
+
// EXTERNAL MODULE: ./client/hooks/useIsScrolled.js
|
| 18568 |
+
var useIsScrolled = __webpack_require__(295);
|
|
|
|
|
|
|
| 18569 |
|
| 18570 |
+
// CONCATENATED MODULE: ./client/navigation/components/header/index.js
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18571 |
|
| 18572 |
|
| 18573 |
/**
|
| 18574 |
+
* External dependencies
|
| 18575 |
*/
|
| 18576 |
|
| 18577 |
|
| 18579 |
|
| 18580 |
|
| 18581 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18582 |
|
| 18583 |
|
| 18584 |
/**
|
| 18585 |
+
* Internal dependencies
|
| 18586 |
*/
|
| 18587 |
|
| 18588 |
|
| 18589 |
|
| 18590 |
+
var header_Header = function Header() {
|
| 18591 |
+
var siteTitle = Object(settings["g" /* getSetting */])('siteTitle', '');
|
| 18592 |
+
var siteUrl = Object(settings["g" /* getSetting */])('siteUrl', '');
|
| 18593 |
+
var isScrolled = Object(useIsScrolled["a" /* default */])();
|
| 18594 |
|
| 18595 |
+
var toggleFolded = function toggleFolded() {
|
| 18596 |
+
document.body.classList.toggle('is-folded');
|
| 18597 |
+
};
|
| 18598 |
|
| 18599 |
+
var foldOnMobile = function foldOnMobile() {
|
| 18600 |
+
var screenWidth = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document.body.clientWidth;
|
| 18601 |
+
var isSmallScreen = screenWidth <= 960;
|
| 18602 |
+
document.body.classList[isSmallScreen ? 'add' : 'remove']('is-folded');
|
| 18603 |
+
};
|
| 18604 |
|
| 18605 |
+
Object(external_React_["useEffect"])(function () {
|
| 18606 |
+
foldOnMobile();
|
| 18607 |
+
var foldEvents = [{
|
| 18608 |
+
eventName: 'orientationchange',
|
| 18609 |
+
handler: function handler(e) {
|
| 18610 |
+
return foldOnMobile(e.target.screen.availWidth);
|
| 18611 |
+
}
|
| 18612 |
+
}, {
|
| 18613 |
+
eventName: 'resize',
|
| 18614 |
+
handler: Object(external_lodash_["debounce"])(function () {
|
| 18615 |
+
return foldOnMobile();
|
| 18616 |
+
}, 200)
|
| 18617 |
+
}];
|
| 18618 |
|
| 18619 |
+
for (var _i = 0, _foldEvents = foldEvents; _i < _foldEvents.length; _i++) {
|
| 18620 |
+
var _foldEvents$_i = _foldEvents[_i],
|
| 18621 |
+
eventName = _foldEvents$_i.eventName,
|
| 18622 |
+
handler = _foldEvents$_i.handler;
|
| 18623 |
+
window.addEventListener(eventName, handler, false);
|
| 18624 |
+
}
|
| 18625 |
+
}, []);
|
| 18626 |
+
var buttonIcon = Object(external_this_wp_element_["createElement"])(build_module_icon["a" /* default */], {
|
| 18627 |
+
size: "36px",
|
| 18628 |
+
icon: library_wordpress
|
| 18629 |
+
});
|
| 18630 |
|
| 18631 |
+
var _useSelect = Object(external_this_wp_data_["useSelect"])(function (select) {
|
| 18632 |
+
var _select = select('core/data'),
|
| 18633 |
+
isResolving = _select.isResolving;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18634 |
|
| 18635 |
+
var _select2 = select('core'),
|
| 18636 |
+
getEntityRecord = _select2.getEntityRecord;
|
|
|
|
|
|
|
| 18637 |
|
| 18638 |
+
var siteData = getEntityRecord('root', '__unstableBase', undefined) || {};
|
| 18639 |
+
return {
|
| 18640 |
+
isRequestingSiteIcon: isResolving('core', 'getEntityRecord', ['root', '__unstableBase', undefined]),
|
| 18641 |
+
siteIconUrl: siteData.siteIconUrl
|
| 18642 |
+
};
|
| 18643 |
+
}),
|
| 18644 |
+
isRequestingSiteIcon = _useSelect.isRequestingSiteIcon,
|
| 18645 |
+
siteIconUrl = _useSelect.siteIconUrl;
|
| 18646 |
+
|
| 18647 |
+
if (siteIconUrl) {
|
| 18648 |
+
buttonIcon = Object(external_this_wp_element_["createElement"])("img", {
|
| 18649 |
+
alt: Object(external_this_wp_i18n_["__"])('Site Icon'),
|
| 18650 |
+
src: siteIconUrl
|
| 18651 |
+
});
|
| 18652 |
+
} else if (isRequestingSiteIcon) {
|
| 18653 |
+
buttonIcon = null;
|
| 18654 |
}
|
| 18655 |
|
| 18656 |
+
var className = classnames_default()('woocommerce-navigation-header', {
|
| 18657 |
+
'is-scrolled': isScrolled
|
| 18658 |
});
|
| 18659 |
+
return Object(external_this_wp_element_["createElement"])("div", {
|
| 18660 |
+
className: className
|
| 18661 |
+
}, Object(external_this_wp_element_["createElement"])(build_module_button["a" /* default */], {
|
| 18662 |
+
onClick: function onClick() {
|
| 18663 |
+
return toggleFolded();
|
| 18664 |
+
},
|
| 18665 |
+
className: "woocommerce-navigation-header__site-icon"
|
| 18666 |
+
}, buttonIcon), Object(external_this_wp_element_["createElement"])(build_module_button["a" /* default */], {
|
| 18667 |
+
href: siteUrl,
|
| 18668 |
+
className: "woocommerce-navigation-header__site-title",
|
| 18669 |
+
as: "span"
|
| 18670 |
+
}, siteTitle));
|
| 18671 |
+
};
|
| 18672 |
|
| 18673 |
+
/* harmony default export */ var header = (header_Header);
|
| 18674 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
|
| 18675 |
+
var esm_extends = __webpack_require__(7);
|
| 18676 |
+
|
| 18677 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js
|
| 18678 |
+
var objectWithoutProperties = __webpack_require__(12);
|
| 18679 |
+
|
| 18680 |
+
// CONCATENATED MODULE: ./node_modules/@wordpress/components/node_modules/@wordpress/icons/build-module/library/chevron-right.js
|
| 18681 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18682 |
|
| 18683 |
+
/**
|
| 18684 |
+
* WordPress dependencies
|
| 18685 |
+
*/
|
|
|
|
|
|
|
| 18686 |
|
| 18687 |
+
var chevronRight = Object(external_this_wp_element_["createElement"])(svg["c" /* SVG */], {
|
| 18688 |
+
xmlns: "http://www.w3.org/2000/svg",
|
| 18689 |
+
viewBox: "0 0 24 24"
|
| 18690 |
+
}, Object(external_this_wp_element_["createElement"])(svg["b" /* Path */], {
|
| 18691 |
+
d: "M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"
|
| 18692 |
+
}));
|
| 18693 |
+
/* harmony default export */ var chevron_right = (chevronRight);
|
| 18694 |
+
//# sourceMappingURL=chevron-right.js.map
|
| 18695 |
+
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigation/item/use-navigation-tree-item.js
|
| 18696 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18697 |
|
| 18698 |
+
function use_navigation_tree_item_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18699 |
|
| 18700 |
+
function use_navigation_tree_item_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { use_navigation_tree_item_ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { use_navigation_tree_item_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18701 |
|
| 18702 |
+
/**
|
| 18703 |
+
* WordPress dependencies
|
| 18704 |
+
*/
|
| 18705 |
|
| 18706 |
+
/**
|
| 18707 |
+
* Internal dependencies
|
| 18708 |
+
*/
|
| 18709 |
|
|
|
|
| 18710 |
|
|
|
|
|
|
|
| 18711 |
|
| 18712 |
+
var use_navigation_tree_item_useNavigationTreeItem = function useNavigationTreeItem(props) {
|
| 18713 |
+
var _useNavigationContext = context_useNavigationContext(),
|
| 18714 |
+
_useNavigationContext2 = _useNavigationContext.navigationTree,
|
| 18715 |
+
addItem = _useNavigationContext2.addItem,
|
| 18716 |
+
removeItem = _useNavigationContext2.removeItem;
|
| 18717 |
|
| 18718 |
+
var _useNavigationMenuCon = context_useNavigationMenuContext(),
|
| 18719 |
+
menu = _useNavigationMenuCon.menu;
|
| 18720 |
+
|
| 18721 |
+
var key = props.item;
|
| 18722 |
+
Object(external_this_wp_element_["useEffect"])(function () {
|
| 18723 |
+
addItem(key, use_navigation_tree_item_objectSpread(use_navigation_tree_item_objectSpread({}, props), {}, {
|
| 18724 |
+
menu: menu
|
| 18725 |
+
}));
|
| 18726 |
+
return function () {
|
| 18727 |
+
removeItem(key);
|
| 18728 |
+
};
|
| 18729 |
+
}, []);
|
| 18730 |
+
};
|
| 18731 |
+
//# sourceMappingURL=use-navigation-tree-item.js.map
|
| 18732 |
+
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigation/item/index.js
|
| 18733 |
|
|
|
|
|
|
|
| 18734 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18735 |
|
| 18736 |
|
| 18737 |
/**
|
| 18739 |
*/
|
| 18740 |
|
| 18741 |
|
| 18742 |
+
/**
|
| 18743 |
+
* WordPress dependencies
|
| 18744 |
+
*/
|
| 18745 |
+
|
| 18746 |
|
| 18747 |
/**
|
| 18748 |
* Internal dependencies
|
| 18750 |
|
| 18751 |
|
| 18752 |
|
|
|
|
|
|
|
| 18753 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18754 |
|
|
|
|
|
|
|
|
|
|
| 18755 |
|
| 18756 |
+
function NavigationItem(props) {
|
| 18757 |
+
var badge = props.badge,
|
| 18758 |
+
children = props.children,
|
| 18759 |
+
className = props.className,
|
| 18760 |
+
href = props.href,
|
| 18761 |
+
item = props.item,
|
| 18762 |
+
navigateToMenu = props.navigateToMenu,
|
| 18763 |
+
_props$onClick = props.onClick,
|
| 18764 |
+
onClick = _props$onClick === void 0 ? external_lodash_["noop"] : _props$onClick,
|
| 18765 |
+
title = props.title,
|
| 18766 |
+
restProps = Object(objectWithoutProperties["a" /* default */])(props, ["badge", "children", "className", "href", "item", "navigateToMenu", "onClick", "title"]);
|
| 18767 |
|
| 18768 |
+
use_navigation_tree_item_useNavigationTreeItem(props);
|
|
|
|
|
|
|
| 18769 |
|
| 18770 |
+
var _useNavigationContext = context_useNavigationContext(),
|
| 18771 |
+
activeItem = _useNavigationContext.activeItem,
|
| 18772 |
+
setActiveMenu = _useNavigationContext.setActiveMenu;
|
| 18773 |
|
| 18774 |
+
var _useNavigationMenuCon = context_useNavigationMenuContext(),
|
| 18775 |
+
isActive = _useNavigationMenuCon.isActive; // If this item is in an inactive menu, then we skip rendering
|
| 18776 |
+
// We need to make sure this component gets mounted though
|
| 18777 |
+
// To make sure inactive items are included in the navigation tree
|
| 18778 |
|
| 18779 |
|
| 18780 |
+
if (!isActive) {
|
| 18781 |
+
return null;
|
| 18782 |
+
}
|
| 18783 |
|
| 18784 |
+
var classes = classnames_default()('components-navigation__item', className, {
|
| 18785 |
+
'is-active': item && activeItem === item
|
| 18786 |
+
});
|
| 18787 |
+
|
| 18788 |
+
var onItemClick = function onItemClick(event) {
|
| 18789 |
+
if (navigateToMenu) {
|
| 18790 |
+
setActiveMenu(navigateToMenu);
|
| 18791 |
+
}
|
| 18792 |
|
| 18793 |
+
onClick(event);
|
| 18794 |
+
};
|
| 18795 |
|
| 18796 |
+
return Object(external_this_wp_element_["createElement"])(ItemUI, {
|
| 18797 |
+
className: classes
|
| 18798 |
+
}, children || Object(external_this_wp_element_["createElement"])(build_module_button["a" /* default */], Object(esm_extends["a" /* default */])({
|
| 18799 |
+
href: href,
|
| 18800 |
+
onClick: onItemClick
|
| 18801 |
+
}, restProps), title && Object(external_this_wp_element_["createElement"])(ItemTitleUI, {
|
| 18802 |
+
className: "components-navigation__item-title",
|
| 18803 |
+
variant: "body.small",
|
| 18804 |
+
as: "span"
|
| 18805 |
+
}, title), badge && Object(external_this_wp_element_["createElement"])(ItemBadgeUI, {
|
| 18806 |
+
className: "components-navigation__item-badge"
|
| 18807 |
+
}, badge), navigateToMenu && Object(external_this_wp_element_["createElement"])(icon["a" /* default */], {
|
| 18808 |
+
icon: chevron_right
|
| 18809 |
+
})));
|
| 18810 |
}
|
| 18811 |
+
//# sourceMappingURL=index.js.map
|
| 18812 |
+
// CONCATENATED MODULE: ./client/navigation/components/Item/index.js
|
| 18813 |
|
|
|
|
| 18814 |
|
| 18815 |
+
/**
|
| 18816 |
+
* External dependencies
|
| 18817 |
+
*/
|
| 18818 |
|
|
|
|
| 18819 |
|
|
|
|
| 18820 |
|
| 18821 |
+
var Item_Item = function Item(_ref) {
|
| 18822 |
+
var item = _ref.item;
|
| 18823 |
+
var slot = Object(external_this_wc_navigation_["useNavSlot"])('woocommerce_navigation_' + item.id);
|
| 18824 |
+
var hasFills = Boolean(slot.fills && slot.fills.length); // Only render a slot if a coresponding Fill exists and the item is not a category
|
| 18825 |
|
| 18826 |
+
if (hasFills && !item.isCategory) {
|
| 18827 |
+
return Object(external_this_wp_element_["createElement"])(NavigationItem, {
|
| 18828 |
+
key: item.id,
|
| 18829 |
+
item: item.id
|
| 18830 |
+
}, Object(external_this_wp_element_["createElement"])(external_this_wc_navigation_["WooNavigationItem"].Slot, {
|
| 18831 |
+
name: item.id
|
| 18832 |
+
}));
|
| 18833 |
+
}
|
| 18834 |
|
| 18835 |
+
return Object(external_this_wp_element_["createElement"])(NavigationItem, {
|
| 18836 |
+
key: item.id,
|
| 18837 |
+
item: item.id,
|
| 18838 |
+
title: item.title,
|
| 18839 |
+
href: item.url,
|
| 18840 |
+
navigateToMenu: !item.url && item.id
|
| 18841 |
+
});
|
| 18842 |
+
};
|
| 18843 |
|
| 18844 |
+
/* harmony default export */ var components_Item = (Item_Item);
|
| 18845 |
+
// CONCATENATED MODULE: ./client/navigation/components/container/index.js
|
| 18846 |
|
|
|
|
| 18847 |
|
|
|
|
| 18848 |
|
| 18849 |
+
/**
|
| 18850 |
+
* External dependencies
|
| 18851 |
+
*/
|
| 18852 |
+
|
| 18853 |
+
|
| 18854 |
|
|
|
|
| 18855 |
|
|
|
|
| 18856 |
|
|
|
|
|
|
|
| 18857 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18858 |
|
| 18859 |
/**
|
| 18860 |
+
* Internal dependencies
|
| 18861 |
*/
|
| 18862 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18863 |
|
|
|
|
| 18864 |
|
|
|
|
|
|
|
| 18865 |
|
|
|
|
| 18866 |
|
| 18867 |
+
var container_Container = function Container(_ref) {
|
| 18868 |
+
var menuItems = _ref.menuItems;
|
| 18869 |
+
Object(external_this_wp_element_["useEffect"])(function () {
|
| 18870 |
+
// Collapse the original WP Menu.
|
| 18871 |
+
var adminMenu = document.getElementById('adminmenumain');
|
| 18872 |
+
adminMenu.classList.add('folded');
|
| 18873 |
+
}, []);
|
| 18874 |
+
var dashboardUrl = Object(settings["f" /* getAdminLink */])('');
|
| 18875 |
+
var categories = menuItems.filter(function (item) {
|
| 18876 |
+
return item.isCategory;
|
| 18877 |
+
});
|
| 18878 |
+
categories.push({
|
| 18879 |
+
capability: 'manage_woocommerce',
|
| 18880 |
+
id: 'woocommerce',
|
| 18881 |
+
isCategory: true,
|
| 18882 |
+
menuId: 'primary',
|
| 18883 |
+
migrate: true,
|
| 18884 |
+
order: 10,
|
| 18885 |
+
parent: '',
|
| 18886 |
+
title: 'WooCommerce'
|
| 18887 |
+
});
|
| 18888 |
|
| 18889 |
+
var _useState = Object(external_this_wp_element_["useState"])('woocommerce-home'),
|
| 18890 |
+
_useState2 = slicedToArray_default()(_useState, 2),
|
| 18891 |
+
activeItem = _useState2[0],
|
| 18892 |
+
setActiveItem = _useState2[1];
|
| 18893 |
|
| 18894 |
+
var _useState3 = Object(external_this_wp_element_["useState"])('woocommerce'),
|
| 18895 |
+
_useState4 = slicedToArray_default()(_useState3, 2),
|
| 18896 |
+
activeLevel = _useState4[0],
|
| 18897 |
+
setActiveLevel = _useState4[1];
|
| 18898 |
|
| 18899 |
+
Object(external_this_wp_element_["useEffect"])(function () {
|
| 18900 |
+
var initialMatchedItem = utils_getMatchingItem(menuItems);
|
| 18901 |
|
| 18902 |
+
if (initialMatchedItem) {
|
| 18903 |
+
setActiveItem(initialMatchedItem);
|
| 18904 |
+
setActiveLevel(initialMatchedItem.parent);
|
| 18905 |
+
}
|
| 18906 |
|
| 18907 |
+
var removeListener = addHistoryListener(function () {
|
| 18908 |
+
setTimeout(function () {
|
| 18909 |
+
var matchedItem = utils_getMatchingItem(menuItems);
|
| 18910 |
|
| 18911 |
+
if (matchedItem) {
|
| 18912 |
+
setActiveItem(matchedItem);
|
| 18913 |
+
}
|
| 18914 |
+
}, 0);
|
| 18915 |
+
});
|
| 18916 |
+
return removeListener;
|
| 18917 |
+
}, [menuItems]);
|
| 18918 |
|
| 18919 |
+
var getMenuItemsByCategory = function getMenuItemsByCategory(items) {
|
| 18920 |
+
return items.reduce(function (acc, item) {
|
| 18921 |
+
if (!acc[item.parent]) {
|
| 18922 |
+
acc[item.parent] = [[], [], []];
|
| 18923 |
+
}
|
| 18924 |
|
| 18925 |
+
var index = 0;
|
| 18926 |
|
| 18927 |
+
if (item.menuId === 'secondary') {
|
| 18928 |
+
index = 1;
|
| 18929 |
+
} else if (item.menuId === 'plugins') {
|
| 18930 |
+
index = 2;
|
| 18931 |
+
}
|
| 18932 |
|
| 18933 |
+
acc[item.parent][index].push(item);
|
| 18934 |
+
return acc;
|
| 18935 |
+
}, {});
|
| 18936 |
+
};
|
| 18937 |
|
| 18938 |
+
var categorizedItems = Object(external_this_wp_element_["useMemo"])(function () {
|
| 18939 |
+
return getMenuItemsByCategory(menuItems);
|
| 18940 |
+
}, [menuItems]);
|
| 18941 |
+
return Object(external_this_wp_element_["createElement"])("div", {
|
| 18942 |
+
className: "woocommerce-navigation"
|
| 18943 |
+
}, Object(external_this_wp_element_["createElement"])(header, null), Object(external_this_wp_element_["createElement"])(navigation_Navigation, {
|
| 18944 |
+
activeItem: activeItem ? activeItem.id : null,
|
| 18945 |
+
activeMenu: activeLevel,
|
| 18946 |
+
onActivateMenu: function onActivateMenu() {
|
| 18947 |
+
var navDomRef = document.querySelector('.components-navigation');
|
| 18948 |
|
| 18949 |
+
if (navDomRef) {
|
| 18950 |
+
navDomRef.scrollTop = 0;
|
| 18951 |
+
}
|
| 18952 |
+
|
| 18953 |
+
setActiveLevel.apply(void 0, arguments);
|
| 18954 |
+
}
|
| 18955 |
+
}, activeLevel === 'woocommerce' && dashboardUrl && Object(external_this_wp_element_["createElement"])(NavigationBackButton, {
|
| 18956 |
+
className: "woocommerce-navigation__back-to-dashboard",
|
| 18957 |
+
href: dashboardUrl,
|
| 18958 |
+
backButtonLabel: Object(external_this_wp_i18n_["__"])('WordPress Dashboard', 'woocommerce-navigation')
|
| 18959 |
+
}), categories.map(function (category) {
|
| 18960 |
+
var _ref2 = categorizedItems[category.id] || [[], [], []],
|
| 18961 |
+
_ref3 = slicedToArray_default()(_ref2, 3),
|
| 18962 |
+
primaryItems = _ref3[0],
|
| 18963 |
+
secondaryItems = _ref3[1],
|
| 18964 |
+
pluginItems = _ref3[2];
|
| 18965 |
+
|
| 18966 |
+
return Object(external_this_wp_element_["createElement"])(NavigationMenu, {
|
| 18967 |
+
key: category.id,
|
| 18968 |
+
title: category.title,
|
| 18969 |
+
menu: category.id,
|
| 18970 |
+
parentMenu: category.parent,
|
| 18971 |
+
backButtonLabel: category.backButtonLabel || null
|
| 18972 |
+
}, !!primaryItems.length && Object(external_this_wp_element_["createElement"])(NavigationGroup, null, primaryItems.map(function (item) {
|
| 18973 |
+
return Object(external_this_wp_element_["createElement"])(components_Item, {
|
| 18974 |
+
key: item.id,
|
| 18975 |
+
item: item
|
| 18976 |
+
});
|
| 18977 |
+
})), !!pluginItems.length && Object(external_this_wp_element_["createElement"])(NavigationGroup, {
|
| 18978 |
+
title: category.id === 'woocommerce' ? Object(external_this_wp_i18n_["__"])('Extensions', 'woocommerce-admin') : null
|
| 18979 |
+
}, pluginItems.map(function (item) {
|
| 18980 |
+
return Object(external_this_wp_element_["createElement"])(components_Item, {
|
| 18981 |
+
key: item.id,
|
| 18982 |
+
item: item
|
| 18983 |
+
});
|
| 18984 |
+
})), !!secondaryItems.length && Object(external_this_wp_element_["createElement"])(NavigationGroup, null, secondaryItems.map(function (item) {
|
| 18985 |
+
return Object(external_this_wp_element_["createElement"])(components_Item, {
|
| 18986 |
+
key: item.id,
|
| 18987 |
+
item: item
|
| 18988 |
+
});
|
| 18989 |
+
})));
|
| 18990 |
+
})));
|
| 18991 |
+
};
|
| 18992 |
+
|
| 18993 |
+
/* harmony default export */ var container = (Object(compose["a" /* default */])(Object(external_this_wp_data_["withSelect"])(function (select) {
|
| 18994 |
+
var _select = select(external_this_wc_data_["NAVIGATION_STORE_NAME"]),
|
| 18995 |
+
getActiveItem = _select.getActiveItem,
|
| 18996 |
+
getMenuItems = _select.getMenuItems;
|
| 18997 |
+
|
| 18998 |
+
return {
|
| 18999 |
+
activeItem: getActiveItem(),
|
| 19000 |
+
menuItems: getMenuItems()
|
| 19001 |
+
};
|
| 19002 |
+
}))(container_Container));
|
| 19003 |
+
// CONCATENATED MODULE: ./client/navigation/index.js
|
| 19004 |
|
|
|
|
|
|
|
| 19005 |
|
| 19006 |
+
/**
|
| 19007 |
+
* External dependencies
|
| 19008 |
+
*/
|
| 19009 |
|
|
|
|
| 19010 |
|
|
|
|
|
|
|
| 19011 |
|
| 19012 |
+
/**
|
| 19013 |
+
* Internal dependencies
|
| 19014 |
+
*/
|
| 19015 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19016 |
|
|
|
|
| 19017 |
|
|
|
|
| 19018 |
|
| 19019 |
+
var client_navigation_Navigation = function Navigation() {
|
| 19020 |
+
return Object(external_this_wp_element_["createElement"])(external_this_wc_navigation_["NavSlotFillProvider"], null, Object(external_this_wp_element_["createElement"])(container, null), Object(external_this_wp_element_["createElement"])(external_this_wp_plugins_["PluginArea"], null));
|
| 19021 |
+
};
|
| 19022 |
|
| 19023 |
+
var HydratedNavigation = Object(external_this_wc_data_["withNavigationHydration"])(window.wcNavigation)(client_navigation_Navigation);
|
| 19024 |
+
/* harmony default export */ var navigation = __webpack_exports__["a"] = (HydratedNavigation);
|
| 19025 |
|
| 19026 |
/***/ }),
|
| 19027 |
|
| 19028 |
+
/***/ 544:
|
| 19029 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
| 19030 |
|
| 19031 |
+
"use strict";
|
|
|
|
|
|
|
| 19032 |
|
| 19033 |
+
// EXPORTS
|
| 19034 |
+
__webpack_require__.d(__webpack_exports__, "a", function() { return /* reexport */ customer_effort_score_tracks_container; });
|
| 19035 |
|
| 19036 |
+
// UNUSED EXPORTS: CustomerEffortScoreTracks
|
| 19037 |
|
| 19038 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/defineProperty.js
|
| 19039 |
+
var defineProperty = __webpack_require__(5);
|
| 19040 |
+
var defineProperty_default = /*#__PURE__*/__webpack_require__.n(defineProperty);
|
| 19041 |
|
| 19042 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/toConsumableArray.js
|
| 19043 |
+
var toConsumableArray = __webpack_require__(30);
|
| 19044 |
+
var toConsumableArray_default = /*#__PURE__*/__webpack_require__.n(toConsumableArray);
|
| 19045 |
|
| 19046 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/slicedToArray.js
|
| 19047 |
+
var slicedToArray = __webpack_require__(34);
|
| 19048 |
+
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19049 |
|
| 19050 |
+
// EXTERNAL MODULE: external {"this":["wp","element"]}
|
| 19051 |
+
var external_this_wp_element_ = __webpack_require__(0);
|
| 19052 |
|
| 19053 |
+
// EXTERNAL MODULE: ./node_modules/prop-types/index.js
|
| 19054 |
+
var prop_types = __webpack_require__(1);
|
| 19055 |
+
var prop_types_default = /*#__PURE__*/__webpack_require__.n(prop_types);
|
| 19056 |
|
| 19057 |
+
// EXTERNAL MODULE: external {"this":["wc","tracks"]}
|
| 19058 |
+
var external_this_wc_tracks_ = __webpack_require__(64);
|
| 19059 |
|
| 19060 |
+
// EXTERNAL MODULE: external {"this":["wc","customerEffortScore"]}
|
| 19061 |
+
var external_this_wc_customerEffortScore_ = __webpack_require__(538);
|
| 19062 |
+
var external_this_wc_customerEffortScore_default = /*#__PURE__*/__webpack_require__.n(external_this_wc_customerEffortScore_);
|
| 19063 |
|
| 19064 |
+
// EXTERNAL MODULE: ./node_modules/@wordpress/compose/build-module/higher-order/compose.js
|
| 19065 |
+
var compose = __webpack_require__(277);
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19066 |
|
| 19067 |
+
// EXTERNAL MODULE: external {"this":["wp","data"]}
|
| 19068 |
+
var external_this_wp_data_ = __webpack_require__(20);
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19069 |
|
| 19070 |
+
// EXTERNAL MODULE: external {"this":["wc","data"]}
|
| 19071 |
+
var external_this_wc_data_ = __webpack_require__(35);
|
| 19072 |
|
| 19073 |
+
// CONCATENATED MODULE: ./client/customer-effort-score-tracks/customer-effort-score-tracks.js
|
|
|
|
| 19074 |
|
|
|
|
| 19075 |
|
|
|
|
|
|
|
| 19076 |
|
|
|
|
| 19077 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19078 |
|
| 19079 |
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
|
|
| 19080 |
|
| 19081 |
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { defineProperty_default()(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19082 |
|
| 19083 |
+
/**
|
| 19084 |
+
* External dependencies
|
| 19085 |
+
*/
|
| 19086 |
|
|
|
|
| 19087 |
|
|
|
|
| 19088 |
|
|
|
|
|
|
|
| 19089 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19090 |
|
|
|
|
|
|
|
| 19091 |
|
|
|
|
| 19092 |
|
| 19093 |
+
var SHOWN_FOR_ACTIONS_OPTION_NAME = 'woocommerce_ces_shown_for_actions';
|
| 19094 |
+
var ADMIN_INSTALL_TIMESTAMP_OPTION_NAME = 'woocommerce_admin_install_timestamp';
|
| 19095 |
+
var ALLOW_TRACKING_OPTION_NAME = 'woocommerce_allow_tracking';
|
| 19096 |
+
/**
|
| 19097 |
+
* A CustomerEffortScore wrapper that uses tracks to track the selected
|
| 19098 |
+
* customer effort score.
|
| 19099 |
+
*
|
| 19100 |
+
* @param {Object} props Component props.
|
| 19101 |
+
* @param {string} props.action The action name sent to Tracks.
|
| 19102 |
+
* @param {Object} props.trackProps Additional props sent to Tracks.
|
| 19103 |
+
* @param {string} props.label The label displayed in the modal.
|
| 19104 |
+
* @param {Array} props.cesShownForActions The array of actions that the CES modal has been shown for.
|
| 19105 |
+
* @param {boolean} props.allowTracking Whether tracking is allowed or not.
|
| 19106 |
+
* @param {boolean} props.resolving Are values still being resolved.
|
| 19107 |
+
* @param {number} props.storeAge The age of the store in months.
|
| 19108 |
+
* @param {Function} props.updateOptions Function to update options.
|
| 19109 |
+
*/
|
| 19110 |
|
| 19111 |
+
function CustomerEffortScoreTracks(_ref) {
|
| 19112 |
+
var action = _ref.action,
|
| 19113 |
+
trackProps = _ref.trackProps,
|
| 19114 |
+
label = _ref.label,
|
| 19115 |
+
cesShownForActions = _ref.cesShownForActions,
|
| 19116 |
+
allowTracking = _ref.allowTracking,
|
| 19117 |
+
resolving = _ref.resolving,
|
| 19118 |
+
storeAge = _ref.storeAge,
|
| 19119 |
+
updateOptions = _ref.updateOptions;
|
| 19120 |
|
| 19121 |
+
var _useState = Object(external_this_wp_element_["useState"])(false),
|
| 19122 |
+
_useState2 = slicedToArray_default()(_useState, 2),
|
| 19123 |
+
shown = _useState2[0],
|
| 19124 |
+
setShown = _useState2[1];
|
| 19125 |
|
| 19126 |
+
if (resolving) {
|
| 19127 |
+
return null;
|
| 19128 |
+
} // Don't show if tracking is disallowed.
|
| 19129 |
|
|
|
|
| 19130 |
|
| 19131 |
+
if (!allowTracking) {
|
| 19132 |
+
return null;
|
| 19133 |
+
}
|
| 19134 |
|
| 19135 |
+
if (cesShownForActions.indexOf(action) !== -1 && !shown) {
|
| 19136 |
+
return null;
|
| 19137 |
+
}
|
| 19138 |
|
| 19139 |
+
var openedCallback = function openedCallback() {
|
| 19140 |
+
// Use the `shown` state value to only update the shown_for_actions
|
| 19141 |
+
// option once.
|
| 19142 |
+
if (shown) {
|
| 19143 |
+
return;
|
| 19144 |
+
}
|
| 19145 |
|
| 19146 |
+
setShown(true);
|
| 19147 |
+
updateOptions(defineProperty_default()({}, SHOWN_FOR_ACTIONS_OPTION_NAME, [action].concat(toConsumableArray_default()(cesShownForActions))));
|
| 19148 |
+
};
|
| 19149 |
|
| 19150 |
+
var trackCallback = function trackCallback(score) {
|
| 19151 |
+
Object(external_this_wc_tracks_["recordEvent"])('ces_feedback', _objectSpread({
|
| 19152 |
+
action: action,
|
| 19153 |
+
score: score,
|
| 19154 |
+
store_age: storeAge
|
| 19155 |
+
}, trackProps));
|
| 19156 |
};
|
| 19157 |
|
| 19158 |
+
return Object(external_this_wp_element_["createElement"])(external_this_wc_customerEffortScore_default.a, {
|
| 19159 |
+
trackCallback: trackCallback,
|
| 19160 |
+
label: label,
|
| 19161 |
+
openedCallback: openedCallback
|
| 19162 |
+
});
|
| 19163 |
}
|
|
|
|
| 19164 |
|
| 19165 |
+
CustomerEffortScoreTracks.propTypes = {
|
| 19166 |
+
/**
|
| 19167 |
+
* The action name sent to Tracks.
|
| 19168 |
+
*/
|
| 19169 |
+
action: prop_types_default.a.string.isRequired,
|
| 19170 |
|
| 19171 |
+
/**
|
| 19172 |
+
* Additional props sent to Tracks.
|
| 19173 |
+
*/
|
| 19174 |
+
trackProps: prop_types_default.a.object,
|
| 19175 |
|
| 19176 |
+
/**
|
| 19177 |
+
* The label displayed in the modal.
|
| 19178 |
+
*/
|
| 19179 |
+
label: prop_types_default.a.string.isRequired,
|
| 19180 |
|
| 19181 |
+
/**
|
| 19182 |
+
* The array of actions that the CES modal has been shown for.
|
| 19183 |
+
*/
|
| 19184 |
+
cesShownForActions: prop_types_default.a.arrayOf(prop_types_default.a.string).isRequired,
|
| 19185 |
|
| 19186 |
+
/**
|
| 19187 |
+
* Whether tracking is allowed or not.
|
| 19188 |
+
*/
|
| 19189 |
+
allowTracking: prop_types_default.a.bool,
|
| 19190 |
|
| 19191 |
+
/**
|
| 19192 |
+
* Whether props are still being resolved.
|
| 19193 |
+
*/
|
| 19194 |
+
resolving: prop_types_default.a.bool.isRequired,
|
| 19195 |
|
| 19196 |
+
/**
|
| 19197 |
+
* The age of the store in months.
|
| 19198 |
+
*/
|
| 19199 |
+
storeAge: prop_types_default.a.number,
|
| 19200 |
|
| 19201 |
+
/**
|
| 19202 |
+
* Function to update options.
|
| 19203 |
+
*/
|
| 19204 |
+
updateOptions: prop_types_default.a.func
|
| 19205 |
+
};
|
| 19206 |
+
/* harmony default export */ var customer_effort_score_tracks = (Object(compose["a" /* default */])(Object(external_this_wp_data_["withSelect"])(function (select) {
|
| 19207 |
+
var _select = select(external_this_wc_data_["OPTIONS_STORE_NAME"]),
|
| 19208 |
+
getOption = _select.getOption,
|
| 19209 |
+
isResolving = _select.isResolving;
|
| 19210 |
|
| 19211 |
+
var cesShownForActions = getOption(SHOWN_FOR_ACTIONS_OPTION_NAME) || [];
|
| 19212 |
+
var adminInstallTimestamp = getOption(ADMIN_INSTALL_TIMESTAMP_OPTION_NAME) || 0; // Date.now() is ms since Unix epoch, adminInstallTimestamp is in
|
| 19213 |
+
// seconds since Unix epoch.
|
| 19214 |
|
| 19215 |
+
var storeAgeInMs = Date.now() - adminInstallTimestamp * 1000;
|
| 19216 |
+
var storeAge = Math.round(storeAgeInMs / external_this_wc_data_["MONTH"]);
|
| 19217 |
+
var allowTrackingOption = getOption(ALLOW_TRACKING_OPTION_NAME) || 'no';
|
| 19218 |
+
var allowTracking = allowTrackingOption === 'yes';
|
| 19219 |
+
var resolving = isResolving('getOption', [SHOWN_FOR_ACTIONS_OPTION_NAME]) || isResolving('getOption', [ADMIN_INSTALL_TIMESTAMP_OPTION_NAME]) || isResolving('getOption', [ALLOW_TRACKING_OPTION_NAME]);
|
| 19220 |
+
return {
|
| 19221 |
+
cesShownForActions: cesShownForActions,
|
| 19222 |
+
allowTracking: allowTracking,
|
| 19223 |
+
storeAge: storeAge,
|
| 19224 |
+
resolving: resolving
|
| 19225 |
+
};
|
| 19226 |
+
}), Object(external_this_wp_data_["withDispatch"])(function (dispatch) {
|
| 19227 |
+
var _dispatch = dispatch(external_this_wc_data_["OPTIONS_STORE_NAME"]),
|
| 19228 |
+
updateOptions = _dispatch.updateOptions;
|
| 19229 |
|
| 19230 |
+
return {
|
| 19231 |
+
updateOptions: updateOptions
|
| 19232 |
+
};
|
| 19233 |
+
}))(CustomerEffortScoreTracks));
|
| 19234 |
+
// CONCATENATED MODULE: ./client/customer-effort-score-tracks/customer-effort-score-tracks-container.js
|
| 19235 |
|
|
|
|
| 19236 |
|
| 19237 |
+
/**
|
| 19238 |
+
* External dependencies
|
| 19239 |
+
*/
|
| 19240 |
|
|
|
|
|
|
|
| 19241 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19242 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19243 |
|
| 19244 |
+
/**
|
| 19245 |
+
* Internal dependencies
|
| 19246 |
+
*/
|
| 19247 |
|
|
|
|
| 19248 |
|
| 19249 |
+
/**
|
| 19250 |
+
* Maps the queue of CES tracks surveys to CustomerEffortScoreTracks
|
| 19251 |
+
* components. Note that generally there will only be a single survey per page
|
| 19252 |
+
* however this is designed to be flexible if multiple surveys per page are
|
| 19253 |
+
* added in the future.
|
| 19254 |
+
*
|
| 19255 |
+
* @param {Object} props Component props.
|
| 19256 |
+
* @param {Array} props.queue The queue of surveys.
|
| 19257 |
+
* @param {boolean} props.resolving Whether the queue is resolving.
|
| 19258 |
+
* @param {Function} props.clearQueue Sets up clearing of the queue on the next page load.
|
| 19259 |
+
*/
|
| 19260 |
|
| 19261 |
+
function CustomerEffortScoreTracksContainer(_ref) {
|
| 19262 |
+
var queue = _ref.queue,
|
| 19263 |
+
resolving = _ref.resolving,
|
| 19264 |
+
clearQueue = _ref.clearQueue;
|
| 19265 |
|
| 19266 |
+
if (resolving) {
|
| 19267 |
+
return null;
|
| 19268 |
+
}
|
| 19269 |
|
| 19270 |
+
var queueForPage = queue.filter(function (item) {
|
| 19271 |
+
return item.pagenow === window.pagenow && item.adminpage === window.adminpage;
|
| 19272 |
+
});
|
| 19273 |
|
| 19274 |
+
if (queueForPage.length) {
|
| 19275 |
+
clearQueue();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19276 |
}
|
| 19277 |
|
| 19278 |
+
return Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, queueForPage.map(function (item, index) {
|
| 19279 |
+
return Object(external_this_wp_element_["createElement"])(customer_effort_score_tracks, {
|
| 19280 |
+
key: index,
|
| 19281 |
+
action: item.action,
|
| 19282 |
+
label: item.label,
|
| 19283 |
+
trackProps: item.props || {}
|
| 19284 |
+
});
|
| 19285 |
+
}));
|
| 19286 |
}
|
| 19287 |
|
| 19288 |
+
CustomerEffortScoreTracksContainer.propTypes = {
|
| 19289 |
+
/**
|
| 19290 |
+
* The queue of CES tracks surveys to display.
|
| 19291 |
+
*/
|
| 19292 |
+
queue: prop_types_default.a.arrayOf(prop_types_default.a.object),
|
|
|
|
| 19293 |
|
| 19294 |
+
/**
|
| 19295 |
+
* If the queue option is being resolved.
|
| 19296 |
+
*/
|
| 19297 |
+
resolving: prop_types_default.a.bool,
|
| 19298 |
|
| 19299 |
+
/**
|
| 19300 |
+
* Set up clearing the queue on the next page load.
|
| 19301 |
+
*/
|
| 19302 |
+
clearQueue: prop_types_default.a.func
|
| 19303 |
+
};
|
| 19304 |
+
/* harmony default export */ var customer_effort_score_tracks_container = (Object(compose["a" /* default */])(Object(external_this_wp_data_["withSelect"])(function (select) {
|
| 19305 |
+
var _select = select(external_this_wc_data_["OPTIONS_STORE_NAME"]),
|
| 19306 |
+
getOption = _select.getOption,
|
| 19307 |
+
isResolving = _select.isResolving;
|
| 19308 |
|
| 19309 |
+
var queue = getOption('woocommerce_ces_tracks_queue') || [];
|
| 19310 |
+
var resolving = isResolving('getOption', ['woocommerce_ces_tracks_queue']);
|
| 19311 |
+
return {
|
| 19312 |
+
queue: queue,
|
| 19313 |
+
resolving: resolving
|
| 19314 |
};
|
| 19315 |
+
}), Object(external_this_wp_data_["withDispatch"])(function (dispatch) {
|
| 19316 |
+
var _dispatch = dispatch(external_this_wc_data_["OPTIONS_STORE_NAME"]),
|
| 19317 |
+
updateOptions = _dispatch.updateOptions;
|
| 19318 |
+
|
| 19319 |
+
return {
|
| 19320 |
+
clearQueue: function clearQueue() {
|
| 19321 |
+
// This sets an option that should be used on the next page
|
| 19322 |
+
// load to clear the CES tracks queue for the current page (see
|
| 19323 |
+
// CustomerEffortScoreTracks.php) - clearing the queue
|
| 19324 |
+
// directly puts this into an infinite loop which is picked
|
| 19325 |
+
// up by React.
|
| 19326 |
+
updateOptions({
|
| 19327 |
+
woocommerce_clear_ces_tracks_queue_for_page: {
|
| 19328 |
+
pagenow: window.pagenow,
|
| 19329 |
+
adminpage: window.adminpage
|
| 19330 |
+
}
|
| 19331 |
+
});
|
| 19332 |
+
}
|
| 19333 |
+
};
|
| 19334 |
+
}))(CustomerEffortScoreTracksContainer));
|
| 19335 |
+
// CONCATENATED MODULE: ./client/customer-effort-score-tracks/index.js
|
| 19336 |
+
|
| 19337 |
|
|
|
|
| 19338 |
|
| 19339 |
/***/ }),
|
| 19340 |
|
| 19341 |
+
/***/ 55:
|
| 19342 |
/***/ (function(module, exports) {
|
| 19343 |
|
| 19344 |
+
(function() { module.exports = this["wp"]["hooks"]; }());
|
| 19345 |
|
| 19346 |
/***/ }),
|
| 19347 |
|
| 19348 |
+
/***/ 56:
|
| 19349 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
| 19350 |
|
| 19351 |
"use strict";
|
| 19352 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _inheritsLoose; });
|
| 19353 |
+
function _inheritsLoose(subClass, superClass) {
|
| 19354 |
+
subClass.prototype = Object.create(superClass.prototype);
|
| 19355 |
+
subClass.prototype.constructor = subClass;
|
| 19356 |
+
subClass.__proto__ = superClass;
|
| 19357 |
+
}
|
| 19358 |
|
| 19359 |
+
/***/ }),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19360 |
|
| 19361 |
+
/***/ 561:
|
| 19362 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
| 19363 |
|
| 19364 |
+
"use strict";
|
| 19365 |
+
__webpack_require__.r(__webpack_exports__);
|
| 19366 |
+
/* WEBPACK VAR INJECTION */(function(global) {/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
|
| 19367 |
+
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
|
| 19368 |
+
/* harmony import */ var _wordpress_notices__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(732);
|
| 19369 |
+
/* harmony import */ var _woocommerce_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(35);
|
| 19370 |
+
/* harmony import */ var _woocommerce_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_woocommerce_data__WEBPACK_IMPORTED_MODULE_2__);
|
| 19371 |
+
/* harmony import */ var _stylesheets_index_scss__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(565);
|
| 19372 |
+
/* harmony import */ var _stylesheets_index_scss__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_stylesheets_index_scss__WEBPACK_IMPORTED_MODULE_3__);
|
| 19373 |
+
/* harmony import */ var _layout__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(297);
|
| 19374 |
+
/* harmony import */ var _customer_effort_score_tracks__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(544);
|
| 19375 |
+
/* harmony import */ var _navigation__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(543);
|
| 19376 |
|
|
|
|
|
|
|
| 19377 |
|
| 19378 |
+
/**
|
| 19379 |
+
* External dependencies
|
| 19380 |
+
*/
|
| 19381 |
|
|
|
|
|
|
|
| 19382 |
|
|
|
|
| 19383 |
|
| 19384 |
+
/**
|
| 19385 |
+
* Internal dependencies
|
| 19386 |
+
*/
|
| 19387 |
|
|
|
|
| 19388 |
|
|
|
|
| 19389 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19390 |
|
| 19391 |
+
// Modify webpack pubilcPath at runtime based on location of WordPress Plugin.
|
| 19392 |
+
// eslint-disable-next-line no-undef,camelcase
|
|
|
|
|
|
|
| 19393 |
|
| 19394 |
+
__webpack_require__.p = global.wcAdminAssets.path;
|
| 19395 |
+
var appRoot = document.getElementById('root');
|
| 19396 |
+
var embeddedRoot = document.getElementById('woocommerce-embedded-root');
|
| 19397 |
+
var settingsGroup = 'wc_admin';
|
| 19398 |
+
var hydrateUser = window.wcSettings.currentUserData;
|
| 19399 |
|
| 19400 |
+
if (appRoot) {
|
| 19401 |
+
var HydratedPageLayout = Object(_woocommerce_data__WEBPACK_IMPORTED_MODULE_2__["withSettingsHydration"])(settingsGroup, window.wcSettings)(_layout__WEBPACK_IMPORTED_MODULE_4__[/* PageLayout */ "b"]);
|
| 19402 |
+
var hydrateSettings = window.wcSettings.preloadSettings && window.wcSettings.preloadSettings.general;
|
| 19403 |
|
| 19404 |
+
if (hydrateSettings) {
|
| 19405 |
+
HydratedPageLayout = Object(_woocommerce_data__WEBPACK_IMPORTED_MODULE_2__["withSettingsHydration"])('general', {
|
| 19406 |
+
general: window.wcSettings.preloadSettings.general
|
| 19407 |
+
})(HydratedPageLayout);
|
| 19408 |
+
}
|
| 19409 |
|
| 19410 |
+
if (hydrateUser) {
|
| 19411 |
+
HydratedPageLayout = Object(_woocommerce_data__WEBPACK_IMPORTED_MODULE_2__["withCurrentUserHydration"])(hydrateUser)(HydratedPageLayout);
|
| 19412 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19413 |
|
| 19414 |
+
Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["render"])(Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(HydratedPageLayout, null), appRoot);
|
| 19415 |
+
} else if (embeddedRoot) {
|
| 19416 |
+
var HydratedEmbedLayout = Object(_woocommerce_data__WEBPACK_IMPORTED_MODULE_2__["withSettingsHydration"])(settingsGroup, window.wcSettings)(_layout__WEBPACK_IMPORTED_MODULE_4__[/* EmbedLayout */ "a"]);
|
| 19417 |
|
| 19418 |
+
if (hydrateUser) {
|
| 19419 |
+
HydratedEmbedLayout = Object(_woocommerce_data__WEBPACK_IMPORTED_MODULE_2__["withCurrentUserHydration"])(hydrateUser)(HydratedEmbedLayout);
|
| 19420 |
+
} // Render the header.
|
| 19421 |
|
| 19422 |
+
|
| 19423 |
+
Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["render"])(Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(HydratedEmbedLayout, null), embeddedRoot);
|
| 19424 |
+
embeddedRoot.classList.remove('is-embed-loading'); // Render notices just above the WP content div.
|
| 19425 |
+
|
| 19426 |
+
var wpBody = document.getElementById('wpbody-content');
|
| 19427 |
+
var wrap = wpBody.querySelector('.wrap.woocommerce') || wpBody.querySelector('[class="wrap"]');
|
| 19428 |
+
var noticeContainer = document.createElement('div');
|
| 19429 |
+
Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["render"])(Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", {
|
| 19430 |
+
className: "woocommerce-layout"
|
| 19431 |
+
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_layout__WEBPACK_IMPORTED_MODULE_4__[/* PrimaryLayout */ "c"], null)), wpBody.insertBefore(noticeContainer, wrap));
|
| 19432 |
+
}
|
| 19433 |
+
|
| 19434 |
+
var navigationRoot = document.getElementById('woocommerce-embedded-navigation');
|
| 19435 |
+
|
| 19436 |
+
if (navigationRoot) {
|
| 19437 |
+
Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["render"])(Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_navigation__WEBPACK_IMPORTED_MODULE_6__[/* default */ "a"], null), navigationRoot);
|
| 19438 |
+
} // Set up customer effort score survey.
|
| 19439 |
|
| 19440 |
|
| 19441 |
+
(function () {
|
| 19442 |
+
var root = appRoot || embeddedRoot;
|
| 19443 |
+
Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["render"])(Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_customer_effort_score_tracks__WEBPACK_IMPORTED_MODULE_5__[/* CustomerEffortScoreTracksContainer */ "a"], null), root.insertBefore(document.createElement('div'), null));
|
| 19444 |
+
})();
|
| 19445 |
+
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(46)))
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19446 |
|
| 19447 |
+
/***/ }),
|
|
|
|
|
|
|
| 19448 |
|
| 19449 |
+
/***/ 565:
|
| 19450 |
+
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19451 |
|
| 19452 |
+
// extracted by mini-css-extract-plugin
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19453 |
|
| 19454 |
+
/***/ }),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19455 |
|
| 19456 |
+
/***/ 566:
|
| 19457 |
+
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19458 |
|
| 19459 |
+
// extracted by mini-css-extract-plugin
|
|
|
|
|
|
|
| 19460 |
|
| 19461 |
+
/***/ }),
|
| 19462 |
|
| 19463 |
+
/***/ 567:
|
| 19464 |
+
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
| 19465 |
|
| 19466 |
+
// extracted by mini-css-extract-plugin
|
|
|
|
|
|
|
| 19467 |
|
| 19468 |
+
/***/ }),
|
|
|
|
|
|
|
| 19469 |
|
| 19470 |
+
/***/ 568:
|
| 19471 |
+
/***/ (function(module, exports, __webpack_require__) {
|
| 19472 |
+
|
| 19473 |
+
"use strict";
|
| 19474 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19475 |
|
| 19476 |
/**
|
| 19477 |
+
* Copyright 2015, Yahoo! Inc.
|
| 19478 |
+
* Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19479 |
*/
|
| 19480 |
+
var REACT_STATICS = {
|
| 19481 |
+
childContextTypes: true,
|
| 19482 |
+
contextTypes: true,
|
| 19483 |
+
defaultProps: true,
|
| 19484 |
+
displayName: true,
|
| 19485 |
+
getDefaultProps: true,
|
| 19486 |
+
getDerivedStateFromProps: true,
|
| 19487 |
+
mixins: true,
|
| 19488 |
+
propTypes: true,
|
| 19489 |
+
type: true
|
| 19490 |
+
};
|
| 19491 |
|
| 19492 |
+
var KNOWN_STATICS = {
|
| 19493 |
+
name: true,
|
| 19494 |
+
length: true,
|
| 19495 |
+
prototype: true,
|
| 19496 |
+
caller: true,
|
| 19497 |
+
callee: true,
|
| 19498 |
+
arguments: true,
|
| 19499 |
+
arity: true
|
| 19500 |
+
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19501 |
|
| 19502 |
+
var defineProperty = Object.defineProperty;
|
| 19503 |
+
var getOwnPropertyNames = Object.getOwnPropertyNames;
|
| 19504 |
+
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
| 19505 |
+
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
| 19506 |
+
var getPrototypeOf = Object.getPrototypeOf;
|
| 19507 |
+
var objectPrototype = getPrototypeOf && getPrototypeOf(Object);
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19508 |
|
| 19509 |
+
function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {
|
| 19510 |
+
if (typeof sourceComponent !== 'string') { // don't hoist over string (html) components
|
| 19511 |
|
| 19512 |
+
if (objectPrototype) {
|
| 19513 |
+
var inheritedComponent = getPrototypeOf(sourceComponent);
|
| 19514 |
+
if (inheritedComponent && inheritedComponent !== objectPrototype) {
|
| 19515 |
+
hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);
|
| 19516 |
+
}
|
| 19517 |
+
}
|
| 19518 |
|
| 19519 |
+
var keys = getOwnPropertyNames(sourceComponent);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19520 |
|
| 19521 |
+
if (getOwnPropertySymbols) {
|
| 19522 |
+
keys = keys.concat(getOwnPropertySymbols(sourceComponent));
|
| 19523 |
+
}
|
| 19524 |
+
|
| 19525 |
+
for (var i = 0; i < keys.length; ++i) {
|
| 19526 |
+
var key = keys[i];
|
| 19527 |
+
if (!REACT_STATICS[key] && !KNOWN_STATICS[key] && (!blacklist || !blacklist[key])) {
|
| 19528 |
+
var descriptor = getOwnPropertyDescriptor(sourceComponent, key);
|
| 19529 |
+
try { // Avoid failures from read-only properties
|
| 19530 |
+
defineProperty(targetComponent, key, descriptor);
|
| 19531 |
+
} catch (e) {}
|
|
|
|
|
|
|
| 19532 |
}
|
| 19533 |
+
}
|
| 19534 |
|
| 19535 |
+
return targetComponent;
|
|
|
|
|
|
|
|
|
|
| 19536 |
}
|
| 19537 |
+
|
| 19538 |
+
return targetComponent;
|
| 19539 |
}
|
| 19540 |
+
|
| 19541 |
+
module.exports = hoistNonReactStatics;
|
| 19542 |
+
|
| 19543 |
+
|
| 19544 |
+
/***/ }),
|
| 19545 |
+
|
| 19546 |
+
/***/ 569:
|
| 19547 |
+
/***/ (function(module, exports, __webpack_require__) {
|
| 19548 |
+
|
| 19549 |
+
// extracted by mini-css-extract-plugin
|
| 19550 |
+
|
| 19551 |
+
/***/ }),
|
| 19552 |
+
|
| 19553 |
+
/***/ 57:
|
| 19554 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
| 19555 |
+
|
| 19556 |
+
"use strict";
|
| 19557 |
+
/* unused harmony export logged */
|
| 19558 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return deprecated; });
|
| 19559 |
+
/* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(55);
|
| 19560 |
+
/* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_0__);
|
| 19561 |
/**
|
| 19562 |
+
* WordPress dependencies
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19563 |
*/
|
| 19564 |
|
|
|
|
|
|
|
|
|
|
| 19565 |
/**
|
| 19566 |
+
* Object map tracking messages which have been logged, for use in ensuring a
|
| 19567 |
+
* message is only logged once.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19568 |
*
|
| 19569 |
+
* @type {Object}
|
| 19570 |
*/
|
| 19571 |
|
| 19572 |
+
var logged = Object.create(null);
|
|
|
|
|
|
|
| 19573 |
/**
|
| 19574 |
+
* Logs a message to notify developers about a deprecated feature.
|
|
|
|
| 19575 |
*
|
| 19576 |
+
* @param {string} feature Name of the deprecated feature.
|
| 19577 |
+
* @param {?Object} options Personalisation options
|
| 19578 |
+
* @param {?string} options.version Version in which the feature will be removed.
|
| 19579 |
+
* @param {?string} options.alternative Feature to use instead
|
| 19580 |
+
* @param {?string} options.plugin Plugin name if it's a plugin feature
|
| 19581 |
+
* @param {?string} options.link Link to documentation
|
| 19582 |
+
* @param {?string} options.hint Additional message to help transition away from the deprecated feature.
|
| 19583 |
*
|
| 19584 |
+
* @example
|
| 19585 |
+
* ```js
|
| 19586 |
+
* import deprecated from '@wordpress/deprecated';
|
| 19587 |
*
|
| 19588 |
+
* deprecated( 'Eating meat', {
|
| 19589 |
+
* version: 'the future',
|
| 19590 |
+
* alternative: 'vegetables',
|
| 19591 |
+
* plugin: 'the earth',
|
| 19592 |
+
* hint: 'You may find it beneficial to transition gradually.',
|
| 19593 |
+
* } );
|
| 19594 |
+
*
|
| 19595 |
+
* // Logs: 'Eating meat is deprecated and will be removed from the earth in the future. Please use vegetables instead. Note: You may find it beneficial to transition gradually.'
|
| 19596 |
+
* ```
|
| 19597 |
*/
|
| 19598 |
|
| 19599 |
+
function deprecated(feature) {
|
| 19600 |
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
| 19601 |
+
var version = options.version,
|
| 19602 |
+
alternative = options.alternative,
|
| 19603 |
+
plugin = options.plugin,
|
| 19604 |
+
link = options.link,
|
| 19605 |
+
hint = options.hint;
|
| 19606 |
+
var pluginMessage = plugin ? " from ".concat(plugin) : '';
|
| 19607 |
+
var versionMessage = version ? " and will be removed".concat(pluginMessage, " in version ").concat(version) : '';
|
| 19608 |
+
var useInsteadMessage = alternative ? " Please use ".concat(alternative, " instead.") : '';
|
| 19609 |
+
var linkMessage = link ? " See: ".concat(link) : '';
|
| 19610 |
+
var hintMessage = hint ? " Note: ".concat(hint) : '';
|
| 19611 |
+
var message = "".concat(feature, " is deprecated").concat(versionMessage, ".").concat(useInsteadMessage).concat(linkMessage).concat(hintMessage); // Skip if already logged.
|
| 19612 |
+
|
| 19613 |
+
if (message in logged) {
|
| 19614 |
+
return;
|
| 19615 |
+
}
|
| 19616 |
+
/**
|
| 19617 |
+
* Fires whenever a deprecated feature is encountered
|
| 19618 |
+
*
|
| 19619 |
+
* @param {string} feature Name of the deprecated feature.
|
| 19620 |
+
* @param {?Object} options Personalisation options
|
| 19621 |
+
* @param {?string} options.version Version in which the feature will be removed.
|
| 19622 |
+
* @param {?string} options.alternative Feature to use instead
|
| 19623 |
+
* @param {?string} options.plugin Plugin name if it's a plugin feature
|
| 19624 |
+
* @param {?string} options.link Link to documentation
|
| 19625 |
+
* @param {?string} options.hint Additional message to help transition away from the deprecated feature.
|
| 19626 |
+
* @param {?string} message Message sent to console.warn
|
| 19627 |
+
*/
|
| 19628 |
+
|
| 19629 |
+
|
| 19630 |
+
Object(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_0__["doAction"])('deprecated', feature, options, message); // eslint-disable-next-line no-console
|
| 19631 |
+
|
| 19632 |
+
console.warn(message);
|
| 19633 |
+
logged[message] = true;
|
| 19634 |
}
|
| 19635 |
+
//# sourceMappingURL=index.js.map
|
| 19636 |
+
|
| 19637 |
+
/***/ }),
|
| 19638 |
+
|
| 19639 |
+
/***/ 570:
|
| 19640 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
| 19641 |
+
|
| 19642 |
+
"use strict";
|
| 19643 |
+
/* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8);
|
| 19644 |
+
/* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(12);
|
| 19645 |
+
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(0);
|
| 19646 |
+
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__);
|
| 19647 |
+
|
| 19648 |
+
|
| 19649 |
+
|
| 19650 |
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
| 19651 |
+
|
| 19652 |
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
| 19653 |
+
|
| 19654 |
+
/**
|
| 19655 |
+
* WordPress dependencies
|
| 19656 |
*/
|
| 19657 |
+
// Disable reason: JSDoc linter doesn't seem to parse the union (`&`) correctly.
|
| 19658 |
+
|
| 19659 |
+
/* eslint-disable jsdoc/valid-types */
|
| 19660 |
+
|
| 19661 |
+
/** @typedef {{icon: JSX.Element, size?: number} & import('react').ComponentPropsWithoutRef<'SVG'>} IconProps */
|
| 19662 |
+
|
| 19663 |
+
/* eslint-enable jsdoc/valid-types */
|
| 19664 |
|
|
|
|
|
|
|
|
|
|
| 19665 |
/**
|
| 19666 |
+
* Return an SVG icon.
|
| 19667 |
*
|
| 19668 |
+
* @param {IconProps} props icon is the SVG component to render
|
| 19669 |
+
* size is a number specifiying the icon size in pixels
|
| 19670 |
+
* Other props will be passed to wrapped SVG component
|
| 19671 |
*
|
| 19672 |
+
* @return {JSX.Element} Icon component
|
| 19673 |
*/
|
| 19674 |
|
| 19675 |
+
function Icon(_ref) {
|
| 19676 |
+
var icon = _ref.icon,
|
| 19677 |
+
_ref$size = _ref.size,
|
| 19678 |
+
size = _ref$size === void 0 ? 24 : _ref$size,
|
| 19679 |
+
props = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(_ref, ["icon", "size"]);
|
| 19680 |
+
|
| 19681 |
+
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["cloneElement"])(icon, _objectSpread({
|
| 19682 |
+
width: size,
|
| 19683 |
+
height: size
|
| 19684 |
+
}, props));
|
| 19685 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19686 |
|
| 19687 |
+
/* harmony default export */ __webpack_exports__["a"] = (Icon);
|
| 19688 |
+
//# sourceMappingURL=index.js.map
|
| 19689 |
|
| 19690 |
+
/***/ }),
|
| 19691 |
+
|
| 19692 |
+
/***/ 571:
|
| 19693 |
+
/***/ (function(module, exports, __webpack_require__) {
|
| 19694 |
+
|
| 19695 |
+
// extracted by mini-css-extract-plugin
|
| 19696 |
+
|
| 19697 |
+
/***/ }),
|
| 19698 |
+
|
| 19699 |
+
/***/ 572:
|
| 19700 |
+
/***/ (function(module, exports, __webpack_require__) {
|
| 19701 |
+
|
| 19702 |
+
// extracted by mini-css-extract-plugin
|
| 19703 |
+
|
| 19704 |
+
/***/ }),
|
| 19705 |
+
|
| 19706 |
+
/***/ 573:
|
| 19707 |
+
/***/ (function(module, exports) {
|
| 19708 |
+
|
| 19709 |
+
module.exports = Array.isArray || function (arr) {
|
| 19710 |
+
return Object.prototype.toString.call(arr) == '[object Array]';
|
| 19711 |
+
};
|
| 19712 |
+
|
| 19713 |
+
|
| 19714 |
+
/***/ }),
|
| 19715 |
+
|
| 19716 |
+
/***/ 574:
|
| 19717 |
+
/***/ (function(module, exports, __webpack_require__) {
|
| 19718 |
+
|
| 19719 |
+
// extracted by mini-css-extract-plugin
|
| 19720 |
+
|
| 19721 |
+
/***/ }),
|
| 19722 |
+
|
| 19723 |
+
/***/ 575:
|
| 19724 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
| 19725 |
+
|
| 19726 |
+
"use strict";
|
| 19727 |
+
/* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8);
|
| 19728 |
+
/* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(12);
|
| 19729 |
+
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(0);
|
| 19730 |
+
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__);
|
| 19731 |
+
|
| 19732 |
+
|
| 19733 |
+
|
| 19734 |
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
| 19735 |
+
|
| 19736 |
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
| 19737 |
|
|
|
|
| 19738 |
/**
|
| 19739 |
+
* WordPress dependencies
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19740 |
*/
|
| 19741 |
|
| 19742 |
+
/** @typedef {{icon: JSX.Element, size?: number} & import('@wordpress/primitives').SVGProps} IconProps */
|
| 19743 |
+
|
| 19744 |
/**
|
| 19745 |
+
* Return an SVG icon.
|
|
|
|
| 19746 |
*
|
| 19747 |
+
* @param {IconProps} props icon is the SVG component to render
|
| 19748 |
+
* size is a number specifiying the icon size in pixels
|
| 19749 |
+
* Other props will be passed to wrapped SVG component
|
| 19750 |
*
|
| 19751 |
+
* @return {JSX.Element} Icon component
|
| 19752 |
*/
|
| 19753 |
|
| 19754 |
+
function Icon(_ref) {
|
| 19755 |
+
var icon = _ref.icon,
|
| 19756 |
+
_ref$size = _ref.size,
|
| 19757 |
+
size = _ref$size === void 0 ? 24 : _ref$size,
|
| 19758 |
+
props = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(_ref, ["icon", "size"]);
|
| 19759 |
+
|
| 19760 |
+
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["cloneElement"])(icon, _objectSpread({
|
| 19761 |
+
width: size,
|
| 19762 |
+
height: size
|
| 19763 |
+
}, props));
|
| 19764 |
}
|
|
|
|
|
|
|
|
|
|
| 19765 |
|
| 19766 |
+
/* harmony default export */ __webpack_exports__["a"] = (Icon);
|
| 19767 |
+
//# sourceMappingURL=index.js.map
|
|
|
|
|
|
|
| 19768 |
|
| 19769 |
+
/***/ }),
|
| 19770 |
+
|
| 19771 |
+
/***/ 58:
|
| 19772 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
| 19773 |
+
|
| 19774 |
+
"use strict";
|
| 19775 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _objectWithoutPropertiesLoose; });
|
| 19776 |
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
| 19777 |
+
if (source == null) return {};
|
| 19778 |
+
var target = {};
|
| 19779 |
+
var sourceKeys = Object.keys(source);
|
| 19780 |
+
var key, i;
|
| 19781 |
+
|
| 19782 |
+
for (i = 0; i < sourceKeys.length; i++) {
|
| 19783 |
+
key = sourceKeys[i];
|
| 19784 |
+
if (excluded.indexOf(key) >= 0) continue;
|
| 19785 |
+
target[key] = source[key];
|
| 19786 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19787 |
|
| 19788 |
+
return target;
|
| 19789 |
+
}
|
| 19790 |
+
|
| 19791 |
+
/***/ }),
|
| 19792 |
+
|
| 19793 |
+
/***/ 59:
|
| 19794 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
| 19795 |
|
| 19796 |
+
"use strict";
|
| 19797 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _arrayLikeToArray; });
|
| 19798 |
+
function _arrayLikeToArray(arr, len) {
|
| 19799 |
+
if (len == null || len > arr.length) len = arr.length;
|
| 19800 |
|
| 19801 |
+
for (var i = 0, arr2 = new Array(len); i < len; i++) {
|
| 19802 |
+
arr2[i] = arr[i];
|
| 19803 |
+
}
|
| 19804 |
|
| 19805 |
+
return arr2;
|
| 19806 |
+
}
|
| 19807 |
|
| 19808 |
+
/***/ }),
|
| 19809 |
|
| 19810 |
+
/***/ 6:
|
| 19811 |
+
/***/ (function(module, exports) {
|
| 19812 |
+
|
| 19813 |
+
(function() { module.exports = this["React"]; }());
|
| 19814 |
+
|
| 19815 |
+
/***/ }),
|
| 19816 |
+
|
| 19817 |
+
/***/ 62:
|
| 19818 |
+
/***/ (function(module, exports, __webpack_require__) {
|
| 19819 |
+
|
| 19820 |
+
var objectWithoutPropertiesLoose = __webpack_require__(280);
|
| 19821 |
+
|
| 19822 |
+
function _objectWithoutProperties(source, excluded) {
|
| 19823 |
+
if (source == null) return {};
|
| 19824 |
+
var target = objectWithoutPropertiesLoose(source, excluded);
|
| 19825 |
+
var key, i;
|
| 19826 |
+
|
| 19827 |
+
if (Object.getOwnPropertySymbols) {
|
| 19828 |
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
| 19829 |
+
|
| 19830 |
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
| 19831 |
+
key = sourceSymbolKeys[i];
|
| 19832 |
+
if (excluded.indexOf(key) >= 0) continue;
|
| 19833 |
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
| 19834 |
+
target[key] = source[key];
|
| 19835 |
+
}
|
| 19836 |
+
}
|
| 19837 |
+
|
| 19838 |
+
return target;
|
| 19839 |
+
}
|
| 19840 |
+
|
| 19841 |
+
module.exports = _objectWithoutProperties;
|
| 19842 |
+
|
| 19843 |
+
/***/ }),
|
| 19844 |
+
|
| 19845 |
+
/***/ 63:
|
| 19846 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
| 19847 |
+
|
| 19848 |
+
"use strict";
|
| 19849 |
+
/* WEBPACK VAR INJECTION */(function(process) {/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
|
| 19850 |
+
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
|
| 19851 |
+
/* harmony import */ var _wordpress_warning__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(90);
|
| 19852 |
/**
|
| 19853 |
+
* WordPress dependencies
|
| 19854 |
*/
|
| 19855 |
|
| 19856 |
+
|
| 19857 |
+
var SlotFillContext = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createContext"])({
|
| 19858 |
+
slots: {},
|
| 19859 |
+
fills: {},
|
| 19860 |
+
registerSlot: function registerSlot() {
|
| 19861 |
+
typeof process !== "undefined" && process.env && "production" !== "production" ? Object(_wordpress_warning__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])('Components must be wrapped within `SlotFillProvider`. ' + 'See https://developer.wordpress.org/block-editor/components/slot-fill/') : void 0;
|
| 19862 |
+
},
|
| 19863 |
+
updateSlot: function updateSlot() {},
|
| 19864 |
+
unregisterSlot: function unregisterSlot() {},
|
| 19865 |
+
registerFill: function registerFill() {},
|
| 19866 |
+
unregisterFill: function unregisterFill() {}
|
| 19867 |
+
});
|
| 19868 |
+
/* harmony default export */ __webpack_exports__["a"] = (SlotFillContext);
|
| 19869 |
+
//# sourceMappingURL=slot-fill-context.js.map
|
| 19870 |
+
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(33)))
|
| 19871 |
|
| 19872 |
/***/ }),
|
| 19873 |
|
| 19874 |
+
/***/ 64:
|
| 19875 |
/***/ (function(module, exports) {
|
| 19876 |
|
| 19877 |
+
(function() { module.exports = this["wc"]["tracks"]; }());
|
| 19878 |
|
| 19879 |
/***/ }),
|
| 19880 |
|
| 19881 |
+
/***/ 67:
|
| 19882 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
| 19883 |
|
| 19884 |
"use strict";
|
| 19885 |
|
| 19886 |
+
// EXPORTS
|
| 19887 |
+
__webpack_require__.d(__webpack_exports__, "a", function() { return /* reexport */ ThemeContext; });
|
| 19888 |
+
__webpack_require__.d(__webpack_exports__, "c", function() { return /* reexport */ emotion_element_57a3a7a3_browser_esm_withEmotionCache; });
|
| 19889 |
+
__webpack_require__.d(__webpack_exports__, "b", function() { return /* reexport */ css_browser_esm; });
|
| 19890 |
|
| 19891 |
+
// UNUSED EXPORTS: CacheProvider, ClassNames, Global, createElement, jsx, keyframes
|
|
|
|
|
|
|
| 19892 |
|
| 19893 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js
|
| 19894 |
+
var inheritsLoose = __webpack_require__(56);
|
|
|
|
|
|
|
|
|
|
| 19895 |
|
| 19896 |
+
// EXTERNAL MODULE: external "React"
|
| 19897 |
+
var external_React_ = __webpack_require__(6);
|
| 19898 |
|
| 19899 |
+
// CONCATENATED MODULE: ./node_modules/@emotion/sheet/dist/sheet.browser.esm.js
|
| 19900 |
+
/*
|
| 19901 |
|
| 19902 |
+
Based off glamor's StyleSheet, thanks Sunil ❤️
|
|
|
|
| 19903 |
|
| 19904 |
+
high performance StyleSheet for css-in-js systems
|
|
|
|
|
|
|
|
|
|
| 19905 |
|
| 19906 |
+
- uses multiple style tags behind the scenes for millions of rules
|
| 19907 |
+
- uses `insertRule` for appending in production for *much* faster performance
|
| 19908 |
|
| 19909 |
+
// usage
|
|
|
|
|
|
|
| 19910 |
|
| 19911 |
+
import { StyleSheet } from '@emotion/sheet'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19912 |
|
| 19913 |
+
let styleSheet = new StyleSheet({ key: '', container: document.head })
|
| 19914 |
|
| 19915 |
+
styleSheet.insert('#box { border: 1px solid red; }')
|
| 19916 |
+
- appends a css rule into the stylesheet
|
| 19917 |
|
| 19918 |
+
styleSheet.flush()
|
| 19919 |
+
- empties the stylesheet of all its contents
|
| 19920 |
+
|
| 19921 |
+
*/
|
| 19922 |
+
// $FlowFixMe
|
| 19923 |
+
function sheetForTag(tag) {
|
| 19924 |
+
if (tag.sheet) {
|
| 19925 |
+
// $FlowFixMe
|
| 19926 |
+
return tag.sheet;
|
| 19927 |
+
} // this weirdness brought to you by firefox
|
| 19928 |
+
|
| 19929 |
+
/* istanbul ignore next */
|
| 19930 |
+
|
| 19931 |
+
|
| 19932 |
+
for (var i = 0; i < document.styleSheets.length; i++) {
|
| 19933 |
+
if (document.styleSheets[i].ownerNode === tag) {
|
| 19934 |
+
// $FlowFixMe
|
| 19935 |
+
return document.styleSheets[i];
|
| 19936 |
+
}
|
| 19937 |
+
}
|
| 19938 |
+
}
|
| 19939 |
+
|
| 19940 |
+
function createStyleElement(options) {
|
| 19941 |
+
var tag = document.createElement('style');
|
| 19942 |
+
tag.setAttribute('data-emotion', options.key);
|
| 19943 |
+
|
| 19944 |
+
if (options.nonce !== undefined) {
|
| 19945 |
+
tag.setAttribute('nonce', options.nonce);
|
| 19946 |
}
|
| 19947 |
|
| 19948 |
+
tag.appendChild(document.createTextNode(''));
|
| 19949 |
+
return tag;
|
| 19950 |
}
|
| 19951 |
|
| 19952 |
+
var StyleSheet =
|
| 19953 |
+
/*#__PURE__*/
|
| 19954 |
+
function () {
|
| 19955 |
+
function StyleSheet(options) {
|
| 19956 |
+
this.isSpeedy = options.speedy === undefined ? "production" === 'production' : options.speedy;
|
| 19957 |
+
this.tags = [];
|
| 19958 |
+
this.ctr = 0;
|
| 19959 |
+
this.nonce = options.nonce; // key is the value of the data-emotion attribute, it's used to identify different sheets
|
| 19960 |
+
|
| 19961 |
+
this.key = options.key;
|
| 19962 |
+
this.container = options.container;
|
| 19963 |
+
this.before = null;
|
| 19964 |
+
}
|
| 19965 |
|
| 19966 |
+
var _proto = StyleSheet.prototype;
|
| 19967 |
|
| 19968 |
+
_proto.insert = function insert(rule) {
|
| 19969 |
+
// the max length is how many rules we have per style tag, it's 65000 in speedy mode
|
| 19970 |
+
// it's 1 in dev because we insert source maps that map a single rule to a location
|
| 19971 |
+
// and you can only have one source map per style tag
|
| 19972 |
+
if (this.ctr % (this.isSpeedy ? 65000 : 1) === 0) {
|
| 19973 |
+
var _tag = createStyleElement(this);
|
| 19974 |
|
| 19975 |
+
var before;
|
| 19976 |
|
| 19977 |
+
if (this.tags.length === 0) {
|
| 19978 |
+
before = this.before;
|
| 19979 |
+
} else {
|
| 19980 |
+
before = this.tags[this.tags.length - 1].nextSibling;
|
| 19981 |
+
}
|
| 19982 |
|
| 19983 |
+
this.container.insertBefore(_tag, before);
|
| 19984 |
+
this.tags.push(_tag);
|
| 19985 |
+
}
|
| 19986 |
|
| 19987 |
+
var tag = this.tags[this.tags.length - 1];
|
| 19988 |
+
|
| 19989 |
+
if (this.isSpeedy) {
|
| 19990 |
+
var sheet = sheetForTag(tag);
|
| 19991 |
+
|
| 19992 |
+
try {
|
| 19993 |
+
// this is a really hot path
|
| 19994 |
+
// we check the second character first because having "i"
|
| 19995 |
+
// as the second character will happen less often than
|
| 19996 |
+
// having "@" as the first character
|
| 19997 |
+
var isImportRule = rule.charCodeAt(1) === 105 && rule.charCodeAt(0) === 64; // this is the ultrafast version, works across browsers
|
| 19998 |
+
// the big drawback is that the css won't be editable in devtools
|
| 19999 |
+
|
| 20000 |
+
sheet.insertRule(rule, // we need to insert @import rules before anything else
|
| 20001 |
+
// otherwise there will be an error
|
| 20002 |
+
// technically this means that the @import rules will
|
| 20003 |
+
// _usually_(not always since there could be multiple style tags)
|
| 20004 |
+
// be the first ones in prod and generally later in dev
|
| 20005 |
+
// this shouldn't really matter in the real world though
|
| 20006 |
+
// @import is generally only used for font faces from google fonts and etc.
|
| 20007 |
+
// so while this could be technically correct then it would be slower and larger
|
| 20008 |
+
// for a tiny bit of correctness that won't matter in the real world
|
| 20009 |
+
isImportRule ? 0 : sheet.cssRules.length);
|
| 20010 |
+
} catch (e) {
|
| 20011 |
+
if (false) {}
|
| 20012 |
+
}
|
| 20013 |
+
} else {
|
| 20014 |
+
tag.appendChild(document.createTextNode(rule));
|
| 20015 |
+
}
|
| 20016 |
|
| 20017 |
+
this.ctr++;
|
| 20018 |
+
};
|
| 20019 |
|
| 20020 |
+
_proto.flush = function flush() {
|
| 20021 |
+
// $FlowFixMe
|
| 20022 |
+
this.tags.forEach(function (tag) {
|
| 20023 |
+
return tag.parentNode.removeChild(tag);
|
| 20024 |
+
});
|
| 20025 |
+
this.tags = [];
|
| 20026 |
+
this.ctr = 0;
|
| 20027 |
+
};
|
| 20028 |
|
| 20029 |
+
return StyleSheet;
|
| 20030 |
+
}();
|
|
|
|
|
|
|
| 20031 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20032 |
|
| 20033 |
|
| 20034 |
+
// CONCATENATED MODULE: ./node_modules/@emotion/stylis/dist/stylis.browser.esm.js
|
| 20035 |
+
function stylis_min (W) {
|
| 20036 |
+
function M(d, c, e, h, a) {
|
| 20037 |
+
for (var m = 0, b = 0, v = 0, n = 0, q, g, x = 0, K = 0, k, u = k = q = 0, l = 0, r = 0, I = 0, t = 0, B = e.length, J = B - 1, y, f = '', p = '', F = '', G = '', C; l < B;) {
|
| 20038 |
+
g = e.charCodeAt(l);
|
| 20039 |
+
l === J && 0 !== b + n + v + m && (0 !== b && (g = 47 === b ? 10 : 47), n = v = m = 0, B++, J++);
|
| 20040 |
|
| 20041 |
+
if (0 === b + n + v + m) {
|
| 20042 |
+
if (l === J && (0 < r && (f = f.replace(N, '')), 0 < f.trim().length)) {
|
| 20043 |
+
switch (g) {
|
| 20044 |
+
case 32:
|
| 20045 |
+
case 9:
|
| 20046 |
+
case 59:
|
| 20047 |
+
case 13:
|
| 20048 |
+
case 10:
|
| 20049 |
+
break;
|
| 20050 |
|
| 20051 |
+
default:
|
| 20052 |
+
f += e.charAt(l);
|
| 20053 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20054 |
|
| 20055 |
+
g = 59;
|
| 20056 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20057 |
|
| 20058 |
+
switch (g) {
|
| 20059 |
+
case 123:
|
| 20060 |
+
f = f.trim();
|
| 20061 |
+
q = f.charCodeAt(0);
|
| 20062 |
+
k = 1;
|
| 20063 |
|
| 20064 |
+
for (t = ++l; l < B;) {
|
| 20065 |
+
switch (g = e.charCodeAt(l)) {
|
| 20066 |
+
case 123:
|
| 20067 |
+
k++;
|
| 20068 |
+
break;
|
| 20069 |
|
| 20070 |
+
case 125:
|
| 20071 |
+
k--;
|
| 20072 |
+
break;
|
| 20073 |
|
| 20074 |
+
case 47:
|
| 20075 |
+
switch (g = e.charCodeAt(l + 1)) {
|
| 20076 |
+
case 42:
|
| 20077 |
+
case 47:
|
| 20078 |
+
a: {
|
| 20079 |
+
for (u = l + 1; u < J; ++u) {
|
| 20080 |
+
switch (e.charCodeAt(u)) {
|
| 20081 |
+
case 47:
|
| 20082 |
+
if (42 === g && 42 === e.charCodeAt(u - 1) && l + 2 !== u) {
|
| 20083 |
+
l = u + 1;
|
| 20084 |
+
break a;
|
| 20085 |
+
}
|
| 20086 |
|
| 20087 |
+
break;
|
|
|
|
|
|
|
| 20088 |
|
| 20089 |
+
case 10:
|
| 20090 |
+
if (47 === g) {
|
| 20091 |
+
l = u + 1;
|
| 20092 |
+
break a;
|
| 20093 |
+
}
|
| 20094 |
|
| 20095 |
+
}
|
| 20096 |
+
}
|
| 20097 |
|
| 20098 |
+
l = u;
|
| 20099 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20100 |
|
| 20101 |
+
}
|
|
|
|
| 20102 |
|
| 20103 |
+
break;
|
| 20104 |
|
| 20105 |
+
case 91:
|
| 20106 |
+
g++;
|
| 20107 |
|
|
|
|
|
|
