{"version":3,"file":"polyfills.min.js","sources":["polyfills.min.js"],"sourcesContent":["// IE fix for Number.EPSILON\nif (Number.EPSILON === undefined) {\n Number.EPSILON = Math.pow(2, -52);\n}\n\n// IE11 fix for ngClass on SVG elements\nif (!(\"classList\" in document.createElementNS(\"http://www.w3.org/2000/svg\", \"g\"))) {\n var descr = Object.getOwnPropertyDescriptor(HTMLElement.prototype, 'classList');\n Object.defineProperty(SVGElement.prototype, 'classList', descr);\n}\n\n/**\n * innerHTML property for SVGElement\n * Copyright(c) 2010, Jeff Schiller\n *\n * Licensed under the Apache License, Version 2\n *\n * Minor modifications by Chris Price to only polyfill when required.\n */\n(function (SVGElement) {\n if (!SVGElement || 'innerHTML' in SVGElement.prototype) {\n return;\n }\n var serializeXML = function (node, output) {\n var nodeType = node.nodeType;\n if (nodeType == 3) { // TEXT nodes.\n // Replace special XML characters with their entities.\n output.push(node.textContent.replace(/&/, '&').replace(/', '>'));\n } else if (nodeType == 1) { // ELEMENT nodes.\n // Serialize Element nodes.\n output.push('<', node.tagName);\n if (node.hasAttributes()) {\n var attrMap = node.attributes;\n for (var i = 0, len = attrMap.length; i < len; ++i) {\n var attrNode = attrMap.item(i);\n output.push(' ', attrNode.name, '=\\'', attrNode.value, '\\'');\n }\n }\n if (node.hasChildNodes()) {\n output.push('>');\n var childNodes = node.childNodes;\n for (var i = 0, len = childNodes.length; i < len; ++i) {\n serializeXML(childNodes.item(i), output);\n }\n output.push('');\n } else {\n output.push('/>');\n }\n } else if (nodeType == 8) {\n // TODO(codedread): Replace special characters with XML entities?\n output.push('');\n } else {\n // TODO: Handle CDATA nodes.\n // TODO: Handle ENTITY nodes.\n // TODO: Handle DOCUMENT nodes.\n throw 'Error serializing XML. Unhandled node of type: ' + nodeType;\n }\n }\n // The innerHTML DOM property for SVGElement.\n Object.defineProperty(SVGElement.prototype, 'innerHTML', {\n get: function () {\n var output = [];\n var childNode = this.firstChild;\n while (childNode) {\n serializeXML(childNode, output);\n childNode = childNode.nextSibling;\n }\n return output.join('');\n },\n set: function (markupText) {\n // Wipe out the current contents of the element.\n while (this.firstChild) {\n this.removeChild(this.firstChild);\n }\n\n try {\n // Parse the markup into valid nodes.\n var dXML = new DOMParser();\n dXML.async = false;\n // Wrap the markup into a SVG node to ensure parsing works.\n sXML = '' + markupText + '';\n var svgDocElement = dXML.parseFromString(sXML, 'text/xml').documentElement;\n\n // Now take each node, import it and append to this element.\n var childNode = svgDocElement.firstChild;\n while (childNode) {\n this.appendChild(this.ownerDocument.importNode(childNode, true));\n childNode = childNode.nextSibling;\n }\n } catch (e) {\n throw new Error('Error parsing XML string');\n };\n }\n });\n})((1, eval)('this').SVGElement);\n\n// matches polyfill\nthis.Element && function (ElementPrototype) {\n ElementPrototype.matches = ElementPrototype.matches ||\n ElementPrototype.matchesSelector ||\n ElementPrototype.webkitMatchesSelector ||\n ElementPrototype.msMatchesSelector ||\n function (selector) {\n var node = this, nodes = (node.parentNode || node.document).querySelectorAll(selector), i = -1;\n while (nodes[++i] && nodes[i] != node);\n return !!nodes[i];\n }\n}(Element.prototype);\n\n// closest polyfill\nthis.Element && function (ElementPrototype) {\n ElementPrototype.closest = ElementPrototype.closest ||\n function (selector) {\n var el = this;\n while (el.matches && !el.matches(selector)) el = el.parentNode;\n return el.matches ? el : null;\n }\n}(Element.prototype);"],"names":["descr","undefined","Number","EPSILON","Math","pow","document","createElementNS","Object","getOwnPropertyDescriptor","HTMLElement","prototype","defineProperty","SVGElement","serializeXML","node","output","nodeType","push","textContent","replace","tagName","hasAttributes","attrMap","attributes","i","len","length","attrNode","item","name","value","hasChildNodes","childNodes","nodeValue","get","childNode","this","firstChild","nextSibling","join","set","markupText","removeChild","dXML","DOMParser","async","sXML","parseFromString","documentElement","appendChild","ownerDocument","importNode","e","Error","eval","Element","ElementPrototype","matches","matchesSelector","webkitMatchesSelector","msMatchesSelector","selector","nodes","parentNode","querySelectorAll","closest","el"],"mappings":"AAMA,IACQA,WANeC,IAAnBC,OAAOC,UACPD,OAAO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