1/******/ (() => { // webpackBootstrap 2/******/ var __webpack_modules__ = ({ 3 4/***/ 1030: 5/***/ (function(module, exports, __webpack_require__) { 6 7var __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 13function 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
vendor: 8,648 bytes, lines 64-381
64with 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 190function 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 207var 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 */ 261showdown.helper = {}; 262 263/** 264 * TODO LEGACY SUPPORT CODE 265 * @type {{}} 266 */ 267showdown.extensions = {}; 268 269/** 270 * Set a global option 271 * @static 272 * @param {string} key 273 * @param {*} value 274 * @returns {showdown} 275 */ 276showdown.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 */ 288showdown.getOption = function (key) { 289 'use strict'; 290 return globalOptions[key]; 291}; 292 293/** 294 * Get the global options 295 * @static 296 * @returns {{}} 297 */ 298showdown.getOptions = function () { 299 'use strict'; 300 return globalOptions; 301}; 302 303/** 304 * Reset global options to the default values 305 * @static 306 */ 307showdown.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 */ 316showdown.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 */ 335showdown.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 */ 345showdown.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 */ 358showdown.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 */ 373showdown.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
vendor: 15,998 bytes, lines 392-979
392|function=} ext 393 * @returns {*} 394 */ 395showdown.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 */ 437showdown.getAllExtensions = function () { 438 'use strict'; 439 return extensions; 440}; 441 442/** 443 * Remove an extension 444 * @param {string} name 445 */ 446showdown.removeExtension = function (name) { 447 'use strict'; 448 delete extensions[name]; 449}; 450 451/** 452 * Removes all extensions 453 */ 454showdown.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 */ 465function 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 */ 572showdown.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 587if (!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 */ 597showdown.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 */ 608showdown.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 */ 620showdown.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 */ 631showdown.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 */ 643showdown.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 */ 681showdown.helper.stdExtName = function (s) { 682 'use strict'; 683 return s.replace(/[_?*+\/\\.^-]/g, '').replace(/\s/g, '').toLowerCase(); 684}; 685 686function 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 */ 699showdown.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 */ 709showdown.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 */ 730showdown.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 740var 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 */ 807showdown.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 */ 833showdown.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 */ 883showdown.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 */ 902showdown.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 */ 919showdown.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 */ 957showdown.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 979if (typeof
979console
vendor: 50,510 bytes, lines 979-2582
979 === '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 */ 1000showdown.helper.regexes = { 1001 asteriskDashAndColon: /([*_:~])/g 1002}; 1003 1004/** 1005 * EMOJIS LIST 1006 */ 1007showdown.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 */ 2197showdown.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)
vendor: 4,065 bytes, lines 2582-2726
2582) { 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(
vendor: 12,891 bytes, lines 2726-3114
2726i, 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 */ 2793showdown.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 2891var 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 2935showdown.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 2948showdown.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 */ 2973showdown.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 3002showdown.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 */ 3048showdown.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 */ 3109showdown.subParser('codeSpans', function (text, options, globals) { 3110 'use strict'; 3111 3112 text = globals.converter._dispatch('codeSpans.before', text, options, globals); 3113 3114 if (typeof
vendor: 6,056 bytes, lines 3114-3310
3114text === '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 */ 3136showdown.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 */ 3199showdown.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 3230showdown.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 */ 3247showdown.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 */ 3273showdown.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 */ 3305showdown.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(/\\([`*_{}\[\]()>#+.!~=|
vendor: 38,008 bytes, lines 3310-4406
3310-])/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 */ 3321showdown.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 */ 3344showdown.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 */ 3377showdown.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 3414showdown.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 */ 3426showdown.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 3442showdown.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 3462showdown.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 */ 3564showdown.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 */ 3601showdown.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 */ 3629showdown.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 3646showdown.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 */ 3776showdown.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 */ 3792showdown.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 3894showdown.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 */ 3968showdown.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 */ 4172showdown.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 */ 4222showdown.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 */ 4240showdown.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 */ 4311showdown.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 */ 4333showdown.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 4379showdown.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 */ 4403showdown.subParser('stripLinkDefinitions', function (text, options, globals) { 4404 'use strict'; 4405 4406 var regex = /^ {0,3}\[(
4406.+)]:[ \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();
vendor: 20,061 bytes, lines 4413-5133
4413 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 4452showdown.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 4595showdown.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 */ 4631showdown.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 4644showdown.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 4667showdown.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 4675showdown.subParser('makeMarkdown.codeSpan', function (node) { 4676 'use strict'; 4677 4678 return '`' + node.innerHTML + '`'; 4679}); 4680 4681showdown.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 4697showdown.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 4715showdown.subParser('makeMarkdown.hr', function () { 4716 'use strict'; 4717 4718 return '---'; 4719}); 4720 4721showdown.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 4740showdown.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 4761showdown.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 4795showdown.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 4823showdown.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 4942showdown.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 4960showdown.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 4967showdown.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 4983showdown.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 4999showdown.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 5070showdown.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 5086showdown.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 5130var root = this; 5131 5132// AMD Loader 5133if (t
5133rue) { 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"; 5153var __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 */ 5163var 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"); 5164function 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}; 5167exports.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 5184module.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;
vendor: 9,321 bytes, lines 5189-5783
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 5258if (true) { 5259 module.exports = __webpack_require__(5373); 5260} else {} 5261 5262 5263/***/ }), 5264 5265/***/ 9681: 5266/***/ ((module) => { 5267 5268var 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", 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 5730var chars = Object.keys(characterMap).join('|'); 5731var allAccents = new RegExp(chars, 'g'); 5732var firstAccent = new RegExp(chars, ''); 5733 5734function matcher(match) { 5735 return characterMap[match]; 5736} 5737 5738var removeAccents = function(string) { 5739 return string.replace(allAccents, matcher); 5740}; 5741 5742var hasAccents = function(string) { 5743 return !!string.match(firstAccent); 5744}; 5745 5746module.exports = removeAccents; 5747module.exports.has = hasAccents; 5748module.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) => {
vendor: 1,617 bytes, lines 5784-5824
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/************************************************************************/ 5821var __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 5912var 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 5924var 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 5949var 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 5971var 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;
5980// external ["wp","data"] 5981const external_wp_data_namespaceObject = window["wp"]["data"]; 5982;// ./node_modules/tslib/tslib.es6.mjs
vendor: 15,434 bytes, lines 5982-6310
5982 5983/****************************************************************************** 5984Copyright (c) Microsoft Corporation. 5985 5986Permission to use, copy, modify, and/or distribute this software for any 5987purpose with or without fee is hereby granted. 5988 5989THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 5990REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 5991AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 5992INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 5993LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 5994OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 5995PERFORMANCE OF THIS SOFTWARE. 5996***************************************************************************** */ 5997/* global Reflect, Promise, SuppressedError, Symbol, Iterator */ 5998 5999var 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 6006function __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 6014var __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 6025function __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 6037function __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 6044function __param(paramIndex, decorator) { 6045 return function (target, key) { decorator(target, key, paramIndex); } 6046} 6047 6048function __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 6076function __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 6084function __propKey(x) { 6085 return typeof x === "symbol" ? x : "".concat(x); 6086}; 6087 6088function __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 6093function __metadata(metadataKey, metadataValue) { 6094 if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); 6095} 6096 6097function __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 6107function __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 6135var __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 6147function __exportStar(m, o) { 6148 for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); 6149} 6150 6151function __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 6163function __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 */ 6181function __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 */ 6188function __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 6196function __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 6206function __await(v) { 6207 return this instanceof __await ? (this.v = v, this) : new __await(v); 6208} 6209 6210function __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 6223function __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 6229function __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 6237function __makeTemplateObject(cooked, raw) { 6238 if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } 6239 return cooked; 6240}; 6241 6242var __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 6248var 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 6257function __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 6265function __importDefault(mod) { 6266 return (mod && mod.__esModule) ? mod : { default: mod }; 6267} 6268 6269function __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 6275function __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 6282function __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 6287function __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 6310var _SuppressedError =
vendor: 1,531 bytes, lines 6310-6356
6310typeof 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 6315function __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 6341function __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 */ 6389var SUPPORTED_LOCALE = { 6390 tr: { 6391 regexp: /\u0130|\u0049|\u0049\u0307/g, 6392 map: { 6393 İ: "\u0069", 6394 I: "\u0131", 6395 IÌ: "\u0069", 6396 }, 6397 }, 6398 az: { 6399 regexp: /\u0130/g, 6400 map: { 6401 İ: "\u0069", 6402 I: "\u0131", 6403 IÌ: "\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 */ 6421function 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 */ 6430function 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"). 6437var DEFAULT_SPLIT_REGEXP = [/([a-z0-9])([A-Z])/g, /([A-Z])([A-Z][a-z])/g]; 6438// Remove all non-word characters. 6439var DEFAULT_STRIP_REGEXP = /[^A-Z0-9]+/gi; 6440/** 6441 * Normalize the string into something other libraries can manipulate easier. 6442 */ 6443function 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 */ 6460function 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 6469function 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} 6477function dist_es2015_pascalCaseTransformMerge(input) { 6478 return input.charAt(0).toUpperCase() + input.slice(1).toLowerCase(); 6479} 6480function 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 6488function camelCaseTransform(input, index) { 6489 if (index === 0) 6490 return input.toLowerCase(); 6491 return pascalCaseTransform(input, index); 6492} 6493function camelCaseTransformMerge(input, index) { 6494 if (index === 0) 6495 return input.toLowerCase(); 6496 return pascalCaseTransformMerge(input); 6497} 6498function camelCase(input, options) { 6499 if (options === void 0) { options = {}; } 6500 return pascalCase(input, __assign({ transform: camelCaseTransform }, options)); 6501} 6502 6503;// external ["wp","i18n"] 6504const external_wp_i18n_namespaceObject = window["wp"]["i18n"]; 6505;// ./node_modules/colord/index.mjs 6506var 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*,\
vendor: 6,973 bytes, lines 6506-6509
6506s*([+-]?\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",s
6509andybrown:"#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 6512var 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"] 6515const external_wp_element_namespaceObject = window["wp"]["element"]; 6516;// external ["wp","dom"] 6517const external_wp_dom_namespaceObject = window["wp"]["dom"]; 6518;// external ["wp","richText"] 6519const external_wp_richText_namespaceObject = window["wp"]["richText"]; 6520;// external ["wp","deprecated"] 6521const external_wp_deprecated_namespaceObject = window["wp"]["deprecated"]; 6522var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_namespaceObject); 6523;// ./node_modules/@wordpress/blocks/build-module/api/constants.js 6524const BLOCK_ICON_DEFAULT = "block-default"; 6525const DEPRECATED_ENTRY_KEYS = [ 6526 "attributes", 6527 "supports", 6528 "save", 6529 "migrate", 6530 "isEligible", 6531 "apiVersion" 6532]; 6533const __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}; 6789const __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}; 6804const __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"] 6815const external_wp_warning_namespaceObject = window["wp"]["warning"]; 6816var external_wp_warning_default = /*#__PURE__*/__webpack_require__.n(external_wp_warning_namespaceObject); 6817;// ./node_modules/@wordpress/blocks/build-module/api/i18n-block.json 6818const 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;
6819// external ["wp","privateApis"] 6820const external_wp_privateApis_namespaceObject = window["wp"]["privateApis"]; 6821;// ./node_modules/@wordpress/blocks/build-module/lock-unlock.js 6822 6823const { 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 6836function isObject(object) { 6837 return object !== null && typeof object === "object"; 6838} 6839function 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} 6845function 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} 6885function 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} 6911function 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} 6940function registerBlockCollection(namespace, { title, icon }) { 6941 (0,external_wp_data_namespaceObject.dispatch)(store).addBlockCollection(namespace, title, icon); 6942} 6943function unregisterBlockCollection(namespace) { 6944 dispatch(blocksStore).removeBlockCollection(namespace); 6945} 6946function 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} 6955function setFreeformContentHandlerName(blockName) { 6956 (0,external_wp_data_namespaceObject.dispatch)(store).setFreeformFallbackBlockName(blockName); 6957} 6958function getFreeformContentHandlerName() { 6959 return (0,external_wp_data_namespaceObject.select)(store).getFreeformFallbackBlockName(); 6960} 6961function getGroupingBlockName() { 6962 return (0,external_wp_data_namespaceObject.select)(store).getGroupingBlockName(); 6963} 6964function setUnregisteredTypeHandlerName(blockName) { 6965 (0,external_wp_data_namespaceObject.dispatch)(store).setUnregisteredFallbackBlockName(blockName); 6966} 6967function getUnregisteredTypeHandlerName() { 6968 return (0,external_wp_data_namespaceObject.select)(store).getUnregisteredFallbackBlockName(); 6969} 6970function setDefaultBlockName(name) { 6971 (0,external_wp_data_namespaceObject.dispatch)(store).setDefaultBlockName(name); 6972} 6973function setGroupingBlockName(name) { 6974 (0,external_wp_data_namespaceObject.dispatch)(store).setGroupingBlockName(name); 6975} 6976function getDefaultBlockName() { 6977 return (0,external_wp_data_namespaceObject.select)(store).getDefaultBlockName(); 6978} 6979function getBlockType(name) { 6980 return (0,external_wp_data_namespaceObject.select)(store)?.getBlockType(name); 6981} 6982function getBlockTypes() { 6983 return (0,external_wp_data_namespaceObject.select)(store).getBlockTypes(); 6984}
6985function getBlockSupport(nameOrType, feature, defaultSupports) { 6986 return (0,external_wp_data_namespaceObject.select)(store).getBlockSupport( 6987 nameOrType, 6988 feature, 6989 defaultSupports 6990 ); 6991} 6992function hasBlockSupport(nameOrType, feature, defaultSupports) { 6993 return (0,external_wp_data_namespaceObject.select)(store).hasBlockSupport( 6994 nameOrType, 6995 feature, 6996 defaultSupports 6997 ); 6998} 6999function isReusableBlock(blockOrType) { 7000 return blockOrType?.name === "core/block"; 7001} 7002function isTemplatePart(blockOrType) { 7003 return blockOrType?.name === "core/template-part"; 7004} 7005const getChildBlockNames = (blockName) => { 7006 return (0,external_wp_data_namespaceObject.select)(store).getChildBlockNames(blockName); 7007}; 7008const hasChildBlocks = (blockName) => { 7009 return (0,external_wp_data_namespaceObject.select)(store).hasChildBlocks(blockName); 7010}; 7011const hasChildBlocksWithInserterSupport = (blockName) => { 7012 return (0,external_wp_data_namespaceObject.select)(store).hasChildBlocksWithInserterSupport(blockName); 7013}; 7014const registerBlockStyle = (blockNames, styleVariation) => { 7015 (0,external_wp_data_namespaceObject.dispatch)(store).addBlockStyles(blockNames, styleVariation); 7016}; 7017const unregisterBlockStyle = (blockName, styleVariationName) => { 7018 (0,external_wp_data_namespaceObject.dispatch)(store).removeBlockStyles(blockName, styleVariationName); 7019}; 7020const getBlockVariations = (blockName, scope) => { 7021 return (0,external_wp_data_namespaceObject.select)(store).getBlockVariations(blockName, scope); 7022}; 7023const 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}; 7029const unregisterBlockVariation = (blockName, variationName) => { 7030 (0,external_wp_data_namespaceObject.dispatch)(store).removeBlockVariations(blockName, variationName); 7031}; 7032const registerBlockBindingsSource = (source) => { 7033 const { 7034 name, 7035 label, 7036 usesContext, 7037 getValues, 7038 setValues, 7039 canUserEditValue, 7040 getFieldsList 7041 } = source; 7042 const existingSource = unlock( 7043 (0,external_wp_data_namespaceObject.select)(store) 7044 ).getBlockBindingsSource(name); 7045 const serverProps = ["label", "usesContext"]; 7046 for (const prop in existingSource) { 7047 if (!serverProps.includes(prop) && existingSource[prop]) { 7048 external_wp_warning_default()( 7049 'Block bindings source "' + name + '" is already registered.' 7050 ); 7051 return; 7052 } 7053 } 7054 if (!name) { 7055 external_wp_warning_default()("Block bindings source must contain a name."); 7056 return; 7057 } 7058 if (typeof name !== "string") { 7059 external_wp_warning_default()("Block bindings source name must be a string."); 7060 return; 7061 } 7062 if (/[A-Z]+/.test(name)) { 7063 external_wp_warning_default()( 7064 "Block bindings source name must not contain uppercase characters." 7065 ); 7066 return; 7067 } 7068 if (!/^[a-z0-9/-]+$/.test(name)) { 7069 external_wp_warning_default()( 7070 "Block bindings source name must contain only valid characters: lowercase characters, hyphens, or digits. Example: my-plugin/my-custom-source." 7071 ); 7072 return; 7073 } 7074 if (!/^[a-z0-9-]+\/[a-z0-9-]+$/.test(name)) { 7075 external_wp_warning_default()( 7076 "Block bindings source name must contain a namespace and valid characters. Example: my-plugin/my-custom-source." 7077 ); 7078 return; 7079 } 7080 if (!label && !existingSource?.label) { 7081 external_wp_warning_default()("Block bindings source must contain a label."); 7082 return; 7083 } 7084 if (label && typeof label !== "string") { 7085 external_wp_warning_default()("Block bindings source label must be a string."); 7086 return; 7087 } 7088 if (label && existingSource?.label && label !== existingSource?.label) { 7089 external_wp_warning_default()('Block bindings "' + name + '" source label was overridden.'); 7090 } 7091 if (usesContext && !Array.isArray(usesContext)) { 7092 external_wp_warning_default()("Block bindings source usesContext must be an array."); 7093 return; 7094 } 7095 if (getValues && typeof getValues !== "function") { 7096 external_wp_warning_default()("Block bindings source getValues must be a function."); 7097 return; 7098 } 7099 if (setValues && typeof setValues !== "function") { 7100 external_wp_warning_default()("Block bindings source setValues must be a function."); 7101 return; 7102 } 7103 if (canUserEditValue && typeof canUserEditValue !== "function") { 7104 external_wp_warning_default()("Block bindings source canUserEditValue must be a function."); 7105 return; 7106 } 7107 if (getFieldsList && typeof getFieldsList !== "function") { 7108 external_wp_warning_default()("Block bindings source getFieldsList must be a function."); 7109 return; 7110 } 7111 return unlock((0,external_wp_data_namespaceObject.dispatch)(store)).addBlockBindingsSource(source); 7112}; 7113function unregisterBlockBindingsSource(name) { 7114 const oldSource = getBlockBindingsSource(name); 7115 if (!oldSource) { 7116 external_wp_warning_default()('Block bindings source "' + name + '" is not registered.'); 7117 return; 7118 } 7119 unlock((0,external_wp_data_namespaceObject.dispatch)(store)).removeBlockBindingsSource(name); 7120} 7121function getBlockBindingsSource(name) { 7122 return unlock((0,external_wp_data_namespaceObject.select)(store)).getBlockBindingsSource(name); 7123} 7124function getBlockBindingsSources() { 7125 return unlock((0,external_wp_data_namespaceObject.select)(store)).getAllBlockBindingsSources(); 7126} 7127 7128 7129;// ./node_modules/@wordpress/blocks/build-module/api/utils.js 7130 7131 7132 7133 7134 7135 7136 7137 7138 7139 7140k([names, a11y]); 7141const ICON_COLORS = ["#191e23", "#f8f9f9"]; 7142function isUnmodifiedBlock(block, role) { 7143 const blockAttributes = getBlockType(block.name)?.attributes ?? {}; 7144 const attributesByRole = role ? Object.entries(blockAttributes).filter(([key, definition]) => { 7145 if (role === "content" && key === "metadata") { 7146 return Object.keys(block.attributes[key]?.bindings ?? {}).length > 0; 7147 } 7148 return definition.role === role || definition.__experimentalRole === role; 7149 }) : []; 7150 const attributesToCheck = !!attributesByRole.length ? attributesByRole : Object.entries(blockAttributes); 7151 return attributesToCheck.every(([key, definition]) => { 7152 const value = block.attributes[key]; 7153 if (definition.hasOwnProperty("default")) { 7154 return value === definition.default; 7155 } 7156 if (definition.type === "rich-text") { 7157 return !value?.length; 7158 } 7159 return value === void 0; 7160 }); 7161} 7162function isUnmodifiedDefaultBlock(block, role) { 7163 return block.name === getDefaultBlockName() && isUnmodifiedBlock(block, role); 7164} 7165function isValidIcon(icon) { 7166 return !!icon && (typeof icon === "string" || (0,external_wp_element_namespaceObject.isValidElement)(icon) || typeof icon === "function" || icon instanceof external_wp_element_namespaceObject.Component); 7167} 7168function normalizeIconObject(icon) { 7169 icon = icon || BLOCK_ICON_DEFAULT; 7170 if (isValidIcon(icon)) { 7171 return { src: icon }; 7172 } 7173 if ("background" in icon) { 7174 const colordBgColor = w(icon.background); 7175 const getColorContrast = (iconColor) => colordBgColor.contrast(iconColor); 7176 const maxContrast = Math.max(...ICON_COLORS.map(getColorContrast)); 7177 return { 7178 ...icon,
7179 foreground: icon.foreground ? icon.foreground : ICON_COLORS.find( 7180 (iconColor) => getColorContrast(iconColor) === maxContrast 7181 ), 7182 shadowColor: colordBgColor.alpha(0.3).toRgbString() 7183 }; 7184 } 7185 return icon; 7186} 7187function normalizeBlockType(blockTypeOrName) { 7188 if (typeof blockTypeOrName === "string") { 7189 return getBlockType(blockTypeOrName); 7190 } 7191 return blockTypeOrName; 7192} 7193function getBlockLabel(blockType, attributes, context = "visual") { 7194 const { __experimentalLabel: getLabel, title } = blockType; 7195 const label = getLabel && getLabel(attributes, { context }); 7196 if (!label) { 7197 return title; 7198 } 7199 if (label.toPlainText) { 7200 return label.toPlainText(); 7201 } 7202 return (0,external_wp_dom_namespaceObject.__unstableStripHTML)(label); 7203} 7204function getAccessibleBlockLabel(blockType, attributes, position, direction = "vertical") { 7205 const title = blockType?.title; 7206 const label = blockType ? getBlockLabel(blockType, attributes, "accessibility") : ""; 7207 const hasPosition = position !== void 0; 7208 const hasLabel = label && label !== title; 7209 if (hasPosition && direction === "vertical") { 7210 if (hasLabel) { 7211 return (0,external_wp_i18n_namespaceObject.sprintf)( 7212 /* translators: accessibility text. 1: The block title. 2: The block row number. 3: The block label.. */ 7213 (0,external_wp_i18n_namespaceObject.__)("%1$s Block. Row %2$d. %3$s"), 7214 title, 7215 position, 7216 label 7217 ); 7218 } 7219 return (0,external_wp_i18n_namespaceObject.sprintf)( 7220 /* translators: accessibility text. 1: The block title. 2: The block row number. */ 7221 (0,external_wp_i18n_namespaceObject.__)("%1$s Block. Row %2$d"), 7222 title, 7223 position 7224 ); 7225 } else if (hasPosition && direction === "horizontal") { 7226 if (hasLabel) { 7227 return (0,external_wp_i18n_namespaceObject.sprintf)( 7228 /* translators: accessibility text. 1: The block title. 2: The block column number. 3: The block label.. */ 7229 (0,external_wp_i18n_namespaceObject.__)("%1$s Block. Column %2$d. %3$s"), 7230 title, 7231 position, 7232 label 7233 ); 7234 } 7235 return (0,external_wp_i18n_namespaceObject.sprintf)( 7236 /* translators: accessibility text. 1: The block title. 2: The block column number. */ 7237 (0,external_wp_i18n_namespaceObject.__)("%1$s Block. Column %2$d"), 7238 title, 7239 position 7240 ); 7241 } 7242 if (hasLabel) { 7243 return (0,external_wp_i18n_namespaceObject.sprintf)( 7244 /* translators: accessibility text. 1: The block title. 2: The block label. */ 7245 (0,external_wp_i18n_namespaceObject.__)("%1$s Block. %2$s"), 7246 title, 7247 label 7248 ); 7249 } 7250 return (0,external_wp_i18n_namespaceObject.sprintf)( 7251 /* translators: accessibility text. %s: The block title. */ 7252 (0,external_wp_i18n_namespaceObject.__)("%s Block"), 7253 title 7254 ); 7255} 7256function getDefault(attributeSchema) { 7257 if (attributeSchema.default !== void 0) { 7258 return attributeSchema.default; 7259 } 7260 if (attributeSchema.type === "rich-text") { 7261 return new external_wp_richText_namespaceObject.RichTextData(); 7262 } 7263} 7264function isBlockRegistered(name) { 7265 return getBlockType(name) !== void 0; 7266} 7267function __experimentalSanitizeBlockAttributes(name, attributes) { 7268 const blockType = getBlockType(name); 7269 if (void 0 === blockType) { 7270 throw new Error(`Block type '${name}' is not registered.`); 7271 } 7272 return Object.entries(blockType.attributes).reduce( 7273 (accumulator, [key, schema]) => { 7274 const value = attributes[key]; 7275 if (void 0 !== value) { 7276 if (schema.type === "rich-text") { 7277 if (value instanceof external_wp_richText_namespaceObject.RichTextData) { 7278 accumulator[key] = value; 7279 } else if (typeof value === "string") { 7280 accumulator[key] = external_wp_richText_namespaceObject.RichTextData.fromHTMLString(value); 7281 } 7282 } else if (schema.type === "string" && value instanceof external_wp_richText_namespaceObject.RichTextData) { 7283 accumulator[key] = value.toHTMLString(); 7284 } else { 7285 accumulator[key] = value; 7286 } 7287 } else { 7288 const _default = getDefault(schema); 7289 if (void 0 !== _default) { 7290 accumulator[key] = _default; 7291 } 7292 } 7293 if (["node", "children"].indexOf(schema.source) !== -1) { 7294 if (typeof accumulator[key] === "string") { 7295 accumulator[key] = [accumulator[key]]; 7296 } else if (!Array.isArray(accumulator[key])) { 7297 accumulator[key] = []; 7298 } 7299 } 7300 return accumulator; 7301 }, 7302 {} 7303 ); 7304} 7305function getBlockAttributesNamesByRole(name, role) { 7306 const attributes = getBlockType(name)?.attributes; 7307 if (!attributes) { 7308 return []; 7309 } 7310 const attributesNames = Object.keys(attributes); 7311 if (!role) { 7312 return attributesNames; 7313 } 7314 return attributesNames.filter((attributeName) => { 7315 const attribute = attributes[attributeName]; 7316 if (attribute?.role === role) { 7317 return true; 7318 } 7319 if (attribute?.__experimentalRole === role) { 7320 external_wp_deprecated_default()("__experimentalRole attribute", { 7321 since: "6.7", 7322 version: "6.8", 7323 alternative: "role attribute", 7324 hint: `Check the block.json of the ${name} block.` 7325 }); 7326 return true; 7327 } 7328 return false;
7329 }); 7330} 7331const __experimentalGetBlockAttributesNamesByRole = (...args) => { 7332 external_wp_deprecated_default()("__experimentalGetBlockAttributesNamesByRole", { 7333 since: "6.7", 7334 version: "6.8", 7335 alternative: "getBlockAttributesNamesByRole" 7336 }); 7337 return getBlockAttributesNamesByRole(...args); 7338}; 7339function isContentBlock(name) { 7340 const blockType = getBlockType(name); 7341 const attributes = blockType?.attributes; 7342 const supportsContentRole = blockType?.supports?.contentRole; 7343 if (supportsContentRole) { 7344 return true; 7345 } 7346 if (!attributes) { 7347 return false; 7348 } 7349 return !!Object.keys(attributes)?.some((attributeKey) => { 7350 const attribute = attributes[attributeKey]; 7351 return attribute?.role === "content" || attribute?.__experimentalRole === "content"; 7352 }); 7353} 7354function omit(object, keys) { 7355 return Object.fromEntries( 7356 Object.entries(object).filter(([key]) => !keys.includes(key)) 7357 ); 7358} 7359 7360 7361;// ./node_modules/@wordpress/blocks/build-module/store/reducer.js 7362 7363 7364 7365 7366const DEFAULT_CATEGORIES = [ 7367 { slug: "text", title: (0,external_wp_i18n_namespaceObject.__)("Text") }, 7368 { slug: "media", title: (0,external_wp_i18n_namespaceObject.__)("Media") }, 7369 { slug: "design", title: (0,external_wp_i18n_namespaceObject.__)("Design") }, 7370 { slug: "widgets", title: (0,external_wp_i18n_namespaceObject.__)("Widgets") }, 7371 { slug: "theme", title: (0,external_wp_i18n_namespaceObject.__)("Theme") }, 7372 { slug: "embed", title: (0,external_wp_i18n_namespaceObject.__)("Embeds") }, 7373 { slug: "reusable", title: (0,external_wp_i18n_namespaceObject.__)("Reusable blocks") } 7374]; 7375function keyBlockTypesByName(types) { 7376 return types.reduce( 7377 (newBlockTypes, block) => ({ 7378 ...newBlockTypes, 7379 [block.name]: block 7380 }), 7381 {} 7382 ); 7383} 7384function getUniqueItemsByName(items) { 7385 return items.reduce((acc, currentItem) => { 7386 if (!acc.some((item) => item.name === currentItem.name)) { 7387 acc.push(currentItem); 7388 } 7389 return acc; 7390 }, []); 7391} 7392function bootstrappedBlockTypes(state = {}, action) { 7393 switch (action.type) { 7394 case "ADD_BOOTSTRAPPED_BLOCK_TYPE": 7395 const { name, blockType } = action; 7396 const serverDefinition = state[name]; 7397 let newDefinition; 7398 if (serverDefinition) { 7399 if (serverDefinition.blockHooks === void 0 && blockType.blockHooks) { 7400 newDefinition = { 7401 ...serverDefinition, 7402 ...newDefinition, 7403 blockHooks: blockType.blockHooks 7404 }; 7405 } 7406 if (serverDefinition.allowedBlocks === void 0 && blockType.allowedBlocks) { 7407 newDefinition = { 7408 ...serverDefinition, 7409 ...newDefinition, 7410 allowedBlocks: blockType.allowedBlocks 7411 }; 7412 } 7413 } else { 7414 newDefinition = Object.fromEntries( 7415 Object.entries(blockType).filter( 7416 ([, value]) => value !== null && value !== void 0 7417 ).map(([key, value]) => [ 7418 camelCase(key), 7419 value 7420 ]) 7421 ); 7422 newDefinition.name = name; 7423 } 7424 if (newDefinition) { 7425 return { 7426 ...state, 7427 [name]: newDefinition 7428 }; 7429 } 7430 return state; 7431 case "REMOVE_BLOCK_TYPES": 7432 return omit(state, action.names); 7433 } 7434 return state; 7435} 7436function unprocessedBlockTypes(state = {}, action) { 7437 switch (action.type) { 7438 case "ADD_UNPROCESSED_BLOCK_TYPE": 7439 return { 7440 ...state, 7441 [action.name]: action.blockType 7442 }; 7443 case "REMOVE_BLOCK_TYPES": 7444 return omit(state, action.names); 7445 } 7446 return state; 7447} 7448function blockTypes(state = {}, action) { 7449 switch (action.type) { 7450 case "ADD_BLOCK_TYPES": 7451 return { 7452 ...state, 7453 ...keyBlockTypesByName(action.blockTypes) 7454 }; 7455 case "REMOVE_BLOCK_TYPES": 7456 return omit(state, action.names); 7457 } 7458 return state; 7459} 7460function blockStyles(state = {}, action) { 7461 switch (action.type) { 7462 case "ADD_BLOCK_TYPES": 7463 return { 7464 ...state, 7465 ...Object.fromEntries( 7466 Object.entries( 7467 keyBlockTypesByName(action.blockTypes) 7468 ).map(([name, blockType]) => [ 7469 name, 7470 getUniqueItemsByName([ 7471 ...(blockType.styles ?? []).map((style) => ({ 7472 ...style, 7473 source: "block" 7474 })),
7475 ...(state[blockType.name] ?? []).filter( 7476 ({ source }) => "block" !== source 7477 ) 7478 ]) 7479 ]) 7480 ) 7481 }; 7482 case "ADD_BLOCK_STYLES": 7483 const updatedStyles = {}; 7484 action.blockNames.forEach((blockName) => { 7485 updatedStyles[blockName] = getUniqueItemsByName([ 7486 ...state[blockName] ?? [], 7487 ...action.styles 7488 ]); 7489 }); 7490 return { ...state, ...updatedStyles }; 7491 case "REMOVE_BLOCK_STYLES": 7492 return { 7493 ...state, 7494 [action.blockName]: (state[action.blockName] ?? []).filter( 7495 (style) => action.styleNames.indexOf(style.name) === -1 7496 ) 7497 }; 7498 } 7499 return state; 7500} 7501function blockVariations(state = {}, action) { 7502 switch (action.type) { 7503 case "ADD_BLOCK_TYPES": 7504 return { 7505 ...state, 7506 ...Object.fromEntries( 7507 Object.entries( 7508 keyBlockTypesByName(action.blockTypes) 7509 ).map(([name, blockType]) => { 7510 return [ 7511 name, 7512 getUniqueItemsByName([ 7513 ...(blockType.variations ?? []).map( 7514 (variation) => ({ 7515 ...variation, 7516 source: "block" 7517 }) 7518 ),
7519 ...(state[blockType.name] ?? []).filter( 7520 ({ source }) => "block" !== source 7521 ) 7522 ]) 7523 ]; 7524 }) 7525 ) 7526 }; 7527 case "ADD_BLOCK_VARIATIONS": 7528 return { 7529 ...state, 7530 [action.blockName]: getUniqueItemsByName([ 7531 ...state[action.blockName] ?? [], 7532 ...action.variations 7533 ]) 7534 }; 7535 case "REMOVE_BLOCK_VARIATIONS": 7536 return { 7537 ...state, 7538 [action.blockName]: (state[action.blockName] ?? []).filter( 7539 (variation) => action.variationNames.indexOf(variation.name) === -1 7540 ) 7541 }; 7542 } 7543 return state; 7544} 7545function createBlockNameSetterReducer(setActionType) { 7546 return (state = null, action) => { 7547 switch (action.type) { 7548 case "REMOVE_BLOCK_TYPES": 7549 if (action.names.indexOf(state) !== -1) { 7550 return null; 7551 } 7552 return state; 7553 case setActionType: 7554 return action.name || null; 7555 } 7556 return state; 7557 }; 7558} 7559const defaultBlockName = createBlockNameSetterReducer( 7560 "SET_DEFAULT_BLOCK_NAME" 7561); 7562const freeformFallbackBlockName = createBlockNameSetterReducer( 7563 "SET_FREEFORM_FALLBACK_BLOCK_NAME" 7564); 7565const unregisteredFallbackBlockName = createBlockNameSetterReducer( 7566 "SET_UNREGISTERED_FALLBACK_BLOCK_NAME" 7567); 7568const groupingBlockName = createBlockNameSetterReducer( 7569 "SET_GROUPING_BLOCK_NAME" 7570); 7571function categories(state = DEFAULT_CATEGORIES, action) { 7572 switch (action.type) { 7573 case "SET_CATEGORIES": 7574 const uniqueCategories = /* @__PURE__ */ new Map(); 7575 (action.categories || []).forEach((category) => { 7576 uniqueCategories.set(category.slug, category); 7577 }); 7578 return [...uniqueCategories.values()]; 7579 case "UPDATE_CATEGORY": { 7580 if (!action.category || !Object.keys(action.category).length) { 7581 return state; 7582 } 7583 const categoryToChange = state.find( 7584 ({ slug }) => slug === action.slug 7585 ); 7586 if (categoryToChange) { 7587 return state.map((category) => { 7588 if (category.slug === action.slug) { 7589 return { 7590 ...category, 7591 ...action.category 7592 }; 7593 } 7594 return category; 7595 }); 7596 } 7597 } 7598 } 7599 return state; 7600} 7601function collections(state = {}, action) { 7602 switch (action.type) { 7603 case "ADD_BLOCK_COLLECTION": 7604 return { 7605 ...state, 7606 [action.namespace]: { 7607 title: action.title, 7608 icon: action.icon 7609 } 7610 }; 7611 case "REMOVE_BLOCK_COLLECTION": 7612 return omit(state, action.namespace); 7613 } 7614 return state; 7615} 7616function getMergedUsesContext(existingUsesContext = [], newUsesContext = []) { 7617 const mergedArrays = Array.from( 7618 new Set(existingUsesContext.concat(newUsesContext)) 7619 ); 7620 return mergedArrays.length > 0 ? mergedArrays : void 0; 7621} 7622function blockBindingsSources(state = {}, action) { 7623 switch (action.type) { 7624 case "ADD_BLOCK_BINDINGS_SOURCE": 7625 return { 7626 ...state, 7627 [action.name]: { 7628 label: action.label || state[action.name]?.label, 7629 usesContext: getMergedUsesContext( 7630 state[action.name]?.usesContext, 7631 action.usesContext 7632 ), 7633 getValues: action.getValues, 7634 setValues: action.setValues, 7635 // Only set `canUserEditValue` if `setValues` is also defined. 7636 canUserEditValue: action.setValues && action.canUserEditValue, 7637 getFieldsList: action.getFieldsList 7638 } 7639 }; 7640 case "REMOVE_BLOCK_BINDINGS_SOURCE": 7641 return omit(state, action.name); 7642 } 7643 return state; 7644} 7645var reducer_default = (0,external_wp_data_namespaceObject.combineReducers)({ 7646 bootstrappedBlockTypes, 7647 unprocessedBlockTypes, 7648 blockTypes, 7649 blockStyles, 7650 blockVariations, 7651 defaultBlockName, 7652 freeformFallbackBlockName, 7653 unregisteredFallbackBlockName, 7654 groupingBlockName, 7655 categories, 7656 collections, 7657 blockBindingsSources 7658}); 7659 7660 7661// EXTERNAL MODULE: ./node_modules/remove-accents/index.js 7662var remove_accents = __webpack_require__(9681); 7663var remove_accents_default = /*#__PURE__*/__webpack_require__.n(remove_accents); 7664;// ./node_modules/@wordpress/blocks/build-module/store/utils.js 7665const getValueFromObjectPath = (object, path, defaultValue) => { 7666 const normalizedPath = Array.isArray(path) ? path : path.split("."); 7667 let value = object; 7668 normalizedPath.forEach((fieldName) => { 7669 value = value?.[fieldName]; 7670 }); 7671 return value ?? defaultValue; 7672}; 7673function utils_isObject(candidate) { 7674 return typeof candidate === "object" && candidate.constructor === Object && candidate !== null; 7675} 7676function matchesAttributes(blockAttributes, variationAttributes) { 7677 if (utils_isObject(blockAttributes) && utils_isObject(variationAttributes)) { 7678 return Object.entries(variationAttributes).every( 7679 ([key, value]) => matchesAttributes(blockAttributes?.[key], value) 7680 ); 7681 } 7682 return blockAttributes === variationAttributes; 7683} 7684 7685 7686;// ./node_modules/@wordpress/blocks/build-module/store/private-selectors.js 7687 7688 7689 7690 7691 7692const ROOT_BLOCK_SUPPORTS = [ 7693 "background", 7694 "backgroundColor", 7695 "color", 7696 "linkColor", 7697 "captionColor", 7698 "buttonColor", 7699 "headingColor", 7700 "fontFamily", 7701 "fontSize", 7702 "fontStyle", 7703 "fontWeight", 7704 "lineHeight", 7705 "padding", 7706 "contentSize", 7707 "wideSize", 7708 "blockGap", 7709 "textDecoration", 7710 "textTransform", 7711 "letterSpacing" 7712]; 7713function filterElementBlockSupports(blockSupports, name, element) { 7714 return blockSupports.filter((support) => { 7715 if (support === "fontSize" && element === "heading") { 7716 return false;
7717 } 7718 if (support === "textDecoration" && !name && element !== "link") { 7719 return false; 7720 } 7721 if (support === "textTransform" && !name && !(["heading", "h1", "h2", "h3", "h4", "h5", "h6"].includes( 7722 element 7723 ) || element === "button" || element === "caption" || element === "text")) { 7724 return false; 7725 } 7726 if (support === "letterSpacing" && !name && !(["heading", "h1", "h2", "h3", "h4", "h5", "h6"].includes( 7727 element 7728 ) || element === "button" || element === "caption" || element === "text")) { 7729 return false; 7730 } 7731 if (support === "textColumns" && !name) { 7732 return false; 7733 } 7734 return true; 7735 }); 7736} 7737const getSupportedStyles = (0,external_wp_data_namespaceObject.createSelector)( 7738 (state, name, element) => { 7739 if (!name) { 7740 return filterElementBlockSupports( 7741 ROOT_BLOCK_SUPPORTS, 7742 name, 7743 element 7744 ); 7745 } 7746 const blockType = selectors_getBlockType(state, name); 7747 if (!blockType) { 7748 return []; 7749 } 7750 const supportKeys = []; 7751 if (blockType?.supports?.spacing?.blockGap) { 7752 supportKeys.push("blockGap"); 7753 } 7754 if (blockType?.supports?.shadow) { 7755 supportKeys.push("shadow"); 7756 } 7757 Object.keys(__EXPERIMENTAL_STYLE_PROPERTY).forEach((styleName) => { 7758 if (!__EXPERIMENTAL_STYLE_PROPERTY[styleName].support) { 7759 return; 7760 } 7761 if (__EXPERIMENTAL_STYLE_PROPERTY[styleName].requiresOptOut) { 7762 if (__EXPERIMENTAL_STYLE_PROPERTY[styleName].support[0] in blockType.supports && getValueFromObjectPath( 7763 blockType.supports, 7764 __EXPERIMENTAL_STYLE_PROPERTY[styleName].support 7765 ) !== false) { 7766 supportKeys.push(styleName); 7767 return; 7768 } 7769 } 7770 if (getValueFromObjectPath( 7771 blockType.supports, 7772 __EXPERIMENTAL_STYLE_PROPERTY[styleName].support, 7773 false 7774 )) { 7775 supportKeys.push(styleName); 7776 } 7777 }); 7778 return filterElementBlockSupports(supportKeys, name, element); 7779 }, 7780 (state, name) => [state.blockTypes[name]] 7781); 7782function getBootstrappedBlockType(state, name) { 7783 return state.bootstrappedBlockTypes[name]; 7784} 7785function getUnprocessedBlockTypes(state) { 7786 return state.unprocessedBlockTypes; 7787} 7788function getAllBlockBindingsSources(state) { 7789 return state.blockBindingsSources; 7790} 7791function private_selectors_getBlockBindingsSource(state, sourceName) { 7792 return state.blockBindingsSources[sourceName]; 7793} 7794const hasContentRoleAttribute = (state, blockTypeName) => { 7795 const blockType = selectors_getBlockType(state, blockTypeName); 7796 if (!blockType) { 7797 return false; 7798 } 7799 return Object.values(blockType.attributes).some( 7800 ({ role, __experimentalRole }) => { 7801 if (role === "content") { 7802 return true; 7803 } 7804 if (__experimentalRole === "content") { 7805 external_wp_deprecated_default()("__experimentalRole attribute", { 7806 since: "6.7", 7807 version: "6.8", 7808 alternative: "role attribute", 7809 hint: `Check the block.json of the ${blockTypeName} block.` 7810 }); 7811 return true; 7812 } 7813 return false; 7814 } 7815 ); 7816}; 7817 7818 7819;// ./node_modules/@wordpress/blocks/build-module/store/selectors.js 7820 7821 7822 7823 7824 7825 7826const getNormalizedBlockType = (state, nameOrType) => "string" === typeof nameOrType ? selectors_getBlockType(state, nameOrType) : nameOrType; 7827const selectors_getBlockTypes = (0,external_wp_data_namespaceObject.createSelector)( 7828 (state) => Object.values(state.blockTypes), 7829 (state) => [state.blockTypes] 7830); 7831function selectors_getBlockType(state, name) { 7832 return state.blockTypes[name]; 7833} 7834function getBlockStyles(state, name) { 7835 return state.blockStyles[name]; 7836} 7837const selectors_getBlockVariations = (0,external_wp_data_namespaceObject.createSelector)( 7838 (state, blockName, scope) => { 7839 const variations = state.blockVariations[blockName]; 7840 if (!variations || !scope) { 7841 return variations; 7842 } 7843 return variations.filter((variation) => { 7844 return (variation.scope || ["block", "inserter"]).includes( 7845 scope 7846 ); 7847 }); 7848 }, 7849 (state, blockName) => [state.blockVariations[blockName]] 7850); 7851function getActiveBlockVariation(state, blockName, attributes, scope) { 7852 const variations = selectors_getBlockVariations(state, blockName, scope); 7853 if (!variations) { 7854 return variations; 7855 } 7856 const blockType = selectors_getBlockType(state, blockName); 7857 const attributeKeys = Object.keys(blockType?.attributes || {}); 7858 let match; 7859 let maxMatchedAttributes = 0; 7860 for (const variation of variations) { 7861 if (Array.isArray(variation.isActive)) { 7862 const definedAttributes = variation.isActive.filter( 7863 (attribute) => { 7864 const topLevelAttribute = attribute.split(".")[0]; 7865 return attributeKeys.includes(topLevelAttribute); 7866 } 7867 ); 7868 const definedAttributesLength = definedAttributes.length; 7869 if (definedAttributesLength === 0) { 7870 continue; 7871 } 7872 const isMatch = definedAttributes.every((attribute) => { 7873 const variationAttributeValue = getValueFromObjectPath( 7874 variation.attributes, 7875 attribute 7876 ); 7877 if (variationAttributeValue === void 0) { 7878 return false;
7879 } 7880 let blockAttributeValue = getValueFromObjectPath( 7881 attributes, 7882 attribute 7883 ); 7884 if (blockAttributeValue instanceof external_wp_richText_namespaceObject.RichTextData) { 7885 blockAttributeValue = blockAttributeValue.toHTMLString(); 7886 } 7887 return matchesAttributes( 7888 blockAttributeValue, 7889 variationAttributeValue 7890 ); 7891 }); 7892 if (isMatch && definedAttributesLength > maxMatchedAttributes) { 7893 match = variation; 7894 maxMatchedAttributes = definedAttributesLength; 7895 } 7896 } else if (variation.isActive?.(attributes, variation.attributes)) { 7897 return match || variation; 7898 } 7899 } 7900 if (!match && ["block", "transform"].includes(scope)) { 7901 match = variations.find( 7902 (variation) => variation?.isDefault && !Object.hasOwn(variation, "isActive") 7903 ); 7904 } 7905 return match; 7906} 7907function getDefaultBlockVariation(state, blockName, scope) { 7908 const variations = selectors_getBlockVariations(state, blockName, scope); 7909 const defaultVariation = [...variations].reverse().find(({ isDefault }) => !!isDefault); 7910 return defaultVariation || variations[0]; 7911} 7912function getCategories(state) { 7913 return state.categories; 7914} 7915function getCollections(state) { 7916 return state.collections; 7917} 7918function selectors_getDefaultBlockName(state) { 7919 return state.defaultBlockName; 7920} 7921function getFreeformFallbackBlockName(state) { 7922 return state.freeformFallbackBlockName; 7923} 7924function getUnregisteredFallbackBlockName(state) { 7925 return state.unregisteredFallbackBlockName; 7926} 7927function selectors_getGroupingBlockName(state) { 7928 return state.groupingBlockName; 7929} 7930const selectors_getChildBlockNames = (0,external_wp_data_namespaceObject.createSelector)( 7931 (state, blockName) => { 7932 return selectors_getBlockTypes(state).filter((blockType) => { 7933 return blockType.parent?.includes(blockName); 7934 }).map(({ name }) => name); 7935 }, 7936 (state) => [state.blockTypes] 7937); 7938const selectors_getBlockSupport = (state, nameOrType, feature, defaultSupp
7938orts) => { 7939 const blockType = getNormalizedBlockType(state, nameOrType); 7940 if (!blockType?.supports) { 7941 return defaultSupports; 7942 } 7943 return getValueFromObjectPath( 7944 blockType.supports, 7945 feature, 7946 defaultSupports 7947 ); 7948}; 7949function selectors_hasBlockSupport(state, nameOrType, feature, defaultSupports) { 7950 return !!selectors_getBlockSupport(state, nameOrType, feature, defaultSupports); 7951} 7952function getNormalizedSearchTerm(term) { 7953 return remove_accents_default()(term ?? "").toLowerCase().trim(); 7954} 7955function isMatchingSearchTerm(state, nameOrType, searchTerm = "") { 7956 const blockType = getNormalizedBlockType(state, nameOrType); 7957 const normalizedSearchTerm = getNormalizedSearchTerm(searchTerm); 7958 const isSearchMatch = (candidate) => getNormalizedSearchTerm(candidate).includes(normalizedSearchTerm); 7959 return isSearchMatch(blockType.title) || blockType.keywords?.some(isSearchMatch) || isSearchMatch(blockType.category) || typeof blockType.description === "string" && isSearchMatch(blockType.description); 7960} 7961const selectors_hasChildBlocks = (state, blockName) => { 7962 return selectors_getChildBlockNames(state, blockName).length > 0; 7963}; 7964const selectors_hasChildBlocksWithInserterSupport = (state, blockName) => { 7965 return selectors_getChildBlockNames(state, blockName).some((childBlockName) => { 7966 return selectors_hasBlockSupport(state, childBlockName, "inserter", true); 7967 }); 7968}; 7969const __experimentalHasContentRoleAttribute = (...args) => { 7970 external_wp_deprecated_default()("__experimentalHasContentRoleAttribute", { 7971 since: "6.7", 7972 version: "6.8", 7973 hint: "This is a private selector." 7974 }); 7975 return hasContentRoleAttribute(...args); 7976}; 7977 7978 7979;// ./node_modules/is-plain-object/dist/is-plain-object.mjs 7980/*! 7981 * is-plain-object <https://github.com/jonschlinkert/is-plain-object> 7982 * 7983 * Copyright (c) 2014-2017, Jon Schlinkert. 7984 * Released under the MIT License. 7985 */ 7986 7987function is_plain_object_isObject(o) { 7988 return Object.prototype.toString.call(o) === '[object Object]'; 7989} 7990 7991function isPlainObject(o) { 7992 var ctor,prot; 7993 7994 if (is_plain_object_isObject(o) === false) return false; 7995 7996 // If has modified constructor 7997 ctor = o.constructor; 7998 if (ctor === undefined) return true; 7999 8000 // If has modified prototype 8001 prot = ctor.prototype; 8002 if (is_plain_object_isObject(prot) === false) return false; 8003 8004 // If constructor does not have an Object-specific method 8005 if (prot.hasOwnProperty('isPrototypeOf') === false) { 8006 return false; 8007 } 8008 8009 // Most likely a plain Object 8010 return true; 8011} 8012 8013 8014 8015// EXTERNAL MODULE: ./node_modules/react-is/index.js 8016var react_is = __webpack_require__(8529); 8017;// external ["wp","hooks"] 8018const external_wp_hooks_namespaceObject = window["wp"]["hooks"]; 8019;// ./node_modules/@wordpress/blocks/build-module/store/process-block-type.js 8020 8021 8022 8023 8024 8025 8026 8027const LEGACY_CATEGORY_MAPPING = { 8028 common: "text", 8029 formatting: "text", 8030 layout: "design" 8031}; 8032function mergeBlockVariations(bootstrappedVariations = [], clientVariations = []) { 8033 const result = [...bootstrappedVariations]; 8034 clientVariations.forEach((clientVariation) => { 8035 const index = result.findIndex( 8036 (bootstrappedVariation) => bootstrappedVariation.name === clientVariation.name 8037 ); 8038 if (index !== -1) { 8039 result[index] = { ...result[index], ...clientVariation }; 8040 } else { 8041 result.push(clientVariation); 8042 } 8043 }); 8044 return result; 8045} 8046const processBlockType = (name, blockSettings) => ({ select }) => { 8047 const bootstrappedBlockType = select.getBootstrappedBlockType(name); 8048 const blockType = { 8049 apiVersion: 1, 8050 name, 8051 icon: BLOCK_ICON_DEFAULT, 8052 keywords: [], 8053 attributes: {}, 8054 providesContext: {}, 8055 usesContext: [], 8056 selectors: {}, 8057 supports: {}, 8058 styles: [], 8059 blockHooks: {}, 8060 save: () => null, 8061 ...bootstrappedBlockType, 8062 ...blockSettings, 8063 // blockType.variations can be defined as a filePath. 8064 variations: mergeBlockVariations( 8065 Array.isArray(bootstrappedBlockType?.variations) ? bootstrappedBlockType.variations : [], 8066 Array.isArray(blockSettings?.variations) ? blockSettings.variations : [] 8067 ) 8068 }; 8069 const settings = (0,external_wp_hooks_namespaceObject.applyFilters)( 8070 "blocks.registerBlockType", 8071 blockType, 8072 name, 8073 null 8074 ); 8075 if (settings.apiVersion <= 2) { 8076 external_wp_deprecated_default()("Block with API version 2 or lower", { 8077 since: "6.9", 8078 hint: `The block "${name}" is registered with API version ${settings.apiVersion}. This means that the post editor may work as a non-iframe editor. 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.`, 8079 link: "https://developer.wordpress.org/block-editor/reference-guides/block-api/block-api-versions/block-migration-for-iframe-editor-compatibility/" 8080 }); 8081 } 8082 if (settings.description && typeof settings.description !== "string") { 8083 external_wp_deprecated_default()("Declaring non-string block descriptions", { 8084 since: "6.2" 8085 }); 8086 } 8087 if (settings.deprecated) { 8088 settings.deprecated = settings.deprecated.map( 8089 (deprecation) => Object.fromEntries( 8090 Object.entries( 8091 // Only keep valid deprecation keys. 8092 (0,external_wp_hooks_namespaceObject.applyFilters)( 8093 "blocks.registerBlockType", 8094 // Merge deprecation keys with pre-filter settings 8095 // so that filters that depend on specific keys being 8096 // present don't fail. 8097 { 8098 // Omit deprecation keys here so that deprecations 8099 // can opt out of specific keys like "supports". 8100 ...omit(blockType, DEPRECATED_ENTRY_KEYS), 8101 ...deprecation 8102 },
8103 blockType.name, 8104 deprecation 8105 ) 8106 ).filter( 8107 ([key]) => DEPRECATED_ENTRY_KEYS.includes(key) 8108 ) 8109 ) 8110 ); 8111 } 8112 if (!isPlainObject(settings)) { 8113 external_wp_warning_default()("Block settings must be a valid object."); 8114 return; 8115 } 8116 if (typeof settings.save !== "function") { 8117 external_wp_warning_default()('The "save" property must be a valid function.'); 8118 return; 8119 } 8120 if ("edit" in settings && !(0,react_is.isValidElementType)(settings.edit)) { 8121 external_wp_warning_default()('The "edit" property must be a valid component.'); 8122 return; 8123 } 8124 if (LEGACY_CATEGORY_MAPPING.hasOwnProperty(settings.category)) { 8125 settings.category = LEGACY_CATEGORY_MAPPING[settings.category]; 8126 } 8127 if ("category" in settings && !select.getCategories().some(({ slug }) => slug === settings.category)) { 8128 external_wp_warning_default()( 8129 'The block "' + name + '" is registered with an invalid category "' + settings.category + '".' 8130 ); 8131 delete settings.category; 8132 } 8133 if (!("title" in settings) || settings.title === "") { 8134 external_wp_warning_default()('The block "' + name + '" must have a title.'); 8135 return; 8136 } 8137 if (typeof settings.title !== "string") { 8138 external_wp_warning_default()("Block titles must be strings."); 8139 return; 8140 } 8141 settings.icon = normalizeIconObject(settings.icon); 8142 if (!isValidIcon(settings.icon.src)) { 8143 external_wp_warning_default()( 8144 "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" 8145 ); 8146 return; 8147 } 8148 if (typeof settings?.parent === "string" || settings?.parent instanceof String) { 8149 settings.parent = [settings.parent]; 8150 external_wp_warning_default()( 8151 "Parent must be undefined or an array of strings (block types), but it is a string." 8152 ); 8153 } 8154 if (!Array.isArray(settings?.parent) && settings?.parent !== void 0) { 8155 external_wp_warning_default()( 8156 "Parent must be undefined or an array of block types, but it is ", 8157 settings.parent 8158 ); 8159 return; 8160 } 8161 if (1 === settings?.parent?.length && name === settings.parent[0]) { 8162 external_wp_warning_default()( 8163 'Block "' + name + '" cannot be a parent of itself. Please remove the block name from the parent list.' 8164 ); 8165 return; 8166 } 8167 return settings; 8168}; 8169 8170 8171;// ./node_modules/@wordpress/blocks/build-module/store/actions.js 8172 8173 8174function addBlockTypes(blockTypes) { 8175 return { 8176 type: "ADD_BLOCK_TYPES", 8177 blockTypes: Array.isArray(blockTypes) ? blockTypes : [blockTypes] 8178 }; 8179} 8180function reapplyBlockTypeFilters() { 8181 return ({ dispatch, select }) => { 8182 const processedBlockTypes = []; 8183 for (const [name, settings] of Object.entries( 8184 select.getUnprocessedBlockTypes() 8185 )) { 8186 const result = dispatch(processBlockType(name, settings)); 8187 if (result) { 8188 processedBlockTypes.push(result); 8189 } 8190 } 8191 if (!processedBlockTypes.length) { 8192 return; 8193 } 8194 dispatch.addBlockTypes(processedBlockTypes); 8195 }; 8196} 8197function __experimentalReapplyBlockFilters() { 8198 external_wp_deprecated_default()( 8199 'wp.data.dispatch( "core/blocks" ).__experimentalReapplyBlockFilters', 8200 { 8201 since: "6.4", 8202 alternative: "reapplyBlockFilters" 8203 } 8204 ); 8205 return reapplyBlockTypeFilters(); 8206} 8207function removeBlockTypes(names) { 8208 return { 8209 type: "REMOVE_BLOCK_TYPES", 8210 names: Array.isArray(names) ? names : [names] 8211 }; 8212} 8213function addBlockStyles(blockNames, styles) { 8214 return { 8215 type: "ADD_BLOCK_STYLES", 8216 styles: Array.isArray(styles) ? styles : [styles], 8217 blockNames: Array.isArray(blockNames) ? blockNames : [blockNames] 8218 }; 8219} 8220function removeBlockStyles(blockName, styleNames) { 8221 return { 8222 type: "REMOVE_BLOCK_STYLES", 8223 styleNames: Array.isArray(styleNames) ? styleNames : [styleNames], 8224 blockName 8225 }; 8226} 8227function addBlockVariations(blockName, variations) { 8228 return { 8229 type: "ADD_BLOCK_VARIATIONS", 8230 variations: Array.isArray(variations) ? variations : [variations], 8231 blockName 8232 }; 8233} 8234function removeBlockVariations(blockName, variationNames) { 8235 return { 8236 type: "REMOVE_BLOCK_VARIATIONS", 8237 variationNames: Array.isArray(variationNames) ? variationNames : [variationNames], 8238 blockName 8239 }; 8240} 8241function actions_setDefaultBlockName(name) { 8242 return { 8243 type: "SET_DEFAULT_BLOCK_NAME", 8244 name 8245 }; 8246} 8247function setFreeformFallbackBlockName(name) { 8248 return { 8249 type: "SET_FREEFORM_FALLBACK_BLOCK_NAME", 8250 name 8251 }; 8252} 8253function setUnregisteredFallbackBlockName(name) { 8254 return { 8255 type: "SET_UNREGISTERED_FALLBACK_BLOCK_NAME", 8256 name 8257 }; 8258} 8259function actions_setGroupingBlockName(name) { 8260 return { 8261 type: "SET_GROUPING_BLOCK_NAME", 8262 name 8263 }; 8264} 8265function setCategories(categories) { 8266 return { 8267 type: "SET_CATEGORIES", 8268 categories 8269 }; 8270} 8271function updateCategory(slug, category) { 8272 return { 8273 type: "UPDATE_CATEGORY", 8274 slug, 8275 category 8276 }; 8277} 8278function addBlockCollection(namespace, title, icon) { 8279 return { 8280 type: "ADD_BLOCK_COLLECTION", 8281 namespace, 8282 title, 8283 icon 8284 }; 8285} 8286function removeBlockCollection(namespace) { 8287 return { 8288 type: "REMOVE_BLOCK_COLLECTION", 8289 namespace 8290 }; 8291} 8292 8293 8294;// ./node_modules/@wordpress/blocks/build-module/store/private-actions.js 8295 8296function addBootstrappedBlockType(name, blockType) { 8297 return { 8298 type: "ADD_BOOTSTRAPPED_BLOCK_TYPE", 8299 name, 8300 blockType 8301 }; 8302} 8303function addUnprocessedBlockType(name, blockType) { 8304 return ({ dispatch }) => { 8305 dispatch({ type: "ADD_UNPROCESSED_BLOCK_TYPE", name, blockType }); 8306 const processedBlockType = dispatch( 8307 processBlockType(name, blockType) 8308 ); 8309 if (!processedBlockType) { 8310 return; 8311 } 8312 dispatch.addBlockTypes(processedBlockType); 8313 }; 8314} 8315function addBlockBindingsSource(source) { 8316 return { 8317 type: "ADD_BLOCK_BINDINGS_SOURCE", 8318 name: source.name,
8319 label: source.label, 8320 usesContext: source.usesContext, 8321 getValues: source.getValues, 8322 setValues: source.setValues, 8323 canUserEditValue: source.canUserEditValue, 8324 getFieldsList: source.getFieldsList 8325 }; 8326} 8327function removeBlockBindingsSource(name) { 8328 return { 8329 type: "REMOVE_BLOCK_BINDINGS_SOURCE", 8330 name 8331 }; 8332} 8333 8334 8335;// ./node_modules/@wordpress/blocks/build-module/store/constants.js 8336const STORE_NAME = "core/blocks"; 8337 8338 8339;// ./node_modules/@wordpress/blocks/build-module/store/index.js 8340 8341 8342 8343 8344 8345 8346 8347 8348const store = (0,external_wp_data_namespaceObject.createReduxStore)(STORE_NAME, { 8349 reducer: reducer_default, 8350 selectors: selectors_namespaceObject, 8351 actions: actions_namespaceObject 8352}); 8353(0,external_wp_data_namespaceObject.register)(store); 8354unlock(store).registerPrivateSelectors(private_selectors_namespaceObject); 8355unlock(store).registerPrivateActions(private_actions_namespaceObject); 8356 8357 8358;// ./node_modules/@wordpress/blocks/node_modules/uuid/dist/esm-browser/native.js 8359const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto); 8360/* harmony default export */ const esm_browser_native = ({ 8361 randomUUID 8362}); 8363;// ./node_modules/@wordpress/blocks/node_modules/uuid/dist/esm-browser/rng.js 8364// Unique ID creation requires a high quality random # generator. In the browser we therefore 8365// require the crypto API and do not support built-in fallback to lower quality random number 8366// generators (like Math.random()). 8367let getRandomValues; 8368const rnds8 = new Uint8Array(16); 8369function rng() { 8370 // lazy load so that environments that need to polyfill have a chance to do so 8371 if (!getRandomValues) { 8372 // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation. 8373 getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto); 8374 8375 if (!getRandomValues) { 8376 throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported'); 8377 } 8378 } 8379 8380 return getRandomValues(rnds8); 8381} 8382;// ./node_modules/@wordpress/blocks/node_modules/uuid/dist/esm-browser/stringify.js 8383 8384/** 8385 * Convert array of 16 byte values to UUID string format of the form: 8386 * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX 8387 */ 8388 8389const byteToHex = []; 8390 8391for (let i = 0; i < 256; ++i) { 8392 byteToHex.push((i + 0x100).toString(16).slice(1)); 8393} 8394 8395function unsafeStringify(arr, offset = 0) { 8396 // Note: Be careful editing this code! It's been tuned for performance 8397 // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434 8398 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]]; 8399} 8400 8401function stringify(arr, offset = 0) { 8402 const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID. If this throws, it's likely due to one 8403 // of the following: 8404 // - One or more input array values don't map to a hex octet (leading to 8405 // "undefined" in the uuid) 8406 // - Invalid input values for the RFC `version` or `variant` fields 8407 8408 if (!validate(uuid)) { 8409 throw TypeError('Stringified UUID is invalid'); 8410 } 8411 8412 return uuid; 8413} 8414 8415/* harmony default export */ const esm_browser_stringify = ((/* unused pure expression or super */ null && (stringify))); 8416;// ./node_modules/@wordpress/blocks/node_modules/uuid/dist/esm-browser/v4.js 8417 8418 8419 8420 8421function v4(options, buf, offset) { 8422 if (esm_browser_native.randomUUID && !buf && !options) { 8423 return esm_browser_native.randomUUID(); 8424 } 8425 8426 options = options || {}; 8427 const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` 8428 8429 rnds[6] = rnds[6] & 0x0f | 0x40; 8430 rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided 8431 8432 if (buf) { 8433 offset = offset || 0; 8434 8435 for (let i = 0; i < 16; ++i) { 8436 buf[offset + i] = rnds[i]; 8437 } 8438 8439 return buf; 8440 } 8441 8442 return unsafeStringify(rnds); 8443} 8444 8445/* harmony default export */ const esm_browser_v4 = (v4); 8446;// ./node_modules/@wordpress/blocks/build-module/api/factory.js 8447 8448 8449 8450 8451function createBlock(name, attributes = {}, innerBlocks = []) { 8452 if (!isBlockRegistered(name)) { 8453 return createBlock("core/missing", { 8454 originalName: name, 8455 originalContent: "", 8456 originalUndelimitedContent: "" 8457 }); 8458 } 8459 const sanitizedAttributes = __experimentalSanitizeBlockAttributes( 8460 name, 8461 attributes 8462 ); 8463 const clientId = esm_browser_v4(); 8464 return { 8465 clientId, 8466 name, 8467 isValid: true, 8468 attributes: sanitizedAttributes, 8469 innerBlocks 8470 }; 8471} 8472function createBlocksFromInnerBlocksTemplate(innerBlocksOrTemplate = []) { 8473 return innerBlocksOrTemplate.map((innerBlock) => { 8474 const innerBlockTemplate = Array.isArray(innerBlock) ? innerBlock : [ 8475 innerBlock.name, 8476 innerBlock.attributes, 8477 innerBlock.innerBlocks 8478 ]; 8479 const [name, attributes, innerBlocks = []] = innerBlockTemplate; 8480 return createBlock( 8481 name, 8482 attributes, 8483 createBlocksFromInnerBlocksTemplate(innerBlocks) 8484 ); 8485 }); 8486} 8487function __experimentalCloneSanitizedBlock(block, mergeAttributes = {}, newInnerBlocks) { 8488 const { name } = block; 8489 if (!isBlockRegistered(name)) { 8490 return createBlock("core/missing", { 8491 originalName: name, 8492 originalContent: "", 8493 originalUndelimitedContent: "" 8494 }); 8495 } 8496 const clientId = esm_browser_v4(); 8497 const sanitizedAttributes = __experimentalSanitizeBlockAttributes(name, { 8498 ...block.attributes, 8499 ...mergeAttributes 8500 }); 8501 return { 8502 ...block, 8503 clientId, 8504 attributes: sanitizedAttributes, 8505 innerBlocks: newInnerBlocks || block.innerBlocks.map( 8506 (innerBlock) => __experimentalCloneSanitizedBlock(innerBlock) 8507 ) 8508 }; 8509} 8510function cloneBlock(block, mergeAttributes = {}, newInnerBlocks) { 8511 const clientId = esm_browser_v4(); 8512 return { 8513 ...block, 8514 clientId, 8515 attributes: { 8516 ...block.attributes, 8517 ...mergeAttributes 8518 }, 8519 innerBlocks: newInnerBlocks || block.innerBlocks.map((innerBlock) => cloneBlock(innerBlock)) 8520 }; 8521} 8522const isPossibleTransformForSource = (transform, direction, blocks) => { 8523 if (!blocks.length) { 8524 return false;
8525 } 8526 const isMultiBlock = blocks.length > 1; 8527 const firstBlockName = blocks[0].name; 8528 const isValidForMultiBlocks = isWildcardBlockTransform(transform) || !isMultiBlock || transform.isMultiBlock; 8529 if (!isValidForMultiBlocks) { 8530 return false; 8531 } 8532 if (!isWildcardBlockTransform(transform) && !blocks.every((block) => block.name === firstBlockName)) { 8533 return false; 8534 } 8535 const isBlockType = transform.type === "block"; 8536 if (!isBlockType) { 8537 return false; 8538 } 8539 const sourceBlock = blocks[0]; 8540 const hasMatchingName = direction !== "from" || transform.blocks.indexOf(sourceBlock.name) !== -1 || isWildcardBlockTransform(transform); 8541 if (!hasMatchingName) { 8542 return false; 8543 } 8544 if (!isMultiBlock && direction === "from" && isContainerGroupBlock(sourceBlock.name) && isContainerGroupBlock(transform.blockName)) { 8545 return false; 8546 } 8547 if (!maybeCheckTransformIsMatch(transform, blocks)) { 8548 return false; 8549 } 8550 return true; 8551}; 8552const getBlockTypesForPossibleFromTransforms = (blocks) => { 8553 if (!blocks.length) { 8554 return []; 8555 } 8556 const allBlockTypes = getBlockTypes(); 8557 const blockTypesWithPossibleFromTransforms = allBlockTypes.filter( 8558 (blockType) => { 8559 const fromTransforms = getBlockTransforms("from", blockType.name); 8560 return !!findTransform(fromTransforms, (transform) => { 8561 return isPossibleTransformForSource( 8562 transform, 8563 "from", 8564 blocks 8565 ); 8566 }); 8567 } 8568 ); 8569 return blockTypesWithPossibleFromTransforms; 8570}; 8571const getBlockTypesForPossibleToTransforms = (blocks) => { 8572 if (!blocks.length) { 8573 return []; 8574 } 8575 const sourceBlock = blocks[0]; 8576 const blockType = getBlockType(sourceBlock.name); 8577 const transformsTo = blockType ? getBlockTransforms("to", blockType.name) : []; 8578 const possibleTransforms = transformsTo.filter((transform) => { 8579 return transform && isPossibleTransformForSource(transform, "to", blocks); 8580 }); 8581 const blockNames = possibleTransforms.map((transformation) => transformation.blocks).flat(); 8582 return blockNames.map(getBlockType); 8583}; 8584const isWildcardBlockTransform = (t) => t && t.type === "block" && Array.isArray(t.blocks) && t.blocks.includes("*"); 8585const isContainerGroupBlock = (name) => name === getGroupingBlockName(); 8586function getPossibleBlockTransformations(blocks) { 8587 if (!blocks.length) { 8588 return []; 8589 } 8590 const blockTypesForFromTransforms = getBlockTypesForPossibleFromTransforms(blocks); 8591 const blockTypesForToTransforms = getBlockTypesForPossibleToTransforms(blocks); 8592 return [ 8593 .../* @__PURE__ */ new Set([ 8594 ...blockTypesForFromTransforms, 8595 ...blockTypesForToTransforms 8596 ]) 8597 ]; 8598} 8599function findTransform(transforms, predicate) { 8600 const hooks = (0,external_wp_hooks_namespaceObject.createHooks)(); 8601 for (let i = 0; i < transforms.length; i++) { 8602 const candidate = transforms[i]; 8603 if (predicate(candidate)) { 8604 hooks.addFilter( 8605 "transform", 8606 "transform/" + i.toString(), 8607 (result) => result ? result : candidate, 8608 candidate.priority 8609 ); 8610 } 8611 } 8612 return hooks.applyFilters("transform", null); 8613} 8614function getBlockTransforms(direction, blockTypeOrName) { 8615 if (blockTypeOrName === void 0) { 8616 return getBlockTypes().map(({ name }) => getBlockTransforms(direction, name)).flat(); 8617 } 8618 const blockType = normalizeBlockType(blockTypeOrName); 8619 const { name: blockName, transforms } = blockType || {}; 8620 if (!transforms || !Array.isArray(transforms[direction])) { 8621 return []; 8622 } 8623 const usingMobileTransformations = transforms.supportedMobileTransforms && Array.isArray(transforms.supportedMobileTransforms); 8624 const filteredTransforms = usingMobileTransformations ? transforms[direction].filter((t) => { 8625 if (t.type === "raw") { 8626 return true; 8627 } 8628 if (t.type === "prefix") { 8629 return true; 8630 } 8631 if (!t.blocks || !t.blocks.length) { 8632 return false; 8633 } 8634 if (isWildcardBlockTransform(t)) { 8635 return true; 8636 } 8637 return t.blocks.every( 8638 (transformBlockName) => transforms.supportedMobileTransforms.includes( 8639 transformBlockName 8640 ) 8641 ); 8642 }) : transforms[direction]; 8643 return filteredTransforms.map((transform) => ({ 8644 ...transform, 8645 blockName, 8646 usingMobileTransformations 8647 })); 8648} 8649function maybeCheckTransformIsMatch(transform, blocks) { 8650 if (typeof transform.isMatch !== "function") { 8651 return true; 8652 } 8653 const sourceBlock = blocks[0]; 8654 const attributes = transform.isMultiBlock ? blocks.map((block2) => block2.attributes) : sourceBlock.attributes; 8655 const block = transform.isMultiBlock ? blocks : sourceBlock; 8656 return transform.isMatch(attributes, block); 8657} 8658function switchToBlockType(blocks, name) { 8659 const blocksArray = Array.isArray(blocks) ? blocks : [blocks]; 8660 const isMultiBlock = blocksArray.length > 1; 8661 const firstBlock = blocksArray[0]; 8662 const sourceName = firstBlock.name; 8663 const transformationsFrom = getBlockTransforms("from", name); 8664 const transformationsTo = getBlockTransforms("to", sourceName); 8665 const transformation = findTransform( 8666 transformationsTo, 8667 (t) => t.type === "block" && (isWildcardBlockTransform(t) || t.blocks.indexOf(name) !== -1) && (!isMultiBlock || t.isMultiBlock) && maybeCheckTransformIsMatch(t, blocksArray) 8668 ) || findTransform( 8669 transformationsFrom, 8670 (t) => t.type === "block" && (isWildcardBlockTransform(t) || t.blocks.indexOf(sourceName) !== -1) && (!isMultiBlock || t.isMultiBlock) && maybeCheckTransformIsMatch(t, blocksArray) 8671 ); 8672 if (!transformation) { 8673 return null; 8674 } 8675 let transformationResults; 8676 if (transformation.isMultiBlock) { 8677 if ("__experimentalConvert" in transformation) { 8678 transformationResults = transformation.__experimentalConvert(blocksArray); 8679 } else { 8680 transformationResults = transformation.transform( 8681 blocksArray.map((currentBlock) => currentBlock.attributes), 8682 blocksArray.map((currentBlock) => currentBlock.innerBlocks) 8683 ); 8684 } 8685 } else if ("__experimentalConvert" in transformation) { 8686 transformationResults = transformation.__experimentalConvert(firstBlock); 8687 } else { 8688 transformationResults = transformation.transform( 8689 firstBlock.attributes, 8690 firstBlock.innerBlocks 8691 ); 8692 } 8693 if (transformationResults === null || typeof transformationResults !== "object") { 8694 return null; 8695 } 8696 transformationResults = Array.isArray(transformationResults) ? transformationResults : [transformationResults]; 8697 if (transformationResults.some( 8698 (result) => !getBlockType(result.name) 8699 )) { 8700 return null; 8701 } 8702 const hasSwitchedBlock = transformationResults.some( 8703 (result) => result.name === name 8704 ); 8705 if (!hasSwitchedBlock) { 8706 return null; 8707 } 8708 const ret = transformationResults.map((result, index, results) => { 8709 return (0,external_wp_hooks_namespaceObject.applyFilters)( 8710 "blocks.switchToBlockType.transformedBlock", 8711 result, 8712 blocks, 8713 index, 8714 results 8715 ); 8716 }); 8717 return ret; 8718} 8719const getBlockFromExample = (name, example) => createBlock( 8720 name, 8721 example.attributes, 8722 (example.innerBlocks ?? []).map( 8723 (innerBlock) => getBlockFromExample(innerBlock.name, innerBlock) 8724 ) 8725); 8726 8727 8728;
8728// external ["wp","blockSerializationDefaultParser"] 8729const external_wp_blockSerializationDefaultParser_namespaceObject = window["wp"]["blockSerializationDefaultParser"]; 8730;// external ["wp","autop"] 8731const external_wp_autop_namespaceObject = window["wp"]["autop"]; 8732;// external "ReactJSXRuntime" 8733const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"]; 8734;// external ["wp","isShallowEqual"] 8735const external_wp_isShallowEqual_namespaceObject = window["wp"]["isShallowEqual"]; 8736var external_wp_isShallowEqual_default = /*#__PURE__*/__webpack_require__.n(external_wp_isShallowEqual_namespaceObject); 8737;// ./node_modules/@wordpress/blocks/build-module/api/parser/serialize-raw-block.js 8738 8739function serializeRawBlock(rawBlock, options = {}) { 8740 const { isCommentDelimited = true } = options; 8741 const { 8742 blockName, 8743 attrs = {}, 8744 innerBlocks = [], 8745 innerContent = [] 8746 } = rawBlock; 8747 let childIndex = 0; 8748 const content = innerContent.map( 8749 (item) => ( 8750 // `null` denotes a nested block, otherwise we have an HTML fragment. 8751 item !== null ? item : serializeRawBlock(innerBlocks[childIndex++], options) 8752 ) 8753 ).join("\n").replace(/\n+/g, "\n").trim(); 8754 return isCommentDelimited ? getCommentDelimitedContent(blockName, attrs, content) : content; 8755} 8756 8757 8758;// ./node_modules/@wordpress/blocks/build-module/api/serializer.js 8759 8760 8761 8762 8763 8764 8765 8766 8767 8768function getBlockDefaultClassName(blockName) { 8769 const className = "wp-block-" + blockName.replace(/\//, "-").replace(/^core-/, ""); 8770 return (0,external_wp_hooks_namespaceObject.applyFilters)( 8771 "blocks.getBlockDefaultClassName", 8772 className, 8773 blockName 8774 ); 8775} 8776function getBlockMenuDefaultClassName(blockName) { 8777 const className = "editor-block-list-item-" + blockName.replace(/\//, "-").replace(/^core-/, ""); 8778 return (0,external_wp_hooks_namespaceObject.applyFilters)( 8779 "blocks.getBlockMenuDefaultClassName", 8780 className, 8781 blockName 8782 ); 8783} 8784const blockPropsProvider = {}; 8785const innerBlocksPropsProvider = {}; 8786function getBlockProps(props = {}) { 8787 const { blockType, attributes } = blockPropsProvider; 8788 return getBlockProps.skipFilters ? props : (0,external_wp_hooks_namespaceObject.applyFilters)( 8789 "blocks.getSaveContent.extraProps", 8790 { ...props }, 8791 blockType, 8792 attributes 8793 ); 8794} 8795function getInnerBlocksProps(props = {}) { 8796 const { innerBlocks } = innerBlocksPropsProvider; 8797 if (!Array.isArray(innerBlocks)) { 8798 return { ...props, children: innerBlocks }; 8799 } 8800 const html = serialize(innerBlocks, { isInnerBlocks: true }); 8801 const children = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_element_namespaceObject.RawHTML, { children: html }); 8802 return { ...props, children }; 8803} 8804function getSaveElement(blockTypeOrName, attributes, innerBlocks = []) { 8805 const blockType = normalizeBlockType(blockTypeOrName); 8806 if (!blockType?.save) { 8807 return null; 8808 } 8809 let { save } = blockType; 8810 if (save.prototype instanceof external_wp_element_namespaceObject.Component) { 8811 const instance = new save({ attributes }); 8812 save = instance.render.bind(instance); 8813 } 8814 blockPropsProvider.blockType = blockType; 8815 blockPropsProvider.attributes = attributes; 8816 innerBlocksPropsProvider.innerBlocks = innerBlocks; 8817 let element = save({ attributes, innerBlocks }); 8818 if (element !== null && typeof element === "object" && (0,external_wp_hooks_namespaceObject.hasFilter)("blocks.getSaveContent.extraProps") && !(blockType.apiVersion > 1)) { 8819 const props = (0,external_wp_hooks_namespaceObject.applyFilters)( 8820 "blocks.getSaveContent.extraProps", 8821 { ...element.props }, 8822 blockType, 8823 attributes 8824 ); 8825 if (!external_wp_isShallowEqual_default()(props, element.props)) { 8826 element = (0,external_wp_element_namespaceObject.cloneElement)(element, props); 8827 } 8828 } 8829 return (0,external_wp_hooks_namespaceObject.applyFilters)( 8830 "blocks.getSaveElement", 8831 element, 8832 blockType, 8833 attributes 8834 ); 8835} 8836function getSaveContent(blockTypeOrName, attributes, innerBlocks) { 8837 const blockType = normalizeBlockType(blockTypeOrName); 8838 return (0,external_wp_element_namespaceObject.renderToString)( 8839 getSaveElement(blockType, attributes, innerBlocks) 8840 ); 8841} 8842function getCommentAttributes(blockType, attributes) { 8843 return Object.entries(blockType.attributes ?? {}).reduce(
8844 (accumulator, [key, attributeSchema]) => { 8845 const value = attributes[key]; 8846 if (void 0 === value) { 8847 return accumulator; 8848 } 8849 if (attributeSchema.source !== void 0) { 8850 return accumulator; 8851 } 8852 if (attributeSchema.role === "local") { 8853 return accumulator; 8854 } 8855 if (attributeSchema.__experimentalRole === "local") { 8856 external_wp_deprecated_default()("__experimentalRole attribute", { 8857 since: "6.7", 8858 version: "6.8", 8859 alternative: "role attribute", 8860 hint: `Check the block.json of the ${blockType?.name} block.` 8861 }); 8862 return accumulator; 8863 } 8864 if ("default" in attributeSchema && JSON.stringify(attributeSchema.default) === JSON.stringify(value)) { 8865 return accumulator; 8866 } 8867 accumulator[key] = value; 8868 return accumulator; 8869 }, 8870 {} 8871 ); 8872} 8873function serializeAttributes(attributes) { 8874 return JSON.stringify(attributes).replaceAll("\\\\", "\\u005c").replaceAll("--", "\\u002d\\u002d").replaceAll("<", "\\u003c").replaceAll(">", "\\u003e").replaceAll("&", "\\u0026").replaceAll('\\"', "\\u0022"); 8875} 8876function getBlockInnerHTML(block) { 8877 let saveContent = block.originalContent; 8878 if (block.isValid || block.innerBlocks.length) { 8879 try { 8880 saveContent = getSaveContent( 8881 block.name, 8882 block.attributes, 8883 block.innerBlocks 8884 ); 8885 } catch (error) { 8886 } 8887 } 8888 return saveContent; 8889} 8890function getCommentDelimitedContent(rawBlockName, attributes, content) { 8891 const serializedAttributes = attributes && Object.entries(attributes).length ? serializeAttributes(attributes) + " " : ""; 8892 const blockName = rawBlockName?.startsWith("core/") ? rawBlockName.slice(5) : rawBlockName; 8893 if (!content) { 8894 return `<!-- wp:${blockName} ${serializedAttributes}/-->`; 8895 } 8896 return `<!-- wp:${blockName} ${serializedAttributes}--> 8897` + content + ` 8898<!-- /wp:${blockName} -->`; 8899} 8900function serializeBlock(block, { isInnerBlocks = false } = {}) { 8901 if (!block.isValid && block.__unstableBlockSource) { 8902 return serializeRawBlock(block.__unstableBlockSource); 8903 } 8904 const blockName = block.name; 8905 const saveContent = getBlockInnerHTML(block); 8906 if (blockName === getUnregisteredTypeHandlerName() || !isInnerBlocks && blockName === getFreeformContentHandlerName()) { 8907 return saveContent; 8908 } 8909 const blockType = getBlockType(blockName); 8910 if (!blockType) { 8911 return saveContent; 8912 } 8913 const saveAttributes = getCommentAttributes(blockType, block.attributes); 8914 return getCommentDelimitedContent(blockName, saveAttributes, saveContent); 8915} 8916function __unstableSerializeAndClean(blocks) { 8917 if (blocks.length === 1 && isUnmodifiedDefaultBlock(blocks[0])) { 8918 blocks = []; 8919 } 8920 let content = serialize(blocks); 8921 if (blocks.length === 1 && blocks[0].name === getFreeformContentHandlerName() && blocks[0].name === "core/freeform") { 8922 content = (0,external_wp_autop_namespaceObject.removep)(content); 8923 } 8924 return content; 8925} 8926function serialize(blocks, options) { 8927 const blocksArray = Array.isArray(blocks) ? blocks : [blocks]; 8928 return blocksArray.map((block) => serializeBlock(block, options)).join("\n\n"); 8929} 8930 8931 8932;// ./node_modules/simple-html-tokenizer/dist/es6/index.js 8933/** 8934 * generated from https://raw.githubusercontent.com/w3c/html/26b5126f96f736f796b9e29718138919dd513744/entities.json 8935 * do not edit 8936 */ 8937var namedCharRefs = { 8938 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: "â©",
8938capcap: "â©", 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
8938: "ϵ", 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: "ï¬", fflig: "ï¬", ffllig: "ï¬", Ffr: "ð", ffr: "ð£", filig: "ï¬", FilledSmallSquare: "â¼", FilledVerySmallSquare: "âª", fjlig: "fj", flat: "â", fllig: "ï¬", 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
8938: "Ä»", 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: "Å", 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
8938: "â®", 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: "%", peri
8938od: ".", 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: "â¿", tri
vendor: 30,673 bytes, lines 8938-9573
8938angleleft: "â", 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" 8939}; 8940 8941var HEXCHARCODE = /^#[xX]([A-Fa-f0-9]+)$/; 8942var CHARCODE = /^#([0-9]+)$/; 8943var NAMED = /^([A-Za-z0-9]+)$/; 8944var EntityParser = /** @class */ (function () { 8945 function EntityParser(named) { 8946 this.named = named; 8947 } 8948 EntityParser.prototype.parse = function (entity) { 8949 if (!entity) { 8950 return; 8951 } 8952 var matches = entity.match(HEXCHARCODE); 8953 if (matches) { 8954 return String.fromCharCode(parseInt(matches[1], 16)); 8955 } 8956 matches = entity.match(CHARCODE); 8957 if (matches) { 8958 return String.fromCharCode(parseInt(matches[1], 10)); 8959 } 8960 matches = entity.match(NAMED); 8961 if (matches) { 8962 return this.named[matches[1]]; 8963 } 8964 }; 8965 return EntityParser; 8966}()); 8967 8968var WSP = /[\t\n\f ]/; 8969var ALPHA = /[A-Za-z]/; 8970var CRLF = /\r\n?/g; 8971function isSpace(char) { 8972 return WSP.test(char); 8973} 8974function isAlpha(char) { 8975 return ALPHA.test(char); 8976} 8977function preprocessInput(input) { 8978 return input.replace(CRLF, '\n'); 8979} 8980 8981var EventedTokenizer = /** @class */ (function () { 8982 function EventedTokenizer(delegate, entityParser, mode) { 8983 if (mode === void 0) { mode = 'precompile'; } 8984 this.delegate = delegate; 8985 this.entityParser = entityParser; 8986 this.mode = mode; 8987 this.state = "beforeData" /* beforeData */; 8988 this.line = -1; 8989 this.column = -1; 8990 this.input = ''; 8991 this.index = -1; 8992 this.tagNameBuffer = ''; 8993 this.states = { 8994 beforeData: function () { 8995 var char = this.peek(); 8996 if (char === '<' && !this.isIgnoredEndTag()) { 8997 this.transitionTo("tagOpen" /* tagOpen */); 8998 this.markTagStart(); 8999 this.consume(); 9000 } 9001 else { 9002 if (this.mode === 'precompile' && char === '\n') { 9003 var tag = this.tagNameBuffer.toLowerCase(); 9004 if (tag === 'pre' || tag === 'textarea') { 9005 this.consume(); 9006 } 9007 } 9008 this.transitionTo("data" /* data */); 9009 this.delegate.beginData(); 9010 } 9011 }, 9012 data: function () { 9013 var char = this.peek(); 9014 var tag = this.tagNameBuffer; 9015 if (char === '<' && !this.isIgnoredEndTag()) { 9016 this.delegate.finishData(); 9017 this.transitionTo("tagOpen" /* tagOpen */); 9018 this.markTagStart(); 9019 this.consume(); 9020 } 9021 else if (char === '&' && tag !== 'script' && tag !== 'style') { 9022 this.consume(); 9023 this.delegate.appendToData(this.consumeCharRef() || '&'); 9024 } 9025 else { 9026 this.consume(); 9027 this.delegate.appendToData(char); 9028 } 9029 }, 9030 tagOpen: function () { 9031 var char = this.consume(); 9032 if (char === '!') { 9033 this.transitionTo("markupDeclarationOpen" /* markupDeclarationOpen */); 9034 } 9035 else if (char === '/') { 9036 this.transitionTo("endTagOpen" /* endTagOpen */); 9037 } 9038 else if (char === '@' || char === ':' || isAlpha(char)) { 9039 this.transitionTo("tagName" /* tagName */); 9040 this.tagNameBuffer = ''; 9041 this.delegate.beginStartTag(); 9042 this.appendToTagName(char); 9043 } 9044 }, 9045 markupDeclarationOpen: function () { 9046 var char = this.consume(); 9047 if (char === '-' && this.peek() === '-') { 9048 this.consume(); 9049 this.transitionTo("commentStart" /* commentStart */); 9050 this.delegate.beginComment(); 9051 } 9052 else { 9053 var maybeDoctype = char.toUpperCase() + this.input.substring(this.index, this.index + 6).toUpperCase(); 9054 if (maybeDoctype === 'DOCTYPE') { 9055 this.consume(); 9056 this.consume(); 9057 this.consume(); 9058 this.consume(); 9059 this.consume(); 9060 this.consume(); 9061 this.transitionTo("doctype" /* doctype */); 9062 if (this.delegate.beginDoctype) 9063 this.delegate.beginDoctype(); 9064 } 9065 } 9066 }, 9067 doctype: function () { 9068 var char = this.consume(); 9069 if (isSpace(char)) { 9070 this.transitionTo("beforeDoctypeName" /* beforeDoctypeName */); 9071 } 9072 }, 9073 beforeDoctypeName: function () { 9074 var char = this.consume(); 9075 if (isSpace(char)) { 9076 return; 9077 } 9078 else { 9079 this.transitionTo("doctypeName" /* doctypeName */); 9080 if (this.delegate.appendToDoctypeName) 9081 this.delegate.appendToDoctypeName(char.toLowerCase()); 9082 } 9083 }, 9084 doctypeName: function () { 9085 var char = this.consume(); 9086 if (isSpace(char)) { 9087 this.transitionTo("afterDoctypeName" /* afterDoctypeName */); 9088 } 9089 else if (char === '>') { 9090 if (this.delegate.endDoctype) 9091 this.delegate.endDoctype(); 9092 this.transitionTo("beforeData" /* beforeData */); 9093 } 9094 else { 9095 if (this.delegate.appendToDoctypeName) 9096 this.delegate.appendToDoctypeName(char.toLowerCase()); 9097 } 9098 }, 9099 afterDoctypeName: function () { 9100 var char = this.consume(); 9101 if (isSpace(char)) { 9102 return; 9103 } 9104 else if (char === '>') { 9105 if (this.delegate.endDoctype) 9106 this.delegate.endDoctype(); 9107 this.transitionTo("beforeData" /* beforeData */); 9108 } 9109 else { 9110 var nextSixChars = char.toUpperCase() + this.input.substring(this.index, this.index + 5).toUpperCase(); 9111 var isPublic = nextSixChars.toUpperCase() === 'PUBLIC'; 9112 var isSystem = nextSixChars.toUpperCase() === 'SYSTEM'; 9113 if (isPublic || isSystem) { 9114 this.consume(); 9115 this.consume(); 9116 this.consume(); 9117 this.consume(); 9118 this.consume(); 9119 this.consume(); 9120 } 9121 if (isPublic) { 9122 this.transitionTo("afterDoctypePublicKeyword" /* afterDoctypePublicKeyword */); 9123 } 9124 else if (isSystem) { 9125 this.transitionTo("afterDoctypeSystemKeyword" /* afterDoctypeSystemKeyword */); 9126 } 9127 } 9128 }, 9129 afterDoctypePublicKeyword: function () { 9130 var char = this.peek(); 9131 if (isSpace(char)) { 9132 this.transitionTo("beforeDoctypePublicIdentifier" /* beforeDoctypePublicIdentifier */); 9133 this.consume(); 9134 } 9135 else if (char === '"') { 9136 this.transitionTo("doctypePublicIdentifierDoubleQuoted" /* doctypePublicIdentifierDoubleQuoted */); 9137 this.consume(); 9138 } 9139 else if (char === "'") { 9140 this.transitionTo("doctypePublicIdentifierSingleQuoted" /* doctypePublicIdentifierSingleQuoted */); 9141 this.consume(); 9142 } 9143 else if (char === '>') { 9144 this.consume(); 9145 if (this.delegate.endDoctype) 9146 this.delegate.endDoctype(); 9147 this.transitionTo("beforeData" /* beforeData */); 9148 } 9149 }, 9150 doctypePublicIdentifierDoubleQuoted: function () { 9151 var char = this.consume(); 9152 if (char === '"') { 9153 this.transitionTo("afterDoctypePublicIdentifier" /* afterDoctypePublicIdentifier */); 9154 } 9155 else if (char === '>') { 9156 if (this.delegate.endDoctype) 9157 this.delegate.endDoctype(); 9158 this.transitionTo("beforeData" /* beforeData */); 9159 } 9160 else { 9161 if (this.delegate.appendToDoctypePublicIdentifier) 9162 this.delegate.appendToDoctypePublicIdentifier(char); 9163 } 9164 }, 9165 doctypePublicIdentifierSingleQuoted: function () { 9166 var char = this.consume(); 9167 if (char === "'") { 9168 this.transitionTo("afterDoctypePublicIdentifier" /* afterDoctypePublicIdentifier */); 9169 } 9170 else if (char === '>') { 9171 if (this.delegate.endDoctype) 9172 this.delegate.endDoctype(); 9173 this.transitionTo("beforeData" /* beforeData */); 9174 } 9175 else { 9176 if (this.delegate.appendToDoctypePublicIdentifier) 9177 this.delegate.appendToDoctypePublicIdentifier(char); 9178 } 9179 }, 9180 afterDoctypePublicIdentifier: function () { 9181 var char = this.consume(); 9182 if (isSpace(char)) { 9183 this.transitionTo("betweenDoctypePublicAndSystemIdentifiers" /* betweenDoctypePublicAndSystemIdentifiers */); 9184 } 9185 else if (char === '>') { 9186 if (this.delegate.endDoctype) 9187 this.delegate.endDoctype(); 9188 this.transitionTo("beforeData" /* beforeData */); 9189 } 9190 else if (char === '"') { 9191 this.transitionTo("doctypeSystemIdentifierDoubleQuoted" /* doctypeSystemIdentifierDoubleQuoted */); 9192 } 9193 else if (char === "'") { 9194 this.transitionTo("doctypeSystemIdentifierSingleQuoted" /* doctypeSystemIdentifierSingleQuoted */); 9195 } 9196 }, 9197 betweenDoctypePublicAndSystemIdentifiers: function () { 9198 var char = this.consume(); 9199 if (isSpace(char)) { 9200 return; 9201 } 9202 else if (char === '>') { 9203 if (this.delegate.endDoctype) 9204 this.delegate.endDoctype(); 9205 this.transitionTo("beforeData" /* beforeData */); 9206 } 9207 else if (char === '"') { 9208 this.transitionTo("doctypeSystemIdentifierDoubleQuoted" /* doctypeSystemIdentifierDoubleQuoted */); 9209 } 9210 else if (char === "'") { 9211 this.transitionTo("doctypeSystemIdentifierSingleQuoted" /* doctypeSystemIdentifierSingleQuoted */); 9212 } 9213 }, 9214 doctypeSystemIdentifierDoubleQuoted: function () { 9215 var char = this.consume(); 9216 if (char === '"') { 9217 this.transitionTo("afterDoctypeSystemIdentifier" /* afterDoctypeSystemIdentifier */); 9218 } 9219 else if (char === '>') { 9220 if (this.delegate.endDoctype) 9221 this.delegate.endDoctype(); 9222 this.transitionTo("beforeData" /* beforeData */); 9223 } 9224 else { 9225 if (this.delegate.appendToDoctypeSystemIdentifier) 9226 this.delegate.appendToDoctypeSystemIdentifier(char); 9227 } 9228 }, 9229 doctypeSystemIdentifierSingleQuoted: function () { 9230 var char = this.consume(); 9231 if (char === "'") { 9232 this.transitionTo("afterDoctypeSystemIdentifier" /* afterDoctypeSystemIdentifier */); 9233 } 9234 else if (char === '>') { 9235 if (this.delegate.endDoctype) 9236 this.delegate.endDoctype(); 9237 this.transitionTo("beforeData" /* beforeData */); 9238 } 9239 else { 9240 if (this.delegate.appendToDoctypeSystemIdentifier) 9241 this.delegate.appendToDoctypeSystemIdentifier(char); 9242 } 9243 }, 9244 afterDoctypeSystemIdentifier: function () { 9245 var char = this.consume(); 9246 if (isSpace(char)) { 9247 return; 9248 } 9249 else if (char === '>') { 9250 if (this.delegate.endDoctype) 9251 this.delegate.endDoctype(); 9252 this.transitionTo("beforeData" /* beforeData */); 9253 } 9254 }, 9255 commentStart: function () { 9256 var char = this.consume(); 9257 if (char === '-') { 9258 this.transitionTo("commentStartDash" /* commentStartDash */); 9259 } 9260 else if (char === '>') { 9261 this.delegate.finishComment(); 9262 this.transitionTo("beforeData" /* beforeData */); 9263 } 9264 else { 9265 this.delegate.appendToCommentData(char); 9266 this.transitionTo("comment" /* comment */); 9267 } 9268 }, 9269 commentStartDash: function () { 9270 var char = this.consume(); 9271 if (char === '-') { 9272 this.transitionTo("commentEnd" /* commentEnd */); 9273 } 9274 else if (char === '>') { 9275 this.delegate.finishComment(); 9276 this.transitionTo("beforeData" /* beforeData */); 9277 } 9278 else { 9279 this.delegate.appendToCommentData('-'); 9280 this.transitionTo("comment" /* comment */); 9281 } 9282 }, 9283 comment: function () { 9284 var char = this.consume(); 9285 if (char === '-') { 9286 this.transitionTo("commentEndDash" /* commentEndDash */); 9287 } 9288 else { 9289 this.delegate.appendToCommentData(char); 9290 } 9291 }, 9292 commentEndDash: function () { 9293 var char = this.consume(); 9294 if (char === '-') { 9295 this.transitionTo("commentEnd" /* commentEnd */); 9296 } 9297 else { 9298 this.delegate.appendToCommentData('-' + char); 9299 this.transitionTo("comment" /* comment */); 9300 } 9301 }, 9302 commentEnd: function () { 9303 var char = this.consume(); 9304 if (char === '>') { 9305 this.delegate.finishComment(); 9306 this.transitionTo("beforeData" /* beforeData */); 9307 } 9308 else { 9309 this.delegate.appendToCommentData('--' + char); 9310 this.transitionTo("comment" /* comment */); 9311 } 9312 }, 9313 tagName: function () { 9314 var char = this.consume(); 9315 if (isSpace(char)) { 9316 this.transitionTo("beforeAttributeName" /* beforeAttributeName */); 9317 } 9318 else if (char === '/') { 9319 this.transitionTo("selfClosingStartTag" /* selfClosingStartTag */); 9320 } 9321 else if (char === '>') { 9322 this.delegate.finishTag(); 9323 this.transitionTo("beforeData" /* beforeData */); 9324 } 9325 else { 9326 this.appendToTagName(char); 9327 } 9328 }, 9329 endTagName: function () { 9330 var char = this.consume(); 9331 if (isSpace(char)) { 9332 this.transitionTo("beforeAttributeName" /* beforeAttributeName */); 9333 this.tagNameBuffer = ''; 9334 } 9335 else if (char === '/') { 9336 this.transitionTo("selfClosingStartTag" /* selfClosingStartTag */); 9337 this.tagNameBuffer = ''; 9338 } 9339 else if (char === '>') { 9340 this.delegate.finishTag(); 9341 this.transitionTo("beforeData" /* beforeData */); 9342 this.tagNameBuffer = ''; 9343 } 9344 else { 9345 this.appendToTagName(char); 9346 } 9347 }, 9348 beforeAttributeName: function () { 9349 var char = this.peek(); 9350 if (isSpace(char)) { 9351 this.consume(); 9352 return; 9353 } 9354 else if (char === '/') { 9355 this.transitionTo("selfClosingStartTag" /* selfClosingStartTag */); 9356 this.consume(); 9357 } 9358 else if (char === '>') { 9359 this.consume(); 9360 this.delegate.finishTag(); 9361 this.transitionTo("beforeData" /* beforeData */); 9362 } 9363 else if (char === '=') { 9364 this.delegate.reportSyntaxError('attribute name cannot start with equals sign'); 9365 this.transitionTo("attributeName" /* attributeName */); 9366 this.delegate.beginAttribute(); 9367 this.consume(); 9368 this.delegate.appendToAttributeName(char); 9369 } 9370 else { 9371 this.transitionTo("attributeName" /* attributeName */); 9372 this.delegate.beginAttribute(); 9373 } 9374 }, 9375 attributeName: function () { 9376 var char = this.peek(); 9377 if (isSpace(char)) { 9378 this.transitionTo("afterAttributeName" /* afterAttributeName */); 9379 this.consume(); 9380 } 9381 else if (char === '/') { 9382 this.delegate.beginAttributeValue(false); 9383 this.delegate.finishAttributeValue(); 9384 this.consume(); 9385 this.transitionTo("selfClosingStartTag" /* selfClosingStartTag */); 9386 } 9387 else if (char === '=') { 9388 this.transitionTo("beforeAttributeValue" /* beforeAttributeValue */); 9389 this.consume(); 9390 } 9391 else if (char === '>') { 9392 this.delegate.beginAttributeValue(false); 9393 this.delegate.finishAttributeValue(); 9394 this.consume(); 9395 this.delegate.finishTag(); 9396 this.transitionTo("beforeData" /* beforeData */); 9397 } 9398 else if (char === '"' || char === "'" || char === '<') { 9399 this.delegate.reportSyntaxError(char + ' is not a valid character within attribute names'); 9400 this.consume(); 9401 this.delegate.appendToAttributeName(char); 9402 } 9403 else { 9404 this.consume(); 9405 this.delegate.appendToAttributeName(char); 9406 } 9407 }, 9408 afterAttributeName: function () { 9409 var char = this.peek(); 9410 if (isSpace(char)) { 9411 this.consume(); 9412 return; 9413 } 9414 else if (char === '/') { 9415 this.delegate.beginAttributeValue(false); 9416 this.delegate.finishAttributeValue(); 9417 this.consume(); 9418 this.transitionTo("selfClosingStartTag" /* selfClosingStartTag */); 9419 } 9420 else if (char === '=') { 9421 this.consume(); 9422 this.transitionTo("beforeAttributeValue" /* beforeAttributeValue */); 9423 } 9424 else if (char === '>') { 9425 this.delegate.beginAttributeValue(false); 9426 this.delegate.finishAttributeValue(); 9427 this.consume(); 9428 this.delegate.finishTag(); 9429 this.transitionTo("beforeData" /* beforeData */); 9430 } 9431 else { 9432 this.delegate.beginAttributeValue(false); 9433 this.delegate.finishAttributeValue(); 9434 this.transitionTo("attributeName" /* attributeName */); 9435 this.delegate.beginAttribute(); 9436 this.consume(); 9437 this.delegate.appendToAttributeName(char); 9438 } 9439 }, 9440 beforeAttributeValue: function () { 9441 var char = this.peek(); 9442 if (isSpace(char)) { 9443 this.consume(); 9444 } 9445 else if (char === '"') { 9446 this.transitionTo("attributeValueDoubleQuoted" /* attributeValueDoubleQuoted */); 9447 this.delegate.beginAttributeValue(true); 9448 this.consume(); 9449 } 9450 else if (char === "'") { 9451 this.transitionTo("attributeValueSingleQuoted" /* attributeValueSingleQuoted */); 9452 this.delegate.beginAttributeValue(true); 9453 this.consume(); 9454 } 9455 else if (char === '>') { 9456 this.delegate.beginAttributeValue(false); 9457 this.delegate.finishAttributeValue(); 9458 this.consume(); 9459 this.delegate.finishTag(); 9460 this.transitionTo("beforeData" /* beforeData */); 9461 } 9462 else { 9463 this.transitionTo("attributeValueUnquoted" /* attributeValueUnquoted */); 9464 this.delegate.beginAttributeValue(false); 9465 this.consume(); 9466 this.delegate.appendToAttributeValue(char); 9467 } 9468 }, 9469 attributeValueDoubleQuoted: function () { 9470 var char = this.consume(); 9471 if (char === '"') { 9472 this.delegate.finishAttributeValue(); 9473 this.transitionTo("afterAttributeValueQuoted" /* afterAttributeValueQuoted */); 9474 } 9475 else if (char === '&') { 9476 this.delegate.appendToAttributeValue(this.consumeCharRef() || '&'); 9477 } 9478 else { 9479 this.delegate.appendToAttributeValue(char); 9480 } 9481 }, 9482 attributeValueSingleQuoted: function () { 9483 var char = this.consume(); 9484 if (char === "'") { 9485 this.delegate.finishAttributeValue(); 9486 this.transitionTo("afterAttributeValueQuoted" /* afterAttributeValueQuoted */); 9487 } 9488 else if (char === '&') { 9489 this.delegate.appendToAttributeValue(this.consumeCharRef() || '&'); 9490 } 9491 else { 9492 this.delegate.appendToAttributeValue(char); 9493 } 9494 }, 9495 attributeValueUnquoted: function () { 9496 var char = this.peek(); 9497 if (isSpace(char)) { 9498 this.delegate.finishAttributeValue(); 9499 this.consume(); 9500 this.transitionTo("beforeAttributeName" /* beforeAttributeName */); 9501 } 9502 else if (char === '/') { 9503 this.delegate.finishAttributeValue(); 9504 this.consume(); 9505 this.transitionTo("selfClosingStartTag" /* selfClosingStartTag */); 9506 } 9507 else if (char === '&') { 9508 this.consume(); 9509 this.delegate.appendToAttributeValue(this.consumeCharRef() || '&'); 9510 } 9511 else if (char === '>') { 9512 this.delegate.finishAttributeValue(); 9513 this.consume(); 9514 this.delegate.finishTag(); 9515 this.transitionTo("beforeData" /* beforeData */); 9516 } 9517 else { 9518 this.consume(); 9519 this.delegate.appendToAttributeValue(char); 9520 } 9521 }, 9522 afterAttributeValueQuoted: function () { 9523 var char = this.peek(); 9524 if (isSpace(char)) { 9525 this.consume(); 9526 this.transitionTo("beforeAttributeName" /* beforeAttributeName */); 9527 } 9528 else if (char === '/') { 9529 this.consume(); 9530 this.transitionTo("selfClosingStartTag" /* selfClosingStartTag */); 9531 } 9532 else if (char === '>') { 9533 this.consume(); 9534 this.delegate.finishTag(); 9535 this.transitionTo("beforeData" /* beforeData */); 9536 } 9537 else { 9538 this.transitionTo("beforeAttributeName" /* beforeAttributeName */); 9539 } 9540 }, 9541 selfClosingStartTag: function () { 9542 var char = this.peek(); 9543 if (char === '>') { 9544 this.consume(); 9545 this.delegate.markTagAsSelfClosing(); 9546 this.delegate.finishTag(); 9547 this.transitionTo("beforeData" /* beforeData */); 9548 } 9549 else { 9550 this.transitionTo("beforeAttributeName" /* beforeAttributeName */); 9551 } 9552 }, 9553 endTagOpen: function () { 9554 var char = this.consume(); 9555 if (char === '@' || char === ':' || isAlpha(char)) { 9556 this.transitionTo("endTagName" /* endTagName */); 9557 this.tagNameBuffer = ''; 9558 this.delegate.beginEndTag(); 9559 this.appendToTagName(char); 9560 } 9561 } 9562 }; 9563 this.reset(); 9564 } 9565 EventedTokenizer.prototype.reset = function () { 9566 this.transitionTo("beforeData" /* beforeData */); 9567 this.input = ''; 9568 this.tagNameBuffer = ''; 9569 this.index = 0; 9570 this.line = 1; 9571 this.column = 0; 9572 this.delegate.reset(); 9573 };
vendor: 8,649 bytes, lines 9574-9836
9574 EventedTokenizer.prototype.transitionTo = function (state) { 9575 this.state = state; 9576 }; 9577 EventedTokenizer.prototype.tokenize = function (input) { 9578 this.reset(); 9579 this.tokenizePart(input); 9580 this.tokenizeEOF(); 9581 }; 9582 EventedTokenizer.prototype.tokenizePart = function (input) { 9583 this.input += preprocessInput(input); 9584 while (this.index < this.input.length) { 9585 var handler = this.states[this.state]; 9586 if (handler !== undefined) { 9587 handler.call(this); 9588 } 9589 else { 9590 throw new Error("unhandled state " + this.state); 9591 } 9592 } 9593 }; 9594 EventedTokenizer.prototype.tokenizeEOF = function () { 9595 this.flushData(); 9596 }; 9597 EventedTokenizer.prototype.flushData = function () { 9598 if (this.state === 'data') { 9599 this.delegate.finishData(); 9600 this.transitionTo("beforeData" /* beforeData */); 9601 } 9602 }; 9603 EventedTokenizer.prototype.peek = function () { 9604 return this.input.charAt(this.index); 9605 }; 9606 EventedTokenizer.prototype.consume = function () { 9607 var char = this.peek(); 9608 this.index++; 9609 if (char === '\n') { 9610 this.line++; 9611 this.column = 0; 9612 } 9613 else { 9614 this.column++; 9615 } 9616 return char; 9617 }; 9618 EventedTokenizer.prototype.consumeCharRef = function () { 9619 var endIndex = this.input.indexOf(';', this.index); 9620 if (endIndex === -1) { 9621 return; 9622 } 9623 var entity = this.input.slice(this.index, endIndex); 9624 var chars = this.entityParser.parse(entity); 9625 if (chars) { 9626 var count = entity.length; 9627 // consume the entity chars 9628 while (count) { 9629 this.consume(); 9630 count--; 9631 } 9632 // consume the `;` 9633 this.consume(); 9634 return chars; 9635 } 9636 }; 9637 EventedTokenizer.prototype.markTagStart = function () { 9638 this.delegate.tagOpen(); 9639 }; 9640 EventedTokenizer.prototype.appendToTagName = function (char) { 9641 this.tagNameBuffer += char; 9642 this.delegate.appendToTagName(char); 9643 }; 9644 EventedTokenizer.prototype.isIgnoredEndTag = function () { 9645 var tag = this.tagNameBuffer; 9646 return (tag === 'title' && this.input.substring(this.index, this.index + 8) !== '</title>') || 9647 (tag === 'style' && this.input.substring(this.index, this.index + 8) !== '</style>') || 9648 (tag === 'script' && this.input.substring(this.index, this.index + 9) !== '</script>'); 9649 }; 9650 return EventedTokenizer; 9651}()); 9652 9653var Tokenizer = /** @class */ (function () { 9654 function Tokenizer(entityParser, options) { 9655 if (options === void 0) { options = {}; } 9656 this.options = options; 9657 this.token = null; 9658 this.startLine = 1; 9659 this.startColumn = 0; 9660 this.tokens = []; 9661 this.tokenizer = new EventedTokenizer(this, entityParser, options.mode); 9662 this._currentAttribute = undefined; 9663 } 9664 Tokenizer.prototype.tokenize = function (input) { 9665 this.tokens = []; 9666 this.tokenizer.tokenize(input); 9667 return this.tokens; 9668 }; 9669 Tokenizer.prototype.tokenizePart = function (input) { 9670 this.tokens = []; 9671 this.tokenizer.tokenizePart(input); 9672 return this.tokens; 9673 }; 9674 Tokenizer.prototype.tokenizeEOF = function () { 9675 this.tokens = []; 9676 this.tokenizer.tokenizeEOF(); 9677 return this.tokens[0]; 9678 }; 9679 Tokenizer.prototype.reset = function () { 9680 this.token = null; 9681 this.startLine = 1; 9682 this.startColumn = 0; 9683 }; 9684 Tokenizer.prototype.current = function () { 9685 var token = this.token; 9686 if (token === null) { 9687 throw new Error('token was unexpectedly null'); 9688 } 9689 if (arguments.length === 0) { 9690 return token; 9691 } 9692 for (var i = 0; i < arguments.length; i++) { 9693 if (token.type === arguments[i]) { 9694 return token; 9695 } 9696 } 9697 throw new Error("token type was unexpectedly " + token.type); 9698 }; 9699 Tokenizer.prototype.push = function (token) { 9700 this.token = token; 9701 this.tokens.push(token); 9702 }; 9703 Tokenizer.prototype.currentAttribute = function () { 9704 return this._currentAttribute; 9705 }; 9706 Tokenizer.prototype.addLocInfo = function () { 9707 if (this.options.loc) { 9708 this.current().loc = { 9709 start: { 9710 line: this.startLine, 9711 column: this.startColumn 9712 }, 9713 end: { 9714 line: this.tokenizer.line, 9715 column: this.tokenizer.column 9716 } 9717 }; 9718 } 9719 this.startLine = this.tokenizer.line; 9720 this.startColumn = this.tokenizer.column; 9721 }; 9722 // Data 9723 Tokenizer.prototype.beginDoctype = function () { 9724 this.push({ 9725 type: "Doctype" /* Doctype */, 9726 name: '', 9727 }); 9728 }; 9729 Tokenizer.prototype.appendToDoctypeName = function (char) { 9730 this.current("Doctype" /* Doctype */).name += char; 9731 }; 9732 Tokenizer.prototype.appendToDoctypePublicIdentifier = function (char) { 9733 var doctype = this.current("Doctype" /* Doctype */); 9734 if (doctype.publicIdentifier === undefined) { 9735 doctype.publicIdentifier = char; 9736 } 9737 else { 9738 doctype.publicIdentifier += char; 9739 } 9740 }; 9741 Tokenizer.prototype.appendToDoctypeSystemIdentifier = function (char) { 9742 var doctype = this.current("Doctype" /* Doctype */); 9743 if (doctype.systemIdentifier === undefined) { 9744 doctype.systemIdentifier = char; 9745 } 9746 else { 9747 doctype.systemIdentifier += char; 9748 } 9749 }; 9750 Tokenizer.prototype.endDoctype = function () { 9751 this.addLocInfo(); 9752 }; 9753 Tokenizer.prototype.beginData = function () { 9754 this.push({ 9755 type: "Chars" /* Chars */, 9756 chars: '' 9757 }); 9758 }; 9759 Tokenizer.prototype.appendToData = function (char) { 9760 this.current("Chars" /* Chars */).chars += char; 9761 }; 9762 Tokenizer.prototype.finishData = function () { 9763 this.addLocInfo(); 9764 }; 9765 // Comment 9766 Tokenizer.prototype.beginComment = function () { 9767 this.push({ 9768 type: "Comment" /* Comment */, 9769 chars: '' 9770 }); 9771 }; 9772 Tokenizer.prototype.appendToCommentData = function (char) { 9773 this.current("Comment" /* Comment */).chars += char; 9774 }; 9775 Tokenizer.prototype.finishComment = function () { 9776 this.addLocInfo(); 9777 }; 9778 // Tags - basic 9779 Tokenizer.prototype.tagOpen = function () { }; 9780 Tokenizer.prototype.beginStartTag = function () { 9781 this.push({ 9782 type: "StartTag" /* StartTag */, 9783 tagName: '', 9784 attributes: [], 9785 selfClosing: false 9786 }); 9787 }; 9788 Tokenizer.prototype.beginEndTag = function () { 9789 this.push({ 9790 type: "EndTag" /* EndTag */, 9791 tagName: '' 9792 }); 9793 }; 9794 Tokenizer.prototype.finishTag = function () { 9795 this.addLocInfo(); 9796 }; 9797 Tokenizer.prototype.markTagAsSelfClosing = function () { 9798 this.current("StartTag" /* StartTag */).selfClosing = true; 9799 }; 9800 // Tags - name 9801 Tokenizer.prototype.appendToTagName = function (char) { 9802 this.current("StartTag" /* StartTag */, "EndTag" /* EndTag */).tagName += char; 9803 }; 9804 // Tags - attributes 9805 Tokenizer.prototype.beginAttribute = function () { 9806 this._currentAttribute = ['', '', false]; 9807 }; 9808 Tokenizer.prototype.appendToAttributeName = function (char) { 9809 this.currentAttribute()[0] += char; 9810 }; 9811 Tokenizer.prototype.beginAttributeValue = function (isQuoted) { 9812 this.currentAttribute()[2] = isQuoted; 9813 }; 9814 Tokenizer.prototype.appendToAttributeValue = function (char) { 9815 this.currentAttribute()[1] += char; 9816 }; 9817 Tokenizer.prototype.finishAttributeValue = function () { 9818 this.current("StartTag" /* StartTag */).attributes.push(this._currentAttribute); 9819 }; 9820 Tokenizer.prototype.reportSyntaxError = function (message) { 9821 this.current().syntaxError = message; 9822 }; 9823 return Tokenizer; 9824}()); 9825 9826function tokenize(input, options) { 9827 var tokenizer = new Tokenizer(new EntityParser(namedCharRefs), options); 9828 return tokenizer.tokenize(input); 9829} 9830 9831 9832 9833// EXTERNAL MODULE: ./node_modules/fast-deep-equal/es6/index.js 9834var es6 = __webpack_require__(7734); 9835var es6_default = /*#__PURE__*/__webpack_require__.n(es6); 9836;
9836// external ["wp","htmlEntities"] 9837const external_wp_htmlEntities_namespaceObject = window["wp"]["htmlEntities"]; 9838;// ./node_modules/@wordpress/blocks/build-module/api/validation/logger.js 9839function createLogger() { 9840 function createLogHandler(logger) { 9841 let log = (message, ...args) => logger("Block validation: " + message, ...args); 9842 if (false) {} 9843 return log; 9844 } 9845 return { 9846 // eslint-disable-next-line no-console 9847 error: createLogHandler(console.error), 9848 // eslint-disable-next-line no-console 9849 warning: createLogHandler(console.warn), 9850 getItems() { 9851 return []; 9852 } 9853 }; 9854} 9855function createQueuedLogger() { 9856 const queue = []; 9857 const logger = createLogger(); 9858 return { 9859 error(...args) { 9860 queue.push({ log: logger.error, args }); 9861 }, 9862 warning(...args) { 9863 queue.push({ log: logger.warning, args }); 9864 }, 9865 getItems() { 9866 return queue; 9867 } 9868 }; 9869} 9870 9871 9872;// ./node_modules/@wordpress/blocks/build-module/api/validation/index.js 9873 9874 9875 9876 9877 9878 9879 9880 9881const identity = (x) => x; 9882const REGEXP_WHITESPACE = /[\t\n\r\v\f ]+/g; 9883const REGEXP_ONLY_WHITESPACE = /^[\t\n\r\v\f ]*$/; 9884const REGEXP_STYLE_URL_TYPE = /^url\s*\(['"\s]*(.*?)['"\s]*\)$/; 9885const BOOLEAN_ATTRIBUTES = [ 9886 "allowfullscreen", 9887 "allowpaymentrequest", 9888 "allowusermedia", 9889 "async", 9890 "autofocus", 9891 "autoplay", 9892 "checked", 9893 "controls", 9894 "default", 9895 "defer", 9896 "disabled", 9897 "download", 9898 "formnovalidate", 9899 "hidden", 9900 "ismap", 9901 "itemscope", 9902 "loop", 9903 "multiple", 9904 "muted", 9905 "nomodule", 9906 "novalidate", 9907 "open", 9908 "playsinline", 9909 "readonly", 9910 "required", 9911 "reversed", 9912 "selected", 9913 "typemustmatch" 9914]; 9915const ENUMERATED_ATTRIBUTES = [ 9916 "autocapitalize", 9917 "autocomplete", 9918 "charset", 9919 "contenteditable", 9920 "crossorigin", 9921 "decoding", 9922 "dir", 9923 "draggable", 9924 "enctype", 9925 "formenctype", 9926 "formmethod", 9927 "http-equiv", 9928 "inputmode", 9929 "kind", 9930 "method", 9931 "preload", 9932 "scope", 9933 "shape", 9934 "spellcheck", 9935 "translate", 9936 "type", 9937 "wrap" 9938]; 9939const MEANINGFUL_ATTRIBUTES = [ 9940 ...BOOLEAN_ATTRIBUTES, 9941 ...ENUMERATED_ATTRIBUTES 9942]; 9943const TEXT_NORMALIZATIONS = [identity, getTextWithCollapsedWhitespace]; 9944const REGEXP_NAMED_CHARACTER_REFERENCE = /^[\da-z]+$/i; 9945const REGEXP_DECIMAL_CHARACTER_REFERENCE = /^#\d+$/; 9946const REGEXP_HEXADECIMAL_CHARACTER_REFERENCE = /^#x[\da-f]+$/i; 9947function isValidCharacterReference(text) { 9948 return REGEXP_NAMED_CHARACTER_REFERENCE.test(text) || REGEXP_DECIMAL_CHARACTER_REFERENCE.test(text) || REGEXP_HEXADECIMAL_CHARACTER_REFERENCE.test(text); 9949} 9950class DecodeEntityParser { 9951 /** 9952 * Returns a substitute string for an entity string sequence between `&` 9953 * and `;`, or undefined if no substitution should occur. 9954 * 9955 * @param {string} entity Entity fragment discovered in HTML. 9956 * 9957 * @return {string | undefined} Entity substitute value. 9958 */ 9959 parse(entity) { 9960 if (isValidCharacterReference(entity)) { 9961 return (0,external_wp_htmlEntities_namespaceObject.decodeEntities)("&" + entity + ";"); 9962 } 9963 } 9964} 9965function getTextPiecesSplitOnWhitespace(text) { 9966 return text.trim().split(REGEXP_WHITESPACE); 9967} 9968function getTextWithCollapsedWhitespace(text) { 9969 return getTextPiecesSplitOnWhitespace(text).join(" "); 9970} 9971function getMeaningfulAttributePairs(token) { 9972 return token.attributes.filter((pair) => { 9973 const [key, value] = pair; 9974 return value || key.indexOf("data-") === 0 || MEANINGFUL_ATTRIBUTES.includes(key); 9975 }); 9976} 9977function isEquivalentTextTokens(actual, expected, logger = createLogger()) { 9978 let actualChars = actual.chars; 9979 let expectedChars = expected.chars; 9980 for (let i = 0; i < TEXT_NORMALIZATIONS.length; i++) { 9981 const normalize = TEXT_NORMALIZATIONS[i]; 9982 actualChars = normalize(actualChars); 9983 expectedChars = normalize(expectedChars); 9984 if (actualChars === expectedChars) { 9985 return true; 9986 } 9987 } 9988 logger.warning( 9989 "Expected text `%s`, saw `%s`.", 9990 expected.chars, 9991 actual.chars 9992 ); 9993 return false; 9994} 9995function getNormalizedLength(value) { 9996 if (0 === parseFloat(value)) { 9997 return "0"; 9998 } 9999 if (value.indexOf(".") === 0) { 10000 return "0" + value; 10001 } 10002 return value; 10003} 10004function getNormalizedStyleValue(value) { 10005 const textPieces = getTextPiecesSplitOnWhitespace(value); 10006 const normalizedPieces = textPieces.map(getNormalizedLength); 10007 const result = normalizedPieces.join(" "); 10008 return result.replace(REGEXP_STYLE_URL_TYPE, "url($1)"); 10009} 10010function getStyleProperties(text) { 10011 const pairs = text.replace(/;?\s*$/, "").split(";").map((style) => { 10012 const [key, ...valueParts] = style.split(":"); 10013 const value = valueParts.join(":"); 10014 return [key.trim(), getNormalizedStyleValue(value.trim())]; 10015 }); 10016 return Object.fromEntries(pairs); 10017} 10018const isEqualAttributesOfName = { 10019 class: (actual, expected) => { 10020 const [actualPieces, expectedPieces] = [actual, expected].map( 10021 getTextPiecesSplitOnWhitespace 10022 ); 10023 const actualDiff = actualPieces.filter( 10024 (c) => !expectedPieces.includes(c) 10025 ); 10026 const expectedDiff = expectedPieces.filter( 10027 (c) => !actualPieces.includes(c) 10028 ); 10029 return actualDiff.length === 0 && expectedDiff.length === 0; 10030 }, 10031 style: (actual, expected) => { 10032 return es6_default()( 10033 ...[actual, expected].map(getStyleProperties) 10034 ); 10035 }, 10036 // For each boolean attribute, mere presence of attribute in both is enough 10037 // to assume equivalence. 10038 ...Object.fromEntries( 10039 BOOLEAN_ATTRIBUTES.map((attribute) => [attribute, () => true]) 10040 ) 10041}; 10042function isEqualTagAttributePairs(actual, expected, logger = createLogger()) { 10043 if (actual.length !== expected.length) { 10044 logger.warning( 10045 "Expected attributes %o, instead saw %o.", 10046 expected, 10047 actual 10048 ); 10049 return false;
10050 } 10051 const expectedAttributes = {}; 10052 for (let i = 0; i < expected.length; i++) { 10053 expectedAttributes[expected[i][0].toLowerCase()] = expected[i][1]; 10054 } 10055 for (let i = 0; i < actual.length; i++) { 10056 const [name, actualValue] = actual[i]; 10057 const nameLower = name.toLowerCase(); 10058 if (!expectedAttributes.hasOwnProperty(nameLower)) { 10059 logger.warning("Encountered unexpected attribute `%s`.", name); 10060 return false; 10061 } 10062 const expectedValue = expectedAttributes[nameLower]; 10063 const isEqualAttributes = isEqualAttributesOfName[nameLower]; 10064 if (isEqualAttributes) { 10065 if (!isEqualAttributes(actualValue, expectedValue)) { 10066 logger.warning( 10067 "Expected attribute `%s` of value `%s`, saw `%s`.", 10068 name, 10069 expectedValue, 10070 actualValue 10071 ); 10072 return false; 10073 } 10074 } else if (actualValue !== expectedValue) { 10075 logger.warning( 10076 "Expected attribute `%s` of value `%s`, saw `%s`.", 10077 name, 10078 expectedValue, 10079 actualValue 10080 ); 10081 return false; 10082 } 10083 } 10084 return true; 10085} 10086const isEqualTokensOfType = { 10087 StartTag: (actual, expected, logger = createLogger()) => { 10088 if (actual.tagName !== expected.tagName && // Optimization: Use short-circuit evaluation to defer case- 10089 // insensitive check on the assumption that the majority case will 10090 // have exactly equal tag names. 10091 actual.tagName.toLowerCase() !== expected.tagName.toLowerCase()) { 10092 logger.warning( 10093 "Expected tag name `%s`, instead saw `%s`.", 10094 expected.tagName, 10095 actual.tagName 10096 ); 10097 return false; 10098 } 10099 return isEqualTagAttributePairs( 10100 ...[actual, expected].map(getMeaningfulAttributePairs), 10101 logger 10102 ); 10103 }, 10104 Chars: isEquivalentTextTokens, 10105 Comment: isEquivalentTextTokens 10106}; 10107function getNextNonWhitespaceToken(tokens) { 10108 let token; 10109 while (token = tokens.shift()) { 10110 if (token.type !== "Chars") { 10111 return token; 10112 } 10113 if (!REGEXP_ONLY_WHITESPACE.test(token.chars)) { 10114 return token; 10115 } 10116 } 10117} 10118function getHTMLTokens(html, logger = createLogger()) { 10119 try { 10120 return new Tokenizer(new DecodeEntityParser()).tokenize(html); 10121 } catch (e) { 10122 logger.warning("Malformed HTML detected: %s", html); 10123 } 10124 return null; 10125} 10126function isClosedByToken(currentToken, nextToken) { 10127 if (!currentToken.selfClosing) { 10128 return false; 10129 } 10130 if (nextToken && nextToken.tagName === currentToken.tagName && nextToken.type === "EndTag") { 10131 return true; 10132 } 10133 return false; 10134} 10135function isEquivalentHTML(actual, expected, logger = createLogger()) { 10136 if (actual === expected) { 10137 return true; 10138 } 10139 const [actualTokens, expectedTokens] = [actual, expected].map( 10140 (html) => getHTMLTokens(html, logger) 10141 ); 10142 if (!actualTokens || !expectedTokens) { 10143 return false; 10144 } 10145 let actualToken, expectedToken; 10146 while (actualToken = getNextNonWhitespaceToken(actualTokens)) { 10147 expectedToken = getNextNonWhitespaceToken(expectedTokens); 10148 if (!expectedToken) { 10149 logger.warning( 10150 "Expected end of content, instead saw %o.", 10151 actualToken 10152 ); 10153 return false; 10154 } 10155 if (actualToken.type !== expectedToken.type) { 10156 logger.warning( 10157 "Expected token of type `%s` (%o), instead saw `%s` (%o).", 10158 expectedToken.type, 10159 expectedToken, 10160 actualToken.type, 10161 actualToken 10162 ); 10163 return false; 10164 } 10165 const isEqualTokens = isEqualTokensOfType[actualToken.type]; 10166 if (isEqualTokens && !isEqualTokens(actualToken, expectedToken, logger)) { 10167 return false; 10168 } 10169 if (isClosedByToken(actualToken, expectedTokens[0])) { 10170 getNextNonWhitespaceToken(expectedTokens); 10171 } else if (isClosedByToken(expectedToken, actualTokens[0])) { 10172 getNextNonWhitespaceToken(actualTokens); 10173 } 10174 } 10175 if (expectedToken = getNextNonWhitespaceToken(expectedTokens)) { 10176 logger.warning( 10177 "Expected %o, instead saw end of content.", 10178 expectedToken 10179 ); 10180 return false; 10181 } 10182 return true; 10183} 10184function validateBlock(block, blockTypeOrName = block.name) { 10185 const isFallbackBlock = block.name === getFreeformContentHandlerName() || block.name === getUnregisteredTypeHandlerName(); 10186 if (isFallbackBlock) { 10187 return [true, []]; 10188 } 10189 const logger = createQueuedLogger(); 10190 const blockType = normalizeBlockType(blockTypeOrName); 10191 let generatedBlockContent; 10192 try { 10193 generatedBlockContent = getSaveContent(blockType, block.attributes); 10194 } catch (error) { 10195 logger.error( 10196 "Block validation failed because an error occurred while generating block content:\n\n%s", 10197 error.toString() 10198 ); 10199 return [false, logger.getItems()]; 10200 } 10201 const isValid = isEquivalentHTML( 10202 block.originalContent, 10203 generatedBlockContent, 10204 logger 10205 ); 10206 if (!isValid) { 10207 logger.error( 10208 "Block validation failed for `%s` (%o).\n\nContent generated by `save` function:\n\n%s\n\nContent retrieved from post body:\n\n%s",
10209 blockType.name, 10210 blockType, 10211 generatedBlockContent, 10212 block.originalContent 10213 ); 10214 } 10215 return [isValid, logger.getItems()]; 10216} 10217function isValidBlockContent(blockTypeOrName, attributes, originalBlockContent) { 10218 external_wp_deprecated_default()("isValidBlockContent introduces opportunity for data loss", { 10219 since: "12.6", 10220 plugin: "Gutenberg", 10221 alternative: "validateBlock" 10222 }); 10223 const blockType = normalizeBlockType(blockTypeOrName); 10224 const block = { 10225 name: blockType.name, 10226 attributes, 10227 innerBlocks: [], 10228 originalContent: originalBlockContent 10229 }; 10230 const [isValid] = validateBlock(block, blockType); 10231 return isValid; 10232} 10233 10234 10235;// ./node_modules/@wordpress/blocks/build-module/api/parser/convert-legacy-block.js 10236function convertLegacyBlockNameAndAttributes(name, attributes) { 10237 const newAttributes = { ...attributes }; 10238 if ("core/cover-image" === name) { 10239 name = "core/cover"; 10240 } 10241 if ("core/text" === name || "core/cover-text" === name) { 10242 name = "core/paragraph"; 10243 } 10244 if (name && name.indexOf("core/social-link-") === 0) { 10245 newAttributes.service = name.substring(17); 10246 name = "core/social-link"; 10247 } 10248 if (name && name.indexOf("core-embed/") === 0) { 10249 const providerSlug = name.substring(11); 10250 const deprecated = { 10251 speaker: "speaker-deck", 10252 polldaddy: "crowdsignal" 10253 }; 10254 newAttributes.providerNameSlug = providerSlug in deprecated ? deprecated[providerSlug] : providerSlug; 10255 if (!["amazon-kindle", "wordpress"].includes(providerSlug)) { 10256 newAttributes.responsive = true; 10257 } 10258 name = "core/embed"; 10259 } 10260 if (name === "core/post-comment-author") { 10261 name = "core/comment-author-name"; 10262 } 10263 if (name === "core/post-comment-content") { 10264 name = "core/comment-content"; 10265 } 10266 if (name === "core/post-comment-date") { 10267 name = "core/comment-date"; 10268 } 10269 if (name === "core/comments-query-loop") { 10270 name = "core/comments"; 10271 const { className = "" } = newAttributes; 10272 if (!className.includes("wp-block-comments-query-loop")) { 10273 newAttributes.className = [ 10274 "wp-block-comments-query-loop", 10275 className 10276 ].join(" "); 10277 } 10278 } 10279 if (name === "core/post-comments") { 10280 name = "core/comments"; 10281 newAttributes.legacy = true; 10282 } 10283 if (attributes.layout?.type === "grid" && typeof attributes.layout?.columnCount === "string") { 10284 newAttributes.layout = { 10285 ...newAttributes.layout, 10286 columnCount: parseInt(attributes.layout.columnCount, 10) 10287 }; 10288 } 10289 if (typeof attributes.style?.layout?.columnSpan === "string") { 10290 const columnSpanNumber = parseInt( 10291 attributes.style.layout.columnSpan, 10292 10 10293 ); 10294 newAttributes.style = { 10295 ...newAttributes.style, 10296 layout: { 10297 ...newAttributes.style.layout, 10298 columnSpan: isNaN(columnSpanNumber) ? void 0 : columnSpanNumber 10299 } 10300 }; 10301 } 10302 if (typeof attributes.style?.layout?.rowSpan === "string") { 10303 const rowSpanNumber = parseInt(attributes.style.layout.rowSpan, 10); 10304 newAttributes.style = { 10305 ...newAttributes.style, 10306 layout: { 10307 ...newAttributes.style.layout, 10308 rowSpan: isNaN(rowSpanNumber) ? void 0 : rowSpanNumber 10309 } 10310 }; 10311 } 10312 return [name, newAttributes]; 10313} 10314 10315 10316;
10316// ./node_modules/hpq/es/get-path.js 10317/** 10318 * Given object and string of dot-delimited path segments, returns value at 10319 * path or undefined if path cannot be resolved. 10320 * 10321 * @param {Object} object Lookup object 10322 * @param {string} path Path to resolve 10323 * @return {?*} Resolved value 10324 */ 10325function getPath(object, path) { 10326 var segments = path.split('.'); 10327 var segment; 10328 10329 while (segment = segments.shift()) { 10330 if (!(segment in object)) { 10331 return; 10332 } 10333 10334 object = object[segment]; 10335 } 10336 10337 return object; 10338} 10339;// ./node_modules/hpq/es/index.js 10340/** 10341 * Internal dependencies 10342 */ 10343 10344/** 10345 * Function returning a DOM document created by `createHTMLDocument`. The same 10346 * document is returned between invocations. 10347 * 10348 * @return {Document} DOM document. 10349 */ 10350 10351var getDocument = function () { 10352 var doc; 10353 return function () { 10354 if (!doc) { 10355 doc = document.implementation.createHTMLDocument(''); 10356 } 10357 10358 return doc; 10359 }; 10360}(); 10361/** 10362 * Given a markup string or DOM element, creates an object aligning with the 10363 * shape of the matchers object, or the value returned by the matcher. 10364 * 10365 * @param {(string|Element)} source Source content 10366 * @param {(Object|Function)} matchers Matcher function or object of matchers 10367 * @return {(Object|*)} Matched value(s), shaped by object 10368 */ 10369 10370 10371function parse(source, matchers) { 10372 if (!matchers) { 10373 return; 10374 } // Coerce to element 10375 10376 10377 if ('string' === typeof source) { 10378 var doc = getDocument(); 10379 doc.body.innerHTML = source; 10380 source = doc.body; 10381 } // Return singular value 10382 10383 10384 if ('function' === typeof matchers) { 10385 return matchers(source); 10386 } // Bail if we can't handle matchers 10387 10388 10389 if (Object !== matchers.constructor) { 10390 return; 10391 } // Shape result by matcher object 10392 10393 10394 return Object.keys(matchers).reduce(function (memo, key) { 10395 memo[key] = parse(source, matchers[key]); 10396 return memo; 10397 }, {}); 10398} 10399/** 10400 * Generates a function which matches node of type selector, returning an 10401 * attribute by property if the attribute exists. If no selector is passed, 10402 * returns property of the query element. 10403 * 10404 * @param {?string} selector Optional selector 10405 * @param {string} name Property name 10406 * @return {*} Property value 10407 */ 10408 10409function prop(selector, name) { 10410 if (1 === arguments.length) { 10411 name = selector; 10412 selector = undefined; 10413 } 10414 10415 return function (node) { 10416 var match = node; 10417 10418 if (selector) { 10419 match = node.querySelector(selector); 10420 } 10421 10422 if (match) { 10423 return getPath(match, name); 10424 } 10425 }; 10426} 10427/** 10428 * Generates a function which matches node of type selector, returning an 10429 * attribute by name if the attribute exists. If no selector is passed, 10430 * returns attribute of the query element. 10431 * 10432 * @param {?string} selector Optional selector 10433 * @param {string} name Attribute name 10434 * @return {?string} Attribute value 10435 */ 10436 10437function attr(selector, name) { 10438 if (1 === arguments.length) { 10439 name = selector; 10440 selector = undefined; 10441 } 10442 10443 return function (node) { 10444 var attributes = prop(selector, 'attributes')(node); 10445 10446 if (attributes && attributes.hasOwnProperty(name)) { 10447 return attributes[name].value; 10448 } 10449 }; 10450} 10451/** 10452 * Convenience for `prop( selector, 'innerHTML' )`. 10453 * 10454 * @see prop() 10455 * 10456 * @param {?string} selector Optional selector 10457 * @return {string} Inner HTML 10458 */ 10459 10460function html(selector) { 10461 return prop(selector, 'innerHTML'); 10462} 10463/** 10464 * Convenience for `prop( selector, 'textContent' )`. 10465 * 10466 * @see prop() 10467 * 10468 * @param {?string} selector Optional selector 10469 * @return {string} Text content 10470 */ 10471 10472function es_text(selector) { 10473 return prop(selector, 'textContent'); 10474} 10475/** 10476 * Creates a new matching context by first finding elements matching selector 10477 * using querySelectorAll before then running another `parse` on `matchers` 10478 * scoped to the matched elements. 10479 * 10480 * @see parse() 10481 * 10482 * @param {string} selector Selector to match 10483 * @param {(Object|Function)} matchers Matcher function or object of matchers 10484 * @return {Array.<*,Object>} Array of matched value(s) 10485 */ 10486 10487function query(selector, matchers) { 10488 return function (node) { 10489 var matches = node.querySelectorAll(selector); 10490 return [].map.call(matches, function (match) { 10491 return parse(match, matchers); 10492 }); 10493 }; 10494} 10495;// ./node_modules/memize/dist/index.js 10496/** 10497 * Memize options object. 10498 * 10499 * @typedef MemizeOptions 10500 * 10501 * @property {number} [maxSize] Maximum size of the cache. 10502 */ 10503 10504/**
10505 * Internal cache entry. 10506 * 10507 * @typedef MemizeCacheNode 10508 * 10509 * @property {?MemizeCacheNode|undefined} [prev] Previous node. 10510 * @property {?MemizeCacheNode|undefined} [next] Next node. 10511 * @property {Array<*>} args Function arguments for cache 10512 * entry. 10513 * @property {*} val Function result. 10514 */ 10515 10516/** 10517 * Properties of the enhanced function for controlling cache. 10518 * 10519 * @typedef MemizeMemoizedFunction 10520 * 10521 * @property {()=>void} clear Clear the cache. 10522 */ 10523 10524/** 10525 * Accepts a function to be memoized, and returns a new memoized function, with 10526 * optional options. 10527 * 10528 * @template {(...args: any[]) => any} F 10529 * 10530 * @param {F} fn Function to memoize. 10531 * @param {MemizeOptions} [options] Options object. 10532 * 10533 * @return {((...args: Parameters<F>) => ReturnType<F>) & MemizeMemoizedFunction} Memoized function. 10534 */ 10535function memize(fn, options) { 10536 var size = 0; 10537 10538 /** @type {?MemizeCacheNode|undefined} */ 10539 var head; 10540 10541 /** @type {?MemizeCacheNode|undefined} */ 10542 var tail; 10543 10544 options = options || {}; 10545 10546 function memoized(/* ...args */) { 10547 var node = head, 10548 len = arguments.length, 10549 args, 10550 i; 10551 10552 searchCache: while (node) { 10553 // Perform a shallow equality test to confirm that whether the node 10554 // under test is a candidate for the arguments passed. Two arrays 10555 // are shallowly equal if their length matches and each entry is 10556 // strictly equal between the two sets. Avoid abstracting to a 10557 // function which could incur an arguments leaking deoptimization. 10558 10559 // Check whether node arguments match arguments length 10560 if (node.args.length !== arguments.length) { 10561 node = node.next; 10562 continue; 10563 } 10564 10565 // Check whether node arguments match arguments values 10566 for (i = 0; i < len; i++) { 10567 if (node.args[i] !== arguments[i]) { 10568 node = node.next; 10569 continue searchCache; 10570 } 10571 } 10572 10573 // At this point we can assume we've found a match 10574 10575 // Surface matched node to head if not already 10576 if (node !== head) { 10577 // As tail, shift to previous. Must only shift if not also 10578 // head, since if both head and tail, there is no previous. 10579 if (node === tail) { 10580 tail = node.prev; 10581 } 10582 10583 // Adjust siblings to point to each other. If node was tail, 10584 // this also handles new tail's empty `next` assignment. 10585 /** @type {MemizeCacheNode} */ (node.prev).next = node.next; 10586 if (node.next) { 10587 node.next.prev = node.prev; 10588 } 10589 10590 node.next = head; 10591 node.prev = null; 10592 /** @type {MemizeCacheNode} */ (head).prev = node; 10593 head = node; 10594 } 10595 10596 // Return immediately 10597 return node.val; 10598 } 10599 10600 // No cached value found. Continue to insertion phase: 10601 10602 // Create a copy of arguments (avoid leaking deoptimization) 10603 args = new Array(len); 10604 for (i = 0; i < len; i++) { 10605 args[i] = arguments[i]; 10606 } 10607 10608 node = { 10609 args: args, 10610 10611 // Generate the result from original function 10612 val: fn.apply(null, args), 10613 }; 10614 10615 // Don't need to check whether node is already head, since it would 10616 // have been returned above already if it was 10617 10618 // Shift existing head down list 10619 if (head) { 10620 head.prev = node; 10621 node.next = head; 10622 } else { 10623 // If no head, follows that there's no tail (at initial or reset) 10624 tail = node; 10625 } 10626 10627 // Trim tail if we're reached max size and are pending cache insertion 10628 if (size === /** @type {MemizeOptions} */ (options).maxSize) { 10629 tail = /** @type {MemizeCacheNode} */ (tail).prev; 10630 /** @type {MemizeCacheNode} */ (tail).next = null; 10631 } else { 10632 size++; 10633 } 10634 10635 head = node; 10636 10637 return node.val; 10638 } 10639 10640 memoized.clear = function () { 10641 head = null; 10642 tail = null; 10643 size = 0; 10644 }; 10645 10646 // Ignore reason: There's not a clear solution to create an intersection of 10647 // the function with additional properties, where the goal is to retain the 10648 // function signature of the incoming argument and add control properties 10649 // on the return value. 10650 10651 // @ts-ignore 10652 return memoized; 10653} 10654 10655 10656 10657;// ./node_modules/@wordpress/blocks/build-module/api/matchers.js 10658 10659 10660 10661 10662function matchers_html(selector, multilineTag) { 10663 return (domNode) => { 10664 let match = domNode; 10665 if (selector) { 10666 match = domNode.querySelector(selector); 10667 } 10668 if (!match) { 10669 return ""; 10670 } 10671 if (multilineTag) { 10672 let value = ""; 10673 const length = match.children.length; 10674 for (let index = 0; index < length; index++) { 10675 const child = match.children[index]; 10676 if (child.nodeName.toLowerCase() !== multilineTag) { 10677 continue; 10678 } 10679 value += child.outerHTML; 10680 } 10681 return value; 10682 } 10683 return match.innerHTML; 10684 }; 10685}
10686const richText = (selector, preserveWhiteSpace) => (el) => { 10687 const target = selector ? el.querySelector(selector) : el; 10688 return target ? external_wp_richText_namespaceObject.RichTextData.fromHTMLElement(target, { preserveWhiteSpace }) : external_wp_richText_namespaceObject.RichTextData.empty(); 10689}; 10690 10691 10692;// ./node_modules/@wordpress/blocks/build-module/api/node.js 10693 10694 10695function isNodeOfType(node, type) { 10696 external_wp_deprecated_default()("wp.blocks.node.isNodeOfType", { 10697 since: "6.1", 10698 version: "6.3", 10699 link: "https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/" 10700 }); 10701 return node && node.type === type; 10702} 10703function getNamedNodeMapAsObject(nodeMap) { 10704 const result = {}; 10705 for (let i = 0; i < nodeMap.length; i++) { 10706 const { name, value } = nodeMap[i]; 10707 result[name] = value; 10708 } 10709 return result; 10710} 10711function fromDOM(domNode) { 10712 external_wp_deprecated_default()("wp.blocks.node.fromDOM", { 10713 since: "6.1", 10714 version: "6.3", 10715 alternative: "wp.richText.create", 10716 link: "https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/" 10717 }); 10718 if (domNode.nodeType === domNode.TEXT_NODE) { 10719 return domNode.nodeValue; 10720 } 10721 if (domNode.nodeType !== domNode.ELEMENT_NODE) { 10722 throw new TypeError( 10723 "A block node can only be created from a node of type text or element." 10724 ); 10725 } 10726 return { 10727 type: domNode.nodeName.toLowerCase(), 10728 props: { 10729 ...getNamedNodeMapAsObject(domNode.attributes), 10730 children: children_fromDOM(domNode.childNodes) 10731 } 10732 }; 10733} 10734function toHTML(node) { 10735 external_wp_deprecated_default()("wp.blocks.node.toHTML", { 10736 since: "6.1", 10737 version: "6.3", 10738 alternative: "wp.richText.toHTMLString", 10739 link: "https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/" 10740 }); 10741 return children_toHTML([node]); 10742} 10743function matcher(selector) { 10744 external_wp_deprecated_default()("wp.blocks.node.matcher", { 10745 since: "6.1", 10746 version: "6.3", 10747 alternative: "html source", 10748 link: "https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/" 10749 }); 10750 return (domNode) => { 10751 let match = domNode; 10752 if (selector) { 10753 match = domNode.querySelector(selector); 10754 } 10755 try { 10756 return fromDOM(match); 10757 } catch (error) { 10758 return null; 10759 } 10760 }; 10761} 10762var node_default = { 10763 isNodeOfType, 10764 fromDOM, 10765 toHTML, 10766 matcher 10767}; 10768 10769 10770;// ./node_modules/@wordpress/blocks/build-module/api/children.js 10771 10772 10773 10774function getSerializeCapableElement(children) { 10775 return children; 10776} 10777function getChildrenArray(children) { 10778 external_wp_deprecated_default()("wp.blocks.children.getChildrenArray", { 10779 since: "6.1", 10780 version: "6.3", 10781 link: "https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/" 10782 }); 10783 return children; 10784} 10785function concat(...blockNodes) { 10786 external_wp_deprecated_default()("wp.blocks.children.concat", { 10787 since: "6.1", 10788 version: "6.3", 10789 alternative: "wp.richText.concat", 10790 link: "https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/" 10791 }); 10792 const result = []; 10793 for (let i = 0; i < blockNodes.length; i++) { 10794 const blockNode = Array.isArray(blockNodes[i]) ? blockNodes[i] : [blockNodes[i]]; 10795 for (let j = 0; j < blockNode.length; j++) { 10796 const child = blockNode[j]; 10797 const canConcatToPreviousString = typeof child === "string" && typeof result[result.length - 1] === "string"; 10798 if (canConcatToPreviousString) { 10799 result[result.length - 1] += child; 10800 } else { 10801 result.push(child); 10802 } 10803 } 10804 } 10805 return result; 10806} 10807function children_fromDOM(domNodes) { 10808 external_wp_deprecated_default()("wp.blocks.children.fromDOM", { 10809 since: "6.1", 10810 version: "6.3", 10811 alternative: "wp.richText.create", 10812 link: "https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/" 10813 }); 10814 const result = []; 10815 for (let i = 0; i < domNodes.length; i++) { 10816 try {
10817 result.push(fromDOM(domNodes[i])); 10818 } catch (error) { 10819 } 10820 } 10821 return result; 10822} 10823function children_toHTML(children) { 10824 external_wp_deprecated_default()("wp.blocks.children.toHTML", { 10825 since: "6.1", 10826 version: "6.3", 10827 alternative: "wp.richText.toHTMLString", 10828 link: "https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/" 10829 }); 10830 const element = getSerializeCapableElement(children); 10831 return (0,external_wp_element_namespaceObject.renderToString)(element); 10832} 10833function children_matcher(selector) { 10834 external_wp_deprecated_default()("wp.blocks.children.matcher", { 10835 since: "6.1", 10836 version: "6.3", 10837 alternative: "html source", 10838 link: "https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/" 10839 }); 10840 return (domNode) => { 10841 let match = domNode; 10842 if (selector) { 10843 match = domNode.querySelector(selector); 10844 } 10845 if (match) { 10846 return children_fromDOM(match.childNodes); 10847 } 10848 return []; 10849 }; 10850} 10851var children_default = { 10852 concat, 10853 getChildrenArray, 10854 fromDOM: children_fromDOM, 10855 toHTML: children_toHTML, 10856 matcher: children_matcher 10857}; 10858 10859 10860;// ./node_modules/@wordpress/blocks/build-module/api/parser/get-block-attributes.js 10861 10862 10863 10864 10865 10866 10867const toBooleanAttributeMatcher = (matcher) => (value) => matcher(value) !== void 0; 10868function isOfType(value, type) { 10869 switch (type) { 10870 case "rich-text": 10871 return value instanceof external_wp_richText_namespaceObject.RichTextData; 10872 case "string": 10873 return typeof value === "string"; 10874 case "boolean": 10875 return typeof value === "boolean"; 10876 case "object": 10877 return !!value && value.constructor === Object; 10878 case "null": 10879 return value === null; 10880 case "array": 10881 return Array.isArray(value); 10882 case "integer": 10883 case "number": 10884 return typeof value === "number"; 10885 } 10886 return true; 10887} 10888function isOfTypes(value, types) { 10889 return types.some((type) => isOfType(value, type)); 10890} 10891function getBlockAttribute(attributeKey, attributeSchema, innerDOM, commentAttributes, innerHTML) { 10892 let value; 10893 switch (attributeSchema.source) { 10894 // An undefined source means that it's an attribute serialized to the 10895 // block's "comment". 10896 case void 0: 10897 value = commentAttributes ? commentAttributes[attributeKey] : void 0; 10898 break; 10899 // raw source means that it's the original raw block content. 10900 case "raw": 10901 value = innerHTML; 10902 break; 10903 case "attribute": 10904 case "property": 10905 case "html": 10906 case "text": 10907 case "rich-text": 10908 case "children": 10909 case "node": 10910 case "query": 10911 case "tag": 10912 value = parseWithAttributeSchema(innerDOM, attributeSchema); 10913 break; 10914 } 10915 if (!isValidByType(value, attributeSchema.type) || !isValidByEnum(value, attributeSchema.enum)) { 10916 value = void 0; 10917 } 10918 if (value === void 0) { 10919 value = getDefault(attributeSchema); 10920 } 10921 return value; 10922} 10923function isValidByType(value, type) { 10924 return type === void 0 || isOfTypes(value, Array.isArray(type) ? type : [type]); 10925} 10926function isValidByEnum(value, enumSet) { 10927 return !Array.isArray(enumSet) || enumSet.includes(value); 10928} 10929const matcherFromSource = memize((sourceConfig) => { 10930 switch (sourceConfig.source) { 10931 case "attribute": { 10932 let matcher = attr(sourceConfig.selector, sourceConfig.attribute); 10933 if (sourceConfig.type === "boolean") { 10934 matcher = toBooleanAttributeMatcher(matcher); 10935 } 10936 return matcher; 10937 } 10938 case "html": 10939 return matchers_html(sourceConfig.selector, sourceConfig.multiline); 10940 case "text": 10941 return es_text(sourceConfig.selector); 10942 case "rich-text": 10943 return richText( 10944 sourceConfig.selector, 10945 sourceConfig.__unstablePreserveWhiteSpace 10946 ); 10947 case "children": 10948 return children_matcher(sourceConfig.selector); 10949 case "node": 10950 return matcher(sourceConfig.selector); 10951 case "query": 10952 const subMatchers = Object.fromEntries( 10953 Object.entries(sourceConfig.query).map( 10954 ([key, subSourceConfig]) => [ 10955 key, 10956 matcherFromSource(subSourceConfig) 10957 ] 10958 ) 10959 ); 10960 return query(sourceConfig.selector, subMatchers); 10961 case "tag": { 10962 const matcher = prop(sourceConfig.selector, "nodeName"); 10963 return (domNode) => matcher(domNode)?.toLowerCase(); 10964 } 10965 default: 10966 console.error(`Unknown source type "${sourceConfig.source}"`); 10967 } 10968}); 10969function parseHtml(innerHTML) { 10970 return parse(innerHTML, (h) => h); 10971} 10972function parseWithAttributeSchema(innerHTML, attributeSchema) { 10973 return matcherFromSource(attributeSchema)(parseHtml(innerHTML)); 10974} 10975function getBlockAttributes(blockTypeOrName, innerHTML, attributes = {}) { 10976 const doc = parseHtml(innerHTML); 10977 const blockType = normalizeBlockType(blockTypeOrName); 10978 const blockAttributes = Object.fromEntries( 10979 Object.entries(blockType.attributes ?? {}).map( 10980 ([key, schema]) => [ 10981 key, 10982 getBlockAttribute(key, schema, doc, attributes, innerHTML) 10983 ] 10984 ) 10985 ); 10986 return (0,external_wp_hooks_namespaceObject.applyFilters)( 10987 "blocks.getBlockAttributes", 10988 blockAttributes, 10989 blockType, 10990 innerHTML, 10991 attributes 10992 ); 10993} 10994 10995 10996;// ./node_modules/@wordpress/blocks/build-module/api/parser/fix-custom-classname.js 10997 10998 10999 11000const CLASS_ATTR_SCHEMA = { 11001 type: "string", 11002 source: "attribute", 11003 selector: "[data-custom-class-name] > *", 11004 attribute: "class" 11005}; 11006function getHTMLRootElementClasses(innerHTML) { 11007 const parsed = parseWithAttributeSchema( 11008 `<div data-custom-class-name>${innerHTML}</div>`, 11009 CLASS_ATTR_SCHEMA 11010 ); 11011 return parsed ? parsed.trim().split(/\s+/) : []; 11012} 11013function fixCustomClassname(blockAttributes, blockType, innerHTML) { 11014 if (!hasBlockSupport(blockType, "customClassName", true)) { 11015 return blockAttributes; 11016 } 11017 const modifiedBlockAttributes = { ...blockAttributes }; 11018 const { className: omittedClassName, ...attributesSansClassName } = modifiedBlockAttributes; 11019 const serialized = getSaveContent(blockType, attributesSansClassName); 11020 const defaultClasses = getHTMLRootElementClasses(serialized); 11021 const actualClasses = getHTMLRootElementClasses(innerHTML); 11022 const customClasses = actualClasses.filter( 11023 (className) => !defaultClasses.includes(className) 11024 ); 11025 if (customClasses.length) { 11026 modifiedBlockAttributes.className = customClasses.join(" "); 11027 } else if (serialized) { 11028 delete modifiedBlockAttributes.className; 11029 } 11030 return modifiedBlockAttributes; 11031} 11032 11033 11034;// ./node_modules/@wordpress/blocks/build-module/api/parser/fix-aria-label.js 11035 11036 11037const ARIA_LABEL_ATTR_SCHEMA = { 11038 type: "string", 11039 source: "attribute", 11040 selector: "[data-aria-label] > *", 11041 attribute: "aria-label" 11042}; 11043function getHTMLRootElementAriaLabel(innerHTML) { 11044 const parsed = parseWithAttributeSchema( 11045 `<div data-aria-label>${innerHTML}</div>`, 11046 ARIA_LABEL_ATTR_SCHEMA 11047 ); 11048 return parsed; 11049} 11050function fixAriaLabel(blockAttributes, blockType, innerHTML) { 11051 if (!hasBlockSupport(blockType, "ariaLabel", false)) { 11052 return blockAttributes; 11053 } 11054 const modifiedBlockAttributes = { ...blockAttributes }; 11055 const ariaLabel = getHTMLRootElementAriaLabel(innerHTML); 11056 if (ariaLabel) { 11057 modifiedBlockAttributes.ariaLabel = ariaLabel; 11058 } 11059 return modifiedBlockAttributes; 11060} 11061 11062 11063;// ./node_modules/@wordpress/blocks/build-module/api/parser/apply-built-in-validation-fixes.js 11064 11065 11066function applyBuiltInValidationFixes(block, blockType) { 11067 const { attributes, originalContent } = block; 11068 let updatedBlockAttributes = attributes; 11069 updatedBlockAttributes = fixCustomClassname( 11070 attributes, 11071 blockType, 11072 originalContent 11073 ); 11074 updatedBlockAttributes = fixAriaLabel( 11075 updatedBlockAttributes, 11076 blockType, 11077 originalContent 11078 ); 11079 return { 11080 ...block, 11081 attributes: updatedBlockAttributes 11082 }; 11083} 11084 11085 11086;// ./node_modules/@wordpress/blocks/build-module/api/parser/apply-block-deprecated-versions.js 11087 11088 11089 11090 11091 11092function stubFalse() { 11093 return false;
11094} 11095function applyBlockDeprecatedVersions(block, rawBlock, blockType) { 11096 const parsedAttributes = rawBlock.attrs; 11097 const { deprecated: deprecatedDefinitions } = blockType; 11098 if (!deprecatedDefinitions || !deprecatedDefinitions.length) { 11099 return block; 11100 } 11101 for (let i = 0; i < deprecatedDefinitions.length; i++) { 11102 const { isEligible = stubFalse } = deprecatedDefinitions[i]; 11103 if (block.isValid && !isEligible(parsedAttributes, block.innerBlocks, { 11104 blockNode: rawBlock, 11105 block 11106 })) { 11107 continue; 11108 } 11109 const deprecatedBlockType = Object.assign( 11110 omit(blockType, DEPRECATED_ENTRY_KEYS), 11111 deprecatedDefinitions[i] 11112 ); 11113 let migratedBlock = { 11114 ...block, 11115 attributes: getBlockAttributes( 11116 deprecatedBlockType, 11117 block.originalContent, 11118 parsedAttributes 11119 ) 11120 }; 11121 let [isValid] = validateBlock(migratedBlock, deprecatedBlockType); 11122 if (!isValid) { 11123 migratedBlock = applyBuiltInValidationFixes( 11124 migratedBlock, 11125 deprecatedBlockType 11126 ); 11127 [isValid] = validateBlock(migratedBlock, deprecatedBlockType); 11128 } 11129 if (!isValid) { 11130 continue; 11131 } 11132 let migratedInnerBlocks = migratedBlock.innerBlocks; 11133 let migratedAttributes = migratedBlock.attributes; 11134 const { migrate } = deprecatedBlockType; 11135 if (migrate) { 11136 let migrated = migrate(migratedAttributes, block.innerBlocks); 11137 if (!Array.isArray(migrated)) { 11138 migrated = [migrated]; 11139 } 11140 [ 11141 migratedAttributes = parsedAttributes, 11142 migratedInnerBlocks = block.innerBlocks 11143 ] = migrated; 11144 } 11145 block = { 11146 ...block, 11147 attributes: migratedAttributes, 11148 innerBlocks: migratedInnerBlocks, 11149 isValid: true, 11150 validationIssues: [] 11151 }; 11152 } 11153 return block; 11154} 11155 11156 11157;// ./node_modules/@wordpress/blocks/build-module/api/parser/index.js 11158 11159 11160 11161 11162 11163 11164 11165 11166 11167 11168 11169function convertLegacyBlocks(rawBlock) { 11170 const [correctName, correctedAttributes] = convertLegacyBlockNameAndAttributes( 11171 rawBlock.blockName, 11172 rawBlock.attrs 11173 ); 11174 return { 11175 ...rawBlock, 11176 blockName: correctName, 11177 attrs: correctedAttributes 11178 }; 11179} 11180function normalizeRawBlock(rawBlock, options) { 11181 const fallbackBlockName = getFreeformContentHandlerName(); 11182 const rawBlockName = rawBlock.blockName || getFreeformContentHandlerName(); 11183 const rawAttributes = rawBlock.attrs || {}; 11184 const rawInnerBlocks = rawBlock.innerBlocks || []; 11185 let rawInnerHTML = rawBlock.innerHTML.trim(); 11186 if (rawBlockName === fallbackBlockName && rawBlockName === "core/freeform" && !options?.__unstableSkipAutop) { 11187 rawInnerHTML = (0,external_wp_autop_namespaceObject.autop)(rawInnerHTML).trim(); 11188 } 11189 return { 11190 ...rawBlock, 11191 blockName: rawBlockName, 11192 attrs: rawAttributes, 11193 innerHTML: rawInnerHTML, 11194 innerBlocks: rawInnerBlocks 11195 }; 11196} 11197function createMissingBlockType(rawBlock) { 11198 const unregisteredFallbackBlock = getUnregisteredTypeHandlerName() || getFreeformContentHandlerName(); 11199 const originalUndelimitedContent = serializeRawBlock(rawBlock, { 11200 isCommentDelimited: false 11201 }); 11202 const originalContent = serializeRawBlock(rawBlock, { 11203 isCommentDelimited: true 11204 }); 11205 return { 11206 blockName: unregisteredFallbackBlock, 11207 attrs: { 11208 originalName: rawBlock.blockName, 11209 originalContent, 11210 originalUndelimitedContent 11211 }, 11212 innerHTML: rawBlock.blockName ? originalContent : rawBlock.innerHTML, 11213 innerBlocks: rawBlock.innerBlocks, 11214 innerContent: rawBlock.innerContent 11215 }; 11216} 11217function applyBlockValidation(unvalidatedBlock, blockType) { 11218 const [isValid] = validateBlock(unvalidatedBlock, blockType); 11219 if (isValid) { 11220 return { ...unvalidatedBlock, isValid, validationIssues: [] }; 11221 } 11222 const fixedBlock = applyBuiltInValidationFixes( 11223 unvalidatedBlock,
11224 blockType 11225 ); 11226 const [isFixedValid, validationIssues] = validateBlock( 11227 fixedBlock, 11228 blockType 11229 ); 11230 return { ...fixedBlock, isValid: isFixedValid, validationIssues }; 11231} 11232function parseRawBlock(rawBlock, options) { 11233 let normalizedBlock = normalizeRawBlock(rawBlock, options); 11234 normalizedBlock = convertLegacyBlocks(normalizedBlock); 11235 let blockType = getBlockType(normalizedBlock.blockName); 11236 if (!blockType) { 11237 normalizedBlock = createMissingBlockType(normalizedBlock); 11238 blockType = getBlockType(normalizedBlock.blockName); 11239 } 11240 const isFallbackBlock = normalizedBlock.blockName === getFreeformContentHandlerName() || normalizedBlock.blockName === getUnregisteredTypeHandlerName(); 11241 if (!blockType || !normalizedBlock.innerHTML && isFallbackBlock) { 11242 return; 11243 } 11244 const parsedInnerBlocks = normalizedBlock.innerBlocks.map((innerBlock) => parseRawBlock(innerBlock, options)).filter((innerBlock) => !!innerBlock); 11245 const parsedBlock = createBlock( 11246 normalizedBlock.blockName, 11247 getBlockAttributes( 11248 blockType, 11249 normalizedBlock.innerHTML, 11250 normalizedBlock.attrs 11251 ), 11252 parsedInnerBlocks 11253 ); 11254 parsedBlock.originalContent = normalizedBlock.innerHTML; 11255 const validatedBlock = applyBlockValidation(parsedBlock, blockType); 11256 const { validationIssues } = validatedBlock; 11257 const updatedBlock = applyBlockDeprecatedVersions( 11258 validatedBlock,
11259 normalizedBlock, 11260 blockType 11261 ); 11262 if (!updatedBlock.isValid) { 11263 updatedBlock.__unstableBlockSource = rawBlock; 11264 } 11265 if (!validatedBlock.isValid && updatedBlock.isValid && !options?.__unstableSkipMigrationLogs) { 11266 console.groupCollapsed("Updated Block: %s", blockType.name); 11267 console.info( 11268 "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", 11269 blockType.name, 11270 blockType, 11271 getSaveContent(blockType, updatedBlock.attributes), 11272 updatedBlock.originalContent 11273 ); 11274 console.groupEnd(); 11275 } else if (!validatedBlock.isValid && !updatedBlock.isValid) { 11276 validationIssues.forEach(({ log, args }) => log(...args)); 11277 } 11278 return updatedBlock; 11279} 11280function parser_parse(content, options) { 11281 return (0,external_wp_blockSerializationDefaultParser_namespaceObject.parse)(content).reduce((accumulator, rawBlock) => { 11282 const block = parseRawBlock(rawBlock, options); 11283 if (block) { 11284 accumulator.push(block); 11285 } 11286 return accumulator; 11287 }, []); 11288} 11289 11290 11291;// ./node_modules/@wordpress/blocks/build-module/api/raw-handling/get-raw-transforms.js 11292 11293function getRawTransforms() { 11294 return getBlockTransforms("from").filter(({ type }) => type === "raw").map((transform) => { 11295 return transform.isMatch ? transform : { 11296 ...transform, 11297 isMatch: (node) => transform.selector && node.matches(transform.selector) 11298 }; 11299 }); 11300} 11301 11302 11303;// ./node_modules/@wordpress/blocks/build-module/api/raw-handling/html-to-blocks.js 11304 11305 11306 11307 11308 11309function htmlToBlocks(html, handler) { 11310 const doc = document.implementation.createHTMLDocument(""); 11311 doc.body.innerHTML = html; 11312 return Array.from(doc.body.children).flatMap((node) => { 11313 const rawTransform = findTransform( 11314 getRawTransforms(), 11315 ({ isMatch }) => isMatch(node) 11316 ); 11317 if (!rawTransform) { 11318 if (external_wp_element_namespaceObject.Platform.isNative) { 11319 return parser_parse( 11320 `<!-- wp:html -->${node.outerHTML}<!-- /wp:html -->` 11321 ); 11322 } 11323 return createBlock( 11324 // Should not be hardcoded. 11325 "core/html", 11326 getBlockAttributes("core/html", node.outerHTML) 11327 ); 11328 } 11329 const { transform, blockName } = rawTransform; 11330 if (transform) { 11331 const block = transform(node, handler); 11332 if (node.hasAttribute("class")) { 11333 block.attributes.className = node.getAttribute("class"); 11334 } 11335 return block; 11336 } 11337 return createBlock( 11338 blockName, 11339 getBlockAttributes(blockName, node.outerHTML) 11340 ); 11341 }); 11342} 11343 11344 11345;// ./node_modules/@wordpress/blocks/build-module/api/raw-handling/normalise-blocks.js 11346 11347function normaliseBlocks(HTML, options = {}) { 11348 const decuDoc = document.implementation.createHTMLDocument(""); 11349 const accuDoc = document.implementation.createHTMLDocument(""); 11350 const decu = decuDoc.body; 11351 const accu = accuDoc.body; 11352 decu.innerHTML = HTML; 11353 while (decu.firstChild) { 11354 const node = decu.firstChild; 11355 if (node.nodeType === node.TEXT_NODE) { 11356 if ((0,external_wp_dom_namespaceObject.isEmpty)(node)) { 11357 decu.removeChild(node); 11358 } else { 11359 if (!accu.lastChild || accu.lastChild.nodeName !== "P") { 11360 accu.appendChild(accuDoc.createElement("P")); 11361 } 11362 accu.lastChild.appendChild(node); 11363 } 11364 } else if (node.nodeType === node.ELEMENT_NODE) { 11365 if (node.nodeName === "BR") { 11366 if (node.nextSibling && node.nextSibling.nodeName === "BR") { 11367 accu.appendChild(accuDoc.createElement("P")); 11368 decu.removeChild(node.nextSibling); 11369 } 11370 if (accu.lastChild && accu.lastChild.nodeName === "P" && accu.lastChild.hasChildNodes()) { 11371 accu.lastChild.appendChild(node); 11372 } else { 11373 decu.removeChild(node); 11374 } 11375 } else if (node.nodeName === "P") { 11376 if ((0,external_wp_dom_namespaceObject.isEmpty)(node) && !options.raw) { 11377 decu.removeChild(node); 11378 } else { 11379 accu.appendChild(node); 11380 } 11381 } else if ((0,external_wp_dom_namespaceObject.isPhrasingContent)(node)) {
11382 if (!accu.lastChild || accu.lastChild.nodeName !== "P") { 11383 accu.appendChild(accuDoc.createElement("P")); 11384 } 11385 accu.lastChild.appendChild(node); 11386 } else { 11387 accu.appendChild(node); 11388 } 11389 } else { 11390 decu.removeChild(node); 11391 } 11392 } 11393 return accu.innerHTML; 11394} 11395 11396 11397;// ./node_modules/@wordpress/blocks/build-module/api/raw-handling/special-comment-converter.js 11398 11399function specialCommentConverter(node, doc) { 11400 if (node.nodeType !== node.COMMENT_NODE) { 11401 return; 11402 } 11403 if (node.nodeValue !== "nextpage" && node.nodeValue.indexOf("more") !== 0) { 11404 return; 11405 } 11406 const block = special_comment_converter_createBlock(node, doc); 11407 if (!node.parentNode || node.parentNode.nodeName !== "P") { 11408 (0,external_wp_dom_namespaceObject.replace)(node, block); 11409 } else { 11410 const childNodes = Array.from(node.parentNode.childNodes); 11411 const nodeIndex = childNodes.indexOf(node); 11412 const wrapperNode = node.parentNode.parentNode || doc.body; 11413 const paragraphBuilder = (acc, child) => { 11414 if (!acc) { 11415 acc = doc.createElement("p"); 11416 } 11417 acc.appendChild(child); 11418 return acc; 11419 }; 11420 [ 11421 childNodes.slice(0, nodeIndex).reduce(paragraphBuilder, null), 11422 block, 11423 childNodes.slice(nodeIndex + 1).reduce(paragraphBuilder, null) 11424 ].forEach( 11425 (element) => element && wrapperNode.insertBefore(element, node.parentNode) 11426 ); 11427 (0,external_wp_dom_namespaceObject.remove)(node.parentNode); 11428 } 11429} 11430function special_comment_converter_createBlock(commentNode, doc) { 11431 if (commentNode.nodeValue === "nextpage") { 11432 return createNextpage(doc); 11433 } 11434 const customText = commentNode.nodeValue.slice(4).trim(); 11435 let sibling = commentNode; 11436 let noTeaser = false; 11437 while (sibling = sibling.nextSibling) { 11438 if (sibling.nodeType === sibling.COMMENT_NODE && sibling.nodeValue === "noteaser") { 11439 noTeaser = true; 11440 (0,external_wp_dom_namespaceObject.remove)(sibling); 11441 break; 11442 } 11443 } 11444 return createMore(customText, noTeaser, doc); 11445} 11446function createMore(customText, noTeaser, doc) { 11447 const node = doc.createElement("wp-block"); 11448 node.dataset.block = "core/more"; 11449 if (customText) { 11450 node.dataset.customText = customText; 11451 } 11452 if (noTeaser) { 11453 node.dataset.noTeaser = ""; 11454 } 11455 return node; 11456} 11457function createNextpage(doc) { 11458 const node = doc.createElement("wp-block"); 11459 node.dataset.block = "core/nextpage"; 11460 return node; 11461} 11462 11463 11464;// ./node_modules/@wordpress/blocks/build-module/api/raw-handling/list-reducer.js 11465 11466function isList(node) { 11467 return node.nodeName === "OL" || node.nodeName === "UL"; 11468} 11469function shallowTextContent(element) { 11470 return Array.from(element.childNodes).map(({ nodeValue = "" }) => nodeValue).join(""); 11471} 11472function listReducer(node) { 11473 if (!isList(node)) { 11474 return; 11475 } 11476 const list = node; 11477 const prevElement = node.previousElementSibling; 11478 if (prevElement && prevElement.nodeName === node.nodeName && list.children.length === 1) { 11479 while (list.firstChild) { 11480 prevElement.appendChild(list.firstChild); 11481 } 11482 list.parentNode.removeChild(list); 11483 } 11484 const parentElement = node.parentNode; 11485 if (parentElement && parentElement.nodeName === "LI" && parentElement.children.length === 1 && !/\S/.test(shallowTextContent(parentElement))) { 11486 const parentListItem = parentElement; 11487 const prevListItem = parentListItem.previousElementSibling; 11488 const parentList = parentListItem.parentNode; 11489 if (prevListItem) { 11490 prevListItem.appendChild(list); 11491 parentList.removeChild(parentListItem); 11492 } 11493 } 11494 if (parentElement && isList(parentElement)) { 11495 const prevListItem = node.previousElementSibling; 11496 if (prevListItem) { 11497 prevListItem.appendChild(node); 11498 } else { 11499 (0,external_wp_dom_namespaceObject.unwrap)(node); 11500 } 11501 } 11502} 11503 11504 11505;// ./node_modules/@wordpress/blocks/build-module/api/raw-handling/blockquote-normaliser.js 11506 11507function blockquoteNormaliser(options) { 11508 return (node) => { 11509 if (node.nodeName !== "BLOCKQUOTE") { 11510 return; 11511 } 11512 node.innerHTML = normaliseBlocks(node.innerHTML, options); 11513 }; 11514} 11515 11516 11517;// ./node_modules/@wordpress/blocks/build-module/api/raw-handling/figure-content-reducer.js 11518 11519function isFigureContent(node, schema) { 11520 const tag = node.nodeName.toLowerCase(); 11521 if (tag === "figcaption" || (0,external_wp_dom_namespaceObject.isTextContent)(node)) { 11522 return false;
11523 } 11524 return tag in (schema?.figure?.children ?? {}); 11525} 11526function canHaveAnchor(node, schema) { 11527 const tag = node.nodeName.toLowerCase(); 11528 return tag in (schema?.figure?.children?.a?.children ?? {}); 11529} 11530function wrapFigureContent(element, beforeElement = element) { 11531 const figure = element.ownerDocument.createElement("figure"); 11532 beforeElement.parentNode.insertBefore(figure, beforeElement); 11533 figure.appendChild(element); 11534} 11535function figureContentReducer(node, doc, schema) { 11536 if (!isFigureContent(node, schema)) { 11537 return; 11538 } 11539 let nodeToInsert = node; 11540 const parentNode = node.parentNode; 11541 if (canHaveAnchor(node, schema) && parentNode.nodeName === "A" && parentNode.childNodes.length === 1) { 11542 nodeToInsert = node.parentNode; 11543 } 11544 const wrapper = nodeToInsert.closest("p,div"); 11545 if (wrapper) { 11546 if (!node.classList) { 11547 wrapFigureContent(nodeToInsert, wrapper); 11548 } else if (node.classList.contains("alignright") || node.classList.contains("alignleft") || node.classList.contains("aligncenter") || !wrapper.textContent.trim()) { 11549 wrapFigureContent(nodeToInsert, wrapper); 11550 } 11551 } else { 11552 wrapFigureContent(nodeToInsert); 11553 } 11554} 11555 11556 11557;// external ["wp","shortcode"] 11558const external_wp_shortcode_namespaceObject = window["wp"]["shortcode"]; 11559;// ./node_modules/@wordpress/blocks/build-module/api/raw-handling/shortcode-converter.js 11560 11561 11562 11563 11564 11565const castArray = (maybeArray) => Array.isArray(maybeArray) ? maybeArray : [maybeArray]; 11566const beforeLineRegexp = /(\n|<p>)\s*$/; 11567const afterLineRegexp = /^\s*(\n|<\/p>)/; 11568function segmentHTMLToShortcodeBlock(HTML, lastIndex = 0, excludedBlockNames = []) { 11569 const transformsFrom = getBlockTransforms("from"); 11570 const transformation = findTransform( 11571 transformsFrom, 11572 (transform) => excludedBlockNames.indexOf(transform.blockName) === -1 && transform.type === "shortcode" && castArray(transform.tag).some( 11573 (tag) => (0,external_wp_shortcode_namespaceObject.regexp)(tag).test(HTML) 11574 ) 11575 ); 11576 if (!transformation) { 11577 return [HTML]; 11578 } 11579 const transformTags = castArray(transformation.tag); 11580 const transformTag = transformTags.find( 11581 (tag) => (0,external_wp_shortcode_namespaceObject.regexp)(tag).test(HTML) 11582 ); 11583 let match; 11584 const previousIndex = lastIndex; 11585 if (match = (0,external_wp_shortcode_namespaceObject.next)(transformTag, HTML, lastIndex)) { 11586 lastIndex = match.index + match.content.length; 11587 const beforeHTML = HTML.substr(0, match.index); 11588 const afterHTML = HTML.substr(lastIndex); 11589 if (!match.shortcode.content?.includes("<") && !(beforeLineRegexp.test(beforeHTML) && afterLineRegexp.test(afterHTML))) { 11590 return segmentHTMLToShortcodeBlock(HTML, lastIndex); 11591 } 11592 if (transformation.isMatch && !transformation.isMatch(match.shortcode.attrs)) { 11593 return segmentHTMLToShortcodeBlock(HTML, previousIndex, [ 11594 ...excludedBlockNames, 11595 transformation.blockName 11596 ]); 11597 } 11598 let blocks = []; 11599 if (typeof transformation.transform === "function") { 11600 blocks = [].concat( 11601 transformation.transform(match.shortcode.attrs, match) 11602 ); 11603 blocks = blocks.map((block) => { 11604 block.originalContent = match.shortcode.content; 11605 return applyBuiltInValidationFixes( 11606 block, 11607 getBlockType(block.name) 11608 ); 11609 }); 11610 } else { 11611 const attributes = Object.fromEntries( 11612 Object.entries(transformation.attributes).filter(([, schema]) => schema.shortcode).map(([key, schema]) => [ 11613 key, 11614 schema.shortcode(match.shortcode.attrs, match) 11615 ]) 11616 ); 11617 const blockType = getBlockType(transformation.blockName); 11618 if (!blockType) { 11619 return [HTML]; 11620 } 11621 const transformationBlockType = { 11622 ...blockType, 11623 attributes: transformation.attributes 11624 }; 11625 let block = createBlock( 11626 transformation.blockName, 11627 getBlockAttributes( 11628 transformationBlockType, 11629 match.shortcode.content, 11630 attributes 11631 ) 11632 ); 11633 block.originalContent = match.shortcode.content; 11634 block = applyBuiltInValidationFixes( 11635 block, 11636 transformationBlockType 11637 ); 11638 blocks = [block]; 11639 } 11640 return [ 11641 ...segmentHTMLToShortcodeBlock( 11642 beforeHTML.replace(beforeLineRegexp, "") 11643 ), 11644 ...blocks, 11645 ...segmentHTMLToShortcodeBlock( 11646 afterHTML.replace(afterLineRegexp, "") 11647 ) 11648 ]; 11649 } 11650 return [HTML]; 11651} 11652var shortcode_converter_default = segmentHTMLToShortcodeBlock; 11653 11654 11655;// ./node_modules/@wordpress/blocks/build-module/api/raw-handling/utils.js 11656 11657 11658 11659function getBlockContentSchemaFromTransforms(transforms, context) { 11660 const phrasingContentSchema = (0,external_wp_dom_namespaceObject.getPhrasingContentSchema)(context); 11661 const schemaArgs = { phrasingContentSchema, isPaste: context === "paste" }; 11662 const schemas = transforms.map(({ isMatch, blockName, schema }) => { 11663 const hasAnchorSupport = hasBlockSupport(blockName, "anchor"); 11664 schema = typeof schema === "function" ? schema(schemaArgs) : schema; 11665 if (!hasAnchorSupport && !isMatch) { 11666 return schema; 11667 } 11668 if (!schema) { 11669 return {}; 11670 } 11671 return Object.fromEntries( 11672 Object.entries(schema).map(([key, value]) => { 11673 let attributes = value.attributes || []; 11674 if (hasAnchorSupport) { 11675 attributes = [...attributes, "id"]; 11676 } 11677 return [ 11678 key, 11679 { 11680 ...value, 11681 attributes,
11682 isMatch: isMatch ? isMatch : void 0 11683 } 11684 ]; 11685 }) 11686 ); 11687 }); 11688 function mergeTagNameSchemaProperties(objValue, srcValue, key) { 11689 switch (key) { 11690 case "children": { 11691 if (objValue === "*" || srcValue === "*") { 11692 return "*"; 11693 } 11694 return { ...objValue, ...srcValue }; 11695 } 11696 case "attributes": 11697 case "require": { 11698 return [...objValue || [], ...srcValue || []]; 11699 } 11700 case "isMatch": { 11701 if (!objValue || !srcValue) { 11702 return void 0; 11703 } 11704 return (...args) => { 11705 return objValue(...args) || srcValue(...args); 11706 }; 11707 } 11708 } 11709 } 11710 function mergeTagNameSchemas(a, b) { 11711 for (const key in b) { 11712 a[key] = a[key] ? mergeTagNameSchemaProperties(a[key], b[key], key) : { ...b[key] }; 11713 } 11714 return a; 11715 } 11716 function mergeSchemas(a, b) { 11717 for (const key in b) { 11718 a[key] = a[key] ? mergeTagNameSchemas(a[key], b[key]) : { ...b[key] }; 11719 } 11720 return a; 11721 } 11722 return schemas.reduce(mergeSchemas, {}); 11723} 11724function getBlockContentSchema(context) { 11725 return getBlockContentSchemaFromTransforms(getRawTransforms(), context); 11726} 11727function isPlain(HTML) { 11728 return !/<(?!br[ />])/i.test(HTML); 11729} 11730function deepFilterNodeList(nodeList, filters, doc, schema) { 11731 Array.from(nodeList).forEach((node) => { 11732 deepFilterNodeList(node.childNodes, filters, doc, schema); 11733 filters.forEach((item) => { 11734 if (!doc.contains(node)) { 11735 return; 11736 } 11737 item(node, doc, schema); 11738 }); 11739 }); 11740} 11741function deepFilterHTML(HTML, filters = [], schema) { 11742 const doc = document.implementation.createHTMLDocument(""); 11743 doc.body.innerHTML = HTML; 11744 deepFilterNodeList(doc.body.childNodes, filters, doc, schema); 11745 return doc.body.innerHTML; 11746} 11747function getSibling(node, which) { 11748 const sibling = node[`${which}Sibling`]; 11749 if (sibling && (0,external_wp_dom_namespaceObject.isPhrasingContent)(sibling)) { 11750 return sibling; 11751 } 11752 const { parentNode } = node; 11753 if (!parentNode || !(0,external_wp_dom_namespaceObject.isPhrasingContent)(parentNode)) { 11754 return; 11755 } 11756 return getSibling(parentNode, which); 11757} 11758 11759 11760;// ./node_modules/@wordpress/blocks/build-module/api/raw-handling/index.js 11761 11762 11763 11764 11765 11766 11767 11768 11769 11770 11771 11772 11773function deprecatedGetPhrasingContentSchema(context) { 11774 external_wp_deprecated_default()("wp.blocks.getPhrasingContentSchema", { 11775 since: "5.6", 11776 alternative: "wp.dom.getPhrasingContentSchema" 11777 }); 11778 return (0,external_wp_dom_namespaceObject.getPhrasingContentSchema)(context); 11779} 11780function rawHandler({ HTML = "" }) { 11781 if (HTML.indexOf("<!-- wp:") !== -1) { 11782 const parseResult = parser_parse(HTML); 11783 const isSingleFreeFormBlock = parseResult.length === 1 && parseResult[0].name === "core/freeform"; 11784 if (!isSingleFreeFormBlock) { 11785 return parseResult; 11786 } 11787 } 11788 const pieces = shortcode_converter_default(HTML); 11789 const blockContentSchema = getBlockContentSchema(); 11790 return pieces.map((piece) => { 11791 if (typeof piece !== "string") { 11792 return piece; 11793 } 11794 const filters = [ 11795 // Needed to adjust invalid lists. 11796 listReducer, 11797 // Needed to create more and nextpage blocks. 11798 specialCommentConverter, 11799 // Needed to create media blocks. 11800 figureContentReducer, 11801 // Needed to create the quote block, which cannot handle text 11802 // without wrapper paragraphs. 11803 blockquoteNormaliser({ raw: true }) 11804 ]; 11805 piece = deepFilterHTML(piece, filters, blockContentSchema); 11806 piece = normaliseBlocks(piece, { raw: true }); 11807 return htmlToBlocks(piece, rawHandler); 11808 }).flat().filter(Boolean); 11809} 11810 11811 11812;// ./node_modules/@wordpress/blocks/build-module/api/raw-handling/comment-remover.js 11813 11814function commentRemover(node) { 11815 if (node.nodeType === node.COMMENT_NODE) { 11816 (0,external_wp_dom_namespaceObject.remove)(node); 11817 } 11818} 11819 11820 11821;// ./node_modules/@wordpress/blocks/build-module/api/raw-handling/is-inline-content.js 11822 11823function isInline(node, contextTag) { 11824 if ((0,external_wp_dom_namespaceObject.isTextContent)(node)) { 11825 return true; 11826 } 11827 if (!contextTag) { 11828 return false; 11829 } 11830 const tag = node.nodeName.toLowerCase(); 11831 const inlineAllowedTagGroups = [ 11832 ["ul", "li", "ol"], 11833 ["h1", "h2", "h3", "h4", "h5", "h6"] 11834 ]; 11835 return inlineAllowedTagGroups.some( 11836 (tagGroup) => [tag, contextTag].filter((t) => !tagGroup.includes(t)).length === 0 11837 ); 11838} 11839function deepCheck(nodes, contextTag) { 11840 return nodes.every( 11841 (node) => isInline(node, contextTag) && deepCheck(Array.from(node.children), contextTag) 11842 ); 11843} 11844function isDoubleBR(node) { 11845 return node.nodeName === "BR" && node.previousSibling && node.previousSibling.nodeName === "BR"; 11846} 11847function isInlineContent(HTML, contextTag) { 11848 const doc = document.implementation.createHTMLDocument(""); 11849 doc.body.innerHTML = HTML; 11850 const nodes = Array.from(doc.body.children); 11851 return !nodes.some(isDoubleBR) && deepCheck(nodes, contextTag); 11852} 11853 11854 11855;// ./node_modules/@wordpress/blocks/build-module/api/raw-handling/phrasing-content-reducer.js 11856 11857function phrasingContentReducer(node, doc) { 11858 if (node.nodeName === "SPAN" && node.style) { 11859 const { 11860 fontWeight, 11861 fontStyle, 11862 textDecorationLine, 11863 textDecoration, 11864 verticalAlign 11865 } = node.style; 11866 if (fontWeight === "bold" || fontWeight === "700") { 11867 (0,external_wp_dom_namespaceObject.wrap)(doc.createElement("strong"), node); 11868 } 11869 if (fontStyle === "italic") { 11870 (0,external_wp_dom_namespaceObject.wrap)(doc.createElement("em"), node); 11871 } 11872 if (textDecorationLine === "line-through" || textDecoration.includes("line-through")) { 11873 (0,external_wp_dom_namespaceObject.wrap)(doc.createElement("s"), node); 11874 } 11875 if (verticalAlign === "super") { 11876 (0,external_wp_dom_namespaceObject.wrap)(doc.createElement("sup"), node); 11877 } else if (verticalAlign === "sub") { 11878 (0,external_wp_dom_namespaceObject.wrap)(doc.createElement("sub"), node); 11879 } 11880 } else if (node.nodeName === "B") { 11881 node = (0,external_wp_dom_namespaceObject.replaceTag)(node, "strong"); 11882 } else if (node.nodeName === "I") { 11883 node = (0,external_wp_dom_namespaceObject.replaceTag)(node, "em"); 11884 } else if (node.nodeName === "A") { 11885 if (node.target && node.target.toLowerCase() === "_blank") { 11886 node.rel = "noreferrer noopener"; 11887 } else { 11888 node.removeAttribute("target"); 11889 node.removeAttribute("rel"); 11890 } 11891 if (node.name && !node.id) { 11892 node.id = node.name; 11893 } 11894 if (node.id && !node.ownerDocument.querySelector(`[href="#${node.id}"]`)) { 11895 node.removeAttribute("id"); 11896 } 11897 } 11898} 11899 11900 11901;// ./node_modules/@wordpress/blocks/build-module/api/raw-handling/head-remover.js 11902function headRemover(node) { 11903 if (node.nodeName !== "SCRIPT" && node.nodeName !== "NOSCRIPT" && node.nodeName !== "TEMPLATE" && node.nodeName !== "STYLE") { 11904 return; 11905 } 11906 node.parentNode.removeChild(node); 11907} 11908 11909 11910;// ./node_modules/@wordpress/blocks/build-module/api/raw-handling/ms-list-ignore.js 11911function msListIgnore(node) {
11912 if (node.nodeType !== node.ELEMENT_NODE) { 11913 return; 11914 } 11915 const style = node.getAttribute("style"); 11916 if (!style || !style.includes("mso-list")) { 11917 return; 11918 } 11919 const rules = style.split(";").reduce((acc, rule) => { 11920 const [key, value] = rule.split(":"); 11921 if (key && value) { 11922 acc[key.trim().toLowerCase()] = value.trim().toLowerCase(); 11923 } 11924 return acc; 11925 }, {}); 11926 if (rules["mso-list"] === "ignore") { 11927 node.remove(); 11928 } 11929} 11930 11931 11932;// ./node_modules/@wordpress/blocks/build-module/api/raw-handling/ms-list-converter.js 11933 11934 11935function ms_list_converter_isList(node) { 11936 return node.nodeName === "OL" || node.nodeName === "UL"; 11937} 11938function msListConverter(node, doc) { 11939 if (node.nodeName !== "P") { 11940 return; 11941 } 11942 const style = node.getAttribute("style"); 11943 if (!style || !style.includes("mso-list")) { 11944 return; 11945 } 11946 const prevNode = node.previousElementSibling; 11947 if (!prevNode || !ms_list_converter_isList(prevNode)) { 11948 const type = node.textContent.trim().slice(0, 1); 11949 const isNumeric = /[1iIaA]/.test(type); 11950 const newListNode = doc.createElement(isNumeric ? "ol" : "ul"); 11951 if (isNumeric) { 11952 newListNode.setAttribute("type", type); 11953 } 11954 node.parentNode.insertBefore(newListNode, node); 11955 } 11956 const listNode = node.previousElementSibling; 11957 const listType = listNode.nodeName; 11958 const listItem = doc.createElement("li"); 11959 let receivingNode = listNode; 11960 listItem.innerHTML = deepFilterHTML(node.innerHTML, [msListIgnore]); 11961 const matches = /mso-list\s*:[^;]+level([0-9]+)/i.exec(style); 11962 let level = matches ? parseInt(matches[1], 10) - 1 || 0 : 0; 11963 while (level--) { 11964 receivingNode = receivingNode.lastChild || receivingNode; 11965 if (ms_list_converter_isList(receivingNode)) { 11966 receivingNode = receivingNode.lastChild || receivingNode; 11967 } 11968 } 11969 if (!ms_list_converter_isList(receivingNode)) { 11970 receivingNode = receivingNode.appendChild( 11971 doc.createElement(listType) 11972 ); 11973 } 11974 receivingNode.appendChild(listItem); 11975 node.parentNode.removeChild(node); 11976} 11977 11978 11979;// external ["wp","blob"] 11980const external_wp_blob_namespaceObject = window["wp"]["blob"]; 11981;// ./node_modules/@wordpress/blocks/build-module/api/raw-handling/image-corrector.js 11982 11983function imageCorrector(node) { 11984 if (node.nodeName !== "IMG") { 11985 return; 11986 } 11987 if (node.src.indexOf("file:") === 0) { 11988 node.src = ""; 11989 } 11990 if (node.src.indexOf("data:") === 0) { 11991 const [properties, data] = node.src.split(","); 11992 const [type] = properties.slice(5).split(";"); 11993 if (!data || !type) { 11994 node.src = ""; 11995 return; 11996 } 11997 let decoded; 11998 try { 11999 decoded = atob(data); 12000 } catch (e) { 12001 node.src = ""; 12002 return; 12003 } 12004 const uint8Array = new Uint8Array(decoded.length); 12005 for (let i = 0; i < uint8Array.length; i++) { 12006 uint8Array[i] = decoded.charCodeAt(i); 12007 } 12008 const name = type.replace("/", "."); 12009 const file = new window.File([uint8Array], name, { type }); 12010 node.src = (0,external_wp_blob_namespaceObject.createBlobURL)(file); 12011 } 12012 if (node.height === 1 || node.width === 1) { 12013 node.parentNode.removeChild(node); 12014 } 12015} 12016 12017 12018;// ./node_modules/@wordpress/blocks/build-module/api/raw-handling/div-normaliser.js 12019 12020function divNormaliser(node) { 12021 if (node.nodeName !== "DIV") { 12022 return; 12023 } 12024 node.innerHTML = normaliseBlocks(node.innerHTML); 12025} 12026 12027 12028// EXTERNAL MODULE: ./node_modules/showdown/dist/showdown.js 12029var showdown = __webpack_require__(1030); 12030var showdown_default = /*#__PURE__*/__webpack_require__.n(showdown); 12031;// ./node_modules/@wordpress/blocks/build-module/api/raw-handling/markdown-converter.js 12032 12033const converter = new (showdown_default()).Converter({ 12034 noHeaderId: true, 12035 tables: true, 12036 literalMidWordUnderscores: true, 12037 omitExtraWLInCodeBlocks: true, 12038 simpleLineBreaks: true, 12039 strikethrough: true 12040}); 12041function slackMarkdownVariantCorrector(text) { 12042 return text.replace( 12043 /((?:^|\n)```)([^\n`]+)(```(?:$|\n))/, 12044 (match, p1, p2, p3) => `${p1} 12045${p2} 12046${p3}` 12047 ); 12048} 12049function bulletsToAsterisks(text) { 12050 return text.replace(/(^|\n)â¢( +)/g, "$1*$2"); 12051} 12052function markdownConverter(text) { 12053 return converter.makeHtml( 12054 slackMarkdownVariantCorrector(bulletsToAsterisks(text)) 12055 ); 12056} 12057 12058 12059;// ./node_modules/@wordpress/blocks/build-module/api/raw-handling/iframe-remover.js 12060function iframeRemover(node) { 12061 if (node.nodeName === "IFRAME") { 12062 const text = node.ownerDocument.createTextNode(node.src); 12063 node.parentNode.replaceChild(text, node); 12064 } 12065} 12066 12067 12068;// ./node_modules/@wordpress/blocks/build-module/api/raw-handling/google-docs-uid-remover.js 12069 12070function googleDocsUIdRemover(node) { 12071 if (!node.id || node.id.indexOf("docs-internal-guid-") !== 0) { 12072 return; 12073 } 12074 if (node.tagName === "B") { 12075 (0,external_wp_dom_namespaceObject.unwrap)(node); 12076 } else { 12077 node.removeAttribute("id"); 12078 } 12079} 12080 12081 12082;// ./node_modules/@wordpress/blocks/build-module/api/raw-handling/html-formatting-remover.js 12083 12084function isFormattingSpace(character) { 12085 return character === " " || character === "\r" || character === "\n" || character === " "; 12086} 12087function htmlFormattingRemover(node) {
12088 if (node.nodeType !== node.TEXT_NODE) { 12089 return; 12090 } 12091 let parent = node; 12092 while (parent = parent.parentNode) { 12093 if (parent.nodeType === parent.ELEMENT_NODE && parent.nodeName === "PRE") { 12094 return; 12095 } 12096 } 12097 let newData = node.data.replace(/[ \r\n\t]+/g, " "); 12098 if (newData[0] === " ") { 12099 const previousSibling = getSibling(node, "previous"); 12100 if (!previousSibling || previousSibling.nodeName === "BR" || previousSibling.textContent.slice(-1) === " ") { 12101 newData = newData.slice(1); 12102 } 12103 } 12104 if (newData[newData.length - 1] === " ") { 12105 const nextSibling = getSibling(node, "next"); 12106 if (!nextSibling || nextSibling.nodeName === "BR" || nextSibling.nodeType === nextSibling.TEXT_NODE && isFormattingSpace(nextSibling.textContent[0])) { 12107 newData = newData.slice(0, -1); 12108 } 12109 } 12110 if (!newData) { 12111 node.parentNode.removeChild(node); 12112 } else { 12113 node.data = newData; 12114 } 12115} 12116 12117 12118;// ./node_modules/@wordpress/blocks/build-module/api/raw-handling/br-remover.js 12119 12120function brRemover(node) { 12121 if (node.nodeName !== "BR") { 12122 return; 12123 } 12124 if (getSibling(node, "next")) { 12125 return; 12126 } 12127 node.parentNode.removeChild(node); 12128} 12129 12130 12131;// ./node_modules/@wordpress/blocks/build-module/api/raw-handling/empty-paragraph-remover.js 12132function emptyParagraphRemover(node) { 12133 if (node.nodeName !== "P") { 12134 return; 12135 } 12136 if (node.hasChildNodes()) { 12137 return; 12138 } 12139 node.parentNode.removeChild(node); 12140} 12141 12142 12143;// ./node_modules/@wordpress/blocks/build-module/api/raw-handling/slack-paragraph-corrector.js 12144function slackParagraphCorrector(node) { 12145 if (node.nodeName !== "SPAN") { 12146 return; 12147 } 12148 if (node.getAttribute("data-stringify-type") !== "paragraph-break") { 12149 return; 12150 } 12151 const { parentNode } = node; 12152 parentNode.insertBefore(node.ownerDocument.createElement("br"), node); 12153 parentNode.insertBefore(node.ownerDocument.createElement("br"), node); 12154 parentNode.removeChild(node); 12155} 12156 12157 12158;// ./node_modules/@wordpress/blocks/build-module/api/raw-handling/latex-to-math.js 12159function isLatexMathMode(text) { 12160 const lettersRegex = /[\p{L}\s]+/gu; 12161 let match; 12162 while (match = lettersRegex.exec(text)) { 12163 if (text[match.index - 1] === "{") { 12164 continue; 12165 } 12166 let sequence = match[0]; 12167 if (text[match.index - 1] === "\\") { 12168 sequence = sequence.replace(/^[a-zA-Z]+/, ""); 12169 } 12170 if (sequence.length < 6) { 12171 continue; 12172 } 12173 return false; 12174 } 12175 if (/\\[a-zA-Z]+\s*\{/g.test(text)) { 12176 return true; 12177 } 12178 const softClues = [ 12179 (t) => t.includes("^") && !t.startsWith("^"), 12180 (t) => ["=", "+", "-", "/", "*"].some( 12181 (operator) => t.includes(operator) 12182 ), 12183 (t) => /\\[a-zA-Z]+/g.test(t) 12184 ]; 12185 if (softClues.filter((clue) => clue(text)).length >= 2) { 12186 return true; 12187 } 12188 return false; 12189} 12190 12191 12192;// ./node_modules/@wordpress/blocks/build-module/api/raw-handling/paste-handler.js 12193 12194 12195 12196 12197 12198 12199 12200 12201 12202 12203 12204 12205 12206 12207 12208 12209 12210 12211 12212 12213 12214 12215 12216 12217 12218 12219 12220 12221 12222const log = (...args) => window?.console?.log?.(...args); 12223function filterInlineHTML(HTML) { 12224 HTML = deepFilterHTML(HTML, [ 12225 headRemover, 12226 googleDocsUIdRemover, 12227 msListIgnore, 12228 phrasingContentReducer, 12229 commentRemover 12230 ]); 12231 HTML = (0,external_wp_dom_namespaceObject.removeInvalidHTML)(HTML, (0,external_wp_dom_namespaceObject.getPhrasingContentSchema)("paste"), { 12232 inline: true 12233 }); 12234 HTML = deepFilterHTML(HTML, [htmlFormattingRemover, brRemover]); 12235 log("Processed inline HTML:\n\n", HTML); 12236 return HTML; 12237} 12238function pasteHandler({ 12239 HTML = "", 12240 plainText = "", 12241 mode = "AUTO", 12242 tagName 12243}) { 12244 HTML = HTML.replace(/<meta[^>]+>/g, ""); 12245 HTML = HTML.replace( 12246 /^\s*<html[^>]*>\s*<body[^>]*>(?:\s*<!--\s*StartFragment\s*-->)?/i, 12247 "" 12248 ); 12249 HTML = HTML.replace( 12250 /(?:<!--\s*EndFragment\s*-->\s*)?<\/body>\s*<\/html>\s*$/i, 12251 "" 12252 ); 12253 if (mode !== "INLINE") { 12254 const content = HTML ? HTML : plainText; 12255 if (content.indexOf("<!-- wp:") !== -1) { 12256 const parseResult = parser_parse(content); 12257 const isSingleFreeFormBlock = parseResult.length === 1 && parseResult[0].name === "core/freeform"; 12258 if (!isSingleFreeFormBlock) { 12259 return parseResult; 12260 } 12261 } 12262 } 12263 if (String.prototype.normalize) { 12264 HTML = HTML.normalize(); 12265 }
12266 HTML = deepFilterHTML(HTML, [slackParagraphCorrector]); 12267 const isPlainText = plainText && (!HTML || isPlain(HTML)); 12268 if (isPlainText && isLatexMathMode(plainText)) { 12269 return [createBlock("core/math", { latex: plainText })]; 12270 } 12271 if (isPlainText) { 12272 HTML = plainText; 12273 if (!/^\s+$/.test(plainText)) { 12274 HTML = markdownConverter(HTML); 12275 } 12276 } 12277 const pieces = shortcode_converter_default(HTML); 12278 const hasShortcodes = pieces.length > 1; 12279 if (isPlainText && !hasShortcodes) { 12280 if (mode === "AUTO" && plainText.indexOf("\n") === -1 && plainText.indexOf("<p>") !== 0 && HTML.indexOf("<p>") === 0) { 12281 mode = "INLINE"; 12282 } 12283 } 12284 if (mode === "INLINE") { 12285 return filterInlineHTML(HTML); 12286 } 12287 if (mode === "AUTO" && !hasShortcodes && isInlineContent(HTML, tagName)) { 12288 return filterInlineHTML(HTML); 12289 } 12290 const phrasingContentSchema = (0,external_wp_dom_namespaceObject.getPhrasingContentSchema)("paste"); 12291 const blockContentSchema = getBlockContentSchema("paste"); 12292 const blocks = pieces.map((piece) => { 12293 if (typeof piece !== "string") { 12294 return piece; 12295 } 12296 const filters = [ 12297 googleDocsUIdRemover, 12298 msListConverter, 12299 headRemover, 12300 listReducer, 12301 imageCorrector, 12302 phrasingContentReducer, 12303 specialCommentConverter, 12304 commentRemover, 12305 iframeRemover, 12306 figureContentReducer, 12307 blockquoteNormaliser(), 12308 divNormaliser 12309 ]; 12310 const schema = { 12311 ...blockContentSchema, 12312 // Keep top-level phrasing content, normalised by `normaliseBlocks`. 12313 ...phrasingContentSchema 12314 }; 12315 piece = deepFilterHTML(piece, filters, blockContentSchema); 12316 piece = (0,external_wp_dom_namespaceObject.removeInvalidHTML)(piece, schema); 12317 piece = normaliseBlocks(piece); 12318 piece = deepFilterHTML( 12319 piece, 12320 [htmlFormattingRemover, brRemover, emptyParagraphRemover], 12321 blockContentSchema 12322 ); 12323 log("Processed HTML piece:\n\n", piece); 12324 return htmlToBlocks(piece, pasteHandler); 12325 }).flat().filter(Boolean); 12326 if (mode === "AUTO" && blocks.length === 1 && hasBlockSupport(blocks[0].name, "__unstablePasteTextInline", false)) { 12327 const trimRegex = /^[\n]+|[\n]+$/g; 12328 const trimmedPlainText = plainText.replace(trimRegex, ""); 12329 if (trimmedPlainText !== "" && trimmedPlainText.indexOf("\n") === -1) { 12330 return (0,external_wp_dom_namespaceObject.removeInvalidHTML)( 12331 getBlockInnerHTML(blocks[0]), 12332 phrasingContentSchema 12333 ).replace(trimRegex, ""); 12334 } 12335 } 12336 return blocks; 12337} 12338 12339 12340;// ./node_modules/@wordpress/blocks/build-module/api/categories.js 12341 12342 12343function categories_getCategories() { 12344 return (0,external_wp_data_namespaceObject.select)(store).getCategories(); 12345} 12346function categories_setCategories(categories) { 12347 (0,external_wp_data_namespaceObject.dispatch)(store).setCategories(categories); 12348} 12349function categories_updateCategory(slug, category) { 12350 (0,external_wp_data_namespaceObject.dispatch)(store).updateCategory(slug, category); 12351} 12352 12353 12354;// ./node_modules/@wordpress/blocks/build-module/api/templates.js 12355 12356 12357 12358 12359function doBlocksMatchTemplate(blocks = [], template = []) { 12360 return blocks.length === template.length && template.every(([name, , innerBlocksTemplate], index) => { 12361 const block = blocks[index]; 12362 return name === block.name && doBlocksMatchTemplate(block.innerBlocks, innerBlocksTemplate); 12363 }); 12364} 12365const isHTMLAttribute = (attributeDefinition) => attributeDefinition?.source === "html"; 12366const isQueryAttribute = (attributeDefinition) => attributeDefinition?.source === "query"; 12367function normalizeAttributes(schema, values) { 12368 if (!values) { 12369 return {}; 12370 } 12371 return Object.fromEntries( 12372 Object.entries(values).map(([key, value]) => [ 12373 key, 12374 normalizeAttribute(schema[key], value) 12375 ]) 12376 ); 12377} 12378function normalizeAttribute(definition, value) { 12379 if (isHTMLAttribute(definition) && Array.isArray(value)) { 12380 return (0,external_wp_element_namespaceObject.renderToString)(value); 12381 } 12382 if (isQueryAttribute(definition) && value) { 12383 return value.map((subValues) => { 12384 return normalizeAttributes(definition.query, subValues); 12385 }); 12386 } 12387 return value; 12388} 12389function synchronizeBlocksWithTemplate(blocks = [], template) { 12390 if (!template) { 12391 return blocks; 12392 } 12393 return template.map( 12394 ([name, attributes, innerBlocksTemplate], index) => { 12395 const block = blocks[index]; 12396 if (block && block.name === name) { 12397 const innerBlocks = synchronizeBlocksWithTemplate( 12398 block.innerBlocks, 12399 innerBlocksTemplate 12400 ); 12401 return { ...block, innerBlocks }; 12402 } 12403 const blockType = getBlockType(name); 12404 const normalizedAttributes = normalizeAttributes( 12405 blockType?.attributes ?? {}, 12406 attributes 12407 ); 12408 const [blockName, blockAttributes] = convertLegacyBlockNameAndAttributes( 12409 name, 12410 normalizedAttributes 12411 ); 12412 return createBlock( 12413 blockName, 12414 blockAttributes, 12415 synchronizeBlocksWithTemplate([], innerBlocksTemplate) 12416 ); 12417 } 12418 ); 12419} 12420 12421 12422;// ./node_modules/@wordpress/blocks/build-module/api/index.js 12423 12424 12425 12426 12427 12428 12429 12430 12431 12432 12433 12434 12435 12436 12437 12438 12439const privateApis = {}; 12440lock(privateApis, { isContentBlock: isContentBlock }); 12441 12442 12443;// ./node_modules/@wordpress/blocks/build-module/deprecated.js 12444 12445function withBlockContentContext(OriginalComponent) { 12446 external_wp_deprecated_default()("wp.blocks.withBlockContentContext", { 12447 since: "6.1" 12448 }); 12449 return OriginalComponent; 12450} 12451 12452 12453;// ./node_modules/@wordpress/blocks/build-module/index.js 12454 12455 12456 12457 12458 12459})(); 12460 12461(window.wp = window.wp || {}).blocks = __webpack_exports__; 12462/******/ })() 12463;
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.