{"version":3,"names":[],"mappings":"","sources":["svg4everybody.js"],"sourcesContent":["!function(root, factory) {\r\n \"function\" == typeof define && define.amd ? // AMD. Register as an anonymous module unless amdModuleId is set\r\n define([], function() {\r\n return root.svg4everybody = factory();\r\n }) : \"object\" == typeof module && module.exports ? // Node. Does not work with strict CommonJS, but\r\n // only CommonJS-like environments that support module.exports,\r\n // like Node.\r\n module.exports = factory() : root.svg4everybody = factory();\r\n}(this, function() {\r\n /*! svg4everybody v2.1.9 | github.com/jonathantneal/svg4everybody */\r\n function embed(parent, svg, target) {\r\n // if the target exists\r\n if (target) {\r\n // create a document fragment to hold the contents of the target\r\n var fragment = document.createDocumentFragment(), viewBox = !svg.hasAttribute(\"viewBox\") && target.getAttribute(\"viewBox\");\r\n // conditionally set the viewBox on the svg\r\n viewBox && svg.setAttribute(\"viewBox\", viewBox);\r\n // copy the contents of the clone into the fragment\r\n for (// clone the target\r\n var clone = target.cloneNode(!0); clone.childNodes.length; ) {\r\n fragment.appendChild(clone.firstChild);\r\n }\r\n // append the fragment into the svg\r\n parent.appendChild(fragment);\r\n }\r\n }\r\n function loadreadystatechange(xhr) {\r\n // listen to changes in the request\r\n xhr.onreadystatechange = function() {\r\n // if the request is ready\r\n if (4 === xhr.readyState) {\r\n // get the cached html document\r\n var cachedDocument = xhr._cachedDocument;\r\n // ensure the cached html document based on the xhr response\r\n cachedDocument || (cachedDocument = xhr._cachedDocument = document.implementation.createHTMLDocument(\"\"), \r\n cachedDocument.body.innerHTML = xhr.responseText, xhr._cachedTarget = {}), // clear the xhr embeds list and embed each item\r\n xhr._embeds.splice(0).map(function(item) {\r\n // get the cached target\r\n var target = xhr._cachedTarget[item.id];\r\n // ensure the cached target\r\n target || (target = xhr._cachedTarget[item.id] = cachedDocument.getElementById(item.id)), \r\n // embed the target into the svg\r\n embed(item.parent, item.svg, target);\r\n });\r\n }\r\n }, // test the ready state change immediately\r\n xhr.onreadystatechange();\r\n }\r\n function svg4everybody(rawopts) {\r\n function oninterval() {\r\n // while the index exists in the live collection\r\n for (// get the cached index\r\n var index = 0; index < uses.length; ) {\r\n // get the current \r\n var use = uses[index], parent = use.parentNode, svg = getSVGAncestor(parent), src = use.getAttribute(\"xlink:href\") || use.getAttribute(\"href\");\r\n if (!src && opts.attributeName && (src = use.getAttribute(opts.attributeName)), \r\n svg && src) {\r\n if (polyfill) {\r\n if (!opts.validate || opts.validate(src, svg, use)) {\r\n // remove the element\r\n parent.removeChild(use);\r\n // parse the src and get the url and id\r\n var srcSplit = src.split(\"#\"), url = srcSplit.shift(), id = srcSplit.join(\"#\");\r\n // if the link is external\r\n if (url.length) {\r\n // get the cached xhr request\r\n var xhr = requests[url];\r\n // ensure the xhr request exists\r\n xhr || (xhr = requests[url] = new XMLHttpRequest(), xhr.open(\"GET\", url), xhr.send(), \r\n xhr._embeds = []), // add the svg and id as an item to the xhr embeds list\r\n xhr._embeds.push({\r\n parent: parent,\r\n svg: svg,\r\n id: id\r\n }), // prepare the xhr ready state change event\r\n loadreadystatechange(xhr);\r\n } else {\r\n // embed the local id into the svg\r\n embed(parent, svg, document.getElementById(id));\r\n }\r\n } else {\r\n // increase the index when the previous value was not \"valid\"\r\n ++index, ++numberOfSvgUseElementsToBypass;\r\n }\r\n }\r\n } else {\r\n // increase the index when the previous value was not \"valid\"\r\n ++index;\r\n }\r\n }\r\n // continue the interval\r\n (!uses.length || uses.length - numberOfSvgUseElementsToBypass > 0) && requestAnimationFrame(oninterval, 67);\r\n }\r\n var polyfill, opts = Object(rawopts), newerIEUA = /\\bTrident\\/[567]\\b|\\bMSIE (?:9|10)\\.0\\b/, webkitUA = /\\bAppleWebKit\\/(\\d+)\\b/, olderEdgeUA = /\\bEdge\\/12\\.(\\d+)\\b/, edgeUA = /\\bEdge\\/.(\\d+)\\b/, inIframe = window.top !== window.self;\r\n polyfill = \"polyfill\" in opts ? opts.polyfill : newerIEUA.test(navigator.userAgent) || (navigator.userAgent.match(olderEdgeUA) || [])[1] < 10547 || (navigator.userAgent.match(webkitUA) || [])[1] < 537 || edgeUA.test(navigator.userAgent) && inIframe;\r\n // create xhr requests object\r\n var requests = {}, requestAnimationFrame = window.requestAnimationFrame || setTimeout, uses = document.getElementsByTagName(\"use\"), numberOfSvgUseElementsToBypass = 0;\r\n // conditionally start the interval if the polyfill is active\r\n polyfill && oninterval();\r\n }\r\n function getSVGAncestor(node) {\r\n for (var svg = node; \"svg\" !== svg.nodeName.toLowerCase() && (svg = svg.parentNode); ) {}\r\n return svg;\r\n }\r\n return svg4everybody;\r\n});"],"file":"../../../../../../maps/svg4everybody.js.min.map"}