-(function(e, a) { for(var i in a) e[i] = a[i]; }(exports, /******/ (function(modules) { // webpackBootstrap
-/******/ // The module cache
-/******/ var installedModules = {};
-/******/
-/******/ // The require function
-/******/ function __webpack_require__(moduleId) {
-/******/
-/******/ // Check if module is in cache
-/******/ if(installedModules[moduleId]) {
-/******/ return installedModules[moduleId].exports;
-/******/ }
-/******/ // Create a new module (and put it into the cache)
-/******/ var module = installedModules[moduleId] = {
-/******/ i: moduleId,
-/******/ l: false,
-/******/ exports: {}
-/******/ };
-/******/
-/******/ // Execute the module function
-/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
-/******/
-/******/ // Flag the module as loaded
-/******/ module.l = true;
-/******/
-/******/ // Return the exports of the module
-/******/ return module.exports;
-/******/ }
-/******/
-/******/
-/******/ // expose the modules object (__webpack_modules__)
-/******/ __webpack_require__.m = modules;
-/******/
-/******/ // expose the module cache
-/******/ __webpack_require__.c = installedModules;
-/******/
-/******/ // define getter function for harmony exports
-/******/ __webpack_require__.d = function(exports, name, getter) {
-/******/ if(!__webpack_require__.o(exports, name)) {
-/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
-/******/ }
-/******/ };
-/******/
-/******/ // define __esModule on exports
-/******/ __webpack_require__.r = function(exports) {
-/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
-/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
-/******/ }
-/******/ Object.defineProperty(exports, '__esModule', { value: true });
-/******/ };
-/******/
-/******/ // create a fake namespace object
-/******/ // mode & 1: value is a module id, require it
-/******/ // mode & 2: merge all properties of value into the ns
-/******/ // mode & 4: return value when already ns object
-/******/ // mode & 8|1: behave like require
-/******/ __webpack_require__.t = function(value, mode) {
-/******/ if(mode & 1) value = __webpack_require__(value);
-/******/ if(mode & 8) return value;
-/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
-/******/ var ns = Object.create(null);
-/******/ __webpack_require__.r(ns);
-/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
-/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
-/******/ return ns;
-/******/ };
-/******/
-/******/ // getDefaultExport function for compatibility with non-harmony modules
-/******/ __webpack_require__.n = function(module) {
-/******/ var getter = module && module.__esModule ?
-/******/ function getDefault() { return module['default']; } :
-/******/ function getModuleExports() { return module; };
-/******/ __webpack_require__.d(getter, 'a', getter);
-/******/ return getter;
-/******/ };
-/******/
-/******/ // Object.prototype.hasOwnProperty.call
-/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
-/******/
-/******/ // __webpack_public_path__
-/******/ __webpack_require__.p = "";
-/******/
-/******/
-/******/ // Load entry module and return exports
-/******/ return __webpack_require__(__webpack_require__.s = 0);
-/******/ })
-/************************************************************************/
-/******/ ([
-/* 0 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-Object.defineProperty(exports, "__esModule", { value: true });
-exports.activate = void 0;
-const coc_nvim_1 = __webpack_require__(1);
-const engine_1 = __webpack_require__(2);
-const documentSelector = [
- {
- language: 'markdown',
- scheme: 'file'
- },
- {
- language: 'markdown',
- scheme: 'untitled'
- }
-];
-let documentVersion = 0;
-const engine = new engine_1.MarkdownlintEngine();
-const config = coc_nvim_1.workspace.getConfiguration('markdownlint');
-function didOpenTextDocument(document) {
- if (config.get('onOpen', true)) {
- engine.lint(document);
- }
-}
-async function didChangeTextDocument(params) {
- if (!config.get('onChange', true)) {
- return;
- }
- if (params.textDocument.version && documentVersion !== params.textDocument.version) {
- documentVersion = params.textDocument.version;
- const { document } = await coc_nvim_1.workspace.getCurrentState();
- engine.lint(document);
- }
-}
-async function didSaveTextDocument(document) {
- if (config.get('onSave', true)) {
- engine.lint(document);
- }
-}
-async function activate(context) {
- await engine.parseConfig();
- context.subscriptions.push(coc_nvim_1.languages.registerCodeActionProvider(documentSelector, engine, 'markdownlint'), coc_nvim_1.commands.registerCommand(engine.fixAllCommandName, async () => {
- const { document } = await coc_nvim_1.workspace.getCurrentState();
- engine.fixAll(document);
- }), coc_nvim_1.workspace.onDidOpenTextDocument(didOpenTextDocument), coc_nvim_1.workspace.onDidChangeTextDocument(didChangeTextDocument), coc_nvim_1.workspace.onDidSaveTextDocument(didSaveTextDocument), coc_nvim_1.events.on('BufEnter', bufnr => {
- if (!bufnr) {
- return;
- }
- const doc = coc_nvim_1.workspace.getDocument(bufnr);
- if (!doc) {
- return;
- }
- didOpenTextDocument(doc.textDocument);
- }));
- coc_nvim_1.workspace.documents.map((doc) => {
- didOpenTextDocument(doc.textDocument);
- });
-}
-exports.activate = activate;
-
-
-/***/ }),
-/* 1 */
-/***/ (function(module, exports) {
-
-module.exports = require("coc.nvim");
-
-/***/ }),
-/* 2 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-var __importDefault = (this && this.__importDefault) || function (mod) {
- return (mod && mod.__esModule) ? mod : { "default": mod };
-};
-Object.defineProperty(exports, "__esModule", { value: true });
-exports.MarkdownlintEngine = void 0;
-const coc_nvim_1 = __webpack_require__(1);
-const deep_extend_1 = __importDefault(__webpack_require__(3));
-const fs_1 = __importDefault(__webpack_require__(4));
-const js_yaml_1 = __importDefault(__webpack_require__(5));
-const markdownlint_1 = __importDefault(__webpack_require__(37));
-const markdownlint_rule_helpers_1 = __webpack_require__(156);
-const path_1 = __importDefault(__webpack_require__(38));
-const rc_1 = __importDefault(__webpack_require__(157));
-const vscode_languageserver_protocol_1 = __webpack_require__(162);
-const projectConfigFiles = ['.markdownlint.json', '.markdownlint.yaml', '.markdownlint.yml'];
-const configFileParsers = [JSON.parse, js_yaml_1.default.safeLoad];
-class MarkdownlintEngine {
- constructor() {
- this.fixAllCommandName = 'markdownlint.fixAll';
- this.source = 'markdownlint';
- this.outputChannel = coc_nvim_1.workspace.createOutputChannel(this.source);
- this.diagnosticCollection = coc_nvim_1.languages.createDiagnosticCollection(this.source);
- this.config = {};
- }
- outputLine(message) {
- if (this.outputChannel) {
- this.outputChannel.appendLine(`[${new Date().toLocaleTimeString()}] ${message}`);
- }
- }
- async parseConfig() {
- try {
- this.config = rc_1.default(this.source, {});
- this.outputLine(`Info: global config: ${JSON.stringify(rc_1.default(this.source, {}))}`);
- }
- catch (e) {
- this.outputLine(`Error: global config parse failed: ${e}`);
- }
- try {
- const preferences = coc_nvim_1.workspace.getConfiguration('coc.preferences');
- const rootFolder = await coc_nvim_1.workspace.resolveRootFolder(coc_nvim_1.Uri.parse(coc_nvim_1.workspace.uri), preferences.get('rootPatterns', []));
- for (const projectConfigFile of projectConfigFiles) {
- const fullPath = path_1.default.join(rootFolder, projectConfigFile);
- if (fs_1.default.existsSync(fullPath)) {
- // @ts-ignore
- const projectConfig = markdownlint_1.default.readConfigSync(fullPath, configFileParsers);
- this.config = deep_extend_1.default(this.config, projectConfig);
- this.outputLine(`Info: local config: ${fullPath}, ${JSON.stringify(projectConfig)}`);
- break;
- }
- }
- }
- catch (e) {
- this.outputLine(`Error: local config parse failed: ${e}`);
- }
- const cocConfig = coc_nvim_1.workspace.getConfiguration('markdownlint').get('config');
- if (cocConfig) {
- this.config = deep_extend_1.default(this.config, cocConfig);
- this.outputLine(`Info: config from coc-settings.json: ${JSON.stringify(cocConfig)}`);
- }
- this.outputLine(`Info: full config: ${JSON.stringify(this.config)}`);
- }
- markdownlintWrapper(document) {
- const options = {
- resultVersion: 3,
- config: this.config,
- // customRules: customRules,
- strings: {
- [document.uri]: document.getText()
- }
- };
- let results = [];
- try {
- results = markdownlint_1.default.sync(options)[document.uri];
- }
- catch (e) {
- this.outputLine(`Error: lint exception: ${e.stack}`);
- }
- return results;
- }
- async provideCodeActions(document, _range, context) {
- const codeActions = [];
- const fixInfoDiagnostics = [];
- for (const diagnostic of context.diagnostics) {
- // @ts-ignore
- if (diagnostic.fixInfo) {
- // @ts-ignore
- const lineNumber = diagnostic.fixInfo.lineNumber - 1 || diagnostic.range.start.line;
- const line = await coc_nvim_1.workspace.getLine(document.uri, lineNumber);
- // @ts-ignore
- const newText = markdownlint_rule_helpers_1.applyFix(line, diagnostic.fixInfo, '\n');
- const edit = { changes: {} };
- if (typeof newText === 'string') {
- const range = vscode_languageserver_protocol_1.Range.create(lineNumber, 0, lineNumber, line.length);
- edit.changes[document.uri] = [vscode_languageserver_protocol_1.TextEdit.replace(range, newText)];
- }
- else {
- edit.changes[document.uri] = [vscode_languageserver_protocol_1.TextEdit.del(diagnostic.range)];
- }
- const title = `Fix: ${diagnostic.message.split(':')[0]}`;
- const action = {
- title,
- edit,
- diagnostics: [...context.diagnostics]
- };
- fixInfoDiagnostics.push(diagnostic);
- codeActions.push(action);
- }
- }
- if (fixInfoDiagnostics.length) {
- const title = 'Fix All error found by markdownlint';
- const sourceFixAllAction = {
- title,
- kind: vscode_languageserver_protocol_1.CodeActionKind.SourceFixAll,
- diagnostics: fixInfoDiagnostics,
- command: {
- title,
- command: this.fixAllCommandName
- }
- };
- codeActions.push(sourceFixAllAction);
- }
- return codeActions;
- }
- lint(document) {
- this.diagnosticCollection.clear();
- if (document.languageId !== 'markdown') {
- return;
- }
- const results = this.markdownlintWrapper(document);
- if (!results.length) {
- return;
- }
- const diagnostics = [];
- results.forEach((result) => {
- const ruleDescription = result.ruleDescription;
- let message = result.ruleNames.join('/') + ': ' + ruleDescription;
- if (result.errorDetail) {
- message += ' [' + result.errorDetail + ']';
- }
- const start = vscode_languageserver_protocol_1.Position.create(result.lineNumber - 1, 0);
- const end = vscode_languageserver_protocol_1.Position.create(result.lineNumber - 1, 0);
- if (result.errorRange) {
- start.character = result.errorRange[0] - 1;
- end.character = start.character + result.errorRange[1];
- }
- const range = vscode_languageserver_protocol_1.Range.create(start, end);
- const diagnostic = vscode_languageserver_protocol_1.Diagnostic.create(range, message);
- diagnostic.severity = vscode_languageserver_protocol_1.DiagnosticSeverity.Warning;
- diagnostic.source = this.source;
- // @ts-ignore
- diagnostic.fixInfo = result.fixInfo;
- diagnostics.push(diagnostic);
- });
- this.diagnosticCollection.set(document.uri, diagnostics);
- }
- async fixAll(document) {
- const results = this.markdownlintWrapper(document);
- if (!results.length) {
- return;
- }
- const text = document.getText();
- const fixedText = markdownlint_rule_helpers_1.applyFixes(text, results);
- if (text != fixedText) {
- const doc = coc_nvim_1.workspace.getDocument(document.uri);
- const end = vscode_languageserver_protocol_1.Position.create(doc.lineCount - 1, doc.getline(doc.lineCount - 1).length);
- const edit = {
- changes: {
- [document.uri]: [vscode_languageserver_protocol_1.TextEdit.replace(vscode_languageserver_protocol_1.Range.create(vscode_languageserver_protocol_1.Position.create(0, 0), end), fixedText)]
- }
- };
- await coc_nvim_1.workspace.applyEdit(edit);
- }
- }
-}
-exports.MarkdownlintEngine = MarkdownlintEngine;
-
-
-/***/ }),
-/* 3 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/*!
- * @description Recursive object extending
- * @author Viacheslav Lotsmanov <lotsmanov89@gmail.com>
- * @license MIT
- *
- * The MIT License (MIT)
- *
- * Copyright (c) 2013-2018 Viacheslav Lotsmanov
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy of
- * this software and associated documentation files (the "Software"), to deal in
- * the Software without restriction, including without limitation the rights to
- * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
- * the Software, and to permit persons to whom the Software is furnished to do so,
- * subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
- * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
- * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-
-function isSpecificValue(val) {
- return (
- val instanceof Buffer
- || val instanceof Date
- || val instanceof RegExp
- ) ? true : false;
-}
-
-function cloneSpecificValue(val) {
- if (val instanceof Buffer) {
- var x = Buffer.alloc
- ? Buffer.alloc(val.length)
- : new Buffer(val.length);
- val.copy(x);
- return x;
- } else if (val instanceof Date) {
- return new Date(val.getTime());
- } else if (val instanceof RegExp) {
- return new RegExp(val);
- } else {
- throw new Error('Unexpected situation');
- }
-}
-
-/**
- * Recursive cloning array.
- */
-function deepCloneArray(arr) {
- var clone = [];
- arr.forEach(function (item, index) {
- if (typeof item === 'object' && item !== null) {
- if (Array.isArray(item)) {
- clone[index] = deepCloneArray(item);
- } else if (isSpecificValue(item)) {
- clone[index] = cloneSpecificValue(item);
- } else {
- clone[index] = deepExtend({}, item);
- }
- } else {
- clone[index] = item;
- }
- });
- return clone;
-}
-
-function safeGetProperty(object, property) {
- return property === '__proto__' ? undefined : object[property];
-}
-
-/**
- * Extening object that entered in first argument.
- *
- * Returns extended object or false if have no target object or incorrect type.
- *
- * If you wish to clone source object (without modify it), just use empty new
- * object as first argument, like this:
- * deepExtend({}, yourObj_1, [yourObj_N]);
- */
-var deepExtend = module.exports = function (/*obj_1, [obj_2], [obj_N]*/) {
- if (arguments.length < 1 || typeof arguments[0] !== 'object') {
- return false;
- }
-
- if (arguments.length < 2) {
- return arguments[0];
- }
-
- var target = arguments[0];
-
- // convert arguments to array and cut off target object
- var args = Array.prototype.slice.call(arguments, 1);
-
- var val, src, clone;
-
- args.forEach(function (obj) {
- // skip argument if isn't an object, is null, or is an array
- if (typeof obj !== 'object' || obj === null || Array.isArray(obj)) {
- return;
- }
-
- Object.keys(obj).forEach(function (key) {
- src = safeGetProperty(target, key); // source value
- val = safeGetProperty(obj, key); // new value
-
- // recursion prevention
- if (val === target) {
- return;
-
- /**
- * if new value isn't object then just overwrite by new value
- * instead of extending.
- */
- } else if (typeof val !== 'object' || val === null) {
- target[key] = val;
- return;
-
- // just clone arrays (and recursive clone objects inside)
- } else if (Array.isArray(val)) {
- target[key] = deepCloneArray(val);
- return;
-
- // custom cloning and overwrite for specific objects
- } else if (isSpecificValue(val)) {
- target[key] = cloneSpecificValue(val);
- return;
-
- // overwrite by new value if source isn't object or array
- } else if (typeof src !== 'object' || src === null || Array.isArray(src)) {
- target[key] = deepExtend({}, val);
- return;
-
- // source value and new value is objects both, extending...
- } else {
- target[key] = deepExtend(src, val);
- return;
- }
- });
- });
-
- return target;
-};
-
-
-/***/ }),
-/* 4 */
-/***/ (function(module, exports) {
-
-module.exports = require("fs");
-
-/***/ }),
-/* 5 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-
-var yaml = __webpack_require__(6);
-
-
-module.exports = yaml;
-
-
-/***/ }),
-/* 6 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-
-var loader = __webpack_require__(7);
-var dumper = __webpack_require__(36);
-
-
-function deprecated(name) {
- return function () {
- throw new Error('Function ' + name + ' is deprecated and cannot be used.');
- };
-}
-
-
-module.exports.Type = __webpack_require__(13);
-module.exports.Schema = __webpack_require__(12);
-module.exports.FAILSAFE_SCHEMA = __webpack_require__(16);
-module.exports.JSON_SCHEMA = __webpack_require__(15);
-module.exports.CORE_SCHEMA = __webpack_require__(14);
-module.exports.DEFAULT_SAFE_SCHEMA = __webpack_require__(11);
-module.exports.DEFAULT_FULL_SCHEMA = __webpack_require__(31);
-module.exports.load = loader.load;
-module.exports.loadAll = loader.loadAll;
-module.exports.safeLoad = loader.safeLoad;
-module.exports.safeLoadAll = loader.safeLoadAll;
-module.exports.dump = dumper.dump;
-module.exports.safeDump = dumper.safeDump;
-module.exports.YAMLException = __webpack_require__(9);
-
-// Deprecated schema names from JS-YAML 2.0.x
-module.exports.MINIMAL_SCHEMA = __webpack_require__(16);
-module.exports.SAFE_SCHEMA = __webpack_require__(11);
-module.exports.DEFAULT_SCHEMA = __webpack_require__(31);
-
-// Deprecated functions from JS-YAML 1.x.x
-module.exports.scan = deprecated('scan');
-module.exports.parse = deprecated('parse');
-module.exports.compose = deprecated('compose');
-module.exports.addConstructor = deprecated('addConstructor');
-
-
-/***/ }),
-/* 7 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-/*eslint-disable max-len,no-use-before-define*/
-
-var common = __webpack_require__(8);
-var YAMLException = __webpack_require__(9);
-var Mark = __webpack_require__(10);
-var DEFAULT_SAFE_SCHEMA = __webpack_require__(11);
-var DEFAULT_FULL_SCHEMA = __webpack_require__(31);
-
-
-var _hasOwnProperty = Object.prototype.hasOwnProperty;
-
-
-var CONTEXT_FLOW_IN = 1;
-var CONTEXT_FLOW_OUT = 2;
-var CONTEXT_BLOCK_IN = 3;
-var CONTEXT_BLOCK_OUT = 4;
-
-
-var CHOMPING_CLIP = 1;
-var CHOMPING_STRIP = 2;
-var CHOMPING_KEEP = 3;
-
-
-var PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;
-var PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/;
-var PATTERN_FLOW_INDICATORS = /[,\[\]\{\}]/;
-var PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\-]+!)$/i;
-var PATTERN_TAG_URI = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;
-
-
-function _class(obj) { return Object.prototype.toString.call(obj); }
-
-function is_EOL(c) {
- return (c === 0x0A/* LF */) || (c === 0x0D/* CR */);
-}
-
-function is_WHITE_SPACE(c) {
- return (c === 0x09/* Tab */) || (c === 0x20/* Space */);
-}
-
-function is_WS_OR_EOL(c) {
- return (c === 0x09/* Tab */) ||
- (c === 0x20/* Space */) ||
- (c === 0x0A/* LF */) ||
- (c === 0x0D/* CR */);
-}
-
-function is_FLOW_INDICATOR(c) {
- return c === 0x2C/* , */ ||
- c === 0x5B/* [ */ ||
- c === 0x5D/* ] */ ||
- c === 0x7B/* { */ ||
- c === 0x7D/* } */;
-}
-
-function fromHexCode(c) {
- var lc;
-
- if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) {
- return c - 0x30;
- }
-
- /*eslint-disable no-bitwise*/
- lc = c | 0x20;
-
- if ((0x61/* a */ <= lc) && (lc <= 0x66/* f */)) {
- return lc - 0x61 + 10;
- }
-
- return -1;
-}
-
-function escapedHexLen(c) {
- if (c === 0x78/* x */) { return 2; }
- if (c === 0x75/* u */) { return 4; }
- if (c === 0x55/* U */) { return 8; }
- return 0;
-}
-
-function fromDecimalCode(c) {
- if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) {
- return c - 0x30;
- }
-
- return -1;
-}
-
-function simpleEscapeSequence(c) {
- /* eslint-disable indent */
- return (c === 0x30/* 0 */) ? '\x00' :
- (c === 0x61/* a */) ? '\x07' :
- (c === 0x62/* b */) ? '\x08' :
- (c === 0x74/* t */) ? '\x09' :
- (c === 0x09/* Tab */) ? '\x09' :
- (c === 0x6E/* n */) ? '\x0A' :
- (c === 0x76/* v */) ? '\x0B' :
- (c === 0x66/* f */) ? '\x0C' :
- (c === 0x72/* r */) ? '\x0D' :
- (c === 0x65/* e */) ? '\x1B' :
- (c === 0x20/* Space */) ? ' ' :
- (c === 0x22/* " */) ? '\x22' :
- (c === 0x2F/* / */) ? '/' :
- (c === 0x5C/* \ */) ? '\x5C' :
- (c === 0x4E/* N */) ? '\x85' :
- (c === 0x5F/* _ */) ? '\xA0' :
- (c === 0x4C/* L */) ? '\u2028' :
- (c === 0x50/* P */) ? '\u2029' : '';
-}
-
-function charFromCodepoint(c) {
- if (c <= 0xFFFF) {
- return String.fromCharCode(c);
- }
- // Encode UTF-16 surrogate pair
- // https://en.wikipedia.org/wiki/UTF-16#Code_points_U.2B010000_to_U.2B10FFFF
- return String.fromCharCode(
- ((c - 0x010000) >> 10) + 0xD800,
- ((c - 0x010000) & 0x03FF) + 0xDC00
- );
-}
-
-var simpleEscapeCheck = new Array(256); // integer, for fast access
-var simpleEscapeMap = new Array(256);
-for (var i = 0; i < 256; i++) {
- simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0;
- simpleEscapeMap[i] = simpleEscapeSequence(i);
-}
-
-
-function State(input, options) {
- this.input = input;
-
- this.filename = options['filename'] || null;
- this.schema = options['schema'] || DEFAULT_FULL_SCHEMA;
- this.onWarning = options['onWarning'] || null;
- this.legacy = options['legacy'] || false;
- this.json = options['json'] || false;
- this.listener = options['listener'] || null;
-
- this.implicitTypes = this.schema.compiledImplicit;
- this.typeMap = this.schema.compiledTypeMap;
-
- this.length = input.length;
- this.position = 0;
- this.line = 0;
- this.lineStart = 0;
- this.lineIndent = 0;
-
- this.documents = [];
-
- /*
- this.version;
- this.checkLineBreaks;
- this.tagMap;
- this.anchorMap;
- this.tag;
- this.anchor;
- this.kind;
- this.result;*/
-
-}
-
-
-function generateError(state, message) {
- return new YAMLException(
- message,
- new Mark(state.filename, state.input, state.position, state.line, (state.position - state.lineStart)));
-}
-
-function throwError(state, message) {
- throw generateError(state, message);
-}
-
-function throwWarning(state, message) {
- if (state.onWarning) {
- state.onWarning.call(null, generateError(state, message));
- }
-}
-
-
-var directiveHandlers = {
-
- YAML: function handleYamlDirective(state, name, args) {
-
- var match, major, minor;
-
- if (state.version !== null) {
- throwError(state, 'duplication of %YAML directive');
- }
-
- if (args.length !== 1) {
- throwError(state, 'YAML directive accepts exactly one argument');
- }
-
- match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]);
-
- if (match === null) {
- throwError(state, 'ill-formed argument of the YAML directive');
- }
-
- major = parseInt(match[1], 10);
- minor = parseInt(match[2], 10);
-
- if (major !== 1) {
- throwError(state, 'unacceptable YAML version of the document');
- }
-
- state.version = args[0];
- state.checkLineBreaks = (minor < 2);
-
- if (minor !== 1 && minor !== 2) {
- throwWarning(state, 'unsupported YAML version of the document');
- }
- },
-
- TAG: function handleTagDirective(state, name, args) {
-
- var handle, prefix;
-
- if (args.length !== 2) {
- throwError(state, 'TAG directive accepts exactly two arguments');
- }
-
- handle = args[0];
- prefix = args[1];
-
- if (!PATTERN_TAG_HANDLE.test(handle)) {
- throwError(state, 'ill-formed tag handle (first argument) of the TAG directive');
- }
-
- if (_hasOwnProperty.call(state.tagMap, handle)) {
- throwError(state, 'there is a previously declared suffix for "' + handle + '" tag handle');
- }
-
- if (!PATTERN_TAG_URI.test(prefix)) {
- throwError(state, 'ill-formed tag prefix (second argument) of the TAG directive');
- }
-
- state.tagMap[handle] = prefix;
- }
-};
-
-
-function captureSegment(state, start, end, checkJson) {
- var _position, _length, _character, _result;
-
- if (start < end) {
- _result = state.input.slice(start, end);
-
- if (checkJson) {
- for (_position = 0, _length = _result.length; _position < _length; _position += 1) {
- _character = _result.charCodeAt(_position);
- if (!(_character === 0x09 ||
- (0x20 <= _character && _character <= 0x10FFFF))) {
- throwError(state, 'expected valid JSON character');
- }
- }
- } else if (PATTERN_NON_PRINTABLE.test(_result)) {
- throwError(state, 'the stream contains non-printable characters');
- }
-
- state.result += _result;
- }
-}
-
-function mergeMappings(state, destination, source, overridableKeys) {
- var sourceKeys, key, index, quantity;
-
- if (!common.isObject(source)) {
- throwError(state, 'cannot merge mappings; the provided source object is unacceptable');
- }
-
- sourceKeys = Object.keys(source);
-
- for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) {
- key = sourceKeys[index];
-
- if (!_hasOwnProperty.call(destination, key)) {
- destination[key] = source[key];
- overridableKeys[key] = true;
- }
- }
-}
-
-function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, startLine, startPos) {
- var index, quantity;
-
- // The output is a plain object here, so keys can only be strings.
- // We need to convert keyNode to a string, but doing so can hang the process
- // (deeply nested arrays that explode exponentially using aliases).
- if (Array.isArray(keyNode)) {
- keyNode = Array.prototype.slice.call(keyNode);
-
- for (index = 0, quantity = keyNode.length; index < quantity; index += 1) {
- if (Array.isArray(keyNode[index])) {
- throwError(state, 'nested arrays are not supported inside keys');
- }
-
- if (typeof keyNode === 'object' && _class(keyNode[index]) === '[object Object]') {
- keyNode[index] = '[object Object]';
- }
- }
- }
-
- // Avoid code execution in load() via toString property
- // (still use its own toString for arrays, timestamps,
- // and whatever user schema extensions happen to have @@toStringTag)
- if (typeof keyNode === 'object' && _class(keyNode) === '[object Object]') {
- keyNode = '[object Object]';
- }
-
-
- keyNode = String(keyNode);
-
- if (_result === null) {
- _result = {};
- }
-
- if (keyTag === 'tag:yaml.org,2002:merge') {
- if (Array.isArray(valueNode)) {
- for (index = 0, quantity = valueNode.length; index < quantity; index += 1) {
- mergeMappings(state, _result, valueNode[index], overridableKeys);
- }
- } else {
- mergeMappings(state, _result, valueNode, overridableKeys);
- }
- } else {
- if (!state.json &&
- !_hasOwnProperty.call(overridableKeys, keyNode) &&
- _hasOwnProperty.call(_result, keyNode)) {
- state.line = startLine || state.line;
- state.position = startPos || state.position;
- throwError(state, 'duplicated mapping key');
- }
- _result[keyNode] = valueNode;
- delete overridableKeys[keyNode];
- }
-
- return _result;
-}
-
-function readLineBreak(state) {
- var ch;
-
- ch = state.input.charCodeAt(state.position);
-
- if (ch === 0x0A/* LF */) {
- state.position++;
- } else if (ch === 0x0D/* CR */) {
- state.position++;
- if (state.input.charCodeAt(state.position) === 0x0A/* LF */) {
- state.position++;
- }
- } else {
- throwError(state, 'a line break is expected');
- }
-
- state.line += 1;
- state.lineStart = state.position;
-}
-
-function skipSeparationSpace(state, allowComments, checkIndent) {
- var lineBreaks = 0,
- ch = state.input.charCodeAt(state.position);
-
- while (ch !== 0) {
- while (is_WHITE_SPACE(ch)) {
- ch = state.input.charCodeAt(++state.position);
- }
-
- if (allowComments && ch === 0x23/* # */) {
- do {
- ch = state.input.charCodeAt(++state.position);
- } while (ch !== 0x0A/* LF */ && ch !== 0x0D/* CR */ && ch !== 0);
- }
-
- if (is_EOL(ch)) {
- readLineBreak(state);
-
- ch = state.input.charCodeAt(state.position);
- lineBreaks++;
- state.lineIndent = 0;
-
- while (ch === 0x20/* Space */) {
- state.lineIndent++;
- ch = state.input.charCodeAt(++state.position);
- }
- } else {
- break;
- }
- }
-
- if (checkIndent !== -1 && lineBreaks !== 0 && state.lineIndent < checkIndent) {
- throwWarning(state, 'deficient indentation');
- }
-
- return lineBreaks;
-}
-
-function testDocumentSeparator(state) {
- var _position = state.position,
- ch;
-
- ch = state.input.charCodeAt(_position);
-
- // Condition state.position === state.lineStart is tested
- // in parent on each call, for efficiency. No needs to test here again.
- if ((ch === 0x2D/* - */ || ch === 0x2E/* . */) &&
- ch === state.input.charCodeAt(_position + 1) &&
- ch === state.input.charCodeAt(_position + 2)) {
-
- _position += 3;
-
- ch = state.input.charCodeAt(_position);
-
- if (ch === 0 || is_WS_OR_EOL(ch)) {
- return true;
- }
- }
-
- return false;
-}
-
-function writeFoldedLines(state, count) {
- if (count === 1) {
- state.result += ' ';
- } else if (count > 1) {
- state.result += common.repeat('\n', count - 1);
- }
-}
-
-
-function readPlainScalar(state, nodeIndent, withinFlowCollection) {
- var preceding,
- following,
- captureStart,
- captureEnd,
- hasPendingContent,
- _line,
- _lineStart,
- _lineIndent,
- _kind = state.kind,
- _result = state.result,
- ch;
-
- ch = state.input.charCodeAt(state.position);
-
- if (is_WS_OR_EOL(ch) ||
- is_FLOW_INDICATOR(ch) ||
- ch === 0x23/* # */ ||
- ch === 0x26/* & */ ||
- ch === 0x2A/* * */ ||
- ch === 0x21/* ! */ ||
- ch === 0x7C/* | */ ||
- ch === 0x3E/* > */ ||
- ch === 0x27/* ' */ ||
- ch === 0x22/* " */ ||
- ch === 0x25/* % */ ||
- ch === 0x40/* @ */ ||
- ch === 0x60/* ` */) {
- return false;
- }
-
- if (ch === 0x3F/* ? */ || ch === 0x2D/* - */) {
- following = state.input.charCodeAt(state.position + 1);
-
- if (is_WS_OR_EOL(following) ||
- withinFlowCollection && is_FLOW_INDICATOR(following)) {
- return false;
- }
- }
-
- state.kind = 'scalar';
- state.result = '';
- captureStart = captureEnd = state.position;
- hasPendingContent = false;
-
- while (ch !== 0) {
- if (ch === 0x3A/* : */) {
- following = state.input.charCodeAt(state.position + 1);
-
- if (is_WS_OR_EOL(following) ||
- withinFlowCollection && is_FLOW_INDICATOR(following)) {
- break;
- }
-
- } else if (ch === 0x23/* # */) {
- preceding = state.input.charCodeAt(state.position - 1);
-
- if (is_WS_OR_EOL(preceding)) {
- break;
- }
-
- } else if ((state.position === state.lineStart && testDocumentSeparator(state)) ||
- withinFlowCollection && is_FLOW_INDICATOR(ch)) {
- break;
-
- } else if (is_EOL(ch)) {
- _line = state.line;
- _lineStart = state.lineStart;
- _lineIndent = state.lineIndent;
- skipSeparationSpace(state, false, -1);
-
- if (state.lineIndent >= nodeIndent) {
- hasPendingContent = true;
- ch = state.input.charCodeAt(state.position);
- continue;
- } else {
- state.position = captureEnd;
- state.line = _line;
- state.lineStart = _lineStart;
- state.lineIndent = _lineIndent;
- break;
- }
- }
-
- if (hasPendingContent) {
- captureSegment(state, captureStart, captureEnd, false);
- writeFoldedLines(state, state.line - _line);
- captureStart = captureEnd = state.position;
- hasPendingContent = false;
- }
-
- if (!is_WHITE_SPACE(ch)) {
- captureEnd = state.position + 1;
- }
-
- ch = state.input.charCodeAt(++state.position);
- }
-
- captureSegment(state, captureStart, captureEnd, false);
-
- if (state.result) {
- return true;
- }
-
- state.kind = _kind;
- state.result = _result;
- return false;
-}
-
-function readSingleQuotedScalar(state, nodeIndent) {
- var ch,
- captureStart, captureEnd;
-
- ch = state.input.charCodeAt(state.position);
-
- if (ch !== 0x27/* ' */) {
- return false;
- }
-
- state.kind = 'scalar';
- state.result = '';
- state.position++;
- captureStart = captureEnd = state.position;
-
- while ((ch = state.input.charCodeAt(state.position)) !== 0) {
- if (ch === 0x27/* ' */) {
- captureSegment(state, captureStart, state.position, true);
- ch = state.input.charCodeAt(++state.position);
-
- if (ch === 0x27/* ' */) {
- captureStart = state.position;
- state.position++;
- captureEnd = state.position;
- } else {
- return true;
- }
-
- } else if (is_EOL(ch)) {
- captureSegment(state, captureStart, captureEnd, true);
- writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));
- captureStart = captureEnd = state.position;
-
- } else if (state.position === state.lineStart && testDocumentSeparator(state)) {
- throwError(state, 'unexpected end of the document within a single quoted scalar');
-
- } else {
- state.position++;
- captureEnd = state.position;
- }
- }
-
- throwError(state, 'unexpected end of the stream within a single quoted scalar');
-}
-
-function readDoubleQuotedScalar(state, nodeIndent) {
- var captureStart,
- captureEnd,
- hexLength,
- hexResult,
- tmp,
- ch;
-
- ch = state.input.charCodeAt(state.position);
-
- if (ch !== 0x22/* " */) {
- return false;
- }
-
- state.kind = 'scalar';
- state.result = '';
- state.position++;
- captureStart = captureEnd = state.position;
-
- while ((ch = state.input.charCodeAt(state.position)) !== 0) {
- if (ch === 0x22/* " */) {
- captureSegment(state, captureStart, state.position, true);
- state.position++;
- return true;
-
- } else if (ch === 0x5C/* \ */) {
- captureSegment(state, captureStart, state.position, true);
- ch = state.input.charCodeAt(++state.position);
-
- if (is_EOL(ch)) {
- skipSeparationSpace(state, false, nodeIndent);
-
- // TODO: rework to inline fn with no type cast?
- } else if (ch < 256 && simpleEscapeCheck[ch]) {
- state.result += simpleEscapeMap[ch];
- state.position++;
-
- } else if ((tmp = escapedHexLen(ch)) > 0) {
- hexLength = tmp;
- hexResult = 0;
-
- for (; hexLength > 0; hexLength--) {
- ch = state.input.charCodeAt(++state.position);
-
- if ((tmp = fromHexCode(ch)) >= 0) {
- hexResult = (hexResult << 4) + tmp;
-
- } else {
- throwError(state, 'expected hexadecimal character');
- }
- }
-
- state.result += charFromCodepoint(hexResult);
-
- state.position++;
-
- } else {
- throwError(state, 'unknown escape sequence');
- }
-
- captureStart = captureEnd = state.position;
-
- } else if (is_EOL(ch)) {
- captureSegment(state, captureStart, captureEnd, true);
- writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));
- captureStart = captureEnd = state.position;
-
- } else if (state.position === state.lineStart && testDocumentSeparator(state)) {
- throwError(state, 'unexpected end of the document within a double quoted scalar');
-
- } else {
- state.position++;
- captureEnd = state.position;
- }
- }
-
- throwError(state, 'unexpected end of the stream within a double quoted scalar');
-}
-
-function readFlowCollection(state, nodeIndent) {
- var readNext = true,
- _line,
- _tag = state.tag,
- _result,
- _anchor = state.anchor,
- following,
- terminator,
- isPair,
- isExplicitPair,
- isMapping,
- overridableKeys = {},
- keyNode,
- keyTag,
- valueNode,
- ch;
-
- ch = state.input.charCodeAt(state.position);
-
- if (ch === 0x5B/* [ */) {
- terminator = 0x5D;/* ] */
- isMapping = false;
- _result = [];
- } else if (ch === 0x7B/* { */) {
- terminator = 0x7D;/* } */
- isMapping = true;
- _result = {};
- } else {
- return false;
- }
-
- if (state.anchor !== null) {
- state.anchorMap[state.anchor] = _result;
- }
-
- ch = state.input.charCodeAt(++state.position);
-
- while (ch !== 0) {
- skipSeparationSpace(state, true, nodeIndent);
-
- ch = state.input.charCodeAt(state.position);
-
- if (ch === terminator) {
- state.position++;
- state.tag = _tag;
- state.anchor = _anchor;
- state.kind = isMapping ? 'mapping' : 'sequence';
- state.result = _result;
- return true;
- } else if (!readNext) {
- throwError(state, 'missed comma between flow collection entries');
- }
-
- keyTag = keyNode = valueNode = null;
- isPair = isExplicitPair = false;
-
- if (ch === 0x3F/* ? */) {
- following = state.input.charCodeAt(state.position + 1);
-
- if (is_WS_OR_EOL(following)) {
- isPair = isExplicitPair = true;
- state.position++;
- skipSeparationSpace(state, true, nodeIndent);
- }
- }
-
- _line = state.line;
- composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
- keyTag = state.tag;
- keyNode = state.result;
- skipSeparationSpace(state, true, nodeIndent);
-
- ch = state.input.charCodeAt(state.position);
-
- if ((isExplicitPair || state.line === _line) && ch === 0x3A/* : */) {
- isPair = true;
- ch = state.input.charCodeAt(++state.position);
- skipSeparationSpace(state, true, nodeIndent);
- composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
- valueNode = state.result;
- }
-
- if (isMapping) {
- storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode);
- } else if (isPair) {
- _result.push(storeMappingPair(state, null, overridableKeys, keyTag, keyNode, valueNode));
- } else {
- _result.push(keyNode);
- }
-
- skipSeparationSpace(state, true, nodeIndent);
-
- ch = state.input.charCodeAt(state.position);
-
- if (ch === 0x2C/* , */) {
- readNext = true;
- ch = state.input.charCodeAt(++state.position);
- } else {
- readNext = false;
- }
- }
-
- throwError(state, 'unexpected end of the stream within a flow collection');
-}
-
-function readBlockScalar(state, nodeIndent) {
- var captureStart,
- folding,
- chomping = CHOMPING_CLIP,
- didReadContent = false,
- detectedIndent = false,
- textIndent = nodeIndent,
- emptyLines = 0,
- atMoreIndented = false,
- tmp,
- ch;
-
- ch = state.input.charCodeAt(state.position);
-
- if (ch === 0x7C/* | */) {
- folding = false;
- } else if (ch === 0x3E/* > */) {
- folding = true;
- } else {
- return false;
- }
-
- state.kind = 'scalar';
- state.result = '';
-
- while (ch !== 0) {
- ch = state.input.charCodeAt(++state.position);
-
- if (ch === 0x2B/* + */ || ch === 0x2D/* - */) {
- if (CHOMPING_CLIP === chomping) {
- chomping = (ch === 0x2B/* + */) ? CHOMPING_KEEP : CHOMPING_STRIP;
- } else {
- throwError(state, 'repeat of a chomping mode identifier');
- }
-
- } else if ((tmp = fromDecimalCode(ch)) >= 0) {
- if (tmp === 0) {
- throwError(state, 'bad explicit indentation width of a block scalar; it cannot be less than one');
- } else if (!detectedIndent) {
- textIndent = nodeIndent + tmp - 1;
- detectedIndent = true;
- } else {
- throwError(state, 'repeat of an indentation width identifier');
- }
-
- } else {
- break;
- }
- }
-
- if (is_WHITE_SPACE(ch)) {
- do { ch = state.input.charCodeAt(++state.position); }
- while (is_WHITE_SPACE(ch));
-
- if (ch === 0x23/* # */) {
- do { ch = state.input.charCodeAt(++state.position); }
- while (!is_EOL(ch) && (ch !== 0));
- }
- }
-
- while (ch !== 0) {
- readLineBreak(state);
- state.lineIndent = 0;
-
- ch = state.input.charCodeAt(state.position);
-
- while ((!detectedIndent || state.lineIndent < textIndent) &&
- (ch === 0x20/* Space */)) {
- state.lineIndent++;
- ch = state.input.charCodeAt(++state.position);
- }
-
- if (!detectedIndent && state.lineIndent > textIndent) {
- textIndent = state.lineIndent;
- }
-
- if (is_EOL(ch)) {
- emptyLines++;
- continue;
- }
-
- // End of the scalar.
- if (state.lineIndent < textIndent) {
-
- // Perform the chomping.
- if (chomping === CHOMPING_KEEP) {
- state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines);
- } else if (chomping === CHOMPING_CLIP) {
- if (didReadContent) { // i.e. only if the scalar is not empty.
- state.result += '\n';
- }
- }
-
- // Break this `while` cycle and go to the funciton's epilogue.
- break;
- }
-
- // Folded style: use fancy rules to handle line breaks.
- if (folding) {
-
- // Lines starting with white space characters (more-indented lines) are not folded.
- if (is_WHITE_SPACE(ch)) {
- atMoreIndented = true;
- // except for the first content line (cf. Example 8.1)
- state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines);
-
- // End of more-indented block.
- } else if (atMoreIndented) {
- atMoreIndented = false;
- state.result += common.repeat('\n', emptyLines + 1);
-
- // Just one line break - perceive as the same line.
- } else if (emptyLines === 0) {
- if (didReadContent) { // i.e. only if we have already read some scalar content.
- state.result += ' ';
- }
-
- // Several line breaks - perceive as different lines.
- } else {
- state.result += common.repeat('\n', emptyLines);
- }
-
- // Literal style: just add exact number of line breaks between content lines.
- } else {
- // Keep all line breaks except the header line break.
- state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines);
- }
-
- didReadContent = true;
- detectedIndent = true;
- emptyLines = 0;
- captureStart = state.position;
-
- while (!is_EOL(ch) && (ch !== 0)) {
- ch = state.input.charCodeAt(++state.position);
- }
-
- captureSegment(state, captureStart, state.position, false);
- }
-
- return true;
-}
-
-function readBlockSequence(state, nodeIndent) {
- var _line,
- _tag = state.tag,
- _anchor = state.anchor,
- _result = [],
- following,
- detected = false,
- ch;
-
- if (state.anchor !== null) {
- state.anchorMap[state.anchor] = _result;
- }
-
- ch = state.input.charCodeAt(state.position);
-
- while (ch !== 0) {
-
- if (ch !== 0x2D/* - */) {
- break;
- }
-
- following = state.input.charCodeAt(state.position + 1);
-
- if (!is_WS_OR_EOL(following)) {
- break;
- }
-
- detected = true;
- state.position++;
-
- if (skipSeparationSpace(state, true, -1)) {
- if (state.lineIndent <= nodeIndent) {
- _result.push(null);
- ch = state.input.charCodeAt(state.position);
- continue;
- }
- }
-
- _line = state.line;
- composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true);
- _result.push(state.result);
- skipSeparationSpace(state, true, -1);
-
- ch = state.input.charCodeAt(state.position);
-
- if ((state.line === _line || state.lineIndent > nodeIndent) && (ch !== 0)) {
- throwError(state, 'bad indentation of a sequence entry');
- } else if (state.lineIndent < nodeIndent) {
- break;
- }
- }
-
- if (detected) {
- state.tag = _tag;
- state.anchor = _anchor;
- state.kind = 'sequence';
- state.result = _result;
- return true;
- }
- return false;
-}
-
-function readBlockMapping(state, nodeIndent, flowIndent) {
- var following,
- allowCompact,
- _line,
- _pos,
- _tag = state.tag,
- _anchor = state.anchor,
- _result = {},
- overridableKeys = {},
- keyTag = null,
- keyNode = null,
- valueNode = null,
- atExplicitKey = false,
- detected = false,
- ch;
-
- if (state.anchor !== null) {
- state.anchorMap[state.anchor] = _result;
- }
-
- ch = state.input.charCodeAt(state.position);
-
- while (ch !== 0) {
- following = state.input.charCodeAt(state.position + 1);
- _line = state.line; // Save the current line.
- _pos = state.position;
-
- //
- // Explicit notation case. There are two separate blocks:
- // first for the key (denoted by "?") and second for the value (denoted by ":")
- //
- if ((ch === 0x3F/* ? */ || ch === 0x3A/* : */) && is_WS_OR_EOL(following)) {
-
- if (ch === 0x3F/* ? */) {
- if (atExplicitKey) {
- storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null);
- keyTag = keyNode = valueNode = null;
- }
-
- detected = true;
- atExplicitKey = true;
- allowCompact = true;
-
- } else if (atExplicitKey) {
- // i.e. 0x3A/* : */ === character after the explicit key.
- atExplicitKey = false;
- allowCompact = true;
-
- } else {
- throwError(state, 'incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line');
- }
-
- state.position += 1;
- ch = following;
-
- //
- // Implicit notation case. Flow-style node as the key first, then ":", and the value.
- //
- } else if (composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) {
-
- if (state.line === _line) {
- ch = state.input.charCodeAt(state.position);
-
- while (is_WHITE_SPACE(ch)) {
- ch = state.input.charCodeAt(++state.position);
- }
-
- if (ch === 0x3A/* : */) {
- ch = state.input.charCodeAt(++state.position);
-
- if (!is_WS_OR_EOL(ch)) {
- throwError(state, 'a whitespace character is expected after the key-value separator within a block mapping');
- }
-
- if (atExplicitKey) {
- storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null);
- keyTag = keyNode = valueNode = null;
- }
-
- detected = true;
- atExplicitKey = false;
- allowCompact = false;
- keyTag = state.tag;
- keyNode = state.result;
-
- } else if (detected) {
- throwError(state, 'can not read an implicit mapping pair; a colon is missed');
-
- } else {
- state.tag = _tag;
- state.anchor = _anchor;
- return true; // Keep the result of `composeNode`.
- }
-
- } else if (detected) {
- throwError(state, 'can not read a block mapping entry; a multiline key may not be an implicit key');
-
- } else {
- state.tag = _tag;
- state.anchor = _anchor;
- return true; // Keep the result of `composeNode`.
- }
-
- } else {
- break; // Reading is done. Go to the epilogue.
- }
-
- //
- // Common reading code for both explicit and implicit notations.
- //
- if (state.line === _line || state.lineIndent > nodeIndent) {
- if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) {
- if (atExplicitKey) {
- keyNode = state.result;
- } else {
- valueNode = state.result;
- }
- }
-
- if (!atExplicitKey) {
- storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _pos);
- keyTag = keyNode = valueNode = null;
- }
-
- skipSeparationSpace(state, true, -1);
- ch = state.input.charCodeAt(state.position);
- }
-
- if (state.lineIndent > nodeIndent && (ch !== 0)) {
- throwError(state, 'bad indentation of a mapping entry');
- } else if (state.lineIndent < nodeIndent) {
- break;
- }
- }
-
- //
- // Epilogue.
- //
-
- // Special case: last mapping's node contains only the key in explicit notation.
- if (atExplicitKey) {
- storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null);
- }
-
- // Expose the resulting mapping.
- if (detected) {
- state.tag = _tag;
- state.anchor = _anchor;
- state.kind = 'mapping';
- state.result = _result;
- }
-
- return detected;
-}
-
-function readTagProperty(state) {
- var _position,
- isVerbatim = false,
- isNamed = false,
- tagHandle,
- tagName,
- ch;
-
- ch = state.input.charCodeAt(state.position);
-
- if (ch !== 0x21/* ! */) return false;
-
- if (state.tag !== null) {
- throwError(state, 'duplication of a tag property');
- }
-
- ch = state.input.charCodeAt(++state.position);
-
- if (ch === 0x3C/* < */) {
- isVerbatim = true;
- ch = state.input.charCodeAt(++state.position);
-
- } else if (ch === 0x21/* ! */) {
- isNamed = true;
- tagHandle = '!!';
- ch = state.input.charCodeAt(++state.position);
-
- } else {
- tagHandle = '!';
- }
-
- _position = state.position;
-
- if (isVerbatim) {
- do { ch = state.input.charCodeAt(++state.position); }
- while (ch !== 0 && ch !== 0x3E/* > */);
-
- if (state.position < state.length) {
- tagName = state.input.slice(_position, state.position);
- ch = state.input.charCodeAt(++state.position);
- } else {
- throwError(state, 'unexpected end of the stream within a verbatim tag');
- }
- } else {
- while (ch !== 0 && !is_WS_OR_EOL(ch)) {
-
- if (ch === 0x21/* ! */) {
- if (!isNamed) {
- tagHandle = state.input.slice(_position - 1, state.position + 1);
-
- if (!PATTERN_TAG_HANDLE.test(tagHandle)) {
- throwError(state, 'named tag handle cannot contain such characters');
- }
-
- isNamed = true;
- _position = state.position + 1;
- } else {
- throwError(state, 'tag suffix cannot contain exclamation marks');
- }
- }
-
- ch = state.input.charCodeAt(++state.position);
- }
-
- tagName = state.input.slice(_position, state.position);
-
- if (PATTERN_FLOW_INDICATORS.test(tagName)) {
- throwError(state, 'tag suffix cannot contain flow indicator characters');
- }
- }
-
- if (tagName && !PATTERN_TAG_URI.test(tagName)) {
- throwError(state, 'tag name cannot contain such characters: ' + tagName);
- }
-
- if (isVerbatim) {
- state.tag = tagName;
-
- } else if (_hasOwnProperty.call(state.tagMap, tagHandle)) {
- state.tag = state.tagMap[tagHandle] + tagName;
-
- } else if (tagHandle === '!') {
- state.tag = '!' + tagName;
-
- } else if (tagHandle === '!!') {
- state.tag = 'tag:yaml.org,2002:' + tagName;
-
- } else {
- throwError(state, 'undeclared tag handle "' + tagHandle + '"');
- }
-
- return true;
-}
-
-function readAnchorProperty(state) {
- var _position,
- ch;
-
- ch = state.input.charCodeAt(state.position);
-
- if (ch !== 0x26/* & */) return false;
-
- if (state.anchor !== null) {
- throwError(state, 'duplication of an anchor property');
- }
-
- ch = state.input.charCodeAt(++state.position);
- _position = state.position;
-
- while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {
- ch = state.input.charCodeAt(++state.position);
- }
-
- if (state.position === _position) {
- throwError(state, 'name of an anchor node must contain at least one character');
- }
-
- state.anchor = state.input.slice(_position, state.position);
- return true;
-}
-
-function readAlias(state) {
- var _position, alias,
- ch;
-
- ch = state.input.charCodeAt(state.position);
-
- if (ch !== 0x2A/* * */) return false;
-
- ch = state.input.charCodeAt(++state.position);
- _position = state.position;
-
- while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {
- ch = state.input.charCodeAt(++state.position);
- }
-
- if (state.position === _position) {
- throwError(state, 'name of an alias node must contain at least one character');
- }
-
- alias = state.input.slice(_position, state.position);
-
- if (!state.anchorMap.hasOwnProperty(alias)) {
- throwError(state, 'unidentified alias "' + alias + '"');
- }
-
- state.result = state.anchorMap[alias];
- skipSeparationSpace(state, true, -1);
- return true;
-}
-
-function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact) {
- var allowBlockStyles,
- allowBlockScalars,
- allowBlockCollections,
- indentStatus = 1, // 1: this>parent, 0: this=parent, -1: this<parent
- atNewLine = false,
- hasContent = false,
- typeIndex,
- typeQuantity,
- type,
- flowIndent,
- blockIndent;
-
- if (state.listener !== null) {
- state.listener('open', state);
- }
-
- state.tag = null;
- state.anchor = null;
- state.kind = null;
- state.result = null;
-
- allowBlockStyles = allowBlockScalars = allowBlockCollections =
- CONTEXT_BLOCK_OUT === nodeContext ||
- CONTEXT_BLOCK_IN === nodeContext;
-
- if (allowToSeek) {
- if (skipSeparationSpace(state, true, -1)) {
- atNewLine = true;
-
- if (state.lineIndent > parentIndent) {
- indentStatus = 1;
- } else if (state.lineIndent === parentIndent) {
- indentStatus = 0;
- } else if (state.lineIndent < parentIndent) {
- indentStatus = -1;
- }
- }
- }
-
- if (indentStatus === 1) {
- while (readTagProperty(state) || readAnchorProperty(state)) {
- if (skipSeparationSpace(state, true, -1)) {
- atNewLine = true;
- allowBlockCollections = allowBlockStyles;
-
- if (state.lineIndent > parentIndent) {
- indentStatus = 1;
- } else if (state.lineIndent === parentIndent) {
- indentStatus = 0;
- } else if (state.lineIndent < parentIndent) {
- indentStatus = -1;
- }
- } else {
- allowBlockCollections = false;
- }
- }
- }
-
- if (allowBlockCollections) {
- allowBlockCollections = atNewLine || allowCompact;
- }
-
- if (indentStatus === 1 || CONTEXT_BLOCK_OUT === nodeContext) {
- if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) {
- flowIndent = parentIndent;
- } else {
- flowIndent = parentIndent + 1;
- }
-
- blockIndent = state.position - state.lineStart;
-
- if (indentStatus === 1) {
- if (allowBlockCollections &&
- (readBlockSequence(state, blockIndent) ||
- readBlockMapping(state, blockIndent, flowIndent)) ||
- readFlowCollection(state, flowIndent)) {
- hasContent = true;
- } else {
- if ((allowBlockScalars && readBlockScalar(state, flowIndent)) ||
- readSingleQuotedScalar(state, flowIndent) ||
- readDoubleQuotedScalar(state, flowIndent)) {
- hasContent = true;
-
- } else if (readAlias(state)) {
- hasContent = true;
-
- if (state.tag !== null || state.anchor !== null) {
- throwError(state, 'alias node should not have any properties');
- }
-
- } else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) {
- hasContent = true;
-
- if (state.tag === null) {
- state.tag = '?';
- }
- }
-
- if (state.anchor !== null) {
- state.anchorMap[state.anchor] = state.result;
- }
- }
- } else if (indentStatus === 0) {
- // Special case: block sequences are allowed to have same indentation level as the parent.
- // http://www.yaml.org/spec/1.2/spec.html#id2799784
- hasContent = allowBlockCollections && readBlockSequence(state, blockIndent);
- }
- }
-
- if (state.tag !== null && state.tag !== '!') {
- if (state.tag === '?') {
- // Implicit resolving is not allowed for non-scalar types, and '?'
- // non-specific tag is only automatically assigned to plain scalars.
- //
- // We only need to check kind conformity in case user explicitly assigns '?'
- // tag, for example like this: "!<?> [0]"
- //
- if (state.result !== null && state.kind !== 'scalar') {
- throwError(state, 'unacceptable node kind for !<?> tag; it should be "scalar", not "' + state.kind + '"');
- }
-
- for (typeIndex = 0, typeQuantity = state.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) {
- type = state.implicitTypes[typeIndex];
-
- if (type.resolve(state.result)) { // `state.result` updated in resolver if matched
- state.result = type.construct(state.result);
- state.tag = type.tag;
- if (state.anchor !== null) {
- state.anchorMap[state.anchor] = state.result;
- }
- break;
- }
- }
- } else if (_hasOwnProperty.call(state.typeMap[state.kind || 'fallback'], state.tag)) {
- type = state.typeMap[state.kind || 'fallback'][state.tag];
-
- if (state.result !== null && type.kind !== state.kind) {
- throwError(state, 'unacceptable node kind for !<' + state.tag + '> tag; it should be "' + type.kind + '", not "' + state.kind + '"');
- }
-
- if (!type.resolve(state.result)) { // `state.result` updated in resolver if matched
- throwError(state, 'cannot resolve a node with !<' + state.tag + '> explicit tag');
- } else {
- state.result = type.construct(state.result);
- if (state.anchor !== null) {
- state.anchorMap[state.anchor] = state.result;
- }
- }
- } else {
- throwError(state, 'unknown tag !<' + state.tag + '>');
- }
- }
-
- if (state.listener !== null) {
- state.listener('close', state);
- }
- return state.tag !== null || state.anchor !== null || hasContent;
-}
-
-function readDocument(state) {
- var documentStart = state.position,
- _position,
- directiveName,
- directiveArgs,
- hasDirectives = false,
- ch;
-
- state.version = null;
- state.checkLineBreaks = state.legacy;
- state.tagMap = {};
- state.anchorMap = {};
-
- while ((ch = state.input.charCodeAt(state.position)) !== 0) {
- skipSeparationSpace(state, true, -1);
-
- ch = state.input.charCodeAt(state.position);
-
- if (state.lineIndent > 0 || ch !== 0x25/* % */) {
- break;
- }
-
- hasDirectives = true;
- ch = state.input.charCodeAt(++state.position);
- _position = state.position;
-
- while (ch !== 0 && !is_WS_OR_EOL(ch)) {
- ch = state.input.charCodeAt(++state.position);
- }
-
- directiveName = state.input.slice(_position, state.position);
- directiveArgs = [];
-
- if (directiveName.length < 1) {
- throwError(state, 'directive name must not be less than one character in length');
- }
-
- while (ch !== 0) {
- while (is_WHITE_SPACE(ch)) {
- ch = state.input.charCodeAt(++state.position);
- }
-
- if (ch === 0x23/* # */) {
- do { ch = state.input.charCodeAt(++state.position); }
- while (ch !== 0 && !is_EOL(ch));
- break;
- }
-
- if (is_EOL(ch)) break;
-
- _position = state.position;
-
- while (ch !== 0 && !is_WS_OR_EOL(ch)) {
- ch = state.input.charCodeAt(++state.position);
- }
-
- directiveArgs.push(state.input.slice(_position, state.position));
- }
-
- if (ch !== 0) readLineBreak(state);
-
- if (_hasOwnProperty.call(directiveHandlers, directiveName)) {
- directiveHandlers[directiveName](state, directiveName, directiveArgs);
- } else {
- throwWarning(state, 'unknown document directive "' + directiveName + '"');
- }
- }
-
- skipSeparationSpace(state, true, -1);
-
- if (state.lineIndent === 0 &&
- state.input.charCodeAt(state.position) === 0x2D/* - */ &&
- state.input.charCodeAt(state.position + 1) === 0x2D/* - */ &&
- state.input.charCodeAt(state.position + 2) === 0x2D/* - */) {
- state.position += 3;
- skipSeparationSpace(state, true, -1);
-
- } else if (hasDirectives) {
- throwError(state, 'directives end mark is expected');
- }
-
- composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true);
- skipSeparationSpace(state, true, -1);
-
- if (state.checkLineBreaks &&
- PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart, state.position))) {
- throwWarning(state, 'non-ASCII line breaks are interpreted as content');
- }
-
- state.documents.push(state.result);
-
- if (state.position === state.lineStart && testDocumentSeparator(state)) {
-
- if (state.input.charCodeAt(state.position) === 0x2E/* . */) {
- state.position += 3;
- skipSeparationSpace(state, true, -1);
- }
- return;
- }
-
- if (state.position < (state.length - 1)) {
- throwError(state, 'end of the stream or a document separator is expected');
- } else {
- return;
- }
-}
-
-
-function loadDocuments(input, options) {
- input = String(input);
- options = options || {};
-
- if (input.length !== 0) {
-
- // Add tailing `\n` if not exists
- if (input.charCodeAt(input.length - 1) !== 0x0A/* LF */ &&
- input.charCodeAt(input.length - 1) !== 0x0D/* CR */) {
- input += '\n';
- }
-
- // Strip BOM
- if (input.charCodeAt(0) === 0xFEFF) {
- input = input.slice(1);
- }
- }
-
- var state = new State(input, options);
-
- var nullpos = input.indexOf('\0');
-
- if (nullpos !== -1) {
- state.position = nullpos;
- throwError(state, 'null byte is not allowed in input');
- }
-
- // Use 0 as string terminator. That significantly simplifies bounds check.
- state.input += '\0';
-
- while (state.input.charCodeAt(state.position) === 0x20/* Space */) {
- state.lineIndent += 1;
- state.position += 1;
- }
-
- while (state.position < (state.length - 1)) {
- readDocument(state);
- }
-
- return state.documents;
-}
-
-
-function loadAll(input, iterator, options) {
- if (iterator !== null && typeof iterator === 'object' && typeof options === 'undefined') {
- options = iterator;
- iterator = null;
- }
-
- var documents = loadDocuments(input, options);
-
- if (typeof iterator !== 'function') {
- return documents;
- }
-
- for (var index = 0, length = documents.length; index < length; index += 1) {
- iterator(documents[index]);
- }
-}
-
-
-function load(input, options) {
- var documents = loadDocuments(input, options);
-
- if (documents.length === 0) {
- /*eslint-disable no-undefined*/
- return undefined;
- } else if (documents.length === 1) {
- return documents[0];
- }
- throw new YAMLException('expected a single document in the stream, but found more');
-}
-
-
-function safeLoadAll(input, iterator, options) {
- if (typeof iterator === 'object' && iterator !== null && typeof options === 'undefined') {
- options = iterator;
- iterator = null;
- }
-
- return loadAll(input, iterator, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options));
-}
-
-
-function safeLoad(input, options) {
- return load(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options));
-}
-
-
-module.exports.loadAll = loadAll;
-module.exports.load = load;
-module.exports.safeLoadAll = safeLoadAll;
-module.exports.safeLoad = safeLoad;
-
-
-/***/ }),
-/* 8 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-
-function isNothing(subject) {
- return (typeof subject === 'undefined') || (subject === null);
-}
-
-
-function isObject(subject) {
- return (typeof subject === 'object') && (subject !== null);
-}
-
-
-function toArray(sequence) {
- if (Array.isArray(sequence)) return sequence;
- else if (isNothing(sequence)) return [];
-
- return [ sequence ];
-}
-
-
-function extend(target, source) {
- var index, length, key, sourceKeys;
-
- if (source) {
- sourceKeys = Object.keys(source);
-
- for (index = 0, length = sourceKeys.length; index < length; index += 1) {
- key = sourceKeys[index];
- target[key] = source[key];
- }
- }
-
- return target;
-}
-
-
-function repeat(string, count) {
- var result = '', cycle;
-
- for (cycle = 0; cycle < count; cycle += 1) {
- result += string;
- }
-
- return result;
-}
-
-
-function isNegativeZero(number) {
- return (number === 0) && (Number.NEGATIVE_INFINITY === 1 / number);
-}
-
-
-module.exports.isNothing = isNothing;
-module.exports.isObject = isObject;
-module.exports.toArray = toArray;
-module.exports.repeat = repeat;
-module.exports.isNegativeZero = isNegativeZero;
-module.exports.extend = extend;
-
-
-/***/ }),
-/* 9 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// YAML error class. http://stackoverflow.com/questions/8458984
-//
-
-
-function YAMLException(reason, mark) {
- // Super constructor
- Error.call(this);
-
- this.name = 'YAMLException';
- this.reason = reason;
- this.mark = mark;
- this.message = (this.reason || '(unknown reason)') + (this.mark ? ' ' + this.mark.toString() : '');
-
- // Include stack trace in error object
- if (Error.captureStackTrace) {
- // Chrome and NodeJS
- Error.captureStackTrace(this, this.constructor);
- } else {
- // FF, IE 10+ and Safari 6+. Fallback for others
- this.stack = (new Error()).stack || '';
- }
-}
-
-
-// Inherit from Error
-YAMLException.prototype = Object.create(Error.prototype);
-YAMLException.prototype.constructor = YAMLException;
-
-
-YAMLException.prototype.toString = function toString(compact) {
- var result = this.name + ': ';
-
- result += this.reason || '(unknown reason)';
-
- if (!compact && this.mark) {
- result += ' ' + this.mark.toString();
- }
-
- return result;
-};
-
-
-module.exports = YAMLException;
-
-
-/***/ }),
-/* 10 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-
-var common = __webpack_require__(8);
-
-
-function Mark(name, buffer, position, line, column) {
- this.name = name;
- this.buffer = buffer;
- this.position = position;
- this.line = line;
- this.column = column;
-}
-
-
-Mark.prototype.getSnippet = function getSnippet(indent, maxLength) {
- var head, start, tail, end, snippet;
-
- if (!this.buffer) return null;
-
- indent = indent || 4;
- maxLength = maxLength || 75;
-
- head = '';
- start = this.position;
-
- while (start > 0 && '\x00\r\n\x85\u2028\u2029'.indexOf(this.buffer.charAt(start - 1)) === -1) {
- start -= 1;
- if (this.position - start > (maxLength / 2 - 1)) {
- head = ' ... ';
- start += 5;
- break;
- }
- }
-
- tail = '';
- end = this.position;
-
- while (end < this.buffer.length && '\x00\r\n\x85\u2028\u2029'.indexOf(this.buffer.charAt(end)) === -1) {
- end += 1;
- if (end - this.position > (maxLength / 2 - 1)) {
- tail = ' ... ';
- end -= 5;
- break;
- }
- }
-
- snippet = this.buffer.slice(start, end);
-
- return common.repeat(' ', indent) + head + snippet + tail + '\n' +
- common.repeat(' ', indent + this.position - start + head.length) + '^';
-};
-
-
-Mark.prototype.toString = function toString(compact) {
- var snippet, where = '';
-
- if (this.name) {
- where += 'in "' + this.name + '" ';
- }
-
- where += 'at line ' + (this.line + 1) + ', column ' + (this.column + 1);
-
- if (!compact) {
- snippet = this.getSnippet();
-
- if (snippet) {
- where += ':\n' + snippet;
- }
- }
-
- return where;
-};
-
-
-module.exports = Mark;
-
-
-/***/ }),
-/* 11 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// JS-YAML's default schema for `safeLoad` function.
-// It is not described in the YAML specification.
-//
-// This schema is based on standard YAML's Core schema and includes most of
-// extra types described at YAML tag repository. (http://yaml.org/type/)
-
-
-
-
-
-var Schema = __webpack_require__(12);
-
-
-module.exports = new Schema({
- include: [
- __webpack_require__(14)
- ],
- implicit: [
- __webpack_require__(24),
- __webpack_require__(25)
- ],
- explicit: [
- __webpack_require__(26),
- __webpack_require__(28),
- __webpack_require__(29),
- __webpack_require__(30)
- ]
-});
-
-
-/***/ }),
-/* 12 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-/*eslint-disable max-len*/
-
-var common = __webpack_require__(8);
-var YAMLException = __webpack_require__(9);
-var Type = __webpack_require__(13);
-
-
-function compileList(schema, name, result) {
- var exclude = [];
-
- schema.include.forEach(function (includedSchema) {
- result = compileList(includedSchema, name, result);
- });
-
- schema[name].forEach(function (currentType) {
- result.forEach(function (previousType, previousIndex) {
- if (previousType.tag === currentType.tag && previousType.kind === currentType.kind) {
- exclude.push(previousIndex);
- }
- });
-
- result.push(currentType);
- });
-
- return result.filter(function (type, index) {
- return exclude.indexOf(index) === -1;
- });
-}
-
-
-function compileMap(/* lists... */) {
- var result = {
- scalar: {},
- sequence: {},
- mapping: {},
- fallback: {}
- }, index, length;
-
- function collectType(type) {
- result[type.kind][type.tag] = result['fallback'][type.tag] = type;
- }
-
- for (index = 0, length = arguments.length; index < length; index += 1) {
- arguments[index].forEach(collectType);
- }
- return result;
-}
-
-
-function Schema(definition) {
- this.include = definition.include || [];
- this.implicit = definition.implicit || [];
- this.explicit = definition.explicit || [];
-
- this.implicit.forEach(function (type) {
- if (type.loadKind && type.loadKind !== 'scalar') {
- throw new YAMLException('There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.');
- }
- });
-
- this.compiledImplicit = compileList(this, 'implicit', []);
- this.compiledExplicit = compileList(this, 'explicit', []);
- this.compiledTypeMap = compileMap(this.compiledImplicit, this.compiledExplicit);
-}
-
-
-Schema.DEFAULT = null;
-
-
-Schema.create = function createSchema() {
- var schemas, types;
-
- switch (arguments.length) {
- case 1:
- schemas = Schema.DEFAULT;
- types = arguments[0];
- break;
-
- case 2:
- schemas = arguments[0];
- types = arguments[1];
- break;
-
- default:
- throw new YAMLException('Wrong number of arguments for Schema.create function');
- }
-
- schemas = common.toArray(schemas);
- types = common.toArray(types);
-
- if (!schemas.every(function (schema) { return schema instanceof Schema; })) {
- throw new YAMLException('Specified list of super schemas (or a single Schema object) contains a non-Schema object.');
- }
-
- if (!types.every(function (type) { return type instanceof Type; })) {
- throw new YAMLException('Specified list of YAML types (or a single Type object) contains a non-Type object.');
- }
-
- return new Schema({
- include: schemas,
- explicit: types
- });
-};
-
-
-module.exports = Schema;
-
-
-/***/ }),
-/* 13 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-var YAMLException = __webpack_require__(9);
-
-var TYPE_CONSTRUCTOR_OPTIONS = [
- 'kind',
- 'resolve',
- 'construct',
- 'instanceOf',
- 'predicate',
- 'represent',
- 'defaultStyle',
- 'styleAliases'
-];
-
-var YAML_NODE_KINDS = [
- 'scalar',
- 'sequence',
- 'mapping'
-];
-
-function compileStyleAliases(map) {
- var result = {};
-
- if (map !== null) {
- Object.keys(map).forEach(function (style) {
- map[style].forEach(function (alias) {
- result[String(alias)] = style;
- });
- });
- }
-
- return result;
-}
-
-function Type(tag, options) {
- options = options || {};
-
- Object.keys(options).forEach(function (name) {
- if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) {
- throw new YAMLException('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.');
- }
- });
-
- // TODO: Add tag format check.
- this.tag = tag;
- this.kind = options['kind'] || null;
- this.resolve = options['resolve'] || function () { return true; };
- this.construct = options['construct'] || function (data) { return data; };
- this.instanceOf = options['instanceOf'] || null;
- this.predicate = options['predicate'] || null;
- this.represent = options['represent'] || null;
- this.defaultStyle = options['defaultStyle'] || null;
- this.styleAliases = compileStyleAliases(options['styleAliases'] || null);
-
- if (YAML_NODE_KINDS.indexOf(this.kind) === -1) {
- throw new YAMLException('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.');
- }
-}
-
-module.exports = Type;
-
-
-/***/ }),
-/* 14 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// Standard YAML's Core schema.
-// http://www.yaml.org/spec/1.2/spec.html#id2804923
-//
-// NOTE: JS-YAML does not support schema-specific tag resolution restrictions.
-// So, Core schema has no distinctions from JSON schema is JS-YAML.
-
-
-
-
-
-var Schema = __webpack_require__(12);
-
-
-module.exports = new Schema({
- include: [
- __webpack_require__(15)
- ]
-});
-
-
-/***/ }),
-/* 15 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// Standard YAML's JSON schema.
-// http://www.yaml.org/spec/1.2/spec.html#id2803231
-//
-// NOTE: JS-YAML does not support schema-specific tag resolution restrictions.
-// So, this schema is not such strict as defined in the YAML specification.
-// It allows numbers in binary notaion, use `Null` and `NULL` as `null`, etc.
-
-
-
-
-
-var Schema = __webpack_require__(12);
-
-
-module.exports = new Schema({
- include: [
- __webpack_require__(16)
- ],
- implicit: [
- __webpack_require__(20),
- __webpack_require__(21),
- __webpack_require__(22),
- __webpack_require__(23)
- ]
-});
-
-
-/***/ }),
-/* 16 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// Standard YAML's Failsafe schema.
-// http://www.yaml.org/spec/1.2/spec.html#id2802346
-
-
-
-
-
-var Schema = __webpack_require__(12);
-
-
-module.exports = new Schema({
- explicit: [
- __webpack_require__(17),
- __webpack_require__(18),
- __webpack_require__(19)
- ]
-});
-
-
-/***/ }),
-/* 17 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-var Type = __webpack_require__(13);
-
-module.exports = new Type('tag:yaml.org,2002:str', {
- kind: 'scalar',
- construct: function (data) { return data !== null ? data : ''; }
-});
-
-
-/***/ }),
-/* 18 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-var Type = __webpack_require__(13);
-
-module.exports = new Type('tag:yaml.org,2002:seq', {
- kind: 'sequence',
- construct: function (data) { return data !== null ? data : []; }
-});
-
-
-/***/ }),
-/* 19 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-var Type = __webpack_require__(13);
-
-module.exports = new Type('tag:yaml.org,2002:map', {
- kind: 'mapping',
- construct: function (data) { return data !== null ? data : {}; }
-});
-
-
-/***/ }),
-/* 20 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-var Type = __webpack_require__(13);
-
-function resolveYamlNull(data) {
- if (data === null) return true;
-
- var max = data.length;
-
- return (max === 1 && data === '~') ||
- (max === 4 && (data === 'null' || data === 'Null' || data === 'NULL'));
-}
-
-function constructYamlNull() {
- return null;
-}
-
-function isNull(object) {
- return object === null;
-}
-
-module.exports = new Type('tag:yaml.org,2002:null', {
- kind: 'scalar',
- resolve: resolveYamlNull,
- construct: constructYamlNull,
- predicate: isNull,
- represent: {
- canonical: function () { return '~'; },
- lowercase: function () { return 'null'; },
- uppercase: function () { return 'NULL'; },
- camelcase: function () { return 'Null'; }
- },
- defaultStyle: 'lowercase'
-});
-
-
-/***/ }),
-/* 21 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-var Type = __webpack_require__(13);
-
-function resolveYamlBoolean(data) {
- if (data === null) return false;
-
- var max = data.length;
-
- return (max === 4 && (data === 'true' || data === 'True' || data === 'TRUE')) ||
- (max === 5 && (data === 'false' || data === 'False' || data === 'FALSE'));
-}
-
-function constructYamlBoolean(data) {
- return data === 'true' ||
- data === 'True' ||
- data === 'TRUE';
-}
-
-function isBoolean(object) {
- return Object.prototype.toString.call(object) === '[object Boolean]';
-}
-
-module.exports = new Type('tag:yaml.org,2002:bool', {
- kind: 'scalar',
- resolve: resolveYamlBoolean,
- construct: constructYamlBoolean,
- predicate: isBoolean,
- represent: {
- lowercase: function (object) { return object ? 'true' : 'false'; },
- uppercase: function (object) { return object ? 'TRUE' : 'FALSE'; },
- camelcase: function (object) { return object ? 'True' : 'False'; }
- },
- defaultStyle: 'lowercase'
-});
-
-
-/***/ }),
-/* 22 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-var common = __webpack_require__(8);
-var Type = __webpack_require__(13);
-
-function isHexCode(c) {
- return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) ||
- ((0x41/* A */ <= c) && (c <= 0x46/* F */)) ||
- ((0x61/* a */ <= c) && (c <= 0x66/* f */));
-}
-
-function isOctCode(c) {
- return ((0x30/* 0 */ <= c) && (c <= 0x37/* 7 */));
-}
-
-function isDecCode(c) {
- return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */));
-}
-
-function resolveYamlInteger(data) {
- if (data === null) return false;
-
- var max = data.length,
- index = 0,
- hasDigits = false,
- ch;
-
- if (!max) return false;
-
- ch = data[index];
-
- // sign
- if (ch === '-' || ch === '+') {
- ch = data[++index];
- }
-
- if (ch === '0') {
- // 0
- if (index + 1 === max) return true;
- ch = data[++index];
-
- // base 2, base 8, base 16
-
- if (ch === 'b') {
- // base 2
- index++;
-
- for (; index < max; index++) {
- ch = data[index];
- if (ch === '_') continue;
- if (ch !== '0' && ch !== '1') return false;
- hasDigits = true;
- }
- return hasDigits && ch !== '_';
- }
-
-
- if (ch === 'x') {
- // base 16
- index++;
-
- for (; index < max; index++) {
- ch = data[index];
- if (ch === '_') continue;
- if (!isHexCode(data.charCodeAt(index))) return false;
- hasDigits = true;
- }
- return hasDigits && ch !== '_';
- }
-
- // base 8
- for (; index < max; index++) {
- ch = data[index];
- if (ch === '_') continue;
- if (!isOctCode(data.charCodeAt(index))) return false;
- hasDigits = true;
- }
- return hasDigits && ch !== '_';
- }
-
- // base 10 (except 0) or base 60
-
- // value should not start with `_`;
- if (ch === '_') return false;
-
- for (; index < max; index++) {
- ch = data[index];
- if (ch === '_') continue;
- if (ch === ':') break;
- if (!isDecCode(data.charCodeAt(index))) {
- return false;
- }
- hasDigits = true;
- }
-
- // Should have digits and should not end with `_`
- if (!hasDigits || ch === '_') return false;
-
- // if !base60 - done;
- if (ch !== ':') return true;
-
- // base60 almost not used, no needs to optimize
- return /^(:[0-5]?[0-9])+$/.test(data.slice(index));
-}
-
-function constructYamlInteger(data) {
- var value = data, sign = 1, ch, base, digits = [];
-
- if (value.indexOf('_') !== -1) {
- value = value.replace(/_/g, '');
- }
-
- ch = value[0];
-
- if (ch === '-' || ch === '+') {
- if (ch === '-') sign = -1;
- value = value.slice(1);
- ch = value[0];
- }
-
- if (value === '0') return 0;
-
- if (ch === '0') {
- if (value[1] === 'b') return sign * parseInt(value.slice(2), 2);
- if (value[1] === 'x') return sign * parseInt(value, 16);
- return sign * parseInt(value, 8);
- }
-
- if (value.indexOf(':') !== -1) {
- value.split(':').forEach(function (v) {
- digits.unshift(parseInt(v, 10));
- });
-
- value = 0;
- base = 1;
-
- digits.forEach(function (d) {
- value += (d * base);
- base *= 60;
- });
-
- return sign * value;
-
- }
-
- return sign * parseInt(value, 10);
-}
-
-function isInteger(object) {
- return (Object.prototype.toString.call(object)) === '[object Number]' &&
- (object % 1 === 0 && !common.isNegativeZero(object));
-}
-
-module.exports = new Type('tag:yaml.org,2002:int', {
- kind: 'scalar',
- resolve: resolveYamlInteger,
- construct: constructYamlInteger,
- predicate: isInteger,
- represent: {
- binary: function (obj) { return obj >= 0 ? '0b' + obj.toString(2) : '-0b' + obj.toString(2).slice(1); },
- octal: function (obj) { return obj >= 0 ? '0' + obj.toString(8) : '-0' + obj.toString(8).slice(1); },
- decimal: function (obj) { return obj.toString(10); },
- /* eslint-disable max-len */
- hexadecimal: function (obj) { return obj >= 0 ? '0x' + obj.toString(16).toUpperCase() : '-0x' + obj.toString(16).toUpperCase().slice(1); }
- },
- defaultStyle: 'decimal',
- styleAliases: {
- binary: [ 2, 'bin' ],
- octal: [ 8, 'oct' ],
- decimal: [ 10, 'dec' ],
- hexadecimal: [ 16, 'hex' ]
- }
-});
-
-
-/***/ }),
-/* 23 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-var common = __webpack_require__(8);
-var Type = __webpack_require__(13);
-
-var YAML_FLOAT_PATTERN = new RegExp(
- // 2.5e4, 2.5 and integers
- '^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?' +
- // .2e4, .2
- // special case, seems not from spec
- '|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?' +
- // 20:59
- '|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*' +
- // .inf
- '|[-+]?\\.(?:inf|Inf|INF)' +
- // .nan
- '|\\.(?:nan|NaN|NAN))$');
-
-function resolveYamlFloat(data) {
- if (data === null) return false;
-
- if (!YAML_FLOAT_PATTERN.test(data) ||
- // Quick hack to not allow integers end with `_`
- // Probably should update regexp & check speed
- data[data.length - 1] === '_') {
- return false;
- }
-
- return true;
-}
-
-function constructYamlFloat(data) {
- var value, sign, base, digits;
-
- value = data.replace(/_/g, '').toLowerCase();
- sign = value[0] === '-' ? -1 : 1;
- digits = [];
-
- if ('+-'.indexOf(value[0]) >= 0) {
- value = value.slice(1);
- }
-
- if (value === '.inf') {
- return (sign === 1) ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY;
-
- } else if (value === '.nan') {
- return NaN;
-
- } else if (value.indexOf(':') >= 0) {
- value.split(':').forEach(function (v) {
- digits.unshift(parseFloat(v, 10));
- });
-
- value = 0.0;
- base = 1;
-
- digits.forEach(function (d) {
- value += d * base;
- base *= 60;
- });
-
- return sign * value;
-
- }
- return sign * parseFloat(value, 10);
-}
-
-
-var SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/;
-
-function representYamlFloat(object, style) {
- var res;
-
- if (isNaN(object)) {
- switch (style) {
- case 'lowercase': return '.nan';
- case 'uppercase': return '.NAN';
- case 'camelcase': return '.NaN';
- }
- } else if (Number.POSITIVE_INFINITY === object) {
- switch (style) {
- case 'lowercase': return '.inf';
- case 'uppercase': return '.INF';
- case 'camelcase': return '.Inf';
- }
- } else if (Number.NEGATIVE_INFINITY === object) {
- switch (style) {
- case 'lowercase': return '-.inf';
- case 'uppercase': return '-.INF';
- case 'camelcase': return '-.Inf';
- }
- } else if (common.isNegativeZero(object)) {
- return '-0.0';
- }
-
- res = object.toString(10);
-
- // JS stringifier can build scientific format without dots: 5e-100,
- // while YAML requres dot: 5.e-100. Fix it with simple hack
-
- return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace('e', '.e') : res;
-}
-
-function isFloat(object) {
- return (Object.prototype.toString.call(object) === '[object Number]') &&
- (object % 1 !== 0 || common.isNegativeZero(object));
-}
-
-module.exports = new Type('tag:yaml.org,2002:float', {
- kind: 'scalar',
- resolve: resolveYamlFloat,
- construct: constructYamlFloat,
- predicate: isFloat,
- represent: representYamlFloat,
- defaultStyle: 'lowercase'
-});
-
-
-/***/ }),
-/* 24 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-var Type = __webpack_require__(13);
-
-var YAML_DATE_REGEXP = new RegExp(
- '^([0-9][0-9][0-9][0-9])' + // [1] year
- '-([0-9][0-9])' + // [2] month
- '-([0-9][0-9])$'); // [3] day
-
-var YAML_TIMESTAMP_REGEXP = new RegExp(
- '^([0-9][0-9][0-9][0-9])' + // [1] year
- '-([0-9][0-9]?)' + // [2] month
- '-([0-9][0-9]?)' + // [3] day
- '(?:[Tt]|[ \\t]+)' + // ...
- '([0-9][0-9]?)' + // [4] hour
- ':([0-9][0-9])' + // [5] minute
- ':([0-9][0-9])' + // [6] second
- '(?:\\.([0-9]*))?' + // [7] fraction
- '(?:[ \\t]*(Z|([-+])([0-9][0-9]?)' + // [8] tz [9] tz_sign [10] tz_hour
- '(?::([0-9][0-9]))?))?$'); // [11] tz_minute
-
-function resolveYamlTimestamp(data) {
- if (data === null) return false;
- if (YAML_DATE_REGEXP.exec(data) !== null) return true;
- if (YAML_TIMESTAMP_REGEXP.exec(data) !== null) return true;
- return false;
-}
-
-function constructYamlTimestamp(data) {
- var match, year, month, day, hour, minute, second, fraction = 0,
- delta = null, tz_hour, tz_minute, date;
-
- match = YAML_DATE_REGEXP.exec(data);
- if (match === null) match = YAML_TIMESTAMP_REGEXP.exec(data);
-
- if (match === null) throw new Error('Date resolve error');
-
- // match: [1] year [2] month [3] day
-
- year = +(match[1]);
- month = +(match[2]) - 1; // JS month starts with 0
- day = +(match[3]);
-
- if (!match[4]) { // no hour
- return new Date(Date.UTC(year, month, day));
- }
-
- // match: [4] hour [5] minute [6] second [7] fraction
-
- hour = +(match[4]);
- minute = +(match[5]);
- second = +(match[6]);
-
- if (match[7]) {
- fraction = match[7].slice(0, 3);
- while (fraction.length < 3) { // milli-seconds
- fraction += '0';
- }
- fraction = +fraction;
- }
-
- // match: [8] tz [9] tz_sign [10] tz_hour [11] tz_minute
-
- if (match[9]) {
- tz_hour = +(match[10]);
- tz_minute = +(match[11] || 0);
- delta = (tz_hour * 60 + tz_minute) * 60000; // delta in mili-seconds
- if (match[9] === '-') delta = -delta;
- }
-
- date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction));
-
- if (delta) date.setTime(date.getTime() - delta);
-
- return date;
-}
-
-function representYamlTimestamp(object /*, style*/) {
- return object.toISOString();
-}
-
-module.exports = new Type('tag:yaml.org,2002:timestamp', {
- kind: 'scalar',
- resolve: resolveYamlTimestamp,
- construct: constructYamlTimestamp,
- instanceOf: Date,
- represent: representYamlTimestamp
-});
-
-
-/***/ }),
-/* 25 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-var Type = __webpack_require__(13);
-
-function resolveYamlMerge(data) {
- return data === '<<' || data === null;
-}
-
-module.exports = new Type('tag:yaml.org,2002:merge', {
- kind: 'scalar',
- resolve: resolveYamlMerge
-});
-
-
-/***/ }),
-/* 26 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-var require;
-
-/*eslint-disable no-bitwise*/
-
-var NodeBuffer;
-
-try {
- // A trick for browserified version, to not include `Buffer` shim
- var _require = require;
- NodeBuffer = __webpack_require__(27).Buffer;
-} catch (__) {}
-
-var Type = __webpack_require__(13);
-
-
-// [ 64, 65, 66 ] -> [ padding, CR, LF ]
-var BASE64_MAP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r';
-
-
-function resolveYamlBinary(data) {
- if (data === null) return false;
-
- var code, idx, bitlen = 0, max = data.length, map = BASE64_MAP;
-
- // Convert one by one.
- for (idx = 0; idx < max; idx++) {
- code = map.indexOf(data.charAt(idx));
-
- // Skip CR/LF
- if (code > 64) continue;
-
- // Fail on illegal characters
- if (code < 0) return false;
-
- bitlen += 6;
- }
-
- // If there are any bits left, source was corrupted
- return (bitlen % 8) === 0;
-}
-
-function constructYamlBinary(data) {
- var idx, tailbits,
- input = data.replace(/[\r\n=]/g, ''), // remove CR/LF & padding to simplify scan
- max = input.length,
- map = BASE64_MAP,
- bits = 0,
- result = [];
-
- // Collect by 6*4 bits (3 bytes)
-
- for (idx = 0; idx < max; idx++) {
- if ((idx % 4 === 0) && idx) {
- result.push((bits >> 16) & 0xFF);
- result.push((bits >> 8) & 0xFF);
- result.push(bits & 0xFF);
- }
-
- bits = (bits << 6) | map.indexOf(input.charAt(idx));
- }
-
- // Dump tail
-
- tailbits = (max % 4) * 6;
-
- if (tailbits === 0) {
- result.push((bits >> 16) & 0xFF);
- result.push((bits >> 8) & 0xFF);
- result.push(bits & 0xFF);
- } else if (tailbits === 18) {
- result.push((bits >> 10) & 0xFF);
- result.push((bits >> 2) & 0xFF);
- } else if (tailbits === 12) {
- result.push((bits >> 4) & 0xFF);
- }
-
- // Wrap into Buffer for NodeJS and leave Array for browser
- if (NodeBuffer) {
- // Support node 6.+ Buffer API when available
- return NodeBuffer.from ? NodeBuffer.from(result) : new NodeBuffer(result);
- }
-
- return result;
-}
-
-function representYamlBinary(object /*, style*/) {
- var result = '', bits = 0, idx, tail,
- max = object.length,
- map = BASE64_MAP;
-
- // Convert every three bytes to 4 ASCII characters.
-
- for (idx = 0; idx < max; idx++) {
- if ((idx % 3 === 0) && idx) {
- result += map[(bits >> 18) & 0x3F];
- result += map[(bits >> 12) & 0x3F];
- result += map[(bits >> 6) & 0x3F];
- result += map[bits & 0x3F];
- }
-
- bits = (bits << 8) + object[idx];
- }
-
- // Dump tail
-
- tail = max % 3;
-
- if (tail === 0) {
- result += map[(bits >> 18) & 0x3F];
- result += map[(bits >> 12) & 0x3F];
- result += map[(bits >> 6) & 0x3F];
- result += map[bits & 0x3F];
- } else if (tail === 2) {
- result += map[(bits >> 10) & 0x3F];
- result += map[(bits >> 4) & 0x3F];
- result += map[(bits << 2) & 0x3F];
- result += map[64];
- } else if (tail === 1) {
- result += map[(bits >> 2) & 0x3F];
- result += map[(bits << 4) & 0x3F];
- result += map[64];
- result += map[64];
- }
-
- return result;
-}
-
-function isBinary(object) {
- return NodeBuffer && NodeBuffer.isBuffer(object);
-}
-
-module.exports = new Type('tag:yaml.org,2002:binary', {
- kind: 'scalar',
- resolve: resolveYamlBinary,
- construct: constructYamlBinary,
- predicate: isBinary,
- represent: representYamlBinary
-});
-
-
-/***/ }),
-/* 27 */
-/***/ (function(module, exports) {
-
-module.exports = require("buffer");
-
-/***/ }),
-/* 28 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-var Type = __webpack_require__(13);
-
-var _hasOwnProperty = Object.prototype.hasOwnProperty;
-var _toString = Object.prototype.toString;
-
-function resolveYamlOmap(data) {
- if (data === null) return true;
-
- var objectKeys = [], index, length, pair, pairKey, pairHasKey,
- object = data;
-
- for (index = 0, length = object.length; index < length; index += 1) {
- pair = object[index];
- pairHasKey = false;
-
- if (_toString.call(pair) !== '[object Object]') return false;
-
- for (pairKey in pair) {
- if (_hasOwnProperty.call(pair, pairKey)) {
- if (!pairHasKey) pairHasKey = true;
- else return false;
- }
- }
-
- if (!pairHasKey) return false;
-
- if (objectKeys.indexOf(pairKey) === -1) objectKeys.push(pairKey);
- else return false;
- }
-
- return true;
-}
-
-function constructYamlOmap(data) {
- return data !== null ? data : [];
-}
-
-module.exports = new Type('tag:yaml.org,2002:omap', {
- kind: 'sequence',
- resolve: resolveYamlOmap,
- construct: constructYamlOmap
-});
-
-
-/***/ }),
-/* 29 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-var Type = __webpack_require__(13);
-
-var _toString = Object.prototype.toString;
-
-function resolveYamlPairs(data) {
- if (data === null) return true;
-
- var index, length, pair, keys, result,
- object = data;
-
- result = new Array(object.length);
-
- for (index = 0, length = object.length; index < length; index += 1) {
- pair = object[index];
-
- if (_toString.call(pair) !== '[object Object]') return false;
-
- keys = Object.keys(pair);
-
- if (keys.length !== 1) return false;
-
- result[index] = [ keys[0], pair[keys[0]] ];
- }
-
- return true;
-}
-
-function constructYamlPairs(data) {
- if (data === null) return [];
-
- var index, length, pair, keys, result,
- object = data;
-
- result = new Array(object.length);
-
- for (index = 0, length = object.length; index < length; index += 1) {
- pair = object[index];
-
- keys = Object.keys(pair);
-
- result[index] = [ keys[0], pair[keys[0]] ];
- }
-
- return result;
-}
-
-module.exports = new Type('tag:yaml.org,2002:pairs', {
- kind: 'sequence',
- resolve: resolveYamlPairs,
- construct: constructYamlPairs
-});
-
-
-/***/ }),
-/* 30 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-var Type = __webpack_require__(13);
-
-var _hasOwnProperty = Object.prototype.hasOwnProperty;
-
-function resolveYamlSet(data) {
- if (data === null) return true;
-
- var key, object = data;
-
- for (key in object) {
- if (_hasOwnProperty.call(object, key)) {
- if (object[key] !== null) return false;
- }
- }
-
- return true;
-}
-
-function constructYamlSet(data) {
- return data !== null ? data : {};
-}
-
-module.exports = new Type('tag:yaml.org,2002:set', {
- kind: 'mapping',
- resolve: resolveYamlSet,
- construct: constructYamlSet
-});
-
-
-/***/ }),
-/* 31 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// JS-YAML's default schema for `load` function.
-// It is not described in the YAML specification.
-//
-// This schema is based on JS-YAML's default safe schema and includes
-// JavaScript-specific types: !!js/undefined, !!js/regexp and !!js/function.
-//
-// Also this schema is used as default base schema at `Schema.create` function.
-
-
-
-
-
-var Schema = __webpack_require__(12);
-
-
-module.exports = Schema.DEFAULT = new Schema({
- include: [
- __webpack_require__(11)
- ],
- explicit: [
- __webpack_require__(32),
- __webpack_require__(33),
- __webpack_require__(34)
- ]
-});
-
-
-/***/ }),
-/* 32 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-var Type = __webpack_require__(13);
-
-function resolveJavascriptUndefined() {
- return true;
-}
-
-function constructJavascriptUndefined() {
- /*eslint-disable no-undefined*/
- return undefined;
-}
-
-function representJavascriptUndefined() {
- return '';
-}
-
-function isUndefined(object) {
- return typeof object === 'undefined';
-}
-
-module.exports = new Type('tag:yaml.org,2002:js/undefined', {
- kind: 'scalar',
- resolve: resolveJavascriptUndefined,
- construct: constructJavascriptUndefined,
- predicate: isUndefined,
- represent: representJavascriptUndefined
-});
-
-
-/***/ }),
-/* 33 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-var Type = __webpack_require__(13);
-
-function resolveJavascriptRegExp(data) {
- if (data === null) return false;
- if (data.length === 0) return false;
-
- var regexp = data,
- tail = /\/([gim]*)$/.exec(data),
- modifiers = '';
-
- // if regexp starts with '/' it can have modifiers and must be properly closed
- // `/foo/gim` - modifiers tail can be maximum 3 chars
- if (regexp[0] === '/') {
- if (tail) modifiers = tail[1];
-
- if (modifiers.length > 3) return false;
- // if expression starts with /, is should be properly terminated
- if (regexp[regexp.length - modifiers.length - 1] !== '/') return false;
- }
-
- return true;
-}
-
-function constructJavascriptRegExp(data) {
- var regexp = data,
- tail = /\/([gim]*)$/.exec(data),
- modifiers = '';
-
- // `/foo/gim` - tail can be maximum 4 chars
- if (regexp[0] === '/') {
- if (tail) modifiers = tail[1];
- regexp = regexp.slice(1, regexp.length - modifiers.length - 1);
- }
-
- return new RegExp(regexp, modifiers);
-}
-
-function representJavascriptRegExp(object /*, style*/) {
- var result = '/' + object.source + '/';
-
- if (object.global) result += 'g';
- if (object.multiline) result += 'm';
- if (object.ignoreCase) result += 'i';
-
- return result;
-}
-
-function isRegExp(object) {
- return Object.prototype.toString.call(object) === '[object RegExp]';
-}
-
-module.exports = new Type('tag:yaml.org,2002:js/regexp', {
- kind: 'scalar',
- resolve: resolveJavascriptRegExp,
- construct: constructJavascriptRegExp,
- predicate: isRegExp,
- represent: representJavascriptRegExp
-});
-
-
-/***/ }),
-/* 34 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-var require;
-
-var esprima;
-
-// Browserified version does not have esprima
-//
-// 1. For node.js just require module as deps
-// 2. For browser try to require mudule via external AMD system.
-// If not found - try to fallback to window.esprima. If not
-// found too - then fail to parse.
-//
-try {
- // workaround to exclude package from browserify list.
- var _require = require;
- esprima = __webpack_require__(35);
-} catch (_) {
- /* eslint-disable no-redeclare */
- /* global window */
- if (typeof window !== 'undefined') esprima = window.esprima;
-}
-
-var Type = __webpack_require__(13);
-
-function resolveJavascriptFunction(data) {
- if (data === null) return false;
-
- try {
- var source = '(' + data + ')',
- ast = esprima.parse(source, { range: true });
-
- if (ast.type !== 'Program' ||
- ast.body.length !== 1 ||
- ast.body[0].type !== 'ExpressionStatement' ||
- (ast.body[0].expression.type !== 'ArrowFunctionExpression' &&
- ast.body[0].expression.type !== 'FunctionExpression')) {
- return false;
- }
-
- return true;
- } catch (err) {
- return false;
- }
-}
-
-function constructJavascriptFunction(data) {
- /*jslint evil:true*/
-
- var source = '(' + data + ')',
- ast = esprima.parse(source, { range: true }),
- params = [],
- body;
-
- if (ast.type !== 'Program' ||
- ast.body.length !== 1 ||
- ast.body[0].type !== 'ExpressionStatement' ||
- (ast.body[0].expression.type !== 'ArrowFunctionExpression' &&
- ast.body[0].expression.type !== 'FunctionExpression')) {
- throw new Error('Failed to resolve function');
- }
-
- ast.body[0].expression.params.forEach(function (param) {
- params.push(param.name);
- });
-
- body = ast.body[0].expression.body.range;
-
- // Esprima's ranges include the first '{' and the last '}' characters on
- // function expressions. So cut them out.
- if (ast.body[0].expression.body.type === 'BlockStatement') {
- /*eslint-disable no-new-func*/
- return new Function(params, source.slice(body[0] + 1, body[1] - 1));
- }
- // ES6 arrow functions can omit the BlockStatement. In that case, just return
- // the body.
- /*eslint-disable no-new-func*/
- return new Function(params, 'return ' + source.slice(body[0], body[1]));
-}
-
-function representJavascriptFunction(object /*, style*/) {
- return object.toString();
-}
-
-function isFunction(object) {
- return Object.prototype.toString.call(object) === '[object Function]';
-}
-
-module.exports = new Type('tag:yaml.org,2002:js/function', {
- kind: 'scalar',
- resolve: resolveJavascriptFunction,
- construct: constructJavascriptFunction,
- predicate: isFunction,
- represent: representJavascriptFunction
-});
-
-
-/***/ }),
-/* 35 */
-/***/ (function(module, exports, __webpack_require__) {
-
-(function webpackUniversalModuleDefinition(root, factory) {
-/* istanbul ignore next */
- if(true)
- module.exports = factory();
- else {}
-})(this, function() {
-return /******/ (function(modules) { // webpackBootstrap
-/******/ // The module cache
-/******/ var installedModules = {};
-
-/******/ // The require function
-/******/ function __webpack_require__(moduleId) {
-
-/******/ // Check if module is in cache
-/* istanbul ignore if */
-/******/ if(installedModules[moduleId])
-/******/ return installedModules[moduleId].exports;
-
-/******/ // Create a new module (and put it into the cache)
-/******/ var module = installedModules[moduleId] = {
-/******/ exports: {},
-/******/ id: moduleId,
-/******/ loaded: false
-/******/ };
-
-/******/ // Execute the module function
-/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
-
-/******/ // Flag the module as loaded
-/******/ module.loaded = true;
-
-/******/ // Return the exports of the module
-/******/ return module.exports;
-/******/ }
-
-
-/******/ // expose the modules object (__webpack_modules__)
-/******/ __webpack_require__.m = modules;
-
-/******/ // expose the module cache
-/******/ __webpack_require__.c = installedModules;
-
-/******/ // __webpack_public_path__
-/******/ __webpack_require__.p = "";
-
-/******/ // Load entry module and return exports
-/******/ return __webpack_require__(0);
-/******/ })
-/************************************************************************/
-/******/ ([
-/* 0 */
-/***/ function(module, exports, __webpack_require__) {
-
- "use strict";
- /*
- Copyright JS Foundation and other contributors, https://js.foundation/
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
- Object.defineProperty(exports, "__esModule", { value: true });
- var comment_handler_1 = __webpack_require__(1);
- var jsx_parser_1 = __webpack_require__(3);
- var parser_1 = __webpack_require__(8);
- var tokenizer_1 = __webpack_require__(15);
- function parse(code, options, delegate) {
- var commentHandler = null;
- var proxyDelegate = function (node, metadata) {
- if (delegate) {
- delegate(node, metadata);
- }
- if (commentHandler) {
- commentHandler.visit(node, metadata);
- }
- };
- var parserDelegate = (typeof delegate === 'function') ? proxyDelegate : null;
- var collectComment = false;
- if (options) {
- collectComment = (typeof options.comment === 'boolean' && options.comment);
- var attachComment = (typeof options.attachComment === 'boolean' && options.attachComment);
- if (collectComment || attachComment) {
- commentHandler = new comment_handler_1.CommentHandler();
- commentHandler.attach = attachComment;
- options.comment = true;
- parserDelegate = proxyDelegate;
- }
- }
- var isModule = false;
- if (options && typeof options.sourceType === 'string') {
- isModule = (options.sourceType === 'module');
- }
- var parser;
- if (options && typeof options.jsx === 'boolean' && options.jsx) {
- parser = new jsx_parser_1.JSXParser(code, options, parserDelegate);
- }
- else {
- parser = new parser_1.Parser(code, options, parserDelegate);
- }
- var program = isModule ? parser.parseModule() : parser.parseScript();
- var ast = program;
- if (collectComment && commentHandler) {
- ast.comments = commentHandler.comments;
- }
- if (parser.config.tokens) {
- ast.tokens = parser.tokens;
- }
- if (parser.config.tolerant) {
- ast.errors = parser.errorHandler.errors;
- }
- return ast;
- }
- exports.parse = parse;
- function parseModule(code, options, delegate) {
- var parsingOptions = options || {};
- parsingOptions.sourceType = 'module';
- return parse(code, parsingOptions, delegate);
- }
- exports.parseModule = parseModule;
- function parseScript(code, options, delegate) {
- var parsingOptions = options || {};
- parsingOptions.sourceType = 'script';
- return parse(code, parsingOptions, delegate);
- }
- exports.parseScript = parseScript;
- function tokenize(code, options, delegate) {
- var tokenizer = new tokenizer_1.Tokenizer(code, options);
- var tokens;
- tokens = [];
- try {
- while (true) {
- var token = tokenizer.getNextToken();
- if (!token) {
- break;
- }
- if (delegate) {
- token = delegate(token);
- }
- tokens.push(token);
- }
- }
- catch (e) {
- tokenizer.errorHandler.tolerate(e);
- }
- if (tokenizer.errorHandler.tolerant) {
- tokens.errors = tokenizer.errors();
- }
- return tokens;
- }
- exports.tokenize = tokenize;
- var syntax_1 = __webpack_require__(2);
- exports.Syntax = syntax_1.Syntax;
- // Sync with *.json manifests.
- exports.version = '4.0.1';
-
-
-/***/ },
-/* 1 */
-/***/ function(module, exports, __webpack_require__) {
-
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- var syntax_1 = __webpack_require__(2);
- var CommentHandler = (function () {
- function CommentHandler() {
- this.attach = false;
- this.comments = [];
- this.stack = [];
- this.leading = [];
- this.trailing = [];
- }
- CommentHandler.prototype.insertInnerComments = function (node, metadata) {
- // innnerComments for properties empty block
- // `function a() {/** comments **\/}`
- if (node.type === syntax_1.Syntax.BlockStatement && node.body.length === 0) {
- var innerComments = [];
- for (var i = this.leading.length - 1; i >= 0; --i) {
- var entry = this.leading[i];
- if (metadata.end.offset >= entry.start) {
- innerComments.unshift(entry.comment);
- this.leading.splice(i, 1);
- this.trailing.splice(i, 1);
- }
- }
- if (innerComments.length) {
- node.innerComments = innerComments;
- }
- }
- };
- CommentHandler.prototype.findTrailingComments = function (metadata) {
- var trailingComments = [];
- if (this.trailing.length > 0) {
- for (var i = this.trailing.length - 1; i >= 0; --i) {
- var entry_1 = this.trailing[i];
- if (entry_1.start >= metadata.end.offset) {
- trailingComments.unshift(entry_1.comment);
- }
- }
- this.trailing.length = 0;
- return trailingComments;
- }
- var entry = this.stack[this.stack.length - 1];
- if (entry && entry.node.trailingComments) {
- var firstComment = entry.node.trailingComments[0];
- if (firstComment && firstComment.range[0] >= metadata.end.offset) {
- trailingComments = entry.node.trailingComments;
- delete entry.node.trailingComments;
- }
- }
- return trailingComments;
- };
- CommentHandler.prototype.findLeadingComments = function (metadata) {
- var leadingComments = [];
- var target;
- while (this.stack.length > 0) {
- var entry = this.stack[this.stack.length - 1];
- if (entry && entry.start >= metadata.start.offset) {
- target = entry.node;
- this.stack.pop();
- }
- else {
- break;
- }
- }
- if (target) {
- var count = target.leadingComments ? target.leadingComments.length : 0;
- for (var i = count - 1; i >= 0; --i) {
- var comment = target.leadingComments[i];
- if (comment.range[1] <= metadata.start.offset) {
- leadingComments.unshift(comment);
- target.leadingComments.splice(i, 1);
- }
- }
- if (target.leadingComments && target.leadingComments.length === 0) {
- delete target.leadingComments;
- }
- return leadingComments;
- }
- for (var i = this.leading.length - 1; i >= 0; --i) {
- var entry = this.leading[i];
- if (entry.start <= metadata.start.offset) {
- leadingComments.unshift(entry.comment);
- this.leading.splice(i, 1);
- }
- }
- return leadingComments;
- };
- CommentHandler.prototype.visitNode = function (node, metadata) {
- if (node.type === syntax_1.Syntax.Program && node.body.length > 0) {
- return;
- }
- this.insertInnerComments(node, metadata);
- var trailingComments = this.findTrailingComments(metadata);
- var leadingComments = this.findLeadingComments(metadata);
- if (leadingComments.length > 0) {
- node.leadingComments = leadingComments;
- }
- if (trailingComments.length > 0) {
- node.trailingComments = trailingComments;
- }
- this.stack.push({
- node: node,
- start: metadata.start.offset
- });
- };
- CommentHandler.prototype.visitComment = function (node, metadata) {
- var type = (node.type[0] === 'L') ? 'Line' : 'Block';
- var comment = {
- type: type,
- value: node.value
- };
- if (node.range) {
- comment.range = node.range;
- }
- if (node.loc) {
- comment.loc = node.loc;
- }
- this.comments.push(comment);
- if (this.attach) {
- var entry = {
- comment: {
- type: type,
- value: node.value,
- range: [metadata.start.offset, metadata.end.offset]
- },
- start: metadata.start.offset
- };
- if (node.loc) {
- entry.comment.loc = node.loc;
- }
- node.type = type;
- this.leading.push(entry);
- this.trailing.push(entry);
- }
- };
- CommentHandler.prototype.visit = function (node, metadata) {
- if (node.type === 'LineComment') {
- this.visitComment(node, metadata);
- }
- else if (node.type === 'BlockComment') {
- this.visitComment(node, metadata);
- }
- else if (this.attach) {
- this.visitNode(node, metadata);
- }
- };
- return CommentHandler;
- }());
- exports.CommentHandler = CommentHandler;
-
-
-/***/ },
-/* 2 */
-/***/ function(module, exports) {
-
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.Syntax = {
- AssignmentExpression: 'AssignmentExpression',
- AssignmentPattern: 'AssignmentPattern',
- ArrayExpression: 'ArrayExpression',
- ArrayPattern: 'ArrayPattern',
- ArrowFunctionExpression: 'ArrowFunctionExpression',
- AwaitExpression: 'AwaitExpression',
- BlockStatement: 'BlockStatement',
- BinaryExpression: 'BinaryExpression',
- BreakStatement: 'BreakStatement',
- CallExpression: 'CallExpression',
- CatchClause: 'CatchClause',
- ClassBody: 'ClassBody',
- ClassDeclaration: 'ClassDeclaration',
- ClassExpression: 'ClassExpression',
- ConditionalExpression: 'ConditionalExpression',
- ContinueStatement: 'ContinueStatement',
- DoWhileStatement: 'DoWhileStatement',
- DebuggerStatement: 'DebuggerStatement',
- EmptyStatement: 'EmptyStatement',
- ExportAllDeclaration: 'ExportAllDeclaration',
- ExportDefaultDeclaration: 'ExportDefaultDeclaration',
- ExportNamedDeclaration: 'ExportNamedDeclaration',
- ExportSpecifier: 'ExportSpecifier',
- ExpressionStatement: 'ExpressionStatement',
- ForStatement: 'ForStatement',
- ForOfStatement: 'ForOfStatement',
- ForInStatement: 'ForInStatement',
- FunctionDeclaration: 'FunctionDeclaration',
- FunctionExpression: 'FunctionExpression',
- Identifier: 'Identifier',
- IfStatement: 'IfStatement',
- ImportDeclaration: 'ImportDeclaration',
- ImportDefaultSpecifier: 'ImportDefaultSpecifier',
- ImportNamespaceSpecifier: 'ImportNamespaceSpecifier',
- ImportSpecifier: 'ImportSpecifier',
- Literal: 'Literal',
- LabeledStatement: 'LabeledStatement',
- LogicalExpression: 'LogicalExpression',
- MemberExpression: 'MemberExpression',
- MetaProperty: 'MetaProperty',
- MethodDefinition: 'MethodDefinition',
- NewExpression: 'NewExpression',
- ObjectExpression: 'ObjectExpression',
- ObjectPattern: 'ObjectPattern',
- Program: 'Program',
- Property: 'Property',
- RestElement: 'RestElement',
- ReturnStatement: 'ReturnStatement',
- SequenceExpression: 'SequenceExpression',
- SpreadElement: 'SpreadElement',
- Super: 'Super',
- SwitchCase: 'SwitchCase',
- SwitchStatement: 'SwitchStatement',
- TaggedTemplateExpression: 'TaggedTemplateExpression',
- TemplateElement: 'TemplateElement',
- TemplateLiteral: 'TemplateLiteral',
- ThisExpression: 'ThisExpression',
- ThrowStatement: 'ThrowStatement',
- TryStatement: 'TryStatement',
- UnaryExpression: 'UnaryExpression',
- UpdateExpression: 'UpdateExpression',
- VariableDeclaration: 'VariableDeclaration',
- VariableDeclarator: 'VariableDeclarator',
- WhileStatement: 'WhileStatement',
- WithStatement: 'WithStatement',
- YieldExpression: 'YieldExpression'
- };
-
-
-/***/ },
-/* 3 */
-/***/ function(module, exports, __webpack_require__) {
-
- "use strict";
-/* istanbul ignore next */
- var __extends = (this && this.__extends) || (function () {
- var extendStatics = Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
- return function (d, b) {
- extendStatics(d, b);
- function __() { this.constructor = d; }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
- })();
- Object.defineProperty(exports, "__esModule", { value: true });
- var character_1 = __webpack_require__(4);
- var JSXNode = __webpack_require__(5);
- var jsx_syntax_1 = __webpack_require__(6);
- var Node = __webpack_require__(7);
- var parser_1 = __webpack_require__(8);
- var token_1 = __webpack_require__(13);
- var xhtml_entities_1 = __webpack_require__(14);
- token_1.TokenName[100 /* Identifier */] = 'JSXIdentifier';
- token_1.TokenName[101 /* Text */] = 'JSXText';
- // Fully qualified element name, e.g. <svg:path> returns "svg:path"
- function getQualifiedElementName(elementName) {
- var qualifiedName;
- switch (elementName.type) {
- case jsx_syntax_1.JSXSyntax.JSXIdentifier:
- var id = elementName;
- qualifiedName = id.name;
- break;
- case jsx_syntax_1.JSXSyntax.JSXNamespacedName:
- var ns = elementName;
- qualifiedName = getQualifiedElementName(ns.namespace) + ':' +
- getQualifiedElementName(ns.name);
- break;
- case jsx_syntax_1.JSXSyntax.JSXMemberExpression:
- var expr = elementName;
- qualifiedName = getQualifiedElementName(expr.object) + '.' +
- getQualifiedElementName(expr.property);
- break;
- /* istanbul ignore next */
- default:
- break;
- }
- return qualifiedName;
- }
- var JSXParser = (function (_super) {
- __extends(JSXParser, _super);
- function JSXParser(code, options, delegate) {
- return _super.call(this, code, options, delegate) || this;
- }
- JSXParser.prototype.parsePrimaryExpression = function () {
- return this.match('<') ? this.parseJSXRoot() : _super.prototype.parsePrimaryExpression.call(this);
- };
- JSXParser.prototype.startJSX = function () {
- // Unwind the scanner before the lookahead token.
- this.scanner.index = this.startMarker.index;
- this.scanner.lineNumber = this.startMarker.line;
- this.scanner.lineStart = this.startMarker.index - this.startMarker.column;
- };
- JSXParser.prototype.finishJSX = function () {
- // Prime the next lookahead.
- this.nextToken();
- };
- JSXParser.prototype.reenterJSX = function () {
- this.startJSX();
- this.expectJSX('}');
- // Pop the closing '}' added from the lookahead.
- if (this.config.tokens) {
- this.tokens.pop();
- }
- };
- JSXParser.prototype.createJSXNode = function () {
- this.collectComments();
- return {
- index: this.scanner.index,
- line: this.scanner.lineNumber,
- column: this.scanner.index - this.scanner.lineStart
- };
- };
- JSXParser.prototype.createJSXChildNode = function () {
- return {
- index: this.scanner.index,
- line: this.scanner.lineNumber,
- column: this.scanner.index - this.scanner.lineStart
- };
- };
- JSXParser.prototype.scanXHTMLEntity = function (quote) {
- var result = '&';
- var valid = true;
- var terminated = false;
- var numeric = false;
- var hex = false;
- while (!this.scanner.eof() && valid && !terminated) {
- var ch = this.scanner.source[this.scanner.index];
- if (ch === quote) {
- break;
- }
- terminated = (ch === ';');
- result += ch;
- ++this.scanner.index;
- if (!terminated) {
- switch (result.length) {
- case 2:
- // e.g. '{'
- numeric = (ch === '#');
- break;
- case 3:
- if (numeric) {
- // e.g. 'A'
- hex = (ch === 'x');
- valid = hex || character_1.Character.isDecimalDigit(ch.charCodeAt(0));
- numeric = numeric && !hex;
- }
- break;
- default:
- valid = valid && !(numeric && !character_1.Character.isDecimalDigit(ch.charCodeAt(0)));
- valid = valid && !(hex && !character_1.Character.isHexDigit(ch.charCodeAt(0)));
- break;
- }
- }
- }
- if (valid && terminated && result.length > 2) {
- // e.g. 'A' becomes just '#x41'
- var str = result.substr(1, result.length - 2);
- if (numeric && str.length > 1) {
- result = String.fromCharCode(parseInt(str.substr(1), 10));
- }
- else if (hex && str.length > 2) {
- result = String.fromCharCode(parseInt('0' + str.substr(1), 16));
- }
- else if (!numeric && !hex && xhtml_entities_1.XHTMLEntities[str]) {
- result = xhtml_entities_1.XHTMLEntities[str];
- }
- }
- return result;
- };
- // Scan the next JSX token. This replaces Scanner#lex when in JSX mode.
- JSXParser.prototype.lexJSX = function () {
- var cp = this.scanner.source.charCodeAt(this.scanner.index);
- // < > / : = { }
- if (cp === 60 || cp === 62 || cp === 47 || cp === 58 || cp === 61 || cp === 123 || cp === 125) {
- var value = this.scanner.source[this.scanner.index++];
- return {
- type: 7 /* Punctuator */,
- value: value,
- lineNumber: this.scanner.lineNumber,
- lineStart: this.scanner.lineStart,
- start: this.scanner.index - 1,
- end: this.scanner.index
- };
- }
- // " '
- if (cp === 34 || cp === 39) {
- var start = this.scanner.index;
- var quote = this.scanner.source[this.scanner.index++];
- var str = '';
- while (!this.scanner.eof()) {
- var ch = this.scanner.source[this.scanner.index++];
- if (ch === quote) {
- break;
- }
- else if (ch === '&') {
- str += this.scanXHTMLEntity(quote);
- }
- else {
- str += ch;
- }
- }
- return {
- type: 8 /* StringLiteral */,
- value: str,
- lineNumber: this.scanner.lineNumber,
- lineStart: this.scanner.lineStart,
- start: start,
- end: this.scanner.index
- };
- }
- // ... or .
- if (cp === 46) {
- var n1 = this.scanner.source.charCodeAt(this.scanner.index + 1);
- var n2 = this.scanner.source.charCodeAt(this.scanner.index + 2);
- var value = (n1 === 46 && n2 === 46) ? '...' : '.';
- var start = this.scanner.index;
- this.scanner.index += value.length;
- return {
- type: 7 /* Punctuator */,
- value: value,
- lineNumber: this.scanner.lineNumber,
- lineStart: this.scanner.lineStart,
- start: start,
- end: this.scanner.index
- };
- }
- // `
- if (cp === 96) {
- // Only placeholder, since it will be rescanned as a real assignment expression.
- return {
- type: 10 /* Template */,
- value: '',
- lineNumber: this.scanner.lineNumber,
- lineStart: this.scanner.lineStart,
- start: this.scanner.index,
- end: this.scanner.index
- };
- }
- // Identifer can not contain backslash (char code 92).
- if (character_1.Character.isIdentifierStart(cp) && (cp !== 92)) {
- var start = this.scanner.index;
- ++this.scanner.index;
- while (!this.scanner.eof()) {
- var ch = this.scanner.source.charCodeAt(this.scanner.index);
- if (character_1.Character.isIdentifierPart(ch) && (ch !== 92)) {
- ++this.scanner.index;
- }
- else if (ch === 45) {
- // Hyphen (char code 45) can be part of an identifier.
- ++this.scanner.index;
- }
- else {
- break;
- }
- }
- var id = this.scanner.source.slice(start, this.scanner.index);
- return {
- type: 100 /* Identifier */,
- value: id,
- lineNumber: this.scanner.lineNumber,
- lineStart: this.scanner.lineStart,
- start: start,
- end: this.scanner.index
- };
- }
- return this.scanner.lex();
- };
- JSXParser.prototype.nextJSXToken = function () {
- this.collectComments();
- this.startMarker.index = this.scanner.index;
- this.startMarker.line = this.scanner.lineNumber;
- this.startMarker.column = this.scanner.index - this.scanner.lineStart;
- var token = this.lexJSX();
- this.lastMarker.index = this.scanner.index;
- this.lastMarker.line = this.scanner.lineNumber;
- this.lastMarker.column = this.scanner.index - this.scanner.lineStart;
- if (this.config.tokens) {
- this.tokens.push(this.convertToken(token));
- }
- return token;
- };
- JSXParser.prototype.nextJSXText = function () {
- this.startMarker.index = this.scanner.index;
- this.startMarker.line = this.scanner.lineNumber;
- this.startMarker.column = this.scanner.index - this.scanner.lineStart;
- var start = this.scanner.index;
- var text = '';
- while (!this.scanner.eof()) {
- var ch = this.scanner.source[this.scanner.index];
- if (ch === '{' || ch === '<') {
- break;
- }
- ++this.scanner.index;
- text += ch;
- if (character_1.Character.isLineTerminator(ch.charCodeAt(0))) {
- ++this.scanner.lineNumber;
- if (ch === '\r' && this.scanner.source[this.scanner.index] === '\n') {
- ++this.scanner.index;
- }
- this.scanner.lineStart = this.scanner.index;
- }
- }
- this.lastMarker.index = this.scanner.index;
- this.lastMarker.line = this.scanner.lineNumber;
- this.lastMarker.column = this.scanner.index - this.scanner.lineStart;
- var token = {
- type: 101 /* Text */,
- value: text,
- lineNumber: this.scanner.lineNumber,
- lineStart: this.scanner.lineStart,
- start: start,
- end: this.scanner.index
- };
- if ((text.length > 0) && this.config.tokens) {
- this.tokens.push(this.convertToken(token));
- }
- return token;
- };
- JSXParser.prototype.peekJSXToken = function () {
- var state = this.scanner.saveState();
- this.scanner.scanComments();
- var next = this.lexJSX();
- this.scanner.restoreState(state);
- return next;
- };
- // Expect the next JSX token to match the specified punctuator.
- // If not, an exception will be thrown.
- JSXParser.prototype.expectJSX = function (value) {
- var token = this.nextJSXToken();
- if (token.type !== 7 /* Punctuator */ || token.value !== value) {
- this.throwUnexpectedToken(token);
- }
- };
- // Return true if the next JSX token matches the specified punctuator.
- JSXParser.prototype.matchJSX = function (value) {
- var next = this.peekJSXToken();
- return next.type === 7 /* Punctuator */ && next.value === value;
- };
- JSXParser.prototype.parseJSXIdentifier = function () {
- var node = this.createJSXNode();
- var token = this.nextJSXToken();
- if (token.type !== 100 /* Identifier */) {
- this.throwUnexpectedToken(token);
- }
- return this.finalize(node, new JSXNode.JSXIdentifier(token.value));
- };
- JSXParser.prototype.parseJSXElementName = function () {
- var node = this.createJSXNode();
- var elementName = this.parseJSXIdentifier();
- if (this.matchJSX(':')) {
- var namespace = elementName;
- this.expectJSX(':');
- var name_1 = this.parseJSXIdentifier();
- elementName = this.finalize(node, new JSXNode.JSXNamespacedName(namespace, name_1));
- }
- else if (this.matchJSX('.')) {
- while (this.matchJSX('.')) {
- var object = elementName;
- this.expectJSX('.');
- var property = this.parseJSXIdentifier();
- elementName = this.finalize(node, new JSXNode.JSXMemberExpression(object, property));
- }
- }
- return elementName;
- };
- JSXParser.prototype.parseJSXAttributeName = function () {
- var node = this.createJSXNode();
- var attributeName;
- var identifier = this.parseJSXIdentifier();
- if (this.matchJSX(':')) {
- var namespace = identifier;
- this.expectJSX(':');
- var name_2 = this.parseJSXIdentifier();
- attributeName = this.finalize(node, new JSXNode.JSXNamespacedName(namespace, name_2));
- }
- else {
- attributeName = identifier;
- }
- return attributeName;
- };
- JSXParser.prototype.parseJSXStringLiteralAttribute = function () {
- var node = this.createJSXNode();
- var token = this.nextJSXToken();
- if (token.type !== 8 /* StringLiteral */) {
- this.throwUnexpectedToken(token);
- }
- var raw = this.getTokenRaw(token);
- return this.finalize(node, new Node.Literal(token.value, raw));
- };
- JSXParser.prototype.parseJSXExpressionAttribute = function () {
- var node = this.createJSXNode();
- this.expectJSX('{');
- this.finishJSX();
- if (this.match('}')) {
- this.tolerateError('JSX attributes must only be assigned a non-empty expression');
- }
- var expression = this.parseAssignmentExpression();
- this.reenterJSX();
- return this.finalize(node, new JSXNode.JSXExpressionContainer(expression));
- };
- JSXParser.prototype.parseJSXAttributeValue = function () {
- return this.matchJSX('{') ? this.parseJSXExpressionAttribute() :
- this.matchJSX('<') ? this.parseJSXElement() : this.parseJSXStringLiteralAttribute();
- };
- JSXParser.prototype.parseJSXNameValueAttribute = function () {
- var node = this.createJSXNode();
- var name = this.parseJSXAttributeName();
- var value = null;
- if (this.matchJSX('=')) {
- this.expectJSX('=');
- value = this.parseJSXAttributeValue();
- }
- return this.finalize(node, new JSXNode.JSXAttribute(name, value));
- };
- JSXParser.prototype.parseJSXSpreadAttribute = function () {
- var node = this.createJSXNode();
- this.expectJSX('{');
- this.expectJSX('...');
- this.finishJSX();
- var argument = this.parseAssignmentExpression();
- this.reenterJSX();
- return this.finalize(node, new JSXNode.JSXSpreadAttribute(argument));
- };
- JSXParser.prototype.parseJSXAttributes = function () {
- var attributes = [];
- while (!this.matchJSX('/') && !this.matchJSX('>')) {
- var attribute = this.matchJSX('{') ? this.parseJSXSpreadAttribute() :
- this.parseJSXNameValueAttribute();
- attributes.push(attribute);
- }
- return attributes;
- };
- JSXParser.prototype.parseJSXOpeningElement = function () {
- var node = this.createJSXNode();
- this.expectJSX('<');
- var name = this.parseJSXElementName();
- var attributes = this.parseJSXAttributes();
- var selfClosing = this.matchJSX('/');
- if (selfClosing) {
- this.expectJSX('/');
- }
- this.expectJSX('>');
- return this.finalize(node, new JSXNode.JSXOpeningElement(name, selfClosing, attributes));
- };
- JSXParser.prototype.parseJSXBoundaryElement = function () {
- var node = this.createJSXNode();
- this.expectJSX('<');
- if (this.matchJSX('/')) {
- this.expectJSX('/');
- var name_3 = this.parseJSXElementName();
- this.expectJSX('>');
- return this.finalize(node, new JSXNode.JSXClosingElement(name_3));
- }
- var name = this.parseJSXElementName();
- var attributes = this.parseJSXAttributes();
- var selfClosing = this.matchJSX('/');
- if (selfClosing) {
- this.expectJSX('/');
- }
- this.expectJSX('>');
- return this.finalize(node, new JSXNode.JSXOpeningElement(name, selfClosing, attributes));
- };
- JSXParser.prototype.parseJSXEmptyExpression = function () {
- var node = this.createJSXChildNode();
- this.collectComments();
- this.lastMarker.index = this.scanner.index;
- this.lastMarker.line = this.scanner.lineNumber;
- this.lastMarker.column = this.scanner.index - this.scanner.lineStart;
- return this.finalize(node, new JSXNode.JSXEmptyExpression());
- };
- JSXParser.prototype.parseJSXExpressionContainer = function () {
- var node = this.createJSXNode();
- this.expectJSX('{');
- var expression;
- if (this.matchJSX('}')) {
- expression = this.parseJSXEmptyExpression();
- this.expectJSX('}');
- }
- else {
- this.finishJSX();
- expression = this.parseAssignmentExpression();
- this.reenterJSX();
- }
- return this.finalize(node, new JSXNode.JSXExpressionContainer(expression));
- };
- JSXParser.prototype.parseJSXChildren = function () {
- var children = [];
- while (!this.scanner.eof()) {
- var node = this.createJSXChildNode();
- var token = this.nextJSXText();
- if (token.start < token.end) {
- var raw = this.getTokenRaw(token);
- var child = this.finalize(node, new JSXNode.JSXText(token.value, raw));
- children.push(child);
- }
- if (this.scanner.source[this.scanner.index] === '{') {
- var container = this.parseJSXExpressionContainer();
- children.push(container);
- }
- else {
- break;
- }
- }
- return children;
- };
- JSXParser.prototype.parseComplexJSXElement = function (el) {
- var stack = [];
- while (!this.scanner.eof()) {
- el.children = el.children.concat(this.parseJSXChildren());
- var node = this.createJSXChildNode();
- var element = this.parseJSXBoundaryElement();
- if (element.type === jsx_syntax_1.JSXSyntax.JSXOpeningElement) {
- var opening = element;
- if (opening.selfClosing) {
- var child = this.finalize(node, new JSXNode.JSXElement(opening, [], null));
- el.children.push(child);
- }
- else {
- stack.push(el);
- el = { node: node, opening: opening, closing: null, children: [] };
- }
- }
- if (element.type === jsx_syntax_1.JSXSyntax.JSXClosingElement) {
- el.closing = element;
- var open_1 = getQualifiedElementName(el.opening.name);
- var close_1 = getQualifiedElementName(el.closing.name);
- if (open_1 !== close_1) {
- this.tolerateError('Expected corresponding JSX closing tag for %0', open_1);
- }
- if (stack.length > 0) {
- var child = this.finalize(el.node, new JSXNode.JSXElement(el.opening, el.children, el.closing));
- el = stack[stack.length - 1];
- el.children.push(child);
- stack.pop();
- }
- else {
- break;
- }
- }
- }
- return el;
- };
- JSXParser.prototype.parseJSXElement = function () {
- var node = this.createJSXNode();
- var opening = this.parseJSXOpeningElement();
- var children = [];
- var closing = null;
- if (!opening.selfClosing) {
- var el = this.parseComplexJSXElement({ node: node, opening: opening, closing: closing, children: children });
- children = el.children;
- closing = el.closing;
- }
- return this.finalize(node, new JSXNode.JSXElement(opening, children, closing));
- };
- JSXParser.prototype.parseJSXRoot = function () {
- // Pop the opening '<' added from the lookahead.
- if (this.config.tokens) {
- this.tokens.pop();
- }
- this.startJSX();
- var element = this.parseJSXElement();
- this.finishJSX();
- return element;
- };
- JSXParser.prototype.isStartOfExpression = function () {
- return _super.prototype.isStartOfExpression.call(this) || this.match('<');
- };
- return JSXParser;
- }(parser_1.Parser));
- exports.JSXParser = JSXParser;
-
-
-/***/ },
-/* 4 */
-/***/ function(module, exports) {
-
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- // See also tools/generate-unicode-regex.js.
- var Regex = {
- // Unicode v8.0.0 NonAsciiIdentifierStart:
- NonAsciiIdentifierStart: /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]/,
- // Unicode v8.0.0 NonAsciiIdentifierPart:
- NonAsciiIdentifierPart: /[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/
- };
- exports.Character = {
- /* tslint:disable:no-bitwise */
- fromCodePoint: function (cp) {
- return (cp < 0x10000) ? String.fromCharCode(cp) :
- String.fromCharCode(0xD800 + ((cp - 0x10000) >> 10)) +
- String.fromCharCode(0xDC00 + ((cp - 0x10000) & 1023));
- },
- // https://tc39.github.io/ecma262/#sec-white-space
- isWhiteSpace: function (cp) {
- return (cp === 0x20) || (cp === 0x09) || (cp === 0x0B) || (cp === 0x0C) || (cp === 0xA0) ||
- (cp >= 0x1680 && [0x1680, 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200A, 0x202F, 0x205F, 0x3000, 0xFEFF].indexOf(cp) >= 0);
- },
- // https://tc39.github.io/ecma262/#sec-line-terminators
- isLineTerminator: function (cp) {
- return (cp === 0x0A) || (cp === 0x0D) || (cp === 0x2028) || (cp === 0x2029);
- },
- // https://tc39.github.io/ecma262/#sec-names-and-keywords
- isIdentifierStart: function (cp) {
- return (cp === 0x24) || (cp === 0x5F) ||
- (cp >= 0x41 && cp <= 0x5A) ||
- (cp >= 0x61 && cp <= 0x7A) ||
- (cp === 0x5C) ||
- ((cp >= 0x80) && Regex.NonAsciiIdentifierStart.test(exports.Character.fromCodePoint(cp)));
- },
- isIdentifierPart: function (cp) {
- return (cp === 0x24) || (cp === 0x5F) ||
- (cp >= 0x41 && cp <= 0x5A) ||
- (cp >= 0x61 && cp <= 0x7A) ||
- (cp >= 0x30 && cp <= 0x39) ||
- (cp === 0x5C) ||
- ((cp >= 0x80) && Regex.NonAsciiIdentifierPart.test(exports.Character.fromCodePoint(cp)));
- },
- // https://tc39.github.io/ecma262/#sec-literals-numeric-literals
- isDecimalDigit: function (cp) {
- return (cp >= 0x30 && cp <= 0x39); // 0..9
- },
- isHexDigit: function (cp) {
- return (cp >= 0x30 && cp <= 0x39) ||
- (cp >= 0x41 && cp <= 0x46) ||
- (cp >= 0x61 && cp <= 0x66); // a..f
- },
- isOctalDigit: function (cp) {
- return (cp >= 0x30 && cp <= 0x37); // 0..7
- }
- };
-
-
-/***/ },
-/* 5 */
-/***/ function(module, exports, __webpack_require__) {
-
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- var jsx_syntax_1 = __webpack_require__(6);
- /* tslint:disable:max-classes-per-file */
- var JSXClosingElement = (function () {
- function JSXClosingElement(name) {
- this.type = jsx_syntax_1.JSXSyntax.JSXClosingElement;
- this.name = name;
- }
- return JSXClosingElement;
- }());
- exports.JSXClosingElement = JSXClosingElement;
- var JSXElement = (function () {
- function JSXElement(openingElement, children, closingElement) {
- this.type = jsx_syntax_1.JSXSyntax.JSXElement;
- this.openingElement = openingElement;
- this.children = children;
- this.closingElement = closingElement;
- }
- return JSXElement;
- }());
- exports.JSXElement = JSXElement;
- var JSXEmptyExpression = (function () {
- function JSXEmptyExpression() {
- this.type = jsx_syntax_1.JSXSyntax.JSXEmptyExpression;
- }
- return JSXEmptyExpression;
- }());
- exports.JSXEmptyExpression = JSXEmptyExpression;
- var JSXExpressionContainer = (function () {
- function JSXExpressionContainer(expression) {
- this.type = jsx_syntax_1.JSXSyntax.JSXExpressionContainer;
- this.expression = expression;
- }
- return JSXExpressionContainer;
- }());
- exports.JSXExpressionContainer = JSXExpressionContainer;
- var JSXIdentifier = (function () {
- function JSXIdentifier(name) {
- this.type = jsx_syntax_1.JSXSyntax.JSXIdentifier;
- this.name = name;
- }
- return JSXIdentifier;
- }());
- exports.JSXIdentifier = JSXIdentifier;
- var JSXMemberExpression = (function () {
- function JSXMemberExpression(object, property) {
- this.type = jsx_syntax_1.JSXSyntax.JSXMemberExpression;
- this.object = object;
- this.property = property;
- }
- return JSXMemberExpression;
- }());
- exports.JSXMemberExpression = JSXMemberExpression;
- var JSXAttribute = (function () {
- function JSXAttribute(name, value) {
- this.type = jsx_syntax_1.JSXSyntax.JSXAttribute;
- this.name = name;
- this.value = value;
- }
- return JSXAttribute;
- }());
- exports.JSXAttribute = JSXAttribute;
- var JSXNamespacedName = (function () {
- function JSXNamespacedName(namespace, name) {
- this.type = jsx_syntax_1.JSXSyntax.JSXNamespacedName;
- this.namespace = namespace;
- this.name = name;
- }
- return JSXNamespacedName;
- }());
- exports.JSXNamespacedName = JSXNamespacedName;
- var JSXOpeningElement = (function () {
- function JSXOpeningElement(name, selfClosing, attributes) {
- this.type = jsx_syntax_1.JSXSyntax.JSXOpeningElement;
- this.name = name;
- this.selfClosing = selfClosing;
- this.attributes = attributes;
- }
- return JSXOpeningElement;
- }());
- exports.JSXOpeningElement = JSXOpeningElement;
- var JSXSpreadAttribute = (function () {
- function JSXSpreadAttribute(argument) {
- this.type = jsx_syntax_1.JSXSyntax.JSXSpreadAttribute;
- this.argument = argument;
- }
- return JSXSpreadAttribute;
- }());
- exports.JSXSpreadAttribute = JSXSpreadAttribute;
- var JSXText = (function () {
- function JSXText(value, raw) {
- this.type = jsx_syntax_1.JSXSyntax.JSXText;
- this.value = value;
- this.raw = raw;
- }
- return JSXText;
- }());
- exports.JSXText = JSXText;
-
-
-/***/ },
-/* 6 */
-/***/ function(module, exports) {
-
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.JSXSyntax = {
- JSXAttribute: 'JSXAttribute',
- JSXClosingElement: 'JSXClosingElement',
- JSXElement: 'JSXElement',
- JSXEmptyExpression: 'JSXEmptyExpression',
- JSXExpressionContainer: 'JSXExpressionContainer',
- JSXIdentifier: 'JSXIdentifier',
- JSXMemberExpression: 'JSXMemberExpression',
- JSXNamespacedName: 'JSXNamespacedName',
- JSXOpeningElement: 'JSXOpeningElement',
- JSXSpreadAttribute: 'JSXSpreadAttribute',
- JSXText: 'JSXText'
- };
-
-
-/***/ },
-/* 7 */
-/***/ function(module, exports, __webpack_require__) {
-
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- var syntax_1 = __webpack_require__(2);
- /* tslint:disable:max-classes-per-file */
- var ArrayExpression = (function () {
- function ArrayExpression(elements) {
- this.type = syntax_1.Syntax.ArrayExpression;
- this.elements = elements;
- }
- return ArrayExpression;
- }());
- exports.ArrayExpression = ArrayExpression;
- var ArrayPattern = (function () {
- function ArrayPattern(elements) {
- this.type = syntax_1.Syntax.ArrayPattern;
- this.elements = elements;
- }
- return ArrayPattern;
- }());
- exports.ArrayPattern = ArrayPattern;
- var ArrowFunctionExpression = (function () {
- function ArrowFunctionExpression(params, body, expression) {
- this.type = syntax_1.Syntax.ArrowFunctionExpression;
- this.id = null;
- this.params = params;
- this.body = body;
- this.generator = false;
- this.expression = expression;
- this.async = false;
- }
- return ArrowFunctionExpression;
- }());
- exports.ArrowFunctionExpression = ArrowFunctionExpression;
- var AssignmentExpression = (function () {
- function AssignmentExpression(operator, left, right) {
- this.type = syntax_1.Syntax.AssignmentExpression;
- this.operator = operator;
- this.left = left;
- this.right = right;
- }
- return AssignmentExpression;
- }());
- exports.AssignmentExpression = AssignmentExpression;
- var AssignmentPattern = (function () {
- function AssignmentPattern(left, right) {
- this.type = syntax_1.Syntax.AssignmentPattern;
- this.left = left;
- this.right = right;
- }
- return AssignmentPattern;
- }());
- exports.AssignmentPattern = AssignmentPattern;
- var AsyncArrowFunctionExpression = (function () {
- function AsyncArrowFunctionExpression(params, body, expression) {
- this.type = syntax_1.Syntax.ArrowFunctionExpression;
- this.id = null;
- this.params = params;
- this.body = body;
- this.generator = false;
- this.expression = expression;
- this.async = true;
- }
- return AsyncArrowFunctionExpression;
- }());
- exports.AsyncArrowFunctionExpression = AsyncArrowFunctionExpression;
- var AsyncFunctionDeclaration = (function () {
- function AsyncFunctionDeclaration(id, params, body) {
- this.type = syntax_1.Syntax.FunctionDeclaration;
- this.id = id;
- this.params = params;
- this.body = body;
- this.generator = false;
- this.expression = false;
- this.async = true;
- }
- return AsyncFunctionDeclaration;
- }());
- exports.AsyncFunctionDeclaration = AsyncFunctionDeclaration;
- var AsyncFunctionExpression = (function () {
- function AsyncFunctionExpression(id, params, body) {
- this.type = syntax_1.Syntax.FunctionExpression;
- this.id = id;
- this.params = params;
- this.body = body;
- this.generator = false;
- this.expression = false;
- this.async = true;
- }
- return AsyncFunctionExpression;
- }());
- exports.AsyncFunctionExpression = AsyncFunctionExpression;
- var AwaitExpression = (function () {
- function AwaitExpression(argument) {
- this.type = syntax_1.Syntax.AwaitExpression;
- this.argument = argument;
- }
- return AwaitExpression;
- }());
- exports.AwaitExpression = AwaitExpression;
- var BinaryExpression = (function () {
- function BinaryExpression(operator, left, right) {
- var logical = (operator === '||' || operator === '&&');
- this.type = logical ? syntax_1.Syntax.LogicalExpression : syntax_1.Syntax.BinaryExpression;
- this.operator = operator;
- this.left = left;
- this.right = right;
- }
- return BinaryExpression;
- }());
- exports.BinaryExpression = BinaryExpression;
- var BlockStatement = (function () {
- function BlockStatement(body) {
- this.type = syntax_1.Syntax.BlockStatement;
- this.body = body;
- }
- return BlockStatement;
- }());
- exports.BlockStatement = BlockStatement;
- var BreakStatement = (function () {
- function BreakStatement(label) {
- this.type = syntax_1.Syntax.BreakStatement;
- this.label = label;
- }
- return BreakStatement;
- }());
- exports.BreakStatement = BreakStatement;
- var CallExpression = (function () {
- function CallExpression(callee, args) {
- this.type = syntax_1.Syntax.CallExpression;
- this.callee = callee;
- this.arguments = args;
- }
- return CallExpression;
- }());
- exports.CallExpression = CallExpression;
- var CatchClause = (function () {
- function CatchClause(param, body) {
- this.type = syntax_1.Syntax.CatchClause;
- this.param = param;
- this.body = body;
- }
- return CatchClause;
- }());
- exports.CatchClause = CatchClause;
- var ClassBody = (function () {
- function ClassBody(body) {
- this.type = syntax_1.Syntax.ClassBody;
- this.body = body;
- }
- return ClassBody;
- }());
- exports.ClassBody = ClassBody;
- var ClassDeclaration = (function () {
- function ClassDeclaration(id, superClass, body) {
- this.type = syntax_1.Syntax.ClassDeclaration;
- this.id = id;
- this.superClass = superClass;
- this.body = body;
- }
- return ClassDeclaration;
- }());
- exports.ClassDeclaration = ClassDeclaration;
- var ClassExpression = (function () {
- function ClassExpression(id, superClass, body) {
- this.type = syntax_1.Syntax.ClassExpression;
- this.id = id;
- this.superClass = superClass;
- this.body = body;
- }
- return ClassExpression;
- }());
- exports.ClassExpression = ClassExpression;
- var ComputedMemberExpression = (function () {
- function ComputedMemberExpression(object, property) {
- this.type = syntax_1.Syntax.MemberExpression;
- this.computed = true;
- this.object = object;
- this.property = property;
- }
- return ComputedMemberExpression;
- }());
- exports.ComputedMemberExpression = ComputedMemberExpression;
- var ConditionalExpression = (function () {
- function ConditionalExpression(test, consequent, alternate) {
- this.type = syntax_1.Syntax.ConditionalExpression;
- this.test = test;
- this.consequent = consequent;
- this.alternate = alternate;
- }
- return ConditionalExpression;
- }());
- exports.ConditionalExpression = ConditionalExpression;
- var ContinueStatement = (function () {
- function ContinueStatement(label) {
- this.type = syntax_1.Syntax.ContinueStatement;
- this.label = label;
- }
- return ContinueStatement;
- }());
- exports.ContinueStatement = ContinueStatement;
- var DebuggerStatement = (function () {
- function DebuggerStatement() {
- this.type = syntax_1.Syntax.DebuggerStatement;
- }
- return DebuggerStatement;
- }());
- exports.DebuggerStatement = DebuggerStatement;
- var Directive = (function () {
- function Directive(expression, directive) {
- this.type = syntax_1.Syntax.ExpressionStatement;
- this.expression = expression;
- this.directive = directive;
- }
- return Directive;
- }());
- exports.Directive = Directive;
- var DoWhileStatement = (function () {
- function DoWhileStatement(body, test) {
- this.type = syntax_1.Syntax.DoWhileStatement;
- this.body = body;
- this.test = test;
- }
- return DoWhileStatement;
- }());
- exports.DoWhileStatement = DoWhileStatement;
- var EmptyStatement = (function () {
- function EmptyStatement() {
- this.type = syntax_1.Syntax.EmptyStatement;
- }
- return EmptyStatement;
- }());
- exports.EmptyStatement = EmptyStatement;
- var ExportAllDeclaration = (function () {
- function ExportAllDeclaration(source) {
- this.type = syntax_1.Syntax.ExportAllDeclaration;
- this.source = source;
- }
- return ExportAllDeclaration;
- }());
- exports.ExportAllDeclaration = ExportAllDeclaration;
- var ExportDefaultDeclaration = (function () {
- function ExportDefaultDeclaration(declaration) {
- this.type = syntax_1.Syntax.ExportDefaultDeclaration;
- this.declaration = declaration;
- }
- return ExportDefaultDeclaration;
- }());
- exports.ExportDefaultDeclaration = ExportDefaultDeclaration;
- var ExportNamedDeclaration = (function () {
- function ExportNamedDeclaration(declaration, specifiers, source) {
- this.type = syntax_1.Syntax.ExportNamedDeclaration;
- this.declaration = declaration;
- this.specifiers = specifiers;
- this.source = source;
- }
- return ExportNamedDeclaration;
- }());
- exports.ExportNamedDeclaration = ExportNamedDeclaration;
- var ExportSpecifier = (function () {
- function ExportSpecifier(local, exported) {
- this.type = syntax_1.Syntax.ExportSpecifier;
- this.exported = exported;
- this.local = local;
- }
- return ExportSpecifier;
- }());
- exports.ExportSpecifier = ExportSpecifier;
- var ExpressionStatement = (function () {
- function ExpressionStatement(expression) {
- this.type = syntax_1.Syntax.ExpressionStatement;
- this.expression = expression;
- }
- return ExpressionStatement;
- }());
- exports.ExpressionStatement = ExpressionStatement;
- var ForInStatement = (function () {
- function ForInStatement(left, right, body) {
- this.type = syntax_1.Syntax.ForInStatement;
- this.left = left;
- this.right = right;
- this.body = body;
- this.each = false;
- }
- return ForInStatement;
- }());
- exports.ForInStatement = ForInStatement;
- var ForOfStatement = (function () {
- function ForOfStatement(left, right, body) {
- this.type = syntax_1.Syntax.ForOfStatement;
- this.left = left;
- this.right = right;
- this.body = body;
- }
- return ForOfStatement;
- }());
- exports.ForOfStatement = ForOfStatement;
- var ForStatement = (function () {
- function ForStatement(init, test, update, body) {
- this.type = syntax_1.Syntax.ForStatement;
- this.init = init;
- this.test = test;
- this.update = update;
- this.body = body;
- }
- return ForStatement;
- }());
- exports.ForStatement = ForStatement;
- var FunctionDeclaration = (function () {
- function FunctionDeclaration(id, params, body, generator) {
- this.type = syntax_1.Syntax.FunctionDeclaration;
- this.id = id;
- this.params = params;
- this.body = body;
- this.generator = generator;
- this.expression = false;
- this.async = false;
- }
- return FunctionDeclaration;
- }());
- exports.FunctionDeclaration = FunctionDeclaration;
- var FunctionExpression = (function () {
- function FunctionExpression(id, params, body, generator) {
- this.type = syntax_1.Syntax.FunctionExpression;
- this.id = id;
- this.params = params;
- this.body = body;
- this.generator = generator;
- this.expression = false;
- this.async = false;
- }
- return FunctionExpression;
- }());
- exports.FunctionExpression = FunctionExpression;
- var Identifier = (function () {
- function Identifier(name) {
- this.type = syntax_1.Syntax.Identifier;
- this.name = name;
- }
- return Identifier;
- }());
- exports.Identifier = Identifier;
- var IfStatement = (function () {
- function IfStatement(test, consequent, alternate) {
- this.type = syntax_1.Syntax.IfStatement;
- this.test = test;
- this.consequent = consequent;
- this.alternate = alternate;
- }
- return IfStatement;
- }());
- exports.IfStatement = IfStatement;
- var ImportDeclaration = (function () {
- function ImportDeclaration(specifiers, source) {
- this.type = syntax_1.Syntax.ImportDeclaration;
- this.specifiers = specifiers;
- this.source = source;
- }
- return ImportDeclaration;
- }());
- exports.ImportDeclaration = ImportDeclaration;
- var ImportDefaultSpecifier = (function () {
- function ImportDefaultSpecifier(local) {
- this.type = syntax_1.Syntax.ImportDefaultSpecifier;
- this.local = local;
- }
- return ImportDefaultSpecifier;
- }());
- exports.ImportDefaultSpecifier = ImportDefaultSpecifier;
- var ImportNamespaceSpecifier = (function () {
- function ImportNamespaceSpecifier(local) {
- this.type = syntax_1.Syntax.ImportNamespaceSpecifier;
- this.local = local;
- }
- return ImportNamespaceSpecifier;
- }());
- exports.ImportNamespaceSpecifier = ImportNamespaceSpecifier;
- var ImportSpecifier = (function () {
- function ImportSpecifier(local, imported) {
- this.type = syntax_1.Syntax.ImportSpecifier;
- this.local = local;
- this.imported = imported;
- }
- return ImportSpecifier;
- }());
- exports.ImportSpecifier = ImportSpecifier;
- var LabeledStatement = (function () {
- function LabeledStatement(label, body) {
- this.type = syntax_1.Syntax.LabeledStatement;
- this.label = label;
- this.body = body;
- }
- return LabeledStatement;
- }());
- exports.LabeledStatement = LabeledStatement;
- var Literal = (function () {
- function Literal(value, raw) {
- this.type = syntax_1.Syntax.Literal;
- this.value = value;
- this.raw = raw;
- }
- return Literal;
- }());
- exports.Literal = Literal;
- var MetaProperty = (function () {
- function MetaProperty(meta, property) {
- this.type = syntax_1.Syntax.MetaProperty;
- this.meta = meta;
- this.property = property;
- }
- return MetaProperty;
- }());
- exports.MetaProperty = MetaProperty;
- var MethodDefinition = (function () {
- function MethodDefinition(key, computed, value, kind, isStatic) {
- this.type = syntax_1.Syntax.MethodDefinition;
- this.key = key;
- this.computed = computed;
- this.value = value;
- this.kind = kind;
- this.static = isStatic;
- }
- return MethodDefinition;
- }());
- exports.MethodDefinition = MethodDefinition;
- var Module = (function () {
- function Module(body) {
- this.type = syntax_1.Syntax.Program;
- this.body = body;
- this.sourceType = 'module';
- }
- return Module;
- }());
- exports.Module = Module;
- var NewExpression = (function () {
- function NewExpression(callee, args) {
- this.type = syntax_1.Syntax.NewExpression;
- this.callee = callee;
- this.arguments = args;
- }
- return NewExpression;
- }());
- exports.NewExpression = NewExpression;
- var ObjectExpression = (function () {
- function ObjectExpression(properties) {
- this.type = syntax_1.Syntax.ObjectExpression;
- this.properties = properties;
- }
- return ObjectExpression;
- }());
- exports.ObjectExpression = ObjectExpression;
- var ObjectPattern = (function () {
- function ObjectPattern(properties) {
- this.type = syntax_1.Syntax.ObjectPattern;
- this.properties = properties;
- }
- return ObjectPattern;
- }());
- exports.ObjectPattern = ObjectPattern;
- var Property = (function () {
- function Property(kind, key, computed, value, method, shorthand) {
- this.type = syntax_1.Syntax.Property;
- this.key = key;
- this.computed = computed;
- this.value = value;
- this.kind = kind;
- this.method = method;
- this.shorthand = shorthand;
- }
- return Property;
- }());
- exports.Property = Property;
- var RegexLiteral = (function () {
- function RegexLiteral(value, raw, pattern, flags) {
- this.type = syntax_1.Syntax.Literal;
- this.value = value;
- this.raw = raw;
- this.regex = { pattern: pattern, flags: flags };
- }
- return RegexLiteral;
- }());
- exports.RegexLiteral = RegexLiteral;
- var RestElement = (function () {
- function RestElement(argument) {
- this.type = syntax_1.Syntax.RestElement;
- this.argument = argument;
- }
- return RestElement;
- }());
- exports.RestElement = RestElement;
- var ReturnStatement = (function () {
- function ReturnStatement(argument) {
- this.type = syntax_1.Syntax.ReturnStatement;
- this.argument = argument;
- }
- return ReturnStatement;
- }());
- exports.ReturnStatement = ReturnStatement;
- var Script = (function () {
- function Script(body) {
- this.type = syntax_1.Syntax.Program;
- this.body = body;
- this.sourceType = 'script';
- }
- return Script;
- }());
- exports.Script = Script;
- var SequenceExpression = (function () {
- function SequenceExpression(expressions) {
- this.type = syntax_1.Syntax.SequenceExpression;
- this.expressions = expressions;
- }
- return SequenceExpression;
- }());
- exports.SequenceExpression = SequenceExpression;
- var SpreadElement = (function () {
- function SpreadElement(argument) {
- this.type = syntax_1.Syntax.SpreadElement;
- this.argument = argument;
- }
- return SpreadElement;
- }());
- exports.SpreadElement = SpreadElement;
- var StaticMemberExpression = (function () {
- function StaticMemberExpression(object, property) {
- this.type = syntax_1.Syntax.MemberExpression;
- this.computed = false;
- this.object = object;
- this.property = property;
- }
- return StaticMemberExpression;
- }());
- exports.StaticMemberExpression = StaticMemberExpression;
- var Super = (function () {
- function Super() {
- this.type = syntax_1.Syntax.Super;
- }
- return Super;
- }());
- exports.Super = Super;
- var SwitchCase = (function () {
- function SwitchCase(test, consequent) {
- this.type = syntax_1.Syntax.SwitchCase;
- this.test = test;
- this.consequent = consequent;
- }
- return SwitchCase;
- }());
- exports.SwitchCase = SwitchCase;
- var SwitchStatement = (function () {
- function SwitchStatement(discriminant, cases) {
- this.type = syntax_1.Syntax.SwitchStatement;
- this.discriminant = discriminant;
- this.cases = cases;
- }
- return SwitchStatement;
- }());
- exports.SwitchStatement = SwitchStatement;
- var TaggedTemplateExpression = (function () {
- function TaggedTemplateExpression(tag, quasi) {
- this.type = syntax_1.Syntax.TaggedTemplateExpression;
- this.tag = tag;
- this.quasi = quasi;
- }
- return TaggedTemplateExpression;
- }());
- exports.TaggedTemplateExpression = TaggedTemplateExpression;
- var TemplateElement = (function () {
- function TemplateElement(value, tail) {
- this.type = syntax_1.Syntax.TemplateElement;
- this.value = value;
- this.tail = tail;
- }
- return TemplateElement;
- }());
- exports.TemplateElement = TemplateElement;
- var TemplateLiteral = (function () {
- function TemplateLiteral(quasis, expressions) {
- this.type = syntax_1.Syntax.TemplateLiteral;
- this.quasis = quasis;
- this.expressions = expressions;
- }
- return TemplateLiteral;
- }());
- exports.TemplateLiteral = TemplateLiteral;
- var ThisExpression = (function () {
- function ThisExpression() {
- this.type = syntax_1.Syntax.ThisExpression;
- }
- return ThisExpression;
- }());
- exports.ThisExpression = ThisExpression;
- var ThrowStatement = (function () {
- function ThrowStatement(argument) {
- this.type = syntax_1.Syntax.ThrowStatement;
- this.argument = argument;
- }
- return ThrowStatement;
- }());
- exports.ThrowStatement = ThrowStatement;
- var TryStatement = (function () {
- function TryStatement(block, handler, finalizer) {
- this.type = syntax_1.Syntax.TryStatement;
- this.block = block;
- this.handler = handler;
- this.finalizer = finalizer;
- }
- return TryStatement;
- }());
- exports.TryStatement = TryStatement;
- var UnaryExpression = (function () {
- function UnaryExpression(operator, argument) {
- this.type = syntax_1.Syntax.UnaryExpression;
- this.operator = operator;
- this.argument = argument;
- this.prefix = true;
- }
- return UnaryExpression;
- }());
- exports.UnaryExpression = UnaryExpression;
- var UpdateExpression = (function () {
- function UpdateExpression(operator, argument, prefix) {
- this.type = syntax_1.Syntax.UpdateExpression;
- this.operator = operator;
- this.argument = argument;
- this.prefix = prefix;
- }
- return UpdateExpression;
- }());
- exports.UpdateExpression = UpdateExpression;
- var VariableDeclaration = (function () {
- function VariableDeclaration(declarations, kind) {
- this.type = syntax_1.Syntax.VariableDeclaration;
- this.declarations = declarations;
- this.kind = kind;
- }
- return VariableDeclaration;
- }());
- exports.VariableDeclaration = VariableDeclaration;
- var VariableDeclarator = (function () {
- function VariableDeclarator(id, init) {
- this.type = syntax_1.Syntax.VariableDeclarator;
- this.id = id;
- this.init = init;
- }
- return VariableDeclarator;
- }());
- exports.VariableDeclarator = VariableDeclarator;
- var WhileStatement = (function () {
- function WhileStatement(test, body) {
- this.type = syntax_1.Syntax.WhileStatement;
- this.test = test;
- this.body = body;
- }
- return WhileStatement;
- }());
- exports.WhileStatement = WhileStatement;
- var WithStatement = (function () {
- function WithStatement(object, body) {
- this.type = syntax_1.Syntax.WithStatement;
- this.object = object;
- this.body = body;
- }
- return WithStatement;
- }());
- exports.WithStatement = WithStatement;
- var YieldExpression = (function () {
- function YieldExpression(argument, delegate) {
- this.type = syntax_1.Syntax.YieldExpression;
- this.argument = argument;
- this.delegate = delegate;
- }
- return YieldExpression;
- }());
- exports.YieldExpression = YieldExpression;
-
-
-/***/ },
-/* 8 */
-/***/ function(module, exports, __webpack_require__) {
-
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- var assert_1 = __webpack_require__(9);
- var error_handler_1 = __webpack_require__(10);
- var messages_1 = __webpack_require__(11);
- var Node = __webpack_require__(7);
- var scanner_1 = __webpack_require__(12);
- var syntax_1 = __webpack_require__(2);
- var token_1 = __webpack_require__(13);
- var ArrowParameterPlaceHolder = 'ArrowParameterPlaceHolder';
- var Parser = (function () {
- function Parser(code, options, delegate) {
- if (options === void 0) { options = {}; }
- this.config = {
- range: (typeof options.range === 'boolean') && options.range,
- loc: (typeof options.loc === 'boolean') && options.loc,
- source: null,
- tokens: (typeof options.tokens === 'boolean') && options.tokens,
- comment: (typeof options.comment === 'boolean') && options.comment,
- tolerant: (typeof options.tolerant === 'boolean') && options.tolerant
- };
- if (this.config.loc && options.source && options.source !== null) {
- this.config.source = String(options.source);
- }
- this.delegate = delegate;
- this.errorHandler = new error_handler_1.ErrorHandler();
- this.errorHandler.tolerant = this.config.tolerant;
- this.scanner = new scanner_1.Scanner(code, this.errorHandler);
- this.scanner.trackComment = this.config.comment;
- this.operatorPrecedence = {
- ')': 0,
- ';': 0,
- ',': 0,
- '=': 0,
- ']': 0,
- '||': 1,
- '&&': 2,
- '|': 3,
- '^': 4,
- '&': 5,
- '==': 6,
- '!=': 6,
- '===': 6,
- '!==': 6,
- '<': 7,
- '>': 7,
- '<=': 7,
- '>=': 7,
- '<<': 8,
- '>>': 8,
- '>>>': 8,
- '+': 9,
- '-': 9,
- '*': 11,
- '/': 11,
- '%': 11
- };
- this.lookahead = {
- type: 2 /* EOF */,
- value: '',
- lineNumber: this.scanner.lineNumber,
- lineStart: 0,
- start: 0,
- end: 0
- };
- this.hasLineTerminator = false;
- this.context = {
- isModule: false,
- await: false,
- allowIn: true,
- allowStrictDirective: true,
- allowYield: true,
- firstCoverInitializedNameError: null,
- isAssignmentTarget: false,
- isBindingElement: false,
- inFunctionBody: false,
- inIteration: false,
- inSwitch: false,
- labelSet: {},
- strict: false
- };
- this.tokens = [];
- this.startMarker = {
- index: 0,
- line: this.scanner.lineNumber,
- column: 0
- };
- this.lastMarker = {
- index: 0,
- line: this.scanner.lineNumber,
- column: 0
- };
- this.nextToken();
- this.lastMarker = {
- index: this.scanner.index,
- line: this.scanner.lineNumber,
- column: this.scanner.index - this.scanner.lineStart
- };
- }
- Parser.prototype.throwError = function (messageFormat) {
- var values = [];
- for (var _i = 1; _i < arguments.length; _i++) {
- values[_i - 1] = arguments[_i];
- }
- var args = Array.prototype.slice.call(arguments, 1);
- var msg = messageFormat.replace(/%(\d)/g, function (whole, idx) {
- assert_1.assert(idx < args.length, 'Message reference must be in range');
- return args[idx];
- });
- var index = this.lastMarker.index;
- var line = this.lastMarker.line;
- var column = this.lastMarker.column + 1;
- throw this.errorHandler.createError(index, line, column, msg);
- };
- Parser.prototype.tolerateError = function (messageFormat) {
- var values = [];
- for (var _i = 1; _i < arguments.length; _i++) {
- values[_i - 1] = arguments[_i];
- }
- var args = Array.prototype.slice.call(arguments, 1);
- var msg = messageFormat.replace(/%(\d)/g, function (whole, idx) {
- assert_1.assert(idx < args.length, 'Message reference must be in range');
- return args[idx];
- });
- var index = this.lastMarker.index;
- var line = this.scanner.lineNumber;
- var column = this.lastMarker.column + 1;
- this.errorHandler.tolerateError(index, line, column, msg);
- };
- // Throw an exception because of the token.
- Parser.prototype.unexpectedTokenError = function (token, message) {
- var msg = message || messages_1.Messages.UnexpectedToken;
- var value;
- if (token) {
- if (!message) {
- msg = (token.type === 2 /* EOF */) ? messages_1.Messages.UnexpectedEOS :
- (token.type === 3 /* Identifier */) ? messages_1.Messages.UnexpectedIdentifier :
- (token.type === 6 /* NumericLiteral */) ? messages_1.Messages.UnexpectedNumber :
- (token.type === 8 /* StringLiteral */) ? messages_1.Messages.UnexpectedString :
- (token.type === 10 /* Template */) ? messages_1.Messages.UnexpectedTemplate :
- messages_1.Messages.UnexpectedToken;
- if (token.type === 4 /* Keyword */) {
- if (this.scanner.isFutureReservedWord(token.value)) {
- msg = messages_1.Messages.UnexpectedReserved;
- }
- else if (this.context.strict && this.scanner.isStrictModeReservedWord(token.value)) {
- msg = messages_1.Messages.StrictReservedWord;
- }
- }
- }
- value = token.value;
- }
- else {
- value = 'ILLEGAL';
- }
- msg = msg.replace('%0', value);
- if (token && typeof token.lineNumber === 'number') {
- var index = token.start;
- var line = token.lineNumber;
- var lastMarkerLineStart = this.lastMarker.index - this.lastMarker.column;
- var column = token.start - lastMarkerLineStart + 1;
- return this.errorHandler.createError(index, line, column, msg);
- }
- else {
- var index = this.lastMarker.index;
- var line = this.lastMarker.line;
- var column = this.lastMarker.column + 1;
- return this.errorHandler.createError(index, line, column, msg);
- }
- };
- Parser.prototype.throwUnexpectedToken = function (token, message) {
- throw this.unexpectedTokenError(token, message);
- };
- Parser.prototype.tolerateUnexpectedToken = function (token, message) {
- this.errorHandler.tolerate(this.unexpectedTokenError(token, message));
- };
- Parser.prototype.collectComments = function () {
- if (!this.config.comment) {
- this.scanner.scanComments();
- }
- else {
- var comments = this.scanner.scanComments();
- if (comments.length > 0 && this.delegate) {
- for (var i = 0; i < comments.length; ++i) {
- var e = comments[i];
- var node = void 0;
- node = {
- type: e.multiLine ? 'BlockComment' : 'LineComment',
- value: this.scanner.source.slice(e.slice[0], e.slice[1])
- };
- if (this.config.range) {
- node.range = e.range;
- }
- if (this.config.loc) {
- node.loc = e.loc;
- }
- var metadata = {
- start: {
- line: e.loc.start.line,
- column: e.loc.start.column,
- offset: e.range[0]
- },
- end: {
- line: e.loc.end.line,
- column: e.loc.end.column,
- offset: e.range[1]
- }
- };
- this.delegate(node, metadata);
- }
- }
- }
- };
- // From internal representation to an external structure
- Parser.prototype.getTokenRaw = function (token) {
- return this.scanner.source.slice(token.start, token.end);
- };
- Parser.prototype.convertToken = function (token) {
- var t = {
- type: token_1.TokenName[token.type],
- value: this.getTokenRaw(token)
- };
- if (this.config.range) {
- t.range = [token.start, token.end];
- }
- if (this.config.loc) {
- t.loc = {
- start: {
- line: this.startMarker.line,
- column: this.startMarker.column
- },
- end: {
- line: this.scanner.lineNumber,
- column: this.scanner.index - this.scanner.lineStart
- }
- };
- }
- if (token.type === 9 /* RegularExpression */) {
- var pattern = token.pattern;
- var flags = token.flags;
- t.regex = { pattern: pattern, flags: flags };
- }
- return t;
- };
- Parser.prototype.nextToken = function () {
- var token = this.lookahead;
- this.lastMarker.index = this.scanner.index;
- this.lastMarker.line = this.scanner.lineNumber;
- this.lastMarker.column = this.scanner.index - this.scanner.lineStart;
- this.collectComments();
- if (this.scanner.index !== this.startMarker.index) {
- this.startMarker.index = this.scanner.index;
- this.startMarker.line = this.scanner.lineNumber;
- this.startMarker.column = this.scanner.index - this.scanner.lineStart;
- }
- var next = this.scanner.lex();
- this.hasLineTerminator = (token.lineNumber !== next.lineNumber);
- if (next && this.context.strict && next.type === 3 /* Identifier */) {
- if (this.scanner.isStrictModeReservedWord(next.value)) {
- next.type = 4 /* Keyword */;
- }
- }
- this.lookahead = next;
- if (this.config.tokens && next.type !== 2 /* EOF */) {
- this.tokens.push(this.convertToken(next));
- }
- return token;
- };
- Parser.prototype.nextRegexToken = function () {
- this.collectComments();
- var token = this.scanner.scanRegExp();
- if (this.config.tokens) {
- // Pop the previous token, '/' or '/='
- // This is added from the lookahead token.
- this.tokens.pop();
- this.tokens.push(this.convertToken(token));
- }
- // Prime the next lookahead.
- this.lookahead = token;
- this.nextToken();
- return token;
- };
- Parser.prototype.createNode = function () {
- return {
- index: this.startMarker.index,
- line: this.startMarker.line,
- column: this.startMarker.column
- };
- };
- Parser.prototype.startNode = function (token, lastLineStart) {
- if (lastLineStart === void 0) { lastLineStart = 0; }
- var column = token.start - token.lineStart;
- var line = token.lineNumber;
- if (column < 0) {
- column += lastLineStart;
- line--;
- }
- return {
- index: token.start,
- line: line,
- column: column
- };
- };
- Parser.prototype.finalize = function (marker, node) {
- if (this.config.range) {
- node.range = [marker.index, this.lastMarker.index];
- }
- if (this.config.loc) {
- node.loc = {
- start: {
- line: marker.line,
- column: marker.column,
- },
- end: {
- line: this.lastMarker.line,
- column: this.lastMarker.column
- }
- };
- if (this.config.source) {
- node.loc.source = this.config.source;
- }
- }
- if (this.delegate) {
- var metadata = {
- start: {
- line: marker.line,
- column: marker.column,
- offset: marker.index
- },
- end: {
- line: this.lastMarker.line,
- column: this.lastMarker.column,
- offset: this.lastMarker.index
- }
- };
- this.delegate(node, metadata);
- }
- return node;
- };
- // Expect the next token to match the specified punctuator.
- // If not, an exception will be thrown.
- Parser.prototype.expect = function (value) {
- var token = this.nextToken();
- if (token.type !== 7 /* Punctuator */ || token.value !== value) {
- this.throwUnexpectedToken(token);
- }
- };
- // Quietly expect a comma when in tolerant mode, otherwise delegates to expect().
- Parser.prototype.expectCommaSeparator = function () {
- if (this.config.tolerant) {
- var token = this.lookahead;
- if (token.type === 7 /* Punctuator */ && token.value === ',') {
- this.nextToken();
- }
- else if (token.type === 7 /* Punctuator */ && token.value === ';') {
- this.nextToken();
- this.tolerateUnexpectedToken(token);
- }
- else {
- this.tolerateUnexpectedToken(token, messages_1.Messages.UnexpectedToken);
- }
- }
- else {
- this.expect(',');
- }
- };
- // Expect the next token to match the specified keyword.
- // If not, an exception will be thrown.
- Parser.prototype.expectKeyword = function (keyword) {
- var token = this.nextToken();
- if (token.type !== 4 /* Keyword */ || token.value !== keyword) {
- this.throwUnexpectedToken(token);
- }
- };
- // Return true if the next token matches the specified punctuator.
- Parser.prototype.match = function (value) {
- return this.lookahead.type === 7 /* Punctuator */ && this.lookahead.value === value;
- };
- // Return true if the next token matches the specified keyword
- Parser.prototype.matchKeyword = function (keyword) {
- return this.lookahead.type === 4 /* Keyword */ && this.lookahead.value === keyword;
- };
- // Return true if the next token matches the specified contextual keyword
- // (where an identifier is sometimes a keyword depending on the context)
- Parser.prototype.matchContextualKeyword = function (keyword) {
- return this.lookahead.type === 3 /* Identifier */ && this.lookahead.value === keyword;
- };
- // Return true if the next token is an assignment operator
- Parser.prototype.matchAssign = function () {
- if (this.lookahead.type !== 7 /* Punctuator */) {
- return false;
- }
- var op = this.lookahead.value;
- return op === '=' ||
- op === '*=' ||
- op === '**=' ||
- op === '/=' ||
- op === '%=' ||
- op === '+=' ||
- op === '-=' ||
- op === '<<=' ||
- op === '>>=' ||
- op === '>>>=' ||
- op === '&=' ||
- op === '^=' ||
- op === '|=';
- };
- // Cover grammar support.
- //
- // When an assignment expression position starts with an left parenthesis, the determination of the type
- // of the syntax is to be deferred arbitrarily long until the end of the parentheses pair (plus a lookahead)
- // or the first comma. This situation also defers the determination of all the expressions nested in the pair.
- //
- // There are three productions that can be parsed in a parentheses pair that needs to be determined
- // after the outermost pair is closed. They are:
- //
- // 1. AssignmentExpression
- // 2. BindingElements
- // 3. AssignmentTargets
- //
- // In order to avoid exponential backtracking, we use two flags to denote if the production can be
- // binding element or assignment target.
- //
- // The three productions have the relationship:
- //
- // BindingElements ⊆ AssignmentTargets ⊆ AssignmentExpression
- //
- // with a single exception that CoverInitializedName when used directly in an Expression, generates
- // an early error. Therefore, we need the third state, firstCoverInitializedNameError, to track the
- // first usage of CoverInitializedName and report it when we reached the end of the parentheses pair.
- //
- // isolateCoverGrammar function runs the given parser function with a new cover grammar context, and it does not
- // effect the current flags. This means the production the parser parses is only used as an expression. Therefore
- // the CoverInitializedName check is conducted.
- //
- // inheritCoverGrammar function runs the given parse function with a new cover grammar context, and it propagates
- // the flags outside of the parser. This means the production the parser parses is used as a part of a potential
- // pattern. The CoverInitializedName check is deferred.
- Parser.prototype.isolateCoverGrammar = function (parseFunction) {
- var previousIsBindingElement = this.context.isBindingElement;
- var previousIsAssignmentTarget = this.context.isAssignmentTarget;
- var previousFirstCoverInitializedNameError = this.context.firstCoverInitializedNameError;
- this.context.isBindingElement = true;
- this.context.isAssignmentTarget = true;
- this.context.firstCoverInitializedNameError = null;
- var result = parseFunction.call(this);
- if (this.context.firstCoverInitializedNameError !== null) {
- this.throwUnexpectedToken(this.context.firstCoverInitializedNameError);
- }
- this.context.isBindingElement = previousIsBindingElement;
- this.context.isAssignmentTarget = previousIsAssignmentTarget;
- this.context.firstCoverInitializedNameError = previousFirstCoverInitializedNameError;
- return result;
- };
- Parser.prototype.inheritCoverGrammar = function (parseFunction) {
- var previousIsBindingElement = this.context.isBindingElement;
- var previousIsAssignmentTarget = this.context.isAssignmentTarget;
- var previousFirstCoverInitializedNameError = this.context.firstCoverInitializedNameError;
- this.context.isBindingElement = true;
- this.context.isAssignmentTarget = true;
- this.context.firstCoverInitializedNameError = null;
- var result = parseFunction.call(this);
- this.context.isBindingElement = this.context.isBindingElement && previousIsBindingElement;
- this.context.isAssignmentTarget = this.context.isAssignmentTarget && previousIsAssignmentTarget;
- this.context.firstCoverInitializedNameError = previousFirstCoverInitializedNameError || this.context.firstCoverInitializedNameError;
- return result;
- };
- Parser.prototype.consumeSemicolon = function () {
- if (this.match(';')) {
- this.nextToken();
- }
- else if (!this.hasLineTerminator) {
- if (this.lookahead.type !== 2 /* EOF */ && !this.match('}')) {
- this.throwUnexpectedToken(this.lookahead);
- }
- this.lastMarker.index = this.startMarker.index;
- this.lastMarker.line = this.startMarker.line;
- this.lastMarker.column = this.startMarker.column;
- }
- };
- // https://tc39.github.io/ecma262/#sec-primary-expression
- Parser.prototype.parsePrimaryExpression = function () {
- var node = this.createNode();
- var expr;
- var token, raw;
- switch (this.lookahead.type) {
- case 3 /* Identifier */:
- if ((this.context.isModule || this.context.await) && this.lookahead.value === 'await') {
- this.tolerateUnexpectedToken(this.lookahead);
- }
- expr = this.matchAsyncFunction() ? this.parseFunctionExpression() : this.finalize(node, new Node.Identifier(this.nextToken().value));
- break;
- case 6 /* NumericLiteral */:
- case 8 /* StringLiteral */:
- if (this.context.strict && this.lookahead.octal) {
- this.tolerateUnexpectedToken(this.lookahead, messages_1.Messages.StrictOctalLiteral);
- }
- this.context.isAssignmentTarget = false;
- this.context.isBindingElement = false;
- token = this.nextToken();
- raw = this.getTokenRaw(token);
- expr = this.finalize(node, new Node.Literal(token.value, raw));
- break;
- case 1 /* BooleanLiteral */:
- this.context.isAssignmentTarget = false;
- this.context.isBindingElement = false;
- token = this.nextToken();
- raw = this.getTokenRaw(token);
- expr = this.finalize(node, new Node.Literal(token.value === 'true', raw));
- break;
- case 5 /* NullLiteral */:
- this.context.isAssignmentTarget = false;
- this.context.isBindingElement = false;
- token = this.nextToken();
- raw = this.getTokenRaw(token);
- expr = this.finalize(node, new Node.Literal(null, raw));
- break;
- case 10 /* Template */:
- expr = this.parseTemplateLiteral();
- break;
- case 7 /* Punctuator */:
- switch (this.lookahead.value) {
- case '(':
- this.context.isBindingElement = false;
- expr = this.inheritCoverGrammar(this.parseGroupExpression);
- break;
- case '[':
- expr = this.inheritCoverGrammar(this.parseArrayInitializer);
- break;
- case '{':
- expr = this.inheritCoverGrammar(this.parseObjectInitializer);
- break;
- case '/':
- case '/=':
- this.context.isAssignmentTarget = false;
- this.context.isBindingElement = false;
- this.scanner.index = this.startMarker.index;
- token = this.nextRegexToken();
- raw = this.getTokenRaw(token);
- expr = this.finalize(node, new Node.RegexLiteral(token.regex, raw, token.pattern, token.flags));
- break;
- default:
- expr = this.throwUnexpectedToken(this.nextToken());
- }
- break;
- case 4 /* Keyword */:
- if (!this.context.strict && this.context.allowYield && this.matchKeyword('yield')) {
- expr = this.parseIdentifierName();
- }
- else if (!this.context.strict && this.matchKeyword('let')) {
- expr = this.finalize(node, new Node.Identifier(this.nextToken().value));
- }
- else {
- this.context.isAssignmentTarget = false;
- this.context.isBindingElement = false;
- if (this.matchKeyword('function')) {
- expr = this.parseFunctionExpression();
- }
- else if (this.matchKeyword('this')) {
- this.nextToken();
- expr = this.finalize(node, new Node.ThisExpression());
- }
- else if (this.matchKeyword('class')) {
- expr = this.parseClassExpression();
- }
- else {
- expr = this.throwUnexpectedToken(this.nextToken());
- }
- }
- break;
- default:
- expr = this.throwUnexpectedToken(this.nextToken());
- }
- return expr;
- };
- // https://tc39.github.io/ecma262/#sec-array-initializer
- Parser.prototype.parseSpreadElement = function () {
- var node = this.createNode();
- this.expect('...');
- var arg = this.inheritCoverGrammar(this.parseAssignmentExpression);
- return this.finalize(node, new Node.SpreadElement(arg));
- };
- Parser.prototype.parseArrayInitializer = function () {
- var node = this.createNode();
- var elements = [];
- this.expect('[');
- while (!this.match(']')) {
- if (this.match(',')) {
- this.nextToken();
- elements.push(null);
- }
- else if (this.match('...')) {
- var element = this.parseSpreadElement();
- if (!this.match(']')) {
- this.context.isAssignmentTarget = false;
- this.context.isBindingElement = false;
- this.expect(',');
- }
- elements.push(element);
- }
- else {
- elements.push(this.inheritCoverGrammar(this.parseAssignmentExpression));
- if (!this.match(']')) {
- this.expect(',');
- }
- }
- }
- this.expect(']');
- return this.finalize(node, new Node.ArrayExpression(elements));
- };
- // https://tc39.github.io/ecma262/#sec-object-initializer
- Parser.prototype.parsePropertyMethod = function (params) {
- this.context.isAssignmentTarget = false;
- this.context.isBindingElement = false;
- var previousStrict = this.context.strict;
- var previousAllowStrictDirective = this.context.allowStrictDirective;
- this.context.allowStrictDirective = params.simple;
- var body = this.isolateCoverGrammar(this.parseFunctionSourceElements);
- if (this.context.strict && params.firstRestricted) {
- this.tolerateUnexpectedToken(params.firstRestricted, params.message);
- }
- if (this.context.strict && params.stricted) {
- this.tolerateUnexpectedToken(params.stricted, params.message);
- }
- this.context.strict = previousStrict;
- this.context.allowStrictDirective = previousAllowStrictDirective;
- return body;
- };
- Parser.prototype.parsePropertyMethodFunction = function () {
- var isGenerator = false;
- var node = this.createNode();
- var previousAllowYield = this.context.allowYield;
- this.context.allowYield = true;
- var params = this.parseFormalParameters();
- var method = this.parsePropertyMethod(params);
- this.context.allowYield = previousAllowYield;
- return this.finalize(node, new Node.FunctionExpression(null, params.params, method, isGenerator));
- };
- Parser.prototype.parsePropertyMethodAsyncFunction = function () {
- var node = this.createNode();
- var previousAllowYield = this.context.allowYield;
- var previousAwait = this.context.await;
- this.context.allowYield = false;
- this.context.await = true;
- var params = this.parseFormalParameters();
- var method = this.parsePropertyMethod(params);
- this.context.allowYield = previousAllowYield;
- this.context.await = previousAwait;
- return this.finalize(node, new Node.AsyncFunctionExpression(null, params.params, method));
- };
- Parser.prototype.parseObjectPropertyKey = function () {
- var node = this.createNode();
- var token = this.nextToken();
- var key;
- switch (token.type) {
- case 8 /* StringLiteral */:
- case 6 /* NumericLiteral */:
- if (this.context.strict && token.octal) {
- this.tolerateUnexpectedToken(token, messages_1.Messages.StrictOctalLiteral);
- }
- var raw = this.getTokenRaw(token);
- key = this.finalize(node, new Node.Literal(token.value, raw));
- break;
- case 3 /* Identifier */:
- case 1 /* BooleanLiteral */:
- case 5 /* NullLiteral */:
- case 4 /* Keyword */:
- key = this.finalize(node, new Node.Identifier(token.value));
- break;
- case 7 /* Punctuator */:
- if (token.value === '[') {
- key = this.isolateCoverGrammar(this.parseAssignmentExpression);
- this.expect(']');
- }
- else {
- key = this.throwUnexpectedToken(token);
- }
- break;
- default:
- key = this.throwUnexpectedToken(token);
- }
- return key;
- };
- Parser.prototype.isPropertyKey = function (key, value) {
- return (key.type === syntax_1.Syntax.Identifier && key.name === value) ||
- (key.type === syntax_1.Syntax.Literal && key.value === value);
- };
- Parser.prototype.parseObjectProperty = function (hasProto) {
- var node = this.createNode();
- var token = this.lookahead;
- var kind;
- var key = null;
- var value = null;
- var computed = false;
- var method = false;
- var shorthand = false;
- var isAsync = false;
- if (token.type === 3 /* Identifier */) {
- var id = token.value;
- this.nextToken();
- computed = this.match('[');
- isAsync = !this.hasLineTerminator && (id === 'async') &&
- !this.match(':') && !this.match('(') && !this.match('*') && !this.match(',');
- key = isAsync ? this.parseObjectPropertyKey() : this.finalize(node, new Node.Identifier(id));
- }
- else if (this.match('*')) {
- this.nextToken();
- }
- else {
- computed = this.match('[');
- key = this.parseObjectPropertyKey();
- }
- var lookaheadPropertyKey = this.qualifiedPropertyName(this.lookahead);
- if (token.type === 3 /* Identifier */ && !isAsync && token.value === 'get' && lookaheadPropertyKey) {
- kind = 'get';
- computed = this.match('[');
- key = this.parseObjectPropertyKey();
- this.context.allowYield = false;
- value = this.parseGetterMethod();
- }
- else if (token.type === 3 /* Identifier */ && !isAsync && token.value === 'set' && lookaheadPropertyKey) {
- kind = 'set';
- computed = this.match('[');
- key = this.parseObjectPropertyKey();
- value = this.parseSetterMethod();
- }
- else if (token.type === 7 /* Punctuator */ && token.value === '*' && lookaheadPropertyKey) {
- kind = 'init';
- computed = this.match('[');
- key = this.parseObjectPropertyKey();
- value = this.parseGeneratorMethod();
- method = true;
- }
- else {
- if (!key) {
- this.throwUnexpectedToken(this.lookahead);
- }
- kind = 'init';
- if (this.match(':') && !isAsync) {
- if (!computed && this.isPropertyKey(key, '__proto__')) {
- if (hasProto.value) {
- this.tolerateError(messages_1.Messages.DuplicateProtoProperty);
- }
- hasProto.value = true;
- }
- this.nextToken();
- value = this.inheritCoverGrammar(this.parseAssignmentExpression);
- }
- else if (this.match('(')) {
- value = isAsync ? this.parsePropertyMethodAsyncFunction() : this.parsePropertyMethodFunction();
- method = true;
- }
- else if (token.type === 3 /* Identifier */) {
- var id = this.finalize(node, new Node.Identifier(token.value));
- if (this.match('=')) {
- this.context.firstCoverInitializedNameError = this.lookahead;
- this.nextToken();
- shorthand = true;
- var init = this.isolateCoverGrammar(this.parseAssignmentExpression);
- value = this.finalize(node, new Node.AssignmentPattern(id, init));
- }
- else {
- shorthand = true;
- value = id;
- }
- }
- else {
- this.throwUnexpectedToken(this.nextToken());
- }
- }
- return this.finalize(node, new Node.Property(kind, key, computed, value, method, shorthand));
- };
- Parser.prototype.parseObjectInitializer = function () {
- var node = this.createNode();
- this.expect('{');
- var properties = [];
- var hasProto = { value: false };
- while (!this.match('}')) {
- properties.push(this.parseObjectProperty(hasProto));
- if (!this.match('}')) {
- this.expectCommaSeparator();
- }
- }
- this.expect('}');
- return this.finalize(node, new Node.ObjectExpression(properties));
- };
- // https://tc39.github.io/ecma262/#sec-template-literals
- Parser.prototype.parseTemplateHead = function () {
- assert_1.assert(this.lookahead.head, 'Template literal must start with a template head');
- var node = this.createNode();
- var token = this.nextToken();
- var raw = token.value;
- var cooked = token.cooked;
- return this.finalize(node, new Node.TemplateElement({ raw: raw, cooked: cooked }, token.tail));
- };
- Parser.prototype.parseTemplateElement = function () {
- if (this.lookahead.type !== 10 /* Template */) {
- this.throwUnexpectedToken();
- }
- var node = this.createNode();
- var token = this.nextToken();
- var raw = token.value;
- var cooked = token.cooked;
- return this.finalize(node, new Node.TemplateElement({ raw: raw, cooked: cooked }, token.tail));
- };
- Parser.prototype.parseTemplateLiteral = function () {
- var node = this.createNode();
- var expressions = [];
- var quasis = [];
- var quasi = this.parseTemplateHead();
- quasis.push(quasi);
- while (!quasi.tail) {
- expressions.push(this.parseExpression());
- quasi = this.parseTemplateElement();
- quasis.push(quasi);
- }
- return this.finalize(node, new Node.TemplateLiteral(quasis, expressions));
- };
- // https://tc39.github.io/ecma262/#sec-grouping-operator
- Parser.prototype.reinterpretExpressionAsPattern = function (expr) {
- switch (expr.type) {
- case syntax_1.Syntax.Identifier:
- case syntax_1.Syntax.MemberExpression:
- case syntax_1.Syntax.RestElement:
- case syntax_1.Syntax.AssignmentPattern:
- break;
- case syntax_1.Syntax.SpreadElement:
- expr.type = syntax_1.Syntax.RestElement;
- this.reinterpretExpressionAsPattern(expr.argument);
- break;
- case syntax_1.Syntax.ArrayExpression:
- expr.type = syntax_1.Syntax.ArrayPattern;
- for (var i = 0; i < expr.elements.length; i++) {
- if (expr.elements[i] !== null) {
- this.reinterpretExpressionAsPattern(expr.elements[i]);
- }
- }
- break;
- case syntax_1.Syntax.ObjectExpression:
- expr.type = syntax_1.Syntax.ObjectPattern;
- for (var i = 0; i < expr.properties.length; i++) {
- this.reinterpretExpressionAsPattern(expr.properties[i].value);
- }
- break;
- case syntax_1.Syntax.AssignmentExpression:
- expr.type = syntax_1.Syntax.AssignmentPattern;
- delete expr.operator;
- this.reinterpretExpressionAsPattern(expr.left);
- break;
- default:
- // Allow other node type for tolerant parsing.
- break;
- }
- };
- Parser.prototype.parseGroupExpression = function () {
- var expr;
- this.expect('(');
- if (this.match(')')) {
- this.nextToken();
- if (!this.match('=>')) {
- this.expect('=>');
- }
- expr = {
- type: ArrowParameterPlaceHolder,
- params: [],
- async: false
- };
- }
- else {
- var startToken = this.lookahead;
- var params = [];
- if (this.match('...')) {
- expr = this.parseRestElement(params);
- this.expect(')');
- if (!this.match('=>')) {
- this.expect('=>');
- }
- expr = {
- type: ArrowParameterPlaceHolder,
- params: [expr],
- async: false
- };
- }
- else {
- var arrow = false;
- this.context.isBindingElement = true;
- expr = this.inheritCoverGrammar(this.parseAssignmentExpression);
- if (this.match(',')) {
- var expressions = [];
- this.context.isAssignmentTarget = false;
- expressions.push(expr);
- while (this.lookahead.type !== 2 /* EOF */) {
- if (!this.match(',')) {
- break;
- }
- this.nextToken();
- if (this.match(')')) {
- this.nextToken();
- for (var i = 0; i < expressions.length; i++) {
- this.reinterpretExpressionAsPattern(expressions[i]);
- }
- arrow = true;
- expr = {
- type: ArrowParameterPlaceHolder,
- params: expressions,
- async: false
- };
- }
- else if (this.match('...')) {
- if (!this.context.isBindingElement) {
- this.throwUnexpectedToken(this.lookahead);
- }
- expressions.push(this.parseRestElement(params));
- this.expect(')');
- if (!this.match('=>')) {
- this.expect('=>');
- }
- this.context.isBindingElement = false;
- for (var i = 0; i < expressions.length; i++) {
- this.reinterpretExpressionAsPattern(expressions[i]);
- }
- arrow = true;
- expr = {
- type: ArrowParameterPlaceHolder,
- params: expressions,
- async: false
- };
- }
- else {
- expressions.push(this.inheritCoverGrammar(this.parseAssignmentExpression));
- }
- if (arrow) {
- break;
- }
- }
- if (!arrow) {
- expr = this.finalize(this.startNode(startToken), new Node.SequenceExpression(expressions));
- }
- }
- if (!arrow) {
- this.expect(')');
- if (this.match('=>')) {
- if (expr.type === syntax_1.Syntax.Identifier && expr.name === 'yield') {
- arrow = true;
- expr = {
- type: ArrowParameterPlaceHolder,
- params: [expr],
- async: false
- };
- }
- if (!arrow) {
- if (!this.context.isBindingElement) {
- this.throwUnexpectedToken(this.lookahead);
- }
- if (expr.type === syntax_1.Syntax.SequenceExpression) {
- for (var i = 0; i < expr.expressions.length; i++) {
- this.reinterpretExpressionAsPattern(expr.expressions[i]);
- }
- }
- else {
- this.reinterpretExpressionAsPattern(expr);
- }
- var parameters = (expr.type === syntax_1.Syntax.SequenceExpression ? expr.expressions : [expr]);
- expr = {
- type: ArrowParameterPlaceHolder,
- params: parameters,
- async: false
- };
- }
- }
- this.context.isBindingElement = false;
- }
- }
- }
- return expr;
- };
- // https://tc39.github.io/ecma262/#sec-left-hand-side-expressions
- Parser.prototype.parseArguments = function () {
- this.expect('(');
- var args = [];
- if (!this.match(')')) {
- while (true) {
- var expr = this.match('...') ? this.parseSpreadElement() :
- this.isolateCoverGrammar(this.parseAssignmentExpression);
- args.push(expr);
- if (this.match(')')) {
- break;
- }
- this.expectCommaSeparator();
- if (this.match(')')) {
- break;
- }
- }
- }
- this.expect(')');
- return args;
- };
- Parser.prototype.isIdentifierName = function (token) {
- return token.type === 3 /* Identifier */ ||
- token.type === 4 /* Keyword */ ||
- token.type === 1 /* BooleanLiteral */ ||
- token.type === 5 /* NullLiteral */;
- };
- Parser.prototype.parseIdentifierName = function () {
- var node = this.createNode();
- var token = this.nextToken();
- if (!this.isIdentifierName(token)) {
- this.throwUnexpectedToken(token);
- }
- return this.finalize(node, new Node.Identifier(token.value));
- };
- Parser.prototype.parseNewExpression = function () {
- var node = this.createNode();
- var id = this.parseIdentifierName();
- assert_1.assert(id.name === 'new', 'New expression must start with `new`');
- var expr;
- if (this.match('.')) {
- this.nextToken();
- if (this.lookahead.type === 3 /* Identifier */ && this.context.inFunctionBody && this.lookahead.value === 'target') {
- var property = this.parseIdentifierName();
- expr = new Node.MetaProperty(id, property);
- }
- else {
- this.throwUnexpectedToken(this.lookahead);
- }
- }
- else {
- var callee = this.isolateCoverGrammar(this.parseLeftHandSideExpression);
- var args = this.match('(') ? this.parseArguments() : [];
- expr = new Node.NewExpression(callee, args);
- this.context.isAssignmentTarget = false;
- this.context.isBindingElement = false;
- }
- return this.finalize(node, expr);
- };
- Parser.prototype.parseAsyncArgument = function () {
- var arg = this.parseAssignmentExpression();
- this.context.firstCoverInitializedNameError = null;
- return arg;
- };
- Parser.prototype.parseAsyncArguments = function () {
- this.expect('(');
- var args = [];
- if (!this.match(')')) {
- while (true) {
- var expr = this.match('...') ? this.parseSpreadElement() :
- this.isolateCoverGrammar(this.parseAsyncArgument);
- args.push(expr);
- if (this.match(')')) {
- break;
- }
- this.expectCommaSeparator();
- if (this.match(')')) {
- break;
- }
- }
- }
- this.expect(')');
- return args;
- };
- Parser.prototype.parseLeftHandSideExpressionAllowCall = function () {
- var startToken = this.lookahead;
- var maybeAsync = this.matchContextualKeyword('async');
- var previousAllowIn = this.context.allowIn;
- this.context.allowIn = true;
- var expr;
- if (this.matchKeyword('super') && this.context.inFunctionBody) {
- expr = this.createNode();
- this.nextToken();
- expr = this.finalize(expr, new Node.Super());
- if (!this.match('(') && !this.match('.') && !this.match('[')) {
- this.throwUnexpectedToken(this.lookahead);
- }
- }
- else {
- expr = this.inheritCoverGrammar(this.matchKeyword('new') ? this.parseNewExpression : this.parsePrimaryExpression);
- }
- while (true) {
- if (this.match('.')) {
- this.context.isBindingElement = false;
- this.context.isAssignmentTarget = true;
- this.expect('.');
- var property = this.parseIdentifierName();
- expr = this.finalize(this.startNode(startToken), new Node.StaticMemberExpression(expr, property));
- }
- else if (this.match('(')) {
- var asyncArrow = maybeAsync && (startToken.lineNumber === this.lookahead.lineNumber);
- this.context.isBindingElement = false;
- this.context.isAssignmentTarget = false;
- var args = asyncArrow ? this.parseAsyncArguments() : this.parseArguments();
- expr = this.finalize(this.startNode(startToken), new Node.CallExpression(expr, args));
- if (asyncArrow && this.match('=>')) {
- for (var i = 0; i < args.length; ++i) {
- this.reinterpretExpressionAsPattern(args[i]);
- }
- expr = {
- type: ArrowParameterPlaceHolder,
- params: args,
- async: true
- };
- }
- }
- else if (this.match('[')) {
- this.context.isBindingElement = false;
- this.context.isAssignmentTarget = true;
- this.expect('[');
- var property = this.isolateCoverGrammar(this.parseExpression);
- this.expect(']');
- expr = this.finalize(this.startNode(startToken), new Node.ComputedMemberExpression(expr, property));
- }
- else if (this.lookahead.type === 10 /* Template */ && this.lookahead.head) {
- var quasi = this.parseTemplateLiteral();
- expr = this.finalize(this.startNode(startToken), new Node.TaggedTemplateExpression(expr, quasi));
- }
- else {
- break;
- }
- }
- this.context.allowIn = previousAllowIn;
- return expr;
- };
- Parser.prototype.parseSuper = function () {
- var node = this.createNode();
- this.expectKeyword('super');
- if (!this.match('[') && !this.match('.')) {
- this.throwUnexpectedToken(this.lookahead);
- }
- return this.finalize(node, new Node.Super());
- };
- Parser.prototype.parseLeftHandSideExpression = function () {
- assert_1.assert(this.context.allowIn, 'callee of new expression always allow in keyword.');
- var node = this.startNode(this.lookahead);
- var expr = (this.matchKeyword('super') && this.context.inFunctionBody) ? this.parseSuper() :
- this.inheritCoverGrammar(this.matchKeyword('new') ? this.parseNewExpression : this.parsePrimaryExpression);
- while (true) {
- if (this.match('[')) {
- this.context.isBindingElement = false;
- this.context.isAssignmentTarget = true;
- this.expect('[');
- var property = this.isolateCoverGrammar(this.parseExpression);
- this.expect(']');
- expr = this.finalize(node, new Node.ComputedMemberExpression(expr, property));
- }
- else if (this.match('.')) {
- this.context.isBindingElement = false;
- this.context.isAssignmentTarget = true;
- this.expect('.');
- var property = this.parseIdentifierName();
- expr = this.finalize(node, new Node.StaticMemberExpression(expr, property));
- }
- else if (this.lookahead.type === 10 /* Template */ && this.lookahead.head) {
- var quasi = this.parseTemplateLiteral();
- expr = this.finalize(node, new Node.TaggedTemplateExpression(expr, quasi));
- }
- else {
- break;
- }
- }
- return expr;
- };
- // https://tc39.github.io/ecma262/#sec-update-expressions
- Parser.prototype.parseUpdateExpression = function () {
- var expr;
- var startToken = this.lookahead;
- if (this.match('++') || this.match('--')) {
- var node = this.startNode(startToken);
- var token = this.nextToken();
- expr = this.inheritCoverGrammar(this.parseUnaryExpression);
- if (this.context.strict && expr.type === syntax_1.Syntax.Identifier && this.scanner.isRestrictedWord(expr.name)) {
- this.tolerateError(messages_1.Messages.StrictLHSPrefix);
- }
- if (!this.context.isAssignmentTarget) {
- this.tolerateError(messages_1.Messages.InvalidLHSInAssignment);
- }
- var prefix = true;
- expr = this.finalize(node, new Node.UpdateExpression(token.value, expr, prefix));
- this.context.isAssignmentTarget = false;
- this.context.isBindingElement = false;
- }
- else {
- expr = this.inheritCoverGrammar(this.parseLeftHandSideExpressionAllowCall);
- if (!this.hasLineTerminator && this.lookahead.type === 7 /* Punctuator */) {
- if (this.match('++') || this.match('--')) {
- if (this.context.strict && expr.type === syntax_1.Syntax.Identifier && this.scanner.isRestrictedWord(expr.name)) {
- this.tolerateError(messages_1.Messages.StrictLHSPostfix);
- }
- if (!this.context.isAssignmentTarget) {
- this.tolerateError(messages_1.Messages.InvalidLHSInAssignment);
- }
- this.context.isAssignmentTarget = false;
- this.context.isBindingElement = false;
- var operator = this.nextToken().value;
- var prefix = false;
- expr = this.finalize(this.startNode(startToken), new Node.UpdateExpression(operator, expr, prefix));
- }
- }
- }
- return expr;
- };
- // https://tc39.github.io/ecma262/#sec-unary-operators
- Parser.prototype.parseAwaitExpression = function () {
- var node = this.createNode();
- this.nextToken();
- var argument = this.parseUnaryExpression();
- return this.finalize(node, new Node.AwaitExpression(argument));
- };
- Parser.prototype.parseUnaryExpression = function () {
- var expr;
- if (this.match('+') || this.match('-') || this.match('~') || this.match('!') ||
- this.matchKeyword('delete') || this.matchKeyword('void') || this.matchKeyword('typeof')) {
- var node = this.startNode(this.lookahead);
- var token = this.nextToken();
- expr = this.inheritCoverGrammar(this.parseUnaryExpression);
- expr = this.finalize(node, new Node.UnaryExpression(token.value, expr));
- if (this.context.strict && expr.operator === 'delete' && expr.argument.type === syntax_1.Syntax.Identifier) {
- this.tolerateError(messages_1.Messages.StrictDelete);
- }
- this.context.isAssignmentTarget = false;
- this.context.isBindingElement = false;
- }
- else if (this.context.await && this.matchContextualKeyword('await')) {
- expr = this.parseAwaitExpression();
- }
- else {
- expr = this.parseUpdateExpression();
- }
- return expr;
- };
- Parser.prototype.parseExponentiationExpression = function () {
- var startToken = this.lookahead;
- var expr = this.inheritCoverGrammar(this.parseUnaryExpression);
- if (expr.type !== syntax_1.Syntax.UnaryExpression && this.match('**')) {
- this.nextToken();
- this.context.isAssignmentTarget = false;
- this.context.isBindingElement = false;
- var left = expr;
- var right = this.isolateCoverGrammar(this.parseExponentiationExpression);
- expr = this.finalize(this.startNode(startToken), new Node.BinaryExpression('**', left, right));
- }
- return expr;
- };
- // https://tc39.github.io/ecma262/#sec-exp-operator
- // https://tc39.github.io/ecma262/#sec-multiplicative-operators
- // https://tc39.github.io/ecma262/#sec-additive-operators
- // https://tc39.github.io/ecma262/#sec-bitwise-shift-operators
- // https://tc39.github.io/ecma262/#sec-relational-operators
- // https://tc39.github.io/ecma262/#sec-equality-operators
- // https://tc39.github.io/ecma262/#sec-binary-bitwise-operators
- // https://tc39.github.io/ecma262/#sec-binary-logical-operators
- Parser.prototype.binaryPrecedence = function (token) {
- var op = token.value;
- var precedence;
- if (token.type === 7 /* Punctuator */) {
- precedence = this.operatorPrecedence[op] || 0;
- }
- else if (token.type === 4 /* Keyword */) {
- precedence = (op === 'instanceof' || (this.context.allowIn && op === 'in')) ? 7 : 0;
- }
- else {
- precedence = 0;
- }
- return precedence;
- };
- Parser.prototype.parseBinaryExpression = function () {
- var startToken = this.lookahead;
- var expr = this.inheritCoverGrammar(this.parseExponentiationExpression);
- var token = this.lookahead;
- var prec = this.binaryPrecedence(token);
- if (prec > 0) {
- this.nextToken();
- this.context.isAssignmentTarget = false;
- this.context.isBindingElement = false;
- var markers = [startToken, this.lookahead];
- var left = expr;
- var right = this.isolateCoverGrammar(this.parseExponentiationExpression);
- var stack = [left, token.value, right];
- var precedences = [prec];
- while (true) {
- prec = this.binaryPrecedence(this.lookahead);
- if (prec <= 0) {
- break;
- }
- // Reduce: make a binary expression from the three topmost entries.
- while ((stack.length > 2) && (prec <= precedences[precedences.length - 1])) {
- right = stack.pop();
- var operator = stack.pop();
- precedences.pop();
- left = stack.pop();
- markers.pop();
- var node = this.startNode(markers[markers.length - 1]);
- stack.push(this.finalize(node, new Node.BinaryExpression(operator, left, right)));
- }
- // Shift.
- stack.push(this.nextToken().value);
- precedences.push(prec);
- markers.push(this.lookahead);
- stack.push(this.isolateCoverGrammar(this.parseExponentiationExpression));
- }
- // Final reduce to clean-up the stack.
- var i = stack.length - 1;
- expr = stack[i];
- var lastMarker = markers.pop();
- while (i > 1) {
- var marker = markers.pop();
- var lastLineStart = lastMarker && lastMarker.lineStart;
- var node = this.startNode(marker, lastLineStart);
- var operator = stack[i - 1];
- expr = this.finalize(node, new Node.BinaryExpression(operator, stack[i - 2], expr));
- i -= 2;
- lastMarker = marker;
- }
- }
- return expr;
- };
- // https://tc39.github.io/ecma262/#sec-conditional-operator
- Parser.prototype.parseConditionalExpression = function () {
- var startToken = this.lookahead;
- var expr = this.inheritCoverGrammar(this.parseBinaryExpression);
- if (this.match('?')) {
- this.nextToken();
- var previousAllowIn = this.context.allowIn;
- this.context.allowIn = true;
- var consequent = this.isolateCoverGrammar(this.parseAssignmentExpression);
- this.context.allowIn = previousAllowIn;
- this.expect(':');
- var alternate = this.isolateCoverGrammar(this.parseAssignmentExpression);
- expr = this.finalize(this.startNode(startToken), new Node.ConditionalExpression(expr, consequent, alternate));
- this.context.isAssignmentTarget = false;
- this.context.isBindingElement = false;
- }
- return expr;
- };
- // https://tc39.github.io/ecma262/#sec-assignment-operators
- Parser.prototype.checkPatternParam = function (options, param) {
- switch (param.type) {
- case syntax_1.Syntax.Identifier:
- this.validateParam(options, param, param.name);
- break;
- case syntax_1.Syntax.RestElement:
- this.checkPatternParam(options, param.argument);
- break;
- case syntax_1.Syntax.AssignmentPattern:
- this.checkPatternParam(options, param.left);
- break;
- case syntax_1.Syntax.ArrayPattern:
- for (var i = 0; i < param.elements.length; i++) {
- if (param.elements[i] !== null) {
- this.checkPatternParam(options, param.elements[i]);
- }
- }
- break;
- case syntax_1.Syntax.ObjectPattern:
- for (var i = 0; i < param.properties.length; i++) {
- this.checkPatternParam(options, param.properties[i].value);
- }
- break;
- default:
- break;
- }
- options.simple = options.simple && (param instanceof Node.Identifier);
- };
- Parser.prototype.reinterpretAsCoverFormalsList = function (expr) {
- var params = [expr];
- var options;
- var asyncArrow = false;
- switch (expr.type) {
- case syntax_1.Syntax.Identifier:
- break;
- case ArrowParameterPlaceHolder:
- params = expr.params;
- asyncArrow = expr.async;
- break;
- default:
- return null;
- }
- options = {
- simple: true,
- paramSet: {}
- };
- for (var i = 0; i < params.length; ++i) {
- var param = params[i];
- if (param.type === syntax_1.Syntax.AssignmentPattern) {
- if (param.right.type === syntax_1.Syntax.YieldExpression) {
- if (param.right.argument) {
- this.throwUnexpectedToken(this.lookahead);
- }
- param.right.type = syntax_1.Syntax.Identifier;
- param.right.name = 'yield';
- delete param.right.argument;
- delete param.right.delegate;
- }
- }
- else if (asyncArrow && param.type === syntax_1.Syntax.Identifier && param.name === 'await') {
- this.throwUnexpectedToken(this.lookahead);
- }
- this.checkPatternParam(options, param);
- params[i] = param;
- }
- if (this.context.strict || !this.context.allowYield) {
- for (var i = 0; i < params.length; ++i) {
- var param = params[i];
- if (param.type === syntax_1.Syntax.YieldExpression) {
- this.throwUnexpectedToken(this.lookahead);
- }
- }
- }
- if (options.message === messages_1.Messages.StrictParamDupe) {
- var token = this.context.strict ? options.stricted : options.firstRestricted;
- this.throwUnexpectedToken(token, options.message);
- }
- return {
- simple: options.simple,
- params: params,
- stricted: options.stricted,
- firstRestricted: options.firstRestricted,
- message: options.message
- };
- };
- Parser.prototype.parseAssignmentExpression = function () {
- var expr;
- if (!this.context.allowYield && this.matchKeyword('yield')) {
- expr = this.parseYieldExpression();
- }
- else {
- var startToken = this.lookahead;
- var token = startToken;
- expr = this.parseConditionalExpression();
- if (token.type === 3 /* Identifier */ && (token.lineNumber === this.lookahead.lineNumber) && token.value === 'async') {
- if (this.lookahead.type === 3 /* Identifier */ || this.matchKeyword('yield')) {
- var arg = this.parsePrimaryExpression();
- this.reinterpretExpressionAsPattern(arg);
- expr = {
- type: ArrowParameterPlaceHolder,
- params: [arg],
- async: true
- };
- }
- }
- if (expr.type === ArrowParameterPlaceHolder || this.match('=>')) {
- // https://tc39.github.io/ecma262/#sec-arrow-function-definitions
- this.context.isAssignmentTarget = false;
- this.context.isBindingElement = false;
- var isAsync = expr.async;
- var list = this.reinterpretAsCoverFormalsList(expr);
- if (list) {
- if (this.hasLineTerminator) {
- this.tolerateUnexpectedToken(this.lookahead);
- }
- this.context.firstCoverInitializedNameError = null;
- var previousStrict = this.context.strict;
- var previousAllowStrictDirective = this.context.allowStrictDirective;
- this.context.allowStrictDirective = list.simple;
- var previousAllowYield = this.context.allowYield;
- var previousAwait = this.context.await;
- this.context.allowYield = true;
- this.context.await = isAsync;
- var node = this.startNode(startToken);
- this.expect('=>');
- var body = void 0;
- if (this.match('{')) {
- var previousAllowIn = this.context.allowIn;
- this.context.allowIn = true;
- body = this.parseFunctionSourceElements();
- this.context.allowIn = previousAllowIn;
- }
- else {
- body = this.isolateCoverGrammar(this.parseAssignmentExpression);
- }
- var expression = body.type !== syntax_1.Syntax.BlockStatement;
- if (this.context.strict && list.firstRestricted) {
- this.throwUnexpectedToken(list.firstRestricted, list.message);
- }
- if (this.context.strict && list.stricted) {
- this.tolerateUnexpectedToken(list.stricted, list.message);
- }
- expr = isAsync ? this.finalize(node, new Node.AsyncArrowFunctionExpression(list.params, body, expression)) :
- this.finalize(node, new Node.ArrowFunctionExpression(list.params, body, expression));
- this.context.strict = previousStrict;
- this.context.allowStrictDirective = previousAllowStrictDirective;
- this.context.allowYield = previousAllowYield;
- this.context.await = previousAwait;
- }
- }
- else {
- if (this.matchAssign()) {
- if (!this.context.isAssignmentTarget) {
- this.tolerateError(messages_1.Messages.InvalidLHSInAssignment);
- }
- if (this.context.strict && expr.type === syntax_1.Syntax.Identifier) {
- var id = expr;
- if (this.scanner.isRestrictedWord(id.name)) {
- this.tolerateUnexpectedToken(token, messages_1.Messages.StrictLHSAssignment);
- }
- if (this.scanner.isStrictModeReservedWord(id.name)) {
- this.tolerateUnexpectedToken(token, messages_1.Messages.StrictReservedWord);
- }
- }
- if (!this.match('=')) {
- this.context.isAssignmentTarget = false;
- this.context.isBindingElement = false;
- }
- else {
- this.reinterpretExpressionAsPattern(expr);
- }
- token = this.nextToken();
- var operator = token.value;
- var right = this.isolateCoverGrammar(this.parseAssignmentExpression);
- expr = this.finalize(this.startNode(startToken), new Node.AssignmentExpression(operator, expr, right));
- this.context.firstCoverInitializedNameError = null;
- }
- }
- }
- return expr;
- };
- // https://tc39.github.io/ecma262/#sec-comma-operator
- Parser.prototype.parseExpression = function () {
- var startToken = this.lookahead;
- var expr = this.isolateCoverGrammar(this.parseAssignmentExpression);
- if (this.match(',')) {
- var expressions = [];
- expressions.push(expr);
- while (this.lookahead.type !== 2 /* EOF */) {
- if (!this.match(',')) {
- break;
- }
- this.nextToken();
- expressions.push(this.isolateCoverGrammar(this.parseAssignmentExpression));
- }
- expr = this.finalize(this.startNode(startToken), new Node.SequenceExpression(expressions));
- }
- return expr;
- };
- // https://tc39.github.io/ecma262/#sec-block
- Parser.prototype.parseStatementListItem = function () {
- var statement;
- this.context.isAssignmentTarget = true;
- this.context.isBindingElement = true;
- if (this.lookahead.type === 4 /* Keyword */) {
- switch (this.lookahead.value) {
- case 'export':
- if (!this.context.isModule) {
- this.tolerateUnexpectedToken(this.lookahead, messages_1.Messages.IllegalExportDeclaration);
- }
- statement = this.parseExportDeclaration();
- break;
- case 'import':
- if (!this.context.isModule) {
- this.tolerateUnexpectedToken(this.lookahead, messages_1.Messages.IllegalImportDeclaration);
- }
- statement = this.parseImportDeclaration();
- break;
- case 'const':
- statement = this.parseLexicalDeclaration({ inFor: false });
- break;
- case 'function':
- statement = this.parseFunctionDeclaration();
- break;
- case 'class':
- statement = this.parseClassDeclaration();
- break;
- case 'let':
- statement = this.isLexicalDeclaration() ? this.parseLexicalDeclaration({ inFor: false }) : this.parseStatement();
- break;
- default:
- statement = this.parseStatement();
- break;
- }
- }
- else {
- statement = this.parseStatement();
- }
- return statement;
- };
- Parser.prototype.parseBlock = function () {
- var node = this.createNode();
- this.expect('{');
- var block = [];
- while (true) {
- if (this.match('}')) {
- break;
- }
- block.push(this.parseStatementListItem());
- }
- this.expect('}');
- return this.finalize(node, new Node.BlockStatement(block));
- };
- // https://tc39.github.io/ecma262/#sec-let-and-const-declarations
- Parser.prototype.parseLexicalBinding = function (kind, options) {
- var node = this.createNode();
- var params = [];
- var id = this.parsePattern(params, kind);
- if (this.context.strict && id.type === syntax_1.Syntax.Identifier) {
- if (this.scanner.isRestrictedWord(id.name)) {
- this.tolerateError(messages_1.Messages.StrictVarName);
- }
- }
- var init = null;
- if (kind === 'const') {
- if (!this.matchKeyword('in') && !this.matchContextualKeyword('of')) {
- if (this.match('=')) {
- this.nextToken();
- init = this.isolateCoverGrammar(this.parseAssignmentExpression);
- }
- else {
- this.throwError(messages_1.Messages.DeclarationMissingInitializer, 'const');
- }
- }
- }
- else if ((!options.inFor && id.type !== syntax_1.Syntax.Identifier) || this.match('=')) {
- this.expect('=');
- init = this.isolateCoverGrammar(this.parseAssignmentExpression);
- }
- return this.finalize(node, new Node.VariableDeclarator(id, init));
- };
- Parser.prototype.parseBindingList = function (kind, options) {
- var list = [this.parseLexicalBinding(kind, options)];
- while (this.match(',')) {
- this.nextToken();
- list.push(this.parseLexicalBinding(kind, options));
- }
- return list;
- };
- Parser.prototype.isLexicalDeclaration = function () {
- var state = this.scanner.saveState();
- this.scanner.scanComments();
- var next = this.scanner.lex();
- this.scanner.restoreState(state);
- return (next.type === 3 /* Identifier */) ||
- (next.type === 7 /* Punctuator */ && next.value === '[') ||
- (next.type === 7 /* Punctuator */ && next.value === '{') ||
- (next.type === 4 /* Keyword */ && next.value === 'let') ||
- (next.type === 4 /* Keyword */ && next.value === 'yield');
- };
- Parser.prototype.parseLexicalDeclaration = function (options) {
- var node = this.createNode();
- var kind = this.nextToken().value;
- assert_1.assert(kind === 'let' || kind === 'const', 'Lexical declaration must be either let or const');
- var declarations = this.parseBindingList(kind, options);
- this.consumeSemicolon();
- return this.finalize(node, new Node.VariableDeclaration(declarations, kind));
- };
- // https://tc39.github.io/ecma262/#sec-destructuring-binding-patterns
- Parser.prototype.parseBindingRestElement = function (params, kind) {
- var node = this.createNode();
- this.expect('...');
- var arg = this.parsePattern(params, kind);
- return this.finalize(node, new Node.RestElement(arg));
- };
- Parser.prototype.parseArrayPattern = function (params, kind) {
- var node = this.createNode();
- this.expect('[');
- var elements = [];
- while (!this.match(']')) {
- if (this.match(',')) {
- this.nextToken();
- elements.push(null);
- }
- else {
- if (this.match('...')) {
- elements.push(this.parseBindingRestElement(params, kind));
- break;
- }
- else {
- elements.push(this.parsePatternWithDefault(params, kind));
- }
- if (!this.match(']')) {
- this.expect(',');
- }
- }
- }
- this.expect(']');
- return this.finalize(node, new Node.ArrayPattern(elements));
- };
- Parser.prototype.parsePropertyPattern = function (params, kind) {
- var node = this.createNode();
- var computed = false;
- var shorthand = false;
- var method = false;
- var key;
- var value;
- if (this.lookahead.type === 3 /* Identifier */) {
- var keyToken = this.lookahead;
- key = this.parseVariableIdentifier();
- var init = this.finalize(node, new Node.Identifier(keyToken.value));
- if (this.match('=')) {
- params.push(keyToken);
- shorthand = true;
- this.nextToken();
- var expr = this.parseAssignmentExpression();
- value = this.finalize(this.startNode(keyToken), new Node.AssignmentPattern(init, expr));
- }
- else if (!this.match(':')) {
- params.push(keyToken);
- shorthand = true;
- value = init;
- }
- else {
- this.expect(':');
- value = this.parsePatternWithDefault(params, kind);
- }
- }
- else {
- computed = this.match('[');
- key = this.parseObjectPropertyKey();
- this.expect(':');
- value = this.parsePatternWithDefault(params, kind);
- }
- return this.finalize(node, new Node.Property('init', key, computed, value, method, shorthand));
- };
- Parser.prototype.parseObjectPattern = function (params, kind) {
- var node = this.createNode();
- var properties = [];
- this.expect('{');
- while (!this.match('}')) {
- properties.push(this.parsePropertyPattern(params, kind));
- if (!this.match('}')) {
- this.expect(',');
- }
- }
- this.expect('}');
- return this.finalize(node, new Node.ObjectPattern(properties));
- };
- Parser.prototype.parsePattern = function (params, kind) {
- var pattern;
- if (this.match('[')) {
- pattern = this.parseArrayPattern(params, kind);
- }
- else if (this.match('{')) {
- pattern = this.parseObjectPattern(params, kind);
- }
- else {
- if (this.matchKeyword('let') && (kind === 'const' || kind === 'let')) {
- this.tolerateUnexpectedToken(this.lookahead, messages_1.Messages.LetInLexicalBinding);
- }
- params.push(this.lookahead);
- pattern = this.parseVariableIdentifier(kind);
- }
- return pattern;
- };
- Parser.prototype.parsePatternWithDefault = function (params, kind) {
- var startToken = this.lookahead;
- var pattern = this.parsePattern(params, kind);
- if (this.match('=')) {
- this.nextToken();
- var previousAllowYield = this.context.allowYield;
- this.context.allowYield = true;
- var right = this.isolateCoverGrammar(this.parseAssignmentExpression);
- this.context.allowYield = previousAllowYield;
- pattern = this.finalize(this.startNode(startToken), new Node.AssignmentPattern(pattern, right));
- }
- return pattern;
- };
- // https://tc39.github.io/ecma262/#sec-variable-statement
- Parser.prototype.parseVariableIdentifier = function (kind) {
- var node = this.createNode();
- var token = this.nextToken();
- if (token.type === 4 /* Keyword */ && token.value === 'yield') {
- if (this.context.strict) {
- this.tolerateUnexpectedToken(token, messages_1.Messages.StrictReservedWord);
- }
- else if (!this.context.allowYield) {
- this.throwUnexpectedToken(token);
- }
- }
- else if (token.type !== 3 /* Identifier */) {
- if (this.context.strict && token.type === 4 /* Keyword */ && this.scanner.isStrictModeReservedWord(token.value)) {
- this.tolerateUnexpectedToken(token, messages_1.Messages.StrictReservedWord);
- }
- else {
- if (this.context.strict || token.value !== 'let' || kind !== 'var') {
- this.throwUnexpectedToken(token);
- }
- }
- }
- else if ((this.context.isModule || this.context.await) && token.type === 3 /* Identifier */ && token.value === 'await') {
- this.tolerateUnexpectedToken(token);
- }
- return this.finalize(node, new Node.Identifier(token.value));
- };
- Parser.prototype.parseVariableDeclaration = function (options) {
- var node = this.createNode();
- var params = [];
- var id = this.parsePattern(params, 'var');
- if (this.context.strict && id.type === syntax_1.Syntax.Identifier) {
- if (this.scanner.isRestrictedWord(id.name)) {
- this.tolerateError(messages_1.Messages.StrictVarName);
- }
- }
- var init = null;
- if (this.match('=')) {
- this.nextToken();
- init = this.isolateCoverGrammar(this.parseAssignmentExpression);
- }
- else if (id.type !== syntax_1.Syntax.Identifier && !options.inFor) {
- this.expect('=');
- }
- return this.finalize(node, new Node.VariableDeclarator(id, init));
- };
- Parser.prototype.parseVariableDeclarationList = function (options) {
- var opt = { inFor: options.inFor };
- var list = [];
- list.push(this.parseVariableDeclaration(opt));
- while (this.match(',')) {
- this.nextToken();
- list.push(this.parseVariableDeclaration(opt));
- }
- return list;
- };
- Parser.prototype.parseVariableStatement = function () {
- var node = this.createNode();
- this.expectKeyword('var');
- var declarations = this.parseVariableDeclarationList({ inFor: false });
- this.consumeSemicolon();
- return this.finalize(node, new Node.VariableDeclaration(declarations, 'var'));
- };
- // https://tc39.github.io/ecma262/#sec-empty-statement
- Parser.prototype.parseEmptyStatement = function () {
- var node = this.createNode();
- this.expect(';');
- return this.finalize(node, new Node.EmptyStatement());
- };
- // https://tc39.github.io/ecma262/#sec-expression-statement
- Parser.prototype.parseExpressionStatement = function () {
- var node = this.createNode();
- var expr = this.parseExpression();
- this.consumeSemicolon();
- return this.finalize(node, new Node.ExpressionStatement(expr));
- };
- // https://tc39.github.io/ecma262/#sec-if-statement
- Parser.prototype.parseIfClause = function () {
- if (this.context.strict && this.matchKeyword('function')) {
- this.tolerateError(messages_1.Messages.StrictFunction);
- }
- return this.parseStatement();
- };
- Parser.prototype.parseIfStatement = function () {
- var node = this.createNode();
- var consequent;
- var alternate = null;
- this.expectKeyword('if');
- this.expect('(');
- var test = this.parseExpression();
- if (!this.match(')') && this.config.tolerant) {
- this.tolerateUnexpectedToken(this.nextToken());
- consequent = this.finalize(this.createNode(), new Node.EmptyStatement());
- }
- else {
- this.expect(')');
- consequent = this.parseIfClause();
- if (this.matchKeyword('else')) {
- this.nextToken();
- alternate = this.parseIfClause();
- }
- }
- return this.finalize(node, new Node.IfStatement(test, consequent, alternate));
- };
- // https://tc39.github.io/ecma262/#sec-do-while-statement
- Parser.prototype.parseDoWhileStatement = function () {
- var node = this.createNode();
- this.expectKeyword('do');
- var previousInIteration = this.context.inIteration;
- this.context.inIteration = true;
- var body = this.parseStatement();
- this.context.inIteration = previousInIteration;
- this.expectKeyword('while');
- this.expect('(');
- var test = this.parseExpression();
- if (!this.match(')') && this.config.tolerant) {
- this.tolerateUnexpectedToken(this.nextToken());
- }
- else {
- this.expect(')');
- if (this.match(';')) {
- this.nextToken();
- }
- }
- return this.finalize(node, new Node.DoWhileStatement(body, test));
- };
- // https://tc39.github.io/ecma262/#sec-while-statement
- Parser.prototype.parseWhileStatement = function () {
- var node = this.createNode();
- var body;
- this.expectKeyword('while');
- this.expect('(');
- var test = this.parseExpression();
- if (!this.match(')') && this.config.tolerant) {
- this.tolerateUnexpectedToken(this.nextToken());
- body = this.finalize(this.createNode(), new Node.EmptyStatement());
- }
- else {
- this.expect(')');
- var previousInIteration = this.context.inIteration;
- this.context.inIteration = true;
- body = this.parseStatement();
- this.context.inIteration = previousInIteration;
- }
- return this.finalize(node, new Node.WhileStatement(test, body));
- };
- // https://tc39.github.io/ecma262/#sec-for-statement
- // https://tc39.github.io/ecma262/#sec-for-in-and-for-of-statements
- Parser.prototype.parseForStatement = function () {
- var init = null;
- var test = null;
- var update = null;
- var forIn = true;
- var left, right;
- var node = this.createNode();
- this.expectKeyword('for');
- this.expect('(');
- if (this.match(';')) {
- this.nextToken();
- }
- else {
- if (this.matchKeyword('var')) {
- init = this.createNode();
- this.nextToken();
- var previousAllowIn = this.context.allowIn;
- this.context.allowIn = false;
- var declarations = this.parseVariableDeclarationList({ inFor: true });
- this.context.allowIn = previousAllowIn;
- if (declarations.length === 1 && this.matchKeyword('in')) {
- var decl = declarations[0];
- if (decl.init && (decl.id.type === syntax_1.Syntax.ArrayPattern || decl.id.type === syntax_1.Syntax.ObjectPattern || this.context.strict)) {
- this.tolerateError(messages_1.Messages.ForInOfLoopInitializer, 'for-in');
- }
- init = this.finalize(init, new Node.VariableDeclaration(declarations, 'var'));
- this.nextToken();
- left = init;
- right = this.parseExpression();
- init = null;
- }
- else if (declarations.length === 1 && declarations[0].init === null && this.matchContextualKeyword('of')) {
- init = this.finalize(init, new Node.VariableDeclaration(declarations, 'var'));
- this.nextToken();
- left = init;
- right = this.parseAssignmentExpression();
- init = null;
- forIn = false;
- }
- else {
- init = this.finalize(init, new Node.VariableDeclaration(declarations, 'var'));
- this.expect(';');
- }
- }
- else if (this.matchKeyword('const') || this.matchKeyword('let')) {
- init = this.createNode();
- var kind = this.nextToken().value;
- if (!this.context.strict && this.lookahead.value === 'in') {
- init = this.finalize(init, new Node.Identifier(kind));
- this.nextToken();
- left = init;
- right = this.parseExpression();
- init = null;
- }
- else {
- var previousAllowIn = this.context.allowIn;
- this.context.allowIn = false;
- var declarations = this.parseBindingList(kind, { inFor: true });
- this.context.allowIn = previousAllowIn;
- if (declarations.length === 1 && declarations[0].init === null && this.matchKeyword('in')) {
- init = this.finalize(init, new Node.VariableDeclaration(declarations, kind));
- this.nextToken();
- left = init;
- right = this.parseExpression();
- init = null;
- }
- else if (declarations.length === 1 && declarations[0].init === null && this.matchContextualKeyword('of')) {
- init = this.finalize(init, new Node.VariableDeclaration(declarations, kind));
- this.nextToken();
- left = init;
- right = this.parseAssignmentExpression();
- init = null;
- forIn = false;
- }
- else {
- this.consumeSemicolon();
- init = this.finalize(init, new Node.VariableDeclaration(declarations, kind));
- }
- }
- }
- else {
- var initStartToken = this.lookahead;
- var previousAllowIn = this.context.allowIn;
- this.context.allowIn = false;
- init = this.inheritCoverGrammar(this.parseAssignmentExpression);
- this.context.allowIn = previousAllowIn;
- if (this.matchKeyword('in')) {
- if (!this.context.isAssignmentTarget || init.type === syntax_1.Syntax.AssignmentExpression) {
- this.tolerateError(messages_1.Messages.InvalidLHSInForIn);
- }
- this.nextToken();
- this.reinterpretExpressionAsPattern(init);
- left = init;
- right = this.parseExpression();
- init = null;
- }
- else if (this.matchContextualKeyword('of')) {
- if (!this.context.isAssignmentTarget || init.type === syntax_1.Syntax.AssignmentExpression) {
- this.tolerateError(messages_1.Messages.InvalidLHSInForLoop);
- }
- this.nextToken();
- this.reinterpretExpressionAsPattern(init);
- left = init;
- right = this.parseAssignmentExpression();
- init = null;
- forIn = false;
- }
- else {
- if (this.match(',')) {
- var initSeq = [init];
- while (this.match(',')) {
- this.nextToken();
- initSeq.push(this.isolateCoverGrammar(this.parseAssignmentExpression));
- }
- init = this.finalize(this.startNode(initStartToken), new Node.SequenceExpression(initSeq));
- }
- this.expect(';');
- }
- }
- }
- if (typeof left === 'undefined') {
- if (!this.match(';')) {
- test = this.parseExpression();
- }
- this.expect(';');
- if (!this.match(')')) {
- update = this.parseExpression();
- }
- }
- var body;
- if (!this.match(')') && this.config.tolerant) {
- this.tolerateUnexpectedToken(this.nextToken());
- body = this.finalize(this.createNode(), new Node.EmptyStatement());
- }
- else {
- this.expect(')');
- var previousInIteration = this.context.inIteration;
- this.context.inIteration = true;
- body = this.isolateCoverGrammar(this.parseStatement);
- this.context.inIteration = previousInIteration;
- }
- return (typeof left === 'undefined') ?
- this.finalize(node, new Node.ForStatement(init, test, update, body)) :
- forIn ? this.finalize(node, new Node.ForInStatement(left, right, body)) :
- this.finalize(node, new Node.ForOfStatement(left, right, body));
- };
- // https://tc39.github.io/ecma262/#sec-continue-statement
- Parser.prototype.parseContinueStatement = function () {
- var node = this.createNode();
- this.expectKeyword('continue');
- var label = null;
- if (this.lookahead.type === 3 /* Identifier */ && !this.hasLineTerminator) {
- var id = this.parseVariableIdentifier();
- label = id;
- var key = '$' + id.name;
- if (!Object.prototype.hasOwnProperty.call(this.context.labelSet, key)) {
- this.throwError(messages_1.Messages.UnknownLabel, id.name);
- }
- }
- this.consumeSemicolon();
- if (label === null && !this.context.inIteration) {
- this.throwError(messages_1.Messages.IllegalContinue);
- }
- return this.finalize(node, new Node.ContinueStatement(label));
- };
- // https://tc39.github.io/ecma262/#sec-break-statement
- Parser.prototype.parseBreakStatement = function () {
- var node = this.createNode();
- this.expectKeyword('break');
- var label = null;
- if (this.lookahead.type === 3 /* Identifier */ && !this.hasLineTerminator) {
- var id = this.parseVariableIdentifier();
- var key = '$' + id.name;
- if (!Object.prototype.hasOwnProperty.call(this.context.labelSet, key)) {
- this.throwError(messages_1.Messages.UnknownLabel, id.name);
- }
- label = id;
- }
- this.consumeSemicolon();
- if (label === null && !this.context.inIteration && !this.context.inSwitch) {
- this.throwError(messages_1.Messages.IllegalBreak);
- }
- return this.finalize(node, new Node.BreakStatement(label));
- };
- // https://tc39.github.io/ecma262/#sec-return-statement
- Parser.prototype.parseReturnStatement = function () {
- if (!this.context.inFunctionBody) {
- this.tolerateError(messages_1.Messages.IllegalReturn);
- }
- var node = this.createNode();
- this.expectKeyword('return');
- var hasArgument = (!this.match(';') && !this.match('}') &&
- !this.hasLineTerminator && this.lookahead.type !== 2 /* EOF */) ||
- this.lookahead.type === 8 /* StringLiteral */ ||
- this.lookahead.type === 10 /* Template */;
- var argument = hasArgument ? this.parseExpression() : null;
- this.consumeSemicolon();
- return this.finalize(node, new Node.ReturnStatement(argument));
- };
- // https://tc39.github.io/ecma262/#sec-with-statement
- Parser.prototype.parseWithStatement = function () {
- if (this.context.strict) {
- this.tolerateError(messages_1.Messages.StrictModeWith);
- }
- var node = this.createNode();
- var body;
- this.expectKeyword('with');
- this.expect('(');
- var object = this.parseExpression();
- if (!this.match(')') && this.config.tolerant) {
- this.tolerateUnexpectedToken(this.nextToken());
- body = this.finalize(this.createNode(), new Node.EmptyStatement());
- }
- else {
- this.expect(')');
- body = this.parseStatement();
- }
- return this.finalize(node, new Node.WithStatement(object, body));
- };
- // https://tc39.github.io/ecma262/#sec-switch-statement
- Parser.prototype.parseSwitchCase = function () {
- var node = this.createNode();
- var test;
- if (this.matchKeyword('default')) {
- this.nextToken();
- test = null;
- }
- else {
- this.expectKeyword('case');
- test = this.parseExpression();
- }
- this.expect(':');
- var consequent = [];
- while (true) {
- if (this.match('}') || this.matchKeyword('default') || this.matchKeyword('case')) {
- break;
- }
- consequent.push(this.parseStatementListItem());
- }
- return this.finalize(node, new Node.SwitchCase(test, consequent));
- };
- Parser.prototype.parseSwitchStatement = function () {
- var node = this.createNode();
- this.expectKeyword('switch');
- this.expect('(');
- var discriminant = this.parseExpression();
- this.expect(')');
- var previousInSwitch = this.context.inSwitch;
- this.context.inSwitch = true;
- var cases = [];
- var defaultFound = false;
- this.expect('{');
- while (true) {
- if (this.match('}')) {
- break;
- }
- var clause = this.parseSwitchCase();
- if (clause.test === null) {
- if (defaultFound) {
- this.throwError(messages_1.Messages.MultipleDefaultsInSwitch);
- }
- defaultFound = true;
- }
- cases.push(clause);
- }
- this.expect('}');
- this.context.inSwitch = previousInSwitch;
- return this.finalize(node, new Node.SwitchStatement(discriminant, cases));
- };
- // https://tc39.github.io/ecma262/#sec-labelled-statements
- Parser.prototype.parseLabelledStatement = function () {
- var node = this.createNode();
- var expr = this.parseExpression();
- var statement;
- if ((expr.type === syntax_1.Syntax.Identifier) && this.match(':')) {
- this.nextToken();
- var id = expr;
- var key = '$' + id.name;
- if (Object.prototype.hasOwnProperty.call(this.context.labelSet, key)) {
- this.throwError(messages_1.Messages.Redeclaration, 'Label', id.name);
- }
- this.context.labelSet[key] = true;
- var body = void 0;
- if (this.matchKeyword('class')) {
- this.tolerateUnexpectedToken(this.lookahead);
- body = this.parseClassDeclaration();
- }
- else if (this.matchKeyword('function')) {
- var token = this.lookahead;
- var declaration = this.parseFunctionDeclaration();
- if (this.context.strict) {
- this.tolerateUnexpectedToken(token, messages_1.Messages.StrictFunction);
- }
- else if (declaration.generator) {
- this.tolerateUnexpectedToken(token, messages_1.Messages.GeneratorInLegacyContext);
- }
- body = declaration;
- }
- else {
- body = this.parseStatement();
- }
- delete this.context.labelSet[key];
- statement = new Node.LabeledStatement(id, body);
- }
- else {
- this.consumeSemicolon();
- statement = new Node.ExpressionStatement(expr);
- }
- return this.finalize(node, statement);
- };
- // https://tc39.github.io/ecma262/#sec-throw-statement
- Parser.prototype.parseThrowStatement = function () {
- var node = this.createNode();
- this.expectKeyword('throw');
- if (this.hasLineTerminator) {
- this.throwError(messages_1.Messages.NewlineAfterThrow);
- }
- var argument = this.parseExpression();
- this.consumeSemicolon();
- return this.finalize(node, new Node.ThrowStatement(argument));
- };
- // https://tc39.github.io/ecma262/#sec-try-statement
- Parser.prototype.parseCatchClause = function () {
- var node = this.createNode();
- this.expectKeyword('catch');
- this.expect('(');
- if (this.match(')')) {
- this.throwUnexpectedToken(this.lookahead);
- }
- var params = [];
- var param = this.parsePattern(params);
- var paramMap = {};
- for (var i = 0; i < params.length; i++) {
- var key = '$' + params[i].value;
- if (Object.prototype.hasOwnProperty.call(paramMap, key)) {
- this.tolerateError(messages_1.Messages.DuplicateBinding, params[i].value);
- }
- paramMap[key] = true;
- }
- if (this.context.strict && param.type === syntax_1.Syntax.Identifier) {
- if (this.scanner.isRestrictedWord(param.name)) {
- this.tolerateError(messages_1.Messages.StrictCatchVariable);
- }
- }
- this.expect(')');
- var body = this.parseBlock();
- return this.finalize(node, new Node.CatchClause(param, body));
- };
- Parser.prototype.parseFinallyClause = function () {
- this.expectKeyword('finally');
- return this.parseBlock();
- };
- Parser.prototype.parseTryStatement = function () {
- var node = this.createNode();
- this.expectKeyword('try');
- var block = this.parseBlock();
- var handler = this.matchKeyword('catch') ? this.parseCatchClause() : null;
- var finalizer = this.matchKeyword('finally') ? this.parseFinallyClause() : null;
- if (!handler && !finalizer) {
- this.throwError(messages_1.Messages.NoCatchOrFinally);
- }
- return this.finalize(node, new Node.TryStatement(block, handler, finalizer));
- };
- // https://tc39.github.io/ecma262/#sec-debugger-statement
- Parser.prototype.parseDebuggerStatement = function () {
- var node = this.createNode();
- this.expectKeyword('debugger');
- this.consumeSemicolon();
- return this.finalize(node, new Node.DebuggerStatement());
- };
- // https://tc39.github.io/ecma262/#sec-ecmascript-language-statements-and-declarations
- Parser.prototype.parseStatement = function () {
- var statement;
- switch (this.lookahead.type) {
- case 1 /* BooleanLiteral */:
- case 5 /* NullLiteral */:
- case 6 /* NumericLiteral */:
- case 8 /* StringLiteral */:
- case 10 /* Template */:
- case 9 /* RegularExpression */:
- statement = this.parseExpressionStatement();
- break;
- case 7 /* Punctuator */:
- var value = this.lookahead.value;
- if (value === '{') {
- statement = this.parseBlock();
- }
- else if (value === '(') {
- statement = this.parseExpressionStatement();
- }
- else if (value === ';') {
- statement = this.parseEmptyStatement();
- }
- else {
- statement = this.parseExpressionStatement();
- }
- break;
- case 3 /* Identifier */:
- statement = this.matchAsyncFunction() ? this.parseFunctionDeclaration() : this.parseLabelledStatement();
- break;
- case 4 /* Keyword */:
- switch (this.lookahead.value) {
- case 'break':
- statement = this.parseBreakStatement();
- break;
- case 'continue':
- statement = this.parseContinueStatement();
- break;
- case 'debugger':
- statement = this.parseDebuggerStatement();
- break;
- case 'do':
- statement = this.parseDoWhileStatement();
- break;
- case 'for':
- statement = this.parseForStatement();
- break;
- case 'function':
- statement = this.parseFunctionDeclaration();
- break;
- case 'if':
- statement = this.parseIfStatement();
- break;
- case 'return':
- statement = this.parseReturnStatement();
- break;
- case 'switch':
- statement = this.parseSwitchStatement();
- break;
- case 'throw':
- statement = this.parseThrowStatement();
- break;
- case 'try':
- statement = this.parseTryStatement();
- break;
- case 'var':
- statement = this.parseVariableStatement();
- break;
- case 'while':
- statement = this.parseWhileStatement();
- break;
- case 'with':
- statement = this.parseWithStatement();
- break;
- default:
- statement = this.parseExpressionStatement();
- break;
- }
- break;
- default:
- statement = this.throwUnexpectedToken(this.lookahead);
- }
- return statement;
- };
- // https://tc39.github.io/ecma262/#sec-function-definitions
- Parser.prototype.parseFunctionSourceElements = function () {
- var node = this.createNode();
- this.expect('{');
- var body = this.parseDirectivePrologues();
- var previousLabelSet = this.context.labelSet;
- var previousInIteration = this.context.inIteration;
- var previousInSwitch = this.context.inSwitch;
- var previousInFunctionBody = this.context.inFunctionBody;
- this.context.labelSet = {};
- this.context.inIteration = false;
- this.context.inSwitch = false;
- this.context.inFunctionBody = true;
- while (this.lookahead.type !== 2 /* EOF */) {
- if (this.match('}')) {
- break;
- }
- body.push(this.parseStatementListItem());
- }
- this.expect('}');
- this.context.labelSet = previousLabelSet;
- this.context.inIteration = previousInIteration;
- this.context.inSwitch = previousInSwitch;
- this.context.inFunctionBody = previousInFunctionBody;
- return this.finalize(node, new Node.BlockStatement(body));
- };
- Parser.prototype.validateParam = function (options, param, name) {
- var key = '$' + name;
- if (this.context.strict) {
- if (this.scanner.isRestrictedWord(name)) {
- options.stricted = param;
- options.message = messages_1.Messages.StrictParamName;
- }
- if (Object.prototype.hasOwnProperty.call(options.paramSet, key)) {
- options.stricted = param;
- options.message = messages_1.Messages.StrictParamDupe;
- }
- }
- else if (!options.firstRestricted) {
- if (this.scanner.isRestrictedWord(name)) {
- options.firstRestricted = param;
- options.message = messages_1.Messages.StrictParamName;
- }
- else if (this.scanner.isStrictModeReservedWord(name)) {
- options.firstRestricted = param;
- options.message = messages_1.Messages.StrictReservedWord;
- }
- else if (Object.prototype.hasOwnProperty.call(options.paramSet, key)) {
- options.stricted = param;
- options.message = messages_1.Messages.StrictParamDupe;
- }
- }
- /* istanbul ignore next */
- if (typeof Object.defineProperty === 'function') {
- Object.defineProperty(options.paramSet, key, { value: true, enumerable: true, writable: true, configurable: true });
- }
- else {
- options.paramSet[key] = true;
- }
- };
- Parser.prototype.parseRestElement = function (params) {
- var node = this.createNode();
- this.expect('...');
- var arg = this.parsePattern(params);
- if (this.match('=')) {
- this.throwError(messages_1.Messages.DefaultRestParameter);
- }
- if (!this.match(')')) {
- this.throwError(messages_1.Messages.ParameterAfterRestParameter);
- }
- return this.finalize(node, new Node.RestElement(arg));
- };
- Parser.prototype.parseFormalParameter = function (options) {
- var params = [];
- var param = this.match('...') ? this.parseRestElement(params) : this.parsePatternWithDefault(params);
- for (var i = 0; i < params.length; i++) {
- this.validateParam(options, params[i], params[i].value);
- }
- options.simple = options.simple && (param instanceof Node.Identifier);
- options.params.push(param);
- };
- Parser.prototype.parseFormalParameters = function (firstRestricted) {
- var options;
- options = {
- simple: true,
- params: [],
- firstRestricted: firstRestricted
- };
- this.expect('(');
- if (!this.match(')')) {
- options.paramSet = {};
- while (this.lookahead.type !== 2 /* EOF */) {
- this.parseFormalParameter(options);
- if (this.match(')')) {
- break;
- }
- this.expect(',');
- if (this.match(')')) {
- break;
- }
- }
- }
- this.expect(')');
- return {
- simple: options.simple,
- params: options.params,
- stricted: options.stricted,
- firstRestricted: options.firstRestricted,
- message: options.message
- };
- };
- Parser.prototype.matchAsyncFunction = function () {
- var match = this.matchContextualKeyword('async');
- if (match) {
- var state = this.scanner.saveState();
- this.scanner.scanComments();
- var next = this.scanner.lex();
- this.scanner.restoreState(state);
- match = (state.lineNumber === next.lineNumber) && (next.type === 4 /* Keyword */) && (next.value === 'function');
- }
- return match;
- };
- Parser.prototype.parseFunctionDeclaration = function (identifierIsOptional) {
- var node = this.createNode();
- var isAsync = this.matchContextualKeyword('async');
- if (isAsync) {
- this.nextToken();
- }
- this.expectKeyword('function');
- var isGenerator = isAsync ? false : this.match('*');
- if (isGenerator) {
- this.nextToken();
- }
- var message;
- var id = null;
- var firstRestricted = null;
- if (!identifierIsOptional || !this.match('(')) {
- var token = this.lookahead;
- id = this.parseVariableIdentifier();
- if (this.context.strict) {
- if (this.scanner.isRestrictedWord(token.value)) {
- this.tolerateUnexpectedToken(token, messages_1.Messages.StrictFunctionName);
- }
- }
- else {
- if (this.scanner.isRestrictedWord(token.value)) {
- firstRestricted = token;
- message = messages_1.Messages.StrictFunctionName;
- }
- else if (this.scanner.isStrictModeReservedWord(token.value)) {
- firstRestricted = token;
- message = messages_1.Messages.StrictReservedWord;
- }
- }
- }
- var previousAllowAwait = this.context.await;
- var previousAllowYield = this.context.allowYield;
- this.context.await = isAsync;
- this.context.allowYield = !isGenerator;
- var formalParameters = this.parseFormalParameters(firstRestricted);
- var params = formalParameters.params;
- var stricted = formalParameters.stricted;
- firstRestricted = formalParameters.firstRestricted;
- if (formalParameters.message) {
- message = formalParameters.message;
- }
- var previousStrict = this.context.strict;
- var previousAllowStrictDirective = this.context.allowStrictDirective;
- this.context.allowStrictDirective = formalParameters.simple;
- var body = this.parseFunctionSourceElements();
- if (this.context.strict && firstRestricted) {
- this.throwUnexpectedToken(firstRestricted, message);
- }
- if (this.context.strict && stricted) {
- this.tolerateUnexpectedToken(stricted, message);
- }
- this.context.strict = previousStrict;
- this.context.allowStrictDirective = previousAllowStrictDirective;
- this.context.await = previousAllowAwait;
- this.context.allowYield = previousAllowYield;
- return isAsync ? this.finalize(node, new Node.AsyncFunctionDeclaration(id, params, body)) :
- this.finalize(node, new Node.FunctionDeclaration(id, params, body, isGenerator));
- };
- Parser.prototype.parseFunctionExpression = function () {
- var node = this.createNode();
- var isAsync = this.matchContextualKeyword('async');
- if (isAsync) {
- this.nextToken();
- }
- this.expectKeyword('function');
- var isGenerator = isAsync ? false : this.match('*');
- if (isGenerator) {
- this.nextToken();
- }
- var message;
- var id = null;
- var firstRestricted;
- var previousAllowAwait = this.context.await;
- var previousAllowYield = this.context.allowYield;
- this.context.await = isAsync;
- this.context.allowYield = !isGenerator;
- if (!this.match('(')) {
- var token = this.lookahead;
- id = (!this.context.strict && !isGenerator && this.matchKeyword('yield')) ? this.parseIdentifierName() : this.parseVariableIdentifier();
- if (this.context.strict) {
- if (this.scanner.isRestrictedWord(token.value)) {
- this.tolerateUnexpectedToken(token, messages_1.Messages.StrictFunctionName);
- }
- }
- else {
- if (this.scanner.isRestrictedWord(token.value)) {
- firstRestricted = token;
- message = messages_1.Messages.StrictFunctionName;
- }
- else if (this.scanner.isStrictModeReservedWord(token.value)) {
- firstRestricted = token;
- message = messages_1.Messages.StrictReservedWord;
- }
- }
- }
- var formalParameters = this.parseFormalParameters(firstRestricted);
- var params = formalParameters.params;
- var stricted = formalParameters.stricted;
- firstRestricted = formalParameters.firstRestricted;
- if (formalParameters.message) {
- message = formalParameters.message;
- }
- var previousStrict = this.context.strict;
- var previousAllowStrictDirective = this.context.allowStrictDirective;
- this.context.allowStrictDirective = formalParameters.simple;
- var body = this.parseFunctionSourceElements();
- if (this.context.strict && firstRestricted) {
- this.throwUnexpectedToken(firstRestricted, message);
- }
- if (this.context.strict && stricted) {
- this.tolerateUnexpectedToken(stricted, message);
- }
- this.context.strict = previousStrict;
- this.context.allowStrictDirective = previousAllowStrictDirective;
- this.context.await = previousAllowAwait;
- this.context.allowYield = previousAllowYield;
- return isAsync ? this.finalize(node, new Node.AsyncFunctionExpression(id, params, body)) :
- this.finalize(node, new Node.FunctionExpression(id, params, body, isGenerator));
- };
- // https://tc39.github.io/ecma262/#sec-directive-prologues-and-the-use-strict-directive
- Parser.prototype.parseDirective = function () {
- var token = this.lookahead;
- var node = this.createNode();
- var expr = this.parseExpression();
- var directive = (expr.type === syntax_1.Syntax.Literal) ? this.getTokenRaw(token).slice(1, -1) : null;
- this.consumeSemicolon();
- return this.finalize(node, directive ? new Node.Directive(expr, directive) : new Node.ExpressionStatement(expr));
- };
- Parser.prototype.parseDirectivePrologues = function () {
- var firstRestricted = null;
- var body = [];
- while (true) {
- var token = this.lookahead;
- if (token.type !== 8 /* StringLiteral */) {
- break;
- }
- var statement = this.parseDirective();
- body.push(statement);
- var directive = statement.directive;
- if (typeof directive !== 'string') {
- break;
- }
- if (directive === 'use strict') {
- this.context.strict = true;
- if (firstRestricted) {
- this.tolerateUnexpectedToken(firstRestricted, messages_1.Messages.StrictOctalLiteral);
- }
- if (!this.context.allowStrictDirective) {
- this.tolerateUnexpectedToken(token, messages_1.Messages.IllegalLanguageModeDirective);
- }
- }
- else {
- if (!firstRestricted && token.octal) {
- firstRestricted = token;
- }
- }
- }
- return body;
- };
- // https://tc39.github.io/ecma262/#sec-method-definitions
- Parser.prototype.qualifiedPropertyName = function (token) {
- switch (token.type) {
- case 3 /* Identifier */:
- case 8 /* StringLiteral */:
- case 1 /* BooleanLiteral */:
- case 5 /* NullLiteral */:
- case 6 /* NumericLiteral */:
- case 4 /* Keyword */:
- return true;
- case 7 /* Punctuator */:
- return token.value === '[';
- default:
- break;
- }
- return false;
- };
- Parser.prototype.parseGetterMethod = function () {
- var node = this.createNode();
- var isGenerator = false;
- var previousAllowYield = this.context.allowYield;
- this.context.allowYield = !isGenerator;
- var formalParameters = this.parseFormalParameters();
- if (formalParameters.params.length > 0) {
- this.tolerateError(messages_1.Messages.BadGetterArity);
- }
- var method = this.parsePropertyMethod(formalParameters);
- this.context.allowYield = previousAllowYield;
- return this.finalize(node, new Node.FunctionExpression(null, formalParameters.params, method, isGenerator));
- };
- Parser.prototype.parseSetterMethod = function () {
- var node = this.createNode();
- var isGenerator = false;
- var previousAllowYield = this.context.allowYield;
- this.context.allowYield = !isGenerator;
- var formalParameters = this.parseFormalParameters();
- if (formalParameters.params.length !== 1) {
- this.tolerateError(messages_1.Messages.BadSetterArity);
- }
- else if (formalParameters.params[0] instanceof Node.RestElement) {
- this.tolerateError(messages_1.Messages.BadSetterRestParameter);
- }
- var method = this.parsePropertyMethod(formalParameters);
- this.context.allowYield = previousAllowYield;
- return this.finalize(node, new Node.FunctionExpression(null, formalParameters.params, method, isGenerator));
- };
- Parser.prototype.parseGeneratorMethod = function () {
- var node = this.createNode();
- var isGenerator = true;
- var previousAllowYield = this.context.allowYield;
- this.context.allowYield = true;
- var params = this.parseFormalParameters();
- this.context.allowYield = false;
- var method = this.parsePropertyMethod(params);
- this.context.allowYield = previousAllowYield;
- return this.finalize(node, new Node.FunctionExpression(null, params.params, method, isGenerator));
- };
- // https://tc39.github.io/ecma262/#sec-generator-function-definitions
- Parser.prototype.isStartOfExpression = function () {
- var start = true;
- var value = this.lookahead.value;
- switch (this.lookahead.type) {
- case 7 /* Punctuator */:
- start = (value === '[') || (value === '(') || (value === '{') ||
- (value === '+') || (value === '-') ||
- (value === '!') || (value === '~') ||
- (value === '++') || (value === '--') ||
- (value === '/') || (value === '/='); // regular expression literal
- break;
- case 4 /* Keyword */:
- start = (value === 'class') || (value === 'delete') ||
- (value === 'function') || (value === 'let') || (value === 'new') ||
- (value === 'super') || (value === 'this') || (value === 'typeof') ||
- (value === 'void') || (value === 'yield');
- break;
- default:
- break;
- }
- return start;
- };
- Parser.prototype.parseYieldExpression = function () {
- var node = this.createNode();
- this.expectKeyword('yield');
- var argument = null;
- var delegate = false;
- if (!this.hasLineTerminator) {
- var previousAllowYield = this.context.allowYield;
- this.context.allowYield = false;
- delegate = this.match('*');
- if (delegate) {
- this.nextToken();
- argument = this.parseAssignmentExpression();
- }
- else if (this.isStartOfExpression()) {
- argument = this.parseAssignmentExpression();
- }
- this.context.allowYield = previousAllowYield;
- }
- return this.finalize(node, new Node.YieldExpression(argument, delegate));
- };
- // https://tc39.github.io/ecma262/#sec-class-definitions
- Parser.prototype.parseClassElement = function (hasConstructor) {
- var token = this.lookahead;
- var node = this.createNode();
- var kind = '';
- var key = null;
- var value = null;
- var computed = false;
- var method = false;
- var isStatic = false;
- var isAsync = false;
- if (this.match('*')) {
- this.nextToken();
- }
- else {
- computed = this.match('[');
- key = this.parseObjectPropertyKey();
- var id = key;
- if (id.name === 'static' && (this.qualifiedPropertyName(this.lookahead) || this.match('*'))) {
- token = this.lookahead;
- isStatic = true;
- computed = this.match('[');
- if (this.match('*')) {
- this.nextToken();
- }
- else {
- key = this.parseObjectPropertyKey();
- }
- }
- if ((token.type === 3 /* Identifier */) && !this.hasLineTerminator && (token.value === 'async')) {
- var punctuator = this.lookahead.value;
- if (punctuator !== ':' && punctuator !== '(' && punctuator !== '*') {
- isAsync = true;
- token = this.lookahead;
- key = this.parseObjectPropertyKey();
- if (token.type === 3 /* Identifier */ && token.value === 'constructor') {
- this.tolerateUnexpectedToken(token, messages_1.Messages.ConstructorIsAsync);
- }
- }
- }
- }
- var lookaheadPropertyKey = this.qualifiedPropertyName(this.lookahead);
- if (token.type === 3 /* Identifier */) {
- if (token.value === 'get' && lookaheadPropertyKey) {
- kind = 'get';
- computed = this.match('[');
- key = this.parseObjectPropertyKey();
- this.context.allowYield = false;
- value = this.parseGetterMethod();
- }
- else if (token.value === 'set' && lookaheadPropertyKey) {
- kind = 'set';
- computed = this.match('[');
- key = this.parseObjectPropertyKey();
- value = this.parseSetterMethod();
- }
- }
- else if (token.type === 7 /* Punctuator */ && token.value === '*' && lookaheadPropertyKey) {
- kind = 'init';
- computed = this.match('[');
- key = this.parseObjectPropertyKey();
- value = this.parseGeneratorMethod();
- method = true;
- }
- if (!kind && key && this.match('(')) {
- kind = 'init';
- value = isAsync ? this.parsePropertyMethodAsyncFunction() : this.parsePropertyMethodFunction();
- method = true;
- }
- if (!kind) {
- this.throwUnexpectedToken(this.lookahead);
- }
- if (kind === 'init') {
- kind = 'method';
- }
- if (!computed) {
- if (isStatic && this.isPropertyKey(key, 'prototype')) {
- this.throwUnexpectedToken(token, messages_1.Messages.StaticPrototype);
- }
- if (!isStatic && this.isPropertyKey(key, 'constructor')) {
- if (kind !== 'method' || !method || (value && value.generator)) {
- this.throwUnexpectedToken(token, messages_1.Messages.ConstructorSpecialMethod);
- }
- if (hasConstructor.value) {
- this.throwUnexpectedToken(token, messages_1.Messages.DuplicateConstructor);
- }
- else {
- hasConstructor.value = true;
- }
- kind = 'constructor';
- }
- }
- return this.finalize(node, new Node.MethodDefinition(key, computed, value, kind, isStatic));
- };
- Parser.prototype.parseClassElementList = function () {
- var body = [];
- var hasConstructor = { value: false };
- this.expect('{');
- while (!this.match('}')) {
- if (this.match(';')) {
- this.nextToken();
- }
- else {
- body.push(this.parseClassElement(hasConstructor));
- }
- }
- this.expect('}');
- return body;
- };
- Parser.prototype.parseClassBody = function () {
- var node = this.createNode();
- var elementList = this.parseClassElementList();
- return this.finalize(node, new Node.ClassBody(elementList));
- };
- Parser.prototype.parseClassDeclaration = function (identifierIsOptional) {
- var node = this.createNode();
- var previousStrict = this.context.strict;
- this.context.strict = true;
- this.expectKeyword('class');
- var id = (identifierIsOptional && (this.lookahead.type !== 3 /* Identifier */)) ? null : this.parseVariableIdentifier();
- var superClass = null;
- if (this.matchKeyword('extends')) {
- this.nextToken();
- superClass = this.isolateCoverGrammar(this.parseLeftHandSideExpressionAllowCall);
- }
- var classBody = this.parseClassBody();
- this.context.strict = previousStrict;
- return this.finalize(node, new Node.ClassDeclaration(id, superClass, classBody));
- };
- Parser.prototype.parseClassExpression = function () {
- var node = this.createNode();
- var previousStrict = this.context.strict;
- this.context.strict = true;
- this.expectKeyword('class');
- var id = (this.lookahead.type === 3 /* Identifier */) ? this.parseVariableIdentifier() : null;
- var superClass = null;
- if (this.matchKeyword('extends')) {
- this.nextToken();
- superClass = this.isolateCoverGrammar(this.parseLeftHandSideExpressionAllowCall);
- }
- var classBody = this.parseClassBody();
- this.context.strict = previousStrict;
- return this.finalize(node, new Node.ClassExpression(id, superClass, classBody));
- };
- // https://tc39.github.io/ecma262/#sec-scripts
- // https://tc39.github.io/ecma262/#sec-modules
- Parser.prototype.parseModule = function () {
- this.context.strict = true;
- this.context.isModule = true;
- this.scanner.isModule = true;
- var node = this.createNode();
- var body = this.parseDirectivePrologues();
- while (this.lookahead.type !== 2 /* EOF */) {
- body.push(this.parseStatementListItem());
- }
- return this.finalize(node, new Node.Module(body));
- };
- Parser.prototype.parseScript = function () {
- var node = this.createNode();
- var body = this.parseDirectivePrologues();
- while (this.lookahead.type !== 2 /* EOF */) {
- body.push(this.parseStatementListItem());
- }
- return this.finalize(node, new Node.Script(body));
- };
- // https://tc39.github.io/ecma262/#sec-imports
- Parser.prototype.parseModuleSpecifier = function () {
- var node = this.createNode();
- if (this.lookahead.type !== 8 /* StringLiteral */) {
- this.throwError(messages_1.Messages.InvalidModuleSpecifier);
- }
- var token = this.nextToken();
- var raw = this.getTokenRaw(token);
- return this.finalize(node, new Node.Literal(token.value, raw));
- };
- // import {<foo as bar>} ...;
- Parser.prototype.parseImportSpecifier = function () {
- var node = this.createNode();
- var imported;
- var local;
- if (this.lookahead.type === 3 /* Identifier */) {
- imported = this.parseVariableIdentifier();
- local = imported;
- if (this.matchContextualKeyword('as')) {
- this.nextToken();
- local = this.parseVariableIdentifier();
- }
- }
- else {
- imported = this.parseIdentifierName();
- local = imported;
- if (this.matchContextualKeyword('as')) {
- this.nextToken();
- local = this.parseVariableIdentifier();
- }
- else {
- this.throwUnexpectedToken(this.nextToken());
- }
- }
- return this.finalize(node, new Node.ImportSpecifier(local, imported));
- };
- // {foo, bar as bas}
- Parser.prototype.parseNamedImports = function () {
- this.expect('{');
- var specifiers = [];
- while (!this.match('}')) {
- specifiers.push(this.parseImportSpecifier());
- if (!this.match('}')) {
- this.expect(',');
- }
- }
- this.expect('}');
- return specifiers;
- };
- // import <foo> ...;
- Parser.prototype.parseImportDefaultSpecifier = function () {
- var node = this.createNode();
- var local = this.parseIdentifierName();
- return this.finalize(node, new Node.ImportDefaultSpecifier(local));
- };
- // import <* as foo> ...;
- Parser.prototype.parseImportNamespaceSpecifier = function () {
- var node = this.createNode();
- this.expect('*');
- if (!this.matchContextualKeyword('as')) {
- this.throwError(messages_1.Messages.NoAsAfterImportNamespace);
- }
- this.nextToken();
- var local = this.parseIdentifierName();
- return this.finalize(node, new Node.ImportNamespaceSpecifier(local));
- };
- Parser.prototype.parseImportDeclaration = function () {
- if (this.context.inFunctionBody) {
- this.throwError(messages_1.Messages.IllegalImportDeclaration);
- }
- var node = this.createNode();
- this.expectKeyword('import');
- var src;
- var specifiers = [];
- if (this.lookahead.type === 8 /* StringLiteral */) {
- // import 'foo';
- src = this.parseModuleSpecifier();
- }
- else {
- if (this.match('{')) {
- // import {bar}
- specifiers = specifiers.concat(this.parseNamedImports());
- }
- else if (this.match('*')) {
- // import * as foo
- specifiers.push(this.parseImportNamespaceSpecifier());
- }
- else if (this.isIdentifierName(this.lookahead) && !this.matchKeyword('default')) {
- // import foo
- specifiers.push(this.parseImportDefaultSpecifier());
- if (this.match(',')) {
- this.nextToken();
- if (this.match('*')) {
- // import foo, * as foo
- specifiers.push(this.parseImportNamespaceSpecifier());
- }
- else if (this.match('{')) {
- // import foo, {bar}
- specifiers = specifiers.concat(this.parseNamedImports());
- }
- else {
- this.throwUnexpectedToken(this.lookahead);
- }
- }
- }
- else {
- this.throwUnexpectedToken(this.nextToken());
- }
- if (!this.matchContextualKeyword('from')) {
- var message = this.lookahead.value ? messages_1.Messages.UnexpectedToken : messages_1.Messages.MissingFromClause;
- this.throwError(message, this.lookahead.value);
- }
- this.nextToken();
- src = this.parseModuleSpecifier();
- }
- this.consumeSemicolon();
- return this.finalize(node, new Node.ImportDeclaration(specifiers, src));
- };
- // https://tc39.github.io/ecma262/#sec-exports
- Parser.prototype.parseExportSpecifier = function () {
- var node = this.createNode();
- var local = this.parseIdentifierName();
- var exported = local;
- if (this.matchContextualKeyword('as')) {
- this.nextToken();
- exported = this.parseIdentifierName();
- }
- return this.finalize(node, new Node.ExportSpecifier(local, exported));
- };
- Parser.prototype.parseExportDeclaration = function () {
- if (this.context.inFunctionBody) {
- this.throwError(messages_1.Messages.IllegalExportDeclaration);
- }
- var node = this.createNode();
- this.expectKeyword('export');
- var exportDeclaration;
- if (this.matchKeyword('default')) {
- // export default ...
- this.nextToken();
- if (this.matchKeyword('function')) {
- // export default function foo () {}
- // export default function () {}
- var declaration = this.parseFunctionDeclaration(true);
- exportDeclaration = this.finalize(node, new Node.ExportDefaultDeclaration(declaration));
- }
- else if (this.matchKeyword('class')) {
- // export default class foo {}
- var declaration = this.parseClassDeclaration(true);
- exportDeclaration = this.finalize(node, new Node.ExportDefaultDeclaration(declaration));
- }
- else if (this.matchContextualKeyword('async')) {
- // export default async function f () {}
- // export default async function () {}
- // export default async x => x
- var declaration = this.matchAsyncFunction() ? this.parseFunctionDeclaration(true) : this.parseAssignmentExpression();
- exportDeclaration = this.finalize(node, new Node.ExportDefaultDeclaration(declaration));
- }
- else {
- if (this.matchContextualKeyword('from')) {
- this.throwError(messages_1.Messages.UnexpectedToken, this.lookahead.value);
- }
- // export default {};
- // export default [];
- // export default (1 + 2);
- var declaration = this.match('{') ? this.parseObjectInitializer() :
- this.match('[') ? this.parseArrayInitializer() : this.parseAssignmentExpression();
- this.consumeSemicolon();
- exportDeclaration = this.finalize(node, new Node.ExportDefaultDeclaration(declaration));
- }
- }
- else if (this.match('*')) {
- // export * from 'foo';
- this.nextToken();
- if (!this.matchContextualKeyword('from')) {
- var message = this.lookahead.value ? messages_1.Messages.UnexpectedToken : messages_1.Messages.MissingFromClause;
- this.throwError(message, this.lookahead.value);
- }
- this.nextToken();
- var src = this.parseModuleSpecifier();
- this.consumeSemicolon();
- exportDeclaration = this.finalize(node, new Node.ExportAllDeclaration(src));
- }
- else if (this.lookahead.type === 4 /* Keyword */) {
- // export var f = 1;
- var declaration = void 0;
- switch (this.lookahead.value) {
- case 'let':
- case 'const':
- declaration = this.parseLexicalDeclaration({ inFor: false });
- break;
- case 'var':
- case 'class':
- case 'function':
- declaration = this.parseStatementListItem();
- break;
- default:
- this.throwUnexpectedToken(this.lookahead);
- }
- exportDeclaration = this.finalize(node, new Node.ExportNamedDeclaration(declaration, [], null));
- }
- else if (this.matchAsyncFunction()) {
- var declaration = this.parseFunctionDeclaration();
- exportDeclaration = this.finalize(node, new Node.ExportNamedDeclaration(declaration, [], null));
- }
- else {
- var specifiers = [];
- var source = null;
- var isExportFromIdentifier = false;
- this.expect('{');
- while (!this.match('}')) {
- isExportFromIdentifier = isExportFromIdentifier || this.matchKeyword('default');
- specifiers.push(this.parseExportSpecifier());
- if (!this.match('}')) {
- this.expect(',');
- }
- }
- this.expect('}');
- if (this.matchContextualKeyword('from')) {
- // export {default} from 'foo';
- // export {foo} from 'foo';
- this.nextToken();
- source = this.parseModuleSpecifier();
- this.consumeSemicolon();
- }
- else if (isExportFromIdentifier) {
- // export {default}; // missing fromClause
- var message = this.lookahead.value ? messages_1.Messages.UnexpectedToken : messages_1.Messages.MissingFromClause;
- this.throwError(message, this.lookahead.value);
- }
- else {
- // export {foo};
- this.consumeSemicolon();
- }
- exportDeclaration = this.finalize(node, new Node.ExportNamedDeclaration(null, specifiers, source));
- }
- return exportDeclaration;
- };
- return Parser;
- }());
- exports.Parser = Parser;
-
-
-/***/ },
-/* 9 */
-/***/ function(module, exports) {
-
- "use strict";
- // Ensure the condition is true, otherwise throw an error.
- // This is only to have a better contract semantic, i.e. another safety net
- // to catch a logic error. The condition shall be fulfilled in normal case.
- // Do NOT use this to enforce a certain condition on any user input.
- Object.defineProperty(exports, "__esModule", { value: true });
- function assert(condition, message) {
- /* istanbul ignore if */
- if (!condition) {
- throw new Error('ASSERT: ' + message);
- }
- }
- exports.assert = assert;
-
-
-/***/ },
-/* 10 */
-/***/ function(module, exports) {
-
- "use strict";
- /* tslint:disable:max-classes-per-file */
- Object.defineProperty(exports, "__esModule", { value: true });
- var ErrorHandler = (function () {
- function ErrorHandler() {
- this.errors = [];
- this.tolerant = false;
- }
- ErrorHandler.prototype.recordError = function (error) {
- this.errors.push(error);
- };
- ErrorHandler.prototype.tolerate = function (error) {
- if (this.tolerant) {
- this.recordError(error);
- }
- else {
- throw error;
- }
- };
- ErrorHandler.prototype.constructError = function (msg, column) {
- var error = new Error(msg);
- try {
- throw error;
- }
- catch (base) {
- /* istanbul ignore else */
- if (Object.create && Object.defineProperty) {
- error = Object.create(base);
- Object.defineProperty(error, 'column', { value: column });
- }
- }
- /* istanbul ignore next */
- return error;
- };
- ErrorHandler.prototype.createError = function (index, line, col, description) {
- var msg = 'Line ' + line + ': ' + description;
- var error = this.constructError(msg, col);
- error.index = index;
- error.lineNumber = line;
- error.description = description;
- return error;
- };
- ErrorHandler.prototype.throwError = function (index, line, col, description) {
- throw this.createError(index, line, col, description);
- };
- ErrorHandler.prototype.tolerateError = function (index, line, col, description) {
- var error = this.createError(index, line, col, description);
- if (this.tolerant) {
- this.recordError(error);
- }
- else {
- throw error;
- }
- };
- return ErrorHandler;
- }());
- exports.ErrorHandler = ErrorHandler;
-
-
-/***/ },
-/* 11 */
-/***/ function(module, exports) {
-
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- // Error messages should be identical to V8.
- exports.Messages = {
- BadGetterArity: 'Getter must not have any formal parameters',
- BadSetterArity: 'Setter must have exactly one formal parameter',
- BadSetterRestParameter: 'Setter function argument must not be a rest parameter',
- ConstructorIsAsync: 'Class constructor may not be an async method',
- ConstructorSpecialMethod: 'Class constructor may not be an accessor',
- DeclarationMissingInitializer: 'Missing initializer in %0 declaration',
- DefaultRestParameter: 'Unexpected token =',
- DuplicateBinding: 'Duplicate binding %0',
- DuplicateConstructor: 'A class may only have one constructor',
- DuplicateProtoProperty: 'Duplicate __proto__ fields are not allowed in object literals',
- ForInOfLoopInitializer: '%0 loop variable declaration may not have an initializer',
- GeneratorInLegacyContext: 'Generator declarations are not allowed in legacy contexts',
- IllegalBreak: 'Illegal break statement',
- IllegalContinue: 'Illegal continue statement',
- IllegalExportDeclaration: 'Unexpected token',
- IllegalImportDeclaration: 'Unexpected token',
- IllegalLanguageModeDirective: 'Illegal \'use strict\' directive in function with non-simple parameter list',
- IllegalReturn: 'Illegal return statement',
- InvalidEscapedReservedWord: 'Keyword must not contain escaped characters',
- InvalidHexEscapeSequence: 'Invalid hexadecimal escape sequence',
- InvalidLHSInAssignment: 'Invalid left-hand side in assignment',
- InvalidLHSInForIn: 'Invalid left-hand side in for-in',
- InvalidLHSInForLoop: 'Invalid left-hand side in for-loop',
- InvalidModuleSpecifier: 'Unexpected token',
- InvalidRegExp: 'Invalid regular expression',
- LetInLexicalBinding: 'let is disallowed as a lexically bound name',
- MissingFromClause: 'Unexpected token',
- MultipleDefaultsInSwitch: 'More than one default clause in switch statement',
- NewlineAfterThrow: 'Illegal newline after throw',
- NoAsAfterImportNamespace: 'Unexpected token',
- NoCatchOrFinally: 'Missing catch or finally after try',
- ParameterAfterRestParameter: 'Rest parameter must be last formal parameter',
- Redeclaration: '%0 \'%1\' has already been declared',
- StaticPrototype: 'Classes may not have static property named prototype',
- StrictCatchVariable: 'Catch variable may not be eval or arguments in strict mode',
- StrictDelete: 'Delete of an unqualified identifier in strict mode.',
- StrictFunction: 'In strict mode code, functions can only be declared at top level or inside a block',
- StrictFunctionName: 'Function name may not be eval or arguments in strict mode',
- StrictLHSAssignment: 'Assignment to eval or arguments is not allowed in strict mode',
- StrictLHSPostfix: 'Postfix increment/decrement may not have eval or arguments operand in strict mode',
- StrictLHSPrefix: 'Prefix increment/decrement may not have eval or arguments operand in strict mode',
- StrictModeWith: 'Strict mode code may not include a with statement',
- StrictOctalLiteral: 'Octal literals are not allowed in strict mode.',
- StrictParamDupe: 'Strict mode function may not have duplicate parameter names',
- StrictParamName: 'Parameter name eval or arguments is not allowed in strict mode',
- StrictReservedWord: 'Use of future reserved word in strict mode',
- StrictVarName: 'Variable name may not be eval or arguments in strict mode',
- TemplateOctalLiteral: 'Octal literals are not allowed in template strings.',
- UnexpectedEOS: 'Unexpected end of input',
- UnexpectedIdentifier: 'Unexpected identifier',
- UnexpectedNumber: 'Unexpected number',
- UnexpectedReserved: 'Unexpected reserved word',
- UnexpectedString: 'Unexpected string',
- UnexpectedTemplate: 'Unexpected quasi %0',
- UnexpectedToken: 'Unexpected token %0',
- UnexpectedTokenIllegal: 'Unexpected token ILLEGAL',
- UnknownLabel: 'Undefined label \'%0\'',
- UnterminatedRegExp: 'Invalid regular expression: missing /'
- };
-
-
-/***/ },
-/* 12 */
-/***/ function(module, exports, __webpack_require__) {
-
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- var assert_1 = __webpack_require__(9);
- var character_1 = __webpack_require__(4);
- var messages_1 = __webpack_require__(11);
- function hexValue(ch) {
- return '0123456789abcdef'.indexOf(ch.toLowerCase());
- }
- function octalValue(ch) {
- return '01234567'.indexOf(ch);
- }
- var Scanner = (function () {
- function Scanner(code, handler) {
- this.source = code;
- this.errorHandler = handler;
- this.trackComment = false;
- this.isModule = false;
- this.length = code.length;
- this.index = 0;
- this.lineNumber = (code.length > 0) ? 1 : 0;
- this.lineStart = 0;
- this.curlyStack = [];
- }
- Scanner.prototype.saveState = function () {
- return {
- index: this.index,
- lineNumber: this.lineNumber,
- lineStart: this.lineStart
- };
- };
- Scanner.prototype.restoreState = function (state) {
- this.index = state.index;
- this.lineNumber = state.lineNumber;
- this.lineStart = state.lineStart;
- };
- Scanner.prototype.eof = function () {
- return this.index >= this.length;
- };
- Scanner.prototype.throwUnexpectedToken = function (message) {
- if (message === void 0) { message = messages_1.Messages.UnexpectedTokenIllegal; }
- return this.errorHandler.throwError(this.index, this.lineNumber, this.index - this.lineStart + 1, message);
- };
- Scanner.prototype.tolerateUnexpectedToken = function (message) {
- if (message === void 0) { message = messages_1.Messages.UnexpectedTokenIllegal; }
- this.errorHandler.tolerateError(this.index, this.lineNumber, this.index - this.lineStart + 1, message);
- };
- // https://tc39.github.io/ecma262/#sec-comments
- Scanner.prototype.skipSingleLineComment = function (offset) {
- var comments = [];
- var start, loc;
- if (this.trackComment) {
- comments = [];
- start = this.index - offset;
- loc = {
- start: {
- line: this.lineNumber,
- column: this.index - this.lineStart - offset
- },
- end: {}
- };
- }
- while (!this.eof()) {
- var ch = this.source.charCodeAt(this.index);
- ++this.index;
- if (character_1.Character.isLineTerminator(ch)) {
- if (this.trackComment) {
- loc.end = {
- line: this.lineNumber,
- column: this.index - this.lineStart - 1
- };
- var entry = {
- multiLine: false,
- slice: [start + offset, this.index - 1],
- range: [start, this.index - 1],
- loc: loc
- };
- comments.push(entry);
- }
- if (ch === 13 && this.source.charCodeAt(this.index) === 10) {
- ++this.index;
- }
- ++this.lineNumber;
- this.lineStart = this.index;
- return comments;
- }
- }
- if (this.trackComment) {
- loc.end = {
- line: this.lineNumber,
- column: this.index - this.lineStart
- };
- var entry = {
- multiLine: false,
- slice: [start + offset, this.index],
- range: [start, this.index],
- loc: loc
- };
- comments.push(entry);
- }
- return comments;
- };
- Scanner.prototype.skipMultiLineComment = function () {
- var comments = [];
- var start, loc;
- if (this.trackComment) {
- comments = [];
- start = this.index - 2;
- loc = {
- start: {
- line: this.lineNumber,
- column: this.index - this.lineStart - 2
- },
- end: {}
- };
- }
- while (!this.eof()) {
- var ch = this.source.charCodeAt(this.index);
- if (character_1.Character.isLineTerminator(ch)) {
- if (ch === 0x0D && this.source.charCodeAt(this.index + 1) === 0x0A) {
- ++this.index;
- }
- ++this.lineNumber;
- ++this.index;
- this.lineStart = this.index;
- }
- else if (ch === 0x2A) {
- // Block comment ends with '*/'.
- if (this.source.charCodeAt(this.index + 1) === 0x2F) {
- this.index += 2;
- if (this.trackComment) {
- loc.end = {
- line: this.lineNumber,
- column: this.index - this.lineStart
- };
- var entry = {
- multiLine: true,
- slice: [start + 2, this.index - 2],
- range: [start, this.index],
- loc: loc
- };
- comments.push(entry);
- }
- return comments;
- }
- ++this.index;
- }
- else {
- ++this.index;
- }
- }
- // Ran off the end of the file - the whole thing is a comment
- if (this.trackComment) {
- loc.end = {
- line: this.lineNumber,
- column: this.index - this.lineStart
- };
- var entry = {
- multiLine: true,
- slice: [start + 2, this.index],
- range: [start, this.index],
- loc: loc
- };
- comments.push(entry);
- }
- this.tolerateUnexpectedToken();
- return comments;
- };
- Scanner.prototype.scanComments = function () {
- var comments;
- if (this.trackComment) {
- comments = [];
- }
- var start = (this.index === 0);
- while (!this.eof()) {
- var ch = this.source.charCodeAt(this.index);
- if (character_1.Character.isWhiteSpace(ch)) {
- ++this.index;
- }
- else if (character_1.Character.isLineTerminator(ch)) {
- ++this.index;
- if (ch === 0x0D && this.source.charCodeAt(this.index) === 0x0A) {
- ++this.index;
- }
- ++this.lineNumber;
- this.lineStart = this.index;
- start = true;
- }
- else if (ch === 0x2F) {
- ch = this.source.charCodeAt(this.index + 1);
- if (ch === 0x2F) {
- this.index += 2;
- var comment = this.skipSingleLineComment(2);
- if (this.trackComment) {
- comments = comments.concat(comment);
- }
- start = true;
- }
- else if (ch === 0x2A) {
- this.index += 2;
- var comment = this.skipMultiLineComment();
- if (this.trackComment) {
- comments = comments.concat(comment);
- }
- }
- else {
- break;
- }
- }
- else if (start && ch === 0x2D) {
- // U+003E is '>'
- if ((this.source.charCodeAt(this.index + 1) === 0x2D) && (this.source.charCodeAt(this.index + 2) === 0x3E)) {
- // '-->' is a single-line comment
- this.index += 3;
- var comment = this.skipSingleLineComment(3);
- if (this.trackComment) {
- comments = comments.concat(comment);
- }
- }
- else {
- break;
- }
- }
- else if (ch === 0x3C && !this.isModule) {
- if (this.source.slice(this.index + 1, this.index + 4) === '!--') {
- this.index += 4; // `<!--`
- var comment = this.skipSingleLineComment(4);
- if (this.trackComment) {
- comments = comments.concat(comment);
- }
- }
- else {
- break;
- }
- }
- else {
- break;
- }
- }
- return comments;
- };
- // https://tc39.github.io/ecma262/#sec-future-reserved-words
- Scanner.prototype.isFutureReservedWord = function (id) {
- switch (id) {
- case 'enum':
- case 'export':
- case 'import':
- case 'super':
- return true;
- default:
- return false;
- }
- };
- Scanner.prototype.isStrictModeReservedWord = function (id) {
- switch (id) {
- case 'implements':
- case 'interface':
- case 'package':
- case 'private':
- case 'protected':
- case 'public':
- case 'static':
- case 'yield':
- case 'let':
- return true;
- default:
- return false;
- }
- };
- Scanner.prototype.isRestrictedWord = function (id) {
- return id === 'eval' || id === 'arguments';
- };
- // https://tc39.github.io/ecma262/#sec-keywords
- Scanner.prototype.isKeyword = function (id) {
- switch (id.length) {
- case 2:
- return (id === 'if') || (id === 'in') || (id === 'do');
- case 3:
- return (id === 'var') || (id === 'for') || (id === 'new') ||
- (id === 'try') || (id === 'let');
- case 4:
- return (id === 'this') || (id === 'else') || (id === 'case') ||
- (id === 'void') || (id === 'with') || (id === 'enum');
- case 5:
- return (id === 'while') || (id === 'break') || (id === 'catch') ||
- (id === 'throw') || (id === 'const') || (id === 'yield') ||
- (id === 'class') || (id === 'super');
- case 6:
- return (id === 'return') || (id === 'typeof') || (id === 'delete') ||
- (id === 'switch') || (id === 'export') || (id === 'import');
- case 7:
- return (id === 'default') || (id === 'finally') || (id === 'extends');
- case 8:
- return (id === 'function') || (id === 'continue') || (id === 'debugger');
- case 10:
- return (id === 'instanceof');
- default:
- return false;
- }
- };
- Scanner.prototype.codePointAt = function (i) {
- var cp = this.source.charCodeAt(i);
- if (cp >= 0xD800 && cp <= 0xDBFF) {
- var second = this.source.charCodeAt(i + 1);
- if (second >= 0xDC00 && second <= 0xDFFF) {
- var first = cp;
- cp = (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000;
- }
- }
- return cp;
- };
- Scanner.prototype.scanHexEscape = function (prefix) {
- var len = (prefix === 'u') ? 4 : 2;
- var code = 0;
- for (var i = 0; i < len; ++i) {
- if (!this.eof() && character_1.Character.isHexDigit(this.source.charCodeAt(this.index))) {
- code = code * 16 + hexValue(this.source[this.index++]);
- }
- else {
- return null;
- }
- }
- return String.fromCharCode(code);
- };
- Scanner.prototype.scanUnicodeCodePointEscape = function () {
- var ch = this.source[this.index];
- var code = 0;
- // At least, one hex digit is required.
- if (ch === '}') {
- this.throwUnexpectedToken();
- }
- while (!this.eof()) {
- ch = this.source[this.index++];
- if (!character_1.Character.isHexDigit(ch.charCodeAt(0))) {
- break;
- }
- code = code * 16 + hexValue(ch);
- }
- if (code > 0x10FFFF || ch !== '}') {
- this.throwUnexpectedToken();
- }
- return character_1.Character.fromCodePoint(code);
- };
- Scanner.prototype.getIdentifier = function () {
- var start = this.index++;
- while (!this.eof()) {
- var ch = this.source.charCodeAt(this.index);
- if (ch === 0x5C) {
- // Blackslash (U+005C) marks Unicode escape sequence.
- this.index = start;
- return this.getComplexIdentifier();
- }
- else if (ch >= 0xD800 && ch < 0xDFFF) {
- // Need to handle surrogate pairs.
- this.index = start;
- return this.getComplexIdentifier();
- }
- if (character_1.Character.isIdentifierPart(ch)) {
- ++this.index;
- }
- else {
- break;
- }
- }
- return this.source.slice(start, this.index);
- };
- Scanner.prototype.getComplexIdentifier = function () {
- var cp = this.codePointAt(this.index);
- var id = character_1.Character.fromCodePoint(cp);
- this.index += id.length;
- // '\u' (U+005C, U+0075) denotes an escaped character.
- var ch;
- if (cp === 0x5C) {
- if (this.source.charCodeAt(this.index) !== 0x75) {
- this.throwUnexpectedToken();
- }
- ++this.index;
- if (this.source[this.index] === '{') {
- ++this.index;
- ch = this.scanUnicodeCodePointEscape();
- }
- else {
- ch = this.scanHexEscape('u');
- if (ch === null || ch === '\\' || !character_1.Character.isIdentifierStart(ch.charCodeAt(0))) {
- this.throwUnexpectedToken();
- }
- }
- id = ch;
- }
- while (!this.eof()) {
- cp = this.codePointAt(this.index);
- if (!character_1.Character.isIdentifierPart(cp)) {
- break;
- }
- ch = character_1.Character.fromCodePoint(cp);
- id += ch;
- this.index += ch.length;
- // '\u' (U+005C, U+0075) denotes an escaped character.
- if (cp === 0x5C) {
- id = id.substr(0, id.length - 1);
- if (this.source.charCodeAt(this.index) !== 0x75) {
- this.throwUnexpectedToken();
- }
- ++this.index;
- if (this.source[this.index] === '{') {
- ++this.index;
- ch = this.scanUnicodeCodePointEscape();
- }
- else {
- ch = this.scanHexEscape('u');
- if (ch === null || ch === '\\' || !character_1.Character.isIdentifierPart(ch.charCodeAt(0))) {
- this.throwUnexpectedToken();
- }
- }
- id += ch;
- }
- }
- return id;
- };
- Scanner.prototype.octalToDecimal = function (ch) {
- // \0 is not octal escape sequence
- var octal = (ch !== '0');
- var code = octalValue(ch);
- if (!this.eof() && character_1.Character.isOctalDigit(this.source.charCodeAt(this.index))) {
- octal = true;
- code = code * 8 + octalValue(this.source[this.index++]);
- // 3 digits are only allowed when string starts
- // with 0, 1, 2, 3
- if ('0123'.indexOf(ch) >= 0 && !this.eof() && character_1.Character.isOctalDigit(this.source.charCodeAt(this.index))) {
- code = code * 8 + octalValue(this.source[this.index++]);
- }
- }
- return {
- code: code,
- octal: octal
- };
- };
- // https://tc39.github.io/ecma262/#sec-names-and-keywords
- Scanner.prototype.scanIdentifier = function () {
- var type;
- var start = this.index;
- // Backslash (U+005C) starts an escaped character.
- var id = (this.source.charCodeAt(start) === 0x5C) ? this.getComplexIdentifier() : this.getIdentifier();
- // There is no keyword or literal with only one character.
- // Thus, it must be an identifier.
- if (id.length === 1) {
- type = 3 /* Identifier */;
- }
- else if (this.isKeyword(id)) {
- type = 4 /* Keyword */;
- }
- else if (id === 'null') {
- type = 5 /* NullLiteral */;
- }
- else if (id === 'true' || id === 'false') {
- type = 1 /* BooleanLiteral */;
- }
- else {
- type = 3 /* Identifier */;
- }
- if (type !== 3 /* Identifier */ && (start + id.length !== this.index)) {
- var restore = this.index;
- this.index = start;
- this.tolerateUnexpectedToken(messages_1.Messages.InvalidEscapedReservedWord);
- this.index = restore;
- }
- return {
- type: type,
- value: id,
- lineNumber: this.lineNumber,
- lineStart: this.lineStart,
- start: start,
- end: this.index
- };
- };
- // https://tc39.github.io/ecma262/#sec-punctuators
- Scanner.prototype.scanPunctuator = function () {
- var start = this.index;
- // Check for most common single-character punctuators.
- var str = this.source[this.index];
- switch (str) {
- case '(':
- case '{':
- if (str === '{') {
- this.curlyStack.push('{');
- }
- ++this.index;
- break;
- case '.':
- ++this.index;
- if (this.source[this.index] === '.' && this.source[this.index + 1] === '.') {
- // Spread operator: ...
- this.index += 2;
- str = '...';
- }
- break;
- case '}':
- ++this.index;
- this.curlyStack.pop();
- break;
- case ')':
- case ';':
- case ',':
- case '[':
- case ']':
- case ':':
- case '?':
- case '~':
- ++this.index;
- break;
- default:
- // 4-character punctuator.
- str = this.source.substr(this.index, 4);
- if (str === '>>>=') {
- this.index += 4;
- }
- else {
- // 3-character punctuators.
- str = str.substr(0, 3);
- if (str === '===' || str === '!==' || str === '>>>' ||
- str === '<<=' || str === '>>=' || str === '**=') {
- this.index += 3;
- }
- else {
- // 2-character punctuators.
- str = str.substr(0, 2);
- if (str === '&&' || str === '||' || str === '==' || str === '!=' ||
- str === '+=' || str === '-=' || str === '*=' || str === '/=' ||
- str === '++' || str === '--' || str === '<<' || str === '>>' ||
- str === '&=' || str === '|=' || str === '^=' || str === '%=' ||
- str === '<=' || str === '>=' || str === '=>' || str === '**') {
- this.index += 2;
- }
- else {
- // 1-character punctuators.
- str = this.source[this.index];
- if ('<>=!+-*%&|^/'.indexOf(str) >= 0) {
- ++this.index;
- }
- }
- }
- }
- }
- if (this.index === start) {
- this.throwUnexpectedToken();
- }
- return {
- type: 7 /* Punctuator */,
- value: str,
- lineNumber: this.lineNumber,
- lineStart: this.lineStart,
- start: start,
- end: this.index
- };
- };
- // https://tc39.github.io/ecma262/#sec-literals-numeric-literals
- Scanner.prototype.scanHexLiteral = function (start) {
- var num = '';
- while (!this.eof()) {
- if (!character_1.Character.isHexDigit(this.source.charCodeAt(this.index))) {
- break;
- }
- num += this.source[this.index++];
- }
- if (num.length === 0) {
- this.throwUnexpectedToken();
- }
- if (character_1.Character.isIdentifierStart(this.source.charCodeAt(this.index))) {
- this.throwUnexpectedToken();
- }
- return {
- type: 6 /* NumericLiteral */,
- value: parseInt('0x' + num, 16),
- lineNumber: this.lineNumber,
- lineStart: this.lineStart,
- start: start,
- end: this.index
- };
- };
- Scanner.prototype.scanBinaryLiteral = function (start) {
- var num = '';
- var ch;
- while (!this.eof()) {
- ch = this.source[this.index];
- if (ch !== '0' && ch !== '1') {
- break;
- }
- num += this.source[this.index++];
- }
- if (num.length === 0) {
- // only 0b or 0B
- this.throwUnexpectedToken();
- }
- if (!this.eof()) {
- ch = this.source.charCodeAt(this.index);
- /* istanbul ignore else */
- if (character_1.Character.isIdentifierStart(ch) || character_1.Character.isDecimalDigit(ch)) {
- this.throwUnexpectedToken();
- }
- }
- return {
- type: 6 /* NumericLiteral */,
- value: parseInt(num, 2),
- lineNumber: this.lineNumber,
- lineStart: this.lineStart,
- start: start,
- end: this.index
- };
- };
- Scanner.prototype.scanOctalLiteral = function (prefix, start) {
- var num = '';
- var octal = false;
- if (character_1.Character.isOctalDigit(prefix.charCodeAt(0))) {
- octal = true;
- num = '0' + this.source[this.index++];
- }
- else {
- ++this.index;
- }
- while (!this.eof()) {
- if (!character_1.Character.isOctalDigit(this.source.charCodeAt(this.index))) {
- break;
- }
- num += this.source[this.index++];
- }
- if (!octal && num.length === 0) {
- // only 0o or 0O
- this.throwUnexpectedToken();
- }
- if (character_1.Character.isIdentifierStart(this.source.charCodeAt(this.index)) || character_1.Character.isDecimalDigit(this.source.charCodeAt(this.index))) {
- this.throwUnexpectedToken();
- }
- return {
- type: 6 /* NumericLiteral */,
- value: parseInt(num, 8),
- octal: octal,
- lineNumber: this.lineNumber,
- lineStart: this.lineStart,
- start: start,
- end: this.index
- };
- };
- Scanner.prototype.isImplicitOctalLiteral = function () {
- // Implicit octal, unless there is a non-octal digit.
- // (Annex B.1.1 on Numeric Literals)
- for (var i = this.index + 1; i < this.length; ++i) {
- var ch = this.source[i];
- if (ch === '8' || ch === '9') {
- return false;
- }
- if (!character_1.Character.isOctalDigit(ch.charCodeAt(0))) {
- return true;
- }
- }
- return true;
- };
- Scanner.prototype.scanNumericLiteral = function () {
- var start = this.index;
- var ch = this.source[start];
- assert_1.assert(character_1.Character.isDecimalDigit(ch.charCodeAt(0)) || (ch === '.'), 'Numeric literal must start with a decimal digit or a decimal point');
- var num = '';
- if (ch !== '.') {
- num = this.source[this.index++];
- ch = this.source[this.index];
- // Hex number starts with '0x'.
- // Octal number starts with '0'.
- // Octal number in ES6 starts with '0o'.
- // Binary number in ES6 starts with '0b'.
- if (num === '0') {
- if (ch === 'x' || ch === 'X') {
- ++this.index;
- return this.scanHexLiteral(start);
- }
- if (ch === 'b' || ch === 'B') {
- ++this.index;
- return this.scanBinaryLiteral(start);
- }
- if (ch === 'o' || ch === 'O') {
- return this.scanOctalLiteral(ch, start);
- }
- if (ch && character_1.Character.isOctalDigit(ch.charCodeAt(0))) {
- if (this.isImplicitOctalLiteral()) {
- return this.scanOctalLiteral(ch, start);
- }
- }
- }
- while (character_1.Character.isDecimalDigit(this.source.charCodeAt(this.index))) {
- num += this.source[this.index++];
- }
- ch = this.source[this.index];
- }
- if (ch === '.') {
- num += this.source[this.index++];
- while (character_1.Character.isDecimalDigit(this.source.charCodeAt(this.index))) {
- num += this.source[this.index++];
- }
- ch = this.source[this.index];
- }
- if (ch === 'e' || ch === 'E') {
- num += this.source[this.index++];
- ch = this.source[this.index];
- if (ch === '+' || ch === '-') {
- num += this.source[this.index++];
- }
- if (character_1.Character.isDecimalDigit(this.source.charCodeAt(this.index))) {
- while (character_1.Character.isDecimalDigit(this.source.charCodeAt(this.index))) {
- num += this.source[this.index++];
- }
- }
- else {
- this.throwUnexpectedToken();
- }
- }
- if (character_1.Character.isIdentifierStart(this.source.charCodeAt(this.index))) {
- this.throwUnexpectedToken();
- }
- return {
- type: 6 /* NumericLiteral */,
- value: parseFloat(num),
- lineNumber: this.lineNumber,
- lineStart: this.lineStart,
- start: start,
- end: this.index
- };
- };
- // https://tc39.github.io/ecma262/#sec-literals-string-literals
- Scanner.prototype.scanStringLiteral = function () {
- var start = this.index;
- var quote = this.source[start];
- assert_1.assert((quote === '\'' || quote === '"'), 'String literal must starts with a quote');
- ++this.index;
- var octal = false;
- var str = '';
- while (!this.eof()) {
- var ch = this.source[this.index++];
- if (ch === quote) {
- quote = '';
- break;
- }
- else if (ch === '\\') {
- ch = this.source[this.index++];
- if (!ch || !character_1.Character.isLineTerminator(ch.charCodeAt(0))) {
- switch (ch) {
- case 'u':
- if (this.source[this.index] === '{') {
- ++this.index;
- str += this.scanUnicodeCodePointEscape();
- }
- else {
- var unescaped_1 = this.scanHexEscape(ch);
- if (unescaped_1 === null) {
- this.throwUnexpectedToken();
- }
- str += unescaped_1;
- }
- break;
- case 'x':
- var unescaped = this.scanHexEscape(ch);
- if (unescaped === null) {
- this.throwUnexpectedToken(messages_1.Messages.InvalidHexEscapeSequence);
- }
- str += unescaped;
- break;
- case 'n':
- str += '\n';
- break;
- case 'r':
- str += '\r';
- break;
- case 't':
- str += '\t';
- break;
- case 'b':
- str += '\b';
- break;
- case 'f':
- str += '\f';
- break;
- case 'v':
- str += '\x0B';
- break;
- case '8':
- case '9':
- str += ch;
- this.tolerateUnexpectedToken();
- break;
- default:
- if (ch && character_1.Character.isOctalDigit(ch.charCodeAt(0))) {
- var octToDec = this.octalToDecimal(ch);
- octal = octToDec.octal || octal;
- str += String.fromCharCode(octToDec.code);
- }
- else {
- str += ch;
- }
- break;
- }
- }
- else {
- ++this.lineNumber;
- if (ch === '\r' && this.source[this.index] === '\n') {
- ++this.index;
- }
- this.lineStart = this.index;
- }
- }
- else if (character_1.Character.isLineTerminator(ch.charCodeAt(0))) {
- break;
- }
- else {
- str += ch;
- }
- }
- if (quote !== '') {
- this.index = start;
- this.throwUnexpectedToken();
- }
- return {
- type: 8 /* StringLiteral */,
- value: str,
- octal: octal,
- lineNumber: this.lineNumber,
- lineStart: this.lineStart,
- start: start,
- end: this.index
- };
- };
- // https://tc39.github.io/ecma262/#sec-template-literal-lexical-components
- Scanner.prototype.scanTemplate = function () {
- var cooked = '';
- var terminated = false;
- var start = this.index;
- var head = (this.source[start] === '`');
- var tail = false;
- var rawOffset = 2;
- ++this.index;
- while (!this.eof()) {
- var ch = this.source[this.index++];
- if (ch === '`') {
- rawOffset = 1;
- tail = true;
- terminated = true;
- break;
- }
- else if (ch === '$') {
- if (this.source[this.index] === '{') {
- this.curlyStack.push('${');
- ++this.index;
- terminated = true;
- break;
- }
- cooked += ch;
- }
- else if (ch === '\\') {
- ch = this.source[this.index++];
- if (!character_1.Character.isLineTerminator(ch.charCodeAt(0))) {
- switch (ch) {
- case 'n':
- cooked += '\n';
- break;
- case 'r':
- cooked += '\r';
- break;
- case 't':
- cooked += '\t';
- break;
- case 'u':
- if (this.source[this.index] === '{') {
- ++this.index;
- cooked += this.scanUnicodeCodePointEscape();
- }
- else {
- var restore = this.index;
- var unescaped_2 = this.scanHexEscape(ch);
- if (unescaped_2 !== null) {
- cooked += unescaped_2;
- }
- else {
- this.index = restore;
- cooked += ch;
- }
- }
- break;
- case 'x':
- var unescaped = this.scanHexEscape(ch);
- if (unescaped === null) {
- this.throwUnexpectedToken(messages_1.Messages.InvalidHexEscapeSequence);
- }
- cooked += unescaped;
- break;
- case 'b':
- cooked += '\b';
- break;
- case 'f':
- cooked += '\f';
- break;
- case 'v':
- cooked += '\v';
- break;
- default:
- if (ch === '0') {
- if (character_1.Character.isDecimalDigit(this.source.charCodeAt(this.index))) {
- // Illegal: \01 \02 and so on
- this.throwUnexpectedToken(messages_1.Messages.TemplateOctalLiteral);
- }
- cooked += '\0';
- }
- else if (character_1.Character.isOctalDigit(ch.charCodeAt(0))) {
- // Illegal: \1 \2
- this.throwUnexpectedToken(messages_1.Messages.TemplateOctalLiteral);
- }
- else {
- cooked += ch;
- }
- break;
- }
- }
- else {
- ++this.lineNumber;
- if (ch === '\r' && this.source[this.index] === '\n') {
- ++this.index;
- }
- this.lineStart = this.index;
- }
- }
- else if (character_1.Character.isLineTerminator(ch.charCodeAt(0))) {
- ++this.lineNumber;
- if (ch === '\r' && this.source[this.index] === '\n') {
- ++this.index;
- }
- this.lineStart = this.index;
- cooked += '\n';
- }
- else {
- cooked += ch;
- }
- }
- if (!terminated) {
- this.throwUnexpectedToken();
- }
- if (!head) {
- this.curlyStack.pop();
- }
- return {
- type: 10 /* Template */,
- value: this.source.slice(start + 1, this.index - rawOffset),
- cooked: cooked,
- head: head,
- tail: tail,
- lineNumber: this.lineNumber,
- lineStart: this.lineStart,
- start: start,
- end: this.index
- };
- };
- // https://tc39.github.io/ecma262/#sec-literals-regular-expression-literals
- Scanner.prototype.testRegExp = function (pattern, flags) {
- // The BMP character to use as a replacement for astral symbols when
- // translating an ES6 "u"-flagged pattern to an ES5-compatible
- // approximation.
- // Note: replacing with '\uFFFF' enables false positives in unlikely
- // scenarios. For example, `[\u{1044f}-\u{10440}]` is an invalid
- // pattern that would not be detected by this substitution.
- var astralSubstitute = '\uFFFF';
- var tmp = pattern;
- var self = this;
- if (flags.indexOf('u') >= 0) {
- tmp = tmp
- .replace(/\\u\{([0-9a-fA-F]+)\}|\\u([a-fA-F0-9]{4})/g, function ($0, $1, $2) {
- var codePoint = parseInt($1 || $2, 16);
- if (codePoint > 0x10FFFF) {
- self.throwUnexpectedToken(messages_1.Messages.InvalidRegExp);
- }
- if (codePoint <= 0xFFFF) {
- return String.fromCharCode(codePoint);
- }
- return astralSubstitute;
- })
- .replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g, astralSubstitute);
- }
- // First, detect invalid regular expressions.
- try {
- RegExp(tmp);
- }
- catch (e) {
- this.throwUnexpectedToken(messages_1.Messages.InvalidRegExp);
- }
- // Return a regular expression object for this pattern-flag pair, or
- // `null` in case the current environment doesn't support the flags it
- // uses.
- try {
- return new RegExp(pattern, flags);
- }
- catch (exception) {
- /* istanbul ignore next */
- return null;
- }
- };
- Scanner.prototype.scanRegExpBody = function () {
- var ch = this.source[this.index];
- assert_1.assert(ch === '/', 'Regular expression literal must start with a slash');
- var str = this.source[this.index++];
- var classMarker = false;
- var terminated = false;
- while (!this.eof()) {
- ch = this.source[this.index++];
- str += ch;
- if (ch === '\\') {
- ch = this.source[this.index++];
- // https://tc39.github.io/ecma262/#sec-literals-regular-expression-literals
- if (character_1.Character.isLineTerminator(ch.charCodeAt(0))) {
- this.throwUnexpectedToken(messages_1.Messages.UnterminatedRegExp);
- }
- str += ch;
- }
- else if (character_1.Character.isLineTerminator(ch.charCodeAt(0))) {
- this.throwUnexpectedToken(messages_1.Messages.UnterminatedRegExp);
- }
- else if (classMarker) {
- if (ch === ']') {
- classMarker = false;
- }
- }
- else {
- if (ch === '/') {
- terminated = true;
- break;
- }
- else if (ch === '[') {
- classMarker = true;
- }
- }
- }
- if (!terminated) {
- this.throwUnexpectedToken(messages_1.Messages.UnterminatedRegExp);
- }
- // Exclude leading and trailing slash.
- return str.substr(1, str.length - 2);
- };
- Scanner.prototype.scanRegExpFlags = function () {
- var str = '';
- var flags = '';
- while (!this.eof()) {
- var ch = this.source[this.index];
- if (!character_1.Character.isIdentifierPart(ch.charCodeAt(0))) {
- break;
- }
- ++this.index;
- if (ch === '\\' && !this.eof()) {
- ch = this.source[this.index];
- if (ch === 'u') {
- ++this.index;
- var restore = this.index;
- var char = this.scanHexEscape('u');
- if (char !== null) {
- flags += char;
- for (str += '\\u'; restore < this.index; ++restore) {
- str += this.source[restore];
- }
- }
- else {
- this.index = restore;
- flags += 'u';
- str += '\\u';
- }
- this.tolerateUnexpectedToken();
- }
- else {
- str += '\\';
- this.tolerateUnexpectedToken();
- }
- }
- else {
- flags += ch;
- str += ch;
- }
- }
- return flags;
- };
- Scanner.prototype.scanRegExp = function () {
- var start = this.index;
- var pattern = this.scanRegExpBody();
- var flags = this.scanRegExpFlags();
- var value = this.testRegExp(pattern, flags);
- return {
- type: 9 /* RegularExpression */,
- value: '',
- pattern: pattern,
- flags: flags,
- regex: value,
- lineNumber: this.lineNumber,
- lineStart: this.lineStart,
- start: start,
- end: this.index
- };
- };
- Scanner.prototype.lex = function () {
- if (this.eof()) {
- return {
- type: 2 /* EOF */,
- value: '',
- lineNumber: this.lineNumber,
- lineStart: this.lineStart,
- start: this.index,
- end: this.index
- };
- }
- var cp = this.source.charCodeAt(this.index);
- if (character_1.Character.isIdentifierStart(cp)) {
- return this.scanIdentifier();
- }
- // Very common: ( and ) and ;
- if (cp === 0x28 || cp === 0x29 || cp === 0x3B) {
- return this.scanPunctuator();
- }
- // String literal starts with single quote (U+0027) or double quote (U+0022).
- if (cp === 0x27 || cp === 0x22) {
- return this.scanStringLiteral();
- }
- // Dot (.) U+002E can also start a floating-point number, hence the need
- // to check the next character.
- if (cp === 0x2E) {
- if (character_1.Character.isDecimalDigit(this.source.charCodeAt(this.index + 1))) {
- return this.scanNumericLiteral();
- }
- return this.scanPunctuator();
- }
- if (character_1.Character.isDecimalDigit(cp)) {
- return this.scanNumericLiteral();
- }
- // Template literals start with ` (U+0060) for template head
- // or } (U+007D) for template middle or template tail.
- if (cp === 0x60 || (cp === 0x7D && this.curlyStack[this.curlyStack.length - 1] === '${')) {
- return this.scanTemplate();
- }
- // Possible identifier start in a surrogate pair.
- if (cp >= 0xD800 && cp < 0xDFFF) {
- if (character_1.Character.isIdentifierStart(this.codePointAt(this.index))) {
- return this.scanIdentifier();
- }
- }
- return this.scanPunctuator();
- };
- return Scanner;
- }());
- exports.Scanner = Scanner;
-
-
-/***/ },
-/* 13 */
-/***/ function(module, exports) {
-
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.TokenName = {};
- exports.TokenName[1 /* BooleanLiteral */] = 'Boolean';
- exports.TokenName[2 /* EOF */] = '<end>';
- exports.TokenName[3 /* Identifier */] = 'Identifier';
- exports.TokenName[4 /* Keyword */] = 'Keyword';
- exports.TokenName[5 /* NullLiteral */] = 'Null';
- exports.TokenName[6 /* NumericLiteral */] = 'Numeric';
- exports.TokenName[7 /* Punctuator */] = 'Punctuator';
- exports.TokenName[8 /* StringLiteral */] = 'String';
- exports.TokenName[9 /* RegularExpression */] = 'RegularExpression';
- exports.TokenName[10 /* Template */] = 'Template';
-
-
-/***/ },
-/* 14 */
-/***/ function(module, exports) {
-
- "use strict";
- // Generated by generate-xhtml-entities.js. DO NOT MODIFY!
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.XHTMLEntities = {
- quot: '\u0022',
- amp: '\u0026',
- apos: '\u0027',
- gt: '\u003E',
- nbsp: '\u00A0',
- iexcl: '\u00A1',
- cent: '\u00A2',
- pound: '\u00A3',
- curren: '\u00A4',
- yen: '\u00A5',
- brvbar: '\u00A6',
- sect: '\u00A7',
- uml: '\u00A8',
- copy: '\u00A9',
- ordf: '\u00AA',
- laquo: '\u00AB',
- not: '\u00AC',
- shy: '\u00AD',
- reg: '\u00AE',
- macr: '\u00AF',
- deg: '\u00B0',
- plusmn: '\u00B1',
- sup2: '\u00B2',
- sup3: '\u00B3',
- acute: '\u00B4',
- micro: '\u00B5',
- para: '\u00B6',
- middot: '\u00B7',
- cedil: '\u00B8',
- sup1: '\u00B9',
- ordm: '\u00BA',
- raquo: '\u00BB',
- frac14: '\u00BC',
- frac12: '\u00BD',
- frac34: '\u00BE',
- iquest: '\u00BF',
- Agrave: '\u00C0',
- Aacute: '\u00C1',
- Acirc: '\u00C2',
- Atilde: '\u00C3',
- Auml: '\u00C4',
- Aring: '\u00C5',
- AElig: '\u00C6',
- Ccedil: '\u00C7',
- Egrave: '\u00C8',
- Eacute: '\u00C9',
- Ecirc: '\u00CA',
- Euml: '\u00CB',
- Igrave: '\u00CC',
- Iacute: '\u00CD',
- Icirc: '\u00CE',
- Iuml: '\u00CF',
- ETH: '\u00D0',
- Ntilde: '\u00D1',
- Ograve: '\u00D2',
- Oacute: '\u00D3',
- Ocirc: '\u00D4',
- Otilde: '\u00D5',
- Ouml: '\u00D6',
- times: '\u00D7',
- Oslash: '\u00D8',
- Ugrave: '\u00D9',
- Uacute: '\u00DA',
- Ucirc: '\u00DB',
- Uuml: '\u00DC',
- Yacute: '\u00DD',
- THORN: '\u00DE',
- szlig: '\u00DF',
- agrave: '\u00E0',
- aacute: '\u00E1',
- acirc: '\u00E2',
- atilde: '\u00E3',
- auml: '\u00E4',
- aring: '\u00E5',
- aelig: '\u00E6',
- ccedil: '\u00E7',
- egrave: '\u00E8',
- eacute: '\u00E9',
- ecirc: '\u00EA',
- euml: '\u00EB',
- igrave: '\u00EC',
- iacute: '\u00ED',
- icirc: '\u00EE',
- iuml: '\u00EF',
- eth: '\u00F0',
- ntilde: '\u00F1',
- ograve: '\u00F2',
- oacute: '\u00F3',
- ocirc: '\u00F4',
- otilde: '\u00F5',
- ouml: '\u00F6',
- divide: '\u00F7',
- oslash: '\u00F8',
- ugrave: '\u00F9',
- uacute: '\u00FA',
- ucirc: '\u00FB',
- uuml: '\u00FC',
- yacute: '\u00FD',
- thorn: '\u00FE',
- yuml: '\u00FF',
- OElig: '\u0152',
- oelig: '\u0153',
- Scaron: '\u0160',
- scaron: '\u0161',
- Yuml: '\u0178',
- fnof: '\u0192',
- circ: '\u02C6',
- tilde: '\u02DC',
- Alpha: '\u0391',
- Beta: '\u0392',
- Gamma: '\u0393',
- Delta: '\u0394',
- Epsilon: '\u0395',
- Zeta: '\u0396',
- Eta: '\u0397',
- Theta: '\u0398',
- Iota: '\u0399',
- Kappa: '\u039A',
- Lambda: '\u039B',
- Mu: '\u039C',
- Nu: '\u039D',
- Xi: '\u039E',
- Omicron: '\u039F',
- Pi: '\u03A0',
- Rho: '\u03A1',
- Sigma: '\u03A3',
- Tau: '\u03A4',
- Upsilon: '\u03A5',
- Phi: '\u03A6',
- Chi: '\u03A7',
- Psi: '\u03A8',
- Omega: '\u03A9',
- alpha: '\u03B1',
- beta: '\u03B2',
- gamma: '\u03B3',
- delta: '\u03B4',
- epsilon: '\u03B5',
- zeta: '\u03B6',
- eta: '\u03B7',
- theta: '\u03B8',
- iota: '\u03B9',
- kappa: '\u03BA',
- lambda: '\u03BB',
- mu: '\u03BC',
- nu: '\u03BD',
- xi: '\u03BE',
- omicron: '\u03BF',
- pi: '\u03C0',
- rho: '\u03C1',
- sigmaf: '\u03C2',
- sigma: '\u03C3',
- tau: '\u03C4',
- upsilon: '\u03C5',
- phi: '\u03C6',
- chi: '\u03C7',
- psi: '\u03C8',
- omega: '\u03C9',
- thetasym: '\u03D1',
- upsih: '\u03D2',
- piv: '\u03D6',
- ensp: '\u2002',
- emsp: '\u2003',
- thinsp: '\u2009',
- zwnj: '\u200C',
- zwj: '\u200D',
- lrm: '\u200E',
- rlm: '\u200F',
- ndash: '\u2013',
- mdash: '\u2014',
- lsquo: '\u2018',
- rsquo: '\u2019',
- sbquo: '\u201A',
- ldquo: '\u201C',
- rdquo: '\u201D',
- bdquo: '\u201E',
- dagger: '\u2020',
- Dagger: '\u2021',
- bull: '\u2022',
- hellip: '\u2026',
- permil: '\u2030',
- prime: '\u2032',
- Prime: '\u2033',
- lsaquo: '\u2039',
- rsaquo: '\u203A',
- oline: '\u203E',
- frasl: '\u2044',
- euro: '\u20AC',
- image: '\u2111',
- weierp: '\u2118',
- real: '\u211C',
- trade: '\u2122',
- alefsym: '\u2135',
- larr: '\u2190',
- uarr: '\u2191',
- rarr: '\u2192',
- darr: '\u2193',
- harr: '\u2194',
- crarr: '\u21B5',
- lArr: '\u21D0',
- uArr: '\u21D1',
- rArr: '\u21D2',
- dArr: '\u21D3',
- hArr: '\u21D4',
- forall: '\u2200',
- part: '\u2202',
- exist: '\u2203',
- empty: '\u2205',
- nabla: '\u2207',
- isin: '\u2208',
- notin: '\u2209',
- ni: '\u220B',
- prod: '\u220F',
- sum: '\u2211',
- minus: '\u2212',
- lowast: '\u2217',
- radic: '\u221A',
- prop: '\u221D',
- infin: '\u221E',
- ang: '\u2220',
- and: '\u2227',
- or: '\u2228',
- cap: '\u2229',
- cup: '\u222A',
- int: '\u222B',
- there4: '\u2234',
- sim: '\u223C',
- cong: '\u2245',
- asymp: '\u2248',
- ne: '\u2260',
- equiv: '\u2261',
- le: '\u2264',
- ge: '\u2265',
- sub: '\u2282',
- sup: '\u2283',
- nsub: '\u2284',
- sube: '\u2286',
- supe: '\u2287',
- oplus: '\u2295',
- otimes: '\u2297',
- perp: '\u22A5',
- sdot: '\u22C5',
- lceil: '\u2308',
- rceil: '\u2309',
- lfloor: '\u230A',
- rfloor: '\u230B',
- loz: '\u25CA',
- spades: '\u2660',
- clubs: '\u2663',
- hearts: '\u2665',
- diams: '\u2666',
- lang: '\u27E8',
- rang: '\u27E9'
- };
-
-
-/***/ },
-/* 15 */
-/***/ function(module, exports, __webpack_require__) {
-
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- var error_handler_1 = __webpack_require__(10);
- var scanner_1 = __webpack_require__(12);
- var token_1 = __webpack_require__(13);
- var Reader = (function () {
- function Reader() {
- this.values = [];
- this.curly = this.paren = -1;
- }
- // A function following one of those tokens is an expression.
- Reader.prototype.beforeFunctionExpression = function (t) {
- return ['(', '{', '[', 'in', 'typeof', 'instanceof', 'new',
- 'return', 'case', 'delete', 'throw', 'void',
- // assignment operators
- '=', '+=', '-=', '*=', '**=', '/=', '%=', '<<=', '>>=', '>>>=',
- '&=', '|=', '^=', ',',
- // binary/unary operators
- '+', '-', '*', '**', '/', '%', '++', '--', '<<', '>>', '>>>', '&',
- '|', '^', '!', '~', '&&', '||', '?', ':', '===', '==', '>=',
- '<=', '<', '>', '!=', '!=='].indexOf(t) >= 0;
- };
- // Determine if forward slash (/) is an operator or part of a regular expression
- // https://github.com/mozilla/sweet.js/wiki/design
- Reader.prototype.isRegexStart = function () {
- var previous = this.values[this.values.length - 1];
- var regex = (previous !== null);
- switch (previous) {
- case 'this':
- case ']':
- regex = false;
- break;
- case ')':
- var keyword = this.values[this.paren - 1];
- regex = (keyword === 'if' || keyword === 'while' || keyword === 'for' || keyword === 'with');
- break;
- case '}':
- // Dividing a function by anything makes little sense,
- // but we have to check for that.
- regex = false;
- if (this.values[this.curly - 3] === 'function') {
- // Anonymous function, e.g. function(){} /42
- var check = this.values[this.curly - 4];
- regex = check ? !this.beforeFunctionExpression(check) : false;
- }
- else if (this.values[this.curly - 4] === 'function') {
- // Named function, e.g. function f(){} /42/
- var check = this.values[this.curly - 5];
- regex = check ? !this.beforeFunctionExpression(check) : true;
- }
- break;
- default:
- break;
- }
- return regex;
- };
- Reader.prototype.push = function (token) {
- if (token.type === 7 /* Punctuator */ || token.type === 4 /* Keyword */) {
- if (token.value === '{') {
- this.curly = this.values.length;
- }
- else if (token.value === '(') {
- this.paren = this.values.length;
- }
- this.values.push(token.value);
- }
- else {
- this.values.push(null);
- }
- };
- return Reader;
- }());
- var Tokenizer = (function () {
- function Tokenizer(code, config) {
- this.errorHandler = new error_handler_1.ErrorHandler();
- this.errorHandler.tolerant = config ? (typeof config.tolerant === 'boolean' && config.tolerant) : false;
- this.scanner = new scanner_1.Scanner(code, this.errorHandler);
- this.scanner.trackComment = config ? (typeof config.comment === 'boolean' && config.comment) : false;
- this.trackRange = config ? (typeof config.range === 'boolean' && config.range) : false;
- this.trackLoc = config ? (typeof config.loc === 'boolean' && config.loc) : false;
- this.buffer = [];
- this.reader = new Reader();
- }
- Tokenizer.prototype.errors = function () {
- return this.errorHandler.errors;
- };
- Tokenizer.prototype.getNextToken = function () {
- if (this.buffer.length === 0) {
- var comments = this.scanner.scanComments();
- if (this.scanner.trackComment) {
- for (var i = 0; i < comments.length; ++i) {
- var e = comments[i];
- var value = this.scanner.source.slice(e.slice[0], e.slice[1]);
- var comment = {
- type: e.multiLine ? 'BlockComment' : 'LineComment',
- value: value
- };
- if (this.trackRange) {
- comment.range = e.range;
- }
- if (this.trackLoc) {
- comment.loc = e.loc;
- }
- this.buffer.push(comment);
- }
- }
- if (!this.scanner.eof()) {
- var loc = void 0;
- if (this.trackLoc) {
- loc = {
- start: {
- line: this.scanner.lineNumber,
- column: this.scanner.index - this.scanner.lineStart
- },
- end: {}
- };
- }
- var startRegex = (this.scanner.source[this.scanner.index] === '/') && this.reader.isRegexStart();
- var token = startRegex ? this.scanner.scanRegExp() : this.scanner.lex();
- this.reader.push(token);
- var entry = {
- type: token_1.TokenName[token.type],
- value: this.scanner.source.slice(token.start, token.end)
- };
- if (this.trackRange) {
- entry.range = [token.start, token.end];
- }
- if (this.trackLoc) {
- loc.end = {
- line: this.scanner.lineNumber,
- column: this.scanner.index - this.scanner.lineStart
- };
- entry.loc = loc;
- }
- if (token.type === 9 /* RegularExpression */) {
- var pattern = token.pattern;
- var flags = token.flags;
- entry.regex = { pattern: pattern, flags: flags };
- }
- this.buffer.push(entry);
- }
- }
- return this.buffer.shift();
- };
- return Tokenizer;
- }());
- exports.Tokenizer = Tokenizer;
-
-
-/***/ }
-/******/ ])
-});
-;
-
-/***/ }),
-/* 36 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-/*eslint-disable no-use-before-define*/
-
-var common = __webpack_require__(8);
-var YAMLException = __webpack_require__(9);
-var DEFAULT_FULL_SCHEMA = __webpack_require__(31);
-var DEFAULT_SAFE_SCHEMA = __webpack_require__(11);
-
-var _toString = Object.prototype.toString;
-var _hasOwnProperty = Object.prototype.hasOwnProperty;
-
-var CHAR_TAB = 0x09; /* Tab */
-var CHAR_LINE_FEED = 0x0A; /* LF */
-var CHAR_CARRIAGE_RETURN = 0x0D; /* CR */
-var CHAR_SPACE = 0x20; /* Space */
-var CHAR_EXCLAMATION = 0x21; /* ! */
-var CHAR_DOUBLE_QUOTE = 0x22; /* " */
-var CHAR_SHARP = 0x23; /* # */
-var CHAR_PERCENT = 0x25; /* % */
-var CHAR_AMPERSAND = 0x26; /* & */
-var CHAR_SINGLE_QUOTE = 0x27; /* ' */
-var CHAR_ASTERISK = 0x2A; /* * */
-var CHAR_COMMA = 0x2C; /* , */
-var CHAR_MINUS = 0x2D; /* - */
-var CHAR_COLON = 0x3A; /* : */
-var CHAR_EQUALS = 0x3D; /* = */
-var CHAR_GREATER_THAN = 0x3E; /* > */
-var CHAR_QUESTION = 0x3F; /* ? */
-var CHAR_COMMERCIAL_AT = 0x40; /* @ */
-var CHAR_LEFT_SQUARE_BRACKET = 0x5B; /* [ */
-var CHAR_RIGHT_SQUARE_BRACKET = 0x5D; /* ] */
-var CHAR_GRAVE_ACCENT = 0x60; /* ` */
-var CHAR_LEFT_CURLY_BRACKET = 0x7B; /* { */
-var CHAR_VERTICAL_LINE = 0x7C; /* | */
-var CHAR_RIGHT_CURLY_BRACKET = 0x7D; /* } */
-
-var ESCAPE_SEQUENCES = {};
-
-ESCAPE_SEQUENCES[0x00] = '\\0';
-ESCAPE_SEQUENCES[0x07] = '\\a';
-ESCAPE_SEQUENCES[0x08] = '\\b';
-ESCAPE_SEQUENCES[0x09] = '\\t';
-ESCAPE_SEQUENCES[0x0A] = '\\n';
-ESCAPE_SEQUENCES[0x0B] = '\\v';
-ESCAPE_SEQUENCES[0x0C] = '\\f';
-ESCAPE_SEQUENCES[0x0D] = '\\r';
-ESCAPE_SEQUENCES[0x1B] = '\\e';
-ESCAPE_SEQUENCES[0x22] = '\\"';
-ESCAPE_SEQUENCES[0x5C] = '\\\\';
-ESCAPE_SEQUENCES[0x85] = '\\N';
-ESCAPE_SEQUENCES[0xA0] = '\\_';
-ESCAPE_SEQUENCES[0x2028] = '\\L';
-ESCAPE_SEQUENCES[0x2029] = '\\P';
-
-var DEPRECATED_BOOLEANS_SYNTAX = [
- 'y', 'Y', 'yes', 'Yes', 'YES', 'on', 'On', 'ON',
- 'n', 'N', 'no', 'No', 'NO', 'off', 'Off', 'OFF'
-];
-
-function compileStyleMap(schema, map) {
- var result, keys, index, length, tag, style, type;
-
- if (map === null) return {};
-
- result = {};
- keys = Object.keys(map);
-
- for (index = 0, length = keys.length; index < length; index += 1) {
- tag = keys[index];
- style = String(map[tag]);
-
- if (tag.slice(0, 2) === '!!') {
- tag = 'tag:yaml.org,2002:' + tag.slice(2);
- }
- type = schema.compiledTypeMap['fallback'][tag];
-
- if (type && _hasOwnProperty.call(type.styleAliases, style)) {
- style = type.styleAliases[style];
- }
-
- result[tag] = style;
- }
-
- return result;
-}
-
-function encodeHex(character) {
- var string, handle, length;
-
- string = character.toString(16).toUpperCase();
-
- if (character <= 0xFF) {
- handle = 'x';
- length = 2;
- } else if (character <= 0xFFFF) {
- handle = 'u';
- length = 4;
- } else if (character <= 0xFFFFFFFF) {
- handle = 'U';
- length = 8;
- } else {
- throw new YAMLException('code point within a string may not be greater than 0xFFFFFFFF');
- }
-
- return '\\' + handle + common.repeat('0', length - string.length) + string;
-}
-
-function State(options) {
- this.schema = options['schema'] || DEFAULT_FULL_SCHEMA;
- this.indent = Math.max(1, (options['indent'] || 2));
- this.noArrayIndent = options['noArrayIndent'] || false;
- this.skipInvalid = options['skipInvalid'] || false;
- this.flowLevel = (common.isNothing(options['flowLevel']) ? -1 : options['flowLevel']);
- this.styleMap = compileStyleMap(this.schema, options['styles'] || null);
- this.sortKeys = options['sortKeys'] || false;
- this.lineWidth = options['lineWidth'] || 80;
- this.noRefs = options['noRefs'] || false;
- this.noCompatMode = options['noCompatMode'] || false;
- this.condenseFlow = options['condenseFlow'] || false;
-
- this.implicitTypes = this.schema.compiledImplicit;
- this.explicitTypes = this.schema.compiledExplicit;
-
- this.tag = null;
- this.result = '';
-
- this.duplicates = [];
- this.usedDuplicates = null;
-}
-
-// Indents every line in a string. Empty lines (\n only) are not indented.
-function indentString(string, spaces) {
- var ind = common.repeat(' ', spaces),
- position = 0,
- next = -1,
- result = '',
- line,
- length = string.length;
-
- while (position < length) {
- next = string.indexOf('\n', position);
- if (next === -1) {
- line = string.slice(position);
- position = length;
- } else {
- line = string.slice(position, next + 1);
- position = next + 1;
- }
-
- if (line.length && line !== '\n') result += ind;
-
- result += line;
- }
-
- return result;
-}
-
-function generateNextLine(state, level) {
- return '\n' + common.repeat(' ', state.indent * level);
-}
-
-function testImplicitResolving(state, str) {
- var index, length, type;
-
- for (index = 0, length = state.implicitTypes.length; index < length; index += 1) {
- type = state.implicitTypes[index];
-
- if (type.resolve(str)) {
- return true;
- }
- }
-
- return false;
-}
-
-// [33] s-white ::= s-space | s-tab
-function isWhitespace(c) {
- return c === CHAR_SPACE || c === CHAR_TAB;
-}
-
-// Returns true if the character can be printed without escaping.
-// From YAML 1.2: "any allowed characters known to be non-printable
-// should also be escaped. [However,] This isn’t mandatory"
-// Derived from nb-char - \t - #x85 - #xA0 - #x2028 - #x2029.
-function isPrintable(c) {
- return (0x00020 <= c && c <= 0x00007E)
- || ((0x000A1 <= c && c <= 0x00D7FF) && c !== 0x2028 && c !== 0x2029)
- || ((0x0E000 <= c && c <= 0x00FFFD) && c !== 0xFEFF /* BOM */)
- || (0x10000 <= c && c <= 0x10FFFF);
-}
-
-// [34] ns-char ::= nb-char - s-white
-// [27] nb-char ::= c-printable - b-char - c-byte-order-mark
-// [26] b-char ::= b-line-feed | b-carriage-return
-// [24] b-line-feed ::= #xA /* LF */
-// [25] b-carriage-return ::= #xD /* CR */
-// [3] c-byte-order-mark ::= #xFEFF
-function isNsChar(c) {
- return isPrintable(c) && !isWhitespace(c)
- // byte-order-mark
- && c !== 0xFEFF
- // b-char
- && c !== CHAR_CARRIAGE_RETURN
- && c !== CHAR_LINE_FEED;
-}
-
-// Simplified test for values allowed after the first character in plain style.
-function isPlainSafe(c, prev) {
- // Uses a subset of nb-char - c-flow-indicator - ":" - "#"
- // where nb-char ::= c-printable - b-char - c-byte-order-mark.
- return isPrintable(c) && c !== 0xFEFF
- // - c-flow-indicator
- && c !== CHAR_COMMA
- && c !== CHAR_LEFT_SQUARE_BRACKET
- && c !== CHAR_RIGHT_SQUARE_BRACKET
- && c !== CHAR_LEFT_CURLY_BRACKET
- && c !== CHAR_RIGHT_CURLY_BRACKET
- // - ":" - "#"
- // /* An ns-char preceding */ "#"
- && c !== CHAR_COLON
- && ((c !== CHAR_SHARP) || (prev && isNsChar(prev)));
-}
-
-// Simplified test for values allowed as the first character in plain style.
-function isPlainSafeFirst(c) {
- // Uses a subset of ns-char - c-indicator
- // where ns-char = nb-char - s-white.
- return isPrintable(c) && c !== 0xFEFF
- && !isWhitespace(c) // - s-white
- // - (c-indicator ::=
- // “-” | “?” | “:” | “,” | “[” | “]” | “{” | “}”
- && c !== CHAR_MINUS
- && c !== CHAR_QUESTION
- && c !== CHAR_COLON
- && c !== CHAR_COMMA
- && c !== CHAR_LEFT_SQUARE_BRACKET
- && c !== CHAR_RIGHT_SQUARE_BRACKET
- && c !== CHAR_LEFT_CURLY_BRACKET
- && c !== CHAR_RIGHT_CURLY_BRACKET
- // | “#” | “&” | “*” | “!” | “|” | “=” | “>” | “'” | “"”
- && c !== CHAR_SHARP
- && c !== CHAR_AMPERSAND
- && c !== CHAR_ASTERISK
- && c !== CHAR_EXCLAMATION
- && c !== CHAR_VERTICAL_LINE
- && c !== CHAR_EQUALS
- && c !== CHAR_GREATER_THAN
- && c !== CHAR_SINGLE_QUOTE
- && c !== CHAR_DOUBLE_QUOTE
- // | “%” | “@” | “`”)
- && c !== CHAR_PERCENT
- && c !== CHAR_COMMERCIAL_AT
- && c !== CHAR_GRAVE_ACCENT;
-}
-
-// Determines whether block indentation indicator is required.
-function needIndentIndicator(string) {
- var leadingSpaceRe = /^\n* /;
- return leadingSpaceRe.test(string);
-}
-
-var STYLE_PLAIN = 1,
- STYLE_SINGLE = 2,
- STYLE_LITERAL = 3,
- STYLE_FOLDED = 4,
- STYLE_DOUBLE = 5;
-
-// Determines which scalar styles are possible and returns the preferred style.
-// lineWidth = -1 => no limit.
-// Pre-conditions: str.length > 0.
-// Post-conditions:
-// STYLE_PLAIN or STYLE_SINGLE => no \n are in the string.
-// STYLE_LITERAL => no lines are suitable for folding (or lineWidth is -1).
-// STYLE_FOLDED => a line > lineWidth and can be folded (and lineWidth != -1).
-function chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth, testAmbiguousType) {
- var i;
- var char, prev_char;
- var hasLineBreak = false;
- var hasFoldableLine = false; // only checked if shouldTrackWidth
- var shouldTrackWidth = lineWidth !== -1;
- var previousLineBreak = -1; // count the first line correctly
- var plain = isPlainSafeFirst(string.charCodeAt(0))
- && !isWhitespace(string.charCodeAt(string.length - 1));
-
- if (singleLineOnly) {
- // Case: no block styles.
- // Check for disallowed characters to rule out plain and single.
- for (i = 0; i < string.length; i++) {
- char = string.charCodeAt(i);
- if (!isPrintable(char)) {
- return STYLE_DOUBLE;
- }
- prev_char = i > 0 ? string.charCodeAt(i - 1) : null;
- plain = plain && isPlainSafe(char, prev_char);
- }
- } else {
- // Case: block styles permitted.
- for (i = 0; i < string.length; i++) {
- char = string.charCodeAt(i);
- if (char === CHAR_LINE_FEED) {
- hasLineBreak = true;
- // Check if any line can be folded.
- if (shouldTrackWidth) {
- hasFoldableLine = hasFoldableLine ||
- // Foldable line = too long, and not more-indented.
- (i - previousLineBreak - 1 > lineWidth &&
- string[previousLineBreak + 1] !== ' ');
- previousLineBreak = i;
- }
- } else if (!isPrintable(char)) {
- return STYLE_DOUBLE;
- }
- prev_char = i > 0 ? string.charCodeAt(i - 1) : null;
- plain = plain && isPlainSafe(char, prev_char);
- }
- // in case the end is missing a \n
- hasFoldableLine = hasFoldableLine || (shouldTrackWidth &&
- (i - previousLineBreak - 1 > lineWidth &&
- string[previousLineBreak + 1] !== ' '));
- }
- // Although every style can represent \n without escaping, prefer block styles
- // for multiline, since they're more readable and they don't add empty lines.
- // Also prefer folding a super-long line.
- if (!hasLineBreak && !hasFoldableLine) {
- // Strings interpretable as another type have to be quoted;
- // e.g. the string 'true' vs. the boolean true.
- return plain && !testAmbiguousType(string)
- ? STYLE_PLAIN : STYLE_SINGLE;
- }
- // Edge case: block indentation indicator can only have one digit.
- if (indentPerLevel > 9 && needIndentIndicator(string)) {
- return STYLE_DOUBLE;
- }
- // At this point we know block styles are valid.
- // Prefer literal style unless we want to fold.
- return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL;
-}
-
-// Note: line breaking/folding is implemented for only the folded style.
-// NB. We drop the last trailing newline (if any) of a returned block scalar
-// since the dumper adds its own newline. This always works:
-// • No ending newline => unaffected; already using strip "-" chomping.
-// • Ending newline => removed then restored.
-// Importantly, this keeps the "+" chomp indicator from gaining an extra line.
-function writeScalar(state, string, level, iskey) {
- state.dump = (function () {
- if (string.length === 0) {
- return "''";
- }
- if (!state.noCompatMode &&
- DEPRECATED_BOOLEANS_SYNTAX.indexOf(string) !== -1) {
- return "'" + string + "'";
- }
-
- var indent = state.indent * Math.max(1, level); // no 0-indent scalars
- // As indentation gets deeper, let the width decrease monotonically
- // to the lower bound min(state.lineWidth, 40).
- // Note that this implies
- // state.lineWidth ≤ 40 + state.indent: width is fixed at the lower bound.
- // state.lineWidth > 40 + state.indent: width decreases until the lower bound.
- // This behaves better than a constant minimum width which disallows narrower options,
- // or an indent threshold which causes the width to suddenly increase.
- var lineWidth = state.lineWidth === -1
- ? -1 : Math.max(Math.min(state.lineWidth, 40), state.lineWidth - indent);
-
- // Without knowing if keys are implicit/explicit, assume implicit for safety.
- var singleLineOnly = iskey
- // No block styles in flow mode.
- || (state.flowLevel > -1 && level >= state.flowLevel);
- function testAmbiguity(string) {
- return testImplicitResolving(state, string);
- }
-
- switch (chooseScalarStyle(string, singleLineOnly, state.indent, lineWidth, testAmbiguity)) {
- case STYLE_PLAIN:
- return string;
- case STYLE_SINGLE:
- return "'" + string.replace(/'/g, "''") + "'";
- case STYLE_LITERAL:
- return '|' + blockHeader(string, state.indent)
- + dropEndingNewline(indentString(string, indent));
- case STYLE_FOLDED:
- return '>' + blockHeader(string, state.indent)
- + dropEndingNewline(indentString(foldString(string, lineWidth), indent));
- case STYLE_DOUBLE:
- return '"' + escapeString(string, lineWidth) + '"';
- default:
- throw new YAMLException('impossible error: invalid scalar style');
- }
- }());
-}
-
-// Pre-conditions: string is valid for a block scalar, 1 <= indentPerLevel <= 9.
-function blockHeader(string, indentPerLevel) {
- var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : '';
-
- // note the special case: the string '\n' counts as a "trailing" empty line.
- var clip = string[string.length - 1] === '\n';
- var keep = clip && (string[string.length - 2] === '\n' || string === '\n');
- var chomp = keep ? '+' : (clip ? '' : '-');
-
- return indentIndicator + chomp + '\n';
-}
-
-// (See the note for writeScalar.)
-function dropEndingNewline(string) {
- return string[string.length - 1] === '\n' ? string.slice(0, -1) : string;
-}
-
-// Note: a long line without a suitable break point will exceed the width limit.
-// Pre-conditions: every char in str isPrintable, str.length > 0, width > 0.
-function foldString(string, width) {
- // In folded style, $k$ consecutive newlines output as $k+1$ newlines—
- // unless they're before or after a more-indented line, or at the very
- // beginning or end, in which case $k$ maps to $k$.
- // Therefore, parse each chunk as newline(s) followed by a content line.
- var lineRe = /(\n+)([^\n]*)/g;
-
- // first line (possibly an empty line)
- var result = (function () {
- var nextLF = string.indexOf('\n');
- nextLF = nextLF !== -1 ? nextLF : string.length;
- lineRe.lastIndex = nextLF;
- return foldLine(string.slice(0, nextLF), width);
- }());
- // If we haven't reached the first content line yet, don't add an extra \n.
- var prevMoreIndented = string[0] === '\n' || string[0] === ' ';
- var moreIndented;
-
- // rest of the lines
- var match;
- while ((match = lineRe.exec(string))) {
- var prefix = match[1], line = match[2];
- moreIndented = (line[0] === ' ');
- result += prefix
- + (!prevMoreIndented && !moreIndented && line !== ''
- ? '\n' : '')
- + foldLine(line, width);
- prevMoreIndented = moreIndented;
- }
-
- return result;
-}
-
-// Greedy line breaking.
-// Picks the longest line under the limit each time,
-// otherwise settles for the shortest line over the limit.
-// NB. More-indented lines *cannot* be folded, as that would add an extra \n.
-function foldLine(line, width) {
- if (line === '' || line[0] === ' ') return line;
-
- // Since a more-indented line adds a \n, breaks can't be followed by a space.
- var breakRe = / [^ ]/g; // note: the match index will always be <= length-2.
- var match;
- // start is an inclusive index. end, curr, and next are exclusive.
- var start = 0, end, curr = 0, next = 0;
- var result = '';
-
- // Invariants: 0 <= start <= length-1.
- // 0 <= curr <= next <= max(0, length-2). curr - start <= width.
- // Inside the loop:
- // A match implies length >= 2, so curr and next are <= length-2.
- while ((match = breakRe.exec(line))) {
- next = match.index;
- // maintain invariant: curr - start <= width
- if (next - start > width) {
- end = (curr > start) ? curr : next; // derive end <= length-2
- result += '\n' + line.slice(start, end);
- // skip the space that was output as \n
- start = end + 1; // derive start <= length-1
- }
- curr = next;
- }
-
- // By the invariants, start <= length-1, so there is something left over.
- // It is either the whole string or a part starting from non-whitespace.
- result += '\n';
- // Insert a break if the remainder is too long and there is a break available.
- if (line.length - start > width && curr > start) {
- result += line.slice(start, curr) + '\n' + line.slice(curr + 1);
- } else {
- result += line.slice(start);
- }
-
- return result.slice(1); // drop extra \n joiner
-}
-
-// Escapes a double-quoted string.
-function escapeString(string) {
- var result = '';
- var char, nextChar;
- var escapeSeq;
-
- for (var i = 0; i < string.length; i++) {
- char = string.charCodeAt(i);
- // Check for surrogate pairs (reference Unicode 3.0 section "3.7 Surrogates").
- if (char >= 0xD800 && char <= 0xDBFF/* high surrogate */) {
- nextChar = string.charCodeAt(i + 1);
- if (nextChar >= 0xDC00 && nextChar <= 0xDFFF/* low surrogate */) {
- // Combine the surrogate pair and store it escaped.
- result += encodeHex((char - 0xD800) * 0x400 + nextChar - 0xDC00 + 0x10000);
- // Advance index one extra since we already used that char here.
- i++; continue;
- }
- }
- escapeSeq = ESCAPE_SEQUENCES[char];
- result += !escapeSeq && isPrintable(char)
- ? string[i]
- : escapeSeq || encodeHex(char);
- }
-
- return result;
-}
-
-function writeFlowSequence(state, level, object) {
- var _result = '',
- _tag = state.tag,
- index,
- length;
-
- for (index = 0, length = object.length; index < length; index += 1) {
- // Write only valid elements.
- if (writeNode(state, level, object[index], false, false)) {
- if (index !== 0) _result += ',' + (!state.condenseFlow ? ' ' : '');
- _result += state.dump;
- }
- }
-
- state.tag = _tag;
- state.dump = '[' + _result + ']';
-}
-
-function writeBlockSequence(state, level, object, compact) {
- var _result = '',
- _tag = state.tag,
- index,
- length;
-
- for (index = 0, length = object.length; index < length; index += 1) {
- // Write only valid elements.
- if (writeNode(state, level + 1, object[index], true, true)) {
- if (!compact || index !== 0) {
- _result += generateNextLine(state, level);
- }
-
- if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
- _result += '-';
- } else {
- _result += '- ';
- }
-
- _result += state.dump;
- }
- }
-
- state.tag = _tag;
- state.dump = _result || '[]'; // Empty sequence if no valid values.
-}
-
-function writeFlowMapping(state, level, object) {
- var _result = '',
- _tag = state.tag,
- objectKeyList = Object.keys(object),
- index,
- length,
- objectKey,
- objectValue,
- pairBuffer;
-
- for (index = 0, length = objectKeyList.length; index < length; index += 1) {
-
- pairBuffer = '';
- if (index !== 0) pairBuffer += ', ';
-
- if (state.condenseFlow) pairBuffer += '"';
-
- objectKey = objectKeyList[index];
- objectValue = object[objectKey];
-
- if (!writeNode(state, level, objectKey, false, false)) {
- continue; // Skip this pair because of invalid key;
- }
-
- if (state.dump.length > 1024) pairBuffer += '? ';
-
- pairBuffer += state.dump + (state.condenseFlow ? '"' : '') + ':' + (state.condenseFlow ? '' : ' ');
-
- if (!writeNode(state, level, objectValue, false, false)) {
- continue; // Skip this pair because of invalid value.
- }
-
- pairBuffer += state.dump;
-
- // Both key and value are valid.
- _result += pairBuffer;
- }
-
- state.tag = _tag;
- state.dump = '{' + _result + '}';
-}
-
-function writeBlockMapping(state, level, object, compact) {
- var _result = '',
- _tag = state.tag,
- objectKeyList = Object.keys(object),
- index,
- length,
- objectKey,
- objectValue,
- explicitPair,
- pairBuffer;
-
- // Allow sorting keys so that the output file is deterministic
- if (state.sortKeys === true) {
- // Default sorting
- objectKeyList.sort();
- } else if (typeof state.sortKeys === 'function') {
- // Custom sort function
- objectKeyList.sort(state.sortKeys);
- } else if (state.sortKeys) {
- // Something is wrong
- throw new YAMLException('sortKeys must be a boolean or a function');
- }
-
- for (index = 0, length = objectKeyList.length; index < length; index += 1) {
- pairBuffer = '';
-
- if (!compact || index !== 0) {
- pairBuffer += generateNextLine(state, level);
- }
-
- objectKey = objectKeyList[index];
- objectValue = object[objectKey];
-
- if (!writeNode(state, level + 1, objectKey, true, true, true)) {
- continue; // Skip this pair because of invalid key.
- }
-
- explicitPair = (state.tag !== null && state.tag !== '?') ||
- (state.dump && state.dump.length > 1024);
-
- if (explicitPair) {
- if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
- pairBuffer += '?';
- } else {
- pairBuffer += '? ';
- }
- }
-
- pairBuffer += state.dump;
-
- if (explicitPair) {
- pairBuffer += generateNextLine(state, level);
- }
-
- if (!writeNode(state, level + 1, objectValue, true, explicitPair)) {
- continue; // Skip this pair because of invalid value.
- }
-
- if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
- pairBuffer += ':';
- } else {
- pairBuffer += ': ';
- }
-
- pairBuffer += state.dump;
-
- // Both key and value are valid.
- _result += pairBuffer;
- }
-
- state.tag = _tag;
- state.dump = _result || '{}'; // Empty mapping if no valid pairs.
-}
-
-function detectType(state, object, explicit) {
- var _result, typeList, index, length, type, style;
-
- typeList = explicit ? state.explicitTypes : state.implicitTypes;
-
- for (index = 0, length = typeList.length; index < length; index += 1) {
- type = typeList[index];
-
- if ((type.instanceOf || type.predicate) &&
- (!type.instanceOf || ((typeof object === 'object') && (object instanceof type.instanceOf))) &&
- (!type.predicate || type.predicate(object))) {
-
- state.tag = explicit ? type.tag : '?';
-
- if (type.represent) {
- style = state.styleMap[type.tag] || type.defaultStyle;
-
- if (_toString.call(type.represent) === '[object Function]') {
- _result = type.represent(object, style);
- } else if (_hasOwnProperty.call(type.represent, style)) {
- _result = type.represent[style](object, style);
- } else {
- throw new YAMLException('!<' + type.tag + '> tag resolver accepts not "' + style + '" style');
- }
-
- state.dump = _result;
- }
-
- return true;
- }
- }
-
- return false;
-}
-
-// Serializes `object` and writes it to global `result`.
-// Returns true on success, or false on invalid object.
-//
-function writeNode(state, level, object, block, compact, iskey) {
- state.tag = null;
- state.dump = object;
-
- if (!detectType(state, object, false)) {
- detectType(state, object, true);
- }
-
- var type = _toString.call(state.dump);
-
- if (block) {
- block = (state.flowLevel < 0 || state.flowLevel > level);
- }
-
- var objectOrArray = type === '[object Object]' || type === '[object Array]',
- duplicateIndex,
- duplicate;
-
- if (objectOrArray) {
- duplicateIndex = state.duplicates.indexOf(object);
- duplicate = duplicateIndex !== -1;
- }
-
- if ((state.tag !== null && state.tag !== '?') || duplicate || (state.indent !== 2 && level > 0)) {
- compact = false;
- }
-
- if (duplicate && state.usedDuplicates[duplicateIndex]) {
- state.dump = '*ref_' + duplicateIndex;
- } else {
- if (objectOrArray && duplicate && !state.usedDuplicates[duplicateIndex]) {
- state.usedDuplicates[duplicateIndex] = true;
- }
- if (type === '[object Object]') {
- if (block && (Object.keys(state.dump).length !== 0)) {
- writeBlockMapping(state, level, state.dump, compact);
- if (duplicate) {
- state.dump = '&ref_' + duplicateIndex + state.dump;
- }
- } else {
- writeFlowMapping(state, level, state.dump);
- if (duplicate) {
- state.dump = '&ref_' + duplicateIndex + ' ' + state.dump;
- }
- }
- } else if (type === '[object Array]') {
- var arrayLevel = (state.noArrayIndent && (level > 0)) ? level - 1 : level;
- if (block && (state.dump.length !== 0)) {
- writeBlockSequence(state, arrayLevel, state.dump, compact);
- if (duplicate) {
- state.dump = '&ref_' + duplicateIndex + state.dump;
- }
- } else {
- writeFlowSequence(state, arrayLevel, state.dump);
- if (duplicate) {
- state.dump = '&ref_' + duplicateIndex + ' ' + state.dump;
- }
- }
- } else if (type === '[object String]') {
- if (state.tag !== '?') {
- writeScalar(state, state.dump, level, iskey);
- }
- } else {
- if (state.skipInvalid) return false;
- throw new YAMLException('unacceptable kind of an object to dump ' + type);
- }
-
- if (state.tag !== null && state.tag !== '?') {
- state.dump = '!<' + state.tag + '> ' + state.dump;
- }
- }
-
- return true;
-}
-
-function getDuplicateReferences(object, state) {
- var objects = [],
- duplicatesIndexes = [],
- index,
- length;
-
- inspectNode(object, objects, duplicatesIndexes);
-
- for (index = 0, length = duplicatesIndexes.length; index < length; index += 1) {
- state.duplicates.push(objects[duplicatesIndexes[index]]);
- }
- state.usedDuplicates = new Array(length);
-}
-
-function inspectNode(object, objects, duplicatesIndexes) {
- var objectKeyList,
- index,
- length;
-
- if (object !== null && typeof object === 'object') {
- index = objects.indexOf(object);
- if (index !== -1) {
- if (duplicatesIndexes.indexOf(index) === -1) {
- duplicatesIndexes.push(index);
- }
- } else {
- objects.push(object);
-
- if (Array.isArray(object)) {
- for (index = 0, length = object.length; index < length; index += 1) {
- inspectNode(object[index], objects, duplicatesIndexes);
- }
- } else {
- objectKeyList = Object.keys(object);
-
- for (index = 0, length = objectKeyList.length; index < length; index += 1) {
- inspectNode(object[objectKeyList[index]], objects, duplicatesIndexes);
- }
- }
- }
- }
-}
-
-function dump(input, options) {
- options = options || {};
-
- var state = new State(options);
-
- if (!state.noRefs) getDuplicateReferences(input, state);
-
- if (writeNode(state, 0, input, true, true)) return state.dump + '\n';
-
- return '';
-}
-
-function safeDump(input, options) {
- return dump(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options));
-}
-
-module.exports.dump = dump;
-module.exports.safeDump = safeDump;
-
-
-/***/ }),
-/* 37 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// @ts-check
-
-
-
-const fs = __webpack_require__(4);
-const path = __webpack_require__(38);
-const { URL } = __webpack_require__(39);
-const markdownIt = __webpack_require__(40);
-const rules = __webpack_require__(107);
-const helpers = __webpack_require__(110);
-const cache = __webpack_require__(115);
-
-const deprecatedRuleNames = [ "MD002", "MD006" ];
-
-
-/**
- * Validate the list of rules for structure and reuse.
- *
- * @param {Rule[]} ruleList List of rules.
- * @returns {string} Error message if validation fails.
- */
-function validateRuleList(ruleList) {
- let result = null;
- if (ruleList.length === rules.length) {
- // No need to validate if only using built-in rules
- return result;
- }
- const allIds = {};
- ruleList.forEach(function forRule(rule, index) {
- const customIndex = index - rules.length;
- // eslint-disable-next-line jsdoc/require-jsdoc
- function newError(property) {
- return new Error(
- "Property '" + property + "' of custom rule at index " +
- customIndex + " is incorrect.");
- }
- [ "names", "tags" ].forEach(function forProperty(property) {
- const value = rule[property];
- if (!result &&
- (!value || !Array.isArray(value) || (value.length === 0) ||
- !value.every(helpers.isString) || value.some(helpers.isEmptyString))) {
- result = newError(property);
- }
- });
- [
- [ "description", "string" ],
- [ "function", "function" ]
- ].forEach(function forProperty(propertyInfo) {
- const property = propertyInfo[0];
- const value = rule[property];
- if (!result && (!value || (typeof value !== propertyInfo[1]))) {
- result = newError(property);
- }
- });
- if (!result && rule.information) {
- if (Object.getPrototypeOf(rule.information) !== URL.prototype) {
- result = newError("information");
- }
- }
- if (!result) {
- rule.names.forEach(function forName(name) {
- const nameUpper = name.toUpperCase();
- if (!result && (allIds[nameUpper] !== undefined)) {
- result = new Error("Name '" + name + "' of custom rule at index " +
- customIndex + " is already used as a name or tag.");
- }
- allIds[nameUpper] = true;
- });
- rule.tags.forEach(function forTag(tag) {
- const tagUpper = tag.toUpperCase();
- if (!result && allIds[tagUpper]) {
- result = new Error("Tag '" + tag + "' of custom rule at index " +
- customIndex + " is already used as a name.");
- }
- allIds[tagUpper] = false;
- });
- }
- });
- return result;
-}
-
-/**
- * Creates a LintResults instance with toString for pretty display.
- *
- * @param {Rule[]} ruleList List of rules.
- * @returns {LintResults} New LintResults instance.
- */
-function newResults(ruleList) {
- // eslint-disable-next-line jsdoc/require-jsdoc
- function Results() {}
- Results.prototype.toString = function toString(useAlias) {
- const that = this;
- let ruleNameToRule = null;
- const results = [];
- Object.keys(that).forEach(function forFile(file) {
- const fileResults = that[file];
- if (Array.isArray(fileResults)) {
- fileResults.forEach(function forResult(result) {
- const ruleMoniker = result.ruleNames ?
- result.ruleNames.join("/") :
- (result.ruleName + "/" + result.ruleAlias);
- results.push(
- file + ": " +
- result.lineNumber + ": " +
- ruleMoniker + " " +
- result.ruleDescription +
- (result.errorDetail ?
- " [" + result.errorDetail + "]" :
- "") +
- (result.errorContext ?
- " [Context: \"" + result.errorContext + "\"]" :
- ""));
- });
- } else {
- if (!ruleNameToRule) {
- ruleNameToRule = {};
- ruleList.forEach(function forRule(rule) {
- const ruleName = rule.names[0].toUpperCase();
- ruleNameToRule[ruleName] = rule;
- });
- }
- Object.keys(fileResults).forEach(function forRule(ruleName) {
- const rule = ruleNameToRule[ruleName.toUpperCase()];
- const ruleResults = fileResults[ruleName];
- ruleResults.forEach(function forLine(lineNumber) {
- const nameIndex = Math.min(useAlias ? 1 : 0, rule.names.length - 1);
- const result =
- file + ": " +
- lineNumber + ": " +
- rule.names[nameIndex] + " " +
- rule.description;
- results.push(result);
- });
- });
- }
- });
- return results.join("\n");
- };
- // @ts-ignore
- return new Results();
-}
-
-/**
- * Remove front matter (if present at beginning of content).
- *
- * @param {string} content Markdown content.
- * @param {RegExp} frontMatter Regular expression to match front matter.
- * @returns {Object} Trimmed content and front matter lines.
- */
-function removeFrontMatter(content, frontMatter) {
- let frontMatterLines = [];
- if (frontMatter) {
- const frontMatterMatch = content.match(frontMatter);
- if (frontMatterMatch && !frontMatterMatch.index) {
- const contentMatched = frontMatterMatch[0];
- content = content.slice(contentMatched.length);
- frontMatterLines = contentMatched.split(helpers.newLineRe);
- if (frontMatterLines.length &&
- (frontMatterLines[frontMatterLines.length - 1] === "")) {
- frontMatterLines.length--;
- }
- }
- }
- return {
- "content": content,
- "frontMatterLines": frontMatterLines
- };
-}
-
-/**
- * Annotate tokens with line/lineNumber.
- *
- * @param {MarkdownItToken[]} tokens Array of markdown-it tokens.
- * @param {string[]} lines Lines of Markdown content.
- * @returns {void}
- */
-function annotateTokens(tokens, lines) {
- let tbodyMap = null;
- tokens.forEach(function forToken(token) {
- // Handle missing maps for table body
- if (token.type === "tbody_open") {
- tbodyMap = token.map.slice();
- } else if ((token.type === "tr_close") && tbodyMap) {
- tbodyMap[0]++;
- } else if (token.type === "tbody_close") {
- tbodyMap = null;
- }
- if (tbodyMap && !token.map) {
- token.map = tbodyMap.slice();
- }
- // Update token metadata
- if (token.map) {
- token.line = lines[token.map[0]];
- token.lineNumber = token.map[0] + 1;
- // Trim bottom of token to exclude whitespace lines
- while (token.map[1] && !((lines[token.map[1] - 1] || "").trim())) {
- token.map[1]--;
- }
- // Annotate children with lineNumber
- let lineNumber = token.lineNumber;
- const codeSpanExtraLines = [];
- helpers.forEachInlineCodeSpan(
- token.content,
- function handleInlineCodeSpan(code) {
- codeSpanExtraLines.push(code.split(helpers.newLineRe).length - 1);
- }
- );
- (token.children || []).forEach(function forChild(child) {
- child.lineNumber = lineNumber;
- child.line = lines[lineNumber - 1];
- if ((child.type === "softbreak") || (child.type === "hardbreak")) {
- lineNumber++;
- } else if (child.type === "code_inline") {
- lineNumber += codeSpanExtraLines.shift();
- }
- });
- }
- });
-}
-
-/**
- * Map rule names/tags to canonical rule name.
- *
- * @param {Rule[]} ruleList List of rules.
- * @returns {Object.<string, string[]>} Map of alias to rule name.
- */
-function mapAliasToRuleNames(ruleList) {
- const aliasToRuleNames = {};
- // const tagToRuleNames = {};
- ruleList.forEach(function forRule(rule) {
- const ruleName = rule.names[0].toUpperCase();
- // The following is useful for updating README.md:
- // console.log(
- // "* **[" + ruleName + "](doc/Rules.md#" + ruleName.toLowerCase() +
- // ")** *" + rule.names.slice(1).join("/") + "* - " + rule.description);
- rule.names.forEach(function forName(name) {
- const nameUpper = name.toUpperCase();
- aliasToRuleNames[nameUpper] = [ ruleName ];
- });
- rule.tags.forEach(function forTag(tag) {
- const tagUpper = tag.toUpperCase();
- const ruleNames = aliasToRuleNames[tagUpper] || [];
- ruleNames.push(ruleName);
- aliasToRuleNames[tagUpper] = ruleNames;
- // tagToRuleNames[tag] = ruleName;
- });
- });
- // The following is useful for updating README.md:
- // Object.keys(tagToRuleNames).sort().forEach(function forTag(tag) {
- // console.log("* **" + tag + "** - " +
- // aliasToRuleNames[tag.toUpperCase()].join(", "));
- // });
- // @ts-ignore
- return aliasToRuleNames;
-}
-
-/**
- * Apply (and normalize) configuration object.
- *
- * @param {Rule[]} ruleList List of rules.
- * @param {Configuration} config Configuration object.
- * @param {Object.<string, string[]>} aliasToRuleNames Map of alias to rule
- * names.
- * @returns {Configuration} Effective configuration.
- */
-function getEffectiveConfig(ruleList, config, aliasToRuleNames) {
- const defaultKey = Object.keys(config).filter(
- (key) => key.toUpperCase() === "DEFAULT"
- );
- const ruleDefault = (defaultKey.length === 0) || !!config[defaultKey[0]];
- const effectiveConfig = {};
- ruleList.forEach((rule) => {
- const ruleName = rule.names[0].toUpperCase();
- effectiveConfig[ruleName] = ruleDefault;
- });
- deprecatedRuleNames.forEach((ruleName) => {
- effectiveConfig[ruleName] = false;
- });
- Object.keys(config).forEach((key) => {
- let value = config[key];
- if (value) {
- if (!(value instanceof Object)) {
- value = {};
- }
- } else {
- value = false;
- }
- const keyUpper = key.toUpperCase();
- (aliasToRuleNames[keyUpper] || []).forEach((ruleName) => {
- effectiveConfig[ruleName] = value;
- });
- });
- return effectiveConfig;
-}
-
-/**
- * Create a mapping of enabled rules per line.
- *
- * @param {Rule[]} ruleList List of rules.
- * @param {string[]} lines List of content lines.
- * @param {string[]} frontMatterLines List of front matter lines.
- * @param {boolean} noInlineConfig Whether to allow inline configuration.
- * @param {Configuration} config Configuration object.
- * @param {Object.<string, string[]>} aliasToRuleNames Map of alias to rule
- * names.
- * @returns {Object} Effective configuration and enabled rules per line number.
- */
-function getEnabledRulesPerLineNumber(
- ruleList,
- lines,
- frontMatterLines,
- noInlineConfig,
- config,
- aliasToRuleNames) {
- // Shared variables
- let enabledRules = {};
- let capturedRules = {};
- const allRuleNames = [];
- const enabledRulesPerLineNumber = new Array(1 + frontMatterLines.length);
- // Helper functions
- // eslint-disable-next-line jsdoc/require-jsdoc
- function handleInlineConfig(perLine, forEachMatch, forEachLine) {
- const input = perLine ? lines : [ lines.join("\n") ];
- input.forEach((line) => {
- if (!noInlineConfig) {
- let match = null;
- while ((match = helpers.inlineCommentRe.exec(line))) {
- const action = (match[1] || match[3]).toUpperCase();
- const parameter = match[2] || match[4];
- forEachMatch(action, parameter);
- }
- }
- if (forEachLine) {
- forEachLine();
- }
- });
- }
- // eslint-disable-next-line jsdoc/require-jsdoc
- function configureFile(action, parameter) {
- if (action === "CONFIGURE-FILE") {
- try {
- const json = JSON.parse(parameter);
- config = {
- ...config,
- ...json
- };
- } catch (ex) {
- // Ignore parse errors for inline configuration
- }
- }
- }
- // eslint-disable-next-line jsdoc/require-jsdoc
- function applyEnableDisable(action, parameter) {
- const enabled = (action.startsWith("ENABLE"));
- const items = parameter ?
- parameter.trim().toUpperCase().split(/\s+/) :
- allRuleNames;
- items.forEach((nameUpper) => {
- (aliasToRuleNames[nameUpper] || []).forEach((ruleName) => {
- enabledRules[ruleName] = enabled;
- });
- });
- }
- // eslint-disable-next-line jsdoc/require-jsdoc
- function enableDisableFile(action, parameter) {
- if ((action === "ENABLE-FILE") || (action === "DISABLE-FILE")) {
- applyEnableDisable(action, parameter);
- }
- }
- // eslint-disable-next-line jsdoc/require-jsdoc
- function captureRestoreEnableDisable(action, parameter) {
- if (action === "CAPTURE") {
- capturedRules = { ...enabledRules };
- } else if (action === "RESTORE") {
- enabledRules = { ...capturedRules };
- } else if ((action === "ENABLE") || (action === "DISABLE")) {
- enabledRules = { ...enabledRules };
- applyEnableDisable(action, parameter);
- }
- }
- // eslint-disable-next-line jsdoc/require-jsdoc
- function updateLineState() {
- enabledRulesPerLineNumber.push(enabledRules);
- }
- // Handle inline comments
- handleInlineConfig(false, configureFile);
- const effectiveConfig = getEffectiveConfig(
- ruleList, config, aliasToRuleNames);
- ruleList.forEach((rule) => {
- const ruleName = rule.names[0].toUpperCase();
- allRuleNames.push(ruleName);
- enabledRules[ruleName] = !!effectiveConfig[ruleName];
- });
- capturedRules = enabledRules;
- handleInlineConfig(true, enableDisableFile);
- handleInlineConfig(true, captureRestoreEnableDisable, updateLineState);
- // Return results
- return {
- effectiveConfig,
- enabledRulesPerLineNumber
- };
-}
-
-/**
- * Compare function for Array.prototype.sort for ascending order of errors.
- *
- * @param {LintError} a First error.
- * @param {LintError} b Second error.
- * @returns {number} Positive value if a>b, negative value if b<a, 0 otherwise.
- */
-function lineNumberComparison(a, b) {
- return a.lineNumber - b.lineNumber;
-}
-
-/**
- * Filter function to include everything.
- *
- * @returns {boolean} True.
- */
-function filterAllValues() {
- return true;
-}
-
-/**
- * Function to return unique values from a sorted errors array.
- *
- * @param {LintError} value Error instance.
- * @param {number} index Index in array.
- * @param {LintError[]} array Array of errors.
- * @returns {boolean} Filter value.
- */
-function uniqueFilterForSortedErrors(value, index, array) {
- return (index === 0) || (value.lineNumber > array[index - 1].lineNumber);
-}
-
-/**
- * Lints a string containing Markdown content.
- *
- * @param {Rule[]} ruleList List of rules.
- * @param {string} name Identifier for the content.
- * @param {string} content Markdown content
- * @param {Object} md markdown-it instance.
- * @param {Configuration} config Configuration object.
- * @param {RegExp} frontMatter Regular expression for front matter.
- * @param {boolean} handleRuleFailures Whether to handle exceptions in rules.
- * @param {boolean} noInlineConfig Whether to allow inline configuration.
- * @param {number} resultVersion Version of the LintResults object to return.
- * @param {Function} callback Callback (err, result) function.
- * @returns {void}
- */
-function lintContent(
- ruleList,
- name,
- content,
- md,
- config,
- frontMatter,
- handleRuleFailures,
- noInlineConfig,
- resultVersion,
- callback) {
- // Remove UTF-8 byte order marker (if present)
- content = content.replace(/^\ufeff/, "");
- // Remove front matter
- const removeFrontMatterResult = removeFrontMatter(content, frontMatter);
- const frontMatterLines = removeFrontMatterResult.frontMatterLines;
- // Ignore the content of HTML comments
- content = helpers.clearHtmlCommentText(removeFrontMatterResult.content);
- // Parse content into tokens and lines
- const tokens = md.parse(content, {});
- const lines = content.split(helpers.newLineRe);
- annotateTokens(tokens, lines);
- const aliasToRuleNames = mapAliasToRuleNames(ruleList);
- const { effectiveConfig, enabledRulesPerLineNumber } =
- getEnabledRulesPerLineNumber(
- ruleList,
- lines,
- frontMatterLines,
- noInlineConfig,
- config,
- aliasToRuleNames
- );
- // Create parameters for rules
- const params = {
- name,
- tokens,
- lines,
- frontMatterLines
- };
- cache.lineMetadata(helpers.getLineMetadata(params));
- cache.flattenedLists(helpers.flattenLists(params));
- // Function to run for each rule
- const result = (resultVersion === 0) ? {} : [];
- // eslint-disable-next-line jsdoc/require-jsdoc
- function forRule(rule) {
- // Configure rule
- const ruleNameFriendly = rule.names[0];
- const ruleName = ruleNameFriendly.toUpperCase();
- params.config = effectiveConfig[ruleName];
- // eslint-disable-next-line jsdoc/require-jsdoc
- function throwError(property) {
- throw new Error(
- "Property '" + property + "' of onError parameter is incorrect.");
- }
- const errors = [];
- // eslint-disable-next-line jsdoc/require-jsdoc
- function onError(errorInfo) {
- if (!errorInfo ||
- !helpers.isNumber(errorInfo.lineNumber) ||
- (errorInfo.lineNumber < 1) ||
- (errorInfo.lineNumber > lines.length)) {
- throwError("lineNumber");
- }
- if (errorInfo.detail &&
- !helpers.isString(errorInfo.detail)) {
- throwError("detail");
- }
- if (errorInfo.context &&
- !helpers.isString(errorInfo.context)) {
- throwError("context");
- }
- if (errorInfo.range &&
- (!Array.isArray(errorInfo.range) ||
- (errorInfo.range.length !== 2) ||
- !helpers.isNumber(errorInfo.range[0]) ||
- (errorInfo.range[0] < 1) ||
- !helpers.isNumber(errorInfo.range[1]) ||
- (errorInfo.range[1] < 1) ||
- ((errorInfo.range[0] + errorInfo.range[1] - 1) >
- lines[errorInfo.lineNumber - 1].length))) {
- throwError("range");
- }
- const fixInfo = errorInfo.fixInfo;
- const cleanFixInfo = {};
- if (fixInfo) {
- if (!helpers.isObject(fixInfo)) {
- throwError("fixInfo");
- }
- if (fixInfo.lineNumber !== undefined) {
- if ((!helpers.isNumber(fixInfo.lineNumber) ||
- (fixInfo.lineNumber < 1) ||
- (fixInfo.lineNumber > lines.length))) {
- throwError("fixInfo.lineNumber");
- }
- cleanFixInfo.lineNumber =
- fixInfo.lineNumber + frontMatterLines.length;
- }
- const effectiveLineNumber = fixInfo.lineNumber || errorInfo.lineNumber;
- if (fixInfo.editColumn !== undefined) {
- if ((!helpers.isNumber(fixInfo.editColumn) ||
- (fixInfo.editColumn < 1) ||
- (fixInfo.editColumn >
- lines[effectiveLineNumber - 1].length + 1))) {
- throwError("fixInfo.editColumn");
- }
- cleanFixInfo.editColumn = fixInfo.editColumn;
- }
- if (fixInfo.deleteCount !== undefined) {
- if ((!helpers.isNumber(fixInfo.deleteCount) ||
- (fixInfo.deleteCount < -1) ||
- (fixInfo.deleteCount >
- lines[effectiveLineNumber - 1].length))) {
- throwError("fixInfo.deleteCount");
- }
- cleanFixInfo.deleteCount = fixInfo.deleteCount;
- }
- if (fixInfo.insertText !== undefined) {
- if (!helpers.isString(fixInfo.insertText)) {
- throwError("fixInfo.insertText");
- }
- cleanFixInfo.insertText = fixInfo.insertText;
- }
- }
- errors.push({
- "lineNumber": errorInfo.lineNumber + frontMatterLines.length,
- "detail": errorInfo.detail || null,
- "context": errorInfo.context || null,
- "range": errorInfo.range ? [ ...errorInfo.range ] : null,
- "fixInfo": fixInfo ? cleanFixInfo : null
- });
- }
- // Call (possibly external) rule function
- if (handleRuleFailures) {
- try {
- rule.function(params, onError);
- } catch (ex) {
- onError({
- "lineNumber": 1,
- "detail": `This rule threw an exception: ${ex.message}`
- });
- }
- } else {
- rule.function(params, onError);
- }
- // Record any errors (significant performance benefit from length check)
- if (errors.length) {
- errors.sort(lineNumberComparison);
- const filteredErrors = errors
- .filter((resultVersion === 3) ?
- filterAllValues :
- uniqueFilterForSortedErrors)
- .filter(function removeDisabledRules(error) {
- return enabledRulesPerLineNumber[error.lineNumber][ruleName];
- })
- .map(function formatResults(error) {
- if (resultVersion === 0) {
- return error.lineNumber;
- }
- const errorObject = {};
- errorObject.lineNumber = error.lineNumber;
- if (resultVersion === 1) {
- errorObject.ruleName = ruleNameFriendly;
- errorObject.ruleAlias = rule.names[1] || rule.names[0];
- } else {
- errorObject.ruleNames = rule.names;
- }
- errorObject.ruleDescription = rule.description;
- errorObject.ruleInformation =
- rule.information ? rule.information.href : null;
- errorObject.errorDetail = error.detail;
- errorObject.errorContext = error.context;
- errorObject.errorRange = error.range;
- if (resultVersion === 3) {
- errorObject.fixInfo = error.fixInfo;
- }
- return errorObject;
- });
- if (filteredErrors.length) {
- if (resultVersion === 0) {
- result[ruleNameFriendly] = filteredErrors;
- } else {
- Array.prototype.push.apply(result, filteredErrors);
- }
- }
- }
- }
- // Run all rules
- try {
- ruleList.forEach(forRule);
- } catch (ex) {
- cache.clear();
- return callback(ex);
- }
- cache.clear();
- return callback(null, result);
-}
-
-/**
- * Lints a file containing Markdown content.
- *
- * @param {Rule[]} ruleList List of rules.
- * @param {string} file Path of file to lint.
- * @param {Object} md markdown-it instance.
- * @param {Configuration} config Configuration object.
- * @param {RegExp} frontMatter Regular expression for front matter.
- * @param {boolean} handleRuleFailures Whether to handle exceptions in rules.
- * @param {boolean} noInlineConfig Whether to allow inline configuration.
- * @param {number} resultVersion Version of the LintResults object to return.
- * @param {boolean} synchronous Whether to execute synchronously.
- * @param {Function} callback Callback (err, result) function.
- * @returns {void}
- */
-function lintFile(
- ruleList,
- file,
- md,
- config,
- frontMatter,
- handleRuleFailures,
- noInlineConfig,
- resultVersion,
- synchronous,
- callback) {
- // eslint-disable-next-line jsdoc/require-jsdoc
- function lintContentWrapper(err, content) {
- if (err) {
- return callback(err);
- }
- return lintContent(ruleList, file, content, md, config, frontMatter,
- handleRuleFailures, noInlineConfig, resultVersion, callback);
- }
- // Make a/synchronous call to read file
- if (synchronous) {
- lintContentWrapper(null, fs.readFileSync(file, helpers.utf8Encoding));
- } else {
- fs.readFile(file, helpers.utf8Encoding, lintContentWrapper);
- }
-}
-
-/**
- * Lint files and strings specified in the Options object.
- *
- * @param {Options} options Options object.
- * @param {boolean} synchronous Whether to execute synchronously.
- * @param {Function} callback Callback (err, result) function.
- * @returns {void}
- */
-function lintInput(options, synchronous, callback) {
- // Normalize inputs
- options = options || {};
- callback = callback || function noop() {};
- const ruleList = rules.concat(options.customRules || []);
- const ruleErr = validateRuleList(ruleList);
- if (ruleErr) {
- return callback(ruleErr);
- }
- let files = [];
- if (Array.isArray(options.files)) {
- files = options.files.slice();
- } else if (options.files) {
- files = [ String(options.files) ];
- }
- const strings = options.strings || {};
- const stringsKeys = Object.keys(strings);
- const config = options.config || { "default": true };
- const frontMatter = (options.frontMatter === undefined) ?
- helpers.frontMatterRe : options.frontMatter;
- const handleRuleFailures = !!options.handleRuleFailures;
- const noInlineConfig = !!options.noInlineConfig;
- const resultVersion = (options.resultVersion === undefined) ?
- 2 : options.resultVersion;
- const md = markdownIt({ "html": true });
- const markdownItPlugins = options.markdownItPlugins || [];
- markdownItPlugins.forEach(function forPlugin(plugin) {
- // @ts-ignore
- md.use(...plugin);
- });
- const results = newResults(ruleList);
- // Helper to lint the next string or file
- /* eslint-disable consistent-return */
- // eslint-disable-next-line jsdoc/require-jsdoc
- function lintNextItem() {
- let iterating = true;
- let item = null;
- // eslint-disable-next-line jsdoc/require-jsdoc
- function lintNextItemCallback(err, result) {
- if (err) {
- iterating = false;
- return callback(err);
- }
- results[item] = result;
- return iterating || lintNextItem();
- }
- while (iterating) {
- if ((item = stringsKeys.shift())) {
- lintContent(
- ruleList,
- item,
- strings[item] || "",
- md,
- config,
- frontMatter,
- handleRuleFailures,
- noInlineConfig,
- resultVersion,
- lintNextItemCallback);
- } else if ((item = files.shift())) {
- iterating = synchronous;
- lintFile(
- ruleList,
- item,
- md,
- config,
- frontMatter,
- handleRuleFailures,
- noInlineConfig,
- resultVersion,
- synchronous,
- lintNextItemCallback);
- } else {
- return callback(null, results);
- }
- }
- }
- return lintNextItem();
-}
-
-/**
- * Lint specified Markdown files.
- *
- * @param {Options} options Configuration options.
- * @param {LintCallback} callback Callback (err, result) function.
- * @returns {void}
- */
-function markdownlint(options, callback) {
- return lintInput(options, false, callback);
-}
-
-/**
- * Lint specified Markdown files synchronously.
- *
- * @param {Options} options Configuration options.
- * @returns {LintResults} Results object.
- */
-function markdownlintSync(options) {
- let results = null;
- lintInput(options, true, function callback(error, res) {
- if (error) {
- throw error;
- }
- results = res;
- });
- return results;
-}
-
-/**
- * Parse the content of a configuration file.
- *
- * @param {string} name Name of the configuration file.
- * @param {string} content Configuration content.
- * @param {ConfigurationParser[]} parsers Parsing function(s).
- * @returns {Object} Configuration object and error message.
- */
-function parseConfiguration(name, content, parsers) {
- let config = null;
- let message = "";
- const errors = [];
- // Try each parser
- (parsers || [ JSON.parse ]).every((parser) => {
- try {
- config = parser(content);
- } catch (ex) {
- errors.push(ex.message);
- }
- return !config;
- });
- // Message if unable to parse
- if (!config) {
- errors.unshift(`Unable to parse '${name}'`);
- message = errors.join("; ");
- }
- return {
- config,
- message
- };
-}
-
-/**
- * Read specified configuration file.
- *
- * @param {string} file Configuration file name.
- * @param {ConfigurationParser[] | ReadConfigCallback} parsers Parsing
- * function(s).
- * @param {ReadConfigCallback} [callback] Callback (err, result) function.
- * @returns {void}
- */
-function readConfig(file, parsers, callback) {
- if (!callback) {
- // @ts-ignore
- callback = parsers;
- parsers = null;
- }
- // Read file
- fs.readFile(file, helpers.utf8Encoding, (err, content) => {
- if (err) {
- return callback(err);
- }
- // Try to parse file
- // @ts-ignore
- const { config, message } = parseConfiguration(file, content, parsers);
- if (!config) {
- return callback(new Error(message));
- }
- // Extend configuration
- const configExtends = config.extends;
- if (configExtends) {
- delete config.extends;
- const extendsFile = path.resolve(path.dirname(file), configExtends);
- return readConfig(extendsFile, parsers, (errr, extendsConfig) => {
- if (errr) {
- return callback(errr);
- }
- return callback(null, {
- ...extendsConfig,
- ...config
- });
- });
- }
- return callback(null, config);
- });
-}
-
-/**
- * Read specified configuration file synchronously.
- *
- * @param {string} file Configuration file name.
- * @param {ConfigurationParser[]} [parsers] Parsing function(s).
- * @returns {Configuration} Configuration object.
- */
-function readConfigSync(file, parsers) {
- // Read file
- const content = fs.readFileSync(file, helpers.utf8Encoding);
- // Try to parse file
- const { config, message } = parseConfiguration(file, content, parsers);
- if (!config) {
- throw new Error(message);
- }
- // Extend configuration
- const configExtends = config.extends;
- if (configExtends) {
- delete config.extends;
- return {
- ...readConfigSync(
- path.resolve(path.dirname(file), configExtends),
- parsers
- ),
- ...config
- };
- }
- return config;
-}
-
-// Export a/synchronous APIs
-markdownlint.sync = markdownlintSync;
-markdownlint.readConfig = readConfig;
-markdownlint.readConfigSync = readConfigSync;
-module.exports = markdownlint;
-
-// Type declarations
-
-/**
- * Function to implement rule logic.
- *
- * @callback RuleFunction
- * @param {RuleParams} params Rule parameters.
- * @param {RuleOnError} onError Error-reporting callback.
- * @returns {void}
- */
-
-/**
- * Rule parameters.
- *
- * @typedef {Object} RuleParams
- * @property {string} name File/string name.
- * @property {MarkdownItToken[]} tokens markdown-it token objects.
- * @property {string[]} lines File/string lines.
- * @property {string[]} frontMatterLines Front matter lines.
- * @property {RuleConfiguration} config Rule configuration.
- */
-
-/**
- * Markdown-It token.
- *
- * @typedef {Object} MarkdownItToken
- * @property {string[][]} attrs HTML attributes.
- * @property {boolean} block Block-level token.
- * @property {MarkdownItToken[]} children Child nodes.
- * @property {string} content Tag contents.
- * @property {boolean} hidden Ignore element.
- * @property {string} info Fence info.
- * @property {number} level Nesting level.
- * @property {number[]} map Beginning/ending line numbers.
- * @property {string} markup Markup text.
- * @property {Object} meta Arbitrary data.
- * @property {number} nesting Level change.
- * @property {string} tag HTML tag name.
- * @property {string} type Token type.
- * @property {number} lineNumber Line number (1-based).
- * @property {string} line Line content.
- */
-
-/**
- * Error-reporting callback.
- *
- * @callback RuleOnError
- * @param {RuleOnErrorInfo} onErrorInfo Error information.
- * @returns {void}
- */
-
-/**
- * Fix information for RuleOnError callback.
- *
- * @typedef {Object} RuleOnErrorInfo
- * @property {number} lineNumber Line number (1-based).
- * @property {string} [details] Details about the error.
- * @property {string} [context] Context for the error.
- * @property {number[]} [range] Column number (1-based) and length.
- * @property {RuleOnErrorFixInfo} [fixInfo] Fix information.
- */
-
-/**
- * Fix information for RuleOnErrorInfo.
- *
- * @typedef {Object} RuleOnErrorFixInfo
- * @property {number} [lineNumber] Line number (1-based).
- * @property {number} [editColumn] Column of the fix (1-based).
- * @property {number} [deleteCount] Count of characters to delete.
- * @property {string} [insertText] Text to insert (after deleting).
- */
-
-/**
- * Rule definition.
- *
- * @typedef {Object} Rule
- * @property {string[]} names Rule name(s).
- * @property {string} description Rule description.
- * @property {URL} [information] Link to more information.
- * @property {string[]} tags Rule tag(s).
- * @property {RuleFunction} function Rule implementation.
- */
-
-/**
- * Configuration options.
- *
- * @typedef {Object} Options
- * @property {string[] | string} [files] Files to lint.
- * @property {Object.<string, string>} [strings] Strings to lint.
- * @property {Configuration} [config] Configuration object.
- * @property {Rule[] | Rule} [customRules] Custom rules.
- * @property {RegExp} [frontMatter] Front matter pattern.
- * @property {boolean} [handleRuleFailures] True to catch exceptions.
- * @property {boolean} [noInlineConfig] True to ignore HTML directives.
- * @property {number} [resultVersion] Results object version.
- * @property {Plugin[]} [markdownItPlugins] Additional plugins.
- */
-
-/**
- * markdown-it plugin.
- *
- * @typedef {Array} Plugin
- */
-
-/**
- * Function to pretty-print lint results.
- *
- * @callback ToStringCallback
- * @param {boolean} [ruleAliases] True to use rule aliases.
- * @returns {string}
- */
-
-/**
- * Lint results (for resultVersion 3).
- *
- * @typedef {Object.<string, LintError[]>} LintResults
- */
-// The following should be part of the LintResults typedef, but that causes
-// TypeScript to "forget" about the string map.
-// * @property {ToStringCallback} toString String representation.
-// https://github.com/microsoft/TypeScript/issues/34911
-
-/**
- * Lint error.
- *
- * @typedef {Object} LintError
- * @property {number} lineNumber Line number (1-based).
- * @property {string[]} ruleNames Rule name(s).
- * @property {string} ruleDescription Rule description.
- * @property {string} ruleInformation Link to more information.
- * @property {string} errorDetail Detail about the error.
- * @property {string} errorContext Context for the error.
- * @property {number[]} errorRange Column number (1-based) and length.
- * @property {FixInfo} fixInfo Fix information.
- */
-
-/**
- * Fix information.
- *
- * @typedef {Object} FixInfo
- * @property {number} [editColumn] Column of the fix (1-based).
- * @property {number} [deleteCount] Count of characters to delete.
- * @property {string} [insertText] Text to insert (after deleting).
- */
-
-/**
- * Called with the result of the lint operation.
- *
- * @callback LintCallback
- * @param {Error | null} err Error object or null.
- * @param {LintResults} [results] Lint results.
- * @returns {void}
- */
-
-/**
- * Configuration object for linting rules. For a detailed schema, see
- * {@link ../schema/markdownlint-config-schema.json}.
- *
- * @typedef {Object.<string, RuleConfiguration>} Configuration
- */
-
-/**
- * Rule configuration object.
- *
- * @typedef {boolean | Object} RuleConfiguration Rule configuration.
- */
-
-/**
- * Parses a configuration string and returns a configuration object.
- *
- * @callback ConfigurationParser
- * @param {string} text Configuration string.
- * @returns {Configuration}
- */
-
-/**
- * Called with the result of the readConfig operation.
- *
- * @callback ReadConfigCallback
- * @param {Error | null} err Error object or null.
- * @param {Configuration} [config] Configuration object.
- * @returns {void}
- */
-
-
-/***/ }),
-/* 38 */
-/***/ (function(module, exports) {
-
-module.exports = require("path");
-
-/***/ }),
-/* 39 */
-/***/ (function(module, exports) {
-
-module.exports = require("url");
-
-/***/ }),
-/* 40 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-
-module.exports = __webpack_require__(41);
-
-
-/***/ }),
-/* 41 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// Main parser class
-
-
-
-
-var utils = __webpack_require__(42);
-var helpers = __webpack_require__(56);
-var Renderer = __webpack_require__(60);
-var ParserCore = __webpack_require__(61);
-var ParserBlock = __webpack_require__(71);
-var ParserInline = __webpack_require__(86);
-var LinkifyIt = __webpack_require__(101);
-var mdurl = __webpack_require__(46);
-var punycode = __webpack_require__(103);
-
-
-var config = {
- 'default': __webpack_require__(104),
- zero: __webpack_require__(105),
- commonmark: __webpack_require__(106)
-};
-
-////////////////////////////////////////////////////////////////////////////////
-//
-// This validator can prohibit more than really needed to prevent XSS. It's a
-// tradeoff to keep code simple and to be secure by default.
-//
-// If you need different setup - override validator method as you wish. Or
-// replace it with dummy function and use external sanitizer.
-//
-
-var BAD_PROTO_RE = /^(vbscript|javascript|file|data):/;
-var GOOD_DATA_RE = /^data:image\/(gif|png|jpeg|webp);/;
-
-function validateLink(url) {
- // url should be normalized at this point, and existing entities are decoded
- var str = url.trim().toLowerCase();
-
- return BAD_PROTO_RE.test(str) ? (GOOD_DATA_RE.test(str) ? true : false) : true;
-}
-
-////////////////////////////////////////////////////////////////////////////////
-
-
-var RECODE_HOSTNAME_FOR = [ 'http:', 'https:', 'mailto:' ];
-
-function normalizeLink(url) {
- var parsed = mdurl.parse(url, true);
-
- if (parsed.hostname) {
- // Encode hostnames in urls like:
- // `http://host/`, `https://host/`, `mailto:user@host`, `//host/`
- //
- // We don't encode unknown schemas, because it's likely that we encode
- // something we shouldn't (e.g. `skype:name` treated as `skype:host`)
- //
- if (!parsed.protocol || RECODE_HOSTNAME_FOR.indexOf(parsed.protocol) >= 0) {
- try {
- parsed.hostname = punycode.toASCII(parsed.hostname);
- } catch (er) { /**/ }
- }
- }
-
- return mdurl.encode(mdurl.format(parsed));
-}
-
-function normalizeLinkText(url) {
- var parsed = mdurl.parse(url, true);
-
- if (parsed.hostname) {
- // Encode hostnames in urls like:
- // `http://host/`, `https://host/`, `mailto:user@host`, `//host/`
- //
- // We don't encode unknown schemas, because it's likely that we encode
- // something we shouldn't (e.g. `skype:name` treated as `skype:host`)
- //
- if (!parsed.protocol || RECODE_HOSTNAME_FOR.indexOf(parsed.protocol) >= 0) {
- try {
- parsed.hostname = punycode.toUnicode(parsed.hostname);
- } catch (er) { /**/ }
- }
- }
-
- return mdurl.decode(mdurl.format(parsed));
-}
-
-
-/**
- * class MarkdownIt
- *
- * Main parser/renderer class.
- *
- * ##### Usage
- *
- * ```javascript
- * // node.js, "classic" way:
- * var MarkdownIt = require('markdown-it'),
- * md = new MarkdownIt();
- * var result = md.render('# markdown-it rulezz!');
- *
- * // node.js, the same, but with sugar:
- * var md = require('markdown-it')();
- * var result = md.render('# markdown-it rulezz!');
- *
- * // browser without AMD, added to "window" on script load
- * // Note, there are no dash.
- * var md = window.markdownit();
- * var result = md.render('# markdown-it rulezz!');
- * ```
- *
- * Single line rendering, without paragraph wrap:
- *
- * ```javascript
- * var md = require('markdown-it')();
- * var result = md.renderInline('__markdown-it__ rulezz!');
- * ```
- **/
-
-/**
- * new MarkdownIt([presetName, options])
- * - presetName (String): optional, `commonmark` / `zero`
- * - options (Object)
- *
- * Creates parser instanse with given config. Can be called without `new`.
- *
- * ##### presetName
- *
- * MarkdownIt provides named presets as a convenience to quickly
- * enable/disable active syntax rules and options for common use cases.
- *
- * - ["commonmark"](https://github.com/markdown-it/markdown-it/blob/master/lib/presets/commonmark.js) -
- * configures parser to strict [CommonMark](http://commonmark.org/) mode.
- * - [default](https://github.com/markdown-it/markdown-it/blob/master/lib/presets/default.js) -
- * similar to GFM, used when no preset name given. Enables all available rules,
- * but still without html, typographer & autolinker.
- * - ["zero"](https://github.com/markdown-it/markdown-it/blob/master/lib/presets/zero.js) -
- * all rules disabled. Useful to quickly setup your config via `.enable()`.
- * For example, when you need only `bold` and `italic` markup and nothing else.
- *
- * ##### options:
- *
- * - __html__ - `false`. Set `true` to enable HTML tags in source. Be careful!
- * That's not safe! You may need external sanitizer to protect output from XSS.
- * It's better to extend features via plugins, instead of enabling HTML.
- * - __xhtmlOut__ - `false`. Set `true` to add '/' when closing single tags
- * (`<br />`). This is needed only for full CommonMark compatibility. In real
- * world you will need HTML output.
- * - __breaks__ - `false`. Set `true` to convert `\n` in paragraphs into `<br>`.
- * - __langPrefix__ - `language-`. CSS language class prefix for fenced blocks.
- * Can be useful for external highlighters.
- * - __linkify__ - `false`. Set `true` to autoconvert URL-like text to links.
- * - __typographer__ - `false`. Set `true` to enable [some language-neutral
- * replacement](https://github.com/markdown-it/markdown-it/blob/master/lib/rules_core/replacements.js) +
- * quotes beautification (smartquotes).
- * - __quotes__ - `“”‘’`, String or Array. Double + single quotes replacement
- * pairs, when typographer enabled and smartquotes on. For example, you can
- * use `'«»„“'` for Russian, `'„“‚‘'` for German, and
- * `['«\xA0', '\xA0»', '‹\xA0', '\xA0›']` for French (including nbsp).
- * - __highlight__ - `null`. Highlighter function for fenced code blocks.
- * Highlighter `function (str, lang)` should return escaped HTML. It can also
- * return empty string if the source was not changed and should be escaped
- * externaly. If result starts with <pre... internal wrapper is skipped.
- *
- * ##### Example
- *
- * ```javascript
- * // commonmark mode
- * var md = require('markdown-it')('commonmark');
- *
- * // default mode
- * var md = require('markdown-it')();
- *
- * // enable everything
- * var md = require('markdown-it')({
- * html: true,
- * linkify: true,
- * typographer: true
- * });
- * ```
- *
- * ##### Syntax highlighting
- *
- * ```js
- * var hljs = require('highlight.js') // https://highlightjs.org/
- *
- * var md = require('markdown-it')({
- * highlight: function (str, lang) {
- * if (lang && hljs.getLanguage(lang)) {
- * try {
- * return hljs.highlight(lang, str, true).value;
- * } catch (__) {}
- * }
- *
- * return ''; // use external default escaping
- * }
- * });
- * ```
- *
- * Or with full wrapper override (if you need assign class to `<pre>`):
- *
- * ```javascript
- * var hljs = require('highlight.js') // https://highlightjs.org/
- *
- * // Actual default values
- * var md = require('markdown-it')({
- * highlight: function (str, lang) {
- * if (lang && hljs.getLanguage(lang)) {
- * try {
- * return '<pre class="hljs"><code>' +
- * hljs.highlight(lang, str, true).value +
- * '</code></pre>';
- * } catch (__) {}
- * }
- *
- * return '<pre class="hljs"><code>' + md.utils.escapeHtml(str) + '</code></pre>';
- * }
- * });
- * ```
- *
- **/
-function MarkdownIt(presetName, options) {
- if (!(this instanceof MarkdownIt)) {
- return new MarkdownIt(presetName, options);
- }
-
- if (!options) {
- if (!utils.isString(presetName)) {
- options = presetName || {};
- presetName = 'default';
- }
- }
-
- /**
- * MarkdownIt#inline -> ParserInline
- *
- * Instance of [[ParserInline]]. You may need it to add new rules when
- * writing plugins. For simple rules control use [[MarkdownIt.disable]] and
- * [[MarkdownIt.enable]].
- **/
- this.inline = new ParserInline();
-
- /**
- * MarkdownIt#block -> ParserBlock
- *
- * Instance of [[ParserBlock]]. You may need it to add new rules when
- * writing plugins. For simple rules control use [[MarkdownIt.disable]] and
- * [[MarkdownIt.enable]].
- **/
- this.block = new ParserBlock();
-
- /**
- * MarkdownIt#core -> Core
- *
- * Instance of [[Core]] chain executor. You may need it to add new rules when
- * writing plugins. For simple rules control use [[MarkdownIt.disable]] and
- * [[MarkdownIt.enable]].
- **/
- this.core = new ParserCore();
-
- /**
- * MarkdownIt#renderer -> Renderer
- *
- * Instance of [[Renderer]]. Use it to modify output look. Or to add rendering
- * rules for new token types, generated by plugins.
- *
- * ##### Example
- *
- * ```javascript
- * var md = require('markdown-it')();
- *
- * function myToken(tokens, idx, options, env, self) {
- * //...
- * return result;
- * };
- *
- * md.renderer.rules['my_token'] = myToken
- * ```
- *
- * See [[Renderer]] docs and [source code](https://github.com/markdown-it/markdown-it/blob/master/lib/renderer.js).
- **/
- this.renderer = new Renderer();
-
- /**
- * MarkdownIt#linkify -> LinkifyIt
- *
- * [linkify-it](https://github.com/markdown-it/linkify-it) instance.
- * Used by [linkify](https://github.com/markdown-it/markdown-it/blob/master/lib/rules_core/linkify.js)
- * rule.
- **/
- this.linkify = new LinkifyIt();
-
- /**
- * MarkdownIt#validateLink(url) -> Boolean
- *
- * Link validation function. CommonMark allows too much in links. By default
- * we disable `javascript:`, `vbscript:`, `file:` schemas, and almost all `data:...` schemas
- * except some embedded image types.
- *
- * You can change this behaviour:
- *
- * ```javascript
- * var md = require('markdown-it')();
- * // enable everything
- * md.validateLink = function () { return true; }
- * ```
- **/
- this.validateLink = validateLink;
-
- /**
- * MarkdownIt#normalizeLink(url) -> String
- *
- * Function used to encode link url to a machine-readable format,
- * which includes url-encoding, punycode, etc.
- **/
- this.normalizeLink = normalizeLink;
-
- /**
- * MarkdownIt#normalizeLinkText(url) -> String
- *
- * Function used to decode link url to a human-readable format`
- **/
- this.normalizeLinkText = normalizeLinkText;
-
-
- // Expose utils & helpers for easy acces from plugins
-
- /**
- * MarkdownIt#utils -> utils
- *
- * Assorted utility functions, useful to write plugins. See details
- * [here](https://github.com/markdown-it/markdown-it/blob/master/lib/common/utils.js).
- **/
- this.utils = utils;
-
- /**
- * MarkdownIt#helpers -> helpers
- *
- * Link components parser functions, useful to write plugins. See details
- * [here](https://github.com/markdown-it/markdown-it/blob/master/lib/helpers).
- **/
- this.helpers = utils.assign({}, helpers);
-
-
- this.options = {};
- this.configure(presetName);
-
- if (options) { this.set(options); }
-}
-
-
-/** chainable
- * MarkdownIt.set(options)
- *
- * Set parser options (in the same format as in constructor). Probably, you
- * will never need it, but you can change options after constructor call.
- *
- * ##### Example
- *
- * ```javascript
- * var md = require('markdown-it')()
- * .set({ html: true, breaks: true })
- * .set({ typographer, true });
- * ```
- *
- * __Note:__ To achieve the best possible performance, don't modify a
- * `markdown-it` instance options on the fly. If you need multiple configurations
- * it's best to create multiple instances and initialize each with separate
- * config.
- **/
-MarkdownIt.prototype.set = function (options) {
- utils.assign(this.options, options);
- return this;
-};
-
-
-/** chainable, internal
- * MarkdownIt.configure(presets)
- *
- * Batch load of all options and compenent settings. This is internal method,
- * and you probably will not need it. But if you with - see available presets
- * and data structure [here](https://github.com/markdown-it/markdown-it/tree/master/lib/presets)
- *
- * We strongly recommend to use presets instead of direct config loads. That
- * will give better compatibility with next versions.
- **/
-MarkdownIt.prototype.configure = function (presets) {
- var self = this, presetName;
-
- if (utils.isString(presets)) {
- presetName = presets;
- presets = config[presetName];
- if (!presets) { throw new Error('Wrong `markdown-it` preset "' + presetName + '", check name'); }
- }
-
- if (!presets) { throw new Error('Wrong `markdown-it` preset, can\'t be empty'); }
-
- if (presets.options) { self.set(presets.options); }
-
- if (presets.components) {
- Object.keys(presets.components).forEach(function (name) {
- if (presets.components[name].rules) {
- self[name].ruler.enableOnly(presets.components[name].rules);
- }
- if (presets.components[name].rules2) {
- self[name].ruler2.enableOnly(presets.components[name].rules2);
- }
- });
- }
- return this;
-};
-
-
-/** chainable
- * MarkdownIt.enable(list, ignoreInvalid)
- * - list (String|Array): rule name or list of rule names to enable
- * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found.
- *
- * Enable list or rules. It will automatically find appropriate components,
- * containing rules with given names. If rule not found, and `ignoreInvalid`
- * not set - throws exception.
- *
- * ##### Example
- *
- * ```javascript
- * var md = require('markdown-it')()
- * .enable(['sub', 'sup'])
- * .disable('smartquotes');
- * ```
- **/
-MarkdownIt.prototype.enable = function (list, ignoreInvalid) {
- var result = [];
-
- if (!Array.isArray(list)) { list = [ list ]; }
-
- [ 'core', 'block', 'inline' ].forEach(function (chain) {
- result = result.concat(this[chain].ruler.enable(list, true));
- }, this);
-
- result = result.concat(this.inline.ruler2.enable(list, true));
-
- var missed = list.filter(function (name) { return result.indexOf(name) < 0; });
-
- if (missed.length && !ignoreInvalid) {
- throw new Error('MarkdownIt. Failed to enable unknown rule(s): ' + missed);
- }
-
- return this;
-};
-
-
-/** chainable
- * MarkdownIt.disable(list, ignoreInvalid)
- * - list (String|Array): rule name or list of rule names to disable.
- * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found.
- *
- * The same as [[MarkdownIt.enable]], but turn specified rules off.
- **/
-MarkdownIt.prototype.disable = function (list, ignoreInvalid) {
- var result = [];
-
- if (!Array.isArray(list)) { list = [ list ]; }
-
- [ 'core', 'block', 'inline' ].forEach(function (chain) {
- result = result.concat(this[chain].ruler.disable(list, true));
- }, this);
-
- result = result.concat(this.inline.ruler2.disable(list, true));
-
- var missed = list.filter(function (name) { return result.indexOf(name) < 0; });
-
- if (missed.length && !ignoreInvalid) {
- throw new Error('MarkdownIt. Failed to disable unknown rule(s): ' + missed);
- }
- return this;
-};
-
-
-/** chainable
- * MarkdownIt.use(plugin, params)
- *
- * Load specified plugin with given params into current parser instance.
- * It's just a sugar to call `plugin(md, params)` with curring.
- *
- * ##### Example
- *
- * ```javascript
- * var iterator = require('markdown-it-for-inline');
- * var md = require('markdown-it')()
- * .use(iterator, 'foo_replace', 'text', function (tokens, idx) {
- * tokens[idx].content = tokens[idx].content.replace(/foo/g, 'bar');
- * });
- * ```
- **/
-MarkdownIt.prototype.use = function (plugin /*, params, ... */) {
- var args = [ this ].concat(Array.prototype.slice.call(arguments, 1));
- plugin.apply(plugin, args);
- return this;
-};
-
-
-/** internal
- * MarkdownIt.parse(src, env) -> Array
- * - src (String): source string
- * - env (Object): environment sandbox
- *
- * Parse input string and returns list of block tokens (special token type
- * "inline" will contain list of inline tokens). You should not call this
- * method directly, until you write custom renderer (for example, to produce
- * AST).
- *
- * `env` is used to pass data between "distributed" rules and return additional
- * metadata like reference info, needed for the renderer. It also can be used to
- * inject data in specific cases. Usually, you will be ok to pass `{}`,
- * and then pass updated object to renderer.
- **/
-MarkdownIt.prototype.parse = function (src, env) {
- if (typeof src !== 'string') {
- throw new Error('Input data should be a String');
- }
-
- var state = new this.core.State(src, this, env);
-
- this.core.process(state);
-
- return state.tokens;
-};
-
-
-/**
- * MarkdownIt.render(src [, env]) -> String
- * - src (String): source string
- * - env (Object): environment sandbox
- *
- * Render markdown string into html. It does all magic for you :).
- *
- * `env` can be used to inject additional metadata (`{}` by default).
- * But you will not need it with high probability. See also comment
- * in [[MarkdownIt.parse]].
- **/
-MarkdownIt.prototype.render = function (src, env) {
- env = env || {};
-
- return this.renderer.render(this.parse(src, env), this.options, env);
-};
-
-
-/** internal
- * MarkdownIt.parseInline(src, env) -> Array
- * - src (String): source string
- * - env (Object): environment sandbox
- *
- * The same as [[MarkdownIt.parse]] but skip all block rules. It returns the
- * block tokens list with the single `inline` element, containing parsed inline
- * tokens in `children` property. Also updates `env` object.
- **/
-MarkdownIt.prototype.parseInline = function (src, env) {
- var state = new this.core.State(src, this, env);
-
- state.inlineMode = true;
- this.core.process(state);
-
- return state.tokens;
-};
-
-
-/**
- * MarkdownIt.renderInline(src [, env]) -> String
- * - src (String): source string
- * - env (Object): environment sandbox
- *
- * Similar to [[MarkdownIt.render]] but for single paragraph content. Result
- * will NOT be wrapped into `<p>` tags.
- **/
-MarkdownIt.prototype.renderInline = function (src, env) {
- env = env || {};
-
- return this.renderer.render(this.parseInline(src, env), this.options, env);
-};
-
-
-module.exports = MarkdownIt;
-
-
-/***/ }),
-/* 42 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// Utilities
-//
-
-
-
-function _class(obj) { return Object.prototype.toString.call(obj); }
-
-function isString(obj) { return _class(obj) === '[object String]'; }
-
-var _hasOwnProperty = Object.prototype.hasOwnProperty;
-
-function has(object, key) {
- return _hasOwnProperty.call(object, key);
-}
-
-// Merge objects
-//
-function assign(obj /*from1, from2, from3, ...*/) {
- var sources = Array.prototype.slice.call(arguments, 1);
-
- sources.forEach(function (source) {
- if (!source) { return; }
-
- if (typeof source !== 'object') {
- throw new TypeError(source + 'must be object');
- }
-
- Object.keys(source).forEach(function (key) {
- obj[key] = source[key];
- });
- });
-
- return obj;
-}
-
-// Remove element from array and put another array at those position.
-// Useful for some operations with tokens
-function arrayReplaceAt(src, pos, newElements) {
- return [].concat(src.slice(0, pos), newElements, src.slice(pos + 1));
-}
-
-////////////////////////////////////////////////////////////////////////////////
-
-function isValidEntityCode(c) {
- /*eslint no-bitwise:0*/
- // broken sequence
- if (c >= 0xD800 && c <= 0xDFFF) { return false; }
- // never used
- if (c >= 0xFDD0 && c <= 0xFDEF) { return false; }
- if ((c & 0xFFFF) === 0xFFFF || (c & 0xFFFF) === 0xFFFE) { return false; }
- // control codes
- if (c >= 0x00 && c <= 0x08) { return false; }
- if (c === 0x0B) { return false; }
- if (c >= 0x0E && c <= 0x1F) { return false; }
- if (c >= 0x7F && c <= 0x9F) { return false; }
- // out of range
- if (c > 0x10FFFF) { return false; }
- return true;
-}
-
-function fromCodePoint(c) {
- /*eslint no-bitwise:0*/
- if (c > 0xffff) {
- c -= 0x10000;
- var surrogate1 = 0xd800 + (c >> 10),
- surrogate2 = 0xdc00 + (c & 0x3ff);
-
- return String.fromCharCode(surrogate1, surrogate2);
- }
- return String.fromCharCode(c);
-}
-
-
-var UNESCAPE_MD_RE = /\\([!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~])/g;
-var ENTITY_RE = /&([a-z#][a-z0-9]{1,31});/gi;
-var UNESCAPE_ALL_RE = new RegExp(UNESCAPE_MD_RE.source + '|' + ENTITY_RE.source, 'gi');
-
-var DIGITAL_ENTITY_TEST_RE = /^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i;
-
-var entities = __webpack_require__(43);
-
-function replaceEntityPattern(match, name) {
- var code = 0;
-
- if (has(entities, name)) {
- return entities[name];
- }
-
- if (name.charCodeAt(0) === 0x23/* # */ && DIGITAL_ENTITY_TEST_RE.test(name)) {
- code = name[1].toLowerCase() === 'x' ?
- parseInt(name.slice(2), 16) : parseInt(name.slice(1), 10);
-
- if (isValidEntityCode(code)) {
- return fromCodePoint(code);
- }
- }
-
- return match;
-}
-
-/*function replaceEntities(str) {
- if (str.indexOf('&') < 0) { return str; }
-
- return str.replace(ENTITY_RE, replaceEntityPattern);
-}*/
-
-function unescapeMd(str) {
- if (str.indexOf('\\') < 0) { return str; }
- return str.replace(UNESCAPE_MD_RE, '$1');
-}
-
-function unescapeAll(str) {
- if (str.indexOf('\\') < 0 && str.indexOf('&') < 0) { return str; }
-
- return str.replace(UNESCAPE_ALL_RE, function (match, escaped, entity) {
- if (escaped) { return escaped; }
- return replaceEntityPattern(match, entity);
- });
-}
-
-////////////////////////////////////////////////////////////////////////////////
-
-var HTML_ESCAPE_TEST_RE = /[&<>"]/;
-var HTML_ESCAPE_REPLACE_RE = /[&<>"]/g;
-var HTML_REPLACEMENTS = {
- '&': '&',
- '<': '<',
- '>': '>',
- '"': '"'
-};
-
-function replaceUnsafeChar(ch) {
- return HTML_REPLACEMENTS[ch];
-}
-
-function escapeHtml(str) {
- if (HTML_ESCAPE_TEST_RE.test(str)) {
- return str.replace(HTML_ESCAPE_REPLACE_RE, replaceUnsafeChar);
- }
- return str;
-}
-
-////////////////////////////////////////////////////////////////////////////////
-
-var REGEXP_ESCAPE_RE = /[.?*+^$[\]\\(){}|-]/g;
-
-function escapeRE(str) {
- return str.replace(REGEXP_ESCAPE_RE, '\\$&');
-}
-
-////////////////////////////////////////////////////////////////////////////////
-
-function isSpace(code) {
- switch (code) {
- case 0x09:
- case 0x20:
- return true;
- }
- return false;
-}
-
-// Zs (unicode class) || [\t\f\v\r\n]
-function isWhiteSpace(code) {
- if (code >= 0x2000 && code <= 0x200A) { return true; }
- switch (code) {
- case 0x09: // \t
- case 0x0A: // \n
- case 0x0B: // \v
- case 0x0C: // \f
- case 0x0D: // \r
- case 0x20:
- case 0xA0:
- case 0x1680:
- case 0x202F:
- case 0x205F:
- case 0x3000:
- return true;
- }
- return false;
-}
-
-////////////////////////////////////////////////////////////////////////////////
-
-/*eslint-disable max-len*/
-var UNICODE_PUNCT_RE = __webpack_require__(45);
-
-// Currently without astral characters support.
-function isPunctChar(ch) {
- return UNICODE_PUNCT_RE.test(ch);
-}
-
-
-// Markdown ASCII punctuation characters.
-//
-// !, ", #, $, %, &, ', (, ), *, +, ,, -, ., /, :, ;, <, =, >, ?, @, [, \, ], ^, _, `, {, |, }, or ~
-// http://spec.commonmark.org/0.15/#ascii-punctuation-character
-//
-// Don't confuse with unicode punctuation !!! It lacks some chars in ascii range.
-//
-function isMdAsciiPunct(ch) {
- switch (ch) {
- case 0x21/* ! */:
- case 0x22/* " */:
- case 0x23/* # */:
- case 0x24/* $ */:
- case 0x25/* % */:
- case 0x26/* & */:
- case 0x27/* ' */:
- case 0x28/* ( */:
- case 0x29/* ) */:
- case 0x2A/* * */:
- case 0x2B/* + */:
- case 0x2C/* , */:
- case 0x2D/* - */:
- case 0x2E/* . */:
- case 0x2F/* / */:
- case 0x3A/* : */:
- case 0x3B/* ; */:
- case 0x3C/* < */:
- case 0x3D/* = */:
- case 0x3E/* > */:
- case 0x3F/* ? */:
- case 0x40/* @ */:
- case 0x5B/* [ */:
- case 0x5C/* \ */:
- case 0x5D/* ] */:
- case 0x5E/* ^ */:
- case 0x5F/* _ */:
- case 0x60/* ` */:
- case 0x7B/* { */:
- case 0x7C/* | */:
- case 0x7D/* } */:
- case 0x7E/* ~ */:
- return true;
- default:
- return false;
- }
-}
-
-// Hepler to unify [reference labels].
-//
-function normalizeReference(str) {
- // Trim and collapse whitespace
- //
- str = str.trim().replace(/\s+/g, ' ');
-
- // In node v10 'ẞ'.toLowerCase() === 'Ṿ', which is presumed to be a bug
- // fixed in v12 (couldn't find any details).
- //
- // So treat this one as a special case
- // (remove this when node v10 is no longer supported).
- //
- if ('ẞ'.toLowerCase() === 'Ṿ') {
- str = str.replace(/ẞ/g, 'ß');
- }
-
- // .toLowerCase().toUpperCase() should get rid of all differences
- // between letter variants.
- //
- // Simple .toLowerCase() doesn't normalize 125 code points correctly,
- // and .toUpperCase doesn't normalize 6 of them (list of exceptions:
- // İ, ϴ, ẞ, Ω, K, Å - those are already uppercased, but have differently
- // uppercased versions).
- //
- // Here's an example showing how it happens. Lets take greek letter omega:
- // uppercase U+0398 (Θ), U+03f4 (ϴ) and lowercase U+03b8 (θ), U+03d1 (ϑ)
- //
- // Unicode entries:
- // 0398;GREEK CAPITAL LETTER THETA;Lu;0;L;;;;;N;;;;03B8;
- // 03B8;GREEK SMALL LETTER THETA;Ll;0;L;;;;;N;;;0398;;0398
- // 03D1;GREEK THETA SYMBOL;Ll;0;L;<compat> 03B8;;;;N;GREEK SMALL LETTER SCRIPT THETA;;0398;;0398
- // 03F4;GREEK CAPITAL THETA SYMBOL;Lu;0;L;<compat> 0398;;;;N;;;;03B8;
- //
- // Case-insensitive comparison should treat all of them as equivalent.
- //
- // But .toLowerCase() doesn't change ϑ (it's already lowercase),
- // and .toUpperCase() doesn't change ϴ (already uppercase).
- //
- // Applying first lower then upper case normalizes any character:
- // '\u0398\u03f4\u03b8\u03d1'.toLowerCase().toUpperCase() === '\u0398\u0398\u0398\u0398'
- //
- // Note: this is equivalent to unicode case folding; unicode normalization
- // is a different step that is not required here.
- //
- // Final result should be uppercased, because it's later stored in an object
- // (this avoid a conflict with Object.prototype members,
- // most notably, `__proto__`)
- //
- return str.toLowerCase().toUpperCase();
-}
-
-////////////////////////////////////////////////////////////////////////////////
-
-// Re-export libraries commonly used in both markdown-it and its plugins,
-// so plugins won't have to depend on them explicitly, which reduces their
-// bundled size (e.g. a browser build).
-//
-exports.lib = {};
-exports.lib.mdurl = __webpack_require__(46);
-exports.lib.ucmicro = __webpack_require__(51);
-
-exports.assign = assign;
-exports.isString = isString;
-exports.has = has;
-exports.unescapeMd = unescapeMd;
-exports.unescapeAll = unescapeAll;
-exports.isValidEntityCode = isValidEntityCode;
-exports.fromCodePoint = fromCodePoint;
-// exports.replaceEntities = replaceEntities;
-exports.escapeHtml = escapeHtml;
-exports.arrayReplaceAt = arrayReplaceAt;
-exports.isSpace = isSpace;
-exports.isWhiteSpace = isWhiteSpace;
-exports.isMdAsciiPunct = isMdAsciiPunct;
-exports.isPunctChar = isPunctChar;
-exports.escapeRE = escapeRE;
-exports.normalizeReference = normalizeReference;
-
-
-/***/ }),
-/* 43 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// HTML5 entities map: { name -> utf16string }
-//
-
-
-/*eslint quotes:0*/
-module.exports = __webpack_require__(44);
-
-
-/***/ }),
-/* 44 */
-/***/ (function(module) {
-
-module.exports = JSON.parse("{\"Aacute\":\"Á\",\"aacute\":\"á\",\"Abreve\":\"Ă\",\"abreve\":\"ă\",\"ac\":\"∾\",\"acd\":\"∿\",\"acE\":\"∾̳\",\"Acirc\":\"Â\",\"acirc\":\"â\",\"acute\":\"´\",\"Acy\":\"А\",\"acy\":\"а\",\"AElig\":\"Æ\",\"aelig\":\"æ\",\"af\":\"\",\"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\":\"\",\"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\":\"\",\"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\":\"\",\"InvisibleTimes\":\"\",\"IOcy\":\"Ё\",\"iocy\":\"ё\",\"Iogon\":\"Į\",\"iogon\":\"į\",\"Iopf\":\"𝕀\",\"iopf\":\"𝕚\",\"Iota\":\"Ι\",\"iota\":\"ι\",\"iprod\":\"⨼\",\"iquest\":\"¿\",\"iscr\":\"𝒾\",\"Iscr\":\"ℐ\",\"isin\":\"∈\",\"isindot\":\"⋵\",\"isinE\":\"⋹\",\"isins\":\"⋴\",\"isinsv\":\"⋳\",\"isinv\":\"∈\",\"it\":\"\",\"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\":\"\",\"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\":\"\\n\",\"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\":\"\",\"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\":\"\",\"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\":\"\",\"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\":\"\\t\",\"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\":\"\",\"zwnj\":\"\"}");
-
-/***/ }),
-/* 45 */
-/***/ (function(module, exports) {
-
-module.exports=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4E\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDF55-\uDF59]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3E]|\uD806[\uDC3B\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/
-
-/***/ }),
-/* 46 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-
-module.exports.encode = __webpack_require__(47);
-module.exports.decode = __webpack_require__(48);
-module.exports.format = __webpack_require__(49);
-module.exports.parse = __webpack_require__(50);
-
-
-/***/ }),
-/* 47 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-
-
-var encodeCache = {};
-
-
-// Create a lookup array where anything but characters in `chars` string
-// and alphanumeric chars is percent-encoded.
-//
-function getEncodeCache(exclude) {
- var i, ch, cache = encodeCache[exclude];
- if (cache) { return cache; }
-
- cache = encodeCache[exclude] = [];
-
- for (i = 0; i < 128; i++) {
- ch = String.fromCharCode(i);
-
- if (/^[0-9a-z]$/i.test(ch)) {
- // always allow unencoded alphanumeric characters
- cache.push(ch);
- } else {
- cache.push('%' + ('0' + i.toString(16).toUpperCase()).slice(-2));
- }
- }
-
- for (i = 0; i < exclude.length; i++) {
- cache[exclude.charCodeAt(i)] = exclude[i];
- }
-
- return cache;
-}
-
-
-// Encode unsafe characters with percent-encoding, skipping already
-// encoded sequences.
-//
-// - string - string to encode
-// - exclude - list of characters to ignore (in addition to a-zA-Z0-9)
-// - keepEscaped - don't encode '%' in a correct escape sequence (default: true)
-//
-function encode(string, exclude, keepEscaped) {
- var i, l, code, nextCode, cache,
- result = '';
-
- if (typeof exclude !== 'string') {
- // encode(string, keepEscaped)
- keepEscaped = exclude;
- exclude = encode.defaultChars;
- }
-
- if (typeof keepEscaped === 'undefined') {
- keepEscaped = true;
- }
-
- cache = getEncodeCache(exclude);
-
- for (i = 0, l = string.length; i < l; i++) {
- code = string.charCodeAt(i);
-
- if (keepEscaped && code === 0x25 /* % */ && i + 2 < l) {
- if (/^[0-9a-f]{2}$/i.test(string.slice(i + 1, i + 3))) {
- result += string.slice(i, i + 3);
- i += 2;
- continue;
- }
- }
-
- if (code < 128) {
- result += cache[code];
- continue;
- }
-
- if (code >= 0xD800 && code <= 0xDFFF) {
- if (code >= 0xD800 && code <= 0xDBFF && i + 1 < l) {
- nextCode = string.charCodeAt(i + 1);
- if (nextCode >= 0xDC00 && nextCode <= 0xDFFF) {
- result += encodeURIComponent(string[i] + string[i + 1]);
- i++;
- continue;
- }
- }
- result += '%EF%BF%BD';
- continue;
- }
-
- result += encodeURIComponent(string[i]);
- }
-
- return result;
-}
-
-encode.defaultChars = ";/?:@&=+$,-_.!~*'()#";
-encode.componentChars = "-_.!~*'()";
-
-
-module.exports = encode;
-
-
-/***/ }),
-/* 48 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-
-
-/* eslint-disable no-bitwise */
-
-var decodeCache = {};
-
-function getDecodeCache(exclude) {
- var i, ch, cache = decodeCache[exclude];
- if (cache) { return cache; }
-
- cache = decodeCache[exclude] = [];
-
- for (i = 0; i < 128; i++) {
- ch = String.fromCharCode(i);
- cache.push(ch);
- }
-
- for (i = 0; i < exclude.length; i++) {
- ch = exclude.charCodeAt(i);
- cache[ch] = '%' + ('0' + ch.toString(16).toUpperCase()).slice(-2);
- }
-
- return cache;
-}
-
-
-// Decode percent-encoded string.
-//
-function decode(string, exclude) {
- var cache;
-
- if (typeof exclude !== 'string') {
- exclude = decode.defaultChars;
- }
-
- cache = getDecodeCache(exclude);
-
- return string.replace(/(%[a-f0-9]{2})+/gi, function(seq) {
- var i, l, b1, b2, b3, b4, chr,
- result = '';
-
- for (i = 0, l = seq.length; i < l; i += 3) {
- b1 = parseInt(seq.slice(i + 1, i + 3), 16);
-
- if (b1 < 0x80) {
- result += cache[b1];
- continue;
- }
-
- if ((b1 & 0xE0) === 0xC0 && (i + 3 < l)) {
- // 110xxxxx 10xxxxxx
- b2 = parseInt(seq.slice(i + 4, i + 6), 16);
-
- if ((b2 & 0xC0) === 0x80) {
- chr = ((b1 << 6) & 0x7C0) | (b2 & 0x3F);
-
- if (chr < 0x80) {
- result += '\ufffd\ufffd';
- } else {
- result += String.fromCharCode(chr);
- }
-
- i += 3;
- continue;
- }
- }
-
- if ((b1 & 0xF0) === 0xE0 && (i + 6 < l)) {
- // 1110xxxx 10xxxxxx 10xxxxxx
- b2 = parseInt(seq.slice(i + 4, i + 6), 16);
- b3 = parseInt(seq.slice(i + 7, i + 9), 16);
-
- if ((b2 & 0xC0) === 0x80 && (b3 & 0xC0) === 0x80) {
- chr = ((b1 << 12) & 0xF000) | ((b2 << 6) & 0xFC0) | (b3 & 0x3F);
-
- if (chr < 0x800 || (chr >= 0xD800 && chr <= 0xDFFF)) {
- result += '\ufffd\ufffd\ufffd';
- } else {
- result += String.fromCharCode(chr);
- }
-
- i += 6;
- continue;
- }
- }
-
- if ((b1 & 0xF8) === 0xF0 && (i + 9 < l)) {
- // 111110xx 10xxxxxx 10xxxxxx 10xxxxxx
- b2 = parseInt(seq.slice(i + 4, i + 6), 16);
- b3 = parseInt(seq.slice(i + 7, i + 9), 16);
- b4 = parseInt(seq.slice(i + 10, i + 12), 16);
-
- if ((b2 & 0xC0) === 0x80 && (b3 & 0xC0) === 0x80 && (b4 & 0xC0) === 0x80) {
- chr = ((b1 << 18) & 0x1C0000) | ((b2 << 12) & 0x3F000) | ((b3 << 6) & 0xFC0) | (b4 & 0x3F);
-
- if (chr < 0x10000 || chr > 0x10FFFF) {
- result += '\ufffd\ufffd\ufffd\ufffd';
- } else {
- chr -= 0x10000;
- result += String.fromCharCode(0xD800 + (chr >> 10), 0xDC00 + (chr & 0x3FF));
- }
-
- i += 9;
- continue;
- }
- }
-
- result += '\ufffd';
- }
-
- return result;
- });
-}
-
-
-decode.defaultChars = ';/?:@&=+$,#';
-decode.componentChars = '';
-
-
-module.exports = decode;
-
-
-/***/ }),
-/* 49 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-
-
-module.exports = function format(url) {
- var result = '';
-
- result += url.protocol || '';
- result += url.slashes ? '//' : '';
- result += url.auth ? url.auth + '@' : '';
-
- if (url.hostname && url.hostname.indexOf(':') !== -1) {
- // ipv6 address
- result += '[' + url.hostname + ']';
- } else {
- result += url.hostname || '';
- }
-
- result += url.port ? ':' + url.port : '';
- result += url.pathname || '';
- result += url.search || '';
- result += url.hash || '';
-
- return result;
-};
-
-
-/***/ }),
-/* 50 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// Copyright Joyent, Inc. and other Node contributors.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a
-// copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to permit
-// persons to whom the Software is furnished to do so, subject to the
-// following conditions:
-//
-// The above copyright notice and this permission notice shall be included
-// in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
-// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
-// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
-// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
-// USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-
-
-//
-// Changes from joyent/node:
-//
-// 1. No leading slash in paths,
-// e.g. in `url.parse('http://foo?bar')` pathname is ``, not `/`
-//
-// 2. Backslashes are not replaced with slashes,
-// so `http:\\example.org\` is treated like a relative path
-//
-// 3. Trailing colon is treated like a part of the path,
-// i.e. in `http://example.org:foo` pathname is `:foo`
-//
-// 4. Nothing is URL-encoded in the resulting object,
-// (in joyent/node some chars in auth and paths are encoded)
-//
-// 5. `url.parse()` does not have `parseQueryString` argument
-//
-// 6. Removed extraneous result properties: `host`, `path`, `query`, etc.,
-// which can be constructed using other parts of the url.
-//
-
-
-function Url() {
- this.protocol = null;
- this.slashes = null;
- this.auth = null;
- this.port = null;
- this.hostname = null;
- this.hash = null;
- this.search = null;
- this.pathname = null;
-}
-
-// Reference: RFC 3986, RFC 1808, RFC 2396
-
-// define these here so at least they only have to be
-// compiled once on the first module load.
-var protocolPattern = /^([a-z0-9.+-]+:)/i,
- portPattern = /:[0-9]*$/,
-
- // Special case for a simple path URL
- simplePathPattern = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,
-
- // RFC 2396: characters reserved for delimiting URLs.
- // We actually just auto-escape these.
- delims = [ '<', '>', '"', '`', ' ', '\r', '\n', '\t' ],
-
- // RFC 2396: characters not allowed for various reasons.
- unwise = [ '{', '}', '|', '\\', '^', '`' ].concat(delims),
-
- // Allowed by RFCs, but cause of XSS attacks. Always escape these.
- autoEscape = [ '\'' ].concat(unwise),
- // Characters that are never ever allowed in a hostname.
- // Note that any invalid chars are also handled, but these
- // are the ones that are *expected* to be seen, so we fast-path
- // them.
- nonHostChars = [ '%', '/', '?', ';', '#' ].concat(autoEscape),
- hostEndingChars = [ '/', '?', '#' ],
- hostnameMaxLen = 255,
- hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/,
- hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/,
- // protocols that can allow "unsafe" and "unwise" chars.
- /* eslint-disable no-script-url */
- // protocols that never have a hostname.
- hostlessProtocol = {
- 'javascript': true,
- 'javascript:': true
- },
- // protocols that always contain a // bit.
- slashedProtocol = {
- 'http': true,
- 'https': true,
- 'ftp': true,
- 'gopher': true,
- 'file': true,
- 'http:': true,
- 'https:': true,
- 'ftp:': true,
- 'gopher:': true,
- 'file:': true
- };
- /* eslint-enable no-script-url */
-
-function urlParse(url, slashesDenoteHost) {
- if (url && url instanceof Url) { return url; }
-
- var u = new Url();
- u.parse(url, slashesDenoteHost);
- return u;
-}
-
-Url.prototype.parse = function(url, slashesDenoteHost) {
- var i, l, lowerProto, hec, slashes,
- rest = url;
-
- // trim before proceeding.
- // This is to support parse stuff like " http://foo.com \n"
- rest = rest.trim();
-
- if (!slashesDenoteHost && url.split('#').length === 1) {
- // Try fast path regexp
- var simplePath = simplePathPattern.exec(rest);
- if (simplePath) {
- this.pathname = simplePath[1];
- if (simplePath[2]) {
- this.search = simplePath[2];
- }
- return this;
- }
- }
-
- var proto = protocolPattern.exec(rest);
- if (proto) {
- proto = proto[0];
- lowerProto = proto.toLowerCase();
- this.protocol = proto;
- rest = rest.substr(proto.length);
- }
-
- // figure out if it's got a host
- // user@server is *always* interpreted as a hostname, and url
- // resolution will treat //foo/bar as host=foo,path=bar because that's
- // how the browser resolves relative URLs.
- if (slashesDenoteHost || proto || rest.match(/^\/\/[^@\/]+@[^@\/]+/)) {
- slashes = rest.substr(0, 2) === '//';
- if (slashes && !(proto && hostlessProtocol[proto])) {
- rest = rest.substr(2);
- this.slashes = true;
- }
- }
-
- if (!hostlessProtocol[proto] &&
- (slashes || (proto && !slashedProtocol[proto]))) {
-
- // there's a hostname.
- // the first instance of /, ?, ;, or # ends the host.
- //
- // If there is an @ in the hostname, then non-host chars *are* allowed
- // to the left of the last @ sign, unless some host-ending character
- // comes *before* the @-sign.
- // URLs are obnoxious.
- //
- // ex:
- // http://a@b@c/ => user:a@b host:c
- // http://a@b?@c => user:a host:c path:/?@c
-
- // v0.12 TODO(isaacs): This is not quite how Chrome does things.
- // Review our test case against browsers more comprehensively.
-
- // find the first instance of any hostEndingChars
- var hostEnd = -1;
- for (i = 0; i < hostEndingChars.length; i++) {
- hec = rest.indexOf(hostEndingChars[i]);
- if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) {
- hostEnd = hec;
- }
- }
-
- // at this point, either we have an explicit point where the
- // auth portion cannot go past, or the last @ char is the decider.
- var auth, atSign;
- if (hostEnd === -1) {
- // atSign can be anywhere.
- atSign = rest.lastIndexOf('@');
- } else {
- // atSign must be in auth portion.
- // http://a@b/c@d => host:b auth:a path:/c@d
- atSign = rest.lastIndexOf('@', hostEnd);
- }
-
- // Now we have a portion which is definitely the auth.
- // Pull that off.
- if (atSign !== -1) {
- auth = rest.slice(0, atSign);
- rest = rest.slice(atSign + 1);
- this.auth = auth;
- }
-
- // the host is the remaining to the left of the first non-host char
- hostEnd = -1;
- for (i = 0; i < nonHostChars.length; i++) {
- hec = rest.indexOf(nonHostChars[i]);
- if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) {
- hostEnd = hec;
- }
- }
- // if we still have not hit it, then the entire thing is a host.
- if (hostEnd === -1) {
- hostEnd = rest.length;
- }
-
- if (rest[hostEnd - 1] === ':') { hostEnd--; }
- var host = rest.slice(0, hostEnd);
- rest = rest.slice(hostEnd);
-
- // pull out port.
- this.parseHost(host);
-
- // we've indicated that there is a hostname,
- // so even if it's empty, it has to be present.
- this.hostname = this.hostname || '';
-
- // if hostname begins with [ and ends with ]
- // assume that it's an IPv6 address.
- var ipv6Hostname = this.hostname[0] === '[' &&
- this.hostname[this.hostname.length - 1] === ']';
-
- // validate a little.
- if (!ipv6Hostname) {
- var hostparts = this.hostname.split(/\./);
- for (i = 0, l = hostparts.length; i < l; i++) {
- var part = hostparts[i];
- if (!part) { continue; }
- if (!part.match(hostnamePartPattern)) {
- var newpart = '';
- for (var j = 0, k = part.length; j < k; j++) {
- if (part.charCodeAt(j) > 127) {
- // we replace non-ASCII char with a temporary placeholder
- // we need this to make sure size of hostname is not
- // broken by replacing non-ASCII by nothing
- newpart += 'x';
- } else {
- newpart += part[j];
- }
- }
- // we test again with ASCII char only
- if (!newpart.match(hostnamePartPattern)) {
- var validParts = hostparts.slice(0, i);
- var notHost = hostparts.slice(i + 1);
- var bit = part.match(hostnamePartStart);
- if (bit) {
- validParts.push(bit[1]);
- notHost.unshift(bit[2]);
- }
- if (notHost.length) {
- rest = notHost.join('.') + rest;
- }
- this.hostname = validParts.join('.');
- break;
- }
- }
- }
- }
-
- if (this.hostname.length > hostnameMaxLen) {
- this.hostname = '';
- }
-
- // strip [ and ] from the hostname
- // the host field still retains them, though
- if (ipv6Hostname) {
- this.hostname = this.hostname.substr(1, this.hostname.length - 2);
- }
- }
-
- // chop off from the tail first.
- var hash = rest.indexOf('#');
- if (hash !== -1) {
- // got a fragment string.
- this.hash = rest.substr(hash);
- rest = rest.slice(0, hash);
- }
- var qm = rest.indexOf('?');
- if (qm !== -1) {
- this.search = rest.substr(qm);
- rest = rest.slice(0, qm);
- }
- if (rest) { this.pathname = rest; }
- if (slashedProtocol[lowerProto] &&
- this.hostname && !this.pathname) {
- this.pathname = '';
- }
-
- return this;
-};
-
-Url.prototype.parseHost = function(host) {
- var port = portPattern.exec(host);
- if (port) {
- port = port[0];
- if (port !== ':') {
- this.port = port.substr(1);
- }
- host = host.substr(0, host.length - port.length);
- }
- if (host) { this.hostname = host; }
-};
-
-module.exports = urlParse;
-
-
-/***/ }),
-/* 51 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-exports.Any = __webpack_require__(52);
-exports.Cc = __webpack_require__(53);
-exports.Cf = __webpack_require__(54);
-exports.P = __webpack_require__(45);
-exports.Z = __webpack_require__(55);
-
-
-/***/ }),
-/* 52 */
-/***/ (function(module, exports) {
-
-module.exports=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/
-
-/***/ }),
-/* 53 */
-/***/ (function(module, exports) {
-
-module.exports=/[\0-\x1F\x7F-\x9F]/
-
-/***/ }),
-/* 54 */
-/***/ (function(module, exports) {
-
-module.exports=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/
-
-/***/ }),
-/* 55 */
-/***/ (function(module, exports) {
-
-module.exports=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/
-
-/***/ }),
-/* 56 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// Just a shortcut for bulk export
-
-
-
-exports.parseLinkLabel = __webpack_require__(57);
-exports.parseLinkDestination = __webpack_require__(58);
-exports.parseLinkTitle = __webpack_require__(59);
-
-
-/***/ }),
-/* 57 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// Parse link label
-//
-// this function assumes that first character ("[") already matches;
-// returns the end of the label
-//
-
-
-module.exports = function parseLinkLabel(state, start, disableNested) {
- var level, found, marker, prevPos,
- labelEnd = -1,
- max = state.posMax,
- oldPos = state.pos;
-
- state.pos = start + 1;
- level = 1;
-
- while (state.pos < max) {
- marker = state.src.charCodeAt(state.pos);
- if (marker === 0x5D /* ] */) {
- level--;
- if (level === 0) {
- found = true;
- break;
- }
- }
-
- prevPos = state.pos;
- state.md.inline.skipToken(state);
- if (marker === 0x5B /* [ */) {
- if (prevPos === state.pos - 1) {
- // increase level if we find text `[`, which is not a part of any token
- level++;
- } else if (disableNested) {
- state.pos = oldPos;
- return -1;
- }
- }
- }
-
- if (found) {
- labelEnd = state.pos;
- }
-
- // restore old state
- state.pos = oldPos;
-
- return labelEnd;
-};
-
-
-/***/ }),
-/* 58 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// Parse link destination
-//
-
-
-
-var unescapeAll = __webpack_require__(42).unescapeAll;
-
-
-module.exports = function parseLinkDestination(str, pos, max) {
- var code, level,
- lines = 0,
- start = pos,
- result = {
- ok: false,
- pos: 0,
- lines: 0,
- str: ''
- };
-
- if (str.charCodeAt(pos) === 0x3C /* < */) {
- pos++;
- while (pos < max) {
- code = str.charCodeAt(pos);
- if (code === 0x0A /* \n */) { return result; }
- if (code === 0x3E /* > */) {
- result.pos = pos + 1;
- result.str = unescapeAll(str.slice(start + 1, pos));
- result.ok = true;
- return result;
- }
- if (code === 0x5C /* \ */ && pos + 1 < max) {
- pos += 2;
- continue;
- }
-
- pos++;
- }
-
- // no closing '>'
- return result;
- }
-
- // this should be ... } else { ... branch
-
- level = 0;
- while (pos < max) {
- code = str.charCodeAt(pos);
-
- if (code === 0x20) { break; }
-
- // ascii control characters
- if (code < 0x20 || code === 0x7F) { break; }
-
- if (code === 0x5C /* \ */ && pos + 1 < max) {
- pos += 2;
- continue;
- }
-
- if (code === 0x28 /* ( */) {
- level++;
- }
-
- if (code === 0x29 /* ) */) {
- if (level === 0) { break; }
- level--;
- }
-
- pos++;
- }
-
- if (start === pos) { return result; }
- if (level !== 0) { return result; }
-
- result.str = unescapeAll(str.slice(start, pos));
- result.lines = lines;
- result.pos = pos;
- result.ok = true;
- return result;
-};
-
-
-/***/ }),
-/* 59 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// Parse link title
-//
-
-
-
-var unescapeAll = __webpack_require__(42).unescapeAll;
-
-
-module.exports = function parseLinkTitle(str, pos, max) {
- var code,
- marker,
- lines = 0,
- start = pos,
- result = {
- ok: false,
- pos: 0,
- lines: 0,
- str: ''
- };
-
- if (pos >= max) { return result; }
-
- marker = str.charCodeAt(pos);
-
- if (marker !== 0x22 /* " */ && marker !== 0x27 /* ' */ && marker !== 0x28 /* ( */) { return result; }
-
- pos++;
-
- // if opening marker is "(", switch it to closing marker ")"
- if (marker === 0x28) { marker = 0x29; }
-
- while (pos < max) {
- code = str.charCodeAt(pos);
- if (code === marker) {
- result.pos = pos + 1;
- result.lines = lines;
- result.str = unescapeAll(str.slice(start + 1, pos));
- result.ok = true;
- return result;
- } else if (code === 0x0A) {
- lines++;
- } else if (code === 0x5C /* \ */ && pos + 1 < max) {
- pos++;
- if (str.charCodeAt(pos) === 0x0A) {
- lines++;
- }
- }
-
- pos++;
- }
-
- return result;
-};
-
-
-/***/ }),
-/* 60 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/**
- * class Renderer
- *
- * Generates HTML from parsed token stream. Each instance has independent
- * copy of rules. Those can be rewritten with ease. Also, you can add new
- * rules if you create plugin and adds new token types.
- **/
-
-
-
-var assign = __webpack_require__(42).assign;
-var unescapeAll = __webpack_require__(42).unescapeAll;
-var escapeHtml = __webpack_require__(42).escapeHtml;
-
-
-////////////////////////////////////////////////////////////////////////////////
-
-var default_rules = {};
-
-
-default_rules.code_inline = function (tokens, idx, options, env, slf) {
- var token = tokens[idx];
-
- return '<code' + slf.renderAttrs(token) + '>' +
- escapeHtml(tokens[idx].content) +
- '</code>';
-};
-
-
-default_rules.code_block = function (tokens, idx, options, env, slf) {
- var token = tokens[idx];
-
- return '<pre' + slf.renderAttrs(token) + '><code>' +
- escapeHtml(tokens[idx].content) +
- '</code></pre>\n';
-};
-
-
-default_rules.fence = function (tokens, idx, options, env, slf) {
- var token = tokens[idx],
- info = token.info ? unescapeAll(token.info).trim() : '',
- langName = '',
- highlighted, i, tmpAttrs, tmpToken;
-
- if (info) {
- langName = info.split(/\s+/g)[0];
- }
-
- if (options.highlight) {
- highlighted = options.highlight(token.content, langName) || escapeHtml(token.content);
- } else {
- highlighted = escapeHtml(token.content);
- }
-
- if (highlighted.indexOf('<pre') === 0) {
- return highlighted + '\n';
- }
-
- // If language exists, inject class gently, without modifying original token.
- // May be, one day we will add .clone() for token and simplify this part, but
- // now we prefer to keep things local.
- if (info) {
- i = token.attrIndex('class');
- tmpAttrs = token.attrs ? token.attrs.slice() : [];
-
- if (i < 0) {
- tmpAttrs.push([ 'class', options.langPrefix + langName ]);
- } else {
- tmpAttrs[i][1] += ' ' + options.langPrefix + langName;
- }
-
- // Fake token just to render attributes
- tmpToken = {
- attrs: tmpAttrs
- };
-
- return '<pre><code' + slf.renderAttrs(tmpToken) + '>'
- + highlighted
- + '</code></pre>\n';
- }
-
-
- return '<pre><code' + slf.renderAttrs(token) + '>'
- + highlighted
- + '</code></pre>\n';
-};
-
-
-default_rules.image = function (tokens, idx, options, env, slf) {
- var token = tokens[idx];
-
- // "alt" attr MUST be set, even if empty. Because it's mandatory and
- // should be placed on proper position for tests.
- //
- // Replace content with actual value
-
- token.attrs[token.attrIndex('alt')][1] =
- slf.renderInlineAsText(token.children, options, env);
-
- return slf.renderToken(tokens, idx, options);
-};
-
-
-default_rules.hardbreak = function (tokens, idx, options /*, env */) {
- return options.xhtmlOut ? '<br />\n' : '<br>\n';
-};
-default_rules.softbreak = function (tokens, idx, options /*, env */) {
- return options.breaks ? (options.xhtmlOut ? '<br />\n' : '<br>\n') : '\n';
-};
-
-
-default_rules.text = function (tokens, idx /*, options, env */) {
- return escapeHtml(tokens[idx].content);
-};
-
-
-default_rules.html_block = function (tokens, idx /*, options, env */) {
- return tokens[idx].content;
-};
-default_rules.html_inline = function (tokens, idx /*, options, env */) {
- return tokens[idx].content;
-};
-
-
-/**
- * new Renderer()
- *
- * Creates new [[Renderer]] instance and fill [[Renderer#rules]] with defaults.
- **/
-function Renderer() {
-
- /**
- * Renderer#rules -> Object
- *
- * Contains render rules for tokens. Can be updated and extended.
- *
- * ##### Example
- *
- * ```javascript
- * var md = require('markdown-it')();
- *
- * md.renderer.rules.strong_open = function () { return '<b>'; };
- * md.renderer.rules.strong_close = function () { return '</b>'; };
- *
- * var result = md.renderInline(...);
- * ```
- *
- * Each rule is called as independent static function with fixed signature:
- *
- * ```javascript
- * function my_token_render(tokens, idx, options, env, renderer) {
- * // ...
- * return renderedHTML;
- * }
- * ```
- *
- * See [source code](https://github.com/markdown-it/markdown-it/blob/master/lib/renderer.js)
- * for more details and examples.
- **/
- this.rules = assign({}, default_rules);
-}
-
-
-/**
- * Renderer.renderAttrs(token) -> String
- *
- * Render token attributes to string.
- **/
-Renderer.prototype.renderAttrs = function renderAttrs(token) {
- var i, l, result;
-
- if (!token.attrs) { return ''; }
-
- result = '';
-
- for (i = 0, l = token.attrs.length; i < l; i++) {
- result += ' ' + escapeHtml(token.attrs[i][0]) + '="' + escapeHtml(token.attrs[i][1]) + '"';
- }
-
- return result;
-};
-
-
-/**
- * Renderer.renderToken(tokens, idx, options) -> String
- * - tokens (Array): list of tokens
- * - idx (Numbed): token index to render
- * - options (Object): params of parser instance
- *
- * Default token renderer. Can be overriden by custom function
- * in [[Renderer#rules]].
- **/
-Renderer.prototype.renderToken = function renderToken(tokens, idx, options) {
- var nextToken,
- result = '',
- needLf = false,
- token = tokens[idx];
-
- // Tight list paragraphs
- if (token.hidden) {
- return '';
- }
-
- // Insert a newline between hidden paragraph and subsequent opening
- // block-level tag.
- //
- // For example, here we should insert a newline before blockquote:
- // - a
- // >
- //
- if (token.block && token.nesting !== -1 && idx && tokens[idx - 1].hidden) {
- result += '\n';
- }
-
- // Add token name, e.g. `<img`
- result += (token.nesting === -1 ? '</' : '<') + token.tag;
-
- // Encode attributes, e.g. `<img src="foo"`
- result += this.renderAttrs(token);
-
- // Add a slash for self-closing tags, e.g. `<img src="foo" /`
- if (token.nesting === 0 && options.xhtmlOut) {
- result += ' /';
- }
-
- // Check if we need to add a newline after this tag
- if (token.block) {
- needLf = true;
-
- if (token.nesting === 1) {
- if (idx + 1 < tokens.length) {
- nextToken = tokens[idx + 1];
-
- if (nextToken.type === 'inline' || nextToken.hidden) {
- // Block-level tag containing an inline tag.
- //
- needLf = false;
-
- } else if (nextToken.nesting === -1 && nextToken.tag === token.tag) {
- // Opening tag + closing tag of the same type. E.g. `<li></li>`.
- //
- needLf = false;
- }
- }
- }
- }
-
- result += needLf ? '>\n' : '>';
-
- return result;
-};
-
-
-/**
- * Renderer.renderInline(tokens, options, env) -> String
- * - tokens (Array): list on block tokens to renter
- * - options (Object): params of parser instance
- * - env (Object): additional data from parsed input (references, for example)
- *
- * The same as [[Renderer.render]], but for single token of `inline` type.
- **/
-Renderer.prototype.renderInline = function (tokens, options, env) {
- var type,
- result = '',
- rules = this.rules;
-
- for (var i = 0, len = tokens.length; i < len; i++) {
- type = tokens[i].type;
-
- if (typeof rules[type] !== 'undefined') {
- result += rules[type](tokens, i, options, env, this);
- } else {
- result += this.renderToken(tokens, i, options);
- }
- }
-
- return result;
-};
-
-
-/** internal
- * Renderer.renderInlineAsText(tokens, options, env) -> String
- * - tokens (Array): list on block tokens to renter
- * - options (Object): params of parser instance
- * - env (Object): additional data from parsed input (references, for example)
- *
- * Special kludge for image `alt` attributes to conform CommonMark spec.
- * Don't try to use it! Spec requires to show `alt` content with stripped markup,
- * instead of simple escaping.
- **/
-Renderer.prototype.renderInlineAsText = function (tokens, options, env) {
- var result = '';
-
- for (var i = 0, len = tokens.length; i < len; i++) {
- if (tokens[i].type === 'text') {
- result += tokens[i].content;
- } else if (tokens[i].type === 'image') {
- result += this.renderInlineAsText(tokens[i].children, options, env);
- }
- }
-
- return result;
-};
-
-
-/**
- * Renderer.render(tokens, options, env) -> String
- * - tokens (Array): list on block tokens to renter
- * - options (Object): params of parser instance
- * - env (Object): additional data from parsed input (references, for example)
- *
- * Takes token stream and generates HTML. Probably, you will never need to call
- * this method directly.
- **/
-Renderer.prototype.render = function (tokens, options, env) {
- var i, len, type,
- result = '',
- rules = this.rules;
-
- for (i = 0, len = tokens.length; i < len; i++) {
- type = tokens[i].type;
-
- if (type === 'inline') {
- result += this.renderInline(tokens[i].children, options, env);
- } else if (typeof rules[type] !== 'undefined') {
- result += rules[tokens[i].type](tokens, i, options, env, this);
- } else {
- result += this.renderToken(tokens, i, options, env);
- }
- }
-
- return result;
-};
-
-module.exports = Renderer;
-
-
-/***/ }),
-/* 61 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/** internal
- * class Core
- *
- * Top-level rules executor. Glues block/inline parsers and does intermediate
- * transformations.
- **/
-
-
-
-var Ruler = __webpack_require__(62);
-
-
-var _rules = [
- [ 'normalize', __webpack_require__(63) ],
- [ 'block', __webpack_require__(64) ],
- [ 'inline', __webpack_require__(65) ],
- [ 'linkify', __webpack_require__(66) ],
- [ 'replacements', __webpack_require__(67) ],
- [ 'smartquotes', __webpack_require__(68) ]
-];
-
-
-/**
- * new Core()
- **/
-function Core() {
- /**
- * Core#ruler -> Ruler
- *
- * [[Ruler]] instance. Keep configuration of core rules.
- **/
- this.ruler = new Ruler();
-
- for (var i = 0; i < _rules.length; i++) {
- this.ruler.push(_rules[i][0], _rules[i][1]);
- }
-}
-
-
-/**
- * Core.process(state)
- *
- * Executes core chain rules.
- **/
-Core.prototype.process = function (state) {
- var i, l, rules;
-
- rules = this.ruler.getRules('');
-
- for (i = 0, l = rules.length; i < l; i++) {
- rules[i](state);
- }
-};
-
-Core.prototype.State = __webpack_require__(69);
-
-
-module.exports = Core;
-
-
-/***/ }),
-/* 62 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/**
- * class Ruler
- *
- * Helper class, used by [[MarkdownIt#core]], [[MarkdownIt#block]] and
- * [[MarkdownIt#inline]] to manage sequences of functions (rules):
- *
- * - keep rules in defined order
- * - assign the name to each rule
- * - enable/disable rules
- * - add/replace rules
- * - allow assign rules to additional named chains (in the same)
- * - cacheing lists of active rules
- *
- * You will not need use this class directly until write plugins. For simple
- * rules control use [[MarkdownIt.disable]], [[MarkdownIt.enable]] and
- * [[MarkdownIt.use]].
- **/
-
-
-
-/**
- * new Ruler()
- **/
-function Ruler() {
- // List of added rules. Each element is:
- //
- // {
- // name: XXX,
- // enabled: Boolean,
- // fn: Function(),
- // alt: [ name2, name3 ]
- // }
- //
- this.__rules__ = [];
-
- // Cached rule chains.
- //
- // First level - chain name, '' for default.
- // Second level - diginal anchor for fast filtering by charcodes.
- //
- this.__cache__ = null;
-}
-
-////////////////////////////////////////////////////////////////////////////////
-// Helper methods, should not be used directly
-
-
-// Find rule index by name
-//
-Ruler.prototype.__find__ = function (name) {
- for (var i = 0; i < this.__rules__.length; i++) {
- if (this.__rules__[i].name === name) {
- return i;
- }
- }
- return -1;
-};
-
-
-// Build rules lookup cache
-//
-Ruler.prototype.__compile__ = function () {
- var self = this;
- var chains = [ '' ];
-
- // collect unique names
- self.__rules__.forEach(function (rule) {
- if (!rule.enabled) { return; }
-
- rule.alt.forEach(function (altName) {
- if (chains.indexOf(altName) < 0) {
- chains.push(altName);
- }
- });
- });
-
- self.__cache__ = {};
-
- chains.forEach(function (chain) {
- self.__cache__[chain] = [];
- self.__rules__.forEach(function (rule) {
- if (!rule.enabled) { return; }
-
- if (chain && rule.alt.indexOf(chain) < 0) { return; }
-
- self.__cache__[chain].push(rule.fn);
- });
- });
-};
-
-
-/**
- * Ruler.at(name, fn [, options])
- * - name (String): rule name to replace.
- * - fn (Function): new rule function.
- * - options (Object): new rule options (not mandatory).
- *
- * Replace rule by name with new function & options. Throws error if name not
- * found.
- *
- * ##### Options:
- *
- * - __alt__ - array with names of "alternate" chains.
- *
- * ##### Example
- *
- * Replace existing typographer replacement rule with new one:
- *
- * ```javascript
- * var md = require('markdown-it')();
- *
- * md.core.ruler.at('replacements', function replace(state) {
- * //...
- * });
- * ```
- **/
-Ruler.prototype.at = function (name, fn, options) {
- var index = this.__find__(name);
- var opt = options || {};
-
- if (index === -1) { throw new Error('Parser rule not found: ' + name); }
-
- this.__rules__[index].fn = fn;
- this.__rules__[index].alt = opt.alt || [];
- this.__cache__ = null;
-};
-
-
-/**
- * Ruler.before(beforeName, ruleName, fn [, options])
- * - beforeName (String): new rule will be added before this one.
- * - ruleName (String): name of added rule.
- * - fn (Function): rule function.
- * - options (Object): rule options (not mandatory).
- *
- * Add new rule to chain before one with given name. See also
- * [[Ruler.after]], [[Ruler.push]].
- *
- * ##### Options:
- *
- * - __alt__ - array with names of "alternate" chains.
- *
- * ##### Example
- *
- * ```javascript
- * var md = require('markdown-it')();
- *
- * md.block.ruler.before('paragraph', 'my_rule', function replace(state) {
- * //...
- * });
- * ```
- **/
-Ruler.prototype.before = function (beforeName, ruleName, fn, options) {
- var index = this.__find__(beforeName);
- var opt = options || {};
-
- if (index === -1) { throw new Error('Parser rule not found: ' + beforeName); }
-
- this.__rules__.splice(index, 0, {
- name: ruleName,
- enabled: true,
- fn: fn,
- alt: opt.alt || []
- });
-
- this.__cache__ = null;
-};
-
-
-/**
- * Ruler.after(afterName, ruleName, fn [, options])
- * - afterName (String): new rule will be added after this one.
- * - ruleName (String): name of added rule.
- * - fn (Function): rule function.
- * - options (Object): rule options (not mandatory).
- *
- * Add new rule to chain after one with given name. See also
- * [[Ruler.before]], [[Ruler.push]].
- *
- * ##### Options:
- *
- * - __alt__ - array with names of "alternate" chains.
- *
- * ##### Example
- *
- * ```javascript
- * var md = require('markdown-it')();
- *
- * md.inline.ruler.after('text', 'my_rule', function replace(state) {
- * //...
- * });
- * ```
- **/
-Ruler.prototype.after = function (afterName, ruleName, fn, options) {
- var index = this.__find__(afterName);
- var opt = options || {};
-
- if (index === -1) { throw new Error('Parser rule not found: ' + afterName); }
-
- this.__rules__.splice(index + 1, 0, {
- name: ruleName,
- enabled: true,
- fn: fn,
- alt: opt.alt || []
- });
-
- this.__cache__ = null;
-};
-
-/**
- * Ruler.push(ruleName, fn [, options])
- * - ruleName (String): name of added rule.
- * - fn (Function): rule function.
- * - options (Object): rule options (not mandatory).
- *
- * Push new rule to the end of chain. See also
- * [[Ruler.before]], [[Ruler.after]].
- *
- * ##### Options:
- *
- * - __alt__ - array with names of "alternate" chains.
- *
- * ##### Example
- *
- * ```javascript
- * var md = require('markdown-it')();
- *
- * md.core.ruler.push('my_rule', function replace(state) {
- * //...
- * });
- * ```
- **/
-Ruler.prototype.push = function (ruleName, fn, options) {
- var opt = options || {};
-
- this.__rules__.push({
- name: ruleName,
- enabled: true,
- fn: fn,
- alt: opt.alt || []
- });
-
- this.__cache__ = null;
-};
-
-
-/**
- * Ruler.enable(list [, ignoreInvalid]) -> Array
- * - list (String|Array): list of rule names to enable.
- * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found.
- *
- * Enable rules with given names. If any rule name not found - throw Error.
- * Errors can be disabled by second param.
- *
- * Returns list of found rule names (if no exception happened).
- *
- * See also [[Ruler.disable]], [[Ruler.enableOnly]].
- **/
-Ruler.prototype.enable = function (list, ignoreInvalid) {
- if (!Array.isArray(list)) { list = [ list ]; }
-
- var result = [];
-
- // Search by name and enable
- list.forEach(function (name) {
- var idx = this.__find__(name);
-
- if (idx < 0) {
- if (ignoreInvalid) { return; }
- throw new Error('Rules manager: invalid rule name ' + name);
- }
- this.__rules__[idx].enabled = true;
- result.push(name);
- }, this);
-
- this.__cache__ = null;
- return result;
-};
-
-
-/**
- * Ruler.enableOnly(list [, ignoreInvalid])
- * - list (String|Array): list of rule names to enable (whitelist).
- * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found.
- *
- * Enable rules with given names, and disable everything else. If any rule name
- * not found - throw Error. Errors can be disabled by second param.
- *
- * See also [[Ruler.disable]], [[Ruler.enable]].
- **/
-Ruler.prototype.enableOnly = function (list, ignoreInvalid) {
- if (!Array.isArray(list)) { list = [ list ]; }
-
- this.__rules__.forEach(function (rule) { rule.enabled = false; });
-
- this.enable(list, ignoreInvalid);
-};
-
-
-/**
- * Ruler.disable(list [, ignoreInvalid]) -> Array
- * - list (String|Array): list of rule names to disable.
- * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found.
- *
- * Disable rules with given names. If any rule name not found - throw Error.
- * Errors can be disabled by second param.
- *
- * Returns list of found rule names (if no exception happened).
- *
- * See also [[Ruler.enable]], [[Ruler.enableOnly]].
- **/
-Ruler.prototype.disable = function (list, ignoreInvalid) {
- if (!Array.isArray(list)) { list = [ list ]; }
-
- var result = [];
-
- // Search by name and disable
- list.forEach(function (name) {
- var idx = this.__find__(name);
-
- if (idx < 0) {
- if (ignoreInvalid) { return; }
- throw new Error('Rules manager: invalid rule name ' + name);
- }
- this.__rules__[idx].enabled = false;
- result.push(name);
- }, this);
-
- this.__cache__ = null;
- return result;
-};
-
-
-/**
- * Ruler.getRules(chainName) -> Array
- *
- * Return array of active functions (rules) for given chain name. It analyzes
- * rules configuration, compiles caches if not exists and returns result.
- *
- * Default chain name is `''` (empty string). It can't be skipped. That's
- * done intentionally, to keep signature monomorphic for high speed.
- **/
-Ruler.prototype.getRules = function (chainName) {
- if (this.__cache__ === null) {
- this.__compile__();
- }
-
- // Chain can be empty, if rules disabled. But we still have to return Array.
- return this.__cache__[chainName] || [];
-};
-
-module.exports = Ruler;
-
-
-/***/ }),
-/* 63 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// Normalize input string
-
-
-
-
-// https://spec.commonmark.org/0.29/#line-ending
-var NEWLINES_RE = /\r\n?|\n/g;
-var NULL_RE = /\0/g;
-
-
-module.exports = function normalize(state) {
- var str;
-
- // Normalize newlines
- str = state.src.replace(NEWLINES_RE, '\n');
-
- // Replace NULL characters
- str = str.replace(NULL_RE, '\uFFFD');
-
- state.src = str;
-};
-
-
-/***/ }),
-/* 64 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-
-module.exports = function block(state) {
- var token;
-
- if (state.inlineMode) {
- token = new state.Token('inline', '', 0);
- token.content = state.src;
- token.map = [ 0, 1 ];
- token.children = [];
- state.tokens.push(token);
- } else {
- state.md.block.parse(state.src, state.md, state.env, state.tokens);
- }
-};
-
-
-/***/ }),
-/* 65 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-module.exports = function inline(state) {
- var tokens = state.tokens, tok, i, l;
-
- // Parse inlines
- for (i = 0, l = tokens.length; i < l; i++) {
- tok = tokens[i];
- if (tok.type === 'inline') {
- state.md.inline.parse(tok.content, state.md, state.env, tok.children);
- }
- }
-};
-
-
-/***/ }),
-/* 66 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// Replace link-like texts with link nodes.
-//
-// Currently restricted by `md.validateLink()` to http/https/ftp
-//
-
-
-
-var arrayReplaceAt = __webpack_require__(42).arrayReplaceAt;
-
-
-function isLinkOpen(str) {
- return /^<a[>\s]/i.test(str);
-}
-function isLinkClose(str) {
- return /^<\/a\s*>/i.test(str);
-}
-
-
-module.exports = function linkify(state) {
- var i, j, l, tokens, token, currentToken, nodes, ln, text, pos, lastPos,
- level, htmlLinkLevel, url, fullUrl, urlText,
- blockTokens = state.tokens,
- links;
-
- if (!state.md.options.linkify) { return; }
-
- for (j = 0, l = blockTokens.length; j < l; j++) {
- if (blockTokens[j].type !== 'inline' ||
- !state.md.linkify.pretest(blockTokens[j].content)) {
- continue;
- }
-
- tokens = blockTokens[j].children;
-
- htmlLinkLevel = 0;
-
- // We scan from the end, to keep position when new tags added.
- // Use reversed logic in links start/end match
- for (i = tokens.length - 1; i >= 0; i--) {
- currentToken = tokens[i];
-
- // Skip content of markdown links
- if (currentToken.type === 'link_close') {
- i--;
- while (tokens[i].level !== currentToken.level && tokens[i].type !== 'link_open') {
- i--;
- }
- continue;
- }
-
- // Skip content of html tag links
- if (currentToken.type === 'html_inline') {
- if (isLinkOpen(currentToken.content) && htmlLinkLevel > 0) {
- htmlLinkLevel--;
- }
- if (isLinkClose(currentToken.content)) {
- htmlLinkLevel++;
- }
- }
- if (htmlLinkLevel > 0) { continue; }
-
- if (currentToken.type === 'text' && state.md.linkify.test(currentToken.content)) {
-
- text = currentToken.content;
- links = state.md.linkify.match(text);
-
- // Now split string to nodes
- nodes = [];
- level = currentToken.level;
- lastPos = 0;
-
- for (ln = 0; ln < links.length; ln++) {
-
- url = links[ln].url;
- fullUrl = state.md.normalizeLink(url);
- if (!state.md.validateLink(fullUrl)) { continue; }
-
- urlText = links[ln].text;
-
- // Linkifier might send raw hostnames like "example.com", where url
- // starts with domain name. So we prepend http:// in those cases,
- // and remove it afterwards.
- //
- if (!links[ln].schema) {
- urlText = state.md.normalizeLinkText('http://' + urlText).replace(/^http:\/\//, '');
- } else if (links[ln].schema === 'mailto:' && !/^mailto:/i.test(urlText)) {
- urlText = state.md.normalizeLinkText('mailto:' + urlText).replace(/^mailto:/, '');
- } else {
- urlText = state.md.normalizeLinkText(urlText);
- }
-
- pos = links[ln].index;
-
- if (pos > lastPos) {
- token = new state.Token('text', '', 0);
- token.content = text.slice(lastPos, pos);
- token.level = level;
- nodes.push(token);
- }
-
- token = new state.Token('link_open', 'a', 1);
- token.attrs = [ [ 'href', fullUrl ] ];
- token.level = level++;
- token.markup = 'linkify';
- token.info = 'auto';
- nodes.push(token);
-
- token = new state.Token('text', '', 0);
- token.content = urlText;
- token.level = level;
- nodes.push(token);
-
- token = new state.Token('link_close', 'a', -1);
- token.level = --level;
- token.markup = 'linkify';
- token.info = 'auto';
- nodes.push(token);
-
- lastPos = links[ln].lastIndex;
- }
- if (lastPos < text.length) {
- token = new state.Token('text', '', 0);
- token.content = text.slice(lastPos);
- token.level = level;
- nodes.push(token);
- }
-
- // replace current node
- blockTokens[j].children = tokens = arrayReplaceAt(tokens, i, nodes);
- }
- }
- }
-};
-
-
-/***/ }),
-/* 67 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// Simple typographic replacements
-//
-// (c) (C) → ©
-// (tm) (TM) → ™
-// (r) (R) → ®
-// +- → ±
-// (p) (P) -> §
-// ... → … (also ?.... → ?.., !.... → !..)
-// ???????? → ???, !!!!! → !!!, `,,` → `,`
-// -- → –, --- → —
-//
-
-
-// TODO:
-// - fractionals 1/2, 1/4, 3/4 -> ½, ¼, ¾
-// - miltiplication 2 x 4 -> 2 × 4
-
-var RARE_RE = /\+-|\.\.|\?\?\?\?|!!!!|,,|--/;
-
-// Workaround for phantomjs - need regex without /g flag,
-// or root check will fail every second time
-var SCOPED_ABBR_TEST_RE = /\((c|tm|r|p)\)/i;
-
-var SCOPED_ABBR_RE = /\((c|tm|r|p)\)/ig;
-var SCOPED_ABBR = {
- c: '©',
- r: '®',
- p: '§',
- tm: '™'
-};
-
-function replaceFn(match, name) {
- return SCOPED_ABBR[name.toLowerCase()];
-}
-
-function replace_scoped(inlineTokens) {
- var i, token, inside_autolink = 0;
-
- for (i = inlineTokens.length - 1; i >= 0; i--) {
- token = inlineTokens[i];
-
- if (token.type === 'text' && !inside_autolink) {
- token.content = token.content.replace(SCOPED_ABBR_RE, replaceFn);
- }
-
- if (token.type === 'link_open' && token.info === 'auto') {
- inside_autolink--;
- }
-
- if (token.type === 'link_close' && token.info === 'auto') {
- inside_autolink++;
- }
- }
-}
-
-function replace_rare(inlineTokens) {
- var i, token, inside_autolink = 0;
-
- for (i = inlineTokens.length - 1; i >= 0; i--) {
- token = inlineTokens[i];
-
- if (token.type === 'text' && !inside_autolink) {
- if (RARE_RE.test(token.content)) {
- token.content = token.content
- .replace(/\+-/g, '±')
- // .., ..., ....... -> …
- // but ?..... & !..... -> ?.. & !..
- .replace(/\.{2,}/g, '…').replace(/([?!])…/g, '$1..')
- .replace(/([?!]){4,}/g, '$1$1$1').replace(/,{2,}/g, ',')
- // em-dash
- .replace(/(^|[^-])---([^-]|$)/mg, '$1\u2014$2')
- // en-dash
- .replace(/(^|\s)--(\s|$)/mg, '$1\u2013$2')
- .replace(/(^|[^-\s])--([^-\s]|$)/mg, '$1\u2013$2');
- }
- }
-
- if (token.type === 'link_open' && token.info === 'auto') {
- inside_autolink--;
- }
-
- if (token.type === 'link_close' && token.info === 'auto') {
- inside_autolink++;
- }
- }
-}
-
-
-module.exports = function replace(state) {
- var blkIdx;
-
- if (!state.md.options.typographer) { return; }
-
- for (blkIdx = state.tokens.length - 1; blkIdx >= 0; blkIdx--) {
-
- if (state.tokens[blkIdx].type !== 'inline') { continue; }
-
- if (SCOPED_ABBR_TEST_RE.test(state.tokens[blkIdx].content)) {
- replace_scoped(state.tokens[blkIdx].children);
- }
-
- if (RARE_RE.test(state.tokens[blkIdx].content)) {
- replace_rare(state.tokens[blkIdx].children);
- }
-
- }
-};
-
-
-/***/ }),
-/* 68 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// Convert straight quotation marks to typographic ones
-//
-
-
-
-var isWhiteSpace = __webpack_require__(42).isWhiteSpace;
-var isPunctChar = __webpack_require__(42).isPunctChar;
-var isMdAsciiPunct = __webpack_require__(42).isMdAsciiPunct;
-
-var QUOTE_TEST_RE = /['"]/;
-var QUOTE_RE = /['"]/g;
-var APOSTROPHE = '\u2019'; /* ’ */
-
-
-function replaceAt(str, index, ch) {
- return str.substr(0, index) + ch + str.substr(index + 1);
-}
-
-function process_inlines(tokens, state) {
- var i, token, text, t, pos, max, thisLevel, item, lastChar, nextChar,
- isLastPunctChar, isNextPunctChar, isLastWhiteSpace, isNextWhiteSpace,
- canOpen, canClose, j, isSingle, stack, openQuote, closeQuote;
-
- stack = [];
-
- for (i = 0; i < tokens.length; i++) {
- token = tokens[i];
-
- thisLevel = tokens[i].level;
-
- for (j = stack.length - 1; j >= 0; j--) {
- if (stack[j].level <= thisLevel) { break; }
- }
- stack.length = j + 1;
-
- if (token.type !== 'text') { continue; }
-
- text = token.content;
- pos = 0;
- max = text.length;
-
- /*eslint no-labels:0,block-scoped-var:0*/
- OUTER:
- while (pos < max) {
- QUOTE_RE.lastIndex = pos;
- t = QUOTE_RE.exec(text);
- if (!t) { break; }
-
- canOpen = canClose = true;
- pos = t.index + 1;
- isSingle = (t[0] === "'");
-
- // Find previous character,
- // default to space if it's the beginning of the line
- //
- lastChar = 0x20;
-
- if (t.index - 1 >= 0) {
- lastChar = text.charCodeAt(t.index - 1);
- } else {
- for (j = i - 1; j >= 0; j--) {
- if (tokens[j].type === 'softbreak' || tokens[j].type === 'hardbreak') break; // lastChar defaults to 0x20
- if (tokens[j].type !== 'text') continue;
-
- lastChar = tokens[j].content.charCodeAt(tokens[j].content.length - 1);
- break;
- }
- }
-
- // Find next character,
- // default to space if it's the end of the line
- //
- nextChar = 0x20;
-
- if (pos < max) {
- nextChar = text.charCodeAt(pos);
- } else {
- for (j = i + 1; j < tokens.length; j++) {
- if (tokens[j].type === 'softbreak' || tokens[j].type === 'hardbreak') break; // nextChar defaults to 0x20
- if (tokens[j].type !== 'text') continue;
-
- nextChar = tokens[j].content.charCodeAt(0);
- break;
- }
- }
-
- isLastPunctChar = isMdAsciiPunct(lastChar) || isPunctChar(String.fromCharCode(lastChar));
- isNextPunctChar = isMdAsciiPunct(nextChar) || isPunctChar(String.fromCharCode(nextChar));
-
- isLastWhiteSpace = isWhiteSpace(lastChar);
- isNextWhiteSpace = isWhiteSpace(nextChar);
-
- if (isNextWhiteSpace) {
- canOpen = false;
- } else if (isNextPunctChar) {
- if (!(isLastWhiteSpace || isLastPunctChar)) {
- canOpen = false;
- }
- }
-
- if (isLastWhiteSpace) {
- canClose = false;
- } else if (isLastPunctChar) {
- if (!(isNextWhiteSpace || isNextPunctChar)) {
- canClose = false;
- }
- }
-
- if (nextChar === 0x22 /* " */ && t[0] === '"') {
- if (lastChar >= 0x30 /* 0 */ && lastChar <= 0x39 /* 9 */) {
- // special case: 1"" - count first quote as an inch
- canClose = canOpen = false;
- }
- }
-
- if (canOpen && canClose) {
- // treat this as the middle of the word
- canOpen = false;
- canClose = isNextPunctChar;
- }
-
- if (!canOpen && !canClose) {
- // middle of word
- if (isSingle) {
- token.content = replaceAt(token.content, t.index, APOSTROPHE);
- }
- continue;
- }
-
- if (canClose) {
- // this could be a closing quote, rewind the stack to get a match
- for (j = stack.length - 1; j >= 0; j--) {
- item = stack[j];
- if (stack[j].level < thisLevel) { break; }
- if (item.single === isSingle && stack[j].level === thisLevel) {
- item = stack[j];
-
- if (isSingle) {
- openQuote = state.md.options.quotes[2];
- closeQuote = state.md.options.quotes[3];
- } else {
- openQuote = state.md.options.quotes[0];
- closeQuote = state.md.options.quotes[1];
- }
-
- // replace token.content *before* tokens[item.token].content,
- // because, if they are pointing at the same token, replaceAt
- // could mess up indices when quote length != 1
- token.content = replaceAt(token.content, t.index, closeQuote);
- tokens[item.token].content = replaceAt(
- tokens[item.token].content, item.pos, openQuote);
-
- pos += closeQuote.length - 1;
- if (item.token === i) { pos += openQuote.length - 1; }
-
- text = token.content;
- max = text.length;
-
- stack.length = j;
- continue OUTER;
- }
- }
- }
-
- if (canOpen) {
- stack.push({
- token: i,
- pos: t.index,
- single: isSingle,
- level: thisLevel
- });
- } else if (canClose && isSingle) {
- token.content = replaceAt(token.content, t.index, APOSTROPHE);
- }
- }
- }
-}
-
-
-module.exports = function smartquotes(state) {
- /*eslint max-depth:0*/
- var blkIdx;
-
- if (!state.md.options.typographer) { return; }
-
- for (blkIdx = state.tokens.length - 1; blkIdx >= 0; blkIdx--) {
-
- if (state.tokens[blkIdx].type !== 'inline' ||
- !QUOTE_TEST_RE.test(state.tokens[blkIdx].content)) {
- continue;
- }
-
- process_inlines(state.tokens[blkIdx].children, state);
- }
-};
-
-
-/***/ }),
-/* 69 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// Core state object
-//
-
-
-var Token = __webpack_require__(70);
-
-
-function StateCore(src, md, env) {
- this.src = src;
- this.env = env;
- this.tokens = [];
- this.inlineMode = false;
- this.md = md; // link to parser instance
-}
-
-// re-export Token class to use in core rules
-StateCore.prototype.Token = Token;
-
-
-module.exports = StateCore;
-
-
-/***/ }),
-/* 70 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// Token class
-
-
-
-
-/**
- * class Token
- **/
-
-/**
- * new Token(type, tag, nesting)
- *
- * Create new token and fill passed properties.
- **/
-function Token(type, tag, nesting) {
- /**
- * Token#type -> String
- *
- * Type of the token (string, e.g. "paragraph_open")
- **/
- this.type = type;
-
- /**
- * Token#tag -> String
- *
- * html tag name, e.g. "p"
- **/
- this.tag = tag;
-
- /**
- * Token#attrs -> Array
- *
- * Html attributes. Format: `[ [ name1, value1 ], [ name2, value2 ] ]`
- **/
- this.attrs = null;
-
- /**
- * Token#map -> Array
- *
- * Source map info. Format: `[ line_begin, line_end ]`
- **/
- this.map = null;
-
- /**
- * Token#nesting -> Number
- *
- * Level change (number in {-1, 0, 1} set), where:
- *
- * - `1` means the tag is opening
- * - `0` means the tag is self-closing
- * - `-1` means the tag is closing
- **/
- this.nesting = nesting;
-
- /**
- * Token#level -> Number
- *
- * nesting level, the same as `state.level`
- **/
- this.level = 0;
-
- /**
- * Token#children -> Array
- *
- * An array of child nodes (inline and img tokens)
- **/
- this.children = null;
-
- /**
- * Token#content -> String
- *
- * In a case of self-closing tag (code, html, fence, etc.),
- * it has contents of this tag.
- **/
- this.content = '';
-
- /**
- * Token#markup -> String
- *
- * '*' or '_' for emphasis, fence string for fence, etc.
- **/
- this.markup = '';
-
- /**
- * Token#info -> String
- *
- * fence infostring
- **/
- this.info = '';
-
- /**
- * Token#meta -> Object
- *
- * A place for plugins to store an arbitrary data
- **/
- this.meta = null;
-
- /**
- * Token#block -> Boolean
- *
- * True for block-level tokens, false for inline tokens.
- * Used in renderer to calculate line breaks
- **/
- this.block = false;
-
- /**
- * Token#hidden -> Boolean
- *
- * If it's true, ignore this element when rendering. Used for tight lists
- * to hide paragraphs.
- **/
- this.hidden = false;
-}
-
-
-/**
- * Token.attrIndex(name) -> Number
- *
- * Search attribute index by name.
- **/
-Token.prototype.attrIndex = function attrIndex(name) {
- var attrs, i, len;
-
- if (!this.attrs) { return -1; }
-
- attrs = this.attrs;
-
- for (i = 0, len = attrs.length; i < len; i++) {
- if (attrs[i][0] === name) { return i; }
- }
- return -1;
-};
-
-
-/**
- * Token.attrPush(attrData)
- *
- * Add `[ name, value ]` attribute to list. Init attrs if necessary
- **/
-Token.prototype.attrPush = function attrPush(attrData) {
- if (this.attrs) {
- this.attrs.push(attrData);
- } else {
- this.attrs = [ attrData ];
- }
-};
-
-
-/**
- * Token.attrSet(name, value)
- *
- * Set `name` attribute to `value`. Override old value if exists.
- **/
-Token.prototype.attrSet = function attrSet(name, value) {
- var idx = this.attrIndex(name),
- attrData = [ name, value ];
-
- if (idx < 0) {
- this.attrPush(attrData);
- } else {
- this.attrs[idx] = attrData;
- }
-};
-
-
-/**
- * Token.attrGet(name)
- *
- * Get the value of attribute `name`, or null if it does not exist.
- **/
-Token.prototype.attrGet = function attrGet(name) {
- var idx = this.attrIndex(name), value = null;
- if (idx >= 0) {
- value = this.attrs[idx][1];
- }
- return value;
-};
-
-
-/**
- * Token.attrJoin(name, value)
- *
- * Join value to existing attribute via space. Or create new attribute if not
- * exists. Useful to operate with token classes.
- **/
-Token.prototype.attrJoin = function attrJoin(name, value) {
- var idx = this.attrIndex(name);
-
- if (idx < 0) {
- this.attrPush([ name, value ]);
- } else {
- this.attrs[idx][1] = this.attrs[idx][1] + ' ' + value;
- }
-};
-
-
-module.exports = Token;
-
-
-/***/ }),
-/* 71 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/** internal
- * class ParserBlock
- *
- * Block-level tokenizer.
- **/
-
-
-
-var Ruler = __webpack_require__(62);
-
-
-var _rules = [
- // First 2 params - rule name & source. Secondary array - list of rules,
- // which can be terminated by this one.
- [ 'table', __webpack_require__(72), [ 'paragraph', 'reference' ] ],
- [ 'code', __webpack_require__(73) ],
- [ 'fence', __webpack_require__(74), [ 'paragraph', 'reference', 'blockquote', 'list' ] ],
- [ 'blockquote', __webpack_require__(75), [ 'paragraph', 'reference', 'blockquote', 'list' ] ],
- [ 'hr', __webpack_require__(76), [ 'paragraph', 'reference', 'blockquote', 'list' ] ],
- [ 'list', __webpack_require__(77), [ 'paragraph', 'reference', 'blockquote' ] ],
- [ 'reference', __webpack_require__(78) ],
- [ 'heading', __webpack_require__(79), [ 'paragraph', 'reference', 'blockquote' ] ],
- [ 'lheading', __webpack_require__(80) ],
- [ 'html_block', __webpack_require__(81), [ 'paragraph', 'reference', 'blockquote' ] ],
- [ 'paragraph', __webpack_require__(84) ]
-];
-
-
-/**
- * new ParserBlock()
- **/
-function ParserBlock() {
- /**
- * ParserBlock#ruler -> Ruler
- *
- * [[Ruler]] instance. Keep configuration of block rules.
- **/
- this.ruler = new Ruler();
-
- for (var i = 0; i < _rules.length; i++) {
- this.ruler.push(_rules[i][0], _rules[i][1], { alt: (_rules[i][2] || []).slice() });
- }
-}
-
-
-// Generate tokens for input range
-//
-ParserBlock.prototype.tokenize = function (state, startLine, endLine) {
- var ok, i,
- rules = this.ruler.getRules(''),
- len = rules.length,
- line = startLine,
- hasEmptyLines = false,
- maxNesting = state.md.options.maxNesting;
-
- while (line < endLine) {
- state.line = line = state.skipEmptyLines(line);
- if (line >= endLine) { break; }
-
- // Termination condition for nested calls.
- // Nested calls currently used for blockquotes & lists
- if (state.sCount[line] < state.blkIndent) { break; }
-
- // If nesting level exceeded - skip tail to the end. That's not ordinary
- // situation and we should not care about content.
- if (state.level >= maxNesting) {
- state.line = endLine;
- break;
- }
-
- // Try all possible rules.
- // On success, rule should:
- //
- // - update `state.line`
- // - update `state.tokens`
- // - return true
-
- for (i = 0; i < len; i++) {
- ok = rules[i](state, line, endLine, false);
- if (ok) { break; }
- }
-
- // set state.tight if we had an empty line before current tag
- // i.e. latest empty line should not count
- state.tight = !hasEmptyLines;
-
- // paragraph might "eat" one newline after it in nested lists
- if (state.isEmpty(state.line - 1)) {
- hasEmptyLines = true;
- }
-
- line = state.line;
-
- if (line < endLine && state.isEmpty(line)) {
- hasEmptyLines = true;
- line++;
- state.line = line;
- }
- }
-};
-
-
-/**
- * ParserBlock.parse(str, md, env, outTokens)
- *
- * Process input string and push block tokens into `outTokens`
- **/
-ParserBlock.prototype.parse = function (src, md, env, outTokens) {
- var state;
-
- if (!src) { return; }
-
- state = new this.State(src, md, env, outTokens);
-
- this.tokenize(state, state.line, state.lineMax);
-};
-
-
-ParserBlock.prototype.State = __webpack_require__(85);
-
-
-module.exports = ParserBlock;
-
-
-/***/ }),
-/* 72 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// GFM table, non-standard
-
-
-
-var isSpace = __webpack_require__(42).isSpace;
-
-
-function getLine(state, line) {
- var pos = state.bMarks[line] + state.blkIndent,
- max = state.eMarks[line];
-
- return state.src.substr(pos, max - pos);
-}
-
-function escapedSplit(str) {
- var result = [],
- pos = 0,
- max = str.length,
- ch,
- escapes = 0,
- lastPos = 0,
- backTicked = false,
- lastBackTick = 0;
-
- ch = str.charCodeAt(pos);
-
- while (pos < max) {
- if (ch === 0x60/* ` */) {
- if (backTicked) {
- // make \` close code sequence, but not open it;
- // the reason is: `\` is correct code block
- backTicked = false;
- lastBackTick = pos;
- } else if (escapes % 2 === 0) {
- backTicked = true;
- lastBackTick = pos;
- }
- } else if (ch === 0x7c/* | */ && (escapes % 2 === 0) && !backTicked) {
- result.push(str.substring(lastPos, pos));
- lastPos = pos + 1;
- }
-
- if (ch === 0x5c/* \ */) {
- escapes++;
- } else {
- escapes = 0;
- }
-
- pos++;
-
- // If there was an un-closed backtick, go back to just after
- // the last backtick, but as if it was a normal character
- if (pos === max && backTicked) {
- backTicked = false;
- pos = lastBackTick + 1;
- }
-
- ch = str.charCodeAt(pos);
- }
-
- result.push(str.substring(lastPos));
-
- return result;
-}
-
-
-module.exports = function table(state, startLine, endLine, silent) {
- var ch, lineText, pos, i, nextLine, columns, columnCount, token,
- aligns, t, tableLines, tbodyLines;
-
- // should have at least two lines
- if (startLine + 2 > endLine) { return false; }
-
- nextLine = startLine + 1;
-
- if (state.sCount[nextLine] < state.blkIndent) { return false; }
-
- // if it's indented more than 3 spaces, it should be a code block
- if (state.sCount[nextLine] - state.blkIndent >= 4) { return false; }
-
- // first character of the second line should be '|', '-', ':',
- // and no other characters are allowed but spaces;
- // basically, this is the equivalent of /^[-:|][-:|\s]*$/ regexp
-
- pos = state.bMarks[nextLine] + state.tShift[nextLine];
- if (pos >= state.eMarks[nextLine]) { return false; }
-
- ch = state.src.charCodeAt(pos++);
- if (ch !== 0x7C/* | */ && ch !== 0x2D/* - */ && ch !== 0x3A/* : */) { return false; }
-
- while (pos < state.eMarks[nextLine]) {
- ch = state.src.charCodeAt(pos);
-
- if (ch !== 0x7C/* | */ && ch !== 0x2D/* - */ && ch !== 0x3A/* : */ && !isSpace(ch)) { return false; }
-
- pos++;
- }
-
- lineText = getLine(state, startLine + 1);
-
- columns = lineText.split('|');
- aligns = [];
- for (i = 0; i < columns.length; i++) {
- t = columns[i].trim();
- if (!t) {
- // allow empty columns before and after table, but not in between columns;
- // e.g. allow ` |---| `, disallow ` ---||--- `
- if (i === 0 || i === columns.length - 1) {
- continue;
- } else {
- return false;
- }
- }
-
- if (!/^:?-+:?$/.test(t)) { return false; }
- if (t.charCodeAt(t.length - 1) === 0x3A/* : */) {
- aligns.push(t.charCodeAt(0) === 0x3A/* : */ ? 'center' : 'right');
- } else if (t.charCodeAt(0) === 0x3A/* : */) {
- aligns.push('left');
- } else {
- aligns.push('');
- }
- }
-
- lineText = getLine(state, startLine).trim();
- if (lineText.indexOf('|') === -1) { return false; }
- if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
- columns = escapedSplit(lineText.replace(/^\||\|$/g, ''));
-
- // header row will define an amount of columns in the entire table,
- // and align row shouldn't be smaller than that (the rest of the rows can)
- columnCount = columns.length;
- if (columnCount > aligns.length) { return false; }
-
- if (silent) { return true; }
-
- token = state.push('table_open', 'table', 1);
- token.map = tableLines = [ startLine, 0 ];
-
- token = state.push('thead_open', 'thead', 1);
- token.map = [ startLine, startLine + 1 ];
-
- token = state.push('tr_open', 'tr', 1);
- token.map = [ startLine, startLine + 1 ];
-
- for (i = 0; i < columns.length; i++) {
- token = state.push('th_open', 'th', 1);
- token.map = [ startLine, startLine + 1 ];
- if (aligns[i]) {
- token.attrs = [ [ 'style', 'text-align:' + aligns[i] ] ];
- }
-
- token = state.push('inline', '', 0);
- token.content = columns[i].trim();
- token.map = [ startLine, startLine + 1 ];
- token.children = [];
-
- token = state.push('th_close', 'th', -1);
- }
-
- token = state.push('tr_close', 'tr', -1);
- token = state.push('thead_close', 'thead', -1);
-
- token = state.push('tbody_open', 'tbody', 1);
- token.map = tbodyLines = [ startLine + 2, 0 ];
-
- for (nextLine = startLine + 2; nextLine < endLine; nextLine++) {
- if (state.sCount[nextLine] < state.blkIndent) { break; }
-
- lineText = getLine(state, nextLine).trim();
- if (lineText.indexOf('|') === -1) { break; }
- if (state.sCount[nextLine] - state.blkIndent >= 4) { break; }
- columns = escapedSplit(lineText.replace(/^\||\|$/g, ''));
-
- token = state.push('tr_open', 'tr', 1);
- for (i = 0; i < columnCount; i++) {
- token = state.push('td_open', 'td', 1);
- if (aligns[i]) {
- token.attrs = [ [ 'style', 'text-align:' + aligns[i] ] ];
- }
-
- token = state.push('inline', '', 0);
- token.content = columns[i] ? columns[i].trim() : '';
- token.children = [];
-
- token = state.push('td_close', 'td', -1);
- }
- token = state.push('tr_close', 'tr', -1);
- }
- token = state.push('tbody_close', 'tbody', -1);
- token = state.push('table_close', 'table', -1);
-
- tableLines[1] = tbodyLines[1] = nextLine;
- state.line = nextLine;
- return true;
-};
-
-
-/***/ }),
-/* 73 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// Code block (4 spaces padded)
-
-
-
-
-module.exports = function code(state, startLine, endLine/*, silent*/) {
- var nextLine, last, token;
-
- if (state.sCount[startLine] - state.blkIndent < 4) { return false; }
-
- last = nextLine = startLine + 1;
-
- while (nextLine < endLine) {
- if (state.isEmpty(nextLine)) {
- nextLine++;
- continue;
- }
-
- if (state.sCount[nextLine] - state.blkIndent >= 4) {
- nextLine++;
- last = nextLine;
- continue;
- }
- break;
- }
-
- state.line = last;
-
- token = state.push('code_block', 'code', 0);
- token.content = state.getLines(startLine, last, 4 + state.blkIndent, true);
- token.map = [ startLine, state.line ];
-
- return true;
-};
-
-
-/***/ }),
-/* 74 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// fences (``` lang, ~~~ lang)
-
-
-
-
-module.exports = function fence(state, startLine, endLine, silent) {
- var marker, len, params, nextLine, mem, token, markup,
- haveEndMarker = false,
- pos = state.bMarks[startLine] + state.tShift[startLine],
- max = state.eMarks[startLine];
-
- // if it's indented more than 3 spaces, it should be a code block
- if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
-
- if (pos + 3 > max) { return false; }
-
- marker = state.src.charCodeAt(pos);
-
- if (marker !== 0x7E/* ~ */ && marker !== 0x60 /* ` */) {
- return false;
- }
-
- // scan marker length
- mem = pos;
- pos = state.skipChars(pos, marker);
-
- len = pos - mem;
-
- if (len < 3) { return false; }
-
- markup = state.src.slice(mem, pos);
- params = state.src.slice(pos, max);
-
- if (marker === 0x60 /* ` */) {
- if (params.indexOf(String.fromCharCode(marker)) >= 0) {
- return false;
- }
- }
-
- // Since start is found, we can report success here in validation mode
- if (silent) { return true; }
-
- // search end of block
- nextLine = startLine;
-
- for (;;) {
- nextLine++;
- if (nextLine >= endLine) {
- // unclosed block should be autoclosed by end of document.
- // also block seems to be autoclosed by end of parent
- break;
- }
-
- pos = mem = state.bMarks[nextLine] + state.tShift[nextLine];
- max = state.eMarks[nextLine];
-
- if (pos < max && state.sCount[nextLine] < state.blkIndent) {
- // non-empty line with negative indent should stop the list:
- // - ```
- // test
- break;
- }
-
- if (state.src.charCodeAt(pos) !== marker) { continue; }
-
- if (state.sCount[nextLine] - state.blkIndent >= 4) {
- // closing fence should be indented less than 4 spaces
- continue;
- }
-
- pos = state.skipChars(pos, marker);
-
- // closing code fence must be at least as long as the opening one
- if (pos - mem < len) { continue; }
-
- // make sure tail has spaces only
- pos = state.skipSpaces(pos);
-
- if (pos < max) { continue; }
-
- haveEndMarker = true;
- // found!
- break;
- }
-
- // If a fence has heading spaces, they should be removed from its inner block
- len = state.sCount[startLine];
-
- state.line = nextLine + (haveEndMarker ? 1 : 0);
-
- token = state.push('fence', 'code', 0);
- token.info = params;
- token.content = state.getLines(startLine + 1, nextLine, len, true);
- token.markup = markup;
- token.map = [ startLine, state.line ];
-
- return true;
-};
-
-
-/***/ }),
-/* 75 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// Block quotes
-
-
-
-var isSpace = __webpack_require__(42).isSpace;
-
-
-module.exports = function blockquote(state, startLine, endLine, silent) {
- var adjustTab,
- ch,
- i,
- initial,
- l,
- lastLineEmpty,
- lines,
- nextLine,
- offset,
- oldBMarks,
- oldBSCount,
- oldIndent,
- oldParentType,
- oldSCount,
- oldTShift,
- spaceAfterMarker,
- terminate,
- terminatorRules,
- token,
- wasOutdented,
- oldLineMax = state.lineMax,
- pos = state.bMarks[startLine] + state.tShift[startLine],
- max = state.eMarks[startLine];
-
- // if it's indented more than 3 spaces, it should be a code block
- if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
-
- // check the block quote marker
- if (state.src.charCodeAt(pos++) !== 0x3E/* > */) { return false; }
-
- // we know that it's going to be a valid blockquote,
- // so no point trying to find the end of it in silent mode
- if (silent) { return true; }
-
- // skip spaces after ">" and re-calculate offset
- initial = offset = state.sCount[startLine] + pos - (state.bMarks[startLine] + state.tShift[startLine]);
-
- // skip one optional space after '>'
- if (state.src.charCodeAt(pos) === 0x20 /* space */) {
- // ' > test '
- // ^ -- position start of line here:
- pos++;
- initial++;
- offset++;
- adjustTab = false;
- spaceAfterMarker = true;
- } else if (state.src.charCodeAt(pos) === 0x09 /* tab */) {
- spaceAfterMarker = true;
-
- if ((state.bsCount[startLine] + offset) % 4 === 3) {
- // ' >\t test '
- // ^ -- position start of line here (tab has width===1)
- pos++;
- initial++;
- offset++;
- adjustTab = false;
- } else {
- // ' >\t test '
- // ^ -- position start of line here + shift bsCount slightly
- // to make extra space appear
- adjustTab = true;
- }
- } else {
- spaceAfterMarker = false;
- }
-
- oldBMarks = [ state.bMarks[startLine] ];
- state.bMarks[startLine] = pos;
-
- while (pos < max) {
- ch = state.src.charCodeAt(pos);
-
- if (isSpace(ch)) {
- if (ch === 0x09) {
- offset += 4 - (offset + state.bsCount[startLine] + (adjustTab ? 1 : 0)) % 4;
- } else {
- offset++;
- }
- } else {
- break;
- }
-
- pos++;
- }
-
- oldBSCount = [ state.bsCount[startLine] ];
- state.bsCount[startLine] = state.sCount[startLine] + 1 + (spaceAfterMarker ? 1 : 0);
-
- lastLineEmpty = pos >= max;
-
- oldSCount = [ state.sCount[startLine] ];
- state.sCount[startLine] = offset - initial;
-
- oldTShift = [ state.tShift[startLine] ];
- state.tShift[startLine] = pos - state.bMarks[startLine];
-
- terminatorRules = state.md.block.ruler.getRules('blockquote');
-
- oldParentType = state.parentType;
- state.parentType = 'blockquote';
- wasOutdented = false;
-
- // Search the end of the block
- //
- // Block ends with either:
- // 1. an empty line outside:
- // ```
- // > test
- //
- // ```
- // 2. an empty line inside:
- // ```
- // >
- // test
- // ```
- // 3. another tag:
- // ```
- // > test
- // - - -
- // ```
- for (nextLine = startLine + 1; nextLine < endLine; nextLine++) {
- // check if it's outdented, i.e. it's inside list item and indented
- // less than said list item:
- //
- // ```
- // 1. anything
- // > current blockquote
- // 2. checking this line
- // ```
- if (state.sCount[nextLine] < state.blkIndent) wasOutdented = true;
-
- pos = state.bMarks[nextLine] + state.tShift[nextLine];
- max = state.eMarks[nextLine];
-
- if (pos >= max) {
- // Case 1: line is not inside the blockquote, and this line is empty.
- break;
- }
-
- if (state.src.charCodeAt(pos++) === 0x3E/* > */ && !wasOutdented) {
- // This line is inside the blockquote.
-
- // skip spaces after ">" and re-calculate offset
- initial = offset = state.sCount[nextLine] + pos - (state.bMarks[nextLine] + state.tShift[nextLine]);
-
- // skip one optional space after '>'
- if (state.src.charCodeAt(pos) === 0x20 /* space */) {
- // ' > test '
- // ^ -- position start of line here:
- pos++;
- initial++;
- offset++;
- adjustTab = false;
- spaceAfterMarker = true;
- } else if (state.src.charCodeAt(pos) === 0x09 /* tab */) {
- spaceAfterMarker = true;
-
- if ((state.bsCount[nextLine] + offset) % 4 === 3) {
- // ' >\t test '
- // ^ -- position start of line here (tab has width===1)
- pos++;
- initial++;
- offset++;
- adjustTab = false;
- } else {
- // ' >\t test '
- // ^ -- position start of line here + shift bsCount slightly
- // to make extra space appear
- adjustTab = true;
- }
- } else {
- spaceAfterMarker = false;
- }
-
- oldBMarks.push(state.bMarks[nextLine]);
- state.bMarks[nextLine] = pos;
-
- while (pos < max) {
- ch = state.src.charCodeAt(pos);
-
- if (isSpace(ch)) {
- if (ch === 0x09) {
- offset += 4 - (offset + state.bsCount[nextLine] + (adjustTab ? 1 : 0)) % 4;
- } else {
- offset++;
- }
- } else {
- break;
- }
-
- pos++;
- }
-
- lastLineEmpty = pos >= max;
-
- oldBSCount.push(state.bsCount[nextLine]);
- state.bsCount[nextLine] = state.sCount[nextLine] + 1 + (spaceAfterMarker ? 1 : 0);
-
- oldSCount.push(state.sCount[nextLine]);
- state.sCount[nextLine] = offset - initial;
-
- oldTShift.push(state.tShift[nextLine]);
- state.tShift[nextLine] = pos - state.bMarks[nextLine];
- continue;
- }
-
- // Case 2: line is not inside the blockquote, and the last line was empty.
- if (lastLineEmpty) { break; }
-
- // Case 3: another tag found.
- terminate = false;
- for (i = 0, l = terminatorRules.length; i < l; i++) {
- if (terminatorRules[i](state, nextLine, endLine, true)) {
- terminate = true;
- break;
- }
- }
-
- if (terminate) {
- // Quirk to enforce "hard termination mode" for paragraphs;
- // normally if you call `tokenize(state, startLine, nextLine)`,
- // paragraphs will look below nextLine for paragraph continuation,
- // but if blockquote is terminated by another tag, they shouldn't
- state.lineMax = nextLine;
-
- if (state.blkIndent !== 0) {
- // state.blkIndent was non-zero, we now set it to zero,
- // so we need to re-calculate all offsets to appear as
- // if indent wasn't changed
- oldBMarks.push(state.bMarks[nextLine]);
- oldBSCount.push(state.bsCount[nextLine]);
- oldTShift.push(state.tShift[nextLine]);
- oldSCount.push(state.sCount[nextLine]);
- state.sCount[nextLine] -= state.blkIndent;
- }
-
- break;
- }
-
- oldBMarks.push(state.bMarks[nextLine]);
- oldBSCount.push(state.bsCount[nextLine]);
- oldTShift.push(state.tShift[nextLine]);
- oldSCount.push(state.sCount[nextLine]);
-
- // A negative indentation means that this is a paragraph continuation
- //
- state.sCount[nextLine] = -1;
- }
-
- oldIndent = state.blkIndent;
- state.blkIndent = 0;
-
- token = state.push('blockquote_open', 'blockquote', 1);
- token.markup = '>';
- token.map = lines = [ startLine, 0 ];
-
- state.md.block.tokenize(state, startLine, nextLine);
-
- token = state.push('blockquote_close', 'blockquote', -1);
- token.markup = '>';
-
- state.lineMax = oldLineMax;
- state.parentType = oldParentType;
- lines[1] = state.line;
-
- // Restore original tShift; this might not be necessary since the parser
- // has already been here, but just to make sure we can do that.
- for (i = 0; i < oldTShift.length; i++) {
- state.bMarks[i + startLine] = oldBMarks[i];
- state.tShift[i + startLine] = oldTShift[i];
- state.sCount[i + startLine] = oldSCount[i];
- state.bsCount[i + startLine] = oldBSCount[i];
- }
- state.blkIndent = oldIndent;
-
- return true;
-};
-
-
-/***/ }),
-/* 76 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// Horizontal rule
-
-
-
-var isSpace = __webpack_require__(42).isSpace;
-
-
-module.exports = function hr(state, startLine, endLine, silent) {
- var marker, cnt, ch, token,
- pos = state.bMarks[startLine] + state.tShift[startLine],
- max = state.eMarks[startLine];
-
- // if it's indented more than 3 spaces, it should be a code block
- if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
-
- marker = state.src.charCodeAt(pos++);
-
- // Check hr marker
- if (marker !== 0x2A/* * */ &&
- marker !== 0x2D/* - */ &&
- marker !== 0x5F/* _ */) {
- return false;
- }
-
- // markers can be mixed with spaces, but there should be at least 3 of them
-
- cnt = 1;
- while (pos < max) {
- ch = state.src.charCodeAt(pos++);
- if (ch !== marker && !isSpace(ch)) { return false; }
- if (ch === marker) { cnt++; }
- }
-
- if (cnt < 3) { return false; }
-
- if (silent) { return true; }
-
- state.line = startLine + 1;
-
- token = state.push('hr', 'hr', 0);
- token.map = [ startLine, state.line ];
- token.markup = Array(cnt + 1).join(String.fromCharCode(marker));
-
- return true;
-};
-
-
-/***/ }),
-/* 77 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// Lists
-
-
-
-var isSpace = __webpack_require__(42).isSpace;
-
-
-// Search `[-+*][\n ]`, returns next pos after marker on success
-// or -1 on fail.
-function skipBulletListMarker(state, startLine) {
- var marker, pos, max, ch;
-
- pos = state.bMarks[startLine] + state.tShift[startLine];
- max = state.eMarks[startLine];
-
- marker = state.src.charCodeAt(pos++);
- // Check bullet
- if (marker !== 0x2A/* * */ &&
- marker !== 0x2D/* - */ &&
- marker !== 0x2B/* + */) {
- return -1;
- }
-
- if (pos < max) {
- ch = state.src.charCodeAt(pos);
-
- if (!isSpace(ch)) {
- // " -test " - is not a list item
- return -1;
- }
- }
-
- return pos;
-}
-
-// Search `\d+[.)][\n ]`, returns next pos after marker on success
-// or -1 on fail.
-function skipOrderedListMarker(state, startLine) {
- var ch,
- start = state.bMarks[startLine] + state.tShift[startLine],
- pos = start,
- max = state.eMarks[startLine];
-
- // List marker should have at least 2 chars (digit + dot)
- if (pos + 1 >= max) { return -1; }
-
- ch = state.src.charCodeAt(pos++);
-
- if (ch < 0x30/* 0 */ || ch > 0x39/* 9 */) { return -1; }
-
- for (;;) {
- // EOL -> fail
- if (pos >= max) { return -1; }
-
- ch = state.src.charCodeAt(pos++);
-
- if (ch >= 0x30/* 0 */ && ch <= 0x39/* 9 */) {
-
- // List marker should have no more than 9 digits
- // (prevents integer overflow in browsers)
- if (pos - start >= 10) { return -1; }
-
- continue;
- }
-
- // found valid marker
- if (ch === 0x29/* ) */ || ch === 0x2e/* . */) {
- break;
- }
-
- return -1;
- }
-
-
- if (pos < max) {
- ch = state.src.charCodeAt(pos);
-
- if (!isSpace(ch)) {
- // " 1.test " - is not a list item
- return -1;
- }
- }
- return pos;
-}
-
-function markTightParagraphs(state, idx) {
- var i, l,
- level = state.level + 2;
-
- for (i = idx + 2, l = state.tokens.length - 2; i < l; i++) {
- if (state.tokens[i].level === level && state.tokens[i].type === 'paragraph_open') {
- state.tokens[i + 2].hidden = true;
- state.tokens[i].hidden = true;
- i += 2;
- }
- }
-}
-
-
-module.exports = function list(state, startLine, endLine, silent) {
- var ch,
- contentStart,
- i,
- indent,
- indentAfterMarker,
- initial,
- isOrdered,
- itemLines,
- l,
- listLines,
- listTokIdx,
- markerCharCode,
- markerValue,
- max,
- nextLine,
- offset,
- oldListIndent,
- oldParentType,
- oldSCount,
- oldTShift,
- oldTight,
- pos,
- posAfterMarker,
- prevEmptyEnd,
- start,
- terminate,
- terminatorRules,
- token,
- isTerminatingParagraph = false,
- tight = true;
-
- // if it's indented more than 3 spaces, it should be a code block
- if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
-
- // Special case:
- // - item 1
- // - item 2
- // - item 3
- // - item 4
- // - this one is a paragraph continuation
- if (state.listIndent >= 0 &&
- state.sCount[startLine] - state.listIndent >= 4 &&
- state.sCount[startLine] < state.blkIndent) {
- return false;
- }
-
- // limit conditions when list can interrupt
- // a paragraph (validation mode only)
- if (silent && state.parentType === 'paragraph') {
- // Next list item should still terminate previous list item;
- //
- // This code can fail if plugins use blkIndent as well as lists,
- // but I hope the spec gets fixed long before that happens.
- //
- if (state.tShift[startLine] >= state.blkIndent) {
- isTerminatingParagraph = true;
- }
- }
-
- // Detect list type and position after marker
- if ((posAfterMarker = skipOrderedListMarker(state, startLine)) >= 0) {
- isOrdered = true;
- start = state.bMarks[startLine] + state.tShift[startLine];
- markerValue = Number(state.src.substr(start, posAfterMarker - start - 1));
-
- // If we're starting a new ordered list right after
- // a paragraph, it should start with 1.
- if (isTerminatingParagraph && markerValue !== 1) return false;
-
- } else if ((posAfterMarker = skipBulletListMarker(state, startLine)) >= 0) {
- isOrdered = false;
-
- } else {
- return false;
- }
-
- // If we're starting a new unordered list right after
- // a paragraph, first line should not be empty.
- if (isTerminatingParagraph) {
- if (state.skipSpaces(posAfterMarker) >= state.eMarks[startLine]) return false;
- }
-
- // We should terminate list on style change. Remember first one to compare.
- markerCharCode = state.src.charCodeAt(posAfterMarker - 1);
-
- // For validation mode we can terminate immediately
- if (silent) { return true; }
-
- // Start list
- listTokIdx = state.tokens.length;
-
- if (isOrdered) {
- token = state.push('ordered_list_open', 'ol', 1);
- if (markerValue !== 1) {
- token.attrs = [ [ 'start', markerValue ] ];
- }
-
- } else {
- token = state.push('bullet_list_open', 'ul', 1);
- }
-
- token.map = listLines = [ startLine, 0 ];
- token.markup = String.fromCharCode(markerCharCode);
-
- //
- // Iterate list items
- //
-
- nextLine = startLine;
- prevEmptyEnd = false;
- terminatorRules = state.md.block.ruler.getRules('list');
-
- oldParentType = state.parentType;
- state.parentType = 'list';
-
- while (nextLine < endLine) {
- pos = posAfterMarker;
- max = state.eMarks[nextLine];
-
- initial = offset = state.sCount[nextLine] + posAfterMarker - (state.bMarks[startLine] + state.tShift[startLine]);
-
- while (pos < max) {
- ch = state.src.charCodeAt(pos);
-
- if (ch === 0x09) {
- offset += 4 - (offset + state.bsCount[nextLine]) % 4;
- } else if (ch === 0x20) {
- offset++;
- } else {
- break;
- }
-
- pos++;
- }
-
- contentStart = pos;
-
- if (contentStart >= max) {
- // trimming space in "- \n 3" case, indent is 1 here
- indentAfterMarker = 1;
- } else {
- indentAfterMarker = offset - initial;
- }
-
- // If we have more than 4 spaces, the indent is 1
- // (the rest is just indented code block)
- if (indentAfterMarker > 4) { indentAfterMarker = 1; }
-
- // " - test"
- // ^^^^^ - calculating total length of this thing
- indent = initial + indentAfterMarker;
-
- // Run subparser & write tokens
- token = state.push('list_item_open', 'li', 1);
- token.markup = String.fromCharCode(markerCharCode);
- token.map = itemLines = [ startLine, 0 ];
-
- // change current state, then restore it after parser subcall
- oldTight = state.tight;
- oldTShift = state.tShift[startLine];
- oldSCount = state.sCount[startLine];
-
- // - example list
- // ^ listIndent position will be here
- // ^ blkIndent position will be here
- //
- oldListIndent = state.listIndent;
- state.listIndent = state.blkIndent;
- state.blkIndent = indent;
-
- state.tight = true;
- state.tShift[startLine] = contentStart - state.bMarks[startLine];
- state.sCount[startLine] = offset;
-
- if (contentStart >= max && state.isEmpty(startLine + 1)) {
- // workaround for this case
- // (list item is empty, list terminates before "foo"):
- // ~~~~~~~~
- // -
- //
- // foo
- // ~~~~~~~~
- state.line = Math.min(state.line + 2, endLine);
- } else {
- state.md.block.tokenize(state, startLine, endLine, true);
- }
-
- // If any of list item is tight, mark list as tight
- if (!state.tight || prevEmptyEnd) {
- tight = false;
- }
- // Item become loose if finish with empty line,
- // but we should filter last element, because it means list finish
- prevEmptyEnd = (state.line - startLine) > 1 && state.isEmpty(state.line - 1);
-
- state.blkIndent = state.listIndent;
- state.listIndent = oldListIndent;
- state.tShift[startLine] = oldTShift;
- state.sCount[startLine] = oldSCount;
- state.tight = oldTight;
-
- token = state.push('list_item_close', 'li', -1);
- token.markup = String.fromCharCode(markerCharCode);
-
- nextLine = startLine = state.line;
- itemLines[1] = nextLine;
- contentStart = state.bMarks[startLine];
-
- if (nextLine >= endLine) { break; }
-
- //
- // Try to check if list is terminated or continued.
- //
- if (state.sCount[nextLine] < state.blkIndent) { break; }
-
- // if it's indented more than 3 spaces, it should be a code block
- if (state.sCount[startLine] - state.blkIndent >= 4) { break; }
-
- // fail if terminating block found
- terminate = false;
- for (i = 0, l = terminatorRules.length; i < l; i++) {
- if (terminatorRules[i](state, nextLine, endLine, true)) {
- terminate = true;
- break;
- }
- }
- if (terminate) { break; }
-
- // fail if list has another type
- if (isOrdered) {
- posAfterMarker = skipOrderedListMarker(state, nextLine);
- if (posAfterMarker < 0) { break; }
- } else {
- posAfterMarker = skipBulletListMarker(state, nextLine);
- if (posAfterMarker < 0) { break; }
- }
-
- if (markerCharCode !== state.src.charCodeAt(posAfterMarker - 1)) { break; }
- }
-
- // Finalize list
- if (isOrdered) {
- token = state.push('ordered_list_close', 'ol', -1);
- } else {
- token = state.push('bullet_list_close', 'ul', -1);
- }
- token.markup = String.fromCharCode(markerCharCode);
-
- listLines[1] = nextLine;
- state.line = nextLine;
-
- state.parentType = oldParentType;
-
- // mark paragraphs tight if needed
- if (tight) {
- markTightParagraphs(state, listTokIdx);
- }
-
- return true;
-};
-
-
-/***/ }),
-/* 78 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-
-var normalizeReference = __webpack_require__(42).normalizeReference;
-var isSpace = __webpack_require__(42).isSpace;
-
-
-module.exports = function reference(state, startLine, _endLine, silent) {
- var ch,
- destEndPos,
- destEndLineNo,
- endLine,
- href,
- i,
- l,
- label,
- labelEnd,
- oldParentType,
- res,
- start,
- str,
- terminate,
- terminatorRules,
- title,
- lines = 0,
- pos = state.bMarks[startLine] + state.tShift[startLine],
- max = state.eMarks[startLine],
- nextLine = startLine + 1;
-
- // if it's indented more than 3 spaces, it should be a code block
- if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
-
- if (state.src.charCodeAt(pos) !== 0x5B/* [ */) { return false; }
-
- // Simple check to quickly interrupt scan on [link](url) at the start of line.
- // Can be useful on practice: https://github.com/markdown-it/markdown-it/issues/54
- while (++pos < max) {
- if (state.src.charCodeAt(pos) === 0x5D /* ] */ &&
- state.src.charCodeAt(pos - 1) !== 0x5C/* \ */) {
- if (pos + 1 === max) { return false; }
- if (state.src.charCodeAt(pos + 1) !== 0x3A/* : */) { return false; }
- break;
- }
- }
-
- endLine = state.lineMax;
-
- // jump line-by-line until empty one or EOF
- terminatorRules = state.md.block.ruler.getRules('reference');
-
- oldParentType = state.parentType;
- state.parentType = 'reference';
-
- for (; nextLine < endLine && !state.isEmpty(nextLine); nextLine++) {
- // this would be a code block normally, but after paragraph
- // it's considered a lazy continuation regardless of what's there
- if (state.sCount[nextLine] - state.blkIndent > 3) { continue; }
-
- // quirk for blockquotes, this line should already be checked by that rule
- if (state.sCount[nextLine] < 0) { continue; }
-
- // Some tags can terminate paragraph without empty line.
- terminate = false;
- for (i = 0, l = terminatorRules.length; i < l; i++) {
- if (terminatorRules[i](state, nextLine, endLine, true)) {
- terminate = true;
- break;
- }
- }
- if (terminate) { break; }
- }
-
- str = state.getLines(startLine, nextLine, state.blkIndent, false).trim();
- max = str.length;
-
- for (pos = 1; pos < max; pos++) {
- ch = str.charCodeAt(pos);
- if (ch === 0x5B /* [ */) {
- return false;
- } else if (ch === 0x5D /* ] */) {
- labelEnd = pos;
- break;
- } else if (ch === 0x0A /* \n */) {
- lines++;
- } else if (ch === 0x5C /* \ */) {
- pos++;
- if (pos < max && str.charCodeAt(pos) === 0x0A) {
- lines++;
- }
- }
- }
-
- if (labelEnd < 0 || str.charCodeAt(labelEnd + 1) !== 0x3A/* : */) { return false; }
-
- // [label]: destination 'title'
- // ^^^ skip optional whitespace here
- for (pos = labelEnd + 2; pos < max; pos++) {
- ch = str.charCodeAt(pos);
- if (ch === 0x0A) {
- lines++;
- } else if (isSpace(ch)) {
- /*eslint no-empty:0*/
- } else {
- break;
- }
- }
-
- // [label]: destination 'title'
- // ^^^^^^^^^^^ parse this
- res = state.md.helpers.parseLinkDestination(str, pos, max);
- if (!res.ok) { return false; }
-
- href = state.md.normalizeLink(res.str);
- if (!state.md.validateLink(href)) { return false; }
-
- pos = res.pos;
- lines += res.lines;
-
- // save cursor state, we could require to rollback later
- destEndPos = pos;
- destEndLineNo = lines;
-
- // [label]: destination 'title'
- // ^^^ skipping those spaces
- start = pos;
- for (; pos < max; pos++) {
- ch = str.charCodeAt(pos);
- if (ch === 0x0A) {
- lines++;
- } else if (isSpace(ch)) {
- /*eslint no-empty:0*/
- } else {
- break;
- }
- }
-
- // [label]: destination 'title'
- // ^^^^^^^ parse this
- res = state.md.helpers.parseLinkTitle(str, pos, max);
- if (pos < max && start !== pos && res.ok) {
- title = res.str;
- pos = res.pos;
- lines += res.lines;
- } else {
- title = '';
- pos = destEndPos;
- lines = destEndLineNo;
- }
-
- // skip trailing spaces until the rest of the line
- while (pos < max) {
- ch = str.charCodeAt(pos);
- if (!isSpace(ch)) { break; }
- pos++;
- }
-
- if (pos < max && str.charCodeAt(pos) !== 0x0A) {
- if (title) {
- // garbage at the end of the line after title,
- // but it could still be a valid reference if we roll back
- title = '';
- pos = destEndPos;
- lines = destEndLineNo;
- while (pos < max) {
- ch = str.charCodeAt(pos);
- if (!isSpace(ch)) { break; }
- pos++;
- }
- }
- }
-
- if (pos < max && str.charCodeAt(pos) !== 0x0A) {
- // garbage at the end of the line
- return false;
- }
-
- label = normalizeReference(str.slice(1, labelEnd));
- if (!label) {
- // CommonMark 0.20 disallows empty labels
- return false;
- }
-
- // Reference can not terminate anything. This check is for safety only.
- /*istanbul ignore if*/
- if (silent) { return true; }
-
- if (typeof state.env.references === 'undefined') {
- state.env.references = {};
- }
- if (typeof state.env.references[label] === 'undefined') {
- state.env.references[label] = { title: title, href: href };
- }
-
- state.parentType = oldParentType;
-
- state.line = startLine + lines + 1;
- return true;
-};
-
-
-/***/ }),
-/* 79 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// heading (#, ##, ...)
-
-
-
-var isSpace = __webpack_require__(42).isSpace;
-
-
-module.exports = function heading(state, startLine, endLine, silent) {
- var ch, level, tmp, token,
- pos = state.bMarks[startLine] + state.tShift[startLine],
- max = state.eMarks[startLine];
-
- // if it's indented more than 3 spaces, it should be a code block
- if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
-
- ch = state.src.charCodeAt(pos);
-
- if (ch !== 0x23/* # */ || pos >= max) { return false; }
-
- // count heading level
- level = 1;
- ch = state.src.charCodeAt(++pos);
- while (ch === 0x23/* # */ && pos < max && level <= 6) {
- level++;
- ch = state.src.charCodeAt(++pos);
- }
-
- if (level > 6 || (pos < max && !isSpace(ch))) { return false; }
-
- if (silent) { return true; }
-
- // Let's cut tails like ' ### ' from the end of string
-
- max = state.skipSpacesBack(max, pos);
- tmp = state.skipCharsBack(max, 0x23, pos); // #
- if (tmp > pos && isSpace(state.src.charCodeAt(tmp - 1))) {
- max = tmp;
- }
-
- state.line = startLine + 1;
-
- token = state.push('heading_open', 'h' + String(level), 1);
- token.markup = '########'.slice(0, level);
- token.map = [ startLine, state.line ];
-
- token = state.push('inline', '', 0);
- token.content = state.src.slice(pos, max).trim();
- token.map = [ startLine, state.line ];
- token.children = [];
-
- token = state.push('heading_close', 'h' + String(level), -1);
- token.markup = '########'.slice(0, level);
-
- return true;
-};
-
-
-/***/ }),
-/* 80 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// lheading (---, ===)
-
-
-
-
-module.exports = function lheading(state, startLine, endLine/*, silent*/) {
- var content, terminate, i, l, token, pos, max, level, marker,
- nextLine = startLine + 1, oldParentType,
- terminatorRules = state.md.block.ruler.getRules('paragraph');
-
- // if it's indented more than 3 spaces, it should be a code block
- if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
-
- oldParentType = state.parentType;
- state.parentType = 'paragraph'; // use paragraph to match terminatorRules
-
- // jump line-by-line until empty one or EOF
- for (; nextLine < endLine && !state.isEmpty(nextLine); nextLine++) {
- // this would be a code block normally, but after paragraph
- // it's considered a lazy continuation regardless of what's there
- if (state.sCount[nextLine] - state.blkIndent > 3) { continue; }
-
- //
- // Check for underline in setext header
- //
- if (state.sCount[nextLine] >= state.blkIndent) {
- pos = state.bMarks[nextLine] + state.tShift[nextLine];
- max = state.eMarks[nextLine];
-
- if (pos < max) {
- marker = state.src.charCodeAt(pos);
-
- if (marker === 0x2D/* - */ || marker === 0x3D/* = */) {
- pos = state.skipChars(pos, marker);
- pos = state.skipSpaces(pos);
-
- if (pos >= max) {
- level = (marker === 0x3D/* = */ ? 1 : 2);
- break;
- }
- }
- }
- }
-
- // quirk for blockquotes, this line should already be checked by that rule
- if (state.sCount[nextLine] < 0) { continue; }
-
- // Some tags can terminate paragraph without empty line.
- terminate = false;
- for (i = 0, l = terminatorRules.length; i < l; i++) {
- if (terminatorRules[i](state, nextLine, endLine, true)) {
- terminate = true;
- break;
- }
- }
- if (terminate) { break; }
- }
-
- if (!level) {
- // Didn't find valid underline
- return false;
- }
-
- content = state.getLines(startLine, nextLine, state.blkIndent, false).trim();
-
- state.line = nextLine + 1;
-
- token = state.push('heading_open', 'h' + String(level), 1);
- token.markup = String.fromCharCode(marker);
- token.map = [ startLine, state.line ];
-
- token = state.push('inline', '', 0);
- token.content = content;
- token.map = [ startLine, state.line - 1 ];
- token.children = [];
-
- token = state.push('heading_close', 'h' + String(level), -1);
- token.markup = String.fromCharCode(marker);
-
- state.parentType = oldParentType;
-
- return true;
-};
-
-
-/***/ }),
-/* 81 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// HTML block
-
-
-
-
-var block_names = __webpack_require__(82);
-var HTML_OPEN_CLOSE_TAG_RE = __webpack_require__(83).HTML_OPEN_CLOSE_TAG_RE;
-
-// An array of opening and corresponding closing sequences for html tags,
-// last argument defines whether it can terminate a paragraph or not
-//
-var HTML_SEQUENCES = [
- [ /^<(script|pre|style)(?=(\s|>|$))/i, /<\/(script|pre|style)>/i, true ],
- [ /^<!--/, /-->/, true ],
- [ /^<\?/, /\?>/, true ],
- [ /^<![A-Z]/, />/, true ],
- [ /^<!\[CDATA\[/, /\]\]>/, true ],
- [ new RegExp('^</?(' + block_names.join('|') + ')(?=(\\s|/?>|$))', 'i'), /^$/, true ],
- [ new RegExp(HTML_OPEN_CLOSE_TAG_RE.source + '\\s*$'), /^$/, false ]
-];
-
-
-module.exports = function html_block(state, startLine, endLine, silent) {
- var i, nextLine, token, lineText,
- pos = state.bMarks[startLine] + state.tShift[startLine],
- max = state.eMarks[startLine];
-
- // if it's indented more than 3 spaces, it should be a code block
- if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
-
- if (!state.md.options.html) { return false; }
-
- if (state.src.charCodeAt(pos) !== 0x3C/* < */) { return false; }
-
- lineText = state.src.slice(pos, max);
-
- for (i = 0; i < HTML_SEQUENCES.length; i++) {
- if (HTML_SEQUENCES[i][0].test(lineText)) { break; }
- }
-
- if (i === HTML_SEQUENCES.length) { return false; }
-
- if (silent) {
- // true if this sequence can be a terminator, false otherwise
- return HTML_SEQUENCES[i][2];
- }
-
- nextLine = startLine + 1;
-
- // If we are here - we detected HTML block.
- // Let's roll down till block end.
- if (!HTML_SEQUENCES[i][1].test(lineText)) {
- for (; nextLine < endLine; nextLine++) {
- if (state.sCount[nextLine] < state.blkIndent) { break; }
-
- pos = state.bMarks[nextLine] + state.tShift[nextLine];
- max = state.eMarks[nextLine];
- lineText = state.src.slice(pos, max);
-
- if (HTML_SEQUENCES[i][1].test(lineText)) {
- if (lineText.length !== 0) { nextLine++; }
- break;
- }
- }
- }
-
- state.line = nextLine;
-
- token = state.push('html_block', '', 0);
- token.map = [ startLine, nextLine ];
- token.content = state.getLines(startLine, nextLine, state.blkIndent, true);
-
- return true;
-};
-
-
-/***/ }),
-/* 82 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// List of valid html blocks names, accorting to commonmark spec
-// http://jgm.github.io/CommonMark/spec.html#html-blocks
-
-
-
-
-module.exports = [
- 'address',
- 'article',
- 'aside',
- 'base',
- 'basefont',
- 'blockquote',
- 'body',
- 'caption',
- 'center',
- 'col',
- 'colgroup',
- 'dd',
- 'details',
- 'dialog',
- 'dir',
- 'div',
- 'dl',
- 'dt',
- 'fieldset',
- 'figcaption',
- 'figure',
- 'footer',
- 'form',
- 'frame',
- 'frameset',
- 'h1',
- 'h2',
- 'h3',
- 'h4',
- 'h5',
- 'h6',
- 'head',
- 'header',
- 'hr',
- 'html',
- 'iframe',
- 'legend',
- 'li',
- 'link',
- 'main',
- 'menu',
- 'menuitem',
- 'meta',
- 'nav',
- 'noframes',
- 'ol',
- 'optgroup',
- 'option',
- 'p',
- 'param',
- 'section',
- 'source',
- 'summary',
- 'table',
- 'tbody',
- 'td',
- 'tfoot',
- 'th',
- 'thead',
- 'title',
- 'tr',
- 'track',
- 'ul'
-];
-
-
-/***/ }),
-/* 83 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// Regexps to match html elements
-
-
-
-var attr_name = '[a-zA-Z_:][a-zA-Z0-9:._-]*';
-
-var unquoted = '[^"\'=<>`\\x00-\\x20]+';
-var single_quoted = "'[^']*'";
-var double_quoted = '"[^"]*"';
-
-var attr_value = '(?:' + unquoted + '|' + single_quoted + '|' + double_quoted + ')';
-
-var attribute = '(?:\\s+' + attr_name + '(?:\\s*=\\s*' + attr_value + ')?)';
-
-var open_tag = '<[A-Za-z][A-Za-z0-9\\-]*' + attribute + '*\\s*\\/?>';
-
-var close_tag = '<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>';
-var comment = '<!---->|<!--(?:-?[^>-])(?:-?[^-])*-->';
-var processing = '<[?].*?[?]>';
-var declaration = '<![A-Z]+\\s+[^>]*>';
-var cdata = '<!\\[CDATA\\[[\\s\\S]*?\\]\\]>';
-
-var HTML_TAG_RE = new RegExp('^(?:' + open_tag + '|' + close_tag + '|' + comment +
- '|' + processing + '|' + declaration + '|' + cdata + ')');
-var HTML_OPEN_CLOSE_TAG_RE = new RegExp('^(?:' + open_tag + '|' + close_tag + ')');
-
-module.exports.HTML_TAG_RE = HTML_TAG_RE;
-module.exports.HTML_OPEN_CLOSE_TAG_RE = HTML_OPEN_CLOSE_TAG_RE;
-
-
-/***/ }),
-/* 84 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// Paragraph
-
-
-
-
-module.exports = function paragraph(state, startLine/*, endLine*/) {
- var content, terminate, i, l, token, oldParentType,
- nextLine = startLine + 1,
- terminatorRules = state.md.block.ruler.getRules('paragraph'),
- endLine = state.lineMax;
-
- oldParentType = state.parentType;
- state.parentType = 'paragraph';
-
- // jump line-by-line until empty one or EOF
- for (; nextLine < endLine && !state.isEmpty(nextLine); nextLine++) {
- // this would be a code block normally, but after paragraph
- // it's considered a lazy continuation regardless of what's there
- if (state.sCount[nextLine] - state.blkIndent > 3) { continue; }
-
- // quirk for blockquotes, this line should already be checked by that rule
- if (state.sCount[nextLine] < 0) { continue; }
-
- // Some tags can terminate paragraph without empty line.
- terminate = false;
- for (i = 0, l = terminatorRules.length; i < l; i++) {
- if (terminatorRules[i](state, nextLine, endLine, true)) {
- terminate = true;
- break;
- }
- }
- if (terminate) { break; }
- }
-
- content = state.getLines(startLine, nextLine, state.blkIndent, false).trim();
-
- state.line = nextLine;
-
- token = state.push('paragraph_open', 'p', 1);
- token.map = [ startLine, state.line ];
-
- token = state.push('inline', '', 0);
- token.content = content;
- token.map = [ startLine, state.line ];
- token.children = [];
-
- token = state.push('paragraph_close', 'p', -1);
-
- state.parentType = oldParentType;
-
- return true;
-};
-
-
-/***/ }),
-/* 85 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// Parser state class
-
-
-
-var Token = __webpack_require__(70);
-var isSpace = __webpack_require__(42).isSpace;
-
-
-function StateBlock(src, md, env, tokens) {
- var ch, s, start, pos, len, indent, offset, indent_found;
-
- this.src = src;
-
- // link to parser instance
- this.md = md;
-
- this.env = env;
-
- //
- // Internal state vartiables
- //
-
- this.tokens = tokens;
-
- this.bMarks = []; // line begin offsets for fast jumps
- this.eMarks = []; // line end offsets for fast jumps
- this.tShift = []; // offsets of the first non-space characters (tabs not expanded)
- this.sCount = []; // indents for each line (tabs expanded)
-
- // An amount of virtual spaces (tabs expanded) between beginning
- // of each line (bMarks) and real beginning of that line.
- //
- // It exists only as a hack because blockquotes override bMarks
- // losing information in the process.
- //
- // It's used only when expanding tabs, you can think about it as
- // an initial tab length, e.g. bsCount=21 applied to string `\t123`
- // means first tab should be expanded to 4-21%4 === 3 spaces.
- //
- this.bsCount = [];
-
- // block parser variables
- this.blkIndent = 0; // required block content indent (for example, if we are
- // inside a list, it would be positioned after list marker)
- this.line = 0; // line index in src
- this.lineMax = 0; // lines count
- this.tight = false; // loose/tight mode for lists
- this.ddIndent = -1; // indent of the current dd block (-1 if there isn't any)
- this.listIndent = -1; // indent of the current list block (-1 if there isn't any)
-
- // can be 'blockquote', 'list', 'root', 'paragraph' or 'reference'
- // used in lists to determine if they interrupt a paragraph
- this.parentType = 'root';
-
- this.level = 0;
-
- // renderer
- this.result = '';
-
- // Create caches
- // Generate markers.
- s = this.src;
- indent_found = false;
-
- for (start = pos = indent = offset = 0, len = s.length; pos < len; pos++) {
- ch = s.charCodeAt(pos);
-
- if (!indent_found) {
- if (isSpace(ch)) {
- indent++;
-
- if (ch === 0x09) {
- offset += 4 - offset % 4;
- } else {
- offset++;
- }
- continue;
- } else {
- indent_found = true;
- }
- }
-
- if (ch === 0x0A || pos === len - 1) {
- if (ch !== 0x0A) { pos++; }
- this.bMarks.push(start);
- this.eMarks.push(pos);
- this.tShift.push(indent);
- this.sCount.push(offset);
- this.bsCount.push(0);
-
- indent_found = false;
- indent = 0;
- offset = 0;
- start = pos + 1;
- }
- }
-
- // Push fake entry to simplify cache bounds checks
- this.bMarks.push(s.length);
- this.eMarks.push(s.length);
- this.tShift.push(0);
- this.sCount.push(0);
- this.bsCount.push(0);
-
- this.lineMax = this.bMarks.length - 1; // don't count last fake line
-}
-
-// Push new token to "stream".
-//
-StateBlock.prototype.push = function (type, tag, nesting) {
- var token = new Token(type, tag, nesting);
- token.block = true;
-
- if (nesting < 0) this.level--; // closing tag
- token.level = this.level;
- if (nesting > 0) this.level++; // opening tag
-
- this.tokens.push(token);
- return token;
-};
-
-StateBlock.prototype.isEmpty = function isEmpty(line) {
- return this.bMarks[line] + this.tShift[line] >= this.eMarks[line];
-};
-
-StateBlock.prototype.skipEmptyLines = function skipEmptyLines(from) {
- for (var max = this.lineMax; from < max; from++) {
- if (this.bMarks[from] + this.tShift[from] < this.eMarks[from]) {
- break;
- }
- }
- return from;
-};
-
-// Skip spaces from given position.
-StateBlock.prototype.skipSpaces = function skipSpaces(pos) {
- var ch;
-
- for (var max = this.src.length; pos < max; pos++) {
- ch = this.src.charCodeAt(pos);
- if (!isSpace(ch)) { break; }
- }
- return pos;
-};
-
-// Skip spaces from given position in reverse.
-StateBlock.prototype.skipSpacesBack = function skipSpacesBack(pos, min) {
- if (pos <= min) { return pos; }
-
- while (pos > min) {
- if (!isSpace(this.src.charCodeAt(--pos))) { return pos + 1; }
- }
- return pos;
-};
-
-// Skip char codes from given position
-StateBlock.prototype.skipChars = function skipChars(pos, code) {
- for (var max = this.src.length; pos < max; pos++) {
- if (this.src.charCodeAt(pos) !== code) { break; }
- }
- return pos;
-};
-
-// Skip char codes reverse from given position - 1
-StateBlock.prototype.skipCharsBack = function skipCharsBack(pos, code, min) {
- if (pos <= min) { return pos; }
-
- while (pos > min) {
- if (code !== this.src.charCodeAt(--pos)) { return pos + 1; }
- }
- return pos;
-};
-
-// cut lines range from source.
-StateBlock.prototype.getLines = function getLines(begin, end, indent, keepLastLF) {
- var i, lineIndent, ch, first, last, queue, lineStart,
- line = begin;
-
- if (begin >= end) {
- return '';
- }
-
- queue = new Array(end - begin);
-
- for (i = 0; line < end; line++, i++) {
- lineIndent = 0;
- lineStart = first = this.bMarks[line];
-
- if (line + 1 < end || keepLastLF) {
- // No need for bounds check because we have fake entry on tail.
- last = this.eMarks[line] + 1;
- } else {
- last = this.eMarks[line];
- }
-
- while (first < last && lineIndent < indent) {
- ch = this.src.charCodeAt(first);
-
- if (isSpace(ch)) {
- if (ch === 0x09) {
- lineIndent += 4 - (lineIndent + this.bsCount[line]) % 4;
- } else {
- lineIndent++;
- }
- } else if (first - lineStart < this.tShift[line]) {
- // patched tShift masked characters to look like spaces (blockquotes, list markers)
- lineIndent++;
- } else {
- break;
- }
-
- first++;
- }
-
- if (lineIndent > indent) {
- // partially expanding tabs in code blocks, e.g '\t\tfoobar'
- // with indent=2 becomes ' \tfoobar'
- queue[i] = new Array(lineIndent - indent + 1).join(' ') + this.src.slice(first, last);
- } else {
- queue[i] = this.src.slice(first, last);
- }
- }
-
- return queue.join('');
-};
-
-// re-export Token class to use in block rules
-StateBlock.prototype.Token = Token;
-
-
-module.exports = StateBlock;
-
-
-/***/ }),
-/* 86 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/** internal
- * class ParserInline
- *
- * Tokenizes paragraph content.
- **/
-
-
-
-var Ruler = __webpack_require__(62);
-
-
-////////////////////////////////////////////////////////////////////////////////
-// Parser rules
-
-var _rules = [
- [ 'text', __webpack_require__(87) ],
- [ 'newline', __webpack_require__(88) ],
- [ 'escape', __webpack_require__(89) ],
- [ 'backticks', __webpack_require__(90) ],
- [ 'strikethrough', __webpack_require__(91).tokenize ],
- [ 'emphasis', __webpack_require__(92).tokenize ],
- [ 'link', __webpack_require__(93) ],
- [ 'image', __webpack_require__(94) ],
- [ 'autolink', __webpack_require__(95) ],
- [ 'html_inline', __webpack_require__(96) ],
- [ 'entity', __webpack_require__(97) ]
-];
-
-var _rules2 = [
- [ 'balance_pairs', __webpack_require__(98) ],
- [ 'strikethrough', __webpack_require__(91).postProcess ],
- [ 'emphasis', __webpack_require__(92).postProcess ],
- [ 'text_collapse', __webpack_require__(99) ]
-];
-
-
-/**
- * new ParserInline()
- **/
-function ParserInline() {
- var i;
-
- /**
- * ParserInline#ruler -> Ruler
- *
- * [[Ruler]] instance. Keep configuration of inline rules.
- **/
- this.ruler = new Ruler();
-
- for (i = 0; i < _rules.length; i++) {
- this.ruler.push(_rules[i][0], _rules[i][1]);
- }
-
- /**
- * ParserInline#ruler2 -> Ruler
- *
- * [[Ruler]] instance. Second ruler used for post-processing
- * (e.g. in emphasis-like rules).
- **/
- this.ruler2 = new Ruler();
-
- for (i = 0; i < _rules2.length; i++) {
- this.ruler2.push(_rules2[i][0], _rules2[i][1]);
- }
-}
-
-
-// Skip single token by running all rules in validation mode;
-// returns `true` if any rule reported success
-//
-ParserInline.prototype.skipToken = function (state) {
- var ok, i, pos = state.pos,
- rules = this.ruler.getRules(''),
- len = rules.length,
- maxNesting = state.md.options.maxNesting,
- cache = state.cache;
-
-
- if (typeof cache[pos] !== 'undefined') {
- state.pos = cache[pos];
- return;
- }
-
- if (state.level < maxNesting) {
- for (i = 0; i < len; i++) {
- // Increment state.level and decrement it later to limit recursion.
- // It's harmless to do here, because no tokens are created. But ideally,
- // we'd need a separate private state variable for this purpose.
- //
- state.level++;
- ok = rules[i](state, true);
- state.level--;
-
- if (ok) { break; }
- }
- } else {
- // Too much nesting, just skip until the end of the paragraph.
- //
- // NOTE: this will cause links to behave incorrectly in the following case,
- // when an amount of `[` is exactly equal to `maxNesting + 1`:
- //
- // [[[[[[[[[[[[[[[[[[[[[foo]()
- //
- // TODO: remove this workaround when CM standard will allow nested links
- // (we can replace it by preventing links from being parsed in
- // validation mode)
- //
- state.pos = state.posMax;
- }
-
- if (!ok) { state.pos++; }
- cache[pos] = state.pos;
-};
-
-
-// Generate tokens for input range
-//
-ParserInline.prototype.tokenize = function (state) {
- var ok, i,
- rules = this.ruler.getRules(''),
- len = rules.length,
- end = state.posMax,
- maxNesting = state.md.options.maxNesting;
-
- while (state.pos < end) {
- // Try all possible rules.
- // On success, rule should:
- //
- // - update `state.pos`
- // - update `state.tokens`
- // - return true
-
- if (state.level < maxNesting) {
- for (i = 0; i < len; i++) {
- ok = rules[i](state, false);
- if (ok) { break; }
- }
- }
-
- if (ok) {
- if (state.pos >= end) { break; }
- continue;
- }
-
- state.pending += state.src[state.pos++];
- }
-
- if (state.pending) {
- state.pushPending();
- }
-};
-
-
-/**
- * ParserInline.parse(str, md, env, outTokens)
- *
- * Process input string and push inline tokens into `outTokens`
- **/
-ParserInline.prototype.parse = function (str, md, env, outTokens) {
- var i, rules, len;
- var state = new this.State(str, md, env, outTokens);
-
- this.tokenize(state);
-
- rules = this.ruler2.getRules('');
- len = rules.length;
-
- for (i = 0; i < len; i++) {
- rules[i](state);
- }
-};
-
-
-ParserInline.prototype.State = __webpack_require__(100);
-
-
-module.exports = ParserInline;
-
-
-/***/ }),
-/* 87 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// Skip text characters for text token, place those to pending buffer
-// and increment current pos
-
-
-
-
-// Rule to skip pure text
-// '{}$%@~+=:' reserved for extentions
-
-// !, ", #, $, %, &, ', (, ), *, +, ,, -, ., /, :, ;, <, =, >, ?, @, [, \, ], ^, _, `, {, |, }, or ~
-
-// !!!! Don't confuse with "Markdown ASCII Punctuation" chars
-// http://spec.commonmark.org/0.15/#ascii-punctuation-character
-function isTerminatorChar(ch) {
- switch (ch) {
- case 0x0A/* \n */:
- case 0x21/* ! */:
- case 0x23/* # */:
- case 0x24/* $ */:
- case 0x25/* % */:
- case 0x26/* & */:
- case 0x2A/* * */:
- case 0x2B/* + */:
- case 0x2D/* - */:
- case 0x3A/* : */:
- case 0x3C/* < */:
- case 0x3D/* = */:
- case 0x3E/* > */:
- case 0x40/* @ */:
- case 0x5B/* [ */:
- case 0x5C/* \ */:
- case 0x5D/* ] */:
- case 0x5E/* ^ */:
- case 0x5F/* _ */:
- case 0x60/* ` */:
- case 0x7B/* { */:
- case 0x7D/* } */:
- case 0x7E/* ~ */:
- return true;
- default:
- return false;
- }
-}
-
-module.exports = function text(state, silent) {
- var pos = state.pos;
-
- while (pos < state.posMax && !isTerminatorChar(state.src.charCodeAt(pos))) {
- pos++;
- }
-
- if (pos === state.pos) { return false; }
-
- if (!silent) { state.pending += state.src.slice(state.pos, pos); }
-
- state.pos = pos;
-
- return true;
-};
-
-// Alternative implementation, for memory.
-//
-// It costs 10% of performance, but allows extend terminators list, if place it
-// to `ParcerInline` property. Probably, will switch to it sometime, such
-// flexibility required.
-
-/*
-var TERMINATOR_RE = /[\n!#$%&*+\-:<=>@[\\\]^_`{}~]/;
-
-module.exports = function text(state, silent) {
- var pos = state.pos,
- idx = state.src.slice(pos).search(TERMINATOR_RE);
-
- // first char is terminator -> empty text
- if (idx === 0) { return false; }
-
- // no terminator -> text till end of string
- if (idx < 0) {
- if (!silent) { state.pending += state.src.slice(pos); }
- state.pos = state.src.length;
- return true;
- }
-
- if (!silent) { state.pending += state.src.slice(pos, pos + idx); }
-
- state.pos += idx;
-
- return true;
-};*/
-
-
-/***/ }),
-/* 88 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// Proceess '\n'
-
-
-
-var isSpace = __webpack_require__(42).isSpace;
-
-
-module.exports = function newline(state, silent) {
- var pmax, max, pos = state.pos;
-
- if (state.src.charCodeAt(pos) !== 0x0A/* \n */) { return false; }
-
- pmax = state.pending.length - 1;
- max = state.posMax;
-
- // ' \n' -> hardbreak
- // Lookup in pending chars is bad practice! Don't copy to other rules!
- // Pending string is stored in concat mode, indexed lookups will cause
- // convertion to flat mode.
- if (!silent) {
- if (pmax >= 0 && state.pending.charCodeAt(pmax) === 0x20) {
- if (pmax >= 1 && state.pending.charCodeAt(pmax - 1) === 0x20) {
- state.pending = state.pending.replace(/ +$/, '');
- state.push('hardbreak', 'br', 0);
- } else {
- state.pending = state.pending.slice(0, -1);
- state.push('softbreak', 'br', 0);
- }
-
- } else {
- state.push('softbreak', 'br', 0);
- }
- }
-
- pos++;
-
- // skip heading spaces for next line
- while (pos < max && isSpace(state.src.charCodeAt(pos))) { pos++; }
-
- state.pos = pos;
- return true;
-};
-
-
-/***/ }),
-/* 89 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// Process escaped chars and hardbreaks
-
-
-
-var isSpace = __webpack_require__(42).isSpace;
-
-var ESCAPED = [];
-
-for (var i = 0; i < 256; i++) { ESCAPED.push(0); }
-
-'\\!"#$%&\'()*+,./:;<=>?@[]^_`{|}~-'
- .split('').forEach(function (ch) { ESCAPED[ch.charCodeAt(0)] = 1; });
-
-
-module.exports = function escape(state, silent) {
- var ch, pos = state.pos, max = state.posMax;
-
- if (state.src.charCodeAt(pos) !== 0x5C/* \ */) { return false; }
-
- pos++;
-
- if (pos < max) {
- ch = state.src.charCodeAt(pos);
-
- if (ch < 256 && ESCAPED[ch] !== 0) {
- if (!silent) { state.pending += state.src[pos]; }
- state.pos += 2;
- return true;
- }
-
- if (ch === 0x0A) {
- if (!silent) {
- state.push('hardbreak', 'br', 0);
- }
-
- pos++;
- // skip leading whitespaces from next line
- while (pos < max) {
- ch = state.src.charCodeAt(pos);
- if (!isSpace(ch)) { break; }
- pos++;
- }
-
- state.pos = pos;
- return true;
- }
- }
-
- if (!silent) { state.pending += '\\'; }
- state.pos++;
- return true;
-};
-
-
-/***/ }),
-/* 90 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// Parse backticks
-
-
-
-module.exports = function backtick(state, silent) {
- var start, max, marker, matchStart, matchEnd, token,
- pos = state.pos,
- ch = state.src.charCodeAt(pos);
-
- if (ch !== 0x60/* ` */) { return false; }
-
- start = pos;
- pos++;
- max = state.posMax;
-
- while (pos < max && state.src.charCodeAt(pos) === 0x60/* ` */) { pos++; }
-
- marker = state.src.slice(start, pos);
-
- matchStart = matchEnd = pos;
-
- while ((matchStart = state.src.indexOf('`', matchEnd)) !== -1) {
- matchEnd = matchStart + 1;
-
- while (matchEnd < max && state.src.charCodeAt(matchEnd) === 0x60/* ` */) { matchEnd++; }
-
- if (matchEnd - matchStart === marker.length) {
- if (!silent) {
- token = state.push('code_inline', 'code', 0);
- token.markup = marker;
- token.content = state.src.slice(pos, matchStart)
- .replace(/\n/g, ' ')
- .replace(/^ (.+) $/, '$1');
- }
- state.pos = matchEnd;
- return true;
- }
- }
-
- if (!silent) { state.pending += marker; }
- state.pos += marker.length;
- return true;
-};
-
-
-/***/ }),
-/* 91 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// ~~strike through~~
-//
-
-
-
-// Insert each marker as a separate text token, and add it to delimiter list
-//
-module.exports.tokenize = function strikethrough(state, silent) {
- var i, scanned, token, len, ch,
- start = state.pos,
- marker = state.src.charCodeAt(start);
-
- if (silent) { return false; }
-
- if (marker !== 0x7E/* ~ */) { return false; }
-
- scanned = state.scanDelims(state.pos, true);
- len = scanned.length;
- ch = String.fromCharCode(marker);
-
- if (len < 2) { return false; }
-
- if (len % 2) {
- token = state.push('text', '', 0);
- token.content = ch;
- len--;
- }
-
- for (i = 0; i < len; i += 2) {
- token = state.push('text', '', 0);
- token.content = ch + ch;
-
- state.delimiters.push({
- marker: marker,
- length: 0, // disable "rule of 3" length checks meant for emphasis
- jump: i,
- token: state.tokens.length - 1,
- end: -1,
- open: scanned.can_open,
- close: scanned.can_close
- });
- }
-
- state.pos += scanned.length;
-
- return true;
-};
-
-
-function postProcess(state, delimiters) {
- var i, j,
- startDelim,
- endDelim,
- token,
- loneMarkers = [],
- max = delimiters.length;
-
- for (i = 0; i < max; i++) {
- startDelim = delimiters[i];
-
- if (startDelim.marker !== 0x7E/* ~ */) {
- continue;
- }
-
- if (startDelim.end === -1) {
- continue;
- }
-
- endDelim = delimiters[startDelim.end];
-
- token = state.tokens[startDelim.token];
- token.type = 's_open';
- token.tag = 's';
- token.nesting = 1;
- token.markup = '~~';
- token.content = '';
-
- token = state.tokens[endDelim.token];
- token.type = 's_close';
- token.tag = 's';
- token.nesting = -1;
- token.markup = '~~';
- token.content = '';
-
- if (state.tokens[endDelim.token - 1].type === 'text' &&
- state.tokens[endDelim.token - 1].content === '~') {
-
- loneMarkers.push(endDelim.token - 1);
- }
- }
-
- // If a marker sequence has an odd number of characters, it's splitted
- // like this: `~~~~~` -> `~` + `~~` + `~~`, leaving one marker at the
- // start of the sequence.
- //
- // So, we have to move all those markers after subsequent s_close tags.
- //
- while (loneMarkers.length) {
- i = loneMarkers.pop();
- j = i + 1;
-
- while (j < state.tokens.length && state.tokens[j].type === 's_close') {
- j++;
- }
-
- j--;
-
- if (i !== j) {
- token = state.tokens[j];
- state.tokens[j] = state.tokens[i];
- state.tokens[i] = token;
- }
- }
-}
-
-
-// Walk through delimiter list and replace text tokens with tags
-//
-module.exports.postProcess = function strikethrough(state) {
- var curr,
- tokens_meta = state.tokens_meta,
- max = state.tokens_meta.length;
-
- postProcess(state, state.delimiters);
-
- for (curr = 0; curr < max; curr++) {
- if (tokens_meta[curr] && tokens_meta[curr].delimiters) {
- postProcess(state, tokens_meta[curr].delimiters);
- }
- }
-};
-
-
-/***/ }),
-/* 92 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// Process *this* and _that_
-//
-
-
-
-// Insert each marker as a separate text token, and add it to delimiter list
-//
-module.exports.tokenize = function emphasis(state, silent) {
- var i, scanned, token,
- start = state.pos,
- marker = state.src.charCodeAt(start);
-
- if (silent) { return false; }
-
- if (marker !== 0x5F /* _ */ && marker !== 0x2A /* * */) { return false; }
-
- scanned = state.scanDelims(state.pos, marker === 0x2A);
-
- for (i = 0; i < scanned.length; i++) {
- token = state.push('text', '', 0);
- token.content = String.fromCharCode(marker);
-
- state.delimiters.push({
- // Char code of the starting marker (number).
- //
- marker: marker,
-
- // Total length of these series of delimiters.
- //
- length: scanned.length,
-
- // An amount of characters before this one that's equivalent to
- // current one. In plain English: if this delimiter does not open
- // an emphasis, neither do previous `jump` characters.
- //
- // Used to skip sequences like "*****" in one step, for 1st asterisk
- // value will be 0, for 2nd it's 1 and so on.
- //
- jump: i,
-
- // A position of the token this delimiter corresponds to.
- //
- token: state.tokens.length - 1,
-
- // If this delimiter is matched as a valid opener, `end` will be
- // equal to its position, otherwise it's `-1`.
- //
- end: -1,
-
- // Boolean flags that determine if this delimiter could open or close
- // an emphasis.
- //
- open: scanned.can_open,
- close: scanned.can_close
- });
- }
-
- state.pos += scanned.length;
-
- return true;
-};
-
-
-function postProcess(state, delimiters) {
- var i,
- startDelim,
- endDelim,
- token,
- ch,
- isStrong,
- max = delimiters.length;
-
- for (i = max - 1; i >= 0; i--) {
- startDelim = delimiters[i];
-
- if (startDelim.marker !== 0x5F/* _ */ && startDelim.marker !== 0x2A/* * */) {
- continue;
- }
-
- // Process only opening markers
- if (startDelim.end === -1) {
- continue;
- }
-
- endDelim = delimiters[startDelim.end];
-
- // If the previous delimiter has the same marker and is adjacent to this one,
- // merge those into one strong delimiter.
- //
- // `<em><em>whatever</em></em>` -> `<strong>whatever</strong>`
- //
- isStrong = i > 0 &&
- delimiters[i - 1].end === startDelim.end + 1 &&
- delimiters[i - 1].token === startDelim.token - 1 &&
- delimiters[startDelim.end + 1].token === endDelim.token + 1 &&
- delimiters[i - 1].marker === startDelim.marker;
-
- ch = String.fromCharCode(startDelim.marker);
-
- token = state.tokens[startDelim.token];
- token.type = isStrong ? 'strong_open' : 'em_open';
- token.tag = isStrong ? 'strong' : 'em';
- token.nesting = 1;
- token.markup = isStrong ? ch + ch : ch;
- token.content = '';
-
- token = state.tokens[endDelim.token];
- token.type = isStrong ? 'strong_close' : 'em_close';
- token.tag = isStrong ? 'strong' : 'em';
- token.nesting = -1;
- token.markup = isStrong ? ch + ch : ch;
- token.content = '';
-
- if (isStrong) {
- state.tokens[delimiters[i - 1].token].content = '';
- state.tokens[delimiters[startDelim.end + 1].token].content = '';
- i--;
- }
- }
-}
-
-
-// Walk through delimiter list and replace text tokens with tags
-//
-module.exports.postProcess = function emphasis(state) {
- var curr,
- tokens_meta = state.tokens_meta,
- max = state.tokens_meta.length;
-
- postProcess(state, state.delimiters);
-
- for (curr = 0; curr < max; curr++) {
- if (tokens_meta[curr] && tokens_meta[curr].delimiters) {
- postProcess(state, tokens_meta[curr].delimiters);
- }
- }
-};
-
-
-/***/ }),
-/* 93 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// Process [link](<to> "stuff")
-
-
-
-var normalizeReference = __webpack_require__(42).normalizeReference;
-var isSpace = __webpack_require__(42).isSpace;
-
-
-module.exports = function link(state, silent) {
- var attrs,
- code,
- label,
- labelEnd,
- labelStart,
- pos,
- res,
- ref,
- title,
- token,
- href = '',
- oldPos = state.pos,
- max = state.posMax,
- start = state.pos,
- parseReference = true;
-
- if (state.src.charCodeAt(state.pos) !== 0x5B/* [ */) { return false; }
-
- labelStart = state.pos + 1;
- labelEnd = state.md.helpers.parseLinkLabel(state, state.pos, true);
-
- // parser failed to find ']', so it's not a valid link
- if (labelEnd < 0) { return false; }
-
- pos = labelEnd + 1;
- if (pos < max && state.src.charCodeAt(pos) === 0x28/* ( */) {
- //
- // Inline link
- //
-
- // might have found a valid shortcut link, disable reference parsing
- parseReference = false;
-
- // [link]( <href> "title" )
- // ^^ skipping these spaces
- pos++;
- for (; pos < max; pos++) {
- code = state.src.charCodeAt(pos);
- if (!isSpace(code) && code !== 0x0A) { break; }
- }
- if (pos >= max) { return false; }
-
- // [link]( <href> "title" )
- // ^^^^^^ parsing link destination
- start = pos;
- res = state.md.helpers.parseLinkDestination(state.src, pos, state.posMax);
- if (res.ok) {
- href = state.md.normalizeLink(res.str);
- if (state.md.validateLink(href)) {
- pos = res.pos;
- } else {
- href = '';
- }
- }
-
- // [link]( <href> "title" )
- // ^^ skipping these spaces
- start = pos;
- for (; pos < max; pos++) {
- code = state.src.charCodeAt(pos);
- if (!isSpace(code) && code !== 0x0A) { break; }
- }
-
- // [link]( <href> "title" )
- // ^^^^^^^ parsing link title
- res = state.md.helpers.parseLinkTitle(state.src, pos, state.posMax);
- if (pos < max && start !== pos && res.ok) {
- title = res.str;
- pos = res.pos;
-
- // [link]( <href> "title" )
- // ^^ skipping these spaces
- for (; pos < max; pos++) {
- code = state.src.charCodeAt(pos);
- if (!isSpace(code) && code !== 0x0A) { break; }
- }
- } else {
- title = '';
- }
-
- if (pos >= max || state.src.charCodeAt(pos) !== 0x29/* ) */) {
- // parsing a valid shortcut link failed, fallback to reference
- parseReference = true;
- }
- pos++;
- }
-
- if (parseReference) {
- //
- // Link reference
- //
- if (typeof state.env.references === 'undefined') { return false; }
-
- if (pos < max && state.src.charCodeAt(pos) === 0x5B/* [ */) {
- start = pos + 1;
- pos = state.md.helpers.parseLinkLabel(state, pos);
- if (pos >= 0) {
- label = state.src.slice(start, pos++);
- } else {
- pos = labelEnd + 1;
- }
- } else {
- pos = labelEnd + 1;
- }
-
- // covers label === '' and label === undefined
- // (collapsed reference link and shortcut reference link respectively)
- if (!label) { label = state.src.slice(labelStart, labelEnd); }
-
- ref = state.env.references[normalizeReference(label)];
- if (!ref) {
- state.pos = oldPos;
- return false;
- }
- href = ref.href;
- title = ref.title;
- }
-
- //
- // We found the end of the link, and know for a fact it's a valid link;
- // so all that's left to do is to call tokenizer.
- //
- if (!silent) {
- state.pos = labelStart;
- state.posMax = labelEnd;
-
- token = state.push('link_open', 'a', 1);
- token.attrs = attrs = [ [ 'href', href ] ];
- if (title) {
- attrs.push([ 'title', title ]);
- }
-
- state.md.inline.tokenize(state);
-
- token = state.push('link_close', 'a', -1);
- }
-
- state.pos = pos;
- state.posMax = max;
- return true;
-};
-
-
-/***/ }),
-/* 94 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// Process ![image](<src> "title")
-
-
-
-var normalizeReference = __webpack_require__(42).normalizeReference;
-var isSpace = __webpack_require__(42).isSpace;
-
-
-module.exports = function image(state, silent) {
- var attrs,
- code,
- content,
- label,
- labelEnd,
- labelStart,
- pos,
- ref,
- res,
- title,
- token,
- tokens,
- start,
- href = '',
- oldPos = state.pos,
- max = state.posMax;
-
- if (state.src.charCodeAt(state.pos) !== 0x21/* ! */) { return false; }
- if (state.src.charCodeAt(state.pos + 1) !== 0x5B/* [ */) { return false; }
-
- labelStart = state.pos + 2;
- labelEnd = state.md.helpers.parseLinkLabel(state, state.pos + 1, false);
-
- // parser failed to find ']', so it's not a valid link
- if (labelEnd < 0) { return false; }
-
- pos = labelEnd + 1;
- if (pos < max && state.src.charCodeAt(pos) === 0x28/* ( */) {
- //
- // Inline link
- //
-
- // [link]( <href> "title" )
- // ^^ skipping these spaces
- pos++;
- for (; pos < max; pos++) {
- code = state.src.charCodeAt(pos);
- if (!isSpace(code) && code !== 0x0A) { break; }
- }
- if (pos >= max) { return false; }
-
- // [link]( <href> "title" )
- // ^^^^^^ parsing link destination
- start = pos;
- res = state.md.helpers.parseLinkDestination(state.src, pos, state.posMax);
- if (res.ok) {
- href = state.md.normalizeLink(res.str);
- if (state.md.validateLink(href)) {
- pos = res.pos;
- } else {
- href = '';
- }
- }
-
- // [link]( <href> "title" )
- // ^^ skipping these spaces
- start = pos;
- for (; pos < max; pos++) {
- code = state.src.charCodeAt(pos);
- if (!isSpace(code) && code !== 0x0A) { break; }
- }
-
- // [link]( <href> "title" )
- // ^^^^^^^ parsing link title
- res = state.md.helpers.parseLinkTitle(state.src, pos, state.posMax);
- if (pos < max && start !== pos && res.ok) {
- title = res.str;
- pos = res.pos;
-
- // [link]( <href> "title" )
- // ^^ skipping these spaces
- for (; pos < max; pos++) {
- code = state.src.charCodeAt(pos);
- if (!isSpace(code) && code !== 0x0A) { break; }
- }
- } else {
- title = '';
- }
-
- if (pos >= max || state.src.charCodeAt(pos) !== 0x29/* ) */) {
- state.pos = oldPos;
- return false;
- }
- pos++;
- } else {
- //
- // Link reference
- //
- if (typeof state.env.references === 'undefined') { return false; }
-
- if (pos < max && state.src.charCodeAt(pos) === 0x5B/* [ */) {
- start = pos + 1;
- pos = state.md.helpers.parseLinkLabel(state, pos);
- if (pos >= 0) {
- label = state.src.slice(start, pos++);
- } else {
- pos = labelEnd + 1;
- }
- } else {
- pos = labelEnd + 1;
- }
-
- // covers label === '' and label === undefined
- // (collapsed reference link and shortcut reference link respectively)
- if (!label) { label = state.src.slice(labelStart, labelEnd); }
-
- ref = state.env.references[normalizeReference(label)];
- if (!ref) {
- state.pos = oldPos;
- return false;
- }
- href = ref.href;
- title = ref.title;
- }
-
- //
- // We found the end of the link, and know for a fact it's a valid link;
- // so all that's left to do is to call tokenizer.
- //
- if (!silent) {
- content = state.src.slice(labelStart, labelEnd);
-
- state.md.inline.parse(
- content,
- state.md,
- state.env,
- tokens = []
- );
-
- token = state.push('image', 'img', 0);
- token.attrs = attrs = [ [ 'src', href ], [ 'alt', '' ] ];
- token.children = tokens;
- token.content = content;
-
- if (title) {
- attrs.push([ 'title', title ]);
- }
- }
-
- state.pos = pos;
- state.posMax = max;
- return true;
-};
-
-
-/***/ }),
-/* 95 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// Process autolinks '<protocol:...>'
-
-
-
-
-/*eslint max-len:0*/
-var EMAIL_RE = /^<([a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)>/;
-var AUTOLINK_RE = /^<([a-zA-Z][a-zA-Z0-9+.\-]{1,31}):([^<>\x00-\x20]*)>/;
-
-
-module.exports = function autolink(state, silent) {
- var tail, linkMatch, emailMatch, url, fullUrl, token,
- pos = state.pos;
-
- if (state.src.charCodeAt(pos) !== 0x3C/* < */) { return false; }
-
- tail = state.src.slice(pos);
-
- if (tail.indexOf('>') < 0) { return false; }
-
- if (AUTOLINK_RE.test(tail)) {
- linkMatch = tail.match(AUTOLINK_RE);
-
- url = linkMatch[0].slice(1, -1);
- fullUrl = state.md.normalizeLink(url);
- if (!state.md.validateLink(fullUrl)) { return false; }
-
- if (!silent) {
- token = state.push('link_open', 'a', 1);
- token.attrs = [ [ 'href', fullUrl ] ];
- token.markup = 'autolink';
- token.info = 'auto';
-
- token = state.push('text', '', 0);
- token.content = state.md.normalizeLinkText(url);
-
- token = state.push('link_close', 'a', -1);
- token.markup = 'autolink';
- token.info = 'auto';
- }
-
- state.pos += linkMatch[0].length;
- return true;
- }
-
- if (EMAIL_RE.test(tail)) {
- emailMatch = tail.match(EMAIL_RE);
-
- url = emailMatch[0].slice(1, -1);
- fullUrl = state.md.normalizeLink('mailto:' + url);
- if (!state.md.validateLink(fullUrl)) { return false; }
-
- if (!silent) {
- token = state.push('link_open', 'a', 1);
- token.attrs = [ [ 'href', fullUrl ] ];
- token.markup = 'autolink';
- token.info = 'auto';
-
- token = state.push('text', '', 0);
- token.content = state.md.normalizeLinkText(url);
-
- token = state.push('link_close', 'a', -1);
- token.markup = 'autolink';
- token.info = 'auto';
- }
-
- state.pos += emailMatch[0].length;
- return true;
- }
-
- return false;
-};
-
-
-/***/ }),
-/* 96 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// Process html tags
-
-
-
-
-var HTML_TAG_RE = __webpack_require__(83).HTML_TAG_RE;
-
-
-function isLetter(ch) {
- /*eslint no-bitwise:0*/
- var lc = ch | 0x20; // to lower case
- return (lc >= 0x61/* a */) && (lc <= 0x7a/* z */);
-}
-
-
-module.exports = function html_inline(state, silent) {
- var ch, match, max, token,
- pos = state.pos;
-
- if (!state.md.options.html) { return false; }
-
- // Check start
- max = state.posMax;
- if (state.src.charCodeAt(pos) !== 0x3C/* < */ ||
- pos + 2 >= max) {
- return false;
- }
-
- // Quick fail on second char
- ch = state.src.charCodeAt(pos + 1);
- if (ch !== 0x21/* ! */ &&
- ch !== 0x3F/* ? */ &&
- ch !== 0x2F/* / */ &&
- !isLetter(ch)) {
- return false;
- }
-
- match = state.src.slice(pos).match(HTML_TAG_RE);
- if (!match) { return false; }
-
- if (!silent) {
- token = state.push('html_inline', '', 0);
- token.content = state.src.slice(pos, pos + match[0].length);
- }
- state.pos += match[0].length;
- return true;
-};
-
-
-/***/ }),
-/* 97 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// Process html entity - {, ¯, ", ...
-
-
-
-var entities = __webpack_require__(43);
-var has = __webpack_require__(42).has;
-var isValidEntityCode = __webpack_require__(42).isValidEntityCode;
-var fromCodePoint = __webpack_require__(42).fromCodePoint;
-
-
-var DIGITAL_RE = /^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i;
-var NAMED_RE = /^&([a-z][a-z0-9]{1,31});/i;
-
-
-module.exports = function entity(state, silent) {
- var ch, code, match, pos = state.pos, max = state.posMax;
-
- if (state.src.charCodeAt(pos) !== 0x26/* & */) { return false; }
-
- if (pos + 1 < max) {
- ch = state.src.charCodeAt(pos + 1);
-
- if (ch === 0x23 /* # */) {
- match = state.src.slice(pos).match(DIGITAL_RE);
- if (match) {
- if (!silent) {
- code = match[1][0].toLowerCase() === 'x' ? parseInt(match[1].slice(1), 16) : parseInt(match[1], 10);
- state.pending += isValidEntityCode(code) ? fromCodePoint(code) : fromCodePoint(0xFFFD);
- }
- state.pos += match[0].length;
- return true;
- }
- } else {
- match = state.src.slice(pos).match(NAMED_RE);
- if (match) {
- if (has(entities, match[1])) {
- if (!silent) { state.pending += entities[match[1]]; }
- state.pos += match[0].length;
- return true;
- }
- }
- }
- }
-
- if (!silent) { state.pending += '&'; }
- state.pos++;
- return true;
-};
-
-
-/***/ }),
-/* 98 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// For each opening emphasis-like marker find a matching closing one
-//
-
-
-
-function processDelimiters(state, delimiters) {
- var closerIdx, openerIdx, closer, opener, minOpenerIdx, newMinOpenerIdx,
- isOddMatch, lastJump,
- openersBottom = {},
- max = delimiters.length;
-
- for (closerIdx = 0; closerIdx < max; closerIdx++) {
- closer = delimiters[closerIdx];
-
- // Length is only used for emphasis-specific "rule of 3",
- // if it's not defined (in strikethrough or 3rd party plugins),
- // we can default it to 0 to disable those checks.
- //
- closer.length = closer.length || 0;
-
- if (!closer.close) continue;
-
- // Previously calculated lower bounds (previous fails)
- // for each marker and each delimiter length modulo 3.
- if (!openersBottom.hasOwnProperty(closer.marker)) {
- openersBottom[closer.marker] = [ -1, -1, -1 ];
- }
-
- minOpenerIdx = openersBottom[closer.marker][closer.length % 3];
- newMinOpenerIdx = -1;
-
- openerIdx = closerIdx - closer.jump - 1;
-
- for (; openerIdx > minOpenerIdx; openerIdx -= opener.jump + 1) {
- opener = delimiters[openerIdx];
-
- if (opener.marker !== closer.marker) continue;
-
- if (newMinOpenerIdx === -1) newMinOpenerIdx = openerIdx;
-
- if (opener.open &&
- opener.end < 0 &&
- opener.level === closer.level) {
-
- isOddMatch = false;
-
- // from spec:
- //
- // If one of the delimiters can both open and close emphasis, then the
- // sum of the lengths of the delimiter runs containing the opening and
- // closing delimiters must not be a multiple of 3 unless both lengths
- // are multiples of 3.
- //
- if (opener.close || closer.open) {
- if ((opener.length + closer.length) % 3 === 0) {
- if (opener.length % 3 !== 0 || closer.length % 3 !== 0) {
- isOddMatch = true;
- }
- }
- }
-
- if (!isOddMatch) {
- // If previous delimiter cannot be an opener, we can safely skip
- // the entire sequence in future checks. This is required to make
- // sure algorithm has linear complexity (see *_*_*_*_*_... case).
- //
- lastJump = openerIdx > 0 && !delimiters[openerIdx - 1].open ?
- delimiters[openerIdx - 1].jump + 1 :
- 0;
-
- closer.jump = closerIdx - openerIdx + lastJump;
- closer.open = false;
- opener.end = closerIdx;
- opener.jump = lastJump;
- opener.close = false;
- newMinOpenerIdx = -1;
- break;
- }
- }
- }
-
- if (newMinOpenerIdx !== -1) {
- // If match for this delimiter run failed, we want to set lower bound for
- // future lookups. This is required to make sure algorithm has linear
- // complexity.
- //
- // See details here:
- // https://github.com/commonmark/cmark/issues/178#issuecomment-270417442
- //
- openersBottom[closer.marker][(closer.length || 0) % 3] = newMinOpenerIdx;
- }
- }
-}
-
-
-module.exports = function link_pairs(state) {
- var curr,
- tokens_meta = state.tokens_meta,
- max = state.tokens_meta.length;
-
- processDelimiters(state, state.delimiters);
-
- for (curr = 0; curr < max; curr++) {
- if (tokens_meta[curr] && tokens_meta[curr].delimiters) {
- processDelimiters(state, tokens_meta[curr].delimiters);
- }
- }
-};
-
-
-/***/ }),
-/* 99 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// Clean up tokens after emphasis and strikethrough postprocessing:
-// merge adjacent text nodes into one and re-calculate all token levels
-//
-// This is necessary because initially emphasis delimiter markers (*, _, ~)
-// are treated as their own separate text tokens. Then emphasis rule either
-// leaves them as text (needed to merge with adjacent text) or turns them
-// into opening/closing tags (which messes up levels inside).
-//
-
-
-
-module.exports = function text_collapse(state) {
- var curr, last,
- level = 0,
- tokens = state.tokens,
- max = state.tokens.length;
-
- for (curr = last = 0; curr < max; curr++) {
- // re-calculate levels after emphasis/strikethrough turns some text nodes
- // into opening/closing tags
- if (tokens[curr].nesting < 0) level--; // closing tag
- tokens[curr].level = level;
- if (tokens[curr].nesting > 0) level++; // opening tag
-
- if (tokens[curr].type === 'text' &&
- curr + 1 < max &&
- tokens[curr + 1].type === 'text') {
-
- // collapse two adjacent text nodes
- tokens[curr + 1].content = tokens[curr].content + tokens[curr + 1].content;
- } else {
- if (curr !== last) { tokens[last] = tokens[curr]; }
-
- last++;
- }
- }
-
- if (curr !== last) {
- tokens.length = last;
- }
-};
-
-
-/***/ }),
-/* 100 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// Inline parser state
-
-
-
-
-var Token = __webpack_require__(70);
-var isWhiteSpace = __webpack_require__(42).isWhiteSpace;
-var isPunctChar = __webpack_require__(42).isPunctChar;
-var isMdAsciiPunct = __webpack_require__(42).isMdAsciiPunct;
-
-
-function StateInline(src, md, env, outTokens) {
- this.src = src;
- this.env = env;
- this.md = md;
- this.tokens = outTokens;
- this.tokens_meta = Array(outTokens.length);
-
- this.pos = 0;
- this.posMax = this.src.length;
- this.level = 0;
- this.pending = '';
- this.pendingLevel = 0;
-
- // Stores { start: end } pairs. Useful for backtrack
- // optimization of pairs parse (emphasis, strikes).
- this.cache = {};
-
- // List of emphasis-like delimiters for current tag
- this.delimiters = [];
-
- // Stack of delimiter lists for upper level tags
- this._prev_delimiters = [];
-}
-
-
-// Flush pending text
-//
-StateInline.prototype.pushPending = function () {
- var token = new Token('text', '', 0);
- token.content = this.pending;
- token.level = this.pendingLevel;
- this.tokens.push(token);
- this.pending = '';
- return token;
-};
-
-
-// Push new token to "stream".
-// If pending text exists - flush it as text token
-//
-StateInline.prototype.push = function (type, tag, nesting) {
- if (this.pending) {
- this.pushPending();
- }
-
- var token = new Token(type, tag, nesting);
- var token_meta = null;
-
- if (nesting < 0) {
- // closing tag
- this.level--;
- this.delimiters = this._prev_delimiters.pop();
- }
-
- token.level = this.level;
-
- if (nesting > 0) {
- // opening tag
- this.level++;
- this._prev_delimiters.push(this.delimiters);
- this.delimiters = [];
- token_meta = { delimiters: this.delimiters };
- }
-
- this.pendingLevel = this.level;
- this.tokens.push(token);
- this.tokens_meta.push(token_meta);
- return token;
-};
-
-
-// Scan a sequence of emphasis-like markers, and determine whether
-// it can start an emphasis sequence or end an emphasis sequence.
-//
-// - start - position to scan from (it should point at a valid marker);
-// - canSplitWord - determine if these markers can be found inside a word
-//
-StateInline.prototype.scanDelims = function (start, canSplitWord) {
- var pos = start, lastChar, nextChar, count, can_open, can_close,
- isLastWhiteSpace, isLastPunctChar,
- isNextWhiteSpace, isNextPunctChar,
- left_flanking = true,
- right_flanking = true,
- max = this.posMax,
- marker = this.src.charCodeAt(start);
-
- // treat beginning of the line as a whitespace
- lastChar = start > 0 ? this.src.charCodeAt(start - 1) : 0x20;
-
- while (pos < max && this.src.charCodeAt(pos) === marker) { pos++; }
-
- count = pos - start;
-
- // treat end of the line as a whitespace
- nextChar = pos < max ? this.src.charCodeAt(pos) : 0x20;
-
- isLastPunctChar = isMdAsciiPunct(lastChar) || isPunctChar(String.fromCharCode(lastChar));
- isNextPunctChar = isMdAsciiPunct(nextChar) || isPunctChar(String.fromCharCode(nextChar));
-
- isLastWhiteSpace = isWhiteSpace(lastChar);
- isNextWhiteSpace = isWhiteSpace(nextChar);
-
- if (isNextWhiteSpace) {
- left_flanking = false;
- } else if (isNextPunctChar) {
- if (!(isLastWhiteSpace || isLastPunctChar)) {
- left_flanking = false;
- }
- }
-
- if (isLastWhiteSpace) {
- right_flanking = false;
- } else if (isLastPunctChar) {
- if (!(isNextWhiteSpace || isNextPunctChar)) {
- right_flanking = false;
- }
- }
-
- if (!canSplitWord) {
- can_open = left_flanking && (!right_flanking || isLastPunctChar);
- can_close = right_flanking && (!left_flanking || isNextPunctChar);
- } else {
- can_open = left_flanking;
- can_close = right_flanking;
- }
-
- return {
- can_open: can_open,
- can_close: can_close,
- length: count
- };
-};
-
-
-// re-export Token class to use in block rules
-StateInline.prototype.Token = Token;
-
-
-module.exports = StateInline;
-
-
-/***/ }),
-/* 101 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-
-////////////////////////////////////////////////////////////////////////////////
-// Helpers
-
-// Merge objects
-//
-function assign(obj /*from1, from2, from3, ...*/) {
- var sources = Array.prototype.slice.call(arguments, 1);
-
- sources.forEach(function (source) {
- if (!source) { return; }
-
- Object.keys(source).forEach(function (key) {
- obj[key] = source[key];
- });
- });
-
- return obj;
-}
-
-function _class(obj) { return Object.prototype.toString.call(obj); }
-function isString(obj) { return _class(obj) === '[object String]'; }
-function isObject(obj) { return _class(obj) === '[object Object]'; }
-function isRegExp(obj) { return _class(obj) === '[object RegExp]'; }
-function isFunction(obj) { return _class(obj) === '[object Function]'; }
-
-
-function escapeRE(str) { return str.replace(/[.?*+^$[\]\\(){}|-]/g, '\\$&'); }
-
-////////////////////////////////////////////////////////////////////////////////
-
-
-var defaultOptions = {
- fuzzyLink: true,
- fuzzyEmail: true,
- fuzzyIP: false
-};
-
-
-function isOptionsObj(obj) {
- return Object.keys(obj || {}).reduce(function (acc, k) {
- return acc || defaultOptions.hasOwnProperty(k);
- }, false);
-}
-
-
-var defaultSchemas = {
- 'http:': {
- validate: function (text, pos, self) {
- var tail = text.slice(pos);
-
- if (!self.re.http) {
- // compile lazily, because "host"-containing variables can change on tlds update.
- self.re.http = new RegExp(
- '^\\/\\/' + self.re.src_auth + self.re.src_host_port_strict + self.re.src_path, 'i'
- );
- }
- if (self.re.http.test(tail)) {
- return tail.match(self.re.http)[0].length;
- }
- return 0;
- }
- },
- 'https:': 'http:',
- 'ftp:': 'http:',
- '//': {
- validate: function (text, pos, self) {
- var tail = text.slice(pos);
-
- if (!self.re.no_http) {
- // compile lazily, because "host"-containing variables can change on tlds update.
- self.re.no_http = new RegExp(
- '^' +
- self.re.src_auth +
- // Don't allow single-level domains, because of false positives like '//test'
- // with code comments
- '(?:localhost|(?:(?:' + self.re.src_domain + ')\\.)+' + self.re.src_domain_root + ')' +
- self.re.src_port +
- self.re.src_host_terminator +
- self.re.src_path,
-
- 'i'
- );
- }
-
- if (self.re.no_http.test(tail)) {
- // should not be `://` & `///`, that protects from errors in protocol name
- if (pos >= 3 && text[pos - 3] === ':') { return 0; }
- if (pos >= 3 && text[pos - 3] === '/') { return 0; }
- return tail.match(self.re.no_http)[0].length;
- }
- return 0;
- }
- },
- 'mailto:': {
- validate: function (text, pos, self) {
- var tail = text.slice(pos);
-
- if (!self.re.mailto) {
- self.re.mailto = new RegExp(
- '^' + self.re.src_email_name + '@' + self.re.src_host_strict, 'i'
- );
- }
- if (self.re.mailto.test(tail)) {
- return tail.match(self.re.mailto)[0].length;
- }
- return 0;
- }
- }
-};
-
-/*eslint-disable max-len*/
-
-// RE pattern for 2-character tlds (autogenerated by ./support/tlds_2char_gen.js)
-var tlds_2ch_src_re = 'a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]';
-
-// DON'T try to make PRs with changes. Extend TLDs with LinkifyIt.tlds() instead
-var tlds_default = 'biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф'.split('|');
-
-/*eslint-enable max-len*/
-
-////////////////////////////////////////////////////////////////////////////////
-
-function resetScanCache(self) {
- self.__index__ = -1;
- self.__text_cache__ = '';
-}
-
-function createValidator(re) {
- return function (text, pos) {
- var tail = text.slice(pos);
-
- if (re.test(tail)) {
- return tail.match(re)[0].length;
- }
- return 0;
- };
-}
-
-function createNormalizer() {
- return function (match, self) {
- self.normalize(match);
- };
-}
-
-// Schemas compiler. Build regexps.
-//
-function compile(self) {
-
- // Load & clone RE patterns.
- var re = self.re = __webpack_require__(102)(self.__opts__);
-
- // Define dynamic patterns
- var tlds = self.__tlds__.slice();
-
- self.onCompile();
-
- if (!self.__tlds_replaced__) {
- tlds.push(tlds_2ch_src_re);
- }
- tlds.push(re.src_xn);
-
- re.src_tlds = tlds.join('|');
-
- function untpl(tpl) { return tpl.replace('%TLDS%', re.src_tlds); }
-
- re.email_fuzzy = RegExp(untpl(re.tpl_email_fuzzy), 'i');
- re.link_fuzzy = RegExp(untpl(re.tpl_link_fuzzy), 'i');
- re.link_no_ip_fuzzy = RegExp(untpl(re.tpl_link_no_ip_fuzzy), 'i');
- re.host_fuzzy_test = RegExp(untpl(re.tpl_host_fuzzy_test), 'i');
-
- //
- // Compile each schema
- //
-
- var aliases = [];
-
- self.__compiled__ = {}; // Reset compiled data
-
- function schemaError(name, val) {
- throw new Error('(LinkifyIt) Invalid schema "' + name + '": ' + val);
- }
-
- Object.keys(self.__schemas__).forEach(function (name) {
- var val = self.__schemas__[name];
-
- // skip disabled methods
- if (val === null) { return; }
-
- var compiled = { validate: null, link: null };
-
- self.__compiled__[name] = compiled;
-
- if (isObject(val)) {
- if (isRegExp(val.validate)) {
- compiled.validate = createValidator(val.validate);
- } else if (isFunction(val.validate)) {
- compiled.validate = val.validate;
- } else {
- schemaError(name, val);
- }
-
- if (isFunction(val.normalize)) {
- compiled.normalize = val.normalize;
- } else if (!val.normalize) {
- compiled.normalize = createNormalizer();
- } else {
- schemaError(name, val);
- }
-
- return;
- }
-
- if (isString(val)) {
- aliases.push(name);
- return;
- }
-
- schemaError(name, val);
- });
-
- //
- // Compile postponed aliases
- //
-
- aliases.forEach(function (alias) {
- if (!self.__compiled__[self.__schemas__[alias]]) {
- // Silently fail on missed schemas to avoid errons on disable.
- // schemaError(alias, self.__schemas__[alias]);
- return;
- }
-
- self.__compiled__[alias].validate =
- self.__compiled__[self.__schemas__[alias]].validate;
- self.__compiled__[alias].normalize =
- self.__compiled__[self.__schemas__[alias]].normalize;
- });
-
- //
- // Fake record for guessed links
- //
- self.__compiled__[''] = { validate: null, normalize: createNormalizer() };
-
- //
- // Build schema condition
- //
- var slist = Object.keys(self.__compiled__)
- .filter(function (name) {
- // Filter disabled & fake schemas
- return name.length > 0 && self.__compiled__[name];
- })
- .map(escapeRE)
- .join('|');
- // (?!_) cause 1.5x slowdown
- self.re.schema_test = RegExp('(^|(?!_)(?:[><\uff5c]|' + re.src_ZPCc + '))(' + slist + ')', 'i');
- self.re.schema_search = RegExp('(^|(?!_)(?:[><\uff5c]|' + re.src_ZPCc + '))(' + slist + ')', 'ig');
-
- self.re.pretest = RegExp(
- '(' + self.re.schema_test.source + ')|(' + self.re.host_fuzzy_test.source + ')|@',
- 'i'
- );
-
- //
- // Cleanup
- //
-
- resetScanCache(self);
-}
-
-/**
- * class Match
- *
- * Match result. Single element of array, returned by [[LinkifyIt#match]]
- **/
-function Match(self, shift) {
- var start = self.__index__,
- end = self.__last_index__,
- text = self.__text_cache__.slice(start, end);
-
- /**
- * Match#schema -> String
- *
- * Prefix (protocol) for matched string.
- **/
- this.schema = self.__schema__.toLowerCase();
- /**
- * Match#index -> Number
- *
- * First position of matched string.
- **/
- this.index = start + shift;
- /**
- * Match#lastIndex -> Number
- *
- * Next position after matched string.
- **/
- this.lastIndex = end + shift;
- /**
- * Match#raw -> String
- *
- * Matched string.
- **/
- this.raw = text;
- /**
- * Match#text -> String
- *
- * Notmalized text of matched string.
- **/
- this.text = text;
- /**
- * Match#url -> String
- *
- * Normalized url of matched string.
- **/
- this.url = text;
-}
-
-function createMatch(self, shift) {
- var match = new Match(self, shift);
-
- self.__compiled__[match.schema].normalize(match, self);
-
- return match;
-}
-
-
-/**
- * class LinkifyIt
- **/
-
-/**
- * new LinkifyIt(schemas, options)
- * - schemas (Object): Optional. Additional schemas to validate (prefix/validator)
- * - options (Object): { fuzzyLink|fuzzyEmail|fuzzyIP: true|false }
- *
- * Creates new linkifier instance with optional additional schemas.
- * Can be called without `new` keyword for convenience.
- *
- * By default understands:
- *
- * - `http(s)://...` , `ftp://...`, `mailto:...` & `//...` links
- * - "fuzzy" links and emails (example.com, foo@bar.com).
- *
- * `schemas` is an object, where each key/value describes protocol/rule:
- *
- * - __key__ - link prefix (usually, protocol name with `:` at the end, `skype:`
- * for example). `linkify-it` makes shure that prefix is not preceeded with
- * alphanumeric char and symbols. Only whitespaces and punctuation allowed.
- * - __value__ - rule to check tail after link prefix
- * - _String_ - just alias to existing rule
- * - _Object_
- * - _validate_ - validator function (should return matched length on success),
- * or `RegExp`.
- * - _normalize_ - optional function to normalize text & url of matched result
- * (for example, for @twitter mentions).
- *
- * `options`:
- *
- * - __fuzzyLink__ - recognige URL-s without `http(s):` prefix. Default `true`.
- * - __fuzzyIP__ - allow IPs in fuzzy links above. Can conflict with some texts
- * like version numbers. Default `false`.
- * - __fuzzyEmail__ - recognize emails without `mailto:` prefix.
- *
- **/
-function LinkifyIt(schemas, options) {
- if (!(this instanceof LinkifyIt)) {
- return new LinkifyIt(schemas, options);
- }
-
- if (!options) {
- if (isOptionsObj(schemas)) {
- options = schemas;
- schemas = {};
- }
- }
-
- this.__opts__ = assign({}, defaultOptions, options);
-
- // Cache last tested result. Used to skip repeating steps on next `match` call.
- this.__index__ = -1;
- this.__last_index__ = -1; // Next scan position
- this.__schema__ = '';
- this.__text_cache__ = '';
-
- this.__schemas__ = assign({}, defaultSchemas, schemas);
- this.__compiled__ = {};
-
- this.__tlds__ = tlds_default;
- this.__tlds_replaced__ = false;
-
- this.re = {};
-
- compile(this);
-}
-
-
-/** chainable
- * LinkifyIt#add(schema, definition)
- * - schema (String): rule name (fixed pattern prefix)
- * - definition (String|RegExp|Object): schema definition
- *
- * Add new rule definition. See constructor description for details.
- **/
-LinkifyIt.prototype.add = function add(schema, definition) {
- this.__schemas__[schema] = definition;
- compile(this);
- return this;
-};
-
-
-/** chainable
- * LinkifyIt#set(options)
- * - options (Object): { fuzzyLink|fuzzyEmail|fuzzyIP: true|false }
- *
- * Set recognition options for links without schema.
- **/
-LinkifyIt.prototype.set = function set(options) {
- this.__opts__ = assign(this.__opts__, options);
- return this;
-};
-
-
-/**
- * LinkifyIt#test(text) -> Boolean
- *
- * Searches linkifiable pattern and returns `true` on success or `false` on fail.
- **/
-LinkifyIt.prototype.test = function test(text) {
- // Reset scan cache
- this.__text_cache__ = text;
- this.__index__ = -1;
-
- if (!text.length) { return false; }
-
- var m, ml, me, len, shift, next, re, tld_pos, at_pos;
-
- // try to scan for link with schema - that's the most simple rule
- if (this.re.schema_test.test(text)) {
- re = this.re.schema_search;
- re.lastIndex = 0;
- while ((m = re.exec(text)) !== null) {
- len = this.testSchemaAt(text, m[2], re.lastIndex);
- if (len) {
- this.__schema__ = m[2];
- this.__index__ = m.index + m[1].length;
- this.__last_index__ = m.index + m[0].length + len;
- break;
- }
- }
- }
-
- if (this.__opts__.fuzzyLink && this.__compiled__['http:']) {
- // guess schemaless links
- tld_pos = text.search(this.re.host_fuzzy_test);
- if (tld_pos >= 0) {
- // if tld is located after found link - no need to check fuzzy pattern
- if (this.__index__ < 0 || tld_pos < this.__index__) {
- if ((ml = text.match(this.__opts__.fuzzyIP ? this.re.link_fuzzy : this.re.link_no_ip_fuzzy)) !== null) {
-
- shift = ml.index + ml[1].length;
-
- if (this.__index__ < 0 || shift < this.__index__) {
- this.__schema__ = '';
- this.__index__ = shift;
- this.__last_index__ = ml.index + ml[0].length;
- }
- }
- }
- }
- }
-
- if (this.__opts__.fuzzyEmail && this.__compiled__['mailto:']) {
- // guess schemaless emails
- at_pos = text.indexOf('@');
- if (at_pos >= 0) {
- // We can't skip this check, because this cases are possible:
- // 192.168.1.1@gmail.com, my.in@example.com
- if ((me = text.match(this.re.email_fuzzy)) !== null) {
-
- shift = me.index + me[1].length;
- next = me.index + me[0].length;
-
- if (this.__index__ < 0 || shift < this.__index__ ||
- (shift === this.__index__ && next > this.__last_index__)) {
- this.__schema__ = 'mailto:';
- this.__index__ = shift;
- this.__last_index__ = next;
- }
- }
- }
- }
-
- return this.__index__ >= 0;
-};
-
-
-/**
- * LinkifyIt#pretest(text) -> Boolean
- *
- * Very quick check, that can give false positives. Returns true if link MAY BE
- * can exists. Can be used for speed optimization, when you need to check that
- * link NOT exists.
- **/
-LinkifyIt.prototype.pretest = function pretest(text) {
- return this.re.pretest.test(text);
-};
-
-
-/**
- * LinkifyIt#testSchemaAt(text, name, position) -> Number
- * - text (String): text to scan
- * - name (String): rule (schema) name
- * - position (Number): text offset to check from
- *
- * Similar to [[LinkifyIt#test]] but checks only specific protocol tail exactly
- * at given position. Returns length of found pattern (0 on fail).
- **/
-LinkifyIt.prototype.testSchemaAt = function testSchemaAt(text, schema, pos) {
- // If not supported schema check requested - terminate
- if (!this.__compiled__[schema.toLowerCase()]) {
- return 0;
- }
- return this.__compiled__[schema.toLowerCase()].validate(text, pos, this);
-};
-
-
-/**
- * LinkifyIt#match(text) -> Array|null
- *
- * Returns array of found link descriptions or `null` on fail. We strongly
- * recommend to use [[LinkifyIt#test]] first, for best speed.
- *
- * ##### Result match description
- *
- * - __schema__ - link schema, can be empty for fuzzy links, or `//` for
- * protocol-neutral links.
- * - __index__ - offset of matched text
- * - __lastIndex__ - index of next char after mathch end
- * - __raw__ - matched text
- * - __text__ - normalized text
- * - __url__ - link, generated from matched text
- **/
-LinkifyIt.prototype.match = function match(text) {
- var shift = 0, result = [];
-
- // Try to take previous element from cache, if .test() called before
- if (this.__index__ >= 0 && this.__text_cache__ === text) {
- result.push(createMatch(this, shift));
- shift = this.__last_index__;
- }
-
- // Cut head if cache was used
- var tail = shift ? text.slice(shift) : text;
-
- // Scan string until end reached
- while (this.test(tail)) {
- result.push(createMatch(this, shift));
-
- tail = tail.slice(this.__last_index__);
- shift += this.__last_index__;
- }
-
- if (result.length) {
- return result;
- }
-
- return null;
-};
-
-
-/** chainable
- * LinkifyIt#tlds(list [, keepOld]) -> this
- * - list (Array): list of tlds
- * - keepOld (Boolean): merge with current list if `true` (`false` by default)
- *
- * Load (or merge) new tlds list. Those are user for fuzzy links (without prefix)
- * to avoid false positives. By default this algorythm used:
- *
- * - hostname with any 2-letter root zones are ok.
- * - biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф
- * are ok.
- * - encoded (`xn--...`) root zones are ok.
- *
- * If list is replaced, then exact match for 2-chars root zones will be checked.
- **/
-LinkifyIt.prototype.tlds = function tlds(list, keepOld) {
- list = Array.isArray(list) ? list : [ list ];
-
- if (!keepOld) {
- this.__tlds__ = list.slice();
- this.__tlds_replaced__ = true;
- compile(this);
- return this;
- }
-
- this.__tlds__ = this.__tlds__.concat(list)
- .sort()
- .filter(function (el, idx, arr) {
- return el !== arr[idx - 1];
- })
- .reverse();
-
- compile(this);
- return this;
-};
-
-/**
- * LinkifyIt#normalize(match)
- *
- * Default normalizer (if schema does not define it's own).
- **/
-LinkifyIt.prototype.normalize = function normalize(match) {
-
- // Do minimal possible changes by default. Need to collect feedback prior
- // to move forward https://github.com/markdown-it/linkify-it/issues/1
-
- if (!match.schema) { match.url = 'http://' + match.url; }
-
- if (match.schema === 'mailto:' && !/^mailto:/i.test(match.url)) {
- match.url = 'mailto:' + match.url;
- }
-};
-
-
-/**
- * LinkifyIt#onCompile()
- *
- * Override to modify basic RegExp-s.
- **/
-LinkifyIt.prototype.onCompile = function onCompile() {
-};
-
-
-module.exports = LinkifyIt;
-
-
-/***/ }),
-/* 102 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-
-module.exports = function (opts) {
- var re = {};
-
- // Use direct extract instead of `regenerate` to reduse browserified size
- re.src_Any = __webpack_require__(52).source;
- re.src_Cc = __webpack_require__(53).source;
- re.src_Z = __webpack_require__(55).source;
- re.src_P = __webpack_require__(45).source;
-
- // \p{\Z\P\Cc\CF} (white spaces + control + format + punctuation)
- re.src_ZPCc = [ re.src_Z, re.src_P, re.src_Cc ].join('|');
-
- // \p{\Z\Cc} (white spaces + control)
- re.src_ZCc = [ re.src_Z, re.src_Cc ].join('|');
-
- // Experimental. List of chars, completely prohibited in links
- // because can separate it from other part of text
- var text_separators = '[><\uff5c]';
-
- // All possible word characters (everything without punctuation, spaces & controls)
- // Defined via punctuation & spaces to save space
- // Should be something like \p{\L\N\S\M} (\w but without `_`)
- re.src_pseudo_letter = '(?:(?!' + text_separators + '|' + re.src_ZPCc + ')' + re.src_Any + ')';
- // The same as abothe but without [0-9]
- // var src_pseudo_letter_non_d = '(?:(?![0-9]|' + src_ZPCc + ')' + src_Any + ')';
-
- ////////////////////////////////////////////////////////////////////////////////
-
- re.src_ip4 =
-
- '(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)';
-
- // Prohibit any of "@/[]()" in user/pass to avoid wrong domain fetch.
- re.src_auth = '(?:(?:(?!' + re.src_ZCc + '|[@/\\[\\]()]).)+@)?';
-
- re.src_port =
-
- '(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?';
-
- re.src_host_terminator =
-
- '(?=$|' + text_separators + '|' + re.src_ZPCc + ')(?!-|_|:\\d|\\.-|\\.(?!$|' + re.src_ZPCc + '))';
-
- re.src_path =
-
- '(?:' +
- '[/?#]' +
- '(?:' +
- '(?!' + re.src_ZCc + '|' + text_separators + '|[()[\\]{}.,"\'?!\\-]).|' +
- '\\[(?:(?!' + re.src_ZCc + '|\\]).)*\\]|' +
- '\\((?:(?!' + re.src_ZCc + '|[)]).)*\\)|' +
- '\\{(?:(?!' + re.src_ZCc + '|[}]).)*\\}|' +
- '\\"(?:(?!' + re.src_ZCc + '|["]).)+\\"|' +
- "\\'(?:(?!" + re.src_ZCc + "|[']).)+\\'|" +
- "\\'(?=" + re.src_pseudo_letter + '|[-]).|' + // allow `I'm_king` if no pair found
- '\\.{2,4}[a-zA-Z0-9%/]|' + // github has ... in commit range links,
- // google has .... in links (issue #66)
- // Restrict to
- // - english
- // - percent-encoded
- // - parts of file path
- // until more examples found.
- '\\.(?!' + re.src_ZCc + '|[.]).|' +
- (opts && opts['---'] ?
- '\\-(?!--(?:[^-]|$))(?:-*)|' // `---` => long dash, terminate
- :
- '\\-+|'
- ) +
- '\\,(?!' + re.src_ZCc + ').|' + // allow `,,,` in paths
- '\\!(?!' + re.src_ZCc + '|[!]).|' +
- '\\?(?!' + re.src_ZCc + '|[?]).' +
- ')+' +
- '|\\/' +
- ')?';
-
- // Allow anything in markdown spec, forbid quote (") at the first position
- // because emails enclosed in quotes are far more common
- re.src_email_name =
-
- '[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*';
-
- re.src_xn =
-
- 'xn--[a-z0-9\\-]{1,59}';
-
- // More to read about domain names
- // http://serverfault.com/questions/638260/
-
- re.src_domain_root =
-
- // Allow letters & digits (http://test1)
- '(?:' +
- re.src_xn +
- '|' +
- re.src_pseudo_letter + '{1,63}' +
- ')';
-
- re.src_domain =
-
- '(?:' +
- re.src_xn +
- '|' +
- '(?:' + re.src_pseudo_letter + ')' +
- '|' +
- '(?:' + re.src_pseudo_letter + '(?:-|' + re.src_pseudo_letter + '){0,61}' + re.src_pseudo_letter + ')' +
- ')';
-
- re.src_host =
-
- '(?:' +
- // Don't need IP check, because digits are already allowed in normal domain names
- // src_ip4 +
- // '|' +
- '(?:(?:(?:' + re.src_domain + ')\\.)*' + re.src_domain/*_root*/ + ')' +
- ')';
-
- re.tpl_host_fuzzy =
-
- '(?:' +
- re.src_ip4 +
- '|' +
- '(?:(?:(?:' + re.src_domain + ')\\.)+(?:%TLDS%))' +
- ')';
-
- re.tpl_host_no_ip_fuzzy =
-
- '(?:(?:(?:' + re.src_domain + ')\\.)+(?:%TLDS%))';
-
- re.src_host_strict =
-
- re.src_host + re.src_host_terminator;
-
- re.tpl_host_fuzzy_strict =
-
- re.tpl_host_fuzzy + re.src_host_terminator;
-
- re.src_host_port_strict =
-
- re.src_host + re.src_port + re.src_host_terminator;
-
- re.tpl_host_port_fuzzy_strict =
-
- re.tpl_host_fuzzy + re.src_port + re.src_host_terminator;
-
- re.tpl_host_port_no_ip_fuzzy_strict =
-
- re.tpl_host_no_ip_fuzzy + re.src_port + re.src_host_terminator;
-
-
- ////////////////////////////////////////////////////////////////////////////////
- // Main rules
-
- // Rude test fuzzy links by host, for quick deny
- re.tpl_host_fuzzy_test =
-
- 'localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:' + re.src_ZPCc + '|>|$))';
-
- re.tpl_email_fuzzy =
-
- '(^|' + text_separators + '|"|\\(|' + re.src_ZCc + ')' +
- '(' + re.src_email_name + '@' + re.tpl_host_fuzzy_strict + ')';
-
- re.tpl_link_fuzzy =
- // Fuzzy link can't be prepended with .:/\- and non punctuation.
- // but can start with > (markdown blockquote)
- '(^|(?![.:/\\-_@])(?:[$+<=>^`|\uff5c]|' + re.src_ZPCc + '))' +
- '((?![$+<=>^`|\uff5c])' + re.tpl_host_port_fuzzy_strict + re.src_path + ')';
-
- re.tpl_link_no_ip_fuzzy =
- // Fuzzy link can't be prepended with .:/\- and non punctuation.
- // but can start with > (markdown blockquote)
- '(^|(?![.:/\\-_@])(?:[$+<=>^`|\uff5c]|' + re.src_ZPCc + '))' +
- '((?![$+<=>^`|\uff5c])' + re.tpl_host_port_no_ip_fuzzy_strict + re.src_path + ')';
-
- return re;
-};
-
-
-/***/ }),
-/* 103 */
-/***/ (function(module, exports) {
-
-module.exports = require("punycode");
-
-/***/ }),
-/* 104 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// markdown-it default options
-
-
-
-
-module.exports = {
- options: {
- html: false, // Enable HTML tags in source
- xhtmlOut: false, // Use '/' to close single tags (<br />)
- breaks: false, // Convert '\n' in paragraphs into <br>
- langPrefix: 'language-', // CSS language prefix for fenced blocks
- linkify: false, // autoconvert URL-like texts to links
-
- // Enable some language-neutral replacements + quotes beautification
- typographer: false,
-
- // Double + single quotes replacement pairs, when typographer enabled,
- // and smartquotes on. Could be either a String or an Array.
- //
- // For example, you can use '«»„“' for Russian, '„“‚‘' for German,
- // and ['«\xA0', '\xA0»', '‹\xA0', '\xA0›'] for French (including nbsp).
- quotes: '\u201c\u201d\u2018\u2019', /* “”‘’ */
-
- // Highlighter function. Should return escaped HTML,
- // or '' if the source string is not changed and should be escaped externaly.
- // If result starts with <pre... internal wrapper is skipped.
- //
- // function (/*str, lang*/) { return ''; }
- //
- highlight: null,
-
- maxNesting: 100 // Internal protection, recursion limit
- },
-
- components: {
-
- core: {},
- block: {},
- inline: {}
- }
-};
-
-
-/***/ }),
-/* 105 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// "Zero" preset, with nothing enabled. Useful for manual configuring of simple
-// modes. For example, to parse bold/italic only.
-
-
-
-
-module.exports = {
- options: {
- html: false, // Enable HTML tags in source
- xhtmlOut: false, // Use '/' to close single tags (<br />)
- breaks: false, // Convert '\n' in paragraphs into <br>
- langPrefix: 'language-', // CSS language prefix for fenced blocks
- linkify: false, // autoconvert URL-like texts to links
-
- // Enable some language-neutral replacements + quotes beautification
- typographer: false,
-
- // Double + single quotes replacement pairs, when typographer enabled,
- // and smartquotes on. Could be either a String or an Array.
- //
- // For example, you can use '«»„“' for Russian, '„“‚‘' for German,
- // and ['«\xA0', '\xA0»', '‹\xA0', '\xA0›'] for French (including nbsp).
- quotes: '\u201c\u201d\u2018\u2019', /* “”‘’ */
-
- // Highlighter function. Should return escaped HTML,
- // or '' if the source string is not changed and should be escaped externaly.
- // If result starts with <pre... internal wrapper is skipped.
- //
- // function (/*str, lang*/) { return ''; }
- //
- highlight: null,
-
- maxNesting: 20 // Internal protection, recursion limit
- },
-
- components: {
-
- core: {
- rules: [
- 'normalize',
- 'block',
- 'inline'
- ]
- },
-
- block: {
- rules: [
- 'paragraph'
- ]
- },
-
- inline: {
- rules: [
- 'text'
- ],
- rules2: [
- 'balance_pairs',
- 'text_collapse'
- ]
- }
- }
-};
-
-
-/***/ }),
-/* 106 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// Commonmark default options
-
-
-
-
-module.exports = {
- options: {
- html: true, // Enable HTML tags in source
- xhtmlOut: true, // Use '/' to close single tags (<br />)
- breaks: false, // Convert '\n' in paragraphs into <br>
- langPrefix: 'language-', // CSS language prefix for fenced blocks
- linkify: false, // autoconvert URL-like texts to links
-
- // Enable some language-neutral replacements + quotes beautification
- typographer: false,
-
- // Double + single quotes replacement pairs, when typographer enabled,
- // and smartquotes on. Could be either a String or an Array.
- //
- // For example, you can use '«»„“' for Russian, '„“‚‘' for German,
- // and ['«\xA0', '\xA0»', '‹\xA0', '\xA0›'] for French (including nbsp).
- quotes: '\u201c\u201d\u2018\u2019', /* “”‘’ */
-
- // Highlighter function. Should return escaped HTML,
- // or '' if the source string is not changed and should be escaped externaly.
- // If result starts with <pre... internal wrapper is skipped.
- //
- // function (/*str, lang*/) { return ''; }
- //
- highlight: null,
-
- maxNesting: 20 // Internal protection, recursion limit
- },
-
- components: {
-
- core: {
- rules: [
- 'normalize',
- 'block',
- 'inline'
- ]
- },
-
- block: {
- rules: [
- 'blockquote',
- 'code',
- 'fence',
- 'heading',
- 'hr',
- 'html_block',
- 'lheading',
- 'list',
- 'reference',
- 'paragraph'
- ]
- },
-
- inline: {
- rules: [
- 'autolink',
- 'backticks',
- 'emphasis',
- 'entity',
- 'escape',
- 'html_inline',
- 'image',
- 'link',
- 'newline',
- 'text'
- ],
- rules2: [
- 'balance_pairs',
- 'emphasis',
- 'text_collapse'
- ]
- }
- }
-};
-
-
-/***/ }),
-/* 107 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// @ts-check
-
-
-
-const { URL } = __webpack_require__(39);
-const packageJson = __webpack_require__(108);
-const homepage = packageJson.homepage;
-const version = packageJson.version;
-
-const rules = [
- __webpack_require__(109),
- __webpack_require__(112),
- __webpack_require__(113),
- __webpack_require__(114),
- __webpack_require__(116),
- __webpack_require__(117),
- __webpack_require__(118),
- __webpack_require__(119),
- __webpack_require__(120),
- __webpack_require__(121),
- __webpack_require__(122),
- __webpack_require__(123),
- __webpack_require__(124),
- __webpack_require__(125),
- __webpack_require__(126),
- __webpack_require__(127),
- __webpack_require__(128),
- __webpack_require__(129),
- __webpack_require__(130),
- __webpack_require__(131),
- __webpack_require__(132),
- __webpack_require__(133),
- __webpack_require__(134),
- __webpack_require__(135),
- __webpack_require__(136),
- __webpack_require__(137),
- __webpack_require__(138),
- __webpack_require__(139),
- __webpack_require__(140),
- __webpack_require__(141),
- __webpack_require__(142),
- __webpack_require__(143),
- __webpack_require__(144),
- __webpack_require__(145),
- __webpack_require__(146),
- __webpack_require__(147),
- __webpack_require__(148),
- __webpack_require__(149),
- __webpack_require__(150),
- __webpack_require__(151),
- __webpack_require__(152),
- __webpack_require__(153),
- __webpack_require__(154),
- __webpack_require__(155)
-];
-rules.forEach((rule) => {
- const name = rule.names[0].toLowerCase();
- rule.information =
- new URL(`${homepage}/blob/v${version}/doc/Rules.md#${name}`);
-});
-module.exports = rules;
-
-
-/***/ }),
-/* 108 */
-/***/ (function(module) {
-
-module.exports = JSON.parse("{\"name\":\"markdownlint\",\"version\":\"0.20.4\",\"description\":\"A Node.js style checker and lint tool for Markdown/CommonMark files.\",\"main\":\"lib/markdownlint.js\",\"types\":\"lib/markdownlint.d.ts\",\"author\":\"David Anson (https://dlaa.me/)\",\"license\":\"MIT\",\"homepage\":\"https://github.com/DavidAnson/markdownlint\",\"repository\":{\"type\":\"git\",\"url\":\"https://github.com/DavidAnson/markdownlint.git\"},\"bugs\":\"https://github.com/DavidAnson/markdownlint/issues\",\"scripts\":{\"test\":\"node test/markdownlint-test.js\",\"test-cover\":\"c8 --check-coverage --branches 100 --functions 100 --lines 100 --statements 100 node test/markdownlint-test.js\",\"test-declaration\":\"cd example/typescript && tsc && node type-check.js\",\"test-extra\":\"node test/markdownlint-test-extra.js\",\"debug\":\"node debug node_modules/nodeunit/bin/nodeunit\",\"lint\":\"eslint --max-warnings 0 lib helpers test schema && eslint --env browser --global markdownit --global markdownlint --rule \\\"no-unused-vars: 0, no-extend-native: 0, max-statements: 0, no-console: 0, no-var: 0\\\" demo && eslint --rule \\\"no-console: 0, no-invalid-this: 0, no-shadow: 0, object-property-newline: 0\\\" example\",\"ci\":\"npm run test-cover && npm run lint && npm run test-declaration\",\"build-config-schema\":\"node schema/build-config-schema.js\",\"build-declaration\":\"tsc --allowJs --declaration --outDir declaration --resolveJsonModule lib/markdownlint.js && cpy declaration/lib/markdownlint.d.ts lib && rimraf declaration\",\"build-demo\":\"cpy node_modules/markdown-it/dist/markdown-it.min.js demo && cd demo && rimraf markdownlint-browser.* && cpy file-header.js . --rename=markdownlint-browser.js && tsc --allowJs --resolveJsonModule --outDir ../lib-es3 ../lib/markdownlint.js && cpy ../helpers/package.json ../lib-es3/helpers && browserify ../lib-es3/lib/markdownlint.js --standalone markdownlint >> markdownlint-browser.js && uglifyjs markdownlint-browser.js --compress --mangle --comments --output markdownlint-browser.min.js\",\"build-example\":\"npm install --no-save --ignore-scripts grunt grunt-cli gulp through2\",\"example\":\"cd example && node standalone.js && grunt markdownlint --force && gulp markdownlint\",\"clone-test-repos\":\"make-dir test-repos && cd test-repos && git clone https://github.com/eslint/eslint eslint-eslint --depth 1 --no-tags --quiet && git clone https://github.com/mkdocs/mkdocs mkdocs-mkdocs --depth 1 --no-tags --quiet && git clone https://github.com/pi-hole/docs pi-hole-docs --depth 1 --no-tags --quiet\",\"clone-test-repos-large\":\"npm run clone-test-repos && cd test-repos && git clone https://github.com/dotnet/docs dotnet-docs --depth 1 --no-tags --quiet\",\"lint-test-repos\":\"node test/markdownlint-test-repos.js\",\"clean-test-repos\":\"rimraf test-repos\"},\"engines\":{\"node\":\">=10\"},\"dependencies\":{\"markdown-it\":\"10.0.0\"},\"devDependencies\":{\"@types/node\":\"~13.11.1\",\"browserify\":\"~16.5.1\",\"c8\":\"~7.1.2\",\"cpy-cli\":\"~3.1.0\",\"eslint\":\"~6.8.0\",\"eslint-plugin-jsdoc\":\"~22.1.0\",\"globby\":\"~11.0.0\",\"js-yaml\":\"~3.13.1\",\"make-dir-cli\":\"~2.0.0\",\"markdown-it-for-inline\":\"~0.1.1\",\"markdown-it-katex\":\"~2.0.3\",\"markdown-it-sub\":\"~1.0.0\",\"markdown-it-sup\":\"~1.0.0\",\"markdownlint-rule-helpers\":\"~0.7.0\",\"rimraf\":\"~3.0.2\",\"strip-json-comments\":\"~3.1.0\",\"tape\":\"~4.13.2\",\"tape-player\":\"~0.1.0\",\"toml\":\"~3.0.0\",\"tv4\":\"~1.3.0\",\"typescript\":\"~3.8.3\",\"uglify-js\":\"~3.8.1\"},\"keywords\":[\"markdown\",\"lint\",\"md\",\"CommonMark\",\"markdownlint\"],\"browser\":{\"markdown-it\":\"../demo/markdown-it-stub.js\"}}");
-
-/***/ }),
-/* 109 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// @ts-check
-
-
-
-const { addErrorDetailIf, filterTokens } = __webpack_require__(110);
-
-module.exports = {
- "names": [ "MD001", "heading-increment", "header-increment" ],
- "description": "Heading levels should only increment by one level at a time",
- "tags": [ "headings", "headers" ],
- "function": function MD001(params, onError) {
- let prevLevel = 0;
- filterTokens(params, "heading_open", function forToken(token) {
- const level = parseInt(token.tag.slice(1), 10);
- if (prevLevel && (level > prevLevel)) {
- addErrorDetailIf(onError, token.lineNumber,
- "h" + (prevLevel + 1), "h" + level);
- }
- prevLevel = level;
- });
- }
-};
-
-
-/***/ }),
-/* 110 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// @ts-check
-
-
-
-const os = __webpack_require__(111);
-
-// Regular expression for matching common newline characters
-// See NEWLINES_RE in markdown-it/lib/rules_core/normalize.js
-const newLineRe = /\r\n?|\n/g;
-module.exports.newLineRe = newLineRe;
-
-// Regular expression for matching common front matter (YAML and TOML)
-module.exports.frontMatterRe =
- // eslint-disable-next-line max-len
- /((^---\s*$[^]*?^---\s*$)|(^\+\+\+\s*$[^]*?^(\+\+\+|\.\.\.)\s*$))(\r\n|\r|\n|$)/m;
-
-// Regular expression for matching inline disable/enable comments
-const inlineCommentRe =
- // eslint-disable-next-line max-len
- /<!--\s*markdownlint-(?:(?:(disable|enable|capture|restore|disable-file|enable-file)((?:\s+[a-z0-9_-]+)*))|(?:(configure-file)\s+([\s\S]*?)))\s*-->/ig;
-module.exports.inlineCommentRe = inlineCommentRe;
-
-// Regular expressions for range matching
-module.exports.bareUrlRe = /(?:http|ftp)s?:\/\/[^\s\]"']*(?:\/|[^\s\]"'\W])/ig;
-module.exports.listItemMarkerRe = /^([\s>]*)(?:[*+-]|\d+[.)])\s+/;
-module.exports.orderedListItemMarkerRe = /^[\s>]*0*(\d+)[.)]/;
-
-// Regular expression for all instances of emphasis markers
-const emphasisMarkersRe = /[_*]/g;
-
-// Regular expression for inline links and shortcut reference links
-const linkRe = /\[(?:[^[\]]|\[[^\]]*\])*\](?:\(\S*\))?/g;
-
-// readFile options for reading with the UTF-8 encoding
-module.exports.utf8Encoding = { "encoding": "utf8" };
-
-// All punctuation characters (normal and full-width)
-module.exports.allPunctuation = ".,;:!?。,;:!?";
-
-// Returns true iff the input is a number
-module.exports.isNumber = function isNumber(obj) {
- return typeof obj === "number";
-};
-
-// Returns true iff the input is a string
-module.exports.isString = function isString(obj) {
- return typeof obj === "string";
-};
-
-// Returns true iff the input string is empty
-module.exports.isEmptyString = function isEmptyString(str) {
- return str.length === 0;
-};
-
-// Returns true iff the input is an object
-module.exports.isObject = function isObject(obj) {
- return (obj !== null) && (typeof obj === "object") && !Array.isArray(obj);
-};
-
-// Returns true iff the input line is blank (no content)
-// Example: Contains nothing, whitespace, or comments
-const blankLineRe = />|(?:<!--.*?-->)/g;
-module.exports.isBlankLine = function isBlankLine(line) {
- return !line || !line.trim() || !line.replace(blankLineRe, "").trim();
-};
-
-/**
- * Compare function for Array.prototype.sort for ascending order of numbers.
- *
- * @param {number} a First number.
- * @param {number} b Second number.
- * @returns {number} Positive value if a>b, negative value if b<a, 0 otherwise.
- */
-module.exports.numericSortAscending = function numericSortAscending(a, b) {
- return a - b;
-};
-
-// Returns true iff the sorted array contains the specified element
-module.exports.includesSorted = function includesSorted(array, element) {
- let left = 0;
- let right = array.length - 1;
- while (left <= right) {
- /* eslint-disable no-bitwise */
- const mid = (left + right) >> 1;
- if (array[mid] < element) {
- left = mid + 1;
- } else if (array[mid] > element) {
- right = mid - 1;
- } else {
- return true;
- }
- }
- return false;
-};
-
-// Replaces the text of all properly-formatted HTML comments with whitespace
-// This preserves the line/column information for the rest of the document
-// Trailing whitespace is avoided with a '\' character in the last column
-// See https://www.w3.org/TR/html5/syntax.html#comments for details
-const htmlCommentBegin = "<!--";
-const htmlCommentEnd = "-->";
-module.exports.clearHtmlCommentText = function clearHtmlCommentText(text) {
- let i = 0;
- while ((i = text.indexOf(htmlCommentBegin, i)) !== -1) {
- const j = text.indexOf(htmlCommentEnd, i);
- if (j === -1) {
- // Un-terminated comments are treated as text
- break;
- }
- const comment = text.slice(i + htmlCommentBegin.length, j);
- if ((comment.length > 0) &&
- (comment[0] !== ">") &&
- (comment[comment.length - 1] !== "-") &&
- !comment.includes("--") &&
- (text.slice(i, j + htmlCommentEnd.length)
- .search(inlineCommentRe) === -1)) {
- const blanks = comment
- .replace(/[^\r\n]/g, " ")
- .replace(/ ([\r\n])/g, "\\$1");
- text = text.slice(0, i + htmlCommentBegin.length) +
- blanks + text.slice(j);
- }
- i = j + htmlCommentEnd.length;
- }
- return text;
-};
-
-// Escapes a string for use in a RegExp
-module.exports.escapeForRegExp = function escapeForRegExp(str) {
- return str.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&");
-};
-
-// Un-escapes Markdown content (simple algorithm; not a parser)
-const escapedMarkdownRe = /\\./g;
-module.exports.unescapeMarkdown =
- function unescapeMarkdown(markdown, replacement) {
- return markdown.replace(escapedMarkdownRe, (match) => {
- const char = match[1];
- if ("!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~".includes(char)) {
- return replacement || char;
- }
- return match;
- });
- };
-
-/**
- * Return the string representation of a fence markup character.
- *
- * @param {string} markup Fence string.
- * @returns {string} String representation.
- */
-module.exports.fencedCodeBlockStyleFor =
- function fencedCodeBlockStyleFor(markup) {
- switch (markup[0]) {
- case "~":
- return "tilde";
- default:
- return "backtick";
- }
- };
-
-/**
- * Return the number of characters of indent for a token.
- *
- * @param {Object} token MarkdownItToken instance.
- * @returns {number} Characters of indent.
- */
-function indentFor(token) {
- const line = token.line.replace(/^[\s>]*(> |>)/, "");
- return line.length - line.trimLeft().length;
-}
-module.exports.indentFor = indentFor;
-
-// Returns the heading style for a heading token
-module.exports.headingStyleFor = function headingStyleFor(token) {
- if ((token.map[1] - token.map[0]) === 1) {
- if (/[^\\]#\s*$/.test(token.line)) {
- return "atx_closed";
- }
- return "atx";
- }
- return "setext";
-};
-
-/**
- * Return the string representation of an unordered list marker.
- *
- * @param {Object} token MarkdownItToken instance.
- * @returns {string} String representation.
- */
-module.exports.unorderedListStyleFor = function unorderedListStyleFor(token) {
- switch (token.markup) {
- case "-":
- return "dash";
- case "+":
- return "plus";
- // case "*":
- default:
- return "asterisk";
- }
-};
-
-/**
- * Calls the provided function for each matching token.
- *
- * @param {Object} params RuleParams instance.
- * @param {string} type Token type identifier.
- * @param {Function} handler Callback function.
- * @returns {void}
- */
-function filterTokens(params, type, handler) {
- params.tokens.forEach(function forToken(token) {
- if (token.type === type) {
- handler(token);
- }
- });
-}
-module.exports.filterTokens = filterTokens;
-
-// Get line metadata array
-module.exports.getLineMetadata = function getLineMetadata(params) {
- const lineMetadata = params.lines.map(function mapLine(line, index) {
- return [ line, index, false, 0, false, false ];
- });
- filterTokens(params, "fence", function forToken(token) {
- lineMetadata[token.map[0]][3] = 1;
- lineMetadata[token.map[1] - 1][3] = -1;
- for (let i = token.map[0] + 1; i < token.map[1] - 1; i++) {
- lineMetadata[i][2] = true;
- }
- });
- filterTokens(params, "code_block", function forToken(token) {
- for (let i = token.map[0]; i < token.map[1]; i++) {
- lineMetadata[i][2] = true;
- }
- });
- filterTokens(params, "table_open", function forToken(token) {
- for (let i = token.map[0]; i < token.map[1]; i++) {
- lineMetadata[i][4] = true;
- }
- });
- filterTokens(params, "list_item_open", function forToken(token) {
- let count = 1;
- for (let i = token.map[0]; i < token.map[1]; i++) {
- lineMetadata[i][5] = count;
- count++;
- }
- });
- filterTokens(params, "hr", function forToken(token) {
- lineMetadata[token.map[0]][6] = true;
- });
- return lineMetadata;
-};
-
-// Calls the provided function for each line (with context)
-module.exports.forEachLine = function forEachLine(lineMetadata, handler) {
- lineMetadata.forEach(function forMetadata(metadata) {
- // Parameters: line, lineIndex, inCode, onFence, inTable, inItem, inBreak
- handler(...metadata);
- });
-};
-
-// Returns (nested) lists as a flat array (in order)
-module.exports.flattenLists = function flattenLists(params) {
- const flattenedLists = [];
- const stack = [];
- let current = null;
- let nesting = 0;
- const nestingStack = [];
- let lastWithMap = { "map": [ 0, 1 ] };
- params.tokens.forEach(function forToken(token) {
- if ((token.type === "bullet_list_open") ||
- (token.type === "ordered_list_open")) {
- // Save current context and start a new one
- stack.push(current);
- current = {
- "unordered": (token.type === "bullet_list_open"),
- "parentsUnordered": !current ||
- (current.unordered && current.parentsUnordered),
- "open": token,
- "indent": indentFor(token),
- "parentIndent": (current && current.indent) || 0,
- "items": [],
- "nesting": nesting,
- "lastLineIndex": -1,
- "insert": flattenedLists.length
- };
- nesting++;
- } else if ((token.type === "bullet_list_close") ||
- (token.type === "ordered_list_close")) {
- // Finalize current context and restore previous
- current.lastLineIndex = lastWithMap.map[1];
- flattenedLists.splice(current.insert, 0, current);
- delete current.insert;
- current = stack.pop();
- nesting--;
- } else if (token.type === "list_item_open") {
- // Add list item
- current.items.push(token);
- } else if (token.type === "blockquote_open") {
- nestingStack.push(nesting);
- nesting = 0;
- } else if (token.type === "blockquote_close") {
- nesting = nestingStack.pop();
- } else if (token.map) {
- // Track last token with map
- lastWithMap = token;
- }
- });
- return flattenedLists;
-};
-
-// Calls the provided function for each specified inline child token
-module.exports.forEachInlineChild =
-function forEachInlineChild(params, type, handler) {
- filterTokens(params, "inline", function forToken(token) {
- token.children.forEach(function forChild(child) {
- if (child.type === type) {
- handler(child, token);
- }
- });
- });
-};
-
-// Calls the provided function for each heading's content
-module.exports.forEachHeading = function forEachHeading(params, handler) {
- let heading = null;
- params.tokens.forEach(function forToken(token) {
- if (token.type === "heading_open") {
- heading = token;
- } else if (token.type === "heading_close") {
- heading = null;
- } else if ((token.type === "inline") && heading) {
- handler(heading, token.content);
- }
- });
-};
-
-/**
- * Calls the provided function for each inline code span's content.
- *
- * @param {string} input Markdown content.
- * @param {Function} handler Callback function.
- * @returns {void}
- */
-function forEachInlineCodeSpan(input, handler) {
- let currentLine = 0;
- let currentColumn = 0;
- let index = 0;
- while (index < input.length) {
- let startIndex = -1;
- let startLine = -1;
- let startColumn = -1;
- let tickCount = 0;
- let currentTicks = 0;
- let state = "normal";
- // Deliberate <= so trailing 0 completes the last span (ex: "text `code`")
- for (; index <= input.length; index++) {
- const char = input[index];
- // Ignore backticks in link destination
- if ((char === "[") && (state === "normal")) {
- state = "linkTextOpen";
- } else if ((char === "]") && (state === "linkTextOpen")) {
- state = "linkTextClosed";
- } else if ((char === "(") && (state === "linkTextClosed")) {
- state = "linkDestinationOpen";
- } else if (
- ((char === "(") && (state === "linkDestinationOpen")) ||
- ((char === ")") && (state === "linkDestinationOpen")) ||
- (state === "linkTextClosed")) {
- state = "normal";
- }
- // Parse backtick open/close
- if ((char === "`") && (state !== "linkDestinationOpen")) {
- // Count backticks at start or end of code span
- currentTicks++;
- if ((startIndex === -1) || (startColumn === -1)) {
- startIndex = index + 1;
- }
- } else {
- if ((startIndex >= 0) &&
- (startColumn >= 0) &&
- (tickCount === currentTicks)) {
- // Found end backticks; invoke callback for code span
- handler(
- input.substring(startIndex, index - currentTicks),
- startLine, startColumn, tickCount);
- startIndex = -1;
- startColumn = -1;
- } else if ((startIndex >= 0) && (startColumn === -1)) {
- // Found start backticks
- tickCount = currentTicks;
- startLine = currentLine;
- startColumn = currentColumn;
- }
- // Not in backticks
- currentTicks = 0;
- }
- if (char === "\n") {
- // On next line
- currentLine++;
- currentColumn = 0;
- } else if ((char === "\\") &&
- ((startIndex === -1) || (startColumn === -1)) &&
- (input[index + 1] !== "\n")) {
- // Escape character outside code, skip next
- index++;
- currentColumn += 2;
- } else {
- // On next column
- currentColumn++;
- }
- }
- if (startIndex >= 0) {
- // Restart loop after unmatched start backticks (ex: "`text``code``")
- index = startIndex;
- currentLine = startLine;
- currentColumn = startColumn;
- }
- }
-}
-module.exports.forEachInlineCodeSpan = forEachInlineCodeSpan;
-
-/**
- * Adds a generic error object via the onError callback.
- *
- * @param {Object} onError RuleOnError instance.
- * @param {number} lineNumber Line number.
- * @param {string} [detail] Error details.
- * @param {string} [context] Error context.
- * @param {number[]} [range] Column and length of error.
- * @param {Object} [fixInfo] RuleOnErrorFixInfo instance.
- * @returns {void}
- */
-function addError(onError, lineNumber, detail, context, range, fixInfo) {
- onError({
- lineNumber,
- detail,
- context,
- range,
- fixInfo
- });
-}
-module.exports.addError = addError;
-
-// Adds an error object with details conditionally via the onError callback
-module.exports.addErrorDetailIf = function addErrorDetailIf(
- onError, lineNumber, expected, actual, detail, context, range, fixInfo) {
- if (expected !== actual) {
- addError(
- onError,
- lineNumber,
- "Expected: " + expected + "; Actual: " + actual +
- (detail ? "; " + detail : ""),
- context,
- range,
- fixInfo);
- }
-};
-
-// Adds an error object with context via the onError callback
-module.exports.addErrorContext = function addErrorContext(
- onError, lineNumber, context, left, right, range, fixInfo) {
- if (context.length <= 30) {
- // Nothing to do
- } else if (left && right) {
- context = context.substr(0, 15) + "..." + context.substr(-15);
- } else if (right) {
- context = "..." + context.substr(-30);
- } else {
- context = context.substr(0, 30) + "...";
- }
- addError(onError, lineNumber, null, context, range, fixInfo);
-};
-
-// Returns a range object for a line by applying a RegExp
-module.exports.rangeFromRegExp = function rangeFromRegExp(line, regexp) {
- let range = null;
- const match = line.match(regexp);
- if (match) {
- const column = match.index + 1;
- const length = match[0].length;
- range = [ column, length ];
- }
- return range;
-};
-
-// Determines if the front matter includes a title
-module.exports.frontMatterHasTitle =
- function frontMatterHasTitle(frontMatterLines, frontMatterTitlePattern) {
- const ignoreFrontMatter =
- (frontMatterTitlePattern !== undefined) && !frontMatterTitlePattern;
- const frontMatterTitleRe =
- new RegExp(String(frontMatterTitlePattern || "^\\s*title\\s*[:=]"), "i");
- return !ignoreFrontMatter &&
- frontMatterLines.some((line) => frontMatterTitleRe.test(line));
- };
-
-/**
- * Returns a list of emphasis markers in code spans and links.
- *
- * @param {Object} params RuleParams instance.
- * @returns {number[][]} List of markers.
- */
-function emphasisMarkersInContent(params) {
- const { lines } = params;
- const byLine = new Array(lines.length);
- // Search code spans
- filterTokens(params, "inline", (token) => {
- const { children, lineNumber, map } = token;
- if (children.some((child) => child.type === "code_inline")) {
- const tokenLines = lines.slice(map[0], map[1]);
- forEachInlineCodeSpan(
- tokenLines.join("\n"),
- (code, lineIndex, column, tickCount) => {
- const codeLines = code.split(newLineRe);
- codeLines.forEach((codeLine, codeLineIndex) => {
- let match = null;
- while ((match = emphasisMarkersRe.exec(codeLine))) {
- const byLineIndex = lineNumber - 1 + lineIndex + codeLineIndex;
- const inLine = byLine[byLineIndex] || [];
- const codeLineOffset = codeLineIndex ? 0 : column - 1 + tickCount;
- inLine.push(codeLineOffset + match.index);
- byLine[byLineIndex] = inLine;
- }
- });
- }
- );
- }
- });
- // Search links
- lines.forEach((tokenLine, tokenLineIndex) => {
- let linkMatch = null;
- while ((linkMatch = linkRe.exec(tokenLine))) {
- let markerMatch = null;
- while ((markerMatch = emphasisMarkersRe.exec(linkMatch[0]))) {
- const inLine = byLine[tokenLineIndex] || [];
- inLine.push(linkMatch.index + markerMatch.index);
- byLine[tokenLineIndex] = inLine;
- }
- }
- });
- return byLine;
-}
-module.exports.emphasisMarkersInContent = emphasisMarkersInContent;
-
-/**
- * Gets the most common line ending, falling back to the platform default.
- *
- * @param {string} input Markdown content to analyze.
- * @returns {string} Preferred line ending.
- */
-function getPreferredLineEnding(input) {
- let cr = 0;
- let lf = 0;
- let crlf = 0;
- const endings = input.match(newLineRe) || [];
- endings.forEach((ending) => {
- // eslint-disable-next-line default-case
- switch (ending) {
- case "\r":
- cr++;
- break;
- case "\n":
- lf++;
- break;
- case "\r\n":
- crlf++;
- break;
- }
- });
- let preferredLineEnding = null;
- if (!cr && !lf && !crlf) {
- preferredLineEnding = os.EOL;
- } else if ((lf >= crlf) && (lf >= cr)) {
- preferredLineEnding = "\n";
- } else if (crlf >= cr) {
- preferredLineEnding = "\r\n";
- } else {
- preferredLineEnding = "\r";
- }
- return preferredLineEnding;
-}
-module.exports.getPreferredLineEnding = getPreferredLineEnding;
-
-/**
- * Normalizes the fields of a RuleOnErrorFixInfo instance.
- *
- * @param {Object} fixInfo RuleOnErrorFixInfo instance.
- * @param {number} [lineNumber] Line number.
- * @returns {Object} Normalized RuleOnErrorFixInfo instance.
- */
-function normalizeFixInfo(fixInfo, lineNumber) {
- return {
- "lineNumber": fixInfo.lineNumber || lineNumber,
- "editColumn": fixInfo.editColumn || 1,
- "deleteCount": fixInfo.deleteCount || 0,
- "insertText": fixInfo.insertText || ""
- };
-}
-
-/**
- * Fixes the specified error on a line of Markdown content.
- *
- * @param {string} line Line of Markdown content.
- * @param {Object} fixInfo RuleOnErrorFixInfo instance.
- * @param {string} lineEnding Line ending to use.
- * @returns {string} Fixed content.
- */
-function applyFix(line, fixInfo, lineEnding) {
- const { editColumn, deleteCount, insertText } = normalizeFixInfo(fixInfo);
- const editIndex = editColumn - 1;
- return (deleteCount === -1) ?
- null :
- line.slice(0, editIndex) +
- insertText.replace(/\n/g, lineEnding || "\n") +
- line.slice(editIndex + deleteCount);
-}
-module.exports.applyFix = applyFix;
-
-// Applies as many fixes as possible to the input lines
-module.exports.applyFixes = function applyFixes(input, errors) {
- const lineEnding = getPreferredLineEnding(input);
- const lines = input.split(newLineRe);
- // Normalize fixInfo objects
- let fixInfos = errors
- .filter((error) => error.fixInfo)
- .map((error) => normalizeFixInfo(error.fixInfo, error.lineNumber));
- // Sort bottom-to-top, line-deletes last, right-to-left, long-to-short
- fixInfos.sort((a, b) => {
- const aDeletingLine = (a.deleteCount === -1);
- const bDeletingLine = (b.deleteCount === -1);
- return (
- (b.lineNumber - a.lineNumber) ||
- (aDeletingLine ? 1 : (bDeletingLine ? -1 : 0)) ||
- (b.editColumn - a.editColumn) ||
- (b.insertText.length - a.insertText.length)
- );
- });
- // Remove duplicate entries (needed for following collapse step)
- let lastFixInfo = {};
- fixInfos = fixInfos.filter((fixInfo) => {
- const unique = (
- (fixInfo.lineNumber !== lastFixInfo.lineNumber) ||
- (fixInfo.editColumn !== lastFixInfo.editColumn) ||
- (fixInfo.deleteCount !== lastFixInfo.deleteCount) ||
- (fixInfo.insertText !== lastFixInfo.insertText)
- );
- lastFixInfo = fixInfo;
- return unique;
- });
- // Collapse insert/no-delete and no-insert/delete for same line/column
- lastFixInfo = {};
- fixInfos.forEach((fixInfo) => {
- if (
- (fixInfo.lineNumber === lastFixInfo.lineNumber) &&
- (fixInfo.editColumn === lastFixInfo.editColumn) &&
- !fixInfo.insertText &&
- (fixInfo.deleteCount > 0) &&
- lastFixInfo.insertText &&
- !lastFixInfo.deleteCount) {
- fixInfo.insertText = lastFixInfo.insertText;
- lastFixInfo.lineNumber = 0;
- }
- lastFixInfo = fixInfo;
- });
- fixInfos = fixInfos.filter((fixInfo) => fixInfo.lineNumber);
- // Apply all (remaining/updated) fixes
- let lastLineIndex = -1;
- let lastEditIndex = -1;
- fixInfos.forEach((fixInfo) => {
- const { lineNumber, editColumn, deleteCount } = fixInfo;
- const lineIndex = lineNumber - 1;
- const editIndex = editColumn - 1;
- if (
- (lineIndex !== lastLineIndex) ||
- ((editIndex + deleteCount) < lastEditIndex) ||
- (deleteCount === -1)
- ) {
- lines[lineIndex] = applyFix(lines[lineIndex], fixInfo, lineEnding);
- }
- lastLineIndex = lineIndex;
- lastEditIndex = editIndex;
- });
- // Return corrected input
- return lines.filter((line) => line !== null).join(lineEnding);
-};
-
-
-/***/ }),
-/* 111 */
-/***/ (function(module, exports) {
-
-module.exports = require("os");
-
-/***/ }),
-/* 112 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// @ts-check
-
-
-
-const { addErrorDetailIf } = __webpack_require__(110);
-
-module.exports = {
- "names": [ "MD002", "first-heading-h1", "first-header-h1" ],
- "description": "First heading should be a top level heading",
- "tags": [ "headings", "headers" ],
- "function": function MD002(params, onError) {
- const level = Number(params.config.level || 1);
- const tag = "h" + level;
- params.tokens.every(function forToken(token) {
- if (token.type === "heading_open") {
- addErrorDetailIf(onError, token.lineNumber, tag, token.tag);
- return false;
- }
- return true;
- });
- }
-};
-
-
-/***/ }),
-/* 113 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// @ts-check
-
-
-
-const { addErrorDetailIf, filterTokens, headingStyleFor } =
- __webpack_require__(110);
-
-module.exports = {
- "names": [ "MD003", "heading-style", "header-style" ],
- "description": "Heading style",
- "tags": [ "headings", "headers" ],
- "function": function MD003(params, onError) {
- let style = String(params.config.style || "consistent");
- filterTokens(params, "heading_open", function forToken(token) {
- const styleForToken = headingStyleFor(token);
- if (style === "consistent") {
- style = styleForToken;
- }
- if (styleForToken !== style) {
- const h12 = /h[12]/.test(token.tag);
- const setextWithAtx =
- (style === "setext_with_atx") &&
- ((h12 && (styleForToken === "setext")) ||
- (!h12 && (styleForToken === "atx")));
- const setextWithAtxClosed =
- (style === "setext_with_atx_closed") &&
- ((h12 && (styleForToken === "setext")) ||
- (!h12 && (styleForToken === "atx_closed")));
- if (!setextWithAtx && !setextWithAtxClosed) {
- let expected = style;
- if (style === "setext_with_atx") {
- expected = h12 ? "setext" : "atx";
- } else if (style === "setext_with_atx_closed") {
- expected = h12 ? "setext" : "atx_closed";
- }
- addErrorDetailIf(onError, token.lineNumber,
- expected, styleForToken);
- }
- }
- });
- }
-};
-
-
-/***/ }),
-/* 114 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// @ts-check
-
-
-
-const { addErrorDetailIf, listItemMarkerRe,
- rangeFromRegExp, unorderedListStyleFor } = __webpack_require__(110);
-const { flattenedLists } = __webpack_require__(115);
-
-module.exports = {
- "names": [ "MD004", "ul-style" ],
- "description": "Unordered list style",
- "tags": [ "bullet", "ul" ],
- "function": function MD004(params, onError) {
- const style = String(params.config.style || "consistent");
- let expectedStyle = style;
- const nestingStyles = [];
- flattenedLists().forEach((list) => {
- if (list.unordered) {
- if (expectedStyle === "consistent") {
- expectedStyle = unorderedListStyleFor(list.items[0]);
- }
- list.items.forEach((item) => {
- const itemStyle = unorderedListStyleFor(item);
- if (style === "sublist") {
- const nesting = list.nesting;
- if (!nestingStyles[nesting] &&
- (itemStyle !== nestingStyles[nesting - 1])) {
- nestingStyles[nesting] = itemStyle;
- } else {
- addErrorDetailIf(onError, item.lineNumber,
- nestingStyles[nesting], itemStyle, null, null,
- rangeFromRegExp(item.line, listItemMarkerRe));
- }
- } else {
- addErrorDetailIf(onError, item.lineNumber,
- expectedStyle, itemStyle, null, null,
- rangeFromRegExp(item.line, listItemMarkerRe));
- }
- });
- }
- });
- }
-};
-
-
-/***/ }),
-/* 115 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// @ts-check
-
-
-
-let lineMetadata = null;
-module.exports.lineMetadata = (value) => {
- if (value) {
- lineMetadata = value;
- }
- return lineMetadata;
-};
-
-let flattenedLists = null;
-module.exports.flattenedLists = (value) => {
- if (value) {
- flattenedLists = value;
- }
- return flattenedLists;
-};
-
-module.exports.clear = () => {
- lineMetadata = null;
- flattenedLists = null;
-};
-
-
-/***/ }),
-/* 116 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// @ts-check
-
-
-
-const { addError, addErrorDetailIf, indentFor, listItemMarkerRe,
- orderedListItemMarkerRe, rangeFromRegExp } = __webpack_require__(110);
-const { flattenedLists } = __webpack_require__(115);
-
-module.exports = {
- "names": [ "MD005", "list-indent" ],
- "description": "Inconsistent indentation for list items at the same level",
- "tags": [ "bullet", "ul", "indentation" ],
- "function": function MD005(params, onError) {
- flattenedLists().forEach((list) => {
- const expectedIndent = list.indent;
- let expectedEnd = 0;
- let actualEnd = -1;
- let endMatching = false;
- list.items.forEach((item) => {
- const { line, lineNumber } = item;
- const actualIndent = indentFor(item);
- let match = null;
- if (list.unordered) {
- addErrorDetailIf(
- onError,
- lineNumber,
- expectedIndent,
- actualIndent,
- null,
- null,
- rangeFromRegExp(line, listItemMarkerRe)
- // No fixInfo; MD007 handles this scenario better
- );
- } else if ((match = orderedListItemMarkerRe.exec(line))) {
- actualEnd = match[0].length;
- expectedEnd = expectedEnd || actualEnd;
- const markerLength = match[1].length + 1;
- if ((expectedIndent !== actualIndent) || endMatching) {
- if (expectedEnd === actualEnd) {
- endMatching = true;
- } else {
- const detail = endMatching ?
- `Expected: (${expectedEnd}); Actual: (${actualEnd})` :
- `Expected: ${expectedIndent}; Actual: ${actualIndent}`;
- const expected = endMatching ?
- expectedEnd - markerLength :
- expectedIndent;
- const actual = endMatching ?
- actualEnd - markerLength :
- actualIndent;
- addError(
- onError,
- lineNumber,
- detail,
- null,
- rangeFromRegExp(line, listItemMarkerRe),
- {
- "editColumn": Math.min(actual, expected) + 1,
- "deleteCount": Math.max(actual - expected, 0),
- "insertText": "".padEnd(Math.max(expected - actual, 0))
- }
- );
- }
- }
- }
- });
- });
- }
-};
-
-
-/***/ }),
-/* 117 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// @ts-check
-
-
-
-const { addErrorDetailIf, listItemMarkerRe, rangeFromRegExp } =
- __webpack_require__(110);
-const { flattenedLists } = __webpack_require__(115);
-
-module.exports = {
- "names": [ "MD006", "ul-start-left" ],
- "description":
- "Consider starting bulleted lists at the beginning of the line",
- "tags": [ "bullet", "ul", "indentation" ],
- "function": function MD006(params, onError) {
- flattenedLists().forEach((list) => {
- if (list.unordered && !list.nesting && (list.indent !== 0)) {
- list.items.forEach((item) => {
- const { lineNumber, line } = item;
- addErrorDetailIf(
- onError,
- lineNumber,
- 0,
- list.indent,
- null,
- null,
- rangeFromRegExp(line, listItemMarkerRe),
- {
- "deleteCount": line.length - line.trimLeft().length
- });
- });
- }
- });
- }
-};
-
-
-/***/ }),
-/* 118 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// @ts-check
-
-
-
-const { addErrorDetailIf, indentFor, listItemMarkerRe } =
- __webpack_require__(110);
-const { flattenedLists } = __webpack_require__(115);
-
-module.exports = {
- "names": [ "MD007", "ul-indent" ],
- "description": "Unordered list indentation",
- "tags": [ "bullet", "ul", "indentation" ],
- "function": function MD007(params, onError) {
- const indent = Number(params.config.indent || 2);
- const startIndented = !!params.config.start_indented;
- flattenedLists().forEach((list) => {
- if (list.unordered && list.parentsUnordered) {
- list.items.forEach((item) => {
- const { lineNumber, line } = item;
- const expectedNesting = list.nesting + (startIndented ? 1 : 0);
- const expectedIndent = expectedNesting * indent;
- const actualIndent = indentFor(item);
- let range = null;
- let editColumn = 1;
- const match = line.match(listItemMarkerRe);
- if (match) {
- range = [ 1, match[0].length ];
- editColumn += match[1].length - actualIndent;
- }
- addErrorDetailIf(
- onError,
- lineNumber,
- expectedIndent,
- actualIndent,
- null,
- null,
- range,
- {
- editColumn,
- "deleteCount": actualIndent,
- "insertText": "".padEnd(expectedIndent)
- });
- });
- }
- });
- }
-};
-
-
-/***/ }),
-/* 119 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// @ts-check
-
-
-
-const { addError, filterTokens, forEachInlineCodeSpan, forEachLine,
- includesSorted, newLineRe, numericSortAscending } = __webpack_require__(110);
-const { lineMetadata } = __webpack_require__(115);
-
-module.exports = {
- "names": [ "MD009", "no-trailing-spaces" ],
- "description": "Trailing spaces",
- "tags": [ "whitespace" ],
- "function": function MD009(params, onError) {
- let brSpaces = params.config.br_spaces;
- brSpaces = Number((brSpaces === undefined) ? 2 : brSpaces);
- const listItemEmptyLines = !!params.config.list_item_empty_lines;
- const strict = !!params.config.strict;
- const listItemLineNumbers = [];
- if (listItemEmptyLines) {
- filterTokens(params, "list_item_open", (token) => {
- for (let i = token.map[0]; i < token.map[1]; i++) {
- listItemLineNumbers.push(i + 1);
- }
- });
- listItemLineNumbers.sort(numericSortAscending);
- }
- const paragraphLineNumbers = [];
- const codeInlineLineNumbers = [];
- if (strict) {
- filterTokens(params, "paragraph_open", (token) => {
- for (let i = token.map[0]; i < token.map[1] - 1; i++) {
- paragraphLineNumbers.push(i + 1);
- }
- });
- paragraphLineNumbers.sort(numericSortAscending);
- filterTokens(params, "inline", (token) => {
- if (token.children.some((child) => child.type === "code_inline")) {
- const tokenLines = params.lines.slice(token.map[0], token.map[1]);
- forEachInlineCodeSpan(tokenLines.join("\n"), (code, lineIndex) => {
- const codeLineCount = code.split(newLineRe).length;
- for (let i = 0; i < codeLineCount; i++) {
- codeInlineLineNumbers.push(token.lineNumber + lineIndex + i);
- }
- });
- }
- });
- codeInlineLineNumbers.sort(numericSortAscending);
- }
- const expected = (brSpaces < 2) ? 0 : brSpaces;
- let inFencedCode = 0;
- forEachLine(lineMetadata(), (line, lineIndex, inCode, onFence) => {
- inFencedCode += onFence;
- const lineNumber = lineIndex + 1;
- const trailingSpaces = line.length - line.trimRight().length;
- if ((!inCode || inFencedCode) && trailingSpaces &&
- !includesSorted(listItemLineNumbers, lineNumber)) {
- if ((expected !== trailingSpaces) ||
- (strict &&
- (!includesSorted(paragraphLineNumbers, lineNumber) ||
- includesSorted(codeInlineLineNumbers, lineNumber)))) {
- const column = line.length - trailingSpaces + 1;
- addError(
- onError,
- lineNumber,
- "Expected: " + (expected === 0 ? "" : "0 or ") +
- expected + "; Actual: " + trailingSpaces,
- null,
- [ column, trailingSpaces ],
- {
- "editColumn": column,
- "deleteCount": trailingSpaces
- });
- }
- }
- });
- }
-};
-
-
-/***/ }),
-/* 120 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// @ts-check
-
-
-
-const { addError, forEachLine } = __webpack_require__(110);
-const { lineMetadata } = __webpack_require__(115);
-
-const tabRe = /\t+/g;
-
-module.exports = {
- "names": [ "MD010", "no-hard-tabs" ],
- "description": "Hard tabs",
- "tags": [ "whitespace", "hard_tab" ],
- "function": function MD010(params, onError) {
- const codeBlocks = params.config.code_blocks;
- const includeCodeBlocks = (codeBlocks === undefined) ? true : !!codeBlocks;
- forEachLine(lineMetadata(), (line, lineIndex, inCode) => {
- if (!inCode || includeCodeBlocks) {
- let match = null;
- while ((match = tabRe.exec(line)) !== null) {
- const column = match.index + 1;
- const length = match[0].length;
- addError(
- onError,
- lineIndex + 1,
- "Column: " + column,
- null,
- [ column, length ],
- {
- "editColumn": column,
- "deleteCount": length,
- "insertText": "".padEnd(length)
- });
- }
- }
- });
- }
-};
-
-
-/***/ }),
-/* 121 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// @ts-check
-
-
-
-const { addError, forEachInlineChild, unescapeMarkdown } =
- __webpack_require__(110);
-
-const reversedLinkRe = /\(([^)]+)\)\[([^\]^][^\]]*)]/g;
-
-module.exports = {
- "names": [ "MD011", "no-reversed-links" ],
- "description": "Reversed link syntax",
- "tags": [ "links" ],
- "function": function MD011(params, onError) {
- forEachInlineChild(params, "text", (token) => {
- const { lineNumber, content } = token;
- let match = null;
- while ((match = reversedLinkRe.exec(content)) !== null) {
- const [ reversedLink, linkText, linkDestination ] = match;
- const line = params.lines[lineNumber - 1];
- const column = unescapeMarkdown(line).indexOf(reversedLink) + 1;
- const length = reversedLink.length;
- addError(
- onError,
- lineNumber,
- reversedLink,
- null,
- [ column, length ],
- {
- "editColumn": column,
- "deleteCount": length,
- "insertText": `[${linkText}](${linkDestination})`
- }
- );
- }
- });
- }
-};
-
-
-/***/ }),
-/* 122 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// @ts-check
-
-
-
-const { addErrorDetailIf, forEachLine } = __webpack_require__(110);
-const { lineMetadata } = __webpack_require__(115);
-
-module.exports = {
- "names": [ "MD012", "no-multiple-blanks" ],
- "description": "Multiple consecutive blank lines",
- "tags": [ "whitespace", "blank_lines" ],
- "function": function MD012(params, onError) {
- const maximum = Number(params.config.maximum || 1);
- let count = 0;
- forEachLine(lineMetadata(), (line, lineIndex, inCode) => {
- count = (inCode || line.trim().length) ? 0 : count + 1;
- if (maximum < count) {
- addErrorDetailIf(
- onError,
- lineIndex + 1,
- maximum,
- count,
- null,
- null,
- null,
- {
- "deleteCount": -1
- });
- }
- });
- }
-};
-
-
-/***/ }),
-/* 123 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// @ts-check
-
-
-
-const { addErrorDetailIf, filterTokens, forEachHeading, forEachLine,
- includesSorted } = __webpack_require__(110);
-const { lineMetadata } = __webpack_require__(115);
-
-const longLineRePrefix = "^.{";
-const longLineRePostfixRelaxed = "}.*\\s.*$";
-const longLineRePostfixStrict = "}.+$";
-const labelRe = /^\s*\[.*[^\\]]:/;
-const linkOrImageOnlyLineRe = /^[es]*(lT?L|I)[ES]*$/;
-const sternModeRe = /^([#>\s]*\s)?\S*$/;
-const tokenTypeMap = {
- "em_open": "e",
- "em_close": "E",
- "image": "I",
- "link_open": "l",
- "link_close": "L",
- "strong_open": "s",
- "strong_close": "S",
- "text": "T"
-};
-
-module.exports = {
- "names": [ "MD013", "line-length" ],
- "description": "Line length",
- "tags": [ "line_length" ],
- "function": function MD013(params, onError) {
- const lineLength = Number(params.config.line_length || 80);
- const headingLineLength =
- Number(params.config.heading_line_length || lineLength);
- const codeLineLength =
- Number(params.config.code_block_line_length || lineLength);
- const strict = !!params.config.strict;
- const stern = !!params.config.stern;
- const longLineRePostfix =
- (strict || stern) ? longLineRePostfixStrict : longLineRePostfixRelaxed;
- const longLineRe =
- new RegExp(longLineRePrefix + lineLength + longLineRePostfix);
- const longHeadingLineRe =
- new RegExp(longLineRePrefix + headingLineLength + longLineRePostfix);
- const longCodeLineRe =
- new RegExp(longLineRePrefix + codeLineLength + longLineRePostfix);
- const codeBlocks = params.config.code_blocks;
- const includeCodeBlocks = (codeBlocks === undefined) ? true : !!codeBlocks;
- const tables = params.config.tables;
- const includeTables = (tables === undefined) ? true : !!tables;
- let headings = params.config.headings;
- if (headings === undefined) {
- headings = params.config.headers;
- }
- const includeHeadings = (headings === undefined) ? true : !!headings;
- const headingLineNumbers = [];
- forEachHeading(params, (heading) => {
- headingLineNumbers.push(heading.lineNumber);
- });
- const linkOnlyLineNumbers = [];
- filterTokens(params, "inline", (token) => {
- let childTokenTypes = "";
- token.children.forEach((child) => {
- if (child.type !== "text" || child.content !== "") {
- childTokenTypes += tokenTypeMap[child.type] || "x";
- }
- });
- if (linkOrImageOnlyLineRe.test(childTokenTypes)) {
- linkOnlyLineNumbers.push(token.lineNumber);
- }
- });
- forEachLine(lineMetadata(), (line, lineIndex, inCode, onFence, inTable) => {
- const lineNumber = lineIndex + 1;
- const isHeading = includesSorted(headingLineNumbers, lineNumber);
- const length = inCode ?
- codeLineLength :
- (isHeading ? headingLineLength : lineLength);
- const lengthRe = inCode ?
- longCodeLineRe :
- (isHeading ? longHeadingLineRe : longLineRe);
- if ((includeCodeBlocks || !inCode) &&
- (includeTables || !inTable) &&
- (includeHeadings || !isHeading) &&
- (strict ||
- (!(stern && sternModeRe.test(line)) &&
- !includesSorted(linkOnlyLineNumbers, lineNumber) &&
- !labelRe.test(line))) &&
- lengthRe.test(line)) {
- addErrorDetailIf(
- onError,
- lineNumber,
- length,
- line.length,
- null,
- null,
- [ length + 1, line.length - length ]);
- }
- });
- }
-};
-
-
-/***/ }),
-/* 124 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// @ts-check
-
-
-
-const { addErrorContext, filterTokens } = __webpack_require__(110);
-
-const dollarCommandRe = /^(\s*)(\$\s+)/;
-
-module.exports = {
- "names": [ "MD014", "commands-show-output" ],
- "description": "Dollar signs used before commands without showing output",
- "tags": [ "code" ],
- "function": function MD014(params, onError) {
- [ "code_block", "fence" ].forEach((type) => {
- filterTokens(params, type, (token) => {
- const margin = (token.type === "fence") ? 1 : 0;
- const dollarInstances = [];
- let allDollars = true;
- for (let i = token.map[0] + margin; i < token.map[1] - margin; i++) {
- const line = params.lines[i];
- const lineTrim = line.trim();
- if (lineTrim) {
- const match = dollarCommandRe.exec(line);
- if (match) {
- const column = match[1].length + 1;
- const length = match[2].length;
- dollarInstances.push([ i, lineTrim, column, length ]);
- } else {
- allDollars = false;
- }
- }
- }
- if (allDollars) {
- dollarInstances.forEach((instance) => {
- const [ i, lineTrim, column, length ] = instance;
- addErrorContext(
- onError,
- i + 1,
- lineTrim,
- null,
- null,
- [ column, length ],
- {
- "editColumn": column,
- "deleteCount": length
- }
- );
- });
- }
- });
- });
- }
-};
-
-
-/***/ }),
-/* 125 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// @ts-check
-
-
-
-const { addErrorContext, forEachLine } = __webpack_require__(110);
-const { lineMetadata } = __webpack_require__(115);
-
-module.exports = {
- "names": [ "MD018", "no-missing-space-atx" ],
- "description": "No space after hash on atx style heading",
- "tags": [ "headings", "headers", "atx", "spaces" ],
- "function": function MD018(params, onError) {
- forEachLine(lineMetadata(), (line, lineIndex, inCode) => {
- if (!inCode &&
- /^#+[^#\s]/.test(line) &&
- !/#\s*$/.test(line) &&
- !line.startsWith("#️⃣")) {
- const hashCount = /^#+/.exec(line)[0].length;
- addErrorContext(
- onError,
- lineIndex + 1,
- line.trim(),
- null,
- null,
- [ 1, hashCount + 1 ],
- {
- "editColumn": hashCount + 1,
- "insertText": " "
- }
- );
- }
- });
- }
-};
-
-
-/***/ }),
-/* 126 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// @ts-check
-
-
-
-const { addErrorContext, filterTokens, headingStyleFor } =
- __webpack_require__(110);
-
-module.exports = {
- "names": [ "MD019", "no-multiple-space-atx" ],
- "description": "Multiple spaces after hash on atx style heading",
- "tags": [ "headings", "headers", "atx", "spaces" ],
- "function": function MD019(params, onError) {
- filterTokens(params, "heading_open", (token) => {
- if (headingStyleFor(token) === "atx") {
- const { line, lineNumber } = token;
- const match = /^(#+)(\s{2,})(?:\S)/.exec(line);
- if (match) {
- const [
- ,
- { "length": hashLength },
- { "length": spacesLength }
- ] = match;
- addErrorContext(
- onError,
- lineNumber,
- line.trim(),
- null,
- null,
- [ 1, hashLength + spacesLength + 1 ],
- {
- "editColumn": hashLength + 1,
- "deleteCount": spacesLength - 1
- }
- );
- }
- }
- });
- }
-};
-
-
-/***/ }),
-/* 127 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// @ts-check
-
-
-
-const { addErrorContext, forEachLine } = __webpack_require__(110);
-const { lineMetadata } = __webpack_require__(115);
-
-module.exports = {
- "names": [ "MD020", "no-missing-space-closed-atx" ],
- "description": "No space inside hashes on closed atx style heading",
- "tags": [ "headings", "headers", "atx_closed", "spaces" ],
- "function": function MD020(params, onError) {
- forEachLine(lineMetadata(), (line, lineIndex, inCode) => {
- if (!inCode) {
- const match =
- /^(#+)(\s*)([^#]*?[^#\\])(\s*)((?:\\#)?)(#+)(\s*)$/.exec(line);
- if (match) {
- const [
- ,
- leftHash,
- { "length": leftSpaceLength },
- content,
- { "length": rightSpaceLength },
- rightEscape,
- rightHash,
- { "length": trailSpaceLength }
- ] = match;
- const leftHashLength = leftHash.length;
- const rightHashLength = rightHash.length;
- const left = !leftSpaceLength;
- const right = !rightSpaceLength || rightEscape;
- const rightEscapeReplacement = rightEscape ? `${rightEscape} ` : "";
- if (left || right) {
- const range = left ?
- [
- 1,
- leftHashLength + 1
- ] :
- [
- line.length - trailSpaceLength - rightHashLength,
- rightHashLength + 1
- ];
- addErrorContext(
- onError,
- lineIndex + 1,
- line.trim(),
- left,
- right,
- range,
- {
- "editColumn": 1,
- "deleteCount": line.length,
- "insertText":
- `${leftHash} ${content} ${rightEscapeReplacement}${rightHash}`
- }
- );
- }
- }
- }
- });
- }
-};
-
-
-/***/ }),
-/* 128 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// @ts-check
-
-
-
-const { addErrorContext, filterTokens, headingStyleFor } =
- __webpack_require__(110);
-
-module.exports = {
- "names": [ "MD021", "no-multiple-space-closed-atx" ],
- "description": "Multiple spaces inside hashes on closed atx style heading",
- "tags": [ "headings", "headers", "atx_closed", "spaces" ],
- "function": function MD021(params, onError) {
- filterTokens(params, "heading_open", (token) => {
- if (headingStyleFor(token) === "atx_closed") {
- const { line, lineNumber } = token;
- const match = /^(#+)(\s+)([^#]+?)(\s+)(#+)(\s*)$/.exec(line);
- if (match) {
- const [
- ,
- leftHash,
- { "length": leftSpaceLength },
- content,
- { "length": rightSpaceLength },
- rightHash,
- { "length": trailSpaceLength }
- ] = match;
- const left = leftSpaceLength > 1;
- const right = rightSpaceLength > 1;
- if (left || right) {
- const length = line.length;
- const leftHashLength = leftHash.length;
- const rightHashLength = rightHash.length;
- const range = left ?
- [
- 1,
- leftHashLength + leftSpaceLength + 1
- ] :
- [
- length - trailSpaceLength - rightHashLength - rightSpaceLength,
- rightSpaceLength + rightHashLength + 1
- ];
- addErrorContext(
- onError,
- lineNumber,
- line.trim(),
- left,
- right,
- range,
- {
- "editColumn": 1,
- "deleteCount": length,
- "insertText": `${leftHash} ${content} ${rightHash}`
- }
- );
- }
- }
- }
- });
- }
-};
-
-
-/***/ }),
-/* 129 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// @ts-check
-
-
-
-const { addErrorDetailIf, filterTokens, isBlankLine } = __webpack_require__(110);
-
-module.exports = {
- "names": [ "MD022", "blanks-around-headings", "blanks-around-headers" ],
- "description": "Headings should be surrounded by blank lines",
- "tags": [ "headings", "headers", "blank_lines" ],
- "function": function MD022(params, onError) {
- let linesAbove = params.config.lines_above;
- linesAbove = Number((linesAbove === undefined) ? 1 : linesAbove);
- let linesBelow = params.config.lines_below;
- linesBelow = Number((linesBelow === undefined) ? 1 : linesBelow);
- const { lines } = params;
- filterTokens(params, "heading_open", (token) => {
- const [ topIndex, nextIndex ] = token.map;
- let actualAbove = 0;
- for (let i = 0; i < linesAbove; i++) {
- if (isBlankLine(lines[topIndex - i - 1])) {
- actualAbove++;
- }
- }
- addErrorDetailIf(
- onError,
- topIndex + 1,
- linesAbove,
- actualAbove,
- "Above",
- lines[topIndex].trim(),
- null,
- {
- "insertText": "".padEnd(linesAbove - actualAbove, "\n")
- });
- let actualBelow = 0;
- for (let i = 0; i < linesBelow; i++) {
- if (isBlankLine(lines[nextIndex + i])) {
- actualBelow++;
- }
- }
- addErrorDetailIf(
- onError,
- topIndex + 1,
- linesBelow,
- actualBelow,
- "Below",
- lines[topIndex].trim(),
- null,
- {
- "lineNumber": nextIndex + 1,
- "insertText": "".padEnd(linesBelow - actualBelow, "\n")
- });
- });
- }
-};
-
-
-/***/ }),
-/* 130 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// @ts-check
-
-
-
-const { addErrorContext, filterTokens } = __webpack_require__(110);
-
-const spaceBeforeHeadingRe = /^((?:\s+)|(?:[>\s]+\s\s))[^>\s]/;
-
-module.exports = {
- "names": [ "MD023", "heading-start-left", "header-start-left" ],
- "description": "Headings must start at the beginning of the line",
- "tags": [ "headings", "headers", "spaces" ],
- "function": function MD023(params, onError) {
- filterTokens(params, "heading_open", function forToken(token) {
- const { lineNumber, line } = token;
- const match = line.match(spaceBeforeHeadingRe);
- if (match) {
- const [ prefixAndFirstChar, prefix ] = match;
- let deleteCount = prefix.length;
- const prefixLengthNoSpace = prefix.trimRight().length;
- if (prefixLengthNoSpace) {
- deleteCount -= prefixLengthNoSpace - 1;
- }
- addErrorContext(
- onError,
- lineNumber,
- line,
- null,
- null,
- [ 1, prefixAndFirstChar.length ],
- {
- "editColumn": prefixLengthNoSpace + 1,
- "deleteCount": deleteCount
- });
- }
- });
- }
-};
-
-
-/***/ }),
-/* 131 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// @ts-check
-
-
-
-const { addErrorContext, forEachHeading } = __webpack_require__(110);
-
-module.exports = {
- "names": [ "MD024", "no-duplicate-heading", "no-duplicate-header" ],
- "description": "Multiple headings with the same content",
- "tags": [ "headings", "headers" ],
- "function": function MD024(params, onError) {
- const siblingsOnly = !!params.config.siblings_only ||
- !!params.config.allow_different_nesting || false;
- const knownContents = [ null, [] ];
- let lastLevel = 1;
- let knownContent = knownContents[lastLevel];
- forEachHeading(params, (heading, content) => {
- if (siblingsOnly) {
- const newLevel = heading.tag.slice(1);
- while (lastLevel < newLevel) {
- lastLevel++;
- knownContents[lastLevel] = [];
- }
- while (lastLevel > newLevel) {
- knownContents[lastLevel] = [];
- lastLevel--;
- }
- knownContent = knownContents[newLevel];
- }
- if (knownContent.includes(content)) {
- addErrorContext(onError, heading.lineNumber,
- heading.line.trim());
- } else {
- knownContent.push(content);
- }
- });
- }
-};
-
-
-/***/ }),
-/* 132 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// @ts-check
-
-
-
-const { addErrorContext, filterTokens, frontMatterHasTitle } =
- __webpack_require__(110);
-
-module.exports = {
- "names": [ "MD025", "single-title", "single-h1" ],
- "description": "Multiple top level headings in the same document",
- "tags": [ "headings", "headers" ],
- "function": function MD025(params, onError) {
- const level = Number(params.config.level || 1);
- const tag = "h" + level;
- const foundFrontMatterTitle =
- frontMatterHasTitle(
- params.frontMatterLines,
- params.config.front_matter_title
- );
- let hasTopLevelHeading = false;
- filterTokens(params, "heading_open", function forToken(token) {
- if (token.tag === tag) {
- if (hasTopLevelHeading || foundFrontMatterTitle) {
- addErrorContext(onError, token.lineNumber,
- token.line.trim());
- } else if (token.lineNumber === 1) {
- hasTopLevelHeading = true;
- }
- }
- });
- }
-};
-
-
-/***/ }),
-/* 133 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// @ts-check
-
-
-
-const { addError, allPunctuation, escapeForRegExp, forEachHeading } =
- __webpack_require__(110);
-
-module.exports = {
- "names": [ "MD026", "no-trailing-punctuation" ],
- "description": "Trailing punctuation in heading",
- "tags": [ "headings", "headers" ],
- "function": function MD026(params, onError) {
- let punctuation = params.config.punctuation;
- punctuation =
- String((punctuation === undefined) ? allPunctuation : punctuation);
- const trailingPunctuationRe =
- new RegExp("\\s*[" + escapeForRegExp(punctuation) + "]+$");
- forEachHeading(params, (heading) => {
- const { line, lineNumber } = heading;
- const trimmedLine = line.replace(/[\s#]*$/, "");
- const match = trailingPunctuationRe.exec(trimmedLine);
- if (match) {
- const fullMatch = match[0];
- const column = match.index + 1;
- const length = fullMatch.length;
- addError(
- onError,
- lineNumber,
- `Punctuation: '${fullMatch}'`,
- null,
- [ column, length ],
- {
- "editColumn": column,
- "deleteCount": length
- }
- );
- }
- });
- }
-};
-
-
-/***/ }),
-/* 134 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// @ts-check
-
-
-
-const { addErrorContext, newLineRe } = __webpack_require__(110);
-
-const spaceAfterBlockQuoteRe = /^((?:\s*>)+)(\s{2,})\S/;
-
-module.exports = {
- "names": [ "MD027", "no-multiple-space-blockquote" ],
- "description": "Multiple spaces after blockquote symbol",
- "tags": [ "blockquote", "whitespace", "indentation" ],
- "function": function MD027(params, onError) {
- let blockquoteNesting = 0;
- let listItemNesting = 0;
- params.tokens.forEach((token) => {
- const { content, lineNumber, type } = token;
- if (type === "blockquote_open") {
- blockquoteNesting++;
- } else if (type === "blockquote_close") {
- blockquoteNesting--;
- } else if (type === "list_item_open") {
- listItemNesting++;
- } else if (type === "list_item_close") {
- listItemNesting--;
- } else if ((type === "inline") && blockquoteNesting) {
- const lineCount = content.split(newLineRe).length;
- for (let i = 0; i < lineCount; i++) {
- const line = params.lines[lineNumber + i - 1];
- const match = line.match(spaceAfterBlockQuoteRe);
- if (match) {
- const [
- fullMatch,
- { "length": blockquoteLength },
- { "length": spaceLength }
- ] = match;
- if (!listItemNesting || (fullMatch[fullMatch.length - 1] === ">")) {
- addErrorContext(
- onError,
- lineNumber + i,
- line,
- null,
- null,
- [ 1, fullMatch.length ],
- {
- "editColumn": blockquoteLength + 1,
- "deleteCount": spaceLength - 1
- }
- );
- }
- }
- }
- }
- });
- }
-};
-
-
-/***/ }),
-/* 135 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// @ts-check
-
-
-
-const { addError } = __webpack_require__(110);
-
-module.exports = {
- "names": [ "MD028", "no-blanks-blockquote" ],
- "description": "Blank line inside blockquote",
- "tags": [ "blockquote", "whitespace" ],
- "function": function MD028(params, onError) {
- let prevToken = {};
- let prevLineNumber = null;
- params.tokens.forEach(function forToken(token) {
- if ((token.type === "blockquote_open") &&
- (prevToken.type === "blockquote_close")) {
- for (
- let lineNumber = prevLineNumber;
- lineNumber < token.lineNumber;
- lineNumber++) {
- addError(
- onError,
- lineNumber,
- null,
- null,
- null,
- {
- "deleteCount": -1
- });
- }
- }
- prevToken = token;
- if (token.type === "blockquote_open") {
- prevLineNumber = token.map[1] + 1;
- }
- });
- }
-};
-
-
-/***/ }),
-/* 136 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// @ts-check
-
-
-
-const { addErrorDetailIf, listItemMarkerRe, orderedListItemMarkerRe,
- rangeFromRegExp } = __webpack_require__(110);
-const { flattenedLists } = __webpack_require__(115);
-
-const listStyleExamples = {
- "one": "1/1/1",
- "ordered": "1/2/3",
- "zero": "0/0/0"
-};
-
-module.exports = {
- "names": [ "MD029", "ol-prefix" ],
- "description": "Ordered list item prefix",
- "tags": [ "ol" ],
- "function": function MD029(params, onError) {
- const style = String(params.config.style || "one_or_ordered");
- flattenedLists().filter((list) => !list.unordered).forEach((list) => {
- const { items } = list;
- let current = 1;
- let incrementing = false;
- // Check for incrementing number pattern 1/2/3 or 0/1/2
- if (items.length >= 2) {
- const first = orderedListItemMarkerRe.exec(items[0].line);
- const second = orderedListItemMarkerRe.exec(items[1].line);
- if (first && second) {
- const [ , firstNumber ] = first;
- const [ , secondNumber ] = second;
- if ((secondNumber !== "1") || (firstNumber === "0")) {
- incrementing = true;
- if (firstNumber === "0") {
- current = 0;
- }
- }
- }
- }
- // Determine effective style
- let listStyle = style;
- if (listStyle === "one_or_ordered") {
- listStyle = incrementing ? "ordered" : "one";
- }
- // Force expected value for 0/0/0 and 1/1/1 patterns
- if (listStyle === "zero") {
- current = 0;
- } else if (listStyle === "one") {
- current = 1;
- }
- // Validate each list item marker
- items.forEach((item) => {
- const match = orderedListItemMarkerRe.exec(item.line);
- if (match) {
- addErrorDetailIf(onError, item.lineNumber,
- String(current), match[1],
- "Style: " + listStyleExamples[listStyle], null,
- rangeFromRegExp(item.line, listItemMarkerRe));
- if (listStyle === "ordered") {
- current++;
- }
- }
- });
- });
- }
-};
-
-
-/***/ }),
-/* 137 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// @ts-check
-
-
-
-const { addErrorDetailIf } = __webpack_require__(110);
-const { flattenedLists } = __webpack_require__(115);
-
-module.exports = {
- "names": [ "MD030", "list-marker-space" ],
- "description": "Spaces after list markers",
- "tags": [ "ol", "ul", "whitespace" ],
- "function": function MD030(params, onError) {
- const ulSingle = Number(params.config.ul_single || 1);
- const olSingle = Number(params.config.ol_single || 1);
- const ulMulti = Number(params.config.ul_multi || 1);
- const olMulti = Number(params.config.ol_multi || 1);
- flattenedLists().forEach((list) => {
- const lineCount = list.lastLineIndex - list.open.map[0];
- const allSingle = lineCount === list.items.length;
- const expectedSpaces = list.unordered ?
- (allSingle ? ulSingle : ulMulti) :
- (allSingle ? olSingle : olMulti);
- list.items.forEach((item) => {
- const { line, lineNumber } = item;
- const match = /^[\s>]*\S+(\s*)/.exec(line);
- const [ { "length": matchLength }, { "length": actualSpaces } ] = match;
- if (matchLength < line.length) {
- let fixInfo = null;
- if (expectedSpaces !== actualSpaces) {
- fixInfo = {
- "editColumn": matchLength - actualSpaces + 1,
- "deleteCount": actualSpaces,
- "insertText": "".padEnd(expectedSpaces)
- };
- }
- addErrorDetailIf(
- onError,
- lineNumber,
- expectedSpaces,
- actualSpaces,
- null,
- null,
- [ 1, matchLength ],
- fixInfo
- );
- }
- });
- });
- }
-};
-
-
-/***/ }),
-/* 138 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// @ts-check
-
-
-
-const { addErrorContext, forEachLine, isBlankLine } = __webpack_require__(110);
-const { lineMetadata } = __webpack_require__(115);
-
-const codeFencePrefixRe = /^(.*?)\s*[`~]/;
-
-module.exports = {
- "names": [ "MD031", "blanks-around-fences" ],
- "description": "Fenced code blocks should be surrounded by blank lines",
- "tags": [ "code", "blank_lines" ],
- "function": function MD031(params, onError) {
- const listItems = params.config.list_items;
- const includeListItems = (listItems === undefined) ? true : !!listItems;
- const { lines } = params;
- forEachLine(lineMetadata(), (line, i, inCode, onFence, inTable, inItem) => {
- const onTopFence = (onFence > 0);
- const onBottomFence = (onFence < 0);
- if ((includeListItems || !inItem) &&
- ((onTopFence && !isBlankLine(lines[i - 1])) ||
- (onBottomFence && !isBlankLine(lines[i + 1])))) {
- const [ , prefix ] = line.match(codeFencePrefixRe);
- addErrorContext(
- onError,
- i + 1,
- lines[i].trim(),
- null,
- null,
- null,
- {
- "lineNumber": i + (onTopFence ? 1 : 2),
- "insertText": `${prefix}\n`
- });
- }
- });
- }
-};
-
-
-/***/ }),
-/* 139 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// @ts-check
-
-
-
-const { addErrorContext, isBlankLine } = __webpack_require__(110);
-const { flattenedLists } = __webpack_require__(115);
-
-const quotePrefixRe = /^[>\s]*/;
-
-module.exports = {
- "names": [ "MD032", "blanks-around-lists" ],
- "description": "Lists should be surrounded by blank lines",
- "tags": [ "bullet", "ul", "ol", "blank_lines" ],
- "function": function MD032(params, onError) {
- const { lines } = params;
- flattenedLists().filter((list) => !list.nesting).forEach((list) => {
- const firstIndex = list.open.map[0];
- if (!isBlankLine(lines[firstIndex - 1])) {
- const line = lines[firstIndex];
- const quotePrefix = line.match(quotePrefixRe)[0].trimRight();
- addErrorContext(
- onError,
- firstIndex + 1,
- line.trim(),
- null,
- null,
- null,
- {
- "insertText": `${quotePrefix}\n`
- });
- }
- const lastIndex = list.lastLineIndex - 1;
- if (!isBlankLine(lines[lastIndex + 1])) {
- const line = lines[lastIndex];
- const quotePrefix = line.match(quotePrefixRe)[0].trimRight();
- addErrorContext(
- onError,
- lastIndex + 1,
- line.trim(),
- null,
- null,
- null,
- {
- "lineNumber": lastIndex + 2,
- "insertText": `${quotePrefix}\n`
- });
- }
- });
- }
-};
-
-
-/***/ }),
-/* 140 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// @ts-check
-
-
-
-const { addError, forEachLine, unescapeMarkdown } = __webpack_require__(110);
-const { lineMetadata } = __webpack_require__(115);
-
-const htmlElementRe = /<(([A-Za-z][A-Za-z0-9-]*)(?:\s[^>]*)?)\/?>/g;
-const linkDestinationRe = /]\(\s*$/;
-const inlineCodeRe = /^[^`]*(`+[^`]+`+[^`]+)*`+[^`]*$/;
-// See https://spec.commonmark.org/0.29/#autolinks
-const emailAddressRe =
- // eslint-disable-next-line max-len
- /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;
-
-module.exports = {
- "names": [ "MD033", "no-inline-html" ],
- "description": "Inline HTML",
- "tags": [ "html" ],
- "function": function MD033(params, onError) {
- let allowedElements = params.config.allowed_elements;
- allowedElements = Array.isArray(allowedElements) ? allowedElements : [];
- allowedElements = allowedElements.map((element) => element.toLowerCase());
- forEachLine(lineMetadata(), (line, lineIndex, inCode) => {
- let match = null;
- // eslint-disable-next-line no-unmodified-loop-condition
- while (!inCode && ((match = htmlElementRe.exec(line)) !== null)) {
- const [ tag, content, element ] = match;
- if (!allowedElements.includes(element.toLowerCase()) &&
- !tag.endsWith("\\>") &&
- !emailAddressRe.test(content)) {
- const prefix = line.substring(0, match.index);
- if (!linkDestinationRe.test(prefix) && !inlineCodeRe.test(prefix)) {
- const unescaped = unescapeMarkdown(prefix + "<", "_");
- if (!unescaped.endsWith("_") &&
- ((unescaped + "`").match(/`/g).length % 2)) {
- addError(onError, lineIndex + 1, "Element: " + element,
- null, [ match.index + 1, tag.length ]);
- }
- }
- }
- }
- });
- }
-};
-
-
-/***/ }),
-/* 141 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// @ts-check
-
-
-
-const { addErrorContext, bareUrlRe, filterTokens } = __webpack_require__(110);
-
-module.exports = {
- "names": [ "MD034", "no-bare-urls" ],
- "description": "Bare URL used",
- "tags": [ "links", "url" ],
- "function": function MD034(params, onError) {
- filterTokens(params, "inline", (token) => {
- let inLink = false;
- token.children.forEach((child) => {
- const { content, line, lineNumber, type } = child;
- let match = null;
- if (type === "link_open") {
- inLink = true;
- } else if (type === "link_close") {
- inLink = false;
- } else if ((type === "text") && !inLink) {
- while ((match = bareUrlRe.exec(content)) !== null) {
- const [ bareUrl ] = match;
- const matchIndex = match.index;
- const bareUrlLength = bareUrl.length;
- // Allow "[https://example.com]" to avoid conflicts with
- // MD011/no-reversed-links; allow quoting as another way
- // of deliberately including a bare URL
- const leftChar = content[matchIndex - 1];
- const rightChar = content[matchIndex + bareUrlLength];
- if (
- !((leftChar === "[") && (rightChar === "]")) &&
- !((leftChar === "\"") && (rightChar === "\"")) &&
- !((leftChar === "'") && (rightChar === "'"))
- ) {
- const index = line.indexOf(content);
- const range = (index === -1) ? null : [
- index + matchIndex + 1,
- bareUrlLength
- ];
- const fixInfo = range ? {
- "editColumn": range[0],
- "deleteCount": range[1],
- "insertText": `<${bareUrl}>`
- } : null;
- addErrorContext(
- onError,
- lineNumber,
- bareUrl,
- null,
- null,
- range,
- fixInfo
- );
- }
- }
- }
- });
- });
- }
-};
-
-
-/***/ }),
-/* 142 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// @ts-check
-
-
-
-const { addErrorDetailIf, filterTokens } = __webpack_require__(110);
-
-module.exports = {
- "names": [ "MD035", "hr-style" ],
- "description": "Horizontal rule style",
- "tags": [ "hr" ],
- "function": function MD035(params, onError) {
- let style = String(params.config.style || "consistent");
- filterTokens(params, "hr", function forToken(token) {
- const lineTrim = token.line.trim();
- if (style === "consistent") {
- style = lineTrim;
- }
- addErrorDetailIf(onError, token.lineNumber, style, lineTrim);
- });
- }
-};
-
-
-/***/ }),
-/* 143 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// @ts-check
-
-
-
-const { addErrorContext, allPunctuation } = __webpack_require__(110);
-
-module.exports = {
- "names": [ "MD036", "no-emphasis-as-heading", "no-emphasis-as-header" ],
- "description": "Emphasis used instead of a heading",
- "tags": [ "headings", "headers", "emphasis" ],
- "function": function MD036(params, onError) {
- let punctuation = params.config.punctuation;
- punctuation =
- String((punctuation === undefined) ? allPunctuation : punctuation);
- const re = new RegExp("[" + punctuation + "]$");
- // eslint-disable-next-line jsdoc/require-jsdoc
- function base(token) {
- if (token.type === "paragraph_open") {
- return function inParagraph(t) {
- // Always paragraph_open/inline/paragraph_close,
- const children = t.children.filter(function notEmptyText(child) {
- return (child.type !== "text") || (child.content !== "");
- });
- if ((children.length === 3) &&
- ((children[0].type === "strong_open") ||
- (children[0].type === "em_open")) &&
- (children[1].type === "text") &&
- !re.test(children[1].content)) {
- addErrorContext(onError, t.lineNumber,
- children[1].content);
- }
- return base;
- };
- } else if (token.type === "blockquote_open") {
- return function inBlockquote(t) {
- if (t.type !== "blockquote_close") {
- return inBlockquote;
- }
- return base;
- };
- } else if (token.type === "list_item_open") {
- return function inListItem(t) {
- if (t.type !== "list_item_close") {
- return inListItem;
- }
- return base;
- };
- }
- return base;
- }
- let state = base;
- params.tokens.forEach(function forToken(token) {
- state = state(token);
- });
- }
-};
-
-
-/***/ }),
-/* 144 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// @ts-check
-
-
-
-const { addErrorContext, emphasisMarkersInContent, forEachLine, isBlankLine } =
- __webpack_require__(110);
-const { lineMetadata } = __webpack_require__(115);
-
-const emphasisRe = /(^|[^\\]|\\\\)(?:(\*\*?\*?)|(__?_?))/g;
-const asteriskListItemMarkerRe = /^([\s>]*)\*(\s+)/;
-const leftSpaceRe = /^\s+/;
-const rightSpaceRe = /\s+$/;
-
-module.exports = {
- "names": [ "MD037", "no-space-in-emphasis" ],
- "description": "Spaces inside emphasis markers",
- "tags": [ "whitespace", "emphasis" ],
- "function": function MD037(params, onError) {
- // eslint-disable-next-line init-declarations
- let effectiveEmphasisLength, emphasisIndex, emphasisKind, emphasisLength,
- pendingError = null;
- // eslint-disable-next-line jsdoc/require-jsdoc
- function resetRunTracking() {
- emphasisIndex = -1;
- emphasisLength = 0;
- emphasisKind = "";
- effectiveEmphasisLength = 0;
- pendingError = null;
- }
- // eslint-disable-next-line jsdoc/require-jsdoc
- function handleRunEnd(line, lineIndex, contextLength, match, matchIndex) {
- // Close current run
- let content = line.substring(emphasisIndex, matchIndex);
- if (!emphasisLength) {
- content = content.trimStart();
- }
- if (!match) {
- content = content.trimEnd();
- }
- const leftSpace = leftSpaceRe.test(content);
- const rightSpace = rightSpaceRe.test(content);
- if (leftSpace || rightSpace) {
- // Report the violation
- const contextStart = emphasisIndex - emphasisLength;
- const contextEnd = matchIndex + contextLength;
- const context = line.substring(contextStart, contextEnd);
- const column = contextStart + 1;
- const length = contextEnd - contextStart;
- const leftMarker = line.substring(contextStart, emphasisIndex);
- const rightMarker = match ? (match[2] || match[3]) : "";
- const fixedText = `${leftMarker}${content.trim()}${rightMarker}`;
- return [
- onError,
- lineIndex + 1,
- context,
- leftSpace,
- rightSpace,
- [ column, length ],
- {
- "editColumn": column,
- "deleteCount": length,
- "insertText": fixedText
- }
- ];
- }
- return null;
- }
- // Initialize
- const ignoreMarkersByLine = emphasisMarkersInContent(params);
- resetRunTracking();
- forEachLine(
- lineMetadata(),
- (line, lineIndex, inCode, onFence, inTable, inItem, onBreak) => {
- const onItemStart = (inItem === 1);
- if (inCode || inTable || onBreak || onItemStart || isBlankLine(line)) {
- // Emphasis resets when leaving a block
- resetRunTracking();
- }
- if (inCode || onBreak) {
- // Emphasis has no meaning here
- return;
- }
- if (onItemStart) {
- // Trim overlapping '*' list item marker
- line = line.replace(asteriskListItemMarkerRe, "$1 $2");
- }
- let match = null;
- // Match all emphasis-looking runs in the line...
- while ((match = emphasisRe.exec(line))) {
- const ignoreMarkersForLine = ignoreMarkersByLine[lineIndex] || [];
- const matchIndex = match.index + match[1].length;
- if (ignoreMarkersForLine.includes(matchIndex)) {
- // Ignore emphasis markers inside code spans and links
- continue;
- }
- const matchLength = match[0].length - match[1].length;
- const matchKind = (match[2] || match[3])[0];
- if (emphasisIndex === -1) {
- // New run
- emphasisIndex = matchIndex + matchLength;
- emphasisLength = matchLength;
- emphasisKind = matchKind;
- effectiveEmphasisLength = matchLength;
- } else if (matchKind === emphasisKind) {
- // Matching emphasis markers
- if (matchLength === effectiveEmphasisLength) {
- // Ending an existing run, report any pending error
- if (pendingError) {
- addErrorContext(...pendingError);
- pendingError = null;
- }
- const error = handleRunEnd(
- line, lineIndex, effectiveEmphasisLength, match, matchIndex);
- if (error) {
- addErrorContext(...error);
- }
- // Reset
- resetRunTracking();
- } else if (matchLength === 3) {
- // Swap internal run length (1->2 or 2->1)
- effectiveEmphasisLength = matchLength - effectiveEmphasisLength;
- } else if (effectiveEmphasisLength === 3) {
- // Downgrade internal run (3->1 or 3->2)
- effectiveEmphasisLength -= matchLength;
- } else {
- // Upgrade to internal run (1->3 or 2->3)
- effectiveEmphasisLength += matchLength;
- }
- // Back up one character so RegExp has a chance to match the
- // next marker (ex: "**star**_underscore_")
- if (emphasisRe.lastIndex > 1) {
- emphasisRe.lastIndex--;
- }
- } else if (emphasisRe.lastIndex > 1) {
- // Back up one character so RegExp has a chance to match the
- // mis-matched marker (ex: "*text_*")
- emphasisRe.lastIndex--;
- }
- }
- if (emphasisIndex !== -1) {
- pendingError = pendingError ||
- handleRunEnd(line, lineIndex, 0, null, line.length);
- // Adjust for pending run on new line
- emphasisIndex = 0;
- emphasisLength = 0;
- }
- }
- );
- }
-};
-
-
-/***/ }),
-/* 145 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// @ts-check
-
-
-
-const { addErrorContext, filterTokens, forEachInlineCodeSpan, newLineRe } =
- __webpack_require__(110);
-
-const leftSpaceRe = /^\s([^`]|$)/;
-const rightSpaceRe = /[^`]\s$/;
-const singleLeftRightSpaceRe = /^\s(?:\S.*\S|\S)\s$/;
-
-module.exports = {
- "names": [ "MD038", "no-space-in-code" ],
- "description": "Spaces inside code span elements",
- "tags": [ "whitespace", "code" ],
- "function": function MD038(params, onError) {
- filterTokens(params, "inline", (token) => {
- if (token.children.some((child) => child.type === "code_inline")) {
- const tokenLines = params.lines.slice(token.map[0], token.map[1]);
- forEachInlineCodeSpan(
- tokenLines.join("\n"),
- (code, lineIndex, columnIndex, tickCount) => {
- let rangeIndex = columnIndex - tickCount;
- let rangeLength = code.length + (2 * tickCount);
- let rangeLineOffset = 0;
- let fixIndex = columnIndex;
- let fixLength = code.length;
- const codeLines = code.split(newLineRe);
- const left = leftSpaceRe.test(code);
- const right = !left && rightSpaceRe.test(code);
- if (right && (codeLines.length > 1)) {
- rangeIndex = 0;
- rangeLineOffset = codeLines.length - 1;
- fixIndex = 0;
- }
- const allowed = singleLeftRightSpaceRe.test(code);
- if ((left || right) && !allowed) {
- const codeLinesRange = codeLines[rangeLineOffset];
- if (codeLines.length > 1) {
- rangeLength = codeLinesRange.length + tickCount;
- fixLength = codeLinesRange.length;
- }
- const context = tokenLines[lineIndex + rangeLineOffset]
- .substring(rangeIndex, rangeIndex + rangeLength);
- const codeLinesRangeTrim = codeLinesRange.trim();
- const fixText =
- (codeLinesRangeTrim.startsWith("`") ? " " : "") +
- codeLinesRangeTrim +
- (codeLinesRangeTrim.endsWith("`") ? " " : "");
- addErrorContext(
- onError,
- token.lineNumber + lineIndex + rangeLineOffset,
- context,
- left,
- right,
- [ rangeIndex + 1, rangeLength ],
- {
- "editColumn": fixIndex + 1,
- "deleteCount": fixLength,
- "insertText": fixText
- }
- );
- }
- });
- }
- });
- }
-};
-
-
-/***/ }),
-/* 146 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// @ts-check
-
-
-
-const { addErrorContext, filterTokens } = __webpack_require__(110);
-
-const spaceInLinkRe = /\[(?:\s+(?:[^\]]*?)\s*|(?:[^\]]*?)\s+)](?=\(\S*\))/;
-
-module.exports = {
- "names": [ "MD039", "no-space-in-links" ],
- "description": "Spaces inside link text",
- "tags": [ "whitespace", "links" ],
- "function": function MD039(params, onError) {
- filterTokens(params, "inline", (token) => {
- const { children } = token;
- let { lineNumber } = token;
- let inLink = false;
- let linkText = "";
- let lineIndex = 0;
- children.forEach((child) => {
- const { content, type } = child;
- if (type === "link_open") {
- inLink = true;
- linkText = "";
- } else if (type === "link_close") {
- inLink = false;
- const left = linkText.trimLeft().length !== linkText.length;
- const right = linkText.trimRight().length !== linkText.length;
- if (left || right) {
- const line = params.lines[lineNumber - 1];
- let range = null;
- let fixInfo = null;
- const match = line.slice(lineIndex).match(spaceInLinkRe);
- if (match) {
- const column = match.index + lineIndex + 1;
- const length = match[0].length;
- range = [ column, length ];
- fixInfo = {
- "editColumn": column + 1,
- "deleteCount": length - 2,
- "insertText": linkText.trim()
- };
- lineIndex = column + length - 1;
- }
- addErrorContext(
- onError,
- lineNumber,
- `[${linkText}]`,
- left,
- right,
- range,
- fixInfo
- );
- }
- } else if ((type === "softbreak") || (type === "hardbreak")) {
- lineNumber++;
- lineIndex = 0;
- } else if (inLink) {
- linkText += content;
- }
- });
- });
- }
-};
-
-
-/***/ }),
-/* 147 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// @ts-check
-
-
-
-const { addErrorContext, filterTokens } = __webpack_require__(110);
-
-module.exports = {
- "names": [ "MD040", "fenced-code-language" ],
- "description": "Fenced code blocks should have a language specified",
- "tags": [ "code", "language" ],
- "function": function MD040(params, onError) {
- filterTokens(params, "fence", function forToken(token) {
- if (!token.info.trim()) {
- addErrorContext(onError, token.lineNumber, token.line);
- }
- });
- }
-};
-
-
-/***/ }),
-/* 148 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// @ts-check
-
-
-
-const { addErrorContext, frontMatterHasTitle } = __webpack_require__(110);
-
-module.exports = {
- "names": [ "MD041", "first-line-heading", "first-line-h1" ],
- "description": "First line in file should be a top level heading",
- "tags": [ "headings", "headers" ],
- "function": function MD041(params, onError) {
- const level = Number(params.config.level || 1);
- const tag = "h" + level;
- const foundFrontMatterTitle =
- frontMatterHasTitle(
- params.frontMatterLines,
- params.config.front_matter_title
- );
- if (!foundFrontMatterTitle) {
- params.tokens.every((token) => {
- if (token.type === "html_block") {
- return true;
- }
- if ((token.type !== "heading_open") || (token.tag !== tag)) {
- addErrorContext(onError, token.lineNumber, token.line);
- }
- return false;
- });
- }
- }
-};
-
-
-/***/ }),
-/* 149 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// @ts-check
-
-
-
-const { addErrorContext, filterTokens, rangeFromRegExp } =
- __webpack_require__(110);
-
-const emptyLinkRe = /\[[^\]]*](?:\((?:#?|(?:<>))\))/;
-
-module.exports = {
- "names": [ "MD042", "no-empty-links" ],
- "description": "No empty links",
- "tags": [ "links" ],
- "function": function MD042(params, onError) {
- filterTokens(params, "inline", function forToken(token) {
- let inLink = false;
- let linkText = "";
- let emptyLink = false;
- token.children.forEach(function forChild(child) {
- if (child.type === "link_open") {
- inLink = true;
- linkText = "";
- child.attrs.forEach(function forAttr(attr) {
- if (attr[0] === "href" && (!attr[1] || (attr[1] === "#"))) {
- emptyLink = true;
- }
- });
- } else if (child.type === "link_close") {
- inLink = false;
- if (emptyLink) {
- addErrorContext(onError, child.lineNumber,
- "[" + linkText + "]()", null, null,
- rangeFromRegExp(child.line, emptyLinkRe));
- }
- } else if (inLink) {
- linkText += child.content;
- }
- });
- });
- }
-};
-
-
-/***/ }),
-/* 150 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// @ts-check
-
-
-
-const { addErrorContext, addErrorDetailIf, forEachHeading } =
- __webpack_require__(110);
-
-module.exports = {
- "names": [ "MD043", "required-headings", "required-headers" ],
- "description": "Required heading structure",
- "tags": [ "headings", "headers" ],
- "function": function MD043(params, onError) {
- const requiredHeadings = params.config.headings || params.config.headers;
- if (Array.isArray(requiredHeadings)) {
- const levels = {};
- [ 1, 2, 3, 4, 5, 6 ].forEach(function forLevel(level) {
- levels["h" + level] = "######".substr(-level);
- });
- let i = 0;
- let optional = false;
- let errorCount = 0;
- forEachHeading(params, function forHeading(heading, content) {
- if (!errorCount) {
- const actual = levels[heading.tag] + " " + content;
- const expected = requiredHeadings[i++] || "[None]";
- if (expected === "*") {
- optional = true;
- } else if (expected.toLowerCase() === actual.toLowerCase()) {
- optional = false;
- } else if (optional) {
- i--;
- } else {
- addErrorDetailIf(onError, heading.lineNumber,
- expected, actual);
- errorCount++;
- }
- }
- });
- if ((i < requiredHeadings.length) && !errorCount) {
- addErrorContext(onError, params.lines.length,
- requiredHeadings[i]);
- }
- }
- }
-};
-
-
-/***/ }),
-/* 151 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// @ts-check
-
-
-
-const { addErrorDetailIf, bareUrlRe, escapeForRegExp, filterTokens,
- forEachInlineChild, newLineRe } = __webpack_require__(110);
-
-const startNonWordRe = /^\W/;
-const endNonWordRe = /\W$/;
-
-module.exports = {
- "names": [ "MD044", "proper-names" ],
- "description": "Proper names should have the correct capitalization",
- "tags": [ "spelling" ],
- "function": function MD044(params, onError) {
- let names = params.config.names;
- names = Array.isArray(names) ? names : [];
- const codeBlocks = params.config.code_blocks;
- const includeCodeBlocks = (codeBlocks === undefined) ? true : !!codeBlocks;
- names.forEach((name) => {
- const escapedName = escapeForRegExp(name);
- const startNamePattern = startNonWordRe.test(name) ? "" : "\\S*\\b";
- const endNamePattern = endNonWordRe.test(name) ? "" : "\\b\\S*";
- const namePattern =
- `(${startNamePattern})(${escapedName})(${endNamePattern})`;
- const anyNameRe = new RegExp(namePattern, "gi");
- // eslint-disable-next-line jsdoc/require-jsdoc
- function forToken(token) {
- const fenceOffset = (token.type === "fence") ? 1 : 0;
- token.content.split(newLineRe)
- .forEach((line, index) => {
- let match = null;
- while ((match = anyNameRe.exec(line)) !== null) {
- const [ fullMatch, leftMatch, nameMatch, rightMatch ] = match;
- if (fullMatch.search(bareUrlRe) === -1) {
- const wordMatch = fullMatch
- .replace(new RegExp(`^\\W{0,${leftMatch.length}}`), "")
- .replace(new RegExp(`\\W{0,${rightMatch.length}}$`), "");
- if (!names.includes(wordMatch)) {
- const lineNumber = token.lineNumber + index + fenceOffset;
- const fullLine = params.lines[lineNumber - 1];
- const matchLength = wordMatch.length;
- const matchIndex = fullLine.indexOf(wordMatch);
- const range = (matchIndex === -1) ?
- null :
- [ matchIndex + 1, matchLength ];
- const fixInfo = (matchIndex === -1) ?
- null :
- {
- "editColumn": matchIndex + 1,
- "deleteCount": matchLength,
- "insertText": name
- };
- addErrorDetailIf(
- onError,
- lineNumber,
- name,
- nameMatch,
- null,
- null,
- range,
- fixInfo
- );
- }
- }
- }
- });
- }
- forEachInlineChild(params, "text", forToken);
- if (includeCodeBlocks) {
- forEachInlineChild(params, "code_inline", forToken);
- filterTokens(params, "code_block", forToken);
- filterTokens(params, "fence", forToken);
- }
- });
- }
-};
-
-
-/***/ }),
-/* 152 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// @ts-check
-
-
-
-const { addError, forEachInlineChild } = __webpack_require__(110);
-
-module.exports = {
- "names": [ "MD045", "no-alt-text" ],
- "description": "Images should have alternate text (alt text)",
- "tags": [ "accessibility", "images" ],
- "function": function MD045(params, onError) {
- forEachInlineChild(params, "image", function forToken(token) {
- if (token.content === "") {
- addError(onError, token.lineNumber);
- }
- });
- }
-};
-
-
-/***/ }),
-/* 153 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// @ts-check
-
-
-
-const { addErrorDetailIf } = __webpack_require__(110);
-
-const tokenTypeToStyle = {
- "fence": "fenced",
- "code_block": "indented"
-};
-
-module.exports = {
- "names": [ "MD046", "code-block-style" ],
- "description": "Code block style",
- "tags": [ "code" ],
- "function": function MD046(params, onError) {
- let expectedStyle = String(params.config.style || "consistent");
- params.tokens
- .filter((token) => token.type === "code_block" || token.type === "fence")
- .forEach((token) => {
- const { lineNumber, type } = token;
- if (expectedStyle === "consistent") {
- expectedStyle = tokenTypeToStyle[type];
- }
- addErrorDetailIf(
- onError,
- lineNumber,
- expectedStyle,
- tokenTypeToStyle[type]);
- });
- }
-};
-
-
-/***/ }),
-/* 154 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// @ts-check
-
-
-
-const { addError, isBlankLine } = __webpack_require__(110);
-
-module.exports = {
- "names": [ "MD047", "single-trailing-newline" ],
- "description": "Files should end with a single newline character",
- "tags": [ "blank_lines" ],
- "function": function MD047(params, onError) {
- const lastLineNumber = params.lines.length;
- const lastLine = params.lines[lastLineNumber - 1];
- if (!isBlankLine(lastLine)) {
- addError(
- onError,
- lastLineNumber,
- null,
- null,
- [ lastLine.length, 1 ],
- {
- "insertText": "\n",
- "editColumn": lastLine.length + 1
- }
- );
- }
- }
-};
-
-
-/***/ }),
-/* 155 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// @ts-check
-
-
-
-const { addErrorDetailIf, fencedCodeBlockStyleFor } = __webpack_require__(110);
-
-module.exports = {
- "names": [ "MD048", "code-fence-style" ],
- "description": "Code fence style",
- "tags": [ "code" ],
- "function": function MD048(params, onError) {
- const style = String(params.config.style || "consistent");
- let expectedStyle = style;
- params.tokens
- .filter((token) => token.type === "fence")
- .forEach((fenceToken) => {
- const { lineNumber, markup } = fenceToken;
- if (expectedStyle === "consistent") {
- expectedStyle = fencedCodeBlockStyleFor(markup);
- }
- addErrorDetailIf(
- onError,
- lineNumber,
- expectedStyle,
- fencedCodeBlockStyleFor(markup)
- );
- });
- }
-};
-
-
-/***/ }),
-/* 156 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-// @ts-check
-
-
-
-const os = __webpack_require__(111);
-
-// Regular expression for matching common newline characters
-// See NEWLINES_RE in markdown-it/lib/rules_core/normalize.js
-const newLineRe = /\r\n?|\n/g;
-module.exports.newLineRe = newLineRe;
-
-// Regular expression for matching common front matter (YAML and TOML)
-module.exports.frontMatterRe =
- // eslint-disable-next-line max-len
- /((^---\s*$[^]*?^---\s*$)|(^\+\+\+\s*$[^]*?^(\+\+\+|\.\.\.)\s*$))(\r\n|\r|\n|$)/m;
-
-// Regular expression for matching inline disable/enable comments
-const inlineCommentRe =
- // eslint-disable-next-line max-len
- /<!--\s*markdownlint-(?:(?:(disable|enable|capture|restore|disable-file|enable-file)((?:\s+[a-z0-9_-]+)*))|(?:(configure-file)\s+([\s\S]*?)))\s*-->/ig;
-module.exports.inlineCommentRe = inlineCommentRe;
-
-// Regular expressions for range matching
-module.exports.bareUrlRe = /(?:http|ftp)s?:\/\/[^\s\]"']*(?:\/|[^\s\]"'\W])/ig;
-module.exports.listItemMarkerRe = /^([\s>]*)(?:[*+-]|\d+[.)])\s+/;
-module.exports.orderedListItemMarkerRe = /^[\s>]*0*(\d+)[.)]/;
-
-// Regular expression for all instances of emphasis markers
-const emphasisMarkersRe = /[_*]/g;
-
-// Regular expression for inline links and shortcut reference links
-const linkRe = /\[(?:[^[\]]|\[[^\]]*\])*\](?:\(\S*\))?/g;
-
-// readFile options for reading with the UTF-8 encoding
-module.exports.utf8Encoding = { "encoding": "utf8" };
-
-// All punctuation characters (normal and full-width)
-module.exports.allPunctuation = ".,;:!?。,;:!?";
-
-// Returns true iff the input is a number
-module.exports.isNumber = function isNumber(obj) {
- return typeof obj === "number";
-};
-
-// Returns true iff the input is a string
-module.exports.isString = function isString(obj) {
- return typeof obj === "string";
-};
-
-// Returns true iff the input string is empty
-module.exports.isEmptyString = function isEmptyString(str) {
- return str.length === 0;
-};
-
-// Returns true iff the input is an object
-module.exports.isObject = function isObject(obj) {
- return (obj !== null) && (typeof obj === "object") && !Array.isArray(obj);
-};
-
-// Returns true iff the input line is blank (no content)
-// Example: Contains nothing, whitespace, or comments
-const blankLineRe = />|(?:<!--.*?-->)/g;
-module.exports.isBlankLine = function isBlankLine(line) {
- return !line || !line.trim() || !line.replace(blankLineRe, "").trim();
-};
-
-/**
- * Compare function for Array.prototype.sort for ascending order of numbers.
- *
- * @param {number} a First number.
- * @param {number} b Second number.
- * @returns {number} Positive value if a>b, negative value if b<a, 0 otherwise.
- */
-module.exports.numericSortAscending = function numericSortAscending(a, b) {
- return a - b;
-};
-
-// Returns true iff the sorted array contains the specified element
-module.exports.includesSorted = function includesSorted(array, element) {
- let left = 0;
- let right = array.length - 1;
- while (left <= right) {
- /* eslint-disable no-bitwise */
- const mid = (left + right) >> 1;
- if (array[mid] < element) {
- left = mid + 1;
- } else if (array[mid] > element) {
- right = mid - 1;
- } else {
- return true;
- }
- }
- return false;
-};
-
-// Replaces the text of all properly-formatted HTML comments with whitespace
-// This preserves the line/column information for the rest of the document
-// Trailing whitespace is avoided with a '\' character in the last column
-// See https://www.w3.org/TR/html5/syntax.html#comments for details
-const htmlCommentBegin = "<!--";
-const htmlCommentEnd = "-->";
-module.exports.clearHtmlCommentText = function clearHtmlCommentText(text) {
- let i = 0;
- while ((i = text.indexOf(htmlCommentBegin, i)) !== -1) {
- const j = text.indexOf(htmlCommentEnd, i);
- if (j === -1) {
- // Un-terminated comments are treated as text
- break;
- }
- const comment = text.slice(i + htmlCommentBegin.length, j);
- if ((comment.length > 0) &&
- (comment[0] !== ">") &&
- (comment[comment.length - 1] !== "-") &&
- !comment.includes("--") &&
- (text.slice(i, j + htmlCommentEnd.length)
- .search(inlineCommentRe) === -1)) {
- const blanks = comment
- .replace(/[^\r\n]/g, " ")
- .replace(/ ([\r\n])/g, "\\$1");
- text = text.slice(0, i + htmlCommentBegin.length) +
- blanks + text.slice(j);
- }
- i = j + htmlCommentEnd.length;
- }
- return text;
-};
-
-// Escapes a string for use in a RegExp
-module.exports.escapeForRegExp = function escapeForRegExp(str) {
- return str.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&");
-};
-
-// Un-escapes Markdown content (simple algorithm; not a parser)
-const escapedMarkdownRe = /\\./g;
-module.exports.unescapeMarkdown =
- function unescapeMarkdown(markdown, replacement) {
- return markdown.replace(escapedMarkdownRe, (match) => {
- const char = match[1];
- if ("!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~".includes(char)) {
- return replacement || char;
- }
- return match;
- });
- };
-
-/**
- * Return the string representation of a fence markup character.
- *
- * @param {string} markup Fence string.
- * @returns {string} String representation.
- */
-module.exports.fencedCodeBlockStyleFor =
- function fencedCodeBlockStyleFor(markup) {
- switch (markup[0]) {
- case "~":
- return "tilde";
- default:
- return "backtick";
- }
- };
-
-/**
- * Return the number of characters of indent for a token.
- *
- * @param {Object} token MarkdownItToken instance.
- * @returns {number} Characters of indent.
- */
-function indentFor(token) {
- const line = token.line.replace(/^[\s>]*(> |>)/, "");
- return line.length - line.trimLeft().length;
-}
-module.exports.indentFor = indentFor;
-
-// Returns the heading style for a heading token
-module.exports.headingStyleFor = function headingStyleFor(token) {
- if ((token.map[1] - token.map[0]) === 1) {
- if (/[^\\]#\s*$/.test(token.line)) {
- return "atx_closed";
- }
- return "atx";
- }
- return "setext";
-};
-
-/**
- * Return the string representation of an unordered list marker.
- *
- * @param {Object} token MarkdownItToken instance.
- * @returns {string} String representation.
- */
-module.exports.unorderedListStyleFor = function unorderedListStyleFor(token) {
- switch (token.markup) {
- case "-":
- return "dash";
- case "+":
- return "plus";
- // case "*":
- default:
- return "asterisk";
- }
-};
-
-/**
- * Calls the provided function for each matching token.
- *
- * @param {Object} params RuleParams instance.
- * @param {string} type Token type identifier.
- * @param {Function} handler Callback function.
- * @returns {void}
- */
-function filterTokens(params, type, handler) {
- params.tokens.forEach(function forToken(token) {
- if (token.type === type) {
- handler(token);
- }
- });
-}
-module.exports.filterTokens = filterTokens;
-
-// Get line metadata array
-module.exports.getLineMetadata = function getLineMetadata(params) {
- const lineMetadata = params.lines.map(function mapLine(line, index) {
- return [ line, index, false, 0, false, false ];
- });
- filterTokens(params, "fence", function forToken(token) {
- lineMetadata[token.map[0]][3] = 1;
- lineMetadata[token.map[1] - 1][3] = -1;
- for (let i = token.map[0] + 1; i < token.map[1] - 1; i++) {
- lineMetadata[i][2] = true;
- }
- });
- filterTokens(params, "code_block", function forToken(token) {
- for (let i = token.map[0]; i < token.map[1]; i++) {
- lineMetadata[i][2] = true;
- }
- });
- filterTokens(params, "table_open", function forToken(token) {
- for (let i = token.map[0]; i < token.map[1]; i++) {
- lineMetadata[i][4] = true;
- }
- });
- filterTokens(params, "list_item_open", function forToken(token) {
- let count = 1;
- for (let i = token.map[0]; i < token.map[1]; i++) {
- lineMetadata[i][5] = count;
- count++;
- }
- });
- filterTokens(params, "hr", function forToken(token) {
- lineMetadata[token.map[0]][6] = true;
- });
- return lineMetadata;
-};
-
-// Calls the provided function for each line (with context)
-module.exports.forEachLine = function forEachLine(lineMetadata, handler) {
- lineMetadata.forEach(function forMetadata(metadata) {
- // Parameters: line, lineIndex, inCode, onFence, inTable, inItem, inBreak
- handler(...metadata);
- });
-};
-
-// Returns (nested) lists as a flat array (in order)
-module.exports.flattenLists = function flattenLists(params) {
- const flattenedLists = [];
- const stack = [];
- let current = null;
- let nesting = 0;
- const nestingStack = [];
- let lastWithMap = { "map": [ 0, 1 ] };
- params.tokens.forEach(function forToken(token) {
- if ((token.type === "bullet_list_open") ||
- (token.type === "ordered_list_open")) {
- // Save current context and start a new one
- stack.push(current);
- current = {
- "unordered": (token.type === "bullet_list_open"),
- "parentsUnordered": !current ||
- (current.unordered && current.parentsUnordered),
- "open": token,
- "indent": indentFor(token),
- "parentIndent": (current && current.indent) || 0,
- "items": [],
- "nesting": nesting,
- "lastLineIndex": -1,
- "insert": flattenedLists.length
- };
- nesting++;
- } else if ((token.type === "bullet_list_close") ||
- (token.type === "ordered_list_close")) {
- // Finalize current context and restore previous
- current.lastLineIndex = lastWithMap.map[1];
- flattenedLists.splice(current.insert, 0, current);
- delete current.insert;
- current = stack.pop();
- nesting--;
- } else if (token.type === "list_item_open") {
- // Add list item
- current.items.push(token);
- } else if (token.type === "blockquote_open") {
- nestingStack.push(nesting);
- nesting = 0;
- } else if (token.type === "blockquote_close") {
- nesting = nestingStack.pop();
- } else if (token.map) {
- // Track last token with map
- lastWithMap = token;
- }
- });
- return flattenedLists;
-};
-
-// Calls the provided function for each specified inline child token
-module.exports.forEachInlineChild =
-function forEachInlineChild(params, type, handler) {
- filterTokens(params, "inline", function forToken(token) {
- token.children.forEach(function forChild(child) {
- if (child.type === type) {
- handler(child, token);
- }
- });
- });
-};
-
-// Calls the provided function for each heading's content
-module.exports.forEachHeading = function forEachHeading(params, handler) {
- let heading = null;
- params.tokens.forEach(function forToken(token) {
- if (token.type === "heading_open") {
- heading = token;
- } else if (token.type === "heading_close") {
- heading = null;
- } else if ((token.type === "inline") && heading) {
- handler(heading, token.content);
- }
- });
-};
-
-/**
- * Calls the provided function for each inline code span's content.
- *
- * @param {string} input Markdown content.
- * @param {Function} handler Callback function.
- * @returns {void}
- */
-function forEachInlineCodeSpan(input, handler) {
- let currentLine = 0;
- let currentColumn = 0;
- let index = 0;
- while (index < input.length) {
- let startIndex = -1;
- let startLine = -1;
- let startColumn = -1;
- let tickCount = 0;
- let currentTicks = 0;
- let state = "normal";
- // Deliberate <= so trailing 0 completes the last span (ex: "text `code`")
- for (; index <= input.length; index++) {
- const char = input[index];
- // Ignore backticks in link destination
- if ((char === "[") && (state === "normal")) {
- state = "linkTextOpen";
- } else if ((char === "]") && (state === "linkTextOpen")) {
- state = "linkTextClosed";
- } else if ((char === "(") && (state === "linkTextClosed")) {
- state = "linkDestinationOpen";
- } else if (
- ((char === "(") && (state === "linkDestinationOpen")) ||
- ((char === ")") && (state === "linkDestinationOpen")) ||
- (state === "linkTextClosed")) {
- state = "normal";
- }
- // Parse backtick open/close
- if ((char === "`") && (state !== "linkDestinationOpen")) {
- // Count backticks at start or end of code span
- currentTicks++;
- if ((startIndex === -1) || (startColumn === -1)) {
- startIndex = index + 1;
- }
- } else {
- if ((startIndex >= 0) &&
- (startColumn >= 0) &&
- (tickCount === currentTicks)) {
- // Found end backticks; invoke callback for code span
- handler(
- input.substring(startIndex, index - currentTicks),
- startLine, startColumn, tickCount);
- startIndex = -1;
- startColumn = -1;
- } else if ((startIndex >= 0) && (startColumn === -1)) {
- // Found start backticks
- tickCount = currentTicks;
- startLine = currentLine;
- startColumn = currentColumn;
- }
- // Not in backticks
- currentTicks = 0;
- }
- if (char === "\n") {
- // On next line
- currentLine++;
- currentColumn = 0;
- } else if ((char === "\\") &&
- ((startIndex === -1) || (startColumn === -1)) &&
- (input[index + 1] !== "\n")) {
- // Escape character outside code, skip next
- index++;
- currentColumn += 2;
- } else {
- // On next column
- currentColumn++;
- }
- }
- if (startIndex >= 0) {
- // Restart loop after unmatched start backticks (ex: "`text``code``")
- index = startIndex;
- currentLine = startLine;
- currentColumn = startColumn;
- }
- }
-}
-module.exports.forEachInlineCodeSpan = forEachInlineCodeSpan;
-
-/**
- * Adds a generic error object via the onError callback.
- *
- * @param {Object} onError RuleOnError instance.
- * @param {number} lineNumber Line number.
- * @param {string} [detail] Error details.
- * @param {string} [context] Error context.
- * @param {number[]} [range] Column and length of error.
- * @param {Object} [fixInfo] RuleOnErrorFixInfo instance.
- * @returns {void}
- */
-function addError(onError, lineNumber, detail, context, range, fixInfo) {
- onError({
- lineNumber,
- detail,
- context,
- range,
- fixInfo
- });
-}
-module.exports.addError = addError;
-
-// Adds an error object with details conditionally via the onError callback
-module.exports.addErrorDetailIf = function addErrorDetailIf(
- onError, lineNumber, expected, actual, detail, context, range, fixInfo) {
- if (expected !== actual) {
- addError(
- onError,
- lineNumber,
- "Expected: " + expected + "; Actual: " + actual +
- (detail ? "; " + detail : ""),
- context,
- range,
- fixInfo);
- }
-};
-
-// Adds an error object with context via the onError callback
-module.exports.addErrorContext = function addErrorContext(
- onError, lineNumber, context, left, right, range, fixInfo) {
- if (context.length <= 30) {
- // Nothing to do
- } else if (left && right) {
- context = context.substr(0, 15) + "..." + context.substr(-15);
- } else if (right) {
- context = "..." + context.substr(-30);
- } else {
- context = context.substr(0, 30) + "...";
- }
- addError(onError, lineNumber, null, context, range, fixInfo);
-};
-
-// Returns a range object for a line by applying a RegExp
-module.exports.rangeFromRegExp = function rangeFromRegExp(line, regexp) {
- let range = null;
- const match = line.match(regexp);
- if (match) {
- const column = match.index + 1;
- const length = match[0].length;
- range = [ column, length ];
- }
- return range;
-};
-
-// Determines if the front matter includes a title
-module.exports.frontMatterHasTitle =
- function frontMatterHasTitle(frontMatterLines, frontMatterTitlePattern) {
- const ignoreFrontMatter =
- (frontMatterTitlePattern !== undefined) && !frontMatterTitlePattern;
- const frontMatterTitleRe =
- new RegExp(String(frontMatterTitlePattern || "^\\s*title\\s*[:=]"), "i");
- return !ignoreFrontMatter &&
- frontMatterLines.some((line) => frontMatterTitleRe.test(line));
- };
-
-/**
- * Returns a list of emphasis markers in code spans and links.
- *
- * @param {Object} params RuleParams instance.
- * @returns {number[][]} List of markers.
- */
-function emphasisMarkersInContent(params) {
- const { lines } = params;
- const byLine = new Array(lines.length);
- // Search code spans
- filterTokens(params, "inline", (token) => {
- const { children, lineNumber, map } = token;
- if (children.some((child) => child.type === "code_inline")) {
- const tokenLines = lines.slice(map[0], map[1]);
- forEachInlineCodeSpan(
- tokenLines.join("\n"),
- (code, lineIndex, column, tickCount) => {
- const codeLines = code.split(newLineRe);
- codeLines.forEach((codeLine, codeLineIndex) => {
- let match = null;
- while ((match = emphasisMarkersRe.exec(codeLine))) {
- const byLineIndex = lineNumber - 1 + lineIndex + codeLineIndex;
- const inLine = byLine[byLineIndex] || [];
- const codeLineOffset = codeLineIndex ? 0 : column - 1 + tickCount;
- inLine.push(codeLineOffset + match.index);
- byLine[byLineIndex] = inLine;
- }
- });
- }
- );
- }
- });
- // Search links
- lines.forEach((tokenLine, tokenLineIndex) => {
- let linkMatch = null;
- while ((linkMatch = linkRe.exec(tokenLine))) {
- let markerMatch = null;
- while ((markerMatch = emphasisMarkersRe.exec(linkMatch[0]))) {
- const inLine = byLine[tokenLineIndex] || [];
- inLine.push(linkMatch.index + markerMatch.index);
- byLine[tokenLineIndex] = inLine;
- }
- }
- });
- return byLine;
-}
-module.exports.emphasisMarkersInContent = emphasisMarkersInContent;
-
-/**
- * Gets the most common line ending, falling back to the platform default.
- *
- * @param {string} input Markdown content to analyze.
- * @returns {string} Preferred line ending.
- */
-function getPreferredLineEnding(input) {
- let cr = 0;
- let lf = 0;
- let crlf = 0;
- const endings = input.match(newLineRe) || [];
- endings.forEach((ending) => {
- // eslint-disable-next-line default-case
- switch (ending) {
- case "\r":
- cr++;
- break;
- case "\n":
- lf++;
- break;
- case "\r\n":
- crlf++;
- break;
- }
- });
- let preferredLineEnding = null;
- if (!cr && !lf && !crlf) {
- preferredLineEnding = os.EOL;
- } else if ((lf >= crlf) && (lf >= cr)) {
- preferredLineEnding = "\n";
- } else if (crlf >= cr) {
- preferredLineEnding = "\r\n";
- } else {
- preferredLineEnding = "\r";
- }
- return preferredLineEnding;
-}
-module.exports.getPreferredLineEnding = getPreferredLineEnding;
-
-/**
- * Normalizes the fields of a RuleOnErrorFixInfo instance.
- *
- * @param {Object} fixInfo RuleOnErrorFixInfo instance.
- * @param {number} [lineNumber] Line number.
- * @returns {Object} Normalized RuleOnErrorFixInfo instance.
- */
-function normalizeFixInfo(fixInfo, lineNumber) {
- return {
- "lineNumber": fixInfo.lineNumber || lineNumber,
- "editColumn": fixInfo.editColumn || 1,
- "deleteCount": fixInfo.deleteCount || 0,
- "insertText": fixInfo.insertText || ""
- };
-}
-
-/**
- * Fixes the specified error on a line of Markdown content.
- *
- * @param {string} line Line of Markdown content.
- * @param {Object} fixInfo RuleOnErrorFixInfo instance.
- * @param {string} lineEnding Line ending to use.
- * @returns {string} Fixed content.
- */
-function applyFix(line, fixInfo, lineEnding) {
- const { editColumn, deleteCount, insertText } = normalizeFixInfo(fixInfo);
- const editIndex = editColumn - 1;
- return (deleteCount === -1) ?
- null :
- line.slice(0, editIndex) +
- insertText.replace(/\n/g, lineEnding || "\n") +
- line.slice(editIndex + deleteCount);
-}
-module.exports.applyFix = applyFix;
-
-// Applies as many fixes as possible to the input lines
-module.exports.applyFixes = function applyFixes(input, errors) {
- const lineEnding = getPreferredLineEnding(input);
- const lines = input.split(newLineRe);
- // Normalize fixInfo objects
- let fixInfos = errors
- .filter((error) => error.fixInfo)
- .map((error) => normalizeFixInfo(error.fixInfo, error.lineNumber));
- // Sort bottom-to-top, line-deletes last, right-to-left, long-to-short
- fixInfos.sort((a, b) => {
- const aDeletingLine = (a.deleteCount === -1);
- const bDeletingLine = (b.deleteCount === -1);
- return (
- (b.lineNumber - a.lineNumber) ||
- (aDeletingLine ? 1 : (bDeletingLine ? -1 : 0)) ||
- (b.editColumn - a.editColumn) ||
- (b.insertText.length - a.insertText.length)
- );
- });
- // Remove duplicate entries (needed for following collapse step)
- let lastFixInfo = {};
- fixInfos = fixInfos.filter((fixInfo) => {
- const unique = (
- (fixInfo.lineNumber !== lastFixInfo.lineNumber) ||
- (fixInfo.editColumn !== lastFixInfo.editColumn) ||
- (fixInfo.deleteCount !== lastFixInfo.deleteCount) ||
- (fixInfo.insertText !== lastFixInfo.insertText)
- );
- lastFixInfo = fixInfo;
- return unique;
- });
- // Collapse insert/no-delete and no-insert/delete for same line/column
- lastFixInfo = {};
- fixInfos.forEach((fixInfo) => {
- if (
- (fixInfo.lineNumber === lastFixInfo.lineNumber) &&
- (fixInfo.editColumn === lastFixInfo.editColumn) &&
- !fixInfo.insertText &&
- (fixInfo.deleteCount > 0) &&
- lastFixInfo.insertText &&
- !lastFixInfo.deleteCount) {
- fixInfo.insertText = lastFixInfo.insertText;
- lastFixInfo.lineNumber = 0;
- }
- lastFixInfo = fixInfo;
- });
- fixInfos = fixInfos.filter((fixInfo) => fixInfo.lineNumber);
- // Apply all (remaining/updated) fixes
- let lastLineIndex = -1;
- let lastEditIndex = -1;
- fixInfos.forEach((fixInfo) => {
- const { lineNumber, editColumn, deleteCount } = fixInfo;
- const lineIndex = lineNumber - 1;
- const editIndex = editColumn - 1;
- if (
- (lineIndex !== lastLineIndex) ||
- ((editIndex + deleteCount) < lastEditIndex) ||
- (deleteCount === -1)
- ) {
- lines[lineIndex] = applyFix(lines[lineIndex], fixInfo, lineEnding);
- }
- lastLineIndex = lineIndex;
- lastEditIndex = editIndex;
- });
- // Return corrected input
- return lines.filter((line) => line !== null).join(lineEnding);
-};
-
-
-/***/ }),
-/* 157 */
-/***/ (function(module, exports, __webpack_require__) {
-
-var cc = __webpack_require__(158)
-var join = __webpack_require__(38).join
-var deepExtend = __webpack_require__(3)
-var etc = '/etc'
-var win = process.platform === "win32"
-var home = win
- ? process.env.USERPROFILE
- : process.env.HOME
-
-module.exports = function (name, defaults, argv, parse) {
- if('string' !== typeof name)
- throw new Error('rc(name): name *must* be string')
- if(!argv)
- argv = __webpack_require__(161)(process.argv.slice(2))
- defaults = (
- 'string' === typeof defaults
- ? cc.json(defaults) : defaults
- ) || {}
-
- parse = parse || cc.parse
-
- var env = cc.env(name + '_')
-
- var configs = [defaults]
- var configFiles = []
- function addConfigFile (file) {
- if (configFiles.indexOf(file) >= 0) return
- var fileConfig = cc.file(file)
- if (fileConfig) {
- configs.push(parse(fileConfig))
- configFiles.push(file)
- }
- }
-
- // which files do we look at?
- if (!win)
- [join(etc, name, 'config'),
- join(etc, name + 'rc')].forEach(addConfigFile)
- if (home)
- [join(home, '.config', name, 'config'),
- join(home, '.config', name),
- join(home, '.' + name, 'config'),
- join(home, '.' + name + 'rc')].forEach(addConfigFile)
- addConfigFile(cc.find('.'+name+'rc'))
- if (env.config) addConfigFile(env.config)
- if (argv.config) addConfigFile(argv.config)
-
- return deepExtend.apply(null, configs.concat([
- env,
- argv,
- configFiles.length ? {configs: configFiles, config: configFiles[configFiles.length - 1]} : undefined,
- ]))
-}
-
-
-/***/ }),
-/* 158 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-var fs = __webpack_require__(4)
-var ini = __webpack_require__(159)
-var path = __webpack_require__(38)
-var stripJsonComments = __webpack_require__(160)
-
-var parse = exports.parse = function (content) {
-
- //if it ends in .json or starts with { then it must be json.
- //must be done this way, because ini accepts everything.
- //can't just try and parse it and let it throw if it's not ini.
- //everything is ini. even json with a syntax error.
-
- if(/^\s*{/.test(content))
- return JSON.parse(stripJsonComments(content))
- return ini.parse(content)
-
-}
-
-var file = exports.file = function () {
- var args = [].slice.call(arguments).filter(function (arg) { return arg != null })
-
- //path.join breaks if it's a not a string, so just skip this.
- for(var i in args)
- if('string' !== typeof args[i])
- return
-
- var file = path.join.apply(null, args)
- var content
- try {
- return fs.readFileSync(file,'utf-8')
- } catch (err) {
- return
- }
-}
-
-var json = exports.json = function () {
- var content = file.apply(null, arguments)
- return content ? parse(content) : null
-}
-
-var env = exports.env = function (prefix, env) {
- env = env || process.env
- var obj = {}
- var l = prefix.length
- for(var k in env) {
- if(k.toLowerCase().indexOf(prefix.toLowerCase()) === 0) {
-
- var keypath = k.substring(l).split('__')
-
- // Trim empty strings from keypath array
- var _emptyStringIndex
- while ((_emptyStringIndex=keypath.indexOf('')) > -1) {
- keypath.splice(_emptyStringIndex, 1)
- }
-
- var cursor = obj
- keypath.forEach(function _buildSubObj(_subkey,i){
-
- // (check for _subkey first so we ignore empty strings)
- // (check for cursor to avoid assignment to primitive objects)
- if (!_subkey || typeof cursor !== 'object')
- return
-
- // If this is the last key, just stuff the value in there
- // Assigns actual value from env variable to final key
- // (unless it's just an empty string- in that case use the last valid key)
- if (i === keypath.length-1)
- cursor[_subkey] = env[k]
-
-
- // Build sub-object if nothing already exists at the keypath
- if (cursor[_subkey] === undefined)
- cursor[_subkey] = {}
-
- // Increment cursor used to track the object at the current depth
- cursor = cursor[_subkey]
-
- })
-
- }
-
- }
-
- return obj
-}
-
-var find = exports.find = function () {
- var rel = path.join.apply(null, [].slice.call(arguments))
-
- function find(start, rel) {
- var file = path.join(start, rel)
- try {
- fs.statSync(file)
- return file
- } catch (err) {
- if(path.dirname(start) !== start) // root
- return find(path.dirname(start), rel)
- }
- }
- return find(process.cwd(), rel)
-}
-
-
-
-
-/***/ }),
-/* 159 */
-/***/ (function(module, exports) {
-
-exports.parse = exports.decode = decode
-
-exports.stringify = exports.encode = encode
-
-exports.safe = safe
-exports.unsafe = unsafe
-
-var eol = typeof process !== 'undefined' &&
- process.platform === 'win32' ? '\r\n' : '\n'
-
-function encode (obj, opt) {
- var children = []
- var out = ''
-
- if (typeof opt === 'string') {
- opt = {
- section: opt,
- whitespace: false
- }
- } else {
- opt = opt || {}
- opt.whitespace = opt.whitespace === true
- }
-
- var separator = opt.whitespace ? ' = ' : '='
-
- Object.keys(obj).forEach(function (k, _, __) {
- var val = obj[k]
- if (val && Array.isArray(val)) {
- val.forEach(function (item) {
- out += safe(k + '[]') + separator + safe(item) + '\n'
- })
- } else if (val && typeof val === 'object') {
- children.push(k)
- } else {
- out += safe(k) + separator + safe(val) + eol
- }
- })
-
- if (opt.section && out.length) {
- out = '[' + safe(opt.section) + ']' + eol + out
- }
-
- children.forEach(function (k, _, __) {
- var nk = dotSplit(k).join('\\.')
- var section = (opt.section ? opt.section + '.' : '') + nk
- var child = encode(obj[k], {
- section: section,
- whitespace: opt.whitespace
- })
- if (out.length && child.length) {
- out += eol
- }
- out += child
- })
-
- return out
-}
-
-function dotSplit (str) {
- return str.replace(/\1/g, '\u0002LITERAL\\1LITERAL\u0002')
- .replace(/\\\./g, '\u0001')
- .split(/\./).map(function (part) {
- return part.replace(/\1/g, '\\.')
- .replace(/\2LITERAL\\1LITERAL\2/g, '\u0001')
- })
-}
-
-function decode (str) {
- var out = {}
- var p = out
- var section = null
- // section |key = value
- var re = /^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i
- var lines = str.split(/[\r\n]+/g)
-
- lines.forEach(function (line, _, __) {
- if (!line || line.match(/^\s*[;#]/)) return
- var match = line.match(re)
- if (!match) return
- if (match[1] !== undefined) {
- section = unsafe(match[1])
- p = out[section] = out[section] || {}
- return
- }
- var key = unsafe(match[2])
- var value = match[3] ? unsafe(match[4]) : true
- switch (value) {
- case 'true':
- case 'false':
- case 'null': value = JSON.parse(value)
- }
-
- // Convert keys with '[]' suffix to an array
- if (key.length > 2 && key.slice(-2) === '[]') {
- key = key.substring(0, key.length - 2)
- if (!p[key]) {
- p[key] = []
- } else if (!Array.isArray(p[key])) {
- p[key] = [p[key]]
- }
- }
-
- // safeguard against resetting a previously defined
- // array by accidentally forgetting the brackets
- if (Array.isArray(p[key])) {
- p[key].push(value)
- } else {
- p[key] = value
- }
- })
-
- // {a:{y:1},"a.b":{x:2}} --> {a:{y:1,b:{x:2}}}
- // use a filter to return the keys that have to be deleted.
- Object.keys(out).filter(function (k, _, __) {
- if (!out[k] ||
- typeof out[k] !== 'object' ||
- Array.isArray(out[k])) {
- return false
- }
- // see if the parent section is also an object.
- // if so, add it to that, and mark this one for deletion
- var parts = dotSplit(k)
- var p = out
- var l = parts.pop()
- var nl = l.replace(/\\\./g, '.')
- parts.forEach(function (part, _, __) {
- if (!p[part] || typeof p[part] !== 'object') p[part] = {}
- p = p[part]
- })
- if (p === out && nl === l) {
- return false
- }
- p[nl] = out[k]
- return true
- }).forEach(function (del, _, __) {
- delete out[del]
- })
-
- return out
-}
-
-function isQuoted (val) {
- return (val.charAt(0) === '"' && val.slice(-1) === '"') ||
- (val.charAt(0) === "'" && val.slice(-1) === "'")
-}
-
-function safe (val) {
- return (typeof val !== 'string' ||
- val.match(/[=\r\n]/) ||
- val.match(/^\[/) ||
- (val.length > 1 &&
- isQuoted(val)) ||
- val !== val.trim())
- ? JSON.stringify(val)
- : val.replace(/;/g, '\\;').replace(/#/g, '\\#')
-}
-
-function unsafe (val, doUnesc) {
- val = (val || '').trim()
- if (isQuoted(val)) {
- // remove the single quotes before calling JSON.parse
- if (val.charAt(0) === "'") {
- val = val.substr(1, val.length - 2)
- }
- try { val = JSON.parse(val) } catch (_) {}
- } else {
- // walk the val to find the first not-escaped ; character
- var esc = false
- var unesc = ''
- for (var i = 0, l = val.length; i < l; i++) {
- var c = val.charAt(i)
- if (esc) {
- if ('\\;#'.indexOf(c) !== -1) {
- unesc += c
- } else {
- unesc += '\\' + c
- }
- esc = false
- } else if (';#'.indexOf(c) !== -1) {
- break
- } else if (c === '\\') {
- esc = true
- } else {
- unesc += c
- }
- }
- if (esc) {
- unesc += '\\'
- }
- return unesc.trim()
- }
- return val
-}
-
-
-/***/ }),
-/* 160 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-var singleComment = 1;
-var multiComment = 2;
-
-function stripWithoutWhitespace() {
- return '';
-}
-
-function stripWithWhitespace(str, start, end) {
- return str.slice(start, end).replace(/\S/g, ' ');
-}
-
-module.exports = function (str, opts) {
- opts = opts || {};
-
- var currentChar;
- var nextChar;
- var insideString = false;
- var insideComment = false;
- var offset = 0;
- var ret = '';
- var strip = opts.whitespace === false ? stripWithoutWhitespace : stripWithWhitespace;
-
- for (var i = 0; i < str.length; i++) {
- currentChar = str[i];
- nextChar = str[i + 1];
-
- if (!insideComment && currentChar === '"') {
- var escaped = str[i - 1] === '\\' && str[i - 2] !== '\\';
- if (!escaped) {
- insideString = !insideString;
- }
- }
-
- if (insideString) {
- continue;
- }
-
- if (!insideComment && currentChar + nextChar === '//') {
- ret += str.slice(offset, i);
- offset = i;
- insideComment = singleComment;
- i++;
- } else if (insideComment === singleComment && currentChar + nextChar === '\r\n') {
- i++;
- insideComment = false;
- ret += strip(str, offset, i);
- offset = i;
- continue;
- } else if (insideComment === singleComment && currentChar === '\n') {
- insideComment = false;
- ret += strip(str, offset, i);
- offset = i;
- } else if (!insideComment && currentChar + nextChar === '/*') {
- ret += str.slice(offset, i);
- offset = i;
- insideComment = multiComment;
- i++;
- continue;
- } else if (insideComment === multiComment && currentChar + nextChar === '*/') {
- i++;
- insideComment = false;
- ret += strip(str, offset, i + 1);
- offset = i + 1;
- continue;
- }
- }
-
- return ret + (insideComment ? strip(str.substr(offset)) : str.substr(offset));
-};
-
-
-/***/ }),
-/* 161 */
-/***/ (function(module, exports) {
-
-module.exports = function (args, opts) {
- if (!opts) opts = {};
-
- var flags = { bools : {}, strings : {}, unknownFn: null };
-
- if (typeof opts['unknown'] === 'function') {
- flags.unknownFn = opts['unknown'];
- }
-
- if (typeof opts['boolean'] === 'boolean' && opts['boolean']) {
- flags.allBools = true;
- } else {
- [].concat(opts['boolean']).filter(Boolean).forEach(function (key) {
- flags.bools[key] = true;
- });
- }
-
- var aliases = {};
- Object.keys(opts.alias || {}).forEach(function (key) {
- aliases[key] = [].concat(opts.alias[key]);
- aliases[key].forEach(function (x) {
- aliases[x] = [key].concat(aliases[key].filter(function (y) {
- return x !== y;
- }));
- });
- });
-
- [].concat(opts.string).filter(Boolean).forEach(function (key) {
- flags.strings[key] = true;
- if (aliases[key]) {
- flags.strings[aliases[key]] = true;
- }
- });
-
- var defaults = opts['default'] || {};
-
- var argv = { _ : [] };
- Object.keys(flags.bools).forEach(function (key) {
- setArg(key, defaults[key] === undefined ? false : defaults[key]);
- });
-
- var notFlags = [];
-
- if (args.indexOf('--') !== -1) {
- notFlags = args.slice(args.indexOf('--')+1);
- args = args.slice(0, args.indexOf('--'));
- }
-
- function argDefined(key, arg) {
- return (flags.allBools && /^--[^=]+$/.test(arg)) ||
- flags.strings[key] || flags.bools[key] || aliases[key];
- }
-
- function setArg (key, val, arg) {
- if (arg && flags.unknownFn && !argDefined(key, arg)) {
- if (flags.unknownFn(arg) === false) return;
- }
-
- var value = !flags.strings[key] && isNumber(val)
- ? Number(val) : val
- ;
- setKey(argv, key.split('.'), value);
-
- (aliases[key] || []).forEach(function (x) {
- setKey(argv, x.split('.'), value);
- });
- }
-
- function setKey (obj, keys, value) {
- var o = obj;
- for (var i = 0; i < keys.length-1; i++) {
- var key = keys[i];
- if (key === '__proto__') return;
- if (o[key] === undefined) o[key] = {};
- if (o[key] === Object.prototype || o[key] === Number.prototype
- || o[key] === String.prototype) o[key] = {};
- if (o[key] === Array.prototype) o[key] = [];
- o = o[key];
- }
-
- var key = keys[keys.length - 1];
- if (key === '__proto__') return;
- if (o === Object.prototype || o === Number.prototype
- || o === String.prototype) o = {};
- if (o === Array.prototype) o = [];
- if (o[key] === undefined || flags.bools[key] || typeof o[key] === 'boolean') {
- o[key] = value;
- }
- else if (Array.isArray(o[key])) {
- o[key].push(value);
- }
- else {
- o[key] = [ o[key], value ];
- }
- }
-
- function aliasIsBoolean(key) {
- return aliases[key].some(function (x) {
- return flags.bools[x];
- });
- }
-
- for (var i = 0; i < args.length; i++) {
- var arg = args[i];
-
- if (/^--.+=/.test(arg)) {
- // Using [\s\S] instead of . because js doesn't support the
- // 'dotall' regex modifier. See:
- // http://stackoverflow.com/a/1068308/13216
- var m = arg.match(/^--([^=]+)=([\s\S]*)$/);
- var key = m[1];
- var value = m[2];
- if (flags.bools[key]) {
- value = value !== 'false';
- }
- setArg(key, value, arg);
- }
- else if (/^--no-.+/.test(arg)) {
- var key = arg.match(/^--no-(.+)/)[1];
- setArg(key, false, arg);
- }
- else if (/^--.+/.test(arg)) {
- var key = arg.match(/^--(.+)/)[1];
- var next = args[i + 1];
- if (next !== undefined && !/^-/.test(next)
- && !flags.bools[key]
- && !flags.allBools
- && (aliases[key] ? !aliasIsBoolean(key) : true)) {
- setArg(key, next, arg);
- i++;
- }
- else if (/^(true|false)$/.test(next)) {
- setArg(key, next === 'true', arg);
- i++;
- }
- else {
- setArg(key, flags.strings[key] ? '' : true, arg);
- }
- }
- else if (/^-[^-]+/.test(arg)) {
- var letters = arg.slice(1,-1).split('');
-
- var broken = false;
- for (var j = 0; j < letters.length; j++) {
- var next = arg.slice(j+2);
-
- if (next === '-') {
- setArg(letters[j], next, arg)
- continue;
- }
-
- if (/[A-Za-z]/.test(letters[j]) && /=/.test(next)) {
- setArg(letters[j], next.split('=')[1], arg);
- broken = true;
- break;
- }
-
- if (/[A-Za-z]/.test(letters[j])
- && /-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) {
- setArg(letters[j], next, arg);
- broken = true;
- break;
- }
-
- if (letters[j+1] && letters[j+1].match(/\W/)) {
- setArg(letters[j], arg.slice(j+2), arg);
- broken = true;
- break;
- }
- else {
- setArg(letters[j], flags.strings[letters[j]] ? '' : true, arg);
- }
- }
-
- var key = arg.slice(-1)[0];
- if (!broken && key !== '-') {
- if (args[i+1] && !/^(-|--)[^-]/.test(args[i+1])
- && !flags.bools[key]
- && (aliases[key] ? !aliasIsBoolean(key) : true)) {
- setArg(key, args[i+1], arg);
- i++;
- }
- else if (args[i+1] && /^(true|false)$/.test(args[i+1])) {
- setArg(key, args[i+1] === 'true', arg);
- i++;
- }
- else {
- setArg(key, flags.strings[key] ? '' : true, arg);
- }
- }
- }
- else {
- if (!flags.unknownFn || flags.unknownFn(arg) !== false) {
- argv._.push(
- flags.strings['_'] || !isNumber(arg) ? arg : Number(arg)
- );
- }
- if (opts.stopEarly) {
- argv._.push.apply(argv._, args.slice(i + 1));
- break;
- }
- }
- }
-
- Object.keys(defaults).forEach(function (key) {
- if (!hasKey(argv, key.split('.'))) {
- setKey(argv, key.split('.'), defaults[key]);
-
- (aliases[key] || []).forEach(function (x) {
- setKey(argv, x.split('.'), defaults[key]);
- });
- }
- });
-
- if (opts['--']) {
- argv['--'] = new Array();
- notFlags.forEach(function(key) {
- argv['--'].push(key);
- });
- }
- else {
- notFlags.forEach(function(key) {
- argv._.push(key);
- });
- }
-
- return argv;
-};
-
-function hasKey (obj, keys) {
- var o = obj;
- keys.slice(0,-1).forEach(function (key) {
- o = (o[key] || {});
- });
-
- var key = keys[keys.length - 1];
- return key in o;
-}
-
-function isNumber (x) {
- if (typeof x === 'number') return true;
- if (/^0x[0-9a-f]+$/i.test(x)) return true;
- return /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x);
-}
-
-
-
-/***/ }),
-/* 162 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/* --------------------------------------------------------------------------------------------\r
- * Copyright (c) Microsoft Corporation. All rights reserved.\r
- * Licensed under the MIT License. See License.txt in the project root for license information.\r
- * ------------------------------------------------------------------------------------------ */\r
-\r
-function __export(m) {\r
- for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\r
-}\r
-Object.defineProperty(exports, "__esModule", { value: true });\r
-const vscode_jsonrpc_1 = __webpack_require__(163);\r
-exports.ErrorCodes = vscode_jsonrpc_1.ErrorCodes;\r
-exports.ResponseError = vscode_jsonrpc_1.ResponseError;\r
-exports.CancellationToken = vscode_jsonrpc_1.CancellationToken;\r
-exports.CancellationTokenSource = vscode_jsonrpc_1.CancellationTokenSource;\r
-exports.Disposable = vscode_jsonrpc_1.Disposable;\r
-exports.Event = vscode_jsonrpc_1.Event;\r
-exports.Emitter = vscode_jsonrpc_1.Emitter;\r
-exports.Trace = vscode_jsonrpc_1.Trace;\r
-exports.TraceFormat = vscode_jsonrpc_1.TraceFormat;\r
-exports.SetTraceNotification = vscode_jsonrpc_1.SetTraceNotification;\r
-exports.LogTraceNotification = vscode_jsonrpc_1.LogTraceNotification;\r
-exports.RequestType = vscode_jsonrpc_1.RequestType;\r
-exports.RequestType0 = vscode_jsonrpc_1.RequestType0;\r
-exports.NotificationType = vscode_jsonrpc_1.NotificationType;\r
-exports.NotificationType0 = vscode_jsonrpc_1.NotificationType0;\r
-exports.MessageReader = vscode_jsonrpc_1.MessageReader;\r
-exports.MessageWriter = vscode_jsonrpc_1.MessageWriter;\r
-exports.ConnectionStrategy = vscode_jsonrpc_1.ConnectionStrategy;\r
-exports.StreamMessageReader = vscode_jsonrpc_1.StreamMessageReader;\r
-exports.StreamMessageWriter = vscode_jsonrpc_1.StreamMessageWriter;\r
-exports.IPCMessageReader = vscode_jsonrpc_1.IPCMessageReader;\r
-exports.IPCMessageWriter = vscode_jsonrpc_1.IPCMessageWriter;\r
-exports.createClientPipeTransport = vscode_jsonrpc_1.createClientPipeTransport;\r
-exports.createServerPipeTransport = vscode_jsonrpc_1.createServerPipeTransport;\r
-exports.generateRandomPipeName = vscode_jsonrpc_1.generateRandomPipeName;\r
-exports.createClientSocketTransport = vscode_jsonrpc_1.createClientSocketTransport;\r
-exports.createServerSocketTransport = vscode_jsonrpc_1.createServerSocketTransport;\r
-exports.ProgressType = vscode_jsonrpc_1.ProgressType;\r
-__export(__webpack_require__(175));\r
-__export(__webpack_require__(176));\r
-const callHierarchy = __webpack_require__(188);\r
-const st = __webpack_require__(189);\r
-var Proposed;\r
-(function (Proposed) {\r
- let CallHierarchyPrepareRequest;\r
- (function (CallHierarchyPrepareRequest) {\r
- CallHierarchyPrepareRequest.method = callHierarchy.CallHierarchyPrepareRequest.method;\r
- CallHierarchyPrepareRequest.type = callHierarchy.CallHierarchyPrepareRequest.type;\r
- })(CallHierarchyPrepareRequest = Proposed.CallHierarchyPrepareRequest || (Proposed.CallHierarchyPrepareRequest = {}));\r
- let CallHierarchyIncomingCallsRequest;\r
- (function (CallHierarchyIncomingCallsRequest) {\r
- CallHierarchyIncomingCallsRequest.method = callHierarchy.CallHierarchyIncomingCallsRequest.method;\r
- CallHierarchyIncomingCallsRequest.type = callHierarchy.CallHierarchyIncomingCallsRequest.type;\r
- })(CallHierarchyIncomingCallsRequest = Proposed.CallHierarchyIncomingCallsRequest || (Proposed.CallHierarchyIncomingCallsRequest = {}));\r
- let CallHierarchyOutgoingCallsRequest;\r
- (function (CallHierarchyOutgoingCallsRequest) {\r
- CallHierarchyOutgoingCallsRequest.method = callHierarchy.CallHierarchyOutgoingCallsRequest.method;\r
- CallHierarchyOutgoingCallsRequest.type = callHierarchy.CallHierarchyOutgoingCallsRequest.type;\r
- })(CallHierarchyOutgoingCallsRequest = Proposed.CallHierarchyOutgoingCallsRequest || (Proposed.CallHierarchyOutgoingCallsRequest = {}));\r
- Proposed.SemanticTokenTypes = st.SemanticTokenTypes;\r
- Proposed.SemanticTokenModifiers = st.SemanticTokenModifiers;\r
- Proposed.SemanticTokens = st.SemanticTokens;\r
- let SemanticTokensRequest;\r
- (function (SemanticTokensRequest) {\r
- SemanticTokensRequest.method = st.SemanticTokensRequest.method;\r
- SemanticTokensRequest.type = st.SemanticTokensRequest.type;\r
- })(SemanticTokensRequest = Proposed.SemanticTokensRequest || (Proposed.SemanticTokensRequest = {}));\r
- let SemanticTokensEditsRequest;\r
- (function (SemanticTokensEditsRequest) {\r
- SemanticTokensEditsRequest.method = st.SemanticTokensEditsRequest.method;\r
- SemanticTokensEditsRequest.type = st.SemanticTokensEditsRequest.type;\r
- })(SemanticTokensEditsRequest = Proposed.SemanticTokensEditsRequest || (Proposed.SemanticTokensEditsRequest = {}));\r
- let SemanticTokensRangeRequest;\r
- (function (SemanticTokensRangeRequest) {\r
- SemanticTokensRangeRequest.method = st.SemanticTokensRangeRequest.method;\r
- SemanticTokensRangeRequest.type = st.SemanticTokensRangeRequest.type;\r
- })(SemanticTokensRangeRequest = Proposed.SemanticTokensRangeRequest || (Proposed.SemanticTokensRangeRequest = {}));\r
-})(Proposed = exports.Proposed || (exports.Proposed = {}));\r
-function createProtocolConnection(reader, writer, logger, strategy) {\r
- return vscode_jsonrpc_1.createMessageConnection(reader, writer, logger, strategy);\r
-}\r
-exports.createProtocolConnection = createProtocolConnection;\r
-
-
-/***/ }),
-/* 163 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/* --------------------------------------------------------------------------------------------\r
- * Copyright (c) Microsoft Corporation. All rights reserved.\r
- * Licensed under the MIT License. See License.txt in the project root for license information.\r
- * ------------------------------------------------------------------------------------------ */\r
-/// <reference path="../typings/thenable.d.ts" />\r
-\r
-function __export(m) {\r
- for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\r
-}\r
-Object.defineProperty(exports, "__esModule", { value: true });\r
-const Is = __webpack_require__(164);\r
-const messages_1 = __webpack_require__(165);\r
-exports.RequestType = messages_1.RequestType;\r
-exports.RequestType0 = messages_1.RequestType0;\r
-exports.RequestType1 = messages_1.RequestType1;\r
-exports.RequestType2 = messages_1.RequestType2;\r
-exports.RequestType3 = messages_1.RequestType3;\r
-exports.RequestType4 = messages_1.RequestType4;\r
-exports.RequestType5 = messages_1.RequestType5;\r
-exports.RequestType6 = messages_1.RequestType6;\r
-exports.RequestType7 = messages_1.RequestType7;\r
-exports.RequestType8 = messages_1.RequestType8;\r
-exports.RequestType9 = messages_1.RequestType9;\r
-exports.ResponseError = messages_1.ResponseError;\r
-exports.ErrorCodes = messages_1.ErrorCodes;\r
-exports.NotificationType = messages_1.NotificationType;\r
-exports.NotificationType0 = messages_1.NotificationType0;\r
-exports.NotificationType1 = messages_1.NotificationType1;\r
-exports.NotificationType2 = messages_1.NotificationType2;\r
-exports.NotificationType3 = messages_1.NotificationType3;\r
-exports.NotificationType4 = messages_1.NotificationType4;\r
-exports.NotificationType5 = messages_1.NotificationType5;\r
-exports.NotificationType6 = messages_1.NotificationType6;\r
-exports.NotificationType7 = messages_1.NotificationType7;\r
-exports.NotificationType8 = messages_1.NotificationType8;\r
-exports.NotificationType9 = messages_1.NotificationType9;\r
-const messageReader_1 = __webpack_require__(166);\r
-exports.MessageReader = messageReader_1.MessageReader;\r
-exports.StreamMessageReader = messageReader_1.StreamMessageReader;\r
-exports.IPCMessageReader = messageReader_1.IPCMessageReader;\r
-exports.SocketMessageReader = messageReader_1.SocketMessageReader;\r
-const messageWriter_1 = __webpack_require__(168);\r
-exports.MessageWriter = messageWriter_1.MessageWriter;\r
-exports.StreamMessageWriter = messageWriter_1.StreamMessageWriter;\r
-exports.IPCMessageWriter = messageWriter_1.IPCMessageWriter;\r
-exports.SocketMessageWriter = messageWriter_1.SocketMessageWriter;\r
-const events_1 = __webpack_require__(167);\r
-exports.Disposable = events_1.Disposable;\r
-exports.Event = events_1.Event;\r
-exports.Emitter = events_1.Emitter;\r
-const cancellation_1 = __webpack_require__(169);\r
-exports.CancellationTokenSource = cancellation_1.CancellationTokenSource;\r
-exports.CancellationToken = cancellation_1.CancellationToken;\r
-const linkedMap_1 = __webpack_require__(170);\r
-__export(__webpack_require__(171));\r
-__export(__webpack_require__(174));\r
-var CancelNotification;\r
-(function (CancelNotification) {\r
- CancelNotification.type = new messages_1.NotificationType('$/cancelRequest');\r
-})(CancelNotification || (CancelNotification = {}));\r
-var ProgressNotification;\r
-(function (ProgressNotification) {\r
- ProgressNotification.type = new messages_1.NotificationType('$/progress');\r
-})(ProgressNotification || (ProgressNotification = {}));\r
-class ProgressType {\r
- constructor() {\r
- }\r
-}\r
-exports.ProgressType = ProgressType;\r
-exports.NullLogger = Object.freeze({\r
- error: () => { },\r
- warn: () => { },\r
- info: () => { },\r
- log: () => { }\r
-});\r
-var Trace;\r
-(function (Trace) {\r
- Trace[Trace["Off"] = 0] = "Off";\r
- Trace[Trace["Messages"] = 1] = "Messages";\r
- Trace[Trace["Verbose"] = 2] = "Verbose";\r
-})(Trace = exports.Trace || (exports.Trace = {}));\r
-(function (Trace) {\r
- function fromString(value) {\r
- if (!Is.string(value)) {\r
- return Trace.Off;\r
- }\r
- value = value.toLowerCase();\r
- switch (value) {\r
- case 'off':\r
- return Trace.Off;\r
- case 'messages':\r
- return Trace.Messages;\r
- case 'verbose':\r
- return Trace.Verbose;\r
- default:\r
- return Trace.Off;\r
- }\r
- }\r
- Trace.fromString = fromString;\r
- function toString(value) {\r
- switch (value) {\r
- case Trace.Off:\r
- return 'off';\r
- case Trace.Messages:\r
- return 'messages';\r
- case Trace.Verbose:\r
- return 'verbose';\r
- default:\r
- return 'off';\r
- }\r
- }\r
- Trace.toString = toString;\r
-})(Trace = exports.Trace || (exports.Trace = {}));\r
-var TraceFormat;\r
-(function (TraceFormat) {\r
- TraceFormat["Text"] = "text";\r
- TraceFormat["JSON"] = "json";\r
-})(TraceFormat = exports.TraceFormat || (exports.TraceFormat = {}));\r
-(function (TraceFormat) {\r
- function fromString(value) {\r
- value = value.toLowerCase();\r
- if (value === 'json') {\r
- return TraceFormat.JSON;\r
- }\r
- else {\r
- return TraceFormat.Text;\r
- }\r
- }\r
- TraceFormat.fromString = fromString;\r
-})(TraceFormat = exports.TraceFormat || (exports.TraceFormat = {}));\r
-var SetTraceNotification;\r
-(function (SetTraceNotification) {\r
- SetTraceNotification.type = new messages_1.NotificationType('$/setTraceNotification');\r
-})(SetTraceNotification = exports.SetTraceNotification || (exports.SetTraceNotification = {}));\r
-var LogTraceNotification;\r
-(function (LogTraceNotification) {\r
- LogTraceNotification.type = new messages_1.NotificationType('$/logTraceNotification');\r
-})(LogTraceNotification = exports.LogTraceNotification || (exports.LogTraceNotification = {}));\r
-var ConnectionErrors;\r
-(function (ConnectionErrors) {\r
- /**\r
- * The connection is closed.\r
- */\r
- ConnectionErrors[ConnectionErrors["Closed"] = 1] = "Closed";\r
- /**\r
- * The connection got disposed.\r
- */\r
- ConnectionErrors[ConnectionErrors["Disposed"] = 2] = "Disposed";\r
- /**\r
- * The connection is already in listening mode.\r
- */\r
- ConnectionErrors[ConnectionErrors["AlreadyListening"] = 3] = "AlreadyListening";\r
-})(ConnectionErrors = exports.ConnectionErrors || (exports.ConnectionErrors = {}));\r
-class ConnectionError extends Error {\r
- constructor(code, message) {\r
- super(message);\r
- this.code = code;\r
- Object.setPrototypeOf(this, ConnectionError.prototype);\r
- }\r
-}\r
-exports.ConnectionError = ConnectionError;\r
-var ConnectionStrategy;\r
-(function (ConnectionStrategy) {\r
- function is(value) {\r
- let candidate = value;\r
- return candidate && Is.func(candidate.cancelUndispatched);\r
- }\r
- ConnectionStrategy.is = is;\r
-})(ConnectionStrategy = exports.ConnectionStrategy || (exports.ConnectionStrategy = {}));\r
-var ConnectionState;\r
-(function (ConnectionState) {\r
- ConnectionState[ConnectionState["New"] = 1] = "New";\r
- ConnectionState[ConnectionState["Listening"] = 2] = "Listening";\r
- ConnectionState[ConnectionState["Closed"] = 3] = "Closed";\r
- ConnectionState[ConnectionState["Disposed"] = 4] = "Disposed";\r
-})(ConnectionState || (ConnectionState = {}));\r
-function _createMessageConnection(messageReader, messageWriter, logger, strategy) {\r
- let sequenceNumber = 0;\r
- let notificationSquenceNumber = 0;\r
- let unknownResponseSquenceNumber = 0;\r
- const version = '2.0';\r
- let starRequestHandler = undefined;\r
- let requestHandlers = Object.create(null);\r
- let starNotificationHandler = undefined;\r
- let notificationHandlers = Object.create(null);\r
- let progressHandlers = new Map();\r
- let timer;\r
- let messageQueue = new linkedMap_1.LinkedMap();\r
- let responsePromises = Object.create(null);\r
- let requestTokens = Object.create(null);\r
- let trace = Trace.Off;\r
- let traceFormat = TraceFormat.Text;\r
- let tracer;\r
- let state = ConnectionState.New;\r
- let errorEmitter = new events_1.Emitter();\r
- let closeEmitter = new events_1.Emitter();\r
- let unhandledNotificationEmitter = new events_1.Emitter();\r
- let unhandledProgressEmitter = new events_1.Emitter();\r
- let disposeEmitter = new events_1.Emitter();\r
- function createRequestQueueKey(id) {\r
- return 'req-' + id.toString();\r
- }\r
- function createResponseQueueKey(id) {\r
- if (id === null) {\r
- return 'res-unknown-' + (++unknownResponseSquenceNumber).toString();\r
- }\r
- else {\r
- return 'res-' + id.toString();\r
- }\r
- }\r
- function createNotificationQueueKey() {\r
- return 'not-' + (++notificationSquenceNumber).toString();\r
- }\r
- function addMessageToQueue(queue, message) {\r
- if (messages_1.isRequestMessage(message)) {\r
- queue.set(createRequestQueueKey(message.id), message);\r
- }\r
- else if (messages_1.isResponseMessage(message)) {\r
- queue.set(createResponseQueueKey(message.id), message);\r
- }\r
- else {\r
- queue.set(createNotificationQueueKey(), message);\r
- }\r
- }\r
- function cancelUndispatched(_message) {\r
- return undefined;\r
- }\r
- function isListening() {\r
- return state === ConnectionState.Listening;\r
- }\r
- function isClosed() {\r
- return state === ConnectionState.Closed;\r
- }\r
- function isDisposed() {\r
- return state === ConnectionState.Disposed;\r
- }\r
- function closeHandler() {\r
- if (state === ConnectionState.New || state === ConnectionState.Listening) {\r
- state = ConnectionState.Closed;\r
- closeEmitter.fire(undefined);\r
- }\r
- // If the connection is disposed don't sent close events.\r
- }\r
- function readErrorHandler(error) {\r
- errorEmitter.fire([error, undefined, undefined]);\r
- }\r
- function writeErrorHandler(data) {\r
- errorEmitter.fire(data);\r
- }\r
- messageReader.onClose(closeHandler);\r
- messageReader.onError(readErrorHandler);\r
- messageWriter.onClose(closeHandler);\r
- messageWriter.onError(writeErrorHandler);\r
- function triggerMessageQueue() {\r
- if (timer || messageQueue.size === 0) {\r
- return;\r
- }\r
- timer = setImmediate(() => {\r
- timer = undefined;\r
- processMessageQueue();\r
- });\r
- }\r
- function processMessageQueue() {\r
- if (messageQueue.size === 0) {\r
- return;\r
- }\r
- let message = messageQueue.shift();\r
- try {\r
- if (messages_1.isRequestMessage(message)) {\r
- handleRequest(message);\r
- }\r
- else if (messages_1.isNotificationMessage(message)) {\r
- handleNotification(message);\r
- }\r
- else if (messages_1.isResponseMessage(message)) {\r
- handleResponse(message);\r
- }\r
- else {\r
- handleInvalidMessage(message);\r
- }\r
- }\r
- finally {\r
- triggerMessageQueue();\r
- }\r
- }\r
- let callback = (message) => {\r
- try {\r
- // We have received a cancellation message. Check if the message is still in the queue\r
- // and cancel it if allowed to do so.\r
- if (messages_1.isNotificationMessage(message) && message.method === CancelNotification.type.method) {\r
- let key = createRequestQueueKey(message.params.id);\r
- let toCancel = messageQueue.get(key);\r
- if (messages_1.isRequestMessage(toCancel)) {\r
- let response = strategy && strategy.cancelUndispatched ? strategy.cancelUndispatched(toCancel, cancelUndispatched) : cancelUndispatched(toCancel);\r
- if (response && (response.error !== void 0 || response.result !== void 0)) {\r
- messageQueue.delete(key);\r
- response.id = toCancel.id;\r
- traceSendingResponse(response, message.method, Date.now());\r
- messageWriter.write(response);\r
- return;\r
- }\r
- }\r
- }\r
- addMessageToQueue(messageQueue, message);\r
- }\r
- finally {\r
- triggerMessageQueue();\r
- }\r
- };\r
- function handleRequest(requestMessage) {\r
- if (isDisposed()) {\r
- // we return here silently since we fired an event when the\r
- // connection got disposed.\r
- return;\r
- }\r
- function reply(resultOrError, method, startTime) {\r
- let message = {\r
- jsonrpc: version,\r
- id: requestMessage.id\r
- };\r
- if (resultOrError instanceof messages_1.ResponseError) {\r
- message.error = resultOrError.toJson();\r
- }\r
- else {\r
- message.result = resultOrError === void 0 ? null : resultOrError;\r
- }\r
- traceSendingResponse(message, method, startTime);\r
- messageWriter.write(message);\r
- }\r
- function replyError(error, method, startTime) {\r
- let message = {\r
- jsonrpc: version,\r
- id: requestMessage.id,\r
- error: error.toJson()\r
- };\r
- traceSendingResponse(message, method, startTime);\r
- messageWriter.write(message);\r
- }\r
- function replySuccess(result, method, startTime) {\r
- // The JSON RPC defines that a response must either have a result or an error\r
- // So we can't treat undefined as a valid response result.\r
- if (result === void 0) {\r
- result = null;\r
- }\r
- let message = {\r
- jsonrpc: version,\r
- id: requestMessage.id,\r
- result: result\r
- };\r
- traceSendingResponse(message, method, startTime);\r
- messageWriter.write(message);\r
- }\r
- traceReceivedRequest(requestMessage);\r
- let element = requestHandlers[requestMessage.method];\r
- let type;\r
- let requestHandler;\r
- if (element) {\r
- type = element.type;\r
- requestHandler = element.handler;\r
- }\r
- let startTime = Date.now();\r
- if (requestHandler || starRequestHandler) {\r
- let cancellationSource = new cancellation_1.CancellationTokenSource();\r
- let tokenKey = String(requestMessage.id);\r
- requestTokens[tokenKey] = cancellationSource;\r
- try {\r
- let handlerResult;\r
- if (requestMessage.params === void 0 || (type !== void 0 && type.numberOfParams === 0)) {\r
- handlerResult = requestHandler\r
- ? requestHandler(cancellationSource.token)\r
- : starRequestHandler(requestMessage.method, cancellationSource.token);\r
- }\r
- else if (Is.array(requestMessage.params) && (type === void 0 || type.numberOfParams > 1)) {\r
- handlerResult = requestHandler\r
- ? requestHandler(...requestMessage.params, cancellationSource.token)\r
- : starRequestHandler(requestMessage.method, ...requestMessage.params, cancellationSource.token);\r
- }\r
- else {\r
- handlerResult = requestHandler\r
- ? requestHandler(requestMessage.params, cancellationSource.token)\r
- : starRequestHandler(requestMessage.method, requestMessage.params, cancellationSource.token);\r
- }\r
- let promise = handlerResult;\r
- if (!handlerResult) {\r
- delete requestTokens[tokenKey];\r
- replySuccess(handlerResult, requestMessage.method, startTime);\r
- }\r
- else if (promise.then) {\r
- promise.then((resultOrError) => {\r
- delete requestTokens[tokenKey];\r
- reply(resultOrError, requestMessage.method, startTime);\r
- }, error => {\r
- delete requestTokens[tokenKey];\r
- if (error instanceof messages_1.ResponseError) {\r
- replyError(error, requestMessage.method, startTime);\r
- }\r
- else if (error && Is.string(error.message)) {\r
- replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InternalError, `Request ${requestMessage.method} failed with message: ${error.message}`), requestMessage.method, startTime);\r
- }\r
- else {\r
- replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InternalError, `Request ${requestMessage.method} failed unexpectedly without providing any details.`), requestMessage.method, startTime);\r
- }\r
- });\r
- }\r
- else {\r
- delete requestTokens[tokenKey];\r
- reply(handlerResult, requestMessage.method, startTime);\r
- }\r
- }\r
- catch (error) {\r
- delete requestTokens[tokenKey];\r
- if (error instanceof messages_1.ResponseError) {\r
- reply(error, requestMessage.method, startTime);\r
- }\r
- else if (error && Is.string(error.message)) {\r
- replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InternalError, `Request ${requestMessage.method} failed with message: ${error.message}`), requestMessage.method, startTime);\r
- }\r
- else {\r
- replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InternalError, `Request ${requestMessage.method} failed unexpectedly without providing any details.`), requestMessage.method, startTime);\r
- }\r
- }\r
- }\r
- else {\r
- replyError(new messages_1.ResponseError(messages_1.ErrorCodes.MethodNotFound, `Unhandled method ${requestMessage.method}`), requestMessage.method, startTime);\r
- }\r
- }\r
- function handleResponse(responseMessage) {\r
- if (isDisposed()) {\r
- // See handle request.\r
- return;\r
- }\r
- if (responseMessage.id === null) {\r
- if (responseMessage.error) {\r
- logger.error(`Received response message without id: Error is: \n${JSON.stringify(responseMessage.error, undefined, 4)}`);\r
- }\r
- else {\r
- logger.error(`Received response message without id. No further error information provided.`);\r
- }\r
- }\r
- else {\r
- let key = String(responseMessage.id);\r
- let responsePromise = responsePromises[key];\r
- traceReceivedResponse(responseMessage, responsePromise);\r
- if (responsePromise) {\r
- delete responsePromises[key];\r
- try {\r
- if (responseMessage.error) {\r
- let error = responseMessage.error;\r
- responsePromise.reject(new messages_1.ResponseError(error.code, error.message, error.data));\r
- }\r
- else if (responseMessage.result !== void 0) {\r
- responsePromise.resolve(responseMessage.result);\r
- }\r
- else {\r
- throw new Error('Should never happen.');\r
- }\r
- }\r
- catch (error) {\r
- if (error.message) {\r
- logger.error(`Response handler '${responsePromise.method}' failed with message: ${error.message}`);\r
- }\r
- else {\r
- logger.error(`Response handler '${responsePromise.method}' failed unexpectedly.`);\r
- }\r
- }\r
- }\r
- }\r
- }\r
- function handleNotification(message) {\r
- if (isDisposed()) {\r
- // See handle request.\r
- return;\r
- }\r
- let type = undefined;\r
- let notificationHandler;\r
- if (message.method === CancelNotification.type.method) {\r
- notificationHandler = (params) => {\r
- let id = params.id;\r
- let source = requestTokens[String(id)];\r
- if (source) {\r
- source.cancel();\r
- }\r
- };\r
- }\r
- else {\r
- let element = notificationHandlers[message.method];\r
- if (element) {\r
- notificationHandler = element.handler;\r
- type = element.type;\r
- }\r
- }\r
- if (notificationHandler || starNotificationHandler) {\r
- try {\r
- traceReceivedNotification(message);\r
- if (message.params === void 0 || (type !== void 0 && type.numberOfParams === 0)) {\r
- notificationHandler ? notificationHandler() : starNotificationHandler(message.method);\r
- }\r
- else if (Is.array(message.params) && (type === void 0 || type.numberOfParams > 1)) {\r
- notificationHandler ? notificationHandler(...message.params) : starNotificationHandler(message.method, ...message.params);\r
- }\r
- else {\r
- notificationHandler ? notificationHandler(message.params) : starNotificationHandler(message.method, message.params);\r
- }\r
- }\r
- catch (error) {\r
- if (error.message) {\r
- logger.error(`Notification handler '${message.method}' failed with message: ${error.message}`);\r
- }\r
- else {\r
- logger.error(`Notification handler '${message.method}' failed unexpectedly.`);\r
- }\r
- }\r
- }\r
- else {\r
- unhandledNotificationEmitter.fire(message);\r
- }\r
- }\r
- function handleInvalidMessage(message) {\r
- if (!message) {\r
- logger.error('Received empty message.');\r
- return;\r
- }\r
- logger.error(`Received message which is neither a response nor a notification message:\n${JSON.stringify(message, null, 4)}`);\r
- // Test whether we find an id to reject the promise\r
- let responseMessage = message;\r
- if (Is.string(responseMessage.id) || Is.number(responseMessage.id)) {\r
- let key = String(responseMessage.id);\r
- let responseHandler = responsePromises[key];\r
- if (responseHandler) {\r
- responseHandler.reject(new Error('The received response has neither a result nor an error property.'));\r
- }\r
- }\r
- }\r
- function traceSendingRequest(message) {\r
- if (trace === Trace.Off || !tracer) {\r
- return;\r
- }\r
- if (traceFormat === TraceFormat.Text) {\r
- let data = undefined;\r
- if (trace === Trace.Verbose && message.params) {\r
- data = `Params: ${JSON.stringify(message.params, null, 4)}\n\n`;\r
- }\r
- tracer.log(`Sending request '${message.method} - (${message.id})'.`, data);\r
- }\r
- else {\r
- logLSPMessage('send-request', message);\r
- }\r
- }\r
- function traceSendingNotification(message) {\r
- if (trace === Trace.Off || !tracer) {\r
- return;\r
- }\r
- if (traceFormat === TraceFormat.Text) {\r
- let data = undefined;\r
- if (trace === Trace.Verbose) {\r
- if (message.params) {\r
- data = `Params: ${JSON.stringify(message.params, null, 4)}\n\n`;\r
- }\r
- else {\r
- data = 'No parameters provided.\n\n';\r
- }\r
- }\r
- tracer.log(`Sending notification '${message.method}'.`, data);\r
- }\r
- else {\r
- logLSPMessage('send-notification', message);\r
- }\r
- }\r
- function traceSendingResponse(message, method, startTime) {\r
- if (trace === Trace.Off || !tracer) {\r
- return;\r
- }\r
- if (traceFormat === TraceFormat.Text) {\r
- let data = undefined;\r
- if (trace === Trace.Verbose) {\r
- if (message.error && message.error.data) {\r
- data = `Error data: ${JSON.stringify(message.error.data, null, 4)}\n\n`;\r
- }\r
- else {\r
- if (message.result) {\r
- data = `Result: ${JSON.stringify(message.result, null, 4)}\n\n`;\r
- }\r
- else if (message.error === void 0) {\r
- data = 'No result returned.\n\n';\r
- }\r
- }\r
- }\r
- tracer.log(`Sending response '${method} - (${message.id})'. Processing request took ${Date.now() - startTime}ms`, data);\r
- }\r
- else {\r
- logLSPMessage('send-response', message);\r
- }\r
- }\r
- function traceReceivedRequest(message) {\r
- if (trace === Trace.Off || !tracer) {\r
- return;\r
- }\r
- if (traceFormat === TraceFormat.Text) {\r
- let data = undefined;\r
- if (trace === Trace.Verbose && message.params) {\r
- data = `Params: ${JSON.stringify(message.params, null, 4)}\n\n`;\r
- }\r
- tracer.log(`Received request '${message.method} - (${message.id})'.`, data);\r
- }\r
- else {\r
- logLSPMessage('receive-request', message);\r
- }\r
- }\r
- function traceReceivedNotification(message) {\r
- if (trace === Trace.Off || !tracer || message.method === LogTraceNotification.type.method) {\r
- return;\r
- }\r
- if (traceFormat === TraceFormat.Text) {\r
- let data = undefined;\r
- if (trace === Trace.Verbose) {\r
- if (message.params) {\r
- data = `Params: ${JSON.stringify(message.params, null, 4)}\n\n`;\r
- }\r
- else {\r
- data = 'No parameters provided.\n\n';\r
- }\r
- }\r
- tracer.log(`Received notification '${message.method}'.`, data);\r
- }\r
- else {\r
- logLSPMessage('receive-notification', message);\r
- }\r
- }\r
- function traceReceivedResponse(message, responsePromise) {\r
- if (trace === Trace.Off || !tracer) {\r
- return;\r
- }\r
- if (traceFormat === TraceFormat.Text) {\r
- let data = undefined;\r
- if (trace === Trace.Verbose) {\r
- if (message.error && message.error.data) {\r
- data = `Error data: ${JSON.stringify(message.error.data, null, 4)}\n\n`;\r
- }\r
- else {\r
- if (message.result) {\r
- data = `Result: ${JSON.stringify(message.result, null, 4)}\n\n`;\r
- }\r
- else if (message.error === void 0) {\r
- data = 'No result returned.\n\n';\r
- }\r
- }\r
- }\r
- if (responsePromise) {\r
- let error = message.error ? ` Request failed: ${message.error.message} (${message.error.code}).` : '';\r
- tracer.log(`Received response '${responsePromise.method} - (${message.id})' in ${Date.now() - responsePromise.timerStart}ms.${error}`, data);\r
- }\r
- else {\r
- tracer.log(`Received response ${message.id} without active response promise.`, data);\r
- }\r
- }\r
- else {\r
- logLSPMessage('receive-response', message);\r
- }\r
- }\r
- function logLSPMessage(type, message) {\r
- if (!tracer || trace === Trace.Off) {\r
- return;\r
- }\r
- const lspMessage = {\r
- isLSPMessage: true,\r
- type,\r
- message,\r
- timestamp: Date.now()\r
- };\r
- tracer.log(lspMessage);\r
- }\r
- function throwIfClosedOrDisposed() {\r
- if (isClosed()) {\r
- throw new ConnectionError(ConnectionErrors.Closed, 'Connection is closed.');\r
- }\r
- if (isDisposed()) {\r
- throw new ConnectionError(ConnectionErrors.Disposed, 'Connection is disposed.');\r
- }\r
- }\r
- function throwIfListening() {\r
- if (isListening()) {\r
- throw new ConnectionError(ConnectionErrors.AlreadyListening, 'Connection is already listening');\r
- }\r
- }\r
- function throwIfNotListening() {\r
- if (!isListening()) {\r
- throw new Error('Call listen() first.');\r
- }\r
- }\r
- function undefinedToNull(param) {\r
- if (param === void 0) {\r
- return null;\r
- }\r
- else {\r
- return param;\r
- }\r
- }\r
- function computeMessageParams(type, params) {\r
- let result;\r
- let numberOfParams = type.numberOfParams;\r
- switch (numberOfParams) {\r
- case 0:\r
- result = null;\r
- break;\r
- case 1:\r
- result = undefinedToNull(params[0]);\r
- break;\r
- default:\r
- result = [];\r
- for (let i = 0; i < params.length && i < numberOfParams; i++) {\r
- result.push(undefinedToNull(params[i]));\r
- }\r
- if (params.length < numberOfParams) {\r
- for (let i = params.length; i < numberOfParams; i++) {\r
- result.push(null);\r
- }\r
- }\r
- break;\r
- }\r
- return result;\r
- }\r
- let connection = {\r
- sendNotification: (type, ...params) => {\r
- throwIfClosedOrDisposed();\r
- let method;\r
- let messageParams;\r
- if (Is.string(type)) {\r
- method = type;\r
- switch (params.length) {\r
- case 0:\r
- messageParams = null;\r
- break;\r
- case 1:\r
- messageParams = params[0];\r
- break;\r
- default:\r
- messageParams = params;\r
- break;\r
- }\r
- }\r
- else {\r
- method = type.method;\r
- messageParams = computeMessageParams(type, params);\r
- }\r
- let notificationMessage = {\r
- jsonrpc: version,\r
- method: method,\r
- params: messageParams\r
- };\r
- traceSendingNotification(notificationMessage);\r
- messageWriter.write(notificationMessage);\r
- },\r
- onNotification: (type, handler) => {\r
- throwIfClosedOrDisposed();\r
- if (Is.func(type)) {\r
- starNotificationHandler = type;\r
- }\r
- else if (handler) {\r
- if (Is.string(type)) {\r
- notificationHandlers[type] = { type: undefined, handler };\r
- }\r
- else {\r
- notificationHandlers[type.method] = { type, handler };\r
- }\r
- }\r
- },\r
- onProgress: (_type, token, handler) => {\r
- if (progressHandlers.has(token)) {\r
- throw new Error(`Progress handler for token ${token} already registered`);\r
- }\r
- progressHandlers.set(token, handler);\r
- return {\r
- dispose: () => {\r
- progressHandlers.delete(token);\r
- }\r
- };\r
- },\r
- sendProgress: (_type, token, value) => {\r
- connection.sendNotification(ProgressNotification.type, { token, value });\r
- },\r
- onUnhandledProgress: unhandledProgressEmitter.event,\r
- sendRequest: (type, ...params) => {\r
- throwIfClosedOrDisposed();\r
- throwIfNotListening();\r
- let method;\r
- let messageParams;\r
- let token = undefined;\r
- if (Is.string(type)) {\r
- method = type;\r
- switch (params.length) {\r
- case 0:\r
- messageParams = null;\r
- break;\r
- case 1:\r
- // The cancellation token is optional so it can also be undefined.\r
- if (cancellation_1.CancellationToken.is(params[0])) {\r
- messageParams = null;\r
- token = params[0];\r
- }\r
- else {\r
- messageParams = undefinedToNull(params[0]);\r
- }\r
- break;\r
- default:\r
- const last = params.length - 1;\r
- if (cancellation_1.CancellationToken.is(params[last])) {\r
- token = params[last];\r
- if (params.length === 2) {\r
- messageParams = undefinedToNull(params[0]);\r
- }\r
- else {\r
- messageParams = params.slice(0, last).map(value => undefinedToNull(value));\r
- }\r
- }\r
- else {\r
- messageParams = params.map(value => undefinedToNull(value));\r
- }\r
- break;\r
- }\r
- }\r
- else {\r
- method = type.method;\r
- messageParams = computeMessageParams(type, params);\r
- let numberOfParams = type.numberOfParams;\r
- token = cancellation_1.CancellationToken.is(params[numberOfParams]) ? params[numberOfParams] : undefined;\r
- }\r
- let id = sequenceNumber++;\r
- let result = new Promise((resolve, reject) => {\r
- let requestMessage = {\r
- jsonrpc: version,\r
- id: id,\r
- method: method,\r
- params: messageParams\r
- };\r
- let responsePromise = { method: method, timerStart: Date.now(), resolve, reject };\r
- traceSendingRequest(requestMessage);\r
- try {\r
- messageWriter.write(requestMessage);\r
- }\r
- catch (e) {\r
- // Writing the message failed. So we need to reject the promise.\r
- responsePromise.reject(new messages_1.ResponseError(messages_1.ErrorCodes.MessageWriteError, e.message ? e.message : 'Unknown reason'));\r
- responsePromise = null;\r
- }\r
- if (responsePromise) {\r
- responsePromises[String(id)] = responsePromise;\r
- }\r
- });\r
- if (token) {\r
- token.onCancellationRequested(() => {\r
- connection.sendNotification(CancelNotification.type, { id });\r
- });\r
- }\r
- return result;\r
- },\r
- onRequest: (type, handler) => {\r
- throwIfClosedOrDisposed();\r
- if (Is.func(type)) {\r
- starRequestHandler = type;\r
- }\r
- else if (handler) {\r
- if (Is.string(type)) {\r
- requestHandlers[type] = { type: undefined, handler };\r
- }\r
- else {\r
- requestHandlers[type.method] = { type, handler };\r
- }\r
- }\r
- },\r
- trace: (_value, _tracer, sendNotificationOrTraceOptions) => {\r
- let _sendNotification = false;\r
- let _traceFormat = TraceFormat.Text;\r
- if (sendNotificationOrTraceOptions !== void 0) {\r
- if (Is.boolean(sendNotificationOrTraceOptions)) {\r
- _sendNotification = sendNotificationOrTraceOptions;\r
- }\r
- else {\r
- _sendNotification = sendNotificationOrTraceOptions.sendNotification || false;\r
- _traceFormat = sendNotificationOrTraceOptions.traceFormat || TraceFormat.Text;\r
- }\r
- }\r
- trace = _value;\r
- traceFormat = _traceFormat;\r
- if (trace === Trace.Off) {\r
- tracer = undefined;\r
- }\r
- else {\r
- tracer = _tracer;\r
- }\r
- if (_sendNotification && !isClosed() && !isDisposed()) {\r
- connection.sendNotification(SetTraceNotification.type, { value: Trace.toString(_value) });\r
- }\r
- },\r
- onError: errorEmitter.event,\r
- onClose: closeEmitter.event,\r
- onUnhandledNotification: unhandledNotificationEmitter.event,\r
- onDispose: disposeEmitter.event,\r
- dispose: () => {\r
- if (isDisposed()) {\r
- return;\r
- }\r
- state = ConnectionState.Disposed;\r
- disposeEmitter.fire(undefined);\r
- let error = new Error('Connection got disposed.');\r
- Object.keys(responsePromises).forEach((key) => {\r
- responsePromises[key].reject(error);\r
- });\r
- responsePromises = Object.create(null);\r
- requestTokens = Object.create(null);\r
- messageQueue = new linkedMap_1.LinkedMap();\r
- // Test for backwards compatibility\r
- if (Is.func(messageWriter.dispose)) {\r
- messageWriter.dispose();\r
- }\r
- if (Is.func(messageReader.dispose)) {\r
- messageReader.dispose();\r
- }\r
- },\r
- listen: () => {\r
- throwIfClosedOrDisposed();\r
- throwIfListening();\r
- state = ConnectionState.Listening;\r
- messageReader.listen(callback);\r
- },\r
- inspect: () => {\r
- // eslint-disable-next-line no-console\r
- console.log('inspect');\r
- }\r
- };\r
- connection.onNotification(LogTraceNotification.type, (params) => {\r
- if (trace === Trace.Off || !tracer) {\r
- return;\r
- }\r
- tracer.log(params.message, trace === Trace.Verbose ? params.verbose : undefined);\r
- });\r
- connection.onNotification(ProgressNotification.type, (params) => {\r
- const handler = progressHandlers.get(params.token);\r
- if (handler) {\r
- handler(params.value);\r
- }\r
- else {\r
- unhandledProgressEmitter.fire(params);\r
- }\r
- });\r
- return connection;\r
-}\r
-function isMessageReader(value) {\r
- return value.listen !== void 0 && value.read === void 0;\r
-}\r
-function isMessageWriter(value) {\r
- return value.write !== void 0 && value.end === void 0;\r
-}\r
-function createMessageConnection(input, output, logger, strategy) {\r
- if (!logger) {\r
- logger = exports.NullLogger;\r
- }\r
- let reader = isMessageReader(input) ? input : new messageReader_1.StreamMessageReader(input);\r
- let writer = isMessageWriter(output) ? output : new messageWriter_1.StreamMessageWriter(output);\r
- return _createMessageConnection(reader, writer, logger, strategy);\r
-}\r
-exports.createMessageConnection = createMessageConnection;\r
-
-
-/***/ }),
-/* 164 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/* --------------------------------------------------------------------------------------------\r
- * Copyright (c) Microsoft Corporation. All rights reserved.\r
- * Licensed under the MIT License. See License.txt in the project root for license information.\r
- * ------------------------------------------------------------------------------------------ */\r
-\r
-Object.defineProperty(exports, "__esModule", { value: true });\r
-function boolean(value) {\r
- return value === true || value === false;\r
-}\r
-exports.boolean = boolean;\r
-function string(value) {\r
- return typeof value === 'string' || value instanceof String;\r
-}\r
-exports.string = string;\r
-function number(value) {\r
- return typeof value === 'number' || value instanceof Number;\r
-}\r
-exports.number = number;\r
-function error(value) {\r
- return value instanceof Error;\r
-}\r
-exports.error = error;\r
-function func(value) {\r
- return typeof value === 'function';\r
-}\r
-exports.func = func;\r
-function array(value) {\r
- return Array.isArray(value);\r
-}\r
-exports.array = array;\r
-function stringArray(value) {\r
- return array(value) && value.every(elem => string(elem));\r
-}\r
-exports.stringArray = stringArray;\r
-
-
-/***/ }),
-/* 165 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/* --------------------------------------------------------------------------------------------\r
- * Copyright (c) Microsoft Corporation. All rights reserved.\r
- * Licensed under the MIT License. See License.txt in the project root for license information.\r
- * ------------------------------------------------------------------------------------------ */\r
-\r
-Object.defineProperty(exports, "__esModule", { value: true });\r
-const is = __webpack_require__(164);\r
-/**\r
- * Predefined error codes.\r
- */\r
-var ErrorCodes;\r
-(function (ErrorCodes) {\r
- // Defined by JSON RPC\r
- ErrorCodes.ParseError = -32700;\r
- ErrorCodes.InvalidRequest = -32600;\r
- ErrorCodes.MethodNotFound = -32601;\r
- ErrorCodes.InvalidParams = -32602;\r
- ErrorCodes.InternalError = -32603;\r
- ErrorCodes.serverErrorStart = -32099;\r
- ErrorCodes.serverErrorEnd = -32000;\r
- ErrorCodes.ServerNotInitialized = -32002;\r
- ErrorCodes.UnknownErrorCode = -32001;\r
- // Defined by the protocol.\r
- ErrorCodes.RequestCancelled = -32800;\r
- ErrorCodes.ContentModified = -32801;\r
- // Defined by VSCode library.\r
- ErrorCodes.MessageWriteError = 1;\r
- ErrorCodes.MessageReadError = 2;\r
-})(ErrorCodes = exports.ErrorCodes || (exports.ErrorCodes = {}));\r
-/**\r
- * An error object return in a response in case a request\r
- * has failed.\r
- */\r
-class ResponseError extends Error {\r
- constructor(code, message, data) {\r
- super(message);\r
- this.code = is.number(code) ? code : ErrorCodes.UnknownErrorCode;\r
- this.data = data;\r
- Object.setPrototypeOf(this, ResponseError.prototype);\r
- }\r
- toJson() {\r
- return {\r
- code: this.code,\r
- message: this.message,\r
- data: this.data,\r
- };\r
- }\r
-}\r
-exports.ResponseError = ResponseError;\r
-/**\r
- * An abstract implementation of a MessageType.\r
- */\r
-class AbstractMessageType {\r
- constructor(_method, _numberOfParams) {\r
- this._method = _method;\r
- this._numberOfParams = _numberOfParams;\r
- }\r
- get method() {\r
- return this._method;\r
- }\r
- get numberOfParams() {\r
- return this._numberOfParams;\r
- }\r
-}\r
-exports.AbstractMessageType = AbstractMessageType;\r
-/**\r
- * Classes to type request response pairs\r
- *\r
- * The type parameter RO will be removed in the next major version\r
- * of the JSON RPC library since it is a LSP concept and doesn't\r
- * belong here. For now it is tagged as default never.\r
- */\r
-class RequestType0 extends AbstractMessageType {\r
- constructor(method) {\r
- super(method, 0);\r
- }\r
-}\r
-exports.RequestType0 = RequestType0;\r
-class RequestType extends AbstractMessageType {\r
- constructor(method) {\r
- super(method, 1);\r
- }\r
-}\r
-exports.RequestType = RequestType;\r
-class RequestType1 extends AbstractMessageType {\r
- constructor(method) {\r
- super(method, 1);\r
- }\r
-}\r
-exports.RequestType1 = RequestType1;\r
-class RequestType2 extends AbstractMessageType {\r
- constructor(method) {\r
- super(method, 2);\r
- }\r
-}\r
-exports.RequestType2 = RequestType2;\r
-class RequestType3 extends AbstractMessageType {\r
- constructor(method) {\r
- super(method, 3);\r
- }\r
-}\r
-exports.RequestType3 = RequestType3;\r
-class RequestType4 extends AbstractMessageType {\r
- constructor(method) {\r
- super(method, 4);\r
- }\r
-}\r
-exports.RequestType4 = RequestType4;\r
-class RequestType5 extends AbstractMessageType {\r
- constructor(method) {\r
- super(method, 5);\r
- }\r
-}\r
-exports.RequestType5 = RequestType5;\r
-class RequestType6 extends AbstractMessageType {\r
- constructor(method) {\r
- super(method, 6);\r
- }\r
-}\r
-exports.RequestType6 = RequestType6;\r
-class RequestType7 extends AbstractMessageType {\r
- constructor(method) {\r
- super(method, 7);\r
- }\r
-}\r
-exports.RequestType7 = RequestType7;\r
-class RequestType8 extends AbstractMessageType {\r
- constructor(method) {\r
- super(method, 8);\r
- }\r
-}\r
-exports.RequestType8 = RequestType8;\r
-class RequestType9 extends AbstractMessageType {\r
- constructor(method) {\r
- super(method, 9);\r
- }\r
-}\r
-exports.RequestType9 = RequestType9;\r
-/**\r
- * The type parameter RO will be removed in the next major version\r
- * of the JSON RPC library since it is a LSP concept and doesn't\r
- * belong here. For now it is tagged as default never.\r
- */\r
-class NotificationType extends AbstractMessageType {\r
- constructor(method) {\r
- super(method, 1);\r
- this._ = undefined;\r
- }\r
-}\r
-exports.NotificationType = NotificationType;\r
-class NotificationType0 extends AbstractMessageType {\r
- constructor(method) {\r
- super(method, 0);\r
- }\r
-}\r
-exports.NotificationType0 = NotificationType0;\r
-class NotificationType1 extends AbstractMessageType {\r
- constructor(method) {\r
- super(method, 1);\r
- }\r
-}\r
-exports.NotificationType1 = NotificationType1;\r
-class NotificationType2 extends AbstractMessageType {\r
- constructor(method) {\r
- super(method, 2);\r
- }\r
-}\r
-exports.NotificationType2 = NotificationType2;\r
-class NotificationType3 extends AbstractMessageType {\r
- constructor(method) {\r
- super(method, 3);\r
- }\r
-}\r
-exports.NotificationType3 = NotificationType3;\r
-class NotificationType4 extends AbstractMessageType {\r
- constructor(method) {\r
- super(method, 4);\r
- }\r
-}\r
-exports.NotificationType4 = NotificationType4;\r
-class NotificationType5 extends AbstractMessageType {\r
- constructor(method) {\r
- super(method, 5);\r
- }\r
-}\r
-exports.NotificationType5 = NotificationType5;\r
-class NotificationType6 extends AbstractMessageType {\r
- constructor(method) {\r
- super(method, 6);\r
- }\r
-}\r
-exports.NotificationType6 = NotificationType6;\r
-class NotificationType7 extends AbstractMessageType {\r
- constructor(method) {\r
- super(method, 7);\r
- }\r
-}\r
-exports.NotificationType7 = NotificationType7;\r
-class NotificationType8 extends AbstractMessageType {\r
- constructor(method) {\r
- super(method, 8);\r
- }\r
-}\r
-exports.NotificationType8 = NotificationType8;\r
-class NotificationType9 extends AbstractMessageType {\r
- constructor(method) {\r
- super(method, 9);\r
- }\r
-}\r
-exports.NotificationType9 = NotificationType9;\r
-/**\r
- * Tests if the given message is a request message\r
- */\r
-function isRequestMessage(message) {\r
- let candidate = message;\r
- return candidate && is.string(candidate.method) && (is.string(candidate.id) || is.number(candidate.id));\r
-}\r
-exports.isRequestMessage = isRequestMessage;\r
-/**\r
- * Tests if the given message is a notification message\r
- */\r
-function isNotificationMessage(message) {\r
- let candidate = message;\r
- return candidate && is.string(candidate.method) && message.id === void 0;\r
-}\r
-exports.isNotificationMessage = isNotificationMessage;\r
-/**\r
- * Tests if the given message is a response message\r
- */\r
-function isResponseMessage(message) {\r
- let candidate = message;\r
- return candidate && (candidate.result !== void 0 || !!candidate.error) && (is.string(candidate.id) || is.number(candidate.id) || candidate.id === null);\r
-}\r
-exports.isResponseMessage = isResponseMessage;\r
-
-
-/***/ }),
-/* 166 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/* --------------------------------------------------------------------------------------------\r
- * Copyright (c) Microsoft Corporation. All rights reserved.\r
- * Licensed under the MIT License. See License.txt in the project root for license information.\r
- * ------------------------------------------------------------------------------------------ */\r
-\r
-Object.defineProperty(exports, "__esModule", { value: true });\r
-const events_1 = __webpack_require__(167);\r
-const Is = __webpack_require__(164);\r
-let DefaultSize = 8192;\r
-let CR = Buffer.from('\r', 'ascii')[0];\r
-let LF = Buffer.from('\n', 'ascii')[0];\r
-let CRLF = '\r\n';\r
-class MessageBuffer {\r
- constructor(encoding = 'utf8') {\r
- this.encoding = encoding;\r
- this.index = 0;\r
- this.buffer = Buffer.allocUnsafe(DefaultSize);\r
- }\r
- append(chunk) {\r
- var toAppend = chunk;\r
- if (typeof (chunk) === 'string') {\r
- var str = chunk;\r
- var bufferLen = Buffer.byteLength(str, this.encoding);\r
- toAppend = Buffer.allocUnsafe(bufferLen);\r
- toAppend.write(str, 0, bufferLen, this.encoding);\r
- }\r
- if (this.buffer.length - this.index >= toAppend.length) {\r
- toAppend.copy(this.buffer, this.index, 0, toAppend.length);\r
- }\r
- else {\r
- var newSize = (Math.ceil((this.index + toAppend.length) / DefaultSize) + 1) * DefaultSize;\r
- if (this.index === 0) {\r
- this.buffer = Buffer.allocUnsafe(newSize);\r
- toAppend.copy(this.buffer, 0, 0, toAppend.length);\r
- }\r
- else {\r
- this.buffer = Buffer.concat([this.buffer.slice(0, this.index), toAppend], newSize);\r
- }\r
- }\r
- this.index += toAppend.length;\r
- }\r
- tryReadHeaders() {\r
- let result = undefined;\r
- let current = 0;\r
- while (current + 3 < this.index && (this.buffer[current] !== CR || this.buffer[current + 1] !== LF || this.buffer[current + 2] !== CR || this.buffer[current + 3] !== LF)) {\r
- current++;\r
- }\r
- // No header / body separator found (e.g CRLFCRLF)\r
- if (current + 3 >= this.index) {\r
- return result;\r
- }\r
- result = Object.create(null);\r
- let headers = this.buffer.toString('ascii', 0, current).split(CRLF);\r
- headers.forEach((header) => {\r
- let index = header.indexOf(':');\r
- if (index === -1) {\r
- throw new Error('Message header must separate key and value using :');\r
- }\r
- let key = header.substr(0, index);\r
- let value = header.substr(index + 1).trim();\r
- result[key] = value;\r
- });\r
- let nextStart = current + 4;\r
- this.buffer = this.buffer.slice(nextStart);\r
- this.index = this.index - nextStart;\r
- return result;\r
- }\r
- tryReadContent(length) {\r
- if (this.index < length) {\r
- return null;\r
- }\r
- let result = this.buffer.toString(this.encoding, 0, length);\r
- let nextStart = length;\r
- this.buffer.copy(this.buffer, 0, nextStart);\r
- this.index = this.index - nextStart;\r
- return result;\r
- }\r
- get numberOfBytes() {\r
- return this.index;\r
- }\r
-}\r
-var MessageReader;\r
-(function (MessageReader) {\r
- function is(value) {\r
- let candidate = value;\r
- return candidate && Is.func(candidate.listen) && Is.func(candidate.dispose) &&\r
- Is.func(candidate.onError) && Is.func(candidate.onClose) && Is.func(candidate.onPartialMessage);\r
- }\r
- MessageReader.is = is;\r
-})(MessageReader = exports.MessageReader || (exports.MessageReader = {}));\r
-class AbstractMessageReader {\r
- constructor() {\r
- this.errorEmitter = new events_1.Emitter();\r
- this.closeEmitter = new events_1.Emitter();\r
- this.partialMessageEmitter = new events_1.Emitter();\r
- }\r
- dispose() {\r
- this.errorEmitter.dispose();\r
- this.closeEmitter.dispose();\r
- }\r
- get onError() {\r
- return this.errorEmitter.event;\r
- }\r
- fireError(error) {\r
- this.errorEmitter.fire(this.asError(error));\r
- }\r
- get onClose() {\r
- return this.closeEmitter.event;\r
- }\r
- fireClose() {\r
- this.closeEmitter.fire(undefined);\r
- }\r
- get onPartialMessage() {\r
- return this.partialMessageEmitter.event;\r
- }\r
- firePartialMessage(info) {\r
- this.partialMessageEmitter.fire(info);\r
- }\r
- asError(error) {\r
- if (error instanceof Error) {\r
- return error;\r
- }\r
- else {\r
- return new Error(`Reader received error. Reason: ${Is.string(error.message) ? error.message : 'unknown'}`);\r
- }\r
- }\r
-}\r
-exports.AbstractMessageReader = AbstractMessageReader;\r
-class StreamMessageReader extends AbstractMessageReader {\r
- constructor(readable, encoding = 'utf8') {\r
- super();\r
- this.readable = readable;\r
- this.buffer = new MessageBuffer(encoding);\r
- this._partialMessageTimeout = 10000;\r
- }\r
- set partialMessageTimeout(timeout) {\r
- this._partialMessageTimeout = timeout;\r
- }\r
- get partialMessageTimeout() {\r
- return this._partialMessageTimeout;\r
- }\r
- listen(callback) {\r
- this.nextMessageLength = -1;\r
- this.messageToken = 0;\r
- this.partialMessageTimer = undefined;\r
- this.callback = callback;\r
- this.readable.on('data', (data) => {\r
- this.onData(data);\r
- });\r
- this.readable.on('error', (error) => this.fireError(error));\r
- this.readable.on('close', () => this.fireClose());\r
- }\r
- onData(data) {\r
- this.buffer.append(data);\r
- while (true) {\r
- if (this.nextMessageLength === -1) {\r
- let headers = this.buffer.tryReadHeaders();\r
- if (!headers) {\r
- return;\r
- }\r
- let contentLength = headers['Content-Length'];\r
- if (!contentLength) {\r
- throw new Error('Header must provide a Content-Length property.');\r
- }\r
- let length = parseInt(contentLength);\r
- if (isNaN(length)) {\r
- throw new Error('Content-Length value must be a number.');\r
- }\r
- this.nextMessageLength = length;\r
- // Take the encoding form the header. For compatibility\r
- // treat both utf-8 and utf8 as node utf8\r
- }\r
- var msg = this.buffer.tryReadContent(this.nextMessageLength);\r
- if (msg === null) {\r
- /** We haven't received the full message yet. */\r
- this.setPartialMessageTimer();\r
- return;\r
- }\r
- this.clearPartialMessageTimer();\r
- this.nextMessageLength = -1;\r
- this.messageToken++;\r
- var json = JSON.parse(msg);\r
- this.callback(json);\r
- }\r
- }\r
- clearPartialMessageTimer() {\r
- if (this.partialMessageTimer) {\r
- clearTimeout(this.partialMessageTimer);\r
- this.partialMessageTimer = undefined;\r
- }\r
- }\r
- setPartialMessageTimer() {\r
- this.clearPartialMessageTimer();\r
- if (this._partialMessageTimeout <= 0) {\r
- return;\r
- }\r
- this.partialMessageTimer = setTimeout((token, timeout) => {\r
- this.partialMessageTimer = undefined;\r
- if (token === this.messageToken) {\r
- this.firePartialMessage({ messageToken: token, waitingTime: timeout });\r
- this.setPartialMessageTimer();\r
- }\r
- }, this._partialMessageTimeout, this.messageToken, this._partialMessageTimeout);\r
- }\r
-}\r
-exports.StreamMessageReader = StreamMessageReader;\r
-class IPCMessageReader extends AbstractMessageReader {\r
- constructor(process) {\r
- super();\r
- this.process = process;\r
- let eventEmitter = this.process;\r
- eventEmitter.on('error', (error) => this.fireError(error));\r
- eventEmitter.on('close', () => this.fireClose());\r
- }\r
- listen(callback) {\r
- this.process.on('message', callback);\r
- }\r
-}\r
-exports.IPCMessageReader = IPCMessageReader;\r
-class SocketMessageReader extends StreamMessageReader {\r
- constructor(socket, encoding = 'utf-8') {\r
- super(socket, encoding);\r
- }\r
-}\r
-exports.SocketMessageReader = SocketMessageReader;\r
-
-
-/***/ }),
-/* 167 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/* --------------------------------------------------------------------------------------------\r
- * Copyright (c) Microsoft Corporation. All rights reserved.\r
- * Licensed under the MIT License. See License.txt in the project root for license information.\r
- * ------------------------------------------------------------------------------------------ */\r
-\r
-Object.defineProperty(exports, "__esModule", { value: true });\r
-var Disposable;\r
-(function (Disposable) {\r
- function create(func) {\r
- return {\r
- dispose: func\r
- };\r
- }\r
- Disposable.create = create;\r
-})(Disposable = exports.Disposable || (exports.Disposable = {}));\r
-var Event;\r
-(function (Event) {\r
- const _disposable = { dispose() { } };\r
- Event.None = function () { return _disposable; };\r
-})(Event = exports.Event || (exports.Event = {}));\r
-class CallbackList {\r
- add(callback, context = null, bucket) {\r
- if (!this._callbacks) {\r
- this._callbacks = [];\r
- this._contexts = [];\r
- }\r
- this._callbacks.push(callback);\r
- this._contexts.push(context);\r
- if (Array.isArray(bucket)) {\r
- bucket.push({ dispose: () => this.remove(callback, context) });\r
- }\r
- }\r
- remove(callback, context = null) {\r
- if (!this._callbacks) {\r
- return;\r
- }\r
- var foundCallbackWithDifferentContext = false;\r
- for (var i = 0, len = this._callbacks.length; i < len; i++) {\r
- if (this._callbacks[i] === callback) {\r
- if (this._contexts[i] === context) {\r
- // callback & context match => remove it\r
- this._callbacks.splice(i, 1);\r
- this._contexts.splice(i, 1);\r
- return;\r
- }\r
- else {\r
- foundCallbackWithDifferentContext = true;\r
- }\r
- }\r
- }\r
- if (foundCallbackWithDifferentContext) {\r
- throw new Error('When adding a listener with a context, you should remove it with the same context');\r
- }\r
- }\r
- invoke(...args) {\r
- if (!this._callbacks) {\r
- return [];\r
- }\r
- var ret = [], callbacks = this._callbacks.slice(0), contexts = this._contexts.slice(0);\r
- for (var i = 0, len = callbacks.length; i < len; i++) {\r
- try {\r
- ret.push(callbacks[i].apply(contexts[i], args));\r
- }\r
- catch (e) {\r
- // eslint-disable-next-line no-console\r
- console.error(e);\r
- }\r
- }\r
- return ret;\r
- }\r
- isEmpty() {\r
- return !this._callbacks || this._callbacks.length === 0;\r
- }\r
- dispose() {\r
- this._callbacks = undefined;\r
- this._contexts = undefined;\r
- }\r
-}\r
-class Emitter {\r
- constructor(_options) {\r
- this._options = _options;\r
- }\r
- /**\r
- * For the public to allow to subscribe\r
- * to events from this Emitter\r
- */\r
- get event() {\r
- if (!this._event) {\r
- this._event = (listener, thisArgs, disposables) => {\r
- if (!this._callbacks) {\r
- this._callbacks = new CallbackList();\r
- }\r
- if (this._options && this._options.onFirstListenerAdd && this._callbacks.isEmpty()) {\r
- this._options.onFirstListenerAdd(this);\r
- }\r
- this._callbacks.add(listener, thisArgs);\r
- let result;\r
- result = {\r
- dispose: () => {\r
- this._callbacks.remove(listener, thisArgs);\r
- result.dispose = Emitter._noop;\r
- if (this._options && this._options.onLastListenerRemove && this._callbacks.isEmpty()) {\r
- this._options.onLastListenerRemove(this);\r
- }\r
- }\r
- };\r
- if (Array.isArray(disposables)) {\r
- disposables.push(result);\r
- }\r
- return result;\r
- };\r
- }\r
- return this._event;\r
- }\r
- /**\r
- * To be kept private to fire an event to\r
- * subscribers\r
- */\r
- fire(event) {\r
- if (this._callbacks) {\r
- this._callbacks.invoke.call(this._callbacks, event);\r
- }\r
- }\r
- dispose() {\r
- if (this._callbacks) {\r
- this._callbacks.dispose();\r
- this._callbacks = undefined;\r
- }\r
- }\r
-}\r
-exports.Emitter = Emitter;\r
-Emitter._noop = function () { };\r
-
-
-/***/ }),
-/* 168 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/* --------------------------------------------------------------------------------------------\r
- * Copyright (c) Microsoft Corporation. All rights reserved.\r
- * Licensed under the MIT License. See License.txt in the project root for license information.\r
- * ------------------------------------------------------------------------------------------ */\r
-\r
-Object.defineProperty(exports, "__esModule", { value: true });\r
-const events_1 = __webpack_require__(167);\r
-const Is = __webpack_require__(164);\r
-let ContentLength = 'Content-Length: ';\r
-let CRLF = '\r\n';\r
-var MessageWriter;\r
-(function (MessageWriter) {\r
- function is(value) {\r
- let candidate = value;\r
- return candidate && Is.func(candidate.dispose) && Is.func(candidate.onClose) &&\r
- Is.func(candidate.onError) && Is.func(candidate.write);\r
- }\r
- MessageWriter.is = is;\r
-})(MessageWriter = exports.MessageWriter || (exports.MessageWriter = {}));\r
-class AbstractMessageWriter {\r
- constructor() {\r
- this.errorEmitter = new events_1.Emitter();\r
- this.closeEmitter = new events_1.Emitter();\r
- }\r
- dispose() {\r
- this.errorEmitter.dispose();\r
- this.closeEmitter.dispose();\r
- }\r
- get onError() {\r
- return this.errorEmitter.event;\r
- }\r
- fireError(error, message, count) {\r
- this.errorEmitter.fire([this.asError(error), message, count]);\r
- }\r
- get onClose() {\r
- return this.closeEmitter.event;\r
- }\r
- fireClose() {\r
- this.closeEmitter.fire(undefined);\r
- }\r
- asError(error) {\r
- if (error instanceof Error) {\r
- return error;\r
- }\r
- else {\r
- return new Error(`Writer received error. Reason: ${Is.string(error.message) ? error.message : 'unknown'}`);\r
- }\r
- }\r
-}\r
-exports.AbstractMessageWriter = AbstractMessageWriter;\r
-class StreamMessageWriter extends AbstractMessageWriter {\r
- constructor(writable, encoding = 'utf8') {\r
- super();\r
- this.writable = writable;\r
- this.encoding = encoding;\r
- this.errorCount = 0;\r
- this.writable.on('error', (error) => this.fireError(error));\r
- this.writable.on('close', () => this.fireClose());\r
- }\r
- write(msg) {\r
- let json = JSON.stringify(msg);\r
- let contentLength = Buffer.byteLength(json, this.encoding);\r
- let headers = [\r
- ContentLength, contentLength.toString(), CRLF,\r
- CRLF\r
- ];\r
- try {\r
- // Header must be written in ASCII encoding\r
- this.writable.write(headers.join(''), 'ascii');\r
- // Now write the content. This can be written in any encoding\r
- this.writable.write(json, this.encoding);\r
- this.errorCount = 0;\r
- }\r
- catch (error) {\r
- this.errorCount++;\r
- this.fireError(error, msg, this.errorCount);\r
- }\r
- }\r
-}\r
-exports.StreamMessageWriter = StreamMessageWriter;\r
-class IPCMessageWriter extends AbstractMessageWriter {\r
- constructor(process) {\r
- super();\r
- this.process = process;\r
- this.errorCount = 0;\r
- this.queue = [];\r
- this.sending = false;\r
- let eventEmitter = this.process;\r
- eventEmitter.on('error', (error) => this.fireError(error));\r
- eventEmitter.on('close', () => this.fireClose);\r
- }\r
- write(msg) {\r
- if (!this.sending && this.queue.length === 0) {\r
- // See https://github.com/nodejs/node/issues/7657\r
- this.doWriteMessage(msg);\r
- }\r
- else {\r
- this.queue.push(msg);\r
- }\r
- }\r
- doWriteMessage(msg) {\r
- try {\r
- if (this.process.send) {\r
- this.sending = true;\r
- this.process.send(msg, undefined, undefined, (error) => {\r
- this.sending = false;\r
- if (error) {\r
- this.errorCount++;\r
- this.fireError(error, msg, this.errorCount);\r
- }\r
- else {\r
- this.errorCount = 0;\r
- }\r
- if (this.queue.length > 0) {\r
- this.doWriteMessage(this.queue.shift());\r
- }\r
- });\r
- }\r
- }\r
- catch (error) {\r
- this.errorCount++;\r
- this.fireError(error, msg, this.errorCount);\r
- }\r
- }\r
-}\r
-exports.IPCMessageWriter = IPCMessageWriter;\r
-class SocketMessageWriter extends AbstractMessageWriter {\r
- constructor(socket, encoding = 'utf8') {\r
- super();\r
- this.socket = socket;\r
- this.queue = [];\r
- this.sending = false;\r
- this.encoding = encoding;\r
- this.errorCount = 0;\r
- this.socket.on('error', (error) => this.fireError(error));\r
- this.socket.on('close', () => this.fireClose());\r
- }\r
- dispose() {\r
- super.dispose();\r
- this.socket.destroy();\r
- }\r
- write(msg) {\r
- if (!this.sending && this.queue.length === 0) {\r
- // See https://github.com/nodejs/node/issues/7657\r
- this.doWriteMessage(msg);\r
- }\r
- else {\r
- this.queue.push(msg);\r
- }\r
- }\r
- doWriteMessage(msg) {\r
- let json = JSON.stringify(msg);\r
- let contentLength = Buffer.byteLength(json, this.encoding);\r
- let headers = [\r
- ContentLength, contentLength.toString(), CRLF,\r
- CRLF\r
- ];\r
- try {\r
- // Header must be written in ASCII encoding\r
- this.sending = true;\r
- this.socket.write(headers.join(''), 'ascii', (error) => {\r
- if (error) {\r
- this.handleError(error, msg);\r
- }\r
- try {\r
- // Now write the content. This can be written in any encoding\r
- this.socket.write(json, this.encoding, (error) => {\r
- this.sending = false;\r
- if (error) {\r
- this.handleError(error, msg);\r
- }\r
- else {\r
- this.errorCount = 0;\r
- }\r
- if (this.queue.length > 0) {\r
- this.doWriteMessage(this.queue.shift());\r
- }\r
- });\r
- }\r
- catch (error) {\r
- this.handleError(error, msg);\r
- }\r
- });\r
- }\r
- catch (error) {\r
- this.handleError(error, msg);\r
- }\r
- }\r
- handleError(error, msg) {\r
- this.errorCount++;\r
- this.fireError(error, msg, this.errorCount);\r
- }\r
-}\r
-exports.SocketMessageWriter = SocketMessageWriter;\r
-
-
-/***/ }),
-/* 169 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/*---------------------------------------------------------------------------------------------\r
- * Copyright (c) Microsoft Corporation. All rights reserved.\r
- * Licensed under the MIT License. See License.txt in the project root for license information.\r
- *--------------------------------------------------------------------------------------------*/\r
-\r
-Object.defineProperty(exports, "__esModule", { value: true });\r
-const events_1 = __webpack_require__(167);\r
-const Is = __webpack_require__(164);\r
-var CancellationToken;\r
-(function (CancellationToken) {\r
- CancellationToken.None = Object.freeze({\r
- isCancellationRequested: false,\r
- onCancellationRequested: events_1.Event.None\r
- });\r
- CancellationToken.Cancelled = Object.freeze({\r
- isCancellationRequested: true,\r
- onCancellationRequested: events_1.Event.None\r
- });\r
- function is(value) {\r
- let candidate = value;\r
- return candidate && (candidate === CancellationToken.None\r
- || candidate === CancellationToken.Cancelled\r
- || (Is.boolean(candidate.isCancellationRequested) && !!candidate.onCancellationRequested));\r
- }\r
- CancellationToken.is = is;\r
-})(CancellationToken = exports.CancellationToken || (exports.CancellationToken = {}));\r
-const shortcutEvent = Object.freeze(function (callback, context) {\r
- let handle = setTimeout(callback.bind(context), 0);\r
- return { dispose() { clearTimeout(handle); } };\r
-});\r
-class MutableToken {\r
- constructor() {\r
- this._isCancelled = false;\r
- }\r
- cancel() {\r
- if (!this._isCancelled) {\r
- this._isCancelled = true;\r
- if (this._emitter) {\r
- this._emitter.fire(undefined);\r
- this.dispose();\r
- }\r
- }\r
- }\r
- get isCancellationRequested() {\r
- return this._isCancelled;\r
- }\r
- get onCancellationRequested() {\r
- if (this._isCancelled) {\r
- return shortcutEvent;\r
- }\r
- if (!this._emitter) {\r
- this._emitter = new events_1.Emitter();\r
- }\r
- return this._emitter.event;\r
- }\r
- dispose() {\r
- if (this._emitter) {\r
- this._emitter.dispose();\r
- this._emitter = undefined;\r
- }\r
- }\r
-}\r
-class CancellationTokenSource {\r
- get token() {\r
- if (!this._token) {\r
- // be lazy and create the token only when\r
- // actually needed\r
- this._token = new MutableToken();\r
- }\r
- return this._token;\r
- }\r
- cancel() {\r
- if (!this._token) {\r
- // save an object by returning the default\r
- // cancelled token when cancellation happens\r
- // before someone asks for the token\r
- this._token = CancellationToken.Cancelled;\r
- }\r
- else {\r
- this._token.cancel();\r
- }\r
- }\r
- dispose() {\r
- if (!this._token) {\r
- // ensure to initialize with an empty token if we had none\r
- this._token = CancellationToken.None;\r
- }\r
- else if (this._token instanceof MutableToken) {\r
- // actually dispose\r
- this._token.dispose();\r
- }\r
- }\r
-}\r
-exports.CancellationTokenSource = CancellationTokenSource;\r
-
-
-/***/ }),
-/* 170 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-\r
-/*---------------------------------------------------------------------------------------------\r
- * Copyright (c) Microsoft Corporation. All rights reserved.\r
- * Licensed under the MIT License. See License.txt in the project root for license information.\r
- *--------------------------------------------------------------------------------------------*/\r
-Object.defineProperty(exports, "__esModule", { value: true });\r
-var Touch;\r
-(function (Touch) {\r
- Touch.None = 0;\r
- Touch.First = 1;\r
- Touch.Last = 2;\r
-})(Touch = exports.Touch || (exports.Touch = {}));\r
-class LinkedMap {\r
- constructor() {\r
- this._map = new Map();\r
- this._head = undefined;\r
- this._tail = undefined;\r
- this._size = 0;\r
- }\r
- clear() {\r
- this._map.clear();\r
- this._head = undefined;\r
- this._tail = undefined;\r
- this._size = 0;\r
- }\r
- isEmpty() {\r
- return !this._head && !this._tail;\r
- }\r
- get size() {\r
- return this._size;\r
- }\r
- has(key) {\r
- return this._map.has(key);\r
- }\r
- get(key) {\r
- const item = this._map.get(key);\r
- if (!item) {\r
- return undefined;\r
- }\r
- return item.value;\r
- }\r
- set(key, value, touch = Touch.None) {\r
- let item = this._map.get(key);\r
- if (item) {\r
- item.value = value;\r
- if (touch !== Touch.None) {\r
- this.touch(item, touch);\r
- }\r
- }\r
- else {\r
- item = { key, value, next: undefined, previous: undefined };\r
- switch (touch) {\r
- case Touch.None:\r
- this.addItemLast(item);\r
- break;\r
- case Touch.First:\r
- this.addItemFirst(item);\r
- break;\r
- case Touch.Last:\r
- this.addItemLast(item);\r
- break;\r
- default:\r
- this.addItemLast(item);\r
- break;\r
- }\r
- this._map.set(key, item);\r
- this._size++;\r
- }\r
- }\r
- delete(key) {\r
- const item = this._map.get(key);\r
- if (!item) {\r
- return false;\r
- }\r
- this._map.delete(key);\r
- this.removeItem(item);\r
- this._size--;\r
- return true;\r
- }\r
- shift() {\r
- if (!this._head && !this._tail) {\r
- return undefined;\r
- }\r
- if (!this._head || !this._tail) {\r
- throw new Error('Invalid list');\r
- }\r
- const item = this._head;\r
- this._map.delete(item.key);\r
- this.removeItem(item);\r
- this._size--;\r
- return item.value;\r
- }\r
- forEach(callbackfn, thisArg) {\r
- let current = this._head;\r
- while (current) {\r
- if (thisArg) {\r
- callbackfn.bind(thisArg)(current.value, current.key, this);\r
- }\r
- else {\r
- callbackfn(current.value, current.key, this);\r
- }\r
- current = current.next;\r
- }\r
- }\r
- forEachReverse(callbackfn, thisArg) {\r
- let current = this._tail;\r
- while (current) {\r
- if (thisArg) {\r
- callbackfn.bind(thisArg)(current.value, current.key, this);\r
- }\r
- else {\r
- callbackfn(current.value, current.key, this);\r
- }\r
- current = current.previous;\r
- }\r
- }\r
- values() {\r
- let result = [];\r
- let current = this._head;\r
- while (current) {\r
- result.push(current.value);\r
- current = current.next;\r
- }\r
- return result;\r
- }\r
- keys() {\r
- let result = [];\r
- let current = this._head;\r
- while (current) {\r
- result.push(current.key);\r
- current = current.next;\r
- }\r
- return result;\r
- }\r
- /* JSON RPC run on es5 which has no Symbol.iterator\r
- public keys(): IterableIterator<K> {\r
- let current = this._head;\r
- let iterator: IterableIterator<K> = {\r
- [Symbol.iterator]() {\r
- return iterator;\r
- },\r
- next():IteratorResult<K> {\r
- if (current) {\r
- let result = { value: current.key, done: false };\r
- current = current.next;\r
- return result;\r
- } else {\r
- return { value: undefined, done: true };\r
- }\r
- }\r
- };\r
- return iterator;\r
- }\r
-\r
- public values(): IterableIterator<V> {\r
- let current = this._head;\r
- let iterator: IterableIterator<V> = {\r
- [Symbol.iterator]() {\r
- return iterator;\r
- },\r
- next():IteratorResult<V> {\r
- if (current) {\r
- let result = { value: current.value, done: false };\r
- current = current.next;\r
- return result;\r
- } else {\r
- return { value: undefined, done: true };\r
- }\r
- }\r
- };\r
- return iterator;\r
- }\r
- */\r
- addItemFirst(item) {\r
- // First time Insert\r
- if (!this._head && !this._tail) {\r
- this._tail = item;\r
- }\r
- else if (!this._head) {\r
- throw new Error('Invalid list');\r
- }\r
- else {\r
- item.next = this._head;\r
- this._head.previous = item;\r
- }\r
- this._head = item;\r
- }\r
- addItemLast(item) {\r
- // First time Insert\r
- if (!this._head && !this._tail) {\r
- this._head = item;\r
- }\r
- else if (!this._tail) {\r
- throw new Error('Invalid list');\r
- }\r
- else {\r
- item.previous = this._tail;\r
- this._tail.next = item;\r
- }\r
- this._tail = item;\r
- }\r
- removeItem(item) {\r
- if (item === this._head && item === this._tail) {\r
- this._head = undefined;\r
- this._tail = undefined;\r
- }\r
- else if (item === this._head) {\r
- this._head = item.next;\r
- }\r
- else if (item === this._tail) {\r
- this._tail = item.previous;\r
- }\r
- else {\r
- const next = item.next;\r
- const previous = item.previous;\r
- if (!next || !previous) {\r
- throw new Error('Invalid list');\r
- }\r
- next.previous = previous;\r
- previous.next = next;\r
- }\r
- }\r
- touch(item, touch) {\r
- if (!this._head || !this._tail) {\r
- throw new Error('Invalid list');\r
- }\r
- if ((touch !== Touch.First && touch !== Touch.Last)) {\r
- return;\r
- }\r
- if (touch === Touch.First) {\r
- if (item === this._head) {\r
- return;\r
- }\r
- const next = item.next;\r
- const previous = item.previous;\r
- // Unlink the item\r
- if (item === this._tail) {\r
- // previous must be defined since item was not head but is tail\r
- // So there are more than on item in the map\r
- previous.next = undefined;\r
- this._tail = previous;\r
- }\r
- else {\r
- // Both next and previous are not undefined since item was neither head nor tail.\r
- next.previous = previous;\r
- previous.next = next;\r
- }\r
- // Insert the node at head\r
- item.previous = undefined;\r
- item.next = this._head;\r
- this._head.previous = item;\r
- this._head = item;\r
- }\r
- else if (touch === Touch.Last) {\r
- if (item === this._tail) {\r
- return;\r
- }\r
- const next = item.next;\r
- const previous = item.previous;\r
- // Unlink the item.\r
- if (item === this._head) {\r
- // next must be defined since item was not tail but is head\r
- // So there are more than on item in the map\r
- next.previous = undefined;\r
- this._head = next;\r
- }\r
- else {\r
- // Both next and previous are not undefined since item was neither head nor tail.\r
- next.previous = previous;\r
- previous.next = next;\r
- }\r
- item.next = undefined;\r
- item.previous = this._tail;\r
- this._tail.next = item;\r
- this._tail = item;\r
- }\r
- }\r
-}\r
-exports.LinkedMap = LinkedMap;\r
-
-
-/***/ }),
-/* 171 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/* --------------------------------------------------------------------------------------------\r
- * Copyright (c) Microsoft Corporation. All rights reserved.\r
- * Licensed under the MIT License. See License.txt in the project root for license information.\r
- * ------------------------------------------------------------------------------------------ */\r
-\r
-Object.defineProperty(exports, "__esModule", { value: true });\r
-const path_1 = __webpack_require__(38);\r
-const os_1 = __webpack_require__(111);\r
-const crypto_1 = __webpack_require__(172);\r
-const net_1 = __webpack_require__(173);\r
-const messageReader_1 = __webpack_require__(166);\r
-const messageWriter_1 = __webpack_require__(168);\r
-function generateRandomPipeName() {\r
- const randomSuffix = crypto_1.randomBytes(21).toString('hex');\r
- if (process.platform === 'win32') {\r
- return `\\\\.\\pipe\\vscode-jsonrpc-${randomSuffix}-sock`;\r
- }\r
- else {\r
- // Mac/Unix: use socket file\r
- return path_1.join(os_1.tmpdir(), `vscode-${randomSuffix}.sock`);\r
- }\r
-}\r
-exports.generateRandomPipeName = generateRandomPipeName;\r
-function createClientPipeTransport(pipeName, encoding = 'utf-8') {\r
- let connectResolve;\r
- let connected = new Promise((resolve, _reject) => {\r
- connectResolve = resolve;\r
- });\r
- return new Promise((resolve, reject) => {\r
- let server = net_1.createServer((socket) => {\r
- server.close();\r
- connectResolve([\r
- new messageReader_1.SocketMessageReader(socket, encoding),\r
- new messageWriter_1.SocketMessageWriter(socket, encoding)\r
- ]);\r
- });\r
- server.on('error', reject);\r
- server.listen(pipeName, () => {\r
- server.removeListener('error', reject);\r
- resolve({\r
- onConnected: () => { return connected; }\r
- });\r
- });\r
- });\r
-}\r
-exports.createClientPipeTransport = createClientPipeTransport;\r
-function createServerPipeTransport(pipeName, encoding = 'utf-8') {\r
- const socket = net_1.createConnection(pipeName);\r
- return [\r
- new messageReader_1.SocketMessageReader(socket, encoding),\r
- new messageWriter_1.SocketMessageWriter(socket, encoding)\r
- ];\r
-}\r
-exports.createServerPipeTransport = createServerPipeTransport;\r
-
-
-/***/ }),
-/* 172 */
-/***/ (function(module, exports) {
-
-module.exports = require("crypto");
-
-/***/ }),
-/* 173 */
-/***/ (function(module, exports) {
-
-module.exports = require("net");
-
-/***/ }),
-/* 174 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/* --------------------------------------------------------------------------------------------\r
- * Copyright (c) Microsoft Corporation. All rights reserved.\r
- * Licensed under the MIT License. See License.txt in the project root for license information.\r
- * ------------------------------------------------------------------------------------------ */\r
-\r
-Object.defineProperty(exports, "__esModule", { value: true });\r
-const net_1 = __webpack_require__(173);\r
-const messageReader_1 = __webpack_require__(166);\r
-const messageWriter_1 = __webpack_require__(168);\r
-function createClientSocketTransport(port, encoding = 'utf-8') {\r
- let connectResolve;\r
- let connected = new Promise((resolve, _reject) => {\r
- connectResolve = resolve;\r
- });\r
- return new Promise((resolve, reject) => {\r
- let server = net_1.createServer((socket) => {\r
- server.close();\r
- connectResolve([\r
- new messageReader_1.SocketMessageReader(socket, encoding),\r
- new messageWriter_1.SocketMessageWriter(socket, encoding)\r
- ]);\r
- });\r
- server.on('error', reject);\r
- server.listen(port, '127.0.0.1', () => {\r
- server.removeListener('error', reject);\r
- resolve({\r
- onConnected: () => { return connected; }\r
- });\r
- });\r
- });\r
-}\r
-exports.createClientSocketTransport = createClientSocketTransport;\r
-function createServerSocketTransport(port, encoding = 'utf-8') {\r
- const socket = net_1.createConnection(port, '127.0.0.1');\r
- return [\r
- new messageReader_1.SocketMessageReader(socket, encoding),\r
- new messageWriter_1.SocketMessageWriter(socket, encoding)\r
- ];\r
-}\r
-exports.createServerSocketTransport = createServerSocketTransport;\r
-
-
-/***/ }),
-/* 175 */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Position", function() { return Position; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Range", function() { return Range; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Location", function() { return Location; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LocationLink", function() { return LocationLink; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Color", function() { return Color; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ColorInformation", function() { return ColorInformation; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ColorPresentation", function() { return ColorPresentation; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FoldingRangeKind", function() { return FoldingRangeKind; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FoldingRange", function() { return FoldingRange; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DiagnosticRelatedInformation", function() { return DiagnosticRelatedInformation; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DiagnosticSeverity", function() { return DiagnosticSeverity; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DiagnosticTag", function() { return DiagnosticTag; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Diagnostic", function() { return Diagnostic; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Command", function() { return Command; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextEdit", function() { return TextEdit; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextDocumentEdit", function() { return TextDocumentEdit; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CreateFile", function() { return CreateFile; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RenameFile", function() { return RenameFile; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DeleteFile", function() { return DeleteFile; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WorkspaceEdit", function() { return WorkspaceEdit; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WorkspaceChange", function() { return WorkspaceChange; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextDocumentIdentifier", function() { return TextDocumentIdentifier; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VersionedTextDocumentIdentifier", function() { return VersionedTextDocumentIdentifier; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextDocumentItem", function() { return TextDocumentItem; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MarkupKind", function() { return MarkupKind; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MarkupContent", function() { return MarkupContent; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CompletionItemKind", function() { return CompletionItemKind; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InsertTextFormat", function() { return InsertTextFormat; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CompletionItemTag", function() { return CompletionItemTag; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CompletionItem", function() { return CompletionItem; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CompletionList", function() { return CompletionList; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MarkedString", function() { return MarkedString; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Hover", function() { return Hover; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ParameterInformation", function() { return ParameterInformation; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SignatureInformation", function() { return SignatureInformation; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DocumentHighlightKind", function() { return DocumentHighlightKind; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DocumentHighlight", function() { return DocumentHighlight; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SymbolKind", function() { return SymbolKind; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SymbolTag", function() { return SymbolTag; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SymbolInformation", function() { return SymbolInformation; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DocumentSymbol", function() { return DocumentSymbol; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CodeActionKind", function() { return CodeActionKind; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CodeActionContext", function() { return CodeActionContext; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CodeAction", function() { return CodeAction; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CodeLens", function() { return CodeLens; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FormattingOptions", function() { return FormattingOptions; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DocumentLink", function() { return DocumentLink; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SelectionRange", function() { return SelectionRange; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EOL", function() { return EOL; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextDocument", function() { return TextDocument; });
-/* --------------------------------------------------------------------------------------------\r
- * Copyright (c) Microsoft Corporation. All rights reserved.\r
- * Licensed under the MIT License. See License.txt in the project root for license information.\r
- * ------------------------------------------------------------------------------------------ */\r
-\r
-/**\r
- * The Position namespace provides helper functions to work with\r
- * [Position](#Position) literals.\r
- */\r
-var Position;\r
-(function (Position) {\r
- /**\r
- * Creates a new Position literal from the given line and character.\r
- * @param line The position's line.\r
- * @param character The position's character.\r
- */\r
- function create(line, character) {\r
- return { line: line, character: character };\r
- }\r
- Position.create = create;\r
- /**\r
- * Checks whether the given liternal conforms to the [Position](#Position) interface.\r
- */\r
- function is(value) {\r
- var candidate = value;\r
- return Is.objectLiteral(candidate) && Is.number(candidate.line) && Is.number(candidate.character);\r
- }\r
- Position.is = is;\r
-})(Position || (Position = {}));\r
-/**\r
- * The Range namespace provides helper functions to work with\r
- * [Range](#Range) literals.\r
- */\r
-var Range;\r
-(function (Range) {\r
- function create(one, two, three, four) {\r
- if (Is.number(one) && Is.number(two) && Is.number(three) && Is.number(four)) {\r
- return { start: Position.create(one, two), end: Position.create(three, four) };\r
- }\r
- else if (Position.is(one) && Position.is(two)) {\r
- return { start: one, end: two };\r
- }\r
- else {\r
- throw new Error("Range#create called with invalid arguments[" + one + ", " + two + ", " + three + ", " + four + "]");\r
- }\r
- }\r
- Range.create = create;\r
- /**\r
- * Checks whether the given literal conforms to the [Range](#Range) interface.\r
- */\r
- function is(value) {\r
- var candidate = value;\r
- return Is.objectLiteral(candidate) && Position.is(candidate.start) && Position.is(candidate.end);\r
- }\r
- Range.is = is;\r
-})(Range || (Range = {}));\r
-/**\r
- * The Location namespace provides helper functions to work with\r
- * [Location](#Location) literals.\r
- */\r
-var Location;\r
-(function (Location) {\r
- /**\r
- * Creates a Location literal.\r
- * @param uri The location's uri.\r
- * @param range The location's range.\r
- */\r
- function create(uri, range) {\r
- return { uri: uri, range: range };\r
- }\r
- Location.create = create;\r
- /**\r
- * Checks whether the given literal conforms to the [Location](#Location) interface.\r
- */\r
- function is(value) {\r
- var candidate = value;\r
- return Is.defined(candidate) && Range.is(candidate.range) && (Is.string(candidate.uri) || Is.undefined(candidate.uri));\r
- }\r
- Location.is = is;\r
-})(Location || (Location = {}));\r
-/**\r
- * The LocationLink namespace provides helper functions to work with\r
- * [LocationLink](#LocationLink) literals.\r
- */\r
-var LocationLink;\r
-(function (LocationLink) {\r
- /**\r
- * Creates a LocationLink literal.\r
- * @param targetUri The definition's uri.\r
- * @param targetRange The full range of the definition.\r
- * @param targetSelectionRange The span of the symbol definition at the target.\r
- * @param originSelectionRange The span of the symbol being defined in the originating source file.\r
- */\r
- function create(targetUri, targetRange, targetSelectionRange, originSelectionRange) {\r
- return { targetUri: targetUri, targetRange: targetRange, targetSelectionRange: targetSelectionRange, originSelectionRange: originSelectionRange };\r
- }\r
- LocationLink.create = create;\r
- /**\r
- * Checks whether the given literal conforms to the [LocationLink](#LocationLink) interface.\r
- */\r
- function is(value) {\r
- var candidate = value;\r
- return Is.defined(candidate) && Range.is(candidate.targetRange) && Is.string(candidate.targetUri)\r
- && (Range.is(candidate.targetSelectionRange) || Is.undefined(candidate.targetSelectionRange))\r
- && (Range.is(candidate.originSelectionRange) || Is.undefined(candidate.originSelectionRange));\r
- }\r
- LocationLink.is = is;\r
-})(LocationLink || (LocationLink = {}));\r
-/**\r
- * The Color namespace provides helper functions to work with\r
- * [Color](#Color) literals.\r
- */\r
-var Color;\r
-(function (Color) {\r
- /**\r
- * Creates a new Color literal.\r
- */\r
- function create(red, green, blue, alpha) {\r
- return {\r
- red: red,\r
- green: green,\r
- blue: blue,\r
- alpha: alpha,\r
- };\r
- }\r
- Color.create = create;\r
- /**\r
- * Checks whether the given literal conforms to the [Color](#Color) interface.\r
- */\r
- function is(value) {\r
- var candidate = value;\r
- return Is.number(candidate.red)\r
- && Is.number(candidate.green)\r
- && Is.number(candidate.blue)\r
- && Is.number(candidate.alpha);\r
- }\r
- Color.is = is;\r
-})(Color || (Color = {}));\r
-/**\r
- * The ColorInformation namespace provides helper functions to work with\r
- * [ColorInformation](#ColorInformation) literals.\r
- */\r
-var ColorInformation;\r
-(function (ColorInformation) {\r
- /**\r
- * Creates a new ColorInformation literal.\r
- */\r
- function create(range, color) {\r
- return {\r
- range: range,\r
- color: color,\r
- };\r
- }\r
- ColorInformation.create = create;\r
- /**\r
- * Checks whether the given literal conforms to the [ColorInformation](#ColorInformation) interface.\r
- */\r
- function is(value) {\r
- var candidate = value;\r
- return Range.is(candidate.range) && Color.is(candidate.color);\r
- }\r
- ColorInformation.is = is;\r
-})(ColorInformation || (ColorInformation = {}));\r
-/**\r
- * The Color namespace provides helper functions to work with\r
- * [ColorPresentation](#ColorPresentation) literals.\r
- */\r
-var ColorPresentation;\r
-(function (ColorPresentation) {\r
- /**\r
- * Creates a new ColorInformation literal.\r
- */\r
- function create(label, textEdit, additionalTextEdits) {\r
- return {\r
- label: label,\r
- textEdit: textEdit,\r
- additionalTextEdits: additionalTextEdits,\r
- };\r
- }\r
- ColorPresentation.create = create;\r
- /**\r
- * Checks whether the given literal conforms to the [ColorInformation](#ColorInformation) interface.\r
- */\r
- function is(value) {\r
- var candidate = value;\r
- return Is.string(candidate.label)\r
- && (Is.undefined(candidate.textEdit) || TextEdit.is(candidate))\r
- && (Is.undefined(candidate.additionalTextEdits) || Is.typedArray(candidate.additionalTextEdits, TextEdit.is));\r
- }\r
- ColorPresentation.is = is;\r
-})(ColorPresentation || (ColorPresentation = {}));\r
-/**\r
- * Enum of known range kinds\r
- */\r
-var FoldingRangeKind;\r
-(function (FoldingRangeKind) {\r
- /**\r
- * Folding range for a comment\r
- */\r
- FoldingRangeKind["Comment"] = "comment";\r
- /**\r
- * Folding range for a imports or includes\r
- */\r
- FoldingRangeKind["Imports"] = "imports";\r
- /**\r
- * Folding range for a region (e.g. `#region`)\r
- */\r
- FoldingRangeKind["Region"] = "region";\r
-})(FoldingRangeKind || (FoldingRangeKind = {}));\r
-/**\r
- * The folding range namespace provides helper functions to work with\r
- * [FoldingRange](#FoldingRange) literals.\r
- */\r
-var FoldingRange;\r
-(function (FoldingRange) {\r
- /**\r
- * Creates a new FoldingRange literal.\r
- */\r
- function create(startLine, endLine, startCharacter, endCharacter, kind) {\r
- var result = {\r
- startLine: startLine,\r
- endLine: endLine\r
- };\r
- if (Is.defined(startCharacter)) {\r
- result.startCharacter = startCharacter;\r
- }\r
- if (Is.defined(endCharacter)) {\r
- result.endCharacter = endCharacter;\r
- }\r
- if (Is.defined(kind)) {\r
- result.kind = kind;\r
- }\r
- return result;\r
- }\r
- FoldingRange.create = create;\r
- /**\r
- * Checks whether the given literal conforms to the [FoldingRange](#FoldingRange) interface.\r
- */\r
- function is(value) {\r
- var candidate = value;\r
- return Is.number(candidate.startLine) && Is.number(candidate.startLine)\r
- && (Is.undefined(candidate.startCharacter) || Is.number(candidate.startCharacter))\r
- && (Is.undefined(candidate.endCharacter) || Is.number(candidate.endCharacter))\r
- && (Is.undefined(candidate.kind) || Is.string(candidate.kind));\r
- }\r
- FoldingRange.is = is;\r
-})(FoldingRange || (FoldingRange = {}));\r
-/**\r
- * The DiagnosticRelatedInformation namespace provides helper functions to work with\r
- * [DiagnosticRelatedInformation](#DiagnosticRelatedInformation) literals.\r
- */\r
-var DiagnosticRelatedInformation;\r
-(function (DiagnosticRelatedInformation) {\r
- /**\r
- * Creates a new DiagnosticRelatedInformation literal.\r
- */\r
- function create(location, message) {\r
- return {\r
- location: location,\r
- message: message\r
- };\r
- }\r
- DiagnosticRelatedInformation.create = create;\r
- /**\r
- * Checks whether the given literal conforms to the [DiagnosticRelatedInformation](#DiagnosticRelatedInformation) interface.\r
- */\r
- function is(value) {\r
- var candidate = value;\r
- return Is.defined(candidate) && Location.is(candidate.location) && Is.string(candidate.message);\r
- }\r
- DiagnosticRelatedInformation.is = is;\r
-})(DiagnosticRelatedInformation || (DiagnosticRelatedInformation = {}));\r
-/**\r
- * The diagnostic's severity.\r
- */\r
-var DiagnosticSeverity;\r
-(function (DiagnosticSeverity) {\r
- /**\r
- * Reports an error.\r
- */\r
- DiagnosticSeverity.Error = 1;\r
- /**\r
- * Reports a warning.\r
- */\r
- DiagnosticSeverity.Warning = 2;\r
- /**\r
- * Reports an information.\r
- */\r
- DiagnosticSeverity.Information = 3;\r
- /**\r
- * Reports a hint.\r
- */\r
- DiagnosticSeverity.Hint = 4;\r
-})(DiagnosticSeverity || (DiagnosticSeverity = {}));\r
-/**\r
- * The diagnostic tags.\r
- *\r
- * @since 3.15.0\r
- */\r
-var DiagnosticTag;\r
-(function (DiagnosticTag) {\r
- /**\r
- * Unused or unnecessary code.\r
- *\r
- * Clients are allowed to render diagnostics with this tag faded out instead of having\r
- * an error squiggle.\r
- */\r
- DiagnosticTag.Unnecessary = 1;\r
- /**\r
- * Deprecated or obsolete code.\r
- *\r
- * Clients are allowed to rendered diagnostics with this tag strike through.\r
- */\r
- DiagnosticTag.Deprecated = 2;\r
-})(DiagnosticTag || (DiagnosticTag = {}));\r
-/**\r
- * The Diagnostic namespace provides helper functions to work with\r
- * [Diagnostic](#Diagnostic) literals.\r
- */\r
-var Diagnostic;\r
-(function (Diagnostic) {\r
- /**\r
- * Creates a new Diagnostic literal.\r
- */\r
- function create(range, message, severity, code, source, relatedInformation) {\r
- var result = { range: range, message: message };\r
- if (Is.defined(severity)) {\r
- result.severity = severity;\r
- }\r
- if (Is.defined(code)) {\r
- result.code = code;\r
- }\r
- if (Is.defined(source)) {\r
- result.source = source;\r
- }\r
- if (Is.defined(relatedInformation)) {\r
- result.relatedInformation = relatedInformation;\r
- }\r
- return result;\r
- }\r
- Diagnostic.create = create;\r
- /**\r
- * Checks whether the given literal conforms to the [Diagnostic](#Diagnostic) interface.\r
- */\r
- function is(value) {\r
- var candidate = value;\r
- return Is.defined(candidate)\r
- && Range.is(candidate.range)\r
- && Is.string(candidate.message)\r
- && (Is.number(candidate.severity) || Is.undefined(candidate.severity))\r
- && (Is.number(candidate.code) || Is.string(candidate.code) || Is.undefined(candidate.code))\r
- && (Is.string(candidate.source) || Is.undefined(candidate.source))\r
- && (Is.undefined(candidate.relatedInformation) || Is.typedArray(candidate.relatedInformation, DiagnosticRelatedInformation.is));\r
- }\r
- Diagnostic.is = is;\r
-})(Diagnostic || (Diagnostic = {}));\r
-/**\r
- * The Command namespace provides helper functions to work with\r
- * [Command](#Command) literals.\r
- */\r
-var Command;\r
-(function (Command) {\r
- /**\r
- * Creates a new Command literal.\r
- */\r
- function create(title, command) {\r
- var args = [];\r
- for (var _i = 2; _i < arguments.length; _i++) {\r
- args[_i - 2] = arguments[_i];\r
- }\r
- var result = { title: title, command: command };\r
- if (Is.defined(args) && args.length > 0) {\r
- result.arguments = args;\r
- }\r
- return result;\r
- }\r
- Command.create = create;\r
- /**\r
- * Checks whether the given literal conforms to the [Command](#Command) interface.\r
- */\r
- function is(value) {\r
- var candidate = value;\r
- return Is.defined(candidate) && Is.string(candidate.title) && Is.string(candidate.command);\r
- }\r
- Command.is = is;\r
-})(Command || (Command = {}));\r
-/**\r
- * The TextEdit namespace provides helper function to create replace,\r
- * insert and delete edits more easily.\r
- */\r
-var TextEdit;\r
-(function (TextEdit) {\r
- /**\r
- * Creates a replace text edit.\r
- * @param range The range of text to be replaced.\r
- * @param newText The new text.\r
- */\r
- function replace(range, newText) {\r
- return { range: range, newText: newText };\r
- }\r
- TextEdit.replace = replace;\r
- /**\r
- * Creates a insert text edit.\r
- * @param position The position to insert the text at.\r
- * @param newText The text to be inserted.\r
- */\r
- function insert(position, newText) {\r
- return { range: { start: position, end: position }, newText: newText };\r
- }\r
- TextEdit.insert = insert;\r
- /**\r
- * Creates a delete text edit.\r
- * @param range The range of text to be deleted.\r
- */\r
- function del(range) {\r
- return { range: range, newText: '' };\r
- }\r
- TextEdit.del = del;\r
- function is(value) {\r
- var candidate = value;\r
- return Is.objectLiteral(candidate)\r
- && Is.string(candidate.newText)\r
- && Range.is(candidate.range);\r
- }\r
- TextEdit.is = is;\r
-})(TextEdit || (TextEdit = {}));\r
-/**\r
- * The TextDocumentEdit namespace provides helper function to create\r
- * an edit that manipulates a text document.\r
- */\r
-var TextDocumentEdit;\r
-(function (TextDocumentEdit) {\r
- /**\r
- * Creates a new `TextDocumentEdit`\r
- */\r
- function create(textDocument, edits) {\r
- return { textDocument: textDocument, edits: edits };\r
- }\r
- TextDocumentEdit.create = create;\r
- function is(value) {\r
- var candidate = value;\r
- return Is.defined(candidate)\r
- && VersionedTextDocumentIdentifier.is(candidate.textDocument)\r
- && Array.isArray(candidate.edits);\r
- }\r
- TextDocumentEdit.is = is;\r
-})(TextDocumentEdit || (TextDocumentEdit = {}));\r
-var CreateFile;\r
-(function (CreateFile) {\r
- function create(uri, options) {\r
- var result = {\r
- kind: 'create',\r
- uri: uri\r
- };\r
- if (options !== void 0 && (options.overwrite !== void 0 || options.ignoreIfExists !== void 0)) {\r
- result.options = options;\r
- }\r
- return result;\r
- }\r
- CreateFile.create = create;\r
- function is(value) {\r
- var candidate = value;\r
- return candidate && candidate.kind === 'create' && Is.string(candidate.uri) &&\r
- (candidate.options === void 0 ||\r
- ((candidate.options.overwrite === void 0 || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === void 0 || Is.boolean(candidate.options.ignoreIfExists))));\r
- }\r
- CreateFile.is = is;\r
-})(CreateFile || (CreateFile = {}));\r
-var RenameFile;\r
-(function (RenameFile) {\r
- function create(oldUri, newUri, options) {\r
- var result = {\r
- kind: 'rename',\r
- oldUri: oldUri,\r
- newUri: newUri\r
- };\r
- if (options !== void 0 && (options.overwrite !== void 0 || options.ignoreIfExists !== void 0)) {\r
- result.options = options;\r
- }\r
- return result;\r
- }\r
- RenameFile.create = create;\r
- function is(value) {\r
- var candidate = value;\r
- return candidate && candidate.kind === 'rename' && Is.string(candidate.oldUri) && Is.string(candidate.newUri) &&\r
- (candidate.options === void 0 ||\r
- ((candidate.options.overwrite === void 0 || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === void 0 || Is.boolean(candidate.options.ignoreIfExists))));\r
- }\r
- RenameFile.is = is;\r
-})(RenameFile || (RenameFile = {}));\r
-var DeleteFile;\r
-(function (DeleteFile) {\r
- function create(uri, options) {\r
- var result = {\r
- kind: 'delete',\r
- uri: uri\r
- };\r
- if (options !== void 0 && (options.recursive !== void 0 || options.ignoreIfNotExists !== void 0)) {\r
- result.options = options;\r
- }\r
- return result;\r
- }\r
- DeleteFile.create = create;\r
- function is(value) {\r
- var candidate = value;\r
- return candidate && candidate.kind === 'delete' && Is.string(candidate.uri) &&\r
- (candidate.options === void 0 ||\r
- ((candidate.options.recursive === void 0 || Is.boolean(candidate.options.recursive)) && (candidate.options.ignoreIfNotExists === void 0 || Is.boolean(candidate.options.ignoreIfNotExists))));\r
- }\r
- DeleteFile.is = is;\r
-})(DeleteFile || (DeleteFile = {}));\r
-var WorkspaceEdit;\r
-(function (WorkspaceEdit) {\r
- function is(value) {\r
- var candidate = value;\r
- return candidate &&\r
- (candidate.changes !== void 0 || candidate.documentChanges !== void 0) &&\r
- (candidate.documentChanges === void 0 || candidate.documentChanges.every(function (change) {\r
- if (Is.string(change.kind)) {\r
- return CreateFile.is(change) || RenameFile.is(change) || DeleteFile.is(change);\r
- }\r
- else {\r
- return TextDocumentEdit.is(change);\r
- }\r
- }));\r
- }\r
- WorkspaceEdit.is = is;\r
-})(WorkspaceEdit || (WorkspaceEdit = {}));\r
-var TextEditChangeImpl = /** @class */ (function () {\r
- function TextEditChangeImpl(edits) {\r
- this.edits = edits;\r
- }\r
- TextEditChangeImpl.prototype.insert = function (position, newText) {\r
- this.edits.push(TextEdit.insert(position, newText));\r
- };\r
- TextEditChangeImpl.prototype.replace = function (range, newText) {\r
- this.edits.push(TextEdit.replace(range, newText));\r
- };\r
- TextEditChangeImpl.prototype.delete = function (range) {\r
- this.edits.push(TextEdit.del(range));\r
- };\r
- TextEditChangeImpl.prototype.add = function (edit) {\r
- this.edits.push(edit);\r
- };\r
- TextEditChangeImpl.prototype.all = function () {\r
- return this.edits;\r
- };\r
- TextEditChangeImpl.prototype.clear = function () {\r
- this.edits.splice(0, this.edits.length);\r
- };\r
- return TextEditChangeImpl;\r
-}());\r
-/**\r
- * A workspace change helps constructing changes to a workspace.\r
- */\r
-var WorkspaceChange = /** @class */ (function () {\r
- function WorkspaceChange(workspaceEdit) {\r
- var _this = this;\r
- this._textEditChanges = Object.create(null);\r
- if (workspaceEdit) {\r
- this._workspaceEdit = workspaceEdit;\r
- if (workspaceEdit.documentChanges) {\r
- workspaceEdit.documentChanges.forEach(function (change) {\r
- if (TextDocumentEdit.is(change)) {\r
- var textEditChange = new TextEditChangeImpl(change.edits);\r
- _this._textEditChanges[change.textDocument.uri] = textEditChange;\r
- }\r
- });\r
- }\r
- else if (workspaceEdit.changes) {\r
- Object.keys(workspaceEdit.changes).forEach(function (key) {\r
- var textEditChange = new TextEditChangeImpl(workspaceEdit.changes[key]);\r
- _this._textEditChanges[key] = textEditChange;\r
- });\r
- }\r
- }\r
- }\r
- Object.defineProperty(WorkspaceChange.prototype, "edit", {\r
- /**\r
- * Returns the underlying [WorkspaceEdit](#WorkspaceEdit) literal\r
- * use to be returned from a workspace edit operation like rename.\r
- */\r
- get: function () {\r
- return this._workspaceEdit;\r
- },\r
- enumerable: true,\r
- configurable: true\r
- });\r
- WorkspaceChange.prototype.getTextEditChange = function (key) {\r
- if (VersionedTextDocumentIdentifier.is(key)) {\r
- if (!this._workspaceEdit) {\r
- this._workspaceEdit = {\r
- documentChanges: []\r
- };\r
- }\r
- if (!this._workspaceEdit.documentChanges) {\r
- throw new Error('Workspace edit is not configured for document changes.');\r
- }\r
- var textDocument = key;\r
- var result = this._textEditChanges[textDocument.uri];\r
- if (!result) {\r
- var edits = [];\r
- var textDocumentEdit = {\r
- textDocument: textDocument,\r
- edits: edits\r
- };\r
- this._workspaceEdit.documentChanges.push(textDocumentEdit);\r
- result = new TextEditChangeImpl(edits);\r
- this._textEditChanges[textDocument.uri] = result;\r
- }\r
- return result;\r
- }\r
- else {\r
- if (!this._workspaceEdit) {\r
- this._workspaceEdit = {\r
- changes: Object.create(null)\r
- };\r
- }\r
- if (!this._workspaceEdit.changes) {\r
- throw new Error('Workspace edit is not configured for normal text edit changes.');\r
- }\r
- var result = this._textEditChanges[key];\r
- if (!result) {\r
- var edits = [];\r
- this._workspaceEdit.changes[key] = edits;\r
- result = new TextEditChangeImpl(edits);\r
- this._textEditChanges[key] = result;\r
- }\r
- return result;\r
- }\r
- };\r
- WorkspaceChange.prototype.createFile = function (uri, options) {\r
- this.checkDocumentChanges();\r
- this._workspaceEdit.documentChanges.push(CreateFile.create(uri, options));\r
- };\r
- WorkspaceChange.prototype.renameFile = function (oldUri, newUri, options) {\r
- this.checkDocumentChanges();\r
- this._workspaceEdit.documentChanges.push(RenameFile.create(oldUri, newUri, options));\r
- };\r
- WorkspaceChange.prototype.deleteFile = function (uri, options) {\r
- this.checkDocumentChanges();\r
- this._workspaceEdit.documentChanges.push(DeleteFile.create(uri, options));\r
- };\r
- WorkspaceChange.prototype.checkDocumentChanges = function () {\r
- if (!this._workspaceEdit || !this._workspaceEdit.documentChanges) {\r
- throw new Error('Workspace edit is not configured for document changes.');\r
- }\r
- };\r
- return WorkspaceChange;\r
-}());\r
-\r
-/**\r
- * The TextDocumentIdentifier namespace provides helper functions to work with\r
- * [TextDocumentIdentifier](#TextDocumentIdentifier) literals.\r
- */\r
-var TextDocumentIdentifier;\r
-(function (TextDocumentIdentifier) {\r
- /**\r
- * Creates a new TextDocumentIdentifier literal.\r
- * @param uri The document's uri.\r
- */\r
- function create(uri) {\r
- return { uri: uri };\r
- }\r
- TextDocumentIdentifier.create = create;\r
- /**\r
- * Checks whether the given literal conforms to the [TextDocumentIdentifier](#TextDocumentIdentifier) interface.\r
- */\r
- function is(value) {\r
- var candidate = value;\r
- return Is.defined(candidate) && Is.string(candidate.uri);\r
- }\r
- TextDocumentIdentifier.is = is;\r
-})(TextDocumentIdentifier || (TextDocumentIdentifier = {}));\r
-/**\r
- * The VersionedTextDocumentIdentifier namespace provides helper functions to work with\r
- * [VersionedTextDocumentIdentifier](#VersionedTextDocumentIdentifier) literals.\r
- */\r
-var VersionedTextDocumentIdentifier;\r
-(function (VersionedTextDocumentIdentifier) {\r
- /**\r
- * Creates a new VersionedTextDocumentIdentifier literal.\r
- * @param uri The document's uri.\r
- * @param uri The document's text.\r
- */\r
- function create(uri, version) {\r
- return { uri: uri, version: version };\r
- }\r
- VersionedTextDocumentIdentifier.create = create;\r
- /**\r
- * Checks whether the given literal conforms to the [VersionedTextDocumentIdentifier](#VersionedTextDocumentIdentifier) interface.\r
- */\r
- function is(value) {\r
- var candidate = value;\r
- return Is.defined(candidate) && Is.string(candidate.uri) && (candidate.version === null || Is.number(candidate.version));\r
- }\r
- VersionedTextDocumentIdentifier.is = is;\r
-})(VersionedTextDocumentIdentifier || (VersionedTextDocumentIdentifier = {}));\r
-/**\r
- * The TextDocumentItem namespace provides helper functions to work with\r
- * [TextDocumentItem](#TextDocumentItem) literals.\r
- */\r
-var TextDocumentItem;\r
-(function (TextDocumentItem) {\r
- /**\r
- * Creates a new TextDocumentItem literal.\r
- * @param uri The document's uri.\r
- * @param languageId The document's language identifier.\r
- * @param version The document's version number.\r
- * @param text The document's text.\r
- */\r
- function create(uri, languageId, version, text) {\r
- return { uri: uri, languageId: languageId, version: version, text: text };\r
- }\r
- TextDocumentItem.create = create;\r
- /**\r
- * Checks whether the given literal conforms to the [TextDocumentItem](#TextDocumentItem) interface.\r
- */\r
- function is(value) {\r
- var candidate = value;\r
- return Is.defined(candidate) && Is.string(candidate.uri) && Is.string(candidate.languageId) && Is.number(candidate.version) && Is.string(candidate.text);\r
- }\r
- TextDocumentItem.is = is;\r
-})(TextDocumentItem || (TextDocumentItem = {}));\r
-/**\r
- * Describes the content type that a client supports in various\r
- * result literals like `Hover`, `ParameterInfo` or `CompletionItem`.\r
- *\r
- * Please note that `MarkupKinds` must not start with a `$`. This kinds\r
- * are reserved for internal usage.\r
- */\r
-var MarkupKind;\r
-(function (MarkupKind) {\r
- /**\r
- * Plain text is supported as a content format\r
- */\r
- MarkupKind.PlainText = 'plaintext';\r
- /**\r
- * Markdown is supported as a content format\r
- */\r
- MarkupKind.Markdown = 'markdown';\r
-})(MarkupKind || (MarkupKind = {}));\r
-(function (MarkupKind) {\r
- /**\r
- * Checks whether the given value is a value of the [MarkupKind](#MarkupKind) type.\r
- */\r
- function is(value) {\r
- var candidate = value;\r
- return candidate === MarkupKind.PlainText || candidate === MarkupKind.Markdown;\r
- }\r
- MarkupKind.is = is;\r
-})(MarkupKind || (MarkupKind = {}));\r
-var MarkupContent;\r
-(function (MarkupContent) {\r
- /**\r
- * Checks whether the given value conforms to the [MarkupContent](#MarkupContent) interface.\r
- */\r
- function is(value) {\r
- var candidate = value;\r
- return Is.objectLiteral(value) && MarkupKind.is(candidate.kind) && Is.string(candidate.value);\r
- }\r
- MarkupContent.is = is;\r
-})(MarkupContent || (MarkupContent = {}));\r
-/**\r
- * The kind of a completion entry.\r
- */\r
-var CompletionItemKind;\r
-(function (CompletionItemKind) {\r
- CompletionItemKind.Text = 1;\r
- CompletionItemKind.Method = 2;\r
- CompletionItemKind.Function = 3;\r
- CompletionItemKind.Constructor = 4;\r
- CompletionItemKind.Field = 5;\r
- CompletionItemKind.Variable = 6;\r
- CompletionItemKind.Class = 7;\r
- CompletionItemKind.Interface = 8;\r
- CompletionItemKind.Module = 9;\r
- CompletionItemKind.Property = 10;\r
- CompletionItemKind.Unit = 11;\r
- CompletionItemKind.Value = 12;\r
- CompletionItemKind.Enum = 13;\r
- CompletionItemKind.Keyword = 14;\r
- CompletionItemKind.Snippet = 15;\r
- CompletionItemKind.Color = 16;\r
- CompletionItemKind.File = 17;\r
- CompletionItemKind.Reference = 18;\r
- CompletionItemKind.Folder = 19;\r
- CompletionItemKind.EnumMember = 20;\r
- CompletionItemKind.Constant = 21;\r
- CompletionItemKind.Struct = 22;\r
- CompletionItemKind.Event = 23;\r
- CompletionItemKind.Operator = 24;\r
- CompletionItemKind.TypeParameter = 25;\r
-})(CompletionItemKind || (CompletionItemKind = {}));\r
-/**\r
- * Defines whether the insert text in a completion item should be interpreted as\r
- * plain text or a snippet.\r
- */\r
-var InsertTextFormat;\r
-(function (InsertTextFormat) {\r
- /**\r
- * The primary text to be inserted is treated as a plain string.\r
- */\r
- InsertTextFormat.PlainText = 1;\r
- /**\r
- * The primary text to be inserted is treated as a snippet.\r
- *\r
- * A snippet can define tab stops and placeholders with `$1`, `$2`\r
- * and `${3:foo}`. `$0` defines the final tab stop, it defaults to\r
- * the end of the snippet. Placeholders with equal identifiers are linked,\r
- * that is typing in one will update others too.\r
- *\r
- * See also: https://github.com/Microsoft/vscode/blob/master/src/vs/editor/contrib/snippet/common/snippet.md\r
- */\r
- InsertTextFormat.Snippet = 2;\r
-})(InsertTextFormat || (InsertTextFormat = {}));\r
-/**\r
- * Completion item tags are extra annotations that tweak the rendering of a completion\r
- * item.\r
- *\r
- * @since 3.15.0\r
- */\r
-var CompletionItemTag;\r
-(function (CompletionItemTag) {\r
- /**\r
- * Render a completion as obsolete, usually using a strike-out.\r
- */\r
- CompletionItemTag.Deprecated = 1;\r
-})(CompletionItemTag || (CompletionItemTag = {}));\r
-/**\r
- * The CompletionItem namespace provides functions to deal with\r
- * completion items.\r
- */\r
-var CompletionItem;\r
-(function (CompletionItem) {\r
- /**\r
- * Create a completion item and seed it with a label.\r
- * @param label The completion item's label\r
- */\r
- function create(label) {\r
- return { label: label };\r
- }\r
- CompletionItem.create = create;\r
-})(CompletionItem || (CompletionItem = {}));\r
-/**\r
- * The CompletionList namespace provides functions to deal with\r
- * completion lists.\r
- */\r
-var CompletionList;\r
-(function (CompletionList) {\r
- /**\r
- * Creates a new completion list.\r
- *\r
- * @param items The completion items.\r
- * @param isIncomplete The list is not complete.\r
- */\r
- function create(items, isIncomplete) {\r
- return { items: items ? items : [], isIncomplete: !!isIncomplete };\r
- }\r
- CompletionList.create = create;\r
-})(CompletionList || (CompletionList = {}));\r
-var MarkedString;\r
-(function (MarkedString) {\r
- /**\r
- * Creates a marked string from plain text.\r
- *\r
- * @param plainText The plain text.\r
- */\r
- function fromPlainText(plainText) {\r
- return plainText.replace(/[\\`*_{}[\]()#+\-.!]/g, '\\$&'); // escape markdown syntax tokens: http://daringfireball.net/projects/markdown/syntax#backslash\r
- }\r
- MarkedString.fromPlainText = fromPlainText;\r
- /**\r
- * Checks whether the given value conforms to the [MarkedString](#MarkedString) type.\r
- */\r
- function is(value) {\r
- var candidate = value;\r
- return Is.string(candidate) || (Is.objectLiteral(candidate) && Is.string(candidate.language) && Is.string(candidate.value));\r
- }\r
- MarkedString.is = is;\r
-})(MarkedString || (MarkedString = {}));\r
-var Hover;\r
-(function (Hover) {\r
- /**\r
- * Checks whether the given value conforms to the [Hover](#Hover) interface.\r
- */\r
- function is(value) {\r
- var candidate = value;\r
- return !!candidate && Is.objectLiteral(candidate) && (MarkupContent.is(candidate.contents) ||\r
- MarkedString.is(candidate.contents) ||\r
- Is.typedArray(candidate.contents, MarkedString.is)) && (value.range === void 0 || Range.is(value.range));\r
- }\r
- Hover.is = is;\r
-})(Hover || (Hover = {}));\r
-/**\r
- * The ParameterInformation namespace provides helper functions to work with\r
- * [ParameterInformation](#ParameterInformation) literals.\r
- */\r
-var ParameterInformation;\r
-(function (ParameterInformation) {\r
- /**\r
- * Creates a new parameter information literal.\r
- *\r
- * @param label A label string.\r
- * @param documentation A doc string.\r
- */\r
- function create(label, documentation) {\r
- return documentation ? { label: label, documentation: documentation } : { label: label };\r
- }\r
- ParameterInformation.create = create;\r
-})(ParameterInformation || (ParameterInformation = {}));\r
-/**\r
- * The SignatureInformation namespace provides helper functions to work with\r
- * [SignatureInformation](#SignatureInformation) literals.\r
- */\r
-var SignatureInformation;\r
-(function (SignatureInformation) {\r
- function create(label, documentation) {\r
- var parameters = [];\r
- for (var _i = 2; _i < arguments.length; _i++) {\r
- parameters[_i - 2] = arguments[_i];\r
- }\r
- var result = { label: label };\r
- if (Is.defined(documentation)) {\r
- result.documentation = documentation;\r
- }\r
- if (Is.defined(parameters)) {\r
- result.parameters = parameters;\r
- }\r
- else {\r
- result.parameters = [];\r
- }\r
- return result;\r
- }\r
- SignatureInformation.create = create;\r
-})(SignatureInformation || (SignatureInformation = {}));\r
-/**\r
- * A document highlight kind.\r
- */\r
-var DocumentHighlightKind;\r
-(function (DocumentHighlightKind) {\r
- /**\r
- * A textual occurrence.\r
- */\r
- DocumentHighlightKind.Text = 1;\r
- /**\r
- * Read-access of a symbol, like reading a variable.\r
- */\r
- DocumentHighlightKind.Read = 2;\r
- /**\r
- * Write-access of a symbol, like writing to a variable.\r
- */\r
- DocumentHighlightKind.Write = 3;\r
-})(DocumentHighlightKind || (DocumentHighlightKind = {}));\r
-/**\r
- * DocumentHighlight namespace to provide helper functions to work with\r
- * [DocumentHighlight](#DocumentHighlight) literals.\r
- */\r
-var DocumentHighlight;\r
-(function (DocumentHighlight) {\r
- /**\r
- * Create a DocumentHighlight object.\r
- * @param range The range the highlight applies to.\r
- */\r
- function create(range, kind) {\r
- var result = { range: range };\r
- if (Is.number(kind)) {\r
- result.kind = kind;\r
- }\r
- return result;\r
- }\r
- DocumentHighlight.create = create;\r
-})(DocumentHighlight || (DocumentHighlight = {}));\r
-/**\r
- * A symbol kind.\r
- */\r
-var SymbolKind;\r
-(function (SymbolKind) {\r
- SymbolKind.File = 1;\r
- SymbolKind.Module = 2;\r
- SymbolKind.Namespace = 3;\r
- SymbolKind.Package = 4;\r
- SymbolKind.Class = 5;\r
- SymbolKind.Method = 6;\r
- SymbolKind.Property = 7;\r
- SymbolKind.Field = 8;\r
- SymbolKind.Constructor = 9;\r
- SymbolKind.Enum = 10;\r
- SymbolKind.Interface = 11;\r
- SymbolKind.Function = 12;\r
- SymbolKind.Variable = 13;\r
- SymbolKind.Constant = 14;\r
- SymbolKind.String = 15;\r
- SymbolKind.Number = 16;\r
- SymbolKind.Boolean = 17;\r
- SymbolKind.Array = 18;\r
- SymbolKind.Object = 19;\r
- SymbolKind.Key = 20;\r
- SymbolKind.Null = 21;\r
- SymbolKind.EnumMember = 22;\r
- SymbolKind.Struct = 23;\r
- SymbolKind.Event = 24;\r
- SymbolKind.Operator = 25;\r
- SymbolKind.TypeParameter = 26;\r
-})(SymbolKind || (SymbolKind = {}));\r
-/**\r
- * Symbol tags are extra annotations that tweak the rendering of a symbol.\r
- * @since 3.15\r
- */\r
-var SymbolTag;\r
-(function (SymbolTag) {\r
- /**\r
- * Render a symbol as obsolete, usually using a strike-out.\r
- */\r
- SymbolTag.Deprecated = 1;\r
-})(SymbolTag || (SymbolTag = {}));\r
-var SymbolInformation;\r
-(function (SymbolInformation) {\r
- /**\r
- * Creates a new symbol information literal.\r
- *\r
- * @param name The name of the symbol.\r
- * @param kind The kind of the symbol.\r
- * @param range The range of the location of the symbol.\r
- * @param uri The resource of the location of symbol, defaults to the current document.\r
- * @param containerName The name of the symbol containing the symbol.\r
- */\r
- function create(name, kind, range, uri, containerName) {\r
- var result = {\r
- name: name,\r
- kind: kind,\r
- location: { uri: uri, range: range }\r
- };\r
- if (containerName) {\r
- result.containerName = containerName;\r
- }\r
- return result;\r
- }\r
- SymbolInformation.create = create;\r
-})(SymbolInformation || (SymbolInformation = {}));\r
-var DocumentSymbol;\r
-(function (DocumentSymbol) {\r
- /**\r
- * Creates a new symbol information literal.\r
- *\r
- * @param name The name of the symbol.\r
- * @param detail The detail of the symbol.\r
- * @param kind The kind of the symbol.\r
- * @param range The range of the symbol.\r
- * @param selectionRange The selectionRange of the symbol.\r
- * @param children Children of the symbol.\r
- */\r
- function create(name, detail, kind, range, selectionRange, children) {\r
- var result = {\r
- name: name,\r
- detail: detail,\r
- kind: kind,\r
- range: range,\r
- selectionRange: selectionRange\r
- };\r
- if (children !== void 0) {\r
- result.children = children;\r
- }\r
- return result;\r
- }\r
- DocumentSymbol.create = create;\r
- /**\r
- * Checks whether the given literal conforms to the [DocumentSymbol](#DocumentSymbol) interface.\r
- */\r
- function is(value) {\r
- var candidate = value;\r
- return candidate &&\r
- Is.string(candidate.name) && Is.number(candidate.kind) &&\r
- Range.is(candidate.range) && Range.is(candidate.selectionRange) &&\r
- (candidate.detail === void 0 || Is.string(candidate.detail)) &&\r
- (candidate.deprecated === void 0 || Is.boolean(candidate.deprecated)) &&\r
- (candidate.children === void 0 || Array.isArray(candidate.children));\r
- }\r
- DocumentSymbol.is = is;\r
-})(DocumentSymbol || (DocumentSymbol = {}));\r
-/**\r
- * A set of predefined code action kinds\r
- */\r
-var CodeActionKind;\r
-(function (CodeActionKind) {\r
- /**\r
- * Empty kind.\r
- */\r
- CodeActionKind.Empty = '';\r
- /**\r
- * Base kind for quickfix actions: 'quickfix'\r
- */\r
- CodeActionKind.QuickFix = 'quickfix';\r
- /**\r
- * Base kind for refactoring actions: 'refactor'\r
- */\r
- CodeActionKind.Refactor = 'refactor';\r
- /**\r
- * Base kind for refactoring extraction actions: 'refactor.extract'\r
- *\r
- * Example extract actions:\r
- *\r
- * - Extract method\r
- * - Extract function\r
- * - Extract variable\r
- * - Extract interface from class\r
- * - ...\r
- */\r
- CodeActionKind.RefactorExtract = 'refactor.extract';\r
- /**\r
- * Base kind for refactoring inline actions: 'refactor.inline'\r
- *\r
- * Example inline actions:\r
- *\r
- * - Inline function\r
- * - Inline variable\r
- * - Inline constant\r
- * - ...\r
- */\r
- CodeActionKind.RefactorInline = 'refactor.inline';\r
- /**\r
- * Base kind for refactoring rewrite actions: 'refactor.rewrite'\r
- *\r
- * Example rewrite actions:\r
- *\r
- * - Convert JavaScript function to class\r
- * - Add or remove parameter\r
- * - Encapsulate field\r
- * - Make method static\r
- * - Move method to base class\r
- * - ...\r
- */\r
- CodeActionKind.RefactorRewrite = 'refactor.rewrite';\r
- /**\r
- * Base kind for source actions: `source`\r
- *\r
- * Source code actions apply to the entire file.\r
- */\r
- CodeActionKind.Source = 'source';\r
- /**\r
- * Base kind for an organize imports source action: `source.organizeImports`\r
- */\r
- CodeActionKind.SourceOrganizeImports = 'source.organizeImports';\r
- /**\r
- * Base kind for auto-fix source actions: `source.fixAll`.\r
- *\r
- * Fix all actions automatically fix errors that have a clear fix that do not require user input.\r
- * They should not suppress errors or perform unsafe fixes such as generating new types or classes.\r
- *\r
- * @since 3.15.0\r
- */\r
- CodeActionKind.SourceFixAll = 'source.fixAll';\r
-})(CodeActionKind || (CodeActionKind = {}));\r
-/**\r
- * The CodeActionContext namespace provides helper functions to work with\r
- * [CodeActionContext](#CodeActionContext) literals.\r
- */\r
-var CodeActionContext;\r
-(function (CodeActionContext) {\r
- /**\r
- * Creates a new CodeActionContext literal.\r
- */\r
- function create(diagnostics, only) {\r
- var result = { diagnostics: diagnostics };\r
- if (only !== void 0 && only !== null) {\r
- result.only = only;\r
- }\r
- return result;\r
- }\r
- CodeActionContext.create = create;\r
- /**\r
- * Checks whether the given literal conforms to the [CodeActionContext](#CodeActionContext) interface.\r
- */\r
- function is(value) {\r
- var candidate = value;\r
- return Is.defined(candidate) && Is.typedArray(candidate.diagnostics, Diagnostic.is) && (candidate.only === void 0 || Is.typedArray(candidate.only, Is.string));\r
- }\r
- CodeActionContext.is = is;\r
-})(CodeActionContext || (CodeActionContext = {}));\r
-var CodeAction;\r
-(function (CodeAction) {\r
- function create(title, commandOrEdit, kind) {\r
- var result = { title: title };\r
- if (Command.is(commandOrEdit)) {\r
- result.command = commandOrEdit;\r
- }\r
- else {\r
- result.edit = commandOrEdit;\r
- }\r
- if (kind !== void 0) {\r
- result.kind = kind;\r
- }\r
- return result;\r
- }\r
- CodeAction.create = create;\r
- function is(value) {\r
- var candidate = value;\r
- return candidate && Is.string(candidate.title) &&\r
- (candidate.diagnostics === void 0 || Is.typedArray(candidate.diagnostics, Diagnostic.is)) &&\r
- (candidate.kind === void 0 || Is.string(candidate.kind)) &&\r
- (candidate.edit !== void 0 || candidate.command !== void 0) &&\r
- (candidate.command === void 0 || Command.is(candidate.command)) &&\r
- (candidate.isPreferred === void 0 || Is.boolean(candidate.isPreferred)) &&\r
- (candidate.edit === void 0 || WorkspaceEdit.is(candidate.edit));\r
- }\r
- CodeAction.is = is;\r
-})(CodeAction || (CodeAction = {}));\r
-/**\r
- * The CodeLens namespace provides helper functions to work with\r
- * [CodeLens](#CodeLens) literals.\r
- */\r
-var CodeLens;\r
-(function (CodeLens) {\r
- /**\r
- * Creates a new CodeLens literal.\r
- */\r
- function create(range, data) {\r
- var result = { range: range };\r
- if (Is.defined(data)) {\r
- result.data = data;\r
- }\r
- return result;\r
- }\r
- CodeLens.create = create;\r
- /**\r
- * Checks whether the given literal conforms to the [CodeLens](#CodeLens) interface.\r
- */\r
- function is(value) {\r
- var candidate = value;\r
- return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.command) || Command.is(candidate.command));\r
- }\r
- CodeLens.is = is;\r
-})(CodeLens || (CodeLens = {}));\r
-/**\r
- * The FormattingOptions namespace provides helper functions to work with\r
- * [FormattingOptions](#FormattingOptions) literals.\r
- */\r
-var FormattingOptions;\r
-(function (FormattingOptions) {\r
- /**\r
- * Creates a new FormattingOptions literal.\r
- */\r
- function create(tabSize, insertSpaces) {\r
- return { tabSize: tabSize, insertSpaces: insertSpaces };\r
- }\r
- FormattingOptions.create = create;\r
- /**\r
- * Checks whether the given literal conforms to the [FormattingOptions](#FormattingOptions) interface.\r
- */\r
- function is(value) {\r
- var candidate = value;\r
- return Is.defined(candidate) && Is.number(candidate.tabSize) && Is.boolean(candidate.insertSpaces);\r
- }\r
- FormattingOptions.is = is;\r
-})(FormattingOptions || (FormattingOptions = {}));\r
-/**\r
- * The DocumentLink namespace provides helper functions to work with\r
- * [DocumentLink](#DocumentLink) literals.\r
- */\r
-var DocumentLink;\r
-(function (DocumentLink) {\r
- /**\r
- * Creates a new DocumentLink literal.\r
- */\r
- function create(range, target, data) {\r
- return { range: range, target: target, data: data };\r
- }\r
- DocumentLink.create = create;\r
- /**\r
- * Checks whether the given literal conforms to the [DocumentLink](#DocumentLink) interface.\r
- */\r
- function is(value) {\r
- var candidate = value;\r
- return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.target) || Is.string(candidate.target));\r
- }\r
- DocumentLink.is = is;\r
-})(DocumentLink || (DocumentLink = {}));\r
-/**\r
- * The SelectionRange namespace provides helper function to work with\r
- * SelectionRange literals.\r
- */\r
-var SelectionRange;\r
-(function (SelectionRange) {\r
- /**\r
- * Creates a new SelectionRange\r
- * @param range the range.\r
- * @param parent an optional parent.\r
- */\r
- function create(range, parent) {\r
- return { range: range, parent: parent };\r
- }\r
- SelectionRange.create = create;\r
- function is(value) {\r
- var candidate = value;\r
- return candidate !== undefined && Range.is(candidate.range) && (candidate.parent === undefined || SelectionRange.is(candidate.parent));\r
- }\r
- SelectionRange.is = is;\r
-})(SelectionRange || (SelectionRange = {}));\r
-var EOL = ['\n', '\r\n', '\r'];\r
-/**\r
- * @deprecated Use the text document from the new vscode-languageserver-textdocument package.\r
- */\r
-var TextDocument;\r
-(function (TextDocument) {\r
- /**\r
- * Creates a new ITextDocument literal from the given uri and content.\r
- * @param uri The document's uri.\r
- * @param languageId The document's language Id.\r
- * @param content The document's content.\r
- */\r
- function create(uri, languageId, version, content) {\r
- return new FullTextDocument(uri, languageId, version, content);\r
- }\r
- TextDocument.create = create;\r
- /**\r
- * Checks whether the given literal conforms to the [ITextDocument](#ITextDocument) interface.\r
- */\r
- function is(value) {\r
- var candidate = value;\r
- return Is.defined(candidate) && Is.string(candidate.uri) && (Is.undefined(candidate.languageId) || Is.string(candidate.languageId)) && Is.number(candidate.lineCount)\r
- && Is.func(candidate.getText) && Is.func(candidate.positionAt) && Is.func(candidate.offsetAt) ? true : false;\r
- }\r
- TextDocument.is = is;\r
- function applyEdits(document, edits) {\r
- var text = document.getText();\r
- var sortedEdits = mergeSort(edits, function (a, b) {\r
- var diff = a.range.start.line - b.range.start.line;\r
- if (diff === 0) {\r
- return a.range.start.character - b.range.start.character;\r
- }\r
- return diff;\r
- });\r
- var lastModifiedOffset = text.length;\r
- for (var i = sortedEdits.length - 1; i >= 0; i--) {\r
- var e = sortedEdits[i];\r
- var startOffset = document.offsetAt(e.range.start);\r
- var endOffset = document.offsetAt(e.range.end);\r
- if (endOffset <= lastModifiedOffset) {\r
- text = text.substring(0, startOffset) + e.newText + text.substring(endOffset, text.length);\r
- }\r
- else {\r
- throw new Error('Overlapping edit');\r
- }\r
- lastModifiedOffset = startOffset;\r
- }\r
- return text;\r
- }\r
- TextDocument.applyEdits = applyEdits;\r
- function mergeSort(data, compare) {\r
- if (data.length <= 1) {\r
- // sorted\r
- return data;\r
- }\r
- var p = (data.length / 2) | 0;\r
- var left = data.slice(0, p);\r
- var right = data.slice(p);\r
- mergeSort(left, compare);\r
- mergeSort(right, compare);\r
- var leftIdx = 0;\r
- var rightIdx = 0;\r
- var i = 0;\r
- while (leftIdx < left.length && rightIdx < right.length) {\r
- var ret = compare(left[leftIdx], right[rightIdx]);\r
- if (ret <= 0) {\r
- // smaller_equal -> take left to preserve order\r
- data[i++] = left[leftIdx++];\r
- }\r
- else {\r
- // greater -> take right\r
- data[i++] = right[rightIdx++];\r
- }\r
- }\r
- while (leftIdx < left.length) {\r
- data[i++] = left[leftIdx++];\r
- }\r
- while (rightIdx < right.length) {\r
- data[i++] = right[rightIdx++];\r
- }\r
- return data;\r
- }\r
-})(TextDocument || (TextDocument = {}));\r
-var FullTextDocument = /** @class */ (function () {\r
- function FullTextDocument(uri, languageId, version, content) {\r
- this._uri = uri;\r
- this._languageId = languageId;\r
- this._version = version;\r
- this._content = content;\r
- this._lineOffsets = undefined;\r
- }\r
- Object.defineProperty(FullTextDocument.prototype, "uri", {\r
- get: function () {\r
- return this._uri;\r
- },\r
- enumerable: true,\r
- configurable: true\r
- });\r
- Object.defineProperty(FullTextDocument.prototype, "languageId", {\r
- get: function () {\r
- return this._languageId;\r
- },\r
- enumerable: true,\r
- configurable: true\r
- });\r
- Object.defineProperty(FullTextDocument.prototype, "version", {\r
- get: function () {\r
- return this._version;\r
- },\r
- enumerable: true,\r
- configurable: true\r
- });\r
- FullTextDocument.prototype.getText = function (range) {\r
- if (range) {\r
- var start = this.offsetAt(range.start);\r
- var end = this.offsetAt(range.end);\r
- return this._content.substring(start, end);\r
- }\r
- return this._content;\r
- };\r
- FullTextDocument.prototype.update = function (event, version) {\r
- this._content = event.text;\r
- this._version = version;\r
- this._lineOffsets = undefined;\r
- };\r
- FullTextDocument.prototype.getLineOffsets = function () {\r
- if (this._lineOffsets === undefined) {\r
- var lineOffsets = [];\r
- var text = this._content;\r
- var isLineStart = true;\r
- for (var i = 0; i < text.length; i++) {\r
- if (isLineStart) {\r
- lineOffsets.push(i);\r
- isLineStart = false;\r
- }\r
- var ch = text.charAt(i);\r
- isLineStart = (ch === '\r' || ch === '\n');\r
- if (ch === '\r' && i + 1 < text.length && text.charAt(i + 1) === '\n') {\r
- i++;\r
- }\r
- }\r
- if (isLineStart && text.length > 0) {\r
- lineOffsets.push(text.length);\r
- }\r
- this._lineOffsets = lineOffsets;\r
- }\r
- return this._lineOffsets;\r
- };\r
- FullTextDocument.prototype.positionAt = function (offset) {\r
- offset = Math.max(Math.min(offset, this._content.length), 0);\r
- var lineOffsets = this.getLineOffsets();\r
- var low = 0, high = lineOffsets.length;\r
- if (high === 0) {\r
- return Position.create(0, offset);\r
- }\r
- while (low < high) {\r
- var mid = Math.floor((low + high) / 2);\r
- if (lineOffsets[mid] > offset) {\r
- high = mid;\r
- }\r
- else {\r
- low = mid + 1;\r
- }\r
- }\r
- // low is the least x for which the line offset is larger than the current offset\r
- // or array.length if no line offset is larger than the current offset\r
- var line = low - 1;\r
- return Position.create(line, offset - lineOffsets[line]);\r
- };\r
- FullTextDocument.prototype.offsetAt = function (position) {\r
- var lineOffsets = this.getLineOffsets();\r
- if (position.line >= lineOffsets.length) {\r
- return this._content.length;\r
- }\r
- else if (position.line < 0) {\r
- return 0;\r
- }\r
- var lineOffset = lineOffsets[position.line];\r
- var nextLineOffset = (position.line + 1 < lineOffsets.length) ? lineOffsets[position.line + 1] : this._content.length;\r
- return Math.max(Math.min(lineOffset + position.character, nextLineOffset), lineOffset);\r
- };\r
- Object.defineProperty(FullTextDocument.prototype, "lineCount", {\r
- get: function () {\r
- return this.getLineOffsets().length;\r
- },\r
- enumerable: true,\r
- configurable: true\r
- });\r
- return FullTextDocument;\r
-}());\r
-var Is;\r
-(function (Is) {\r
- var toString = Object.prototype.toString;\r
- function defined(value) {\r
- return typeof value !== 'undefined';\r
- }\r
- Is.defined = defined;\r
- function undefined(value) {\r
- return typeof value === 'undefined';\r
- }\r
- Is.undefined = undefined;\r
- function boolean(value) {\r
- return value === true || value === false;\r
- }\r
- Is.boolean = boolean;\r
- function string(value) {\r
- return toString.call(value) === '[object String]';\r
- }\r
- Is.string = string;\r
- function number(value) {\r
- return toString.call(value) === '[object Number]';\r
- }\r
- Is.number = number;\r
- function func(value) {\r
- return toString.call(value) === '[object Function]';\r
- }\r
- Is.func = func;\r
- function objectLiteral(value) {\r
- // Strictly speaking class instances pass this check as well. Since the LSP\r
- // doesn't use classes we ignore this for now. If we do we need to add something\r
- // like this: `Object.getPrototypeOf(Object.getPrototypeOf(x)) === null`\r
- return value !== null && typeof value === 'object';\r
- }\r
- Is.objectLiteral = objectLiteral;\r
- function typedArray(value, check) {\r
- return Array.isArray(value) && value.every(check);\r
- }\r
- Is.typedArray = typedArray;\r
-})(Is || (Is = {}));\r
-
-
-/***/ }),
-/* 176 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/* --------------------------------------------------------------------------------------------\r
- * Copyright (c) Microsoft Corporation. All rights reserved.\r
- * Licensed under the MIT License. See License.txt in the project root for license information.\r
- * ------------------------------------------------------------------------------------------ */\r
-\r
-Object.defineProperty(exports, "__esModule", { value: true });\r
-const Is = __webpack_require__(177);\r
-const vscode_jsonrpc_1 = __webpack_require__(163);\r
-const messages_1 = __webpack_require__(178);\r
-const protocol_implementation_1 = __webpack_require__(179);\r
-exports.ImplementationRequest = protocol_implementation_1.ImplementationRequest;\r
-const protocol_typeDefinition_1 = __webpack_require__(180);\r
-exports.TypeDefinitionRequest = protocol_typeDefinition_1.TypeDefinitionRequest;\r
-const protocol_workspaceFolders_1 = __webpack_require__(181);\r
-exports.WorkspaceFoldersRequest = protocol_workspaceFolders_1.WorkspaceFoldersRequest;\r
-exports.DidChangeWorkspaceFoldersNotification = protocol_workspaceFolders_1.DidChangeWorkspaceFoldersNotification;\r
-const protocol_configuration_1 = __webpack_require__(182);\r
-exports.ConfigurationRequest = protocol_configuration_1.ConfigurationRequest;\r
-const protocol_colorProvider_1 = __webpack_require__(183);\r
-exports.DocumentColorRequest = protocol_colorProvider_1.DocumentColorRequest;\r
-exports.ColorPresentationRequest = protocol_colorProvider_1.ColorPresentationRequest;\r
-const protocol_foldingRange_1 = __webpack_require__(184);\r
-exports.FoldingRangeRequest = protocol_foldingRange_1.FoldingRangeRequest;\r
-const protocol_declaration_1 = __webpack_require__(185);\r
-exports.DeclarationRequest = protocol_declaration_1.DeclarationRequest;\r
-const protocol_selectionRange_1 = __webpack_require__(186);\r
-exports.SelectionRangeRequest = protocol_selectionRange_1.SelectionRangeRequest;\r
-const protocol_progress_1 = __webpack_require__(187);\r
-exports.WorkDoneProgress = protocol_progress_1.WorkDoneProgress;\r
-exports.WorkDoneProgressCreateRequest = protocol_progress_1.WorkDoneProgressCreateRequest;\r
-exports.WorkDoneProgressCancelNotification = protocol_progress_1.WorkDoneProgressCancelNotification;\r
-// @ts-ignore: to avoid inlining LocatioLink as dynamic import\r
-let __noDynamicImport;\r
-/**\r
- * The DocumentFilter namespace provides helper functions to work with\r
- * [DocumentFilter](#DocumentFilter) literals.\r
- */\r
-var DocumentFilter;\r
-(function (DocumentFilter) {\r
- function is(value) {\r
- const candidate = value;\r
- return Is.string(candidate.language) || Is.string(candidate.scheme) || Is.string(candidate.pattern);\r
- }\r
- DocumentFilter.is = is;\r
-})(DocumentFilter = exports.DocumentFilter || (exports.DocumentFilter = {}));\r
-/**\r
- * The DocumentSelector namespace provides helper functions to work with\r
- * [DocumentSelector](#DocumentSelector)s.\r
- */\r
-var DocumentSelector;\r
-(function (DocumentSelector) {\r
- function is(value) {\r
- if (!Array.isArray(value)) {\r
- return false;\r
- }\r
- for (let elem of value) {\r
- if (!Is.string(elem) && !DocumentFilter.is(elem)) {\r
- return false;\r
- }\r
- }\r
- return true;\r
- }\r
- DocumentSelector.is = is;\r
-})(DocumentSelector = exports.DocumentSelector || (exports.DocumentSelector = {}));\r
-/**\r
- * The `client/registerCapability` request is sent from the server to the client to register a new capability\r
- * handler on the client side.\r
- */\r
-var RegistrationRequest;\r
-(function (RegistrationRequest) {\r
- RegistrationRequest.type = new messages_1.ProtocolRequestType('client/registerCapability');\r
-})(RegistrationRequest = exports.RegistrationRequest || (exports.RegistrationRequest = {}));\r
-/**\r
- * The `client/unregisterCapability` request is sent from the server to the client to unregister a previously registered capability\r
- * handler on the client side.\r
- */\r
-var UnregistrationRequest;\r
-(function (UnregistrationRequest) {\r
- UnregistrationRequest.type = new messages_1.ProtocolRequestType('client/unregisterCapability');\r
-})(UnregistrationRequest = exports.UnregistrationRequest || (exports.UnregistrationRequest = {}));\r
-var ResourceOperationKind;\r
-(function (ResourceOperationKind) {\r
- /**\r
- * Supports creating new files and folders.\r
- */\r
- ResourceOperationKind.Create = 'create';\r
- /**\r
- * Supports renaming existing files and folders.\r
- */\r
- ResourceOperationKind.Rename = 'rename';\r
- /**\r
- * Supports deleting existing files and folders.\r
- */\r
- ResourceOperationKind.Delete = 'delete';\r
-})(ResourceOperationKind = exports.ResourceOperationKind || (exports.ResourceOperationKind = {}));\r
-var FailureHandlingKind;\r
-(function (FailureHandlingKind) {\r
- /**\r
- * Applying the workspace change is simply aborted if one of the changes provided\r
- * fails. All operations executed before the failing operation stay executed.\r
- */\r
- FailureHandlingKind.Abort = 'abort';\r
- /**\r
- * All operations are executed transactional. That means they either all\r
- * succeed or no changes at all are applied to the workspace.\r
- */\r
- FailureHandlingKind.Transactional = 'transactional';\r
- /**\r
- * If the workspace edit contains only textual file changes they are executed transactional.\r
- * If resource changes (create, rename or delete file) are part of the change the failure\r
- * handling startegy is abort.\r
- */\r
- FailureHandlingKind.TextOnlyTransactional = 'textOnlyTransactional';\r
- /**\r
- * The client tries to undo the operations already executed. But there is no\r
- * guarantee that this is succeeding.\r
- */\r
- FailureHandlingKind.Undo = 'undo';\r
-})(FailureHandlingKind = exports.FailureHandlingKind || (exports.FailureHandlingKind = {}));\r
-/**\r
- * The StaticRegistrationOptions namespace provides helper functions to work with\r
- * [StaticRegistrationOptions](#StaticRegistrationOptions) literals.\r
- */\r
-var StaticRegistrationOptions;\r
-(function (StaticRegistrationOptions) {\r
- function hasId(value) {\r
- const candidate = value;\r
- return candidate && Is.string(candidate.id) && candidate.id.length > 0;\r
- }\r
- StaticRegistrationOptions.hasId = hasId;\r
-})(StaticRegistrationOptions = exports.StaticRegistrationOptions || (exports.StaticRegistrationOptions = {}));\r
-/**\r
- * The TextDocumentRegistrationOptions namespace provides helper functions to work with\r
- * [TextDocumentRegistrationOptions](#TextDocumentRegistrationOptions) literals.\r
- */\r
-var TextDocumentRegistrationOptions;\r
-(function (TextDocumentRegistrationOptions) {\r
- function is(value) {\r
- const candidate = value;\r
- return candidate && (candidate.documentSelector === null || DocumentSelector.is(candidate.documentSelector));\r
- }\r
- TextDocumentRegistrationOptions.is = is;\r
-})(TextDocumentRegistrationOptions = exports.TextDocumentRegistrationOptions || (exports.TextDocumentRegistrationOptions = {}));\r
-/**\r
- * The WorkDoneProgressOptions namespace provides helper functions to work with\r
- * [WorkDoneProgressOptions](#WorkDoneProgressOptions) literals.\r
- */\r
-var WorkDoneProgressOptions;\r
-(function (WorkDoneProgressOptions) {\r
- function is(value) {\r
- const candidate = value;\r
- return Is.objectLiteral(candidate) && (candidate.workDoneProgress === undefined || Is.boolean(candidate.workDoneProgress));\r
- }\r
- WorkDoneProgressOptions.is = is;\r
- function hasWorkDoneProgress(value) {\r
- const candidate = value;\r
- return candidate && Is.boolean(candidate.workDoneProgress);\r
- }\r
- WorkDoneProgressOptions.hasWorkDoneProgress = hasWorkDoneProgress;\r
-})(WorkDoneProgressOptions = exports.WorkDoneProgressOptions || (exports.WorkDoneProgressOptions = {}));\r
-/**\r
- * The initialize request is sent from the client to the server.\r
- * It is sent once as the request after starting up the server.\r
- * The requests parameter is of type [InitializeParams](#InitializeParams)\r
- * the response if of type [InitializeResult](#InitializeResult) of a Thenable that\r
- * resolves to such.\r
- */\r
-var InitializeRequest;\r
-(function (InitializeRequest) {\r
- InitializeRequest.type = new messages_1.ProtocolRequestType('initialize');\r
-})(InitializeRequest = exports.InitializeRequest || (exports.InitializeRequest = {}));\r
-/**\r
- * Known error codes for an `InitializeError`;\r
- */\r
-var InitializeError;\r
-(function (InitializeError) {\r
- /**\r
- * If the protocol version provided by the client can't be handled by the server.\r
- * @deprecated This initialize error got replaced by client capabilities. There is\r
- * no version handshake in version 3.0x\r
- */\r
- InitializeError.unknownProtocolVersion = 1;\r
-})(InitializeError = exports.InitializeError || (exports.InitializeError = {}));\r
-/**\r
- * The intialized notification is sent from the client to the\r
- * server after the client is fully initialized and the server\r
- * is allowed to send requests from the server to the client.\r
- */\r
-var InitializedNotification;\r
-(function (InitializedNotification) {\r
- InitializedNotification.type = new messages_1.ProtocolNotificationType('initialized');\r
-})(InitializedNotification = exports.InitializedNotification || (exports.InitializedNotification = {}));\r
-//---- Shutdown Method ----\r
-/**\r
- * A shutdown request is sent from the client to the server.\r
- * It is sent once when the client decides to shutdown the\r
- * server. The only notification that is sent after a shutdown request\r
- * is the exit event.\r
- */\r
-var ShutdownRequest;\r
-(function (ShutdownRequest) {\r
- ShutdownRequest.type = new messages_1.ProtocolRequestType0('shutdown');\r
-})(ShutdownRequest = exports.ShutdownRequest || (exports.ShutdownRequest = {}));\r
-//---- Exit Notification ----\r
-/**\r
- * The exit event is sent from the client to the server to\r
- * ask the server to exit its process.\r
- */\r
-var ExitNotification;\r
-(function (ExitNotification) {\r
- ExitNotification.type = new messages_1.ProtocolNotificationType0('exit');\r
-})(ExitNotification = exports.ExitNotification || (exports.ExitNotification = {}));\r
-/**\r
- * The configuration change notification is sent from the client to the server\r
- * when the client's configuration has changed. The notification contains\r
- * the changed configuration as defined by the language client.\r
- */\r
-var DidChangeConfigurationNotification;\r
-(function (DidChangeConfigurationNotification) {\r
- DidChangeConfigurationNotification.type = new messages_1.ProtocolNotificationType('workspace/didChangeConfiguration');\r
-})(DidChangeConfigurationNotification = exports.DidChangeConfigurationNotification || (exports.DidChangeConfigurationNotification = {}));\r
-//---- Message show and log notifications ----\r
-/**\r
- * The message type\r
- */\r
-var MessageType;\r
-(function (MessageType) {\r
- /**\r
- * An error message.\r
- */\r
- MessageType.Error = 1;\r
- /**\r
- * A warning message.\r
- */\r
- MessageType.Warning = 2;\r
- /**\r
- * An information message.\r
- */\r
- MessageType.Info = 3;\r
- /**\r
- * A log message.\r
- */\r
- MessageType.Log = 4;\r
-})(MessageType = exports.MessageType || (exports.MessageType = {}));\r
-/**\r
- * The show message notification is sent from a server to a client to ask\r
- * the client to display a particular message in the user interface.\r
- */\r
-var ShowMessageNotification;\r
-(function (ShowMessageNotification) {\r
- ShowMessageNotification.type = new messages_1.ProtocolNotificationType('window/showMessage');\r
-})(ShowMessageNotification = exports.ShowMessageNotification || (exports.ShowMessageNotification = {}));\r
-/**\r
- * The show message request is sent from the server to the client to show a message\r
- * and a set of options actions to the user.\r
- */\r
-var ShowMessageRequest;\r
-(function (ShowMessageRequest) {\r
- ShowMessageRequest.type = new messages_1.ProtocolRequestType('window/showMessageRequest');\r
-})(ShowMessageRequest = exports.ShowMessageRequest || (exports.ShowMessageRequest = {}));\r
-/**\r
- * The log message notification is sent from the server to the client to ask\r
- * the client to log a particular message.\r
- */\r
-var LogMessageNotification;\r
-(function (LogMessageNotification) {\r
- LogMessageNotification.type = new messages_1.ProtocolNotificationType('window/logMessage');\r
-})(LogMessageNotification = exports.LogMessageNotification || (exports.LogMessageNotification = {}));\r
-//---- Telemetry notification\r
-/**\r
- * The telemetry event notification is sent from the server to the client to ask\r
- * the client to log telemetry data.\r
- */\r
-var TelemetryEventNotification;\r
-(function (TelemetryEventNotification) {\r
- TelemetryEventNotification.type = new messages_1.ProtocolNotificationType('telemetry/event');\r
-})(TelemetryEventNotification = exports.TelemetryEventNotification || (exports.TelemetryEventNotification = {}));\r
-/**\r
- * Defines how the host (editor) should sync\r
- * document changes to the language server.\r
- */\r
-var TextDocumentSyncKind;\r
-(function (TextDocumentSyncKind) {\r
- /**\r
- * Documents should not be synced at all.\r
- */\r
- TextDocumentSyncKind.None = 0;\r
- /**\r
- * Documents are synced by always sending the full content\r
- * of the document.\r
- */\r
- TextDocumentSyncKind.Full = 1;\r
- /**\r
- * Documents are synced by sending the full content on open.\r
- * After that only incremental updates to the document are\r
- * send.\r
- */\r
- TextDocumentSyncKind.Incremental = 2;\r
-})(TextDocumentSyncKind = exports.TextDocumentSyncKind || (exports.TextDocumentSyncKind = {}));\r
-/**\r
- * The document open notification is sent from the client to the server to signal\r
- * newly opened text documents. The document's truth is now managed by the client\r
- * and the server must not try to read the document's truth using the document's\r
- * uri. Open in this sense means it is managed by the client. It doesn't necessarily\r
- * mean that its content is presented in an editor. An open notification must not\r
- * be sent more than once without a corresponding close notification send before.\r
- * This means open and close notification must be balanced and the max open count\r
- * is one.\r
- */\r
-var DidOpenTextDocumentNotification;\r
-(function (DidOpenTextDocumentNotification) {\r
- DidOpenTextDocumentNotification.method = 'textDocument/didOpen';\r
- DidOpenTextDocumentNotification.type = new messages_1.ProtocolNotificationType(DidOpenTextDocumentNotification.method);\r
-})(DidOpenTextDocumentNotification = exports.DidOpenTextDocumentNotification || (exports.DidOpenTextDocumentNotification = {}));\r
-/**\r
- * The document change notification is sent from the client to the server to signal\r
- * changes to a text document.\r
- */\r
-var DidChangeTextDocumentNotification;\r
-(function (DidChangeTextDocumentNotification) {\r
- DidChangeTextDocumentNotification.method = 'textDocument/didChange';\r
- DidChangeTextDocumentNotification.type = new messages_1.ProtocolNotificationType(DidChangeTextDocumentNotification.method);\r
-})(DidChangeTextDocumentNotification = exports.DidChangeTextDocumentNotification || (exports.DidChangeTextDocumentNotification = {}));\r
-/**\r
- * The document close notification is sent from the client to the server when\r
- * the document got closed in the client. The document's truth now exists where\r
- * the document's uri points to (e.g. if the document's uri is a file uri the\r
- * truth now exists on disk). As with the open notification the close notification\r
- * is about managing the document's content. Receiving a close notification\r
- * doesn't mean that the document was open in an editor before. A close\r
- * notification requires a previous open notification to be sent.\r
- */\r
-var DidCloseTextDocumentNotification;\r
-(function (DidCloseTextDocumentNotification) {\r
- DidCloseTextDocumentNotification.method = 'textDocument/didClose';\r
- DidCloseTextDocumentNotification.type = new messages_1.ProtocolNotificationType(DidCloseTextDocumentNotification.method);\r
-})(DidCloseTextDocumentNotification = exports.DidCloseTextDocumentNotification || (exports.DidCloseTextDocumentNotification = {}));\r
-/**\r
- * The document save notification is sent from the client to the server when\r
- * the document got saved in the client.\r
- */\r
-var DidSaveTextDocumentNotification;\r
-(function (DidSaveTextDocumentNotification) {\r
- DidSaveTextDocumentNotification.method = 'textDocument/didSave';\r
- DidSaveTextDocumentNotification.type = new messages_1.ProtocolNotificationType(DidSaveTextDocumentNotification.method);\r
-})(DidSaveTextDocumentNotification = exports.DidSaveTextDocumentNotification || (exports.DidSaveTextDocumentNotification = {}));\r
-/**\r
- * Represents reasons why a text document is saved.\r
- */\r
-var TextDocumentSaveReason;\r
-(function (TextDocumentSaveReason) {\r
- /**\r
- * Manually triggered, e.g. by the user pressing save, by starting debugging,\r
- * or by an API call.\r
- */\r
- TextDocumentSaveReason.Manual = 1;\r
- /**\r
- * Automatic after a delay.\r
- */\r
- TextDocumentSaveReason.AfterDelay = 2;\r
- /**\r
- * When the editor lost focus.\r
- */\r
- TextDocumentSaveReason.FocusOut = 3;\r
-})(TextDocumentSaveReason = exports.TextDocumentSaveReason || (exports.TextDocumentSaveReason = {}));\r
-/**\r
- * A document will save notification is sent from the client to the server before\r
- * the document is actually saved.\r
- */\r
-var WillSaveTextDocumentNotification;\r
-(function (WillSaveTextDocumentNotification) {\r
- WillSaveTextDocumentNotification.method = 'textDocument/willSave';\r
- WillSaveTextDocumentNotification.type = new messages_1.ProtocolNotificationType(WillSaveTextDocumentNotification.method);\r
-})(WillSaveTextDocumentNotification = exports.WillSaveTextDocumentNotification || (exports.WillSaveTextDocumentNotification = {}));\r
-/**\r
- * A document will save request is sent from the client to the server before\r
- * the document is actually saved. The request can return an array of TextEdits\r
- * which will be applied to the text document before it is saved. Please note that\r
- * clients might drop results if computing the text edits took too long or if a\r
- * server constantly fails on this request. This is done to keep the save fast and\r
- * reliable.\r
- */\r
-var WillSaveTextDocumentWaitUntilRequest;\r
-(function (WillSaveTextDocumentWaitUntilRequest) {\r
- WillSaveTextDocumentWaitUntilRequest.method = 'textDocument/willSaveWaitUntil';\r
- WillSaveTextDocumentWaitUntilRequest.type = new messages_1.ProtocolRequestType(WillSaveTextDocumentWaitUntilRequest.method);\r
-})(WillSaveTextDocumentWaitUntilRequest = exports.WillSaveTextDocumentWaitUntilRequest || (exports.WillSaveTextDocumentWaitUntilRequest = {}));\r
-/**\r
- * The watched files notification is sent from the client to the server when\r
- * the client detects changes to file watched by the language client.\r
- */\r
-var DidChangeWatchedFilesNotification;\r
-(function (DidChangeWatchedFilesNotification) {\r
- DidChangeWatchedFilesNotification.type = new messages_1.ProtocolNotificationType('workspace/didChangeWatchedFiles');\r
-})(DidChangeWatchedFilesNotification = exports.DidChangeWatchedFilesNotification || (exports.DidChangeWatchedFilesNotification = {}));\r
-/**\r
- * The file event type\r
- */\r
-var FileChangeType;\r
-(function (FileChangeType) {\r
- /**\r
- * The file got created.\r
- */\r
- FileChangeType.Created = 1;\r
- /**\r
- * The file got changed.\r
- */\r
- FileChangeType.Changed = 2;\r
- /**\r
- * The file got deleted.\r
- */\r
- FileChangeType.Deleted = 3;\r
-})(FileChangeType = exports.FileChangeType || (exports.FileChangeType = {}));\r
-var WatchKind;\r
-(function (WatchKind) {\r
- /**\r
- * Interested in create events.\r
- */\r
- WatchKind.Create = 1;\r
- /**\r
- * Interested in change events\r
- */\r
- WatchKind.Change = 2;\r
- /**\r
- * Interested in delete events\r
- */\r
- WatchKind.Delete = 4;\r
-})(WatchKind = exports.WatchKind || (exports.WatchKind = {}));\r
-/**\r
- * Diagnostics notification are sent from the server to the client to signal\r
- * results of validation runs.\r
- */\r
-var PublishDiagnosticsNotification;\r
-(function (PublishDiagnosticsNotification) {\r
- PublishDiagnosticsNotification.type = new messages_1.ProtocolNotificationType('textDocument/publishDiagnostics');\r
-})(PublishDiagnosticsNotification = exports.PublishDiagnosticsNotification || (exports.PublishDiagnosticsNotification = {}));\r
-/**\r
- * How a completion was triggered\r
- */\r
-var CompletionTriggerKind;\r
-(function (CompletionTriggerKind) {\r
- /**\r
- * Completion was triggered by typing an identifier (24x7 code\r
- * complete), manual invocation (e.g Ctrl+Space) or via API.\r
- */\r
- CompletionTriggerKind.Invoked = 1;\r
- /**\r
- * Completion was triggered by a trigger character specified by\r
- * the `triggerCharacters` properties of the `CompletionRegistrationOptions`.\r
- */\r
- CompletionTriggerKind.TriggerCharacter = 2;\r
- /**\r
- * Completion was re-triggered as current completion list is incomplete\r
- */\r
- CompletionTriggerKind.TriggerForIncompleteCompletions = 3;\r
-})(CompletionTriggerKind = exports.CompletionTriggerKind || (exports.CompletionTriggerKind = {}));\r
-/**\r
- * Request to request completion at a given text document position. The request's\r
- * parameter is of type [TextDocumentPosition](#TextDocumentPosition) the response\r
- * is of type [CompletionItem[]](#CompletionItem) or [CompletionList](#CompletionList)\r
- * or a Thenable that resolves to such.\r
- *\r
- * The request can delay the computation of the [`detail`](#CompletionItem.detail)\r
- * and [`documentation`](#CompletionItem.documentation) properties to the `completionItem/resolve`\r
- * request. However, properties that are needed for the initial sorting and filtering, like `sortText`,\r
- * `filterText`, `insertText`, and `textEdit`, must not be changed during resolve.\r
- */\r
-var CompletionRequest;\r
-(function (CompletionRequest) {\r
- CompletionRequest.method = 'textDocument/completion';\r
- CompletionRequest.type = new messages_1.ProtocolRequestType(CompletionRequest.method);\r
- /** @deprecated Use CompletionRequest.type */\r
- CompletionRequest.resultType = new vscode_jsonrpc_1.ProgressType();\r
-})(CompletionRequest = exports.CompletionRequest || (exports.CompletionRequest = {}));\r
-/**\r
- * Request to resolve additional information for a given completion item.The request's\r
- * parameter is of type [CompletionItem](#CompletionItem) the response\r
- * is of type [CompletionItem](#CompletionItem) or a Thenable that resolves to such.\r
- */\r
-var CompletionResolveRequest;\r
-(function (CompletionResolveRequest) {\r
- CompletionResolveRequest.method = 'completionItem/resolve';\r
- CompletionResolveRequest.type = new messages_1.ProtocolRequestType(CompletionResolveRequest.method);\r
-})(CompletionResolveRequest = exports.CompletionResolveRequest || (exports.CompletionResolveRequest = {}));\r
-/**\r
- * Request to request hover information at a given text document position. The request's\r
- * parameter is of type [TextDocumentPosition](#TextDocumentPosition) the response is of\r
- * type [Hover](#Hover) or a Thenable that resolves to such.\r
- */\r
-var HoverRequest;\r
-(function (HoverRequest) {\r
- HoverRequest.method = 'textDocument/hover';\r
- HoverRequest.type = new messages_1.ProtocolRequestType(HoverRequest.method);\r
-})(HoverRequest = exports.HoverRequest || (exports.HoverRequest = {}));\r
-/**\r
- * How a signature help was triggered.\r
- *\r
- * @since 3.15.0\r
- */\r
-var SignatureHelpTriggerKind;\r
-(function (SignatureHelpTriggerKind) {\r
- /**\r
- * Signature help was invoked manually by the user or by a command.\r
- */\r
- SignatureHelpTriggerKind.Invoked = 1;\r
- /**\r
- * Signature help was triggered by a trigger character.\r
- */\r
- SignatureHelpTriggerKind.TriggerCharacter = 2;\r
- /**\r
- * Signature help was triggered by the cursor moving or by the document content changing.\r
- */\r
- SignatureHelpTriggerKind.ContentChange = 3;\r
-})(SignatureHelpTriggerKind = exports.SignatureHelpTriggerKind || (exports.SignatureHelpTriggerKind = {}));\r
-var SignatureHelpRequest;\r
-(function (SignatureHelpRequest) {\r
- SignatureHelpRequest.method = 'textDocument/signatureHelp';\r
- SignatureHelpRequest.type = new messages_1.ProtocolRequestType(SignatureHelpRequest.method);\r
-})(SignatureHelpRequest = exports.SignatureHelpRequest || (exports.SignatureHelpRequest = {}));\r
-/**\r
- * A request to resolve the definition location of a symbol at a given text\r
- * document position. The request's parameter is of type [TextDocumentPosition]\r
- * (#TextDocumentPosition) the response is of either type [Definition](#Definition)\r
- * or a typed array of [DefinitionLink](#DefinitionLink) or a Thenable that resolves\r
- * to such.\r
- */\r
-var DefinitionRequest;\r
-(function (DefinitionRequest) {\r
- DefinitionRequest.method = 'textDocument/definition';\r
- DefinitionRequest.type = new messages_1.ProtocolRequestType(DefinitionRequest.method);\r
- /** @deprecated Use DefinitionRequest.type */\r
- DefinitionRequest.resultType = new vscode_jsonrpc_1.ProgressType();\r
-})(DefinitionRequest = exports.DefinitionRequest || (exports.DefinitionRequest = {}));\r
-/**\r
- * A request to resolve project-wide references for the symbol denoted\r
- * by the given text document position. The request's parameter is of\r
- * type [ReferenceParams](#ReferenceParams) the response is of type\r
- * [Location[]](#Location) or a Thenable that resolves to such.\r
- */\r
-var ReferencesRequest;\r
-(function (ReferencesRequest) {\r
- ReferencesRequest.method = 'textDocument/references';\r
- ReferencesRequest.type = new messages_1.ProtocolRequestType(ReferencesRequest.method);\r
- /** @deprecated Use ReferencesRequest.type */\r
- ReferencesRequest.resultType = new vscode_jsonrpc_1.ProgressType();\r
-})(ReferencesRequest = exports.ReferencesRequest || (exports.ReferencesRequest = {}));\r
-/**\r
- * Request to resolve a [DocumentHighlight](#DocumentHighlight) for a given\r
- * text document position. The request's parameter is of type [TextDocumentPosition]\r
- * (#TextDocumentPosition) the request response is of type [DocumentHighlight[]]\r
- * (#DocumentHighlight) or a Thenable that resolves to such.\r
- */\r
-var DocumentHighlightRequest;\r
-(function (DocumentHighlightRequest) {\r
- DocumentHighlightRequest.method = 'textDocument/documentHighlight';\r
- DocumentHighlightRequest.type = new messages_1.ProtocolRequestType(DocumentHighlightRequest.method);\r
- /** @deprecated Use DocumentHighlightRequest.type */\r
- DocumentHighlightRequest.resultType = new vscode_jsonrpc_1.ProgressType();\r
-})(DocumentHighlightRequest = exports.DocumentHighlightRequest || (exports.DocumentHighlightRequest = {}));\r
-/**\r
- * A request to list all symbols found in a given text document. The request's\r
- * parameter is of type [TextDocumentIdentifier](#TextDocumentIdentifier) the\r
- * response is of type [SymbolInformation[]](#SymbolInformation) or a Thenable\r
- * that resolves to such.\r
- */\r
-var DocumentSymbolRequest;\r
-(function (DocumentSymbolRequest) {\r
- DocumentSymbolRequest.method = 'textDocument/documentSymbol';\r
- DocumentSymbolRequest.type = new messages_1.ProtocolRequestType(DocumentSymbolRequest.method);\r
- /** @deprecated Use DocumentSymbolRequest.type */\r
- DocumentSymbolRequest.resultType = new vscode_jsonrpc_1.ProgressType();\r
-})(DocumentSymbolRequest = exports.DocumentSymbolRequest || (exports.DocumentSymbolRequest = {}));\r
-/**\r
- * A request to provide commands for the given text document and range.\r
- */\r
-var CodeActionRequest;\r
-(function (CodeActionRequest) {\r
- CodeActionRequest.method = 'textDocument/codeAction';\r
- CodeActionRequest.type = new messages_1.ProtocolRequestType(CodeActionRequest.method);\r
- /** @deprecated Use CodeActionRequest.type */\r
- CodeActionRequest.resultType = new vscode_jsonrpc_1.ProgressType();\r
-})(CodeActionRequest = exports.CodeActionRequest || (exports.CodeActionRequest = {}));\r
-/**\r
- * A request to list project-wide symbols matching the query string given\r
- * by the [WorkspaceSymbolParams](#WorkspaceSymbolParams). The response is\r
- * of type [SymbolInformation[]](#SymbolInformation) or a Thenable that\r
- * resolves to such.\r
- */\r
-var WorkspaceSymbolRequest;\r
-(function (WorkspaceSymbolRequest) {\r
- WorkspaceSymbolRequest.method = 'workspace/symbol';\r
- WorkspaceSymbolRequest.type = new messages_1.ProtocolRequestType(WorkspaceSymbolRequest.method);\r
- /** @deprecated Use WorkspaceSymbolRequest.type */\r
- WorkspaceSymbolRequest.resultType = new vscode_jsonrpc_1.ProgressType();\r
-})(WorkspaceSymbolRequest = exports.WorkspaceSymbolRequest || (exports.WorkspaceSymbolRequest = {}));\r
-/**\r
- * A request to provide code lens for the given text document.\r
- */\r
-var CodeLensRequest;\r
-(function (CodeLensRequest) {\r
- CodeLensRequest.type = new messages_1.ProtocolRequestType('textDocument/codeLens');\r
- /** @deprecated Use CodeLensRequest.type */\r
- CodeLensRequest.resultType = new vscode_jsonrpc_1.ProgressType();\r
-})(CodeLensRequest = exports.CodeLensRequest || (exports.CodeLensRequest = {}));\r
-/**\r
- * A request to resolve a command for a given code lens.\r
- */\r
-var CodeLensResolveRequest;\r
-(function (CodeLensResolveRequest) {\r
- CodeLensResolveRequest.type = new messages_1.ProtocolRequestType('codeLens/resolve');\r
-})(CodeLensResolveRequest = exports.CodeLensResolveRequest || (exports.CodeLensResolveRequest = {}));\r
-/**\r
- * A request to provide document links\r
- */\r
-var DocumentLinkRequest;\r
-(function (DocumentLinkRequest) {\r
- DocumentLinkRequest.method = 'textDocument/documentLink';\r
- DocumentLinkRequest.type = new messages_1.ProtocolRequestType(DocumentLinkRequest.method);\r
- /** @deprecated Use DocumentLinkRequest.type */\r
- DocumentLinkRequest.resultType = new vscode_jsonrpc_1.ProgressType();\r
-})(DocumentLinkRequest = exports.DocumentLinkRequest || (exports.DocumentLinkRequest = {}));\r
-/**\r
- * Request to resolve additional information for a given document link. The request's\r
- * parameter is of type [DocumentLink](#DocumentLink) the response\r
- * is of type [DocumentLink](#DocumentLink) or a Thenable that resolves to such.\r
- */\r
-var DocumentLinkResolveRequest;\r
-(function (DocumentLinkResolveRequest) {\r
- DocumentLinkResolveRequest.type = new messages_1.ProtocolRequestType('documentLink/resolve');\r
-})(DocumentLinkResolveRequest = exports.DocumentLinkResolveRequest || (exports.DocumentLinkResolveRequest = {}));\r
-/**\r
- * A request to to format a whole document.\r
- */\r
-var DocumentFormattingRequest;\r
-(function (DocumentFormattingRequest) {\r
- DocumentFormattingRequest.method = 'textDocument/formatting';\r
- DocumentFormattingRequest.type = new messages_1.ProtocolRequestType(DocumentFormattingRequest.method);\r
-})(DocumentFormattingRequest = exports.DocumentFormattingRequest || (exports.DocumentFormattingRequest = {}));\r
-/**\r
- * A request to to format a range in a document.\r
- */\r
-var DocumentRangeFormattingRequest;\r
-(function (DocumentRangeFormattingRequest) {\r
- DocumentRangeFormattingRequest.method = 'textDocument/rangeFormatting';\r
- DocumentRangeFormattingRequest.type = new messages_1.ProtocolRequestType(DocumentRangeFormattingRequest.method);\r
-})(DocumentRangeFormattingRequest = exports.DocumentRangeFormattingRequest || (exports.DocumentRangeFormattingRequest = {}));\r
-/**\r
- * A request to format a document on type.\r
- */\r
-var DocumentOnTypeFormattingRequest;\r
-(function (DocumentOnTypeFormattingRequest) {\r
- DocumentOnTypeFormattingRequest.method = 'textDocument/onTypeFormatting';\r
- DocumentOnTypeFormattingRequest.type = new messages_1.ProtocolRequestType(DocumentOnTypeFormattingRequest.method);\r
-})(DocumentOnTypeFormattingRequest = exports.DocumentOnTypeFormattingRequest || (exports.DocumentOnTypeFormattingRequest = {}));\r
-/**\r
- * A request to rename a symbol.\r
- */\r
-var RenameRequest;\r
-(function (RenameRequest) {\r
- RenameRequest.method = 'textDocument/rename';\r
- RenameRequest.type = new messages_1.ProtocolRequestType(RenameRequest.method);\r
-})(RenameRequest = exports.RenameRequest || (exports.RenameRequest = {}));\r
-/**\r
- * A request to test and perform the setup necessary for a rename.\r
- */\r
-var PrepareRenameRequest;\r
-(function (PrepareRenameRequest) {\r
- PrepareRenameRequest.method = 'textDocument/prepareRename';\r
- PrepareRenameRequest.type = new messages_1.ProtocolRequestType(PrepareRenameRequest.method);\r
-})(PrepareRenameRequest = exports.PrepareRenameRequest || (exports.PrepareRenameRequest = {}));\r
-/**\r
- * A request send from the client to the server to execute a command. The request might return\r
- * a workspace edit which the client will apply to the workspace.\r
- */\r
-var ExecuteCommandRequest;\r
-(function (ExecuteCommandRequest) {\r
- ExecuteCommandRequest.type = new messages_1.ProtocolRequestType('workspace/executeCommand');\r
-})(ExecuteCommandRequest = exports.ExecuteCommandRequest || (exports.ExecuteCommandRequest = {}));\r
-/**\r
- * A request sent from the server to the client to modified certain resources.\r
- */\r
-var ApplyWorkspaceEditRequest;\r
-(function (ApplyWorkspaceEditRequest) {\r
- ApplyWorkspaceEditRequest.type = new messages_1.ProtocolRequestType('workspace/applyEdit');\r
-})(ApplyWorkspaceEditRequest = exports.ApplyWorkspaceEditRequest || (exports.ApplyWorkspaceEditRequest = {}));\r
-
-
-/***/ }),
-/* 177 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/* --------------------------------------------------------------------------------------------\r
- * Copyright (c) Microsoft Corporation. All rights reserved.\r
- * Licensed under the MIT License. See License.txt in the project root for license information.\r
- * ------------------------------------------------------------------------------------------ */\r
-\r
-Object.defineProperty(exports, "__esModule", { value: true });\r
-function boolean(value) {\r
- return value === true || value === false;\r
-}\r
-exports.boolean = boolean;\r
-function string(value) {\r
- return typeof value === 'string' || value instanceof String;\r
-}\r
-exports.string = string;\r
-function number(value) {\r
- return typeof value === 'number' || value instanceof Number;\r
-}\r
-exports.number = number;\r
-function error(value) {\r
- return value instanceof Error;\r
-}\r
-exports.error = error;\r
-function func(value) {\r
- return typeof value === 'function';\r
-}\r
-exports.func = func;\r
-function array(value) {\r
- return Array.isArray(value);\r
-}\r
-exports.array = array;\r
-function stringArray(value) {\r
- return array(value) && value.every(elem => string(elem));\r
-}\r
-exports.stringArray = stringArray;\r
-function typedArray(value, check) {\r
- return Array.isArray(value) && value.every(check);\r
-}\r
-exports.typedArray = typedArray;\r
-function objectLiteral(value) {\r
- // Strictly speaking class instances pass this check as well. Since the LSP\r
- // doesn't use classes we ignore this for now. If we do we need to add something\r
- // like this: `Object.getPrototypeOf(Object.getPrototypeOf(x)) === null`\r
- return value !== null && typeof value === 'object';\r
-}\r
-exports.objectLiteral = objectLiteral;\r
-
-
-/***/ }),
-/* 178 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/* --------------------------------------------------------------------------------------------\r
- * Copyright (c) Microsoft Corporation. All rights reserved.\r
- * Licensed under the MIT License. See License.txt in the project root for license information.\r
- * ------------------------------------------------------------------------------------------ */\r
-\r
-Object.defineProperty(exports, "__esModule", { value: true });\r
-const vscode_jsonrpc_1 = __webpack_require__(163);\r
-class ProtocolRequestType0 extends vscode_jsonrpc_1.RequestType0 {\r
- constructor(method) {\r
- super(method);\r
- }\r
-}\r
-exports.ProtocolRequestType0 = ProtocolRequestType0;\r
-class ProtocolRequestType extends vscode_jsonrpc_1.RequestType {\r
- constructor(method) {\r
- super(method);\r
- }\r
-}\r
-exports.ProtocolRequestType = ProtocolRequestType;\r
-class ProtocolNotificationType extends vscode_jsonrpc_1.NotificationType {\r
- constructor(method) {\r
- super(method);\r
- }\r
-}\r
-exports.ProtocolNotificationType = ProtocolNotificationType;\r
-class ProtocolNotificationType0 extends vscode_jsonrpc_1.NotificationType0 {\r
- constructor(method) {\r
- super(method);\r
- }\r
-}\r
-exports.ProtocolNotificationType0 = ProtocolNotificationType0;\r
-
-
-/***/ }),
-/* 179 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/* --------------------------------------------------------------------------------------------\r
- * Copyright (c) Microsoft Corporation. All rights reserved.\r
- * Licensed under the MIT License. See License.txt in the project root for license information.\r
- * ------------------------------------------------------------------------------------------ */\r
-\r
-Object.defineProperty(exports, "__esModule", { value: true });\r
-const vscode_jsonrpc_1 = __webpack_require__(163);\r
-const messages_1 = __webpack_require__(178);\r
-// @ts-ignore: to avoid inlining LocatioLink as dynamic import\r
-let __noDynamicImport;\r
-/**\r
- * A request to resolve the implementation locations of a symbol at a given text\r
- * document position. The request's parameter is of type [TextDocumentPositioParams]\r
- * (#TextDocumentPositionParams) the response is of type [Definition](#Definition) or a\r
- * Thenable that resolves to such.\r
- */\r
-var ImplementationRequest;\r
-(function (ImplementationRequest) {\r
- ImplementationRequest.method = 'textDocument/implementation';\r
- ImplementationRequest.type = new messages_1.ProtocolRequestType(ImplementationRequest.method);\r
- /** @deprecated Use ImplementationRequest.type */\r
- ImplementationRequest.resultType = new vscode_jsonrpc_1.ProgressType();\r
-})(ImplementationRequest = exports.ImplementationRequest || (exports.ImplementationRequest = {}));\r
-
-
-/***/ }),
-/* 180 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/* --------------------------------------------------------------------------------------------\r
- * Copyright (c) Microsoft Corporation. All rights reserved.\r
- * Licensed under the MIT License. See License.txt in the project root for license information.\r
- * ------------------------------------------------------------------------------------------ */\r
-\r
-Object.defineProperty(exports, "__esModule", { value: true });\r
-const vscode_jsonrpc_1 = __webpack_require__(163);\r
-const messages_1 = __webpack_require__(178);\r
-// @ts-ignore: to avoid inlining LocatioLink as dynamic import\r
-let __noDynamicImport;\r
-/**\r
- * A request to resolve the type definition locations of a symbol at a given text\r
- * document position. The request's parameter is of type [TextDocumentPositioParams]\r
- * (#TextDocumentPositionParams) the response is of type [Definition](#Definition) or a\r
- * Thenable that resolves to such.\r
- */\r
-var TypeDefinitionRequest;\r
-(function (TypeDefinitionRequest) {\r
- TypeDefinitionRequest.method = 'textDocument/typeDefinition';\r
- TypeDefinitionRequest.type = new messages_1.ProtocolRequestType(TypeDefinitionRequest.method);\r
- /** @deprecated Use TypeDefinitionRequest.type */\r
- TypeDefinitionRequest.resultType = new vscode_jsonrpc_1.ProgressType();\r
-})(TypeDefinitionRequest = exports.TypeDefinitionRequest || (exports.TypeDefinitionRequest = {}));\r
-
-
-/***/ }),
-/* 181 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/* --------------------------------------------------------------------------------------------\r
- * Copyright (c) Microsoft Corporation. All rights reserved.\r
- * Licensed under the MIT License. See License.txt in the project root for license information.\r
- * ------------------------------------------------------------------------------------------ */\r
-\r
-Object.defineProperty(exports, "__esModule", { value: true });\r
-const messages_1 = __webpack_require__(178);\r
-/**\r
- * The `workspace/workspaceFolders` is sent from the server to the client to fetch the open workspace folders.\r
- */\r
-var WorkspaceFoldersRequest;\r
-(function (WorkspaceFoldersRequest) {\r
- WorkspaceFoldersRequest.type = new messages_1.ProtocolRequestType0('workspace/workspaceFolders');\r
-})(WorkspaceFoldersRequest = exports.WorkspaceFoldersRequest || (exports.WorkspaceFoldersRequest = {}));\r
-/**\r
- * The `workspace/didChangeWorkspaceFolders` notification is sent from the client to the server when the workspace\r
- * folder configuration changes.\r
- */\r
-var DidChangeWorkspaceFoldersNotification;\r
-(function (DidChangeWorkspaceFoldersNotification) {\r
- DidChangeWorkspaceFoldersNotification.type = new messages_1.ProtocolNotificationType('workspace/didChangeWorkspaceFolders');\r
-})(DidChangeWorkspaceFoldersNotification = exports.DidChangeWorkspaceFoldersNotification || (exports.DidChangeWorkspaceFoldersNotification = {}));\r
-
-
-/***/ }),
-/* 182 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/* --------------------------------------------------------------------------------------------\r
- * Copyright (c) Microsoft Corporation. All rights reserved.\r
- * Licensed under the MIT License. See License.txt in the project root for license information.\r
- * ------------------------------------------------------------------------------------------ */\r
-\r
-Object.defineProperty(exports, "__esModule", { value: true });\r
-const messages_1 = __webpack_require__(178);\r
-/**\r
- * The 'workspace/configuration' request is sent from the server to the client to fetch a certain\r
- * configuration setting.\r
- *\r
- * This pull model replaces the old push model were the client signaled configuration change via an\r
- * event. If the server still needs to react to configuration changes (since the server caches the\r
- * result of `workspace/configuration` requests) the server should register for an empty configuration\r
- * change event and empty the cache if such an event is received.\r
- */\r
-var ConfigurationRequest;\r
-(function (ConfigurationRequest) {\r
- ConfigurationRequest.type = new messages_1.ProtocolRequestType('workspace/configuration');\r
-})(ConfigurationRequest = exports.ConfigurationRequest || (exports.ConfigurationRequest = {}));\r
-
-
-/***/ }),
-/* 183 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/* --------------------------------------------------------------------------------------------\r
- * Copyright (c) Microsoft Corporation. All rights reserved.\r
- * Licensed under the MIT License. See License.txt in the project root for license information.\r
- * ------------------------------------------------------------------------------------------ */\r
-\r
-Object.defineProperty(exports, "__esModule", { value: true });\r
-const vscode_jsonrpc_1 = __webpack_require__(163);\r
-const messages_1 = __webpack_require__(178);\r
-/**\r
- * A request to list all color symbols found in a given text document. The request's\r
- * parameter is of type [DocumentColorParams](#DocumentColorParams) the\r
- * response is of type [ColorInformation[]](#ColorInformation) or a Thenable\r
- * that resolves to such.\r
- */\r
-var DocumentColorRequest;\r
-(function (DocumentColorRequest) {\r
- DocumentColorRequest.method = 'textDocument/documentColor';\r
- DocumentColorRequest.type = new messages_1.ProtocolRequestType(DocumentColorRequest.method);\r
- /** @deprecated Use DocumentColorRequest.type */\r
- DocumentColorRequest.resultType = new vscode_jsonrpc_1.ProgressType();\r
-})(DocumentColorRequest = exports.DocumentColorRequest || (exports.DocumentColorRequest = {}));\r
-/**\r
- * A request to list all presentation for a color. The request's\r
- * parameter is of type [ColorPresentationParams](#ColorPresentationParams) the\r
- * response is of type [ColorInformation[]](#ColorInformation) or a Thenable\r
- * that resolves to such.\r
- */\r
-var ColorPresentationRequest;\r
-(function (ColorPresentationRequest) {\r
- ColorPresentationRequest.type = new messages_1.ProtocolRequestType('textDocument/colorPresentation');\r
-})(ColorPresentationRequest = exports.ColorPresentationRequest || (exports.ColorPresentationRequest = {}));\r
-
-
-/***/ }),
-/* 184 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-\r
-/*---------------------------------------------------------------------------------------------\r
- * Copyright (c) Microsoft Corporation. All rights reserved.\r
- * Licensed under the MIT License. See License.txt in the project root for license information.\r
- *--------------------------------------------------------------------------------------------*/\r
-Object.defineProperty(exports, "__esModule", { value: true });\r
-const vscode_jsonrpc_1 = __webpack_require__(163);\r
-const messages_1 = __webpack_require__(178);\r
-/**\r
- * Enum of known range kinds\r
- */\r
-var FoldingRangeKind;\r
-(function (FoldingRangeKind) {\r
- /**\r
- * Folding range for a comment\r
- */\r
- FoldingRangeKind["Comment"] = "comment";\r
- /**\r
- * Folding range for a imports or includes\r
- */\r
- FoldingRangeKind["Imports"] = "imports";\r
- /**\r
- * Folding range for a region (e.g. `#region`)\r
- */\r
- FoldingRangeKind["Region"] = "region";\r
-})(FoldingRangeKind = exports.FoldingRangeKind || (exports.FoldingRangeKind = {}));\r
-/**\r
- * A request to provide folding ranges in a document. The request's\r
- * parameter is of type [FoldingRangeParams](#FoldingRangeParams), the\r
- * response is of type [FoldingRangeList](#FoldingRangeList) or a Thenable\r
- * that resolves to such.\r
- */\r
-var FoldingRangeRequest;\r
-(function (FoldingRangeRequest) {\r
- FoldingRangeRequest.method = 'textDocument/foldingRange';\r
- FoldingRangeRequest.type = new messages_1.ProtocolRequestType(FoldingRangeRequest.method);\r
- /** @deprecated Use FoldingRangeRequest.type */\r
- FoldingRangeRequest.resultType = new vscode_jsonrpc_1.ProgressType();\r
-})(FoldingRangeRequest = exports.FoldingRangeRequest || (exports.FoldingRangeRequest = {}));\r
-
-
-/***/ }),
-/* 185 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/* --------------------------------------------------------------------------------------------\r
- * Copyright (c) Microsoft Corporation. All rights reserved.\r
- * Licensed under the MIT License. See License.txt in the project root for license information.\r
- * ------------------------------------------------------------------------------------------ */\r
-\r
-Object.defineProperty(exports, "__esModule", { value: true });\r
-const vscode_jsonrpc_1 = __webpack_require__(163);\r
-const messages_1 = __webpack_require__(178);\r
-// @ts-ignore: to avoid inlining LocatioLink as dynamic import\r
-let __noDynamicImport;\r
-/**\r
- * A request to resolve the type definition locations of a symbol at a given text\r
- * document position. The request's parameter is of type [TextDocumentPositioParams]\r
- * (#TextDocumentPositionParams) the response is of type [Declaration](#Declaration)\r
- * or a typed array of [DeclarationLink](#DeclarationLink) or a Thenable that resolves\r
- * to such.\r
- */\r
-var DeclarationRequest;\r
-(function (DeclarationRequest) {\r
- DeclarationRequest.method = 'textDocument/declaration';\r
- DeclarationRequest.type = new messages_1.ProtocolRequestType(DeclarationRequest.method);\r
- /** @deprecated Use DeclarationRequest.type */\r
- DeclarationRequest.resultType = new vscode_jsonrpc_1.ProgressType();\r
-})(DeclarationRequest = exports.DeclarationRequest || (exports.DeclarationRequest = {}));\r
-
-
-/***/ }),
-/* 186 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-\r
-/*---------------------------------------------------------------------------------------------\r
- * Copyright (c) Microsoft Corporation. All rights reserved.\r
- * Licensed under the MIT License. See License.txt in the project root for license information.\r
- *--------------------------------------------------------------------------------------------*/\r
-Object.defineProperty(exports, "__esModule", { value: true });\r
-const vscode_jsonrpc_1 = __webpack_require__(163);\r
-const messages_1 = __webpack_require__(178);\r
-/**\r
- * A request to provide selection ranges in a document. The request's\r
- * parameter is of type [SelectionRangeParams](#SelectionRangeParams), the\r
- * response is of type [SelectionRange[]](#SelectionRange[]) or a Thenable\r
- * that resolves to such.\r
- */\r
-var SelectionRangeRequest;\r
-(function (SelectionRangeRequest) {\r
- SelectionRangeRequest.method = 'textDocument/selectionRange';\r
- SelectionRangeRequest.type = new messages_1.ProtocolRequestType(SelectionRangeRequest.method);\r
- /** @deprecated Use SelectionRangeRequest.type */\r
- SelectionRangeRequest.resultType = new vscode_jsonrpc_1.ProgressType();\r
-})(SelectionRangeRequest = exports.SelectionRangeRequest || (exports.SelectionRangeRequest = {}));\r
-
-
-/***/ }),
-/* 187 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/* --------------------------------------------------------------------------------------------\r
- * Copyright (c) Microsoft Corporation. All rights reserved.\r
- * Licensed under the MIT License. See License.txt in the project root for license information.\r
- * ------------------------------------------------------------------------------------------ */\r
-\r
-Object.defineProperty(exports, "__esModule", { value: true });\r
-const vscode_jsonrpc_1 = __webpack_require__(163);\r
-const messages_1 = __webpack_require__(178);\r
-var WorkDoneProgress;\r
-(function (WorkDoneProgress) {\r
- WorkDoneProgress.type = new vscode_jsonrpc_1.ProgressType();\r
-})(WorkDoneProgress = exports.WorkDoneProgress || (exports.WorkDoneProgress = {}));\r
-/**\r
- * The `window/workDoneProgress/create` request is sent from the server to the client to initiate progress\r
- * reporting from the server.\r
- */\r
-var WorkDoneProgressCreateRequest;\r
-(function (WorkDoneProgressCreateRequest) {\r
- WorkDoneProgressCreateRequest.type = new messages_1.ProtocolRequestType('window/workDoneProgress/create');\r
-})(WorkDoneProgressCreateRequest = exports.WorkDoneProgressCreateRequest || (exports.WorkDoneProgressCreateRequest = {}));\r
-/**\r
- * The `window/workDoneProgress/cancel` notification is sent from the client to the server to cancel a progress\r
- * initiated on the server side.\r
- */\r
-var WorkDoneProgressCancelNotification;\r
-(function (WorkDoneProgressCancelNotification) {\r
- WorkDoneProgressCancelNotification.type = new messages_1.ProtocolNotificationType('window/workDoneProgress/cancel');\r
-})(WorkDoneProgressCancelNotification = exports.WorkDoneProgressCancelNotification || (exports.WorkDoneProgressCancelNotification = {}));\r
-
-
-/***/ }),
-/* 188 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/* --------------------------------------------------------------------------------------------\r
- * Copyright (c) TypeFox and others. All rights reserved.\r
- * Licensed under the MIT License. See License.txt in the project root for license information.\r
- * ------------------------------------------------------------------------------------------ */\r
-\r
-Object.defineProperty(exports, "__esModule", { value: true });\r
-const messages_1 = __webpack_require__(178);\r
-/**\r
- * A request to result a `CallHierarchyItem` in a document at a given position.\r
- * Can be used as an input to a incoming or outgoing call hierarchy.\r
- *\r
- * @since 3.16.0 - Proposed state\r
- */\r
-var CallHierarchyPrepareRequest;\r
-(function (CallHierarchyPrepareRequest) {\r
- CallHierarchyPrepareRequest.method = 'textDocument/prepareCallHierarchy';\r
- CallHierarchyPrepareRequest.type = new messages_1.ProtocolRequestType(CallHierarchyPrepareRequest.method);\r
-})(CallHierarchyPrepareRequest = exports.CallHierarchyPrepareRequest || (exports.CallHierarchyPrepareRequest = {}));\r
-/**\r
- * A request to resolve the incoming calls for a given `CallHierarchyItem`.\r
- *\r
- * @since 3.16.0 - Proposed state\r
- */\r
-var CallHierarchyIncomingCallsRequest;\r
-(function (CallHierarchyIncomingCallsRequest) {\r
- CallHierarchyIncomingCallsRequest.method = 'callHierarchy/incomingCalls';\r
- CallHierarchyIncomingCallsRequest.type = new messages_1.ProtocolRequestType(CallHierarchyIncomingCallsRequest.method);\r
-})(CallHierarchyIncomingCallsRequest = exports.CallHierarchyIncomingCallsRequest || (exports.CallHierarchyIncomingCallsRequest = {}));\r
-/**\r
- * A request to resolve the outgoing calls for a given `CallHierarchyItem`.\r
- *\r
- * @since 3.16.0 - Proposed state\r
- */\r
-var CallHierarchyOutgoingCallsRequest;\r
-(function (CallHierarchyOutgoingCallsRequest) {\r
- CallHierarchyOutgoingCallsRequest.method = 'callHierarchy/outgoingCalls';\r
- CallHierarchyOutgoingCallsRequest.type = new messages_1.ProtocolRequestType(CallHierarchyOutgoingCallsRequest.method);\r
-})(CallHierarchyOutgoingCallsRequest = exports.CallHierarchyOutgoingCallsRequest || (exports.CallHierarchyOutgoingCallsRequest = {}));\r
-
-
-/***/ }),
-/* 189 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/* --------------------------------------------------------------------------------------------\r
- * Copyright (c) Microsoft Corporation. All rights reserved.\r
- * Licensed under the MIT License. See License.txt in the project root for license information.\r
- * ------------------------------------------------------------------------------------------ */\r
-\r
-Object.defineProperty(exports, "__esModule", { value: true });\r
-const messages_1 = __webpack_require__(178);\r
-/**\r
- * A set of predefined token types. This set is not fixed\r
- * an clients can specify additional token types via the\r
- * corresponding client capabilities.\r
- *\r
- * @since 3.16.0 - Proposed state\r
- */\r
-var SemanticTokenTypes;\r
-(function (SemanticTokenTypes) {\r
- SemanticTokenTypes["comment"] = "comment";\r
- SemanticTokenTypes["keyword"] = "keyword";\r
- SemanticTokenTypes["string"] = "string";\r
- SemanticTokenTypes["number"] = "number";\r
- SemanticTokenTypes["regexp"] = "regexp";\r
- SemanticTokenTypes["operator"] = "operator";\r
- SemanticTokenTypes["namespace"] = "namespace";\r
- SemanticTokenTypes["type"] = "type";\r
- SemanticTokenTypes["struct"] = "struct";\r
- SemanticTokenTypes["class"] = "class";\r
- SemanticTokenTypes["interface"] = "interface";\r
- SemanticTokenTypes["enum"] = "enum";\r
- SemanticTokenTypes["typeParameter"] = "typeParameter";\r
- SemanticTokenTypes["function"] = "function";\r
- SemanticTokenTypes["member"] = "member";\r
- SemanticTokenTypes["property"] = "property";\r
- SemanticTokenTypes["macro"] = "macro";\r
- SemanticTokenTypes["variable"] = "variable";\r
- SemanticTokenTypes["parameter"] = "parameter";\r
- SemanticTokenTypes["label"] = "label";\r
-})(SemanticTokenTypes = exports.SemanticTokenTypes || (exports.SemanticTokenTypes = {}));\r
-/**\r
- * A set of predefined token modifiers. This set is not fixed\r
- * an clients can specify additional token types via the\r
- * corresponding client capabilities.\r
- *\r
- * @since 3.16.0 - Proposed state\r
- */\r
-var SemanticTokenModifiers;\r
-(function (SemanticTokenModifiers) {\r
- SemanticTokenModifiers["documentation"] = "documentation";\r
- SemanticTokenModifiers["declaration"] = "declaration";\r
- SemanticTokenModifiers["definition"] = "definition";\r
- SemanticTokenModifiers["reference"] = "reference";\r
- SemanticTokenModifiers["static"] = "static";\r
- SemanticTokenModifiers["abstract"] = "abstract";\r
- SemanticTokenModifiers["deprecated"] = "deprecated";\r
- SemanticTokenModifiers["async"] = "async";\r
- SemanticTokenModifiers["volatile"] = "volatile";\r
- SemanticTokenModifiers["readonly"] = "readonly";\r
-})(SemanticTokenModifiers = exports.SemanticTokenModifiers || (exports.SemanticTokenModifiers = {}));\r
-/**\r
- * @since 3.16.0 - Proposed state\r
- */\r
-var SemanticTokens;\r
-(function (SemanticTokens) {\r
- function is(value) {\r
- const candidate = value;\r
- return candidate !== undefined && (candidate.resultId === undefined || typeof candidate.resultId === 'string') &&\r
- Array.isArray(candidate.data) && (candidate.data.length === 0 || typeof candidate.data[0] === 'number');\r
- }\r
- SemanticTokens.is = is;\r
-})(SemanticTokens = exports.SemanticTokens || (exports.SemanticTokens = {}));\r
-/**\r
- * @since 3.16.0 - Proposed state\r
- */\r
-var SemanticTokensRequest;\r
-(function (SemanticTokensRequest) {\r
- SemanticTokensRequest.method = 'textDocument/semanticTokens';\r
- SemanticTokensRequest.type = new messages_1.ProtocolRequestType(SemanticTokensRequest.method);\r
-})(SemanticTokensRequest = exports.SemanticTokensRequest || (exports.SemanticTokensRequest = {}));\r
-/**\r
- * @since 3.16.0 - Proposed state\r
- */\r
-var SemanticTokensEditsRequest;\r
-(function (SemanticTokensEditsRequest) {\r
- SemanticTokensEditsRequest.method = 'textDocument/semanticTokens/edits';\r
- SemanticTokensEditsRequest.type = new messages_1.ProtocolRequestType(SemanticTokensEditsRequest.method);\r
-})(SemanticTokensEditsRequest = exports.SemanticTokensEditsRequest || (exports.SemanticTokensEditsRequest = {}));\r
-/**\r
- * @since 3.16.0 - Proposed state\r
- */\r
-var SemanticTokensRangeRequest;\r
-(function (SemanticTokensRangeRequest) {\r
- SemanticTokensRangeRequest.method = 'textDocument/semanticTokens/range';\r
- SemanticTokensRangeRequest.type = new messages_1.ProtocolRequestType(SemanticTokensRangeRequest.method);\r
-})(SemanticTokensRangeRequest = exports.SemanticTokensRangeRequest || (exports.SemanticTokensRangeRequest = {}));\r
-
-
-/***/ })
-/******/ ])));
\ No newline at end of file
+/*! For license information please see index.js.LICENSE.txt */
+!function(e,t){for(var n in t)e[n]=t[n];t.__esModule&&Object.defineProperty(e,"__esModule",{value:!0})}(exports,(()=>{var e=[(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.activate=void 0;const r=n(1),i=n(2),s=[{language:"markdown",scheme:"file"},{language:"markdown",scheme:"untitled"}];let o=0;const a=new i.MarkdownlintEngine,u=r.workspace.getConfiguration("markdownlint");function c(e){u.get("onOpen",!0)&&a.lint(e)}async function l(e){if(u.get("onChange",!0)&&e.textDocument.version&&o!==e.textDocument.version){o=e.textDocument.version;const{document:t}=await r.workspace.getCurrentState();a.lint(t)}}async function h(e){u.get("onSave",!0)&&a.lint(e)}t.activate=async function(e){await a.parseConfig(),e.subscriptions.push(r.languages.registerCodeActionProvider(s,a,"markdownlint"),r.commands.registerCommand(a.fixAllCommandName,(async()=>{const{document:e}=await r.workspace.getCurrentState();a.fixAll(e)})),r.workspace.onDidOpenTextDocument(c),r.workspace.onDidChangeTextDocument(l),r.workspace.onDidSaveTextDocument(h)),r.workspace.documents.map((e=>{c(e.textDocument)}))}},e=>{"use strict";e.exports=require("coc.nvim")},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.MarkdownlintEngine=void 0;const i=n(1),s=r(n(3)),o=r(n(4)),a=r(n(5)),u=r(n(37)),c=n(158),l=r(n(39)),h=r(n(159)),p=n(164),d=[".markdownlint.json",".markdownlint.yaml",".markdownlint.yml"],f=[JSON.parse,a.default.safeLoad];t.MarkdownlintEngine=class{constructor(){this.fixAllCommandName="markdownlint.fixAll",this.source="markdownlint",this.outputChannel=i.workspace.createOutputChannel(this.source),this.diagnosticCollection=i.languages.createDiagnosticCollection(this.source),this.config={}}outputLine(e){this.outputChannel&&this.outputChannel.appendLine(`[${(new Date).toLocaleTimeString()}] ${e}`)}async parseConfig(){try{this.config=h.default(this.source,{}),this.outputLine("Info: global config: "+JSON.stringify(h.default(this.source,{})))}catch(e){this.outputLine("Error: global config parse failed: "+e)}try{const e=i.workspace.getConfiguration("coc.preferences"),t=await i.workspace.resolveRootFolder(i.Uri.parse(i.workspace.uri),e.get("rootPatterns",[]));for(const e of d){const n=l.default.join(t,e);if(o.default.existsSync(n)){const e=u.default.readConfigSync(n,f);this.config=s.default(this.config,e),this.outputLine(`Info: local config: ${n}, ${JSON.stringify(e)}`);break}}}catch(e){this.outputLine("Error: local config parse failed: "+e)}const e=i.workspace.getConfiguration("markdownlint").get("config");e&&(this.config=s.default(this.config,e),this.outputLine("Info: config from coc-settings.json: "+JSON.stringify(e))),this.outputLine("Info: full config: "+JSON.stringify(this.config))}markdownlintWrapper(e){const t={resultVersion:3,config:this.config,strings:{[e.uri]:e.getText()}};let n=[];try{n=u.default.sync(t)[e.uri]}catch(e){this.outputLine("Error: lint exception: "+e.stack)}return n}async provideCodeActions(e,t,n){const r=[],s=[];for(const t of n.diagnostics)if(t.fixInfo){const o=t.fixInfo.lineNumber-1||t.range.start.line,a=await i.workspace.getLine(e.uri,o),u=c.applyFix(a,t.fixInfo,"\n"),l={changes:{}};if("string"==typeof u){const t=p.Range.create(o,0,o,a.length);l.changes[e.uri]=[p.TextEdit.replace(t,u)]}else l.changes[e.uri]=[p.TextEdit.del(t.range)];const h={title:"Fix: "+t.message.split(":")[0],edit:l,diagnostics:[...n.diagnostics]};s.push(t),r.push(h)}if(s.length){const e="Fix All error found by markdownlint",t={title:e,kind:p.CodeActionKind.SourceFixAll,diagnostics:s,command:{title:e,command:this.fixAllCommandName}};r.push(t)}return r}lint(e){if("markdown"!==e.languageId)return;this.diagnosticCollection.clear();const t=this.markdownlintWrapper(e);if(!t.length)return;const n=[];t.forEach((e=>{const t=e.ruleDescription;let r=e.ruleNames.join("/")+": "+t;e.errorDetail&&(r+=" ["+e.errorDetail+"]");const i=p.Position.create(e.lineNumber-1,0),s=p.Position.create(e.lineNumber-1,0);e.errorRange&&(i.character=e.errorRange[0]-1,s.character=i.character+e.errorRange[1]);const o=p.Range.create(i,s),a=p.Diagnostic.create(o,r);a.severity=p.DiagnosticSeverity.Warning,a.source=this.source,a.fixInfo=e.fixInfo,n.push(a)})),this.diagnosticCollection.set(e.uri,n)}async fixAll(e){const t=this.markdownlintWrapper(e);if(!t.length)return;const n=e.getText(),r=c.applyFixes(n,t);if(n!=r){const t=i.workspace.getDocument(e.uri),n=p.Position.create(t.lineCount-1,t.getline(t.lineCount-1).length),s={changes:{[e.uri]:[p.TextEdit.replace(p.Range.create(p.Position.create(0,0),n),r)]}};await i.workspace.applyEdit(s)}}}},e=>{"use strict";function t(e){return e instanceof Buffer||e instanceof Date||e instanceof RegExp}function n(e){if(e instanceof Buffer){var t=Buffer.alloc?Buffer.alloc(e.length):new Buffer(e.length);return e.copy(t),t}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp)return new RegExp(e);throw new Error("Unexpected situation")}function r(e){var i=[];return e.forEach((function(e,o){"object"==typeof e&&null!==e?Array.isArray(e)?i[o]=r(e):t(e)?i[o]=n(e):i[o]=s({},e):i[o]=e})),i}function i(e,t){return"__proto__"===t?void 0:e[t]}var s=e.exports=function(){if(arguments.length<1||"object"!=typeof arguments[0])return!1;if(arguments.length<2)return arguments[0];var e,o,a=arguments[0],u=Array.prototype.slice.call(arguments,1);return u.forEach((function(u){"object"!=typeof u||null===u||Array.isArray(u)||Object.keys(u).forEach((function(c){return o=i(a,c),(e=i(u,c))===a?void 0:"object"!=typeof e||null===e?void(a[c]=e):Array.isArray(e)?void(a[c]=r(e)):t(e)?void(a[c]=n(e)):"object"!=typeof o||null===o||Array.isArray(o)?void(a[c]=s({},e)):void(a[c]=s(o,e))}))})),a}},e=>{"use strict";e.exports=require("fs")},(e,t,n)=>{"use strict";var r=n(6);e.exports=r},(e,t,n)=>{"use strict";var r=n(7),i=n(36);function s(e){return function(){throw new Error("Function "+e+" is deprecated and cannot be used.")}}e.exports.Type=n(13),e.exports.Schema=n(12),e.exports.FAILSAFE_SCHEMA=n(16),e.exports.JSON_SCHEMA=n(15),e.exports.CORE_SCHEMA=n(14),e.exports.DEFAULT_SAFE_SCHEMA=n(11),e.exports.DEFAULT_FULL_SCHEMA=n(31),e.exports.load=r.load,e.exports.loadAll=r.loadAll,e.exports.safeLoad=r.safeLoad,e.exports.safeLoadAll=r.safeLoadAll,e.exports.dump=i.dump,e.exports.safeDump=i.safeDump,e.exports.YAMLException=n(9),e.exports.MINIMAL_SCHEMA=n(16),e.exports.SAFE_SCHEMA=n(11),e.exports.DEFAULT_SCHEMA=n(31),e.exports.scan=s("scan"),e.exports.parse=s("parse"),e.exports.compose=s("compose"),e.exports.addConstructor=s("addConstructor")},(e,t,n)=>{"use strict";var r=n(8),i=n(9),s=n(10),o=n(11),a=n(31),u=Object.prototype.hasOwnProperty,c=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,l=/[\x85\u2028\u2029]/,h=/[,\[\]\{\}]/,p=/^(?:!|!!|![a-z\-]+!)$/i,d=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function f(e){return Object.prototype.toString.call(e)}function m(e){return 10===e||13===e}function g(e){return 9===e||32===e}function x(e){return 9===e||32===e||10===e||13===e}function y(e){return 44===e||91===e||93===e||123===e||125===e}function D(e){var t;return 48<=e&&e<=57?e-48:97<=(t=32|e)&&t<=102?t-97+10:-1}function C(e){return 48===e?"\0":97===e?"\a":98===e?"\b":116===e||9===e?"\t":110===e?"\n":118===e?"\v":102===e?"\f":114===e?"\r":101===e?"\e":32===e?" ":34===e?'"':47===e?"/":92===e?"\\":78===e?"\85":95===e?" ":76===e?"\u2028":80===e?"\u2029":""}function v(e){return e<=65535?String.fromCharCode(e):String.fromCharCode(55296+(e-65536>>10),56320+(e-65536&1023))}for(var E=new Array(256),k=new Array(256),b=0;b<256;b++)E[b]=C(b)?1:0,k[b]=C(b);function A(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||a,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.documents=[]}function w(e,t){return new i(t,new s(e.filename,e.input,e.position,e.line,e.position-e.lineStart))}function S(e,t){throw w(e,t)}function _(e,t){e.onWarning&&e.onWarning.call(null,w(e,t))}var F={YAML:function(e,t,n){var r,i,s;null!==e.version&&S(e,"duplication of %YAML directive"),1!==n.length&&S(e,"YAML directive accepts exactly one argument"),null===(r=/^([0-9]+)\.([0-9]+)$/.exec(n[0]))&&S(e,"ill-formed argument of the YAML directive"),i=parseInt(r[1],10),s=parseInt(r[2],10),1!==i&&S(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=s<2,1!==s&&2!==s&&_(e,"unsupported YAML version of the document")},TAG:function(e,t,n){var r,i;2!==n.length&&S(e,"TAG directive accepts exactly two arguments"),r=n[0],i=n[1],p.test(r)||S(e,"ill-formed tag handle (first argument) of the TAG directive"),u.call(e.tagMap,r)&&S(e,'there is a previously declared suffix for "'+r+'" tag handle'),d.test(i)||S(e,"ill-formed tag prefix (second argument) of the TAG directive"),e.tagMap[r]=i}};function T(e,t,n,r){var i,s,o,a;if(t<n){if(a=e.input.slice(t,n),r)for(i=0,s=a.length;i<s;i+=1)9===(o=a.charCodeAt(i))||32<=o&&o<=1114111||S(e,"expected valid JSON character");else c.test(a)&&S(e,"the stream contains non-printable characters");e.result+=a}}function N(e,t,n,i){var s,o,a,c;for(r.isObject(n)||S(e,"cannot merge mappings; the provided source object is unacceptable"),a=0,c=(s=Object.keys(n)).length;a<c;a+=1)o=s[a],u.call(t,o)||(t[o]=n[o],i[o]=!0)}function M(e,t,n,r,i,s,o,a){var c,l;if(Array.isArray(i))for(c=0,l=(i=Array.prototype.slice.call(i)).length;c<l;c+=1)Array.isArray(i[c])&&S(e,"nested arrays are not supported inside keys"),"object"==typeof i&&"[object Object]"===f(i[c])&&(i[c]="[object Object]");if("object"==typeof i&&"[object Object]"===f(i)&&(i="[object Object]"),i=String(i),null===t&&(t={}),"tag:yaml.org,2002:merge"===r)if(Array.isArray(s))for(c=0,l=s.length;c<l;c+=1)N(e,t,s[c],n);else N(e,t,s,n);else e.json||u.call(n,i)||!u.call(t,i)||(e.line=o||e.line,e.position=a||e.position,S(e,"duplicated mapping key")),t[i]=s,delete n[i];return t}function R(e){var t;10===(t=e.input.charCodeAt(e.position))?e.position++:13===t?(e.position++,10===e.input.charCodeAt(e.position)&&e.position++):S(e,"a line break is expected"),e.line+=1,e.lineStart=e.position}function I(e,t,n){for(var r=0,i=e.input.charCodeAt(e.position);0!==i;){for(;g(i);)i=e.input.charCodeAt(++e.position);if(t&&35===i)do{i=e.input.charCodeAt(++e.position)}while(10!==i&&13!==i&&0!==i);if(!m(i))break;for(R(e),i=e.input.charCodeAt(e.position),r++,e.lineIndent=0;32===i;)e.lineIndent++,i=e.input.charCodeAt(++e.position)}return-1!==n&&0!==r&&e.lineIndent<n&&_(e,"deficient indentation"),r}function B(e){var t,n=e.position;return!(45!==(t=e.input.charCodeAt(n))&&46!==t||t!==e.input.charCodeAt(n+1)||t!==e.input.charCodeAt(n+2)||(n+=3,0!==(t=e.input.charCodeAt(n))&&!x(t)))}function L(e,t){1===t?e.result+=" ":t>1&&(e.result+=r.repeat("\n",t-1))}function q(e,t){var n,r,i=e.tag,s=e.anchor,o=[],a=!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=o),r=e.input.charCodeAt(e.position);0!==r&&45===r&&x(e.input.charCodeAt(e.position+1));)if(a=!0,e.position++,I(e,!0,-1)&&e.lineIndent<=t)o.push(null),r=e.input.charCodeAt(e.position);else if(n=e.line,z(e,t,3,!1,!0),o.push(e.result),I(e,!0,-1),r=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&0!==r)S(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break;return!!a&&(e.tag=i,e.anchor=s,e.kind="sequence",e.result=o,!0)}function P(e){var t,n,r,i,s=!1,o=!1;if(33!==(i=e.input.charCodeAt(e.position)))return!1;if(null!==e.tag&&S(e,"duplication of a tag property"),60===(i=e.input.charCodeAt(++e.position))?(s=!0,i=e.input.charCodeAt(++e.position)):33===i?(o=!0,n="!!",i=e.input.charCodeAt(++e.position)):n="!",t=e.position,s){do{i=e.input.charCodeAt(++e.position)}while(0!==i&&62!==i);e.position<e.length?(r=e.input.slice(t,e.position),i=e.input.charCodeAt(++e.position)):S(e,"unexpected end of the stream within a verbatim tag")}else{for(;0!==i&&!x(i);)33===i&&(o?S(e,"tag suffix cannot contain exclamation marks"):(n=e.input.slice(t-1,e.position+1),p.test(n)||S(e,"named tag handle cannot contain such characters"),o=!0,t=e.position+1)),i=e.input.charCodeAt(++e.position);r=e.input.slice(t,e.position),h.test(r)&&S(e,"tag suffix cannot contain flow indicator characters")}return r&&!d.test(r)&&S(e,"tag name cannot contain such characters: "+r),s?e.tag=r:u.call(e.tagMap,n)?e.tag=e.tagMap[n]+r:"!"===n?e.tag="!"+r:"!!"===n?e.tag="tag:yaml.org,2002:"+r:S(e,'undeclared tag handle "'+n+'"'),!0}function O(e){var t,n;if(38!==(n=e.input.charCodeAt(e.position)))return!1;for(null!==e.anchor&&S(e,"duplication of an anchor property"),n=e.input.charCodeAt(++e.position),t=e.position;0!==n&&!x(n)&&!y(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&S(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function z(e,t,n,i,s){var o,a,c,l,h,p,d,f,C=1,b=!1,A=!1;if(null!==e.listener&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,o=a=c=4===n||3===n,i&&I(e,!0,-1)&&(b=!0,e.lineIndent>t?C=1:e.lineIndent===t?C=0:e.lineIndent<t&&(C=-1)),1===C)for(;P(e)||O(e);)I(e,!0,-1)?(b=!0,c=o,e.lineIndent>t?C=1:e.lineIndent===t?C=0:e.lineIndent<t&&(C=-1)):c=!1;if(c&&(c=b||s),1!==C&&4!==n||(d=1===n||2===n?t:t+1,f=e.position-e.lineStart,1===C?c&&(q(e,f)||function(e,t,n){var r,i,s,o,a,u=e.tag,c=e.anchor,l={},h={},p=null,d=null,f=null,m=!1,y=!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=l),a=e.input.charCodeAt(e.position);0!==a;){if(r=e.input.charCodeAt(e.position+1),s=e.line,o=e.position,63!==a&&58!==a||!x(r)){if(!z(e,n,2,!1,!0))break;if(e.line===s){for(a=e.input.charCodeAt(e.position);g(a);)a=e.input.charCodeAt(++e.position);if(58===a)x(a=e.input.charCodeAt(++e.position))||S(e,"a whitespace character is expected after the key-value separator within a block mapping"),m&&(M(e,l,h,p,d,null),p=d=f=null),y=!0,m=!1,i=!1,p=e.tag,d=e.result;else{if(!y)return e.tag=u,e.anchor=c,!0;S(e,"can not read an implicit mapping pair; a colon is missed")}}else{if(!y)return e.tag=u,e.anchor=c,!0;S(e,"can not read a block mapping entry; a multiline key may not be an implicit key")}}else 63===a?(m&&(M(e,l,h,p,d,null),p=d=f=null),y=!0,m=!0,i=!0):m?(m=!1,i=!0):S(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,a=r;if((e.line===s||e.lineIndent>t)&&(z(e,t,4,!0,i)&&(m?d=e.result:f=e.result),m||(M(e,l,h,p,d,f,s,o),p=d=f=null),I(e,!0,-1),a=e.input.charCodeAt(e.position)),e.lineIndent>t&&0!==a)S(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return m&&M(e,l,h,p,d,null),y&&(e.tag=u,e.anchor=c,e.kind="mapping",e.result=l),y}(e,f,d))||function(e,t){var n,r,i,s,o,a,u,c,l,h,p=!0,d=e.tag,f=e.anchor,m={};if(91===(h=e.input.charCodeAt(e.position)))i=93,a=!1,r=[];else{if(123!==h)return!1;i=125,a=!0,r={}}for(null!==e.anchor&&(e.anchorMap[e.anchor]=r),h=e.input.charCodeAt(++e.position);0!==h;){if(I(e,!0,t),(h=e.input.charCodeAt(e.position))===i)return e.position++,e.tag=d,e.anchor=f,e.kind=a?"mapping":"sequence",e.result=r,!0;p||S(e,"missed comma between flow collection entries"),l=null,s=o=!1,63===h&&x(e.input.charCodeAt(e.position+1))&&(s=o=!0,e.position++,I(e,!0,t)),n=e.line,z(e,t,1,!1,!0),c=e.tag,u=e.result,I(e,!0,t),h=e.input.charCodeAt(e.position),!o&&e.line!==n||58!==h||(s=!0,h=e.input.charCodeAt(++e.position),I(e,!0,t),z(e,t,1,!1,!0),l=e.result),a?M(e,r,m,c,u,l):s?r.push(M(e,null,m,c,u,l)):r.push(u),I(e,!0,t),44===(h=e.input.charCodeAt(e.position))?(p=!0,h=e.input.charCodeAt(++e.position)):p=!1}S(e,"unexpected end of the stream within a flow collection")}(e,d)?A=!0:(a&&function(e,t){var n,i,s,o,a,u=1,c=!1,l=!1,h=t,p=0,d=!1;if(124===(o=e.input.charCodeAt(e.position)))i=!1;else{if(62!==o)return!1;i=!0}for(e.kind="scalar",e.result="";0!==o;)if(43===(o=e.input.charCodeAt(++e.position))||45===o)1===u?u=43===o?3:2:S(e,"repeat of a chomping mode identifier");else{if(!((s=48<=(a=o)&&a<=57?a-48:-1)>=0))break;0===s?S(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):l?S(e,"repeat of an indentation width identifier"):(h=t+s-1,l=!0)}if(g(o)){do{o=e.input.charCodeAt(++e.position)}while(g(o));if(35===o)do{o=e.input.charCodeAt(++e.position)}while(!m(o)&&0!==o)}for(;0!==o;){for(R(e),e.lineIndent=0,o=e.input.charCodeAt(e.position);(!l||e.lineIndent<h)&&32===o;)e.lineIndent++,o=e.input.charCodeAt(++e.position);if(!l&&e.lineIndent>h&&(h=e.lineIndent),m(o))p++;else{if(e.lineIndent<h){3===u?e.result+=r.repeat("\n",c?1+p:p):1===u&&c&&(e.result+="\n");break}for(i?g(o)?(d=!0,e.result+=r.repeat("\n",c?1+p:p)):d?(d=!1,e.result+=r.repeat("\n",p+1)):0===p?c&&(e.result+=" "):e.result+=r.repeat("\n",p):e.result+=r.repeat("\n",c?1+p:p),c=!0,l=!0,p=0,n=e.position;!m(o)&&0!==o;)o=e.input.charCodeAt(++e.position);T(e,n,e.position,!1)}}return!0}(e,d)||function(e,t){var n,r,i;if(39!==(n=e.input.charCodeAt(e.position)))return!1;for(e.kind="scalar",e.result="",e.position++,r=i=e.position;0!==(n=e.input.charCodeAt(e.position));)if(39===n){if(T(e,r,e.position,!0),39!==(n=e.input.charCodeAt(++e.position)))return!0;r=e.position,e.position++,i=e.position}else m(n)?(T(e,r,i,!0),L(e,I(e,!1,t)),r=i=e.position):e.position===e.lineStart&&B(e)?S(e,"unexpected end of the document within a single quoted scalar"):(e.position++,i=e.position);S(e,"unexpected end of the stream within a single quoted scalar")}(e,d)||function(e,t){var n,r,i,s,o,a,u;if(34!==(a=e.input.charCodeAt(e.position)))return!1;for(e.kind="scalar",e.result="",e.position++,n=r=e.position;0!==(a=e.input.charCodeAt(e.position));){if(34===a)return T(e,n,e.position,!0),e.position++,!0;if(92===a){if(T(e,n,e.position,!0),m(a=e.input.charCodeAt(++e.position)))I(e,!1,t);else if(a<256&&E[a])e.result+=k[a],e.position++;else if((o=120===(u=a)?2:117===u?4:85===u?8:0)>0){for(i=o,s=0;i>0;i--)(o=D(a=e.input.charCodeAt(++e.position)))>=0?s=(s<<4)+o:S(e,"expected hexadecimal character");e.result+=v(s),e.position++}else S(e,"unknown escape sequence");n=r=e.position}else m(a)?(T(e,n,r,!0),L(e,I(e,!1,t)),n=r=e.position):e.position===e.lineStart&&B(e)?S(e,"unexpected end of the document within a double quoted scalar"):(e.position++,r=e.position)}S(e,"unexpected end of the stream within a double quoted scalar")}(e,d)?A=!0:function(e){var t,n,r;if(42!==(r=e.input.charCodeAt(e.position)))return!1;for(r=e.input.charCodeAt(++e.position),t=e.position;0!==r&&!x(r)&&!y(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&S(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),e.anchorMap.hasOwnProperty(n)||S(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],I(e,!0,-1),!0}(e)?(A=!0,null===e.tag&&null===e.anchor||S(e,"alias node should not have any properties")):function(e,t,n){var r,i,s,o,a,u,c,l,h=e.kind,p=e.result;if(x(l=e.input.charCodeAt(e.position))||y(l)||35===l||38===l||42===l||33===l||124===l||62===l||39===l||34===l||37===l||64===l||96===l)return!1;if((63===l||45===l)&&(x(r=e.input.charCodeAt(e.position+1))||n&&y(r)))return!1;for(e.kind="scalar",e.result="",i=s=e.position,o=!1;0!==l;){if(58===l){if(x(r=e.input.charCodeAt(e.position+1))||n&&y(r))break}else if(35===l){if(x(e.input.charCodeAt(e.position-1)))break}else{if(e.position===e.lineStart&&B(e)||n&&y(l))break;if(m(l)){if(a=e.line,u=e.lineStart,c=e.lineIndent,I(e,!1,-1),e.lineIndent>=t){o=!0,l=e.input.charCodeAt(e.position);continue}e.position=s,e.line=a,e.lineStart=u,e.lineIndent=c;break}}o&&(T(e,i,s,!1),L(e,e.line-a),i=s=e.position,o=!1),g(l)||(s=e.position+1),l=e.input.charCodeAt(++e.position)}return T(e,i,s,!1),!!e.result||(e.kind=h,e.result=p,!1)}(e,d,1===n)&&(A=!0,null===e.tag&&(e.tag="?")),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):0===C&&(A=c&&q(e,f))),null!==e.tag&&"!"!==e.tag)if("?"===e.tag){for(null!==e.result&&"scalar"!==e.kind&&S(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),l=0,h=e.implicitTypes.length;l<h;l+=1)if((p=e.implicitTypes[l]).resolve(e.result)){e.result=p.construct(e.result),e.tag=p.tag,null!==e.anchor&&(e.anchorMap[e.anchor]=e.result);break}}else u.call(e.typeMap[e.kind||"fallback"],e.tag)?(p=e.typeMap[e.kind||"fallback"][e.tag],null!==e.result&&p.kind!==e.kind&&S(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+p.kind+'", not "'+e.kind+'"'),p.resolve(e.result)?(e.result=p.construct(e.result),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):S(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")):S(e,"unknown tag !<"+e.tag+">");return null!==e.listener&&e.listener("close",e),null!==e.tag||null!==e.anchor||A}function j(e){var t,n,r,i,s=e.position,o=!1;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap={},e.anchorMap={};0!==(i=e.input.charCodeAt(e.position))&&(I(e,!0,-1),i=e.input.charCodeAt(e.position),!(e.lineIndent>0||37!==i));){for(o=!0,i=e.input.charCodeAt(++e.position),t=e.position;0!==i&&!x(i);)i=e.input.charCodeAt(++e.position);for(r=[],(n=e.input.slice(t,e.position)).length<1&&S(e,"directive name must not be less than one character in length");0!==i;){for(;g(i);)i=e.input.charCodeAt(++e.position);if(35===i){do{i=e.input.charCodeAt(++e.position)}while(0!==i&&!m(i));break}if(m(i))break;for(t=e.position;0!==i&&!x(i);)i=e.input.charCodeAt(++e.position);r.push(e.input.slice(t,e.position))}0!==i&&R(e),u.call(F,n)?F[n](e,n,r):_(e,'unknown document directive "'+n+'"')}I(e,!0,-1),0===e.lineIndent&&45===e.input.charCodeAt(e.position)&&45===e.input.charCodeAt(e.position+1)&&45===e.input.charCodeAt(e.position+2)?(e.position+=3,I(e,!0,-1)):o&&S(e,"directives end mark is expected"),z(e,e.lineIndent-1,4,!1,!0),I(e,!0,-1),e.checkLineBreaks&&l.test(e.input.slice(s,e.position))&&_(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&B(e)?46===e.input.charCodeAt(e.position)&&(e.position+=3,I(e,!0,-1)):e.position<e.length-1&&S(e,"end of the stream or a document separator is expected")}function U(e,t){t=t||{},0!==(e=String(e)).length&&(10!==e.charCodeAt(e.length-1)&&13!==e.charCodeAt(e.length-1)&&(e+="\n"),65279===e.charCodeAt(0)&&(e=e.slice(1)));var n=new A(e,t),r=e.indexOf("\0");for(-1!==r&&(n.position=r,S(n,"null byte is not allowed in input")),n.input+="\0";32===n.input.charCodeAt(n.position);)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)j(n);return n.documents}function J(e,t,n){null!==t&&"object"==typeof t&&void 0===n&&(n=t,t=null);var r=U(e,n);if("function"!=typeof t)return r;for(var i=0,s=r.length;i<s;i+=1)t(r[i])}function X(e,t){var n=U(e,t);if(0!==n.length){if(1===n.length)return n[0];throw new i("expected a single document in the stream, but found more")}}e.exports.loadAll=J,e.exports.load=X,e.exports.safeLoadAll=function(e,t,n){return"object"==typeof t&&null!==t&&void 0===n&&(n=t,t=null),J(e,t,r.extend({schema:o},n))},e.exports.safeLoad=function(e,t){return X(e,r.extend({schema:o},t))}},e=>{"use strict";function t(e){return null==e}e.exports.isNothing=t,e.exports.isObject=function(e){return"object"==typeof e&&null!==e},e.exports.toArray=function(e){return Array.isArray(e)?e:t(e)?[]:[e]},e.exports.repeat=function(e,t){var n,r="";for(n=0;n<t;n+=1)r+=e;return r},e.exports.isNegativeZero=function(e){return 0===e&&Number.NEGATIVE_INFINITY===1/e},e.exports.extend=function(e,t){var n,r,i,s;if(t)for(n=0,r=(s=Object.keys(t)).length;n<r;n+=1)e[i=s[n]]=t[i];return e}},e=>{"use strict";function t(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=(this.reason||"(unknown reason)")+(this.mark?" "+this.mark.toString():""),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack||""}t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t.prototype.toString=function(e){var t=this.name+": ";return t+=this.reason||"(unknown reason)",!e&&this.mark&&(t+=" "+this.mark.toString()),t},e.exports=t},(e,t,n)=>{"use strict";var r=n(8);function i(e,t,n,r,i){this.name=e,this.buffer=t,this.position=n,this.line=r,this.column=i}i.prototype.getSnippet=function(e,t){var n,i,s,o,a;if(!this.buffer)return null;for(e=e||4,t=t||75,n="",i=this.position;i>0&&-1==="\0\r\n\85\u2028\u2029".indexOf(this.buffer.charAt(i-1));)if(i-=1,this.position-i>t/2-1){n=" ... ",i+=5;break}for(s="",o=this.position;o<this.buffer.length&&-1==="\0\r\n\85\u2028\u2029".indexOf(this.buffer.charAt(o));)if((o+=1)-this.position>t/2-1){s=" ... ",o-=5;break}return a=this.buffer.slice(i,o),r.repeat(" ",e)+n+a+s+"\n"+r.repeat(" ",e+this.position-i+n.length)+"^"},i.prototype.toString=function(e){var t,n="";return this.name&&(n+='in "'+this.name+'" '),n+="at line "+(this.line+1)+", column "+(this.column+1),e||(t=this.getSnippet())&&(n+=":\n"+t),n},e.exports=i},(e,t,n)=>{"use strict";var r=n(12);e.exports=new r({include:[n(14)],implicit:[n(24),n(25)],explicit:[n(26),n(28),n(29),n(30)]})},(e,t,n)=>{"use strict";var r=n(8),i=n(9),s=n(13);function o(e,t,n){var r=[];return e.include.forEach((function(e){n=o(e,t,n)})),e[t].forEach((function(e){n.forEach((function(t,n){t.tag===e.tag&&t.kind===e.kind&&r.push(n)})),n.push(e)})),n.filter((function(e,t){return-1===r.indexOf(t)}))}function a(e){this.include=e.include||[],this.implicit=e.implicit||[],this.explicit=e.explicit||[],this.implicit.forEach((function(e){if(e.loadKind&&"scalar"!==e.loadKind)throw new i("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.")})),this.compiledImplicit=o(this,"implicit",[]),this.compiledExplicit=o(this,"explicit",[]),this.compiledTypeMap=function(){var e,t,n={scalar:{},sequence:{},mapping:{},fallback:{}};function r(e){n[e.kind][e.tag]=n.fallback[e.tag]=e}for(e=0,t=arguments.length;e<t;e+=1)arguments[e].forEach(r);return n}(this.compiledImplicit,this.compiledExplicit)}a.DEFAULT=null,a.create=function(){var e,t;switch(arguments.length){case 1:e=a.DEFAULT,t=arguments[0];break;case 2:e=arguments[0],t=arguments[1];break;default:throw new i("Wrong number of arguments for Schema.create function")}if(e=r.toArray(e),t=r.toArray(t),!e.every((function(e){return e instanceof a})))throw new i("Specified list of super schemas (or a single Schema object) contains a non-Schema object.");if(!t.every((function(e){return e instanceof s})))throw new i("Specified list of YAML types (or a single Type object) contains a non-Type object.");return new a({include:e,explicit:t})},e.exports=a},(e,t,n)=>{"use strict";var r=n(9),i=["kind","resolve","construct","instanceOf","predicate","represent","defaultStyle","styleAliases"],s=["scalar","sequence","mapping"];e.exports=function(e,t){var n,o;if(t=t||{},Object.keys(t).forEach((function(t){if(-1===i.indexOf(t))throw new r('Unknown option "'+t+'" is met in definition of "'+e+'" YAML type.')})),this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(e){return e},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.defaultStyle=t.defaultStyle||null,this.styleAliases=(n=t.styleAliases||null,o={},null!==n&&Object.keys(n).forEach((function(e){n[e].forEach((function(t){o[String(t)]=e}))})),o),-1===s.indexOf(this.kind))throw new r('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}},(e,t,n)=>{"use strict";var r=n(12);e.exports=new r({include:[n(15)]})},(e,t,n)=>{"use strict";var r=n(12);e.exports=new r({include:[n(16)],implicit:[n(20),n(21),n(22),n(23)]})},(e,t,n)=>{"use strict";var r=n(12);e.exports=new r({explicit:[n(17),n(18),n(19)]})},(e,t,n)=>{"use strict";var r=n(13);e.exports=new r("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return null!==e?e:""}})},(e,t,n)=>{"use strict";var r=n(13);e.exports=new r("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return null!==e?e:[]}})},(e,t,n)=>{"use strict";var r=n(13);e.exports=new r("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return null!==e?e:{}}})},(e,t,n)=>{"use strict";var r=n(13);e.exports=new r("tag:yaml.org,2002:null",{kind:"scalar",resolve:function(e){if(null===e)return!0;var t=e.length;return 1===t&&"~"===e||4===t&&("null"===e||"Null"===e||"NULL"===e)},construct:function(){return null},predicate:function(e){return null===e},represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"}},defaultStyle:"lowercase"})},(e,t,n)=>{"use strict";var r=n(13);e.exports=new r("tag:yaml.org,2002:bool",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t=e.length;return 4===t&&("true"===e||"True"===e||"TRUE"===e)||5===t&&("false"===e||"False"===e||"FALSE"===e)},construct:function(e){return"true"===e||"True"===e||"TRUE"===e},predicate:function(e){return"[object Boolean]"===Object.prototype.toString.call(e)},represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"})},(e,t,n)=>{"use strict";var r=n(8),i=n(13);function s(e){return 48<=e&&e<=55}function o(e){return 48<=e&&e<=57}e.exports=new i("tag:yaml.org,2002:int",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t,n,r=e.length,i=0,a=!1;if(!r)return!1;if("-"!==(t=e[i])&&"+"!==t||(t=e[++i]),"0"===t){if(i+1===r)return!0;if("b"===(t=e[++i])){for(i++;i<r;i++)if("_"!==(t=e[i])){if("0"!==t&&"1"!==t)return!1;a=!0}return a&&"_"!==t}if("x"===t){for(i++;i<r;i++)if("_"!==(t=e[i])){if(!(48<=(n=e.charCodeAt(i))&&n<=57||65<=n&&n<=70||97<=n&&n<=102))return!1;a=!0}return a&&"_"!==t}for(;i<r;i++)if("_"!==(t=e[i])){if(!s(e.charCodeAt(i)))return!1;a=!0}return a&&"_"!==t}if("_"===t)return!1;for(;i<r;i++)if("_"!==(t=e[i])){if(":"===t)break;if(!o(e.charCodeAt(i)))return!1;a=!0}return!(!a||"_"===t)&&(":"!==t||/^(:[0-5]?[0-9])+$/.test(e.slice(i)))},construct:function(e){var t,n,r=e,i=1,s=[];return-1!==r.indexOf("_")&&(r=r.replace(/_/g,"")),"-"!==(t=r[0])&&"+"!==t||("-"===t&&(i=-1),t=(r=r.slice(1))[0]),"0"===r?0:"0"===t?"b"===r[1]?i*parseInt(r.slice(2),2):"x"===r[1]?i*parseInt(r,16):i*parseInt(r,8):-1!==r.indexOf(":")?(r.split(":").forEach((function(e){s.unshift(parseInt(e,10))})),r=0,n=1,s.forEach((function(e){r+=e*n,n*=60})),i*r):i*parseInt(r,10)},predicate:function(e){return"[object Number]"===Object.prototype.toString.call(e)&&e%1==0&&!r.isNegativeZero(e)},represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0"+e.toString(8):"-0"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}})},(e,t,n)=>{"use strict";var r=n(8),i=n(13),s=new RegExp("^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),o=/^[-+]?[0-9]+e/;e.exports=new i("tag:yaml.org,2002:float",{kind:"scalar",resolve:function(e){return null!==e&&!(!s.test(e)||"_"===e[e.length-1])},construct:function(e){var t,n,r,i;return n="-"===(t=e.replace(/_/g,"").toLowerCase())[0]?-1:1,i=[],"+-".indexOf(t[0])>=0&&(t=t.slice(1)),".inf"===t?1===n?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===t?NaN:t.indexOf(":")>=0?(t.split(":").forEach((function(e){i.unshift(parseFloat(e,10))})),t=0,r=1,i.forEach((function(e){t+=e*r,r*=60})),n*t):n*parseFloat(t,10)},predicate:function(e){return"[object Number]"===Object.prototype.toString.call(e)&&(e%1!=0||r.isNegativeZero(e))},represent:function(e,t){var n;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(r.isNegativeZero(e))return"-0.0";return n=e.toString(10),o.test(n)?n.replace("e",".e"):n},defaultStyle:"lowercase"})},(e,t,n)=>{"use strict";var r=n(13),i=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),s=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");e.exports=new r("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:function(e){return null!==e&&(null!==i.exec(e)||null!==s.exec(e))},construct:function(e){var t,n,r,o,a,u,c,l,h=0,p=null;if(null===(t=i.exec(e))&&(t=s.exec(e)),null===t)throw new Error("Date resolve error");if(n=+t[1],r=+t[2]-1,o=+t[3],!t[4])return new Date(Date.UTC(n,r,o));if(a=+t[4],u=+t[5],c=+t[6],t[7]){for(h=t[7].slice(0,3);h.length<3;)h+="0";h=+h}return t[9]&&(p=6e4*(60*+t[10]+ +(t[11]||0)),"-"===t[9]&&(p=-p)),l=new Date(Date.UTC(n,r,o,a,u,c,h)),p&&l.setTime(l.getTime()-p),l},instanceOf:Date,represent:function(e){return e.toISOString()}})},(e,t,n)=>{"use strict";var r=n(13);e.exports=new r("tag:yaml.org,2002:merge",{kind:"scalar",resolve:function(e){return"<<"===e||null===e}})},(e,t,n)=>{"use strict";var r;try{r=n(27).Buffer}catch(e){}var i=n(13),s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";e.exports=new i("tag:yaml.org,2002:binary",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t,n,r=0,i=e.length,o=s;for(n=0;n<i;n++)if(!((t=o.indexOf(e.charAt(n)))>64)){if(t<0)return!1;r+=6}return r%8==0},construct:function(e){var t,n,i=e.replace(/[\r\n=]/g,""),o=i.length,a=s,u=0,c=[];for(t=0;t<o;t++)t%4==0&&t&&(c.push(u>>16&255),c.push(u>>8&255),c.push(255&u)),u=u<<6|a.indexOf(i.charAt(t));return 0==(n=o%4*6)?(c.push(u>>16&255),c.push(u>>8&255),c.push(255&u)):18===n?(c.push(u>>10&255),c.push(u>>2&255)):12===n&&c.push(u>>4&255),r?r.from?r.from(c):new r(c):c},predicate:function(e){return r&&r.isBuffer(e)},represent:function(e){var t,n,r="",i=0,o=e.length,a=s;for(t=0;t<o;t++)t%3==0&&t&&(r+=a[i>>18&63],r+=a[i>>12&63],r+=a[i>>6&63],r+=a[63&i]),i=(i<<8)+e[t];return 0==(n=o%3)?(r+=a[i>>18&63],r+=a[i>>12&63],r+=a[i>>6&63],r+=a[63&i]):2===n?(r+=a[i>>10&63],r+=a[i>>4&63],r+=a[i<<2&63],r+=a[64]):1===n&&(r+=a[i>>2&63],r+=a[i<<4&63],r+=a[64],r+=a[64]),r}})},e=>{"use strict";e.exports=require("buffer")},(e,t,n)=>{"use strict";var r=n(13),i=Object.prototype.hasOwnProperty,s=Object.prototype.toString;e.exports=new r("tag:yaml.org,2002:omap",{kind:"sequence",resolve:function(e){if(null===e)return!0;var t,n,r,o,a,u=[],c=e;for(t=0,n=c.length;t<n;t+=1){if(r=c[t],a=!1,"[object Object]"!==s.call(r))return!1;for(o in r)if(i.call(r,o)){if(a)return!1;a=!0}if(!a)return!1;if(-1!==u.indexOf(o))return!1;u.push(o)}return!0},construct:function(e){return null!==e?e:[]}})},(e,t,n)=>{"use strict";var r=n(13),i=Object.prototype.toString;e.exports=new r("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:function(e){if(null===e)return!0;var t,n,r,s,o,a=e;for(o=new Array(a.length),t=0,n=a.length;t<n;t+=1){if(r=a[t],"[object Object]"!==i.call(r))return!1;if(1!==(s=Object.keys(r)).length)return!1;o[t]=[s[0],r[s[0]]]}return!0},construct:function(e){if(null===e)return[];var t,n,r,i,s,o=e;for(s=new Array(o.length),t=0,n=o.length;t<n;t+=1)r=o[t],i=Object.keys(r),s[t]=[i[0],r[i[0]]];return s}})},(e,t,n)=>{"use strict";var r=n(13),i=Object.prototype.hasOwnProperty;e.exports=new r("tag:yaml.org,2002:set",{kind:"mapping",resolve:function(e){if(null===e)return!0;var t,n=e;for(t in n)if(i.call(n,t)&&null!==n[t])return!1;return!0},construct:function(e){return null!==e?e:{}}})},(e,t,n)=>{"use strict";var r=n(12);e.exports=r.DEFAULT=new r({include:[n(11)],explicit:[n(32),n(33),n(34)]})},(e,t,n)=>{"use strict";var r=n(13);e.exports=new r("tag:yaml.org,2002:js/undefined",{kind:"scalar",resolve:function(){return!0},construct:function(){},predicate:function(e){return void 0===e},represent:function(){return""}})},(e,t,n)=>{"use strict";var r=n(13);e.exports=new r("tag:yaml.org,2002:js/regexp",{kind:"scalar",resolve:function(e){if(null===e)return!1;if(0===e.length)return!1;var t=e,n=/\/([gim]*)$/.exec(e),r="";if("/"===t[0]){if(n&&(r=n[1]),r.length>3)return!1;if("/"!==t[t.length-r.length-1])return!1}return!0},construct:function(e){var t=e,n=/\/([gim]*)$/.exec(e),r="";return"/"===t[0]&&(n&&(r=n[1]),t=t.slice(1,t.length-r.length-1)),new RegExp(t,r)},predicate:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},represent:function(e){var t="/"+e.source+"/";return e.global&&(t+="g"),e.multiline&&(t+="m"),e.ignoreCase&&(t+="i"),t}})},(e,t,n)=>{"use strict";var r;try{r=n(35)}catch(e){"undefined"!=typeof window&&(r=window.esprima)}var i=n(13);e.exports=new i("tag:yaml.org,2002:js/function",{kind:"scalar",resolve:function(e){if(null===e)return!1;try{var t="("+e+")",n=r.parse(t,{range:!0});return"Program"===n.type&&1===n.body.length&&"ExpressionStatement"===n.body[0].type&&("ArrowFunctionExpression"===n.body[0].expression.type||"FunctionExpression"===n.body[0].expression.type)}catch(e){return!1}},construct:function(e){var t,n="("+e+")",i=r.parse(n,{range:!0}),s=[];if("Program"!==i.type||1!==i.body.length||"ExpressionStatement"!==i.body[0].type||"ArrowFunctionExpression"!==i.body[0].expression.type&&"FunctionExpression"!==i.body[0].expression.type)throw new Error("Failed to resolve function");return i.body[0].expression.params.forEach((function(e){s.push(e.name)})),t=i.body[0].expression.body.range,"BlockStatement"===i.body[0].expression.body.type?new Function(s,n.slice(t[0]+1,t[1]-1)):new Function(s,"return "+n.slice(t[0],t[1]))},predicate:function(e){return"[object Function]"===Object.prototype.toString.call(e)},represent:function(e){return e.toString()}})},function(e){var t;t=function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={exports:{},id:r,loaded:!1};return e[r].call(i.exports,i,i.exports,n),i.loaded=!0,i.exports}return n.m=e,n.c=t,n.p="",n(0)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),i=n(3),s=n(8),o=n(15);function a(e,t,n){var o=null,a=function(e,t){n&&n(e,t),o&&o.visit(e,t)},u="function"==typeof n?a:null,c=!1;if(t){c="boolean"==typeof t.comment&&t.comment;var l="boolean"==typeof t.attachComment&&t.attachComment;(c||l)&&((o=new r.CommentHandler).attach=l,t.comment=!0,u=a)}var h,p=!1;t&&"string"==typeof t.sourceType&&(p="module"===t.sourceType),h=t&&"boolean"==typeof t.jsx&&t.jsx?new i.JSXParser(e,t,u):new s.Parser(e,t,u);var d=p?h.parseModule():h.parseScript();return c&&o&&(d.comments=o.comments),h.config.tokens&&(d.tokens=h.tokens),h.config.tolerant&&(d.errors=h.errorHandler.errors),d}t.parse=a,t.parseModule=function(e,t,n){var r=t||{};return r.sourceType="module",a(e,r,n)},t.parseScript=function(e,t,n){var r=t||{};return r.sourceType="script",a(e,r,n)},t.tokenize=function(e,t,n){var r,i=new o.Tokenizer(e,t);r=[];try{for(;;){var s=i.getNextToken();if(!s)break;n&&(s=n(s)),r.push(s)}}catch(e){i.errorHandler.tolerate(e)}return i.errorHandler.tolerant&&(r.errors=i.errors()),r};var u=n(2);t.Syntax=u.Syntax,t.version="4.0.1"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2),i=function(){function e(){this.attach=!1,this.comments=[],this.stack=[],this.leading=[],this.trailing=[]}return e.prototype.insertInnerComments=function(e,t){if(e.type===r.Syntax.BlockStatement&&0===e.body.length){for(var n=[],i=this.leading.length-1;i>=0;--i){var s=this.leading[i];t.end.offset>=s.start&&(n.unshift(s.comment),this.leading.splice(i,1),this.trailing.splice(i,1))}n.length&&(e.innerComments=n)}},e.prototype.findTrailingComments=function(e){var t=[];if(this.trailing.length>0){for(var n=this.trailing.length-1;n>=0;--n){var r=this.trailing[n];r.start>=e.end.offset&&t.unshift(r.comment)}return this.trailing.length=0,t}var i=this.stack[this.stack.length-1];if(i&&i.node.trailingComments){var s=i.node.trailingComments[0];s&&s.range[0]>=e.end.offset&&(t=i.node.trailingComments,delete i.node.trailingComments)}return t},e.prototype.findLeadingComments=function(e){for(var t,n=[];this.stack.length>0&&(s=this.stack[this.stack.length-1])&&s.start>=e.start.offset;)t=s.node,this.stack.pop();if(t){for(var r=(t.leadingComments?t.leadingComments.length:0)-1;r>=0;--r){var i=t.leadingComments[r];i.range[1]<=e.start.offset&&(n.unshift(i),t.leadingComments.splice(r,1))}return t.leadingComments&&0===t.leadingComments.length&&delete t.leadingComments,n}for(r=this.leading.length-1;r>=0;--r){var s;(s=this.leading[r]).start<=e.start.offset&&(n.unshift(s.comment),this.leading.splice(r,1))}return n},e.prototype.visitNode=function(e,t){if(!(e.type===r.Syntax.Program&&e.body.length>0)){this.insertInnerComments(e,t);var n=this.findTrailingComments(t),i=this.findLeadingComments(t);i.length>0&&(e.leadingComments=i),n.length>0&&(e.trailingComments=n),this.stack.push({node:e,start:t.start.offset})}},e.prototype.visitComment=function(e,t){var n="L"===e.type[0]?"Line":"Block",r={type:n,value:e.value};if(e.range&&(r.range=e.range),e.loc&&(r.loc=e.loc),this.comments.push(r),this.attach){var i={comment:{type:n,value:e.value,range:[t.start.offset,t.end.offset]},start:t.start.offset};e.loc&&(i.comment.loc=e.loc),e.type=n,this.leading.push(i),this.trailing.push(i)}},e.prototype.visit=function(e,t){"LineComment"===e.type||"BlockComment"===e.type?this.visitComment(e,t):this.attach&&this.visitNode(e,t)},e}();t.CommentHandler=i},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Syntax={AssignmentExpression:"AssignmentExpression",AssignmentPattern:"AssignmentPattern",ArrayExpression:"ArrayExpression",ArrayPattern:"ArrayPattern",ArrowFunctionExpression:"ArrowFunctionExpression",AwaitExpression:"AwaitExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ClassBody:"ClassBody",ClassDeclaration:"ClassDeclaration",ClassExpression:"ClassExpression",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DoWhileStatement:"DoWhileStatement",DebuggerStatement:"DebuggerStatement",EmptyStatement:"EmptyStatement",ExportAllDeclaration:"ExportAllDeclaration",ExportDefaultDeclaration:"ExportDefaultDeclaration",ExportNamedDeclaration:"ExportNamedDeclaration",ExportSpecifier:"ExportSpecifier",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForOfStatement:"ForOfStatement",ForInStatement:"ForInStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",Identifier:"Identifier",IfStatement:"IfStatement",ImportDeclaration:"ImportDeclaration",ImportDefaultSpecifier:"ImportDefaultSpecifier",ImportNamespaceSpecifier:"ImportNamespaceSpecifier",ImportSpecifier:"ImportSpecifier",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",MetaProperty:"MetaProperty",MethodDefinition:"MethodDefinition",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",ObjectPattern:"ObjectPattern",Program:"Program",Property:"Property",RestElement:"RestElement",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SpreadElement:"SpreadElement",Super:"Super",SwitchCase:"SwitchCase",SwitchStatement:"SwitchStatement",TaggedTemplateExpression:"TaggedTemplateExpression",TemplateElement:"TemplateElement",TemplateLiteral:"TemplateLiteral",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement",YieldExpression:"YieldExpression"}},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var s=n(4),o=n(5),a=n(6),u=n(7),c=n(8),l=n(13),h=n(14);function p(e){var t;switch(e.type){case a.JSXSyntax.JSXIdentifier:t=e.name;break;case a.JSXSyntax.JSXNamespacedName:var n=e;t=p(n.namespace)+":"+p(n.name);break;case a.JSXSyntax.JSXMemberExpression:var r=e;t=p(r.object)+"."+p(r.property)}return t}l.TokenName[100]="JSXIdentifier",l.TokenName[101]="JSXText";var d=function(e){function t(t,n,r){return e.call(this,t,n,r)||this}return i(t,e),t.prototype.parsePrimaryExpression=function(){return this.match("<")?this.parseJSXRoot():e.prototype.parsePrimaryExpression.call(this)},t.prototype.startJSX=function(){this.scanner.index=this.startMarker.index,this.scanner.lineNumber=this.startMarker.line,this.scanner.lineStart=this.startMarker.index-this.startMarker.column},t.prototype.finishJSX=function(){this.nextToken()},t.prototype.reenterJSX=function(){this.startJSX(),this.expectJSX("}"),this.config.tokens&&this.tokens.pop()},t.prototype.createJSXNode=function(){return this.collectComments(),{index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}},t.prototype.createJSXChildNode=function(){return{index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}},t.prototype.scanXHTMLEntity=function(e){for(var t="&",n=!0,r=!1,i=!1,o=!1;!this.scanner.eof()&&n&&!r;){var a=this.scanner.source[this.scanner.index];if(a===e)break;if(r=";"===a,t+=a,++this.scanner.index,!r)switch(t.length){case 2:i="#"===a;break;case 3:i&&(n=(o="x"===a)||s.Character.isDecimalDigit(a.charCodeAt(0)),i=i&&!o);break;default:n=(n=n&&!(i&&!s.Character.isDecimalDigit(a.charCodeAt(0))))&&!(o&&!s.Character.isHexDigit(a.charCodeAt(0)))}}if(n&&r&&t.length>2){var u=t.substr(1,t.length-2);i&&u.length>1?t=String.fromCharCode(parseInt(u.substr(1),10)):o&&u.length>2?t=String.fromCharCode(parseInt("0"+u.substr(1),16)):i||o||!h.XHTMLEntities[u]||(t=h.XHTMLEntities[u])}return t},t.prototype.lexJSX=function(){var e=this.scanner.source.charCodeAt(this.scanner.index);if(60===e||62===e||47===e||58===e||61===e||123===e||125===e)return{type:7,value:a=this.scanner.source[this.scanner.index++],lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:this.scanner.index-1,end:this.scanner.index};if(34===e||39===e){for(var t=this.scanner.index,n=this.scanner.source[this.scanner.index++],r="";!this.scanner.eof()&&(u=this.scanner.source[this.scanner.index++])!==n;)r+="&"===u?this.scanXHTMLEntity(n):u;return{type:8,value:r,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:t,end:this.scanner.index}}if(46===e){var i=this.scanner.source.charCodeAt(this.scanner.index+1),o=this.scanner.source.charCodeAt(this.scanner.index+2),a=46===i&&46===o?"...":".";return t=this.scanner.index,this.scanner.index+=a.length,{type:7,value:a,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:t,end:this.scanner.index}}if(96===e)return{type:10,value:"",lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:this.scanner.index,end:this.scanner.index};if(s.Character.isIdentifierStart(e)&&92!==e){for(t=this.scanner.index,++this.scanner.index;!this.scanner.eof();){var u=this.scanner.source.charCodeAt(this.scanner.index);if(s.Character.isIdentifierPart(u)&&92!==u)++this.scanner.index;else{if(45!==u)break;++this.scanner.index}}return{type:100,value:this.scanner.source.slice(t,this.scanner.index),lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:t,end:this.scanner.index}}return this.scanner.lex()},t.prototype.nextJSXToken=function(){this.collectComments(),this.startMarker.index=this.scanner.index,this.startMarker.line=this.scanner.lineNumber,this.startMarker.column=this.scanner.index-this.scanner.lineStart;var e=this.lexJSX();return this.lastMarker.index=this.scanner.index,this.lastMarker.line=this.scanner.lineNumber,this.lastMarker.column=this.scanner.index-this.scanner.lineStart,this.config.tokens&&this.tokens.push(this.convertToken(e)),e},t.prototype.nextJSXText=function(){this.startMarker.index=this.scanner.index,this.startMarker.line=this.scanner.lineNumber,this.startMarker.column=this.scanner.index-this.scanner.lineStart;for(var e=this.scanner.index,t="";!this.scanner.eof();){var n=this.scanner.source[this.scanner.index];if("{"===n||"<"===n)break;++this.scanner.index,t+=n,s.Character.isLineTerminator(n.charCodeAt(0))&&(++this.scanner.lineNumber,"\r"===n&&"\n"===this.scanner.source[this.scanner.index]&&++this.scanner.index,this.scanner.lineStart=this.scanner.index)}this.lastMarker.index=this.scanner.index,this.lastMarker.line=this.scanner.lineNumber,this.lastMarker.column=this.scanner.index-this.scanner.lineStart;var r={type:101,value:t,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:e,end:this.scanner.index};return t.length>0&&this.config.tokens&&this.tokens.push(this.convertToken(r)),r},t.prototype.peekJSXToken=function(){var e=this.scanner.saveState();this.scanner.scanComments();var t=this.lexJSX();return this.scanner.restoreState(e),t},t.prototype.expectJSX=function(e){var t=this.nextJSXToken();7===t.type&&t.value===e||this.throwUnexpectedToken(t)},t.prototype.matchJSX=function(e){var t=this.peekJSXToken();return 7===t.type&&t.value===e},t.prototype.parseJSXIdentifier=function(){var e=this.createJSXNode(),t=this.nextJSXToken();return 100!==t.type&&this.throwUnexpectedToken(t),this.finalize(e,new o.JSXIdentifier(t.value))},t.prototype.parseJSXElementName=function(){var e=this.createJSXNode(),t=this.parseJSXIdentifier();if(this.matchJSX(":")){var n=t;this.expectJSX(":");var r=this.parseJSXIdentifier();t=this.finalize(e,new o.JSXNamespacedName(n,r))}else if(this.matchJSX("."))for(;this.matchJSX(".");){var i=t;this.expectJSX(".");var s=this.parseJSXIdentifier();t=this.finalize(e,new o.JSXMemberExpression(i,s))}return t},t.prototype.parseJSXAttributeName=function(){var e,t=this.createJSXNode(),n=this.parseJSXIdentifier();if(this.matchJSX(":")){var r=n;this.expectJSX(":");var i=this.parseJSXIdentifier();e=this.finalize(t,new o.JSXNamespacedName(r,i))}else e=n;return e},t.prototype.parseJSXStringLiteralAttribute=function(){var e=this.createJSXNode(),t=this.nextJSXToken();8!==t.type&&this.throwUnexpectedToken(t);var n=this.getTokenRaw(t);return this.finalize(e,new u.Literal(t.value,n))},t.prototype.parseJSXExpressionAttribute=function(){var e=this.createJSXNode();this.expectJSX("{"),this.finishJSX(),this.match("}")&&this.tolerateError("JSX attributes must only be assigned a non-empty expression");var t=this.parseAssignmentExpression();return this.reenterJSX(),this.finalize(e,new o.JSXExpressionContainer(t))},t.prototype.parseJSXAttributeValue=function(){return this.matchJSX("{")?this.parseJSXExpressionAttribute():this.matchJSX("<")?this.parseJSXElement():this.parseJSXStringLiteralAttribute()},t.prototype.parseJSXNameValueAttribute=function(){var e=this.createJSXNode(),t=this.parseJSXAttributeName(),n=null;return this.matchJSX("=")&&(this.expectJSX("="),n=this.parseJSXAttributeValue()),this.finalize(e,new o.JSXAttribute(t,n))},t.prototype.parseJSXSpreadAttribute=function(){var e=this.createJSXNode();this.expectJSX("{"),this.expectJSX("..."),this.finishJSX();var t=this.parseAssignmentExpression();return this.reenterJSX(),this.finalize(e,new o.JSXSpreadAttribute(t))},t.prototype.parseJSXAttributes=function(){for(var e=[];!this.matchJSX("/")&&!this.matchJSX(">");){var t=this.matchJSX("{")?this.parseJSXSpreadAttribute():this.parseJSXNameValueAttribute();e.push(t)}return e},t.prototype.parseJSXOpeningElement=function(){var e=this.createJSXNode();this.expectJSX("<");var t=this.parseJSXElementName(),n=this.parseJSXAttributes(),r=this.matchJSX("/");return r&&this.expectJSX("/"),this.expectJSX(">"),this.finalize(e,new o.JSXOpeningElement(t,r,n))},t.prototype.parseJSXBoundaryElement=function(){var e=this.createJSXNode();if(this.expectJSX("<"),this.matchJSX("/")){this.expectJSX("/");var t=this.parseJSXElementName();return this.expectJSX(">"),this.finalize(e,new o.JSXClosingElement(t))}var n=this.parseJSXElementName(),r=this.parseJSXAttributes(),i=this.matchJSX("/");return i&&this.expectJSX("/"),this.expectJSX(">"),this.finalize(e,new o.JSXOpeningElement(n,i,r))},t.prototype.parseJSXEmptyExpression=function(){var e=this.createJSXChildNode();return this.collectComments(),this.lastMarker.index=this.scanner.index,this.lastMarker.line=this.scanner.lineNumber,this.lastMarker.column=this.scanner.index-this.scanner.lineStart,this.finalize(e,new o.JSXEmptyExpression)},t.prototype.parseJSXExpressionContainer=function(){var e,t=this.createJSXNode();return this.expectJSX("{"),this.matchJSX("}")?(e=this.parseJSXEmptyExpression(),this.expectJSX("}")):(this.finishJSX(),e=this.parseAssignmentExpression(),this.reenterJSX()),this.finalize(t,new o.JSXExpressionContainer(e))},t.prototype.parseJSXChildren=function(){for(var e=[];!this.scanner.eof();){var t=this.createJSXChildNode(),n=this.nextJSXText();if(n.start<n.end){var r=this.getTokenRaw(n),i=this.finalize(t,new o.JSXText(n.value,r));e.push(i)}if("{"!==this.scanner.source[this.scanner.index])break;var s=this.parseJSXExpressionContainer();e.push(s)}return e},t.prototype.parseComplexJSXElement=function(e){for(var t=[];!this.scanner.eof();){e.children=e.children.concat(this.parseJSXChildren());var n=this.createJSXChildNode(),r=this.parseJSXBoundaryElement();if(r.type===a.JSXSyntax.JSXOpeningElement){var i=r;if(i.selfClosing){var s=this.finalize(n,new o.JSXElement(i,[],null));e.children.push(s)}else t.push(e),e={node:n,opening:i,closing:null,children:[]}}if(r.type===a.JSXSyntax.JSXClosingElement){e.closing=r;var u=p(e.opening.name);if(u!==p(e.closing.name)&&this.tolerateError("Expected corresponding JSX closing tag for %0",u),!(t.length>0))break;s=this.finalize(e.node,new o.JSXElement(e.opening,e.children,e.closing)),(e=t[t.length-1]).children.push(s),t.pop()}}return e},t.prototype.parseJSXElement=function(){var e=this.createJSXNode(),t=this.parseJSXOpeningElement(),n=[],r=null;if(!t.selfClosing){var i=this.parseComplexJSXElement({node:e,opening:t,closing:r,children:n});n=i.children,r=i.closing}return this.finalize(e,new o.JSXElement(t,n,r))},t.prototype.parseJSXRoot=function(){this.config.tokens&&this.tokens.pop(),this.startJSX();var e=this.parseJSXElement();return this.finishJSX(),e},t.prototype.isStartOfExpression=function(){return e.prototype.isStartOfExpression.call(this)||this.match("<")},t}(c.Parser);t.JSXParser=d},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={NonAsciiIdentifierStart:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]/,NonAsciiIdentifierPart:/[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/};t.Character={fromCodePoint:function(e){return e<65536?String.fromCharCode(e):String.fromCharCode(55296+(e-65536>>10))+String.fromCharCode(56320+(e-65536&1023))},isWhiteSpace:function(e){return 32===e||9===e||11===e||12===e||160===e||e>=5760&&[5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(e)>=0},isLineTerminator:function(e){return 10===e||13===e||8232===e||8233===e},isIdentifierStart:function(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||92===e||e>=128&&n.NonAsciiIdentifierStart.test(t.Character.fromCodePoint(e))},isIdentifierPart:function(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||92===e||e>=128&&n.NonAsciiIdentifierPart.test(t.Character.fromCodePoint(e))},isDecimalDigit:function(e){return e>=48&&e<=57},isHexDigit:function(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102},isOctalDigit:function(e){return e>=48&&e<=55}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6);t.JSXClosingElement=function(e){this.type=r.JSXSyntax.JSXClosingElement,this.name=e};t.JSXElement=function(e,t,n){this.type=r.JSXSyntax.JSXElement,this.openingElement=e,this.children=t,this.closingElement=n};t.JSXEmptyExpression=function(){this.type=r.JSXSyntax.JSXEmptyExpression};t.JSXExpressionContainer=function(e){this.type=r.JSXSyntax.JSXExpressionContainer,this.expression=e};t.JSXIdentifier=function(e){this.type=r.JSXSyntax.JSXIdentifier,this.name=e};t.JSXMemberExpression=function(e,t){this.type=r.JSXSyntax.JSXMemberExpression,this.object=e,this.property=t};t.JSXAttribute=function(e,t){this.type=r.JSXSyntax.JSXAttribute,this.name=e,this.value=t};t.JSXNamespacedName=function(e,t){this.type=r.JSXSyntax.JSXNamespacedName,this.namespace=e,this.name=t};t.JSXOpeningElement=function(e,t,n){this.type=r.JSXSyntax.JSXOpeningElement,this.name=e,this.selfClosing=t,this.attributes=n};t.JSXSpreadAttribute=function(e){this.type=r.JSXSyntax.JSXSpreadAttribute,this.argument=e};t.JSXText=function(e,t){this.type=r.JSXSyntax.JSXText,this.value=e,this.raw=t}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JSXSyntax={JSXAttribute:"JSXAttribute",JSXClosingElement:"JSXClosingElement",JSXElement:"JSXElement",JSXEmptyExpression:"JSXEmptyExpression",JSXExpressionContainer:"JSXExpressionContainer",JSXIdentifier:"JSXIdentifier",JSXMemberExpression:"JSXMemberExpression",JSXNamespacedName:"JSXNamespacedName",JSXOpeningElement:"JSXOpeningElement",JSXSpreadAttribute:"JSXSpreadAttribute",JSXText:"JSXText"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2);t.ArrayExpression=function(e){this.type=r.Syntax.ArrayExpression,this.elements=e};t.ArrayPattern=function(e){this.type=r.Syntax.ArrayPattern,this.elements=e};t.ArrowFunctionExpression=function(e,t,n){this.type=r.Syntax.ArrowFunctionExpression,this.id=null,this.params=e,this.body=t,this.generator=!1,this.expression=n,this.async=!1};t.AssignmentExpression=function(e,t,n){this.type=r.Syntax.AssignmentExpression,this.operator=e,this.left=t,this.right=n};t.AssignmentPattern=function(e,t){this.type=r.Syntax.AssignmentPattern,this.left=e,this.right=t};t.AsyncArrowFunctionExpression=function(e,t,n){this.type=r.Syntax.ArrowFunctionExpression,this.id=null,this.params=e,this.body=t,this.generator=!1,this.expression=n,this.async=!0};t.AsyncFunctionDeclaration=function(e,t,n){this.type=r.Syntax.FunctionDeclaration,this.id=e,this.params=t,this.body=n,this.generator=!1,this.expression=!1,this.async=!0};t.AsyncFunctionExpression=function(e,t,n){this.type=r.Syntax.FunctionExpression,this.id=e,this.params=t,this.body=n,this.generator=!1,this.expression=!1,this.async=!0};t.AwaitExpression=function(e){this.type=r.Syntax.AwaitExpression,this.argument=e};t.BinaryExpression=function(e,t,n){var i="||"===e||"&&"===e;this.type=i?r.Syntax.LogicalExpression:r.Syntax.BinaryExpression,this.operator=e,this.left=t,this.right=n};t.BlockStatement=function(e){this.type=r.Syntax.BlockStatement,this.body=e};t.BreakStatement=function(e){this.type=r.Syntax.BreakStatement,this.label=e};t.CallExpression=function(e,t){this.type=r.Syntax.CallExpression,this.callee=e,this.arguments=t};t.CatchClause=function(e,t){this.type=r.Syntax.CatchClause,this.param=e,this.body=t};t.ClassBody=function(e){this.type=r.Syntax.ClassBody,this.body=e};t.ClassDeclaration=function(e,t,n){this.type=r.Syntax.ClassDeclaration,this.id=e,this.superClass=t,this.body=n};t.ClassExpression=function(e,t,n){this.type=r.Syntax.ClassExpression,this.id=e,this.superClass=t,this.body=n};t.ComputedMemberExpression=function(e,t){this.type=r.Syntax.MemberExpression,this.computed=!0,this.object=e,this.property=t};t.ConditionalExpression=function(e,t,n){this.type=r.Syntax.ConditionalExpression,this.test=e,this.consequent=t,this.alternate=n};t.ContinueStatement=function(e){this.type=r.Syntax.ContinueStatement,this.label=e};t.DebuggerStatement=function(){this.type=r.Syntax.DebuggerStatement};t.Directive=function(e,t){this.type=r.Syntax.ExpressionStatement,this.expression=e,this.directive=t};t.DoWhileStatement=function(e,t){this.type=r.Syntax.DoWhileStatement,this.body=e,this.test=t};t.EmptyStatement=function(){this.type=r.Syntax.EmptyStatement};t.ExportAllDeclaration=function(e){this.type=r.Syntax.ExportAllDeclaration,this.source=e};t.ExportDefaultDeclaration=function(e){this.type=r.Syntax.ExportDefaultDeclaration,this.declaration=e};t.ExportNamedDeclaration=function(e,t,n){this.type=r.Syntax.ExportNamedDeclaration,this.declaration=e,this.specifiers=t,this.source=n};t.ExportSpecifier=function(e,t){this.type=r.Syntax.ExportSpecifier,this.exported=t,this.local=e};t.ExpressionStatement=function(e){this.type=r.Syntax.ExpressionStatement,this.expression=e};t.ForInStatement=function(e,t,n){this.type=r.Syntax.ForInStatement,this.left=e,this.right=t,this.body=n,this.each=!1};t.ForOfStatement=function(e,t,n){this.type=r.Syntax.ForOfStatement,this.left=e,this.right=t,this.body=n};t.ForStatement=function(e,t,n,i){this.type=r.Syntax.ForStatement,this.init=e,this.test=t,this.update=n,this.body=i};t.FunctionDeclaration=function(e,t,n,i){this.type=r.Syntax.FunctionDeclaration,this.id=e,this.params=t,this.body=n,this.generator=i,this.expression=!1,this.async=!1};t.FunctionExpression=function(e,t,n,i){this.type=r.Syntax.FunctionExpression,this.id=e,this.params=t,this.body=n,this.generator=i,this.expression=!1,this.async=!1};t.Identifier=function(e){this.type=r.Syntax.Identifier,this.name=e};t.IfStatement=function(e,t,n){this.type=r.Syntax.IfStatement,this.test=e,this.consequent=t,this.alternate=n};t.ImportDeclaration=function(e,t){this.type=r.Syntax.ImportDeclaration,this.specifiers=e,this.source=t};t.ImportDefaultSpecifier=function(e){this.type=r.Syntax.ImportDefaultSpecifier,this.local=e};t.ImportNamespaceSpecifier=function(e){this.type=r.Syntax.ImportNamespaceSpecifier,this.local=e};t.ImportSpecifier=function(e,t){this.type=r.Syntax.ImportSpecifier,this.local=e,this.imported=t};t.LabeledStatement=function(e,t){this.type=r.Syntax.LabeledStatement,this.label=e,this.body=t};t.Literal=function(e,t){this.type=r.Syntax.Literal,this.value=e,this.raw=t};t.MetaProperty=function(e,t){this.type=r.Syntax.MetaProperty,this.meta=e,this.property=t};t.MethodDefinition=function(e,t,n,i,s){this.type=r.Syntax.MethodDefinition,this.key=e,this.computed=t,this.value=n,this.kind=i,this.static=s};t.Module=function(e){this.type=r.Syntax.Program,this.body=e,this.sourceType="module"};t.NewExpression=function(e,t){this.type=r.Syntax.NewExpression,this.callee=e,this.arguments=t};t.ObjectExpression=function(e){this.type=r.Syntax.ObjectExpression,this.properties=e};t.ObjectPattern=function(e){this.type=r.Syntax.ObjectPattern,this.properties=e};t.Property=function(e,t,n,i,s,o){this.type=r.Syntax.Property,this.key=t,this.computed=n,this.value=i,this.kind=e,this.method=s,this.shorthand=o};t.RegexLiteral=function(e,t,n,i){this.type=r.Syntax.Literal,this.value=e,this.raw=t,this.regex={pattern:n,flags:i}};t.RestElement=function(e){this.type=r.Syntax.RestElement,this.argument=e};t.ReturnStatement=function(e){this.type=r.Syntax.ReturnStatement,this.argument=e};t.Script=function(e){this.type=r.Syntax.Program,this.body=e,this.sourceType="script"};t.SequenceExpression=function(e){this.type=r.Syntax.SequenceExpression,this.expressions=e};t.SpreadElement=function(e){this.type=r.Syntax.SpreadElement,this.argument=e};t.StaticMemberExpression=function(e,t){this.type=r.Syntax.MemberExpression,this.computed=!1,this.object=e,this.property=t};t.Super=function(){this.type=r.Syntax.Super};t.SwitchCase=function(e,t){this.type=r.Syntax.SwitchCase,this.test=e,this.consequent=t};t.SwitchStatement=function(e,t){this.type=r.Syntax.SwitchStatement,this.discriminant=e,this.cases=t};t.TaggedTemplateExpression=function(e,t){this.type=r.Syntax.TaggedTemplateExpression,this.tag=e,this.quasi=t};t.TemplateElement=function(e,t){this.type=r.Syntax.TemplateElement,this.value=e,this.tail=t};t.TemplateLiteral=function(e,t){this.type=r.Syntax.TemplateLiteral,this.quasis=e,this.expressions=t};t.ThisExpression=function(){this.type=r.Syntax.ThisExpression};t.ThrowStatement=function(e){this.type=r.Syntax.ThrowStatement,this.argument=e};t.TryStatement=function(e,t,n){this.type=r.Syntax.TryStatement,this.block=e,this.handler=t,this.finalizer=n};t.UnaryExpression=function(e,t){this.type=r.Syntax.UnaryExpression,this.operator=e,this.argument=t,this.prefix=!0};t.UpdateExpression=function(e,t,n){this.type=r.Syntax.UpdateExpression,this.operator=e,this.argument=t,this.prefix=n};t.VariableDeclaration=function(e,t){this.type=r.Syntax.VariableDeclaration,this.declarations=e,this.kind=t};t.VariableDeclarator=function(e,t){this.type=r.Syntax.VariableDeclarator,this.id=e,this.init=t};t.WhileStatement=function(e,t){this.type=r.Syntax.WhileStatement,this.test=e,this.body=t};t.WithStatement=function(e,t){this.type=r.Syntax.WithStatement,this.object=e,this.body=t};t.YieldExpression=function(e,t){this.type=r.Syntax.YieldExpression,this.argument=e,this.delegate=t}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(9),i=n(10),s=n(11),o=n(7),a=n(12),u=n(2),c=n(13),l="ArrowParameterPlaceHolder",h=function(){function e(e,t,n){void 0===t&&(t={}),this.config={range:"boolean"==typeof t.range&&t.range,loc:"boolean"==typeof t.loc&&t.loc,source:null,tokens:"boolean"==typeof t.tokens&&t.tokens,comment:"boolean"==typeof t.comment&&t.comment,tolerant:"boolean"==typeof t.tolerant&&t.tolerant},this.config.loc&&t.source&&null!==t.source&&(this.config.source=String(t.source)),this.delegate=n,this.errorHandler=new i.ErrorHandler,this.errorHandler.tolerant=this.config.tolerant,this.scanner=new a.Scanner(e,this.errorHandler),this.scanner.trackComment=this.config.comment,this.operatorPrecedence={")":0,";":0,",":0,"=":0,"]":0,"||":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":11,"/":11,"%":11},this.lookahead={type:2,value:"",lineNumber:this.scanner.lineNumber,lineStart:0,start:0,end:0},this.hasLineTerminator=!1,this.context={isModule:!1,await:!1,allowIn:!0,allowStrictDirective:!0,allowYield:!0,firstCoverInitializedNameError:null,isAssignmentTarget:!1,isBindingElement:!1,inFunctionBody:!1,inIteration:!1,inSwitch:!1,labelSet:{},strict:!1},this.tokens=[],this.startMarker={index:0,line:this.scanner.lineNumber,column:0},this.lastMarker={index:0,line:this.scanner.lineNumber,column:0},this.nextToken(),this.lastMarker={index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}}return e.prototype.throwError=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var i=Array.prototype.slice.call(arguments,1),s=e.replace(/%(\d)/g,(function(e,t){return r.assert(t<i.length,"Message reference must be in range"),i[t]})),o=this.lastMarker.index,a=this.lastMarker.line,u=this.lastMarker.column+1;throw this.errorHandler.createError(o,a,u,s)},e.prototype.tolerateError=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var i=Array.prototype.slice.call(arguments,1),s=e.replace(/%(\d)/g,(function(e,t){return r.assert(t<i.length,"Message reference must be in range"),i[t]})),o=this.lastMarker.index,a=this.scanner.lineNumber,u=this.lastMarker.column+1;this.errorHandler.tolerateError(o,a,u,s)},e.prototype.unexpectedTokenError=function(e,t){var n,r=t||s.Messages.UnexpectedToken;if(e?(t||(r=2===e.type?s.Messages.UnexpectedEOS:3===e.type?s.Messages.UnexpectedIdentifier:6===e.type?s.Messages.UnexpectedNumber:8===e.type?s.Messages.UnexpectedString:10===e.type?s.Messages.UnexpectedTemplate:s.Messages.UnexpectedToken,4===e.type&&(this.scanner.isFutureReservedWord(e.value)?r=s.Messages.UnexpectedReserved:this.context.strict&&this.scanner.isStrictModeReservedWord(e.value)&&(r=s.Messages.StrictReservedWord))),n=e.value):n="ILLEGAL",r=r.replace("%0",n),e&&"number"==typeof e.lineNumber){var i=e.start,o=e.lineNumber,a=this.lastMarker.index-this.lastMarker.column,u=e.start-a+1;return this.errorHandler.createError(i,o,u,r)}return i=this.lastMarker.index,o=this.lastMarker.line,u=this.lastMarker.column+1,this.errorHandler.createError(i,o,u,r)},e.prototype.throwUnexpectedToken=function(e,t){throw this.unexpectedTokenError(e,t)},e.prototype.tolerateUnexpectedToken=function(e,t){this.errorHandler.tolerate(this.unexpectedTokenError(e,t))},e.prototype.collectComments=function(){if(this.config.comment){var e=this.scanner.scanComments();if(e.length>0&&this.delegate)for(var t=0;t<e.length;++t){var n=e[t],r=void 0;r={type:n.multiLine?"BlockComment":"LineComment",value:this.scanner.source.slice(n.slice[0],n.slice[1])},this.config.range&&(r.range=n.range),this.config.loc&&(r.loc=n.loc);var i={start:{line:n.loc.start.line,column:n.loc.start.column,offset:n.range[0]},end:{line:n.loc.end.line,column:n.loc.end.column,offset:n.range[1]}};this.delegate(r,i)}}else this.scanner.scanComments()},e.prototype.getTokenRaw=function(e){return this.scanner.source.slice(e.start,e.end)},e.prototype.convertToken=function(e){var t={type:c.TokenName[e.type],value:this.getTokenRaw(e)};if(this.config.range&&(t.range=[e.start,e.end]),this.config.loc&&(t.loc={start:{line:this.startMarker.line,column:this.startMarker.column},end:{line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}}),9===e.type){var n=e.pattern,r=e.flags;t.regex={pattern:n,flags:r}}return t},e.prototype.nextToken=function(){var e=this.lookahead;this.lastMarker.index=this.scanner.index,this.lastMarker.line=this.scanner.lineNumber,this.lastMarker.column=this.scanner.index-this.scanner.lineStart,this.collectComments(),this.scanner.index!==this.startMarker.index&&(this.startMarker.index=this.scanner.index,this.startMarker.line=this.scanner.lineNumber,this.startMarker.column=this.scanner.index-this.scanner.lineStart);var t=this.scanner.lex();return this.hasLineTerminator=e.lineNumber!==t.lineNumber,t&&this.context.strict&&3===t.type&&this.scanner.isStrictModeReservedWord(t.value)&&(t.type=4),this.lookahead=t,this.config.tokens&&2!==t.type&&this.tokens.push(this.convertToken(t)),e},e.prototype.nextRegexToken=function(){this.collectComments();var e=this.scanner.scanRegExp();return this.config.tokens&&(this.tokens.pop(),this.tokens.push(this.convertToken(e))),this.lookahead=e,this.nextToken(),e},e.prototype.createNode=function(){return{index:this.startMarker.index,line:this.startMarker.line,column:this.startMarker.column}},e.prototype.startNode=function(e,t){void 0===t&&(t=0);var n=e.start-e.lineStart,r=e.lineNumber;return n<0&&(n+=t,r--),{index:e.start,line:r,column:n}},e.prototype.finalize=function(e,t){if(this.config.range&&(t.range=[e.index,this.lastMarker.index]),this.config.loc&&(t.loc={start:{line:e.line,column:e.column},end:{line:this.lastMarker.line,column:this.lastMarker.column}},this.config.source&&(t.loc.source=this.config.source)),this.delegate){var n={start:{line:e.line,column:e.column,offset:e.index},end:{line:this.lastMarker.line,column:this.lastMarker.column,offset:this.lastMarker.index}};this.delegate(t,n)}return t},e.prototype.expect=function(e){var t=this.nextToken();7===t.type&&t.value===e||this.throwUnexpectedToken(t)},e.prototype.expectCommaSeparator=function(){if(this.config.tolerant){var e=this.lookahead;7===e.type&&","===e.value?this.nextToken():7===e.type&&";"===e.value?(this.nextToken(),this.tolerateUnexpectedToken(e)):this.tolerateUnexpectedToken(e,s.Messages.UnexpectedToken)}else this.expect(",")},e.prototype.expectKeyword=function(e){var t=this.nextToken();4===t.type&&t.value===e||this.throwUnexpectedToken(t)},e.prototype.match=function(e){return 7===this.lookahead.type&&this.lookahead.value===e},e.prototype.matchKeyword=function(e){return 4===this.lookahead.type&&this.lookahead.value===e},e.prototype.matchContextualKeyword=function(e){return 3===this.lookahead.type&&this.lookahead.value===e},e.prototype.matchAssign=function(){if(7!==this.lookahead.type)return!1;var e=this.lookahead.value;return"="===e||"*="===e||"**="===e||"/="===e||"%="===e||"+="===e||"-="===e||"<<="===e||">>="===e||">>>="===e||"&="===e||"^="===e||"|="===e},e.prototype.isolateCoverGrammar=function(e){var t=this.context.isBindingElement,n=this.context.isAssignmentTarget,r=this.context.firstCoverInitializedNameError;this.context.isBindingElement=!0,this.context.isAssignmentTarget=!0,this.context.firstCoverInitializedNameError=null;var i=e.call(this);return null!==this.context.firstCoverInitializedNameError&&this.throwUnexpectedToken(this.context.firstCoverInitializedNameError),this.context.isBindingElement=t,this.context.isAssignmentTarget=n,this.context.firstCoverInitializedNameError=r,i},e.prototype.inheritCoverGrammar=function(e){var t=this.context.isBindingElement,n=this.context.isAssignmentTarget,r=this.context.firstCoverInitializedNameError;this.context.isBindingElement=!0,this.context.isAssignmentTarget=!0,this.context.firstCoverInitializedNameError=null;var i=e.call(this);return this.context.isBindingElement=this.context.isBindingElement&&t,this.context.isAssignmentTarget=this.context.isAssignmentTarget&&n,this.context.firstCoverInitializedNameError=r||this.context.firstCoverInitializedNameError,i},e.prototype.consumeSemicolon=function(){this.match(";")?this.nextToken():this.hasLineTerminator||(2===this.lookahead.type||this.match("}")||this.throwUnexpectedToken(this.lookahead),this.lastMarker.index=this.startMarker.index,this.lastMarker.line=this.startMarker.line,this.lastMarker.column=this.startMarker.column)},e.prototype.parsePrimaryExpression=function(){var e,t,n,r=this.createNode();switch(this.lookahead.type){case 3:(this.context.isModule||this.context.await)&&"await"===this.lookahead.value&&this.tolerateUnexpectedToken(this.lookahead),e=this.matchAsyncFunction()?this.parseFunctionExpression():this.finalize(r,new o.Identifier(this.nextToken().value));break;case 6:case 8:this.context.strict&&this.lookahead.octal&&this.tolerateUnexpectedToken(this.lookahead,s.Messages.StrictOctalLiteral),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,t=this.nextToken(),n=this.getTokenRaw(t),e=this.finalize(r,new o.Literal(t.value,n));break;case 1:this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,t=this.nextToken(),n=this.getTokenRaw(t),e=this.finalize(r,new o.Literal("true"===t.value,n));break;case 5:this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,t=this.nextToken(),n=this.getTokenRaw(t),e=this.finalize(r,new o.Literal(null,n));break;case 10:e=this.parseTemplateLiteral();break;case 7:switch(this.lookahead.value){case"(":this.context.isBindingElement=!1,e=this.inheritCoverGrammar(this.parseGroupExpression);break;case"[":e=this.inheritCoverGrammar(this.parseArrayInitializer);break;case"{":e=this.inheritCoverGrammar(this.parseObjectInitializer);break;case"/":case"/=":this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,this.scanner.index=this.startMarker.index,t=this.nextRegexToken(),n=this.getTokenRaw(t),e=this.finalize(r,new o.RegexLiteral(t.regex,n,t.pattern,t.flags));break;default:e=this.throwUnexpectedToken(this.nextToken())}break;case 4:!this.context.strict&&this.context.allowYield&&this.matchKeyword("yield")?e=this.parseIdentifierName():!this.context.strict&&this.matchKeyword("let")?e=this.finalize(r,new o.Identifier(this.nextToken().value)):(this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,this.matchKeyword("function")?e=this.parseFunctionExpression():this.matchKeyword("this")?(this.nextToken(),e=this.finalize(r,new o.ThisExpression)):e=this.matchKeyword("class")?this.parseClassExpression():this.throwUnexpectedToken(this.nextToken()));break;default:e=this.throwUnexpectedToken(this.nextToken())}return e},e.prototype.parseSpreadElement=function(){var e=this.createNode();this.expect("...");var t=this.inheritCoverGrammar(this.parseAssignmentExpression);return this.finalize(e,new o.SpreadElement(t))},e.prototype.parseArrayInitializer=function(){var e=this.createNode(),t=[];for(this.expect("[");!this.match("]");)if(this.match(","))this.nextToken(),t.push(null);else if(this.match("...")){var n=this.parseSpreadElement();this.match("]")||(this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,this.expect(",")),t.push(n)}else t.push(this.inheritCoverGrammar(this.parseAssignmentExpression)),this.match("]")||this.expect(",");return this.expect("]"),this.finalize(e,new o.ArrayExpression(t))},e.prototype.parsePropertyMethod=function(e){this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var t=this.context.strict,n=this.context.allowStrictDirective;this.context.allowStrictDirective=e.simple;var r=this.isolateCoverGrammar(this.parseFunctionSourceElements);return this.context.strict&&e.firstRestricted&&this.tolerateUnexpectedToken(e.firstRestricted,e.message),this.context.strict&&e.stricted&&this.tolerateUnexpectedToken(e.stricted,e.message),this.context.strict=t,this.context.allowStrictDirective=n,r},e.prototype.parsePropertyMethodFunction=function(){var e=this.createNode(),t=this.context.allowYield;this.context.allowYield=!0;var n=this.parseFormalParameters(),r=this.parsePropertyMethod(n);return this.context.allowYield=t,this.finalize(e,new o.FunctionExpression(null,n.params,r,!1))},e.prototype.parsePropertyMethodAsyncFunction=function(){var e=this.createNode(),t=this.context.allowYield,n=this.context.await;this.context.allowYield=!1,this.context.await=!0;var r=this.parseFormalParameters(),i=this.parsePropertyMethod(r);return this.context.allowYield=t,this.context.await=n,this.finalize(e,new o.AsyncFunctionExpression(null,r.params,i))},e.prototype.parseObjectPropertyKey=function(){var e,t=this.createNode(),n=this.nextToken();switch(n.type){case 8:case 6:this.context.strict&&n.octal&&this.tolerateUnexpectedToken(n,s.Messages.StrictOctalLiteral);var r=this.getTokenRaw(n);e=this.finalize(t,new o.Literal(n.value,r));break;case 3:case 1:case 5:case 4:e=this.finalize(t,new o.Identifier(n.value));break;case 7:"["===n.value?(e=this.isolateCoverGrammar(this.parseAssignmentExpression),this.expect("]")):e=this.throwUnexpectedToken(n);break;default:e=this.throwUnexpectedToken(n)}return e},e.prototype.isPropertyKey=function(e,t){return e.type===u.Syntax.Identifier&&e.name===t||e.type===u.Syntax.Literal&&e.value===t},e.prototype.parseObjectProperty=function(e){var t,n=this.createNode(),r=this.lookahead,i=null,a=null,u=!1,c=!1,l=!1,h=!1;if(3===r.type){var p=r.value;this.nextToken(),u=this.match("["),i=(h=!(this.hasLineTerminator||"async"!==p||this.match(":")||this.match("(")||this.match("*")||this.match(",")))?this.parseObjectPropertyKey():this.finalize(n,new o.Identifier(p))}else this.match("*")?this.nextToken():(u=this.match("["),i=this.parseObjectPropertyKey());var d=this.qualifiedPropertyName(this.lookahead);if(3===r.type&&!h&&"get"===r.value&&d)t="get",u=this.match("["),i=this.parseObjectPropertyKey(),this.context.allowYield=!1,a=this.parseGetterMethod();else if(3===r.type&&!h&&"set"===r.value&&d)t="set",u=this.match("["),i=this.parseObjectPropertyKey(),a=this.parseSetterMethod();else if(7===r.type&&"*"===r.value&&d)t="init",u=this.match("["),i=this.parseObjectPropertyKey(),a=this.parseGeneratorMethod(),c=!0;else if(i||this.throwUnexpectedToken(this.lookahead),t="init",this.match(":")&&!h)!u&&this.isPropertyKey(i,"__proto__")&&(e.value&&this.tolerateError(s.Messages.DuplicateProtoProperty),e.value=!0),this.nextToken(),a=this.inheritCoverGrammar(this.parseAssignmentExpression);else if(this.match("("))a=h?this.parsePropertyMethodAsyncFunction():this.parsePropertyMethodFunction(),c=!0;else if(3===r.type)if(p=this.finalize(n,new o.Identifier(r.value)),this.match("=")){this.context.firstCoverInitializedNameError=this.lookahead,this.nextToken(),l=!0;var f=this.isolateCoverGrammar(this.parseAssignmentExpression);a=this.finalize(n,new o.AssignmentPattern(p,f))}else l=!0,a=p;else this.throwUnexpectedToken(this.nextToken());return this.finalize(n,new o.Property(t,i,u,a,c,l))},e.prototype.parseObjectInitializer=function(){var e=this.createNode();this.expect("{");for(var t=[],n={value:!1};!this.match("}");)t.push(this.parseObjectProperty(n)),this.match("}")||this.expectCommaSeparator();return this.expect("}"),this.finalize(e,new o.ObjectExpression(t))},e.prototype.parseTemplateHead=function(){r.assert(this.lookahead.head,"Template literal must start with a template head");var e=this.createNode(),t=this.nextToken(),n=t.value,i=t.cooked;return this.finalize(e,new o.TemplateElement({raw:n,cooked:i},t.tail))},e.prototype.parseTemplateElement=function(){10!==this.lookahead.type&&this.throwUnexpectedToken();var e=this.createNode(),t=this.nextToken(),n=t.value,r=t.cooked;return this.finalize(e,new o.TemplateElement({raw:n,cooked:r},t.tail))},e.prototype.parseTemplateLiteral=function(){var e=this.createNode(),t=[],n=[],r=this.parseTemplateHead();for(n.push(r);!r.tail;)t.push(this.parseExpression()),r=this.parseTemplateElement(),n.push(r);return this.finalize(e,new o.TemplateLiteral(n,t))},e.prototype.reinterpretExpressionAsPattern=function(e){switch(e.type){case u.Syntax.Identifier:case u.Syntax.MemberExpression:case u.Syntax.RestElement:case u.Syntax.AssignmentPattern:break;case u.Syntax.SpreadElement:e.type=u.Syntax.RestElement,this.reinterpretExpressionAsPattern(e.argument);break;case u.Syntax.ArrayExpression:e.type=u.Syntax.ArrayPattern;for(var t=0;t<e.elements.length;t++)null!==e.elements[t]&&this.reinterpretExpressionAsPattern(e.elements[t]);break;case u.Syntax.ObjectExpression:for(e.type=u.Syntax.ObjectPattern,t=0;t<e.properties.length;t++)this.reinterpretExpressionAsPattern(e.properties[t].value);break;case u.Syntax.AssignmentExpression:e.type=u.Syntax.AssignmentPattern,delete e.operator,this.reinterpretExpressionAsPattern(e.left)}},e.prototype.parseGroupExpression=function(){var e;if(this.expect("("),this.match(")"))this.nextToken(),this.match("=>")||this.expect("=>"),e={type:l,params:[],async:!1};else{var t=this.lookahead,n=[];if(this.match("..."))e=this.parseRestElement(n),this.expect(")"),this.match("=>")||this.expect("=>"),e={type:l,params:[e],async:!1};else{var r=!1;if(this.context.isBindingElement=!0,e=this.inheritCoverGrammar(this.parseAssignmentExpression),this.match(",")){var i=[];for(this.context.isAssignmentTarget=!1,i.push(e);2!==this.lookahead.type&&this.match(",");){if(this.nextToken(),this.match(")")){this.nextToken();for(var s=0;s<i.length;s++)this.reinterpretExpressionAsPattern(i[s]);r=!0,e={type:l,params:i,async:!1}}else if(this.match("...")){for(this.context.isBindingElement||this.throwUnexpectedToken(this.lookahead),i.push(this.parseRestElement(n)),this.expect(")"),this.match("=>")||this.expect("=>"),this.context.isBindingElement=!1,s=0;s<i.length;s++)this.reinterpretExpressionAsPattern(i[s]);r=!0,e={type:l,params:i,async:!1}}else i.push(this.inheritCoverGrammar(this.parseAssignmentExpression));if(r)break}r||(e=this.finalize(this.startNode(t),new o.SequenceExpression(i)))}if(!r){if(this.expect(")"),this.match("=>")&&(e.type===u.Syntax.Identifier&&"yield"===e.name&&(r=!0,e={type:l,params:[e],async:!1}),!r)){if(this.context.isBindingElement||this.throwUnexpectedToken(this.lookahead),e.type===u.Syntax.SequenceExpression)for(s=0;s<e.expressions.length;s++)this.reinterpretExpressionAsPattern(e.expressions[s]);else this.reinterpretExpressionAsPattern(e);var a=e.type===u.Syntax.SequenceExpression?e.expressions:[e];e={type:l,params:a,async:!1}}this.context.isBindingElement=!1}}}return e},e.prototype.parseArguments=function(){this.expect("(");var e=[];if(!this.match(")"))for(;;){var t=this.match("...")?this.parseSpreadElement():this.isolateCoverGrammar(this.parseAssignmentExpression);if(e.push(t),this.match(")"))break;if(this.expectCommaSeparator(),this.match(")"))break}return this.expect(")"),e},e.prototype.isIdentifierName=function(e){return 3===e.type||4===e.type||1===e.type||5===e.type},e.prototype.parseIdentifierName=function(){var e=this.createNode(),t=this.nextToken();return this.isIdentifierName(t)||this.throwUnexpectedToken(t),this.finalize(e,new o.Identifier(t.value))},e.prototype.parseNewExpression=function(){var e,t=this.createNode(),n=this.parseIdentifierName();if(r.assert("new"===n.name,"New expression must start with `new`"),this.match("."))if(this.nextToken(),3===this.lookahead.type&&this.context.inFunctionBody&&"target"===this.lookahead.value){var i=this.parseIdentifierName();e=new o.MetaProperty(n,i)}else this.throwUnexpectedToken(this.lookahead);else{var s=this.isolateCoverGrammar(this.parseLeftHandSideExpression),a=this.match("(")?this.parseArguments():[];e=new o.NewExpression(s,a),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1}return this.finalize(t,e)},e.prototype.parseAsyncArgument=function(){var e=this.parseAssignmentExpression();return this.context.firstCoverInitializedNameError=null,e},e.prototype.parseAsyncArguments=function(){this.expect("(");var e=[];if(!this.match(")"))for(;;){var t=this.match("...")?this.parseSpreadElement():this.isolateCoverGrammar(this.parseAsyncArgument);if(e.push(t),this.match(")"))break;if(this.expectCommaSeparator(),this.match(")"))break}return this.expect(")"),e},e.prototype.parseLeftHandSideExpressionAllowCall=function(){var e,t=this.lookahead,n=this.matchContextualKeyword("async"),r=this.context.allowIn;for(this.context.allowIn=!0,this.matchKeyword("super")&&this.context.inFunctionBody?(e=this.createNode(),this.nextToken(),e=this.finalize(e,new o.Super),this.match("(")||this.match(".")||this.match("[")||this.throwUnexpectedToken(this.lookahead)):e=this.inheritCoverGrammar(this.matchKeyword("new")?this.parseNewExpression:this.parsePrimaryExpression);;)if(this.match(".")){this.context.isBindingElement=!1,this.context.isAssignmentTarget=!0,this.expect(".");var i=this.parseIdentifierName();e=this.finalize(this.startNode(t),new o.StaticMemberExpression(e,i))}else if(this.match("(")){var s=n&&t.lineNumber===this.lookahead.lineNumber;this.context.isBindingElement=!1,this.context.isAssignmentTarget=!1;var a=s?this.parseAsyncArguments():this.parseArguments();if(e=this.finalize(this.startNode(t),new o.CallExpression(e,a)),s&&this.match("=>")){for(var u=0;u<a.length;++u)this.reinterpretExpressionAsPattern(a[u]);e={type:l,params:a,async:!0}}}else if(this.match("["))this.context.isBindingElement=!1,this.context.isAssignmentTarget=!0,this.expect("["),i=this.isolateCoverGrammar(this.parseExpression),this.expect("]"),e=this.finalize(this.startNode(t),new o.ComputedMemberExpression(e,i));else{if(10!==this.lookahead.type||!this.lookahead.head)break;var c=this.parseTemplateLiteral();e=this.finalize(this.startNode(t),new o.TaggedTemplateExpression(e,c))}return this.context.allowIn=r,e},e.prototype.parseSuper=function(){var e=this.createNode();return this.expectKeyword("super"),this.match("[")||this.match(".")||this.throwUnexpectedToken(this.lookahead),this.finalize(e,new o.Super)},e.prototype.parseLeftHandSideExpression=function(){r.assert(this.context.allowIn,"callee of new expression always allow in keyword.");for(var e=this.startNode(this.lookahead),t=this.matchKeyword("super")&&this.context.inFunctionBody?this.parseSuper():this.inheritCoverGrammar(this.matchKeyword("new")?this.parseNewExpression:this.parsePrimaryExpression);;)if(this.match("[")){this.context.isBindingElement=!1,this.context.isAssignmentTarget=!0,this.expect("[");var n=this.isolateCoverGrammar(this.parseExpression);this.expect("]"),t=this.finalize(e,new o.ComputedMemberExpression(t,n))}else if(this.match("."))this.context.isBindingElement=!1,this.context.isAssignmentTarget=!0,this.expect("."),n=this.parseIdentifierName(),t=this.finalize(e,new o.StaticMemberExpression(t,n));else{if(10!==this.lookahead.type||!this.lookahead.head)break;var i=this.parseTemplateLiteral();t=this.finalize(e,new o.TaggedTemplateExpression(t,i))}return t},e.prototype.parseUpdateExpression=function(){var e,t=this.lookahead;if(this.match("++")||this.match("--")){var n=this.startNode(t),r=this.nextToken();e=this.inheritCoverGrammar(this.parseUnaryExpression),this.context.strict&&e.type===u.Syntax.Identifier&&this.scanner.isRestrictedWord(e.name)&&this.tolerateError(s.Messages.StrictLHSPrefix),this.context.isAssignmentTarget||this.tolerateError(s.Messages.InvalidLHSInAssignment);var i=!0;e=this.finalize(n,new o.UpdateExpression(r.value,e,i)),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1}else if(e=this.inheritCoverGrammar(this.parseLeftHandSideExpressionAllowCall),!this.hasLineTerminator&&7===this.lookahead.type&&(this.match("++")||this.match("--"))){this.context.strict&&e.type===u.Syntax.Identifier&&this.scanner.isRestrictedWord(e.name)&&this.tolerateError(s.Messages.StrictLHSPostfix),this.context.isAssignmentTarget||this.tolerateError(s.Messages.InvalidLHSInAssignment),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var a=this.nextToken().value;i=!1,e=this.finalize(this.startNode(t),new o.UpdateExpression(a,e,i))}return e},e.prototype.parseAwaitExpression=function(){var e=this.createNode();this.nextToken();var t=this.parseUnaryExpression();return this.finalize(e,new o.AwaitExpression(t))},e.prototype.parseUnaryExpression=function(){var e;if(this.match("+")||this.match("-")||this.match("~")||this.match("!")||this.matchKeyword("delete")||this.matchKeyword("void")||this.matchKeyword("typeof")){var t=this.startNode(this.lookahead),n=this.nextToken();e=this.inheritCoverGrammar(this.parseUnaryExpression),e=this.finalize(t,new o.UnaryExpression(n.value,e)),this.context.strict&&"delete"===e.operator&&e.argument.type===u.Syntax.Identifier&&this.tolerateError(s.Messages.StrictDelete),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1}else e=this.context.await&&this.matchContextualKeyword("await")?this.parseAwaitExpression():this.parseUpdateExpression();return e},e.prototype.parseExponentiationExpression=function(){var e=this.lookahead,t=this.inheritCoverGrammar(this.parseUnaryExpression);if(t.type!==u.Syntax.UnaryExpression&&this.match("**")){this.nextToken(),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var n=t,r=this.isolateCoverGrammar(this.parseExponentiationExpression);t=this.finalize(this.startNode(e),new o.BinaryExpression("**",n,r))}return t},e.prototype.binaryPrecedence=function(e){var t=e.value;return 7===e.type?this.operatorPrecedence[t]||0:4===e.type&&("instanceof"===t||this.context.allowIn&&"in"===t)?7:0},e.prototype.parseBinaryExpression=function(){var e=this.lookahead,t=this.inheritCoverGrammar(this.parseExponentiationExpression),n=this.lookahead,r=this.binaryPrecedence(n);if(r>0){this.nextToken(),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;for(var i=[e,this.lookahead],s=t,a=this.isolateCoverGrammar(this.parseExponentiationExpression),u=[s,n.value,a],c=[r];!((r=this.binaryPrecedence(this.lookahead))<=0);){for(;u.length>2&&r<=c[c.length-1];){a=u.pop();var l=u.pop();c.pop(),s=u.pop(),i.pop();var h=this.startNode(i[i.length-1]);u.push(this.finalize(h,new o.BinaryExpression(l,s,a)))}u.push(this.nextToken().value),c.push(r),i.push(this.lookahead),u.push(this.isolateCoverGrammar(this.parseExponentiationExpression))}var p=u.length-1;t=u[p];for(var d=i.pop();p>1;){var f=i.pop(),m=d&&d.lineStart;h=this.startNode(f,m),l=u[p-1],t=this.finalize(h,new o.BinaryExpression(l,u[p-2],t)),p-=2,d=f}}return t},e.prototype.parseConditionalExpression=function(){var e=this.lookahead,t=this.inheritCoverGrammar(this.parseBinaryExpression);if(this.match("?")){this.nextToken();var n=this.context.allowIn;this.context.allowIn=!0;var r=this.isolateCoverGrammar(this.parseAssignmentExpression);this.context.allowIn=n,this.expect(":");var i=this.isolateCoverGrammar(this.parseAssignmentExpression);t=this.finalize(this.startNode(e),new o.ConditionalExpression(t,r,i)),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1}return t},e.prototype.checkPatternParam=function(e,t){switch(t.type){case u.Syntax.Identifier:this.validateParam(e,t,t.name);break;case u.Syntax.RestElement:this.checkPatternParam(e,t.argument);break;case u.Syntax.AssignmentPattern:this.checkPatternParam(e,t.left);break;case u.Syntax.ArrayPattern:for(var n=0;n<t.elements.length;n++)null!==t.elements[n]&&this.checkPatternParam(e,t.elements[n]);break;case u.Syntax.ObjectPattern:for(n=0;n<t.properties.length;n++)this.checkPatternParam(e,t.properties[n].value)}e.simple=e.simple&&t instanceof o.Identifier},e.prototype.reinterpretAsCoverFormalsList=function(e){var t,n=[e],r=!1;switch(e.type){case u.Syntax.Identifier:break;case l:n=e.params,r=e.async;break;default:return null}t={simple:!0,paramSet:{}};for(var i=0;i<n.length;++i)(o=n[i]).type===u.Syntax.AssignmentPattern?o.right.type===u.Syntax.YieldExpression&&(o.right.argument&&this.throwUnexpectedToken(this.lookahead),o.right.type=u.Syntax.Identifier,o.right.name="yield",delete o.right.argument,delete o.right.delegate):r&&o.type===u.Syntax.Identifier&&"await"===o.name&&this.throwUnexpectedToken(this.lookahead),this.checkPatternParam(t,o),n[i]=o;if(this.context.strict||!this.context.allowYield)for(i=0;i<n.length;++i){var o;(o=n[i]).type===u.Syntax.YieldExpression&&this.throwUnexpectedToken(this.lookahead)}if(t.message===s.Messages.StrictParamDupe){var a=this.context.strict?t.stricted:t.firstRestricted;this.throwUnexpectedToken(a,t.message)}return{simple:t.simple,params:n,stricted:t.stricted,firstRestricted:t.firstRestricted,message:t.message}},e.prototype.parseAssignmentExpression=function(){var e;if(!this.context.allowYield&&this.matchKeyword("yield"))e=this.parseYieldExpression();else{var t=this.lookahead,n=t;if(e=this.parseConditionalExpression(),3===n.type&&n.lineNumber===this.lookahead.lineNumber&&"async"===n.value&&(3===this.lookahead.type||this.matchKeyword("yield"))){var r=this.parsePrimaryExpression();this.reinterpretExpressionAsPattern(r),e={type:l,params:[r],async:!0}}if(e.type===l||this.match("=>")){this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var i=e.async,a=this.reinterpretAsCoverFormalsList(e);if(a){this.hasLineTerminator&&this.tolerateUnexpectedToken(this.lookahead),this.context.firstCoverInitializedNameError=null;var c=this.context.strict,h=this.context.allowStrictDirective;this.context.allowStrictDirective=a.simple;var p=this.context.allowYield,d=this.context.await;this.context.allowYield=!0,this.context.await=i;var f=this.startNode(t);this.expect("=>");var m=void 0;if(this.match("{")){var g=this.context.allowIn;this.context.allowIn=!0,m=this.parseFunctionSourceElements(),this.context.allowIn=g}else m=this.isolateCoverGrammar(this.parseAssignmentExpression);var x=m.type!==u.Syntax.BlockStatement;this.context.strict&&a.firstRestricted&&this.throwUnexpectedToken(a.firstRestricted,a.message),this.context.strict&&a.stricted&&this.tolerateUnexpectedToken(a.stricted,a.message),e=i?this.finalize(f,new o.AsyncArrowFunctionExpression(a.params,m,x)):this.finalize(f,new o.ArrowFunctionExpression(a.params,m,x)),this.context.strict=c,this.context.allowStrictDirective=h,this.context.allowYield=p,this.context.await=d}}else if(this.matchAssign()){if(this.context.isAssignmentTarget||this.tolerateError(s.Messages.InvalidLHSInAssignment),this.context.strict&&e.type===u.Syntax.Identifier){var y=e;this.scanner.isRestrictedWord(y.name)&&this.tolerateUnexpectedToken(n,s.Messages.StrictLHSAssignment),this.scanner.isStrictModeReservedWord(y.name)&&this.tolerateUnexpectedToken(n,s.Messages.StrictReservedWord)}this.match("=")?this.reinterpretExpressionAsPattern(e):(this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1);var D=(n=this.nextToken()).value,C=this.isolateCoverGrammar(this.parseAssignmentExpression);e=this.finalize(this.startNode(t),new o.AssignmentExpression(D,e,C)),this.context.firstCoverInitializedNameError=null}}return e},e.prototype.parseExpression=function(){var e=this.lookahead,t=this.isolateCoverGrammar(this.parseAssignmentExpression);if(this.match(",")){var n=[];for(n.push(t);2!==this.lookahead.type&&this.match(",");)this.nextToken(),n.push(this.isolateCoverGrammar(this.parseAssignmentExpression));t=this.finalize(this.startNode(e),new o.SequenceExpression(n))}return t},e.prototype.parseStatementListItem=function(){var e;if(this.context.isAssignmentTarget=!0,this.context.isBindingElement=!0,4===this.lookahead.type)switch(this.lookahead.value){case"export":this.context.isModule||this.tolerateUnexpectedToken(this.lookahead,s.Messages.IllegalExportDeclaration),e=this.parseExportDeclaration();break;case"import":this.context.isModule||this.tolerateUnexpectedToken(this.lookahead,s.Messages.IllegalImportDeclaration),e=this.parseImportDeclaration();break;case"const":e=this.parseLexicalDeclaration({inFor:!1});break;case"function":e=this.parseFunctionDeclaration();break;case"class":e=this.parseClassDeclaration();break;case"let":e=this.isLexicalDeclaration()?this.parseLexicalDeclaration({inFor:!1}):this.parseStatement();break;default:e=this.parseStatement()}else e=this.parseStatement();return e},e.prototype.parseBlock=function(){var e=this.createNode();this.expect("{");for(var t=[];!this.match("}");)t.push(this.parseStatementListItem());return this.expect("}"),this.finalize(e,new o.BlockStatement(t))},e.prototype.parseLexicalBinding=function(e,t){var n=this.createNode(),r=this.parsePattern([],e);this.context.strict&&r.type===u.Syntax.Identifier&&this.scanner.isRestrictedWord(r.name)&&this.tolerateError(s.Messages.StrictVarName);var i=null;return"const"===e?this.matchKeyword("in")||this.matchContextualKeyword("of")||(this.match("=")?(this.nextToken(),i=this.isolateCoverGrammar(this.parseAssignmentExpression)):this.throwError(s.Messages.DeclarationMissingInitializer,"const")):(!t.inFor&&r.type!==u.Syntax.Identifier||this.match("="))&&(this.expect("="),i=this.isolateCoverGrammar(this.parseAssignmentExpression)),this.finalize(n,new o.VariableDeclarator(r,i))},e.prototype.parseBindingList=function(e,t){for(var n=[this.parseLexicalBinding(e,t)];this.match(",");)this.nextToken(),n.push(this.parseLexicalBinding(e,t));return n},e.prototype.isLexicalDeclaration=function(){var e=this.scanner.saveState();this.scanner.scanComments();var t=this.scanner.lex();return this.scanner.restoreState(e),3===t.type||7===t.type&&"["===t.value||7===t.type&&"{"===t.value||4===t.type&&"let"===t.value||4===t.type&&"yield"===t.value},e.prototype.parseLexicalDeclaration=function(e){var t=this.createNode(),n=this.nextToken().value;r.assert("let"===n||"const"===n,"Lexical declaration must be either let or const");var i=this.parseBindingList(n,e);return this.consumeSemicolon(),this.finalize(t,new o.VariableDeclaration(i,n))},e.prototype.parseBindingRestElement=function(e,t){var n=this.createNode();this.expect("...");var r=this.parsePattern(e,t);return this.finalize(n,new o.RestElement(r))},e.prototype.parseArrayPattern=function(e,t){var n=this.createNode();this.expect("[");for(var r=[];!this.match("]");)if(this.match(","))this.nextToken(),r.push(null);else{if(this.match("...")){r.push(this.parseBindingRestElement(e,t));break}r.push(this.parsePatternWithDefault(e,t)),this.match("]")||this.expect(",")}return this.expect("]"),this.finalize(n,new o.ArrayPattern(r))},e.prototype.parsePropertyPattern=function(e,t){var n,r,i=this.createNode(),s=!1,a=!1;if(3===this.lookahead.type){var u=this.lookahead;n=this.parseVariableIdentifier();var c=this.finalize(i,new o.Identifier(u.value));if(this.match("=")){e.push(u),a=!0,this.nextToken();var l=this.parseAssignmentExpression();r=this.finalize(this.startNode(u),new o.AssignmentPattern(c,l))}else this.match(":")?(this.expect(":"),r=this.parsePatternWithDefault(e,t)):(e.push(u),a=!0,r=c)}else s=this.match("["),n=this.parseObjectPropertyKey(),this.expect(":"),r=this.parsePatternWithDefault(e,t);return this.finalize(i,new o.Property("init",n,s,r,!1,a))},e.prototype.parseObjectPattern=function(e,t){var n=this.createNode(),r=[];for(this.expect("{");!this.match("}");)r.push(this.parsePropertyPattern(e,t)),this.match("}")||this.expect(",");return this.expect("}"),this.finalize(n,new o.ObjectPattern(r))},e.prototype.parsePattern=function(e,t){var n;return this.match("[")?n=this.parseArrayPattern(e,t):this.match("{")?n=this.parseObjectPattern(e,t):(!this.matchKeyword("let")||"const"!==t&&"let"!==t||this.tolerateUnexpectedToken(this.lookahead,s.Messages.LetInLexicalBinding),e.push(this.lookahead),n=this.parseVariableIdentifier(t)),n},e.prototype.parsePatternWithDefault=function(e,t){var n=this.lookahead,r=this.parsePattern(e,t);if(this.match("=")){this.nextToken();var i=this.context.allowYield;this.context.allowYield=!0;var s=this.isolateCoverGrammar(this.parseAssignmentExpression);this.context.allowYield=i,r=this.finalize(this.startNode(n),new o.AssignmentPattern(r,s))}return r},e.prototype.parseVariableIdentifier=function(e){var t=this.createNode(),n=this.nextToken();return 4===n.type&&"yield"===n.value?this.context.strict?this.tolerateUnexpectedToken(n,s.Messages.StrictReservedWord):this.context.allowYield||this.throwUnexpectedToken(n):3!==n.type?this.context.strict&&4===n.type&&this.scanner.isStrictModeReservedWord(n.value)?this.tolerateUnexpectedToken(n,s.Messages.StrictReservedWord):(this.context.strict||"let"!==n.value||"var"!==e)&&this.throwUnexpectedToken(n):(this.context.isModule||this.context.await)&&3===n.type&&"await"===n.value&&this.tolerateUnexpectedToken(n),this.finalize(t,new o.Identifier(n.value))},e.prototype.parseVariableDeclaration=function(e){var t=this.createNode(),n=this.parsePattern([],"var");this.context.strict&&n.type===u.Syntax.Identifier&&this.scanner.isRestrictedWord(n.name)&&this.tolerateError(s.Messages.StrictVarName);var r=null;return this.match("=")?(this.nextToken(),r=this.isolateCoverGrammar(this.parseAssignmentExpression)):n.type===u.Syntax.Identifier||e.inFor||this.expect("="),this.finalize(t,new o.VariableDeclarator(n,r))},e.prototype.parseVariableDeclarationList=function(e){var t={inFor:e.inFor},n=[];for(n.push(this.parseVariableDeclaration(t));this.match(",");)this.nextToken(),n.push(this.parseVariableDeclaration(t));return n},e.prototype.parseVariableStatement=function(){var e=this.createNode();this.expectKeyword("var");var t=this.parseVariableDeclarationList({inFor:!1});return this.consumeSemicolon(),this.finalize(e,new o.VariableDeclaration(t,"var"))},e.prototype.parseEmptyStatement=function(){var e=this.createNode();return this.expect(";"),this.finalize(e,new o.EmptyStatement)},e.prototype.parseExpressionStatement=function(){var e=this.createNode(),t=this.parseExpression();return this.consumeSemicolon(),this.finalize(e,new o.ExpressionStatement(t))},e.prototype.parseIfClause=function(){return this.context.strict&&this.matchKeyword("function")&&this.tolerateError(s.Messages.StrictFunction),this.parseStatement()},e.prototype.parseIfStatement=function(){var e,t=this.createNode(),n=null;this.expectKeyword("if"),this.expect("(");var r=this.parseExpression();return!this.match(")")&&this.config.tolerant?(this.tolerateUnexpectedToken(this.nextToken()),e=this.finalize(this.createNode(),new o.EmptyStatement)):(this.expect(")"),e=this.parseIfClause(),this.matchKeyword("else")&&(this.nextToken(),n=this.parseIfClause())),this.finalize(t,new o.IfStatement(r,e,n))},e.prototype.parseDoWhileStatement=function(){var e=this.createNode();this.expectKeyword("do");var t=this.context.inIteration;this.context.inIteration=!0;var n=this.parseStatement();this.context.inIteration=t,this.expectKeyword("while"),this.expect("(");var r=this.parseExpression();return!this.match(")")&&this.config.tolerant?this.tolerateUnexpectedToken(this.nextToken()):(this.expect(")"),this.match(";")&&this.nextToken()),this.finalize(e,new o.DoWhileStatement(n,r))},e.prototype.parseWhileStatement=function(){var e,t=this.createNode();this.expectKeyword("while"),this.expect("(");var n=this.parseExpression();if(!this.match(")")&&this.config.tolerant)this.tolerateUnexpectedToken(this.nextToken()),e=this.finalize(this.createNode(),new o.EmptyStatement);else{this.expect(")");var r=this.context.inIteration;this.context.inIteration=!0,e=this.parseStatement(),this.context.inIteration=r}return this.finalize(t,new o.WhileStatement(n,e))},e.prototype.parseForStatement=function(){var e,t,n,r=null,i=null,a=null,c=!0,l=this.createNode();if(this.expectKeyword("for"),this.expect("("),this.match(";"))this.nextToken();else if(this.matchKeyword("var")){r=this.createNode(),this.nextToken();var h=this.context.allowIn;this.context.allowIn=!1;var p=this.parseVariableDeclarationList({inFor:!0});if(this.context.allowIn=h,1===p.length&&this.matchKeyword("in")){var d=p[0];d.init&&(d.id.type===u.Syntax.ArrayPattern||d.id.type===u.Syntax.ObjectPattern||this.context.strict)&&this.tolerateError(s.Messages.ForInOfLoopInitializer,"for-in"),r=this.finalize(r,new o.VariableDeclaration(p,"var")),this.nextToken(),e=r,t=this.parseExpression(),r=null}else 1===p.length&&null===p[0].init&&this.matchContextualKeyword("of")?(r=this.finalize(r,new o.VariableDeclaration(p,"var")),this.nextToken(),e=r,t=this.parseAssignmentExpression(),r=null,c=!1):(r=this.finalize(r,new o.VariableDeclaration(p,"var")),this.expect(";"))}else if(this.matchKeyword("const")||this.matchKeyword("let")){r=this.createNode();var f=this.nextToken().value;this.context.strict||"in"!==this.lookahead.value?(h=this.context.allowIn,this.context.allowIn=!1,p=this.parseBindingList(f,{inFor:!0}),this.context.allowIn=h,1===p.length&&null===p[0].init&&this.matchKeyword("in")?(r=this.finalize(r,new o.VariableDeclaration(p,f)),this.nextToken(),e=r,t=this.parseExpression(),r=null):1===p.length&&null===p[0].init&&this.matchContextualKeyword("of")?(r=this.finalize(r,new o.VariableDeclaration(p,f)),this.nextToken(),e=r,t=this.parseAssignmentExpression(),r=null,c=!1):(this.consumeSemicolon(),r=this.finalize(r,new o.VariableDeclaration(p,f)))):(r=this.finalize(r,new o.Identifier(f)),this.nextToken(),e=r,t=this.parseExpression(),r=null)}else{var m=this.lookahead;if(h=this.context.allowIn,this.context.allowIn=!1,r=this.inheritCoverGrammar(this.parseAssignmentExpression),this.context.allowIn=h,this.matchKeyword("in"))this.context.isAssignmentTarget&&r.type!==u.Syntax.AssignmentExpression||this.tolerateError(s.Messages.InvalidLHSInForIn),this.nextToken(),this.reinterpretExpressionAsPattern(r),e=r,t=this.parseExpression(),r=null;else if(this.matchContextualKeyword("of"))this.context.isAssignmentTarget&&r.type!==u.Syntax.AssignmentExpression||this.tolerateError(s.Messages.InvalidLHSInForLoop),this.nextToken(),this.reinterpretExpressionAsPattern(r),e=r,t=this.parseAssignmentExpression(),r=null,c=!1;else{if(this.match(",")){for(var g=[r];this.match(",");)this.nextToken(),g.push(this.isolateCoverGrammar(this.parseAssignmentExpression));r=this.finalize(this.startNode(m),new o.SequenceExpression(g))}this.expect(";")}}if(void 0===e&&(this.match(";")||(i=this.parseExpression()),this.expect(";"),this.match(")")||(a=this.parseExpression())),!this.match(")")&&this.config.tolerant)this.tolerateUnexpectedToken(this.nextToken()),n=this.finalize(this.createNode(),new o.EmptyStatement);else{this.expect(")");var x=this.context.inIteration;this.context.inIteration=!0,n=this.isolateCoverGrammar(this.parseStatement),this.context.inIteration=x}return void 0===e?this.finalize(l,new o.ForStatement(r,i,a,n)):c?this.finalize(l,new o.ForInStatement(e,t,n)):this.finalize(l,new o.ForOfStatement(e,t,n))},e.prototype.parseContinueStatement=function(){var e=this.createNode();this.expectKeyword("continue");var t=null;if(3===this.lookahead.type&&!this.hasLineTerminator){var n=this.parseVariableIdentifier();t=n;var r="$"+n.name;Object.prototype.hasOwnProperty.call(this.context.labelSet,r)||this.throwError(s.Messages.UnknownLabel,n.name)}return this.consumeSemicolon(),null!==t||this.context.inIteration||this.throwError(s.Messages.IllegalContinue),this.finalize(e,new o.ContinueStatement(t))},e.prototype.parseBreakStatement=function(){var e=this.createNode();this.expectKeyword("break");var t=null;if(3===this.lookahead.type&&!this.hasLineTerminator){var n=this.parseVariableIdentifier(),r="$"+n.name;Object.prototype.hasOwnProperty.call(this.context.labelSet,r)||this.throwError(s.Messages.UnknownLabel,n.name),t=n}return this.consumeSemicolon(),null!==t||this.context.inIteration||this.context.inSwitch||this.throwError(s.Messages.IllegalBreak),this.finalize(e,new o.BreakStatement(t))},e.prototype.parseReturnStatement=function(){this.context.inFunctionBody||this.tolerateError(s.Messages.IllegalReturn);var e=this.createNode();this.expectKeyword("return");var t=(this.match(";")||this.match("}")||this.hasLineTerminator||2===this.lookahead.type)&&8!==this.lookahead.type&&10!==this.lookahead.type?null:this.parseExpression();return this.consumeSemicolon(),this.finalize(e,new o.ReturnStatement(t))},e.prototype.parseWithStatement=function(){this.context.strict&&this.tolerateError(s.Messages.StrictModeWith);var e,t=this.createNode();this.expectKeyword("with"),this.expect("(");var n=this.parseExpression();return!this.match(")")&&this.config.tolerant?(this.tolerateUnexpectedToken(this.nextToken()),e=this.finalize(this.createNode(),new o.EmptyStatement)):(this.expect(")"),e=this.parseStatement()),this.finalize(t,new o.WithStatement(n,e))},e.prototype.parseSwitchCase=function(){var e,t=this.createNode();this.matchKeyword("default")?(this.nextToken(),e=null):(this.expectKeyword("case"),e=this.parseExpression()),this.expect(":");for(var n=[];!(this.match("}")||this.matchKeyword("default")||this.matchKeyword("case"));)n.push(this.parseStatementListItem());return this.finalize(t,new o.SwitchCase(e,n))},e.prototype.parseSwitchStatement=function(){var e=this.createNode();this.expectKeyword("switch"),this.expect("(");var t=this.parseExpression();this.expect(")");var n=this.context.inSwitch;this.context.inSwitch=!0;var r=[],i=!1;for(this.expect("{");!this.match("}");){var a=this.parseSwitchCase();null===a.test&&(i&&this.throwError(s.Messages.MultipleDefaultsInSwitch),i=!0),r.push(a)}return this.expect("}"),this.context.inSwitch=n,this.finalize(e,new o.SwitchStatement(t,r))},e.prototype.parseLabelledStatement=function(){var e,t=this.createNode(),n=this.parseExpression();if(n.type===u.Syntax.Identifier&&this.match(":")){this.nextToken();var r=n,i="$"+r.name;Object.prototype.hasOwnProperty.call(this.context.labelSet,i)&&this.throwError(s.Messages.Redeclaration,"Label",r.name),this.context.labelSet[i]=!0;var a=void 0;if(this.matchKeyword("class"))this.tolerateUnexpectedToken(this.lookahead),a=this.parseClassDeclaration();else if(this.matchKeyword("function")){var c=this.lookahead,l=this.parseFunctionDeclaration();this.context.strict?this.tolerateUnexpectedToken(c,s.Messages.StrictFunction):l.generator&&this.tolerateUnexpectedToken(c,s.Messages.GeneratorInLegacyContext),a=l}else a=this.parseStatement();delete this.context.labelSet[i],e=new o.LabeledStatement(r,a)}else this.consumeSemicolon(),e=new o.ExpressionStatement(n);return this.finalize(t,e)},e.prototype.parseThrowStatement=function(){var e=this.createNode();this.expectKeyword("throw"),this.hasLineTerminator&&this.throwError(s.Messages.NewlineAfterThrow);var t=this.parseExpression();return this.consumeSemicolon(),this.finalize(e,new o.ThrowStatement(t))},e.prototype.parseCatchClause=function(){var e=this.createNode();this.expectKeyword("catch"),this.expect("("),this.match(")")&&this.throwUnexpectedToken(this.lookahead);for(var t=[],n=this.parsePattern(t),r={},i=0;i<t.length;i++){var a="$"+t[i].value;Object.prototype.hasOwnProperty.call(r,a)&&this.tolerateError(s.Messages.DuplicateBinding,t[i].value),r[a]=!0}this.context.strict&&n.type===u.Syntax.Identifier&&this.scanner.isRestrictedWord(n.name)&&this.tolerateError(s.Messages.StrictCatchVariable),this.expect(")");var c=this.parseBlock();return this.finalize(e,new o.CatchClause(n,c))},e.prototype.parseFinallyClause=function(){return this.expectKeyword("finally"),this.parseBlock()},e.prototype.parseTryStatement=function(){var e=this.createNode();this.expectKeyword("try");var t=this.parseBlock(),n=this.matchKeyword("catch")?this.parseCatchClause():null,r=this.matchKeyword("finally")?this.parseFinallyClause():null;return n||r||this.throwError(s.Messages.NoCatchOrFinally),this.finalize(e,new o.TryStatement(t,n,r))},e.prototype.parseDebuggerStatement=function(){var e=this.createNode();return this.expectKeyword("debugger"),this.consumeSemicolon(),this.finalize(e,new o.DebuggerStatement)},e.prototype.parseStatement=function(){var e;switch(this.lookahead.type){case 1:case 5:case 6:case 8:case 10:case 9:e=this.parseExpressionStatement();break;case 7:var t=this.lookahead.value;e="{"===t?this.parseBlock():"("===t?this.parseExpressionStatement():";"===t?this.parseEmptyStatement():this.parseExpressionStatement();break;case 3:e=this.matchAsyncFunction()?this.parseFunctionDeclaration():this.parseLabelledStatement();break;case 4:switch(this.lookahead.value){case"break":e=this.parseBreakStatement();break;case"continue":e=this.parseContinueStatement();break;case"debugger":e=this.parseDebuggerStatement();break;case"do":e=this.parseDoWhileStatement();break;case"for":e=this.parseForStatement();break;case"function":e=this.parseFunctionDeclaration();break;case"if":e=this.parseIfStatement();break;case"return":e=this.parseReturnStatement();break;case"switch":e=this.parseSwitchStatement();break;case"throw":e=this.parseThrowStatement();break;case"try":e=this.parseTryStatement();break;case"var":e=this.parseVariableStatement();break;case"while":e=this.parseWhileStatement();break;case"with":e=this.parseWithStatement();break;default:e=this.parseExpressionStatement()}break;default:e=this.throwUnexpectedToken(this.lookahead)}return e},e.prototype.parseFunctionSourceElements=function(){var e=this.createNode();this.expect("{");var t=this.parseDirectivePrologues(),n=this.context.labelSet,r=this.context.inIteration,i=this.context.inSwitch,s=this.context.inFunctionBody;for(this.context.labelSet={},this.context.inIteration=!1,this.context.inSwitch=!1,this.context.inFunctionBody=!0;2!==this.lookahead.type&&!this.match("}");)t.push(this.parseStatementListItem());return this.expect("}"),this.context.labelSet=n,this.context.inIteration=r,this.context.inSwitch=i,this.context.inFunctionBody=s,this.finalize(e,new o.BlockStatement(t))},e.prototype.validateParam=function(e,t,n){var r="$"+n;this.context.strict?(this.scanner.isRestrictedWord(n)&&(e.stricted=t,e.message=s.Messages.StrictParamName),Object.prototype.hasOwnProperty.call(e.paramSet,r)&&(e.stricted=t,e.message=s.Messages.StrictParamDupe)):e.firstRestricted||(this.scanner.isRestrictedWord(n)?(e.firstRestricted=t,e.message=s.Messages.StrictParamName):this.scanner.isStrictModeReservedWord(n)?(e.firstRestricted=t,e.message=s.Messages.StrictReservedWord):Object.prototype.hasOwnProperty.call(e.paramSet,r)&&(e.stricted=t,e.message=s.Messages.StrictParamDupe)),"function"==typeof Object.defineProperty?Object.defineProperty(e.paramSet,r,{value:!0,enumerable:!0,writable:!0,configurable:!0}):e.paramSet[r]=!0},e.prototype.parseRestElement=function(e){var t=this.createNode();this.expect("...");var n=this.parsePattern(e);return this.match("=")&&this.throwError(s.Messages.DefaultRestParameter),this.match(")")||this.throwError(s.Messages.ParameterAfterRestParameter),this.finalize(t,new o.RestElement(n))},e.prototype.parseFormalParameter=function(e){for(var t=[],n=this.match("...")?this.parseRestElement(t):this.parsePatternWithDefault(t),r=0;r<t.length;r++)this.validateParam(e,t[r],t[r].value);e.simple=e.simple&&n instanceof o.Identifier,e.params.push(n)},e.prototype.parseFormalParameters=function(e){var t;if(t={simple:!0,params:[],firstRestricted:e},this.expect("("),!this.match(")"))for(t.paramSet={};2!==this.lookahead.type&&(this.parseFormalParameter(t),!this.match(")"))&&(this.expect(","),!this.match(")")););return this.expect(")"),{simple:t.simple,params:t.params,stricted:t.stricted,firstRestricted:t.firstRestricted,message:t.message}},e.prototype.matchAsyncFunction=function(){var e=this.matchContextualKeyword("async");if(e){var t=this.scanner.saveState();this.scanner.scanComments();var n=this.scanner.lex();this.scanner.restoreState(t),e=t.lineNumber===n.lineNumber&&4===n.type&&"function"===n.value}return e},e.prototype.parseFunctionDeclaration=function(e){var t=this.createNode(),n=this.matchContextualKeyword("async");n&&this.nextToken(),this.expectKeyword("function");var r,i=!n&&this.match("*");i&&this.nextToken();var a=null,u=null;if(!e||!this.match("(")){var c=this.lookahead;a=this.parseVariableIdentifier(),this.context.strict?this.scanner.isRestrictedWord(c.value)&&this.tolerateUnexpectedToken(c,s.Messages.StrictFunctionName):this.scanner.isRestrictedWord(c.value)?(u=c,r=s.Messages.StrictFunctionName):this.scanner.isStrictModeReservedWord(c.value)&&(u=c,r=s.Messages.StrictReservedWord)}var l=this.context.await,h=this.context.allowYield;this.context.await=n,this.context.allowYield=!i;var p=this.parseFormalParameters(u),d=p.params,f=p.stricted;u=p.firstRestricted,p.message&&(r=p.message);var m=this.context.strict,g=this.context.allowStrictDirective;this.context.allowStrictDirective=p.simple;var x=this.parseFunctionSourceElements();return this.context.strict&&u&&this.throwUnexpectedToken(u,r),this.context.strict&&f&&this.tolerateUnexpectedToken(f,r),this.context.strict=m,this.context.allowStrictDirective=g,this.context.await=l,this.context.allowYield=h,n?this.finalize(t,new o.AsyncFunctionDeclaration(a,d,x)):this.finalize(t,new o.FunctionDeclaration(a,d,x,i))},e.prototype.parseFunctionExpression=function(){var e=this.createNode(),t=this.matchContextualKeyword("async");t&&this.nextToken(),this.expectKeyword("function");var n,r=!t&&this.match("*");r&&this.nextToken();var i,a=null,u=this.context.await,c=this.context.allowYield;if(this.context.await=t,this.context.allowYield=!r,!this.match("(")){var l=this.lookahead;a=this.context.strict||r||!this.matchKeyword("yield")?this.parseVariableIdentifier():this.parseIdentifierName(),this.context.strict?this.scanner.isRestrictedWord(l.value)&&this.tolerateUnexpectedToken(l,s.Messages.StrictFunctionName):this.scanner.isRestrictedWord(l.value)?(i=l,n=s.Messages.StrictFunctionName):this.scanner.isStrictModeReservedWord(l.value)&&(i=l,n=s.Messages.StrictReservedWord)}var h=this.parseFormalParameters(i),p=h.params,d=h.stricted;i=h.firstRestricted,h.message&&(n=h.message);var f=this.context.strict,m=this.context.allowStrictDirective;this.context.allowStrictDirective=h.simple;var g=this.parseFunctionSourceElements();return this.context.strict&&i&&this.throwUnexpectedToken(i,n),this.context.strict&&d&&this.tolerateUnexpectedToken(d,n),this.context.strict=f,this.context.allowStrictDirective=m,this.context.await=u,this.context.allowYield=c,t?this.finalize(e,new o.AsyncFunctionExpression(a,p,g)):this.finalize(e,new o.FunctionExpression(a,p,g,r))},e.prototype.parseDirective=function(){var e=this.lookahead,t=this.createNode(),n=this.parseExpression(),r=n.type===u.Syntax.Literal?this.getTokenRaw(e).slice(1,-1):null;return this.consumeSemicolon(),this.finalize(t,r?new o.Directive(n,r):new o.ExpressionStatement(n))},e.prototype.parseDirectivePrologues=function(){for(var e=null,t=[];;){var n=this.lookahead;if(8!==n.type)break;var r=this.parseDirective();t.push(r);var i=r.directive;if("string"!=typeof i)break;"use strict"===i?(this.context.strict=!0,e&&this.tolerateUnexpectedToken(e,s.Messages.StrictOctalLiteral),this.context.allowStrictDirective||this.tolerateUnexpectedToken(n,s.Messages.IllegalLanguageModeDirective)):!e&&n.octal&&(e=n)}return t},e.prototype.qualifiedPropertyName=function(e){switch(e.type){case 3:case 8:case 1:case 5:case 6:case 4:return!0;case 7:return"["===e.value}return!1},e.prototype.parseGetterMethod=function(){var e=this.createNode(),t=this.context.allowYield;this.context.allowYield=!0;var n=this.parseFormalParameters();n.params.length>0&&this.tolerateError(s.Messages.BadGetterArity);var r=this.parsePropertyMethod(n);return this.context.allowYield=t,this.finalize(e,new o.FunctionExpression(null,n.params,r,!1))},e.prototype.parseSetterMethod=function(){var e=this.createNode(),t=this.context.allowYield;this.context.allowYield=!0;var n=this.parseFormalParameters();1!==n.params.length?this.tolerateError(s.Messages.BadSetterArity):n.params[0]instanceof o.RestElement&&this.tolerateError(s.Messages.BadSetterRestParameter);var r=this.parsePropertyMethod(n);return this.context.allowYield=t,this.finalize(e,new o.FunctionExpression(null,n.params,r,!1))},e.prototype.parseGeneratorMethod=function(){var e=this.createNode(),t=this.context.allowYield;this.context.allowYield=!0;var n=this.parseFormalParameters();this.context.allowYield=!1;var r=this.parsePropertyMethod(n);return this.context.allowYield=t,this.finalize(e,new o.FunctionExpression(null,n.params,r,!0))},e.prototype.isStartOfExpression=function(){var e=!0,t=this.lookahead.value;switch(this.lookahead.type){case 7:e="["===t||"("===t||"{"===t||"+"===t||"-"===t||"!"===t||"~"===t||"++"===t||"--"===t||"/"===t||"/="===t;break;case 4:e="class"===t||"delete"===t||"function"===t||"let"===t||"new"===t||"super"===t||"this"===t||"typeof"===t||"void"===t||"yield"===t}return e},e.prototype.parseYieldExpression=function(){var e=this.createNode();this.expectKeyword("yield");var t=null,n=!1;if(!this.hasLineTerminator){var r=this.context.allowYield;this.context.allowYield=!1,(n=this.match("*"))?(this.nextToken(),t=this.parseAssignmentExpression()):this.isStartOfExpression()&&(t=this.parseAssignmentExpression()),this.context.allowYield=r}return this.finalize(e,new o.YieldExpression(t,n))},e.prototype.parseClassElement=function(e){var t=this.lookahead,n=this.createNode(),r="",i=null,a=null,u=!1,c=!1,l=!1,h=!1;if(this.match("*"))this.nextToken();else if(u=this.match("["),"static"===(i=this.parseObjectPropertyKey()).name&&(this.qualifiedPropertyName(this.lookahead)||this.match("*"))&&(t=this.lookahead,l=!0,u=this.match("["),this.match("*")?this.nextToken():i=this.parseObjectPropertyKey()),3===t.type&&!this.hasLineTerminator&&"async"===t.value){var p=this.lookahead.value;":"!==p&&"("!==p&&"*"!==p&&(h=!0,t=this.lookahead,i=this.parseObjectPropertyKey(),3===t.type&&"constructor"===t.value&&this.tolerateUnexpectedToken(t,s.Messages.ConstructorIsAsync))}var d=this.qualifiedPropertyName(this.lookahead);return 3===t.type?"get"===t.value&&d?(r="get",u=this.match("["),i=this.parseObjectPropertyKey(),this.context.allowYield=!1,a=this.parseGetterMethod()):"set"===t.value&&d&&(r="set",u=this.match("["),i=this.parseObjectPropertyKey(),a=this.parseSetterMethod()):7===t.type&&"*"===t.value&&d&&(r="init",u=this.match("["),i=this.parseObjectPropertyKey(),a=this.parseGeneratorMethod(),c=!0),!r&&i&&this.match("(")&&(r="init",a=h?this.parsePropertyMethodAsyncFunction():this.parsePropertyMethodFunction(),c=!0),r||this.throwUnexpectedToken(this.lookahead),"init"===r&&(r="method"),u||(l&&this.isPropertyKey(i,"prototype")&&this.throwUnexpectedToken(t,s.Messages.StaticPrototype),!l&&this.isPropertyKey(i,"constructor")&&(("method"!==r||!c||a&&a.generator)&&this.throwUnexpectedToken(t,s.Messages.ConstructorSpecialMethod),e.value?this.throwUnexpectedToken(t,s.Messages.DuplicateConstructor):e.value=!0,r="constructor")),this.finalize(n,new o.MethodDefinition(i,u,a,r,l))},e.prototype.parseClassElementList=function(){var e=[],t={value:!1};for(this.expect("{");!this.match("}");)this.match(";")?this.nextToken():e.push(this.parseClassElement(t));return this.expect("}"),e},e.prototype.parseClassBody=function(){var e=this.createNode(),t=this.parseClassElementList();return this.finalize(e,new o.ClassBody(t))},e.prototype.parseClassDeclaration=function(e){var t=this.createNode(),n=this.context.strict;this.context.strict=!0,this.expectKeyword("class");var r=e&&3!==this.lookahead.type?null:this.parseVariableIdentifier(),i=null;this.matchKeyword("extends")&&(this.nextToken(),i=this.isolateCoverGrammar(this.parseLeftHandSideExpressionAllowCall));var s=this.parseClassBody();return this.context.strict=n,this.finalize(t,new o.ClassDeclaration(r,i,s))},e.prototype.parseClassExpression=function(){var e=this.createNode(),t=this.context.strict;this.context.strict=!0,this.expectKeyword("class");var n=3===this.lookahead.type?this.parseVariableIdentifier():null,r=null;this.matchKeyword("extends")&&(this.nextToken(),r=this.isolateCoverGrammar(this.parseLeftHandSideExpressionAllowCall));var i=this.parseClassBody();return this.context.strict=t,this.finalize(e,new o.ClassExpression(n,r,i))},e.prototype.parseModule=function(){this.context.strict=!0,this.context.isModule=!0,this.scanner.isModule=!0;for(var e=this.createNode(),t=this.parseDirectivePrologues();2!==this.lookahead.type;)t.push(this.parseStatementListItem());return this.finalize(e,new o.Module(t))},e.prototype.parseScript=function(){for(var e=this.createNode(),t=this.parseDirectivePrologues();2!==this.lookahead.type;)t.push(this.parseStatementListItem());return this.finalize(e,new o.Script(t))},e.prototype.parseModuleSpecifier=function(){var e=this.createNode();8!==this.lookahead.type&&this.throwError(s.Messages.InvalidModuleSpecifier);var t=this.nextToken(),n=this.getTokenRaw(t);return this.finalize(e,new o.Literal(t.value,n))},e.prototype.parseImportSpecifier=function(){var e,t,n=this.createNode();return 3===this.lookahead.type?(t=e=this.parseVariableIdentifier(),this.matchContextualKeyword("as")&&(this.nextToken(),t=this.parseVariableIdentifier())):(t=e=this.parseIdentifierName(),this.matchContextualKeyword("as")?(this.nextToken(),t=this.parseVariableIdentifier()):this.throwUnexpectedToken(this.nextToken())),this.finalize(n,new o.ImportSpecifier(t,e))},e.prototype.parseNamedImports=function(){this.expect("{");for(var e=[];!this.match("}");)e.push(this.parseImportSpecifier()),this.match("}")||this.expect(",");return this.expect("}"),e},e.prototype.parseImportDefaultSpecifier=function(){var e=this.createNode(),t=this.parseIdentifierName();return this.finalize(e,new o.ImportDefaultSpecifier(t))},e.prototype.parseImportNamespaceSpecifier=function(){var e=this.createNode();this.expect("*"),this.matchContextualKeyword("as")||this.throwError(s.Messages.NoAsAfterImportNamespace),this.nextToken();var t=this.parseIdentifierName();return this.finalize(e,new o.ImportNamespaceSpecifier(t))},e.prototype.parseImportDeclaration=function(){this.context.inFunctionBody&&this.throwError(s.Messages.IllegalImportDeclaration);var e,t=this.createNode();this.expectKeyword("import");var n=[];if(8===this.lookahead.type)e=this.parseModuleSpecifier();else{if(this.match("{")?n=n.concat(this.parseNamedImports()):this.match("*")?n.push(this.parseImportNamespaceSpecifier()):this.isIdentifierName(this.lookahead)&&!this.matchKeyword("default")?(n.push(this.parseImportDefaultSpecifier()),this.match(",")&&(this.nextToken(),this.match("*")?n.push(this.parseImportNamespaceSpecifier()):this.match("{")?n=n.concat(this.parseNamedImports()):this.throwUnexpectedToken(this.lookahead))):this.throwUnexpectedToken(this.nextToken()),!this.matchContextualKeyword("from")){var r=this.lookahead.value?s.Messages.UnexpectedToken:s.Messages.MissingFromClause;this.throwError(r,this.lookahead.value)}this.nextToken(),e=this.parseModuleSpecifier()}return this.consumeSemicolon(),this.finalize(t,new o.ImportDeclaration(n,e))},e.prototype.parseExportSpecifier=function(){var e=this.createNode(),t=this.parseIdentifierName(),n=t;return this.matchContextualKeyword("as")&&(this.nextToken(),n=this.parseIdentifierName()),this.finalize(e,new o.ExportSpecifier(t,n))},e.prototype.parseExportDeclaration=function(){this.context.inFunctionBody&&this.throwError(s.Messages.IllegalExportDeclaration);var e,t=this.createNode();if(this.expectKeyword("export"),this.matchKeyword("default"))if(this.nextToken(),this.matchKeyword("function")){var n=this.parseFunctionDeclaration(!0);e=this.finalize(t,new o.ExportDefaultDeclaration(n))}else this.matchKeyword("class")?(n=this.parseClassDeclaration(!0),e=this.finalize(t,new o.ExportDefaultDeclaration(n))):this.matchContextualKeyword("async")?(n=this.matchAsyncFunction()?this.parseFunctionDeclaration(!0):this.parseAssignmentExpression(),e=this.finalize(t,new o.ExportDefaultDeclaration(n))):(this.matchContextualKeyword("from")&&this.throwError(s.Messages.UnexpectedToken,this.lookahead.value),n=this.match("{")?this.parseObjectInitializer():this.match("[")?this.parseArrayInitializer():this.parseAssignmentExpression(),this.consumeSemicolon(),e=this.finalize(t,new o.ExportDefaultDeclaration(n)));else if(this.match("*")){if(this.nextToken(),!this.matchContextualKeyword("from")){var r=this.lookahead.value?s.Messages.UnexpectedToken:s.Messages.MissingFromClause;this.throwError(r,this.lookahead.value)}this.nextToken();var i=this.parseModuleSpecifier();this.consumeSemicolon(),e=this.finalize(t,new o.ExportAllDeclaration(i))}else if(4===this.lookahead.type){switch(n=void 0,this.lookahead.value){case"let":case"const":n=this.parseLexicalDeclaration({inFor:!1});break;case"var":case"class":case"function":n=this.parseStatementListItem();break;default:this.throwUnexpectedToken(this.lookahead)}e=this.finalize(t,new o.ExportNamedDeclaration(n,[],null))}else if(this.matchAsyncFunction())n=this.parseFunctionDeclaration(),e=this.finalize(t,new o.ExportNamedDeclaration(n,[],null));else{var a=[],u=null,c=!1;for(this.expect("{");!this.match("}");)c=c||this.matchKeyword("default"),a.push(this.parseExportSpecifier()),this.match("}")||this.expect(",");this.expect("}"),this.matchContextualKeyword("from")?(this.nextToken(),u=this.parseModuleSpecifier(),this.consumeSemicolon()):c?(r=this.lookahead.value?s.Messages.UnexpectedToken:s.Messages.MissingFromClause,this.throwError(r,this.lookahead.value)):this.consumeSemicolon(),e=this.finalize(t,new o.ExportNamedDeclaration(null,a,u))}return e},e}();t.Parser=h},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assert=function(e,t){if(!e)throw new Error("ASSERT: "+t)}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){this.errors=[],this.tolerant=!1}return e.prototype.recordError=function(e){this.errors.push(e)},e.prototype.tolerate=function(e){if(!this.tolerant)throw e;this.recordError(e)},e.prototype.constructError=function(e,t){var n=new Error(e);try{throw n}catch(e){Object.create&&Object.defineProperty&&(n=Object.create(e),Object.defineProperty(n,"column",{value:t}))}return n},e.prototype.createError=function(e,t,n,r){var i="Line "+t+": "+r,s=this.constructError(i,n);return s.index=e,s.lineNumber=t,s.description=r,s},e.prototype.throwError=function(e,t,n,r){throw this.createError(e,t,n,r)},e.prototype.tolerateError=function(e,t,n,r){var i=this.createError(e,t,n,r);if(!this.tolerant)throw i;this.recordError(i)},e}();t.ErrorHandler=n},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Messages={BadGetterArity:"Getter must not have any formal parameters",BadSetterArity:"Setter must have exactly one formal parameter",BadSetterRestParameter:"Setter function argument must not be a rest parameter",ConstructorIsAsync:"Class constructor may not be an async method",ConstructorSpecialMethod:"Class constructor may not be an accessor",DeclarationMissingInitializer:"Missing initializer in %0 declaration",DefaultRestParameter:"Unexpected token =",DuplicateBinding:"Duplicate binding %0",DuplicateConstructor:"A class may only have one constructor",DuplicateProtoProperty:"Duplicate __proto__ fields are not allowed in object literals",ForInOfLoopInitializer:"%0 loop variable declaration may not have an initializer",GeneratorInLegacyContext:"Generator declarations are not allowed in legacy contexts",IllegalBreak:"Illegal break statement",IllegalContinue:"Illegal continue statement",IllegalExportDeclaration:"Unexpected token",IllegalImportDeclaration:"Unexpected token",IllegalLanguageModeDirective:"Illegal 'use strict' directive in function with non-simple parameter list",IllegalReturn:"Illegal return statement",InvalidEscapedReservedWord:"Keyword must not contain escaped characters",InvalidHexEscapeSequence:"Invalid hexadecimal escape sequence",InvalidLHSInAssignment:"Invalid left-hand side in assignment",InvalidLHSInForIn:"Invalid left-hand side in for-in",InvalidLHSInForLoop:"Invalid left-hand side in for-loop",InvalidModuleSpecifier:"Unexpected token",InvalidRegExp:"Invalid regular expression",LetInLexicalBinding:"let is disallowed as a lexically bound name",MissingFromClause:"Unexpected token",MultipleDefaultsInSwitch:"More than one default clause in switch statement",NewlineAfterThrow:"Illegal newline after throw",NoAsAfterImportNamespace:"Unexpected token",NoCatchOrFinally:"Missing catch or finally after try",ParameterAfterRestParameter:"Rest parameter must be last formal parameter",Redeclaration:"%0 '%1' has already been declared",StaticPrototype:"Classes may not have static property named prototype",StrictCatchVariable:"Catch variable may not be eval or arguments in strict mode",StrictDelete:"Delete of an unqualified identifier in strict mode.",StrictFunction:"In strict mode code, functions can only be declared at top level or inside a block",StrictFunctionName:"Function name may not be eval or arguments in strict mode",StrictLHSAssignment:"Assignment to eval or arguments is not allowed in strict mode",StrictLHSPostfix:"Postfix increment/decrement may not have eval or arguments operand in strict mode",StrictLHSPrefix:"Prefix increment/decrement may not have eval or arguments operand in strict mode",StrictModeWith:"Strict mode code may not include a with statement",StrictOctalLiteral:"Octal literals are not allowed in strict mode.",StrictParamDupe:"Strict mode function may not have duplicate parameter names",StrictParamName:"Parameter name eval or arguments is not allowed in strict mode",StrictReservedWord:"Use of future reserved word in strict mode",StrictVarName:"Variable name may not be eval or arguments in strict mode",TemplateOctalLiteral:"Octal literals are not allowed in template strings.",UnexpectedEOS:"Unexpected end of input",UnexpectedIdentifier:"Unexpected identifier",UnexpectedNumber:"Unexpected number",UnexpectedReserved:"Unexpected reserved word",UnexpectedString:"Unexpected string",UnexpectedTemplate:"Unexpected quasi %0",UnexpectedToken:"Unexpected token %0",UnexpectedTokenIllegal:"Unexpected token ILLEGAL",UnknownLabel:"Undefined label '%0'",UnterminatedRegExp:"Invalid regular expression: missing /"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(9),i=n(4),s=n(11);function o(e){return"0123456789abcdef".indexOf(e.toLowerCase())}function a(e){return"01234567".indexOf(e)}var u=function(){function e(e,t){this.source=e,this.errorHandler=t,this.trackComment=!1,this.isModule=!1,this.length=e.length,this.index=0,this.lineNumber=e.length>0?1:0,this.lineStart=0,this.curlyStack=[]}return e.prototype.saveState=function(){return{index:this.index,lineNumber:this.lineNumber,lineStart:this.lineStart}},e.prototype.restoreState=function(e){this.index=e.index,this.lineNumber=e.lineNumber,this.lineStart=e.lineStart},e.prototype.eof=function(){return this.index>=this.length},e.prototype.throwUnexpectedToken=function(e){return void 0===e&&(e=s.Messages.UnexpectedTokenIllegal),this.errorHandler.throwError(this.index,this.lineNumber,this.index-this.lineStart+1,e)},e.prototype.tolerateUnexpectedToken=function(e){void 0===e&&(e=s.Messages.UnexpectedTokenIllegal),this.errorHandler.tolerateError(this.index,this.lineNumber,this.index-this.lineStart+1,e)},e.prototype.skipSingleLineComment=function(e){var t,n,r=[];for(this.trackComment&&(r=[],t=this.index-e,n={start:{line:this.lineNumber,column:this.index-this.lineStart-e},end:{}});!this.eof();){var s=this.source.charCodeAt(this.index);if(++this.index,i.Character.isLineTerminator(s)){if(this.trackComment){n.end={line:this.lineNumber,column:this.index-this.lineStart-1};var o={multiLine:!1,slice:[t+e,this.index-1],range:[t,this.index-1],loc:n};r.push(o)}return 13===s&&10===this.source.charCodeAt(this.index)&&++this.index,++this.lineNumber,this.lineStart=this.index,r}}return this.trackComment&&(n.end={line:this.lineNumber,column:this.index-this.lineStart},o={multiLine:!1,slice:[t+e,this.index],range:[t,this.index],loc:n},r.push(o)),r},e.prototype.skipMultiLineComment=function(){var e,t,n=[];for(this.trackComment&&(n=[],e=this.index-2,t={start:{line:this.lineNumber,column:this.index-this.lineStart-2},end:{}});!this.eof();){var r=this.source.charCodeAt(this.index);if(i.Character.isLineTerminator(r))13===r&&10===this.source.charCodeAt(this.index+1)&&++this.index,++this.lineNumber,++this.index,this.lineStart=this.index;else if(42===r){if(47===this.source.charCodeAt(this.index+1)){if(this.index+=2,this.trackComment){t.end={line:this.lineNumber,column:this.index-this.lineStart};var s={multiLine:!0,slice:[e+2,this.index-2],range:[e,this.index],loc:t};n.push(s)}return n}++this.index}else++this.index}return this.trackComment&&(t.end={line:this.lineNumber,column:this.index-this.lineStart},s={multiLine:!0,slice:[e+2,this.index],range:[e,this.index],loc:t},n.push(s)),this.tolerateUnexpectedToken(),n},e.prototype.scanComments=function(){var e;this.trackComment&&(e=[]);for(var t=0===this.index;!this.eof();){var n=this.source.charCodeAt(this.index);if(i.Character.isWhiteSpace(n))++this.index;else if(i.Character.isLineTerminator(n))++this.index,13===n&&10===this.source.charCodeAt(this.index)&&++this.index,++this.lineNumber,this.lineStart=this.index,t=!0;else if(47===n)if(47===(n=this.source.charCodeAt(this.index+1))){this.index+=2;var r=this.skipSingleLineComment(2);this.trackComment&&(e=e.concat(r)),t=!0}else{if(42!==n)break;this.index+=2,r=this.skipMultiLineComment(),this.trackComment&&(e=e.concat(r))}else if(t&&45===n){if(45!==this.source.charCodeAt(this.index+1)||62!==this.source.charCodeAt(this.index+2))break;this.index+=3,r=this.skipSingleLineComment(3),this.trackComment&&(e=e.concat(r))}else{if(60!==n||this.isModule)break;if("!--"!==this.source.slice(this.index+1,this.index+4))break;this.index+=4,r=this.skipSingleLineComment(4),this.trackComment&&(e=e.concat(r))}}return e},e.prototype.isFutureReservedWord=function(e){switch(e){case"enum":case"export":case"import":case"super":return!0;default:return!1}},e.prototype.isStrictModeReservedWord=function(e){switch(e){case"implements":case"interface":case"package":case"private":case"protected":case"public":case"static":case"yield":case"let":return!0;default:return!1}},e.prototype.isRestrictedWord=function(e){return"eval"===e||"arguments"===e},e.prototype.isKeyword=function(e){switch(e.length){case 2:return"if"===e||"in"===e||"do"===e;case 3:return"var"===e||"for"===e||"new"===e||"try"===e||"let"===e;case 4:return"this"===e||"else"===e||"case"===e||"void"===e||"with"===e||"enum"===e;case 5:return"while"===e||"break"===e||"catch"===e||"throw"===e||"const"===e||"yield"===e||"class"===e||"super"===e;case 6:return"return"===e||"typeof"===e||"delete"===e||"switch"===e||"export"===e||"import"===e;case 7:return"default"===e||"finally"===e||"extends"===e;case 8:return"function"===e||"continue"===e||"debugger"===e;case 10:return"instanceof"===e;default:return!1}},e.prototype.codePointAt=function(e){var t=this.source.charCodeAt(e);if(t>=55296&&t<=56319){var n=this.source.charCodeAt(e+1);n>=56320&&n<=57343&&(t=1024*(t-55296)+n-56320+65536)}return t},e.prototype.scanHexEscape=function(e){for(var t="u"===e?4:2,n=0,r=0;r<t;++r){if(this.eof()||!i.Character.isHexDigit(this.source.charCodeAt(this.index)))return null;n=16*n+o(this.source[this.index++])}return String.fromCharCode(n)},e.prototype.scanUnicodeCodePointEscape=function(){var e=this.source[this.index],t=0;for("}"===e&&this.throwUnexpectedToken();!this.eof()&&(e=this.source[this.index++],i.Character.isHexDigit(e.charCodeAt(0)));)t=16*t+o(e);return(t>1114111||"}"!==e)&&this.throwUnexpectedToken(),i.Character.fromCodePoint(t)},e.prototype.getIdentifier=function(){for(var e=this.index++;!this.eof();){var t=this.source.charCodeAt(this.index);if(92===t)return this.index=e,this.getComplexIdentifier();if(t>=55296&&t<57343)return this.index=e,this.getComplexIdentifier();if(!i.Character.isIdentifierPart(t))break;++this.index}return this.source.slice(e,this.index)},e.prototype.getComplexIdentifier=function(){var e,t=this.codePointAt(this.index),n=i.Character.fromCodePoint(t);for(this.index+=n.length,92===t&&(117!==this.source.charCodeAt(this.index)&&this.throwUnexpectedToken(),++this.index,"{"===this.source[this.index]?(++this.index,e=this.scanUnicodeCodePointEscape()):null!==(e=this.scanHexEscape("u"))&&"\\"!==e&&i.Character.isIdentifierStart(e.charCodeAt(0))||this.throwUnexpectedToken(),n=e);!this.eof()&&(t=this.codePointAt(this.index),i.Character.isIdentifierPart(t));)n+=e=i.Character.fromCodePoint(t),this.index+=e.length,92===t&&(n=n.substr(0,n.length-1),117!==this.source.charCodeAt(this.index)&&this.throwUnexpectedToken(),++this.index,"{"===this.source[this.index]?(++this.index,e=this.scanUnicodeCodePointEscape()):null!==(e=this.scanHexEscape("u"))&&"\\"!==e&&i.Character.isIdentifierPart(e.charCodeAt(0))||this.throwUnexpectedToken(),n+=e);return n},e.prototype.octalToDecimal=function(e){var t="0"!==e,n=a(e);return!this.eof()&&i.Character.isOctalDigit(this.source.charCodeAt(this.index))&&(t=!0,n=8*n+a(this.source[this.index++]),"0123".indexOf(e)>=0&&!this.eof()&&i.Character.isOctalDigit(this.source.charCodeAt(this.index))&&(n=8*n+a(this.source[this.index++]))),{code:n,octal:t}},e.prototype.scanIdentifier=function(){var e,t=this.index,n=92===this.source.charCodeAt(t)?this.getComplexIdentifier():this.getIdentifier();if(3!=(e=1===n.length?3:this.isKeyword(n)?4:"null"===n?5:"true"===n||"false"===n?1:3)&&t+n.length!==this.index){var r=this.index;this.index=t,this.tolerateUnexpectedToken(s.Messages.InvalidEscapedReservedWord),this.index=r}return{type:e,value:n,lineNumber:this.lineNumber,lineStart:this.lineStart,start:t,end:this.index}},e.prototype.scanPunctuator=function(){var e=this.index,t=this.source[this.index];switch(t){case"(":case"{":"{"===t&&this.curlyStack.push("{"),++this.index;break;case".":++this.index,"."===this.source[this.index]&&"."===this.source[this.index+1]&&(this.index+=2,t="...");break;case"}":++this.index,this.curlyStack.pop();break;case")":case";":case",":case"[":case"]":case":":case"?":case"~":++this.index;break;default:">>>="===(t=this.source.substr(this.index,4))?this.index+=4:"==="===(t=t.substr(0,3))||"!=="===t||">>>"===t||"<<="===t||">>="===t||"**="===t?this.index+=3:"&&"===(t=t.substr(0,2))||"||"===t||"=="===t||"!="===t||"+="===t||"-="===t||"*="===t||"/="===t||"++"===t||"--"===t||"<<"===t||">>"===t||"&="===t||"|="===t||"^="===t||"%="===t||"<="===t||">="===t||"=>"===t||"**"===t?this.index+=2:(t=this.source[this.index],"<>=!+-*%&|^/".indexOf(t)>=0&&++this.index)}return this.index===e&&this.throwUnexpectedToken(),{type:7,value:t,lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}},e.prototype.scanHexLiteral=function(e){for(var t="";!this.eof()&&i.Character.isHexDigit(this.source.charCodeAt(this.index));)t+=this.source[this.index++];return 0===t.length&&this.throwUnexpectedToken(),i.Character.isIdentifierStart(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(),{type:6,value:parseInt("0x"+t,16),lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}},e.prototype.scanBinaryLiteral=function(e){for(var t,n="";!this.eof()&&("0"===(t=this.source[this.index])||"1"===t);)n+=this.source[this.index++];return 0===n.length&&this.throwUnexpectedToken(),this.eof()||(t=this.source.charCodeAt(this.index),(i.Character.isIdentifierStart(t)||i.Character.isDecimalDigit(t))&&this.throwUnexpectedToken()),{type:6,value:parseInt(n,2),lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}},e.prototype.scanOctalLiteral=function(e,t){var n="",r=!1;for(i.Character.isOctalDigit(e.charCodeAt(0))?(r=!0,n="0"+this.source[this.index++]):++this.index;!this.eof()&&i.Character.isOctalDigit(this.source.charCodeAt(this.index));)n+=this.source[this.index++];return r||0!==n.length||this.throwUnexpectedToken(),(i.Character.isIdentifierStart(this.source.charCodeAt(this.index))||i.Character.isDecimalDigit(this.source.charCodeAt(this.index)))&&this.throwUnexpectedToken(),{type:6,value:parseInt(n,8),octal:r,lineNumber:this.lineNumber,lineStart:this.lineStart,start:t,end:this.index}},e.prototype.isImplicitOctalLiteral=function(){for(var e=this.index+1;e<this.length;++e){var t=this.source[e];if("8"===t||"9"===t)return!1;if(!i.Character.isOctalDigit(t.charCodeAt(0)))return!0}return!0},e.prototype.scanNumericLiteral=function(){var e=this.index,t=this.source[e];r.assert(i.Character.isDecimalDigit(t.charCodeAt(0))||"."===t,"Numeric literal must start with a decimal digit or a decimal point");var n="";if("."!==t){if(n=this.source[this.index++],t=this.source[this.index],"0"===n){if("x"===t||"X"===t)return++this.index,this.scanHexLiteral(e);if("b"===t||"B"===t)return++this.index,this.scanBinaryLiteral(e);if("o"===t||"O"===t)return this.scanOctalLiteral(t,e);if(t&&i.Character.isOctalDigit(t.charCodeAt(0))&&this.isImplicitOctalLiteral())return this.scanOctalLiteral(t,e)}for(;i.Character.isDecimalDigit(this.source.charCodeAt(this.index));)n+=this.source[this.index++];t=this.source[this.index]}if("."===t){for(n+=this.source[this.index++];i.Character.isDecimalDigit(this.source.charCodeAt(this.index));)n+=this.source[this.index++];t=this.source[this.index]}if("e"===t||"E"===t)if(n+=this.source[this.index++],"+"!==(t=this.source[this.index])&&"-"!==t||(n+=this.source[this.index++]),i.Character.isDecimalDigit(this.source.charCodeAt(this.index)))for(;i.Character.isDecimalDigit(this.source.charCodeAt(this.index));)n+=this.source[this.index++];else this.throwUnexpectedToken();return i.Character.isIdentifierStart(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(),{type:6,value:parseFloat(n),lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}},e.prototype.scanStringLiteral=function(){var e=this.index,t=this.source[e];r.assert("'"===t||'"'===t,"String literal must starts with a quote"),++this.index;for(var n=!1,o="";!this.eof();){var a=this.source[this.index++];if(a===t){t="";break}if("\\"===a)if((a=this.source[this.index++])&&i.Character.isLineTerminator(a.charCodeAt(0)))++this.lineNumber,"\r"===a&&"\n"===this.source[this.index]&&++this.index,this.lineStart=this.index;else switch(a){case"u":if("{"===this.source[this.index])++this.index,o+=this.scanUnicodeCodePointEscape();else{var u=this.scanHexEscape(a);null===u&&this.throwUnexpectedToken(),o+=u}break;case"x":var c=this.scanHexEscape(a);null===c&&this.throwUnexpectedToken(s.Messages.InvalidHexEscapeSequence),o+=c;break;case"n":o+="\n";break;case"r":o+="\r";break;case"t":o+="\t";break;case"b":o+="\b";break;case"f":o+="\f";break;case"v":o+="\v";break;case"8":case"9":o+=a,this.tolerateUnexpectedToken();break;default:if(a&&i.Character.isOctalDigit(a.charCodeAt(0))){var l=this.octalToDecimal(a);n=l.octal||n,o+=String.fromCharCode(l.code)}else o+=a}else{if(i.Character.isLineTerminator(a.charCodeAt(0)))break;o+=a}}return""!==t&&(this.index=e,this.throwUnexpectedToken()),{type:8,value:o,octal:n,lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}},e.prototype.scanTemplate=function(){var e="",t=!1,n=this.index,r="`"===this.source[n],o=!1,a=2;for(++this.index;!this.eof();){var u=this.source[this.index++];if("`"===u){a=1,o=!0,t=!0;break}if("$"===u){if("{"===this.source[this.index]){this.curlyStack.push("${"),++this.index,t=!0;break}e+=u}else if("\\"===u)if(u=this.source[this.index++],i.Character.isLineTerminator(u.charCodeAt(0)))++this.lineNumber,"\r"===u&&"\n"===this.source[this.index]&&++this.index,this.lineStart=this.index;else switch(u){case"n":e+="\n";break;case"r":e+="\r";break;case"t":e+="\t";break;case"u":if("{"===this.source[this.index])++this.index,e+=this.scanUnicodeCodePointEscape();else{var c=this.index,l=this.scanHexEscape(u);null!==l?e+=l:(this.index=c,e+=u)}break;case"x":var h=this.scanHexEscape(u);null===h&&this.throwUnexpectedToken(s.Messages.InvalidHexEscapeSequence),e+=h;break;case"b":e+="\b";break;case"f":e+="\f";break;case"v":e+="\v";break;default:"0"===u?(i.Character.isDecimalDigit(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(s.Messages.TemplateOctalLiteral),e+="\0"):i.Character.isOctalDigit(u.charCodeAt(0))?this.throwUnexpectedToken(s.Messages.TemplateOctalLiteral):e+=u}else i.Character.isLineTerminator(u.charCodeAt(0))?(++this.lineNumber,"\r"===u&&"\n"===this.source[this.index]&&++this.index,this.lineStart=this.index,e+="\n"):e+=u}return t||this.throwUnexpectedToken(),r||this.curlyStack.pop(),{type:10,value:this.source.slice(n+1,this.index-a),cooked:e,head:r,tail:o,lineNumber:this.lineNumber,lineStart:this.lineStart,start:n,end:this.index}},e.prototype.testRegExp=function(e,t){var n=e,r=this;t.indexOf("u")>=0&&(n=n.replace(/\\u\{([0-9a-fA-F]+)\}|\\u([a-fA-F0-9]{4})/g,(function(e,t,n){var i=parseInt(t||n,16);return i>1114111&&r.throwUnexpectedToken(s.Messages.InvalidRegExp),i<=65535?String.fromCharCode(i):""})).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,""));try{RegExp(n)}catch(e){this.throwUnexpectedToken(s.Messages.InvalidRegExp)}try{return new RegExp(e,t)}catch(e){return null}},e.prototype.scanRegExpBody=function(){var e=this.source[this.index];r.assert("/"===e,"Regular expression literal must start with a slash");for(var t=this.source[this.index++],n=!1,o=!1;!this.eof();)if(t+=e=this.source[this.index++],"\\"===e)e=this.source[this.index++],i.Character.isLineTerminator(e.charCodeAt(0))&&this.throwUnexpectedToken(s.Messages.UnterminatedRegExp),t+=e;else if(i.Character.isLineTerminator(e.charCodeAt(0)))this.throwUnexpectedToken(s.Messages.UnterminatedRegExp);else if(n)"]"===e&&(n=!1);else{if("/"===e){o=!0;break}"["===e&&(n=!0)}return o||this.throwUnexpectedToken(s.Messages.UnterminatedRegExp),t.substr(1,t.length-2)},e.prototype.scanRegExpFlags=function(){for(var e="";!this.eof();){var t=this.source[this.index];if(!i.Character.isIdentifierPart(t.charCodeAt(0)))break;if(++this.index,"\\"!==t||this.eof())e+=t;else if("u"===(t=this.source[this.index])){++this.index;var n=this.index,r=this.scanHexEscape("u");if(null!==r)for(e+=r;n<this.index;++n)this.source[n];else this.index=n,e+="u";this.tolerateUnexpectedToken()}else this.tolerateUnexpectedToken()}return e},e.prototype.scanRegExp=function(){var e=this.index,t=this.scanRegExpBody(),n=this.scanRegExpFlags();return{type:9,value:"",pattern:t,flags:n,regex:this.testRegExp(t,n),lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}},e.prototype.lex=function(){if(this.eof())return{type:2,value:"",lineNumber:this.lineNumber,lineStart:this.lineStart,start:this.index,end:this.index};var e=this.source.charCodeAt(this.index);return i.Character.isIdentifierStart(e)?this.scanIdentifier():40===e||41===e||59===e?this.scanPunctuator():39===e||34===e?this.scanStringLiteral():46===e?i.Character.isDecimalDigit(this.source.charCodeAt(this.index+1))?this.scanNumericLiteral():this.scanPunctuator():i.Character.isDecimalDigit(e)?this.scanNumericLiteral():96===e||125===e&&"${"===this.curlyStack[this.curlyStack.length-1]?this.scanTemplate():e>=55296&&e<57343&&i.Character.isIdentifierStart(this.codePointAt(this.index))?this.scanIdentifier():this.scanPunctuator()},e}();t.Scanner=u},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TokenName={},t.TokenName[1]="Boolean",t.TokenName[2]="<end>",t.TokenName[3]="Identifier",t.TokenName[4]="Keyword",t.TokenName[5]="Null",t.TokenName[6]="Numeric",t.TokenName[7]="Punctuator",t.TokenName[8]="String",t.TokenName[9]="RegularExpression",t.TokenName[10]="Template"},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.XHTMLEntities={quot:'"',amp:"&",apos:"'",gt:">",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",ensp:" ",emsp:" ",thinsp:" ",zwnj:"",zwj:"",lrm:"",rlm:"",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",frasl:"⁄",euro:"€",image:"ℑ",weierp:"℘",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",lang:"⟨",rang:"⟩"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(10),i=n(12),s=n(13),o=function(){function e(){this.values=[],this.curly=this.paren=-1}return e.prototype.beforeFunctionExpression=function(e){return["(","{","[","in","typeof","instanceof","new","return","case","delete","throw","void","=","+=","-=","*=","**=","/=","%=","<<=",">>=",">>>=","&=","|=","^=",",","+","-","*","**","/","%","++","--","<<",">>",">>>","&","|","^","!","~","&&","||","?",":","===","==",">=","<=","<",">","!=","!=="].indexOf(e)>=0},e.prototype.isRegexStart=function(){var e=this.values[this.values.length-1],t=null!==e;switch(e){case"this":case"]":t=!1;break;case")":var n=this.values[this.paren-1];t="if"===n||"while"===n||"for"===n||"with"===n;break;case"}":if(t=!1,"function"===this.values[this.curly-3])t=!!(r=this.values[this.curly-4])&&!this.beforeFunctionExpression(r);else if("function"===this.values[this.curly-4]){var r;t=!(r=this.values[this.curly-5])||!this.beforeFunctionExpression(r)}}return t},e.prototype.push=function(e){7===e.type||4===e.type?("{"===e.value?this.curly=this.values.length:"("===e.value&&(this.paren=this.values.length),this.values.push(e.value)):this.values.push(null)},e}(),a=function(){function e(e,t){this.errorHandler=new r.ErrorHandler,this.errorHandler.tolerant=!!t&&"boolean"==typeof t.tolerant&&t.tolerant,this.scanner=new i.Scanner(e,this.errorHandler),this.scanner.trackComment=!!t&&"boolean"==typeof t.comment&&t.comment,this.trackRange=!!t&&"boolean"==typeof t.range&&t.range,this.trackLoc=!!t&&"boolean"==typeof t.loc&&t.loc,this.buffer=[],this.reader=new o}return e.prototype.errors=function(){return this.errorHandler.errors},e.prototype.getNextToken=function(){if(0===this.buffer.length){var e=this.scanner.scanComments();if(this.scanner.trackComment)for(var t=0;t<e.length;++t){var n=e[t],r=this.scanner.source.slice(n.slice[0],n.slice[1]),i={type:n.multiLine?"BlockComment":"LineComment",value:r};this.trackRange&&(i.range=n.range),this.trackLoc&&(i.loc=n.loc),this.buffer.push(i)}if(!this.scanner.eof()){var o=void 0;this.trackLoc&&(o={start:{line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart},end:{}});var a="/"===this.scanner.source[this.scanner.index]&&this.reader.isRegexStart()?this.scanner.scanRegExp():this.scanner.lex();this.reader.push(a);var u={type:s.TokenName[a.type],value:this.scanner.source.slice(a.start,a.end)};if(this.trackRange&&(u.range=[a.start,a.end]),this.trackLoc&&(o.end={line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart},u.loc=o),9===a.type){var c=a.pattern,l=a.flags;u.regex={pattern:c,flags:l}}this.buffer.push(u)}}return this.buffer.shift()},e}();t.Tokenizer=a}])},e.exports=t()},(e,t,n)=>{"use strict";var r=n(8),i=n(9),s=n(31),o=n(11),a=Object.prototype.toString,u=Object.prototype.hasOwnProperty,c={0:"\\0",7:"\\a",8:"\\b",9:"\\t",10:"\\n",11:"\\v",12:"\\f",13:"\\r",27:"\\e",34:'\\"',92:"\\\\",133:"\\N",160:"\\_",8232:"\\L",8233:"\\P"},l=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"];function h(e){var t,n,s;if(t=e.toString(16).toUpperCase(),e<=255)n="x",s=2;else if(e<=65535)n="u",s=4;else{if(!(e<=4294967295))throw new i("code point within a string may not be greater than 0xFFFFFFFF");n="U",s=8}return"\\"+n+r.repeat("0",s-t.length)+t}function p(e){this.schema=e.schema||s,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=r.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=function(e,t){var n,r,i,s,o,a,c;if(null===t)return{};for(n={},i=0,s=(r=Object.keys(t)).length;i<s;i+=1)o=r[i],a=String(t[o]),"!!"===o.slice(0,2)&&(o="tag:yaml.org,2002:"+o.slice(2)),(c=e.compiledTypeMap.fallback[o])&&u.call(c.styleAliases,a)&&(a=c.styleAliases[a]),n[o]=a;return n}(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function d(e,t){for(var n,i=r.repeat(" ",t),s=0,o=-1,a="",u=e.length;s<u;)-1===(o=e.indexOf("\n",s))?(n=e.slice(s),s=u):(n=e.slice(s,o+1),s=o+1),n.length&&"\n"!==n&&(a+=i),a+=n;return a}function f(e,t){return"\n"+r.repeat(" ",e.indent*t)}function m(e){return 32===e||9===e}function g(e){return 32<=e&&e<=126||161<=e&&e<=55295&&8232!==e&&8233!==e||57344<=e&&e<=65533&&65279!==e||65536<=e&&e<=1114111}function x(e,t){return g(e)&&65279!==e&&44!==e&&91!==e&&93!==e&&123!==e&&125!==e&&58!==e&&(35!==e||t&&function(e){return g(e)&&!m(e)&&65279!==e&&13!==e&&10!==e}(t))}function y(e){return/^\n* /.test(e)}function D(e,t,n,r){e.dump=function(){if(0===t.length)return"''";if(!e.noCompatMode&&-1!==l.indexOf(t))return"'"+t+"'";var s=e.indent*Math.max(1,n),o=-1===e.lineWidth?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-s),a=r||e.flowLevel>-1&&n>=e.flowLevel;switch(function(e,t,n,r,i){var s,o,a,u,c=!1,l=!1,h=-1!==r,p=-1,d=g(u=e.charCodeAt(0))&&65279!==u&&!m(u)&&45!==u&&63!==u&&58!==u&&44!==u&&91!==u&&93!==u&&123!==u&&125!==u&&35!==u&&38!==u&&42!==u&&33!==u&&124!==u&&61!==u&&62!==u&&39!==u&&34!==u&&37!==u&&64!==u&&96!==u&&!m(e.charCodeAt(e.length-1));if(t)for(s=0;s<e.length;s++){if(!g(o=e.charCodeAt(s)))return 5;a=s>0?e.charCodeAt(s-1):null,d=d&&x(o,a)}else{for(s=0;s<e.length;s++){if(10===(o=e.charCodeAt(s)))c=!0,h&&(l=l||s-p-1>r&&" "!==e[p+1],p=s);else if(!g(o))return 5;a=s>0?e.charCodeAt(s-1):null,d=d&&x(o,a)}l=l||h&&s-p-1>r&&" "!==e[p+1]}return c||l?n>9&&y(e)?5:l?4:3:d&&!i(e)?1:2}(t,a,e.indent,o,(function(t){return function(e,t){var n,r;for(n=0,r=e.implicitTypes.length;n<r;n+=1)if(e.implicitTypes[n].resolve(t))return!0;return!1}(e,t)}))){case 1:return t;case 2:return"'"+t.replace(/'/g,"''")+"'";case 3:return"|"+C(t,e.indent)+v(d(t,s));case 4:return">"+C(t,e.indent)+v(d(function(e,t){for(var n,r,i,s=/(\n+)([^\n]*)/g,o=(i=-1!==(i=e.indexOf("\n"))?i:e.length,s.lastIndex=i,E(e.slice(0,i),t)),a="\n"===e[0]||" "===e[0];r=s.exec(e);){var u=r[1],c=r[2];n=" "===c[0],o+=u+(a||n||""===c?"":"\n")+E(c,t),a=n}return o}(t,o),s));case 5:return'"'+function(e){for(var t,n,r,i="",s=0;s<e.length;s++)(t=e.charCodeAt(s))>=55296&&t<=56319&&(n=e.charCodeAt(s+1))>=56320&&n<=57343?(i+=h(1024*(t-55296)+n-56320+65536),s++):i+=!(r=c[t])&&g(t)?e[s]:r||h(t);return i}(t)+'"';default:throw new i("impossible error: invalid scalar style")}}()}function C(e,t){var n=y(e)?String(t):"",r="\n"===e[e.length-1];return n+(!r||"\n"!==e[e.length-2]&&"\n"!==e?r?"":"-":"+")+"\n"}function v(e){return"\n"===e[e.length-1]?e.slice(0,-1):e}function E(e,t){if(""===e||" "===e[0])return e;for(var n,r,i=/ [^ ]/g,s=0,o=0,a=0,u="";n=i.exec(e);)(a=n.index)-s>t&&(r=o>s?o:a,u+="\n"+e.slice(s,r),s=r+1),o=a;return u+="\n",e.length-s>t&&o>s?u+=e.slice(s,o)+"\n"+e.slice(o+1):u+=e.slice(s),u.slice(1)}function k(e,t,n){var r,s,o,c,l,h;for(o=0,c=(s=n?e.explicitTypes:e.implicitTypes).length;o<c;o+=1)if(((l=s[o]).instanceOf||l.predicate)&&(!l.instanceOf||"object"==typeof t&&t instanceof l.instanceOf)&&(!l.predicate||l.predicate(t))){if(e.tag=n?l.tag:"?",l.represent){if(h=e.styleMap[l.tag]||l.defaultStyle,"[object Function]"===a.call(l.represent))r=l.represent(t,h);else{if(!u.call(l.represent,h))throw new i("!<"+l.tag+'> tag resolver accepts not "'+h+'" style');r=l.represent[h](t,h)}e.dump=r}return!0}return!1}function b(e,t,n,r,s,o){e.tag=null,e.dump=n,k(e,n,!1)||k(e,n,!0);var u=a.call(e.dump);r&&(r=e.flowLevel<0||e.flowLevel>t);var c,l,h="[object Object]"===u||"[object Array]"===u;if(h&&(l=-1!==(c=e.duplicates.indexOf(n))),(null!==e.tag&&"?"!==e.tag||l||2!==e.indent&&t>0)&&(s=!1),l&&e.usedDuplicates[c])e.dump="*ref_"+c;else{if(h&&l&&!e.usedDuplicates[c]&&(e.usedDuplicates[c]=!0),"[object Object]"===u)r&&0!==Object.keys(e.dump).length?(function(e,t,n,r){var s,o,a,u,c,l,h="",p=e.tag,d=Object.keys(n);if(!0===e.sortKeys)d.sort();else if("function"==typeof e.sortKeys)d.sort(e.sortKeys);else if(e.sortKeys)throw new i("sortKeys must be a boolean or a function");for(s=0,o=d.length;s<o;s+=1)l="",r&&0===s||(l+=f(e,t)),u=n[a=d[s]],b(e,t+1,a,!0,!0,!0)&&((c=null!==e.tag&&"?"!==e.tag||e.dump&&e.dump.length>1024)&&(e.dump&&10===e.dump.charCodeAt(0)?l+="?":l+="? "),l+=e.dump,c&&(l+=f(e,t)),b(e,t+1,u,!0,c)&&(e.dump&&10===e.dump.charCodeAt(0)?l+=":":l+=": ",h+=l+=e.dump));e.tag=p,e.dump=h||"{}"}(e,t,e.dump,s),l&&(e.dump="&ref_"+c+e.dump)):(function(e,t,n){var r,i,s,o,a,u="",c=e.tag,l=Object.keys(n);for(r=0,i=l.length;r<i;r+=1)a="",0!==r&&(a+=", "),e.condenseFlow&&(a+='"'),o=n[s=l[r]],b(e,t,s,!1,!1)&&(e.dump.length>1024&&(a+="? "),a+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),b(e,t,o,!1,!1)&&(u+=a+=e.dump));e.tag=c,e.dump="{"+u+"}"}(e,t,e.dump),l&&(e.dump="&ref_"+c+" "+e.dump));else if("[object Array]"===u){var p=e.noArrayIndent&&t>0?t-1:t;r&&0!==e.dump.length?(function(e,t,n,r){var i,s,o="",a=e.tag;for(i=0,s=n.length;i<s;i+=1)b(e,t+1,n[i],!0,!0)&&(r&&0===i||(o+=f(e,t)),e.dump&&10===e.dump.charCodeAt(0)?o+="-":o+="- ",o+=e.dump);e.tag=a,e.dump=o||"[]"}(e,p,e.dump,s),l&&(e.dump="&ref_"+c+e.dump)):(function(e,t,n){var r,i,s="",o=e.tag;for(r=0,i=n.length;r<i;r+=1)b(e,t,n[r],!1,!1)&&(0!==r&&(s+=","+(e.condenseFlow?"":" ")),s+=e.dump);e.tag=o,e.dump="["+s+"]"}(e,p,e.dump),l&&(e.dump="&ref_"+c+" "+e.dump))}else{if("[object String]"!==u){if(e.skipInvalid)return!1;throw new i("unacceptable kind of an object to dump "+u)}"?"!==e.tag&&D(e,e.dump,t,o)}null!==e.tag&&"?"!==e.tag&&(e.dump="!<"+e.tag+"> "+e.dump)}return!0}function A(e,t){var n,r,i=[],s=[];for(w(e,i,s),n=0,r=s.length;n<r;n+=1)t.duplicates.push(i[s[n]]);t.usedDuplicates=new Array(r)}function w(e,t,n){var r,i,s;if(null!==e&&"object"==typeof e)if(-1!==(i=t.indexOf(e)))-1===n.indexOf(i)&&n.push(i);else if(t.push(e),Array.isArray(e))for(i=0,s=e.length;i<s;i+=1)w(e[i],t,n);else for(i=0,s=(r=Object.keys(e)).length;i<s;i+=1)w(e[r[i]],t,n)}function S(e,t){var n=new p(t=t||{});return n.noRefs||A(e,n),b(n,0,e,!0,!0)?n.dump+"\n":""}e.exports.dump=S,e.exports.safeDump=function(e,t){return S(e,r.extend({schema:o},t))}},(e,t,n)=>{"use strict";const r=n(38).URL,i=n(4),s=n(39),{promisify:o}=n(40),a=n(41),u=n(108),c=n(111),l=n(116),h=["MD002","MD006"];function p(e,t){return e.lineNumber-t.lineNumber}function d(){return!0}function f(e,t,n){return 0===t||e.lineNumber>n[t-1].lineNumber}function m(e,t,n,r,i,s,o,a,u,m){const g=function(e,t){let n=[];if(t){const r=e.match(t);if(r&&!r.index){const t=r[0];e=e.slice(t.length),n=t.split(c.newLineRe),n.length>0&&""===n[n.length-1]&&n.length--}}return{content:e,frontMatterLines:n}}(n=n.replace(/^\uFEFF/,""),s),x=g.frontMatterLines;n=c.clearHtmlCommentText(g.content);const y=r.parse(n,{}),D=n.split(c.newLineRe);!function(e,t){let n=null;e.forEach((function(e){if("thead_open"===e.type||"tbody_open"===e.type?n=e.map.slice():"tr_close"===e.type&&n?n[0]++:"thead_close"!==e.type&&"tbody_close"!==e.type||(n=null),n&&!e.map&&(e.map=n.slice()),e.map){for(e.line=t[e.map[0]],e.lineNumber=e.map[0]+1;e.map[1]&&!(t[e.map[1]-1]||"").trim();)e.map[1]--;let n=e.lineNumber;const r=[];c.forEachInlineCodeSpan(e.content,(function(e){r.push(e.split(c.newLineRe).length-1)})),(e.children||[]).forEach((function(e){e.lineNumber=n,e.line=t[n-1],"softbreak"===e.type||"hardbreak"===e.type?n++:"code_inline"===e.type&&(n+=r.shift())}))}}))}(y,D);const C=function(e){const t={};return e.forEach((function(e){const n=e.names[0].toUpperCase();e.names.forEach((function(e){const r=e.toUpperCase();t[r]=[n]})),e.tags.forEach((function(e){const r=e.toUpperCase(),i=t[r]||[];i.push(n),t[r]=i}))})),t}(e),{effectiveConfig:v,enabledRulesPerLineNumber:E}=function(e,t,n,r,i,s){let o={},a={};const u=[],l=new Array(1+n.length);function p(e,n,i){(e?t:[t.join("\n")]).forEach(((e,t)=>{if(!r){let r=null;for(;r=c.inlineCommentRe.exec(e);){const e=(r[1]||r[3]).toUpperCase(),i=r[2]||r[4];n(e,i,t+1)}}i&&i()}))}function d(e,t,n){const r=e.startsWith("ENABLE");(t?t.trim().toUpperCase().split(/\s+/):u).forEach((e=>{(s[e]||[]).forEach((e=>{n[e]=r}))}))}p(!1,(function(e,t){if("CONFIGURE-FILE"===e)try{const e=JSON.parse(t);i={...i,...e}}catch{}}));const f=function(e,t,n){const r=Object.keys(t).filter((e=>"DEFAULT"===e.toUpperCase())),i=0===r.length||!!t[r[0]],s={};return e.forEach((e=>{const t=e.names[0].toUpperCase();s[t]=i})),h.forEach((e=>{s[e]=!1})),Object.keys(t).forEach((e=>{let r=t[e];r?r instanceof Object||(r={}):r=!1;const i=e.toUpperCase();(n[i]||[]).forEach((e=>{s[e]=r}))})),s}(e,i,s);return e.forEach((e=>{const t=e.names[0].toUpperCase();u.push(t),o[t]=!!f[t]})),a=o,p(!0,(function(e,t){"ENABLE-FILE"!==e&&"DISABLE-FILE"!==e||d(e,t,o)})),p(!0,(function(e,t){"CAPTURE"===e?a={...o}:"RESTORE"===e?o={...a}:"ENABLE"!==e&&"DISABLE"!==e||(o={...o},d(e,t,o))}),(function(){l.push({...o})})),p(!0,(function(e,t,n){"DISABLE-NEXT-LINE"===e&&d(e,t,l[n+1]||{})})),{effectiveConfig:f,enabledRulesPerLineNumber:l}}(e,D,x,a,i,C),k={name:t,tokens:y,lines:D,frontMatterLines:x};l.lineMetadata(c.getLineMetadata(k)),l.flattenedLists(c.flattenLists(k));const b=0===u?{}:[];try{e.forEach((function(e){const t=e.names[0],n=t.toUpperCase();function r(e){throw new Error("Property '"+e+"' of onError parameter is incorrect.")}k.config=v[n];const i=[];function s(e){(!e||!c.isNumber(e.lineNumber)||e.lineNumber<1||e.lineNumber>D.length)&&r("lineNumber"),e.detail&&!c.isString(e.detail)&&r("detail"),e.context&&!c.isString(e.context)&&r("context"),e.range&&(!Array.isArray(e.range)||2!==e.range.length||!c.isNumber(e.range[0])||e.range[0]<1||!c.isNumber(e.range[1])||e.range[1]<1||e.range[0]+e.range[1]-1>D[e.lineNumber-1].length)&&r("range");const t=e.fixInfo,n={};if(t){c.isObject(t)||r("fixInfo"),void 0!==t.lineNumber&&((!c.isNumber(t.lineNumber)||t.lineNumber<1||t.lineNumber>D.length)&&r("fixInfo.lineNumber"),n.lineNumber=t.lineNumber+x.length);const i=t.lineNumber||e.lineNumber;void 0!==t.editColumn&&((!c.isNumber(t.editColumn)||t.editColumn<1||t.editColumn>D[i-1].length+1)&&r("fixInfo.editColumn"),n.editColumn=t.editColumn),void 0!==t.deleteCount&&((!c.isNumber(t.deleteCount)||t.deleteCount<-1||t.deleteCount>D[i-1].length)&&r("fixInfo.deleteCount"),n.deleteCount=t.deleteCount),void 0!==t.insertText&&(c.isString(t.insertText)||r("fixInfo.insertText"),n.insertText=t.insertText)}i.push({lineNumber:e.lineNumber+x.length,detail:e.detail||null,context:e.context||null,range:e.range?[...e.range]:null,fixInfo:t?n:null})}if(o)try{e.function(k,s)}catch(e){s({lineNumber:1,detail:"This rule threw an exception: "+e.message})}else e.function(k,s);if(i.length>0){i.sort(p);const r=i.filter(3===u?d:f).filter((function(e){return E[e.lineNumber][n]})).map((function(n){if(0===u)return n.lineNumber;const r={};return r.lineNumber=n.lineNumber,1===u?(r.ruleName=t,r.ruleAlias=e.names[1]||e.names[0]):r.ruleNames=e.names,r.ruleDescription=e.description,r.ruleInformation=e.information?e.information.href:null,r.errorDetail=n.detail,r.errorContext=n.context,r.errorRange=n.range,3===u&&(r.fixInfo=n.fixInfo),r}));r.length>0&&(0===u?b[t]=r:Array.prototype.push.apply(b,r))}}))}catch(e){return l.clear(),m(e)}return l.clear(),m(null,b)}function g(e,t,n,r,s,o,a,u,l,h){function p(i,c){return i?h(i):m(e,t,c,n,r,s,o,a,u,h)}l?p(null,i.readFileSync(t,c.utf8Encoding)):i.readFile(t,c.utf8Encoding,p)}function x(e,t,n){e=e||{},n=n||function(){};const i=u.concat(e.customRules||[]),s=function(e){let t=null;if(e.length===u.length)return t;const n={};return e.forEach((function(e,i){const s=i-u.length;function o(e){return new Error("Property '"+e+"' of custom rule at index "+s+" is incorrect.")}["names","tags"].forEach((function(n){const r=e[n];t||r&&Array.isArray(r)&&0!==r.length&&r.every(c.isString)&&!r.some(c.isEmptyString)||(t=o(n))})),[["description","string"],["function","function"]].forEach((function(n){const r=n[0],i=e[r];t||i&&typeof i===n[1]||(t=o(r))})),!t&&e.information&&Object.getPrototypeOf(e.information)!==r.prototype&&(t=o("information")),t||(e.names.forEach((function(e){const r=e.toUpperCase();t||void 0===n[r]||(t=new Error("Name '"+e+"' of custom rule at index "+s+" is already used as a name or tag.")),n[r]=!0})),e.tags.forEach((function(e){const r=e.toUpperCase();!t&&n[r]&&(t=new Error("Tag '"+e+"' of custom rule at index "+s+" is already used as a name.")),n[r]=!1})))})),t}(i);if(s)return n(s);let o=[];Array.isArray(e.files)?o=e.files.slice():e.files&&(o=[String(e.files)]);const l=e.strings||{},h=Object.keys(l),p=e.config||{default:!0},d=void 0===e.frontMatter?c.frontMatterRe:e.frontMatter,f=!!e.handleRuleFailures,x=!!e.noInlineConfig,y=void 0===e.resultVersion?2:e.resultVersion,D=a({html:!0});(e.markdownItPlugins||[]).forEach((function(e){D.use(...e)}));const C=function(e){const t={};return Object.defineProperty(t,"toString",{value:function(n){let r=null;const i=[],s=Object.keys(t);return s.sort(),s.forEach((function(s){const o=t[s];Array.isArray(o)?o.forEach((function(e){const t=e.ruleNames?e.ruleNames.join("/"):e.ruleName+"/"+e.ruleAlias;i.push(s+": "+e.lineNumber+": "+t+" "+e.ruleDescription+(e.errorDetail?" ["+e.errorDetail+"]":"")+(e.errorContext?' [Context: "'+e.errorContext+'"]':""))})):(r||(r={},e.forEach((function(e){const t=e.names[0].toUpperCase();r[t]=e}))),Object.keys(o).forEach((function(e){const t=r[e.toUpperCase()];o[e].forEach((function(e){const r=Math.min(n?1:0,t.names.length-1),o=s+": "+e+": "+t.names[r]+" "+t.description;i.push(o)}))})))})),i.join("\n")}}),t}(i);let v=!1,E=null;function k(e,t){return e?(v=!0,n(e)):(C[E]=t,null)}for(;!v&&(E=h.shift());)m(i,E,l[E]||"",D,p,d,f,x,y,k);if(t){for(;!v&&(E=o.shift());)g(i,E,D,p,d,f,x,y,t,k);return v||n(null,C)}let b=0;function A(){const e=o.shift();if(v);else if(e)b++,g(i,e,D,p,d,f,x,y,t,((t,r)=>(b--,t?(v=!0,n(t)):(C[e]=r,A(),null))));else if(0===b)return v=!0,n(null,C);return null}return A(),A(),A(),A(),A(),A(),A(),A(),null}function y(e,t){return x(e,!1,t)}const D=o(y);function C(e,t,n){let r=null,i="";const s=[];return(n||[JSON.parse]).every((e=>{try{r=e(t)}catch(e){s.push(e.message)}return!r})),r||(s.unshift(`Unable to parse '${e}'`),i=s.join("; ")),{config:r,message:i}}function v(e,t){const r=s.dirname(e),o=s.resolve(r,t);try{if(i.statSync(o).isFile())return o}catch{}try{return n(157).resolve(t,{paths:[r]})}catch{}return o}function E(e,t,n){n||(n=t,t=null),i.readFile(e,c.utf8Encoding,((r,i)=>{if(r)return n(r);const{config:s,message:o}=C(e,i,t);if(!s)return n(new Error(o));const a=s.extends;return a?(delete s.extends,E(v(e,a),t,((e,t)=>e?n(e):n(null,{...t,...s})))):n(null,s)}))}const k=o(E);y.sync=function(e){let t=null;return x(e,!0,(function(e,n){if(e)throw e;t=n})),t},y.readConfig=E,y.readConfigSync=function e(t,n){const r=i.readFileSync(t,c.utf8Encoding),{config:s,message:o}=C(t,r,n);if(!s)throw new Error(o);const a=s.extends;return a?(delete s.extends,{...e(v(t,a),n),...s}):s},y.getVersion=function(){return n(109).version},y.promises={markdownlint:function(e){return D(e)},readConfig:function(e,t){return k(e,t)}},e.exports=y},e=>{"use strict";e.exports=require("url")},e=>{"use strict";e.exports=require("path")},e=>{"use strict";e.exports=require("util")},(e,t,n)=>{"use strict";e.exports=n(42)},(e,t,n)=>{"use strict";var r=n(43),i=n(57),s=n(61),o=n(62),a=n(72),u=n(87),c=n(102),l=n(47),h=n(104),p={default:n(105),zero:n(106),commonmark:n(107)},d=/^(vbscript|javascript|file|data):/,f=/^data:image\/(gif|png|jpeg|webp);/;function m(e){var t=e.trim().toLowerCase();return!d.test(t)||!!f.test(t)}var g=["http:","https:","mailto:"];function x(e){var t=l.parse(e,!0);if(t.hostname&&(!t.protocol||g.indexOf(t.protocol)>=0))try{t.hostname=h.toASCII(t.hostname)}catch(e){}return l.encode(l.format(t))}function y(e){var t=l.parse(e,!0);if(t.hostname&&(!t.protocol||g.indexOf(t.protocol)>=0))try{t.hostname=h.toUnicode(t.hostname)}catch(e){}return l.decode(l.format(t),l.decode.defaultChars+"%")}function D(e,t){if(!(this instanceof D))return new D(e,t);t||r.isString(e)||(t=e||{},e="default"),this.inline=new u,this.block=new a,this.core=new o,this.renderer=new s,this.linkify=new c,this.validateLink=m,this.normalizeLink=x,this.normalizeLinkText=y,this.utils=r,this.helpers=r.assign({},i),this.options={},this.configure(e),t&&this.set(t)}D.prototype.set=function(e){return r.assign(this.options,e),this},D.prototype.configure=function(e){var t,n=this;if(r.isString(e)&&!(e=p[t=e]))throw new Error('Wrong `markdown-it` preset "'+t+'", check name');if(!e)throw new Error("Wrong `markdown-it` preset, can't be empty");return e.options&&n.set(e.options),e.components&&Object.keys(e.components).forEach((function(t){e.components[t].rules&&n[t].ruler.enableOnly(e.components[t].rules),e.components[t].rules2&&n[t].ruler2.enableOnly(e.components[t].rules2)})),this},D.prototype.enable=function(e,t){var n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach((function(t){n=n.concat(this[t].ruler.enable(e,!0))}),this),n=n.concat(this.inline.ruler2.enable(e,!0));var r=e.filter((function(e){return n.indexOf(e)<0}));if(r.length&&!t)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+r);return this},D.prototype.disable=function(e,t){var n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach((function(t){n=n.concat(this[t].ruler.disable(e,!0))}),this),n=n.concat(this.inline.ruler2.disable(e,!0));var r=e.filter((function(e){return n.indexOf(e)<0}));if(r.length&&!t)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+r);return this},D.prototype.use=function(e){var t=[this].concat(Array.prototype.slice.call(arguments,1));return e.apply(e,t),this},D.prototype.parse=function(e,t){if("string"!=typeof e)throw new Error("Input data should be a String");var n=new this.core.State(e,this,t);return this.core.process(n),n.tokens},D.prototype.render=function(e,t){return t=t||{},this.renderer.render(this.parse(e,t),this.options,t)},D.prototype.parseInline=function(e,t){var n=new this.core.State(e,this,t);return n.inlineMode=!0,this.core.process(n),n.tokens},D.prototype.renderInline=function(e,t){return t=t||{},this.renderer.render(this.parseInline(e,t),this.options,t)},e.exports=D},(e,t,n)=>{"use strict";var r=Object.prototype.hasOwnProperty;function i(e,t){return r.call(e,t)}function s(e){return!(e>=55296&&e<=57343||e>=64976&&e<=65007||65535==(65535&e)||65534==(65535&e)||e>=0&&e<=8||11===e||e>=14&&e<=31||e>=127&&e<=159||e>1114111)}function o(e){if(e>65535){var t=55296+((e-=65536)>>10),n=56320+(1023&e);return String.fromCharCode(t,n)}return String.fromCharCode(e)}var a=/\\([!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~])/g,u=new RegExp(a.source+"|"+/&([a-z#][a-z0-9]{1,31});/gi.source,"gi"),c=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i,l=n(44),h=/[&<>"]/,p=/[&<>"]/g,d={"&":"&","<":"<",">":">",'"':"""};function f(e){return d[e]}var m=/[.?*+^$[\]\\(){}|-]/g,g=n(46);t.lib={},t.lib.mdurl=n(47),t.lib.ucmicro=n(52),t.assign=function(e){var t=Array.prototype.slice.call(arguments,1);return t.forEach((function(t){if(t){if("object"!=typeof t)throw new TypeError(t+"must be object");Object.keys(t).forEach((function(n){e[n]=t[n]}))}})),e},t.isString=function(e){return"[object String]"===function(e){return Object.prototype.toString.call(e)}(e)},t.has=i,t.unescapeMd=function(e){return e.indexOf("\\")<0?e:e.replace(a,"$1")},t.unescapeAll=function(e){return e.indexOf("\\")<0&&e.indexOf("&")<0?e:e.replace(u,(function(e,t,n){return t||function(e,t){var n=0;return i(l,t)?l[t]:35===t.charCodeAt(0)&&c.test(t)&&s(n="x"===t[1].toLowerCase()?parseInt(t.slice(2),16):parseInt(t.slice(1),10))?o(n):e}(e,n)}))},t.isValidEntityCode=s,t.fromCodePoint=o,t.escapeHtml=function(e){return h.test(e)?e.replace(p,f):e},t.arrayReplaceAt=function(e,t,n){return[].concat(e.slice(0,t),n,e.slice(t+1))},t.isSpace=function(e){switch(e){case 9:case 32:return!0}return!1},t.isWhiteSpace=function(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1},t.isMdAsciiPunct=function(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}},t.isPunctChar=function(e){return g.test(e)},t.escapeRE=function(e){return e.replace(m,"\\$&")},t.normalizeReference=function(e){return e=e.trim().replace(/\s+/g," "),"Ṿ"==="ẞ".toLowerCase()&&(e=e.replace(/ẞ/g,"ß")),e.toLowerCase().toUpperCase()}},(e,t,n)=>{"use strict";e.exports=n(45)},e=>{"use strict";e.exports=JSON.parse('{"Aacute":"Á","aacute":"á","Abreve":"Ă","abreve":"ă","ac":"∾","acd":"∿","acE":"∾̳","Acirc":"Â","acirc":"â","acute":"´","Acy":"А","acy":"а","AElig":"Æ","aelig":"æ","af":"","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":"","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":"","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":"","InvisibleTimes":"","IOcy":"Ё","iocy":"ё","Iogon":"Į","iogon":"į","Iopf":"𝕀","iopf":"𝕚","Iota":"Ι","iota":"ι","iprod":"⨼","iquest":"¿","iscr":"𝒾","Iscr":"ℐ","isin":"∈","isindot":"⋵","isinE":"⋹","isins":"⋴","isinsv":"⋳","isinv":"∈","it":"","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":"","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":"\\n","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":"","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":"","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":"","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":"\\t","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":"","zwnj":""}')},e=>{e.exports=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4E\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDF55-\uDF59]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3E]|\uD806[\uDC3B\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/},(e,t,n)=>{"use strict";e.exports.encode=n(48),e.exports.decode=n(49),e.exports.format=n(50),e.exports.parse=n(51)},e=>{"use strict";var t={};function n(e,r,i){var s,o,a,u,c,l="";for("string"!=typeof r&&(i=r,r=n.defaultChars),void 0===i&&(i=!0),c=function(e){var n,r,i=t[e];if(i)return i;for(i=t[e]=[],n=0;n<128;n++)r=String.fromCharCode(n),/^[0-9a-z]$/i.test(r)?i.push(r):i.push("%"+("0"+n.toString(16).toUpperCase()).slice(-2));for(n=0;n<e.length;n++)i[e.charCodeAt(n)]=e[n];return i}(r),s=0,o=e.length;s<o;s++)if(a=e.charCodeAt(s),i&&37===a&&s+2<o&&/^[0-9a-f]{2}$/i.test(e.slice(s+1,s+3)))l+=e.slice(s,s+3),s+=2;else if(a<128)l+=c[a];else if(a>=55296&&a<=57343){if(a>=55296&&a<=56319&&s+1<o&&(u=e.charCodeAt(s+1))>=56320&&u<=57343){l+=encodeURIComponent(e[s]+e[s+1]),s++;continue}l+="%EF%BF%BD"}else l+=encodeURIComponent(e[s]);return l}n.defaultChars=";/?:@&=+$,-_.!~*'()#",n.componentChars="-_.!~*'()",e.exports=n},e=>{"use strict";var t={};function n(e,r){var i;return"string"!=typeof r&&(r=n.defaultChars),i=function(e){var n,r,i=t[e];if(i)return i;for(i=t[e]=[],n=0;n<128;n++)r=String.fromCharCode(n),i.push(r);for(n=0;n<e.length;n++)i[r=e.charCodeAt(n)]="%"+("0"+r.toString(16).toUpperCase()).slice(-2);return i}(r),e.replace(/(%[a-f0-9]{2})+/gi,(function(e){var t,n,r,s,o,a,u,c="";for(t=0,n=e.length;t<n;t+=3)(r=parseInt(e.slice(t+1,t+3),16))<128?c+=i[r]:192==(224&r)&&t+3<n&&128==(192&(s=parseInt(e.slice(t+4,t+6),16)))?(c+=(u=r<<6&1984|63&s)<128?"��":String.fromCharCode(u),t+=3):224==(240&r)&&t+6<n&&(s=parseInt(e.slice(t+4,t+6),16),o=parseInt(e.slice(t+7,t+9),16),128==(192&s)&&128==(192&o))?(c+=(u=r<<12&61440|s<<6&4032|63&o)<2048||u>=55296&&u<=57343?"���":String.fromCharCode(u),t+=6):240==(248&r)&&t+9<n&&(s=parseInt(e.slice(t+4,t+6),16),o=parseInt(e.slice(t+7,t+9),16),a=parseInt(e.slice(t+10,t+12),16),128==(192&s)&&128==(192&o)&&128==(192&a))?((u=r<<18&1835008|s<<12&258048|o<<6&4032|63&a)<65536||u>1114111?c+="����":(u-=65536,c+=String.fromCharCode(55296+(u>>10),56320+(1023&u))),t+=9):c+="�";return c}))}n.defaultChars=";/?:@&=+$,#",n.componentChars="",e.exports=n},e=>{"use strict";e.exports=function(e){var t="";return t+=e.protocol||"",t+=e.slashes?"//":"",t+=e.auth?e.auth+"@":"",e.hostname&&-1!==e.hostname.indexOf(":")?t+="["+e.hostname+"]":t+=e.hostname||"",t+=e.port?":"+e.port:"",t+=e.pathname||"",(t+=e.search||"")+(e.hash||"")}},e=>{"use strict";function t(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}var n=/^([a-z0-9.+-]+:)/i,r=/:[0-9]*$/,i=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,s=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),o=["'"].concat(s),a=["%","/","?",";","#"].concat(o),u=["/","?","#"],c=/^[+a-z0-9A-Z_-]{0,63}$/,l=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,h={javascript:!0,"javascript:":!0},p={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};t.prototype.parse=function(e,t){var r,s,o,d,f,m=e;if(m=m.trim(),!t&&1===e.split("#").length){var g=i.exec(m);if(g)return this.pathname=g[1],g[2]&&(this.search=g[2]),this}var x=n.exec(m);if(x&&(o=(x=x[0]).toLowerCase(),this.protocol=x,m=m.substr(x.length)),(t||x||m.match(/^\/\/[^@\/]+@[^@\/]+/))&&(!(f="//"===m.substr(0,2))||x&&h[x]||(m=m.substr(2),this.slashes=!0)),!h[x]&&(f||x&&!p[x])){var y,D,C=-1;for(r=0;r<u.length;r++)-1!==(d=m.indexOf(u[r]))&&(-1===C||d<C)&&(C=d);for(-1!==(D=-1===C?m.lastIndexOf("@"):m.lastIndexOf("@",C))&&(y=m.slice(0,D),m=m.slice(D+1),this.auth=y),C=-1,r=0;r<a.length;r++)-1!==(d=m.indexOf(a[r]))&&(-1===C||d<C)&&(C=d);-1===C&&(C=m.length),":"===m[C-1]&&C--;var v=m.slice(0,C);m=m.slice(C),this.parseHost(v),this.hostname=this.hostname||"";var E="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!E){var k=this.hostname.split(/\./);for(r=0,s=k.length;r<s;r++){var b=k[r];if(b&&!b.match(c)){for(var A="",w=0,S=b.length;w<S;w++)b.charCodeAt(w)>127?A+="x":A+=b[w];if(!A.match(c)){var _=k.slice(0,r),F=k.slice(r+1),T=b.match(l);T&&(_.push(T[1]),F.unshift(T[2])),F.length&&(m=F.join(".")+m),this.hostname=_.join(".");break}}}}this.hostname.length>255&&(this.hostname=""),E&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}var N=m.indexOf("#");-1!==N&&(this.hash=m.substr(N),m=m.slice(0,N));var M=m.indexOf("?");return-1!==M&&(this.search=m.substr(M),m=m.slice(0,M)),m&&(this.pathname=m),p[o]&&this.hostname&&!this.pathname&&(this.pathname=""),this},t.prototype.parseHost=function(e){var t=r.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)},e.exports=function(e,n){if(e&&e instanceof t)return e;var r=new t;return r.parse(e,n),r}},(e,t,n)=>{"use strict";t.Any=n(53),t.Cc=n(54),t.Cf=n(55),t.P=n(46),t.Z=n(56)},e=>{e.exports=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/},e=>{e.exports=/[\0-\x1F\x7F-\x9F]/},e=>{e.exports=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/},e=>{e.exports=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/},(e,t,n)=>{"use strict";t.parseLinkLabel=n(58),t.parseLinkDestination=n(59),t.parseLinkTitle=n(60)},e=>{"use strict";e.exports=function(e,t,n){var r,i,s,o,a=-1,u=e.posMax,c=e.pos;for(e.pos=t+1,r=1;e.pos<u;){if(93===(s=e.src.charCodeAt(e.pos))&&0==--r){i=!0;break}if(o=e.pos,e.md.inline.skipToken(e),91===s)if(o===e.pos-1)r++;else if(n)return e.pos=c,-1}return i&&(a=e.pos),e.pos=c,a}},(e,t,n)=>{"use strict";var r=n(43).unescapeAll;e.exports=function(e,t,n){var i,s,o=t,a={ok:!1,pos:0,lines:0,str:""};if(60===e.charCodeAt(t)){for(t++;t<n;){if(10===(i=e.charCodeAt(t)))return a;if(62===i)return a.pos=t+1,a.str=r(e.slice(o+1,t)),a.ok=!0,a;92===i&&t+1<n?t+=2:t++}return a}for(s=0;t<n&&32!==(i=e.charCodeAt(t))&&!(i<32||127===i);)if(92===i&&t+1<n)t+=2;else{if(40===i&&s++,41===i){if(0===s)break;s--}t++}return o===t||0!==s||(a.str=r(e.slice(o,t)),a.lines=0,a.pos=t,a.ok=!0),a}},(e,t,n)=>{"use strict";var r=n(43).unescapeAll;e.exports=function(e,t,n){var i,s,o=0,a=t,u={ok:!1,pos:0,lines:0,str:""};if(t>=n)return u;if(34!==(s=e.charCodeAt(t))&&39!==s&&40!==s)return u;for(t++,40===s&&(s=41);t<n;){if((i=e.charCodeAt(t))===s)return u.pos=t+1,u.lines=o,u.str=r(e.slice(a+1,t)),u.ok=!0,u;10===i?o++:92===i&&t+1<n&&(t++,10===e.charCodeAt(t)&&o++),t++}return u}},(e,t,n)=>{"use strict";var r=n(43).assign,i=n(43).unescapeAll,s=n(43).escapeHtml,o={};function a(){this.rules=r({},o)}o.code_inline=function(e,t,n,r,i){var o=e[t];return"<code"+i.renderAttrs(o)+">"+s(e[t].content)+"</code>"},o.code_block=function(e,t,n,r,i){var o=e[t];return"<pre"+i.renderAttrs(o)+"><code>"+s(e[t].content)+"</code></pre>\n"},o.fence=function(e,t,n,r,o){var a,u,c,l,h,p=e[t],d=p.info?i(p.info).trim():"",f="",m="";return d&&(f=(c=d.split(/(\s+)/g))[0],m=c.slice(2).join("")),0===(a=n.highlight&&n.highlight(p.content,f,m)||s(p.content)).indexOf("<pre")?a+"\n":d?(u=p.attrIndex("class"),l=p.attrs?p.attrs.slice():[],u<0?l.push(["class",n.langPrefix+f]):l[u][1]+=" "+n.langPrefix+f,h={attrs:l},"<pre><code"+o.renderAttrs(h)+">"+a+"</code></pre>\n"):"<pre><code"+o.renderAttrs(p)+">"+a+"</code></pre>\n"},o.image=function(e,t,n,r,i){var s=e[t];return s.attrs[s.attrIndex("alt")][1]=i.renderInlineAsText(s.children,n,r),i.renderToken(e,t,n)},o.hardbreak=function(e,t,n){return n.xhtmlOut?"<br />\n":"<br>\n"},o.softbreak=function(e,t,n){return n.breaks?n.xhtmlOut?"<br />\n":"<br>\n":"\n"},o.text=function(e,t){return s(e[t].content)},o.html_block=function(e,t){return e[t].content},o.html_inline=function(e,t){return e[t].content},a.prototype.renderAttrs=function(e){var t,n,r;if(!e.attrs)return"";for(r="",t=0,n=e.attrs.length;t<n;t++)r+=" "+s(e.attrs[t][0])+'="'+s(e.attrs[t][1])+'"';return r},a.prototype.renderToken=function(e,t,n){var r,i="",s=!1,o=e[t];return o.hidden?"":(o.block&&-1!==o.nesting&&t&&e[t-1].hidden&&(i+="\n"),i+=(-1===o.nesting?"</":"<")+o.tag,i+=this.renderAttrs(o),0===o.nesting&&n.xhtmlOut&&(i+=" /"),o.block&&(s=!0,1===o.nesting&&t+1<e.length&&("inline"===(r=e[t+1]).type||r.hidden||-1===r.nesting&&r.tag===o.tag)&&(s=!1)),i+=s?">\n":">")},a.prototype.renderInline=function(e,t,n){for(var r,i="",s=this.rules,o=0,a=e.length;o<a;o++)void 0!==s[r=e[o].type]?i+=s[r](e,o,t,n,this):i+=this.renderToken(e,o,t);return i},a.prototype.renderInlineAsText=function(e,t,n){for(var r="",i=0,s=e.length;i<s;i++)"text"===e[i].type?r+=e[i].content:"image"===e[i].type&&(r+=this.renderInlineAsText(e[i].children,t,n));return r},a.prototype.render=function(e,t,n){var r,i,s,o="",a=this.rules;for(r=0,i=e.length;r<i;r++)"inline"===(s=e[r].type)?o+=this.renderInline(e[r].children,t,n):void 0!==a[s]?o+=a[e[r].type](e,r,t,n,this):o+=this.renderToken(e,r,t,n);return o},e.exports=a},(e,t,n)=>{"use strict";var r=n(63),i=[["normalize",n(64)],["block",n(65)],["inline",n(66)],["linkify",n(67)],["replacements",n(68)],["smartquotes",n(69)]];function s(){this.ruler=new r;for(var e=0;e<i.length;e++)this.ruler.push(i[e][0],i[e][1])}s.prototype.process=function(e){var t,n,r;for(t=0,n=(r=this.ruler.getRules("")).length;t<n;t++)r[t](e)},s.prototype.State=n(70),e.exports=s},e=>{"use strict";function t(){this.__rules__=[],this.__cache__=null}t.prototype.__find__=function(e){for(var t=0;t<this.__rules__.length;t++)if(this.__rules__[t].name===e)return t;return-1},t.prototype.__compile__=function(){var e=this,t=[""];e.__rules__.forEach((function(e){e.enabled&&e.alt.forEach((function(e){t.indexOf(e)<0&&t.push(e)}))})),e.__cache__={},t.forEach((function(t){e.__cache__[t]=[],e.__rules__.forEach((function(n){n.enabled&&(t&&n.alt.indexOf(t)<0||e.__cache__[t].push(n.fn))}))}))},t.prototype.at=function(e,t,n){var r=this.__find__(e),i=n||{};if(-1===r)throw new Error("Parser rule not found: "+e);this.__rules__[r].fn=t,this.__rules__[r].alt=i.alt||[],this.__cache__=null},t.prototype.before=function(e,t,n,r){var i=this.__find__(e),s=r||{};if(-1===i)throw new Error("Parser rule not found: "+e);this.__rules__.splice(i,0,{name:t,enabled:!0,fn:n,alt:s.alt||[]}),this.__cache__=null},t.prototype.after=function(e,t,n,r){var i=this.__find__(e),s=r||{};if(-1===i)throw new Error("Parser rule not found: "+e);this.__rules__.splice(i+1,0,{name:t,enabled:!0,fn:n,alt:s.alt||[]}),this.__cache__=null},t.prototype.push=function(e,t,n){var r=n||{};this.__rules__.push({name:e,enabled:!0,fn:t,alt:r.alt||[]}),this.__cache__=null},t.prototype.enable=function(e,t){Array.isArray(e)||(e=[e]);var n=[];return e.forEach((function(e){var r=this.__find__(e);if(r<0){if(t)return;throw new Error("Rules manager: invalid rule name "+e)}this.__rules__[r].enabled=!0,n.push(e)}),this),this.__cache__=null,n},t.prototype.enableOnly=function(e,t){Array.isArray(e)||(e=[e]),this.__rules__.forEach((function(e){e.enabled=!1})),this.enable(e,t)},t.prototype.disable=function(e,t){Array.isArray(e)||(e=[e]);var n=[];return e.forEach((function(e){var r=this.__find__(e);if(r<0){if(t)return;throw new Error("Rules manager: invalid rule name "+e)}this.__rules__[r].enabled=!1,n.push(e)}),this),this.__cache__=null,n},t.prototype.getRules=function(e){return null===this.__cache__&&this.__compile__(),this.__cache__[e]||[]},e.exports=t},e=>{"use strict";var t=/\r\n?|\n/g,n=/\0/g;e.exports=function(e){var r;r=(r=e.src.replace(t,"\n")).replace(n,"�"),e.src=r}},e=>{"use strict";e.exports=function(e){var t;e.inlineMode?((t=new e.Token("inline","",0)).content=e.src,t.map=[0,1],t.children=[],e.tokens.push(t)):e.md.block.parse(e.src,e.md,e.env,e.tokens)}},e=>{"use strict";e.exports=function(e){var t,n,r,i=e.tokens;for(n=0,r=i.length;n<r;n++)"inline"===(t=i[n]).type&&e.md.inline.parse(t.content,e.md,e.env,t.children)}},(e,t,n)=>{"use strict";var r=n(43).arrayReplaceAt;function i(e){return/^<\/a\s*>/i.test(e)}e.exports=function(e){var t,n,s,o,a,u,c,l,h,p,d,f,m,g,x,y,D,C,v=e.tokens;if(e.md.options.linkify)for(n=0,s=v.length;n<s;n++)if("inline"===v[n].type&&e.md.linkify.pretest(v[n].content))for(m=0,t=(o=v[n].children).length-1;t>=0;t--)if("link_close"!==(u=o[t]).type){if("html_inline"===u.type&&(C=u.content,/^<a[>\s]/i.test(C)&&m>0&&m--,i(u.content)&&m++),!(m>0)&&"text"===u.type&&e.md.linkify.test(u.content)){for(h=u.content,D=e.md.linkify.match(h),c=[],f=u.level,d=0,l=0;l<D.length;l++)g=D[l].url,x=e.md.normalizeLink(g),e.md.validateLink(x)&&(y=D[l].text,y=D[l].schema?"mailto:"!==D[l].schema||/^mailto:/i.test(y)?e.md.normalizeLinkText(y):e.md.normalizeLinkText("mailto:"+y).replace(/^mailto:/,""):e.md.normalizeLinkText("http://"+y).replace(/^http:\/\//,""),(p=D[l].index)>d&&((a=new e.Token("text","",0)).content=h.slice(d,p),a.level=f,c.push(a)),(a=new e.Token("link_open","a",1)).attrs=[["href",x]],a.level=f++,a.markup="linkify",a.info="auto",c.push(a),(a=new e.Token("text","",0)).content=y,a.level=f,c.push(a),(a=new e.Token("link_close","a",-1)).level=--f,a.markup="linkify",a.info="auto",c.push(a),d=D[l].lastIndex);d<h.length&&((a=new e.Token("text","",0)).content=h.slice(d),a.level=f,c.push(a)),v[n].children=o=r(o,t,c)}}else for(t--;o[t].level!==u.level&&"link_open"!==o[t].type;)t--}},e=>{"use strict";var t=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,n=/\((c|tm|r|p)\)/i,r=/\((c|tm|r|p)\)/gi,i={c:"©",r:"®",p:"§",tm:"™"};function s(e,t){return i[t.toLowerCase()]}function o(e){var t,n,i=0;for(t=e.length-1;t>=0;t--)"text"!==(n=e[t]).type||i||(n.content=n.content.replace(r,s)),"link_open"===n.type&&"auto"===n.info&&i--,"link_close"===n.type&&"auto"===n.info&&i++}function a(e){var n,r,i=0;for(n=e.length-1;n>=0;n--)"text"!==(r=e[n]).type||i||t.test(r.content)&&(r.content=r.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/gm,"$1—").replace(/(^|\s)--(?=\s|$)/gm,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/gm,"$1–")),"link_open"===r.type&&"auto"===r.info&&i--,"link_close"===r.type&&"auto"===r.info&&i++}e.exports=function(e){var r;if(e.md.options.typographer)for(r=e.tokens.length-1;r>=0;r--)"inline"===e.tokens[r].type&&(n.test(e.tokens[r].content)&&o(e.tokens[r].children),t.test(e.tokens[r].content)&&a(e.tokens[r].children))}},(e,t,n)=>{"use strict";var r=n(43).isWhiteSpace,i=n(43).isPunctChar,s=n(43).isMdAsciiPunct,o=/['"]/,a=/['"]/g;function u(e,t,n){return e.substr(0,t)+n+e.substr(t+1)}function c(e,t){var n,o,c,l,h,p,d,f,m,g,x,y,D,C,v,E,k,b,A,w,S;for(A=[],n=0;n<e.length;n++){for(o=e[n],d=e[n].level,k=A.length-1;k>=0&&!(A[k].level<=d);k--);if(A.length=k+1,"text"===o.type){h=0,p=(c=o.content).length;e:for(;h<p&&(a.lastIndex=h,l=a.exec(c));){if(v=E=!0,h=l.index+1,b="'"===l[0],m=32,l.index-1>=0)m=c.charCodeAt(l.index-1);else for(k=n-1;k>=0&&"softbreak"!==e[k].type&&"hardbreak"!==e[k].type;k--)if(e[k].content){m=e[k].content.charCodeAt(e[k].content.length-1);break}if(g=32,h<p)g=c.charCodeAt(h);else for(k=n+1;k<e.length&&"softbreak"!==e[k].type&&"hardbreak"!==e[k].type;k++)if(e[k].content){g=e[k].content.charCodeAt(0);break}if(x=s(m)||i(String.fromCharCode(m)),y=s(g)||i(String.fromCharCode(g)),D=r(m),(C=r(g))?v=!1:y&&(D||x||(v=!1)),D?E=!1:x&&(C||y||(E=!1)),34===g&&'"'===l[0]&&m>=48&&m<=57&&(E=v=!1),v&&E&&(v=x,E=y),v||E){if(E)for(k=A.length-1;k>=0&&(f=A[k],!(A[k].level<d));k--)if(f.single===b&&A[k].level===d){f=A[k],b?(w=t.md.options.quotes[2],S=t.md.options.quotes[3]):(w=t.md.options.quotes[0],S=t.md.options.quotes[1]),o.content=u(o.content,l.index,S),e[f.token].content=u(e[f.token].content,f.pos,w),h+=S.length-1,f.token===n&&(h+=w.length-1),p=(c=o.content).length,A.length=k;continue e}v?A.push({token:n,pos:l.index,single:b,level:d}):E&&b&&(o.content=u(o.content,l.index,"’"))}else b&&(o.content=u(o.content,l.index,"’"))}}}}e.exports=function(e){var t;if(e.md.options.typographer)for(t=e.tokens.length-1;t>=0;t--)"inline"===e.tokens[t].type&&o.test(e.tokens[t].content)&&c(e.tokens[t].children,e)}},(e,t,n)=>{"use strict";var r=n(71);function i(e,t,n){this.src=e,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=t}i.prototype.Token=r,e.exports=i},e=>{"use strict";function t(e,t,n){this.type=e,this.tag=t,this.attrs=null,this.map=null,this.nesting=n,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}t.prototype.attrIndex=function(e){var t,n,r;if(!this.attrs)return-1;for(n=0,r=(t=this.attrs).length;n<r;n++)if(t[n][0]===e)return n;return-1},t.prototype.attrPush=function(e){this.attrs?this.attrs.push(e):this.attrs=[e]},t.prototype.attrSet=function(e,t){var n=this.attrIndex(e),r=[e,t];n<0?this.attrPush(r):this.attrs[n]=r},t.prototype.attrGet=function(e){var t=this.attrIndex(e),n=null;return t>=0&&(n=this.attrs[t][1]),n},t.prototype.attrJoin=function(e,t){var n=this.attrIndex(e);n<0?this.attrPush([e,t]):this.attrs[n][1]=this.attrs[n][1]+" "+t},e.exports=t},(e,t,n)=>{"use strict";var r=n(63),i=[["table",n(73),["paragraph","reference"]],["code",n(74)],["fence",n(75),["paragraph","reference","blockquote","list"]],["blockquote",n(76),["paragraph","reference","blockquote","list"]],["hr",n(77),["paragraph","reference","blockquote","list"]],["list",n(78),["paragraph","reference","blockquote"]],["reference",n(79)],["heading",n(80),["paragraph","reference","blockquote"]],["lheading",n(81)],["html_block",n(82),["paragraph","reference","blockquote"]],["paragraph",n(85)]];function s(){this.ruler=new r;for(var e=0;e<i.length;e++)this.ruler.push(i[e][0],i[e][1],{alt:(i[e][2]||[]).slice()})}s.prototype.tokenize=function(e,t,n){for(var r,i=this.ruler.getRules(""),s=i.length,o=t,a=!1,u=e.md.options.maxNesting;o<n&&(e.line=o=e.skipEmptyLines(o),!(o>=n))&&!(e.sCount[o]<e.blkIndent);){if(e.level>=u){e.line=n;break}for(r=0;r<s&&!i[r](e,o,n,!1);r++);e.tight=!a,e.isEmpty(e.line-1)&&(a=!0),(o=e.line)<n&&e.isEmpty(o)&&(a=!0,o++,e.line=o)}},s.prototype.parse=function(e,t,n,r){var i;e&&(i=new this.State(e,t,n,r),this.tokenize(i,i.line,i.lineMax))},s.prototype.State=n(86),e.exports=s},(e,t,n)=>{"use strict";var r=n(43).isSpace;function i(e,t){var n=e.bMarks[t]+e.tShift[t],r=e.eMarks[t];return e.src.substr(n,r-n)}function s(e){var t,n=[],r=0,i=e.length,s=!1,o=0,a="";for(t=e.charCodeAt(r);r<i;)124===t&&(s?(a+=e.substring(o,r-1),o=r):(n.push(a+e.substring(o,r)),a="",o=r+1)),s=92===t,r++,t=e.charCodeAt(r);return n.push(a+e.substring(o)),n}e.exports=function(e,t,n,o){var a,u,c,l,h,p,d,f,m,g,x,y,D,C,v,E;if(t+2>n)return!1;if(p=t+1,e.sCount[p]<e.blkIndent)return!1;if(e.sCount[p]-e.blkIndent>=4)return!1;if((c=e.bMarks[p]+e.tShift[p])>=e.eMarks[p])return!1;if(124!==(a=e.src.charCodeAt(c++))&&45!==a&&58!==a)return!1;for(;c<e.eMarks[p];){if(124!==(a=e.src.charCodeAt(c))&&45!==a&&58!==a&&!r(a))return!1;c++}for(d=(u=i(e,t+1)).split("|"),g=[],l=0;l<d.length;l++){if(!(x=d[l].trim())){if(0===l||l===d.length-1)continue;return!1}if(!/^:?-+:?$/.test(x))return!1;58===x.charCodeAt(x.length-1)?g.push(58===x.charCodeAt(0)?"center":"right"):58===x.charCodeAt(0)?g.push("left"):g.push("")}if(-1===(u=i(e,t).trim()).indexOf("|"))return!1;if(e.sCount[t]-e.blkIndent>=4)return!1;if((d=s(u)).length&&""===d[0]&&d.shift(),d.length&&""===d[d.length-1]&&d.pop(),0===(f=d.length)||f!==g.length)return!1;if(o)return!0;for(C=e.parentType,e.parentType="table",E=e.md.block.ruler.getRules("blockquote"),(m=e.push("table_open","table",1)).map=y=[t,0],(m=e.push("thead_open","thead",1)).map=[t,t+1],(m=e.push("tr_open","tr",1)).map=[t,t+1],l=0;l<d.length;l++)m=e.push("th_open","th",1),g[l]&&(m.attrs=[["style","text-align:"+g[l]]]),(m=e.push("inline","",0)).content=d[l].trim(),m.children=[],m=e.push("th_close","th",-1);for(m=e.push("tr_close","tr",-1),m=e.push("thead_close","thead",-1),p=t+2;p<n&&!(e.sCount[p]<e.blkIndent);p++){for(v=!1,l=0,h=E.length;l<h;l++)if(E[l](e,p,n,!0)){v=!0;break}if(v)break;if(!(u=i(e,p).trim()))break;if(e.sCount[p]-e.blkIndent>=4)break;for((d=s(u)).length&&""===d[0]&&d.shift(),d.length&&""===d[d.length-1]&&d.pop(),p===t+2&&((m=e.push("tbody_open","tbody",1)).map=D=[t+2,0]),(m=e.push("tr_open","tr",1)).map=[p,p+1],l=0;l<f;l++)m=e.push("td_open","td",1),g[l]&&(m.attrs=[["style","text-align:"+g[l]]]),(m=e.push("inline","",0)).content=d[l]?d[l].trim():"",m.children=[],m=e.push("td_close","td",-1);m=e.push("tr_close","tr",-1)}return D&&(m=e.push("tbody_close","tbody",-1),D[1]=p),m=e.push("table_close","table",-1),y[1]=p,e.parentType=C,e.line=p,!0}},e=>{"use strict";e.exports=function(e,t,n){var r,i,s;if(e.sCount[t]-e.blkIndent<4)return!1;for(i=r=t+1;r<n;)if(e.isEmpty(r))r++;else{if(!(e.sCount[r]-e.blkIndent>=4))break;i=++r}return e.line=i,(s=e.push("code_block","code",0)).content=e.getLines(t,i,4+e.blkIndent,!0),s.map=[t,e.line],!0}},e=>{"use strict";e.exports=function(e,t,n,r){var i,s,o,a,u,c,l,h=!1,p=e.bMarks[t]+e.tShift[t],d=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;if(p+3>d)return!1;if(126!==(i=e.src.charCodeAt(p))&&96!==i)return!1;if(u=p,(s=(p=e.skipChars(p,i))-u)<3)return!1;if(l=e.src.slice(u,p),o=e.src.slice(p,d),96===i&&o.indexOf(String.fromCharCode(i))>=0)return!1;if(r)return!0;for(a=t;!(++a>=n||(p=u=e.bMarks[a]+e.tShift[a])<(d=e.eMarks[a])&&e.sCount[a]<e.blkIndent);)if(e.src.charCodeAt(p)===i&&!(e.sCount[a]-e.blkIndent>=4||(p=e.skipChars(p,i))-u<s||(p=e.skipSpaces(p))<d)){h=!0;break}return s=e.sCount[t],e.line=a+(h?1:0),(c=e.push("fence","code",0)).info=o,c.content=e.getLines(t+1,a,s,!0),c.markup=l,c.map=[t,e.line],!0}},(e,t,n)=>{"use strict";var r=n(43).isSpace;e.exports=function(e,t,n,i){var s,o,a,u,c,l,h,p,d,f,m,g,x,y,D,C,v,E,k,b,A=e.lineMax,w=e.bMarks[t]+e.tShift[t],S=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;if(62!==e.src.charCodeAt(w++))return!1;if(i)return!0;for(u=d=e.sCount[t]+1,32===e.src.charCodeAt(w)?(w++,u++,d++,s=!1,C=!0):9===e.src.charCodeAt(w)?(C=!0,(e.bsCount[t]+d)%4==3?(w++,u++,d++,s=!1):s=!0):C=!1,f=[e.bMarks[t]],e.bMarks[t]=w;w<S&&(o=e.src.charCodeAt(w),r(o));)9===o?d+=4-(d+e.bsCount[t]+(s?1:0))%4:d++,w++;for(m=[e.bsCount[t]],e.bsCount[t]=e.sCount[t]+1+(C?1:0),l=w>=S,y=[e.sCount[t]],e.sCount[t]=d-u,D=[e.tShift[t]],e.tShift[t]=w-e.bMarks[t],E=e.md.block.ruler.getRules("blockquote"),x=e.parentType,e.parentType="blockquote",p=t+1;p<n&&(b=e.sCount[p]<e.blkIndent,!((w=e.bMarks[p]+e.tShift[p])>=(S=e.eMarks[p])));p++)if(62!==e.src.charCodeAt(w++)||b){if(l)break;for(v=!1,a=0,c=E.length;a<c;a++)if(E[a](e,p,n,!0)){v=!0;break}if(v){e.lineMax=p,0!==e.blkIndent&&(f.push(e.bMarks[p]),m.push(e.bsCount[p]),D.push(e.tShift[p]),y.push(e.sCount[p]),e.sCount[p]-=e.blkIndent);break}f.push(e.bMarks[p]),m.push(e.bsCount[p]),D.push(e.tShift[p]),y.push(e.sCount[p]),e.sCount[p]=-1}else{for(u=d=e.sCount[p]+1,32===e.src.charCodeAt(w)?(w++,u++,d++,s=!1,C=!0):9===e.src.charCodeAt(w)?(C=!0,(e.bsCount[p]+d)%4==3?(w++,u++,d++,s=!1):s=!0):C=!1,f.push(e.bMarks[p]),e.bMarks[p]=w;w<S&&(o=e.src.charCodeAt(w),r(o));)9===o?d+=4-(d+e.bsCount[p]+(s?1:0))%4:d++,w++;l=w>=S,m.push(e.bsCount[p]),e.bsCount[p]=e.sCount[p]+1+(C?1:0),y.push(e.sCount[p]),e.sCount[p]=d-u,D.push(e.tShift[p]),e.tShift[p]=w-e.bMarks[p]}for(g=e.blkIndent,e.blkIndent=0,(k=e.push("blockquote_open","blockquote",1)).markup=">",k.map=h=[t,0],e.md.block.tokenize(e,t,p),(k=e.push("blockquote_close","blockquote",-1)).markup=">",e.lineMax=A,e.parentType=x,h[1]=e.line,a=0;a<D.length;a++)e.bMarks[a+t]=f[a],e.tShift[a+t]=D[a],e.sCount[a+t]=y[a],e.bsCount[a+t]=m[a];return e.blkIndent=g,!0}},(e,t,n)=>{"use strict";var r=n(43).isSpace;e.exports=function(e,t,n,i){var s,o,a,u,c=e.bMarks[t]+e.tShift[t],l=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;if(42!==(s=e.src.charCodeAt(c++))&&45!==s&&95!==s)return!1;for(o=1;c<l;){if((a=e.src.charCodeAt(c++))!==s&&!r(a))return!1;a===s&&o++}return!(o<3||(i||(e.line=t+1,(u=e.push("hr","hr",0)).map=[t,e.line],u.markup=Array(o+1).join(String.fromCharCode(s))),0))}},(e,t,n)=>{"use strict";var r=n(43).isSpace;function i(e,t){var n,i,s,o;return i=e.bMarks[t]+e.tShift[t],s=e.eMarks[t],42!==(n=e.src.charCodeAt(i++))&&45!==n&&43!==n||i<s&&(o=e.src.charCodeAt(i),!r(o))?-1:i}function s(e,t){var n,i=e.bMarks[t]+e.tShift[t],s=i,o=e.eMarks[t];if(s+1>=o)return-1;if((n=e.src.charCodeAt(s++))<48||n>57)return-1;for(;;){if(s>=o)return-1;if(!((n=e.src.charCodeAt(s++))>=48&&n<=57)){if(41===n||46===n)break;return-1}if(s-i>=10)return-1}return s<o&&(n=e.src.charCodeAt(s),!r(n))?-1:s}e.exports=function(e,t,n,r){var o,a,u,c,l,h,p,d,f,m,g,x,y,D,C,v,E,k,b,A,w,S,_,F,T,N,M,R,I=!1,B=!0;if(e.sCount[t]-e.blkIndent>=4)return!1;if(e.listIndent>=0&&e.sCount[t]-e.listIndent>=4&&e.sCount[t]<e.blkIndent)return!1;if(r&&"paragraph"===e.parentType&&e.tShift[t]>=e.blkIndent&&(I=!0),(_=s(e,t))>=0){if(p=!0,T=e.bMarks[t]+e.tShift[t],y=Number(e.src.substr(T,_-T-1)),I&&1!==y)return!1}else{if(!((_=i(e,t))>=0))return!1;p=!1}if(I&&e.skipSpaces(_)>=e.eMarks[t])return!1;if(x=e.src.charCodeAt(_-1),r)return!0;for(g=e.tokens.length,p?(R=e.push("ordered_list_open","ol",1),1!==y&&(R.attrs=[["start",y]])):R=e.push("bullet_list_open","ul",1),R.map=m=[t,0],R.markup=String.fromCharCode(x),C=t,F=!1,M=e.md.block.ruler.getRules("list"),k=e.parentType,e.parentType="list";C<n;){for(S=_,D=e.eMarks[C],h=v=e.sCount[C]+_-(e.bMarks[t]+e.tShift[t]);S<D;){if(9===(o=e.src.charCodeAt(S)))v+=4-(v+e.bsCount[C])%4;else{if(32!==o)break;v++}S++}if((l=(a=S)>=D?1:v-h)>4&&(l=1),c=h+l,(R=e.push("list_item_open","li",1)).markup=String.fromCharCode(x),R.map=d=[t,0],w=e.tight,A=e.tShift[t],b=e.sCount[t],E=e.listIndent,e.listIndent=e.blkIndent,e.blkIndent=c,e.tight=!0,e.tShift[t]=a-e.bMarks[t],e.sCount[t]=v,a>=D&&e.isEmpty(t+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,t,n,!0),e.tight&&!F||(B=!1),F=e.line-t>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=E,e.tShift[t]=A,e.sCount[t]=b,e.tight=w,(R=e.push("list_item_close","li",-1)).markup=String.fromCharCode(x),C=t=e.line,d[1]=C,a=e.bMarks[t],C>=n)break;if(e.sCount[C]<e.blkIndent)break;if(e.sCount[t]-e.blkIndent>=4)break;for(N=!1,u=0,f=M.length;u<f;u++)if(M[u](e,C,n,!0)){N=!0;break}if(N)break;if(p){if((_=s(e,C))<0)break}else if((_=i(e,C))<0)break;if(x!==e.src.charCodeAt(_-1))break}return(R=p?e.push("ordered_list_close","ol",-1):e.push("bullet_list_close","ul",-1)).markup=String.fromCharCode(x),m[1]=C,e.line=C,e.parentType=k,B&&function(e,t){var n,r,i=e.level+2;for(n=t+2,r=e.tokens.length-2;n<r;n++)e.tokens[n].level===i&&"paragraph_open"===e.tokens[n].type&&(e.tokens[n+2].hidden=!0,e.tokens[n].hidden=!0,n+=2)}(e,g),!0}},(e,t,n)=>{"use strict";var r=n(43).normalizeReference,i=n(43).isSpace;e.exports=function(e,t,n,s){var o,a,u,c,l,h,p,d,f,m,g,x,y,D,C,v,E=0,k=e.bMarks[t]+e.tShift[t],b=e.eMarks[t],A=t+1;if(e.sCount[t]-e.blkIndent>=4)return!1;if(91!==e.src.charCodeAt(k))return!1;for(;++k<b;)if(93===e.src.charCodeAt(k)&&92!==e.src.charCodeAt(k-1)){if(k+1===b)return!1;if(58!==e.src.charCodeAt(k+1))return!1;break}for(c=e.lineMax,C=e.md.block.ruler.getRules("reference"),m=e.parentType,e.parentType="reference";A<c&&!e.isEmpty(A);A++)if(!(e.sCount[A]-e.blkIndent>3||e.sCount[A]<0)){for(D=!1,h=0,p=C.length;h<p;h++)if(C[h](e,A,c,!0)){D=!0;break}if(D)break}for(b=(y=e.getLines(t,A,e.blkIndent,!1).trim()).length,k=1;k<b;k++){if(91===(o=y.charCodeAt(k)))return!1;if(93===o){f=k;break}(10===o||92===o&&++k<b&&10===y.charCodeAt(k))&&E++}if(f<0||58!==y.charCodeAt(f+1))return!1;for(k=f+2;k<b;k++)if(10===(o=y.charCodeAt(k)))E++;else if(!i(o))break;if(!(g=e.md.helpers.parseLinkDestination(y,k,b)).ok)return!1;if(l=e.md.normalizeLink(g.str),!e.md.validateLink(l))return!1;for(a=k=g.pos,u=E+=g.lines,x=k;k<b;k++)if(10===(o=y.charCodeAt(k)))E++;else if(!i(o))break;for(g=e.md.helpers.parseLinkTitle(y,k,b),k<b&&x!==k&&g.ok?(v=g.str,k=g.pos,E+=g.lines):(v="",k=a,E=u);k<b&&(o=y.charCodeAt(k),i(o));)k++;if(k<b&&10!==y.charCodeAt(k)&&v)for(v="",k=a,E=u;k<b&&(o=y.charCodeAt(k),i(o));)k++;return!(k<b&&10!==y.charCodeAt(k)||!(d=r(y.slice(1,f)))||(s||(void 0===e.env.references&&(e.env.references={}),void 0===e.env.references[d]&&(e.env.references[d]={title:v,href:l}),e.parentType=m,e.line=t+E+1),0))}},(e,t,n)=>{"use strict";var r=n(43).isSpace;e.exports=function(e,t,n,i){var s,o,a,u,c=e.bMarks[t]+e.tShift[t],l=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;if(35!==(s=e.src.charCodeAt(c))||c>=l)return!1;for(o=1,s=e.src.charCodeAt(++c);35===s&&c<l&&o<=6;)o++,s=e.src.charCodeAt(++c);return!(o>6||c<l&&!r(s)||(i||(l=e.skipSpacesBack(l,c),(a=e.skipCharsBack(l,35,c))>c&&r(e.src.charCodeAt(a-1))&&(l=a),e.line=t+1,(u=e.push("heading_open","h"+String(o),1)).markup="########".slice(0,o),u.map=[t,e.line],(u=e.push("inline","",0)).content=e.src.slice(c,l).trim(),u.map=[t,e.line],u.children=[],(u=e.push("heading_close","h"+String(o),-1)).markup="########".slice(0,o)),0))}},e=>{"use strict";e.exports=function(e,t,n){var r,i,s,o,a,u,c,l,h,p,d=t+1,f=e.md.block.ruler.getRules("paragraph");if(e.sCount[t]-e.blkIndent>=4)return!1;for(p=e.parentType,e.parentType="paragraph";d<n&&!e.isEmpty(d);d++)if(!(e.sCount[d]-e.blkIndent>3)){if(e.sCount[d]>=e.blkIndent&&(u=e.bMarks[d]+e.tShift[d])<(c=e.eMarks[d])&&(45===(h=e.src.charCodeAt(u))||61===h)&&(u=e.skipChars(u,h),(u=e.skipSpaces(u))>=c)){l=61===h?1:2;break}if(!(e.sCount[d]<0)){for(i=!1,s=0,o=f.length;s<o;s++)if(f[s](e,d,n,!0)){i=!0;break}if(i)break}}return!!l&&(r=e.getLines(t,d,e.blkIndent,!1).trim(),e.line=d+1,(a=e.push("heading_open","h"+String(l),1)).markup=String.fromCharCode(h),a.map=[t,e.line],(a=e.push("inline","",0)).content=r,a.map=[t,e.line-1],a.children=[],(a=e.push("heading_close","h"+String(l),-1)).markup=String.fromCharCode(h),e.parentType=p,!0)}},(e,t,n)=>{"use strict";var r=n(83),i=n(84).HTML_OPEN_CLOSE_TAG_RE,s=[[/^<(script|pre|style)(?=(\s|>|$))/i,/<\/(script|pre|style)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp("^</?("+r.join("|")+")(?=(\\s|/?>|$))","i"),/^$/,!0],[new RegExp(i.source+"\\s*$"),/^$/,!1]];e.exports=function(e,t,n,r){var i,o,a,u,c=e.bMarks[t]+e.tShift[t],l=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;if(!e.md.options.html)return!1;if(60!==e.src.charCodeAt(c))return!1;for(u=e.src.slice(c,l),i=0;i<s.length&&!s[i][0].test(u);i++);if(i===s.length)return!1;if(r)return s[i][2];if(o=t+1,!s[i][1].test(u))for(;o<n&&!(e.sCount[o]<e.blkIndent);o++)if(c=e.bMarks[o]+e.tShift[o],l=e.eMarks[o],u=e.src.slice(c,l),s[i][1].test(u)){0!==u.length&&o++;break}return e.line=o,(a=e.push("html_block","",0)).map=[t,o],a.content=e.getLines(t,o,e.blkIndent,!0),!0}},e=>{"use strict";e.exports=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","meta","nav","noframes","ol","optgroup","option","p","param","section","source","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"]},e=>{"use strict";var t="<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^\"'=<>`\\x00-\\x20]+|'[^']*'|\"[^\"]*\"))?)*\\s*\\/?>",n="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",r=new RegExp("^(?:"+t+"|"+n+"|\x3c!----\x3e|\x3c!--(?:-?[^>-])(?:-?[^-])*--\x3e|<[?].*?[?]>|<![A-Z]+\\s+[^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)"),i=new RegExp("^(?:"+t+"|"+n+")");e.exports.HTML_TAG_RE=r,e.exports.HTML_OPEN_CLOSE_TAG_RE=i},e=>{"use strict";e.exports=function(e,t){var n,r,i,s,o,a,u=t+1,c=e.md.block.ruler.getRules("paragraph"),l=e.lineMax;for(a=e.parentType,e.parentType="paragraph";u<l&&!e.isEmpty(u);u++)if(!(e.sCount[u]-e.blkIndent>3||e.sCount[u]<0)){for(r=!1,i=0,s=c.length;i<s;i++)if(c[i](e,u,l,!0)){r=!0;break}if(r)break}return n=e.getLines(t,u,e.blkIndent,!1).trim(),e.line=u,(o=e.push("paragraph_open","p",1)).map=[t,e.line],(o=e.push("inline","",0)).content=n,o.map=[t,e.line],o.children=[],o=e.push("paragraph_close","p",-1),e.parentType=a,!0}},(e,t,n)=>{"use strict";var r=n(71),i=n(43).isSpace;function s(e,t,n,r){var s,o,a,u,c,l,h,p;for(this.src=e,this.md=t,this.env=n,this.tokens=r,this.bMarks=[],this.eMarks=[],this.tShift=[],this.sCount=[],this.bsCount=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.ddIndent=-1,this.listIndent=-1,this.parentType="root",this.level=0,this.result="",p=!1,a=u=l=h=0,c=(o=this.src).length;u<c;u++){if(s=o.charCodeAt(u),!p){if(i(s)){l++,9===s?h+=4-h%4:h++;continue}p=!0}10!==s&&u!==c-1||(10!==s&&u++,this.bMarks.push(a),this.eMarks.push(u),this.tShift.push(l),this.sCount.push(h),this.bsCount.push(0),p=!1,l=0,h=0,a=u+1)}this.bMarks.push(o.length),this.eMarks.push(o.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}s.prototype.push=function(e,t,n){var i=new r(e,t,n);return i.block=!0,n<0&&this.level--,i.level=this.level,n>0&&this.level++,this.tokens.push(i),i},s.prototype.isEmpty=function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]},s.prototype.skipEmptyLines=function(e){for(var t=this.lineMax;e<t&&!(this.bMarks[e]+this.tShift[e]<this.eMarks[e]);e++);return e},s.prototype.skipSpaces=function(e){for(var t,n=this.src.length;e<n&&(t=this.src.charCodeAt(e),i(t));e++);return e},s.prototype.skipSpacesBack=function(e,t){if(e<=t)return e;for(;e>t;)if(!i(this.src.charCodeAt(--e)))return e+1;return e},s.prototype.skipChars=function(e,t){for(var n=this.src.length;e<n&&this.src.charCodeAt(e)===t;e++);return e},s.prototype.skipCharsBack=function(e,t,n){if(e<=n)return e;for(;e>n;)if(t!==this.src.charCodeAt(--e))return e+1;return e},s.prototype.getLines=function(e,t,n,r){var s,o,a,u,c,l,h,p=e;if(e>=t)return"";for(l=new Array(t-e),s=0;p<t;p++,s++){for(o=0,h=u=this.bMarks[p],c=p+1<t||r?this.eMarks[p]+1:this.eMarks[p];u<c&&o<n;){if(a=this.src.charCodeAt(u),i(a))9===a?o+=4-(o+this.bsCount[p])%4:o++;else{if(!(u-h<this.tShift[p]))break;o++}u++}l[s]=o>n?new Array(o-n+1).join(" ")+this.src.slice(u,c):this.src.slice(u,c)}return l.join("")},s.prototype.Token=r,e.exports=s},(e,t,n)=>{"use strict";var r=n(63),i=[["text",n(88)],["newline",n(89)],["escape",n(90)],["backticks",n(91)],["strikethrough",n(92).tokenize],["emphasis",n(93).tokenize],["link",n(94)],["image",n(95)],["autolink",n(96)],["html_inline",n(97)],["entity",n(98)]],s=[["balance_pairs",n(99)],["strikethrough",n(92).postProcess],["emphasis",n(93).postProcess],["text_collapse",n(100)]];function o(){var e;for(this.ruler=new r,e=0;e<i.length;e++)this.ruler.push(i[e][0],i[e][1]);for(this.ruler2=new r,e=0;e<s.length;e++)this.ruler2.push(s[e][0],s[e][1])}o.prototype.skipToken=function(e){var t,n,r=e.pos,i=this.ruler.getRules(""),s=i.length,o=e.md.options.maxNesting,a=e.cache;if(void 0===a[r]){if(e.level<o)for(n=0;n<s&&(e.level++,t=i[n](e,!0),e.level--,!t);n++);else e.pos=e.posMax;t||e.pos++,a[r]=e.pos}else e.pos=a[r]},o.prototype.tokenize=function(e){for(var t,n,r=this.ruler.getRules(""),i=r.length,s=e.posMax,o=e.md.options.maxNesting;e.pos<s;){if(e.level<o)for(n=0;n<i&&!(t=r[n](e,!1));n++);if(t){if(e.pos>=s)break}else e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()},o.prototype.parse=function(e,t,n,r){var i,s,o,a=new this.State(e,t,n,r);for(this.tokenize(a),o=(s=this.ruler2.getRules("")).length,i=0;i<o;i++)s[i](a)},o.prototype.State=n(101),e.exports=o},e=>{"use strict";function t(e){switch(e){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}e.exports=function(e,n){for(var r=e.pos;r<e.posMax&&!t(e.src.charCodeAt(r));)r++;return r!==e.pos&&(n||(e.pending+=e.src.slice(e.pos,r)),e.pos=r,!0)}},(e,t,n)=>{"use strict";var r=n(43).isSpace;e.exports=function(e,t){var n,i,s=e.pos;if(10!==e.src.charCodeAt(s))return!1;for(n=e.pending.length-1,i=e.posMax,t||(n>=0&&32===e.pending.charCodeAt(n)?n>=1&&32===e.pending.charCodeAt(n-1)?(e.pending=e.pending.replace(/ +$/,""),e.push("hardbreak","br",0)):(e.pending=e.pending.slice(0,-1),e.push("softbreak","br",0)):e.push("softbreak","br",0)),s++;s<i&&r(e.src.charCodeAt(s));)s++;return e.pos=s,!0}},(e,t,n)=>{"use strict";for(var r=n(43).isSpace,i=[],s=0;s<256;s++)i.push(0);"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach((function(e){i[e.charCodeAt(0)]=1})),e.exports=function(e,t){var n,s=e.pos,o=e.posMax;if(92!==e.src.charCodeAt(s))return!1;if(++s<o){if((n=e.src.charCodeAt(s))<256&&0!==i[n])return t||(e.pending+=e.src[s]),e.pos+=2,!0;if(10===n){for(t||e.push("hardbreak","br",0),s++;s<o&&(n=e.src.charCodeAt(s),r(n));)s++;return e.pos=s,!0}}return t||(e.pending+="\\"),e.pos++,!0}},e=>{"use strict";e.exports=function(e,t){var n,r,i,s,o,a,u=e.pos;if(96!==e.src.charCodeAt(u))return!1;for(n=u,u++,r=e.posMax;u<r&&96===e.src.charCodeAt(u);)u++;for(i=e.src.slice(n,u),s=o=u;-1!==(s=e.src.indexOf("`",o));){for(o=s+1;o<r&&96===e.src.charCodeAt(o);)o++;if(o-s===i.length)return t||((a=e.push("code_inline","code",0)).markup=i,a.content=e.src.slice(u,s).replace(/\n/g," ").replace(/^ (.+) $/,"$1")),e.pos=o,!0}return t||(e.pending+=i),e.pos+=i.length,!0}},e=>{"use strict";function t(e,t){var n,r,i,s,o,a=[],u=t.length;for(n=0;n<u;n++)126===(i=t[n]).marker&&-1!==i.end&&(s=t[i.end],(o=e.tokens[i.token]).type="s_open",o.tag="s",o.nesting=1,o.markup="~~",o.content="",(o=e.tokens[s.token]).type="s_close",o.tag="s",o.nesting=-1,o.markup="~~",o.content="","text"===e.tokens[s.token-1].type&&"~"===e.tokens[s.token-1].content&&a.push(s.token-1));for(;a.length;){for(r=(n=a.pop())+1;r<e.tokens.length&&"s_close"===e.tokens[r].type;)r++;n!==--r&&(o=e.tokens[r],e.tokens[r]=e.tokens[n],e.tokens[n]=o)}}e.exports.tokenize=function(e,t){var n,r,i,s,o=e.pos,a=e.src.charCodeAt(o);if(t)return!1;if(126!==a)return!1;if(i=(r=e.scanDelims(e.pos,!0)).length,s=String.fromCharCode(a),i<2)return!1;for(i%2&&(e.push("text","",0).content=s,i--),n=0;n<i;n+=2)e.push("text","",0).content=s+s,e.delimiters.push({marker:a,length:0,jump:n,token:e.tokens.length-1,end:-1,open:r.can_open,close:r.can_close});return e.pos+=r.length,!0},e.exports.postProcess=function(e){var n,r=e.tokens_meta,i=e.tokens_meta.length;for(t(e,e.delimiters),n=0;n<i;n++)r[n]&&r[n].delimiters&&t(e,r[n].delimiters)}},e=>{"use strict";function t(e,t){var n,r,i,s,o,a;for(n=t.length-1;n>=0;n--)95!==(r=t[n]).marker&&42!==r.marker||-1!==r.end&&(i=t[r.end],a=n>0&&t[n-1].end===r.end+1&&t[n-1].token===r.token-1&&t[r.end+1].token===i.token+1&&t[n-1].marker===r.marker,o=String.fromCharCode(r.marker),(s=e.tokens[r.token]).type=a?"strong_open":"em_open",s.tag=a?"strong":"em",s.nesting=1,s.markup=a?o+o:o,s.content="",(s=e.tokens[i.token]).type=a?"strong_close":"em_close",s.tag=a?"strong":"em",s.nesting=-1,s.markup=a?o+o:o,s.content="",a&&(e.tokens[t[n-1].token].content="",e.tokens[t[r.end+1].token].content="",n--))}e.exports.tokenize=function(e,t){var n,r,i=e.pos,s=e.src.charCodeAt(i);if(t)return!1;if(95!==s&&42!==s)return!1;for(r=e.scanDelims(e.pos,42===s),n=0;n<r.length;n++)e.push("text","",0).content=String.fromCharCode(s),e.delimiters.push({marker:s,length:r.length,jump:n,token:e.tokens.length-1,end:-1,open:r.can_open,close:r.can_close});return e.pos+=r.length,!0},e.exports.postProcess=function(e){var n,r=e.tokens_meta,i=e.tokens_meta.length;for(t(e,e.delimiters),n=0;n<i;n++)r[n]&&r[n].delimiters&&t(e,r[n].delimiters)}},(e,t,n)=>{"use strict";var r=n(43).normalizeReference,i=n(43).isSpace;e.exports=function(e,t){var n,s,o,a,u,c,l,h,p,d="",f=e.pos,m=e.posMax,g=e.pos,x=!0;if(91!==e.src.charCodeAt(e.pos))return!1;if(u=e.pos+1,(a=e.md.helpers.parseLinkLabel(e,e.pos,!0))<0)return!1;if((c=a+1)<m&&40===e.src.charCodeAt(c)){for(x=!1,c++;c<m&&(s=e.src.charCodeAt(c),i(s)||10===s);c++);if(c>=m)return!1;for(g=c,(l=e.md.helpers.parseLinkDestination(e.src,c,e.posMax)).ok&&(d=e.md.normalizeLink(l.str),e.md.validateLink(d)?c=l.pos:d=""),g=c;c<m&&(s=e.src.charCodeAt(c),i(s)||10===s);c++);if(l=e.md.helpers.parseLinkTitle(e.src,c,e.posMax),c<m&&g!==c&&l.ok)for(p=l.str,c=l.pos;c<m&&(s=e.src.charCodeAt(c),i(s)||10===s);c++);else p="";(c>=m||41!==e.src.charCodeAt(c))&&(x=!0),c++}if(x){if(void 0===e.env.references)return!1;if(c<m&&91===e.src.charCodeAt(c)?(g=c+1,(c=e.md.helpers.parseLinkLabel(e,c))>=0?o=e.src.slice(g,c++):c=a+1):c=a+1,o||(o=e.src.slice(u,a)),!(h=e.env.references[r(o)]))return e.pos=f,!1;d=h.href,p=h.title}return t||(e.pos=u,e.posMax=a,e.push("link_open","a",1).attrs=n=[["href",d]],p&&n.push(["title",p]),e.md.inline.tokenize(e),e.push("link_close","a",-1)),e.pos=c,e.posMax=m,!0}},(e,t,n)=>{"use strict";var r=n(43).normalizeReference,i=n(43).isSpace;e.exports=function(e,t){var n,s,o,a,u,c,l,h,p,d,f,m,g,x="",y=e.pos,D=e.posMax;if(33!==e.src.charCodeAt(e.pos))return!1;if(91!==e.src.charCodeAt(e.pos+1))return!1;if(c=e.pos+2,(u=e.md.helpers.parseLinkLabel(e,e.pos+1,!1))<0)return!1;if((l=u+1)<D&&40===e.src.charCodeAt(l)){for(l++;l<D&&(s=e.src.charCodeAt(l),i(s)||10===s);l++);if(l>=D)return!1;for(g=l,(p=e.md.helpers.parseLinkDestination(e.src,l,e.posMax)).ok&&(x=e.md.normalizeLink(p.str),e.md.validateLink(x)?l=p.pos:x=""),g=l;l<D&&(s=e.src.charCodeAt(l),i(s)||10===s);l++);if(p=e.md.helpers.parseLinkTitle(e.src,l,e.posMax),l<D&&g!==l&&p.ok)for(d=p.str,l=p.pos;l<D&&(s=e.src.charCodeAt(l),i(s)||10===s);l++);else d="";if(l>=D||41!==e.src.charCodeAt(l))return e.pos=y,!1;l++}else{if(void 0===e.env.references)return!1;if(l<D&&91===e.src.charCodeAt(l)?(g=l+1,(l=e.md.helpers.parseLinkLabel(e,l))>=0?a=e.src.slice(g,l++):l=u+1):l=u+1,a||(a=e.src.slice(c,u)),!(h=e.env.references[r(a)]))return e.pos=y,!1;x=h.href,d=h.title}return t||(o=e.src.slice(c,u),e.md.inline.parse(o,e.md,e.env,m=[]),(f=e.push("image","img",0)).attrs=n=[["src",x],["alt",""]],f.children=m,f.content=o,d&&n.push(["title",d])),e.pos=l,e.posMax=D,!0}},e=>{"use strict";var t=/^<([a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)>/,n=/^<([a-zA-Z][a-zA-Z0-9+.\-]{1,31}):([^<>\x00-\x20]*)>/;e.exports=function(e,r){var i,s,o,a,u,c,l=e.pos;return!(60!==e.src.charCodeAt(l)||(i=e.src.slice(l)).indexOf(">")<0||(n.test(i)?(a=(s=i.match(n))[0].slice(1,-1),u=e.md.normalizeLink(a),!e.md.validateLink(u)||(r||((c=e.push("link_open","a",1)).attrs=[["href",u]],c.markup="autolink",c.info="auto",(c=e.push("text","",0)).content=e.md.normalizeLinkText(a),(c=e.push("link_close","a",-1)).markup="autolink",c.info="auto"),e.pos+=s[0].length,0)):!t.test(i)||(a=(o=i.match(t))[0].slice(1,-1),u=e.md.normalizeLink("mailto:"+a),!e.md.validateLink(u)||(r||((c=e.push("link_open","a",1)).attrs=[["href",u]],c.markup="autolink",c.info="auto",(c=e.push("text","",0)).content=e.md.normalizeLinkText(a),(c=e.push("link_close","a",-1)).markup="autolink",c.info="auto"),e.pos+=o[0].length,0))))}},(e,t,n)=>{"use strict";var r=n(84).HTML_TAG_RE;e.exports=function(e,t){var n,i,s,o=e.pos;return!(!e.md.options.html||(s=e.posMax,60!==e.src.charCodeAt(o)||o+2>=s||33!==(n=e.src.charCodeAt(o+1))&&63!==n&&47!==n&&!function(e){var t=32|e;return t>=97&&t<=122}(n)||!(i=e.src.slice(o).match(r))||(t||(e.push("html_inline","",0).content=e.src.slice(o,o+i[0].length)),e.pos+=i[0].length,0)))}},(e,t,n)=>{"use strict";var r=n(44),i=n(43).has,s=n(43).isValidEntityCode,o=n(43).fromCodePoint,a=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,u=/^&([a-z][a-z0-9]{1,31});/i;e.exports=function(e,t){var n,c,l=e.pos,h=e.posMax;if(38!==e.src.charCodeAt(l))return!1;if(l+1<h)if(35===e.src.charCodeAt(l+1)){if(c=e.src.slice(l).match(a))return t||(n="x"===c[1][0].toLowerCase()?parseInt(c[1].slice(1),16):parseInt(c[1],10),e.pending+=s(n)?o(n):o(65533)),e.pos+=c[0].length,!0}else if((c=e.src.slice(l).match(u))&&i(r,c[1]))return t||(e.pending+=r[c[1]]),e.pos+=c[0].length,!0;return t||(e.pending+="&"),e.pos++,!0}},e=>{"use strict";function t(e,t){var n,r,i,s,o,a,u,c,l={},h=t.length;for(n=0;n<h;n++)if((i=t[n]).length=i.length||0,i.close){for(l.hasOwnProperty(i.marker)||(l[i.marker]=[-1,-1,-1]),o=l[i.marker][i.length%3],a=-1,r=n-i.jump-1;r>o;r-=s.jump+1)if((s=t[r]).marker===i.marker&&(-1===a&&(a=r),s.open&&s.end<0&&(u=!1,(s.close||i.open)&&(s.length+i.length)%3==0&&(s.length%3==0&&i.length%3==0||(u=!0)),!u))){c=r>0&&!t[r-1].open?t[r-1].jump+1:0,i.jump=n-r+c,i.open=!1,s.end=n,s.jump=c,s.close=!1,a=-1;break}-1!==a&&(l[i.marker][(i.length||0)%3]=a)}}e.exports=function(e){var n,r=e.tokens_meta,i=e.tokens_meta.length;for(t(0,e.delimiters),n=0;n<i;n++)r[n]&&r[n].delimiters&&t(0,r[n].delimiters)}},e=>{"use strict";e.exports=function(e){var t,n,r=0,i=e.tokens,s=e.tokens.length;for(t=n=0;t<s;t++)i[t].nesting<0&&r--,i[t].level=r,i[t].nesting>0&&r++,"text"===i[t].type&&t+1<s&&"text"===i[t+1].type?i[t+1].content=i[t].content+i[t+1].content:(t!==n&&(i[n]=i[t]),n++);t!==n&&(i.length=n)}},(e,t,n)=>{"use strict";var r=n(71),i=n(43).isWhiteSpace,s=n(43).isPunctChar,o=n(43).isMdAsciiPunct;function a(e,t,n,r){this.src=e,this.env=n,this.md=t,this.tokens=r,this.tokens_meta=Array(r.length),this.pos=0,this.posMax=this.src.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache={},this.delimiters=[],this._prev_delimiters=[]}a.prototype.pushPending=function(){var e=new r("text","",0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending="",e},a.prototype.push=function(e,t,n){this.pending&&this.pushPending();var i=new r(e,t,n),s=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),i.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],s={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(i),this.tokens_meta.push(s),i},a.prototype.scanDelims=function(e,t){var n,r,a,u,c,l,h,p,d,f=e,m=!0,g=!0,x=this.posMax,y=this.src.charCodeAt(e);for(n=e>0?this.src.charCodeAt(e-1):32;f<x&&this.src.charCodeAt(f)===y;)f++;return a=f-e,r=f<x?this.src.charCodeAt(f):32,h=o(n)||s(String.fromCharCode(n)),d=o(r)||s(String.fromCharCode(r)),l=i(n),(p=i(r))?m=!1:d&&(l||h||(m=!1)),l?g=!1:h&&(p||d||(g=!1)),t?(u=m,c=g):(u=m&&(!g||h),c=g&&(!m||d)),{can_open:u,can_close:c,length:a}},a.prototype.Token=r,e.exports=a},(e,t,n)=>{"use strict";function r(e){var t=Array.prototype.slice.call(arguments,1);return t.forEach((function(t){t&&Object.keys(t).forEach((function(n){e[n]=t[n]}))})),e}function i(e){return Object.prototype.toString.call(e)}function s(e){return"[object Function]"===i(e)}function o(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}var a={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1},u={"http:":{validate:function(e,t,n){var r=e.slice(t);return n.re.http||(n.re.http=new RegExp("^\\/\\/"+n.re.src_auth+n.re.src_host_port_strict+n.re.src_path,"i")),n.re.http.test(r)?r.match(n.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(e,t,n){var r=e.slice(t);return n.re.no_http||(n.re.no_http=new RegExp("^"+n.re.src_auth+"(?:localhost|(?:(?:"+n.re.src_domain+")\\.)+"+n.re.src_domain_root+")"+n.re.src_port+n.re.src_host_terminator+n.re.src_path,"i")),n.re.no_http.test(r)?t>=3&&":"===e[t-3]||t>=3&&"/"===e[t-3]?0:r.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,n){var r=e.slice(t);return n.re.mailto||(n.re.mailto=new RegExp("^"+n.re.src_email_name+"@"+n.re.src_host_strict,"i")),n.re.mailto.test(r)?r.match(n.re.mailto)[0].length:0}}},c="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function l(e){var t=e.re=n(103)(e.__opts__),r=e.__tlds__.slice();function a(e){return e.replace("%TLDS%",t.src_tlds)}e.onCompile(),e.__tlds_replaced__||r.push("a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]"),r.push(t.src_xn),t.src_tlds=r.join("|"),t.email_fuzzy=RegExp(a(t.tpl_email_fuzzy),"i"),t.link_fuzzy=RegExp(a(t.tpl_link_fuzzy),"i"),t.link_no_ip_fuzzy=RegExp(a(t.tpl_link_no_ip_fuzzy),"i"),t.host_fuzzy_test=RegExp(a(t.tpl_host_fuzzy_test),"i");var u=[];function c(e,t){throw new Error('(LinkifyIt) Invalid schema "'+e+'": '+t)}e.__compiled__={},Object.keys(e.__schemas__).forEach((function(t){var n=e.__schemas__[t];if(null!==n){var r={validate:null,link:null};if(e.__compiled__[t]=r,"[object Object]"===i(n))return"[object RegExp]"!==i(n.validate)?s(n.validate)?r.validate=n.validate:c(t,n):r.validate=function(e){return function(t,n){var r=t.slice(n);return e.test(r)?r.match(e)[0].length:0}}(n.validate),void(s(n.normalize)?r.normalize=n.normalize:n.normalize?c(t,n):r.normalize=function(e,t){t.normalize(e)});!function(e){return"[object String]"===i(e)}(n)?c(t,n):u.push(t)}})),u.forEach((function(t){e.__compiled__[e.__schemas__[t]]&&(e.__compiled__[t].validate=e.__compiled__[e.__schemas__[t]].validate,e.__compiled__[t].normalize=e.__compiled__[e.__schemas__[t]].normalize)})),e.__compiled__[""]={validate:null,normalize:function(e,t){t.normalize(e)}};var l=Object.keys(e.__compiled__).filter((function(t){return t.length>0&&e.__compiled__[t]})).map(o).join("|");e.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+l+")","i"),e.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+l+")","ig"),e.re.pretest=RegExp("("+e.re.schema_test.source+")|("+e.re.host_fuzzy_test.source+")|@","i"),function(e){e.__index__=-1,e.__text_cache__=""}(e)}function h(e,t){var n=e.__index__,r=e.__last_index__,i=e.__text_cache__.slice(n,r);this.schema=e.__schema__.toLowerCase(),this.index=n+t,this.lastIndex=r+t,this.raw=i,this.text=i,this.url=i}function p(e,t){var n=new h(e,t);return e.__compiled__[n.schema].normalize(n,e),n}function d(e,t){if(!(this instanceof d))return new d(e,t);var n;t||(n=e,Object.keys(n||{}).reduce((function(e,t){return e||a.hasOwnProperty(t)}),!1)&&(t=e,e={})),this.__opts__=r({},a,t),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=r({},u,e),this.__compiled__={},this.__tlds__=c,this.__tlds_replaced__=!1,this.re={},l(this)}d.prototype.add=function(e,t){return this.__schemas__[e]=t,l(this),this},d.prototype.set=function(e){return this.__opts__=r(this.__opts__,e),this},d.prototype.test=function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return!1;var t,n,r,i,s,o,a,u;if(this.re.schema_test.test(e))for((a=this.re.schema_search).lastIndex=0;null!==(t=a.exec(e));)if(i=this.testSchemaAt(e,t[2],a.lastIndex)){this.__schema__=t[2],this.__index__=t.index+t[1].length,this.__last_index__=t.index+t[0].length+i;break}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(u=e.search(this.re.host_fuzzy_test))>=0&&(this.__index__<0||u<this.__index__)&&null!==(n=e.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy))&&(s=n.index+n[1].length,(this.__index__<0||s<this.__index__)&&(this.__schema__="",this.__index__=s,this.__last_index__=n.index+n[0].length)),this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&e.indexOf("@")>=0&&null!==(r=e.match(this.re.email_fuzzy))&&(s=r.index+r[1].length,o=r.index+r[0].length,(this.__index__<0||s<this.__index__||s===this.__index__&&o>this.__last_index__)&&(this.__schema__="mailto:",this.__index__=s,this.__last_index__=o)),this.__index__>=0},d.prototype.pretest=function(e){return this.re.pretest.test(e)},d.prototype.testSchemaAt=function(e,t,n){return this.__compiled__[t.toLowerCase()]?this.__compiled__[t.toLowerCase()].validate(e,n,this):0},d.prototype.match=function(e){var t=0,n=[];this.__index__>=0&&this.__text_cache__===e&&(n.push(p(this,t)),t=this.__last_index__);for(var r=t?e.slice(t):e;this.test(r);)n.push(p(this,t)),r=r.slice(this.__last_index__),t+=this.__last_index__;return n.length?n:null},d.prototype.tlds=function(e,t){return e=Array.isArray(e)?e:[e],t?(this.__tlds__=this.__tlds__.concat(e).sort().filter((function(e,t,n){return e!==n[t-1]})).reverse(),l(this),this):(this.__tlds__=e.slice(),this.__tlds_replaced__=!0,l(this),this)},d.prototype.normalize=function(e){e.schema||(e.url="http://"+e.url),"mailto:"!==e.schema||/^mailto:/i.test(e.url)||(e.url="mailto:"+e.url)},d.prototype.onCompile=function(){},e.exports=d},(e,t,n)=>{"use strict";e.exports=function(e){var t={};return t.src_Any=n(53).source,t.src_Cc=n(54).source,t.src_Z=n(56).source,t.src_P=n(46).source,t.src_ZPCc=[t.src_Z,t.src_P,t.src_Cc].join("|"),t.src_ZCc=[t.src_Z,t.src_Cc].join("|"),t.src_pseudo_letter="(?:(?![><|]|"+t.src_ZPCc+")"+t.src_Any+")",t.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",t.src_auth="(?:(?:(?!"+t.src_ZCc+"|[@/\\[\\]()]).)+@)?",t.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",t.src_host_terminator="(?=$|[><|]|"+t.src_ZPCc+")(?!-|_|:\\d|\\.-|\\.(?!$|"+t.src_ZPCc+"))",t.src_path="(?:[/?#](?:(?!"+t.src_ZCc+"|[><|]|[()[\\]{}.,\"'?!\\-]).|\\[(?:(?!"+t.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+t.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+t.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+t.src_ZCc+'|["]).)+\\"|\\\'(?:(?!'+t.src_ZCc+"|[']).)+\\'|\\'(?="+t.src_pseudo_letter+"|[-]).|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!"+t.src_ZCc+"|[.]).|"+(e&&e["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+"\\,(?!"+t.src_ZCc+").|\\!+(?!"+t.src_ZCc+"|[!]).|\\?(?!"+t.src_ZCc+"|[?]).)+|\\/)?",t.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',t.src_xn="xn--[a-z0-9\\-]{1,59}",t.src_domain_root="(?:"+t.src_xn+"|"+t.src_pseudo_letter+"{1,63})",t.src_domain="(?:"+t.src_xn+"|(?:"+t.src_pseudo_letter+")|(?:"+t.src_pseudo_letter+"(?:-|"+t.src_pseudo_letter+"){0,61}"+t.src_pseudo_letter+"))",t.src_host="(?:(?:(?:(?:"+t.src_domain+")\\.)*"+t.src_domain+"))",t.tpl_host_fuzzy="(?:"+t.src_ip4+"|(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%)))",t.tpl_host_no_ip_fuzzy="(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%))",t.src_host_strict=t.src_host+t.src_host_terminator,t.tpl_host_fuzzy_strict=t.tpl_host_fuzzy+t.src_host_terminator,t.src_host_port_strict=t.src_host+t.src_port+t.src_host_terminator,t.tpl_host_port_fuzzy_strict=t.tpl_host_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_port_no_ip_fuzzy_strict=t.tpl_host_no_ip_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+t.src_ZPCc+"|>|$))",t.tpl_email_fuzzy='(^|[><|]|"|\\(|'+t.src_ZCc+")("+t.src_email_name+"@"+t.tpl_host_fuzzy_strict+")",t.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_fuzzy_strict+t.src_path+")",t.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_no_ip_fuzzy_strict+t.src_path+")",t}},e=>{"use strict";e.exports=require("punycode")},e=>{"use strict";e.exports={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}}},e=>{"use strict";e.exports={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline"]},block:{rules:["paragraph"]},inline:{rules:["text"],rules2:["balance_pairs","text_collapse"]}}}},e=>{"use strict";e.exports={options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"],rules2:["balance_pairs","emphasis","text_collapse"]}}}},(e,t,n)=>{"use strict";const r=n(38).URL,i=n(109),s=i.homepage,o=i.version,a=[n(110),n(113),n(114),n(115),n(117),n(118),n(119),n(120),n(121),n(122),n(123),n(124),n(125),n(126),n(127),n(128),n(129),n(130),n(131),n(132),n(133),n(134),n(135),n(136),n(137),n(138),n(139),n(140),n(141),n(142),n(143),n(144),n(145),n(146),n(147),n(148),n(149),n(150),n(151),n(152),n(153),n(154),n(155),n(156)];a.forEach((e=>{const t=e.names[0].toLowerCase();e.information=new r(`${s}/blob/v${o}/doc/Rules.md#${t}`)})),e.exports=a},e=>{"use strict";e.exports=JSON.parse('{"name":"markdownlint","version":"0.22.0","description":"A Node.js style checker and lint tool for Markdown/CommonMark files.","main":"lib/markdownlint.js","types":"lib/markdownlint.d.ts","author":"David Anson (https://dlaa.me/)","license":"MIT","homepage":"https://github.com/DavidAnson/markdownlint","repository":{"type":"git","url":"https://github.com/DavidAnson/markdownlint.git"},"bugs":"https://github.com/DavidAnson/markdownlint/issues","scripts":{"test":"tape test/markdownlint-test.js test/markdownlint-test-custom-rules.js test/markdownlint-test-helpers.js test/markdownlint-test-result-object.js test/markdownlint-test-scenarios.js","test-cover":"c8 --check-coverage --branches 100 --functions 100 --lines 100 --statements 100 tape test/markdownlint-test.js test/markdownlint-test-custom-rules.js test/markdownlint-test-helpers.js test/markdownlint-test-result-object.js test/markdownlint-test-scenarios.js","test-declaration":"cd example/typescript && tsc && node type-check.js","test-extra":"node test/markdownlint-test-extra.js","lint":"eslint --max-warnings 0 lib helpers test schema && eslint --env browser --global markdownit --global markdownlint --rule \\"no-unused-vars: 0, no-extend-native: 0, max-statements: 0, no-console: 0, no-var: 0, unicorn/prefer-add-event-listener: 0, unicorn/prefer-query-selector: 0, unicorn/prefer-replace-all: 0\\" demo && eslint --rule \\"no-console: 0, no-invalid-this: 0, no-shadow: 0, object-property-newline: 0, node/no-missing-require: 0, node/no-extraneous-require: 0\\" example","ci":"npm run test-cover && npm run lint && npm run test-declaration","build-config-schema":"node schema/build-config-schema.js","build-declaration":"tsc --allowJs --declaration --emitDeclarationOnly --resolveJsonModule lib/markdownlint.js && rimraf \'lib/{c,md,r}*.d.ts\' \'helpers/*.d.ts\'","build-demo":"cpy node_modules/markdown-it/dist/markdown-it.min.js demo && cd demo && rimraf markdownlint-browser.* && cpy file-header.js . --rename=markdownlint-browser.js && tsc --allowJs --resolveJsonModule --outDir ../lib-es3 ../lib/markdownlint.js && cpy ../helpers/package.json ../lib-es3/helpers && browserify ../lib-es3/lib/markdownlint.js --standalone markdownlint >> markdownlint-browser.js && browserify ../lib-es3/helpers/helpers.js --standalone helpers >> markdownlint-rule-helpers-browser.js && uglifyjs markdownlint-browser.js markdownlint-rule-helpers-browser.js --compress --mangle --comments --output markdownlint-browser.min.js","build-example":"npm install --no-save --ignore-scripts grunt grunt-cli gulp through2","example":"cd example && node standalone.js && grunt markdownlint --force && gulp markdownlint","clone-test-repos":"make-dir test-repos && cd test-repos && git clone https://github.com/eslint/eslint eslint-eslint --depth 1 --no-tags --quiet && git clone https://github.com/mkdocs/mkdocs mkdocs-mkdocs --depth 1 --no-tags --quiet && git clone https://github.com/pi-hole/docs pi-hole-docs --depth 1 --no-tags --quiet","clone-test-repos-large":"npm run clone-test-repos && cd test-repos && git clone https://github.com/dotnet/docs dotnet-docs --depth 1 --no-tags --quiet","lint-test-repos":"node test/markdownlint-test-repos.js","clean-test-repos":"rimraf test-repos"},"engines":{"node":">=10"},"dependencies":{"markdown-it":"12.0.2"},"devDependencies":{"@types/node":"~14.14.9","browserify":"~17.0.0","c8":"~7.3.5","cpy-cli":"~3.1.1","eslint":"~7.14.0","eslint-plugin-jsdoc":"~30.7.8","eslint-plugin-node":"~11.1.0","eslint-plugin-unicorn":"~23.0.0","globby":"~11.0.1","js-yaml":"~3.14.0","make-dir-cli":"~2.0.0","markdown-it-for-inline":"~0.1.1","markdown-it-sub":"~1.0.0","markdown-it-sup":"~1.0.0","markdown-it-texmath":"~0.8.0","markdownlint-rule-helpers":"~0.12.0","rimraf":"~3.0.2","strip-json-comments":"~3.1.1","tape":"~5.0.1","tape-player":"~0.1.1","toml":"~3.0.0","tv4":"~1.3.0","typescript":"~4.1.2","uglify-js":"~3.12.0"},"keywords":["markdown","lint","md","CommonMark","markdownlint"],"browser":{"markdown-it":"../demo/markdown-it-stub.js"}}')},(e,t,n)=>{"use strict";const{addErrorDetailIf:r,filterTokens:i}=n(111);e.exports={names:["MD001","heading-increment","header-increment"],description:"Heading levels should only increment by one level at a time",tags:["headings","headers"],function:function(e,t){let n=0;i(e,"heading_open",(function(e){const i=Number.parseInt(e.tag.slice(1),10);n&&i>n&&r(t,e.lineNumber,"h"+(n+1),"h"+i),n=i}))}}},(e,t,n)=>{"use strict";const r=n(112),i=/\r\n?|\n/g;e.exports.newLineRe=i,e.exports.frontMatterRe=/((^---\s*$[^]*?^---\s*$)|(^\+\+\+\s*$[^]*?^(\+\+\+|\.\.\.)\s*$)|(^\{\s*$[^]*?^\}\s*$))(\r\n|\r|\n|$)/m;const s=/<!--\s*markdownlint-(?:(?:(disable|enable|capture|restore|disable-file|enable-file|disable-next-line)((?:\s+[a-z0-9_-]+)*))|(?:(configure-file)\s+([\s\S]*?)))\s*-->/gi;e.exports.inlineCommentRe=s,e.exports.bareUrlRe=/(?:http|ftp)s?:\/\/[^\s\]"']*(?:\/|[^\s\]"'\W])/gi,e.exports.listItemMarkerRe=/^([\s>]*)(?:[*+-]|\d+[.)])\s+/,e.exports.orderedListItemMarkerRe=/^[\s>]*0*(\d+)[.)]/;const o=/[_*]/g,a=/\[(?:[^[\]]|\[[^\]]*\])*\](?:\(\S*\))?/g;e.exports.utf8Encoding="utf8";const u=".,;:!?。,;:!?";e.exports.allPunctuation=u,e.exports.allPunctuationNoQuestion=u.replace(/[??]/gu,""),e.exports.isNumber=function(e){return"number"==typeof e},e.exports.isString=function(e){return"string"==typeof e},e.exports.isEmptyString=function(e){return 0===e.length},e.exports.isObject=function(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)};const c=/>|(?:<!--.*?-->)/g;e.exports.isBlankLine=function(e){return!e||!e.trim()||!e.replace(c,"").trim()},e.exports.numericSortAscending=function(e,t){return e-t},e.exports.includesSorted=function(e,t){let n=0,r=e.length-1;for(;n<=r;){const i=n+r>>1;if(e[i]<t)n=i+1;else{if(!(e[i]>t))return!0;r=i-1}}return!1};const l="\x3c!--",h="--\x3e";e.exports.clearHtmlCommentText=function(e){let t=0;for(;-1!==(t=e.indexOf(l,t));){const n=e.indexOf(h,t);if(-1===n)break;const r=e.slice(t+l.length,n);if(r.length>0&&">"!==r[0]&&"-"!==r[r.length-1]&&!r.includes("--")&&-1===e.slice(t,n+h.length).search(s)){const i=r.replace(/[^\r\n]/g," ").replace(/ ([\r\n])/g,"\\$1");e=e.slice(0,t+l.length)+i+e.slice(n)}t=n+h.length}return e},e.exports.escapeForRegExp=function(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")};const p=/\\./g;function d(e){const t=e.line.replace(/^[\s>]*(> |>)/,"");return t.length-t.trimLeft().length}function f(e,t,n){e.tokens.forEach((function(e){e.type===t&&n(e)}))}function m(e,t){let n=0,r=0,i=0;for(;i<e.length;){let s=-1,o=-1,a=-1,u=0,c=0,l="normal";for(;i<=e.length;i++){const h=e[i];"["===h&&"normal"===l?l="linkTextOpen":"]"===h&&"linkTextOpen"===l?l="linkTextClosed":"("===h&&"linkTextClosed"===l?l="linkDestinationOpen":("("===h&&"linkDestinationOpen"===l||")"===h&&"linkDestinationOpen"===l||"linkTextClosed"===l)&&(l="normal"),"`"===h&&"linkDestinationOpen"!==l?(c++,-1!==s&&-1!==a||(s=i+1)):(s>=0&&a>=0&&u===c?(t(e.substring(s,i-c),o,a,u),s=-1,a=-1):s>=0&&-1===a&&(u=c,o=n,a=r),c=0),"\n"===h?(n++,r=0):"\\"!==h||-1!==s&&-1!==a||"\n"===e[i+1]?r++:(i++,r+=2)}s>=0&&(i=s,n=o,r=a)}}function g(e,t,n,r,i,s){e({lineNumber:t,detail:n,context:r,range:i,fixInfo:s})}function x(e){let t=0,n=0,s=0;(e.match(i)||[]).forEach((e=>{switch(e){case"\r":t++;break;case"\n":n++;break;case"\r\n":s++}}));let o=null;return o=t||n||s?n>=s&&n>=t?"\n":s>=t?"\r\n":"\r":r.EOL,o}function y(e,t){return{lineNumber:e.lineNumber||t,editColumn:e.editColumn||1,deleteCount:e.deleteCount||0,insertText:e.insertText||""}}function D(e,t,n){const{editColumn:r,deleteCount:i,insertText:s}=y(t),o=r-1;return-1===i?null:e.slice(0,o)+s.replace(/\n/g,n||"\n")+e.slice(o+i)}e.exports.unescapeMarkdown=function(e,t){return e.replace(p,(e=>{const n=e[1];return"!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~".includes(n)?t||n:e}))},e.exports.fencedCodeBlockStyleFor=function(e){switch(e[0]){case"~":return"tilde";default:return"backtick"}},e.exports.indentFor=d,e.exports.headingStyleFor=function(e){return e.map[1]-e.map[0]==1?/[^\\]#\s*$/.test(e.line)?"atx_closed":"atx":"setext"},e.exports.unorderedListStyleFor=function(e){switch(e.markup){case"-":return"dash";case"+":return"plus";default:return"asterisk"}},e.exports.filterTokens=f,e.exports.getLineMetadata=function(e){const t=e.lines.map((function(e,t){return[e,t,!1,0,!1,!1]}));return f(e,"fence",(function(e){t[e.map[0]][3]=1,t[e.map[1]-1][3]=-1;for(let n=e.map[0]+1;n<e.map[1]-1;n++)t[n][2]=!0})),f(e,"code_block",(function(e){for(let n=e.map[0];n<e.map[1];n++)t[n][2]=!0})),f(e,"table_open",(function(e){for(let n=e.map[0];n<e.map[1];n++)t[n][4]=!0})),f(e,"list_item_open",(function(e){let n=1;for(let r=e.map[0];r<e.map[1];r++)t[r][5]=n,n++})),f(e,"hr",(function(e){t[e.map[0]][6]=!0})),t},e.exports.forEachLine=function(e,t){e.forEach((function(e){t(...e)}))},e.exports.flattenLists=function(e){const t=[],n=[];let r=null,i=0;const s=[];let o={map:[0,1]};return e.tokens.forEach((function(e){"math_block"===e.type&&"math"===e.tag&&e.map[1]&&e.map[1]++,"bullet_list_open"===e.type||"ordered_list_open"===e.type?(n.push(r),r={unordered:"bullet_list_open"===e.type,parentsUnordered:!r||r.unordered&&r.parentsUnordered,open:e,indent:d(e),parentIndent:r&&r.indent||0,items:[],nesting:i,lastLineIndex:-1,insert:t.length},i++):"bullet_list_close"===e.type||"ordered_list_close"===e.type?(r.lastLineIndex=o.map[1],t.splice(r.insert,0,r),delete r.insert,r=n.pop(),i--):"list_item_open"===e.type?r.items.push(e):"blockquote_open"===e.type?(s.push(i),i=0):"blockquote_close"===e.type?i=s.pop():e.map&&(o=e)})),t},e.exports.forEachInlineChild=function(e,t,n){f(e,"inline",(function(e){e.children.forEach((function(r){r.type===t&&n(r,e)}))}))},e.exports.forEachHeading=function(e,t){let n=null;e.tokens.forEach((function(e){"heading_open"===e.type?n=e:"heading_close"===e.type?n=null:"inline"===e.type&&n&&t(n,e.content)}))},e.exports.forEachInlineCodeSpan=m,e.exports.addError=g,e.exports.addErrorDetailIf=function(e,t,n,r,i,s,o,a){n!==r&&g(e,t,"Expected: "+n+"; Actual: "+r+(i?"; "+i:""),s,o,a)},e.exports.addErrorContext=function(e,t,n,r,i,s,o){n.length<=30||(n=r&&i?n.substr(0,15)+"..."+n.substr(-15):i?"..."+n.substr(-30):n.substr(0,30)+"..."),g(e,t,null,n,s,o)},e.exports.rangeFromRegExp=function(e,t){let n=null;const r=e.match(t);return r&&(n=[r.index+1,r[0].length]),n},e.exports.frontMatterHasTitle=function(e,t){const n=void 0!==t&&!t,r=new RegExp(String(t||'^\\s*"?title"?\\s*[:=]'),"i");return!n&&e.some((e=>r.test(e)))},e.exports.emphasisMarkersInContent=function(e){const{lines:t}=e,n=new Array(t.length);return f(e,"inline",(e=>{const{children:r,lineNumber:s,map:a}=e;r.some((e=>"code_inline"===e.type))&&m(t.slice(a[0],a[1]).join("\n"),((e,t,r,a)=>{e.split(i).forEach(((e,i)=>{let u=null;for(;u=o.exec(e);){const e=s-1+t+i,o=n[e]||[],c=i?0:r-1+a;o.push(c+u.index),n[e]=o}}))}))})),t.forEach(((e,t)=>{let r=null;for(;r=a.exec(e);){let e=null;for(;e=o.exec(r[0]);){const i=n[t]||[];i.push(r.index+e.index),n[t]=i}}})),n},e.exports.getPreferredLineEnding=x,e.exports.applyFix=D,e.exports.applyFixes=function(e,t){const n=x(e),r=e.split(i);let s=t.filter((e=>e.fixInfo)).map((e=>y(e.fixInfo,e.lineNumber)));s.sort(((e,t)=>{const n=-1===e.deleteCount,r=-1===t.deleteCount;return t.lineNumber-e.lineNumber||(n?1:r?-1:0)||t.editColumn-e.editColumn||t.insertText.length-e.insertText.length}));let o={};s=s.filter((e=>{const t=e.lineNumber!==o.lineNumber||e.editColumn!==o.editColumn||e.deleteCount!==o.deleteCount||e.insertText!==o.insertText;return o=e,t})),o={},s.forEach((e=>{e.lineNumber===o.lineNumber&&e.editColumn===o.editColumn&&!e.insertText&&e.deleteCount>0&&o.insertText&&!o.deleteCount&&(e.insertText=o.insertText,o.lineNumber=0),o=e})),s=s.filter((e=>e.lineNumber));let a=-1,u=-1;return s.forEach((e=>{const{lineNumber:t,editColumn:i,deleteCount:s}=e,o=t-1,c=i-1;(o!==a||c+s<u||-1===s)&&(r[o]=D(r[o],e,n)),a=o,u=c})),r.filter((e=>null!==e)).join(n)}},e=>{"use strict";e.exports=require("os")},(e,t,n)=>{"use strict";const{addErrorDetailIf:r}=n(111);e.exports={names:["MD002","first-heading-h1","first-header-h1"],description:"First heading should be a top level heading",tags:["headings","headers"],function:function(e,t){const n="h"+Number(e.config.level||1);e.tokens.every((function(e){return"heading_open"!==e.type||(r(t,e.lineNumber,n,e.tag),!1)}))}}},(e,t,n)=>{"use strict";const{addErrorDetailIf:r,filterTokens:i,headingStyleFor:s}=n(111);e.exports={names:["MD003","heading-style","header-style"],description:"Heading style",tags:["headings","headers"],function:function(e,t){let n=String(e.config.style||"consistent");i(e,"heading_open",(function(e){const i=s(e);if("consistent"===n&&(n=i),i!==n){const s=/h[12]/.test(e.tag),o="setext_with_atx_closed"===n&&(s&&"setext"===i||!s&&"atx_closed"===i);if(!("setext_with_atx"===n&&(s&&"setext"===i||!s&&"atx"===i)||o)){let o=n;"setext_with_atx"===n?o=s?"setext":"atx":"setext_with_atx_closed"===n&&(o=s?"setext":"atx_closed"),r(t,e.lineNumber,o,i)}}}))}}},(e,t,n)=>{"use strict";const{addErrorDetailIf:r,listItemMarkerRe:i,rangeFromRegExp:s,unorderedListStyleFor:o}=n(111),{flattenedLists:a}=n(116);e.exports={names:["MD004","ul-style"],description:"Unordered list style",tags:["bullet","ul"],function:function(e,t){const n=String(e.config.style||"consistent");let u=n;const c=[];a().forEach((e=>{e.unordered&&("consistent"===u&&(u=o(e.items[0])),e.items.forEach((a=>{const l=o(a);if("sublist"===n){const n=e.nesting;c[n]||l===c[n-1]?r(t,a.lineNumber,c[n],l,null,null,s(a.line,i)):c[n]=l}else r(t,a.lineNumber,u,l,null,null,s(a.line,i))})))}))}}},e=>{"use strict";let t=null;e.exports.lineMetadata=e=>(e&&(t=e),t);let n=null;e.exports.flattenedLists=e=>(e&&(n=e),n),e.exports.clear=()=>{t=null,n=null}},(e,t,n)=>{"use strict";const{addError:r,addErrorDetailIf:i,indentFor:s,listItemMarkerRe:o,orderedListItemMarkerRe:a,rangeFromRegExp:u}=n(111),{flattenedLists:c}=n(116);e.exports={names:["MD005","list-indent"],description:"Inconsistent indentation for list items at the same level",tags:["bullet","ul","indentation"],function:function(e,t){c().forEach((e=>{const n=e.indent;let c=0,l=-1,h=!1;e.items.forEach((p=>{const{line:d,lineNumber:f}=p,m=s(p);let g=null;if(e.unordered)i(t,f,n,m,null,null,u(d,o));else if(g=a.exec(d)){l=g[0].length,c=c||l;const e=g[1].length+1;if(n!==m||h)if(c===l)h=!0;else{const i=h?c-e:n,s=h?l-e:m;r(t,f,h?`Expected: (${c}); Actual: (${l})`:`Expected: ${n}; Actual: ${m}`,null,u(d,o),{editColumn:Math.min(s,i)+1,deleteCount:Math.max(s-i,0),insertText:"".padEnd(Math.max(i-s,0))})}}}))}))}}},(e,t,n)=>{"use strict";const{addErrorDetailIf:r,listItemMarkerRe:i,rangeFromRegExp:s}=n(111),{flattenedLists:o}=n(116);e.exports={names:["MD006","ul-start-left"],description:"Consider starting bulleted lists at the beginning of the line",tags:["bullet","ul","indentation"],function:function(e,t){o().forEach((e=>{e.unordered&&!e.nesting&&0!==e.indent&&e.items.forEach((n=>{const{lineNumber:o,line:a}=n;r(t,o,0,e.indent,null,null,s(a,i),{deleteCount:a.length-a.trimLeft().length})}))}))}}},(e,t,n)=>{"use strict";const{addErrorDetailIf:r,indentFor:i,listItemMarkerRe:s}=n(111),{flattenedLists:o}=n(116);e.exports={names:["MD007","ul-indent"],description:"Unordered list indentation",tags:["bullet","ul","indentation"],function:function(e,t){const n=Number(e.config.indent||2),a=!!e.config.start_indented;o().forEach((e=>{e.unordered&&e.parentsUnordered&&e.items.forEach((o=>{const{lineNumber:u,line:c}=o,l=(e.nesting+(a?1:0))*n,h=i(o);let p=null,d=1;const f=c.match(s);f&&(p=[1,f[0].length],d+=f[1].length-h),r(t,u,l,h,null,null,p,{editColumn:d,deleteCount:h,insertText:"".padEnd(l)})}))}))}}},(e,t,n)=>{"use strict";const{addError:r,filterTokens:i,forEachInlineCodeSpan:s,forEachLine:o,includesSorted:a,newLineRe:u,numericSortAscending:c}=n(111),{lineMetadata:l}=n(116);e.exports={names:["MD009","no-trailing-spaces"],description:"Trailing spaces",tags:["whitespace"],function:function(e,t){let n=e.config.br_spaces;n=Number(void 0===n?2:n);const h=!!e.config.list_item_empty_lines,p=!!e.config.strict,d=[];h&&(i(e,"list_item_open",(e=>{for(let t=e.map[0];t<e.map[1];t++)d.push(t+1)})),d.sort(c));const f=[],m=[];p&&(i(e,"paragraph_open",(e=>{for(let t=e.map[0];t<e.map[1]-1;t++)f.push(t+1)})),f.sort(c),i(e,"inline",(t=>{if(t.children.some((e=>"code_inline"===e.type))){const n=e.lines.slice(t.map[0],t.map[1]);s(n.join("\n"),((e,n)=>{const r=e.split(u).length;for(let e=0;e<r;e++)m.push(t.lineNumber+n+e)}))}})),m.sort(c));const g=n<2?0:n;o(l(),((e,n,i)=>{const s=n+1,o=e.length-e.trimRight().length;if(o&&!i&&!a(d,s)&&(g!==o||p&&(!a(f,s)||a(m,s)))){const n=e.length-o+1;r(t,s,"Expected: "+(0===g?"":"0 or ")+g+"; Actual: "+o,null,[n,o],{editColumn:n,deleteCount:o})}}))}}},(e,t,n)=>{"use strict";const{addError:r,forEachLine:i}=n(111),{lineMetadata:s}=n(116),o=/\t+/g;e.exports={names:["MD010","no-hard-tabs"],description:"Hard tabs",tags:["whitespace","hard_tab"],function:function(e,t){const n=e.config.code_blocks,a=void 0===n||!!n;i(s(),((e,n,i)=>{if(!i||a){let i=null;for(;null!==(i=o.exec(e));){const e=i.index+1,s=i[0].length;r(t,n+1,"Column: "+e,null,[e,s],{editColumn:e,deleteCount:s,insertText:"".padEnd(s)})}}}))}}},(e,t,n)=>{"use strict";const{addError:r,forEachInlineChild:i,unescapeMarkdown:s}=n(111),o=/\(([^)]+)\)\[([^\]^][^\]]*)]/g;e.exports={names:["MD011","no-reversed-links"],description:"Reversed link syntax",tags:["links"],function:function(e,t){i(e,"text",(n=>{const{lineNumber:i,content:a}=n;let u=null;for(;null!==(u=o.exec(a));){const[n,o,a]=u,c=e.lines[i-1],l=s(c).indexOf(n)+1,h=n.length;r(t,i,n,null,l?[l,h]:null,l?{editColumn:l,deleteCount:h,insertText:`[${o}](${a})`}:null)}}))}}},(e,t,n)=>{"use strict";const{addErrorDetailIf:r,forEachLine:i}=n(111),{lineMetadata:s}=n(116);e.exports={names:["MD012","no-multiple-blanks"],description:"Multiple consecutive blank lines",tags:["whitespace","blank_lines"],function:function(e,t){const n=Number(e.config.maximum||1);let o=0;i(s(),((e,i,s)=>{o=s||e.trim().length>0?0:o+1,n<o&&r(t,i+1,n,o,null,null,null,{deleteCount:-1})}))}}},(e,t,n)=>{"use strict";const{addErrorDetailIf:r,filterTokens:i,forEachHeading:s,forEachLine:o,includesSorted:a}=n(111),{lineMetadata:u}=n(116),c="^.{",l=/^\s*\[.*[^\\]]:/,h=/^[es]*(lT?L|I)[ES]*$/,p=/^([#>\s]*\s)?\S*$/,d={em_open:"e",em_close:"E",image:"I",link_open:"l",link_close:"L",strong_open:"s",strong_close:"S",text:"T"};e.exports={names:["MD013","line-length"],description:"Line length",tags:["line_length"],function:function(e,t){const n=Number(e.config.line_length||80),f=Number(e.config.heading_line_length||n),m=Number(e.config.code_block_line_length||n),g=!!e.config.strict,x=!!e.config.stern,y=g||x?"}.+$":"}.*\\s.*$",D=new RegExp(c+n+y),C=new RegExp(c+f+y),v=new RegExp(c+m+y),E=e.config.code_blocks,k=void 0===E||!!E,b=e.config.tables,A=void 0===b||!!b;let w=e.config.headings;void 0===w&&(w=e.config.headers);const S=void 0===w||!!w,_=[];s(e,(e=>{_.push(e.lineNumber)}));const F=[];i(e,"inline",(e=>{let t="";e.children.forEach((e=>{"text"===e.type&&""===e.content||(t+=d[e.type]||"x")})),h.test(t)&&F.push(e.lineNumber)})),o(u(),((e,i,s,o,u)=>{const c=i+1,h=a(_,c),d=s?m:h?f:n,y=s?v:h?C:D;!k&&s||!A&&u||!S&&h||!g&&(x&&p.test(e)||a(F,c)||l.test(e))||!y.test(e)||r(t,c,d,e.length,null,null,[d+1,e.length-d])}))}}},(e,t,n)=>{"use strict";const{addErrorContext:r,filterTokens:i}=n(111),s=/^(\s*)(\$\s+)/;e.exports={names:["MD014","commands-show-output"],description:"Dollar signs used before commands without showing output",tags:["code"],function:function(e,t){["code_block","fence"].forEach((n=>{i(e,n,(n=>{const i="fence"===n.type?1:0,o=[];let a=!0;for(let t=n.map[0]+i;t<n.map[1]-i;t++){const n=e.lines[t],r=n.trim();if(r){const e=s.exec(n);if(e){const n=e[1].length+1,i=e[2].length;o.push([t,r,n,i])}else a=!1}}a&&o.forEach((e=>{const[n,i,s,o]=e;r(t,n+1,i,null,null,[s,o],{editColumn:s,deleteCount:o})}))}))}))}}},(e,t,n)=>{"use strict";const{addErrorContext:r,forEachLine:i}=n(111),{lineMetadata:s}=n(116);e.exports={names:["MD018","no-missing-space-atx"],description:"No space after hash on atx style heading",tags:["headings","headers","atx","spaces"],function:function(e,t){i(s(),((e,n,i)=>{if(!i&&/^#+[^#\s]/.test(e)&&!/#\s*$/.test(e)&&!e.startsWith("#️⃣")){const i=/^#+/.exec(e)[0].length;r(t,n+1,e.trim(),null,null,[1,i+1],{editColumn:i+1,insertText:" "})}}))}}},(e,t,n)=>{"use strict";const{addErrorContext:r,filterTokens:i,headingStyleFor:s}=n(111);e.exports={names:["MD019","no-multiple-space-atx"],description:"Multiple spaces after hash on atx style heading",tags:["headings","headers","atx","spaces"],function:function(e,t){i(e,"heading_open",(e=>{if("atx"===s(e)){const{line:n,lineNumber:i}=e,s=/^(#+)(\s{2,})(?:\S)/.exec(n);if(s){const[,{length:e},{length:o}]=s;r(t,i,n.trim(),null,null,[1,e+o+1],{editColumn:e+1,deleteCount:o-1})}}}))}}},(e,t,n)=>{"use strict";const{addErrorContext:r,forEachLine:i}=n(111),{lineMetadata:s}=n(116);e.exports={names:["MD020","no-missing-space-closed-atx"],description:"No space inside hashes on closed atx style heading",tags:["headings","headers","atx_closed","spaces"],function:function(e,t){i(s(),((e,n,i)=>{if(!i){const i=/^(#+)(\s*)([^#]*?[^#\\])(\s*)((?:\\#)?)(#+)(\s*)$/.exec(e);if(i){const[,s,{length:o},a,{length:u},c,l,{length:h}]=i,p=s.length,d=l.length,f=!o,m=!u||c,g=c?c+" ":"";if(f||m){const i=f?[1,p+1]:[e.length-h-d,d+1];r(t,n+1,e.trim(),f,m,i,{editColumn:1,deleteCount:e.length,insertText:`${s} ${a} ${g}${l}`})}}}}))}}},(e,t,n)=>{"use strict";const{addErrorContext:r,filterTokens:i,headingStyleFor:s}=n(111);e.exports={names:["MD021","no-multiple-space-closed-atx"],description:"Multiple spaces inside hashes on closed atx style heading",tags:["headings","headers","atx_closed","spaces"],function:function(e,t){i(e,"heading_open",(e=>{if("atx_closed"===s(e)){const{line:n,lineNumber:i}=e,s=/^(#+)(\s+)([^#]+?)(\s+)(#+)(\s*)$/.exec(n);if(s){const[,e,{length:o},a,{length:u},c,{length:l}]=s,h=o>1,p=u>1;if(h||p){const s=n.length,d=e.length,f=c.length,m=h?[1,d+o+1]:[s-l-f-u,u+f+1];r(t,i,n.trim(),h,p,m,{editColumn:1,deleteCount:s,insertText:`${e} ${a} ${c}`})}}}}))}}},(e,t,n)=>{"use strict";const{addErrorDetailIf:r,filterTokens:i,isBlankLine:s}=n(111);e.exports={names:["MD022","blanks-around-headings","blanks-around-headers"],description:"Headings should be surrounded by blank lines",tags:["headings","headers","blank_lines"],function:function(e,t){let n=e.config.lines_above;n=Number(void 0===n?1:n);let o=e.config.lines_below;o=Number(void 0===o?1:o);const{lines:a}=e;i(e,"heading_open",(e=>{const[i,u]=e.map;let c=0;for(let e=0;e<n;e++)s(a[i-e-1])&&c++;r(t,i+1,n,c,"Above",a[i].trim(),null,{insertText:"".padEnd(n-c,"\n")});let l=0;for(let e=0;e<o;e++)s(a[u+e])&&l++;r(t,i+1,o,l,"Below",a[i].trim(),null,{lineNumber:u+1,insertText:"".padEnd(o-l,"\n")})}))}}},(e,t,n)=>{"use strict";const{addErrorContext:r,filterTokens:i}=n(111),s=/^((?:\s+)|(?:[>\s]+\s\s))[^>\s]/;e.exports={names:["MD023","heading-start-left","header-start-left"],description:"Headings must start at the beginning of the line",tags:["headings","headers","spaces"],function:function(e,t){i(e,"heading_open",(function(e){const{lineNumber:n,line:i}=e,o=i.match(s);if(o){const[e,s]=o;let a=s.length;const u=s.trimRight().length;u&&(a-=u-1),r(t,n,i,null,null,[1,e.length],{editColumn:u+1,deleteCount:a})}}))}}},(e,t,n)=>{"use strict";const{addErrorContext:r,forEachHeading:i}=n(111);e.exports={names:["MD024","no-duplicate-heading","no-duplicate-header"],description:"Multiple headings with the same content",tags:["headings","headers"],function:function(e,t){const n=!!e.config.siblings_only||!!e.config.allow_different_nesting||!1,s=[null,[]];let o=1,a=s[o];i(e,((e,i)=>{if(n){const t=e.tag.slice(1);for(;o<t;)o++,s[o]=[];for(;o>t;)s[o]=[],o--;a=s[t]}a.includes(i)?r(t,e.lineNumber,e.line.trim()):a.push(i)}))}}},(e,t,n)=>{"use strict";const{addErrorContext:r,filterTokens:i,frontMatterHasTitle:s}=n(111);e.exports={names:["MD025","single-title","single-h1"],description:"Multiple top level headings in the same document",tags:["headings","headers"],function:function(e,t){const n="h"+Number(e.config.level||1),o=s(e.frontMatterLines,e.config.front_matter_title);let a=!1;i(e,"heading_open",(function(e){e.tag===n&&(a||o?r(t,e.lineNumber,e.line.trim()):1===e.lineNumber&&(a=!0))}))}}},(e,t,n)=>{"use strict";const{addError:r,allPunctuationNoQuestion:i,escapeForRegExp:s,forEachHeading:o}=n(111),a=/&#?[0-9a-zA-Z]+;$/;e.exports={names:["MD026","no-trailing-punctuation"],description:"Trailing punctuation in heading",tags:["headings","headers"],function:function(e,t){let n=e.config.punctuation;n=String(void 0===n?i:n);const u=new RegExp("\\s*["+s(n)+"]+$");o(e,(e=>{const{line:n,lineNumber:i}=e,s=n.replace(/[\s#]*$/,""),o=u.exec(s);if(o&&!a.test(s)){const e=o[0],n=o.index+1,s=e.length;r(t,i,`Punctuation: '${e}'`,null,[n,s],{editColumn:n,deleteCount:s})}}))}}},(e,t,n)=>{"use strict";const{addErrorContext:r,newLineRe:i}=n(111),s=/^((?:\s*>)+)(\s{2,})\S/;e.exports={names:["MD027","no-multiple-space-blockquote"],description:"Multiple spaces after blockquote symbol",tags:["blockquote","whitespace","indentation"],function:function(e,t){let n=0,o=0;e.tokens.forEach((a=>{const{content:u,lineNumber:c,type:l}=a;if("blockquote_open"===l)n++;else if("blockquote_close"===l)n--;else if("list_item_open"===l)o++;else if("list_item_close"===l)o--;else if("inline"===l&&n){const n=u.split(i).length;for(let i=0;i<n;i++){const n=e.lines[c+i-1],a=n.match(s);if(a){const[e,{length:s},{length:u}]=a;o&&">"!==e[e.length-1]||r(t,c+i,n,null,null,[1,e.length],{editColumn:s+1,deleteCount:u-1})}}}}))}}},(e,t,n)=>{"use strict";const{addError:r}=n(111);e.exports={names:["MD028","no-blanks-blockquote"],description:"Blank line inside blockquote",tags:["blockquote","whitespace"],function:function(e,t){let n={},i=null;e.tokens.forEach((function(e){if("blockquote_open"===e.type&&"blockquote_close"===n.type)for(let n=i;n<e.lineNumber;n++)r(t,n);n=e,"blockquote_open"===e.type&&(i=e.map[1]+1)}))}}},(e,t,n)=>{"use strict";const{addErrorDetailIf:r,listItemMarkerRe:i,orderedListItemMarkerRe:s,rangeFromRegExp:o}=n(111),{flattenedLists:a}=n(116),u={one:"1/1/1",ordered:"1/2/3",zero:"0/0/0"};e.exports={names:["MD029","ol-prefix"],description:"Ordered list item prefix",tags:["ol"],function:function(e,t){const n=String(e.config.style||"one_or_ordered");a().filter((e=>!e.unordered)).forEach((e=>{const{items:a}=e;let c=1,l=!1;if(a.length>=2){const e=s.exec(a[0].line),t=s.exec(a[1].line);if(e&&t){const[,n]=e,[,r]=t;"1"===r&&"0"!==n||(l=!0,"0"===n&&(c=0))}}let h=n;"one_or_ordered"===h&&(h=l?"ordered":"one"),"zero"===h?c=0:"one"===h&&(c=1),a.forEach((e=>{const n=s.exec(e.line);n&&(r(t,e.lineNumber,String(c),n[1],"Style: "+u[h],null,o(e.line,i)),"ordered"===h&&c++)}))}))}}},(e,t,n)=>{"use strict";const{addErrorDetailIf:r}=n(111),{flattenedLists:i}=n(116);e.exports={names:["MD030","list-marker-space"],description:"Spaces after list markers",tags:["ol","ul","whitespace"],function:function(e,t){const n=Number(e.config.ul_single||1),s=Number(e.config.ol_single||1),o=Number(e.config.ul_multi||1),a=Number(e.config.ol_multi||1);i().forEach((e=>{const i=e.lastLineIndex-e.open.map[0]===e.items.length,u=e.unordered?i?n:o:i?s:a;e.items.forEach((e=>{const{line:n,lineNumber:i}=e,s=/^[\s>]*\S+(\s*)/.exec(n),[{length:o},{length:a}]=s;if(o<n.length){let e=null;u!==a&&(e={editColumn:o-a+1,deleteCount:a,insertText:"".padEnd(u)}),r(t,i,u,a,null,null,[1,o],e)}}))}))}}},(e,t,n)=>{"use strict";const{addErrorContext:r,forEachLine:i,isBlankLine:s}=n(111),{lineMetadata:o}=n(116),a=/^(.*?)\s*[`~]/;e.exports={names:["MD031","blanks-around-fences"],description:"Fenced code blocks should be surrounded by blank lines",tags:["code","blank_lines"],function:function(e,t){const n=e.config.list_items,u=void 0===n||!!n,{lines:c}=e;i(o(),((e,n,i,o,l,h)=>{const p=o>0,d=o<0;if((u||!h)&&(p&&!s(c[n-1])||d&&!s(c[n+1]))){const[,i]=e.match(a)||[],s=void 0===i?null:{lineNumber:n+(p?1:2),insertText:i+"\n"};r(t,n+1,c[n].trim(),null,null,null,s)}}))}}},(e,t,n)=>{"use strict";const{addErrorContext:r,isBlankLine:i}=n(111),{flattenedLists:s}=n(116),o=/^[>\s]*/;e.exports={names:["MD032","blanks-around-lists"],description:"Lists should be surrounded by blank lines",tags:["bullet","ul","ol","blank_lines"],function:function(e,t){const{lines:n}=e;s().filter((e=>!e.nesting)).forEach((e=>{const s=e.open.map[0];if(!i(n[s-1])){const e=n[s],i=e.match(o)[0].trimRight();r(t,s+1,e.trim(),null,null,null,{insertText:i+"\n"})}const a=e.lastLineIndex-1;if(!i(n[a+1])){const e=n[a],i=e.match(o)[0].trimRight();r(t,a+1,e.trim(),null,null,null,{lineNumber:a+2,insertText:i+"\n"})}}))}}},(e,t,n)=>{"use strict";const{addError:r,forEachLine:i,unescapeMarkdown:s}=n(111),{lineMetadata:o}=n(116),a=/<(([A-Za-z][A-Za-z0-9-]*)(?:\s[^>]*)?)\/?>/g,u=/]\(\s*$/,c=/^[^`]*(`+[^`]+`+[^`]+)*`+[^`]*$/,l=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;e.exports={names:["MD033","no-inline-html"],description:"Inline HTML",tags:["html"],function:function(e,t){let n=e.config.allowed_elements;n=Array.isArray(n)?n:[],n=n.map((e=>e.toLowerCase())),i(o(),((e,i,o)=>{let h=null;for(;!o&&null!==(h=a.exec(e));){const[o,a,p]=h;if(!n.includes(p.toLowerCase())&&!o.endsWith("\\>")&&!l.test(a)){const n=e.substring(0,h.index);if(!u.test(n)&&!c.test(n)){const e=s(n+"<","_");!e.endsWith("_")&&(e+"`").match(/`/g).length%2&&r(t,i+1,"Element: "+p,null,[h.index+1,o.length])}}}}))}}},(e,t,n)=>{"use strict";const{addErrorContext:r,bareUrlRe:i,filterTokens:s}=n(111);e.exports={names:["MD034","no-bare-urls"],description:"Bare URL used",tags:["links","url"],function:function(e,t){s(e,"inline",(e=>{let n=!1;e.children.forEach((e=>{const{content:s,line:o,lineNumber:a,type:u}=e;let c=null;if("link_open"===u)n=!0;else if("link_close"===u)n=!1;else if("text"===u&&!n)for(;null!==(c=i.exec(s));){const[e]=c,n=c.index,i=e.length,u=s[n-1],l=s[n+i];if(!("["===u&&"]"===l||'"'===u&&'"'===l||"'"===u&&"'"===l)){const u=o.indexOf(s),c=-1===u?null:[u+n+1,i],l=c?{editColumn:c[0],deleteCount:c[1],insertText:`<${e}>`}:null;r(t,a,e,null,null,c,l)}}}))}))}}},(e,t,n)=>{"use strict";const{addErrorDetailIf:r,filterTokens:i}=n(111);e.exports={names:["MD035","hr-style"],description:"Horizontal rule style",tags:["hr"],function:function(e,t){let n=String(e.config.style||"consistent");i(e,"hr",(function(e){const i=e.line.trim();"consistent"===n&&(n=i),r(t,e.lineNumber,n,i)}))}}},(e,t,n)=>{"use strict";const{addErrorContext:r,allPunctuation:i}=n(111);e.exports={names:["MD036","no-emphasis-as-heading","no-emphasis-as-header"],description:"Emphasis used instead of a heading",tags:["headings","headers","emphasis"],function:function(e,t){let n=e.config.punctuation;n=String(void 0===n?i:n);const s=new RegExp("["+n+"]$");let o=function e(n){return"paragraph_open"===n.type?function(n){const i=n.children.filter((function(e){return"text"!==e.type||""!==e.content}));return 3!==i.length||"strong_open"!==i[0].type&&"em_open"!==i[0].type||"text"!==i[1].type||s.test(i[1].content)||r(t,n.lineNumber,i[1].content),e}:"blockquote_open"===n.type?function t(n){return"blockquote_close"!==n.type?t:e}:"list_item_open"===n.type?function t(n){return"list_item_close"!==n.type?t:e}:e};e.tokens.forEach((function(e){o=o(e)}))}}},(e,t,n)=>{"use strict";const{addErrorContext:r,emphasisMarkersInContent:i,forEachLine:s,isBlankLine:o}=n(111),{lineMetadata:a}=n(116),u=/(^|[^\\]|\\\\)(?:(\*\*?\*?)|(__?_?))/g,c=/^([\s>]*)\*(\s+)/,l=/^\s+/,h=/\s+$/;e.exports={names:["MD037","no-space-in-emphasis"],description:"Spaces inside emphasis markers",tags:["whitespace","emphasis"],function:function(e,t){let n,p,d,f,m=null;function g(){p=-1,f=0,d="",n=0,m=null}function x(e,n,r,i,s){let o=e.substring(p,s);f||(o=o.trimLeft()),i||(o=o.trimRight());const a=l.test(o),u=h.test(o);if(a||u){const c=p-f,l=s+r,h=e.substring(c,l),d=c+1,m=l-c,g=e.substring(c,p),x=i?i[2]||i[3]:"",y=`${g}${o.trim()}${x}`;return[t,n+1,h,a,u,[d,m],{editColumn:d,deleteCount:m,insertText:y}]}return null}const y=i(e);g(),s(a(),((e,t,i,s,a,l,h)=>{const D=1===l;if((i||a||h||D||o(e))&&g(),i||h)return;D&&(e=e.replace(c,"$1 $2"));let C=null;for(;C=u.exec(e);){const i=y[t]||[],s=C.index+C[1].length;if(i.includes(s))continue;const o=C[0].length-C[1].length,a=(C[2]||C[3])[0];if(-1===p)p=s+o,f=o,d=a,n=o;else if(a===d){if(o===n){m&&(r(...m),m=null);const i=x(e,t,n,C,s);i&&r(...i),g()}else 3===o?n=o-n:3===n?n-=o:n+=o;u.lastIndex>1&&u.lastIndex--}else u.lastIndex>1&&u.lastIndex--}-1!==p&&(m=m||x(e,t,0,null,e.length),p=0,f=0)}))}}},(e,t,n)=>{"use strict";const{addErrorContext:r,filterTokens:i,forEachInlineCodeSpan:s,newLineRe:o}=n(111),a=/^\s([^`]|$)/,u=/[^`]\s$/,c=/^\s(?:\S.*\S|\S)\s$/;e.exports={names:["MD038","no-space-in-code"],description:"Spaces inside code span elements",tags:["whitespace","code"],function:function(e,t){i(e,"inline",(n=>{if(n.children.some((e=>"code_inline"===e.type))){const i=e.lines.slice(n.map[0],n.map[1]);s(i.join("\n"),((e,s,l,h)=>{let p=l-h,d=e.length+2*h,f=0,m=l,g=e.length;const x=e.split(o),y=a.test(e),D=!y&&u.test(e);D&&x.length>1&&(p=0,f=x.length-1,m=0);const C=c.test(e);if((y||D)&&!C){const e=x[f];x.length>1&&(d=e.length+h,g=e.length);const o=i[s+f].substring(p,p+d),a=e.trim(),u=(a.startsWith("`")?" ":"")+a+(a.endsWith("`")?" ":"");r(t,n.lineNumber+s+f,o,y,D,[p+1,d],{editColumn:m+1,deleteCount:g,insertText:u})}}))}}))}}},(e,t,n)=>{"use strict";const{addErrorContext:r,filterTokens:i}=n(111),s=/\[(?:\s+(?:[^\]]*?)\s*|(?:[^\]]*?)\s+)](?=\(\S*\))/;e.exports={names:["MD039","no-space-in-links"],description:"Spaces inside link text",tags:["whitespace","links"],function:function(e,t){i(e,"inline",(n=>{const{children:i}=n;let{lineNumber:o}=n,a=!1,u="",c=0;i.forEach((n=>{const{content:i,type:l}=n;if("link_open"===l)a=!0,u="";else if("link_close"===l){a=!1;const n=u.trimLeft().length!==u.length,i=u.trimRight().length!==u.length;if(n||i){let a=null,l=null;const h=e.lines[o-1].slice(c).match(s);if(h){const e=h.index+c+1,t=h[0].length;a=[e,t],l={editColumn:e+1,deleteCount:t-2,insertText:u.trim()},c=e+t-1}r(t,o,`[${u}]`,n,i,a,l)}}else"softbreak"===l||"hardbreak"===l?(o++,c=0):a&&(u+=i)}))}))}}},(e,t,n)=>{"use strict";const{addErrorContext:r,filterTokens:i}=n(111);e.exports={names:["MD040","fenced-code-language"],description:"Fenced code blocks should have a language specified",tags:["code","language"],function:function(e,t){i(e,"fence",(function(e){e.info.trim()||r(t,e.lineNumber,e.line)}))}}},(e,t,n)=>{"use strict";const{addErrorContext:r,frontMatterHasTitle:i}=n(111);e.exports={names:["MD041","first-line-heading","first-line-h1"],description:"First line in file should be a top level heading",tags:["headings","headers"],function:function(e,t){const n="h"+Number(e.config.level||1);i(e.frontMatterLines,e.config.front_matter_title)||e.tokens.every((e=>"html_block"===e.type||("heading_open"===e.type&&e.tag===n||r(t,e.lineNumber,e.line),!1)))}}},(e,t,n)=>{"use strict";const{addErrorContext:r,filterTokens:i,rangeFromRegExp:s}=n(111),o=/\[[^\]]*](?:\((?:#?|(?:<>))\))/;e.exports={names:["MD042","no-empty-links"],description:"No empty links",tags:["links"],function:function(e,t){i(e,"inline",(function(e){let n=!1,i="",a=!1;e.children.forEach((function(e){"link_open"===e.type?(n=!0,i="",e.attrs.forEach((function(e){"href"!==e[0]||e[1]&&"#"!==e[1]||(a=!0)}))):"link_close"===e.type?(n=!1,a&&(r(t,e.lineNumber,"["+i+"]()",null,null,s(e.line,o)),a=!1)):n&&(i+=e.content)}))}))}}},(e,t,n)=>{"use strict";const{addErrorContext:r,addErrorDetailIf:i,forEachHeading:s}=n(111);e.exports={names:["MD043","required-headings","required-headers"],description:"Required heading structure",tags:["headings","headers"],function:function(e,t){const n=e.config.headings||e.config.headers;if(Array.isArray(n)){const o={};[1,2,3,4,5,6].forEach((e=>{o["h"+e]="######".substr(-e)}));let a=0,u=!1,c=!1,l=!1;const h=()=>n[a++]||"[None]";s(e,((e,n)=>{if(!c){l=!0;const r=o[e.tag]+" "+n;let s=h();"*"===s?(u=!0,s=h()):"+"===s?u=!0:s.toLowerCase()===r.toLowerCase()?u=!1:u?a--:(i(t,e.lineNumber,s,r),c=!0)}})),!c&&a<n.length&&(l||!n.every((e=>"*"===e)))&&r(t,e.lines.length,n[a])}}}},(e,t,n)=>{"use strict";const{addErrorDetailIf:r,bareUrlRe:i,escapeForRegExp:s,filterTokens:o,forEachInlineChild:a,newLineRe:u}=n(111),c=/^\W/,l=/\W$/;e.exports={names:["MD044","proper-names"],description:"Proper names should have the correct capitalization",tags:["spelling"],function:function(e,t){let n=e.config.names;n=Array.isArray(n)?n:[];const h=e.config.code_blocks,p=void 0===h||!!h,d=new Set;o(e,"inline",(e=>{let t=!1;e.children.forEach((e=>{const{info:n,type:r}=e;"link_open"===r&&"auto"===n?t=!0:"link_close"===r?t=!1:"text"===r&&t&&d.add(e)}))})),n.forEach((h=>{const f=s(h),m=c.test(h)?"":"\\S*\\b",g=l.test(h)?"":"\\b\\S*",x=new RegExp(`(${m})(${f})(${g})`,"gi");function y(s){if(!d.has(s)){const o="fence"===s.type?1:0;s.content.split(u).forEach(((a,u)=>{let c=null;for(;null!==(c=x.exec(a));){const[a,l,p,d]=c;if(-1===a.search(i)){const i=a.replace(new RegExp(`^\\W{0,${l.length}}`),"").replace(new RegExp(`\\W{0,${d.length}}$`),"");if(!n.includes(i)){const n=s.lineNumber+u+o,a=e.lines[n-1],c=i.length,l=a.indexOf(i);r(t,n,h,p,null,null,-1===l?null:[l+1,c],-1===l?null:{editColumn:l+1,deleteCount:c,insertText:h})}}}}))}}a(e,"text",y),p&&(a(e,"code_inline",y),o(e,"code_block",y),o(e,"fence",y))}))}}},(e,t,n)=>{"use strict";const{addError:r,forEachInlineChild:i}=n(111);e.exports={names:["MD045","no-alt-text"],description:"Images should have alternate text (alt text)",tags:["accessibility","images"],function:function(e,t){i(e,"image",(function(e){""===e.content&&r(t,e.lineNumber)}))}}},(e,t,n)=>{"use strict";const{addErrorDetailIf:r}=n(111),i={fence:"fenced",code_block:"indented"};e.exports={names:["MD046","code-block-style"],description:"Code block style",tags:["code"],function:function(e,t){let n=String(e.config.style||"consistent");e.tokens.filter((e=>"code_block"===e.type||"fence"===e.type)).forEach((e=>{const{lineNumber:s,type:o}=e;"consistent"===n&&(n=i[o]),r(t,s,n,i[o])}))}}},(e,t,n)=>{"use strict";const{addError:r,isBlankLine:i}=n(111);e.exports={names:["MD047","single-trailing-newline"],description:"Files should end with a single newline character",tags:["blank_lines"],function:function(e,t){const n=e.lines.length,s=e.lines[n-1];i(s)||r(t,n,null,null,[s.length,1],{insertText:"\n",editColumn:s.length+1})}}},(e,t,n)=>{"use strict";const{addErrorDetailIf:r,fencedCodeBlockStyleFor:i}=n(111);e.exports={names:["MD048","code-fence-style"],description:"Code fence style",tags:["code"],function:function(e,t){let n=String(e.config.style||"consistent");e.tokens.filter((e=>"fence"===e.type)).forEach((e=>{const{lineNumber:s,markup:o}=e;"consistent"===n&&(n=i(o)),r(t,s,n,i(o))}))}}},e=>{function t(e){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}t.keys=()=>[],t.resolve=t,t.id=157,e.exports=t},(e,t,n)=>{"use strict";const r=n(112),i=/\r\n?|\n/g;e.exports.newLineRe=i,e.exports.frontMatterRe=/((^---\s*$[^]*?^---\s*$)|(^\+\+\+\s*$[^]*?^(\+\+\+|\.\.\.)\s*$)|(^\{\s*$[^]*?^\}\s*$))(\r\n|\r|\n|$)/m;const s=/<!--\s*markdownlint-(?:(?:(disable|enable|capture|restore|disable-file|enable-file|disable-next-line)((?:\s+[a-z0-9_-]+)*))|(?:(configure-file)\s+([\s\S]*?)))\s*-->/gi;e.exports.inlineCommentRe=s,e.exports.bareUrlRe=/(?:http|ftp)s?:\/\/[^\s\]"']*(?:\/|[^\s\]"'\W])/gi,e.exports.listItemMarkerRe=/^([\s>]*)(?:[*+-]|\d+[.)])\s+/,e.exports.orderedListItemMarkerRe=/^[\s>]*0*(\d+)[.)]/;const o=/[_*]/g,a=/\[(?:[^[\]]|\[[^\]]*\])*\](?:\(\S*\))?/g;e.exports.utf8Encoding="utf8";const u=".,;:!?。,;:!?";e.exports.allPunctuation=u,e.exports.allPunctuationNoQuestion=u.replace(/[??]/gu,""),e.exports.isNumber=function(e){return"number"==typeof e},e.exports.isString=function(e){return"string"==typeof e},e.exports.isEmptyString=function(e){return 0===e.length},e.exports.isObject=function(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)};const c=/>|(?:<!--.*?-->)/g;e.exports.isBlankLine=function(e){return!e||!e.trim()||!e.replace(c,"").trim()},e.exports.numericSortAscending=function(e,t){return e-t},e.exports.includesSorted=function(e,t){let n=0,r=e.length-1;for(;n<=r;){const i=n+r>>1;if(e[i]<t)n=i+1;else{if(!(e[i]>t))return!0;r=i-1}}return!1};const l="\x3c!--",h="--\x3e";e.exports.clearHtmlCommentText=function(e){let t=0;for(;-1!==(t=e.indexOf(l,t));){const n=e.indexOf(h,t);if(-1===n)break;const r=e.slice(t+l.length,n);if(r.length>0&&">"!==r[0]&&"-"!==r[r.length-1]&&!r.includes("--")&&-1===e.slice(t,n+h.length).search(s)){const i=r.replace(/[^\r\n]/g," ").replace(/ ([\r\n])/g,"\\$1");e=e.slice(0,t+l.length)+i+e.slice(n)}t=n+h.length}return e},e.exports.escapeForRegExp=function(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")};const p=/\\./g;function d(e){const t=e.line.replace(/^[\s>]*(> |>)/,"");return t.length-t.trimLeft().length}function f(e,t,n){e.tokens.forEach((function(e){e.type===t&&n(e)}))}function m(e,t){let n=0,r=0,i=0;for(;i<e.length;){let s=-1,o=-1,a=-1,u=0,c=0,l="normal";for(;i<=e.length;i++){const h=e[i];"["===h&&"normal"===l?l="linkTextOpen":"]"===h&&"linkTextOpen"===l?l="linkTextClosed":"("===h&&"linkTextClosed"===l?l="linkDestinationOpen":("("===h&&"linkDestinationOpen"===l||")"===h&&"linkDestinationOpen"===l||"linkTextClosed"===l)&&(l="normal"),"`"===h&&"linkDestinationOpen"!==l?(c++,-1!==s&&-1!==a||(s=i+1)):(s>=0&&a>=0&&u===c?(t(e.substring(s,i-c),o,a,u),s=-1,a=-1):s>=0&&-1===a&&(u=c,o=n,a=r),c=0),"\n"===h?(n++,r=0):"\\"!==h||-1!==s&&-1!==a||"\n"===e[i+1]?r++:(i++,r+=2)}s>=0&&(i=s,n=o,r=a)}}function g(e,t,n,r,i,s){e({lineNumber:t,detail:n,context:r,range:i,fixInfo:s})}function x(e){let t=0,n=0,s=0;(e.match(i)||[]).forEach((e=>{switch(e){case"\r":t++;break;case"\n":n++;break;case"\r\n":s++}}));let o=null;return o=t||n||s?n>=s&&n>=t?"\n":s>=t?"\r\n":"\r":r.EOL,o}function y(e,t){return{lineNumber:e.lineNumber||t,editColumn:e.editColumn||1,deleteCount:e.deleteCount||0,insertText:e.insertText||""}}function D(e,t,n){const{editColumn:r,deleteCount:i,insertText:s}=y(t),o=r-1;return-1===i?null:e.slice(0,o)+s.replace(/\n/g,n||"\n")+e.slice(o+i)}e.exports.unescapeMarkdown=function(e,t){return e.replace(p,(e=>{const n=e[1];return"!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~".includes(n)?t||n:e}))},e.exports.fencedCodeBlockStyleFor=function(e){switch(e[0]){case"~":return"tilde";default:return"backtick"}},e.exports.indentFor=d,e.exports.headingStyleFor=function(e){return e.map[1]-e.map[0]==1?/[^\\]#\s*$/.test(e.line)?"atx_closed":"atx":"setext"},e.exports.unorderedListStyleFor=function(e){switch(e.markup){case"-":return"dash";case"+":return"plus";default:return"asterisk"}},e.exports.filterTokens=f,e.exports.getLineMetadata=function(e){const t=e.lines.map((function(e,t){return[e,t,!1,0,!1,!1]}));return f(e,"fence",(function(e){t[e.map[0]][3]=1,t[e.map[1]-1][3]=-1;for(let n=e.map[0]+1;n<e.map[1]-1;n++)t[n][2]=!0})),f(e,"code_block",(function(e){for(let n=e.map[0];n<e.map[1];n++)t[n][2]=!0})),f(e,"table_open",(function(e){for(let n=e.map[0];n<e.map[1];n++)t[n][4]=!0})),f(e,"list_item_open",(function(e){let n=1;for(let r=e.map[0];r<e.map[1];r++)t[r][5]=n,n++})),f(e,"hr",(function(e){t[e.map[0]][6]=!0})),t},e.exports.forEachLine=function(e,t){e.forEach((function(e){t(...e)}))},e.exports.flattenLists=function(e){const t=[],n=[];let r=null,i=0;const s=[];let o={map:[0,1]};return e.tokens.forEach((function(e){"math_block"===e.type&&"math"===e.tag&&e.map[1]&&e.map[1]++,"bullet_list_open"===e.type||"ordered_list_open"===e.type?(n.push(r),r={unordered:"bullet_list_open"===e.type,parentsUnordered:!r||r.unordered&&r.parentsUnordered,open:e,indent:d(e),parentIndent:r&&r.indent||0,items:[],nesting:i,lastLineIndex:-1,insert:t.length},i++):"bullet_list_close"===e.type||"ordered_list_close"===e.type?(r.lastLineIndex=o.map[1],t.splice(r.insert,0,r),delete r.insert,r=n.pop(),i--):"list_item_open"===e.type?r.items.push(e):"blockquote_open"===e.type?(s.push(i),i=0):"blockquote_close"===e.type?i=s.pop():e.map&&(o=e)})),t},e.exports.forEachInlineChild=function(e,t,n){f(e,"inline",(function(e){e.children.forEach((function(r){r.type===t&&n(r,e)}))}))},e.exports.forEachHeading=function(e,t){let n=null;e.tokens.forEach((function(e){"heading_open"===e.type?n=e:"heading_close"===e.type?n=null:"inline"===e.type&&n&&t(n,e.content)}))},e.exports.forEachInlineCodeSpan=m,e.exports.addError=g,e.exports.addErrorDetailIf=function(e,t,n,r,i,s,o,a){n!==r&&g(e,t,"Expected: "+n+"; Actual: "+r+(i?"; "+i:""),s,o,a)},e.exports.addErrorContext=function(e,t,n,r,i,s,o){n.length<=30||(n=r&&i?n.substr(0,15)+"..."+n.substr(-15):i?"..."+n.substr(-30):n.substr(0,30)+"..."),g(e,t,null,n,s,o)},e.exports.rangeFromRegExp=function(e,t){let n=null;const r=e.match(t);return r&&(n=[r.index+1,r[0].length]),n},e.exports.frontMatterHasTitle=function(e,t){const n=void 0!==t&&!t,r=new RegExp(String(t||'^\\s*"?title"?\\s*[:=]'),"i");return!n&&e.some((e=>r.test(e)))},e.exports.emphasisMarkersInContent=function(e){const{lines:t}=e,n=new Array(t.length);return f(e,"inline",(e=>{const{children:r,lineNumber:s,map:a}=e;r.some((e=>"code_inline"===e.type))&&m(t.slice(a[0],a[1]).join("\n"),((e,t,r,a)=>{e.split(i).forEach(((e,i)=>{let u=null;for(;u=o.exec(e);){const e=s-1+t+i,o=n[e]||[],c=i?0:r-1+a;o.push(c+u.index),n[e]=o}}))}))})),t.forEach(((e,t)=>{let r=null;for(;r=a.exec(e);){let e=null;for(;e=o.exec(r[0]);){const i=n[t]||[];i.push(r.index+e.index),n[t]=i}}})),n},e.exports.getPreferredLineEnding=x,e.exports.applyFix=D,e.exports.applyFixes=function(e,t){const n=x(e),r=e.split(i);let s=t.filter((e=>e.fixInfo)).map((e=>y(e.fixInfo,e.lineNumber)));s.sort(((e,t)=>{const n=-1===e.deleteCount,r=-1===t.deleteCount;return t.lineNumber-e.lineNumber||(n?1:r?-1:0)||t.editColumn-e.editColumn||t.insertText.length-e.insertText.length}));let o={};s=s.filter((e=>{const t=e.lineNumber!==o.lineNumber||e.editColumn!==o.editColumn||e.deleteCount!==o.deleteCount||e.insertText!==o.insertText;return o=e,t})),o={},s.forEach((e=>{e.lineNumber===o.lineNumber&&e.editColumn===o.editColumn&&!e.insertText&&e.deleteCount>0&&o.insertText&&!o.deleteCount&&(e.insertText=o.insertText,o.lineNumber=0),o=e})),s=s.filter((e=>e.lineNumber));let a=-1,u=-1;return s.forEach((e=>{const{lineNumber:t,editColumn:i,deleteCount:s}=e,o=t-1,c=i-1;(o!==a||c+s<u||-1===s)&&(r[o]=D(r[o],e,n)),a=o,u=c})),r.filter((e=>null!==e)).join(n)}},(e,t,n)=>{var r=n(160),i=n(39).join,s=n(3),o="/etc",a="win32"===process.platform,u=a?process.env.USERPROFILE:process.env.HOME;e.exports=function(e,t,c,l){if("string"!=typeof e)throw new Error("rc(name): name *must* be string");c||(c=n(163)(process.argv.slice(2))),t=("string"==typeof t?r.json(t):t)||{},l=l||r.parse;var h=r.env(e+"_"),p=[t],d=[];function f(e){if(!(d.indexOf(e)>=0)){var t=r.file(e);t&&(p.push(l(t)),d.push(e))}}return a||[i(o,e,"config"),i(o,e+"rc")].forEach(f),u&&[i(u,".config",e,"config"),i(u,".config",e),i(u,"."+e,"config"),i(u,"."+e+"rc")].forEach(f),f(r.find("."+e+"rc")),h.config&&f(h.config),c.config&&f(c.config),s.apply(null,p.concat([h,c,d.length?{configs:d,config:d[d.length-1]}:void 0]))}},(e,t,n)=>{"use strict";var r=n(4),i=n(161),s=n(39),o=n(162),a=t.parse=function(e){return/^\s*{/.test(e)?JSON.parse(o(e)):i.parse(e)},u=t.file=function(){var e=[].slice.call(arguments).filter((function(e){return null!=e}));for(var t in e)if("string"!=typeof e[t])return;var n=s.join.apply(null,e);try{return r.readFileSync(n,"utf-8")}catch(e){return}};t.json=function(){var e=u.apply(null,arguments);return e?a(e):null},t.env=function(e,t){t=t||process.env;var n={},r=e.length;for(var i in t)if(0===i.toLowerCase().indexOf(e.toLowerCase())){for(var s,o=i.substring(r).split("__");(s=o.indexOf(""))>-1;)o.splice(s,1);var a=n;o.forEach((function(e,n){e&&"object"==typeof a&&(n===o.length-1&&(a[e]=t[i]),void 0===a[e]&&(a[e]={}),a=a[e])}))}return n},t.find=function(){var e=s.join.apply(null,[].slice.call(arguments));function t(e,n){var i=s.join(e,n);try{return r.statSync(i),i}catch(r){if(s.dirname(e)!==e)return t(s.dirname(e),n)}}return t(process.cwd(),e)}},(e,t)=>{t.parse=t.decode=function(e){var t={},n=t,i=null,s=/^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i;return e.split(/[\r\n]+/g).forEach((function(e,r,a){if(e&&!e.match(/^\s*[;#]/)){var u=e.match(s);if(u){if(void 0!==u[1])return i=o(u[1]),void(n=t[i]=t[i]||{});var c=o(u[2]),l=!u[3]||o(u[4]);switch(l){case"true":case"false":case"null":l=JSON.parse(l)}c.length>2&&"[]"===c.slice(-2)&&(c=c.substring(0,c.length-2),n[c]?Array.isArray(n[c])||(n[c]=[n[c]]):n[c]=[]),Array.isArray(n[c])?n[c].push(l):n[c]=l}}})),Object.keys(t).filter((function(e,n,i){if(!t[e]||"object"!=typeof t[e]||Array.isArray(t[e]))return!1;var s=r(e),o=t,a=s.pop(),u=a.replace(/\\\./g,".");return s.forEach((function(e,t,n){o[e]&&"object"==typeof o[e]||(o[e]={}),o=o[e]})),(o!==t||u!==a)&&(o[u]=t[e],!0)})).forEach((function(e,n,r){delete t[e]})),t},t.stringify=t.encode=function e(t,i){var o=[],a="";"string"==typeof i?i={section:i,whitespace:!1}:(i=i||{}).whitespace=!0===i.whitespace;var u=i.whitespace?" = ":"=";return Object.keys(t).forEach((function(e,r,i){var c=t[e];c&&Array.isArray(c)?c.forEach((function(t){a+=s(e+"[]")+u+s(t)+"\n"})):c&&"object"==typeof c?o.push(e):a+=s(e)+u+s(c)+n})),i.section&&a.length&&(a="["+s(i.section)+"]"+n+a),o.forEach((function(s,o,u){var c=r(s).join("\\."),l=(i.section?i.section+".":"")+c,h=e(t[s],{section:l,whitespace:i.whitespace});a.length&&h.length&&(a+=n),a+=h})),a},t.safe=s,t.unsafe=o;var n="undefined"!=typeof process&&"win32"===process.platform?"\r\n":"\n";function r(e){return e.replace(/\1/g,"\ 2LITERAL\\1LITERAL\ 2").replace(/\\\./g,"\ 1").split(/\./).map((function(e){return e.replace(/\1/g,"\\.").replace(/\2LITERAL\\1LITERAL\2/g,"\ 1")}))}function i(e){return'"'===e.charAt(0)&&'"'===e.slice(-1)||"'"===e.charAt(0)&&"'"===e.slice(-1)}function s(e){return"string"!=typeof e||e.match(/[=\r\n]/)||e.match(/^\[/)||e.length>1&&i(e)||e!==e.trim()?JSON.stringify(e):e.replace(/;/g,"\\;").replace(/#/g,"\\#")}function o(e,t){if(!i(e=(e||"").trim())){for(var n=!1,r="",s=0,o=e.length;s<o;s++){var a=e.charAt(s);if(n)-1!=="\\;#".indexOf(a)?r+=a:r+="\\"+a,n=!1;else{if(-1!==";#".indexOf(a))break;"\\"===a?n=!0:r+=a}}return n&&(r+="\\"),r.trim()}"'"===e.charAt(0)&&(e=e.substr(1,e.length-2));try{e=JSON.parse(e)}catch(e){}return e}},e=>{"use strict";function t(){return""}function n(e,t,n){return e.slice(t,n).replace(/\S/g," ")}e.exports=function(e,r){for(var i,s,o=!1,a=!1,u=0,c="",l=!1===(r=r||{}).whitespace?t:n,h=0;h<e.length;h++)if(i=e[h],s=e[h+1],a||'"'!==i||"\\"===e[h-1]&&"\\"!==e[h-2]||(o=!o),!o)if(a||i+s!=="//"){if(1===a&&i+s==="\r\n"){a=!1,c+=l(e,u,++h),u=h;continue}if(1===a&&"\n"===i)a=!1,c+=l(e,u,h),u=h;else{if(!a&&i+s==="/*"){c+=e.slice(u,h),u=h,a=2,h++;continue}if(2===a&&i+s==="*/"){a=!1,c+=l(e,u,1+ ++h),u=h+1;continue}}}else c+=e.slice(u,h),u=h,a=1,h++;return c+(a?l(e.substr(u)):e.substr(u))}},e=>{function t(e){return"number"==typeof e||!!/^0x[0-9a-f]+$/i.test(e)||/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(e)}e.exports=function(e,n){n||(n={});var r={bools:{},strings:{},unknownFn:null};"function"==typeof n.unknown&&(r.unknownFn=n.unknown),"boolean"==typeof n.boolean&&n.boolean?r.allBools=!0:[].concat(n.boolean).filter(Boolean).forEach((function(e){r.bools[e]=!0}));var i={};Object.keys(n.alias||{}).forEach((function(e){i[e]=[].concat(n.alias[e]),i[e].forEach((function(t){i[t]=[e].concat(i[e].filter((function(e){return t!==e})))}))})),[].concat(n.string).filter(Boolean).forEach((function(e){r.strings[e]=!0,i[e]&&(r.strings[i[e]]=!0)}));var s=n.default||{},o={_:[]};Object.keys(r.bools).forEach((function(e){u(e,void 0!==s[e]&&s[e])}));var a=[];function u(e,n,s){if(!s||!r.unknownFn||function(e,t){return r.allBools&&/^--[^=]+$/.test(t)||r.strings[e]||r.bools[e]||i[e]}(e,s)||!1!==r.unknownFn(s)){var a=!r.strings[e]&&t(n)?Number(n):n;c(o,e.split("."),a),(i[e]||[]).forEach((function(e){c(o,e.split("."),a)}))}}function c(e,t,n){for(var i=e,s=0;s<t.length-1;s++){if("__proto__"===(o=t[s]))return;void 0===i[o]&&(i[o]={}),i[o]!==Object.prototype&&i[o]!==Number.prototype&&i[o]!==String.prototype||(i[o]={}),i[o]===Array.prototype&&(i[o]=[]),i=i[o]}var o;"__proto__"!==(o=t[t.length-1])&&(i!==Object.prototype&&i!==Number.prototype&&i!==String.prototype||(i={}),i===Array.prototype&&(i=[]),void 0===i[o]||r.bools[o]||"boolean"==typeof i[o]?i[o]=n:Array.isArray(i[o])?i[o].push(n):i[o]=[i[o],n])}function l(e){return i[e].some((function(e){return r.bools[e]}))}-1!==e.indexOf("--")&&(a=e.slice(e.indexOf("--")+1),e=e.slice(0,e.indexOf("--")));for(var h=0;h<e.length;h++){var p=e[h];if(/^--.+=/.test(p)){var d=p.match(/^--([^=]+)=([\s\S]*)$/),f=d[1],m=d[2];r.bools[f]&&(m="false"!==m),u(f,m,p)}else if(/^--no-.+/.test(p))u(f=p.match(/^--no-(.+)/)[1],!1,p);else if(/^--.+/.test(p))f=p.match(/^--(.+)/)[1],void 0===(D=e[h+1])||/^-/.test(D)||r.bools[f]||r.allBools||i[f]&&l(f)?/^(true|false)$/.test(D)?(u(f,"true"===D,p),h++):u(f,!r.strings[f]||"",p):(u(f,D,p),h++);else if(/^-[^-]+/.test(p)){for(var g=p.slice(1,-1).split(""),x=!1,y=0;y<g.length;y++){var D;if("-"!==(D=p.slice(y+2))){if(/[A-Za-z]/.test(g[y])&&/=/.test(D)){u(g[y],D.split("=")[1],p),x=!0;break}if(/[A-Za-z]/.test(g[y])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(D)){u(g[y],D,p),x=!0;break}if(g[y+1]&&g[y+1].match(/\W/)){u(g[y],p.slice(y+2),p),x=!0;break}u(g[y],!r.strings[g[y]]||"",p)}else u(g[y],D,p)}f=p.slice(-1)[0],x||"-"===f||(!e[h+1]||/^(-|--)[^-]/.test(e[h+1])||r.bools[f]||i[f]&&l(f)?e[h+1]&&/^(true|false)$/.test(e[h+1])?(u(f,"true"===e[h+1],p),h++):u(f,!r.strings[f]||"",p):(u(f,e[h+1],p),h++))}else if(r.unknownFn&&!1===r.unknownFn(p)||o._.push(r.strings._||!t(p)?p:Number(p)),n.stopEarly){o._.push.apply(o._,e.slice(h+1));break}}return Object.keys(s).forEach((function(e){var t,n,r;t=o,n=e.split("."),r=t,n.slice(0,-1).forEach((function(e){r=r[e]||{}})),n[n.length-1]in r||(c(o,e.split("."),s[e]),(i[e]||[]).forEach((function(t){c(o,t.split("."),s[e])})))})),n["--"]?(o["--"]=new Array,a.forEach((function(e){o["--"].push(e)}))):a.forEach((function(e){o._.push(e)})),o}},(e,t,n)=>{"use strict";function r(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}Object.defineProperty(t,"__esModule",{value:!0});const i=n(165);t.ErrorCodes=i.ErrorCodes,t.ResponseError=i.ResponseError,t.CancellationToken=i.CancellationToken,t.CancellationTokenSource=i.CancellationTokenSource,t.Disposable=i.Disposable,t.Event=i.Event,t.Emitter=i.Emitter,t.Trace=i.Trace,t.TraceFormat=i.TraceFormat,t.SetTraceNotification=i.SetTraceNotification,t.LogTraceNotification=i.LogTraceNotification,t.RequestType=i.RequestType,t.RequestType0=i.RequestType0,t.NotificationType=i.NotificationType,t.NotificationType0=i.NotificationType0,t.MessageReader=i.MessageReader,t.MessageWriter=i.MessageWriter,t.ConnectionStrategy=i.ConnectionStrategy,t.StreamMessageReader=i.StreamMessageReader,t.StreamMessageWriter=i.StreamMessageWriter,t.IPCMessageReader=i.IPCMessageReader,t.IPCMessageWriter=i.IPCMessageWriter,t.createClientPipeTransport=i.createClientPipeTransport,t.createServerPipeTransport=i.createServerPipeTransport,t.generateRandomPipeName=i.generateRandomPipeName,t.createClientSocketTransport=i.createClientSocketTransport,t.createServerSocketTransport=i.createServerSocketTransport,t.ProgressType=i.ProgressType,r(n(177)),r(n(178));const s=n(190),o=n(191);!function(e){let t,n,r,i,a,u;!function(e){e.method=s.CallHierarchyPrepareRequest.method,e.type=s.CallHierarchyPrepareRequest.type}(t=e.CallHierarchyPrepareRequest||(e.CallHierarchyPrepareRequest={})),function(e){e.method=s.CallHierarchyIncomingCallsRequest.method,e.type=s.CallHierarchyIncomingCallsRequest.type}(n=e.CallHierarchyIncomingCallsRequest||(e.CallHierarchyIncomingCallsRequest={})),function(e){e.method=s.CallHierarchyOutgoingCallsRequest.method,e.type=s.CallHierarchyOutgoingCallsRequest.type}(r=e.CallHierarchyOutgoingCallsRequest||(e.CallHierarchyOutgoingCallsRequest={})),e.SemanticTokenTypes=o.SemanticTokenTypes,e.SemanticTokenModifiers=o.SemanticTokenModifiers,e.SemanticTokens=o.SemanticTokens,function(e){e.method=o.SemanticTokensRequest.method,e.type=o.SemanticTokensRequest.type}(i=e.SemanticTokensRequest||(e.SemanticTokensRequest={})),function(e){e.method=o.SemanticTokensEditsRequest.method,e.type=o.SemanticTokensEditsRequest.type}(a=e.SemanticTokensEditsRequest||(e.SemanticTokensEditsRequest={})),function(e){e.method=o.SemanticTokensRangeRequest.method,e.type=o.SemanticTokensRangeRequest.type}(u=e.SemanticTokensRangeRequest||(e.SemanticTokensRangeRequest={}))}(t.Proposed||(t.Proposed={})),t.createProtocolConnection=function(e,t,n,r){return i.createMessageConnection(e,t,n,r)}},(e,t,n)=>{"use strict";function r(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}Object.defineProperty(t,"__esModule",{value:!0});const i=n(166),s=n(167);t.RequestType=s.RequestType,t.RequestType0=s.RequestType0,t.RequestType1=s.RequestType1,t.RequestType2=s.RequestType2,t.RequestType3=s.RequestType3,t.RequestType4=s.RequestType4,t.RequestType5=s.RequestType5,t.RequestType6=s.RequestType6,t.RequestType7=s.RequestType7,t.RequestType8=s.RequestType8,t.RequestType9=s.RequestType9,t.ResponseError=s.ResponseError,t.ErrorCodes=s.ErrorCodes,t.NotificationType=s.NotificationType,t.NotificationType0=s.NotificationType0,t.NotificationType1=s.NotificationType1,t.NotificationType2=s.NotificationType2,t.NotificationType3=s.NotificationType3,t.NotificationType4=s.NotificationType4,t.NotificationType5=s.NotificationType5,t.NotificationType6=s.NotificationType6,t.NotificationType7=s.NotificationType7,t.NotificationType8=s.NotificationType8,t.NotificationType9=s.NotificationType9;const o=n(168);t.MessageReader=o.MessageReader,t.StreamMessageReader=o.StreamMessageReader,t.IPCMessageReader=o.IPCMessageReader,t.SocketMessageReader=o.SocketMessageReader;const a=n(170);t.MessageWriter=a.MessageWriter,t.StreamMessageWriter=a.StreamMessageWriter,t.IPCMessageWriter=a.IPCMessageWriter,t.SocketMessageWriter=a.SocketMessageWriter;const u=n(169);t.Disposable=u.Disposable,t.Event=u.Event,t.Emitter=u.Emitter;const c=n(171);t.CancellationTokenSource=c.CancellationTokenSource,t.CancellationToken=c.CancellationToken;const l=n(172);var h,p,d,f,m,g,x,y;r(n(173)),r(n(176)),function(e){e.type=new s.NotificationType("$/cancelRequest")}(h||(h={})),function(e){e.type=new s.NotificationType("$/progress")}(p||(p={})),t.ProgressType=class{constructor(){}},t.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}}),function(e){e[e.Off=0]="Off",e[e.Messages=1]="Messages",e[e.Verbose=2]="Verbose"}(d=t.Trace||(t.Trace={})),function(e){e.fromString=function(t){if(!i.string(t))return e.Off;switch(t=t.toLowerCase()){case"off":return e.Off;case"messages":return e.Messages;case"verbose":return e.Verbose;default:return e.Off}},e.toString=function(t){switch(t){case e.Off:return"off";case e.Messages:return"messages";case e.Verbose:return"verbose";default:return"off"}}}(d=t.Trace||(t.Trace={})),function(e){e.Text="text",e.JSON="json"}(t.TraceFormat||(t.TraceFormat={})),function(e){e.fromString=function(t){return"json"===(t=t.toLowerCase())?e.JSON:e.Text}}(f=t.TraceFormat||(t.TraceFormat={})),function(e){e.type=new s.NotificationType("$/setTraceNotification")}(m=t.SetTraceNotification||(t.SetTraceNotification={})),function(e){e.type=new s.NotificationType("$/logTraceNotification")}(g=t.LogTraceNotification||(t.LogTraceNotification={})),function(e){e[e.Closed=1]="Closed",e[e.Disposed=2]="Disposed",e[e.AlreadyListening=3]="AlreadyListening"}(x=t.ConnectionErrors||(t.ConnectionErrors={}));class D extends Error{constructor(e,t){super(t),this.code=e,Object.setPrototypeOf(this,D.prototype)}}function C(e,t,n,r){let o=0,a=0,C=0;const v="2.0";let E,k,b=void 0,A=Object.create(null),w=void 0,S=Object.create(null),_=new Map,F=new l.LinkedMap,T=Object.create(null),N=Object.create(null),M=d.Off,R=f.Text,I=y.New,B=new u.Emitter,L=new u.Emitter,q=new u.Emitter,P=new u.Emitter,O=new u.Emitter;function z(e){return"req-"+e.toString()}function j(e){}function U(){return I===y.Listening}function J(){return I===y.Closed}function X(){return I===y.Disposed}function $(){I!==y.New&&I!==y.Listening||(I=y.Closed,L.fire(void 0))}function H(){E||0===F.size||(E=setImmediate((()=>{E=void 0,function(){if(0===F.size)return;let e=F.shift();try{s.isRequestMessage(e)?function(e){if(X())return;function n(n,r,i){let o={jsonrpc:v,id:e.id};n instanceof s.ResponseError?o.error=n.toJson():o.result=void 0===n?null:n,K(o,r,i),t.write(o)}function r(n,r,i){let s={jsonrpc:v,id:e.id,error:n.toJson()};K(s,r,i),t.write(s)}!function(e){if(M!==d.Off&&k)if(R===f.Text){let t=void 0;M===d.Verbose&&e.params&&(t=`Params: ${JSON.stringify(e.params,null,4)}\n\n`),k.log(`Received request '${e.method} - (${e.id})'.`,t)}else V("receive-request",e)}(e);let o,a,u=A[e.method];u&&(o=u.type,a=u.handler);let l=Date.now();if(a||b){let u=new c.CancellationTokenSource,h=String(e.id);N[h]=u;try{let c;c=void 0===e.params||void 0!==o&&0===o.numberOfParams?a?a(u.token):b(e.method,u.token):i.array(e.params)&&(void 0===o||o.numberOfParams>1)?a?a(...e.params,u.token):b(e.method,...e.params,u.token):a?a(e.params,u.token):b(e.method,e.params,u.token);let p=c;c?p.then?p.then((t=>{delete N[h],n(t,e.method,l)}),(t=>{delete N[h],t instanceof s.ResponseError?r(t,e.method,l):t&&i.string(t.message)?r(new s.ResponseError(s.ErrorCodes.InternalError,`Request ${e.method} failed with message: ${t.message}`),e.method,l):r(new s.ResponseError(s.ErrorCodes.InternalError,`Request ${e.method} failed unexpectedly without providing any details.`),e.method,l)})):(delete N[h],n(c,e.method,l)):(delete N[h],function(n,r,i){void 0===n&&(n=null);let s={jsonrpc:v,id:e.id,result:n};K(s,r,i),t.write(s)}(c,e.method,l))}catch(t){delete N[h],t instanceof s.ResponseError?n(t,e.method,l):t&&i.string(t.message)?r(new s.ResponseError(s.ErrorCodes.InternalError,`Request ${e.method} failed with message: ${t.message}`),e.method,l):r(new s.ResponseError(s.ErrorCodes.InternalError,`Request ${e.method} failed unexpectedly without providing any details.`),e.method,l)}}else r(new s.ResponseError(s.ErrorCodes.MethodNotFound,"Unhandled method "+e.method),e.method,l)}(e):s.isNotificationMessage(e)?function(e){if(X())return;let t,r=void 0;if(e.method===h.type.method)t=e=>{let t=e.id,n=N[String(t)];n&&n.cancel()};else{let n=S[e.method];n&&(t=n.handler,r=n.type)}if(t||w)try{!function(e){if(M!==d.Off&&k&&e.method!==g.type.method)if(R===f.Text){let t=void 0;M===d.Verbose&&(t=e.params?`Params: ${JSON.stringify(e.params,null,4)}\n\n`:"No parameters provided.\n\n"),k.log(`Received notification '${e.method}'.`,t)}else V("receive-notification",e)}(e),void 0===e.params||void 0!==r&&0===r.numberOfParams?t?t():w(e.method):i.array(e.params)&&(void 0===r||r.numberOfParams>1)?t?t(...e.params):w(e.method,...e.params):t?t(e.params):w(e.method,e.params)}catch(t){t.message?n.error(`Notification handler '${e.method}' failed with message: ${t.message}`):n.error(`Notification handler '${e.method}' failed unexpectedly.`)}else q.fire(e)}(e):s.isResponseMessage(e)?function(e){if(!X())if(null===e.id)e.error?n.error("Received response message without id: Error is: \n"+JSON.stringify(e.error,void 0,4)):n.error("Received response message without id. No further error information provided.");else{let t=String(e.id),r=T[t];if(function(e,t){if(M!==d.Off&&k)if(R===f.Text){let n=void 0;if(M===d.Verbose&&(e.error&&e.error.data?n=`Error data: ${JSON.stringify(e.error.data,null,4)}\n\n`:e.result?n=`Result: ${JSON.stringify(e.result,null,4)}\n\n`:void 0===e.error&&(n="No result returned.\n\n")),t){let r=e.error?` Request failed: ${e.error.message} (${e.error.code}).`:"";k.log(`Received response '${t.method} - (${e.id})' in ${Date.now()-t.timerStart}ms.${r}`,n)}else k.log(`Received response ${e.id} without active response promise.`,n)}else V("receive-response",e)}(e,r),r){delete T[t];try{if(e.error){let t=e.error;r.reject(new s.ResponseError(t.code,t.message,t.data))}else{if(void 0===e.result)throw new Error("Should never happen.");r.resolve(e.result)}}catch(e){e.message?n.error(`Response handler '${r.method}' failed with message: ${e.message}`):n.error(`Response handler '${r.method}' failed unexpectedly.`)}}}}(e):function(e){if(!e)return void n.error("Received empty message.");n.error("Received message which is neither a response nor a notification message:\n"+JSON.stringify(e,null,4));let t=e;if(i.string(t.id)||i.number(t.id)){let e=String(t.id),n=T[e];n&&n.reject(new Error("The received response has neither a result nor an error property."))}}(e)}finally{H()}}()})))}e.onClose($),e.onError((function(e){B.fire([e,void 0,void 0])})),t.onClose($),t.onError((function(e){B.fire(e)}));let W=e=>{try{if(s.isNotificationMessage(e)&&e.method===h.type.method){let n=z(e.params.id),i=F.get(n);if(s.isRequestMessage(i)){let s=r&&r.cancelUndispatched?r.cancelUndispatched(i,j):void 0;if(s&&(void 0!==s.error||void 0!==s.result))return F.delete(n),s.id=i.id,K(s,e.method,Date.now()),void t.write(s)}}!function(e,t){var n;s.isRequestMessage(t)?e.set(z(t.id),t):s.isResponseMessage(t)?e.set(null===(n=t.id)?"res-unknown-"+(++C).toString():"res-"+n.toString(),t):e.set("not-"+(++a).toString(),t)}(F,e)}finally{H()}};function K(e,t,n){if(M!==d.Off&&k)if(R===f.Text){let r=void 0;M===d.Verbose&&(e.error&&e.error.data?r=`Error data: ${JSON.stringify(e.error.data,null,4)}\n\n`:e.result?r=`Result: ${JSON.stringify(e.result,null,4)}\n\n`:void 0===e.error&&(r="No result returned.\n\n")),k.log(`Sending response '${t} - (${e.id})'. Processing request took ${Date.now()-n}ms`,r)}else V("send-response",e)}function V(e,t){if(!k||M===d.Off)return;const n={isLSPMessage:!0,type:e,message:t,timestamp:Date.now()};k.log(n)}function G(){if(J())throw new D(x.Closed,"Connection is closed.");if(X())throw new D(x.Disposed,"Connection is disposed.")}function Y(e){return void 0===e?null:e}function Z(e,t){let n,r=e.numberOfParams;switch(r){case 0:n=null;break;case 1:n=Y(t[0]);break;default:n=[];for(let e=0;e<t.length&&e<r;e++)n.push(Y(t[e]));if(t.length<r)for(let e=t.length;e<r;e++)n.push(null)}return n}let Q={sendNotification:(e,...n)=>{let r,s;if(G(),i.string(e))switch(r=e,n.length){case 0:s=null;break;case 1:s=n[0];break;default:s=n}else r=e.method,s=Z(e,n);let o={jsonrpc:v,method:r,params:s};!function(e){if(M!==d.Off&&k)if(R===f.Text){let t=void 0;M===d.Verbose&&(t=e.params?`Params: ${JSON.stringify(e.params,null,4)}\n\n`:"No parameters provided.\n\n"),k.log(`Sending notification '${e.method}'.`,t)}else V("send-notification",e)}(o),t.write(o)},onNotification:(e,t)=>{G(),i.func(e)?w=e:t&&(i.string(e)?S[e]={type:void 0,handler:t}:S[e.method]={type:e,handler:t})},onProgress:(e,t,n)=>{if(_.has(t))throw new Error(`Progress handler for token ${t} already registered`);return _.set(t,n),{dispose:()=>{_.delete(t)}}},sendProgress:(e,t,n)=>{Q.sendNotification(p.type,{token:t,value:n})},onUnhandledProgress:P.event,sendRequest:(e,...n)=>{let r,a;G(),function(){if(!U())throw new Error("Call listen() first.")}();let u=void 0;if(i.string(e))switch(r=e,n.length){case 0:a=null;break;case 1:c.CancellationToken.is(n[0])?(a=null,u=n[0]):a=Y(n[0]);break;default:const e=n.length-1;c.CancellationToken.is(n[e])?(u=n[e],a=2===n.length?Y(n[0]):n.slice(0,e).map((e=>Y(e)))):a=n.map((e=>Y(e)))}else{r=e.method,a=Z(e,n);let t=e.numberOfParams;u=c.CancellationToken.is(n[t])?n[t]:void 0}let l=o++,p=new Promise(((e,n)=>{let i={jsonrpc:v,id:l,method:r,params:a},o={method:r,timerStart:Date.now(),resolve:e,reject:n};!function(e){if(M!==d.Off&&k)if(R===f.Text){let t=void 0;M===d.Verbose&&e.params&&(t=`Params: ${JSON.stringify(e.params,null,4)}\n\n`),k.log(`Sending request '${e.method} - (${e.id})'.`,t)}else V("send-request",e)}(i);try{t.write(i)}catch(e){o.reject(new s.ResponseError(s.ErrorCodes.MessageWriteError,e.message?e.message:"Unknown reason")),o=null}o&&(T[String(l)]=o)}));return u&&u.onCancellationRequested((()=>{Q.sendNotification(h.type,{id:l})})),p},onRequest:(e,t)=>{G(),i.func(e)?b=e:t&&(i.string(e)?A[e]={type:void 0,handler:t}:A[e.method]={type:e,handler:t})},trace:(e,t,n)=>{let r=!1,s=f.Text;void 0!==n&&(i.boolean(n)?r=n:(r=n.sendNotification||!1,s=n.traceFormat||f.Text)),M=e,R=s,k=M===d.Off?void 0:t,!r||J()||X()||Q.sendNotification(m.type,{value:d.toString(e)})},onError:B.event,onClose:L.event,onUnhandledNotification:q.event,onDispose:O.event,dispose:()=>{if(X())return;I=y.Disposed,O.fire(void 0);let n=new Error("Connection got disposed.");Object.keys(T).forEach((e=>{T[e].reject(n)})),T=Object.create(null),N=Object.create(null),F=new l.LinkedMap,i.func(t.dispose)&&t.dispose(),i.func(e.dispose)&&e.dispose()},listen:()=>{G(),function(){if(U())throw new D(x.AlreadyListening,"Connection is already listening")}(),I=y.Listening,e.listen(W)},inspect:()=>{console.log("inspect")}};return Q.onNotification(g.type,(e=>{M!==d.Off&&k&&k.log(e.message,M===d.Verbose?e.verbose:void 0)})),Q.onNotification(p.type,(e=>{const t=_.get(e.token);t?t(e.value):P.fire(e)})),Q}t.ConnectionError=D,(t.ConnectionStrategy||(t.ConnectionStrategy={})).is=function(e){let t=e;return t&&i.func(t.cancelUndispatched)},function(e){e[e.New=1]="New",e[e.Listening=2]="Listening",e[e.Closed=3]="Closed",e[e.Disposed=4]="Disposed"}(y||(y={})),t.createMessageConnection=function(e,n,r,i){var s;return r||(r=t.NullLogger),C(void 0!==(s=e).listen&&void 0===s.read?e:new o.StreamMessageReader(e),function(e){return void 0!==e.write&&void 0===e.end}(n)?n:new a.StreamMessageWriter(n),r,i)}},(e,t)=>{"use strict";function n(e){return"string"==typeof e||e instanceof String}function r(e){return Array.isArray(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.boolean=function(e){return!0===e||!1===e},t.string=n,t.number=function(e){return"number"==typeof e||e instanceof Number},t.error=function(e){return e instanceof Error},t.func=function(e){return"function"==typeof e},t.array=r,t.stringArray=function(e){return r(e)&&e.every((e=>n(e)))}},(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(166);var i;!function(e){e.ParseError=-32700,e.InvalidRequest=-32600,e.MethodNotFound=-32601,e.InvalidParams=-32602,e.InternalError=-32603,e.serverErrorStart=-32099,e.serverErrorEnd=-32e3,e.ServerNotInitialized=-32002,e.UnknownErrorCode=-32001,e.RequestCancelled=-32800,e.ContentModified=-32801,e.MessageWriteError=1,e.MessageReadError=2}(i=t.ErrorCodes||(t.ErrorCodes={}));class s extends Error{constructor(e,t,n){super(t),this.code=r.number(e)?e:i.UnknownErrorCode,this.data=n,Object.setPrototypeOf(this,s.prototype)}toJson(){return{code:this.code,message:this.message,data:this.data}}}t.ResponseError=s;class o{constructor(e,t){this._method=e,this._numberOfParams=t}get method(){return this._method}get numberOfParams(){return this._numberOfParams}}t.AbstractMessageType=o,t.RequestType0=class extends o{constructor(e){super(e,0)}},t.RequestType=class extends o{constructor(e){super(e,1)}},t.RequestType1=class extends o{constructor(e){super(e,1)}},t.RequestType2=class extends o{constructor(e){super(e,2)}},t.RequestType3=class extends o{constructor(e){super(e,3)}},t.RequestType4=class extends o{constructor(e){super(e,4)}},t.RequestType5=class extends o{constructor(e){super(e,5)}},t.RequestType6=class extends o{constructor(e){super(e,6)}},t.RequestType7=class extends o{constructor(e){super(e,7)}},t.RequestType8=class extends o{constructor(e){super(e,8)}},t.RequestType9=class extends o{constructor(e){super(e,9)}},t.NotificationType=class extends o{constructor(e){super(e,1),this._=void 0}},t.NotificationType0=class extends o{constructor(e){super(e,0)}},t.NotificationType1=class extends o{constructor(e){super(e,1)}},t.NotificationType2=class extends o{constructor(e){super(e,2)}},t.NotificationType3=class extends o{constructor(e){super(e,3)}},t.NotificationType4=class extends o{constructor(e){super(e,4)}},t.NotificationType5=class extends o{constructor(e){super(e,5)}},t.NotificationType6=class extends o{constructor(e){super(e,6)}},t.NotificationType7=class extends o{constructor(e){super(e,7)}},t.NotificationType8=class extends o{constructor(e){super(e,8)}},t.NotificationType9=class extends o{constructor(e){super(e,9)}},t.isRequestMessage=function(e){let t=e;return t&&r.string(t.method)&&(r.string(t.id)||r.number(t.id))},t.isNotificationMessage=function(e){let t=e;return t&&r.string(t.method)&&void 0===e.id},t.isResponseMessage=function(e){let t=e;return t&&(void 0!==t.result||!!t.error)&&(r.string(t.id)||r.number(t.id)||null===t.id)}},(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(169),i=n(166);let s=8192,o=Buffer.from("\r","ascii")[0],a=Buffer.from("\n","ascii")[0];class u{constructor(e="utf8"){this.encoding=e,this.index=0,this.buffer=Buffer.allocUnsafe(s)}append(e){var t=e;if("string"==typeof e){var n=e,r=Buffer.byteLength(n,this.encoding);(t=Buffer.allocUnsafe(r)).write(n,0,r,this.encoding)}if(this.buffer.length-this.index>=t.length)t.copy(this.buffer,this.index,0,t.length);else{var i=(Math.ceil((this.index+t.length)/s)+1)*s;0===this.index?(this.buffer=Buffer.allocUnsafe(i),t.copy(this.buffer,0,0,t.length)):this.buffer=Buffer.concat([this.buffer.slice(0,this.index),t],i)}this.index+=t.length}tryReadHeaders(){let e=void 0,t=0;for(;t+3<this.index&&(this.buffer[t]!==o||this.buffer[t+1]!==a||this.buffer[t+2]!==o||this.buffer[t+3]!==a);)t++;if(t+3>=this.index)return e;e=Object.create(null),this.buffer.toString("ascii",0,t).split("\r\n").forEach((t=>{let n=t.indexOf(":");if(-1===n)throw new Error("Message header must separate key and value using :");let r=t.substr(0,n),i=t.substr(n+1).trim();e[r]=i}));let n=t+4;return this.buffer=this.buffer.slice(n),this.index=this.index-n,e}tryReadContent(e){if(this.index<e)return null;let t=this.buffer.toString(this.encoding,0,e),n=e;return this.buffer.copy(this.buffer,0,n),this.index=this.index-n,t}get numberOfBytes(){return this.index}}(t.MessageReader||(t.MessageReader={})).is=function(e){let t=e;return t&&i.func(t.listen)&&i.func(t.dispose)&&i.func(t.onError)&&i.func(t.onClose)&&i.func(t.onPartialMessage)};class c{constructor(){this.errorEmitter=new r.Emitter,this.closeEmitter=new r.Emitter,this.partialMessageEmitter=new r.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e){this.errorEmitter.fire(this.asError(e))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(e){this.partialMessageEmitter.fire(e)}asError(e){return e instanceof Error?e:new Error("Reader received error. Reason: "+(i.string(e.message)?e.message:"unknown"))}}t.AbstractMessageReader=c;class l extends c{constructor(e,t="utf8"){super(),this.readable=e,this.buffer=new u(t),this._partialMessageTimeout=1e4}set partialMessageTimeout(e){this._partialMessageTimeout=e}get partialMessageTimeout(){return this._partialMessageTimeout}listen(e){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=e,this.readable.on("data",(e=>{this.onData(e)})),this.readable.on("error",(e=>this.fireError(e))),this.readable.on("close",(()=>this.fireClose()))}onData(e){for(this.buffer.append(e);;){if(-1===this.nextMessageLength){let e=this.buffer.tryReadHeaders();if(!e)return;let t=e["Content-Length"];if(!t)throw new Error("Header must provide a Content-Length property.");let n=parseInt(t);if(isNaN(n))throw new Error("Content-Length value must be a number.");this.nextMessageLength=n}var t=this.buffer.tryReadContent(this.nextMessageLength);if(null===t)return void this.setPartialMessageTimer();this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.messageToken++;var n=JSON.parse(t);this.callback(n)}}clearPartialMessageTimer(){this.partialMessageTimer&&(clearTimeout(this.partialMessageTimer),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),this._partialMessageTimeout<=0||(this.partialMessageTimer=setTimeout(((e,t)=>{this.partialMessageTimer=void 0,e===this.messageToken&&(this.firePartialMessage({messageToken:e,waitingTime:t}),this.setPartialMessageTimer())}),this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}}t.StreamMessageReader=l,t.IPCMessageReader=class extends c{constructor(e){super(),this.process=e;let t=this.process;t.on("error",(e=>this.fireError(e))),t.on("close",(()=>this.fireClose()))}listen(e){this.process.on("message",e)}},t.SocketMessageReader=class extends l{constructor(e,t="utf-8"){super(e,t)}}},(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),(t.Disposable||(t.Disposable={})).create=function(e){return{dispose:e}},function(e){const t={dispose(){}};e.None=function(){return t}}(t.Event||(t.Event={}));class n{add(e,t=null,n){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(t),Array.isArray(n)&&n.push({dispose:()=>this.remove(e,t)})}remove(e,t=null){if(this._callbacks){for(var n=!1,r=0,i=this._callbacks.length;r<i;r++)if(this._callbacks[r]===e){if(this._contexts[r]===t)return this._callbacks.splice(r,1),void this._contexts.splice(r,1);n=!0}if(n)throw new Error("When adding a listener with a context, you should remove it with the same context")}}invoke(...e){if(!this._callbacks)return[];for(var t=[],n=this._callbacks.slice(0),r=this._contexts.slice(0),i=0,s=n.length;i<s;i++)try{t.push(n[i].apply(r[i],e))}catch(e){console.error(e)}return t}isEmpty(){return!this._callbacks||0===this._callbacks.length}dispose(){this._callbacks=void 0,this._contexts=void 0}}class r{constructor(e){this._options=e}get event(){return this._event||(this._event=(e,t,i)=>{let s;return this._callbacks||(this._callbacks=new n),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,t),s={dispose:()=>{this._callbacks.remove(e,t),s.dispose=r._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this)}},Array.isArray(i)&&i.push(s),s}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}}t.Emitter=r,r._noop=function(){}},(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(169),i=n(166);let s="Content-Length: ",o="\r\n";(t.MessageWriter||(t.MessageWriter={})).is=function(e){let t=e;return t&&i.func(t.dispose)&&i.func(t.onClose)&&i.func(t.onError)&&i.func(t.write)};class a{constructor(){this.errorEmitter=new r.Emitter,this.closeEmitter=new r.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e,t,n){this.errorEmitter.fire([this.asError(e),t,n])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(e){return e instanceof Error?e:new Error("Writer received error. Reason: "+(i.string(e.message)?e.message:"unknown"))}}t.AbstractMessageWriter=a,t.StreamMessageWriter=class extends a{constructor(e,t="utf8"){super(),this.writable=e,this.encoding=t,this.errorCount=0,this.writable.on("error",(e=>this.fireError(e))),this.writable.on("close",(()=>this.fireClose()))}write(e){let t=JSON.stringify(e),n=Buffer.byteLength(t,this.encoding),r=[s,n.toString(),o,o];try{this.writable.write(r.join(""),"ascii"),this.writable.write(t,this.encoding),this.errorCount=0}catch(t){this.errorCount++,this.fireError(t,e,this.errorCount)}}},t.IPCMessageWriter=class extends a{constructor(e){super(),this.process=e,this.errorCount=0,this.queue=[],this.sending=!1;let t=this.process;t.on("error",(e=>this.fireError(e))),t.on("close",(()=>this.fireClose))}write(e){this.sending||0!==this.queue.length?this.queue.push(e):this.doWriteMessage(e)}doWriteMessage(e){try{this.process.send&&(this.sending=!0,this.process.send(e,void 0,void 0,(t=>{this.sending=!1,t?(this.errorCount++,this.fireError(t,e,this.errorCount)):this.errorCount=0,this.queue.length>0&&this.doWriteMessage(this.queue.shift())})))}catch(t){this.errorCount++,this.fireError(t,e,this.errorCount)}}},t.SocketMessageWriter=class extends a{constructor(e,t="utf8"){super(),this.socket=e,this.queue=[],this.sending=!1,this.encoding=t,this.errorCount=0,this.socket.on("error",(e=>this.fireError(e))),this.socket.on("close",(()=>this.fireClose()))}dispose(){super.dispose(),this.socket.destroy()}write(e){this.sending||0!==this.queue.length?this.queue.push(e):this.doWriteMessage(e)}doWriteMessage(e){let t=JSON.stringify(e),n=Buffer.byteLength(t,this.encoding),r=[s,n.toString(),o,o];try{this.sending=!0,this.socket.write(r.join(""),"ascii",(n=>{n&&this.handleError(n,e);try{this.socket.write(t,this.encoding,(t=>{this.sending=!1,t?this.handleError(t,e):this.errorCount=0,this.queue.length>0&&this.doWriteMessage(this.queue.shift())}))}catch(n){this.handleError(n,e)}}))}catch(t){this.handleError(t,e)}}handleError(e,t){this.errorCount++,this.fireError(e,t,this.errorCount)}}},(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(169),i=n(166);var s;!function(e){e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:r.Event.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:r.Event.None}),e.is=function(t){let n=t;return n&&(n===e.None||n===e.Cancelled||i.boolean(n.isCancellationRequested)&&!!n.onCancellationRequested)}}(s=t.CancellationToken||(t.CancellationToken={}));const o=Object.freeze((function(e,t){let n=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(n)}}}));class a{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?o:(this._emitter||(this._emitter=new r.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}}t.CancellationTokenSource=class{get token(){return this._token||(this._token=new a),this._token}cancel(){this._token?this._token.cancel():this._token=s.Cancelled}dispose(){this._token?this._token instanceof a&&this._token.dispose():this._token=s.None}}},(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.None=0,e.First=1,e.Last=2}(n=t.Touch||(t.Touch={})),t.LinkedMap=class{constructor(){this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}has(e){return this._map.has(e)}get(e){const t=this._map.get(e);if(t)return t.value}set(e,t,r=n.None){let i=this._map.get(e);if(i)i.value=t,r!==n.None&&this.touch(i,r);else{switch(i={key:e,value:t,next:void 0,previous:void 0},r){case n.None:this.addItemLast(i);break;case n.First:this.addItemFirst(i);break;case n.Last:default:this.addItemLast(i)}this._map.set(e,i),this._size++}}delete(e){const t=this._map.get(e);return!!t&&(this._map.delete(e),this.removeItem(t),this._size--,!0)}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");const e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,t){let n=this._head;for(;n;)t?e.bind(t)(n.value,n.key,this):e(n.value,n.key,this),n=n.next}forEachReverse(e,t){let n=this._tail;for(;n;)t?e.bind(t)(n.value,n.key,this):e(n.value,n.key,this),n=n.previous}values(){let e=[],t=this._head;for(;t;)e.push(t.value),t=t.next;return e}keys(){let e=[],t=this._head;for(;t;)e.push(t.key),t=t.next;return e}addItemFirst(e){if(this._head||this._tail){if(!this._head)throw new Error("Invalid list");e.next=this._head,this._head.previous=e}else this._tail=e;this._head=e}addItemLast(e){if(this._head||this._tail){if(!this._tail)throw new Error("Invalid list");e.previous=this._tail,this._tail.next=e}else this._head=e;this._tail=e}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head)this._head=e.next;else if(e===this._tail)this._tail=e.previous;else{const t=e.next,n=e.previous;if(!t||!n)throw new Error("Invalid list");t.previous=n,n.next=t}}touch(e,t){if(!this._head||!this._tail)throw new Error("Invalid list");if(t===n.First||t===n.Last)if(t===n.First){if(e===this._head)return;const t=e.next,n=e.previous;e===this._tail?(n.next=void 0,this._tail=n):(t.previous=n,n.next=t),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e}else if(t===n.Last){if(e===this._tail)return;const t=e.next,n=e.previous;e===this._head?(t.previous=void 0,this._head=t):(t.previous=n,n.next=t),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e}}}},(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(39),i=n(112),s=n(174),o=n(175),a=n(168),u=n(170);t.generateRandomPipeName=function(){const e=s.randomBytes(21).toString("hex");return"win32"===process.platform?`\\\\.\\pipe\\vscode-jsonrpc-${e}-sock`:r.join(i.tmpdir(),`vscode-${e}.sock`)},t.createClientPipeTransport=function(e,t="utf-8"){let n,r=new Promise(((e,t)=>{n=e}));return new Promise(((i,s)=>{let c=o.createServer((e=>{c.close(),n([new a.SocketMessageReader(e,t),new u.SocketMessageWriter(e,t)])}));c.on("error",s),c.listen(e,(()=>{c.removeListener("error",s),i({onConnected:()=>r})}))}))},t.createServerPipeTransport=function(e,t="utf-8"){const n=o.createConnection(e);return[new a.SocketMessageReader(n,t),new u.SocketMessageWriter(n,t)]}},e=>{"use strict";e.exports=require("crypto")},e=>{"use strict";e.exports=require("net")},(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(175),i=n(168),s=n(170);t.createClientSocketTransport=function(e,t="utf-8"){let n,o=new Promise(((e,t)=>{n=e}));return new Promise(((a,u)=>{let c=r.createServer((e=>{c.close(),n([new i.SocketMessageReader(e,t),new s.SocketMessageWriter(e,t)])}));c.on("error",u),c.listen(e,"127.0.0.1",(()=>{c.removeListener("error",u),a({onConnected:()=>o})}))}))},t.createServerSocketTransport=function(e,t="utf-8"){const n=r.createConnection(e,"127.0.0.1");return[new i.SocketMessageReader(n,t),new s.SocketMessageWriter(n,t)]}},(e,t,n)=>{"use strict";var r,i,s,o,a,u,c,l,h,p,d,f,m,g,x,y,D,C,v,E;n.r(t),n.d(t,{Position:()=>r,Range:()=>i,Location:()=>s,LocationLink:()=>o,Color:()=>a,ColorInformation:()=>u,ColorPresentation:()=>c,FoldingRangeKind:()=>l,FoldingRange:()=>h,DiagnosticRelatedInformation:()=>p,DiagnosticSeverity:()=>d,DiagnosticTag:()=>f,Diagnostic:()=>m,Command:()=>g,TextEdit:()=>x,TextDocumentEdit:()=>y,CreateFile:()=>D,RenameFile:()=>C,DeleteFile:()=>v,WorkspaceEdit:()=>E,WorkspaceChange:()=>Y,TextDocumentIdentifier:()=>k,VersionedTextDocumentIdentifier:()=>b,TextDocumentItem:()=>A,MarkupKind:()=>w,MarkupContent:()=>S,CompletionItemKind:()=>_,InsertTextFormat:()=>F,CompletionItemTag:()=>T,CompletionItem:()=>N,CompletionList:()=>M,MarkedString:()=>R,Hover:()=>I,ParameterInformation:()=>B,SignatureInformation:()=>L,DocumentHighlightKind:()=>q,DocumentHighlight:()=>P,SymbolKind:()=>O,SymbolTag:()=>z,SymbolInformation:()=>j,DocumentSymbol:()=>U,CodeActionKind:()=>J,CodeActionContext:()=>X,CodeAction:()=>$,CodeLens:()=>H,FormattingOptions:()=>W,DocumentLink:()=>K,SelectionRange:()=>V,EOL:()=>Q,TextDocument:()=>Z}),function(e){e.create=function(e,t){return{line:e,character:t}},e.is=function(e){var t=e;return ee.objectLiteral(t)&&ee.number(t.line)&&ee.number(t.character)}}(r||(r={})),function(e){e.create=function(e,t,n,i){if(ee.number(e)&&ee.number(t)&&ee.number(n)&&ee.number(i))return{start:r.create(e,t),end:r.create(n,i)};if(r.is(e)&&r.is(t))return{start:e,end:t};throw new Error("Range#create called with invalid arguments["+e+", "+t+", "+n+", "+i+"]")},e.is=function(e){var t=e;return ee.objectLiteral(t)&&r.is(t.start)&&r.is(t.end)}}(i||(i={})),function(e){e.create=function(e,t){return{uri:e,range:t}},e.is=function(e){var t=e;return ee.defined(t)&&i.is(t.range)&&(ee.string(t.uri)||ee.undefined(t.uri))}}(s||(s={})),function(e){e.create=function(e,t,n,r){return{targetUri:e,targetRange:t,targetSelectionRange:n,originSelectionRange:r}},e.is=function(e){var t=e;return ee.defined(t)&&i.is(t.targetRange)&&ee.string(t.targetUri)&&(i.is(t.targetSelectionRange)||ee.undefined(t.targetSelectionRange))&&(i.is(t.originSelectionRange)||ee.undefined(t.originSelectionRange))}}(o||(o={})),function(e){e.create=function(e,t,n,r){return{red:e,green:t,blue:n,alpha:r}},e.is=function(e){var t=e;return ee.number(t.red)&&ee.number(t.green)&&ee.number(t.blue)&&ee.number(t.alpha)}}(a||(a={})),function(e){e.create=function(e,t){return{range:e,color:t}},e.is=function(e){var t=e;return i.is(t.range)&&a.is(t.color)}}(u||(u={})),function(e){e.create=function(e,t,n){return{label:e,textEdit:t,additionalTextEdits:n}},e.is=function(e){var t=e;return ee.string(t.label)&&(ee.undefined(t.textEdit)||x.is(t))&&(ee.undefined(t.additionalTextEdits)||ee.typedArray(t.additionalTextEdits,x.is))}}(c||(c={})),function(e){e.Comment="comment",e.Imports="imports",e.Region="region"}(l||(l={})),function(e){e.create=function(e,t,n,r,i){var s={startLine:e,endLine:t};return ee.defined(n)&&(s.startCharacter=n),ee.defined(r)&&(s.endCharacter=r),ee.defined(i)&&(s.kind=i),s},e.is=function(e){var t=e;return ee.number(t.startLine)&&ee.number(t.startLine)&&(ee.undefined(t.startCharacter)||ee.number(t.startCharacter))&&(ee.undefined(t.endCharacter)||ee.number(t.endCharacter))&&(ee.undefined(t.kind)||ee.string(t.kind))}}(h||(h={})),function(e){e.create=function(e,t){return{location:e,message:t}},e.is=function(e){var t=e;return ee.defined(t)&&s.is(t.location)&&ee.string(t.message)}}(p||(p={})),function(e){e.Error=1,e.Warning=2,e.Information=3,e.Hint=4}(d||(d={})),function(e){e.Unnecessary=1,e.Deprecated=2}(f||(f={})),function(e){e.create=function(e,t,n,r,i,s){var o={range:e,message:t};return ee.defined(n)&&(o.severity=n),ee.defined(r)&&(o.code=r),ee.defined(i)&&(o.source=i),ee.defined(s)&&(o.relatedInformation=s),o},e.is=function(e){var t=e;return ee.defined(t)&&i.is(t.range)&&ee.string(t.message)&&(ee.number(t.severity)||ee.undefined(t.severity))&&(ee.number(t.code)||ee.string(t.code)||ee.undefined(t.code))&&(ee.string(t.source)||ee.undefined(t.source))&&(ee.undefined(t.relatedInformation)||ee.typedArray(t.relatedInformation,p.is))}}(m||(m={})),function(e){e.create=function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i={title:e,command:t};return ee.defined(n)&&n.length>0&&(i.arguments=n),i},e.is=function(e){var t=e;return ee.defined(t)&&ee.string(t.title)&&ee.string(t.command)}}(g||(g={})),function(e){e.replace=function(e,t){return{range:e,newText:t}},e.insert=function(e,t){return{range:{start:e,end:e},newText:t}},e.del=function(e){return{range:e,newText:""}},e.is=function(e){var t=e;return ee.objectLiteral(t)&&ee.string(t.newText)&&i.is(t.range)}}(x||(x={})),function(e){e.create=function(e,t){return{textDocument:e,edits:t}},e.is=function(e){var t=e;return ee.defined(t)&&b.is(t.textDocument)&&Array.isArray(t.edits)}}(y||(y={})),function(e){e.create=function(e,t){var n={kind:"create",uri:e};return void 0===t||void 0===t.overwrite&&void 0===t.ignoreIfExists||(n.options=t),n},e.is=function(e){var t=e;return t&&"create"===t.kind&&ee.string(t.uri)&&(void 0===t.options||(void 0===t.options.overwrite||ee.boolean(t.options.overwrite))&&(void 0===t.options.ignoreIfExists||ee.boolean(t.options.ignoreIfExists)))}}(D||(D={})),function(e){e.create=function(e,t,n){var r={kind:"rename",oldUri:e,newUri:t};return void 0===n||void 0===n.overwrite&&void 0===n.ignoreIfExists||(r.options=n),r},e.is=function(e){var t=e;return t&&"rename"===t.kind&&ee.string(t.oldUri)&&ee.string(t.newUri)&&(void 0===t.options||(void 0===t.options.overwrite||ee.boolean(t.options.overwrite))&&(void 0===t.options.ignoreIfExists||ee.boolean(t.options.ignoreIfExists)))}}(C||(C={})),function(e){e.create=function(e,t){var n={kind:"delete",uri:e};return void 0===t||void 0===t.recursive&&void 0===t.ignoreIfNotExists||(n.options=t),n},e.is=function(e){var t=e;return t&&"delete"===t.kind&&ee.string(t.uri)&&(void 0===t.options||(void 0===t.options.recursive||ee.boolean(t.options.recursive))&&(void 0===t.options.ignoreIfNotExists||ee.boolean(t.options.ignoreIfNotExists)))}}(v||(v={})),function(e){e.is=function(e){var t=e;return t&&(void 0!==t.changes||void 0!==t.documentChanges)&&(void 0===t.documentChanges||t.documentChanges.every((function(e){return ee.string(e.kind)?D.is(e)||C.is(e)||v.is(e):y.is(e)})))}}(E||(E={}));var k,b,A,w,S,_,F,T,N,M,R,I,B,L,q,P,O,z,j,U,J,X,$,H,W,K,V,G=function(){function e(e){this.edits=e}return e.prototype.insert=function(e,t){this.edits.push(x.insert(e,t))},e.prototype.replace=function(e,t){this.edits.push(x.replace(e,t))},e.prototype.delete=function(e){this.edits.push(x.del(e))},e.prototype.add=function(e){this.edits.push(e)},e.prototype.all=function(){return this.edits},e.prototype.clear=function(){this.edits.splice(0,this.edits.length)},e}(),Y=function(){function e(e){var t=this;this._textEditChanges=Object.create(null),e&&(this._workspaceEdit=e,e.documentChanges?e.documentChanges.forEach((function(e){if(y.is(e)){var n=new G(e.edits);t._textEditChanges[e.textDocument.uri]=n}})):e.changes&&Object.keys(e.changes).forEach((function(n){var r=new G(e.changes[n]);t._textEditChanges[n]=r})))}return Object.defineProperty(e.prototype,"edit",{get:function(){return this._workspaceEdit},enumerable:!0,configurable:!0}),e.prototype.getTextEditChange=function(e){if(b.is(e)){if(this._workspaceEdit||(this._workspaceEdit={documentChanges:[]}),!this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for document changes.");var t=e;if(!(r=this._textEditChanges[t.uri])){var n={textDocument:t,edits:i=[]};this._workspaceEdit.documentChanges.push(n),r=new G(i),this._textEditChanges[t.uri]=r}return r}if(this._workspaceEdit||(this._workspaceEdit={changes:Object.create(null)}),!this._workspaceEdit.changes)throw new Error("Workspace edit is not configured for normal text edit changes.");var r;if(!(r=this._textEditChanges[e])){var i=[];this._workspaceEdit.changes[e]=i,r=new G(i),this._textEditChanges[e]=r}return r},e.prototype.createFile=function(e,t){this.checkDocumentChanges(),this._workspaceEdit.documentChanges.push(D.create(e,t))},e.prototype.renameFile=function(e,t,n){this.checkDocumentChanges(),this._workspaceEdit.documentChanges.push(C.create(e,t,n))},e.prototype.deleteFile=function(e,t){this.checkDocumentChanges(),this._workspaceEdit.documentChanges.push(v.create(e,t))},e.prototype.checkDocumentChanges=function(){if(!this._workspaceEdit||!this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for document changes.")},e}();!function(e){e.create=function(e){return{uri:e}},e.is=function(e){var t=e;return ee.defined(t)&&ee.string(t.uri)}}(k||(k={})),function(e){e.create=function(e,t){return{uri:e,version:t}},e.is=function(e){var t=e;return ee.defined(t)&&ee.string(t.uri)&&(null===t.version||ee.number(t.version))}}(b||(b={})),function(e){e.create=function(e,t,n,r){return{uri:e,languageId:t,version:n,text:r}},e.is=function(e){var t=e;return ee.defined(t)&&ee.string(t.uri)&&ee.string(t.languageId)&&ee.number(t.version)&&ee.string(t.text)}}(A||(A={})),function(e){e.PlainText="plaintext",e.Markdown="markdown"}(w||(w={})),function(e){e.is=function(t){var n=t;return n===e.PlainText||n===e.Markdown}}(w||(w={})),function(e){e.is=function(e){var t=e;return ee.objectLiteral(e)&&w.is(t.kind)&&ee.string(t.value)}}(S||(S={})),function(e){e.Text=1,e.Method=2,e.Function=3,e.Constructor=4,e.Field=5,e.Variable=6,e.Class=7,e.Interface=8,e.Module=9,e.Property=10,e.Unit=11,e.Value=12,e.Enum=13,e.Keyword=14,e.Snippet=15,e.Color=16,e.File=17,e.Reference=18,e.Folder=19,e.EnumMember=20,e.Constant=21,e.Struct=22,e.Event=23,e.Operator=24,e.TypeParameter=25}(_||(_={})),function(e){e.PlainText=1,e.Snippet=2}(F||(F={})),function(e){e.Deprecated=1}(T||(T={})),function(e){e.create=function(e){return{label:e}}}(N||(N={})),function(e){e.create=function(e,t){return{items:e||[],isIncomplete:!!t}}}(M||(M={})),function(e){e.fromPlainText=function(e){return e.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")},e.is=function(e){var t=e;return ee.string(t)||ee.objectLiteral(t)&&ee.string(t.language)&&ee.string(t.value)}}(R||(R={})),function(e){e.is=function(e){var t=e;return!!t&&ee.objectLiteral(t)&&(S.is(t.contents)||R.is(t.contents)||ee.typedArray(t.contents,R.is))&&(void 0===e.range||i.is(e.range))}}(I||(I={})),function(e){e.create=function(e,t){return t?{label:e,documentation:t}:{label:e}}}(B||(B={})),function(e){e.create=function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i={label:e};return ee.defined(t)&&(i.documentation=t),ee.defined(n)?i.parameters=n:i.parameters=[],i}}(L||(L={})),function(e){e.Text=1,e.Read=2,e.Write=3}(q||(q={})),function(e){e.create=function(e,t){var n={range:e};return ee.number(t)&&(n.kind=t),n}}(P||(P={})),function(e){e.File=1,e.Module=2,e.Namespace=3,e.Package=4,e.Class=5,e.Method=6,e.Property=7,e.Field=8,e.Constructor=9,e.Enum=10,e.Interface=11,e.Function=12,e.Variable=13,e.Constant=14,e.String=15,e.Number=16,e.Boolean=17,e.Array=18,e.Object=19,e.Key=20,e.Null=21,e.EnumMember=22,e.Struct=23,e.Event=24,e.Operator=25,e.TypeParameter=26}(O||(O={})),function(e){e.Deprecated=1}(z||(z={})),function(e){e.create=function(e,t,n,r,i){var s={name:e,kind:t,location:{uri:r,range:n}};return i&&(s.containerName=i),s}}(j||(j={})),function(e){e.create=function(e,t,n,r,i,s){var o={name:e,detail:t,kind:n,range:r,selectionRange:i};return void 0!==s&&(o.children=s),o},e.is=function(e){var t=e;return t&&ee.string(t.name)&&ee.number(t.kind)&&i.is(t.range)&&i.is(t.selectionRange)&&(void 0===t.detail||ee.string(t.detail))&&(void 0===t.deprecated||ee.boolean(t.deprecated))&&(void 0===t.children||Array.isArray(t.children))}}(U||(U={})),function(e){e.Empty="",e.QuickFix="quickfix",e.Refactor="refactor",e.RefactorExtract="refactor.extract",e.RefactorInline="refactor.inline",e.RefactorRewrite="refactor.rewrite",e.Source="source",e.SourceOrganizeImports="source.organizeImports",e.SourceFixAll="source.fixAll"}(J||(J={})),function(e){e.create=function(e,t){var n={diagnostics:e};return null!=t&&(n.only=t),n},e.is=function(e){var t=e;return ee.defined(t)&&ee.typedArray(t.diagnostics,m.is)&&(void 0===t.only||ee.typedArray(t.only,ee.string))}}(X||(X={})),function(e){e.create=function(e,t,n){var r={title:e};return g.is(t)?r.command=t:r.edit=t,void 0!==n&&(r.kind=n),r},e.is=function(e){var t=e;return t&&ee.string(t.title)&&(void 0===t.diagnostics||ee.typedArray(t.diagnostics,m.is))&&(void 0===t.kind||ee.string(t.kind))&&(void 0!==t.edit||void 0!==t.command)&&(void 0===t.command||g.is(t.command))&&(void 0===t.isPreferred||ee.boolean(t.isPreferred))&&(void 0===t.edit||E.is(t.edit))}}($||($={})),function(e){e.create=function(e,t){var n={range:e};return ee.defined(t)&&(n.data=t),n},e.is=function(e){var t=e;return ee.defined(t)&&i.is(t.range)&&(ee.undefined(t.command)||g.is(t.command))}}(H||(H={})),function(e){e.create=function(e,t){return{tabSize:e,insertSpaces:t}},e.is=function(e){var t=e;return ee.defined(t)&&ee.number(t.tabSize)&&ee.boolean(t.insertSpaces)}}(W||(W={})),function(e){e.create=function(e,t,n){return{range:e,target:t,data:n}},e.is=function(e){var t=e;return ee.defined(t)&&i.is(t.range)&&(ee.undefined(t.target)||ee.string(t.target))}}(K||(K={})),function(e){e.create=function(e,t){return{range:e,parent:t}},e.is=function(t){var n=t;return void 0!==n&&i.is(n.range)&&(void 0===n.parent||e.is(n.parent))}}(V||(V={}));var Z,Q=["\n","\r\n","\r"];!function(e){function t(e,n){if(e.length<=1)return e;var r=e.length/2|0,i=e.slice(0,r),s=e.slice(r);t(i,n),t(s,n);for(var o=0,a=0,u=0;o<i.length&&a<s.length;){var c=n(i[o],s[a]);e[u++]=c<=0?i[o++]:s[a++]}for(;o<i.length;)e[u++]=i[o++];for(;a<s.length;)e[u++]=s[a++];return e}e.create=function(e,t,n,r){return new te(e,t,n,r)},e.is=function(e){var t=e;return!!(ee.defined(t)&&ee.string(t.uri)&&(ee.undefined(t.languageId)||ee.string(t.languageId))&&ee.number(t.lineCount)&&ee.func(t.getText)&&ee.func(t.positionAt)&&ee.func(t.offsetAt))},e.applyEdits=function(e,n){for(var r=e.getText(),i=t(n,(function(e,t){var n=e.range.start.line-t.range.start.line;return 0===n?e.range.start.character-t.range.start.character:n})),s=r.length,o=i.length-1;o>=0;o--){var a=i[o],u=e.offsetAt(a.range.start),c=e.offsetAt(a.range.end);if(!(c<=s))throw new Error("Overlapping edit");r=r.substring(0,u)+a.newText+r.substring(c,r.length),s=u}return r}}(Z||(Z={}));var ee,te=function(){function e(e,t,n,r){this._uri=e,this._languageId=t,this._version=n,this._content=r,this._lineOffsets=void 0}return Object.defineProperty(e.prototype,"uri",{get:function(){return this._uri},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"languageId",{get:function(){return this._languageId},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"version",{get:function(){return this._version},enumerable:!0,configurable:!0}),e.prototype.getText=function(e){if(e){var t=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(t,n)}return this._content},e.prototype.update=function(e,t){this._content=e.text,this._version=t,this._lineOffsets=void 0},e.prototype.getLineOffsets=function(){if(void 0===this._lineOffsets){for(var e=[],t=this._content,n=!0,r=0;r<t.length;r++){n&&(e.push(r),n=!1);var i=t.charAt(r);n="\r"===i||"\n"===i,"\r"===i&&r+1<t.length&&"\n"===t.charAt(r+1)&&r++}n&&t.length>0&&e.push(t.length),this._lineOffsets=e}return this._lineOffsets},e.prototype.positionAt=function(e){e=Math.max(Math.min(e,this._content.length),0);var t=this.getLineOffsets(),n=0,i=t.length;if(0===i)return r.create(0,e);for(;n<i;){var s=Math.floor((n+i)/2);t[s]>e?i=s:n=s+1}var o=n-1;return r.create(o,e-t[o])},e.prototype.offsetAt=function(e){var t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;var n=t[e.line],r=e.line+1<t.length?t[e.line+1]:this._content.length;return Math.max(Math.min(n+e.character,r),n)},Object.defineProperty(e.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!0,configurable:!0}),e}();!function(e){var t=Object.prototype.toString;e.defined=function(e){return void 0!==e},e.undefined=function(e){return void 0===e},e.boolean=function(e){return!0===e||!1===e},e.string=function(e){return"[object String]"===t.call(e)},e.number=function(e){return"[object Number]"===t.call(e)},e.func=function(e){return"[object Function]"===t.call(e)},e.objectLiteral=function(e){return null!==e&&"object"==typeof e},e.typedArray=function(e,t){return Array.isArray(e)&&e.every(t)}}(ee||(ee={}))},(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(179),i=n(165),s=n(180),o=n(181);t.ImplementationRequest=o.ImplementationRequest;const a=n(182);t.TypeDefinitionRequest=a.TypeDefinitionRequest;const u=n(183);t.WorkspaceFoldersRequest=u.WorkspaceFoldersRequest,t.DidChangeWorkspaceFoldersNotification=u.DidChangeWorkspaceFoldersNotification;const c=n(184);t.ConfigurationRequest=c.ConfigurationRequest;const l=n(185);t.DocumentColorRequest=l.DocumentColorRequest,t.ColorPresentationRequest=l.ColorPresentationRequest;const h=n(186);t.FoldingRangeRequest=h.FoldingRangeRequest;const p=n(187);t.DeclarationRequest=p.DeclarationRequest;const d=n(188);t.SelectionRangeRequest=d.SelectionRangeRequest;const f=n(189);var m,g,x,y,D,C,v,E,k,b,A,w,S,_,F,T,N,M,R,I,B,L,q,P,O,z,j,U,J,X,$,H,W,K,V;t.WorkDoneProgress=f.WorkDoneProgress,t.WorkDoneProgressCreateRequest=f.WorkDoneProgressCreateRequest,t.WorkDoneProgressCancelNotification=f.WorkDoneProgressCancelNotification,function(e){e.is=function(e){const t=e;return r.string(t.language)||r.string(t.scheme)||r.string(t.pattern)}}(m=t.DocumentFilter||(t.DocumentFilter={})),function(e){e.is=function(e){if(!Array.isArray(e))return!1;for(let t of e)if(!r.string(t)&&!m.is(t))return!1;return!0}}(g=t.DocumentSelector||(t.DocumentSelector={})),(t.RegistrationRequest||(t.RegistrationRequest={})).type=new s.ProtocolRequestType("client/registerCapability"),(t.UnregistrationRequest||(t.UnregistrationRequest={})).type=new s.ProtocolRequestType("client/unregisterCapability"),(V=t.ResourceOperationKind||(t.ResourceOperationKind={})).Create="create",V.Rename="rename",V.Delete="delete",(K=t.FailureHandlingKind||(t.FailureHandlingKind={})).Abort="abort",K.Transactional="transactional",K.TextOnlyTransactional="textOnlyTransactional",K.Undo="undo",(t.StaticRegistrationOptions||(t.StaticRegistrationOptions={})).hasId=function(e){const t=e;return t&&r.string(t.id)&&t.id.length>0},(t.TextDocumentRegistrationOptions||(t.TextDocumentRegistrationOptions={})).is=function(e){const t=e;return t&&(null===t.documentSelector||g.is(t.documentSelector))},(W=t.WorkDoneProgressOptions||(t.WorkDoneProgressOptions={})).is=function(e){const t=e;return r.objectLiteral(t)&&(void 0===t.workDoneProgress||r.boolean(t.workDoneProgress))},W.hasWorkDoneProgress=function(e){const t=e;return t&&r.boolean(t.workDoneProgress)},(t.InitializeRequest||(t.InitializeRequest={})).type=new s.ProtocolRequestType("initialize"),(t.InitializeError||(t.InitializeError={})).unknownProtocolVersion=1,(t.InitializedNotification||(t.InitializedNotification={})).type=new s.ProtocolNotificationType("initialized"),(t.ShutdownRequest||(t.ShutdownRequest={})).type=new s.ProtocolRequestType0("shutdown"),(t.ExitNotification||(t.ExitNotification={})).type=new s.ProtocolNotificationType0("exit"),(t.DidChangeConfigurationNotification||(t.DidChangeConfigurationNotification={})).type=new s.ProtocolNotificationType("workspace/didChangeConfiguration"),(H=t.MessageType||(t.MessageType={})).Error=1,H.Warning=2,H.Info=3,H.Log=4,(t.ShowMessageNotification||(t.ShowMessageNotification={})).type=new s.ProtocolNotificationType("window/showMessage"),(t.ShowMessageRequest||(t.ShowMessageRequest={})).type=new s.ProtocolRequestType("window/showMessageRequest"),(t.LogMessageNotification||(t.LogMessageNotification={})).type=new s.ProtocolNotificationType("window/logMessage"),(t.TelemetryEventNotification||(t.TelemetryEventNotification={})).type=new s.ProtocolNotificationType("telemetry/event"),($=t.TextDocumentSyncKind||(t.TextDocumentSyncKind={})).None=0,$.Full=1,$.Incremental=2,(X=t.DidOpenTextDocumentNotification||(t.DidOpenTextDocumentNotification={})).method="textDocument/didOpen",X.type=new s.ProtocolNotificationType(X.method),(J=t.DidChangeTextDocumentNotification||(t.DidChangeTextDocumentNotification={})).method="textDocument/didChange",J.type=new s.ProtocolNotificationType(J.method),(U=t.DidCloseTextDocumentNotification||(t.DidCloseTextDocumentNotification={})).method="textDocument/didClose",U.type=new s.ProtocolNotificationType(U.method),(j=t.DidSaveTextDocumentNotification||(t.DidSaveTextDocumentNotification={})).method="textDocument/didSave",j.type=new s.ProtocolNotificationType(j.method),(z=t.TextDocumentSaveReason||(t.TextDocumentSaveReason={})).Manual=1,z.AfterDelay=2,z.FocusOut=3,(O=t.WillSaveTextDocumentNotification||(t.WillSaveTextDocumentNotification={})).method="textDocument/willSave",O.type=new s.ProtocolNotificationType(O.method),(P=t.WillSaveTextDocumentWaitUntilRequest||(t.WillSaveTextDocumentWaitUntilRequest={})).method="textDocument/willSaveWaitUntil",P.type=new s.ProtocolRequestType(P.method),(t.DidChangeWatchedFilesNotification||(t.DidChangeWatchedFilesNotification={})).type=new s.ProtocolNotificationType("workspace/didChangeWatchedFiles"),(q=t.FileChangeType||(t.FileChangeType={})).Created=1,q.Changed=2,q.Deleted=3,(L=t.WatchKind||(t.WatchKind={})).Create=1,L.Change=2,L.Delete=4,(t.PublishDiagnosticsNotification||(t.PublishDiagnosticsNotification={})).type=new s.ProtocolNotificationType("textDocument/publishDiagnostics"),(B=t.CompletionTriggerKind||(t.CompletionTriggerKind={})).Invoked=1,B.TriggerCharacter=2,B.TriggerForIncompleteCompletions=3,(I=t.CompletionRequest||(t.CompletionRequest={})).method="textDocument/completion",I.type=new s.ProtocolRequestType(I.method),I.resultType=new i.ProgressType,(R=t.CompletionResolveRequest||(t.CompletionResolveRequest={})).method="completionItem/resolve",R.type=new s.ProtocolRequestType(R.method),(M=t.HoverRequest||(t.HoverRequest={})).method="textDocument/hover",M.type=new s.ProtocolRequestType(M.method),(N=t.SignatureHelpTriggerKind||(t.SignatureHelpTriggerKind={})).Invoked=1,N.TriggerCharacter=2,N.ContentChange=3,(T=t.SignatureHelpRequest||(t.SignatureHelpRequest={})).method="textDocument/signatureHelp",T.type=new s.ProtocolRequestType(T.method),(F=t.DefinitionRequest||(t.DefinitionRequest={})).method="textDocument/definition",F.type=new s.ProtocolRequestType(F.method),F.resultType=new i.ProgressType,(_=t.ReferencesRequest||(t.ReferencesRequest={})).method="textDocument/references",_.type=new s.ProtocolRequestType(_.method),_.resultType=new i.ProgressType,(S=t.DocumentHighlightRequest||(t.DocumentHighlightRequest={})).method="textDocument/documentHighlight",S.type=new s.ProtocolRequestType(S.method),S.resultType=new i.ProgressType,(w=t.DocumentSymbolRequest||(t.DocumentSymbolRequest={})).method="textDocument/documentSymbol",w.type=new s.ProtocolRequestType(w.method),w.resultType=new i.ProgressType,(A=t.CodeActionRequest||(t.CodeActionRequest={})).method="textDocument/codeAction",A.type=new s.ProtocolRequestType(A.method),A.resultType=new i.ProgressType,(b=t.WorkspaceSymbolRequest||(t.WorkspaceSymbolRequest={})).method="workspace/symbol",b.type=new s.ProtocolRequestType(b.method),b.resultType=new i.ProgressType,(k=t.CodeLensRequest||(t.CodeLensRequest={})).type=new s.ProtocolRequestType("textDocument/codeLens"),k.resultType=new i.ProgressType,(t.CodeLensResolveRequest||(t.CodeLensResolveRequest={})).type=new s.ProtocolRequestType("codeLens/resolve"),(E=t.DocumentLinkRequest||(t.DocumentLinkRequest={})).method="textDocument/documentLink",E.type=new s.ProtocolRequestType(E.method),E.resultType=new i.ProgressType,(t.DocumentLinkResolveRequest||(t.DocumentLinkResolveRequest={})).type=new s.ProtocolRequestType("documentLink/resolve"),(v=t.DocumentFormattingRequest||(t.DocumentFormattingRequest={})).method="textDocument/formatting",v.type=new s.ProtocolRequestType(v.method),(C=t.DocumentRangeFormattingRequest||(t.DocumentRangeFormattingRequest={})).method="textDocument/rangeFormatting",C.type=new s.ProtocolRequestType(C.method),(D=t.DocumentOnTypeFormattingRequest||(t.DocumentOnTypeFormattingRequest={})).method="textDocument/onTypeFormatting",D.type=new s.ProtocolRequestType(D.method),(y=t.RenameRequest||(t.RenameRequest={})).method="textDocument/rename",y.type=new s.ProtocolRequestType(y.method),(x=t.PrepareRenameRequest||(t.PrepareRenameRequest={})).method="textDocument/prepareRename",x.type=new s.ProtocolRequestType(x.method),(t.ExecuteCommandRequest||(t.ExecuteCommandRequest={})).type=new s.ProtocolRequestType("workspace/executeCommand"),(t.ApplyWorkspaceEditRequest||(t.ApplyWorkspaceEditRequest={})).type=new s.ProtocolRequestType("workspace/applyEdit")},(e,t)=>{"use strict";function n(e){return"string"==typeof e||e instanceof String}function r(e){return Array.isArray(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.boolean=function(e){return!0===e||!1===e},t.string=n,t.number=function(e){return"number"==typeof e||e instanceof Number},t.error=function(e){return e instanceof Error},t.func=function(e){return"function"==typeof e},t.array=r,t.stringArray=function(e){return r(e)&&e.every((e=>n(e)))},t.typedArray=function(e,t){return Array.isArray(e)&&e.every(t)},t.objectLiteral=function(e){return null!==e&&"object"==typeof e}},(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(165);class i extends r.RequestType0{constructor(e){super(e)}}t.ProtocolRequestType0=i;class s extends r.RequestType{constructor(e){super(e)}}t.ProtocolRequestType=s;class o extends r.NotificationType{constructor(e){super(e)}}t.ProtocolNotificationType=o;class a extends r.NotificationType0{constructor(e){super(e)}}t.ProtocolNotificationType0=a},(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(165),i=n(180);var s;(s=t.ImplementationRequest||(t.ImplementationRequest={})).method="textDocument/implementation",s.type=new i.ProtocolRequestType(s.method),s.resultType=new r.ProgressType},(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(165),i=n(180);var s;(s=t.TypeDefinitionRequest||(t.TypeDefinitionRequest={})).method="textDocument/typeDefinition",s.type=new i.ProtocolRequestType(s.method),s.resultType=new r.ProgressType},(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(180);(t.WorkspaceFoldersRequest||(t.WorkspaceFoldersRequest={})).type=new r.ProtocolRequestType0("workspace/workspaceFolders"),(t.DidChangeWorkspaceFoldersNotification||(t.DidChangeWorkspaceFoldersNotification={})).type=new r.ProtocolNotificationType("workspace/didChangeWorkspaceFolders")},(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(180);(t.ConfigurationRequest||(t.ConfigurationRequest={})).type=new r.ProtocolRequestType("workspace/configuration")},(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(165),i=n(180);var s;(s=t.DocumentColorRequest||(t.DocumentColorRequest={})).method="textDocument/documentColor",s.type=new i.ProtocolRequestType(s.method),s.resultType=new r.ProgressType,(t.ColorPresentationRequest||(t.ColorPresentationRequest={})).type=new i.ProtocolRequestType("textDocument/colorPresentation")},(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(165),i=n(180);var s,o;(o=t.FoldingRangeKind||(t.FoldingRangeKind={})).Comment="comment",o.Imports="imports",o.Region="region",(s=t.FoldingRangeRequest||(t.FoldingRangeRequest={})).method="textDocument/foldingRange",s.type=new i.ProtocolRequestType(s.method),s.resultType=new r.ProgressType},(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(165),i=n(180);var s;(s=t.DeclarationRequest||(t.DeclarationRequest={})).method="textDocument/declaration",s.type=new i.ProtocolRequestType(s.method),s.resultType=new r.ProgressType},(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(165),i=n(180);var s;(s=t.SelectionRangeRequest||(t.SelectionRangeRequest={})).method="textDocument/selectionRange",s.type=new i.ProtocolRequestType(s.method),s.resultType=new r.ProgressType},(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(165),i=n(180);(t.WorkDoneProgress||(t.WorkDoneProgress={})).type=new r.ProgressType,(t.WorkDoneProgressCreateRequest||(t.WorkDoneProgressCreateRequest={})).type=new i.ProtocolRequestType("window/workDoneProgress/create"),(t.WorkDoneProgressCancelNotification||(t.WorkDoneProgressCancelNotification={})).type=new i.ProtocolNotificationType("window/workDoneProgress/cancel")},(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(180);var i,s,o;(o=t.CallHierarchyPrepareRequest||(t.CallHierarchyPrepareRequest={})).method="textDocument/prepareCallHierarchy",o.type=new r.ProtocolRequestType(o.method),(s=t.CallHierarchyIncomingCallsRequest||(t.CallHierarchyIncomingCallsRequest={})).method="callHierarchy/incomingCalls",s.type=new r.ProtocolRequestType(s.method),(i=t.CallHierarchyOutgoingCallsRequest||(t.CallHierarchyOutgoingCallsRequest={})).method="callHierarchy/outgoingCalls",i.type=new r.ProtocolRequestType(i.method)},(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(180);var i,s,o,a,u;(u=t.SemanticTokenTypes||(t.SemanticTokenTypes={})).comment="comment",u.keyword="keyword",u.string="string",u.number="number",u.regexp="regexp",u.operator="operator",u.namespace="namespace",u.type="type",u.struct="struct",u.class="class",u.interface="interface",u.enum="enum",u.typeParameter="typeParameter",u.function="function",u.member="member",u.property="property",u.macro="macro",u.variable="variable",u.parameter="parameter",u.label="label",(a=t.SemanticTokenModifiers||(t.SemanticTokenModifiers={})).documentation="documentation",a.declaration="declaration",a.definition="definition",a.reference="reference",a.static="static",a.abstract="abstract",a.deprecated="deprecated",a.async="async",a.volatile="volatile",a.readonly="readonly",(t.SemanticTokens||(t.SemanticTokens={})).is=function(e){const t=e;return void 0!==t&&(void 0===t.resultId||"string"==typeof t.resultId)&&Array.isArray(t.data)&&(0===t.data.length||"number"==typeof t.data[0])},(o=t.SemanticTokensRequest||(t.SemanticTokensRequest={})).method="textDocument/semanticTokens",o.type=new r.ProtocolRequestType(o.method),(s=t.SemanticTokensEditsRequest||(t.SemanticTokensEditsRequest={})).method="textDocument/semanticTokens/edits",s.type=new r.ProtocolRequestType(s.method),(i=t.SemanticTokensRangeRequest||(t.SemanticTokensRangeRequest={})).method="textDocument/semanticTokens/range",i.type=new r.ProtocolRequestType(i.method)}],t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={exports:{}};return e[r].call(i.exports,i,i.exports,n),i.exports}return n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n(0)})());
\ No newline at end of file