UNPKG

@react-email/tailwind

Version:

A React component to wrap emails with Tailwind CSS

1,459 lines (1,457 loc) 599 kB
import { jsx as lu } from "react/jsx-runtime"; import * as kr from "react"; import ot from "react"; var ta = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}; function He(u) { return u && u.__esModule && Object.prototype.hasOwnProperty.call(u, "default") ? u.default : u; } function uu(u) { if (Object.prototype.hasOwnProperty.call(u, "__esModule")) return u; var a = u.default; if (typeof a == "function") { var h = function p() { return this instanceof p ? Reflect.construct(a, arguments, this.constructor) : a.apply(this, arguments); }; h.prototype = a.prototype; } else h = {}; return Object.defineProperty(h, "__esModule", { value: !0 }), Object.keys(u).forEach(function(p) { var l = Object.getOwnPropertyDescriptor(u, p); Object.defineProperty(h, p, l.get ? l : { enumerable: !0, get: function() { return u[p]; } }); }), h; } var pt = { exports: {} }, ra; function Ai() { if (ra) return pt.exports; ra = 1; var u = String, a = function() { return { isColorSupported: !1, reset: u, bold: u, dim: u, italic: u, underline: u, inverse: u, hidden: u, strikethrough: u, black: u, red: u, green: u, yellow: u, blue: u, magenta: u, cyan: u, white: u, gray: u, bgBlack: u, bgRed: u, bgGreen: u, bgYellow: u, bgBlue: u, bgMagenta: u, bgCyan: u, bgWhite: u, blackBright: u, redBright: u, greenBright: u, yellowBright: u, blueBright: u, magentaBright: u, cyanBright: u, whiteBright: u, bgBlackBright: u, bgRedBright: u, bgGreenBright: u, bgYellowBright: u, bgBlueBright: u, bgMagentaBright: u, bgCyanBright: u, bgWhiteBright: u }; }; return pt.exports = a(), pt.exports.createColors = a, pt.exports; } const fu = {}, cu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: fu }, Symbol.toStringTag, { value: "Module" })), Ne = /* @__PURE__ */ uu(cu); var Pr, na; function Ci() { if (na) return Pr; na = 1; let u = /* @__PURE__ */ Ai(), a = Ne; class h extends Error { constructor(l, f, s, c, t, e) { super(l), this.name = "CssSyntaxError", this.reason = l, t && (this.file = t), c && (this.source = c), e && (this.plugin = e), typeof f < "u" && typeof s < "u" && (typeof f == "number" ? (this.line = f, this.column = s) : (this.line = f.line, this.column = f.column, this.endLine = s.line, this.endColumn = s.column)), this.setMessage(), Error.captureStackTrace && Error.captureStackTrace(this, h); } setMessage() { this.message = this.plugin ? this.plugin + ": " : "", this.message += this.file ? this.file : "<css input>", typeof this.line < "u" && (this.message += ":" + this.line + ":" + this.column), this.message += ": " + this.reason; } showSourceCode(l) { if (!this.source) return ""; let f = this.source; l == null && (l = u.isColorSupported); let s = (v) => v, c = (v) => v, t = (v) => v; if (l) { let { bold: v, gray: g, red: n } = u.createColors(!0); c = (d) => v(n(d)), s = (d) => g(d), a && (t = (d) => a(d)); } let e = f.split(/\r?\n/), r = Math.max(this.line - 3, 0), i = Math.min(this.line + 2, e.length), o = String(i).length; return e.slice(r, i).map((v, g) => { let n = r + 1 + g, d = " " + (" " + n).slice(-o) + " | "; if (n === this.line) { if (v.length > 160) { let w = 20, y = Math.max(0, this.column - w), x = Math.max( this.column + w, this.endColumn + w ), m = v.slice(y, x), O = s(d.replace(/\d/g, " ")) + v.slice(0, Math.min(this.column - 1, w - 1)).replace(/[^\t]/g, " "); return c(">") + s(d) + t(m) + ` ` + O + c("^"); } let _ = s(d.replace(/\d/g, " ")) + v.slice(0, this.column - 1).replace(/[^\t]/g, " "); return c(">") + s(d) + t(v) + ` ` + _ + c("^"); } return " " + s(d) + t(v); }).join(` `); } toString() { let l = this.showSourceCode(); return l && (l = ` ` + l + ` `), this.name + ": " + this.message + l; } } return Pr = h, h.default = h, Pr; } var Er, ia; function cl() { if (ia) return Er; ia = 1; const u = { after: ` `, beforeClose: ` `, beforeComment: ` `, beforeDecl: ` `, beforeOpen: " ", beforeRule: ` `, colon: ": ", commentLeft: " ", commentRight: " ", emptyBody: "", indent: " ", semicolon: !1 }; function a(p) { return p[0].toUpperCase() + p.slice(1); } class h { constructor(l) { this.builder = l; } atrule(l, f) { let s = "@" + l.name, c = l.params ? this.rawValue(l, "params") : ""; if (typeof l.raws.afterName < "u" ? s += l.raws.afterName : c && (s += " "), l.nodes) this.block(l, s + c); else { let t = (l.raws.between || "") + (f ? ";" : ""); this.builder(s + c + t, l); } } beforeAfter(l, f) { let s; l.type === "decl" ? s = this.raw(l, null, "beforeDecl") : l.type === "comment" ? s = this.raw(l, null, "beforeComment") : f === "before" ? s = this.raw(l, null, "beforeRule") : s = this.raw(l, null, "beforeClose"); let c = l.parent, t = 0; for (; c && c.type !== "root"; ) t += 1, c = c.parent; if (s.includes(` `)) { let e = this.raw(l, null, "indent"); if (e.length) for (let r = 0; r < t; r++) s += e; } return s; } block(l, f) { let s = this.raw(l, "between", "beforeOpen"); this.builder(f + s + "{", l, "start"); let c; l.nodes && l.nodes.length ? (this.body(l), c = this.raw(l, "after")) : c = this.raw(l, "after", "emptyBody"), c && this.builder(c), this.builder("}", l, "end"); } body(l) { let f = l.nodes.length - 1; for (; f > 0 && l.nodes[f].type === "comment"; ) f -= 1; let s = this.raw(l, "semicolon"); for (let c = 0; c < l.nodes.length; c++) { let t = l.nodes[c], e = this.raw(t, "before"); e && this.builder(e), this.stringify(t, f !== c || s); } } comment(l) { let f = this.raw(l, "left", "commentLeft"), s = this.raw(l, "right", "commentRight"); this.builder("/*" + f + l.text + s + "*/", l); } decl(l, f) { let s = this.raw(l, "between", "colon"), c = l.prop + s + this.rawValue(l, "value"); l.important && (c += l.raws.important || " !important"), f && (c += ";"), this.builder(c, l); } document(l) { this.body(l); } raw(l, f, s) { let c; if (s || (s = f), f && (c = l.raws[f], typeof c < "u")) return c; let t = l.parent; if (s === "before" && (!t || t.type === "root" && t.first === l || t && t.type === "document")) return ""; if (!t) return u[s]; let e = l.root(); if (e.rawCache || (e.rawCache = {}), typeof e.rawCache[s] < "u") return e.rawCache[s]; if (s === "before" || s === "after") return this.beforeAfter(l, s); { let r = "raw" + a(s); this[r] ? c = this[r](e, l) : e.walk((i) => { if (c = i.raws[f], typeof c < "u") return !1; }); } return typeof c > "u" && (c = u[s]), e.rawCache[s] = c, c; } rawBeforeClose(l) { let f; return l.walk((s) => { if (s.nodes && s.nodes.length > 0 && typeof s.raws.after < "u") return f = s.raws.after, f.includes(` `) && (f = f.replace(/[^\n]+$/, "")), !1; }), f && (f = f.replace(/\S/g, "")), f; } rawBeforeComment(l, f) { let s; return l.walkComments((c) => { if (typeof c.raws.before < "u") return s = c.raws.before, s.includes(` `) && (s = s.replace(/[^\n]+$/, "")), !1; }), typeof s > "u" ? s = this.raw(f, null, "beforeDecl") : s && (s = s.replace(/\S/g, "")), s; } rawBeforeDecl(l, f) { let s; return l.walkDecls((c) => { if (typeof c.raws.before < "u") return s = c.raws.before, s.includes(` `) && (s = s.replace(/[^\n]+$/, "")), !1; }), typeof s > "u" ? s = this.raw(f, null, "beforeRule") : s && (s = s.replace(/\S/g, "")), s; } rawBeforeOpen(l) { let f; return l.walk((s) => { if (s.type !== "decl" && (f = s.raws.between, typeof f < "u")) return !1; }), f; } rawBeforeRule(l) { let f; return l.walk((s) => { if (s.nodes && (s.parent !== l || l.first !== s) && typeof s.raws.before < "u") return f = s.raws.before, f.includes(` `) && (f = f.replace(/[^\n]+$/, "")), !1; }), f && (f = f.replace(/\S/g, "")), f; } rawColon(l) { let f; return l.walkDecls((s) => { if (typeof s.raws.between < "u") return f = s.raws.between.replace(/[^\s:]/g, ""), !1; }), f; } rawEmptyBody(l) { let f; return l.walk((s) => { if (s.nodes && s.nodes.length === 0 && (f = s.raws.after, typeof f < "u")) return !1; }), f; } rawIndent(l) { if (l.raws.indent) return l.raws.indent; let f; return l.walk((s) => { let c = s.parent; if (c && c !== l && c.parent && c.parent === l && typeof s.raws.before < "u") { let t = s.raws.before.split(` `); return f = t[t.length - 1], f = f.replace(/\S/g, ""), !1; } }), f; } rawSemicolon(l) { let f; return l.walk((s) => { if (s.nodes && s.nodes.length && s.last.type === "decl" && (f = s.raws.semicolon, typeof f < "u")) return !1; }), f; } rawValue(l, f) { let s = l[f], c = l.raws[f]; return c && c.value === s ? c.raw : s; } root(l) { this.body(l), l.raws.after && this.builder(l.raws.after); } rule(l) { this.block(l, this.rawValue(l, "selector")), l.raws.ownSemicolon && this.builder(l.raws.ownSemicolon, l, "end"); } stringify(l, f) { if (!this[l.type]) throw new Error( "Unknown AST node type " + l.type + ". Maybe you need to change PostCSS stringifier." ); this[l.type](l, f); } } return Er = h, h.default = h, Er; } var Tr, aa; function lr() { if (aa) return Tr; aa = 1; let u = cl(); function a(h, p) { new u(p).stringify(h); } return Tr = a, a.default = a, Tr; } var ht = {}, sa; function Ri() { return sa || (sa = 1, ht.isClean = Symbol("isClean"), ht.my = Symbol("my")), ht; } var Ar, oa; function ur() { if (oa) return Ar; oa = 1; let u = Ci(), a = cl(), h = lr(), { isClean: p, my: l } = Ri(); function f(t, e) { let r = new t.constructor(); for (let i in t) { if (!Object.prototype.hasOwnProperty.call(t, i) || i === "proxyCache") continue; let o = t[i], v = typeof o; i === "parent" && v === "object" ? e && (r[i] = e) : i === "source" ? r[i] = o : Array.isArray(o) ? r[i] = o.map((g) => f(g, r)) : (v === "object" && o !== null && (o = f(o)), r[i] = o); } return r; } function s(t, e) { if (e && typeof e.offset < "u") return e.offset; let r = 1, i = 1, o = 0; for (let v = 0; v < t.length; v++) { if (i === e.line && r === e.column) { o = v; break; } t[v] === ` ` ? (r = 1, i += 1) : r += 1; } return o; } class c { get proxyOf() { return this; } constructor(e = {}) { this.raws = {}, this[p] = !1, this[l] = !0; for (let r in e) if (r === "nodes") { this.nodes = []; for (let i of e[r]) typeof i.clone == "function" ? this.append(i.clone()) : this.append(i); } else this[r] = e[r]; } addToError(e) { if (e.postcssNode = this, e.stack && this.source && /\n\s{4}at /.test(e.stack)) { let r = this.source; e.stack = e.stack.replace( /\n\s{4}at /, `$&${r.input.from}:${r.start.line}:${r.start.column}$&` ); } return e; } after(e) { return this.parent.insertAfter(this, e), this; } assign(e = {}) { for (let r in e) this[r] = e[r]; return this; } before(e) { return this.parent.insertBefore(this, e), this; } cleanRaws(e) { delete this.raws.before, delete this.raws.after, e || delete this.raws.between; } clone(e = {}) { let r = f(this); for (let i in e) r[i] = e[i]; return r; } cloneAfter(e = {}) { let r = this.clone(e); return this.parent.insertAfter(this, r), r; } cloneBefore(e = {}) { let r = this.clone(e); return this.parent.insertBefore(this, r), r; } error(e, r = {}) { if (this.source) { let { end: i, start: o } = this.rangeBy(r); return this.source.input.error( e, { column: o.column, line: o.line }, { column: i.column, line: i.line }, r ); } return new u(e); } getProxyProcessor() { return { get(e, r) { return r === "proxyOf" ? e : r === "root" ? () => e.root().toProxy() : e[r]; }, set(e, r, i) { return e[r] === i || (e[r] = i, (r === "prop" || r === "value" || r === "name" || r === "params" || r === "important" || /* c8 ignore next */ r === "text") && e.markDirty()), !0; } }; } /* c8 ignore next 3 */ markClean() { this[p] = !0; } markDirty() { if (this[p]) { this[p] = !1; let e = this; for (; e = e.parent; ) e[p] = !1; } } next() { if (!this.parent) return; let e = this.parent.index(this); return this.parent.nodes[e + 1]; } positionBy(e) { let r = this.source.start; if (e.index) r = this.positionInside(e.index); else if (e.word) { let i = "document" in this.source.input ? this.source.input.document : this.source.input.css, v = i.slice( s(i, this.source.start), s(i, this.source.end) ).indexOf(e.word); v !== -1 && (r = this.positionInside(v)); } return r; } positionInside(e) { let r = this.source.start.column, i = this.source.start.line, o = "document" in this.source.input ? this.source.input.document : this.source.input.css, v = s(o, this.source.start), g = v + e; for (let n = v; n < g; n++) o[n] === ` ` ? (r = 1, i += 1) : r += 1; return { column: r, line: i }; } prev() { if (!this.parent) return; let e = this.parent.index(this); return this.parent.nodes[e - 1]; } rangeBy(e) { let r = { column: this.source.start.column, line: this.source.start.line }, i = this.source.end ? { column: this.source.end.column + 1, line: this.source.end.line } : { column: r.column + 1, line: r.line }; if (e.word) { let o = "document" in this.source.input ? this.source.input.document : this.source.input.css, g = o.slice( s(o, this.source.start), s(o, this.source.end) ).indexOf(e.word); g !== -1 && (r = this.positionInside(g), i = this.positionInside( g + e.word.length )); } else e.start ? r = { column: e.start.column, line: e.start.line } : e.index && (r = this.positionInside(e.index)), e.end ? i = { column: e.end.column, line: e.end.line } : typeof e.endIndex == "number" ? i = this.positionInside(e.endIndex) : e.index && (i = this.positionInside(e.index + 1)); return (i.line < r.line || i.line === r.line && i.column <= r.column) && (i = { column: r.column + 1, line: r.line }), { end: i, start: r }; } raw(e, r) { return new a().raw(this, e, r); } remove() { return this.parent && this.parent.removeChild(this), this.parent = void 0, this; } replaceWith(...e) { if (this.parent) { let r = this, i = !1; for (let o of e) o === this ? i = !0 : i ? (this.parent.insertAfter(r, o), r = o) : this.parent.insertBefore(r, o); i || this.remove(); } return this; } root() { let e = this; for (; e.parent && e.parent.type !== "document"; ) e = e.parent; return e; } toJSON(e, r) { let i = {}, o = r == null; r = r || /* @__PURE__ */ new Map(); let v = 0; for (let g in this) { if (!Object.prototype.hasOwnProperty.call(this, g) || g === "parent" || g === "proxyCache") continue; let n = this[g]; if (Array.isArray(n)) i[g] = n.map((d) => typeof d == "object" && d.toJSON ? d.toJSON(null, r) : d); else if (typeof n == "object" && n.toJSON) i[g] = n.toJSON(null, r); else if (g === "source") { let d = r.get(n.input); d == null && (d = v, r.set(n.input, v), v++), i[g] = { end: n.end, inputId: d, start: n.start }; } else i[g] = n; } return o && (i.inputs = [...r.keys()].map((g) => g.toJSON())), i; } toProxy() { return this.proxyCache || (this.proxyCache = new Proxy(this, this.getProxyProcessor())), this.proxyCache; } toString(e = h) { e.stringify && (e = e.stringify); let r = ""; return e(this, (i) => { r += i; }), r; } warn(e, r, i) { let o = { node: this }; for (let v in i) o[v] = i[v]; return e.warn(r, o); } } return Ar = c, c.default = c, Ar; } var Cr, la; function fr() { if (la) return Cr; la = 1; let u = ur(); class a extends u { constructor(p) { super(p), this.type = "comment"; } } return Cr = a, a.default = a, Cr; } var Rr, ua; function cr() { if (ua) return Rr; ua = 1; let u = ur(); class a extends u { get variable() { return this.prop.startsWith("--") || this.prop[0] === "$"; } constructor(p) { p && typeof p.value < "u" && typeof p.value != "string" && (p = { ...p, value: String(p.value) }), super(p), this.type = "decl"; } } return Rr = a, a.default = a, Rr; } var Ir, fa; function nt() { if (fa) return Ir; fa = 1; let u = fr(), a = cr(), h = ur(), { isClean: p, my: l } = Ri(), f, s, c, t; function e(o) { return o.map((v) => (v.nodes && (v.nodes = e(v.nodes)), delete v.source, v)); } function r(o) { if (o[p] = !1, o.proxyOf.nodes) for (let v of o.proxyOf.nodes) r(v); } class i extends h { get first() { if (this.proxyOf.nodes) return this.proxyOf.nodes[0]; } get last() { if (this.proxyOf.nodes) return this.proxyOf.nodes[this.proxyOf.nodes.length - 1]; } append(...v) { for (let g of v) { let n = this.normalize(g, this.last); for (let d of n) this.proxyOf.nodes.push(d); } return this.markDirty(), this; } cleanRaws(v) { if (super.cleanRaws(v), this.nodes) for (let g of this.nodes) g.cleanRaws(v); } each(v) { if (!this.proxyOf.nodes) return; let g = this.getIterator(), n, d; for (; this.indexes[g] < this.proxyOf.nodes.length && (n = this.indexes[g], d = v(this.proxyOf.nodes[n], n), d !== !1); ) this.indexes[g] += 1; return delete this.indexes[g], d; } every(v) { return this.nodes.every(v); } getIterator() { this.lastEach || (this.lastEach = 0), this.indexes || (this.indexes = {}), this.lastEach += 1; let v = this.lastEach; return this.indexes[v] = 0, v; } getProxyProcessor() { return { get(v, g) { return g === "proxyOf" ? v : v[g] ? g === "each" || typeof g == "string" && g.startsWith("walk") ? (...n) => v[g]( ...n.map((d) => typeof d == "function" ? (_, w) => d(_.toProxy(), w) : d) ) : g === "every" || g === "some" ? (n) => v[g]( (d, ..._) => n(d.toProxy(), ..._) ) : g === "root" ? () => v.root().toProxy() : g === "nodes" ? v.nodes.map((n) => n.toProxy()) : g === "first" || g === "last" ? v[g].toProxy() : v[g] : v[g]; }, set(v, g, n) { return v[g] === n || (v[g] = n, (g === "name" || g === "params" || g === "selector") && v.markDirty()), !0; } }; } index(v) { return typeof v == "number" ? v : (v.proxyOf && (v = v.proxyOf), this.proxyOf.nodes.indexOf(v)); } insertAfter(v, g) { let n = this.index(v), d = this.normalize(g, this.proxyOf.nodes[n]).reverse(); n = this.index(v); for (let w of d) this.proxyOf.nodes.splice(n + 1, 0, w); let _; for (let w in this.indexes) _ = this.indexes[w], n < _ && (this.indexes[w] = _ + d.length); return this.markDirty(), this; } insertBefore(v, g) { let n = this.index(v), d = n === 0 ? "prepend" : !1, _ = this.normalize( g, this.proxyOf.nodes[n], d ).reverse(); n = this.index(v); for (let y of _) this.proxyOf.nodes.splice(n, 0, y); let w; for (let y in this.indexes) w = this.indexes[y], n <= w && (this.indexes[y] = w + _.length); return this.markDirty(), this; } normalize(v, g) { if (typeof v == "string") v = e(s(v).nodes); else if (typeof v > "u") v = []; else if (Array.isArray(v)) { v = v.slice(0); for (let d of v) d.parent && d.parent.removeChild(d, "ignore"); } else if (v.type === "root" && this.type !== "document") { v = v.nodes.slice(0); for (let d of v) d.parent && d.parent.removeChild(d, "ignore"); } else if (v.type) v = [v]; else if (v.prop) { if (typeof v.value > "u") throw new Error("Value field is missed in node creation"); typeof v.value != "string" && (v.value = String(v.value)), v = [new a(v)]; } else if (v.selector || v.selectors) v = [new t(v)]; else if (v.name) v = [new f(v)]; else if (v.text) v = [new u(v)]; else throw new Error("Unknown node type in node creation"); return v.map((d) => (d[l] || i.rebuild(d), d = d.proxyOf, d.parent && d.parent.removeChild(d), d[p] && r(d), d.raws || (d.raws = {}), typeof d.raws.before > "u" && g && typeof g.raws.before < "u" && (d.raws.before = g.raws.before.replace(/\S/g, "")), d.parent = this.proxyOf, d)); } prepend(...v) { v = v.reverse(); for (let g of v) { let n = this.normalize(g, this.first, "prepend").reverse(); for (let d of n) this.proxyOf.nodes.unshift(d); for (let d in this.indexes) this.indexes[d] = this.indexes[d] + n.length; } return this.markDirty(), this; } push(v) { return v.parent = this, this.proxyOf.nodes.push(v), this; } removeAll() { for (let v of this.proxyOf.nodes) v.parent = void 0; return this.proxyOf.nodes = [], this.markDirty(), this; } removeChild(v) { v = this.index(v), this.proxyOf.nodes[v].parent = void 0, this.proxyOf.nodes.splice(v, 1); let g; for (let n in this.indexes) g = this.indexes[n], g >= v && (this.indexes[n] = g - 1); return this.markDirty(), this; } replaceValues(v, g, n) { return n || (n = g, g = {}), this.walkDecls((d) => { g.props && !g.props.includes(d.prop) || g.fast && !d.value.includes(g.fast) || (d.value = d.value.replace(v, n)); }), this.markDirty(), this; } some(v) { return this.nodes.some(v); } walk(v) { return this.each((g, n) => { let d; try { d = v(g, n); } catch (_) { throw g.addToError(_); } return d !== !1 && g.walk && (d = g.walk(v)), d; }); } walkAtRules(v, g) { return g ? v instanceof RegExp ? this.walk((n, d) => { if (n.type === "atrule" && v.test(n.name)) return g(n, d); }) : this.walk((n, d) => { if (n.type === "atrule" && n.name === v) return g(n, d); }) : (g = v, this.walk((n, d) => { if (n.type === "atrule") return g(n, d); })); } walkComments(v) { return this.walk((g, n) => { if (g.type === "comment") return v(g, n); }); } walkDecls(v, g) { return g ? v instanceof RegExp ? this.walk((n, d) => { if (n.type === "decl" && v.test(n.prop)) return g(n, d); }) : this.walk((n, d) => { if (n.type === "decl" && n.prop === v) return g(n, d); }) : (g = v, this.walk((n, d) => { if (n.type === "decl") return g(n, d); })); } walkRules(v, g) { return g ? v instanceof RegExp ? this.walk((n, d) => { if (n.type === "rule" && v.test(n.selector)) return g(n, d); }) : this.walk((n, d) => { if (n.type === "rule" && n.selector === v) return g(n, d); }) : (g = v, this.walk((n, d) => { if (n.type === "rule") return g(n, d); })); } } return i.registerParse = (o) => { s = o; }, i.registerRule = (o) => { t = o; }, i.registerAtRule = (o) => { f = o; }, i.registerRoot = (o) => { c = o; }, Ir = i, i.default = i, i.rebuild = (o) => { o.type === "atrule" ? Object.setPrototypeOf(o, f.prototype) : o.type === "rule" ? Object.setPrototypeOf(o, t.prototype) : o.type === "decl" ? Object.setPrototypeOf(o, a.prototype) : o.type === "comment" ? Object.setPrototypeOf(o, u.prototype) : o.type === "root" && Object.setPrototypeOf(o, c.prototype), o[l] = !0, o.nodes && o.nodes.forEach((v) => { i.rebuild(v); }); }, Ir; } var Mr, ca; function Ii() { if (ca) return Mr; ca = 1; let u = nt(); class a extends u { constructor(p) { super(p), this.type = "atrule"; } append(...p) { return this.proxyOf.nodes || (this.nodes = []), super.append(...p); } prepend(...p) { return this.proxyOf.nodes || (this.nodes = []), super.prepend(...p); } } return Mr = a, a.default = a, u.registerAtRule(a), Mr; } var Dr, da; function Mi() { if (da) return Dr; da = 1; let u = nt(), a, h; class p extends u { constructor(f) { super({ type: "document", ...f }), this.nodes || (this.nodes = []); } toResult(f = {}) { return new a(new h(), this, f).stringify(); } } return p.registerLazyResult = (l) => { a = l; }, p.registerProcessor = (l) => { h = l; }, Dr = p, p.default = p, Dr; } var qr, pa; function du() { if (pa) return qr; pa = 1; let u = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"; return qr = { nanoid: (p = 21) => { let l = "", f = p | 0; for (; f--; ) l += u[Math.random() * 64 | 0]; return l; }, customAlphabet: (p, l = 21) => (f = l) => { let s = "", c = f | 0; for (; c--; ) s += p[Math.random() * p.length | 0]; return s; } }, qr; } var Lr, ha; function dl() { if (ha) return Lr; ha = 1; let { existsSync: u, readFileSync: a } = Ne, { dirname: h, join: p } = Ne, { SourceMapConsumer: l, SourceMapGenerator: f } = Ne; function s(t) { return Buffer ? Buffer.from(t, "base64").toString() : window.atob(t); } class c { constructor(e, r) { if (r.map === !1) return; this.loadAnnotation(e), this.inline = this.startWith(this.annotation, "data:"); let i = r.map ? r.map.prev : void 0, o = this.loadMap(r.from, i); !this.mapFile && r.from && (this.mapFile = r.from), this.mapFile && (this.root = h(this.mapFile)), o && (this.text = o); } consumer() { return this.consumerCache || (this.consumerCache = new l(this.text)), this.consumerCache; } decodeInline(e) { let r = /^data:application\/json;charset=utf-?8;base64,/, i = /^data:application\/json;base64,/, o = /^data:application\/json;charset=utf-?8,/, v = /^data:application\/json,/, g = e.match(o) || e.match(v); if (g) return decodeURIComponent(e.substr(g[0].length)); let n = e.match(r) || e.match(i); if (n) return s(e.substr(n[0].length)); let d = e.match(/data:application\/json;([^,]+),/)[1]; throw new Error("Unsupported source map encoding " + d); } getAnnotationURL(e) { return e.replace(/^\/\*\s*# sourceMappingURL=/, "").trim(); } isMap(e) { return typeof e != "object" ? !1 : typeof e.mappings == "string" || typeof e._mappings == "string" || Array.isArray(e.sections); } loadAnnotation(e) { let r = e.match(/\/\*\s*# sourceMappingURL=/g); if (!r) return; let i = e.lastIndexOf(r.pop()), o = e.indexOf("*/", i); i > -1 && o > -1 && (this.annotation = this.getAnnotationURL(e.substring(i, o))); } loadFile(e) { if (this.root = h(e), u(e)) return this.mapFile = e, a(e, "utf-8").toString().trim(); } loadMap(e, r) { if (r === !1) return !1; if (r) { if (typeof r == "string") return r; if (typeof r == "function") { let i = r(e); if (i) { let o = this.loadFile(i); if (!o) throw new Error( "Unable to load previous source map: " + i.toString() ); return o; } } else { if (r instanceof l) return f.fromSourceMap(r).toString(); if (r instanceof f) return r.toString(); if (this.isMap(r)) return JSON.stringify(r); throw new Error( "Unsupported previous source map format: " + r.toString() ); } } else { if (this.inline) return this.decodeInline(this.annotation); if (this.annotation) { let i = this.annotation; return e && (i = p(h(e), i)), this.loadFile(i); } } } startWith(e, r) { return e ? e.substr(0, r.length) === r : !1; } withContent() { return !!(this.consumer().sourcesContent && this.consumer().sourcesContent.length > 0); } } return Lr = c, c.default = c, Lr; } var Nr, va; function dr() { if (va) return Nr; va = 1; let { nanoid: u } = /* @__PURE__ */ du(), { isAbsolute: a, resolve: h } = Ne, { SourceMapConsumer: p, SourceMapGenerator: l } = Ne, { fileURLToPath: f, pathToFileURL: s } = Ne, c = Ci(), t = dl(), e = Ne, r = Symbol("fromOffsetCache"), i = !!(p && l), o = !!(h && a); class v { get from() { return this.file || this.id; } constructor(n, d = {}) { if (n === null || typeof n > "u" || typeof n == "object" && !n.toString) throw new Error(`PostCSS received ${n} instead of CSS string`); if (this.css = n.toString(), this.css[0] === "\uFEFF" || this.css[0] === "￾" ? (this.hasBOM = !0, this.css = this.css.slice(1)) : this.hasBOM = !1, this.document = this.css, d.document && (this.document = d.document.toString()), d.from && (!o || /^\w+:\/\//.test(d.from) || a(d.from) ? this.file = d.from : this.file = h(d.from)), o && i) { let _ = new t(this.css, d); if (_.text) { this.map = _; let w = _.consumer().file; !this.file && w && (this.file = this.mapResolve(w)); } } this.file || (this.id = "<input css " + u(6) + ">"), this.map && (this.map.file = this.from); } error(n, d, _, w = {}) { let y, x, m; if (d && typeof d == "object") { let A = d, E = _; if (typeof A.offset == "number") { let b = this.fromOffset(A.offset); d = b.line, _ = b.col; } else d = A.line, _ = A.column; if (typeof E.offset == "number") { let b = this.fromOffset(E.offset); x = b.line, y = b.col; } else x = E.line, y = E.column; } else if (!_) { let A = this.fromOffset(d); d = A.line, _ = A.col; } let O = this.origin(d, _, x, y); return O ? m = new c( n, O.endLine === void 0 ? O.line : { column: O.column, line: O.line }, O.endLine === void 0 ? O.column : { column: O.endColumn, line: O.endLine }, O.source, O.file, w.plugin ) : m = new c( n, x === void 0 ? d : { column: _, line: d }, x === void 0 ? _ : { column: y, line: x }, this.css, this.file, w.plugin ), m.input = { column: _, endColumn: y, endLine: x, line: d, source: this.css }, this.file && (s && (m.input.url = s(this.file).toString()), m.input.file = this.file), m; } fromOffset(n) { let d, _; if (this[r]) _ = this[r]; else { let y = this.css.split(` `); _ = new Array(y.length); let x = 0; for (let m = 0, O = y.length; m < O; m++) _[m] = x, x += y[m].length + 1; this[r] = _; } d = _[_.length - 1]; let w = 0; if (n >= d) w = _.length - 1; else { let y = _.length - 2, x; for (; w < y; ) if (x = w + (y - w >> 1), n < _[x]) y = x - 1; else if (n >= _[x + 1]) w = x + 1; else { w = x; break; } } return { col: n - _[w] + 1, line: w + 1 }; } mapResolve(n) { return /^\w+:\/\//.test(n) ? n : h(this.map.consumer().sourceRoot || this.map.root || ".", n); } origin(n, d, _, w) { if (!this.map) return !1; let y = this.map.consumer(), x = y.originalPositionFor({ column: d, line: n }); if (!x.source) return !1; let m; typeof _ == "number" && (m = y.originalPositionFor({ column: w, line: _ })); let O; a(x.source) ? O = s(x.source) : O = new URL( x.source, this.map.consumer().sourceRoot || s(this.map.mapFile) ); let A = { column: x.column, endColumn: m && m.column, endLine: m && m.line, line: x.line, url: O.toString() }; if (O.protocol === "file:") if (f) A.file = f(O); else throw new Error("file: protocol is not available in this PostCSS build"); let E = y.sourceContentFor(x.source); return E && (A.source = E), A; } toJSON() { let n = {}; for (let d of ["hasBOM", "css", "file", "id"]) this[d] != null && (n[d] = this[d]); return this.map && (n.map = { ...this.map }, n.map.consumerCache && (n.map.consumerCache = void 0)), n; } } return Nr = v, v.default = v, e && e.registerInput && e.registerInput(v), Nr; } var Fr, ma; function lt() { if (ma) return Fr; ma = 1; let u = nt(), a, h; class p extends u { constructor(f) { super(f), this.type = "root", this.nodes || (this.nodes = []); } normalize(f, s, c) { let t = super.normalize(f); if (s) { if (c === "prepend") this.nodes.length > 1 ? s.raws.before = this.nodes[1].raws.before : delete s.raws.before; else if (this.first !== s) for (let e of t) e.raws.before = s.raws.before; } return t; } removeChild(f, s) { let c = this.index(f); return !s && c === 0 && this.nodes.length > 1 && (this.nodes[1].raws.before = this.nodes[c].raws.before), super.removeChild(f); } toResult(f = {}) { return new a(new h(), this, f).stringify(); } } return p.registerLazyResult = (l) => { a = l; }, p.registerProcessor = (l) => { h = l; }, Fr = p, p.default = p, u.registerRoot(p), Fr; } var $r, ga; function pl() { if (ga) return $r; ga = 1; let u = { comma(a) { return u.split(a, [","], !0); }, space(a) { let h = [" ", ` `, " "]; return u.split(a, h); }, split(a, h, p) { let l = [], f = "", s = !1, c = 0, t = !1, e = "", r = !1; for (let i of a) r ? r = !1 : i === "\\" ? r = !0 : t ? i === e && (t = !1) : i === '"' || i === "'" ? (t = !0, e = i) : i === "(" ? c += 1 : i === ")" ? c > 0 && (c -= 1) : c === 0 && h.includes(i) && (s = !0), s ? (f !== "" && l.push(f.trim()), f = "", s = !1) : f += i; return (p || f !== "") && l.push(f.trim()), l; } }; return $r = u, u.default = u, $r; } var Ur, ya; function Di() { if (ya) return Ur; ya = 1; let u = nt(), a = pl(); class h extends u { get selectors() { return a.comma(this.selector); } set selectors(l) { let f = this.selector ? this.selector.match(/,\s*/) : null, s = f ? f[0] : "," + this.raw("between", "beforeOpen"); this.selector = l.join(s); } constructor(l) { super(l), this.type = "rule", this.nodes || (this.nodes = []); } } return Ur = h, h.default = h, u.registerRule(h), Ur; } var zr, wa; function pu() { if (wa) return zr; wa = 1; let u = Ii(), a = fr(), h = cr(), p = dr(), l = dl(), f = lt(), s = Di(); function c(t, e) { if (Array.isArray(t)) return t.map((o) => c(o)); let { inputs: r, ...i } = t; if (r) { e = []; for (let o of r) { let v = { ...o, __proto__: p.prototype }; v.map && (v.map = { ...v.map, __proto__: l.prototype }), e.push(v); } } if (i.nodes && (i.nodes = t.nodes.map((o) => c(o, e))), i.source) { let { inputId: o, ...v } = i.source; i.source = v, o != null && (i.source.input = e[o]); } if (i.type === "root") return new f(i); if (i.type === "decl") return new h(i); if (i.type === "rule") return new s(i); if (i.type === "comment") return new a(i); if (i.type === "atrule") return new u(i); throw new Error("Unknown node type: " + t.type); } return zr = c, c.default = c, zr; } var Wr, ba; function hl() { if (ba) return Wr; ba = 1; let { dirname: u, relative: a, resolve: h, sep: p } = Ne, { SourceMapConsumer: l, SourceMapGenerator: f } = Ne, { pathToFileURL: s } = Ne, c = dr(), t = !!(l && f), e = !!(u && h && a && p); class r { constructor(o, v, g, n) { this.stringify = o, this.mapOpts = g.map || {}, this.root = v, this.opts = g, this.css = n, this.originalCSS = n, this.usesFileUrls = !this.mapOpts.from && this.mapOpts.absolute, this.memoizedFileURLs = /* @__PURE__ */ new Map(), this.memoizedPaths = /* @__PURE__ */ new Map(), this.memoizedURLs = /* @__PURE__ */ new Map(); } addAnnotation() { let o; this.isInline() ? o = "data:application/json;base64," + this.toBase64(this.map.toString()) : typeof this.mapOpts.annotation == "string" ? o = this.mapOpts.annotation : typeof this.mapOpts.annotation == "function" ? o = this.mapOpts.annotation(this.opts.to, this.root) : o = this.outputFile() + ".map"; let v = ` `; this.css.includes(`\r `) && (v = `\r `), this.css += v + "/*# sourceMappingURL=" + o + " */"; } applyPrevMaps() { for (let o of this.previous()) { let v = this.toUrl(this.path(o.file)), g = o.root || u(o.file), n; this.mapOpts.sourcesContent === !1 ? (n = new l(o.text), n.sourcesContent && (n.sourcesContent = null)) : n = o.consumer(), this.map.applySourceMap(n, v, this.toUrl(this.path(g))); } } clearAnnotation() { if (this.mapOpts.annotation !== !1) if (this.root) { let o; for (let v = this.root.nodes.length - 1; v >= 0; v--) o = this.root.nodes[v], o.type === "comment" && o.text.startsWith("# sourceMappingURL=") && this.root.removeChild(v); } else this.css && (this.css = this.css.replace(/\n*\/\*#[\S\s]*?\*\/$/gm, "")); } generate() { if (this.clearAnnotation(), e && t && this.isMap()) return this.generateMap(); { let o = ""; return this.stringify(this.root, (v) => { o += v; }), [o]; } } generateMap() { if (this.root) this.generateString(); else if (this.previous().length === 1) { let o = this.previous()[0].consumer(); o.file = this.outputFile(), this.map = f.fromSourceMap(o, { ignoreInvalidMapping: !0 }); } else this.map = new f({ file: this.outputFile(), ignoreInvalidMapping: !0 }), this.map.addMapping({ generated: { column: 0, line: 1 }, original: { column: 0, line: 1 }, source: this.opts.from ? this.toUrl(this.path(this.opts.from)) : "<no source>" }); return this.isSourcesContent() && this.setSourcesContent(), this.root && this.previous().length > 0 && this.applyPrevMaps(), this.isAnnotation() && this.addAnnotation(), this.isInline() ? [this.css] : [this.css, this.map]; } generateString() { this.css = "", this.map = new f({ file: this.outputFile(), ignoreInvalidMapping: !0 }); let o = 1, v = 1, g = "<no source>", n = { generated: { column: 0, line: 0 }, original: { column: 0, line: 0 }, source: "" }, d, _; this.stringify(this.root, (w, y, x) => { if (this.css += w, y && x !== "end" && (n.generated.line = o, n.generated.column = v - 1, y.source && y.source.start ? (n.source = this.sourcePath(y), n.original.line = y.source.start.line, n.original.column = y.source.start.column - 1, this.map.addMapping(n)) : (n.source = g, n.original.line = 1, n.original.column = 0, this.map.addMapping(n))), _ = w.match(/\n/g), _ ? (o += _.length, d = w.lastIndexOf(` `), v = w.length - d) : v += w.length, y && x !== "start") { let m = y.parent || { raws: {} }; (!(y.type === "decl" || y.type === "atrule" && !y.nodes) || y !== m.last || m.raws.semicolon) && (y.source && y.source.end ? (n.source = this.sourcePath(y), n.original.line = y.source.end.line, n.original.column = y.source.end.column - 1, n.generated.line = o, n.generated.column = v - 2, this.map.addMapping(n)) : (n.source = g, n.original.line = 1, n.original.column = 0, n.generated.line = o, n.generated.column = v - 1, this.map.addMapping(n))); } }); } isAnnotation() { return this.isInline() ? !0 : typeof this.mapOpts.annotation < "u" ? this.mapOpts.annotation : this.previous().length ? this.previous().some((o) => o.annotation) : !0; } isInline() { if (typeof this.mapOpts.inline < "u") return this.mapOpts.inline; let o = this.mapOpts.annotation; return typeof o < "u" && o !== !0 ? !1 : this.previous().length ? this.previous().some((v) => v.inline) : !0; } isMap() { return typeof this.opts.map < "u" ? !!this.opts.map : this.previous().length > 0; } isSourcesContent() { return typeof this.mapOpts.sourcesContent < "u" ? this.mapOpts.sourcesContent : this.previous().length ? this.previous().some((o) => o.withContent()) : !0; } outputFile() { return this.opts.to ? this.path(this.opts.to) : this.opts.from ? this.path(this.opts.from) : "to.css"; } path(o) { if (this.mapOpts.absolute || o.charCodeAt(0) === 60 || /^\w+:\/\//.test(o)) return o; let v = this.memoizedPaths.get(o); if (v) return v; let g = this.opts.to ? u(this.opts.to) : "."; typeof this.mapOpts.annotation == "string" && (g = u(h(g, this.mapOpts.annotation))); let n = a(g, o); return this.memoizedPaths.set(o, n), n; } previous() { if (!this.previousMaps) if (this.previousMaps = [], this.root) this.root.walk((o) => { if (o.source && o.source.input.map) { let v = o.source.input.map; this.previousMaps.includes(v) || this.previousMaps.push(v); } }); else { let o = new c(this.originalCSS, this.opts); o.map && this.previousMaps.push(o.map); } return this.previousMaps; } setSourcesContent() { let o = {}; if (this.root) this.root.walk((v) => { if (v.source) { let g = v.source.input.from; if (g && !o[g]) { o[g] = !0; let n = this.usesFileUrls ? this.toFileUrl(g) : this.toUrl(this.path(g)); this.map.setSourceContent(n, v.source.input.css); } } }); else if (this.css) { let v = this.opts.from ? this.toUrl(this.path(this.opts.from)) : "<no source>"; this.map.setSourceContent(v, this.css); } } sourcePath(o) { return this.mapOpts.from ? this.toUrl(this.mapOpts.from) : this.usesFileUrls ? this.toFileUrl(o.source.input.from) : this.toUrl(this.path(o.source.input.from)); } toBase64(o) { return Buffer ? Buffer.from(o).toString("base64") : window.btoa(unescape(encodeURIComponent(o))); } toFileUrl(o) { let v = this.memoizedFileURLs.get(o); if (v) return v; if (s) { let g = s(o).toString(); return this.memoizedFileURLs.set(o, g), g; } else throw new Error( "`map.absolute` option is not available in this PostCSS build" ); } toUrl(o) { let v = this.memoizedURLs.get(o); if (v) return v; p === "\\" && (o = o.replace(/\\/g, "/")); let g = encodeURI(o).replace(/[#?]/g, encodeURIComponent); return this.memoizedURLs.set(o, g), g; } } return Wr = r, Wr; } var Vr, _a; function hu() { if (_a) return Vr; _a = 1; const u = 39, a = 34, h = 92, p = 47, l = 10, f = 32, s = 12, c = 9, t = 13, e = 91, r = 93, i = 40, o = 41, v = 123, g = 125, n = 59, d = 42, _ = 58, w = 64, y = /[\t\n\f\r "#'()/;[\\\]{}]/g, x = /[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g, m = /.[\r\n"'(/\\]/, O = /[\da-f]/i; return Vr = function(E, b = {}) { let k = E.css.valueOf(), q = b.ignoreErrors, M, W, S, P, C, R, $, B, z, L, F = k.length, D = 0, I = [], N = []; function J() { return D; } function T(V) { throw E.error("Unclosed " + V, D); } function U() { return N.length === 0 && D >= F; } function j(V) { if (N.length) return N.pop(); if (D >= F) return; let K = V ? V.ignoreUnclosed : !1; switch (M = k.charCodeAt(D), M) { case l: case f: case c: case t: case s: { P = D; do P += 1, M = k.charCodeAt(P); while (M === f || M === l || M === c || M === t || M === s); R = ["space", k.slice(D, P)], D = P - 1; break; } case e: case r: case v: case g: case _: case n: case o: { let X = String.fromCharCode(M); R = [X, X, D]; break; } case i: { if (L = I.length ? I.pop()[1] : "", z = k.charCodeAt(D + 1), L === "url" && z !== u && z !== a && z !== f && z !== l && z !== c && z !== s && z !== t) { P = D; do { if ($ = !1, P = k.indexOf(")", P + 1), P === -1) if (q || K) { P = D; break; } else T("bracket"); for (B = P; k.charCodeAt(B - 1) === h; ) B -= 1, $ = !$; } while ($); R = ["brackets", k.slice(D, P + 1), D, P], D = P; } else P = k.indexOf(")", D + 1), W = k.slice(D, P + 1), P === -1 || m.test(W) ? R = ["(", "(", D] : (R = ["brackets", W, D, P], D = P); break; } case u: case a: { C = M === u ? "'" : '"', P = D; do { if ($ = !1, P = k.indexOf(C, P + 1), P === -1) if (q || K) { P = D + 1; break; } else T("string"); for (B = P; k.charCodeAt(B - 1) === h; ) B -= 1, $ = !$; } while ($); R = ["string", k.slice(D, P + 1), D, P], D = P; break; } case w: { y.lastIndex = D + 1, y.test(k), y.lastIndex === 0 ? P = k.length - 1 : P = y.lastIndex - 2, R = ["at-word", k.slice(D, P + 1), D, P], D = P; break; } case h: { for (P = D, S = !0; k.charCodeAt(P + 1) === h; ) P += 1, S = !S; if (M = k.charCodeAt(P + 1), S && M !== p && M !== f && M !== l && M !== c && M !== t && M !== s && (P += 1, O.test(k.charAt(P)))) { for (; O.test(k.charAt(P + 1)); ) P += 1; k.charCodeAt(P + 1) === f && (P += 1); } R = ["word", k.slice(D, P + 1), D, P], D = P; break; } default: { M === p && k.charCodeAt(D + 1) === d ? (P = k.indexOf("*/", D + 2) + 1, P === 0 && (q || K ? P = k.length : T("comment")), R = ["comment", k.slice(D, P + 1), D, P], D = P) : (x.lastIndex = D + 1, x.test(k), x.lastIndex === 0 ? P = k.length - 1 : P = x.lastIndex - 2, R = ["word", k.slice(D, P + 1), D, P], I.push(R), D = P); break; } } return D++, R; } function H(V) { N.push(V); } return { back: H, endOfFile: U, nextToken: j, position: J }; }, Vr; } var jr, Sa; function vu() { if (Sa) return jr; Sa = 1; let u = Ii(), a = fr(), h = cr(), p = lt(), l = Di(), f = hu(); const s = { empty: !0, space: !0 }; function c(e) { for (let r = e.length - 1; r >= 0; r--) { let i = e[r], o = i[3] || i[2]; if (o) return o; } } class t { constructor(r) { this.input = r, this.root = new p(), this.current = this.root, this.spaces = "", this.semicolon = !1, this.createTokenizer(), this.root.source = { input: r, start: { column: 1, line: 1, offset: 0 } }; } atrule(r) { let i = new u(); i.name = r[1].slice(1), i.name === "" && this.unnamedAtrule(i, r), this.init(i, r[2]); let o, v, g, n = !1, d = !1, _ = [], w = [];