/*! * css-vars-ponyfill * v2.4.9 * https://jhildenbiddle.github.io/css-vars-ponyfill/ * (c) 2018-2024 John Hildenbiddle * MIT license */ function _extends() { _extends = Object.assign ? Object.assign.bind() : function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } /*! * get-css-data * v2.1.0 * https://github.com/jhildenbiddle/get-css-data * (c) 2018-2022 John Hildenbiddle * MIT license */ function getUrls(urls) { var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var settings = { mimeType: options.mimeType || null, onBeforeSend: options.onBeforeSend || Function.prototype, onSuccess: options.onSuccess || Function.prototype, onError: options.onError || Function.prototype, onComplete: options.onComplete || Function.prototype }; var urlArray = Array.isArray(urls) ? urls : [ urls ]; var urlQueue = Array.apply(null, Array(urlArray.length)).map((function(x) { return null; })); function isValidCss(text) { var isString = typeof text === "string"; var isHTML = isString && text.trim().charAt(0) === "<"; return isString && !isHTML; } function onError(xhr, urlIndex) { settings.onError(xhr, urlArray[urlIndex], urlIndex); } function onSuccess(responseText, urlIndex) { var returnVal = settings.onSuccess(responseText, urlArray[urlIndex], urlIndex); responseText = returnVal === false ? "" : returnVal || responseText; urlQueue[urlIndex] = responseText; if (urlQueue.indexOf(null) === -1) { settings.onComplete(urlQueue); } } var parser = document.createElement("a"); urlArray.forEach((function(url, i) { parser.setAttribute("href", url); parser.href = String(parser.href); var isIElte9 = Boolean(document.all && !window.atob); var isIElte9CORS = isIElte9 && parser.host.split(":")[0] !== location.host.split(":")[0]; if (isIElte9CORS) { var isSameProtocol = parser.protocol === location.protocol; if (isSameProtocol) { var xdr = new XDomainRequest; xdr.open("GET", url); xdr.timeout = 0; xdr.onprogress = Function.prototype; xdr.ontimeout = Function.prototype; xdr.onload = function() { var text = xdr.responseText; if (isValidCss(text)) { onSuccess(text, i); } else { onError(xdr, i); } }; xdr.onerror = function(err) { onError(xdr, i); }; setTimeout((function() { xdr.send(); }), 0); } else { console.warn("Internet Explorer 9 Cross-Origin (CORS) requests must use the same protocol (".concat(url, ")")); onError(null, i); } } else { var xhr = new XMLHttpRequest; xhr.open("GET", url); if (settings.mimeType && xhr.overrideMimeType) { xhr.overrideMimeType(settings.mimeType); } settings.onBeforeSend(xhr, url, i); xhr.onreadystatechange = function() { if (xhr.readyState === 4) { var text = xhr.responseText; if (xhr.status < 400 && isValidCss(text)) { onSuccess(text, i); } else if (xhr.status === 0 && isValidCss(text)) { onSuccess(text, i); } else { onError(xhr, i); } } }; xhr.send(); } })); } /** * Gets CSS data from