hackmd-to-html-cli
Version:
A node.js CLI tool for converting HackMD markdown to HTML.
96 lines (73 loc) • 4.82 MB
JavaScript
/*
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
* This devtool is neither made for production nor for readable output files.
* It uses "eval()" calls to create a separate source file in the browser devtools.
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
* or disable the default devtool with "devtool: false".
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
*/
var hmd2html;
/******/ (() => { // webpackBootstrap
/******/ var __webpack_modules__ = ({
/***/ "./node_modules/boolbase/index.js":
/*!****************************************!*\
!*** ./node_modules/boolbase/index.js ***!
\****************************************/
/***/ ((module) => {
eval("module.exports = {\n\ttrueFunc: function trueFunc(){\n\t\treturn true;\n\t},\n\tfalseFunc: function falseFunc(){\n\t\treturn false;\n\t}\n};\n\n//# sourceURL=webpack://hmd2html/./node_modules/boolbase/index.js?");
/***/ }),
/***/ "./node_modules/cheerio-select/lib/helpers.js":
/*!****************************************************!*\
!*** ./node_modules/cheerio-select/lib/helpers.js ***!
\****************************************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
"use strict";
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.groupSelectors = exports.getDocumentRoot = void 0;\nvar positionals_1 = __webpack_require__(/*! ./positionals */ \"./node_modules/cheerio-select/lib/positionals.js\");\nfunction getDocumentRoot(node) {\n while (node.parent)\n node = node.parent;\n return node;\n}\nexports.getDocumentRoot = getDocumentRoot;\nfunction groupSelectors(selectors) {\n var filteredSelectors = [];\n var plainSelectors = [];\n for (var _i = 0, selectors_1 = selectors; _i < selectors_1.length; _i++) {\n var selector = selectors_1[_i];\n if (selector.some(positionals_1.isFilter)) {\n filteredSelectors.push(selector);\n }\n else {\n plainSelectors.push(selector);\n }\n }\n return [plainSelectors, filteredSelectors];\n}\nexports.groupSelectors = groupSelectors;\n\n\n//# sourceURL=webpack://hmd2html/./node_modules/cheerio-select/lib/helpers.js?");
/***/ }),
/***/ "./node_modules/cheerio-select/lib/index.js":
/*!**************************************************!*\
!*** ./node_modules/cheerio-select/lib/index.js ***!
\**************************************************/
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
eval("\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.select = exports.filter = exports.some = exports.is = exports.aliases = exports.pseudos = exports.filters = void 0;\nvar css_what_1 = __webpack_require__(/*! css-what */ \"./node_modules/css-what/lib/es/index.js\");\nvar css_select_1 = __webpack_require__(/*! css-select */ \"./node_modules/css-select/lib/index.js\");\nvar DomUtils = __importStar(__webpack_require__(/*! domutils */ \"./node_modules/domutils/lib/index.js\"));\nvar helpers_1 = __webpack_require__(/*! ./helpers */ \"./node_modules/cheerio-select/lib/helpers.js\");\nvar positionals_1 = __webpack_require__(/*! ./positionals */ \"./node_modules/cheerio-select/lib/positionals.js\");\n// Re-export pseudo extension points\nvar css_select_2 = __webpack_require__(/*! css-select */ \"./node_modules/css-select/lib/index.js\");\nObject.defineProperty(exports, \"filters\", ({ enumerable: true, get: function () { return css_select_2.filters; } }));\nObject.defineProperty(exports, \"pseudos\", ({ enumerable: true, get: function () { return css_select_2.pseudos; } }));\nObject.defineProperty(exports, \"aliases\", ({ enumerable: true, get: function () { return css_select_2.aliases; } }));\n/** Used to indicate a scope should be filtered. Might be ignored when filtering. */\nvar SCOPE_PSEUDO = {\n type: css_what_1.SelectorType.Pseudo,\n name: \"scope\",\n data: null,\n};\n/** Used for actually filtering for scope. */\nvar CUSTOM_SCOPE_PSEUDO = __assign({}, SCOPE_PSEUDO);\nvar UNIVERSAL_SELECTOR = {\n type: css_what_1.SelectorType.Universal,\n namespace: null,\n};\nfunction is(element, selector, options) {\n if (options === void 0) { options = {}; }\n return some([element], selector, options);\n}\nexports.is = is;\nfunction some(elements, selector, options) {\n if (options === void 0) { options = {}; }\n if (typeof selector === \"function\")\n return elements.some(selector);\n var _a = (0, helpers_1.groupSelectors)((0, css_what_1.parse)(selector)), plain = _a[0], filtered = _a[1];\n return ((plain.length > 0 && elements.some((0, css_select_1._compileToken)(plain, options))) ||\n filtered.some(function (sel) { return filterBySelector(sel, elements, options).length > 0; }));\n}\nexports.some = some;\nfunction filterByPosition(filter, elems, data, options) {\n var num = typeof data === \"string\" ? parseInt(data, 10) : NaN;\n switch (filter) {\n case \"first\":\n case \"lt\":\n // Already done in `getLimit`\n return elems;\n case \"last\":\n return elems.length > 0 ? [elems[elems.length - 1]] : elems;\n case \"nth\":\n case \"eq\":\n return isFinite(num) && Math.abs(num) < elems.length\n ? [num < 0 ? elems[elems.length + num] : elems[num]]\n : [];\n case \"gt\":\n return isFinite(num) ? elems.slice(num + 1) : [];\n case \"even\":\n return elems.filter(function (_, i) { return i % 2 === 0; });\n case \"odd\":\n return elems.filter(function (_, i) { return i % 2 === 1; });\n case \"not\": {\n var filtered_1 = new Set(filterParsed(data, elems, options));\n return elems.filter(function (e) { return !filtered_1.has(e); });\n }\n }\n}\nfunction filter(selector, elements, options) {\n if (options === void 0) { options = {}; }\n return filterParsed((0, css_what_1.parse)(selector), elements, options);\n}\nexports.filter = filter;\n/**\n * Filter a set of elements by a selector.\n *\n * Will return elements in the original order.\n *\n * @param selector Selector to filter by.\n * @param elements Elements to filter.\n * @param options Options for selector.\n */\nfunction filterParsed(selector, elements, options) {\n if (elements.length === 0)\n return [];\n var _a = (0, helpers_1.groupSelectors)(selector), plainSelectors = _a[0], filteredSelectors = _a[1];\n var found;\n if (plainSelectors.length) {\n var filtered = filterElements(elements, plainSelectors, options);\n // If there are no filters, just return\n if (filteredSelectors.length === 0) {\n return filtered;\n }\n // Otherwise, we have to do some filtering\n if (filtered.length) {\n found = new Set(filtered);\n }\n }\n for (var i = 0; i < filteredSelectors.length && (found === null || found === void 0 ? void 0 : found.size) !== elements.length; i++) {\n var filteredSelector = filteredSelectors[i];\n var missing = found\n ? elements.filter(function (e) { return DomUtils.isTag(e) && !found.has(e); })\n : elements;\n if (missing.length === 0)\n break;\n var filtered = filterBySelector(filteredSelector, elements, options);\n if (filtered.length) {\n if (!found) {\n /*\n * If we haven't found anything before the last selector,\n * just return what we found now.\n */\n if (i === filteredSelectors.length - 1) {\n return filtered;\n }\n found = new Set(filtered);\n }\n else {\n filtered.forEach(function (el) { return found.add(el); });\n }\n }\n }\n return typeof found !== \"undefined\"\n ? (found.size === elements.length\n ? elements\n : // Filter elements to preserve order\n elements.filter(function (el) {\n return found.has(el);\n }))\n : [];\n}\nfunction filterBySelector(selector, elements, options) {\n var _a;\n if (selector.some(css_what_1.isTraversal)) {\n /*\n * Get root node, run selector with the scope\n * set to all of our nodes.\n */\n var root = (_a = options.root) !== null && _a !== void 0 ? _a : (0, helpers_1.getDocumentRoot)(elements[0]);\n var sel = __spreadArray(__spreadArray([], selector, true), [CUSTOM_SCOPE_PSEUDO], false);\n return findFilterElements(root, sel, options, true, elements);\n }\n // Performance optimization: If we don't have to traverse, just filter set.\n return findFilterElements(elements, selector, options, false);\n}\nfunction select(selector, root, options) {\n if (options === void 0) { options = {}; }\n if (typeof selector === \"function\") {\n return find(root, selector);\n }\n var _a = (0, helpers_1.groupSelectors)((0, css_what_1.parse)(selector)), plain = _a[0], filtered = _a[1];\n var results = filtered.map(function (sel) {\n return findFilterElements(root, sel, options, true);\n });\n // Plain selectors can be queried in a single go\n if (plain.length) {\n results.push(findElements(root, plain, options, Infinity));\n }\n if (results.length === 0) {\n return [];\n }\n // If there was only a single selector, just return the result\n if (results.length === 1) {\n return results[0];\n }\n // Sort results, filtering for duplicates\n return DomUtils.uniqueSort(results.reduce(function (a, b) { return __spreadArray(__spreadArray([], a, true), b, true); }));\n}\nexports.select = select;\n// Traversals that are treated differently in css-select.\nvar specialTraversal = new Set([\n css_what_1.SelectorType.Descendant,\n css_what_1.SelectorType.Adjacent,\n]);\nfunction includesScopePseudo(t) {\n return (t !== SCOPE_PSEUDO &&\n t.type === \"pseudo\" &&\n (t.name === \"scope\" ||\n (Array.isArray(t.data) &&\n t.data.some(function (data) { return data.some(includesScopePseudo); }))));\n}\nfunction addContextIfScope(selector, options, scopeContext) {\n return scopeContext && selector.some(includesScopePseudo)\n ? __assign(__assign({}, options), { context: scopeContext }) : options;\n}\n/**\n *\n * @param root Element(s) to search from.\n * @param selector Selector to look for.\n * @param options Options for querying.\n * @param queryForSelector Query multiple levels deep for the initial selector, even if it doesn't contain a traversal.\n * @param scopeContext Optional context for a :scope.\n */\nfunction findFilterElements(root, selector, options, queryForSelector, scopeContext) {\n var filterIndex = selector.findIndex(positionals_1.isFilter);\n var sub = selector.slice(0, filterIndex);\n var filter = selector[filterIndex];\n /*\n * Set the number of elements to retrieve.\n * Eg. for :first, we only have to get a single element.\n */\n var limit = (0, positionals_1.getLimit)(filter.name, filter.data);\n if (limit === 0)\n return [];\n var subOpts = addContextIfScope(sub, options, scopeContext);\n /*\n * Skip `findElements` call if our selector starts with a positional\n * pseudo.\n */\n var elemsNoLimit = sub.length === 0 && !Array.isArray(root)\n ? DomUtils.getChildren(root).filter(DomUtils.isTag)\n : sub.length === 0 || (sub.length === 1 && sub[0] === SCOPE_PSEUDO)\n ? (Array.isArray(root) ? root : [root]).filter(DomUtils.isTag)\n : queryForSelector || sub.some(css_what_1.isTraversal)\n ? findElements(root, [sub], subOpts, limit)\n : filterElements(root, [sub], subOpts);\n var elems = elemsNoLimit.slice(0, limit);\n var result = filterByPosition(filter.name, elems, filter.data, options);\n if (result.length === 0 || selector.length === filterIndex + 1) {\n return result;\n }\n var remainingSelector = selector.slice(filterIndex + 1);\n var remainingHasTraversal = remainingSelector.some(css_what_1.isTraversal);\n var remainingOpts = addContextIfScope(remainingSelector, options, scopeContext);\n if (remainingHasTraversal) {\n /*\n * Some types of traversals have special logic when they start a selector\n * in css-select. If this is the case, add a universal selector in front of\n * the selector to avoid this behavior.\n */\n if (specialTraversal.has(remainingSelector[0].type)) {\n remainingSelector.unshift(UNIVERSAL_SELECTOR);\n }\n /*\n * Add a scope token in front of the remaining selector,\n * to make sure traversals don't match elements that aren't a\n * part of the considered tree.\n */\n remainingSelector.unshift(SCOPE_PSEUDO);\n }\n /*\n * If we have another filter, recursively call `findFilterElements`,\n * with the `recursive` flag disabled. We only have to look for more\n * elements when we see a traversal.\n *\n * Otherwise,\n */\n return remainingSelector.some(positionals_1.isFilter)\n ? findFilterElements(result, remainingSelector, options, false, scopeContext)\n : remainingHasTraversal\n ? // Query existing elements to resolve traversal.\n findElements(result, [remainingSelector], remainingOpts, Infinity)\n : // If we don't have any more traversals, simply filter elements.\n filterElements(result, [remainingSelector], remainingOpts);\n}\nfunction findElements(root, sel, options, limit) {\n if (limit === 0)\n return [];\n var query = (0, css_select_1._compileToken)(sel, options, root);\n return find(root, query, limit);\n}\nfunction find(root, query, limit) {\n if (limit === void 0) { limit = Infinity; }\n var elems = (0, css_select_1.prepareContext)(root, DomUtils, query.shouldTestNextSiblings);\n return DomUtils.find(function (node) { return DomUtils.isTag(node) && query(node); }, elems, true, limit);\n}\nfunction filterElements(elements, sel, options) {\n var els = (Array.isArray(elements) ? elements : [elements]).filter(DomUtils.isTag);\n if (els.length === 0)\n return els;\n var query = (0, css_select_1._compileToken)(sel, options);\n return els.filter(query);\n}\n\n\n//# sourceURL=webpack://hmd2html/./node_modules/cheerio-select/lib/index.js?");
/***/ }),
/***/ "./node_modules/cheerio-select/lib/positionals.js":
/*!********************************************************!*\
!*** ./node_modules/cheerio-select/lib/positionals.js ***!
\********************************************************/
/***/ ((__unused_webpack_module, exports) => {
"use strict";
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.getLimit = exports.isFilter = exports.filterNames = void 0;\nexports.filterNames = new Set([\n \"first\",\n \"last\",\n \"eq\",\n \"gt\",\n \"nth\",\n \"lt\",\n \"even\",\n \"odd\",\n]);\nfunction isFilter(s) {\n if (s.type !== \"pseudo\")\n return false;\n if (exports.filterNames.has(s.name))\n return true;\n if (s.name === \"not\" && Array.isArray(s.data)) {\n // Only consider `:not` with embedded filters\n return s.data.some(function (s) { return s.some(isFilter); });\n }\n return false;\n}\nexports.isFilter = isFilter;\nfunction getLimit(filter, data) {\n var num = data != null ? parseInt(data, 10) : NaN;\n switch (filter) {\n case \"first\":\n return 1;\n case \"nth\":\n case \"eq\":\n return isFinite(num) ? (num >= 0 ? num + 1 : Infinity) : 0;\n case \"lt\":\n return isFinite(num) ? (num >= 0 ? num : Infinity) : 0;\n case \"gt\":\n return isFinite(num) ? Infinity : 0;\n default:\n return Infinity;\n }\n}\nexports.getLimit = getLimit;\n\n\n//# sourceURL=webpack://hmd2html/./node_modules/cheerio-select/lib/positionals.js?");
/***/ }),
/***/ "./node_modules/cheerio/lib/api/attributes.js":
/*!****************************************************!*\
!*** ./node_modules/cheerio/lib/api/attributes.js ***!
\****************************************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
"use strict";
eval("\n/**\n * Methods for getting and modifying attributes.\n *\n * @module cheerio/attributes\n */\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.toggleClass = exports.removeClass = exports.addClass = exports.hasClass = exports.removeAttr = exports.val = exports.data = exports.prop = exports.attr = void 0;\nvar static_1 = __webpack_require__(/*! ../static */ \"./node_modules/cheerio/lib/static.js\");\nvar utils_1 = __webpack_require__(/*! ../utils */ \"./node_modules/cheerio/lib/utils.js\");\nvar hasOwn = Object.prototype.hasOwnProperty;\nvar rspace = /\\s+/;\nvar dataAttrPrefix = 'data-';\n/*\n * Lookup table for coercing string data-* attributes to their corresponding\n * JavaScript primitives\n */\nvar primitives = {\n null: null,\n true: true,\n false: false,\n};\n// Attributes that are booleans\nvar rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i;\n// Matches strings that look like JSON objects or arrays\nvar rbrace = /^{[^]*}$|^\\[[^]*]$/;\nfunction getAttr(elem, name, xmlMode) {\n var _a;\n if (!elem || !utils_1.isTag(elem))\n return undefined;\n (_a = elem.attribs) !== null && _a !== void 0 ? _a : (elem.attribs = {});\n // Return the entire attribs object if no attribute specified\n if (!name) {\n return elem.attribs;\n }\n if (hasOwn.call(elem.attribs, name)) {\n // Get the (decoded) attribute\n return !xmlMode && rboolean.test(name) ? name : elem.attribs[name];\n }\n // Mimic the DOM and return text content as value for `option's`\n if (elem.name === 'option' && name === 'value') {\n return static_1.text(elem.children);\n }\n // Mimic DOM with default value for radios/checkboxes\n if (elem.name === 'input' &&\n (elem.attribs.type === 'radio' || elem.attribs.type === 'checkbox') &&\n name === 'value') {\n return 'on';\n }\n return undefined;\n}\n/**\n * Sets the value of an attribute. The attribute will be deleted if the value is `null`.\n *\n * @private\n * @param el - The element to set the attribute on.\n * @param name - The attribute's name.\n * @param value - The attribute's value.\n */\nfunction setAttr(el, name, value) {\n if (value === null) {\n removeAttribute(el, name);\n }\n else {\n el.attribs[name] = \"\" + value;\n }\n}\nfunction attr(name, value) {\n // Set the value (with attr map support)\n if (typeof name === 'object' || value !== undefined) {\n if (typeof value === 'function') {\n if (typeof name !== 'string') {\n {\n throw new Error('Bad combination of arguments.');\n }\n }\n return utils_1.domEach(this, function (el, i) {\n if (utils_1.isTag(el))\n setAttr(el, name, value.call(el, i, el.attribs[name]));\n });\n }\n return utils_1.domEach(this, function (el) {\n if (!utils_1.isTag(el))\n return;\n if (typeof name === 'object') {\n Object.keys(name).forEach(function (objName) {\n var objValue = name[objName];\n setAttr(el, objName, objValue);\n });\n }\n else {\n setAttr(el, name, value);\n }\n });\n }\n return arguments.length > 1\n ? this\n : getAttr(this[0], name, this.options.xmlMode);\n}\nexports.attr = attr;\n/**\n * Gets a node's prop.\n *\n * @private\n * @category Attributes\n * @param el - Elenent to get the prop of.\n * @param name - Name of the prop.\n * @returns The prop's value.\n */\nfunction getProp(el, name, xmlMode) {\n if (!el || !utils_1.isTag(el))\n return;\n return name in el\n ? // @ts-expect-error TS doesn't like us accessing the value directly here.\n el[name]\n : !xmlMode && rboolean.test(name)\n ? getAttr(el, name, false) !== undefined\n : getAttr(el, name, xmlMode);\n}\n/**\n * Sets the value of a prop.\n *\n * @private\n * @param el - The element to set the prop on.\n * @param name - The prop's name.\n * @param value - The prop's value.\n */\nfunction setProp(el, name, value, xmlMode) {\n if (name in el) {\n // @ts-expect-error Overriding value\n el[name] = value;\n }\n else {\n setAttr(el, name, !xmlMode && rboolean.test(name) ? (value ? '' : null) : \"\" + value);\n }\n}\nfunction prop(name, value) {\n var _this = this;\n if (typeof name === 'string' && value === undefined) {\n switch (name) {\n case 'style': {\n var property_1 = this.css();\n var keys = Object.keys(property_1);\n keys.forEach(function (p, i) {\n property_1[i] = p;\n });\n property_1.length = keys.length;\n return property_1;\n }\n case 'tagName':\n case 'nodeName': {\n var el = this[0];\n return utils_1.isTag(el) ? el.name.toUpperCase() : undefined;\n }\n case 'outerHTML':\n return this.clone().wrap('<container />').parent().html();\n case 'innerHTML':\n return this.html();\n default:\n return getProp(this[0], name, this.options.xmlMode);\n }\n }\n if (typeof name === 'object' || value !== undefined) {\n if (typeof value === 'function') {\n if (typeof name === 'object') {\n throw new Error('Bad combination of arguments.');\n }\n return utils_1.domEach(this, function (el, i) {\n if (utils_1.isTag(el))\n setProp(el, name, value.call(el, i, getProp(el, name, _this.options.xmlMode)), _this.options.xmlMode);\n });\n }\n return utils_1.domEach(this, function (el) {\n if (!utils_1.isTag(el))\n return;\n if (typeof name === 'object') {\n Object.keys(name).forEach(function (key) {\n var val = name[key];\n setProp(el, key, val, _this.options.xmlMode);\n });\n }\n else {\n setProp(el, name, value, _this.options.xmlMode);\n }\n });\n }\n return undefined;\n}\nexports.prop = prop;\n/**\n * Sets the value of a data attribute.\n *\n * @private\n * @param el - The element to set the data attribute on.\n * @param name - The data attribute's name.\n * @param value - The data attribute's value.\n */\nfunction setData(el, name, value) {\n var _a;\n var elem = el;\n (_a = elem.data) !== null && _a !== void 0 ? _a : (elem.data = {});\n if (typeof name === 'object')\n Object.assign(elem.data, name);\n else if (typeof name === 'string' && value !== undefined) {\n elem.data[name] = value;\n }\n}\n/**\n * Read the specified attribute from the equivalent HTML5 `data-*` attribute,\n * and (if present) cache the value in the node's internal data store. If no\n * attribute name is specified, read *all* HTML5 `data-*` attributes in this manner.\n *\n * @private\n * @category Attributes\n * @param el - Elenent to get the data attribute of.\n * @param name - Name of the data attribute.\n * @returns The data attribute's value, or a map with all of the data attribute.\n */\nfunction readData(el, name) {\n var domNames;\n var jsNames;\n var value;\n if (name == null) {\n domNames = Object.keys(el.attribs).filter(function (attrName) {\n return attrName.startsWith(dataAttrPrefix);\n });\n jsNames = domNames.map(function (domName) {\n return utils_1.camelCase(domName.slice(dataAttrPrefix.length));\n });\n }\n else {\n domNames = [dataAttrPrefix + utils_1.cssCase(name)];\n jsNames = [name];\n }\n for (var idx = 0; idx < domNames.length; ++idx) {\n var domName = domNames[idx];\n var jsName = jsNames[idx];\n if (hasOwn.call(el.attribs, domName) &&\n !hasOwn.call(el.data, jsName)) {\n value = el.attribs[domName];\n if (hasOwn.call(primitives, value)) {\n value = primitives[value];\n }\n else if (value === String(Number(value))) {\n value = Number(value);\n }\n else if (rbrace.test(value)) {\n try {\n value = JSON.parse(value);\n }\n catch (e) {\n /* Ignore */\n }\n }\n el.data[jsName] = value;\n }\n }\n return name == null ? el.data : value;\n}\nfunction data(name, value) {\n var _a;\n var elem = this[0];\n if (!elem || !utils_1.isTag(elem))\n return;\n var dataEl = elem;\n (_a = dataEl.data) !== null && _a !== void 0 ? _a : (dataEl.data = {});\n // Return the entire data object if no data specified\n if (!name) {\n return readData(dataEl);\n }\n // Set the value (with attr map support)\n if (typeof name === 'object' || value !== undefined) {\n utils_1.domEach(this, function (el) {\n if (utils_1.isTag(el))\n if (typeof name === 'object')\n setData(el, name);\n else\n setData(el, name, value);\n });\n return this;\n }\n if (hasOwn.call(dataEl.data, name)) {\n return dataEl.data[name];\n }\n return readData(dataEl, name);\n}\nexports.data = data;\nfunction val(value) {\n var querying = arguments.length === 0;\n var element = this[0];\n if (!element || !utils_1.isTag(element))\n return querying ? undefined : this;\n switch (element.name) {\n case 'textarea':\n return this.text(value);\n case 'select': {\n var option = this.find('option:selected');\n if (!querying) {\n if (this.attr('multiple') == null && typeof value === 'object') {\n return this;\n }\n this.find('option').removeAttr('selected');\n var values = typeof value !== 'object' ? [value] : value;\n for (var i = 0; i < values.length; i++) {\n this.find(\"option[value=\\\"\" + values[i] + \"\\\"]\").attr('selected', '');\n }\n return this;\n }\n return this.attr('multiple')\n ? option.toArray().map(function (el) { return static_1.text(el.children); })\n : option.attr('value');\n }\n case 'input':\n case 'option':\n return querying\n ? this.attr('value')\n : this.attr('value', value);\n }\n return undefined;\n}\nexports.val = val;\n/**\n * Remove an attribute.\n *\n * @private\n * @param elem - Node to remove attribute from.\n * @param name - Name of the attribute to remove.\n */\nfunction removeAttribute(elem, name) {\n if (!elem.attribs || !hasOwn.call(elem.attribs, name))\n return;\n delete elem.attribs[name];\n}\n/**\n * Splits a space-separated list of names to individual names.\n *\n * @category Attributes\n * @param names - Names to split.\n * @returns - Split names.\n */\nfunction splitNames(names) {\n return names ? names.trim().split(rspace) : [];\n}\n/**\n * Method for removing attributes by `name`.\n *\n * @category Attributes\n * @example\n *\n * ```js\n * $('.pear').removeAttr('class').html();\n * //=> <li>Pear</li>\n *\n * $('.apple').attr('id', 'favorite');\n * $('.apple').removeAttr('id class').html();\n * //=> <li>Apple</li>\n * ```\n *\n * @param name - Name of the attribute.\n * @returns The instance itself.\n * @see {@link https://api.jquery.com/removeAttr/}\n */\nfunction removeAttr(name) {\n var attrNames = splitNames(name);\n var _loop_1 = function (i) {\n utils_1.domEach(this_1, function (elem) {\n if (utils_1.isTag(elem))\n removeAttribute(elem, attrNames[i]);\n });\n };\n var this_1 = this;\n for (var i = 0; i < attrNames.length; i++) {\n _loop_1(i);\n }\n return this;\n}\nexports.removeAttr = removeAttr;\n/**\n * Check to see if *any* of the matched elements have the given `className`.\n *\n * @category Attributes\n * @example\n *\n * ```js\n * $('.pear').hasClass('pear');\n * //=> true\n *\n * $('apple').hasClass('fruit');\n * //=> false\n *\n * $('li').hasClass('pear');\n * //=> true\n * ```\n *\n * @param className - Name of the class.\n * @returns Indicates if an element has the given `className`.\n * @see {@link https://api.jquery.com/hasClass/}\n */\nfunction hasClass(className) {\n return this.toArray().some(function (elem) {\n var clazz = utils_1.isTag(elem) && elem.attribs.class;\n var idx = -1;\n if (clazz && className.length) {\n while ((idx = clazz.indexOf(className, idx + 1)) > -1) {\n var end = idx + className.length;\n if ((idx === 0 || rspace.test(clazz[idx - 1])) &&\n (end === clazz.length || rspace.test(clazz[end]))) {\n return true;\n }\n }\n }\n return false;\n });\n}\nexports.hasClass = hasClass;\n/**\n * Adds class(es) to all of the matched elements. Also accepts a `function`.\n *\n * @category Attributes\n * @example\n *\n * ```js\n * $('.pear').addClass('fruit').html();\n * //=> <li class=\"pear fruit\">Pear</li>\n *\n * $('.apple').addClass('fruit red').html();\n * //=> <li class=\"apple fruit red\">Apple</li>\n * ```\n *\n * @param value - Name of new class.\n * @returns The instance itself.\n * @see {@link https://api.jquery.com/addClass/}\n */\nfunction addClass(value) {\n // Support functions\n if (typeof value === 'function') {\n return utils_1.domEach(this, function (el, i) {\n if (utils_1.isTag(el)) {\n var className = el.attribs.class || '';\n addClass.call([el], value.call(el, i, className));\n }\n });\n }\n // Return if no value or not a string or function\n if (!value || typeof value !== 'string')\n return this;\n var classNames = value.split(rspace);\n var numElements = this.length;\n for (var i = 0; i < numElements; i++) {\n var el = this[i];\n // If selected element isn't a tag, move on\n if (!utils_1.isTag(el))\n continue;\n // If we don't already have classes — always set xmlMode to false here, as it doesn't matter for classes\n var className = getAttr(el, 'class', false);\n if (!className) {\n setAttr(el, 'class', classNames.join(' ').trim());\n }\n else {\n var setClass = \" \" + className + \" \";\n // Check if class already exists\n for (var j = 0; j < classNames.length; j++) {\n var appendClass = classNames[j] + \" \";\n if (!setClass.includes(\" \" + appendClass))\n setClass += appendClass;\n }\n setAttr(el, 'class', setClass.trim());\n }\n }\n return this;\n}\nexports.addClass = addClass;\n/**\n * Removes one or more space-separated classes from the selected elements. If no\n * `className` is defined, all classes will be removed. Also accepts a `function`.\n *\n * @category Attributes\n * @example\n *\n * ```js\n * $('.pear').removeClass('pear').html();\n * //=> <li class=\"\">Pear</li>\n *\n * $('.apple').addClass('red').removeClass().html();\n * //=> <li class=\"\">Apple</li>\n * ```\n *\n * @param name - Name of the class. If not specified, removes all elements.\n * @returns The instance itself.\n * @see {@link https://api.jquery.com/removeClass/}\n */\nfunction removeClass(name) {\n // Handle if value is a function\n if (typeof name === 'function') {\n return utils_1.domEach(this, function (el, i) {\n if (utils_1.isTag(el))\n removeClass.call([el], name.call(el, i, el.attribs.class || ''));\n });\n }\n var classes = splitNames(name);\n var numClasses = classes.length;\n var removeAll = arguments.length === 0;\n return utils_1.domEach(this, function (el) {\n if (!utils_1.isTag(el))\n return;\n if (removeAll) {\n // Short circuit the remove all case as this is the nice one\n el.attribs.class = '';\n }\n else {\n var elClasses = splitNames(el.attribs.class);\n var changed = false;\n for (var j = 0; j < numClasses; j++) {\n var index = elClasses.indexOf(classes[j]);\n if (index >= 0) {\n elClasses.splice(index, 1);\n changed = true;\n /*\n * We have to do another pass to ensure that there are not duplicate\n * classes listed\n */\n j--;\n }\n }\n if (changed) {\n el.attribs.class = elClasses.join(' ');\n }\n }\n });\n}\nexports.removeClass = removeClass;\n/**\n * Add or remove class(es) from the matched elements, depending on either the\n * class's presence or the value of the switch argument. Also accepts a `function`.\n *\n * @category Attributes\n * @example\n *\n * ```js\n * $('.apple.green').toggleClass('fruit green red').html();\n * //=> <li class=\"apple fruit red\">Apple</li>\n *\n * $('.apple.green').toggleClass('fruit green red', true).html();\n * //=> <li class=\"apple green fruit red\">Apple</li>\n * ```\n *\n * @param value - Name of the class. Can also be a function.\n * @param stateVal - If specified the state of the class.\n * @returns The instance itself.\n * @see {@link https://api.jquery.com/toggleClass/}\n */\nfunction toggleClass(value, stateVal) {\n // Support functions\n if (typeof value === 'function') {\n return utils_1.domEach(this, function (el, i) {\n if (utils_1.isTag(el)) {\n toggleClass.call([el], value.call(el, i, el.attribs.class || '', stateVal), stateVal);\n }\n });\n }\n // Return if no value or not a string or function\n if (!value || typeof value !== 'string')\n return this;\n var classNames = value.split(rspace);\n var numClasses = classNames.length;\n var state = typeof stateVal === 'boolean' ? (stateVal ? 1 : -1) : 0;\n var numElements = this.length;\n for (var i = 0; i < numElements; i++) {\n var el = this[i];\n // If selected element isn't a tag, move on\n if (!utils_1.isTag(el))\n continue;\n var elementClasses = splitNames(el.attribs.class);\n // Check if class already exists\n for (var j = 0; j < numClasses; j++) {\n // Check if the class name is currently defined\n var index = elementClasses.indexOf(classNames[j]);\n // Add if stateValue === true or we are toggling and there is no value\n if (state >= 0 && index < 0) {\n elementClasses.push(classNames[j]);\n }\n else if (state <= 0 && index >= 0) {\n // Otherwise remove but only if the item exists\n elementClasses.splice(index, 1);\n }\n }\n el.attribs.class = elementClasses.join(' ');\n }\n return this;\n}\nexports.toggleClass = toggleClass;\n\n\n//# sourceURL=webpack://hmd2html/./node_modules/cheerio/lib/api/attributes.js?");
/***/ }),
/***/ "./node_modules/cheerio/lib/api/css.js":
/*!*********************************************!*\
!*** ./node_modules/cheerio/lib/api/css.js ***!
\*********************************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
"use strict";
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.css = void 0;\nvar utils_1 = __webpack_require__(/*! ../utils */ \"./node_modules/cheerio/lib/utils.js\");\nfunction css(prop, val) {\n if ((prop != null && val != null) ||\n // When `prop` is a \"plain\" object\n (typeof prop === 'object' && !Array.isArray(prop))) {\n return utils_1.domEach(this, function (el, i) {\n if (utils_1.isTag(el)) {\n // `prop` can't be an array here anymore.\n setCss(el, prop, val, i);\n }\n });\n }\n return getCss(this[0], prop);\n}\nexports.css = css;\n/**\n * Set styles of all elements.\n *\n * @private\n * @param el - Element to set style of.\n * @param prop - Name of property.\n * @param value - Value to set property to.\n * @param idx - Optional index within the selection.\n */\nfunction setCss(el, prop, value, idx) {\n if (typeof prop === 'string') {\n var styles = getCss(el);\n var val = typeof value === 'function' ? value.call(el, idx, styles[prop]) : value;\n if (val === '') {\n delete styles[prop];\n }\n else if (val != null) {\n styles[prop] = val;\n }\n el.attribs.style = stringify(styles);\n }\n else if (typeof prop === 'object') {\n Object.keys(prop).forEach(function (k, i) {\n setCss(el, k, prop[k], i);\n });\n }\n}\nfunction getCss(el, prop) {\n if (!el || !utils_1.isTag(el))\n return;\n var styles = parse(el.attribs.style);\n if (typeof prop === 'string') {\n return styles[prop];\n }\n if (Array.isArray(prop)) {\n var newStyles_1 = {};\n prop.forEach(function (item) {\n if (styles[item] != null) {\n newStyles_1[item] = styles[item];\n }\n });\n return newStyles_1;\n }\n return styles;\n}\n/**\n * Stringify `obj` to styles.\n *\n * @private\n * @category CSS\n * @param obj - Object to stringify.\n * @returns The serialized styles.\n */\nfunction stringify(obj) {\n return Object.keys(obj).reduce(function (str, prop) { return \"\" + str + (str ? ' ' : '') + prop + \": \" + obj[prop] + \";\"; }, '');\n}\n/**\n * Parse `styles`.\n *\n * @private\n * @category CSS\n * @param styles - Styles to be parsed.\n * @returns The parsed styles.\n */\nfunction parse(styles) {\n styles = (styles || '').trim();\n if (!styles)\n return {};\n return styles.split(';').reduce(function (obj, str) {\n var n = str.indexOf(':');\n // Skip if there is no :, or if it is the first/last character\n if (n < 1 || n === str.length - 1)\n return obj;\n obj[str.slice(0, n).trim()] = str.slice(n + 1).trim();\n return obj;\n }, {});\n}\n\n\n//# sourceURL=webpack://hmd2html/./node_modules/cheerio/lib/api/css.js?");
/***/ }),
/***/ "./node_modules/cheerio/lib/api/forms.js":
/*!***********************************************!*\
!*** ./node_modules/cheerio/lib/api/forms.js ***!
\***********************************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
"use strict";
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.serializeArray = exports.serialize = void 0;\nvar utils_1 = __webpack_require__(/*! ../utils */ \"./node_modules/cheerio/lib/utils.js\");\n/*\n * https://github.com/jquery/jquery/blob/2.1.3/src/manipulation/var/rcheckableType.js\n * https://github.com/jquery/jquery/blob/2.1.3/src/serialize.js\n */\nvar submittableSelector = 'input,select,textarea,keygen';\nvar r20 = /%20/g;\nvar rCRLF = /\\r?\\n/g;\n/**\n * Encode a set of form elements as a string for submission.\n *\n * @category Forms\n * @returns The serialized form.\n * @see {@link https://api.jquery.com/serialize/}\n */\nfunction serialize() {\n // Convert form elements into name/value objects\n var arr = this.serializeArray();\n // Serialize each element into a key/value string\n var retArr = arr.map(function (data) {\n return encodeURIComponent(data.name) + \"=\" + encodeURIComponent(data.value);\n });\n // Return the resulting serialization\n return retArr.join('&').replace(r20, '+');\n}\nexports.serialize = serialize;\n/**\n * Encode a set of form elements as an array of names and values.\n *\n * @category Forms\n * @example\n *\n * ```js\n * $('<form><input name=\"foo\" value=\"bar\" /></form>').serializeArray();\n * //=> [ { name: 'foo', value: 'bar' } ]\n * ```\n *\n * @returns The serialized form.\n * @see {@link https://api.jquery.com/serializeArray/}\n */\nfunction serializeArray() {\n var _this = this;\n // Resolve all form elements from either forms or collections of form elements\n return this.map(function (_, elem) {\n var $elem = _this._make(elem);\n if (utils_1.isTag(elem) && elem.name === 'form') {\n return $elem.find(submittableSelector).toArray();\n }\n return $elem.filter(submittableSelector).toArray();\n })\n .filter(\n // Verify elements have a name (`attr.name`) and are not disabled (`:enabled`)\n '[name!=\"\"]:enabled' +\n // And cannot be clicked (`[type=submit]`) or are used in `x-www-form-urlencoded` (`[type=file]`)\n ':not(:submit, :button, :image, :reset, :file)' +\n // And are either checked/don't have a checkable state\n ':matches([checked], :not(:checkbox, :radio))'\n // Convert each of the elements to its value(s)\n )\n .map(function (_, elem) {\n var _a;\n var $elem = _this._make(elem);\n var name = $elem.attr('name'); // We have filtered for elements with a name before.\n // If there is no value set (e.g. `undefined`, `null`), then default value to empty\n var value = (_a = $elem.val()) !== null && _a !== void 0 ? _a : '';\n // If we have an array of values (e.g. `<select multiple>`), return an array of key/value pairs\n if (Array.isArray(value)) {\n return value.map(function (val) {\n /*\n * We trim replace any line endings (e.g. `\\r` or `\\r\\n` with `\\r\\n`) to guarantee consistency across platforms\n * These can occur inside of `<textarea>'s`\n */\n return ({ name: name, value: val.replace(rCRLF, '\\r\\n') });\n });\n }\n // Otherwise (e.g. `<input type=\"text\">`, return only one key/value pair\n return { name: name, value: value.replace(rCRLF, '\\r\\n') };\n })\n .toArray();\n}\nexports.serializeArray = serializeArray;\n\n\n//# sourceURL=webpack://hmd2html/./node_modules/cheerio/lib/api/forms.js?");
/***/ }),
/***/ "./node_modules/cheerio/lib/api/manipulation.js":
/*!******************************************************!*\
!*** ./node_modules/cheerio/lib/api/manipulation.js ***!
\******************************************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
"use strict";
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.clone = exports.text = exports.toString = exports.html = exports.empty = exports.replaceWith = exports.remove = exports.insertBefore = exports.before = exports.insertAfter = exports.after = exports.wrapAll = exports.unwrap = exports.wrapInner = exports.wrap = exports.prepend = exports.append = exports.prependTo = exports.appendTo = exports._makeDomArray = void 0;\nvar tslib_1 = __webpack_require__(/*! tslib */ \"./node_modules/cheerio/node_modules/tslib/tslib.es6.js\");\nvar domhandler_1 = __webpack_require__(/*! domhandler */ \"./node_modules/domhandler/lib/index.js\");\n/**\n * Methods for modifying the DOM structure.\n *\n * @module cheerio/manipulation\n */\nvar domhandler_2 = __webpack_require__(/*! domhandler */ \"./node_modules/domhandler/lib/index.js\");\nvar parse_1 = tslib_1.__importStar(__webpack_require__(/*! ../parse */ \"./node_modules/cheerio/lib/parse.js\"));\nvar static_1 = __webpack_require__(/*! ../static */ \"./node_modules/cheerio/lib/static.js\");\nvar utils_1 = __webpack_require__(/*! ../utils */ \"./node_modules/cheerio/lib/utils.js\");\nvar htmlparser2_1 = __webpack_require__(/*! htmlparser2 */ \"./node_modules/htmlparser2/lib/index.js\");\n/**\n * Create an array of nodes, recursing into arrays and parsing strings if necessary.\n *\n * @private\n * @category Manipulation\n * @param elem - Elements to make an array of.\n * @param clone - Optionally clone nodes.\n * @returns The array of nodes.\n */\nfunction _makeDomArray(elem, clone) {\n var _this = this;\n if (elem == null) {\n return [];\n }\n if (utils_1.isCheerio(elem)) {\n return clone ? utils_1.cloneDom(elem.get()) : elem.get();\n }\n if (Array.isArray(elem)) {\n return elem.reduce(function (newElems, el) { return newElems.concat(_this._makeDomArray(el, clone)); }, []);\n }\n if (typeof elem === 'string') {\n return parse_1.default(elem, this.options, false).children;\n }\n return clone ? utils_1.cloneDom([elem]) : [elem];\n}\nexports._makeDomArray = _makeDomArray;\nfunction _insert(concatenator) {\n return function () {\n var _this = this;\n var elems = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n elems[_i] = arguments[_i];\n }\n var lastIdx = this.length - 1;\n return utils_1.domEach(this, function (el, i) {\n if (!domhandler_1.hasChildren(el))\n return;\n var domSrc = typeof elems[0] === 'function'\n ? elems[0].call(el, i, static_1.html(el.children))\n : elems;\n var dom = _this._makeDomArray(domSrc, i < lastIdx);\n concatenator(dom, el.children, el);\n });\n };\n}\n/**\n * Modify an array in-place, removing some number of elements and adding new\n * elements directly following them.\n *\n * @private\n * @category Manipulation\n * @param array - Target array to splice.\n * @param spliceIdx - Index at which to begin changing the array.\n * @param spliceCount - Number of elements to remove from the array.\n * @param newElems - Elements to insert into the array.\n * @param parent - The parent of the node.\n * @returns The spliced array.\n */\nfunction uniqueSplice(array, spliceIdx, spliceCount, newElems, parent) {\n var _a, _b;\n var spliceArgs = tslib_1.__spreadArray([\n spliceIdx,\n spliceCount\n ], newElems);\n var prev = array[spliceIdx - 1] || null;\n var next = array[spliceIdx + spliceCount] || null;\n /*\n * Before splicing in new elements, ensure they do not already appear in the\n * current array.\n */\n for (var idx = 0; idx < newElems.length; ++idx) {\n var node = newElems[idx];\n var oldParent = node.parent;\n if (oldParent) {\n var prevIdx = oldParent.children.indexOf(newElems[idx]);\n if (prevIdx > -1) {\n oldParent.children.splice(prevIdx, 1);\n