@angular/platform-server
Version:
Angular - library for using Angular in Node.js
1 lines • 1.08 MB
Source Map (JSON)
{"version":3,"file":"init.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-46c76129e412/bin/packages/platform-server/init/src/bundled-domino.mjs","../../../../../darwin_arm64-fastbuild-ST-46c76129e412/bin/packages/platform-server/init/src/shims.ts","../../../../../darwin_arm64-fastbuild-ST-46c76129e412/bin/packages/platform-server/init/src/init.ts","../../../../../darwin_arm64-fastbuild-ST-46c76129e412/bin/packages/platform-server/init/index.ts"],"sourcesContent":["function getDefaultExportFromCjs (x) {\n\treturn x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;\n}\n\nvar lib = {};\n\nvar Event_1;\nvar hasRequiredEvent;\n\nfunction requireEvent () {\n\tif (hasRequiredEvent) return Event_1;\n\thasRequiredEvent = 1;\n\tEvent_1 = Event;\n\n\tEvent.CAPTURING_PHASE = 1;\n\tEvent.AT_TARGET = 2;\n\tEvent.BUBBLING_PHASE = 3;\n\n\tfunction Event(type, dictionary) {\n\t // Initialize basic event properties\n\t this.type = '';\n\t this.target = null;\n\t this.currentTarget = null;\n\t this.eventPhase = Event.AT_TARGET;\n\t this.bubbles = false;\n\t this.cancelable = false;\n\t this.isTrusted = false;\n\t this.defaultPrevented = false;\n\t this.timeStamp = Date.now();\n\n\t // Initialize internal flags\n\t // XXX: Would it be better to inherit these defaults from the prototype?\n\t this._propagationStopped = false;\n\t this._immediatePropagationStopped = false;\n\t this._initialized = true;\n\t this._dispatching = false;\n\n\t // Now initialize based on the constructor arguments (if any)\n\t if (type) this.type = type;\n\t if (dictionary) {\n\t for(var p in dictionary) {\n\t this[p] = dictionary[p];\n\t }\n\t }\n\t}\n\n\tEvent.prototype = Object.create(Object.prototype, {\n\t constructor: { value: Event },\n\t stopPropagation: { value: function stopPropagation() {\n\t this._propagationStopped = true;\n\t }},\n\n\t stopImmediatePropagation: { value: function stopImmediatePropagation() {\n\t this._propagationStopped = true;\n\t this._immediatePropagationStopped = true;\n\t }},\n\n\t preventDefault: { value: function preventDefault() {\n\t if (this.cancelable) this.defaultPrevented = true;\n\t }},\n\n\t initEvent: { value: function initEvent(type, bubbles, cancelable) {\n\t this._initialized = true;\n\t if (this._dispatching) return;\n\n\t this._propagationStopped = false;\n\t this._immediatePropagationStopped = false;\n\t this.defaultPrevented = false;\n\t this.isTrusted = false;\n\n\t this.target = null;\n\t this.type = type;\n\t this.bubbles = bubbles;\n\t this.cancelable = cancelable;\n\t }},\n\n\t});\n\treturn Event_1;\n}\n\nvar UIEvent_1;\nvar hasRequiredUIEvent;\n\nfunction requireUIEvent () {\n\tif (hasRequiredUIEvent) return UIEvent_1;\n\thasRequiredUIEvent = 1;\n\tvar Event = requireEvent();\n\n\tUIEvent_1 = UIEvent;\n\n\tfunction UIEvent() {\n\t // Just use the superclass constructor to initialize\n\t Event.call(this);\n\t this.view = null; // FF uses the current window\n\t this.detail = 0;\n\t}\n\tUIEvent.prototype = Object.create(Event.prototype, {\n\t constructor: { value: UIEvent },\n\t initUIEvent: { value: function(type, bubbles, cancelable, view, detail) {\n\t this.initEvent(type, bubbles, cancelable);\n\t this.view = view;\n\t this.detail = detail;\n\t }}\n\t});\n\treturn UIEvent_1;\n}\n\nvar MouseEvent_1;\nvar hasRequiredMouseEvent;\n\nfunction requireMouseEvent () {\n\tif (hasRequiredMouseEvent) return MouseEvent_1;\n\thasRequiredMouseEvent = 1;\n\tvar UIEvent = requireUIEvent();\n\n\tMouseEvent_1 = MouseEvent;\n\n\tfunction MouseEvent() {\n\t // Just use the superclass constructor to initialize\n\t UIEvent.call(this);\n\n\t this.screenX = this.screenY = this.clientX = this.clientY = 0;\n\t this.ctrlKey = this.altKey = this.shiftKey = this.metaKey = false;\n\t this.button = 0;\n\t this.buttons = 1;\n\t this.relatedTarget = null;\n\t}\n\tMouseEvent.prototype = Object.create(UIEvent.prototype, {\n\t constructor: { value: MouseEvent },\n\t initMouseEvent: { value: function(type, bubbles, cancelable,\n\t view, detail,\n\t screenX, screenY, clientX, clientY,\n\t ctrlKey, altKey, shiftKey, metaKey,\n\t button, relatedTarget) {\n\n\t this.initEvent(type, bubbles, cancelable, view, detail);\n\t this.screenX = screenX;\n\t this.screenY = screenY;\n\t this.clientX = clientX;\n\t this.clientY = clientY;\n\t this.ctrlKey = ctrlKey;\n\t this.altKey = altKey;\n\t this.shiftKey = shiftKey;\n\t this.metaKey = metaKey;\n\t this.button = button;\n\t switch(button) {\n\t case 0: this.buttons = 1; break;\n\t case 1: this.buttons = 4; break;\n\t case 2: this.buttons = 2; break;\n\t default: this.buttons = 0; break;\n\t }\n\t this.relatedTarget = relatedTarget;\n\t }},\n\n\t getModifierState: { value: function(key) {\n\t switch(key) {\n\t case \"Alt\": return this.altKey;\n\t case \"Control\": return this.ctrlKey;\n\t case \"Shift\": return this.shiftKey;\n\t case \"Meta\": return this.metaKey;\n\t default: return false;\n\t }\n\t }}\n\t});\n\treturn MouseEvent_1;\n}\n\nvar utils = {};\n\nvar config = {};\n\n/*\n * This file defines Domino behaviour that can be externally configured.\n * To change these settings, set the relevant global property *before*\n * you call `require(\"domino\")`.\n */\n\nvar hasRequiredConfig;\n\nfunction requireConfig () {\n\tif (hasRequiredConfig) return config;\n\thasRequiredConfig = 1;\n\tconfig.isApiWritable = !globalThis.__domino_frozen__;\n\treturn config;\n}\n\nvar hasRequiredUtils;\n\nfunction requireUtils () {\n\tif (hasRequiredUtils) return utils;\n\thasRequiredUtils = 1;\n\tvar isApiWritable = requireConfig().isApiWritable;\n\n\tutils.NAMESPACE = {\n\t HTML: 'http://www.w3.org/1999/xhtml',\n\t XML: 'http://www.w3.org/XML/1998/namespace',\n\t XMLNS: 'http://www.w3.org/2000/xmlns/',\n\t MATHML: 'http://www.w3.org/1998/Math/MathML',\n\t SVG: 'http://www.w3.org/2000/svg',\n\t XLINK: 'http://www.w3.org/1999/xlink',\n\t};\n\n\t//\n\t// Shortcut functions for throwing errors of various types.\n\t//\n\tutils.IndexSizeError = () => {\n\t throw new DOMException('The index is not in the allowed range', 'IndexSizeError');\n\t};\n\n\tutils.HierarchyRequestError = () => {\n\t throw new DOMException('The node tree hierarchy is not correct', 'HierarchyRequestError');\n\t};\n\n\tutils.WrongDocumentError = () => {\n\t throw new DOMException('The object is in the wrong Document', 'WrongDocumentError');\n\t};\n\n\tutils.InvalidCharacterError = () => {\n\t throw new DOMException('The string contains invalid characters', 'InvalidCharacterError');\n\t};\n\n\tutils.NoModificationAllowedError = () => {\n\t throw new DOMException('The object cannot be modified', 'NoModificationAllowedError');\n\t};\n\n\tutils.NotFoundError = () => {\n\t throw new DOMException('The object can not be found here', 'NotFoundError');\n\t};\n\n\tutils.NotSupportedError = () => {\n\t throw new DOMException('The operation is not supported', 'NotSupportedError');\n\t};\n\n\tutils.InvalidStateError = () => {\n\t throw new DOMException('The object is in an invalid state', 'InvalidStateError');\n\t};\n\n\tutils.SyntaxError = () => {\n\t throw new DOMException('The string did not match the expected pattern', 'SyntaxError');\n\t};\n\n\tutils.InvalidModificationError = () => {\n\t throw new DOMException('The object can not be modified in this way', 'InvalidModificationError');\n\t};\n\n\tutils.NamespaceError = () => {\n\t throw new DOMException('The operation is not allowed by Namespaces in XML', 'NamespaceError');\n\t};\n\n\tutils.InvalidAccessError = () => {\n\t throw new DOMException(\n\t 'The object does not support the operation or argument',\n\t 'InvalidAccessError'\n\t );\n\t};\n\n\tutils.TypeMismatchError = () => {\n\t throw new DOMException(\n\t 'The type of the object does not match the expected type',\n\t 'TypeMismatchError'\n\t );\n\t};\n\n\tutils.SecurityError = () => {\n\t throw new DOMException('The operation is insecure', 'SecurityError');\n\t};\n\n\tutils.NetworkError = () => {\n\t throw new DOMException('A network error occurred', 'NetworkError');\n\t};\n\n\tutils.AbortError = () => {\n\t throw new DOMException('The operation was aborted', 'AbortError');\n\t};\n\n\tutils.UrlMismatchError = () => {\n\t throw new DOMException('The given URL does not match another URL', 'URLMismatchError');\n\t};\n\n\tutils.QuotaExceededError = () => {\n\t throw new DOMException('The quota has been exceeded', 'QuotaExceededError');\n\t};\n\n\tutils.TimeoutError = () => {\n\t throw new DOMException('The operation timed out', 'TimeoutError');\n\t};\n\n\tutils.InvalidNodeTypeError = () => {\n\t throw new DOMException('The node is of an invalid type', 'InvalidNodeTypeError');\n\t};\n\n\tutils.DataCloneError = () => {\n\t throw new DOMException('The object can not be cloned', 'DataCloneError');\n\t};\n\n\tutils.InUseAttributeError = () => {\n\t throw new DOMException('The attribute is already in use', 'InUseAttributeError');\n\t};\n\n\tutils.nyi = function () {\n\t throw new Error('NotYetImplemented');\n\t};\n\n\tutils.shouldOverride = function () {\n\t throw new Error('Abstract function; should be overriding in subclass.');\n\t};\n\n\tutils.assert = function (expr, msg) {\n\t if (!expr) {\n\t throw new Error('Assertion failed: ' + (msg || '') + '\\n' + new Error().stack);\n\t }\n\t};\n\n\tutils.expose = function (src, c) {\n\t for (var n in src) {\n\t Object.defineProperty(c.prototype, n, {\n\t value: src[n],\n\t writable: isApiWritable,\n\t });\n\t }\n\t};\n\n\tutils.merge = function (a, b) {\n\t for (var n in b) {\n\t a[n] = b[n];\n\t }\n\t};\n\n\t// Compare two nodes based on their document order. This function is intended\n\t// to be passed to sort(). Assumes that the array being sorted does not\n\t// contain duplicates. And that all nodes are connected and comparable.\n\t// Clever code by ppk via jeresig.\n\tutils.documentOrder = function (n, m) {\n\t /* jshint bitwise: false */\n\t return 3 - (n.compareDocumentPosition(m) & 6);\n\t};\n\n\tutils.toASCIILowerCase = function (s) {\n\t return s.replace(/[A-Z]+/g, function (c) {\n\t return c.toLowerCase();\n\t });\n\t};\n\n\tutils.toASCIIUpperCase = function (s) {\n\t return s.replace(/[a-z]+/g, function (c) {\n\t return c.toUpperCase();\n\t });\n\t};\n\treturn utils;\n}\n\nvar EventTarget_1;\nvar hasRequiredEventTarget;\n\nfunction requireEventTarget () {\n\tif (hasRequiredEventTarget) return EventTarget_1;\n\thasRequiredEventTarget = 1;\n\tvar Event = requireEvent();\n\tvar MouseEvent = requireMouseEvent();\n\tvar utils = requireUtils();\n\n\tEventTarget_1 = EventTarget;\n\n\tfunction EventTarget() {}\n\n\tEventTarget.prototype = {\n\t // XXX\n\t // See WebIDL §4.8 for details on object event handlers\n\t // and how they should behave. We actually have to accept\n\t // any object to addEventListener... Can't type check it.\n\t // on registration.\n\n\t // XXX:\n\t // Capturing event listeners are sort of rare. I think I can optimize\n\t // them so that dispatchEvent can skip the capturing phase (or much of\n\t // it). Each time a capturing listener is added, increment a flag on\n\t // the target node and each of its ancestors. Decrement when removed.\n\t // And update the counter when nodes are added and removed from the\n\t // tree as well. Then, in dispatch event, the capturing phase can\n\t // abort if it sees any node with a zero count.\n\t addEventListener: function addEventListener(type, listener, capture) {\n\t if (!listener) return;\n\t if (capture === undefined) capture = false;\n\t if (!this._listeners) this._listeners = Object.create(null);\n\t if (!this._listeners[type]) this._listeners[type] = [];\n\t var list = this._listeners[type];\n\n\t // If this listener has already been registered, just return\n\t for(var i = 0, n = list.length; i < n; i++) {\n\t var l = list[i];\n\t if (l.listener === listener && l.capture === capture)\n\t return;\n\t }\n\n\t // Add an object to the list of listeners\n\t var obj = { listener: listener, capture: capture };\n\t if (typeof listener === 'function') obj.f = listener;\n\t list.push(obj);\n\t },\n\n\t removeEventListener: function removeEventListener(type,\n\t listener,\n\t capture) {\n\t if (capture === undefined) capture = false;\n\t if (this._listeners) {\n\t var list = this._listeners[type];\n\t if (list) {\n\t // Find the listener in the list and remove it\n\t for(var i = 0, n = list.length; i < n; i++) {\n\t var l = list[i];\n\t if (l.listener === listener && l.capture === capture) {\n\t if (list.length === 1) {\n\t this._listeners[type] = undefined;\n\t }\n\t else {\n\t list.splice(i, 1);\n\t }\n\t return;\n\t }\n\t }\n\t }\n\t }\n\t },\n\n\t // This is the public API for dispatching untrusted public events.\n\t // See _dispatchEvent for the implementation\n\t dispatchEvent: function dispatchEvent(event) {\n\t // Dispatch an untrusted event\n\t return this._dispatchEvent(event, false);\n\t },\n\n\t //\n\t // See DOMCore §4.4\n\t // XXX: I'll probably need another version of this method for\n\t // internal use, one that does not set isTrusted to false.\n\t // XXX: see Document._dispatchEvent: perhaps that and this could\n\t // call a common internal function with different settings of\n\t // a trusted boolean argument\n\t //\n\t // XXX:\n\t // The spec has changed in how to deal with handlers registered\n\t // on idl or content attributes rather than with addEventListener.\n\t // Used to say that they always ran first. That's how webkit does it\n\t // Spec now says that they run in a position determined by\n\t // when they were first set. FF does it that way. See:\n\t // http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#event-handlers\n\t //\n\t _dispatchEvent: function _dispatchEvent(event, trusted) {\n\t if (typeof trusted !== 'boolean') trusted = false;\n\t function invoke(target, event) {\n\t var type = event.type, phase = event.eventPhase;\n\t event.currentTarget = target;\n\n\t // If there was an individual handler defined, invoke it first\n\t // XXX: see comment above: this shouldn't always be first.\n\t if (phase !== Event.CAPTURING_PHASE &&\n\t target._handlers && target._handlers[type])\n\t {\n\t var handler = target._handlers[type];\n\t var rv;\n\t if (typeof handler === 'function') {\n\t rv=handler.call(event.currentTarget, event);\n\t }\n\t else {\n\t var f = handler.handleEvent;\n\t if (typeof f !== 'function')\n\t throw new TypeError('handleEvent property of ' +\n\t 'event handler object is' +\n\t 'not a function.');\n\t rv=f.call(handler, event);\n\t }\n\n\t switch(event.type) {\n\t case 'mouseover':\n\t if (rv === true) // Historical baggage\n\t event.preventDefault();\n\t break;\n\t case 'beforeunload':\n\t // XXX: eventually we need a special case here\n\t /* falls through */\n\t default:\n\t if (rv === false)\n\t event.preventDefault();\n\t break;\n\t }\n\t }\n\n\t // Now invoke list list of listeners for this target and type\n\t var list = target._listeners && target._listeners[type];\n\t if (!list) return;\n\t list = list.slice();\n\t for(var i = 0, n = list.length; i < n; i++) {\n\t if (event._immediatePropagationStopped) return;\n\t var l = list[i];\n\t if ((phase === Event.CAPTURING_PHASE && !l.capture) ||\n\t (phase === Event.BUBBLING_PHASE && l.capture))\n\t continue;\n\t if (l.f) {\n\t l.f.call(event.currentTarget, event);\n\t }\n\t else {\n\t var fn = l.listener.handleEvent;\n\t if (typeof fn !== 'function')\n\t throw new TypeError('handleEvent property of event listener object is not a function.');\n\t fn.call(l.listener, event);\n\t }\n\t }\n\t }\n\n\t if (!event._initialized || event._dispatching) utils.InvalidStateError();\n\t event.isTrusted = trusted;\n\n\t // Begin dispatching the event now\n\t event._dispatching = true;\n\t event.target = this;\n\n\t // Build the list of targets for the capturing and bubbling phases\n\t // XXX: we'll eventually have to add Window to this list.\n\t var ancestors = [];\n\t for(var n = this.parentNode; n; n = n.parentNode)\n\t ancestors.push(n);\n\n\t // Capturing phase\n\t event.eventPhase = Event.CAPTURING_PHASE;\n\t for(var i = ancestors.length-1; i >= 0; i--) {\n\t invoke(ancestors[i], event);\n\t if (event._propagationStopped) break;\n\t }\n\n\t // At target phase\n\t if (!event._propagationStopped) {\n\t event.eventPhase = Event.AT_TARGET;\n\t invoke(this, event);\n\t }\n\n\t // Bubbling phase\n\t if (event.bubbles && !event._propagationStopped) {\n\t event.eventPhase = Event.BUBBLING_PHASE;\n\t for(var ii = 0, nn = ancestors.length; ii < nn; ii++) {\n\t invoke(ancestors[ii], event);\n\t if (event._propagationStopped) break;\n\t }\n\t }\n\n\t event._dispatching = false;\n\t event.eventPhase = Event.AT_TARGET;\n\t event.currentTarget = null;\n\n\t // Deal with mouse events and figure out when\n\t // a click has happened\n\t if (trusted && !event.defaultPrevented && event instanceof MouseEvent) {\n\t switch(event.type) {\n\t case 'mousedown':\n\t this._armed = {\n\t x: event.clientX,\n\t y: event.clientY,\n\t t: event.timeStamp\n\t };\n\t break;\n\t case 'mouseout':\n\t case 'mouseover':\n\t this._armed = null;\n\t break;\n\t case 'mouseup':\n\t if (this._isClick(event)) this._doClick(event);\n\t this._armed = null;\n\t break;\n\t }\n\t }\n\n\n\n\t return !event.defaultPrevented;\n\t },\n\n\t // Determine whether a click occurred\n\t // XXX We don't support double clicks for now\n\t _isClick: function(event) {\n\t return (this._armed !== null &&\n\t event.type === 'mouseup' &&\n\t event.isTrusted &&\n\t event.button === 0 &&\n\t event.timeStamp - this._armed.t < 1000 &&\n\t Math.abs(event.clientX - this._armed.x) < 10 &&\n\t Math.abs(event.clientY - this._armed.Y) < 10);\n\t },\n\n\t // Clicks are handled like this:\n\t // http://www.whatwg.org/specs/web-apps/current-work/multipage/elements.html#interactive-content-0\n\t //\n\t // Note that this method is similar to the HTMLElement.click() method\n\t // The event argument must be the trusted mouseup event\n\t _doClick: function(event) {\n\t if (this._click_in_progress) return;\n\t this._click_in_progress = true;\n\n\t // Find the nearest enclosing element that is activatable\n\t // An element is activatable if it has a\n\t // _post_click_activation_steps hook\n\t var activated = this;\n\t while(activated && !activated._post_click_activation_steps)\n\t activated = activated.parentNode;\n\n\t if (activated && activated._pre_click_activation_steps) {\n\t activated._pre_click_activation_steps();\n\t }\n\n\t var click = this.ownerDocument.createEvent('MouseEvent');\n\t click.initMouseEvent('click', true, true,\n\t this.ownerDocument.defaultView, 1,\n\t event.screenX, event.screenY,\n\t event.clientX, event.clientY,\n\t event.ctrlKey, event.altKey,\n\t event.shiftKey, event.metaKey,\n\t event.button, null);\n\n\t var result = this._dispatchEvent(click, true);\n\n\t if (activated) {\n\t if (result) {\n\t // This is where hyperlinks get followed, for example.\n\t if (activated._post_click_activation_steps)\n\t activated._post_click_activation_steps(click);\n\t }\n\t else {\n\t if (activated._cancelled_activation_steps)\n\t activated._cancelled_activation_steps();\n\t }\n\t }\n\t },\n\n\t //\n\t // An event handler is like an event listener, but it registered\n\t // by setting an IDL or content attribute like onload or onclick.\n\t // There can only be one of these at a time for any event type.\n\t // This is an internal method for the attribute accessors and\n\t // content attribute handlers that need to register events handlers.\n\t // The type argument is the same as in addEventListener().\n\t // The handler argument is the same as listeners in addEventListener:\n\t // it can be a function or an object. Pass null to remove any existing\n\t // handler. Handlers are always invoked before any listeners of\n\t // the same type. They are not invoked during the capturing phase\n\t // of event dispatch.\n\t //\n\t _setEventHandler: function _setEventHandler(type, handler) {\n\t if (!this._handlers) this._handlers = Object.create(null);\n\t this._handlers[type] = handler;\n\t },\n\n\t _getEventHandler: function _getEventHandler(type) {\n\t return (this._handlers && this._handlers[type]) || null;\n\t }\n\n\t};\n\treturn EventTarget_1;\n}\n\nvar LinkedList = {exports: {}};\n\nvar hasRequiredLinkedList;\n\nfunction requireLinkedList () {\n\tif (hasRequiredLinkedList) return LinkedList.exports;\n\thasRequiredLinkedList = 1;\n\tvar utils = requireUtils();\n\n\tvar LinkedList$1 = LinkedList.exports = {\n\t // basic validity tests on a circular linked list a\n\t valid: function(a) {\n\t utils.assert(a, \"list falsy\");\n\t utils.assert(a._previousSibling, \"previous falsy\");\n\t utils.assert(a._nextSibling, \"next falsy\");\n\t // xxx check that list is actually circular\n\t return true;\n\t },\n\t // insert a before b\n\t insertBefore: function(a, b) {\n\t utils.assert(LinkedList$1.valid(a) && LinkedList$1.valid(b));\n\t var a_first = a, a_last = a._previousSibling;\n\t var b_first = b, b_last = b._previousSibling;\n\t a_first._previousSibling = b_last;\n\t a_last._nextSibling = b_first;\n\t b_last._nextSibling = a_first;\n\t b_first._previousSibling = a_last;\n\t utils.assert(LinkedList$1.valid(a) && LinkedList$1.valid(b));\n\t },\n\t // replace a single node a with a list b (which could be null)\n\t replace: function(a, b) {\n\t utils.assert(LinkedList$1.valid(a) && (b===null || LinkedList$1.valid(b)));\n\t if (b!==null) {\n\t LinkedList$1.insertBefore(b, a);\n\t }\n\t LinkedList$1.remove(a);\n\t utils.assert(LinkedList$1.valid(a) && (b===null || LinkedList$1.valid(b)));\n\t },\n\t // remove single node a from its list\n\t remove: function(a) {\n\t utils.assert(LinkedList$1.valid(a));\n\t var prev = a._previousSibling;\n\t if (prev === a) { return; }\n\t var next = a._nextSibling;\n\t prev._nextSibling = next;\n\t next._previousSibling = prev;\n\t a._previousSibling = a._nextSibling = a;\n\t utils.assert(LinkedList$1.valid(a));\n\t }\n\t};\n\treturn LinkedList.exports;\n}\n\nvar NodeUtils;\nvar hasRequiredNodeUtils;\n\nfunction requireNodeUtils () {\n\tif (hasRequiredNodeUtils) return NodeUtils;\n\thasRequiredNodeUtils = 1;\n\tNodeUtils = {\n\t // NOTE: The `serializeOne()` function used to live on the `Node.prototype`\n\t // as a private method `Node#_serializeOne(child)`, however that requires\n\t // a megamorphic property access `this._serializeOne` just to get to the\n\t // method, and this is being done on lots of different `Node` subclasses,\n\t // which puts a lot of pressure on V8's megamorphic stub cache. So by\n\t // moving the helper off of the `Node.prototype` and into a separate\n\t // function in this helper module, we get a monomorphic property access\n\t // `NodeUtils.serializeOne` to get to the function and reduce pressure\n\t // on the megamorphic stub cache.\n\t // See https://github.com/fgnass/domino/pull/142 for more information.\n\t serializeOne: serializeOne,\n\n\t // Export util functions so that we can run extra test for them.\n\t // Note: we prefix function names with `ɵ`, similar to what we do\n\t // with internal functions in Angular packages.\n\t ɵescapeMatchingClosingTag: escapeMatchingClosingTag,\n\t ɵescapeClosingCommentTag: escapeClosingCommentTag,\n\t ɵescapeProcessingInstructionContent: escapeProcessingInstructionContent\n\t};\n\n\tvar utils = requireUtils();\n\tvar NAMESPACE = utils.NAMESPACE;\n\n\tvar hasRawContent = {\n\t STYLE: true,\n\t SCRIPT: true,\n\t XMP: true,\n\t IFRAME: true,\n\t NOEMBED: true,\n\t NOFRAMES: true,\n\t PLAINTEXT: true\n\t};\n\n\tvar emptyElements = {\n\t area: true,\n\t base: true,\n\t basefont: true,\n\t bgsound: true,\n\t br: true,\n\t col: true,\n\t embed: true,\n\t frame: true,\n\t hr: true,\n\t img: true,\n\t input: true,\n\t keygen: true,\n\t link: true,\n\t meta: true,\n\t param: true,\n\t source: true,\n\t track: true,\n\t wbr: true\n\t};\n\n\tvar extraNewLine = {\n\t /* Removed in https://github.com/whatwg/html/issues/944\n\t pre: true,\n\t textarea: true,\n\t listing: true\n\t */\n\t};\n\n\tconst ESCAPE_REGEXP = /[&<>\\u00A0]/g;\n\tconst ESCAPE_ATTR_REGEXP = /[&\"<>\\u00A0]/g;\n\n\tfunction escape(s) {\n\t if (!ESCAPE_REGEXP.test(s)) {\n\t // nothing to do, fast path\n\t return s;\n\t }\n\n\t return s.replace(ESCAPE_REGEXP, (c) => {\n\t switch (c) {\n\t case \"&\":\n\t return \"&\";\n\t case \"<\":\n\t return \"<\";\n\t case \">\":\n\t return \">\";\n\t case \"\\u00A0\":\n\t return \" \";\n\t }\n\t });\n\t}\n\n\tfunction escapeAttr(s) {\n\t if (!ESCAPE_ATTR_REGEXP.test(s)) {\n\t // nothing to do, fast path\n\t return s;\n\t }\n\n\t return s.replace(ESCAPE_ATTR_REGEXP, (c) => {\n\t switch (c) {\n\t case \"<\":\n\t return \"<\";\n\t case \">\":\n\t return \">\";\n\t case \"&\":\n\t return \"&\";\n\t case '\"':\n\t return \""\";\n\t case \"\\u00A0\":\n\t return \" \";\n\t }\n\t });\n\t}\n\n\tfunction attrname(a) {\n\t var ns = a.namespaceURI;\n\t if (!ns)\n\t return a.localName;\n\t if (ns === NAMESPACE.XML)\n\t return 'xml:' + a.localName;\n\t if (ns === NAMESPACE.XLINK)\n\t return 'xlink:' + a.localName;\n\n\t if (ns === NAMESPACE.XMLNS) {\n\t if (a.localName === 'xmlns') return 'xmlns';\n\t else return 'xmlns:' + a.localName;\n\t }\n\t return a.name;\n\t}\n\n\t/**\n\t * Escapes matching closing tag in a raw text.\n\t *\n\t * For example, given `<style>#text(</style><script></script>)</style>`,\n\t * the parent tag would by \"style\" and the raw text is\n\t * \"</style><script></script>\". If we come across a matching closing tag\n\t * (in out case `</style>`) - replace `<` with `<` to avoid unexpected\n\t * and unsafe behavior after de-serialization.\n\t */\n\tfunction escapeMatchingClosingTag(rawText, parentTag) {\n\t const parentClosingTag = '</' + parentTag;\n\t if (!rawText.toLowerCase().includes(parentClosingTag)) {\n\t return rawText; // fast path\n\t }\n\t const result = [...rawText];\n\t const matches = rawText.matchAll(new RegExp(parentClosingTag, 'ig'));\n\t for (const match of matches) {\n\t result[match.index] = '<';\n\t }\n\t return result.join('');\n\t}\n\n\tconst CLOSING_COMMENT_REGEXP = /--!?>/;\n\n\t/**\n\t * Escapes closing comment tag in a comment content.\n\t *\n\t * For example, given `#comment('-->')`, the content of a comment would be\n\t * updated to `-->` to avoid unexpected and unsafe behavior after\n\t * de-serialization.\n\t */\n\tfunction escapeClosingCommentTag(rawContent) {\n\t if (!CLOSING_COMMENT_REGEXP.test(rawContent)) {\n\t return rawContent; // fast path\n\t }\n\t return rawContent.replace(/(--\\!?)>/g, '$1>');\n\t}\n\n\t/**\n\t * Escapes processing instruction content by replacing `>` with `>`.\n\t */\n\tfunction escapeProcessingInstructionContent(rawContent) {\n\t return rawContent.includes('>')\n\t ? rawContent.replaceAll('>', '>')\n\t : rawContent;\n\t}\n\n\tfunction serializeOne(kid, parent) {\n\t var s = '';\n\t switch(kid.nodeType) {\n\t case 1: //ELEMENT_NODE\n\t var ns = kid.namespaceURI;\n\t var html = ns === NAMESPACE.HTML;\n\t var tagname = (html || ns === NAMESPACE.SVG || ns === NAMESPACE.MATHML) ? kid.localName : kid.tagName;\n\n\t s += '<' + tagname;\n\n\t for(var j = 0, k = kid._numattrs; j < k; j++) {\n\t var a = kid._attr(j);\n\t s += ' ' + attrname(a);\n\t if (a.value !== undefined) s += '=\"' + escapeAttr(a.value) + '\"';\n\t }\n\t s += '>';\n\n\t if (!(html && emptyElements[tagname])) {\n\t var ss = kid.serialize();\n\t // If an element can have raw content, this content may\n\t // potentially require escaping to avoid XSS.\n\t if (hasRawContent[tagname.toUpperCase()]) {\n\t ss = escapeMatchingClosingTag(ss, tagname);\n\t }\n\t if (html && extraNewLine[tagname] && ss.charAt(0)==='\\n') s += '\\n';\n\t // Serialize children and add end tag for all others\n\t s += ss;\n\t s += '</' + tagname + '>';\n\t }\n\t break;\n\t case 3: //TEXT_NODE\n\t case 4: //CDATA_SECTION_NODE\n\t var parenttag;\n\t if (parent.nodeType === 1 /*ELEMENT_NODE*/ &&\n\t parent.namespaceURI === NAMESPACE.HTML)\n\t parenttag = parent.tagName;\n\t else\n\t parenttag = '';\n\n\t if (hasRawContent[parenttag] ||\n\t (parenttag==='NOSCRIPT' && parent.ownerDocument._scripting_enabled)) {\n\t s += kid.data;\n\t } else {\n\t s += escape(kid.data);\n\t }\n\t break;\n\t case 8: //COMMENT_NODE\n\t s += '<!--' + escapeClosingCommentTag(kid.data) + '-->';\n\t break;\n\t case 7: //PROCESSING_INSTRUCTION_NODE\n\t const content = escapeProcessingInstructionContent(kid.data);\n\t s += '<?' + kid.target + ' ' + content + '?>';\n\t break;\n\t case 10: //DOCUMENT_TYPE_NODE\n\t s += '<!DOCTYPE ' + kid.name;\n\n\t s += '>';\n\t break;\n\t default:\n\t utils.InvalidStateError();\n\t }\n\t return s;\n\t}\n\treturn NodeUtils;\n}\n\nvar Node_1;\nvar hasRequiredNode;\n\nfunction requireNode () {\n\tif (hasRequiredNode) return Node_1;\n\thasRequiredNode = 1;\n\tNode_1 = Node;\n\n\tvar EventTarget = requireEventTarget();\n\tvar LinkedList = requireLinkedList();\n\tvar NodeUtils = requireNodeUtils();\n\tvar utils = requireUtils();\n\n\t// All nodes have a nodeType and an ownerDocument.\n\t// Once inserted, they also have a parentNode.\n\t// This is an abstract class; all nodes in a document are instances\n\t// of a subtype, so all the properties are defined by more specific\n\t// constructors.\n\tfunction Node() {\n\t EventTarget.call(this);\n\t this.parentNode = null;\n\t this._nextSibling = this._previousSibling = this;\n\t this._index = undefined;\n\t}\n\n\tvar ELEMENT_NODE = Node.ELEMENT_NODE = 1;\n\tvar ATTRIBUTE_NODE = Node.ATTRIBUTE_NODE = 2;\n\tvar TEXT_NODE = Node.TEXT_NODE = 3;\n\tvar CDATA_SECTION_NODE = Node.CDATA_SECTION_NODE = 4;\n\tvar ENTITY_REFERENCE_NODE = Node.ENTITY_REFERENCE_NODE = 5;\n\tvar ENTITY_NODE = Node.ENTITY_NODE = 6;\n\tvar PROCESSING_INSTRUCTION_NODE = Node.PROCESSING_INSTRUCTION_NODE = 7;\n\tvar COMMENT_NODE = Node.COMMENT_NODE = 8;\n\tvar DOCUMENT_NODE = Node.DOCUMENT_NODE = 9;\n\tvar DOCUMENT_TYPE_NODE = Node.DOCUMENT_TYPE_NODE = 10;\n\tvar DOCUMENT_FRAGMENT_NODE = Node.DOCUMENT_FRAGMENT_NODE = 11;\n\tvar NOTATION_NODE = Node.NOTATION_NODE = 12;\n\n\tvar DOCUMENT_POSITION_DISCONNECTED = Node.DOCUMENT_POSITION_DISCONNECTED = 0x01;\n\tvar DOCUMENT_POSITION_PRECEDING = Node.DOCUMENT_POSITION_PRECEDING = 0x02;\n\tvar DOCUMENT_POSITION_FOLLOWING = Node.DOCUMENT_POSITION_FOLLOWING = 0x04;\n\tvar DOCUMENT_POSITION_CONTAINS = Node.DOCUMENT_POSITION_CONTAINS = 0x08;\n\tvar DOCUMENT_POSITION_CONTAINED_BY = Node.DOCUMENT_POSITION_CONTAINED_BY = 0x10;\n\tvar DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 0x20;\n\n\tNode.prototype = Object.create(EventTarget.prototype, {\n\n\t // Node that are not inserted into the tree inherit a null parent\n\n\t // XXX: the baseURI attribute is defined by dom core, but\n\t // a correct implementation of it requires HTML features, so\n\t // we'll come back to this later.\n\t baseURI: { get: utils.nyi },\n\n\t parentElement: { get: function() {\n\t return (this.parentNode && this.parentNode.nodeType===ELEMENT_NODE) ? this.parentNode : null;\n\t }},\n\n\t hasChildNodes: { value: utils.shouldOverride },\n\n\t firstChild: { get: utils.shouldOverride },\n\n\t lastChild: { get: utils.shouldOverride },\n\n\t isConnected: {\n\t get: function () {\n\t let node = this;\n\t while (node != null) {\n\t if (node.nodeType === Node.DOCUMENT_NODE) {\n\t return true;\n\t }\n\n\t node = node.parentNode;\n\t if (node != null && node.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {\n\t node = node.host;\n\t }\n\t }\n\t return false;\n\t },\n\t },\n\n\t previousSibling: { get: function() {\n\t var parent = this.parentNode;\n\t if (!parent) return null;\n\t if (this === parent.firstChild) return null;\n\t return this._previousSibling;\n\t }},\n\n\t nextSibling: { get: function() {\n\t var parent = this.parentNode, next = this._nextSibling;\n\t if (!parent) return null;\n\t if (next === parent.firstChild) return null;\n\t return next;\n\t }},\n\n\t textContent: {\n\t // Should override for DocumentFragment/Element/Attr/Text/PI/Comment\n\t get: function() { return null; },\n\t set: function(v) { /* do nothing */ },\n\t },\n\n\t innerText: {\n\t // Should override for DocumentFragment/Element/Attr/Text/PI/Comment\n\t get: function() { return null; },\n\t set: function(v) { /* do nothing */ },\n\t },\n\n\t _countChildrenOfType: { value: function(type) {\n\t var sum = 0;\n\t for (var kid = this.firstChild; kid !== null; kid = kid.nextSibling) {\n\t if (kid.nodeType === type) sum++;\n\t }\n\t return sum;\n\t }},\n\n\t _ensureInsertValid: { value: function _ensureInsertValid(node, child, isPreinsert) {\n\t var parent = this, i, kid;\n\t if (!node.nodeType) throw new TypeError('not a node');\n\t // 1. If parent is not a Document, DocumentFragment, or Element\n\t // node, throw a HierarchyRequestError.\n\t switch (parent.nodeType) {\n\t case DOCUMENT_NODE:\n\t case DOCUMENT_FRAGMENT_NODE:\n\t case ELEMENT_NODE:\n\t break;\n\t default: utils.HierarchyRequestError();\n\t }\n\t // 2. If node is a host-including inclusive ancestor of parent,\n\t // throw a HierarchyRequestError.\n\t if (node.isAncestor(parent)) utils.HierarchyRequestError();\n\t // 3. If child is not null and its parent is not parent, then\n\t // throw a NotFoundError. (replaceChild omits the 'child is not null'\n\t // and throws a TypeError here if child is null.)\n\t if (child !== null || !isPreinsert) {\n\t if (child.parentNode !== parent) utils.NotFoundError();\n\t }\n\t // 4. If node is not a DocumentFragment, DocumentType, Element,\n\t // Text, ProcessingInstruction, or Comment node, throw a\n\t // HierarchyRequestError.\n\t switch (node.nodeType) {\n\t case DOCUMENT_FRAGMENT_NODE:\n\t case DOCUMENT_TYPE_NODE:\n\t case ELEMENT_NODE:\n\t case TEXT_NODE:\n\t case PROCESSING_INSTRUCTION_NODE:\n\t case COMMENT_NODE:\n\t break;\n\t default: utils.HierarchyRequestError();\n\t }\n\t // 5. If either node is a Text node and parent is a document, or\n\t // node is a doctype and parent is not a document, throw a\n\t // HierarchyRequestError.\n\t // 6. If parent is a document, and any of the statements below, switched\n\t // on node, are true, throw a HierarchyRequestError.\n\t if (parent.nodeType === DOCUMENT_NODE) {\n\t switch (node.nodeType) {\n\t case TEXT_NODE:\n\t utils.HierarchyRequestError();\n\t break;\n\t case DOCUMENT_FRAGMENT_NODE:\n\t // 6a1. If node has more than one element child or has a Text\n\t // node child.\n\t if (node._countChildrenOfType(TEXT_NODE) > 0)\n\t utils.HierarchyRequestError();\n\t switch (node._countChildrenOfType(ELEMENT_NODE)) {\n\t case 0:\n\t break;\n\t case 1:\n\t // 6a2. Otherwise, if node has one element child and either\n\t // parent has an element child, child is a doctype, or child\n\t // is not null and a doctype is following child. [preinsert]\n\t // 6a2. Otherwise, if node has one element child and either\n\t // parent has an element child that is not child or a\n\t // doctype is following child. [replaceWith]\n\t if (child !== null /* always true here for replaceWith */) {\n\t if (isPreinsert && child.nodeType === DOCUMENT_TYPE_NODE)\n\t utils.HierarchyRequestError();\n\t for (kid = child.nextSibling; kid !== null; kid = kid.nextSibling) {\n\t if (kid.nodeType === DOCUMENT_TYPE_NODE)\n\t utils.HierarchyRequestError();\n\t }\n\t }\n\t i = parent._countChildrenOfType(ELEMENT_NODE);\n\t if (isPreinsert) {\n\t // \"parent has an element child\"\n\t if (i > 0)\n\t utils.HierarchyRequestError();\n\t } else {\n\t // \"parent has an element child that is not child\"\n\t if (i > 1 || (i === 1 && child.nodeType !== ELEMENT_NODE))\n\t utils.HierarchyRequestError();\n\t }\n\t break;\n\t default: // 6a1, continued. (more than one Element child)\n\t utils.HierarchyRequestError();\n\t }\n\t break;\n\t case ELEMENT_NODE:\n\t // 6b. parent has an element child, child is a doctype, or\n\t // child is not null and a doctype is following child. [preinsert]\n\t // 6b. parent has an element child that is not child or a\n\t // doctype is following child. [replaceWith]\n\t if (child !== null /* always true here for replaceWith */) {\n\t if (isPreinsert && child.nodeType === DOCUMENT_TYPE_NODE)\n\t utils.HierarchyRequestError();\n\t for (kid = child.nextSibling; kid !== null; kid = kid.nextSibling) {\n\t if (kid.nodeType === DOCUMENT_TYPE_NODE)\n\t utils.HierarchyRequestError();\n\t }\n\t }\n\t i = parent._countChildrenOfType(ELEMENT_NODE);\n\t if (isPreinsert) {\n\t // \"parent has an element child\"\n\t if (i > 0)\n\t utils.HierarchyRequestError();\n\t } else {\n\t // \"parent has an element child that is not child\"\n\t if (i > 1 || (i === 1 && child.nodeType !== ELEMENT_NODE))\n\t utils.HierarchyRequestError();\n\t }\n\t break;\n\t case DOCUMENT_TYPE_NODE:\n\t // 6c. parent has a doctype child, child is non-null and an\n\t // element is preceding child, or child is null and parent has\n\t // an element child. [preinsert]\n\t // 6c. parent has a doctype child that is not child, or an\n\t // element is preceding child. [replaceWith]\n\t if (child === null) {\n\t if (parent._countChildrenOfType(ELEMENT_NODE))\n\t utils.HierarchyRequestError();\n\t } else {\n\t // child is always non-null for [replaceWith] case\n\t for (kid = parent.firstChild; kid !== null; kid = kid.nextSibling) {\n\t if (kid === child) break;\n\t if (kid.nodeType === ELEMENT_NODE)\n\t utils.HierarchyRequestError();\n\t }\n\t }\n\t i = parent._countChildrenOfType(DOCUMENT_TYPE_NODE);\n\t if (isPreinsert) {\n\t // \"parent has an doctype child\"\n\t if (i > 0)\n\t utils.HierarchyRequestError();\n\t } else {\n\t // \"parent has an doctype child that is not child\"\n\t if (i > 1 || (i === 1 && child.nodeType !== DOCUMENT_TYPE_NODE))\n\t utils.HierarchyRequestError();\n\t }\n\t break;\n\t }\n\t } else {\n\t // 5, continued: (parent is not a document)\n\t if (node.nodeType === DOCUMENT_TYPE_NODE) utils.HierarchyRequestError();\n\t }\n\t }},\n\n\t insertBefore: { value: function insertBefore(node, child) {\n\t var parent = this;\n\t // 1. Ensure pre-insertion validity\n\t parent._ensureInsertValid(node, child, true);\n\t // 2. Let reference child be child.\n\t var refChild = child;\n\t // 3. If reference child is node, set it to node's next sibling\n\t if (refChild === node) { refChild = node.nextSibling; }\n\t // 4. Adopt node into parent's node document.\n\t parent.doc.adoptNode(node);\n\t // 5. Insert node into parent before reference child.\n\t node._insertOrReplace(parent, refChild, false);\n\t // 6. Return node\n\t return node;\n\t }},\n\n\n\t appendChild: { value: function(child) {\n\t // This invokes _appendChild after doing validity checks.\n\t return this.insertBefore(child, null);\n\t }},\n\n\t _appendChild: { value: function(child) {\n\t child._insertOrReplace(this, null, false);\n\t }},\n\n\t removeChild: { value: function removeChild(child) {\n\t var parent = this;\n\t if (!child.nodeType) throw new TypeError('not a node');\n\t if (child.parentNode !== parent) utils.NotFoundError();\n\t child.remove();\n\t return child;\n\t }},\n\n\t // To replace a `child` with `node` within a `parent` (this)\n\t replaceChild: { value: function replaceChild(node, child) {\n\t var parent = this;\n\t // Ensure validity (slight differences from pre-insertion check)\n\t parent._ensureInsertValid(node, child, false);\n\t // Adopt node into parent's node document.\n\t if (node.doc !== parent.doc) {\n\t // XXX adoptNode has side-effect of removing node from its parent\n\t // and generating a mutation event, thus causing the _insertOrReplace\n\t // to generate two deletes and an insert instead of a 'move'\n\t // event. It looks like the new MutationObserver stuff avoids\n\t // this problem, but for now let's only adopt (ie, remove `node`\n\t // from its parent) here if we need to.\n\t parent.doc.adoptNode(node);\n\t }\n\t // Do the replace.\n\t node._insertOrReplace(parent, child, true);\n\t return child;\n\t }},\n\n\t // See: http://ejohn.org/blog/comparing-document-position/\n\t contains: { value: function contains(node) {\n\t if (node === null) { return false; }\n\t if (this === node) { return true; /* inclusive descendant */ }\n\t /* jshint bitwise: false */\n\t return (this.compareDocumentPosition(node) &\n\t DOCUMENT_POSITION_CONTAINED_BY) !== 0;\n\t }},\n\n\t compareDocumentPosition: { value: function compareDocumentPosition(that){\n\t // Basic algorithm for finding the relative position of two nodes.\n\t // Make a list the ancestors of each node, starting with the\n\t // document element and proceeding down to the nodes themselves.\n\t // Then, loop through the lists, looking for the first element\n\t // that differs. The order of those two elements give the\n\t // order of their descendant nodes. Or, if one list is a prefix\n\t // of the other one, then that node contains the other.\n\n\t if (this === that) return 0;\n\n\t // If they're not owned by the same document or if one is rooted\n\t // and one is not, then they're disconnected.\n\t if (this.doc !== that.doc ||\n\t this.rooted !== that.rooted)\n\t return (DOCUMENT_POSITION_DISCONNECTED +\n\t DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC);\n\n\t // Get arrays of ancestors for this and that\n\t var these = [], those = [];\n\t for(var n = this; n !== null; n = n.parentNode) these.push(n);\n\t for(n = that; n !== null; n = n.parentNode) those.push(n);\n\t these.reverse(); // So we start with the outermost\n\t those.reverse();\n\n\t if (these[0] !== those[0]) // No common ancestor\n\t return (DOCUMENT_POSITION_DISCONNECTED +\n\t DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC);\n\n\t n = Math.min(these.length, those.length);\n\t for(var i = 1; i < n; i++) {\n\t if (these[i] !== those[i]) {\n\t // We found two different ancestors, so compare\n\t // their positions\n\t if (these[i].index < those[i].index)\n\t return DOCUMENT_POSITION_FOLLOWING;\n\t else\n\t return DOCUMENT_POSITION_PRECEDING;\n\t }\n\t }\n\n\t // If we get to here, then one of the nodes (the one with the\n\t // shorter list of ancestors) contains the other one.\n\t if (these.length < those.length)\n\t return (DOCUMENT_POSITION_FOLLOWING +\n\t DOCUMENT_POSITION_CONTAINED_BY);\n\t else\n\t return (DOCUMENT_POSITION_PRECEDING +\n\t DOCUMENT_POSITION_CONTAINS);\n\t }},\n\n\t isSameNode: {value : function isSameNode(node) {\n\t return this === node;\n\t }},\n\n\n\t // This method implements the generic parts of node equality testing\n\t // and defers to the (non-recursive) type-specific isEqual() method\n\t // defined by subclasses\n\t isEqualNode: { value: function isEqualNode(node) {\n\t if (!node) return false;\n\t if (node.nodeType !== this.nodeType) return false;\n\n\t // Check type-specific properties for equality\n\t if (!this.isEqual(node)) return false;\n\n\t // Now check children for number and equality\n\t for (var c1 = this.firstChild, c2 = node.firstChild;\n\t c1 && c2;\n\t c1 = c1.nextSibling, c2 = c2.nextSibling) {\n\t if (!c1.isEqualNode(c2)) return false;\n\t }\n\t return c1 === null && c2 === null;\n\t }},\n\n\t // This method delegates shallow cloning to a clone() method\n\t // that each concrete subclass must implement\n\t cloneNode: { value: function(deep) {\n\t // Clone this node\n\t var clone = this.clone();\n\n\t // Handle the recursive case if necessary\n\t if (deep) {\n\t for (var kid = this.firstChild; kid !== null; kid = kid.nextSibling) {\n\t clone._appendChild(kid.cloneNode(true));\n\t }\n\t }\n\n\t return clone;\n\t }},\n\n\t lookupPrefix: { value: function lookupPrefix(ns) {\n\t var e;\n\t if (ns === '' || ns === null || ns === undefined) return null;\n\t switch(this.nodeType) {\n\t case ELEMENT_NODE:\n\t return this._lookupNamespacePrefix(ns, this);\n\t case DOCUMENT_NODE:\n\t e = this.documentElement;\n\t return e ? e.lookupPrefix(ns) : null;\n\t case ENTITY_NODE:\n\t case NOTATION_NODE:\n\t case DOCUMENT_FRAGMENT_NODE:\n\t case DOCUMENT_TYPE_NODE:\n\t return null;\n\t case ATTRIBUTE_NODE:\n\t e = this.ownerElement;\n\t return e ? e.lookupPrefix(ns) : null;\n\t default:\n\t e = this.parentElement;\n\t return e ? e.lookupPrefix(ns) : null;\n\t }\n\t }},\n\n\n\t lookupNamespaceURI: {value: function lookupNamespaceURI(prefix) {\n\t if (prefix === '' || prefix === undefined) { prefix = null; }\n\t var e;\n\t switch(this.nodeType) {\n\t case ELEMENT_NODE:\n\t return utils.shouldOverride();\n\t case DOCUMENT_NODE:\n\t e = this.documentElement;\n\t return e ? e.lookupNamespaceURI(prefix) : null;\n\t case ENTITY_NODE:\n\t case NOTATION_NODE:\n\t case DOCUMENT_TYPE_NODE:\n\t case DOCUMENT_FRAGMENT_NODE:\n\t return null;\n\t case ATTRIBUTE_NODE:\n\t e = this.ownerElement;\n\t return e ? e.lookupNamespaceURI(prefix) : null;\n\t default:\n\t e = this.parentElement;\n\t return e ? e.lookupNamespaceURI(prefix) : null;\n\t }\n\t }},\n\n\t isDefaultNamespace: { value: function isDefaultNamespace(ns) {\n\t if (ns === '' || ns === undefined) { ns = null; }\n\t var defaultNamespace = this.lookupNamespaceURI(null);\n\t return (defaultNamespace === ns);\n\t }},\n\n\t // Utility methods for nodes. Not part of the DOM\n\n\t // Return the index of this node in its parent.\n\t // Throw if no parent, or if this node is not a child of its parent\n\t index: { get: function() {\n\t var parent = this.parentNode;\n\t if (this === parent.firstChild) return 0; // fast case\n\t var kids = parent.childNodes;\n\t if (this._index === undefined || kids[this._index] !== this) {\n\t // Ensure that we don't have an O(N^2) blowup if none of the\n\t // kids have defined indices yet and we're traversing via\n\t // nextSibling or previousSibling\n\t for (var i=0; i<kids.length; i++) {\n\t kids[i]._index = i;\n\t }\n\t utils.assert(kids[this._index] === this);\n\t }\n\t return this._index;\n\t }},\n\n\t // Return true if this node is equal to or is an ance