%PDF- %PDF-
Direktori : /var/www/html/node_modules/html-dom-parser/dist/ |
Current File : /var/www/html/node_modules/html-dom-parser/dist/html-dom-parser.min.js.map |
{"version":3,"file":"html-dom-parser.min.js","sources":["../lib/client/domparser.js","../node_modules/domelementtype/lib/index.js","../node_modules/domhandler/lib/node.js","../node_modules/domhandler/lib/index.js","../lib/client/utilities.js","../lib/client/constants.js","../lib/client/html-to-dom.js"],"sourcesContent":["// constants\nvar HTML = 'html';\nvar HEAD = 'head';\nvar BODY = 'body';\nvar FIRST_TAG_REGEX = /<([a-zA-Z]+[0-9]?)/; // e.g., <h1>\n// match-all-characters in case of newlines (DOTALL)\nvar HEAD_TAG_REGEX = /<head[^]*>/i;\nvar BODY_TAG_REGEX = /<body[^]*>/i;\n\n// falls back to `parseFromString` if `createHTMLDocument` cannot be used\nvar parseFromDocument = function () {\n throw new Error(\n 'This browser does not support `document.implementation.createHTMLDocument`'\n );\n};\n\nvar parseFromString = function () {\n throw new Error(\n 'This browser does not support `DOMParser.prototype.parseFromString`'\n );\n};\n\n/**\n * DOMParser (performance: slow).\n *\n * @see https://developer.mozilla.org/docs/Web/API/DOMParser#Parsing_an_SVG_or_HTML_document\n */\nif (typeof window.DOMParser === 'function') {\n var domParser = new window.DOMParser();\n var mimeType = 'text/html';\n\n /**\n * Creates an HTML document using `DOMParser.parseFromString`.\n *\n * @param {string} html - The HTML string.\n * @param {string} [tagName] - The element to render the HTML (with 'body' as fallback).\n * @return {HTMLDocument}\n */\n parseFromString = function (html, tagName) {\n if (tagName) {\n html = '<' + tagName + '>' + html + '</' + tagName + '>';\n }\n\n return domParser.parseFromString(html, mimeType);\n };\n\n parseFromDocument = parseFromString;\n}\n\n/**\n * DOMImplementation (performance: fair).\n *\n * @see https://developer.mozilla.org/docs/Web/API/DOMImplementation/createHTMLDocument\n */\nif (document.implementation) {\n var doc = document.implementation.createHTMLDocument();\n\n /**\n * Use HTML document created by `document.implementation.createHTMLDocument`.\n *\n * @param {string} html - The HTML string.\n * @param {string} [tagName] - The element to render the HTML (with 'body' as fallback).\n * @return {HTMLDocument}\n */\n parseFromDocument = function (html, tagName) {\n if (tagName) {\n var element = doc.documentElement.querySelector(tagName);\n element.innerHTML = html;\n return doc;\n }\n\n doc.documentElement.innerHTML = html;\n return doc;\n };\n}\n\n/**\n * Template (performance: fast).\n *\n * @see https://developer.mozilla.org/docs/Web/HTML/Element/template\n */\nvar template = document.createElement('template');\nvar parseFromTemplate;\n\nif (template.content) {\n /**\n * Uses a template element (content fragment) to parse HTML.\n *\n * @param {string} html - The HTML string.\n * @return {NodeList}\n */\n parseFromTemplate = function (html) {\n template.innerHTML = html;\n return template.content.childNodes;\n };\n}\n\n/**\n * Parses HTML string to DOM nodes.\n *\n * @param {string} html - HTML markup.\n * @return {NodeList}\n */\nfunction domparser(html) {\n var firstTagName;\n var match = html.match(FIRST_TAG_REGEX);\n\n if (match && match[1]) {\n firstTagName = match[1].toLowerCase();\n }\n\n var doc;\n var element;\n var elements;\n\n switch (firstTagName) {\n case HTML:\n doc = parseFromString(html);\n\n // the created document may come with filler head/body elements,\n // so make sure to remove them if they don't actually exist\n if (!HEAD_TAG_REGEX.test(html)) {\n element = doc.querySelector(HEAD);\n if (element) {\n element.parentNode.removeChild(element);\n }\n }\n\n if (!BODY_TAG_REGEX.test(html)) {\n element = doc.querySelector(BODY);\n if (element) {\n element.parentNode.removeChild(element);\n }\n }\n\n return doc.querySelectorAll(HTML);\n\n case HEAD:\n case BODY:\n doc = parseFromDocument(html);\n elements = doc.querySelectorAll(firstTagName);\n\n // if there's a sibling element, then return both elements\n if (BODY_TAG_REGEX.test(html) && HEAD_TAG_REGEX.test(html)) {\n return elements[0].parentNode.childNodes;\n }\n return elements;\n\n // low-level tag or text\n default:\n if (parseFromTemplate) {\n return parseFromTemplate(html);\n }\n element = parseFromDocument(html, BODY).querySelector(BODY);\n return element.childNodes;\n }\n}\n\nmodule.exports = domparser;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Doctype = exports.CDATA = exports.Tag = exports.Style = exports.Script = exports.Comment = exports.Directive = exports.Text = exports.Root = exports.isTag = exports.ElementType = void 0;\n/** Types of elements found in htmlparser2's DOM */\nvar ElementType;\n(function (ElementType) {\n /** Type for the root element of a document */\n ElementType[\"Root\"] = \"root\";\n /** Type for Text */\n ElementType[\"Text\"] = \"text\";\n /** Type for <? ... ?> */\n ElementType[\"Directive\"] = \"directive\";\n /** Type for <!-- ... --> */\n ElementType[\"Comment\"] = \"comment\";\n /** Type for <script> tags */\n ElementType[\"Script\"] = \"script\";\n /** Type for <style> tags */\n ElementType[\"Style\"] = \"style\";\n /** Type for Any tag */\n ElementType[\"Tag\"] = \"tag\";\n /** Type for <![CDATA[ ... ]]> */\n ElementType[\"CDATA\"] = \"cdata\";\n /** Type for <!doctype ...> */\n ElementType[\"Doctype\"] = \"doctype\";\n})(ElementType = exports.ElementType || (exports.ElementType = {}));\n/**\n * Tests whether an element is a tag or not.\n *\n * @param elem Element to test\n */\nfunction isTag(elem) {\n return (elem.type === ElementType.Tag ||\n elem.type === ElementType.Script ||\n elem.type === ElementType.Style);\n}\nexports.isTag = isTag;\n// Exports for backwards compatibility\n/** Type for the root element of a document */\nexports.Root = ElementType.Root;\n/** Type for Text */\nexports.Text = ElementType.Text;\n/** Type for <? ... ?> */\nexports.Directive = ElementType.Directive;\n/** Type for <!-- ... --> */\nexports.Comment = ElementType.Comment;\n/** Type for <script> tags */\nexports.Script = ElementType.Script;\n/** Type for <style> tags */\nexports.Style = ElementType.Style;\n/** Type for Any tag */\nexports.Tag = ElementType.Tag;\n/** Type for <![CDATA[ ... ]]> */\nexports.CDATA = ElementType.CDATA;\n/** Type for <!doctype ...> */\nexports.Doctype = ElementType.Doctype;\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\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};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.cloneNode = exports.hasChildren = exports.isDocument = exports.isDirective = exports.isComment = exports.isText = exports.isCDATA = exports.isTag = exports.Element = exports.Document = exports.CDATA = exports.NodeWithChildren = exports.ProcessingInstruction = exports.Comment = exports.Text = exports.DataNode = exports.Node = void 0;\nvar domelementtype_1 = require(\"domelementtype\");\n/**\n * This object will be used as the prototype for Nodes when creating a\n * DOM-Level-1-compliant structure.\n */\nvar Node = /** @class */ (function () {\n function Node() {\n /** Parent of the node */\n this.parent = null;\n /** Previous sibling */\n this.prev = null;\n /** Next sibling */\n this.next = null;\n /** The start index of the node. Requires `withStartIndices` on the handler to be `true. */\n this.startIndex = null;\n /** The end index of the node. Requires `withEndIndices` on the handler to be `true. */\n this.endIndex = null;\n }\n Object.defineProperty(Node.prototype, \"parentNode\", {\n // Read-write aliases for properties\n /**\n * Same as {@link parent}.\n * [DOM spec](https://dom.spec.whatwg.org)-compatible alias.\n */\n get: function () {\n return this.parent;\n },\n set: function (parent) {\n this.parent = parent;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Node.prototype, \"previousSibling\", {\n /**\n * Same as {@link prev}.\n * [DOM spec](https://dom.spec.whatwg.org)-compatible alias.\n */\n get: function () {\n return this.prev;\n },\n set: function (prev) {\n this.prev = prev;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Node.prototype, \"nextSibling\", {\n /**\n * Same as {@link next}.\n * [DOM spec](https://dom.spec.whatwg.org)-compatible alias.\n */\n get: function () {\n return this.next;\n },\n set: function (next) {\n this.next = next;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Clone this node, and optionally its children.\n *\n * @param recursive Clone child nodes as well.\n * @returns A clone of the node.\n */\n Node.prototype.cloneNode = function (recursive) {\n if (recursive === void 0) { recursive = false; }\n return cloneNode(this, recursive);\n };\n return Node;\n}());\nexports.Node = Node;\n/**\n * A node that contains some data.\n */\nvar DataNode = /** @class */ (function (_super) {\n __extends(DataNode, _super);\n /**\n * @param data The content of the data node\n */\n function DataNode(data) {\n var _this = _super.call(this) || this;\n _this.data = data;\n return _this;\n }\n Object.defineProperty(DataNode.prototype, \"nodeValue\", {\n /**\n * Same as {@link data}.\n * [DOM spec](https://dom.spec.whatwg.org)-compatible alias.\n */\n get: function () {\n return this.data;\n },\n set: function (data) {\n this.data = data;\n },\n enumerable: false,\n configurable: true\n });\n return DataNode;\n}(Node));\nexports.DataNode = DataNode;\n/**\n * Text within the document.\n */\nvar Text = /** @class */ (function (_super) {\n __extends(Text, _super);\n function Text() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = domelementtype_1.ElementType.Text;\n return _this;\n }\n Object.defineProperty(Text.prototype, \"nodeType\", {\n get: function () {\n return 3;\n },\n enumerable: false,\n configurable: true\n });\n return Text;\n}(DataNode));\nexports.Text = Text;\n/**\n * Comments within the document.\n */\nvar Comment = /** @class */ (function (_super) {\n __extends(Comment, _super);\n function Comment() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = domelementtype_1.ElementType.Comment;\n return _this;\n }\n Object.defineProperty(Comment.prototype, \"nodeType\", {\n get: function () {\n return 8;\n },\n enumerable: false,\n configurable: true\n });\n return Comment;\n}(DataNode));\nexports.Comment = Comment;\n/**\n * Processing instructions, including doc types.\n */\nvar ProcessingInstruction = /** @class */ (function (_super) {\n __extends(ProcessingInstruction, _super);\n function ProcessingInstruction(name, data) {\n var _this = _super.call(this, data) || this;\n _this.name = name;\n _this.type = domelementtype_1.ElementType.Directive;\n return _this;\n }\n Object.defineProperty(ProcessingInstruction.prototype, \"nodeType\", {\n get: function () {\n return 1;\n },\n enumerable: false,\n configurable: true\n });\n return ProcessingInstruction;\n}(DataNode));\nexports.ProcessingInstruction = ProcessingInstruction;\n/**\n * A `Node` that can have children.\n */\nvar NodeWithChildren = /** @class */ (function (_super) {\n __extends(NodeWithChildren, _super);\n /**\n * @param children Children of the node. Only certain node types can have children.\n */\n function NodeWithChildren(children) {\n var _this = _super.call(this) || this;\n _this.children = children;\n return _this;\n }\n Object.defineProperty(NodeWithChildren.prototype, \"firstChild\", {\n // Aliases\n /** First child of the node. */\n get: function () {\n var _a;\n return (_a = this.children[0]) !== null && _a !== void 0 ? _a : null;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(NodeWithChildren.prototype, \"lastChild\", {\n /** Last child of the node. */\n get: function () {\n return this.children.length > 0\n ? this.children[this.children.length - 1]\n : null;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(NodeWithChildren.prototype, \"childNodes\", {\n /**\n * Same as {@link children}.\n * [DOM spec](https://dom.spec.whatwg.org)-compatible alias.\n */\n get: function () {\n return this.children;\n },\n set: function (children) {\n this.children = children;\n },\n enumerable: false,\n configurable: true\n });\n return NodeWithChildren;\n}(Node));\nexports.NodeWithChildren = NodeWithChildren;\nvar CDATA = /** @class */ (function (_super) {\n __extends(CDATA, _super);\n function CDATA() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = domelementtype_1.ElementType.CDATA;\n return _this;\n }\n Object.defineProperty(CDATA.prototype, \"nodeType\", {\n get: function () {\n return 4;\n },\n enumerable: false,\n configurable: true\n });\n return CDATA;\n}(NodeWithChildren));\nexports.CDATA = CDATA;\n/**\n * The root node of the document.\n */\nvar Document = /** @class */ (function (_super) {\n __extends(Document, _super);\n function Document() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = domelementtype_1.ElementType.Root;\n return _this;\n }\n Object.defineProperty(Document.prototype, \"nodeType\", {\n get: function () {\n return 9;\n },\n enumerable: false,\n configurable: true\n });\n return Document;\n}(NodeWithChildren));\nexports.Document = Document;\n/**\n * An element within the DOM.\n */\nvar Element = /** @class */ (function (_super) {\n __extends(Element, _super);\n /**\n * @param name Name of the tag, eg. `div`, `span`.\n * @param attribs Object mapping attribute names to attribute values.\n * @param children Children of the node.\n */\n function Element(name, attribs, children, type) {\n if (children === void 0) { children = []; }\n if (type === void 0) { type = name === \"script\"\n ? domelementtype_1.ElementType.Script\n : name === \"style\"\n ? domelementtype_1.ElementType.Style\n : domelementtype_1.ElementType.Tag; }\n var _this = _super.call(this, children) || this;\n _this.name = name;\n _this.attribs = attribs;\n _this.type = type;\n return _this;\n }\n Object.defineProperty(Element.prototype, \"nodeType\", {\n get: function () {\n return 1;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Element.prototype, \"tagName\", {\n // DOM Level 1 aliases\n /**\n * Same as {@link name}.\n * [DOM spec](https://dom.spec.whatwg.org)-compatible alias.\n */\n get: function () {\n return this.name;\n },\n set: function (name) {\n this.name = name;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Element.prototype, \"attributes\", {\n get: function () {\n var _this = this;\n return Object.keys(this.attribs).map(function (name) {\n var _a, _b;\n return ({\n name: name,\n value: _this.attribs[name],\n namespace: (_a = _this[\"x-attribsNamespace\"]) === null || _a === void 0 ? void 0 : _a[name],\n prefix: (_b = _this[\"x-attribsPrefix\"]) === null || _b === void 0 ? void 0 : _b[name],\n });\n });\n },\n enumerable: false,\n configurable: true\n });\n return Element;\n}(NodeWithChildren));\nexports.Element = Element;\n/**\n * @param node Node to check.\n * @returns `true` if the node is a `Element`, `false` otherwise.\n */\nfunction isTag(node) {\n return (0, domelementtype_1.isTag)(node);\n}\nexports.isTag = isTag;\n/**\n * @param node Node to check.\n * @returns `true` if the node has the type `CDATA`, `false` otherwise.\n */\nfunction isCDATA(node) {\n return node.type === domelementtype_1.ElementType.CDATA;\n}\nexports.isCDATA = isCDATA;\n/**\n * @param node Node to check.\n * @returns `true` if the node has the type `Text`, `false` otherwise.\n */\nfunction isText(node) {\n return node.type === domelementtype_1.ElementType.Text;\n}\nexports.isText = isText;\n/**\n * @param node Node to check.\n * @returns `true` if the node has the type `Comment`, `false` otherwise.\n */\nfunction isComment(node) {\n return node.type === domelementtype_1.ElementType.Comment;\n}\nexports.isComment = isComment;\n/**\n * @param node Node to check.\n * @returns `true` if the node has the type `ProcessingInstruction`, `false` otherwise.\n */\nfunction isDirective(node) {\n return node.type === domelementtype_1.ElementType.Directive;\n}\nexports.isDirective = isDirective;\n/**\n * @param node Node to check.\n * @returns `true` if the node has the type `ProcessingInstruction`, `false` otherwise.\n */\nfunction isDocument(node) {\n return node.type === domelementtype_1.ElementType.Root;\n}\nexports.isDocument = isDocument;\n/**\n * @param node Node to check.\n * @returns `true` if the node has children, `false` otherwise.\n */\nfunction hasChildren(node) {\n return Object.prototype.hasOwnProperty.call(node, \"children\");\n}\nexports.hasChildren = hasChildren;\n/**\n * Clone a node, and optionally its children.\n *\n * @param recursive Clone child nodes as well.\n * @returns A clone of the node.\n */\nfunction cloneNode(node, recursive) {\n if (recursive === void 0) { recursive = false; }\n var result;\n if (isText(node)) {\n result = new Text(node.data);\n }\n else if (isComment(node)) {\n result = new Comment(node.data);\n }\n else if (isTag(node)) {\n var children = recursive ? cloneChildren(node.children) : [];\n var clone_1 = new Element(node.name, __assign({}, node.attribs), children);\n children.forEach(function (child) { return (child.parent = clone_1); });\n if (node.namespace != null) {\n clone_1.namespace = node.namespace;\n }\n if (node[\"x-attribsNamespace\"]) {\n clone_1[\"x-attribsNamespace\"] = __assign({}, node[\"x-attribsNamespace\"]);\n }\n if (node[\"x-attribsPrefix\"]) {\n clone_1[\"x-attribsPrefix\"] = __assign({}, node[\"x-attribsPrefix\"]);\n }\n result = clone_1;\n }\n else if (isCDATA(node)) {\n var children = recursive ? cloneChildren(node.children) : [];\n var clone_2 = new CDATA(children);\n children.forEach(function (child) { return (child.parent = clone_2); });\n result = clone_2;\n }\n else if (isDocument(node)) {\n var children = recursive ? cloneChildren(node.children) : [];\n var clone_3 = new Document(children);\n children.forEach(function (child) { return (child.parent = clone_3); });\n if (node[\"x-mode\"]) {\n clone_3[\"x-mode\"] = node[\"x-mode\"];\n }\n result = clone_3;\n }\n else if (isDirective(node)) {\n var instruction = new ProcessingInstruction(node.name, node.data);\n if (node[\"x-name\"] != null) {\n instruction[\"x-name\"] = node[\"x-name\"];\n instruction[\"x-publicId\"] = node[\"x-publicId\"];\n instruction[\"x-systemId\"] = node[\"x-systemId\"];\n }\n result = instruction;\n }\n else {\n throw new Error(\"Not implemented yet: \".concat(node.type));\n }\n result.startIndex = node.startIndex;\n result.endIndex = node.endIndex;\n if (node.sourceCodeLocation != null) {\n result.sourceCodeLocation = node.sourceCodeLocation;\n }\n return result;\n}\nexports.cloneNode = cloneNode;\nfunction cloneChildren(childs) {\n var children = childs.map(function (child) { return cloneNode(child, true); });\n for (var i = 1; i < children.length; i++) {\n children[i].prev = children[i - 1];\n children[i - 1].next = children[i];\n }\n return children;\n}\n","\"use strict\";\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 __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DomHandler = void 0;\nvar domelementtype_1 = require(\"domelementtype\");\nvar node_js_1 = require(\"./node.js\");\n__exportStar(require(\"./node.js\"), exports);\n// Default options\nvar defaultOpts = {\n withStartIndices: false,\n withEndIndices: false,\n xmlMode: false,\n};\nvar DomHandler = /** @class */ (function () {\n /**\n * @param callback Called once parsing has completed.\n * @param options Settings for the handler.\n * @param elementCB Callback whenever a tag is closed.\n */\n function DomHandler(callback, options, elementCB) {\n /** The elements of the DOM */\n this.dom = [];\n /** The root element for the DOM */\n this.root = new node_js_1.Document(this.dom);\n /** Indicated whether parsing has been completed. */\n this.done = false;\n /** Stack of open tags. */\n this.tagStack = [this.root];\n /** A data node that is still being written to. */\n this.lastNode = null;\n /** Reference to the parser instance. Used for location information. */\n this.parser = null;\n // Make it possible to skip arguments, for backwards-compatibility\n if (typeof options === \"function\") {\n elementCB = options;\n options = defaultOpts;\n }\n if (typeof callback === \"object\") {\n options = callback;\n callback = undefined;\n }\n this.callback = callback !== null && callback !== void 0 ? callback : null;\n this.options = options !== null && options !== void 0 ? options : defaultOpts;\n this.elementCB = elementCB !== null && elementCB !== void 0 ? elementCB : null;\n }\n DomHandler.prototype.onparserinit = function (parser) {\n this.parser = parser;\n };\n // Resets the handler back to starting state\n DomHandler.prototype.onreset = function () {\n this.dom = [];\n this.root = new node_js_1.Document(this.dom);\n this.done = false;\n this.tagStack = [this.root];\n this.lastNode = null;\n this.parser = null;\n };\n // Signals the handler that parsing is done\n DomHandler.prototype.onend = function () {\n if (this.done)\n return;\n this.done = true;\n this.parser = null;\n this.handleCallback(null);\n };\n DomHandler.prototype.onerror = function (error) {\n this.handleCallback(error);\n };\n DomHandler.prototype.onclosetag = function () {\n this.lastNode = null;\n var elem = this.tagStack.pop();\n if (this.options.withEndIndices) {\n elem.endIndex = this.parser.endIndex;\n }\n if (this.elementCB)\n this.elementCB(elem);\n };\n DomHandler.prototype.onopentag = function (name, attribs) {\n var type = this.options.xmlMode ? domelementtype_1.ElementType.Tag : undefined;\n var element = new node_js_1.Element(name, attribs, undefined, type);\n this.addNode(element);\n this.tagStack.push(element);\n };\n DomHandler.prototype.ontext = function (data) {\n var lastNode = this.lastNode;\n if (lastNode && lastNode.type === domelementtype_1.ElementType.Text) {\n lastNode.data += data;\n if (this.options.withEndIndices) {\n lastNode.endIndex = this.parser.endIndex;\n }\n }\n else {\n var node = new node_js_1.Text(data);\n this.addNode(node);\n this.lastNode = node;\n }\n };\n DomHandler.prototype.oncomment = function (data) {\n if (this.lastNode && this.lastNode.type === domelementtype_1.ElementType.Comment) {\n this.lastNode.data += data;\n return;\n }\n var node = new node_js_1.Comment(data);\n this.addNode(node);\n this.lastNode = node;\n };\n DomHandler.prototype.oncommentend = function () {\n this.lastNode = null;\n };\n DomHandler.prototype.oncdatastart = function () {\n var text = new node_js_1.Text(\"\");\n var node = new node_js_1.CDATA([text]);\n this.addNode(node);\n text.parent = node;\n this.lastNode = text;\n };\n DomHandler.prototype.oncdataend = function () {\n this.lastNode = null;\n };\n DomHandler.prototype.onprocessinginstruction = function (name, data) {\n var node = new node_js_1.ProcessingInstruction(name, data);\n this.addNode(node);\n };\n DomHandler.prototype.handleCallback = function (error) {\n if (typeof this.callback === \"function\") {\n this.callback(error, this.dom);\n }\n else if (error) {\n throw error;\n }\n };\n DomHandler.prototype.addNode = function (node) {\n var parent = this.tagStack[this.tagStack.length - 1];\n var previousSibling = parent.children[parent.children.length - 1];\n if (this.options.withStartIndices) {\n node.startIndex = this.parser.startIndex;\n }\n if (this.options.withEndIndices) {\n node.endIndex = this.parser.endIndex;\n }\n parent.children.push(node);\n if (previousSibling) {\n node.prev = previousSibling;\n previousSibling.next = node;\n }\n node.parent = parent;\n this.lastNode = null;\n };\n return DomHandler;\n}());\nexports.DomHandler = DomHandler;\nexports.default = DomHandler;\n","var domhandler = require('domhandler');\nvar constants = require('./constants');\n\nvar CASE_SENSITIVE_TAG_NAMES = constants.CASE_SENSITIVE_TAG_NAMES;\n\nvar Comment = domhandler.Comment;\nvar Element = domhandler.Element;\nvar ProcessingInstruction = domhandler.ProcessingInstruction;\nvar Text = domhandler.Text;\n\nvar caseSensitiveTagNamesMap = {};\nvar tagName;\n\nfor (var i = 0, len = CASE_SENSITIVE_TAG_NAMES.length; i < len; i++) {\n tagName = CASE_SENSITIVE_TAG_NAMES[i];\n caseSensitiveTagNamesMap[tagName.toLowerCase()] = tagName;\n}\n\n/**\n * Gets case-sensitive tag name.\n *\n * @param {string} tagName - Tag name in lowercase.\n * @returns {string|undefined} - Case-sensitive tag name.\n */\nfunction getCaseSensitiveTagName(tagName) {\n return caseSensitiveTagNamesMap[tagName];\n}\n\n/**\n * Formats DOM attributes to a hash map.\n *\n * @param {NamedNodeMap} attributes - List of attributes.\n * @returns {object} - Map of attribute name to value.\n */\nfunction formatAttributes(attributes) {\n var result = {};\n var attribute;\n // `NamedNodeMap` is array-like\n for (var i = 0, len = attributes.length; i < len; i++) {\n attribute = attributes[i];\n result[attribute.name] = attribute.value;\n }\n return result;\n}\n\n/**\n * Corrects the tag name if it is case-sensitive (SVG).\n * Otherwise, returns the lowercase tag name (HTML).\n *\n * @param {string} tagName - Lowercase tag name.\n * @returns {string} - Formatted tag name.\n */\nfunction formatTagName(tagName) {\n tagName = tagName.toLowerCase();\n var caseSensitiveTagName = getCaseSensitiveTagName(tagName);\n if (caseSensitiveTagName) {\n return caseSensitiveTagName;\n }\n return tagName;\n}\n\n/**\n * Transforms DOM nodes to `domhandler` nodes.\n *\n * @param {NodeList} nodes - DOM nodes.\n * @param {Element|null} [parent=null] - Parent node.\n * @param {string} [directive] - Directive.\n * @returns {Array<Comment|Element|ProcessingInstruction|Text>}\n */\nfunction formatDOM(nodes, parent, directive) {\n parent = parent || null;\n var result = [];\n\n for (var index = 0, len = nodes.length; index < len; index++) {\n var node = nodes[index];\n var current;\n\n // set the node data given the type\n switch (node.nodeType) {\n case 1:\n // script, style, or tag\n current = new Element(\n formatTagName(node.nodeName),\n formatAttributes(node.attributes)\n );\n current.children = formatDOM(node.childNodes, current);\n break;\n\n case 3:\n current = new Text(node.nodeValue);\n break;\n\n case 8:\n current = new Comment(node.nodeValue);\n break;\n\n default:\n continue;\n }\n\n // set previous node next\n var prev = result[index - 1] || null;\n if (prev) {\n prev.next = current;\n }\n\n // set properties for current node\n current.parent = parent;\n current.prev = prev;\n current.next = null;\n\n result.push(current);\n }\n\n if (directive) {\n current = new ProcessingInstruction(\n directive.substring(0, directive.indexOf(' ')).toLowerCase(),\n directive\n );\n current.next = result[0] || null;\n current.parent = parent;\n result.unshift(current);\n\n if (result[1]) {\n result[1].prev = result[0];\n }\n }\n\n return result;\n}\n\nexports.formatAttributes = formatAttributes;\nexports.formatDOM = formatDOM;\n","/**\n * SVG elements are case-sensitive.\n *\n * @see {@link https://developer.mozilla.org/docs/Web/SVG/Element#svg_elements_a_to_z}\n */\nexports.CASE_SENSITIVE_TAG_NAMES = [\n 'animateMotion',\n 'animateTransform',\n 'clipPath',\n 'feBlend',\n 'feColorMatrix',\n 'feComponentTransfer',\n 'feComposite',\n 'feConvolveMatrix',\n 'feDiffuseLighting',\n 'feDisplacementMap',\n 'feDropShadow',\n 'feFlood',\n 'feFuncA',\n 'feFuncB',\n 'feFuncG',\n 'feFuncR',\n 'feGaussainBlur',\n 'feImage',\n 'feMerge',\n 'feMergeNode',\n 'feMorphology',\n 'feOffset',\n 'fePointLight',\n 'feSpecularLighting',\n 'feSpotLight',\n 'feTile',\n 'feTurbulence',\n 'foreignObject',\n 'linearGradient',\n 'radialGradient',\n 'textPath'\n];\n","var domparser = require('./domparser');\nvar formatDOM = require('./utilities').formatDOM;\n\nvar DIRECTIVE_REGEX = /<(![a-zA-Z\\s]+)>/; // e.g., <!doctype html>\n\n/**\n * Parses HTML string to DOM nodes in browser.\n *\n * @param {string} html - HTML markup.\n * @return {DomElement[]} - DOM elements.\n */\nfunction HTMLDOMParser(html) {\n if (typeof html !== 'string') {\n throw new TypeError('First argument must be a string');\n }\n\n if (html === '') {\n return [];\n }\n\n // match directive\n var match = html.match(DIRECTIVE_REGEX);\n var directive;\n\n if (match && match[1]) {\n directive = match[1];\n }\n\n return formatDOM(domparser(html), null, directive);\n}\n\nmodule.exports = HTMLDOMParser;\n"],"names":["HTML","HEAD","BODY","FIRST_TAG_REGEX","HEAD_TAG_REGEX","BODY_TAG_REGEX","parseFromDocument","Error","parseFromString","window","DOMParser","domParser","html","tagName","document","implementation","doc","createHTMLDocument","documentElement","querySelector","innerHTML","parseFromTemplate","template","createElement","content","childNodes","domparser_1","firstTagName","element","elements","match","toLowerCase","test","parentNode","removeChild","querySelectorAll","ElementType","Object","defineProperty","exports","value","Doctype","CDATA","Tag","Style","Script","Comment","Directive","Text","Root","isTag","elem","type","extendStatics","__extends","this","d","b","setPrototypeOf","__proto__","Array","p","prototype","hasOwnProperty","call","TypeError","String","__","constructor","create","__assign","assign","t","s","i","n","arguments","length","apply","node","cloneNode","hasChildren","isDocument","isDirective","isComment","isCDATA","Element","Document","NodeWithChildren","ProcessingInstruction","Node","domelementtype_1","require$$0","parent","prev","next","startIndex","endIndex","get","set","enumerable","configurable","recursive","DataNode","_super","data","_this","name","children","_a","attribs","keys","map","_b","namespace","prefix","isText","result","cloneChildren","clone_1","forEach","child","clone_2","clone_3","concat","instruction","sourceCodeLocation","childs","__createBinding","o","m","k","k2","undefined","desc","getOwnPropertyDescriptor","__esModule","writable","__exportStar","DomHandler","node_js_1","require$$1","defaultOpts","withStartIndices","withEndIndices","xmlMode","callback","options","elementCB","dom","root","done","tagStack","lastNode","parser","onparserinit","onreset","onend","handleCallback","onerror","error","onclosetag","pop","onopentag","addNode","push","ontext","oncomment","oncommentend","oncdatastart","text","oncdataend","onprocessinginstruction","previousSibling","default","constants$1","domhandler","CASE_SENSITIVE_TAG_NAMES","caseSensitiveTagNamesMap","len","formatAttributes","attributes","attribute","formatTagName","caseSensitiveTagName","getCaseSensitiveTagName","utilities","formatDOM","nodes","directive","index","current","nodeType","nodeName","nodeValue","substring","indexOf","unshift","domparser","DIRECTIVE_REGEX"],"mapp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