wisemapping-frontend/packages/mindplot/lib/components/libraries/less/less-1.4.2.min.js

372 lines
91 KiB
JavaScript
Raw Normal View History

2021-07-16 16:41:58 +02:00
/*
* LESS - Leaner CSS v1.4.2
* http://lesscss.org
*
* Copyright (c) 2009-2013, Alexis Sellier
* Licensed under the Apache 2.0 License.
*
* @licence
2021-10-05 02:05:34 +02:00
*/(function (e, t) {
function n(t) { return e.less[t.split('/')[1]]; } function f() { r.env === 'development' ? (r.optimization = 0, r.watchTimer = setInterval(() => { r.watchMode && g((e, t, n, i, s) => { e ? k(e, i.href) : t && S(t.toCSS(r), i, s.lastModified); }); }, r.poll)) : r.optimization = 3; } function m() { const e = document.getElementsByTagName('style'); for (var t = 0; t < e.length; t++) if (e[t].type.match(p)) { const n = new r.tree.parseEnv(r); n.filename = document.location.href.replace(/#.*$/, ''), (new r.Parser(n)).parse(e[t].innerHTML || '', (n, i) => { if (n) return k(n, 'inline'); const s = i.toCSS(r); const o = e[t]; o.type = 'text/css', o.styleSheet ? o.styleSheet.cssText = s : o.innerHTML = s; }); } } function g(e, t) { for (let n = 0; n < r.sheets.length; n++)w(r.sheets[n], e, t, r.sheets.length - (n + 1)); } function y(e, t) { const n = b(e); const r = b(t); let i; let s; let o; let u; let a = ''; if (n.hostPart !== r.hostPart) return ''; s = Math.max(r.directories.length, n.directories.length); for (i = 0; i < s; i++) if (r.directories[i] !== n.directories[i]) break; u = r.directories.slice(i), o = n.directories.slice(i); for (i = 0; i < u.length - 1; i++)a += '../'; for (i = 0; i < o.length - 1; i++)a += `${o[i]}/`; return a; } function b(e, t) { const n = /^((?:[a-z-]+:)?\/+?(?:[^\/\?#]*\/)|([\/\\]))?((?:[^\/\\\?#]*[\/\\])*)([^\/\\\?#]*)([#\?].*)?$/i; const r = e.match(n); const i = {}; let s = []; let o; let u; if (!r) throw new Error(`Could not parse sheet href - '${e}'`); if (!r[1] || r[2]) { u = t.match(n); if (!u) throw new Error(`Could not parse page url - '${t}'`); r[1] = r[1] || u[1] || '', r[2] || (r[3] = u[3] + r[3]); } if (r[3]) { s = r[3].replace(/\\/g, '/').split('/'); for (o = 0; o < s.length; o++)s[o] === '.' && (s.splice(o, 1), o -= 1); for (o = 0; o < s.length; o++)s[o] === '..' && o > 0 && (s.splice(o - 1, 2), o -= 2); } return i.hostPart = r[1], i.directories = s, i.path = r[1] + s.join('/'), i.fileUrl = i.path + (r[4] || ''), i.url = i.fileUrl + (r[5] || ''), i; } function w(t, n, i, s) { const o = b(t.href, e.location.href); const u = o.url; const a = l && l.getItem(u); const f = l && l.getItem(`${u}:timestamp`); const c = { css: a, timestamp: f }; let h; const p = { relativeUrls: r.relativeUrls, currentDirectory: o.path, filename: u }; t instanceof r.tree.parseEnv ? (h = new r.tree.parseEnv(t), p.entryPath = h.currentFileInfo.entryPath, p.rootpath = h.currentFileInfo.rootpath, p.rootFilename = h.currentFileInfo.rootFilename) : (h = new r.tree.parseEnv(r), h.mime = t.type, p.entryPath = o.path, p.rootpath = r.rootpath || o.path, p.rootFilename = u), h.relativeUrls && (r.rootpath ? p.rootpath = b(r.rootpath + y(o.path, p.entryPath)).path : p.rootpath = o.path), x(u, t.type, (e, a) => { v += e.replace(/@import .+?;/ig, ''); if (!i && c && a && (new Date(a)).valueOf() === (new Date(c.timestamp)).valueOf())S(c.css, t), n(null, null, e, t, { local: !0, remaining: s }, u); else try { h.contents[u] = e, h.paths = [o.path], h.currentFileInfo = p, (new r.Parser(h)).parse(e, (r, i) => { if (r) return n(r, null, null, t); try { n(r, i, e, t, { local: !1, lastModified: a, remaining: s }, u), h.currentFileInfo.rootFilename === u && N(document.getElementById(`less-error-message:${E(u)}`)); } catch (r) { n(r, null, null, t); } }); } catch (f) { n(f, null, null, t); } }, (e, r) => { n({ type: 'File', message: `'${r}' wasn't found (${e})` }, null, null, t); }); } function E(e) {
return e.replace(/^[a-z-]+:\/+?[^\/]+/, '').replace(/^\//, '').replace(/\.[a-zA-Z]+$/, '').replace(/[^\.\w-]+/g, '-')
.replace(/\./g, ':');
} function S(e, t, n) { const r = t.href || ''; const i = `less:${t.title || E(r)}`; const s = document.getElementById(i); let o = !1; const u = document.createElement('style'); u.setAttribute('type', 'text/css'), t.media && u.setAttribute('media', t.media), u.id = i; if (u.styleSheet) try { u.styleSheet.cssText = e; } catch (a) { throw new Error("Couldn't reassign styleSheet.cssText."); } else u.appendChild(document.createTextNode(e)), o = s !== null && s.childNodes.length > 0 && u.childNodes.length > 0 && s.firstChild.nodeValue === u.firstChild.nodeValue; const f = document.getElementsByTagName('head')[0]; if (s == null || o === !1) { const c = t && t.nextSibling || null; (c || document.getElementsByTagName('head')[0]).parentNode.insertBefore(u, c); }s && o === !1 && f.removeChild(s); if (n && l) { C(`saving ${r} to cache.`); try { l.setItem(r, e), l.setItem(`${r}:timestamp`, n); } catch (a) { C('failed to save'); } } } function x(e, t, n, i) { function a(t, n, r) { t.status >= 200 && t.status < 300 ? n(t.responseText, t.getResponseHeader('Last-Modified')) : typeof r === 'function' && r(t.status, e); } const s = T(); const u = o ? r.fileAsync : r.async; typeof s.overrideMimeType === 'function' && s.overrideMimeType('text/css'), s.open('GET', e, u), s.setRequestHeader('Accept', t || 'text/x-less, text/css; q=0.9, */*; q=0.5'), s.send(null), o && !r.fileAsync ? s.status === 0 || s.status >= 200 && s.status < 300 ? n(s.responseText) : i(s.status, e) : u ? s.onreadystatechange = function () { s.readyState == 4 && a(s, n, i); } : a(s, n, i); } function T() { if (e.XMLHttpRequest) return new XMLHttpRequest(); try { return new ActiveXObject('MSXML2.XMLHTTP.3.0'); } catch (t) { return C("browser doesn't support AJAX."), null; } } function N(e) { return e && e.parentNode.removeChild(e); } function C(e) { r.env == 'development' && typeof console !== 'undefined' && console.log(`less: ${e}`); } function k(e, n) { const i = `less-error-message:${E(n || '')}`; const s = '<li><label>{line}</label><pre class="{class}">{content}</pre></li>'; const o = document.createElement('div'); let u; let a; const f = []; const l = e.filename || n; const c = l.match(/([^\/]+(\?.*)?)$/)[1]; o.id = i, o.className = 'less-error-message', a = `<h3>${e.type || 'Syntax'}Error: ${e.message || 'There is an error in your .less file'}</h3>` + `<p>in <a href="${l}">${c}</a> `; const h = function (e, n, r) { e.extract[n] != t && f.push(s.replace(/\{line\}/, (parseInt(e.line) || 0) + (n - 1)).replace(/\{class\}/, r).replace(/\{content\}/, e.extract[n])); }; e.extract ? (h(e, 0, ''), h(e, 1, 'line'), h(e, 2, ''), a += `on line ${e.line}, column ${e.column + 1}:</p>` + `<ul>${f.join('')}</ul>`) : e.stack && (a += `<br/>${e.stack.split('\n').slice(1).join('<br/>')}`), o.innerHTML = a, S(['.less-error-message ul, .less-error-message li {', 'list-style-type: none;', 'margin-right: 15px;', 'padding: 4px 0;', 'margin: 0;', '}', '.less-error-message label {', 'font-size: 12px;', 'margin-right: 15px;', 'padding: 4px 0;', 'color: #cc7777;', '}', '.less-error-message pre {', 'color: #dd6666;', 'padding: 4px 0;', 'margin: 0;', 'display: inline-block;', '}', '.less-error-message pre.line {', 'color: #ff0000;', '}', '.less-error-message h3 {', 'font-size: 20px;', 'font-weight: bold;', 'padding: 15px 0 5px 0;', 'margin: 0;', '}', '.less-error-message a {', 'color: #10a', '}', '.less-error-message .error {', 'color: red;', 'font-weight: bold;', 'padding-bottom: 2px;', 'border-bottom: 1px dashed red;', '}'].join('\n'), { title: 'error-message' }), o.style.cssText = ['font-family: Arial, sans-serif', 'border: 1px solid #e00', 'background-color: #eee', 'border-radius: 5px', '-webkit-border-radius: 5px', '-moz-border-radius: 5px', 'color: #e00', 'padding: 15px', 'margin-bottom: 15px'].join(';'), r.env == 'development' && (u = setInterval(() => { document.body && (document.getElementById(i) ? document.body.replaceChild(o, document.getElementById(i)) : document.body.insertBefore(o, document.body.firstChild), clearInterval(u)); }, 10)); } let r; let i; let s; typeof environment ==
function m() { a = c[u], f = o, h = o; } function g() { c[u] = a, o = f, h = o; } function y() { o > h && (c[u] = c[u].slice(o - h), h = o); } function b(e) { const t = e.charCodeAt(0); return t === 32 || t === 10 || t === 9; } function w(e) { let t; let n; let r; let i; let a; if (e instanceof Function) return e.call(p.parsers); if (typeof e === 'string')t = s.charAt(o) === e ? e : null, r = 1, y(); else { y(); if (!(t = e.exec(c[u]))) return null; r = t[0].length; } if (t) return E(r), typeof t === 'string' ? t : t.length === 1 ? t[0] : t; } function E(e) { const t = o; const n = u; const r = o + c[u].length; const i = o += e; while (o < r) { if (!b(s.charAt(o))) break; o++; } return c[u] = c[u].slice(e + (o - i)), h = o, c[u].length === 0 && u < c.length - 1 && u++, t !== o || n !== u; } function S(e, t) { const n = w(e); if (n) return n; x(t || (typeof e === 'string' ? `expected '${e}' got '${s.charAt(o)}'` : 'unexpected token')); } function x(e, t) { const n = new Error(e); throw n.index = o, n.type = t || 'Syntax', n; } function T(e) { return typeof e === 'string' ? s.charAt(o) === e : e.test(c[u]) ? !0 : !1; } function N(e, t) { return e.filename && t.currentFileInfo.filename && e.filename !== t.currentFileInfo.filename ? p.imports.contents[e.filename] : s; } function C(e, t) { for (var n = e, r = -1; n >= 0 && t.charAt(n) !== '\n'; n--)r++; return { line: typeof e === 'number' ? (t.slice(0, e).match(/\n/g) || '').length : null, column: r }; } function k(e, t, i) { let s = i.currentFileInfo.filename; return r.mode !== 'browser' && r.mode !== 'rhino' && (s = n('path').resolve(s)), { lineNumber: C(e, t).line + 1, fileName: s }; } function L(e, t) { const n = N(e, t); const r = C(e.index, n); const i = r.line; const s = r.column; const o = n.split('\n'); this.type = e.type || 'Syntax', this.message = e.message, this.filename = e.filename || t.currentFileInfo.filename, this.index = e.index, this.line = typeof i === 'number' ? i + 1 : null, this.callLine = e.call && C(e.call, n).line + 1, this.callExtract = o[C(e.call, n).line], this.stack = e.stack, this.column = s, this.extract = [o[i - 1], o[i], o[i + 1]]; } let s; let o; let u; let a; let f; let l; let c; let h; let p; const d = this; t instanceof i.parseEnv || (t = new i.parseEnv(t)); const v = this.imports = {
paths: t.paths || [], queue: [], files: t.files, contents: t.contents, mime: t.mime, error: null, push(e, n, i) { const s = this; this.queue.push(e), r.Parser.importer(e, n, (t, n, r) => { s.queue.splice(s.queue.indexOf(e), 1); const o = r in s.files; s.files[r] = n, t && !s.error && (s.error = t), i(t, n, o); }, t); },
}; return L.prototype = new Error(), L.prototype.constructor = L, this.env = t = t || {}, this.optimization = 'optimization' in this.env ? this.env.optimization : 1, p = {
imports: v,
parse(e, a) {
let f; let d; let v; let m; let g; let y; const b = []; let E; let S = null; o = u = h = l = 0, s = e.replace(/\r\n/g, '\n'), s = s.replace(/^\uFEFF/, ''), c = (function (e) {
let n = 0; const r = /(?:@\{[\w-]+\}|[^"'`\{\}\/\(\)\\])+/g; const i = /\/\*(?:[^*]|\*+[^\/*])*\*+\/|\/\/.*/g; const o = /"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'|`((?:[^`]|\\.)*)`/g; let u = 0; let a; let f = e[0]; let l; for (var c = 0, h, p; c < s.length;) { r.lastIndex = c, (a = r.exec(s)) && a.index === c && (c += a[0].length, f.push(a[0])), h = s.charAt(c), i.lastIndex = o.lastIndex = c; if (a = o.exec(s)) if (a.index === c) { c += a[0].length, f.push(a[0]); continue; } if (!l && h === '/') { p = s.charAt(c + 1); if (p === '/' || p === '*') if (a = i.exec(s)) if (a.index === c) { c += a[0].length, f.push(a[0]); continue; } } switch (h) { case '{': if (!l) { u++, f.push(h); break; } case '}': if (!l) { u--, f.push(h), e[++n] = f = []; break; } case '(': if (!l) { l = !0, f.push(h); break; } case ')': if (l) { l = !1, f.push(h); break; } default: f.push(h); }c++; } return u != 0 && (S = new L({
index: c - 1, type: 'Parse', message: u > 0 ? 'missing closing `}`' : 'missing opening `{`', filename: t.currentFileInfo.filename,
}, t)), e.map((e) => e.join(''));
}([[]])); if (S) return a(new L(S, t)); try { f = new i.Ruleset([], w(this.parsers.primary)), f.root = !0, f.firstRoot = !0; } catch (x) { return a(new L(x, t)); }f.toCSS = (function (e) { let s; let o; let u; return function (s, o) { s = s || {}; let u; const a = new i.evalEnv(s); typeof o === 'object' && !Array.isArray(o) && (o = Object.keys(o).map((e) => { let t = o[e]; return t instanceof i.Value || (t instanceof i.Expression || (t = new i.Expression([t])), t = new i.Value([t])), new i.Rule(`@${e}`, t, !1, 0); }), a.frames = [new i.Ruleset(null, o)]); try { const f = e.call(this, a); (new i.joinSelectorVisitor()).run(f), (new i.processExtendsVisitor()).run(f); var l = f.toCSS({ compress: Boolean(s.compress), dumpLineNumbers: t.dumpLineNumbers, strictUnits: Boolean(s.strictUnits) }); } catch (c) { throw new L(c, t); } return s.yuicompress && r.mode === 'node' ? n('ycssmin').cssmin(l, s.maxLineLen) : s.compress ? l.replace(/(\s)+/g, '$1') : l; }; }(f.eval)); if (o < s.length - 1) {
o = l, y = s.split('\n'), g = (s.slice(0, o).match(/\n/g) || '').length + 1; for (var T = o, N = -1; T >= 0 && s.charAt(T) !== '\n'; T--)N++; S = {
type: 'Parse', message: 'Unrecognised input', index: o, filename: t.currentFileInfo.filename, line: g, column: N, extract: [y[g - 2], y[g - 1], y[g]],
};
} const C = function (e) { e = S || e || p.imports.error, e ? (e instanceof L || (e = new L(e, t)), a(e)) : a(null, f); }; t.processImports !== !1 ? (new i.importVisitor(this.imports, C)).run(f) : C();
},
parsers: {
primary() { let e; const t = []; while ((e = w(this.extendRule) || w(this.mixin.definition) || w(this.rule) || w(this.ruleset) || w(this.mixin.call) || w(this.comment) || w(this.directive)) || w(/^[\s\n]+/) || w(/^;+/))e && t.push(e); return t; },
comment() { let e; if (s.charAt(o) !== '/') return; if (s.charAt(o + 1) === '/') return new i.Comment(w(/^\/\/.*/), !0); if (e = w(/^\/\*(?:[^*]|\*+[^\/*])*\*+\/\n?/)) return new i.Comment(e); },
entities: {
quoted() { let e; let n = o; let r; const u = o; s.charAt(n) === '~' && (n++, r = !0); if (s.charAt(n) !== '"' && s.charAt(n) !== "'") return; r && w('~'); if (e = w(/^"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'/)) return new i.Quoted(e[0], e[1] || e[2], r, u, t.currentFileInfo); }, keyword() { let e; if (e = w(/^[_A-Za-z-][_A-Za-z0-9-]*/)) return i.colors.hasOwnProperty(e) ? new i.Color(i.colors[e].slice(1)) : new i.Keyword(e); }, call() { let e; let n; let r; let s; const a = o; if (!(e = /^([\w-]+|%|progid:[\w\.]+)\(/.exec(c[u]))) return; e = e[1], n = e.toLowerCase(); if (n === 'url') return null; o += e.length; if (n === 'alpha') { s = w(this.alpha); if (typeof s !== 'undefined') return s; }w('('), r = w(this.entities.arguments); if (!w(')')) return; if (e) return new i.Call(e, r, a, t.currentFileInfo); }, arguments() { const e = []; let t; while (t = w(this.entities.assignment) || w(this.expression)) { e.push(t); if (!w(',')) break; } return e; }, literal() { return w(this.entities.dimension) || w(this.entities.color) || w(this.entities.quoted) || w(this.entities.unicodeDescriptor); }, assignment() { let e; let t; if ((e = w(/^\w+(?=\s?=)/i)) && w('=') && (t = w(this.entity))) return new i.Assignment(e, t); }, url() { let e; if (s.charAt(o) !== 'u' || !w(/^url\(/)) return; return e = w(this.entities.quoted) || w(this.entities.variable) || w(/^(?:(?:\\[\(\)'"])|[^\(\)'"])+/) || '', S(')'), new i.URL(e.value != null || e instanceof i.Variable ? e : new i.Anonymous(e), t.currentFileInfo); }, variable() { let e; const n = o; if (s.charAt(o) === '@' && (e = w(/^@@?[\w-]+/))) return new i.Variable(e, n, t.currentFileInfo); }, variableCurly() { let e; let n; const r = o; if (s.charAt(o) === '@' && (n = w(/^@\{([\w-]+)\}/))) return new i.Variable(`@${n[1]}`, r, t.currentFileInfo); }, color() { let e; if (s.charAt(o) === '#' && (e = w(/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})/))) return new i.Color(e[1]); }, dimension() { let e; const t = s.charCodeAt(o); if (t > 57 || t < 43 || t === 47 || t == 44) return; if (e = w(/^([+-]?\d*\.?\d+)(%|[a-z]+)?/)) return new i.Dimension(e[1], e[2]); }, unicodeDescriptor() { let e; if (e = w(/^U\+[0-9a-fA-F?]+(\-[0-9a-fA-F?]+)?/)) return new i.UnicodeDescriptor(e[0]); }, javascript() { let e; let t = o; let n; s.charAt(t) === '~' && (t++, n = !0); if (s.charAt(t) !== '`') return; n && w('~'); if (e = w(/^`([^`]*)`/)) return new i.JavaScript(e[1], o, n); },
},
variable() { let e; if (s.charAt(o) === '@' && (e = w(/^(@[\w-]+)\s*:/))) return e[1]; },
extend(e) { let t; let n; const r = o; let s; const u = []; if (!w(e ? /^&:extend\(/ : /^:extend\(/)) return; do { s = null, t = []; for (;;) { s = w(/^(all)(?=\s*(\)|,))/); if (s) break; n = w(this.element); if (!n) break; t.push(n); }s = s && s[1], u.push(new i.Extend(new i.Selector(t), s, r)); } while (w(',')); return S(/^\)/), e && S(/^;/), u; },
extendRule() { return this.extend(!0); },
mixin: { call() { const e = []; let n; let r; let u; let a; let f; const l = o; const c = s.charAt(o); let h = !1; if (c !== '.' && c !== '#') return; m(); while (n = w(/^[#.](?:[\w-]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/))e.push(new i.Element(r, n, o)), r = w('>'); w('(') && (u = this.mixin.args.call(this, !0).args, S(')')), u = u || [], w(this.important) && (h = !0); if (e.length > 0 && (w(';') || T('}'))) return new i.mixin.Call(e, u, l, t.currentFileInfo, h); g(); }, args(e) { let t = []; const n = []; let r; const u = []; let a; let f; let l; let c; let h; const p = { args: null, variadic: !1 }; for (;;) { if (e)h = w(this.expression); else { w(this.comment); if (s.charAt(o) === '.' && w(/^\.{3}/)) { p.variadic = !0, w(';') && !r && (r = !0), (r ? n : u).push({ variadic: !0 }); break; }h = w(this.entities.variable) || w(this.entities.literal) || w(this.entities.keyword); } if (!h) break; l = null, h.throwAwayComments && h.throwAwayComments(), c = h; var d = null; if (e) { if (h.value.length == 1) var d = h.value[0]; } else d = h; if (d && d instanceof i.Variable) if (w(':'))t.length > 0 && (r && x('Cannot mix ; and , as delimiter types'), a = !0), c = S(this.expression), l = f = d.name; else { if (!e && w(/^\.{3}/)) { p.variadic = !0, w(';') && !r && (r = !0), (r ? n : u).push({ name: h.name, variadic: !0 }); break; }e || (f = l = d.name, c = null); }c && t.push(c), u.push({ name: l, value: c }); if (w(',')) continue; if (w(';') || r)a && x('Cannot mix ; and , as delimiter types'), r = !0, t.length > 1 && (c = new i.Value(t)), n.push({ name: f, value: c }), f = null, t = [], a = !1; } return p.args = r ? n : u, p; }, definition() { let e; let t = []; let n; let r; let u; let a; let f; let c = !1; if (s.charAt(o) !== '.' && s.charAt(o) !== '#' || T(/^[^{]*\}/)) return; m(); if (n = w(/^([#.](?:[\w-]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+)\s*\(/)) { e = n[1]; const h = this.mixin.args.call(this, !1); t = h.args, c = h.variadic, w(')') || (l = o, g()), w(this.comment), w(/^when/) && (f = S(this.conditions, 'expected condition')), r = w(this.block); if (r) return new i.mixin.Definition(e, t, r, f, c); g(); } } },
entity() { return w(this.entities.literal) || w(this.entities.variable) || w(this.entities.url) || w(this.entities.call) || w(this.entities.keyword) || w(this.entities.javascript) || w(this.comment); },
end() { return w(';') || T('}'); },
alpha() { let e; if (!w(/^\(opacity=/i)) return; if (e = w(/^\d+/) || w(this.entities.variable)) return S(')'), new i.Alpha(e); },
element() { let e; let t; let n; let r; n = w(this.combinator), e = w(/^(?:\d+\.\d+|\d+)%/) || w(/^(?:[.#]?|:*)(?:[\w-]|[^\x00-\x9f]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/) || w('*') || w('&') || w(this.attribute) || w(/^\([^()@]+\)/) || w(/^[\.#](?=@)/) || w(this.entities.variableCurly), e || w('(') && (r = w(this.selector)) && w(')') && (e = new i.Paren(r)); if (e) return new i.Element(n, e, o); },
combinator() { const e = s.charAt(o); if (e === '>' || e === '+' || e === '~' || e === '|') { o++; while (s.charAt(o).match(/\s/))o++; return new i.Combinator(e); } return s.charAt(o - 1).match(/\s/) ? new i.Combinator(' ') : new i.Combinator(null); },
selector() { let e; let t; const n = []; let r; let u; const a = []; while ((u = w(this.extend)) || (t = w(this.element))) { u ? a.push.apply(a, u) : (a.length && x('Extend can only be used at the end of selector'), r = s.charAt(o), n.push(t), t = null); if (r === '{' || r === '}' || r === ';' || r === ',' || r === ')') break; } if (n.length > 0) return new i.Selector(n, a); a.length && x('Extend must be used to extend a selector, it cannot be used on its own'); },
attribute() { const e = ''; let t; let n; let r; if (!w('[')) return; (t = w(this.entities.variableCurly)) || (t = S(/^(?:[_A-Za-z0-9-\*]*\|)?(?:[_A-Za-z0-9-]|\\.)+/)); if (r = w(/^[|~*$^]?=/))n = w(this.entities.quoted) || w(/^[\w-]+/) || w(this.entities.variableCurly); return S(']'), new i.Attribute(t, r, n); },
block() { let e; if (w('{') && (e = w(this.primary)) && w('}')) return e; },
ruleset() { const e = []; let n; let r; let u; m(), t.dumpLineNumbers && (u = k(o, s, t)); while (n = w(this.selector)) { e.push(n), w(this.comment); if (!w(',')) break; w(this.comment); } if (e.length > 0 && (r = w(this.block))) { const a = new i.Ruleset(e, r, t.strictImports); return t.dumpLineNumbers && (a.debugInfo = u), a; }l = o, g(); },
rule(e) { let n; let r; const u = s.charAt(o); let a; m(); if (u === '.' || u === '#' || u === '&') return; if (n = w(this.variable) || w(this.property)) { r = !e && (t.compress || n.charAt(0) === '@') ? w(this.value) || w(this.anonymousValue) : w(this.anonymousValue) || w(this.value), a = w(this.important); if (r && w(this.end)) return new i.Rule(n, r, a, f, t.currentFileInfo); l = o, g(); if (r && !e) return this.rule(!0); } },
anonymousValue() { let e; if (e = /^([^@+\/'"*`(;{}-]*);/.exec(c[u])) return o += e[0].length - 1, new i.Anonymous(e[1]); },
import() { let e; let n; const r = o; m(); const s = w(/^@import?\s+/); const u = (s ? w(this.importOptions) : null) || {}; if (s && (e = w(this.entities.quoted) || w(this.entities.url))) { n = w(this.mediaFeatures); if (w(';')) return n = n && new i.Value(n), new i.Import(e, n, u, r, t.currentFileInfo); }g(); },
importOptions() { let e; const t = {}; let n; let r; if (!w('(')) return null; do if (e = w(this.importOption)) { n = e, r = !0; switch (n) { case 'css': n = 'less', r = !1; break; case 'once': n = 'multiple', r = !1; }t[n] = r; if (!w(',')) break; } while (e); return S(')'), t; },
importOption() { const e = w(/^(less|css|multiple|once)/); if (e) return e[1]; },
mediaFeature() { let e; let n; const r = []; do if (e = w(this.entities.keyword))r.push(e); else if (w('(')) { n = w(this.property), e = w(this.value); if (!w(')')) return null; if (n && e)r.push(new i.Paren(new i.Rule(n, e, null, o, t.currentFileInfo, !0))); else { if (!e) return null; r.push(new i.Paren(e)); } } while (e); if (r.length > 0) return new i.Expression(r); },
mediaFeatures() { let e; const t = []; do if (e = w(this.mediaFeature)) { t.push(e); if (!w(',')) break; } else if (e = w(this.entities.variable)) { t.push(e); if (!w(',')) break; } while (e); return t.length > 0 ? t : null; },
media() { let e; let n; let r; let u; t.dumpLineNumbers && (u = k(o, s, t)); if (w(/^@media/)) { e = w(this.mediaFeatures); if (n = w(this.block)) return r = new i.Media(n, e), t.dumpLineNumbers && (r.debugInfo = u), r; } },
directive() { let e; let n; let r; let u; let a; let f; let l; let c; let h; let p; if (s.charAt(o) !== '@') return; if (n = w(this.import) || w(this.media)) return n; m(), e = w(/^@[a-z-]+/); if (!e) return; l = e, e.charAt(1) == '-' && e.indexOf('-', 2) > 0 && (l = `@${e.slice(e.indexOf('-', 2) + 1)}`); switch (l) { case '@font-face': c = !0; break; case '@viewport': case '@top-left': case '@top-left-corner': case '@top-center': case '@top-right': case '@top-right-corner': case '@bottom-left': case '@bottom-left-corner': case '@bottom-center': case '@bottom-right': case '@bottom-right-corner': case '@left-top': case '@left-middle': case '@left-bottom': case '@right-top': case '@right-middle': case '@right-bottom': c = !0; break; case '@page': case '@document': case '@supports': case '@keyframes': c = !0, h = !0; break; case '@namespace': p = !0; }h && (e += ` ${(w(/^[^{]+/) || '').trim()}`); if (c) { if (r = w(this.block)) return new i.Directive(e, r); } else if ((n = p ? w(this.expression) : w(this.entity)) && w(';')) { const d = new i.Directive(e, n); return t.dumpLineNumbers && (d.debugInfo = k(o, s, t)), d; }g(); },
value() { let e; const t = []; let n; while (e = w(this.expression)) { t.push(e); if (!w(',')) break; } if (t.length > 0) return new i.Value(t); },
important() { if (s.charAt(o) === '!') return w(/^! *important/); },
sub() { let e; let t; if (w('(')) if (e = w(this.addition)) return t = new i.Expression([e]), S(')'), t.parens = !0, t; },
multiplication() { let e; let t; let n; let r; let u; const a = []; if (e = w(this.operand)) { u = b(s.charAt(o - 1)); while (!T(/^\/[*\/]/) && (n = w('/') || w('*'))) { if (!(t = w(this.operand))) break; e.parensInOp = !0, t.parensInOp = !0, r = new i.Operation(n, [r || e, t], u), u = b(s.charAt(o - 1)); } return r || e; } },
addition() { let e; let t; let n; let r; let u; if (e = w(this.multiplication)) { u = b(s.charAt(o - 1)); while ((n = w(/^[-+]\s+/) || !u && (w('+') || w('-'))) && (t = w(this.multiplication)))e.parensInOp = !0, t.parensInOp = !0, r = new i.Operation(n, [r || e, t], u), u = b(s.charAt(o - 1)); return r || e; } },
conditions() { let e; let t; const n = o; let r; if (e = w(this.condition)) { while (w(',') && (t = w(this.condition)))r = new i.Condition('or', r || e, t, n); return r || e; } },
condition() { let e; let t; let n; let r; const s = o; let u = !1; w(/^not/) && (u = !0), S('('); if (e = w(this.addition) || w(this.entities.keyword) || w(this.entities.quoted)) return (r = w(/^(?:>=|=<|[<=>])/)) ? (t = w(this.addition) || w(this.entities.keyword) || w(this.entities.quoted)) ? n = new i.Condition(r, e, t, s, u) : x('expected expression') : n = new i.Condition('=', e, new i.Keyword('true'), s, u), S(')'), w(/^and/) ? new i.Condition('and', n, w(this.condition)) : n; },
operand() { let e; const t = s.charAt(o + 1); s.charAt(o) === '-' && (t === '@' || t === '(') && (e = w('-')); let n = w(this.sub) || w(this.entities.dimension) || w(this.entities.color) || w(this.entities.variable) || w(this.entities.call); return e && (n.parensInOp = !0, n = new i.Negative(n)), n; },
expression() { let e; let t; const n = []; let r; while (e = w(this.addition) || w(this.entity))n.push(e), !T(/^\/[\/*]/) && (t = w('/')) && n.push(new i.Anonymous(t)); if (n.length > 0) return new i.Expression(n); },
property() { let e; if (e = w(/^(\*?-?[_a-zA-Z0-9-]+)\s*:/)) return e[1]; },
},
};
}; if (r.mode === 'browser' || r.mode === 'rhino')r.Parser.importer = function (e, t, n, r) { !/^([a-z-]+:)?\//.test(e) && t.currentDirectory && (e = t.currentDirectory + e); const i = r.toSheet(e); i.processImports = !1, i.currentFileInfo = t, w(i, (e, t, r, i, s, o) => { n.call(null, e, t, o); }, !0); }; (function (r) {
function u(e) { return r.functions.hsla(e.h, e.s, e.l, e.a); } function a(e, t) { return e instanceof r.Dimension && e.unit.is('%') ? parseFloat(e.value * t / 100) : f(e); } function f(e) { if (e instanceof r.Dimension) return parseFloat(e.unit.is('%') ? e.value / 100 : e.value); if (typeof e === 'number') return e; throw { error: 'RuntimeError', message: 'color functions take numbers as parameters' }; } function l(e) { return Math.min(1, Math.max(0, e)); }r.functions = {
rgb(e, t, n) { return this.rgba(e, t, n, 1); },
rgba(e, t, n, i) { const s = [e, t, n].map((e) => a(e, 256)); return i = f(i), new r.Color(s, i); },
hsl(e, t, n) { return this.hsla(e, t, n, 1); },
hsla(e, t, n, r) { function o(e) { return e = e < 0 ? e + 1 : e > 1 ? e - 1 : e, e * 6 < 1 ? s + (i - s) * e * 6 : e * 2 < 1 ? i : e * 3 < 2 ? s + (i - s) * (2 / 3 - e) * 6 : s; }e = f(e) % 360 / 360, t = l(f(t)), n = l(f(n)), r = l(f(r)); var i = n <= 0.5 ? n * (t + 1) : n + t - n * t; var s = n * 2 - i; return this.rgba(o(e + 1 / 3) * 255, o(e) * 255, o(e - 1 / 3) * 255, r); },
hsv(e, t, n) { return this.hsva(e, t, n, 1); },
hsva(e, t, n, r) { e = f(e) % 360 / 360 * 360, t = f(t), n = f(n), r = f(r); let i; let s; i = Math.floor(e / 60 % 6), s = e / 60 - i; const o = [n, n * (1 - t), n * (1 - s * t), n * (1 - (1 - s) * t)]; const u = [[0, 3, 1], [2, 0, 1], [1, 0, 3], [1, 2, 0], [3, 1, 0], [0, 1, 2]]; return this.rgba(o[u[i][0]] * 255, o[u[i][1]] * 255, o[u[i][2]] * 255, r); },
hue(e) { return new r.Dimension(Math.round(e.toHSL().h)); },
saturation(e) { return new r.Dimension(Math.round(e.toHSL().s * 100), '%'); },
lightness(e) { return new r.Dimension(Math.round(e.toHSL().l * 100), '%'); },
hsvhue(e) { return new r.Dimension(Math.round(e.toHSV().h)); },
hsvsaturation(e) { return new r.Dimension(Math.round(e.toHSV().s * 100), '%'); },
hsvvalue(e) { return new r.Dimension(Math.round(e.toHSV().v * 100), '%'); },
red(e) { return new r.Dimension(e.rgb[0]); },
green(e) { return new r.Dimension(e.rgb[1]); },
blue(e) { return new r.Dimension(e.rgb[2]); },
alpha(e) { return new r.Dimension(e.toHSL().a); },
luma(e) { return new r.Dimension(Math.round(e.luma() * e.alpha * 100), '%'); },
saturate(e, t) { const n = e.toHSL(); return n.s += t.value / 100, n.s = l(n.s), u(n); },
desaturate(e, t) { const n = e.toHSL(); return n.s -= t.value / 100, n.s = l(n.s), u(n); },
lighten(e, t) { const n = e.toHSL(); return n.l += t.value / 100, n.l = l(n.l), u(n); },
darken(e, t) { const n = e.toHSL(); return n.l -= t.value / 100, n.l = l(n.l), u(n); },
fadein(e, t) { const n = e.toHSL(); return n.a += t.value / 100, n.a = l(n.a), u(n); },
fadeout(e, t) { const n = e.toHSL(); return n.a -= t.value / 100, n.a = l(n.a), u(n); },
fade(e, t) { const n = e.toHSL(); return n.a = t.value / 100, n.a = l(n.a), u(n); },
spin(e, t) { const n = e.toHSL(); const r = (n.h + t.value) % 360; return n.h = r < 0 ? 360 + r : r, u(n); },
mix(e, t, n) { n || (n = new r.Dimension(50)); const i = n.value / 100; const s = i * 2 - 1; const o = e.toHSL().a - t.toHSL().a; const u = ((s * o == -1 ? s : (s + o) / (1 + s * o)) + 1) / 2; const a = 1 - u; const f = [e.rgb[0] * u + t.rgb[0] * a, e.rgb[1] * u + t.rgb[1] * a, e.rgb[2] * u + t.rgb[2] * a]; const l = e.alpha * i + t.alpha * (1 - i); return new r.Color(f, l); },
greyscale(e) { return this.desaturate(e, new r.Dimension(100)); },
contrast(e, t, n, r) { if (!e.rgb) return null; typeof n === 'undefined' && (n = this.rgba(255, 255, 255, 1)), typeof t === 'undefined' && (t = this.rgba(0, 0, 0, 1)); if (t.luma() > n.luma()) { const i = n; n = t, t = i; } return typeof r === 'undefined' ? r = 0.43 : r = f(r), e.luma() * e.alpha < r ? n : t; },
e(e) { return new r.Anonymous(e instanceof r.JavaScript ? e.evaluated : e); },
escape(e) {
return new r.Anonymous(encodeURI(e.value).replace(/=/g, '%3D').replace(/:/g, '%3A').replace(/#/g, '%23')
.replace(/;/g, '%3B')
.replace(/\(/g, '%28')
.replace(/\)/g, '%29'));
},
'%': function (e) { const t = Array.prototype.slice.call(arguments, 1); let n = e.value; for (var i = 0; i < t.length; i++)n = n.replace(/%[sda]/i, (e) => { const n = e.match(/s/i) ? t[i].value : t[i].toCSS(); return e.match(/[A-Z]$/) ? encodeURIComponent(n) : n; }); return n = n.replace(/%%/g, '%'), new r.Quoted(`"${n}"`, n); },
unit(e, t) { return new r.Dimension(e.value, t ? t.toCSS() : ''); },
convert(e, t) { return e.convertTo(t.value); },
round(e, t) { const n = typeof t === 'undefined' ? 0 : t.value; return this._math((e) => e.toFixed(n), null, e); },
pi() { return new r.Dimension(Math.PI); },
mod(e, t) { return new r.Dimension(e.value % t.value, e.unit); },
pow(e, t) { if (typeof e === 'number' && typeof t === 'number')e = new r.Dimension(e), t = new r.Dimension(t); else if (!(e instanceof r.Dimension) || !(t instanceof r.Dimension)) throw { type: 'Argument', message: 'arguments must be numbers' }; return new r.Dimension(Math.pow(e.value, t.value), e.unit); },
_math(e, t, n) { if (n instanceof r.Dimension) return new r.Dimension(e(parseFloat(n.value)), t == null ? n.unit : t); if (typeof n === 'number') return e(n); throw { type: 'Argument', message: 'argument must be a number' }; },
argb(e) { return new r.Anonymous(e.toARGB()); },
percentage(e) { return new r.Dimension(e.value * 100, '%'); },
color(e) { if (e instanceof r.Quoted) return new r.Color(e.value.slice(1)); throw { type: 'Argument', message: 'argument must be a string' }; },
iscolor(e) { return this._isa(e, r.Color); },
isnumber(e) { return this._isa(e, r.Dimension); },
isstring(e) { return this._isa(e, r.Quoted); },
iskeyword(e) { return this._isa(e, r.Keyword); },
isurl(e) { return this._isa(e, r.URL); },
ispixel(e) { return this.isunit(e, 'px'); },
ispercentage(e) { return this.isunit(e, '%'); },
isem(e) { return this.isunit(e, 'em'); },
isunit(e, t) { return e instanceof r.Dimension && e.unit.is(t.value || t) ? r.True : r.False; },
_isa(e, t) { return e instanceof t ? r.True : r.False; },
multiply(e, t) { const n = e.rgb[0] * t.rgb[0] / 255; const r = e.rgb[1] * t.rgb[1] / 255; const i = e.rgb[2] * t.rgb[2] / 255; return this.rgb(n, r, i); },
screen(e, t) { const n = 255 - (255 - e.rgb[0]) * (255 - t.rgb[0]) / 255; const r = 255 - (255 - e.rgb[1]) * (255 - t.rgb[1]) / 255; const i = 255 - (255 - e.rgb[2]) * (255 - t.rgb[2]) / 255; return this.rgb(n, r, i); },
overlay(e, t) { const n = e.rgb[0] < 128 ? 2 * e.rgb[0] * t.rgb[0] / 255 : 255 - 2 * (255 - e.rgb[0]) * (255 - t.rgb[0]) / 255; const r = e.rgb[1] < 128 ? 2 * e.rgb[1] * t.rgb[1] / 255 : 255 - 2 * (255 - e.rgb[1]) * (255 - t.rgb[1]) / 255; const i = e.rgb[2] < 128 ? 2 * e.rgb[2] * t.rgb[2] / 255 : 255 - 2 * (255 - e.rgb[2]) * (255 - t.rgb[2]) / 255; return this.rgb(n, r, i); },
softlight(e, t) { let n = t.rgb[0] * e.rgb[0] / 255; const r = n + e.rgb[0] * (255 - (255 - e.rgb[0]) * (255 - t.rgb[0]) / 255 - n) / 255; n = t.rgb[1] * e.rgb[1] / 255; const i = n + e.rgb[1] * (255 - (255 - e.rgb[1]) * (255 - t.rgb[1]) / 255 - n) / 255; n = t.rgb[2] * e.rgb[2] / 255; const s = n + e.rgb[2] * (255 - (255 - e.rgb[2]) * (255 - t.rgb[2]) / 255 - n) / 255; return this.rgb(r, i, s); },
hardlight(e, t) { const n = t.rgb[0] < 128 ? 2 * t.rgb[0] * e.rgb[0] / 255 : 255 - 2 * (255 - t.rgb[0]) * (255 - e.rgb[0]) / 255; const r = t.rgb[1] < 128 ? 2 * t.rgb[1] * e.rgb[1] / 255 : 255 - 2 * (255 - t.rgb[1]) * (255 - e.rgb[1]) / 255; const i = t.rgb[2] < 128 ? 2 * t.rgb[2] * e.rgb[2] / 255 : 255 - 2 * (255 - t.rgb[2]) * (255 - e.rgb[2]) / 255; return this.rgb(n, r, i); },
difference(e, t) { const n = Math.abs(e.rgb[0] - t.rgb[0]); const r = Math.abs(e.rgb[1] - t.rgb[1]); const i = Math.abs(e.rgb[2] - t.rgb[2]); return this.rgb(n, r, i); },
exclusion(e, t) { const n = e.rgb[0] + t.rgb[0] * (255 - e.rgb[0] - e.rgb[0]) / 255; const r = e.rgb[1] + t.rgb[1] * (255 - e.rgb[1] - e.rgb[1]) / 255; const i = e.rgb[2] + t.rgb[2] * (255 - e.rgb[2] - e.rgb[2]) / 255; return this.rgb(n, r, i); },
average(e, t) { const n = (e.rgb[0] + t.rgb[0]) / 2; const r = (e.rgb[1] + t.rgb[1]) / 2; const i = (e.rgb[2] + t.rgb[2]) / 2; return this.rgb(n, r, i); },
negation(e, t) { const n = 255 - Math.abs(255 - t.rgb[0] - e.rgb[0]); const r = 255 - Math.abs(255 - t.rgb[1] - e.rgb[1]); const i = 255 - Math.abs(255 - t.rgb[2] - e.rgb[2]); return this.rgb(n, r, i); },
tint(e, t) { return this.mix(this.rgb(255, 255, 255), e, t); },
shade(e, t) { return this.mix(this.rgb(0, 0, 0), e, t); },
extract(e, t) { return t = t.value - 1, e.value[t]; },
'data-uri': function (t, i) { if (typeof e !== 'undefined') return (new r.URL(i || t, this.currentFileInfo)).eval(this.env); let s = t.value; let o = i && i.value; const u = n('fs'); const a = n('path'); let f = !1; arguments.length < 2 && (o = s), this.env.isPathRelative(o) && (this.currentFileInfo.relativeUrls ? o = a.join(this.currentFileInfo.currentDirectory, o) : o = a.join(this.currentFileInfo.entryPath, o)); if (arguments.length < 2) { let l; try { l = n('mime'); } catch (c) { l = r._mime; }s = l.lookup(o); const h = l.charsets.lookup(s); f = ['US-ASCII', 'UTF-8'].indexOf(h) < 0, f && (s += ';base64'); } else f = /;base64$/.test(s); let p = u.readFileSync(o); const d = 32; const v = parseInt(p.length / 1024, 10); if (v >= d) { if (this.env.ieCompat !== !1) return this.env.silent || console.warn('Skipped data-uri embedding of %s because its size (%dKB) exceeds IE8-safe %dKB!', o, v, d), (new r.URL(i || t, this.currentFileInfo)).eval(this.env); this.env.silent || console.warn("WARNING: Embedding %s (%dKB) exceeds IE8's data-uri size limit of %dKB!", o, v, d); }p = f ? p.toString('base64') : encodeURIComponent(p); const m = `'data:${s},${p}'`; return new r.URL(new r.Anonymous(m)); },
}, r._mime = {
_types: {
'.htm': 'text/html', '.html': 'text/html', '.gif': 'image/gif', '.jpg': 'image/jpeg', '.jpeg': 'image/jpeg', '.png': 'image/png',
},
lookup(e) { const i = n('path').extname(e); const s = r._mime._types[i]; if (s === t) throw new Error(`Optional dependency "mime" is required for ${i}`); return s; },
charsets: { lookup(e) { return e && /^text\//.test(e) ? 'UTF-8' : ''; } },
}; const i = [{ name: 'ceil' }, { name: 'floor' }, { name: 'sqrt' }, { name: 'abs' }, { name: 'tan', unit: '' }, { name: 'sin', unit: '' }, { name: 'cos', unit: '' }, { name: 'atan', unit: 'rad' }, { name: 'asin', unit: 'rad' }, { name: 'acos', unit: 'rad' }]; const s = function (e, t) { return function (n) { return t != null && (n = n.unify()), this._math(Math[e], t, n); }; }; for (let o = 0; o < i.length; o++)r.functions[i[o].name] = s(i[o].name, i[o].unit); r.functionCall = function (e, t) { this.env = e, this.currentFileInfo = t; }, r.functionCall.prototype = r.functions;
}(n('./tree'))), (function (e) {
e.colors = {
aliceblue: '#f0f8ff', antiquewhite: '#faebd7', aqua: '#00ffff', aquamarine: '#7fffd4', azure: '#f0ffff', beige: '#f5f5dc', bisque: '#ffe4c4', black: '#000000', blanchedalmond: '#ffebcd', blue: '#0000ff', blueviolet: '#8a2be2', brown: '#a52a2a', burlywood: '#deb887', cadetblue: '#5f9ea0', chartreuse: '#7fff00', chocolate: '#d2691e', coral: '#ff7f50', cornflowerblue: '#6495ed', cornsilk: '#fff8dc', crimson: '#dc143c', cyan: '#00ffff', darkblue: '#00008b', darkcyan: '#008b8b', darkgoldenrod: '#b8860b', darkgray: '#a9a9a9', darkgrey: '#a9a9a9', darkgreen: '#006400', darkkhaki: '#bdb76b', darkmagenta: '#8b008b', darkolivegreen: '#556b2f', darkorange: '#ff8c00', darkorchid: '#9932cc', darkred: '#8b0000', darksalmon: '#e9967a', darkseagreen: '#8fbc8f', darkslateblue: '#483d8b', darkslategray: '#2f4f4f', darkslategrey: '#2f4f4f', darkturquoise: '#00ced1', darkviolet: '#9400d3', deeppink: '#ff1493', deepskyblue: '#00bfff', dimgray: '#696969', dimgrey: '#696969', dodgerblue: '#1e90ff', firebrick: '#b22222', floralwhite: '#fffaf0', forestgreen: '#228b22', fuchsia: '#ff00ff', gainsboro: '#dcdcdc', ghostwhite: '#f8f8ff', gold: '#ffd700', goldenrod: '#daa520', gray: '#808080', grey: '#808080', green: '#008000', greenyellow: '#adff2f', honeydew: '#f0fff0', hotpink: '#ff69b4', indianred: '#cd5c5c', indigo: '#4b0082', ivory: '#fffff0', khaki: '#f0e68c', lavender: '#e6e6fa', lavenderblush: '#fff0f5', lawngreen: '#7cfc00', lemonchiffon: '#fffacd', lightblue: '#add8e6', lightcoral: '#f08080', lightcyan: '#e0ffff', lightgoldenrodyellow: '#fafad2', lightgray: '#d3d3d3', lightgrey: '#d3d3d3', lightgreen: '#90ee90', lightpink: '#ffb6c1', lightsalmon: '#ffa07a', lightseagreen: '#20b2aa', lightskyblue: '#87cefa', lightslategray: '#778899', lightslategrey: '#778899', lightsteelblue: '#b0c4de', lightyellow: '#ffffe0', lime: '#00ff00', limegreen: '#32cd32', linen: '#faf0e6', magenta: '#ff00ff', maroon: '#800000', mediumaquamarine: '#66cdaa', mediumblue: '#0000cd', mediumorchid: '#ba55d3', mediumpurple: '#9370d8', mediumseagreen: '#3cb371', mediumslateblue: '#7b68ee', mediumspringgreen: '#00fa9a', mediumturquoise: '#48d1cc', mediumvioletred: '#c71585', midnightblue: '#191970', mintcream: '#f5fffa', mistyrose: '#ffe4e1', moccasin: '#ffe4b5', navajowhite: '#ffdead', navy: '#000080', oldlace: '#fdf5e6', olive: '#808000', olivedrab: '#6b8e23', orange: '#ffa500', orangered: '#ff4500', orchid: '#da70d6', palegoldenrod: '#eee8aa', palegreen: '#98fb98', paleturquoise: '#afeeee', palevioletred: '#d87093', papayawhip: '#ffefd5', peachpuff: '#ffdab9', peru: '#cd853f', pink: '#ffc0cb', plum: '#dda0dd', powderblue: '#b0e0e6', purple: '#800080', red: '#ff0000', rosybrown: '#bc8f8f', royalblue: '#4169e1', saddlebrown: '#8b4513', salmon: '#fa8072', sandybrown: '#f4a460', seagreen: '#2e8b57', seashell: '#fff5ee', sienna: '#a0522d', silver: '#c0c0c0', skyblue: '#87ceeb', slateblue: '#6a5acd', slategray: '#708090', slategrey: '#708090', snow: '#fffafa', springgreen: '#00ff7f', steelblue: '#4682b4', tan: '#d2b48c', teal: '#008080', thistle: '#d8bfd8', tomato: '#ff6347', turquoise: '#40e0d0', violet: '#ee82ee', wheat: '#f5deb3', white: '#ffffff', whitesmoke: '#f5f5f5', yellow: '#ffff00', yellowgreen: '#9acd32',
};
}(n('./tree'))), (function (e) {
e.Alpha = function (e) { this.value = e; }, e.Alpha.prototype = {
type: 'Alpha', accept(e) { this.value = e.visit(this.value); }, eval(e) { return this.value.eval && (this.value = this.value.eval(e)), this; }, toCSS() { return `alpha(opacity=${this.value.toCSS ? this.value.toCSS() : this.value})`; },
};
}(n('../tree'))), (function (e) {
e.Anonymous = function (e) { this.value = e.value || e; }, e.Anonymous.prototype = {
type: 'Anonymous', toCSS() { return this.value; }, eval() { return this; }, compare(e) { if (!e.toCSS) return -1; const t = this.toCSS(); const n = e.toCSS(); return t === n ? 0 : t < n ? -1 : 1; },
};
}(n('../tree'))), (function (e) {
e.Assignment = function (e, t) { this.key = e, this.value = t; }, e.Assignment.prototype = {
type: 'Assignment', accept(e) { this.value = e.visit(this.value); }, toCSS() { return `${this.key}=${this.value.toCSS ? this.value.toCSS() : this.value}`; }, eval(t) { return this.value.eval ? new e.Assignment(this.key, this.value.eval(t)) : this; },
};
}(n('../tree'))), (function (e) {
e.Call = function (e, t, n, r) { this.name = e, this.args = t, this.index = n, this.currentFileInfo = r; }, e.Call.prototype = {
type: 'Call',
accept(e) { this.args = e.visit(this.args); },
eval(t) {
const n = this.args.map((e) => e.eval(t)); const r = this.name.toLowerCase(); let i; let s; if (r in e.functions) {
try { s = new e.functionCall(t, this.currentFileInfo), i = s[r].apply(s, n); if (i != null) return i; } catch (o) {
throw {
type: o.type || 'Runtime', message: `error evaluating function \`${this.name}\`${o.message ? `: ${o.message}` : ''}`, index: this.index, filename: this.currentFileInfo.filename,
};
}
} return new e.Anonymous(`${this.name}(${n.map((e) => e.toCSS(t)).join(', ')})`);
},
toCSS(e) { return this.eval(e).toCSS(); },
};
}(n('../tree'))), (function (e) {
e.Color = function (e, t) { Array.isArray(e) ? this.rgb = e : e.length == 6 ? this.rgb = e.match(/.{2}/g).map((e) => parseInt(e, 16)) : this.rgb = e.split('').map((e) => parseInt(e + e, 16)), this.alpha = typeof t === 'number' ? t : 1; }, e.Color.prototype = {
type: 'Color',
eval() { return this; },
luma() { return 0.2126 * this.rgb[0] / 255 + 0.7152 * this.rgb[1] / 255 + 0.0722 * this.rgb[2] / 255; },
toCSS(e, t) { const n = e && e.compress && !t; if (this.alpha < 1) return `rgba(${this.rgb.map((e) => Math.round(e)).concat(this.alpha).join(`,${n ? '' : ' '}`)})`; let r = this.rgb.map((e) => (e = Math.round(e), e = (e > 255 ? 255 : e < 0 ? 0 : e).toString(16), e.length === 1 ? `0${e}` : e)).join(''); return n && (r = r.split(''), r[0] == r[1] && r[2] == r[3] && r[4] == r[5] ? r = r[0] + r[2] + r[4] : r = r.join('')), `#${r}`; },
operate(t, n, r) { const i = []; r instanceof e.Color || (r = r.toColor()); for (let s = 0; s < 3; s++)i[s] = e.operate(t, n, this.rgb[s], r.rgb[s]); return new e.Color(i, this.alpha + r.alpha); },
toHSL() {
const e = this.rgb[0] / 255; const t = this.rgb[1] / 255; const n = this.rgb[2] / 255; const r = this.alpha; const i = Math.max(e, t, n); const s = Math.min(e, t, n); let o; let u; const a = (i + s) / 2; const f = i - s; if (i === s)o = u = 0; else { u = a > 0.5 ? f / (2 - i - s) : f / (i + s); switch (i) { case e: o = (t - n) / f + (t < n ? 6 : 0); break; case t: o = (n - e) / f + 2; break; case n: o = (e - t) / f + 4; }o /= 6; } return {
h: o * 360, s: u, l: a, a: r,
};
},
toHSV() {
const e = this.rgb[0] / 255; const t = this.rgb[1] / 255; const n = this.rgb[2] / 255; const r = this.alpha; const i = Math.max(e, t, n); const s = Math.min(e, t, n); let o; let u; const a = i; const f = i - s; i === 0 ? u = 0 : u = f / i; if (i === s)o = 0; else { switch (i) { case e: o = (t - n) / f + (t < n ? 6 : 0); break; case t: o = (n - e) / f + 2; break; case n: o = (e - t) / f + 4; }o /= 6; } return {
h: o * 360, s: u, v: a, a: r,
};
},
toARGB() { const e = [Math.round(this.alpha * 255)].concat(this.rgb); return `#${e.map((e) => (e = Math.round(e), e = (e > 255 ? 255 : e < 0 ? 0 : e).toString(16), e.length === 1 ? `0${e}` : e)).join('')}`; },
compare(e) { return e.rgb ? e.rgb[0] === this.rgb[0] && e.rgb[1] === this.rgb[1] && e.rgb[2] === this.rgb[2] && e.alpha === this.alpha ? 0 : -1 : -1; },
};
}(n('../tree'))), (function (e) { e.Comment = function (e, t) { this.value = e, this.silent = !!t; }, e.Comment.prototype = { type: 'Comment', toCSS(e) { return e.compress ? '' : this.value; }, eval() { return this; } }; }(n('../tree'))), (function (e) { e.Condition = function (e, t, n, r, i) { this.op = e.trim(), this.lvalue = t, this.rvalue = n, this.index = r, this.negate = i; }, e.Condition.prototype = { type: 'Condition', accept(e) { this.lvalue = e.visit(this.lvalue), this.rvalue = e.visit(this.rvalue); }, eval(e) { const t = this.lvalue.eval(e); const n = this.rvalue.eval(e); const r = this.index; var i; var i = (function (e) { switch (e) { case 'and': return t && n; case 'or': return t || n; default: if (t.compare)i = t.compare(n); else { if (!n.compare) throw { type: 'Type', message: 'Unable to perform comparison', index: r }; i = n.compare(t); } switch (i) { case -1: return e === '<' || e === '=<'; case 0: return e === '=' || e === '>=' || e === '=<'; case 1: return e === '>' || e === '>='; } } }(this.op)); return this.negate ? !i : i; } }; }(n('../tree'))), (function (e) {
e.Dimension = function (n, r) { this.value = parseFloat(n), this.unit = r && r instanceof e.Unit ? r : new e.Unit(r ? [r] : t); }, e.Dimension.prototype = {
type: 'Dimension', accept(e) { this.unit = e.visit(this.unit); }, eval(e) { return this; }, toColor() { return new e.Color([this.value, this.value, this.value]); }, toCSS(e) { if (e && e.strictUnits && !this.unit.isSingular()) throw new Error(`Multiple units in dimension. Correct the units or use the unit function. Bad unit: ${this.unit.toString()}`); const t = this.value; let n = String(t); t !== 0 && t < 1e-6 && t > -0.000001 && (n = t.toFixed(20).replace(/0+$/, '')); if (e && e.compress) { if (t === 0 && !this.unit.isAngle()) return n; t > 0 && t < 1 && (n = n.substr(1)); } return n + this.unit.toCSS(e); }, operate(t, n, r) { let i = e.operate(t, n, this.value, r.value); const s = this.unit.clone(); if (n === '+' || n === '-') { if (s.numerator.length === 0 && s.denominator.length === 0)s.numerator = r.unit.numerator.slice(0), s.denominator = r.unit.denominator.slice(0); else if (r.unit.numerator.length != 0 || s.denominator.length != 0) { r = r.convertTo(this.unit.usedUnits()); if (t.strictUnits && r.unit.toString() !== s.toString()) throw new Error(`Incompatible units. Change the units or use the unit function. Bad units: '${s.toString()}' and '${r.unit.toString()}'.`); i = e.operate(t, n, this.value, r.value); } } else n === '*' ? (s.numerator = s.numerator.concat(r.unit.numerator).sort(), s.denominator = s.denominator.concat(r.unit.denominator).sort(), s.cancel()) : n === '/' && (s.numerator = s.numerator.concat(r.unit.denominator).sort(), s.denominator = s.denominator.concat(r.unit.numerator).sort(), s.cancel()); return new e.Dimension(i, s); }, compare(t) { if (t instanceof e.Dimension) { const n = this.unify(); const r = t.unify(); const i = n.value; const s = r.value; return s > i ? -1 : s < i ? 1 : !r.unit.isEmpty() && n.unit.compare(r.unit) !== 0 ? -1 : 0; } return -1; }, unify() { return this.convertTo({ length: 'm', duration: 's', angle: 'rad' }); }, convertTo(t) { let n = this.value; const r = this.unit.clone(); let i; let s; let o; let u; let a; let f = {}; if (typeof t === 'string') { for (i in e.UnitConversions)e.UnitConversions[i].hasOwnProperty(t) && (f = {}, f[i] = t); t = f; } for (s in t)t.hasOwnProperty(s) && (a = t[s], o = e.UnitConversions[s], r.map((e, t) => (o.hasOwnProperty(e) ? (t ? n /= o[e] / o[a] : n *= o[e] / o[a], a) : e))); return r.cancel(), new e.Dimension(n, r); },
}, e.UnitConversions = {
length: {
m: 1, cm: 0.01, mm: 0.001, in: 0.0254, pt: 0.0254 / 72, pc: 0.0254 / 72 * 12,
},
duration: { s: 1, ms: 0.001 },
angle: {
rad: 1 / (2 * Math.PI), deg: 1 / 360, grad: 0.0025, turn: 1,
},
}, e.Unit = function (e, t, n) { this.numerator = e ? e.slice(0).sort() : [], this.denominator = t ? t.slice(0).sort() : [], this.backupUnit = n; }, e.Unit.prototype = {
type: 'Unit', clone() { return new e.Unit(this.numerator.slice(0), this.denominator.slice(0), this.backupUnit); }, toCSS(e) { return this.numerator.length >= 1 ? this.numerator[0] : this.denominator.length >= 1 ? this.denominator[0] : (!e || !e.strictUnits) && this.backupUnit ? this.backupUnit : ''; }, toString() { let e; let t = this.numerator.join('*'); for (e = 0; e < this.denominator.length; e++)t += `/${this.denominator[e]}`; return t; }, compare(e) { return this.is(e.toString()) ? 0 : -1; }, is(e) { return this.toString() === e; }, isAngle() { return e.UnitConversions.angle.hasOwnProperty(this.toCSS()); }, isEmpty() { return this.numerator.length == 0 && this.denominator.length == 0; }, isSingular() { return this.numerator.length <= 1 && this.denominator.length == 0; }, map(e) { let t; for (t = 0; t < this.numerator.length; t++) this.numerator[t] = e(this.numerator[t], !1); for (t = 0; t < this.denominator.length; t++) this.denominator[t] = e(this.denominator[t], !0); }, usedUnits() { let t; let n; const r = {}; for (n in e.UnitConversions)e.UnitConversions.hasOwnProperty(n) && (t = e.UnitConversions[n], this.map((e) => (t.hasOwnProperty(e) && !r[n] && (r[n] = e), e))); return r; }, cancel() { const e = {}; let t; let n; let r; for (n = 0; n < this.numerator.length; n++)t = this.numerator[n], r || (r = t), e[t] = (e[t] || 0) + 1; for (n = 0; n < this.denominator.length; n++)t = this.denominator[n], r || (r = t), e[t] = (e[t] || 0) - 1; this.numerator = [], this.denominator = []; for (t in e) if (e.hasOwnProperty(t)) { const i = e[t]; if (i > 0) for (n = 0; n < i; n++) this.numerator.push(t); else if (i < 0) for (n = 0; n < -i; n++) this.denominator.push(t); } this.numerator.length === 0 && this.denominator.length === 0 && r && (this.backupUnit = r), this.numerator.sort(), this.denominator.sort(); },
};
}(n('../tree'))), (function (e) {
e.Directive = function (t, n) { this.name = t, Array.isArray(n) ? (this.ruleset = new e.Ruleset([], n), this.ruleset.allowImports = !0) : this.value = n; }, e.Directive.prototype = {
type: 'Directive', accept(e) { this.ruleset = e.visit(this.ruleset), this.value = e.visit(this.value); }, toCSS(e) { return this.ruleset ? (this.ruleset.root = !0, this.name + (e.compress ? '{' : ' {\n ') + this.ruleset.toCSS(e).trim().replace(/\n/g, '\n ') + (e.compress ? '}' : '\n}\n')) : `${this.name} ${this.value.toCSS()};\n`; }, eval(t) { let n = this; return this.ruleset && (t.frames.unshift(this), n = new e.Directive(this.name), n.ruleset = this.ruleset.eval(t), t.frames.shift()), n; }, variable(t) { return e.Ruleset.prototype.variable.call(this.ruleset, t); }, find() { return e.Ruleset.prototype.find.apply(this.ruleset, arguments); }, rulesets() { return e.Ruleset.prototype.rulesets.apply(this.ruleset); },
};
}(n('../tree'))), (function (e) {
e.Element = function (t, n, r) { this.combinator = t instanceof e.Combinator ? t : new e.Combinator(t), typeof n === 'string' ? this.value = n.trim() : n ? this.value = n : this.value = '', this.index = r; }, e.Element.prototype = {
type: 'Element', accept(e) { this.combinator = e.visit(this.combinator), this.value = e.visit(this.value); }, eval(t) { return new e.Element(this.combinator, this.value.eval ? this.value.eval(t) : this.value, this.index); }, toCSS(e) { const t = this.value.toCSS ? this.value.toCSS(e) : this.value; return t == '' && this.combinator.value.charAt(0) == '&' ? '' : this.combinator.toCSS(e || {}) + t; },
}, e.Attribute = function (e, t, n) { this.key = e, this.op = t, this.value = n; }, e.Attribute.prototype = {
type: 'Attribute', accept(e) { this.value = e.visit(this.value); }, eval(t) { return new e.Attribute(this.key.eval ? this.key.eval(t) : this.key, this.op, this.value && this.value.eval ? this.value.eval(t) : this.value); }, toCSS(e) { let t = this.key.toCSS ? this.key.toCSS(e) : this.key; return this.op && (t += this.op, t += this.value.toCSS ? this.value.toCSS(e) : this.value), `[${t}]`; },
}, e.Combinator = function (e) { e === ' ' ? this.value = ' ' : this.value = e ? e.trim() : ''; }, e.Combinator.prototype = {
type: 'Combinator',
toCSS(e) {
return {
'': '', ' ': ' ', ':': ' :', '+': e.compress ? '+' : ' + ', '~': e.compress ? '~' : ' ~ ', '>': e.compress ? '>' : ' > ', '|': e.compress ? '|' : ' | ',
}[this.value];
},
};
}(n('../tree'))), (function (e) {
e.Expression = function (e) { this.value = e; }, e.Expression.prototype = {
type: 'Expression', accept(e) { this.value = e.visit(this.value); }, eval(t) { let n; const r = this.parens && !this.parensInOp; let i = !1; return r && t.inParenthesis(), this.value.length > 1 ? n = new e.Expression(this.value.map((e) => e.eval(t))) : this.value.length === 1 ? (this.value[0].parens && !this.value[0].parensInOp && (i = !0), n = this.value[0].eval(t)) : n = this, r && t.outOfParenthesis(), this.parens && this.parensInOp && !t.isMathOn() && !i && (n = new e.Paren(n)), n; }, toCSS(e) { return this.value.map((t) => (t.toCSS ? t.toCSS(e) : '')).join(' '); }, throwAwayComments() { this.value = this.value.filter((t) => !(t instanceof e.Comment)); },
};
}(n('../tree'))), (function (e) {
e.Extend = function (t, n, r) { this.selector = t, this.option = n, this.index = r; switch (n) { case 'all': this.allowBefore = !0, this.allowAfter = !0; break; default: this.allowBefore = !1, this.allowAfter = !1; } }, e.Extend.prototype = {
type: 'Extend', accept(e) { this.selector = e.visit(this.selector); }, eval(t) { return new e.Extend(this.selector.eval(t), this.option, this.index); }, clone(t) { return new e.Extend(this.selector, this.option, this.index); }, findSelfSelectors(e) { let t = []; let n; for (n = 0; n < e.length; n++)t = t.concat(e[n].elements); this.selfSelectors = [{ elements: t }]; },
};
}(n('../tree'))), (function (e) {
e.Import = function (e, n, r, i, s) { const o = this; this.options = r, this.index = i, this.path = e, this.features = n, this.currentFileInfo = s; if (this.options.less !== t) this.css = !this.options.less; else { const u = this.getPath(); u && /css([\?;].*)?$/.test(u) && (this.css = !0); } }, e.Import.prototype = {
type: 'Import', accept(e) { this.features = e.visit(this.features), this.path = e.visit(this.path), this.root = e.visit(this.root); }, toCSS(e) { const t = this.features ? ` ${this.features.toCSS(e)}` : ''; return this.css ? `@import ${this.path.toCSS()}${t};\n` : ''; }, getPath() { if (this.path instanceof e.Quoted) { const n = this.path.value; return this.css !== t || /(\.[a-z]*$)|([\?;].*)$/.test(n) ? n : `${n}.less`; } return this.path instanceof e.URL ? this.path.value.value : null; }, evalForImport(t) { return new e.Import(this.path.eval(t), this.features, this.options, this.index, this.currentFileInfo); }, evalPath(t) { const n = this.path.eval(t); const r = this.currentFileInfo && this.currentFileInfo.rootpath; if (r && !(n instanceof e.URL)) { const i = n.value; i && t.isPathRelative(i) && (n.value = r + i); } return n; }, eval(t) { let n; const r = this.features && this.features.eval(t); if (this.skip) return []; if (this.css) { const i = new e.Import(this.evalPath(t), r, this.options, this.index); if (!i.css && this.error) throw this.error; return i; } return n = new e.Ruleset([], this.root.rules.slice(0)), n.evalImports(t), this.features ? new e.Media(n.rules, this.features.value) : n.rules; },
};
}(n('../tree'))), (function (e) { e.JavaScript = function (e, t, n) { this.escaped = n, this.expression = e, this.index = t; }, e.JavaScript.prototype = { type: 'JavaScript', eval(t) { let n; const r = this; const i = {}; let s = this.expression.replace(/@\{([\w-]+)\}/g, (n, i) => e.jsify((new e.Variable(`@${i}`, r.index)).eval(t))); try { s = new Function(`return (${s})`); } catch (o) { throw { message: `JavaScript evaluation error: \`${s}\``, index: this.index }; } for (const u in t.frames[0].variables())i[u.slice(1)] = { value: t.frames[0].variables()[u].value, toJS() { return this.value.eval(t).toCSS(); } }; try { n = s.call(i); } catch (o) { throw { message: `JavaScript evaluation error: '${o.name}: ${o.message}'`, index: this.index }; } return typeof n === 'string' ? new e.Quoted(`"${n}"`, n, this.escaped, this.index) : Array.isArray(n) ? new e.Anonymous(n.join(', ')) : new e.Anonymous(n); } }; }(n('../tree'))), (function (e) {
e.Keyword = function (e) { this.value = e; }, e.Keyword.prototype = {
type: 'Keyword', eval() { return this; }, toCSS() { return this.value; }, compare(t) { return t instanceof e.Keyword ? t.value === this.value ? 0 : 1 : -1; },
}, e.True = new e.Keyword('true'), e.False = new e.Keyword('false');
}(n('../tree'))), (function (e) {
e.Media = function (t, n) { const r = this.emptySelectors(); this.features = new e.Value(n), this.ruleset = new e.Ruleset(r, t), this.ruleset.allowImports = !0; }, e.Media.prototype = {
type: 'Media', accept(e) { this.features = e.visit(this.features), this.ruleset = e.visit(this.ruleset); }, toCSS(e) { const t = this.features.toCSS(e); return `@media ${t}${e.compress ? '{' : ' {\n '}${this.ruleset.toCSS(e).trim().replace(/\n/g, '\n ')}${e.compress ? '}' : '\n}\n'}`; }, eval(t) { t.mediaBlocks || (t.mediaBlocks = [], t.mediaPath = []); const n = new e.Media([], []); this.debugInfo && (this.ruleset.debugInfo = this.debugInfo, n.debugInfo = this.debugInfo); let r = !1; t.strictMath || (r = !0, t.strictMath = !0); try { n.features = this.features.eval(t); } finally { r && (t.strictMath = !1); } return t.mediaPath.push(n), t.mediaBlocks.push(n), t.frames.unshift(this.ruleset), n.ruleset = this.ruleset.eval(t), t.frames.shift(), t.mediaPath.pop(), t.mediaPath.length === 0 ? n.evalTop(t) : n.evalNested(t); }, variable(t) { return e.Ruleset.prototype.variable.call(this.ruleset, t); }, find() { return e.Ruleset.prototype.find.apply(this.ruleset, arguments); }, rulesets() { return e.Ruleset.prototype.rulesets.apply(this.ruleset); }, emptySelectors() { const t = new e.Element('', '&', 0); return [new e.Selector([t])]; }, evalTop(t) { let n = this; if (t.mediaBlocks.length > 1) { const r = this.emptySelectors(); n = new e.Ruleset(r, t.mediaBlocks), n.multiMedia = !0; } return delete t.mediaBlocks, delete t.mediaPath, n; }, evalNested(t) { let n; let r; const i = t.mediaPath.concat([this]); for (n = 0; n < i.length; n++)r = i[n].features instanceof e.Value ? i[n].features.value : i[n].features, i[n] = Array.isArray(r) ? r : [r]; return this.features = new e.Value(this.permute(i).map((t) => { t = t.map((t) => (t.toCSS ? t : new e.Anonymous(t))); for (n = t.length - 1; n > 0; n--)t.splice(n, 0, new e.Anonymous('and')); return new e.Expression(t); })), new e.Ruleset([], []); }, permute(e) { if (e.length === 0) return []; if (e.length === 1) return e[0]; const t = []; const n = this.permute(e.slice(1)); for (let r = 0; r < n.length; r++) for (let i = 0; i < e[0].length; i++)t.push([e[0][i]].concat(n[r])); return t; }, bubbleSelectors(t) { this.ruleset = new e.Ruleset(t.slice(0), [this.ruleset]); },
};
}(n('../tree'))), (function (e) {
e.mixin = {}, e.mixin.Call = function (t, n, r, i, s) { this.selector = new e.Selector(t), this.arguments = n, this.index = r, this.currentFileInfo = i, this.important = s; }, e.mixin.Call.prototype = {
type: 'MixinCall',
accept(e) { this.selector = e.visit(this.selector), this.arguments = e.visit(this.arguments); },
eval(t) {
let n; let r; let i; const s = []; let o = !1; let u; let a; let f; let l; let c; i = this.arguments && this.arguments.map((e) => ({ name: e.name, value: e.value.eval(t) })); for (u = 0; u < t.frames.length; u++) {
if ((n = t.frames[u].find(this.selector)).length > 0) {
c = !0; for (a = 0; a < n.length; a++) {
r = n[a], l = !1; for (f = 0; f < t.frames.length; f++) if (!(r instanceof e.mixin.Definition) && r === (t.frames[f].originalRuleset || t.frames[f])) { l = !0; break; } if (l) continue; if (r.matchArgs(i, t)) {
if (!r.matchCondition || r.matchCondition(i, t)) {
try { Array.prototype.push.apply(s, r.eval(t, i, this.important).rules); } catch (h) {
throw {
message: h.message, index: this.index, filename: this.currentFileInfo.filename, stack: h.stack,
};
}
}o = !0;
}
} if (o) return s;
}
} throw c ? {
type: 'Runtime', message: `No matching definition was found for \`${this.selector.toCSS().trim()}(${i ? i.map((e) => { let t = ''; return e.name && (t += `${e.name}:`), e.value.toCSS ? t += e.value.toCSS() : t += '???', t; }).join(', ') : ''})\``, index: this.index, filename: this.currentFileInfo.filename,
} : {
type: 'Name', message: `${this.selector.toCSS().trim()} is undefined`, index: this.index, filename: this.currentFileInfo.filename,
};
},
}, e.mixin.Definition = function (t, n, r, i, s) { this.name = t, this.selectors = [new e.Selector([new e.Element(null, t)])], this.params = n, this.condition = i, this.variadic = s, this.arity = n.length, this.rules = r, this._lookups = {}, this.required = n.reduce((e, t) => (!t.name || t.name && !t.value ? e + 1 : e), 0), this.parent = e.Ruleset.prototype, this.frames = []; }, e.mixin.Definition.prototype = {
type: 'MixinDefinition', accept(e) { this.params = e.visit(this.params), this.rules = e.visit(this.rules), this.condition = e.visit(this.condition); }, toCSS() { return ''; }, variable(e) { return this.parent.variable.call(this, e); }, variables() { return this.parent.variables.call(this); }, find() { return this.parent.find.apply(this, arguments); }, rulesets() { return this.parent.rulesets.apply(this); }, evalParams(t, n, r, i) { const s = new e.Ruleset(null, []); let o; let u; const a = this.params.slice(0); let f; let l; let c; let h; let p; let d; n = new e.evalEnv(n, [s].concat(n.frames)); if (r) { r = r.slice(0); for (f = 0; f < r.length; f++) { u = r[f]; if (h = u && u.name) { p = !1; for (l = 0; l < a.length; l++) if (!i[l] && h === a[l].name) { i[l] = u.value.eval(t), s.rules.unshift(new e.Rule(h, u.value.eval(t))), p = !0; break; } if (p) { r.splice(f, 1), f--; continue; } throw { type: 'Runtime', message: `Named argument for ${this.name} ${r[f].name} not found` }; } } }d = 0; for (f = 0; f < a.length; f++) { if (i[f]) continue; u = r && r[d]; if (h = a[f].name) if (a[f].variadic && r) { o = []; for (l = d; l < r.length; l++)o.push(r[l].value.eval(t)); s.rules.unshift(new e.Rule(h, (new e.Expression(o)).eval(t))); } else { c = u && u.value; if (c)c = c.eval(t); else { if (!a[f].value) throw { type: 'Runtime', message: `wrong number of arguments for ${this.name} (${r.length} for ${this.arity})` }; c = a[f].value.eval(n), s.resetCache(); }s.rules.unshift(new e.Rule(h, c)), i[f] = c; } if (a[f].variadic && r) for (l = d; l < r.length; l++)i[l] = r[l].value.eval(t); d++; } return s; }, eval(t, n, r) { const i = []; const s = this.frames.concat(t.frames); const o = this.evalParams(t, new e.evalEnv(t, s), n, i); let u; let a; let f; let l; return o.rules.unshift(new e.Rule('@arguments', (new e.Expression(i)).eval(t))), a = r ? this.parent.makeImportant.apply(this).rules : this.rules.slice(0), l = (new e.Ruleset(null, a)).eval(new e.evalEnv(t, [this, o].concat(s))), l.originalRuleset = this, l; }, matchCondition(t, n) { return this.condition && !this.condition.eval(new e.evalEnv(n, [this.evalParams(n, new e.evalEnv(n, this.frames.concat(n.frames)), t, [])].concat(n.frames))) ? !1 : !0; }, matchArgs(e, t) { const n = e && e.length || 0; let r; let i; if (!this.variadic) { if (n < this.required) return !1; if (n > this.params.length) return !1; if (this.required > 0 && n > this.params.length) return !1; }r = Math.min(n, this.arity); for (let s = 0; s < r; s++) if (!this.params[s].name && !this.params[s].variadic && e[s].value.eval(t).toCSS() != this.params[s].value.eval(t).toCSS()) return !1; return !0; },
};
}(n('../tree'))), (function (e) {
e.Negative = function (e) { this.value = e; }, e.Negative.prototype = {
type: 'Negative', accept(e) { this.value = e.visit(this.value); }, toCSS(e) { return `-${this.value.toCSS(e)}`; }, eval(t) { return t.isMathOn() ? (new e.Operation('*', [new e.Dimension(-1), this.value])).eval(t) : new e.Negative(this.value.eval(t)); },
};
}(n('../tree'))), (function (e) {
e.Operation = function (e, t, n) { this.op = e.trim(), this.operands = t, this.isSpaced = n; }, e.Operation.prototype = {
type: 'Operation', accept(e) { this.operands = e.visit(this.operands); }, eval(t) { let n = this.operands[0].eval(t); let r = this.operands[1].eval(t); let i; if (t.isMathOn()) { if (n instanceof e.Dimension && r instanceof e.Color) { if (this.op !== '*' && this.op !== '+') throw { type: 'Operation', message: "Can't substract or divide a color from a number" }; i = r, r = n, n = i; } if (!n.operate) throw { type: 'Operation', message: 'Operation on an invalid type' }; return n.operate(t, this.op, r); } return new e.Operation(this.op, [n, r], this.isSpaced); }, toCSS(e) { const t = this.isSpaced ? ' ' : ''; return this.operands[0].toCSS() + t + this.op + t + this.operands[1].toCSS(); },
}, e.operate = function (e, t, n, r) { switch (t) { case '+': return n + r; case '-': return n - r; case '*': return n * r; case '/': return n / r; } };
}(n('../tree'))), (function (e) {
e.Paren = function (e) { this.value = e; }, e.Paren.prototype = {
type: 'Paren', accept(e) { this.value = e.visit(this.value); }, toCSS(e) { return `(${this.value.toCSS(e).trim()})`; }, eval(t) { return new e.Paren(this.value.eval(t)); },
};
}(n('../tree'))), (function (e) {
e.Quoted = function (e, t, n, r, i) { this.escaped = n, this.value = t || '', this.quote = e.charAt(0), this.index = r, this.currentFileInfo = i; }, e.Quoted.prototype = {
type: 'Quoted', toCSS() { return this.escaped ? this.value : this.quote + this.value + this.quote; }, eval(t) { const n = this; const r = this.value.replace(/`([^`]+)`/g, (r, i) => (new e.JavaScript(i, n.index, !0)).eval(t).value).replace(/@\{([\w-]+)\}/g, (r, i) => { const s = (new e.Variable(`@${i}`, n.index, n.currentFileInfo)).eval(t, !0); return s instanceof e.Quoted ? s.value : s.toCSS(); }); return new e.Quoted(this.quote + r + this.quote, r, this.escaped, this.index); }, compare(e) { if (!e.toCSS) return -1; const t = this.toCSS(); const n = e.toCSS(); return t === n ? 0 : t < n ? -1 : 1; },
};
}(n('../tree'))), (function (e) {
e.Rule = function (t, n, r, i, s, o) { this.name = t, this.value = n instanceof e.Value ? n : new e.Value([n]), this.important = r ? ` ${r.trim()}` : '', this.index = i, this.currentFileInfo = s, this.inline = o || !1, t.charAt(0) === '@' ? this.variable = !0 : this.variable = !1; }, e.Rule.prototype = {
type: 'Rule', accept(e) { this.value = e.visit(this.value); }, toCSS(e) { if (this.variable) return ''; try { return this.name + (e.compress ? ':' : ': ') + this.value.toCSS(e) + this.important + (this.inline ? '' : ';'); } catch (t) { throw t.index = this.index, t.filename = this.currentFileInfo.filename, t; } }, eval(t) { let n = !1; this.name === 'font' && !t.strictMath && (n = !0, t.strictMath = !0); try { return new e.Rule(this.name, this.value.eval(t), this.important, this.index, this.currentFileInfo, this.inline); } finally { n && (t.strictMath = !1); } }, makeImportant() { return new e.Rule(this.name, this.value, '!important', this.index, this.currentFileInfo, this.inline); },
};
}(n('../tree'))), (function (e) {
e.Ruleset = function (e, t, n) { this.selectors = e, this.rules = t, this._lookups = {}, this.strictImports = n; }, e.Ruleset.prototype = {
type: 'Ruleset', accept(e) { this.selectors = e.visit(this.selectors), this.rules = e.visit(this.rules); }, eval(t) { const n = this.selectors && this.selectors.map((e) => e.eval(t)); const r = new e.Ruleset(n, this.rules.slice(0), this.strictImports); let i; r.originalRuleset = this, r.root = this.root, r.firstRoot = this.firstRoot, r.allowImports = this.allowImports, this.debugInfo && (r.debugInfo = this.debugInfo), t.frames.unshift(r), t.selectors || (t.selectors = []), t.selectors.unshift(this.selectors), (r.root || r.allowImports || !r.strictImports) && r.evalImports(t); for (var s = 0; s < r.rules.length; s++)r.rules[s] instanceof e.mixin.Definition && (r.rules[s].frames = t.frames.slice(0)); const o = t.mediaBlocks && t.mediaBlocks.length || 0; for (var s = 0; s < r.rules.length; s++)r.rules[s] instanceof e.mixin.Call && (i = r.rules[s].eval(t).filter((t) => (t instanceof e.Rule && t.variable ? !r.variable(t.name) : !0)), r.rules.splice.apply(r.rules, [s, 1].concat(i)), s += i.length - 1, r.resetCache()); for (var s = 0, u; s < r.rules.length; s++)u = r.rules[s], u instanceof e.mixin.Definition || (r.rules[s] = u.eval ? u.eval(t) : u); t.frames.shift(), t.selectors.shift(); if (t.mediaBlocks) for (var s = o; s < t.mediaBlocks.length; s++)t.mediaBlocks[s].bubbleSelectors(n); return r; }, evalImports(t) { let n; let r; for (n = 0; n < this.rules.length; n++) this.rules[n] instanceof e.Import && (r = this.rules[n].eval(t), typeof r.length === 'number' ? (this.rules.splice.apply(this.rules, [n, 1].concat(r)), n += r.length - 1) : this.rules.splice(n, 1, r), this.resetCache()); }, makeImportant() { return new e.Ruleset(this.selectors, this.rules.map((e) => (e.makeImportant ? e.makeImportant() : e)), this.strictImports); }, matchArgs(e) { return !e || e.length === 0; }, resetCache() { this._rulesets = null, this._variables = null, this._lookups = {}; }, variables() { return this._variables ? this._variables : this._variables = this.rules.reduce((t, n) => (n instanceof e.Rule && n.variable === !0 && (t[n.name] = n), t), {}); }, variable(e) { return this.variables()[e]; }, rulesets() { return this.rules.filter((t) => t instanceof e.Ruleset || t instanceof e.mixin.Definition); }, find(t, n) { n = n || this; const r = []; let i; let s; const o = t.toCSS(); return o in this._lookups ? this._lookups[o] : (this.rulesets().forEach((i) => { if (i !== n) for (let o = 0; o < i.selectors.length; o++) if (s = t.match(i.selectors[o])) { t.elements.length > i.selectors[o].elements.length ? Array.prototype.push.apply(r, i.find(new e.Selector(t.elements.slice(1)), n)) : r.push(i); break; } }), this._lookups[o] = r); }, toCSS(t) { const n = []; let r = []; const i = []; let s = []; let o; let u; let a; for (var f = 0; f < this.rules.length; f++) { a = this.rules[f]; if (a.rules || a instanceof e.Media)s.push(a.toCSS(t)); else if (a instanceof e.Directive) { const l = a.toCSS(t); if (a.name === '@charset') { if (t.charset) { a.debugInfo && (s.push(e.debugInfo(t, a)), s.push((new e.Comment(`/* ${l.replace(/\n/g, '')} */\n`)).toCSS(t))); continue; }t.charset = !0; }s.push(l); } else if (a instanceof e.Comment)a.silent || (this.root ? s.push(a.toCSS(t)) : r.push(a.toCSS(t))); else if (a.toCSS && !a.variable) { if (this.firstRoot && a instanceof e.Rule) throw { message: 'properties must be inside selector blocks, they cannot be in the root.', index: a.index, filename: a.currentFileInfo ? a.currentFileInfo.filename : null }; r.push(a.toCSS(t)); } else a.value && !a.variable && r.push(a.value.toString()); }t.compress && r.length && (a = r[r.length - 1], a.charAt(a.length - 1) === ';' && (r[r.length - 1] = a.substring(0, a.length - 1))), s = s.join(''); if (this.root)n.push(r.join(t.compress ? '' : '\n')); else if (r.length > 0) { u = e.debugInfo(t, this), o = this.paths.map((e) => e.map((e) => e.toCSS(t)).join('').trim()).join(t.compress ? ',' : ',\n'); for (var f = r.length - 1; f >= 0; f--)(r[f].slice(0, 2) === '/*' || i.indexOf(r[f]) === -1) && i.unshift(r[f]); r = i, n.push(u + o + (t.compress ? '{' : ' {\n ') + r.join(t.compress ?
};
}(n('../tree'))), (function (e) {
e.Selector = function (e, t) { this.elements = e, this.extendList = t || []; }, e.Selector.prototype = {
type: 'Selector', accept(e) { this.elements = e.visit(this.elements), this.extendList = e.visit(this.extendList); }, match(e) { const t = this.elements; const n = t.length; let r; let i; let s; let o; r = e.elements.slice(e.elements.length && e.elements[0].value === '&' ? 1 : 0), i = r.length, s = Math.min(n, i); if (i === 0 || n < i) return !1; for (o = 0; o < s; o++) if (t[o].value !== r[o].value) return !1; return !0; }, eval(t) { return new e.Selector(this.elements.map((e) => e.eval(t)), this.extendList.map((e) => e.eval(t))); }, toCSS(e) { return this._css ? this._css : (this.elements[0].combinator.value === '' ? this._css = ' ' : this._css = '', this._css += this.elements.map((t) => (typeof t === 'string' ? ` ${t.trim()}` : t.toCSS(e))).join(''), this._css); },
};
}(n('../tree'))), (function (e) { e.UnicodeDescriptor = function (e) { this.value = e; }, e.UnicodeDescriptor.prototype = { type: 'UnicodeDescriptor', toCSS(e) { return this.value; }, eval() { return this; } }; }(n('../tree'))), (function (e) {
e.URL = function (e, t) { this.value = e, this.currentFileInfo = t; }, e.URL.prototype = {
type: 'Url', accept(e) { this.value = e.visit(this.value); }, toCSS() { return `url(${this.value.toCSS()})`; }, eval(t) { const n = this.value.eval(t); let r; return r = this.currentFileInfo && this.currentFileInfo.rootpath, r && typeof n.value === 'string' && t.isPathRelative(n.value) && (n.quote || (r = r.replace(/[\(\)'"\s]/g, (e) => `\\${e}`)), n.value = r + n.value), new e.URL(n, null); },
};
}(n('../tree'))), (function (e) {
e.Value = function (e) { this.value = e; }, e.Value.prototype = {
type: 'Value', accept(e) { this.value = e.visit(this.value); }, eval(t) { return this.value.length === 1 ? this.value[0].eval(t) : new e.Value(this.value.map((e) => e.eval(t))); }, toCSS(e) { return this.value.map((t) => t.toCSS(e)).join(e.compress ? ',' : ', '); },
};
}(n('../tree'))), (function (e) {
e.Variable = function (e, t, n) { this.name = e, this.index = t, this.currentFileInfo = n; }, e.Variable.prototype = {
type: 'Variable',
eval(t) {
let n; let r; let i = this.name; i.indexOf('@@') == 0 && (i = `@${(new e.Variable(i.slice(1))).eval(t).value}`); if (this.evaluating) {
throw {
type: 'Name', message: `Recursive variable definition for ${i}`, filename: this.currentFileInfo.file, index: this.index,
};
} this.evaluating = !0; if (n = e.find(t.frames, (e) => { if (r = e.variable(i)) return r.value.eval(t); })) return this.evaluating = !1, n; throw {
type: 'Name', message: `variable ${i} is undefined`, filename: this.currentFileInfo.filename, index: this.index,
};
},
};
}(n('../tree'))), (function (e) { e.debugInfo = function (t, n) { let r = ''; if (t.dumpLineNumbers && !t.compress) switch (t.dumpLineNumbers) { case 'comments': r = e.debugInfo.asComment(n); break; case 'mediaquery': r = e.debugInfo.asMediaQuery(n); break; case 'all': r = e.debugInfo.asComment(n) + e.debugInfo.asMediaQuery(n); } return r; }, e.debugInfo.asComment = function (e) { return `/* line ${e.debugInfo.lineNumber}, ${e.debugInfo.fileName} */\n`; }, e.debugInfo.asMediaQuery = function (e) { return `@media -sass-debug-info{filename{font-family:${(`file://${e.debugInfo.fileName}`).replace(/([.:/\\])/g, (e) => (e == '\\' && (e = '/'), `\\${e}`))}}line{font-family:\\00003${e.debugInfo.lineNumber}}}\n`; }, e.find = function (e, t) { for (var n = 0, r; n < e.length; n++) if (r = t.call(e, e[n])) return r; return null; }, e.jsify = function (e) { return Array.isArray(e.value) && e.value.length > 1 ? `[${e.value.map((e) => e.toCSS(!1)).join(', ')}]` : e.toCSS(!1); }; }(n('./tree'))), (function (e) {
const t = ['paths', 'optimization', 'files', 'contents', 'relativeUrls', 'strictImports', 'dumpLineNumbers', 'compress', 'processImports', 'syncImport', 'mime', 'currentFileInfo']; e.parseEnv = function (e) {
r(e, this, t), this.contents || (this.contents = {}), this.files || (this.files = {}); if (!this.currentFileInfo) {
const n = e && e.filename || 'input'; const i = n.replace(/[^\/\\]*$/, ''); e && (e.filename = null), this.currentFileInfo = {
filename: n, relativeUrls: this.relativeUrls, rootpath: e && e.rootpath || '', currentDirectory: i, entryPath: i, rootFilename: n,
};
}
}, e.parseEnv.prototype.toSheet = function (t) { const n = new e.parseEnv(this); return n.href = t, n.type = this.mime, n; }; const n = ['silent', 'verbose', 'compress', 'yuicompress', 'ieCompat', 'strictMath', 'strictUnits']; e.evalEnv = function (e, t) { r(e, this, n), this.frames = t || []; }, e.evalEnv.prototype.inParenthesis = function () { this.parensStack || (this.parensStack = []), this.parensStack.push(!0); }, e.evalEnv.prototype.outOfParenthesis = function () { this.parensStack.pop(); }, e.evalEnv.prototype.isMathOn = function () { return this.strictMath ? this.parensStack && this.parensStack.length : !0; }, e.evalEnv.prototype.isPathRelative = function (e) { return !/^(?:[a-z-]+:|\/)/.test(e); }; var r = function (e, t, n) { if (!e) return; for (let r = 0; r < n.length; r++)e.hasOwnProperty(n[r]) && (t[n[r]] = e[n[r]]); };
}(n('./tree'))), (function (e) { e.visitor = function (e) { this._implementation = e; }, e.visitor.prototype = { visit(e) { if (e instanceof Array) return this.visitArray(e); if (!e || !e.type) return e; let t = `visit${e.type}`; const n = this._implementation[t]; let r; let i; return n && (r = { visitDeeper: !0 }, i = n.call(this._implementation, e, r), this._implementation.isReplacing && (e = i)), (!r || r.visitDeeper) && e && e.accept && e.accept(this), t += 'Out', this._implementation[t] && this._implementation[t](e), e; }, visitArray(e) { let t; let n = []; for (t = 0; t < e.length; t++) { const r = this.visit(e[t]); r instanceof Array ? n = n.concat(r) : n.push(r); } return this._implementation.isReplacing ? n : e; } }; }(n('./tree'))), (function (e) {
e.importVisitor = function (t, n, r) { this._visitor = new e.visitor(this), this._importer = t, this._finish = n, this.env = r || new e.evalEnv(), this.importCount = 0; }, e.importVisitor.prototype = {
isReplacing: !0, run(e) { let t; try { this._visitor.visit(e); } catch (n) { t = n; } this.isFinished = !0, this.importCount === 0 && this._finish(t); }, visitImport(t, n) { const r = this; let i; if (!t.css) { try { i = t.evalForImport(this.env); } catch (s) { s.filename || (s.index = t.index, s.filename = t.currentFileInfo.filename), t.css = !0, t.error = s; } if (i && !i.css) { t = i, this.importCount++; const o = new e.evalEnv(this.env, this.env.frames.slice(0)); this._importer.push(t.getPath(), t.currentFileInfo, (n, i, s) => { n && !n.filename && (n.index = t.index, n.filename = t.currentFileInfo.filename), s && !t.options.multiple && (t.skip = s); const u = function (e) { r.importCount--, r.importCount === 0 && r.isFinished && r._finish(e); }; i ? (t.root = i, (new e.importVisitor(r._importer, u, o)).run(i)) : u(); }); } } return n.visitDeeper = !1, t; }, visitRule(e, t) { return t.visitDeeper = !1, e; }, visitDirective(e, t) { return this.env.frames.unshift(e), e; }, visitDirectiveOut(e) { this.env.frames.shift(); }, visitMixinDefinition(e, t) { return this.env.frames.unshift(e), e; }, visitMixinDefinitionOut(e) { this.env.frames.shift(); }, visitRuleset(e, t) { return this.env.frames.unshift(e), e; }, visitRulesetOut(e) { this.env.frames.shift(); }, visitMedia(e, t) { return this.env.frames.unshift(e.ruleset), e; }, visitMediaOut(e) { this.env.frames.shift(); },
};
}(n('./tree'))), (function (e) {
e.joinSelectorVisitor = function () { this.contexts = [[]], this._visitor = new e.visitor(this); }, e.joinSelectorVisitor.prototype = {
run(e) { return this._visitor.visit(e); }, visitRule(e, t) { t.visitDeeper = !1; }, visitMixinDefinition(e, t) { t.visitDeeper = !1; }, visitRuleset(e, t) { const n = this.contexts[this.contexts.length - 1]; const r = []; this.contexts.push(r), e.root || (e.joinSelectors(r, n, e.selectors), e.paths = r); }, visitRulesetOut(e) { this.contexts.length = this.contexts.length - 1; }, visitMedia(e, t) { const n = this.contexts[this.contexts.length - 1]; e.ruleset.root = n.length === 0 || n[0].multiMedia; },
};
}(n('./tree'))), (function (e) {
e.extendFinderVisitor = function () { this._visitor = new e.visitor(this), this.contexts = [], this.allExtendsStack = [[]]; }, e.extendFinderVisitor.prototype = {
run(e) { return e = this._visitor.visit(e), e.allExtends = this.allExtendsStack[0], e; }, visitRule(e, t) { t.visitDeeper = !1; }, visitMixinDefinition(e, t) { t.visitDeeper = !1; }, visitRuleset(t, n) { if (t.root) return; let r; let i; let s; const o = []; let u; for (r = 0; r < t.rules.length; r++)t.rules[r] instanceof e.Extend && o.push(t.rules[r]); for (r = 0; r < t.paths.length; r++) { const a = t.paths[r]; const f = a[a.length - 1]; u = f.extendList.slice(0).concat(o).map((e) => e.clone()); for (i = 0; i < u.length; i++) this.foundExtends = !0, s = u[i], s.findSelfSelectors(a), s.ruleset = t, i === 0 && (s.firstExtendOnThisSelectorPath = !0), this.allExtendsStack[this.allExtendsStack.length - 1].push(s); } this.contexts.push(t.selectors); }, visitRulesetOut(e) { e.root || (this.contexts.length = this.contexts.length - 1); }, visitMedia(e, t) { e.allExtends = [], this.allExtendsStack.push(e.allExtends); }, visitMediaOut(e) { this.allExtendsStack.length = this.allExtendsStack.length - 1; }, visitDirective(e, t) { e.allExtends = [], this.allExtendsStack.push(e.allExtends); }, visitDirectiveOut(e) { this.allExtendsStack.length = this.allExtendsStack.length - 1; },
}, e.processExtendsVisitor = function () { this._visitor = new e.visitor(this); }, e.processExtendsVisitor.prototype = {
run(t) { const n = new e.extendFinderVisitor(); return n.run(t), n.foundExtends ? (t.allExtends = t.allExtends.concat(this.doExtendChaining(t.allExtends, t.allExtends)), this.allExtendsStack = [t.allExtends], this._visitor.visit(t)) : t; },
doExtendChaining(t, n, r) { let i; let s; let o; const u = []; let a; const f = this; let l; let c; let h; let p; r = r || 0; for (i = 0; i < t.length; i++) for (s = 0; s < n.length; s++) { c = t[i], h = n[s]; if (this.inInheritanceChain(h, c)) continue; l = [h.selfSelectors[0]], o = f.findMatch(c, l), o.length && c.selfSelectors.forEach((t) => { a = f.extendSelector(o, l, t), p = new e.Extend(h.selector, h.option, 0), p.selfSelectors = a, a[a.length - 1].extendList = [p], u.push(p), p.ruleset = h.ruleset, p.parents = [h, c], h.firstExtendOnThisSelectorPath && (p.firstExtendOnThisSelectorPath = !0, h.ruleset.paths.push(a)); }); } if (u.length) { this.extendChainCount++; if (r > 100) { let d = '{unable to calculate}'; let v = '{unable to calculate}'; try { d = u[0].selfSelectors[0].toCSS(), v = u[0].selector.toCSS(); } catch (m) {} throw { message: `extend circular reference detected. One of the circular extends is currently:${d}:extend(${v})` }; } return u.concat(f.doExtendChaining(u, n, r + 1)); } return u; },
inInheritanceChain(e, t) { if (e === t) return !0; if (t.parents) { if (this.inInheritanceChain(e, t.parents[0])) return !0; if (this.inInheritanceChain(e, t.parents[1])) return !0; } return !1; },
visitRule(e, t) { t.visitDeeper = !1; },
visitMixinDefinition(e, t) { t.visitDeeper = !1; },
visitSelector(e, t) { t.visitDeeper = !1; },
visitRuleset(e, t) { if (e.root) return; let n; let r; let i; const s = this.allExtendsStack[this.allExtendsStack.length - 1]; const o = []; const u = this; let a; for (i = 0; i < s.length; i++) for (r = 0; r < e.paths.length; r++) { a = e.paths[r]; if (a[a.length - 1].extendList.length) continue; n = this.findMatch(s[i], a), n.length && s[i].selfSelectors.forEach((e) => { o.push(u.extendSelector(n, a, e)); }); }e.paths = e.paths.concat(o); },
findMatch(e, t) {
let n; let r; let i; let s; let o; let u; const a = this; const f = e.selector.elements; const l = []; let c; const h = []; for (n = 0; n < t.length; n++) {
r = t[n]; for (i = 0; i < r.elements.length; i++) {
s = r.elements[i], (e.allowBefore || n == 0 && i == 0) && l.push({
pathIndex: n, index: i, matched: 0, initialCombinator: s.combinator,
}); for (u = 0; u < l.length; u++)c = l[u], o = s.combinator.value, o == '' && i === 0 && (o = ' '), !a.isElementValuesEqual(f[c.matched].value, s.value) || c.matched > 0 && f[c.matched].combinator.value !== o ? c = null : c.matched++, c && (c.finished = c.matched === f.length, c.finished && !e.allowAfter && (i + 1 < r.elements.length || n + 1 < t.length) && (c = null)), c ? c.finished && (c.length = f.length, c.endPathIndex = n, c.endPathElementIndex = i + 1, l.length = 0, h.push(c)) : (l.splice(u, 1), u--);
}
} return h;
},
isElementValuesEqual(t, n) { if (typeof t === 'string' || typeof n === 'string') return t === n; if (t instanceof e.Attribute) return t.op !== n.op || t.key !== n.key ? !1 : !t.value || !n.value ? t.value || n.value ? !1 : !0 : (t = t.value.value || t.value, n = n.value.value || n.value, t === n); return !1; },
extendSelector(t, n, r) { let i = 0; let s = 0; let o = []; let u; let a; let f; let l; for (u = 0; u < t.length; u++)l = t[u], a = n[l.pathIndex], f = new e.Element(l.initialCombinator, r.elements[0].value, r.elements[0].index), l.pathIndex > i && s > 0 && (o[o.length - 1].elements = o[o.length - 1].elements.concat(n[i].elements.slice(s)), s = 0, i++), o = o.concat(n.slice(i, l.pathIndex)), o.push(new e.Selector(a.elements.slice(s, l.index).concat([f]).concat(r.elements.slice(1)))), i = l.endPathIndex, s = l.endPathElementIndex, s >= a.elements.length && (s = 0, i++); return i < n.length && s > 0 && (o[o.length - 1].elements = o[o.length - 1].elements.concat(n[i].elements.slice(s)), s = 0, i++), o = o.concat(n.slice(i, n.length)), o; },
visitRulesetOut(e) {},
visitMedia(e, t) { let n = e.allExtends.concat(this.allExtendsStack[this.allExtendsStack.length - 1]); n = n.concat(this.doExtendChaining(n, e.allExtends)), this.allExtendsStack.push(n); },
visitMediaOut(e) { this.allExtendsStack.length = this.allExtendsStack.length - 1; },
visitDirective(e, t) { let n = e.allExtends.concat(this.allExtendsStack[this.allExtendsStack.length - 1]); n = n.concat(this.doExtendChaining(n, e.allExtends)), this.allExtendsStack.push(n); },
visitDirectiveOut(e) { this.allExtendsStack.length = this.allExtendsStack.length - 1; },
};
}(n('./tree'))); var o = /^(file|chrome(-extension)?|resource|qrc|app):/.test(location.protocol); r.env = r.env || (location.hostname == '127.0.0.1' || location.hostname == '0.0.0.0' || location.hostname == 'localhost' || location.port.length > 0 || o ? 'development' : 'production'), r.async = r.async || !1, r.fileAsync = r.fileAsync || !1, r.poll = r.poll || (o ? 1e3 : 1500); if (r.functions) for (const u in r.functions)r.tree.functions[u] = r.functions[u]; const a = /!dumpLineNumbers:(comments|mediaquery|all)/.exec(location.hash); a && (r.dumpLineNumbers = a[1]), r.watch = function () { return r.watchMode || (r.env = 'development', f()), this.watchMode = !0; }, r.unwatch = function () { return clearInterval(r.watchTimer), this.watchMode = !1; }, /!watch/.test(location.hash) && r.watch(); var l = null; if (r.env != 'development') try { l = typeof e.localStorage === 'undefined' ? null : e.localStorage; } catch (c) {} const h = document.getElementsByTagName('link'); var p = /^text\/(x-)?less$/; r.sheets = []; for (let d = 0; d < h.length; d++)(h[d].rel === 'stylesheet/less' || h[d].rel.match(/stylesheet/) && h[d].type.match(p)) && r.sheets.push(h[d]); var v = ''; r.modifyVars = function (e) { let t = v; for (const n in e)t += `${(n.slice(0, 1) === '@' ? '' : '@') + n}: ${e[n].slice(-1) === ';' ? e[n] : `${e[n]};`}`; (new r.Parser(new r.tree.parseEnv(r))).parse(t, (e, t) => { e ? k(e, 'session_cache') : S(t.toCSS(r), r.sheets[r.sheets.length - 1]); }); }, r.refresh = function (e) { let t; let n; t = n = new Date(), g((e, i, s, o, u) => { if (e) return k(e, o.href); u.local ? C(`loading ${o.href} from cache.`) : (C(`parsed ${o.href} successfully.`), S(i.toCSS(r), o, u.lastModified)), C(`css for ${o.href} generated in ${new Date() - n}ms`), u.remaining === 0 && C(`css generated in ${new Date() - t}ms`), n = new Date(); }, e), m(); }, r.refreshStyles = m, r.refresh(r.env === 'development'), typeof define === 'function' && define.amd && define(() => r);
}(window));