[ Index ] |
PHP Cross Reference of WordPress Trunk (Updated Daily) |
[Summary view] [Print] [Text view]
1 /******/ (() => { // webpackBootstrap 2 /******/ var __webpack_modules__ = ({ 3 4 /***/ 1030: 5 /***/ (function(module, exports, __webpack_require__) { 6 7 var __WEBPACK_AMD_DEFINE_RESULT__;;/*! showdown v 1.9.1 - 02-11-2019 */ 8 (function(){ 9 /** 10 * Created by Tivie on 13-07-2015. 11 */ 12 13 function getDefaultOpts (simple) { 14 'use strict'; 15 16 var defaultOptions = { 17 omitExtraWLInCodeBlocks: { 18 defaultValue: false, 19 describe: 'Omit the default extra whiteline added to code blocks', 20 type: 'boolean' 21 }, 22 noHeaderId: { 23 defaultValue: false, 24 describe: 'Turn on/off generated header id', 25 type: 'boolean' 26 }, 27 prefixHeaderId: { 28 defaultValue: false, 29 describe: 'Add a prefix to the generated header ids. Passing a string will prefix that string to the header id. Setting to true will add a generic \'section-\' prefix', 30 type: 'string' 31 }, 32 rawPrefixHeaderId: { 33 defaultValue: false, 34 describe: 'Setting this option to true will prevent showdown from modifying the prefix. This might result in malformed IDs (if, for instance, the " char is used in the prefix)', 35 type: 'boolean' 36 }, 37 ghCompatibleHeaderId: { 38 defaultValue: false, 39 describe: 'Generate header ids compatible with github style (spaces are replaced with dashes, a bunch of non alphanumeric chars are removed)', 40 type: 'boolean' 41 }, 42 rawHeaderId: { 43 defaultValue: false, 44 describe: 'Remove only spaces, \' and " from generated header ids (including prefixes), replacing them with dashes (-). WARNING: This might result in malformed ids', 45 type: 'boolean' 46 }, 47 headerLevelStart: { 48 defaultValue: false, 49 describe: 'The header blocks level start', 50 type: 'integer' 51 }, 52 parseImgDimensions: { 53 defaultValue: false, 54 describe: 'Turn on/off image dimension parsing', 55 type: 'boolean' 56 }, 57 simplifiedAutoLink: { 58 defaultValue: false, 59 describe: 'Turn on/off GFM autolink style', 60 type: 'boolean' 61 }, 62 excludeTrailingPunctuationFromURLs: { 63 defaultValue: false, 64 describe: 'Excludes trailing punctuation from links generated with autoLinking', 65 type: 'boolean' 66 }, 67 literalMidWordUnderscores: { 68 defaultValue: false, 69 describe: 'Parse midword underscores as literal underscores', 70 type: 'boolean' 71 }, 72 literalMidWordAsterisks: { 73 defaultValue: false, 74 describe: 'Parse midword asterisks as literal asterisks', 75 type: 'boolean' 76 }, 77 strikethrough: { 78 defaultValue: false, 79 describe: 'Turn on/off strikethrough support', 80 type: 'boolean' 81 }, 82 tables: { 83 defaultValue: false, 84 describe: 'Turn on/off tables support', 85 type: 'boolean' 86 }, 87 tablesHeaderId: { 88 defaultValue: false, 89 describe: 'Add an id to table headers', 90 type: 'boolean' 91 }, 92 ghCodeBlocks: { 93 defaultValue: true, 94 describe: 'Turn on/off GFM fenced code blocks support', 95 type: 'boolean' 96 }, 97 tasklists: { 98 defaultValue: false, 99 describe: 'Turn on/off GFM tasklist support', 100 type: 'boolean' 101 }, 102 smoothLivePreview: { 103 defaultValue: false, 104 describe: 'Prevents weird effects in live previews due to incomplete input', 105 type: 'boolean' 106 }, 107 smartIndentationFix: { 108 defaultValue: false, 109 description: 'Tries to smartly fix indentation in es6 strings', 110 type: 'boolean' 111 }, 112 disableForced4SpacesIndentedSublists: { 113 defaultValue: false, 114 description: 'Disables the requirement of indenting nested sublists by 4 spaces', 115 type: 'boolean' 116 }, 117 simpleLineBreaks: { 118 defaultValue: false, 119 description: 'Parses simple line breaks as <br> (GFM Style)', 120 type: 'boolean' 121 }, 122 requireSpaceBeforeHeadingText: { 123 defaultValue: false, 124 description: 'Makes adding a space between `#` and the header text mandatory (GFM Style)', 125 type: 'boolean' 126 }, 127 ghMentions: { 128 defaultValue: false, 129 description: 'Enables github @mentions', 130 type: 'boolean' 131 }, 132 ghMentionsLink: { 133 defaultValue: 'https://github.com/{u}', 134 description: 'Changes the link generated by @mentions. Only applies if ghMentions option is enabled.', 135 type: 'string' 136 }, 137 encodeEmails: { 138 defaultValue: true, 139 description: 'Encode e-mail addresses through the use of Character Entities, transforming ASCII e-mail addresses into its equivalent decimal entities', 140 type: 'boolean' 141 }, 142 openLinksInNewWindow: { 143 defaultValue: false, 144 description: 'Open all links in new windows', 145 type: 'boolean' 146 }, 147 backslashEscapesHTMLTags: { 148 defaultValue: false, 149 description: 'Support for HTML Tag escaping. ex: \<div>foo\</div>', 150 type: 'boolean' 151 }, 152 emoji: { 153 defaultValue: false, 154 description: 'Enable emoji support. Ex: `this is a :smile: emoji`', 155 type: 'boolean' 156 }, 157 underline: { 158 defaultValue: false, 159 description: 'Enable support for underline. Syntax is double or triple underscores: `__underline word__`. With this option enabled, underscores no longer parses into `<em>` and `<strong>`', 160 type: 'boolean' 161 }, 162 completeHTMLDocument: { 163 defaultValue: false, 164 description: 'Outputs a complete html document, including `<html>`, `<head>` and `<body>` tags', 165 type: 'boolean' 166 }, 167 metadata: { 168 defaultValue: false, 169 description: 'Enable support for document metadata (defined at the top of the document between `«««` and `»»»` or between `---` and `---`).', 170 type: 'boolean' 171 }, 172 splitAdjacentBlockquotes: { 173 defaultValue: false, 174 description: 'Split adjacent blockquote blocks', 175 type: 'boolean' 176 } 177 }; 178 if (simple === false) { 179 return JSON.parse(JSON.stringify(defaultOptions)); 180 } 181 var ret = {}; 182 for (var opt in defaultOptions) { 183 if (defaultOptions.hasOwnProperty(opt)) { 184 ret[opt] = defaultOptions[opt].defaultValue; 185 } 186 } 187 return ret; 188 } 189 190 function allOptionsOn () { 191 'use strict'; 192 var options = getDefaultOpts(true), 193 ret = {}; 194 for (var opt in options) { 195 if (options.hasOwnProperty(opt)) { 196 ret[opt] = true; 197 } 198 } 199 return ret; 200 } 201 202 /** 203 * Created by Tivie on 06-01-2015. 204 */ 205 206 // Private properties 207 var showdown = {}, 208 parsers = {}, 209 extensions = {}, 210 globalOptions = getDefaultOpts(true), 211 setFlavor = 'vanilla', 212 flavor = { 213 github: { 214 omitExtraWLInCodeBlocks: true, 215 simplifiedAutoLink: true, 216 excludeTrailingPunctuationFromURLs: true, 217 literalMidWordUnderscores: true, 218 strikethrough: true, 219 tables: true, 220 tablesHeaderId: true, 221 ghCodeBlocks: true, 222 tasklists: true, 223 disableForced4SpacesIndentedSublists: true, 224 simpleLineBreaks: true, 225 requireSpaceBeforeHeadingText: true, 226 ghCompatibleHeaderId: true, 227 ghMentions: true, 228 backslashEscapesHTMLTags: true, 229 emoji: true, 230 splitAdjacentBlockquotes: true 231 }, 232 original: { 233 noHeaderId: true, 234 ghCodeBlocks: false 235 }, 236 ghost: { 237 omitExtraWLInCodeBlocks: true, 238 parseImgDimensions: true, 239 simplifiedAutoLink: true, 240 excludeTrailingPunctuationFromURLs: true, 241 literalMidWordUnderscores: true, 242 strikethrough: true, 243 tables: true, 244 tablesHeaderId: true, 245 ghCodeBlocks: true, 246 tasklists: true, 247 smoothLivePreview: true, 248 simpleLineBreaks: true, 249 requireSpaceBeforeHeadingText: true, 250 ghMentions: false, 251 encodeEmails: true 252 }, 253 vanilla: getDefaultOpts(true), 254 allOn: allOptionsOn() 255 }; 256 257 /** 258 * helper namespace 259 * @type {{}} 260 */ 261 showdown.helper = {}; 262 263 /** 264 * TODO LEGACY SUPPORT CODE 265 * @type {{}} 266 */ 267 showdown.extensions = {}; 268 269 /** 270 * Set a global option 271 * @static 272 * @param {string} key 273 * @param {*} value 274 * @returns {showdown} 275 */ 276 showdown.setOption = function (key, value) { 277 'use strict'; 278 globalOptions[key] = value; 279 return this; 280 }; 281 282 /** 283 * Get a global option 284 * @static 285 * @param {string} key 286 * @returns {*} 287 */ 288 showdown.getOption = function (key) { 289 'use strict'; 290 return globalOptions[key]; 291 }; 292 293 /** 294 * Get the global options 295 * @static 296 * @returns {{}} 297 */ 298 showdown.getOptions = function () { 299 'use strict'; 300 return globalOptions; 301 }; 302 303 /** 304 * Reset global options to the default values 305 * @static 306 */ 307 showdown.resetOptions = function () { 308 'use strict'; 309 globalOptions = getDefaultOpts(true); 310 }; 311 312 /** 313 * Set the flavor showdown should use as default 314 * @param {string} name 315 */ 316 showdown.setFlavor = function (name) { 317 'use strict'; 318 if (!flavor.hasOwnProperty(name)) { 319 throw Error(name + ' flavor was not found'); 320 } 321 showdown.resetOptions(); 322 var preset = flavor[name]; 323 setFlavor = name; 324 for (var option in preset) { 325 if (preset.hasOwnProperty(option)) { 326 globalOptions[option] = preset[option]; 327 } 328 } 329 }; 330 331 /** 332 * Get the currently set flavor 333 * @returns {string} 334 */ 335 showdown.getFlavor = function () { 336 'use strict'; 337 return setFlavor; 338 }; 339 340 /** 341 * Get the options of a specified flavor. Returns undefined if the flavor was not found 342 * @param {string} name Name of the flavor 343 * @returns {{}|undefined} 344 */ 345 showdown.getFlavorOptions = function (name) { 346 'use strict'; 347 if (flavor.hasOwnProperty(name)) { 348 return flavor[name]; 349 } 350 }; 351 352 /** 353 * Get the default options 354 * @static 355 * @param {boolean} [simple=true] 356 * @returns {{}} 357 */ 358 showdown.getDefaultOptions = function (simple) { 359 'use strict'; 360 return getDefaultOpts(simple); 361 }; 362 363 /** 364 * Get or set a subParser 365 * 366 * subParser(name) - Get a registered subParser 367 * subParser(name, func) - Register a subParser 368 * @static 369 * @param {string} name 370 * @param {function} [func] 371 * @returns {*} 372 */ 373 showdown.subParser = function (name, func) { 374 'use strict'; 375 if (showdown.helper.isString(name)) { 376 if (typeof func !== 'undefined') { 377 parsers[name] = func; 378 } else { 379 if (parsers.hasOwnProperty(name)) { 380 return parsers[name]; 381 } else { 382 throw Error('SubParser named ' + name + ' not registered!'); 383 } 384 } 385 } 386 }; 387 388 /** 389 * Gets or registers an extension 390 * @static 391 * @param {string} name 392 * @param {object|function=} ext 393 * @returns {*} 394 */ 395 showdown.extension = function (name, ext) { 396 'use strict'; 397 398 if (!showdown.helper.isString(name)) { 399 throw Error('Extension \'name\' must be a string'); 400 } 401 402 name = showdown.helper.stdExtName(name); 403 404 // Getter 405 if (showdown.helper.isUndefined(ext)) { 406 if (!extensions.hasOwnProperty(name)) { 407 throw Error('Extension named ' + name + ' is not registered!'); 408 } 409 return extensions[name]; 410 411 // Setter 412 } else { 413 // Expand extension if it's wrapped in a function 414 if (typeof ext === 'function') { 415 ext = ext(); 416 } 417 418 // Ensure extension is an array 419 if (!showdown.helper.isArray(ext)) { 420 ext = [ext]; 421 } 422 423 var validExtension = validate(ext, name); 424 425 if (validExtension.valid) { 426 extensions[name] = ext; 427 } else { 428 throw Error(validExtension.error); 429 } 430 } 431 }; 432 433 /** 434 * Gets all extensions registered 435 * @returns {{}} 436 */ 437 showdown.getAllExtensions = function () { 438 'use strict'; 439 return extensions; 440 }; 441 442 /** 443 * Remove an extension 444 * @param {string} name 445 */ 446 showdown.removeExtension = function (name) { 447 'use strict'; 448 delete extensions[name]; 449 }; 450 451 /** 452 * Removes all extensions 453 */ 454 showdown.resetExtensions = function () { 455 'use strict'; 456 extensions = {}; 457 }; 458 459 /** 460 * Validate extension 461 * @param {array} extension 462 * @param {string} name 463 * @returns {{valid: boolean, error: string}} 464 */ 465 function validate (extension, name) { 466 'use strict'; 467 468 var errMsg = (name) ? 'Error in ' + name + ' extension->' : 'Error in unnamed extension', 469 ret = { 470 valid: true, 471 error: '' 472 }; 473 474 if (!showdown.helper.isArray(extension)) { 475 extension = [extension]; 476 } 477 478 for (var i = 0; i < extension.length; ++i) { 479 var baseMsg = errMsg + ' sub-extension ' + i + ': ', 480 ext = extension[i]; 481 if (typeof ext !== 'object') { 482 ret.valid = false; 483 ret.error = baseMsg + 'must be an object, but ' + typeof ext + ' given'; 484 return ret; 485 } 486 487 if (!showdown.helper.isString(ext.type)) { 488 ret.valid = false; 489 ret.error = baseMsg + 'property "type" must be a string, but ' + typeof ext.type + ' given'; 490 return ret; 491 } 492 493 var type = ext.type = ext.type.toLowerCase(); 494 495 // normalize extension type 496 if (type === 'language') { 497 type = ext.type = 'lang'; 498 } 499 500 if (type === 'html') { 501 type = ext.type = 'output'; 502 } 503 504 if (type !== 'lang' && type !== 'output' && type !== 'listener') { 505 ret.valid = false; 506 ret.error = baseMsg + 'type ' + type + ' is not recognized. Valid values: "lang/language", "output/html" or "listener"'; 507 return ret; 508 } 509 510 if (type === 'listener') { 511 if (showdown.helper.isUndefined(ext.listeners)) { 512 ret.valid = false; 513 ret.error = baseMsg + '. Extensions of type "listener" must have a property called "listeners"'; 514 return ret; 515 } 516 } else { 517 if (showdown.helper.isUndefined(ext.filter) && showdown.helper.isUndefined(ext.regex)) { 518 ret.valid = false; 519 ret.error = baseMsg + type + ' extensions must define either a "regex" property or a "filter" method'; 520 return ret; 521 } 522 } 523 524 if (ext.listeners) { 525 if (typeof ext.listeners !== 'object') { 526 ret.valid = false; 527 ret.error = baseMsg + '"listeners" property must be an object but ' + typeof ext.listeners + ' given'; 528 return ret; 529 } 530 for (var ln in ext.listeners) { 531 if (ext.listeners.hasOwnProperty(ln)) { 532 if (typeof ext.listeners[ln] !== 'function') { 533 ret.valid = false; 534 ret.error = baseMsg + '"listeners" property must be an hash of [event name]: [callback]. listeners.' + ln + 535 ' must be a function but ' + typeof ext.listeners[ln] + ' given'; 536 return ret; 537 } 538 } 539 } 540 } 541 542 if (ext.filter) { 543 if (typeof ext.filter !== 'function') { 544 ret.valid = false; 545 ret.error = baseMsg + '"filter" must be a function, but ' + typeof ext.filter + ' given'; 546 return ret; 547 } 548 } else if (ext.regex) { 549 if (showdown.helper.isString(ext.regex)) { 550 ext.regex = new RegExp(ext.regex, 'g'); 551 } 552 if (!(ext.regex instanceof RegExp)) { 553 ret.valid = false; 554 ret.error = baseMsg + '"regex" property must either be a string or a RegExp object, but ' + typeof ext.regex + ' given'; 555 return ret; 556 } 557 if (showdown.helper.isUndefined(ext.replace)) { 558 ret.valid = false; 559 ret.error = baseMsg + '"regex" extensions must implement a replace string or function'; 560 return ret; 561 } 562 } 563 } 564 return ret; 565 } 566 567 /** 568 * Validate extension 569 * @param {object} ext 570 * @returns {boolean} 571 */ 572 showdown.validateExtension = function (ext) { 573 'use strict'; 574 575 var validateExtension = validate(ext, null); 576 if (!validateExtension.valid) { 577 console.warn(validateExtension.error); 578 return false; 579 } 580 return true; 581 }; 582 583 /** 584 * showdownjs helper functions 585 */ 586 587 if (!showdown.hasOwnProperty('helper')) { 588 showdown.helper = {}; 589 } 590 591 /** 592 * Check if var is string 593 * @static 594 * @param {string} a 595 * @returns {boolean} 596 */ 597 showdown.helper.isString = function (a) { 598 'use strict'; 599 return (typeof a === 'string' || a instanceof String); 600 }; 601 602 /** 603 * Check if var is a function 604 * @static 605 * @param {*} a 606 * @returns {boolean} 607 */ 608 showdown.helper.isFunction = function (a) { 609 'use strict'; 610 var getType = {}; 611 return a && getType.toString.call(a) === '[object Function]'; 612 }; 613 614 /** 615 * isArray helper function 616 * @static 617 * @param {*} a 618 * @returns {boolean} 619 */ 620 showdown.helper.isArray = function (a) { 621 'use strict'; 622 return Array.isArray(a); 623 }; 624 625 /** 626 * Check if value is undefined 627 * @static 628 * @param {*} value The value to check. 629 * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`. 630 */ 631 showdown.helper.isUndefined = function (value) { 632 'use strict'; 633 return typeof value === 'undefined'; 634 }; 635 636 /** 637 * ForEach helper function 638 * Iterates over Arrays and Objects (own properties only) 639 * @static 640 * @param {*} obj 641 * @param {function} callback Accepts 3 params: 1. value, 2. key, 3. the original array/object 642 */ 643 showdown.helper.forEach = function (obj, callback) { 644 'use strict'; 645 // check if obj is defined 646 if (showdown.helper.isUndefined(obj)) { 647 throw new Error('obj param is required'); 648 } 649 650 if (showdown.helper.isUndefined(callback)) { 651 throw new Error('callback param is required'); 652 } 653 654 if (!showdown.helper.isFunction(callback)) { 655 throw new Error('callback param must be a function/closure'); 656 } 657 658 if (typeof obj.forEach === 'function') { 659 obj.forEach(callback); 660 } else if (showdown.helper.isArray(obj)) { 661 for (var i = 0; i < obj.length; i++) { 662 callback(obj[i], i, obj); 663 } 664 } else if (typeof (obj) === 'object') { 665 for (var prop in obj) { 666 if (obj.hasOwnProperty(prop)) { 667 callback(obj[prop], prop, obj); 668 } 669 } 670 } else { 671 throw new Error('obj does not seem to be an array or an iterable object'); 672 } 673 }; 674 675 /** 676 * Standardidize extension name 677 * @static 678 * @param {string} s extension name 679 * @returns {string} 680 */ 681 showdown.helper.stdExtName = function (s) { 682 'use strict'; 683 return s.replace(/[_?*+\/\\.^-]/g, '').replace(/\s/g, '').toLowerCase(); 684 }; 685 686 function escapeCharactersCallback (wholeMatch, m1) { 687 'use strict'; 688 var charCodeToEscape = m1.charCodeAt(0); 689 return '¨E' + charCodeToEscape + 'E'; 690 } 691 692 /** 693 * Callback used to escape characters when passing through String.replace 694 * @static 695 * @param {string} wholeMatch 696 * @param {string} m1 697 * @returns {string} 698 */ 699 showdown.helper.escapeCharactersCallback = escapeCharactersCallback; 700 701 /** 702 * Escape characters in a string 703 * @static 704 * @param {string} text 705 * @param {string} charsToEscape 706 * @param {boolean} afterBackslash 707 * @returns {XML|string|void|*} 708 */ 709 showdown.helper.escapeCharacters = function (text, charsToEscape, afterBackslash) { 710 'use strict'; 711 // First we have to escape the escape characters so that 712 // we can build a character class out of them 713 var regexString = '([' + charsToEscape.replace(/([\[\]\\])/g, '\\$1') + '])'; 714 715 if (afterBackslash) { 716 regexString = '\\\\' + regexString; 717 } 718 719 var regex = new RegExp(regexString, 'g'); 720 text = text.replace(regex, escapeCharactersCallback); 721 722 return text; 723 }; 724 725 /** 726 * Unescape HTML entities 727 * @param txt 728 * @returns {string} 729 */ 730 showdown.helper.unescapeHTMLEntities = function (txt) { 731 'use strict'; 732 733 return txt 734 .replace(/"/g, '"') 735 .replace(/</g, '<') 736 .replace(/>/g, '>') 737 .replace(/&/g, '&'); 738 }; 739 740 var rgxFindMatchPos = function (str, left, right, flags) { 741 'use strict'; 742 var f = flags || '', 743 g = f.indexOf('g') > -1, 744 x = new RegExp(left + '|' + right, 'g' + f.replace(/g/g, '')), 745 l = new RegExp(left, f.replace(/g/g, '')), 746 pos = [], 747 t, s, m, start, end; 748 749 do { 750 t = 0; 751 while ((m = x.exec(str))) { 752 if (l.test(m[0])) { 753 if (!(t++)) { 754 s = x.lastIndex; 755 start = s - m[0].length; 756 } 757 } else if (t) { 758 if (!--t) { 759 end = m.index + m[0].length; 760 var obj = { 761 left: {start: start, end: s}, 762 match: {start: s, end: m.index}, 763 right: {start: m.index, end: end}, 764 wholeMatch: {start: start, end: end} 765 }; 766 pos.push(obj); 767 if (!g) { 768 return pos; 769 } 770 } 771 } 772 } 773 } while (t && (x.lastIndex = s)); 774 775 return pos; 776 }; 777 778 /** 779 * matchRecursiveRegExp 780 * 781 * (c) 2007 Steven Levithan <stevenlevithan.com> 782 * MIT License 783 * 784 * Accepts a string to search, a left and right format delimiter 785 * as regex patterns, and optional regex flags. Returns an array 786 * of matches, allowing nested instances of left/right delimiters. 787 * Use the "g" flag to return all matches, otherwise only the 788 * first is returned. Be careful to ensure that the left and 789 * right format delimiters produce mutually exclusive matches. 790 * Backreferences are not supported within the right delimiter 791 * due to how it is internally combined with the left delimiter. 792 * When matching strings whose format delimiters are unbalanced 793 * to the left or right, the output is intentionally as a 794 * conventional regex library with recursion support would 795 * produce, e.g. "<<x>" and "<x>>" both produce ["x"] when using 796 * "<" and ">" as the delimiters (both strings contain a single, 797 * balanced instance of "<x>"). 798 * 799 * examples: 800 * matchRecursiveRegExp("test", "\\(", "\\)") 801 * returns: [] 802 * matchRecursiveRegExp("<t<<e>><s>>t<>", "<", ">", "g") 803 * returns: ["t<<e>><s>", ""] 804 * matchRecursiveRegExp("<div id=\"x\">test</div>", "<div\\b[^>]*>", "</div>", "gi") 805 * returns: ["test"] 806 */ 807 showdown.helper.matchRecursiveRegExp = function (str, left, right, flags) { 808 'use strict'; 809 810 var matchPos = rgxFindMatchPos (str, left, right, flags), 811 results = []; 812 813 for (var i = 0; i < matchPos.length; ++i) { 814 results.push([ 815 str.slice(matchPos[i].wholeMatch.start, matchPos[i].wholeMatch.end), 816 str.slice(matchPos[i].match.start, matchPos[i].match.end), 817 str.slice(matchPos[i].left.start, matchPos[i].left.end), 818 str.slice(matchPos[i].right.start, matchPos[i].right.end) 819 ]); 820 } 821 return results; 822 }; 823 824 /** 825 * 826 * @param {string} str 827 * @param {string|function} replacement 828 * @param {string} left 829 * @param {string} right 830 * @param {string} flags 831 * @returns {string} 832 */ 833 showdown.helper.replaceRecursiveRegExp = function (str, replacement, left, right, flags) { 834 'use strict'; 835 836 if (!showdown.helper.isFunction(replacement)) { 837 var repStr = replacement; 838 replacement = function () { 839 return repStr; 840 }; 841 } 842 843 var matchPos = rgxFindMatchPos(str, left, right, flags), 844 finalStr = str, 845 lng = matchPos.length; 846 847 if (lng > 0) { 848 var bits = []; 849 if (matchPos[0].wholeMatch.start !== 0) { 850 bits.push(str.slice(0, matchPos[0].wholeMatch.start)); 851 } 852 for (var i = 0; i < lng; ++i) { 853 bits.push( 854 replacement( 855 str.slice(matchPos[i].wholeMatch.start, matchPos[i].wholeMatch.end), 856 str.slice(matchPos[i].match.start, matchPos[i].match.end), 857 str.slice(matchPos[i].left.start, matchPos[i].left.end), 858 str.slice(matchPos[i].right.start, matchPos[i].right.end) 859 ) 860 ); 861 if (i < lng - 1) { 862 bits.push(str.slice(matchPos[i].wholeMatch.end, matchPos[i + 1].wholeMatch.start)); 863 } 864 } 865 if (matchPos[lng - 1].wholeMatch.end < str.length) { 866 bits.push(str.slice(matchPos[lng - 1].wholeMatch.end)); 867 } 868 finalStr = bits.join(''); 869 } 870 return finalStr; 871 }; 872 873 /** 874 * Returns the index within the passed String object of the first occurrence of the specified regex, 875 * starting the search at fromIndex. Returns -1 if the value is not found. 876 * 877 * @param {string} str string to search 878 * @param {RegExp} regex Regular expression to search 879 * @param {int} [fromIndex = 0] Index to start the search 880 * @returns {Number} 881 * @throws InvalidArgumentError 882 */ 883 showdown.helper.regexIndexOf = function (str, regex, fromIndex) { 884 'use strict'; 885 if (!showdown.helper.isString(str)) { 886 throw 'InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string'; 887 } 888 if (regex instanceof RegExp === false) { 889 throw 'InvalidArgumentError: second parameter of showdown.helper.regexIndexOf function must be an instance of RegExp'; 890 } 891 var indexOf = str.substring(fromIndex || 0).search(regex); 892 return (indexOf >= 0) ? (indexOf + (fromIndex || 0)) : indexOf; 893 }; 894 895 /** 896 * Splits the passed string object at the defined index, and returns an array composed of the two substrings 897 * @param {string} str string to split 898 * @param {int} index index to split string at 899 * @returns {[string,string]} 900 * @throws InvalidArgumentError 901 */ 902 showdown.helper.splitAtIndex = function (str, index) { 903 'use strict'; 904 if (!showdown.helper.isString(str)) { 905 throw 'InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string'; 906 } 907 return [str.substring(0, index), str.substring(index)]; 908 }; 909 910 /** 911 * Obfuscate an e-mail address through the use of Character Entities, 912 * transforming ASCII characters into their equivalent decimal or hex entities. 913 * 914 * Since it has a random component, subsequent calls to this function produce different results 915 * 916 * @param {string} mail 917 * @returns {string} 918 */ 919 showdown.helper.encodeEmailAddress = function (mail) { 920 'use strict'; 921 var encode = [ 922 function (ch) { 923 return '&#' + ch.charCodeAt(0) + ';'; 924 }, 925 function (ch) { 926 return '&#x' + ch.charCodeAt(0).toString(16) + ';'; 927 }, 928 function (ch) { 929 return ch; 930 } 931 ]; 932 933 mail = mail.replace(/./g, function (ch) { 934 if (ch === '@') { 935 // this *must* be encoded. I insist. 936 ch = encode[Math.floor(Math.random() * 2)](ch); 937 } else { 938 var r = Math.random(); 939 // roughly 10% raw, 45% hex, 45% dec 940 ch = ( 941 r > 0.9 ? encode[2](ch) : r > 0.45 ? encode[1](ch) : encode[0](ch) 942 ); 943 } 944 return ch; 945 }); 946 947 return mail; 948 }; 949 950 /** 951 * 952 * @param str 953 * @param targetLength 954 * @param padString 955 * @returns {string} 956 */ 957 showdown.helper.padEnd = function padEnd (str, targetLength, padString) { 958 'use strict'; 959 /*jshint bitwise: false*/ 960 // eslint-disable-next-line space-infix-ops 961 targetLength = targetLength>>0; //floor if number or convert non-number to 0; 962 /*jshint bitwise: true*/ 963 padString = String(padString || ' '); 964 if (str.length > targetLength) { 965 return String(str); 966 } else { 967 targetLength = targetLength - str.length; 968 if (targetLength > padString.length) { 969 padString += padString.repeat(targetLength / padString.length); //append to original to ensure we are longer than needed 970 } 971 return String(str) + padString.slice(0,targetLength); 972 } 973 }; 974 975 /** 976 * POLYFILLS 977 */ 978 // use this instead of builtin is undefined for IE8 compatibility 979 if (typeof console === 'undefined') { 980 console = { 981 warn: function (msg) { 982 'use strict'; 983 alert(msg); 984 }, 985 log: function (msg) { 986 'use strict'; 987 alert(msg); 988 }, 989 error: function (msg) { 990 'use strict'; 991 throw msg; 992 } 993 }; 994 } 995 996 /** 997 * Common regexes. 998 * We declare some common regexes to improve performance 999 */ 1000 showdown.helper.regexes = { 1001 asteriskDashAndColon: /([*_:~])/g 1002 }; 1003 1004 /** 1005 * EMOJIS LIST 1006 */ 1007 showdown.helper.emojis = { 1008 '+1':'\ud83d\udc4d', 1009 '-1':'\ud83d\udc4e', 1010 '100':'\ud83d\udcaf', 1011 '1234':'\ud83d\udd22', 1012 '1st_place_medal':'\ud83e\udd47', 1013 '2nd_place_medal':'\ud83e\udd48', 1014 '3rd_place_medal':'\ud83e\udd49', 1015 '8ball':'\ud83c\udfb1', 1016 'a':'\ud83c\udd70\ufe0f', 1017 'ab':'\ud83c\udd8e', 1018 'abc':'\ud83d\udd24', 1019 'abcd':'\ud83d\udd21', 1020 'accept':'\ud83c\ude51', 1021 'aerial_tramway':'\ud83d\udea1', 1022 'airplane':'\u2708\ufe0f', 1023 'alarm_clock':'\u23f0', 1024 'alembic':'\u2697\ufe0f', 1025 'alien':'\ud83d\udc7d', 1026 'ambulance':'\ud83d\ude91', 1027 'amphora':'\ud83c\udffa', 1028 'anchor':'\u2693\ufe0f', 1029 'angel':'\ud83d\udc7c', 1030 'anger':'\ud83d\udca2', 1031 'angry':'\ud83d\ude20', 1032 'anguished':'\ud83d\ude27', 1033 'ant':'\ud83d\udc1c', 1034 'apple':'\ud83c\udf4e', 1035 'aquarius':'\u2652\ufe0f', 1036 'aries':'\u2648\ufe0f', 1037 'arrow_backward':'\u25c0\ufe0f', 1038 'arrow_double_down':'\u23ec', 1039 'arrow_double_up':'\u23eb', 1040 'arrow_down':'\u2b07\ufe0f', 1041 'arrow_down_small':'\ud83d\udd3d', 1042 'arrow_forward':'\u25b6\ufe0f', 1043 'arrow_heading_down':'\u2935\ufe0f', 1044 'arrow_heading_up':'\u2934\ufe0f', 1045 'arrow_left':'\u2b05\ufe0f', 1046 'arrow_lower_left':'\u2199\ufe0f', 1047 'arrow_lower_right':'\u2198\ufe0f', 1048 'arrow_right':'\u27a1\ufe0f', 1049 'arrow_right_hook':'\u21aa\ufe0f', 1050 'arrow_up':'\u2b06\ufe0f', 1051 'arrow_up_down':'\u2195\ufe0f', 1052 'arrow_up_small':'\ud83d\udd3c', 1053 'arrow_upper_left':'\u2196\ufe0f', 1054 'arrow_upper_right':'\u2197\ufe0f', 1055 'arrows_clockwise':'\ud83d\udd03', 1056 'arrows_counterclockwise':'\ud83d\udd04', 1057 'art':'\ud83c\udfa8', 1058 'articulated_lorry':'\ud83d\ude9b', 1059 'artificial_satellite':'\ud83d\udef0', 1060 'astonished':'\ud83d\ude32', 1061 'athletic_shoe':'\ud83d\udc5f', 1062 'atm':'\ud83c\udfe7', 1063 'atom_symbol':'\u269b\ufe0f', 1064 'avocado':'\ud83e\udd51', 1065 'b':'\ud83c\udd71\ufe0f', 1066 'baby':'\ud83d\udc76', 1067 'baby_bottle':'\ud83c\udf7c', 1068 'baby_chick':'\ud83d\udc24', 1069 'baby_symbol':'\ud83d\udebc', 1070 'back':'\ud83d\udd19', 1071 'bacon':'\ud83e\udd53', 1072 'badminton':'\ud83c\udff8', 1073 'baggage_claim':'\ud83d\udec4', 1074 'baguette_bread':'\ud83e\udd56', 1075 'balance_scale':'\u2696\ufe0f', 1076 'balloon':'\ud83c\udf88', 1077 'ballot_box':'\ud83d\uddf3', 1078 'ballot_box_with_check':'\u2611\ufe0f', 1079 'bamboo':'\ud83c\udf8d', 1080 'banana':'\ud83c\udf4c', 1081 'bangbang':'\u203c\ufe0f', 1082 'bank':'\ud83c\udfe6', 1083 'bar_chart':'\ud83d\udcca', 1084 'barber':'\ud83d\udc88', 1085 'baseball':'\u26be\ufe0f', 1086 'basketball':'\ud83c\udfc0', 1087 'basketball_man':'\u26f9\ufe0f', 1088 'basketball_woman':'\u26f9\ufe0f‍\u2640\ufe0f', 1089 'bat':'\ud83e\udd87', 1090 'bath':'\ud83d\udec0', 1091 'bathtub':'\ud83d\udec1', 1092 'battery':'\ud83d\udd0b', 1093 'beach_umbrella':'\ud83c\udfd6', 1094 'bear':'\ud83d\udc3b', 1095 'bed':'\ud83d\udecf', 1096 'bee':'\ud83d\udc1d', 1097 'beer':'\ud83c\udf7a', 1098 'beers':'\ud83c\udf7b', 1099 'beetle':'\ud83d\udc1e', 1100 'beginner':'\ud83d\udd30', 1101 'bell':'\ud83d\udd14', 1102 'bellhop_bell':'\ud83d\udece', 1103 'bento':'\ud83c\udf71', 1104 'biking_man':'\ud83d\udeb4', 1105 'bike':'\ud83d\udeb2', 1106 'biking_woman':'\ud83d\udeb4‍\u2640\ufe0f', 1107 'bikini':'\ud83d\udc59', 1108 'biohazard':'\u2623\ufe0f', 1109 'bird':'\ud83d\udc26', 1110 'birthday':'\ud83c\udf82', 1111 'black_circle':'\u26ab\ufe0f', 1112 'black_flag':'\ud83c\udff4', 1113 'black_heart':'\ud83d\udda4', 1114 'black_joker':'\ud83c\udccf', 1115 'black_large_square':'\u2b1b\ufe0f', 1116 'black_medium_small_square':'\u25fe\ufe0f', 1117 'black_medium_square':'\u25fc\ufe0f', 1118 'black_nib':'\u2712\ufe0f', 1119 'black_small_square':'\u25aa\ufe0f', 1120 'black_square_button':'\ud83d\udd32', 1121 'blonde_man':'\ud83d\udc71', 1122 'blonde_woman':'\ud83d\udc71‍\u2640\ufe0f', 1123 'blossom':'\ud83c\udf3c', 1124 'blowfish':'\ud83d\udc21', 1125 'blue_book':'\ud83d\udcd8', 1126 'blue_car':'\ud83d\ude99', 1127 'blue_heart':'\ud83d\udc99', 1128 'blush':'\ud83d\ude0a', 1129 'boar':'\ud83d\udc17', 1130 'boat':'\u26f5\ufe0f', 1131 'bomb':'\ud83d\udca3', 1132 'book':'\ud83d\udcd6', 1133 'bookmark':'\ud83d\udd16', 1134 'bookmark_tabs':'\ud83d\udcd1', 1135 'books':'\ud83d\udcda', 1136 'boom':'\ud83d\udca5', 1137 'boot':'\ud83d\udc62', 1138 'bouquet':'\ud83d\udc90', 1139 'bowing_man':'\ud83d\ude47', 1140 'bow_and_arrow':'\ud83c\udff9', 1141 'bowing_woman':'\ud83d\ude47‍\u2640\ufe0f', 1142 'bowling':'\ud83c\udfb3', 1143 'boxing_glove':'\ud83e\udd4a', 1144 'boy':'\ud83d\udc66', 1145 'bread':'\ud83c\udf5e', 1146 'bride_with_veil':'\ud83d\udc70', 1147 'bridge_at_night':'\ud83c\udf09', 1148 'briefcase':'\ud83d\udcbc', 1149 'broken_heart':'\ud83d\udc94', 1150 'bug':'\ud83d\udc1b', 1151 'building_construction':'\ud83c\udfd7', 1152 'bulb':'\ud83d\udca1', 1153 'bullettrain_front':'\ud83d\ude85', 1154 'bullettrain_side':'\ud83d\ude84', 1155 'burrito':'\ud83c\udf2f', 1156 'bus':'\ud83d\ude8c', 1157 'business_suit_levitating':'\ud83d\udd74', 1158 'busstop':'\ud83d\ude8f', 1159 'bust_in_silhouette':'\ud83d\udc64', 1160 'busts_in_silhouette':'\ud83d\udc65', 1161 'butterfly':'\ud83e\udd8b', 1162 'cactus':'\ud83c\udf35', 1163 'cake':'\ud83c\udf70', 1164 'calendar':'\ud83d\udcc6', 1165 'call_me_hand':'\ud83e\udd19', 1166 'calling':'\ud83d\udcf2', 1167 'camel':'\ud83d\udc2b', 1168 'camera':'\ud83d\udcf7', 1169 'camera_flash':'\ud83d\udcf8', 1170 'camping':'\ud83c\udfd5', 1171 'cancer':'\u264b\ufe0f', 1172 'candle':'\ud83d\udd6f', 1173 'candy':'\ud83c\udf6c', 1174 'canoe':'\ud83d\udef6', 1175 'capital_abcd':'\ud83d\udd20', 1176 'capricorn':'\u2651\ufe0f', 1177 'car':'\ud83d\ude97', 1178 'card_file_box':'\ud83d\uddc3', 1179 'card_index':'\ud83d\udcc7', 1180 'card_index_dividers':'\ud83d\uddc2', 1181 'carousel_horse':'\ud83c\udfa0', 1182 'carrot':'\ud83e\udd55', 1183 'cat':'\ud83d\udc31', 1184 'cat2':'\ud83d\udc08', 1185 'cd':'\ud83d\udcbf', 1186 'chains':'\u26d3', 1187 'champagne':'\ud83c\udf7e', 1188 'chart':'\ud83d\udcb9', 1189 'chart_with_downwards_trend':'\ud83d\udcc9', 1190 'chart_with_upwards_trend':'\ud83d\udcc8', 1191 'checkered_flag':'\ud83c\udfc1', 1192 'cheese':'\ud83e\uddc0', 1193 'cherries':'\ud83c\udf52', 1194 'cherry_blossom':'\ud83c\udf38', 1195 'chestnut':'\ud83c\udf30', 1196 'chicken':'\ud83d\udc14', 1197 'children_crossing':'\ud83d\udeb8', 1198 'chipmunk':'\ud83d\udc3f', 1199 'chocolate_bar':'\ud83c\udf6b', 1200 'christmas_tree':'\ud83c\udf84', 1201 'church':'\u26ea\ufe0f', 1202 'cinema':'\ud83c\udfa6', 1203 'circus_tent':'\ud83c\udfaa', 1204 'city_sunrise':'\ud83c\udf07', 1205 'city_sunset':'\ud83c\udf06', 1206 'cityscape':'\ud83c\udfd9', 1207 'cl':'\ud83c\udd91', 1208 'clamp':'\ud83d\udddc', 1209 'clap':'\ud83d\udc4f', 1210 'clapper':'\ud83c\udfac', 1211 'classical_building':'\ud83c\udfdb', 1212 'clinking_glasses':'\ud83e\udd42', 1213 'clipboard':'\ud83d\udccb', 1214 'clock1':'\ud83d\udd50', 1215 'clock10':'\ud83d\udd59', 1216 'clock1030':'\ud83d\udd65', 1217 'clock11':'\ud83d\udd5a', 1218 'clock1130':'\ud83d\udd66', 1219 'clock12':'\ud83d\udd5b', 1220 'clock1230':'\ud83d\udd67', 1221 'clock130':'\ud83d\udd5c', 1222 'clock2':'\ud83d\udd51', 1223 'clock230':'\ud83d\udd5d', 1224 'clock3':'\ud83d\udd52', 1225 'clock330':'\ud83d\udd5e', 1226 'clock4':'\ud83d\udd53', 1227 'clock430':'\ud83d\udd5f', 1228 'clock5':'\ud83d\udd54', 1229 'clock530':'\ud83d\udd60', 1230 'clock6':'\ud83d\udd55', 1231 'clock630':'\ud83d\udd61', 1232 'clock7':'\ud83d\udd56', 1233 'clock730':'\ud83d\udd62', 1234 'clock8':'\ud83d\udd57', 1235 'clock830':'\ud83d\udd63', 1236 'clock9':'\ud83d\udd58', 1237 'clock930':'\ud83d\udd64', 1238 'closed_book':'\ud83d\udcd5', 1239 'closed_lock_with_key':'\ud83d\udd10', 1240 'closed_umbrella':'\ud83c\udf02', 1241 'cloud':'\u2601\ufe0f', 1242 'cloud_with_lightning':'\ud83c\udf29', 1243 'cloud_with_lightning_and_rain':'\u26c8', 1244 'cloud_with_rain':'\ud83c\udf27', 1245 'cloud_with_snow':'\ud83c\udf28', 1246 'clown_face':'\ud83e\udd21', 1247 'clubs':'\u2663\ufe0f', 1248 'cocktail':'\ud83c\udf78', 1249 'coffee':'\u2615\ufe0f', 1250 'coffin':'\u26b0\ufe0f', 1251 'cold_sweat':'\ud83d\ude30', 1252 'comet':'\u2604\ufe0f', 1253 'computer':'\ud83d\udcbb', 1254 'computer_mouse':'\ud83d\uddb1', 1255 'confetti_ball':'\ud83c\udf8a', 1256 'confounded':'\ud83d\ude16', 1257 'confused':'\ud83d\ude15', 1258 'congratulations':'\u3297\ufe0f', 1259 'construction':'\ud83d\udea7', 1260 'construction_worker_man':'\ud83d\udc77', 1261 'construction_worker_woman':'\ud83d\udc77‍\u2640\ufe0f', 1262 'control_knobs':'\ud83c\udf9b', 1263 'convenience_store':'\ud83c\udfea', 1264 'cookie':'\ud83c\udf6a', 1265 'cool':'\ud83c\udd92', 1266 'policeman':'\ud83d\udc6e', 1267 'copyright':'\u00a9\ufe0f', 1268 'corn':'\ud83c\udf3d', 1269 'couch_and_lamp':'\ud83d\udecb', 1270 'couple':'\ud83d\udc6b', 1271 'couple_with_heart_woman_man':'\ud83d\udc91', 1272 'couple_with_heart_man_man':'\ud83d\udc68‍\u2764\ufe0f‍\ud83d\udc68', 1273 'couple_with_heart_woman_woman':'\ud83d\udc69‍\u2764\ufe0f‍\ud83d\udc69', 1274 'couplekiss_man_man':'\ud83d\udc68‍\u2764\ufe0f‍\ud83d\udc8b‍\ud83d\udc68', 1275 'couplekiss_man_woman':'\ud83d\udc8f', 1276 'couplekiss_woman_woman':'\ud83d\udc69‍\u2764\ufe0f‍\ud83d\udc8b‍\ud83d\udc69', 1277 'cow':'\ud83d\udc2e', 1278 'cow2':'\ud83d\udc04', 1279 'cowboy_hat_face':'\ud83e\udd20', 1280 'crab':'\ud83e\udd80', 1281 'crayon':'\ud83d\udd8d', 1282 'credit_card':'\ud83d\udcb3', 1283 'crescent_moon':'\ud83c\udf19', 1284 'cricket':'\ud83c\udfcf', 1285 'crocodile':'\ud83d\udc0a', 1286 'croissant':'\ud83e\udd50', 1287 'crossed_fingers':'\ud83e\udd1e', 1288 'crossed_flags':'\ud83c\udf8c', 1289 'crossed_swords':'\u2694\ufe0f', 1290 'crown':'\ud83d\udc51', 1291 'cry':'\ud83d\ude22', 1292 'crying_cat_face':'\ud83d\ude3f', 1293 'crystal_ball':'\ud83d\udd2e', 1294 'cucumber':'\ud83e\udd52', 1295 'cupid':'\ud83d\udc98', 1296 'curly_loop':'\u27b0', 1297 'currency_exchange':'\ud83d\udcb1', 1298 'curry':'\ud83c\udf5b', 1299 'custard':'\ud83c\udf6e', 1300 'customs':'\ud83d\udec3', 1301 'cyclone':'\ud83c\udf00', 1302 'dagger':'\ud83d\udde1', 1303 'dancer':'\ud83d\udc83', 1304 'dancing_women':'\ud83d\udc6f', 1305 'dancing_men':'\ud83d\udc6f‍\u2642\ufe0f', 1306 'dango':'\ud83c\udf61', 1307 'dark_sunglasses':'\ud83d\udd76', 1308 'dart':'\ud83c\udfaf', 1309 'dash':'\ud83d\udca8', 1310 'date':'\ud83d\udcc5', 1311 'deciduous_tree':'\ud83c\udf33', 1312 'deer':'\ud83e\udd8c', 1313 'department_store':'\ud83c\udfec', 1314 'derelict_house':'\ud83c\udfda', 1315 'desert':'\ud83c\udfdc', 1316 'desert_island':'\ud83c\udfdd', 1317 'desktop_computer':'\ud83d\udda5', 1318 'male_detective':'\ud83d\udd75\ufe0f', 1319 'diamond_shape_with_a_dot_inside':'\ud83d\udca0', 1320 'diamonds':'\u2666\ufe0f', 1321 'disappointed':'\ud83d\ude1e', 1322 'disappointed_relieved':'\ud83d\ude25', 1323 'dizzy':'\ud83d\udcab', 1324 'dizzy_face':'\ud83d\ude35', 1325 'do_not_litter':'\ud83d\udeaf', 1326 'dog':'\ud83d\udc36', 1327 'dog2':'\ud83d\udc15', 1328 'dollar':'\ud83d\udcb5', 1329 'dolls':'\ud83c\udf8e', 1330 'dolphin':'\ud83d\udc2c', 1331 'door':'\ud83d\udeaa', 1332 'doughnut':'\ud83c\udf69', 1333 'dove':'\ud83d\udd4a', 1334 'dragon':'\ud83d\udc09', 1335 'dragon_face':'\ud83d\udc32', 1336 'dress':'\ud83d\udc57', 1337 'dromedary_camel':'\ud83d\udc2a', 1338 'drooling_face':'\ud83e\udd24', 1339 'droplet':'\ud83d\udca7', 1340 'drum':'\ud83e\udd41', 1341 'duck':'\ud83e\udd86', 1342 'dvd':'\ud83d\udcc0', 1343 'e-mail':'\ud83d\udce7', 1344 'eagle':'\ud83e\udd85', 1345 'ear':'\ud83d\udc42', 1346 'ear_of_rice':'\ud83c\udf3e', 1347 'earth_africa':'\ud83c\udf0d', 1348 'earth_americas':'\ud83c\udf0e', 1349 'earth_asia':'\ud83c\udf0f', 1350 'egg':'\ud83e\udd5a', 1351 'eggplant':'\ud83c\udf46', 1352 'eight_pointed_black_star':'\u2734\ufe0f', 1353 'eight_spoked_asterisk':'\u2733\ufe0f', 1354 'electric_plug':'\ud83d\udd0c', 1355 'elephant':'\ud83d\udc18', 1356 'email':'\u2709\ufe0f', 1357 'end':'\ud83d\udd1a', 1358 'envelope_with_arrow':'\ud83d\udce9', 1359 'euro':'\ud83d\udcb6', 1360 'european_castle':'\ud83c\udff0', 1361 'european_post_office':'\ud83c\udfe4', 1362 'evergreen_tree':'\ud83c\udf32', 1363 'exclamation':'\u2757\ufe0f', 1364 'expressionless':'\ud83d\ude11', 1365 'eye':'\ud83d\udc41', 1366 'eye_speech_bubble':'\ud83d\udc41‍\ud83d\udde8', 1367 'eyeglasses':'\ud83d\udc53', 1368 'eyes':'\ud83d\udc40', 1369 'face_with_head_bandage':'\ud83e\udd15', 1370 'face_with_thermometer':'\ud83e\udd12', 1371 'fist_oncoming':'\ud83d\udc4a', 1372 'factory':'\ud83c\udfed', 1373 'fallen_leaf':'\ud83c\udf42', 1374 'family_man_woman_boy':'\ud83d\udc6a', 1375 'family_man_boy':'\ud83d\udc68‍\ud83d\udc66', 1376 'family_man_boy_boy':'\ud83d\udc68‍\ud83d\udc66‍\ud83d\udc66', 1377 'family_man_girl':'\ud83d\udc68‍\ud83d\udc67', 1378 'family_man_girl_boy':'\ud83d\udc68‍\ud83d\udc67‍\ud83d\udc66', 1379 'family_man_girl_girl':'\ud83d\udc68‍\ud83d\udc67‍\ud83d\udc67', 1380 'family_man_man_boy':'\ud83d\udc68‍\ud83d\udc68‍\ud83d\udc66', 1381 'family_man_man_boy_boy':'\ud83d\udc68‍\ud83d\udc68‍\ud83d\udc66‍\ud83d\udc66', 1382 'family_man_man_girl':'\ud83d\udc68‍\ud83d\udc68‍\ud83d\udc67', 1383 'family_man_man_girl_boy':'\ud83d\udc68‍\ud83d\udc68‍\ud83d\udc67‍\ud83d\udc66', 1384 'family_man_man_girl_girl':'\ud83d\udc68‍\ud83d\udc68‍\ud83d\udc67‍\ud83d\udc67', 1385 'family_man_woman_boy_boy':'\ud83d\udc68‍\ud83d\udc69‍\ud83d\udc66‍\ud83d\udc66', 1386 'family_man_woman_girl':'\ud83d\udc68‍\ud83d\udc69‍\ud83d\udc67', 1387 'family_man_woman_girl_boy':'\ud83d\udc68‍\ud83d\udc69‍\ud83d\udc67‍\ud83d\udc66', 1388 'family_man_woman_girl_girl':'\ud83d\udc68‍\ud83d\udc69‍\ud83d\udc67‍\ud83d\udc67', 1389 'family_woman_boy':'\ud83d\udc69‍\ud83d\udc66', 1390 'family_woman_boy_boy':'\ud83d\udc69‍\ud83d\udc66‍\ud83d\udc66', 1391 'family_woman_girl':'\ud83d\udc69‍\ud83d\udc67', 1392 'family_woman_girl_boy':'\ud83d\udc69‍\ud83d\udc67‍\ud83d\udc66', 1393 'family_woman_girl_girl':'\ud83d\udc69‍\ud83d\udc67‍\ud83d\udc67', 1394 'family_woman_woman_boy':'\ud83d\udc69‍\ud83d\udc69‍\ud83d\udc66', 1395 'family_woman_woman_boy_boy':'\ud83d\udc69‍\ud83d\udc69‍\ud83d\udc66‍\ud83d\udc66', 1396 'family_woman_woman_girl':'\ud83d\udc69‍\ud83d\udc69‍\ud83d\udc67', 1397 'family_woman_woman_girl_boy':'\ud83d\udc69‍\ud83d\udc69‍\ud83d\udc67‍\ud83d\udc66', 1398 'family_woman_woman_girl_girl':'\ud83d\udc69‍\ud83d\udc69‍\ud83d\udc67‍\ud83d\udc67', 1399 'fast_forward':'\u23e9', 1400 'fax':'\ud83d\udce0', 1401 'fearful':'\ud83d\ude28', 1402 'feet':'\ud83d\udc3e', 1403 'female_detective':'\ud83d\udd75\ufe0f‍\u2640\ufe0f', 1404 'ferris_wheel':'\ud83c\udfa1', 1405 'ferry':'\u26f4', 1406 'field_hockey':'\ud83c\udfd1', 1407 'file_cabinet':'\ud83d\uddc4', 1408 'file_folder':'\ud83d\udcc1', 1409 'film_projector':'\ud83d\udcfd', 1410 'film_strip':'\ud83c\udf9e', 1411 'fire':'\ud83d\udd25', 1412 'fire_engine':'\ud83d\ude92', 1413 'fireworks':'\ud83c\udf86', 1414 'first_quarter_moon':'\ud83c\udf13', 1415 'first_quarter_moon_with_face':'\ud83c\udf1b', 1416 'fish':'\ud83d\udc1f', 1417 'fish_cake':'\ud83c\udf65', 1418 'fishing_pole_and_fish':'\ud83c\udfa3', 1419 'fist_raised':'\u270a', 1420 'fist_left':'\ud83e\udd1b', 1421 'fist_right':'\ud83e\udd1c', 1422 'flags':'\ud83c\udf8f', 1423 'flashlight':'\ud83d\udd26', 1424 'fleur_de_lis':'\u269c\ufe0f', 1425 'flight_arrival':'\ud83d\udeec', 1426 'flight_departure':'\ud83d\udeeb', 1427 'floppy_disk':'\ud83d\udcbe', 1428 'flower_playing_cards':'\ud83c\udfb4', 1429 'flushed':'\ud83d\ude33', 1430 'fog':'\ud83c\udf2b', 1431 'foggy':'\ud83c\udf01', 1432 'football':'\ud83c\udfc8', 1433 'footprints':'\ud83d\udc63', 1434 'fork_and_knife':'\ud83c\udf74', 1435 'fountain':'\u26f2\ufe0f', 1436 'fountain_pen':'\ud83d\udd8b', 1437 'four_leaf_clover':'\ud83c\udf40', 1438 'fox_face':'\ud83e\udd8a', 1439 'framed_picture':'\ud83d\uddbc', 1440 'free':'\ud83c\udd93', 1441 'fried_egg':'\ud83c\udf73', 1442 'fried_shrimp':'\ud83c\udf64', 1443 'fries':'\ud83c\udf5f', 1444 'frog':'\ud83d\udc38', 1445 'frowning':'\ud83d\ude26', 1446 'frowning_face':'\u2639\ufe0f', 1447 'frowning_man':'\ud83d\ude4d‍\u2642\ufe0f', 1448 'frowning_woman':'\ud83d\ude4d', 1449 'middle_finger':'\ud83d\udd95', 1450 'fuelpump':'\u26fd\ufe0f', 1451 'full_moon':'\ud83c\udf15', 1452 'full_moon_with_face':'\ud83c\udf1d', 1453 'funeral_urn':'\u26b1\ufe0f', 1454 'game_die':'\ud83c\udfb2', 1455 'gear':'\u2699\ufe0f', 1456 'gem':'\ud83d\udc8e', 1457 'gemini':'\u264a\ufe0f', 1458 'ghost':'\ud83d\udc7b', 1459 'gift':'\ud83c\udf81', 1460 'gift_heart':'\ud83d\udc9d', 1461 'girl':'\ud83d\udc67', 1462 'globe_with_meridians':'\ud83c\udf10', 1463 'goal_net':'\ud83e\udd45', 1464 'goat':'\ud83d\udc10', 1465 'golf':'\u26f3\ufe0f', 1466 'golfing_man':'\ud83c\udfcc\ufe0f', 1467 'golfing_woman':'\ud83c\udfcc\ufe0f‍\u2640\ufe0f', 1468 'gorilla':'\ud83e\udd8d', 1469 'grapes':'\ud83c\udf47', 1470 'green_apple':'\ud83c\udf4f', 1471 'green_book':'\ud83d\udcd7', 1472 'green_heart':'\ud83d\udc9a', 1473 'green_salad':'\ud83e\udd57', 1474 'grey_exclamation':'\u2755', 1475 'grey_question':'\u2754', 1476 'grimacing':'\ud83d\ude2c', 1477 'grin':'\ud83d\ude01', 1478 'grinning':'\ud83d\ude00', 1479 'guardsman':'\ud83d\udc82', 1480 'guardswoman':'\ud83d\udc82‍\u2640\ufe0f', 1481 'guitar':'\ud83c\udfb8', 1482 'gun':'\ud83d\udd2b', 1483 'haircut_woman':'\ud83d\udc87', 1484 'haircut_man':'\ud83d\udc87‍\u2642\ufe0f', 1485 'hamburger':'\ud83c\udf54', 1486 'hammer':'\ud83d\udd28', 1487 'hammer_and_pick':'\u2692', 1488 'hammer_and_wrench':'\ud83d\udee0', 1489 'hamster':'\ud83d\udc39', 1490 'hand':'\u270b', 1491 'handbag':'\ud83d\udc5c', 1492 'handshake':'\ud83e\udd1d', 1493 'hankey':'\ud83d\udca9', 1494 'hatched_chick':'\ud83d\udc25', 1495 'hatching_chick':'\ud83d\udc23', 1496 'headphones':'\ud83c\udfa7', 1497 'hear_no_evil':'\ud83d\ude49', 1498 'heart':'\u2764\ufe0f', 1499 'heart_decoration':'\ud83d\udc9f', 1500 'heart_eyes':'\ud83d\ude0d', 1501 'heart_eyes_cat':'\ud83d\ude3b', 1502 'heartbeat':'\ud83d\udc93', 1503 'heartpulse':'\ud83d\udc97', 1504 'hearts':'\u2665\ufe0f', 1505 'heavy_check_mark':'\u2714\ufe0f', 1506 'heavy_division_sign':'\u2797', 1507 'heavy_dollar_sign':'\ud83d\udcb2', 1508 'heavy_heart_exclamation':'\u2763\ufe0f', 1509 'heavy_minus_sign':'\u2796', 1510 'heavy_multiplication_x':'\u2716\ufe0f', 1511 'heavy_plus_sign':'\u2795', 1512 'helicopter':'\ud83d\ude81', 1513 'herb':'\ud83c\udf3f', 1514 'hibiscus':'\ud83c\udf3a', 1515 'high_brightness':'\ud83d\udd06', 1516 'high_heel':'\ud83d\udc60', 1517 'hocho':'\ud83d\udd2a', 1518 'hole':'\ud83d\udd73', 1519 'honey_pot':'\ud83c\udf6f', 1520 'horse':'\ud83d\udc34', 1521 'horse_racing':'\ud83c\udfc7', 1522 'hospital':'\ud83c\udfe5', 1523 'hot_pepper':'\ud83c\udf36', 1524 'hotdog':'\ud83c\udf2d', 1525 'hotel':'\ud83c\udfe8', 1526 'hotsprings':'\u2668\ufe0f', 1527 'hourglass':'\u231b\ufe0f', 1528 'hourglass_flowing_sand':'\u23f3', 1529 'house':'\ud83c\udfe0', 1530 'house_with_garden':'\ud83c\udfe1', 1531 'houses':'\ud83c\udfd8', 1532 'hugs':'\ud83e\udd17', 1533 'hushed':'\ud83d\ude2f', 1534 'ice_cream':'\ud83c\udf68', 1535 'ice_hockey':'\ud83c\udfd2', 1536 'ice_skate':'\u26f8', 1537 'icecream':'\ud83c\udf66', 1538 'id':'\ud83c\udd94', 1539 'ideograph_advantage':'\ud83c\ude50', 1540 'imp':'\ud83d\udc7f', 1541 'inbox_tray':'\ud83d\udce5', 1542 'incoming_envelope':'\ud83d\udce8', 1543 'tipping_hand_woman':'\ud83d\udc81', 1544 'information_source':'\u2139\ufe0f', 1545 'innocent':'\ud83d\ude07', 1546 'interrobang':'\u2049\ufe0f', 1547 'iphone':'\ud83d\udcf1', 1548 'izakaya_lantern':'\ud83c\udfee', 1549 'jack_o_lantern':'\ud83c\udf83', 1550 'japan':'\ud83d\uddfe', 1551 'japanese_castle':'\ud83c\udfef', 1552 'japanese_goblin':'\ud83d\udc7a', 1553 'japanese_ogre':'\ud83d\udc79', 1554 'jeans':'\ud83d\udc56', 1555 'joy':'\ud83d\ude02', 1556 'joy_cat':'\ud83d\ude39', 1557 'joystick':'\ud83d\udd79', 1558 'kaaba':'\ud83d\udd4b', 1559 'key':'\ud83d\udd11', 1560 'keyboard':'\u2328\ufe0f', 1561 'keycap_ten':'\ud83d\udd1f', 1562 'kick_scooter':'\ud83d\udef4', 1563 'kimono':'\ud83d\udc58', 1564 'kiss':'\ud83d\udc8b', 1565 'kissing':'\ud83d\ude17', 1566 'kissing_cat':'\ud83d\ude3d', 1567 'kissing_closed_eyes':'\ud83d\ude1a', 1568 'kissing_heart':'\ud83d\ude18', 1569 'kissing_smiling_eyes':'\ud83d\ude19', 1570 'kiwi_fruit':'\ud83e\udd5d', 1571 'koala':'\ud83d\udc28', 1572 'koko':'\ud83c\ude01', 1573 'label':'\ud83c\udff7', 1574 'large_blue_circle':'\ud83d\udd35', 1575 'large_blue_diamond':'\ud83d\udd37', 1576 'large_orange_diamond':'\ud83d\udd36', 1577 'last_quarter_moon':'\ud83c\udf17', 1578 'last_quarter_moon_with_face':'\ud83c\udf1c', 1579 'latin_cross':'\u271d\ufe0f', 1580 'laughing':'\ud83d\ude06', 1581 'leaves':'\ud83c\udf43', 1582 'ledger':'\ud83d\udcd2', 1583 'left_luggage':'\ud83d\udec5', 1584 'left_right_arrow':'\u2194\ufe0f', 1585 'leftwards_arrow_with_hook':'\u21a9\ufe0f', 1586 'lemon':'\ud83c\udf4b', 1587 'leo':'\u264c\ufe0f', 1588 'leopard':'\ud83d\udc06', 1589 'level_slider':'\ud83c\udf9a', 1590 'libra':'\u264e\ufe0f', 1591 'light_rail':'\ud83d\ude88', 1592 'link':'\ud83d\udd17', 1593 'lion':'\ud83e\udd81', 1594 'lips':'\ud83d\udc44', 1595 'lipstick':'\ud83d\udc84', 1596 'lizard':'\ud83e\udd8e', 1597 'lock':'\ud83d\udd12', 1598 'lock_with_ink_pen':'\ud83d\udd0f', 1599 'lollipop':'\ud83c\udf6d', 1600 'loop':'\u27bf', 1601 'loud_sound':'\ud83d\udd0a', 1602 'loudspeaker':'\ud83d\udce2', 1603 'love_hotel':'\ud83c\udfe9', 1604 'love_letter':'\ud83d\udc8c', 1605 'low_brightness':'\ud83d\udd05', 1606 'lying_face':'\ud83e\udd25', 1607 'm':'\u24c2\ufe0f', 1608 'mag':'\ud83d\udd0d', 1609 'mag_right':'\ud83d\udd0e', 1610 'mahjong':'\ud83c\udc04\ufe0f', 1611 'mailbox':'\ud83d\udceb', 1612 'mailbox_closed':'\ud83d\udcea', 1613 'mailbox_with_mail':'\ud83d\udcec', 1614 'mailbox_with_no_mail':'\ud83d\udced', 1615 'man':'\ud83d\udc68', 1616 'man_artist':'\ud83d\udc68‍\ud83c\udfa8', 1617 'man_astronaut':'\ud83d\udc68‍\ud83d\ude80', 1618 'man_cartwheeling':'\ud83e\udd38‍\u2642\ufe0f', 1619 'man_cook':'\ud83d\udc68‍\ud83c\udf73', 1620 'man_dancing':'\ud83d\udd7a', 1621 'man_facepalming':'\ud83e\udd26‍\u2642\ufe0f', 1622 'man_factory_worker':'\ud83d\udc68‍\ud83c\udfed', 1623 'man_farmer':'\ud83d\udc68‍\ud83c\udf3e', 1624 'man_firefighter':'\ud83d\udc68‍\ud83d\ude92', 1625 'man_health_worker':'\ud83d\udc68‍\u2695\ufe0f', 1626 'man_in_tuxedo':'\ud83e\udd35', 1627 'man_judge':'\ud83d\udc68‍\u2696\ufe0f', 1628 'man_juggling':'\ud83e\udd39‍\u2642\ufe0f', 1629 'man_mechanic':'\ud83d\udc68‍\ud83d\udd27', 1630 'man_office_worker':'\ud83d\udc68‍\ud83d\udcbc', 1631 'man_pilot':'\ud83d\udc68‍\u2708\ufe0f', 1632 'man_playing_handball':'\ud83e\udd3e‍\u2642\ufe0f', 1633 'man_playing_water_polo':'\ud83e\udd3d‍\u2642\ufe0f', 1634 'man_scientist':'\ud83d\udc68‍\ud83d\udd2c', 1635 'man_shrugging':'\ud83e\udd37‍\u2642\ufe0f', 1636 'man_singer':'\ud83d\udc68‍\ud83c\udfa4', 1637 'man_student':'\ud83d\udc68‍\ud83c\udf93', 1638 'man_teacher':'\ud83d\udc68‍\ud83c\udfeb', 1639 'man_technologist':'\ud83d\udc68‍\ud83d\udcbb', 1640 'man_with_gua_pi_mao':'\ud83d\udc72', 1641 'man_with_turban':'\ud83d\udc73', 1642 'tangerine':'\ud83c\udf4a', 1643 'mans_shoe':'\ud83d\udc5e', 1644 'mantelpiece_clock':'\ud83d\udd70', 1645 'maple_leaf':'\ud83c\udf41', 1646 'martial_arts_uniform':'\ud83e\udd4b', 1647 'mask':'\ud83d\ude37', 1648 'massage_woman':'\ud83d\udc86', 1649 'massage_man':'\ud83d\udc86‍\u2642\ufe0f', 1650 'meat_on_bone':'\ud83c\udf56', 1651 'medal_military':'\ud83c\udf96', 1652 'medal_sports':'\ud83c\udfc5', 1653 'mega':'\ud83d\udce3', 1654 'melon':'\ud83c\udf48', 1655 'memo':'\ud83d\udcdd', 1656 'men_wrestling':'\ud83e\udd3c‍\u2642\ufe0f', 1657 'menorah':'\ud83d\udd4e', 1658 'mens':'\ud83d\udeb9', 1659 'metal':'\ud83e\udd18', 1660 'metro':'\ud83d\ude87', 1661 'microphone':'\ud83c\udfa4', 1662 'microscope':'\ud83d\udd2c', 1663 'milk_glass':'\ud83e\udd5b', 1664 'milky_way':'\ud83c\udf0c', 1665 'minibus':'\ud83d\ude90', 1666 'minidisc':'\ud83d\udcbd', 1667 'mobile_phone_off':'\ud83d\udcf4', 1668 'money_mouth_face':'\ud83e\udd11', 1669 'money_with_wings':'\ud83d\udcb8', 1670 'moneybag':'\ud83d\udcb0', 1671 'monkey':'\ud83d\udc12', 1672 'monkey_face':'\ud83d\udc35', 1673 'monorail':'\ud83d\ude9d', 1674 'moon':'\ud83c\udf14', 1675 'mortar_board':'\ud83c\udf93', 1676 'mosque':'\ud83d\udd4c', 1677 'motor_boat':'\ud83d\udee5', 1678 'motor_scooter':'\ud83d\udef5', 1679 'motorcycle':'\ud83c\udfcd', 1680 'motorway':'\ud83d\udee3', 1681 'mount_fuji':'\ud83d\uddfb', 1682 'mountain':'\u26f0', 1683 'mountain_biking_man':'\ud83d\udeb5', 1684 'mountain_biking_woman':'\ud83d\udeb5‍\u2640\ufe0f', 1685 'mountain_cableway':'\ud83d\udea0', 1686 'mountain_railway':'\ud83d\ude9e', 1687 'mountain_snow':'\ud83c\udfd4', 1688 'mouse':'\ud83d\udc2d', 1689 'mouse2':'\ud83d\udc01', 1690 'movie_camera':'\ud83c\udfa5', 1691 'moyai':'\ud83d\uddff', 1692 'mrs_claus':'\ud83e\udd36', 1693 'muscle':'\ud83d\udcaa', 1694 'mushroom':'\ud83c\udf44', 1695 'musical_keyboard':'\ud83c\udfb9', 1696 'musical_note':'\ud83c\udfb5', 1697 'musical_score':'\ud83c\udfbc', 1698 'mute':'\ud83d\udd07', 1699 'nail_care':'\ud83d\udc85', 1700 'name_badge':'\ud83d\udcdb', 1701 'national_park':'\ud83c\udfde', 1702 'nauseated_face':'\ud83e\udd22', 1703 'necktie':'\ud83d\udc54', 1704 'negative_squared_cross_mark':'\u274e', 1705 'nerd_face':'\ud83e\udd13', 1706 'neutral_face':'\ud83d\ude10', 1707 'new':'\ud83c\udd95', 1708 'new_moon':'\ud83c\udf11', 1709 'new_moon_with_face':'\ud83c\udf1a', 1710 'newspaper':'\ud83d\udcf0', 1711 'newspaper_roll':'\ud83d\uddde', 1712 'next_track_button':'\u23ed', 1713 'ng':'\ud83c\udd96', 1714 'no_good_man':'\ud83d\ude45‍\u2642\ufe0f', 1715 'no_good_woman':'\ud83d\ude45', 1716 'night_with_stars':'\ud83c\udf03', 1717 'no_bell':'\ud83d\udd15', 1718 'no_bicycles':'\ud83d\udeb3', 1719 'no_entry':'\u26d4\ufe0f', 1720 'no_entry_sign':'\ud83d\udeab', 1721 'no_mobile_phones':'\ud83d\udcf5', 1722 'no_mouth':'\ud83d\ude36', 1723 'no_pedestrians':'\ud83d\udeb7', 1724 'no_smoking':'\ud83d\udead', 1725 'non-potable_water':'\ud83d\udeb1', 1726 'nose':'\ud83d\udc43', 1727 'notebook':'\ud83d\udcd3', 1728 'notebook_with_decorative_cover':'\ud83d\udcd4', 1729 'notes':'\ud83c\udfb6', 1730 'nut_and_bolt':'\ud83d\udd29', 1731 'o':'\u2b55\ufe0f', 1732 'o2':'\ud83c\udd7e\ufe0f', 1733 'ocean':'\ud83c\udf0a', 1734 'octopus':'\ud83d\udc19', 1735 'oden':'\ud83c\udf62', 1736 'office':'\ud83c\udfe2', 1737 'oil_drum':'\ud83d\udee2', 1738 'ok':'\ud83c\udd97', 1739 'ok_hand':'\ud83d\udc4c', 1740 'ok_man':'\ud83d\ude46‍\u2642\ufe0f', 1741 'ok_woman':'\ud83d\ude46', 1742 'old_key':'\ud83d\udddd', 1743 'older_man':'\ud83d\udc74', 1744 'older_woman':'\ud83d\udc75', 1745 'om':'\ud83d\udd49', 1746 'on':'\ud83d\udd1b', 1747 'oncoming_automobile':'\ud83d\ude98', 1748 'oncoming_bus':'\ud83d\ude8d', 1749 'oncoming_police_car':'\ud83d\ude94', 1750 'oncoming_taxi':'\ud83d\ude96', 1751 'open_file_folder':'\ud83d\udcc2', 1752 'open_hands':'\ud83d\udc50', 1753 'open_mouth':'\ud83d\ude2e', 1754 'open_umbrella':'\u2602\ufe0f', 1755 'ophiuchus':'\u26ce', 1756 'orange_book':'\ud83d\udcd9', 1757 'orthodox_cross':'\u2626\ufe0f', 1758 'outbox_tray':'\ud83d\udce4', 1759 'owl':'\ud83e\udd89', 1760 'ox':'\ud83d\udc02', 1761 'package':'\ud83d\udce6', 1762 'page_facing_up':'\ud83d\udcc4', 1763 'page_with_curl':'\ud83d\udcc3', 1764 'pager':'\ud83d\udcdf', 1765 'paintbrush':'\ud83d\udd8c', 1766 'palm_tree':'\ud83c\udf34', 1767 'pancakes':'\ud83e\udd5e', 1768 'panda_face':'\ud83d\udc3c', 1769 'paperclip':'\ud83d\udcce', 1770 'paperclips':'\ud83d\udd87', 1771 'parasol_on_ground':'\u26f1', 1772 'parking':'\ud83c\udd7f\ufe0f', 1773 'part_alternation_mark':'\u303d\ufe0f', 1774 'partly_sunny':'\u26c5\ufe0f', 1775 'passenger_ship':'\ud83d\udef3', 1776 'passport_control':'\ud83d\udec2', 1777 'pause_button':'\u23f8', 1778 'peace_symbol':'\u262e\ufe0f', 1779 'peach':'\ud83c\udf51', 1780 'peanuts':'\ud83e\udd5c', 1781 'pear':'\ud83c\udf50', 1782 'pen':'\ud83d\udd8a', 1783 'pencil2':'\u270f\ufe0f', 1784 'penguin':'\ud83d\udc27', 1785 'pensive':'\ud83d\ude14', 1786 'performing_arts':'\ud83c\udfad', 1787 'persevere':'\ud83d\ude23', 1788 'person_fencing':'\ud83e\udd3a', 1789 'pouting_woman':'\ud83d\ude4e', 1790 'phone':'\u260e\ufe0f', 1791 'pick':'\u26cf', 1792 'pig':'\ud83d\udc37', 1793 'pig2':'\ud83d\udc16', 1794 'pig_nose':'\ud83d\udc3d', 1795 'pill':'\ud83d\udc8a', 1796 'pineapple':'\ud83c\udf4d', 1797 'ping_pong':'\ud83c\udfd3', 1798 'pisces':'\u2653\ufe0f', 1799 'pizza':'\ud83c\udf55', 1800 'place_of_worship':'\ud83d\uded0', 1801 'plate_with_cutlery':'\ud83c\udf7d', 1802 'play_or_pause_button':'\u23ef', 1803 'point_down':'\ud83d\udc47', 1804 'point_left':'\ud83d\udc48', 1805 'point_right':'\ud83d\udc49', 1806 'point_up':'\u261d\ufe0f', 1807 'point_up_2':'\ud83d\udc46', 1808 'police_car':'\ud83d\ude93', 1809 'policewoman':'\ud83d\udc6e‍\u2640\ufe0f', 1810 'poodle':'\ud83d\udc29', 1811 'popcorn':'\ud83c\udf7f', 1812 'post_office':'\ud83c\udfe3', 1813 'postal_horn':'\ud83d\udcef', 1814 'postbox':'\ud83d\udcee', 1815 'potable_water':'\ud83d\udeb0', 1816 'potato':'\ud83e\udd54', 1817 'pouch':'\ud83d\udc5d', 1818 'poultry_leg':'\ud83c\udf57', 1819 'pound':'\ud83d\udcb7', 1820 'rage':'\ud83d\ude21', 1821 'pouting_cat':'\ud83d\ude3e', 1822 'pouting_man':'\ud83d\ude4e‍\u2642\ufe0f', 1823 'pray':'\ud83d\ude4f', 1824 'prayer_beads':'\ud83d\udcff', 1825 'pregnant_woman':'\ud83e\udd30', 1826 'previous_track_button':'\u23ee', 1827 'prince':'\ud83e\udd34', 1828 'princess':'\ud83d\udc78', 1829 'printer':'\ud83d\udda8', 1830 'purple_heart':'\ud83d\udc9c', 1831 'purse':'\ud83d\udc5b', 1832 'pushpin':'\ud83d\udccc', 1833 'put_litter_in_its_place':'\ud83d\udeae', 1834 'question':'\u2753', 1835 'rabbit':'\ud83d\udc30', 1836 'rabbit2':'\ud83d\udc07', 1837 'racehorse':'\ud83d\udc0e', 1838 'racing_car':'\ud83c\udfce', 1839 'radio':'\ud83d\udcfb', 1840 'radio_button':'\ud83d\udd18', 1841 'radioactive':'\u2622\ufe0f', 1842 'railway_car':'\ud83d\ude83', 1843 'railway_track':'\ud83d\udee4', 1844 'rainbow':'\ud83c\udf08', 1845 'rainbow_flag':'\ud83c\udff3\ufe0f‍\ud83c\udf08', 1846 'raised_back_of_hand':'\ud83e\udd1a', 1847 'raised_hand_with_fingers_splayed':'\ud83d\udd90', 1848 'raised_hands':'\ud83d\ude4c', 1849 'raising_hand_woman':'\ud83d\ude4b', 1850 'raising_hand_man':'\ud83d\ude4b‍\u2642\ufe0f', 1851 'ram':'\ud83d\udc0f', 1852 'ramen':'\ud83c\udf5c', 1853 'rat':'\ud83d\udc00', 1854 'record_button':'\u23fa', 1855 'recycle':'\u267b\ufe0f', 1856 'red_circle':'\ud83d\udd34', 1857 'registered':'\u00ae\ufe0f', 1858 'relaxed':'\u263a\ufe0f', 1859 'relieved':'\ud83d\ude0c', 1860 'reminder_ribbon':'\ud83c\udf97', 1861 'repeat':'\ud83d\udd01', 1862 'repeat_one':'\ud83d\udd02', 1863 'rescue_worker_helmet':'\u26d1', 1864 'restroom':'\ud83d\udebb', 1865 'revolving_hearts':'\ud83d\udc9e', 1866 'rewind':'\u23ea', 1867 'rhinoceros':'\ud83e\udd8f', 1868 'ribbon':'\ud83c\udf80', 1869 'rice':'\ud83c\udf5a', 1870 'rice_ball':'\ud83c\udf59', 1871 'rice_cracker':'\ud83c\udf58', 1872 'rice_scene':'\ud83c\udf91', 1873 'right_anger_bubble':'\ud83d\uddef', 1874 'ring':'\ud83d\udc8d', 1875 'robot':'\ud83e\udd16', 1876 'rocket':'\ud83d\ude80', 1877 'rofl':'\ud83e\udd23', 1878 'roll_eyes':'\ud83d\ude44', 1879 'roller_coaster':'\ud83c\udfa2', 1880 'rooster':'\ud83d\udc13', 1881 'rose':'\ud83c\udf39', 1882 'rosette':'\ud83c\udff5', 1883 'rotating_light':'\ud83d\udea8', 1884 'round_pushpin':'\ud83d\udccd', 1885 'rowing_man':'\ud83d\udea3', 1886 'rowing_woman':'\ud83d\udea3‍\u2640\ufe0f', 1887 'rugby_football':'\ud83c\udfc9', 1888 'running_man':'\ud83c\udfc3', 1889 'running_shirt_with_sash':'\ud83c\udfbd', 1890 'running_woman':'\ud83c\udfc3‍\u2640\ufe0f', 1891 'sa':'\ud83c\ude02\ufe0f', 1892 'sagittarius':'\u2650\ufe0f', 1893 'sake':'\ud83c\udf76', 1894 'sandal':'\ud83d\udc61', 1895 'santa':'\ud83c\udf85', 1896 'satellite':'\ud83d\udce1', 1897 'saxophone':'\ud83c\udfb7', 1898 'school':'\ud83c\udfeb', 1899 'school_satchel':'\ud83c\udf92', 1900 'scissors':'\u2702\ufe0f', 1901 'scorpion':'\ud83e\udd82', 1902 'scorpius':'\u264f\ufe0f', 1903 'scream':'\ud83d\ude31', 1904 'scream_cat':'\ud83d\ude40', 1905 'scroll':'\ud83d\udcdc', 1906 'seat':'\ud83d\udcba', 1907 'secret':'\u3299\ufe0f', 1908 'see_no_evil':'\ud83d\ude48', 1909 'seedling':'\ud83c\udf31', 1910 'selfie':'\ud83e\udd33', 1911 'shallow_pan_of_food':'\ud83e\udd58', 1912 'shamrock':'\u2618\ufe0f', 1913 'shark':'\ud83e\udd88', 1914 'shaved_ice':'\ud83c\udf67', 1915 'sheep':'\ud83d\udc11', 1916 'shell':'\ud83d\udc1a', 1917 'shield':'\ud83d\udee1', 1918 'shinto_shrine':'\u26e9', 1919 'ship':'\ud83d\udea2', 1920 'shirt':'\ud83d\udc55', 1921 'shopping':'\ud83d\udecd', 1922 'shopping_cart':'\ud83d\uded2', 1923 'shower':'\ud83d\udebf', 1924 'shrimp':'\ud83e\udd90', 1925 'signal_strength':'\ud83d\udcf6', 1926 'six_pointed_star':'\ud83d\udd2f', 1927 'ski':'\ud83c\udfbf', 1928 'skier':'\u26f7', 1929 'skull':'\ud83d\udc80', 1930 'skull_and_crossbones':'\u2620\ufe0f', 1931 'sleeping':'\ud83d\ude34', 1932 'sleeping_bed':'\ud83d\udecc', 1933 'sleepy':'\ud83d\ude2a', 1934 'slightly_frowning_face':'\ud83d\ude41', 1935 'slightly_smiling_face':'\ud83d\ude42', 1936 'slot_machine':'\ud83c\udfb0', 1937 'small_airplane':'\ud83d\udee9', 1938 'small_blue_diamond':'\ud83d\udd39', 1939 'small_orange_diamond':'\ud83d\udd38', 1940 'small_red_triangle':'\ud83d\udd3a', 1941 'small_red_triangle_down':'\ud83d\udd3b', 1942 'smile':'\ud83d\ude04', 1943 'smile_cat':'\ud83d\ude38', 1944 'smiley':'\ud83d\ude03', 1945 'smiley_cat':'\ud83d\ude3a', 1946 'smiling_imp':'\ud83d\ude08', 1947 'smirk':'\ud83d\ude0f', 1948 'smirk_cat':'\ud83d\ude3c', 1949 'smoking':'\ud83d\udeac', 1950 'snail':'\ud83d\udc0c', 1951 'snake':'\ud83d\udc0d', 1952 'sneezing_face':'\ud83e\udd27', 1953 'snowboarder':'\ud83c\udfc2', 1954 'snowflake':'\u2744\ufe0f', 1955 'snowman':'\u26c4\ufe0f', 1956 'snowman_with_snow':'\u2603\ufe0f', 1957 'sob':'\ud83d\ude2d', 1958 'soccer':'\u26bd\ufe0f', 1959 'soon':'\ud83d\udd1c', 1960 'sos':'\ud83c\udd98', 1961 'sound':'\ud83d\udd09', 1962 'space_invader':'\ud83d\udc7e', 1963 'spades':'\u2660\ufe0f', 1964 'spaghetti':'\ud83c\udf5d', 1965 'sparkle':'\u2747\ufe0f', 1966 'sparkler':'\ud83c\udf87', 1967 'sparkles':'\u2728', 1968 'sparkling_heart':'\ud83d\udc96', 1969 'speak_no_evil':'\ud83d\ude4a', 1970 'speaker':'\ud83d\udd08', 1971 'speaking_head':'\ud83d\udde3', 1972 'speech_balloon':'\ud83d\udcac', 1973 'speedboat':'\ud83d\udea4', 1974 'spider':'\ud83d\udd77', 1975 'spider_web':'\ud83d\udd78', 1976 'spiral_calendar':'\ud83d\uddd3', 1977 'spiral_notepad':'\ud83d\uddd2', 1978 'spoon':'\ud83e\udd44', 1979 'squid':'\ud83e\udd91', 1980 'stadium':'\ud83c\udfdf', 1981 'star':'\u2b50\ufe0f', 1982 'star2':'\ud83c\udf1f', 1983 'star_and_crescent':'\u262a\ufe0f', 1984 'star_of_david':'\u2721\ufe0f', 1985 'stars':'\ud83c\udf20', 1986 'station':'\ud83d\ude89', 1987 'statue_of_liberty':'\ud83d\uddfd', 1988 'steam_locomotive':'\ud83d\ude82', 1989 'stew':'\ud83c\udf72', 1990 'stop_button':'\u23f9', 1991 'stop_sign':'\ud83d\uded1', 1992 'stopwatch':'\u23f1', 1993 'straight_ruler':'\ud83d\udccf', 1994 'strawberry':'\ud83c\udf53', 1995 'stuck_out_tongue':'\ud83d\ude1b', 1996 'stuck_out_tongue_closed_eyes':'\ud83d\ude1d', 1997 'stuck_out_tongue_winking_eye':'\ud83d\ude1c', 1998 'studio_microphone':'\ud83c\udf99', 1999 'stuffed_flatbread':'\ud83e\udd59', 2000 'sun_behind_large_cloud':'\ud83c\udf25', 2001 'sun_behind_rain_cloud':'\ud83c\udf26', 2002 'sun_behind_small_cloud':'\ud83c\udf24', 2003 'sun_with_face':'\ud83c\udf1e', 2004 'sunflower':'\ud83c\udf3b', 2005 'sunglasses':'\ud83d\ude0e', 2006 'sunny':'\u2600\ufe0f', 2007 'sunrise':'\ud83c\udf05', 2008 'sunrise_over_mountains':'\ud83c\udf04', 2009 'surfing_man':'\ud83c\udfc4', 2010 'surfing_woman':'\ud83c\udfc4‍\u2640\ufe0f', 2011 'sushi':'\ud83c\udf63', 2012 'suspension_railway':'\ud83d\ude9f', 2013 'sweat':'\ud83d\ude13', 2014 'sweat_drops':'\ud83d\udca6', 2015 'sweat_smile':'\ud83d\ude05', 2016 'sweet_potato':'\ud83c\udf60', 2017 'swimming_man':'\ud83c\udfca', 2018 'swimming_woman':'\ud83c\udfca‍\u2640\ufe0f', 2019 'symbols':'\ud83d\udd23', 2020 'synagogue':'\ud83d\udd4d', 2021 'syringe':'\ud83d\udc89', 2022 'taco':'\ud83c\udf2e', 2023 'tada':'\ud83c\udf89', 2024 'tanabata_tree':'\ud83c\udf8b', 2025 'taurus':'\u2649\ufe0f', 2026 'taxi':'\ud83d\ude95', 2027 'tea':'\ud83c\udf75', 2028 'telephone_receiver':'\ud83d\udcde', 2029 'telescope':'\ud83d\udd2d', 2030 'tennis':'\ud83c\udfbe', 2031 'tent':'\u26fa\ufe0f', 2032 'thermometer':'\ud83c\udf21', 2033 'thinking':'\ud83e\udd14', 2034 'thought_balloon':'\ud83d\udcad', 2035 'ticket':'\ud83c\udfab', 2036 'tickets':'\ud83c\udf9f', 2037 'tiger':'\ud83d\udc2f', 2038 'tiger2':'\ud83d\udc05', 2039 'timer_clock':'\u23f2', 2040 'tipping_hand_man':'\ud83d\udc81‍\u2642\ufe0f', 2041 'tired_face':'\ud83d\ude2b', 2042 'tm':'\u2122\ufe0f', 2043 'toilet':'\ud83d\udebd', 2044 'tokyo_tower':'\ud83d\uddfc', 2045 'tomato':'\ud83c\udf45', 2046 'tongue':'\ud83d\udc45', 2047 'top':'\ud83d\udd1d', 2048 'tophat':'\ud83c\udfa9', 2049 'tornado':'\ud83c\udf2a', 2050 'trackball':'\ud83d\uddb2', 2051 'tractor':'\ud83d\ude9c', 2052 'traffic_light':'\ud83d\udea5', 2053 'train':'\ud83d\ude8b', 2054 'train2':'\ud83d\ude86', 2055 'tram':'\ud83d\ude8a', 2056 'triangular_flag_on_post':'\ud83d\udea9', 2057 'triangular_ruler':'\ud83d\udcd0', 2058 'trident':'\ud83d\udd31', 2059 'triumph':'\ud83d\ude24', 2060 'trolleybus':'\ud83d\ude8e', 2061 'trophy':'\ud83c\udfc6', 2062 'tropical_drink':'\ud83c\udf79', 2063 'tropical_fish':'\ud83d\udc20', 2064 'truck':'\ud83d\ude9a', 2065 'trumpet':'\ud83c\udfba', 2066 'tulip':'\ud83c\udf37', 2067 'tumbler_glass':'\ud83e\udd43', 2068 'turkey':'\ud83e\udd83', 2069 'turtle':'\ud83d\udc22', 2070 'tv':'\ud83d\udcfa', 2071 'twisted_rightwards_arrows':'\ud83d\udd00', 2072 'two_hearts':'\ud83d\udc95', 2073 'two_men_holding_hands':'\ud83d\udc6c', 2074 'two_women_holding_hands':'\ud83d\udc6d', 2075 'u5272':'\ud83c\ude39', 2076 'u5408':'\ud83c\ude34', 2077 'u55b6':'\ud83c\ude3a', 2078 'u6307':'\ud83c\ude2f\ufe0f', 2079 'u6708':'\ud83c\ude37\ufe0f', 2080 'u6709':'\ud83c\ude36', 2081 'u6e80':'\ud83c\ude35', 2082 'u7121':'\ud83c\ude1a\ufe0f', 2083 'u7533':'\ud83c\ude38', 2084 'u7981':'\ud83c\ude32', 2085 'u7a7a':'\ud83c\ude33', 2086 'umbrella':'\u2614\ufe0f', 2087 'unamused':'\ud83d\ude12', 2088 'underage':'\ud83d\udd1e', 2089 'unicorn':'\ud83e\udd84', 2090 'unlock':'\ud83d\udd13', 2091 'up':'\ud83c\udd99', 2092 'upside_down_face':'\ud83d\ude43', 2093 'v':'\u270c\ufe0f', 2094 'vertical_traffic_light':'\ud83d\udea6', 2095 'vhs':'\ud83d\udcfc', 2096 'vibration_mode':'\ud83d\udcf3', 2097 'video_camera':'\ud83d\udcf9', 2098 'video_game':'\ud83c\udfae', 2099 'violin':'\ud83c\udfbb', 2100 'virgo':'\u264d\ufe0f', 2101 'volcano':'\ud83c\udf0b', 2102 'volleyball':'\ud83c\udfd0', 2103 'vs':'\ud83c\udd9a', 2104 'vulcan_salute':'\ud83d\udd96', 2105 'walking_man':'\ud83d\udeb6', 2106 'walking_woman':'\ud83d\udeb6‍\u2640\ufe0f', 2107 'waning_crescent_moon':'\ud83c\udf18', 2108 'waning_gibbous_moon':'\ud83c\udf16', 2109 'warning':'\u26a0\ufe0f', 2110 'wastebasket':'\ud83d\uddd1', 2111 'watch':'\u231a\ufe0f', 2112 'water_buffalo':'\ud83d\udc03', 2113 'watermelon':'\ud83c\udf49', 2114 'wave':'\ud83d\udc4b', 2115 'wavy_dash':'\u3030\ufe0f', 2116 'waxing_crescent_moon':'\ud83c\udf12', 2117 'wc':'\ud83d\udebe', 2118 'weary':'\ud83d\ude29', 2119 'wedding':'\ud83d\udc92', 2120 'weight_lifting_man':'\ud83c\udfcb\ufe0f', 2121 'weight_lifting_woman':'\ud83c\udfcb\ufe0f‍\u2640\ufe0f', 2122 'whale':'\ud83d\udc33', 2123 'whale2':'\ud83d\udc0b', 2124 'wheel_of_dharma':'\u2638\ufe0f', 2125 'wheelchair':'\u267f\ufe0f', 2126 'white_check_mark':'\u2705', 2127 'white_circle':'\u26aa\ufe0f', 2128 'white_flag':'\ud83c\udff3\ufe0f', 2129 'white_flower':'\ud83d\udcae', 2130 'white_large_square':'\u2b1c\ufe0f', 2131 'white_medium_small_square':'\u25fd\ufe0f', 2132 'white_medium_square':'\u25fb\ufe0f', 2133 'white_small_square':'\u25ab\ufe0f', 2134 'white_square_button':'\ud83d\udd33', 2135 'wilted_flower':'\ud83e\udd40', 2136 'wind_chime':'\ud83c\udf90', 2137 'wind_face':'\ud83c\udf2c', 2138 'wine_glass':'\ud83c\udf77', 2139 'wink':'\ud83d\ude09', 2140 'wolf':'\ud83d\udc3a', 2141 'woman':'\ud83d\udc69', 2142 'woman_artist':'\ud83d\udc69‍\ud83c\udfa8', 2143 'woman_astronaut':'\ud83d\udc69‍\ud83d\ude80', 2144 'woman_cartwheeling':'\ud83e\udd38‍\u2640\ufe0f', 2145 'woman_cook':'\ud83d\udc69‍\ud83c\udf73', 2146 'woman_facepalming':'\ud83e\udd26‍\u2640\ufe0f', 2147 'woman_factory_worker':'\ud83d\udc69‍\ud83c\udfed', 2148 'woman_farmer':'\ud83d\udc69‍\ud83c\udf3e', 2149 'woman_firefighter':'\ud83d\udc69‍\ud83d\ude92', 2150 'woman_health_worker':'\ud83d\udc69‍\u2695\ufe0f', 2151 'woman_judge':'\ud83d\udc69‍\u2696\ufe0f', 2152 'woman_juggling':'\ud83e\udd39‍\u2640\ufe0f', 2153 'woman_mechanic':'\ud83d\udc69‍\ud83d\udd27', 2154 'woman_office_worker':'\ud83d\udc69‍\ud83d\udcbc', 2155 'woman_pilot':'\ud83d\udc69‍\u2708\ufe0f', 2156 'woman_playing_handball':'\ud83e\udd3e‍\u2640\ufe0f', 2157 'woman_playing_water_polo':'\ud83e\udd3d‍\u2640\ufe0f', 2158 'woman_scientist':'\ud83d\udc69‍\ud83d\udd2c', 2159 'woman_shrugging':'\ud83e\udd37‍\u2640\ufe0f', 2160 'woman_singer':'\ud83d\udc69‍\ud83c\udfa4', 2161 'woman_student':'\ud83d\udc69‍\ud83c\udf93', 2162 'woman_teacher':'\ud83d\udc69‍\ud83c\udfeb', 2163 'woman_technologist':'\ud83d\udc69‍\ud83d\udcbb', 2164 'woman_with_turban':'\ud83d\udc73‍\u2640\ufe0f', 2165 'womans_clothes':'\ud83d\udc5a', 2166 'womans_hat':'\ud83d\udc52', 2167 'women_wrestling':'\ud83e\udd3c‍\u2640\ufe0f', 2168 'womens':'\ud83d\udeba', 2169 'world_map':'\ud83d\uddfa', 2170 'worried':'\ud83d\ude1f', 2171 'wrench':'\ud83d\udd27', 2172 'writing_hand':'\u270d\ufe0f', 2173 'x':'\u274c', 2174 'yellow_heart':'\ud83d\udc9b', 2175 'yen':'\ud83d\udcb4', 2176 'yin_yang':'\u262f\ufe0f', 2177 'yum':'\ud83d\ude0b', 2178 'zap':'\u26a1\ufe0f', 2179 'zipper_mouth_face':'\ud83e\udd10', 2180 'zzz':'\ud83d\udca4', 2181 2182 /* special emojis :P */ 2183 'octocat': '<img alt=":octocat:" height="20" width="20" align="absmiddle" src="https://assets-cdn.github.com/images/icons/emoji/octocat.png">', 2184 'showdown': '<span style="font-family: \'Anonymous Pro\', monospace; text-decoration: underline; text-decoration-style: dashed; text-decoration-color: #3e8b8a;text-underline-position: under;">S</span>' 2185 }; 2186 2187 /** 2188 * Created by Estevao on 31-05-2015. 2189 */ 2190 2191 /** 2192 * Showdown Converter class 2193 * @class 2194 * @param {object} [converterOptions] 2195 * @returns {Converter} 2196 */ 2197 showdown.Converter = function (converterOptions) { 2198 'use strict'; 2199 2200 var 2201 /** 2202 * Options used by this converter 2203 * @private 2204 * @type {{}} 2205 */ 2206 options = {}, 2207 2208 /** 2209 * Language extensions used by this converter 2210 * @private 2211 * @type {Array} 2212 */ 2213 langExtensions = [], 2214 2215 /** 2216 * Output modifiers extensions used by this converter 2217 * @private 2218 * @type {Array} 2219 */ 2220 outputModifiers = [], 2221 2222 /** 2223 * Event listeners 2224 * @private 2225 * @type {{}} 2226 */ 2227 listeners = {}, 2228 2229 /** 2230 * The flavor set in this converter 2231 */ 2232 setConvFlavor = setFlavor, 2233 2234 /** 2235 * Metadata of the document 2236 * @type {{parsed: {}, raw: string, format: string}} 2237 */ 2238 metadata = { 2239 parsed: {}, 2240 raw: '', 2241 format: '' 2242 }; 2243 2244 _constructor(); 2245 2246 /** 2247 * Converter constructor 2248 * @private 2249 */ 2250 function _constructor () { 2251 converterOptions = converterOptions || {}; 2252 2253 for (var gOpt in globalOptions) { 2254 if (globalOptions.hasOwnProperty(gOpt)) { 2255 options[gOpt] = globalOptions[gOpt]; 2256 } 2257 } 2258 2259 // Merge options 2260 if (typeof converterOptions === 'object') { 2261 for (var opt in converterOptions) { 2262 if (converterOptions.hasOwnProperty(opt)) { 2263 options[opt] = converterOptions[opt]; 2264 } 2265 } 2266 } else { 2267 throw Error('Converter expects the passed parameter to be an object, but ' + typeof converterOptions + 2268 ' was passed instead.'); 2269 } 2270 2271 if (options.extensions) { 2272 showdown.helper.forEach(options.extensions, _parseExtension); 2273 } 2274 } 2275 2276 /** 2277 * Parse extension 2278 * @param {*} ext 2279 * @param {string} [name=''] 2280 * @private 2281 */ 2282 function _parseExtension (ext, name) { 2283 2284 name = name || null; 2285 // If it's a string, the extension was previously loaded 2286 if (showdown.helper.isString(ext)) { 2287 ext = showdown.helper.stdExtName(ext); 2288 name = ext; 2289 2290 // LEGACY_SUPPORT CODE 2291 if (showdown.extensions[ext]) { 2292 console.warn('DEPRECATION WARNING: ' + ext + ' is an old extension that uses a deprecated loading method.' + 2293 'Please inform the developer that the extension should be updated!'); 2294 legacyExtensionLoading(showdown.extensions[ext], ext); 2295 return; 2296 // END LEGACY SUPPORT CODE 2297 2298 } else if (!showdown.helper.isUndefined(extensions[ext])) { 2299 ext = extensions[ext]; 2300 2301 } else { 2302 throw Error('Extension "' + ext + '" could not be loaded. It was either not found or is not a valid extension.'); 2303 } 2304 } 2305 2306 if (typeof ext === 'function') { 2307 ext = ext(); 2308 } 2309 2310 if (!showdown.helper.isArray(ext)) { 2311 ext = [ext]; 2312 } 2313 2314 var validExt = validate(ext, name); 2315 if (!validExt.valid) { 2316 throw Error(validExt.error); 2317 } 2318 2319 for (var i = 0; i < ext.length; ++i) { 2320 switch (ext[i].type) { 2321 2322 case 'lang': 2323 langExtensions.push(ext[i]); 2324 break; 2325 2326 case 'output': 2327 outputModifiers.push(ext[i]); 2328 break; 2329 } 2330 if (ext[i].hasOwnProperty('listeners')) { 2331 for (var ln in ext[i].listeners) { 2332 if (ext[i].listeners.hasOwnProperty(ln)) { 2333 listen(ln, ext[i].listeners[ln]); 2334 } 2335 } 2336 } 2337 } 2338 2339 } 2340 2341 /** 2342 * LEGACY_SUPPORT 2343 * @param {*} ext 2344 * @param {string} name 2345 */ 2346 function legacyExtensionLoading (ext, name) { 2347 if (typeof ext === 'function') { 2348 ext = ext(new showdown.Converter()); 2349 } 2350 if (!showdown.helper.isArray(ext)) { 2351 ext = [ext]; 2352 } 2353 var valid = validate(ext, name); 2354 2355 if (!valid.valid) { 2356 throw Error(valid.error); 2357 } 2358 2359 for (var i = 0; i < ext.length; ++i) { 2360 switch (ext[i].type) { 2361 case 'lang': 2362 langExtensions.push(ext[i]); 2363 break; 2364 case 'output': 2365 outputModifiers.push(ext[i]); 2366 break; 2367 default:// should never reach here 2368 throw Error('Extension loader error: Type unrecognized!!!'); 2369 } 2370 } 2371 } 2372 2373 /** 2374 * Listen to an event 2375 * @param {string} name 2376 * @param {function} callback 2377 */ 2378 function listen (name, callback) { 2379 if (!showdown.helper.isString(name)) { 2380 throw Error('Invalid argument in converter.listen() method: name must be a string, but ' + typeof name + ' given'); 2381 } 2382 2383 if (typeof callback !== 'function') { 2384 throw Error('Invalid argument in converter.listen() method: callback must be a function, but ' + typeof callback + ' given'); 2385 } 2386 2387 if (!listeners.hasOwnProperty(name)) { 2388 listeners[name] = []; 2389 } 2390 listeners[name].push(callback); 2391 } 2392 2393 function rTrimInputText (text) { 2394 var rsp = text.match(/^\s*/)[0].length, 2395 rgx = new RegExp('^\\s{0,' + rsp + '}', 'gm'); 2396 return text.replace(rgx, ''); 2397 } 2398 2399 /** 2400 * Dispatch an event 2401 * @private 2402 * @param {string} evtName Event name 2403 * @param {string} text Text 2404 * @param {{}} options Converter Options 2405 * @param {{}} globals 2406 * @returns {string} 2407 */ 2408 this._dispatch = function dispatch (evtName, text, options, globals) { 2409 if (listeners.hasOwnProperty(evtName)) { 2410 for (var ei = 0; ei < listeners[evtName].length; ++ei) { 2411 var nText = listeners[evtName][ei](evtName, text, this, options, globals); 2412 if (nText && typeof nText !== 'undefined') { 2413 text = nText; 2414 } 2415 } 2416 } 2417 return text; 2418 }; 2419 2420 /** 2421 * Listen to an event 2422 * @param {string} name 2423 * @param {function} callback 2424 * @returns {showdown.Converter} 2425 */ 2426 this.listen = function (name, callback) { 2427 listen(name, callback); 2428 return this; 2429 }; 2430 2431 /** 2432 * Converts a markdown string into HTML 2433 * @param {string} text 2434 * @returns {*} 2435 */ 2436 this.makeHtml = function (text) { 2437 //check if text is not falsy 2438 if (!text) { 2439 return text; 2440 } 2441 2442 var globals = { 2443 gHtmlBlocks: [], 2444 gHtmlMdBlocks: [], 2445 gHtmlSpans: [], 2446 gUrls: {}, 2447 gTitles: {}, 2448 gDimensions: {}, 2449 gListLevel: 0, 2450 hashLinkCounts: {}, 2451 langExtensions: langExtensions, 2452 outputModifiers: outputModifiers, 2453 converter: this, 2454 ghCodeBlocks: [], 2455 metadata: { 2456 parsed: {}, 2457 raw: '', 2458 format: '' 2459 } 2460 }; 2461 2462 // This lets us use ¨ trema as an escape char to avoid md5 hashes 2463 // The choice of character is arbitrary; anything that isn't 2464 // magic in Markdown will work. 2465 text = text.replace(/¨/g, '¨T'); 2466 2467 // Replace $ with ¨D 2468 // RegExp interprets $ as a special character 2469 // when it's in a replacement string 2470 text = text.replace(/\$/g, '¨D'); 2471 2472 // Standardize line endings 2473 text = text.replace(/\r\n/g, '\n'); // DOS to Unix 2474 text = text.replace(/\r/g, '\n'); // Mac to Unix 2475 2476 // Stardardize line spaces 2477 text = text.replace(/\u00A0/g, ' '); 2478 2479 if (options.smartIndentationFix) { 2480 text = rTrimInputText(text); 2481 } 2482 2483 // Make sure text begins and ends with a couple of newlines: 2484 text = '\n\n' + text + '\n\n'; 2485 2486 // detab 2487 text = showdown.subParser('detab')(text, options, globals); 2488 2489 /** 2490 * Strip any lines consisting only of spaces and tabs. 2491 * This makes subsequent regexs easier to write, because we can 2492 * match consecutive blank lines with /\n+/ instead of something 2493 * contorted like /[ \t]*\n+/ 2494 */ 2495 text = text.replace(/^[ \t]+$/mg, ''); 2496 2497 //run languageExtensions 2498 showdown.helper.forEach(langExtensions, function (ext) { 2499 text = showdown.subParser('runExtension')(ext, text, options, globals); 2500 }); 2501 2502 // run the sub parsers 2503 text = showdown.subParser('metadata')(text, options, globals); 2504 text = showdown.subParser('hashPreCodeTags')(text, options, globals); 2505 text = showdown.subParser('githubCodeBlocks')(text, options, globals); 2506 text = showdown.subParser('hashHTMLBlocks')(text, options, globals); 2507 text = showdown.subParser('hashCodeTags')(text, options, globals); 2508 text = showdown.subParser('stripLinkDefinitions')(text, options, globals); 2509 text = showdown.subParser('blockGamut')(text, options, globals); 2510 text = showdown.subParser('unhashHTMLSpans')(text, options, globals); 2511 text = showdown.subParser('unescapeSpecialChars')(text, options, globals); 2512 2513 // attacklab: Restore dollar signs 2514 text = text.replace(/¨D/g, '$$'); 2515 2516 // attacklab: Restore tremas 2517 text = text.replace(/¨T/g, '¨'); 2518 2519 // render a complete html document instead of a partial if the option is enabled 2520 text = showdown.subParser('completeHTMLDocument')(text, options, globals); 2521 2522 // Run output modifiers 2523 showdown.helper.forEach(outputModifiers, function (ext) { 2524 text = showdown.subParser('runExtension')(ext, text, options, globals); 2525 }); 2526 2527 // update metadata 2528 metadata = globals.metadata; 2529 return text; 2530 }; 2531 2532 /** 2533 * Converts an HTML string into a markdown string 2534 * @param src 2535 * @param [HTMLParser] A WHATWG DOM and HTML parser, such as JSDOM. If none is supplied, window.document will be used. 2536 * @returns {string} 2537 */ 2538 this.makeMarkdown = this.makeMd = function (src, HTMLParser) { 2539 2540 // replace \r\n with \n 2541 src = src.replace(/\r\n/g, '\n'); 2542 src = src.replace(/\r/g, '\n'); // old macs 2543 2544 // due to an edge case, we need to find this: > < 2545 // to prevent removing of non silent white spaces 2546 // ex: <em>this is</em> <strong>sparta</strong> 2547 src = src.replace(/>[ \t]+</, '>¨NBSP;<'); 2548 2549 if (!HTMLParser) { 2550 if (window && window.document) { 2551 HTMLParser = window.document; 2552 } else { 2553 throw new Error('HTMLParser is undefined. If in a webworker or nodejs environment, you need to provide a WHATWG DOM and HTML such as JSDOM'); 2554 } 2555 } 2556 2557 var doc = HTMLParser.createElement('div'); 2558 doc.innerHTML = src; 2559 2560 var globals = { 2561 preList: substitutePreCodeTags(doc) 2562 }; 2563 2564 // remove all newlines and collapse spaces 2565 clean(doc); 2566 2567 // some stuff, like accidental reference links must now be escaped 2568 // TODO 2569 // doc.innerHTML = doc.innerHTML.replace(/\[[\S\t ]]/); 2570 2571 var nodes = doc.childNodes, 2572 mdDoc = ''; 2573 2574 for (var i = 0; i < nodes.length; i++) { 2575 mdDoc += showdown.subParser('makeMarkdown.node')(nodes[i], globals); 2576 } 2577 2578 function clean (node) { 2579 for (var n = 0; n < node.childNodes.length; ++n) { 2580 var child = node.childNodes[n]; 2581 if (child.nodeType === 3) { 2582 if (!/\S/.test(child.nodeValue)) { 2583 node.removeChild(child); 2584 --n; 2585 } else { 2586 child.nodeValue = child.nodeValue.split('\n').join(' '); 2587 child.nodeValue = child.nodeValue.replace(/(\s)+/g, '$1'); 2588 } 2589 } else if (child.nodeType === 1) { 2590 clean(child); 2591 } 2592 } 2593 } 2594 2595 // find all pre tags and replace contents with placeholder 2596 // we need this so that we can remove all indentation from html 2597 // to ease up parsing 2598 function substitutePreCodeTags (doc) { 2599 2600 var pres = doc.querySelectorAll('pre'), 2601 presPH = []; 2602 2603 for (var i = 0; i < pres.length; ++i) { 2604 2605 if (pres[i].childElementCount === 1 && pres[i].firstChild.tagName.toLowerCase() === 'code') { 2606 var content = pres[i].firstChild.innerHTML.trim(), 2607 language = pres[i].firstChild.getAttribute('data-language') || ''; 2608 2609 // if data-language attribute is not defined, then we look for class language-* 2610 if (language === '') { 2611 var classes = pres[i].firstChild.className.split(' '); 2612 for (var c = 0; c < classes.length; ++c) { 2613 var matches = classes[c].match(/^language-(.+)$/); 2614 if (matches !== null) { 2615 language = matches[1]; 2616 break; 2617 } 2618 } 2619 } 2620 2621 // unescape html entities in content 2622 content = showdown.helper.unescapeHTMLEntities(content); 2623 2624 presPH.push(content); 2625 pres[i].outerHTML = '<precode language="' + language + '" precodenum="' + i.toString() + '"></precode>'; 2626 } else { 2627 presPH.push(pres[i].innerHTML); 2628 pres[i].innerHTML = ''; 2629 pres[i].setAttribute('prenum', i.toString()); 2630 } 2631 } 2632 return presPH; 2633 } 2634 2635 return mdDoc; 2636 }; 2637 2638 /** 2639 * Set an option of this Converter instance 2640 * @param {string} key 2641 * @param {*} value 2642 */ 2643 this.setOption = function (key, value) { 2644 options[key] = value; 2645 }; 2646 2647 /** 2648 * Get the option of this Converter instance 2649 * @param {string} key 2650 * @returns {*} 2651 */ 2652 this.getOption = function (key) { 2653 return options[key]; 2654 }; 2655 2656 /** 2657 * Get the options of this Converter instance 2658 * @returns {{}} 2659 */ 2660 this.getOptions = function () { 2661 return options; 2662 }; 2663 2664 /** 2665 * Add extension to THIS converter 2666 * @param {{}} extension 2667 * @param {string} [name=null] 2668 */ 2669 this.addExtension = function (extension, name) { 2670 name = name || null; 2671 _parseExtension(extension, name); 2672 }; 2673 2674 /** 2675 * Use a global registered extension with THIS converter 2676 * @param {string} extensionName Name of the previously registered extension 2677 */ 2678 this.useExtension = function (extensionName) { 2679 _parseExtension(extensionName); 2680 }; 2681 2682 /** 2683 * Set the flavor THIS converter should use 2684 * @param {string} name 2685 */ 2686 this.setFlavor = function (name) { 2687 if (!flavor.hasOwnProperty(name)) { 2688 throw Error(name + ' flavor was not found'); 2689 } 2690 var preset = flavor[name]; 2691 setConvFlavor = name; 2692 for (var option in preset) { 2693 if (preset.hasOwnProperty(option)) { 2694 options[option] = preset[option]; 2695 } 2696 } 2697 }; 2698 2699 /** 2700 * Get the currently set flavor of this converter 2701 * @returns {string} 2702 */ 2703 this.getFlavor = function () { 2704 return setConvFlavor; 2705 }; 2706 2707 /** 2708 * Remove an extension from THIS converter. 2709 * Note: This is a costly operation. It's better to initialize a new converter 2710 * and specify the extensions you wish to use 2711 * @param {Array} extension 2712 */ 2713 this.removeExtension = function (extension) { 2714 if (!showdown.helper.isArray(extension)) { 2715 extension = [extension]; 2716 } 2717 for (var a = 0; a < extension.length; ++a) { 2718 var ext = extension[a]; 2719 for (var i = 0; i < langExtensions.length; ++i) { 2720 if (langExtensions[i] === ext) { 2721 langExtensions[i].splice(i, 1); 2722 } 2723 } 2724 for (var ii = 0; ii < outputModifiers.length; ++i) { 2725 if (outputModifiers[ii] === ext) { 2726 outputModifiers[ii].splice(i, 1); 2727 } 2728 } 2729 } 2730 }; 2731 2732 /** 2733 * Get all extension of THIS converter 2734 * @returns {{language: Array, output: Array}} 2735 */ 2736 this.getAllExtensions = function () { 2737 return { 2738 language: langExtensions, 2739 output: outputModifiers 2740 }; 2741 }; 2742 2743 /** 2744 * Get the metadata of the previously parsed document 2745 * @param raw 2746 * @returns {string|{}} 2747 */ 2748 this.getMetadata = function (raw) { 2749 if (raw) { 2750 return metadata.raw; 2751 } else { 2752 return metadata.parsed; 2753 } 2754 }; 2755 2756 /** 2757 * Get the metadata format of the previously parsed document 2758 * @returns {string} 2759 */ 2760 this.getMetadataFormat = function () { 2761 return metadata.format; 2762 }; 2763 2764 /** 2765 * Private: set a single key, value metadata pair 2766 * @param {string} key 2767 * @param {string} value 2768 */ 2769 this._setMetadataPair = function (key, value) { 2770 metadata.parsed[key] = value; 2771 }; 2772 2773 /** 2774 * Private: set metadata format 2775 * @param {string} format 2776 */ 2777 this._setMetadataFormat = function (format) { 2778 metadata.format = format; 2779 }; 2780 2781 /** 2782 * Private: set metadata raw text 2783 * @param {string} raw 2784 */ 2785 this._setMetadataRaw = function (raw) { 2786 metadata.raw = raw; 2787 }; 2788 }; 2789 2790 /** 2791 * Turn Markdown link shortcuts into XHTML <a> tags. 2792 */ 2793 showdown.subParser('anchors', function (text, options, globals) { 2794 'use strict'; 2795 2796 text = globals.converter._dispatch('anchors.before', text, options, globals); 2797 2798 var writeAnchorTag = function (wholeMatch, linkText, linkId, url, m5, m6, title) { 2799 if (showdown.helper.isUndefined(title)) { 2800 title = ''; 2801 } 2802 linkId = linkId.toLowerCase(); 2803 2804 // Special case for explicit empty url 2805 if (wholeMatch.search(/\(<?\s*>? ?(['"].*['"])?\)$/m) > -1) { 2806 url = ''; 2807 } else if (!url) { 2808 if (!linkId) { 2809 // lower-case and turn embedded newlines into spaces 2810 linkId = linkText.toLowerCase().replace(/ ?\n/g, ' '); 2811 } 2812 url = '#' + linkId; 2813 2814 if (!showdown.helper.isUndefined(globals.gUrls[linkId])) { 2815 url = globals.gUrls[linkId]; 2816 if (!showdown.helper.isUndefined(globals.gTitles[linkId])) { 2817 title = globals.gTitles[linkId]; 2818 } 2819 } else { 2820 return wholeMatch; 2821 } 2822 } 2823 2824 //url = showdown.helper.escapeCharacters(url, '*_', false); // replaced line to improve performance 2825 url = url.replace(showdown.helper.regexes.asteriskDashAndColon, showdown.helper.escapeCharactersCallback); 2826 2827 var result = '<a href="' + url + '"'; 2828 2829 if (title !== '' && title !== null) { 2830 title = title.replace(/"/g, '"'); 2831 //title = showdown.helper.escapeCharacters(title, '*_', false); // replaced line to improve performance 2832 title = title.replace(showdown.helper.regexes.asteriskDashAndColon, showdown.helper.escapeCharactersCallback); 2833 result += ' title="' + title + '"'; 2834 } 2835 2836 // optionLinksInNewWindow only applies 2837 // to external links. Hash links (#) open in same page 2838 if (options.openLinksInNewWindow && !/^#/.test(url)) { 2839 // escaped _ 2840 result += ' rel="noopener noreferrer" target="¨E95Eblank"'; 2841 } 2842 2843 result += '>' + linkText + '</a>'; 2844 2845 return result; 2846 }; 2847 2848 // First, handle reference-style links: [link text] [id] 2849 text = text.replace(/\[((?:\[[^\]]*]|[^\[\]])*)] ?(?:\n *)?\[(.*?)]()()()()/g, writeAnchorTag); 2850 2851 // Next, inline-style links: [link text](url "optional title") 2852 // cases with crazy urls like ./image/cat1).png 2853 text = text.replace(/\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]?<([^>]*)>(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g, 2854 writeAnchorTag); 2855 2856 // normal cases 2857 text = text.replace(/\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]?<?([\S]+?(?:\([\S]*?\)[\S]*?)?)>?(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g, 2858 writeAnchorTag); 2859 2860 // handle reference-style shortcuts: [link text] 2861 // These must come last in case you've also got [link test][1] 2862 // or [link test](/foo) 2863 text = text.replace(/\[([^\[\]]+)]()()()()()/g, writeAnchorTag); 2864 2865 // Lastly handle GithubMentions if option is enabled 2866 if (options.ghMentions) { 2867 text = text.replace(/(^|\s)(\\)?(@([a-z\d]+(?:[a-z\d.-]+?[a-z\d]+)*))/gmi, function (wm, st, escape, mentions, username) { 2868 if (escape === '\\') { 2869 return st + mentions; 2870 } 2871 2872 //check if options.ghMentionsLink is a string 2873 if (!showdown.helper.isString(options.ghMentionsLink)) { 2874 throw new Error('ghMentionsLink option must be a string'); 2875 } 2876 var lnk = options.ghMentionsLink.replace(/\{u}/g, username), 2877 target = ''; 2878 if (options.openLinksInNewWindow) { 2879 target = ' rel="noopener noreferrer" target="¨E95Eblank"'; 2880 } 2881 return st + '<a href="' + lnk + '"' + target + '>' + mentions + '</a>'; 2882 }); 2883 } 2884 2885 text = globals.converter._dispatch('anchors.after', text, options, globals); 2886 return text; 2887 }); 2888 2889 // url allowed chars [a-z\d_.~:/?#[]@!$&'()*+,;=-] 2890 2891 var simpleURLRegex = /([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+?\.[^'">\s]+?)()(\1)?(?=\s|$)(?!["<>])/gi, 2892 simpleURLRegex2 = /([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+\.[^'">\s]+?)([.!?,()\[\]])?(\1)?(?=\s|$)(?!["<>])/gi, 2893 delimUrlRegex = /()<(((https?|ftp|dict):\/\/|www\.)[^'">\s]+)()>()/gi, 2894 simpleMailRegex = /(^|\s)(?:mailto:)?([A-Za-z0-9!#$%&'*+-/=?^_`{|}~.]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)(?=$|\s)/gmi, 2895 delimMailRegex = /<()(?:mailto:)?([-.\w]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)>/gi, 2896 2897 replaceLink = function (options) { 2898 'use strict'; 2899 return function (wm, leadingMagicChars, link, m2, m3, trailingPunctuation, trailingMagicChars) { 2900 link = link.replace(showdown.helper.regexes.asteriskDashAndColon, showdown.helper.escapeCharactersCallback); 2901 var lnkTxt = link, 2902 append = '', 2903 target = '', 2904 lmc = leadingMagicChars || '', 2905 tmc = trailingMagicChars || ''; 2906 if (/^www\./i.test(link)) { 2907 link = link.replace(/^www\./i, 'http://www.'); 2908 } 2909 if (options.excludeTrailingPunctuationFromURLs && trailingPunctuation) { 2910 append = trailingPunctuation; 2911 } 2912 if (options.openLinksInNewWindow) { 2913 target = ' rel="noopener noreferrer" target="¨E95Eblank"'; 2914 } 2915 return lmc + '<a href="' + link + '"' + target + '>' + lnkTxt + '</a>' + append + tmc; 2916 }; 2917 }, 2918 2919 replaceMail = function (options, globals) { 2920 'use strict'; 2921 return function (wholeMatch, b, mail) { 2922 var href = 'mailto:'; 2923 b = b || ''; 2924 mail = showdown.subParser('unescapeSpecialChars')(mail, options, globals); 2925 if (options.encodeEmails) { 2926 href = showdown.helper.encodeEmailAddress(href + mail); 2927 mail = showdown.helper.encodeEmailAddress(mail); 2928 } else { 2929 href = href + mail; 2930 } 2931 return b + '<a href="' + href + '">' + mail + '</a>'; 2932 }; 2933 }; 2934 2935 showdown.subParser('autoLinks', function (text, options, globals) { 2936 'use strict'; 2937 2938 text = globals.converter._dispatch('autoLinks.before', text, options, globals); 2939 2940 text = text.replace(delimUrlRegex, replaceLink(options)); 2941 text = text.replace(delimMailRegex, replaceMail(options, globals)); 2942 2943 text = globals.converter._dispatch('autoLinks.after', text, options, globals); 2944 2945 return text; 2946 }); 2947 2948 showdown.subParser('simplifiedAutoLinks', function (text, options, globals) { 2949 'use strict'; 2950 2951 if (!options.simplifiedAutoLink) { 2952 return text; 2953 } 2954 2955 text = globals.converter._dispatch('simplifiedAutoLinks.before', text, options, globals); 2956 2957 if (options.excludeTrailingPunctuationFromURLs) { 2958 text = text.replace(simpleURLRegex2, replaceLink(options)); 2959 } else { 2960 text = text.replace(simpleURLRegex, replaceLink(options)); 2961 } 2962 text = text.replace(simpleMailRegex, replaceMail(options, globals)); 2963 2964 text = globals.converter._dispatch('simplifiedAutoLinks.after', text, options, globals); 2965 2966 return text; 2967 }); 2968 2969 /** 2970 * These are all the transformations that form block-level 2971 * tags like paragraphs, headers, and list items. 2972 */ 2973 showdown.subParser('blockGamut', function (text, options, globals) { 2974 'use strict'; 2975 2976 text = globals.converter._dispatch('blockGamut.before', text, options, globals); 2977 2978 // we parse blockquotes first so that we can have headings and hrs 2979 // inside blockquotes 2980 text = showdown.subParser('blockQuotes')(text, options, globals); 2981 text = showdown.subParser('headers')(text, options, globals); 2982 2983 // Do Horizontal Rules: 2984 text = showdown.subParser('horizontalRule')(text, options, globals); 2985 2986 text = showdown.subParser('lists')(text, options, globals); 2987 text = showdown.subParser('codeBlocks')(text, options, globals); 2988 text = showdown.subParser('tables')(text, options, globals); 2989 2990 // We already ran _HashHTMLBlocks() before, in Markdown(), but that 2991 // was to escape raw HTML in the original Markdown source. This time, 2992 // we're escaping the markup we've just created, so that we don't wrap 2993 // <p> tags around block-level tags. 2994 text = showdown.subParser('hashHTMLBlocks')(text, options, globals); 2995 text = showdown.subParser('paragraphs')(text, options, globals); 2996 2997 text = globals.converter._dispatch('blockGamut.after', text, options, globals); 2998 2999 return text; 3000 }); 3001 3002 showdown.subParser('blockQuotes', function (text, options, globals) { 3003 'use strict'; 3004 3005 text = globals.converter._dispatch('blockQuotes.before', text, options, globals); 3006 3007 // add a couple extra lines after the text and endtext mark 3008 text = text + '\n\n'; 3009 3010 var rgx = /(^ {0,3}>[ \t]?.+\n(.+\n)*\n*)+/gm; 3011 3012 if (options.splitAdjacentBlockquotes) { 3013 rgx = /^ {0,3}>[\s\S]*?(?:\n\n)/gm; 3014 } 3015 3016 text = text.replace(rgx, function (bq) { 3017 // attacklab: hack around Konqueror 3.5.4 bug: 3018 // "----------bug".replace(/^-/g,"") == "bug" 3019 bq = bq.replace(/^[ \t]*>[ \t]?/gm, ''); // trim one level of quoting 3020 3021 // attacklab: clean up hack 3022 bq = bq.replace(/¨0/g, ''); 3023 3024 bq = bq.replace(/^[ \t]+$/gm, ''); // trim whitespace-only lines 3025 bq = showdown.subParser('githubCodeBlocks')(bq, options, globals); 3026 bq = showdown.subParser('blockGamut')(bq, options, globals); // recurse 3027 3028 bq = bq.replace(/(^|\n)/g, '$1 '); 3029 // These leading spaces screw with <pre> content, so we need to fix that: 3030 bq = bq.replace(/(\s*<pre>[^\r]+?<\/pre>)/gm, function (wholeMatch, m1) { 3031 var pre = m1; 3032 // attacklab: hack around Konqueror 3.5.4 bug: 3033 pre = pre.replace(/^ /mg, '¨0'); 3034 pre = pre.replace(/¨0/g, ''); 3035 return pre; 3036 }); 3037 3038 return showdown.subParser('hashBlock')('<blockquote>\n' + bq + '\n</blockquote>', options, globals); 3039 }); 3040 3041 text = globals.converter._dispatch('blockQuotes.after', text, options, globals); 3042 return text; 3043 }); 3044 3045 /** 3046 * Process Markdown `<pre><code>` blocks. 3047 */ 3048 showdown.subParser('codeBlocks', function (text, options, globals) { 3049 'use strict'; 3050 3051 text = globals.converter._dispatch('codeBlocks.before', text, options, globals); 3052 3053 // sentinel workarounds for lack of \A and \Z, safari\khtml bug 3054 text += '¨0'; 3055 3056 var pattern = /(?:\n\n|^)((?:(?:[ ]{4}|\t).*\n+)+)(\n*[ ]{0,3}[^ \t\n]|(?=¨0))/g; 3057 text = text.replace(pattern, function (wholeMatch, m1, m2) { 3058 var codeblock = m1, 3059 nextChar = m2, 3060 end = '\n'; 3061 3062 codeblock = showdown.subParser('outdent')(codeblock, options, globals); 3063 codeblock = showdown.subParser('encodeCode')(codeblock, options, globals); 3064 codeblock = showdown.subParser('detab')(codeblock, options, globals); 3065 codeblock = codeblock.replace(/^\n+/g, ''); // trim leading newlines 3066 codeblock = codeblock.replace(/\n+$/g, ''); // trim trailing newlines 3067 3068 if (options.omitExtraWLInCodeBlocks) { 3069 end = ''; 3070 } 3071 3072 codeblock = '<pre><code>' + codeblock + end + '</code></pre>'; 3073 3074 return showdown.subParser('hashBlock')(codeblock, options, globals) + nextChar; 3075 }); 3076 3077 // strip sentinel 3078 text = text.replace(/¨0/, ''); 3079 3080 text = globals.converter._dispatch('codeBlocks.after', text, options, globals); 3081 return text; 3082 }); 3083 3084 /** 3085 * 3086 * * Backtick quotes are used for <code></code> spans. 3087 * 3088 * * You can use multiple backticks as the delimiters if you want to 3089 * include literal backticks in the code span. So, this input: 3090 * 3091 * Just type ``foo `bar` baz`` at the prompt. 3092 * 3093 * Will translate to: 3094 * 3095 * <p>Just type <code>foo `bar` baz</code> at the prompt.</p> 3096 * 3097 * There's no arbitrary limit to the number of backticks you 3098 * can use as delimters. If you need three consecutive backticks 3099 * in your code, use four for delimiters, etc. 3100 * 3101 * * You can use spaces to get literal backticks at the edges: 3102 * 3103 * ... type `` `bar` `` ... 3104 * 3105 * Turns to: 3106 * 3107 * ... type <code>`bar`</code> ... 3108 */ 3109 showdown.subParser('codeSpans', function (text, options, globals) { 3110 'use strict'; 3111 3112 text = globals.converter._dispatch('codeSpans.before', text, options, globals); 3113 3114 if (typeof text === 'undefined') { 3115 text = ''; 3116 } 3117 text = text.replace(/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm, 3118 function (wholeMatch, m1, m2, m3) { 3119 var c = m3; 3120 c = c.replace(/^([ \t]*)/g, ''); // leading whitespace 3121 c = c.replace(/[ \t]*$/g, ''); // trailing whitespace 3122 c = showdown.subParser('encodeCode')(c, options, globals); 3123 c = m1 + '<code>' + c + '</code>'; 3124 c = showdown.subParser('hashHTMLSpans')(c, options, globals); 3125 return c; 3126 } 3127 ); 3128 3129 text = globals.converter._dispatch('codeSpans.after', text, options, globals); 3130 return text; 3131 }); 3132 3133 /** 3134 * Create a full HTML document from the processed markdown 3135 */ 3136 showdown.subParser('completeHTMLDocument', function (text, options, globals) { 3137 'use strict'; 3138 3139 if (!options.completeHTMLDocument) { 3140 return text; 3141 } 3142 3143 text = globals.converter._dispatch('completeHTMLDocument.before', text, options, globals); 3144 3145 var doctype = 'html', 3146 doctypeParsed = '<!DOCTYPE HTML>\n', 3147 title = '', 3148 charset = '<meta charset="utf-8">\n', 3149 lang = '', 3150 metadata = ''; 3151 3152 if (typeof globals.metadata.parsed.doctype !== 'undefined') { 3153 doctypeParsed = '<!DOCTYPE ' + globals.metadata.parsed.doctype + '>\n'; 3154 doctype = globals.metadata.parsed.doctype.toString().toLowerCase(); 3155 if (doctype === 'html' || doctype === 'html5') { 3156 charset = '<meta charset="utf-8">'; 3157 } 3158 } 3159 3160 for (var meta in globals.metadata.parsed) { 3161 if (globals.metadata.parsed.hasOwnProperty(meta)) { 3162 switch (meta.toLowerCase()) { 3163 case 'doctype': 3164 break; 3165 3166 case 'title': 3167 title = '<title>' + globals.metadata.parsed.title + '</title>\n'; 3168 break; 3169 3170 case 'charset': 3171 if (doctype === 'html' || doctype === 'html5') { 3172 charset = '<meta charset="' + globals.metadata.parsed.charset + '">\n'; 3173 } else { 3174 charset = '<meta name="charset" content="' + globals.metadata.parsed.charset + '">\n'; 3175 } 3176 break; 3177 3178 case 'language': 3179 case 'lang': 3180 lang = ' lang="' + globals.metadata.parsed[meta] + '"'; 3181 metadata += '<meta name="' + meta + '" content="' + globals.metadata.parsed[meta] + '">\n'; 3182 break; 3183 3184 default: 3185 metadata += '<meta name="' + meta + '" content="' + globals.metadata.parsed[meta] + '">\n'; 3186 } 3187 } 3188 } 3189 3190 text = doctypeParsed + '<html' + lang + '>\n<head>\n' + title + charset + metadata + '</head>\n<body>\n' + text.trim() + '\n</body>\n</html>'; 3191 3192 text = globals.converter._dispatch('completeHTMLDocument.after', text, options, globals); 3193 return text; 3194 }); 3195 3196 /** 3197 * Convert all tabs to spaces 3198 */ 3199 showdown.subParser('detab', function (text, options, globals) { 3200 'use strict'; 3201 text = globals.converter._dispatch('detab.before', text, options, globals); 3202 3203 // expand first n-1 tabs 3204 text = text.replace(/\t(?=\t)/g, ' '); // g_tab_width 3205 3206 // replace the nth with two sentinels 3207 text = text.replace(/\t/g, '¨A¨B'); 3208 3209 // use the sentinel to anchor our regex so it doesn't explode 3210 text = text.replace(/¨B(.+?)¨A/g, function (wholeMatch, m1) { 3211 var leadingText = m1, 3212 numSpaces = 4 - leadingText.length % 4; // g_tab_width 3213 3214 // there *must* be a better way to do this: 3215 for (var i = 0; i < numSpaces; i++) { 3216 leadingText += ' '; 3217 } 3218 3219 return leadingText; 3220 }); 3221 3222 // clean up sentinels 3223 text = text.replace(/¨A/g, ' '); // g_tab_width 3224 text = text.replace(/¨B/g, ''); 3225 3226 text = globals.converter._dispatch('detab.after', text, options, globals); 3227 return text; 3228 }); 3229 3230 showdown.subParser('ellipsis', function (text, options, globals) { 3231 'use strict'; 3232 3233 text = globals.converter._dispatch('ellipsis.before', text, options, globals); 3234 3235 text = text.replace(/\.\.\./g, '…'); 3236 3237 text = globals.converter._dispatch('ellipsis.after', text, options, globals); 3238 3239 return text; 3240 }); 3241 3242 /** 3243 * Turn emoji codes into emojis 3244 * 3245 * List of supported emojis: https://github.com/showdownjs/showdown/wiki/Emojis 3246 */ 3247 showdown.subParser('emoji', function (text, options, globals) { 3248 'use strict'; 3249 3250 if (!options.emoji) { 3251 return text; 3252 } 3253 3254 text = globals.converter._dispatch('emoji.before', text, options, globals); 3255 3256 var emojiRgx = /:([\S]+?):/g; 3257 3258 text = text.replace(emojiRgx, function (wm, emojiCode) { 3259 if (showdown.helper.emojis.hasOwnProperty(emojiCode)) { 3260 return showdown.helper.emojis[emojiCode]; 3261 } 3262 return wm; 3263 }); 3264 3265 text = globals.converter._dispatch('emoji.after', text, options, globals); 3266 3267 return text; 3268 }); 3269 3270 /** 3271 * Smart processing for ampersands and angle brackets that need to be encoded. 3272 */ 3273 showdown.subParser('encodeAmpsAndAngles', function (text, options, globals) { 3274 'use strict'; 3275 text = globals.converter._dispatch('encodeAmpsAndAngles.before', text, options, globals); 3276 3277 // Ampersand-encoding based entirely on Nat Irons's Amputator MT plugin: 3278 // http://bumppo.net/projects/amputator/ 3279 text = text.replace(/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)/g, '&'); 3280 3281 // Encode naked <'s 3282 text = text.replace(/<(?![a-z\/?$!])/gi, '<'); 3283 3284 // Encode < 3285 text = text.replace(/</g, '<'); 3286 3287 // Encode > 3288 text = text.replace(/>/g, '>'); 3289 3290 text = globals.converter._dispatch('encodeAmpsAndAngles.after', text, options, globals); 3291 return text; 3292 }); 3293 3294 /** 3295 * Returns the string, with after processing the following backslash escape sequences. 3296 * 3297 * attacklab: The polite way to do this is with the new escapeCharacters() function: 3298 * 3299 * text = escapeCharacters(text,"\\",true); 3300 * text = escapeCharacters(text,"`*_{}[]()>#+-.!",true); 3301 * 3302 * ...but we're sidestepping its use of the (slow) RegExp constructor 3303 * as an optimization for Firefox. This function gets called a LOT. 3304 */ 3305 showdown.subParser('encodeBackslashEscapes', function (text, options, globals) { 3306 'use strict'; 3307 text = globals.converter._dispatch('encodeBackslashEscapes.before', text, options, globals); 3308 3309 text = text.replace(/\\(\\)/g, showdown.helper.escapeCharactersCallback); 3310 text = text.replace(/\\([`*_{}\[\]()>#+.!~=|-])/g, showdown.helper.escapeCharactersCallback); 3311 3312 text = globals.converter._dispatch('encodeBackslashEscapes.after', text, options, globals); 3313 return text; 3314 }); 3315 3316 /** 3317 * Encode/escape certain characters inside Markdown code runs. 3318 * The point is that in code, these characters are literals, 3319 * and lose their special Markdown meanings. 3320 */ 3321 showdown.subParser('encodeCode', function (text, options, globals) { 3322 'use strict'; 3323 3324 text = globals.converter._dispatch('encodeCode.before', text, options, globals); 3325 3326 // Encode all ampersands; HTML entities are not 3327 // entities within a Markdown code span. 3328 text = text 3329 .replace(/&/g, '&') 3330 // Do the angle bracket song and dance: 3331 .replace(/</g, '<') 3332 .replace(/>/g, '>') 3333 // Now, escape characters that are magic in Markdown: 3334 .replace(/([*_{}\[\]\\=~-])/g, showdown.helper.escapeCharactersCallback); 3335 3336 text = globals.converter._dispatch('encodeCode.after', text, options, globals); 3337 return text; 3338 }); 3339 3340 /** 3341 * Within tags -- meaning between < and > -- encode [\ ` * _ ~ =] so they 3342 * don't conflict with their use in Markdown for code, italics and strong. 3343 */ 3344 showdown.subParser('escapeSpecialCharsWithinTagAttributes', function (text, options, globals) { 3345 'use strict'; 3346 text = globals.converter._dispatch('escapeSpecialCharsWithinTagAttributes.before', text, options, globals); 3347 3348 // Build a regex to find HTML tags. 3349 var tags = /<\/?[a-z\d_:-]+(?:[\s]+[\s\S]+?)?>/gi, 3350 comments = /<!(--(?:(?:[^>-]|-[^>])(?:[^-]|-[^-])*)--)>/gi; 3351 3352 text = text.replace(tags, function (wholeMatch) { 3353 return wholeMatch 3354 .replace(/(.)<\/?code>(?=.)/g, '$1`') 3355 .replace(/([\\`*_~=|])/g, showdown.helper.escapeCharactersCallback); 3356 }); 3357 3358 text = text.replace(comments, function (wholeMatch) { 3359 return wholeMatch 3360 .replace(/([\\`*_~=|])/g, showdown.helper.escapeCharactersCallback); 3361 }); 3362 3363 text = globals.converter._dispatch('escapeSpecialCharsWithinTagAttributes.after', text, options, globals); 3364 return text; 3365 }); 3366 3367 /** 3368 * Handle github codeblocks prior to running HashHTML so that 3369 * HTML contained within the codeblock gets escaped properly 3370 * Example: 3371 * ```ruby 3372 * def hello_world(x) 3373 * puts "Hello, #{x}" 3374 * end 3375 * ``` 3376 */ 3377 showdown.subParser('githubCodeBlocks', function (text, options, globals) { 3378 'use strict'; 3379 3380 // early exit if option is not enabled 3381 if (!options.ghCodeBlocks) { 3382 return text; 3383 } 3384 3385 text = globals.converter._dispatch('githubCodeBlocks.before', text, options, globals); 3386 3387 text += '¨0'; 3388 3389 text = text.replace(/(?:^|\n)(?: {0,3})(```+|~~~+)(?: *)([^\s`~]*)\n([\s\S]*?)\n(?: {0,3})\1/g, function (wholeMatch, delim, language, codeblock) { 3390 var end = (options.omitExtraWLInCodeBlocks) ? '' : '\n'; 3391 3392 // First parse the github code block 3393 codeblock = showdown.subParser('encodeCode')(codeblock, options, globals); 3394 codeblock = showdown.subParser('detab')(codeblock, options, globals); 3395 codeblock = codeblock.replace(/^\n+/g, ''); // trim leading newlines 3396 codeblock = codeblock.replace(/\n+$/g, ''); // trim trailing whitespace 3397 3398 codeblock = '<pre><code' + (language ? ' class="' + language + ' language-' + language + '"' : '') + '>' + codeblock + end + '</code></pre>'; 3399 3400 codeblock = showdown.subParser('hashBlock')(codeblock, options, globals); 3401 3402 // Since GHCodeblocks can be false positives, we need to 3403 // store the primitive text and the parsed text in a global var, 3404 // and then return a token 3405 return '\n\n¨G' + (globals.ghCodeBlocks.push({text: wholeMatch, codeblock: codeblock}) - 1) + 'G\n\n'; 3406 }); 3407 3408 // attacklab: strip sentinel 3409 text = text.replace(/¨0/, ''); 3410 3411 return globals.converter._dispatch('githubCodeBlocks.after', text, options, globals); 3412 }); 3413 3414 showdown.subParser('hashBlock', function (text, options, globals) { 3415 'use strict'; 3416 text = globals.converter._dispatch('hashBlock.before', text, options, globals); 3417 text = text.replace(/(^\n+|\n+$)/g, ''); 3418 text = '\n\n¨K' + (globals.gHtmlBlocks.push(text) - 1) + 'K\n\n'; 3419 text = globals.converter._dispatch('hashBlock.after', text, options, globals); 3420 return text; 3421 }); 3422 3423 /** 3424 * Hash and escape <code> elements that should not be parsed as markdown 3425 */ 3426 showdown.subParser('hashCodeTags', function (text, options, globals) { 3427 'use strict'; 3428 text = globals.converter._dispatch('hashCodeTags.before', text, options, globals); 3429 3430 var repFunc = function (wholeMatch, match, left, right) { 3431 var codeblock = left + showdown.subParser('encodeCode')(match, options, globals) + right; 3432 return '¨C' + (globals.gHtmlSpans.push(codeblock) - 1) + 'C'; 3433 }; 3434 3435 // Hash naked <code> 3436 text = showdown.helper.replaceRecursiveRegExp(text, repFunc, '<code\\b[^>]*>', '</code>', 'gim'); 3437 3438 text = globals.converter._dispatch('hashCodeTags.after', text, options, globals); 3439 return text; 3440 }); 3441 3442 showdown.subParser('hashElement', function (text, options, globals) { 3443 'use strict'; 3444 3445 return function (wholeMatch, m1) { 3446 var blockText = m1; 3447 3448 // Undo double lines 3449 blockText = blockText.replace(/\n\n/g, '\n'); 3450 blockText = blockText.replace(/^\n/, ''); 3451 3452 // strip trailing blank lines 3453 blockText = blockText.replace(/\n+$/g, ''); 3454 3455 // Replace the element text with a marker ("¨KxK" where x is its key) 3456 blockText = '\n\n¨K' + (globals.gHtmlBlocks.push(blockText) - 1) + 'K\n\n'; 3457 3458 return blockText; 3459 }; 3460 }); 3461 3462 showdown.subParser('hashHTMLBlocks', function (text, options, globals) { 3463 'use strict'; 3464 text = globals.converter._dispatch('hashHTMLBlocks.before', text, options, globals); 3465 3466 var blockTags = [ 3467 'pre', 3468 'div', 3469 'h1', 3470 'h2', 3471 'h3', 3472 'h4', 3473 'h5', 3474 'h6', 3475 'blockquote', 3476 'table', 3477 'dl', 3478 'ol', 3479 'ul', 3480 'script', 3481 'noscript', 3482 'form', 3483 'fieldset', 3484 'iframe', 3485 'math', 3486 'style', 3487 'section', 3488 'header', 3489 'footer', 3490 'nav', 3491 'article', 3492 'aside', 3493 'address', 3494 'audio', 3495 'canvas', 3496 'figure', 3497 'hgroup', 3498 'output', 3499 'video', 3500 'p' 3501 ], 3502 repFunc = function (wholeMatch, match, left, right) { 3503 var txt = wholeMatch; 3504 // check if this html element is marked as markdown 3505 // if so, it's contents should be parsed as markdown 3506 if (left.search(/\bmarkdown\b/) !== -1) { 3507 txt = left + globals.converter.makeHtml(match) + right; 3508 } 3509 return '\n\n¨K' + (globals.gHtmlBlocks.push(txt) - 1) + 'K\n\n'; 3510 }; 3511 3512 if (options.backslashEscapesHTMLTags) { 3513 // encode backslash escaped HTML tags 3514 text = text.replace(/\\<(\/?[^>]+?)>/g, function (wm, inside) { 3515 return '<' + inside + '>'; 3516 }); 3517 } 3518 3519 // hash HTML Blocks 3520 for (var i = 0; i < blockTags.length; ++i) { 3521 3522 var opTagPos, 3523 rgx1 = new RegExp('^ {0,3}(<' + blockTags[i] + '\\b[^>]*>)', 'im'), 3524 patLeft = '<' + blockTags[i] + '\\b[^>]*>', 3525 patRight = '</' + blockTags[i] + '>'; 3526 // 1. Look for the first position of the first opening HTML tag in the text 3527 while ((opTagPos = showdown.helper.regexIndexOf(text, rgx1)) !== -1) { 3528 3529 // if the HTML tag is \ escaped, we need to escape it and break 3530 3531 3532 //2. Split the text in that position 3533 var subTexts = showdown.helper.splitAtIndex(text, opTagPos), 3534 //3. Match recursively 3535 newSubText1 = showdown.helper.replaceRecursiveRegExp(subTexts[1], repFunc, patLeft, patRight, 'im'); 3536 3537 // prevent an infinite loop 3538 if (newSubText1 === subTexts[1]) { 3539 break; 3540 } 3541 text = subTexts[0].concat(newSubText1); 3542 } 3543 } 3544 // HR SPECIAL CASE 3545 text = text.replace(/(\n {0,3}(<(hr)\b([^<>])*?\/?>)[ \t]*(?=\n{2,}))/g, 3546 showdown.subParser('hashElement')(text, options, globals)); 3547 3548 // Special case for standalone HTML comments 3549 text = showdown.helper.replaceRecursiveRegExp(text, function (txt) { 3550 return '\n\n¨K' + (globals.gHtmlBlocks.push(txt) - 1) + 'K\n\n'; 3551 }, '^ {0,3}<!--', '-->', 'gm'); 3552 3553 // PHP and ASP-style processor instructions (<?...?> and <%...%>) 3554 text = text.replace(/(?:\n\n)( {0,3}(?:<([?%])[^\r]*?\2>)[ \t]*(?=\n{2,}))/g, 3555 showdown.subParser('hashElement')(text, options, globals)); 3556 3557 text = globals.converter._dispatch('hashHTMLBlocks.after', text, options, globals); 3558 return text; 3559 }); 3560 3561 /** 3562 * Hash span elements that should not be parsed as markdown 3563 */ 3564 showdown.subParser('hashHTMLSpans', function (text, options, globals) { 3565 'use strict'; 3566 text = globals.converter._dispatch('hashHTMLSpans.before', text, options, globals); 3567 3568 function hashHTMLSpan (html) { 3569 return '¨C' + (globals.gHtmlSpans.push(html) - 1) + 'C'; 3570 } 3571 3572 // Hash Self Closing tags 3573 text = text.replace(/<[^>]+?\/>/gi, function (wm) { 3574 return hashHTMLSpan(wm); 3575 }); 3576 3577 // Hash tags without properties 3578 text = text.replace(/<([^>]+?)>[\s\S]*?<\/\1>/g, function (wm) { 3579 return hashHTMLSpan(wm); 3580 }); 3581 3582 // Hash tags with properties 3583 text = text.replace(/<([^>]+?)\s[^>]+?>[\s\S]*?<\/\1>/g, function (wm) { 3584 return hashHTMLSpan(wm); 3585 }); 3586 3587 // Hash self closing tags without /> 3588 text = text.replace(/<[^>]+?>/gi, function (wm) { 3589 return hashHTMLSpan(wm); 3590 }); 3591 3592 /*showdown.helper.matchRecursiveRegExp(text, '<code\\b[^>]*>', '</code>', 'gi');*/ 3593 3594 text = globals.converter._dispatch('hashHTMLSpans.after', text, options, globals); 3595 return text; 3596 }); 3597 3598 /** 3599 * Unhash HTML spans 3600 */ 3601 showdown.subParser('unhashHTMLSpans', function (text, options, globals) { 3602 'use strict'; 3603 text = globals.converter._dispatch('unhashHTMLSpans.before', text, options, globals); 3604 3605 for (var i = 0; i < globals.gHtmlSpans.length; ++i) { 3606 var repText = globals.gHtmlSpans[i], 3607 // limiter to prevent infinite loop (assume 10 as limit for recurse) 3608 limit = 0; 3609 3610 while (/¨C(\d+)C/.test(repText)) { 3611 var num = RegExp.$1; 3612 repText = repText.replace('¨C' + num + 'C', globals.gHtmlSpans[num]); 3613 if (limit === 10) { 3614 console.error('maximum nesting of 10 spans reached!!!'); 3615 break; 3616 } 3617 ++limit; 3618 } 3619 text = text.replace('¨C' + i + 'C', repText); 3620 } 3621 3622 text = globals.converter._dispatch('unhashHTMLSpans.after', text, options, globals); 3623 return text; 3624 }); 3625 3626 /** 3627 * Hash and escape <pre><code> elements that should not be parsed as markdown 3628 */ 3629 showdown.subParser('hashPreCodeTags', function (text, options, globals) { 3630 'use strict'; 3631 text = globals.converter._dispatch('hashPreCodeTags.before', text, options, globals); 3632 3633 var repFunc = function (wholeMatch, match, left, right) { 3634 // encode html entities 3635 var codeblock = left + showdown.subParser('encodeCode')(match, options, globals) + right; 3636 return '\n\n¨G' + (globals.ghCodeBlocks.push({text: wholeMatch, codeblock: codeblock}) - 1) + 'G\n\n'; 3637 }; 3638 3639 // Hash <pre><code> 3640 text = showdown.helper.replaceRecursiveRegExp(text, repFunc, '^ {0,3}<pre\\b[^>]*>\\s*<code\\b[^>]*>', '^ {0,3}</code>\\s*</pre>', 'gim'); 3641 3642 text = globals.converter._dispatch('hashPreCodeTags.after', text, options, globals); 3643 return text; 3644 }); 3645 3646 showdown.subParser('headers', function (text, options, globals) { 3647 'use strict'; 3648 3649 text = globals.converter._dispatch('headers.before', text, options, globals); 3650 3651 var headerLevelStart = (isNaN(parseInt(options.headerLevelStart))) ? 1 : parseInt(options.headerLevelStart), 3652 3653 // Set text-style headers: 3654 // Header 1 3655 // ======== 3656 // 3657 // Header 2 3658 // -------- 3659 // 3660 setextRegexH1 = (options.smoothLivePreview) ? /^(.+)[ \t]*\n={2,}[ \t]*\n+/gm : /^(.+)[ \t]*\n=+[ \t]*\n+/gm, 3661 setextRegexH2 = (options.smoothLivePreview) ? /^(.+)[ \t]*\n-{2,}[ \t]*\n+/gm : /^(.+)[ \t]*\n-+[ \t]*\n+/gm; 3662 3663 text = text.replace(setextRegexH1, function (wholeMatch, m1) { 3664 3665 var spanGamut = showdown.subParser('spanGamut')(m1, options, globals), 3666 hID = (options.noHeaderId) ? '' : ' id="' + headerId(m1) + '"', 3667 hLevel = headerLevelStart, 3668 hashBlock = '<h' + hLevel + hID + '>' + spanGamut + '</h' + hLevel + '>'; 3669 return showdown.subParser('hashBlock')(hashBlock, options, globals); 3670 }); 3671 3672 text = text.replace(setextRegexH2, function (matchFound, m1) { 3673 var spanGamut = showdown.subParser('spanGamut')(m1, options, globals), 3674 hID = (options.noHeaderId) ? '' : ' id="' + headerId(m1) + '"', 3675 hLevel = headerLevelStart + 1, 3676 hashBlock = '<h' + hLevel + hID + '>' + spanGamut + '</h' + hLevel + '>'; 3677 return showdown.subParser('hashBlock')(hashBlock, options, globals); 3678 }); 3679 3680 // atx-style headers: 3681 // # Header 1 3682 // ## Header 2 3683 // ## Header 2 with closing hashes ## 3684 // ... 3685 // ###### Header 6 3686 // 3687 var atxStyle = (options.requireSpaceBeforeHeadingText) ? /^(#{1,6})[ \t]+(.+?)[ \t]*#*\n+/gm : /^(#{1,6})[ \t]*(.+?)[ \t]*#*\n+/gm; 3688 3689 text = text.replace(atxStyle, function (wholeMatch, m1, m2) { 3690 var hText = m2; 3691 if (options.customizedHeaderId) { 3692 hText = m2.replace(/\s?\{([^{]+?)}\s*$/, ''); 3693 } 3694 3695 var span = showdown.subParser('spanGamut')(hText, options, globals), 3696 hID = (options.noHeaderId) ? '' : ' id="' + headerId(m2) + '"', 3697 hLevel = headerLevelStart - 1 + m1.length, 3698 header = '<h' + hLevel + hID + '>' + span + '</h' + hLevel + '>'; 3699 3700 return showdown.subParser('hashBlock')(header, options, globals); 3701 }); 3702 3703 function headerId (m) { 3704 var title, 3705 prefix; 3706 3707 // It is separate from other options to allow combining prefix and customized 3708 if (options.customizedHeaderId) { 3709 var match = m.match(/\{([^{]+?)}\s*$/); 3710 if (match && match[1]) { 3711 m = match[1]; 3712 } 3713 } 3714 3715 title = m; 3716 3717 // Prefix id to prevent causing inadvertent pre-existing style matches. 3718 if (showdown.helper.isString(options.prefixHeaderId)) { 3719 prefix = options.prefixHeaderId; 3720 } else if (options.prefixHeaderId === true) { 3721 prefix = 'section-'; 3722 } else { 3723 prefix = ''; 3724 } 3725 3726 if (!options.rawPrefixHeaderId) { 3727 title = prefix + title; 3728 } 3729 3730 if (options.ghCompatibleHeaderId) { 3731 title = title 3732 .replace(/ /g, '-') 3733 // replace previously escaped chars (&, ¨ and $) 3734 .replace(/&/g, '') 3735 .replace(/¨T/g, '') 3736 .replace(/¨D/g, '') 3737 // replace rest of the chars (&~$ are repeated as they might have been escaped) 3738 // borrowed from github's redcarpet (some they should produce similar results) 3739 .replace(/[&+$,\/:;=?@"#{}|^¨~\[\]`\\*)(%.!'<>]/g, '') 3740 .toLowerCase(); 3741 } else if (options.rawHeaderId) { 3742 title = title 3743 .replace(/ /g, '-') 3744 // replace previously escaped chars (&, ¨ and $) 3745 .replace(/&/g, '&') 3746 .replace(/¨T/g, '¨') 3747 .replace(/¨D/g, '$') 3748 // replace " and ' 3749 .replace(/["']/g, '-') 3750 .toLowerCase(); 3751 } else { 3752 title = title 3753 .replace(/[^\w]/g, '') 3754 .toLowerCase(); 3755 } 3756 3757 if (options.rawPrefixHeaderId) { 3758 title = prefix + title; 3759 } 3760 3761 if (globals.hashLinkCounts[title]) { 3762 title = title + '-' + (globals.hashLinkCounts[title]++); 3763 } else { 3764 globals.hashLinkCounts[title] = 1; 3765 } 3766 return title; 3767 } 3768 3769 text = globals.converter._dispatch('headers.after', text, options, globals); 3770 return text; 3771 }); 3772 3773 /** 3774 * Turn Markdown link shortcuts into XHTML <a> tags. 3775 */ 3776 showdown.subParser('horizontalRule', function (text, options, globals) { 3777 'use strict'; 3778 text = globals.converter._dispatch('horizontalRule.before', text, options, globals); 3779 3780 var key = showdown.subParser('hashBlock')('<hr />', options, globals); 3781 text = text.replace(/^ {0,2}( ?-){3,}[ \t]*$/gm, key); 3782 text = text.replace(/^ {0,2}( ?\*){3,}[ \t]*$/gm, key); 3783 text = text.replace(/^ {0,2}( ?_){3,}[ \t]*$/gm, key); 3784 3785 text = globals.converter._dispatch('horizontalRule.after', text, options, globals); 3786 return text; 3787 }); 3788 3789 /** 3790 * Turn Markdown image shortcuts into <img> tags. 3791 */ 3792 showdown.subParser('images', function (text, options, globals) { 3793 'use strict'; 3794 3795 text = globals.converter._dispatch('images.before', text, options, globals); 3796 3797 var inlineRegExp = /!\[([^\]]*?)][ \t]*()\([ \t]?<?([\S]+?(?:\([\S]*?\)[\S]*?)?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g, 3798 crazyRegExp = /!\[([^\]]*?)][ \t]*()\([ \t]?<([^>]*)>(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(?:(["'])([^"]*?)\6))?[ \t]?\)/g, 3799 base64RegExp = /!\[([^\]]*?)][ \t]*()\([ \t]?<?(data:.+?\/.+?;base64,[A-Za-z0-9+/=\n]+?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g, 3800 referenceRegExp = /!\[([^\]]*?)] ?(?:\n *)?\[([\s\S]*?)]()()()()()/g, 3801 refShortcutRegExp = /!\[([^\[\]]+)]()()()()()/g; 3802 3803 function writeImageTagBase64 (wholeMatch, altText, linkId, url, width, height, m5, title) { 3804 url = url.replace(/\s/g, ''); 3805 return writeImageTag (wholeMatch, altText, linkId, url, width, height, m5, title); 3806 } 3807 3808 function writeImageTag (wholeMatch, altText, linkId, url, width, height, m5, title) { 3809 3810 var gUrls = globals.gUrls, 3811 gTitles = globals.gTitles, 3812 gDims = globals.gDimensions; 3813 3814 linkId = linkId.toLowerCase(); 3815 3816 if (!title) { 3817 title = ''; 3818 } 3819 // Special case for explicit empty url 3820 if (wholeMatch.search(/\(<?\s*>? ?(['"].*['"])?\)$/m) > -1) { 3821 url = ''; 3822 3823 } else if (url === '' || url === null) { 3824 if (linkId === '' || linkId === null) { 3825 // lower-case and turn embedded newlines into spaces 3826 linkId = altText.toLowerCase().replace(/ ?\n/g, ' '); 3827 } 3828 url = '#' + linkId; 3829 3830 if (!showdown.helper.isUndefined(gUrls[linkId])) { 3831 url = gUrls[linkId]; 3832 if (!showdown.helper.isUndefined(gTitles[linkId])) { 3833 title = gTitles[linkId]; 3834 } 3835 if (!showdown.helper.isUndefined(gDims[linkId])) { 3836 width = gDims[linkId].width; 3837 height = gDims[linkId].height; 3838 } 3839 } else { 3840 return wholeMatch; 3841 } 3842 } 3843 3844 altText = altText 3845 .replace(/"/g, '"') 3846 //altText = showdown.helper.escapeCharacters(altText, '*_', false); 3847 .replace(showdown.helper.regexes.asteriskDashAndColon, showdown.helper.escapeCharactersCallback); 3848 //url = showdown.helper.escapeCharacters(url, '*_', false); 3849 url = url.replace(showdown.helper.regexes.asteriskDashAndColon, showdown.helper.escapeCharactersCallback); 3850 var result = '<img src="' + url + '" alt="' + altText + '"'; 3851 3852 if (title && showdown.helper.isString(title)) { 3853 title = title 3854 .replace(/"/g, '"') 3855 //title = showdown.helper.escapeCharacters(title, '*_', false); 3856 .replace(showdown.helper.regexes.asteriskDashAndColon, showdown.helper.escapeCharactersCallback); 3857 result += ' title="' + title + '"'; 3858 } 3859 3860 if (width && height) { 3861 width = (width === '*') ? 'auto' : width; 3862 height = (height === '*') ? 'auto' : height; 3863 3864 result += ' width="' + width + '"'; 3865 result += ' height="' + height + '"'; 3866 } 3867 3868 result += ' />'; 3869 3870 return result; 3871 } 3872 3873 // First, handle reference-style labeled images: ![alt text][id] 3874 text = text.replace(referenceRegExp, writeImageTag); 3875 3876 // Next, handle inline images:  3877 3878 // base64 encoded images 3879 text = text.replace(base64RegExp, writeImageTagBase64); 3880 3881 // cases with crazy urls like ./image/cat1).png 3882 text = text.replace(crazyRegExp, writeImageTag); 3883 3884 // normal cases 3885 text = text.replace(inlineRegExp, writeImageTag); 3886 3887 // handle reference-style shortcuts: ![img text] 3888 text = text.replace(refShortcutRegExp, writeImageTag); 3889 3890 text = globals.converter._dispatch('images.after', text, options, globals); 3891 return text; 3892 }); 3893 3894 showdown.subParser('italicsAndBold', function (text, options, globals) { 3895 'use strict'; 3896 3897 text = globals.converter._dispatch('italicsAndBold.before', text, options, globals); 3898 3899 // it's faster to have 3 separate regexes for each case than have just one 3900 // because of backtracing, in some cases, it could lead to an exponential effect 3901 // called "catastrophic backtrace". Ominous! 3902 3903 function parseInside (txt, left, right) { 3904 /* 3905 if (options.simplifiedAutoLink) { 3906 txt = showdown.subParser('simplifiedAutoLinks')(txt, options, globals); 3907 } 3908 */ 3909 return left + txt + right; 3910 } 3911 3912 // Parse underscores 3913 if (options.literalMidWordUnderscores) { 3914 text = text.replace(/\b___(\S[\s\S]*?)___\b/g, function (wm, txt) { 3915 return parseInside (txt, '<strong><em>', '</em></strong>'); 3916 }); 3917 text = text.replace(/\b__(\S[\s\S]*?)__\b/g, function (wm, txt) { 3918 return parseInside (txt, '<strong>', '</strong>'); 3919 }); 3920 text = text.replace(/\b_(\S[\s\S]*?)_\b/g, function (wm, txt) { 3921 return parseInside (txt, '<em>', '</em>'); 3922 }); 3923 } else { 3924 text = text.replace(/___(\S[\s\S]*?)___/g, function (wm, m) { 3925 return (/\S$/.test(m)) ? parseInside (m, '<strong><em>', '</em></strong>') : wm; 3926 }); 3927 text = text.replace(/__(\S[\s\S]*?)__/g, function (wm, m) { 3928 return (/\S$/.test(m)) ? parseInside (m, '<strong>', '</strong>') : wm; 3929 }); 3930 text = text.replace(/_([^\s_][\s\S]*?)_/g, function (wm, m) { 3931 // !/^_[^_]/.test(m) - test if it doesn't start with __ (since it seems redundant, we removed it) 3932 return (/\S$/.test(m)) ? parseInside (m, '<em>', '</em>') : wm; 3933 }); 3934 } 3935 3936 // Now parse asterisks 3937 if (options.literalMidWordAsterisks) { 3938 text = text.replace(/([^*]|^)\B\*\*\*(\S[\s\S]*?)\*\*\*\B(?!\*)/g, function (wm, lead, txt) { 3939 return parseInside (txt, lead + '<strong><em>', '</em></strong>'); 3940 }); 3941 text = text.replace(/([^*]|^)\B\*\*(\S[\s\S]*?)\*\*\B(?!\*)/g, function (wm, lead, txt) { 3942 return parseInside (txt, lead + '<strong>', '</strong>'); 3943 }); 3944 text = text.replace(/([^*]|^)\B\*(\S[\s\S]*?)\*\B(?!\*)/g, function (wm, lead, txt) { 3945 return parseInside (txt, lead + '<em>', '</em>'); 3946 }); 3947 } else { 3948 text = text.replace(/\*\*\*(\S[\s\S]*?)\*\*\*/g, function (wm, m) { 3949 return (/\S$/.test(m)) ? parseInside (m, '<strong><em>', '</em></strong>') : wm; 3950 }); 3951 text = text.replace(/\*\*(\S[\s\S]*?)\*\*/g, function (wm, m) { 3952 return (/\S$/.test(m)) ? parseInside (m, '<strong>', '</strong>') : wm; 3953 }); 3954 text = text.replace(/\*([^\s*][\s\S]*?)\*/g, function (wm, m) { 3955 // !/^\*[^*]/.test(m) - test if it doesn't start with ** (since it seems redundant, we removed it) 3956 return (/\S$/.test(m)) ? parseInside (m, '<em>', '</em>') : wm; 3957 }); 3958 } 3959 3960 3961 text = globals.converter._dispatch('italicsAndBold.after', text, options, globals); 3962 return text; 3963 }); 3964 3965 /** 3966 * Form HTML ordered (numbered) and unordered (bulleted) lists. 3967 */ 3968 showdown.subParser('lists', function (text, options, globals) { 3969 'use strict'; 3970 3971 /** 3972 * Process the contents of a single ordered or unordered list, splitting it 3973 * into individual list items. 3974 * @param {string} listStr 3975 * @param {boolean} trimTrailing 3976 * @returns {string} 3977 */ 3978 function processListItems (listStr, trimTrailing) { 3979 // The $g_list_level global keeps track of when we're inside a list. 3980 // Each time we enter a list, we increment it; when we leave a list, 3981 // we decrement. If it's zero, we're not in a list anymore. 3982 // 3983 // We do this because when we're not inside a list, we want to treat 3984 // something like this: 3985 // 3986 // I recommend upgrading to version 3987 // 8. Oops, now this line is treated 3988 // as a sub-list. 3989 // 3990 // As a single paragraph, despite the fact that the second line starts 3991 // with a digit-period-space sequence. 3992 // 3993 // Whereas when we're inside a list (or sub-list), that line will be 3994 // treated as the start of a sub-list. What a kludge, huh? This is 3995 // an aspect of Markdown's syntax that's hard to parse perfectly 3996 // without resorting to mind-reading. Perhaps the solution is to 3997 // change the syntax rules such that sub-lists must start with a 3998 // starting cardinal number; e.g. "1." or "a.". 3999 globals.gListLevel++; 4000 4001 // trim trailing blank lines: 4002 listStr = listStr.replace(/\n{2,}$/, '\n'); 4003 4004 // attacklab: add sentinel to emulate \z 4005 listStr += '¨0'; 4006 4007 var rgx = /(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0| {0,3}([*+-]|\d+[.])[ \t]+))/gm, 4008 isParagraphed = (/\n[ \t]*\n(?!¨0)/.test(listStr)); 4009 4010 // Since version 1.5, nesting sublists requires 4 spaces (or 1 tab) indentation, 4011 // which is a syntax breaking change 4012 // activating this option reverts to old behavior 4013 if (options.disableForced4SpacesIndentedSublists) { 4014 rgx = /(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0|\2([*+-]|\d+[.])[ \t]+))/gm; 4015 } 4016 4017 listStr = listStr.replace(rgx, function (wholeMatch, m1, m2, m3, m4, taskbtn, checked) { 4018 checked = (checked && checked.trim() !== ''); 4019 4020 var item = showdown.subParser('outdent')(m4, options, globals), 4021 bulletStyle = ''; 4022 4023 // Support for github tasklists 4024 if (taskbtn && options.tasklists) { 4025 bulletStyle = ' class="task-list-item" style="list-style-type: none;"'; 4026 item = item.replace(/^[ \t]*\[(x|X| )?]/m, function () { 4027 var otp = '<input type="checkbox" disabled style="margin: 0px 0.35em 0.25em -1.6em; vertical-align: middle;"'; 4028 if (checked) { 4029 otp += ' checked'; 4030 } 4031 otp += '>'; 4032 return otp; 4033 }); 4034 } 4035 4036 // ISSUE #312 4037 // This input: - - - a 4038 // causes trouble to the parser, since it interprets it as: 4039 // <ul><li><li><li>a</li></li></li></ul> 4040 // instead of: 4041 // <ul><li>- - a</li></ul> 4042 // So, to prevent it, we will put a marker (¨A)in the beginning of the line 4043 // Kind of hackish/monkey patching, but seems more effective than overcomplicating the list parser 4044 item = item.replace(/^([-*+]|\d\.)[ \t]+[\S\n ]*/g, function (wm2) { 4045 return '¨A' + wm2; 4046 }); 4047 4048 // m1 - Leading line or 4049 // Has a double return (multi paragraph) or 4050 // Has sublist 4051 if (m1 || (item.search(/\n{2,}/) > -1)) { 4052 item = showdown.subParser('githubCodeBlocks')(item, options, globals); 4053 item = showdown.subParser('blockGamut')(item, options, globals); 4054 } else { 4055 // Recursion for sub-lists: 4056 item = showdown.subParser('lists')(item, options, globals); 4057 item = item.replace(/\n$/, ''); // chomp(item) 4058 item = showdown.subParser('hashHTMLBlocks')(item, options, globals); 4059 4060 // Colapse double linebreaks 4061 item = item.replace(/\n\n+/g, '\n\n'); 4062 if (isParagraphed) { 4063 item = showdown.subParser('paragraphs')(item, options, globals); 4064 } else { 4065 item = showdown.subParser('spanGamut')(item, options, globals); 4066 } 4067 } 4068 4069 // now we need to remove the marker (¨A) 4070 item = item.replace('¨A', ''); 4071 // we can finally wrap the line in list item tags 4072 item = '<li' + bulletStyle + '>' + item + '</li>\n'; 4073 4074 return item; 4075 }); 4076 4077 // attacklab: strip sentinel 4078 listStr = listStr.replace(/¨0/g, ''); 4079 4080 globals.gListLevel--; 4081 4082 if (trimTrailing) { 4083 listStr = listStr.replace(/\s+$/, ''); 4084 } 4085 4086 return listStr; 4087 } 4088 4089 function styleStartNumber (list, listType) { 4090 // check if ol and starts by a number different than 1 4091 if (listType === 'ol') { 4092 var res = list.match(/^ *(\d+)\./); 4093 if (res && res[1] !== '1') { 4094 return ' start="' + res[1] + '"'; 4095 } 4096 } 4097 return ''; 4098 } 4099 4100 /** 4101 * Check and parse consecutive lists (better fix for issue #142) 4102 * @param {string} list 4103 * @param {string} listType 4104 * @param {boolean} trimTrailing 4105 * @returns {string} 4106 */ 4107 function parseConsecutiveLists (list, listType, trimTrailing) { 4108 // check if we caught 2 or more consecutive lists by mistake 4109 // we use the counterRgx, meaning if listType is UL we look for OL and vice versa 4110 var olRgx = (options.disableForced4SpacesIndentedSublists) ? /^ ?\d+\.[ \t]/gm : /^ {0,3}\d+\.[ \t]/gm, 4111 ulRgx = (options.disableForced4SpacesIndentedSublists) ? /^ ?[*+-][ \t]/gm : /^ {0,3}[*+-][ \t]/gm, 4112 counterRxg = (listType === 'ul') ? olRgx : ulRgx, 4113 result = ''; 4114 4115 if (list.search(counterRxg) !== -1) { 4116 (function parseCL (txt) { 4117 var pos = txt.search(counterRxg), 4118 style = styleStartNumber(list, listType); 4119 if (pos !== -1) { 4120 // slice 4121 result += '\n\n<' + listType + style + '>\n' + processListItems(txt.slice(0, pos), !!trimTrailing) + '</' + listType + '>\n'; 4122 4123 // invert counterType and listType 4124 listType = (listType === 'ul') ? 'ol' : 'ul'; 4125 counterRxg = (listType === 'ul') ? olRgx : ulRgx; 4126 4127 //recurse 4128 parseCL(txt.slice(pos)); 4129 } else { 4130 result += '\n\n<' + listType + style + '>\n' + processListItems(txt, !!trimTrailing) + '</' + listType + '>\n'; 4131 } 4132 })(list); 4133 } else { 4134 var style = styleStartNumber(list, listType); 4135 result = '\n\n<' + listType + style + '>\n' + processListItems(list, !!trimTrailing) + '</' + listType + '>\n'; 4136 } 4137 4138 return result; 4139 } 4140 4141 /** Start of list parsing **/ 4142 text = globals.converter._dispatch('lists.before', text, options, globals); 4143 // add sentinel to hack around khtml/safari bug: 4144 // http://bugs.webkit.org/show_bug.cgi?id=11231 4145 text += '¨0'; 4146 4147 if (globals.gListLevel) { 4148 text = text.replace(/^(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm, 4149 function (wholeMatch, list, m2) { 4150 var listType = (m2.search(/[*+-]/g) > -1) ? 'ul' : 'ol'; 4151 return parseConsecutiveLists(list, listType, true); 4152 } 4153 ); 4154 } else { 4155 text = text.replace(/(\n\n|^\n?)(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm, 4156 function (wholeMatch, m1, list, m3) { 4157 var listType = (m3.search(/[*+-]/g) > -1) ? 'ul' : 'ol'; 4158 return parseConsecutiveLists(list, listType, false); 4159 } 4160 ); 4161 } 4162 4163 // strip sentinel 4164 text = text.replace(/¨0/, ''); 4165 text = globals.converter._dispatch('lists.after', text, options, globals); 4166 return text; 4167 }); 4168 4169 /** 4170 * Parse metadata at the top of the document 4171 */ 4172 showdown.subParser('metadata', function (text, options, globals) { 4173 'use strict'; 4174 4175 if (!options.metadata) { 4176 return text; 4177 } 4178 4179 text = globals.converter._dispatch('metadata.before', text, options, globals); 4180 4181 function parseMetadataContents (content) { 4182 // raw is raw so it's not changed in any way 4183 globals.metadata.raw = content; 4184 4185 // escape chars forbidden in html attributes 4186 // double quotes 4187 content = content 4188 // ampersand first 4189 .replace(/&/g, '&') 4190 // double quotes 4191 .replace(/"/g, '"'); 4192 4193 content = content.replace(/\n {4}/g, ' '); 4194 content.replace(/^([\S ]+): +([\s\S]+?)$/gm, function (wm, key, value) { 4195 globals.metadata.parsed[key] = value; 4196 return ''; 4197 }); 4198 } 4199 4200 text = text.replace(/^\s*«««+(\S*?)\n([\s\S]+?)\n»»»+\n/, function (wholematch, format, content) { 4201 parseMetadataContents(content); 4202 return '¨M'; 4203 }); 4204 4205 text = text.replace(/^\s*---+(\S*?)\n([\s\S]+?)\n---+\n/, function (wholematch, format, content) { 4206 if (format) { 4207 globals.metadata.format = format; 4208 } 4209 parseMetadataContents(content); 4210 return '¨M'; 4211 }); 4212 4213 text = text.replace(/¨M/g, ''); 4214 4215 text = globals.converter._dispatch('metadata.after', text, options, globals); 4216 return text; 4217 }); 4218 4219 /** 4220 * Remove one level of line-leading tabs or spaces 4221 */ 4222 showdown.subParser('outdent', function (text, options, globals) { 4223 'use strict'; 4224 text = globals.converter._dispatch('outdent.before', text, options, globals); 4225 4226 // attacklab: hack around Konqueror 3.5.4 bug: 4227 // "----------bug".replace(/^-/g,"") == "bug" 4228 text = text.replace(/^(\t|[ ]{1,4})/gm, '¨0'); // attacklab: g_tab_width 4229 4230 // attacklab: clean up hack 4231 text = text.replace(/¨0/g, ''); 4232 4233 text = globals.converter._dispatch('outdent.after', text, options, globals); 4234 return text; 4235 }); 4236 4237 /** 4238 * 4239 */ 4240 showdown.subParser('paragraphs', function (text, options, globals) { 4241 'use strict'; 4242 4243 text = globals.converter._dispatch('paragraphs.before', text, options, globals); 4244 // Strip leading and trailing lines: 4245 text = text.replace(/^\n+/g, ''); 4246 text = text.replace(/\n+$/g, ''); 4247 4248 var grafs = text.split(/\n{2,}/g), 4249 grafsOut = [], 4250 end = grafs.length; // Wrap <p> tags 4251 4252 for (var i = 0; i < end; i++) { 4253 var str = grafs[i]; 4254 // if this is an HTML marker, copy it 4255 if (str.search(/¨(K|G)(\d+)\1/g) >= 0) { 4256 grafsOut.push(str); 4257 4258 // test for presence of characters to prevent empty lines being parsed 4259 // as paragraphs (resulting in undesired extra empty paragraphs) 4260 } else if (str.search(/\S/) >= 0) { 4261 str = showdown.subParser('spanGamut')(str, options, globals); 4262 str = str.replace(/^([ \t]*)/g, '<p>'); 4263 str += '</p>'; 4264 grafsOut.push(str); 4265 } 4266 } 4267 4268 /** Unhashify HTML blocks */ 4269 end = grafsOut.length; 4270 for (i = 0; i < end; i++) { 4271 var blockText = '', 4272 grafsOutIt = grafsOut[i], 4273 codeFlag = false; 4274 // if this is a marker for an html block... 4275 // use RegExp.test instead of string.search because of QML bug 4276 while (/¨(K|G)(\d+)\1/.test(grafsOutIt)) { 4277 var delim = RegExp.$1, 4278 num = RegExp.$2; 4279 4280 if (delim === 'K') { 4281 blockText = globals.gHtmlBlocks[num]; 4282 } else { 4283 // we need to check if ghBlock is a false positive 4284 if (codeFlag) { 4285 // use encoded version of all text 4286 blockText = showdown.subParser('encodeCode')(globals.ghCodeBlocks[num].text, options, globals); 4287 } else { 4288 blockText = globals.ghCodeBlocks[num].codeblock; 4289 } 4290 } 4291 blockText = blockText.replace(/\$/g, '$$$$'); // Escape any dollar signs 4292 4293 grafsOutIt = grafsOutIt.replace(/(\n\n)?¨(K|G)\d+\2(\n\n)?/, blockText); 4294 // Check if grafsOutIt is a pre->code 4295 if (/^<pre\b[^>]*>\s*<code\b[^>]*>/.test(grafsOutIt)) { 4296 codeFlag = true; 4297 } 4298 } 4299 grafsOut[i] = grafsOutIt; 4300 } 4301 text = grafsOut.join('\n'); 4302 // Strip leading and trailing lines: 4303 text = text.replace(/^\n+/g, ''); 4304 text = text.replace(/\n+$/g, ''); 4305 return globals.converter._dispatch('paragraphs.after', text, options, globals); 4306 }); 4307 4308 /** 4309 * Run extension 4310 */ 4311 showdown.subParser('runExtension', function (ext, text, options, globals) { 4312 'use strict'; 4313 4314 if (ext.filter) { 4315 text = ext.filter(text, globals.converter, options); 4316 4317 } else if (ext.regex) { 4318 // TODO remove this when old extension loading mechanism is deprecated 4319 var re = ext.regex; 4320 if (!(re instanceof RegExp)) { 4321 re = new RegExp(re, 'g'); 4322 } 4323 text = text.replace(re, ext.replace); 4324 } 4325 4326 return text; 4327 }); 4328 4329 /** 4330 * These are all the transformations that occur *within* block-level 4331 * tags like paragraphs, headers, and list items. 4332 */ 4333 showdown.subParser('spanGamut', function (text, options, globals) { 4334 'use strict'; 4335 4336 text = globals.converter._dispatch('spanGamut.before', text, options, globals); 4337 text = showdown.subParser('codeSpans')(text, options, globals); 4338 text = showdown.subParser('escapeSpecialCharsWithinTagAttributes')(text, options, globals); 4339 text = showdown.subParser('encodeBackslashEscapes')(text, options, globals); 4340 4341 // Process anchor and image tags. Images must come first, 4342 // because ![foo][f] looks like an anchor. 4343 text = showdown.subParser('images')(text, options, globals); 4344 text = showdown.subParser('anchors')(text, options, globals); 4345 4346 // Make links out of things like `<http://example.com/>` 4347 // Must come after anchors, because you can use < and > 4348 // delimiters in inline links like [this](<url>). 4349 text = showdown.subParser('autoLinks')(text, options, globals); 4350 text = showdown.subParser('simplifiedAutoLinks')(text, options, globals); 4351 text = showdown.subParser('emoji')(text, options, globals); 4352 text = showdown.subParser('underline')(text, options, globals); 4353 text = showdown.subParser('italicsAndBold')(text, options, globals); 4354 text = showdown.subParser('strikethrough')(text, options, globals); 4355 text = showdown.subParser('ellipsis')(text, options, globals); 4356 4357 // we need to hash HTML tags inside spans 4358 text = showdown.subParser('hashHTMLSpans')(text, options, globals); 4359 4360 // now we encode amps and angles 4361 text = showdown.subParser('encodeAmpsAndAngles')(text, options, globals); 4362 4363 // Do hard breaks 4364 if (options.simpleLineBreaks) { 4365 // GFM style hard breaks 4366 // only add line breaks if the text does not contain a block (special case for lists) 4367 if (!/\n\n¨K/.test(text)) { 4368 text = text.replace(/\n+/g, '<br />\n'); 4369 } 4370 } else { 4371 // Vanilla hard breaks 4372 text = text.replace(/ +\n/g, '<br />\n'); 4373 } 4374 4375 text = globals.converter._dispatch('spanGamut.after', text, options, globals); 4376 return text; 4377 }); 4378 4379 showdown.subParser('strikethrough', function (text, options, globals) { 4380 'use strict'; 4381 4382 function parseInside (txt) { 4383 if (options.simplifiedAutoLink) { 4384 txt = showdown.subParser('simplifiedAutoLinks')(txt, options, globals); 4385 } 4386 return '<del>' + txt + '</del>'; 4387 } 4388 4389 if (options.strikethrough) { 4390 text = globals.converter._dispatch('strikethrough.before', text, options, globals); 4391 text = text.replace(/(?:~){2}([\s\S]+?)(?:~){2}/g, function (wm, txt) { return parseInside(txt); }); 4392 text = globals.converter._dispatch('strikethrough.after', text, options, globals); 4393 } 4394 4395 return text; 4396 }); 4397 4398 /** 4399 * Strips link definitions from text, stores the URLs and titles in 4400 * hash references. 4401 * Link defs are in the form: ^[id]: url "optional title" 4402 */ 4403 showdown.subParser('stripLinkDefinitions', function (text, options, globals) { 4404 'use strict'; 4405 4406 var regex = /^ {0,3}\[(.+)]:[ \t]*\n?[ \t]*<?([^>\s]+)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n+|(?=¨0))/gm, 4407 base64Regex = /^ {0,3}\[(.+)]:[ \t]*\n?[ \t]*<?(data:.+?\/.+?;base64,[A-Za-z0-9+/=\n]+?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n\n|(?=¨0)|(?=\n\[))/gm; 4408 4409 // attacklab: sentinel workarounds for lack of \A and \Z, safari\khtml bug 4410 text += '¨0'; 4411 4412 var replaceFunc = function (wholeMatch, linkId, url, width, height, blankLines, title) { 4413 linkId = linkId.toLowerCase(); 4414 if (url.match(/^data:.+?\/.+?;base64,/)) { 4415 // remove newlines 4416 globals.gUrls[linkId] = url.replace(/\s/g, ''); 4417 } else { 4418 globals.gUrls[linkId] = showdown.subParser('encodeAmpsAndAngles')(url, options, globals); // Link IDs are case-insensitive 4419 } 4420 4421 if (blankLines) { 4422 // Oops, found blank lines, so it's not a title. 4423 // Put back the parenthetical statement we stole. 4424 return blankLines + title; 4425 4426 } else { 4427 if (title) { 4428 globals.gTitles[linkId] = title.replace(/"|'/g, '"'); 4429 } 4430 if (options.parseImgDimensions && width && height) { 4431 globals.gDimensions[linkId] = { 4432 width: width, 4433 height: height 4434 }; 4435 } 4436 } 4437 // Completely remove the definition from the text 4438 return ''; 4439 }; 4440 4441 // first we try to find base64 link references 4442 text = text.replace(base64Regex, replaceFunc); 4443 4444 text = text.replace(regex, replaceFunc); 4445 4446 // attacklab: strip sentinel 4447 text = text.replace(/¨0/, ''); 4448 4449 return text; 4450 }); 4451 4452 showdown.subParser('tables', function (text, options, globals) { 4453 'use strict'; 4454 4455 if (!options.tables) { 4456 return text; 4457 } 4458 4459 var tableRgx = /^ {0,3}\|?.+\|.+\n {0,3}\|?[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*:?[ \t]*(?:[-=]){2,}[\s\S]+?(?:\n\n|¨0)/gm, 4460 //singeColTblRgx = /^ {0,3}\|.+\|\n {0,3}\|[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*\n(?: {0,3}\|.+\|\n)+(?:\n\n|¨0)/gm; 4461 singeColTblRgx = /^ {0,3}\|.+\|[ \t]*\n {0,3}\|[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*\n( {0,3}\|.+\|[ \t]*\n)*(?:\n|¨0)/gm; 4462 4463 function parseStyles (sLine) { 4464 if (/^:[ \t]*--*$/.test(sLine)) { 4465 return ' style="text-align:left;"'; 4466 } else if (/^--*[ \t]*:[ \t]*$/.test(sLine)) { 4467 return ' style="text-align:right;"'; 4468 } else if (/^:[ \t]*--*[ \t]*:$/.test(sLine)) { 4469 return ' style="text-align:center;"'; 4470 } else { 4471 return ''; 4472 } 4473 } 4474 4475 function parseHeaders (header, style) { 4476 var id = ''; 4477 header = header.trim(); 4478 // support both tablesHeaderId and tableHeaderId due to error in documentation so we don't break backwards compatibility 4479 if (options.tablesHeaderId || options.tableHeaderId) { 4480 id = ' id="' + header.replace(/ /g, '_').toLowerCase() + '"'; 4481 } 4482 header = showdown.subParser('spanGamut')(header, options, globals); 4483 4484 return '<th' + id + style + '>' + header + '</th>\n'; 4485 } 4486 4487 function parseCells (cell, style) { 4488 var subText = showdown.subParser('spanGamut')(cell, options, globals); 4489 return '<td' + style + '>' + subText + '</td>\n'; 4490 } 4491 4492 function buildTable (headers, cells) { 4493 var tb = '<table>\n<thead>\n<tr>\n', 4494 tblLgn = headers.length; 4495 4496 for (var i = 0; i < tblLgn; ++i) { 4497 tb += headers[i]; 4498 } 4499 tb += '</tr>\n</thead>\n<tbody>\n'; 4500 4501 for (i = 0; i < cells.length; ++i) { 4502 tb += '<tr>\n'; 4503 for (var ii = 0; ii < tblLgn; ++ii) { 4504 tb += cells[i][ii]; 4505 } 4506 tb += '</tr>\n'; 4507 } 4508 tb += '</tbody>\n</table>\n'; 4509 return tb; 4510 } 4511 4512 function parseTable (rawTable) { 4513 var i, tableLines = rawTable.split('\n'); 4514 4515 for (i = 0; i < tableLines.length; ++i) { 4516 // strip wrong first and last column if wrapped tables are used 4517 if (/^ {0,3}\|/.test(tableLines[i])) { 4518 tableLines[i] = tableLines[i].replace(/^ {0,3}\|/, ''); 4519 } 4520 if (/\|[ \t]*$/.test(tableLines[i])) { 4521 tableLines[i] = tableLines[i].replace(/\|[ \t]*$/, ''); 4522 } 4523 // parse code spans first, but we only support one line code spans 4524 tableLines[i] = showdown.subParser('codeSpans')(tableLines[i], options, globals); 4525 } 4526 4527 var rawHeaders = tableLines[0].split('|').map(function (s) { return s.trim();}), 4528 rawStyles = tableLines[1].split('|').map(function (s) { return s.trim();}), 4529 rawCells = [], 4530 headers = [], 4531 styles = [], 4532 cells = []; 4533 4534 tableLines.shift(); 4535 tableLines.shift(); 4536 4537 for (i = 0; i < tableLines.length; ++i) { 4538 if (tableLines[i].trim() === '') { 4539 continue; 4540 } 4541 rawCells.push( 4542 tableLines[i] 4543 .split('|') 4544 .map(function (s) { 4545 return s.trim(); 4546 }) 4547 ); 4548 } 4549 4550 if (rawHeaders.length < rawStyles.length) { 4551 return rawTable; 4552 } 4553 4554 for (i = 0; i < rawStyles.length; ++i) { 4555 styles.push(parseStyles(rawStyles[i])); 4556 } 4557 4558 for (i = 0; i < rawHeaders.length; ++i) { 4559 if (showdown.helper.isUndefined(styles[i])) { 4560 styles[i] = ''; 4561 } 4562 headers.push(parseHeaders(rawHeaders[i], styles[i])); 4563 } 4564 4565 for (i = 0; i < rawCells.length; ++i) { 4566 var row = []; 4567 for (var ii = 0; ii < headers.length; ++ii) { 4568 if (showdown.helper.isUndefined(rawCells[i][ii])) { 4569 4570 } 4571 row.push(parseCells(rawCells[i][ii], styles[ii])); 4572 } 4573 cells.push(row); 4574 } 4575 4576 return buildTable(headers, cells); 4577 } 4578 4579 text = globals.converter._dispatch('tables.before', text, options, globals); 4580 4581 // find escaped pipe characters 4582 text = text.replace(/\\(\|)/g, showdown.helper.escapeCharactersCallback); 4583 4584 // parse multi column tables 4585 text = text.replace(tableRgx, parseTable); 4586 4587 // parse one column tables 4588 text = text.replace(singeColTblRgx, parseTable); 4589 4590 text = globals.converter._dispatch('tables.after', text, options, globals); 4591 4592 return text; 4593 }); 4594 4595 showdown.subParser('underline', function (text, options, globals) { 4596 'use strict'; 4597 4598 if (!options.underline) { 4599 return text; 4600 } 4601 4602 text = globals.converter._dispatch('underline.before', text, options, globals); 4603 4604 if (options.literalMidWordUnderscores) { 4605 text = text.replace(/\b___(\S[\s\S]*?)___\b/g, function (wm, txt) { 4606 return '<u>' + txt + '</u>'; 4607 }); 4608 text = text.replace(/\b__(\S[\s\S]*?)__\b/g, function (wm, txt) { 4609 return '<u>' + txt + '</u>'; 4610 }); 4611 } else { 4612 text = text.replace(/___(\S[\s\S]*?)___/g, function (wm, m) { 4613 return (/\S$/.test(m)) ? '<u>' + m + '</u>' : wm; 4614 }); 4615 text = text.replace(/__(\S[\s\S]*?)__/g, function (wm, m) { 4616 return (/\S$/.test(m)) ? '<u>' + m + '</u>' : wm; 4617 }); 4618 } 4619 4620 // escape remaining underscores to prevent them being parsed by italic and bold 4621 text = text.replace(/(_)/g, showdown.helper.escapeCharactersCallback); 4622 4623 text = globals.converter._dispatch('underline.after', text, options, globals); 4624 4625 return text; 4626 }); 4627 4628 /** 4629 * Swap back in all the special characters we've hidden. 4630 */ 4631 showdown.subParser('unescapeSpecialChars', function (text, options, globals) { 4632 'use strict'; 4633 text = globals.converter._dispatch('unescapeSpecialChars.before', text, options, globals); 4634 4635 text = text.replace(/¨E(\d+)E/g, function (wholeMatch, m1) { 4636 var charCodeToReplace = parseInt(m1); 4637 return String.fromCharCode(charCodeToReplace); 4638 }); 4639 4640 text = globals.converter._dispatch('unescapeSpecialChars.after', text, options, globals); 4641 return text; 4642 }); 4643 4644 showdown.subParser('makeMarkdown.blockquote', function (node, globals) { 4645 'use strict'; 4646 4647 var txt = ''; 4648 if (node.hasChildNodes()) { 4649 var children = node.childNodes, 4650 childrenLength = children.length; 4651 4652 for (var i = 0; i < childrenLength; ++i) { 4653 var innerTxt = showdown.subParser('makeMarkdown.node')(children[i], globals); 4654 4655 if (innerTxt === '') { 4656 continue; 4657 } 4658 txt += innerTxt; 4659 } 4660 } 4661 // cleanup 4662 txt = txt.trim(); 4663 txt = '> ' + txt.split('\n').join('\n> '); 4664 return txt; 4665 }); 4666 4667 showdown.subParser('makeMarkdown.codeBlock', function (node, globals) { 4668 'use strict'; 4669 4670 var lang = node.getAttribute('language'), 4671 num = node.getAttribute('precodenum'); 4672 return '```' + lang + '\n' + globals.preList[num] + '\n```'; 4673 }); 4674 4675 showdown.subParser('makeMarkdown.codeSpan', function (node) { 4676 'use strict'; 4677 4678 return '`' + node.innerHTML + '`'; 4679 }); 4680 4681 showdown.subParser('makeMarkdown.emphasis', function (node, globals) { 4682 'use strict'; 4683 4684 var txt = ''; 4685 if (node.hasChildNodes()) { 4686 txt += '*'; 4687 var children = node.childNodes, 4688 childrenLength = children.length; 4689 for (var i = 0; i < childrenLength; ++i) { 4690 txt += showdown.subParser('makeMarkdown.node')(children[i], globals); 4691 } 4692 txt += '*'; 4693 } 4694 return txt; 4695 }); 4696 4697 showdown.subParser('makeMarkdown.header', function (node, globals, headerLevel) { 4698 'use strict'; 4699 4700 var headerMark = new Array(headerLevel + 1).join('#'), 4701 txt = ''; 4702 4703 if (node.hasChildNodes()) { 4704 txt = headerMark + ' '; 4705 var children = node.childNodes, 4706 childrenLength = children.length; 4707 4708 for (var i = 0; i < childrenLength; ++i) { 4709 txt += showdown.subParser('makeMarkdown.node')(children[i], globals); 4710 } 4711 } 4712 return txt; 4713 }); 4714 4715 showdown.subParser('makeMarkdown.hr', function () { 4716 'use strict'; 4717 4718 return '---'; 4719 }); 4720 4721 showdown.subParser('makeMarkdown.image', function (node) { 4722 'use strict'; 4723 4724 var txt = ''; 4725 if (node.hasAttribute('src')) { 4726 txt += ' + '>'; 4728 if (node.hasAttribute('width') && node.hasAttribute('height')) { 4729 txt += ' =' + node.getAttribute('width') + 'x' + node.getAttribute('height'); 4730 } 4731 4732 if (node.hasAttribute('title')) { 4733 txt += ' "' + node.getAttribute('title') + '"'; 4734 } 4735 txt += ')'; 4736 } 4737 return txt; 4738 }); 4739 4740 showdown.subParser('makeMarkdown.links', function (node, globals) { 4741 'use strict'; 4742 4743 var txt = ''; 4744 if (node.hasChildNodes() && node.hasAttribute('href')) { 4745 var children = node.childNodes, 4746 childrenLength = children.length; 4747 txt = '['; 4748 for (var i = 0; i < childrenLength; ++i) { 4749 txt += showdown.subParser('makeMarkdown.node')(children[i], globals); 4750 } 4751 txt += ']('; 4752 txt += '<' + node.getAttribute('href') + '>'; 4753 if (node.hasAttribute('title')) { 4754 txt += ' "' + node.getAttribute('title') + '"'; 4755 } 4756 txt += ')'; 4757 } 4758 return txt; 4759 }); 4760 4761 showdown.subParser('makeMarkdown.list', function (node, globals, type) { 4762 'use strict'; 4763 4764 var txt = ''; 4765 if (!node.hasChildNodes()) { 4766 return ''; 4767 } 4768 var listItems = node.childNodes, 4769 listItemsLenght = listItems.length, 4770 listNum = node.getAttribute('start') || 1; 4771 4772 for (var i = 0; i < listItemsLenght; ++i) { 4773 if (typeof listItems[i].tagName === 'undefined' || listItems[i].tagName.toLowerCase() !== 'li') { 4774 continue; 4775 } 4776 4777 // define the bullet to use in list 4778 var bullet = ''; 4779 if (type === 'ol') { 4780 bullet = listNum.toString() + '. '; 4781 } else { 4782 bullet = '- '; 4783 } 4784 4785 // parse list item 4786 txt += bullet + showdown.subParser('makeMarkdown.listItem')(listItems[i], globals); 4787 ++listNum; 4788 } 4789 4790 // add comment at the end to prevent consecutive lists to be parsed as one 4791 txt += '\n<!-- -->\n'; 4792 return txt.trim(); 4793 }); 4794 4795 showdown.subParser('makeMarkdown.listItem', function (node, globals) { 4796 'use strict'; 4797 4798 var listItemTxt = ''; 4799 4800 var children = node.childNodes, 4801 childrenLenght = children.length; 4802 4803 for (var i = 0; i < childrenLenght; ++i) { 4804 listItemTxt += showdown.subParser('makeMarkdown.node')(children[i], globals); 4805 } 4806 // if it's only one liner, we need to add a newline at the end 4807 if (!/\n$/.test(listItemTxt)) { 4808 listItemTxt += '\n'; 4809 } else { 4810 // it's multiparagraph, so we need to indent 4811 listItemTxt = listItemTxt 4812 .split('\n') 4813 .join('\n ') 4814 .replace(/^ {4}$/gm, '') 4815 .replace(/\n\n+/g, '\n\n'); 4816 } 4817 4818 return listItemTxt; 4819 }); 4820 4821 4822 4823 showdown.subParser('makeMarkdown.node', function (node, globals, spansOnly) { 4824 'use strict'; 4825 4826 spansOnly = spansOnly || false; 4827 4828 var txt = ''; 4829 4830 // edge case of text without wrapper paragraph 4831 if (node.nodeType === 3) { 4832 return showdown.subParser('makeMarkdown.txt')(node, globals); 4833 } 4834 4835 // HTML comment 4836 if (node.nodeType === 8) { 4837 return '<!--' + node.data + '-->\n\n'; 4838 } 4839 4840 // process only node elements 4841 if (node.nodeType !== 1) { 4842 return ''; 4843 } 4844 4845 var tagName = node.tagName.toLowerCase(); 4846 4847 switch (tagName) { 4848 4849 // 4850 // BLOCKS 4851 // 4852 case 'h1': 4853 if (!spansOnly) { txt = showdown.subParser('makeMarkdown.header')(node, globals, 1) + '\n\n'; } 4854 break; 4855 case 'h2': 4856 if (!spansOnly) { txt = showdown.subParser('makeMarkdown.header')(node, globals, 2) + '\n\n'; } 4857 break; 4858 case 'h3': 4859 if (!spansOnly) { txt = showdown.subParser('makeMarkdown.header')(node, globals, 3) + '\n\n'; } 4860 break; 4861 case 'h4': 4862 if (!spansOnly) { txt = showdown.subParser('makeMarkdown.header')(node, globals, 4) + '\n\n'; } 4863 break; 4864 case 'h5': 4865 if (!spansOnly) { txt = showdown.subParser('makeMarkdown.header')(node, globals, 5) + '\n\n'; } 4866 break; 4867 case 'h6': 4868 if (!spansOnly) { txt = showdown.subParser('makeMarkdown.header')(node, globals, 6) + '\n\n'; } 4869 break; 4870 4871 case 'p': 4872 if (!spansOnly) { txt = showdown.subParser('makeMarkdown.paragraph')(node, globals) + '\n\n'; } 4873 break; 4874 4875 case 'blockquote': 4876 if (!spansOnly) { txt = showdown.subParser('makeMarkdown.blockquote')(node, globals) + '\n\n'; } 4877 break; 4878 4879 case 'hr': 4880 if (!spansOnly) { txt = showdown.subParser('makeMarkdown.hr')(node, globals) + '\n\n'; } 4881 break; 4882 4883 case 'ol': 4884 if (!spansOnly) { txt = showdown.subParser('makeMarkdown.list')(node, globals, 'ol') + '\n\n'; } 4885 break; 4886 4887 case 'ul': 4888 if (!spansOnly) { txt = showdown.subParser('makeMarkdown.list')(node, globals, 'ul') + '\n\n'; } 4889 break; 4890 4891 case 'precode': 4892 if (!spansOnly) { txt = showdown.subParser('makeMarkdown.codeBlock')(node, globals) + '\n\n'; } 4893 break; 4894 4895 case 'pre': 4896 if (!spansOnly) { txt = showdown.subParser('makeMarkdown.pre')(node, globals) + '\n\n'; } 4897 break; 4898 4899 case 'table': 4900 if (!spansOnly) { txt = showdown.subParser('makeMarkdown.table')(node, globals) + '\n\n'; } 4901 break; 4902 4903 // 4904 // SPANS 4905 // 4906 case 'code': 4907 txt = showdown.subParser('makeMarkdown.codeSpan')(node, globals); 4908 break; 4909 4910 case 'em': 4911 case 'i': 4912 txt = showdown.subParser('makeMarkdown.emphasis')(node, globals); 4913 break; 4914 4915 case 'strong': 4916 case 'b': 4917 txt = showdown.subParser('makeMarkdown.strong')(node, globals); 4918 break; 4919 4920 case 'del': 4921 txt = showdown.subParser('makeMarkdown.strikethrough')(node, globals); 4922 break; 4923 4924 case 'a': 4925 txt = showdown.subParser('makeMarkdown.links')(node, globals); 4926 break; 4927 4928 case 'img': 4929 txt = showdown.subParser('makeMarkdown.image')(node, globals); 4930 break; 4931 4932 default: 4933 txt = node.outerHTML + '\n\n'; 4934 } 4935 4936 // common normalization 4937 // TODO eventually 4938 4939 return txt; 4940 }); 4941 4942 showdown.subParser('makeMarkdown.paragraph', function (node, globals) { 4943 'use strict'; 4944 4945 var txt = ''; 4946 if (node.hasChildNodes()) { 4947 var children = node.childNodes, 4948 childrenLength = children.length; 4949 for (var i = 0; i < childrenLength; ++i) { 4950 txt += showdown.subParser('makeMarkdown.node')(children[i], globals); 4951 } 4952 } 4953 4954 // some text normalization 4955 txt = txt.trim(); 4956 4957 return txt; 4958 }); 4959 4960 showdown.subParser('makeMarkdown.pre', function (node, globals) { 4961 'use strict'; 4962 4963 var num = node.getAttribute('prenum'); 4964 return '<pre>' + globals.preList[num] + '</pre>'; 4965 }); 4966 4967 showdown.subParser('makeMarkdown.strikethrough', function (node, globals) { 4968 'use strict'; 4969 4970 var txt = ''; 4971 if (node.hasChildNodes()) { 4972 txt += '~~'; 4973 var children = node.childNodes, 4974 childrenLength = children.length; 4975 for (var i = 0; i < childrenLength; ++i) { 4976 txt += showdown.subParser('makeMarkdown.node')(children[i], globals); 4977 } 4978 txt += '~~'; 4979 } 4980 return txt; 4981 }); 4982 4983 showdown.subParser('makeMarkdown.strong', function (node, globals) { 4984 'use strict'; 4985 4986 var txt = ''; 4987 if (node.hasChildNodes()) { 4988 txt += '**'; 4989 var children = node.childNodes, 4990 childrenLength = children.length; 4991 for (var i = 0; i < childrenLength; ++i) { 4992 txt += showdown.subParser('makeMarkdown.node')(children[i], globals); 4993 } 4994 txt += '**'; 4995 } 4996 return txt; 4997 }); 4998 4999 showdown.subParser('makeMarkdown.table', function (node, globals) { 5000 'use strict'; 5001 5002 var txt = '', 5003 tableArray = [[], []], 5004 headings = node.querySelectorAll('thead>tr>th'), 5005 rows = node.querySelectorAll('tbody>tr'), 5006 i, ii; 5007 for (i = 0; i < headings.length; ++i) { 5008 var headContent = showdown.subParser('makeMarkdown.tableCell')(headings[i], globals), 5009 allign = '---'; 5010 5011 if (headings[i].hasAttribute('style')) { 5012 var style = headings[i].getAttribute('style').toLowerCase().replace(/\s/g, ''); 5013 switch (style) { 5014 case 'text-align:left;': 5015 allign = ':---'; 5016 break; 5017 case 'text-align:right;': 5018 allign = '---:'; 5019 break; 5020 case 'text-align:center;': 5021 allign = ':---:'; 5022 break; 5023 } 5024 } 5025 tableArray[0][i] = headContent.trim(); 5026 tableArray[1][i] = allign; 5027 } 5028 5029 for (i = 0; i < rows.length; ++i) { 5030 var r = tableArray.push([]) - 1, 5031 cols = rows[i].getElementsByTagName('td'); 5032 5033 for (ii = 0; ii < headings.length; ++ii) { 5034 var cellContent = ' '; 5035 if (typeof cols[ii] !== 'undefined') { 5036 cellContent = showdown.subParser('makeMarkdown.tableCell')(cols[ii], globals); 5037 } 5038 tableArray[r].push(cellContent); 5039 } 5040 } 5041 5042 var cellSpacesCount = 3; 5043 for (i = 0; i < tableArray.length; ++i) { 5044 for (ii = 0; ii < tableArray[i].length; ++ii) { 5045 var strLen = tableArray[i][ii].length; 5046 if (strLen > cellSpacesCount) { 5047 cellSpacesCount = strLen; 5048 } 5049 } 5050 } 5051 5052 for (i = 0; i < tableArray.length; ++i) { 5053 for (ii = 0; ii < tableArray[i].length; ++ii) { 5054 if (i === 1) { 5055 if (tableArray[i][ii].slice(-1) === ':') { 5056 tableArray[i][ii] = showdown.helper.padEnd(tableArray[i][ii].slice(-1), cellSpacesCount - 1, '-') + ':'; 5057 } else { 5058 tableArray[i][ii] = showdown.helper.padEnd(tableArray[i][ii], cellSpacesCount, '-'); 5059 } 5060 } else { 5061 tableArray[i][ii] = showdown.helper.padEnd(tableArray[i][ii], cellSpacesCount); 5062 } 5063 } 5064 txt += '| ' + tableArray[i].join(' | ') + ' |\n'; 5065 } 5066 5067 return txt.trim(); 5068 }); 5069 5070 showdown.subParser('makeMarkdown.tableCell', function (node, globals) { 5071 'use strict'; 5072 5073 var txt = ''; 5074 if (!node.hasChildNodes()) { 5075 return ''; 5076 } 5077 var children = node.childNodes, 5078 childrenLength = children.length; 5079 5080 for (var i = 0; i < childrenLength; ++i) { 5081 txt += showdown.subParser('makeMarkdown.node')(children[i], globals, true); 5082 } 5083 return txt.trim(); 5084 }); 5085 5086 showdown.subParser('makeMarkdown.txt', function (node) { 5087 'use strict'; 5088 5089 var txt = node.nodeValue; 5090 5091 // multiple spaces are collapsed 5092 txt = txt.replace(/ +/g, ' '); 5093 5094 // replace the custom ¨NBSP; with a space 5095 txt = txt.replace(/¨NBSP;/g, ' '); 5096 5097 // ", <, > and & should replace escaped html entities 5098 txt = showdown.helper.unescapeHTMLEntities(txt); 5099 5100 // escape markdown magic characters 5101 // emphasis, strong and strikethrough - can appear everywhere 5102 // we also escape pipe (|) because of tables 5103 // and escape ` because of code blocks and spans 5104 txt = txt.replace(/([*_~|`])/g, '\\$1'); 5105 5106 // escape > because of blockquotes 5107 txt = txt.replace(/^(\s*)>/g, '\\$1>'); 5108 5109 // hash character, only troublesome at the beginning of a line because of headers 5110 txt = txt.replace(/^#/gm, '\\#'); 5111 5112 // horizontal rules 5113 txt = txt.replace(/^(\s*)([-=]{3,})(\s*)$/, '$1\\$2$3'); 5114 5115 // dot, because of ordered lists, only troublesome at the beginning of a line when preceded by an integer 5116 txt = txt.replace(/^( {0,3}\d+)\./gm, '$1\\.'); 5117 5118 // +, * and -, at the beginning of a line becomes a list, so we need to escape them also (asterisk was already escaped) 5119 txt = txt.replace(/^( {0,3})([+-])/gm, '$1\\$2'); 5120 5121 // images and links, ] followed by ( is problematic, so we escape it 5122 txt = txt.replace(/]([\s]*)\(/g, '\\]$1\\('); 5123 5124 // reference URIs must also be escaped 5125 txt = txt.replace(/^ {0,3}\[([\S \t]*?)]:/gm, '\\[$1]:'); 5126 5127 return txt; 5128 }); 5129 5130 var root = this; 5131 5132 // AMD Loader 5133 if (true) { 5134 !(__WEBPACK_AMD_DEFINE_RESULT__ = (function () { 5135 'use strict'; 5136 return showdown; 5137 }).call(exports, __webpack_require__, exports, module), 5138 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 5139 5140 // CommonJS/nodeJS Loader 5141 } else {} 5142 }).call(this); 5143 5144 5145 5146 5147 /***/ }), 5148 5149 /***/ 5373: 5150 /***/ ((__unused_webpack_module, exports) => { 5151 5152 "use strict"; 5153 var __webpack_unused_export__; 5154 /** 5155 * @license React 5156 * react-is.production.min.js 5157 * 5158 * Copyright (c) Facebook, Inc. and its affiliates. 5159 * 5160 * This source code is licensed under the MIT license found in the 5161 * LICENSE file in the root directory of this source tree. 5162 */ 5163 var b=Symbol.for("react.element"),c=Symbol.for("react.portal"),d=Symbol.for("react.fragment"),e=Symbol.for("react.strict_mode"),f=Symbol.for("react.profiler"),g=Symbol.for("react.provider"),h=Symbol.for("react.context"),k=Symbol.for("react.server_context"),l=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),n=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),q=Symbol.for("react.lazy"),t=Symbol.for("react.offscreen"),u;u=Symbol.for("react.module.reference"); 5164 function v(a){if("object"===typeof a&&null!==a){var r=a.$$typeof;switch(r){case b:switch(a=a.type,a){case d:case f:case e:case m:case n:return a;default:switch(a=a&&a.$$typeof,a){case k:case h:case l:case q:case p:case g:return a;default:return r}}case c:return r}}}__webpack_unused_export__=h;__webpack_unused_export__=g;__webpack_unused_export__=b;__webpack_unused_export__=l;__webpack_unused_export__=d;__webpack_unused_export__=q;__webpack_unused_export__=p;__webpack_unused_export__=c;__webpack_unused_export__=f;__webpack_unused_export__=e;__webpack_unused_export__=m; 5165 __webpack_unused_export__=n;__webpack_unused_export__=function(){return!1};__webpack_unused_export__=function(){return!1};__webpack_unused_export__=function(a){return v(a)===h};__webpack_unused_export__=function(a){return v(a)===g};__webpack_unused_export__=function(a){return"object"===typeof a&&null!==a&&a.$$typeof===b};__webpack_unused_export__=function(a){return v(a)===l};__webpack_unused_export__=function(a){return v(a)===d};__webpack_unused_export__=function(a){return v(a)===q};__webpack_unused_export__=function(a){return v(a)===p}; 5166 __webpack_unused_export__=function(a){return v(a)===c};__webpack_unused_export__=function(a){return v(a)===f};__webpack_unused_export__=function(a){return v(a)===e};__webpack_unused_export__=function(a){return v(a)===m};__webpack_unused_export__=function(a){return v(a)===n}; 5167 exports.isValidElementType=function(a){return"string"===typeof a||"function"===typeof a||a===d||a===f||a===e||a===m||a===n||a===t||"object"===typeof a&&null!==a&&(a.$$typeof===q||a.$$typeof===p||a.$$typeof===g||a.$$typeof===h||a.$$typeof===l||a.$$typeof===u||void 0!==a.getModuleId)?!0:!1};__webpack_unused_export__=v; 5168 5169 5170 /***/ }), 5171 5172 /***/ 7734: 5173 /***/ ((module) => { 5174 5175 "use strict"; 5176 5177 5178 // do not edit .js files directly - edit src/index.jst 5179 5180 5181 var envHasBigInt64Array = typeof BigInt64Array !== 'undefined'; 5182 5183 5184 module.exports = function equal(a, b) { 5185 if (a === b) return true; 5186 5187 if (a && b && typeof a == 'object' && typeof b == 'object') { 5188 if (a.constructor !== b.constructor) return false; 5189 5190 var length, i, keys; 5191 if (Array.isArray(a)) { 5192 length = a.length; 5193 if (length != b.length) return false; 5194 for (i = length; i-- !== 0;) 5195 if (!equal(a[i], b[i])) return false; 5196 return true; 5197 } 5198 5199 5200 if ((a instanceof Map) && (b instanceof Map)) { 5201 if (a.size !== b.size) return false; 5202 for (i of a.entries()) 5203 if (!b.has(i[0])) return false; 5204 for (i of a.entries()) 5205 if (!equal(i[1], b.get(i[0]))) return false; 5206 return true; 5207 } 5208 5209 if ((a instanceof Set) && (b instanceof Set)) { 5210 if (a.size !== b.size) return false; 5211 for (i of a.entries()) 5212 if (!b.has(i[0])) return false; 5213 return true; 5214 } 5215 5216 if (ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) { 5217 length = a.length; 5218 if (length != b.length) return false; 5219 for (i = length; i-- !== 0;) 5220 if (a[i] !== b[i]) return false; 5221 return true; 5222 } 5223 5224 5225 if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags; 5226 if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf(); 5227 if (a.toString !== Object.prototype.toString) return a.toString() === b.toString(); 5228 5229 keys = Object.keys(a); 5230 length = keys.length; 5231 if (length !== Object.keys(b).length) return false; 5232 5233 for (i = length; i-- !== 0;) 5234 if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false; 5235 5236 for (i = length; i-- !== 0;) { 5237 var key = keys[i]; 5238 5239 if (!equal(a[key], b[key])) return false; 5240 } 5241 5242 return true; 5243 } 5244 5245 // true if both NaN, false otherwise 5246 return a!==a && b!==b; 5247 }; 5248 5249 5250 /***/ }), 5251 5252 /***/ 8529: 5253 /***/ ((module, __unused_webpack_exports, __webpack_require__) => { 5254 5255 "use strict"; 5256 5257 5258 if (true) { 5259 module.exports = __webpack_require__(5373); 5260 } else {} 5261 5262 5263 /***/ }), 5264 5265 /***/ 9681: 5266 /***/ ((module) => { 5267 5268 var characterMap = { 5269 "À": "A", 5270 "Á": "A", 5271 "Â": "A", 5272 "Ã": "A", 5273 "Ä": "A", 5274 "Å": "A", 5275 "Ấ": "A", 5276 "Ắ": "A", 5277 "Ẳ": "A", 5278 "Ẵ": "A", 5279 "Ặ": "A", 5280 "Æ": "AE", 5281 "Ầ": "A", 5282 "Ằ": "A", 5283 "Ȃ": "A", 5284 "Ả": "A", 5285 "Ạ": "A", 5286 "Ẩ": "A", 5287 "Ẫ": "A", 5288 "Ậ": "A", 5289 "Ç": "C", 5290 "Ḉ": "C", 5291 "È": "E", 5292 "É": "E", 5293 "Ê": "E", 5294 "Ë": "E", 5295 "Ế": "E", 5296 "Ḗ": "E", 5297 "Ề": "E", 5298 "Ḕ": "E", 5299 "Ḝ": "E", 5300 "Ȇ": "E", 5301 "Ẻ": "E", 5302 "Ẽ": "E", 5303 "Ẹ": "E", 5304 "Ể": "E", 5305 "Ễ": "E", 5306 "Ệ": "E", 5307 "Ì": "I", 5308 "Í": "I", 5309 "Î": "I", 5310 "Ï": "I", 5311 "Ḯ": "I", 5312 "Ȋ": "I", 5313 "Ỉ": "I", 5314 "Ị": "I", 5315 "Ð": "D", 5316 "Ñ": "N", 5317 "Ò": "O", 5318 "Ó": "O", 5319 "Ô": "O", 5320 "Õ": "O", 5321 "Ö": "O", 5322 "Ø": "O", 5323 "Ố": "O", 5324 "Ṍ": "O", 5325 "Ṓ": "O", 5326 "Ȏ": "O", 5327 "Ỏ": "O", 5328 "Ọ": "O", 5329 "Ổ": "O", 5330 "Ỗ": "O", 5331 "Ộ": "O", 5332 "Ờ": "O", 5333 "Ở": "O", 5334 "Ỡ": "O", 5335 "Ớ": "O", 5336 "Ợ": "O", 5337 "Ù": "U", 5338 "Ú": "U", 5339 "Û": "U", 5340 "Ü": "U", 5341 "Ủ": "U", 5342 "Ụ": "U", 5343 "Ử": "U", 5344 "Ữ": "U", 5345 "Ự": "U", 5346 "Ý": "Y", 5347 "à": "a", 5348 "á": "a", 5349 "â": "a", 5350 "ã": "a", 5351 "ä": "a", 5352 "å": "a", 5353 "ấ": "a", 5354 "ắ": "a", 5355 "ẳ": "a", 5356 "ẵ": "a", 5357 "ặ": "a", 5358 "æ": "ae", 5359 "ầ": "a", 5360 "ằ": "a", 5361 "ȃ": "a", 5362 "ả": "a", 5363 "ạ": "a", 5364 "ẩ": "a", 5365 "ẫ": "a", 5366 "ậ": "a", 5367 "ç": "c", 5368 "ḉ": "c", 5369 "è": "e", 5370 "é": "e", 5371 "ê": "e", 5372 "ë": "e", 5373 "ế": "e", 5374 "ḗ": "e", 5375 "ề": "e", 5376 "ḕ": "e", 5377 "ḝ": "e", 5378 "ȇ": "e", 5379 "ẻ": "e", 5380 "ẽ": "e", 5381 "ẹ": "e", 5382 "ể": "e", 5383 "ễ": "e", 5384 "ệ": "e", 5385 "ì": "i", 5386 "í": "i", 5387 "î": "i", 5388 "ï": "i", 5389 "ḯ": "i", 5390 "ȋ": "i", 5391 "ỉ": "i", 5392 "ị": "i", 5393 "ð": "d", 5394 "ñ": "n", 5395 "ò": "o", 5396 "ó": "o", 5397 "ô": "o", 5398 "õ": "o", 5399 "ö": "o", 5400 "ø": "o", 5401 "ố": "o", 5402 "ṍ": "o", 5403 "ṓ": "o", 5404 "ȏ": "o", 5405 "ỏ": "o", 5406 "ọ": "o", 5407 "ổ": "o", 5408 "ỗ": "o", 5409 "ộ": "o", 5410 "ờ": "o", 5411 "ở": "o", 5412 "ỡ": "o", 5413 "ớ": "o", 5414 "ợ": "o", 5415 "ù": "u", 5416 "ú": "u", 5417 "û": "u", 5418 "ü": "u", 5419 "ủ": "u", 5420 "ụ": "u", 5421 "ử": "u", 5422 "ữ": "u", 5423 "ự": "u", 5424 "ý": "y", 5425 "ÿ": "y", 5426 "Ā": "A", 5427 "ā": "a", 5428 "Ă": "A", 5429 "ă": "a", 5430 "Ą": "A", 5431 "ą": "a", 5432 "Ć": "C", 5433 "ć": "c", 5434 "Ĉ": "C", 5435 "ĉ": "c", 5436 "Ċ": "C", 5437 "ċ": "c", 5438 "Č": "C", 5439 "č": "c", 5440 "C̆": "C", 5441 "c̆": "c", 5442 "Ď": "D", 5443 "ď": "d", 5444 "Đ": "D", 5445 "đ": "d", 5446 "Ē": "E", 5447 "ē": "e", 5448 "Ĕ": "E", 5449 "ĕ": "e", 5450 "Ė": "E", 5451 "ė": "e", 5452 "Ę": "E", 5453 "ę": "e", 5454 "Ě": "E", 5455 "ě": "e", 5456 "Ĝ": "G", 5457 "Ǵ": "G", 5458 "ĝ": "g", 5459 "ǵ": "g", 5460 "Ğ": "G", 5461 "ğ": "g", 5462 "Ġ": "G", 5463 "ġ": "g", 5464 "Ģ": "G", 5465 "ģ": "g", 5466 "Ĥ": "H", 5467 "ĥ": "h", 5468 "Ħ": "H", 5469 "ħ": "h", 5470 "Ḫ": "H", 5471 "ḫ": "h", 5472 "Ĩ": "I", 5473 "ĩ": "i", 5474 "Ī": "I", 5475 "ī": "i", 5476 "Ĭ": "I", 5477 "ĭ": "i", 5478 "Į": "I", 5479 "į": "i", 5480 "İ": "I", 5481 "ı": "i", 5482 "IJ": "IJ", 5483 "ij": "ij", 5484 "Ĵ": "J", 5485 "ĵ": "j", 5486 "Ķ": "K", 5487 "ķ": "k", 5488 "Ḱ": "K", 5489 "ḱ": "k", 5490 "K̆": "K", 5491 "k̆": "k", 5492 "Ĺ": "L", 5493 "ĺ": "l", 5494 "Ļ": "L", 5495 "ļ": "l", 5496 "Ľ": "L", 5497 "ľ": "l", 5498 "Ŀ": "L", 5499 "ŀ": "l", 5500 "Ł": "l", 5501 "ł": "l", 5502 "Ḿ": "M", 5503 "ḿ": "m", 5504 "M̆": "M", 5505 "m̆": "m", 5506 "Ń": "N", 5507 "ń": "n", 5508 "Ņ": "N", 5509 "ņ": "n", 5510 "Ň": "N", 5511 "ň": "n", 5512 "ʼn": "n", 5513 "N̆": "N", 5514 "n̆": "n", 5515 "Ō": "O", 5516 "ō": "o", 5517 "Ŏ": "O", 5518 "ŏ": "o", 5519 "Ő": "O", 5520 "ő": "o", 5521 "Œ": "OE", 5522 "œ": "oe", 5523 "P̆": "P", 5524 "p̆": "p", 5525 "Ŕ": "R", 5526 "ŕ": "r", 5527 "Ŗ": "R", 5528 "ŗ": "r", 5529 "Ř": "R", 5530 "ř": "r", 5531 "R̆": "R", 5532 "r̆": "r", 5533 "Ȓ": "R", 5534 "ȓ": "r", 5535 "Ś": "S", 5536 "ś": "s", 5537 "Ŝ": "S", 5538 "ŝ": "s", 5539 "Ş": "S", 5540 "Ș": "S", 5541 "ș": "s", 5542 "ş": "s", 5543 "Š": "S", 5544 "š": "s", 5545 "Ţ": "T", 5546 "ţ": "t", 5547 "ț": "t", 5548 "Ț": "T", 5549 "Ť": "T", 5550 "ť": "t", 5551 "Ŧ": "T", 5552 "ŧ": "t", 5553 "T̆": "T", 5554 "t̆": "t", 5555 "Ũ": "U", 5556 "ũ": "u", 5557 "Ū": "U", 5558 "ū": "u", 5559 "Ŭ": "U", 5560 "ŭ": "u", 5561 "Ů": "U", 5562 "ů": "u", 5563 "Ű": "U", 5564 "ű": "u", 5565 "Ų": "U", 5566 "ų": "u", 5567 "Ȗ": "U", 5568 "ȗ": "u", 5569 "V̆": "V", 5570 "v̆": "v", 5571 "Ŵ": "W", 5572 "ŵ": "w", 5573 "Ẃ": "W", 5574 "ẃ": "w", 5575 "X̆": "X", 5576 "x̆": "x", 5577 "Ŷ": "Y", 5578 "ŷ": "y", 5579 "Ÿ": "Y", 5580 "Y̆": "Y", 5581 "y̆": "y", 5582 "Ź": "Z", 5583 "ź": "z", 5584 "Ż": "Z", 5585 "ż": "z", 5586 "Ž": "Z", 5587 "ž": "z", 5588 "ſ": "s", 5589 "ƒ": "f", 5590 "Ơ": "O", 5591 "ơ": "o", 5592 "Ư": "U", 5593 "ư": "u", 5594 "Ǎ": "A", 5595 "ǎ": "a", 5596 "Ǐ": "I", 5597 "ǐ": "i", 5598 "Ǒ": "O", 5599 "ǒ": "o", 5600 "Ǔ": "U", 5601 "ǔ": "u", 5602 "Ǖ": "U", 5603 "ǖ": "u", 5604 "Ǘ": "U", 5605 "ǘ": "u", 5606 "Ǚ": "U", 5607 "ǚ": "u", 5608 "Ǜ": "U", 5609 "ǜ": "u", 5610 "Ứ": "U", 5611 "ứ": "u", 5612 "Ṹ": "U", 5613 "ṹ": "u", 5614 "Ǻ": "A", 5615 "ǻ": "a", 5616 "Ǽ": "AE", 5617 "ǽ": "ae", 5618 "Ǿ": "O", 5619 "ǿ": "o", 5620 "Þ": "TH", 5621 "þ": "th", 5622 "Ṕ": "P", 5623 "ṕ": "p", 5624 "Ṥ": "S", 5625 "ṥ": "s", 5626 "X́": "X", 5627 "x́": "x", 5628 "Ѓ": "Г", 5629 "ѓ": "г", 5630 "Ќ": "К", 5631 "ќ": "к", 5632 "A̋": "A", 5633 "a̋": "a", 5634 "E̋": "E", 5635 "e̋": "e", 5636 "I̋": "I", 5637 "i̋": "i", 5638 "Ǹ": "N", 5639 "ǹ": "n", 5640 "Ồ": "O", 5641 "ồ": "o", 5642 "Ṑ": "O", 5643 "ṑ": "o", 5644 "Ừ": "U", 5645 "ừ": "u", 5646 "Ẁ": "W", 5647 "ẁ": "w", 5648 "Ỳ": "Y", 5649 "ỳ": "y", 5650 "Ȁ": "A", 5651 "ȁ": "a", 5652 "Ȅ": "E", 5653 "ȅ": "e", 5654 "Ȉ": "I", 5655 "ȉ": "i", 5656 "Ȍ": "O", 5657 "ȍ": "o", 5658 "Ȑ": "R", 5659 "ȑ": "r", 5660 "Ȕ": "U", 5661 "ȕ": "u", 5662 "B̌": "B", 5663 "b̌": "b", 5664 "Č̣": "C", 5665 "č̣": "c", 5666 "Ê̌": "E", 5667 "ê̌": "e", 5668 "F̌": "F", 5669 "f̌": "f", 5670 "Ǧ": "G", 5671 "ǧ": "g", 5672 "Ȟ": "H", 5673 "ȟ": "h", 5674 "J̌": "J", 5675 "ǰ": "j", 5676 "Ǩ": "K", 5677 "ǩ": "k", 5678 "M̌": "M", 5679 "m̌": "m", 5680 "P̌": "P", 5681 "p̌": "p", 5682 "Q̌": "Q", 5683 "q̌": "q", 5684 "Ř̩": "R", 5685 "ř̩": "r", 5686 "Ṧ": "S", 5687 "ṧ": "s", 5688 "V̌": "V", 5689 "v̌": "v", 5690 "W̌": "W", 5691 "w̌": "w", 5692 "X̌": "X", 5693 "x̌": "x", 5694 "Y̌": "Y", 5695 "y̌": "y", 5696 "A̧": "A", 5697 "a̧": "a", 5698 "B̧": "B", 5699 "b̧": "b", 5700 "Ḑ": "D", 5701 "ḑ": "d", 5702 "Ȩ": "E", 5703 "ȩ": "e", 5704 "Ɛ̧": "E", 5705 "ɛ̧": "e", 5706 "Ḩ": "H", 5707 "ḩ": "h", 5708 "I̧": "I", 5709 "i̧": "i", 5710 "Ɨ̧": "I", 5711 "ɨ̧": "i", 5712 "M̧": "M", 5713 "m̧": "m", 5714 "O̧": "O", 5715 "o̧": "o", 5716 "Q̧": "Q", 5717 "q̧": "q", 5718 "U̧": "U", 5719 "u̧": "u", 5720 "X̧": "X", 5721 "x̧": "x", 5722 "Z̧": "Z", 5723 "z̧": "z", 5724 "й":"и", 5725 "Й":"И", 5726 "ё":"е", 5727 "Ё":"Е", 5728 }; 5729 5730 var chars = Object.keys(characterMap).join('|'); 5731 var allAccents = new RegExp(chars, 'g'); 5732 var firstAccent = new RegExp(chars, ''); 5733 5734 function matcher(match) { 5735 return characterMap[match]; 5736 } 5737 5738 var removeAccents = function(string) { 5739 return string.replace(allAccents, matcher); 5740 }; 5741 5742 var hasAccents = function(string) { 5743 return !!string.match(firstAccent); 5744 }; 5745 5746 module.exports = removeAccents; 5747 module.exports.has = hasAccents; 5748 module.exports.remove = removeAccents; 5749 5750 5751 /***/ }) 5752 5753 /******/ }); 5754 /************************************************************************/ 5755 /******/ // The module cache 5756 /******/ var __webpack_module_cache__ = {}; 5757 /******/ 5758 /******/ // The require function 5759 /******/ function __webpack_require__(moduleId) { 5760 /******/ // Check if module is in cache 5761 /******/ var cachedModule = __webpack_module_cache__[moduleId]; 5762 /******/ if (cachedModule !== undefined) { 5763 /******/ return cachedModule.exports; 5764 /******/ } 5765 /******/ // Create a new module (and put it into the cache) 5766 /******/ var module = __webpack_module_cache__[moduleId] = { 5767 /******/ // no module.id needed 5768 /******/ // no module.loaded needed 5769 /******/ exports: {} 5770 /******/ }; 5771 /******/ 5772 /******/ // Execute the module function 5773 /******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__); 5774 /******/ 5775 /******/ // Return the exports of the module 5776 /******/ return module.exports; 5777 /******/ } 5778 /******/ 5779 /************************************************************************/ 5780 /******/ /* webpack/runtime/compat get default export */ 5781 /******/ (() => { 5782 /******/ // getDefaultExport function for compatibility with non-harmony modules 5783 /******/ __webpack_require__.n = (module) => { 5784 /******/ var getter = module && module.__esModule ? 5785 /******/ () => (module['default']) : 5786 /******/ () => (module); 5787 /******/ __webpack_require__.d(getter, { a: getter }); 5788 /******/ return getter; 5789 /******/ }; 5790 /******/ })(); 5791 /******/ 5792 /******/ /* webpack/runtime/define property getters */ 5793 /******/ (() => { 5794 /******/ // define getter functions for harmony exports 5795 /******/ __webpack_require__.d = (exports, definition) => { 5796 /******/ for(var key in definition) { 5797 /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { 5798 /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); 5799 /******/ } 5800 /******/ } 5801 /******/ }; 5802 /******/ })(); 5803 /******/ 5804 /******/ /* webpack/runtime/hasOwnProperty shorthand */ 5805 /******/ (() => { 5806 /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) 5807 /******/ })(); 5808 /******/ 5809 /******/ /* webpack/runtime/make namespace object */ 5810 /******/ (() => { 5811 /******/ // define __esModule on exports 5812 /******/ __webpack_require__.r = (exports) => { 5813 /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { 5814 /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 5815 /******/ } 5816 /******/ Object.defineProperty(exports, '__esModule', { value: true }); 5817 /******/ }; 5818 /******/ })(); 5819 /******/ 5820 /************************************************************************/ 5821 var __webpack_exports__ = {}; 5822 // This entry needs to be wrapped in an IIFE because it needs to be in strict mode. 5823 (() => { 5824 "use strict"; 5825 // ESM COMPAT FLAG 5826 __webpack_require__.r(__webpack_exports__); 5827 5828 // EXPORTS 5829 __webpack_require__.d(__webpack_exports__, { 5830 __EXPERIMENTAL_ELEMENTS: () => (/* reexport */ __EXPERIMENTAL_ELEMENTS), 5831 __EXPERIMENTAL_PATHS_WITH_OVERRIDE: () => (/* reexport */ __EXPERIMENTAL_PATHS_WITH_OVERRIDE), 5832 __EXPERIMENTAL_STYLE_PROPERTY: () => (/* reexport */ __EXPERIMENTAL_STYLE_PROPERTY), 5833 __experimentalCloneSanitizedBlock: () => (/* reexport */ __experimentalCloneSanitizedBlock), 5834 __experimentalGetAccessibleBlockLabel: () => (/* reexport */ getAccessibleBlockLabel), 5835 __experimentalGetBlockAttributesNamesByRole: () => (/* reexport */ __experimentalGetBlockAttributesNamesByRole), 5836 __experimentalGetBlockLabel: () => (/* reexport */ getBlockLabel), 5837 __experimentalSanitizeBlockAttributes: () => (/* reexport */ __experimentalSanitizeBlockAttributes), 5838 __unstableGetBlockProps: () => (/* reexport */ getBlockProps), 5839 __unstableGetInnerBlocksProps: () => (/* reexport */ getInnerBlocksProps), 5840 __unstableSerializeAndClean: () => (/* reexport */ __unstableSerializeAndClean), 5841 children: () => (/* reexport */ children_default), 5842 cloneBlock: () => (/* reexport */ cloneBlock), 5843 createBlock: () => (/* reexport */ createBlock), 5844 createBlocksFromInnerBlocksTemplate: () => (/* reexport */ createBlocksFromInnerBlocksTemplate), 5845 doBlocksMatchTemplate: () => (/* reexport */ doBlocksMatchTemplate), 5846 findTransform: () => (/* reexport */ findTransform), 5847 getBlockAttributes: () => (/* reexport */ getBlockAttributes), 5848 getBlockAttributesNamesByRole: () => (/* reexport */ getBlockAttributesNamesByRole), 5849 getBlockBindingsSource: () => (/* reexport */ getBlockBindingsSource), 5850 getBlockBindingsSources: () => (/* reexport */ getBlockBindingsSources), 5851 getBlockContent: () => (/* reexport */ getBlockInnerHTML), 5852 getBlockDefaultClassName: () => (/* reexport */ getBlockDefaultClassName), 5853 getBlockFromExample: () => (/* reexport */ getBlockFromExample), 5854 getBlockMenuDefaultClassName: () => (/* reexport */ getBlockMenuDefaultClassName), 5855 getBlockSupport: () => (/* reexport */ getBlockSupport), 5856 getBlockTransforms: () => (/* reexport */ getBlockTransforms), 5857 getBlockType: () => (/* reexport */ getBlockType), 5858 getBlockTypes: () => (/* reexport */ getBlockTypes), 5859 getBlockVariations: () => (/* reexport */ getBlockVariations), 5860 getCategories: () => (/* reexport */ categories_getCategories), 5861 getChildBlockNames: () => (/* reexport */ getChildBlockNames), 5862 getDefaultBlockName: () => (/* reexport */ getDefaultBlockName), 5863 getFreeformContentHandlerName: () => (/* reexport */ getFreeformContentHandlerName), 5864 getGroupingBlockName: () => (/* reexport */ getGroupingBlockName), 5865 getPhrasingContentSchema: () => (/* reexport */ deprecatedGetPhrasingContentSchema), 5866 getPossibleBlockTransformations: () => (/* reexport */ getPossibleBlockTransformations), 5867 getSaveContent: () => (/* reexport */ getSaveContent), 5868 getSaveElement: () => (/* reexport */ getSaveElement), 5869 getUnregisteredTypeHandlerName: () => (/* reexport */ getUnregisteredTypeHandlerName), 5870 hasBlockSupport: () => (/* reexport */ hasBlockSupport), 5871 hasChildBlocks: () => (/* reexport */ hasChildBlocks), 5872 hasChildBlocksWithInserterSupport: () => (/* reexport */ hasChildBlocksWithInserterSupport), 5873 isReusableBlock: () => (/* reexport */ isReusableBlock), 5874 isTemplatePart: () => (/* reexport */ isTemplatePart), 5875 isUnmodifiedBlock: () => (/* reexport */ isUnmodifiedBlock), 5876 isUnmodifiedDefaultBlock: () => (/* reexport */ isUnmodifiedDefaultBlock), 5877 isValidBlockContent: () => (/* reexport */ isValidBlockContent), 5878 isValidIcon: () => (/* reexport */ isValidIcon), 5879 node: () => (/* reexport */ node_default), 5880 normalizeIconObject: () => (/* reexport */ normalizeIconObject), 5881 parse: () => (/* reexport */ parser_parse), 5882 parseWithAttributeSchema: () => (/* reexport */ parseWithAttributeSchema), 5883 pasteHandler: () => (/* reexport */ pasteHandler), 5884 privateApis: () => (/* reexport */ privateApis), 5885 rawHandler: () => (/* reexport */ rawHandler), 5886 registerBlockBindingsSource: () => (/* reexport */ registerBlockBindingsSource), 5887 registerBlockCollection: () => (/* reexport */ registerBlockCollection), 5888 registerBlockStyle: () => (/* reexport */ registerBlockStyle), 5889 registerBlockType: () => (/* reexport */ registerBlockType), 5890 registerBlockVariation: () => (/* reexport */ registerBlockVariation), 5891 serialize: () => (/* reexport */ serialize), 5892 serializeRawBlock: () => (/* reexport */ serializeRawBlock), 5893 setCategories: () => (/* reexport */ categories_setCategories), 5894 setDefaultBlockName: () => (/* reexport */ setDefaultBlockName), 5895 setFreeformContentHandlerName: () => (/* reexport */ setFreeformContentHandlerName), 5896 setGroupingBlockName: () => (/* reexport */ setGroupingBlockName), 5897 setUnregisteredTypeHandlerName: () => (/* reexport */ setUnregisteredTypeHandlerName), 5898 store: () => (/* reexport */ store), 5899 switchToBlockType: () => (/* reexport */ switchToBlockType), 5900 synchronizeBlocksWithTemplate: () => (/* reexport */ synchronizeBlocksWithTemplate), 5901 unregisterBlockBindingsSource: () => (/* reexport */ unregisterBlockBindingsSource), 5902 unregisterBlockStyle: () => (/* reexport */ unregisterBlockStyle), 5903 unregisterBlockType: () => (/* reexport */ unregisterBlockType), 5904 unregisterBlockVariation: () => (/* reexport */ unregisterBlockVariation), 5905 unstable__bootstrapServerSideBlockDefinitions: () => (/* reexport */ unstable__bootstrapServerSideBlockDefinitions), 5906 updateCategory: () => (/* reexport */ categories_updateCategory), 5907 validateBlock: () => (/* reexport */ validateBlock), 5908 withBlockContentContext: () => (/* reexport */ withBlockContentContext) 5909 }); 5910 5911 // NAMESPACE OBJECT: ./node_modules/@wordpress/blocks/build-module/store/private-selectors.js 5912 var private_selectors_namespaceObject = {}; 5913 __webpack_require__.r(private_selectors_namespaceObject); 5914 __webpack_require__.d(private_selectors_namespaceObject, { 5915 getAllBlockBindingsSources: () => (getAllBlockBindingsSources), 5916 getBlockBindingsSource: () => (private_selectors_getBlockBindingsSource), 5917 getBootstrappedBlockType: () => (getBootstrappedBlockType), 5918 getSupportedStyles: () => (getSupportedStyles), 5919 getUnprocessedBlockTypes: () => (getUnprocessedBlockTypes), 5920 hasContentRoleAttribute: () => (hasContentRoleAttribute) 5921 }); 5922 5923 // NAMESPACE OBJECT: ./node_modules/@wordpress/blocks/build-module/store/selectors.js 5924 var selectors_namespaceObject = {}; 5925 __webpack_require__.r(selectors_namespaceObject); 5926 __webpack_require__.d(selectors_namespaceObject, { 5927 __experimentalHasContentRoleAttribute: () => (__experimentalHasContentRoleAttribute), 5928 getActiveBlockVariation: () => (getActiveBlockVariation), 5929 getBlockStyles: () => (getBlockStyles), 5930 getBlockSupport: () => (selectors_getBlockSupport), 5931 getBlockType: () => (selectors_getBlockType), 5932 getBlockTypes: () => (selectors_getBlockTypes), 5933 getBlockVariations: () => (selectors_getBlockVariations), 5934 getCategories: () => (getCategories), 5935 getChildBlockNames: () => (selectors_getChildBlockNames), 5936 getCollections: () => (getCollections), 5937 getDefaultBlockName: () => (selectors_getDefaultBlockName), 5938 getDefaultBlockVariation: () => (getDefaultBlockVariation), 5939 getFreeformFallbackBlockName: () => (getFreeformFallbackBlockName), 5940 getGroupingBlockName: () => (selectors_getGroupingBlockName), 5941 getUnregisteredFallbackBlockName: () => (getUnregisteredFallbackBlockName), 5942 hasBlockSupport: () => (selectors_hasBlockSupport), 5943 hasChildBlocks: () => (selectors_hasChildBlocks), 5944 hasChildBlocksWithInserterSupport: () => (selectors_hasChildBlocksWithInserterSupport), 5945 isMatchingSearchTerm: () => (isMatchingSearchTerm) 5946 }); 5947 5948 // NAMESPACE OBJECT: ./node_modules/@wordpress/blocks/build-module/store/actions.js 5949 var actions_namespaceObject = {}; 5950 __webpack_require__.r(actions_namespaceObject); 5951 __webpack_require__.d(actions_namespaceObject, { 5952 __experimentalReapplyBlockFilters: () => (__experimentalReapplyBlockFilters), 5953 addBlockCollection: () => (addBlockCollection), 5954 addBlockStyles: () => (addBlockStyles), 5955 addBlockTypes: () => (addBlockTypes), 5956 addBlockVariations: () => (addBlockVariations), 5957 reapplyBlockTypeFilters: () => (reapplyBlockTypeFilters), 5958 removeBlockCollection: () => (removeBlockCollection), 5959 removeBlockStyles: () => (removeBlockStyles), 5960 removeBlockTypes: () => (removeBlockTypes), 5961 removeBlockVariations: () => (removeBlockVariations), 5962 setCategories: () => (setCategories), 5963 setDefaultBlockName: () => (actions_setDefaultBlockName), 5964 setFreeformFallbackBlockName: () => (setFreeformFallbackBlockName), 5965 setGroupingBlockName: () => (actions_setGroupingBlockName), 5966 setUnregisteredFallbackBlockName: () => (setUnregisteredFallbackBlockName), 5967 updateCategory: () => (updateCategory) 5968 }); 5969 5970 // NAMESPACE OBJECT: ./node_modules/@wordpress/blocks/build-module/store/private-actions.js 5971 var private_actions_namespaceObject = {}; 5972 __webpack_require__.r(private_actions_namespaceObject); 5973 __webpack_require__.d(private_actions_namespaceObject, { 5974 addBlockBindingsSource: () => (addBlockBindingsSource), 5975 addBootstrappedBlockType: () => (addBootstrappedBlockType), 5976 addUnprocessedBlockType: () => (addUnprocessedBlockType), 5977 removeBlockBindingsSource: () => (removeBlockBindingsSource) 5978 }); 5979 5980 ;// external ["wp","data"] 5981 const external_wp_data_namespaceObject = window["wp"]["data"]; 5982 ;// ./node_modules/tslib/tslib.es6.mjs 5983 /****************************************************************************** 5984 Copyright (c) Microsoft Corporation. 5985 5986 Permission to use, copy, modify, and/or distribute this software for any 5987 purpose with or without fee is hereby granted. 5988 5989 THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 5990 REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 5991 AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 5992 INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 5993 LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 5994 OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 5995 PERFORMANCE OF THIS SOFTWARE. 5996 ***************************************************************************** */ 5997 /* global Reflect, Promise, SuppressedError, Symbol, Iterator */ 5998 5999 var extendStatics = function(d, b) { 6000 extendStatics = Object.setPrototypeOf || 6001 ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || 6002 function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; 6003 return extendStatics(d, b); 6004 }; 6005 6006 function __extends(d, b) { 6007 if (typeof b !== "function" && b !== null) 6008 throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); 6009 extendStatics(d, b); 6010 function __() { this.constructor = d; } 6011 d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); 6012 } 6013 6014 var __assign = function() { 6015 __assign = Object.assign || function __assign(t) { 6016 for (var s, i = 1, n = arguments.length; i < n; i++) { 6017 s = arguments[i]; 6018 for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; 6019 } 6020 return t; 6021 } 6022 return __assign.apply(this, arguments); 6023 } 6024 6025 function __rest(s, e) { 6026 var t = {}; 6027 for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) 6028 t[p] = s[p]; 6029 if (s != null && typeof Object.getOwnPropertySymbols === "function") 6030 for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { 6031 if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) 6032 t[p[i]] = s[p[i]]; 6033 } 6034 return t; 6035 } 6036 6037 function __decorate(decorators, target, key, desc) { 6038 var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; 6039 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 6040 else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; 6041 return c > 3 && r && Object.defineProperty(target, key, r), r; 6042 } 6043 6044 function __param(paramIndex, decorator) { 6045 return function (target, key) { decorator(target, key, paramIndex); } 6046 } 6047 6048 function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { 6049 function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } 6050 var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; 6051 var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; 6052 var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); 6053 var _, done = false; 6054 for (var i = decorators.length - 1; i >= 0; i--) { 6055 var context = {}; 6056 for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; 6057 for (var p in contextIn.access) context.access[p] = contextIn.access[p]; 6058 context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; 6059 var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); 6060 if (kind === "accessor") { 6061 if (result === void 0) continue; 6062 if (result === null || typeof result !== "object") throw new TypeError("Object expected"); 6063 if (_ = accept(result.get)) descriptor.get = _; 6064 if (_ = accept(result.set)) descriptor.set = _; 6065 if (_ = accept(result.init)) initializers.unshift(_); 6066 } 6067 else if (_ = accept(result)) { 6068 if (kind === "field") initializers.unshift(_); 6069 else descriptor[key] = _; 6070 } 6071 } 6072 if (target) Object.defineProperty(target, contextIn.name, descriptor); 6073 done = true; 6074 }; 6075 6076 function __runInitializers(thisArg, initializers, value) { 6077 var useValue = arguments.length > 2; 6078 for (var i = 0; i < initializers.length; i++) { 6079 value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); 6080 } 6081 return useValue ? value : void 0; 6082 }; 6083 6084 function __propKey(x) { 6085 return typeof x === "symbol" ? x : "".concat(x); 6086 }; 6087 6088 function __setFunctionName(f, name, prefix) { 6089 if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; 6090 return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); 6091 }; 6092 6093 function __metadata(metadataKey, metadataValue) { 6094 if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); 6095 } 6096 6097 function __awaiter(thisArg, _arguments, P, generator) { 6098 function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } 6099 return new (P || (P = Promise))(function (resolve, reject) { 6100 function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } 6101 function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } 6102 function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } 6103 step((generator = generator.apply(thisArg, _arguments || [])).next()); 6104 }); 6105 } 6106 6107 function __generator(thisArg, body) { 6108 var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype); 6109 return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; 6110 function verb(n) { return function (v) { return step([n, v]); }; } 6111 function step(op) { 6112 if (f) throw new TypeError("Generator is already executing."); 6113 while (g && (g = 0, op[0] && (_ = 0)), _) try { 6114 if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; 6115 if (y = 0, t) op = [op[0] & 2, t.value]; 6116 switch (op[0]) { 6117 case 0: case 1: t = op; break; 6118 case 4: _.label++; return { value: op[1], done: false }; 6119 case 5: _.label++; y = op[1]; op = [0]; continue; 6120 case 7: op = _.ops.pop(); _.trys.pop(); continue; 6121 default: 6122 if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } 6123 if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } 6124 if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } 6125 if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } 6126 if (t[2]) _.ops.pop(); 6127 _.trys.pop(); continue; 6128 } 6129 op = body.call(thisArg, _); 6130 } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } 6131 if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; 6132 } 6133 } 6134 6135 var __createBinding = Object.create ? (function(o, m, k, k2) { 6136 if (k2 === undefined) k2 = k; 6137 var desc = Object.getOwnPropertyDescriptor(m, k); 6138 if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { 6139 desc = { enumerable: true, get: function() { return m[k]; } }; 6140 } 6141 Object.defineProperty(o, k2, desc); 6142 }) : (function(o, m, k, k2) { 6143 if (k2 === undefined) k2 = k; 6144 o[k2] = m[k]; 6145 }); 6146 6147 function __exportStar(m, o) { 6148 for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); 6149 } 6150 6151 function __values(o) { 6152 var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; 6153 if (m) return m.call(o); 6154 if (o && typeof o.length === "number") return { 6155 next: function () { 6156 if (o && i >= o.length) o = void 0; 6157 return { value: o && o[i++], done: !o }; 6158 } 6159 }; 6160 throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); 6161 } 6162 6163 function __read(o, n) { 6164 var m = typeof Symbol === "function" && o[Symbol.iterator]; 6165 if (!m) return o; 6166 var i = m.call(o), r, ar = [], e; 6167 try { 6168 while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); 6169 } 6170 catch (error) { e = { error: error }; } 6171 finally { 6172 try { 6173 if (r && !r.done && (m = i["return"])) m.call(i); 6174 } 6175 finally { if (e) throw e.error; } 6176 } 6177 return ar; 6178 } 6179 6180 /** @deprecated */ 6181 function __spread() { 6182 for (var ar = [], i = 0; i < arguments.length; i++) 6183 ar = ar.concat(__read(arguments[i])); 6184 return ar; 6185 } 6186 6187 /** @deprecated */ 6188 function __spreadArrays() { 6189 for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; 6190 for (var r = Array(s), k = 0, i = 0; i < il; i++) 6191 for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) 6192 r[k] = a[j]; 6193 return r; 6194 } 6195 6196 function __spreadArray(to, from, pack) { 6197 if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { 6198 if (ar || !(i in from)) { 6199 if (!ar) ar = Array.prototype.slice.call(from, 0, i); 6200 ar[i] = from[i]; 6201 } 6202 } 6203 return to.concat(ar || Array.prototype.slice.call(from)); 6204 } 6205 6206 function __await(v) { 6207 return this instanceof __await ? (this.v = v, this) : new __await(v); 6208 } 6209 6210 function __asyncGenerator(thisArg, _arguments, generator) { 6211 if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); 6212 var g = generator.apply(thisArg, _arguments || []), i, q = []; 6213 return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i; 6214 function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; } 6215 function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } } 6216 function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } 6217 function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } 6218 function fulfill(value) { resume("next", value); } 6219 function reject(value) { resume("throw", value); } 6220 function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } 6221 } 6222 6223 function __asyncDelegator(o) { 6224 var i, p; 6225 return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; 6226 function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } 6227 } 6228 6229 function __asyncValues(o) { 6230 if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); 6231 var m = o[Symbol.asyncIterator], i; 6232 return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); 6233 function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } 6234 function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } 6235 } 6236 6237 function __makeTemplateObject(cooked, raw) { 6238 if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } 6239 return cooked; 6240 }; 6241 6242 var __setModuleDefault = Object.create ? (function(o, v) { 6243 Object.defineProperty(o, "default", { enumerable: true, value: v }); 6244 }) : function(o, v) { 6245 o["default"] = v; 6246 }; 6247 6248 var ownKeys = function(o) { 6249 ownKeys = Object.getOwnPropertyNames || function (o) { 6250 var ar = []; 6251 for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; 6252 return ar; 6253 }; 6254 return ownKeys(o); 6255 }; 6256 6257 function __importStar(mod) { 6258 if (mod && mod.__esModule) return mod; 6259 var result = {}; 6260 if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); 6261 __setModuleDefault(result, mod); 6262 return result; 6263 } 6264 6265 function __importDefault(mod) { 6266 return (mod && mod.__esModule) ? mod : { default: mod }; 6267 } 6268 6269 function __classPrivateFieldGet(receiver, state, kind, f) { 6270 if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); 6271 if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); 6272 return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); 6273 } 6274 6275 function __classPrivateFieldSet(receiver, state, value, kind, f) { 6276 if (kind === "m") throw new TypeError("Private method is not writable"); 6277 if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); 6278 if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); 6279 return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; 6280 } 6281 6282 function __classPrivateFieldIn(state, receiver) { 6283 if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); 6284 return typeof state === "function" ? receiver === state : state.has(receiver); 6285 } 6286 6287 function __addDisposableResource(env, value, async) { 6288 if (value !== null && value !== void 0) { 6289 if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); 6290 var dispose, inner; 6291 if (async) { 6292 if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); 6293 dispose = value[Symbol.asyncDispose]; 6294 } 6295 if (dispose === void 0) { 6296 if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); 6297 dispose = value[Symbol.dispose]; 6298 if (async) inner = dispose; 6299 } 6300 if (typeof dispose !== "function") throw new TypeError("Object not disposable."); 6301 if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } }; 6302 env.stack.push({ value: value, dispose: dispose, async: async }); 6303 } 6304 else if (async) { 6305 env.stack.push({ async: true }); 6306 } 6307 return value; 6308 } 6309 6310 var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { 6311 var e = new Error(message); 6312 return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; 6313 }; 6314 6315 function __disposeResources(env) { 6316 function fail(e) { 6317 env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; 6318 env.hasError = true; 6319 } 6320 var r, s = 0; 6321 function next() { 6322 while (r = env.stack.pop()) { 6323 try { 6324 if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next); 6325 if (r.dispose) { 6326 var result = r.dispose.call(r.value); 6327 if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); 6328 } 6329 else s |= 1; 6330 } 6331 catch (e) { 6332 fail(e); 6333 } 6334 } 6335 if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve(); 6336 if (env.hasError) throw env.error; 6337 } 6338 return next(); 6339 } 6340 6341 function __rewriteRelativeImportExtension(path, preserveJsx) { 6342 if (typeof path === "string" && /^\.\.?\//.test(path)) { 6343 return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) { 6344 return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js"); 6345 }); 6346 } 6347 return path; 6348 } 6349 6350 /* harmony default export */ const tslib_es6 = ({ 6351 __extends, 6352 __assign, 6353 __rest, 6354 __decorate, 6355 __param, 6356 __esDecorate, 6357 __runInitializers, 6358 __propKey, 6359 __setFunctionName, 6360 __metadata, 6361 __awaiter, 6362 __generator, 6363 __createBinding, 6364 __exportStar, 6365 __values, 6366 __read, 6367 __spread, 6368 __spreadArrays, 6369 __spreadArray, 6370 __await, 6371 __asyncGenerator, 6372 __asyncDelegator, 6373 __asyncValues, 6374 __makeTemplateObject, 6375 __importStar, 6376 __importDefault, 6377 __classPrivateFieldGet, 6378 __classPrivateFieldSet, 6379 __classPrivateFieldIn, 6380 __addDisposableResource, 6381 __disposeResources, 6382 __rewriteRelativeImportExtension, 6383 }); 6384 6385 ;// ./node_modules/lower-case/dist.es2015/index.js 6386 /** 6387 * Source: ftp://ftp.unicode.org/Public/UCD/latest/ucd/SpecialCasing.txt 6388 */ 6389 var SUPPORTED_LOCALE = { 6390 tr: { 6391 regexp: /\u0130|\u0049|\u0049\u0307/g, 6392 map: { 6393 İ: "\u0069", 6394 I: "\u0131", 6395 İ: "\u0069", 6396 }, 6397 }, 6398 az: { 6399 regexp: /\u0130/g, 6400 map: { 6401 İ: "\u0069", 6402 I: "\u0131", 6403 İ: "\u0069", 6404 }, 6405 }, 6406 lt: { 6407 regexp: /\u0049|\u004A|\u012E|\u00CC|\u00CD|\u0128/g, 6408 map: { 6409 I: "\u0069\u0307", 6410 J: "\u006A\u0307", 6411 Į: "\u012F\u0307", 6412 Ì: "\u0069\u0307\u0300", 6413 Í: "\u0069\u0307\u0301", 6414 Ĩ: "\u0069\u0307\u0303", 6415 }, 6416 }, 6417 }; 6418 /** 6419 * Localized lower case. 6420 */ 6421 function localeLowerCase(str, locale) { 6422 var lang = SUPPORTED_LOCALE[locale.toLowerCase()]; 6423 if (lang) 6424 return lowerCase(str.replace(lang.regexp, function (m) { return lang.map[m]; })); 6425 return lowerCase(str); 6426 } 6427 /** 6428 * Lower case as a function. 6429 */ 6430 function lowerCase(str) { 6431 return str.toLowerCase(); 6432 } 6433 6434 ;// ./node_modules/no-case/dist.es2015/index.js 6435 6436 // Support camel case ("camelCase" -> "camel Case" and "CAMELCase" -> "CAMEL Case"). 6437 var DEFAULT_SPLIT_REGEXP = [/([a-z0-9])([A-Z])/g, /([A-Z])([A-Z][a-z])/g]; 6438 // Remove all non-word characters. 6439 var DEFAULT_STRIP_REGEXP = /[^A-Z0-9]+/gi; 6440 /** 6441 * Normalize the string into something other libraries can manipulate easier. 6442 */ 6443 function noCase(input, options) { 6444 if (options === void 0) { options = {}; } 6445 var _a = options.splitRegexp, splitRegexp = _a === void 0 ? DEFAULT_SPLIT_REGEXP : _a, _b = options.stripRegexp, stripRegexp = _b === void 0 ? DEFAULT_STRIP_REGEXP : _b, _c = options.transform, transform = _c === void 0 ? lowerCase : _c, _d = options.delimiter, delimiter = _d === void 0 ? " " : _d; 6446 var result = replace(replace(input, splitRegexp, "$1\0$2"), stripRegexp, "\0"); 6447 var start = 0; 6448 var end = result.length; 6449 // Trim the delimiter from around the output string. 6450 while (result.charAt(start) === "\0") 6451 start++; 6452 while (result.charAt(end - 1) === "\0") 6453 end--; 6454 // Transform each token independently. 6455 return result.slice(start, end).split("\0").map(transform).join(delimiter); 6456 } 6457 /** 6458 * Replace `re` in the input string with the replacement value. 6459 */ 6460 function replace(input, re, value) { 6461 if (re instanceof RegExp) 6462 return input.replace(re, value); 6463 return re.reduce(function (input, re) { return input.replace(re, value); }, input); 6464 } 6465 6466 ;// ./node_modules/pascal-case/dist.es2015/index.js 6467 6468 6469 function pascalCaseTransform(input, index) { 6470 var firstChar = input.charAt(0); 6471 var lowerChars = input.substr(1).toLowerCase(); 6472 if (index > 0 && firstChar >= "0" && firstChar <= "9") { 6473 return "_" + firstChar + lowerChars; 6474 } 6475 return "" + firstChar.toUpperCase() + lowerChars; 6476 } 6477 function dist_es2015_pascalCaseTransformMerge(input) { 6478 return input.charAt(0).toUpperCase() + input.slice(1).toLowerCase(); 6479 } 6480 function pascalCase(input, options) { 6481 if (options === void 0) { options = {}; } 6482 return noCase(input, __assign({ delimiter: "", transform: pascalCaseTransform }, options)); 6483 } 6484 6485 ;// ./node_modules/camel-case/dist.es2015/index.js 6486 6487 6488 function camelCaseTransform(input, index) { 6489 if (index === 0) 6490 return input.toLowerCase(); 6491 return pascalCaseTransform(input, index); 6492 } 6493 function camelCaseTransformMerge(input, index) { 6494 if (index === 0) 6495 return input.toLowerCase(); 6496 return pascalCaseTransformMerge(input); 6497 } 6498 function camelCase(input, options) { 6499 if (options === void 0) { options = {}; } 6500 return pascalCase(input, __assign({ transform: camelCaseTransform }, options)); 6501 } 6502 6503 ;// external ["wp","i18n"] 6504 const external_wp_i18n_namespaceObject = window["wp"]["i18n"]; 6505 ;// ./node_modules/colord/index.mjs 6506 var r={grad:.9,turn:360,rad:360/(2*Math.PI)},t=function(r){return"string"==typeof r?r.length>0:"number"==typeof r},n=function(r,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*r)/n+0},e=function(r,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),r>n?n:r>t?r:t},u=function(r){return(r=isFinite(r)?r%360:0)>0?r:r+360},a=function(r){return{r:e(r.r,0,255),g:e(r.g,0,255),b:e(r.b,0,255),a:e(r.a)}},o=function(r){return{r:n(r.r),g:n(r.g),b:n(r.b),a:n(r.a,3)}},i=/^#([0-9a-f]{3,8})$/i,s=function(r){var t=r.toString(16);return t.length<2?"0"+t:t},h=function(r){var t=r.r,n=r.g,e=r.b,u=r.a,a=Math.max(t,n,e),o=a-Math.min(t,n,e),i=o?a===t?(n-e)/o:a===n?2+(e-t)/o:4+(t-n)/o:0;return{h:60*(i<0?i+6:i),s:a?o/a*100:0,v:a/255*100,a:u}},b=function(r){var t=r.h,n=r.s,e=r.v,u=r.a;t=t/360*6,n/=100,e/=100;var a=Math.floor(t),o=e*(1-n),i=e*(1-(t-a)*n),s=e*(1-(1-t+a)*n),h=a%6;return{r:255*[e,i,o,o,s,e][h],g:255*[s,e,e,i,o,o][h],b:255*[o,o,s,e,e,i][h],a:u}},g=function(r){return{h:u(r.h),s:e(r.s,0,100),l:e(r.l,0,100),a:e(r.a)}},d=function(r){return{h:n(r.h),s:n(r.s),l:n(r.l),a:n(r.a,3)}},f=function(r){return b((n=(t=r).s,{h:t.h,s:(n*=((e=t.l)<50?e:100-e)/100)>0?2*n/(e+n)*100:0,v:e+n,a:t.a}));var t,n,e},c=function(r){return{h:(t=h(r)).h,s:(u=(200-(n=t.s))*(e=t.v)/100)>0&&u<200?n*e/100/(u<=100?u:200-u)*100:0,l:u/2,a:t.a};var t,n,e,u},l=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,p=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,v=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,m=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,y={string:[[function(r){var t=i.exec(r);return t?(r=t[1]).length<=4?{r:parseInt(r[0]+r[0],16),g:parseInt(r[1]+r[1],16),b:parseInt(r[2]+r[2],16),a:4===r.length?n(parseInt(r[3]+r[3],16)/255,2):1}:6===r.length||8===r.length?{r:parseInt(r.substr(0,2),16),g:parseInt(r.substr(2,2),16),b:parseInt(r.substr(4,2),16),a:8===r.length?n(parseInt(r.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(r){var t=v.exec(r)||m.exec(r);return t?t[2]!==t[4]||t[4]!==t[6]?null:a({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(t){var n=l.exec(t)||p.exec(t);if(!n)return null;var e,u,a=g({h:(e=n[1],u=n[2],void 0===u&&(u="deg"),Number(e)*(r[u]||1)),s:Number(n[3]),l:Number(n[4]),a:void 0===n[5]?1:Number(n[5])/(n[6]?100:1)});return f(a)},"hsl"]],object:[[function(r){var n=r.r,e=r.g,u=r.b,o=r.a,i=void 0===o?1:o;return t(n)&&t(e)&&t(u)?a({r:Number(n),g:Number(e),b:Number(u),a:Number(i)}):null},"rgb"],[function(r){var n=r.h,e=r.s,u=r.l,a=r.a,o=void 0===a?1:a;if(!t(n)||!t(e)||!t(u))return null;var i=g({h:Number(n),s:Number(e),l:Number(u),a:Number(o)});return f(i)},"hsl"],[function(r){var n=r.h,a=r.s,o=r.v,i=r.a,s=void 0===i?1:i;if(!t(n)||!t(a)||!t(o))return null;var h=function(r){return{h:u(r.h),s:e(r.s,0,100),v:e(r.v,0,100),a:e(r.a)}}({h:Number(n),s:Number(a),v:Number(o),a:Number(s)});return b(h)},"hsv"]]},N=function(r,t){for(var n=0;n<t.length;n++){var e=t[n][0](r);if(e)return[e,t[n][1]]}return[null,void 0]},x=function(r){return"string"==typeof r?N(r.trim(),y.string):"object"==typeof r&&null!==r?N(r,y.object):[null,void 0]},I=function(r){return x(r)[1]},M=function(r,t){var n=c(r);return{h:n.h,s:e(n.s+100*t,0,100),l:n.l,a:n.a}},H=function(r){return(299*r.r+587*r.g+114*r.b)/1e3/255},$=function(r,t){var n=c(r);return{h:n.h,s:n.s,l:e(n.l+100*t,0,100),a:n.a}},j=function(){function r(r){this.parsed=x(r)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return r.prototype.isValid=function(){return null!==this.parsed},r.prototype.brightness=function(){return n(H(this.rgba),2)},r.prototype.isDark=function(){return H(this.rgba)<.5},r.prototype.isLight=function(){return H(this.rgba)>=.5},r.prototype.toHex=function(){return r=o(this.rgba),t=r.r,e=r.g,u=r.b,i=(a=r.a)<1?s(n(255*a)):"","#"+s(t)+s(e)+s(u)+i;var r,t,e,u,a,i},r.prototype.toRgb=function(){return o(this.rgba)},r.prototype.toRgbString=function(){return r=o(this.rgba),t=r.r,n=r.g,e=r.b,(u=r.a)<1?"rgba("+t+", "+n+", "+e+", "+u+")":"rgb("+t+", "+n+", "+e+")";var r,t,n,e,u},r.prototype.toHsl=function(){return d(c(this.rgba))},r.prototype.toHslString=function(){return r=d(c(this.rgba)),t=r.h,n=r.s,e=r.l,(u=r.a)<1?"hsla("+t+", "+n+"%, "+e+"%, "+u+")":"hsl("+t+", "+n+"%, "+e+"%)";var r,t,n,e,u},r.prototype.toHsv=function(){return r=h(this.rgba),{h:n(r.h),s:n(r.s),v:n(r.v),a:n(r.a,3)};var r},r.prototype.invert=function(){return w({r:255-(r=this.rgba).r,g:255-r.g,b:255-r.b,a:r.a});var r},r.prototype.saturate=function(r){return void 0===r&&(r=.1),w(M(this.rgba,r))},r.prototype.desaturate=function(r){return void 0===r&&(r=.1),w(M(this.rgba,-r))},r.prototype.grayscale=function(){return w(M(this.rgba,-1))},r.prototype.lighten=function(r){return void 0===r&&(r=.1),w($(this.rgba,r))},r.prototype.darken=function(r){return void 0===r&&(r=.1),w($(this.rgba,-r))},r.prototype.rotate=function(r){return void 0===r&&(r=15),this.hue(this.hue()+r)},r.prototype.alpha=function(r){return"number"==typeof r?w({r:(t=this.rgba).r,g:t.g,b:t.b,a:r}):n(this.rgba.a,3);var t},r.prototype.hue=function(r){var t=c(this.rgba);return"number"==typeof r?w({h:r,s:t.s,l:t.l,a:t.a}):n(t.h)},r.prototype.isEqual=function(r){return this.toHex()===w(r).toHex()},r}(),w=function(r){return r instanceof j?r:new j(r)},S=[],k=function(r){r.forEach(function(r){S.indexOf(r)<0&&(r(j,y),S.push(r))})},E=function(){return new j({r:255*Math.random(),g:255*Math.random(),b:255*Math.random()})}; 6507 6508 ;// ./node_modules/colord/plugins/names.mjs 6509 /* harmony default export */ function names(e,f){var a={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},r={};for(var d in a)r[a[d]]=d;var l={};e.prototype.toName=function(f){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var d,i,n=r[this.toHex()];if(n)return n;if(null==f?void 0:f.closest){var o=this.toRgb(),t=1/0,b="black";if(!l.length)for(var c in a)l[c]=new e(a[c]).toRgb();for(var g in a){var u=(d=o,i=l[g],Math.pow(d.r-i.r,2)+Math.pow(d.g-i.g,2)+Math.pow(d.b-i.b,2));u<t&&(t=u,b=g)}return b}};f.string.push([function(f){var r=f.toLowerCase(),d="transparent"===r?"#0000":a[r];return d?new e(d).toRgb():null},"name"])} 6510 6511 ;// ./node_modules/colord/plugins/a11y.mjs 6512 var a11y_o=function(o){var t=o/255;return t<.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},a11y_t=function(t){return.2126*a11y_o(t.r)+.7152*a11y_o(t.g)+.0722*a11y_o(t.b)};/* harmony default export */ function a11y(o){o.prototype.luminance=function(){return o=a11y_t(this.rgba),void 0===(r=2)&&(r=0),void 0===n&&(n=Math.pow(10,r)),Math.round(n*o)/n+0;var o,r,n},o.prototype.contrast=function(r){void 0===r&&(r="#FFF");var n,a,i,e,v,u,d,c=r instanceof o?r:new o(r);return e=this.rgba,v=c.toRgb(),u=a11y_t(e),d=a11y_t(v),n=u>d?(u+.05)/(d+.05):(d+.05)/(u+.05),void 0===(a=2)&&(a=0),void 0===i&&(i=Math.pow(10,a)),Math.floor(i*n)/i+0},o.prototype.isReadable=function(o,t){return void 0===o&&(o="#FFF"),void 0===t&&(t={}),this.contrast(o)>=(e=void 0===(i=(r=t).size)?"normal":i,"AAA"===(a=void 0===(n=r.level)?"AA":n)&&"normal"===e?7:"AA"===a&&"large"===e?3:4.5);var r,n,a,i,e}} 6513 6514 ;// external ["wp","element"] 6515 const external_wp_element_namespaceObject = window["wp"]["element"]; 6516 ;// external ["wp","dom"] 6517 const external_wp_dom_namespaceObject = window["wp"]["dom"]; 6518 ;// external ["wp","richText"] 6519 const external_wp_richText_namespaceObject = window["wp"]["richText"]; 6520 ;// external ["wp","deprecated"] 6521 const external_wp_deprecated_namespaceObject = window["wp"]["deprecated"]; 6522 var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_namespaceObject); 6523 ;// ./node_modules/@wordpress/blocks/build-module/api/constants.js 6524 const BLOCK_ICON_DEFAULT = "block-default"; 6525 const DEPRECATED_ENTRY_KEYS = [ 6526 "attributes", 6527 "supports", 6528 "save", 6529 "migrate", 6530 "isEligible", 6531 "apiVersion" 6532 ]; 6533 const __EXPERIMENTAL_STYLE_PROPERTY = { 6534 // Kept for back-compatibility purposes. 6535 "--wp--style--color--link": { 6536 value: ["color", "link"], 6537 support: ["color", "link"] 6538 }, 6539 aspectRatio: { 6540 value: ["dimensions", "aspectRatio"], 6541 support: ["dimensions", "aspectRatio"], 6542 useEngine: true 6543 }, 6544 background: { 6545 value: ["color", "gradient"], 6546 support: ["color", "gradients"], 6547 useEngine: true 6548 }, 6549 backgroundColor: { 6550 value: ["color", "background"], 6551 support: ["color", "background"], 6552 requiresOptOut: true, 6553 useEngine: true 6554 }, 6555 backgroundImage: { 6556 value: ["background", "backgroundImage"], 6557 support: ["background", "backgroundImage"], 6558 useEngine: true 6559 }, 6560 backgroundRepeat: { 6561 value: ["background", "backgroundRepeat"], 6562 support: ["background", "backgroundRepeat"], 6563 useEngine: true 6564 }, 6565 backgroundSize: { 6566 value: ["background", "backgroundSize"], 6567 support: ["background", "backgroundSize"], 6568 useEngine: true 6569 }, 6570 backgroundPosition: { 6571 value: ["background", "backgroundPosition"], 6572 support: ["background", "backgroundPosition"], 6573 useEngine: true 6574 }, 6575 borderColor: { 6576 value: ["border", "color"], 6577 support: ["__experimentalBorder", "color"], 6578 useEngine: true 6579 }, 6580 borderRadius: { 6581 value: ["border", "radius"], 6582 support: ["__experimentalBorder", "radius"], 6583 properties: { 6584 borderTopLeftRadius: "topLeft", 6585 borderTopRightRadius: "topRight", 6586 borderBottomLeftRadius: "bottomLeft", 6587 borderBottomRightRadius: "bottomRight" 6588 }, 6589 useEngine: true 6590 }, 6591 borderStyle: { 6592 value: ["border", "style"], 6593 support: ["__experimentalBorder", "style"], 6594 useEngine: true 6595 }, 6596 borderWidth: { 6597 value: ["border", "width"], 6598 support: ["__experimentalBorder", "width"], 6599 useEngine: true 6600 }, 6601 borderTopColor: { 6602 value: ["border", "top", "color"], 6603 support: ["__experimentalBorder", "color"], 6604 useEngine: true 6605 }, 6606 borderTopStyle: { 6607 value: ["border", "top", "style"], 6608 support: ["__experimentalBorder", "style"], 6609 useEngine: true 6610 }, 6611 borderTopWidth: { 6612 value: ["border", "top", "width"], 6613 support: ["__experimentalBorder", "width"], 6614 useEngine: true 6615 }, 6616 borderRightColor: { 6617 value: ["border", "right", "color"], 6618 support: ["__experimentalBorder", "color"], 6619 useEngine: true 6620 }, 6621 borderRightStyle: { 6622 value: ["border", "right", "style"], 6623 support: ["__experimentalBorder", "style"], 6624 useEngine: true 6625 }, 6626 borderRightWidth: { 6627 value: ["border", "right", "width"], 6628 support: ["__experimentalBorder", "width"], 6629 useEngine: true 6630 }, 6631 borderBottomColor: { 6632 value: ["border", "bottom", "color"], 6633 support: ["__experimentalBorder", "color"], 6634 useEngine: true 6635 }, 6636 borderBottomStyle: { 6637 value: ["border", "bottom", "style"], 6638 support: ["__experimentalBorder", "style"], 6639 useEngine: true 6640 }, 6641 borderBottomWidth: { 6642 value: ["border", "bottom", "width"], 6643 support: ["__experimentalBorder", "width"], 6644 useEngine: true 6645 }, 6646 borderLeftColor: { 6647 value: ["border", "left", "color"], 6648 support: ["__experimentalBorder", "color"], 6649 useEngine: true 6650 }, 6651 borderLeftStyle: { 6652 value: ["border", "left", "style"], 6653 support: ["__experimentalBorder", "style"], 6654 useEngine: true 6655 }, 6656 borderLeftWidth: { 6657 value: ["border", "left", "width"], 6658 support: ["__experimentalBorder", "width"], 6659 useEngine: true 6660 }, 6661 color: { 6662 value: ["color", "text"], 6663 support: ["color", "text"], 6664 requiresOptOut: true, 6665 useEngine: true 6666 }, 6667 columnCount: { 6668 value: ["typography", "textColumns"], 6669 support: ["typography", "textColumns"], 6670 useEngine: true 6671 }, 6672 filter: { 6673 value: ["filter", "duotone"], 6674 support: ["filter", "duotone"] 6675 }, 6676 linkColor: { 6677 value: ["elements", "link", "color", "text"], 6678 support: ["color", "link"] 6679 }, 6680 captionColor: { 6681 value: ["elements", "caption", "color", "text"], 6682 support: ["color", "caption"] 6683 }, 6684 buttonColor: { 6685 value: ["elements", "button", "color", "text"], 6686 support: ["color", "button"] 6687 }, 6688 buttonBackgroundColor: { 6689 value: ["elements", "button", "color", "background"], 6690 support: ["color", "button"] 6691 }, 6692 headingColor: { 6693 value: ["elements", "heading", "color", "text"], 6694 support: ["color", "heading"] 6695 }, 6696 headingBackgroundColor: { 6697 value: ["elements", "heading", "color", "background"], 6698 support: ["color", "heading"] 6699 }, 6700 fontFamily: { 6701 value: ["typography", "fontFamily"], 6702 support: ["typography", "__experimentalFontFamily"], 6703 useEngine: true 6704 }, 6705 fontSize: { 6706 value: ["typography", "fontSize"], 6707 support: ["typography", "fontSize"], 6708 useEngine: true 6709 }, 6710 fontStyle: { 6711 value: ["typography", "fontStyle"], 6712 support: ["typography", "__experimentalFontStyle"], 6713 useEngine: true 6714 }, 6715 fontWeight: { 6716 value: ["typography", "fontWeight"], 6717 support: ["typography", "__experimentalFontWeight"], 6718 useEngine: true 6719 }, 6720 lineHeight: { 6721 value: ["typography", "lineHeight"], 6722 support: ["typography", "lineHeight"], 6723 useEngine: true 6724 }, 6725 margin: { 6726 value: ["spacing", "margin"], 6727 support: ["spacing", "margin"], 6728 properties: { 6729 marginTop: "top", 6730 marginRight: "right", 6731 marginBottom: "bottom", 6732 marginLeft: "left" 6733 }, 6734 useEngine: true 6735 }, 6736 minHeight: { 6737 value: ["dimensions", "minHeight"], 6738 support: ["dimensions", "minHeight"], 6739 useEngine: true 6740 }, 6741 padding: { 6742 value: ["spacing", "padding"], 6743 support: ["spacing", "padding"], 6744 properties: { 6745 paddingTop: "top", 6746 paddingRight: "right", 6747 paddingBottom: "bottom", 6748 paddingLeft: "left" 6749 }, 6750 useEngine: true 6751 }, 6752 textAlign: { 6753 value: ["typography", "textAlign"], 6754 support: ["typography", "textAlign"], 6755 useEngine: false 6756 }, 6757 textDecoration: { 6758 value: ["typography", "textDecoration"], 6759 support: ["typography", "__experimentalTextDecoration"], 6760 useEngine: true 6761 }, 6762 textTransform: { 6763 value: ["typography", "textTransform"], 6764 support: ["typography", "__experimentalTextTransform"], 6765 useEngine: true 6766 }, 6767 letterSpacing: { 6768 value: ["typography", "letterSpacing"], 6769 support: ["typography", "__experimentalLetterSpacing"], 6770 useEngine: true 6771 }, 6772 writingMode: { 6773 value: ["typography", "writingMode"], 6774 support: ["typography", "__experimentalWritingMode"], 6775 useEngine: true 6776 }, 6777 "--wp--style--root--padding": { 6778 value: ["spacing", "padding"], 6779 support: ["spacing", "padding"], 6780 properties: { 6781 "--wp--style--root--padding-top": "top", 6782 "--wp--style--root--padding-right": "right", 6783 "--wp--style--root--padding-bottom": "bottom", 6784 "--wp--style--root--padding-left": "left" 6785 }, 6786 rootOnly: true 6787 } 6788 }; 6789 const __EXPERIMENTAL_ELEMENTS = { 6790 link: "a:where(:not(.wp-element-button))", 6791 heading: "h1, h2, h3, h4, h5, h6", 6792 h1: "h1", 6793 h2: "h2", 6794 h3: "h3", 6795 h4: "h4", 6796 h5: "h5", 6797 h6: "h6", 6798 button: ".wp-element-button, .wp-block-button__link", 6799 caption: ".wp-element-caption, .wp-block-audio figcaption, .wp-block-embed figcaption, .wp-block-gallery figcaption, .wp-block-image figcaption, .wp-block-table figcaption, .wp-block-video figcaption", 6800 cite: "cite", 6801 select: "select", 6802 textInput: "textarea, input:where([type=email],[type=number],[type=password],[type=search],[type=tel],[type=text],[type=url])" 6803 }; 6804 const __EXPERIMENTAL_PATHS_WITH_OVERRIDE = { 6805 "color.duotone": true, 6806 "color.gradients": true, 6807 "color.palette": true, 6808 "dimensions.aspectRatios": true, 6809 "typography.fontSizes": true, 6810 "spacing.spacingSizes": true 6811 }; 6812 6813 6814 ;// external ["wp","warning"] 6815 const external_wp_warning_namespaceObject = window["wp"]["warning"]; 6816 var external_wp_warning_default = /*#__PURE__*/__webpack_require__.n(external_wp_warning_namespaceObject); 6817 ;// ./node_modules/@wordpress/blocks/build-module/api/i18n-block.json 6818 const i18n_block_namespaceObject = /*#__PURE__*/JSON.parse('{"title":"block title","description":"block description","keywords":["block keyword"],"styles":[{"label":"block style label"}],"variations":[{"title":"block variation title","description":"block variation description","keywords":["block variation keyword"]}]}'); 6819 ;// external ["wp","privateApis"] 6820 const external_wp_privateApis_namespaceObject = window["wp"]["privateApis"]; 6821 ;// ./node_modules/@wordpress/blocks/build-module/lock-unlock.js 6822 6823 const { lock, unlock } = (0,external_wp_privateApis_namespaceObject.__dangerousOptInToUnstableAPIsOnlyForCoreModules)( 6824 "I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.", 6825 "@wordpress/blocks" 6826 ); 6827 6828 6829 ;// ./node_modules/@wordpress/blocks/build-module/api/registration.js 6830 6831 6832 6833 6834 6835 6836 function isObject(object) { 6837 return object !== null && typeof object === "object"; 6838 } 6839 function unstable__bootstrapServerSideBlockDefinitions(definitions) { 6840 const { addBootstrappedBlockType } = unlock((0,external_wp_data_namespaceObject.dispatch)(store)); 6841 for (const [name, blockType] of Object.entries(definitions)) { 6842 addBootstrappedBlockType(name, blockType); 6843 } 6844 } 6845 function getBlockSettingsFromMetadata({ textdomain, ...metadata }) { 6846 const allowedFields = [ 6847 "apiVersion", 6848 "title", 6849 "category", 6850 "parent", 6851 "ancestor", 6852 "icon", 6853 "description", 6854 "keywords", 6855 "attributes", 6856 "providesContext", 6857 "usesContext", 6858 "selectors", 6859 "supports", 6860 "styles", 6861 "example", 6862 "variations", 6863 "blockHooks", 6864 "allowedBlocks" 6865 ]; 6866 const settings = Object.fromEntries( 6867 Object.entries(metadata).filter( 6868 ([key]) => allowedFields.includes(key) 6869 ) 6870 ); 6871 if (textdomain) { 6872 Object.keys(i18n_block_namespaceObject).forEach((key) => { 6873 if (!settings[key]) { 6874 return; 6875 } 6876 settings[key] = translateBlockSettingUsingI18nSchema( 6877 i18n_block_namespaceObject[key], 6878 settings[key], 6879 textdomain 6880 ); 6881 }); 6882 } 6883 return settings; 6884 } 6885 function registerBlockType(blockNameOrMetadata, settings) { 6886 const name = isObject(blockNameOrMetadata) ? blockNameOrMetadata.name : blockNameOrMetadata; 6887 if (typeof name !== "string") { 6888 external_wp_warning_default()("Block names must be strings."); 6889 return; 6890 } 6891 if (!/^[a-z][a-z0-9-]*\/[a-z][a-z0-9-]*$/.test(name)) { 6892 external_wp_warning_default()( 6893 "Block names must contain a namespace prefix, include only lowercase alphanumeric characters or dashes, and start with a letter. Example: my-plugin/my-custom-block" 6894 ); 6895 return; 6896 } 6897 if ((0,external_wp_data_namespaceObject.select)(store).getBlockType(name)) { 6898 external_wp_warning_default()('Block "' + name + '" is already registered.'); 6899 return; 6900 } 6901 const { addBootstrappedBlockType, addUnprocessedBlockType } = unlock( 6902 (0,external_wp_data_namespaceObject.dispatch)(store) 6903 ); 6904 if (isObject(blockNameOrMetadata)) { 6905 const metadata = getBlockSettingsFromMetadata(blockNameOrMetadata); 6906 addBootstrappedBlockType(name, metadata); 6907 } 6908 addUnprocessedBlockType(name, settings); 6909 return (0,external_wp_data_namespaceObject.select)(store).getBlockType(name); 6910 } 6911 function translateBlockSettingUsingI18nSchema(i18nSchema, settingValue, textdomain) { 6912 if (typeof i18nSchema === "string" && typeof settingValue === "string") { 6913 return (0,external_wp_i18n_namespaceObject._x)(settingValue, i18nSchema, textdomain); 6914 } 6915 if (Array.isArray(i18nSchema) && i18nSchema.length && Array.isArray(settingValue)) { 6916 return settingValue.map( 6917 (value) => translateBlockSettingUsingI18nSchema( 6918 i18nSchema[0], 6919 value, 6920 textdomain 6921 ) 6922 ); 6923 } 6924 if (isObject(i18nSchema) && Object.entries(i18nSchema).length && isObject(settingValue)) { 6925 return Object.keys(settingValue).reduce((accumulator, key) => { 6926 if (!i18nSchema[key]) { 6927 accumulator[key] = settingValue[key]; 6928 return accumulator; 6929 } 6930 accumulator[key] = translateBlockSettingUsingI18nSchema( 6931 i18nSchema[key], 6932 settingValue[key], 6933 textdomain 6934 ); 6935 return accumulator; 6936 }, {}); 6937 } 6938 return settingValue; 6939 } 6940 function registerBlockCollection(namespace, { title, icon }) { 6941 (0,external_wp_data_namespaceObject.dispatch)(store).addBlockCollection(namespace, title, icon); 6942 } 6943 function unregisterBlockCollection(namespace) { 6944 dispatch(blocksStore).removeBlockCollection(namespace); 6945 } 6946 function unregisterBlockType(name) { 6947 const oldBlock = (0,external_wp_data_namespaceObject.select)(store).getBlockType(name); 6948 if (!oldBlock) { 6949 external_wp_warning_default()('Block "' + name + '" is not registered.'); 6950 return; 6951 } 6952 (0,external_wp_data_namespaceObject.dispatch)(store).removeBlockTypes(name); 6953 return oldBlock; 6954 } 6955 function setFreeformContentHandlerName(blockName) { 6956 (0,external_wp_data_namespaceObject.dispatch)(store).setFreeformFallbackBlockName(blockName); 6957 } 6958 function getFreeformContentHandlerName() { 6959 return (0,external_wp_data_namespaceObject.select)(store).getFreeformFallbackBlockName(); 6960 } 6961 function getGroupingBlockName() { 6962 return (0,external_wp_data_namespaceObject.select)(store).getGroupingBlockName(); 6963 } 6964 function setUnregisteredTypeHandlerName(blockName) { 6965 (0,external_wp_data_namespaceObject.dispatch)(store).setUnregisteredFallbackBlockName(blockName); 6966 } 6967 function getUnregisteredTypeHandlerName() { 6968 return (0,external_wp_data_namespaceObject.select)(store).getUnregisteredFallbackBlockName(); 6969 } 6970 function setDefaultBlockName(name) { 6971 (0,external_wp_data_namespaceObject.dispatch)(store).setDefaultBlockName(name); 6972 } 6973 function setGroupingBlockName(name) { 6974 (0,external_wp_data_namespaceObject.dispatch)(store).setGroupingBlockName(name); 6975 } 6976 function getDefaultBlockName() { 6977 return (0,external_wp_data_namespaceObject.select)(store).getDefaultBlockName(); 6978 } 6979 function getBlockType(name) { 6980 return (0,external_wp_data_namespaceObject.select)(store)?.getBlockType(name); 6981 } 6982 function getBlockTypes() { 6983 return (0,external_wp_data_namespaceObject.select)(store).getBlockTypes(); 6984 } 6985 function getBlockSupport(nameOrType, feature, defaultSupports) { 6986 return (0,external_wp_data_namespaceObject.select)(store).getBlockSupport( 6987 nameOrType, 6988 feature, 6989 defaultSupports 6990 ); 6991 } 6992 function hasBlockSupport(nameOrType, feature, defaultSupports) { 6993 return (0,external_wp_data_namespaceObject.select)(store).hasBlockSupport( 6994 nameOrType, 6995 feature, 6996 defaultSupports 6997 ); 6998 } 6999 function isReusableBlock(blockOrType) { 7000 return blockOrType?.name === "core/block"; 7001 } 7002 function isTemplatePart(blockOrType) { 7003 return blockOrType?.name === "core/template-part"; 7004 } 7005 const getChildBlockNames = (blockName) => { 7006 return (0,external_wp_data_namespaceObject.select)(store).getChildBlockNames(blockName); 7007 }; 7008 const hasChildBlocks = (blockName) => { 7009 return (0,external_wp_data_namespaceObject.select)(store).hasChildBlocks(blockName); 7010 }; 7011 const hasChildBlocksWithInserterSupport = (blockName) => { 7012 return (0,external_wp_data_namespaceObject.select)(store).hasChildBlocksWithInserterSupport(blockName); 7013 }; 7014 const registerBlockStyle = (blockNames, styleVariation) => { 7015 (0,external_wp_data_namespaceObject.dispatch)(store).addBlockStyles(blockNames, styleVariation); 7016 }; 7017 const unregisterBlockStyle = (blockName, styleVariationName) => { 7018 (0,external_wp_data_namespaceObject.dispatch)(store).removeBlockStyles(blockName, styleVariationName); 7019 }; 7020 const getBlockVariations = (blockName, scope) => { 7021 return (0,external_wp_data_namespaceObject.select)(store).getBlockVariations(blockName, scope); 7022 }; 7023 const registerBlockVariation = (blockName, variation) => { 7024 if (typeof variation.name !== "string") { 7025 external_wp_warning_default()("Variation names must be unique strings."); 7026 } 7027 (0,external_wp_data_namespaceObject.dispatch)(store).addBlockVariations(blockName, variation); 7028 }; 7029 const unregisterBlockVariation = (blockName, variationName) => { 7030 (0,external_wp_data_namespaceObject.dispatch)(store).removeBlockVariations(blockName, variationName); 7031 }; 7032 const registerBlockBindingsSource = (source) => { 7033 const { 7034 name, 7035 label, 7036 usesContext, 7037 getValues, 7038 setValues, 7039 canUserEditValue, 7040 getFieldsList, 7041 editorUI 7042 } = source; 7043 const existingSource = unlock( 7044 (0,external_wp_data_namespaceObject.select)(store) 7045 ).getBlockBindingsSource(name); 7046 const serverProps = ["label", "usesContext"]; 7047 for (const prop in existingSource) { 7048 if (!serverProps.includes(prop) && existingSource[prop]) { 7049 external_wp_warning_default()( 7050 'Block bindings source "' + name + '" is already registered.' 7051 ); 7052 return; 7053 } 7054 } 7055 if (!name) { 7056 external_wp_warning_default()("Block bindings source must contain a name."); 7057 return; 7058 } 7059 if (typeof name !== "string") { 7060 external_wp_warning_default()("Block bindings source name must be a string."); 7061 return; 7062 } 7063 if (/[A-Z]+/.test(name)) { 7064 external_wp_warning_default()( 7065 "Block bindings source name must not contain uppercase characters." 7066 ); 7067 return; 7068 } 7069 if (!/^[a-z0-9/-]+$/.test(name)) { 7070 external_wp_warning_default()( 7071 "Block bindings source name must contain only valid characters: lowercase characters, hyphens, or digits. Example: my-plugin/my-custom-source." 7072 ); 7073 return; 7074 } 7075 if (!/^[a-z0-9-]+\/[a-z0-9-]+$/.test(name)) { 7076 external_wp_warning_default()( 7077 "Block bindings source name must contain a namespace and valid characters. Example: my-plugin/my-custom-source." 7078 ); 7079 return; 7080 } 7081 if (!label && !existingSource?.label) { 7082 external_wp_warning_default()("Block bindings source must contain a label."); 7083 return; 7084 } 7085 if (label && typeof label !== "string") { 7086 external_wp_warning_default()("Block bindings source label must be a string."); 7087 return; 7088 } 7089 if (label && existingSource?.label && label !== existingSource?.label) { 7090 external_wp_warning_default()('Block bindings "' + name + '" source label was overridden.'); 7091 } 7092 if (usesContext && !Array.isArray(usesContext)) { 7093 external_wp_warning_default()("Block bindings source usesContext must be an array."); 7094 return; 7095 } 7096 if (getValues && typeof getValues !== "function") { 7097 external_wp_warning_default()("Block bindings source getValues must be a function."); 7098 return; 7099 } 7100 if (setValues && typeof setValues !== "function") { 7101 external_wp_warning_default()("Block bindings source setValues must be a function."); 7102 return; 7103 } 7104 if (canUserEditValue && typeof canUserEditValue !== "function") { 7105 external_wp_warning_default()("Block bindings source canUserEditValue must be a function."); 7106 return; 7107 } 7108 if (getFieldsList && typeof getFieldsList !== "function") { 7109 external_wp_warning_default()("Block bindings source getFieldsList must be a function."); 7110 return; 7111 } 7112 if (editorUI) { 7113 if (typeof editorUI === "function") { 7114 return unlock((0,external_wp_data_namespaceObject.dispatch)(store)).addBlockBindingsSource( 7115 source 7116 ); 7117 } 7118 if (typeof editorUI !== "object" || Array.isArray(editorUI)) { 7119 external_wp_warning_default()("EditorUI must be an object or a function"); 7120 return; 7121 } 7122 const { mode, data } = editorUI; 7123 if (mode && !["dropdown", "modal"].includes(mode)) { 7124 external_wp_warning_default()('EditorUI mode must be either "dropdown" or "modal"'); 7125 return; 7126 } 7127 if (mode === "dropdown") { 7128 if (!data || !Array.isArray(data)) { 7129 external_wp_warning_default()( 7130 "EditorUI data must be an array of field objects for dropdown mode" 7131 ); 7132 return; 7133 } 7134 for (const field of data) { 7135 if (!field || typeof field !== "object") { 7136 external_wp_warning_default()("Each field must be an object"); 7137 return; 7138 } 7139 if (!field.label || !field.args) { 7140 external_wp_warning_default()( 7141 'Each field must have "label" and "args" properties' 7142 ); 7143 return; 7144 } 7145 if (typeof field.label !== "string") { 7146 external_wp_warning_default()('Field "label" property must be a string'); 7147 return; 7148 } 7149 if (field.type) { 7150 const validTypes = [ 7151 "null", 7152 "boolean", 7153 "object", 7154 "array", 7155 "string", 7156 "integer", 7157 "number" 7158 ]; 7159 if (!validTypes.includes(field.type)) { 7160 external_wp_warning_default()( 7161 'Field "type" must be one of: ' + validTypes.join(", ") 7162 ); 7163 return; 7164 } 7165 if (field.format) { 7166 if (field.type !== "string") { 7167 external_wp_warning_default()( 7168 'Field "format" can only be used with string type' 7169 ); 7170 return; 7171 } 7172 const validFormats = [ 7173 "date-time", 7174 "uri", 7175 "email", 7176 "ip", 7177 "uuid", 7178 "hex-color" 7179 ]; 7180 if (!validFormats.includes(field.format)) { 7181 external_wp_warning_default()( 7182 'Field "format" must be one of: ' + validFormats.join(", ") 7183 ); 7184 return; 7185 } 7186 } 7187 } 7188 } 7189 } else if (mode === "modal") { 7190 if (!editorUI.renderModalContent) { 7191 external_wp_warning_default()("Modal mode requires renderModalContent function"); 7192 return; 7193 } 7194 if (typeof editorUI.renderModalContent !== "function") { 7195 external_wp_warning_default()("renderModalContent must be a function"); 7196 return; 7197 } 7198 } 7199 } 7200 return unlock((0,external_wp_data_namespaceObject.dispatch)(store)).addBlockBindingsSource(source); 7201 }; 7202 function unregisterBlockBindingsSource(name) { 7203 const oldSource = getBlockBindingsSource(name); 7204 if (!oldSource) { 7205 external_wp_warning_default()('Block bindings source "' + name + '" is not registered.'); 7206 return; 7207 } 7208 unlock((0,external_wp_data_namespaceObject.dispatch)(store)).removeBlockBindingsSource(name); 7209 } 7210 function getBlockBindingsSource(name) { 7211 return unlock((0,external_wp_data_namespaceObject.select)(store)).getBlockBindingsSource(name); 7212 } 7213 function getBlockBindingsSources() { 7214 return unlock((0,external_wp_data_namespaceObject.select)(store)).getAllBlockBindingsSources(); 7215 } 7216 7217 7218 ;// ./node_modules/@wordpress/blocks/build-module/api/utils.js 7219 7220 7221 7222 7223 7224 7225 7226 7227 7228 7229 k([names, a11y]); 7230 const ICON_COLORS = ["#191e23", "#f8f9f9"]; 7231 function isUnmodifiedBlock(block, role) { 7232 const blockAttributes = getBlockType(block.name)?.attributes ?? {}; 7233 const attributesToCheck = role ? Object.entries(blockAttributes).filter(([key, definition]) => { 7234 if (role === "content" && key === "metadata") { 7235 return true; 7236 } 7237 return definition.role === role || definition.__experimentalRole === role; 7238 }) : Object.entries(blockAttributes); 7239 return attributesToCheck.every(([key, definition]) => { 7240 const value = block.attributes[key]; 7241 if (definition.hasOwnProperty("default")) { 7242 return value === definition.default; 7243 } 7244 if (definition.type === "rich-text") { 7245 return !value?.length; 7246 } 7247 return value === void 0; 7248 }); 7249 } 7250 function isUnmodifiedDefaultBlock(block, role) { 7251 return block.name === getDefaultBlockName() && isUnmodifiedBlock(block, role); 7252 } 7253 function isValidIcon(icon) { 7254 return !!icon && (typeof icon === "string" || (0,external_wp_element_namespaceObject.isValidElement)(icon) || typeof icon === "function" || icon instanceof external_wp_element_namespaceObject.Component); 7255 } 7256 function normalizeIconObject(icon) { 7257 icon = icon || BLOCK_ICON_DEFAULT; 7258 if (isValidIcon(icon)) { 7259 return { src: icon }; 7260 } 7261 if ("background" in icon) { 7262 const colordBgColor = w(icon.background); 7263 const getColorContrast = (iconColor) => colordBgColor.contrast(iconColor); 7264 const maxContrast = Math.max(...ICON_COLORS.map(getColorContrast)); 7265 return { 7266 ...icon, 7267 foreground: icon.foreground ? icon.foreground : ICON_COLORS.find( 7268 (iconColor) => getColorContrast(iconColor) === maxContrast 7269 ), 7270 shadowColor: colordBgColor.alpha(0.3).toRgbString() 7271 }; 7272 } 7273 return icon; 7274 } 7275 function normalizeBlockType(blockTypeOrName) { 7276 if (typeof blockTypeOrName === "string") { 7277 return getBlockType(blockTypeOrName); 7278 } 7279 return blockTypeOrName; 7280 } 7281 function getBlockLabel(blockType, attributes, context = "visual") { 7282 const { __experimentalLabel: getLabel, title } = blockType; 7283 const label = getLabel && getLabel(attributes, { context }); 7284 if (!label) { 7285 return title; 7286 } 7287 if (label.toPlainText) { 7288 return label.toPlainText(); 7289 } 7290 return (0,external_wp_dom_namespaceObject.__unstableStripHTML)(label); 7291 } 7292 function getAccessibleBlockLabel(blockType, attributes, position, direction = "vertical") { 7293 const title = blockType?.title; 7294 const label = blockType ? getBlockLabel(blockType, attributes, "accessibility") : ""; 7295 const hasPosition = position !== void 0; 7296 const hasLabel = label && label !== title; 7297 if (hasPosition && direction === "vertical") { 7298 if (hasLabel) { 7299 return (0,external_wp_i18n_namespaceObject.sprintf)( 7300 /* translators: accessibility text. 1: The block title. 2: The block row number. 3: The block label.. */ 7301 (0,external_wp_i18n_namespaceObject.__)("%1$s Block. Row %2$d. %3$s"), 7302 title, 7303 position, 7304 label 7305 ); 7306 } 7307 return (0,external_wp_i18n_namespaceObject.sprintf)( 7308 /* translators: accessibility text. 1: The block title. 2: The block row number. */ 7309 (0,external_wp_i18n_namespaceObject.__)("%1$s Block. Row %2$d"), 7310 title, 7311 position 7312 ); 7313 } else if (hasPosition && direction === "horizontal") { 7314 if (hasLabel) { 7315 return (0,external_wp_i18n_namespaceObject.sprintf)( 7316 /* translators: accessibility text. 1: The block title. 2: The block column number. 3: The block label.. */ 7317 (0,external_wp_i18n_namespaceObject.__)("%1$s Block. Column %2$d. %3$s"), 7318 title, 7319 position, 7320 label 7321 ); 7322 } 7323 return (0,external_wp_i18n_namespaceObject.sprintf)( 7324 /* translators: accessibility text. 1: The block title. 2: The block column number. */ 7325 (0,external_wp_i18n_namespaceObject.__)("%1$s Block. Column %2$d"), 7326 title, 7327 position 7328 ); 7329 } 7330 if (hasLabel) { 7331 return (0,external_wp_i18n_namespaceObject.sprintf)( 7332 /* translators: accessibility text. 1: The block title. 2: The block label. */ 7333 (0,external_wp_i18n_namespaceObject.__)("%1$s Block. %2$s"), 7334 title, 7335 label 7336 ); 7337 } 7338 return (0,external_wp_i18n_namespaceObject.sprintf)( 7339 /* translators: accessibility text. %s: The block title. */ 7340 (0,external_wp_i18n_namespaceObject.__)("%s Block"), 7341 title 7342 ); 7343 } 7344 function getDefault(attributeSchema) { 7345 if (attributeSchema.default !== void 0) { 7346 return attributeSchema.default; 7347 } 7348 if (attributeSchema.type === "rich-text") { 7349 return new external_wp_richText_namespaceObject.RichTextData(); 7350 } 7351 } 7352 function isBlockRegistered(name) { 7353 return getBlockType(name) !== void 0; 7354 } 7355 function __experimentalSanitizeBlockAttributes(name, attributes) { 7356 const blockType = getBlockType(name); 7357 if (void 0 === blockType) { 7358 throw new Error(`Block type '$name}' is not registered.`); 7359 } 7360 return Object.entries(blockType.attributes).reduce( 7361 (accumulator, [key, schema]) => { 7362 const value = attributes[key]; 7363 if (void 0 !== value) { 7364 if (schema.type === "rich-text") { 7365 if (value instanceof external_wp_richText_namespaceObject.RichTextData) { 7366 accumulator[key] = value; 7367 } else if (typeof value === "string") { 7368 accumulator[key] = external_wp_richText_namespaceObject.RichTextData.fromHTMLString(value); 7369 } 7370 } else if (schema.type === "string" && value instanceof external_wp_richText_namespaceObject.RichTextData) { 7371 accumulator[key] = value.toHTMLString(); 7372 } else { 7373 accumulator[key] = value; 7374 } 7375 } else { 7376 const _default = getDefault(schema); 7377 if (void 0 !== _default) { 7378 accumulator[key] = _default; 7379 } 7380 } 7381 if (["node", "children"].indexOf(schema.source) !== -1) { 7382 if (typeof accumulator[key] === "string") { 7383 accumulator[key] = [accumulator[key]]; 7384 } else if (!Array.isArray(accumulator[key])) { 7385 accumulator[key] = []; 7386 } 7387 } 7388 return accumulator; 7389 }, 7390 {} 7391 ); 7392 } 7393 function getBlockAttributesNamesByRole(name, role) { 7394 const attributes = getBlockType(name)?.attributes; 7395 if (!attributes) { 7396 return []; 7397 } 7398 const attributesNames = Object.keys(attributes); 7399 if (!role) { 7400 return attributesNames; 7401 } 7402 return attributesNames.filter((attributeName) => { 7403 const attribute = attributes[attributeName]; 7404 if (attribute?.role === role) { 7405 return true; 7406 } 7407 if (attribute?.__experimentalRole === role) { 7408 external_wp_deprecated_default()("__experimentalRole attribute", { 7409 since: "6.7", 7410 version: "6.8", 7411 alternative: "role attribute", 7412 hint: `Check the block.json of the $name} block.` 7413 }); 7414 return true; 7415 } 7416 return false; 7417 }); 7418 } 7419 const __experimentalGetBlockAttributesNamesByRole = (...args) => { 7420 external_wp_deprecated_default()("__experimentalGetBlockAttributesNamesByRole", { 7421 since: "6.7", 7422 version: "6.8", 7423 alternative: "getBlockAttributesNamesByRole" 7424 }); 7425 return getBlockAttributesNamesByRole(...args); 7426 }; 7427 function isContentBlock(name) { 7428 const blockType = getBlockType(name); 7429 const attributes = blockType?.attributes; 7430 const supportsContentRole = blockType?.supports?.contentRole; 7431 if (supportsContentRole) { 7432 return true; 7433 } 7434 if (!attributes) { 7435 return false; 7436 } 7437 return !!Object.keys(attributes)?.some((attributeKey) => { 7438 const attribute = attributes[attributeKey]; 7439 return attribute?.role === "content" || attribute?.__experimentalRole === "content"; 7440 }); 7441 } 7442 function omit(object, keys) { 7443 return Object.fromEntries( 7444 Object.entries(object).filter(([key]) => !keys.includes(key)) 7445 ); 7446 } 7447 7448 7449 ;// ./node_modules/@wordpress/blocks/build-module/store/reducer.js 7450 7451 7452 7453 7454 const DEFAULT_CATEGORIES = [ 7455 { slug: "text", title: (0,external_wp_i18n_namespaceObject.__)("Text") }, 7456 { slug: "media", title: (0,external_wp_i18n_namespaceObject.__)("Media") }, 7457 { slug: "design", title: (0,external_wp_i18n_namespaceObject.__)("Design") }, 7458 { slug: "widgets", title: (0,external_wp_i18n_namespaceObject.__)("Widgets") }, 7459 { slug: "theme", title: (0,external_wp_i18n_namespaceObject.__)("Theme") }, 7460 { slug: "embed", title: (0,external_wp_i18n_namespaceObject.__)("Embeds") }, 7461 { slug: "reusable", title: (0,external_wp_i18n_namespaceObject.__)("Reusable blocks") } 7462 ]; 7463 function keyBlockTypesByName(types) { 7464 return types.reduce( 7465 (newBlockTypes, block) => ({ 7466 ...newBlockTypes, 7467 [block.name]: block 7468 }), 7469 {} 7470 ); 7471 } 7472 function getUniqueItemsByName(items) { 7473 return items.reduce((acc, currentItem) => { 7474 if (!acc.some((item) => item.name === currentItem.name)) { 7475 acc.push(currentItem); 7476 } 7477 return acc; 7478 }, []); 7479 } 7480 function bootstrappedBlockTypes(state = {}, action) { 7481 switch (action.type) { 7482 case "ADD_BOOTSTRAPPED_BLOCK_TYPE": 7483 const { name, blockType } = action; 7484 const serverDefinition = state[name]; 7485 let newDefinition; 7486 if (serverDefinition) { 7487 if (serverDefinition.blockHooks === void 0 && blockType.blockHooks) { 7488 newDefinition = { 7489 ...serverDefinition, 7490 ...newDefinition, 7491 blockHooks: blockType.blockHooks 7492 }; 7493 } 7494 if (serverDefinition.allowedBlocks === void 0 && blockType.allowedBlocks) { 7495 newDefinition = { 7496 ...serverDefinition, 7497 ...newDefinition, 7498 allowedBlocks: blockType.allowedBlocks 7499 }; 7500 } 7501 } else { 7502 newDefinition = Object.fromEntries( 7503 Object.entries(blockType).filter( 7504 ([, value]) => value !== null && value !== void 0 7505 ).map(([key, value]) => [ 7506 camelCase(key), 7507 value 7508 ]) 7509 ); 7510 newDefinition.name = name; 7511 } 7512 if (newDefinition) { 7513 return { 7514 ...state, 7515 [name]: newDefinition 7516 }; 7517 } 7518 return state; 7519 case "REMOVE_BLOCK_TYPES": 7520 return omit(state, action.names); 7521 } 7522 return state; 7523 } 7524 function unprocessedBlockTypes(state = {}, action) { 7525 switch (action.type) { 7526 case "ADD_UNPROCESSED_BLOCK_TYPE": 7527 return { 7528 ...state, 7529 [action.name]: action.blockType 7530 }; 7531 case "REMOVE_BLOCK_TYPES": 7532 return omit(state, action.names); 7533 } 7534 return state; 7535 } 7536 function blockTypes(state = {}, action) { 7537 switch (action.type) { 7538 case "ADD_BLOCK_TYPES": 7539 return { 7540 ...state, 7541 ...keyBlockTypesByName(action.blockTypes) 7542 }; 7543 case "REMOVE_BLOCK_TYPES": 7544 return omit(state, action.names); 7545 } 7546 return state; 7547 } 7548 function blockStyles(state = {}, action) { 7549 switch (action.type) { 7550 case "ADD_BLOCK_TYPES": 7551 return { 7552 ...state, 7553 ...Object.fromEntries( 7554 Object.entries( 7555 keyBlockTypesByName(action.blockTypes) 7556 ).map(([name, blockType]) => [ 7557 name, 7558 getUniqueItemsByName([ 7559 ...(blockType.styles ?? []).map((style) => ({ 7560 ...style, 7561 source: "block" 7562 })), 7563 ...(state[blockType.name] ?? []).filter( 7564 ({ source }) => "block" !== source 7565 ) 7566 ]) 7567 ]) 7568 ) 7569 }; 7570 case "ADD_BLOCK_STYLES": 7571 const updatedStyles = {}; 7572 action.blockNames.forEach((blockName) => { 7573 updatedStyles[blockName] = getUniqueItemsByName([ 7574 ...state[blockName] ?? [], 7575 ...action.styles 7576 ]); 7577 }); 7578 return { ...state, ...updatedStyles }; 7579 case "REMOVE_BLOCK_STYLES": 7580 return { 7581 ...state, 7582 [action.blockName]: (state[action.blockName] ?? []).filter( 7583 (style) => action.styleNames.indexOf(style.name) === -1 7584 ) 7585 }; 7586 } 7587 return state; 7588 } 7589 function blockVariations(state = {}, action) { 7590 switch (action.type) { 7591 case "ADD_BLOCK_TYPES": 7592 return { 7593 ...state, 7594 ...Object.fromEntries( 7595 Object.entries( 7596 keyBlockTypesByName(action.blockTypes) 7597 ).map(([name, blockType]) => { 7598 return [ 7599 name, 7600 getUniqueItemsByName([ 7601 ...(blockType.variations ?? []).map( 7602 (variation) => ({ 7603 ...variation, 7604 source: "block" 7605 }) 7606 ), 7607 ...(state[blockType.name] ?? []).filter( 7608 ({ source }) => "block" !== source 7609 ) 7610 ]) 7611 ]; 7612 }) 7613 ) 7614 }; 7615 case "ADD_BLOCK_VARIATIONS": 7616 return { 7617 ...state, 7618 [action.blockName]: getUniqueItemsByName([ 7619 ...state[action.blockName] ?? [], 7620 ...action.variations 7621 ]) 7622 }; 7623 case "REMOVE_BLOCK_VARIATIONS": 7624 return { 7625 ...state, 7626 [action.blockName]: (state[action.blockName] ?? []).filter( 7627 (variation) => action.variationNames.indexOf(variation.name) === -1 7628 ) 7629 }; 7630 } 7631 return state; 7632 } 7633 function createBlockNameSetterReducer(setActionType) { 7634 return (state = null, action) => { 7635 switch (action.type) { 7636 case "REMOVE_BLOCK_TYPES": 7637 if (action.names.indexOf(state) !== -1) { 7638 return null; 7639 } 7640 return state; 7641 case setActionType: 7642 return action.name || null; 7643 } 7644 return state; 7645 }; 7646 } 7647 const defaultBlockName = createBlockNameSetterReducer( 7648 "SET_DEFAULT_BLOCK_NAME" 7649 ); 7650 const freeformFallbackBlockName = createBlockNameSetterReducer( 7651 "SET_FREEFORM_FALLBACK_BLOCK_NAME" 7652 ); 7653 const unregisteredFallbackBlockName = createBlockNameSetterReducer( 7654 "SET_UNREGISTERED_FALLBACK_BLOCK_NAME" 7655 ); 7656 const groupingBlockName = createBlockNameSetterReducer( 7657 "SET_GROUPING_BLOCK_NAME" 7658 ); 7659 function categories(state = DEFAULT_CATEGORIES, action) { 7660 switch (action.type) { 7661 case "SET_CATEGORIES": 7662 const uniqueCategories = /* @__PURE__ */ new Map(); 7663 (action.categories || []).forEach((category) => { 7664 uniqueCategories.set(category.slug, category); 7665 }); 7666 return [...uniqueCategories.values()]; 7667 case "UPDATE_CATEGORY": { 7668 if (!action.category || !Object.keys(action.category).length) { 7669 return state; 7670 } 7671 const categoryToChange = state.find( 7672 ({ slug }) => slug === action.slug 7673 ); 7674 if (categoryToChange) { 7675 return state.map((category) => { 7676 if (category.slug === action.slug) { 7677 return { 7678 ...category, 7679 ...action.category 7680 }; 7681 } 7682 return category; 7683 }); 7684 } 7685 } 7686 } 7687 return state; 7688 } 7689 function collections(state = {}, action) { 7690 switch (action.type) { 7691 case "ADD_BLOCK_COLLECTION": 7692 return { 7693 ...state, 7694 [action.namespace]: { 7695 title: action.title, 7696 icon: action.icon 7697 } 7698 }; 7699 case "REMOVE_BLOCK_COLLECTION": 7700 return omit(state, action.namespace); 7701 } 7702 return state; 7703 } 7704 function getMergedUsesContext(existingUsesContext = [], newUsesContext = []) { 7705 const mergedArrays = Array.from( 7706 new Set(existingUsesContext.concat(newUsesContext)) 7707 ); 7708 return mergedArrays.length > 0 ? mergedArrays : void 0; 7709 } 7710 function blockBindingsSources(state = {}, action) { 7711 switch (action.type) { 7712 case "ADD_BLOCK_BINDINGS_SOURCE": 7713 let getFieldsList; 7714 if (false) {} else if (action.name === "core/post-meta") { 7715 getFieldsList = action.getFieldsList; 7716 } 7717 return { 7718 ...state, 7719 [action.name]: { 7720 label: action.label || state[action.name]?.label, 7721 usesContext: getMergedUsesContext( 7722 state[action.name]?.usesContext, 7723 action.usesContext 7724 ), 7725 getValues: action.getValues, 7726 setValues: action.setValues, 7727 // Only set `canUserEditValue` if `setValues` is also defined. 7728 canUserEditValue: action.setValues && action.canUserEditValue, 7729 getFieldsList, 7730 editorUI: action.editorUI 7731 } 7732 }; 7733 case "REMOVE_BLOCK_BINDINGS_SOURCE": 7734 return omit(state, action.name); 7735 } 7736 return state; 7737 } 7738 var reducer_default = (0,external_wp_data_namespaceObject.combineReducers)({ 7739 bootstrappedBlockTypes, 7740 unprocessedBlockTypes, 7741 blockTypes, 7742 blockStyles, 7743 blockVariations, 7744 defaultBlockName, 7745 freeformFallbackBlockName, 7746 unregisteredFallbackBlockName, 7747 groupingBlockName, 7748 categories, 7749 collections, 7750 blockBindingsSources 7751 }); 7752 7753 7754 // EXTERNAL MODULE: ./node_modules/remove-accents/index.js 7755 var remove_accents = __webpack_require__(9681); 7756 var remove_accents_default = /*#__PURE__*/__webpack_require__.n(remove_accents); 7757 ;// ./node_modules/@wordpress/blocks/build-module/store/utils.js 7758 const getValueFromObjectPath = (object, path, defaultValue) => { 7759 const normalizedPath = Array.isArray(path) ? path : path.split("."); 7760 let value = object; 7761 normalizedPath.forEach((fieldName) => { 7762 value = value?.[fieldName]; 7763 }); 7764 return value ?? defaultValue; 7765 }; 7766 function utils_isObject(candidate) { 7767 return typeof candidate === "object" && candidate.constructor === Object && candidate !== null; 7768 } 7769 function matchesAttributes(blockAttributes, variationAttributes) { 7770 if (utils_isObject(blockAttributes) && utils_isObject(variationAttributes)) { 7771 return Object.entries(variationAttributes).every( 7772 ([key, value]) => matchesAttributes(blockAttributes?.[key], value) 7773 ); 7774 } 7775 return blockAttributes === variationAttributes; 7776 } 7777 7778 7779 ;// ./node_modules/@wordpress/blocks/build-module/store/private-selectors.js 7780 7781 7782 7783 7784 7785 const ROOT_BLOCK_SUPPORTS = [ 7786 "background", 7787 "backgroundColor", 7788 "color", 7789 "linkColor", 7790 "captionColor", 7791 "buttonColor", 7792 "headingColor", 7793 "fontFamily", 7794 "fontSize", 7795 "fontStyle", 7796 "fontWeight", 7797 "lineHeight", 7798 "padding", 7799 "contentSize", 7800 "wideSize", 7801 "blockGap", 7802 "textDecoration", 7803 "textTransform", 7804 "letterSpacing" 7805 ]; 7806 function filterElementBlockSupports(blockSupports, name, element) { 7807 return blockSupports.filter((support) => { 7808 if (support === "fontSize" && element === "heading") { 7809 return false; 7810 } 7811 if (support === "textDecoration" && !name && element !== "link") { 7812 return false; 7813 } 7814 if (support === "textTransform" && !name && !(["heading", "h1", "h2", "h3", "h4", "h5", "h6"].includes( 7815 element 7816 ) || element === "button" || element === "caption" || element === "text")) { 7817 return false; 7818 } 7819 if (support === "letterSpacing" && !name && !(["heading", "h1", "h2", "h3", "h4", "h5", "h6"].includes( 7820 element 7821 ) || element === "button" || element === "caption" || element === "text")) { 7822 return false; 7823 } 7824 if (support === "textColumns" && !name) { 7825 return false; 7826 } 7827 return true; 7828 }); 7829 } 7830 const getSupportedStyles = (0,external_wp_data_namespaceObject.createSelector)( 7831 (state, name, element) => { 7832 if (!name) { 7833 return filterElementBlockSupports( 7834 ROOT_BLOCK_SUPPORTS, 7835 name, 7836 element 7837 ); 7838 } 7839 const blockType = selectors_getBlockType(state, name); 7840 if (!blockType) { 7841 return []; 7842 } 7843 const supportKeys = []; 7844 if (blockType?.supports?.spacing?.blockGap) { 7845 supportKeys.push("blockGap"); 7846 } 7847 if (blockType?.supports?.shadow) { 7848 supportKeys.push("shadow"); 7849 } 7850 Object.keys(__EXPERIMENTAL_STYLE_PROPERTY).forEach((styleName) => { 7851 if (!__EXPERIMENTAL_STYLE_PROPERTY[styleName].support) { 7852 return; 7853 } 7854 if (__EXPERIMENTAL_STYLE_PROPERTY[styleName].requiresOptOut) { 7855 if (__EXPERIMENTAL_STYLE_PROPERTY[styleName].support[0] in blockType.supports && getValueFromObjectPath( 7856 blockType.supports, 7857 __EXPERIMENTAL_STYLE_PROPERTY[styleName].support 7858 ) !== false) { 7859 supportKeys.push(styleName); 7860 return; 7861 } 7862 } 7863 if (getValueFromObjectPath( 7864 blockType.supports, 7865 __EXPERIMENTAL_STYLE_PROPERTY[styleName].support, 7866 false 7867 )) { 7868 supportKeys.push(styleName); 7869 } 7870 }); 7871 return filterElementBlockSupports(supportKeys, name, element); 7872 }, 7873 (state, name) => [state.blockTypes[name]] 7874 ); 7875 function getBootstrappedBlockType(state, name) { 7876 return state.bootstrappedBlockTypes[name]; 7877 } 7878 function getUnprocessedBlockTypes(state) { 7879 return state.unprocessedBlockTypes; 7880 } 7881 function getAllBlockBindingsSources(state) { 7882 return state.blockBindingsSources; 7883 } 7884 function private_selectors_getBlockBindingsSource(state, sourceName) { 7885 return state.blockBindingsSources[sourceName]; 7886 } 7887 const hasContentRoleAttribute = (state, blockTypeName) => { 7888 const blockType = selectors_getBlockType(state, blockTypeName); 7889 if (!blockType) { 7890 return false; 7891 } 7892 return Object.values(blockType.attributes).some( 7893 ({ role, __experimentalRole }) => { 7894 if (role === "content") { 7895 return true; 7896 } 7897 if (__experimentalRole === "content") { 7898 external_wp_deprecated_default()("__experimentalRole attribute", { 7899 since: "6.7", 7900 version: "6.8", 7901 alternative: "role attribute", 7902 hint: `Check the block.json of the $blockTypeName} block.` 7903 }); 7904 return true; 7905 } 7906 return false; 7907 } 7908 ); 7909 }; 7910 7911 7912 ;// ./node_modules/@wordpress/blocks/build-module/store/selectors.js 7913 7914 7915 7916 7917 7918 7919 const getNormalizedBlockType = (state, nameOrType) => "string" === typeof nameOrType ? selectors_getBlockType(state, nameOrType) : nameOrType; 7920 const selectors_getBlockTypes = (0,external_wp_data_namespaceObject.createSelector)( 7921 (state) => Object.values(state.blockTypes), 7922 (state) => [state.blockTypes] 7923 ); 7924 function selectors_getBlockType(state, name) { 7925 return state.blockTypes[name]; 7926 } 7927 function getBlockStyles(state, name) { 7928 return state.blockStyles[name]; 7929 } 7930 const selectors_getBlockVariations = (0,external_wp_data_namespaceObject.createSelector)( 7931 (state, blockName, scope) => { 7932 const variations = state.blockVariations[blockName]; 7933 if (!variations || !scope) { 7934 return variations; 7935 } 7936 return variations.filter((variation) => { 7937 return (variation.scope || ["block", "inserter"]).includes( 7938 scope 7939 ); 7940 }); 7941 }, 7942 (state, blockName) => [state.blockVariations[blockName]] 7943 ); 7944 function getActiveBlockVariation(state, blockName, attributes, scope) { 7945 const variations = selectors_getBlockVariations(state, blockName, scope); 7946 if (!variations) { 7947 return variations; 7948 } 7949 const blockType = selectors_getBlockType(state, blockName); 7950 const attributeKeys = Object.keys(blockType?.attributes || {}); 7951 let match; 7952 let maxMatchedAttributes = 0; 7953 for (const variation of variations) { 7954 if (Array.isArray(variation.isActive)) { 7955 const definedAttributes = variation.isActive.filter( 7956 (attribute) => { 7957 const topLevelAttribute = attribute.split(".")[0]; 7958 return attributeKeys.includes(topLevelAttribute); 7959 } 7960 ); 7961 const definedAttributesLength = definedAttributes.length; 7962 if (definedAttributesLength === 0) { 7963 continue; 7964 } 7965 const isMatch = definedAttributes.every((attribute) => { 7966 const variationAttributeValue = getValueFromObjectPath( 7967 variation.attributes, 7968 attribute 7969 ); 7970 if (variationAttributeValue === void 0) { 7971 return false; 7972 } 7973 let blockAttributeValue = getValueFromObjectPath( 7974 attributes, 7975 attribute 7976 ); 7977 if (blockAttributeValue instanceof external_wp_richText_namespaceObject.RichTextData) { 7978 blockAttributeValue = blockAttributeValue.toHTMLString(); 7979 } 7980 return matchesAttributes( 7981 blockAttributeValue, 7982 variationAttributeValue 7983 ); 7984 }); 7985 if (isMatch && definedAttributesLength > maxMatchedAttributes) { 7986 match = variation; 7987 maxMatchedAttributes = definedAttributesLength; 7988 } 7989 } else if (variation.isActive?.(attributes, variation.attributes)) { 7990 return match || variation; 7991 } 7992 } 7993 if (!match && ["block", "transform"].includes(scope)) { 7994 match = variations.find( 7995 (variation) => variation?.isDefault && !Object.hasOwn(variation, "isActive") 7996 ); 7997 } 7998 return match; 7999 } 8000 function getDefaultBlockVariation(state, blockName, scope) { 8001 const variations = selectors_getBlockVariations(state, blockName, scope); 8002 const defaultVariation = [...variations].reverse().find(({ isDefault }) => !!isDefault); 8003 return defaultVariation || variations[0]; 8004 } 8005 function getCategories(state) { 8006 return state.categories; 8007 } 8008 function getCollections(state) { 8009 return state.collections; 8010 } 8011 function selectors_getDefaultBlockName(state) { 8012 return state.defaultBlockName; 8013 } 8014 function getFreeformFallbackBlockName(state) { 8015 return state.freeformFallbackBlockName; 8016 } 8017 function getUnregisteredFallbackBlockName(state) { 8018 return state.unregisteredFallbackBlockName; 8019 } 8020 function selectors_getGroupingBlockName(state) { 8021 return state.groupingBlockName; 8022 } 8023 const selectors_getChildBlockNames = (0,external_wp_data_namespaceObject.createSelector)( 8024 (state, blockName) => { 8025 return selectors_getBlockTypes(state).filter((blockType) => { 8026 return blockType.parent?.includes(blockName); 8027 }).map(({ name }) => name); 8028 }, 8029 (state) => [state.blockTypes] 8030 ); 8031 const selectors_getBlockSupport = (state, nameOrType, feature, defaultSupports) => { 8032 const blockType = getNormalizedBlockType(state, nameOrType); 8033 if (!blockType?.supports) { 8034 return defaultSupports; 8035 } 8036 return getValueFromObjectPath( 8037 blockType.supports, 8038 feature, 8039 defaultSupports 8040 ); 8041 }; 8042 function selectors_hasBlockSupport(state, nameOrType, feature, defaultSupports) { 8043 return !!selectors_getBlockSupport(state, nameOrType, feature, defaultSupports); 8044 } 8045 function getNormalizedSearchTerm(term) { 8046 return remove_accents_default()(term ?? "").toLowerCase().trim(); 8047 } 8048 function isMatchingSearchTerm(state, nameOrType, searchTerm = "") { 8049 const blockType = getNormalizedBlockType(state, nameOrType); 8050 const normalizedSearchTerm = getNormalizedSearchTerm(searchTerm); 8051 const isSearchMatch = (candidate) => getNormalizedSearchTerm(candidate).includes(normalizedSearchTerm); 8052 return isSearchMatch(blockType.title) || blockType.keywords?.some(isSearchMatch) || isSearchMatch(blockType.category) || typeof blockType.description === "string" && isSearchMatch(blockType.description); 8053 } 8054 const selectors_hasChildBlocks = (state, blockName) => { 8055 return selectors_getChildBlockNames(state, blockName).length > 0; 8056 }; 8057 const selectors_hasChildBlocksWithInserterSupport = (state, blockName) => { 8058 return selectors_getChildBlockNames(state, blockName).some((childBlockName) => { 8059 return selectors_hasBlockSupport(state, childBlockName, "inserter", true); 8060 }); 8061 }; 8062 const __experimentalHasContentRoleAttribute = (...args) => { 8063 external_wp_deprecated_default()("__experimentalHasContentRoleAttribute", { 8064 since: "6.7", 8065 version: "6.8", 8066 hint: "This is a private selector." 8067 }); 8068 return hasContentRoleAttribute(...args); 8069 }; 8070 8071 8072 ;// ./node_modules/is-plain-object/dist/is-plain-object.mjs 8073 /*! 8074 * is-plain-object <https://github.com/jonschlinkert/is-plain-object> 8075 * 8076 * Copyright (c) 2014-2017, Jon Schlinkert. 8077 * Released under the MIT License. 8078 */ 8079 8080 function is_plain_object_isObject(o) { 8081 return Object.prototype.toString.call(o) === '[object Object]'; 8082 } 8083 8084 function isPlainObject(o) { 8085 var ctor,prot; 8086 8087 if (is_plain_object_isObject(o) === false) return false; 8088 8089 // If has modified constructor 8090 ctor = o.constructor; 8091 if (ctor === undefined) return true; 8092 8093 // If has modified prototype 8094 prot = ctor.prototype; 8095 if (is_plain_object_isObject(prot) === false) return false; 8096 8097 // If constructor does not have an Object-specific method 8098 if (prot.hasOwnProperty('isPrototypeOf') === false) { 8099 return false; 8100 } 8101 8102 // Most likely a plain Object 8103 return true; 8104 } 8105 8106 8107 8108 // EXTERNAL MODULE: ./node_modules/react-is/index.js 8109 var react_is = __webpack_require__(8529); 8110 ;// external ["wp","hooks"] 8111 const external_wp_hooks_namespaceObject = window["wp"]["hooks"]; 8112 ;// ./node_modules/@wordpress/blocks/build-module/store/process-block-type.js 8113 8114 8115 8116 8117 8118 8119 8120 const LEGACY_CATEGORY_MAPPING = { 8121 common: "text", 8122 formatting: "text", 8123 layout: "design" 8124 }; 8125 function mergeBlockVariations(bootstrappedVariations = [], clientVariations = []) { 8126 const result = [...bootstrappedVariations]; 8127 clientVariations.forEach((clientVariation) => { 8128 const index = result.findIndex( 8129 (bootstrappedVariation) => bootstrappedVariation.name === clientVariation.name 8130 ); 8131 if (index !== -1) { 8132 result[index] = { ...result[index], ...clientVariation }; 8133 } else { 8134 result.push(clientVariation); 8135 } 8136 }); 8137 return result; 8138 } 8139 const processBlockType = (name, blockSettings) => ({ select }) => { 8140 const bootstrappedBlockType = select.getBootstrappedBlockType(name); 8141 const blockType = { 8142 apiVersion: 1, 8143 name, 8144 icon: BLOCK_ICON_DEFAULT, 8145 keywords: [], 8146 attributes: {}, 8147 providesContext: {}, 8148 usesContext: [], 8149 selectors: {}, 8150 supports: {}, 8151 styles: [], 8152 blockHooks: {}, 8153 save: () => null, 8154 ...bootstrappedBlockType, 8155 ...blockSettings, 8156 // blockType.variations can be defined as a filePath. 8157 variations: mergeBlockVariations( 8158 Array.isArray(bootstrappedBlockType?.variations) ? bootstrappedBlockType.variations : [], 8159 Array.isArray(blockSettings?.variations) ? blockSettings.variations : [] 8160 ) 8161 }; 8162 const settings = (0,external_wp_hooks_namespaceObject.applyFilters)( 8163 "blocks.registerBlockType", 8164 blockType, 8165 name, 8166 null 8167 ); 8168 if (settings.apiVersion <= 2) { 8169 external_wp_warning_default()( 8170 `The block "$name}" is registered with API version 2 or lower. This means that the post editor may work as a non-iframe editor. 8171 Since all editors are planned to work as iframes in the future, set the \`apiVersion\` field to 3 and test the block inside the iframe editor. 8172 See: https://developer.wordpress.org/block-editor/reference-guides/block-api/block-api-versions/#version-3-wordpress-6-3` 8173 ); 8174 } 8175 if (settings.description && typeof settings.description !== "string") { 8176 external_wp_deprecated_default()("Declaring non-string block descriptions", { 8177 since: "6.2" 8178 }); 8179 } 8180 if (settings.deprecated) { 8181 settings.deprecated = settings.deprecated.map( 8182 (deprecation) => Object.fromEntries( 8183 Object.entries( 8184 // Only keep valid deprecation keys. 8185 (0,external_wp_hooks_namespaceObject.applyFilters)( 8186 "blocks.registerBlockType", 8187 // Merge deprecation keys with pre-filter settings 8188 // so that filters that depend on specific keys being 8189 // present don't fail. 8190 { 8191 // Omit deprecation keys here so that deprecations 8192 // can opt out of specific keys like "supports". 8193 ...omit(blockType, DEPRECATED_ENTRY_KEYS), 8194 ...deprecation 8195 }, 8196 blockType.name, 8197 deprecation 8198 ) 8199 ).filter( 8200 ([key]) => DEPRECATED_ENTRY_KEYS.includes(key) 8201 ) 8202 ) 8203 ); 8204 } 8205 if (!isPlainObject(settings)) { 8206 external_wp_warning_default()("Block settings must be a valid object."); 8207 return; 8208 } 8209 if (typeof settings.save !== "function") { 8210 external_wp_warning_default()('The "save" property must be a valid function.'); 8211 return; 8212 } 8213 if ("edit" in settings && !(0,react_is.isValidElementType)(settings.edit)) { 8214 external_wp_warning_default()('The "edit" property must be a valid component.'); 8215 return; 8216 } 8217 if (LEGACY_CATEGORY_MAPPING.hasOwnProperty(settings.category)) { 8218 settings.category = LEGACY_CATEGORY_MAPPING[settings.category]; 8219 } 8220 if ("category" in settings && !select.getCategories().some(({ slug }) => slug === settings.category)) { 8221 external_wp_warning_default()( 8222 'The block "' + name + '" is registered with an invalid category "' + settings.category + '".' 8223 ); 8224 delete settings.category; 8225 } 8226 if (!("title" in settings) || settings.title === "") { 8227 external_wp_warning_default()('The block "' + name + '" must have a title.'); 8228 return; 8229 } 8230 if (typeof settings.title !== "string") { 8231 external_wp_warning_default()("Block titles must be strings."); 8232 return; 8233 } 8234 settings.icon = normalizeIconObject(settings.icon); 8235 if (!isValidIcon(settings.icon.src)) { 8236 external_wp_warning_default()( 8237 "The icon passed is invalid. The icon should be a string, an element, a function, or an object following the specifications documented in https://developer.wordpress.org/block-editor/developers/block-api/block-registration/#icon-optional" 8238 ); 8239 return; 8240 } 8241 if (typeof settings?.parent === "string" || settings?.parent instanceof String) { 8242 settings.parent = [settings.parent]; 8243 external_wp_warning_default()( 8244 "Parent must be undefined or an array of strings (block types), but it is a string." 8245 ); 8246 } 8247 if (!Array.isArray(settings?.parent) && settings?.parent !== void 0) { 8248 external_wp_warning_default()( 8249 "Parent must be undefined or an array of block types, but it is ", 8250 settings.parent 8251 ); 8252 return; 8253 } 8254 if (1 === settings?.parent?.length && name === settings.parent[0]) { 8255 external_wp_warning_default()( 8256 'Block "' + name + '" cannot be a parent of itself. Please remove the block name from the parent list.' 8257 ); 8258 return; 8259 } 8260 return settings; 8261 }; 8262 8263 8264 ;// ./node_modules/@wordpress/blocks/build-module/store/actions.js 8265 8266 8267 function addBlockTypes(blockTypes) { 8268 return { 8269 type: "ADD_BLOCK_TYPES", 8270 blockTypes: Array.isArray(blockTypes) ? blockTypes : [blockTypes] 8271 }; 8272 } 8273 function reapplyBlockTypeFilters() { 8274 return ({ dispatch, select }) => { 8275 const processedBlockTypes = []; 8276 for (const [name, settings] of Object.entries( 8277 select.getUnprocessedBlockTypes() 8278 )) { 8279 const result = dispatch(processBlockType(name, settings)); 8280 if (result) { 8281 processedBlockTypes.push(result); 8282 } 8283 } 8284 if (!processedBlockTypes.length) { 8285 return; 8286 } 8287 dispatch.addBlockTypes(processedBlockTypes); 8288 }; 8289 } 8290 function __experimentalReapplyBlockFilters() { 8291 external_wp_deprecated_default()( 8292 'wp.data.dispatch( "core/blocks" ).__experimentalReapplyBlockFilters', 8293 { 8294 since: "6.4", 8295 alternative: "reapplyBlockFilters" 8296 } 8297 ); 8298 return reapplyBlockTypeFilters(); 8299 } 8300 function removeBlockTypes(names) { 8301 return { 8302 type: "REMOVE_BLOCK_TYPES", 8303 names: Array.isArray(names) ? names : [names] 8304 }; 8305 } 8306 function addBlockStyles(blockNames, styles) { 8307 return { 8308 type: "ADD_BLOCK_STYLES", 8309 styles: Array.isArray(styles) ? styles : [styles], 8310 blockNames: Array.isArray(blockNames) ? blockNames : [blockNames] 8311 }; 8312 } 8313 function removeBlockStyles(blockName, styleNames) { 8314 return { 8315 type: "REMOVE_BLOCK_STYLES", 8316 styleNames: Array.isArray(styleNames) ? styleNames : [styleNames], 8317 blockName 8318 }; 8319 } 8320 function addBlockVariations(blockName, variations) { 8321 return { 8322 type: "ADD_BLOCK_VARIATIONS", 8323 variations: Array.isArray(variations) ? variations : [variations], 8324 blockName 8325 }; 8326 } 8327 function removeBlockVariations(blockName, variationNames) { 8328 return { 8329 type: "REMOVE_BLOCK_VARIATIONS", 8330 variationNames: Array.isArray(variationNames) ? variationNames : [variationNames], 8331 blockName 8332 }; 8333 } 8334 function actions_setDefaultBlockName(name) { 8335 return { 8336 type: "SET_DEFAULT_BLOCK_NAME", 8337 name 8338 }; 8339 } 8340 function setFreeformFallbackBlockName(name) { 8341 return { 8342 type: "SET_FREEFORM_FALLBACK_BLOCK_NAME", 8343 name 8344 }; 8345 } 8346 function setUnregisteredFallbackBlockName(name) { 8347 return { 8348 type: "SET_UNREGISTERED_FALLBACK_BLOCK_NAME", 8349 name 8350 }; 8351 } 8352 function actions_setGroupingBlockName(name) { 8353 return { 8354 type: "SET_GROUPING_BLOCK_NAME", 8355 name 8356 }; 8357 } 8358 function setCategories(categories) { 8359 return { 8360 type: "SET_CATEGORIES", 8361 categories 8362 }; 8363 } 8364 function updateCategory(slug, category) { 8365 return { 8366 type: "UPDATE_CATEGORY", 8367 slug, 8368 category 8369 }; 8370 } 8371 function addBlockCollection(namespace, title, icon) { 8372 return { 8373 type: "ADD_BLOCK_COLLECTION", 8374 namespace, 8375 title, 8376 icon 8377 }; 8378 } 8379 function removeBlockCollection(namespace) { 8380 return { 8381 type: "REMOVE_BLOCK_COLLECTION", 8382 namespace 8383 }; 8384 } 8385 8386 8387 ;// ./node_modules/@wordpress/blocks/build-module/store/private-actions.js 8388 8389 function addBootstrappedBlockType(name, blockType) { 8390 return { 8391 type: "ADD_BOOTSTRAPPED_BLOCK_TYPE", 8392 name, 8393 blockType 8394 }; 8395 } 8396 function addUnprocessedBlockType(name, blockType) { 8397 return ({ dispatch }) => { 8398 dispatch({ type: "ADD_UNPROCESSED_BLOCK_TYPE", name, blockType }); 8399 const processedBlockType = dispatch( 8400 processBlockType(name, blockType) 8401 ); 8402 if (!processedBlockType) { 8403 return; 8404 } 8405 dispatch.addBlockTypes(processedBlockType); 8406 }; 8407 } 8408 function addBlockBindingsSource(source) { 8409 return { 8410 type: "ADD_BLOCK_BINDINGS_SOURCE", 8411 name: source.name, 8412 label: source.label, 8413 usesContext: source.usesContext, 8414 getValues: source.getValues, 8415 setValues: source.setValues, 8416 canUserEditValue: source.canUserEditValue, 8417 getFieldsList: source.getFieldsList, 8418 editorUI: source.editorUI 8419 }; 8420 } 8421 function removeBlockBindingsSource(name) { 8422 return { 8423 type: "REMOVE_BLOCK_BINDINGS_SOURCE", 8424 name 8425 }; 8426 } 8427 8428 8429 ;// ./node_modules/@wordpress/blocks/build-module/store/constants.js 8430 const STORE_NAME = "core/blocks"; 8431 8432 8433 ;// ./node_modules/@wordpress/blocks/build-module/store/index.js 8434 8435 8436 8437 8438 8439 8440 8441 8442 const store = (0,external_wp_data_namespaceObject.createReduxStore)(STORE_NAME, { 8443 reducer: reducer_default, 8444 selectors: selectors_namespaceObject, 8445 actions: actions_namespaceObject 8446 }); 8447 (0,external_wp_data_namespaceObject.register)(store); 8448 unlock(store).registerPrivateSelectors(private_selectors_namespaceObject); 8449 unlock(store).registerPrivateActions(private_actions_namespaceObject); 8450 8451 8452 ;// ./node_modules/@wordpress/blocks/node_modules/uuid/dist/esm-browser/native.js 8453 const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto); 8454 /* harmony default export */ const esm_browser_native = ({ 8455 randomUUID 8456 }); 8457 ;// ./node_modules/@wordpress/blocks/node_modules/uuid/dist/esm-browser/rng.js 8458 // Unique ID creation requires a high quality random # generator. In the browser we therefore 8459 // require the crypto API and do not support built-in fallback to lower quality random number 8460 // generators (like Math.random()). 8461 let getRandomValues; 8462 const rnds8 = new Uint8Array(16); 8463 function rng() { 8464 // lazy load so that environments that need to polyfill have a chance to do so 8465 if (!getRandomValues) { 8466 // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation. 8467 getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto); 8468 8469 if (!getRandomValues) { 8470 throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported'); 8471 } 8472 } 8473 8474 return getRandomValues(rnds8); 8475 } 8476 ;// ./node_modules/@wordpress/blocks/node_modules/uuid/dist/esm-browser/stringify.js 8477 8478 /** 8479 * Convert array of 16 byte values to UUID string format of the form: 8480 * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX 8481 */ 8482 8483 const byteToHex = []; 8484 8485 for (let i = 0; i < 256; ++i) { 8486 byteToHex.push((i + 0x100).toString(16).slice(1)); 8487 } 8488 8489 function unsafeStringify(arr, offset = 0) { 8490 // Note: Be careful editing this code! It's been tuned for performance 8491 // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434 8492 return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]; 8493 } 8494 8495 function stringify(arr, offset = 0) { 8496 const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID. If this throws, it's likely due to one 8497 // of the following: 8498 // - One or more input array values don't map to a hex octet (leading to 8499 // "undefined" in the uuid) 8500 // - Invalid input values for the RFC `version` or `variant` fields 8501 8502 if (!validate(uuid)) { 8503 throw TypeError('Stringified UUID is invalid'); 8504 } 8505 8506 return uuid; 8507 } 8508 8509 /* harmony default export */ const esm_browser_stringify = ((/* unused pure expression or super */ null && (stringify))); 8510 ;// ./node_modules/@wordpress/blocks/node_modules/uuid/dist/esm-browser/v4.js 8511 8512 8513 8514 8515 function v4(options, buf, offset) { 8516 if (esm_browser_native.randomUUID && !buf && !options) { 8517 return esm_browser_native.randomUUID(); 8518 } 8519 8520 options = options || {}; 8521 const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` 8522 8523 rnds[6] = rnds[6] & 0x0f | 0x40; 8524 rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided 8525 8526 if (buf) { 8527 offset = offset || 0; 8528 8529 for (let i = 0; i < 16; ++i) { 8530 buf[offset + i] = rnds[i]; 8531 } 8532 8533 return buf; 8534 } 8535 8536 return unsafeStringify(rnds); 8537 } 8538 8539 /* harmony default export */ const esm_browser_v4 = (v4); 8540 ;// ./node_modules/@wordpress/blocks/build-module/api/factory.js 8541 8542 8543 8544 8545 function createBlock(name, attributes = {}, innerBlocks = []) { 8546 if (!isBlockRegistered(name)) { 8547 return createBlock("core/missing", { 8548 originalName: name, 8549 originalContent: "", 8550 originalUndelimitedContent: "" 8551 }); 8552 } 8553 const sanitizedAttributes = __experimentalSanitizeBlockAttributes( 8554 name, 8555 attributes 8556 ); 8557 const clientId = esm_browser_v4(); 8558 return { 8559 clientId, 8560 name, 8561 isValid: true, 8562 attributes: sanitizedAttributes, 8563 innerBlocks 8564 }; 8565 } 8566 function createBlocksFromInnerBlocksTemplate(innerBlocksOrTemplate = []) { 8567 return innerBlocksOrTemplate.map((innerBlock) => { 8568 const innerBlockTemplate = Array.isArray(innerBlock) ? innerBlock : [ 8569 innerBlock.name, 8570 innerBlock.attributes, 8571 innerBlock.innerBlocks 8572 ]; 8573 const [name, attributes, innerBlocks = []] = innerBlockTemplate; 8574 return createBlock( 8575 name, 8576 attributes, 8577 createBlocksFromInnerBlocksTemplate(innerBlocks) 8578 ); 8579 }); 8580 } 8581 function __experimentalCloneSanitizedBlock(block, mergeAttributes = {}, newInnerBlocks) { 8582 const { name } = block; 8583 if (!isBlockRegistered(name)) { 8584 return createBlock("core/missing", { 8585 originalName: name, 8586 originalContent: "", 8587 originalUndelimitedContent: "" 8588 }); 8589 } 8590 const clientId = esm_browser_v4(); 8591 const sanitizedAttributes = __experimentalSanitizeBlockAttributes(name, { 8592 ...block.attributes, 8593 ...mergeAttributes 8594 }); 8595 return { 8596 ...block, 8597 clientId, 8598 attributes: sanitizedAttributes, 8599 innerBlocks: newInnerBlocks || block.innerBlocks.map( 8600 (innerBlock) => __experimentalCloneSanitizedBlock(innerBlock) 8601 ) 8602 }; 8603 } 8604 function cloneBlock(block, mergeAttributes = {}, newInnerBlocks) { 8605 const clientId = esm_browser_v4(); 8606 return { 8607 ...block, 8608 clientId, 8609 attributes: { 8610 ...block.attributes, 8611 ...mergeAttributes 8612 }, 8613 innerBlocks: newInnerBlocks || block.innerBlocks.map((innerBlock) => cloneBlock(innerBlock)) 8614 }; 8615 } 8616 const isPossibleTransformForSource = (transform, direction, blocks) => { 8617 if (!blocks.length) { 8618 return false; 8619 } 8620 const isMultiBlock = blocks.length > 1; 8621 const firstBlockName = blocks[0].name; 8622 const isValidForMultiBlocks = isWildcardBlockTransform(transform) || !isMultiBlock || transform.isMultiBlock; 8623 if (!isValidForMultiBlocks) { 8624 return false; 8625 } 8626 if (!isWildcardBlockTransform(transform) && !blocks.every((block) => block.name === firstBlockName)) { 8627 return false; 8628 } 8629 const isBlockType = transform.type === "block"; 8630 if (!isBlockType) { 8631 return false; 8632 } 8633 const sourceBlock = blocks[0]; 8634 const hasMatchingName = direction !== "from" || transform.blocks.indexOf(sourceBlock.name) !== -1 || isWildcardBlockTransform(transform); 8635 if (!hasMatchingName) { 8636 return false; 8637 } 8638 if (!isMultiBlock && direction === "from" && isContainerGroupBlock(sourceBlock.name) && isContainerGroupBlock(transform.blockName)) { 8639 return false; 8640 } 8641 if (!maybeCheckTransformIsMatch(transform, blocks)) { 8642 return false; 8643 } 8644 return true; 8645 }; 8646 const getBlockTypesForPossibleFromTransforms = (blocks) => { 8647 if (!blocks.length) { 8648 return []; 8649 } 8650 const allBlockTypes = getBlockTypes(); 8651 const blockTypesWithPossibleFromTransforms = allBlockTypes.filter( 8652 (blockType) => { 8653 const fromTransforms = getBlockTransforms("from", blockType.name); 8654 return !!findTransform(fromTransforms, (transform) => { 8655 return isPossibleTransformForSource( 8656 transform, 8657 "from", 8658 blocks 8659 ); 8660 }); 8661 } 8662 ); 8663 return blockTypesWithPossibleFromTransforms; 8664 }; 8665 const getBlockTypesForPossibleToTransforms = (blocks) => { 8666 if (!blocks.length) { 8667 return []; 8668 } 8669 const sourceBlock = blocks[0]; 8670 const blockType = getBlockType(sourceBlock.name); 8671 const transformsTo = blockType ? getBlockTransforms("to", blockType.name) : []; 8672 const possibleTransforms = transformsTo.filter((transform) => { 8673 return transform && isPossibleTransformForSource(transform, "to", blocks); 8674 }); 8675 const blockNames = possibleTransforms.map((transformation) => transformation.blocks).flat(); 8676 return blockNames.map(getBlockType); 8677 }; 8678 const isWildcardBlockTransform = (t) => t && t.type === "block" && Array.isArray(t.blocks) && t.blocks.includes("*"); 8679 const isContainerGroupBlock = (name) => name === getGroupingBlockName(); 8680 function getPossibleBlockTransformations(blocks) { 8681 if (!blocks.length) { 8682 return []; 8683 } 8684 const blockTypesForFromTransforms = getBlockTypesForPossibleFromTransforms(blocks); 8685 const blockTypesForToTransforms = getBlockTypesForPossibleToTransforms(blocks); 8686 return [ 8687 .../* @__PURE__ */ new Set([ 8688 ...blockTypesForFromTransforms, 8689 ...blockTypesForToTransforms 8690 ]) 8691 ]; 8692 } 8693 function findTransform(transforms, predicate) { 8694 const hooks = (0,external_wp_hooks_namespaceObject.createHooks)(); 8695 for (let i = 0; i < transforms.length; i++) { 8696 const candidate = transforms[i]; 8697 if (predicate(candidate)) { 8698 hooks.addFilter( 8699 "transform", 8700 "transform/" + i.toString(), 8701 (result) => result ? result : candidate, 8702 candidate.priority 8703 ); 8704 } 8705 } 8706 return hooks.applyFilters("transform", null); 8707 } 8708 function getBlockTransforms(direction, blockTypeOrName) { 8709 if (blockTypeOrName === void 0) { 8710 return getBlockTypes().map(({ name }) => getBlockTransforms(direction, name)).flat(); 8711 } 8712 const blockType = normalizeBlockType(blockTypeOrName); 8713 const { name: blockName, transforms } = blockType || {}; 8714 if (!transforms || !Array.isArray(transforms[direction])) { 8715 return []; 8716 } 8717 const usingMobileTransformations = transforms.supportedMobileTransforms && Array.isArray(transforms.supportedMobileTransforms); 8718 const filteredTransforms = usingMobileTransformations ? transforms[direction].filter((t) => { 8719 if (t.type === "raw") { 8720 return true; 8721 } 8722 if (t.type === "prefix") { 8723 return true; 8724 } 8725 if (!t.blocks || !t.blocks.length) { 8726 return false; 8727 } 8728 if (isWildcardBlockTransform(t)) { 8729 return true; 8730 } 8731 return t.blocks.every( 8732 (transformBlockName) => transforms.supportedMobileTransforms.includes( 8733 transformBlockName 8734 ) 8735 ); 8736 }) : transforms[direction]; 8737 return filteredTransforms.map((transform) => ({ 8738 ...transform, 8739 blockName, 8740 usingMobileTransformations 8741 })); 8742 } 8743 function maybeCheckTransformIsMatch(transform, blocks) { 8744 if (typeof transform.isMatch !== "function") { 8745 return true; 8746 } 8747 const sourceBlock = blocks[0]; 8748 const attributes = transform.isMultiBlock ? blocks.map((block2) => block2.attributes) : sourceBlock.attributes; 8749 const block = transform.isMultiBlock ? blocks : sourceBlock; 8750 return transform.isMatch(attributes, block); 8751 } 8752 function switchToBlockType(blocks, name) { 8753 const blocksArray = Array.isArray(blocks) ? blocks : [blocks]; 8754 const isMultiBlock = blocksArray.length > 1; 8755 const firstBlock = blocksArray[0]; 8756 const sourceName = firstBlock.name; 8757 const transformationsFrom = getBlockTransforms("from", name); 8758 const transformationsTo = getBlockTransforms("to", sourceName); 8759 const transformation = findTransform( 8760 transformationsTo, 8761 (t) => t.type === "block" && (isWildcardBlockTransform(t) || t.blocks.indexOf(name) !== -1) && (!isMultiBlock || t.isMultiBlock) && maybeCheckTransformIsMatch(t, blocksArray) 8762 ) || findTransform( 8763 transformationsFrom, 8764 (t) => t.type === "block" && (isWildcardBlockTransform(t) || t.blocks.indexOf(sourceName) !== -1) && (!isMultiBlock || t.isMultiBlock) && maybeCheckTransformIsMatch(t, blocksArray) 8765 ); 8766 if (!transformation) { 8767 return null; 8768 } 8769 let transformationResults; 8770 if (transformation.isMultiBlock) { 8771 if ("__experimentalConvert" in transformation) { 8772 transformationResults = transformation.__experimentalConvert(blocksArray); 8773 } else { 8774 transformationResults = transformation.transform( 8775 blocksArray.map((currentBlock) => currentBlock.attributes), 8776 blocksArray.map((currentBlock) => currentBlock.innerBlocks) 8777 ); 8778 } 8779 } else if ("__experimentalConvert" in transformation) { 8780 transformationResults = transformation.__experimentalConvert(firstBlock); 8781 } else { 8782 transformationResults = transformation.transform( 8783 firstBlock.attributes, 8784 firstBlock.innerBlocks 8785 ); 8786 } 8787 if (transformationResults === null || typeof transformationResults !== "object") { 8788 return null; 8789 } 8790 transformationResults = Array.isArray(transformationResults) ? transformationResults : [transformationResults]; 8791 if (transformationResults.some( 8792 (result) => !getBlockType(result.name) 8793 )) { 8794 return null; 8795 } 8796 const hasSwitchedBlock = transformationResults.some( 8797 (result) => result.name === name 8798 ); 8799 if (!hasSwitchedBlock) { 8800 return null; 8801 } 8802 const ret = transformationResults.map((result, index, results) => { 8803 return (0,external_wp_hooks_namespaceObject.applyFilters)( 8804 "blocks.switchToBlockType.transformedBlock", 8805 result, 8806 blocks, 8807 index, 8808 results 8809 ); 8810 }); 8811 return ret; 8812 } 8813 const getBlockFromExample = (name, example) => createBlock( 8814 name, 8815 example.attributes, 8816 (example.innerBlocks ?? []).map( 8817 (innerBlock) => getBlockFromExample(innerBlock.name, innerBlock) 8818 ) 8819 ); 8820 8821 8822 ;// external ["wp","blockSerializationDefaultParser"] 8823 const external_wp_blockSerializationDefaultParser_namespaceObject = window["wp"]["blockSerializationDefaultParser"]; 8824 ;// external ["wp","autop"] 8825 const external_wp_autop_namespaceObject = window["wp"]["autop"]; 8826 ;// external "ReactJSXRuntime" 8827 const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"]; 8828 ;// external ["wp","isShallowEqual"] 8829 const external_wp_isShallowEqual_namespaceObject = window["wp"]["isShallowEqual"]; 8830 var external_wp_isShallowEqual_default = /*#__PURE__*/__webpack_require__.n(external_wp_isShallowEqual_namespaceObject); 8831 ;// ./node_modules/@wordpress/blocks/build-module/api/parser/serialize-raw-block.js 8832 8833 function serializeRawBlock(rawBlock, options = {}) { 8834 const { isCommentDelimited = true } = options; 8835 const { 8836 blockName, 8837 attrs = {}, 8838 innerBlocks = [], 8839 innerContent = [] 8840 } = rawBlock; 8841 let childIndex = 0; 8842 const content = innerContent.map( 8843 (item) => ( 8844 // `null` denotes a nested block, otherwise we have an HTML fragment. 8845 item !== null ? item : serializeRawBlock(innerBlocks[childIndex++], options) 8846 ) 8847 ).join("\n").replace(/\n+/g, "\n").trim(); 8848 return isCommentDelimited ? getCommentDelimitedContent(blockName, attrs, content) : content; 8849 } 8850 8851 8852 ;// ./node_modules/@wordpress/blocks/build-module/api/serializer.js 8853 8854 8855 8856 8857 8858 8859 8860 8861 8862 function getBlockDefaultClassName(blockName) { 8863 const className = "wp-block-" + blockName.replace(/\//, "-").replace(/^core-/, ""); 8864 return (0,external_wp_hooks_namespaceObject.applyFilters)( 8865 "blocks.getBlockDefaultClassName", 8866 className, 8867 blockName 8868 ); 8869 } 8870 function getBlockMenuDefaultClassName(blockName) { 8871 const className = "editor-block-list-item-" + blockName.replace(/\//, "-").replace(/^core-/, ""); 8872 return (0,external_wp_hooks_namespaceObject.applyFilters)( 8873 "blocks.getBlockMenuDefaultClassName", 8874 className, 8875 blockName 8876 ); 8877 } 8878 const blockPropsProvider = {}; 8879 const innerBlocksPropsProvider = {}; 8880 function getBlockProps(props = {}) { 8881 const { blockType, attributes } = blockPropsProvider; 8882 return getBlockProps.skipFilters ? props : (0,external_wp_hooks_namespaceObject.applyFilters)( 8883 "blocks.getSaveContent.extraProps", 8884 { ...props }, 8885 blockType, 8886 attributes 8887 ); 8888 } 8889 function getInnerBlocksProps(props = {}) { 8890 const { innerBlocks } = innerBlocksPropsProvider; 8891 if (!Array.isArray(innerBlocks)) { 8892 return { ...props, children: innerBlocks }; 8893 } 8894 const html = serialize(innerBlocks, { isInnerBlocks: true }); 8895 const children = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_element_namespaceObject.RawHTML, { children: html }); 8896 return { ...props, children }; 8897 } 8898 function getSaveElement(blockTypeOrName, attributes, innerBlocks = []) { 8899 const blockType = normalizeBlockType(blockTypeOrName); 8900 if (!blockType?.save) { 8901 return null; 8902 } 8903 let { save } = blockType; 8904 if (save.prototype instanceof external_wp_element_namespaceObject.Component) { 8905 const instance = new save({ attributes }); 8906 save = instance.render.bind(instance); 8907 } 8908 blockPropsProvider.blockType = blockType; 8909 blockPropsProvider.attributes = attributes; 8910 innerBlocksPropsProvider.innerBlocks = innerBlocks; 8911 let element = save({ attributes, innerBlocks }); 8912 if (element !== null && typeof element === "object" && (0,external_wp_hooks_namespaceObject.hasFilter)("blocks.getSaveContent.extraProps") && !(blockType.apiVersion > 1)) { 8913 const props = (0,external_wp_hooks_namespaceObject.applyFilters)( 8914 "blocks.getSaveContent.extraProps", 8915 { ...element.props }, 8916 blockType, 8917 attributes 8918 ); 8919 if (!external_wp_isShallowEqual_default()(props, element.props)) { 8920 element = (0,external_wp_element_namespaceObject.cloneElement)(element, props); 8921 } 8922 } 8923 return (0,external_wp_hooks_namespaceObject.applyFilters)( 8924 "blocks.getSaveElement", 8925 element, 8926 blockType, 8927 attributes 8928 ); 8929 } 8930 function getSaveContent(blockTypeOrName, attributes, innerBlocks) { 8931 const blockType = normalizeBlockType(blockTypeOrName); 8932 return (0,external_wp_element_namespaceObject.renderToString)( 8933 getSaveElement(blockType, attributes, innerBlocks) 8934 ); 8935 } 8936 function getCommentAttributes(blockType, attributes) { 8937 return Object.entries(blockType.attributes ?? {}).reduce( 8938 (accumulator, [key, attributeSchema]) => { 8939 const value = attributes[key]; 8940 if (void 0 === value) { 8941 return accumulator; 8942 } 8943 if (attributeSchema.source !== void 0) { 8944 return accumulator; 8945 } 8946 if (attributeSchema.role === "local") { 8947 return accumulator; 8948 } 8949 if (attributeSchema.__experimentalRole === "local") { 8950 external_wp_deprecated_default()("__experimentalRole attribute", { 8951 since: "6.7", 8952 version: "6.8", 8953 alternative: "role attribute", 8954 hint: `Check the block.json of the $blockType?.name} block.` 8955 }); 8956 return accumulator; 8957 } 8958 if ("default" in attributeSchema && JSON.stringify(attributeSchema.default) === JSON.stringify(value)) { 8959 return accumulator; 8960 } 8961 accumulator[key] = value; 8962 return accumulator; 8963 }, 8964 {} 8965 ); 8966 } 8967 function serializeAttributes(attributes) { 8968 return JSON.stringify(attributes).replaceAll("\\\\", "\\u005c").replaceAll("--", "\\u002d\\u002d").replaceAll("<", "\\u003c").replaceAll(">", "\\u003e").replaceAll("&", "\\u0026").replaceAll('\\"', "\\u0022"); 8969 } 8970 function getBlockInnerHTML(block) { 8971 let saveContent = block.originalContent; 8972 if (block.isValid || block.innerBlocks.length) { 8973 try { 8974 saveContent = getSaveContent( 8975 block.name, 8976 block.attributes, 8977 block.innerBlocks 8978 ); 8979 } catch (error) { 8980 } 8981 } 8982 return saveContent; 8983 } 8984 function getCommentDelimitedContent(rawBlockName, attributes, content) { 8985 const serializedAttributes = attributes && Object.entries(attributes).length ? serializeAttributes(attributes) + " " : ""; 8986 const blockName = rawBlockName?.startsWith("core/") ? rawBlockName.slice(5) : rawBlockName; 8987 if (!content) { 8988 return `<!-- wp:$blockName} $serializedAttributes}/-->`; 8989 } 8990 return `<!-- wp:$blockName} $serializedAttributes}--> 8991 ` + content + ` 8992 <!-- /wp:$blockName} -->`; 8993 } 8994 function serializeBlock(block, { isInnerBlocks = false } = {}) { 8995 if (!block.isValid && block.__unstableBlockSource) { 8996 return serializeRawBlock(block.__unstableBlockSource); 8997 } 8998 const blockName = block.name; 8999 const saveContent = getBlockInnerHTML(block); 9000 if (blockName === getUnregisteredTypeHandlerName() || !isInnerBlocks && blockName === getFreeformContentHandlerName()) { 9001 return saveContent; 9002 } 9003 const blockType = getBlockType(blockName); 9004 if (!blockType) { 9005 return saveContent; 9006 } 9007 const saveAttributes = getCommentAttributes(blockType, block.attributes); 9008 return getCommentDelimitedContent(blockName, saveAttributes, saveContent); 9009 } 9010 function __unstableSerializeAndClean(blocks) { 9011 if (blocks.length === 1 && isUnmodifiedDefaultBlock(blocks[0])) { 9012 blocks = []; 9013 } 9014 let content = serialize(blocks); 9015 if (blocks.length === 1 && blocks[0].name === getFreeformContentHandlerName() && blocks[0].name === "core/freeform") { 9016 content = (0,external_wp_autop_namespaceObject.removep)(content); 9017 } 9018 return content; 9019 } 9020 function serialize(blocks, options) { 9021 const blocksArray = Array.isArray(blocks) ? blocks : [blocks]; 9022 return blocksArray.map((block) => serializeBlock(block, options)).join("\n\n"); 9023 } 9024 9025 9026 ;// ./node_modules/simple-html-tokenizer/dist/es6/index.js 9027 /** 9028 * generated from https://raw.githubusercontent.com/w3c/html/26b5126f96f736f796b9e29718138919dd513744/entities.json 9029 * do not edit 9030 */ 9031 var namedCharRefs = { 9032 Aacute: "Á", aacute: "á", Abreve: "Ă", abreve: "ă", ac: "∾", acd: "∿", acE: "∾̳", Acirc: "Â", acirc: "â", acute: "´", Acy: "А", acy: "а", AElig: "Æ", aelig: "æ", af: "\u2061", Afr: "𝔄", afr: "𝔞", Agrave: "À", agrave: "à", alefsym: "ℵ", aleph: "ℵ", Alpha: "Α", alpha: "α", Amacr: "Ā", amacr: "ā", amalg: "⨿", amp: "&", AMP: "&", andand: "⩕", And: "⩓", and: "∧", andd: "⩜", andslope: "⩘", andv: "⩚", ang: "∠", ange: "⦤", angle: "∠", angmsdaa: "⦨", angmsdab: "⦩", angmsdac: "⦪", angmsdad: "⦫", angmsdae: "⦬", angmsdaf: "⦭", angmsdag: "⦮", angmsdah: "⦯", angmsd: "∡", angrt: "∟", angrtvb: "⊾", angrtvbd: "⦝", angsph: "∢", angst: "Å", angzarr: "⍼", Aogon: "Ą", aogon: "ą", Aopf: "𝔸", aopf: "𝕒", apacir: "⩯", ap: "≈", apE: "⩰", ape: "≊", apid: "≋", apos: "'", ApplyFunction: "\u2061", approx: "≈", approxeq: "≊", Aring: "Å", aring: "å", Ascr: "𝒜", ascr: "𝒶", Assign: "≔", ast: "*", asymp: "≈", asympeq: "≍", Atilde: "Ã", atilde: "ã", Auml: "Ä", auml: "ä", awconint: "∳", awint: "⨑", backcong: "≌", backepsilon: "϶", backprime: "‵", backsim: "∽", backsimeq: "⋍", Backslash: "∖", Barv: "⫧", barvee: "⊽", barwed: "⌅", Barwed: "⌆", barwedge: "⌅", bbrk: "⎵", bbrktbrk: "⎶", bcong: "≌", Bcy: "Б", bcy: "б", bdquo: "„", becaus: "∵", because: "∵", Because: "∵", bemptyv: "⦰", bepsi: "϶", bernou: "ℬ", Bernoullis: "ℬ", Beta: "Β", beta: "β", beth: "ℶ", between: "≬", Bfr: "𝔅", bfr: "𝔟", bigcap: "⋂", bigcirc: "◯", bigcup: "⋃", bigodot: "⨀", bigoplus: "⨁", bigotimes: "⨂", bigsqcup: "⨆", bigstar: "★", bigtriangledown: "▽", bigtriangleup: "△", biguplus: "⨄", bigvee: "⋁", bigwedge: "⋀", bkarow: "⤍", blacklozenge: "⧫", blacksquare: "▪", blacktriangle: "▴", blacktriangledown: "▾", blacktriangleleft: "◂", blacktriangleright: "▸", blank: "␣", blk12: "▒", blk14: "░", blk34: "▓", block: "█", bne: "=⃥", bnequiv: "≡⃥", bNot: "⫭", bnot: "⌐", Bopf: "𝔹", bopf: "𝕓", bot: "⊥", bottom: "⊥", bowtie: "⋈", boxbox: "⧉", boxdl: "┐", boxdL: "╕", boxDl: "╖", boxDL: "╗", boxdr: "┌", boxdR: "╒", boxDr: "╓", boxDR: "╔", boxh: "─", boxH: "═", boxhd: "┬", boxHd: "╤", boxhD: "╥", boxHD: "╦", boxhu: "┴", boxHu: "╧", boxhU: "╨", boxHU: "╩", boxminus: "⊟", boxplus: "⊞", boxtimes: "⊠", boxul: "┘", boxuL: "╛", boxUl: "╜", boxUL: "╝", boxur: "└", boxuR: "╘", boxUr: "╙", boxUR: "╚", boxv: "│", boxV: "║", boxvh: "┼", boxvH: "╪", boxVh: "╫", boxVH: "╬", boxvl: "┤", boxvL: "╡", boxVl: "╢", boxVL: "╣", boxvr: "├", boxvR: "╞", boxVr: "╟", boxVR: "╠", bprime: "‵", breve: "˘", Breve: "˘", brvbar: "¦", bscr: "𝒷", Bscr: "ℬ", bsemi: "⁏", bsim: "∽", bsime: "⋍", bsolb: "⧅", bsol: "\\", bsolhsub: "⟈", bull: "•", bullet: "•", bump: "≎", bumpE: "⪮", bumpe: "≏", Bumpeq: "≎", bumpeq: "≏", Cacute: "Ć", cacute: "ć", capand: "⩄", capbrcup: "⩉", capcap: "⩋", cap: "∩", Cap: "⋒", capcup: "⩇", capdot: "⩀", CapitalDifferentialD: "ⅅ", caps: "∩︀", caret: "⁁", caron: "ˇ", Cayleys: "ℭ", ccaps: "⩍", Ccaron: "Č", ccaron: "č", Ccedil: "Ç", ccedil: "ç", Ccirc: "Ĉ", ccirc: "ĉ", Cconint: "∰", ccups: "⩌", ccupssm: "⩐", Cdot: "Ċ", cdot: "ċ", cedil: "¸", Cedilla: "¸", cemptyv: "⦲", cent: "¢", centerdot: "·", CenterDot: "·", cfr: "𝔠", Cfr: "ℭ", CHcy: "Ч", chcy: "ч", check: "✓", checkmark: "✓", Chi: "Χ", chi: "χ", circ: "ˆ", circeq: "≗", circlearrowleft: "↺", circlearrowright: "↻", circledast: "⊛", circledcirc: "⊚", circleddash: "⊝", CircleDot: "⊙", circledR: "®", circledS: "Ⓢ", CircleMinus: "⊖", CirclePlus: "⊕", CircleTimes: "⊗", cir: "○", cirE: "⧃", cire: "≗", cirfnint: "⨐", cirmid: "⫯", cirscir: "⧂", ClockwiseContourIntegral: "∲", CloseCurlyDoubleQuote: "”", CloseCurlyQuote: "’", clubs: "♣", clubsuit: "♣", colon: ":", Colon: "∷", Colone: "⩴", colone: "≔", coloneq: "≔", comma: ",", commat: "@", comp: "∁", compfn: "∘", complement: "∁", complexes: "ℂ", cong: "≅", congdot: "⩭", Congruent: "≡", conint: "∮", Conint: "∯", ContourIntegral: "∮", copf: "𝕔", Copf: "ℂ", coprod: "∐", Coproduct: "∐", copy: "©", COPY: "©", copysr: "℗", CounterClockwiseContourIntegral: "∳", crarr: "↵", cross: "✗", Cross: "⨯", Cscr: "𝒞", cscr: "𝒸", csub: "⫏", csube: "⫑", csup: "⫐", csupe: "⫒", ctdot: "⋯", cudarrl: "⤸", cudarrr: "⤵", cuepr: "⋞", cuesc: "⋟", cularr: "↶", cularrp: "⤽", cupbrcap: "⩈", cupcap: "⩆", CupCap: "≍", cup: "∪", Cup: "⋓", cupcup: "⩊", cupdot: "⊍", cupor: "⩅", cups: "∪︀", curarr: "↷", curarrm: "⤼", curlyeqprec: "⋞", curlyeqsucc: "⋟", curlyvee: "⋎", curlywedge: "⋏", curren: "¤", curvearrowleft: "↶", curvearrowright: "↷", cuvee: "⋎", cuwed: "⋏", cwconint: "∲", cwint: "∱", cylcty: "⌭", dagger: "†", Dagger: "‡", daleth: "ℸ", darr: "↓", Darr: "↡", dArr: "⇓", dash: "‐", Dashv: "⫤", dashv: "⊣", dbkarow: "⤏", dblac: "˝", Dcaron: "Ď", dcaron: "ď", Dcy: "Д", dcy: "д", ddagger: "‡", ddarr: "⇊", DD: "ⅅ", dd: "ⅆ", DDotrahd: "⤑", ddotseq: "⩷", deg: "°", Del: "∇", Delta: "Δ", delta: "δ", demptyv: "⦱", dfisht: "⥿", Dfr: "𝔇", dfr: "𝔡", dHar: "⥥", dharl: "⇃", dharr: "⇂", DiacriticalAcute: "´", DiacriticalDot: "˙", DiacriticalDoubleAcute: "˝", DiacriticalGrave: "`", DiacriticalTilde: "˜", diam: "⋄", diamond: "⋄", Diamond: "⋄", diamondsuit: "♦", diams: "♦", die: "¨", DifferentialD: "ⅆ", digamma: "ϝ", disin: "⋲", div: "÷", divide: "÷", divideontimes: "⋇", divonx: "⋇", DJcy: "Ђ", djcy: "ђ", dlcorn: "⌞", dlcrop: "⌍", dollar: "$", Dopf: "𝔻", dopf: "𝕕", Dot: "¨", dot: "˙", DotDot: "⃜", doteq: "≐", doteqdot: "≑", DotEqual: "≐", dotminus: "∸", dotplus: "∔", dotsquare: "⊡", doublebarwedge: "⌆", DoubleContourIntegral: "∯", DoubleDot: "¨", DoubleDownArrow: "⇓", DoubleLeftArrow: "⇐", DoubleLeftRightArrow: "⇔", DoubleLeftTee: "⫤", DoubleLongLeftArrow: "⟸", DoubleLongLeftRightArrow: "⟺", DoubleLongRightArrow: "⟹", DoubleRightArrow: "⇒", DoubleRightTee: "⊨", DoubleUpArrow: "⇑", DoubleUpDownArrow: "⇕", DoubleVerticalBar: "∥", DownArrowBar: "⤓", downarrow: "↓", DownArrow: "↓", Downarrow: "⇓", DownArrowUpArrow: "⇵", DownBreve: "̑", downdownarrows: "⇊", downharpoonleft: "⇃", downharpoonright: "⇂", DownLeftRightVector: "⥐", DownLeftTeeVector: "⥞", DownLeftVectorBar: "⥖", DownLeftVector: "↽", DownRightTeeVector: "⥟", DownRightVectorBar: "⥗", DownRightVector: "⇁", DownTeeArrow: "↧", DownTee: "⊤", drbkarow: "⤐", drcorn: "⌟", drcrop: "⌌", Dscr: "𝒟", dscr: "𝒹", DScy: "Ѕ", dscy: "ѕ", dsol: "⧶", Dstrok: "Đ", dstrok: "đ", dtdot: "⋱", dtri: "▿", dtrif: "▾", duarr: "⇵", duhar: "⥯", dwangle: "⦦", DZcy: "Џ", dzcy: "џ", dzigrarr: "⟿", Eacute: "É", eacute: "é", easter: "⩮", Ecaron: "Ě", ecaron: "ě", Ecirc: "Ê", ecirc: "ê", ecir: "≖", ecolon: "≕", Ecy: "Э", ecy: "э", eDDot: "⩷", Edot: "Ė", edot: "ė", eDot: "≑", ee: "ⅇ", efDot: "≒", Efr: "𝔈", efr: "𝔢", eg: "⪚", Egrave: "È", egrave: "è", egs: "⪖", egsdot: "⪘", el: "⪙", Element: "∈", elinters: "⏧", ell: "ℓ", els: "⪕", elsdot: "⪗", Emacr: "Ē", emacr: "ē", empty: "∅", emptyset: "∅", EmptySmallSquare: "◻", emptyv: "∅", EmptyVerySmallSquare: "▫", emsp13: " ", emsp14: " ", emsp: " ", ENG: "Ŋ", eng: "ŋ", ensp: " ", Eogon: "Ę", eogon: "ę", Eopf: "𝔼", eopf: "𝕖", epar: "⋕", eparsl: "⧣", eplus: "⩱", epsi: "ε", Epsilon: "Ε", epsilon: "ε", epsiv: "ϵ", eqcirc: "≖", eqcolon: "≕", eqsim: "≂", eqslantgtr: "⪖", eqslantless: "⪕", Equal: "⩵", equals: "=", EqualTilde: "≂", equest: "≟", Equilibrium: "⇌", equiv: "≡", equivDD: "⩸", eqvparsl: "⧥", erarr: "⥱", erDot: "≓", escr: "ℯ", Escr: "ℰ", esdot: "≐", Esim: "⩳", esim: "≂", Eta: "Η", eta: "η", ETH: "Ð", eth: "ð", Euml: "Ë", euml: "ë", euro: "€", excl: "!", exist: "∃", Exists: "∃", expectation: "ℰ", exponentiale: "ⅇ", ExponentialE: "ⅇ", fallingdotseq: "≒", Fcy: "Ф", fcy: "ф", female: "♀", ffilig: "ffi", fflig: "ff", ffllig: "ffl", Ffr: "𝔉", ffr: "𝔣", filig: "fi", FilledSmallSquare: "◼", FilledVerySmallSquare: "▪", fjlig: "fj", flat: "♭", fllig: "fl", fltns: "▱", fnof: "ƒ", Fopf: "𝔽", fopf: "𝕗", forall: "∀", ForAll: "∀", fork: "⋔", forkv: "⫙", Fouriertrf: "ℱ", fpartint: "⨍", frac12: "½", frac13: "⅓", frac14: "¼", frac15: "⅕", frac16: "⅙", frac18: "⅛", frac23: "⅔", frac25: "⅖", frac34: "¾", frac35: "⅗", frac38: "⅜", frac45: "⅘", frac56: "⅚", frac58: "⅝", frac78: "⅞", frasl: "⁄", frown: "⌢", fscr: "𝒻", Fscr: "ℱ", gacute: "ǵ", Gamma: "Γ", gamma: "γ", Gammad: "Ϝ", gammad: "ϝ", gap: "⪆", Gbreve: "Ğ", gbreve: "ğ", Gcedil: "Ģ", Gcirc: "Ĝ", gcirc: "ĝ", Gcy: "Г", gcy: "г", Gdot: "Ġ", gdot: "ġ", ge: "≥", gE: "≧", gEl: "⪌", gel: "⋛", geq: "≥", geqq: "≧", geqslant: "⩾", gescc: "⪩", ges: "⩾", gesdot: "⪀", gesdoto: "⪂", gesdotol: "⪄", gesl: "⋛︀", gesles: "⪔", Gfr: "𝔊", gfr: "𝔤", gg: "≫", Gg: "⋙", ggg: "⋙", gimel: "ℷ", GJcy: "Ѓ", gjcy: "ѓ", gla: "⪥", gl: "≷", glE: "⪒", glj: "⪤", gnap: "⪊", gnapprox: "⪊", gne: "⪈", gnE: "≩", gneq: "⪈", gneqq: "≩", gnsim: "⋧", Gopf: "𝔾", gopf: "𝕘", grave: "`", GreaterEqual: "≥", GreaterEqualLess: "⋛", GreaterFullEqual: "≧", GreaterGreater: "⪢", GreaterLess: "≷", GreaterSlantEqual: "⩾", GreaterTilde: "≳", Gscr: "𝒢", gscr: "ℊ", gsim: "≳", gsime: "⪎", gsiml: "⪐", gtcc: "⪧", gtcir: "⩺", gt: ">", GT: ">", Gt: "≫", gtdot: "⋗", gtlPar: "⦕", gtquest: "⩼", gtrapprox: "⪆", gtrarr: "⥸", gtrdot: "⋗", gtreqless: "⋛", gtreqqless: "⪌", gtrless: "≷", gtrsim: "≳", gvertneqq: "≩︀", gvnE: "≩︀", Hacek: "ˇ", hairsp: " ", half: "½", hamilt: "ℋ", HARDcy: "Ъ", hardcy: "ъ", harrcir: "⥈", harr: "↔", hArr: "⇔", harrw: "↭", Hat: "^", hbar: "ℏ", Hcirc: "Ĥ", hcirc: "ĥ", hearts: "♥", heartsuit: "♥", hellip: "…", hercon: "⊹", hfr: "𝔥", Hfr: "ℌ", HilbertSpace: "ℋ", hksearow: "⤥", hkswarow: "⤦", hoarr: "⇿", homtht: "∻", hookleftarrow: "↩", hookrightarrow: "↪", hopf: "𝕙", Hopf: "ℍ", horbar: "―", HorizontalLine: "─", hscr: "𝒽", Hscr: "ℋ", hslash: "ℏ", Hstrok: "Ħ", hstrok: "ħ", HumpDownHump: "≎", HumpEqual: "≏", hybull: "⁃", hyphen: "‐", Iacute: "Í", iacute: "í", ic: "\u2063", Icirc: "Î", icirc: "î", Icy: "И", icy: "и", Idot: "İ", IEcy: "Е", iecy: "е", iexcl: "¡", iff: "⇔", ifr: "𝔦", Ifr: "ℑ", Igrave: "Ì", igrave: "ì", ii: "ⅈ", iiiint: "⨌", iiint: "∭", iinfin: "⧜", iiota: "℩", IJlig: "IJ", ijlig: "ij", Imacr: "Ī", imacr: "ī", image: "ℑ", ImaginaryI: "ⅈ", imagline: "ℐ", imagpart: "ℑ", imath: "ı", Im: "ℑ", imof: "⊷", imped: "Ƶ", Implies: "⇒", incare: "℅", in: "∈", infin: "∞", infintie: "⧝", inodot: "ı", intcal: "⊺", int: "∫", Int: "∬", integers: "ℤ", Integral: "∫", intercal: "⊺", Intersection: "⋂", intlarhk: "⨗", intprod: "⨼", InvisibleComma: "\u2063", InvisibleTimes: "\u2062", IOcy: "Ё", iocy: "ё", Iogon: "Į", iogon: "į", Iopf: "𝕀", iopf: "𝕚", Iota: "Ι", iota: "ι", iprod: "⨼", iquest: "¿", iscr: "𝒾", Iscr: "ℐ", isin: "∈", isindot: "⋵", isinE: "⋹", isins: "⋴", isinsv: "⋳", isinv: "∈", it: "\u2062", Itilde: "Ĩ", itilde: "ĩ", Iukcy: "І", iukcy: "і", Iuml: "Ï", iuml: "ï", Jcirc: "Ĵ", jcirc: "ĵ", Jcy: "Й", jcy: "й", Jfr: "𝔍", jfr: "𝔧", jmath: "ȷ", Jopf: "𝕁", jopf: "𝕛", Jscr: "𝒥", jscr: "𝒿", Jsercy: "Ј", jsercy: "ј", Jukcy: "Є", jukcy: "є", Kappa: "Κ", kappa: "κ", kappav: "ϰ", Kcedil: "Ķ", kcedil: "ķ", Kcy: "К", kcy: "к", Kfr: "𝔎", kfr: "𝔨", kgreen: "ĸ", KHcy: "Х", khcy: "х", KJcy: "Ќ", kjcy: "ќ", Kopf: "𝕂", kopf: "𝕜", Kscr: "𝒦", kscr: "𝓀", lAarr: "⇚", Lacute: "Ĺ", lacute: "ĺ", laemptyv: "⦴", lagran: "ℒ", Lambda: "Λ", lambda: "λ", lang: "⟨", Lang: "⟪", langd: "⦑", langle: "⟨", lap: "⪅", Laplacetrf: "ℒ", laquo: "«", larrb: "⇤", larrbfs: "⤟", larr: "←", Larr: "↞", lArr: "⇐", larrfs: "⤝", larrhk: "↩", larrlp: "↫", larrpl: "⤹", larrsim: "⥳", larrtl: "↢", latail: "⤙", lAtail: "⤛", lat: "⪫", late: "⪭", lates: "⪭︀", lbarr: "⤌", lBarr: "⤎", lbbrk: "❲", lbrace: "{", lbrack: "[", lbrke: "⦋", lbrksld: "⦏", lbrkslu: "⦍", Lcaron: "Ľ", lcaron: "ľ", Lcedil: "Ļ", lcedil: "ļ", lceil: "⌈", lcub: "{", Lcy: "Л", lcy: "л", ldca: "⤶", ldquo: "“", ldquor: "„", ldrdhar: "⥧", ldrushar: "⥋", ldsh: "↲", le: "≤", lE: "≦", LeftAngleBracket: "⟨", LeftArrowBar: "⇤", leftarrow: "←", LeftArrow: "←", Leftarrow: "⇐", LeftArrowRightArrow: "⇆", leftarrowtail: "↢", LeftCeiling: "⌈", LeftDoubleBracket: "⟦", LeftDownTeeVector: "⥡", LeftDownVectorBar: "⥙", LeftDownVector: "⇃", LeftFloor: "⌊", leftharpoondown: "↽", leftharpoonup: "↼", leftleftarrows: "⇇", leftrightarrow: "↔", LeftRightArrow: "↔", Leftrightarrow: "⇔", leftrightarrows: "⇆", leftrightharpoons: "⇋", leftrightsquigarrow: "↭", LeftRightVector: "⥎", LeftTeeArrow: "↤", LeftTee: "⊣", LeftTeeVector: "⥚", leftthreetimes: "⋋", LeftTriangleBar: "⧏", LeftTriangle: "⊲", LeftTriangleEqual: "⊴", LeftUpDownVector: "⥑", LeftUpTeeVector: "⥠", LeftUpVectorBar: "⥘", LeftUpVector: "↿", LeftVectorBar: "⥒", LeftVector: "↼", lEg: "⪋", leg: "⋚", leq: "≤", leqq: "≦", leqslant: "⩽", lescc: "⪨", les: "⩽", lesdot: "⩿", lesdoto: "⪁", lesdotor: "⪃", lesg: "⋚︀", lesges: "⪓", lessapprox: "⪅", lessdot: "⋖", lesseqgtr: "⋚", lesseqqgtr: "⪋", LessEqualGreater: "⋚", LessFullEqual: "≦", LessGreater: "≶", lessgtr: "≶", LessLess: "⪡", lesssim: "≲", LessSlantEqual: "⩽", LessTilde: "≲", lfisht: "⥼", lfloor: "⌊", Lfr: "𝔏", lfr: "𝔩", lg: "≶", lgE: "⪑", lHar: "⥢", lhard: "↽", lharu: "↼", lharul: "⥪", lhblk: "▄", LJcy: "Љ", ljcy: "љ", llarr: "⇇", ll: "≪", Ll: "⋘", llcorner: "⌞", Lleftarrow: "⇚", llhard: "⥫", lltri: "◺", Lmidot: "Ŀ", lmidot: "ŀ", lmoustache: "⎰", lmoust: "⎰", lnap: "⪉", lnapprox: "⪉", lne: "⪇", lnE: "≨", lneq: "⪇", lneqq: "≨", lnsim: "⋦", loang: "⟬", loarr: "⇽", lobrk: "⟦", longleftarrow: "⟵", LongLeftArrow: "⟵", Longleftarrow: "⟸", longleftrightarrow: "⟷", LongLeftRightArrow: "⟷", Longleftrightarrow: "⟺", longmapsto: "⟼", longrightarrow: "⟶", LongRightArrow: "⟶", Longrightarrow: "⟹", looparrowleft: "↫", looparrowright: "↬", lopar: "⦅", Lopf: "𝕃", lopf: "𝕝", loplus: "⨭", lotimes: "⨴", lowast: "∗", lowbar: "_", LowerLeftArrow: "↙", LowerRightArrow: "↘", loz: "◊", lozenge: "◊", lozf: "⧫", lpar: "(", lparlt: "⦓", lrarr: "⇆", lrcorner: "⌟", lrhar: "⇋", lrhard: "⥭", lrm: "\u200e", lrtri: "⊿", lsaquo: "‹", lscr: "𝓁", Lscr: "ℒ", lsh: "↰", Lsh: "↰", lsim: "≲", lsime: "⪍", lsimg: "⪏", lsqb: "[", lsquo: "‘", lsquor: "‚", Lstrok: "Ł", lstrok: "ł", ltcc: "⪦", ltcir: "⩹", lt: "<", LT: "<", Lt: "≪", ltdot: "⋖", lthree: "⋋", ltimes: "⋉", ltlarr: "⥶", ltquest: "⩻", ltri: "◃", ltrie: "⊴", ltrif: "◂", ltrPar: "⦖", lurdshar: "⥊", luruhar: "⥦", lvertneqq: "≨︀", lvnE: "≨︀", macr: "¯", male: "♂", malt: "✠", maltese: "✠", Map: "⤅", map: "↦", mapsto: "↦", mapstodown: "↧", mapstoleft: "↤", mapstoup: "↥", marker: "▮", mcomma: "⨩", Mcy: "М", mcy: "м", mdash: "—", mDDot: "∺", measuredangle: "∡", MediumSpace: " ", Mellintrf: "ℳ", Mfr: "𝔐", mfr: "𝔪", mho: "℧", micro: "µ", midast: "*", midcir: "⫰", mid: "∣", middot: "·", minusb: "⊟", minus: "−", minusd: "∸", minusdu: "⨪", MinusPlus: "∓", mlcp: "⫛", mldr: "…", mnplus: "∓", models: "⊧", Mopf: "𝕄", mopf: "𝕞", mp: "∓", mscr: "𝓂", Mscr: "ℳ", mstpos: "∾", Mu: "Μ", mu: "μ", multimap: "⊸", mumap: "⊸", nabla: "∇", Nacute: "Ń", nacute: "ń", nang: "∠⃒", nap: "≉", napE: "⩰̸", napid: "≋̸", napos: "ʼn", napprox: "≉", natural: "♮", naturals: "ℕ", natur: "♮", nbsp: " ", nbump: "≎̸", nbumpe: "≏̸", ncap: "⩃", Ncaron: "Ň", ncaron: "ň", Ncedil: "Ņ", ncedil: "ņ", ncong: "≇", ncongdot: "⩭̸", ncup: "⩂", Ncy: "Н", ncy: "н", ndash: "–", nearhk: "⤤", nearr: "↗", neArr: "⇗", nearrow: "↗", ne: "≠", nedot: "≐̸", NegativeMediumSpace: "", NegativeThickSpace: "", NegativeThinSpace: "", NegativeVeryThinSpace: "", nequiv: "≢", nesear: "⤨", nesim: "≂̸", NestedGreaterGreater: "≫", NestedLessLess: "≪", NewLine: "\u000a", nexist: "∄", nexists: "∄", Nfr: "𝔑", nfr: "𝔫", ngE: "≧̸", nge: "≱", ngeq: "≱", ngeqq: "≧̸", ngeqslant: "⩾̸", nges: "⩾̸", nGg: "⋙̸", ngsim: "≵", nGt: "≫⃒", ngt: "≯", ngtr: "≯", nGtv: "≫̸", nharr: "↮", nhArr: "⇎", nhpar: "⫲", ni: "∋", nis: "⋼", nisd: "⋺", niv: "∋", NJcy: "Њ", njcy: "њ", nlarr: "↚", nlArr: "⇍", nldr: "‥", nlE: "≦̸", nle: "≰", nleftarrow: "↚", nLeftarrow: "⇍", nleftrightarrow: "↮", nLeftrightarrow: "⇎", nleq: "≰", nleqq: "≦̸", nleqslant: "⩽̸", nles: "⩽̸", nless: "≮", nLl: "⋘̸", nlsim: "≴", nLt: "≪⃒", nlt: "≮", nltri: "⋪", nltrie: "⋬", nLtv: "≪̸", nmid: "∤", NoBreak: "\u2060", NonBreakingSpace: " ", nopf: "𝕟", Nopf: "ℕ", Not: "⫬", not: "¬", NotCongruent: "≢", NotCupCap: "≭", NotDoubleVerticalBar: "∦", NotElement: "∉", NotEqual: "≠", NotEqualTilde: "≂̸", NotExists: "∄", NotGreater: "≯", NotGreaterEqual: "≱", NotGreaterFullEqual: "≧̸", NotGreaterGreater: "≫̸", NotGreaterLess: "≹", NotGreaterSlantEqual: "⩾̸", NotGreaterTilde: "≵", NotHumpDownHump: "≎̸", NotHumpEqual: "≏̸", notin: "∉", notindot: "⋵̸", notinE: "⋹̸", notinva: "∉", notinvb: "⋷", notinvc: "⋶", NotLeftTriangleBar: "⧏̸", NotLeftTriangle: "⋪", NotLeftTriangleEqual: "⋬", NotLess: "≮", NotLessEqual: "≰", NotLessGreater: "≸", NotLessLess: "≪̸", NotLessSlantEqual: "⩽̸", NotLessTilde: "≴", NotNestedGreaterGreater: "⪢̸", NotNestedLessLess: "⪡̸", notni: "∌", notniva: "∌", notnivb: "⋾", notnivc: "⋽", NotPrecedes: "⊀", NotPrecedesEqual: "⪯̸", NotPrecedesSlantEqual: "⋠", NotReverseElement: "∌", NotRightTriangleBar: "⧐̸", NotRightTriangle: "⋫", NotRightTriangleEqual: "⋭", NotSquareSubset: "⊏̸", NotSquareSubsetEqual: "⋢", NotSquareSuperset: "⊐̸", NotSquareSupersetEqual: "⋣", NotSubset: "⊂⃒", NotSubsetEqual: "⊈", NotSucceeds: "⊁", NotSucceedsEqual: "⪰̸", NotSucceedsSlantEqual: "⋡", NotSucceedsTilde: "≿̸", NotSuperset: "⊃⃒", NotSupersetEqual: "⊉", NotTilde: "≁", NotTildeEqual: "≄", NotTildeFullEqual: "≇", NotTildeTilde: "≉", NotVerticalBar: "∤", nparallel: "∦", npar: "∦", nparsl: "⫽⃥", npart: "∂̸", npolint: "⨔", npr: "⊀", nprcue: "⋠", nprec: "⊀", npreceq: "⪯̸", npre: "⪯̸", nrarrc: "⤳̸", nrarr: "↛", nrArr: "⇏", nrarrw: "↝̸", nrightarrow: "↛", nRightarrow: "⇏", nrtri: "⋫", nrtrie: "⋭", nsc: "⊁", nsccue: "⋡", nsce: "⪰̸", Nscr: "𝒩", nscr: "𝓃", nshortmid: "∤", nshortparallel: "∦", nsim: "≁", nsime: "≄", nsimeq: "≄", nsmid: "∤", nspar: "∦", nsqsube: "⋢", nsqsupe: "⋣", nsub: "⊄", nsubE: "⫅̸", nsube: "⊈", nsubset: "⊂⃒", nsubseteq: "⊈", nsubseteqq: "⫅̸", nsucc: "⊁", nsucceq: "⪰̸", nsup: "⊅", nsupE: "⫆̸", nsupe: "⊉", nsupset: "⊃⃒", nsupseteq: "⊉", nsupseteqq: "⫆̸", ntgl: "≹", Ntilde: "Ñ", ntilde: "ñ", ntlg: "≸", ntriangleleft: "⋪", ntrianglelefteq: "⋬", ntriangleright: "⋫", ntrianglerighteq: "⋭", Nu: "Ν", nu: "ν", num: "#", numero: "№", numsp: " ", nvap: "≍⃒", nvdash: "⊬", nvDash: "⊭", nVdash: "⊮", nVDash: "⊯", nvge: "≥⃒", nvgt: ">⃒", nvHarr: "⤄", nvinfin: "⧞", nvlArr: "⤂", nvle: "≤⃒", nvlt: "<⃒", nvltrie: "⊴⃒", nvrArr: "⤃", nvrtrie: "⊵⃒", nvsim: "∼⃒", nwarhk: "⤣", nwarr: "↖", nwArr: "⇖", nwarrow: "↖", nwnear: "⤧", Oacute: "Ó", oacute: "ó", oast: "⊛", Ocirc: "Ô", ocirc: "ô", ocir: "⊚", Ocy: "О", ocy: "о", odash: "⊝", Odblac: "Ő", odblac: "ő", odiv: "⨸", odot: "⊙", odsold: "⦼", OElig: "Œ", oelig: "œ", ofcir: "⦿", Ofr: "𝔒", ofr: "𝔬", ogon: "˛", Ograve: "Ò", ograve: "ò", ogt: "⧁", ohbar: "⦵", ohm: "Ω", oint: "∮", olarr: "↺", olcir: "⦾", olcross: "⦻", oline: "‾", olt: "⧀", Omacr: "Ō", omacr: "ō", Omega: "Ω", omega: "ω", Omicron: "Ο", omicron: "ο", omid: "⦶", ominus: "⊖", Oopf: "𝕆", oopf: "𝕠", opar: "⦷", OpenCurlyDoubleQuote: "“", OpenCurlyQuote: "‘", operp: "⦹", oplus: "⊕", orarr: "↻", Or: "⩔", or: "∨", ord: "⩝", order: "ℴ", orderof: "ℴ", ordf: "ª", ordm: "º", origof: "⊶", oror: "⩖", orslope: "⩗", orv: "⩛", oS: "Ⓢ", Oscr: "𝒪", oscr: "ℴ", Oslash: "Ø", oslash: "ø", osol: "⊘", Otilde: "Õ", otilde: "õ", otimesas: "⨶", Otimes: "⨷", otimes: "⊗", Ouml: "Ö", ouml: "ö", ovbar: "⌽", OverBar: "‾", OverBrace: "⏞", OverBracket: "⎴", OverParenthesis: "⏜", para: "¶", parallel: "∥", par: "∥", parsim: "⫳", parsl: "⫽", part: "∂", PartialD: "∂", Pcy: "П", pcy: "п", percnt: "%", period: ".", permil: "‰", perp: "⊥", pertenk: "‱", Pfr: "𝔓", pfr: "𝔭", Phi: "Φ", phi: "φ", phiv: "ϕ", phmmat: "ℳ", phone: "☎", Pi: "Π", pi: "π", pitchfork: "⋔", piv: "ϖ", planck: "ℏ", planckh: "ℎ", plankv: "ℏ", plusacir: "⨣", plusb: "⊞", pluscir: "⨢", plus: "+", plusdo: "∔", plusdu: "⨥", pluse: "⩲", PlusMinus: "±", plusmn: "±", plussim: "⨦", plustwo: "⨧", pm: "±", Poincareplane: "ℌ", pointint: "⨕", popf: "𝕡", Popf: "ℙ", pound: "£", prap: "⪷", Pr: "⪻", pr: "≺", prcue: "≼", precapprox: "⪷", prec: "≺", preccurlyeq: "≼", Precedes: "≺", PrecedesEqual: "⪯", PrecedesSlantEqual: "≼", PrecedesTilde: "≾", preceq: "⪯", precnapprox: "⪹", precneqq: "⪵", precnsim: "⋨", pre: "⪯", prE: "⪳", precsim: "≾", prime: "′", Prime: "″", primes: "ℙ", prnap: "⪹", prnE: "⪵", prnsim: "⋨", prod: "∏", Product: "∏", profalar: "⌮", profline: "⌒", profsurf: "⌓", prop: "∝", Proportional: "∝", Proportion: "∷", propto: "∝", prsim: "≾", prurel: "⊰", Pscr: "𝒫", pscr: "𝓅", Psi: "Ψ", psi: "ψ", puncsp: " ", Qfr: "𝔔", qfr: "𝔮", qint: "⨌", qopf: "𝕢", Qopf: "ℚ", qprime: "⁗", Qscr: "𝒬", qscr: "𝓆", quaternions: "ℍ", quatint: "⨖", quest: "?", questeq: "≟", quot: "\"", QUOT: "\"", rAarr: "⇛", race: "∽̱", Racute: "Ŕ", racute: "ŕ", radic: "√", raemptyv: "⦳", rang: "⟩", Rang: "⟫", rangd: "⦒", range: "⦥", rangle: "⟩", raquo: "»", rarrap: "⥵", rarrb: "⇥", rarrbfs: "⤠", rarrc: "⤳", rarr: "→", Rarr: "↠", rArr: "⇒", rarrfs: "⤞", rarrhk: "↪", rarrlp: "↬", rarrpl: "⥅", rarrsim: "⥴", Rarrtl: "⤖", rarrtl: "↣", rarrw: "↝", ratail: "⤚", rAtail: "⤜", ratio: "∶", rationals: "ℚ", rbarr: "⤍", rBarr: "⤏", RBarr: "⤐", rbbrk: "❳", rbrace: "}", rbrack: "]", rbrke: "⦌", rbrksld: "⦎", rbrkslu: "⦐", Rcaron: "Ř", rcaron: "ř", Rcedil: "Ŗ", rcedil: "ŗ", rceil: "⌉", rcub: "}", Rcy: "Р", rcy: "р", rdca: "⤷", rdldhar: "⥩", rdquo: "”", rdquor: "”", rdsh: "↳", real: "ℜ", realine: "ℛ", realpart: "ℜ", reals: "ℝ", Re: "ℜ", rect: "▭", reg: "®", REG: "®", ReverseElement: "∋", ReverseEquilibrium: "⇋", ReverseUpEquilibrium: "⥯", rfisht: "⥽", rfloor: "⌋", rfr: "𝔯", Rfr: "ℜ", rHar: "⥤", rhard: "⇁", rharu: "⇀", rharul: "⥬", Rho: "Ρ", rho: "ρ", rhov: "ϱ", RightAngleBracket: "⟩", RightArrowBar: "⇥", rightarrow: "→", RightArrow: "→", Rightarrow: "⇒", RightArrowLeftArrow: "⇄", rightarrowtail: "↣", RightCeiling: "⌉", RightDoubleBracket: "⟧", RightDownTeeVector: "⥝", RightDownVectorBar: "⥕", RightDownVector: "⇂", RightFloor: "⌋", rightharpoondown: "⇁", rightharpoonup: "⇀", rightleftarrows: "⇄", rightleftharpoons: "⇌", rightrightarrows: "⇉", rightsquigarrow: "↝", RightTeeArrow: "↦", RightTee: "⊢", RightTeeVector: "⥛", rightthreetimes: "⋌", RightTriangleBar: "⧐", RightTriangle: "⊳", RightTriangleEqual: "⊵", RightUpDownVector: "⥏", RightUpTeeVector: "⥜", RightUpVectorBar: "⥔", RightUpVector: "↾", RightVectorBar: "⥓", RightVector: "⇀", ring: "˚", risingdotseq: "≓", rlarr: "⇄", rlhar: "⇌", rlm: "\u200f", rmoustache: "⎱", rmoust: "⎱", rnmid: "⫮", roang: "⟭", roarr: "⇾", robrk: "⟧", ropar: "⦆", ropf: "𝕣", Ropf: "ℝ", roplus: "⨮", rotimes: "⨵", RoundImplies: "⥰", rpar: ")", rpargt: "⦔", rppolint: "⨒", rrarr: "⇉", Rrightarrow: "⇛", rsaquo: "›", rscr: "𝓇", Rscr: "ℛ", rsh: "↱", Rsh: "↱", rsqb: "]", rsquo: "’", rsquor: "’", rthree: "⋌", rtimes: "⋊", rtri: "▹", rtrie: "⊵", rtrif: "▸", rtriltri: "⧎", RuleDelayed: "⧴", ruluhar: "⥨", rx: "℞", Sacute: "Ś", sacute: "ś", sbquo: "‚", scap: "⪸", Scaron: "Š", scaron: "š", Sc: "⪼", sc: "≻", sccue: "≽", sce: "⪰", scE: "⪴", Scedil: "Ş", scedil: "ş", Scirc: "Ŝ", scirc: "ŝ", scnap: "⪺", scnE: "⪶", scnsim: "⋩", scpolint: "⨓", scsim: "≿", Scy: "С", scy: "с", sdotb: "⊡", sdot: "⋅", sdote: "⩦", searhk: "⤥", searr: "↘", seArr: "⇘", searrow: "↘", sect: "§", semi: ";", seswar: "⤩", setminus: "∖", setmn: "∖", sext: "✶", Sfr: "𝔖", sfr: "𝔰", sfrown: "⌢", sharp: "♯", SHCHcy: "Щ", shchcy: "щ", SHcy: "Ш", shcy: "ш", ShortDownArrow: "↓", ShortLeftArrow: "←", shortmid: "∣", shortparallel: "∥", ShortRightArrow: "→", ShortUpArrow: "↑", shy: "\u00ad", Sigma: "Σ", sigma: "σ", sigmaf: "ς", sigmav: "ς", sim: "∼", simdot: "⩪", sime: "≃", simeq: "≃", simg: "⪞", simgE: "⪠", siml: "⪝", simlE: "⪟", simne: "≆", simplus: "⨤", simrarr: "⥲", slarr: "←", SmallCircle: "∘", smallsetminus: "∖", smashp: "⨳", smeparsl: "⧤", smid: "∣", smile: "⌣", smt: "⪪", smte: "⪬", smtes: "⪬︀", SOFTcy: "Ь", softcy: "ь", solbar: "⌿", solb: "⧄", sol: "/", Sopf: "𝕊", sopf: "𝕤", spades: "♠", spadesuit: "♠", spar: "∥", sqcap: "⊓", sqcaps: "⊓︀", sqcup: "⊔", sqcups: "⊔︀", Sqrt: "√", sqsub: "⊏", sqsube: "⊑", sqsubset: "⊏", sqsubseteq: "⊑", sqsup: "⊐", sqsupe: "⊒", sqsupset: "⊐", sqsupseteq: "⊒", square: "□", Square: "□", SquareIntersection: "⊓", SquareSubset: "⊏", SquareSubsetEqual: "⊑", SquareSuperset: "⊐", SquareSupersetEqual: "⊒", SquareUnion: "⊔", squarf: "▪", squ: "□", squf: "▪", srarr: "→", Sscr: "𝒮", sscr: "𝓈", ssetmn: "∖", ssmile: "⌣", sstarf: "⋆", Star: "⋆", star: "☆", starf: "★", straightepsilon: "ϵ", straightphi: "ϕ", strns: "¯", sub: "⊂", Sub: "⋐", subdot: "⪽", subE: "⫅", sube: "⊆", subedot: "⫃", submult: "⫁", subnE: "⫋", subne: "⊊", subplus: "⪿", subrarr: "⥹", subset: "⊂", Subset: "⋐", subseteq: "⊆", subseteqq: "⫅", SubsetEqual: "⊆", subsetneq: "⊊", subsetneqq: "⫋", subsim: "⫇", subsub: "⫕", subsup: "⫓", succapprox: "⪸", succ: "≻", succcurlyeq: "≽", Succeeds: "≻", SucceedsEqual: "⪰", SucceedsSlantEqual: "≽", SucceedsTilde: "≿", succeq: "⪰", succnapprox: "⪺", succneqq: "⪶", succnsim: "⋩", succsim: "≿", SuchThat: "∋", sum: "∑", Sum: "∑", sung: "♪", sup1: "¹", sup2: "²", sup3: "³", sup: "⊃", Sup: "⋑", supdot: "⪾", supdsub: "⫘", supE: "⫆", supe: "⊇", supedot: "⫄", Superset: "⊃", SupersetEqual: "⊇", suphsol: "⟉", suphsub: "⫗", suplarr: "⥻", supmult: "⫂", supnE: "⫌", supne: "⊋", supplus: "⫀", supset: "⊃", Supset: "⋑", supseteq: "⊇", supseteqq: "⫆", supsetneq: "⊋", supsetneqq: "⫌", supsim: "⫈", supsub: "⫔", supsup: "⫖", swarhk: "⤦", swarr: "↙", swArr: "⇙", swarrow: "↙", swnwar: "⤪", szlig: "ß", Tab: "\u0009", target: "⌖", Tau: "Τ", tau: "τ", tbrk: "⎴", Tcaron: "Ť", tcaron: "ť", Tcedil: "Ţ", tcedil: "ţ", Tcy: "Т", tcy: "т", tdot: "⃛", telrec: "⌕", Tfr: "𝔗", tfr: "𝔱", there4: "∴", therefore: "∴", Therefore: "∴", Theta: "Θ", theta: "θ", thetasym: "ϑ", thetav: "ϑ", thickapprox: "≈", thicksim: "∼", ThickSpace: " ", ThinSpace: " ", thinsp: " ", thkap: "≈", thksim: "∼", THORN: "Þ", thorn: "þ", tilde: "˜", Tilde: "∼", TildeEqual: "≃", TildeFullEqual: "≅", TildeTilde: "≈", timesbar: "⨱", timesb: "⊠", times: "×", timesd: "⨰", tint: "∭", toea: "⤨", topbot: "⌶", topcir: "⫱", top: "⊤", Topf: "𝕋", topf: "𝕥", topfork: "⫚", tosa: "⤩", tprime: "‴", trade: "™", TRADE: "™", triangle: "▵", triangledown: "▿", triangleleft: "◃", trianglelefteq: "⊴", triangleq: "≜", triangleright: "▹", trianglerighteq: "⊵", tridot: "◬", trie: "≜", triminus: "⨺", TripleDot: "⃛", triplus: "⨹", trisb: "⧍", tritime: "⨻", trpezium: "⏢", Tscr: "𝒯", tscr: "𝓉", TScy: "Ц", tscy: "ц", TSHcy: "Ћ", tshcy: "ћ", Tstrok: "Ŧ", tstrok: "ŧ", twixt: "≬", twoheadleftarrow: "↞", twoheadrightarrow: "↠", Uacute: "Ú", uacute: "ú", uarr: "↑", Uarr: "↟", uArr: "⇑", Uarrocir: "⥉", Ubrcy: "Ў", ubrcy: "ў", Ubreve: "Ŭ", ubreve: "ŭ", Ucirc: "Û", ucirc: "û", Ucy: "У", ucy: "у", udarr: "⇅", Udblac: "Ű", udblac: "ű", udhar: "⥮", ufisht: "⥾", Ufr: "𝔘", ufr: "𝔲", Ugrave: "Ù", ugrave: "ù", uHar: "⥣", uharl: "↿", uharr: "↾", uhblk: "▀", ulcorn: "⌜", ulcorner: "⌜", ulcrop: "⌏", ultri: "◸", Umacr: "Ū", umacr: "ū", uml: "¨", UnderBar: "_", UnderBrace: "⏟", UnderBracket: "⎵", UnderParenthesis: "⏝", Union: "⋃", UnionPlus: "⊎", Uogon: "Ų", uogon: "ų", Uopf: "𝕌", uopf: "𝕦", UpArrowBar: "⤒", uparrow: "↑", UpArrow: "↑", Uparrow: "⇑", UpArrowDownArrow: "⇅", updownarrow: "↕", UpDownArrow: "↕", Updownarrow: "⇕", UpEquilibrium: "⥮", upharpoonleft: "↿", upharpoonright: "↾", uplus: "⊎", UpperLeftArrow: "↖", UpperRightArrow: "↗", upsi: "υ", Upsi: "ϒ", upsih: "ϒ", Upsilon: "Υ", upsilon: "υ", UpTeeArrow: "↥", UpTee: "⊥", upuparrows: "⇈", urcorn: "⌝", urcorner: "⌝", urcrop: "⌎", Uring: "Ů", uring: "ů", urtri: "◹", Uscr: "𝒰", uscr: "𝓊", utdot: "⋰", Utilde: "Ũ", utilde: "ũ", utri: "▵", utrif: "▴", uuarr: "⇈", Uuml: "Ü", uuml: "ü", uwangle: "⦧", vangrt: "⦜", varepsilon: "ϵ", varkappa: "ϰ", varnothing: "∅", varphi: "ϕ", varpi: "ϖ", varpropto: "∝", varr: "↕", vArr: "⇕", varrho: "ϱ", varsigma: "ς", varsubsetneq: "⊊︀", varsubsetneqq: "⫋︀", varsupsetneq: "⊋︀", varsupsetneqq: "⫌︀", vartheta: "ϑ", vartriangleleft: "⊲", vartriangleright: "⊳", vBar: "⫨", Vbar: "⫫", vBarv: "⫩", Vcy: "В", vcy: "в", vdash: "⊢", vDash: "⊨", Vdash: "⊩", VDash: "⊫", Vdashl: "⫦", veebar: "⊻", vee: "∨", Vee: "⋁", veeeq: "≚", vellip: "⋮", verbar: "|", Verbar: "‖", vert: "|", Vert: "‖", VerticalBar: "∣", VerticalLine: "|", VerticalSeparator: "❘", VerticalTilde: "≀", VeryThinSpace: " ", Vfr: "𝔙", vfr: "𝔳", vltri: "⊲", vnsub: "⊂⃒", vnsup: "⊃⃒", Vopf: "𝕍", vopf: "𝕧", vprop: "∝", vrtri: "⊳", Vscr: "𝒱", vscr: "𝓋", vsubnE: "⫋︀", vsubne: "⊊︀", vsupnE: "⫌︀", vsupne: "⊋︀", Vvdash: "⊪", vzigzag: "⦚", Wcirc: "Ŵ", wcirc: "ŵ", wedbar: "⩟", wedge: "∧", Wedge: "⋀", wedgeq: "≙", weierp: "℘", Wfr: "𝔚", wfr: "𝔴", Wopf: "𝕎", wopf: "𝕨", wp: "℘", wr: "≀", wreath: "≀", Wscr: "𝒲", wscr: "𝓌", xcap: "⋂", xcirc: "◯", xcup: "⋃", xdtri: "▽", Xfr: "𝔛", xfr: "𝔵", xharr: "⟷", xhArr: "⟺", Xi: "Ξ", xi: "ξ", xlarr: "⟵", xlArr: "⟸", xmap: "⟼", xnis: "⋻", xodot: "⨀", Xopf: "𝕏", xopf: "𝕩", xoplus: "⨁", xotime: "⨂", xrarr: "⟶", xrArr: "⟹", Xscr: "𝒳", xscr: "𝓍", xsqcup: "⨆", xuplus: "⨄", xutri: "△", xvee: "⋁", xwedge: "⋀", Yacute: "Ý", yacute: "ý", YAcy: "Я", yacy: "я", Ycirc: "Ŷ", ycirc: "ŷ", Ycy: "Ы", ycy: "ы", yen: "¥", Yfr: "𝔜", yfr: "𝔶", YIcy: "Ї", yicy: "ї", Yopf: "𝕐", yopf: "𝕪", Yscr: "𝒴", yscr: "𝓎", YUcy: "Ю", yucy: "ю", yuml: "ÿ", Yuml: "Ÿ", Zacute: "Ź", zacute: "ź", Zcaron: "Ž", zcaron: "ž", Zcy: "З", zcy: "з", Zdot: "Ż", zdot: "ż", zeetrf: "ℨ", ZeroWidthSpace: "", Zeta: "Ζ", zeta: "ζ", zfr: "𝔷", Zfr: "ℨ", ZHcy: "Ж", zhcy: "ж", zigrarr: "⇝", zopf: "𝕫", Zopf: "ℤ", Zscr: "𝒵", zscr: "𝓏", zwj: "\u200d", zwnj: "\u200c" 9033 }; 9034 9035 var HEXCHARCODE = /^#[xX]([A-Fa-f0-9]+)$/; 9036 var CHARCODE = /^#([0-9]+)$/; 9037 var NAMED = /^([A-Za-z0-9]+)$/; 9038 var EntityParser = /** @class */ (function () { 9039 function EntityParser(named) { 9040 this.named = named; 9041 } 9042 EntityParser.prototype.parse = function (entity) { 9043 if (!entity) { 9044 return; 9045 } 9046 var matches = entity.match(HEXCHARCODE); 9047 if (matches) { 9048 return String.fromCharCode(parseInt(matches[1], 16)); 9049 } 9050 matches = entity.match(CHARCODE); 9051 if (matches) { 9052 return String.fromCharCode(parseInt(matches[1], 10)); 9053 } 9054 matches = entity.match(NAMED); 9055 if (matches) { 9056 return this.named[matches[1]]; 9057 } 9058 }; 9059 return EntityParser; 9060 }()); 9061 9062 var WSP = /[\t\n\f ]/; 9063 var ALPHA = /[A-Za-z]/; 9064 var CRLF = /\r\n?/g; 9065 function isSpace(char) { 9066 return WSP.test(char); 9067 } 9068 function isAlpha(char) { 9069 return ALPHA.test(char); 9070 } 9071 function preprocessInput(input) { 9072 return input.replace(CRLF, '\n'); 9073 } 9074 9075 var EventedTokenizer = /** @class */ (function () { 9076 function EventedTokenizer(delegate, entityParser, mode) { 9077 if (mode === void 0) { mode = 'precompile'; } 9078 this.delegate = delegate; 9079 this.entityParser = entityParser; 9080 this.mode = mode; 9081 this.state = "beforeData" /* beforeData */; 9082 this.line = -1; 9083 this.column = -1; 9084 this.input = ''; 9085 this.index = -1; 9086 this.tagNameBuffer = ''; 9087 this.states = { 9088 beforeData: function () { 9089 var char = this.peek(); 9090 if (char === '<' && !this.isIgnoredEndTag()) { 9091 this.transitionTo("tagOpen" /* tagOpen */); 9092 this.markTagStart(); 9093 this.consume(); 9094 } 9095 else { 9096 if (this.mode === 'precompile' && char === '\n') { 9097 var tag = this.tagNameBuffer.toLowerCase(); 9098 if (tag === 'pre' || tag === 'textarea') { 9099 this.consume(); 9100 } 9101 } 9102 this.transitionTo("data" /* data */); 9103 this.delegate.beginData(); 9104 } 9105 }, 9106 data: function () { 9107 var char = this.peek(); 9108 var tag = this.tagNameBuffer; 9109 if (char === '<' && !this.isIgnoredEndTag()) { 9110 this.delegate.finishData(); 9111 this.transitionTo("tagOpen" /* tagOpen */); 9112 this.markTagStart(); 9113 this.consume(); 9114 } 9115 else if (char === '&' && tag !== 'script' && tag !== 'style') { 9116 this.consume(); 9117 this.delegate.appendToData(this.consumeCharRef() || '&'); 9118 } 9119 else { 9120 this.consume(); 9121 this.delegate.appendToData(char); 9122 } 9123 }, 9124 tagOpen: function () { 9125 var char = this.consume(); 9126 if (char === '!') { 9127 this.transitionTo("markupDeclarationOpen" /* markupDeclarationOpen */); 9128 } 9129 else if (char === '/') { 9130 this.transitionTo("endTagOpen" /* endTagOpen */); 9131 } 9132 else if (char === '@' || char === ':' || isAlpha(char)) { 9133 this.transitionTo("tagName" /* tagName */); 9134 this.tagNameBuffer = ''; 9135 this.delegate.beginStartTag(); 9136 this.appendToTagName(char); 9137 } 9138 }, 9139 markupDeclarationOpen: function () { 9140 var char = this.consume(); 9141 if (char === '-' && this.peek() === '-') { 9142 this.consume(); 9143 this.transitionTo("commentStart" /* commentStart */); 9144 this.delegate.beginComment(); 9145 } 9146 else { 9147 var maybeDoctype = char.toUpperCase() + this.input.substring(this.index, this.index + 6).toUpperCase(); 9148 if (maybeDoctype === 'DOCTYPE') { 9149 this.consume(); 9150 this.consume(); 9151 this.consume(); 9152 this.consume(); 9153 this.consume(); 9154 this.consume(); 9155 this.transitionTo("doctype" /* doctype */); 9156 if (this.delegate.beginDoctype) 9157 this.delegate.beginDoctype(); 9158 } 9159 } 9160 }, 9161 doctype: function () { 9162 var char = this.consume(); 9163 if (isSpace(char)) { 9164 this.transitionTo("beforeDoctypeName" /* beforeDoctypeName */); 9165 } 9166 }, 9167 beforeDoctypeName: function () { 9168 var char = this.consume(); 9169 if (isSpace(char)) { 9170 return; 9171 } 9172 else { 9173 this.transitionTo("doctypeName" /* doctypeName */); 9174 if (this.delegate.appendToDoctypeName) 9175 this.delegate.appendToDoctypeName(char.toLowerCase()); 9176 } 9177 }, 9178 doctypeName: function () { 9179 var char = this.consume(); 9180 if (isSpace(char)) { 9181 this.transitionTo("afterDoctypeName" /* afterDoctypeName */); 9182 } 9183 else if (char === '>') { 9184 if (this.delegate.endDoctype) 9185 this.delegate.endDoctype(); 9186 this.transitionTo("beforeData" /* beforeData */); 9187 } 9188 else { 9189 if (this.delegate.appendToDoctypeName) 9190 this.delegate.appendToDoctypeName(char.toLowerCase()); 9191 } 9192 }, 9193 afterDoctypeName: function () { 9194 var char = this.consume(); 9195 if (isSpace(char)) { 9196 return; 9197 } 9198 else if (char === '>') { 9199 if (this.delegate.endDoctype) 9200 this.delegate.endDoctype(); 9201 this.transitionTo("beforeData" /* beforeData */); 9202 } 9203 else { 9204 var nextSixChars = char.toUpperCase() + this.input.substring(this.index, this.index + 5).toUpperCase(); 9205 var isPublic = nextSixChars.toUpperCase() === 'PUBLIC'; 9206 var isSystem = nextSixChars.toUpperCase() === 'SYSTEM'; 9207 if (isPublic || isSystem) { 9208 this.consume(); 9209 this.consume(); 9210 this.consume(); 9211 this.consume(); 9212 this.consume(); 9213 this.consume(); 9214 } 9215 if (isPublic) { 9216 this.transitionTo("afterDoctypePublicKeyword" /* afterDoctypePublicKeyword */); 9217 } 9218 else if (isSystem) { 9219 this.transitionTo("afterDoctypeSystemKeyword" /* afterDoctypeSystemKeyword */); 9220 } 9221 } 9222 }, 9223 afterDoctypePublicKeyword: function () { 9224 var char = this.peek(); 9225 if (isSpace(char)) { 9226 this.transitionTo("beforeDoctypePublicIdentifier" /* beforeDoctypePublicIdentifier */); 9227 this.consume(); 9228 } 9229 else if (char === '"') { 9230 this.transitionTo("doctypePublicIdentifierDoubleQuoted" /* doctypePublicIdentifierDoubleQuoted */); 9231 this.consume(); 9232 } 9233 else if (char === "'") { 9234 this.transitionTo("doctypePublicIdentifierSingleQuoted" /* doctypePublicIdentifierSingleQuoted */); 9235 this.consume(); 9236 } 9237 else if (char === '>') { 9238 this.consume(); 9239 if (this.delegate.endDoctype) 9240 this.delegate.endDoctype(); 9241 this.transitionTo("beforeData" /* beforeData */); 9242 } 9243 }, 9244 doctypePublicIdentifierDoubleQuoted: function () { 9245 var char = this.consume(); 9246 if (char === '"') { 9247 this.transitionTo("afterDoctypePublicIdentifier" /* afterDoctypePublicIdentifier */); 9248 } 9249 else if (char === '>') { 9250 if (this.delegate.endDoctype) 9251 this.delegate.endDoctype(); 9252 this.transitionTo("beforeData" /* beforeData */); 9253 } 9254 else { 9255 if (this.delegate.appendToDoctypePublicIdentifier) 9256 this.delegate.appendToDoctypePublicIdentifier(char); 9257 } 9258 }, 9259 doctypePublicIdentifierSingleQuoted: function () { 9260 var char = this.consume(); 9261 if (char === "'") { 9262 this.transitionTo("afterDoctypePublicIdentifier" /* afterDoctypePublicIdentifier */); 9263 } 9264 else if (char === '>') { 9265 if (this.delegate.endDoctype) 9266 this.delegate.endDoctype(); 9267 this.transitionTo("beforeData" /* beforeData */); 9268 } 9269 else { 9270 if (this.delegate.appendToDoctypePublicIdentifier) 9271 this.delegate.appendToDoctypePublicIdentifier(char); 9272 } 9273 }, 9274 afterDoctypePublicIdentifier: function () { 9275 var char = this.consume(); 9276 if (isSpace(char)) { 9277 this.transitionTo("betweenDoctypePublicAndSystemIdentifiers" /* betweenDoctypePublicAndSystemIdentifiers */); 9278 } 9279 else if (char === '>') { 9280 if (this.delegate.endDoctype) 9281 this.delegate.endDoctype(); 9282 this.transitionTo("beforeData" /* beforeData */); 9283 } 9284 else if (char === '"') { 9285 this.transitionTo("doctypeSystemIdentifierDoubleQuoted" /* doctypeSystemIdentifierDoubleQuoted */); 9286 } 9287 else if (char === "'") { 9288 this.transitionTo("doctypeSystemIdentifierSingleQuoted" /* doctypeSystemIdentifierSingleQuoted */); 9289 } 9290 }, 9291 betweenDoctypePublicAndSystemIdentifiers: function () { 9292 var char = this.consume(); 9293 if (isSpace(char)) { 9294 return; 9295 } 9296 else if (char === '>') { 9297 if (this.delegate.endDoctype) 9298 this.delegate.endDoctype(); 9299 this.transitionTo("beforeData" /* beforeData */); 9300 } 9301 else if (char === '"') { 9302 this.transitionTo("doctypeSystemIdentifierDoubleQuoted" /* doctypeSystemIdentifierDoubleQuoted */); 9303 } 9304 else if (char === "'") { 9305 this.transitionTo("doctypeSystemIdentifierSingleQuoted" /* doctypeSystemIdentifierSingleQuoted */); 9306 } 9307 }, 9308 doctypeSystemIdentifierDoubleQuoted: function () { 9309 var char = this.consume(); 9310 if (char === '"') { 9311 this.transitionTo("afterDoctypeSystemIdentifier" /* afterDoctypeSystemIdentifier */); 9312 } 9313 else if (char === '>') { 9314 if (this.delegate.endDoctype) 9315 this.delegate.endDoctype(); 9316 this.transitionTo("beforeData" /* beforeData */); 9317 } 9318 else { 9319 if (this.delegate.appendToDoctypeSystemIdentifier) 9320 this.delegate.appendToDoctypeSystemIdentifier(char); 9321 } 9322 }, 9323 doctypeSystemIdentifierSingleQuoted: function () { 9324 var char = this.consume(); 9325 if (char === "'") { 9326 this.transitionTo("afterDoctypeSystemIdentifier" /* afterDoctypeSystemIdentifier */); 9327 } 9328 else if (char === '>') { 9329 if (this.delegate.endDoctype) 9330 this.delegate.endDoctype(); 9331 this.transitionTo("beforeData" /* beforeData */); 9332 } 9333 else { 9334 if (this.delegate.appendToDoctypeSystemIdentifier) 9335 this.delegate.appendToDoctypeSystemIdentifier(char); 9336 } 9337 }, 9338 afterDoctypeSystemIdentifier: function () { 9339 var char = this.consume(); 9340 if (isSpace(char)) { 9341 return; 9342 } 9343 else if (char === '>') { 9344 if (this.delegate.endDoctype) 9345 this.delegate.endDoctype(); 9346 this.transitionTo("beforeData" /* beforeData */); 9347 } 9348 }, 9349 commentStart: function () { 9350 var char = this.consume(); 9351 if (char === '-') { 9352 this.transitionTo("commentStartDash" /* commentStartDash */); 9353 } 9354 else if (char === '>') { 9355 this.delegate.finishComment(); 9356 this.transitionTo("beforeData" /* beforeData */); 9357 } 9358 else { 9359 this.delegate.appendToCommentData(char); 9360 this.transitionTo("comment" /* comment */); 9361 } 9362 }, 9363 commentStartDash: function () { 9364 var char = this.consume(); 9365 if (char === '-') { 9366 this.transitionTo("commentEnd" /* commentEnd */); 9367 } 9368 else if (char === '>') { 9369 this.delegate.finishComment(); 9370 this.transitionTo("beforeData" /* beforeData */); 9371 } 9372 else { 9373 this.delegate.appendToCommentData('-'); 9374 this.transitionTo("comment" /* comment */); 9375 } 9376 }, 9377 comment: function () { 9378 var char = this.consume(); 9379 if (char === '-') { 9380 this.transitionTo("commentEndDash" /* commentEndDash */); 9381 } 9382 else { 9383 this.delegate.appendToCommentData(char); 9384 } 9385 }, 9386 commentEndDash: function () { 9387 var char = this.consume(); 9388 if (char === '-') { 9389 this.transitionTo("commentEnd" /* commentEnd */); 9390 } 9391 else { 9392 this.delegate.appendToCommentData('-' + char); 9393 this.transitionTo("comment" /* comment */); 9394 } 9395 }, 9396 commentEnd: function () { 9397 var char = this.consume(); 9398 if (char === '>') { 9399 this.delegate.finishComment(); 9400 this.transitionTo("beforeData" /* beforeData */); 9401 } 9402 else { 9403 this.delegate.appendToCommentData('--' + char); 9404 this.transitionTo("comment" /* comment */); 9405 } 9406 }, 9407 tagName: function () { 9408 var char = this.consume(); 9409 if (isSpace(char)) { 9410 this.transitionTo("beforeAttributeName" /* beforeAttributeName */); 9411 } 9412 else if (char === '/') { 9413 this.transitionTo("selfClosingStartTag" /* selfClosingStartTag */); 9414 } 9415 else if (char === '>') { 9416 this.delegate.finishTag(); 9417 this.transitionTo("beforeData" /* beforeData */); 9418 } 9419 else { 9420 this.appendToTagName(char); 9421 } 9422 }, 9423 endTagName: function () { 9424 var char = this.consume(); 9425 if (isSpace(char)) { 9426 this.transitionTo("beforeAttributeName" /* beforeAttributeName */); 9427 this.tagNameBuffer = ''; 9428 } 9429 else if (char === '/') { 9430 this.transitionTo("selfClosingStartTag" /* selfClosingStartTag */); 9431 this.tagNameBuffer = ''; 9432 } 9433 else if (char === '>') { 9434 this.delegate.finishTag(); 9435 this.transitionTo("beforeData" /* beforeData */); 9436 this.tagNameBuffer = ''; 9437 } 9438 else { 9439 this.appendToTagName(char); 9440 } 9441 }, 9442 beforeAttributeName: function () { 9443 var char = this.peek(); 9444 if (isSpace(char)) { 9445 this.consume(); 9446 return; 9447 } 9448 else if (char === '/') { 9449 this.transitionTo("selfClosingStartTag" /* selfClosingStartTag */); 9450 this.consume(); 9451 } 9452 else if (char === '>') { 9453 this.consume(); 9454 this.delegate.finishTag(); 9455 this.transitionTo("beforeData" /* beforeData */); 9456 } 9457 else if (char === '=') { 9458 this.delegate.reportSyntaxError('attribute name cannot start with equals sign'); 9459 this.transitionTo("attributeName" /* attributeName */); 9460 this.delegate.beginAttribute(); 9461 this.consume(); 9462 this.delegate.appendToAttributeName(char); 9463 } 9464 else { 9465 this.transitionTo("attributeName" /* attributeName */); 9466 this.delegate.beginAttribute(); 9467 } 9468 }, 9469 attributeName: function () { 9470 var char = this.peek(); 9471 if (isSpace(char)) { 9472 this.transitionTo("afterAttributeName" /* afterAttributeName */); 9473 this.consume(); 9474 } 9475 else if (char === '/') { 9476 this.delegate.beginAttributeValue(false); 9477 this.delegate.finishAttributeValue(); 9478 this.consume(); 9479 this.transitionTo("selfClosingStartTag" /* selfClosingStartTag */); 9480 } 9481 else if (char === '=') { 9482 this.transitionTo("beforeAttributeValue" /* beforeAttributeValue */); 9483 this.consume(); 9484 } 9485 else if (char === '>') { 9486 this.delegate.beginAttributeValue(false); 9487 this.delegate.finishAttributeValue(); 9488 this.consume(); 9489 this.delegate.finishTag(); 9490 this.transitionTo("beforeData" /* beforeData */); 9491 } 9492 else if (char === '"' || char === "'" || char === '<') { 9493 this.delegate.reportSyntaxError(char + ' is not a valid character within attribute names'); 9494 this.consume(); 9495 this.delegate.appendToAttributeName(char); 9496 } 9497 else { 9498 this.consume(); 9499 this.delegate.appendToAttributeName(char); 9500 } 9501 }, 9502 afterAttributeName: function () { 9503 var char = this.peek(); 9504 if (isSpace(char)) { 9505 this.consume(); 9506 return; 9507 } 9508 else if (char === '/') { 9509 this.delegate.beginAttributeValue(false); 9510 this.delegate.finishAttributeValue(); 9511 this.consume(); 9512 this.transitionTo("selfClosingStartTag" /* selfClosingStartTag */); 9513 } 9514 else if (char === '=') { 9515 this.consume(); 9516 this.transitionTo("beforeAttributeValue" /* beforeAttributeValue */); 9517 } 9518 else if (char === '>') { 9519 this.delegate.beginAttributeValue(false); 9520 this.delegate.finishAttributeValue(); 9521 this.consume(); 9522 this.delegate.finishTag(); 9523 this.transitionTo("beforeData" /* beforeData */); 9524 } 9525 else { 9526 this.delegate.beginAttributeValue(false); 9527 this.delegate.finishAttributeValue(); 9528 this.transitionTo("attributeName" /* attributeName */); 9529 this.delegate.beginAttribute(); 9530 this.consume(); 9531 this.delegate.appendToAttributeName(char); 9532 } 9533 }, 9534 beforeAttributeValue: function () { 9535 var char = this.peek(); 9536 if (isSpace(char)) { 9537 this.consume(); 9538 } 9539 else if (char === '"') { 9540 this.transitionTo("attributeValueDoubleQuoted" /* attributeValueDoubleQuoted */); 9541 this.delegate.beginAttributeValue(true); 9542 this.consume(); 9543 } 9544 else if (char === "'") { 9545 this.transitionTo("attributeValueSingleQuoted" /* attributeValueSingleQuoted */); 9546 this.delegate.beginAttributeValue(true); 9547 this.consume(); 9548 } 9549 else if (char === '>') { 9550 this.delegate.beginAttributeValue(false); 9551 this.delegate.finishAttributeValue(); 9552 this.consume(); 9553 this.delegate.finishTag(); 9554 this.transitionTo("beforeData" /* beforeData */); 9555 } 9556 else { 9557 this.transitionTo("attributeValueUnquoted" /* attributeValueUnquoted */); 9558 this.delegate.beginAttributeValue(false); 9559 this.consume(); 9560 this.delegate.appendToAttributeValue(char); 9561 } 9562 }, 9563 attributeValueDoubleQuoted: function () { 9564 var char = this.consume(); 9565 if (char === '"') { 9566 this.delegate.finishAttributeValue(); 9567 this.transitionTo("afterAttributeValueQuoted" /* afterAttributeValueQuoted */); 9568 } 9569 else if (char === '&') { 9570 this.delegate.appendToAttributeValue(this.consumeCharRef() || '&'); 9571 } 9572 else { 9573 this.delegate.appendToAttributeValue(char); 9574 } 9575 }, 9576 attributeValueSingleQuoted: function () { 9577 var char = this.consume(); 9578 if (char === "'") { 9579 this.delegate.finishAttributeValue(); 9580 this.transitionTo("afterAttributeValueQuoted" /* afterAttributeValueQuoted */); 9581 } 9582 else if (char === '&') { 9583 this.delegate.appendToAttributeValue(this.consumeCharRef() || '&'); 9584 } 9585 else { 9586 this.delegate.appendToAttributeValue(char); 9587 } 9588 }, 9589 attributeValueUnquoted: function () { 9590 var char = this.peek(); 9591 if (isSpace(char)) { 9592 this.delegate.finishAttributeValue(); 9593 this.consume(); 9594 this.transitionTo("beforeAttributeName" /* beforeAttributeName */); 9595 } 9596 else if (char === '/') { 9597 this.delegate.finishAttributeValue(); 9598 this.consume(); 9599 this.transitionTo("selfClosingStartTag" /* selfClosingStartTag */); 9600 } 9601 else if (char === '&') { 9602 this.consume(); 9603 this.delegate.appendToAttributeValue(this.consumeCharRef() || '&'); 9604 } 9605 else if (char === '>') { 9606 this.delegate.finishAttributeValue(); 9607 this.consume(); 9608 this.delegate.finishTag(); 9609 this.transitionTo("beforeData" /* beforeData */); 9610 } 9611 else { 9612 this.consume(); 9613 this.delegate.appendToAttributeValue(char); 9614 } 9615 }, 9616 afterAttributeValueQuoted: function () { 9617 var char = this.peek(); 9618 if (isSpace(char)) { 9619 this.consume(); 9620 this.transitionTo("beforeAttributeName" /* beforeAttributeName */); 9621 } 9622 else if (char === '/') { 9623 this.consume(); 9624 this.transitionTo("selfClosingStartTag" /* selfClosingStartTag */); 9625 } 9626 else if (char === '>') { 9627 this.consume(); 9628 this.delegate.finishTag(); 9629 this.transitionTo("beforeData" /* beforeData */); 9630 } 9631 else { 9632 this.transitionTo("beforeAttributeName" /* beforeAttributeName */); 9633 } 9634 }, 9635 selfClosingStartTag: function () { 9636 var char = this.peek(); 9637 if (char === '>') { 9638 this.consume(); 9639 this.delegate.markTagAsSelfClosing(); 9640 this.delegate.finishTag(); 9641 this.transitionTo("beforeData" /* beforeData */); 9642 } 9643 else { 9644 this.transitionTo("beforeAttributeName" /* beforeAttributeName */); 9645 } 9646 }, 9647 endTagOpen: function () { 9648 var char = this.consume(); 9649 if (char === '@' || char === ':' || isAlpha(char)) { 9650 this.transitionTo("endTagName" /* endTagName */); 9651 this.tagNameBuffer = ''; 9652 this.delegate.beginEndTag(); 9653 this.appendToTagName(char); 9654 } 9655 } 9656 }; 9657 this.reset(); 9658 } 9659 EventedTokenizer.prototype.reset = function () { 9660 this.transitionTo("beforeData" /* beforeData */); 9661 this.input = ''; 9662 this.tagNameBuffer = ''; 9663 this.index = 0; 9664 this.line = 1; 9665 this.column = 0; 9666 this.delegate.reset(); 9667 }; 9668 EventedTokenizer.prototype.transitionTo = function (state) { 9669 this.state = state; 9670 }; 9671 EventedTokenizer.prototype.tokenize = function (input) { 9672 this.reset(); 9673 this.tokenizePart(input); 9674 this.tokenizeEOF(); 9675 }; 9676 EventedTokenizer.prototype.tokenizePart = function (input) { 9677 this.input += preprocessInput(input); 9678 while (this.index < this.input.length) { 9679 var handler = this.states[this.state]; 9680 if (handler !== undefined) { 9681 handler.call(this); 9682 } 9683 else { 9684 throw new Error("unhandled state " + this.state); 9685 } 9686 } 9687 }; 9688 EventedTokenizer.prototype.tokenizeEOF = function () { 9689 this.flushData(); 9690 }; 9691 EventedTokenizer.prototype.flushData = function () { 9692 if (this.state === 'data') { 9693 this.delegate.finishData(); 9694 this.transitionTo("beforeData" /* beforeData */); 9695 } 9696 }; 9697 EventedTokenizer.prototype.peek = function () { 9698 return this.input.charAt(this.index); 9699 }; 9700 EventedTokenizer.prototype.consume = function () { 9701 var char = this.peek(); 9702 this.index++; 9703 if (char === '\n') { 9704 this.line++; 9705 this.column = 0; 9706 } 9707 else { 9708 this.column++; 9709 } 9710 return char; 9711 }; 9712 EventedTokenizer.prototype.consumeCharRef = function () { 9713 var endIndex = this.input.indexOf(';', this.index); 9714 if (endIndex === -1) { 9715 return; 9716 } 9717 var entity = this.input.slice(this.index, endIndex); 9718 var chars = this.entityParser.parse(entity); 9719 if (chars) { 9720 var count = entity.length; 9721 // consume the entity chars 9722 while (count) { 9723 this.consume(); 9724 count--; 9725 } 9726 // consume the `;` 9727 this.consume(); 9728 return chars; 9729 } 9730 }; 9731 EventedTokenizer.prototype.markTagStart = function () { 9732 this.delegate.tagOpen(); 9733 }; 9734 EventedTokenizer.prototype.appendToTagName = function (char) { 9735 this.tagNameBuffer += char; 9736 this.delegate.appendToTagName(char); 9737 }; 9738 EventedTokenizer.prototype.isIgnoredEndTag = function () { 9739 var tag = this.tagNameBuffer; 9740 return (tag === 'title' && this.input.substring(this.index, this.index + 8) !== '</title>') || 9741 (tag === 'style' && this.input.substring(this.index, this.index + 8) !== '</style>') || 9742 (tag === 'script' && this.input.substring(this.index, this.index + 9) !== '</script>'); 9743 }; 9744 return EventedTokenizer; 9745 }()); 9746 9747 var Tokenizer = /** @class */ (function () { 9748 function Tokenizer(entityParser, options) { 9749 if (options === void 0) { options = {}; } 9750 this.options = options; 9751 this.token = null; 9752 this.startLine = 1; 9753 this.startColumn = 0; 9754 this.tokens = []; 9755 this.tokenizer = new EventedTokenizer(this, entityParser, options.mode); 9756 this._currentAttribute = undefined; 9757 } 9758 Tokenizer.prototype.tokenize = function (input) { 9759 this.tokens = []; 9760 this.tokenizer.tokenize(input); 9761 return this.tokens; 9762 }; 9763 Tokenizer.prototype.tokenizePart = function (input) { 9764 this.tokens = []; 9765 this.tokenizer.tokenizePart(input); 9766 return this.tokens; 9767 }; 9768 Tokenizer.prototype.tokenizeEOF = function () { 9769 this.tokens = []; 9770 this.tokenizer.tokenizeEOF(); 9771 return this.tokens[0]; 9772 }; 9773 Tokenizer.prototype.reset = function () { 9774 this.token = null; 9775 this.startLine = 1; 9776 this.startColumn = 0; 9777 }; 9778 Tokenizer.prototype.current = function () { 9779 var token = this.token; 9780 if (token === null) { 9781 throw new Error('token was unexpectedly null'); 9782 } 9783 if (arguments.length === 0) { 9784 return token; 9785 } 9786 for (var i = 0; i < arguments.length; i++) { 9787 if (token.type === arguments[i]) { 9788 return token; 9789 } 9790 } 9791 throw new Error("token type was unexpectedly " + token.type); 9792 }; 9793 Tokenizer.prototype.push = function (token) { 9794 this.token = token; 9795 this.tokens.push(token); 9796 }; 9797 Tokenizer.prototype.currentAttribute = function () { 9798 return this._currentAttribute; 9799 }; 9800 Tokenizer.prototype.addLocInfo = function () { 9801 if (this.options.loc) { 9802 this.current().loc = { 9803 start: { 9804 line: this.startLine, 9805 column: this.startColumn 9806 }, 9807 end: { 9808 line: this.tokenizer.line, 9809 column: this.tokenizer.column 9810 } 9811 }; 9812 } 9813 this.startLine = this.tokenizer.line; 9814 this.startColumn = this.tokenizer.column; 9815 }; 9816 // Data 9817 Tokenizer.prototype.beginDoctype = function () { 9818 this.push({ 9819 type: "Doctype" /* Doctype */, 9820 name: '', 9821 }); 9822 }; 9823 Tokenizer.prototype.appendToDoctypeName = function (char) { 9824 this.current("Doctype" /* Doctype */).name += char; 9825 }; 9826 Tokenizer.prototype.appendToDoctypePublicIdentifier = function (char) { 9827 var doctype = this.current("Doctype" /* Doctype */); 9828 if (doctype.publicIdentifier === undefined) { 9829 doctype.publicIdentifier = char; 9830 } 9831 else { 9832 doctype.publicIdentifier += char; 9833 } 9834 }; 9835 Tokenizer.prototype.appendToDoctypeSystemIdentifier = function (char) { 9836 var doctype = this.current("Doctype" /* Doctype */); 9837 if (doctype.systemIdentifier === undefined) { 9838 doctype.systemIdentifier = char; 9839 } 9840 else { 9841 doctype.systemIdentifier += char; 9842 } 9843 }; 9844 Tokenizer.prototype.endDoctype = function () { 9845 this.addLocInfo(); 9846 }; 9847 Tokenizer.prototype.beginData = function () { 9848 this.push({ 9849 type: "Chars" /* Chars */, 9850 chars: '' 9851 }); 9852 }; 9853 Tokenizer.prototype.appendToData = function (char) { 9854 this.current("Chars" /* Chars */).chars += char; 9855 }; 9856 Tokenizer.prototype.finishData = function () { 9857 this.addLocInfo(); 9858 }; 9859 // Comment 9860 Tokenizer.prototype.beginComment = function () { 9861 this.push({ 9862 type: "Comment" /* Comment */, 9863 chars: '' 9864 }); 9865 }; 9866 Tokenizer.prototype.appendToCommentData = function (char) { 9867 this.current("Comment" /* Comment */).chars += char; 9868 }; 9869 Tokenizer.prototype.finishComment = function () { 9870 this.addLocInfo(); 9871 }; 9872 // Tags - basic 9873 Tokenizer.prototype.tagOpen = function () { }; 9874 Tokenizer.prototype.beginStartTag = function () { 9875 this.push({ 9876 type: "StartTag" /* StartTag */, 9877 tagName: '', 9878 attributes: [], 9879 selfClosing: false 9880 }); 9881 }; 9882 Tokenizer.prototype.beginEndTag = function () { 9883 this.push({ 9884 type: "EndTag" /* EndTag */, 9885 tagName: '' 9886 }); 9887 }; 9888 Tokenizer.prototype.finishTag = function () { 9889 this.addLocInfo(); 9890 }; 9891 Tokenizer.prototype.markTagAsSelfClosing = function () { 9892 this.current("StartTag" /* StartTag */).selfClosing = true; 9893 }; 9894 // Tags - name 9895 Tokenizer.prototype.appendToTagName = function (char) { 9896 this.current("StartTag" /* StartTag */, "EndTag" /* EndTag */).tagName += char; 9897 }; 9898 // Tags - attributes 9899 Tokenizer.prototype.beginAttribute = function () { 9900 this._currentAttribute = ['', '', false]; 9901 }; 9902 Tokenizer.prototype.appendToAttributeName = function (char) { 9903 this.currentAttribute()[0] += char; 9904 }; 9905 Tokenizer.prototype.beginAttributeValue = function (isQuoted) { 9906 this.currentAttribute()[2] = isQuoted; 9907 }; 9908 Tokenizer.prototype.appendToAttributeValue = function (char) { 9909 this.currentAttribute()[1] += char; 9910 }; 9911 Tokenizer.prototype.finishAttributeValue = function () { 9912 this.current("StartTag" /* StartTag */).attributes.push(this._currentAttribute); 9913 }; 9914 Tokenizer.prototype.reportSyntaxError = function (message) { 9915 this.current().syntaxError = message; 9916 }; 9917 return Tokenizer; 9918 }()); 9919 9920 function tokenize(input, options) { 9921 var tokenizer = new Tokenizer(new EntityParser(namedCharRefs), options); 9922 return tokenizer.tokenize(input); 9923 } 9924 9925 9926 9927 // EXTERNAL MODULE: ./node_modules/fast-deep-equal/es6/index.js 9928 var es6 = __webpack_require__(7734); 9929 var es6_default = /*#__PURE__*/__webpack_require__.n(es6); 9930 ;// external ["wp","htmlEntities"] 9931 const external_wp_htmlEntities_namespaceObject = window["wp"]["htmlEntities"]; 9932 ;// ./node_modules/@wordpress/blocks/build-module/api/validation/logger.js 9933 function createLogger() { 9934 function createLogHandler(logger) { 9935 let log = (message, ...args) => logger("Block validation: " + message, ...args); 9936 if (false) {} 9937 return log; 9938 } 9939 return { 9940 // eslint-disable-next-line no-console 9941 error: createLogHandler(console.error), 9942 // eslint-disable-next-line no-console 9943 warning: createLogHandler(console.warn), 9944 getItems() { 9945 return []; 9946 } 9947 }; 9948 } 9949 function createQueuedLogger() { 9950 const queue = []; 9951 const logger = createLogger(); 9952 return { 9953 error(...args) { 9954 queue.push({ log: logger.error, args }); 9955 }, 9956 warning(...args) { 9957 queue.push({ log: logger.warning, args }); 9958 }, 9959 getItems() { 9960 return queue; 9961 } 9962 }; 9963 } 9964 9965 9966 ;// ./node_modules/@wordpress/blocks/build-module/api/validation/index.js 9967 9968 9969 9970 9971 9972 9973 9974 9975 const identity = (x) => x; 9976 const REGEXP_WHITESPACE = /[\t\n\r\v\f ]+/g; 9977 const REGEXP_ONLY_WHITESPACE = /^[\t\n\r\v\f ]*$/; 9978 const REGEXP_STYLE_URL_TYPE = /^url\s*\(['"\s]*(.*?)['"\s]*\)$/; 9979 const BOOLEAN_ATTRIBUTES = [ 9980 "allowfullscreen", 9981 "allowpaymentrequest", 9982 "allowusermedia", 9983 "async", 9984 "autofocus", 9985 "autoplay", 9986 "checked", 9987 "controls", 9988 "default", 9989 "defer", 9990 "disabled", 9991 "download", 9992 "formnovalidate", 9993 "hidden", 9994 "ismap", 9995 "itemscope", 9996 "loop", 9997 "multiple", 9998 "muted", 9999 "nomodule", 10000 "novalidate", 10001 "open", 10002 "playsinline", 10003 "readonly", 10004 "required", 10005 "reversed", 10006 "selected", 10007 "typemustmatch" 10008 ]; 10009 const ENUMERATED_ATTRIBUTES = [ 10010 "autocapitalize", 10011 "autocomplete", 10012 "charset", 10013 "contenteditable", 10014 "crossorigin", 10015 "decoding", 10016 "dir", 10017 "draggable", 10018 "enctype", 10019 "formenctype", 10020 "formmethod", 10021 "http-equiv", 10022 "inputmode", 10023 "kind", 10024 "method", 10025 "preload", 10026 "scope", 10027 "shape", 10028 "spellcheck", 10029 "translate", 10030 "type", 10031 "wrap" 10032 ]; 10033 const MEANINGFUL_ATTRIBUTES = [ 10034 ...BOOLEAN_ATTRIBUTES, 10035 ...ENUMERATED_ATTRIBUTES 10036 ]; 10037 const TEXT_NORMALIZATIONS = [identity, getTextWithCollapsedWhitespace]; 10038 const REGEXP_NAMED_CHARACTER_REFERENCE = /^[\da-z]+$/i; 10039 const REGEXP_DECIMAL_CHARACTER_REFERENCE = /^#\d+$/; 10040 const REGEXP_HEXADECIMAL_CHARACTER_REFERENCE = /^#x[\da-f]+$/i; 10041 function isValidCharacterReference(text) { 10042 return REGEXP_NAMED_CHARACTER_REFERENCE.test(text) || REGEXP_DECIMAL_CHARACTER_REFERENCE.test(text) || REGEXP_HEXADECIMAL_CHARACTER_REFERENCE.test(text); 10043 } 10044 class DecodeEntityParser { 10045 /** 10046 * Returns a substitute string for an entity string sequence between `&` 10047 * and `;`, or undefined if no substitution should occur. 10048 * 10049 * @param {string} entity Entity fragment discovered in HTML. 10050 * 10051 * @return {string | undefined} Entity substitute value. 10052 */ 10053 parse(entity) { 10054 if (isValidCharacterReference(entity)) { 10055 return (0,external_wp_htmlEntities_namespaceObject.decodeEntities)("&" + entity + ";"); 10056 } 10057 } 10058 } 10059 function getTextPiecesSplitOnWhitespace(text) { 10060 return text.trim().split(REGEXP_WHITESPACE); 10061 } 10062 function getTextWithCollapsedWhitespace(text) { 10063 return getTextPiecesSplitOnWhitespace(text).join(" "); 10064 } 10065 function getMeaningfulAttributePairs(token) { 10066 return token.attributes.filter((pair) => { 10067 const [key, value] = pair; 10068 return value || key.indexOf("data-") === 0 || MEANINGFUL_ATTRIBUTES.includes(key); 10069 }); 10070 } 10071 function isEquivalentTextTokens(actual, expected, logger = createLogger()) { 10072 let actualChars = actual.chars; 10073 let expectedChars = expected.chars; 10074 for (let i = 0; i < TEXT_NORMALIZATIONS.length; i++) { 10075 const normalize = TEXT_NORMALIZATIONS[i]; 10076 actualChars = normalize(actualChars); 10077 expectedChars = normalize(expectedChars); 10078 if (actualChars === expectedChars) { 10079 return true; 10080 } 10081 } 10082 logger.warning( 10083 "Expected text `%s`, saw `%s`.", 10084 expected.chars, 10085 actual.chars 10086 ); 10087 return false; 10088 } 10089 function getNormalizedLength(value) { 10090 if (0 === parseFloat(value)) { 10091 return "0"; 10092 } 10093 if (value.indexOf(".") === 0) { 10094 return "0" + value; 10095 } 10096 return value; 10097 } 10098 function getNormalizedStyleValue(value) { 10099 const textPieces = getTextPiecesSplitOnWhitespace(value); 10100 const normalizedPieces = textPieces.map(getNormalizedLength); 10101 const result = normalizedPieces.join(" "); 10102 return result.replace(REGEXP_STYLE_URL_TYPE, "url($1)"); 10103 } 10104 function getStyleProperties(text) { 10105 const pairs = text.replace(/;?\s*$/, "").split(";").map((style) => { 10106 const [key, ...valueParts] = style.split(":"); 10107 const value = valueParts.join(":"); 10108 return [key.trim(), getNormalizedStyleValue(value.trim())]; 10109 }); 10110 return Object.fromEntries(pairs); 10111 } 10112 const isEqualAttributesOfName = { 10113 class: (actual, expected) => { 10114 const [actualPieces, expectedPieces] = [actual, expected].map( 10115 getTextPiecesSplitOnWhitespace 10116 ); 10117 const actualDiff = actualPieces.filter( 10118 (c) => !expectedPieces.includes(c) 10119 ); 10120 const expectedDiff = expectedPieces.filter( 10121 (c) => !actualPieces.includes(c) 10122 ); 10123 return actualDiff.length === 0 && expectedDiff.length === 0; 10124 }, 10125 style: (actual, expected) => { 10126 return es6_default()( 10127 ...[actual, expected].map(getStyleProperties) 10128 ); 10129 }, 10130 // For each boolean attribute, mere presence of attribute in both is enough 10131 // to assume equivalence. 10132 ...Object.fromEntries( 10133 BOOLEAN_ATTRIBUTES.map((attribute) => [attribute, () => true]) 10134 ) 10135 }; 10136 function isEqualTagAttributePairs(actual, expected, logger = createLogger()) { 10137 if (actual.length !== expected.length) { 10138 logger.warning( 10139 "Expected attributes %o, instead saw %o.", 10140 expected, 10141 actual 10142 ); 10143 return false; 10144 } 10145 const expectedAttributes = {}; 10146 for (let i = 0; i < expected.length; i++) { 10147 expectedAttributes[expected[i][0].toLowerCase()] = expected[i][1]; 10148 } 10149 for (let i = 0; i < actual.length; i++) { 10150 const [name, actualValue] = actual[i]; 10151 const nameLower = name.toLowerCase(); 10152 if (!expectedAttributes.hasOwnProperty(nameLower)) { 10153 logger.warning("Encountered unexpected attribute `%s`.", name); 10154 return false; 10155 } 10156 const expectedValue = expectedAttributes[nameLower]; 10157 const isEqualAttributes = isEqualAttributesOfName[nameLower]; 10158 if (isEqualAttributes) { 10159 if (!isEqualAttributes(actualValue, expectedValue)) { 10160 logger.warning( 10161 "Expected attribute `%s` of value `%s`, saw `%s`.", 10162 name, 10163 expectedValue, 10164 actualValue 10165 ); 10166 return false; 10167 } 10168 } else if (actualValue !== expectedValue) { 10169 logger.warning( 10170 "Expected attribute `%s` of value `%s`, saw `%s`.", 10171 name, 10172 expectedValue, 10173 actualValue 10174 ); 10175 return false; 10176 } 10177 } 10178 return true; 10179 } 10180 const isEqualTokensOfType = { 10181 StartTag: (actual, expected, logger = createLogger()) => { 10182 if (actual.tagName !== expected.tagName && // Optimization: Use short-circuit evaluation to defer case- 10183 // insensitive check on the assumption that the majority case will 10184 // have exactly equal tag names. 10185 actual.tagName.toLowerCase() !== expected.tagName.toLowerCase()) { 10186 logger.warning( 10187 "Expected tag name `%s`, instead saw `%s`.", 10188 expected.tagName, 10189 actual.tagName 10190 ); 10191 return false; 10192 } 10193 return isEqualTagAttributePairs( 10194 ...[actual, expected].map(getMeaningfulAttributePairs), 10195 logger 10196 ); 10197 }, 10198 Chars: isEquivalentTextTokens, 10199 Comment: isEquivalentTextTokens 10200 }; 10201 function getNextNonWhitespaceToken(tokens) { 10202 let token; 10203 while (token = tokens.shift()) { 10204 if (token.type !== "Chars") { 10205 return token; 10206 } 10207 if (!REGEXP_ONLY_WHITESPACE.test(token.chars)) { 10208 return token; 10209 } 10210 } 10211 } 10212 function getHTMLTokens(html, logger = createLogger()) { 10213 try { 10214 return new Tokenizer(new DecodeEntityParser()).tokenize(html); 10215 } catch (e) { 10216 logger.warning("Malformed HTML detected: %s", html); 10217 } 10218 return null; 10219 } 10220 function isClosedByToken(currentToken, nextToken) { 10221 if (!currentToken.selfClosing) { 10222 return false; 10223 } 10224 if (nextToken && nextToken.tagName === currentToken.tagName && nextToken.type === "EndTag") { 10225 return true; 10226 } 10227 return false; 10228 } 10229 function isEquivalentHTML(actual, expected, logger = createLogger()) { 10230 if (actual === expected) { 10231 return true; 10232 } 10233 const [actualTokens, expectedTokens] = [actual, expected].map( 10234 (html) => getHTMLTokens(html, logger) 10235 ); 10236 if (!actualTokens || !expectedTokens) { 10237 return false; 10238 } 10239 let actualToken, expectedToken; 10240 while (actualToken = getNextNonWhitespaceToken(actualTokens)) { 10241 expectedToken = getNextNonWhitespaceToken(expectedTokens); 10242 if (!expectedToken) { 10243 logger.warning( 10244 "Expected end of content, instead saw %o.", 10245 actualToken 10246 ); 10247 return false; 10248 } 10249 if (actualToken.type !== expectedToken.type) { 10250 logger.warning( 10251 "Expected token of type `%s` (%o), instead saw `%s` (%o).", 10252 expectedToken.type, 10253 expectedToken, 10254 actualToken.type, 10255 actualToken 10256 ); 10257 return false; 10258 } 10259 const isEqualTokens = isEqualTokensOfType[actualToken.type]; 10260 if (isEqualTokens && !isEqualTokens(actualToken, expectedToken, logger)) { 10261 return false; 10262 } 10263 if (isClosedByToken(actualToken, expectedTokens[0])) { 10264 getNextNonWhitespaceToken(expectedTokens); 10265 } else if (isClosedByToken(expectedToken, actualTokens[0])) { 10266 getNextNonWhitespaceToken(actualTokens); 10267 } 10268 } 10269 if (expectedToken = getNextNonWhitespaceToken(expectedTokens)) { 10270 logger.warning( 10271 "Expected %o, instead saw end of content.", 10272 expectedToken 10273 ); 10274 return false; 10275 } 10276 return true; 10277 } 10278 function validateBlock(block, blockTypeOrName = block.name) { 10279 const isFallbackBlock = block.name === getFreeformContentHandlerName() || block.name === getUnregisteredTypeHandlerName(); 10280 if (isFallbackBlock) { 10281 return [true, []]; 10282 } 10283 const logger = createQueuedLogger(); 10284 const blockType = normalizeBlockType(blockTypeOrName); 10285 let generatedBlockContent; 10286 try { 10287 generatedBlockContent = getSaveContent(blockType, block.attributes); 10288 } catch (error) { 10289 logger.error( 10290 "Block validation failed because an error occurred while generating block content:\n\n%s", 10291 error.toString() 10292 ); 10293 return [false, logger.getItems()]; 10294 } 10295 const isValid = isEquivalentHTML( 10296 block.originalContent, 10297 generatedBlockContent, 10298 logger 10299 ); 10300 if (!isValid) { 10301 logger.error( 10302 "Block validation failed for `%s` (%o).\n\nContent generated by `save` function:\n\n%s\n\nContent retrieved from post body:\n\n%s", 10303 blockType.name, 10304 blockType, 10305 generatedBlockContent, 10306 block.originalContent 10307 ); 10308 } 10309 return [isValid, logger.getItems()]; 10310 } 10311 function isValidBlockContent(blockTypeOrName, attributes, originalBlockContent) { 10312 external_wp_deprecated_default()("isValidBlockContent introduces opportunity for data loss", { 10313 since: "12.6", 10314 plugin: "Gutenberg", 10315 alternative: "validateBlock" 10316 }); 10317 const blockType = normalizeBlockType(blockTypeOrName); 10318 const block = { 10319 name: blockType.name, 10320 attributes, 10321 innerBlocks: [], 10322 originalContent: originalBlockContent 10323 }; 10324 const [isValid] = validateBlock(block, blockType); 10325 return isValid; 10326 } 10327 10328 10329 ;// ./node_modules/@wordpress/blocks/build-module/api/parser/convert-legacy-block.js 10330 function convertLegacyBlockNameAndAttributes(name, attributes) { 10331 const newAttributes = { ...attributes }; 10332 if ("core/cover-image" === name) { 10333 name = "core/cover"; 10334 } 10335 if ("core/text" === name || "core/cover-text" === name) { 10336 name = "core/paragraph"; 10337 } 10338 if (name && name.indexOf("core/social-link-") === 0) { 10339 newAttributes.service = name.substring(17); 10340 name = "core/social-link"; 10341 } 10342 if (name && name.indexOf("core-embed/") === 0) { 10343 const providerSlug = name.substring(11); 10344 const deprecated = { 10345 speaker: "speaker-deck", 10346 polldaddy: "crowdsignal" 10347 }; 10348 newAttributes.providerNameSlug = providerSlug in deprecated ? deprecated[providerSlug] : providerSlug; 10349 if (!["amazon-kindle", "wordpress"].includes(providerSlug)) { 10350 newAttributes.responsive = true; 10351 } 10352 name = "core/embed"; 10353 } 10354 if (name === "core/post-comment-author") { 10355 name = "core/comment-author-name"; 10356 } 10357 if (name === "core/post-comment-content") { 10358 name = "core/comment-content"; 10359 } 10360 if (name === "core/post-comment-date") { 10361 name = "core/comment-date"; 10362 } 10363 if (name === "core/comments-query-loop") { 10364 name = "core/comments"; 10365 const { className = "" } = newAttributes; 10366 if (!className.includes("wp-block-comments-query-loop")) { 10367 newAttributes.className = [ 10368 "wp-block-comments-query-loop", 10369 className 10370 ].join(" "); 10371 } 10372 } 10373 if (name === "core/post-comments") { 10374 name = "core/comments"; 10375 newAttributes.legacy = true; 10376 } 10377 if (attributes.layout?.type === "grid" && typeof attributes.layout?.columnCount === "string") { 10378 newAttributes.layout = { 10379 ...newAttributes.layout, 10380 columnCount: parseInt(attributes.layout.columnCount, 10) 10381 }; 10382 } 10383 if (typeof attributes.style?.layout?.columnSpan === "string") { 10384 const columnSpanNumber = parseInt( 10385 attributes.style.layout.columnSpan, 10386 10 10387 ); 10388 newAttributes.style = { 10389 ...newAttributes.style, 10390 layout: { 10391 ...newAttributes.style.layout, 10392 columnSpan: isNaN(columnSpanNumber) ? void 0 : columnSpanNumber 10393 } 10394 }; 10395 } 10396 if (typeof attributes.style?.layout?.rowSpan === "string") { 10397 const rowSpanNumber = parseInt(attributes.style.layout.rowSpan, 10); 10398 newAttributes.style = { 10399 ...newAttributes.style, 10400 layout: { 10401 ...newAttributes.style.layout, 10402 rowSpan: isNaN(rowSpanNumber) ? void 0 : rowSpanNumber 10403 } 10404 }; 10405 } 10406 return [name, newAttributes]; 10407 } 10408 10409 10410 ;// ./node_modules/hpq/es/get-path.js 10411 /** 10412 * Given object and string of dot-delimited path segments, returns value at 10413 * path or undefined if path cannot be resolved. 10414 * 10415 * @param {Object} object Lookup object 10416 * @param {string} path Path to resolve 10417 * @return {?*} Resolved value 10418 */ 10419 function getPath(object, path) { 10420 var segments = path.split('.'); 10421 var segment; 10422 10423 while (segment = segments.shift()) { 10424 if (!(segment in object)) { 10425 return; 10426 } 10427 10428 object = object[segment]; 10429 } 10430 10431 return object; 10432 } 10433 ;// ./node_modules/hpq/es/index.js 10434 /** 10435 * Internal dependencies 10436 */ 10437 10438 /** 10439 * Function returning a DOM document created by `createHTMLDocument`. The same 10440 * document is returned between invocations. 10441 * 10442 * @return {Document} DOM document. 10443 */ 10444 10445 var getDocument = function () { 10446 var doc; 10447 return function () { 10448 if (!doc) { 10449 doc = document.implementation.createHTMLDocument(''); 10450 } 10451 10452 return doc; 10453 }; 10454 }(); 10455 /** 10456 * Given a markup string or DOM element, creates an object aligning with the 10457 * shape of the matchers object, or the value returned by the matcher. 10458 * 10459 * @param {(string|Element)} source Source content 10460 * @param {(Object|Function)} matchers Matcher function or object of matchers 10461 * @return {(Object|*)} Matched value(s), shaped by object 10462 */ 10463 10464 10465 function parse(source, matchers) { 10466 if (!matchers) { 10467 return; 10468 } // Coerce to element 10469 10470 10471 if ('string' === typeof source) { 10472 var doc = getDocument(); 10473 doc.body.innerHTML = source; 10474 source = doc.body; 10475 } // Return singular value 10476 10477 10478 if ('function' === typeof matchers) { 10479 return matchers(source); 10480 } // Bail if we can't handle matchers 10481 10482 10483 if (Object !== matchers.constructor) { 10484 return; 10485 } // Shape result by matcher object 10486 10487 10488 return Object.keys(matchers).reduce(function (memo, key) { 10489 memo[key] = parse(source, matchers[key]); 10490 return memo; 10491 }, {}); 10492 } 10493 /** 10494 * Generates a function which matches node of type selector, returning an 10495 * attribute by property if the attribute exists. If no selector is passed, 10496 * returns property of the query element. 10497 * 10498 * @param {?string} selector Optional selector 10499 * @param {string} name Property name 10500 * @return {*} Property value 10501 */ 10502 10503 function prop(selector, name) { 10504 if (1 === arguments.length) { 10505 name = selector; 10506 selector = undefined; 10507 } 10508 10509 return function (node) { 10510 var match = node; 10511 10512 if (selector) { 10513 match = node.querySelector(selector); 10514 } 10515 10516 if (match) { 10517 return getPath(match, name); 10518 } 10519 }; 10520 } 10521 /** 10522 * Generates a function which matches node of type selector, returning an 10523 * attribute by name if the attribute exists. If no selector is passed, 10524 * returns attribute of the query element. 10525 * 10526 * @param {?string} selector Optional selector 10527 * @param {string} name Attribute name 10528 * @return {?string} Attribute value 10529 */ 10530 10531 function attr(selector, name) { 10532 if (1 === arguments.length) { 10533 name = selector; 10534 selector = undefined; 10535 } 10536 10537 return function (node) { 10538 var attributes = prop(selector, 'attributes')(node); 10539 10540 if (attributes && attributes.hasOwnProperty(name)) { 10541 return attributes[name].value; 10542 } 10543 }; 10544 } 10545 /** 10546 * Convenience for `prop( selector, 'innerHTML' )`. 10547 * 10548 * @see prop() 10549 * 10550 * @param {?string} selector Optional selector 10551 * @return {string} Inner HTML 10552 */ 10553 10554 function html(selector) { 10555 return prop(selector, 'innerHTML'); 10556 } 10557 /** 10558 * Convenience for `prop( selector, 'textContent' )`. 10559 * 10560 * @see prop() 10561 * 10562 * @param {?string} selector Optional selector 10563 * @return {string} Text content 10564 */ 10565 10566 function es_text(selector) { 10567 return prop(selector, 'textContent'); 10568 } 10569 /** 10570 * Creates a new matching context by first finding elements matching selector 10571 * using querySelectorAll before then running another `parse` on `matchers` 10572 * scoped to the matched elements. 10573 * 10574 * @see parse() 10575 * 10576 * @param {string} selector Selector to match 10577 * @param {(Object|Function)} matchers Matcher function or object of matchers 10578 * @return {Array.<*,Object>} Array of matched value(s) 10579 */ 10580 10581 function query(selector, matchers) { 10582 return function (node) { 10583 var matches = node.querySelectorAll(selector); 10584 return [].map.call(matches, function (match) { 10585 return parse(match, matchers); 10586 }); 10587 }; 10588 } 10589 ;// ./node_modules/memize/dist/index.js 10590 /** 10591 * Memize options object. 10592 * 10593 * @typedef MemizeOptions 10594 * 10595 * @property {number} [maxSize] Maximum size of the cache. 10596 */ 10597 10598 /** 10599 * Internal cache entry. 10600 * 10601 * @typedef MemizeCacheNode 10602 * 10603 * @property {?MemizeCacheNode|undefined} [prev] Previous node. 10604 * @property {?MemizeCacheNode|undefined} [next] Next node. 10605 * @property {Array<*>} args Function arguments for cache 10606 * entry. 10607 * @property {*} val Function result. 10608 */ 10609 10610 /** 10611 * Properties of the enhanced function for controlling cache. 10612 * 10613 * @typedef MemizeMemoizedFunction 10614 * 10615 * @property {()=>void} clear Clear the cache. 10616 */ 10617 10618 /** 10619 * Accepts a function to be memoized, and returns a new memoized function, with 10620 * optional options. 10621 * 10622 * @template {(...args: any[]) => any} F 10623 * 10624 * @param {F} fn Function to memoize. 10625 * @param {MemizeOptions} [options] Options object. 10626 * 10627 * @return {((...args: Parameters<F>) => ReturnType<F>) & MemizeMemoizedFunction} Memoized function. 10628 */ 10629 function memize(fn, options) { 10630 var size = 0; 10631 10632 /** @type {?MemizeCacheNode|undefined} */ 10633 var head; 10634 10635 /** @type {?MemizeCacheNode|undefined} */ 10636 var tail; 10637 10638 options = options || {}; 10639 10640 function memoized(/* ...args */) { 10641 var node = head, 10642 len = arguments.length, 10643 args, 10644 i; 10645 10646 searchCache: while (node) { 10647 // Perform a shallow equality test to confirm that whether the node 10648 // under test is a candidate for the arguments passed. Two arrays 10649 // are shallowly equal if their length matches and each entry is 10650 // strictly equal between the two sets. Avoid abstracting to a 10651 // function which could incur an arguments leaking deoptimization. 10652 10653 // Check whether node arguments match arguments length 10654 if (node.args.length !== arguments.length) { 10655 node = node.next; 10656 continue; 10657 } 10658 10659 // Check whether node arguments match arguments values 10660 for (i = 0; i < len; i++) { 10661 if (node.args[i] !== arguments[i]) { 10662 node = node.next; 10663 continue searchCache; 10664 } 10665 } 10666 10667 // At this point we can assume we've found a match 10668 10669 // Surface matched node to head if not already 10670 if (node !== head) { 10671 // As tail, shift to previous. Must only shift if not also 10672 // head, since if both head and tail, there is no previous. 10673 if (node === tail) { 10674 tail = node.prev; 10675 } 10676 10677 // Adjust siblings to point to each other. If node was tail, 10678 // this also handles new tail's empty `next` assignment. 10679 /** @type {MemizeCacheNode} */ (node.prev).next = node.next; 10680 if (node.next) { 10681 node.next.prev = node.prev; 10682 } 10683 10684 node.next = head; 10685 node.prev = null; 10686 /** @type {MemizeCacheNode} */ (head).prev = node; 10687 head = node; 10688 } 10689 10690 // Return immediately 10691 return node.val; 10692 } 10693 10694 // No cached value found. Continue to insertion phase: 10695 10696 // Create a copy of arguments (avoid leaking deoptimization) 10697 args = new Array(len); 10698 for (i = 0; i < len; i++) { 10699 args[i] = arguments[i]; 10700 } 10701 10702 node = { 10703 args: args, 10704 10705 // Generate the result from original function 10706 val: fn.apply(null, args), 10707 }; 10708 10709 // Don't need to check whether node is already head, since it would 10710 // have been returned above already if it was 10711 10712 // Shift existing head down list 10713 if (head) { 10714 head.prev = node; 10715 node.next = head; 10716 } else { 10717 // If no head, follows that there's no tail (at initial or reset) 10718 tail = node; 10719 } 10720 10721 // Trim tail if we're reached max size and are pending cache insertion 10722 if (size === /** @type {MemizeOptions} */ (options).maxSize) { 10723 tail = /** @type {MemizeCacheNode} */ (tail).prev; 10724 /** @type {MemizeCacheNode} */ (tail).next = null; 10725 } else { 10726 size++; 10727 } 10728 10729 head = node; 10730 10731 return node.val; 10732 } 10733 10734 memoized.clear = function () { 10735 head = null; 10736 tail = null; 10737 size = 0; 10738 }; 10739 10740 // Ignore reason: There's not a clear solution to create an intersection of 10741 // the function with additional properties, where the goal is to retain the 10742 // function signature of the incoming argument and add control properties 10743 // on the return value. 10744 10745 // @ts-ignore 10746 return memoized; 10747 } 10748 10749 10750 10751 ;// ./node_modules/@wordpress/blocks/build-module/api/matchers.js 10752 10753 10754 10755 10756 function matchers_html(selector, multilineTag) { 10757 return (domNode) => { 10758 let match = domNode; 10759 if (selector) { 10760 match = domNode.querySelector(selector); 10761 } 10762 if (!match) { 10763 return ""; 10764 } 10765 if (multilineTag) { 10766 let value = ""; 10767 const length = match.children.length; 10768 for (let index = 0; index < length; index++) { 10769 const child = match.children[index]; 10770 if (child.nodeName.toLowerCase() !== multilineTag) { 10771 continue; 10772 } 10773 value += child.outerHTML; 10774 } 10775 return value; 10776 } 10777 return match.innerHTML; 10778 }; 10779 } 10780 const richText = (selector, preserveWhiteSpace) => (el) => { 10781 const target = selector ? el.querySelector(selector) : el; 10782 return target ? external_wp_richText_namespaceObject.RichTextData.fromHTMLElement(target, { preserveWhiteSpace }) : external_wp_richText_namespaceObject.RichTextData.empty(); 10783 }; 10784 10785 10786 ;// ./node_modules/@wordpress/blocks/build-module/api/node.js 10787 10788 10789 function isNodeOfType(node, type) { 10790 external_wp_deprecated_default()("wp.blocks.node.isNodeOfType", { 10791 since: "6.1", 10792 version: "6.3", 10793 link: "https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/" 10794 }); 10795 return node && node.type === type; 10796 } 10797 function getNamedNodeMapAsObject(nodeMap) { 10798 const result = {}; 10799 for (let i = 0; i < nodeMap.length; i++) { 10800 const { name, value } = nodeMap[i]; 10801 result[name] = value; 10802 } 10803 return result; 10804 } 10805 function fromDOM(domNode) { 10806 external_wp_deprecated_default()("wp.blocks.node.fromDOM", { 10807 since: "6.1", 10808 version: "6.3", 10809 alternative: "wp.richText.create", 10810 link: "https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/" 10811 }); 10812 if (domNode.nodeType === domNode.TEXT_NODE) { 10813 return domNode.nodeValue; 10814 } 10815 if (domNode.nodeType !== domNode.ELEMENT_NODE) { 10816 throw new TypeError( 10817 "A block node can only be created from a node of type text or element." 10818 ); 10819 } 10820 return { 10821 type: domNode.nodeName.toLowerCase(), 10822 props: { 10823 ...getNamedNodeMapAsObject(domNode.attributes), 10824 children: children_fromDOM(domNode.childNodes) 10825 } 10826 }; 10827 } 10828 function toHTML(node) { 10829 external_wp_deprecated_default()("wp.blocks.node.toHTML", { 10830 since: "6.1", 10831 version: "6.3", 10832 alternative: "wp.richText.toHTMLString", 10833 link: "https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/" 10834 }); 10835 return children_toHTML([node]); 10836 } 10837 function matcher(selector) { 10838 external_wp_deprecated_default()("wp.blocks.node.matcher", { 10839 since: "6.1", 10840 version: "6.3", 10841 alternative: "html source", 10842 link: "https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/" 10843 }); 10844 return (domNode) => { 10845 let match = domNode; 10846 if (selector) { 10847 match = domNode.querySelector(selector); 10848 } 10849 try { 10850 return fromDOM(match); 10851 } catch (error) { 10852 return null; 10853 } 10854 }; 10855 } 10856 var node_default = { 10857 isNodeOfType, 10858 fromDOM, 10859 toHTML, 10860 matcher 10861 }; 10862 10863 10864 ;// ./node_modules/@wordpress/blocks/build-module/api/children.js 10865 10866 10867 10868 function getSerializeCapableElement(children) { 10869 return children; 10870 } 10871 function getChildrenArray(children) { 10872 external_wp_deprecated_default()("wp.blocks.children.getChildrenArray", { 10873 since: "6.1", 10874 version: "6.3", 10875 link: "https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/" 10876 }); 10877 return children; 10878 } 10879 function concat(...blockNodes) { 10880 external_wp_deprecated_default()("wp.blocks.children.concat", { 10881 since: "6.1", 10882 version: "6.3", 10883 alternative: "wp.richText.concat", 10884 link: "https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/" 10885 }); 10886 const result = []; 10887 for (let i = 0; i < blockNodes.length; i++) { 10888 const blockNode = Array.isArray(blockNodes[i]) ? blockNodes[i] : [blockNodes[i]]; 10889 for (let j = 0; j < blockNode.length; j++) { 10890 const child = blockNode[j]; 10891 const canConcatToPreviousString = typeof child === "string" && typeof result[result.length - 1] === "string"; 10892 if (canConcatToPreviousString) { 10893 result[result.length - 1] += child; 10894 } else { 10895 result.push(child); 10896 } 10897 } 10898 } 10899 return result; 10900 } 10901 function children_fromDOM(domNodes) { 10902 external_wp_deprecated_default()("wp.blocks.children.fromDOM", { 10903 since: "6.1", 10904 version: "6.3", 10905 alternative: "wp.richText.create", 10906 link: "https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/" 10907 }); 10908 const result = []; 10909 for (let i = 0; i < domNodes.length; i++) { 10910 try { 10911 result.push(fromDOM(domNodes[i])); 10912 } catch (error) { 10913 } 10914 } 10915 return result; 10916 } 10917 function children_toHTML(children) { 10918 external_wp_deprecated_default()("wp.blocks.children.toHTML", { 10919 since: "6.1", 10920 version: "6.3", 10921 alternative: "wp.richText.toHTMLString", 10922 link: "https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/" 10923 }); 10924 const element = getSerializeCapableElement(children); 10925 return (0,external_wp_element_namespaceObject.renderToString)(element); 10926 } 10927 function children_matcher(selector) { 10928 external_wp_deprecated_default()("wp.blocks.children.matcher", { 10929 since: "6.1", 10930 version: "6.3", 10931 alternative: "html source", 10932 link: "https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/" 10933 }); 10934 return (domNode) => { 10935 let match = domNode; 10936 if (selector) { 10937 match = domNode.querySelector(selector); 10938 } 10939 if (match) { 10940 return children_fromDOM(match.childNodes); 10941 } 10942 return []; 10943 }; 10944 } 10945 var children_default = { 10946 concat, 10947 getChildrenArray, 10948 fromDOM: children_fromDOM, 10949 toHTML: children_toHTML, 10950 matcher: children_matcher 10951 }; 10952 10953 10954 ;// ./node_modules/@wordpress/blocks/build-module/api/parser/get-block-attributes.js 10955 10956 10957 10958 10959 10960 10961 const toBooleanAttributeMatcher = (matcher) => (value) => matcher(value) !== void 0; 10962 function isOfType(value, type) { 10963 switch (type) { 10964 case "rich-text": 10965 return value instanceof external_wp_richText_namespaceObject.RichTextData; 10966 case "string": 10967 return typeof value === "string"; 10968 case "boolean": 10969 return typeof value === "boolean"; 10970 case "object": 10971 return !!value && value.constructor === Object; 10972 case "null": 10973 return value === null; 10974 case "array": 10975 return Array.isArray(value); 10976 case "integer": 10977 case "number": 10978 return typeof value === "number"; 10979 } 10980 return true; 10981 } 10982 function isOfTypes(value, types) { 10983 return types.some((type) => isOfType(value, type)); 10984 } 10985 function getBlockAttribute(attributeKey, attributeSchema, innerDOM, commentAttributes, innerHTML) { 10986 let value; 10987 switch (attributeSchema.source) { 10988 // An undefined source means that it's an attribute serialized to the 10989 // block's "comment". 10990 case void 0: 10991 value = commentAttributes ? commentAttributes[attributeKey] : void 0; 10992 break; 10993 // raw source means that it's the original raw block content. 10994 case "raw": 10995 value = innerHTML; 10996 break; 10997 case "attribute": 10998 case "property": 10999 case "html": 11000 case "text": 11001 case "rich-text": 11002 case "children": 11003 case "node": 11004 case "query": 11005 case "tag": 11006 value = parseWithAttributeSchema(innerDOM, attributeSchema); 11007 break; 11008 } 11009 if (!isValidByType(value, attributeSchema.type) || !isValidByEnum(value, attributeSchema.enum)) { 11010 value = void 0; 11011 } 11012 if (value === void 0) { 11013 value = getDefault(attributeSchema); 11014 } 11015 return value; 11016 } 11017 function isValidByType(value, type) { 11018 return type === void 0 || isOfTypes(value, Array.isArray(type) ? type : [type]); 11019 } 11020 function isValidByEnum(value, enumSet) { 11021 return !Array.isArray(enumSet) || enumSet.includes(value); 11022 } 11023 const matcherFromSource = memize((sourceConfig) => { 11024 switch (sourceConfig.source) { 11025 case "attribute": { 11026 let matcher = attr(sourceConfig.selector, sourceConfig.attribute); 11027 if (sourceConfig.type === "boolean") { 11028 matcher = toBooleanAttributeMatcher(matcher); 11029 } 11030 return matcher; 11031 } 11032 case "html": 11033 return matchers_html(sourceConfig.selector, sourceConfig.multiline); 11034 case "text": 11035 return es_text(sourceConfig.selector); 11036 case "rich-text": 11037 return richText( 11038 sourceConfig.selector, 11039 sourceConfig.__unstablePreserveWhiteSpace 11040 ); 11041 case "children": 11042 return children_matcher(sourceConfig.selector); 11043 case "node": 11044 return matcher(sourceConfig.selector); 11045 case "query": 11046 const subMatchers = Object.fromEntries( 11047 Object.entries(sourceConfig.query).map( 11048 ([key, subSourceConfig]) => [ 11049 key, 11050 matcherFromSource(subSourceConfig) 11051 ] 11052 ) 11053 ); 11054 return query(sourceConfig.selector, subMatchers); 11055 case "tag": { 11056 const matcher = prop(sourceConfig.selector, "nodeName"); 11057 return (domNode) => matcher(domNode)?.toLowerCase(); 11058 } 11059 default: 11060 console.error(`Unknown source type "${sourceConfig.source}"`); 11061 } 11062 }); 11063 function parseHtml(innerHTML) { 11064 return parse(innerHTML, (h) => h); 11065 } 11066 function parseWithAttributeSchema(innerHTML, attributeSchema) { 11067 return matcherFromSource(attributeSchema)(parseHtml(innerHTML)); 11068 } 11069 function getBlockAttributes(blockTypeOrName, innerHTML, attributes = {}) { 11070 const doc = parseHtml(innerHTML); 11071 const blockType = normalizeBlockType(blockTypeOrName); 11072 const blockAttributes = Object.fromEntries( 11073 Object.entries(blockType.attributes ?? {}).map( 11074 ([key, schema]) => [ 11075 key, 11076 getBlockAttribute(key, schema, doc, attributes, innerHTML) 11077 ] 11078 ) 11079 ); 11080 return (0,external_wp_hooks_namespaceObject.applyFilters)( 11081 "blocks.getBlockAttributes", 11082 blockAttributes, 11083 blockType, 11084 innerHTML, 11085 attributes 11086 ); 11087 } 11088 11089 11090 ;// ./node_modules/@wordpress/blocks/build-module/api/parser/fix-custom-classname.js 11091 11092 11093 11094 const CLASS_ATTR_SCHEMA = { 11095 type: "string", 11096 source: "attribute", 11097 selector: "[data-custom-class-name] > *", 11098 attribute: "class" 11099 }; 11100 function getHTMLRootElementClasses(innerHTML) { 11101 const parsed = parseWithAttributeSchema( 11102 `<div data-custom-class-name>$innerHTML}</div>`, 11103 CLASS_ATTR_SCHEMA 11104 ); 11105 return parsed ? parsed.trim().split(/\s+/) : []; 11106 } 11107 function fixCustomClassname(blockAttributes, blockType, innerHTML) { 11108 if (!hasBlockSupport(blockType, "customClassName", true)) { 11109 return blockAttributes; 11110 } 11111 const modifiedBlockAttributes = { ...blockAttributes }; 11112 const { className: omittedClassName, ...attributesSansClassName } = modifiedBlockAttributes; 11113 const serialized = getSaveContent(blockType, attributesSansClassName); 11114 const defaultClasses = getHTMLRootElementClasses(serialized); 11115 const actualClasses = getHTMLRootElementClasses(innerHTML); 11116 const customClasses = actualClasses.filter( 11117 (className) => !defaultClasses.includes(className) 11118 ); 11119 if (customClasses.length) { 11120 modifiedBlockAttributes.className = customClasses.join(" "); 11121 } else if (serialized) { 11122 delete modifiedBlockAttributes.className; 11123 } 11124 return modifiedBlockAttributes; 11125 } 11126 11127 11128 ;// ./node_modules/@wordpress/blocks/build-module/api/parser/fix-aria-label.js 11129 11130 11131 const ARIA_LABEL_ATTR_SCHEMA = { 11132 type: "string", 11133 source: "attribute", 11134 selector: "[data-aria-label] > *", 11135 attribute: "aria-label" 11136 }; 11137 function getHTMLRootElementAriaLabel(innerHTML) { 11138 const parsed = parseWithAttributeSchema( 11139 `<div data-aria-label>$innerHTML}</div>`, 11140 ARIA_LABEL_ATTR_SCHEMA 11141 ); 11142 return parsed; 11143 } 11144 function fixAriaLabel(blockAttributes, blockType, innerHTML) { 11145 if (!hasBlockSupport(blockType, "ariaLabel", false)) { 11146 return blockAttributes; 11147 } 11148 const modifiedBlockAttributes = { ...blockAttributes }; 11149 const ariaLabel = getHTMLRootElementAriaLabel(innerHTML); 11150 if (ariaLabel) { 11151 modifiedBlockAttributes.ariaLabel = ariaLabel; 11152 } 11153 return modifiedBlockAttributes; 11154 } 11155 11156 11157 ;// ./node_modules/@wordpress/blocks/build-module/api/parser/apply-built-in-validation-fixes.js 11158 11159 11160 function applyBuiltInValidationFixes(block, blockType) { 11161 const { attributes, originalContent } = block; 11162 let updatedBlockAttributes = attributes; 11163 updatedBlockAttributes = fixCustomClassname( 11164 attributes, 11165 blockType, 11166 originalContent 11167 ); 11168 updatedBlockAttributes = fixAriaLabel( 11169 updatedBlockAttributes, 11170 blockType, 11171 originalContent 11172 ); 11173 return { 11174 ...block, 11175 attributes: updatedBlockAttributes 11176 }; 11177 } 11178 11179 11180 ;// ./node_modules/@wordpress/blocks/build-module/api/parser/apply-block-deprecated-versions.js 11181 11182 11183 11184 11185 11186 function stubFalse() { 11187 return false; 11188 } 11189 function applyBlockDeprecatedVersions(block, rawBlock, blockType) { 11190 const parsedAttributes = rawBlock.attrs; 11191 const { deprecated: deprecatedDefinitions } = blockType; 11192 if (!deprecatedDefinitions || !deprecatedDefinitions.length) { 11193 return block; 11194 } 11195 for (let i = 0; i < deprecatedDefinitions.length; i++) { 11196 const { isEligible = stubFalse } = deprecatedDefinitions[i]; 11197 if (block.isValid && !isEligible(parsedAttributes, block.innerBlocks, { 11198 blockNode: rawBlock, 11199 block 11200 })) { 11201 continue; 11202 } 11203 const deprecatedBlockType = Object.assign( 11204 omit(blockType, DEPRECATED_ENTRY_KEYS), 11205 deprecatedDefinitions[i] 11206 ); 11207 let migratedBlock = { 11208 ...block, 11209 attributes: getBlockAttributes( 11210 deprecatedBlockType, 11211 block.originalContent, 11212 parsedAttributes 11213 ) 11214 }; 11215 let [isValid] = validateBlock(migratedBlock, deprecatedBlockType); 11216 if (!isValid) { 11217 migratedBlock = applyBuiltInValidationFixes( 11218 migratedBlock, 11219 deprecatedBlockType 11220 ); 11221 [isValid] = validateBlock(migratedBlock, deprecatedBlockType); 11222 } 11223 if (!isValid) { 11224 continue; 11225 } 11226 let migratedInnerBlocks = migratedBlock.innerBlocks; 11227 let migratedAttributes = migratedBlock.attributes; 11228 const { migrate } = deprecatedBlockType; 11229 if (migrate) { 11230 let migrated = migrate(migratedAttributes, block.innerBlocks); 11231 if (!Array.isArray(migrated)) { 11232 migrated = [migrated]; 11233 } 11234 [ 11235 migratedAttributes = parsedAttributes, 11236 migratedInnerBlocks = block.innerBlocks 11237 ] = migrated; 11238 } 11239 block = { 11240 ...block, 11241 attributes: migratedAttributes, 11242 innerBlocks: migratedInnerBlocks, 11243 isValid: true, 11244 validationIssues: [] 11245 }; 11246 } 11247 return block; 11248 } 11249 11250 11251 ;// ./node_modules/@wordpress/blocks/build-module/api/parser/index.js 11252 11253 11254 11255 11256 11257 11258 11259 11260 11261 11262 11263 function convertLegacyBlocks(rawBlock) { 11264 const [correctName, correctedAttributes] = convertLegacyBlockNameAndAttributes( 11265 rawBlock.blockName, 11266 rawBlock.attrs 11267 ); 11268 return { 11269 ...rawBlock, 11270 blockName: correctName, 11271 attrs: correctedAttributes 11272 }; 11273 } 11274 function normalizeRawBlock(rawBlock, options) { 11275 const fallbackBlockName = getFreeformContentHandlerName(); 11276 const rawBlockName = rawBlock.blockName || getFreeformContentHandlerName(); 11277 const rawAttributes = rawBlock.attrs || {}; 11278 const rawInnerBlocks = rawBlock.innerBlocks || []; 11279 let rawInnerHTML = rawBlock.innerHTML.trim(); 11280 if (rawBlockName === fallbackBlockName && rawBlockName === "core/freeform" && !options?.__unstableSkipAutop) { 11281 rawInnerHTML = (0,external_wp_autop_namespaceObject.autop)(rawInnerHTML).trim(); 11282 } 11283 return { 11284 ...rawBlock, 11285 blockName: rawBlockName, 11286 attrs: rawAttributes, 11287 innerHTML: rawInnerHTML, 11288 innerBlocks: rawInnerBlocks 11289 }; 11290 } 11291 function createMissingBlockType(rawBlock) { 11292 const unregisteredFallbackBlock = getUnregisteredTypeHandlerName() || getFreeformContentHandlerName(); 11293 const originalUndelimitedContent = serializeRawBlock(rawBlock, { 11294 isCommentDelimited: false 11295 }); 11296 const originalContent = serializeRawBlock(rawBlock, { 11297 isCommentDelimited: true 11298 }); 11299 return { 11300 blockName: unregisteredFallbackBlock, 11301 attrs: { 11302 originalName: rawBlock.blockName, 11303 originalContent, 11304 originalUndelimitedContent 11305 }, 11306 innerHTML: rawBlock.blockName ? originalContent : rawBlock.innerHTML, 11307 innerBlocks: rawBlock.innerBlocks, 11308 innerContent: rawBlock.innerContent 11309 }; 11310 } 11311 function applyBlockValidation(unvalidatedBlock, blockType) { 11312 const [isValid] = validateBlock(unvalidatedBlock, blockType); 11313 if (isValid) { 11314 return { ...unvalidatedBlock, isValid, validationIssues: [] }; 11315 } 11316 const fixedBlock = applyBuiltInValidationFixes( 11317 unvalidatedBlock, 11318 blockType 11319 ); 11320 const [isFixedValid, validationIssues] = validateBlock( 11321 fixedBlock, 11322 blockType 11323 ); 11324 return { ...fixedBlock, isValid: isFixedValid, validationIssues }; 11325 } 11326 function parseRawBlock(rawBlock, options) { 11327 let normalizedBlock = normalizeRawBlock(rawBlock, options); 11328 normalizedBlock = convertLegacyBlocks(normalizedBlock); 11329 let blockType = getBlockType(normalizedBlock.blockName); 11330 if (!blockType) { 11331 normalizedBlock = createMissingBlockType(normalizedBlock); 11332 blockType = getBlockType(normalizedBlock.blockName); 11333 } 11334 const isFallbackBlock = normalizedBlock.blockName === getFreeformContentHandlerName() || normalizedBlock.blockName === getUnregisteredTypeHandlerName(); 11335 if (!blockType || !normalizedBlock.innerHTML && isFallbackBlock) { 11336 return; 11337 } 11338 const parsedInnerBlocks = normalizedBlock.innerBlocks.map((innerBlock) => parseRawBlock(innerBlock, options)).filter((innerBlock) => !!innerBlock); 11339 const parsedBlock = createBlock( 11340 normalizedBlock.blockName, 11341 getBlockAttributes( 11342 blockType, 11343 normalizedBlock.innerHTML, 11344 normalizedBlock.attrs 11345 ), 11346 parsedInnerBlocks 11347 ); 11348 parsedBlock.originalContent = normalizedBlock.innerHTML; 11349 const validatedBlock = applyBlockValidation(parsedBlock, blockType); 11350 const { validationIssues } = validatedBlock; 11351 const updatedBlock = applyBlockDeprecatedVersions( 11352 validatedBlock, 11353 normalizedBlock, 11354 blockType 11355 ); 11356 if (!updatedBlock.isValid) { 11357 updatedBlock.__unstableBlockSource = rawBlock; 11358 } 11359 if (!validatedBlock.isValid && updatedBlock.isValid && !options?.__unstableSkipMigrationLogs) { 11360 console.groupCollapsed("Updated Block: %s", blockType.name); 11361 console.info( 11362 "Block successfully updated for `%s` (%o).\n\nNew content generated by `save` function:\n\n%s\n\nContent retrieved from post body:\n\n%s", 11363 blockType.name, 11364 blockType, 11365 getSaveContent(blockType, updatedBlock.attributes), 11366 updatedBlock.originalContent 11367 ); 11368 console.groupEnd(); 11369 } else if (!validatedBlock.isValid && !updatedBlock.isValid) { 11370 validationIssues.forEach(({ log, args }) => log(...args)); 11371 } 11372 return updatedBlock; 11373 } 11374 function parser_parse(content, options) { 11375 return (0,external_wp_blockSerializationDefaultParser_namespaceObject.parse)(content).reduce((accumulator, rawBlock) => { 11376 const block = parseRawBlock(rawBlock, options); 11377 if (block) { 11378 accumulator.push(block); 11379 } 11380 return accumulator; 11381 }, []); 11382 } 11383 11384 11385 ;// ./node_modules/@wordpress/blocks/build-module/api/raw-handling/get-raw-transforms.js 11386 11387 function getRawTransforms() { 11388 return getBlockTransforms("from").filter(({ type }) => type === "raw").map((transform) => { 11389 return transform.isMatch ? transform : { 11390 ...transform, 11391 isMatch: (node) => transform.selector && node.matches(transform.selector) 11392 }; 11393 }); 11394 } 11395 11396 11397 ;// ./node_modules/@wordpress/blocks/build-module/api/raw-handling/html-to-blocks.js 11398 11399 11400 11401 11402 11403 function htmlToBlocks(html, handler) { 11404 const doc = document.implementation.createHTMLDocument(""); 11405 doc.body.innerHTML = html; 11406 return Array.from(doc.body.children).flatMap((node) => { 11407 const rawTransform = findTransform( 11408 getRawTransforms(), 11409 ({ isMatch }) => isMatch(node) 11410 ); 11411 if (!rawTransform) { 11412 if (external_wp_element_namespaceObject.Platform.isNative) { 11413 return parser_parse( 11414 `<!-- wp:html -->$node.outerHTML}<!-- /wp:html -->` 11415 ); 11416 } 11417 return createBlock( 11418 // Should not be hardcoded. 11419 "core/html", 11420 getBlockAttributes("core/html", node.outerHTML) 11421 ); 11422 } 11423 const { transform, blockName } = rawTransform; 11424 if (transform) { 11425 const block = transform(node, handler); 11426 if (node.hasAttribute("class")) { 11427 block.attributes.className = node.getAttribute("class"); 11428 } 11429 return block; 11430 } 11431 return createBlock( 11432 blockName, 11433 getBlockAttributes(blockName, node.outerHTML) 11434 ); 11435 }); 11436 } 11437 11438 11439 ;// ./node_modules/@wordpress/blocks/build-module/api/raw-handling/normalise-blocks.js 11440 11441 function normaliseBlocks(HTML, options = {}) { 11442 const decuDoc = document.implementation.createHTMLDocument(""); 11443 const accuDoc = document.implementation.createHTMLDocument(""); 11444 const decu = decuDoc.body; 11445 const accu = accuDoc.body; 11446 decu.innerHTML = HTML; 11447 while (decu.firstChild) { 11448 const node = decu.firstChild; 11449 if (node.nodeType === node.TEXT_NODE) { 11450 if ((0,external_wp_dom_namespaceObject.isEmpty)(node)) { 11451 decu.removeChild(node); 11452 } else { 11453 if (!accu.lastChild || accu.lastChild.nodeName !== "P") { 11454 accu.appendChild(accuDoc.createElement("P")); 11455 } 11456 accu.lastChild.appendChild(node); 11457 } 11458 } else if (node.nodeType === node.ELEMENT_NODE) { 11459 if (node.nodeName === "BR") { 11460 if (node.nextSibling && node.nextSibling.nodeName === "BR") { 11461 accu.appendChild(accuDoc.createElement("P")); 11462 decu.removeChild(node.nextSibling); 11463 } 11464 if (accu.lastChild && accu.lastChild.nodeName === "P" && accu.lastChild.hasChildNodes()) { 11465 accu.lastChild.appendChild(node); 11466 } else { 11467 decu.removeChild(node); 11468 } 11469 } else if (node.nodeName === "P") { 11470 if ((0,external_wp_dom_namespaceObject.isEmpty)(node) && !options.raw) { 11471 decu.removeChild(node); 11472 } else { 11473 accu.appendChild(node); 11474 } 11475 } else if ((0,external_wp_dom_namespaceObject.isPhrasingContent)(node)) { 11476 if (!accu.lastChild || accu.lastChild.nodeName !== "P") { 11477 accu.appendChild(accuDoc.createElement("P")); 11478 } 11479 accu.lastChild.appendChild(node); 11480 } else { 11481 accu.appendChild(node); 11482 } 11483 } else { 11484 decu.removeChild(node); 11485 } 11486 } 11487 return accu.innerHTML; 11488 } 11489 11490 11491 ;// ./node_modules/@wordpress/blocks/build-module/api/raw-handling/special-comment-converter.js 11492 11493 function specialCommentConverter(node, doc) { 11494 if (node.nodeType !== node.COMMENT_NODE) { 11495 return; 11496 } 11497 if (node.nodeValue !== "nextpage" && node.nodeValue.indexOf("more") !== 0) { 11498 return; 11499 } 11500 const block = special_comment_converter_createBlock(node, doc); 11501 if (!node.parentNode || node.parentNode.nodeName !== "P") { 11502 (0,external_wp_dom_namespaceObject.replace)(node, block); 11503 } else { 11504 const childNodes = Array.from(node.parentNode.childNodes); 11505 const nodeIndex = childNodes.indexOf(node); 11506 const wrapperNode = node.parentNode.parentNode || doc.body; 11507 const paragraphBuilder = (acc, child) => { 11508 if (!acc) { 11509 acc = doc.createElement("p"); 11510 } 11511 acc.appendChild(child); 11512 return acc; 11513 }; 11514 [ 11515 childNodes.slice(0, nodeIndex).reduce(paragraphBuilder, null), 11516 block, 11517 childNodes.slice(nodeIndex + 1).reduce(paragraphBuilder, null) 11518 ].forEach( 11519 (element) => element && wrapperNode.insertBefore(element, node.parentNode) 11520 ); 11521 (0,external_wp_dom_namespaceObject.remove)(node.parentNode); 11522 } 11523 } 11524 function special_comment_converter_createBlock(commentNode, doc) { 11525 if (commentNode.nodeValue === "nextpage") { 11526 return createNextpage(doc); 11527 } 11528 const customText = commentNode.nodeValue.slice(4).trim(); 11529 let sibling = commentNode; 11530 let noTeaser = false; 11531 while (sibling = sibling.nextSibling) { 11532 if (sibling.nodeType === sibling.COMMENT_NODE && sibling.nodeValue === "noteaser") { 11533 noTeaser = true; 11534 (0,external_wp_dom_namespaceObject.remove)(sibling); 11535 break; 11536 } 11537 } 11538 return createMore(customText, noTeaser, doc); 11539 } 11540 function createMore(customText, noTeaser, doc) { 11541 const node = doc.createElement("wp-block"); 11542 node.dataset.block = "core/more"; 11543 if (customText) { 11544 node.dataset.customText = customText; 11545 } 11546 if (noTeaser) { 11547 node.dataset.noTeaser = ""; 11548 } 11549 return node; 11550 } 11551 function createNextpage(doc) { 11552 const node = doc.createElement("wp-block"); 11553 node.dataset.block = "core/nextpage"; 11554 return node; 11555 } 11556 11557 11558 ;// ./node_modules/@wordpress/blocks/build-module/api/raw-handling/list-reducer.js 11559 11560 function isList(node) { 11561 return node.nodeName === "OL" || node.nodeName === "UL"; 11562 } 11563 function shallowTextContent(element) { 11564 return Array.from(element.childNodes).map(({ nodeValue = "" }) => nodeValue).join(""); 11565 } 11566 function listReducer(node) { 11567 if (!isList(node)) { 11568 return; 11569 } 11570 const list = node; 11571 const prevElement = node.previousElementSibling; 11572 if (prevElement && prevElement.nodeName === node.nodeName && list.children.length === 1) { 11573 while (list.firstChild) { 11574 prevElement.appendChild(list.firstChild); 11575 } 11576 list.parentNode.removeChild(list); 11577 } 11578 const parentElement = node.parentNode; 11579 if (parentElement && parentElement.nodeName === "LI" && parentElement.children.length === 1 && !/\S/.test(shallowTextContent(parentElement))) { 11580 const parentListItem = parentElement; 11581 const prevListItem = parentListItem.previousElementSibling; 11582 const parentList = parentListItem.parentNode; 11583 if (prevListItem) { 11584 prevListItem.appendChild(list); 11585 parentList.removeChild(parentListItem); 11586 } 11587 } 11588 if (parentElement && isList(parentElement)) { 11589 const prevListItem = node.previousElementSibling; 11590 if (prevListItem) { 11591 prevListItem.appendChild(node); 11592 } else { 11593 (0,external_wp_dom_namespaceObject.unwrap)(node); 11594 } 11595 } 11596 } 11597 11598 11599 ;// ./node_modules/@wordpress/blocks/build-module/api/raw-handling/blockquote-normaliser.js 11600 11601 function blockquoteNormaliser(options) { 11602 return (node) => { 11603 if (node.nodeName !== "BLOCKQUOTE") { 11604 return; 11605 } 11606 node.innerHTML = normaliseBlocks(node.innerHTML, options); 11607 }; 11608 } 11609 11610 11611 ;// ./node_modules/@wordpress/blocks/build-module/api/raw-handling/figure-content-reducer.js 11612 11613 function isFigureContent(node, schema) { 11614 const tag = node.nodeName.toLowerCase(); 11615 if (tag === "figcaption" || (0,external_wp_dom_namespaceObject.isTextContent)(node)) { 11616 return false; 11617 } 11618 return tag in (schema?.figure?.children ?? {}); 11619 } 11620 function canHaveAnchor(node, schema) { 11621 const tag = node.nodeName.toLowerCase(); 11622 return tag in (schema?.figure?.children?.a?.children ?? {}); 11623 } 11624 function wrapFigureContent(element, beforeElement = element) { 11625 const figure = element.ownerDocument.createElement("figure"); 11626 beforeElement.parentNode.insertBefore(figure, beforeElement); 11627 figure.appendChild(element); 11628 } 11629 function figureContentReducer(node, doc, schema) { 11630 if (!isFigureContent(node, schema)) { 11631 return; 11632 } 11633 let nodeToInsert = node; 11634 const parentNode = node.parentNode; 11635 if (canHaveAnchor(node, schema) && parentNode.nodeName === "A" && parentNode.childNodes.length === 1) { 11636 nodeToInsert = node.parentNode; 11637 } 11638 const wrapper = nodeToInsert.closest("p,div"); 11639 if (wrapper) { 11640 if (!node.classList) { 11641 wrapFigureContent(nodeToInsert, wrapper); 11642 } else if (node.classList.contains("alignright") || node.classList.contains("alignleft") || node.classList.contains("aligncenter") || !wrapper.textContent.trim()) { 11643 wrapFigureContent(nodeToInsert, wrapper); 11644 } 11645 } else { 11646 wrapFigureContent(nodeToInsert); 11647 } 11648 } 11649 11650 11651 ;// external ["wp","shortcode"] 11652 const external_wp_shortcode_namespaceObject = window["wp"]["shortcode"]; 11653 ;// ./node_modules/@wordpress/blocks/build-module/api/raw-handling/shortcode-converter.js 11654 11655 11656 11657 11658 11659 const castArray = (maybeArray) => Array.isArray(maybeArray) ? maybeArray : [maybeArray]; 11660 const beforeLineRegexp = /(\n|<p>)\s*$/; 11661 const afterLineRegexp = /^\s*(\n|<\/p>)/; 11662 function segmentHTMLToShortcodeBlock(HTML, lastIndex = 0, excludedBlockNames = []) { 11663 const transformsFrom = getBlockTransforms("from"); 11664 const transformation = findTransform( 11665 transformsFrom, 11666 (transform) => excludedBlockNames.indexOf(transform.blockName) === -1 && transform.type === "shortcode" && castArray(transform.tag).some( 11667 (tag) => (0,external_wp_shortcode_namespaceObject.regexp)(tag).test(HTML) 11668 ) 11669 ); 11670 if (!transformation) { 11671 return [HTML]; 11672 } 11673 const transformTags = castArray(transformation.tag); 11674 const transformTag = transformTags.find( 11675 (tag) => (0,external_wp_shortcode_namespaceObject.regexp)(tag).test(HTML) 11676 ); 11677 let match; 11678 const previousIndex = lastIndex; 11679 if (match = (0,external_wp_shortcode_namespaceObject.next)(transformTag, HTML, lastIndex)) { 11680 lastIndex = match.index + match.content.length; 11681 const beforeHTML = HTML.substr(0, match.index); 11682 const afterHTML = HTML.substr(lastIndex); 11683 if (!match.shortcode.content?.includes("<") && !(beforeLineRegexp.test(beforeHTML) && afterLineRegexp.test(afterHTML))) { 11684 return segmentHTMLToShortcodeBlock(HTML, lastIndex); 11685 } 11686 if (transformation.isMatch && !transformation.isMatch(match.shortcode.attrs)) { 11687 return segmentHTMLToShortcodeBlock(HTML, previousIndex, [ 11688 ...excludedBlockNames, 11689 transformation.blockName 11690 ]); 11691 } 11692 let blocks = []; 11693 if (typeof transformation.transform === "function") { 11694 blocks = [].concat( 11695 transformation.transform(match.shortcode.attrs, match) 11696 ); 11697 blocks = blocks.map((block) => { 11698 block.originalContent = match.shortcode.content; 11699 return applyBuiltInValidationFixes( 11700 block, 11701 getBlockType(block.name) 11702 ); 11703 }); 11704 } else { 11705 const attributes = Object.fromEntries( 11706 Object.entries(transformation.attributes).filter(([, schema]) => schema.shortcode).map(([key, schema]) => [ 11707 key, 11708 schema.shortcode(match.shortcode.attrs, match) 11709 ]) 11710 ); 11711 const blockType = getBlockType(transformation.blockName); 11712 if (!blockType) { 11713 return [HTML]; 11714 } 11715 const transformationBlockType = { 11716 ...blockType, 11717 attributes: transformation.attributes 11718 }; 11719 let block = createBlock( 11720 transformation.blockName, 11721 getBlockAttributes( 11722 transformationBlockType, 11723 match.shortcode.content, 11724 attributes 11725 ) 11726 ); 11727 block.originalContent = match.shortcode.content; 11728 block = applyBuiltInValidationFixes( 11729 block, 11730 transformationBlockType 11731 ); 11732 blocks = [block]; 11733 } 11734 return [ 11735 ...segmentHTMLToShortcodeBlock( 11736 beforeHTML.replace(beforeLineRegexp, "") 11737 ), 11738 ...blocks, 11739 ...segmentHTMLToShortcodeBlock( 11740 afterHTML.replace(afterLineRegexp, "") 11741 ) 11742 ]; 11743 } 11744 return [HTML]; 11745 } 11746 var shortcode_converter_default = segmentHTMLToShortcodeBlock; 11747 11748 11749 ;// ./node_modules/@wordpress/blocks/build-module/api/raw-handling/utils.js 11750 11751 11752 11753 function getBlockContentSchemaFromTransforms(transforms, context) { 11754 const phrasingContentSchema = (0,external_wp_dom_namespaceObject.getPhrasingContentSchema)(context); 11755 const schemaArgs = { phrasingContentSchema, isPaste: context === "paste" }; 11756 const schemas = transforms.map(({ isMatch, blockName, schema }) => { 11757 const hasAnchorSupport = hasBlockSupport(blockName, "anchor"); 11758 schema = typeof schema === "function" ? schema(schemaArgs) : schema; 11759 if (!hasAnchorSupport && !isMatch) { 11760 return schema; 11761 } 11762 if (!schema) { 11763 return {}; 11764 } 11765 return Object.fromEntries( 11766 Object.entries(schema).map(([key, value]) => { 11767 let attributes = value.attributes || []; 11768 if (hasAnchorSupport) { 11769 attributes = [...attributes, "id"]; 11770 } 11771 return [ 11772 key, 11773 { 11774 ...value, 11775 attributes, 11776 isMatch: isMatch ? isMatch : void 0 11777 } 11778 ]; 11779 }) 11780 ); 11781 }); 11782 function mergeTagNameSchemaProperties(objValue, srcValue, key) { 11783 switch (key) { 11784 case "children": { 11785 if (objValue === "*" || srcValue === "*") { 11786 return "*"; 11787 } 11788 return { ...objValue, ...srcValue }; 11789 } 11790 case "attributes": 11791 case "require": { 11792 return [...objValue || [], ...srcValue || []]; 11793 } 11794 case "isMatch": { 11795 if (!objValue || !srcValue) { 11796 return void 0; 11797 } 11798 return (...args) => { 11799 return objValue(...args) || srcValue(...args); 11800 }; 11801 } 11802 } 11803 } 11804 function mergeTagNameSchemas(a, b) { 11805 for (const key in b) { 11806 a[key] = a[key] ? mergeTagNameSchemaProperties(a[key], b[key], key) : { ...b[key] }; 11807 } 11808 return a; 11809 } 11810 function mergeSchemas(a, b) { 11811 for (const key in b) { 11812 a[key] = a[key] ? mergeTagNameSchemas(a[key], b[key]) : { ...b[key] }; 11813 } 11814 return a; 11815 } 11816 return schemas.reduce(mergeSchemas, {}); 11817 } 11818 function getBlockContentSchema(context) { 11819 return getBlockContentSchemaFromTransforms(getRawTransforms(), context); 11820 } 11821 function isPlain(HTML) { 11822 return !/<(?!br[ />])/i.test(HTML); 11823 } 11824 function deepFilterNodeList(nodeList, filters, doc, schema) { 11825 Array.from(nodeList).forEach((node) => { 11826 deepFilterNodeList(node.childNodes, filters, doc, schema); 11827 filters.forEach((item) => { 11828 if (!doc.contains(node)) { 11829 return; 11830 } 11831 item(node, doc, schema); 11832 }); 11833 }); 11834 } 11835 function deepFilterHTML(HTML, filters = [], schema) { 11836 const doc = document.implementation.createHTMLDocument(""); 11837 doc.body.innerHTML = HTML; 11838 deepFilterNodeList(doc.body.childNodes, filters, doc, schema); 11839 return doc.body.innerHTML; 11840 } 11841 function getSibling(node, which) { 11842 const sibling = node[`$which}Sibling`]; 11843 if (sibling && (0,external_wp_dom_namespaceObject.isPhrasingContent)(sibling)) { 11844 return sibling; 11845 } 11846 const { parentNode } = node; 11847 if (!parentNode || !(0,external_wp_dom_namespaceObject.isPhrasingContent)(parentNode)) { 11848 return; 11849 } 11850 return getSibling(parentNode, which); 11851 } 11852 11853 11854 ;// ./node_modules/@wordpress/blocks/build-module/api/raw-handling/index.js 11855 11856 11857 11858 11859 11860 11861 11862 11863 11864 11865 11866 11867 function deprecatedGetPhrasingContentSchema(context) { 11868 external_wp_deprecated_default()("wp.blocks.getPhrasingContentSchema", { 11869 since: "5.6", 11870 alternative: "wp.dom.getPhrasingContentSchema" 11871 }); 11872 return (0,external_wp_dom_namespaceObject.getPhrasingContentSchema)(context); 11873 } 11874 function rawHandler({ HTML = "" }) { 11875 if (HTML.indexOf("<!-- wp:") !== -1) { 11876 const parseResult = parser_parse(HTML); 11877 const isSingleFreeFormBlock = parseResult.length === 1 && parseResult[0].name === "core/freeform"; 11878 if (!isSingleFreeFormBlock) { 11879 return parseResult; 11880 } 11881 } 11882 const pieces = shortcode_converter_default(HTML); 11883 const blockContentSchema = getBlockContentSchema(); 11884 return pieces.map((piece) => { 11885 if (typeof piece !== "string") { 11886 return piece; 11887 } 11888 const filters = [ 11889 // Needed to adjust invalid lists. 11890 listReducer, 11891 // Needed to create more and nextpage blocks. 11892 specialCommentConverter, 11893 // Needed to create media blocks. 11894 figureContentReducer, 11895 // Needed to create the quote block, which cannot handle text 11896 // without wrapper paragraphs. 11897 blockquoteNormaliser({ raw: true }) 11898 ]; 11899 piece = deepFilterHTML(piece, filters, blockContentSchema); 11900 piece = normaliseBlocks(piece, { raw: true }); 11901 return htmlToBlocks(piece, rawHandler); 11902 }).flat().filter(Boolean); 11903 } 11904 11905 11906 ;// ./node_modules/@wordpress/blocks/build-module/api/raw-handling/comment-remover.js 11907 11908 function commentRemover(node) { 11909 if (node.nodeType === node.COMMENT_NODE) { 11910 (0,external_wp_dom_namespaceObject.remove)(node); 11911 } 11912 } 11913 11914 11915 ;// ./node_modules/@wordpress/blocks/build-module/api/raw-handling/is-inline-content.js 11916 11917 function isInline(node, contextTag) { 11918 if ((0,external_wp_dom_namespaceObject.isTextContent)(node)) { 11919 return true; 11920 } 11921 if (!contextTag) { 11922 return false; 11923 } 11924 const tag = node.nodeName.toLowerCase(); 11925 const inlineAllowedTagGroups = [ 11926 ["ul", "li", "ol"], 11927 ["h1", "h2", "h3", "h4", "h5", "h6"] 11928 ]; 11929 return inlineAllowedTagGroups.some( 11930 (tagGroup) => [tag, contextTag].filter((t) => !tagGroup.includes(t)).length === 0 11931 ); 11932 } 11933 function deepCheck(nodes, contextTag) { 11934 return nodes.every( 11935 (node) => isInline(node, contextTag) && deepCheck(Array.from(node.children), contextTag) 11936 ); 11937 } 11938 function isDoubleBR(node) { 11939 return node.nodeName === "BR" && node.previousSibling && node.previousSibling.nodeName === "BR"; 11940 } 11941 function isInlineContent(HTML, contextTag) { 11942 const doc = document.implementation.createHTMLDocument(""); 11943 doc.body.innerHTML = HTML; 11944 const nodes = Array.from(doc.body.children); 11945 return !nodes.some(isDoubleBR) && deepCheck(nodes, contextTag); 11946 } 11947 11948 11949 ;// ./node_modules/@wordpress/blocks/build-module/api/raw-handling/phrasing-content-reducer.js 11950 11951 function phrasingContentReducer(node, doc) { 11952 if (node.nodeName === "SPAN" && node.style) { 11953 const { 11954 fontWeight, 11955 fontStyle, 11956 textDecorationLine, 11957 textDecoration, 11958 verticalAlign 11959 } = node.style; 11960 if (fontWeight === "bold" || fontWeight === "700") { 11961 (0,external_wp_dom_namespaceObject.wrap)(doc.createElement("strong"), node); 11962 } 11963 if (fontStyle === "italic") { 11964 (0,external_wp_dom_namespaceObject.wrap)(doc.createElement("em"), node); 11965 } 11966 if (textDecorationLine === "line-through" || textDecoration.includes("line-through")) { 11967 (0,external_wp_dom_namespaceObject.wrap)(doc.createElement("s"), node); 11968 } 11969 if (verticalAlign === "super") { 11970 (0,external_wp_dom_namespaceObject.wrap)(doc.createElement("sup"), node); 11971 } else if (verticalAlign === "sub") { 11972 (0,external_wp_dom_namespaceObject.wrap)(doc.createElement("sub"), node); 11973 } 11974 } else if (node.nodeName === "B") { 11975 node = (0,external_wp_dom_namespaceObject.replaceTag)(node, "strong"); 11976 } else if (node.nodeName === "I") { 11977 node = (0,external_wp_dom_namespaceObject.replaceTag)(node, "em"); 11978 } else if (node.nodeName === "A") { 11979 if (node.target && node.target.toLowerCase() === "_blank") { 11980 node.rel = "noreferrer noopener"; 11981 } else { 11982 node.removeAttribute("target"); 11983 node.removeAttribute("rel"); 11984 } 11985 if (node.name && !node.id) { 11986 node.id = node.name; 11987 } 11988 if (node.id && !node.ownerDocument.querySelector(`[href="#$node.id}"]`)) { 11989 node.removeAttribute("id"); 11990 } 11991 } 11992 } 11993 11994 11995 ;// ./node_modules/@wordpress/blocks/build-module/api/raw-handling/head-remover.js 11996 function headRemover(node) { 11997 if (node.nodeName !== "SCRIPT" && node.nodeName !== "NOSCRIPT" && node.nodeName !== "TEMPLATE" && node.nodeName !== "STYLE") { 11998 return; 11999 } 12000 node.parentNode.removeChild(node); 12001 } 12002 12003 12004 ;// ./node_modules/@wordpress/blocks/build-module/api/raw-handling/ms-list-ignore.js 12005 function msListIgnore(node) { 12006 if (node.nodeType !== node.ELEMENT_NODE) { 12007 return; 12008 } 12009 const style = node.getAttribute("style"); 12010 if (!style || !style.includes("mso-list")) { 12011 return; 12012 } 12013 const rules = style.split(";").reduce((acc, rule) => { 12014 const [key, value] = rule.split(":"); 12015 if (key && value) { 12016 acc[key.trim().toLowerCase()] = value.trim().toLowerCase(); 12017 } 12018 return acc; 12019 }, {}); 12020 if (rules["mso-list"] === "ignore") { 12021 node.remove(); 12022 } 12023 } 12024 12025 12026 ;// ./node_modules/@wordpress/blocks/build-module/api/raw-handling/ms-list-converter.js 12027 12028 12029 function ms_list_converter_isList(node) { 12030 return node.nodeName === "OL" || node.nodeName === "UL"; 12031 } 12032 function msListConverter(node, doc) { 12033 if (node.nodeName !== "P") { 12034 return; 12035 } 12036 const style = node.getAttribute("style"); 12037 if (!style || !style.includes("mso-list")) { 12038 return; 12039 } 12040 const prevNode = node.previousElementSibling; 12041 if (!prevNode || !ms_list_converter_isList(prevNode)) { 12042 const type = node.textContent.trim().slice(0, 1); 12043 const isNumeric = /[1iIaA]/.test(type); 12044 const newListNode = doc.createElement(isNumeric ? "ol" : "ul"); 12045 if (isNumeric) { 12046 newListNode.setAttribute("type", type); 12047 } 12048 node.parentNode.insertBefore(newListNode, node); 12049 } 12050 const listNode = node.previousElementSibling; 12051 const listType = listNode.nodeName; 12052 const listItem = doc.createElement("li"); 12053 let receivingNode = listNode; 12054 listItem.innerHTML = deepFilterHTML(node.innerHTML, [msListIgnore]); 12055 const matches = /mso-list\s*:[^;]+level([0-9]+)/i.exec(style); 12056 let level = matches ? parseInt(matches[1], 10) - 1 || 0 : 0; 12057 while (level--) { 12058 receivingNode = receivingNode.lastChild || receivingNode; 12059 if (ms_list_converter_isList(receivingNode)) { 12060 receivingNode = receivingNode.lastChild || receivingNode; 12061 } 12062 } 12063 if (!ms_list_converter_isList(receivingNode)) { 12064 receivingNode = receivingNode.appendChild( 12065 doc.createElement(listType) 12066 ); 12067 } 12068 receivingNode.appendChild(listItem); 12069 node.parentNode.removeChild(node); 12070 } 12071 12072 12073 ;// external ["wp","blob"] 12074 const external_wp_blob_namespaceObject = window["wp"]["blob"]; 12075 ;// ./node_modules/@wordpress/blocks/build-module/api/raw-handling/image-corrector.js 12076 12077 function imageCorrector(node) { 12078 if (node.nodeName !== "IMG") { 12079 return; 12080 } 12081 if (node.src.indexOf("file:") === 0) { 12082 node.src = ""; 12083 } 12084 if (node.src.indexOf("data:") === 0) { 12085 const [properties, data] = node.src.split(","); 12086 const [type] = properties.slice(5).split(";"); 12087 if (!data || !type) { 12088 node.src = ""; 12089 return; 12090 } 12091 let decoded; 12092 try { 12093 decoded = atob(data); 12094 } catch (e) { 12095 node.src = ""; 12096 return; 12097 } 12098 const uint8Array = new Uint8Array(decoded.length); 12099 for (let i = 0; i < uint8Array.length; i++) { 12100 uint8Array[i] = decoded.charCodeAt(i); 12101 } 12102 const name = type.replace("/", "."); 12103 const file = new window.File([uint8Array], name, { type }); 12104 node.src = (0,external_wp_blob_namespaceObject.createBlobURL)(file); 12105 } 12106 if (node.height === 1 || node.width === 1) { 12107 node.parentNode.removeChild(node); 12108 } 12109 } 12110 12111 12112 ;// ./node_modules/@wordpress/blocks/build-module/api/raw-handling/div-normaliser.js 12113 12114 function divNormaliser(node) { 12115 if (node.nodeName !== "DIV") { 12116 return; 12117 } 12118 node.innerHTML = normaliseBlocks(node.innerHTML); 12119 } 12120 12121 12122 // EXTERNAL MODULE: ./node_modules/showdown/dist/showdown.js 12123 var showdown = __webpack_require__(1030); 12124 var showdown_default = /*#__PURE__*/__webpack_require__.n(showdown); 12125 ;// ./node_modules/@wordpress/blocks/build-module/api/raw-handling/markdown-converter.js 12126 12127 const converter = new (showdown_default()).Converter({ 12128 noHeaderId: true, 12129 tables: true, 12130 literalMidWordUnderscores: true, 12131 omitExtraWLInCodeBlocks: true, 12132 simpleLineBreaks: true, 12133 strikethrough: true 12134 }); 12135 function slackMarkdownVariantCorrector(text) { 12136 return text.replace( 12137 /((?:^|\n)```)([^\n`]+)(```(?:$|\n))/, 12138 (match, p1, p2, p3) => `$p1} 12139 $p2} 12140 $p3}` 12141 ); 12142 } 12143 function bulletsToAsterisks(text) { 12144 return text.replace(/(^|\n)•( +)/g, "$1*$2"); 12145 } 12146 function markdownConverter(text) { 12147 return converter.makeHtml( 12148 slackMarkdownVariantCorrector(bulletsToAsterisks(text)) 12149 ); 12150 } 12151 12152 12153 ;// ./node_modules/@wordpress/blocks/build-module/api/raw-handling/iframe-remover.js 12154 function iframeRemover(node) { 12155 if (node.nodeName === "IFRAME") { 12156 const text = node.ownerDocument.createTextNode(node.src); 12157 node.parentNode.replaceChild(text, node); 12158 } 12159 } 12160 12161 12162 ;// ./node_modules/@wordpress/blocks/build-module/api/raw-handling/google-docs-uid-remover.js 12163 12164 function googleDocsUIdRemover(node) { 12165 if (!node.id || node.id.indexOf("docs-internal-guid-") !== 0) { 12166 return; 12167 } 12168 if (node.tagName === "B") { 12169 (0,external_wp_dom_namespaceObject.unwrap)(node); 12170 } else { 12171 node.removeAttribute("id"); 12172 } 12173 } 12174 12175 12176 ;// ./node_modules/@wordpress/blocks/build-module/api/raw-handling/html-formatting-remover.js 12177 12178 function isFormattingSpace(character) { 12179 return character === " " || character === "\r" || character === "\n" || character === " "; 12180 } 12181 function htmlFormattingRemover(node) { 12182 if (node.nodeType !== node.TEXT_NODE) { 12183 return; 12184 } 12185 let parent = node; 12186 while (parent = parent.parentNode) { 12187 if (parent.nodeType === parent.ELEMENT_NODE && parent.nodeName === "PRE") { 12188 return; 12189 } 12190 } 12191 let newData = node.data.replace(/[ \r\n\t]+/g, " "); 12192 if (newData[0] === " ") { 12193 const previousSibling = getSibling(node, "previous"); 12194 if (!previousSibling || previousSibling.nodeName === "BR" || previousSibling.textContent.slice(-1) === " ") { 12195 newData = newData.slice(1); 12196 } 12197 } 12198 if (newData[newData.length - 1] === " ") { 12199 const nextSibling = getSibling(node, "next"); 12200 if (!nextSibling || nextSibling.nodeName === "BR" || nextSibling.nodeType === nextSibling.TEXT_NODE && isFormattingSpace(nextSibling.textContent[0])) { 12201 newData = newData.slice(0, -1); 12202 } 12203 } 12204 if (!newData) { 12205 node.parentNode.removeChild(node); 12206 } else { 12207 node.data = newData; 12208 } 12209 } 12210 12211 12212 ;// ./node_modules/@wordpress/blocks/build-module/api/raw-handling/br-remover.js 12213 12214 function brRemover(node) { 12215 if (node.nodeName !== "BR") { 12216 return; 12217 } 12218 if (getSibling(node, "next")) { 12219 return; 12220 } 12221 node.parentNode.removeChild(node); 12222 } 12223 12224 12225 ;// ./node_modules/@wordpress/blocks/build-module/api/raw-handling/empty-paragraph-remover.js 12226 function emptyParagraphRemover(node) { 12227 if (node.nodeName !== "P") { 12228 return; 12229 } 12230 if (node.hasChildNodes()) { 12231 return; 12232 } 12233 node.parentNode.removeChild(node); 12234 } 12235 12236 12237 ;// ./node_modules/@wordpress/blocks/build-module/api/raw-handling/slack-paragraph-corrector.js 12238 function slackParagraphCorrector(node) { 12239 if (node.nodeName !== "SPAN") { 12240 return; 12241 } 12242 if (node.getAttribute("data-stringify-type") !== "paragraph-break") { 12243 return; 12244 } 12245 const { parentNode } = node; 12246 parentNode.insertBefore(node.ownerDocument.createElement("br"), node); 12247 parentNode.insertBefore(node.ownerDocument.createElement("br"), node); 12248 parentNode.removeChild(node); 12249 } 12250 12251 12252 ;// ./node_modules/@wordpress/blocks/build-module/api/raw-handling/latex-to-math.js 12253 function isLatexMathMode(text) { 12254 const lettersRegex = /[\p{L}\s]+/gu; 12255 let match; 12256 while (match = lettersRegex.exec(text)) { 12257 if (text[match.index - 1] === "{") { 12258 continue; 12259 } 12260 let sequence = match[0]; 12261 if (text[match.index - 1] === "\\") { 12262 sequence = sequence.replace(/^[a-zA-Z]+/, ""); 12263 } 12264 if (sequence.length < 6) { 12265 continue; 12266 } 12267 return false; 12268 } 12269 if (/\\[a-zA-Z]+\s*\{/g.test(text)) { 12270 return true; 12271 } 12272 const softClues = [ 12273 (t) => t.includes("^") && !t.startsWith("^"), 12274 (t) => ["=", "+", "-", "/", "*"].some( 12275 (operator) => t.includes(operator) 12276 ), 12277 (t) => /\\[a-zA-Z]+/g.test(t) 12278 ]; 12279 if (softClues.filter((clue) => clue(text)).length >= 2) { 12280 return true; 12281 } 12282 return false; 12283 } 12284 12285 12286 ;// ./node_modules/@wordpress/blocks/build-module/api/raw-handling/paste-handler.js 12287 12288 12289 12290 12291 12292 12293 12294 12295 12296 12297 12298 12299 12300 12301 12302 12303 12304 12305 12306 12307 12308 12309 12310 12311 12312 12313 12314 12315 12316 const log = (...args) => window?.console?.log?.(...args); 12317 function filterInlineHTML(HTML) { 12318 HTML = deepFilterHTML(HTML, [ 12319 headRemover, 12320 googleDocsUIdRemover, 12321 msListIgnore, 12322 phrasingContentReducer, 12323 commentRemover 12324 ]); 12325 HTML = (0,external_wp_dom_namespaceObject.removeInvalidHTML)(HTML, (0,external_wp_dom_namespaceObject.getPhrasingContentSchema)("paste"), { 12326 inline: true 12327 }); 12328 HTML = deepFilterHTML(HTML, [htmlFormattingRemover, brRemover]); 12329 log("Processed inline HTML:\n\n", HTML); 12330 return HTML; 12331 } 12332 function pasteHandler({ 12333 HTML = "", 12334 plainText = "", 12335 mode = "AUTO", 12336 tagName 12337 }) { 12338 HTML = HTML.replace(/<meta[^>]+>/g, ""); 12339 HTML = HTML.replace( 12340 /^\s*<html[^>]*>\s*<body[^>]*>(?:\s*<!--\s*StartFragment\s*-->)?/i, 12341 "" 12342 ); 12343 HTML = HTML.replace( 12344 /(?:<!--\s*EndFragment\s*-->\s*)?<\/body>\s*<\/html>\s*$/i, 12345 "" 12346 ); 12347 if (mode !== "INLINE") { 12348 const content = HTML ? HTML : plainText; 12349 if (content.indexOf("<!-- wp:") !== -1) { 12350 const parseResult = parser_parse(content); 12351 const isSingleFreeFormBlock = parseResult.length === 1 && parseResult[0].name === "core/freeform"; 12352 if (!isSingleFreeFormBlock) { 12353 return parseResult; 12354 } 12355 } 12356 } 12357 if (String.prototype.normalize) { 12358 HTML = HTML.normalize(); 12359 } 12360 HTML = deepFilterHTML(HTML, [slackParagraphCorrector]); 12361 const isPlainText = plainText && (!HTML || isPlain(HTML)); 12362 if (isPlainText && isLatexMathMode(plainText)) { 12363 return [createBlock("core/math", { latex: plainText })]; 12364 } 12365 if (isPlainText) { 12366 HTML = plainText; 12367 if (!/^\s+$/.test(plainText)) { 12368 HTML = markdownConverter(HTML); 12369 } 12370 } 12371 const pieces = shortcode_converter_default(HTML); 12372 const hasShortcodes = pieces.length > 1; 12373 if (isPlainText && !hasShortcodes) { 12374 if (mode === "AUTO" && plainText.indexOf("\n") === -1 && plainText.indexOf("<p>") !== 0 && HTML.indexOf("<p>") === 0) { 12375 mode = "INLINE"; 12376 } 12377 } 12378 if (mode === "INLINE") { 12379 return filterInlineHTML(HTML); 12380 } 12381 if (mode === "AUTO" && !hasShortcodes && isInlineContent(HTML, tagName)) { 12382 return filterInlineHTML(HTML); 12383 } 12384 const phrasingContentSchema = (0,external_wp_dom_namespaceObject.getPhrasingContentSchema)("paste"); 12385 const blockContentSchema = getBlockContentSchema("paste"); 12386 const blocks = pieces.map((piece) => { 12387 if (typeof piece !== "string") { 12388 return piece; 12389 } 12390 const filters = [ 12391 googleDocsUIdRemover, 12392 msListConverter, 12393 headRemover, 12394 listReducer, 12395 imageCorrector, 12396 phrasingContentReducer, 12397 specialCommentConverter, 12398 commentRemover, 12399 iframeRemover, 12400 figureContentReducer, 12401 blockquoteNormaliser(), 12402 divNormaliser 12403 ]; 12404 const schema = { 12405 ...blockContentSchema, 12406 // Keep top-level phrasing content, normalised by `normaliseBlocks`. 12407 ...phrasingContentSchema 12408 }; 12409 piece = deepFilterHTML(piece, filters, blockContentSchema); 12410 piece = (0,external_wp_dom_namespaceObject.removeInvalidHTML)(piece, schema); 12411 piece = normaliseBlocks(piece); 12412 piece = deepFilterHTML( 12413 piece, 12414 [htmlFormattingRemover, brRemover, emptyParagraphRemover], 12415 blockContentSchema 12416 ); 12417 log("Processed HTML piece:\n\n", piece); 12418 return htmlToBlocks(piece, pasteHandler); 12419 }).flat().filter(Boolean); 12420 if (mode === "AUTO" && blocks.length === 1 && hasBlockSupport(blocks[0].name, "__unstablePasteTextInline", false)) { 12421 const trimRegex = /^[\n]+|[\n]+$/g; 12422 const trimmedPlainText = plainText.replace(trimRegex, ""); 12423 if (trimmedPlainText !== "" && trimmedPlainText.indexOf("\n") === -1) { 12424 return (0,external_wp_dom_namespaceObject.removeInvalidHTML)( 12425 getBlockInnerHTML(blocks[0]), 12426 phrasingContentSchema 12427 ).replace(trimRegex, ""); 12428 } 12429 } 12430 return blocks; 12431 } 12432 12433 12434 ;// ./node_modules/@wordpress/blocks/build-module/api/categories.js 12435 12436 12437 function categories_getCategories() { 12438 return (0,external_wp_data_namespaceObject.select)(store).getCategories(); 12439 } 12440 function categories_setCategories(categories) { 12441 (0,external_wp_data_namespaceObject.dispatch)(store).setCategories(categories); 12442 } 12443 function categories_updateCategory(slug, category) { 12444 (0,external_wp_data_namespaceObject.dispatch)(store).updateCategory(slug, category); 12445 } 12446 12447 12448 ;// ./node_modules/@wordpress/blocks/build-module/api/templates.js 12449 12450 12451 12452 12453 function doBlocksMatchTemplate(blocks = [], template = []) { 12454 return blocks.length === template.length && template.every(([name, , innerBlocksTemplate], index) => { 12455 const block = blocks[index]; 12456 return name === block.name && doBlocksMatchTemplate(block.innerBlocks, innerBlocksTemplate); 12457 }); 12458 } 12459 const isHTMLAttribute = (attributeDefinition) => attributeDefinition?.source === "html"; 12460 const isQueryAttribute = (attributeDefinition) => attributeDefinition?.source === "query"; 12461 function normalizeAttributes(schema, values) { 12462 if (!values) { 12463 return {}; 12464 } 12465 return Object.fromEntries( 12466 Object.entries(values).map(([key, value]) => [ 12467 key, 12468 normalizeAttribute(schema[key], value) 12469 ]) 12470 ); 12471 } 12472 function normalizeAttribute(definition, value) { 12473 if (isHTMLAttribute(definition) && Array.isArray(value)) { 12474 return (0,external_wp_element_namespaceObject.renderToString)(value); 12475 } 12476 if (isQueryAttribute(definition) && value) { 12477 return value.map((subValues) => { 12478 return normalizeAttributes(definition.query, subValues); 12479 }); 12480 } 12481 return value; 12482 } 12483 function synchronizeBlocksWithTemplate(blocks = [], template) { 12484 if (!template) { 12485 return blocks; 12486 } 12487 return template.map( 12488 ([name, attributes, innerBlocksTemplate], index) => { 12489 const block = blocks[index]; 12490 if (block && block.name === name) { 12491 const innerBlocks = synchronizeBlocksWithTemplate( 12492 block.innerBlocks, 12493 innerBlocksTemplate 12494 ); 12495 return { ...block, innerBlocks }; 12496 } 12497 const blockType = getBlockType(name); 12498 const normalizedAttributes = normalizeAttributes( 12499 blockType?.attributes ?? {}, 12500 attributes 12501 ); 12502 const [blockName, blockAttributes] = convertLegacyBlockNameAndAttributes( 12503 name, 12504 normalizedAttributes 12505 ); 12506 return createBlock( 12507 blockName, 12508 blockAttributes, 12509 synchronizeBlocksWithTemplate([], innerBlocksTemplate) 12510 ); 12511 } 12512 ); 12513 } 12514 12515 12516 ;// ./node_modules/@wordpress/blocks/build-module/api/index.js 12517 12518 12519 12520 12521 12522 12523 12524 12525 12526 12527 12528 12529 12530 12531 12532 12533 const privateApis = {}; 12534 lock(privateApis, { isContentBlock: isContentBlock }); 12535 12536 12537 ;// ./node_modules/@wordpress/blocks/build-module/deprecated.js 12538 12539 function withBlockContentContext(OriginalComponent) { 12540 external_wp_deprecated_default()("wp.blocks.withBlockContentContext", { 12541 since: "6.1" 12542 }); 12543 return OriginalComponent; 12544 } 12545 12546 12547 ;// ./node_modules/@wordpress/blocks/build-module/index.js 12548 12549 12550 12551 12552 12553 })(); 12554 12555 (window.wp = window.wp || {}).blocks = __webpack_exports__; 12556 /******/ })() 12557 ;
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated : Thu Oct 23 08:20:05 2025 | Cross-referenced by PHPXref |