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EAAI,EAAO,GAAO,OAAO,gBAAgB,EAAI,EAAO,EAAK,EAAG,OAAO,MAAM,gBAAgB,SAAW,IAC/K,yBAA4B,WAC5B,SAAS,EAAyB,GAC9B,IAAI,EAAa,gBAAgB,EAAG,QACpC,KAAK,WAAa,CACd,YACA,YACA,QACA,QACA,eACA,QACA,SACA,QACA,SACF,OAAO,wBAAwB,cAAe,GAChD,IAAI,EAAQ,wBAAwB,WAAW,OAAO,GACtD,KAAK,WAAW,SAAQ,SAAU,GAAQ,OAAO,EAAM,QAAQ,EAAO,GAC1E,CAKA,OAJA,EAAyB,UAAU,OAAS,SAAU,GAClD,IAAI,EAAQ,wBAAwB,WAAW,OAAO,GACtD,KAAK,WAAW,SAAQ,SAAU,GAAQ,OAAO,EAAM,WAAW,EAAO,GAC7E,EACO,CACX,CAtB+B,GAuB/B,QAAQ,yBAA2B,yBAEnC,OAAO,eAAe,yBAA0B,OAAQ,CAAE,MAAO,6BACjE,OAAO,eAAe,QAAS,aAAc,CAAE,OAAO,IACtD,QAAQ,QAAU,IAAI,wBAAwB,OAAO","file":"/npm/ak-editor-plugin-markdown-inputrules@5.5.2/dist/es5/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.37.0.\n * Original file: /npm/ak-editor-plugin-markdown-inputrules@5.5.2/dist/es5/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","\"use strict\";\nvar ak_editor_prosemirror_1 = require(\"ak-editor-prosemirror\");\n// NOTE: There is a built in input rule for ordered lists in ProseMirror. However, that\n// input rule will allow for a list to start at any given number, which isn't allowed in\n// markdown (where a ordered list will always start on 1). This is a slightly modified\n// version of that input rule.\nfunction orderedListRule(nodeType) {\n    return ak_editor_prosemirror_1.wrappingInputRule(/^(\\d+)\\. $/, \" \", nodeType, function (match) { return ({}); }, function (match, node) { return node.childCount; });\n}\nvar buildBlockRules = function (schema) {\n    var rules = Array();\n    if (schema.nodes.heading) {\n        rules.push(ak_editor_prosemirror_1.headingRule(schema.nodes.heading, 3));\n    }\n    if (schema.nodes.bullet_list) {\n        rules.push(ak_editor_prosemirror_1.bulletListRule(schema.nodes.bullet_list));\n    }\n    if (schema.nodes.ordered_list) {\n        rules.push(orderedListRule(schema.nodes.ordered_list));\n    }\n    if (schema.nodes.blockquote) {\n        rules.push(ak_editor_prosemirror_1.blockQuoteRule(schema.nodes.blockquote));\n    }\n    if (schema.nodes.code_block) {\n        rules.push(ak_editor_prosemirror_1.codeBlockRule(schema.nodes.code_block));\n    }\n    return rules;\n};\nfunction replaceWithNode(pm, match, pos, node) {\n    var start = pos - match[0].length;\n    var end = pos;\n    pm.tr.delete(start, end).insert(start, node).apply();\n    return true;\n}\nfunction replaceWithMark(pm, match, pos, mark) {\n    var schema = pm.schema;\n    var to = pos;\n    var from = pos - match[1].length;\n    var markType = schema.mark(mark);\n    var marks = pm.tr.doc.marksAt(pos).concat([markType]);\n    pm.tr.replaceWith(from, to, schema.text(match[2], marks)).apply();\n    pm.removeActiveMark(markType);\n    return true;\n}\n// [something](link) should convert to a hyperlink\nvar linkRule = new ak_editor_prosemirror_1.InputRule(/\\[(\\S+)\\]\\((\\S+)\\)$/, ')', function (pm, match, pos) {\n    var schema = pm.schema;\n    var to = pos;\n    var from = pos - match[0].length;\n    var markType = schema.mark('link', {\n        href: match[2],\n    });\n    pm.tr.replaceWith(from, to, schema.text(match[1], markType)).apply();\n    pm.removeActiveMark(markType);\n    return true;\n});\n// ![Image](http://url/a.png) should add an image\n// Note: You have to load this rule before the link rule.\nvar imgRule = new ak_editor_prosemirror_1.InputRule(/!\\[(\\S+)\\]\\((\\S+)\\)$/, ')', function (pm, match, pos) {\n    var attrs = {\n        src: match[2],\n        alt: match[1],\n        title: match[1],\n    };\n    var node = pm.schema.nodes.image.create(attrs);\n    return replaceWithNode(pm, match, pos, node);\n});\n// **string** should bold the text\nvar strongRule1 = new ak_editor_prosemirror_1.InputRule(/(\\*\\*([^\\*]+)\\*\\*)$/, '*', function (pm, match, pos) { return replaceWithMark(pm, match, pos, 'strong'); });\n// __string__ should bold the text\nvar strongRule2 = new ak_editor_prosemirror_1.InputRule(/(__([^_]+)__)$/, '_', function (pm, match, pos) { return replaceWithMark(pm, match, pos, 'strong'); });\n// _string_ or *string* should change the text to italic\nvar emRule1 = new ak_editor_prosemirror_1.InputRule(/(?:[^\\*]+)(\\*([^\\*]+?)\\*)$|^(\\*([^\\*]+)\\*)$/, '*', function (pm, match, pos) { return replaceWithMark(pm, match.filter(function (m) { return m !== undefined; }), pos, 'em'); });\nvar emRule2 = new ak_editor_prosemirror_1.InputRule(/(?:[^_]+)(_([^_]+?)_)$|^(_([^_]+)_)$/, '_', function (pm, match, pos) { return replaceWithMark(pm, match.filter(function (m) { return m !== undefined; }), pos, 'em'); });\n// `string` should change the current text to inline code block\nvar inlineCodeRule = new ak_editor_prosemirror_1.InputRule(/(`([^`]+)`)$/, '`', function (pm, match, pos) { return replaceWithMark(pm, match, pos, 'code'); });\n// --- or *** should add a horizontal line\nvar hrRule1 = new ak_editor_prosemirror_1.InputRule(/^\\*\\*\\*$/, '*', function (pm, match, pos) { return replaceWithNode(pm, match, pos, pm.schema.nodes.horizontal_rule.create()); });\nvar hrRule2 = new ak_editor_prosemirror_1.InputRule(/^\\-\\-\\-$/, '-', function (pm, match, pos) { return replaceWithNode(pm, match, pos, pm.schema.nodes.horizontal_rule.create()); });\nvar MarkdownInputRulesPlugin = (function () {\n    function MarkdownInputRulesPlugin(pm) {\n        var blockRules = buildBlockRules(pm.schema);\n        this.inputRules = [\n            strongRule1,\n            strongRule2,\n            emRule1,\n            emRule2,\n            inlineCodeRule,\n            imgRule,\n            linkRule,\n            hrRule1,\n            hrRule2\n        ].concat(ak_editor_prosemirror_1.allInputRules, blockRules);\n        var rules = ak_editor_prosemirror_1.inputRules.ensure(pm);\n        this.inputRules.forEach(function (rule) { return rules.addRule(rule); });\n    }\n    MarkdownInputRulesPlugin.prototype.detach = function (pm) {\n        var rules = ak_editor_prosemirror_1.inputRules.ensure(pm);\n        this.inputRules.forEach(function (rule) { return rules.removeRule(rule); });\n    };\n    return MarkdownInputRulesPlugin;\n}());\nexports.MarkdownInputRulesPlugin = MarkdownInputRulesPlugin;\n// IE11 + multiple prosemirror fix.\nObject.defineProperty(MarkdownInputRulesPlugin, 'name', { value: 'MarkdownInputRulesPlugin' });\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = new ak_editor_prosemirror_1.Plugin(MarkdownInputRulesPlugin);\n"]}