UNPKG

eldav1d-marvel-ui

Version:

UI library for (and from) Playing with Marvel API

989 lines (986 loc) 33 kB
import { jsx as De } from "react/jsx-runtime"; import * as I from "react"; import { forwardRef as Ve, useContext as Le, useMemo as Me } from "react"; function Fe(e) { if (e.sheet) return e.sheet; for (var r = 0; r < document.styleSheets.length; r++) if (document.styleSheets[r].ownerNode === e) return document.styleSheets[r]; } function ze(e) { var r = document.createElement("style"); return r.setAttribute("data-emotion", e.key), e.nonce !== void 0 && r.setAttribute("nonce", e.nonce), r.appendChild(document.createTextNode("")), r.setAttribute("data-s", ""), r; } var We = /* @__PURE__ */ function() { function e(n) { var t = this; this._insertTag = function(a) { var s; t.tags.length === 0 ? t.insertionPoint ? s = t.insertionPoint.nextSibling : t.prepend ? s = t.container.firstChild : s = t.before : s = t.tags[t.tags.length - 1].nextSibling, t.container.insertBefore(a, s), t.tags.push(a); }, this.isSpeedy = n.speedy === void 0 ? process.env.NODE_ENV === "production" : n.speedy, this.tags = [], this.ctr = 0, this.nonce = n.nonce, this.key = n.key, this.container = n.container, this.prepend = n.prepend, this.insertionPoint = n.insertionPoint, this.before = null; } var r = e.prototype; return r.hydrate = function(t) { t.forEach(this._insertTag); }, r.insert = function(t) { this.ctr % (this.isSpeedy ? 65e3 : 1) === 0 && this._insertTag(ze(this)); var a = this.tags[this.tags.length - 1]; if (process.env.NODE_ENV !== "production") { var s = t.charCodeAt(0) === 64 && t.charCodeAt(1) === 105; s && this._alreadyInsertedOrderInsensitiveRule && console.error(`You're attempting to insert the following rule: ` + t + "\n\n`@import` rules must be before all other types of rules in a stylesheet but other rules have already been inserted. Please ensure that `@import` rules are before all other rules."), this._alreadyInsertedOrderInsensitiveRule = this._alreadyInsertedOrderInsensitiveRule || !s; } if (this.isSpeedy) { var i = Fe(a); try { i.insertRule(t, i.cssRules.length); } catch (o) { process.env.NODE_ENV !== "production" && !/:(-moz-placeholder|-moz-focus-inner|-moz-focusring|-ms-input-placeholder|-moz-read-write|-moz-read-only|-ms-clear|-ms-expand|-ms-reveal){/.test(t) && console.error('There was a problem inserting the following rule: "' + t + '"', o); } } else a.appendChild(document.createTextNode(t)); this.ctr++; }, r.flush = function() { this.tags.forEach(function(t) { return t.parentNode && t.parentNode.removeChild(t); }), this.tags = [], this.ctr = 0, process.env.NODE_ENV !== "production" && (this._alreadyInsertedOrderInsensitiveRule = !1); }, e; }(), b = "-ms-", B = "-moz-", f = "-webkit-", te = "comm", ae = "rule", se = "decl", Ye = "@import", Ee = "@keyframes", Ue = "@layer", je = Math.abs, Z = String.fromCharCode, qe = Object.assign; function Ge(e, r) { return E(e, 0) ^ 45 ? (((r << 2 ^ E(e, 0)) << 2 ^ E(e, 1)) << 2 ^ E(e, 2)) << 2 ^ E(e, 3) : 0; } function be(e) { return e.trim(); } function Be(e, r) { return (e = r.exec(e)) ? e[0] : e; } function u(e, r, n) { return e.replace(r, n); } function X(e, r) { return e.indexOf(r); } function E(e, r) { return e.charCodeAt(r) | 0; } function F(e, r, n) { return e.slice(r, n); } function R(e) { return e.length; } function ie(e) { return e.length; } function U(e, r) { return r.push(e), e; } function Ke(e, r) { return e.map(r).join(""); } var H = 1, D = 1, we = 0, O = 0, g = 0, V = ""; function J(e, r, n, t, a, s, i) { return { value: e, root: r, parent: n, type: t, props: a, children: s, line: H, column: D, length: i, return: "" }; } function M(e, r) { return qe(J("", null, null, "", null, null, 0), e, { length: -e.length }, r); } function Ze() { return g; } function He() { return g = O > 0 ? E(V, --O) : 0, D--, g === 10 && (D = 1, H--), g; } function S() { return g = O < we ? E(V, O++) : 0, D++, g === 10 && (D = 1, H++), g; } function $() { return E(V, O); } function j() { return O; } function Y(e, r) { return F(V, e, r); } function z(e) { switch (e) { case 0: case 9: case 10: case 13: case 32: return 5; case 33: case 43: case 44: case 47: case 62: case 64: case 126: case 59: case 123: case 125: return 4; case 58: return 3; case 34: case 39: case 40: case 91: return 2; case 41: case 93: return 1; } return 0; } function Ne(e) { return H = D = 1, we = R(V = e), O = 0, []; } function xe(e) { return V = "", e; } function q(e) { return be(Y(O - 1, ee(e === 91 ? e + 2 : e === 40 ? e + 1 : e))); } function Je(e) { for (; (g = $()) && g < 33; ) S(); return z(e) > 2 || z(g) > 3 ? "" : " "; } function Qe(e, r) { for (; --r && S() && !(g < 48 || g > 102 || g > 57 && g < 65 || g > 70 && g < 97); ) ; return Y(e, j() + (r < 6 && $() == 32 && S() == 32)); } function ee(e) { for (; S(); ) switch (g) { case e: return O; case 34: case 39: e !== 34 && e !== 39 && ee(g); break; case 40: e === 41 && ee(e); break; case 92: S(); break; } return O; } function Xe(e, r) { for (; S() && e + g !== 57; ) if (e + g === 84 && $() === 47) break; return "/*" + Y(r, O - 1) + "*" + Z(e === 47 ? e : S()); } function er(e) { for (; !z($()); ) S(); return Y(e, O); } function rr(e) { return xe(G("", null, null, null, [""], e = Ne(e), 0, [0], e)); } function G(e, r, n, t, a, s, i, o, l) { for (var h = 0, c = 0, v = i, w = 0, C = 0, N = 0, d = 1, x = 1, m = 1, y = 0, k = "", L = a, P = s, A = t, p = k; x; ) switch (N = y, y = S()) { case 40: if (N != 108 && E(p, v - 1) == 58) { X(p += u(q(y), "&", "&\f"), "&\f") != -1 && (m = -1); break; } case 34: case 39: case 91: p += q(y); break; case 9: case 10: case 13: case 32: p += Je(N); break; case 92: p += Qe(j() - 1, 7); continue; case 47: switch ($()) { case 42: case 47: U(nr(Xe(S(), j()), r, n), l); break; default: p += "/"; } break; case 123 * d: o[h++] = R(p) * m; case 125 * d: case 59: case 0: switch (y) { case 0: case 125: x = 0; case 59 + c: m == -1 && (p = u(p, /\f/g, "")), C > 0 && R(p) - v && U(C > 32 ? ue(p + ";", t, n, v - 1) : ue(u(p, " ", "") + ";", t, n, v - 2), l); break; case 59: p += ";"; default: if (U(A = fe(p, r, n, h, c, a, o, k, L = [], P = [], v), s), y === 123) if (c === 0) G(p, r, A, A, L, s, v, o, P); else switch (w === 99 && E(p, 3) === 110 ? 100 : w) { case 100: case 108: case 109: case 115: G(e, A, A, t && U(fe(e, A, A, 0, 0, a, o, k, a, L = [], v), P), a, P, v, o, t ? L : P); break; default: G(p, A, A, A, [""], P, 0, o, P); } } h = c = C = 0, d = m = 1, k = p = "", v = i; break; case 58: v = 1 + R(p), C = N; default: if (d < 1) { if (y == 123) --d; else if (y == 125 && d++ == 0 && He() == 125) continue; } switch (p += Z(y), y * d) { case 38: m = c > 0 ? 1 : (p += "\f", -1); break; case 44: o[h++] = (R(p) - 1) * m, m = 1; break; case 64: $() === 45 && (p += q(S())), w = $(), c = v = R(k = p += er(j())), y++; break; case 45: N === 45 && R(p) == 2 && (d = 0); } } return s; } function fe(e, r, n, t, a, s, i, o, l, h, c) { for (var v = a - 1, w = a === 0 ? s : [""], C = ie(w), N = 0, d = 0, x = 0; N < t; ++N) for (var m = 0, y = F(e, v + 1, v = je(d = i[N])), k = e; m < C; ++m) (k = be(d > 0 ? w[m] + " " + y : u(y, /&\f/g, w[m]))) && (l[x++] = k); return J(e, r, n, a === 0 ? ae : o, l, h, c); } function nr(e, r, n) { return J(e, r, n, te, Z(Ze()), F(e, 2, -2), 0); } function ue(e, r, n, t) { return J(e, r, n, se, F(e, 0, t), F(e, t + 1, -1), t); } function T(e, r) { for (var n = "", t = ie(e), a = 0; a < t; a++) n += r(e[a], a, e, r) || ""; return n; } function tr(e, r, n, t) { switch (e.type) { case Ue: if (e.children.length) break; case Ye: case se: return e.return = e.return || e.value; case te: return ""; case Ee: return e.return = e.value + "{" + T(e.children, t) + "}"; case ae: e.value = e.props.join(","); } return R(n = T(e.children, t)) ? e.return = e.value + "{" + n + "}" : ""; } function ar(e) { var r = ie(e); return function(n, t, a, s) { for (var i = "", o = 0; o < r; o++) i += e[o](n, t, a, s) || ""; return i; }; } function sr(e) { return function(r) { r.root || (r = r.return) && e(r); }; } function ir(e) { var r = /* @__PURE__ */ Object.create(null); return function(n) { return r[n] === void 0 && (r[n] = e(n)), r[n]; }; } var or = function(r, n, t) { for (var a = 0, s = 0; a = s, s = $(), a === 38 && s === 12 && (n[t] = 1), !z(s); ) S(); return Y(r, O); }, cr = function(r, n) { var t = -1, a = 44; do switch (z(a)) { case 0: a === 38 && $() === 12 && (n[t] = 1), r[t] += or(O - 1, n, t); break; case 2: r[t] += q(a); break; case 4: if (a === 44) { r[++t] = $() === 58 ? "&\f" : "", n[t] = r[t].length; break; } default: r[t] += Z(a); } while (a = S()); return r; }, fr = function(r, n) { return xe(cr(Ne(r), n)); }, le = /* @__PURE__ */ new WeakMap(), ur = function(r) { if (!(r.type !== "rule" || !r.parent || // positive .length indicates that this rule contains pseudo // negative .length indicates that this rule has been already prefixed r.length < 1)) { for (var n = r.value, t = r.parent, a = r.column === t.column && r.line === t.line; t.type !== "rule"; ) if (t = t.parent, !t) return; if (!(r.props.length === 1 && n.charCodeAt(0) !== 58 && !le.get(t)) && !a) { le.set(r, !0); for (var s = [], i = fr(n, s), o = t.props, l = 0, h = 0; l < i.length; l++) for (var c = 0; c < o.length; c++, h++) r.props[h] = s[l] ? i[l].replace(/&\f/g, o[c]) : o[c] + " " + i[l]; } } }, lr = function(r) { if (r.type === "decl") { var n = r.value; // charcode for l n.charCodeAt(0) === 108 && // charcode for b n.charCodeAt(2) === 98 && (r.return = "", r.value = ""); } }, dr = "emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason", hr = function(r) { return r.type === "comm" && r.children.indexOf(dr) > -1; }, pr = function(r) { return function(n, t, a) { if (!(n.type !== "rule" || r.compat)) { var s = n.value.match(/(:first|:nth|:nth-last)-child/g); if (s) { for (var i = !!n.parent, o = i ? n.parent.children : ( // global rule at the root level a ), l = o.length - 1; l >= 0; l--) { var h = o[l]; if (h.line < n.line) break; if (h.column < n.column) { if (hr(h)) return; break; } } s.forEach(function(c) { console.error('The pseudo class "' + c + '" is potentially unsafe when doing server-side rendering. Try changing it to "' + c.split("-child")[0] + '-of-type".'); }); } } }; }, Oe = function(r) { return r.type.charCodeAt(1) === 105 && r.type.charCodeAt(0) === 64; }, mr = function(r, n) { for (var t = r - 1; t >= 0; t--) if (!Oe(n[t])) return !0; return !1; }, de = function(r) { r.type = "", r.value = "", r.return = "", r.children = "", r.props = ""; }, vr = function(r, n, t) { Oe(r) && (r.parent ? (console.error("`@import` rules can't be nested inside other rules. Please move it to the top level and put it before regular rules. Keep in mind that they can only be used within global styles."), de(r)) : mr(n, t) && (console.error("`@import` rules can't be after other rules. Please put your `@import` rules before your other rules."), de(r))); }; function Se(e, r) { switch (Ge(e, r)) { case 5103: return f + "print-" + e + e; case 5737: case 4201: case 3177: case 3433: case 1641: case 4457: case 2921: case 5572: case 6356: case 5844: case 3191: case 6645: case 3005: case 6391: case 5879: case 5623: case 6135: case 4599: case 4855: case 4215: case 6389: case 5109: case 5365: case 5621: case 3829: return f + e + e; case 5349: case 4246: case 4810: case 6968: case 2756: return f + e + B + e + b + e + e; case 6828: case 4268: return f + e + b + e + e; case 6165: return f + e + b + "flex-" + e + e; case 5187: return f + e + u(e, /(\w+).+(:[^]+)/, f + "box-$1$2" + b + "flex-$1$2") + e; case 5443: return f + e + b + "flex-item-" + u(e, /flex-|-self/, "") + e; case 4675: return f + e + b + "flex-line-pack" + u(e, /align-content|flex-|-self/, "") + e; case 5548: return f + e + b + u(e, "shrink", "negative") + e; case 5292: return f + e + b + u(e, "basis", "preferred-size") + e; case 6060: return f + "box-" + u(e, "-grow", "") + f + e + b + u(e, "grow", "positive") + e; case 4554: return f + u(e, /([^-])(transform)/g, "$1" + f + "$2") + e; case 6187: return u(u(u(e, /(zoom-|grab)/, f + "$1"), /(image-set)/, f + "$1"), e, "") + e; case 5495: case 3959: return u(e, /(image-set\([^]*)/, f + "$1$`$1"); case 4968: return u(u(e, /(.+:)(flex-)?(.*)/, f + "box-pack:$3" + b + "flex-pack:$3"), /s.+-b[^;]+/, "justify") + f + e + e; case 4095: case 3583: case 4068: case 2532: return u(e, /(.+)-inline(.+)/, f + "$1$2") + e; case 8116: case 7059: case 5753: case 5535: case 5445: case 5701: case 4933: case 4677: case 5533: case 5789: case 5021: case 4765: if (R(e) - 1 - r > 6) switch (E(e, r + 1)) { case 109: if (E(e, r + 4) !== 45) break; case 102: return u(e, /(.+:)(.+)-([^]+)/, "$1" + f + "$2-$3$1" + B + (E(e, r + 3) == 108 ? "$3" : "$2-$3")) + e; case 115: return ~X(e, "stretch") ? Se(u(e, "stretch", "fill-available"), r) + e : e; } break; case 4949: if (E(e, r + 1) !== 115) break; case 6444: switch (E(e, R(e) - 3 - (~X(e, "!important") && 10))) { case 107: return u(e, ":", ":" + f) + e; case 101: return u(e, /(.+:)([^;!]+)(;|!.+)?/, "$1" + f + (E(e, 14) === 45 ? "inline-" : "") + "box$3$1" + f + "$2$3$1" + b + "$2box$3") + e; } break; case 5936: switch (E(e, r + 11)) { case 114: return f + e + b + u(e, /[svh]\w+-[tblr]{2}/, "tb") + e; case 108: return f + e + b + u(e, /[svh]\w+-[tblr]{2}/, "tb-rl") + e; case 45: return f + e + b + u(e, /[svh]\w+-[tblr]{2}/, "lr") + e; } return f + e + b + e + e; } return e; } var gr = function(r, n, t, a) { if (r.length > -1 && !r.return) switch (r.type) { case se: r.return = Se(r.value, r.length); break; case Ee: return T([M(r, { value: u(r.value, "@", "@" + f) })], a); case ae: if (r.length) return Ke(r.props, function(s) { switch (Be(s, /(::plac\w+|:read-\w+)/)) { case ":read-only": case ":read-write": return T([M(r, { props: [u(s, /:(read-\w+)/, ":" + B + "$1")] })], a); case "::placeholder": return T([M(r, { props: [u(s, /:(plac\w+)/, ":" + f + "input-$1")] }), M(r, { props: [u(s, /:(plac\w+)/, ":" + B + "$1")] }), M(r, { props: [u(s, /:(plac\w+)/, b + "input-$1")] })], a); } return ""; }); } }, yr = [gr], Ce = function(r) { var n = r.key; if (process.env.NODE_ENV !== "production" && !n) throw new Error(`You have to configure \`key\` for your cache. Please make sure it's unique (and not equal to 'css') as it's used for linking styles to your cache. If multiple caches share the same key they might "fight" for each other's style elements.`); if (n === "css") { var t = document.querySelectorAll("style[data-emotion]:not([data-s])"); Array.prototype.forEach.call(t, function(d) { var x = d.getAttribute("data-emotion"); x.indexOf(" ") !== -1 && (document.head.appendChild(d), d.setAttribute("data-s", "")); }); } var a = r.stylisPlugins || yr; if (process.env.NODE_ENV !== "production" && /[^a-z-]/.test(n)) throw new Error('Emotion key must only contain lower case alphabetical characters and - but "' + n + '" was passed'); var s = {}, i, o = []; i = r.container || document.head, Array.prototype.forEach.call( // this means we will ignore elements which don't have a space in them which // means that the style elements we're looking at are only Emotion 11 server-rendered style elements document.querySelectorAll('style[data-emotion^="' + n + ' "]'), function(d) { for (var x = d.getAttribute("data-emotion").split(" "), m = 1; m < x.length; m++) s[x[m]] = !0; o.push(d); } ); var l, h = [ur, lr]; process.env.NODE_ENV !== "production" && h.push(pr({ get compat() { return N.compat; } }), vr); { var c, v = [tr, process.env.NODE_ENV !== "production" ? function(d) { d.root || (d.return ? c.insert(d.return) : d.value && d.type !== te && c.insert(d.value + "{}")); } : sr(function(d) { c.insert(d); })], w = ar(h.concat(a, v)), C = function(x) { return T(rr(x), w); }; l = function(x, m, y, k) { c = y, process.env.NODE_ENV !== "production" && m.map !== void 0 && (c = { insert: function(P) { y.insert(P + m.map); } }), C(x ? x + "{" + m.styles + "}" : m.styles), k && (N.inserted[m.name] = !0); }; } var N = { key: n, sheet: new We({ key: n, container: i, nonce: r.nonce, speedy: r.speedy, prepend: r.prepend, insertionPoint: r.insertionPoint }), nonce: r.nonce, inserted: s, registered: {}, insert: l }; return N.sheet.hydrate(o), N; }, Er = !0; function br(e, r, n) { var t = ""; return n.split(" ").forEach(function(a) { e[a] !== void 0 ? r.push(e[a] + ";") : t += a + " "; }), t; } var _e = function(r, n, t) { var a = r.key + "-" + n.name; // we only need to add the styles to the registered cache if the // class name could be used further down // the tree but if it's a string tag, we know it won't // so we don't have to add it to registered cache. // this improves memory usage since we can avoid storing the whole style string (t === !1 || // we need to always store it if we're in compat mode and // in node since emotion-server relies on whether a style is in // the registered cache to know whether a style is global or not // also, note that this check will be dead code eliminated in the browser Er === !1) && r.registered[a] === void 0 && (r.registered[a] = n.styles); }, wr = function(r, n, t) { _e(r, n, t); var a = r.key + "-" + n.name; if (r.inserted[n.name] === void 0) { var s = n; do r.insert(n === s ? "." + a : "", s, r.sheet, !0), s = s.next; while (s !== void 0); } }; function Nr(e) { for (var r = 0, n, t = 0, a = e.length; a >= 4; ++t, a -= 4) n = e.charCodeAt(t) & 255 | (e.charCodeAt(++t) & 255) << 8 | (e.charCodeAt(++t) & 255) << 16 | (e.charCodeAt(++t) & 255) << 24, n = /* Math.imul(k, m): */ (n & 65535) * 1540483477 + ((n >>> 16) * 59797 << 16), n ^= /* k >>> r: */ n >>> 24, r = /* Math.imul(k, m): */ (n & 65535) * 1540483477 + ((n >>> 16) * 59797 << 16) ^ /* Math.imul(h, m): */ (r & 65535) * 1540483477 + ((r >>> 16) * 59797 << 16); switch (a) { case 3: r ^= (e.charCodeAt(t + 2) & 255) << 16; case 2: r ^= (e.charCodeAt(t + 1) & 255) << 8; case 1: r ^= e.charCodeAt(t) & 255, r = /* Math.imul(h, m): */ (r & 65535) * 1540483477 + ((r >>> 16) * 59797 << 16); } return r ^= r >>> 13, r = /* Math.imul(h, m): */ (r & 65535) * 1540483477 + ((r >>> 16) * 59797 << 16), ((r ^ r >>> 15) >>> 0).toString(36); } var xr = { animationIterationCount: 1, aspectRatio: 1, borderImageOutset: 1, borderImageSlice: 1, borderImageWidth: 1, boxFlex: 1, boxFlexGroup: 1, boxOrdinalGroup: 1, columnCount: 1, columns: 1, flex: 1, flexGrow: 1, flexPositive: 1, flexShrink: 1, flexNegative: 1, flexOrder: 1, gridRow: 1, gridRowEnd: 1, gridRowSpan: 1, gridRowStart: 1, gridColumn: 1, gridColumnEnd: 1, gridColumnSpan: 1, gridColumnStart: 1, msGridRow: 1, msGridRowSpan: 1, msGridColumn: 1, msGridColumnSpan: 1, fontWeight: 1, lineHeight: 1, opacity: 1, order: 1, orphans: 1, tabSize: 1, widows: 1, zIndex: 1, zoom: 1, WebkitLineClamp: 1, // SVG-related properties fillOpacity: 1, floodOpacity: 1, stopOpacity: 1, strokeDasharray: 1, strokeDashoffset: 1, strokeMiterlimit: 1, strokeOpacity: 1, strokeWidth: 1 }, he = `You have illegal escape sequence in your template literal, most likely inside content's property value. Because you write your CSS inside a JavaScript string you actually have to do double escaping, so for example "content: '\\00d7';" should become "content: '\\\\00d7';". You can read more about this here: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences`, Or = "You have passed in falsy value as style object's key (can happen when in example you pass unexported component as computed key).", Sr = /[A-Z]|^ms/g, ke = /_EMO_([^_]+?)_([^]*?)_EMO_/g, oe = function(r) { return r.charCodeAt(1) === 45; }, pe = function(r) { return r != null && typeof r != "boolean"; }, Q = /* @__PURE__ */ ir(function(e) { return oe(e) ? e : e.replace(Sr, "-$&").toLowerCase(); }), K = function(r, n) { switch (r) { case "animation": case "animationName": if (typeof n == "string") return n.replace(ke, function(t, a, s) { return _ = { name: a, styles: s, next: _ }, a; }); } return xr[r] !== 1 && !oe(r) && typeof n == "number" && n !== 0 ? n + "px" : n; }; if (process.env.NODE_ENV !== "production") { var Cr = /(var|attr|counters?|url|element|(((repeating-)?(linear|radial))|conic)-gradient)\(|(no-)?(open|close)-quote/, _r = ["normal", "none", "initial", "inherit", "unset"], kr = K, Ar = /^-ms-/, Rr = /-(.)/g, me = {}; K = function(r, n) { if (r === "content" && (typeof n != "string" || _r.indexOf(n) === -1 && !Cr.test(n) && (n.charAt(0) !== n.charAt(n.length - 1) || n.charAt(0) !== '"' && n.charAt(0) !== "'"))) throw new Error("You seem to be using a value for 'content' without quotes, try replacing it with `content: '\"" + n + "\"'`"); var t = kr(r, n); return t !== "" && !oe(r) && r.indexOf("-") !== -1 && me[r] === void 0 && (me[r] = !0, console.error("Using kebab-case for css properties in objects is not supported. Did you mean " + r.replace(Ar, "ms-").replace(Rr, function(a, s) { return s.toUpperCase(); }) + "?")), t; }; } var Ae = "Component selectors can only be used in conjunction with @emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware compiler transform."; function W(e, r, n) { if (n == null) return ""; if (n.__emotion_styles !== void 0) { if (process.env.NODE_ENV !== "production" && n.toString() === "NO_COMPONENT_SELECTOR") throw new Error(Ae); return n; } switch (typeof n) { case "boolean": return ""; case "object": { if (n.anim === 1) return _ = { name: n.name, styles: n.styles, next: _ }, n.name; if (n.styles !== void 0) { var t = n.next; if (t !== void 0) for (; t !== void 0; ) _ = { name: t.name, styles: t.styles, next: _ }, t = t.next; var a = n.styles + ";"; return process.env.NODE_ENV !== "production" && n.map !== void 0 && (a += n.map), a; } return Ir(e, r, n); } case "function": { if (e !== void 0) { var s = _, i = n(e); return _ = s, W(e, r, i); } else process.env.NODE_ENV !== "production" && console.error("Functions that are interpolated in css calls will be stringified.\nIf you want to have a css call based on props, create a function that returns a css call like this\nlet dynamicStyle = (props) => css`color: ${props.color}`\nIt can be called directly with props or interpolated in a styled call like this\nlet SomeComponent = styled('div')`${dynamicStyle}`"); break; } case "string": if (process.env.NODE_ENV !== "production") { var o = [], l = n.replace(ke, function(c, v, w) { var C = "animation" + o.length; return o.push("const " + C + " = keyframes`" + w.replace(/^@keyframes animation-\w+/, "") + "`"), "${" + C + "}"; }); o.length && console.error("`keyframes` output got interpolated into plain string, please wrap it with `css`.\n\nInstead of doing this:\n\n" + [].concat(o, ["`" + l + "`"]).join(` `) + ` You should wrap it with \`css\` like this: ` + ("css`" + l + "`")); } break; } if (r == null) return n; var h = r[n]; return h !== void 0 ? h : n; } function Ir(e, r, n) { var t = ""; if (Array.isArray(n)) for (var a = 0; a < n.length; a++) t += W(e, r, n[a]) + ";"; else for (var s in n) { var i = n[s]; if (typeof i != "object") r != null && r[i] !== void 0 ? t += s + "{" + r[i] + "}" : pe(i) && (t += Q(s) + ":" + K(s, i) + ";"); else { if (s === "NO_COMPONENT_SELECTOR" && process.env.NODE_ENV !== "production") throw new Error(Ae); if (Array.isArray(i) && typeof i[0] == "string" && (r == null || r[i[0]] === void 0)) for (var o = 0; o < i.length; o++) pe(i[o]) && (t += Q(s) + ":" + K(s, i[o]) + ";"); else { var l = W(e, r, i); switch (s) { case "animation": case "animationName": { t += Q(s) + ":" + l + ";"; break; } default: process.env.NODE_ENV !== "production" && s === "undefined" && console.error(Or), t += s + "{" + l + "}"; } } } } return t; } var ve = /label:\s*([^\s;\n{]+)\s*(;|$)/g, Re; process.env.NODE_ENV !== "production" && (Re = /\/\*#\ssourceMappingURL=data:application\/json;\S+\s+\*\//g); var _, ge = function(r, n, t) { if (r.length === 1 && typeof r[0] == "object" && r[0] !== null && r[0].styles !== void 0) return r[0]; var a = !0, s = ""; _ = void 0; var i = r[0]; i == null || i.raw === void 0 ? (a = !1, s += W(t, n, i)) : (process.env.NODE_ENV !== "production" && i[0] === void 0 && console.error(he), s += i[0]); for (var o = 1; o < r.length; o++) s += W(t, n, r[o]), a && (process.env.NODE_ENV !== "production" && i[o] === void 0 && console.error(he), s += i[o]); var l; process.env.NODE_ENV !== "production" && (s = s.replace(Re, function(w) { return l = w, ""; })), ve.lastIndex = 0; for (var h = "", c; (c = ve.exec(s)) !== null; ) h += "-" + // $FlowFixMe we know it's not null c[1]; var v = Nr(s) + h; return process.env.NODE_ENV !== "production" ? { name: v, styles: s, map: l, next: _, toString: function() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } } : { name: v, styles: s, next: _ }; }, $r = function(r) { return r(); }, Ie = I.useInsertionEffect ? I.useInsertionEffect : !1, Pr = Ie || $r, Ur = Ie || I.useLayoutEffect, $e = {}.hasOwnProperty, ce = /* @__PURE__ */ I.createContext( // we're doing this to avoid preconstruct's dead code elimination in this one case // because this module is primarily intended for the browser and node // but it's also required in react native and similar environments sometimes // and we could have a special build just for that // but this is much easier and the native packages // might use a different theme context in the future anyway typeof HTMLElement < "u" ? /* @__PURE__ */ Ce({ key: "css" }) : null ); process.env.NODE_ENV !== "production" && (ce.displayName = "EmotionCacheContext"); var Tr = ce.Provider, Dr = function(r) { return /* @__PURE__ */ Ve(function(n, t) { var a = Le(ce); return r(n, a, t); }); }, Pe = /* @__PURE__ */ I.createContext({}); process.env.NODE_ENV !== "production" && (Pe.displayName = "EmotionThemeContext"); var ye = function(r) { var n = r.split("."); return n[n.length - 1]; }, Vr = function(r) { var n = /^\s+at\s+([A-Za-z0-9$.]+)\s/.exec(r); if (n || (n = /^([A-Za-z0-9$.]+)@/.exec(r), n)) return ye(n[1]); }, Lr = /* @__PURE__ */ new Set(["renderWithHooks", "processChild", "finishClassComponent", "renderToString"]), Mr = function(r) { return r.replace(/\$/g, "-"); }, Fr = function(r) { if (r) for (var n = r.split(` `), t = 0; t < n.length; t++) { var a = Vr(n[t]); if (a) { if (Lr.has(a)) break; if (/^[A-Z]/.test(a)) return Mr(a); } } }, re = "__EMOTION_TYPE_PLEASE_DO_NOT_USE__", ne = "__EMOTION_LABEL_PLEASE_DO_NOT_USE__", jr = function(r, n) { if (process.env.NODE_ENV !== "production" && typeof n.css == "string" && // check if there is a css declaration n.css.indexOf(":") !== -1) throw new Error("Strings are not allowed as css prop values, please wrap it in a css template literal from '@emotion/react' like this: css`" + n.css + "`"); var t = {}; for (var a in n) $e.call(n, a) && (t[a] = n[a]); if (t[re] = r, process.env.NODE_ENV !== "production" && n.css && (typeof n.css != "object" || typeof n.css.name != "string" || n.css.name.indexOf("-") === -1)) { var s = Fr(new Error().stack); s && (t[ne] = s); } return t; }, zr = function(r) { var n = r.cache, t = r.serialized, a = r.isStringTag; return _e(n, t, a), Pr(function() { return wr(n, t, a); }), null; }, Te = /* @__PURE__ */ Dr(function(e, r, n) { var t = e.css; typeof t == "string" && r.registered[t] !== void 0 && (t = r.registered[t]); var a = e[re], s = [t], i = ""; typeof e.className == "string" ? i = br(r.registered, s, e.className) : e.className != null && (i = e.className + " "); var o = ge(s, void 0, I.useContext(Pe)); if (process.env.NODE_ENV !== "production" && o.name.indexOf("-") === -1) { var l = e[ne]; l && (o = ge([o, "label:" + l + ";"])); } i += r.key + "-" + o.name; var h = {}; for (var c in e) $e.call(e, c) && c !== "css" && c !== re && (process.env.NODE_ENV === "production" || c !== ne) && (h[c] = e[c]); return h.ref = n, h.className = i, /* @__PURE__ */ I.createElement(I.Fragment, null, /* @__PURE__ */ I.createElement(zr, { cache: r, serialized: o, isStringTag: typeof a == "string" }), /* @__PURE__ */ I.createElement(a, h)); }); process.env.NODE_ENV !== "production" && (Te.displayName = "EmotionCssPropInternal"); var qr = Te; const Gr = ({ children: e }) => { const r = document.querySelector("title"); if (!r) throw new Error("No <title> element found in document"); const n = Me(() => Ce({ key: "with-tailwind", insertionPoint: r }), [r]); return De(Tr, { value: n, children: e }); }; export { Gr as E, Pe as T, qr as a, Pr as b, jr as c, br as g, $e as h, wr as i, _e as r, ge as s, Ur as u, Dr as w }; //# sourceMappingURL=EmotionCacheProvider-hWJRBPep.js.map