[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

/wp-includes/js/dist/ -> blocks.js (source)

   1  this["wp"] = this["wp"] || {}; this["wp"]["blocks"] =
   2  /******/ (function(modules) { // webpackBootstrap
   3  /******/     // The module cache
   4  /******/     var installedModules = {};
   5  /******/
   6  /******/     // The require function
   7  /******/ 	function __webpack_require__(moduleId) {
   8  /******/
   9  /******/         // Check if module is in cache
  10  /******/         if(installedModules[moduleId]) {
  11  /******/             return installedModules[moduleId].exports;
  12  /******/         }
  13  /******/         // Create a new module (and put it into the cache)
  14  /******/         var module = installedModules[moduleId] = {
  15  /******/             i: moduleId,
  16  /******/             l: false,
  17  /******/             exports: {}
  18  /******/         };
  19  /******/
  20  /******/         // Execute the module function
  21  /******/         modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  22  /******/
  23  /******/         // Flag the module as loaded
  24  /******/         module.l = true;
  25  /******/
  26  /******/         // Return the exports of the module
  27  /******/         return module.exports;
  28  /******/     }
  29  /******/
  30  /******/
  31  /******/     // expose the modules object (__webpack_modules__)
  32  /******/     __webpack_require__.m = modules;
  33  /******/
  34  /******/     // expose the module cache
  35  /******/     __webpack_require__.c = installedModules;
  36  /******/
  37  /******/     // define getter function for harmony exports
  38  /******/     __webpack_require__.d = function(exports, name, getter) {
  39  /******/         if(!__webpack_require__.o(exports, name)) {
  40  /******/             Object.defineProperty(exports, name, { enumerable: true, get: getter });
  41  /******/         }
  42  /******/     };
  43  /******/
  44  /******/     // define __esModule on exports
  45  /******/     __webpack_require__.r = function(exports) {
  46  /******/         if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  47  /******/             Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  48  /******/         }
  49  /******/         Object.defineProperty(exports, '__esModule', { value: true });
  50  /******/     };
  51  /******/
  52  /******/     // create a fake namespace object
  53  /******/     // mode & 1: value is a module id, require it
  54  /******/     // mode & 2: merge all properties of value into the ns
  55  /******/     // mode & 4: return value when already ns object
  56  /******/     // mode & 8|1: behave like require
  57  /******/     __webpack_require__.t = function(value, mode) {
  58  /******/         if(mode & 1) value = __webpack_require__(value);
  59  /******/         if(mode & 8) return value;
  60  /******/         if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
  61  /******/         var ns = Object.create(null);
  62  /******/         __webpack_require__.r(ns);
  63  /******/         Object.defineProperty(ns, 'default', { enumerable: true, value: value });
  64  /******/         if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
  65  /******/         return ns;
  66  /******/     };
  67  /******/
  68  /******/     // getDefaultExport function for compatibility with non-harmony modules
  69  /******/     __webpack_require__.n = function(module) {
  70  /******/         var getter = module && module.__esModule ?
  71  /******/ 			function getDefault() { return module['default']; } :
  72  /******/ 			function getModuleExports() { return module; };
  73  /******/         __webpack_require__.d(getter, 'a', getter);
  74  /******/         return getter;
  75  /******/     };
  76  /******/
  77  /******/     // Object.prototype.hasOwnProperty.call
  78  /******/     __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  79  /******/
  80  /******/     // __webpack_public_path__
  81  /******/     __webpack_require__.p = "";
  82  /******/
  83  /******/
  84  /******/     // Load entry module and return exports
  85  /******/     return __webpack_require__(__webpack_require__.s = 367);
  86  /******/ })
  87  /************************************************************************/
  88  /******/ ({
  89  
  90  /***/ 0:
  91  /***/ (function(module, exports) {
  92  
  93  (function() { module.exports = this["wp"]["element"]; }());
  94  
  95  /***/ }),
  96  
  97  /***/ 1:
  98  /***/ (function(module, exports) {
  99  
 100  (function() { module.exports = this["wp"]["i18n"]; }());
 101  
 102  /***/ }),
 103  
 104  /***/ 111:
 105  /***/ (function(module, exports) {
 106  
 107  (function() { module.exports = this["wp"]["shortcode"]; }());
 108  
 109  /***/ }),
 110  
 111  /***/ 12:
 112  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 113  
 114  "use strict";
 115  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _extends; });
 116  function _extends() {
 117    _extends = Object.assign || function (target) {
 118      for (var i = 1; i < arguments.length; i++) {
 119        var source = arguments[i];
 120  
 121        for (var key in source) {
 122          if (Object.prototype.hasOwnProperty.call(source, key)) {
 123            target[key] = source[key];
 124          }
 125        }
 126      }
 127  
 128      return target;
 129    };
 130  
 131    return _extends.apply(this, arguments);
 132  }
 133  
 134  /***/ }),
 135  
 136  /***/ 13:
 137  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 138  
 139  "use strict";
 140  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _createClass; });
 141  function _defineProperties(target, props) {
 142    for (var i = 0; i < props.length; i++) {
 143      var descriptor = props[i];
 144      descriptor.enumerable = descriptor.enumerable || false;
 145      descriptor.configurable = true;
 146      if ("value" in descriptor) descriptor.writable = true;
 147      Object.defineProperty(target, descriptor.key, descriptor);
 148    }
 149  }
 150  
 151  function _createClass(Constructor, protoProps, staticProps) {
 152    if (protoProps) _defineProperties(Constructor.prototype, protoProps);
 153    if (staticProps) _defineProperties(Constructor, staticProps);
 154    return Constructor;
 155  }
 156  
 157  /***/ }),
 158  
 159  /***/ 14:
 160  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 161  
 162  "use strict";
 163  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _classCallCheck; });
 164  function _classCallCheck(instance, Constructor) {
 165    if (!(instance instanceof Constructor)) {
 166      throw new TypeError("Cannot call a class as a function");
 167    }
 168  }
 169  
 170  /***/ }),
 171  
 172  /***/ 18:
 173  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 174  
 175  "use strict";
 176  
 177  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js
 178  function _arrayWithoutHoles(arr) {
 179    if (Array.isArray(arr)) {
 180      for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) {
 181        arr2[i] = arr[i];
 182      }
 183  
 184      return arr2;
 185    }
 186  }
 187  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArray.js
 188  var iterableToArray = __webpack_require__(31);
 189  
 190  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js
 191  function _nonIterableSpread() {
 192    throw new TypeError("Invalid attempt to spread non-iterable instance");
 193  }
 194  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js
 195  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _toConsumableArray; });
 196  
 197  
 198  
 199  function _toConsumableArray(arr) {
 200    return _arrayWithoutHoles(arr) || Object(iterableToArray["a" /* default */])(arr) || _nonIterableSpread();
 201  }
 202  
 203  /***/ }),
 204  
 205  /***/ 2:
 206  /***/ (function(module, exports) {
 207  
 208  (function() { module.exports = this["lodash"]; }());
 209  
 210  /***/ }),
 211  
 212  /***/ 22:
 213  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 214  
 215  "use strict";
 216  
 217  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js
 218  var arrayWithHoles = __webpack_require__(35);
 219  
 220  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js
 221  function _iterableToArrayLimit(arr, i) {
 222    if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) {
 223      return;
 224    }
 225  
 226    var _arr = [];
 227    var _n = true;
 228    var _d = false;
 229    var _e = undefined;
 230  
 231    try {
 232      for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
 233        _arr.push(_s.value);
 234  
 235        if (i && _arr.length === i) break;
 236      }
 237    } catch (err) {
 238      _d = true;
 239      _e = err;
 240    } finally {
 241      try {
 242        if (!_n && _i["return"] != null) _i["return"]();
 243      } finally {
 244        if (_d) throw _e;
 245      }
 246    }
 247  
 248    return _arr;
 249  }
 250  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js
 251  var nonIterableRest = __webpack_require__(36);
 252  
 253  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js
 254  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _slicedToArray; });
 255  
 256  
 257  
 258  function _slicedToArray(arr, i) {
 259    return Object(arrayWithHoles["a" /* default */])(arr) || _iterableToArrayLimit(arr, i) || Object(nonIterableRest["a" /* default */])();
 260  }
 261  
 262  /***/ }),
 263  
 264  /***/ 220:
 265  /***/ (function(module, exports) {
 266  
 267  (function() { module.exports = this["wp"]["blockSerializationDefaultParser"]; }());
 268  
 269  /***/ }),
 270  
 271  /***/ 221:
 272  /***/ (function(module, exports, __webpack_require__) {
 273  
 274  var __WEBPACK_AMD_DEFINE_RESULT__;;/*! showdown v 1.9.1 - 02-11-2019 */
 275  (function(){
 276  /**
 277   * Created by Tivie on 13-07-2015.
 278   */
 279  
 280  function getDefaultOpts (simple) {
 281    'use strict';
 282  
 283    var defaultOptions = {
 284      omitExtraWLInCodeBlocks: {
 285        defaultValue: false,
 286        describe: 'Omit the default extra whiteline added to code blocks',
 287        type: 'boolean'
 288      },
 289      noHeaderId: {
 290        defaultValue: false,
 291        describe: 'Turn on/off generated header id',
 292        type: 'boolean'
 293      },
 294      prefixHeaderId: {
 295        defaultValue: false,
 296        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',
 297        type: 'string'
 298      },
 299      rawPrefixHeaderId: {
 300        defaultValue: false,
 301        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)',
 302        type: 'boolean'
 303      },
 304      ghCompatibleHeaderId: {
 305        defaultValue: false,
 306        describe: 'Generate header ids compatible with github style (spaces are replaced with dashes, a bunch of non alphanumeric chars are removed)',
 307        type: 'boolean'
 308      },
 309      rawHeaderId: {
 310        defaultValue: false,
 311        describe: 'Remove only spaces, \' and " from generated header ids (including prefixes), replacing them with dashes (-). WARNING: This might result in malformed ids',
 312        type: 'boolean'
 313      },
 314      headerLevelStart: {
 315        defaultValue: false,
 316        describe: 'The header blocks level start',
 317        type: 'integer'
 318      },
 319      parseImgDimensions: {
 320        defaultValue: false,
 321        describe: 'Turn on/off image dimension parsing',
 322        type: 'boolean'
 323      },
 324      simplifiedAutoLink: {
 325        defaultValue: false,
 326        describe: 'Turn on/off GFM autolink style',
 327        type: 'boolean'
 328      },
 329      excludeTrailingPunctuationFromURLs: {
 330        defaultValue: false,
 331        describe: 'Excludes trailing punctuation from links generated with autoLinking',
 332        type: 'boolean'
 333      },
 334      literalMidWordUnderscores: {
 335        defaultValue: false,
 336        describe: 'Parse midword underscores as literal underscores',
 337        type: 'boolean'
 338      },
 339      literalMidWordAsterisks: {
 340        defaultValue: false,
 341        describe: 'Parse midword asterisks as literal asterisks',
 342        type: 'boolean'
 343      },
 344      strikethrough: {
 345        defaultValue: false,
 346        describe: 'Turn on/off strikethrough support',
 347        type: 'boolean'
 348      },
 349      tables: {
 350        defaultValue: false,
 351        describe: 'Turn on/off tables support',
 352        type: 'boolean'
 353      },
 354      tablesHeaderId: {
 355        defaultValue: false,
 356        describe: 'Add an id to table headers',
 357        type: 'boolean'
 358      },
 359      ghCodeBlocks: {
 360        defaultValue: true,
 361        describe: 'Turn on/off GFM fenced code blocks support',
 362        type: 'boolean'
 363      },
 364      tasklists: {
 365        defaultValue: false,
 366        describe: 'Turn on/off GFM tasklist support',
 367        type: 'boolean'
 368      },
 369      smoothLivePreview: {
 370        defaultValue: false,
 371        describe: 'Prevents weird effects in live previews due to incomplete input',
 372        type: 'boolean'
 373      },
 374      smartIndentationFix: {
 375        defaultValue: false,
 376        description: 'Tries to smartly fix indentation in es6 strings',
 377        type: 'boolean'
 378      },
 379      disableForced4SpacesIndentedSublists: {
 380        defaultValue: false,
 381        description: 'Disables the requirement of indenting nested sublists by 4 spaces',
 382        type: 'boolean'
 383      },
 384      simpleLineBreaks: {
 385        defaultValue: false,
 386        description: 'Parses simple line breaks as <br> (GFM Style)',
 387        type: 'boolean'
 388      },
 389      requireSpaceBeforeHeadingText: {
 390        defaultValue: false,
 391        description: 'Makes adding a space between `#` and the header text mandatory (GFM Style)',
 392        type: 'boolean'
 393      },
 394      ghMentions: {
 395        defaultValue: false,
 396        description: 'Enables github @mentions',
 397        type: 'boolean'
 398      },
 399      ghMentionsLink: {
 400        defaultValue: 'https://github.com/{u}',
 401        description: 'Changes the link generated by @mentions. Only applies if ghMentions option is enabled.',
 402        type: 'string'
 403      },
 404      encodeEmails: {
 405        defaultValue: true,
 406        description: 'Encode e-mail addresses through the use of Character Entities, transforming ASCII e-mail addresses into its equivalent decimal entities',
 407        type: 'boolean'
 408      },
 409      openLinksInNewWindow: {
 410        defaultValue: false,
 411        description: 'Open all links in new windows',
 412        type: 'boolean'
 413      },
 414      backslashEscapesHTMLTags: {
 415        defaultValue: false,
 416        description: 'Support for HTML Tag escaping. ex: \<div>foo\</div>',
 417        type: 'boolean'
 418      },
 419      emoji: {
 420        defaultValue: false,
 421        description: 'Enable emoji support. Ex: `this is a :smile: emoji`',
 422        type: 'boolean'
 423      },
 424      underline: {
 425        defaultValue: false,
 426        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>`',
 427        type: 'boolean'
 428      },
 429      completeHTMLDocument: {
 430        defaultValue: false,
 431        description: 'Outputs a complete html document, including `<html>`, `<head>` and `<body>` tags',
 432        type: 'boolean'
 433      },
 434      metadata: {
 435        defaultValue: false,
 436        description: 'Enable support for document metadata (defined at the top of the document between `«««` and `»»»` or between `---` and `---`).',
 437        type: 'boolean'
 438      },
 439      splitAdjacentBlockquotes: {
 440        defaultValue: false,
 441        description: 'Split adjacent blockquote blocks',
 442        type: 'boolean'
 443      }
 444    };
 445    if (simple === false) {
 446      return JSON.parse(JSON.stringify(defaultOptions));
 447    }
 448    var ret = {};
 449    for (var opt in defaultOptions) {
 450      if (defaultOptions.hasOwnProperty(opt)) {
 451        ret[opt] = defaultOptions[opt].defaultValue;
 452      }
 453    }
 454    return ret;
 455  }
 456  
 457  function allOptionsOn () {
 458    'use strict';
 459    var options = getDefaultOpts(true),
 460        ret = {};
 461    for (var opt in options) {
 462      if (options.hasOwnProperty(opt)) {
 463        ret[opt] = true;
 464      }
 465    }
 466    return ret;
 467  }
 468  
 469  /**
 470   * Created by Tivie on 06-01-2015.
 471   */
 472  
 473  // Private properties
 474  var showdown = {},
 475      parsers = {},
 476      extensions = {},
 477      globalOptions = getDefaultOpts(true),
 478      setFlavor = 'vanilla',
 479      flavor = {
 480        github: {
 481          omitExtraWLInCodeBlocks:              true,
 482          simplifiedAutoLink:                   true,
 483          excludeTrailingPunctuationFromURLs:   true,
 484          literalMidWordUnderscores:            true,
 485          strikethrough:                        true,
 486          tables:                               true,
 487          tablesHeaderId:                       true,
 488          ghCodeBlocks:                         true,
 489          tasklists:                            true,
 490          disableForced4SpacesIndentedSublists: true,
 491          simpleLineBreaks:                     true,
 492          requireSpaceBeforeHeadingText:        true,
 493          ghCompatibleHeaderId:                 true,
 494          ghMentions:                           true,
 495          backslashEscapesHTMLTags:             true,
 496          emoji:                                true,
 497          splitAdjacentBlockquotes:             true
 498        },
 499        original: {
 500          noHeaderId:                           true,
 501          ghCodeBlocks:                         false
 502        },
 503        ghost: {
 504          omitExtraWLInCodeBlocks:              true,
 505          parseImgDimensions:                   true,
 506          simplifiedAutoLink:                   true,
 507          excludeTrailingPunctuationFromURLs:   true,
 508          literalMidWordUnderscores:            true,
 509          strikethrough:                        true,
 510          tables:                               true,
 511          tablesHeaderId:                       true,
 512          ghCodeBlocks:                         true,
 513          tasklists:                            true,
 514          smoothLivePreview:                    true,
 515          simpleLineBreaks:                     true,
 516          requireSpaceBeforeHeadingText:        true,
 517          ghMentions:                           false,
 518          encodeEmails:                         true
 519        },
 520        vanilla: getDefaultOpts(true),
 521        allOn: allOptionsOn()
 522      };
 523  
 524  /**
 525   * helper namespace
 526   * @type {{}}
 527   */
 528  showdown.helper = {};
 529  
 530  /**
 531   * TODO LEGACY SUPPORT CODE
 532   * @type {{}}
 533   */
 534  showdown.extensions = {};
 535  
 536  /**
 537   * Set a global option
 538   * @static
 539   * @param {string} key
 540   * @param {*} value
 541   * @returns {showdown}
 542   */
 543  showdown.setOption = function (key, value) {
 544    'use strict';
 545    globalOptions[key] = value;
 546    return this;
 547  };
 548  
 549  /**
 550   * Get a global option
 551   * @static
 552   * @param {string} key
 553   * @returns {*}
 554   */
 555  showdown.getOption = function (key) {
 556    'use strict';
 557    return globalOptions[key];
 558  };
 559  
 560  /**
 561   * Get the global options
 562   * @static
 563   * @returns {{}}
 564   */
 565  showdown.getOptions = function () {
 566    'use strict';
 567    return globalOptions;
 568  };
 569  
 570  /**
 571   * Reset global options to the default values
 572   * @static
 573   */
 574  showdown.resetOptions = function () {
 575    'use strict';
 576    globalOptions = getDefaultOpts(true);
 577  };
 578  
 579  /**
 580   * Set the flavor showdown should use as default
 581   * @param {string} name
 582   */
 583  showdown.setFlavor = function (name) {
 584    'use strict';
 585    if (!flavor.hasOwnProperty(name)) {
 586      throw Error(name + ' flavor was not found');
 587    }
 588    showdown.resetOptions();
 589    var preset = flavor[name];
 590    setFlavor = name;
 591    for (var option in preset) {
 592      if (preset.hasOwnProperty(option)) {
 593        globalOptions[option] = preset[option];
 594      }
 595    }
 596  };
 597  
 598  /**
 599   * Get the currently set flavor
 600   * @returns {string}
 601   */
 602  showdown.getFlavor = function () {
 603    'use strict';
 604    return setFlavor;
 605  };
 606  
 607  /**
 608   * Get the options of a specified flavor. Returns undefined if the flavor was not found
 609   * @param {string} name Name of the flavor
 610   * @returns {{}|undefined}
 611   */
 612  showdown.getFlavorOptions = function (name) {
 613    'use strict';
 614    if (flavor.hasOwnProperty(name)) {
 615      return flavor[name];
 616    }
 617  };
 618  
 619  /**
 620   * Get the default options
 621   * @static
 622   * @param {boolean} [simple=true]
 623   * @returns {{}}
 624   */
 625  showdown.getDefaultOptions = function (simple) {
 626    'use strict';
 627    return getDefaultOpts(simple);
 628  };
 629  
 630  /**
 631   * Get or set a subParser
 632   *
 633   * subParser(name)       - Get a registered subParser
 634   * subParser(name, func) - Register a subParser
 635   * @static
 636   * @param {string} name
 637   * @param {function} [func]
 638   * @returns {*}
 639   */
 640  showdown.subParser = function (name, func) {
 641    'use strict';
 642    if (showdown.helper.isString(name)) {
 643      if (typeof func !== 'undefined') {
 644        parsers[name] = func;
 645      } else {
 646        if (parsers.hasOwnProperty(name)) {
 647          return parsers[name];
 648        } else {
 649          throw Error('SubParser named ' + name + ' not registered!');
 650        }
 651      }
 652    }
 653  };
 654  
 655  /**
 656   * Gets or registers an extension
 657   * @static
 658   * @param {string} name
 659   * @param {object|function=} ext
 660   * @returns {*}
 661   */
 662  showdown.extension = function (name, ext) {
 663    'use strict';
 664  
 665    if (!showdown.helper.isString(name)) {
 666      throw Error('Extension \'name\' must be a string');
 667    }
 668  
 669    name = showdown.helper.stdExtName(name);
 670  
 671    // Getter
 672    if (showdown.helper.isUndefined(ext)) {
 673      if (!extensions.hasOwnProperty(name)) {
 674        throw Error('Extension named ' + name + ' is not registered!');
 675      }
 676      return extensions[name];
 677  
 678      // Setter
 679    } else {
 680      // Expand extension if it's wrapped in a function
 681      if (typeof ext === 'function') {
 682        ext = ext();
 683      }
 684  
 685      // Ensure extension is an array
 686      if (!showdown.helper.isArray(ext)) {
 687        ext = [ext];
 688      }
 689  
 690      var validExtension = validate(ext, name);
 691  
 692      if (validExtension.valid) {
 693        extensions[name] = ext;
 694      } else {
 695        throw Error(validExtension.error);
 696      }
 697    }
 698  };
 699  
 700  /**
 701   * Gets all extensions registered
 702   * @returns {{}}
 703   */
 704  showdown.getAllExtensions = function () {
 705    'use strict';
 706    return extensions;
 707  };
 708  
 709  /**
 710   * Remove an extension
 711   * @param {string} name
 712   */
 713  showdown.removeExtension = function (name) {
 714    'use strict';
 715    delete extensions[name];
 716  };
 717  
 718  /**
 719   * Removes all extensions
 720   */
 721  showdown.resetExtensions = function () {
 722    'use strict';
 723    extensions = {};
 724  };
 725  
 726  /**
 727   * Validate extension
 728   * @param {array} extension
 729   * @param {string} name
 730   * @returns {{valid: boolean, error: string}}
 731   */
 732  function validate (extension, name) {
 733    'use strict';
 734  
 735    var errMsg = (name) ? 'Error in ' + name + ' extension->' : 'Error in unnamed extension',
 736        ret = {
 737          valid: true,
 738          error: ''
 739        };
 740  
 741    if (!showdown.helper.isArray(extension)) {
 742      extension = [extension];
 743    }
 744  
 745    for (var i = 0; i < extension.length; ++i) {
 746      var baseMsg = errMsg + ' sub-extension ' + i + ': ',
 747          ext = extension[i];
 748      if (typeof ext !== 'object') {
 749        ret.valid = false;
 750        ret.error = baseMsg + 'must be an object, but ' + typeof ext + ' given';
 751        return ret;
 752      }
 753  
 754      if (!showdown.helper.isString(ext.type)) {
 755        ret.valid = false;
 756        ret.error = baseMsg + 'property "type" must be a string, but ' + typeof ext.type + ' given';
 757        return ret;
 758      }
 759  
 760      var type = ext.type = ext.type.toLowerCase();
 761  
 762      // normalize extension type
 763      if (type === 'language') {
 764        type = ext.type = 'lang';
 765      }
 766  
 767      if (type === 'html') {
 768        type = ext.type = 'output';
 769      }
 770  
 771      if (type !== 'lang' && type !== 'output' && type !== 'listener') {
 772        ret.valid = false;
 773        ret.error = baseMsg + 'type ' + type + ' is not recognized. Valid values: "lang/language", "output/html" or "listener"';
 774        return ret;
 775      }
 776  
 777      if (type === 'listener') {
 778        if (showdown.helper.isUndefined(ext.listeners)) {
 779          ret.valid = false;
 780          ret.error = baseMsg + '. Extensions of type "listener" must have a property called "listeners"';
 781          return ret;
 782        }
 783      } else {
 784        if (showdown.helper.isUndefined(ext.filter) && showdown.helper.isUndefined(ext.regex)) {
 785          ret.valid = false;
 786          ret.error = baseMsg + type + ' extensions must define either a "regex" property or a "filter" method';
 787          return ret;
 788        }
 789      }
 790  
 791      if (ext.listeners) {
 792        if (typeof ext.listeners !== 'object') {
 793          ret.valid = false;
 794          ret.error = baseMsg + '"listeners" property must be an object but ' + typeof ext.listeners + ' given';
 795          return ret;
 796        }
 797        for (var ln in ext.listeners) {
 798          if (ext.listeners.hasOwnProperty(ln)) {
 799            if (typeof ext.listeners[ln] !== 'function') {
 800              ret.valid = false;
 801              ret.error = baseMsg + '"listeners" property must be an hash of [event name]: [callback]. listeners.' + ln +
 802                ' must be a function but ' + typeof ext.listeners[ln] + ' given';
 803              return ret;
 804            }
 805          }
 806        }
 807      }
 808  
 809      if (ext.filter) {
 810        if (typeof ext.filter !== 'function') {
 811          ret.valid = false;
 812          ret.error = baseMsg + '"filter" must be a function, but ' + typeof ext.filter + ' given';
 813          return ret;
 814        }
 815      } else if (ext.regex) {
 816        if (showdown.helper.isString(ext.regex)) {
 817          ext.regex = new RegExp(ext.regex, 'g');
 818        }
 819        if (!(ext.regex instanceof RegExp)) {
 820          ret.valid = false;
 821          ret.error = baseMsg + '"regex" property must either be a string or a RegExp object, but ' + typeof ext.regex + ' given';
 822          return ret;
 823        }
 824        if (showdown.helper.isUndefined(ext.replace)) {
 825          ret.valid = false;
 826          ret.error = baseMsg + '"regex" extensions must implement a replace string or function';
 827          return ret;
 828        }
 829      }
 830    }
 831    return ret;
 832  }
 833  
 834  /**
 835   * Validate extension
 836   * @param {object} ext
 837   * @returns {boolean}
 838   */
 839  showdown.validateExtension = function (ext) {
 840    'use strict';
 841  
 842    var validateExtension = validate(ext, null);
 843    if (!validateExtension.valid) {
 844      console.warn(validateExtension.error);
 845      return false;
 846    }
 847    return true;
 848  };
 849  
 850  /**
 851   * showdownjs helper functions
 852   */
 853  
 854  if (!showdown.hasOwnProperty('helper')) {
 855    showdown.helper = {};
 856  }
 857  
 858  /**
 859   * Check if var is string
 860   * @static
 861   * @param {string} a
 862   * @returns {boolean}
 863   */
 864  showdown.helper.isString = function (a) {
 865    'use strict';
 866    return (typeof a === 'string' || a instanceof String);
 867  };
 868  
 869  /**
 870   * Check if var is a function
 871   * @static
 872   * @param {*} a
 873   * @returns {boolean}
 874   */
 875  showdown.helper.isFunction = function (a) {
 876    'use strict';
 877    var getType = {};
 878    return a && getType.toString.call(a) === '[object Function]';
 879  };
 880  
 881  /**
 882   * isArray helper function
 883   * @static
 884   * @param {*} a
 885   * @returns {boolean}
 886   */
 887  showdown.helper.isArray = function (a) {
 888    'use strict';
 889    return Array.isArray(a);
 890  };
 891  
 892  /**
 893   * Check if value is undefined
 894   * @static
 895   * @param {*} value The value to check.
 896   * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
 897   */
 898  showdown.helper.isUndefined = function (value) {
 899    'use strict';
 900    return typeof value === 'undefined';
 901  };
 902  
 903  /**
 904   * ForEach helper function
 905   * Iterates over Arrays and Objects (own properties only)
 906   * @static
 907   * @param {*} obj
 908   * @param {function} callback Accepts 3 params: 1. value, 2. key, 3. the original array/object
 909   */
 910  showdown.helper.forEach = function (obj, callback) {
 911    'use strict';
 912    // check if obj is defined
 913    if (showdown.helper.isUndefined(obj)) {
 914      throw new Error('obj param is required');
 915    }
 916  
 917    if (showdown.helper.isUndefined(callback)) {
 918      throw new Error('callback param is required');
 919    }
 920  
 921    if (!showdown.helper.isFunction(callback)) {
 922      throw new Error('callback param must be a function/closure');
 923    }
 924  
 925    if (typeof obj.forEach === 'function') {
 926      obj.forEach(callback);
 927    } else if (showdown.helper.isArray(obj)) {
 928      for (var i = 0; i < obj.length; i++) {
 929        callback(obj[i], i, obj);
 930      }
 931    } else if (typeof (obj) === 'object') {
 932      for (var prop in obj) {
 933        if (obj.hasOwnProperty(prop)) {
 934          callback(obj[prop], prop, obj);
 935        }
 936      }
 937    } else {
 938      throw new Error('obj does not seem to be an array or an iterable object');
 939    }
 940  };
 941  
 942  /**
 943   * Standardidize extension name
 944   * @static
 945   * @param {string} s extension name
 946   * @returns {string}
 947   */
 948  showdown.helper.stdExtName = function (s) {
 949    'use strict';
 950    return s.replace(/[_?*+\/\\.^-]/g, '').replace(/\s/g, '').toLowerCase();
 951  };
 952  
 953  function escapeCharactersCallback (wholeMatch, m1) {
 954    'use strict';
 955    var charCodeToEscape = m1.charCodeAt(0);
 956    return '¨E' + charCodeToEscape + 'E';
 957  }
 958  
 959  /**
 960   * Callback used to escape characters when passing through String.replace
 961   * @static
 962   * @param {string} wholeMatch
 963   * @param {string} m1
 964   * @returns {string}
 965   */
 966  showdown.helper.escapeCharactersCallback = escapeCharactersCallback;
 967  
 968  /**
 969   * Escape characters in a string
 970   * @static
 971   * @param {string} text
 972   * @param {string} charsToEscape
 973   * @param {boolean} afterBackslash
 974   * @returns {XML|string|void|*}
 975   */
 976  showdown.helper.escapeCharacters = function (text, charsToEscape, afterBackslash) {
 977    'use strict';
 978    // First we have to escape the escape characters so that
 979    // we can build a character class out of them
 980    var regexString = '([' + charsToEscape.replace(/([\[\]\\])/g, '\\$1') + '])';
 981  
 982    if (afterBackslash) {
 983      regexString = '\\\\' + regexString;
 984    }
 985  
 986    var regex = new RegExp(regexString, 'g');
 987    text = text.replace(regex, escapeCharactersCallback);
 988  
 989    return text;
 990  };
 991  
 992  /**
 993   * Unescape HTML entities
 994   * @param txt
 995   * @returns {string}
 996   */
 997  showdown.helper.unescapeHTMLEntities = function (txt) {
 998    'use strict';
 999  
1000    return txt
1001      .replace(/&quot;/g, '"')
1002      .replace(/&lt;/g, '<')
1003      .replace(/&gt;/g, '>')
1004      .replace(/&amp;/g, '&');
1005  };
1006  
1007  var rgxFindMatchPos = function (str, left, right, flags) {
1008    'use strict';
1009    var f = flags || '',
1010        g = f.indexOf('g') > -1,
1011        x = new RegExp(left + '|' + right, 'g' + f.replace(/g/g, '')),
1012        l = new RegExp(left, f.replace(/g/g, '')),
1013        pos = [],
1014        t, s, m, start, end;
1015  
1016    do {
1017      t = 0;
1018      while ((m = x.exec(str))) {
1019        if (l.test(m[0])) {
1020          if (!(t++)) {
1021            s = x.lastIndex;
1022            start = s - m[0].length;
1023          }
1024        } else if (t) {
1025          if (!--t) {
1026            end = m.index + m[0].length;
1027            var obj = {
1028              left: {start: start, end: s},
1029              match: {start: s, end: m.index},
1030              right: {start: m.index, end: end},
1031              wholeMatch: {start: start, end: end}
1032            };
1033            pos.push(obj);
1034            if (!g) {
1035              return pos;
1036            }
1037          }
1038        }
1039      }
1040    } while (t && (x.lastIndex = s));
1041  
1042    return pos;
1043  };
1044  
1045  /**
1046   * matchRecursiveRegExp
1047   *
1048   * (c) 2007 Steven Levithan <stevenlevithan.com>
1049   * MIT License
1050   *
1051   * Accepts a string to search, a left and right format delimiter
1052   * as regex patterns, and optional regex flags. Returns an array
1053   * of matches, allowing nested instances of left/right delimiters.
1054   * Use the "g" flag to return all matches, otherwise only the
1055   * first is returned. Be careful to ensure that the left and
1056   * right format delimiters produce mutually exclusive matches.
1057   * Backreferences are not supported within the right delimiter
1058   * due to how it is internally combined with the left delimiter.
1059   * When matching strings whose format delimiters are unbalanced
1060   * to the left or right, the output is intentionally as a
1061   * conventional regex library with recursion support would
1062   * produce, e.g. "<<x>" and "<x>>" both produce ["x"] when using
1063   * "<" and ">" as the delimiters (both strings contain a single,
1064   * balanced instance of "<x>").
1065   *
1066   * examples:
1067   * matchRecursiveRegExp("test", "\\(", "\\)")
1068   * returns: []
1069   * matchRecursiveRegExp("<t<<e>><s>>t<>", "<", ">", "g")
1070   * returns: ["t<<e>><s>", ""]
1071   * matchRecursiveRegExp("<div id=\"x\">test</div>", "<div\\b[^>]*>", "</div>", "gi")
1072   * returns: ["test"]
1073   */
1074  showdown.helper.matchRecursiveRegExp = function (str, left, right, flags) {
1075    'use strict';
1076  
1077    var matchPos = rgxFindMatchPos (str, left, right, flags),
1078        results = [];
1079  
1080    for (var i = 0; i < matchPos.length; ++i) {
1081      results.push([
1082        str.slice(matchPos[i].wholeMatch.start, matchPos[i].wholeMatch.end),
1083        str.slice(matchPos[i].match.start, matchPos[i].match.end),
1084        str.slice(matchPos[i].left.start, matchPos[i].left.end),
1085        str.slice(matchPos[i].right.start, matchPos[i].right.end)
1086      ]);
1087    }
1088    return results;
1089  };
1090  
1091  /**
1092   *
1093   * @param {string} str
1094   * @param {string|function} replacement
1095   * @param {string} left
1096   * @param {string} right
1097   * @param {string} flags
1098   * @returns {string}
1099   */
1100  showdown.helper.replaceRecursiveRegExp = function (str, replacement, left, right, flags) {
1101    'use strict';
1102  
1103    if (!showdown.helper.isFunction(replacement)) {
1104      var repStr = replacement;
1105      replacement = function () {
1106        return repStr;
1107      };
1108    }
1109  
1110    var matchPos = rgxFindMatchPos(str, left, right, flags),
1111        finalStr = str,
1112        lng = matchPos.length;
1113  
1114    if (lng > 0) {
1115      var bits = [];
1116      if (matchPos[0].wholeMatch.start !== 0) {
1117        bits.push(str.slice(0, matchPos[0].wholeMatch.start));
1118      }
1119      for (var i = 0; i < lng; ++i) {
1120        bits.push(
1121          replacement(
1122            str.slice(matchPos[i].wholeMatch.start, matchPos[i].wholeMatch.end),
1123            str.slice(matchPos[i].match.start, matchPos[i].match.end),
1124            str.slice(matchPos[i].left.start, matchPos[i].left.end),
1125            str.slice(matchPos[i].right.start, matchPos[i].right.end)
1126          )
1127        );
1128        if (i < lng - 1) {
1129          bits.push(str.slice(matchPos[i].wholeMatch.end, matchPos[i + 1].wholeMatch.start));
1130        }
1131      }
1132      if (matchPos[lng - 1].wholeMatch.end < str.length) {
1133        bits.push(str.slice(matchPos[lng - 1].wholeMatch.end));
1134      }
1135      finalStr = bits.join('');
1136    }
1137    return finalStr;
1138  };
1139  
1140  /**
1141   * Returns the index within the passed String object of the first occurrence of the specified regex,
1142   * starting the search at fromIndex. Returns -1 if the value is not found.
1143   *
1144   * @param {string} str string to search
1145   * @param {RegExp} regex Regular expression to search
1146   * @param {int} [fromIndex = 0] Index to start the search
1147   * @returns {Number}
1148   * @throws InvalidArgumentError
1149   */
1150  showdown.helper.regexIndexOf = function (str, regex, fromIndex) {
1151    'use strict';
1152    if (!showdown.helper.isString(str)) {
1153      throw 'InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string';
1154    }
1155    if (regex instanceof RegExp === false) {
1156      throw 'InvalidArgumentError: second parameter of showdown.helper.regexIndexOf function must be an instance of RegExp';
1157    }
1158    var indexOf = str.substring(fromIndex || 0).search(regex);
1159    return (indexOf >= 0) ? (indexOf + (fromIndex || 0)) : indexOf;
1160  };
1161  
1162  /**
1163   * Splits the passed string object at the defined index, and returns an array composed of the two substrings
1164   * @param {string} str string to split
1165   * @param {int} index index to split string at
1166   * @returns {[string,string]}
1167   * @throws InvalidArgumentError
1168   */
1169  showdown.helper.splitAtIndex = function (str, index) {
1170    'use strict';
1171    if (!showdown.helper.isString(str)) {
1172      throw 'InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string';
1173    }
1174    return [str.substring(0, index), str.substring(index)];
1175  };
1176  
1177  /**
1178   * Obfuscate an e-mail address through the use of Character Entities,
1179   * transforming ASCII characters into their equivalent decimal or hex entities.
1180   *
1181   * Since it has a random component, subsequent calls to this function produce different results
1182   *
1183   * @param {string} mail
1184   * @returns {string}
1185   */
1186  showdown.helper.encodeEmailAddress = function (mail) {
1187    'use strict';
1188    var encode = [
1189      function (ch) {
1190        return '&#' + ch.charCodeAt(0) + ';';
1191      },
1192      function (ch) {
1193        return '&#x' + ch.charCodeAt(0).toString(16) + ';';
1194      },
1195      function (ch) {
1196        return ch;
1197      }
1198    ];
1199  
1200    mail = mail.replace(/./g, function (ch) {
1201      if (ch === '@') {
1202        // this *must* be encoded. I insist.
1203        ch = encode[Math.floor(Math.random() * 2)](ch);
1204      } else {
1205        var r = Math.random();
1206        // roughly 10% raw, 45% hex, 45% dec
1207        ch = (
1208          r > 0.9 ? encode[2](ch) : r > 0.45 ? encode[1](ch) : encode[0](ch)
1209        );
1210      }
1211      return ch;
1212    });
1213  
1214    return mail;
1215  };
1216  
1217  /**
1218   *
1219   * @param str
1220   * @param targetLength
1221   * @param padString
1222   * @returns {string}
1223   */
1224  showdown.helper.padEnd = function padEnd (str, targetLength, padString) {
1225    'use strict';
1226    /*jshint bitwise: false*/
1227    // eslint-disable-next-line space-infix-ops
1228    targetLength = targetLength>>0; //floor if number or convert non-number to 0;
1229    /*jshint bitwise: true*/
1230    padString = String(padString || ' ');
1231    if (str.length > targetLength) {
1232      return String(str);
1233    } else {
1234      targetLength = targetLength - str.length;
1235      if (targetLength > padString.length) {
1236        padString += padString.repeat(targetLength / padString.length); //append to original to ensure we are longer than needed
1237      }
1238      return String(str) + padString.slice(0,targetLength);
1239    }
1240  };
1241  
1242  /**
1243   * POLYFILLS
1244   */
1245  // use this instead of builtin is undefined for IE8 compatibility
1246  if (typeof console === 'undefined') {
1247    console = {
1248      warn: function (msg) {
1249        'use strict';
1250        alert(msg);
1251      },
1252      log: function (msg) {
1253        'use strict';
1254        alert(msg);
1255      },
1256      error: function (msg) {
1257        'use strict';
1258        throw msg;
1259      }
1260    };
1261  }
1262  
1263  /**
1264   * Common regexes.
1265   * We declare some common regexes to improve performance
1266   */
1267  showdown.helper.regexes = {
1268    asteriskDashAndColon: /([*_:~])/g
1269  };
1270  
1271  /**
1272   * EMOJIS LIST
1273   */
1274  showdown.helper.emojis = {
1275    '+1':'\ud83d\udc4d',
1276    '-1':'\ud83d\udc4e',
1277    '100':'\ud83d\udcaf',
1278    '1234':'\ud83d\udd22',
1279    '1st_place_medal':'\ud83e\udd47',
1280    '2nd_place_medal':'\ud83e\udd48',
1281    '3rd_place_medal':'\ud83e\udd49',
1282    '8ball':'\ud83c\udfb1',
1283    'a':'\ud83c\udd70\ufe0f',
1284    'ab':'\ud83c\udd8e',
1285    'abc':'\ud83d\udd24',
1286    'abcd':'\ud83d\udd21',
1287    'accept':'\ud83c\ude51',
1288    'aerial_tramway':'\ud83d\udea1',
1289    'airplane':'\u2708\ufe0f',
1290    'alarm_clock':'\u23f0',
1291    'alembic':'\u2697\ufe0f',
1292    'alien':'\ud83d\udc7d',
1293    'ambulance':'\ud83d\ude91',
1294    'amphora':'\ud83c\udffa',
1295    'anchor':'\u2693\ufe0f',
1296    'angel':'\ud83d\udc7c',
1297    'anger':'\ud83d\udca2',
1298    'angry':'\ud83d\ude20',
1299    'anguished':'\ud83d\ude27',
1300    'ant':'\ud83d\udc1c',
1301    'apple':'\ud83c\udf4e',
1302    'aquarius':'\u2652\ufe0f',
1303    'aries':'\u2648\ufe0f',
1304    'arrow_backward':'\u25c0\ufe0f',
1305    'arrow_double_down':'\u23ec',
1306    'arrow_double_up':'\u23eb',
1307    'arrow_down':'\u2b07\ufe0f',
1308    'arrow_down_small':'\ud83d\udd3d',
1309    'arrow_forward':'\u25b6\ufe0f',
1310    'arrow_heading_down':'\u2935\ufe0f',
1311    'arrow_heading_up':'\u2934\ufe0f',
1312    'arrow_left':'\u2b05\ufe0f',
1313    'arrow_lower_left':'\u2199\ufe0f',
1314    'arrow_lower_right':'\u2198\ufe0f',
1315    'arrow_right':'\u27a1\ufe0f',
1316    'arrow_right_hook':'\u21aa\ufe0f',
1317    'arrow_up':'\u2b06\ufe0f',
1318    'arrow_up_down':'\u2195\ufe0f',
1319    'arrow_up_small':'\ud83d\udd3c',
1320    'arrow_upper_left':'\u2196\ufe0f',
1321    'arrow_upper_right':'\u2197\ufe0f',
1322    'arrows_clockwise':'\ud83d\udd03',
1323    'arrows_counterclockwise':'\ud83d\udd04',
1324    'art':'\ud83c\udfa8',
1325    'articulated_lorry':'\ud83d\ude9b',
1326    'artificial_satellite':'\ud83d\udef0',
1327    'astonished':'\ud83d\ude32',
1328    'athletic_shoe':'\ud83d\udc5f',
1329    'atm':'\ud83c\udfe7',
1330    'atom_symbol':'\u269b\ufe0f',
1331    'avocado':'\ud83e\udd51',
1332    'b':'\ud83c\udd71\ufe0f',
1333    'baby':'\ud83d\udc76',
1334    'baby_bottle':'\ud83c\udf7c',
1335    'baby_chick':'\ud83d\udc24',
1336    'baby_symbol':'\ud83d\udebc',
1337    'back':'\ud83d\udd19',
1338    'bacon':'\ud83e\udd53',
1339    'badminton':'\ud83c\udff8',
1340    'baggage_claim':'\ud83d\udec4',
1341    'baguette_bread':'\ud83e\udd56',
1342    'balance_scale':'\u2696\ufe0f',
1343    'balloon':'\ud83c\udf88',
1344    'ballot_box':'\ud83d\uddf3',
1345    'ballot_box_with_check':'\u2611\ufe0f',
1346    'bamboo':'\ud83c\udf8d',
1347    'banana':'\ud83c\udf4c',
1348    'bangbang':'\u203c\ufe0f',
1349    'bank':'\ud83c\udfe6',
1350    'bar_chart':'\ud83d\udcca',
1351    'barber':'\ud83d\udc88',
1352    'baseball':'\u26be\ufe0f',
1353    'basketball':'\ud83c\udfc0',
1354    'basketball_man':'\u26f9\ufe0f',
1355    'basketball_woman':'\u26f9\ufe0f&zwj;\u2640\ufe0f',
1356    'bat':'\ud83e\udd87',
1357    'bath':'\ud83d\udec0',
1358    'bathtub':'\ud83d\udec1',
1359    'battery':'\ud83d\udd0b',
1360    'beach_umbrella':'\ud83c\udfd6',
1361    'bear':'\ud83d\udc3b',
1362    'bed':'\ud83d\udecf',
1363    'bee':'\ud83d\udc1d',
1364    'beer':'\ud83c\udf7a',
1365    'beers':'\ud83c\udf7b',
1366    'beetle':'\ud83d\udc1e',
1367    'beginner':'\ud83d\udd30',
1368    'bell':'\ud83d\udd14',
1369    'bellhop_bell':'\ud83d\udece',
1370    'bento':'\ud83c\udf71',
1371    'biking_man':'\ud83d\udeb4',
1372    'bike':'\ud83d\udeb2',
1373    'biking_woman':'\ud83d\udeb4&zwj;\u2640\ufe0f',
1374    'bikini':'\ud83d\udc59',
1375    'biohazard':'\u2623\ufe0f',
1376    'bird':'\ud83d\udc26',
1377    'birthday':'\ud83c\udf82',
1378    'black_circle':'\u26ab\ufe0f',
1379    'black_flag':'\ud83c\udff4',
1380    'black_heart':'\ud83d\udda4',
1381    'black_joker':'\ud83c\udccf',
1382    'black_large_square':'\u2b1b\ufe0f',
1383    'black_medium_small_square':'\u25fe\ufe0f',
1384    'black_medium_square':'\u25fc\ufe0f',
1385    'black_nib':'\u2712\ufe0f',
1386    'black_small_square':'\u25aa\ufe0f',
1387    'black_square_button':'\ud83d\udd32',
1388    'blonde_man':'\ud83d\udc71',
1389    'blonde_woman':'\ud83d\udc71&zwj;\u2640\ufe0f',
1390    'blossom':'\ud83c\udf3c',
1391    'blowfish':'\ud83d\udc21',
1392    'blue_book':'\ud83d\udcd8',
1393    'blue_car':'\ud83d\ude99',
1394    'blue_heart':'\ud83d\udc99',
1395    'blush':'\ud83d\ude0a',
1396    'boar':'\ud83d\udc17',
1397    'boat':'\u26f5\ufe0f',
1398    'bomb':'\ud83d\udca3',
1399    'book':'\ud83d\udcd6',
1400    'bookmark':'\ud83d\udd16',
1401    'bookmark_tabs':'\ud83d\udcd1',
1402    'books':'\ud83d\udcda',
1403    'boom':'\ud83d\udca5',
1404    'boot':'\ud83d\udc62',
1405    'bouquet':'\ud83d\udc90',
1406    'bowing_man':'\ud83d\ude47',
1407    'bow_and_arrow':'\ud83c\udff9',
1408    'bowing_woman':'\ud83d\ude47&zwj;\u2640\ufe0f',
1409    'bowling':'\ud83c\udfb3',
1410    'boxing_glove':'\ud83e\udd4a',
1411    'boy':'\ud83d\udc66',
1412    'bread':'\ud83c\udf5e',
1413    'bride_with_veil':'\ud83d\udc70',
1414    'bridge_at_night':'\ud83c\udf09',
1415    'briefcase':'\ud83d\udcbc',
1416    'broken_heart':'\ud83d\udc94',
1417    'bug':'\ud83d\udc1b',
1418    'building_construction':'\ud83c\udfd7',
1419    'bulb':'\ud83d\udca1',
1420    'bullettrain_front':'\ud83d\ude85',
1421    'bullettrain_side':'\ud83d\ude84',
1422    'burrito':'\ud83c\udf2f',
1423    'bus':'\ud83d\ude8c',
1424    'business_suit_levitating':'\ud83d\udd74',
1425    'busstop':'\ud83d\ude8f',
1426    'bust_in_silhouette':'\ud83d\udc64',
1427    'busts_in_silhouette':'\ud83d\udc65',
1428    'butterfly':'\ud83e\udd8b',
1429    'cactus':'\ud83c\udf35',
1430    'cake':'\ud83c\udf70',
1431    'calendar':'\ud83d\udcc6',
1432    'call_me_hand':'\ud83e\udd19',
1433    'calling':'\ud83d\udcf2',
1434    'camel':'\ud83d\udc2b',
1435    'camera':'\ud83d\udcf7',
1436    'camera_flash':'\ud83d\udcf8',
1437    'camping':'\ud83c\udfd5',
1438    'cancer':'\u264b\ufe0f',
1439    'candle':'\ud83d\udd6f',
1440    'candy':'\ud83c\udf6c',
1441    'canoe':'\ud83d\udef6',
1442    'capital_abcd':'\ud83d\udd20',
1443    'capricorn':'\u2651\ufe0f',
1444    'car':'\ud83d\ude97',
1445    'card_file_box':'\ud83d\uddc3',
1446    'card_index':'\ud83d\udcc7',
1447    'card_index_dividers':'\ud83d\uddc2',
1448    'carousel_horse':'\ud83c\udfa0',
1449    'carrot':'\ud83e\udd55',
1450    'cat':'\ud83d\udc31',
1451    'cat2':'\ud83d\udc08',
1452    'cd':'\ud83d\udcbf',
1453    'chains':'\u26d3',
1454    'champagne':'\ud83c\udf7e',
1455    'chart':'\ud83d\udcb9',
1456    'chart_with_downwards_trend':'\ud83d\udcc9',
1457    'chart_with_upwards_trend':'\ud83d\udcc8',
1458    'checkered_flag':'\ud83c\udfc1',
1459    'cheese':'\ud83e\uddc0',
1460    'cherries':'\ud83c\udf52',
1461    'cherry_blossom':'\ud83c\udf38',
1462    'chestnut':'\ud83c\udf30',
1463    'chicken':'\ud83d\udc14',
1464    'children_crossing':'\ud83d\udeb8',
1465    'chipmunk':'\ud83d\udc3f',
1466    'chocolate_bar':'\ud83c\udf6b',
1467    'christmas_tree':'\ud83c\udf84',
1468    'church':'\u26ea\ufe0f',
1469    'cinema':'\ud83c\udfa6',
1470    'circus_tent':'\ud83c\udfaa',
1471    'city_sunrise':'\ud83c\udf07',
1472    'city_sunset':'\ud83c\udf06',
1473    'cityscape':'\ud83c\udfd9',
1474    'cl':'\ud83c\udd91',
1475    'clamp':'\ud83d\udddc',
1476    'clap':'\ud83d\udc4f',
1477    'clapper':'\ud83c\udfac',
1478    'classical_building':'\ud83c\udfdb',
1479    'clinking_glasses':'\ud83e\udd42',
1480    'clipboard':'\ud83d\udccb',
1481    'clock1':'\ud83d\udd50',
1482    'clock10':'\ud83d\udd59',
1483    'clock1030':'\ud83d\udd65',
1484    'clock11':'\ud83d\udd5a',
1485    'clock1130':'\ud83d\udd66',
1486    'clock12':'\ud83d\udd5b',
1487    'clock1230':'\ud83d\udd67',
1488    'clock130':'\ud83d\udd5c',
1489    'clock2':'\ud83d\udd51',
1490    'clock230':'\ud83d\udd5d',
1491    'clock3':'\ud83d\udd52',
1492    'clock330':'\ud83d\udd5e',
1493    'clock4':'\ud83d\udd53',
1494    'clock430':'\ud83d\udd5f',
1495    'clock5':'\ud83d\udd54',
1496    'clock530':'\ud83d\udd60',
1497    'clock6':'\ud83d\udd55',
1498    'clock630':'\ud83d\udd61',
1499    'clock7':'\ud83d\udd56',
1500    'clock730':'\ud83d\udd62',
1501    'clock8':'\ud83d\udd57',
1502    'clock830':'\ud83d\udd63',
1503    'clock9':'\ud83d\udd58',
1504    'clock930':'\ud83d\udd64',
1505    'closed_book':'\ud83d\udcd5',
1506    'closed_lock_with_key':'\ud83d\udd10',
1507    'closed_umbrella':'\ud83c\udf02',
1508    'cloud':'\u2601\ufe0f',
1509    'cloud_with_lightning':'\ud83c\udf29',
1510    'cloud_with_lightning_and_rain':'\u26c8',
1511    'cloud_with_rain':'\ud83c\udf27',
1512    'cloud_with_snow':'\ud83c\udf28',
1513    'clown_face':'\ud83e\udd21',
1514    'clubs':'\u2663\ufe0f',
1515    'cocktail':'\ud83c\udf78',
1516    'coffee':'\u2615\ufe0f',
1517    'coffin':'\u26b0\ufe0f',
1518    'cold_sweat':'\ud83d\ude30',
1519    'comet':'\u2604\ufe0f',
1520    'computer':'\ud83d\udcbb',
1521    'computer_mouse':'\ud83d\uddb1',
1522    'confetti_ball':'\ud83c\udf8a',
1523    'confounded':'\ud83d\ude16',
1524    'confused':'\ud83d\ude15',
1525    'congratulations':'\u3297\ufe0f',
1526    'construction':'\ud83d\udea7',
1527    'construction_worker_man':'\ud83d\udc77',
1528    'construction_worker_woman':'\ud83d\udc77&zwj;\u2640\ufe0f',
1529    'control_knobs':'\ud83c\udf9b',
1530    'convenience_store':'\ud83c\udfea',
1531    'cookie':'\ud83c\udf6a',
1532    'cool':'\ud83c\udd92',
1533    'policeman':'\ud83d\udc6e',
1534    'copyright':'\u00a9\ufe0f',
1535    'corn':'\ud83c\udf3d',
1536    'couch_and_lamp':'\ud83d\udecb',
1537    'couple':'\ud83d\udc6b',
1538    'couple_with_heart_woman_man':'\ud83d\udc91',
1539    'couple_with_heart_man_man':'\ud83d\udc68&zwj;\u2764\ufe0f&zwj;\ud83d\udc68',
1540    'couple_with_heart_woman_woman':'\ud83d\udc69&zwj;\u2764\ufe0f&zwj;\ud83d\udc69',
1541    'couplekiss_man_man':'\ud83d\udc68&zwj;\u2764\ufe0f&zwj;\ud83d\udc8b&zwj;\ud83d\udc68',
1542    'couplekiss_man_woman':'\ud83d\udc8f',
1543    'couplekiss_woman_woman':'\ud83d\udc69&zwj;\u2764\ufe0f&zwj;\ud83d\udc8b&zwj;\ud83d\udc69',
1544    'cow':'\ud83d\udc2e',
1545    'cow2':'\ud83d\udc04',
1546    'cowboy_hat_face':'\ud83e\udd20',
1547    'crab':'\ud83e\udd80',
1548    'crayon':'\ud83d\udd8d',
1549    'credit_card':'\ud83d\udcb3',
1550    'crescent_moon':'\ud83c\udf19',
1551    'cricket':'\ud83c\udfcf',
1552    'crocodile':'\ud83d\udc0a',
1553    'croissant':'\ud83e\udd50',
1554    'crossed_fingers':'\ud83e\udd1e',
1555    'crossed_flags':'\ud83c\udf8c',
1556    'crossed_swords':'\u2694\ufe0f',
1557    'crown':'\ud83d\udc51',
1558    'cry':'\ud83d\ude22',
1559    'crying_cat_face':'\ud83d\ude3f',
1560    'crystal_ball':'\ud83d\udd2e',
1561    'cucumber':'\ud83e\udd52',
1562    'cupid':'\ud83d\udc98',
1563    'curly_loop':'\u27b0',
1564    'currency_exchange':'\ud83d\udcb1',
1565    'curry':'\ud83c\udf5b',
1566    'custard':'\ud83c\udf6e',
1567    'customs':'\ud83d\udec3',
1568    'cyclone':'\ud83c\udf00',
1569    'dagger':'\ud83d\udde1',
1570    'dancer':'\ud83d\udc83',
1571    'dancing_women':'\ud83d\udc6f',
1572    'dancing_men':'\ud83d\udc6f&zwj;\u2642\ufe0f',
1573    'dango':'\ud83c\udf61',
1574    'dark_sunglasses':'\ud83d\udd76',
1575    'dart':'\ud83c\udfaf',
1576    'dash':'\ud83d\udca8',
1577    'date':'\ud83d\udcc5',
1578    'deciduous_tree':'\ud83c\udf33',
1579    'deer':'\ud83e\udd8c',
1580    'department_store':'\ud83c\udfec',
1581    'derelict_house':'\ud83c\udfda',
1582    'desert':'\ud83c\udfdc',
1583    'desert_island':'\ud83c\udfdd',
1584    'desktop_computer':'\ud83d\udda5',
1585    'male_detective':'\ud83d\udd75\ufe0f',
1586    'diamond_shape_with_a_dot_inside':'\ud83d\udca0',
1587    'diamonds':'\u2666\ufe0f',
1588    'disappointed':'\ud83d\ude1e',
1589    'disappointed_relieved':'\ud83d\ude25',
1590    'dizzy':'\ud83d\udcab',
1591    'dizzy_face':'\ud83d\ude35',
1592    'do_not_litter':'\ud83d\udeaf',
1593    'dog':'\ud83d\udc36',
1594    'dog2':'\ud83d\udc15',
1595    'dollar':'\ud83d\udcb5',
1596    'dolls':'\ud83c\udf8e',
1597    'dolphin':'\ud83d\udc2c',
1598    'door':'\ud83d\udeaa',
1599    'doughnut':'\ud83c\udf69',
1600    'dove':'\ud83d\udd4a',
1601    'dragon':'\ud83d\udc09',
1602    'dragon_face':'\ud83d\udc32',
1603    'dress':'\ud83d\udc57',
1604    'dromedary_camel':'\ud83d\udc2a',
1605    'drooling_face':'\ud83e\udd24',
1606    'droplet':'\ud83d\udca7',
1607    'drum':'\ud83e\udd41',
1608    'duck':'\ud83e\udd86',
1609    'dvd':'\ud83d\udcc0',
1610    'e-mail':'\ud83d\udce7',
1611    'eagle':'\ud83e\udd85',
1612    'ear':'\ud83d\udc42',
1613    'ear_of_rice':'\ud83c\udf3e',
1614    'earth_africa':'\ud83c\udf0d',
1615    'earth_americas':'\ud83c\udf0e',
1616    'earth_asia':'\ud83c\udf0f',
1617    'egg':'\ud83e\udd5a',
1618    'eggplant':'\ud83c\udf46',
1619    'eight_pointed_black_star':'\u2734\ufe0f',
1620    'eight_spoked_asterisk':'\u2733\ufe0f',
1621    'electric_plug':'\ud83d\udd0c',
1622    'elephant':'\ud83d\udc18',
1623    'email':'\u2709\ufe0f',
1624    'end':'\ud83d\udd1a',
1625    'envelope_with_arrow':'\ud83d\udce9',
1626    'euro':'\ud83d\udcb6',
1627    'european_castle':'\ud83c\udff0',
1628    'european_post_office':'\ud83c\udfe4',
1629    'evergreen_tree':'\ud83c\udf32',
1630    'exclamation':'\u2757\ufe0f',
1631    'expressionless':'\ud83d\ude11',
1632    'eye':'\ud83d\udc41',
1633    'eye_speech_bubble':'\ud83d\udc41&zwj;\ud83d\udde8',
1634    'eyeglasses':'\ud83d\udc53',
1635    'eyes':'\ud83d\udc40',
1636    'face_with_head_bandage':'\ud83e\udd15',
1637    'face_with_thermometer':'\ud83e\udd12',
1638    'fist_oncoming':'\ud83d\udc4a',
1639    'factory':'\ud83c\udfed',
1640    'fallen_leaf':'\ud83c\udf42',
1641    'family_man_woman_boy':'\ud83d\udc6a',
1642    'family_man_boy':'\ud83d\udc68&zwj;\ud83d\udc66',
1643    'family_man_boy_boy':'\ud83d\udc68&zwj;\ud83d\udc66&zwj;\ud83d\udc66',
1644    'family_man_girl':'\ud83d\udc68&zwj;\ud83d\udc67',
1645    'family_man_girl_boy':'\ud83d\udc68&zwj;\ud83d\udc67&zwj;\ud83d\udc66',
1646    'family_man_girl_girl':'\ud83d\udc68&zwj;\ud83d\udc67&zwj;\ud83d\udc67',
1647    'family_man_man_boy':'\ud83d\udc68&zwj;\ud83d\udc68&zwj;\ud83d\udc66',
1648    'family_man_man_boy_boy':'\ud83d\udc68&zwj;\ud83d\udc68&zwj;\ud83d\udc66&zwj;\ud83d\udc66',
1649    'family_man_man_girl':'\ud83d\udc68&zwj;\ud83d\udc68&zwj;\ud83d\udc67',
1650    'family_man_man_girl_boy':'\ud83d\udc68&zwj;\ud83d\udc68&zwj;\ud83d\udc67&zwj;\ud83d\udc66',
1651    'family_man_man_girl_girl':'\ud83d\udc68&zwj;\ud83d\udc68&zwj;\ud83d\udc67&zwj;\ud83d\udc67',
1652    'family_man_woman_boy_boy':'\ud83d\udc68&zwj;\ud83d\udc69&zwj;\ud83d\udc66&zwj;\ud83d\udc66',
1653    'family_man_woman_girl':'\ud83d\udc68&zwj;\ud83d\udc69&zwj;\ud83d\udc67',
1654    'family_man_woman_girl_boy':'\ud83d\udc68&zwj;\ud83d\udc69&zwj;\ud83d\udc67&zwj;\ud83d\udc66',
1655    'family_man_woman_girl_girl':'\ud83d\udc68&zwj;\ud83d\udc69&zwj;\ud83d\udc67&zwj;\ud83d\udc67',
1656    'family_woman_boy':'\ud83d\udc69&zwj;\ud83d\udc66',
1657    'family_woman_boy_boy':'\ud83d\udc69&zwj;\ud83d\udc66&zwj;\ud83d\udc66',
1658    'family_woman_girl':'\ud83d\udc69&zwj;\ud83d\udc67',
1659    'family_woman_girl_boy':'\ud83d\udc69&zwj;\ud83d\udc67&zwj;\ud83d\udc66',
1660    'family_woman_girl_girl':'\ud83d\udc69&zwj;\ud83d\udc67&zwj;\ud83d\udc67',
1661    'family_woman_woman_boy':'\ud83d\udc69&zwj;\ud83d\udc69&zwj;\ud83d\udc66',
1662    'family_woman_woman_boy_boy':'\ud83d\udc69&zwj;\ud83d\udc69&zwj;\ud83d\udc66&zwj;\ud83d\udc66',
1663    'family_woman_woman_girl':'\ud83d\udc69&zwj;\ud83d\udc69&zwj;\ud83d\udc67',
1664    'family_woman_woman_girl_boy':'\ud83d\udc69&zwj;\ud83d\udc69&zwj;\ud83d\udc67&zwj;\ud83d\udc66',
1665    'family_woman_woman_girl_girl':'\ud83d\udc69&zwj;\ud83d\udc69&zwj;\ud83d\udc67&zwj;\ud83d\udc67',
1666    'fast_forward':'\u23e9',
1667    'fax':'\ud83d\udce0',
1668    'fearful':'\ud83d\ude28',
1669    'feet':'\ud83d\udc3e',
1670    'female_detective':'\ud83d\udd75\ufe0f&zwj;\u2640\ufe0f',
1671    'ferris_wheel':'\ud83c\udfa1',
1672    'ferry':'\u26f4',
1673    'field_hockey':'\ud83c\udfd1',
1674    'file_cabinet':'\ud83d\uddc4',
1675    'file_folder':'\ud83d\udcc1',
1676    'film_projector':'\ud83d\udcfd',
1677    'film_strip':'\ud83c\udf9e',
1678    'fire':'\ud83d\udd25',
1679    'fire_engine':'\ud83d\ude92',
1680    'fireworks':'\ud83c\udf86',
1681    'first_quarter_moon':'\ud83c\udf13',
1682    'first_quarter_moon_with_face':'\ud83c\udf1b',
1683    'fish':'\ud83d\udc1f',
1684    'fish_cake':'\ud83c\udf65',
1685    'fishing_pole_and_fish':'\ud83c\udfa3',
1686    'fist_raised':'\u270a',
1687    'fist_left':'\ud83e\udd1b',
1688    'fist_right':'\ud83e\udd1c',
1689    'flags':'\ud83c\udf8f',
1690    'flashlight':'\ud83d\udd26',
1691    'fleur_de_lis':'\u269c\ufe0f',
1692    'flight_arrival':'\ud83d\udeec',
1693    'flight_departure':'\ud83d\udeeb',
1694    'floppy_disk':'\ud83d\udcbe',
1695    'flower_playing_cards':'\ud83c\udfb4',
1696    'flushed':'\ud83d\ude33',
1697    'fog':'\ud83c\udf2b',
1698    'foggy':'\ud83c\udf01',
1699    'football':'\ud83c\udfc8',
1700    'footprints':'\ud83d\udc63',
1701    'fork_and_knife':'\ud83c\udf74',
1702    'fountain':'\u26f2\ufe0f',
1703    'fountain_pen':'\ud83d\udd8b',
1704    'four_leaf_clover':'\ud83c\udf40',
1705    'fox_face':'\ud83e\udd8a',
1706    'framed_picture':'\ud83d\uddbc',
1707    'free':'\ud83c\udd93',
1708    'fried_egg':'\ud83c\udf73',
1709    'fried_shrimp':'\ud83c\udf64',
1710    'fries':'\ud83c\udf5f',
1711    'frog':'\ud83d\udc38',
1712    'frowning':'\ud83d\ude26',
1713    'frowning_face':'\u2639\ufe0f',
1714    'frowning_man':'\ud83d\ude4d&zwj;\u2642\ufe0f',
1715    'frowning_woman':'\ud83d\ude4d',
1716    'middle_finger':'\ud83d\udd95',
1717    'fuelpump':'\u26fd\ufe0f',
1718    'full_moon':'\ud83c\udf15',
1719    'full_moon_with_face':'\ud83c\udf1d',
1720    'funeral_urn':'\u26b1\ufe0f',
1721    'game_die':'\ud83c\udfb2',
1722    'gear':'\u2699\ufe0f',
1723    'gem':'\ud83d\udc8e',
1724    'gemini':'\u264a\ufe0f',
1725    'ghost':'\ud83d\udc7b',
1726    'gift':'\ud83c\udf81',
1727    'gift_heart':'\ud83d\udc9d',
1728    'girl':'\ud83d\udc67',
1729    'globe_with_meridians':'\ud83c\udf10',
1730    'goal_net':'\ud83e\udd45',
1731    'goat':'\ud83d\udc10',
1732    'golf':'\u26f3\ufe0f',
1733    'golfing_man':'\ud83c\udfcc\ufe0f',
1734    'golfing_woman':'\ud83c\udfcc\ufe0f&zwj;\u2640\ufe0f',
1735    'gorilla':'\ud83e\udd8d',
1736    'grapes':'\ud83c\udf47',
1737    'green_apple':'\ud83c\udf4f',
1738    'green_book':'\ud83d\udcd7',
1739    'green_heart':'\ud83d\udc9a',
1740    'green_salad':'\ud83e\udd57',
1741    'grey_exclamation':'\u2755',
1742    'grey_question':'\u2754',
1743    'grimacing':'\ud83d\ude2c',
1744    'grin':'\ud83d\ude01',
1745    'grinning':'\ud83d\ude00',
1746    'guardsman':'\ud83d\udc82',
1747    'guardswoman':'\ud83d\udc82&zwj;\u2640\ufe0f',
1748    'guitar':'\ud83c\udfb8',
1749    'gun':'\ud83d\udd2b',
1750    'haircut_woman':'\ud83d\udc87',
1751    'haircut_man':'\ud83d\udc87&zwj;\u2642\ufe0f',
1752    'hamburger':'\ud83c\udf54',
1753    'hammer':'\ud83d\udd28',
1754    'hammer_and_pick':'\u2692',
1755    'hammer_and_wrench':'\ud83d\udee0',
1756    'hamster':'\ud83d\udc39',
1757    'hand':'\u270b',
1758    'handbag':'\ud83d\udc5c',
1759    'handshake':'\ud83e\udd1d',
1760    'hankey':'\ud83d\udca9',
1761    'hatched_chick':'\ud83d\udc25',
1762    'hatching_chick':'\ud83d\udc23',
1763    'headphones':'\ud83c\udfa7',
1764    'hear_no_evil':'\ud83d\ude49',
1765    'heart':'\u2764\ufe0f',
1766    'heart_decoration':'\ud83d\udc9f',
1767    'heart_eyes':'\ud83d\ude0d',
1768    'heart_eyes_cat':'\ud83d\ude3b',
1769    'heartbeat':'\ud83d\udc93',
1770    'heartpulse':'\ud83d\udc97',
1771    'hearts':'\u2665\ufe0f',
1772    'heavy_check_mark':'\u2714\ufe0f',
1773    'heavy_division_sign':'\u2797',
1774    'heavy_dollar_sign':'\ud83d\udcb2',
1775    'heavy_heart_exclamation':'\u2763\ufe0f',
1776    'heavy_minus_sign':'\u2796',
1777    'heavy_multiplication_x':'\u2716\ufe0f',
1778    'heavy_plus_sign':'\u2795',
1779    'helicopter':'\ud83d\ude81',
1780    'herb':'\ud83c\udf3f',
1781    'hibiscus':'\ud83c\udf3a',
1782    'high_brightness':'\ud83d\udd06',
1783    'high_heel':'\ud83d\udc60',
1784    'hocho':'\ud83d\udd2a',
1785    'hole':'\ud83d\udd73',
1786    'honey_pot':'\ud83c\udf6f',
1787    'horse':'\ud83d\udc34',
1788    'horse_racing':'\ud83c\udfc7',
1789    'hospital':'\ud83c\udfe5',
1790    'hot_pepper':'\ud83c\udf36',
1791    'hotdog':'\ud83c\udf2d',
1792    'hotel':'\ud83c\udfe8',
1793    'hotsprings':'\u2668\ufe0f',
1794    'hourglass':'\u231b\ufe0f',
1795    'hourglass_flowing_sand':'\u23f3',
1796    'house':'\ud83c\udfe0',
1797    'house_with_garden':'\ud83c\udfe1',
1798    'houses':'\ud83c\udfd8',
1799    'hugs':'\ud83e\udd17',
1800    'hushed':'\ud83d\ude2f',
1801    'ice_cream':'\ud83c\udf68',
1802    'ice_hockey':'\ud83c\udfd2',
1803    'ice_skate':'\u26f8',
1804    'icecream':'\ud83c\udf66',
1805    'id':'\ud83c\udd94',
1806    'ideograph_advantage':'\ud83c\ude50',
1807    'imp':'\ud83d\udc7f',
1808    'inbox_tray':'\ud83d\udce5',
1809    'incoming_envelope':'\ud83d\udce8',
1810    'tipping_hand_woman':'\ud83d\udc81',
1811    'information_source':'\u2139\ufe0f',
1812    'innocent':'\ud83d\ude07',
1813    'interrobang':'\u2049\ufe0f',
1814    'iphone':'\ud83d\udcf1',
1815    'izakaya_lantern':'\ud83c\udfee',
1816    'jack_o_lantern':'\ud83c\udf83',
1817    'japan':'\ud83d\uddfe',
1818    'japanese_castle':'\ud83c\udfef',
1819    'japanese_goblin':'\ud83d\udc7a',
1820    'japanese_ogre':'\ud83d\udc79',
1821    'jeans':'\ud83d\udc56',
1822    'joy':'\ud83d\ude02',
1823    'joy_cat':'\ud83d\ude39',
1824    'joystick':'\ud83d\udd79',
1825    'kaaba':'\ud83d\udd4b',
1826    'key':'\ud83d\udd11',
1827    'keyboard':'\u2328\ufe0f',
1828    'keycap_ten':'\ud83d\udd1f',
1829    'kick_scooter':'\ud83d\udef4',
1830    'kimono':'\ud83d\udc58',
1831    'kiss':'\ud83d\udc8b',
1832    'kissing':'\ud83d\ude17',
1833    'kissing_cat':'\ud83d\ude3d',
1834    'kissing_closed_eyes':'\ud83d\ude1a',
1835    'kissing_heart':'\ud83d\ude18',
1836    'kissing_smiling_eyes':'\ud83d\ude19',
1837    'kiwi_fruit':'\ud83e\udd5d',
1838    'koala':'\ud83d\udc28',
1839    'koko':'\ud83c\ude01',
1840    'label':'\ud83c\udff7',
1841    'large_blue_circle':'\ud83d\udd35',
1842    'large_blue_diamond':'\ud83d\udd37',
1843    'large_orange_diamond':'\ud83d\udd36',
1844    'last_quarter_moon':'\ud83c\udf17',
1845    'last_quarter_moon_with_face':'\ud83c\udf1c',
1846    'latin_cross':'\u271d\ufe0f',
1847    'laughing':'\ud83d\ude06',
1848    'leaves':'\ud83c\udf43',
1849    'ledger':'\ud83d\udcd2',
1850    'left_luggage':'\ud83d\udec5',
1851    'left_right_arrow':'\u2194\ufe0f',
1852    'leftwards_arrow_with_hook':'\u21a9\ufe0f',
1853    'lemon':'\ud83c\udf4b',
1854    'leo':'\u264c\ufe0f',
1855    'leopard':'\ud83d\udc06',
1856    'level_slider':'\ud83c\udf9a',
1857    'libra':'\u264e\ufe0f',
1858    'light_rail':'\ud83d\ude88',
1859    'link':'\ud83d\udd17',
1860    'lion':'\ud83e\udd81',
1861    'lips':'\ud83d\udc44',
1862    'lipstick':'\ud83d\udc84',
1863    'lizard':'\ud83e\udd8e',
1864    'lock':'\ud83d\udd12',
1865    'lock_with_ink_pen':'\ud83d\udd0f',
1866    'lollipop':'\ud83c\udf6d',
1867    'loop':'\u27bf',
1868    'loud_sound':'\ud83d\udd0a',
1869    'loudspeaker':'\ud83d\udce2',
1870    'love_hotel':'\ud83c\udfe9',
1871    'love_letter':'\ud83d\udc8c',
1872    'low_brightness':'\ud83d\udd05',
1873    'lying_face':'\ud83e\udd25',
1874    'm':'\u24c2\ufe0f',
1875    'mag':'\ud83d\udd0d',
1876    'mag_right':'\ud83d\udd0e',
1877    'mahjong':'\ud83c\udc04\ufe0f',
1878    'mailbox':'\ud83d\udceb',
1879    'mailbox_closed':'\ud83d\udcea',
1880    'mailbox_with_mail':'\ud83d\udcec',
1881    'mailbox_with_no_mail':'\ud83d\udced',
1882    'man':'\ud83d\udc68',
1883    'man_artist':'\ud83d\udc68&zwj;\ud83c\udfa8',
1884    'man_astronaut':'\ud83d\udc68&zwj;\ud83d\ude80',
1885    'man_cartwheeling':'\ud83e\udd38&zwj;\u2642\ufe0f',
1886    'man_cook':'\ud83d\udc68&zwj;\ud83c\udf73',
1887    'man_dancing':'\ud83d\udd7a',
1888    'man_facepalming':'\ud83e\udd26&zwj;\u2642\ufe0f',
1889    'man_factory_worker':'\ud83d\udc68&zwj;\ud83c\udfed',
1890    'man_farmer':'\ud83d\udc68&zwj;\ud83c\udf3e',
1891    'man_firefighter':'\ud83d\udc68&zwj;\ud83d\ude92',
1892    'man_health_worker':'\ud83d\udc68&zwj;\u2695\ufe0f',
1893    'man_in_tuxedo':'\ud83e\udd35',
1894    'man_judge':'\ud83d\udc68&zwj;\u2696\ufe0f',
1895    'man_juggling':'\ud83e\udd39&zwj;\u2642\ufe0f',
1896    'man_mechanic':'\ud83d\udc68&zwj;\ud83d\udd27',
1897    'man_office_worker':'\ud83d\udc68&zwj;\ud83d\udcbc',
1898    'man_pilot':'\ud83d\udc68&zwj;\u2708\ufe0f',
1899    'man_playing_handball':'\ud83e\udd3e&zwj;\u2642\ufe0f',
1900    'man_playing_water_polo':'\ud83e\udd3d&zwj;\u2642\ufe0f',
1901    'man_scientist':'\ud83d\udc68&zwj;\ud83d\udd2c',
1902    'man_shrugging':'\ud83e\udd37&zwj;\u2642\ufe0f',
1903    'man_singer':'\ud83d\udc68&zwj;\ud83c\udfa4',
1904    'man_student':'\ud83d\udc68&zwj;\ud83c\udf93',
1905    'man_teacher':'\ud83d\udc68&zwj;\ud83c\udfeb',
1906    'man_technologist':'\ud83d\udc68&zwj;\ud83d\udcbb',
1907    'man_with_gua_pi_mao':'\ud83d\udc72',
1908    'man_with_turban':'\ud83d\udc73',
1909    'tangerine':'\ud83c\udf4a',
1910    'mans_shoe':'\ud83d\udc5e',
1911    'mantelpiece_clock':'\ud83d\udd70',
1912    'maple_leaf':'\ud83c\udf41',
1913    'martial_arts_uniform':'\ud83e\udd4b',
1914    'mask':'\ud83d\ude37',
1915    'massage_woman':'\ud83d\udc86',
1916    'massage_man':'\ud83d\udc86&zwj;\u2642\ufe0f',
1917    'meat_on_bone':'\ud83c\udf56',
1918    'medal_military':'\ud83c\udf96',
1919    'medal_sports':'\ud83c\udfc5',
1920    'mega':'\ud83d\udce3',
1921    'melon':'\ud83c\udf48',
1922    'memo':'\ud83d\udcdd',
1923    'men_wrestling':'\ud83e\udd3c&zwj;\u2642\ufe0f',
1924    'menorah':'\ud83d\udd4e',
1925    'mens':'\ud83d\udeb9',
1926    'metal':'\ud83e\udd18',
1927    'metro':'\ud83d\ude87',
1928    'microphone':'\ud83c\udfa4',
1929    'microscope':'\ud83d\udd2c',
1930    'milk_glass':'\ud83e\udd5b',
1931    'milky_way':'\ud83c\udf0c',
1932    'minibus':'\ud83d\ude90',
1933    'minidisc':'\ud83d\udcbd',
1934    'mobile_phone_off':'\ud83d\udcf4',
1935    'money_mouth_face':'\ud83e\udd11',
1936    'money_with_wings':'\ud83d\udcb8',
1937    'moneybag':'\ud83d\udcb0',
1938    'monkey':'\ud83d\udc12',
1939    'monkey_face':'\ud83d\udc35',
1940    'monorail':'\ud83d\ude9d',
1941    'moon':'\ud83c\udf14',
1942    'mortar_board':'\ud83c\udf93',
1943    'mosque':'\ud83d\udd4c',
1944    'motor_boat':'\ud83d\udee5',
1945    'motor_scooter':'\ud83d\udef5',
1946    'motorcycle':'\ud83c\udfcd',
1947    'motorway':'\ud83d\udee3',
1948    'mount_fuji':'\ud83d\uddfb',
1949    'mountain':'\u26f0',
1950    'mountain_biking_man':'\ud83d\udeb5',
1951    'mountain_biking_woman':'\ud83d\udeb5&zwj;\u2640\ufe0f',
1952    'mountain_cableway':'\ud83d\udea0',
1953    'mountain_railway':'\ud83d\ude9e',
1954    'mountain_snow':'\ud83c\udfd4',
1955    'mouse':'\ud83d\udc2d',
1956    'mouse2':'\ud83d\udc01',
1957    'movie_camera':'\ud83c\udfa5',
1958    'moyai':'\ud83d\uddff',
1959    'mrs_claus':'\ud83e\udd36',
1960    'muscle':'\ud83d\udcaa',
1961    'mushroom':'\ud83c\udf44',
1962    'musical_keyboard':'\ud83c\udfb9',
1963    'musical_note':'\ud83c\udfb5',
1964    'musical_score':'\ud83c\udfbc',
1965    'mute':'\ud83d\udd07',
1966    'nail_care':'\ud83d\udc85',
1967    'name_badge':'\ud83d\udcdb',
1968    'national_park':'\ud83c\udfde',
1969    'nauseated_face':'\ud83e\udd22',
1970    'necktie':'\ud83d\udc54',
1971    'negative_squared_cross_mark':'\u274e',
1972    'nerd_face':'\ud83e\udd13',
1973    'neutral_face':'\ud83d\ude10',
1974    'new':'\ud83c\udd95',
1975    'new_moon':'\ud83c\udf11',
1976    'new_moon_with_face':'\ud83c\udf1a',
1977    'newspaper':'\ud83d\udcf0',
1978    'newspaper_roll':'\ud83d\uddde',
1979    'next_track_button':'\u23ed',
1980    'ng':'\ud83c\udd96',
1981    'no_good_man':'\ud83d\ude45&zwj;\u2642\ufe0f',
1982    'no_good_woman':'\ud83d\ude45',
1983    'night_with_stars':'\ud83c\udf03',
1984    'no_bell':'\ud83d\udd15',
1985    'no_bicycles':'\ud83d\udeb3',
1986    'no_entry':'\u26d4\ufe0f',
1987    'no_entry_sign':'\ud83d\udeab',
1988    'no_mobile_phones':'\ud83d\udcf5',
1989    'no_mouth':'\ud83d\ude36',
1990    'no_pedestrians':'\ud83d\udeb7',
1991    'no_smoking':'\ud83d\udead',
1992    'non-potable_water':'\ud83d\udeb1',
1993    'nose':'\ud83d\udc43',
1994    'notebook':'\ud83d\udcd3',
1995    'notebook_with_decorative_cover':'\ud83d\udcd4',
1996    'notes':'\ud83c\udfb6',
1997    'nut_and_bolt':'\ud83d\udd29',
1998    'o':'\u2b55\ufe0f',
1999    'o2':'\ud83c\udd7e\ufe0f',
2000    'ocean':'\ud83c\udf0a',
2001    'octopus':'\ud83d\udc19',
2002    'oden':'\ud83c\udf62',
2003    'office':'\ud83c\udfe2',
2004    'oil_drum':'\ud83d\udee2',
2005    'ok':'\ud83c\udd97',
2006    'ok_hand':'\ud83d\udc4c',
2007    'ok_man':'\ud83d\ude46&zwj;\u2642\ufe0f',
2008    'ok_woman':'\ud83d\ude46',
2009    'old_key':'\ud83d\udddd',
2010    'older_man':'\ud83d\udc74',
2011    'older_woman':'\ud83d\udc75',
2012    'om':'\ud83d\udd49',
2013    'on':'\ud83d\udd1b',
2014    'oncoming_automobile':'\ud83d\ude98',
2015    'oncoming_bus':'\ud83d\ude8d',
2016    'oncoming_police_car':'\ud83d\ude94',
2017    'oncoming_taxi':'\ud83d\ude96',
2018    'open_file_folder':'\ud83d\udcc2',
2019    'open_hands':'\ud83d\udc50',
2020    'open_mouth':'\ud83d\ude2e',
2021    'open_umbrella':'\u2602\ufe0f',
2022    'ophiuchus':'\u26ce',
2023    'orange_book':'\ud83d\udcd9',
2024    'orthodox_cross':'\u2626\ufe0f',
2025    'outbox_tray':'\ud83d\udce4',
2026    'owl':'\ud83e\udd89',
2027    'ox':'\ud83d\udc02',
2028    'package':'\ud83d\udce6',
2029    'page_facing_up':'\ud83d\udcc4',
2030    'page_with_curl':'\ud83d\udcc3',
2031    'pager':'\ud83d\udcdf',
2032    'paintbrush':'\ud83d\udd8c',
2033    'palm_tree':'\ud83c\udf34',
2034    'pancakes':'\ud83e\udd5e',
2035    'panda_face':'\ud83d\udc3c',
2036    'paperclip':'\ud83d\udcce',
2037    'paperclips':'\ud83d\udd87',
2038    'parasol_on_ground':'\u26f1',
2039    'parking':'\ud83c\udd7f\ufe0f',
2040    'part_alternation_mark':'\u303d\ufe0f',
2041    'partly_sunny':'\u26c5\ufe0f',
2042    'passenger_ship':'\ud83d\udef3',
2043    'passport_control':'\ud83d\udec2',
2044    'pause_button':'\u23f8',
2045    'peace_symbol':'\u262e\ufe0f',
2046    'peach':'\ud83c\udf51',
2047    'peanuts':'\ud83e\udd5c',
2048    'pear':'\ud83c\udf50',
2049    'pen':'\ud83d\udd8a',
2050    'pencil2':'\u270f\ufe0f',
2051    'penguin':'\ud83d\udc27',
2052    'pensive':'\ud83d\ude14',
2053    'performing_arts':'\ud83c\udfad',
2054    'persevere':'\ud83d\ude23',
2055    'person_fencing':'\ud83e\udd3a',
2056    'pouting_woman':'\ud83d\ude4e',
2057    'phone':'\u260e\ufe0f',
2058    'pick':'\u26cf',
2059    'pig':'\ud83d\udc37',
2060    'pig2':'\ud83d\udc16',
2061    'pig_nose':'\ud83d\udc3d',
2062    'pill':'\ud83d\udc8a',
2063    'pineapple':'\ud83c\udf4d',
2064    'ping_pong':'\ud83c\udfd3',
2065    'pisces':'\u2653\ufe0f',
2066    'pizza':'\ud83c\udf55',
2067    'place_of_worship':'\ud83d\uded0',
2068    'plate_with_cutlery':'\ud83c\udf7d',
2069    'play_or_pause_button':'\u23ef',
2070    'point_down':'\ud83d\udc47',
2071    'point_left':'\ud83d\udc48',
2072    'point_right':'\ud83d\udc49',
2073    'point_up':'\u261d\ufe0f',
2074    'point_up_2':'\ud83d\udc46',
2075    'police_car':'\ud83d\ude93',
2076    'policewoman':'\ud83d\udc6e&zwj;\u2640\ufe0f',
2077    'poodle':'\ud83d\udc29',
2078    'popcorn':'\ud83c\udf7f',
2079    'post_office':'\ud83c\udfe3',
2080    'postal_horn':'\ud83d\udcef',
2081    'postbox':'\ud83d\udcee',
2082    'potable_water':'\ud83d\udeb0',
2083    'potato':'\ud83e\udd54',
2084    'pouch':'\ud83d\udc5d',
2085    'poultry_leg':'\ud83c\udf57',
2086    'pound':'\ud83d\udcb7',
2087    'rage':'\ud83d\ude21',
2088    'pouting_cat':'\ud83d\ude3e',
2089    'pouting_man':'\ud83d\ude4e&zwj;\u2642\ufe0f',
2090    'pray':'\ud83d\ude4f',
2091    'prayer_beads':'\ud83d\udcff',
2092    'pregnant_woman':'\ud83e\udd30',
2093    'previous_track_button':'\u23ee',
2094    'prince':'\ud83e\udd34',
2095    'princess':'\ud83d\udc78',
2096    'printer':'\ud83d\udda8',
2097    'purple_heart':'\ud83d\udc9c',
2098    'purse':'\ud83d\udc5b',
2099    'pushpin':'\ud83d\udccc',
2100    'put_litter_in_its_place':'\ud83d\udeae',
2101    'question':'\u2753',
2102    'rabbit':'\ud83d\udc30',
2103    'rabbit2':'\ud83d\udc07',
2104    'racehorse':'\ud83d\udc0e',
2105    'racing_car':'\ud83c\udfce',
2106    'radio':'\ud83d\udcfb',
2107    'radio_button':'\ud83d\udd18',
2108    'radioactive':'\u2622\ufe0f',
2109    'railway_car':'\ud83d\ude83',
2110    'railway_track':'\ud83d\udee4',
2111    'rainbow':'\ud83c\udf08',
2112    'rainbow_flag':'\ud83c\udff3\ufe0f&zwj;\ud83c\udf08',
2113    'raised_back_of_hand':'\ud83e\udd1a',
2114    'raised_hand_with_fingers_splayed':'\ud83d\udd90',
2115    'raised_hands':'\ud83d\ude4c',
2116    'raising_hand_woman':'\ud83d\ude4b',
2117    'raising_hand_man':'\ud83d\ude4b&zwj;\u2642\ufe0f',
2118    'ram':'\ud83d\udc0f',
2119    'ramen':'\ud83c\udf5c',
2120    'rat':'\ud83d\udc00',
2121    'record_button':'\u23fa',
2122    'recycle':'\u267b\ufe0f',
2123    'red_circle':'\ud83d\udd34',
2124    'registered':'\u00ae\ufe0f',
2125    'relaxed':'\u263a\ufe0f',
2126    'relieved':'\ud83d\ude0c',
2127    'reminder_ribbon':'\ud83c\udf97',
2128    'repeat':'\ud83d\udd01',
2129    'repeat_one':'\ud83d\udd02',
2130    'rescue_worker_helmet':'\u26d1',
2131    'restroom':'\ud83d\udebb',
2132    'revolving_hearts':'\ud83d\udc9e',
2133    'rewind':'\u23ea',
2134    'rhinoceros':'\ud83e\udd8f',
2135    'ribbon':'\ud83c\udf80',
2136    'rice':'\ud83c\udf5a',
2137    'rice_ball':'\ud83c\udf59',
2138    'rice_cracker':'\ud83c\udf58',
2139    'rice_scene':'\ud83c\udf91',
2140    'right_anger_bubble':'\ud83d\uddef',
2141    'ring':'\ud83d\udc8d',
2142    'robot':'\ud83e\udd16',
2143    'rocket':'\ud83d\ude80',
2144    'rofl':'\ud83e\udd23',
2145    'roll_eyes':'\ud83d\ude44',
2146    'roller_coaster':'\ud83c\udfa2',
2147    'rooster':'\ud83d\udc13',
2148    'rose':'\ud83c\udf39',
2149    'rosette':'\ud83c\udff5',
2150    'rotating_light':'\ud83d\udea8',
2151    'round_pushpin':'\ud83d\udccd',
2152    'rowing_man':'\ud83d\udea3',
2153    'rowing_woman':'\ud83d\udea3&zwj;\u2640\ufe0f',
2154    'rugby_football':'\ud83c\udfc9',
2155    'running_man':'\ud83c\udfc3',
2156    'running_shirt_with_sash':'\ud83c\udfbd',
2157    'running_woman':'\ud83c\udfc3&zwj;\u2640\ufe0f',
2158    'sa':'\ud83c\ude02\ufe0f',
2159    'sagittarius':'\u2650\ufe0f',
2160    'sake':'\ud83c\udf76',
2161    'sandal':'\ud83d\udc61',
2162    'santa':'\ud83c\udf85',
2163    'satellite':'\ud83d\udce1',
2164    'saxophone':'\ud83c\udfb7',
2165    'school':'\ud83c\udfeb',
2166    'school_satchel':'\ud83c\udf92',
2167    'scissors':'\u2702\ufe0f',
2168    'scorpion':'\ud83e\udd82',
2169    'scorpius':'\u264f\ufe0f',
2170    'scream':'\ud83d\ude31',
2171    'scream_cat':'\ud83d\ude40',
2172    'scroll':'\ud83d\udcdc',
2173    'seat':'\ud83d\udcba',
2174    'secret':'\u3299\ufe0f',
2175    'see_no_evil':'\ud83d\ude48',
2176    'seedling':'\ud83c\udf31',
2177    'selfie':'\ud83e\udd33',
2178    'shallow_pan_of_food':'\ud83e\udd58',
2179    'shamrock':'\u2618\ufe0f',
2180    'shark':'\ud83e\udd88',
2181    'shaved_ice':'\ud83c\udf67',
2182    'sheep':'\ud83d\udc11',
2183    'shell':'\ud83d\udc1a',
2184    'shield':'\ud83d\udee1',
2185    'shinto_shrine':'\u26e9',
2186    'ship':'\ud83d\udea2',
2187    'shirt':'\ud83d\udc55',
2188    'shopping':'\ud83d\udecd',
2189    'shopping_cart':'\ud83d\uded2',
2190    'shower':'\ud83d\udebf',
2191    'shrimp':'\ud83e\udd90',
2192    'signal_strength':'\ud83d\udcf6',
2193    'six_pointed_star':'\ud83d\udd2f',
2194    'ski':'\ud83c\udfbf',
2195    'skier':'\u26f7',
2196    'skull':'\ud83d\udc80',
2197    'skull_and_crossbones':'\u2620\ufe0f',
2198    'sleeping':'\ud83d\ude34',
2199    'sleeping_bed':'\ud83d\udecc',
2200    'sleepy':'\ud83d\ude2a',
2201    'slightly_frowning_face':'\ud83d\ude41',
2202    'slightly_smiling_face':'\ud83d\ude42',
2203    'slot_machine':'\ud83c\udfb0',
2204    'small_airplane':'\ud83d\udee9',
2205    'small_blue_diamond':'\ud83d\udd39',
2206    'small_orange_diamond':'\ud83d\udd38',
2207    'small_red_triangle':'\ud83d\udd3a',
2208    'small_red_triangle_down':'\ud83d\udd3b',
2209    'smile':'\ud83d\ude04',
2210    'smile_cat':'\ud83d\ude38',
2211    'smiley':'\ud83d\ude03',
2212    'smiley_cat':'\ud83d\ude3a',
2213    'smiling_imp':'\ud83d\ude08',
2214    'smirk':'\ud83d\ude0f',
2215    'smirk_cat':'\ud83d\ude3c',
2216    'smoking':'\ud83d\udeac',
2217    'snail':'\ud83d\udc0c',
2218    'snake':'\ud83d\udc0d',
2219    'sneezing_face':'\ud83e\udd27',
2220    'snowboarder':'\ud83c\udfc2',
2221    'snowflake':'\u2744\ufe0f',
2222    'snowman':'\u26c4\ufe0f',
2223    'snowman_with_snow':'\u2603\ufe0f',
2224    'sob':'\ud83d\ude2d',
2225    'soccer':'\u26bd\ufe0f',
2226    'soon':'\ud83d\udd1c',
2227    'sos':'\ud83c\udd98',
2228    'sound':'\ud83d\udd09',
2229    'space_invader':'\ud83d\udc7e',
2230    'spades':'\u2660\ufe0f',
2231    'spaghetti':'\ud83c\udf5d',
2232    'sparkle':'\u2747\ufe0f',
2233    'sparkler':'\ud83c\udf87',
2234    'sparkles':'\u2728',
2235    'sparkling_heart':'\ud83d\udc96',
2236    'speak_no_evil':'\ud83d\ude4a',
2237    'speaker':'\ud83d\udd08',
2238    'speaking_head':'\ud83d\udde3',
2239    'speech_balloon':'\ud83d\udcac',
2240    'speedboat':'\ud83d\udea4',
2241    'spider':'\ud83d\udd77',
2242    'spider_web':'\ud83d\udd78',
2243    'spiral_calendar':'\ud83d\uddd3',
2244    'spiral_notepad':'\ud83d\uddd2',
2245    'spoon':'\ud83e\udd44',
2246    'squid':'\ud83e\udd91',
2247    'stadium':'\ud83c\udfdf',
2248    'star':'\u2b50\ufe0f',
2249    'star2':'\ud83c\udf1f',
2250    'star_and_crescent':'\u262a\ufe0f',
2251    'star_of_david':'\u2721\ufe0f',
2252    'stars':'\ud83c\udf20',
2253    'station':'\ud83d\ude89',
2254    'statue_of_liberty':'\ud83d\uddfd',
2255    'steam_locomotive':'\ud83d\ude82',
2256    'stew':'\ud83c\udf72',
2257    'stop_button':'\u23f9',
2258    'stop_sign':'\ud83d\uded1',
2259    'stopwatch':'\u23f1',
2260    'straight_ruler':'\ud83d\udccf',
2261    'strawberry':'\ud83c\udf53',
2262    'stuck_out_tongue':'\ud83d\ude1b',
2263    'stuck_out_tongue_closed_eyes':'\ud83d\ude1d',
2264    'stuck_out_tongue_winking_eye':'\ud83d\ude1c',
2265    'studio_microphone':'\ud83c\udf99',
2266    'stuffed_flatbread':'\ud83e\udd59',
2267    'sun_behind_large_cloud':'\ud83c\udf25',
2268    'sun_behind_rain_cloud':'\ud83c\udf26',
2269    'sun_behind_small_cloud':'\ud83c\udf24',
2270    'sun_with_face':'\ud83c\udf1e',
2271    'sunflower':'\ud83c\udf3b',
2272    'sunglasses':'\ud83d\ude0e',
2273    'sunny':'\u2600\ufe0f',
2274    'sunrise':'\ud83c\udf05',
2275    'sunrise_over_mountains':'\ud83c\udf04',
2276    'surfing_man':'\ud83c\udfc4',
2277    'surfing_woman':'\ud83c\udfc4&zwj;\u2640\ufe0f',
2278    'sushi':'\ud83c\udf63',
2279    'suspension_railway':'\ud83d\ude9f',
2280    'sweat':'\ud83d\ude13',
2281    'sweat_drops':'\ud83d\udca6',
2282    'sweat_smile':'\ud83d\ude05',
2283    'sweet_potato':'\ud83c\udf60',
2284    'swimming_man':'\ud83c\udfca',
2285    'swimming_woman':'\ud83c\udfca&zwj;\u2640\ufe0f',
2286    'symbols':'\ud83d\udd23',
2287    'synagogue':'\ud83d\udd4d',
2288    'syringe':'\ud83d\udc89',
2289    'taco':'\ud83c\udf2e',
2290    'tada':'\ud83c\udf89',
2291    'tanabata_tree':'\ud83c\udf8b',
2292    'taurus':'\u2649\ufe0f',
2293    'taxi':'\ud83d\ude95',
2294    'tea':'\ud83c\udf75',
2295    'telephone_receiver':'\ud83d\udcde',
2296    'telescope':'\ud83d\udd2d',
2297    'tennis':'\ud83c\udfbe',
2298    'tent':'\u26fa\ufe0f',
2299    'thermometer':'\ud83c\udf21',
2300    'thinking':'\ud83e\udd14',
2301    'thought_balloon':'\ud83d\udcad',
2302    'ticket':'\ud83c\udfab',
2303    'tickets':'\ud83c\udf9f',
2304    'tiger':'\ud83d\udc2f',
2305    'tiger2':'\ud83d\udc05',
2306    'timer_clock':'\u23f2',
2307    'tipping_hand_man':'\ud83d\udc81&zwj;\u2642\ufe0f',
2308    'tired_face':'\ud83d\ude2b',
2309    'tm':'\u2122\ufe0f',
2310    'toilet':'\ud83d\udebd',
2311    'tokyo_tower':'\ud83d\uddfc',
2312    'tomato':'\ud83c\udf45',
2313    'tongue':'\ud83d\udc45',
2314    'top':'\ud83d\udd1d',
2315    'tophat':'\ud83c\udfa9',
2316    'tornado':'\ud83c\udf2a',
2317    'trackball':'\ud83d\uddb2',
2318    'tractor':'\ud83d\ude9c',
2319    'traffic_light':'\ud83d\udea5',
2320    'train':'\ud83d\ude8b',
2321    'train2':'\ud83d\ude86',
2322    'tram':'\ud83d\ude8a',
2323    'triangular_flag_on_post':'\ud83d\udea9',
2324    'triangular_ruler':'\ud83d\udcd0',
2325    'trident':'\ud83d\udd31',
2326    'triumph':'\ud83d\ude24',
2327    'trolleybus':'\ud83d\ude8e',
2328    'trophy':'\ud83c\udfc6',
2329    'tropical_drink':'\ud83c\udf79',
2330    'tropical_fish':'\ud83d\udc20',
2331    'truck':'\ud83d\ude9a',
2332    'trumpet':'\ud83c\udfba',
2333    'tulip':'\ud83c\udf37',
2334    'tumbler_glass':'\ud83e\udd43',
2335    'turkey':'\ud83e\udd83',
2336    'turtle':'\ud83d\udc22',
2337    'tv':'\ud83d\udcfa',
2338    'twisted_rightwards_arrows':'\ud83d\udd00',
2339    'two_hearts':'\ud83d\udc95',
2340    'two_men_holding_hands':'\ud83d\udc6c',
2341    'two_women_holding_hands':'\ud83d\udc6d',
2342    'u5272':'\ud83c\ude39',
2343    'u5408':'\ud83c\ude34',
2344    'u55b6':'\ud83c\ude3a',
2345    'u6307':'\ud83c\ude2f\ufe0f',
2346    'u6708':'\ud83c\ude37\ufe0f',
2347    'u6709':'\ud83c\ude36',
2348    'u6e80':'\ud83c\ude35',
2349    'u7121':'\ud83c\ude1a\ufe0f',
2350    'u7533':'\ud83c\ude38',
2351    'u7981':'\ud83c\ude32',
2352    'u7a7a':'\ud83c\ude33',
2353    'umbrella':'\u2614\ufe0f',
2354    'unamused':'\ud83d\ude12',
2355    'underage':'\ud83d\udd1e',
2356    'unicorn':'\ud83e\udd84',
2357    'unlock':'\ud83d\udd13',
2358    'up':'\ud83c\udd99',
2359    'upside_down_face':'\ud83d\ude43',
2360    'v':'\u270c\ufe0f',
2361    'vertical_traffic_light':'\ud83d\udea6',
2362    'vhs':'\ud83d\udcfc',
2363    'vibration_mode':'\ud83d\udcf3',
2364    'video_camera':'\ud83d\udcf9',
2365    'video_game':'\ud83c\udfae',
2366    'violin':'\ud83c\udfbb',
2367    'virgo':'\u264d\ufe0f',
2368    'volcano':'\ud83c\udf0b',
2369    'volleyball':'\ud83c\udfd0',
2370    'vs':'\ud83c\udd9a',
2371    'vulcan_salute':'\ud83d\udd96',
2372    'walking_man':'\ud83d\udeb6',
2373    'walking_woman':'\ud83d\udeb6&zwj;\u2640\ufe0f',
2374    'waning_crescent_moon':'\ud83c\udf18',
2375    'waning_gibbous_moon':'\ud83c\udf16',
2376    'warning':'\u26a0\ufe0f',
2377    'wastebasket':'\ud83d\uddd1',
2378    'watch':'\u231a\ufe0f',
2379    'water_buffalo':'\ud83d\udc03',
2380    'watermelon':'\ud83c\udf49',
2381    'wave':'\ud83d\udc4b',
2382    'wavy_dash':'\u3030\ufe0f',
2383    'waxing_crescent_moon':'\ud83c\udf12',
2384    'wc':'\ud83d\udebe',
2385    'weary':'\ud83d\ude29',
2386    'wedding':'\ud83d\udc92',
2387    'weight_lifting_man':'\ud83c\udfcb\ufe0f',
2388    'weight_lifting_woman':'\ud83c\udfcb\ufe0f&zwj;\u2640\ufe0f',
2389    'whale':'\ud83d\udc33',
2390    'whale2':'\ud83d\udc0b',
2391    'wheel_of_dharma':'\u2638\ufe0f',
2392    'wheelchair':'\u267f\ufe0f',
2393    'white_check_mark':'\u2705',
2394    'white_circle':'\u26aa\ufe0f',
2395    'white_flag':'\ud83c\udff3\ufe0f',
2396    'white_flower':'\ud83d\udcae',
2397    'white_large_square':'\u2b1c\ufe0f',
2398    'white_medium_small_square':'\u25fd\ufe0f',
2399    'white_medium_square':'\u25fb\ufe0f',
2400    'white_small_square':'\u25ab\ufe0f',
2401    'white_square_button':'\ud83d\udd33',
2402    'wilted_flower':'\ud83e\udd40',
2403    'wind_chime':'\ud83c\udf90',
2404    'wind_face':'\ud83c\udf2c',
2405    'wine_glass':'\ud83c\udf77',
2406    'wink':'\ud83d\ude09',
2407    'wolf':'\ud83d\udc3a',
2408    'woman':'\ud83d\udc69',
2409    'woman_artist':'\ud83d\udc69&zwj;\ud83c\udfa8',
2410    'woman_astronaut':'\ud83d\udc69&zwj;\ud83d\ude80',
2411    'woman_cartwheeling':'\ud83e\udd38&zwj;\u2640\ufe0f',
2412    'woman_cook':'\ud83d\udc69&zwj;\ud83c\udf73',
2413    'woman_facepalming':'\ud83e\udd26&zwj;\u2640\ufe0f',
2414    'woman_factory_worker':'\ud83d\udc69&zwj;\ud83c\udfed',
2415    'woman_farmer':'\ud83d\udc69&zwj;\ud83c\udf3e',
2416    'woman_firefighter':'\ud83d\udc69&zwj;\ud83d\ude92',
2417    'woman_health_worker':'\ud83d\udc69&zwj;\u2695\ufe0f',
2418    'woman_judge':'\ud83d\udc69&zwj;\u2696\ufe0f',
2419    'woman_juggling':'\ud83e\udd39&zwj;\u2640\ufe0f',
2420    'woman_mechanic':'\ud83d\udc69&zwj;\ud83d\udd27',
2421    'woman_office_worker':'\ud83d\udc69&zwj;\ud83d\udcbc',
2422    'woman_pilot':'\ud83d\udc69&zwj;\u2708\ufe0f',
2423    'woman_playing_handball':'\ud83e\udd3e&zwj;\u2640\ufe0f',
2424    'woman_playing_water_polo':'\ud83e\udd3d&zwj;\u2640\ufe0f',
2425    'woman_scientist':'\ud83d\udc69&zwj;\ud83d\udd2c',
2426    'woman_shrugging':'\ud83e\udd37&zwj;\u2640\ufe0f',
2427    'woman_singer':'\ud83d\udc69&zwj;\ud83c\udfa4',
2428    'woman_student':'\ud83d\udc69&zwj;\ud83c\udf93',
2429    'woman_teacher':'\ud83d\udc69&zwj;\ud83c\udfeb',
2430    'woman_technologist':'\ud83d\udc69&zwj;\ud83d\udcbb',
2431    'woman_with_turban':'\ud83d\udc73&zwj;\u2640\ufe0f',
2432    'womans_clothes':'\ud83d\udc5a',
2433    'womans_hat':'\ud83d\udc52',
2434    'women_wrestling':'\ud83e\udd3c&zwj;\u2640\ufe0f',
2435    'womens':'\ud83d\udeba',
2436    'world_map':'\ud83d\uddfa',
2437    'worried':'\ud83d\ude1f',
2438    'wrench':'\ud83d\udd27',
2439    'writing_hand':'\u270d\ufe0f',
2440    'x':'\u274c',
2441    'yellow_heart':'\ud83d\udc9b',
2442    'yen':'\ud83d\udcb4',
2443    'yin_yang':'\u262f\ufe0f',
2444    'yum':'\ud83d\ude0b',
2445    'zap':'\u26a1\ufe0f',
2446    'zipper_mouth_face':'\ud83e\udd10',
2447    'zzz':'\ud83d\udca4',
2448  
2449    /* special emojis :P */
2450    'octocat':  '<img alt=":octocat:" height="20" width="20" align="absmiddle" src="https://assets-cdn.github.com/images/icons/emoji/octocat.png">',
2451    '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>'
2452  };
2453  
2454  /**
2455   * Created by Estevao on 31-05-2015.
2456   */
2457  
2458  /**
2459   * Showdown Converter class
2460   * @class
2461   * @param {object} [converterOptions]
2462   * @returns {Converter}
2463   */
2464  showdown.Converter = function (converterOptions) {
2465    'use strict';
2466  
2467    var
2468        /**
2469         * Options used by this converter
2470         * @private
2471         * @type {{}}
2472         */
2473        options = {},
2474  
2475        /**
2476         * Language extensions used by this converter
2477         * @private
2478         * @type {Array}
2479         */
2480        langExtensions = [],
2481  
2482        /**
2483         * Output modifiers extensions used by this converter
2484         * @private
2485         * @type {Array}
2486         */
2487        outputModifiers = [],
2488  
2489        /**
2490         * Event listeners
2491         * @private
2492         * @type {{}}
2493         */
2494        listeners = {},
2495  
2496        /**
2497         * The flavor set in this converter
2498         */
2499        setConvFlavor = setFlavor,
2500  
2501        /**
2502         * Metadata of the document
2503         * @type {{parsed: {}, raw: string, format: string}}
2504         */
2505        metadata = {
2506          parsed: {},
2507          raw: '',
2508          format: ''
2509        };
2510  
2511    _constructor();
2512  
2513    /**
2514     * Converter constructor
2515     * @private
2516     */
2517    function _constructor () {
2518      converterOptions = converterOptions || {};
2519  
2520      for (var gOpt in globalOptions) {
2521        if (globalOptions.hasOwnProperty(gOpt)) {
2522          options[gOpt] = globalOptions[gOpt];
2523        }
2524      }
2525  
2526      // Merge options
2527      if (typeof converterOptions === 'object') {
2528        for (var opt in converterOptions) {
2529          if (converterOptions.hasOwnProperty(opt)) {
2530            options[opt] = converterOptions[opt];
2531          }
2532        }
2533      } else {
2534        throw Error('Converter expects the passed parameter to be an object, but ' + typeof converterOptions +
2535        ' was passed instead.');
2536      }
2537  
2538      if (options.extensions) {
2539        showdown.helper.forEach(options.extensions, _parseExtension);
2540      }
2541    }
2542  
2543    /**
2544     * Parse extension
2545     * @param {*} ext
2546     * @param {string} [name='']
2547     * @private
2548     */
2549    function _parseExtension (ext, name) {
2550  
2551      name = name || null;
2552      // If it's a string, the extension was previously loaded
2553      if (showdown.helper.isString(ext)) {
2554        ext = showdown.helper.stdExtName(ext);
2555        name = ext;
2556  
2557        // LEGACY_SUPPORT CODE
2558        if (showdown.extensions[ext]) {
2559          console.warn('DEPRECATION WARNING: ' + ext + ' is an old extension that uses a deprecated loading method.' +
2560            'Please inform the developer that the extension should be updated!');
2561          legacyExtensionLoading(showdown.extensions[ext], ext);
2562          return;
2563          // END LEGACY SUPPORT CODE
2564  
2565        } else if (!showdown.helper.isUndefined(extensions[ext])) {
2566          ext = extensions[ext];
2567  
2568        } else {
2569          throw Error('Extension "' + ext + '" could not be loaded. It was either not found or is not a valid extension.');
2570        }
2571      }
2572  
2573      if (typeof ext === 'function') {
2574        ext = ext();
2575      }
2576  
2577      if (!showdown.helper.isArray(ext)) {
2578        ext = [ext];
2579      }
2580  
2581      var validExt = validate(ext, name);
2582      if (!validExt.valid) {
2583        throw Error(validExt.error);
2584      }
2585  
2586      for (var i = 0; i < ext.length; ++i) {
2587        switch (ext[i].type) {
2588  
2589          case 'lang':
2590            langExtensions.push(ext[i]);
2591            break;
2592  
2593          case 'output':
2594            outputModifiers.push(ext[i]);
2595            break;
2596        }
2597        if (ext[i].hasOwnProperty('listeners')) {
2598          for (var ln in ext[i].listeners) {
2599            if (ext[i].listeners.hasOwnProperty(ln)) {
2600              listen(ln, ext[i].listeners[ln]);
2601            }
2602          }
2603        }
2604      }
2605  
2606    }
2607  
2608    /**
2609     * LEGACY_SUPPORT
2610     * @param {*} ext
2611     * @param {string} name
2612     */
2613    function legacyExtensionLoading (ext, name) {
2614      if (typeof ext === 'function') {
2615        ext = ext(new showdown.Converter());
2616      }
2617      if (!showdown.helper.isArray(ext)) {
2618        ext = [ext];
2619      }
2620      var valid = validate(ext, name);
2621  
2622      if (!valid.valid) {
2623        throw Error(valid.error);
2624      }
2625  
2626      for (var i = 0; i < ext.length; ++i) {
2627        switch (ext[i].type) {
2628          case 'lang':
2629            langExtensions.push(ext[i]);
2630            break;
2631          case 'output':
2632            outputModifiers.push(ext[i]);
2633            break;
2634          default:// should never reach here
2635            throw Error('Extension loader error: Type unrecognized!!!');
2636        }
2637      }
2638    }
2639  
2640    /**
2641     * Listen to an event
2642     * @param {string} name
2643     * @param {function} callback
2644     */
2645    function listen (name, callback) {
2646      if (!showdown.helper.isString(name)) {
2647        throw Error('Invalid argument in converter.listen() method: name must be a string, but ' + typeof name + ' given');
2648      }
2649  
2650      if (typeof callback !== 'function') {
2651        throw Error('Invalid argument in converter.listen() method: callback must be a function, but ' + typeof callback + ' given');
2652      }
2653  
2654      if (!listeners.hasOwnProperty(name)) {
2655        listeners[name] = [];
2656      }
2657      listeners[name].push(callback);
2658    }
2659  
2660    function rTrimInputText (text) {
2661      var rsp = text.match(/^\s*/)[0].length,
2662          rgx = new RegExp('^\\s{0,' + rsp + '}', 'gm');
2663      return text.replace(rgx, '');
2664    }
2665  
2666    /**
2667     * Dispatch an event
2668     * @private
2669     * @param {string} evtName Event name
2670     * @param {string} text Text
2671     * @param {{}} options Converter Options
2672     * @param {{}} globals
2673     * @returns {string}
2674     */
2675    this._dispatch = function dispatch (evtName, text, options, globals) {
2676      if (listeners.hasOwnProperty(evtName)) {
2677        for (var ei = 0; ei < listeners[evtName].length; ++ei) {
2678          var nText = listeners[evtName][ei](evtName, text, this, options, globals);
2679          if (nText && typeof nText !== 'undefined') {
2680            text = nText;
2681          }
2682        }
2683      }
2684      return text;
2685    };
2686  
2687    /**
2688     * Listen to an event
2689     * @param {string} name
2690     * @param {function} callback
2691     * @returns {showdown.Converter}
2692     */
2693    this.listen = function (name, callback) {
2694      listen(name, callback);
2695      return this;
2696    };
2697  
2698    /**
2699     * Converts a markdown string into HTML
2700     * @param {string} text
2701     * @returns {*}
2702     */
2703    this.makeHtml = function (text) {
2704      //check if text is not falsy
2705      if (!text) {
2706        return text;
2707      }
2708  
2709      var globals = {
2710        gHtmlBlocks:     [],
2711        gHtmlMdBlocks:   [],
2712        gHtmlSpans:      [],
2713        gUrls:           {},
2714        gTitles:         {},
2715        gDimensions:     {},
2716        gListLevel:      0,
2717        hashLinkCounts:  {},
2718        langExtensions:  langExtensions,
2719        outputModifiers: outputModifiers,
2720        converter:       this,
2721        ghCodeBlocks:    [],
2722        metadata: {
2723          parsed: {},
2724          raw: '',
2725          format: ''
2726        }
2727      };
2728  
2729      // This lets us use ¨ trema as an escape char to avoid md5 hashes
2730      // The choice of character is arbitrary; anything that isn't
2731      // magic in Markdown will work.
2732      text = text.replace(/¨/g, '¨T');
2733  
2734      // Replace $ with ¨D
2735      // RegExp interprets $ as a special character
2736      // when it's in a replacement string
2737      text = text.replace(/\$/g, '¨D');
2738  
2739      // Standardize line endings
2740      text = text.replace(/\r\n/g, '\n'); // DOS to Unix
2741      text = text.replace(/\r/g, '\n'); // Mac to Unix
2742  
2743      // Stardardize line spaces
2744      text = text.replace(/\u00A0/g, '&nbsp;');
2745  
2746      if (options.smartIndentationFix) {
2747        text = rTrimInputText(text);
2748      }
2749  
2750      // Make sure text begins and ends with a couple of newlines:
2751      text = '\n\n' + text + '\n\n';
2752  
2753      // detab
2754      text = showdown.subParser('detab')(text, options, globals);
2755  
2756      /**
2757       * Strip any lines consisting only of spaces and tabs.
2758       * This makes subsequent regexs easier to write, because we can
2759       * match consecutive blank lines with /\n+/ instead of something
2760       * contorted like /[ \t]*\n+/
2761       */
2762      text = text.replace(/^[ \t]+$/mg, '');
2763  
2764      //run languageExtensions
2765      showdown.helper.forEach(langExtensions, function (ext) {
2766        text = showdown.subParser('runExtension')(ext, text, options, globals);
2767      });
2768  
2769      // run the sub parsers
2770      text = showdown.subParser('metadata')(text, options, globals);
2771      text = showdown.subParser('hashPreCodeTags')(text, options, globals);
2772      text = showdown.subParser('githubCodeBlocks')(text, options, globals);
2773      text = showdown.subParser('hashHTMLBlocks')(text, options, globals);
2774      text = showdown.subParser('hashCodeTags')(text, options, globals);
2775      text = showdown.subParser('stripLinkDefinitions')(text, options, globals);
2776      text = showdown.subParser('blockGamut')(text, options, globals);
2777      text = showdown.subParser('unhashHTMLSpans')(text, options, globals);
2778      text = showdown.subParser('unescapeSpecialChars')(text, options, globals);
2779  
2780      // attacklab: Restore dollar signs
2781      text = text.replace(/¨D/g, '$$');
2782  
2783      // attacklab: Restore tremas
2784      text = text.replace(/¨T/g, '¨');
2785  
2786      // render a complete html document instead of a partial if the option is enabled
2787      text = showdown.subParser('completeHTMLDocument')(text, options, globals);
2788  
2789      // Run output modifiers
2790      showdown.helper.forEach(outputModifiers, function (ext) {
2791        text = showdown.subParser('runExtension')(ext, text, options, globals);
2792      });
2793  
2794      // update metadata
2795      metadata = globals.metadata;
2796      return text;
2797    };
2798  
2799    /**
2800     * Converts an HTML string into a markdown string
2801     * @param src
2802     * @param [HTMLParser] A WHATWG DOM and HTML parser, such as JSDOM. If none is supplied, window.document will be used.
2803     * @returns {string}
2804     */
2805    this.makeMarkdown = this.makeMd = function (src, HTMLParser) {
2806  
2807      // replace \r\n with \n
2808      src = src.replace(/\r\n/g, '\n');
2809      src = src.replace(/\r/g, '\n'); // old macs
2810  
2811      // due to an edge case, we need to find this: > <
2812      // to prevent removing of non silent white spaces
2813      // ex: <em>this is</em> <strong>sparta</strong>
2814      src = src.replace(/>[ \t]+</, '>¨NBSP;<');
2815  
2816      if (!HTMLParser) {
2817        if (window && window.document) {
2818          HTMLParser = window.document;
2819        } else {
2820          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');
2821        }
2822      }
2823  
2824      var doc = HTMLParser.createElement('div');
2825      doc.innerHTML = src;
2826  
2827      var globals = {
2828        preList: substitutePreCodeTags(doc)
2829      };
2830  
2831      // remove all newlines and collapse spaces
2832      clean(doc);
2833  
2834      // some stuff, like accidental reference links must now be escaped
2835      // TODO
2836      // doc.innerHTML = doc.innerHTML.replace(/\[[\S\t ]]/);
2837  
2838      var nodes = doc.childNodes,
2839          mdDoc = '';
2840  
2841      for (var i = 0; i < nodes.length; i++) {
2842        mdDoc += showdown.subParser('makeMarkdown.node')(nodes[i], globals);
2843      }
2844  
2845      function clean (node) {
2846        for (var n = 0; n < node.childNodes.length; ++n) {
2847          var child = node.childNodes[n];
2848          if (child.nodeType === 3) {
2849            if (!/\S/.test(child.nodeValue)) {
2850              node.removeChild(child);
2851              --n;
2852            } else {
2853              child.nodeValue = child.nodeValue.split('\n').join(' ');
2854              child.nodeValue = child.nodeValue.replace(/(\s)+/g, '$1');
2855            }
2856          } else if (child.nodeType === 1) {
2857            clean(child);
2858          }
2859        }
2860      }
2861  
2862      // find all pre tags and replace contents with placeholder
2863      // we need this so that we can remove all indentation from html
2864      // to ease up parsing
2865      function substitutePreCodeTags (doc) {
2866  
2867        var pres = doc.querySelectorAll('pre'),
2868            presPH = [];
2869  
2870        for (var i = 0; i < pres.length; ++i) {
2871  
2872          if (pres[i].childElementCount === 1 && pres[i].firstChild.tagName.toLowerCase() === 'code') {
2873            var content = pres[i].firstChild.innerHTML.trim(),
2874                language = pres[i].firstChild.getAttribute('data-language') || '';
2875  
2876            // if data-language attribute is not defined, then we look for class language-*
2877            if (language === '') {
2878              var classes = pres[i].firstChild.className.split(' ');
2879              for (var c = 0; c < classes.length; ++c) {
2880                var matches = classes[c].match(/^language-(.+)$/);
2881                if (matches !== null) {
2882                  language = matches[1];
2883                  break;
2884                }
2885              }
2886            }
2887  
2888            // unescape html entities in content
2889            content = showdown.helper.unescapeHTMLEntities(content);
2890  
2891            presPH.push(content);
2892            pres[i].outerHTML = '<precode language="' + language + '" precodenum="' + i.toString() + '"></precode>';
2893          } else {
2894            presPH.push(pres[i].innerHTML);
2895            pres[i].innerHTML = '';
2896            pres[i].setAttribute('prenum', i.toString());
2897          }
2898        }
2899        return presPH;
2900      }
2901  
2902      return mdDoc;
2903    };
2904  
2905    /**
2906     * Set an option of this Converter instance
2907     * @param {string} key
2908     * @param {*} value
2909     */
2910    this.setOption = function (key, value) {
2911      options[key] = value;
2912    };
2913  
2914    /**
2915     * Get the option of this Converter instance
2916     * @param {string} key
2917     * @returns {*}
2918     */
2919    this.getOption = function (key) {
2920      return options[key];
2921    };
2922  
2923    /**
2924     * Get the options of this Converter instance
2925     * @returns {{}}
2926     */
2927    this.getOptions = function () {
2928      return options;
2929    };
2930  
2931    /**
2932     * Add extension to THIS converter
2933     * @param {{}} extension
2934     * @param {string} [name=null]
2935     */
2936    this.addExtension = function (extension, name) {
2937      name = name || null;
2938      _parseExtension(extension, name);
2939    };
2940  
2941    /**
2942     * Use a global registered extension with THIS converter
2943     * @param {string} extensionName Name of the previously registered extension
2944     */
2945    this.useExtension = function (extensionName) {
2946      _parseExtension(extensionName);
2947    };
2948  
2949    /**
2950     * Set the flavor THIS converter should use
2951     * @param {string} name
2952     */
2953    this.setFlavor = function (name) {
2954      if (!flavor.hasOwnProperty(name)) {
2955        throw Error(name + ' flavor was not found');
2956      }
2957      var preset = flavor[name];
2958      setConvFlavor = name;
2959      for (var option in preset) {
2960        if (preset.hasOwnProperty(option)) {
2961          options[option] = preset[option];
2962        }
2963      }
2964    };
2965  
2966    /**
2967     * Get the currently set flavor of this converter
2968     * @returns {string}
2969     */
2970    this.getFlavor = function () {
2971      return setConvFlavor;
2972    };
2973  
2974    /**
2975     * Remove an extension from THIS converter.
2976     * Note: This is a costly operation. It's better to initialize a new converter
2977     * and specify the extensions you wish to use
2978     * @param {Array} extension
2979     */
2980    this.removeExtension = function (extension) {
2981      if (!showdown.helper.isArray(extension)) {
2982        extension = [extension];
2983      }
2984      for (var a = 0; a < extension.length; ++a) {
2985        var ext = extension[a];
2986        for (var i = 0; i < langExtensions.length; ++i) {
2987          if (langExtensions[i] === ext) {
2988            langExtensions[i].splice(i, 1);
2989          }
2990        }
2991        for (var ii = 0; ii < outputModifiers.length; ++i) {
2992          if (outputModifiers[ii] === ext) {
2993            outputModifiers[ii].splice(i, 1);
2994          }
2995        }
2996      }
2997    };
2998  
2999    /**
3000     * Get all extension of THIS converter
3001     * @returns {{language: Array, output: Array}}
3002     */
3003    this.getAllExtensions = function () {
3004      return {
3005        language: langExtensions,
3006        output: outputModifiers
3007      };
3008    };
3009  
3010    /**
3011     * Get the metadata of the previously parsed document
3012     * @param raw
3013     * @returns {string|{}}
3014     */
3015    this.getMetadata = function (raw) {
3016      if (raw) {
3017        return metadata.raw;
3018      } else {
3019        return metadata.parsed;
3020      }
3021    };
3022  
3023    /**
3024     * Get the metadata format of the previously parsed document
3025     * @returns {string}
3026     */
3027    this.getMetadataFormat = function () {
3028      return metadata.format;
3029    };
3030  
3031    /**
3032     * Private: set a single key, value metadata pair
3033     * @param {string} key
3034     * @param {string} value
3035     */
3036    this._setMetadataPair = function (key, value) {
3037      metadata.parsed[key] = value;
3038    };
3039  
3040    /**
3041     * Private: set metadata format
3042     * @param {string} format
3043     */
3044    this._setMetadataFormat = function (format) {
3045      metadata.format = format;
3046    };
3047  
3048    /**
3049     * Private: set metadata raw text
3050     * @param {string} raw
3051     */
3052    this._setMetadataRaw = function (raw) {
3053      metadata.raw = raw;
3054    };
3055  };
3056  
3057  /**
3058   * Turn Markdown link shortcuts into XHTML <a> tags.
3059   */
3060  showdown.subParser('anchors', function (text, options, globals) {
3061    'use strict';
3062  
3063    text = globals.converter._dispatch('anchors.before', text, options, globals);
3064  
3065    var writeAnchorTag = function (wholeMatch, linkText, linkId, url, m5, m6, title) {
3066      if (showdown.helper.isUndefined(title)) {
3067        title = '';
3068      }
3069      linkId = linkId.toLowerCase();
3070  
3071      // Special case for explicit empty url
3072      if (wholeMatch.search(/\(<?\s*>? ?(['"].*['"])?\)$/m) > -1) {
3073        url = '';
3074      } else if (!url) {
3075        if (!linkId) {
3076          // lower-case and turn embedded newlines into spaces
3077          linkId = linkText.toLowerCase().replace(/ ?\n/g, ' ');
3078        }
3079        url = '#' + linkId;
3080  
3081        if (!showdown.helper.isUndefined(globals.gUrls[linkId])) {
3082          url = globals.gUrls[linkId];
3083          if (!showdown.helper.isUndefined(globals.gTitles[linkId])) {
3084            title = globals.gTitles[linkId];
3085          }
3086        } else {
3087          return wholeMatch;
3088        }
3089      }
3090  
3091      //url = showdown.helper.escapeCharacters(url, '*_', false); // replaced line to improve performance
3092      url = url.replace(showdown.helper.regexes.asteriskDashAndColon, showdown.helper.escapeCharactersCallback);
3093  
3094      var result = '<a href="' + url + '"';
3095  
3096      if (title !== '' && title !== null) {
3097        title = title.replace(/"/g, '&quot;');
3098        //title = showdown.helper.escapeCharacters(title, '*_', false); // replaced line to improve performance
3099        title = title.replace(showdown.helper.regexes.asteriskDashAndColon, showdown.helper.escapeCharactersCallback);
3100        result += ' title="' + title + '"';
3101      }
3102  
3103      // optionLinksInNewWindow only applies
3104      // to external links. Hash links (#) open in same page
3105      if (options.openLinksInNewWindow && !/^#/.test(url)) {
3106        // escaped _
3107        result += ' rel="noopener noreferrer" target="¨E95Eblank"';
3108      }
3109  
3110      result += '>' + linkText + '</a>';
3111  
3112      return result;
3113    };
3114  
3115    // First, handle reference-style links: [link text] [id]
3116    text = text.replace(/\[((?:\[[^\]]*]|[^\[\]])*)] ?(?:\n *)?\[(.*?)]()()()()/g, writeAnchorTag);
3117  
3118    // Next, inline-style links: [link text](url "optional title")
3119    // cases with crazy urls like ./image/cat1).png
3120    text = text.replace(/\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]?<([^>]*)>(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g,
3121      writeAnchorTag);
3122  
3123    // normal cases
3124    text = text.replace(/\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]?<?([\S]+?(?:\([\S]*?\)[\S]*?)?)>?(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g,
3125      writeAnchorTag);
3126  
3127    // handle reference-style shortcuts: [link text]
3128    // These must come last in case you've also got [link test][1]
3129    // or [link test](/foo)
3130    text = text.replace(/\[([^\[\]]+)]()()()()()/g, writeAnchorTag);
3131  
3132    // Lastly handle GithubMentions if option is enabled
3133    if (options.ghMentions) {
3134      text = text.replace(/(^|\s)(\\)?(@([a-z\d]+(?:[a-z\d.-]+?[a-z\d]+)*))/gmi, function (wm, st, escape, mentions, username) {
3135        if (escape === '\\') {
3136          return st + mentions;
3137        }
3138  
3139        //check if options.ghMentionsLink is a string
3140        if (!showdown.helper.isString(options.ghMentionsLink)) {
3141          throw new Error('ghMentionsLink option must be a string');
3142        }
3143        var lnk = options.ghMentionsLink.replace(/\{u}/g, username),
3144            target = '';
3145        if (options.openLinksInNewWindow) {
3146          target = ' rel="noopener noreferrer" target="¨E95Eblank"';
3147        }
3148        return st + '<a href="' + lnk + '"' + target + '>' + mentions + '</a>';
3149      });
3150    }
3151  
3152    text = globals.converter._dispatch('anchors.after', text, options, globals);
3153    return text;
3154  });
3155  
3156  // url allowed chars [a-z\d_.~:/?#[]@!$&'()*+,;=-]
3157  
3158  var simpleURLRegex  = /([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+?\.[^'">\s]+?)()(\1)?(?=\s|$)(?!["<>])/gi,
3159      simpleURLRegex2 = /([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+\.[^'">\s]+?)([.!?,()\[\]])?(\1)?(?=\s|$)(?!["<>])/gi,
3160      delimUrlRegex   = /()<(((https?|ftp|dict):\/\/|www\.)[^'">\s]+)()>()/gi,
3161      simpleMailRegex = /(^|\s)(?:mailto:)?([A-Za-z0-9!#$%&'*+-/=?^_`{|}~.]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)(?=$|\s)/gmi,
3162      delimMailRegex  = /<()(?:mailto:)?([-.\w]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)>/gi,
3163  
3164      replaceLink = function (options) {
3165        'use strict';
3166        return function (wm, leadingMagicChars, link, m2, m3, trailingPunctuation, trailingMagicChars) {
3167          link = link.replace(showdown.helper.regexes.asteriskDashAndColon, showdown.helper.escapeCharactersCallback);
3168          var lnkTxt = link,
3169              append = '',
3170              target = '',
3171              lmc    = leadingMagicChars || '',
3172              tmc    = trailingMagicChars || '';
3173          if (/^www\./i.test(link)) {
3174            link = link.replace(/^www\./i, 'http://www.');
3175          }
3176          if (options.excludeTrailingPunctuationFromURLs && trailingPunctuation) {
3177            append = trailingPunctuation;
3178          }
3179          if (options.openLinksInNewWindow) {
3180            target = ' rel="noopener noreferrer" target="¨E95Eblank"';
3181          }
3182          return lmc + '<a href="' + link + '"' + target + '>' + lnkTxt + '</a>' + append + tmc;
3183        };
3184      },
3185  
3186      replaceMail = function (options, globals) {
3187        'use strict';
3188        return function (wholeMatch, b, mail) {
3189          var href = 'mailto:';
3190          b = b || '';
3191          mail = showdown.subParser('unescapeSpecialChars')(mail, options, globals);
3192          if (options.encodeEmails) {
3193            href = showdown.helper.encodeEmailAddress(href + mail);
3194            mail = showdown.helper.encodeEmailAddress(mail);
3195          } else {
3196            href = href + mail;
3197          }
3198          return b + '<a href="' + href + '">' + mail + '</a>';
3199        };
3200      };
3201  
3202  showdown.subParser('autoLinks', function (text, options, globals) {
3203    'use strict';
3204  
3205    text = globals.converter._dispatch('autoLinks.before', text, options, globals);
3206  
3207    text = text.replace(delimUrlRegex, replaceLink(options));
3208    text = text.replace(delimMailRegex, replaceMail(options, globals));
3209  
3210    text = globals.converter._dispatch('autoLinks.after', text, options, globals);
3211  
3212    return text;
3213  });
3214  
3215  showdown.subParser('simplifiedAutoLinks', function (text, options, globals) {
3216    'use strict';
3217  
3218    if (!options.simplifiedAutoLink) {
3219      return text;
3220    }
3221  
3222    text = globals.converter._dispatch('simplifiedAutoLinks.before', text, options, globals);
3223  
3224    if (options.excludeTrailingPunctuationFromURLs) {
3225      text = text.replace(simpleURLRegex2, replaceLink(options));
3226    } else {
3227      text = text.replace(simpleURLRegex, replaceLink(options));
3228    }
3229    text = text.replace(simpleMailRegex, replaceMail(options, globals));
3230  
3231    text = globals.converter._dispatch('simplifiedAutoLinks.after', text, options, globals);
3232  
3233    return text;
3234  });
3235  
3236  /**
3237   * These are all the transformations that form block-level
3238   * tags like paragraphs, headers, and list items.
3239   */
3240  showdown.subParser('blockGamut', function (text, options, globals) {
3241    'use strict';
3242  
3243    text = globals.converter._dispatch('blockGamut.before', text, options, globals);
3244  
3245    // we parse blockquotes first so that we can have headings and hrs
3246    // inside blockquotes
3247    text = showdown.subParser('blockQuotes')(text, options, globals);
3248    text = showdown.subParser('headers')(text, options, globals);
3249  
3250    // Do Horizontal Rules:
3251    text = showdown.subParser('horizontalRule')(text, options, globals);
3252  
3253    text = showdown.subParser('lists')(text, options, globals);
3254    text = showdown.subParser('codeBlocks')(text, options, globals);
3255    text = showdown.subParser('tables')(text, options, globals);
3256  
3257    // We already ran _HashHTMLBlocks() before, in Markdown(), but that
3258    // was to escape raw HTML in the original Markdown source. This time,
3259    // we're escaping the markup we've just created, so that we don't wrap
3260    // <p> tags around block-level tags.
3261    text = showdown.subParser('hashHTMLBlocks')(text, options, globals);
3262    text = showdown.subParser('paragraphs')(text, options, globals);
3263  
3264    text = globals.converter._dispatch('blockGamut.after', text, options, globals);
3265  
3266    return text;
3267  });
3268  
3269  showdown.subParser('blockQuotes', function (text, options, globals) {
3270    'use strict';
3271  
3272    text = globals.converter._dispatch('blockQuotes.before', text, options, globals);
3273  
3274    // add a couple extra lines after the text and endtext mark
3275    text = text + '\n\n';
3276  
3277    var rgx = /(^ {0,3}>[ \t]?.+\n(.+\n)*\n*)+/gm;
3278  
3279    if (options.splitAdjacentBlockquotes) {
3280      rgx = /^ {0,3}>[\s\S]*?(?:\n\n)/gm;
3281    }
3282  
3283    text = text.replace(rgx, function (bq) {
3284      // attacklab: hack around Konqueror 3.5.4 bug:
3285      // "----------bug".replace(/^-/g,"") == "bug"
3286      bq = bq.replace(/^[ \t]*>[ \t]?/gm, ''); // trim one level of quoting
3287  
3288      // attacklab: clean up hack
3289      bq = bq.replace(/¨0/g, '');
3290  
3291      bq = bq.replace(/^[ \t]+$/gm, ''); // trim whitespace-only lines
3292      bq = showdown.subParser('githubCodeBlocks')(bq, options, globals);
3293      bq = showdown.subParser('blockGamut')(bq, options, globals); // recurse
3294  
3295      bq = bq.replace(/(^|\n)/g, '$1  ');
3296      // These leading spaces screw with <pre> content, so we need to fix that:
3297      bq = bq.replace(/(\s*<pre>[^\r]+?<\/pre>)/gm, function (wholeMatch, m1) {
3298        var pre = m1;
3299        // attacklab: hack around Konqueror 3.5.4 bug:
3300        pre = pre.replace(/^  /mg, '¨0');
3301        pre = pre.replace(/¨0/g, '');
3302        return pre;
3303      });
3304  
3305      return showdown.subParser('hashBlock')('<blockquote>\n' + bq + '\n</blockquote>', options, globals);
3306    });
3307  
3308    text = globals.converter._dispatch('blockQuotes.after', text, options, globals);
3309    return text;
3310  });
3311  
3312  /**
3313   * Process Markdown `<pre><code>` blocks.
3314   */
3315  showdown.subParser('codeBlocks', function (text, options, globals) {
3316    'use strict';
3317  
3318    text = globals.converter._dispatch('codeBlocks.before', text, options, globals);
3319  
3320    // sentinel workarounds for lack of \A and \Z, safari\khtml bug
3321    text += '¨0';
3322  
3323    var pattern = /(?:\n\n|^)((?:(?:[ ]{4}|\t).*\n+)+)(\n*[ ]{0,3}[^ \t\n]|(?=¨0))/g;
3324    text = text.replace(pattern, function (wholeMatch, m1, m2) {
3325      var codeblock = m1,
3326          nextChar = m2,
3327          end = '\n';
3328  
3329      codeblock = showdown.subParser('outdent')(codeblock, options, globals);
3330      codeblock = showdown.subParser('encodeCode')(codeblock, options, globals);
3331      codeblock = showdown.subParser('detab')(codeblock, options, globals);
3332      codeblock = codeblock.replace(/^\n+/g, ''); // trim leading newlines
3333      codeblock = codeblock.replace(/\n+$/g, ''); // trim trailing newlines
3334  
3335      if (options.omitExtraWLInCodeBlocks) {
3336        end = '';
3337      }
3338  
3339      codeblock = '<pre><code>' + codeblock + end + '</code></pre>';
3340  
3341      return showdown.subParser('hashBlock')(codeblock, options, globals) + nextChar;
3342    });
3343  
3344    // strip sentinel
3345    text = text.replace(/¨0/, '');
3346  
3347    text = globals.converter._dispatch('codeBlocks.after', text, options, globals);
3348    return text;
3349  });
3350  
3351  /**
3352   *
3353   *   *  Backtick quotes are used for <code></code> spans.
3354   *
3355   *   *  You can use multiple backticks as the delimiters if you want to
3356   *     include literal backticks in the code span. So, this input:
3357   *
3358   *         Just type ``foo `bar` baz`` at the prompt.
3359   *
3360   *       Will translate to:
3361   *
3362   *         <p>Just type <code>foo `bar` baz</code> at the prompt.</p>
3363   *
3364   *    There's no arbitrary limit to the number of backticks you
3365   *    can use as delimters. If you need three consecutive backticks
3366   *    in your code, use four for delimiters, etc.
3367   *
3368   *  *  You can use spaces to get literal backticks at the edges:
3369   *
3370   *         ... type `` `bar` `` ...
3371   *
3372   *       Turns to:
3373   *
3374   *         ... type <code>`bar`</code> ...
3375   */
3376  showdown.subParser('codeSpans', function (text, options, globals) {
3377    'use strict';
3378  
3379    text = globals.converter._dispatch('codeSpans.before', text, options, globals);
3380  
3381    if (typeof text === 'undefined') {
3382      text = '';
3383    }
3384    text = text.replace(/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm,
3385      function (wholeMatch, m1, m2, m3) {
3386        var c = m3;
3387        c = c.replace(/^([ \t]*)/g, '');    // leading whitespace
3388        c = c.replace(/[ \t]*$/g, '');    // trailing whitespace
3389        c = showdown.subParser('encodeCode')(c, options, globals);
3390        c = m1 + '<code>' + c + '</code>';
3391        c = showdown.subParser('hashHTMLSpans')(c, options, globals);
3392        return c;
3393      }
3394    );
3395  
3396    text = globals.converter._dispatch('codeSpans.after', text, options, globals);
3397    return text;
3398  });
3399  
3400  /**
3401   * Create a full HTML document from the processed markdown
3402   */
3403  showdown.subParser('completeHTMLDocument', function (text, options, globals) {
3404    'use strict';
3405  
3406    if (!options.completeHTMLDocument) {
3407      return text;
3408    }
3409  
3410    text = globals.converter._dispatch('completeHTMLDocument.before', text, options, globals);
3411  
3412    var doctype = 'html',
3413        doctypeParsed = '<!DOCTYPE HTML>\n',
3414        title = '',
3415        charset = '<meta charset="utf-8">\n',
3416        lang = '',
3417        metadata = '';
3418  
3419    if (typeof globals.metadata.parsed.doctype !== 'undefined') {
3420      doctypeParsed = '<!DOCTYPE ' +  globals.metadata.parsed.doctype + '>\n';
3421      doctype = globals.metadata.parsed.doctype.toString().toLowerCase();
3422      if (doctype === 'html' || doctype === 'html5') {
3423        charset = '<meta charset="utf-8">';
3424      }
3425    }
3426  
3427    for (var meta in globals.metadata.parsed) {
3428      if (globals.metadata.parsed.hasOwnProperty(meta)) {
3429        switch (meta.toLowerCase()) {
3430          case 'doctype':
3431            break;
3432  
3433          case 'title':
3434            title = '<title>' +  globals.metadata.parsed.title + '</title>\n';
3435            break;
3436  
3437          case 'charset':
3438            if (doctype === 'html' || doctype === 'html5') {
3439              charset = '<meta charset="' + globals.metadata.parsed.charset + '">\n';
3440            } else {
3441              charset = '<meta name="charset" content="' + globals.metadata.parsed.charset + '">\n';
3442            }
3443            break;
3444  
3445          case 'language':
3446          case 'lang':
3447            lang = ' lang="' + globals.metadata.parsed[meta] + '"';
3448            metadata += '<meta name="' + meta + '" content="' + globals.metadata.parsed[meta] + '">\n';
3449            break;
3450  
3451          default:
3452            metadata += '<meta name="' + meta + '" content="' + globals.metadata.parsed[meta] + '">\n';
3453        }
3454      }
3455    }
3456  
3457    text = doctypeParsed + '<html' + lang + '>\n<head>\n' + title + charset + metadata + '</head>\n<body>\n' + text.trim() + '\n</body>\n</html>';
3458  
3459    text = globals.converter._dispatch('completeHTMLDocument.after', text, options, globals);
3460    return text;
3461  });
3462  
3463  /**
3464   * Convert all tabs to spaces
3465   */
3466  showdown.subParser('detab', function (text, options, globals) {
3467    'use strict';
3468    text = globals.converter._dispatch('detab.before', text, options, globals);
3469  
3470    // expand first n-1 tabs
3471    text = text.replace(/\t(?=\t)/g, '    '); // g_tab_width
3472  
3473    // replace the nth with two sentinels
3474    text = text.replace(/\t/g, '¨A¨B');
3475  
3476    // use the sentinel to anchor our regex so it doesn't explode
3477    text = text.replace(/¨B(.+?)¨A/g, function (wholeMatch, m1) {
3478      var leadingText = m1,
3479          numSpaces = 4 - leadingText.length % 4;  // g_tab_width
3480  
3481      // there *must* be a better way to do this:
3482      for (var i = 0; i < numSpaces; i++) {
3483        leadingText += ' ';
3484      }
3485  
3486      return leadingText;
3487    });
3488  
3489    // clean up sentinels
3490    text = text.replace(/¨A/g, '    ');  // g_tab_width
3491    text = text.replace(/¨B/g, '');
3492  
3493    text = globals.converter._dispatch('detab.after', text, options, globals);
3494    return text;
3495  });
3496  
3497  showdown.subParser('ellipsis', function (text, options, globals) {
3498    'use strict';
3499  
3500    text = globals.converter._dispatch('ellipsis.before', text, options, globals);
3501  
3502    text = text.replace(/\.\.\./g, '…');
3503  
3504    text = globals.converter._dispatch('ellipsis.after', text, options, globals);
3505  
3506    return text;
3507  });
3508  
3509  /**
3510   * Turn emoji codes into emojis
3511   *
3512   * List of supported emojis: https://github.com/showdownjs/showdown/wiki/Emojis
3513   */
3514  showdown.subParser('emoji', function (text, options, globals) {
3515    'use strict';
3516  
3517    if (!options.emoji) {
3518      return text;
3519    }
3520  
3521    text = globals.converter._dispatch('emoji.before', text, options, globals);
3522  
3523    var emojiRgx = /:([\S]+?):/g;
3524  
3525    text = text.replace(emojiRgx, function (wm, emojiCode) {
3526      if (showdown.helper.emojis.hasOwnProperty(emojiCode)) {
3527        return showdown.helper.emojis[emojiCode];
3528      }
3529      return wm;
3530    });
3531  
3532    text = globals.converter._dispatch('emoji.after', text, options, globals);
3533  
3534    return text;
3535  });
3536  
3537  /**
3538   * Smart processing for ampersands and angle brackets that need to be encoded.
3539   */
3540  showdown.subParser('encodeAmpsAndAngles', function (text, options, globals) {
3541    'use strict';
3542    text = globals.converter._dispatch('encodeAmpsAndAngles.before', text, options, globals);
3543  
3544    // Ampersand-encoding based entirely on Nat Irons's Amputator MT plugin:
3545    // http://bumppo.net/projects/amputator/
3546    text = text.replace(/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)/g, '&amp;');
3547  
3548    // Encode naked <'s
3549    text = text.replace(/<(?![a-z\/?$!])/gi, '&lt;');
3550  
3551    // Encode <
3552    text = text.replace(/</g, '&lt;');
3553  
3554    // Encode >
3555    text = text.replace(/>/g, '&gt;');
3556  
3557    text = globals.converter._dispatch('encodeAmpsAndAngles.after', text, options, globals);
3558    return text;
3559  });
3560  
3561  /**
3562   * Returns the string, with after processing the following backslash escape sequences.
3563   *
3564   * attacklab: The polite way to do this is with the new escapeCharacters() function:
3565   *
3566   *    text = escapeCharacters(text,"\\",true);
3567   *    text = escapeCharacters(text,"`*_{}[]()>#+-.!",true);
3568   *
3569   * ...but we're sidestepping its use of the (slow) RegExp constructor
3570   * as an optimization for Firefox.  This function gets called a LOT.
3571   */
3572  showdown.subParser('encodeBackslashEscapes', function (text, options, globals) {
3573    'use strict';
3574    text = globals.converter._dispatch('encodeBackslashEscapes.before', text, options, globals);
3575  
3576    text = text.replace(/\\(\\)/g, showdown.helper.escapeCharactersCallback);
3577    text = text.replace(/\\([`*_{}\[\]()>#+.!~=|-])/g, showdown.helper.escapeCharactersCallback);
3578  
3579    text = globals.converter._dispatch('encodeBackslashEscapes.after', text, options, globals);
3580    return text;
3581  });
3582  
3583  /**
3584   * Encode/escape certain characters inside Markdown code runs.
3585   * The point is that in code, these characters are literals,
3586   * and lose their special Markdown meanings.
3587   */
3588  showdown.subParser('encodeCode', function (text, options, globals) {
3589    'use strict';
3590  
3591    text = globals.converter._dispatch('encodeCode.before', text, options, globals);
3592  
3593    // Encode all ampersands; HTML entities are not
3594    // entities within a Markdown code span.
3595    text = text
3596      .replace(/&/g, '&amp;')
3597    // Do the angle bracket song and dance:
3598      .replace(/</g, '&lt;')
3599      .replace(/>/g, '&gt;')
3600    // Now, escape characters that are magic in Markdown:
3601      .replace(/([*_{}\[\]\\=~-])/g, showdown.helper.escapeCharactersCallback);
3602  
3603    text = globals.converter._dispatch('encodeCode.after', text, options, globals);
3604    return text;
3605  });
3606  
3607  /**
3608   * Within tags -- meaning between < and > -- encode [\ ` * _ ~ =] so they
3609   * don't conflict with their use in Markdown for code, italics and strong.
3610   */
3611  showdown.subParser('escapeSpecialCharsWithinTagAttributes', function (text, options, globals) {
3612    'use strict';
3613    text = globals.converter._dispatch('escapeSpecialCharsWithinTagAttributes.before', text, options, globals);
3614  
3615    // Build a regex to find HTML tags.
3616    var tags     = /<\/?[a-z\d_:-]+(?:[\s]+[\s\S]+?)?>/gi,
3617        comments = /<!(--(?:(?:[^>-]|-[^>])(?:[^-]|-[^-])*)--)>/gi;
3618  
3619    text = text.replace(tags, function (wholeMatch) {
3620      return wholeMatch
3621        .replace(/(.)<\/?code>(?=.)/g, '$1`')
3622        .replace(/([\\`*_~=|])/g, showdown.helper.escapeCharactersCallback);
3623    });
3624  
3625    text = text.replace(comments, function (wholeMatch) {
3626      return wholeMatch
3627        .replace(/([\\`*_~=|])/g, showdown.helper.escapeCharactersCallback);
3628    });
3629  
3630    text = globals.converter._dispatch('escapeSpecialCharsWithinTagAttributes.after', text, options, globals);
3631    return text;
3632  });
3633  
3634  /**
3635   * Handle github codeblocks prior to running HashHTML so that
3636   * HTML contained within the codeblock gets escaped properly
3637   * Example:
3638   * ```ruby
3639   *     def hello_world(x)
3640   *       puts "Hello, #{x}"
3641   *     end
3642   * ```
3643   */
3644  showdown.subParser('githubCodeBlocks', function (text, options, globals) {
3645    'use strict';
3646  
3647    // early exit if option is not enabled
3648    if (!options.ghCodeBlocks) {
3649      return text;
3650    }
3651  
3652    text = globals.converter._dispatch('githubCodeBlocks.before', text, options, globals);
3653  
3654    text += '¨0';
3655  
3656    text = text.replace(/(?:^|\n)(?: {0,3})(```+|~~~+)(?: *)([^\s`~]*)\n([\s\S]*?)\n(?: {0,3})\1/g, function (wholeMatch, delim, language, codeblock) {
3657      var end = (options.omitExtraWLInCodeBlocks) ? '' : '\n';
3658  
3659      // First parse the github code block
3660      codeblock = showdown.subParser('encodeCode')(codeblock, options, globals);
3661      codeblock = showdown.subParser('detab')(codeblock, options, globals);
3662      codeblock = codeblock.replace(/^\n+/g, ''); // trim leading newlines
3663      codeblock = codeblock.replace(/\n+$/g, ''); // trim trailing whitespace
3664  
3665      codeblock = '<pre><code' + (language ? ' class="' + language + ' language-' + language + '"' : '') + '>' + codeblock + end + '</code></pre>';
3666  
3667      codeblock = showdown.subParser('hashBlock')(codeblock, options, globals);
3668  
3669      // Since GHCodeblocks can be false positives, we need to
3670      // store the primitive text and the parsed text in a global var,
3671      // and then return a token
3672      return '\n\n¨G' + (globals.ghCodeBlocks.push({text: wholeMatch, codeblock: codeblock}) - 1) + 'G\n\n';
3673    });
3674  
3675    // attacklab: strip sentinel
3676    text = text.replace(/¨0/, '');
3677  
3678    return globals.converter._dispatch('githubCodeBlocks.after', text, options, globals);
3679  });
3680  
3681  showdown.subParser('hashBlock', function (text, options, globals) {
3682    'use strict';
3683    text = globals.converter._dispatch('hashBlock.before', text, options, globals);
3684    text = text.replace(/(^\n+|\n+$)/g, '');
3685    text = '\n\n¨K' + (globals.gHtmlBlocks.push(text) - 1) + 'K\n\n';
3686    text = globals.converter._dispatch('hashBlock.after', text, options, globals);
3687    return text;
3688  });
3689  
3690  /**
3691   * Hash and escape <code> elements that should not be parsed as markdown
3692   */
3693  showdown.subParser('hashCodeTags', function (text, options, globals) {
3694    'use strict';
3695    text = globals.converter._dispatch('hashCodeTags.before', text, options, globals);
3696  
3697    var repFunc = function (wholeMatch, match, left, right) {
3698      var codeblock = left + showdown.subParser('encodeCode')(match, options, globals) + right;
3699      return '¨C' + (globals.gHtmlSpans.push(codeblock) - 1) + 'C';
3700    };
3701  
3702    // Hash naked <code>
3703    text = showdown.helper.replaceRecursiveRegExp(text, repFunc, '<code\\b[^>]*>', '</code>', 'gim');
3704  
3705    text = globals.converter._dispatch('hashCodeTags.after', text, options, globals);
3706    return text;
3707  });
3708  
3709  showdown.subParser('hashElement', function (text, options, globals) {
3710    'use strict';
3711  
3712    return function (wholeMatch, m1) {
3713      var blockText = m1;
3714  
3715      // Undo double lines
3716      blockText = blockText.replace(/\n\n/g, '\n');
3717      blockText = blockText.replace(/^\n/, '');
3718  
3719      // strip trailing blank lines
3720      blockText = blockText.replace(/\n+$/g, '');
3721  
3722      // Replace the element text with a marker ("¨KxK" where x is its key)
3723      blockText = '\n\n¨K' + (globals.gHtmlBlocks.push(blockText) - 1) + 'K\n\n';
3724  
3725      return blockText;
3726    };
3727  });
3728  
3729  showdown.subParser('hashHTMLBlocks', function (text, options, globals) {
3730    'use strict';
3731    text = globals.converter._dispatch('hashHTMLBlocks.before', text, options, globals);
3732  
3733    var blockTags = [
3734          'pre',
3735          'div',
3736          'h1',
3737          'h2',
3738          'h3',
3739          'h4',
3740          'h5',
3741          'h6',
3742          'blockquote',
3743          'table',
3744          'dl',
3745          'ol',
3746          'ul',
3747          'script',
3748          'noscript',
3749          'form',
3750          'fieldset',
3751          'iframe',
3752          'math',
3753          'style',
3754          'section',
3755          'header',
3756          'footer',
3757          'nav',
3758          'article',
3759          'aside',
3760          'address',
3761          'audio',
3762          'canvas',
3763          'figure',
3764          'hgroup',
3765          'output',
3766          'video',
3767          'p'
3768        ],
3769        repFunc = function (wholeMatch, match, left, right) {
3770          var txt = wholeMatch;
3771          // check if this html element is marked as markdown
3772          // if so, it's contents should be parsed as markdown
3773          if (left.search(/\bmarkdown\b/) !== -1) {
3774            txt = left + globals.converter.makeHtml(match) + right;
3775          }
3776          return '\n\n¨K' + (globals.gHtmlBlocks.push(txt) - 1) + 'K\n\n';
3777        };
3778  
3779    if (options.backslashEscapesHTMLTags) {
3780      // encode backslash escaped HTML tags
3781      text = text.replace(/\\<(\/?[^>]+?)>/g, function (wm, inside) {
3782        return '&lt;' + inside + '&gt;';
3783      });
3784    }
3785  
3786    // hash HTML Blocks
3787    for (var i = 0; i < blockTags.length; ++i) {
3788  
3789      var opTagPos,
3790          rgx1     = new RegExp('^ {0,3}(<' + blockTags[i] + '\\b[^>]*>)', 'im'),
3791          patLeft  = '<' + blockTags[i] + '\\b[^>]*>',
3792          patRight = '</' + blockTags[i] + '>';
3793      // 1. Look for the first position of the first opening HTML tag in the text
3794      while ((opTagPos = showdown.helper.regexIndexOf(text, rgx1)) !== -1) {
3795  
3796        // if the HTML tag is \ escaped, we need to escape it and break
3797  
3798  
3799        //2. Split the text in that position
3800        var subTexts = showdown.helper.splitAtIndex(text, opTagPos),
3801            //3. Match recursively
3802            newSubText1 = showdown.helper.replaceRecursiveRegExp(subTexts[1], repFunc, patLeft, patRight, 'im');
3803  
3804        // prevent an infinite loop
3805        if (newSubText1 === subTexts[1]) {
3806          break;
3807        }
3808        text = subTexts[0].concat(newSubText1);
3809      }
3810    }
3811    // HR SPECIAL CASE
3812    text = text.replace(/(\n {0,3}(<(hr)\b([^<>])*?\/?>)[ \t]*(?=\n{2,}))/g,
3813      showdown.subParser('hashElement')(text, options, globals));
3814  
3815    // Special case for standalone HTML comments
3816    text = showdown.helper.replaceRecursiveRegExp(text, function (txt) {
3817      return '\n\n¨K' + (globals.gHtmlBlocks.push(txt) - 1) + 'K\n\n';
3818    }, '^ {0,3}<!--', '-->', 'gm');
3819  
3820    // PHP and ASP-style processor instructions (<?...?> and <%...%>)
3821    text = text.replace(/(?:\n\n)( {0,3}(?:<([?%])[^\r]*?\2>)[ \t]*(?=\n{2,}))/g,
3822      showdown.subParser('hashElement')(text, options, globals));
3823  
3824    text = globals.converter._dispatch('hashHTMLBlocks.after', text, options, globals);
3825    return text;
3826  });
3827  
3828  /**
3829   * Hash span elements that should not be parsed as markdown
3830   */
3831  showdown.subParser('hashHTMLSpans', function (text, options, globals) {
3832    'use strict';
3833    text = globals.converter._dispatch('hashHTMLSpans.before', text, options, globals);
3834  
3835    function hashHTMLSpan (html) {
3836      return '¨C' + (globals.gHtmlSpans.push(html) - 1) + 'C';
3837    }
3838  
3839    // Hash Self Closing tags
3840    text = text.replace(/<[^>]+?\/>/gi, function (wm) {
3841      return hashHTMLSpan(wm);
3842    });
3843  
3844    // Hash tags without properties
3845    text = text.replace(/<([^>]+?)>[\s\S]*?<\/\1>/g, function (wm) {
3846      return hashHTMLSpan(wm);
3847    });
3848  
3849    // Hash tags with properties
3850    text = text.replace(/<([^>]+?)\s[^>]+?>[\s\S]*?<\/\1>/g, function (wm) {
3851      return hashHTMLSpan(wm);
3852    });
3853  
3854    // Hash self closing tags without />
3855    text = text.replace(/<[^>]+?>/gi, function (wm) {
3856      return hashHTMLSpan(wm);
3857    });
3858  
3859    /*showdown.helper.matchRecursiveRegExp(text, '<code\\b[^>]*>', '</code>', 'gi');*/
3860  
3861    text = globals.converter._dispatch('hashHTMLSpans.after', text, options, globals);
3862    return text;
3863  });
3864  
3865  /**
3866   * Unhash HTML spans
3867   */
3868  showdown.subParser('unhashHTMLSpans', function (text, options, globals) {
3869    'use strict';
3870    text = globals.converter._dispatch('unhashHTMLSpans.before', text, options, globals);
3871  
3872    for (var i = 0; i < globals.gHtmlSpans.length; ++i) {
3873      var repText = globals.gHtmlSpans[i],
3874          // limiter to prevent infinite loop (assume 10 as limit for recurse)
3875          limit = 0;
3876  
3877      while (/¨C(\d+)C/.test(repText)) {
3878        var num = RegExp.$1;
3879        repText = repText.replace('¨C' + num + 'C', globals.gHtmlSpans[num]);
3880        if (limit === 10) {
3881          console.error('maximum nesting of 10 spans reached!!!');
3882          break;
3883        }
3884        ++limit;
3885      }
3886      text = text.replace('¨C' + i + 'C', repText);
3887    }
3888  
3889    text = globals.converter._dispatch('unhashHTMLSpans.after', text, options, globals);
3890    return text;
3891  });
3892  
3893  /**
3894   * Hash and escape <pre><code> elements that should not be parsed as markdown
3895   */
3896  showdown.subParser('hashPreCodeTags', function (text, options, globals) {
3897    'use strict';
3898    text = globals.converter._dispatch('hashPreCodeTags.before', text, options, globals);
3899  
3900    var repFunc = function (wholeMatch, match, left, right) {
3901      // encode html entities
3902      var codeblock = left + showdown.subParser('encodeCode')(match, options, globals) + right;
3903      return '\n\n¨G' + (globals.ghCodeBlocks.push({text: wholeMatch, codeblock: codeblock}) - 1) + 'G\n\n';
3904    };
3905  
3906    // Hash <pre><code>
3907    text = showdown.helper.replaceRecursiveRegExp(text, repFunc, '^ {0,3}<pre\\b[^>]*>\\s*<code\\b[^>]*>', '^ {0,3}</code>\\s*</pre>', 'gim');
3908  
3909    text = globals.converter._dispatch('hashPreCodeTags.after', text, options, globals);
3910    return text;
3911  });
3912  
3913  showdown.subParser('headers', function (text, options, globals) {
3914    'use strict';
3915  
3916    text = globals.converter._dispatch('headers.before', text, options, globals);
3917  
3918    var headerLevelStart = (isNaN(parseInt(options.headerLevelStart))) ? 1 : parseInt(options.headerLevelStart),
3919  
3920        // Set text-style headers:
3921        //    Header 1
3922        //    ========
3923        //
3924        //    Header 2
3925        //    --------
3926        //
3927        setextRegexH1 = (options.smoothLivePreview) ? /^(.+)[ \t]*\n={2,}[ \t]*\n+/gm : /^(.+)[ \t]*\n=+[ \t]*\n+/gm,
3928        setextRegexH2 = (options.smoothLivePreview) ? /^(.+)[ \t]*\n-{2,}[ \t]*\n+/gm : /^(.+)[ \t]*\n-+[ \t]*\n+/gm;
3929  
3930    text = text.replace(setextRegexH1, function (wholeMatch, m1) {
3931  
3932      var spanGamut = showdown.subParser('spanGamut')(m1, options, globals),
3933          hID = (options.noHeaderId) ? '' : ' id="' + headerId(m1) + '"',
3934          hLevel = headerLevelStart,
3935          hashBlock = '<h' + hLevel + hID + '>' + spanGamut + '</h' + hLevel + '>';
3936      return showdown.subParser('hashBlock')(hashBlock, options, globals);
3937    });
3938  
3939    text = text.replace(setextRegexH2, function (matchFound, m1) {
3940      var spanGamut = showdown.subParser('spanGamut')(m1, options, globals),
3941          hID = (options.noHeaderId) ? '' : ' id="' + headerId(m1) + '"',
3942          hLevel = headerLevelStart + 1,
3943          hashBlock = '<h' + hLevel + hID + '>' + spanGamut + '</h' + hLevel + '>';
3944      return showdown.subParser('hashBlock')(hashBlock, options, globals);
3945    });
3946  
3947    // atx-style headers:
3948    //  # Header 1
3949    //  ## Header 2
3950    //  ## Header 2 with closing hashes ##
3951    //  ...
3952    //  ###### Header 6
3953    //
3954    var atxStyle = (options.requireSpaceBeforeHeadingText) ? /^(#{1,6})[ \t]+(.+?)[ \t]*#*\n+/gm : /^(#{1,6})[ \t]*(.+?)[ \t]*#*\n+/gm;
3955  
3956    text = text.replace(atxStyle, function (wholeMatch, m1, m2) {
3957      var hText = m2;
3958      if (options.customizedHeaderId) {
3959        hText = m2.replace(/\s?\{([^{]+?)}\s*$/, '');
3960      }
3961  
3962      var span = showdown.subParser('spanGamut')(hText, options, globals),
3963          hID = (options.noHeaderId) ? '' : ' id="' + headerId(m2) + '"',
3964          hLevel = headerLevelStart - 1 + m1.length,
3965          header = '<h' + hLevel + hID + '>' + span + '</h' + hLevel + '>';
3966  
3967      return showdown.subParser('hashBlock')(header, options, globals);
3968    });
3969  
3970    function headerId (m) {
3971      var title,
3972          prefix;
3973  
3974      // It is separate from other options to allow combining prefix and customized
3975      if (options.customizedHeaderId) {
3976        var match = m.match(/\{([^{]+?)}\s*$/);
3977        if (match && match[1]) {
3978          m = match[1];
3979        }
3980      }
3981  
3982      title = m;
3983  
3984      // Prefix id to prevent causing inadvertent pre-existing style matches.
3985      if (showdown.helper.isString(options.prefixHeaderId)) {
3986        prefix = options.prefixHeaderId;
3987      } else if (options.prefixHeaderId === true) {
3988        prefix = 'section-';
3989      } else {
3990        prefix = '';
3991      }
3992  
3993      if (!options.rawPrefixHeaderId) {
3994        title = prefix + title;
3995      }
3996  
3997      if (options.ghCompatibleHeaderId) {
3998        title = title
3999          .replace(/ /g, '-')
4000          // replace previously escaped chars (&, ¨ and $)
4001          .replace(/&amp;/g, '')
4002          .replace(/¨T/g, '')
4003          .replace(/¨D/g, '')
4004          // replace rest of the chars (&~$ are repeated as they might have been escaped)
4005          // borrowed from github's redcarpet (some they should produce similar results)
4006          .replace(/[&+$,\/:;=?@"#{}|^¨~\[\]`\\*)(%.!'<>]/g, '')
4007          .toLowerCase();
4008      } else if (options.rawHeaderId) {
4009        title = title
4010          .replace(/ /g, '-')
4011          // replace previously escaped chars (&, ¨ and $)
4012          .replace(/&amp;/g, '&')
4013          .replace(/¨T/g, '¨')
4014          .replace(/¨D/g, '$')
4015          // replace " and '
4016          .replace(/["']/g, '-')
4017          .toLowerCase();
4018      } else {
4019        title = title
4020          .replace(/[^\w]/g, '')
4021          .toLowerCase();
4022      }
4023  
4024      if (options.rawPrefixHeaderId) {
4025        title = prefix + title;
4026      }
4027  
4028      if (globals.hashLinkCounts[title]) {
4029        title = title + '-' + (globals.hashLinkCounts[title]++);
4030      } else {
4031        globals.hashLinkCounts[title] = 1;
4032      }
4033      return title;
4034    }
4035  
4036    text = globals.converter._dispatch('headers.after', text, options, globals);
4037    return text;
4038  });
4039  
4040  /**
4041   * Turn Markdown link shortcuts into XHTML <a> tags.
4042   */
4043  showdown.subParser('horizontalRule', function (text, options, globals) {
4044    'use strict';
4045    text = globals.converter._dispatch('horizontalRule.before', text, options, globals);
4046  
4047    var key = showdown.subParser('hashBlock')('<hr />', options, globals);
4048    text = text.replace(/^ {0,2}( ?-){3,}[ \t]*$/gm, key);
4049    text = text.replace(/^ {0,2}( ?\*){3,}[ \t]*$/gm, key);
4050    text = text.replace(/^ {0,2}( ?_){3,}[ \t]*$/gm, key);
4051  
4052    text = globals.converter._dispatch('horizontalRule.after', text, options, globals);
4053    return text;
4054  });
4055  
4056  /**
4057   * Turn Markdown image shortcuts into <img> tags.
4058   */
4059  showdown.subParser('images', function (text, options, globals) {
4060    'use strict';
4061  
4062    text = globals.converter._dispatch('images.before', text, options, globals);
4063  
4064    var inlineRegExp      = /!\[([^\]]*?)][ \t]*()\([ \t]?<?([\S]+?(?:\([\S]*?\)[\S]*?)?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g,
4065        crazyRegExp       = /!\[([^\]]*?)][ \t]*()\([ \t]?<([^>]*)>(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(?:(["'])([^"]*?)\6))?[ \t]?\)/g,
4066        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,
4067        referenceRegExp   = /!\[([^\]]*?)] ?(?:\n *)?\[([\s\S]*?)]()()()()()/g,
4068        refShortcutRegExp = /!\[([^\[\]]+)]()()()()()/g;
4069  
4070    function writeImageTagBase64 (wholeMatch, altText, linkId, url, width, height, m5, title) {
4071      url = url.replace(/\s/g, '');
4072      return writeImageTag (wholeMatch, altText, linkId, url, width, height, m5, title);
4073    }
4074  
4075    function writeImageTag (wholeMatch, altText, linkId, url, width, height, m5, title) {
4076  
4077      var gUrls   = globals.gUrls,
4078          gTitles = globals.gTitles,
4079          gDims   = globals.gDimensions;
4080  
4081      linkId = linkId.toLowerCase();
4082  
4083      if (!title) {
4084        title = '';
4085      }
4086      // Special case for explicit empty url
4087      if (wholeMatch.search(/\(<?\s*>? ?(['"].*['"])?\)$/m) > -1) {
4088        url = '';
4089  
4090      } else if (url === '' || url === null) {
4091        if (linkId === '' || linkId === null) {
4092          // lower-case and turn embedded newlines into spaces
4093          linkId = altText.toLowerCase().replace(/ ?\n/g, ' ');
4094        }
4095        url = '#' + linkId;
4096  
4097        if (!showdown.helper.isUndefined(gUrls[linkId])) {
4098          url = gUrls[linkId];
4099          if (!showdown.helper.isUndefined(gTitles[linkId])) {
4100            title = gTitles[linkId];
4101          }
4102          if (!showdown.helper.isUndefined(gDims[linkId])) {
4103            width = gDims[linkId].width;
4104            height = gDims[linkId].height;
4105          }
4106        } else {
4107          return wholeMatch;
4108        }
4109      }
4110  
4111      altText = altText
4112        .replace(/"/g, '&quot;')
4113      //altText = showdown.helper.escapeCharacters(altText, '*_', false);
4114        .replace(showdown.helper.regexes.asteriskDashAndColon, showdown.helper.escapeCharactersCallback);
4115      //url = showdown.helper.escapeCharacters(url, '*_', false);
4116      url = url.replace(showdown.helper.regexes.asteriskDashAndColon, showdown.helper.escapeCharactersCallback);
4117      var result = '<img src="' + url + '" alt="' + altText + '"';
4118  
4119      if (title && showdown.helper.isString(title)) {
4120        title = title
4121          .replace(/"/g, '&quot;')
4122        //title = showdown.helper.escapeCharacters(title, '*_', false);
4123          .replace(showdown.helper.regexes.asteriskDashAndColon, showdown.helper.escapeCharactersCallback);
4124        result += ' title="' + title + '"';
4125      }
4126  
4127      if (width && height) {
4128        width  = (width === '*') ? 'auto' : width;
4129        height = (height === '*') ? 'auto' : height;
4130  
4131        result += ' width="' + width + '"';
4132        result += ' height="' + height + '"';
4133      }
4134  
4135      result += ' />';
4136  
4137      return result;
4138    }
4139  
4140    // First, handle reference-style labeled images: ![alt text][id]
4141    text = text.replace(referenceRegExp, writeImageTag);
4142  
4143    // Next, handle inline images:  ![alt text](url =<width>x<height> "optional title")
4144  
4145    // base64 encoded images
4146    text = text.replace(base64RegExp, writeImageTagBase64);
4147  
4148    // cases with crazy urls like ./image/cat1).png
4149    text = text.replace(crazyRegExp, writeImageTag);
4150  
4151    // normal cases
4152    text = text.replace(inlineRegExp, writeImageTag);
4153  
4154    // handle reference-style shortcuts: ![img text]
4155    text = text.replace(refShortcutRegExp, writeImageTag);
4156  
4157    text = globals.converter._dispatch('images.after', text, options, globals);
4158    return text;
4159  });
4160  
4161  showdown.subParser('italicsAndBold', function (text, options, globals) {
4162    'use strict';
4163  
4164    text = globals.converter._dispatch('italicsAndBold.before', text, options, globals);
4165  
4166    // it's faster to have 3 separate regexes for each case than have just one
4167    // because of backtracing, in some cases, it could lead to an exponential effect
4168    // called "catastrophic backtrace". Ominous!
4169  
4170    function parseInside (txt, left, right) {
4171      /*
4172      if (options.simplifiedAutoLink) {
4173        txt = showdown.subParser('simplifiedAutoLinks')(txt, options, globals);
4174      }
4175      */
4176      return left + txt + right;
4177    }
4178  
4179    // Parse underscores
4180    if (options.literalMidWordUnderscores) {
4181      text = text.replace(/\b___(\S[\s\S]*?)___\b/g, function (wm, txt) {
4182        return parseInside (txt, '<strong><em>', '</em></strong>');
4183      });
4184      text = text.replace(/\b__(\S[\s\S]*?)__\b/g, function (wm, txt) {
4185        return parseInside (txt, '<strong>', '</strong>');
4186      });
4187      text = text.replace(/\b_(\S[\s\S]*?)_\b/g, function (wm, txt) {
4188        return parseInside (txt, '<em>', '</em>');
4189      });
4190    } else {
4191      text = text.replace(/___(\S[\s\S]*?)___/g, function (wm, m) {
4192        return (/\S$/.test(m)) ? parseInside (m, '<strong><em>', '</em></strong>') : wm;
4193      });
4194      text = text.replace(/__(\S[\s\S]*?)__/g, function (wm, m) {
4195        return (/\S$/.test(m)) ? parseInside (m, '<strong>', '</strong>') : wm;
4196      });
4197      text = text.replace(/_([^\s_][\s\S]*?)_/g, function (wm, m) {
4198        // !/^_[^_]/.test(m) - test if it doesn't start with __ (since it seems redundant, we removed it)
4199        return (/\S$/.test(m)) ? parseInside (m, '<em>', '</em>') : wm;
4200      });
4201    }
4202  
4203    // Now parse asterisks
4204    if (options.literalMidWordAsterisks) {
4205      text = text.replace(/([^*]|^)\B\*\*\*(\S[\s\S]*?)\*\*\*\B(?!\*)/g, function (wm, lead, txt) {
4206        return parseInside (txt, lead + '<strong><em>', '</em></strong>');
4207      });
4208      text = text.replace(/([^*]|^)\B\*\*(\S[\s\S]*?)\*\*\B(?!\*)/g, function (wm, lead, txt) {
4209        return parseInside (txt, lead + '<strong>', '</strong>');
4210      });
4211      text = text.replace(/([^*]|^)\B\*(\S[\s\S]*?)\*\B(?!\*)/g, function (wm, lead, txt) {
4212        return parseInside (txt, lead + '<em>', '</em>');
4213      });
4214    } else {
4215      text = text.replace(/\*\*\*(\S[\s\S]*?)\*\*\*/g, function (wm, m) {
4216        return (/\S$/.test(m)) ? parseInside (m, '<strong><em>', '</em></strong>') : wm;
4217      });
4218      text = text.replace(/\*\*(\S[\s\S]*?)\*\*/g, function (wm, m) {
4219        return (/\S$/.test(m)) ? parseInside (m, '<strong>', '</strong>') : wm;
4220      });
4221      text = text.replace(/\*([^\s*][\s\S]*?)\*/g, function (wm, m) {
4222        // !/^\*[^*]/.test(m) - test if it doesn't start with ** (since it seems redundant, we removed it)
4223        return (/\S$/.test(m)) ? parseInside (m, '<em>', '</em>') : wm;
4224      });
4225    }
4226  
4227  
4228    text = globals.converter._dispatch('italicsAndBold.after', text, options, globals);
4229    return text;
4230  });
4231  
4232  /**
4233   * Form HTML ordered (numbered) and unordered (bulleted) lists.
4234   */
4235  showdown.subParser('lists', function (text, options, globals) {
4236    'use strict';
4237  
4238    /**
4239     * Process the contents of a single ordered or unordered list, splitting it
4240     * into individual list items.
4241     * @param {string} listStr
4242     * @param {boolean} trimTrailing
4243     * @returns {string}
4244     */
4245    function processListItems (listStr, trimTrailing) {
4246      // The $g_list_level global keeps track of when we're inside a list.
4247      // Each time we enter a list, we increment it; when we leave a list,
4248      // we decrement. If it's zero, we're not in a list anymore.
4249      //
4250      // We do this because when we're not inside a list, we want to treat
4251      // something like this:
4252      //
4253      //    I recommend upgrading to version
4254      //    8. Oops, now this line is treated
4255      //    as a sub-list.
4256      //
4257      // As a single paragraph, despite the fact that the second line starts
4258      // with a digit-period-space sequence.
4259      //
4260      // Whereas when we're inside a list (or sub-list), that line will be
4261      // treated as the start of a sub-list. What a kludge, huh? This is
4262      // an aspect of Markdown's syntax that's hard to parse perfectly
4263      // without resorting to mind-reading. Perhaps the solution is to
4264      // change the syntax rules such that sub-lists must start with a
4265      // starting cardinal number; e.g. "1." or "a.".
4266      globals.gListLevel++;
4267  
4268      // trim trailing blank lines:
4269      listStr = listStr.replace(/\n{2,}$/, '\n');
4270  
4271      // attacklab: add sentinel to emulate \z
4272      listStr += '¨0';
4273  
4274      var rgx = /(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0| {0,3}([*+-]|\d+[.])[ \t]+))/gm,
4275          isParagraphed = (/\n[ \t]*\n(?!¨0)/.test(listStr));
4276  
4277      // Since version 1.5, nesting sublists requires 4 spaces (or 1 tab) indentation,
4278      // which is a syntax breaking change
4279      // activating this option reverts to old behavior
4280      if (options.disableForced4SpacesIndentedSublists) {
4281        rgx = /(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0|\2([*+-]|\d+[.])[ \t]+))/gm;
4282      }
4283  
4284      listStr = listStr.replace(rgx, function (wholeMatch, m1, m2, m3, m4, taskbtn, checked) {
4285        checked = (checked && checked.trim() !== '');
4286  
4287        var item = showdown.subParser('outdent')(m4, options, globals),
4288            bulletStyle = '';
4289  
4290        // Support for github tasklists
4291        if (taskbtn && options.tasklists) {
4292          bulletStyle = ' class="task-list-item" style="list-style-type: none;"';
4293          item = item.replace(/^[ \t]*\[(x|X| )?]/m, function () {
4294            var otp = '<input type="checkbox" disabled style="margin: 0px 0.35em 0.25em -1.6em; vertical-align: middle;"';
4295            if (checked) {
4296              otp += ' checked';
4297            }
4298            otp += '>';
4299            return otp;
4300          });
4301        }
4302  
4303        // ISSUE #312
4304        // This input: - - - a
4305        // causes trouble to the parser, since it interprets it as:
4306        // <ul><li><li><li>a</li></li></li></ul>
4307        // instead of:
4308        // <ul><li>- - a</li></ul>
4309        // So, to prevent it, we will put a marker (¨A)in the beginning of the line
4310        // Kind of hackish/monkey patching, but seems more effective than overcomplicating the list parser
4311        item = item.replace(/^([-*+]|\d\.)[ \t]+[\S\n ]*/g, function (wm2) {
4312          return '¨A' + wm2;
4313        });
4314  
4315        // m1 - Leading line or
4316        // Has a double return (multi paragraph) or
4317        // Has sublist
4318        if (m1 || (item.search(/\n{2,}/) > -1)) {
4319          item = showdown.subParser('githubCodeBlocks')(item, options, globals);
4320          item = showdown.subParser('blockGamut')(item, options, globals);
4321        } else {
4322          // Recursion for sub-lists:
4323          item = showdown.subParser('lists')(item, options, globals);
4324          item = item.replace(/\n$/, ''); // chomp(item)
4325          item = showdown.subParser('hashHTMLBlocks')(item, options, globals);
4326  
4327          // Colapse double linebreaks
4328          item = item.replace(/\n\n+/g, '\n\n');
4329          if (isParagraphed) {
4330            item = showdown.subParser('paragraphs')(item, options, globals);
4331          } else {
4332            item = showdown.subParser('spanGamut')(item, options, globals);
4333          }
4334        }
4335  
4336        // now we need to remove the marker (¨A)
4337        item = item.replace('¨A', '');
4338        // we can finally wrap the line in list item tags
4339        item =  '<li' + bulletStyle + '>' + item + '</li>\n';
4340  
4341        return item;
4342      });
4343  
4344      // attacklab: strip sentinel
4345      listStr = listStr.replace(/¨0/g, '');
4346  
4347      globals.gListLevel--;
4348  
4349      if (trimTrailing) {
4350        listStr = listStr.replace(/\s+$/, '');
4351      }
4352  
4353      return listStr;
4354    }
4355  
4356    function styleStartNumber (list, listType) {
4357      // check if ol and starts by a number different than 1
4358      if (listType === 'ol') {
4359        var res = list.match(/^ *(\d+)\./);
4360        if (res && res[1] !== '1') {
4361          return ' start="' + res[1] + '"';
4362        }
4363      }
4364      return '';
4365    }
4366  
4367    /**
4368     * Check and parse consecutive lists (better fix for issue #142)
4369     * @param {string} list
4370     * @param {string} listType
4371     * @param {boolean} trimTrailing
4372     * @returns {string}
4373     */
4374    function parseConsecutiveLists (list, listType, trimTrailing) {
4375      // check if we caught 2 or more consecutive lists by mistake
4376      // we use the counterRgx, meaning if listType is UL we look for OL and vice versa
4377      var olRgx = (options.disableForced4SpacesIndentedSublists) ? /^ ?\d+\.[ \t]/gm : /^ {0,3}\d+\.[ \t]/gm,
4378          ulRgx = (options.disableForced4SpacesIndentedSublists) ? /^ ?[*+-][ \t]/gm : /^ {0,3}[*+-][ \t]/gm,
4379          counterRxg = (listType === 'ul') ? olRgx : ulRgx,
4380          result = '';
4381  
4382      if (list.search(counterRxg) !== -1) {
4383        (function parseCL (txt) {
4384          var pos = txt.search(counterRxg),
4385              style = styleStartNumber(list, listType);
4386          if (pos !== -1) {
4387            // slice
4388            result += '\n\n<' + listType + style + '>\n' + processListItems(txt.slice(0, pos), !!trimTrailing) + '</' + listType + '>\n';
4389  
4390            // invert counterType and listType
4391            listType = (listType === 'ul') ? 'ol' : 'ul';
4392            counterRxg = (listType === 'ul') ? olRgx : ulRgx;
4393  
4394            //recurse
4395            parseCL(txt.slice(pos));
4396          } else {
4397            result += '\n\n<' + listType + style + '>\n' + processListItems(txt, !!trimTrailing) + '</' + listType + '>\n';
4398          }
4399        })(list);
4400      } else {
4401        var style = styleStartNumber(list, listType);
4402        result = '\n\n<' + listType + style + '>\n' + processListItems(list, !!trimTrailing) + '</' + listType + '>\n';
4403      }
4404  
4405      return result;
4406    }
4407  
4408    /** Start of list parsing **/
4409    text = globals.converter._dispatch('lists.before', text, options, globals);
4410    // add sentinel to hack around khtml/safari bug:
4411    // http://bugs.webkit.org/show_bug.cgi?id=11231
4412    text += '¨0';
4413  
4414    if (globals.gListLevel) {
4415      text = text.replace(/^(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm,
4416        function (wholeMatch, list, m2) {
4417          var listType = (m2.search(/[*+-]/g) > -1) ? 'ul' : 'ol';
4418          return parseConsecutiveLists(list, listType, true);
4419        }
4420      );
4421    } else {
4422      text = text.replace(/(\n\n|^\n?)(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm,
4423        function (wholeMatch, m1, list, m3) {
4424          var listType = (m3.search(/[*+-]/g) > -1) ? 'ul' : 'ol';
4425          return parseConsecutiveLists(list, listType, false);
4426        }
4427      );
4428    }
4429  
4430    // strip sentinel
4431    text = text.replace(/¨0/, '');
4432    text = globals.converter._dispatch('lists.after', text, options, globals);
4433    return text;
4434  });
4435  
4436  /**
4437   * Parse metadata at the top of the document
4438   */
4439  showdown.subParser('metadata', function (text, options, globals) {
4440    'use strict';
4441  
4442    if (!options.metadata) {
4443      return text;
4444    }
4445  
4446    text = globals.converter._dispatch('metadata.before', text, options, globals);
4447  
4448    function parseMetadataContents (content) {
4449      // raw is raw so it's not changed in any way
4450      globals.metadata.raw = content;
4451  
4452      // escape chars forbidden in html attributes
4453      // double quotes
4454      content = content
4455        // ampersand first
4456        .replace(/&/g, '&amp;')
4457        // double quotes
4458        .replace(/"/g, '&quot;');
4459  
4460      content = content.replace(/\n {4}/g, ' ');
4461      content.replace(/^([\S ]+): +([\s\S]+?)$/gm, function (wm, key, value) {
4462        globals.metadata.parsed[key] = value;
4463        return '';
4464      });
4465    }
4466  
4467    text = text.replace(/^\s*«««+(\S*?)\n([\s\S]+?)\n»»»+\n/, function (wholematch, format, content) {
4468      parseMetadataContents(content);
4469      return '¨M';
4470    });
4471  
4472    text = text.replace(/^\s*---+(\S*?)\n([\s\S]+?)\n---+\n/, function (wholematch, format, content) {
4473      if (format) {
4474        globals.metadata.format = format;
4475      }
4476      parseMetadataContents(content);
4477      return '¨M';
4478    });
4479  
4480    text = text.replace(/¨M/g, '');
4481  
4482    text = globals.converter._dispatch('metadata.after', text, options, globals);
4483    return text;
4484  });
4485  
4486  /**
4487   * Remove one level of line-leading tabs or spaces
4488   */
4489  showdown.subParser('outdent', function (text, options, globals) {
4490    'use strict';
4491    text = globals.converter._dispatch('outdent.before', text, options, globals);
4492  
4493    // attacklab: hack around Konqueror 3.5.4 bug:
4494    // "----------bug".replace(/^-/g,"") == "bug"
4495    text = text.replace(/^(\t|[ ]{1,4})/gm, '¨0'); // attacklab: g_tab_width
4496  
4497    // attacklab: clean up hack
4498    text = text.replace(/¨0/g, '');
4499  
4500    text = globals.converter._dispatch('outdent.after', text, options, globals);
4501    return text;
4502  });
4503  
4504  /**
4505   *
4506   */
4507  showdown.subParser('paragraphs', function (text, options, globals) {
4508    'use strict';
4509  
4510    text = globals.converter._dispatch('paragraphs.before', text, options, globals);
4511    // Strip leading and trailing lines:
4512    text = text.replace(/^\n+/g, '');
4513    text = text.replace(/\n+$/g, '');
4514  
4515    var grafs = text.split(/\n{2,}/g),
4516        grafsOut = [],
4517        end = grafs.length; // Wrap <p> tags
4518  
4519    for (var i = 0; i < end; i++) {
4520      var str = grafs[i];
4521      // if this is an HTML marker, copy it
4522      if (str.search(/¨(K|G)(\d+)\1/g) >= 0) {
4523        grafsOut.push(str);
4524  
4525      // test for presence of characters to prevent empty lines being parsed
4526      // as paragraphs (resulting in undesired extra empty paragraphs)
4527      } else if (str.search(/\S/) >= 0) {
4528        str = showdown.subParser('spanGamut')(str, options, globals);
4529        str = str.replace(/^([ \t]*)/g, '<p>');
4530        str += '</p>';
4531        grafsOut.push(str);
4532      }
4533    }
4534  
4535    /** Unhashify HTML blocks */
4536    end = grafsOut.length;
4537    for (i = 0; i < end; i++) {
4538      var blockText = '',
4539          grafsOutIt = grafsOut[i],
4540          codeFlag = false;
4541      // if this is a marker for an html block...
4542      // use RegExp.test instead of string.search because of QML bug
4543      while (/¨(K|G)(\d+)\1/.test(grafsOutIt)) {
4544        var delim = RegExp.$1,
4545            num   = RegExp.$2;
4546  
4547        if (delim === 'K') {
4548          blockText = globals.gHtmlBlocks[num];
4549        } else {
4550          // we need to check if ghBlock is a false positive
4551          if (codeFlag) {
4552            // use encoded version of all text
4553            blockText = showdown.subParser('encodeCode')(globals.ghCodeBlocks[num].text, options, globals);
4554          } else {
4555            blockText = globals.ghCodeBlocks[num].codeblock;
4556          }
4557        }
4558        blockText = blockText.replace(/\$/g, '$$$$'); // Escape any dollar signs
4559  
4560        grafsOutIt = grafsOutIt.replace(/(\n\n)?¨(K|G)\d+\2(\n\n)?/, blockText);
4561        // Check if grafsOutIt is a pre->code
4562        if (/^<pre\b[^>]*>\s*<code\b[^>]*>/.test(grafsOutIt)) {
4563          codeFlag = true;
4564        }
4565      }
4566      grafsOut[i] = grafsOutIt;
4567    }
4568    text = grafsOut.join('\n');
4569    // Strip leading and trailing lines:
4570    text = text.replace(/^\n+/g, '');
4571    text = text.replace(/\n+$/g, '');
4572    return globals.converter._dispatch('paragraphs.after', text, options, globals);
4573  });
4574  
4575  /**
4576   * Run extension
4577   */
4578  showdown.subParser('runExtension', function (ext, text, options, globals) {
4579    'use strict';
4580  
4581    if (ext.filter) {
4582      text = ext.filter(text, globals.converter, options);
4583  
4584    } else if (ext.regex) {
4585      // TODO remove this when old extension loading mechanism is deprecated
4586      var re = ext.regex;
4587      if (!(re instanceof RegExp)) {
4588        re = new RegExp(re, 'g');
4589      }
4590      text = text.replace(re, ext.replace);
4591    }
4592  
4593    return text;
4594  });
4595  
4596  /**
4597   * These are all the transformations that occur *within* block-level
4598   * tags like paragraphs, headers, and list items.
4599   */
4600  showdown.subParser('spanGamut', function (text, options, globals) {
4601    'use strict';
4602  
4603    text = globals.converter._dispatch('spanGamut.before', text, options, globals);
4604    text = showdown.subParser('codeSpans')(text, options, globals);
4605    text = showdown.subParser('escapeSpecialCharsWithinTagAttributes')(text, options, globals);
4606    text = showdown.subParser('encodeBackslashEscapes')(text, options, globals);
4607  
4608    // Process anchor and image tags. Images must come first,
4609    // because ![foo][f] looks like an anchor.
4610    text = showdown.subParser('images')(text, options, globals);
4611    text = showdown.subParser('anchors')(text, options, globals);
4612  
4613    // Make links out of things like `<http://example.com/>`
4614    // Must come after anchors, because you can use < and >
4615    // delimiters in inline links like [this](<url>).
4616    text = showdown.subParser('autoLinks')(text, options, globals);
4617    text = showdown.subParser('simplifiedAutoLinks')(text, options, globals);
4618    text = showdown.subParser('emoji')(text, options, globals);
4619    text = showdown.subParser('underline')(text, options, globals);
4620    text = showdown.subParser('italicsAndBold')(text, options, globals);
4621    text = showdown.subParser('strikethrough')(text, options, globals);
4622    text = showdown.subParser('ellipsis')(text, options, globals);
4623  
4624    // we need to hash HTML tags inside spans
4625    text = showdown.subParser('hashHTMLSpans')(text, options, globals);
4626  
4627    // now we encode amps and angles
4628    text = showdown.subParser('encodeAmpsAndAngles')(text, options, globals);
4629  
4630    // Do hard breaks
4631    if (options.simpleLineBreaks) {
4632      // GFM style hard breaks
4633      // only add line breaks if the text does not contain a block (special case for lists)
4634      if (!/\n\n¨K/.test(text)) {
4635        text = text.replace(/\n+/g, '<br />\n');
4636      }
4637    } else {
4638      // Vanilla hard breaks
4639      text = text.replace(/  +\n/g, '<br />\n');
4640    }
4641  
4642    text = globals.converter._dispatch('spanGamut.after', text, options, globals);
4643    return text;
4644  });
4645  
4646  showdown.subParser('strikethrough', function (text, options, globals) {
4647    'use strict';
4648  
4649    function parseInside (txt) {
4650      if (options.simplifiedAutoLink) {
4651        txt = showdown.subParser('simplifiedAutoLinks')(txt, options, globals);
4652      }
4653      return '<del>' + txt + '</del>';
4654    }
4655  
4656    if (options.strikethrough) {
4657      text = globals.converter._dispatch('strikethrough.before', text, options, globals);
4658      text = text.replace(/(?:~){2}([\s\S]+?)(?:~){2}/g, function (wm, txt) { return parseInside(txt); });
4659      text = globals.converter._dispatch('strikethrough.after', text, options, globals);
4660    }
4661  
4662    return text;
4663  });
4664  
4665  /**
4666   * Strips link definitions from text, stores the URLs and titles in
4667   * hash references.
4668   * Link defs are in the form: ^[id]: url "optional title"
4669   */
4670  showdown.subParser('stripLinkDefinitions', function (text, options, globals) {
4671    'use strict';
4672  
4673    var regex       = /^ {0,3}\[(.+)]:[ \t]*\n?[ \t]*<?([^>\s]+)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n+|(?=¨0))/gm,
4674        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;
4675  
4676    // attacklab: sentinel workarounds for lack of \A and \Z, safari\khtml bug
4677    text += '¨0';
4678  
4679    var replaceFunc = function (wholeMatch, linkId, url, width, height, blankLines, title) {
4680      linkId = linkId.toLowerCase();
4681      if (url.match(/^data:.+?\/.+?;base64,/)) {
4682        // remove newlines
4683        globals.gUrls[linkId] = url.replace(/\s/g, '');
4684      } else {
4685        globals.gUrls[linkId] = showdown.subParser('encodeAmpsAndAngles')(url, options, globals);  // Link IDs are case-insensitive
4686      }
4687  
4688      if (blankLines) {
4689        // Oops, found blank lines, so it's not a title.
4690        // Put back the parenthetical statement we stole.
4691        return blankLines + title;
4692  
4693      } else {
4694        if (title) {
4695          globals.gTitles[linkId] = title.replace(/"|'/g, '&quot;');
4696        }
4697        if (options.parseImgDimensions && width && height) {
4698          globals.gDimensions[linkId] = {
4699            width:  width,
4700            height: height
4701          };
4702        }
4703      }
4704      // Completely remove the definition from the text
4705      return '';
4706    };
4707  
4708    // first we try to find base64 link references
4709    text = text.replace(base64Regex, replaceFunc);
4710  
4711    text = text.replace(regex, replaceFunc);
4712  
4713    // attacklab: strip sentinel
4714    text = text.replace(/¨0/, '');
4715  
4716    return text;
4717  });
4718  
4719  showdown.subParser('tables', function (text, options, globals) {
4720    'use strict';
4721  
4722    if (!options.tables) {
4723      return text;
4724    }
4725  
4726    var tableRgx       = /^ {0,3}\|?.+\|.+\n {0,3}\|?[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*:?[ \t]*(?:[-=]){2,}[\s\S]+?(?:\n\n|¨0)/gm,
4727        //singeColTblRgx = /^ {0,3}\|.+\|\n {0,3}\|[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*\n(?: {0,3}\|.+\|\n)+(?:\n\n|¨0)/gm;
4728        singeColTblRgx = /^ {0,3}\|.+\|[ \t]*\n {0,3}\|[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*\n( {0,3}\|.+\|[ \t]*\n)*(?:\n|¨0)/gm;
4729  
4730    function parseStyles (sLine) {
4731      if (/^:[ \t]*--*$/.test(sLine)) {
4732        return ' style="text-align:left;"';
4733      } else if (/^--*[ \t]*:[ \t]*$/.test(sLine)) {
4734        return ' style="text-align:right;"';
4735      } else if (/^:[ \t]*--*[ \t]*:$/.test(sLine)) {
4736        return ' style="text-align:center;"';
4737      } else {
4738        return '';
4739      }
4740    }
4741  
4742    function parseHeaders (header, style) {
4743      var id = '';
4744      header = header.trim();
4745      // support both tablesHeaderId and tableHeaderId due to error in documentation so we don't break backwards compatibility
4746      if (options.tablesHeaderId || options.tableHeaderId) {
4747        id = ' id="' + header.replace(/ /g, '_').toLowerCase() + '"';
4748      }
4749      header = showdown.subParser('spanGamut')(header, options, globals);
4750  
4751      return '<th' + id + style + '>' + header + '</th>\n';
4752    }
4753  
4754    function parseCells (cell, style) {
4755      var subText = showdown.subParser('spanGamut')(cell, options, globals);
4756      return '<td' + style + '>' + subText + '</td>\n';
4757    }
4758  
4759    function buildTable (headers, cells) {
4760      var tb = '<table>\n<thead>\n<tr>\n',
4761          tblLgn = headers.length;
4762  
4763      for (var i = 0; i < tblLgn; ++i) {
4764        tb += headers[i];
4765      }
4766      tb += '</tr>\n</thead>\n<tbody>\n';
4767  
4768      for (i = 0; i < cells.length; ++i) {
4769        tb += '<tr>\n';
4770        for (var ii = 0; ii < tblLgn; ++ii) {
4771          tb += cells[i][ii];
4772        }
4773        tb += '</tr>\n';
4774      }
4775      tb += '</tbody>\n</table>\n';
4776      return tb;
4777    }
4778  
4779    function parseTable (rawTable) {
4780      var i, tableLines = rawTable.split('\n');
4781  
4782      for (i = 0; i < tableLines.length; ++i) {
4783        // strip wrong first and last column if wrapped tables are used
4784        if (/^ {0,3}\|/.test(tableLines[i])) {
4785          tableLines[i] = tableLines[i].replace(/^ {0,3}\|/, '');
4786        }
4787        if (/\|[ \t]*$/.test(tableLines[i])) {
4788          tableLines[i] = tableLines[i].replace(/\|[ \t]*$/, '');
4789        }
4790        // parse code spans first, but we only support one line code spans
4791        tableLines[i] = showdown.subParser('codeSpans')(tableLines[i], options, globals);
4792      }
4793  
4794      var rawHeaders = tableLines[0].split('|').map(function (s) { return s.trim();}),
4795          rawStyles = tableLines[1].split('|').map(function (s) { return s.trim();}),
4796          rawCells = [],
4797          headers = [],
4798          styles = [],
4799          cells = [];
4800  
4801      tableLines.shift();
4802      tableLines.shift();
4803  
4804      for (i = 0; i < tableLines.length; ++i) {
4805        if (tableLines[i].trim() === '') {
4806          continue;
4807        }
4808        rawCells.push(
4809          tableLines[i]
4810            .split('|')
4811            .map(function (s) {
4812              return s.trim();
4813            })
4814        );
4815      }
4816  
4817      if (rawHeaders.length < rawStyles.length) {
4818        return rawTable;
4819      }
4820  
4821      for (i = 0; i < rawStyles.length; ++i) {
4822        styles.push(parseStyles(rawStyles[i]));
4823      }
4824  
4825      for (i = 0; i < rawHeaders.length; ++i) {
4826        if (showdown.helper.isUndefined(styles[i])) {
4827          styles[i] = '';
4828        }
4829        headers.push(parseHeaders(rawHeaders[i], styles[i]));
4830      }
4831  
4832      for (i = 0; i < rawCells.length; ++i) {
4833        var row = [];
4834        for (var ii = 0; ii < headers.length; ++ii) {
4835          if (showdown.helper.isUndefined(rawCells[i][ii])) {
4836  
4837          }
4838          row.push(parseCells(rawCells[i][ii], styles[ii]));
4839        }
4840        cells.push(row);
4841      }
4842  
4843      return buildTable(headers, cells);
4844    }
4845  
4846    text = globals.converter._dispatch('tables.before', text, options, globals);
4847  
4848    // find escaped pipe characters
4849    text = text.replace(/\\(\|)/g, showdown.helper.escapeCharactersCallback);
4850  
4851    // parse multi column tables
4852    text = text.replace(tableRgx, parseTable);
4853  
4854    // parse one column tables
4855    text = text.replace(singeColTblRgx, parseTable);
4856  
4857    text = globals.converter._dispatch('tables.after', text, options, globals);
4858  
4859    return text;
4860  });
4861  
4862  showdown.subParser('underline', function (text, options, globals) {
4863    'use strict';
4864  
4865    if (!options.underline) {
4866      return text;
4867    }
4868  
4869    text = globals.converter._dispatch('underline.before', text, options, globals);
4870  
4871    if (options.literalMidWordUnderscores) {
4872      text = text.replace(/\b___(\S[\s\S]*?)___\b/g, function (wm, txt) {
4873        return '<u>' + txt + '</u>';
4874      });
4875      text = text.replace(/\b__(\S[\s\S]*?)__\b/g, function (wm, txt) {
4876        return '<u>' + txt + '</u>';
4877      });
4878    } else {
4879      text = text.replace(/___(\S[\s\S]*?)___/g, function (wm, m) {
4880        return (/\S$/.test(m)) ? '<u>' + m + '</u>' : wm;
4881      });
4882      text = text.replace(/__(\S[\s\S]*?)__/g, function (wm, m) {
4883        return (/\S$/.test(m)) ? '<u>' + m + '</u>' : wm;
4884      });
4885    }
4886  
4887    // escape remaining underscores to prevent them being parsed by italic and bold
4888    text = text.replace(/(_)/g, showdown.helper.escapeCharactersCallback);
4889  
4890    text = globals.converter._dispatch('underline.after', text, options, globals);
4891  
4892    return text;
4893  });
4894  
4895  /**
4896   * Swap back in all the special characters we've hidden.
4897   */
4898  showdown.subParser('unescapeSpecialChars', function (text, options, globals) {
4899    'use strict';
4900    text = globals.converter._dispatch('unescapeSpecialChars.before', text, options, globals);
4901  
4902    text = text.replace(/¨E(\d+)E/g, function (wholeMatch, m1) {
4903      var charCodeToReplace = parseInt(m1);
4904      return String.fromCharCode(charCodeToReplace);
4905    });
4906  
4907    text = globals.converter._dispatch('unescapeSpecialChars.after', text, options, globals);
4908    return text;
4909  });
4910  
4911  showdown.subParser('makeMarkdown.blockquote', function (node, globals) {
4912    'use strict';
4913  
4914    var txt = '';
4915    if (node.hasChildNodes()) {
4916      var children = node.childNodes,
4917          childrenLength = children.length;
4918  
4919      for (var i = 0; i < childrenLength; ++i) {
4920        var innerTxt = showdown.subParser('makeMarkdown.node')(children[i], globals);
4921  
4922        if (innerTxt === '') {
4923          continue;
4924        }
4925        txt += innerTxt;
4926      }
4927    }
4928    // cleanup
4929    txt = txt.trim();
4930    txt = '> ' + txt.split('\n').join('\n> ');
4931    return txt;
4932  });
4933  
4934  showdown.subParser('makeMarkdown.codeBlock', function (node, globals) {
4935    'use strict';
4936  
4937    var lang = node.getAttribute('language'),
4938        num  = node.getAttribute('precodenum');
4939    return '```' + lang + '\n' + globals.preList[num] + '\n```';
4940  });
4941  
4942  showdown.subParser('makeMarkdown.codeSpan', function (node) {
4943    'use strict';
4944  
4945    return '`' + node.innerHTML + '`';
4946  });
4947  
4948  showdown.subParser('makeMarkdown.emphasis', function (node, globals) {
4949    'use strict';
4950  
4951    var txt = '';
4952    if (node.hasChildNodes()) {
4953      txt += '*';
4954      var children = node.childNodes,
4955          childrenLength = children.length;
4956      for (var i = 0; i < childrenLength; ++i) {
4957        txt += showdown.subParser('makeMarkdown.node')(children[i], globals);
4958      }
4959      txt += '*';
4960    }
4961    return txt;
4962  });
4963  
4964  showdown.subParser('makeMarkdown.header', function (node, globals, headerLevel) {
4965    'use strict';
4966  
4967    var headerMark = new Array(headerLevel + 1).join('#'),
4968        txt = '';
4969  
4970    if (node.hasChildNodes()) {
4971      txt = headerMark + ' ';
4972      var children = node.childNodes,
4973          childrenLength = children.length;
4974  
4975      for (var i = 0; i < childrenLength; ++i) {
4976        txt += showdown.subParser('makeMarkdown.node')(children[i], globals);
4977      }
4978    }
4979    return txt;
4980  });
4981  
4982  showdown.subParser('makeMarkdown.hr', function () {
4983    'use strict';
4984  
4985    return '---';
4986  });
4987  
4988  showdown.subParser('makeMarkdown.image', function (node) {
4989    'use strict';
4990  
4991    var txt = '';
4992    if (node.hasAttribute('src')) {
4993      txt += '![' + node.getAttribute('alt') + '](';
4994      txt += '<' + node.getAttribute('src') + '>';
4995      if (node.hasAttribute('width') && node.hasAttribute('height')) {
4996        txt += ' =' + node.getAttribute('width') + 'x' + node.getAttribute('height');
4997      }
4998  
4999      if (node.hasAttribute('title')) {
5000        txt += ' "' + node.getAttribute('title') + '"';
5001      }
5002      txt += ')';
5003    }
5004    return txt;
5005  });
5006  
5007  showdown.subParser('makeMarkdown.links', function (node, globals) {
5008    'use strict';
5009  
5010    var txt = '';
5011    if (node.hasChildNodes() && node.hasAttribute('href')) {
5012      var children = node.childNodes,
5013          childrenLength = children.length;
5014      txt = '[';
5015      for (var i = 0; i < childrenLength; ++i) {
5016        txt += showdown.subParser('makeMarkdown.node')(children[i], globals);
5017      }
5018      txt += '](';
5019      txt += '<' + node.getAttribute('href') + '>';
5020      if (node.hasAttribute('title')) {
5021        txt += ' "' + node.getAttribute('title') + '"';
5022      }
5023      txt += ')';
5024    }
5025    return txt;
5026  });
5027  
5028  showdown.subParser('makeMarkdown.list', function (node, globals, type) {
5029    'use strict';
5030  
5031    var txt = '';
5032    if (!node.hasChildNodes()) {
5033      return '';
5034    }
5035    var listItems       = node.childNodes,
5036        listItemsLenght = listItems.length,
5037        listNum = node.getAttribute('start') || 1;
5038  
5039    for (var i = 0; i < listItemsLenght; ++i) {
5040      if (typeof listItems[i].tagName === 'undefined' || listItems[i].tagName.toLowerCase() !== 'li') {
5041        continue;
5042      }
5043  
5044      // define the bullet to use in list
5045      var bullet = '';
5046      if (type === 'ol') {
5047        bullet = listNum.toString() + '. ';
5048      } else {
5049        bullet = '- ';
5050      }
5051  
5052      // parse list item
5053      txt += bullet + showdown.subParser('makeMarkdown.listItem')(listItems[i], globals);
5054      ++listNum;
5055    }
5056  
5057    // add comment at the end to prevent consecutive lists to be parsed as one
5058    txt += '\n<!-- -->\n';
5059    return txt.trim();
5060  });
5061  
5062  showdown.subParser('makeMarkdown.listItem', function (node, globals) {
5063    'use strict';
5064  
5065    var listItemTxt = '';
5066  
5067    var children = node.childNodes,
5068        childrenLenght = children.length;
5069  
5070    for (var i = 0; i < childrenLenght; ++i) {
5071      listItemTxt += showdown.subParser('makeMarkdown.node')(children[i], globals);
5072    }
5073    // if it's only one liner, we need to add a newline at the end
5074    if (!/\n$/.test(listItemTxt)) {
5075      listItemTxt += '\n';
5076    } else {
5077      // it's multiparagraph, so we need to indent
5078      listItemTxt = listItemTxt
5079        .split('\n')
5080        .join('\n    ')
5081        .replace(/^ {4}$/gm, '')
5082        .replace(/\n\n+/g, '\n\n');
5083    }
5084  
5085    return listItemTxt;
5086  });
5087  
5088  
5089  
5090  showdown.subParser('makeMarkdown.node', function (node, globals, spansOnly) {
5091    'use strict';
5092  
5093    spansOnly = spansOnly || false;
5094  
5095    var txt = '';
5096  
5097    // edge case of text without wrapper paragraph
5098    if (node.nodeType === 3) {
5099      return showdown.subParser('makeMarkdown.txt')(node, globals);
5100    }
5101  
5102    // HTML comment
5103    if (node.nodeType === 8) {
5104      return '<!--' + node.data + '-->\n\n';
5105    }
5106  
5107    // process only node elements
5108    if (node.nodeType !== 1) {
5109      return '';
5110    }
5111  
5112    var tagName = node.tagName.toLowerCase();
5113  
5114    switch (tagName) {
5115  
5116      //
5117      // BLOCKS
5118      //
5119      case 'h1':
5120        if (!spansOnly) { txt = showdown.subParser('makeMarkdown.header')(node, globals, 1) + '\n\n'; }
5121        break;
5122      case 'h2':
5123        if (!spansOnly) { txt = showdown.subParser('makeMarkdown.header')(node, globals, 2) + '\n\n'; }
5124        break;
5125      case 'h3':
5126        if (!spansOnly) { txt = showdown.subParser('makeMarkdown.header')(node, globals, 3) + '\n\n'; }
5127        break;
5128      case 'h4':
5129        if (!spansOnly) { txt = showdown.subParser('makeMarkdown.header')(node, globals, 4) + '\n\n'; }
5130        break;
5131      case 'h5':
5132        if (!spansOnly) { txt = showdown.subParser('makeMarkdown.header')(node, globals, 5) + '\n\n'; }
5133        break;
5134      case 'h6':
5135        if (!spansOnly) { txt = showdown.subParser('makeMarkdown.header')(node, globals, 6) + '\n\n'; }
5136        break;
5137  
5138      case 'p':
5139        if (!spansOnly) { txt = showdown.subParser('makeMarkdown.paragraph')(node, globals) + '\n\n'; }
5140        break;
5141  
5142      case 'blockquote':
5143        if (!spansOnly) { txt = showdown.subParser('makeMarkdown.blockquote')(node, globals) + '\n\n'; }
5144        break;
5145  
5146      case 'hr':
5147        if (!spansOnly) { txt = showdown.subParser('makeMarkdown.hr')(node, globals) + '\n\n'; }
5148        break;
5149  
5150      case 'ol':
5151        if (!spansOnly) { txt = showdown.subParser('makeMarkdown.list')(node, globals, 'ol') + '\n\n'; }
5152        break;
5153  
5154      case 'ul':
5155        if (!spansOnly) { txt = showdown.subParser('makeMarkdown.list')(node, globals, 'ul') + '\n\n'; }
5156        break;
5157  
5158      case 'precode':
5159        if (!spansOnly) { txt = showdown.subParser('makeMarkdown.codeBlock')(node, globals) + '\n\n'; }
5160        break;
5161  
5162      case 'pre':
5163        if (!spansOnly) { txt = showdown.subParser('makeMarkdown.pre')(node, globals) + '\n\n'; }
5164        break;
5165  
5166      case 'table':
5167        if (!spansOnly) { txt = showdown.subParser('makeMarkdown.table')(node, globals) + '\n\n'; }
5168        break;
5169  
5170      //
5171      // SPANS
5172      //
5173      case 'code':
5174        txt = showdown.subParser('makeMarkdown.codeSpan')(node, globals);
5175        break;
5176  
5177      case 'em':
5178      case 'i':
5179        txt = showdown.subParser('makeMarkdown.emphasis')(node, globals);
5180        break;
5181  
5182      case 'strong':
5183      case 'b':
5184        txt = showdown.subParser('makeMarkdown.strong')(node, globals);
5185        break;
5186  
5187      case 'del':
5188        txt = showdown.subParser('makeMarkdown.strikethrough')(node, globals);
5189        break;
5190  
5191      case 'a':
5192        txt = showdown.subParser('makeMarkdown.links')(node, globals);
5193        break;
5194  
5195      case 'img':
5196        txt = showdown.subParser('makeMarkdown.image')(node, globals);
5197        break;
5198  
5199      default:
5200        txt = node.outerHTML + '\n\n';
5201    }
5202  
5203    // common normalization
5204    // TODO eventually
5205  
5206    return txt;
5207  });
5208  
5209  showdown.subParser('makeMarkdown.paragraph', function (node, globals) {
5210    'use strict';
5211  
5212    var txt = '';
5213    if (node.hasChildNodes()) {
5214      var children = node.childNodes,
5215          childrenLength = children.length;
5216      for (var i = 0; i < childrenLength; ++i) {
5217        txt += showdown.subParser('makeMarkdown.node')(children[i], globals);
5218      }
5219    }
5220  
5221    // some text normalization
5222    txt = txt.trim();
5223  
5224    return txt;
5225  });
5226  
5227  showdown.subParser('makeMarkdown.pre', function (node, globals) {
5228    'use strict';
5229  
5230    var num  = node.getAttribute('prenum');
5231    return '<pre>' + globals.preList[num] + '</pre>';
5232  });
5233  
5234  showdown.subParser('makeMarkdown.strikethrough', function (node, globals) {
5235    'use strict';
5236  
5237    var txt = '';
5238    if (node.hasChildNodes()) {
5239      txt += '~~';
5240      var children = node.childNodes,
5241          childrenLength = children.length;
5242      for (var i = 0; i < childrenLength; ++i) {
5243        txt += showdown.subParser('makeMarkdown.node')(children[i], globals);
5244      }
5245      txt += '~~';
5246    }
5247    return txt;
5248  });
5249  
5250  showdown.subParser('makeMarkdown.strong', function (node, globals) {
5251    'use strict';
5252  
5253    var txt = '';
5254    if (node.hasChildNodes()) {
5255      txt += '**';
5256      var children = node.childNodes,
5257          childrenLength = children.length;
5258      for (var i = 0; i < childrenLength; ++i) {
5259        txt += showdown.subParser('makeMarkdown.node')(children[i], globals);
5260      }
5261      txt += '**';
5262    }
5263    return txt;
5264  });
5265  
5266  showdown.subParser('makeMarkdown.table', function (node, globals) {
5267    'use strict';
5268  
5269    var txt = '',
5270        tableArray = [[], []],
5271        headings   = node.querySelectorAll('thead>tr>th'),
5272        rows       = node.querySelectorAll('tbody>tr'),
5273        i, ii;
5274    for (i = 0; i < headings.length; ++i) {
5275      var headContent = showdown.subParser('makeMarkdown.tableCell')(headings[i], globals),
5276          allign = '---';
5277  
5278      if (headings[i].hasAttribute('style')) {
5279        var style = headings[i].getAttribute('style').toLowerCase().replace(/\s/g, '');
5280        switch (style) {
5281          case 'text-align:left;':
5282            allign = ':---';
5283            break;
5284          case 'text-align:right;':
5285            allign = '---:';
5286            break;
5287          case 'text-align:center;':
5288            allign = ':---:';
5289            break;
5290        }
5291      }
5292      tableArray[0][i] = headContent.trim();
5293      tableArray[1][i] = allign;
5294    }
5295  
5296    for (i = 0; i < rows.length; ++i) {
5297      var r = tableArray.push([]) - 1,
5298          cols = rows[i].getElementsByTagName('td');
5299  
5300      for (ii = 0; ii < headings.length; ++ii) {
5301        var cellContent = ' ';
5302        if (typeof cols[ii] !== 'undefined') {
5303          cellContent = showdown.subParser('makeMarkdown.tableCell')(cols[ii], globals);
5304        }
5305        tableArray[r].push(cellContent);
5306      }
5307    }
5308  
5309    var cellSpacesCount = 3;
5310    for (i = 0; i < tableArray.length; ++i) {
5311      for (ii = 0; ii < tableArray[i].length; ++ii) {
5312        var strLen = tableArray[i][ii].length;
5313        if (strLen > cellSpacesCount) {
5314          cellSpacesCount = strLen;
5315        }
5316      }
5317    }
5318  
5319    for (i = 0; i < tableArray.length; ++i) {
5320      for (ii = 0; ii < tableArray[i].length; ++ii) {
5321        if (i === 1) {
5322          if (tableArray[i][ii].slice(-1) === ':') {
5323            tableArray[i][ii] = showdown.helper.padEnd(tableArray[i][ii].slice(-1), cellSpacesCount - 1, '-') + ':';
5324          } else {
5325            tableArray[i][ii] = showdown.helper.padEnd(tableArray[i][ii], cellSpacesCount, '-');
5326          }
5327        } else {
5328          tableArray[i][ii] = showdown.helper.padEnd(tableArray[i][ii], cellSpacesCount);
5329        }
5330      }
5331      txt += '| ' + tableArray[i].join(' | ') + ' |\n';
5332    }
5333  
5334    return txt.trim();
5335  });
5336  
5337  showdown.subParser('makeMarkdown.tableCell', function (node, globals) {
5338    'use strict';
5339  
5340    var txt = '';
5341    if (!node.hasChildNodes()) {
5342      return '';
5343    }
5344    var children = node.childNodes,
5345        childrenLength = children.length;
5346  
5347    for (var i = 0; i < childrenLength; ++i) {
5348      txt += showdown.subParser('makeMarkdown.node')(children[i], globals, true);
5349    }
5350    return txt.trim();
5351  });
5352  
5353  showdown.subParser('makeMarkdown.txt', function (node) {
5354    'use strict';
5355  
5356    var txt = node.nodeValue;
5357  
5358    // multiple spaces are collapsed
5359    txt = txt.replace(/ +/g, ' ');
5360  
5361    // replace the custom ¨NBSP; with a space
5362    txt = txt.replace(/¨NBSP;/g, ' ');
5363  
5364    // ", <, > and & should replace escaped html entities
5365    txt = showdown.helper.unescapeHTMLEntities(txt);
5366  
5367    // escape markdown magic characters
5368    // emphasis, strong and strikethrough - can appear everywhere
5369    // we also escape pipe (|) because of tables
5370    // and escape ` because of code blocks and spans
5371    txt = txt.replace(/([*_~|`])/g, '\\$1');
5372  
5373    // escape > because of blockquotes
5374    txt = txt.replace(/^(\s*)>/g, '\\$1>');
5375  
5376    // hash character, only troublesome at the beginning of a line because of headers
5377    txt = txt.replace(/^#/gm, '\\#');
5378  
5379    // horizontal rules
5380    txt = txt.replace(/^(\s*)([-=]{3,})(\s*)$/, '$1\\$2$3');
5381  
5382    // dot, because of ordered lists, only troublesome at the beginning of a line when preceded by an integer
5383    txt = txt.replace(/^( {0,3}\d+)\./gm, '$1\\.');
5384  
5385    // +, * and -, at the beginning of a line becomes a list, so we need to escape them also (asterisk was already escaped)
5386    txt = txt.replace(/^( {0,3})([+-])/gm, '$1\\$2');
5387  
5388    // images and links, ] followed by ( is problematic, so we escape it
5389    txt = txt.replace(/]([\s]*)\(/g, '\\]$1\\(');
5390  
5391    // reference URIs must also be escaped
5392    txt = txt.replace(/^ {0,3}\[([\S \t]*?)]:/gm, '\\[$1]:');
5393  
5394    return txt;
5395  });
5396  
5397  var root = this;
5398  
5399  // AMD Loader
5400  if (true) {
5401    !(__WEBPACK_AMD_DEFINE_RESULT__ = (function () {
5402      'use strict';
5403      return showdown;
5404    }).call(exports, __webpack_require__, exports, module),
5405                  __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
5406  
5407  // CommonJS/nodeJS Loader
5408  } else {}
5409  }).call(this);
5410  
5411  
5412  
5413  /***/ }),
5414  
5415  /***/ 27:
5416  /***/ (function(module, exports) {
5417  
5418  (function() { module.exports = this["wp"]["dom"]; }());
5419  
5420  /***/ }),
5421  
5422  /***/ 29:
5423  /***/ (function(module, exports) {
5424  
5425  (function() { module.exports = this["wp"]["hooks"]; }());
5426  
5427  /***/ }),
5428  
5429  /***/ 31:
5430  /***/ (function(module, __webpack_exports__, __webpack_require__) {
5431  
5432  "use strict";
5433  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _iterableToArray; });
5434  function _iterableToArray(iter) {
5435    if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter);
5436  }
5437  
5438  /***/ }),
5439  
5440  /***/ 34:
5441  /***/ (function(module, __webpack_exports__, __webpack_require__) {
5442  
5443  "use strict";
5444  
5445  
5446  var LEAF_KEY, hasWeakMap;
5447  
5448  /**
5449   * Arbitrary value used as key for referencing cache object in WeakMap tree.
5450   *
5451   * @type {Object}
5452   */
5453  LEAF_KEY = {};
5454  
5455  /**
5456   * Whether environment supports WeakMap.
5457   *
5458   * @type {boolean}
5459   */
5460  hasWeakMap = typeof WeakMap !== 'undefined';
5461  
5462  /**
5463   * Returns the first argument as the sole entry in an array.
5464   *
5465   * @param {*} value Value to return.
5466   *
5467   * @return {Array} Value returned as entry in array.
5468   */
5469  function arrayOf( value ) {
5470      return [ value ];
5471  }
5472  
5473  /**
5474   * Returns true if the value passed is object-like, or false otherwise. A value
5475   * is object-like if it can support property assignment, e.g. object or array.
5476   *
5477   * @param {*} value Value to test.
5478   *
5479   * @return {boolean} Whether value is object-like.
5480   */
5481  function isObjectLike( value ) {
5482      return !! value && 'object' === typeof value;
5483  }
5484  
5485  /**
5486   * Creates and returns a new cache object.
5487   *
5488   * @return {Object} Cache object.
5489   */
5490  function createCache() {
5491      var cache = {
5492          clear: function() {
5493              cache.head = null;
5494          },
5495      };
5496  
5497      return cache;
5498  }
5499  
5500  /**
5501   * Returns true if entries within the two arrays are strictly equal by
5502   * reference from a starting index.
5503   *
5504   * @param {Array}  a         First array.
5505   * @param {Array}  b         Second array.
5506   * @param {number} fromIndex Index from which to start comparison.
5507   *
5508   * @return {boolean} Whether arrays are shallowly equal.
5509   */
5510  function isShallowEqual( a, b, fromIndex ) {
5511      var i;
5512  
5513      if ( a.length !== b.length ) {
5514          return false;
5515      }
5516  
5517      for ( i = fromIndex; i < a.length; i++ ) {
5518          if ( a[ i ] !== b[ i ] ) {
5519              return false;
5520          }
5521      }
5522  
5523      return true;
5524  }
5525  
5526  /**
5527   * Returns a memoized selector function. The getDependants function argument is
5528   * called before the memoized selector and is expected to return an immutable
5529   * reference or array of references on which the selector depends for computing
5530   * its own return value. The memoize cache is preserved only as long as those
5531   * dependant references remain the same. If getDependants returns a different
5532   * reference(s), the cache is cleared and the selector value regenerated.
5533   *
5534   * @param {Function} selector      Selector function.
5535   * @param {Function} getDependants Dependant getter returning an immutable
5536   *                                 reference or array of reference used in
5537   *                                 cache bust consideration.
5538   *
5539   * @return {Function} Memoized selector.
5540   */
5541  /* harmony default export */ __webpack_exports__["a"] = (function( selector, getDependants ) {
5542      var rootCache, getCache;
5543  
5544      // Use object source as dependant if getter not provided
5545      if ( ! getDependants ) {
5546          getDependants = arrayOf;
5547      }
5548  
5549      /**
5550       * Returns the root cache. If WeakMap is supported, this is assigned to the
5551       * root WeakMap cache set, otherwise it is a shared instance of the default
5552       * cache object.
5553       *
5554       * @return {(WeakMap|Object)} Root cache object.
5555       */
5556  	function getRootCache() {
5557          return rootCache;
5558      }
5559  
5560      /**
5561       * Returns the cache for a given dependants array. When possible, a WeakMap
5562       * will be used to create a unique cache for each set of dependants. This
5563       * is feasible due to the nature of WeakMap in allowing garbage collection
5564       * to occur on entries where the key object is no longer referenced. Since
5565       * WeakMap requires the key to be an object, this is only possible when the
5566       * dependant is object-like. The root cache is created as a hierarchy where
5567       * each top-level key is the first entry in a dependants set, the value a
5568       * WeakMap where each key is the next dependant, and so on. This continues
5569       * so long as the dependants are object-like. If no dependants are object-
5570       * like, then the cache is shared across all invocations.
5571       *
5572       * @see isObjectLike
5573       *
5574       * @param {Array} dependants Selector dependants.
5575       *
5576       * @return {Object} Cache object.
5577       */
5578  	function getWeakMapCache( dependants ) {
5579          var caches = rootCache,
5580              isUniqueByDependants = true,
5581              i, dependant, map, cache;
5582  
5583          for ( i = 0; i < dependants.length; i++ ) {
5584              dependant = dependants[ i ];
5585  
5586              // Can only compose WeakMap from object-like key.
5587              if ( ! isObjectLike( dependant ) ) {
5588                  isUniqueByDependants = false;
5589                  break;
5590              }
5591  
5592              // Does current segment of cache already have a WeakMap?
5593              if ( caches.has( dependant ) ) {
5594                  // Traverse into nested WeakMap.
5595                  caches = caches.get( dependant );
5596              } else {
5597                  // Create, set, and traverse into a new one.
5598                  map = new WeakMap();
5599                  caches.set( dependant, map );
5600                  caches = map;
5601              }
5602          }
5603  
5604          // We use an arbitrary (but consistent) object as key for the last item
5605          // in the WeakMap to serve as our running cache.
5606          if ( ! caches.has( LEAF_KEY ) ) {
5607              cache = createCache();
5608              cache.isUniqueByDependants = isUniqueByDependants;
5609              caches.set( LEAF_KEY, cache );
5610          }
5611  
5612          return caches.get( LEAF_KEY );
5613      }
5614  
5615      // Assign cache handler by availability of WeakMap
5616      getCache = hasWeakMap ? getWeakMapCache : getRootCache;
5617  
5618      /**
5619       * Resets root memoization cache.
5620       */
5621  	function clear() {
5622          rootCache = hasWeakMap ? new WeakMap() : createCache();
5623      }
5624  
5625      // eslint-disable-next-line jsdoc/check-param-names
5626      /**
5627       * The augmented selector call, considering first whether dependants have
5628       * changed before passing it to underlying memoize function.
5629       *
5630       * @param {Object} source    Source object for derivation.
5631       * @param {...*}   extraArgs Additional arguments to pass to selector.
5632       *
5633       * @return {*} Selector result.
5634       */
5635  	function callSelector( /* source, ...extraArgs */ ) {
5636          var len = arguments.length,
5637              cache, node, i, args, dependants;
5638  
5639          // Create copy of arguments (avoid leaking deoptimization).
5640          args = new Array( len );
5641          for ( i = 0; i < len; i++ ) {
5642              args[ i ] = arguments[ i ];
5643          }
5644  
5645          dependants = getDependants.apply( null, args );
5646          cache = getCache( dependants );
5647  
5648          // If not guaranteed uniqueness by dependants (primitive type or lack
5649          // of WeakMap support), shallow compare against last dependants and, if
5650          // references have changed, destroy cache to recalculate result.
5651          if ( ! cache.isUniqueByDependants ) {
5652              if ( cache.lastDependants && ! isShallowEqual( dependants, cache.lastDependants, 0 ) ) {
5653                  cache.clear();
5654              }
5655  
5656              cache.lastDependants = dependants;
5657          }
5658  
5659          node = cache.head;
5660          while ( node ) {
5661              // Check whether node arguments match arguments
5662              if ( ! isShallowEqual( node.args, args, 1 ) ) {
5663                  node = node.next;
5664                  continue;
5665              }
5666  
5667              // At this point we can assume we've found a match
5668  
5669              // Surface matched node to head if not already
5670              if ( node !== cache.head ) {
5671                  // Adjust siblings to point to each other.
5672                  node.prev.next = node.next;
5673                  if ( node.next ) {
5674                      node.next.prev = node.prev;
5675                  }
5676  
5677                  node.next = cache.head;
5678                  node.prev = null;
5679                  cache.head.prev = node;
5680                  cache.head = node;
5681              }
5682  
5683              // Return immediately
5684              return node.val;
5685          }
5686  
5687          // No cached value found. Continue to insertion phase:
5688  
5689          node = {
5690              // Generate the result from original function
5691              val: selector.apply( null, args ),
5692          };
5693  
5694          // Avoid including the source object in the cache.
5695          args[ 0 ] = null;
5696          node.args = args;
5697  
5698          // Don't need to check whether node is already head, since it would
5699          // have been returned above already if it was
5700  
5701          // Shift existing head down list
5702          if ( cache.head ) {
5703              cache.head.prev = node;
5704              node.next = cache.head;
5705          }
5706  
5707          cache.head = node;
5708  
5709          return node.val;
5710      }
5711  
5712      callSelector.getDependants = getDependants;
5713      callSelector.clear = clear;
5714      clear();
5715  
5716      return callSelector;
5717  });
5718  
5719  
5720  /***/ }),
5721  
5722  /***/ 35:
5723  /***/ (function(module, __webpack_exports__, __webpack_require__) {
5724  
5725  "use strict";
5726  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _arrayWithHoles; });
5727  function _arrayWithHoles(arr) {
5728    if (Array.isArray(arr)) return arr;
5729  }
5730  
5731  /***/ }),
5732  
5733  /***/ 36:
5734  /***/ (function(module, __webpack_exports__, __webpack_require__) {
5735  
5736  "use strict";
5737  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _nonIterableRest; });
5738  function _nonIterableRest() {
5739    throw new TypeError("Invalid attempt to destructure non-iterable instance");
5740  }
5741  
5742  /***/ }),
5743  
5744  /***/ 367:
5745  /***/ (function(module, __webpack_exports__, __webpack_require__) {
5746  
5747  "use strict";
5748  __webpack_require__.r(__webpack_exports__);
5749  var selectors_namespaceObject = {};
5750  __webpack_require__.r(selectors_namespaceObject);
5751  __webpack_require__.d(selectors_namespaceObject, "getBlockTypes", function() { return getBlockTypes; });
5752  __webpack_require__.d(selectors_namespaceObject, "getBlockType", function() { return getBlockType; });
5753  __webpack_require__.d(selectors_namespaceObject, "getBlockStyles", function() { return getBlockStyles; });
5754  __webpack_require__.d(selectors_namespaceObject, "__experimentalGetBlockPatterns", function() { return __experimentalGetBlockPatterns; });
5755  __webpack_require__.d(selectors_namespaceObject, "__experimentalGetDefaultBlockPattern", function() { return __experimentalGetDefaultBlockPattern; });
5756  __webpack_require__.d(selectors_namespaceObject, "getCategories", function() { return getCategories; });
5757  __webpack_require__.d(selectors_namespaceObject, "getDefaultBlockName", function() { return getDefaultBlockName; });
5758  __webpack_require__.d(selectors_namespaceObject, "getFreeformFallbackBlockName", function() { return getFreeformFallbackBlockName; });
5759  __webpack_require__.d(selectors_namespaceObject, "getUnregisteredFallbackBlockName", function() { return getUnregisteredFallbackBlockName; });
5760  __webpack_require__.d(selectors_namespaceObject, "getGroupingBlockName", function() { return getGroupingBlockName; });
5761  __webpack_require__.d(selectors_namespaceObject, "getChildBlockNames", function() { return selectors_getChildBlockNames; });
5762  __webpack_require__.d(selectors_namespaceObject, "getBlockSupport", function() { return selectors_getBlockSupport; });
5763  __webpack_require__.d(selectors_namespaceObject, "hasBlockSupport", function() { return hasBlockSupport; });
5764  __webpack_require__.d(selectors_namespaceObject, "isMatchingSearchTerm", function() { return isMatchingSearchTerm; });
5765  __webpack_require__.d(selectors_namespaceObject, "hasChildBlocks", function() { return selectors_hasChildBlocks; });
5766  __webpack_require__.d(selectors_namespaceObject, "hasChildBlocksWithInserterSupport", function() { return selectors_hasChildBlocksWithInserterSupport; });
5767  var actions_namespaceObject = {};
5768  __webpack_require__.r(actions_namespaceObject);
5769  __webpack_require__.d(actions_namespaceObject, "addBlockTypes", function() { return addBlockTypes; });
5770  __webpack_require__.d(actions_namespaceObject, "removeBlockTypes", function() { return removeBlockTypes; });
5771  __webpack_require__.d(actions_namespaceObject, "addBlockStyles", function() { return addBlockStyles; });
5772  __webpack_require__.d(actions_namespaceObject, "removeBlockStyles", function() { return removeBlockStyles; });
5773  __webpack_require__.d(actions_namespaceObject, "__experimentalAddBlockPatterns", function() { return __experimentalAddBlockPatterns; });
5774  __webpack_require__.d(actions_namespaceObject, "__experimentalRemoveBlockPatterns", function() { return __experimentalRemoveBlockPatterns; });
5775  __webpack_require__.d(actions_namespaceObject, "setDefaultBlockName", function() { return setDefaultBlockName; });
5776  __webpack_require__.d(actions_namespaceObject, "setFreeformFallbackBlockName", function() { return setFreeformFallbackBlockName; });
5777  __webpack_require__.d(actions_namespaceObject, "setUnregisteredFallbackBlockName", function() { return setUnregisteredFallbackBlockName; });
5778  __webpack_require__.d(actions_namespaceObject, "setGroupingBlockName", function() { return setGroupingBlockName; });
5779  __webpack_require__.d(actions_namespaceObject, "setCategories", function() { return setCategories; });
5780  __webpack_require__.d(actions_namespaceObject, "updateCategory", function() { return updateCategory; });
5781  
5782  // EXTERNAL MODULE: external {"this":["wp","data"]}
5783  var external_this_wp_data_ = __webpack_require__(4);
5784  
5785  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
5786  var defineProperty = __webpack_require__(9);
5787  
5788  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js + 2 modules
5789  var toConsumableArray = __webpack_require__(18);
5790  
5791  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectSpread.js
5792  var objectSpread = __webpack_require__(6);
5793  
5794  // EXTERNAL MODULE: external {"this":"lodash"}
5795  var external_this_lodash_ = __webpack_require__(2);
5796  
5797  // EXTERNAL MODULE: external {"this":["wp","i18n"]}
5798  var external_this_wp_i18n_ = __webpack_require__(1);
5799  
5800  // CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/store/reducer.js
5801  
5802  
5803  
5804  
5805  /**
5806   * External dependencies
5807   */
5808  
5809  /**
5810   * WordPress dependencies
5811   */
5812  
5813  
5814  
5815  /**
5816   * Module Constants
5817   */
5818  
5819  var DEFAULT_CATEGORIES = [{
5820    slug: 'common',
5821    title: Object(external_this_wp_i18n_["__"])('Common blocks')
5822  }, {
5823    slug: 'formatting',
5824    title: Object(external_this_wp_i18n_["__"])('Formatting')
5825  }, {
5826    slug: 'layout',
5827    title: Object(external_this_wp_i18n_["__"])('Layout elements')
5828  }, {
5829    slug: 'widgets',
5830    title: Object(external_this_wp_i18n_["__"])('Widgets')
5831  }, {
5832    slug: 'embed',
5833    title: Object(external_this_wp_i18n_["__"])('Embeds')
5834  }, {
5835    slug: 'reusable',
5836    title: Object(external_this_wp_i18n_["__"])('Reusable blocks')
5837  }];
5838  /**
5839   * Reducer managing the block types
5840   *
5841   * @param {Object} state  Current state.
5842   * @param {Object} action Dispatched action.
5843   *
5844   * @return {Object} Updated state.
5845   */
5846  
5847  function reducer_blockTypes() {
5848    var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
5849    var action = arguments.length > 1 ? arguments[1] : undefined;
5850  
5851    switch (action.type) {
5852      case 'ADD_BLOCK_TYPES':
5853        return Object(objectSpread["a" /* default */])({}, state, Object(external_this_lodash_["keyBy"])(Object(external_this_lodash_["map"])(action.blockTypes, function (blockType) {
5854          return Object(external_this_lodash_["omit"])(blockType, 'styles ');
5855        }), 'name'));
5856  
5857      case 'REMOVE_BLOCK_TYPES':
5858        return Object(external_this_lodash_["omit"])(state, action.names);
5859    }
5860  
5861    return state;
5862  }
5863  /**
5864   * Reducer managing the block style variations.
5865   *
5866   * @param {Object} state  Current state.
5867   * @param {Object} action Dispatched action.
5868   *
5869   * @return {Object} Updated state.
5870   */
5871  
5872  function blockStyles() {
5873    var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
5874    var action = arguments.length > 1 ? arguments[1] : undefined;
5875  
5876    switch (action.type) {
5877      case 'ADD_BLOCK_TYPES':
5878        return Object(objectSpread["a" /* default */])({}, state, Object(external_this_lodash_["mapValues"])(Object(external_this_lodash_["keyBy"])(action.blockTypes, 'name'), function (blockType) {
5879          return Object(external_this_lodash_["uniqBy"])([].concat(Object(toConsumableArray["a" /* default */])(Object(external_this_lodash_["get"])(blockType, ['styles'], [])), Object(toConsumableArray["a" /* default */])(Object(external_this_lodash_["get"])(state, [blockType.name], []))), function (style) {
5880            return style.name;
5881          });
5882        }));
5883  
5884      case 'ADD_BLOCK_STYLES':
5885        return Object(objectSpread["a" /* default */])({}, state, Object(defineProperty["a" /* default */])({}, action.blockName, Object(external_this_lodash_["uniqBy"])([].concat(Object(toConsumableArray["a" /* default */])(Object(external_this_lodash_["get"])(state, [action.blockName], [])), Object(toConsumableArray["a" /* default */])(action.styles)), function (style) {
5886          return style.name;
5887        })));
5888  
5889      case 'REMOVE_BLOCK_STYLES':
5890        return Object(objectSpread["a" /* default */])({}, state, Object(defineProperty["a" /* default */])({}, action.blockName, Object(external_this_lodash_["filter"])(Object(external_this_lodash_["get"])(state, [action.blockName], []), function (style) {
5891          return action.styleNames.indexOf(style.name) === -1;
5892        })));
5893    }
5894  
5895    return state;
5896  }
5897  /**
5898   * Reducer managing the block patterns.
5899   *
5900   * @param {Object} state  Current state.
5901   * @param {Object} action Dispatched action.
5902   *
5903   * @return {Object} Updated state.
5904   */
5905  
5906  function blockPatterns() {
5907    var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
5908    var action = arguments.length > 1 ? arguments[1] : undefined;
5909  
5910    switch (action.type) {
5911      case 'ADD_BLOCK_TYPES':
5912        return Object(objectSpread["a" /* default */])({}, state, Object(external_this_lodash_["mapValues"])(Object(external_this_lodash_["keyBy"])(action.blockTypes, 'name'), function (blockType) {
5913          return Object(external_this_lodash_["uniqBy"])([].concat(Object(toConsumableArray["a" /* default */])(Object(external_this_lodash_["get"])(blockType, ['patterns'], [])), Object(toConsumableArray["a" /* default */])(Object(external_this_lodash_["get"])(state, [blockType.name], []))), function (pattern) {
5914            return pattern.name;
5915          });
5916        }));
5917  
5918      case 'ADD_BLOCK_PATTERNS':
5919        return Object(objectSpread["a" /* default */])({}, state, Object(defineProperty["a" /* default */])({}, action.blockName, Object(external_this_lodash_["uniqBy"])([].concat(Object(toConsumableArray["a" /* default */])(Object(external_this_lodash_["get"])(state, [action.blockName], [])), Object(toConsumableArray["a" /* default */])(action.patterns)), function (pattern) {
5920          return pattern.name;
5921        })));
5922  
5923      case 'REMOVE_BLOCK_PATTERNS':
5924        return Object(objectSpread["a" /* default */])({}, state, Object(defineProperty["a" /* default */])({}, action.blockName, Object(external_this_lodash_["filter"])(Object(external_this_lodash_["get"])(state, [action.blockName], []), function (pattern) {
5925          return action.patternNames.indexOf(pattern.name) === -1;
5926        })));
5927    }
5928  
5929    return state;
5930  }
5931  /**
5932   * Higher-order Reducer creating a reducer keeping track of given block name.
5933   *
5934   * @param {string} setActionType  Action type.
5935   *
5936   * @return {Function} Reducer.
5937   */
5938  
5939  function createBlockNameSetterReducer(setActionType) {
5940    return function () {
5941      var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
5942      var action = arguments.length > 1 ? arguments[1] : undefined;
5943  
5944      switch (action.type) {
5945        case 'REMOVE_BLOCK_TYPES':
5946          if (action.names.indexOf(state) !== -1) {
5947            return null;
5948          }
5949  
5950          return state;
5951  
5952        case setActionType:
5953          return action.name || null;
5954      }
5955  
5956      return state;
5957    };
5958  }
5959  var reducer_defaultBlockName = createBlockNameSetterReducer('SET_DEFAULT_BLOCK_NAME');
5960  var freeformFallbackBlockName = createBlockNameSetterReducer('SET_FREEFORM_FALLBACK_BLOCK_NAME');
5961  var unregisteredFallbackBlockName = createBlockNameSetterReducer('SET_UNREGISTERED_FALLBACK_BLOCK_NAME');
5962  var groupingBlockName = createBlockNameSetterReducer('SET_GROUPING_BLOCK_NAME');
5963  /**
5964   * Reducer managing the categories
5965   *
5966   * @param {Object} state  Current state.
5967   * @param {Object} action Dispatched action.
5968   *
5969   * @return {Object} Updated state.
5970   */
5971  
5972  function reducer_categories() {
5973    var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : DEFAULT_CATEGORIES;
5974    var action = arguments.length > 1 ? arguments[1] : undefined;
5975  
5976    switch (action.type) {
5977      case 'SET_CATEGORIES':
5978        return action.categories || [];
5979  
5980      case 'UPDATE_CATEGORY':
5981        {
5982          if (!action.category || Object(external_this_lodash_["isEmpty"])(action.category)) {
5983            return state;
5984          }
5985  
5986          var categoryToChange = Object(external_this_lodash_["find"])(state, ['slug', action.slug]);
5987  
5988          if (categoryToChange) {
5989            return Object(external_this_lodash_["map"])(state, function (category) {
5990              if (category.slug === action.slug) {
5991                return Object(objectSpread["a" /* default */])({}, category, action.category);
5992              }
5993  
5994              return category;
5995            });
5996          }
5997        }
5998    }
5999  
6000    return state;
6001  }
6002  /* harmony default export */ var reducer = (Object(external_this_wp_data_["combineReducers"])({
6003    blockTypes: reducer_blockTypes,
6004    blockStyles: blockStyles,
6005    blockPatterns: blockPatterns,
6006    defaultBlockName: reducer_defaultBlockName,
6007    freeformFallbackBlockName: freeformFallbackBlockName,
6008    unregisteredFallbackBlockName: unregisteredFallbackBlockName,
6009    groupingBlockName: groupingBlockName,
6010    categories: reducer_categories
6011  }));
6012  
6013  // EXTERNAL MODULE: ./node_modules/rememo/es/rememo.js
6014  var rememo = __webpack_require__(34);
6015  
6016  // CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/store/selectors.js
6017  /**
6018   * External dependencies
6019   */
6020  
6021  
6022  /**
6023   * Given a block name or block type object, returns the corresponding
6024   * normalized block type object.
6025   *
6026   * @param {Object}          state      Blocks state.
6027   * @param {(string|Object)} nameOrType Block name or type object
6028   *
6029   * @return {Object} Block type object.
6030   */
6031  
6032  var getNormalizedBlockType = function getNormalizedBlockType(state, nameOrType) {
6033    return 'string' === typeof nameOrType ? getBlockType(state, nameOrType) : nameOrType;
6034  };
6035  /**
6036   * Returns all the available block types.
6037   *
6038   * @param {Object} state Data state.
6039   *
6040   * @return {Array} Block Types.
6041   */
6042  
6043  
6044  var getBlockTypes = Object(rememo["a" /* default */])(function (state) {
6045    return Object.values(state.blockTypes);
6046  }, function (state) {
6047    return [state.blockTypes];
6048  });
6049  /**
6050   * Returns a block type by name.
6051   *
6052   * @param {Object} state Data state.
6053   * @param {string} name Block type name.
6054   *
6055   * @return {Object?} Block Type.
6056   */
6057  
6058  function getBlockType(state, name) {
6059    return state.blockTypes[name];
6060  }
6061  /**
6062   * Returns block styles by block name.
6063   *
6064   * @param {Object} state Data state.
6065   * @param {string} name  Block type name.
6066   *
6067   * @return {Array?} Block Styles.
6068   */
6069  
6070  function getBlockStyles(state, name) {
6071    return state.blockStyles[name];
6072  }
6073  /**
6074   * Returns block patterns by block name.
6075   *
6076   * @param {Object} state      Data state.
6077   * @param {string} blockName  Block type name.
6078   *
6079   * @return {(WPBlockPattern[]|void)} Block patterns.
6080   */
6081  
6082  function __experimentalGetBlockPatterns(state, blockName) {
6083    return state.blockPatterns[blockName];
6084  }
6085  /**
6086   * Returns the default block pattern for the given block type.
6087   * When there are multiple patterns annotated as the default one,
6088   * the last added item is picked. This simplifies registering overrides.
6089   * When there is no default pattern set, it returns the first item.
6090   *
6091   * @param {Object} state      Data state.
6092   * @param {string} blockName  Block type name.
6093   *
6094   * @return {?WPBlockPattern} The default block pattern.
6095   */
6096  
6097  function __experimentalGetDefaultBlockPattern(state, blockName) {
6098    var patterns = __experimentalGetBlockPatterns(state, blockName);
6099  
6100    return Object(external_this_lodash_["findLast"])(patterns, 'isDefault') || Object(external_this_lodash_["first"])(patterns);
6101  }
6102  /**
6103   * Returns all the available categories.
6104   *
6105   * @param {Object} state Data state.
6106   *
6107   * @return {Array} Categories list.
6108   */
6109  
6110  function getCategories(state) {
6111    return state.categories;
6112  }
6113  /**
6114   * Returns the name of the default block name.
6115   *
6116   * @param {Object} state Data state.
6117   *
6118   * @return {string?} Default block name.
6119   */
6120  
6121  function getDefaultBlockName(state) {
6122    return state.defaultBlockName;
6123  }
6124  /**
6125   * Returns the name of the block for handling non-block content.
6126   *
6127   * @param {Object} state Data state.
6128   *
6129   * @return {string?} Name of the block for handling non-block content.
6130   */
6131  
6132  function getFreeformFallbackBlockName(state) {
6133    return state.freeformFallbackBlockName;
6134  }
6135  /**
6136   * Returns the name of the block for handling unregistered blocks.
6137   *
6138   * @param {Object} state Data state.
6139   *
6140   * @return {string?} Name of the block for handling unregistered blocks.
6141   */
6142  
6143  function getUnregisteredFallbackBlockName(state) {
6144    return state.unregisteredFallbackBlockName;
6145  }
6146  /**
6147   * Returns the name of the block for handling unregistered blocks.
6148   *
6149   * @param {Object} state Data state.
6150   *
6151   * @return {string?} Name of the block for handling unregistered blocks.
6152   */
6153  
6154  function getGroupingBlockName(state) {
6155    return state.groupingBlockName;
6156  }
6157  /**
6158   * Returns an array with the child blocks of a given block.
6159   *
6160   * @param {Object} state     Data state.
6161   * @param {string} blockName Block type name.
6162   *
6163   * @return {Array} Array of child block names.
6164   */
6165  
6166  var selectors_getChildBlockNames = Object(rememo["a" /* default */])(function (state, blockName) {
6167    return Object(external_this_lodash_["map"])(Object(external_this_lodash_["filter"])(state.blockTypes, function (blockType) {
6168      return Object(external_this_lodash_["includes"])(blockType.parent, blockName);
6169    }), function (_ref) {
6170      var name = _ref.name;
6171      return name;
6172    });
6173  }, function (state) {
6174    return [state.blockTypes];
6175  });
6176  /**
6177   * Returns the block support value for a feature, if defined.
6178   *
6179   * @param  {Object}          state           Data state.
6180   * @param  {(string|Object)} nameOrType      Block name or type object
6181   * @param  {string}          feature         Feature to retrieve
6182   * @param  {*}               defaultSupports Default value to return if not
6183   *                                           explicitly defined
6184   *
6185   * @return {?*} Block support value
6186   */
6187  
6188  var selectors_getBlockSupport = function getBlockSupport(state, nameOrType, feature, defaultSupports) {
6189    var blockType = getNormalizedBlockType(state, nameOrType);
6190    return Object(external_this_lodash_["get"])(blockType, ['supports', feature], defaultSupports);
6191  };
6192  /**
6193   * Returns true if the block defines support for a feature, or false otherwise.
6194   *
6195   * @param  {Object}         state           Data state.
6196   * @param {(string|Object)} nameOrType      Block name or type object.
6197   * @param {string}          feature         Feature to test.
6198   * @param {boolean}         defaultSupports Whether feature is supported by
6199   *                                          default if not explicitly defined.
6200   *
6201   * @return {boolean} Whether block supports feature.
6202   */
6203  
6204  function hasBlockSupport(state, nameOrType, feature, defaultSupports) {
6205    return !!selectors_getBlockSupport(state, nameOrType, feature, defaultSupports);
6206  }
6207  /**
6208   * Returns true if the block type by the given name or object value matches a
6209   * search term, or false otherwise.
6210   *
6211   * @param {Object}          state      Blocks state.
6212   * @param {(string|Object)} nameOrType Block name or type object.
6213   * @param {string}          searchTerm Search term by which to filter.
6214   *
6215   * @return {Object[]} Whether block type matches search term.
6216   */
6217  
6218  function isMatchingSearchTerm(state, nameOrType, searchTerm) {
6219    var blockType = getNormalizedBlockType(state, nameOrType);
6220    var getNormalizedSearchTerm = Object(external_this_lodash_["flow"])([// Disregard diacritics.
6221    //  Input: "média"
6222    external_this_lodash_["deburr"], // Lowercase.
6223    //  Input: "MEDIA"
6224    function (term) {
6225      return term.toLowerCase();
6226    }, // Strip leading and trailing whitespace.
6227    //  Input: " media "
6228    function (term) {
6229      return term.trim();
6230    }]);
6231    var normalizedSearchTerm = getNormalizedSearchTerm(searchTerm);
6232    var isSearchMatch = Object(external_this_lodash_["flow"])([getNormalizedSearchTerm, function (normalizedCandidate) {
6233      return Object(external_this_lodash_["includes"])(normalizedCandidate, normalizedSearchTerm);
6234    }]);
6235    return isSearchMatch(blockType.title) || Object(external_this_lodash_["some"])(blockType.keywords, isSearchMatch) || isSearchMatch(blockType.category);
6236  }
6237  /**
6238   * Returns a boolean indicating if a block has child blocks or not.
6239   *
6240   * @param {Object} state     Data state.
6241   * @param {string} blockName Block type name.
6242   *
6243   * @return {boolean} True if a block contains child blocks and false otherwise.
6244   */
6245  
6246  var selectors_hasChildBlocks = function hasChildBlocks(state, blockName) {
6247    return selectors_getChildBlockNames(state, blockName).length > 0;
6248  };
6249  /**
6250   * Returns a boolean indicating if a block has at least one child block with inserter support.
6251   *
6252   * @param {Object} state     Data state.
6253   * @param {string} blockName Block type name.
6254   *
6255   * @return {boolean} True if a block contains at least one child blocks with inserter support
6256   *                   and false otherwise.
6257   */
6258  
6259  var selectors_hasChildBlocksWithInserterSupport = function hasChildBlocksWithInserterSupport(state, blockName) {
6260    return Object(external_this_lodash_["some"])(selectors_getChildBlockNames(state, blockName), function (childBlockName) {
6261      return hasBlockSupport(state, childBlockName, 'inserter', true);
6262    });
6263  };
6264  
6265  // CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/store/actions.js
6266  /**
6267   * External dependencies
6268   */
6269  
6270  /**
6271   * Returns an action object used in signalling that block types have been added.
6272   *
6273   * @param {Array|Object} blockTypes Block types received.
6274   *
6275   * @return {Object} Action object.
6276   */
6277  
6278  function addBlockTypes(blockTypes) {
6279    return {
6280      type: 'ADD_BLOCK_TYPES',
6281      blockTypes: Object(external_this_lodash_["castArray"])(blockTypes)
6282    };
6283  }
6284  /**
6285   * Returns an action object used to remove a registered block type.
6286   *
6287   * @param {string|Array} names Block name.
6288   *
6289   * @return {Object} Action object.
6290   */
6291  
6292  function removeBlockTypes(names) {
6293    return {
6294      type: 'REMOVE_BLOCK_TYPES',
6295      names: Object(external_this_lodash_["castArray"])(names)
6296    };
6297  }
6298  /**
6299   * Returns an action object used in signalling that new block styles have been added.
6300   *
6301   * @param {string}       blockName  Block name.
6302   * @param {Array|Object} styles     Block styles.
6303   *
6304   * @return {Object} Action object.
6305   */
6306  
6307  function addBlockStyles(blockName, styles) {
6308    return {
6309      type: 'ADD_BLOCK_STYLES',
6310      styles: Object(external_this_lodash_["castArray"])(styles),
6311      blockName: blockName
6312    };
6313  }
6314  /**
6315   * Returns an action object used in signalling that block styles have been removed.
6316   *
6317   * @param {string}       blockName  Block name.
6318   * @param {Array|string} styleNames Block style names.
6319   *
6320   * @return {Object} Action object.
6321   */
6322  
6323  function removeBlockStyles(blockName, styleNames) {
6324    return {
6325      type: 'REMOVE_BLOCK_STYLES',
6326      styleNames: Object(external_this_lodash_["castArray"])(styleNames),
6327      blockName: blockName
6328    };
6329  }
6330  /**
6331   * Returns an action object used in signalling that new block patterns have been added.
6332   *
6333   * @param {string}                          blockName Block name.
6334   * @param {WPBlockPattern|WPBlockPattern[]} patterns  Block patterns.
6335   *
6336   * @return {Object} Action object.
6337   */
6338  
6339  function __experimentalAddBlockPatterns(blockName, patterns) {
6340    return {
6341      type: 'ADD_BLOCK_PATTERNS',
6342      patterns: Object(external_this_lodash_["castArray"])(patterns),
6343      blockName: blockName
6344    };
6345  }
6346  /**
6347   * Returns an action object used in signalling that block patterns have been removed.
6348   *
6349   * @param {string}          blockName    Block name.
6350   * @param {string|string[]} patternNames Block pattern names.
6351   *
6352   * @return {Object} Action object.
6353   */
6354  
6355  function __experimentalRemoveBlockPatterns(blockName, patternNames) {
6356    return {
6357      type: 'REMOVE_BLOCK_PATTERNS',
6358      patternNames: Object(external_this_lodash_["castArray"])(patternNames),
6359      blockName: blockName
6360    };
6361  }
6362  /**
6363   * Returns an action object used to set the default block name.
6364   *
6365   * @param {string} name Block name.
6366   *
6367   * @return {Object} Action object.
6368   */
6369  
6370  function setDefaultBlockName(name) {
6371    return {
6372      type: 'SET_DEFAULT_BLOCK_NAME',
6373      name: name
6374    };
6375  }
6376  /**
6377   * Returns an action object used to set the name of the block used as a fallback
6378   * for non-block content.
6379   *
6380   * @param {string} name Block name.
6381   *
6382   * @return {Object} Action object.
6383   */
6384  
6385  function setFreeformFallbackBlockName(name) {
6386    return {
6387      type: 'SET_FREEFORM_FALLBACK_BLOCK_NAME',
6388      name: name
6389    };
6390  }
6391  /**
6392   * Returns an action object used to set the name of the block used as a fallback
6393   * for unregistered blocks.
6394   *
6395   * @param {string} name Block name.
6396   *
6397   * @return {Object} Action object.
6398   */
6399  
6400  function setUnregisteredFallbackBlockName(name) {
6401    return {
6402      type: 'SET_UNREGISTERED_FALLBACK_BLOCK_NAME',
6403      name: name
6404    };
6405  }
6406  /**
6407   * Returns an action object used to set the name of the block used
6408   * when grouping other blocks
6409   * eg: in "Group/Ungroup" interactions
6410   *
6411   * @param {string} name Block name.
6412   *
6413   * @return {Object} Action object.
6414   */
6415  
6416  function setGroupingBlockName(name) {
6417    return {
6418      type: 'SET_GROUPING_BLOCK_NAME',
6419      name: name
6420    };
6421  }
6422  /**
6423   * Returns an action object used to set block categories.
6424   *
6425   * @param {Object[]} categories Block categories.
6426   *
6427   * @return {Object} Action object.
6428   */
6429  
6430  function setCategories(categories) {
6431    return {
6432      type: 'SET_CATEGORIES',
6433      categories: categories
6434    };
6435  }
6436  /**
6437   * Returns an action object used to update a category.
6438   *
6439   * @param {string} slug     Block category slug.
6440   * @param {Object} category Object containing the category properties that should be updated.
6441   *
6442   * @return {Object} Action object.
6443   */
6444  
6445  function updateCategory(slug, category) {
6446    return {
6447      type: 'UPDATE_CATEGORY',
6448      slug: slug,
6449      category: category
6450    };
6451  }
6452  
6453  // CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/store/index.js
6454  /**
6455   * WordPress dependencies
6456   */
6457  
6458  /**
6459   * Internal dependencies
6460   */
6461  
6462  
6463  
6464  
6465  Object(external_this_wp_data_["registerStore"])('core/blocks', {
6466    reducer: reducer,
6467    selectors: selectors_namespaceObject,
6468    actions: actions_namespaceObject
6469  });
6470  
6471  // EXTERNAL MODULE: ./node_modules/uuid/v4.js
6472  var v4 = __webpack_require__(68);
6473  var v4_default = /*#__PURE__*/__webpack_require__.n(v4);
6474  
6475  // EXTERNAL MODULE: external {"this":["wp","hooks"]}
6476  var external_this_wp_hooks_ = __webpack_require__(29);
6477  
6478  // EXTERNAL MODULE: ./node_modules/tinycolor2/tinycolor.js
6479  var tinycolor = __webpack_require__(49);
6480  var tinycolor_default = /*#__PURE__*/__webpack_require__.n(tinycolor);
6481  
6482  // EXTERNAL MODULE: external {"this":["wp","element"]}
6483  var external_this_wp_element_ = __webpack_require__(0);
6484  
6485  // CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/utils.js
6486  
6487  
6488  /**
6489   * External dependencies
6490   */
6491  
6492  
6493  /**
6494   * WordPress dependencies
6495   */
6496  
6497  
6498  /**
6499   * Internal dependencies
6500   */
6501  
6502  
6503  
6504  /**
6505   * Array of icon colors containing a color to be used if the icon color
6506   * was not explicitly set but the icon background color was.
6507   *
6508   * @type {Object}
6509   */
6510  
6511  var ICON_COLORS = ['#191e23', '#f8f9f9'];
6512  /**
6513   * Determines whether the block is a default block
6514   * and its attributes are equal to the default attributes
6515   * which means the block is unmodified.
6516   *
6517   * @param  {WPBlock} block Block Object
6518   *
6519   * @return {boolean}       Whether the block is an unmodified default block
6520   */
6521  
6522  function isUnmodifiedDefaultBlock(block) {
6523    var defaultBlockName = registration_getDefaultBlockName();
6524  
6525    if (block.name !== defaultBlockName) {
6526      return false;
6527    } // Cache a created default block if no cache exists or the default block
6528    // name changed.
6529  
6530  
6531    if (!isUnmodifiedDefaultBlock.block || isUnmodifiedDefaultBlock.block.name !== defaultBlockName) {
6532      isUnmodifiedDefaultBlock.block = createBlock(defaultBlockName);
6533    }
6534  
6535    var newDefaultBlock = isUnmodifiedDefaultBlock.block;
6536    var blockType = registration_getBlockType(defaultBlockName);
6537    return Object(external_this_lodash_["every"])(blockType.attributes, function (value, key) {
6538      return newDefaultBlock.attributes[key] === block.attributes[key];
6539    });
6540  }
6541  /**
6542   * Function that checks if the parameter is a valid icon.
6543   *
6544   * @param {*} icon  Parameter to be checked.
6545   *
6546   * @return {boolean} True if the parameter is a valid icon and false otherwise.
6547   */
6548  
6549  function isValidIcon(icon) {
6550    return !!icon && (Object(external_this_lodash_["isString"])(icon) || Object(external_this_wp_element_["isValidElement"])(icon) || Object(external_this_lodash_["isFunction"])(icon) || icon instanceof external_this_wp_element_["Component"]);
6551  }
6552  /**
6553   * Function that receives an icon as set by the blocks during the registration
6554   * and returns a new icon object that is normalized so we can rely on just on possible icon structure
6555   * in the codebase.
6556   *
6557   * @param {WPBlockTypeIconRender} icon Render behavior of a block type icon;
6558   *                                     one of a Dashicon slug, an element, or a
6559   *                                     component.
6560   *
6561   * @return {WPBlockTypeIconDescriptor} Object describing the icon.
6562   */
6563  
6564  function normalizeIconObject(icon) {
6565    if (isValidIcon(icon)) {
6566      return {
6567        src: icon
6568      };
6569    }
6570  
6571    if (Object(external_this_lodash_["has"])(icon, ['background'])) {
6572      var tinyBgColor = tinycolor_default()(icon.background);
6573      return Object(objectSpread["a" /* default */])({}, icon, {
6574        foreground: icon.foreground ? icon.foreground : Object(tinycolor["mostReadable"])(tinyBgColor, ICON_COLORS, {
6575          includeFallbackColors: true,
6576          level: 'AA',
6577          size: 'large'
6578        }).toHexString(),
6579        shadowColor: tinyBgColor.setAlpha(0.3).toRgbString()
6580      });
6581    }
6582  
6583    return icon;
6584  }
6585  /**
6586   * Normalizes block type passed as param. When string is passed then
6587   * it converts it to the matching block type object.
6588   * It passes the original object otherwise.
6589   *
6590   * @param {string|Object} blockTypeOrName  Block type or name.
6591   *
6592   * @return {?Object} Block type.
6593   */
6594  
6595  function normalizeBlockType(blockTypeOrName) {
6596    if (Object(external_this_lodash_["isString"])(blockTypeOrName)) {
6597      return registration_getBlockType(blockTypeOrName);
6598    }
6599  
6600    return blockTypeOrName;
6601  }
6602  
6603  // CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/constants.js
6604  /**
6605   * Array of valid keys in a block type settings deprecation object.
6606   *
6607   * @type {string[]}
6608   */
6609  var DEPRECATED_ENTRY_KEYS = ['attributes', 'supports', 'save', 'migrate', 'isEligible'];
6610  
6611  // CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/registration.js
6612  
6613  
6614  /* eslint no-console: [ 'error', { allow: [ 'error' ] } ] */
6615  
6616  /**
6617   * External dependencies
6618   */
6619  
6620  /**
6621   * WordPress dependencies
6622   */
6623  
6624  
6625  
6626  /**
6627   * Internal dependencies
6628   */
6629  
6630  
6631  
6632  /**
6633   * An icon type definition. One of a Dashicon slug, an element,
6634   * or a component.
6635   *
6636   * @typedef {(string|WPElement|WPComponent)} WPIcon
6637   *
6638   * @see https://developer.wordpress.org/resource/dashicons/
6639   */
6640  
6641  /**
6642   * Render behavior of a block type icon; one of a Dashicon slug, an element,
6643   * or a component.
6644   *
6645   * @typedef {WPIcon} WPBlockTypeIconRender
6646   */
6647  
6648  /**
6649   * An object describing a normalized block type icon.
6650   *
6651   * @typedef {Object} WPBlockTypeIconDescriptor
6652   *
6653   * @property {WPBlockTypeIconRender} src         Render behavior of the icon,
6654   *                                               one of a Dashicon slug, an
6655   *                                               element, or a component.
6656   * @property {string}                background  Optimal background hex string
6657   *                                               color when displaying icon.
6658   * @property {string}                foreground  Optimal foreground hex string
6659   *                                               color when displaying icon.
6660   * @property {string}                shadowColor Optimal shadow hex string
6661   *                                               color when displaying icon.
6662   */
6663  
6664  /**
6665   * Value to use to render the icon for a block type in an editor interface,
6666   * either a Dashicon slug, an element, a component, or an object describing
6667   * the icon.
6668   *
6669   * @typedef {(WPBlockTypeIconDescriptor|WPBlockTypeIconRender)} WPBlockTypeIcon
6670   */
6671  
6672  /**
6673   * An object describing a pattern defined for the block type.
6674   *
6675   * @typedef {Object} WPBlockPattern
6676   *
6677   * @property {string}  name          The unique and machine-readable name.
6678   * @property {string}  label         A human-readable label.
6679   * @property {WPIcon}  [icon]        An icon helping to visualize the pattern.
6680   * @property {boolean} [isDefault]   Indicates whether the current pattern is the default one.
6681   *                                   Defaults to `false`.
6682   * @property {Object}  [attributes]  Values which override block attributes.
6683   * @property {Array[]} [innerBlocks] Initial configuration of nested blocks.
6684   */
6685  
6686  /**
6687   * Defined behavior of a block type.
6688   *
6689   * @typedef {Object} WPBlock
6690   *
6691   * @property {string}           name         Block type's namespaced name.
6692   * @property {string}           title        Human-readable block type label.
6693   * @property {string}           category     Block type category classification,
6694   *                                           used in search interfaces to arrange
6695   *                                           block types by category.
6696   * @property {WPBlockTypeIcon}  [icon]       Block type icon.
6697   * @property {string[]}         [keywords]   Additional keywords to produce block
6698   *                                           type as result in search interfaces.
6699   * @property {Object}           [attributes] Block type attributes.
6700   * @property {WPComponent}      [save]       Optional component describing
6701   *                                           serialized markup structure of a
6702   *                                           block type.
6703   * @property {WPComponent}      edit         Component rendering an element to
6704   *                                           manipulate the attributes of a block
6705   *                                           in the context of an editor.
6706   * @property {WPBlockPattern[]} [patterns]   The list of block patterns.
6707   */
6708  
6709  /**
6710   * Default values to assign for omitted optional block type settings.
6711   *
6712   * @type {Object}
6713   */
6714  
6715  var DEFAULT_BLOCK_TYPE_SETTINGS = {
6716    icon: 'block-default',
6717    attributes: {},
6718    keywords: [],
6719    save: function save() {
6720      return null;
6721    }
6722  };
6723  var serverSideBlockDefinitions = {};
6724  /**
6725   * Sets the server side block definition of blocks.
6726   *
6727   * @param {Object} definitions Server-side block definitions
6728   */
6729  
6730  function unstable__bootstrapServerSideBlockDefinitions(definitions) {
6731    // eslint-disable-line camelcase
6732    serverSideBlockDefinitions = Object(objectSpread["a" /* default */])({}, serverSideBlockDefinitions, definitions);
6733  }
6734  /**
6735   * Registers a new block provided a unique name and an object defining its
6736   * behavior. Once registered, the block is made available as an option to any
6737   * editor interface where blocks are implemented.
6738   *
6739   * @param {string} name     Block name.
6740   * @param {Object} settings Block settings.
6741   *
6742   * @return {?WPBlock} The block, if it has been successfully registered;
6743   *                    otherwise `undefined`.
6744   */
6745  
6746  function registerBlockType(name, settings) {
6747    settings = Object(objectSpread["a" /* default */])({
6748      name: name
6749    }, DEFAULT_BLOCK_TYPE_SETTINGS, Object(external_this_lodash_["get"])(serverSideBlockDefinitions, name), settings);
6750  
6751    if (typeof name !== 'string') {
6752      console.error('Block names must be strings.');
6753      return;
6754    }
6755  
6756    if (!/^[a-z][a-z0-9-]*\/[a-z][a-z0-9-]*$/.test(name)) {
6757      console.error('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');
6758      return;
6759    }
6760  
6761    if (Object(external_this_wp_data_["select"])('core/blocks').getBlockType(name)) {
6762      console.error('Block "' + name + '" is already registered.');
6763      return;
6764    }
6765  
6766    var preFilterSettings = Object(objectSpread["a" /* default */])({}, settings);
6767  
6768    settings = Object(external_this_wp_hooks_["applyFilters"])('blocks.registerBlockType', settings, name);
6769  
6770    if (settings.deprecated) {
6771      settings.deprecated = settings.deprecated.map(function (deprecation) {
6772        return Object(external_this_lodash_["pick"])( // Only keep valid deprecation keys.
6773        Object(external_this_wp_hooks_["applyFilters"])('blocks.registerBlockType', // Merge deprecation keys with pre-filter settings
6774        // so that filters that depend on specific keys being
6775        // present don't fail.
6776        Object(objectSpread["a" /* default */])({}, Object(external_this_lodash_["omit"])(preFilterSettings, DEPRECATED_ENTRY_KEYS), deprecation), name), DEPRECATED_ENTRY_KEYS);
6777      });
6778    }
6779  
6780    if (!Object(external_this_lodash_["isPlainObject"])(settings)) {
6781      console.error('Block settings must be a valid object.');
6782      return;
6783    }
6784  
6785    if (!Object(external_this_lodash_["isFunction"])(settings.save)) {
6786      console.error('The "save" property must be a valid function.');
6787      return;
6788    }
6789  
6790    if ('edit' in settings && !Object(external_this_lodash_["isFunction"])(settings.edit)) {
6791      console.error('The "edit" property must be a valid function.');
6792      return;
6793    }
6794  
6795    if (!('category' in settings)) {
6796      console.error('The block "' + name + '" must have a category.');
6797      return;
6798    }
6799  
6800    if ('category' in settings && !Object(external_this_lodash_["some"])(Object(external_this_wp_data_["select"])('core/blocks').getCategories(), {
6801      slug: settings.category
6802    })) {
6803      console.error('The block "' + name + '" must have a registered category.');
6804      return;
6805    }
6806  
6807    if (!('title' in settings) || settings.title === '') {
6808      console.error('The block "' + name + '" must have a title.');
6809      return;
6810    }
6811  
6812    if (typeof settings.title !== 'string') {
6813      console.error('Block titles must be strings.');
6814      return;
6815    }
6816  
6817    settings.icon = normalizeIconObject(settings.icon);
6818  
6819    if (!isValidIcon(settings.icon.src)) {
6820      console.error('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');
6821      return;
6822    }
6823  
6824    Object(external_this_wp_data_["dispatch"])('core/blocks').addBlockTypes(settings);
6825    return settings;
6826  }
6827  /**
6828   * Unregisters a block.
6829   *
6830   * @param {string} name Block name.
6831   *
6832   * @return {?WPBlock} The previous block value, if it has been successfully
6833   *                    unregistered; otherwise `undefined`.
6834   */
6835  
6836  function unregisterBlockType(name) {
6837    var oldBlock = Object(external_this_wp_data_["select"])('core/blocks').getBlockType(name);
6838  
6839    if (!oldBlock) {
6840      console.error('Block "' + name + '" is not registered.');
6841      return;
6842    }
6843  
6844    Object(external_this_wp_data_["dispatch"])('core/blocks').removeBlockTypes(name);
6845    return oldBlock;
6846  }
6847  /**
6848   * Assigns name of block for handling non-block content.
6849   *
6850   * @param {string} blockName Block name.
6851   */
6852  
6853  function setFreeformContentHandlerName(blockName) {
6854    Object(external_this_wp_data_["dispatch"])('core/blocks').setFreeformFallbackBlockName(blockName);
6855  }
6856  /**
6857   * Retrieves name of block handling non-block content, or undefined if no
6858   * handler has been defined.
6859   *
6860   * @return {?string} Block name.
6861   */
6862  
6863  function getFreeformContentHandlerName() {
6864    return Object(external_this_wp_data_["select"])('core/blocks').getFreeformFallbackBlockName();
6865  }
6866  /**
6867   * Retrieves name of block used for handling grouping interactions.
6868   *
6869   * @return {?string} Block name.
6870   */
6871  
6872  function registration_getGroupingBlockName() {
6873    return Object(external_this_wp_data_["select"])('core/blocks').getGroupingBlockName();
6874  }
6875  /**
6876   * Assigns name of block handling unregistered block types.
6877   *
6878   * @param {string} blockName Block name.
6879   */
6880  
6881  function setUnregisteredTypeHandlerName(blockName) {
6882    Object(external_this_wp_data_["dispatch"])('core/blocks').setUnregisteredFallbackBlockName(blockName);
6883  }
6884  /**
6885   * Retrieves name of block handling unregistered block types, or undefined if no
6886   * handler has been defined.
6887   *
6888   * @return {?string} Block name.
6889   */
6890  
6891  function getUnregisteredTypeHandlerName() {
6892    return Object(external_this_wp_data_["select"])('core/blocks').getUnregisteredFallbackBlockName();
6893  }
6894  /**
6895   * Assigns the default block name.
6896   *
6897   * @param {string} name Block name.
6898   */
6899  
6900  function registration_setDefaultBlockName(name) {
6901    Object(external_this_wp_data_["dispatch"])('core/blocks').setDefaultBlockName(name);
6902  }
6903  /**
6904   * Assigns name of block for handling block grouping interactions.
6905   *
6906   * @param {string} name Block name.
6907   */
6908  
6909  function registration_setGroupingBlockName(name) {
6910    Object(external_this_wp_data_["dispatch"])('core/blocks').setGroupingBlockName(name);
6911  }
6912  /**
6913   * Retrieves the default block name.
6914   *
6915   * @return {?string} Block name.
6916   */
6917  
6918  function registration_getDefaultBlockName() {
6919    return Object(external_this_wp_data_["select"])('core/blocks').getDefaultBlockName();
6920  }
6921  /**
6922   * Returns a registered block type.
6923   *
6924   * @param {string} name Block name.
6925   *
6926   * @return {?Object} Block type.
6927   */
6928  
6929  function registration_getBlockType(name) {
6930    return Object(external_this_wp_data_["select"])('core/blocks').getBlockType(name);
6931  }
6932  /**
6933   * Returns all registered blocks.
6934   *
6935   * @return {Array} Block settings.
6936   */
6937  
6938  function registration_getBlockTypes() {
6939    return Object(external_this_wp_data_["select"])('core/blocks').getBlockTypes();
6940  }
6941  /**
6942   * Returns the block support value for a feature, if defined.
6943   *
6944   * @param  {(string|Object)} nameOrType      Block name or type object
6945   * @param  {string}          feature         Feature to retrieve
6946   * @param  {*}               defaultSupports Default value to return if not
6947   *                                           explicitly defined
6948   *
6949   * @return {?*} Block support value
6950   */
6951  
6952  function registration_getBlockSupport(nameOrType, feature, defaultSupports) {
6953    return Object(external_this_wp_data_["select"])('core/blocks').getBlockSupport(nameOrType, feature, defaultSupports);
6954  }
6955  /**
6956   * Returns true if the block defines support for a feature, or false otherwise.
6957   *
6958   * @param {(string|Object)} nameOrType      Block name or type object.
6959   * @param {string}          feature         Feature to test.
6960   * @param {boolean}         defaultSupports Whether feature is supported by
6961   *                                          default if not explicitly defined.
6962   *
6963   * @return {boolean} Whether block supports feature.
6964   */
6965  
6966  function registration_hasBlockSupport(nameOrType, feature, defaultSupports) {
6967    return Object(external_this_wp_data_["select"])('core/blocks').hasBlockSupport(nameOrType, feature, defaultSupports);
6968  }
6969  /**
6970   * Determines whether or not the given block is a reusable block. This is a
6971   * special block type that is used to point to a global block stored via the
6972   * API.
6973   *
6974   * @param {Object} blockOrType Block or Block Type to test.
6975   *
6976   * @return {boolean} Whether the given block is a reusable block.
6977   */
6978  
6979  function isReusableBlock(blockOrType) {
6980    return blockOrType.name === 'core/block';
6981  }
6982  /**
6983   * Returns an array with the child blocks of a given block.
6984   *
6985   * @param {string} blockName Name of block (example: “latest-posts”).
6986   *
6987   * @return {Array} Array of child block names.
6988   */
6989  
6990  var registration_getChildBlockNames = function getChildBlockNames(blockName) {
6991    return Object(external_this_wp_data_["select"])('core/blocks').getChildBlockNames(blockName);
6992  };
6993  /**
6994   * Returns a boolean indicating if a block has child blocks or not.
6995   *
6996   * @param {string} blockName Name of block (example: “latest-posts”).
6997   *
6998   * @return {boolean} True if a block contains child blocks and false otherwise.
6999   */
7000  
7001  var registration_hasChildBlocks = function hasChildBlocks(blockName) {
7002    return Object(external_this_wp_data_["select"])('core/blocks').hasChildBlocks(blockName);
7003  };
7004  /**
7005   * Returns a boolean indicating if a block has at least one child block with inserter support.
7006   *
7007   * @param {string} blockName Block type name.
7008   *
7009   * @return {boolean} True if a block contains at least one child blocks with inserter support
7010   *                   and false otherwise.
7011   */
7012  
7013  var registration_hasChildBlocksWithInserterSupport = function hasChildBlocksWithInserterSupport(blockName) {
7014    return Object(external_this_wp_data_["select"])('core/blocks').hasChildBlocksWithInserterSupport(blockName);
7015  };
7016  /**
7017   * Registers a new block style variation for the given block.
7018   *
7019   * @param {string} blockName      Name of block (example: “core/latest-posts”).
7020   * @param {Object} styleVariation Object containing `name` which is the class name applied to the block and `label` which identifies the variation to the user.
7021   */
7022  
7023  var registration_registerBlockStyle = function registerBlockStyle(blockName, styleVariation) {
7024    Object(external_this_wp_data_["dispatch"])('core/blocks').addBlockStyles(blockName, styleVariation);
7025  };
7026  /**
7027   * Unregisters a block style variation for the given block.
7028   *
7029   * @param {string} blockName          Name of block (example: “core/latest-posts”).
7030   * @param {string} styleVariationName Name of class applied to the block.
7031   */
7032  
7033  var registration_unregisterBlockStyle = function unregisterBlockStyle(blockName, styleVariationName) {
7034    Object(external_this_wp_data_["dispatch"])('core/blocks').removeBlockStyles(blockName, styleVariationName);
7035  };
7036  /**
7037   * Registers a new block pattern for the given block.
7038   *
7039   * @param {string}         blockName Name of the block (example: “core/columns”).
7040   * @param {WPBlockPattern} pattern   Object describing a block pattern.
7041   */
7042  
7043  var registration_experimentalRegisterBlockPattern = function __experimentalRegisterBlockPattern(blockName, pattern) {
7044    Object(external_this_wp_data_["dispatch"])('core/blocks').__experimentalAddBlockPatterns(blockName, pattern);
7045  };
7046  /**
7047   * Unregisters a block pattern defined for the given block.
7048   *
7049   * @param {string} blockName   Name of the block (example: “core/columns”).
7050   * @param {string} patternName Name of the pattern defined for the block.
7051   */
7052  
7053  var registration_experimentalUnregisterBlockPattern = function __experimentalUnregisterBlockPattern(blockName, patternName) {
7054    Object(external_this_wp_data_["dispatch"])('core/blocks').__experimentalRemoveBlockPatterns(blockName, patternName);
7055  };
7056  
7057  // CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/factory.js
7058  
7059  
7060  
7061  /**
7062   * External dependencies
7063   */
7064  
7065  
7066  /**
7067   * WordPress dependencies
7068   */
7069  
7070  
7071  /**
7072   * Internal dependencies
7073   */
7074  
7075  
7076  
7077  /**
7078   * Returns a block object given its type and attributes.
7079   *
7080   * @param {string} name        Block name.
7081   * @param {Object} attributes  Block attributes.
7082   * @param {?Array} innerBlocks Nested blocks.
7083   *
7084   * @return {Object} Block object.
7085   */
7086  
7087  function createBlock(name) {
7088    var attributes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
7089    var innerBlocks = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
7090    // Get the type definition associated with a registered block.
7091    var blockType = registration_getBlockType(name); // Ensure attributes contains only values defined by block type, and merge
7092    // default values for missing attributes.
7093  
7094    var sanitizedAttributes = Object(external_this_lodash_["reduce"])(blockType.attributes, function (accumulator, schema, key) {
7095      var value = attributes[key];
7096  
7097      if (undefined !== value) {
7098        accumulator[key] = value;
7099      } else if (schema.hasOwnProperty('default')) {
7100        accumulator[key] = schema.default;
7101      }
7102  
7103      if (['node', 'children'].indexOf(schema.source) !== -1) {
7104        // Ensure value passed is always an array, which we're expecting in
7105        // the RichText component to handle the deprecated value.
7106        if (typeof accumulator[key] === 'string') {
7107          accumulator[key] = [accumulator[key]];
7108        } else if (!Array.isArray(accumulator[key])) {
7109          accumulator[key] = [];
7110        }
7111      }
7112  
7113      return accumulator;
7114    }, {});
7115    var clientId = v4_default()(); // Blocks are stored with a unique ID, the assigned type name, the block
7116    // attributes, and their inner blocks.
7117  
7118    return {
7119      clientId: clientId,
7120      name: name,
7121      isValid: true,
7122      attributes: sanitizedAttributes,
7123      innerBlocks: innerBlocks
7124    };
7125  }
7126  /**
7127   * Given a block object, returns a copy of the block object, optionally merging
7128   * new attributes and/or replacing its inner blocks.
7129   *
7130   * @param {Object} block              Block instance.
7131   * @param {Object} mergeAttributes    Block attributes.
7132   * @param {?Array} newInnerBlocks     Nested blocks.
7133   *
7134   * @return {Object} A cloned block.
7135   */
7136  
7137  function cloneBlock(block) {
7138    var mergeAttributes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
7139    var newInnerBlocks = arguments.length > 2 ? arguments[2] : undefined;
7140    var clientId = v4_default()();
7141    return Object(objectSpread["a" /* default */])({}, block, {
7142      clientId: clientId,
7143      attributes: Object(objectSpread["a" /* default */])({}, block.attributes, mergeAttributes),
7144      innerBlocks: newInnerBlocks || block.innerBlocks.map(function (innerBlock) {
7145        return cloneBlock(innerBlock);
7146      })
7147    });
7148  }
7149  /**
7150   * Returns a boolean indicating whether a transform is possible based on
7151   * various bits of context.
7152   *
7153   * @param {Object} transform The transform object to validate.
7154   * @param {string} direction Is this a 'from' or 'to' transform.
7155   * @param {Array} blocks The blocks to transform from.
7156   *
7157   * @return {boolean} Is the transform possible?
7158   */
7159  
7160  var factory_isPossibleTransformForSource = function isPossibleTransformForSource(transform, direction, blocks) {
7161    if (Object(external_this_lodash_["isEmpty"])(blocks)) {
7162      return false;
7163    } // If multiple blocks are selected, only multi block transforms
7164    // or wildcard transforms are allowed.
7165  
7166  
7167    var isMultiBlock = blocks.length > 1;
7168    var firstBlockName = Object(external_this_lodash_["first"])(blocks).name;
7169    var isValidForMultiBlocks = isWildcardBlockTransform(transform) || !isMultiBlock || transform.isMultiBlock;
7170  
7171    if (!isValidForMultiBlocks) {
7172      return false;
7173    } // Check non-wildcard transforms to ensure that transform is valid
7174    // for a block selection of multiple blocks of different types
7175  
7176  
7177    if (!isWildcardBlockTransform(transform) && !Object(external_this_lodash_["every"])(blocks, {
7178      name: firstBlockName
7179    })) {
7180      return false;
7181    } // Only consider 'block' type transforms as valid.
7182  
7183  
7184    var isBlockType = transform.type === 'block';
7185  
7186    if (!isBlockType) {
7187      return false;
7188    } // Check if the transform's block name matches the source block (or is a wildcard)
7189    // only if this is a transform 'from'.
7190  
7191  
7192    var sourceBlock = Object(external_this_lodash_["first"])(blocks);
7193    var hasMatchingName = direction !== 'from' || transform.blocks.indexOf(sourceBlock.name) !== -1 || isWildcardBlockTransform(transform);
7194  
7195    if (!hasMatchingName) {
7196      return false;
7197    } // Don't allow single Grouping blocks to be transformed into
7198    // a Grouping block.
7199  
7200  
7201    if (!isMultiBlock && factory_isContainerGroupBlock(sourceBlock.name) && factory_isContainerGroupBlock(transform.blockName)) {
7202      return false;
7203    } // If the transform has a `isMatch` function specified, check that it returns true.
7204  
7205  
7206    if (Object(external_this_lodash_["isFunction"])(transform.isMatch)) {
7207      var attributes = transform.isMultiBlock ? blocks.map(function (block) {
7208        return block.attributes;
7209      }) : sourceBlock.attributes;
7210  
7211      if (!transform.isMatch(attributes)) {
7212        return false;
7213      }
7214    }
7215  
7216    return true;
7217  };
7218  /**
7219   * Returns block types that the 'blocks' can be transformed into, based on
7220   * 'from' transforms on other blocks.
7221   *
7222   * @param {Array}  blocks  The blocks to transform from.
7223   *
7224   * @return {Array} Block types that the blocks can be transformed into.
7225   */
7226  
7227  
7228  var factory_getBlockTypesForPossibleFromTransforms = function getBlockTypesForPossibleFromTransforms(blocks) {
7229    if (Object(external_this_lodash_["isEmpty"])(blocks)) {
7230      return [];
7231    }
7232  
7233    var allBlockTypes = registration_getBlockTypes(); // filter all blocks to find those with a 'from' transform.
7234  
7235    var blockTypesWithPossibleFromTransforms = Object(external_this_lodash_["filter"])(allBlockTypes, function (blockType) {
7236      var fromTransforms = getBlockTransforms('from', blockType.name);
7237      return !!findTransform(fromTransforms, function (transform) {
7238        return factory_isPossibleTransformForSource(transform, 'from', blocks);
7239      });
7240    });
7241    return blockTypesWithPossibleFromTransforms;
7242  };
7243  /**
7244   * Returns block types that the 'blocks' can be transformed into, based on
7245   * the source block's own 'to' transforms.
7246   *
7247   * @param {Array} blocks The blocks to transform from.
7248   *
7249   * @return {Array} Block types that the source can be transformed into.
7250   */
7251  
7252  
7253  var factory_getBlockTypesForPossibleToTransforms = function getBlockTypesForPossibleToTransforms(blocks) {
7254    if (Object(external_this_lodash_["isEmpty"])(blocks)) {
7255      return [];
7256    }
7257  
7258    var sourceBlock = Object(external_this_lodash_["first"])(blocks);
7259    var blockType = registration_getBlockType(sourceBlock.name);
7260    var transformsTo = getBlockTransforms('to', blockType.name); // filter all 'to' transforms to find those that are possible.
7261  
7262    var possibleTransforms = Object(external_this_lodash_["filter"])(transformsTo, function (transform) {
7263      return transform && factory_isPossibleTransformForSource(transform, 'to', blocks);
7264    }); // Build a list of block names using the possible 'to' transforms.
7265  
7266    var blockNames = Object(external_this_lodash_["flatMap"])(possibleTransforms, function (transformation) {
7267      return transformation.blocks;
7268    }); // Map block names to block types.
7269  
7270    return blockNames.map(function (name) {
7271      return registration_getBlockType(name);
7272    });
7273  };
7274  /**
7275   * Determines whether transform is a "block" type
7276   * and if so whether it is a "wildcard" transform
7277   * ie: targets "any" block type
7278   *
7279   * @param {Object} t the Block transform object
7280   *
7281   * @return {boolean} whether transform is a wildcard transform
7282   */
7283  
7284  
7285  var isWildcardBlockTransform = function isWildcardBlockTransform(t) {
7286    return t && t.type === 'block' && Array.isArray(t.blocks) && t.blocks.includes('*');
7287  };
7288  /**
7289   * Determines whether the given Block is the core Block which
7290   * acts as a container Block for other Blocks as part of the
7291   * Grouping mechanics
7292   *
7293   * @param  {string} name the name of the Block to test against
7294   *
7295   * @return {boolean} whether or not the Block is the container Block type
7296   */
7297  
7298  var factory_isContainerGroupBlock = function isContainerGroupBlock(name) {
7299    return name === registration_getGroupingBlockName();
7300  };
7301  /**
7302   * Determines whether the provided Blocks are of the same type
7303   * (eg: all `core/paragraph`).
7304   *
7305   * @param  {Array}  blocksArray the Block definitions
7306   *
7307   * @return {boolean} whether or not the given Blocks pass the criteria
7308   */
7309  
7310  var factory_isBlockSelectionOfSameType = function isBlockSelectionOfSameType() {
7311    var blocksArray = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
7312  
7313    if (!blocksArray.length) {
7314      return false;
7315    }
7316  
7317    var sourceName = blocksArray[0].name;
7318    return Object(external_this_lodash_["every"])(blocksArray, ['name', sourceName]);
7319  };
7320  /**
7321   * Returns an array of block types that the set of blocks received as argument
7322   * can be transformed into.
7323   *
7324   * @param {Array} blocks Blocks array.
7325   *
7326   * @return {Array} Block types that the blocks argument can be transformed to.
7327   */
7328  
7329  function getPossibleBlockTransformations(blocks) {
7330    if (Object(external_this_lodash_["isEmpty"])(blocks)) {
7331      return [];
7332    }
7333  
7334    var blockTypesForFromTransforms = factory_getBlockTypesForPossibleFromTransforms(blocks);
7335    var blockTypesForToTransforms = factory_getBlockTypesForPossibleToTransforms(blocks);
7336    return Object(external_this_lodash_["uniq"])([].concat(Object(toConsumableArray["a" /* default */])(blockTypesForFromTransforms), Object(toConsumableArray["a" /* default */])(blockTypesForToTransforms)));
7337  }
7338  /**
7339   * Given an array of transforms, returns the highest-priority transform where
7340   * the predicate function returns a truthy value. A higher-priority transform
7341   * is one with a lower priority value (i.e. first in priority order). Returns
7342   * null if the transforms set is empty or the predicate function returns a
7343   * falsey value for all entries.
7344   *
7345   * @param {Object[]} transforms Transforms to search.
7346   * @param {Function} predicate  Function returning true on matching transform.
7347   *
7348   * @return {?Object} Highest-priority transform candidate.
7349   */
7350  
7351  function findTransform(transforms, predicate) {
7352    // The hooks library already has built-in mechanisms for managing priority
7353    // queue, so leverage via locally-defined instance.
7354    var hooks = Object(external_this_wp_hooks_["createHooks"])();
7355  
7356    var _loop = function _loop(i) {
7357      var candidate = transforms[i];
7358  
7359      if (predicate(candidate)) {
7360        hooks.addFilter('transform', 'transform/' + i.toString(), function (result) {
7361          return result ? result : candidate;
7362        }, candidate.priority);
7363      }
7364    };
7365  
7366    for (var i = 0; i < transforms.length; i++) {
7367      _loop(i);
7368    } // Filter name is arbitrarily chosen but consistent with above aggregation.
7369  
7370  
7371    return hooks.applyFilters('transform', null);
7372  }
7373  /**
7374   * Returns normal block transforms for a given transform direction, optionally
7375   * for a specific block by name, or an empty array if there are no transforms.
7376   * If no block name is provided, returns transforms for all blocks. A normal
7377   * transform object includes `blockName` as a property.
7378   *
7379   * @param {string}  direction Transform direction ("to", "from").
7380   * @param {string|Object} blockTypeOrName  Block type or name.
7381   *
7382   * @return {Array} Block transforms for direction.
7383   */
7384  
7385  function getBlockTransforms(direction, blockTypeOrName) {
7386    // When retrieving transforms for all block types, recurse into self.
7387    if (blockTypeOrName === undefined) {
7388      return Object(external_this_lodash_["flatMap"])(registration_getBlockTypes(), function (_ref) {
7389        var name = _ref.name;
7390        return getBlockTransforms(direction, name);
7391      });
7392    } // Validate that block type exists and has array of direction.
7393  
7394  
7395    var blockType = normalizeBlockType(blockTypeOrName);
7396  
7397    var _ref2 = blockType || {},
7398        blockName = _ref2.name,
7399        transforms = _ref2.transforms;
7400  
7401    if (!transforms || !Array.isArray(transforms[direction])) {
7402      return [];
7403    } // Map transforms to normal form.
7404  
7405  
7406    return transforms[direction].map(function (transform) {
7407      return Object(objectSpread["a" /* default */])({}, transform, {
7408        blockName: blockName
7409      });
7410    });
7411  }
7412  /**
7413   * Switch one or more blocks into one or more blocks of the new block type.
7414   *
7415   * @param {Array|Object} blocks Blocks array or block object.
7416   * @param {string}       name   Block name.
7417   *
7418   * @return {?Array} Array of blocks or null.
7419   */
7420  
7421  function switchToBlockType(blocks, name) {
7422    var blocksArray = Object(external_this_lodash_["castArray"])(blocks);
7423    var isMultiBlock = blocksArray.length > 1;
7424    var firstBlock = blocksArray[0];
7425    var sourceName = firstBlock.name; // Unless it's a Grouping Block then for multi block selections
7426    // check that all Blocks are of the same type otherwise
7427    // we can't run a conversion
7428  
7429    if (!factory_isContainerGroupBlock(name) && isMultiBlock && !factory_isBlockSelectionOfSameType(blocksArray)) {
7430      return null;
7431    } // Find the right transformation by giving priority to the "to"
7432    // transformation.
7433  
7434  
7435    var transformationsFrom = getBlockTransforms('from', name);
7436    var transformationsTo = getBlockTransforms('to', sourceName);
7437    var transformation = findTransform(transformationsTo, function (t) {
7438      return t.type === 'block' && (isWildcardBlockTransform(t) || t.blocks.indexOf(name) !== -1) && (!isMultiBlock || t.isMultiBlock);
7439    }) || findTransform(transformationsFrom, function (t) {
7440      return t.type === 'block' && (isWildcardBlockTransform(t) || t.blocks.indexOf(sourceName) !== -1) && (!isMultiBlock || t.isMultiBlock);
7441    }); // Stop if there is no valid transformation.
7442  
7443    if (!transformation) {
7444      return null;
7445    }
7446  
7447    var transformationResults;
7448  
7449    if (transformation.isMultiBlock) {
7450      if (Object(external_this_lodash_["has"])(transformation, '__experimentalConvert')) {
7451        transformationResults = transformation.__experimentalConvert(blocksArray);
7452      } else {
7453        transformationResults = transformation.transform(blocksArray.map(function (currentBlock) {
7454          return currentBlock.attributes;
7455        }), blocksArray.map(function (currentBlock) {
7456          return currentBlock.innerBlocks;
7457        }));
7458      }
7459    } else if (Object(external_this_lodash_["has"])(transformation, '__experimentalConvert')) {
7460      transformationResults = transformation.__experimentalConvert(firstBlock);
7461    } else {
7462      transformationResults = transformation.transform(firstBlock.attributes, firstBlock.innerBlocks);
7463    } // Ensure that the transformation function returned an object or an array
7464    // of objects.
7465  
7466  
7467    if (!Object(external_this_lodash_["isObjectLike"])(transformationResults)) {
7468      return null;
7469    } // If the transformation function returned a single object, we want to work
7470    // with an array instead.
7471  
7472  
7473    transformationResults = Object(external_this_lodash_["castArray"])(transformationResults); // Ensure that every block object returned by the transformation has a
7474    // valid block type.
7475  
7476    if (transformationResults.some(function (result) {
7477      return !registration_getBlockType(result.name);
7478    })) {
7479      return null;
7480    }
7481  
7482    var firstSwitchedBlock = Object(external_this_lodash_["findIndex"])(transformationResults, function (result) {
7483      return result.name === name;
7484    }); // Ensure that at least one block object returned by the transformation has
7485    // the expected "destination" block type.
7486  
7487    if (firstSwitchedBlock < 0) {
7488      return null;
7489    }
7490  
7491    return transformationResults.map(function (result, index) {
7492      var transformedBlock = Object(objectSpread["a" /* default */])({}, result, {
7493        // The first transformed block whose type matches the "destination"
7494        // type gets to keep the existing client ID of the first block.
7495        clientId: index === firstSwitchedBlock ? firstBlock.clientId : result.clientId
7496      });
7497      /**
7498       * Filters an individual transform result from block transformation.
7499       * All of the original blocks are passed, since transformations are
7500       * many-to-many, not one-to-one.
7501       *
7502       * @param {Object}   transformedBlock The transformed block.
7503       * @param {Object[]} blocks           Original blocks transformed.
7504       */
7505  
7506  
7507      return Object(external_this_wp_hooks_["applyFilters"])('blocks.switchToBlockType.transformedBlock', transformedBlock, blocks);
7508    });
7509  }
7510  /**
7511   * Create a block object from the example API.
7512   *
7513   * @param {string} name
7514   * @param {Object} example
7515   *
7516   * @return {Object} block.
7517   */
7518  
7519  var factory_getBlockFromExample = function getBlockFromExample(name, example) {
7520    return createBlock(name, example.attributes, Object(external_this_lodash_["map"])(example.innerBlocks, function (innerBlock) {
7521      return getBlockFromExample(innerBlock.name, innerBlock);
7522    }));
7523  };
7524  
7525  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js + 1 modules
7526  var slicedToArray = __webpack_require__(22);
7527  
7528  // CONCATENATED MODULE: ./node_modules/hpq/es/get-path.js
7529  /**
7530   * Given object and string of dot-delimited path segments, returns value at
7531   * path or undefined if path cannot be resolved.
7532   *
7533   * @param  {Object} object Lookup object
7534   * @param  {string} path   Path to resolve
7535   * @return {?*}            Resolved value
7536   */
7537  function getPath(object, path) {
7538    var segments = path.split('.');
7539    var segment;
7540  
7541    while (segment = segments.shift()) {
7542      if (!(segment in object)) {
7543        return;
7544      }
7545  
7546      object = object[segment];
7547    }
7548  
7549    return object;
7550  }
7551  // CONCATENATED MODULE: ./node_modules/hpq/es/index.js
7552  /**
7553   * Internal dependencies
7554   */
7555  
7556  /**
7557   * Function returning a DOM document created by `createHTMLDocument`. The same
7558   * document is returned between invocations.
7559   *
7560   * @return {Document} DOM document.
7561   */
7562  
7563  var getDocument = function () {
7564    var doc;
7565    return function () {
7566      if (!doc) {
7567        doc = document.implementation.createHTMLDocument('');
7568      }
7569  
7570      return doc;
7571    };
7572  }();
7573  /**
7574   * Given a markup string or DOM element, creates an object aligning with the
7575   * shape of the matchers object, or the value returned by the matcher.
7576   *
7577   * @param  {(string|Element)}  source   Source content
7578   * @param  {(Object|Function)} matchers Matcher function or object of matchers
7579   * @return {(Object|*)}                 Matched value(s), shaped by object
7580   */
7581  
7582  
7583  function es_parse(source, matchers) {
7584    if (!matchers) {
7585      return;
7586    } // Coerce to element
7587  
7588  
7589    if ('string' === typeof source) {
7590      var doc = getDocument();
7591      doc.body.innerHTML = source;
7592      source = doc.body;
7593    } // Return singular value
7594  
7595  
7596    if ('function' === typeof matchers) {
7597      return matchers(source);
7598    } // Bail if we can't handle matchers
7599  
7600  
7601    if (Object !== matchers.constructor) {
7602      return;
7603    } // Shape result by matcher object
7604  
7605  
7606    return Object.keys(matchers).reduce(function (memo, key) {
7607      memo[key] = es_parse(source, matchers[key]);
7608      return memo;
7609    }, {});
7610  }
7611  /**
7612   * Generates a function which matches node of type selector, returning an
7613   * attribute by property if the attribute exists. If no selector is passed,
7614   * returns property of the query element.
7615   *
7616   * @param  {?string} selector Optional selector
7617   * @param  {string}  name     Property name
7618   * @return {*}                Property value
7619   */
7620  
7621  function prop(selector, name) {
7622    if (1 === arguments.length) {
7623      name = selector;
7624      selector = undefined;
7625    }
7626  
7627    return function (node) {
7628      var match = node;
7629  
7630      if (selector) {
7631        match = node.querySelector(selector);
7632      }
7633  
7634      if (match) {
7635        return getPath(match, name);
7636      }
7637    };
7638  }
7639  /**
7640   * Generates a function which matches node of type selector, returning an
7641   * attribute by name if the attribute exists. If no selector is passed,
7642   * returns attribute of the query element.
7643   *
7644   * @param  {?string} selector Optional selector
7645   * @param  {string}  name     Attribute name
7646   * @return {?string}          Attribute value
7647   */
7648  
7649  function attr(selector, name) {
7650    if (1 === arguments.length) {
7651      name = selector;
7652      selector = undefined;
7653    }
7654  
7655    return function (node) {
7656      var attributes = prop(selector, 'attributes')(node);
7657  
7658      if (attributes && attributes.hasOwnProperty(name)) {
7659        return attributes[name].value;
7660      }
7661    };
7662  }
7663  /**
7664   * Convenience for `prop( selector, 'innerHTML' )`.
7665   *
7666   * @see prop()
7667   *
7668   * @param  {?string} selector Optional selector
7669   * @return {string}           Inner HTML
7670   */
7671  
7672  function es_html(selector) {
7673    return prop(selector, 'innerHTML');
7674  }
7675  /**
7676   * Convenience for `prop( selector, 'textContent' )`.
7677   *
7678   * @see prop()
7679   *
7680   * @param  {?string} selector Optional selector
7681   * @return {string}           Text content
7682   */
7683  
7684  function es_text(selector) {
7685    return prop(selector, 'textContent');
7686  }
7687  /**
7688   * Creates a new matching context by first finding elements matching selector
7689   * using querySelectorAll before then running another `parse` on `matchers`
7690   * scoped to the matched elements.
7691   *
7692   * @see parse()
7693   *
7694   * @param  {string}            selector Selector to match
7695   * @param  {(Object|Function)} matchers Matcher function or object of matchers
7696   * @return {Array.<*,Object>}           Array of matched value(s)
7697   */
7698  
7699  function query(selector, matchers) {
7700    return function (node) {
7701      var matches = node.querySelectorAll(selector);
7702      return [].map.call(matches, function (match) {
7703        return es_parse(match, matchers);
7704      });
7705    };
7706  }
7707  // EXTERNAL MODULE: external {"this":["wp","autop"]}
7708  var external_this_wp_autop_ = __webpack_require__(70);
7709  
7710  // EXTERNAL MODULE: external {"this":["wp","blockSerializationDefaultParser"]}
7711  var external_this_wp_blockSerializationDefaultParser_ = __webpack_require__(220);
7712  
7713  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js
7714  var arrayWithHoles = __webpack_require__(35);
7715  
7716  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArray.js
7717  var iterableToArray = __webpack_require__(31);
7718  
7719  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js
7720  var nonIterableRest = __webpack_require__(36);
7721  
7722  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/toArray.js
7723  
7724  
7725  
7726  function _toArray(arr) {
7727    return Object(arrayWithHoles["a" /* default */])(arr) || Object(iterableToArray["a" /* default */])(arr) || Object(nonIterableRest["a" /* default */])();
7728  }
7729  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js
7730  var classCallCheck = __webpack_require__(14);
7731  
7732  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/createClass.js
7733  var createClass = __webpack_require__(13);
7734  
7735  // CONCATENATED MODULE: ./node_modules/simple-html-tokenizer/dist/es6/index.js
7736  /**
7737   * generated from https://raw.githubusercontent.com/w3c/html/26b5126f96f736f796b9e29718138919dd513744/entities.json
7738   * do not edit
7739   */
7740  var namedCharRefs = {
7741      Aacute: "Á", aacute: "á", Abreve: "Ă", abreve: "ă", ac: "∾", acd: "∿", acE: "∾̳", Acirc: "Â", acirc: "â", acute: "´", Acy: "А", acy: "а", AElig: "Æ", aelig: "æ", af: "\u2061", Afr: "𝔄", afr: "𝔞", Agrave: "À", agrave: "à", alefsym: "ℵ", aleph: "ℵ", Alpha: "Α", alpha: "α", Amacr: "Ā", amacr: "ā", amalg: "⨿", amp: "&", AMP: "&", andand: "⩕", And: "⩓", and: "∧", andd: "⩜", andslope: "⩘", andv: "⩚", ang: "∠", ange: "⦤", angle: "∠", angmsdaa: "⦨", angmsdab: "⦩", angmsdac: "⦪", angmsdad: "⦫", angmsdae: "⦬", angmsdaf: "⦭", angmsdag: "⦮", angmsdah: "⦯", angmsd: "∡", angrt: "∟", angrtvb: "⊾", angrtvbd: "⦝", angsph: "∢", angst: "Å", angzarr: "⍼", Aogon: "Ą", aogon: "ą", Aopf: "𝔸", aopf: "𝕒", apacir: "⩯", ap: "≈", apE: "⩰", ape: "≊", apid: "≋", apos: "'", ApplyFunction: "\u2061", approx: "≈", approxeq: "≊", Aring: "Å", aring: "å", Ascr: "𝒜", ascr: "𝒶", Assign: "≔", ast: "*", asymp: "≈", asympeq: "≍", Atilde: "Ã", atilde: "ã", Auml: "Ä", auml: "ä", awconint: "∳", awint: "⨑", backcong: "≌", backepsilon: "϶", backprime: "‵", backsim: "∽", backsimeq: "⋍", Backslash: "∖", Barv: "⫧", barvee: "⊽", barwed: "⌅", Barwed: "⌆", barwedge: "⌅", bbrk: "⎵", bbrktbrk: "⎶", bcong: "≌", Bcy: "Б", bcy: "б", bdquo: "„", becaus: "∵", because: "∵", Because: "∵", bemptyv: "⦰", bepsi: "϶", bernou: "ℬ", Bernoullis: "ℬ", Beta: "Β", beta: "β", beth: "ℶ", between: "≬", Bfr: "𝔅", bfr: "𝔟", bigcap: "⋂", bigcirc: "◯", bigcup: "⋃", bigodot: "⨀", bigoplus: "⨁", bigotimes: "⨂", bigsqcup: "⨆", bigstar: "★", bigtriangledown: "▽", bigtriangleup: "△", biguplus: "⨄", bigvee: "⋁", bigwedge: "⋀", bkarow: "⤍", blacklozenge: "⧫", blacksquare: "▪", blacktriangle: "▴", blacktriangledown: "▾", blacktriangleleft: "◂", blacktriangleright: "▸", blank: "␣", blk12: "▒", blk14: "░", blk34: "▓", block: "█", bne: "=⃥", bnequiv: "≡⃥", bNot: "⫭", bnot: "⌐", Bopf: "𝔹", bopf: "𝕓", bot: "⊥", bottom: "⊥", bowtie: "⋈", boxbox: "⧉", boxdl: "┐", boxdL: "╕", boxDl: "╖", boxDL: "╗", boxdr: "┌", boxdR: "╒", boxDr: "╓", boxDR: "╔", boxh: "─", boxH: "═", boxhd: "┬", boxHd: "╤", boxhD: "╥", boxHD: "╦", boxhu: "┴", boxHu: "╧", boxhU: "╨", boxHU: "╩", boxminus: "⊟", boxplus: "⊞", boxtimes: "⊠", boxul: "┘", boxuL: "╛", boxUl: "╜", boxUL: "╝", boxur: "└", boxuR: "╘", boxUr: "╙", boxUR: "╚", boxv: "│", boxV: "║", boxvh: "┼", boxvH: "╪", boxVh: "╫", boxVH: "╬", boxvl: "┤", boxvL: "╡", boxVl: "╢", boxVL: "╣", boxvr: "├", boxvR: "╞", boxVr: "╟", boxVR: "╠", bprime: "‵", breve: "˘", Breve: "˘", brvbar: "¦", bscr: "𝒷", Bscr: "ℬ", bsemi: "⁏", bsim: "∽", bsime: "⋍", bsolb: "⧅", bsol: "\\", bsolhsub: "⟈", bull: "•", bullet: "•", bump: "≎", bumpE: "⪮", bumpe: "≏", Bumpeq: "≎", bumpeq: "≏", Cacute: "Ć", cacute: "ć", capand: "⩄", capbrcup: "⩉", capcap: "⩋", cap: "∩", Cap: "⋒", capcup: "⩇", capdot: "⩀", CapitalDifferentialD: "ⅅ", caps: "∩︀", caret: "⁁", caron: "ˇ", Cayleys: "ℭ", ccaps: "⩍", Ccaron: "Č", ccaron: "č", Ccedil: "Ç", ccedil: "ç", Ccirc: "Ĉ", ccirc: "ĉ", Cconint: "∰", ccups: "⩌", ccupssm: "⩐", Cdot: "Ċ", cdot: "ċ", cedil: "¸", Cedilla: "¸", cemptyv: "⦲", cent: "¢", centerdot: "·", CenterDot: "·", cfr: "𝔠", Cfr: "ℭ", CHcy: "Ч", chcy: "ч", check: "✓", checkmark: "✓", Chi: "Χ", chi: "χ", circ: "ˆ", circeq: "≗", circlearrowleft: "↺", circlearrowright: "↻", circledast: "⊛", circledcirc: "⊚", circleddash: "⊝", CircleDot: "⊙", circledR: "®", circledS: "Ⓢ", CircleMinus: "⊖", CirclePlus: "⊕", CircleTimes: "⊗", cir: "○", cirE: "⧃", cire: "≗", cirfnint: "⨐", cirmid: "⫯", cirscir: "⧂", ClockwiseContourIntegral: "∲", CloseCurlyDoubleQuote: "”", CloseCurlyQuote: "’", clubs: "♣", clubsuit: "♣", colon: ":", Colon: "∷", Colone: "⩴", colone: "≔", coloneq: "≔", comma: ",", commat: "@", comp: "∁", compfn: "∘", complement: "∁", complexes: "ℂ", cong: "≅", congdot: "⩭", Congruent: "≡", conint: "∮", Conint: "∯", ContourIntegral: "∮", copf: "𝕔", Copf: "ℂ", coprod: "∐", Coproduct: "∐", copy: "©", COPY: "©", copysr: "℗", CounterClockwiseContourIntegral: "∳", crarr: "↵", cross: "✗", Cross: "⨯", Cscr: "𝒞", cscr: "𝒸", csub: "⫏", csube: "⫑", csup: "⫐", csupe: "⫒", ctdot: "⋯", cudarrl: "⤸", cudarrr: "⤵", cuepr: "⋞", cuesc: "⋟", cularr: "↶", cularrp: "⤽", cupbrcap: "⩈", cupcap: "⩆", CupCap: "≍", cup: "∪", Cup: "⋓", cupcup: "⩊", cupdot: "⊍", cupor: "⩅", cups: "∪︀", curarr: "↷", curarrm: "⤼", curlyeqprec: "⋞", curlyeqsucc: "⋟", curlyvee: "⋎", curlywedge: "⋏", curren: "¤", curvearrowleft: "↶", curvearrowright: "↷", cuvee: "⋎", cuwed: "⋏", cwconint: "∲", cwint: "∱", cylcty: "⌭", dagger: "†", Dagger: "‡", daleth: "ℸ", darr: "↓", Darr: "↡", dArr: "⇓", dash: "‐", Dashv: "⫤", dashv: "⊣", dbkarow: "⤏", dblac: "˝", Dcaron: "Ď", dcaron: "ď", Dcy: "Д", dcy: "д", ddagger: "‡", ddarr: "⇊", DD: "ⅅ", dd: "ⅆ", DDotrahd: "⤑", ddotseq: "⩷", deg: "°", Del: "∇", Delta: "Δ", delta: "δ", demptyv: "⦱", dfisht: "⥿", Dfr: "𝔇", dfr: "𝔡", dHar: "⥥", dharl: "⇃", dharr: "⇂", DiacriticalAcute: "´", DiacriticalDot: "˙", DiacriticalDoubleAcute: "˝", DiacriticalGrave: "`", DiacriticalTilde: "˜", diam: "⋄", diamond: "⋄", Diamond: "⋄", diamondsuit: "♦", diams: "♦", die: "¨", DifferentialD: "ⅆ", digamma: "ϝ", disin: "⋲", div: "÷", divide: "÷", divideontimes: "⋇", divonx: "⋇", DJcy: "Ђ", djcy: "ђ", dlcorn: "⌞", dlcrop: "⌍", dollar: "$", Dopf: "𝔻", dopf: "𝕕", Dot: "¨", dot: "˙", DotDot: "⃜", doteq: "≐", doteqdot: "≑", DotEqual: "≐", dotminus: "∸", dotplus: "∔", dotsquare: "⊡", doublebarwedge: "⌆", DoubleContourIntegral: "∯", DoubleDot: "¨", DoubleDownArrow: "⇓", DoubleLeftArrow: "⇐", DoubleLeftRightArrow: "⇔", DoubleLeftTee: "⫤", DoubleLongLeftArrow: "⟸", DoubleLongLeftRightArrow: "⟺", DoubleLongRightArrow: "⟹", DoubleRightArrow: "⇒", DoubleRightTee: "⊨", DoubleUpArrow: "⇑", DoubleUpDownArrow: "⇕", DoubleVerticalBar: "∥", DownArrowBar: "⤓", downarrow: "↓", DownArrow: "↓", Downarrow: "⇓", DownArrowUpArrow: "⇵", DownBreve: "̑", downdownarrows: "⇊", downharpoonleft: "⇃", downharpoonright: "⇂", DownLeftRightVector: "⥐", DownLeftTeeVector: "⥞", DownLeftVectorBar: "⥖", DownLeftVector: "↽", DownRightTeeVector: "⥟", DownRightVectorBar: "⥗", DownRightVector: "⇁", DownTeeArrow: "↧", DownTee: "⊤", drbkarow: "⤐", drcorn: "⌟", drcrop: "⌌", Dscr: "𝒟", dscr: "𝒹", DScy: "Ѕ", dscy: "ѕ", dsol: "⧶", Dstrok: "Đ", dstrok: "đ", dtdot: "⋱", dtri: "▿", dtrif: "▾", duarr: "⇵", duhar: "⥯", dwangle: "⦦", DZcy: "Џ", dzcy: "џ", dzigrarr: "⟿", Eacute: "É", eacute: "é", easter: "⩮", Ecaron: "Ě", ecaron: "ě", Ecirc: "Ê", ecirc: "ê", ecir: "≖", ecolon: "≕", Ecy: "Э", ecy: "э", eDDot: "⩷", Edot: "Ė", edot: "ė", eDot: "≑", ee: "ⅇ", efDot: "≒", Efr: "𝔈", efr: "𝔢", eg: "⪚", Egrave: "È", egrave: "è", egs: "⪖", egsdot: "⪘", el: "⪙", Element: "∈", elinters: "⏧", ell: "ℓ", els: "⪕", elsdot: "⪗", Emacr: "Ē", emacr: "ē", empty: "∅", emptyset: "∅", EmptySmallSquare: "◻", emptyv: "∅", EmptyVerySmallSquare: "▫", emsp13: " ", emsp14: " ", emsp: " ", ENG: "Ŋ", eng: "ŋ", ensp: " ", Eogon: "Ę", eogon: "ę", Eopf: "𝔼", eopf: "𝕖", epar: "⋕", eparsl: "⧣", eplus: "⩱", epsi: "ε", Epsilon: "Ε", epsilon: "ε", epsiv: "ϵ", eqcirc: "≖", eqcolon: "≕", eqsim: "≂", eqslantgtr: "⪖", eqslantless: "⪕", Equal: "⩵", equals: "=", EqualTilde: "≂", equest: "≟", Equilibrium: "⇌", equiv: "≡", equivDD: "⩸", eqvparsl: "⧥", erarr: "⥱", erDot: "≓", escr: "ℯ", Escr: "ℰ", esdot: "≐", Esim: "⩳", esim: "≂", Eta: "Η", eta: "η", ETH: "Ð", eth: "ð", Euml: "Ë", euml: "ë", euro: "€", excl: "!", exist: "∃", Exists: "∃", expectation: "ℰ", exponentiale: "ⅇ", ExponentialE: "ⅇ", fallingdotseq: "≒", Fcy: "Ф", fcy: "ф", female: "♀", ffilig: "ffi", fflig: "ff", ffllig: "ffl", Ffr: "𝔉", ffr: "𝔣", filig: "fi", FilledSmallSquare: "◼", FilledVerySmallSquare: "▪", fjlig: "fj", flat: "♭", fllig: "fl", fltns: "▱", fnof: "ƒ", Fopf: "𝔽", fopf: "𝕗", forall: "∀", ForAll: "∀", fork: "⋔", forkv: "⫙", Fouriertrf: "ℱ", fpartint: "⨍", frac12: "½", frac13: "⅓", frac14: "¼", frac15: "⅕", frac16: "⅙", frac18: "⅛", frac23: "⅔", frac25: "⅖", frac34: "¾", frac35: "⅗", frac38: "⅜", frac45: "⅘", frac56: "⅚", frac58: "⅝", frac78: "⅞", frasl: "⁄", frown: "⌢", fscr: "𝒻", Fscr: "ℱ", gacute: "ǵ", Gamma: "Γ", gamma: "γ", Gammad: "Ϝ", gammad: "ϝ", gap: "⪆", Gbreve: "Ğ", gbreve: "ğ", Gcedil: "Ģ", Gcirc: "Ĝ", gcirc: "ĝ", Gcy: "Г", gcy: "г", Gdot: "Ġ", gdot: "ġ", ge: "≥", gE: "≧", gEl: "⪌", gel: "⋛", geq: "≥", geqq: "≧", geqslant: "⩾", gescc: "⪩", ges: "⩾", gesdot: "⪀", gesdoto: "⪂", gesdotol: "⪄", gesl: "⋛︀", gesles: "⪔", Gfr: "𝔊", gfr: "𝔤", gg: "≫", Gg: "⋙", ggg: "⋙", gimel: "ℷ", GJcy: "Ѓ", gjcy: "ѓ", gla: "⪥", gl: "≷", glE: "⪒", glj: "⪤", gnap: "⪊", gnapprox: "⪊", gne: "⪈", gnE: "≩", gneq: "⪈", gneqq: "≩", gnsim: "⋧", Gopf: "𝔾", gopf: "𝕘", grave: "`", GreaterEqual: "≥", GreaterEqualLess: "⋛", GreaterFullEqual: "≧", GreaterGreater: "⪢", GreaterLess: "≷", GreaterSlantEqual: "⩾", GreaterTilde: "≳", Gscr: "𝒢", gscr: "ℊ", gsim: "≳", gsime: "⪎", gsiml: "⪐", gtcc: "⪧", gtcir: "⩺", gt: ">", GT: ">", Gt: "≫", gtdot: "⋗", gtlPar: "⦕", gtquest: "⩼", gtrapprox: "⪆", gtrarr: "⥸", gtrdot: "⋗", gtreqless: "⋛", gtreqqless: "⪌", gtrless: "≷", gtrsim: "≳", gvertneqq: "≩︀", gvnE: "≩︀", Hacek: "ˇ", hairsp: " ", half: "½", hamilt: "ℋ", HARDcy: "Ъ", hardcy: "ъ", harrcir: "⥈", harr: "↔", hArr: "⇔", harrw: "↭", Hat: "^", hbar: "ℏ", Hcirc: "Ĥ", hcirc: "ĥ", hearts: "♥", heartsuit: "♥", hellip: "…", hercon: "⊹", hfr: "𝔥", Hfr: "ℌ", HilbertSpace: "ℋ", hksearow: "⤥", hkswarow: "⤦", hoarr: "⇿", homtht: "∻", hookleftarrow: "↩", hookrightarrow: "↪", hopf: "𝕙", Hopf: "ℍ", horbar: "―", HorizontalLine: "─", hscr: "𝒽", Hscr: "ℋ", hslash: "ℏ", Hstrok: "Ħ", hstrok: "ħ", HumpDownHump: "≎", HumpEqual: "≏", hybull: "⁃", hyphen: "‐", Iacute: "Í", iacute: "í", ic: "\u2063", Icirc: "Î", icirc: "î", Icy: "И", icy: "и", Idot: "İ", IEcy: "Е", iecy: "е", iexcl: "¡", iff: "⇔", ifr: "𝔦", Ifr: "ℑ", Igrave: "Ì", igrave: "ì", ii: "ⅈ", iiiint: "⨌", iiint: "∭", iinfin: "⧜", iiota: "℩", IJlig: "IJ", ijlig: "ij", Imacr: "Ī", imacr: "ī", image: "ℑ", ImaginaryI: "ⅈ", imagline: "ℐ", imagpart: "ℑ", imath: "ı", Im: "ℑ", imof: "⊷", imped: "Ƶ", Implies: "⇒", incare: "℅", in: "∈", infin: "∞", infintie: "⧝", inodot: "ı", intcal: "⊺", int: "∫", Int: "∬", integers: "ℤ", Integral: "∫", intercal: "⊺", Intersection: "⋂", intlarhk: "⨗", intprod: "⨼", InvisibleComma: "\u2063", InvisibleTimes: "\u2062", IOcy: "Ё", iocy: "ё", Iogon: "Į", iogon: "į", Iopf: "𝕀", iopf: "𝕚", Iota: "Ι", iota: "ι", iprod: "⨼", iquest: "¿", iscr: "𝒾", Iscr: "ℐ", isin: "∈", isindot: "⋵", isinE: "⋹", isins: "⋴", isinsv: "⋳", isinv: "∈", it: "\u2062", Itilde: "Ĩ", itilde: "ĩ", Iukcy: "І", iukcy: "і", Iuml: "Ï", iuml: "ï", Jcirc: "Ĵ", jcirc: "ĵ", Jcy: "Й", jcy: "й", Jfr: "𝔍", jfr: "𝔧", jmath: "ȷ", Jopf: "𝕁", jopf: "𝕛", Jscr: "𝒥", jscr: "𝒿", Jsercy: "Ј", jsercy: "ј", Jukcy: "Є", jukcy: "є", Kappa: "Κ", kappa: "κ", kappav: "ϰ", Kcedil: "Ķ", kcedil: "ķ", Kcy: "К", kcy: "к", Kfr: "𝔎", kfr: "𝔨", kgreen: "ĸ", KHcy: "Х", khcy: "х", KJcy: "Ќ", kjcy: "ќ", Kopf: "𝕂", kopf: "𝕜", Kscr: "𝒦", kscr: "𝓀", lAarr: "⇚", Lacute: "Ĺ", lacute: "ĺ", laemptyv: "⦴", lagran: "ℒ", Lambda: "Λ", lambda: "λ", lang: "⟨", Lang: "⟪", langd: "⦑", langle: "⟨", lap: "⪅", Laplacetrf: "ℒ", laquo: "«", larrb: "⇤", larrbfs: "⤟", larr: "←", Larr: "↞", lArr: "⇐", larrfs: "⤝", larrhk: "↩", larrlp: "↫", larrpl: "⤹", larrsim: "⥳", larrtl: "↢", latail: "⤙", lAtail: "⤛", lat: "⪫", late: "⪭", lates: "⪭︀", lbarr: "⤌", lBarr: "⤎", lbbrk: "❲", lbrace: "{", lbrack: "[", lbrke: "⦋", lbrksld: "⦏", lbrkslu: "⦍", Lcaron: "Ľ", lcaron: "ľ", Lcedil: "Ļ", lcedil: "ļ", lceil: "⌈", lcub: "{", Lcy: "Л", lcy: "л", ldca: "⤶", ldquo: "“", ldquor: "„", ldrdhar: "⥧", ldrushar: "⥋", ldsh: "↲", le: "≤", lE: "≦", LeftAngleBracket: "⟨", LeftArrowBar: "⇤", leftarrow: "←", LeftArrow: "←", Leftarrow: "⇐", LeftArrowRightArrow: "⇆", leftarrowtail: "↢", LeftCeiling: "⌈", LeftDoubleBracket: "⟦", LeftDownTeeVector: "⥡", LeftDownVectorBar: "⥙", LeftDownVector: "⇃", LeftFloor: "⌊", leftharpoondown: "↽", leftharpoonup: "↼", leftleftarrows: "⇇", leftrightarrow: "↔", LeftRightArrow: "↔", Leftrightarrow: "⇔", leftrightarrows: "⇆", leftrightharpoons: "⇋", leftrightsquigarrow: "↭", LeftRightVector: "⥎", LeftTeeArrow: "↤", LeftTee: "⊣", LeftTeeVector: "⥚", leftthreetimes: "⋋", LeftTriangleBar: "⧏", LeftTriangle: "⊲", LeftTriangleEqual: "⊴", LeftUpDownVector: "⥑", LeftUpTeeVector: "⥠", LeftUpVectorBar: "⥘", LeftUpVector: "↿", LeftVectorBar: "⥒", LeftVector: "↼", lEg: "⪋", leg: "⋚", leq: "≤", leqq: "≦", leqslant: "⩽", lescc: "⪨", les: "⩽", lesdot: "⩿", lesdoto: "⪁", lesdotor: "⪃", lesg: "⋚︀", lesges: "⪓", lessapprox: "⪅", lessdot: "⋖", lesseqgtr: "⋚", lesseqqgtr: "⪋", LessEqualGreater: "⋚", LessFullEqual: "≦", LessGreater: "≶", lessgtr: "≶", LessLess: "⪡", lesssim: "≲", LessSlantEqual: "⩽", LessTilde: "≲", lfisht: "⥼", lfloor: "⌊", Lfr: "𝔏", lfr: "𝔩", lg: "≶", lgE: "⪑", lHar: "⥢", lhard: "↽", lharu: "↼", lharul: "⥪", lhblk: "▄", LJcy: "Љ", ljcy: "љ", llarr: "⇇", ll: "≪", Ll: "⋘", llcorner: "⌞", Lleftarrow: "⇚", llhard: "⥫", lltri: "◺", Lmidot: "Ŀ", lmidot: "ŀ", lmoustache: "⎰", lmoust: "⎰", lnap: "⪉", lnapprox: "⪉", lne: "⪇", lnE: "≨", lneq: "⪇", lneqq: "≨", lnsim: "⋦", loang: "⟬", loarr: "⇽", lobrk: "⟦", longleftarrow: "⟵", LongLeftArrow: "⟵", Longleftarrow: "⟸", longleftrightarrow: "⟷", LongLeftRightArrow: "⟷", Longleftrightarrow: "⟺", longmapsto: "⟼", longrightarrow: "⟶", LongRightArrow: "⟶", Longrightarrow: "⟹", looparrowleft: "↫", looparrowright: "↬", lopar: "⦅", Lopf: "𝕃", lopf: "𝕝", loplus: "⨭", lotimes: "⨴", lowast: "∗", lowbar: "_", LowerLeftArrow: "↙", LowerRightArrow: "↘", loz: "◊", lozenge: "◊", lozf: "⧫", lpar: "(", lparlt: "⦓", lrarr: "⇆", lrcorner: "⌟", lrhar: "⇋", lrhard: "⥭", lrm: "\u200e", lrtri: "⊿", lsaquo: "‹", lscr: "𝓁", Lscr: "ℒ", lsh: "↰", Lsh: "↰", lsim: "≲", lsime: "⪍", lsimg: "⪏", lsqb: "[", lsquo: "‘", lsquor: "‚", Lstrok: "Ł", lstrok: "ł", ltcc: "⪦", ltcir: "⩹", lt: "<", LT: "<", Lt: "≪", ltdot: "⋖", lthree: "⋋", ltimes: "⋉", ltlarr: "⥶", ltquest: "⩻", ltri: "◃", ltrie: "⊴", ltrif: "◂", ltrPar: "⦖", lurdshar: "⥊", luruhar: "⥦", lvertneqq: "≨︀", lvnE: "≨︀", macr: "¯", male: "♂", malt: "✠", maltese: "✠", Map: "⤅", map: "↦", mapsto: "↦", mapstodown: "↧", mapstoleft: "↤", mapstoup: "↥", marker: "▮", mcomma: "⨩", Mcy: "М", mcy: "м", mdash: "—", mDDot: "∺", measuredangle: "∡", MediumSpace: " ", Mellintrf: "ℳ", Mfr: "𝔐", mfr: "𝔪", mho: "℧", micro: "µ", midast: "*", midcir: "⫰", mid: "∣", middot: "·", minusb: "⊟", minus: "−", minusd: "∸", minusdu: "⨪", MinusPlus: "∓", mlcp: "⫛", mldr: "…", mnplus: "∓", models: "⊧", Mopf: "𝕄", mopf: "𝕞", mp: "∓", mscr: "𝓂", Mscr: "ℳ", mstpos: "∾", Mu: "Μ", mu: "μ", multimap: "⊸", mumap: "⊸", nabla: "∇", Nacute: "Ń", nacute: "ń", nang: "∠⃒", nap: "≉", napE: "⩰̸", napid: "≋̸", napos: "ʼn", napprox: "≉", natural: "♮", naturals: "ℕ", natur: "♮", nbsp: " ", nbump: "≎̸", nbumpe: "≏̸", ncap: "⩃", Ncaron: "Ň", ncaron: "ň", Ncedil: "Ņ", ncedil: "ņ", ncong: "≇", ncongdot: "⩭̸", ncup: "⩂", Ncy: "Н", ncy: "н", ndash: "–", nearhk: "⤤", nearr: "↗", neArr: "⇗", nearrow: "↗", ne: "≠", nedot: "≐̸", NegativeMediumSpace: "​", NegativeThickSpace: "​", NegativeThinSpace: "​", NegativeVeryThinSpace: "​", nequiv: "≢", nesear: "⤨", nesim: "≂̸", NestedGreaterGreater: "≫", NestedLessLess: "≪", NewLine: "\u000a", nexist: "∄", nexists: "∄", Nfr: "𝔑", nfr: "𝔫", ngE: "≧̸", nge: "≱", ngeq: "≱", ngeqq: "≧̸", ngeqslant: "⩾̸", nges: "⩾̸", nGg: "⋙̸", ngsim: "≵", nGt: "≫⃒", ngt: "≯", ngtr: "≯", nGtv: "≫̸", nharr: "↮", nhArr: "⇎", nhpar: "⫲", ni: "∋", nis: "⋼", nisd: "⋺", niv: "∋", NJcy: "Њ", njcy: "њ", nlarr: "↚", nlArr: "⇍", nldr: "‥", nlE: "≦̸", nle: "≰", nleftarrow: "↚", nLeftarrow: "⇍", nleftrightarrow: "↮", nLeftrightarrow: "⇎", nleq: "≰", nleqq: "≦̸", nleqslant: "⩽̸", nles: "⩽̸", nless: "≮", nLl: "⋘̸", nlsim: "≴", nLt: "≪⃒", nlt: "≮", nltri: "⋪", nltrie: "⋬", nLtv: "≪̸", nmid: "∤", NoBreak: "\u2060", NonBreakingSpace: " ", nopf: "𝕟", Nopf: "ℕ", Not: "⫬", not: "¬", NotCongruent: "≢", NotCupCap: "≭", NotDoubleVerticalBar: "∦", NotElement: "∉", NotEqual: "≠", NotEqualTilde: "≂̸", NotExists: "∄", NotGreater: "≯", NotGreaterEqual: "≱", NotGreaterFullEqual: "≧̸", NotGreaterGreater: "≫̸", NotGreaterLess: "≹", NotGreaterSlantEqual: "⩾̸", NotGreaterTilde: "≵", NotHumpDownHump: "≎̸", NotHumpEqual: "≏̸", notin: "∉", notindot: "⋵̸", notinE: "⋹̸", notinva: "∉", notinvb: "⋷", notinvc: "⋶", NotLeftTriangleBar: "⧏̸", NotLeftTriangle: "⋪", NotLeftTriangleEqual: "⋬", NotLess: "≮", NotLessEqual: "≰", NotLessGreater: "≸", NotLessLess: "≪̸", NotLessSlantEqual: "⩽̸", NotLessTilde: "≴", NotNestedGreaterGreater: "⪢̸", NotNestedLessLess: "⪡̸", notni: "∌", notniva: "∌", notnivb: "⋾", notnivc: "⋽", NotPrecedes: "⊀", NotPrecedesEqual: "⪯̸", NotPrecedesSlantEqual: "⋠", NotReverseElement: "∌", NotRightTriangleBar: "⧐̸", NotRightTriangle: "⋫", NotRightTriangleEqual: "⋭", NotSquareSubset: "⊏̸", NotSquareSubsetEqual: "⋢", NotSquareSuperset: "⊐̸", NotSquareSupersetEqual: "⋣", NotSubset: "⊂⃒", NotSubsetEqual: "⊈", NotSucceeds: "⊁", NotSucceedsEqual: "⪰̸", NotSucceedsSlantEqual: "⋡", NotSucceedsTilde: "≿̸", NotSuperset: "⊃⃒", NotSupersetEqual: "⊉", NotTilde: "≁", NotTildeEqual: "≄", NotTildeFullEqual: "≇", NotTildeTilde: "≉", NotVerticalBar: "∤", nparallel: "∦", npar: "∦", nparsl: "⫽⃥", npart: "∂̸", npolint: "⨔", npr: "⊀", nprcue: "⋠", nprec: "⊀", npreceq: "⪯̸", npre: "⪯̸", nrarrc: "⤳̸", nrarr: "↛", nrArr: "⇏", nrarrw: "↝̸", nrightarrow: "↛", nRightarrow: "⇏", nrtri: "⋫", nrtrie: "⋭", nsc: "⊁", nsccue: "⋡", nsce: "⪰̸", Nscr: "𝒩", nscr: "𝓃", nshortmid: "∤", nshortparallel: "∦", nsim: "≁", nsime: "≄", nsimeq: "≄", nsmid: "∤", nspar: "∦", nsqsube: "⋢", nsqsupe: "⋣", nsub: "⊄", nsubE: "⫅̸", nsube: "⊈", nsubset: "⊂⃒", nsubseteq: "⊈", nsubseteqq: "⫅̸", nsucc: "⊁", nsucceq: "⪰̸", nsup: "⊅", nsupE: "⫆̸", nsupe: "⊉", nsupset: "⊃⃒", nsupseteq: "⊉", nsupseteqq: "⫆̸", ntgl: "≹", Ntilde: "Ñ", ntilde: "ñ", ntlg: "≸", ntriangleleft: "⋪", ntrianglelefteq: "⋬", ntriangleright: "⋫", ntrianglerighteq: "⋭", Nu: "Ν", nu: "ν", num: "#", numero: "№", numsp: " ", nvap: "≍⃒", nvdash: "⊬", nvDash: "⊭", nVdash: "⊮", nVDash: "⊯", nvge: "≥⃒", nvgt: ">⃒", nvHarr: "⤄", nvinfin: "⧞", nvlArr: "⤂", nvle: "≤⃒", nvlt: "<⃒", nvltrie: "⊴⃒", nvrArr: "⤃", nvrtrie: "⊵⃒", nvsim: "∼⃒", nwarhk: "⤣", nwarr: "↖", nwArr: "⇖", nwarrow: "↖", nwnear: "⤧", Oacute: "Ó", oacute: "ó", oast: "⊛", Ocirc: "Ô", ocirc: "ô", ocir: "⊚", Ocy: "О", ocy: "о", odash: "⊝", Odblac: "Ő", odblac: "ő", odiv: "⨸", odot: "⊙", odsold: "⦼", OElig: "Œ", oelig: "œ", ofcir: "⦿", Ofr: "𝔒", ofr: "𝔬", ogon: "˛", Ograve: "Ò", ograve: "ò", ogt: "⧁", ohbar: "⦵", ohm: "Ω", oint: "∮", olarr: "↺", olcir: "⦾", olcross: "⦻", oline: "‾", olt: "⧀", Omacr: "Ō", omacr: "ō", Omega: "Ω", omega: "ω", Omicron: "Ο", omicron: "ο", omid: "⦶", ominus: "⊖", Oopf: "𝕆", oopf: "𝕠", opar: "⦷", OpenCurlyDoubleQuote: "“", OpenCurlyQuote: "‘", operp: "⦹", oplus: "⊕", orarr: "↻", Or: "⩔", or: "∨", ord: "⩝", order: "ℴ", orderof: "ℴ", ordf: "ª", ordm: "º", origof: "⊶", oror: "⩖", orslope: "⩗", orv: "⩛", oS: "Ⓢ", Oscr: "𝒪", oscr: "ℴ", Oslash: "Ø", oslash: "ø", osol: "⊘", Otilde: "Õ", otilde: "õ", otimesas: "⨶", Otimes: "⨷", otimes: "⊗", Ouml: "Ö", ouml: "ö", ovbar: "⌽", OverBar: "‾", OverBrace: "⏞", OverBracket: "⎴", OverParenthesis: "⏜", para: "¶", parallel: "∥", par: "∥", parsim: "⫳", parsl: "⫽", part: "∂", PartialD: "∂", Pcy: "П", pcy: "п", percnt: "%", period: ".", permil: "‰", perp: "⊥", pertenk: "‱", Pfr: "𝔓", pfr: "𝔭", Phi: "Φ", phi: "φ", phiv: "ϕ", phmmat: "ℳ", phone: "☎", Pi: "Π", pi: "π", pitchfork: "⋔", piv: "ϖ", planck: "ℏ", planckh: "ℎ", plankv: "ℏ", plusacir: "⨣", plusb: "⊞", pluscir: "⨢", plus: "+", plusdo: "∔", plusdu: "⨥", pluse: "⩲", PlusMinus: "±", plusmn: "±", plussim: "⨦", plustwo: "⨧", pm: "±", Poincareplane: "ℌ", pointint: "⨕", popf: "𝕡", Popf: "ℙ", pound: "£", prap: "⪷", Pr: "⪻", pr: "≺", prcue: "≼", precapprox: "⪷", prec: "≺", preccurlyeq: "≼", Precedes: "≺", PrecedesEqual: "⪯", PrecedesSlantEqual: "≼", PrecedesTilde: "≾", preceq: "⪯", precnapprox: "⪹", precneqq: "⪵", precnsim: "⋨", pre: "⪯", prE: "⪳", precsim: "≾", prime: "′", Prime: "″", primes: "ℙ", prnap: "⪹", prnE: "⪵", prnsim: "⋨", prod: "∏", Product: "∏", profalar: "⌮", profline: "⌒", profsurf: "⌓", prop: "∝", Proportional: "∝", Proportion: "∷", propto: "∝", prsim: "≾", prurel: "⊰", Pscr: "𝒫", pscr: "𝓅", Psi: "Ψ", psi: "ψ", puncsp: " ", Qfr: "𝔔", qfr: "𝔮", qint: "⨌", qopf: "𝕢", Qopf: "ℚ", qprime: "⁗", Qscr: "𝒬", qscr: "𝓆", quaternions: "ℍ", quatint: "⨖", quest: "?", questeq: "≟", quot: "\"", QUOT: "\"", rAarr: "⇛", race: "∽̱", Racute: "Ŕ", racute: "ŕ", radic: "√", raemptyv: "⦳", rang: "⟩", Rang: "⟫", rangd: "⦒", range: "⦥", rangle: "⟩", raquo: "»", rarrap: "⥵", rarrb: "⇥", rarrbfs: "⤠", rarrc: "⤳", rarr: "→", Rarr: "↠", rArr: "⇒", rarrfs: "⤞", rarrhk: "↪", rarrlp: "↬", rarrpl: "⥅", rarrsim: "⥴", Rarrtl: "⤖", rarrtl: "↣", rarrw: "↝", ratail: "⤚", rAtail: "⤜", ratio: "∶", rationals: "ℚ", rbarr: "⤍", rBarr: "⤏", RBarr: "⤐", rbbrk: "❳", rbrace: "}", rbrack: "]", rbrke: "⦌", rbrksld: "⦎", rbrkslu: "⦐", Rcaron: "Ř", rcaron: "ř", Rcedil: "Ŗ", rcedil: "ŗ", rceil: "⌉", rcub: "}", Rcy: "Р", rcy: "р", rdca: "⤷", rdldhar: "⥩", rdquo: "”", rdquor: "”", rdsh: "↳", real: "ℜ", realine: "ℛ", realpart: "ℜ", reals: "ℝ", Re: "ℜ", rect: "▭", reg: "®", REG: "®", ReverseElement: "∋", ReverseEquilibrium: "⇋", ReverseUpEquilibrium: "⥯", rfisht: "⥽", rfloor: "⌋", rfr: "𝔯", Rfr: "ℜ", rHar: "⥤", rhard: "⇁", rharu: "⇀", rharul: "⥬", Rho: "Ρ", rho: "ρ", rhov: "ϱ", RightAngleBracket: "⟩", RightArrowBar: "⇥", rightarrow: "→", RightArrow: "→", Rightarrow: "⇒", RightArrowLeftArrow: "⇄", rightarrowtail: "↣", RightCeiling: "⌉", RightDoubleBracket: "⟧", RightDownTeeVector: "⥝", RightDownVectorBar: "⥕", RightDownVector: "⇂", RightFloor: "⌋", rightharpoondown: "⇁", rightharpoonup: "⇀", rightleftarrows: "⇄", rightleftharpoons: "⇌", rightrightarrows: "⇉", rightsquigarrow: "↝", RightTeeArrow: "↦", RightTee: "⊢", RightTeeVector: "⥛", rightthreetimes: "⋌", RightTriangleBar: "⧐", RightTriangle: "⊳", RightTriangleEqual: "⊵", RightUpDownVector: "⥏", RightUpTeeVector: "⥜", RightUpVectorBar: "⥔", RightUpVector: "↾", RightVectorBar: "⥓", RightVector: "⇀", ring: "˚", risingdotseq: "≓", rlarr: "⇄", rlhar: "⇌", rlm: "\u200f", rmoustache: "⎱", rmoust: "⎱", rnmid: "⫮", roang: "⟭", roarr: "⇾", robrk: "⟧", ropar: "⦆", ropf: "𝕣", Ropf: "ℝ", roplus: "⨮", rotimes: "⨵", RoundImplies: "⥰", rpar: ")", rpargt: "⦔", rppolint: "⨒", rrarr: "⇉", Rrightarrow: "⇛", rsaquo: "›", rscr: "𝓇", Rscr: "ℛ", rsh: "↱", Rsh: "↱", rsqb: "]", rsquo: "’", rsquor: "’", rthree: "⋌", rtimes: "⋊", rtri: "▹", rtrie: "⊵", rtrif: "▸", rtriltri: "⧎", RuleDelayed: "⧴", ruluhar: "⥨", rx: "℞", Sacute: "Ś", sacute: "ś", sbquo: "‚", scap: "⪸", Scaron: "Š", scaron: "š", Sc: "⪼", sc: "≻", sccue: "≽", sce: "⪰", scE: "⪴", Scedil: "Ş", scedil: "ş", Scirc: "Ŝ", scirc: "ŝ", scnap: "⪺", scnE: "⪶", scnsim: "⋩", scpolint: "⨓", scsim: "≿", Scy: "С", scy: "с", sdotb: "⊡", sdot: "⋅", sdote: "⩦", searhk: "⤥", searr: "↘", seArr: "⇘", searrow: "↘", sect: "§", semi: ";", seswar: "⤩", setminus: "∖", setmn: "∖", sext: "✶", Sfr: "𝔖", sfr: "𝔰", sfrown: "⌢", sharp: "♯", SHCHcy: "Щ", shchcy: "щ", SHcy: "Ш", shcy: "ш", ShortDownArrow: "↓", ShortLeftArrow: "←", shortmid: "∣", shortparallel: "∥", ShortRightArrow: "→", ShortUpArrow: "↑", shy: "\u00ad", Sigma: "Σ", sigma: "σ", sigmaf: "ς", sigmav: "ς", sim: "∼", simdot: "⩪", sime: "≃", simeq: "≃", simg: "⪞", simgE: "⪠", siml: "⪝", simlE: "⪟", simne: "≆", simplus: "⨤", simrarr: "⥲", slarr: "←", SmallCircle: "∘", smallsetminus: "∖", smashp: "⨳", smeparsl: "⧤", smid: "∣", smile: "⌣", smt: "⪪", smte: "⪬", smtes: "⪬︀", SOFTcy: "Ь", softcy: "ь", solbar: "⌿", solb: "⧄", sol: "/", Sopf: "𝕊", sopf: "𝕤", spades: "♠", spadesuit: "♠", spar: "∥", sqcap: "⊓", sqcaps: "⊓︀", sqcup: "⊔", sqcups: "⊔︀", Sqrt: "√", sqsub: "⊏", sqsube: "⊑", sqsubset: "⊏", sqsubseteq: "⊑", sqsup: "⊐", sqsupe: "⊒", sqsupset: "⊐", sqsupseteq: "⊒", square: "□", Square: "□", SquareIntersection: "⊓", SquareSubset: "⊏", SquareSubsetEqual: "⊑", SquareSuperset: "⊐", SquareSupersetEqual: "⊒", SquareUnion: "⊔", squarf: "▪", squ: "□", squf: "▪", srarr: "→", Sscr: "𝒮", sscr: "𝓈", ssetmn: "∖", ssmile: "⌣", sstarf: "⋆", Star: "⋆", star: "☆", starf: "★", straightepsilon: "ϵ", straightphi: "ϕ", strns: "¯", sub: "⊂", Sub: "⋐", subdot: "⪽", subE: "⫅", sube: "⊆", subedot: "⫃", submult: "⫁", subnE: "⫋", subne: "⊊", subplus: "⪿", subrarr: "⥹", subset: "⊂", Subset: "⋐", subseteq: "⊆", subseteqq: "⫅", SubsetEqual: "⊆", subsetneq: "⊊", subsetneqq: "⫋", subsim: "⫇", subsub: "⫕", subsup: "⫓", succapprox: "⪸", succ: "≻", succcurlyeq: "≽", Succeeds: "≻", SucceedsEqual: "⪰", SucceedsSlantEqual: "≽", SucceedsTilde: "≿", succeq: "⪰", succnapprox: "⪺", succneqq: "⪶", succnsim: "⋩", succsim: "≿", SuchThat: "∋", sum: "∑", Sum: "∑", sung: "♪", sup1: "¹", sup2: "²", sup3: "³", sup: "⊃", Sup: "⋑", supdot: "⪾", supdsub: "⫘", supE: "⫆", supe: "⊇", supedot: "⫄", Superset: "⊃", SupersetEqual: "⊇", suphsol: "⟉", suphsub: "⫗", suplarr: "⥻", supmult: "⫂", supnE: "⫌", supne: "⊋", supplus: "⫀", supset: "⊃", Supset: "⋑", supseteq: "⊇", supseteqq: "⫆", supsetneq: "⊋", supsetneqq: "⫌", supsim: "⫈", supsub: "⫔", supsup: "⫖", swarhk: "⤦", swarr: "↙", swArr: "⇙", swarrow: "↙", swnwar: "⤪", szlig: "ß", Tab: "\u0009", target: "⌖", Tau: "Τ", tau: "τ", tbrk: "⎴", Tcaron: "Ť", tcaron: "ť", Tcedil: "Ţ", tcedil: "ţ", Tcy: "Т", tcy: "т", tdot: "⃛", telrec: "⌕", Tfr: "𝔗", tfr: "𝔱", there4: "∴", therefore: "∴", Therefore: "∴", Theta: "Θ", theta: "θ", thetasym: "ϑ", thetav: "ϑ", thickapprox: "≈", thicksim: "∼", ThickSpace: "  ", ThinSpace: " ", thinsp: " ", thkap: "≈", thksim: "∼", THORN: "Þ", thorn: "þ", tilde: "˜", Tilde: "∼", TildeEqual: "≃", TildeFullEqual: "≅", TildeTilde: "≈", timesbar: "⨱", timesb: "⊠", times: "×", timesd: "⨰", tint: "∭", toea: "⤨", topbot: "⌶", topcir: "⫱", top: "⊤", Topf: "𝕋", topf: "𝕥", topfork: "⫚", tosa: "⤩", tprime: "‴", trade: "™", TRADE: "™", triangle: "▵", triangledown: "▿", triangleleft: "◃", trianglelefteq: "⊴", triangleq: "≜", triangleright: "▹", trianglerighteq: "⊵", tridot: "◬", trie: "≜", triminus: "⨺", TripleDot: "⃛", triplus: "⨹", trisb: "⧍", tritime: "⨻", trpezium: "⏢", Tscr: "𝒯", tscr: "𝓉", TScy: "Ц", tscy: "ц", TSHcy: "Ћ", tshcy: "ћ", Tstrok: "Ŧ", tstrok: "ŧ", twixt: "≬", twoheadleftarrow: "↞", twoheadrightarrow: "↠", Uacute: "Ú", uacute: "ú", uarr: "↑", Uarr: "↟", uArr: "⇑", Uarrocir: "⥉", Ubrcy: "Ў", ubrcy: "ў", Ubreve: "Ŭ", ubreve: "ŭ", Ucirc: "Û", ucirc: "û", Ucy: "У", ucy: "у", udarr: "⇅", Udblac: "Ű", udblac: "ű", udhar: "⥮", ufisht: "⥾", Ufr: "𝔘", ufr: "𝔲", Ugrave: "Ù", ugrave: "ù", uHar: "⥣", uharl: "↿", uharr: "↾", uhblk: "▀", ulcorn: "⌜", ulcorner: "⌜", ulcrop: "⌏", ultri: "◸", Umacr: "Ū", umacr: "ū", uml: "¨", UnderBar: "_", UnderBrace: "⏟", UnderBracket: "⎵", UnderParenthesis: "⏝", Union: "⋃", UnionPlus: "⊎", Uogon: "Ų", uogon: "ų", Uopf: "𝕌", uopf: "𝕦", UpArrowBar: "⤒", uparrow: "↑", UpArrow: "↑", Uparrow: "⇑", UpArrowDownArrow: "⇅", updownarrow: "↕", UpDownArrow: "↕", Updownarrow: "⇕", UpEquilibrium: "⥮", upharpoonleft: "↿", upharpoonright: "↾", uplus: "⊎", UpperLeftArrow: "↖", UpperRightArrow: "↗", upsi: "υ", Upsi: "ϒ", upsih: "ϒ", Upsilon: "Υ", upsilon: "υ", UpTeeArrow: "↥", UpTee: "⊥", upuparrows: "⇈", urcorn: "⌝", urcorner: "⌝", urcrop: "⌎", Uring: "Ů", uring: "ů", urtri: "◹", Uscr: "𝒰", uscr: "𝓊", utdot: "⋰", Utilde: "Ũ", utilde: "ũ", utri: "▵", utrif: "▴", uuarr: "⇈", Uuml: "Ü", uuml: "ü", uwangle: "⦧", vangrt: "⦜", varepsilon: "ϵ", varkappa: "ϰ", varnothing: "∅", varphi: "ϕ", varpi: "ϖ", varpropto: "∝", varr: "↕", vArr: "⇕", varrho: "ϱ", varsigma: "ς", varsubsetneq: "⊊︀", varsubsetneqq: "⫋︀", varsupsetneq: "⊋︀", varsupsetneqq: "⫌︀", vartheta: "ϑ", vartriangleleft: "⊲", vartriangleright: "⊳", vBar: "⫨", Vbar: "⫫", vBarv: "⫩", Vcy: "В", vcy: "в", vdash: "⊢", vDash: "⊨", Vdash: "⊩", VDash: "⊫", Vdashl: "⫦", veebar: "⊻", vee: "∨", Vee: "⋁", veeeq: "≚", vellip: "⋮", verbar: "|", Verbar: "‖", vert: "|", Vert: "‖", VerticalBar: "∣", VerticalLine: "|", VerticalSeparator: "❘", VerticalTilde: "≀", VeryThinSpace: " ", Vfr: "𝔙", vfr: "𝔳", vltri: "⊲", vnsub: "⊂⃒", vnsup: "⊃⃒", Vopf: "𝕍", vopf: "𝕧", vprop: "∝", vrtri: "⊳", Vscr: "𝒱", vscr: "𝓋", vsubnE: "⫋︀", vsubne: "⊊︀", vsupnE: "⫌︀", vsupne: "⊋︀", Vvdash: "⊪", vzigzag: "⦚", Wcirc: "Ŵ", wcirc: "ŵ", wedbar: "⩟", wedge: "∧", Wedge: "⋀", wedgeq: "≙", weierp: "℘", Wfr: "𝔚", wfr: "𝔴", Wopf: "𝕎", wopf: "𝕨", wp: "℘", wr: "≀", wreath: "≀", Wscr: "𝒲", wscr: "𝓌", xcap: "⋂", xcirc: "◯", xcup: "⋃", xdtri: "▽", Xfr: "𝔛", xfr: "𝔵", xharr: "⟷", xhArr: "⟺", Xi: "Ξ", xi: "ξ", xlarr: "⟵", xlArr: "⟸", xmap: "⟼", xnis: "⋻", xodot: "⨀", Xopf: "𝕏", xopf: "𝕩", xoplus: "⨁", xotime: "⨂", xrarr: "⟶", xrArr: "⟹", Xscr: "𝒳", xscr: "𝓍", xsqcup: "⨆", xuplus: "⨄", xutri: "△", xvee: "⋁", xwedge: "⋀", Yacute: "Ý", yacute: "ý", YAcy: "Я", yacy: "я", Ycirc: "Ŷ", ycirc: "ŷ", Ycy: "Ы", ycy: "ы", yen: "¥", Yfr: "𝔜", yfr: "𝔶", YIcy: "Ї", yicy: "ї", Yopf: "𝕐", yopf: "𝕪", Yscr: "𝒴", yscr: "𝓎", YUcy: "Ю", yucy: "ю", yuml: "ÿ", Yuml: "Ÿ", Zacute: "Ź", zacute: "ź", Zcaron: "Ž", zcaron: "ž", Zcy: "З", zcy: "з", Zdot: "Ż", zdot: "ż", zeetrf: "ℨ", ZeroWidthSpace: "​", Zeta: "Ζ", zeta: "ζ", zfr: "𝔷", Zfr: "ℨ", ZHcy: "Ж", zhcy: "ж", zigrarr: "⇝", zopf: "𝕫", Zopf: "ℤ", Zscr: "𝒵", zscr: "𝓏", zwj: "\u200d", zwnj: "\u200c"
7742  };
7743  
7744  var HEXCHARCODE = /^#[xX]([A-Fa-f0-9]+)$/;
7745  var CHARCODE = /^#([0-9]+)$/;
7746  var NAMED = /^([A-Za-z0-9]+)$/;
7747  var EntityParser = /** @class */ (function () {
7748      function EntityParser(named) {
7749          this.named = named;
7750      }
7751      EntityParser.prototype.parse = function (entity) {
7752          if (!entity) {
7753              return;
7754          }
7755          var matches = entity.match(HEXCHARCODE);
7756          if (matches) {
7757              return String.fromCharCode(parseInt(matches[1], 16));
7758          }
7759          matches = entity.match(CHARCODE);
7760          if (matches) {
7761              return String.fromCharCode(parseInt(matches[1], 10));
7762          }
7763          matches = entity.match(NAMED);
7764          if (matches) {
7765              return this.named[matches[1]];
7766          }
7767      };
7768      return EntityParser;
7769  }());
7770  
7771  var WSP = /[\t\n\f ]/;
7772  var ALPHA = /[A-Za-z]/;
7773  var CRLF = /\r\n?/g;
7774  function isSpace(char) {
7775      return WSP.test(char);
7776  }
7777  function isAlpha(char) {
7778      return ALPHA.test(char);
7779  }
7780  function preprocessInput(input) {
7781      return input.replace(CRLF, '\n');
7782  }
7783  
7784  var EventedTokenizer = /** @class */ (function () {
7785      function EventedTokenizer(delegate, entityParser) {
7786          this.delegate = delegate;
7787          this.entityParser = entityParser;
7788          this.state = "beforeData" /* beforeData */;
7789          this.line = -1;
7790          this.column = -1;
7791          this.input = '';
7792          this.index = -1;
7793          this.tagNameBuffer = '';
7794          this.states = {
7795              beforeData: function () {
7796                  var char = this.peek();
7797                  if (char === '<' && !this.isIgnoredEndTag()) {
7798                      this.transitionTo("tagOpen" /* tagOpen */);
7799                      this.markTagStart();
7800                      this.consume();
7801                  }
7802                  else {
7803                      if (char === '\n') {
7804                          var tag = this.tagNameBuffer.toLowerCase();
7805                          if (tag === 'pre' || tag === 'textarea') {
7806                              this.consume();
7807                          }
7808                      }
7809                      this.transitionTo("data" /* data */);
7810                      this.delegate.beginData();
7811                  }
7812              },
7813              data: function () {
7814                  var char = this.peek();
7815                  var tag = this.tagNameBuffer.toLowerCase();
7816                  if (char === '<' && !this.isIgnoredEndTag()) {
7817                      this.delegate.finishData();
7818                      this.transitionTo("tagOpen" /* tagOpen */);
7819                      this.markTagStart();
7820                      this.consume();
7821                  }
7822                  else if (char === '&' && tag !== 'script' && tag !== 'style') {
7823                      this.consume();
7824                      this.delegate.appendToData(this.consumeCharRef() || '&');
7825                  }
7826                  else {
7827                      this.consume();
7828                      this.delegate.appendToData(char);
7829                  }
7830              },
7831              tagOpen: function () {
7832                  var char = this.consume();
7833                  if (char === '!') {
7834                      this.transitionTo("markupDeclarationOpen" /* markupDeclarationOpen */);
7835                  }
7836                  else if (char === '/') {
7837                      this.transitionTo("endTagOpen" /* endTagOpen */);
7838                  }
7839                  else if (char === '@' || char === ':' || isAlpha(char)) {
7840                      this.transitionTo("tagName" /* tagName */);
7841                      this.tagNameBuffer = '';
7842                      this.delegate.beginStartTag();
7843                      this.appendToTagName(char);
7844                  }
7845              },
7846              markupDeclarationOpen: function () {
7847                  var char = this.consume();
7848                  if (char === '-' && this.peek() === '-') {
7849                      this.consume();
7850                      this.transitionTo("commentStart" /* commentStart */);
7851                      this.delegate.beginComment();
7852                  }
7853              },
7854              commentStart: function () {
7855                  var char = this.consume();
7856                  if (char === '-') {
7857                      this.transitionTo("commentStartDash" /* commentStartDash */);
7858                  }
7859                  else if (char === '>') {
7860                      this.delegate.finishComment();
7861                      this.transitionTo("beforeData" /* beforeData */);
7862                  }
7863                  else {
7864                      this.delegate.appendToCommentData(char);
7865                      this.transitionTo("comment" /* comment */);
7866                  }
7867              },
7868              commentStartDash: function () {
7869                  var char = this.consume();
7870                  if (char === '-') {
7871                      this.transitionTo("commentEnd" /* commentEnd */);
7872                  }
7873                  else if (char === '>') {
7874                      this.delegate.finishComment();
7875                      this.transitionTo("beforeData" /* beforeData */);
7876                  }
7877                  else {
7878                      this.delegate.appendToCommentData('-');
7879                      this.transitionTo("comment" /* comment */);
7880                  }
7881              },
7882              comment: function () {
7883                  var char = this.consume();
7884                  if (char === '-') {
7885                      this.transitionTo("commentEndDash" /* commentEndDash */);
7886                  }
7887                  else {
7888                      this.delegate.appendToCommentData(char);
7889                  }
7890              },
7891              commentEndDash: function () {
7892                  var char = this.consume();
7893                  if (char === '-') {
7894                      this.transitionTo("commentEnd" /* commentEnd */);
7895                  }
7896                  else {
7897                      this.delegate.appendToCommentData('-' + char);
7898                      this.transitionTo("comment" /* comment */);
7899                  }
7900              },
7901              commentEnd: function () {
7902                  var char = this.consume();
7903                  if (char === '>') {
7904                      this.delegate.finishComment();
7905                      this.transitionTo("beforeData" /* beforeData */);
7906                  }
7907                  else {
7908                      this.delegate.appendToCommentData('--' + char);
7909                      this.transitionTo("comment" /* comment */);
7910                  }
7911              },
7912              tagName: function () {
7913                  var char = this.consume();
7914                  if (isSpace(char)) {
7915                      this.transitionTo("beforeAttributeName" /* beforeAttributeName */);
7916                  }
7917                  else if (char === '/') {
7918                      this.transitionTo("selfClosingStartTag" /* selfClosingStartTag */);
7919                  }
7920                  else if (char === '>') {
7921                      this.delegate.finishTag();
7922                      this.transitionTo("beforeData" /* beforeData */);
7923                  }
7924                  else {
7925                      this.appendToTagName(char);
7926                  }
7927              },
7928              endTagName: function () {
7929                  var char = this.consume();
7930                  if (isSpace(char)) {
7931                      this.transitionTo("beforeAttributeName" /* beforeAttributeName */);
7932                      this.tagNameBuffer = '';
7933                  }
7934                  else if (char === '/') {
7935                      this.transitionTo("selfClosingStartTag" /* selfClosingStartTag */);
7936                      this.tagNameBuffer = '';
7937                  }
7938                  else if (char === '>') {
7939                      this.delegate.finishTag();
7940                      this.transitionTo("beforeData" /* beforeData */);
7941                      this.tagNameBuffer = '';
7942                  }
7943                  else {
7944                      this.appendToTagName(char);
7945                  }
7946              },
7947              beforeAttributeName: function () {
7948                  var char = this.peek();
7949                  if (isSpace(char)) {
7950                      this.consume();
7951                      return;
7952                  }
7953                  else if (char === '/') {
7954                      this.transitionTo("selfClosingStartTag" /* selfClosingStartTag */);
7955                      this.consume();
7956                  }
7957                  else if (char === '>') {
7958                      this.consume();
7959                      this.delegate.finishTag();
7960                      this.transitionTo("beforeData" /* beforeData */);
7961                  }
7962                  else if (char === '=') {
7963                      this.delegate.reportSyntaxError('attribute name cannot start with equals sign');
7964                      this.transitionTo("attributeName" /* attributeName */);
7965                      this.delegate.beginAttribute();
7966                      this.consume();
7967                      this.delegate.appendToAttributeName(char);
7968                  }
7969                  else {
7970                      this.transitionTo("attributeName" /* attributeName */);
7971                      this.delegate.beginAttribute();
7972                  }
7973              },
7974              attributeName: function () {
7975                  var char = this.peek();
7976                  if (isSpace(char)) {
7977                      this.transitionTo("afterAttributeName" /* afterAttributeName */);
7978                      this.consume();
7979                  }
7980                  else if (char === '/') {
7981                      this.delegate.beginAttributeValue(false);
7982                      this.delegate.finishAttributeValue();
7983                      this.consume();
7984                      this.transitionTo("selfClosingStartTag" /* selfClosingStartTag */);
7985                  }
7986                  else if (char === '=') {
7987                      this.transitionTo("beforeAttributeValue" /* beforeAttributeValue */);
7988                      this.consume();
7989                  }
7990                  else if (char === '>') {
7991                      this.delegate.beginAttributeValue(false);
7992                      this.delegate.finishAttributeValue();
7993                      this.consume();
7994                      this.delegate.finishTag();
7995                      this.transitionTo("beforeData" /* beforeData */);
7996                  }
7997                  else if (char === '"' || char === "'" || char === '<') {
7998                      this.delegate.reportSyntaxError(char + ' is not a valid character within attribute names');
7999                      this.consume();
8000                      this.delegate.appendToAttributeName(char);
8001                  }
8002                  else {
8003                      this.consume();
8004                      this.delegate.appendToAttributeName(char);
8005                  }
8006              },
8007              afterAttributeName: function () {
8008                  var char = this.peek();
8009                  if (isSpace(char)) {
8010                      this.consume();
8011                      return;
8012                  }
8013                  else if (char === '/') {
8014                      this.delegate.beginAttributeValue(false);
8015                      this.delegate.finishAttributeValue();
8016                      this.consume();
8017                      this.transitionTo("selfClosingStartTag" /* selfClosingStartTag */);
8018                  }
8019                  else if (char === '=') {
8020                      this.consume();
8021                      this.transitionTo("beforeAttributeValue" /* beforeAttributeValue */);
8022                  }
8023                  else if (char === '>') {
8024                      this.delegate.beginAttributeValue(false);
8025                      this.delegate.finishAttributeValue();
8026                      this.consume();
8027                      this.delegate.finishTag();
8028                      this.transitionTo("beforeData" /* beforeData */);
8029                  }
8030                  else {
8031                      this.delegate.beginAttributeValue(false);
8032                      this.delegate.finishAttributeValue();
8033                      this.transitionTo("attributeName" /* attributeName */);
8034                      this.delegate.beginAttribute();
8035                      this.consume();
8036                      this.delegate.appendToAttributeName(char);
8037                  }
8038              },
8039              beforeAttributeValue: function () {
8040                  var char = this.peek();
8041                  if (isSpace(char)) {
8042                      this.consume();
8043                  }
8044                  else if (char === '"') {
8045                      this.transitionTo("attributeValueDoubleQuoted" /* attributeValueDoubleQuoted */);
8046                      this.delegate.beginAttributeValue(true);
8047                      this.consume();
8048                  }
8049                  else if (char === "'") {
8050                      this.transitionTo("attributeValueSingleQuoted" /* attributeValueSingleQuoted */);
8051                      this.delegate.beginAttributeValue(true);
8052                      this.consume();
8053                  }
8054                  else if (char === '>') {
8055                      this.delegate.beginAttributeValue(false);
8056                      this.delegate.finishAttributeValue();
8057                      this.consume();
8058                      this.delegate.finishTag();
8059                      this.transitionTo("beforeData" /* beforeData */);
8060                  }
8061                  else {
8062                      this.transitionTo("attributeValueUnquoted" /* attributeValueUnquoted */);
8063                      this.delegate.beginAttributeValue(false);
8064                      this.consume();
8065                      this.delegate.appendToAttributeValue(char);
8066                  }
8067              },
8068              attributeValueDoubleQuoted: function () {
8069                  var char = this.consume();
8070                  if (char === '"') {
8071                      this.delegate.finishAttributeValue();
8072                      this.transitionTo("afterAttributeValueQuoted" /* afterAttributeValueQuoted */);
8073                  }
8074                  else if (char === '&') {
8075                      this.delegate.appendToAttributeValue(this.consumeCharRef() || '&');
8076                  }
8077                  else {
8078                      this.delegate.appendToAttributeValue(char);
8079                  }
8080              },
8081              attributeValueSingleQuoted: function () {
8082                  var char = this.consume();
8083                  if (char === "'") {
8084                      this.delegate.finishAttributeValue();
8085                      this.transitionTo("afterAttributeValueQuoted" /* afterAttributeValueQuoted */);
8086                  }
8087                  else if (char === '&') {
8088                      this.delegate.appendToAttributeValue(this.consumeCharRef() || '&');
8089                  }
8090                  else {
8091                      this.delegate.appendToAttributeValue(char);
8092                  }
8093              },
8094              attributeValueUnquoted: function () {
8095                  var char = this.peek();
8096                  if (isSpace(char)) {
8097                      this.delegate.finishAttributeValue();
8098                      this.consume();
8099                      this.transitionTo("beforeAttributeName" /* beforeAttributeName */);
8100                  }
8101                  else if (char === '/') {
8102                      this.delegate.finishAttributeValue();
8103                      this.consume();
8104                      this.transitionTo("selfClosingStartTag" /* selfClosingStartTag */);
8105                  }
8106                  else if (char === '&') {
8107                      this.consume();
8108                      this.delegate.appendToAttributeValue(this.consumeCharRef() || '&');
8109                  }
8110                  else if (char === '>') {
8111                      this.delegate.finishAttributeValue();
8112                      this.consume();
8113                      this.delegate.finishTag();
8114                      this.transitionTo("beforeData" /* beforeData */);
8115                  }
8116                  else {
8117                      this.consume();
8118                      this.delegate.appendToAttributeValue(char);
8119                  }
8120              },
8121              afterAttributeValueQuoted: function () {
8122                  var char = this.peek();
8123                  if (isSpace(char)) {
8124                      this.consume();
8125                      this.transitionTo("beforeAttributeName" /* beforeAttributeName */);
8126                  }
8127                  else if (char === '/') {
8128                      this.consume();
8129                      this.transitionTo("selfClosingStartTag" /* selfClosingStartTag */);
8130                  }
8131                  else if (char === '>') {
8132                      this.consume();
8133                      this.delegate.finishTag();
8134                      this.transitionTo("beforeData" /* beforeData */);
8135                  }
8136                  else {
8137                      this.transitionTo("beforeAttributeName" /* beforeAttributeName */);
8138                  }
8139              },
8140              selfClosingStartTag: function () {
8141                  var char = this.peek();
8142                  if (char === '>') {
8143                      this.consume();
8144                      this.delegate.markTagAsSelfClosing();
8145                      this.delegate.finishTag();
8146                      this.transitionTo("beforeData" /* beforeData */);
8147                  }
8148                  else {
8149                      this.transitionTo("beforeAttributeName" /* beforeAttributeName */);
8150                  }
8151              },
8152              endTagOpen: function () {
8153                  var char = this.consume();
8154                  if (char === '@' || char === ':' || isAlpha(char)) {
8155                      this.transitionTo("endTagName" /* endTagName */);
8156                      this.tagNameBuffer = '';
8157                      this.delegate.beginEndTag();
8158                      this.appendToTagName(char);
8159                  }
8160              }
8161          };
8162          this.reset();
8163      }
8164      EventedTokenizer.prototype.reset = function () {
8165          this.transitionTo("beforeData" /* beforeData */);
8166          this.input = '';
8167          this.tagNameBuffer = '';
8168          this.index = 0;
8169          this.line = 1;
8170          this.column = 0;
8171          this.delegate.reset();
8172      };
8173      EventedTokenizer.prototype.transitionTo = function (state) {
8174          this.state = state;
8175      };
8176      EventedTokenizer.prototype.tokenize = function (input) {
8177          this.reset();
8178          this.tokenizePart(input);
8179          this.tokenizeEOF();
8180      };
8181      EventedTokenizer.prototype.tokenizePart = function (input) {
8182          this.input += preprocessInput(input);
8183          while (this.index < this.input.length) {
8184              var handler = this.states[this.state];
8185              if (handler !== undefined) {
8186                  handler.call(this);
8187              }
8188              else {
8189                  throw new Error("unhandled state " + this.state);
8190              }
8191          }
8192      };
8193      EventedTokenizer.prototype.tokenizeEOF = function () {
8194          this.flushData();
8195      };
8196      EventedTokenizer.prototype.flushData = function () {
8197          if (this.state === 'data') {
8198              this.delegate.finishData();
8199              this.transitionTo("beforeData" /* beforeData */);
8200          }
8201      };
8202      EventedTokenizer.prototype.peek = function () {
8203          return this.input.charAt(this.index);
8204      };
8205      EventedTokenizer.prototype.consume = function () {
8206          var char = this.peek();
8207          this.index++;
8208          if (char === '\n') {
8209              this.line++;
8210              this.column = 0;
8211          }
8212          else {
8213              this.column++;
8214          }
8215          return char;
8216      };
8217      EventedTokenizer.prototype.consumeCharRef = function () {
8218          var endIndex = this.input.indexOf(';', this.index);
8219          if (endIndex === -1) {
8220              return;
8221          }
8222          var entity = this.input.slice(this.index, endIndex);
8223          var chars = this.entityParser.parse(entity);
8224          if (chars) {
8225              var count = entity.length;
8226              // consume the entity chars
8227              while (count) {
8228                  this.consume();
8229                  count--;
8230              }
8231              // consume the `;`
8232              this.consume();
8233              return chars;
8234          }
8235      };
8236      EventedTokenizer.prototype.markTagStart = function () {
8237          this.delegate.tagOpen();
8238      };
8239      EventedTokenizer.prototype.appendToTagName = function (char) {
8240          this.tagNameBuffer += char;
8241          this.delegate.appendToTagName(char);
8242      };
8243      EventedTokenizer.prototype.isIgnoredEndTag = function () {
8244          var tag = this.tagNameBuffer.toLowerCase();
8245          return (tag === 'title' && this.input.substring(this.index, this.index + 8) !== '</title>') ||
8246              (tag === 'style' && this.input.substring(this.index, this.index + 8) !== '</style>') ||
8247              (tag === 'script' && this.input.substring(this.index, this.index + 9) !== '</script>');
8248      };
8249      return EventedTokenizer;
8250  }());
8251  
8252  var Tokenizer = /** @class */ (function () {
8253      function Tokenizer(entityParser, options) {
8254          if (options === void 0) { options = {}; }
8255          this.options = options;
8256          this.token = null;
8257          this.startLine = 1;
8258          this.startColumn = 0;
8259          this.tokens = [];
8260          this.tokenizer = new EventedTokenizer(this, entityParser);
8261          this._currentAttribute = undefined;
8262      }
8263      Tokenizer.prototype.tokenize = function (input) {
8264          this.tokens = [];
8265          this.tokenizer.tokenize(input);
8266          return this.tokens;
8267      };
8268      Tokenizer.prototype.tokenizePart = function (input) {
8269          this.tokens = [];
8270          this.tokenizer.tokenizePart(input);
8271          return this.tokens;
8272      };
8273      Tokenizer.prototype.tokenizeEOF = function () {
8274          this.tokens = [];
8275          this.tokenizer.tokenizeEOF();
8276          return this.tokens[0];
8277      };
8278      Tokenizer.prototype.reset = function () {
8279          this.token = null;
8280          this.startLine = 1;
8281          this.startColumn = 0;
8282      };
8283      Tokenizer.prototype.current = function () {
8284          var token = this.token;
8285          if (token === null) {
8286              throw new Error('token was unexpectedly null');
8287          }
8288          if (arguments.length === 0) {
8289              return token;
8290          }
8291          for (var i = 0; i < arguments.length; i++) {
8292              if (token.type === arguments[i]) {
8293                  return token;
8294              }
8295          }
8296          throw new Error("token type was unexpectedly " + token.type);
8297      };
8298      Tokenizer.prototype.push = function (token) {
8299          this.token = token;
8300          this.tokens.push(token);
8301      };
8302      Tokenizer.prototype.currentAttribute = function () {
8303          return this._currentAttribute;
8304      };
8305      Tokenizer.prototype.addLocInfo = function () {
8306          if (this.options.loc) {
8307              this.current().loc = {
8308                  start: {
8309                      line: this.startLine,
8310                      column: this.startColumn
8311                  },
8312                  end: {
8313                      line: this.tokenizer.line,
8314                      column: this.tokenizer.column
8315                  }
8316              };
8317          }
8318          this.startLine = this.tokenizer.line;
8319          this.startColumn = this.tokenizer.column;
8320      };
8321      // Data
8322      Tokenizer.prototype.beginData = function () {
8323          this.push({
8324              type: "Chars" /* Chars */,
8325              chars: ''
8326          });
8327      };
8328      Tokenizer.prototype.appendToData = function (char) {
8329          this.current("Chars" /* Chars */).chars += char;
8330      };
8331      Tokenizer.prototype.finishData = function () {
8332          this.addLocInfo();
8333      };
8334      // Comment
8335      Tokenizer.prototype.beginComment = function () {
8336          this.push({
8337              type: "Comment" /* Comment */,
8338              chars: ''
8339          });
8340      };
8341      Tokenizer.prototype.appendToCommentData = function (char) {
8342          this.current("Comment" /* Comment */).chars += char;
8343      };
8344      Tokenizer.prototype.finishComment = function () {
8345          this.addLocInfo();
8346      };
8347      // Tags - basic
8348      Tokenizer.prototype.tagOpen = function () { };
8349      Tokenizer.prototype.beginStartTag = function () {
8350          this.push({
8351              type: "StartTag" /* StartTag */,
8352              tagName: '',
8353              attributes: [],
8354              selfClosing: false
8355          });
8356      };
8357      Tokenizer.prototype.beginEndTag = function () {
8358          this.push({
8359              type: "EndTag" /* EndTag */,
8360              tagName: ''
8361          });
8362      };
8363      Tokenizer.prototype.finishTag = function () {
8364          this.addLocInfo();
8365      };
8366      Tokenizer.prototype.markTagAsSelfClosing = function () {
8367          this.current("StartTag" /* StartTag */).selfClosing = true;
8368      };
8369      // Tags - name
8370      Tokenizer.prototype.appendToTagName = function (char) {
8371          this.current("StartTag" /* StartTag */, "EndTag" /* EndTag */).tagName += char;
8372      };
8373      // Tags - attributes
8374      Tokenizer.prototype.beginAttribute = function () {
8375          this._currentAttribute = ['', '', false];
8376      };
8377      Tokenizer.prototype.appendToAttributeName = function (char) {
8378          this.currentAttribute()[0] += char;
8379      };
8380      Tokenizer.prototype.beginAttributeValue = function (isQuoted) {
8381          this.currentAttribute()[2] = isQuoted;
8382      };
8383      Tokenizer.prototype.appendToAttributeValue = function (char) {
8384          this.currentAttribute()[1] += char;
8385      };
8386      Tokenizer.prototype.finishAttributeValue = function () {
8387          this.current("StartTag" /* StartTag */).attributes.push(this._currentAttribute);
8388      };
8389      Tokenizer.prototype.reportSyntaxError = function (message) {
8390          this.current().syntaxError = message;
8391      };
8392      return Tokenizer;
8393  }());
8394  
8395  function tokenize(input, options) {
8396      var tokenizer = new Tokenizer(new EntityParser(namedCharRefs), options);
8397      return tokenizer.tokenize(input);
8398  }
8399  
8400  
8401  
8402  // EXTERNAL MODULE: external {"this":["wp","htmlEntities"]}
8403  var external_this_wp_htmlEntities_ = __webpack_require__(54);
8404  
8405  // CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/validation/logger.js
8406  function createLogger() {
8407    /**
8408     * Creates a log handler with block validation prefix.
8409     *
8410     * @param {Function} logger Original logger function.
8411     *
8412     * @return {Function} Augmented logger function.
8413     */
8414    function createLogHandler(logger) {
8415      var log = function log(message) {
8416        for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
8417          args[_key - 1] = arguments[_key];
8418        }
8419  
8420        return logger.apply(void 0, ['Block validation: ' + message].concat(args));
8421      }; // In test environments, pre-process the sprintf message to improve
8422      // readability of error messages. We'd prefer to avoid pulling in this
8423      // dependency in runtime environments, and it can be dropped by a combo
8424      // of Webpack env substitution + UglifyJS dead code elimination.
8425  
8426  
8427      if (false) {}
8428  
8429      return log;
8430    }
8431  
8432    return {
8433      // eslint-disable-next-line no-console
8434      error: createLogHandler(console.error),
8435      // eslint-disable-next-line no-console
8436      warning: createLogHandler(console.warn),
8437      getItems: function getItems() {
8438        return [];
8439      }
8440    };
8441  }
8442  function createQueuedLogger() {
8443    /**
8444     * The list of enqueued log actions to print.
8445     *
8446     * @type {Array}
8447     */
8448    var queue = [];
8449    var logger = createLogger();
8450    return {
8451      error: function error() {
8452        for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
8453          args[_key2] = arguments[_key2];
8454        }
8455  
8456        queue.push({
8457          log: logger.error,
8458          args: args
8459        });
8460      },
8461      warning: function warning() {
8462        for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
8463          args[_key3] = arguments[_key3];
8464        }
8465  
8466        queue.push({
8467          log: logger.warning,
8468          args: args
8469        });
8470      },
8471      getItems: function getItems() {
8472        return queue;
8473      }
8474    };
8475  }
8476  
8477  // EXTERNAL MODULE: external {"this":["wp","isShallowEqual"]}
8478  var external_this_wp_isShallowEqual_ = __webpack_require__(46);
8479  var external_this_wp_isShallowEqual_default = /*#__PURE__*/__webpack_require__.n(external_this_wp_isShallowEqual_);
8480  
8481  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
8482  var esm_extends = __webpack_require__(12);
8483  
8484  // EXTERNAL MODULE: external {"this":["wp","compose"]}
8485  var external_this_wp_compose_ = __webpack_require__(8);
8486  
8487  // CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/block-content-provider/index.js
8488  
8489  
8490  
8491  /**
8492   * WordPress dependencies
8493   */
8494  
8495  
8496  /**
8497   * Internal dependencies
8498   */
8499  
8500  
8501  
8502  var _createContext = Object(external_this_wp_element_["createContext"])(function () {}),
8503      Consumer = _createContext.Consumer,
8504      Provider = _createContext.Provider;
8505  /**
8506   * An internal block component used in block content serialization to inject
8507   * nested block content within the `save` implementation of the ancestor
8508   * component in which it is nested. The component provides a pre-bound
8509   * `BlockContent` component via context, which is used by the developer-facing
8510   * `InnerBlocks.Content` component to render block content.
8511   *
8512   * @example
8513   *
8514   * ```jsx
8515   * <BlockContentProvider innerBlocks={ innerBlocks }>
8516   *     { blockSaveElement }
8517   * </BlockContentProvider>
8518   * ```
8519   *
8520   * @return {WPComponent} Element with BlockContent injected via context.
8521   */
8522  
8523  
8524  var block_content_provider_BlockContentProvider = function BlockContentProvider(_ref) {
8525    var children = _ref.children,
8526        innerBlocks = _ref.innerBlocks;
8527  
8528    var BlockContent = function BlockContent() {
8529      // Value is an array of blocks, so defer to block serializer
8530      var html = serialize(innerBlocks, {
8531        isInnerBlocks: true
8532      }); // Use special-cased raw HTML tag to avoid default escaping
8533  
8534      return Object(external_this_wp_element_["createElement"])(external_this_wp_element_["RawHTML"], null, html);
8535    };
8536  
8537    return Object(external_this_wp_element_["createElement"])(Provider, {
8538      value: BlockContent
8539    }, children);
8540  };
8541  /**
8542   * A Higher Order Component used to inject BlockContent using context to the
8543   * wrapped component.
8544   *
8545   * @return {WPComponent} Enhanced component with injected BlockContent as prop.
8546   */
8547  
8548  
8549  var withBlockContentContext = Object(external_this_wp_compose_["createHigherOrderComponent"])(function (OriginalComponent) {
8550    return function (props) {
8551      return Object(external_this_wp_element_["createElement"])(Consumer, null, function (context) {
8552        return Object(external_this_wp_element_["createElement"])(OriginalComponent, Object(esm_extends["a" /* default */])({}, props, {
8553          BlockContent: context
8554        }));
8555      });
8556    };
8557  }, 'withBlockContentContext');
8558  /* harmony default export */ var block_content_provider = (block_content_provider_BlockContentProvider);
8559  
8560  // CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/serializer.js
8561  
8562  
8563  
8564  /**
8565   * External dependencies
8566   */
8567  
8568  /**
8569   * WordPress dependencies
8570   */
8571  
8572  
8573  
8574  
8575  /**
8576   * Internal dependencies
8577   */
8578  
8579  
8580  
8581  
8582  /**
8583   * @typedef {Object} WPBlockSerializationOptions Serialization Options.
8584   *
8585   * @property {boolean} isInnerBlocks Whether we are serializing inner blocks.
8586   */
8587  
8588  /**
8589   * Returns the block's default classname from its name.
8590   *
8591   * @param {string} blockName The block name.
8592   *
8593   * @return {string} The block's default class.
8594   */
8595  
8596  function getBlockDefaultClassName(blockName) {
8597    // Generated HTML classes for blocks follow the `wp-block-{name}` nomenclature.
8598    // Blocks provided by WordPress drop the prefixes 'core/' or 'core-' (used in 'core-embed/').
8599    var className = 'wp-block-' + blockName.replace(/\//, '-').replace(/^core-/, '');
8600    return Object(external_this_wp_hooks_["applyFilters"])('blocks.getBlockDefaultClassName', className, blockName);
8601  }
8602  /**
8603   * Returns the block's default menu item classname from its name.
8604   *
8605   * @param {string} blockName The block name.
8606   *
8607   * @return {string} The block's default menu item class.
8608   */
8609  
8610  function getBlockMenuDefaultClassName(blockName) {
8611    // Generated HTML classes for blocks follow the `editor-block-list-item-{name}` nomenclature.
8612    // Blocks provided by WordPress drop the prefixes 'core/' or 'core-' (used in 'core-embed/').
8613    var className = 'editor-block-list-item-' + blockName.replace(/\//, '-').replace(/^core-/, '');
8614    return Object(external_this_wp_hooks_["applyFilters"])('blocks.getBlockMenuDefaultClassName', className, blockName);
8615  }
8616  /**
8617   * Given a block type containing a save render implementation and attributes, returns the
8618   * enhanced element to be saved or string when raw HTML expected.
8619   *
8620   * @param {string|Object} blockTypeOrName   Block type or name.
8621   * @param {Object}        attributes        Block attributes.
8622   * @param {?Array}        innerBlocks       Nested blocks.
8623   *
8624   * @return {Object|string} Save element or raw HTML string.
8625   */
8626  
8627  function getSaveElement(blockTypeOrName, attributes) {
8628    var innerBlocks = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
8629    var blockType = normalizeBlockType(blockTypeOrName);
8630    var save = blockType.save; // Component classes are unsupported for save since serialization must
8631    // occur synchronously. For improved interoperability with higher-order
8632    // components which often return component class, emulate basic support.
8633  
8634    if (save.prototype instanceof external_this_wp_element_["Component"]) {
8635      var instance = new save({
8636        attributes: attributes
8637      });
8638      save = instance.render.bind(instance);
8639    }
8640  
8641    var element = save({
8642      attributes: attributes,
8643      innerBlocks: innerBlocks
8644    });
8645  
8646    if (Object(external_this_lodash_["isObject"])(element) && Object(external_this_wp_hooks_["hasFilter"])('blocks.getSaveContent.extraProps')) {
8647      /**
8648       * Filters the props applied to the block save result element.
8649       *
8650       * @param {Object}  props      Props applied to save element.
8651       * @param {WPBlock} blockType  Block type definition.
8652       * @param {Object}  attributes Block attributes.
8653       */
8654      var props = Object(external_this_wp_hooks_["applyFilters"])('blocks.getSaveContent.extraProps', Object(objectSpread["a" /* default */])({}, element.props), blockType, attributes);
8655  
8656      if (!external_this_wp_isShallowEqual_default()(props, element.props)) {
8657        element = Object(external_this_wp_element_["cloneElement"])(element, props);
8658      }
8659    }
8660    /**
8661     * Filters the save result of a block during serialization.