[ Index ] |
PHP Cross Reference of WordPress Trunk (Updated Daily) |
[Summary view] [Print] [Text view]
1 /******/ (() => { // webpackBootstrap 2 /******/ var __webpack_modules__ = ({ 3 4 /***/ 4306: 5 /***/ (function(module, exports) { 6 7 var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! 8 autosize 4.0.4 9 license: MIT 10 http://www.jacklmoore.com/autosize 11 */ 12 (function (global, factory) { 13 if (true) { 14 !(__WEBPACK_AMD_DEFINE_ARRAY__ = [module, exports], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), 15 __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? 16 (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), 17 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 18 } else { var mod; } 19 })(this, function (module, exports) { 20 'use strict'; 21 22 var map = typeof Map === "function" ? new Map() : function () { 23 var keys = []; 24 var values = []; 25 26 return { 27 has: function has(key) { 28 return keys.indexOf(key) > -1; 29 }, 30 get: function get(key) { 31 return values[keys.indexOf(key)]; 32 }, 33 set: function set(key, value) { 34 if (keys.indexOf(key) === -1) { 35 keys.push(key); 36 values.push(value); 37 } 38 }, 39 delete: function _delete(key) { 40 var index = keys.indexOf(key); 41 if (index > -1) { 42 keys.splice(index, 1); 43 values.splice(index, 1); 44 } 45 } 46 }; 47 }(); 48 49 var createEvent = function createEvent(name) { 50 return new Event(name, { bubbles: true }); 51 }; 52 try { 53 new Event('test'); 54 } catch (e) { 55 // IE does not support `new Event()` 56 createEvent = function createEvent(name) { 57 var evt = document.createEvent('Event'); 58 evt.initEvent(name, true, false); 59 return evt; 60 }; 61 } 62 63 function assign(ta) { 64 if (!ta || !ta.nodeName || ta.nodeName !== 'TEXTAREA' || map.has(ta)) return; 65 66 var heightOffset = null; 67 var clientWidth = null; 68 var cachedHeight = null; 69 70 function init() { 71 var style = window.getComputedStyle(ta, null); 72 73 if (style.resize === 'vertical') { 74 ta.style.resize = 'none'; 75 } else if (style.resize === 'both') { 76 ta.style.resize = 'horizontal'; 77 } 78 79 if (style.boxSizing === 'content-box') { 80 heightOffset = -(parseFloat(style.paddingTop) + parseFloat(style.paddingBottom)); 81 } else { 82 heightOffset = parseFloat(style.borderTopWidth) + parseFloat(style.borderBottomWidth); 83 } 84 // Fix when a textarea is not on document body and heightOffset is Not a Number 85 if (isNaN(heightOffset)) { 86 heightOffset = 0; 87 } 88 89 update(); 90 } 91 92 function changeOverflow(value) { 93 { 94 // Chrome/Safari-specific fix: 95 // When the textarea y-overflow is hidden, Chrome/Safari do not reflow the text to account for the space 96 // made available by removing the scrollbar. The following forces the necessary text reflow. 97 var width = ta.style.width; 98 ta.style.width = '0px'; 99 // Force reflow: 100 /* jshint ignore:start */ 101 ta.offsetWidth; 102 /* jshint ignore:end */ 103 ta.style.width = width; 104 } 105 106 ta.style.overflowY = value; 107 } 108 109 function getParentOverflows(el) { 110 var arr = []; 111 112 while (el && el.parentNode && el.parentNode instanceof Element) { 113 if (el.parentNode.scrollTop) { 114 arr.push({ 115 node: el.parentNode, 116 scrollTop: el.parentNode.scrollTop 117 }); 118 } 119 el = el.parentNode; 120 } 121 122 return arr; 123 } 124 125 function resize() { 126 if (ta.scrollHeight === 0) { 127 // If the scrollHeight is 0, then the element probably has display:none or is detached from the DOM. 128 return; 129 } 130 131 var overflows = getParentOverflows(ta); 132 var docTop = document.documentElement && document.documentElement.scrollTop; // Needed for Mobile IE (ticket #240) 133 134 ta.style.height = ''; 135 ta.style.height = ta.scrollHeight + heightOffset + 'px'; 136 137 // used to check if an update is actually necessary on window.resize 138 clientWidth = ta.clientWidth; 139 140 // prevents scroll-position jumping 141 overflows.forEach(function (el) { 142 el.node.scrollTop = el.scrollTop; 143 }); 144 145 if (docTop) { 146 document.documentElement.scrollTop = docTop; 147 } 148 } 149 150 function update() { 151 resize(); 152 153 var styleHeight = Math.round(parseFloat(ta.style.height)); 154 var computed = window.getComputedStyle(ta, null); 155 156 // Using offsetHeight as a replacement for computed.height in IE, because IE does not account use of border-box 157 var actualHeight = computed.boxSizing === 'content-box' ? Math.round(parseFloat(computed.height)) : ta.offsetHeight; 158 159 // The actual height not matching the style height (set via the resize method) indicates that 160 // the max-height has been exceeded, in which case the overflow should be allowed. 161 if (actualHeight < styleHeight) { 162 if (computed.overflowY === 'hidden') { 163 changeOverflow('scroll'); 164 resize(); 165 actualHeight = computed.boxSizing === 'content-box' ? Math.round(parseFloat(window.getComputedStyle(ta, null).height)) : ta.offsetHeight; 166 } 167 } else { 168 // Normally keep overflow set to hidden, to avoid flash of scrollbar as the textarea expands. 169 if (computed.overflowY !== 'hidden') { 170 changeOverflow('hidden'); 171 resize(); 172 actualHeight = computed.boxSizing === 'content-box' ? Math.round(parseFloat(window.getComputedStyle(ta, null).height)) : ta.offsetHeight; 173 } 174 } 175 176 if (cachedHeight !== actualHeight) { 177 cachedHeight = actualHeight; 178 var evt = createEvent('autosize:resized'); 179 try { 180 ta.dispatchEvent(evt); 181 } catch (err) { 182 // Firefox will throw an error on dispatchEvent for a detached element 183 // https://bugzilla.mozilla.org/show_bug.cgi?id=889376 184 } 185 } 186 } 187 188 var pageResize = function pageResize() { 189 if (ta.clientWidth !== clientWidth) { 190 update(); 191 } 192 }; 193 194 var destroy = function (style) { 195 window.removeEventListener('resize', pageResize, false); 196 ta.removeEventListener('input', update, false); 197 ta.removeEventListener('keyup', update, false); 198 ta.removeEventListener('autosize:destroy', destroy, false); 199 ta.removeEventListener('autosize:update', update, false); 200 201 Object.keys(style).forEach(function (key) { 202 ta.style[key] = style[key]; 203 }); 204 205 map.delete(ta); 206 }.bind(ta, { 207 height: ta.style.height, 208 resize: ta.style.resize, 209 overflowY: ta.style.overflowY, 210 overflowX: ta.style.overflowX, 211 wordWrap: ta.style.wordWrap 212 }); 213 214 ta.addEventListener('autosize:destroy', destroy, false); 215 216 // IE9 does not fire onpropertychange or oninput for deletions, 217 // so binding to onkeyup to catch most of those events. 218 // There is no way that I know of to detect something like 'cut' in IE9. 219 if ('onpropertychange' in ta && 'oninput' in ta) { 220 ta.addEventListener('keyup', update, false); 221 } 222 223 window.addEventListener('resize', pageResize, false); 224 ta.addEventListener('input', update, false); 225 ta.addEventListener('autosize:update', update, false); 226 ta.style.overflowX = 'hidden'; 227 ta.style.wordWrap = 'break-word'; 228 229 map.set(ta, { 230 destroy: destroy, 231 update: update 232 }); 233 234 init(); 235 } 236 237 function destroy(ta) { 238 var methods = map.get(ta); 239 if (methods) { 240 methods.destroy(); 241 } 242 } 243 244 function update(ta) { 245 var methods = map.get(ta); 246 if (methods) { 247 methods.update(); 248 } 249 } 250 251 var autosize = null; 252 253 // Do nothing in Node.js environment and IE8 (or lower) 254 if (typeof window === 'undefined' || typeof window.getComputedStyle !== 'function') { 255 autosize = function autosize(el) { 256 return el; 257 }; 258 autosize.destroy = function (el) { 259 return el; 260 }; 261 autosize.update = function (el) { 262 return el; 263 }; 264 } else { 265 autosize = function autosize(el, options) { 266 if (el) { 267 Array.prototype.forEach.call(el.length ? el : [el], function (x) { 268 return assign(x, options); 269 }); 270 } 271 return el; 272 }; 273 autosize.destroy = function (el) { 274 if (el) { 275 Array.prototype.forEach.call(el.length ? el : [el], destroy); 276 } 277 return el; 278 }; 279 autosize.update = function (el) { 280 if (el) { 281 Array.prototype.forEach.call(el.length ? el : [el], update); 282 } 283 return el; 284 }; 285 } 286 287 exports.default = autosize; 288 module.exports = exports['default']; 289 }); 290 291 /***/ }), 292 293 /***/ 6109: 294 /***/ ((module) => { 295 296 // This code has been refactored for 140 bytes 297 // You can see the original here: https://github.com/twolfson/computedStyle/blob/04cd1da2e30fa45844f95f5cb1ac898e9b9ef050/lib/computedStyle.js 298 var computedStyle = function (el, prop, getComputedStyle) { 299 getComputedStyle = window.getComputedStyle; 300 301 // In one fell swoop 302 return ( 303 // If we have getComputedStyle 304 getComputedStyle ? 305 // Query it 306 // TODO: From CSS-Query notes, we might need (node, null) for FF 307 getComputedStyle(el) : 308 309 // Otherwise, we are in IE and use currentStyle 310 el.currentStyle 311 )[ 312 // Switch to camelCase for CSSOM 313 // DEV: Grabbed from jQuery 314 // https://github.com/jquery/jquery/blob/1.9-stable/src/css.js#L191-L194 315 // https://github.com/jquery/jquery/blob/1.9-stable/src/core.js#L593-L597 316 prop.replace(/-(\w)/gi, function (word, letter) { 317 return letter.toUpperCase(); 318 }) 319 ]; 320 }; 321 322 module.exports = computedStyle; 323 324 325 /***/ }), 326 327 /***/ 5417: 328 /***/ ((__unused_webpack_module, exports) => { 329 330 "use strict"; 331 /*istanbul ignore start*/ 332 333 334 Object.defineProperty(exports, "__esModule", ({ 335 value: true 336 })); 337 exports["default"] = Diff; 338 339 /*istanbul ignore end*/ 340 function Diff() {} 341 342 Diff.prototype = { 343 /*istanbul ignore start*/ 344 345 /*istanbul ignore end*/ 346 diff: function diff(oldString, newString) { 347 /*istanbul ignore start*/ 348 var 349 /*istanbul ignore end*/ 350 options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; 351 var callback = options.callback; 352 353 if (typeof options === 'function') { 354 callback = options; 355 options = {}; 356 } 357 358 this.options = options; 359 var self = this; 360 361 function done(value) { 362 if (callback) { 363 setTimeout(function () { 364 callback(undefined, value); 365 }, 0); 366 return true; 367 } else { 368 return value; 369 } 370 } // Allow subclasses to massage the input prior to running 371 372 373 oldString = this.castInput(oldString); 374 newString = this.castInput(newString); 375 oldString = this.removeEmpty(this.tokenize(oldString)); 376 newString = this.removeEmpty(this.tokenize(newString)); 377 var newLen = newString.length, 378 oldLen = oldString.length; 379 var editLength = 1; 380 var maxEditLength = newLen + oldLen; 381 var bestPath = [{ 382 newPos: -1, 383 components: [] 384 }]; // Seed editLength = 0, i.e. the content starts with the same values 385 386 var oldPos = this.extractCommon(bestPath[0], newString, oldString, 0); 387 388 if (bestPath[0].newPos + 1 >= newLen && oldPos + 1 >= oldLen) { 389 // Identity per the equality and tokenizer 390 return done([{ 391 value: this.join(newString), 392 count: newString.length 393 }]); 394 } // Main worker method. checks all permutations of a given edit length for acceptance. 395 396 397 function execEditLength() { 398 for (var diagonalPath = -1 * editLength; diagonalPath <= editLength; diagonalPath += 2) { 399 var basePath = 400 /*istanbul ignore start*/ 401 void 0 402 /*istanbul ignore end*/ 403 ; 404 405 var addPath = bestPath[diagonalPath - 1], 406 removePath = bestPath[diagonalPath + 1], 407 _oldPos = (removePath ? removePath.newPos : 0) - diagonalPath; 408 409 if (addPath) { 410 // No one else is going to attempt to use this value, clear it 411 bestPath[diagonalPath - 1] = undefined; 412 } 413 414 var canAdd = addPath && addPath.newPos + 1 < newLen, 415 canRemove = removePath && 0 <= _oldPos && _oldPos < oldLen; 416 417 if (!canAdd && !canRemove) { 418 // If this path is a terminal then prune 419 bestPath[diagonalPath] = undefined; 420 continue; 421 } // Select the diagonal that we want to branch from. We select the prior 422 // path whose position in the new string is the farthest from the origin 423 // and does not pass the bounds of the diff graph 424 425 426 if (!canAdd || canRemove && addPath.newPos < removePath.newPos) { 427 basePath = clonePath(removePath); 428 self.pushComponent(basePath.components, undefined, true); 429 } else { 430 basePath = addPath; // No need to clone, we've pulled it from the list 431 432 basePath.newPos++; 433 self.pushComponent(basePath.components, true, undefined); 434 } 435 436 _oldPos = self.extractCommon(basePath, newString, oldString, diagonalPath); // If we have hit the end of both strings, then we are done 437 438 if (basePath.newPos + 1 >= newLen && _oldPos + 1 >= oldLen) { 439 return done(buildValues(self, basePath.components, newString, oldString, self.useLongestToken)); 440 } else { 441 // Otherwise track this path as a potential candidate and continue. 442 bestPath[diagonalPath] = basePath; 443 } 444 } 445 446 editLength++; 447 } // Performs the length of edit iteration. Is a bit fugly as this has to support the 448 // sync and async mode which is never fun. Loops over execEditLength until a value 449 // is produced. 450 451 452 if (callback) { 453 (function exec() { 454 setTimeout(function () { 455 // This should not happen, but we want to be safe. 456 457 /* istanbul ignore next */ 458 if (editLength > maxEditLength) { 459 return callback(); 460 } 461 462 if (!execEditLength()) { 463 exec(); 464 } 465 }, 0); 466 })(); 467 } else { 468 while (editLength <= maxEditLength) { 469 var ret = execEditLength(); 470 471 if (ret) { 472 return ret; 473 } 474 } 475 } 476 }, 477 478 /*istanbul ignore start*/ 479 480 /*istanbul ignore end*/ 481 pushComponent: function pushComponent(components, added, removed) { 482 var last = components[components.length - 1]; 483 484 if (last && last.added === added && last.removed === removed) { 485 // We need to clone here as the component clone operation is just 486 // as shallow array clone 487 components[components.length - 1] = { 488 count: last.count + 1, 489 added: added, 490 removed: removed 491 }; 492 } else { 493 components.push({ 494 count: 1, 495 added: added, 496 removed: removed 497 }); 498 } 499 }, 500 501 /*istanbul ignore start*/ 502 503 /*istanbul ignore end*/ 504 extractCommon: function extractCommon(basePath, newString, oldString, diagonalPath) { 505 var newLen = newString.length, 506 oldLen = oldString.length, 507 newPos = basePath.newPos, 508 oldPos = newPos - diagonalPath, 509 commonCount = 0; 510 511 while (newPos + 1 < newLen && oldPos + 1 < oldLen && this.equals(newString[newPos + 1], oldString[oldPos + 1])) { 512 newPos++; 513 oldPos++; 514 commonCount++; 515 } 516 517 if (commonCount) { 518 basePath.components.push({ 519 count: commonCount 520 }); 521 } 522 523 basePath.newPos = newPos; 524 return oldPos; 525 }, 526 527 /*istanbul ignore start*/ 528 529 /*istanbul ignore end*/ 530 equals: function equals(left, right) { 531 if (this.options.comparator) { 532 return this.options.comparator(left, right); 533 } else { 534 return left === right || this.options.ignoreCase && left.toLowerCase() === right.toLowerCase(); 535 } 536 }, 537 538 /*istanbul ignore start*/ 539 540 /*istanbul ignore end*/ 541 removeEmpty: function removeEmpty(array) { 542 var ret = []; 543 544 for (var i = 0; i < array.length; i++) { 545 if (array[i]) { 546 ret.push(array[i]); 547 } 548 } 549 550 return ret; 551 }, 552 553 /*istanbul ignore start*/ 554 555 /*istanbul ignore end*/ 556 castInput: function castInput(value) { 557 return value; 558 }, 559 560 /*istanbul ignore start*/ 561 562 /*istanbul ignore end*/ 563 tokenize: function tokenize(value) { 564 return value.split(''); 565 }, 566 567 /*istanbul ignore start*/ 568 569 /*istanbul ignore end*/ 570 join: function join(chars) { 571 return chars.join(''); 572 } 573 }; 574 575 function buildValues(diff, components, newString, oldString, useLongestToken) { 576 var componentPos = 0, 577 componentLen = components.length, 578 newPos = 0, 579 oldPos = 0; 580 581 for (; componentPos < componentLen; componentPos++) { 582 var component = components[componentPos]; 583 584 if (!component.removed) { 585 if (!component.added && useLongestToken) { 586 var value = newString.slice(newPos, newPos + component.count); 587 value = value.map(function (value, i) { 588 var oldValue = oldString[oldPos + i]; 589 return oldValue.length > value.length ? oldValue : value; 590 }); 591 component.value = diff.join(value); 592 } else { 593 component.value = diff.join(newString.slice(newPos, newPos + component.count)); 594 } 595 596 newPos += component.count; // Common case 597 598 if (!component.added) { 599 oldPos += component.count; 600 } 601 } else { 602 component.value = diff.join(oldString.slice(oldPos, oldPos + component.count)); 603 oldPos += component.count; // Reverse add and remove so removes are output first to match common convention 604 // The diffing algorithm is tied to add then remove output and this is the simplest 605 // route to get the desired output with minimal overhead. 606 607 if (componentPos && components[componentPos - 1].added) { 608 var tmp = components[componentPos - 1]; 609 components[componentPos - 1] = components[componentPos]; 610 components[componentPos] = tmp; 611 } 612 } 613 } // Special case handle for when one terminal is ignored (i.e. whitespace). 614 // For this case we merge the terminal into the prior string and drop the change. 615 // This is only available for string mode. 616 617 618 var lastComponent = components[componentLen - 1]; 619 620 if (componentLen > 1 && typeof lastComponent.value === 'string' && (lastComponent.added || lastComponent.removed) && diff.equals('', lastComponent.value)) { 621 components[componentLen - 2].value += lastComponent.value; 622 components.pop(); 623 } 624 625 return components; 626 } 627 628 function clonePath(path) { 629 return { 630 newPos: path.newPos, 631 components: path.components.slice(0) 632 }; 633 } 634 635 636 /***/ }), 637 638 /***/ 8021: 639 /***/ ((__unused_webpack_module, exports, __webpack_require__) => { 640 641 "use strict"; 642 var __webpack_unused_export__; 643 /*istanbul ignore start*/ 644 645 646 __webpack_unused_export__ = ({ 647 value: true 648 }); 649 exports.JJ = diffChars; 650 __webpack_unused_export__ = void 0; 651 652 /*istanbul ignore end*/ 653 var 654 /*istanbul ignore start*/ 655 _base = _interopRequireDefault(__webpack_require__(5417)) 656 /*istanbul ignore end*/ 657 ; 658 659 /*istanbul ignore start*/ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 660 661 /*istanbul ignore end*/ 662 var characterDiff = new 663 /*istanbul ignore start*/ 664 _base 665 /*istanbul ignore end*/ 666 . 667 /*istanbul ignore start*/ 668 default 669 /*istanbul ignore end*/ 670 (); 671 672 /*istanbul ignore start*/ 673 __webpack_unused_export__ = characterDiff; 674 675 /*istanbul ignore end*/ 676 function diffChars(oldStr, newStr, options) { 677 return characterDiff.diff(oldStr, newStr, options); 678 } 679 680 681 /***/ }), 682 683 /***/ 7734: 684 /***/ ((module) => { 685 686 "use strict"; 687 688 689 // do not edit .js files directly - edit src/index.jst 690 691 692 var envHasBigInt64Array = typeof BigInt64Array !== 'undefined'; 693 694 695 module.exports = function equal(a, b) { 696 if (a === b) return true; 697 698 if (a && b && typeof a == 'object' && typeof b == 'object') { 699 if (a.constructor !== b.constructor) return false; 700 701 var length, i, keys; 702 if (Array.isArray(a)) { 703 length = a.length; 704 if (length != b.length) return false; 705 for (i = length; i-- !== 0;) 706 if (!equal(a[i], b[i])) return false; 707 return true; 708 } 709 710 711 if ((a instanceof Map) && (b instanceof Map)) { 712 if (a.size !== b.size) return false; 713 for (i of a.entries()) 714 if (!b.has(i[0])) return false; 715 for (i of a.entries()) 716 if (!equal(i[1], b.get(i[0]))) return false; 717 return true; 718 } 719 720 if ((a instanceof Set) && (b instanceof Set)) { 721 if (a.size !== b.size) return false; 722 for (i of a.entries()) 723 if (!b.has(i[0])) return false; 724 return true; 725 } 726 727 if (ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) { 728 length = a.length; 729 if (length != b.length) return false; 730 for (i = length; i-- !== 0;) 731 if (a[i] !== b[i]) return false; 732 return true; 733 } 734 735 736 if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags; 737 if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf(); 738 if (a.toString !== Object.prototype.toString) return a.toString() === b.toString(); 739 740 keys = Object.keys(a); 741 length = keys.length; 742 if (length !== Object.keys(b).length) return false; 743 744 for (i = length; i-- !== 0;) 745 if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false; 746 747 for (i = length; i-- !== 0;) { 748 var key = keys[i]; 749 750 if (!equal(a[key], b[key])) return false; 751 } 752 753 return true; 754 } 755 756 // true if both NaN, false otherwise 757 return a!==a && b!==b; 758 }; 759 760 761 /***/ }), 762 763 /***/ 5215: 764 /***/ ((module) => { 765 766 "use strict"; 767 768 769 // do not edit .js files directly - edit src/index.jst 770 771 772 773 module.exports = function equal(a, b) { 774 if (a === b) return true; 775 776 if (a && b && typeof a == 'object' && typeof b == 'object') { 777 if (a.constructor !== b.constructor) return false; 778 779 var length, i, keys; 780 if (Array.isArray(a)) { 781 length = a.length; 782 if (length != b.length) return false; 783 for (i = length; i-- !== 0;) 784 if (!equal(a[i], b[i])) return false; 785 return true; 786 } 787 788 789 790 if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags; 791 if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf(); 792 if (a.toString !== Object.prototype.toString) return a.toString() === b.toString(); 793 794 keys = Object.keys(a); 795 length = keys.length; 796 if (length !== Object.keys(b).length) return false; 797 798 for (i = length; i-- !== 0;) 799 if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false; 800 801 for (i = length; i-- !== 0;) { 802 var key = keys[i]; 803 804 if (!equal(a[key], b[key])) return false; 805 } 806 807 return true; 808 } 809 810 // true if both NaN, false otherwise 811 return a!==a && b!==b; 812 }; 813 814 815 /***/ }), 816 817 /***/ 461: 818 /***/ ((module, __unused_webpack_exports, __webpack_require__) => { 819 820 // Load in dependencies 821 var computedStyle = __webpack_require__(6109); 822 823 /** 824 * Calculate the `line-height` of a given node 825 * @param {HTMLElement} node Element to calculate line height of. Must be in the DOM. 826 * @returns {Number} `line-height` of the element in pixels 827 */ 828 function lineHeight(node) { 829 // Grab the line-height via style 830 var lnHeightStr = computedStyle(node, 'line-height'); 831 var lnHeight = parseFloat(lnHeightStr, 10); 832 833 // If the lineHeight did not contain a unit (i.e. it was numeric), convert it to ems (e.g. '2.3' === '2.3em') 834 if (lnHeightStr === lnHeight + '') { 835 // Save the old lineHeight style and update the em unit to the element 836 var _lnHeightStyle = node.style.lineHeight; 837 node.style.lineHeight = lnHeightStr + 'em'; 838 839 // Calculate the em based height 840 lnHeightStr = computedStyle(node, 'line-height'); 841 lnHeight = parseFloat(lnHeightStr, 10); 842 843 // Revert the lineHeight style 844 if (_lnHeightStyle) { 845 node.style.lineHeight = _lnHeightStyle; 846 } else { 847 delete node.style.lineHeight; 848 } 849 } 850 851 // If the lineHeight is in `pt`, convert it to pixels (4px for 3pt) 852 // DEV: `em` units are converted to `pt` in IE6 853 // Conversion ratio from https://developer.mozilla.org/en-US/docs/Web/CSS/length 854 if (lnHeightStr.indexOf('pt') !== -1) { 855 lnHeight *= 4; 856 lnHeight /= 3; 857 // Otherwise, if the lineHeight is in `mm`, convert it to pixels (96px for 25.4mm) 858 } else if (lnHeightStr.indexOf('mm') !== -1) { 859 lnHeight *= 96; 860 lnHeight /= 25.4; 861 // Otherwise, if the lineHeight is in `cm`, convert it to pixels (96px for 2.54cm) 862 } else if (lnHeightStr.indexOf('cm') !== -1) { 863 lnHeight *= 96; 864 lnHeight /= 2.54; 865 // Otherwise, if the lineHeight is in `in`, convert it to pixels (96px for 1in) 866 } else if (lnHeightStr.indexOf('in') !== -1) { 867 lnHeight *= 96; 868 // Otherwise, if the lineHeight is in `pc`, convert it to pixels (12pt for 1pc) 869 } else if (lnHeightStr.indexOf('pc') !== -1) { 870 lnHeight *= 16; 871 } 872 873 // Continue our computation 874 lnHeight = Math.round(lnHeight); 875 876 // If the line-height is "normal", calculate by font-size 877 if (lnHeightStr === 'normal') { 878 // Create a temporary node 879 var nodeName = node.nodeName; 880 var _node = document.createElement(nodeName); 881 _node.innerHTML = ' '; 882 883 // If we have a text area, reset it to only 1 row 884 // https://github.com/twolfson/line-height/issues/4 885 if (nodeName.toUpperCase() === 'TEXTAREA') { 886 _node.setAttribute('rows', '1'); 887 } 888 889 // Set the font-size of the element 890 var fontSizeStr = computedStyle(node, 'font-size'); 891 _node.style.fontSize = fontSizeStr; 892 893 // Remove default padding/border which can affect offset height 894 // https://github.com/twolfson/line-height/issues/4 895 // https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/offsetHeight 896 _node.style.padding = '0px'; 897 _node.style.border = '0px'; 898 899 // Append it to the body 900 var body = document.body; 901 body.appendChild(_node); 902 903 // Assume the line height of the element is the height 904 var height = _node.offsetHeight; 905 lnHeight = height; 906 907 // Remove our child from the DOM 908 body.removeChild(_node); 909 } 910 911 // Return the calculated height 912 return lnHeight; 913 } 914 915 // Export lineHeight 916 module.exports = lineHeight; 917 918 919 /***/ }), 920 921 /***/ 7520: 922 /***/ ((module, __unused_webpack_exports, __webpack_require__) => { 923 924 module.exports = __webpack_require__(7191); 925 926 927 /***/ }), 928 929 /***/ 8202: 930 /***/ ((module) => { 931 932 "use strict"; 933 /** 934 * Copyright (c) 2015, Facebook, Inc. 935 * All rights reserved. 936 * 937 * This source code is licensed under the BSD-style license found in the 938 * LICENSE file in the root directory of this source tree. An additional grant 939 * of patent rights can be found in the PATENTS file in the same directory. 940 * 941 * @providesModule ExecutionEnvironment 942 */ 943 944 /*jslint evil: true */ 945 946 947 948 var canUseDOM = !!( 949 typeof window !== 'undefined' && 950 window.document && 951 window.document.createElement 952 ); 953 954 /** 955 * Simple, lightweight module assisting with the detection and context of 956 * Worker. Helps avoid circular dependencies and allows code to reason about 957 * whether or not they are in a Worker, even if they never include the main 958 * `ReactWorker` dependency. 959 */ 960 var ExecutionEnvironment = { 961 962 canUseDOM: canUseDOM, 963 964 canUseWorkers: typeof Worker !== 'undefined', 965 966 canUseEventListeners: 967 canUseDOM && !!(window.addEventListener || window.attachEvent), 968 969 canUseViewport: canUseDOM && !!window.screen, 970 971 isInWorker: !canUseDOM // For now, this is true - might change in the future. 972 973 }; 974 975 module.exports = ExecutionEnvironment; 976 977 978 /***/ }), 979 980 /***/ 2213: 981 /***/ ((module) => { 982 983 /** 984 * Copyright 2004-present Facebook. All Rights Reserved. 985 * 986 * @providesModule UserAgent_DEPRECATED 987 */ 988 989 /** 990 * Provides entirely client-side User Agent and OS detection. You should prefer 991 * the non-deprecated UserAgent module when possible, which exposes our 992 * authoritative server-side PHP-based detection to the client. 993 * 994 * Usage is straightforward: 995 * 996 * if (UserAgent_DEPRECATED.ie()) { 997 * // IE 998 * } 999 * 1000 * You can also do version checks: 1001 * 1002 * if (UserAgent_DEPRECATED.ie() >= 7) { 1003 * // IE7 or better 1004 * } 1005 * 1006 * The browser functions will return NaN if the browser does not match, so 1007 * you can also do version compares the other way: 1008 * 1009 * if (UserAgent_DEPRECATED.ie() < 7) { 1010 * // IE6 or worse 1011 * } 1012 * 1013 * Note that the version is a float and may include a minor version number, 1014 * so you should always use range operators to perform comparisons, not 1015 * strict equality. 1016 * 1017 * **Note:** You should **strongly** prefer capability detection to browser 1018 * version detection where it's reasonable: 1019 * 1020 * http://www.quirksmode.org/js/support.html 1021 * 1022 * Further, we have a large number of mature wrapper functions and classes 1023 * which abstract away many browser irregularities. Check the documentation, 1024 * grep for things, or ask on javascript@lists.facebook.com before writing yet 1025 * another copy of "event || window.event". 1026 * 1027 */ 1028 1029 var _populated = false; 1030 1031 // Browsers 1032 var _ie, _firefox, _opera, _webkit, _chrome; 1033 1034 // Actual IE browser for compatibility mode 1035 var _ie_real_version; 1036 1037 // Platforms 1038 var _osx, _windows, _linux, _android; 1039 1040 // Architectures 1041 var _win64; 1042 1043 // Devices 1044 var _iphone, _ipad, _native; 1045 1046 var _mobile; 1047 1048 function _populate() { 1049 if (_populated) { 1050 return; 1051 } 1052 1053 _populated = true; 1054 1055 // To work around buggy JS libraries that can't handle multi-digit 1056 // version numbers, Opera 10's user agent string claims it's Opera 1057 // 9, then later includes a Version/X.Y field: 1058 // 1059 // Opera/9.80 (foo) Presto/2.2.15 Version/10.10 1060 var uas = navigator.userAgent; 1061 var agent = /(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(uas); 1062 var os = /(Mac OS X)|(Windows)|(Linux)/.exec(uas); 1063 1064 _iphone = /\b(iPhone|iP[ao]d)/.exec(uas); 1065 _ipad = /\b(iP[ao]d)/.exec(uas); 1066 _android = /Android/i.exec(uas); 1067 _native = /FBAN\/\w+;/i.exec(uas); 1068 _mobile = /Mobile/i.exec(uas); 1069 1070 // Note that the IE team blog would have you believe you should be checking 1071 // for 'Win64; x64'. But MSDN then reveals that you can actually be coming 1072 // from either x64 or ia64; so ultimately, you should just check for Win64 1073 // as in indicator of whether you're in 64-bit IE. 32-bit IE on 64-bit 1074 // Windows will send 'WOW64' instead. 1075 _win64 = !!(/Win64/.exec(uas)); 1076 1077 if (agent) { 1078 _ie = agent[1] ? parseFloat(agent[1]) : ( 1079 agent[5] ? parseFloat(agent[5]) : NaN); 1080 // IE compatibility mode 1081 if (_ie && document && document.documentMode) { 1082 _ie = document.documentMode; 1083 } 1084 // grab the "true" ie version from the trident token if available 1085 var trident = /(?:Trident\/(\d+.\d+))/.exec(uas); 1086 _ie_real_version = trident ? parseFloat(trident[1]) + 4 : _ie; 1087 1088 _firefox = agent[2] ? parseFloat(agent[2]) : NaN; 1089 _opera = agent[3] ? parseFloat(agent[3]) : NaN; 1090 _webkit = agent[4] ? parseFloat(agent[4]) : NaN; 1091 if (_webkit) { 1092 // We do not add the regexp to the above test, because it will always 1093 // match 'safari' only since 'AppleWebKit' appears before 'Chrome' in 1094 // the userAgent string. 1095 agent = /(?:Chrome\/(\d+\.\d+))/.exec(uas); 1096 _chrome = agent && agent[1] ? parseFloat(agent[1]) : NaN; 1097 } else { 1098 _chrome = NaN; 1099 } 1100 } else { 1101 _ie = _firefox = _opera = _chrome = _webkit = NaN; 1102 } 1103 1104 if (os) { 1105 if (os[1]) { 1106 // Detect OS X version. If no version number matches, set _osx to true. 1107 // Version examples: 10, 10_6_1, 10.7 1108 // Parses version number as a float, taking only first two sets of 1109 // digits. If only one set of digits is found, returns just the major 1110 // version number. 1111 var ver = /(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(uas); 1112 1113 _osx = ver ? parseFloat(ver[1].replace('_', '.')) : true; 1114 } else { 1115 _osx = false; 1116 } 1117 _windows = !!os[2]; 1118 _linux = !!os[3]; 1119 } else { 1120 _osx = _windows = _linux = false; 1121 } 1122 } 1123 1124 var UserAgent_DEPRECATED = { 1125 1126 /** 1127 * Check if the UA is Internet Explorer. 1128 * 1129 * 1130 * @return float|NaN Version number (if match) or NaN. 1131 */ 1132 ie: function() { 1133 return _populate() || _ie; 1134 }, 1135 1136 /** 1137 * Check if we're in Internet Explorer compatibility mode. 1138 * 1139 * @return bool true if in compatibility mode, false if 1140 * not compatibility mode or not ie 1141 */ 1142 ieCompatibilityMode: function() { 1143 return _populate() || (_ie_real_version > _ie); 1144 }, 1145 1146 1147 /** 1148 * Whether the browser is 64-bit IE. Really, this is kind of weak sauce; we 1149 * only need this because Skype can't handle 64-bit IE yet. We need to remove 1150 * this when we don't need it -- tracked by #601957. 1151 */ 1152 ie64: function() { 1153 return UserAgent_DEPRECATED.ie() && _win64; 1154 }, 1155 1156 /** 1157 * Check if the UA is Firefox. 1158 * 1159 * 1160 * @return float|NaN Version number (if match) or NaN. 1161 */ 1162 firefox: function() { 1163 return _populate() || _firefox; 1164 }, 1165 1166 1167 /** 1168 * Check if the UA is Opera. 1169 * 1170 * 1171 * @return float|NaN Version number (if match) or NaN. 1172 */ 1173 opera: function() { 1174 return _populate() || _opera; 1175 }, 1176 1177 1178 /** 1179 * Check if the UA is WebKit. 1180 * 1181 * 1182 * @return float|NaN Version number (if match) or NaN. 1183 */ 1184 webkit: function() { 1185 return _populate() || _webkit; 1186 }, 1187 1188 /** 1189 * For Push 1190 * WILL BE REMOVED VERY SOON. Use UserAgent_DEPRECATED.webkit 1191 */ 1192 safari: function() { 1193 return UserAgent_DEPRECATED.webkit(); 1194 }, 1195 1196 /** 1197 * Check if the UA is a Chrome browser. 1198 * 1199 * 1200 * @return float|NaN Version number (if match) or NaN. 1201 */ 1202 chrome : function() { 1203 return _populate() || _chrome; 1204 }, 1205 1206 1207 /** 1208 * Check if the user is running Windows. 1209 * 1210 * @return bool `true' if the user's OS is Windows. 1211 */ 1212 windows: function() { 1213 return _populate() || _windows; 1214 }, 1215 1216 1217 /** 1218 * Check if the user is running Mac OS X. 1219 * 1220 * @return float|bool Returns a float if a version number is detected, 1221 * otherwise true/false. 1222 */ 1223 osx: function() { 1224 return _populate() || _osx; 1225 }, 1226 1227 /** 1228 * Check if the user is running Linux. 1229 * 1230 * @return bool `true' if the user's OS is some flavor of Linux. 1231 */ 1232 linux: function() { 1233 return _populate() || _linux; 1234 }, 1235 1236 /** 1237 * Check if the user is running on an iPhone or iPod platform. 1238 * 1239 * @return bool `true' if the user is running some flavor of the 1240 * iPhone OS. 1241 */ 1242 iphone: function() { 1243 return _populate() || _iphone; 1244 }, 1245 1246 mobile: function() { 1247 return _populate() || (_iphone || _ipad || _android || _mobile); 1248 }, 1249 1250 nativeApp: function() { 1251 // webviews inside of the native apps 1252 return _populate() || _native; 1253 }, 1254 1255 android: function() { 1256 return _populate() || _android; 1257 }, 1258 1259 ipad: function() { 1260 return _populate() || _ipad; 1261 } 1262 }; 1263 1264 module.exports = UserAgent_DEPRECATED; 1265 1266 1267 /***/ }), 1268 1269 /***/ 1087: 1270 /***/ ((module, __unused_webpack_exports, __webpack_require__) => { 1271 1272 "use strict"; 1273 /** 1274 * Copyright 2013-2015, Facebook, Inc. 1275 * All rights reserved. 1276 * 1277 * This source code is licensed under the BSD-style license found in the 1278 * LICENSE file in the root directory of this source tree. An additional grant 1279 * of patent rights can be found in the PATENTS file in the same directory. 1280 * 1281 * @providesModule isEventSupported 1282 */ 1283 1284 1285 1286 var ExecutionEnvironment = __webpack_require__(8202); 1287 1288 var useHasFeature; 1289 if (ExecutionEnvironment.canUseDOM) { 1290 useHasFeature = 1291 document.implementation && 1292 document.implementation.hasFeature && 1293 // always returns true in newer browsers as per the standard. 1294 // @see http://dom.spec.whatwg.org/#dom-domimplementation-hasfeature 1295 document.implementation.hasFeature('', '') !== true; 1296 } 1297 1298 /** 1299 * Checks if an event is supported in the current execution environment. 1300 * 1301 * NOTE: This will not work correctly for non-generic events such as `change`, 1302 * `reset`, `load`, `error`, and `select`. 1303 * 1304 * Borrows from Modernizr. 1305 * 1306 * @param {string} eventNameSuffix Event name, e.g. "click". 1307 * @param {?boolean} capture Check if the capture phase is supported. 1308 * @return {boolean} True if the event is supported. 1309 * @internal 1310 * @license Modernizr 3.0.0pre (Custom Build) | MIT 1311 */ 1312 function isEventSupported(eventNameSuffix, capture) { 1313 if (!ExecutionEnvironment.canUseDOM || 1314 capture && !('addEventListener' in document)) { 1315 return false; 1316 } 1317 1318 var eventName = 'on' + eventNameSuffix; 1319 var isSupported = eventName in document; 1320 1321 if (!isSupported) { 1322 var element = document.createElement('div'); 1323 element.setAttribute(eventName, 'return;'); 1324 isSupported = typeof element[eventName] === 'function'; 1325 } 1326 1327 if (!isSupported && useHasFeature && eventNameSuffix === 'wheel') { 1328 // This is the only way to test support for the `wheel` event in IE9+. 1329 isSupported = document.implementation.hasFeature('Events.wheel', '3.0'); 1330 } 1331 1332 return isSupported; 1333 } 1334 1335 module.exports = isEventSupported; 1336 1337 1338 /***/ }), 1339 1340 /***/ 7191: 1341 /***/ ((module, __unused_webpack_exports, __webpack_require__) => { 1342 1343 "use strict"; 1344 /** 1345 * Copyright (c) 2015, Facebook, Inc. 1346 * All rights reserved. 1347 * 1348 * This source code is licensed under the BSD-style license found in the 1349 * LICENSE file in the root directory of this source tree. An additional grant 1350 * of patent rights can be found in the PATENTS file in the same directory. 1351 * 1352 * @providesModule normalizeWheel 1353 * @typechecks 1354 */ 1355 1356 1357 1358 var UserAgent_DEPRECATED = __webpack_require__(2213); 1359 1360 var isEventSupported = __webpack_require__(1087); 1361 1362 1363 // Reasonable defaults 1364 var PIXEL_STEP = 10; 1365 var LINE_HEIGHT = 40; 1366 var PAGE_HEIGHT = 800; 1367 1368 /** 1369 * Mouse wheel (and 2-finger trackpad) support on the web sucks. It is 1370 * complicated, thus this doc is long and (hopefully) detailed enough to answer 1371 * your questions. 1372 * 1373 * If you need to react to the mouse wheel in a predictable way, this code is 1374 * like your bestest friend. * hugs * 1375 * 1376 * As of today, there are 4 DOM event types you can listen to: 1377 * 1378 * 'wheel' -- Chrome(31+), FF(17+), IE(9+) 1379 * 'mousewheel' -- Chrome, IE(6+), Opera, Safari 1380 * 'MozMousePixelScroll' -- FF(3.5 only!) (2010-2013) -- don't bother! 1381 * 'DOMMouseScroll' -- FF(0.9.7+) since 2003 1382 * 1383 * So what to do? The is the best: 1384 * 1385 * normalizeWheel.getEventType(); 1386 * 1387 * In your event callback, use this code to get sane interpretation of the 1388 * deltas. This code will return an object with properties: 1389 * 1390 * spinX -- normalized spin speed (use for zoom) - x plane 1391 * spinY -- " - y plane 1392 * pixelX -- normalized distance (to pixels) - x plane 1393 * pixelY -- " - y plane 1394 * 1395 * Wheel values are provided by the browser assuming you are using the wheel to 1396 * scroll a web page by a number of lines or pixels (or pages). Values can vary 1397 * significantly on different platforms and browsers, forgetting that you can 1398 * scroll at different speeds. Some devices (like trackpads) emit more events 1399 * at smaller increments with fine granularity, and some emit massive jumps with 1400 * linear speed or acceleration. 1401 * 1402 * This code does its best to normalize the deltas for you: 1403 * 1404 * - spin is trying to normalize how far the wheel was spun (or trackpad 1405 * dragged). This is super useful for zoom support where you want to 1406 * throw away the chunky scroll steps on the PC and make those equal to 1407 * the slow and smooth tiny steps on the Mac. Key data: This code tries to 1408 * resolve a single slow step on a wheel to 1. 1409 * 1410 * - pixel is normalizing the desired scroll delta in pixel units. You'll 1411 * get the crazy differences between browsers, but at least it'll be in 1412 * pixels! 1413 * 1414 * - positive value indicates scrolling DOWN/RIGHT, negative UP/LEFT. This 1415 * should translate to positive value zooming IN, negative zooming OUT. 1416 * This matches the newer 'wheel' event. 1417 * 1418 * Why are there spinX, spinY (or pixels)? 1419 * 1420 * - spinX is a 2-finger side drag on the trackpad, and a shift + wheel turn 1421 * with a mouse. It results in side-scrolling in the browser by default. 1422 * 1423 * - spinY is what you expect -- it's the classic axis of a mouse wheel. 1424 * 1425 * - I dropped spinZ/pixelZ. It is supported by the DOM 3 'wheel' event and 1426 * probably is by browsers in conjunction with fancy 3D controllers .. but 1427 * you know. 1428 * 1429 * Implementation info: 1430 * 1431 * Examples of 'wheel' event if you scroll slowly (down) by one step with an 1432 * average mouse: 1433 * 1434 * OS X + Chrome (mouse) - 4 pixel delta (wheelDelta -120) 1435 * OS X + Safari (mouse) - N/A pixel delta (wheelDelta -12) 1436 * OS X + Firefox (mouse) - 0.1 line delta (wheelDelta N/A) 1437 * Win8 + Chrome (mouse) - 100 pixel delta (wheelDelta -120) 1438 * Win8 + Firefox (mouse) - 3 line delta (wheelDelta -120) 1439 * 1440 * On the trackpad: 1441 * 1442 * OS X + Chrome (trackpad) - 2 pixel delta (wheelDelta -6) 1443 * OS X + Firefox (trackpad) - 1 pixel delta (wheelDelta N/A) 1444 * 1445 * On other/older browsers.. it's more complicated as there can be multiple and 1446 * also missing delta values. 1447 * 1448 * The 'wheel' event is more standard: 1449 * 1450 * http://www.w3.org/TR/DOM-Level-3-Events/#events-wheelevents 1451 * 1452 * The basics is that it includes a unit, deltaMode (pixels, lines, pages), and 1453 * deltaX, deltaY and deltaZ. Some browsers provide other values to maintain 1454 * backward compatibility with older events. Those other values help us 1455 * better normalize spin speed. Example of what the browsers provide: 1456 * 1457 * | event.wheelDelta | event.detail 1458 * ------------------+------------------+-------------- 1459 * Safari v5/OS X | -120 | 0 1460 * Safari v5/Win7 | -120 | 0 1461 * Chrome v17/OS X | -120 | 0 1462 * Chrome v17/Win7 | -120 | 0 1463 * IE9/Win7 | -120 | undefined 1464 * Firefox v4/OS X | undefined | 1 1465 * Firefox v4/Win7 | undefined | 3 1466 * 1467 */ 1468 function normalizeWheel(/*object*/ event) /*object*/ { 1469 var sX = 0, sY = 0, // spinX, spinY 1470 pX = 0, pY = 0; // pixelX, pixelY 1471 1472 // Legacy 1473 if ('detail' in event) { sY = event.detail; } 1474 if ('wheelDelta' in event) { sY = -event.wheelDelta / 120; } 1475 if ('wheelDeltaY' in event) { sY = -event.wheelDeltaY / 120; } 1476 if ('wheelDeltaX' in event) { sX = -event.wheelDeltaX / 120; } 1477 1478 // side scrolling on FF with DOMMouseScroll 1479 if ( 'axis' in event && event.axis === event.HORIZONTAL_AXIS ) { 1480 sX = sY; 1481 sY = 0; 1482 } 1483 1484 pX = sX * PIXEL_STEP; 1485 pY = sY * PIXEL_STEP; 1486 1487 if ('deltaY' in event) { pY = event.deltaY; } 1488 if ('deltaX' in event) { pX = event.deltaX; } 1489 1490 if ((pX || pY) && event.deltaMode) { 1491 if (event.deltaMode == 1) { // delta in LINE units 1492 pX *= LINE_HEIGHT; 1493 pY *= LINE_HEIGHT; 1494 } else { // delta in PAGE units 1495 pX *= PAGE_HEIGHT; 1496 pY *= PAGE_HEIGHT; 1497 } 1498 } 1499 1500 // Fall-back if spin cannot be determined 1501 if (pX && !sX) { sX = (pX < 1) ? -1 : 1; } 1502 if (pY && !sY) { sY = (pY < 1) ? -1 : 1; } 1503 1504 return { spinX : sX, 1505 spinY : sY, 1506 pixelX : pX, 1507 pixelY : pY }; 1508 } 1509 1510 1511 /** 1512 * The best combination if you prefer spinX + spinY normalization. It favors 1513 * the older DOMMouseScroll for Firefox, as FF does not include wheelDelta with 1514 * 'wheel' event, making spin speed determination impossible. 1515 */ 1516 normalizeWheel.getEventType = function() /*string*/ { 1517 return (UserAgent_DEPRECATED.firefox()) 1518 ? 'DOMMouseScroll' 1519 : (isEventSupported('wheel')) 1520 ? 'wheel' 1521 : 'mousewheel'; 1522 }; 1523 1524 module.exports = normalizeWheel; 1525 1526 1527 /***/ }), 1528 1529 /***/ 2775: 1530 /***/ ((module) => { 1531 1532 var x=String; 1533 var create=function() {return {isColorSupported:false,reset:x,bold:x,dim:x,italic:x,underline:x,inverse:x,hidden:x,strikethrough:x,black:x,red:x,green:x,yellow:x,blue:x,magenta:x,cyan:x,white:x,gray:x,bgBlack:x,bgRed:x,bgGreen:x,bgYellow:x,bgBlue:x,bgMagenta:x,bgCyan:x,bgWhite:x}}; 1534 module.exports=create(); 1535 module.exports.createColors = create; 1536 1537 1538 /***/ }), 1539 1540 /***/ 4465: 1541 /***/ ((__unused_webpack_module, exports) => { 1542 1543 "use strict"; 1544 1545 Object.defineProperty(exports, "__esModule", ({ value: true })); 1546 1547 1548 /***/ }), 1549 1550 /***/ 8036: 1551 /***/ (function(module, __unused_webpack_exports, __webpack_require__) { 1552 1553 "use strict"; 1554 1555 var __importDefault = (this && this.__importDefault) || function (mod) { 1556 return (mod && mod.__esModule) ? mod : { "default": mod }; 1557 }; 1558 __webpack_require__(4465); 1559 const postcss_1 = __importDefault(__webpack_require__(4529)); 1560 const PostCSSPlugin_1 = __importDefault(__webpack_require__(3576)); 1561 module.exports = (0, PostCSSPlugin_1.default)(postcss_1.default); 1562 1563 1564 /***/ }), 1565 1566 /***/ 5525: 1567 /***/ ((__unused_webpack_module, exports, __webpack_require__) => { 1568 1569 "use strict"; 1570 1571 Object.defineProperty(exports, "__esModule", ({ value: true })); 1572 exports.prefixWrapCSSSelector = exports.prefixWrapCSSRule = void 0; 1573 const CSSSelector_1 = __webpack_require__(3467); 1574 const prefixWrapCSSRule = (cssRule, nested, ignoredSelectors, prefixSelector, prefixRootTags) => { 1575 // Check each rule to see if it exactly matches our prefix selector, when 1576 // this happens, don't try to prefix that selector. 1577 const rules = cssRule.selectors.filter((selector) => !(0, CSSSelector_1.cssRuleMatchesPrefixSelector)({ selector: selector }, prefixSelector)); 1578 if (rules.length === 0) { 1579 return; 1580 } 1581 cssRule.selector = rules 1582 .map((cssSelector) => (0, exports.prefixWrapCSSSelector)(cssSelector, cssRule, nested, ignoredSelectors, prefixSelector, prefixRootTags)) 1583 .filter(CSSSelector_1.isValidCSSSelector) 1584 .join(", "); 1585 }; 1586 exports.prefixWrapCSSRule = prefixWrapCSSRule; 1587 const prefixWrapCSSSelector = (cssSelector, cssRule, nested, ignoredSelectors, prefixSelector, prefixRootTags) => { 1588 const cleanedSelector = (0, CSSSelector_1.cleanSelector)(cssSelector); 1589 if (cleanedSelector === "") { 1590 return null; 1591 } 1592 // Don't prefix nested selected. 1593 if (nested !== null && cleanedSelector.startsWith(nested, 0)) { 1594 return cleanedSelector; 1595 } 1596 // Do not prefix keyframes rules. 1597 if ((0, CSSSelector_1.isKeyframes)(cssRule)) { 1598 return cleanedSelector; 1599 } 1600 // Check for matching ignored selectors 1601 if (ignoredSelectors.some((currentValue) => cleanedSelector.match(currentValue))) { 1602 return cleanedSelector; 1603 } 1604 // Anything other than a root tag is always prefixed. 1605 if ((0, CSSSelector_1.isNotRootTag)(cleanedSelector)) { 1606 return prefixSelector + " " + cleanedSelector; 1607 } 1608 // Handle special case where root tags should be converted into classes 1609 // rather than being replaced. 1610 if (prefixRootTags) { 1611 return prefixSelector + " ." + cleanedSelector; 1612 } 1613 // HTML and Body elements cannot be contained within our container so lets 1614 // extract their styles. 1615 return cleanedSelector.replace(/^(body|html|:root)/, prefixSelector); 1616 }; 1617 exports.prefixWrapCSSSelector = prefixWrapCSSSelector; 1618 1619 1620 /***/ }), 1621 1622 /***/ 3467: 1623 /***/ ((__unused_webpack_module, exports) => { 1624 1625 "use strict"; 1626 1627 Object.defineProperty(exports, "__esModule", ({ value: true })); 1628 exports.cssRuleMatchesPrefixSelector = exports.isNotRootTag = exports.isKeyframes = exports.cleanSelector = exports.isValidCSSSelector = void 0; 1629 const ANY_WHITESPACE_AT_BEGINNING_OR_END = /(^\s*|\s*$)/g; 1630 const IS_ROOT_TAG = /^(body|html|:root).*$/; 1631 const isValidCSSSelector = (cssSelector) => { 1632 return cssSelector !== null; 1633 }; 1634 exports.isValidCSSSelector = isValidCSSSelector; 1635 const cleanSelector = (cssSelector) => { 1636 return cssSelector.replace(ANY_WHITESPACE_AT_BEGINNING_OR_END, ""); 1637 }; 1638 exports.cleanSelector = cleanSelector; 1639 const isKeyframes = (cssRule) => { 1640 const { parent } = cssRule; 1641 const parentReal = parent; 1642 // @see https://developer.mozilla.org/en-US/docs/Web/CSS/At-rule 1643 return (parent !== undefined && 1644 parentReal.type === "atrule" && 1645 parentReal.name !== undefined && 1646 parentReal.name.match(/keyframes$/) !== null); 1647 }; 1648 exports.isKeyframes = isKeyframes; 1649 const isNotRootTag = (cleanSelector) => { 1650 return !cleanSelector.match(IS_ROOT_TAG); 1651 }; 1652 exports.isNotRootTag = isNotRootTag; 1653 const cssRuleMatchesPrefixSelector = (cssRule, prefixSelector) => { 1654 const escapedPrefixSelector = prefixSelector.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); 1655 // eslint-disable-next-line security-node/non-literal-reg-expr 1656 const isPrefixSelector = new RegExp(`^$escapedPrefixSelector}$`); 1657 return isPrefixSelector.test(cssRule.selector); 1658 }; 1659 exports.cssRuleMatchesPrefixSelector = cssRuleMatchesPrefixSelector; 1660 1661 1662 /***/ }), 1663 1664 /***/ 9411: 1665 /***/ ((__unused_webpack_module, exports) => { 1666 1667 "use strict"; 1668 1669 Object.defineProperty(exports, "__esModule", ({ value: true })); 1670 exports.shouldIncludeFilePath = void 0; 1671 const shouldIncludeFilePath = (filePath, whitelist, blacklist) => { 1672 // If whitelist exists, check if rule is contained within it. 1673 if (whitelist.length > 0) { 1674 return (filePath != undefined && 1675 whitelist.some((currentValue) => filePath.match(currentValue))); 1676 } 1677 // If blacklist exists, check if rule is not contained within it. 1678 if (blacklist.length > 0) { 1679 return !(filePath != undefined && 1680 blacklist.some((currentValue) => filePath.match(currentValue))); 1681 } 1682 // In all other cases, presume rule should be prefixed. 1683 return true; 1684 }; 1685 exports.shouldIncludeFilePath = shouldIncludeFilePath; 1686 1687 1688 /***/ }), 1689 1690 /***/ 8061: 1691 /***/ (function(__unused_webpack_module, exports, __webpack_require__) { 1692 1693 "use strict"; 1694 1695 var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { 1696 if (k2 === undefined) k2 = k; 1697 var desc = Object.getOwnPropertyDescriptor(m, k); 1698 if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { 1699 desc = { enumerable: true, get: function() { return m[k]; } }; 1700 } 1701 Object.defineProperty(o, k2, desc); 1702 }) : (function(o, m, k, k2) { 1703 if (k2 === undefined) k2 = k; 1704 o[k2] = m[k]; 1705 })); 1706 var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { 1707 Object.defineProperty(o, "default", { enumerable: true, value: v }); 1708 }) : function(o, v) { 1709 o["default"] = v; 1710 }); 1711 var __importStar = (this && this.__importStar) || function (mod) { 1712 if (mod && mod.__esModule) return mod; 1713 var result = {}; 1714 if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); 1715 __setModuleDefault(result, mod); 1716 return result; 1717 }; 1718 Object.defineProperty(exports, "__esModule", ({ value: true })); 1719 exports.asPostCSSv7PluginGenerator = void 0; 1720 const PostCSSPrefixWrap_1 = __importStar(__webpack_require__(1311)); 1721 const asPostCSSv7PluginGenerator = (postcss) => { 1722 return postcss.plugin(PostCSSPrefixWrap_1.PLUGIN_NAME, (prefixSelector, options) => { 1723 return new PostCSSPrefixWrap_1.default(prefixSelector, options).prefix(); 1724 }); 1725 }; 1726 exports.asPostCSSv7PluginGenerator = asPostCSSv7PluginGenerator; 1727 1728 1729 /***/ }), 1730 1731 /***/ 2888: 1732 /***/ (function(__unused_webpack_module, exports, __webpack_require__) { 1733 1734 "use strict"; 1735 1736 var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { 1737 if (k2 === undefined) k2 = k; 1738 var desc = Object.getOwnPropertyDescriptor(m, k); 1739 if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { 1740 desc = { enumerable: true, get: function() { return m[k]; } }; 1741 } 1742 Object.defineProperty(o, k2, desc); 1743 }) : (function(o, m, k, k2) { 1744 if (k2 === undefined) k2 = k; 1745 o[k2] = m[k]; 1746 })); 1747 var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { 1748 Object.defineProperty(o, "default", { enumerable: true, value: v }); 1749 }) : function(o, v) { 1750 o["default"] = v; 1751 }); 1752 var __importStar = (this && this.__importStar) || function (mod) { 1753 if (mod && mod.__esModule) return mod; 1754 var result = {}; 1755 if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); 1756 __setModuleDefault(result, mod); 1757 return result; 1758 }; 1759 Object.defineProperty(exports, "__esModule", ({ value: true })); 1760 exports.asPostCSSv8PluginGenerator = exports.isPostCSSv8 = void 0; 1761 const PostCSSPrefixWrap_1 = __importStar(__webpack_require__(1311)); 1762 const isPostCSSv8 = (postcss) => postcss.Root !== undefined; 1763 exports.isPostCSSv8 = isPostCSSv8; 1764 const asPostCSSv8PluginGenerator = () => { 1765 return (prefixSelector, options) => { 1766 const plugin = new PostCSSPrefixWrap_1.default(prefixSelector, options); 1767 return { 1768 postcssPlugin: PostCSSPrefixWrap_1.PLUGIN_NAME, 1769 Once(root) { 1770 plugin.prefixRoot(root); 1771 }, 1772 }; 1773 }; 1774 }; 1775 exports.asPostCSSv8PluginGenerator = asPostCSSv8PluginGenerator; 1776 1777 1778 /***/ }), 1779 1780 /***/ 3576: 1781 /***/ ((module, __unused_webpack_exports, __webpack_require__) => { 1782 1783 "use strict"; 1784 1785 const PostCSS8Plugin_1 = __webpack_require__(2888); 1786 const PostCSS7Plugin_1 = __webpack_require__(8061); 1787 module.exports = (postcss) => { 1788 if ((0, PostCSS8Plugin_1.isPostCSSv8)(postcss)) { 1789 return (0, PostCSS8Plugin_1.asPostCSSv8PluginGenerator)(); 1790 } 1791 else { 1792 return (0, PostCSS7Plugin_1.asPostCSSv7PluginGenerator)(postcss); 1793 } 1794 }; 1795 1796 1797 /***/ }), 1798 1799 /***/ 1311: 1800 /***/ ((__unused_webpack_module, exports, __webpack_require__) => { 1801 1802 "use strict"; 1803 1804 Object.defineProperty(exports, "__esModule", ({ value: true })); 1805 exports.PLUGIN_NAME = void 0; 1806 const CSSRuleWrapper_1 = __webpack_require__(5525); 1807 const FileIncludeList_1 = __webpack_require__(9411); 1808 exports.PLUGIN_NAME = "postcss-prefixwrap"; 1809 class PostCSSPrefixWrap { 1810 blacklist; 1811 ignoredSelectors; 1812 isPrefixSelector; 1813 prefixRootTags; 1814 prefixSelector; 1815 whitelist; 1816 nested; 1817 constructor(prefixSelector, options = {}) { 1818 this.blacklist = options.blacklist ?? []; 1819 this.ignoredSelectors = options.ignoredSelectors ?? []; 1820 this.isPrefixSelector = new RegExp( 1821 // eslint-disable-next-line security-node/non-literal-reg-expr 1822 `^$prefixSelector.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}$`); 1823 this.prefixRootTags = options.prefixRootTags ?? false; 1824 this.prefixSelector = prefixSelector; 1825 this.whitelist = options.whitelist ?? []; 1826 this.nested = options.nested ?? null; 1827 } 1828 prefixRoot(css) { 1829 if ((0, FileIncludeList_1.shouldIncludeFilePath)(css.source?.input?.file, this.whitelist, this.blacklist)) { 1830 css.walkRules((cssRule) => { 1831 (0, CSSRuleWrapper_1.prefixWrapCSSRule)(cssRule, this.nested, this.ignoredSelectors, this.prefixSelector, this.prefixRootTags); 1832 }); 1833 } 1834 } 1835 prefix() { 1836 return (css) => { 1837 this.prefixRoot(css); 1838 }; 1839 } 1840 } 1841 exports["default"] = PostCSSPrefixWrap; 1842 1843 1844 /***/ }), 1845 1846 /***/ 5404: 1847 /***/ ((module, __unused_webpack_exports, __webpack_require__) => { 1848 1849 const CSSValueParser = __webpack_require__(1544) 1850 1851 /** 1852 * @type {import('postcss').PluginCreator} 1853 */ 1854 module.exports = (opts) => { 1855 1856 const DEFAULTS = { 1857 skipHostRelativeUrls: true, 1858 } 1859 const config = Object.assign(DEFAULTS, opts) 1860 1861 return { 1862 postcssPlugin: 'rebaseUrl', 1863 1864 Declaration(decl) { 1865 // The faster way to find Declaration node 1866 const parsedValue = CSSValueParser(decl.value) 1867 1868 let valueChanged = false 1869 parsedValue.walk(node => { 1870 if (node.type !== 'function' || node.value !== 'url') { 1871 return 1872 } 1873 1874 const urlVal = node.nodes[0].value 1875 1876 // bases relative URLs with rootUrl 1877 const basedUrl = new URL(urlVal, opts.rootUrl) 1878 1879 // skip host-relative, already normalized URLs (e.g. `/images/image.jpg`, without `..`s) 1880 if ((basedUrl.pathname === urlVal) && config.skipHostRelativeUrls) { 1881 return false // skip this value 1882 } 1883 1884 node.nodes[0].value = basedUrl.toString() 1885 valueChanged = true 1886 1887 return false // do not walk deeper 1888 }) 1889 1890 if (valueChanged) { 1891 decl.value = CSSValueParser.stringify(parsedValue) 1892 } 1893 1894 } 1895 } 1896 } 1897 1898 module.exports.postcss = true 1899 1900 1901 /***/ }), 1902 1903 /***/ 1544: 1904 /***/ ((module, __unused_webpack_exports, __webpack_require__) => { 1905 1906 var parse = __webpack_require__(8491); 1907 var walk = __webpack_require__(3815); 1908 var stringify = __webpack_require__(4725); 1909 1910 function ValueParser(value) { 1911 if (this instanceof ValueParser) { 1912 this.nodes = parse(value); 1913 return this; 1914 } 1915 return new ValueParser(value); 1916 } 1917 1918 ValueParser.prototype.toString = function() { 1919 return Array.isArray(this.nodes) ? stringify(this.nodes) : ""; 1920 }; 1921 1922 ValueParser.prototype.walk = function(cb, bubble) { 1923 walk(this.nodes, cb, bubble); 1924 return this; 1925 }; 1926 1927 ValueParser.unit = __webpack_require__(1524); 1928 1929 ValueParser.walk = walk; 1930 1931 ValueParser.stringify = stringify; 1932 1933 module.exports = ValueParser; 1934 1935 1936 /***/ }), 1937 1938 /***/ 8491: 1939 /***/ ((module) => { 1940 1941 var openParentheses = "(".charCodeAt(0); 1942 var closeParentheses = ")".charCodeAt(0); 1943 var singleQuote = "'".charCodeAt(0); 1944 var doubleQuote = '"'.charCodeAt(0); 1945 var backslash = "\\".charCodeAt(0); 1946 var slash = "/".charCodeAt(0); 1947 var comma = ",".charCodeAt(0); 1948 var colon = ":".charCodeAt(0); 1949 var star = "*".charCodeAt(0); 1950 var uLower = "u".charCodeAt(0); 1951 var uUpper = "U".charCodeAt(0); 1952 var plus = "+".charCodeAt(0); 1953 var isUnicodeRange = /^[a-f0-9?-]+$/i; 1954 1955 module.exports = function(input) { 1956 var tokens = []; 1957 var value = input; 1958 1959 var next, 1960 quote, 1961 prev, 1962 token, 1963 escape, 1964 escapePos, 1965 whitespacePos, 1966 parenthesesOpenPos; 1967 var pos = 0; 1968 var code = value.charCodeAt(pos); 1969 var max = value.length; 1970 var stack = [{ nodes: tokens }]; 1971 var balanced = 0; 1972 var parent; 1973 1974 var name = ""; 1975 var before = ""; 1976 var after = ""; 1977 1978 while (pos < max) { 1979 // Whitespaces 1980 if (code <= 32) { 1981 next = pos; 1982 do { 1983 next += 1; 1984 code = value.charCodeAt(next); 1985 } while (code <= 32); 1986 token = value.slice(pos, next); 1987 1988 prev = tokens[tokens.length - 1]; 1989 if (code === closeParentheses && balanced) { 1990 after = token; 1991 } else if (prev && prev.type === "div") { 1992 prev.after = token; 1993 prev.sourceEndIndex += token.length; 1994 } else if ( 1995 code === comma || 1996 code === colon || 1997 (code === slash && 1998 value.charCodeAt(next + 1) !== star && 1999 (!parent || 2000 (parent && parent.type === "function" && parent.value !== "calc"))) 2001 ) { 2002 before = token; 2003 } else { 2004 tokens.push({ 2005 type: "space", 2006 sourceIndex: pos, 2007 sourceEndIndex: next, 2008 value: token 2009 }); 2010 } 2011 2012 pos = next; 2013 2014 // Quotes 2015 } else if (code === singleQuote || code === doubleQuote) { 2016 next = pos; 2017 quote = code === singleQuote ? "'" : '"'; 2018 token = { 2019 type: "string", 2020 sourceIndex: pos, 2021 quote: quote 2022 }; 2023 do { 2024 escape = false; 2025 next = value.indexOf(quote, next + 1); 2026 if (~next) { 2027 escapePos = next; 2028 while (value.charCodeAt(escapePos - 1) === backslash) { 2029 escapePos -= 1; 2030 escape = !escape; 2031 } 2032 } else { 2033 value += quote; 2034 next = value.length - 1; 2035 token.unclosed = true; 2036 } 2037 } while (escape); 2038 token.value = value.slice(pos + 1, next); 2039 token.sourceEndIndex = token.unclosed ? next : next + 1; 2040 tokens.push(token); 2041 pos = next + 1; 2042 code = value.charCodeAt(pos); 2043 2044 // Comments 2045 } else if (code === slash && value.charCodeAt(pos + 1) === star) { 2046 next = value.indexOf("*/", pos); 2047 2048 token = { 2049 type: "comment", 2050 sourceIndex: pos, 2051 sourceEndIndex: next + 2 2052 }; 2053 2054 if (next === -1) { 2055 token.unclosed = true; 2056 next = value.length; 2057 token.sourceEndIndex = next; 2058 } 2059 2060 token.value = value.slice(pos + 2, next); 2061 tokens.push(token); 2062 2063 pos = next + 2; 2064 code = value.charCodeAt(pos); 2065 2066 // Operation within calc 2067 } else if ( 2068 (code === slash || code === star) && 2069 parent && 2070 parent.type === "function" && 2071 parent.value === "calc" 2072 ) { 2073 token = value[pos]; 2074 tokens.push({ 2075 type: "word", 2076 sourceIndex: pos - before.length, 2077 sourceEndIndex: pos + token.length, 2078 value: token 2079 }); 2080 pos += 1; 2081 code = value.charCodeAt(pos); 2082 2083 // Dividers 2084 } else if (code === slash || code === comma || code === colon) { 2085 token = value[pos]; 2086 2087 tokens.push({ 2088 type: "div", 2089 sourceIndex: pos - before.length, 2090 sourceEndIndex: pos + token.length, 2091 value: token, 2092 before: before, 2093 after: "" 2094 }); 2095 before = ""; 2096 2097 pos += 1; 2098 code = value.charCodeAt(pos); 2099 2100 // Open parentheses 2101 } else if (openParentheses === code) { 2102 // Whitespaces after open parentheses 2103 next = pos; 2104 do { 2105 next += 1; 2106 code = value.charCodeAt(next); 2107 } while (code <= 32); 2108 parenthesesOpenPos = pos; 2109 token = { 2110 type: "function", 2111 sourceIndex: pos - name.length, 2112 value: name, 2113 before: value.slice(parenthesesOpenPos + 1, next) 2114 }; 2115 pos = next; 2116 2117 if (name === "url" && code !== singleQuote && code !== doubleQuote) { 2118 next -= 1; 2119 do { 2120 escape = false; 2121 next = value.indexOf(")", next + 1); 2122 if (~next) { 2123 escapePos = next; 2124 while (value.charCodeAt(escapePos - 1) === backslash) { 2125 escapePos -= 1; 2126 escape = !escape; 2127 } 2128 } else { 2129 value += ")"; 2130 next = value.length - 1; 2131 token.unclosed = true; 2132 } 2133 } while (escape); 2134 // Whitespaces before closed 2135 whitespacePos = next; 2136 do { 2137 whitespacePos -= 1; 2138 code = value.charCodeAt(whitespacePos); 2139 } while (code <= 32); 2140 if (parenthesesOpenPos < whitespacePos) { 2141 if (pos !== whitespacePos + 1) { 2142 token.nodes = [ 2143 { 2144 type: "word", 2145 sourceIndex: pos, 2146 sourceEndIndex: whitespacePos + 1, 2147 value: value.slice(pos, whitespacePos + 1) 2148 } 2149 ]; 2150 } else { 2151 token.nodes = []; 2152 } 2153 if (token.unclosed && whitespacePos + 1 !== next) { 2154 token.after = ""; 2155 token.nodes.push({ 2156 type: "space", 2157 sourceIndex: whitespacePos + 1, 2158 sourceEndIndex: next, 2159 value: value.slice(whitespacePos + 1, next) 2160 }); 2161 } else { 2162 token.after = value.slice(whitespacePos + 1, next); 2163 token.sourceEndIndex = next; 2164 } 2165 } else { 2166 token.after = ""; 2167 token.nodes = []; 2168 } 2169 pos = next + 1; 2170 token.sourceEndIndex = token.unclosed ? next : pos; 2171 code = value.charCodeAt(pos); 2172 tokens.push(token); 2173 } else { 2174 balanced += 1; 2175 token.after = ""; 2176 token.sourceEndIndex = pos + 1; 2177 tokens.push(token); 2178 stack.push(token); 2179 tokens = token.nodes = []; 2180 parent = token; 2181 } 2182 name = ""; 2183 2184 // Close parentheses 2185 } else if (closeParentheses === code && balanced) { 2186 pos += 1; 2187 code = value.charCodeAt(pos); 2188 2189 parent.after = after; 2190 parent.sourceEndIndex += after.length; 2191 after = ""; 2192 balanced -= 1; 2193 stack[stack.length - 1].sourceEndIndex = pos; 2194 stack.pop(); 2195 parent = stack[balanced]; 2196 tokens = parent.nodes; 2197 2198 // Words 2199 } else { 2200 next = pos; 2201 do { 2202 if (code === backslash) { 2203 next += 1; 2204 } 2205 next += 1; 2206 code = value.charCodeAt(next); 2207 } while ( 2208 next < max && 2209 !( 2210 code <= 32 || 2211 code === singleQuote || 2212 code === doubleQuote || 2213 code === comma || 2214 code === colon || 2215 code === slash || 2216 code === openParentheses || 2217 (code === star && 2218 parent && 2219 parent.type === "function" && 2220 parent.value === "calc") || 2221 (code === slash && 2222 parent.type === "function" && 2223 parent.value === "calc") || 2224 (code === closeParentheses && balanced) 2225 ) 2226 ); 2227 token = value.slice(pos, next); 2228 2229 if (openParentheses === code) { 2230 name = token; 2231 } else if ( 2232 (uLower === token.charCodeAt(0) || uUpper === token.charCodeAt(0)) && 2233 plus === token.charCodeAt(1) && 2234 isUnicodeRange.test(token.slice(2)) 2235 ) { 2236 tokens.push({ 2237 type: "unicode-range", 2238 sourceIndex: pos, 2239 sourceEndIndex: next, 2240 value: token 2241 }); 2242 } else { 2243 tokens.push({ 2244 type: "word", 2245 sourceIndex: pos, 2246 sourceEndIndex: next, 2247 value: token 2248 }); 2249 } 2250 2251 pos = next; 2252 } 2253 } 2254 2255 for (pos = stack.length - 1; pos; pos -= 1) { 2256 stack[pos].unclosed = true; 2257 stack[pos].sourceEndIndex = value.length; 2258 } 2259 2260 return stack[0].nodes; 2261 }; 2262 2263 2264 /***/ }), 2265 2266 /***/ 4725: 2267 /***/ ((module) => { 2268 2269 function stringifyNode(node, custom) { 2270 var type = node.type; 2271 var value = node.value; 2272 var buf; 2273 var customResult; 2274 2275 if (custom && (customResult = custom(node)) !== undefined) { 2276 return customResult; 2277 } else if (type === "word" || type === "space") { 2278 return value; 2279 } else if (type === "string") { 2280 buf = node.quote || ""; 2281 return buf + value + (node.unclosed ? "" : buf); 2282 } else if (type === "comment") { 2283 return "/*" + value + (node.unclosed ? "" : "*/"); 2284 } else if (type === "div") { 2285 return (node.before || "") + value + (node.after || ""); 2286 } else if (Array.isArray(node.nodes)) { 2287 buf = stringify(node.nodes, custom); 2288 if (type !== "function") { 2289 return buf; 2290 } 2291 return ( 2292 value + 2293 "(" + 2294 (node.before || "") + 2295 buf + 2296 (node.after || "") + 2297 (node.unclosed ? "" : ")") 2298 ); 2299 } 2300 return value; 2301 } 2302 2303 function stringify(nodes, custom) { 2304 var result, i; 2305 2306 if (Array.isArray(nodes)) { 2307 result = ""; 2308 for (i = nodes.length - 1; ~i; i -= 1) { 2309 result = stringifyNode(nodes[i], custom) + result; 2310 } 2311 return result; 2312 } 2313 return stringifyNode(nodes, custom); 2314 } 2315 2316 module.exports = stringify; 2317 2318 2319 /***/ }), 2320 2321 /***/ 1524: 2322 /***/ ((module) => { 2323 2324 var minus = "-".charCodeAt(0); 2325 var plus = "+".charCodeAt(0); 2326 var dot = ".".charCodeAt(0); 2327 var exp = "e".charCodeAt(0); 2328 var EXP = "E".charCodeAt(0); 2329 2330 // Check if three code points would start a number 2331 // https://www.w3.org/TR/css-syntax-3/#starts-with-a-number 2332 function likeNumber(value) { 2333 var code = value.charCodeAt(0); 2334 var nextCode; 2335 2336 if (code === plus || code === minus) { 2337 nextCode = value.charCodeAt(1); 2338 2339 if (nextCode >= 48 && nextCode <= 57) { 2340 return true; 2341 } 2342 2343 var nextNextCode = value.charCodeAt(2); 2344 2345 if (nextCode === dot && nextNextCode >= 48 && nextNextCode <= 57) { 2346 return true; 2347 } 2348 2349 return false; 2350 } 2351 2352 if (code === dot) { 2353 nextCode = value.charCodeAt(1); 2354 2355 if (nextCode >= 48 && nextCode <= 57) { 2356 return true; 2357 } 2358 2359 return false; 2360 } 2361 2362 if (code >= 48 && code <= 57) { 2363 return true; 2364 } 2365 2366 return false; 2367 } 2368 2369 // Consume a number 2370 // https://www.w3.org/TR/css-syntax-3/#consume-number 2371 module.exports = function(value) { 2372 var pos = 0; 2373 var length = value.length; 2374 var code; 2375 var nextCode; 2376 var nextNextCode; 2377 2378 if (length === 0 || !likeNumber(value)) { 2379 return false; 2380 } 2381 2382 code = value.charCodeAt(pos); 2383 2384 if (code === plus || code === minus) { 2385 pos++; 2386 } 2387 2388 while (pos < length) { 2389 code = value.charCodeAt(pos); 2390 2391 if (code < 48 || code > 57) { 2392 break; 2393 } 2394 2395 pos += 1; 2396 } 2397 2398 code = value.charCodeAt(pos); 2399 nextCode = value.charCodeAt(pos + 1); 2400 2401 if (code === dot && nextCode >= 48 && nextCode <= 57) { 2402 pos += 2; 2403 2404 while (pos < length) { 2405 code = value.charCodeAt(pos); 2406 2407 if (code < 48 || code > 57) { 2408 break; 2409 } 2410 2411 pos += 1; 2412 } 2413 } 2414 2415 code = value.charCodeAt(pos); 2416 nextCode = value.charCodeAt(pos + 1); 2417 nextNextCode = value.charCodeAt(pos + 2); 2418 2419 if ( 2420 (code === exp || code === EXP) && 2421 ((nextCode >= 48 && nextCode <= 57) || 2422 ((nextCode === plus || nextCode === minus) && 2423 nextNextCode >= 48 && 2424 nextNextCode <= 57)) 2425 ) { 2426 pos += nextCode === plus || nextCode === minus ? 3 : 2; 2427 2428 while (pos < length) { 2429 code = value.charCodeAt(pos); 2430 2431 if (code < 48 || code > 57) { 2432 break; 2433 } 2434 2435 pos += 1; 2436 } 2437 } 2438 2439 return { 2440 number: value.slice(0, pos), 2441 unit: value.slice(pos) 2442 }; 2443 }; 2444 2445 2446 /***/ }), 2447 2448 /***/ 3815: 2449 /***/ ((module) => { 2450 2451 module.exports = function walk(nodes, cb, bubble) { 2452 var i, max, node, result; 2453 2454 for (i = 0, max = nodes.length; i < max; i += 1) { 2455 node = nodes[i]; 2456 if (!bubble) { 2457 result = cb(node, i, nodes); 2458 } 2459 2460 if ( 2461 result !== false && 2462 node.type === "function" && 2463 Array.isArray(node.nodes) 2464 ) { 2465 walk(node.nodes, cb, bubble); 2466 } 2467 2468 if (bubble) { 2469 cb(node, i, nodes); 2470 } 2471 } 2472 }; 2473 2474 2475 /***/ }), 2476 2477 /***/ 1326: 2478 /***/ ((module, __unused_webpack_exports, __webpack_require__) => { 2479 2480 "use strict"; 2481 2482 2483 let Container = __webpack_require__(683) 2484 2485 class AtRule extends Container { 2486 constructor(defaults) { 2487 super(defaults) 2488 this.type = 'atrule' 2489 } 2490 2491 append(...children) { 2492 if (!this.proxyOf.nodes) this.nodes = [] 2493 return super.append(...children) 2494 } 2495 2496 prepend(...children) { 2497 if (!this.proxyOf.nodes) this.nodes = [] 2498 return super.prepend(...children) 2499 } 2500 } 2501 2502 module.exports = AtRule 2503 AtRule.default = AtRule 2504 2505 Container.registerAtRule(AtRule) 2506 2507 2508 /***/ }), 2509 2510 /***/ 6589: 2511 /***/ ((module, __unused_webpack_exports, __webpack_require__) => { 2512 2513 "use strict"; 2514 2515 2516 let Node = __webpack_require__(7490) 2517 2518 class Comment extends Node { 2519 constructor(defaults) { 2520 super(defaults) 2521 this.type = 'comment' 2522 } 2523 } 2524 2525 module.exports = Comment 2526 Comment.default = Comment 2527 2528 2529 /***/ }), 2530 2531 /***/ 683: 2532 /***/ ((module, __unused_webpack_exports, __webpack_require__) => { 2533 2534 "use strict"; 2535 2536 2537 let { isClean, my } = __webpack_require__(1381) 2538 let Declaration = __webpack_require__(1516) 2539 let Comment = __webpack_require__(6589) 2540 let Node = __webpack_require__(7490) 2541 2542 let parse, Rule, AtRule, Root 2543 2544 function cleanSource(nodes) { 2545 return nodes.map(i => { 2546 if (i.nodes) i.nodes = cleanSource(i.nodes) 2547 delete i.source 2548 return i 2549 }) 2550 } 2551 2552 function markDirtyUp(node) { 2553 node[isClean] = false 2554 if (node.proxyOf.nodes) { 2555 for (let i of node.proxyOf.nodes) { 2556 markDirtyUp(i) 2557 } 2558 } 2559 } 2560 2561 class Container extends Node { 2562 append(...children) { 2563 for (let child of children) { 2564 let nodes = this.normalize(child, this.last) 2565 for (let node of nodes) this.proxyOf.nodes.push(node) 2566 } 2567 2568 this.markDirty() 2569 2570 return this 2571 } 2572 2573 cleanRaws(keepBetween) { 2574 super.cleanRaws(keepBetween) 2575 if (this.nodes) { 2576 for (let node of this.nodes) node.cleanRaws(keepBetween) 2577 } 2578 } 2579 2580 each(callback) { 2581 if (!this.proxyOf.nodes) return undefined 2582 let iterator = this.getIterator() 2583 2584 let index, result 2585 while (this.indexes[iterator] < this.proxyOf.nodes.length) { 2586 index = this.indexes[iterator] 2587 result = callback(this.proxyOf.nodes[index], index) 2588 if (result === false) break 2589 2590 this.indexes[iterator] += 1 2591 } 2592 2593 delete this.indexes[iterator] 2594 return result 2595 } 2596 2597 every(condition) { 2598 return this.nodes.every(condition) 2599 } 2600 2601 getIterator() { 2602 if (!this.lastEach) this.lastEach = 0 2603 if (!this.indexes) this.indexes = {} 2604 2605 this.lastEach += 1 2606 let iterator = this.lastEach 2607 this.indexes[iterator] = 0 2608 2609 return iterator 2610 } 2611 2612 getProxyProcessor() { 2613 return { 2614 get(node, prop) { 2615 if (prop === 'proxyOf') { 2616 return node 2617 } else if (!node[prop]) { 2618 return node[prop] 2619 } else if ( 2620 prop === 'each' || 2621 (typeof prop === 'string' && prop.startsWith('walk')) 2622 ) { 2623 return (...args) => { 2624 return node[prop]( 2625 ...args.map(i => { 2626 if (typeof i === 'function') { 2627 return (child, index) => i(child.toProxy(), index) 2628 } else { 2629 return i 2630 } 2631 }) 2632 ) 2633 } 2634 } else if (prop === 'every' || prop === 'some') { 2635 return cb => { 2636 return node[prop]((child, ...other) => 2637 cb(child.toProxy(), ...other) 2638 ) 2639 } 2640 } else if (prop === 'root') { 2641 return () => node.root().toProxy() 2642 } else if (prop === 'nodes') { 2643 return node.nodes.map(i => i.toProxy()) 2644 } else if (prop === 'first' || prop === 'last') { 2645 return node[prop].toProxy() 2646 } else { 2647 return node[prop] 2648 } 2649 }, 2650 2651 set(node, prop, value) { 2652 if (node[prop] === value) return true 2653 node[prop] = value 2654 if (prop === 'name' || prop === 'params' || prop === 'selector') { 2655 node.markDirty() 2656 } 2657 return true 2658 } 2659 } 2660 } 2661 2662 index(child) { 2663 if (typeof child === 'number') return child 2664 if (child.proxyOf) child = child.proxyOf 2665 return this.proxyOf.nodes.indexOf(child) 2666 } 2667 2668 insertAfter(exist, add) { 2669 let existIndex = this.index(exist) 2670 let nodes = this.normalize(add, this.proxyOf.nodes[existIndex]).reverse() 2671 existIndex = this.index(exist) 2672 for (let node of nodes) this.proxyOf.nodes.splice(existIndex + 1, 0, node) 2673 2674 let index 2675 for (let id in this.indexes) { 2676 index = this.indexes[id] 2677 if (existIndex < index) { 2678 this.indexes[id] = index + nodes.length 2679 } 2680 } 2681 2682 this.markDirty() 2683 2684 return this 2685 } 2686 2687 insertBefore(exist, add) { 2688 let existIndex = this.index(exist) 2689 let type = existIndex === 0 ? 'prepend' : false 2690 let nodes = this.normalize(add, this.proxyOf.nodes[existIndex], type).reverse() 2691 existIndex = this.index(exist) 2692 for (let node of nodes) this.proxyOf.nodes.splice(existIndex, 0, node) 2693 2694 let index 2695 for (let id in this.indexes) { 2696 index = this.indexes[id] 2697 if (existIndex <= index) { 2698 this.indexes[id] = index + nodes.length 2699 } 2700 } 2701 2702 this.markDirty() 2703 2704 return this 2705 } 2706 2707 normalize(nodes, sample) { 2708 if (typeof nodes === 'string') { 2709 nodes = cleanSource(parse(nodes).nodes) 2710 } else if (typeof nodes === 'undefined') { 2711 nodes = [] 2712 } else if (Array.isArray(nodes)) { 2713 nodes = nodes.slice(0) 2714 for (let i of nodes) { 2715 if (i.parent) i.parent.removeChild(i, 'ignore') 2716 } 2717 } else if (nodes.type === 'root' && this.type !== 'document') { 2718 nodes = nodes.nodes.slice(0) 2719 for (let i of nodes) { 2720 if (i.parent) i.parent.removeChild(i, 'ignore') 2721 } 2722 } else if (nodes.type) { 2723 nodes = [nodes] 2724 } else if (nodes.prop) { 2725 if (typeof nodes.value === 'undefined') { 2726 throw new Error('Value field is missed in node creation') 2727 } else if (typeof nodes.value !== 'string') { 2728 nodes.value = String(nodes.value) 2729 } 2730 nodes = [new Declaration(nodes)] 2731 } else if (nodes.selector) { 2732 nodes = [new Rule(nodes)] 2733 } else if (nodes.name) { 2734 nodes = [new AtRule(nodes)] 2735 } else if (nodes.text) { 2736 nodes = [new Comment(nodes)] 2737 } else { 2738 throw new Error('Unknown node type in node creation') 2739 } 2740 2741 let processed = nodes.map(i => { 2742 /* c8 ignore next */ 2743 if (!i[my]) Container.rebuild(i) 2744 i = i.proxyOf 2745 if (i.parent) i.parent.removeChild(i) 2746 if (i[isClean]) markDirtyUp(i) 2747 if (typeof i.raws.before === 'undefined') { 2748 if (sample && typeof sample.raws.before !== 'undefined') { 2749 i.raws.before = sample.raws.before.replace(/\S/g, '') 2750 } 2751 } 2752 i.parent = this.proxyOf 2753 return i 2754 }) 2755 2756 return processed 2757 } 2758 2759 prepend(...children) { 2760 children = children.reverse() 2761 for (let child of children) { 2762 let nodes = this.normalize(child, this.first, 'prepend').reverse() 2763 for (let node of nodes) this.proxyOf.nodes.unshift(node) 2764 for (let id in this.indexes) { 2765 this.indexes[id] = this.indexes[id] + nodes.length 2766 } 2767 } 2768 2769 this.markDirty() 2770 2771 return this 2772 } 2773 2774 push(child) { 2775 child.parent = this 2776 this.proxyOf.nodes.push(child) 2777 return this 2778 } 2779 2780 removeAll() { 2781 for (let node of this.proxyOf.nodes) node.parent = undefined 2782 this.proxyOf.nodes = [] 2783 2784 this.markDirty() 2785 2786 return this 2787 } 2788 2789 removeChild(child) { 2790 child = this.index(child) 2791 this.proxyOf.nodes[child].parent = undefined 2792 this.proxyOf.nodes.splice(child, 1) 2793 2794 let index 2795 for (let id in this.indexes) { 2796 index = this.indexes[id] 2797 if (index >= child) { 2798 this.indexes[id] = index - 1 2799 } 2800 } 2801 2802 this.markDirty() 2803 2804 return this 2805 } 2806 2807 replaceValues(pattern, opts, callback) { 2808 if (!callback) { 2809 callback = opts 2810 opts = {} 2811 } 2812 2813 this.walkDecls(decl => { 2814 if (opts.props && !opts.props.includes(decl.prop)) return 2815 if (opts.fast && !decl.value.includes(opts.fast)) return 2816 2817 decl.value = decl.value.replace(pattern, callback) 2818 }) 2819 2820 this.markDirty() 2821 2822 return this 2823 } 2824 2825 some(condition) { 2826 return this.nodes.some(condition) 2827 } 2828 2829 walk(callback) { 2830 return this.each((child, i) => { 2831 let result 2832 try { 2833 result = callback(child, i) 2834 } catch (e) { 2835 throw child.addToError(e) 2836 } 2837 if (result !== false && child.walk) { 2838 result = child.walk(callback) 2839 } 2840 2841 return result 2842 }) 2843 } 2844 2845 walkAtRules(name, callback) { 2846 if (!callback) { 2847 callback = name 2848 return this.walk((child, i) => { 2849 if (child.type === 'atrule') { 2850 return callback(child, i) 2851 } 2852 }) 2853 } 2854 if (name instanceof RegExp) { 2855 return this.walk((child, i) => { 2856 if (child.type === 'atrule' && name.test(child.name)) { 2857 return callback(child, i) 2858 } 2859 }) 2860 } 2861 return this.walk((child, i) => { 2862 if (child.type === 'atrule' && child.name === name) { 2863 return callback(child, i) 2864 } 2865 }) 2866 } 2867 2868 walkComments(callback) { 2869 return this.walk((child, i) => { 2870 if (child.type === 'comment') { 2871 return callback(child, i) 2872 } 2873 }) 2874 } 2875 2876 walkDecls(prop, callback) { 2877 if (!callback) { 2878 callback = prop 2879 return this.walk((child, i) => { 2880 if (child.type === 'decl') { 2881 return callback(child, i) 2882 } 2883 }) 2884 } 2885 if (prop instanceof RegExp) { 2886 return this.walk((child, i) => { 2887 if (child.type === 'decl' && prop.test(child.prop)) { 2888 return callback(child, i) 2889 } 2890 }) 2891 } 2892 return this.walk((child, i) => { 2893 if (child.type === 'decl' && child.prop === prop) { 2894 return callback(child, i) 2895 } 2896 }) 2897 } 2898 2899 walkRules(selector, callback) { 2900 if (!callback) { 2901 callback = selector 2902 2903 return this.walk((child, i) => { 2904 if (child.type === 'rule') { 2905 return callback(child, i) 2906 } 2907 }) 2908 } 2909 if (selector instanceof RegExp) { 2910 return this.walk((child, i) => { 2911 if (child.type === 'rule' && selector.test(child.selector)) { 2912 return callback(child, i) 2913 } 2914 }) 2915 } 2916 return this.walk((child, i) => { 2917 if (child.type === 'rule' && child.selector === selector) { 2918 return callback(child, i) 2919 } 2920 }) 2921 } 2922 2923 get first() { 2924 if (!this.proxyOf.nodes) return undefined 2925 return this.proxyOf.nodes[0] 2926 } 2927 2928 get last() { 2929 if (!this.proxyOf.nodes) return undefined 2930 return this.proxyOf.nodes[this.proxyOf.nodes.length - 1] 2931 } 2932 } 2933 2934 Container.registerParse = dependant => { 2935 parse = dependant 2936 } 2937 2938 Container.registerRule = dependant => { 2939 Rule = dependant 2940 } 2941 2942 Container.registerAtRule = dependant => { 2943 AtRule = dependant 2944 } 2945 2946 Container.registerRoot = dependant => { 2947 Root = dependant 2948 } 2949 2950 module.exports = Container 2951 Container.default = Container 2952 2953 /* c8 ignore start */ 2954 Container.rebuild = node => { 2955 if (node.type === 'atrule') { 2956 Object.setPrototypeOf(node, AtRule.prototype) 2957 } else if (node.type === 'rule') { 2958 Object.setPrototypeOf(node, Rule.prototype) 2959 } else if (node.type === 'decl') { 2960 Object.setPrototypeOf(node, Declaration.prototype) 2961 } else if (node.type === 'comment') { 2962 Object.setPrototypeOf(node, Comment.prototype) 2963 } else if (node.type === 'root') { 2964 Object.setPrototypeOf(node, Root.prototype) 2965 } 2966 2967 node[my] = true 2968 2969 if (node.nodes) { 2970 node.nodes.forEach(child => { 2971 Container.rebuild(child) 2972 }) 2973 } 2974 } 2975 /* c8 ignore stop */ 2976 2977 2978 /***/ }), 2979 2980 /***/ 356: 2981 /***/ ((module, __unused_webpack_exports, __webpack_require__) => { 2982 2983 "use strict"; 2984 2985 2986 let pico = __webpack_require__(2775) 2987 2988 let terminalHighlight = __webpack_require__(9746) 2989 2990 class CssSyntaxError extends Error { 2991 constructor(message, line, column, source, file, plugin) { 2992 super(message) 2993 this.name = 'CssSyntaxError' 2994 this.reason = message 2995 2996 if (file) { 2997 this.file = file 2998 } 2999 if (source) { 3000 this.source = source 3001 } 3002 if (plugin) { 3003 this.plugin = plugin 3004 } 3005 if (typeof line !== 'undefined' && typeof column !== 'undefined') { 3006 if (typeof line === 'number') { 3007 this.line = line 3008 this.column = column 3009 } else { 3010 this.line = line.line 3011 this.column = line.column 3012 this.endLine = column.line 3013 this.endColumn = column.column 3014 } 3015 } 3016 3017 this.setMessage() 3018 3019 if (Error.captureStackTrace) { 3020 Error.captureStackTrace(this, CssSyntaxError) 3021 } 3022 } 3023 3024 setMessage() { 3025 this.message = this.plugin ? this.plugin + ': ' : '' 3026 this.message += this.file ? this.file : '<css input>' 3027 if (typeof this.line !== 'undefined') { 3028 this.message += ':' + this.line + ':' + this.column 3029 } 3030 this.message += ': ' + this.reason 3031 } 3032 3033 showSourceCode(color) { 3034 if (!this.source) return '' 3035 3036 let css = this.source 3037 if (color == null) color = pico.isColorSupported 3038 if (terminalHighlight) { 3039 if (color) css = terminalHighlight(css) 3040 } 3041 3042 let lines = css.split(/\r?\n/) 3043 let start = Math.max(this.line - 3, 0) 3044 let end = Math.min(this.line + 2, lines.length) 3045 3046 let maxWidth = String(end).length 3047 3048 let mark, aside 3049 if (color) { 3050 let { bold, gray, red } = pico.createColors(true) 3051 mark = text => bold(red(text)) 3052 aside = text => gray(text) 3053 } else { 3054 mark = aside = str => str 3055 } 3056 3057 return lines 3058 .slice(start, end) 3059 .map((line, index) => { 3060 let number = start + 1 + index 3061 let gutter = ' ' + (' ' + number).slice(-maxWidth) + ' | ' 3062 if (number === this.line) { 3063 let spacing = 3064 aside(gutter.replace(/\d/g, ' ')) + 3065 line.slice(0, this.column - 1).replace(/[^\t]/g, ' ') 3066 return mark('>') + aside(gutter) + line + '\n ' + spacing + mark('^') 3067 } 3068 return ' ' + aside(gutter) + line 3069 }) 3070 .join('\n') 3071 } 3072 3073 toString() { 3074 let code = this.showSourceCode() 3075 if (code) { 3076 code = '\n\n' + code + '\n' 3077 } 3078 return this.name + ': ' + this.message + code 3079 } 3080 } 3081 3082 module.exports = CssSyntaxError 3083 CssSyntaxError.default = CssSyntaxError 3084 3085 3086 /***/ }), 3087 3088 /***/ 1516: 3089 /***/ ((module, __unused_webpack_exports, __webpack_require__) => { 3090 3091 "use strict"; 3092 3093 3094 let Node = __webpack_require__(7490) 3095 3096 class Declaration extends Node { 3097 constructor(defaults) { 3098 if ( 3099 defaults && 3100 typeof defaults.value !== 'undefined' && 3101 typeof defaults.value !== 'string' 3102 ) { 3103 defaults = { ...defaults, value: String(defaults.value) } 3104 } 3105 super(defaults) 3106 this.type = 'decl' 3107 } 3108 3109 get variable() { 3110 return this.prop.startsWith('--') || this.prop[0] === '$' 3111 } 3112 } 3113 3114 module.exports = Declaration 3115 Declaration.default = Declaration 3116 3117 3118 /***/ }), 3119 3120 /***/ 271: 3121 /***/ ((module, __unused_webpack_exports, __webpack_require__) => { 3122 3123 "use strict"; 3124 3125 3126 let Container = __webpack_require__(683) 3127 3128 let LazyResult, Processor 3129 3130 class Document extends Container { 3131 constructor(defaults) { 3132 // type needs to be passed to super, otherwise child roots won't be normalized correctly 3133 super({ type: 'document', ...defaults }) 3134 3135 if (!this.nodes) { 3136 this.nodes = [] 3137 } 3138 } 3139 3140 toResult(opts = {}) { 3141 let lazy = new LazyResult(new Processor(), this, opts) 3142 3143 return lazy.stringify() 3144 } 3145 } 3146 3147 Document.registerLazyResult = dependant => { 3148 LazyResult = dependant 3149 } 3150 3151 Document.registerProcessor = dependant => { 3152 Processor = dependant 3153 } 3154 3155 module.exports = Document 3156 Document.default = Document 3157 3158 3159 /***/ }), 3160 3161 /***/ 8940: 3162 /***/ ((module, __unused_webpack_exports, __webpack_require__) => { 3163 3164 "use strict"; 3165 3166 3167 let Declaration = __webpack_require__(1516) 3168 let PreviousMap = __webpack_require__(5696) 3169 let Comment = __webpack_require__(6589) 3170 let AtRule = __webpack_require__(1326) 3171 let Input = __webpack_require__(5380) 3172 let Root = __webpack_require__(9434) 3173 let Rule = __webpack_require__(4092) 3174 3175 function fromJSON(json, inputs) { 3176 if (Array.isArray(json)) return json.map(n => fromJSON(n)) 3177 3178 let { inputs: ownInputs, ...defaults } = json 3179 if (ownInputs) { 3180 inputs = [] 3181 for (let input of ownInputs) { 3182 let inputHydrated = { ...input, __proto__: Input.prototype } 3183 if (inputHydrated.map) { 3184 inputHydrated.map = { 3185 ...inputHydrated.map, 3186 __proto__: PreviousMap.prototype 3187 } 3188 } 3189 inputs.push(inputHydrated) 3190 } 3191 } 3192 if (defaults.nodes) { 3193 defaults.nodes = json.nodes.map(n => fromJSON(n, inputs)) 3194 } 3195 if (defaults.source) { 3196 let { inputId, ...source } = defaults.source 3197 defaults.source = source 3198 if (inputId != null) { 3199 defaults.source.input = inputs[inputId] 3200 } 3201 } 3202 if (defaults.type === 'root') { 3203 return new Root(defaults) 3204 } else if (defaults.type === 'decl') { 3205 return new Declaration(defaults) 3206 } else if (defaults.type === 'rule') { 3207 return new Rule(defaults) 3208 } else if (defaults.type === 'comment') { 3209 return new Comment(defaults) 3210 } else if (defaults.type === 'atrule') { 3211 return new AtRule(defaults) 3212 } else { 3213 throw new Error('Unknown node type: ' + json.type) 3214 } 3215 } 3216 3217 module.exports = fromJSON 3218 fromJSON.default = fromJSON 3219 3220 3221 /***/ }), 3222 3223 /***/ 5380: 3224 /***/ ((module, __unused_webpack_exports, __webpack_require__) => { 3225 3226 "use strict"; 3227 3228 3229 let { SourceMapConsumer, SourceMapGenerator } = __webpack_require__(1866) 3230 let { fileURLToPath, pathToFileURL } = __webpack_require__(2739) 3231 let { isAbsolute, resolve } = __webpack_require__(197) 3232 let { nanoid } = __webpack_require__(5042) 3233 3234 let terminalHighlight = __webpack_require__(9746) 3235 let CssSyntaxError = __webpack_require__(356) 3236 let PreviousMap = __webpack_require__(5696) 3237 3238 let fromOffsetCache = Symbol('fromOffsetCache') 3239 3240 let sourceMapAvailable = Boolean(SourceMapConsumer && SourceMapGenerator) 3241 let pathAvailable = Boolean(resolve && isAbsolute) 3242 3243 class Input { 3244 constructor(css, opts = {}) { 3245 if ( 3246 css === null || 3247 typeof css === 'undefined' || 3248 (typeof css === 'object' && !css.toString) 3249 ) { 3250 throw new Error(`PostCSS received $css} instead of CSS string`) 3251 } 3252 3253 this.css = css.toString() 3254 3255 if (this.css[0] === '\uFEFF' || this.css[0] === '\uFFFE') { 3256 this.hasBOM = true 3257 this.css = this.css.slice(1) 3258 } else { 3259 this.hasBOM = false 3260 } 3261 3262 if (opts.from) { 3263 if ( 3264 !pathAvailable || 3265 /^\w+:\/\//.test(opts.from) || 3266 isAbsolute(opts.from) 3267 ) { 3268 this.file = opts.from 3269 } else { 3270 this.file = resolve(opts.from) 3271 } 3272 } 3273 3274 if (pathAvailable && sourceMapAvailable) { 3275 let map = new PreviousMap(this.css, opts) 3276 if (map.text) { 3277 this.map = map 3278 let file = map.consumer().file 3279 if (!this.file && file) this.file = this.mapResolve(file) 3280 } 3281 } 3282 3283 if (!this.file) { 3284 this.id = '<input css ' + nanoid(6) + '>' 3285 } 3286 if (this.map) this.map.file = this.from 3287 } 3288 3289 error(message, line, column, opts = {}) { 3290 let result, endLine, endColumn 3291 3292 if (line && typeof line === 'object') { 3293 let start = line 3294 let end = column 3295 if (typeof start.offset === 'number') { 3296 let pos = this.fromOffset(start.offset) 3297 line = pos.line 3298 column = pos.col 3299 } else { 3300 line = start.line 3301 column = start.column 3302 } 3303 if (typeof end.offset === 'number') { 3304 let pos = this.fromOffset(end.offset) 3305 endLine = pos.line 3306 endColumn = pos.col 3307 } else { 3308 endLine = end.line 3309 endColumn = end.column 3310 } 3311 } else if (!column) { 3312 let pos = this.fromOffset(line) 3313 line = pos.line 3314 column = pos.col 3315 } 3316 3317 let origin = this.origin(line, column, endLine, endColumn) 3318 if (origin) { 3319 result = new CssSyntaxError( 3320 message, 3321 origin.endLine === undefined 3322 ? origin.line 3323 : { column: origin.column, line: origin.line }, 3324 origin.endLine === undefined 3325 ? origin.column 3326 : { column: origin.endColumn, line: origin.endLine }, 3327 origin.source, 3328 origin.file, 3329 opts.plugin 3330 ) 3331 } else { 3332 result = new CssSyntaxError( 3333 message, 3334 endLine === undefined ? line : { column, line }, 3335 endLine === undefined ? column : { column: endColumn, line: endLine }, 3336 this.css, 3337 this.file, 3338 opts.plugin 3339 ) 3340 } 3341 3342 result.input = { column, endColumn, endLine, line, source: this.css } 3343 if (this.file) { 3344 if (pathToFileURL) { 3345 result.input.url = pathToFileURL(this.file).toString() 3346 } 3347 result.input.file = this.file 3348 } 3349 3350 return result 3351 } 3352 3353 fromOffset(offset) { 3354 let lastLine, lineToIndex 3355 if (!this[fromOffsetCache]) { 3356 let lines = this.css.split('\n') 3357 lineToIndex = new Array(lines.length) 3358 let prevIndex = 0 3359 3360 for (let i = 0, l = lines.length; i < l; i++) { 3361 lineToIndex[i] = prevIndex 3362 prevIndex += lines[i].length + 1 3363 } 3364 3365 this[fromOffsetCache] = lineToIndex 3366 } else { 3367 lineToIndex = this[fromOffsetCache] 3368 } 3369 lastLine = lineToIndex[lineToIndex.length - 1] 3370 3371 let min = 0 3372 if (offset >= lastLine) { 3373 min = lineToIndex.length - 1 3374 } else { 3375 let max = lineToIndex.length - 2 3376 let mid 3377 while (min < max) { 3378 mid = min + ((max - min) >> 1) 3379 if (offset < lineToIndex[mid]) { 3380 max = mid - 1 3381 } else if (offset >= lineToIndex[mid + 1]) { 3382 min = mid + 1 3383 } else { 3384 min = mid 3385 break 3386 } 3387 } 3388 } 3389 return { 3390 col: offset - lineToIndex[min] + 1, 3391 line: min + 1 3392 } 3393 } 3394 3395 mapResolve(file) { 3396 if (/^\w+:\/\//.test(file)) { 3397 return file 3398 } 3399 return resolve(this.map.consumer().sourceRoot || this.map.root || '.', file) 3400 } 3401 3402 origin(line, column, endLine, endColumn) { 3403 if (!this.map) return false 3404 let consumer = this.map.consumer() 3405 3406 let from = consumer.originalPositionFor({ column, line }) 3407 if (!from.source) return false 3408 3409 let to 3410 if (typeof endLine === 'number') { 3411 to = consumer.originalPositionFor({ column: endColumn, line: endLine }) 3412 } 3413 3414 let fromUrl 3415 3416 if (isAbsolute(from.source)) { 3417 fromUrl = pathToFileURL(from.source) 3418 } else { 3419 fromUrl = new URL( 3420 from.source, 3421 this.map.consumer().sourceRoot || pathToFileURL(this.map.mapFile) 3422 ) 3423 } 3424 3425 let result = { 3426 column: from.column, 3427 endColumn: to && to.column, 3428 endLine: to && to.line, 3429 line: from.line, 3430 url: fromUrl.toString() 3431 } 3432 3433 if (fromUrl.protocol === 'file:') { 3434 if (fileURLToPath) { 3435 result.file = fileURLToPath(fromUrl) 3436 } else { 3437 /* c8 ignore next 2 */ 3438 throw new Error(`file: protocol is not available in this PostCSS build`) 3439 } 3440 } 3441 3442 let source = consumer.sourceContentFor(from.source) 3443 if (source) result.source = source 3444 3445 return result 3446 } 3447 3448 toJSON() { 3449 let json = {} 3450 for (let name of ['hasBOM', 'css', 'file', 'id']) { 3451 if (this[name] != null) { 3452 json[name] = this[name] 3453 } 3454 } 3455 if (this.map) { 3456 json.map = { ...this.map } 3457 if (json.map.consumerCache) { 3458 json.map.consumerCache = undefined 3459 } 3460 } 3461 return json 3462 } 3463 3464 get from() { 3465 return this.file || this.id 3466 } 3467 } 3468 3469 module.exports = Input 3470 Input.default = Input 3471 3472 if (terminalHighlight && terminalHighlight.registerInput) { 3473 terminalHighlight.registerInput(Input) 3474 } 3475 3476 3477 /***/ }), 3478 3479 /***/ 448: 3480 /***/ ((module, __unused_webpack_exports, __webpack_require__) => { 3481 3482 "use strict"; 3483 3484 3485 let { isClean, my } = __webpack_require__(1381) 3486 let MapGenerator = __webpack_require__(1670) 3487 let stringify = __webpack_require__(633) 3488 let Container = __webpack_require__(683) 3489 let Document = __webpack_require__(271) 3490 let warnOnce = __webpack_require__(3122) 3491 let Result = __webpack_require__(9055) 3492 let parse = __webpack_require__(4295) 3493 let Root = __webpack_require__(9434) 3494 3495 const TYPE_TO_CLASS_NAME = { 3496 atrule: 'AtRule', 3497 comment: 'Comment', 3498 decl: 'Declaration', 3499 document: 'Document', 3500 root: 'Root', 3501 rule: 'Rule' 3502 } 3503 3504 const PLUGIN_PROPS = { 3505 AtRule: true, 3506 AtRuleExit: true, 3507 Comment: true, 3508 CommentExit: true, 3509 Declaration: true, 3510 DeclarationExit: true, 3511 Document: true, 3512 DocumentExit: true, 3513 Once: true, 3514 OnceExit: true, 3515 postcssPlugin: true, 3516 prepare: true, 3517 Root: true, 3518 RootExit: true, 3519 Rule: true, 3520 RuleExit: true 3521 } 3522 3523 const NOT_VISITORS = { 3524 Once: true, 3525 postcssPlugin: true, 3526 prepare: true 3527 } 3528 3529 const CHILDREN = 0 3530 3531 function isPromise(obj) { 3532 return typeof obj === 'object' && typeof obj.then === 'function' 3533 } 3534 3535 function getEvents(node) { 3536 let key = false 3537 let type = TYPE_TO_CLASS_NAME[node.type] 3538 if (node.type === 'decl') { 3539 key = node.prop.toLowerCase() 3540 } else if (node.type === 'atrule') { 3541 key = node.name.toLowerCase() 3542 } 3543 3544 if (key && node.append) { 3545 return [ 3546 type, 3547 type + '-' + key, 3548 CHILDREN, 3549 type + 'Exit', 3550 type + 'Exit-' + key 3551 ] 3552 } else if (key) { 3553 return [type, type + '-' + key, type + 'Exit', type + 'Exit-' + key] 3554 } else if (node.append) { 3555 return [type, CHILDREN, type + 'Exit'] 3556 } else { 3557 return [type, type + 'Exit'] 3558 } 3559 } 3560 3561 function toStack(node) { 3562 let events 3563 if (node.type === 'document') { 3564 events = ['Document', CHILDREN, 'DocumentExit'] 3565 } else if (node.type === 'root') { 3566 events = ['Root', CHILDREN, 'RootExit'] 3567 } else { 3568 events = getEvents(node) 3569 } 3570 3571 return { 3572 eventIndex: 0, 3573 events, 3574 iterator: 0, 3575 node, 3576 visitorIndex: 0, 3577 visitors: [] 3578 } 3579 } 3580 3581 function cleanMarks(node) { 3582 node[isClean] = false 3583 if (node.nodes) node.nodes.forEach(i => cleanMarks(i)) 3584 return node 3585 } 3586 3587 let postcss = {} 3588 3589 class LazyResult { 3590 constructor(processor, css, opts) { 3591 this.stringified = false 3592 this.processed = false 3593 3594 let root 3595 if ( 3596 typeof css === 'object' && 3597 css !== null && 3598 (css.type === 'root' || css.type === 'document') 3599 ) { 3600 root = cleanMarks(css) 3601 } else if (css instanceof LazyResult || css instanceof Result) { 3602 root = cleanMarks(css.root) 3603 if (css.map) { 3604 if (typeof opts.map === 'undefined') opts.map = {} 3605 if (!opts.map.inline) opts.map.inline = false 3606 opts.map.prev = css.map 3607 } 3608 } else { 3609 let parser = parse 3610 if (opts.syntax) parser = opts.syntax.parse 3611 if (opts.parser) parser = opts.parser 3612 if (parser.parse) parser = parser.parse 3613 3614 try { 3615 root = parser(css, opts) 3616 } catch (error) { 3617 this.processed = true 3618 this.error = error 3619 } 3620 3621 if (root && !root[my]) { 3622 /* c8 ignore next 2 */ 3623 Container.rebuild(root) 3624 } 3625 } 3626 3627 this.result = new Result(processor, root, opts) 3628 this.helpers = { ...postcss, postcss, result: this.result } 3629 this.plugins = this.processor.plugins.map(plugin => { 3630 if (typeof plugin === 'object' && plugin.prepare) { 3631 return { ...plugin, ...plugin.prepare(this.result) } 3632 } else { 3633 return plugin 3634 } 3635 }) 3636 } 3637 3638 async() { 3639 if (this.error) return Promise.reject(this.error) 3640 if (this.processed) return Promise.resolve(this.result) 3641 if (!this.processing) { 3642 this.processing = this.runAsync() 3643 } 3644 return this.processing 3645 } 3646 3647 catch(onRejected) { 3648 return this.async().catch(onRejected) 3649 } 3650 3651 finally(onFinally) { 3652 return this.async().then(onFinally, onFinally) 3653 } 3654 3655 getAsyncError() { 3656 throw new Error('Use process(css).then(cb) to work with async plugins') 3657 } 3658 3659 handleError(error, node) { 3660 let plugin = this.result.lastPlugin 3661 try { 3662 if (node) node.addToError(error) 3663 this.error = error 3664 if (error.name === 'CssSyntaxError' && !error.plugin) { 3665 error.plugin = plugin.postcssPlugin 3666 error.setMessage() 3667 } else if (plugin.postcssVersion) { 3668 if (false) {} 3669 } 3670 } catch (err) { 3671 /* c8 ignore next 3 */ 3672 // eslint-disable-next-line no-console 3673 if (console && console.error) console.error(err) 3674 } 3675 return error 3676 } 3677 3678 prepareVisitors() { 3679 this.listeners = {} 3680 let add = (plugin, type, cb) => { 3681 if (!this.listeners[type]) this.listeners[type] = [] 3682 this.listeners[type].push([plugin, cb]) 3683 } 3684 for (let plugin of this.plugins) { 3685 if (typeof plugin === 'object') { 3686 for (let event in plugin) { 3687 if (!PLUGIN_PROPS[event] && /^[A-Z]/.test(event)) { 3688 throw new Error( 3689 `Unknown event $event} in $plugin.postcssPlugin}. ` + 3690 `Try to update PostCSS ($this.processor.version} now).` 3691 ) 3692 } 3693 if (!NOT_VISITORS[event]) { 3694 if (typeof plugin[event] === 'object') { 3695 for (let filter in plugin[event]) { 3696 if (filter === '*') { 3697 add(plugin, event, plugin[event][filter]) 3698 } else { 3699 add( 3700 plugin, 3701 event + '-' + filter.toLowerCase(), 3702 plugin[event][filter] 3703 ) 3704 } 3705 } 3706 } else if (typeof plugin[event] === 'function') { 3707 add(plugin, event, plugin[event]) 3708 } 3709 } 3710 } 3711 } 3712 } 3713 this.hasListener = Object.keys(this.listeners).length > 0 3714 } 3715 3716 async runAsync() { 3717 this.plugin = 0 3718 for (let i = 0; i < this.plugins.length; i++) { 3719 let plugin = this.plugins[i] 3720 let promise = this.runOnRoot(plugin) 3721 if (isPromise(promise)) { 3722 try { 3723 await promise 3724 } catch (error) { 3725 throw this.handleError(error) 3726 } 3727 } 3728 } 3729 3730 this.prepareVisitors() 3731 if (this.hasListener) { 3732 let root = this.result.root 3733 while (!root[isClean]) { 3734 root[isClean] = true 3735 let stack = [toStack(root)] 3736 while (stack.length > 0) { 3737 let promise = this.visitTick(stack) 3738 if (isPromise(promise)) { 3739 try { 3740 await promise 3741 } catch (e) { 3742 let node = stack[stack.length - 1].node 3743 throw this.handleError(e, node) 3744 } 3745 } 3746 } 3747 } 3748 3749 if (this.listeners.OnceExit) { 3750 for (let [plugin, visitor] of this.listeners.OnceExit) { 3751 this.result.lastPlugin = plugin 3752 try { 3753 if (root.type === 'document') { 3754 let roots = root.nodes.map(subRoot => 3755 visitor(subRoot, this.helpers) 3756 ) 3757 3758 await Promise.all(roots) 3759 } else { 3760 await visitor(root, this.helpers) 3761 } 3762 } catch (e) { 3763 throw this.handleError(e) 3764 } 3765 } 3766 } 3767 } 3768 3769 this.processed = true 3770 return this.stringify() 3771 } 3772 3773 runOnRoot(plugin) { 3774 this.result.lastPlugin = plugin 3775 try { 3776 if (typeof plugin === 'object' && plugin.Once) { 3777 if (this.result.root.type === 'document') { 3778 let roots = this.result.root.nodes.map(root => 3779 plugin.Once(root, this.helpers) 3780 ) 3781 3782 if (isPromise(roots[0])) { 3783 return Promise.all(roots) 3784 } 3785 3786 return roots 3787 } 3788 3789 return plugin.Once(this.result.root, this.helpers) 3790 } else if (typeof plugin === 'function') { 3791 return plugin(this.result.root, this.result) 3792 } 3793 } catch (error) { 3794 throw this.handleError(error) 3795 } 3796 } 3797 3798 stringify() { 3799 if (this.error) throw this.error 3800 if (this.stringified) return this.result 3801 this.stringified = true 3802 3803 this.sync() 3804 3805 let opts = this.result.opts 3806 let str = stringify 3807 if (opts.syntax) str = opts.syntax.stringify 3808 if (opts.stringifier) str = opts.stringifier 3809 if (str.stringify) str = str.stringify 3810 3811 let map = new MapGenerator(str, this.result.root, this.result.opts) 3812 let data = map.generate() 3813 this.result.css = data[0] 3814 this.result.map = data[1] 3815 3816 return this.result 3817 } 3818 3819 sync() { 3820 if (this.error) throw this.error 3821 if (this.processed) return this.result 3822 this.processed = true 3823 3824 if (this.processing) { 3825 throw this.getAsyncError() 3826 } 3827 3828 for (let plugin of this.plugins) { 3829 let promise = this.runOnRoot(plugin) 3830 if (isPromise(promise)) { 3831 throw this.getAsyncError() 3832 } 3833 } 3834 3835 this.prepareVisitors() 3836 if (this.hasListener) { 3837 let root = this.result.root 3838 while (!root[isClean]) { 3839 root[isClean] = true 3840 this.walkSync(root) 3841 } 3842 if (this.listeners.OnceExit) { 3843 if (root.type === 'document') { 3844 for (let subRoot of root.nodes) { 3845 this.visitSync(this.listeners.OnceExit, subRoot) 3846 } 3847 } else { 3848 this.visitSync(this.listeners.OnceExit, root) 3849 } 3850 } 3851 } 3852 3853 return this.result 3854 } 3855 3856 then(onFulfilled, onRejected) { 3857 if (false) {} 3858 return this.async().then(onFulfilled, onRejected) 3859 } 3860 3861 toString() { 3862 return this.css 3863 } 3864 3865 visitSync(visitors, node) { 3866 for (let [plugin, visitor] of visitors) { 3867 this.result.lastPlugin = plugin 3868 let promise 3869 try { 3870 promise = visitor(node, this.helpers) 3871 } catch (e) { 3872 throw this.handleError(e, node.proxyOf) 3873 } 3874 if (node.type !== 'root' && node.type !== 'document' && !node.parent) { 3875 return true 3876 } 3877 if (isPromise(promise)) { 3878 throw this.getAsyncError() 3879 } 3880 } 3881 } 3882 3883 visitTick(stack) { 3884 let visit = stack[stack.length - 1] 3885 let { node, visitors } = visit 3886 3887 if (node.type !== 'root' && node.type !== 'document' && !node.parent) { 3888 stack.pop() 3889 return 3890 } 3891 3892 if (visitors.length > 0 && visit.visitorIndex < visitors.length) { 3893 let [plugin, visitor] = visitors[visit.visitorIndex] 3894 visit.visitorIndex += 1 3895 if (visit.visitorIndex === visitors.length) { 3896 visit.visitors = [] 3897 visit.visitorIndex = 0 3898 } 3899 this.result.lastPlugin = plugin 3900 try { 3901 return visitor(node.toProxy(), this.helpers) 3902 } catch (e) { 3903 throw this.handleError(e, node) 3904 } 3905 } 3906 3907 if (visit.iterator !== 0) { 3908 let iterator = visit.iterator 3909 let child 3910 while ((child = node.nodes[node.indexes[iterator]])) { 3911 node.indexes[iterator] += 1 3912 if (!child[isClean]) { 3913 child[isClean] = true 3914 stack.push(toStack(child)) 3915 return 3916 } 3917 } 3918 visit.iterator = 0 3919 delete node.indexes[iterator] 3920 } 3921 3922 let events = visit.events 3923 while (visit.eventIndex < events.length) { 3924 let event = events[visit.eventIndex] 3925 visit.eventIndex += 1 3926 if (event === CHILDREN) { 3927 if (node.nodes && node.nodes.length) { 3928 node[isClean] = true 3929 visit.iterator = node.getIterator() 3930 } 3931 return 3932 } else if (this.listeners[event]) { 3933 visit.visitors = this.listeners[event] 3934 return 3935 } 3936 } 3937 stack.pop() 3938 } 3939 3940 walkSync(node) { 3941 node[isClean] = true 3942 let events = getEvents(node) 3943 for (let event of events) { 3944 if (event === CHILDREN) { 3945 if (node.nodes) { 3946 node.each(child => { 3947 if (!child[isClean]) this.walkSync(child) 3948 }) 3949 } 3950 } else { 3951 let visitors = this.listeners[event] 3952 if (visitors) { 3953 if (this.visitSync(visitors, node.toProxy())) return 3954 } 3955 } 3956 } 3957 } 3958 3959 warnings() { 3960 return this.sync().warnings() 3961 } 3962 3963 get content() { 3964 return this.stringify().content 3965 } 3966 3967 get css() { 3968 return this.stringify().css 3969 } 3970 3971 get map() { 3972 return this.stringify().map 3973 } 3974 3975 get messages() { 3976 return this.sync().messages 3977 } 3978 3979 get opts() { 3980 return this.result.opts 3981 } 3982 3983 get processor() { 3984 return this.result.processor 3985 } 3986 3987 get root() { 3988 return this.sync().root 3989 } 3990 3991 get [Symbol.toStringTag]() { 3992 return 'LazyResult' 3993 } 3994 } 3995 3996 LazyResult.registerPostcss = dependant => { 3997 postcss = dependant 3998 } 3999 4000 module.exports = LazyResult 4001 LazyResult.default = LazyResult 4002 4003 Root.registerLazyResult(LazyResult) 4004 Document.registerLazyResult(LazyResult) 4005 4006 4007 /***/ }), 4008 4009 /***/ 7374: 4010 /***/ ((module) => { 4011 4012 "use strict"; 4013 4014 4015 let list = { 4016 comma(string) { 4017 return list.split(string, [','], true) 4018 }, 4019 4020 space(string) { 4021 let spaces = [' ', '\n', '\t'] 4022 return list.split(string, spaces) 4023 }, 4024 4025 split(string, separators, last) { 4026 let array = [] 4027 let current = '' 4028 let split = false 4029 4030 let func = 0 4031 let inQuote = false 4032 let prevQuote = '' 4033 let escape = false 4034 4035 for (let letter of string) { 4036 if (escape) { 4037 escape = false 4038 } else if (letter === '\\') { 4039 escape = true 4040 } else if (inQuote) { 4041 if (letter === prevQuote) { 4042 inQuote = false 4043 } 4044 } else if (letter === '"' || letter === "'") { 4045 inQuote = true 4046 prevQuote = letter 4047 } else if (letter === '(') { 4048 func += 1 4049 } else if (letter === ')') { 4050 if (func > 0) func -= 1 4051 } else if (func === 0) { 4052 if (separators.includes(letter)) split = true 4053 } 4054 4055 if (split) { 4056 if (current !== '') array.push(current.trim()) 4057 current = '' 4058 split = false 4059 } else { 4060 current += letter 4061 } 4062 } 4063 4064 if (last || current !== '') array.push(current.trim()) 4065 return array 4066 } 4067 } 4068 4069 module.exports = list 4070 list.default = list 4071 4072 4073 /***/ }), 4074 4075 /***/ 1670: 4076 /***/ ((module, __unused_webpack_exports, __webpack_require__) => { 4077 4078 "use strict"; 4079 4080 4081 let { SourceMapConsumer, SourceMapGenerator } = __webpack_require__(1866) 4082 let { dirname, relative, resolve, sep } = __webpack_require__(197) 4083 let { pathToFileURL } = __webpack_require__(2739) 4084 4085 let Input = __webpack_require__(5380) 4086 4087 let sourceMapAvailable = Boolean(SourceMapConsumer && SourceMapGenerator) 4088 let pathAvailable = Boolean(dirname && resolve && relative && sep) 4089 4090 class MapGenerator { 4091 constructor(stringify, root, opts, cssString) { 4092 this.stringify = stringify 4093 this.mapOpts = opts.map || {} 4094 this.root = root 4095 this.opts = opts 4096 this.css = cssString 4097 this.originalCSS = cssString 4098 this.usesFileUrls = !this.mapOpts.from && this.mapOpts.absolute 4099 4100 this.memoizedFileURLs = new Map() 4101 this.memoizedPaths = new Map() 4102 this.memoizedURLs = new Map() 4103 } 4104 4105 addAnnotation() { 4106 let content 4107 4108 if (this.isInline()) { 4109 content = 4110 'data:application/json;base64,' + this.toBase64(this.map.toString()) 4111 } else if (typeof this.mapOpts.annotation === 'string') { 4112 content = this.mapOpts.annotation 4113 } else if (typeof this.mapOpts.annotation === 'function') { 4114 content = this.mapOpts.annotation(this.opts.to, this.root) 4115 } else { 4116 content = this.outputFile() + '.map' 4117 } 4118 let eol = '\n' 4119 if (this.css.includes('\r\n')) eol = '\r\n' 4120 4121 this.css += eol + '/*# sourceMappingURL=' + content + ' */' 4122 } 4123 4124 applyPrevMaps() { 4125 for (let prev of this.previous()) { 4126 let from = this.toUrl(this.path(prev.file)) 4127 let root = prev.root || dirname(prev.file) 4128 let map 4129 4130 if (this.mapOpts.sourcesContent === false) { 4131 map = new SourceMapConsumer(prev.text) 4132 if (map.sourcesContent) { 4133 map.sourcesContent = null 4134 } 4135 } else { 4136 map = prev.consumer() 4137 } 4138 4139 this.map.applySourceMap(map, from, this.toUrl(this.path(root))) 4140 } 4141 } 4142 4143 clearAnnotation() { 4144 if (this.mapOpts.annotation === false) return 4145 4146 if (this.root) { 4147 let node 4148 for (let i = this.root.nodes.length - 1; i >= 0; i--) { 4149 node = this.root.nodes[i] 4150 if (node.type !== 'comment') continue 4151 if (node.text.indexOf('# sourceMappingURL=') === 0) { 4152 this.root.removeChild(i) 4153 } 4154 } 4155 } else if (this.css) { 4156 this.css = this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm, '') 4157 } 4158 } 4159 4160 generate() { 4161 this.clearAnnotation() 4162 if (pathAvailable && sourceMapAvailable && this.isMap()) { 4163 return this.generateMap() 4164 } else { 4165 let result = '' 4166 this.stringify(this.root, i => { 4167 result += i 4168 }) 4169 return [result] 4170 } 4171 } 4172 4173 generateMap() { 4174 if (this.root) { 4175 this.generateString() 4176 } else if (this.previous().length === 1) { 4177 let prev = this.previous()[0].consumer() 4178 prev.file = this.outputFile() 4179 this.map = SourceMapGenerator.fromSourceMap(prev, { 4180 ignoreInvalidMapping: true 4181 }) 4182 } else { 4183 this.map = new SourceMapGenerator({ 4184 file: this.outputFile(), 4185 ignoreInvalidMapping: true 4186 }) 4187 this.map.addMapping({ 4188 generated: { column: 0, line: 1 }, 4189 original: { column: 0, line: 1 }, 4190 source: this.opts.from 4191 ? this.toUrl(this.path(this.opts.from)) 4192 : '<no source>' 4193 }) 4194 } 4195 4196 if (this.isSourcesContent()) this.setSourcesContent() 4197 if (this.root && this.previous().length > 0) this.applyPrevMaps() 4198 if (this.isAnnotation()) this.addAnnotation() 4199 4200 if (this.isInline()) { 4201 return [this.css] 4202 } else { 4203 return [this.css, this.map] 4204 } 4205 } 4206 4207 generateString() { 4208 this.css = '' 4209 this.map = new SourceMapGenerator({ 4210 file: this.outputFile(), 4211 ignoreInvalidMapping: true 4212 }) 4213 4214 let line = 1 4215 let column = 1 4216 4217 let noSource = '<no source>' 4218 let mapping = { 4219 generated: { column: 0, line: 0 }, 4220 original: { column: 0, line: 0 }, 4221 source: '' 4222 } 4223 4224 let lines, last 4225 this.stringify(this.root, (str, node, type) => { 4226 this.css += str 4227 4228 if (node && type !== 'end') { 4229 mapping.generated.line = line 4230 mapping.generated.column = column - 1 4231 if (node.source && node.source.start) { 4232 mapping.source = this.sourcePath(node) 4233 mapping.original.line = node.source.start.line 4234 mapping.original.column = node.source.start.column - 1 4235 this.map.addMapping(mapping) 4236 } else { 4237 mapping.source = noSource 4238 mapping.original.line = 1 4239 mapping.original.column = 0 4240 this.map.addMapping(mapping) 4241 } 4242 } 4243 4244 lines = str.match(/\n/g) 4245 if (lines) { 4246 line += lines.length 4247 last = str.lastIndexOf('\n') 4248 column = str.length - last 4249 } else { 4250 column += str.length 4251 } 4252 4253 if (node && type !== 'start') { 4254 let p = node.parent || { raws: {} } 4255 let childless = 4256 node.type === 'decl' || (node.type === 'atrule' && !node.nodes) 4257 if (!childless || node !== p.last || p.raws.semicolon) { 4258 if (node.source && node.source.end) { 4259 mapping.source = this.sourcePath(node) 4260 mapping.original.line = node.source.end.line 4261 mapping.original.column = node.source.end.column - 1 4262 mapping.generated.line = line 4263 mapping.generated.column = column - 2 4264 this.map.addMapping(mapping) 4265 } else { 4266 mapping.source = noSource 4267 mapping.original.line = 1 4268 mapping.original.column = 0 4269 mapping.generated.line = line 4270 mapping.generated.column = column - 1 4271 this.map.addMapping(mapping) 4272 } 4273 } 4274 } 4275 }) 4276 } 4277 4278 isAnnotation() { 4279 if (this.isInline()) { 4280 return true 4281 } 4282 if (typeof this.mapOpts.annotation !== 'undefined') { 4283 return this.mapOpts.annotation 4284 } 4285 if (this.previous().length) { 4286 return this.previous().some(i => i.annotation) 4287 } 4288 return true 4289 } 4290 4291 isInline() { 4292 if (typeof this.mapOpts.inline !== 'undefined') { 4293 return this.mapOpts.inline 4294 } 4295 4296 let annotation = this.mapOpts.annotation 4297 if (typeof annotation !== 'undefined' && annotation !== true) { 4298 return false 4299 } 4300 4301 if (this.previous().length) { 4302 return this.previous().some(i => i.inline) 4303 } 4304 return true 4305 } 4306 4307 isMap() { 4308 if (typeof this.opts.map !== 'undefined') { 4309 return !!this.opts.map 4310 } 4311 return this.previous().length > 0 4312 } 4313 4314 isSourcesContent() { 4315 if (typeof this.mapOpts.sourcesContent !== 'undefined') { 4316 return this.mapOpts.sourcesContent 4317 } 4318 if (this.previous().length) { 4319 return this.previous().some(i => i.withContent()) 4320 } 4321 return true 4322 } 4323 4324 outputFile() { 4325 if (this.opts.to) { 4326 return this.path(this.opts.to) 4327 } else if (this.opts.from) { 4328 return this.path(this.opts.from) 4329 } else { 4330 return 'to.css' 4331 } 4332 } 4333 4334 path(file) { 4335 if (this.mapOpts.absolute) return file 4336 if (file.charCodeAt(0) === 60 /* `<` */) return file 4337 if (/^\w+:\/\//.test(file)) return file 4338 let cached = this.memoizedPaths.get(file) 4339 if (cached) return cached 4340 4341 let from = this.opts.to ? dirname(this.opts.to) : '.' 4342 4343 if (typeof this.mapOpts.annotation === 'string') { 4344 from = dirname(resolve(from, this.mapOpts.annotation)) 4345 } 4346 4347 let path = relative(from, file) 4348 this.memoizedPaths.set(file, path) 4349 4350 return path 4351 } 4352 4353 previous() { 4354 if (!this.previousMaps) { 4355 this.previousMaps = [] 4356 if (this.root) { 4357 this.root.walk(node => { 4358 if (node.source && node.source.input.map) { 4359 let map = node.source.input.map 4360 if (!this.previousMaps.includes(map)) { 4361 this.previousMaps.push(map) 4362 } 4363 } 4364 }) 4365 } else { 4366 let input = new Input(this.originalCSS, this.opts) 4367 if (input.map) this.previousMaps.push(input.map) 4368 } 4369 } 4370 4371 return this.previousMaps 4372 } 4373 4374 setSourcesContent() { 4375 let already = {} 4376 if (this.root) { 4377 this.root.walk(node => { 4378 if (node.source) { 4379 let from = node.source.input.from 4380 if (from && !already[from]) { 4381 already[from] = true 4382 let fromUrl = this.usesFileUrls 4383 ? this.toFileUrl(from) 4384 : this.toUrl(this.path(from)) 4385 this.map.setSourceContent(fromUrl, node.source.input.css) 4386 } 4387 } 4388 }) 4389 } else if (this.css) { 4390 let from = this.opts.from 4391 ? this.toUrl(this.path(this.opts.from)) 4392 : '<no source>' 4393 this.map.setSourceContent(from, this.css) 4394 } 4395 } 4396 4397 sourcePath(node) { 4398 if (this.mapOpts.from) { 4399 return this.toUrl(this.mapOpts.from) 4400 } else if (this.usesFileUrls) { 4401 return this.toFileUrl(node.source.input.from) 4402 } else { 4403 return this.toUrl(this.path(node.source.input.from)) 4404 } 4405 } 4406 4407 toBase64(str) { 4408 if (Buffer) { 4409 return Buffer.from(str).toString('base64') 4410 } else { 4411 return window.btoa(unescape(encodeURIComponent(str))) 4412 } 4413 } 4414 4415 toFileUrl(path) { 4416 let cached = this.memoizedFileURLs.get(path) 4417 if (cached) return cached 4418 4419 if (pathToFileURL) { 4420 let fileURL = pathToFileURL(path).toString() 4421 this.memoizedFileURLs.set(path, fileURL) 4422 4423 return fileURL 4424 } else { 4425 throw new Error( 4426 '`map.absolute` option is not available in this PostCSS build' 4427 ) 4428 } 4429 } 4430 4431 toUrl(path) { 4432 let cached = this.memoizedURLs.get(path) 4433 if (cached) return cached 4434 4435 if (sep === '\\') { 4436 path = path.replace(/\\/g, '/') 4437 } 4438 4439 let url = encodeURI(path).replace(/[#?]/g, encodeURIComponent) 4440 this.memoizedURLs.set(path, url) 4441 4442 return url 4443 } 4444 } 4445 4446 module.exports = MapGenerator 4447 4448 4449 /***/ }), 4450 4451 /***/ 7661: 4452 /***/ ((module, __unused_webpack_exports, __webpack_require__) => { 4453 4454 "use strict"; 4455 4456 4457 let MapGenerator = __webpack_require__(1670) 4458 let stringify = __webpack_require__(633) 4459 let warnOnce = __webpack_require__(3122) 4460 let parse = __webpack_require__(4295) 4461 const Result = __webpack_require__(9055) 4462 4463 class NoWorkResult { 4464 constructor(processor, css, opts) { 4465 css = css.toString() 4466 this.stringified = false 4467 4468 this._processor = processor 4469 this._css = css 4470 this._opts = opts 4471 this._map = undefined 4472 let root 4473 4474 let str = stringify 4475 this.result = new Result(this._processor, root, this._opts) 4476 this.result.css = css 4477 4478 let self = this 4479 Object.defineProperty(this.result, 'root', { 4480 get() { 4481 return self.root 4482 } 4483 }) 4484 4485 let map = new MapGenerator(str, root, this._opts, css) 4486 if (map.isMap()) { 4487 let [generatedCSS, generatedMap] = map.generate() 4488 if (generatedCSS) { 4489 this.result.css = generatedCSS 4490 } 4491 if (generatedMap) { 4492 this.result.map = generatedMap 4493 } 4494 } else { 4495 map.clearAnnotation() 4496 this.result.css = map.css 4497 } 4498 } 4499 4500 async() { 4501 if (this.error) return Promise.reject(this.error) 4502 return Promise.resolve(this.result) 4503 } 4504 4505 catch(onRejected) { 4506 return this.async().catch(onRejected) 4507 } 4508 4509 finally(onFinally) { 4510 return this.async().then(onFinally, onFinally) 4511 } 4512 4513 sync() { 4514 if (this.error) throw this.error 4515 return this.result 4516 } 4517 4518 then(onFulfilled, onRejected) { 4519 if (false) {} 4520 4521 return this.async().then(onFulfilled, onRejected) 4522 } 4523 4524 toString() { 4525 return this._css 4526 } 4527 4528 warnings() { 4529 return [] 4530 } 4531 4532 get content() { 4533 return this.result.css 4534 } 4535 4536 get css() { 4537 return this.result.css 4538 } 4539 4540 get map() { 4541 return this.result.map 4542 } 4543 4544 get messages() { 4545 return [] 4546 } 4547 4548 get opts() { 4549 return this.result.opts 4550 } 4551 4552 get processor() { 4553 return this.result.processor 4554 } 4555 4556 get root() { 4557 if (this._root) { 4558 return this._root 4559 } 4560 4561 let root 4562 let parser = parse 4563 4564 try { 4565 root = parser(this._css, this._opts) 4566 } catch (error) { 4567 this.error = error 4568 } 4569 4570 if (this.error) { 4571 throw this.error 4572 } else { 4573 this._root = root 4574 return root 4575 } 4576 } 4577 4578 get [Symbol.toStringTag]() { 4579 return 'NoWorkResult' 4580 } 4581 } 4582 4583 module.exports = NoWorkResult 4584 NoWorkResult.default = NoWorkResult 4585 4586 4587 /***/ }), 4588 4589 /***/ 7490: 4590 /***/ ((module, __unused_webpack_exports, __webpack_require__) => { 4591 4592 "use strict"; 4593 4594 4595 let { isClean, my } = __webpack_require__(1381) 4596 let CssSyntaxError = __webpack_require__(356) 4597 let Stringifier = __webpack_require__(346) 4598 let stringify = __webpack_require__(633) 4599 4600 function cloneNode(obj, parent) { 4601 let cloned = new obj.constructor() 4602 4603 for (let i in obj) { 4604 if (!Object.prototype.hasOwnProperty.call(obj, i)) { 4605 /* c8 ignore next 2 */ 4606 continue 4607 } 4608 if (i === 'proxyCache') continue 4609 let value = obj[i] 4610 let type = typeof value 4611 4612 if (i === 'parent' && type === 'object') { 4613 if (parent) cloned[i] = parent 4614 } else if (i === 'source') { 4615 cloned[i] = value 4616 } else if (Array.isArray(value)) { 4617 cloned[i] = value.map(j => cloneNode(j, cloned)) 4618 } else { 4619 if (type === 'object' && value !== null) value = cloneNode(value) 4620 cloned[i] = value 4621 } 4622 } 4623 4624 return cloned 4625 } 4626 4627 class Node { 4628 constructor(defaults = {}) { 4629 this.raws = {} 4630 this[isClean] = false 4631 this[my] = true 4632 4633 for (let name in defaults) { 4634 if (name === 'nodes') { 4635 this.nodes = [] 4636 for (let node of defaults[name]) { 4637 if (typeof node.clone === 'function') { 4638 this.append(node.clone()) 4639 } else { 4640 this.append(node) 4641 } 4642 } 4643 } else { 4644 this[name] = defaults[name] 4645 } 4646 } 4647 } 4648 4649 addToError(error) { 4650 error.postcssNode = this 4651 if (error.stack && this.source && /\n\s{4}at /.test(error.stack)) { 4652 let s = this.source 4653 error.stack = error.stack.replace( 4654 /\n\s{4}at /, 4655 `$&$s.input.from}:$s.start.line}:$s.start.column}$&` 4656 ) 4657 } 4658 return error 4659 } 4660 4661 after(add) { 4662 this.parent.insertAfter(this, add) 4663 return this 4664 } 4665 4666 assign(overrides = {}) { 4667 for (let name in overrides) { 4668 this[name] = overrides[name] 4669 } 4670 return this 4671 } 4672 4673 before(add) { 4674 this.parent.insertBefore(this, add) 4675 return this 4676 } 4677 4678 cleanRaws(keepBetween) { 4679 delete this.raws.before 4680 delete this.raws.after 4681 if (!keepBetween) delete this.raws.between 4682 } 4683 4684 clone(overrides = {}) { 4685 let cloned = cloneNode(this) 4686 for (let name in overrides) { 4687 cloned[name] = overrides[name] 4688 } 4689 return cloned 4690 } 4691 4692 cloneAfter(overrides = {}) { 4693 let cloned = this.clone(overrides) 4694 this.parent.insertAfter(this, cloned) 4695 return cloned 4696 } 4697 4698 cloneBefore(overrides = {}) { 4699 let cloned = this.clone(overrides) 4700 this.parent.insertBefore(this, cloned) 4701 return cloned 4702 } 4703 4704 error(message, opts = {}) { 4705 if (this.source) { 4706 let { end, start } = this.rangeBy(opts) 4707 return this.source.input.error( 4708 message, 4709 { column: start.column, line: start.line }, 4710 { column: end.column, line: end.line }, 4711 opts 4712 ) 4713 } 4714 return new CssSyntaxError(message) 4715 } 4716 4717 getProxyProcessor() { 4718 return { 4719 get(node, prop) { 4720 if (prop === 'proxyOf') { 4721 return node 4722 } else if (prop === 'root') { 4723 return () => node.root().toProxy() 4724 } else { 4725 return node[prop] 4726 } 4727 }, 4728 4729 set(node, prop, value) { 4730 if (node[prop] === value) return true 4731 node[prop] = value 4732 if ( 4733 prop === 'prop' || 4734 prop === 'value' || 4735 prop === 'name' || 4736 prop === 'params' || 4737 prop === 'important' || 4738 /* c8 ignore next */ 4739 prop === 'text' 4740 ) { 4741 node.markDirty() 4742 } 4743 return true 4744 } 4745 } 4746 } 4747 4748 markDirty() { 4749 if (this[isClean]) { 4750 this[isClean] = false 4751 let next = this 4752 while ((next = next.parent)) { 4753 next[isClean] = false 4754 } 4755 } 4756 } 4757 4758 next() { 4759 if (!this.parent) return undefined 4760 let index = this.parent.index(this) 4761 return this.parent.nodes[index + 1] 4762 } 4763 4764 positionBy(opts, stringRepresentation) { 4765 let pos = this.source.start 4766 if (opts.index) { 4767 pos = this.positionInside(opts.index, stringRepresentation) 4768 } else if (opts.word) { 4769 stringRepresentation = this.toString() 4770 let index = stringRepresentation.indexOf(opts.word) 4771 if (index !== -1) pos = this.positionInside(index, stringRepresentation) 4772 } 4773 return pos 4774 } 4775 4776 positionInside(index, stringRepresentation) { 4777 let string = stringRepresentation || this.toString() 4778 let column = this.source.start.column 4779 let line = this.source.start.line 4780 4781 for (let i = 0; i < index; i++) { 4782 if (string[i] === '\n') { 4783 column = 1 4784 line += 1 4785 } else { 4786 column += 1 4787 } 4788 } 4789 4790 return { column, line } 4791 } 4792 4793 prev() { 4794 if (!this.parent) return undefined 4795 let index = this.parent.index(this) 4796 return this.parent.nodes[index - 1] 4797 } 4798 4799 rangeBy(opts) { 4800 let start = { 4801 column: this.source.start.column, 4802 line: this.source.start.line 4803 } 4804 let end = this.source.end 4805 ? { 4806 column: this.source.end.column + 1, 4807 line: this.source.end.line 4808 } 4809 : { 4810 column: start.column + 1, 4811 line: start.line 4812 } 4813 4814 if (opts.word) { 4815 let stringRepresentation = this.toString() 4816 let index = stringRepresentation.indexOf(opts.word) 4817 if (index !== -1) { 4818 start = this.positionInside(index, stringRepresentation) 4819 end = this.positionInside(index + opts.word.length, stringRepresentation) 4820 } 4821 } else { 4822 if (opts.start) { 4823 start = { 4824 column: opts.start.column, 4825 line: opts.start.line 4826 } 4827 } else if (opts.index) { 4828 start = this.positionInside(opts.index) 4829 } 4830 4831 if (opts.end) { 4832 end = { 4833 column: opts.end.column, 4834 line: opts.end.line 4835 } 4836 } else if (typeof opts.endIndex === 'number') { 4837 end = this.positionInside(opts.endIndex) 4838 } else if (opts.index) { 4839 end = this.positionInside(opts.index + 1) 4840 } 4841 } 4842 4843 if ( 4844 end.line < start.line || 4845 (end.line === start.line && end.column <= start.column) 4846 ) { 4847 end = { column: start.column + 1, line: start.line } 4848 } 4849 4850 return { end, start } 4851 } 4852 4853 raw(prop, defaultType) { 4854 let str = new Stringifier() 4855 return str.raw(this, prop, defaultType) 4856 } 4857 4858 remove() { 4859 if (this.parent) { 4860 this.parent.removeChild(this) 4861 } 4862 this.parent = undefined 4863 return this 4864 } 4865 4866 replaceWith(...nodes) { 4867 if (this.parent) { 4868 let bookmark = this 4869 let foundSelf = false 4870 for (let node of nodes) { 4871 if (node === this) { 4872 foundSelf = true 4873 } else if (foundSelf) { 4874 this.parent.insertAfter(bookmark, node) 4875 bookmark = node 4876 } else { 4877 this.parent.insertBefore(bookmark, node) 4878 } 4879 } 4880 4881 if (!foundSelf) { 4882 this.remove() 4883 } 4884 } 4885 4886 return this 4887 } 4888 4889 root() { 4890 let result = this 4891 while (result.parent && result.parent.type !== 'document') { 4892 result = result.parent 4893 } 4894 return result 4895 } 4896 4897 toJSON(_, inputs) { 4898 let fixed = {} 4899 let emitInputs = inputs == null 4900 inputs = inputs || new Map() 4901 let inputsNextIndex = 0 4902 4903 for (let name in this) { 4904 if (!Object.prototype.hasOwnProperty.call(this, name)) { 4905 /* c8 ignore next 2 */ 4906 continue 4907 } 4908 if (name === 'parent' || name === 'proxyCache') continue 4909 let value = this[name] 4910 4911 if (Array.isArray(value)) { 4912 fixed[name] = value.map(i => { 4913 if (typeof i === 'object' && i.toJSON) { 4914 return i.toJSON(null, inputs) 4915 } else { 4916 return i 4917 } 4918 }) 4919 } else if (typeof value === 'object' && value.toJSON) { 4920 fixed[name] = value.toJSON(null, inputs) 4921 } else if (name === 'source') { 4922 let inputId = inputs.get(value.input) 4923 if (inputId == null) { 4924 inputId = inputsNextIndex 4925 inputs.set(value.input, inputsNextIndex) 4926 inputsNextIndex++ 4927 } 4928 fixed[name] = { 4929 end: value.end, 4930 inputId, 4931 start: value.start 4932 } 4933 } else { 4934 fixed[name] = value 4935 } 4936 } 4937 4938 if (emitInputs) { 4939 fixed.inputs = [...inputs.keys()].map(input => input.toJSON()) 4940 } 4941 4942 return fixed 4943 } 4944 4945 toProxy() { 4946 if (!this.proxyCache) { 4947 this.proxyCache = new Proxy(this, this.getProxyProcessor()) 4948 } 4949 return this.proxyCache 4950 } 4951 4952 toString(stringifier = stringify) { 4953 if (stringifier.stringify) stringifier = stringifier.stringify 4954 let result = '' 4955 stringifier(this, i => { 4956 result += i 4957 }) 4958 return result 4959 } 4960 4961 warn(result, text, opts) { 4962 let data = { node: this } 4963 for (let i in opts) data[i] = opts[i] 4964 return result.warn(text, data) 4965 } 4966 4967 get proxyOf() { 4968 return this 4969 } 4970 } 4971 4972 module.exports = Node 4973 Node.default = Node 4974 4975 4976 /***/ }), 4977 4978 /***/ 4295: 4979 /***/ ((module, __unused_webpack_exports, __webpack_require__) => { 4980 4981 "use strict"; 4982 4983 4984 let Container = __webpack_require__(683) 4985 let Parser = __webpack_require__(3937) 4986 let Input = __webpack_require__(5380) 4987 4988 function parse(css, opts) { 4989 let input = new Input(css, opts) 4990 let parser = new Parser(input) 4991 try { 4992 parser.parse() 4993 } catch (e) { 4994 if (false) {} 4995 throw e 4996 } 4997 4998 return parser.root 4999 } 5000 5001 module.exports = parse 5002 parse.default = parse 5003 5004 Container.registerParse(parse) 5005 5006 5007 /***/ }), 5008 5009 /***/ 3937: 5010 /***/ ((module, __unused_webpack_exports, __webpack_require__) => { 5011 5012 "use strict"; 5013 5014 5015 let Declaration = __webpack_require__(1516) 5016 let tokenizer = __webpack_require__(2327) 5017 let Comment = __webpack_require__(6589) 5018 let AtRule = __webpack_require__(1326) 5019 let Root = __webpack_require__(9434) 5020 let Rule = __webpack_require__(4092) 5021 5022 const SAFE_COMMENT_NEIGHBOR = { 5023 empty: true, 5024 space: true 5025 } 5026 5027 function findLastWithPosition(tokens) { 5028 for (let i = tokens.length - 1; i >= 0; i--) { 5029 let token = tokens[i] 5030 let pos = token[3] || token[2] 5031 if (pos) return pos 5032 } 5033 } 5034 5035 class Parser { 5036 constructor(input) { 5037 this.input = input 5038 5039 this.root = new Root() 5040 this.current = this.root 5041 this.spaces = '' 5042 this.semicolon = false 5043 5044 this.createTokenizer() 5045 this.root.source = { input, start: { column: 1, line: 1, offset: 0 } } 5046 } 5047 5048 atrule(token) { 5049 let node = new AtRule() 5050 node.name = token[1].slice(1) 5051 if (node.name === '') { 5052 this.unnamedAtrule(node, token) 5053 } 5054 this.init(node, token[2]) 5055 5056 let type 5057 let prev 5058 let shift 5059 let last = false 5060 let open = false 5061 let params = [] 5062 let brackets = [] 5063 5064 while (!this.tokenizer.endOfFile()) { 5065 token = this.tokenizer.nextToken() 5066 type = token[0] 5067 5068 if (type === '(' || type === '[') { 5069 brackets.push(type === '(' ? ')' : ']') 5070 } else if (type === '{' && brackets.length > 0) { 5071 brackets.push('}') 5072 } else if (type === brackets[brackets.length - 1]) { 5073 brackets.pop() 5074 } 5075 5076 if (brackets.length === 0) { 5077 if (type === ';') { 5078 node.source.end = this.getPosition(token[2]) 5079 node.source.end.offset++ 5080 this.semicolon = true 5081 break 5082 } else if (type === '{') { 5083 open = true 5084 break 5085 } else if (type === '}') { 5086 if (params.length > 0) { 5087 shift = params.length - 1 5088 prev = params[shift] 5089 while (prev && prev[0] === 'space') { 5090 prev = params[--shift] 5091 } 5092 if (prev) { 5093 node.source.end = this.getPosition(prev[3] || prev[2]) 5094 node.source.end.offset++ 5095 } 5096 } 5097 this.end(token) 5098 break 5099 } else { 5100 params.push(token) 5101 } 5102 } else { 5103 params.push(token) 5104 } 5105 5106 if (this.tokenizer.endOfFile()) { 5107 last = true 5108 break 5109 } 5110 } 5111 5112 node.raws.between = this.spacesAndCommentsFromEnd(params) 5113 if (params.length) { 5114 node.raws.afterName = this.spacesAndCommentsFromStart(params) 5115 this.raw(node, 'params', params) 5116 if (last) { 5117 token = params[params.length - 1] 5118 node.source.end = this.getPosition(token[3] || token[2]) 5119 node.source.end.offset++ 5120 this.spaces = node.raws.between 5121 node.raws.between = '' 5122 } 5123 } else { 5124 node.raws.afterName = '' 5125 node.params = '' 5126 } 5127 5128 if (open) { 5129 node.nodes = [] 5130 this.current = node 5131 } 5132 } 5133 5134 checkMissedSemicolon(tokens) { 5135 let colon = this.colon(tokens) 5136 if (colon === false) return 5137 5138 let founded = 0 5139 let token 5140 for (let j = colon - 1; j >= 0; j--) { 5141 token = tokens[j] 5142 if (token[0] !== 'space') { 5143 founded += 1 5144 if (founded === 2) break 5145 } 5146 } 5147 // If the token is a word, e.g. `!important`, `red` or any other valid property's value. 5148 // Then we need to return the colon after that word token. [3] is the "end" colon of that word. 5149 // And because we need it after that one we do +1 to get the next one. 5150 throw this.input.error( 5151 'Missed semicolon', 5152 token[0] === 'word' ? token[3] + 1 : token[2] 5153 ) 5154 } 5155 5156 colon(tokens) { 5157 let brackets = 0 5158 let token, type, prev 5159 for (let [i, element] of tokens.entries()) { 5160 token = element 5161 type = token[0] 5162 5163 if (type === '(') { 5164 brackets += 1 5165 } 5166 if (type === ')') { 5167 brackets -= 1 5168 } 5169 if (brackets === 0 && type === ':') { 5170 if (!prev) { 5171 this.doubleColon(token) 5172 } else if (prev[0] === 'word' && prev[1] === 'progid') { 5173 continue 5174 } else { 5175 return i 5176 } 5177 } 5178 5179 prev = token 5180 } 5181 return false 5182 } 5183 5184 comment(token) { 5185 let node = new Comment() 5186 this.init(node, token[2]) 5187 node.source.end = this.getPosition(token[3] || token[2]) 5188 node.source.end.offset++ 5189 5190 let text = token[1].slice(2, -2) 5191 if (/^\s*$/.test(text)) { 5192 node.text = '' 5193 node.raws.left = text 5194 node.raws.right = '' 5195 } else { 5196 let match = text.match(/^(\s*)([^]*\S)(\s*)$/) 5197 node.text = match[2] 5198 node.raws.left = match[1] 5199 node.raws.right = match[3] 5200 } 5201 } 5202 5203 createTokenizer() { 5204 this.tokenizer = tokenizer(this.input) 5205 } 5206 5207 decl(tokens, customProperty) { 5208 let node = new Declaration() 5209 this.init(node, tokens[0][2]) 5210 5211 let last = tokens[tokens.length - 1] 5212 if (last[0] === ';') { 5213 this.semicolon = true 5214 tokens.pop() 5215 } 5216 5217 node.source.end = this.getPosition( 5218 last[3] || last[2] || findLastWithPosition(tokens) 5219 ) 5220 node.source.end.offset++ 5221 5222 while (tokens[0][0] !== 'word') { 5223 if (tokens.length === 1) this.unknownWord(tokens) 5224 node.raws.before += tokens.shift()[1] 5225 } 5226 node.source.start = this.getPosition(tokens[0][2]) 5227 5228 node.prop = '' 5229 while (tokens.length) { 5230 let type = tokens[0][0] 5231 if (type === ':' || type === 'space' || type === 'comment') { 5232 break 5233 } 5234 node.prop += tokens.shift()[1] 5235 } 5236 5237 node.raws.between = '' 5238 5239 let token 5240 while (tokens.length) { 5241 token = tokens.shift() 5242 5243 if (token[0] === ':') { 5244 node.raws.between += token[1] 5245 break 5246 } else { 5247 if (token[0] === 'word' && /\w/.test(token[1])) { 5248 this.unknownWord([token]) 5249 } 5250 node.raws.between += token[1] 5251 } 5252 } 5253 5254 if (node.prop[0] === '_' || node.prop[0] === '*') { 5255 node.raws.before += node.prop[0] 5256 node.prop = node.prop.slice(1) 5257 } 5258 5259 let firstSpaces = [] 5260 let next 5261 while (tokens.length) { 5262 next = tokens[0][0] 5263 if (next !== 'space' && next !== 'comment') break 5264 firstSpaces.push(tokens.shift()) 5265 } 5266 5267 this.precheckMissedSemicolon(tokens) 5268 5269 for (let i = tokens.length - 1; i >= 0; i--) { 5270 token = tokens[i] 5271 if (token[1].toLowerCase() === '!important') { 5272 node.important = true 5273 let string = this.stringFrom(tokens, i) 5274 string = this.spacesFromEnd(tokens) + string 5275 if (string !== ' !important') node.raws.important = string 5276 break 5277 } else if (token[1].toLowerCase() === 'important') { 5278 let cache = tokens.slice(0) 5279 let str = '' 5280 for (let j = i; j > 0; j--) { 5281 let type = cache[j][0] 5282 if (str.trim().indexOf('!') === 0 && type !== 'space') { 5283 break 5284 } 5285 str = cache.pop()[1] + str 5286 } 5287 if (str.trim().indexOf('!') === 0) { 5288 node.important = true 5289 node.raws.important = str 5290 tokens = cache 5291 } 5292 } 5293 5294 if (token[0] !== 'space' && token[0] !== 'comment') { 5295 break 5296 } 5297 } 5298 5299 let hasWord = tokens.some(i => i[0] !== 'space' && i[0] !== 'comment') 5300 5301 if (hasWord) { 5302 node.raws.between += firstSpaces.map(i => i[1]).join('') 5303 firstSpaces = [] 5304 } 5305 this.raw(node, 'value', firstSpaces.concat(tokens), customProperty) 5306 5307 if (node.value.includes(':') && !customProperty) { 5308 this.checkMissedSemicolon(tokens) 5309 } 5310 } 5311 5312 doubleColon(token) { 5313 throw this.input.error( 5314 'Double colon', 5315 { offset: token[2] }, 5316 { offset: token[2] + token[1].length } 5317 ) 5318 } 5319 5320 emptyRule(token) { 5321 let node = new Rule() 5322 this.init(node, token[2]) 5323 node.selector = '' 5324 node.raws.between = '' 5325 this.current = node 5326 } 5327 5328 end(token) { 5329 if (this.current.nodes && this.current.nodes.length) { 5330 this.current.raws.semicolon = this.semicolon 5331 } 5332 this.semicolon = false 5333 5334 this.current.raws.after = (this.current.raws.after || '') + this.spaces 5335 this.spaces = '' 5336 5337 if (this.current.parent) { 5338 this.current.source.end = this.getPosition(token[2]) 5339 this.current.source.end.offset++ 5340 this.current = this.current.parent 5341 } else { 5342 this.unexpectedClose(token) 5343 } 5344 } 5345 5346 endFile() { 5347 if (this.current.parent) this.unclosedBlock() 5348 if (this.current.nodes && this.current.nodes.length) { 5349 this.current.raws.semicolon = this.semicolon 5350 } 5351 this.current.raws.after = (this.current.raws.after || '') + this.spaces 5352 this.root.source.end = this.getPosition(this.tokenizer.position()) 5353 } 5354 5355 freeSemicolon(token) { 5356 this.spaces += token[1] 5357 if (this.current.nodes) { 5358 let prev = this.current.nodes[this.current.nodes.length - 1] 5359 if (prev && prev.type === 'rule' && !prev.raws.ownSemicolon) { 5360 prev.raws.ownSemicolon = this.spaces 5361 this.spaces = '' 5362 } 5363 } 5364 } 5365 5366 // Helpers 5367 5368 getPosition(offset) { 5369 let pos = this.input.fromOffset(offset) 5370 return { 5371 column: pos.col, 5372 line: pos.line, 5373 offset 5374 } 5375 } 5376 5377 init(node, offset) { 5378 this.current.push(node) 5379 node.source = { 5380 input: this.input, 5381 start: this.getPosition(offset) 5382 } 5383 node.raws.before = this.spaces 5384 this.spaces = '' 5385 if (node.type !== 'comment') this.semicolon = false 5386 } 5387 5388 other(start) { 5389 let end = false 5390 let type = null 5391 let colon = false 5392 let bracket = null 5393 let brackets = [] 5394 let customProperty = start[1].startsWith('--') 5395 5396 let tokens = [] 5397 let token = start 5398 while (token) { 5399 type = token[0] 5400 tokens.push(token) 5401 5402 if (type === '(' || type === '[') { 5403 if (!bracket) bracket = token 5404 brackets.push(type === '(' ? ')' : ']') 5405 } else if (customProperty && colon && type === '{') { 5406 if (!bracket) bracket = token 5407 brackets.push('}') 5408 } else if (brackets.length === 0) { 5409 if (type === ';') { 5410 if (colon) { 5411 this.decl(tokens, customProperty) 5412 return 5413 } else { 5414 break 5415 } 5416 } else if (type === '{') { 5417 this.rule(tokens) 5418 return 5419 } else if (type === '}') { 5420 this.tokenizer.back(tokens.pop()) 5421 end = true 5422 break 5423 } else if (type === ':') { 5424 colon = true 5425 } 5426 } else if (type === brackets[brackets.length - 1]) { 5427 brackets.pop() 5428 if (brackets.length === 0) bracket = null 5429 } 5430 5431 token = this.tokenizer.nextToken() 5432 } 5433 5434 if (this.tokenizer.endOfFile()) end = true 5435 if (brackets.length > 0) this.unclosedBracket(bracket) 5436 5437 if (end && colon) { 5438 if (!customProperty) { 5439 while (tokens.length) { 5440 token = tokens[tokens.length - 1][0] 5441 if (token !== 'space' && token !== 'comment') break 5442 this.tokenizer.back(tokens.pop()) 5443 } 5444 } 5445 this.decl(tokens, customProperty) 5446 } else { 5447 this.unknownWord(tokens) 5448 } 5449 } 5450 5451 parse() { 5452 let token 5453 while (!this.tokenizer.endOfFile()) { 5454 token = this.tokenizer.nextToken() 5455 5456 switch (token[0]) { 5457 case 'space': 5458 this.spaces += token[1] 5459 break 5460 5461 case ';': 5462 this.freeSemicolon(token) 5463 break 5464 5465 case '}': 5466 this.end(token) 5467 break 5468 5469 case 'comment': 5470 this.comment(token) 5471 break 5472 5473 case 'at-word': 5474 this.atrule(token) 5475 break 5476 5477 case '{': 5478 this.emptyRule(token) 5479 break 5480 5481 default: 5482 this.other(token) 5483 break 5484 } 5485 } 5486 this.endFile() 5487 } 5488 5489 precheckMissedSemicolon(/* tokens */) { 5490 // Hook for Safe Parser 5491 } 5492 5493 raw(node, prop, tokens, customProperty) { 5494 let token, type 5495 let length = tokens.length 5496 let value = '' 5497 let clean = true 5498 let next, prev 5499 5500 for (let i = 0; i < length; i += 1) { 5501 token = tokens[i] 5502 type = token[0] 5503 if (type === 'space' && i === length - 1 && !customProperty) { 5504 clean = false 5505 } else if (type === 'comment') { 5506 prev = tokens[i - 1] ? tokens[i - 1][0] : 'empty' 5507 next = tokens[i + 1] ? tokens[i + 1][0] : 'empty' 5508 if (!SAFE_COMMENT_NEIGHBOR[prev] && !SAFE_COMMENT_NEIGHBOR[next]) { 5509 if (value.slice(-1) === ',') { 5510 clean = false 5511 } else { 5512 value += token[1] 5513 } 5514 } else { 5515 clean = false 5516 } 5517 } else { 5518 value += token[1] 5519 } 5520 } 5521 if (!clean) { 5522 let raw = tokens.reduce((all, i) => all + i[1], '') 5523 node.raws[prop] = { raw, value } 5524 } 5525 node[prop] = value 5526 } 5527 5528 rule(tokens) { 5529 tokens.pop() 5530 5531 let node = new Rule() 5532 this.init(node, tokens[0][2]) 5533 5534 node.raws.between = this.spacesAndCommentsFromEnd(tokens) 5535 this.raw(node, 'selector', tokens) 5536 this.current = node 5537 } 5538 5539 spacesAndCommentsFromEnd(tokens) { 5540 let lastTokenType 5541 let spaces = '' 5542 while (tokens.length) { 5543 lastTokenType = tokens[tokens.length - 1][0] 5544 if (lastTokenType !== 'space' && lastTokenType !== 'comment') break 5545 spaces = tokens.pop()[1] + spaces 5546 } 5547 return spaces 5548 } 5549 5550 // Errors 5551 5552 spacesAndCommentsFromStart(tokens) { 5553 let next 5554 let spaces = '' 5555 while (tokens.length) { 5556 next = tokens[0][0] 5557 if (next !== 'space' && next !== 'comment') break 5558 spaces += tokens.shift()[1] 5559 } 5560 return spaces 5561 } 5562 5563 spacesFromEnd(tokens) { 5564 let lastTokenType 5565 let spaces = '' 5566 while (tokens.length) { 5567 lastTokenType = tokens[tokens.length - 1][0] 5568 if (lastTokenType !== 'space') break 5569 spaces = tokens.pop()[1] + spaces 5570 } 5571 return spaces 5572 } 5573 5574 stringFrom(tokens, from) { 5575 let result = '' 5576 for (let i = from; i < tokens.length; i++) { 5577 result += tokens[i][1] 5578 } 5579 tokens.splice(from, tokens.length - from) 5580 return result 5581 } 5582 5583 unclosedBlock() { 5584 let pos = this.current.source.start 5585 throw this.input.error('Unclosed block', pos.line, pos.column) 5586 } 5587 5588 unclosedBracket(bracket) { 5589 throw this.input.error( 5590 'Unclosed bracket', 5591 { offset: bracket[2] }, 5592 { offset: bracket[2] + 1 } 5593 ) 5594 } 5595 5596 unexpectedClose(token) { 5597 throw this.input.error( 5598 'Unexpected }', 5599 { offset: token[2] }, 5600 { offset: token[2] + 1 } 5601 ) 5602 } 5603 5604 unknownWord(tokens) { 5605 throw this.input.error( 5606 'Unknown word', 5607 { offset: tokens[0][2] }, 5608 { offset: tokens[0][2] + tokens[0][1].length } 5609 ) 5610 } 5611 5612 unnamedAtrule(node, token) { 5613 throw this.input.error( 5614 'At-rule without name', 5615 { offset: token[2] }, 5616 { offset: token[2] + token[1].length } 5617 ) 5618 } 5619 } 5620 5621 module.exports = Parser 5622 5623 5624 /***/ }), 5625 5626 /***/ 4529: 5627 /***/ ((module, __unused_webpack_exports, __webpack_require__) => { 5628 5629 "use strict"; 5630 5631 5632 let CssSyntaxError = __webpack_require__(356) 5633 let Declaration = __webpack_require__(1516) 5634 let LazyResult = __webpack_require__(448) 5635 let Container = __webpack_require__(683) 5636 let Processor = __webpack_require__(9656) 5637 let stringify = __webpack_require__(633) 5638 let fromJSON = __webpack_require__(8940) 5639 let Document = __webpack_require__(271) 5640 let Warning = __webpack_require__(5776) 5641 let Comment = __webpack_require__(6589) 5642 let AtRule = __webpack_require__(1326) 5643 let Result = __webpack_require__(9055) 5644 let Input = __webpack_require__(5380) 5645 let parse = __webpack_require__(4295) 5646 let list = __webpack_require__(7374) 5647 let Rule = __webpack_require__(4092) 5648 let Root = __webpack_require__(9434) 5649 let Node = __webpack_require__(7490) 5650 5651 function postcss(...plugins) { 5652 if (plugins.length === 1 && Array.isArray(plugins[0])) { 5653 plugins = plugins[0] 5654 } 5655 return new Processor(plugins) 5656 } 5657 5658 postcss.plugin = function plugin(name, initializer) { 5659 let warningPrinted = false 5660 function creator(...args) { 5661 // eslint-disable-next-line no-console 5662 if (console && console.warn && !warningPrinted) { 5663 warningPrinted = true 5664 // eslint-disable-next-line no-console 5665 console.warn( 5666 name + 5667 ': postcss.plugin was deprecated. Migration guide:\n' + 5668 'https://evilmartians.com/chronicles/postcss-8-plugin-migration' 5669 ) 5670 if (process.env.LANG && process.env.LANG.startsWith('cn')) { 5671 /* c8 ignore next 7 */ 5672 // eslint-disable-next-line no-console 5673 console.warn( 5674 name + 5675 ': 里面 postcss.plugin 被弃用. 迁移指南:\n' + 5676 'https://www.w3ctech.com/topic/2226' 5677 ) 5678 } 5679 } 5680 let transformer = initializer(...args) 5681 transformer.postcssPlugin = name 5682 transformer.postcssVersion = new Processor().version 5683 return transformer 5684 } 5685 5686 let cache 5687 Object.defineProperty(creator, 'postcss', { 5688 get() { 5689 if (!cache) cache = creator() 5690 return cache 5691 } 5692 }) 5693 5694 creator.process = function (css, processOpts, pluginOpts) { 5695 return postcss([creator(pluginOpts)]).process(css, processOpts) 5696 } 5697 5698 return creator 5699 } 5700 5701 postcss.stringify = stringify 5702 postcss.parse = parse 5703 postcss.fromJSON = fromJSON 5704 postcss.list = list 5705 5706 postcss.comment = defaults => new Comment(defaults) 5707 postcss.atRule = defaults => new AtRule(defaults) 5708 postcss.decl = defaults => new Declaration(defaults) 5709 postcss.rule = defaults => new Rule(defaults) 5710 postcss.root = defaults => new Root(defaults) 5711 postcss.document = defaults => new Document(defaults) 5712 5713 postcss.CssSyntaxError = CssSyntaxError 5714 postcss.Declaration = Declaration 5715 postcss.Container = Container 5716 postcss.Processor = Processor 5717 postcss.Document = Document 5718 postcss.Comment = Comment 5719 postcss.Warning = Warning 5720 postcss.AtRule = AtRule 5721 postcss.Result = Result 5722 postcss.Input = Input 5723 postcss.Rule = Rule 5724 postcss.Root = Root 5725 postcss.Node = Node 5726 5727 LazyResult.registerPostcss(postcss) 5728 5729 module.exports = postcss 5730 postcss.default = postcss 5731 5732 5733 /***/ }), 5734 5735 /***/ 5696: 5736 /***/ ((module, __unused_webpack_exports, __webpack_require__) => { 5737 5738 "use strict"; 5739 5740 5741 let { SourceMapConsumer, SourceMapGenerator } = __webpack_require__(1866) 5742 let { existsSync, readFileSync } = __webpack_require__(9977) 5743 let { dirname, join } = __webpack_require__(197) 5744 5745 function fromBase64(str) { 5746 if (Buffer) { 5747 return Buffer.from(str, 'base64').toString() 5748 } else { 5749 /* c8 ignore next 2 */ 5750 return window.atob(str) 5751 } 5752 } 5753 5754 class PreviousMap { 5755 constructor(css, opts) { 5756 if (opts.map === false) return 5757 this.loadAnnotation(css) 5758 this.inline = this.startWith(this.annotation, 'data:') 5759 5760 let prev = opts.map ? opts.map.prev : undefined 5761 let text = this.loadMap(opts.from, prev) 5762 if (!this.mapFile && opts.from) { 5763 this.mapFile = opts.from 5764 } 5765 if (this.mapFile) this.root = dirname(this.mapFile) 5766 if (text) this.text = text 5767 } 5768 5769 consumer() { 5770 if (!this.consumerCache) { 5771 this.consumerCache = new SourceMapConsumer(this.text) 5772 } 5773 return this.consumerCache 5774 } 5775 5776 decodeInline(text) { 5777 let baseCharsetUri = /^data:application\/json;charset=utf-?8;base64,/ 5778 let baseUri = /^data:application\/json;base64,/ 5779 let charsetUri = /^data:application\/json;charset=utf-?8,/ 5780 let uri = /^data:application\/json,/ 5781 5782 if (charsetUri.test(text) || uri.test(text)) { 5783 return decodeURIComponent(text.substr(RegExp.lastMatch.length)) 5784 } 5785 5786 if (baseCharsetUri.test(text) || baseUri.test(text)) { 5787 return fromBase64(text.substr(RegExp.lastMatch.length)) 5788 } 5789 5790 let encoding = text.match(/data:application\/json;([^,]+),/)[1] 5791 throw new Error('Unsupported source map encoding ' + encoding) 5792 } 5793 5794 getAnnotationURL(sourceMapString) { 5795 return sourceMapString.replace(/^\/\*\s*# sourceMappingURL=/, '').trim() 5796 } 5797 5798 isMap(map) { 5799 if (typeof map !== 'object') return false 5800 return ( 5801 typeof map.mappings === 'string' || 5802 typeof map._mappings === 'string' || 5803 Array.isArray(map.sections) 5804 ) 5805 } 5806 5807 loadAnnotation(css) { 5808 let comments = css.match(/\/\*\s*# sourceMappingURL=/gm) 5809 if (!comments) return 5810 5811 // sourceMappingURLs from comments, strings, etc. 5812 let start = css.lastIndexOf(comments.pop()) 5813 let end = css.indexOf('*/', start) 5814 5815 if (start > -1 && end > -1) { 5816 // Locate the last sourceMappingURL to avoid pickin 5817 this.annotation = this.getAnnotationURL(css.substring(start, end)) 5818 } 5819 } 5820 5821 loadFile(path) { 5822 this.root = dirname(path) 5823 if (existsSync(path)) { 5824 this.mapFile = path 5825 return readFileSync(path, 'utf-8').toString().trim() 5826 } 5827 } 5828 5829 loadMap(file, prev) { 5830 if (prev === false) return false 5831 5832 if (prev) { 5833 if (typeof prev === 'string') { 5834 return prev 5835 } else if (typeof prev === 'function') { 5836 let prevPath = prev(file) 5837 if (prevPath) { 5838 let map = this.loadFile(prevPath) 5839 if (!map) { 5840 throw new Error( 5841 'Unable to load previous source map: ' + prevPath.toString() 5842 ) 5843 } 5844 return map 5845 } 5846 } else if (prev instanceof SourceMapConsumer) { 5847 return SourceMapGenerator.fromSourceMap(prev).toString() 5848 } else if (prev instanceof SourceMapGenerator) { 5849 return prev.toString() 5850 } else if (this.isMap(prev)) { 5851 return JSON.stringify(prev) 5852 } else { 5853 throw new Error( 5854 'Unsupported previous source map format: ' + prev.toString() 5855 ) 5856 } 5857 } else if (this.inline) { 5858 return this.decodeInline(this.annotation) 5859 } else if (this.annotation) { 5860 let map = this.annotation 5861 if (file) map = join(dirname(file), map) 5862 return this.loadFile(map) 5863 } 5864 } 5865 5866 startWith(string, start) { 5867 if (!string) return false 5868 return string.substr(0, start.length) === start 5869 } 5870 5871 withContent() { 5872 return !!( 5873 this.consumer().sourcesContent && 5874 this.consumer().sourcesContent.length > 0 5875 ) 5876 } 5877 } 5878 5879 module.exports = PreviousMap 5880 PreviousMap.default = PreviousMap 5881 5882 5883 /***/ }), 5884 5885 /***/ 9656: 5886 /***/ ((module, __unused_webpack_exports, __webpack_require__) => { 5887 5888 "use strict"; 5889 5890 5891 let NoWorkResult = __webpack_require__(7661) 5892 let LazyResult = __webpack_require__(448) 5893 let Document = __webpack_require__(271) 5894 let Root = __webpack_require__(9434) 5895 5896 class Processor { 5897 constructor(plugins = []) { 5898 this.version = '8.4.38' 5899 this.plugins = this.normalize(plugins) 5900 } 5901 5902 normalize(plugins) { 5903 let normalized = [] 5904 for (let i of plugins) { 5905 if (i.postcss === true) { 5906 i = i() 5907 } else if (i.postcss) { 5908 i = i.postcss 5909 } 5910 5911 if (typeof i === 'object' && Array.isArray(i.plugins)) { 5912 normalized = normalized.concat(i.plugins) 5913 } else if (typeof i === 'object' && i.postcssPlugin) { 5914 normalized.push(i) 5915 } else if (typeof i === 'function') { 5916 normalized.push(i) 5917 } else if (typeof i === 'object' && (i.parse || i.stringify)) { 5918 if (false) {} 5919 } else { 5920 throw new Error(i + ' is not a PostCSS plugin') 5921 } 5922 } 5923 return normalized 5924 } 5925 5926 process(css, opts = {}) { 5927 if ( 5928 !this.plugins.length && 5929 !opts.parser && 5930 !opts.stringifier && 5931 !opts.syntax 5932 ) { 5933 return new NoWorkResult(this, css, opts) 5934 } else { 5935 return new LazyResult(this, css, opts) 5936 } 5937 } 5938 5939 use(plugin) { 5940 this.plugins = this.plugins.concat(this.normalize([plugin])) 5941 return this 5942 } 5943 } 5944 5945 module.exports = Processor 5946 Processor.default = Processor 5947 5948 Root.registerProcessor(Processor) 5949 Document.registerProcessor(Processor) 5950 5951 5952 /***/ }), 5953 5954 /***/ 9055: 5955 /***/ ((module, __unused_webpack_exports, __webpack_require__) => { 5956 5957 "use strict"; 5958 5959 5960 let Warning = __webpack_require__(5776) 5961 5962 class Result { 5963 constructor(processor, root, opts) { 5964 this.processor = processor 5965 this.messages = [] 5966 this.root = root 5967 this.opts = opts 5968 this.css = undefined 5969 this.map = undefined 5970 } 5971 5972 toString() { 5973 return this.css 5974 } 5975 5976 warn(text, opts = {}) { 5977 if (!opts.plugin) { 5978 if (this.lastPlugin && this.lastPlugin.postcssPlugin) { 5979 opts.plugin = this.lastPlugin.postcssPlugin 5980 } 5981 } 5982 5983 let warning = new Warning(text, opts) 5984 this.messages.push(warning) 5985 5986 return warning 5987 } 5988 5989 warnings() { 5990 return this.messages.filter(i => i.type === 'warning') 5991 } 5992 5993 get content() { 5994 return this.css 5995 } 5996 } 5997 5998 module.exports = Result 5999 Result.default = Result 6000 6001 6002 /***/ }), 6003 6004 /***/ 9434: 6005 /***/ ((module, __unused_webpack_exports, __webpack_require__) => { 6006 6007 "use strict"; 6008 6009 6010 let Container = __webpack_require__(683) 6011 6012 let LazyResult, Processor 6013 6014 class Root extends Container { 6015 constructor(defaults) { 6016 super(defaults) 6017 this.type = 'root' 6018 if (!this.nodes) this.nodes = [] 6019 } 6020 6021 normalize(child, sample, type) { 6022 let nodes = super.normalize(child) 6023 6024 if (sample) { 6025 if (type === 'prepend') { 6026 if (this.nodes.length > 1) { 6027 sample.raws.before = this.nodes[1].raws.before 6028 } else { 6029 delete sample.raws.before 6030 } 6031 } else if (this.first !== sample) { 6032 for (let node of nodes) { 6033 node.raws.before = sample.raws.before 6034 } 6035 } 6036 } 6037 6038 return nodes 6039 } 6040 6041 removeChild(child, ignore) { 6042 let index = this.index(child) 6043 6044 if (!ignore && index === 0 && this.nodes.length > 1) { 6045 this.nodes[1].raws.before = this.nodes[index].raws.before 6046 } 6047 6048 return super.removeChild(child) 6049 } 6050 6051 toResult(opts = {}) { 6052 let lazy = new LazyResult(new Processor(), this, opts) 6053 return lazy.stringify() 6054 } 6055 } 6056 6057 Root.registerLazyResult = dependant => { 6058 LazyResult = dependant 6059 } 6060 6061 Root.registerProcessor = dependant => { 6062 Processor = dependant 6063 } 6064 6065 module.exports = Root 6066 Root.default = Root 6067 6068 Container.registerRoot(Root) 6069 6070 6071 /***/ }), 6072 6073 /***/ 4092: 6074 /***/ ((module, __unused_webpack_exports, __webpack_require__) => { 6075 6076 "use strict"; 6077 6078 6079 let Container = __webpack_require__(683) 6080 let list = __webpack_require__(7374) 6081 6082 class Rule extends Container { 6083 constructor(defaults) { 6084 super(defaults) 6085 this.type = 'rule' 6086 if (!this.nodes) this.nodes = [] 6087 } 6088 6089 get selectors() { 6090 return list.comma(this.selector) 6091 } 6092 6093 set selectors(values) { 6094 let match = this.selector ? this.selector.match(/,\s*/) : null 6095 let sep = match ? match[0] : ',' + this.raw('between', 'beforeOpen') 6096 this.selector = values.join(sep) 6097 } 6098 } 6099 6100 module.exports = Rule 6101 Rule.default = Rule 6102 6103 Container.registerRule(Rule) 6104 6105 6106 /***/ }), 6107 6108 /***/ 346: 6109 /***/ ((module) => { 6110 6111 "use strict"; 6112 6113 6114 const DEFAULT_RAW = { 6115 after: '\n', 6116 beforeClose: '\n', 6117 beforeComment: '\n', 6118 beforeDecl: '\n', 6119 beforeOpen: ' ', 6120 beforeRule: '\n', 6121 colon: ': ', 6122 commentLeft: ' ', 6123 commentRight: ' ', 6124 emptyBody: '', 6125 indent: ' ', 6126 semicolon: false 6127 } 6128 6129 function capitalize(str) { 6130 return str[0].toUpperCase() + str.slice(1) 6131 } 6132 6133 class Stringifier { 6134 constructor(builder) { 6135 this.builder = builder 6136 } 6137 6138 atrule(node, semicolon) { 6139 let name = '@' + node.name 6140 let params = node.params ? this.rawValue(node, 'params') : '' 6141 6142 if (typeof node.raws.afterName !== 'undefined') { 6143 name += node.raws.afterName 6144 } else if (params) { 6145 name += ' ' 6146 } 6147 6148 if (node.nodes) { 6149 this.block(node, name + params) 6150 } else { 6151 let end = (node.raws.between || '') + (semicolon ? ';' : '') 6152 this.builder(name + params + end, node) 6153 } 6154 } 6155 6156 beforeAfter(node, detect) { 6157 let value 6158 if (node.type === 'decl') { 6159 value = this.raw(node, null, 'beforeDecl') 6160 } else if (node.type === 'comment') { 6161 value = this.raw(node, null, 'beforeComment') 6162 } else if (detect === 'before') { 6163 value = this.raw(node, null, 'beforeRule') 6164 } else { 6165 value = this.raw(node, null, 'beforeClose') 6166 } 6167 6168 let buf = node.parent 6169 let depth = 0 6170 while (buf && buf.type !== 'root') { 6171 depth += 1 6172 buf = buf.parent 6173 } 6174 6175 if (value.includes('\n')) { 6176 let indent = this.raw(node, null, 'indent') 6177 if (indent.length) { 6178 for (let step = 0; step < depth; step++) value += indent 6179 } 6180 } 6181 6182 return value 6183 } 6184 6185 block(node, start) { 6186 let between = this.raw(node, 'between', 'beforeOpen') 6187 this.builder(start + between + '{', node, 'start') 6188 6189 let after 6190 if (node.nodes && node.nodes.length) { 6191 this.body(node) 6192 after = this.raw(node, 'after') 6193 } else { 6194 after = this.raw(node, 'after', 'emptyBody') 6195 } 6196 6197 if (after) this.builder(after) 6198 this.builder('}', node, 'end') 6199 } 6200 6201 body(node) { 6202 let last = node.nodes.length - 1 6203 while (last > 0) { 6204 if (node.nodes[last].type !== 'comment') break 6205 last -= 1 6206 } 6207 6208 let semicolon = this.raw(node, 'semicolon') 6209 for (let i = 0; i < node.nodes.length; i++) { 6210 let child = node.nodes[i] 6211 let before = this.raw(child, 'before') 6212 if (before) this.builder(before) 6213 this.stringify(child, last !== i || semicolon) 6214 } 6215 } 6216 6217 comment(node) { 6218 let left = this.raw(node, 'left', 'commentLeft') 6219 let right = this.raw(node, 'right', 'commentRight') 6220 this.builder('/*' + left + node.text + right + '*/', node) 6221 } 6222 6223 decl(node, semicolon) { 6224 let between = this.raw(node, 'between', 'colon') 6225 let string = node.prop + between + this.rawValue(node, 'value') 6226 6227 if (node.important) { 6228 string += node.raws.important || ' !important' 6229 } 6230 6231 if (semicolon) string += ';' 6232 this.builder(string, node) 6233 } 6234 6235 document(node) { 6236 this.body(node) 6237 } 6238 6239 raw(node, own, detect) { 6240 let value 6241 if (!detect) detect = own 6242 6243 // Already had 6244 if (own) { 6245 value = node.raws[own] 6246 if (typeof value !== 'undefined') return value 6247 } 6248 6249 let parent = node.parent 6250 6251 if (detect === 'before') { 6252 // Hack for first rule in CSS 6253 if (!parent || (parent.type === 'root' && parent.first === node)) { 6254 return '' 6255 } 6256 6257 // `root` nodes in `document` should use only their own raws 6258 if (parent && parent.type === 'document') { 6259 return '' 6260 } 6261 } 6262 6263 // Floating child without parent 6264 if (!parent) return DEFAULT_RAW[detect] 6265 6266 // Detect style by other nodes 6267 let root = node.root() 6268 if (!root.rawCache) root.rawCache = {} 6269 if (typeof root.rawCache[detect] !== 'undefined') { 6270 return root.rawCache[detect] 6271 } 6272 6273 if (detect === 'before' || detect === 'after') { 6274 return this.beforeAfter(node, detect) 6275 } else { 6276 let method = 'raw' + capitalize(detect) 6277 if (this[method]) { 6278 value = this[method](root, node) 6279 } else { 6280 root.walk(i => { 6281 value = i.raws[own] 6282 if (typeof value !== 'undefined') return false 6283 }) 6284 } 6285 } 6286 6287 if (typeof value === 'undefined') value = DEFAULT_RAW[detect] 6288 6289 root.rawCache[detect] = value 6290 return value 6291 } 6292 6293 rawBeforeClose(root) { 6294 let value 6295 root.walk(i => { 6296 if (i.nodes && i.nodes.length > 0) { 6297 if (typeof i.raws.after !== 'undefined') { 6298 value = i.raws.after 6299 if (value.includes('\n')) { 6300 value = value.replace(/[^\n]+$/, '') 6301 } 6302 return false 6303 } 6304 } 6305 }) 6306 if (value) value = value.replace(/\S/g, '') 6307 return value 6308 } 6309 6310 rawBeforeComment(root, node) { 6311 let value 6312 root.walkComments(i => { 6313 if (typeof i.raws.before !== 'undefined') { 6314 value = i.raws.before 6315 if (value.includes('\n')) { 6316 value = value.replace(/[^\n]+$/, '') 6317 } 6318 return false 6319 } 6320 }) 6321 if (typeof value === 'undefined') { 6322 value = this.raw(node, null, 'beforeDecl') 6323 } else if (value) { 6324 value = value.replace(/\S/g, '') 6325 } 6326 return value 6327 } 6328 6329 rawBeforeDecl(root, node) { 6330 let value 6331 root.walkDecls(i => { 6332 if (typeof i.raws.before !== 'undefined') { 6333 value = i.raws.before 6334 if (value.includes('\n')) { 6335 value = value.replace(/[^\n]+$/, '') 6336 } 6337 return false 6338 } 6339 }) 6340 if (typeof value === 'undefined') { 6341 value = this.raw(node, null, 'beforeRule') 6342 } else if (value) { 6343 value = value.replace(/\S/g, '') 6344 } 6345 return value 6346 } 6347 6348 rawBeforeOpen(root) { 6349 let value 6350 root.walk(i => { 6351 if (i.type !== 'decl') { 6352 value = i.raws.between 6353 if (typeof value !== 'undefined') return false 6354 } 6355 }) 6356 return value 6357 } 6358 6359 rawBeforeRule(root) { 6360 let value 6361 root.walk(i => { 6362 if (i.nodes && (i.parent !== root || root.first !== i)) { 6363 if (typeof i.raws.before !== 'undefined') { 6364 value = i.raws.before 6365 if (value.includes('\n')) { 6366 value = value.replace(/[^\n]+$/, '') 6367 } 6368 return false 6369 } 6370 } 6371 }) 6372 if (value) value = value.replace(/\S/g, '') 6373 return value 6374 } 6375 6376 rawColon(root) { 6377 let value 6378 root.walkDecls(i => { 6379 if (typeof i.raws.between !== 'undefined') { 6380 value = i.raws.between.replace(/[^\s:]/g, '') 6381 return false 6382 } 6383 }) 6384 return value 6385 } 6386 6387 rawEmptyBody(root) { 6388 let value 6389 root.walk(i => { 6390 if (i.nodes && i.nodes.length === 0) { 6391 value = i.raws.after 6392 if (typeof value !== 'undefined') return false 6393 } 6394 }) 6395 return value 6396 } 6397 6398 rawIndent(root) { 6399 if (root.raws.indent) return root.raws.indent 6400 let value 6401 root.walk(i => { 6402 let p = i.parent 6403 if (p && p !== root && p.parent && p.parent === root) { 6404 if (typeof i.raws.before !== 'undefined') { 6405 let parts = i.raws.before.split('\n') 6406 value = parts[parts.length - 1] 6407 value = value.replace(/\S/g, '') 6408 return false 6409 } 6410 } 6411 }) 6412 return value 6413 } 6414 6415 rawSemicolon(root) { 6416 let value 6417 root.walk(i => { 6418 if (i.nodes && i.nodes.length && i.last.type === 'decl') { 6419 value = i.raws.semicolon 6420 if (typeof value !== 'undefined') return false 6421 } 6422 }) 6423 return value 6424 } 6425 6426 rawValue(node, prop) { 6427 let value = node[prop] 6428 let raw = node.raws[prop] 6429 if (raw && raw.value === value) { 6430 return raw.raw 6431 } 6432 6433 return value 6434 } 6435 6436 root(node) { 6437 this.body(node) 6438 if (node.raws.after) this.builder(node.raws.after) 6439 } 6440 6441 rule(node) { 6442 this.block(node, this.rawValue(node, 'selector')) 6443 if (node.raws.ownSemicolon) { 6444 this.builder(node.raws.ownSemicolon, node, 'end') 6445 } 6446 } 6447 6448 stringify(node, semicolon) { 6449 /* c8 ignore start */ 6450 if (!this[node.type]) { 6451 throw new Error( 6452 'Unknown AST node type ' + 6453 node.type + 6454 '. ' + 6455 'Maybe you need to change PostCSS stringifier.' 6456 ) 6457 } 6458 /* c8 ignore stop */ 6459 this[node.type](node, semicolon) 6460 } 6461 } 6462 6463 module.exports = Stringifier 6464 Stringifier.default = Stringifier 6465 6466 6467 /***/ }), 6468 6469 /***/ 633: 6470 /***/ ((module, __unused_webpack_exports, __webpack_require__) => { 6471 6472 "use strict"; 6473 6474 6475 let Stringifier = __webpack_require__(346) 6476 6477 function stringify(node, builder) { 6478 let str = new Stringifier(builder) 6479 str.stringify(node) 6480 } 6481 6482 module.exports = stringify 6483 stringify.default = stringify 6484 6485 6486 /***/ }), 6487 6488 /***/ 1381: 6489 /***/ ((module) => { 6490 6491 "use strict"; 6492 6493 6494 module.exports.isClean = Symbol('isClean') 6495 6496 module.exports.my = Symbol('my') 6497 6498 6499 /***/ }), 6500 6501 /***/ 2327: 6502 /***/ ((module) => { 6503 6504 "use strict"; 6505 6506 6507 const SINGLE_QUOTE = "'".charCodeAt(0) 6508 const DOUBLE_QUOTE = '"'.charCodeAt(0) 6509 const BACKSLASH = '\\'.charCodeAt(0) 6510 const SLASH = '/'.charCodeAt(0) 6511 const NEWLINE = '\n'.charCodeAt(0) 6512 const SPACE = ' '.charCodeAt(0) 6513 const FEED = '\f'.charCodeAt(0) 6514 const TAB = '\t'.charCodeAt(0) 6515 const CR = '\r'.charCodeAt(0) 6516 const OPEN_SQUARE = '['.charCodeAt(0) 6517 const CLOSE_SQUARE = ']'.charCodeAt(0) 6518 const OPEN_PARENTHESES = '('.charCodeAt(0) 6519 const CLOSE_PARENTHESES = ')'.charCodeAt(0) 6520 const OPEN_CURLY = '{'.charCodeAt(0) 6521 const CLOSE_CURLY = '}'.charCodeAt(0) 6522 const SEMICOLON = ';'.charCodeAt(0) 6523 const ASTERISK = '*'.charCodeAt(0) 6524 const COLON = ':'.charCodeAt(0) 6525 const AT = '@'.charCodeAt(0) 6526 6527 const RE_AT_END = /[\t\n\f\r "#'()/;[\\\]{}]/g 6528 const RE_WORD_END = /[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g 6529 const RE_BAD_BRACKET = /.[\r\n"'(/\\]/ 6530 const RE_HEX_ESCAPE = /[\da-f]/i 6531 6532 module.exports = function tokenizer(input, options = {}) { 6533 let css = input.css.valueOf() 6534 let ignore = options.ignoreErrors 6535 6536 let code, next, quote, content, escape 6537 let escaped, escapePos, prev, n, currentToken 6538 6539 let length = css.length 6540 let pos = 0 6541 let buffer = [] 6542 let returned = [] 6543 6544 function position() { 6545 return pos 6546 } 6547 6548 function unclosed(what) { 6549 throw input.error('Unclosed ' + what, pos) 6550 } 6551 6552 function endOfFile() { 6553 return returned.length === 0 && pos >= length 6554 } 6555 6556 function nextToken(opts) { 6557 if (returned.length) return returned.pop() 6558 if (pos >= length) return 6559 6560 let ignoreUnclosed = opts ? opts.ignoreUnclosed : false 6561 6562 code = css.charCodeAt(pos) 6563 6564 switch (code) { 6565 case NEWLINE: 6566 case SPACE: 6567 case TAB: 6568 case CR: 6569 case FEED: { 6570 next = pos 6571 do { 6572 next += 1 6573 code = css.charCodeAt(next) 6574 } while ( 6575 code === SPACE || 6576 code === NEWLINE || 6577 code === TAB || 6578 code === CR || 6579 code === FEED 6580 ) 6581 6582 currentToken = ['space', css.slice(pos, next)] 6583 pos = next - 1 6584 break 6585 } 6586 6587 case OPEN_SQUARE: 6588 case CLOSE_SQUARE: 6589 case OPEN_CURLY: 6590 case CLOSE_CURLY: 6591 case COLON: 6592 case SEMICOLON: 6593 case CLOSE_PARENTHESES: { 6594 let controlChar = String.fromCharCode(code) 6595 currentToken = [controlChar, controlChar, pos] 6596 break 6597 } 6598 6599 case OPEN_PARENTHESES: { 6600 prev = buffer.length ? buffer.pop()[1] : '' 6601 n = css.charCodeAt(pos + 1) 6602 if ( 6603 prev === 'url' && 6604 n !== SINGLE_QUOTE && 6605 n !== DOUBLE_QUOTE && 6606 n !== SPACE && 6607 n !== NEWLINE && 6608 n !== TAB && 6609 n !== FEED && 6610 n !== CR 6611 ) { 6612 next = pos 6613 do { 6614 escaped = false 6615 next = css.indexOf(')', next + 1) 6616 if (next === -1) { 6617 if (ignore || ignoreUnclosed) { 6618 next = pos 6619 break 6620 } else { 6621 unclosed('bracket') 6622 } 6623 } 6624 escapePos = next 6625 while (css.charCodeAt(escapePos - 1) === BACKSLASH) { 6626 escapePos -= 1 6627 escaped = !escaped 6628 } 6629 } while (escaped) 6630 6631 currentToken = ['brackets', css.slice(pos, next + 1), pos, next] 6632 6633 pos = next 6634 } else { 6635 next = css.indexOf(')', pos + 1) 6636 content = css.slice(pos, next + 1) 6637 6638 if (next === -1 || RE_BAD_BRACKET.test(content)) { 6639 currentToken = ['(', '(', pos] 6640 } else { 6641 currentToken = ['brackets', content, pos, next] 6642 pos = next 6643 } 6644 } 6645 6646 break 6647 } 6648 6649 case SINGLE_QUOTE: 6650 case DOUBLE_QUOTE: { 6651 quote = code === SINGLE_QUOTE ? "'" : '"' 6652 next = pos 6653 do { 6654 escaped = false 6655 next = css.indexOf(quote, next + 1) 6656 if (next === -1) { 6657 if (ignore || ignoreUnclosed) { 6658 next = pos + 1 6659 break 6660 } else { 6661 unclosed('string') 6662 } 6663 } 6664 escapePos = next 6665 while (css.charCodeAt(escapePos - 1) === BACKSLASH) { 6666 escapePos -= 1 6667 escaped = !escaped 6668 } 6669 } while (escaped) 6670 6671 currentToken = ['string', css.slice(pos, next + 1), pos, next] 6672 pos = next 6673 break 6674 } 6675 6676 case AT: { 6677 RE_AT_END.lastIndex = pos + 1 6678 RE_AT_END.test(css) 6679 if (RE_AT_END.lastIndex === 0) { 6680 next = css.length - 1 6681 } else { 6682 next = RE_AT_END.lastIndex - 2 6683 } 6684 6685 currentToken = ['at-word', css.slice(pos, next + 1), pos, next] 6686 6687 pos = next 6688 break 6689 } 6690 6691 case BACKSLASH: { 6692 next = pos 6693 escape = true 6694 while (css.charCodeAt(next + 1) === BACKSLASH) { 6695 next += 1 6696 escape = !escape 6697 } 6698 code = css.charCodeAt(next + 1) 6699 if ( 6700 escape && 6701 code !== SLASH && 6702 code !== SPACE && 6703 code !== NEWLINE && 6704 code !== TAB && 6705 code !== CR && 6706 code !== FEED 6707 ) { 6708 next += 1 6709 if (RE_HEX_ESCAPE.test(css.charAt(next))) { 6710 while (RE_HEX_ESCAPE.test(css.charAt(next + 1))) { 6711 next += 1 6712 } 6713 if (css.charCodeAt(next + 1) === SPACE) { 6714 next += 1 6715 } 6716 } 6717 } 6718 6719 currentToken = ['word', css.slice(pos, next + 1), pos, next] 6720 6721 pos = next 6722 break 6723 } 6724 6725 default: { 6726 if (code === SLASH && css.charCodeAt(pos + 1) === ASTERISK) { 6727 next = css.indexOf('*/', pos + 2) + 1 6728 if (next === 0) { 6729 if (ignore || ignoreUnclosed) { 6730 next = css.length 6731 } else { 6732 unclosed('comment') 6733 } 6734 } 6735 6736 currentToken = ['comment', css.slice(pos, next + 1), pos, next] 6737 pos = next 6738 } else { 6739 RE_WORD_END.lastIndex = pos + 1 6740 RE_WORD_END.test(css) 6741 if (RE_WORD_END.lastIndex === 0) { 6742 next = css.length - 1 6743 } else { 6744 next = RE_WORD_END.lastIndex - 2 6745 } 6746 6747 currentToken = ['word', css.slice(pos, next + 1), pos, next] 6748 buffer.push(currentToken) 6749 pos = next 6750 } 6751 6752 break 6753 } 6754 } 6755 6756 pos++ 6757 return currentToken 6758 } 6759 6760 function back(token) { 6761 returned.push(token) 6762 } 6763 6764 return { 6765 back, 6766 endOfFile, 6767 nextToken, 6768 position 6769 } 6770 } 6771 6772 6773 /***/ }), 6774 6775 /***/ 3122: 6776 /***/ ((module) => { 6777 6778 "use strict"; 6779 /* eslint-disable no-console */ 6780 6781 6782 let printed = {} 6783 6784 module.exports = function warnOnce(message) { 6785 if (printed[message]) return 6786 printed[message] = true 6787 6788 if (typeof console !== 'undefined' && console.warn) { 6789 console.warn(message) 6790 } 6791 } 6792 6793 6794 /***/ }), 6795 6796 /***/ 5776: 6797 /***/ ((module) => { 6798 6799 "use strict"; 6800 6801 6802 class Warning { 6803 constructor(text, opts = {}) { 6804 this.type = 'warning' 6805 this.text = text 6806 6807 if (opts.node && opts.node.source) { 6808 let range = opts.node.rangeBy(opts) 6809 this.line = range.start.line 6810 this.column = range.start.column 6811 this.endLine = range.end.line 6812 this.endColumn = range.end.column 6813 } 6814 6815 for (let opt in opts) this[opt] = opts[opt] 6816 } 6817 6818 toString() { 6819 if (this.node) { 6820 return this.node.error(this.text, { 6821 index: this.index, 6822 plugin: this.plugin, 6823 word: this.word 6824 }).message 6825 } 6826 6827 if (this.plugin) { 6828 return this.plugin + ': ' + this.text 6829 } 6830 6831 return this.text 6832 } 6833 } 6834 6835 module.exports = Warning 6836 Warning.default = Warning 6837 6838 6839 /***/ }), 6840 6841 /***/ 628: 6842 /***/ ((module, __unused_webpack_exports, __webpack_require__) => { 6843 6844 "use strict"; 6845 /** 6846 * Copyright (c) 2013-present, Facebook, Inc. 6847 * 6848 * This source code is licensed under the MIT license found in the 6849 * LICENSE file in the root directory of this source tree. 6850 */ 6851 6852 6853 6854 var ReactPropTypesSecret = __webpack_require__(4067); 6855 6856 function emptyFunction() {} 6857 function emptyFunctionWithReset() {} 6858 emptyFunctionWithReset.resetWarningCache = emptyFunction; 6859 6860 module.exports = function() { 6861 function shim(props, propName, componentName, location, propFullName, secret) { 6862 if (secret === ReactPropTypesSecret) { 6863 // It is still safe when called from React. 6864 return; 6865 } 6866 var err = new Error( 6867 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + 6868 'Use PropTypes.checkPropTypes() to call them. ' + 6869 'Read more at http://fb.me/use-check-prop-types' 6870 ); 6871 err.name = 'Invariant Violation'; 6872 throw err; 6873 }; 6874 shim.isRequired = shim; 6875 function getShim() { 6876 return shim; 6877 }; 6878 // Important! 6879 // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`. 6880 var ReactPropTypes = { 6881 array: shim, 6882 bigint: shim, 6883 bool: shim, 6884 func: shim, 6885 number: shim, 6886 object: shim, 6887 string: shim, 6888 symbol: shim, 6889 6890 any: shim, 6891 arrayOf: getShim, 6892 element: shim, 6893 elementType: shim, 6894 instanceOf: getShim, 6895 node: shim, 6896 objectOf: getShim, 6897 oneOf: getShim, 6898 oneOfType: getShim, 6899 shape: getShim, 6900 exact: getShim, 6901 6902 checkPropTypes: emptyFunctionWithReset, 6903 resetWarningCache: emptyFunction 6904 }; 6905 6906 ReactPropTypes.PropTypes = ReactPropTypes; 6907 6908 return ReactPropTypes; 6909 }; 6910 6911 6912 /***/ }), 6913 6914 /***/ 5826: 6915 /***/ ((module, __unused_webpack_exports, __webpack_require__) => { 6916 6917 /** 6918 * Copyright (c) 2013-present, Facebook, Inc. 6919 * 6920 * This source code is licensed under the MIT license found in the 6921 * LICENSE file in the root directory of this source tree. 6922 */ 6923 6924 if (false) { var throwOnDirectAccess, ReactIs; } else { 6925 // By explicitly using `prop-types` you are opting into new production behavior. 6926 // http://fb.me/prop-types-in-prod 6927 module.exports = __webpack_require__(628)(); 6928 } 6929 6930 6931 /***/ }), 6932 6933 /***/ 4067: 6934 /***/ ((module) => { 6935 6936 "use strict"; 6937 /** 6938 * Copyright (c) 2013-present, Facebook, Inc. 6939 * 6940 * This source code is licensed under the MIT license found in the 6941 * LICENSE file in the root directory of this source tree. 6942 */ 6943 6944 6945 6946 var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; 6947 6948 module.exports = ReactPropTypesSecret; 6949 6950 6951 /***/ }), 6952 6953 /***/ 4462: 6954 /***/ (function(__unused_webpack_module, exports, __webpack_require__) { 6955 6956 "use strict"; 6957 6958 var __extends = (this && this.__extends) || (function () { 6959 var extendStatics = Object.setPrototypeOf || 6960 ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || 6961 function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; 6962 return function (d, b) { 6963 extendStatics(d, b); 6964 function __() { this.constructor = d; } 6965 d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); 6966 }; 6967 })(); 6968 var __assign = (this && this.__assign) || Object.assign || function(t) { 6969 for (var s, i = 1, n = arguments.length; i < n; i++) { 6970 s = arguments[i]; 6971 for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) 6972 t[p] = s[p]; 6973 } 6974 return t; 6975 }; 6976 var __rest = (this && this.__rest) || function (s, e) { 6977 var t = {}; 6978 for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) 6979 t[p] = s[p]; 6980 if (s != null && typeof Object.getOwnPropertySymbols === "function") 6981 for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0) 6982 t[p[i]] = s[p[i]]; 6983 return t; 6984 }; 6985 exports.__esModule = true; 6986 var React = __webpack_require__(1609); 6987 var PropTypes = __webpack_require__(5826); 6988 var autosize = __webpack_require__(4306); 6989 var _getLineHeight = __webpack_require__(461); 6990 var getLineHeight = _getLineHeight; 6991 var RESIZED = "autosize:resized"; 6992 /** 6993 * A light replacement for built-in textarea component 6994 * which automaticaly adjusts its height to match the content 6995 */ 6996 var TextareaAutosizeClass = /** @class */ (function (_super) { 6997 __extends(TextareaAutosizeClass, _super); 6998 function TextareaAutosizeClass() { 6999 var _this = _super !== null && _super.apply(this, arguments) || this; 7000 _this.state = { 7001 lineHeight: null 7002 }; 7003 _this.textarea = null; 7004 _this.onResize = function (e) { 7005 if (_this.props.onResize) { 7006 _this.props.onResize(e); 7007 } 7008 }; 7009 _this.updateLineHeight = function () { 7010 if (_this.textarea) { 7011 _this.setState({ 7012 lineHeight: getLineHeight(_this.textarea) 7013 }); 7014 } 7015 }; 7016 _this.onChange = function (e) { 7017 var onChange = _this.props.onChange; 7018 _this.currentValue = e.currentTarget.value; 7019 onChange && onChange(e); 7020 }; 7021 return _this; 7022 } 7023 TextareaAutosizeClass.prototype.componentDidMount = function () { 7024 var _this = this; 7025 var _a = this.props, maxRows = _a.maxRows, async = _a.async; 7026 if (typeof maxRows === "number") { 7027 this.updateLineHeight(); 7028 } 7029 if (typeof maxRows === "number" || async) { 7030 /* 7031 the defer is needed to: 7032 - force "autosize" to activate the scrollbar when this.props.maxRows is passed 7033 - support StyledComponents (see #71) 7034 */ 7035 setTimeout(function () { return _this.textarea && autosize(_this.textarea); }); 7036 } 7037 else { 7038 this.textarea && autosize(this.textarea); 7039 } 7040 if (this.textarea) { 7041 this.textarea.addEventListener(RESIZED, this.onResize); 7042 } 7043 }; 7044 TextareaAutosizeClass.prototype.componentWillUnmount = function () { 7045 if (this.textarea) { 7046 this.textarea.removeEventListener(RESIZED, this.onResize); 7047 autosize.destroy(this.textarea); 7048 } 7049 }; 7050 TextareaAutosizeClass.prototype.render = function () { 7051 var _this = this; 7052 var _a = this, _b = _a.props, onResize = _b.onResize, maxRows = _b.maxRows, onChange = _b.onChange, style = _b.style, innerRef = _b.innerRef, children = _b.children, props = __rest(_b, ["onResize", "maxRows", "onChange", "style", "innerRef", "children"]), lineHeight = _a.state.lineHeight; 7053 var maxHeight = maxRows && lineHeight ? lineHeight * maxRows : null; 7054 return (React.createElement("textarea", __assign({}, props, { onChange: this.onChange, style: maxHeight ? __assign({}, style, { maxHeight: maxHeight }) : style, ref: function (element) { 7055 _this.textarea = element; 7056 if (typeof _this.props.innerRef === 'function') { 7057 _this.props.innerRef(element); 7058 } 7059 else if (_this.props.innerRef) { 7060 _this.props.innerRef.current = element; 7061 } 7062 } }), children)); 7063 }; 7064 TextareaAutosizeClass.prototype.componentDidUpdate = function () { 7065 this.textarea && autosize.update(this.textarea); 7066 }; 7067 TextareaAutosizeClass.defaultProps = { 7068 rows: 1, 7069 async: false 7070 }; 7071 TextareaAutosizeClass.propTypes = { 7072 rows: PropTypes.number, 7073 maxRows: PropTypes.number, 7074 onResize: PropTypes.func, 7075 innerRef: PropTypes.any, 7076 async: PropTypes.bool 7077 }; 7078 return TextareaAutosizeClass; 7079 }(React.Component)); 7080 exports.TextareaAutosize = React.forwardRef(function (props, ref) { 7081 return React.createElement(TextareaAutosizeClass, __assign({}, props, { innerRef: ref })); 7082 }); 7083 7084 7085 /***/ }), 7086 7087 /***/ 4132: 7088 /***/ ((__unused_webpack_module, exports, __webpack_require__) => { 7089 7090 "use strict"; 7091 var __webpack_unused_export__; 7092 7093 __webpack_unused_export__ = true; 7094 var TextareaAutosize_1 = __webpack_require__(4462); 7095 exports.A = TextareaAutosize_1.TextareaAutosize; 7096 7097 7098 /***/ }), 7099 7100 /***/ 9681: 7101 /***/ ((module) => { 7102 7103 var characterMap = { 7104 "À": "A", 7105 "Á": "A", 7106 "Â": "A", 7107 "Ã": "A", 7108 "Ä": "A", 7109 "Å": "A", 7110 "Ấ": "A", 7111 "Ắ": "A", 7112 "Ẳ": "A", 7113 "Ẵ": "A", 7114 "Ặ": "A", 7115 "Æ": "AE", 7116 "Ầ": "A", 7117 "Ằ": "A", 7118 "Ȃ": "A", 7119 "Ả": "A", 7120 "Ạ": "A", 7121 "Ẩ": "A", 7122 "Ẫ": "A", 7123 "Ậ": "A", 7124 "Ç": "C", 7125 "Ḉ": "C", 7126 "È": "E", 7127 "É": "E", 7128 "Ê": "E", 7129 "Ë": "E", 7130 "Ế": "E", 7131 "Ḗ": "E", 7132 "Ề": "E", 7133 "Ḕ": "E", 7134 "Ḝ": "E", 7135 "Ȇ": "E", 7136 "Ẻ": "E", 7137 "Ẽ": "E", 7138 "Ẹ": "E", 7139 "Ể": "E", 7140 "Ễ": "E", 7141 "Ệ": "E", 7142 "Ì": "I", 7143 "Í": "I", 7144 "Î": "I", 7145 "Ï": "I", 7146 "Ḯ": "I", 7147 "Ȋ": "I", 7148 "Ỉ": "I", 7149 "Ị": "I", 7150 "Ð": "D", 7151 "Ñ": "N", 7152 "Ò": "O", 7153 "Ó": "O", 7154 "Ô": "O", 7155 "Õ": "O", 7156 "Ö": "O", 7157 "Ø": "O", 7158 "Ố": "O", 7159 "Ṍ": "O", 7160 "Ṓ": "O", 7161 "Ȏ": "O", 7162 "Ỏ": "O", 7163 "Ọ": "O", 7164 "Ổ": "O", 7165 "Ỗ": "O", 7166 "Ộ": "O", 7167 "Ờ": "O", 7168 "Ở": "O", 7169 "Ỡ": "O", 7170 "Ớ": "O", 7171 "Ợ": "O", 7172 "Ù": "U", 7173 "Ú": "U", 7174 "Û": "U", 7175 "Ü": "U", 7176 "Ủ": "U", 7177 "Ụ": "U", 7178 "Ử": "U", 7179 "Ữ": "U", 7180 "Ự": "U", 7181 "Ý": "Y", 7182 "à": "a", 7183 "á": "a", 7184 "â": "a", 7185 "ã": "a", 7186 "ä": "a", 7187 "å": "a", 7188 "ấ": "a", 7189 "ắ": "a", 7190 "ẳ": "a", 7191 "ẵ": "a", 7192 "ặ": "a", 7193 "æ": "ae", 7194 "ầ": "a", 7195 "ằ": "a", 7196 "ȃ": "a", 7197 "ả": "a", 7198 "ạ": "a", 7199 "ẩ": "a", 7200 "ẫ": "a", 7201 "ậ": "a", 7202 "ç": "c", 7203 "ḉ": "c", 7204 "è": "e", 7205 "é": "e", 7206 "ê": "e", 7207 "ë": "e", 7208 "ế": "e", 7209 "ḗ": "e", 7210 "ề": "e", 7211 "ḕ": "e", 7212 "ḝ": "e", 7213 "ȇ": "e", 7214 "ẻ": "e", 7215 "ẽ": "e", 7216 "ẹ": "e", 7217 "ể": "e", 7218 "ễ": "e", 7219 "ệ": "e", 7220 "ì": "i", 7221 "í": "i", 7222 "î": "i", 7223 "ï": "i", 7224 "ḯ": "i", 7225 "ȋ": "i", 7226 "ỉ": "i", 7227 "ị": "i", 7228 "ð": "d", 7229 "ñ": "n", 7230 "ò": "o", 7231 "ó": "o", 7232 "ô": "o", 7233 "õ": "o", 7234 "ö": "o", 7235 "ø": "o", 7236 "ố": "o", 7237 "ṍ": "o", 7238 "ṓ": "o", 7239 "ȏ": "o", 7240 "ỏ": "o", 7241 "ọ": "o", 7242 "ổ": "o", 7243 "ỗ": "o", 7244 "ộ": "o", 7245 "ờ": "o", 7246 "ở": "o", 7247 "ỡ": "o", 7248 "ớ": "o", 7249 "ợ": "o", 7250 "ù": "u", 7251 "ú": "u", 7252 "û": "u", 7253 "ü": "u", 7254 "ủ": "u", 7255 "ụ": "u", 7256 "ử": "u", 7257 "ữ": "u", 7258 "ự": "u", 7259 "ý": "y", 7260 "ÿ": "y", 7261 "Ā": "A", 7262 "ā": "a", 7263 "Ă": "A", 7264 "ă": "a", 7265 "Ą": "A", 7266 "ą": "a", 7267 "Ć": "C", 7268 "ć": "c", 7269 "Ĉ": "C", 7270 "ĉ": "c", 7271 "Ċ": "C", 7272 "ċ": "c", 7273 "Č": "C", 7274 "č": "c", 7275 "C̆": "C", 7276 "c̆": "c", 7277 "Ď": "D", 7278 "ď": "d", 7279 "Đ": "D", 7280 "đ": "d", 7281 "Ē": "E", 7282 "ē": "e", 7283 "Ĕ": "E", 7284 "ĕ": "e", 7285 "Ė": "E", 7286 "ė": "e", 7287 "Ę": "E", 7288 "ę": "e", 7289 "Ě": "E", 7290 "ě": "e", 7291 "Ĝ": "G", 7292 "Ǵ": "G", 7293 "ĝ": "g", 7294 "ǵ": "g", 7295 "Ğ": "G", 7296 "ğ": "g", 7297 "Ġ": "G", 7298 "ġ": "g", 7299 "Ģ": "G", 7300 "ģ": "g", 7301 "Ĥ": "H", 7302 "ĥ": "h", 7303 "Ħ": "H", 7304 "ħ": "h", 7305 "Ḫ": "H", 7306 "ḫ": "h", 7307 "Ĩ": "I", 7308 "ĩ": "i", 7309 "Ī": "I", 7310 "ī": "i", 7311 "Ĭ": "I", 7312 "ĭ": "i", 7313 "Į": "I", 7314 "į": "i", 7315 "İ": "I", 7316 "ı": "i", 7317 "IJ": "IJ", 7318 "ij": "ij", 7319 "Ĵ": "J", 7320 "ĵ": "j", 7321 "Ķ": "K", 7322 "ķ": "k", 7323 "Ḱ": "K", 7324 "ḱ": "k", 7325 "K̆": "K", 7326 "k̆": "k", 7327 "Ĺ": "L", 7328 "ĺ": "l", 7329 "Ļ": "L", 7330 "ļ": "l", 7331 "Ľ": "L", 7332 "ľ": "l", 7333 "Ŀ": "L", 7334 "ŀ": "l", 7335 "Ł": "l", 7336 "ł": "l", 7337 "Ḿ": "M", 7338 "ḿ": "m", 7339 "M̆": "M", 7340 "m̆": "m", 7341 "Ń": "N", 7342 "ń": "n", 7343 "Ņ": "N", 7344 "ņ": "n", 7345 "Ň": "N", 7346 "ň": "n", 7347 "ʼn": "n", 7348 "N̆": "N", 7349 "n̆": "n", 7350 "Ō": "O", 7351 "ō": "o", 7352 "Ŏ": "O", 7353 "ŏ": "o", 7354 "Ő": "O", 7355 "ő": "o", 7356 "Œ": "OE", 7357 "œ": "oe", 7358 "P̆": "P", 7359 "p̆": "p", 7360 "Ŕ": "R", 7361 "ŕ": "r", 7362 "Ŗ": "R", 7363 "ŗ": "r", 7364 "Ř": "R", 7365 "ř": "r", 7366 "R̆": "R", 7367 "r̆": "r", 7368 "Ȓ": "R", 7369 "ȓ": "r", 7370 "Ś": "S", 7371 "ś": "s", 7372 "Ŝ": "S", 7373 "ŝ": "s", 7374 "Ş": "S", 7375 "Ș": "S", 7376 "ș": "s", 7377 "ş": "s", 7378 "Š": "S", 7379 "š": "s", 7380 "Ţ": "T", 7381 "ţ": "t", 7382 "ț": "t", 7383 "Ț": "T", 7384 "Ť": "T", 7385 "ť": "t", 7386 "Ŧ": "T", 7387 "ŧ": "t", 7388 "T̆": "T", 7389 "t̆": "t", 7390 "Ũ": "U", 7391 "ũ": "u", 7392 "Ū": "U", 7393 "ū": "u", 7394 "Ŭ": "U", 7395 "ŭ": "u", 7396 "Ů": "U", 7397 "ů": "u", 7398 "Ű": "U", 7399 "ű": "u", 7400 "Ų": "U", 7401 "ų": "u", 7402 "Ȗ": "U", 7403 "ȗ": "u", 7404 "V̆": "V", 7405 "v̆": "v", 7406 "Ŵ": "W", 7407 "ŵ": "w", 7408 "Ẃ": "W", 7409 "ẃ": "w", 7410 "X̆": "X", 7411 "x̆": "x", 7412 "Ŷ": "Y", 7413 "ŷ": "y", 7414 "Ÿ": "Y", 7415 "Y̆": "Y", 7416 "y̆": "y", 7417 "Ź": "Z", 7418 "ź": "z", 7419 "Ż": "Z", 7420 "ż": "z", 7421 "Ž": "Z", 7422 "ž": "z", 7423 "ſ": "s", 7424 "ƒ": "f", 7425 "Ơ": "O", 7426 "ơ": "o", 7427 "Ư": "U", 7428 "ư": "u", 7429 "Ǎ": "A", 7430 "ǎ": "a", 7431 "Ǐ": "I", 7432 "ǐ": "i", 7433 "Ǒ": "O", 7434 "ǒ": "o", 7435 "Ǔ": "U", 7436 "ǔ": "u", 7437 "Ǖ": "U", 7438 "ǖ": "u", 7439 "Ǘ": "U", 7440 "ǘ": "u", 7441 "Ǚ": "U", 7442 "ǚ": "u", 7443 "Ǜ": "U", 7444 "ǜ": "u", 7445 "Ứ": "U", 7446 "ứ": "u", 7447 "Ṹ": "U", 7448 "ṹ": "u", 7449 "Ǻ": "A", 7450 "ǻ": "a", 7451 "Ǽ": "AE", 7452 "ǽ": "ae", 7453 "Ǿ": "O", 7454 "ǿ": "o", 7455 "Þ": "TH", 7456 "þ": "th", 7457 "Ṕ": "P", 7458 "ṕ": "p", 7459 "Ṥ": "S", 7460 "ṥ": "s", 7461 "X́": "X", 7462 "x́": "x", 7463 "Ѓ": "Г", 7464 "ѓ": "г", 7465 "Ќ": "К", 7466 "ќ": "к", 7467 "A̋": "A", 7468 "a̋": "a", 7469 "E̋": "E", 7470 "e̋": "e", 7471 "I̋": "I", 7472 "i̋": "i", 7473 "Ǹ": "N", 7474 "ǹ": "n", 7475 "Ồ": "O", 7476 "ồ": "o", 7477 "Ṑ": "O", 7478 "ṑ": "o", 7479 "Ừ": "U", 7480 "ừ": "u", 7481 "Ẁ": "W", 7482 "ẁ": "w", 7483 "Ỳ": "Y", 7484 "ỳ": "y", 7485 "Ȁ": "A", 7486 "ȁ": "a", 7487 "Ȅ": "E", 7488 "ȅ": "e", 7489 "Ȉ": "I", 7490 "ȉ": "i", 7491 "Ȍ": "O", 7492 "ȍ": "o", 7493 "Ȑ": "R", 7494 "ȑ": "r", 7495 "Ȕ": "U", 7496 "ȕ": "u", 7497 "B̌": "B", 7498 "b̌": "b", 7499 "Č̣": "C", 7500 "č̣": "c", 7501 "Ê̌": "E", 7502 "ê̌": "e", 7503 "F̌": "F", 7504 "f̌": "f", 7505 "Ǧ": "G", 7506 "ǧ": "g", 7507 "Ȟ": "H", 7508 "ȟ": "h", 7509 "J̌": "J", 7510 "ǰ": "j", 7511 "Ǩ": "K", 7512 "ǩ": "k", 7513 "M̌": "M", 7514 "m̌": "m", 7515 "P̌": "P", 7516 "p̌": "p", 7517 "Q̌": "Q", 7518 "q̌": "q", 7519 "Ř̩": "R", 7520 "ř̩": "r", 7521 "Ṧ": "S", 7522 "ṧ": "s", 7523 "V̌": "V", 7524 "v̌": "v", 7525 "W̌": "W", 7526 "w̌": "w", 7527 "X̌": "X", 7528 "x̌": "x", 7529 "Y̌": "Y", 7530 "y̌": "y", 7531 "A̧": "A", 7532 "a̧": "a", 7533 "B̧": "B", 7534 "b̧": "b", 7535 "Ḑ": "D", 7536 "ḑ": "d", 7537 "Ȩ": "E", 7538 "ȩ": "e", 7539 "Ɛ̧": "E", 7540 "ɛ̧": "e", 7541 "Ḩ": "H", 7542 "ḩ": "h", 7543 "I̧": "I", 7544 "i̧": "i", 7545 "Ɨ̧": "I", 7546 "ɨ̧": "i", 7547 "M̧": "M", 7548 "m̧": "m", 7549 "O̧": "O", 7550 "o̧": "o", 7551 "Q̧": "Q", 7552 "q̧": "q", 7553 "U̧": "U", 7554 "u̧": "u", 7555 "X̧": "X", 7556 "x̧": "x", 7557 "Z̧": "Z", 7558 "z̧": "z", 7559 "й":"и", 7560 "Й":"И", 7561 "ё":"е", 7562 "Ё":"Е", 7563 }; 7564 7565 var chars = Object.keys(characterMap).join('|'); 7566 var allAccents = new RegExp(chars, 'g'); 7567 var firstAccent = new RegExp(chars, ''); 7568 7569 function matcher(match) { 7570 return characterMap[match]; 7571 } 7572 7573 var removeAccents = function(string) { 7574 return string.replace(allAccents, matcher); 7575 }; 7576 7577 var hasAccents = function(string) { 7578 return !!string.match(firstAccent); 7579 }; 7580 7581 module.exports = removeAccents; 7582 module.exports.has = hasAccents; 7583 module.exports.remove = removeAccents; 7584 7585 7586 /***/ }), 7587 7588 /***/ 1609: 7589 /***/ ((module) => { 7590 7591 "use strict"; 7592 module.exports = window["React"]; 7593 7594 /***/ }), 7595 7596 /***/ 9746: 7597 /***/ (() => { 7598 7599 /* (ignored) */ 7600 7601 /***/ }), 7602 7603 /***/ 9977: 7604 /***/ (() => { 7605 7606 /* (ignored) */ 7607 7608 /***/ }), 7609 7610 /***/ 197: 7611 /***/ (() => { 7612 7613 /* (ignored) */ 7614 7615 /***/ }), 7616 7617 /***/ 1866: 7618 /***/ (() => { 7619 7620 /* (ignored) */ 7621 7622 /***/ }), 7623 7624 /***/ 2739: 7625 /***/ (() => { 7626 7627 /* (ignored) */ 7628 7629 /***/ }), 7630 7631 /***/ 5042: 7632 /***/ ((module) => { 7633 7634 let urlAlphabet = 7635 'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict' 7636 let customAlphabet = (alphabet, defaultSize = 21) => { 7637 return (size = defaultSize) => { 7638 let id = '' 7639 let i = size 7640 while (i--) { 7641 id += alphabet[(Math.random() * alphabet.length) | 0] 7642 } 7643 return id 7644 } 7645 } 7646 let nanoid = (size = 21) => { 7647 let id = '' 7648 let i = size 7649 while (i--) { 7650 id += urlAlphabet[(Math.random() * 64) | 0] 7651 } 7652 return id 7653 } 7654 module.exports = { nanoid, customAlphabet } 7655 7656 7657 /***/ }) 7658 7659 /******/ }); 7660 /************************************************************************/ 7661 /******/ // The module cache 7662 /******/ var __webpack_module_cache__ = {}; 7663 /******/ 7664 /******/ // The require function 7665 /******/ function __webpack_require__(moduleId) { 7666 /******/ // Check if module is in cache 7667 /******/ var cachedModule = __webpack_module_cache__[moduleId]; 7668 /******/ if (cachedModule !== undefined) { 7669 /******/ return cachedModule.exports; 7670 /******/ } 7671 /******/ // Create a new module (and put it into the cache) 7672 /******/ var module = __webpack_module_cache__[moduleId] = { 7673 /******/ // no module.id needed 7674 /******/ // no module.loaded needed 7675 /******/ exports: {} 7676 /******/ }; 7677 /******/ 7678 /******/ // Execute the module function 7679 /******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__); 7680 /******/ 7681 /******/ // Return the exports of the module 7682 /******/ return module.exports; 7683 /******/ } 7684 /******/ 7685 /************************************************************************/ 7686 /******/ /* webpack/runtime/compat get default export */ 7687 /******/ (() => { 7688 /******/ // getDefaultExport function for compatibility with non-harmony modules 7689 /******/ __webpack_require__.n = (module) => { 7690 /******/ var getter = module && module.__esModule ? 7691 /******/ () => (module['default']) : 7692 /******/ () => (module); 7693 /******/ __webpack_require__.d(getter, { a: getter }); 7694 /******/ return getter; 7695 /******/ }; 7696 /******/ })(); 7697 /******/ 7698 /******/ /* webpack/runtime/define property getters */ 7699 /******/ (() => { 7700 /******/ // define getter functions for harmony exports 7701 /******/ __webpack_require__.d = (exports, definition) => { 7702 /******/ for(var key in definition) { 7703 /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { 7704 /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); 7705 /******/ } 7706 /******/ } 7707 /******/ }; 7708 /******/ })(); 7709 /******/ 7710 /******/ /* webpack/runtime/hasOwnProperty shorthand */ 7711 /******/ (() => { 7712 /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) 7713 /******/ })(); 7714 /******/ 7715 /******/ /* webpack/runtime/make namespace object */ 7716 /******/ (() => { 7717 /******/ // define __esModule on exports 7718 /******/ __webpack_require__.r = (exports) => { 7719 /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { 7720 /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 7721 /******/ } 7722 /******/ Object.defineProperty(exports, '__esModule', { value: true }); 7723 /******/ }; 7724 /******/ })(); 7725 /******/ 7726 /************************************************************************/ 7727 var __webpack_exports__ = {}; 7728 // This entry need to be wrapped in an IIFE because it need to be in strict mode. 7729 (() => { 7730 "use strict"; 7731 // ESM COMPAT FLAG 7732 __webpack_require__.r(__webpack_exports__); 7733 7734 // EXPORTS 7735 __webpack_require__.d(__webpack_exports__, { 7736 AlignmentControl: () => (/* reexport */ AlignmentControl), 7737 AlignmentToolbar: () => (/* reexport */ AlignmentToolbar), 7738 Autocomplete: () => (/* reexport */ autocomplete), 7739 BlockAlignmentControl: () => (/* reexport */ BlockAlignmentControl), 7740 BlockAlignmentToolbar: () => (/* reexport */ BlockAlignmentToolbar), 7741 BlockBreadcrumb: () => (/* reexport */ block_breadcrumb), 7742 BlockCanvas: () => (/* reexport */ block_canvas), 7743 BlockColorsStyleSelector: () => (/* reexport */ color_style_selector), 7744 BlockContextProvider: () => (/* reexport */ BlockContextProvider), 7745 BlockControls: () => (/* reexport */ block_controls), 7746 BlockEdit: () => (/* reexport */ BlockEdit), 7747 BlockEditorKeyboardShortcuts: () => (/* reexport */ keyboard_shortcuts), 7748 BlockEditorProvider: () => (/* reexport */ provider), 7749 BlockFormatControls: () => (/* reexport */ BlockFormatControls), 7750 BlockIcon: () => (/* reexport */ block_icon), 7751 BlockInspector: () => (/* reexport */ block_inspector), 7752 BlockList: () => (/* reexport */ BlockList), 7753 BlockMover: () => (/* reexport */ block_mover), 7754 BlockNavigationDropdown: () => (/* reexport */ dropdown), 7755 BlockPopover: () => (/* reexport */ block_popover), 7756 BlockPreview: () => (/* reexport */ block_preview), 7757 BlockSelectionClearer: () => (/* reexport */ BlockSelectionClearer), 7758 BlockSettingsMenu: () => (/* reexport */ block_settings_menu), 7759 BlockSettingsMenuControls: () => (/* reexport */ block_settings_menu_controls), 7760 BlockStyles: () => (/* reexport */ block_styles), 7761 BlockTitle: () => (/* reexport */ BlockTitle), 7762 BlockToolbar: () => (/* reexport */ BlockToolbar), 7763 BlockTools: () => (/* reexport */ BlockTools), 7764 BlockVerticalAlignmentControl: () => (/* reexport */ BlockVerticalAlignmentControl), 7765 BlockVerticalAlignmentToolbar: () => (/* reexport */ BlockVerticalAlignmentToolbar), 7766 ButtonBlockAppender: () => (/* reexport */ button_block_appender), 7767 ButtonBlockerAppender: () => (/* reexport */ ButtonBlockerAppender), 7768 ColorPalette: () => (/* reexport */ color_palette), 7769 ColorPaletteControl: () => (/* reexport */ ColorPaletteControl), 7770 ContrastChecker: () => (/* reexport */ contrast_checker), 7771 CopyHandler: () => (/* reexport */ CopyHandler), 7772 DefaultBlockAppender: () => (/* reexport */ DefaultBlockAppender), 7773 FontSizePicker: () => (/* reexport */ font_size_picker), 7774 HeadingLevelDropdown: () => (/* reexport */ HeadingLevelDropdown), 7775 HeightControl: () => (/* reexport */ HeightControl), 7776 InnerBlocks: () => (/* reexport */ inner_blocks), 7777 Inserter: () => (/* reexport */ inserter), 7778 InspectorAdvancedControls: () => (/* reexport */ InspectorAdvancedControls), 7779 InspectorControls: () => (/* reexport */ inspector_controls), 7780 JustifyContentControl: () => (/* reexport */ JustifyContentControl), 7781 JustifyToolbar: () => (/* reexport */ JustifyToolbar), 7782 LineHeightControl: () => (/* reexport */ line_height_control), 7783 MediaPlaceholder: () => (/* reexport */ media_placeholder), 7784 MediaReplaceFlow: () => (/* reexport */ media_replace_flow), 7785 MediaUpload: () => (/* reexport */ media_upload), 7786 MediaUploadCheck: () => (/* reexport */ check), 7787 MultiSelectScrollIntoView: () => (/* reexport */ MultiSelectScrollIntoView), 7788 NavigableToolbar: () => (/* reexport */ NavigableToolbar), 7789 ObserveTyping: () => (/* reexport */ observe_typing), 7790 PanelColorSettings: () => (/* reexport */ panel_color_settings), 7791 PlainText: () => (/* reexport */ plain_text), 7792 RecursionProvider: () => (/* reexport */ RecursionProvider), 7793 ReusableBlocksRenameHint: () => (/* reexport */ ReusableBlocksRenameHint), 7794 RichText: () => (/* reexport */ rich_text), 7795 RichTextShortcut: () => (/* reexport */ RichTextShortcut), 7796 RichTextToolbarButton: () => (/* reexport */ RichTextToolbarButton), 7797 SETTINGS_DEFAULTS: () => (/* reexport */ SETTINGS_DEFAULTS), 7798 SkipToSelectedBlock: () => (/* reexport */ SkipToSelectedBlock), 7799 ToolSelector: () => (/* reexport */ tool_selector), 7800 Typewriter: () => (/* reexport */ typewriter), 7801 URLInput: () => (/* reexport */ url_input), 7802 URLInputButton: () => (/* reexport */ url_input_button), 7803 URLPopover: () => (/* reexport */ url_popover), 7804 Warning: () => (/* reexport */ warning), 7805 WritingFlow: () => (/* reexport */ writing_flow), 7806 __experimentalBlockAlignmentMatrixControl: () => (/* reexport */ block_alignment_matrix_control), 7807 __experimentalBlockFullHeightAligmentControl: () => (/* reexport */ block_full_height_alignment_control), 7808 __experimentalBlockPatternSetup: () => (/* reexport */ block_pattern_setup), 7809 __experimentalBlockPatternsList: () => (/* reexport */ block_patterns_list), 7810 __experimentalBlockVariationPicker: () => (/* reexport */ block_variation_picker), 7811 __experimentalBlockVariationTransforms: () => (/* reexport */ block_variation_transforms), 7812 __experimentalBorderRadiusControl: () => (/* reexport */ BorderRadiusControl), 7813 __experimentalColorGradientControl: () => (/* reexport */ control), 7814 __experimentalColorGradientSettingsDropdown: () => (/* reexport */ ColorGradientSettingsDropdown), 7815 __experimentalDateFormatPicker: () => (/* reexport */ DateFormatPicker), 7816 __experimentalDuotoneControl: () => (/* reexport */ duotone_control), 7817 __experimentalFontAppearanceControl: () => (/* reexport */ FontAppearanceControl), 7818 __experimentalFontFamilyControl: () => (/* reexport */ FontFamilyControl), 7819 __experimentalGetBorderClassesAndStyles: () => (/* reexport */ getBorderClassesAndStyles), 7820 __experimentalGetColorClassesAndStyles: () => (/* reexport */ getColorClassesAndStyles), 7821 __experimentalGetElementClassName: () => (/* reexport */ __experimentalGetElementClassName), 7822 __experimentalGetGapCSSValue: () => (/* reexport */ getGapCSSValue), 7823 __experimentalGetGradientClass: () => (/* reexport */ __experimentalGetGradientClass), 7824 __experimentalGetGradientObjectByGradientValue: () => (/* reexport */ __experimentalGetGradientObjectByGradientValue), 7825 __experimentalGetShadowClassesAndStyles: () => (/* reexport */ getShadowClassesAndStyles), 7826 __experimentalGetSpacingClassesAndStyles: () => (/* reexport */ getSpacingClassesAndStyles), 7827 __experimentalImageEditor: () => (/* reexport */ ImageEditor), 7828 __experimentalImageSizeControl: () => (/* reexport */ ImageSizeControl), 7829 __experimentalImageURLInputUI: () => (/* reexport */ ImageURLInputUI), 7830 __experimentalInspectorPopoverHeader: () => (/* reexport */ InspectorPopoverHeader), 7831 __experimentalLetterSpacingControl: () => (/* reexport */ LetterSpacingControl), 7832 __experimentalLibrary: () => (/* reexport */ library), 7833 __experimentalLinkControl: () => (/* reexport */ link_control), 7834 __experimentalLinkControlSearchInput: () => (/* reexport */ search_input), 7835 __experimentalLinkControlSearchItem: () => (/* reexport */ search_item), 7836 __experimentalLinkControlSearchResults: () => (/* reexport */ LinkControlSearchResults), 7837 __experimentalListView: () => (/* reexport */ components_list_view), 7838 __experimentalPanelColorGradientSettings: () => (/* reexport */ panel_color_gradient_settings), 7839 __experimentalPreviewOptions: () => (/* reexport */ PreviewOptions), 7840 __experimentalPublishDateTimePicker: () => (/* reexport */ publish_date_time_picker), 7841 __experimentalRecursionProvider: () => (/* reexport */ DeprecatedExperimentalRecursionProvider), 7842 __experimentalResponsiveBlockControl: () => (/* reexport */ responsive_block_control), 7843 __experimentalSpacingSizesControl: () => (/* reexport */ SpacingSizesControl), 7844 __experimentalTextDecorationControl: () => (/* reexport */ TextDecorationControl), 7845 __experimentalTextTransformControl: () => (/* reexport */ TextTransformControl), 7846 __experimentalUnitControl: () => (/* reexport */ UnitControl), 7847 __experimentalUseBlockOverlayActive: () => (/* reexport */ useBlockOverlayActive), 7848 __experimentalUseBlockPreview: () => (/* reexport */ useBlockPreview), 7849 __experimentalUseBorderProps: () => (/* reexport */ useBorderProps), 7850 __experimentalUseColorProps: () => (/* reexport */ useColorProps), 7851 __experimentalUseCustomSides: () => (/* reexport */ useCustomSides), 7852 __experimentalUseGradient: () => (/* reexport */ __experimentalUseGradient), 7853 __experimentalUseHasRecursion: () => (/* reexport */ DeprecatedExperimentalUseHasRecursion), 7854 __experimentalUseMultipleOriginColorsAndGradients: () => (/* reexport */ useMultipleOriginColorsAndGradients), 7855 __experimentalUseResizeCanvas: () => (/* reexport */ useResizeCanvas), 7856 __experimentalWritingModeControl: () => (/* reexport */ WritingModeControl), 7857 __unstableBlockNameContext: () => (/* reexport */ block_name_context), 7858 __unstableBlockSettingsMenuFirstItem: () => (/* reexport */ block_settings_menu_first_item), 7859 __unstableBlockToolbarLastItem: () => (/* reexport */ block_toolbar_last_item), 7860 __unstableEditorStyles: () => (/* reexport */ editor_styles), 7861 __unstableIframe: () => (/* reexport */ iframe), 7862 __unstableInserterMenuExtension: () => (/* reexport */ inserter_menu_extension), 7863 __unstableRichTextInputEvent: () => (/* reexport */ __unstableRichTextInputEvent), 7864 __unstableUseBlockSelectionClearer: () => (/* reexport */ useBlockSelectionClearer), 7865 __unstableUseClipboardHandler: () => (/* reexport */ __unstableUseClipboardHandler), 7866 __unstableUseMouseMoveTypingReset: () => (/* reexport */ useMouseMoveTypingReset), 7867 __unstableUseTypewriter: () => (/* reexport */ useTypewriter), 7868 __unstableUseTypingObserver: () => (/* reexport */ useTypingObserver), 7869 createCustomColorsHOC: () => (/* reexport */ createCustomColorsHOC), 7870 getColorClassName: () => (/* reexport */ getColorClassName), 7871 getColorObjectByAttributeValues: () => (/* reexport */ getColorObjectByAttributeValues), 7872 getColorObjectByColorValue: () => (/* reexport */ getColorObjectByColorValue), 7873 getComputedFluidTypographyValue: () => (/* reexport */ getComputedFluidTypographyValue), 7874 getCustomValueFromPreset: () => (/* reexport */ getCustomValueFromPreset), 7875 getFontSize: () => (/* reexport */ utils_getFontSize), 7876 getFontSizeClass: () => (/* reexport */ getFontSizeClass), 7877 getFontSizeObjectByValue: () => (/* reexport */ utils_getFontSizeObjectByValue), 7878 getGradientSlugByValue: () => (/* reexport */ getGradientSlugByValue), 7879 getGradientValueBySlug: () => (/* reexport */ getGradientValueBySlug), 7880 getPxFromCssUnit: () => (/* reexport */ get_px_from_css_unit), 7881 getSpacingPresetCssVar: () => (/* reexport */ getSpacingPresetCssVar), 7882 getTypographyClassesAndStyles: () => (/* reexport */ getTypographyClassesAndStyles), 7883 isValueSpacingPreset: () => (/* reexport */ isValueSpacingPreset), 7884 privateApis: () => (/* reexport */ privateApis), 7885 store: () => (/* reexport */ store), 7886 storeConfig: () => (/* reexport */ storeConfig), 7887 transformStyles: () => (/* reexport */ transform_styles), 7888 useBlockCommands: () => (/* reexport */ useBlockCommands), 7889 useBlockDisplayInformation: () => (/* reexport */ useBlockDisplayInformation), 7890 useBlockEditContext: () => (/* reexport */ useBlockEditContext), 7891 useBlockEditingMode: () => (/* reexport */ useBlockEditingMode), 7892 useBlockProps: () => (/* reexport */ use_block_props_useBlockProps), 7893 useCachedTruthy: () => (/* reexport */ useCachedTruthy), 7894 useHasRecursion: () => (/* reexport */ useHasRecursion), 7895 useInnerBlocksProps: () => (/* reexport */ useInnerBlocksProps), 7896 useSetting: () => (/* reexport */ useSetting), 7897 useSettings: () => (/* reexport */ use_settings_useSettings), 7898 useZoomOut: () => (/* reexport */ useZoomOut), 7899 withColorContext: () => (/* reexport */ with_color_context), 7900 withColors: () => (/* reexport */ withColors), 7901 withFontSizes: () => (/* reexport */ with_font_sizes) 7902 }); 7903 7904 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-editor/build-module/store/private-selectors.js 7905 var private_selectors_namespaceObject = {}; 7906 __webpack_require__.r(private_selectors_namespaceObject); 7907 __webpack_require__.d(private_selectors_namespaceObject, { 7908 getAllPatterns: () => (getAllPatterns), 7909 getBlockRemovalRules: () => (getBlockRemovalRules), 7910 getBlockSettings: () => (getBlockSettings), 7911 getBlockWithoutAttributes: () => (getBlockWithoutAttributes), 7912 getContentLockingParent: () => (getContentLockingParent), 7913 getEnabledBlockParents: () => (getEnabledBlockParents), 7914 getEnabledClientIdsTree: () => (getEnabledClientIdsTree), 7915 getExpandedBlock: () => (getExpandedBlock), 7916 getInserterMediaCategories: () => (getInserterMediaCategories), 7917 getLastFocus: () => (getLastFocus), 7918 getLastInsertedBlocksClientIds: () => (getLastInsertedBlocksClientIds), 7919 getOpenedBlockSettingsMenu: () => (getOpenedBlockSettingsMenu), 7920 getPatternBySlug: () => (getPatternBySlug), 7921 getRegisteredInserterMediaCategories: () => (getRegisteredInserterMediaCategories), 7922 getRemovalPromptData: () => (getRemovalPromptData), 7923 getReusableBlocks: () => (getReusableBlocks), 7924 getStyleOverrides: () => (getStyleOverrides), 7925 getTemporarilyEditingAsBlocks: () => (getTemporarilyEditingAsBlocks), 7926 getTemporarilyEditingFocusModeToRevert: () => (getTemporarilyEditingFocusModeToRevert), 7927 hasAllowedPatterns: () => (hasAllowedPatterns), 7928 isBlockInterfaceHidden: () => (private_selectors_isBlockInterfaceHidden), 7929 isBlockSubtreeDisabled: () => (isBlockSubtreeDisabled), 7930 isDragging: () => (private_selectors_isDragging), 7931 isResolvingPatterns: () => (isResolvingPatterns) 7932 }); 7933 7934 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-editor/build-module/store/selectors.js 7935 var selectors_namespaceObject = {}; 7936 __webpack_require__.r(selectors_namespaceObject); 7937 __webpack_require__.d(selectors_namespaceObject, { 7938 __experimentalGetActiveBlockIdByBlockNames: () => (__experimentalGetActiveBlockIdByBlockNames), 7939 __experimentalGetAllowedBlocks: () => (__experimentalGetAllowedBlocks), 7940 __experimentalGetAllowedPatterns: () => (__experimentalGetAllowedPatterns), 7941 __experimentalGetBlockListSettingsForBlocks: () => (__experimentalGetBlockListSettingsForBlocks), 7942 __experimentalGetDirectInsertBlock: () => (__experimentalGetDirectInsertBlock), 7943 __experimentalGetGlobalBlocksByName: () => (__experimentalGetGlobalBlocksByName), 7944 __experimentalGetLastBlockAttributeChanges: () => (__experimentalGetLastBlockAttributeChanges), 7945 __experimentalGetParsedPattern: () => (__experimentalGetParsedPattern), 7946 __experimentalGetPatternTransformItems: () => (__experimentalGetPatternTransformItems), 7947 __experimentalGetPatternsByBlockTypes: () => (__experimentalGetPatternsByBlockTypes), 7948 __experimentalGetReusableBlockTitle: () => (__experimentalGetReusableBlockTitle), 7949 __unstableGetBlockWithoutInnerBlocks: () => (__unstableGetBlockWithoutInnerBlocks), 7950 __unstableGetClientIdWithClientIdsTree: () => (__unstableGetClientIdWithClientIdsTree), 7951 __unstableGetClientIdsTree: () => (__unstableGetClientIdsTree), 7952 __unstableGetContentLockingParent: () => (__unstableGetContentLockingParent), 7953 __unstableGetEditorMode: () => (__unstableGetEditorMode), 7954 __unstableGetSelectedBlocksWithPartialSelection: () => (__unstableGetSelectedBlocksWithPartialSelection), 7955 __unstableGetTemporarilyEditingAsBlocks: () => (__unstableGetTemporarilyEditingAsBlocks), 7956 __unstableGetTemporarilyEditingFocusModeToRevert: () => (__unstableGetTemporarilyEditingFocusModeToRevert), 7957 __unstableGetVisibleBlocks: () => (__unstableGetVisibleBlocks), 7958 __unstableHasActiveBlockOverlayActive: () => (__unstableHasActiveBlockOverlayActive), 7959 __unstableIsFullySelected: () => (__unstableIsFullySelected), 7960 __unstableIsLastBlockChangeIgnored: () => (__unstableIsLastBlockChangeIgnored), 7961 __unstableIsSelectionCollapsed: () => (__unstableIsSelectionCollapsed), 7962 __unstableIsSelectionMergeable: () => (__unstableIsSelectionMergeable), 7963 __unstableIsWithinBlockOverlay: () => (__unstableIsWithinBlockOverlay), 7964 __unstableSelectionHasUnmergeableBlock: () => (__unstableSelectionHasUnmergeableBlock), 7965 areInnerBlocksControlled: () => (areInnerBlocksControlled), 7966 canEditBlock: () => (canEditBlock), 7967 canInsertBlockType: () => (canInsertBlockType), 7968 canInsertBlocks: () => (canInsertBlocks), 7969 canLockBlockType: () => (canLockBlockType), 7970 canMoveBlock: () => (canMoveBlock), 7971 canMoveBlocks: () => (canMoveBlocks), 7972 canRemoveBlock: () => (canRemoveBlock), 7973 canRemoveBlocks: () => (canRemoveBlocks), 7974 didAutomaticChange: () => (didAutomaticChange), 7975 getAdjacentBlockClientId: () => (getAdjacentBlockClientId), 7976 getAllowedBlocks: () => (getAllowedBlocks), 7977 getBlock: () => (getBlock), 7978 getBlockAttributes: () => (getBlockAttributes), 7979 getBlockCount: () => (getBlockCount), 7980 getBlockEditingMode: () => (getBlockEditingMode), 7981 getBlockHierarchyRootClientId: () => (getBlockHierarchyRootClientId), 7982 getBlockIndex: () => (getBlockIndex), 7983 getBlockInsertionPoint: () => (getBlockInsertionPoint), 7984 getBlockListSettings: () => (getBlockListSettings), 7985 getBlockMode: () => (getBlockMode), 7986 getBlockName: () => (getBlockName), 7987 getBlockNamesByClientId: () => (getBlockNamesByClientId), 7988 getBlockOrder: () => (getBlockOrder), 7989 getBlockParents: () => (getBlockParents), 7990 getBlockParentsByBlockName: () => (getBlockParentsByBlockName), 7991 getBlockRootClientId: () => (getBlockRootClientId), 7992 getBlockSelectionEnd: () => (getBlockSelectionEnd), 7993 getBlockSelectionStart: () => (getBlockSelectionStart), 7994 getBlockTransformItems: () => (getBlockTransformItems), 7995 getBlocks: () => (getBlocks), 7996 getBlocksByClientId: () => (getBlocksByClientId), 7997 getBlocksByName: () => (getBlocksByName), 7998 getClientIdsOfDescendants: () => (getClientIdsOfDescendants), 7999 getClientIdsWithDescendants: () => (getClientIdsWithDescendants), 8000 getDirectInsertBlock: () => (getDirectInsertBlock), 8001 getDraggedBlockClientIds: () => (getDraggedBlockClientIds), 8002 getFirstMultiSelectedBlockClientId: () => (getFirstMultiSelectedBlockClientId), 8003 getGlobalBlockCount: () => (getGlobalBlockCount), 8004 getInserterItems: () => (getInserterItems), 8005 getLastMultiSelectedBlockClientId: () => (getLastMultiSelectedBlockClientId), 8006 getLowestCommonAncestorWithSelectedBlock: () => (getLowestCommonAncestorWithSelectedBlock), 8007 getMultiSelectedBlockClientIds: () => (getMultiSelectedBlockClientIds), 8008 getMultiSelectedBlocks: () => (getMultiSelectedBlocks), 8009 getMultiSelectedBlocksEndClientId: () => (getMultiSelectedBlocksEndClientId), 8010 getMultiSelectedBlocksStartClientId: () => (getMultiSelectedBlocksStartClientId), 8011 getNextBlockClientId: () => (getNextBlockClientId), 8012 getPatternsByBlockTypes: () => (getPatternsByBlockTypes), 8013 getPreviousBlockClientId: () => (getPreviousBlockClientId), 8014 getSelectedBlock: () => (getSelectedBlock), 8015 getSelectedBlockClientId: () => (getSelectedBlockClientId), 8016 getSelectedBlockClientIds: () => (getSelectedBlockClientIds), 8017 getSelectedBlockCount: () => (getSelectedBlockCount), 8018 getSelectedBlocksInitialCaretPosition: () => (getSelectedBlocksInitialCaretPosition), 8019 getSelectionEnd: () => (getSelectionEnd), 8020 getSelectionStart: () => (getSelectionStart), 8021 getSettings: () => (getSettings), 8022 getTemplate: () => (getTemplate), 8023 getTemplateLock: () => (getTemplateLock), 8024 hasBlockMovingClientId: () => (selectors_hasBlockMovingClientId), 8025 hasDraggedInnerBlock: () => (hasDraggedInnerBlock), 8026 hasInserterItems: () => (hasInserterItems), 8027 hasMultiSelection: () => (hasMultiSelection), 8028 hasSelectedBlock: () => (hasSelectedBlock), 8029 hasSelectedInnerBlock: () => (hasSelectedInnerBlock), 8030 isAncestorBeingDragged: () => (isAncestorBeingDragged), 8031 isAncestorMultiSelected: () => (isAncestorMultiSelected), 8032 isBlockBeingDragged: () => (isBlockBeingDragged), 8033 isBlockHighlighted: () => (isBlockHighlighted), 8034 isBlockInsertionPointVisible: () => (isBlockInsertionPointVisible), 8035 isBlockMultiSelected: () => (isBlockMultiSelected), 8036 isBlockSelected: () => (isBlockSelected), 8037 isBlockValid: () => (isBlockValid), 8038 isBlockVisible: () => (isBlockVisible), 8039 isBlockWithinSelection: () => (isBlockWithinSelection), 8040 isCaretWithinFormattedText: () => (isCaretWithinFormattedText), 8041 isDraggingBlocks: () => (isDraggingBlocks), 8042 isFirstMultiSelectedBlock: () => (isFirstMultiSelectedBlock), 8043 isGroupable: () => (isGroupable), 8044 isLastBlockChangePersistent: () => (isLastBlockChangePersistent), 8045 isMultiSelecting: () => (selectors_isMultiSelecting), 8046 isNavigationMode: () => (isNavigationMode), 8047 isSelectionEnabled: () => (selectors_isSelectionEnabled), 8048 isTyping: () => (selectors_isTyping), 8049 isUngroupable: () => (isUngroupable), 8050 isValidTemplate: () => (isValidTemplate), 8051 wasBlockJustInserted: () => (wasBlockJustInserted) 8052 }); 8053 8054 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-editor/build-module/store/private-actions.js 8055 var private_actions_namespaceObject = {}; 8056 __webpack_require__.r(private_actions_namespaceObject); 8057 __webpack_require__.d(private_actions_namespaceObject, { 8058 __experimentalUpdateSettings: () => (__experimentalUpdateSettings), 8059 clearBlockRemovalPrompt: () => (clearBlockRemovalPrompt), 8060 deleteStyleOverride: () => (deleteStyleOverride), 8061 ensureDefaultBlock: () => (ensureDefaultBlock), 8062 expandBlock: () => (expandBlock), 8063 hideBlockInterface: () => (hideBlockInterface), 8064 modifyContentLockBlock: () => (modifyContentLockBlock), 8065 privateRemoveBlocks: () => (privateRemoveBlocks), 8066 setBlockRemovalRules: () => (setBlockRemovalRules), 8067 setLastFocus: () => (setLastFocus), 8068 setOpenedBlockSettingsMenu: () => (setOpenedBlockSettingsMenu), 8069 setStyleOverride: () => (setStyleOverride), 8070 showBlockInterface: () => (showBlockInterface), 8071 startDragging: () => (startDragging), 8072 stopDragging: () => (stopDragging), 8073 stopEditingAsBlocks: () => (stopEditingAsBlocks), 8074 syncDerivedUpdates: () => (syncDerivedUpdates) 8075 }); 8076 8077 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-editor/build-module/store/actions.js 8078 var actions_namespaceObject = {}; 8079 __webpack_require__.r(actions_namespaceObject); 8080 __webpack_require__.d(actions_namespaceObject, { 8081 __unstableDeleteSelection: () => (__unstableDeleteSelection), 8082 __unstableExpandSelection: () => (__unstableExpandSelection), 8083 __unstableMarkAutomaticChange: () => (__unstableMarkAutomaticChange), 8084 __unstableMarkLastChangeAsPersistent: () => (__unstableMarkLastChangeAsPersistent), 8085 __unstableMarkNextChangeAsNotPersistent: () => (__unstableMarkNextChangeAsNotPersistent), 8086 __unstableSaveReusableBlock: () => (__unstableSaveReusableBlock), 8087 __unstableSetEditorMode: () => (__unstableSetEditorMode), 8088 __unstableSetTemporarilyEditingAsBlocks: () => (__unstableSetTemporarilyEditingAsBlocks), 8089 __unstableSplitSelection: () => (__unstableSplitSelection), 8090 clearSelectedBlock: () => (clearSelectedBlock), 8091 duplicateBlocks: () => (duplicateBlocks), 8092 enterFormattedText: () => (enterFormattedText), 8093 exitFormattedText: () => (exitFormattedText), 8094 flashBlock: () => (flashBlock), 8095 hideInsertionPoint: () => (hideInsertionPoint), 8096 insertAfterBlock: () => (insertAfterBlock), 8097 insertBeforeBlock: () => (insertBeforeBlock), 8098 insertBlock: () => (insertBlock), 8099 insertBlocks: () => (insertBlocks), 8100 insertDefaultBlock: () => (insertDefaultBlock), 8101 mergeBlocks: () => (mergeBlocks), 8102 moveBlockToPosition: () => (moveBlockToPosition), 8103 moveBlocksDown: () => (moveBlocksDown), 8104 moveBlocksToPosition: () => (moveBlocksToPosition), 8105 moveBlocksUp: () => (moveBlocksUp), 8106 multiSelect: () => (multiSelect), 8107 receiveBlocks: () => (receiveBlocks), 8108 registerInserterMediaCategory: () => (registerInserterMediaCategory), 8109 removeBlock: () => (removeBlock), 8110 removeBlocks: () => (removeBlocks), 8111 replaceBlock: () => (replaceBlock), 8112 replaceBlocks: () => (replaceBlocks), 8113 replaceInnerBlocks: () => (replaceInnerBlocks), 8114 resetBlocks: () => (resetBlocks), 8115 resetSelection: () => (resetSelection), 8116 selectBlock: () => (selectBlock), 8117 selectNextBlock: () => (selectNextBlock), 8118 selectPreviousBlock: () => (selectPreviousBlock), 8119 selectionChange: () => (selectionChange), 8120 setBlockEditingMode: () => (setBlockEditingMode), 8121 setBlockMovingClientId: () => (setBlockMovingClientId), 8122 setBlockVisibility: () => (setBlockVisibility), 8123 setHasControlledInnerBlocks: () => (setHasControlledInnerBlocks), 8124 setNavigationMode: () => (setNavigationMode), 8125 setTemplateValidity: () => (setTemplateValidity), 8126 showInsertionPoint: () => (showInsertionPoint), 8127 startDraggingBlocks: () => (startDraggingBlocks), 8128 startMultiSelect: () => (startMultiSelect), 8129 startTyping: () => (startTyping), 8130 stopDraggingBlocks: () => (stopDraggingBlocks), 8131 stopMultiSelect: () => (stopMultiSelect), 8132 stopTyping: () => (stopTyping), 8133 synchronizeTemplate: () => (synchronizeTemplate), 8134 toggleBlockHighlight: () => (toggleBlockHighlight), 8135 toggleBlockMode: () => (toggleBlockMode), 8136 toggleSelection: () => (toggleSelection), 8137 unsetBlockEditingMode: () => (unsetBlockEditingMode), 8138 updateBlock: () => (updateBlock), 8139 updateBlockAttributes: () => (updateBlockAttributes), 8140 updateBlockListSettings: () => (updateBlockListSettings), 8141 updateSettings: () => (updateSettings), 8142 validateBlocksToTemplate: () => (validateBlocksToTemplate) 8143 }); 8144 8145 // NAMESPACE OBJECT: ./node_modules/@wordpress/block-editor/build-module/components/global-styles/index.js 8146 var global_styles_namespaceObject = {}; 8147 __webpack_require__.r(global_styles_namespaceObject); 8148 __webpack_require__.d(global_styles_namespaceObject, { 8149 AdvancedPanel: () => (AdvancedPanel), 8150 BackgroundPanel: () => (BackgroundPanel), 8151 BorderPanel: () => (BorderPanel), 8152 ColorPanel: () => (ColorPanel), 8153 DimensionsPanel: () => (DimensionsPanel), 8154 FiltersPanel: () => (FiltersPanel), 8155 GlobalStylesContext: () => (GlobalStylesContext), 8156 ImageSettingsPanel: () => (ImageSettingsPanel), 8157 TypographyPanel: () => (TypographyPanel), 8158 areGlobalStyleConfigsEqual: () => (areGlobalStyleConfigsEqual), 8159 getBlockCSSSelector: () => (getBlockCSSSelector), 8160 getBlockSelectors: () => (getBlockSelectors), 8161 getGlobalStylesChanges: () => (getGlobalStylesChanges), 8162 getLayoutStyles: () => (getLayoutStyles), 8163 toStyles: () => (toStyles), 8164 useGlobalSetting: () => (useGlobalSetting), 8165 useGlobalStyle: () => (useGlobalStyle), 8166 useGlobalStyleLinks: () => (useGlobalStyleLinks), 8167 useGlobalStylesOutput: () => (useGlobalStylesOutput), 8168 useGlobalStylesOutputWithConfig: () => (useGlobalStylesOutputWithConfig), 8169 useGlobalStylesReset: () => (useGlobalStylesReset), 8170 useHasBackgroundPanel: () => (useHasBackgroundPanel), 8171 useHasBorderPanel: () => (useHasBorderPanel), 8172 useHasBorderPanelControls: () => (useHasBorderPanelControls), 8173 useHasColorPanel: () => (useHasColorPanel), 8174 useHasDimensionsPanel: () => (useHasDimensionsPanel), 8175 useHasFiltersPanel: () => (useHasFiltersPanel), 8176 useHasImageSettingsPanel: () => (useHasImageSettingsPanel), 8177 useHasTypographyPanel: () => (useHasTypographyPanel), 8178 useSettingsForBlockElement: () => (useSettingsForBlockElement) 8179 }); 8180 8181 ;// CONCATENATED MODULE: external ["wp","blocks"] 8182 const external_wp_blocks_namespaceObject = window["wp"]["blocks"]; 8183 ;// CONCATENATED MODULE: external ["wp","element"] 8184 const external_wp_element_namespaceObject = window["wp"]["element"]; 8185 ;// CONCATENATED MODULE: external ["wp","data"] 8186 const external_wp_data_namespaceObject = window["wp"]["data"]; 8187 ;// CONCATENATED MODULE: external ["wp","compose"] 8188 const external_wp_compose_namespaceObject = window["wp"]["compose"]; 8189 ;// CONCATENATED MODULE: external ["wp","hooks"] 8190 const external_wp_hooks_namespaceObject = window["wp"]["hooks"]; 8191 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-edit/context.js 8192 /** 8193 * WordPress dependencies 8194 */ 8195 8196 const mayDisplayControlsKey = Symbol('mayDisplayControls'); 8197 const mayDisplayParentControlsKey = Symbol('mayDisplayParentControls'); 8198 const blockEditingModeKey = Symbol('blockEditingMode'); 8199 const blockBindingsKey = Symbol('blockBindings'); 8200 const isPreviewModeKey = Symbol('isPreviewMode'); 8201 const DEFAULT_BLOCK_EDIT_CONTEXT = { 8202 name: '', 8203 isSelected: false 8204 }; 8205 const Context = (0,external_wp_element_namespaceObject.createContext)(DEFAULT_BLOCK_EDIT_CONTEXT); 8206 const { 8207 Provider 8208 } = Context; 8209 8210 8211 /** 8212 * A hook that returns the block edit context. 8213 * 8214 * @return {Object} Block edit context 8215 */ 8216 function useBlockEditContext() { 8217 return (0,external_wp_element_namespaceObject.useContext)(Context); 8218 } 8219 8220 ;// CONCATENATED MODULE: external ["wp","deprecated"] 8221 const external_wp_deprecated_namespaceObject = window["wp"]["deprecated"]; 8222 var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_namespaceObject); 8223 // EXTERNAL MODULE: ./node_modules/fast-deep-equal/es6/index.js 8224 var es6 = __webpack_require__(7734); 8225 var es6_default = /*#__PURE__*/__webpack_require__.n(es6); 8226 ;// CONCATENATED MODULE: external ["wp","i18n"] 8227 const external_wp_i18n_namespaceObject = window["wp"]["i18n"]; 8228 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/store/defaults.js 8229 /** 8230 * WordPress dependencies 8231 */ 8232 8233 const PREFERENCES_DEFAULTS = { 8234 insertUsage: {} 8235 }; 8236 8237 /** 8238 * The default editor settings 8239 * 8240 * @typedef {Object} SETTINGS_DEFAULT 8241 * @property {boolean} alignWide Enable/Disable Wide/Full Alignments 8242 * @property {boolean} supportsLayout Enable/disable layouts support in container blocks. 8243 * @property {boolean} imageEditing Image Editing settings set to false to disable. 8244 * @property {Array} imageSizes Available image sizes 8245 * @property {number} maxWidth Max width to constraint resizing 8246 * @property {boolean|Array} allowedBlockTypes Allowed block types 8247 * @property {boolean} hasFixedToolbar Whether or not the editor toolbar is fixed 8248 * @property {boolean} distractionFree Whether or not the editor UI is distraction free 8249 * @property {boolean} focusMode Whether the focus mode is enabled or not 8250 * @property {Array} styles Editor Styles 8251 * @property {boolean} keepCaretInsideBlock Whether caret should move between blocks in edit mode 8252 * @property {string} bodyPlaceholder Empty post placeholder 8253 * @property {string} titlePlaceholder Empty title placeholder 8254 * @property {boolean} canLockBlocks Whether the user can manage Block Lock state 8255 * @property {boolean} codeEditingEnabled Whether or not the user can switch to the code editor 8256 * @property {boolean} generateAnchors Enable/Disable auto anchor generation for Heading blocks 8257 * @property {boolean} enableOpenverseMediaCategory Enable/Disable the Openverse media category in the inserter. 8258 * @property {boolean} clearBlockSelection Whether the block editor should clear selection on mousedown when a block is not clicked. 8259 * @property {boolean} __experimentalCanUserUseUnfilteredHTML Whether the user should be able to use unfiltered HTML or the HTML should be filtered e.g., to remove elements considered insecure like iframes. 8260 * @property {boolean} __experimentalBlockDirectory Whether the user has enabled the Block Directory 8261 * @property {Array} __experimentalBlockPatterns Array of objects representing the block patterns 8262 * @property {Array} __experimentalBlockPatternCategories Array of objects representing the block pattern categories 8263 * @property {boolean} __unstableGalleryWithImageBlocks Whether the user has enabled the refactored gallery block which uses InnerBlocks 8264 */ 8265 const SETTINGS_DEFAULTS = { 8266 alignWide: false, 8267 supportsLayout: true, 8268 // colors setting is not used anymore now defaults are passed from theme.json on the server and core has its own defaults. 8269 // The setting is only kept for backward compatibility purposes. 8270 colors: [{ 8271 name: (0,external_wp_i18n_namespaceObject.__)('Black'), 8272 slug: 'black', 8273 color: '#000000' 8274 }, { 8275 name: (0,external_wp_i18n_namespaceObject.__)('Cyan bluish gray'), 8276 slug: 'cyan-bluish-gray', 8277 color: '#abb8c3' 8278 }, { 8279 name: (0,external_wp_i18n_namespaceObject.__)('White'), 8280 slug: 'white', 8281 color: '#ffffff' 8282 }, { 8283 name: (0,external_wp_i18n_namespaceObject.__)('Pale pink'), 8284 slug: 'pale-pink', 8285 color: '#f78da7' 8286 }, { 8287 name: (0,external_wp_i18n_namespaceObject.__)('Vivid red'), 8288 slug: 'vivid-red', 8289 color: '#cf2e2e' 8290 }, { 8291 name: (0,external_wp_i18n_namespaceObject.__)('Luminous vivid orange'), 8292 slug: 'luminous-vivid-orange', 8293 color: '#ff6900' 8294 }, { 8295 name: (0,external_wp_i18n_namespaceObject.__)('Luminous vivid amber'), 8296 slug: 'luminous-vivid-amber', 8297 color: '#fcb900' 8298 }, { 8299 name: (0,external_wp_i18n_namespaceObject.__)('Light green cyan'), 8300 slug: 'light-green-cyan', 8301 color: '#7bdcb5' 8302 }, { 8303 name: (0,external_wp_i18n_namespaceObject.__)('Vivid green cyan'), 8304 slug: 'vivid-green-cyan', 8305 color: '#00d084' 8306 }, { 8307 name: (0,external_wp_i18n_namespaceObject.__)('Pale cyan blue'), 8308 slug: 'pale-cyan-blue', 8309 color: '#8ed1fc' 8310 }, { 8311 name: (0,external_wp_i18n_namespaceObject.__)('Vivid cyan blue'), 8312 slug: 'vivid-cyan-blue', 8313 color: '#0693e3' 8314 }, { 8315 name: (0,external_wp_i18n_namespaceObject.__)('Vivid purple'), 8316 slug: 'vivid-purple', 8317 color: '#9b51e0' 8318 }], 8319 // fontSizes setting is not used anymore now defaults are passed from theme.json on the server and core has its own defaults. 8320 // The setting is only kept for backward compatibility purposes. 8321 fontSizes: [{ 8322 name: (0,external_wp_i18n_namespaceObject._x)('Small', 'font size name'), 8323 size: 13, 8324 slug: 'small' 8325 }, { 8326 name: (0,external_wp_i18n_namespaceObject._x)('Normal', 'font size name'), 8327 size: 16, 8328 slug: 'normal' 8329 }, { 8330 name: (0,external_wp_i18n_namespaceObject._x)('Medium', 'font size name'), 8331 size: 20, 8332 slug: 'medium' 8333 }, { 8334 name: (0,external_wp_i18n_namespaceObject._x)('Large', 'font size name'), 8335 size: 36, 8336 slug: 'large' 8337 }, { 8338 name: (0,external_wp_i18n_namespaceObject._x)('Huge', 'font size name'), 8339 size: 42, 8340 slug: 'huge' 8341 }], 8342 // Image default size slug. 8343 imageDefaultSize: 'large', 8344 imageSizes: [{ 8345 slug: 'thumbnail', 8346 name: (0,external_wp_i18n_namespaceObject.__)('Thumbnail') 8347 }, { 8348 slug: 'medium', 8349 name: (0,external_wp_i18n_namespaceObject.__)('Medium') 8350 }, { 8351 slug: 'large', 8352 name: (0,external_wp_i18n_namespaceObject.__)('Large') 8353 }, { 8354 slug: 'full', 8355 name: (0,external_wp_i18n_namespaceObject.__)('Full Size') 8356 }], 8357 // Allow plugin to disable Image Editor if need be. 8358 imageEditing: true, 8359 // This is current max width of the block inner area 8360 // It's used to constraint image resizing and this value could be overridden later by themes 8361 maxWidth: 580, 8362 // Allowed block types for the editor, defaulting to true (all supported). 8363 allowedBlockTypes: true, 8364 // Maximum upload size in bytes allowed for the site. 8365 maxUploadFileSize: 0, 8366 // List of allowed mime types and file extensions. 8367 allowedMimeTypes: null, 8368 // Allows to disable block locking interface. 8369 canLockBlocks: true, 8370 // Allows to disable Openverse media category in the inserter. 8371 enableOpenverseMediaCategory: true, 8372 clearBlockSelection: true, 8373 __experimentalCanUserUseUnfilteredHTML: false, 8374 __experimentalBlockDirectory: false, 8375 __mobileEnablePageTemplates: false, 8376 __experimentalBlockPatterns: [], 8377 __experimentalBlockPatternCategories: [], 8378 __unstableGalleryWithImageBlocks: false, 8379 __unstableIsPreviewMode: false, 8380 // These settings will be completely revamped in the future. 8381 // The goal is to evolve this into an API which will instruct 8382 // the block inspector to animate transitions between what it 8383 // displays based on the relationship between the selected block 8384 // and its parent, and only enable it if the parent is controlling 8385 // its children blocks. 8386 blockInspectorAnimation: { 8387 animationParent: 'core/navigation', 8388 'core/navigation': { 8389 enterDirection: 'leftToRight' 8390 }, 8391 'core/navigation-submenu': { 8392 enterDirection: 'rightToLeft' 8393 }, 8394 'core/navigation-link': { 8395 enterDirection: 'rightToLeft' 8396 }, 8397 'core/search': { 8398 enterDirection: 'rightToLeft' 8399 }, 8400 'core/social-links': { 8401 enterDirection: 'rightToLeft' 8402 }, 8403 'core/page-list': { 8404 enterDirection: 'rightToLeft' 8405 }, 8406 'core/spacer': { 8407 enterDirection: 'rightToLeft' 8408 }, 8409 'core/home-link': { 8410 enterDirection: 'rightToLeft' 8411 }, 8412 'core/site-title': { 8413 enterDirection: 'rightToLeft' 8414 }, 8415 'core/site-logo': { 8416 enterDirection: 'rightToLeft' 8417 } 8418 }, 8419 generateAnchors: false, 8420 // gradients setting is not used anymore now defaults are passed from theme.json on the server and core has its own defaults. 8421 // The setting is only kept for backward compatibility purposes. 8422 gradients: [{ 8423 name: (0,external_wp_i18n_namespaceObject.__)('Vivid cyan blue to vivid purple'), 8424 gradient: 'linear-gradient(135deg,rgba(6,147,227,1) 0%,rgb(155,81,224) 100%)', 8425 slug: 'vivid-cyan-blue-to-vivid-purple' 8426 }, { 8427 name: (0,external_wp_i18n_namespaceObject.__)('Light green cyan to vivid green cyan'), 8428 gradient: 'linear-gradient(135deg,rgb(122,220,180) 0%,rgb(0,208,130) 100%)', 8429 slug: 'light-green-cyan-to-vivid-green-cyan' 8430 }, { 8431 name: (0,external_wp_i18n_namespaceObject.__)('Luminous vivid amber to luminous vivid orange'), 8432 gradient: 'linear-gradient(135deg,rgba(252,185,0,1) 0%,rgba(255,105,0,1) 100%)', 8433 slug: 'luminous-vivid-amber-to-luminous-vivid-orange' 8434 }, { 8435 name: (0,external_wp_i18n_namespaceObject.__)('Luminous vivid orange to vivid red'), 8436 gradient: 'linear-gradient(135deg,rgba(255,105,0,1) 0%,rgb(207,46,46) 100%)', 8437 slug: 'luminous-vivid-orange-to-vivid-red' 8438 }, { 8439 name: (0,external_wp_i18n_namespaceObject.__)('Very light gray to cyan bluish gray'), 8440 gradient: 'linear-gradient(135deg,rgb(238,238,238) 0%,rgb(169,184,195) 100%)', 8441 slug: 'very-light-gray-to-cyan-bluish-gray' 8442 }, { 8443 name: (0,external_wp_i18n_namespaceObject.__)('Cool to warm spectrum'), 8444 gradient: 'linear-gradient(135deg,rgb(74,234,220) 0%,rgb(151,120,209) 20%,rgb(207,42,186) 40%,rgb(238,44,130) 60%,rgb(251,105,98) 80%,rgb(254,248,76) 100%)', 8445 slug: 'cool-to-warm-spectrum' 8446 }, { 8447 name: (0,external_wp_i18n_namespaceObject.__)('Blush light purple'), 8448 gradient: 'linear-gradient(135deg,rgb(255,206,236) 0%,rgb(152,150,240) 100%)', 8449 slug: 'blush-light-purple' 8450 }, { 8451 name: (0,external_wp_i18n_namespaceObject.__)('Blush bordeaux'), 8452 gradient: 'linear-gradient(135deg,rgb(254,205,165) 0%,rgb(254,45,45) 50%,rgb(107,0,62) 100%)', 8453 slug: 'blush-bordeaux' 8454 }, { 8455 name: (0,external_wp_i18n_namespaceObject.__)('Luminous dusk'), 8456 gradient: 'linear-gradient(135deg,rgb(255,203,112) 0%,rgb(199,81,192) 50%,rgb(65,88,208) 100%)', 8457 slug: 'luminous-dusk' 8458 }, { 8459 name: (0,external_wp_i18n_namespaceObject.__)('Pale ocean'), 8460 gradient: 'linear-gradient(135deg,rgb(255,245,203) 0%,rgb(182,227,212) 50%,rgb(51,167,181) 100%)', 8461 slug: 'pale-ocean' 8462 }, { 8463 name: (0,external_wp_i18n_namespaceObject.__)('Electric grass'), 8464 gradient: 'linear-gradient(135deg,rgb(202,248,128) 0%,rgb(113,206,126) 100%)', 8465 slug: 'electric-grass' 8466 }, { 8467 name: (0,external_wp_i18n_namespaceObject.__)('Midnight'), 8468 gradient: 'linear-gradient(135deg,rgb(2,3,129) 0%,rgb(40,116,252) 100%)', 8469 slug: 'midnight' 8470 }], 8471 __unstableResolvedAssets: { 8472 styles: [], 8473 scripts: [] 8474 } 8475 }; 8476 8477 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/store/array.js 8478 /** 8479 * Insert one or multiple elements into a given position of an array. 8480 * 8481 * @param {Array} array Source array. 8482 * @param {*} elements Elements to insert. 8483 * @param {number} index Insert Position. 8484 * 8485 * @return {Array} Result. 8486 */ 8487 function insertAt(array, elements, index) { 8488 return [...array.slice(0, index), ...(Array.isArray(elements) ? elements : [elements]), ...array.slice(index)]; 8489 } 8490 8491 /** 8492 * Moves an element in an array. 8493 * 8494 * @param {Array} array Source array. 8495 * @param {number} from Source index. 8496 * @param {number} to Destination index. 8497 * @param {number} count Number of elements to move. 8498 * 8499 * @return {Array} Result. 8500 */ 8501 function moveTo(array, from, to, count = 1) { 8502 const withoutMovedElements = [...array]; 8503 withoutMovedElements.splice(from, count); 8504 return insertAt(withoutMovedElements, array.slice(from, from + count), to); 8505 } 8506 8507 ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/store/reducer.js 8508 /** 8509 * External dependencies 8510 */ 8511 8512 8513 /** 8514 * WordPress dependencies 8515 */ 8516 8517 8518 8519 /** 8520 * Internal dependencies 8521 */ 8522 8523 8524 const identity = x => x; 8525 8526 /** 8527 * Given an array of blocks, returns an object where each key is a nesting 8528 * context, the value of which is an array of block client IDs existing within 8529 * that nesting context. 8530 * 8531 * @param {Array} blocks Blocks to map. 8532 * @param {?string} rootClientId Assumed root client ID. 8533 * 8534 * @return {Object} Block order map object. 8535 */ 8536 function mapBlockOrder(blocks, rootClientId = '') { 8537 const result = new Map(); 8538 const current = []; 8539 result.set(rootClientId, current); 8540 blocks.forEach(block => { 8541 const { 8542 clientId, 8543 innerBlocks 8544 } = block; 8545 current.push(clientId); 8546 mapBlockOrder(innerBlocks, clientId).forEach((order, subClientId) => { 8547 result.set(subClientId, order); 8548 }); 8549 }); 8550 return result; 8551 } 8552 8553 /** 8554 * Given an array of blocks, returns an object where each key contains 8555 * the clientId of the block and the value is the parent of the block. 8556 * 8557 * @param {Array} blocks Blocks to map. 8558 * @param {?string} rootClientId Assumed root client ID. 8559 * 8560 * @return {Object} Block order map object. 8561 */ 8562 function mapBlockParents(blocks, rootClientId = '') { 8563 const result = []; 8564 const stack = [[rootClientId, blocks]]; 8565 while (stack.length) { 8566 const [parent, currentBlocks] = stack.shift(); 8567 currentBlocks.forEach(({ 8568 innerBlocks, 8569 ...block 8570 }) => { 8571 result.push([block.clientId, parent]); 8572 if (innerBlocks?.length) { 8573 stack.push([block.clientId, innerBlocks]); 8574 } 8575 }); 8576 } 8577 return result; 8578 } 8579 8580 /** 8581 * Helper method to iterate through all blocks, recursing into inner blocks, 8582 * applying a transformation function to each one. 8583 * Returns a flattened object with the transformed blocks. 8584 * 8585 * @param {Array} blocks Blocks to flatten. 8586 * @param {Function} transform Transforming function to be applied to each block. 8587 * 8588 * @return {Array} Flattened object. 8589 */ 8590 function flattenBlocks(blocks, transform = identity) { 8591 const result = []; 8592 const stack = [...blocks]; 8593 while (stack.length) { 8594 const { 8595 innerBlocks, 8596 ...block 8597 } = stack.shift(); 8598 stack.push(...innerBlocks); 8599 result.push([block.clientId, transform(block)]); 8600 } 8601 return result; 8602 } 8603 function getFlattenedClientIds(blocks) { 8604 const result = {}; 8605 const stack = [...blocks]; 8606 while (stack.length) { 8607 const { 8608 innerBlocks, 8609 ...block 8610 } = stack.shift(); 8611 stack.push(...innerBlocks); 8612 result[block.clientId] = true; 8613 } 8614 return result; 8615 } 8616 8617 /** 8618 * Given an array of blocks, returns an object containing all blocks, without 8619 * attributes, recursing into inner blocks. Keys correspond to the block client 8620 * ID, the value of which is the attributes object. 8621 * 8622 * @param {Array} blocks Blocks to flatten. 8623 * 8624 * @return {Array} Flattened block attributes object. 8625 */ 8626 function getFlattenedBlocksWithoutAttributes(blocks) { 8627 return flattenBlocks(blocks, block => { 8628 const { 8629 attributes, 8630 ...restBlock 8631 } = block; 8632 return restBlock; 8633 }); 8634 } 8635 8636 /** 8637 * Given an array of blocks, returns an object containing all block attributes, 8638 * recursing into inner blocks. Keys correspond to the block client ID, the 8639 * value of which is the attributes object. 8640 * 8641 * @param {Array} blocks Blocks to flatten. 8642 * 8643 * @return {Array} Flattened block attributes object. 8644 */ 8645 function getFlattenedBlockAttributes(blocks) { 8646 return flattenBlocks(blocks, block => block.attributes); 8647 } 8648 8649 /** 8650 * Returns true if the two object arguments have the same keys, or false 8651 * otherwise. 8652 * 8653 * @param {Object} a First object. 8654 * @param {Object} b Second object. 8655 * 8656 * @return {boolean} Whether the two objects have the same keys. 8657 */ 8658 function hasSameKeys(a, b) { 8659 return es6_default()(Object.keys(a), Object.keys(b)); 8660 } 8661 8662 /** 8663 * Returns true if, given the currently dispatching action and the previously 8664 * dispatched action, the two actions are updating the same block attribute, or 8665 * false otherwise. 8666 * 8667 * @param {Object} action Currently dispatching action. 8668 * @param {Object} lastAction Previously dispatched action. 8669 * 8670 * @return {boolean} Whether actions are updating the same block attribute. 8671 */ 8672 function isUpdatingSameBlockAttribute(action, lastAction) { 8673 return action.type === 'UPDATE_BLOCK_ATTRIBUTES' && lastAction !== undefined && lastAction.type === 'UPDATE_BLOCK_ATTRIBUTES' && es6_default()(action.clientIds, lastAction.clientIds) && hasSameKeys(action.attributes, lastAction.attributes); 8674 } 8675 function updateBlockTreeForBlocks(state, blocks) { 8676 const treeToUpdate = state.tree; 8677 const stack = [...blocks]; 8678 const flattenedBlocks = [...blocks]; 8679 while (stack.length) { 8680 const block = stack.shift(); 8681 stack.push(...block.innerBlocks); 8682 flattenedBlocks.push(...block.innerBlocks); 8683 } 8684 // Create objects before mutating them, that way it's always defined. 8685 for (const block of flattenedBlocks) { 8686 treeToUpdate.set(block.clientId, {}); 8687 } 8688 for (const block of flattenedBlocks) { 8689 treeToUpdate.set(block.clientId, Object.assign(treeToUpdate.get(block.clientId), { 8690 ...state.byClientId.get(block.clientId), 8691 attributes: state.attributes.get(block.clientId), 8692 innerBlocks: block.innerBlocks.map(subBlock => treeToUpdate.get(subBlock.clientId)) 8693 })); 8694 } 8695 } 8696 function updateParentInnerBlocksInTree(state, updatedClientIds, updateChildrenOfUpdatedClientIds = false) { 8697 const treeToUpdate = state.tree; 8698 const uncontrolledParents = new Set([]); 8699 const controlledParents = new Set(); 8700 for (const clientId of updatedClientIds) { 8701 let current = updateChildrenOfUpdatedClientIds ? clientId : state.parents.get(clientId); 8702 do { 8703 if (state.controlledInnerBlocks[current]) { 8704 // Should stop on controlled blocks. 8705 // If we reach a controlled parent, break out of the loop. 8706 controlledParents.add(current); 8707 break; 8708 } else { 8709 // Else continue traversing up through parents. 8710 uncontrolledParents.add(current); 8711 current = state.parents.get(current); 8712 } 8713 } while (current !== undefined); 8714 } 8715 8716 // To make sure the order of assignments doesn't matter, 8717 // we first create empty objects and mutates the inner blocks later. 8718 for (const clientId of uncontrolledParents) { 8719 treeToUpdate.set(clientId, { 8720 ...treeToUpdate.get(clientId) 8721 }); 8722 } 8723 for (const clientId of uncontrolledParents) { 8724 treeToUpdate.get(clientId).innerBlocks = (state.order.get(clientId) || []).map(subClientId => treeToUpdate.get(subClientId)); 8725 } 8726 8727 // Controlled parent blocks, need a dedicated key for their inner blocks 8728 // to be used when doing getBlocks( controlledBlockClientId ). 8729 for (const clientId of controlledParents) { 8730 treeToUpdate.set('controlled||' + clientId, { 8731 innerBlocks: (state.order.get(clientId) || []).map(subClientId => treeToUpdate.get(subClientId)) 8732 }); 8733 } 8734 } 8735 8736 /** 8737 * Higher-order reducer intended to compute full block objects key for each block in the post. 8738 * This is a denormalization to optimize the performance of the getBlock selectors and avoid 8739 * recomputing the block objects and avoid heavy memoization. 8740 * 8741 * @param {Function} reducer Original reducer function. 8742 * 8743 * @return {Function} Enhanced reducer function. 8744 */ 8745 const withBlockTree = reducer => (state = {}, action) => { 8746 const newState = reducer(state, action); 8747 if (newState === state) { 8748 return state; 8749 } 8750 newState.tree = state.tree ? state.tree : new Map(); 8751 switch (action.type) { 8752 case 'RECEIVE_BLOCKS': 8753 case 'INSERT_BLOCKS': 8754 { 8755 newState.tree = new Map(newState.tree); 8756 updateBlockTreeForBlocks(newState, action.blocks); 8757 updateParentInnerBlocksInTree(newState, action.rootClientId ? [action.rootClientId] : [''], true); 8758 break; 8759 } 8760 case 'UPDATE_BLOCK': 8761 newState.tree = new Map(newState.tree); 8762 newState.tree.set(action.clientId, { 8763 ...newState.tree.get(action.clientId), 8764 ...newState.byClientId.get(action.clientId), 8765 attributes: newState.attributes.get(action.clientId) 8766 }); 8767 updateParentInnerBlocksInTree(newState, [action.clientId], false); 8768 break; 8769 case 'SYNC_DERIVED_BLOCK_ATTRIBUTES': 8770 case 'UPDATE_BLOCK_ATTRIBUTES': 8771 { 8772 newState.tree = new Map(newState.tree); 8773 action.clientIds.forEach(clientId => { 8774 newState.tree.set(clientId, { 8775 ...newState.tree.get(clientId), 8776 attributes: newState.attributes.get(clientId) 8777 }); 8778 }); 8779 updateParentInnerBlocksInTree(newState, action.clientIds, false); 8780 break; 8781 } 8782 case 'REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN': 8783 { 8784 const inserterClientIds = getFlattenedClientIds(action.blocks); 8785 newState.tree = new Map(newState.tree); 8786 action.replacedClientIds.forEach(clientId => { 8787 newState.tree.delete(clientId); 8788 // Controlled inner blocks are only removed 8789 // if the block doesn't move to another position 8790 // otherwise their content will be lost. 8791 if (!inserterClientIds[clientId]) { 8792 newState.tree.delete('controlled||' + clientId); 8793 } 8794 }); 8795 updateBlockTreeForBlocks(newState, action.blocks); 8796 updateParentInnerBlocksInTree(newState, action.blocks.map(b => b.clientId), false); 8797 8798 // If there are no replaced blocks, it means we're removing blocks so we need to update their parent. 8799 const parentsOfRemovedBlocks = []; 8800 for (const clientId of action.clientIds) { 8801 const parentId = state.parents.get(clientId); 8802 if (parentId !== undefined && (parentId === '' || newState.byClientId.get(parentId))) { 8803 parentsOfRemovedBlocks.push(parentId); 8804 } 8805 } 8806 updateParentInnerBlocksInTree(newState, parentsOfRemovedBlocks, true); 8807 break; 8808 } 8809 case 'REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN': 8810 const parentsOfRemovedBlocks = []; 8811 for (const clientId of action.clientIds) { 8812 const parentId = state.parents.get(clientId); 8813 if (parentId !== undefined && (parentId === '' || newState.byClientId.get(parentId))) { 8814 parentsOfRemovedBlocks.push(parentId); 8815 } 8816 } 8817 newState.tree = new Map(newState.tree); 8818 action.removedClientIds.forEach(clientId => { 8819 newState.tree.delete(clientId); 8820 newState.tree.delete('controlled||' + clientId); 8821 }); 8822 updateParentInnerBlocksInTree(newState, parentsOfRemovedBlocks, true); 8823 break; 8824 case 'MOVE_BLOCKS_TO_POSITION': 8825 { 8826 const updatedBlockUids = []; 8827 if (action.fromRootClientId) { 8828 updatedBlockUids.push(action.fromRootClientId); 8829 } else { 8830 updatedBlockUids.push(''); 8831 } 8832 if (action.toRootClientId) { 8833 updatedBlockUids.push(action.toRootClientId); 8834 } 8835 newState.tree = new Map(newState.tree); 8836 updateParentInnerBlocksInTree(newState, updatedBlockUids, true); 8837 break; 8838 } 8839 case 'MOVE_BLOCKS_UP': 8840 case 'MOVE_BLOCKS_DOWN': 8841 { 8842 const updatedBlockUids = [action.rootClientId ? action.rootClientId : '']; 8843 newState.tree = new Map(newState.tree); 8844 updateParentInnerBlocksInTree(newState, updatedBlockUids, true); 8845 break; 8846 } 8847 case 'SAVE_REUSABLE_BLOCK_SUCCESS': 8848 { 8849 const updatedBlockUids = []; 8850 newState.attributes.forEach((attributes, clientId) => { 8851 if (newState.byClientId.get(clientId).name === 'core/block' && attributes.ref === action.updatedId) { 8852 updatedBlockUids.push(clientId); 8853 } 8854 }); 8855 newState.tree = new Map(newState.tree); 8856 updatedBlockUids.forEach(clientId => { 8857 newState.tree.set(clientId, { 8858 ...newState.byClientId.get(clientId), 8859 attributes: newState.attributes.get(clientId), 8860 innerBlocks: newState.tree.get(clientId).innerBlocks 8861 }); 8862 }); 8863 updateParentInnerBlocksInTree(newState, updatedBlockUids, false); 8864 } 8865 } 8866 return newState; 8867 }; 8868 8869 /** 8870 * Higher-order reducer intended to augment the blocks reducer, assigning an 8871 * `isPersistentChange` property value corresponding to whether a change in 8872 * state can be considered as persistent. All changes are considered persistent 8873 * except when updating the same block attribute as in the previous action. 8874 * 8875 * @param {Function} reducer Original reducer function. 8876 * 8877 * @return {Function} Enhanced reducer function. 8878 */ 8879 function withPersistentBlockChange(reducer) { 8880 let lastAction; 8881 let markNextChangeAsNotPersistent = false; 8882 let explicitPersistent; 8883 return (state, action) => { 8884 let nextState = reducer(state, action); 8885 let nextIsPersistentChange; 8886 if (action.type === 'SET_EXPLICIT_PERSISTENT') { 8887 var _state$isPersistentCh; 8888 explicitPersistent = action.isPersistentChange; 8889 nextIsPersistentChange = (_state$isPersistentCh = state.isPersistentChange) !== null && _state$isPersistentCh !== void 0 ? _state$isPersistentCh : true; 8890 } 8891 if (explicitPersistent !== undefined) { 8892 nextIsPersistentChange = explicitPersistent; 8893 return nextIsPersistentChange === nextState.isPersistentChange ? nextState : { 8894 ...nextState, 8895 isPersistentChange: nextIsPersistentChange 8896 }; 8897 } 8898 const isExplicitPersistentChange = action.type === 'MARK_LAST_CHANGE_AS_PERSISTENT' || markNextChangeAsNotPersistent; 8899 8900 // Defer to previous state value (or default) unless changing or 8901 // explicitly marking as persistent. 8902 if (state === nextState && !isExplicitPersistentChange) { 8903 var _state$isPersistentCh2; 8904 markNextChangeAsNotPersistent = action.type === 'MARK_NEXT_CHANGE_AS_NOT_PERSISTENT'; 8905 nextIsPersistentChange = (_state$isPersistentCh2 = state?.isPersistentChange) !== null && _state$isPersistentCh2 !== void 0 ? _state$isPersistentCh2 : true; 8906 if (state.isPersistentChange === nextIsPersistentChange) { 8907 return state; 8908 } 8909 return { 8910 ...nextState, 8911 isPersistentChange: nextIsPersistentChange 8912 }; 8913 } 8914 nextState = { 8915 ...nextState, 8916 isPersistentChange: isExplicitPersistentChange ? !markNextChangeAsNotPersistent : !isUpdatingSameBlockAttribute(action, lastAction) 8917 }; 8918 8919 // In comparing against the previous action, consider only those which 8920 // would have qualified as one which would have been ignored or not 8921 // have resulted in a changed state. 8922 lastAction = action; 8923 markNextChangeAsNotPersistent = action.type === 'MARK_NEXT_CHANGE_AS_NOT_PERSISTENT'; 8924 return nextState; 8925 }; 8926 } 8927 8928 /** 8929 * Higher-order reducer intended to augment the blocks reducer, assigning an 8930 * `isIgnoredChange` property value corresponding to whether a change in state 8931 * can be considered as ignored. A change is considered ignored when the result 8932 * of an action not incurred by direct user interaction. 8933 * 8934 * @param {Function} reducer Original reducer function. 8935 * 8936 * @return {Function} Enhanced reducer function. 8937 */ 8938 function withIgnoredBlockChange(reducer) { 8939 /** 8940 * Set of action types for which a blocks state change should be ignored. 8941 * 8942 * @type {Set} 8943 */ 8944 const IGNORED_ACTION_TYPES = new Set(['RECEIVE_BLOCKS']); 8945 return (state, action) => { 8946 const nextState = reducer(state, action); 8947 if (nextState !== state) { 8948 nextState.isIgnoredChange = IGNORED_ACTION_TYPES.has(action.type); 8949 } 8950 return nextState; 8951 }; 8952 } 8953 8954 /** 8955 * Higher-order reducer targeting the combined blocks reducer, augmenting 8956 * block client IDs in remove action to include cascade of inner blocks. 8957 * 8958 * @param {Function} reducer Original reducer function. 8959 * 8960 * @return {Function} Enhanced reducer function. 8961 */ 8962 const withInnerBlocksRemoveCascade = reducer => (state, action) => { 8963 // Gets all children which need to be removed. 8964 const getAllChildren = clientIds => { 8965 let result = clientIds; 8966 for (let i = 0; i < result.length; i++) { 8967 if (!state.order.get(result[i]) || action.keepControlledInnerBlocks && action.keepControlledInnerBlocks[result[i]]) { 8968 continue; 8969 } 8970 if (result === clientIds) { 8971 result = [...result]; 8972 } 8973 result.push(...state.order.get(result[i])); 8974 } 8975 return result; 8976 }; 8977 if (state) { 8978 switch (action.type) { 8979 case 'REMOVE_BLOCKS': 8980 action = { 8981 ...action, 8982 type: 'REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN', 8983 removedClientIds: getAllChildren(action.clientIds) 8984 }; 8985 break; 8986 case 'REPLACE_BLOCKS': 8987 action = { 8988 ...action, 8989 type: 'REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN', 8990 replacedClientIds: getAllChildren(action.clientIds) 8991 }; 8992 break; 8993 } 8994 } 8995 return reducer(state, action); 8996 }; 8997 8998 /** 8999 * Higher-order reducer which targets the combined blocks reducer and handles 9000 * the `RESET_BLOCKS` action. When dispatched, this action will replace all 9001 * blocks that exist in the post, leaving blocks that exist only in state (e.g. 9002 * reusable blocks and blocks controlled by inner blocks controllers) alone. 9003 * 9004 * @param {Function} reducer Original reducer function. 9005 * 9006 * @return {Function} Enhanced reducer function. 9007 */ 9008 const withBlockReset = reducer => (state, action) => { 9009 if (action.type === 'RESET_BLOCKS') { 9010 const newState = { 9011 ...state, 9012 byClientId: new Map(getFlattenedBlocksWithoutAttributes(action.blocks)), 9013 attributes: new Map(getFlattenedBlockAttributes(action.blocks)), 9014 order: mapBlockOrder(action.blocks), 9015 parents: new Map(mapBlockParents(action.blocks)), 9016 controlledInnerBlocks: {} 9017 }; 9018 newState.tree = new Map(state?.tree); 9019 updateBlockTreeForBlocks(newState, action.blocks); 9020 newState.tree.set('', { 9021 innerBlocks: action.blocks.map(subBlock => newState.tree.get(subBlock.clientId)) 9022 }); 9023 return newState; 9024 } 9025 return reducer(state, action); 9026 }; 9027 9028 /** 9029 * Higher-order reducer which targets the combined blocks reducer and handles 9030 * the `REPLACE_INNER_BLOCKS` action. When dispatched, this action the state 9031 * should become equivalent to the execution of a `REMOVE_BLOCKS` action 9032 * containing all the child's of the root block followed by the execution of 9033 * `INSERT_BLOCKS` with the new blocks. 9034 * 9035 * @param {Function} reducer Original reducer function. 9036 * 9037 * @return {Function} Enhanced reducer function. 9038 */ 9039 const withReplaceInnerBlocks = reducer => (state, action) => { 9040 if (action.type !== 'REPLACE_INNER_BLOCKS') { 9041 return reducer(state, action); 9042 } 9043 9044 // Finds every nested inner block controller. We must check the action blocks 9045 // and not just the block parent state because some inner block controllers 9046 // should be deleted if specified, whereas others should not be deleted. If 9047 // a controlled should not be deleted, then we need to avoid deleting its 9048 // inner blocks from the block state because its inner blocks will not be 9049 // attached to the block in the action. 9050 const nestedControllers = {}; 9051 if (Object.keys(state.controlledInnerBlocks).length) { 9052 const stack = [...action.blocks]; 9053 while (stack.length) { 9054 const { 9055 innerBlocks, 9056 ...block 9057 } = stack.shift(); 9058 stack.push(...innerBlocks); 9059 if (!!state.controlledInnerBlocks[block.clientId]) { 9060 nestedControllers[block.clientId] = true; 9061 } 9062 } 9063 } 9064 9065 // The `keepControlledInnerBlocks` prop will keep the inner blocks of the 9066 // marked block in the block state so that they can be reattached to the 9067 // marked block when we re-insert everything a few lines below. 9068 let stateAfterBlocksRemoval = state; 9069 if (state.order.get(action.rootClientId)) { 9070 stateAfterBlocksRemoval = reducer(stateAfterBlocksRemoval, { 9071 type: 'REMOVE_BLOCKS', 9072 keepControlledInnerBlocks: nestedControllers, 9073 clientIds: state.order.get(action.rootClientId) 9074 }); 9075 } 9076 let stateAfterInsert = stateAfterBlocksRemoval; 9077 if (action.blocks.length) { 9078 stateAfterInsert = reducer(stateAfterInsert, { 9079 ...action, 9080 type: 'INSERT_BLOCKS', 9081 index: 0 9082 }); 9083 9084 // We need to re-attach the controlled inner blocks to the blocks tree and 9085 // preserve their block order. Otherwise, an inner block controller's blocks 9086 // will be deleted entirely from its entity. 9087 const stateAfterInsertOrder = new Map(stateAfterInsert.order); 9088 Object.keys(nestedControllers).forEach(key => { 9089 if (state.order.get(key)) { 9090 stateAfterInsertOrder.set(key, state.order.get(key)); 9091 } 9092 }); 9093 stateAfterInsert.order = stateAfterInsertOrder; 9094 stateAfterInsert.tree = new Map(stateAfterInsert.tree); 9095 Object.keys(nestedControllers).forEach(_key => { 9096 const key = `controlled||$_key}`; 9097 if (state.tree.has(key)) { 9098 stateAfterInsert.tree.set(key, state.tree.get(key)); 9099 } 9100 }); 9101 } 9102 return stateAfterInsert; 9103 }; 9104 9105 /** 9106 * Higher-order reducer which targets the combined blocks reducer and handles 9107 * the `SAVE_REUSABLE_BLOCK_SUCCESS` action. This action can't be handled by 9108 * regular reducers and needs a higher-order reducer since it needs access to 9109 * both `byClientId` and `attributes` simultaneously. 9110 * 9111 * @param {Function} reducer Original reducer function. 9112 * 9113 * @return {Function} Enhanced reducer function. 9114 */ 9115 const withSaveReusableBlock = reducer => (state, action) => { 9116 if (state && action.type === 'SAVE_REUSABLE_BLOCK_SUCCESS') { 9117 const { 9118 id, 9119 updatedId 9120 } = action; 9121 9122 // If a temporary reusable block is saved, we swap the temporary id with the final one. 9123 if (id === updatedId) { 9124 return state; 9125 } 9126 state = { 9127 ...state 9128 }; 9129 state.attributes = new Map(state.attributes); 9130 state.attributes.forEach((attributes, clientId) => { 9131 const { 9132 name 9133 } = state.byClientId.get(clientId); 9134 if (name === 'core/block' && attributes.ref === id) { 9135 state.attributes.set(clientId, { 9136 ...attributes, 9137 ref: updatedId 9138 }); 9139 } 9140 }); 9141 } 9142 return reducer(state, action); 9143 }; 9144 /** 9145 * Higher-order reducer which removes blocks from state when switching parent block controlled state. 9146 * 9147 * @param {Function} reducer Original reducer function. 9148 * 9149 * @return {Function} Enhanced reducer function. 9150 */ 9151 const withResetControlledBlocks = reducer => (state, action) => { 9152 if (action.type === 'SET_HAS_CONTROLLED_INNER_BLOCKS') { 9153 // when switching a block from controlled to uncontrolled or inverse, 9154 // we need to remove its content first. 9155 const tempState = reducer(state, { 9156 type: 'REPLACE_INNER_BLOCKS', 9157 rootClientId: action.clientId, 9158 blocks: [] 9159 }); 9160 return reducer(tempState, action); 9161 } 9162 return reducer(state, action); 9163 }; 9164 9165 /** 9166 * Reducer returning the blocks state. 9167 * 9168 * @param {Object} state Current state. 9169 * @param {Object} action Dispatched action. 9170 * 9171 * @return {Object} Updated state. 9172 */ 9173 const blocks = (0,external_wp_compose_namespaceObject.pipe)(external_wp_data_namespaceObject.combineReducers, withSaveReusableBlock, 9174 // Needs to be before withBlockCache. 9175 withBlockTree, 9176 // Needs to be before withInnerBlocksRemoveCascade. 9177 withInnerBlocksRemoveCascade, withReplaceInnerBlocks, 9178 // Needs to be after withInnerBlocksRemoveCascade. 9179 withBlockReset, withPersistentBlockChange, withIgnoredBlockChange, withResetControlledBlocks)({ 9180 // The state is using a Map instead of a plain object for performance reasons. 9181 // You can run the "./test/performance.js" unit test to check the impact 9182 // code changes can have on this reducer. 9183 byClientId(state = new Map(), action) { 9184 switch (action.type) { 9185 case 'RECEIVE_BLOCKS': 9186 case 'INSERT_BLOCKS': 9187 { 9188 const newState = new Map(state); 9189 getFlattenedBlocksWithoutAttributes(action.blocks).forEach(([key, value]) => { 9190 newState.set(key, value); 9191 }); 9192 return newState; 9193 } 9194 case 'UPDATE_BLOCK': 9195 { 9196 // Ignore updates if block isn't known. 9197 if (!state.has(action.clientId)) { 9198 return state; 9199 } 9200 9201 // Do nothing if only attributes change. 9202 const { 9203 attributes, 9204 ...changes 9205 } = action.updates; 9206 if (Object.values(changes).length === 0) { 9207 return state; 9208 } 9209 const newState = new Map(state); 9210 newState.set(action.clientId, { 9211 ...state.get(action.clientId), 9212 ...changes 9213 }); 9214 return newState; 9215 } 9216 case 'REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN': 9217 { 9218 if (!action.blocks) { 9219 return state; 9220 } 9221 const newState = new Map(state); 9222 action.replacedClientIds.forEach(clientId => { 9223 newState.delete(clientId); 9224 }); 9225 getFlattenedBlocksWithoutAttributes(action.blocks).forEach(([key, value]) => { 9226 newState.set(key, value); 9227 }); 9228 return newState; 9229 } 9230 case 'REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN': 9231 { 9232 const newState = new Map(state); 9233 action.removedClientIds.forEach(clientId => { 9234 newState.delete(clientId); 9235 }); 9236 return newState; 9237 } 9238 } 9239 return state; 9240 }, 9241 // The state is using a Map instead of a plain object for performance reasons. 9242 // You can run the "./test/performance.js" unit test to check the impact 9243 // code changes can have on this reducer. 9244 attributes(state = new Map(), action) { 9245 switch (action.type) { 9246 case 'RECEIVE_BLOCKS': 9247 case 'INSERT_BLOCKS': 9248 { 9249 const newState = new Map(state); 9250 getFlattenedBlockAttributes(action.blocks).forEach(([key, value]) => { 9251 newState.set(key, value); 9252 }); 9253 return newState; 9254 } 9255 case 'UPDATE_BLOCK': 9256 { 9257 // Ignore updates if block isn't known or there are no attribute changes. 9258 if (!state.get(action.clientId) || !action.updates.attributes) { 9259 return state; 9260 } 9261 const newState = new Map(state); 9262 newState.set(action.clientId, { 9263 ...state.get(action.clientId), 9264 ...action.updates.attributes 9265 }); 9266 return newState; 9267 } 9268 case 'SYNC_DERIVED_BLOCK_ATTRIBUTES': 9269 case 'UPDATE_BLOCK_ATTRIBUTES': 9270 { 9271 // Avoid a state change if none of the block IDs are known. 9272 if (action.clientIds.every(id => !state.get(id))) { 9273 return state; 9274 } 9275 let hasChange = false; 9276 const newState = new Map(state); 9277 for (const clientId of action.clientIds) { 9278 var _action$attributes; 9279 const updatedAttributeEntries = Object.entries(action.uniqueByBlock ? action.attributes[clientId] : (_action$attributes = action.attributes) !== null && _action$attributes !== void 0 ? _action$attributes : {}); 9280 if (updatedAttributeEntries.length === 0) { 9281 continue; 9282 } 9283 let hasUpdatedAttributes = false; 9284 const existingAttributes = state.get(clientId); 9285 const newAttributes = {}; 9286 updatedAttributeEntries.forEach(([key, value]) => { 9287 if (existingAttributes[key] !== value) { 9288 hasUpdatedAttributes = true; 9289 newAttributes[key] = value; 9290 } 9291 }); 9292 hasChange = hasChange || hasUpdatedAttributes; 9293 if (hasUpdatedAttributes) { 9294 newState.set(clientId, { 9295 ...existingAttributes, 9296 ...newAttributes 9297 }); 9298 } 9299 } 9300 return hasChange ? newState : state; 9301 } 9302 case 'REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN': 9303 { 9304 if (!action.blocks) { 9305 return state; 9306 } 9307 const newState = new Map(state); 9308 action.replacedClientIds.forEach(clientId => { 9309 newState.delete(clientId); 9310 }); 9311 getFlattenedBlockAttributes(action.blocks).forEach(([key, value]) => { 9312 newState.set(key, value); 9313 }); 9314 return newState; 9315 } 9316 case 'REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN': 9317 { 9318 const newState = new Map(state); 9319 action.removedClientIds.forEach(clientId => { 9320 newState.delete(clientId); 9321 }); 9322 return newState; 9323 } 9324 } 9325 return state; 9326 }, 9327 // The state is using a Map instead of a plain object for performance reasons. 9328 // You can run the "./test/performance.js" unit test to check the impact 9329 // code changes can have on this reducer. 9330 order(state = new Map(), action) { 9331 switch (action.type) { 9332 case 'RECEIVE_BLOCKS': 9333 { 9334 var _state$get; 9335 const blockOrder = mapBlockOrder(action.blocks); 9336 const newState = new Map(state); 9337 blockOrder.forEach((order, clientId) => { 9338 if (clientId !== '') { 9339 newState.set(clientId, order); 9340 } 9341 }); 9342 newState.set('', ((_state$get = state.get('')) !== null && _state$get !== void 0 ? _state$get : []).concat(blockOrder[''])); 9343 return newState; 9344 } 9345 case 'INSERT_BLOCKS': 9346 { 9347 const { 9348 rootClientId = '' 9349 } = action; 9350 const subState = state.get(rootClientId) || []; 9351 const mappedBlocks = mapBlockOrder(action.blocks, rootClientId); 9352 const { 9353 index = subState.length 9354 } = action; 9355 const newState = new Map(state); 9356 mappedBlocks.forEach((order, clientId) => { 9357 newState.set(clientId, order); 9358 }); 9359 newState.set(rootClientId, insertAt(subState, mappedBlocks.get(rootClientId), index)); 9360 return newState; 9361 } 9362 case 'MOVE_BLOCKS_TO_POSITION': 9363 { 9364 var _state$get$filter; 9365 const { 9366 fromRootClientId = '', 9367 toRootClientId = '', 9368 clientIds 9369 } = action; 9370 const { 9371 index = state.get(toRootClientId).length 9372 } = action; 9373 9374 // Moving inside the same parent block. 9375 if (fromRootClientId === toRootClientId) { 9376 const subState = state.get(toRootClientId); 9377 const fromIndex = subState.indexOf(clientIds[0]); 9378 const newState = new Map(state); 9379 newState.set(toRootClientId, moveTo(state.get(toRootClientId), fromIndex, index, clientIds.length)); 9380 return newState; 9381 } 9382 9383 // Moving from a parent block to another. 9384 const newState = new Map(state); 9385 newState.set(fromRootClientId, (_state$get$filter = state.get(fromRootClientId)?.filter(id => !clientIds.includes(id))) !== null && _state$get$filter !== void 0 ? _state$get$filter : []); 9386 newState.set(toRootClientId, insertAt(state.get(toRootClientId), clientIds, index)); 9387 return newState; 9388 } 9389 case 'MOVE_BLOCKS_UP': 9390 { 9391 const { 9392 clientIds, 9393 rootClientId = '' 9394 } = action; 9395 const firstClientId = clientIds[0]; 9396 const subState = state.get(rootClientId); 9397 if (!subState.length || firstClientId === subState[0]) { 9398 return state; 9399 } 9400 const firstIndex = subState.indexOf(firstClientId); 9401 const newState = new Map(state); 9402 newState.set(rootClientId, moveTo(subState, firstIndex, firstIndex - 1, clientIds.length)); 9403 return newState; 9404 } 9405 case 'MOVE_BLOCKS_DOWN': 9406 { 9407 const { 9408 clientIds, 9409 rootClientId = '' 9410 } = action; 9411 const firstClientId = clientIds[0]; 9412 const lastClientId = clientIds[clientIds.length - 1]; 9413 const subState = state.get(rootClientId); 9414 if (!subState.length || lastClientId === subState[subState.length - 1]) { 9415 return state; 9416 } 9417 const firstIndex = subState.indexOf(firstClientId); 9418 const newState = new Map(state); 9419 newState.set(rootClientId, moveTo(subState, firstIndex, firstIndex + 1, clientIds.length)); 9420 return newState; 9421 } 9422 case 'REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN': 9423 { 9424 const { 9425 clientIds 9426 } = action; 9427 if (!action.blocks) { 9428 return state; 9429 } 9430 const mappedBlocks = mapBlockOrder(action.blocks); 9431 const newState = new Map(state); 9432 action.replacedClientIds.forEach(clientId => { 9433 newState.delete(clientId); 9434 }); 9435 mappedBlocks.forEach((order, clientId) => { 9436 if (clientId !== '') { 9437 newState.set(clientId, order); 9438 } 9439 }); 9440 newState.forEach((order, clientId) => { 9441 const newSubOrder = Object.values(order).reduce((result, subClientId) => { 9442 if (subClientId === clientIds[0]) { 9443 return [...result, ...mappedBlocks.get('')]; 9444 } 9445 if (clientIds.indexOf(subClientId) === -1) { 9446 result.push(subClientId); 9447 } 9448 return result; 9449 }, []); 9450 newState.set(clientId, newSubOrder); 9451 }); 9452 return newState; 9453 } 9454 case 'REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN': 9455 { 9456 const newState = new Map(state); 9457 // Remove inner block ordering for removed blocks. 9458 action.removedClientIds.forEach(clientId => { 9459 newState.delete(clientId); 9460 }); 9461 newState.forEach((order, clientId) => { 9462 var _order$filter; 9463 const newSubOrder = (_order$filter = order?.filter(id => !action.removedClientIds.includes(id))) !== null && _order$filter !== void 0 ? _order$filter : []; 9464 if (newSubOrder.length !== order.length) { 9465 newState.set(clientId, newSubOrder); 9466 } 9467 }); 9468 return newState; 9469 } 9470 } 9471 return state; 9472 }, 9473 // While technically redundant data as the inverse of `order`, it serves as 9474 // an optimization for the selectors which derive the ancestry of a block. 9475 parents(state = new Map(), action) { 9476 switch (action.type) { 9477 case 'RECEIVE_BLOCKS': 9478 { 9479 const newState = new Map(state); 9480 mapBlockParents(action.blocks).forEach(([key, value]) => { 9481 newState.set(key, value); 9482 }); 9483 return newState; 9484 } 9485 case 'INSERT_BLOCKS': 9486 { 9487 const newState = new Map(state); 9488 mapBlockParents(action.blocks, action.rootClientId || '').forEach(([key, value]) => { 9489 newState.set(key, value); 9490 }); 9491 return newState; 9492 } 9493 case 'MOVE_BLOCKS_TO_POSITION': 9494 { 9495 const newState = new Map(state); 9496 action.clientIds.forEach(id => { 9497 newState.set(id, action.toRootClientId || ''); 9498 }); 9499 return newState; 9500 } 9501 case 'REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN': 9502 { 9503 const newState = new Map(state); 9504 action.replacedClientIds.forEach(clientId => { 9505 newState.delete(clientId); 9506 }); 9507 mapBlockParents(action.blocks, state.get(action.clientIds[0])).forEach(([key, value]) => { 9508 newState.set(key, value); 9509 }); 9510 return newState; 9511 } 9512 case 'REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN': 9513 { 9514 const newState = new Map(state); 9515 action.removedClientIds.forEach(clientId => { 9516 newState.delete(clientId); 9517 }); 9518 return newState; 9519 } 9520 } 9521 return state; 9522 }, 9523 controlledInnerBlocks(state = {}, { 9524 type, 9525 clientId, 9526 hasControlledInnerBlocks 9527 }) { 9528 if (type === 'SET_HAS_CONTROLLED_INNER_BLOCKS') { 9529 return { 9530 ...state, 9531 [clientId]: hasControlledInnerBlocks 9532 }; 9533 } 9534 return state; 9535 } 9536 }); 9537 9538 /** 9539 * Reducer returning visibility status of block interface. 9540 * 9541 * @param {boolean} state Current state. 9542 * @param {Object} action Dispatched action. 9543 * 9544 * @return {boolean} Updated state. 9545 */ 9546 function isBlockInterfaceHidden(state = false, action) { 9547 switch (action.type) { 9548 case 'HIDE_BLOCK_INTERFACE': 9549 return true; 9550 case 'SHOW_BLOCK_INTERFACE': 9551 return false; 9552 } 9553 return state; 9554 } 9555 9556 /** 9557 * Reducer returning typing state. 9558 * 9559 * @param {boolean} state Current state. 9560 * @param {Object} action Dispatched action. 9561 * 9562 * @return {boolean} Updated state. 9563 */ 9564 function isTyping(state = false, action) { 9565 switch (action.type) { 9566 case 'START_TYPING': 9567 return true; 9568 case 'STOP_TYPING': 9569 return false; 9570 } 9571 return state; 9572 } 9573 9574 /** 9575 * Reducer returning dragging state. It is possible for a user to be dragging 9576 * data from outside of the editor, so this state is separate from `draggedBlocks`. 9577 * 9578 * @param {boolean} state Current state. 9579 * @param {Object} action Dispatched action. 9580 * 9581 * @return {boolean} Updated state. 9582 */ 9583 function isDragging(state = false, action) { 9584 switch (action.type) { 9585 case 'START_DRAGGING': 9586 return true; 9587 case 'STOP_DRAGGING': 9588 return false; 9589 } 9590 return state; 9591 } 9592 9593 /** 9594 * Reducer returning dragged block client id. 9595 * 9596 * @param {string[]} state Current state. 9597 * @param {Object} action Dispatched action. 9598 * 9599 * @return {string[]} Updated state. 9600 */ 9601 function draggedBlocks(state = [], action) { 9602 switch (action.type) { 9603 case 'START_DRAGGING_BLOCKS': 9604 return action.clientIds; 9605 case 'STOP_DRAGGING_BLOCKS': 9606 return []; 9607 } 9608 return state; 9609 } 9610