UNPKG

create-expo-cljs-app

Version:

Create a react native application with Expo and Shadow-CLJS!

1 lines 344 kB
["^ ","~:resource-id",["~:shadow.build.classpath/resource","goog/dom/dom.js"],"~:js","goog.provide(\"goog.dom\");\ngoog.provide(\"goog.dom.Appendable\");\ngoog.provide(\"goog.dom.DomHelper\");\ngoog.require(\"goog.array\");\ngoog.require(\"goog.asserts\");\ngoog.require(\"goog.dom.BrowserFeature\");\ngoog.require(\"goog.dom.NodeType\");\ngoog.require(\"goog.dom.TagName\");\ngoog.require(\"goog.dom.safe\");\ngoog.require(\"goog.html.SafeHtml\");\ngoog.require(\"goog.html.uncheckedconversions\");\ngoog.require(\"goog.math.Coordinate\");\ngoog.require(\"goog.math.Size\");\ngoog.require(\"goog.object\");\ngoog.require(\"goog.string\");\ngoog.require(\"goog.string.Unicode\");\ngoog.require(\"goog.userAgent\");\ngoog.dom.ASSUME_QUIRKS_MODE = goog.define(\"goog.dom.ASSUME_QUIRKS_MODE\", false);\ngoog.dom.ASSUME_STANDARDS_MODE = goog.define(\"goog.dom.ASSUME_STANDARDS_MODE\", false);\ngoog.dom.COMPAT_MODE_KNOWN_ = goog.dom.ASSUME_QUIRKS_MODE || goog.dom.ASSUME_STANDARDS_MODE;\ngoog.dom.getDomHelper = function(opt_element) {\n return opt_element ? new goog.dom.DomHelper(goog.dom.getOwnerDocument(opt_element)) : goog.dom.defaultDomHelper_ || (goog.dom.defaultDomHelper_ = new goog.dom.DomHelper);\n};\ngoog.dom.defaultDomHelper_;\ngoog.dom.getDocument = function() {\n return document;\n};\ngoog.dom.getElement = function(element) {\n return goog.dom.getElementHelper_(document, element);\n};\ngoog.dom.getElementHelper_ = function(doc, element) {\n return typeof element === \"string\" ? doc.getElementById(element) : element;\n};\ngoog.dom.getRequiredElement = function(id) {\n return goog.dom.getRequiredElementHelper_(document, id);\n};\ngoog.dom.getRequiredElementHelper_ = function(doc, id) {\n goog.asserts.assertString(id);\n var element = goog.dom.getElementHelper_(doc, id);\n element = goog.asserts.assertElement(element, \"No element found with id: \" + id);\n return element;\n};\ngoog.dom.$ = goog.dom.getElement;\ngoog.dom.getElementsByTagName = function(tagName, opt_parent) {\n var parent = opt_parent || document;\n return parent.getElementsByTagName(String(tagName));\n};\ngoog.dom.getElementsByTagNameAndClass = function(opt_tag, opt_class, opt_el) {\n return goog.dom.getElementsByTagNameAndClass_(document, opt_tag, opt_class, opt_el);\n};\ngoog.dom.getElementByTagNameAndClass = function(opt_tag, opt_class, opt_el) {\n return goog.dom.getElementByTagNameAndClass_(document, opt_tag, opt_class, opt_el);\n};\ngoog.dom.getElementsByClass = function(className, opt_el) {\n var parent = opt_el || document;\n if (goog.dom.canUseQuerySelector_(parent)) {\n return parent.querySelectorAll(\".\" + className);\n }\n return goog.dom.getElementsByTagNameAndClass_(document, \"*\", className, opt_el);\n};\ngoog.dom.getElementByClass = function(className, opt_el) {\n var parent = opt_el || document;\n var retVal = null;\n if (parent.getElementsByClassName) {\n retVal = parent.getElementsByClassName(className)[0];\n } else {\n retVal = goog.dom.getElementByTagNameAndClass_(document, \"*\", className, opt_el);\n }\n return retVal || null;\n};\ngoog.dom.getRequiredElementByClass = function(className, opt_root) {\n var retValue = goog.dom.getElementByClass(className, opt_root);\n return goog.asserts.assert(retValue, \"No element found with className: \" + className);\n};\ngoog.dom.canUseQuerySelector_ = function(parent) {\n return !!(parent.querySelectorAll && parent.querySelector);\n};\ngoog.dom.getElementsByTagNameAndClass_ = function(doc, opt_tag, opt_class, opt_el) {\n var parent = opt_el || doc;\n var tagName = opt_tag && opt_tag != \"*\" ? String(opt_tag).toUpperCase() : \"\";\n if (goog.dom.canUseQuerySelector_(parent) && (tagName || opt_class)) {\n var query = tagName + (opt_class ? \".\" + opt_class : \"\");\n return parent.querySelectorAll(query);\n }\n if (opt_class && parent.getElementsByClassName) {\n var els = parent.getElementsByClassName(opt_class);\n if (tagName) {\n var arrayLike = {};\n var len = 0;\n for (var i = 0, el; el = els[i]; i++) {\n if (tagName == el.nodeName) {\n arrayLike[len++] = el;\n }\n }\n arrayLike.length = len;\n return arrayLike;\n } else {\n return els;\n }\n }\n var els = parent.getElementsByTagName(tagName || \"*\");\n if (opt_class) {\n var arrayLike = {};\n var len = 0;\n for (var i = 0, el; el = els[i]; i++) {\n var className = el.className;\n if (typeof className.split == \"function\" && goog.array.contains(className.split(/\\s+/), opt_class)) {\n arrayLike[len++] = el;\n }\n }\n arrayLike.length = len;\n return arrayLike;\n } else {\n return els;\n }\n};\ngoog.dom.getElementByTagNameAndClass_ = function(doc, opt_tag, opt_class, opt_el) {\n var parent = opt_el || doc;\n var tag = opt_tag && opt_tag != \"*\" ? String(opt_tag).toUpperCase() : \"\";\n if (goog.dom.canUseQuerySelector_(parent) && (tag || opt_class)) {\n return parent.querySelector(tag + (opt_class ? \".\" + opt_class : \"\"));\n }\n var elements = goog.dom.getElementsByTagNameAndClass_(doc, opt_tag, opt_class, opt_el);\n return elements[0] || null;\n};\ngoog.dom.$$ = goog.dom.getElementsByTagNameAndClass;\ngoog.dom.setProperties = function(element, properties) {\n goog.object.forEach(properties, function(val, key) {\n if (val && typeof val == \"object\" && val.implementsGoogStringTypedString) {\n val = val.getTypedStringValue();\n }\n if (key == \"style\") {\n element.style.cssText = val;\n } else {\n if (key == \"class\") {\n element.className = val;\n } else {\n if (key == \"for\") {\n element.htmlFor = val;\n } else {\n if (goog.dom.DIRECT_ATTRIBUTE_MAP_.hasOwnProperty(key)) {\n element.setAttribute(goog.dom.DIRECT_ATTRIBUTE_MAP_[key], val);\n } else {\n if (goog.string.startsWith(key, \"aria-\") || goog.string.startsWith(key, \"data-\")) {\n element.setAttribute(key, val);\n } else {\n element[key] = val;\n }\n }\n }\n }\n }\n });\n};\ngoog.dom.DIRECT_ATTRIBUTE_MAP_ = {\"cellpadding\":\"cellPadding\", \"cellspacing\":\"cellSpacing\", \"colspan\":\"colSpan\", \"frameborder\":\"frameBorder\", \"height\":\"height\", \"maxlength\":\"maxLength\", \"nonce\":\"nonce\", \"role\":\"role\", \"rowspan\":\"rowSpan\", \"type\":\"type\", \"usemap\":\"useMap\", \"valign\":\"vAlign\", \"width\":\"width\"};\ngoog.dom.getViewportSize = function(opt_window) {\n return goog.dom.getViewportSize_(opt_window || window);\n};\ngoog.dom.getViewportSize_ = function(win) {\n var doc = win.document;\n var el = goog.dom.isCss1CompatMode_(doc) ? doc.documentElement : doc.body;\n return new goog.math.Size(el.clientWidth, el.clientHeight);\n};\ngoog.dom.getDocumentHeight = function() {\n return goog.dom.getDocumentHeight_(window);\n};\ngoog.dom.getDocumentHeightForWindow = function(win) {\n return goog.dom.getDocumentHeight_(win);\n};\ngoog.dom.getDocumentHeight_ = function(win) {\n var doc = win.document;\n var height = 0;\n if (doc) {\n var body = doc.body;\n var docEl = doc.documentElement;\n if (!(docEl && body)) {\n return 0;\n }\n var vh = goog.dom.getViewportSize_(win).height;\n if (goog.dom.isCss1CompatMode_(doc) && docEl.scrollHeight) {\n height = docEl.scrollHeight != vh ? docEl.scrollHeight : docEl.offsetHeight;\n } else {\n var sh = docEl.scrollHeight;\n var oh = docEl.offsetHeight;\n if (docEl.clientHeight != oh) {\n sh = body.scrollHeight;\n oh = body.offsetHeight;\n }\n if (sh > vh) {\n height = sh > oh ? sh : oh;\n } else {\n height = sh < oh ? sh : oh;\n }\n }\n }\n return height;\n};\ngoog.dom.getPageScroll = function(opt_window) {\n var win = opt_window || goog.global || window;\n return goog.dom.getDomHelper(win.document).getDocumentScroll();\n};\ngoog.dom.getDocumentScroll = function() {\n return goog.dom.getDocumentScroll_(document);\n};\ngoog.dom.getDocumentScroll_ = function(doc) {\n var el = goog.dom.getDocumentScrollElement_(doc);\n var win = goog.dom.getWindow_(doc);\n if (goog.userAgent.IE && goog.userAgent.isVersionOrHigher(\"10\") && win.pageYOffset != el.scrollTop) {\n return new goog.math.Coordinate(el.scrollLeft, el.scrollTop);\n }\n return new goog.math.Coordinate(win.pageXOffset || el.scrollLeft, win.pageYOffset || el.scrollTop);\n};\ngoog.dom.getDocumentScrollElement = function() {\n return goog.dom.getDocumentScrollElement_(document);\n};\ngoog.dom.getDocumentScrollElement_ = function(doc) {\n if (doc.scrollingElement) {\n return doc.scrollingElement;\n }\n if (!goog.userAgent.WEBKIT && goog.dom.isCss1CompatMode_(doc)) {\n return doc.documentElement;\n }\n return doc.body || doc.documentElement;\n};\ngoog.dom.getWindow = function(opt_doc) {\n return opt_doc ? goog.dom.getWindow_(opt_doc) : window;\n};\ngoog.dom.getWindow_ = function(doc) {\n return doc.parentWindow || doc.defaultView;\n};\ngoog.dom.createDom = function(tagName, opt_attributes, var_args) {\n return goog.dom.createDom_(document, arguments);\n};\ngoog.dom.createDom_ = function(doc, args) {\n var tagName = String(args[0]);\n var attributes = args[1];\n if (!goog.dom.BrowserFeature.CAN_ADD_NAME_OR_TYPE_ATTRIBUTES && attributes && (attributes.name || attributes.type)) {\n var tagNameArr = [\"\\x3c\", tagName];\n if (attributes.name) {\n tagNameArr.push(' name\\x3d\"', goog.string.htmlEscape(attributes.name), '\"');\n }\n if (attributes.type) {\n tagNameArr.push(' type\\x3d\"', goog.string.htmlEscape(attributes.type), '\"');\n var clone = {};\n goog.object.extend(clone, attributes);\n delete clone[\"type\"];\n attributes = clone;\n }\n tagNameArr.push(\"\\x3e\");\n tagName = tagNameArr.join(\"\");\n }\n var element = goog.dom.createElement_(doc, tagName);\n if (attributes) {\n if (typeof attributes === \"string\") {\n element.className = attributes;\n } else {\n if (goog.isArray(attributes)) {\n element.className = attributes.join(\" \");\n } else {\n goog.dom.setProperties(element, attributes);\n }\n }\n }\n if (args.length > 2) {\n goog.dom.append_(doc, element, args, 2);\n }\n return element;\n};\ngoog.dom.append_ = function(doc, parent, args, startIndex) {\n function childHandler(child) {\n if (child) {\n parent.appendChild(typeof child === \"string\" ? doc.createTextNode(child) : child);\n }\n }\n for (var i = startIndex; i < args.length; i++) {\n var arg = args[i];\n if (goog.isArrayLike(arg) && !goog.dom.isNodeLike(arg)) {\n goog.array.forEach(goog.dom.isNodeList(arg) ? goog.array.toArray(arg) : arg, childHandler);\n } else {\n childHandler(arg);\n }\n }\n};\ngoog.dom.$dom = goog.dom.createDom;\ngoog.dom.createElement = function(name) {\n return goog.dom.createElement_(document, name);\n};\ngoog.dom.createElement_ = function(doc, name) {\n name = String(name);\n if (doc.contentType === \"application/xhtml+xml\") {\n name = name.toLowerCase();\n }\n return doc.createElement(name);\n};\ngoog.dom.createTextNode = function(content) {\n return document.createTextNode(String(content));\n};\ngoog.dom.createTable = function(rows, columns, opt_fillWithNbsp) {\n return goog.dom.createTable_(document, rows, columns, !!opt_fillWithNbsp);\n};\ngoog.dom.createTable_ = function(doc, rows, columns, fillWithNbsp) {\n var table = goog.dom.createElement_(doc, goog.dom.TagName.TABLE);\n var tbody = table.appendChild(goog.dom.createElement_(doc, goog.dom.TagName.TBODY));\n for (var i = 0; i < rows; i++) {\n var tr = goog.dom.createElement_(doc, goog.dom.TagName.TR);\n for (var j = 0; j < columns; j++) {\n var td = goog.dom.createElement_(doc, goog.dom.TagName.TD);\n if (fillWithNbsp) {\n goog.dom.setTextContent(td, goog.string.Unicode.NBSP);\n }\n tr.appendChild(td);\n }\n tbody.appendChild(tr);\n }\n return table;\n};\ngoog.dom.constHtmlToNode = function(var_args) {\n var stringArray = goog.array.map(arguments, goog.string.Const.unwrap);\n var safeHtml = goog.html.uncheckedconversions.safeHtmlFromStringKnownToSatisfyTypeContract(goog.string.Const.from(\"Constant HTML string, that gets turned into a \" + \"Node later, so it will be automatically balanced.\"), stringArray.join(\"\"));\n return goog.dom.safeHtmlToNode(safeHtml);\n};\ngoog.dom.safeHtmlToNode = function(html) {\n return goog.dom.safeHtmlToNode_(document, html);\n};\ngoog.dom.safeHtmlToNode_ = function(doc, html) {\n var tempDiv = goog.dom.createElement_(doc, goog.dom.TagName.DIV);\n if (goog.dom.BrowserFeature.INNER_HTML_NEEDS_SCOPED_ELEMENT) {\n goog.dom.safe.setInnerHtml(tempDiv, goog.html.SafeHtml.concat(goog.html.SafeHtml.BR, html));\n tempDiv.removeChild(goog.asserts.assert(tempDiv.firstChild));\n } else {\n goog.dom.safe.setInnerHtml(tempDiv, html);\n }\n return goog.dom.childrenToNode_(doc, tempDiv);\n};\ngoog.dom.childrenToNode_ = function(doc, tempDiv) {\n if (tempDiv.childNodes.length == 1) {\n return tempDiv.removeChild(goog.asserts.assert(tempDiv.firstChild));\n } else {\n var fragment = doc.createDocumentFragment();\n while (tempDiv.firstChild) {\n fragment.appendChild(tempDiv.firstChild);\n }\n return fragment;\n }\n};\ngoog.dom.isCss1CompatMode = function() {\n return goog.dom.isCss1CompatMode_(document);\n};\ngoog.dom.isCss1CompatMode_ = function(doc) {\n if (goog.dom.COMPAT_MODE_KNOWN_) {\n return goog.dom.ASSUME_STANDARDS_MODE;\n }\n return doc.compatMode == \"CSS1Compat\";\n};\ngoog.dom.canHaveChildren = function(node) {\n if (node.nodeType != goog.dom.NodeType.ELEMENT) {\n return false;\n }\n switch(node.tagName) {\n case String(goog.dom.TagName.APPLET):\n case String(goog.dom.TagName.AREA):\n case String(goog.dom.TagName.BASE):\n case String(goog.dom.TagName.BR):\n case String(goog.dom.TagName.COL):\n case String(goog.dom.TagName.COMMAND):\n case String(goog.dom.TagName.EMBED):\n case String(goog.dom.TagName.FRAME):\n case String(goog.dom.TagName.HR):\n case String(goog.dom.TagName.IMG):\n case String(goog.dom.TagName.INPUT):\n case String(goog.dom.TagName.IFRAME):\n case String(goog.dom.TagName.ISINDEX):\n case String(goog.dom.TagName.KEYGEN):\n case String(goog.dom.TagName.LINK):\n case String(goog.dom.TagName.NOFRAMES):\n case String(goog.dom.TagName.NOSCRIPT):\n case String(goog.dom.TagName.META):\n case String(goog.dom.TagName.OBJECT):\n case String(goog.dom.TagName.PARAM):\n case String(goog.dom.TagName.SCRIPT):\n case String(goog.dom.TagName.SOURCE):\n case String(goog.dom.TagName.STYLE):\n case String(goog.dom.TagName.TRACK):\n case String(goog.dom.TagName.WBR):\n return false;\n }\n return true;\n};\ngoog.dom.appendChild = function(parent, child) {\n goog.asserts.assert(parent != null && child != null, \"goog.dom.appendChild expects non-null arguments\");\n parent.appendChild(child);\n};\ngoog.dom.append = function(parent, var_args) {\n goog.dom.append_(goog.dom.getOwnerDocument(parent), parent, arguments, 1);\n};\ngoog.dom.removeChildren = function(node) {\n var child;\n while (child = node.firstChild) {\n node.removeChild(child);\n }\n};\ngoog.dom.insertSiblingBefore = function(newNode, refNode) {\n goog.asserts.assert(newNode != null && refNode != null, \"goog.dom.insertSiblingBefore expects non-null arguments\");\n if (refNode.parentNode) {\n refNode.parentNode.insertBefore(newNode, refNode);\n }\n};\ngoog.dom.insertSiblingAfter = function(newNode, refNode) {\n goog.asserts.assert(newNode != null && refNode != null, \"goog.dom.insertSiblingAfter expects non-null arguments\");\n if (refNode.parentNode) {\n refNode.parentNode.insertBefore(newNode, refNode.nextSibling);\n }\n};\ngoog.dom.insertChildAt = function(parent, child, index) {\n goog.asserts.assert(parent != null, \"goog.dom.insertChildAt expects a non-null parent\");\n parent.insertBefore(child, parent.childNodes[index] || null);\n};\ngoog.dom.removeNode = function(node) {\n return node && node.parentNode ? node.parentNode.removeChild(node) : null;\n};\ngoog.dom.replaceNode = function(newNode, oldNode) {\n goog.asserts.assert(newNode != null && oldNode != null, \"goog.dom.replaceNode expects non-null arguments\");\n var parent = oldNode.parentNode;\n if (parent) {\n parent.replaceChild(newNode, oldNode);\n }\n};\ngoog.dom.flattenElement = function(element) {\n var child, parent = element.parentNode;\n if (parent && parent.nodeType != goog.dom.NodeType.DOCUMENT_FRAGMENT) {\n if (element.removeNode) {\n return element.removeNode(false);\n } else {\n while (child = element.firstChild) {\n parent.insertBefore(child, element);\n }\n return goog.dom.removeNode(element);\n }\n }\n};\ngoog.dom.getChildren = function(element) {\n if (goog.dom.BrowserFeature.CAN_USE_CHILDREN_ATTRIBUTE && element.children != undefined) {\n return element.children;\n }\n return goog.array.filter(element.childNodes, function(node) {\n return node.nodeType == goog.dom.NodeType.ELEMENT;\n });\n};\ngoog.dom.getFirstElementChild = function(node) {\n if (node.firstElementChild !== undefined) {\n return node.firstElementChild;\n }\n return goog.dom.getNextElementNode_(node.firstChild, true);\n};\ngoog.dom.getLastElementChild = function(node) {\n if (node.lastElementChild !== undefined) {\n return node.lastElementChild;\n }\n return goog.dom.getNextElementNode_(node.lastChild, false);\n};\ngoog.dom.getNextElementSibling = function(node) {\n if (node.nextElementSibling !== undefined) {\n return node.nextElementSibling;\n }\n return goog.dom.getNextElementNode_(node.nextSibling, true);\n};\ngoog.dom.getPreviousElementSibling = function(node) {\n if (node.previousElementSibling !== undefined) {\n return node.previousElementSibling;\n }\n return goog.dom.getNextElementNode_(node.previousSibling, false);\n};\ngoog.dom.getNextElementNode_ = function(node, forward) {\n while (node && node.nodeType != goog.dom.NodeType.ELEMENT) {\n node = forward ? node.nextSibling : node.previousSibling;\n }\n return node;\n};\ngoog.dom.getNextNode = function(node) {\n if (!node) {\n return null;\n }\n if (node.firstChild) {\n return node.firstChild;\n }\n while (node && !node.nextSibling) {\n node = node.parentNode;\n }\n return node ? node.nextSibling : null;\n};\ngoog.dom.getPreviousNode = function(node) {\n if (!node) {\n return null;\n }\n if (!node.previousSibling) {\n return node.parentNode;\n }\n node = node.previousSibling;\n while (node && node.lastChild) {\n node = node.lastChild;\n }\n return node;\n};\ngoog.dom.isNodeLike = function(obj) {\n return goog.isObject(obj) && obj.nodeType > 0;\n};\ngoog.dom.isElement = function(obj) {\n return goog.isObject(obj) && obj.nodeType == goog.dom.NodeType.ELEMENT;\n};\ngoog.dom.isWindow = function(obj) {\n return goog.isObject(obj) && obj[\"window\"] == obj;\n};\ngoog.dom.getParentElement = function(element) {\n var parent;\n if (goog.dom.BrowserFeature.CAN_USE_PARENT_ELEMENT_PROPERTY) {\n var isIe9 = goog.userAgent.IE && goog.userAgent.isVersionOrHigher(\"9\") && !goog.userAgent.isVersionOrHigher(\"10\");\n if (!(isIe9 && goog.global[\"SVGElement\"] && element instanceof goog.global[\"SVGElement\"])) {\n parent = element.parentElement;\n if (parent) {\n return parent;\n }\n }\n }\n parent = element.parentNode;\n return goog.dom.isElement(parent) ? parent : null;\n};\ngoog.dom.contains = function(parent, descendant) {\n if (!parent || !descendant) {\n return false;\n }\n if (parent.contains && descendant.nodeType == goog.dom.NodeType.ELEMENT) {\n return parent == descendant || parent.contains(descendant);\n }\n if (typeof parent.compareDocumentPosition != \"undefined\") {\n return parent == descendant || Boolean(parent.compareDocumentPosition(descendant) & 16);\n }\n while (descendant && parent != descendant) {\n descendant = descendant.parentNode;\n }\n return descendant == parent;\n};\ngoog.dom.compareNodeOrder = function(node1, node2) {\n if (node1 == node2) {\n return 0;\n }\n if (node1.compareDocumentPosition) {\n return node1.compareDocumentPosition(node2) & 2 ? 1 : -1;\n }\n if (goog.userAgent.IE && !goog.userAgent.isDocumentModeOrHigher(9)) {\n if (node1.nodeType == goog.dom.NodeType.DOCUMENT) {\n return -1;\n }\n if (node2.nodeType == goog.dom.NodeType.DOCUMENT) {\n return 1;\n }\n }\n if (\"sourceIndex\" in node1 || node1.parentNode && \"sourceIndex\" in node1.parentNode) {\n var isElement1 = node1.nodeType == goog.dom.NodeType.ELEMENT;\n var isElement2 = node2.nodeType == goog.dom.NodeType.ELEMENT;\n if (isElement1 && isElement2) {\n return node1.sourceIndex - node2.sourceIndex;\n } else {\n var parent1 = node1.parentNode;\n var parent2 = node2.parentNode;\n if (parent1 == parent2) {\n return goog.dom.compareSiblingOrder_(node1, node2);\n }\n if (!isElement1 && goog.dom.contains(parent1, node2)) {\n return -1 * goog.dom.compareParentsDescendantNodeIe_(node1, node2);\n }\n if (!isElement2 && goog.dom.contains(parent2, node1)) {\n return goog.dom.compareParentsDescendantNodeIe_(node2, node1);\n }\n return (isElement1 ? node1.sourceIndex : parent1.sourceIndex) - (isElement2 ? node2.sourceIndex : parent2.sourceIndex);\n }\n }\n var doc = goog.dom.getOwnerDocument(node1);\n var range1, range2;\n range1 = doc.createRange();\n range1.selectNode(node1);\n range1.collapse(true);\n range2 = doc.createRange();\n range2.selectNode(node2);\n range2.collapse(true);\n return range1.compareBoundaryPoints(goog.global[\"Range\"].START_TO_END, range2);\n};\ngoog.dom.compareParentsDescendantNodeIe_ = function(textNode, node) {\n var parent = textNode.parentNode;\n if (parent == node) {\n return -1;\n }\n var sibling = node;\n while (sibling.parentNode != parent) {\n sibling = sibling.parentNode;\n }\n return goog.dom.compareSiblingOrder_(sibling, textNode);\n};\ngoog.dom.compareSiblingOrder_ = function(node1, node2) {\n var s = node2;\n while (s = s.previousSibling) {\n if (s == node1) {\n return -1;\n }\n }\n return 1;\n};\ngoog.dom.findCommonAncestor = function(var_args) {\n var i, count = arguments.length;\n if (!count) {\n return null;\n } else {\n if (count == 1) {\n return arguments[0];\n }\n }\n var paths = [];\n var minLength = Infinity;\n for (i = 0; i < count; i++) {\n var ancestors = [];\n var node = arguments[i];\n while (node) {\n ancestors.unshift(node);\n node = node.parentNode;\n }\n paths.push(ancestors);\n minLength = Math.min(minLength, ancestors.length);\n }\n var output = null;\n for (i = 0; i < minLength; i++) {\n var first = paths[0][i];\n for (var j = 1; j < count; j++) {\n if (first != paths[j][i]) {\n return output;\n }\n }\n output = first;\n }\n return output;\n};\ngoog.dom.isInDocument = function(node) {\n return (node.ownerDocument.compareDocumentPosition(node) & 16) == 16;\n};\ngoog.dom.getOwnerDocument = function(node) {\n goog.asserts.assert(node, \"Node cannot be null or undefined.\");\n return node.nodeType == goog.dom.NodeType.DOCUMENT ? node : node.ownerDocument || node.document;\n};\ngoog.dom.getFrameContentDocument = function(frame) {\n return frame.contentDocument || frame.contentWindow.document;\n};\ngoog.dom.getFrameContentWindow = function(frame) {\n try {\n return frame.contentWindow || (frame.contentDocument ? goog.dom.getWindow(frame.contentDocument) : null);\n } catch (e) {\n }\n return null;\n};\ngoog.dom.setTextContent = function(node, text) {\n goog.asserts.assert(node != null, \"goog.dom.setTextContent expects a non-null value for node\");\n if (\"textContent\" in node) {\n node.textContent = text;\n } else {\n if (node.nodeType == goog.dom.NodeType.TEXT) {\n node.data = String(text);\n } else {\n if (node.firstChild && node.firstChild.nodeType == goog.dom.NodeType.TEXT) {\n while (node.lastChild != node.firstChild) {\n node.removeChild(goog.asserts.assert(node.lastChild));\n }\n node.firstChild.data = String(text);\n } else {\n goog.dom.removeChildren(node);\n var doc = goog.dom.getOwnerDocument(node);\n node.appendChild(doc.createTextNode(String(text)));\n }\n }\n }\n};\ngoog.dom.getOuterHtml = function(element) {\n goog.asserts.assert(element !== null, \"goog.dom.getOuterHtml expects a non-null value for element\");\n if (\"outerHTML\" in element) {\n return element.outerHTML;\n } else {\n var doc = goog.dom.getOwnerDocument(element);\n var div = goog.dom.createElement_(doc, goog.dom.TagName.DIV);\n div.appendChild(element.cloneNode(true));\n return div.innerHTML;\n }\n};\ngoog.dom.findNode = function(root, p) {\n var rv = [];\n var found = goog.dom.findNodes_(root, p, rv, true);\n return found ? rv[0] : undefined;\n};\ngoog.dom.findNodes = function(root, p) {\n var rv = [];\n goog.dom.findNodes_(root, p, rv, false);\n return rv;\n};\ngoog.dom.findNodes_ = function(root, p, rv, findOne) {\n if (root != null) {\n var child = root.firstChild;\n while (child) {\n if (p(child)) {\n rv.push(child);\n if (findOne) {\n return true;\n }\n }\n if (goog.dom.findNodes_(child, p, rv, findOne)) {\n return true;\n }\n child = child.nextSibling;\n }\n }\n return false;\n};\ngoog.dom.findElement = function(root, pred) {\n var stack = goog.dom.getChildrenReverse_(root);\n while (stack.length > 0) {\n var next = stack.pop();\n if (pred(next)) {\n return next;\n }\n for (var c = next.lastElementChild; c; c = c.previousElementSibling) {\n stack.push(c);\n }\n }\n return null;\n};\ngoog.dom.findElements = function(root, pred) {\n var result = [], stack = goog.dom.getChildrenReverse_(root);\n while (stack.length > 0) {\n var next = stack.pop();\n if (pred(next)) {\n result.push(next);\n }\n for (var c = next.lastElementChild; c; c = c.previousElementSibling) {\n stack.push(c);\n }\n }\n return result;\n};\ngoog.dom.getChildrenReverse_ = function(node) {\n if (node.nodeType == goog.dom.NodeType.DOCUMENT) {\n return [node.documentElement];\n } else {\n var children = [];\n for (var c = node.lastElementChild; c; c = c.previousElementSibling) {\n children.push(c);\n }\n return children;\n }\n};\ngoog.dom.TAGS_TO_IGNORE_ = {\"SCRIPT\":1, \"STYLE\":1, \"HEAD\":1, \"IFRAME\":1, \"OBJECT\":1};\ngoog.dom.PREDEFINED_TAG_VALUES_ = {\"IMG\":\" \", \"BR\":\"\\n\"};\ngoog.dom.isFocusableTabIndex = function(element) {\n return goog.dom.hasSpecifiedTabIndex_(element) && goog.dom.isTabIndexFocusable_(element);\n};\ngoog.dom.setFocusableTabIndex = function(element, enable) {\n if (enable) {\n element.tabIndex = 0;\n } else {\n element.tabIndex = -1;\n element.removeAttribute(\"tabIndex\");\n }\n};\ngoog.dom.isFocusable = function(element) {\n var focusable;\n if (goog.dom.nativelySupportsFocus_(element)) {\n focusable = !element.disabled && (!goog.dom.hasSpecifiedTabIndex_(element) || goog.dom.isTabIndexFocusable_(element));\n } else {\n focusable = goog.dom.isFocusableTabIndex(element);\n }\n return focusable && goog.userAgent.IE ? goog.dom.hasNonZeroBoundingRect_(element) : focusable;\n};\ngoog.dom.hasSpecifiedTabIndex_ = function(element) {\n if (goog.userAgent.IE && !goog.userAgent.isVersionOrHigher(\"9\")) {\n var attrNode = element.getAttributeNode(\"tabindex\");\n return attrNode != null && attrNode.specified;\n } else {\n return element.hasAttribute(\"tabindex\");\n }\n};\ngoog.dom.isTabIndexFocusable_ = function(element) {\n var index = element.tabIndex;\n return typeof index === \"number\" && index >= 0 && index < 32768;\n};\ngoog.dom.nativelySupportsFocus_ = function(element) {\n return element.tagName == goog.dom.TagName.A && element.hasAttribute(\"href\") || element.tagName == goog.dom.TagName.INPUT || element.tagName == goog.dom.TagName.TEXTAREA || element.tagName == goog.dom.TagName.SELECT || element.tagName == goog.dom.TagName.BUTTON;\n};\ngoog.dom.hasNonZeroBoundingRect_ = function(element) {\n var rect;\n if (!goog.isFunction(element[\"getBoundingClientRect\"]) || goog.userAgent.IE && element.parentElement == null) {\n rect = {\"height\":element.offsetHeight, \"width\":element.offsetWidth};\n } else {\n rect = element.getBoundingClientRect();\n }\n return rect != null && rect.height > 0 && rect.width > 0;\n};\ngoog.dom.getTextContent = function(node) {\n var textContent;\n if (goog.dom.BrowserFeature.CAN_USE_INNER_TEXT && node !== null && \"innerText\" in node) {\n textContent = goog.string.canonicalizeNewlines(node.innerText);\n } else {\n var buf = [];\n goog.dom.getTextContent_(node, buf, true);\n textContent = buf.join(\"\");\n }\n textContent = textContent.replace(/ \\xAD /g, \" \").replace(/\\xAD/g, \"\");\n textContent = textContent.replace(/\\u200B/g, \"\");\n if (!goog.dom.BrowserFeature.CAN_USE_INNER_TEXT) {\n textContent = textContent.replace(/ +/g, \" \");\n }\n if (textContent != \" \") {\n textContent = textContent.replace(/^\\s*/, \"\");\n }\n return textContent;\n};\ngoog.dom.getRawTextContent = function(node) {\n var buf = [];\n goog.dom.getTextContent_(node, buf, false);\n return buf.join(\"\");\n};\ngoog.dom.getTextContent_ = function(node, buf, normalizeWhitespace) {\n if (node.nodeName in goog.dom.TAGS_TO_IGNORE_) {\n } else {\n if (node.nodeType == goog.dom.NodeType.TEXT) {\n if (normalizeWhitespace) {\n buf.push(String(node.nodeValue).replace(/(\\r\\n|\\r|\\n)/g, \"\"));\n } else {\n buf.push(node.nodeValue);\n }\n } else {\n if (node.nodeName in goog.dom.PREDEFINED_TAG_VALUES_) {\n buf.push(goog.dom.PREDEFINED_TAG_VALUES_[node.nodeName]);\n } else {\n var child = node.firstChild;\n while (child) {\n goog.dom.getTextContent_(child, buf, normalizeWhitespace);\n child = child.nextSibling;\n }\n }\n }\n }\n};\ngoog.dom.getNodeTextLength = function(node) {\n return goog.dom.getTextContent(node).length;\n};\ngoog.dom.getNodeTextOffset = function(node, opt_offsetParent) {\n var root = opt_offsetParent || goog.dom.getOwnerDocument(node).body;\n var buf = [];\n while (node && node != root) {\n var cur = node;\n while (cur = cur.previousSibling) {\n buf.unshift(goog.dom.getTextContent(cur));\n }\n node = node.parentNode;\n }\n return goog.string.trimLeft(buf.join(\"\")).replace(/ +/g, \" \").length;\n};\ngoog.dom.getNodeAtOffset = function(parent, offset, opt_result) {\n var stack = [parent], pos = 0, cur = null;\n while (stack.length > 0 && pos < offset) {\n cur = stack.pop();\n if (cur.nodeName in goog.dom.TAGS_TO_IGNORE_) {\n } else {\n if (cur.nodeType == goog.dom.NodeType.TEXT) {\n var text = cur.nodeValue.replace(/(\\r\\n|\\r|\\n)/g, \"\").replace(/ +/g, \" \");\n pos += text.length;\n } else {\n if (cur.nodeName in goog.dom.PREDEFINED_TAG_VALUES_) {\n pos += goog.dom.PREDEFINED_TAG_VALUES_[cur.nodeName].length;\n } else {\n for (var i = cur.childNodes.length - 1; i >= 0; i--) {\n stack.push(cur.childNodes[i]);\n }\n }\n }\n }\n }\n if (goog.isObject(opt_result)) {\n opt_result.remainder = cur ? cur.nodeValue.length + offset - pos - 1 : 0;\n opt_result.node = cur;\n }\n return cur;\n};\ngoog.dom.isNodeList = function(val) {\n if (val && typeof val.length == \"number\") {\n if (goog.isObject(val)) {\n return typeof val.item == \"function\" || typeof val.item == \"string\";\n } else {\n if (goog.isFunction(val)) {\n return typeof val.item == \"function\";\n }\n }\n }\n return false;\n};\ngoog.dom.getAncestorByTagNameAndClass = function(element, opt_tag, opt_class, opt_maxSearchSteps) {\n if (!opt_tag && !opt_class) {\n return null;\n }\n var tagName = opt_tag ? String(opt_tag).toUpperCase() : null;\n return goog.dom.getAncestor(element, function(node) {\n return (!tagName || node.nodeName == tagName) && (!opt_class || typeof node.className === \"string\" && goog.array.contains(node.className.split(/\\s+/), opt_class));\n }, true, opt_maxSearchSteps);\n};\ngoog.dom.getAncestorByClass = function(element, className, opt_maxSearchSteps) {\n return goog.dom.getAncestorByTagNameAndClass(element, null, className, opt_maxSearchSteps);\n};\ngoog.dom.getAncestor = function(element, matcher, opt_includeNode, opt_maxSearchSteps) {\n if (element && !opt_includeNode) {\n element = element.parentNode;\n }\n var steps = 0;\n while (element && (opt_maxSearchSteps == null || steps <= opt_maxSearchSteps)) {\n goog.asserts.assert(element.name != \"parentNode\");\n if (matcher(element)) {\n return element;\n }\n element = element.parentNode;\n steps++;\n }\n return null;\n};\ngoog.dom.getActiveElement = function(doc) {\n try {\n var activeElement = doc && doc.activeElement;\n return activeElement && activeElement.nodeName ? activeElement : null;\n } catch (e) {\n return null;\n }\n};\ngoog.dom.getPixelRatio = function() {\n var win = goog.dom.getWindow();\n if (win.devicePixelRatio !== undefined) {\n return win.devicePixelRatio;\n } else {\n if (win.matchMedia) {\n return goog.dom.matchesPixelRatio_(3) || goog.dom.matchesPixelRatio_(2) || goog.dom.matchesPixelRatio_(1.5) || goog.dom.matchesPixelRatio_(1) || .75;\n }\n }\n return 1;\n};\ngoog.dom.matchesPixelRatio_ = function(pixelRatio) {\n var win = goog.dom.getWindow();\n var dpiPerDppx = 96;\n var query = \"(min-resolution: \" + pixelRatio + \"dppx),\" + \"(min--moz-device-pixel-ratio: \" + pixelRatio + \"),\" + \"(min-resolution: \" + pixelRatio * dpiPerDppx + \"dpi)\";\n return win.matchMedia(query).matches ? pixelRatio : 0;\n};\ngoog.dom.getCanvasContext2D = function(canvas) {\n return canvas.getContext(\"2d\");\n};\ngoog.dom.DomHelper = function(opt_document) {\n this.document_ = opt_document || goog.global.document || document;\n};\ngoog.dom.DomHelper.prototype.getDomHelper = goog.dom.getDomHelper;\ngoog.dom.DomHelper.prototype.setDocument = function(document) {\n this.document_ = document;\n};\ngoog.dom.DomHelper.prototype.getDocument = function() {\n return this.document_;\n};\ngoog.dom.DomHelper.prototype.getElement = function(element) {\n return goog.dom.getElementHelper_(this.document_, element);\n};\ngoog.dom.DomHelper.prototype.getRequiredElement = function(id) {\n return goog.dom.getRequiredElementHelper_(this.document_, id);\n};\ngoog.dom.DomHelper.prototype.$ = goog.dom.DomHelper.prototype.getElement;\ngoog.dom.DomHelper.prototype.getElementsByTagName = function(tagName, opt_parent) {\n var parent = opt_parent || this.document_;\n return parent.getElementsByTagName(String(tagName));\n};\ngoog.dom.DomHelper.prototype.getElementsByTagNameAndClass = function(opt_tag, opt_class, opt_el) {\n return goog.dom.getElementsByTagNameAndClass_(this.document_, opt_tag, opt_class, opt_el);\n};\ngoog.dom.DomHelper.prototype.getElementByTagNameAndClass = function(opt_tag, opt_class, opt_el) {\n return goog.dom.getElementByTagNameAndClass_(this.document_, opt_tag, opt_class, opt_el);\n};\ngoog.dom.DomHelper.prototype.getElementsByClass = function(className, opt_el) {\n var doc = opt_el || this.document_;\n return goog.dom.getElementsByClass(className, doc);\n};\ngoog.dom.DomHelper.prototype.getElementByClass = function(className, opt_el) {\n var doc = opt_el || this.document_;\n return goog.dom.getElementByClass(className, doc);\n};\ngoog.dom.DomHelper.prototype.getRequiredElementByClass = function(className, opt_root) {\n var root = opt_root || this.document_;\n return goog.dom.getRequiredElementByClass(className, root);\n};\ngoog.dom.DomHelper.prototype.$$ = goog.dom.DomHelper.prototype.getElementsByTagNameAndClass;\ngoog.dom.DomHelper.prototype.setProperties = goog.dom.setProperties;\ngoog.dom.DomHelper.prototype.getViewportSize = function(opt_window) {\n return goog.dom.getViewportSize(opt_window || this.getWindow());\n};\ngoog.dom.DomHelper.prototype.getDocumentHeight = function() {\n return goog.dom.getDocumentHeight_(this.getWindow());\n};\ngoog.dom.Appendable;\ngoog.dom.DomHelper.prototype.createDom = function(tagName, opt_attributes, var_args) {\n return goog.dom.createDom_(this.document_, arguments);\n};\ngoog.dom.DomHelper.prototype.$dom = goog.dom.DomHelper.prototype.createDom;\ngoog.dom.DomHelper.prototype.createElement = function(name) {\n return goog.dom.createElement_(this.document_, name);\n};\ngoog.dom.DomHelper.prototype.createTextNode = function(content) {\n return this.document_.createTextNode(String(content));\n};\ngoog.dom.DomHelper.prototype.createTable = function(rows, columns, opt_fillWithNbsp) {\n return goog.dom.createTable_(this.document_, rows, columns, !!opt_fillWithNbsp);\n};\ngoog.dom.DomHelper.prototype.safeHtmlToNode = function(html) {\n return goog.dom.safeHtmlToNode_(this.document_, html);\n};\ngoog.dom.DomHelper.prototype.isCss1CompatMode = function() {\n return goog.dom.isCss1CompatMode_(this.document_);\n};\ngoog.dom.DomHelper.prototype.getWindow = function() {\n return goog.dom.getWindow_(this.document_);\n};\ngoog.dom.DomHelper.prototype.getDocumentScrollElement = function() {\n return goog.dom.getDocumentScrollElement_(this.document_);\n};\ngoog.dom.DomHelper.prototype.getDocumentScroll = function() {\n return goog.dom.getDocumentScroll_(this.document_);\n};\ngoog.dom.DomHelper.prototype.getActiveElement = function(opt_doc) {\n return goog.dom.getActiveElement(opt_doc || this.document_);\n};\ngoog.dom.DomHelper.prototype.appendChild = goog.dom.appendChild;\ngoog.dom.DomHelper.prototype.append = goog.dom.append;\ngoog.dom.DomHelper.prototype.canHaveChildren = goog.dom.canHaveChildren;\ngoog.dom.DomHelper.prototype.removeChildren = goog.dom.removeChildren;\ngoog.dom.DomHelper.prototype.insertSiblingBefore = goog.dom.insertSiblingBefore;\ngoog.dom.DomHelper.prototype.insertSiblingAfter = goog.dom.insertSiblingAfter;\ngoog.dom.DomHelper.prototype.insertChildAt = goog.dom.insertChildAt;\ngoog.dom.DomHelper.prototype.removeNode = goog.dom.removeNode;\ngoog.dom.DomHelper.prototype.replaceNode = goog.dom.replaceNode;\ngoog.dom.DomHelper.prototype.flattenElement = goog.dom.flattenElement;\ngoog.dom.DomHelper.prototype.getChildren = goog.dom.getChildren;\ngoog.dom.DomHelper.prototype.getFirstElementChild = goog.dom.getFirstElementChild;\ngoog.dom.DomHelper.prototype.getLastElementChild = goog.dom.getLastElementChild;\ngoog.dom.DomHelper.prototype.getNextElementSibling = goog.dom.getNextElementSibling;\ngoog.dom.DomHelper.prototype.getPreviousElementSibling = goog.dom.getPreviousElementSibling;\ngoog.dom.DomHelper.prototype.getNextNode = goog.dom.getNextNode;\ngoog.dom.DomHelper.prototype.getPreviousNode = goog.dom.getPreviousNode;\ngoog.dom.DomHelper.prototype.isNodeLike = goog.dom.isNodeLike;\ngoog.dom.DomHelper.prototype.isElement = goog.dom.isElement;\ngoog.dom.DomHelper.prototype.isWindow = goog.dom.isWindow;\ngoog.dom.DomHelper.prototype.getParentElement = goog.dom.getParentElement;\ngoog.dom.DomHelper.prototype.contains = goog.dom.contains;\ngoog.dom.DomHelper.prototype.compareNodeOrder = goog.dom.compareNodeOrder;\ngoog.dom.DomHelper.prototype.findCommonAncestor = goog.dom.findCommonAncestor;\ngoog.dom.DomHelper.prototype.getOwnerDocument = goog.dom.getOwnerDocument;\ngoog.dom.DomHelper.prototype.getFrameContentDocument = goog.dom.getFrameContentDocument;\ngoog.dom.DomHelper.prototype.getFrameContentWindow = goog.dom.getFrameContentWindow;\ngoog.dom.DomHelper.prototype.setTextContent = goog.dom.setTextContent;\ngoog.dom.DomHelper.prototype.getOuterHtml = goog.dom.getOuterHtml;\ngoog.dom.DomHelper.prototype.findNode = goog.dom.findNode;\ngoog.dom.DomHelper.prototype.findNodes = goog.dom.findNodes;\ngoog.dom.DomHelper.prototype.isFocusableTabIndex = goog.dom.isFocusableTabIndex;\ngoog.dom.DomHelper.prototype.setFocusableTabIndex = goog.dom.setFocusableTabIndex;\ngoog.dom.DomHelper.prototype.isFocusable = goog.dom.isFocusable;\ngoog.dom.DomHelper.prototype.getTextContent = goog.dom.getTextContent;\ngoog.dom.DomHelper.prototype.getNodeTextLength = goog.dom.getNodeTextLength;\ngoog.dom.DomHelper.prototype.getNodeTextOffset = goog.dom.getNodeTextOffset;\ngoog.dom.DomHelper.prototype.getNodeAtOffset = goog.dom.getNodeAtOffset;\ngoog.dom.DomHelper.prototype.isNodeList = goog.dom.isNodeList;\ngoog.dom.DomHelper.prototype.getAncestorByTagNameAndClass = goog.dom.getAncestorByTagNameAndClass;\ngoog.dom.DomHelper.prototype.getAncestorByClass = goog.dom.getAncestorByClass;\ngoog.dom.DomHelper.prototype.getAncestor = goog.dom.getAncestor;\ngoog.dom.DomHelper.prototype.getCanvasContext2D = goog.dom.getCanvasContext2D;\n","~:source","// Copyright 2006 The Closure Library Authors. All Rights Reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS-IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n/**\n * @fileoverview Utilities for manipulating the browser's Document Object Model\n * Inspiration taken *heavily* from mochikit (http://mochikit.com/).\n *\n * You can use {@link goog.dom.DomHelper} to create new dom helpers that refer\n * to a different document object. This is useful if you are working with\n * frames or multiple windows.\n *\n * @author arv@google.com (Erik Arvidsson)\n * @suppress {strictMissingProperties}\n */\n\n\n// TODO(arv): Rename/refactor getTextContent and getRawTextContent. The problem\n// is that getTextContent should mimic the DOM3 textContent. We should add a\n// getInnerText (or getText) which tries to return the visible text, innerText.\n\n\ngoog.provide('goog.dom');\ngoog.provide('goog.dom.Appendable');\ngoog.provide('goog.dom.DomHelper');\n\ngoog.require('goog.array');\ngoog.require('goog.asserts');\ngoog.require('goog.dom.BrowserFeature');\ngoog.require('goog.dom.NodeType');\ngoog.require('goog.dom.TagName');\ngoog.require('goog.dom.safe');\ngoog.require('goog.html.SafeHtml');\ngoog.require('goog.html.uncheckedconversions');\ngoog.require('goog.math.Coordinate');\ngoog.require('goog.math.Size');\ngoog.require('goog.object');\ngoog.require('goog.string');\ngoog.require('goog.string.Unicode');\ngoog.require('goog.userAgent');\n\n\n/**\n * @define {boolean} Whether we know at compile time that the browser is in\n * quirks mode.\n */\ngoog.dom.ASSUME_QUIRKS_MODE = goog.define('goog.dom.ASSUME_QUIRKS_MODE', false);\n\n\n/**\n * @define {boolean} Whether we know at compile time that the browser is in\n * standards compliance mode.\n */\ngoog.dom.ASSUME_STANDARDS_MODE =\n goog.define('goog.dom.ASSUME_STANDARDS_MODE', false);\n\n\n/**\n * Whether we know the compatibility mode at compile time.\n * @type {boolean}\n * @private\n */\ngoog.dom.COMPAT_MODE_KNOWN_ =\n goog.dom.ASSUME_QUIRKS_MODE || goog.dom.ASSUME_STANDARDS_MODE;\n\n\n/**\n * Gets the DomHelper object for the document where the element resides.\n * @param {(Node|Window)=} opt_element If present, gets the DomHelper for this\n * element.\n * @return {!goog.dom.DomHelper} The DomHelper.\n */\ngoog.dom.getDomHelper = function(opt_element) {\n return opt_element ?\n new goog.dom.DomHelper(goog.dom.getOwnerDocument(opt_element)) :\n (goog.dom.defaultDomHelper_ ||\n (goog.dom.defaultDomHelper_ = new goog.dom.DomHelper()));\n};\n\n\n/**\n * Cached default DOM helper.\n * @type {!goog.dom.DomHelper|undefined}\n * @private\n */\ngoog.dom.defaultDomHelper_;\n\n\n/**\n * Gets the document object being used by the dom library.\n * @return {!Document} Document object.\n */\ngoog.dom.getDocument = function() {\n return document;\n};\n\n\n/**\n * Gets an element from the current document by element id.\n *\n * If an Element is passed in, it is returned.\n *\n * @param {string|Element} element Element ID or a DOM node.\n * @return {Element} The element with the given ID, or the node passed in.\n */\ngoog.dom.getElement = function(element) {\n return goog.dom.getElementHelper_(document, element);\n};\n\n\n/**\n * Gets an element by id from the given document (if present).\n * If an element is given, it is returned.\n * @param {!Document} doc\n * @param {string|Element} element Element ID or a DOM node.\n * @return {Element} The resulting element.\n * @private\n */\ngoog.dom.getElementHelper_ = function(doc, element) {\n return typeof element === 'string' ? doc.getElementById(element) : element;\n};\n\n\n/**\n * Gets an element by id, asserting that the element is found.\n *\n * This is used when an element is expected to exist, and should fail with\n * an assertion error if it does not (if assertions are enabled).\n *\n * @param {string} id Element ID.\n * @return {!Element} The element with the given ID, if it exists.\n */\ngoog.dom.getRequiredElement = function(id) {\n return goog.dom.getRequiredElementHelper_(document, id);\n};\n\n\n/**\n * Helper function for getRequiredElementHelper functions, both static and\n * on DomHelper. Asserts the element with the given id exists.\n * @param {!Document} doc\n * @param {string} id\n * @return {!Element} The element with the given ID, if it exists.\n * @private\n */\ngoog.dom.getRequiredElementHelper_ = function(doc, id) {\n // To prevent users passing in Elements as is permitted in getElement().\n goog.asserts.assertString(id);\n var element = goog.dom.getElementHelper_(doc, id);\n element =\n goog.asserts.assertElement(element, 'No element found with id: ' + id);\n return element;\n};\n\n\n/**\n * Alias for getElement.\n * @param {string|Element} element Element ID or a DOM node.\n * @return {Element} The element with the given ID, or the node passed in.\n * @deprecated Use {@link goog.dom.getElement} instead.\n */\ngoog.dom.$ = goog.dom.getElement;\n\n\n/**\n * Gets elements by tag name.\n * @param {!goog.dom.TagName<T>} tagName\n * @param {(!Document|!Element)=} opt_parent Parent element or document where to\n * look for elements. Defaults to document.\n * @return {!NodeList<R>} List of elements. The members of the list are\n * {!Element} if tagName is not a member of goog.dom.TagName or more\n * specific types if it is (e.g. {!HTMLAnchorElement} for\n * goog.dom.TagName.A).\n * @template T\n * @template R := cond(isUnknown(T), 'Element', T) =:\n */\ngoog.dom.getElementsByTagName = function(tagName, opt_parent) {\n var parent = opt_parent || document;\n return parent.getElementsByTagName(String(tagName));\n};\n\n\n/**\n * Looks up elements by both tag and class name, using browser native functions\n * (`querySelectorAll`, `getElementsByTagName` or\n * `getElementsByClassName`) where possible. This function\n * is a useful, if limited, way of collecting a list of DOM elements\n * with certain characteristics. `querySelectorAll` offers a\n * more powerful and general solution which allows matching on CSS3\n * selector expressions.\n *\n * Note that tag names are case sensitive in the SVG namespace, and this\n * function converts opt_tag to uppercase for comparisons. For queries in the\n * SVG namespace you should use querySelector or querySelectorAll instead.\n * https://bugzilla.mozilla.org/show_bug.cgi?id=963870\n * https://bugs.webkit.org/show_bug.cgi?id=83438\n *\n * @see {https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelectorAll}\n *\n * @param {(string|?goog.dom.TagName<T>)=} opt_tag Element tag name.\n * @param {?string=} opt_class Optional class name.\n * @param {(Document|Element)=} opt_el Optional element to look in.\n * @return {!IArrayLike<R>} Array-like list of elements (only a length property\n * and numerical indices are guaranteed to exist). The members of the array\n * are {!Element} if opt_tag is not a member of goog.dom.TagName or more\n * specific types if it is (e.g. {!HTMLAnchorElement} for\n * goog.dom.TagName.A).\n * @template T\n * @template R := cond(isUnknown(T), 'Element', T) =:\n */\ngoog.dom.getElementsByTagNameAndClass = function(opt_tag, opt_class, opt_el) {\n return goog.dom.getElementsByTagNameAndClass_(\n document, opt_tag, opt_class, opt_el);\n};\n\n\n/**\n * Gets the first element matching the tag and the class.\n *\n * @param {(string|?goog.dom.TagName<T>)=} opt_tag Element tag name.\n * @param {?string=} opt_class Optional class name.\n * @param {(Document|Element)=} opt_el Optional element to look in.\n * @return {?R} Reference to a DOM node. The return type is {?Element} if\n * tagName is a string or a more specific type if it is a member of\n * goog.dom.TagName (e.g. {?HTMLAnchorElement} for goog.dom.TagName.A).\n * @template T\n * @template R := cond(isUnknown(T), 'Element', T) =:\n */\ngoog.dom.getElementByTagNameAndClass = function(opt_tag, opt_class, opt_el) {\n return goog.dom.getElementByTagNameAndClass_(\n document, opt_tag, opt_class, opt_el);\n};\n\n\n