UNPKG

mongodb-chatbot-ui

Version:

UI React components for the MongoDB Assistant

705 lines (672 loc) 42.3 kB
import M, { useRef as Nn, useEffect as Gn } from "react"; import { w as h, F as o, m as s, X as Tn, P as _n, Y as Mn, d as yn, n as K, a0 as Dn } from "./index2.js"; import { c as X, m as Ce } from "./polished.esm.js"; function e(l, g, f) { return (g = function(p) { var F = function(b, m) { if (typeof b != "object" || !b) return b; var E = b[Symbol.toPrimitive]; if (E !== void 0) { var O = E.call(b, m); if (typeof O != "object") return O; throw new TypeError("@@toPrimitive must return a primitive value."); } return String(b); }(p, "string"); return typeof F == "symbol" ? F : F + ""; }(g)) in l ? Object.defineProperty(l, g, { value: f, enumerable: !0, configurable: !0, writable: !0 }) : l[g] = f, l; } var We, Xe, i = { Disabled: "disabled", Placeholder: "placeholder", Primary: "primary", Secondary: "secondary", Tertiary: "tertiary", InversePrimary: "inversePrimary", InverseSecondary: "inverseSecondary", Info: "info", Warning: "warning", Error: "error", Success: "success", Link: "link", OnError: "onError", OnSuccess: "onSuccess", OnSuccessLink: "onSuccessLink" }, n = { Default: "default", Hover: "hover", Focus: "focus" }, be = o.black, H = o.blue, k = o.gray, I = o.green, G = o.red, Rn = o.white, ne = o.yellow, Cn = { background: e(e(e(e(e(e(e(e({}, i.Primary, e(e(e({}, n.Default, be), n.Hover, k.dark2), n.Focus, H.dark3)), i.Secondary, e(e(e({}, n.Default, k.dark4), n.Hover, k.dark2), n.Focus, H.dark3)), i.InversePrimary, e(e(e({}, n.Default, k.light2), n.Hover, k.light3), n.Focus, H.light2)), i.Info, e(e(e({}, n.Default, H.dark3), n.Hover, H.dark3), n.Focus, H.dark3)), i.Warning, e(e(e({}, n.Default, ne.dark3), n.Hover, ne.dark3), n.Focus, ne.dark3)), i.Success, e(e(e({}, n.Default, I.dark3), n.Hover, I.dark3), n.Focus, I.dark3)), i.Error, e(e(e({}, n.Default, G.dark3), n.Hover, G.dark3), n.Focus, G.dark3)), i.Disabled, e(e(e({}, n.Default, k.dark3), n.Hover, k.dark3), n.Focus, k.dark3)), border: e(e(e(e(e(e(e(e({}, i.Primary, e(e(e({}, n.Default, k.base), n.Hover, k.base), n.Focus, H.light1)), i.Secondary, e(e(e({}, n.Default, k.dark2), n.Hover, k.dark2), n.Focus, H.light1)), i.Tertiary, e(e(e({}, n.Default, k.dark1), n.Hover, k.dark1), n.Focus, H.light1)), i.Success, e(e(e({}, n.Default, I.dark1), n.Hover, I.dark1), n.Focus, H.light1)), i.Error, e(e(e({}, n.Default, G.light1), n.Hover, G.light1), n.Focus, H.light1)), i.OnSuccess, e(e(e({}, n.Default, I.dark2), n.Hover, I.dark2), n.Focus, H.light1)), i.OnError, e(e(e({}, n.Default, G.dark2), n.Hover, G.dark2), n.Focus, H.light1)), i.Disabled, e(e(e({}, n.Default, k.dark2), n.Hover, k.dark2), n.Focus, k.dark2)), icon: e(e(e(e(e(e(e(e({}, i.Primary, e(e(e({}, n.Default, k.light1), n.Hover, k.light3), n.Focus, H.light3)), i.Secondary, e(e(e({}, n.Default, k.base), n.Hover, k.light3), n.Focus, H.light3)), i.InversePrimary, e(e(e({}, n.Default, Rn), n.Hover, be), n.Focus, H.dark2)), i.Info, e(e(e({}, n.Default, H.light1), n.Hover, H.light1), n.Focus, H.light1)), i.Warning, e(e(e({}, n.Default, ne.base), n.Hover, ne.base), n.Focus, ne.base)), i.Success, e(e(e({}, n.Default, I.base), n.Hover, I.base), n.Focus, I.base)), i.Error, e(e(e({}, n.Default, G.light1), n.Hover, G.light1), n.Focus, G.light1)), i.Disabled, e(e(e({}, n.Default, k.dark1), n.Hover, k.dark1), n.Focus, k.dark1)), text: (e(e(e(e(e(e(e(e(e(e(We = {}, i.Primary, e(e(e({}, n.Default, k.light2), n.Hover, k.light2), n.Focus, H.light3)), i.Placeholder, e(e(e({}, n.Default, k.dark1), n.Hover, k.dark1), n.Focus, k.dark1)), i.Secondary, e(e(e({}, n.Default, k.light1), n.Hover, k.light2), n.Focus, H.light3)), i.InversePrimary, e(e(e({}, n.Default, be), n.Hover, be), n.Focus, H.dark2)), i.InverseSecondary, e(e(e({}, n.Default, k.dark2), n.Hover, be), n.Focus, H.dark2)), i.Disabled, e(e(e({}, n.Default, k.dark1), n.Hover, k.dark1), n.Focus, k.dark1)), i.Success, e(e(e({}, n.Default, I.light2), n.Hover, I.light2), n.Focus, I.light2)), i.Error, e(e(e({}, n.Default, G.light1), n.Hover, G.light1), n.Focus, G.light1)), i.OnSuccess, e(e(e({}, n.Default, I.light1), n.Hover, I.light1), n.Focus, I.light1)), i.OnSuccessLink, e(e(e({}, n.Default, I.light3), n.Hover, I.light3), n.Focus, I.light3)), e(e(We, i.OnError, e(e(e({}, n.Default, G.light2), n.Hover, G.light2), n.Focus, G.light2)), i.Link, e(e(e({}, n.Default, H.light1), n.Hover, H.light1), n.Focus, H.light1))) }, ae = o.black, S = o.blue, y = o.gray, L = o.green, j = o.red, oe = o.white, te = o.yellow, Wn = { background: e(e(e(e(e(e(e(e({}, i.Primary, e(e(e({}, n.Default, oe), n.Hover, y.light2), n.Focus, S.light3)), i.Secondary, e(e(e({}, n.Default, y.light3), n.Hover, y.light2), n.Focus, S.light3)), i.InversePrimary, e(e(e({}, n.Default, ae), n.Hover, y.dark3), n.Focus, S.dark2)), i.Info, e(e(e({}, n.Default, S.light3), n.Hover, S.light3), n.Focus, S.light3)), i.Warning, e(e(e({}, n.Default, te.light3), n.Hover, te.light3), n.Focus, te.light3)), i.Success, e(e(e({}, n.Default, L.light3), n.Hover, L.light3), n.Focus, L.light3)), i.Error, e(e(e({}, n.Default, j.light3), n.Hover, j.light3), n.Focus, j.light3)), i.Disabled, e(e(e({}, n.Default, y.light2), n.Hover, y.light2), n.Focus, y.light2)), border: e(e(e(e(e(e(e(e({}, i.Primary, e(e(e({}, n.Default, y.base), n.Hover, y.base), n.Focus, S.light1)), i.Secondary, e(e(e({}, n.Default, y.light2), n.Hover, y.light2), n.Focus, S.light1)), i.Tertiary, e(e(e({}, n.Default, y.light1), n.Hover, y.light1), n.Focus, S.light1)), i.Success, e(e(e({}, n.Default, L.dark1), n.Hover, L.dark1), n.Focus, S.light1)), i.Error, e(e(e({}, n.Default, j.base), n.Hover, j.base), n.Focus, S.light1)), i.Disabled, e(e(e({}, n.Default, y.light1), n.Hover, y.light1), n.Focus, y.light1)), i.OnSuccess, e(e(e({}, n.Default, L.light2), n.Hover, L.light2), n.Focus, L.light2)), i.OnError, e(e(e({}, n.Default, j.light2), n.Hover, j.light2), n.Focus, j.light2)), icon: e(e(e(e(e(e(e(e({}, i.Primary, e(e(e({}, n.Default, y.dark1), n.Hover, ae), n.Focus, S.dark1)), i.Secondary, e(e(e({}, n.Default, y.base), n.Hover, ae), n.Focus, S.dark1)), i.InversePrimary, e(e(e({}, n.Default, oe), n.Hover, oe), n.Focus, S.light2)), i.Info, e(e(e({}, n.Default, S.base), n.Hover, S.base), n.Focus, S.base)), i.Warning, e(e(e({}, n.Default, te.dark2), n.Hover, te.dark2), n.Focus, te.dark2)), i.Success, e(e(e({}, n.Default, L.dark1), n.Hover, L.dark1), n.Focus, L.dark1)), i.Error, e(e(e({}, n.Default, j.base), n.Hover, j.base), n.Focus, j.base)), i.Disabled, e(e(e({}, n.Default, y.base), n.Hover, y.base), n.Focus, y.base)), text: (e(e(e(e(e(e(e(e(e(e(Xe = {}, i.Primary, e(e(e({}, n.Default, ae), n.Hover, ae), n.Focus, S.dark1)), i.Secondary, e(e(e({}, n.Default, y.dark1), n.Hover, ae), n.Focus, S.dark1)), i.InversePrimary, e(e(e({}, n.Default, oe), n.Hover, oe), n.Focus, S.light2)), i.InverseSecondary, e(e(e({}, n.Default, y.light1), n.Hover, oe), n.Focus, S.light2)), i.Disabled, e(e(e({}, n.Default, y.base), n.Hover, y.base), n.Focus, y.base)), i.Success, e(e(e({}, n.Default, L.dark2), n.Hover, L.dark2), n.Focus, L.dark2)), i.Error, e(e(e({}, n.Default, j.base), n.Hover, j.base), n.Focus, j.base)), i.Placeholder, e(e(e({}, n.Default, y.base), n.Hover, y.base), n.Focus, y.base)), i.OnSuccess, e(e(e({}, n.Default, L.dark2), n.Hover, L.dark2), n.Focus, L.dark2)), i.OnSuccessLink, e(e(e({}, n.Default, L.dark3), n.Hover, L.dark3), n.Focus, L.dark3)), e(e(Xe, i.OnError, e(e(e({}, n.Default, j.dark2), n.Hover, j.dark2), n.Focus, j.dark2)), i.Link, e(e(e({}, n.Default, S.base), n.Hover, S.base), n.Focus, S.base))) }; e(e({}, h.Dark, Cn), h.Light, Wn); var Oe = { Dark: "dark", Light: "light" }; e(e({}, Oe.Light, { default: "0 0 0 2px ".concat(o.white, ", 0 0 0 4px ").concat(o.blue.light1), input: "0 0 0 3px ".concat(o.blue.light1) }), Oe.Dark, { default: "0 0 0 2px ".concat(o.black, ", 0 0 0 4px ").concat(o.blue.light1), input: "0 0 0 3px ".concat(o.blue.light1) }); var Xn = { default: "'Euclid Circular A', 'Helvetica Neue', Helvetica, Arial, sans-serif", serif: "'MongoDB Value Serif', 'Times New Roman', serif", code: "'Source Code Pro', Menlo, monospace" }, je = { regular: 400, medium: 500, semiBold: 600, bold: 700 }; e(e({}, Oe.Light, { gray: "0 0 0 3px ".concat(o.gray.light2), green: "0 0 0 3px ".concat(o.green.light2), red: "0 0 0 3px ".concat(o.red.light2) }), Oe.Dark, { gray: "0 0 0 3px ".concat(o.gray.dark2), green: "0 0 0 3px ".concat(o.green.dark3), red: "0 0 0 3px ".concat(o.yellow.dark3) }); var An = o.black, le = o.gray, Yn = o.white; e(e({}, i.Primary, e({}, n.Default, le.base)), i.Secondary, e({}, n.Default, le.dark1)), e(e({}, i.Primary, e({}, n.Default, An)), i.Secondary, e({}, n.Default, le.dark4)), e(e({}, i.Primary, e({}, n.Default, le.base)), i.Secondary, e({}, n.Default, le.light1)), e(e({}, i.Primary, e({}, n.Default, Yn)), i.Secondary, e({}, n.Default, le.light3)); var V = e(e({}, h.Light, { 1: "color-mix(in srgb, ".concat(o.black, " 15%, transparent)"), 2: "color-mix(in srgb, ".concat(o.black, " 20%, transparent)"), 3: "color-mix(in srgb, ".concat(o.black, " 60%, transparent)"), overflow: "color-mix(in srgb, ".concat(o.gray.dark1, " 30%, transparent)") }), h.Dark, { 1: "transparent", 2: "color-mix(in srgb, #000000 45%, transparent)", 3: "color-mix(in srgb, #000000 60%, transparent)", overflow: "color-mix(in srgb, #000000 30%, transparent)" }); e(e({}, h.Light, { 1: "0px 2px 4px 1px ".concat(V[h.Light][1]), 2: "0px 18px 18px -15px ".concat(V[h.Light][2]), 3: "0px 8px 20px -8px ".concat(V[h.Light][3]), overflow: "0px 2px 4px 1px ".concat(V[h.Light].overflow) }), h.Dark, { 1: "unset", 2: "0 18px 18px -15px ".concat(V[h.Dark][2]), 3: "0 8px 20px -8px ".concat(V[h.Dark][3]), overflow: "0px 2px 4px 1px ".concat(V[h.Dark].overflow) }); e(e({}, h.Light, 2), h.Dark, 16); var mn = { faster: 100, default: 150, slower: 300, slowest: 500 }, ve = { Body1: 13, Body2: 16 }, Se = { body1: { fontSize: ve.Body1, lineHeight: 20 }, body2: { fontSize: ve.Body2, lineHeight: 28 }, code1: { fontSize: 13, lineHeight: 20 }, code2: { fontSize: 15, lineHeight: 24 }, disclaimer: { fontSize: 12, lineHeight: 20 }, large: { fontSize: 18, lineHeight: 24 } }; function r(l, g, f) { return (g = function(p) { var F = function(b, m) { if (typeof b != "object" || !b) return b; var E = b[Symbol.toPrimitive]; if (E !== void 0) { var O = E.call(b, m); if (typeof O != "object") return O; throw new TypeError("@@toPrimitive must return a primitive value."); } return String(b); }(p, "string"); return typeof F == "symbol" ? F : F + ""; }(g)) in l ? Object.defineProperty(l, g, { value: f, enumerable: !0, configurable: !0, writable: !0 }) : l[g] = f, l; } var Ae, Ye, c = { Disabled: "disabled", Placeholder: "placeholder", Primary: "primary", Secondary: "secondary", Tertiary: "tertiary", InversePrimary: "inversePrimary", InverseSecondary: "inverseSecondary", Info: "info", Warning: "warning", Error: "error", Success: "success", Link: "link", OnError: "onError", OnSuccess: "onSuccess", OnSuccessLink: "onSuccessLink" }, a = { Default: "default", Hover: "hover", Focus: "focus" }, pe = o.black, w = o.blue, v = o.gray, z = o.green, T = o.red, qn = o.white, ie = o.yellow, Un = { background: r(r(r(r(r(r(r(r({}, c.Primary, r(r(r({}, a.Default, pe), a.Hover, v.dark2), a.Focus, w.dark3)), c.Secondary, r(r(r({}, a.Default, v.dark4), a.Hover, v.dark2), a.Focus, w.dark3)), c.InversePrimary, r(r(r({}, a.Default, v.light2), a.Hover, v.light3), a.Focus, w.light2)), c.Info, r(r(r({}, a.Default, w.dark3), a.Hover, w.dark3), a.Focus, w.dark3)), c.Warning, r(r(r({}, a.Default, ie.dark3), a.Hover, ie.dark3), a.Focus, ie.dark3)), c.Success, r(r(r({}, a.Default, z.dark3), a.Hover, z.dark3), a.Focus, z.dark3)), c.Error, r(r(r({}, a.Default, T.dark3), a.Hover, T.dark3), a.Focus, T.dark3)), c.Disabled, r(r(r({}, a.Default, v.dark3), a.Hover, v.dark3), a.Focus, v.dark3)), border: r(r(r(r(r(r(r(r({}, c.Primary, r(r(r({}, a.Default, v.base), a.Hover, v.base), a.Focus, w.light1)), c.Secondary, r(r(r({}, a.Default, v.dark2), a.Hover, v.dark2), a.Focus, w.light1)), c.Tertiary, r(r(r({}, a.Default, v.dark1), a.Hover, v.dark1), a.Focus, w.light1)), c.Success, r(r(r({}, a.Default, z.dark1), a.Hover, z.dark1), a.Focus, w.light1)), c.Error, r(r(r({}, a.Default, T.light1), a.Hover, T.light1), a.Focus, w.light1)), c.OnSuccess, r(r(r({}, a.Default, z.dark2), a.Hover, z.dark2), a.Focus, w.light1)), c.OnError, r(r(r({}, a.Default, T.dark2), a.Hover, T.dark2), a.Focus, w.light1)), c.Disabled, r(r(r({}, a.Default, v.dark2), a.Hover, v.dark2), a.Focus, v.dark2)), icon: r(r(r(r(r(r(r(r({}, c.Primary, r(r(r({}, a.Default, v.light1), a.Hover, v.light3), a.Focus, w.light3)), c.Secondary, r(r(r({}, a.Default, v.base), a.Hover, v.light3), a.Focus, w.light3)), c.InversePrimary, r(r(r({}, a.Default, qn), a.Hover, pe), a.Focus, w.dark2)), c.Info, r(r(r({}, a.Default, w.light1), a.Hover, w.light1), a.Focus, w.light1)), c.Warning, r(r(r({}, a.Default, ie.base), a.Hover, ie.base), a.Focus, ie.base)), c.Success, r(r(r({}, a.Default, z.base), a.Hover, z.base), a.Focus, z.base)), c.Error, r(r(r({}, a.Default, T.light1), a.Hover, T.light1), a.Focus, T.light1)), c.Disabled, r(r(r({}, a.Default, v.dark1), a.Hover, v.dark1), a.Focus, v.dark1)), text: (r(r(r(r(r(r(r(r(r(r(Ae = {}, c.Primary, r(r(r({}, a.Default, v.light2), a.Hover, v.light2), a.Focus, w.light3)), c.Placeholder, r(r(r({}, a.Default, v.dark1), a.Hover, v.dark1), a.Focus, v.dark1)), c.Secondary, r(r(r({}, a.Default, v.light1), a.Hover, v.light2), a.Focus, w.light3)), c.InversePrimary, r(r(r({}, a.Default, pe), a.Hover, pe), a.Focus, w.dark2)), c.InverseSecondary, r(r(r({}, a.Default, v.dark2), a.Hover, pe), a.Focus, w.dark2)), c.Disabled, r(r(r({}, a.Default, v.dark1), a.Hover, v.dark1), a.Focus, v.dark1)), c.Success, r(r(r({}, a.Default, z.light2), a.Hover, z.light2), a.Focus, z.light2)), c.Error, r(r(r({}, a.Default, T.light1), a.Hover, T.light1), a.Focus, T.light1)), c.OnSuccess, r(r(r({}, a.Default, z.light1), a.Hover, z.light1), a.Focus, z.light1)), c.OnSuccessLink, r(r(r({}, a.Default, z.light3), a.Hover, z.light3), a.Focus, z.light3)), r(r(Ae, c.OnError, r(r(r({}, a.Default, T.light2), a.Hover, T.light2), a.Focus, T.light2)), c.Link, r(r(r({}, a.Default, w.light1), a.Hover, w.light1), a.Focus, w.light1))) }, ce = o.black, P = o.blue, D = o.gray, $ = o.green, B = o.red, se = o.white, ue = o.yellow, Zn = { background: r(r(r(r(r(r(r(r({}, c.Primary, r(r(r({}, a.Default, se), a.Hover, D.light2), a.Focus, P.light3)), c.Secondary, r(r(r({}, a.Default, D.light3), a.Hover, D.light2), a.Focus, P.light3)), c.InversePrimary, r(r(r({}, a.Default, ce), a.Hover, D.dark3), a.Focus, P.dark2)), c.Info, r(r(r({}, a.Default, P.light3), a.Hover, P.light3), a.Focus, P.light3)), c.Warning, r(r(r({}, a.Default, ue.light3), a.Hover, ue.light3), a.Focus, ue.light3)), c.Success, r(r(r({}, a.Default, $.light3), a.Hover, $.light3), a.Focus, $.light3)), c.Error, r(r(r({}, a.Default, B.light3), a.Hover, B.light3), a.Focus, B.light3)), c.Disabled, r(r(r({}, a.Default, D.light2), a.Hover, D.light2), a.Focus, D.light2)), border: r(r(r(r(r(r(r(r({}, c.Primary, r(r(r({}, a.Default, D.base), a.Hover, D.base), a.Focus, P.light1)), c.Secondary, r(r(r({}, a.Default, D.light2), a.Hover, D.light2), a.Focus, P.light1)), c.Tertiary, r(r(r({}, a.Default, D.light1), a.Hover, D.light1), a.Focus, P.light1)), c.Success, r(r(r({}, a.Default, $.dark1), a.Hover, $.dark1), a.Focus, P.light1)), c.Error, r(r(r({}, a.Default, B.base), a.Hover, B.base), a.Focus, P.light1)), c.Disabled, r(r(r({}, a.Default, D.light1), a.Hover, D.light1), a.Focus, D.light1)), c.OnSuccess, r(r(r({}, a.Default, $.light2), a.Hover, $.light2), a.Focus, $.light2)), c.OnError, r(r(r({}, a.Default, B.light2), a.Hover, B.light2), a.Focus, B.light2)), icon: r(r(r(r(r(r(r(r({}, c.Primary, r(r(r({}, a.Default, D.dark1), a.Hover, ce), a.Focus, P.dark1)), c.Secondary, r(r(r({}, a.Default, D.base), a.Hover, ce), a.Focus, P.dark1)), c.InversePrimary, r(r(r({}, a.Default, se), a.Hover, se), a.Focus, P.light2)), c.Info, r(r(r({}, a.Default, P.base), a.Hover, P.base), a.Focus, P.base)), c.Warning, r(r(r({}, a.Default, ue.dark2), a.Hover, ue.dark2), a.Focus, ue.dark2)), c.Success, r(r(r({}, a.Default, $.dark1), a.Hover, $.dark1), a.Focus, $.dark1)), c.Error, r(r(r({}, a.Default, B.base), a.Hover, B.base), a.Focus, B.base)), c.Disabled, r(r(r({}, a.Default, D.base), a.Hover, D.base), a.Focus, D.base)), text: (r(r(r(r(r(r(r(r(r(r(Ye = {}, c.Primary, r(r(r({}, a.Default, ce), a.Hover, ce), a.Focus, P.dark1)), c.Secondary, r(r(r({}, a.Default, D.dark1), a.Hover, ce), a.Focus, P.dark1)), c.InversePrimary, r(r(r({}, a.Default, se), a.Hover, se), a.Focus, P.light2)), c.InverseSecondary, r(r(r({}, a.Default, D.light1), a.Hover, se), a.Focus, P.light2)), c.Disabled, r(r(r({}, a.Default, D.base), a.Hover, D.base), a.Focus, D.base)), c.Success, r(r(r({}, a.Default, $.dark2), a.Hover, $.dark2), a.Focus, $.dark2)), c.Error, r(r(r({}, a.Default, B.base), a.Hover, B.base), a.Focus, B.base)), c.Placeholder, r(r(r({}, a.Default, D.base), a.Hover, D.base), a.Focus, D.base)), c.OnSuccess, r(r(r({}, a.Default, $.dark2), a.Hover, $.dark2), a.Focus, $.dark2)), c.OnSuccessLink, r(r(r({}, a.Default, $.dark3), a.Hover, $.dark3), a.Focus, $.dark3)), r(r(Ye, c.OnError, r(r(r({}, a.Default, B.dark2), a.Hover, B.dark2), a.Focus, B.dark2)), c.Link, r(r(r({}, a.Default, P.base), a.Hover, P.base), a.Focus, P.base))) }; r(r({}, h.Dark, Un), h.Light, Zn); var Ee = { Dark: "dark", Light: "light" }; r(r({}, Ee.Light, { default: "0 0 0 2px ".concat(o.white, ", 0 0 0 4px ").concat(o.blue.light1), input: "0 0 0 3px ".concat(o.blue.light1) }), Ee.Dark, { default: "0 0 0 2px ".concat(o.black, ", 0 0 0 4px ").concat(o.blue.light1), input: "0 0 0 3px ".concat(o.blue.light1) }); r(r({}, Ee.Light, { gray: "0 0 0 3px ".concat(o.gray.light2), green: "0 0 0 3px ".concat(o.green.light2), red: "0 0 0 3px ".concat(o.red.light2) }), Ee.Dark, { gray: "0 0 0 3px ".concat(o.gray.dark2), green: "0 0 0 3px ".concat(o.green.dark3), red: "0 0 0 3px ".concat(o.yellow.dark3) }); var Vn = o.black, de = o.gray, Jn = o.white; r(r({}, c.Primary, r({}, a.Default, de.base)), c.Secondary, r({}, a.Default, de.dark1)), r(r({}, c.Primary, r({}, a.Default, Vn)), c.Secondary, r({}, a.Default, de.dark4)), r(r({}, c.Primary, r({}, a.Default, de.base)), c.Secondary, r({}, a.Default, de.light1)), r(r({}, c.Primary, r({}, a.Default, Jn)), c.Secondary, r({}, a.Default, de.light3)); var J = r(r({}, h.Light, { 1: "color-mix(in srgb, ".concat(o.black, " 15%, transparent)"), 2: "color-mix(in srgb, ".concat(o.black, " 20%, transparent)"), 3: "color-mix(in srgb, ".concat(o.black, " 60%, transparent)"), overflow: "color-mix(in srgb, ".concat(o.gray.dark1, " 30%, transparent)") }), h.Dark, { 1: "transparent", 2: "color-mix(in srgb, #000000 45%, transparent)", 3: "color-mix(in srgb, #000000 60%, transparent)", overflow: "color-mix(in srgb, #000000 30%, transparent)" }); r(r({}, h.Light, { 1: "0px 2px 4px 1px ".concat(J[h.Light][1]), 2: "0px 18px 18px -15px ".concat(J[h.Light][2]), 3: "0px 8px 20px -8px ".concat(J[h.Light][3]), overflow: "0px 2px 4px 1px ".concat(J[h.Light].overflow) }), h.Dark, { 1: "unset", 2: "0 18px 18px -15px ".concat(J[h.Dark][2]), 3: "0 8px 20px -8px ".concat(J[h.Dark][3]), overflow: "0px 2px 4px 1px ".concat(J[h.Dark].overflow) }); r(r({}, h.Light, 2), h.Dark, 16); var Kn = { faster: 100, default: 150, slower: 300, slowest: 500 }, ze = Kn.slower, Y = function() { var l, g; if (typeof window < "u") { var f = { setRippleListener: !1, registeredRippleElements: /* @__PURE__ */ new WeakMap() }; return (g = (l = window).__LEAFYGREEN_UTILS__) !== null && g !== void 0 || (l.__LEAFYGREEN_UTILS__ = { modules: {} }), window.__LEAFYGREEN_UTILS__.modules["@leafygreen-ui/ripple"] = f, window.__LEAFYGREEN_UTILS__.modules["@leafygreen-ui/ripple"]; } }(); function Qn(l) { Y != null && Y.registeredRippleElements.has(l.target) && function(g) { var f = g.target, p = Y == null ? void 0 : Y.registeredRippleElements.get(f); if (!(!f || !p)) { var F = p.backgroundColor, b = f.getBoundingClientRect(), m = document.createElement("span"); m.className = "lg-ui-ripple", m.style.height = m.style.width = Math.max(b.width, b.height) + "px", f.appendChild(m); var E = g.pageY - b.top - m.offsetHeight / 2 - document.body.scrollTop, O = g.pageX - b.left - m.offsetWidth / 2 - document.body.scrollLeft; m.style.top = E + "px", m.style.left = O + "px", m.style.background = F, setTimeout(function() { m.remove(); }, 750); } }(l); } function ea(l, g) { if (Y) { if (Y.registeredRippleElements.set(l, g), !Y.setRippleListener) { document.addEventListener("click", Qn, { passive: !0 }); var f = document.createElement("style"); f.innerHTML = ra, document.head.append(f), Y.setRippleListener = !0; } return function() { Y.registeredRippleElements.delete(l); }; } } var ra = ` @-webkit-keyframes lg-ui-ripple { from { opacity:1; } to { transform: scale(2); transition: opacity `.concat(ze, `ms; opacity: 0; } } @-moz-keyframes lg-ui-ripple { from { opacity:1; } to { transform: scale(2); transition: opacity `).concat(ze, `ms; opacity: 0; } } @keyframes lg-ui-ripple { from { opacity:1; } to { transform: scale(2); transition: opacity `).concat(ze, `ms; opacity: 0; } } .lg-ui-ripple { position: absolute; border-radius: 100%; transform: scale(0.2); opacity: 0; pointer-events: none; // Ensures that text is shown above ripple effect z-index: -1; -webkit-animation: lg-ui-ripple .75s ease-out; -moz-animation: lg-ui-ripple .75s ease-out; animation: lg-ui-ripple .75s ease-out; } @media (prefers-reduced-motion: reduce) { .lg-ui-ripple { animation: none; transform: none; } } `); function t(l, g, f) { return (g = function(p) { var F = function(b, m) { if (typeof b != "object" || !b) return b; var E = b[Symbol.toPrimitive]; if (E !== void 0) { var O = E.call(b, m); if (typeof O != "object") return O; throw new TypeError("@@toPrimitive must return a primitive value."); } return String(b); }(p, "string"); return typeof F == "symbol" ? F : F + ""; }(g)) in l ? Object.defineProperty(l, g, { value: f, enumerable: !0, configurable: !0, writable: !0 }) : l[g] = f, l; } function ye() { return ye = Object.assign ? Object.assign.bind() : function(l) { for (var g = 1; g < arguments.length; g++) { var f = arguments[g]; for (var p in f) ({}).hasOwnProperty.call(f, p) && (l[p] = f[p]); } return l; }, ye.apply(null, arguments); } function qe(l, g) { var f = Object.keys(l); if (Object.getOwnPropertySymbols) { var p = Object.getOwnPropertySymbols(l); g && (p = p.filter(function(F) { return Object.getOwnPropertyDescriptor(l, F).enumerable; })), f.push.apply(f, p); } return f; } function De(l) { for (var g = 1; g < arguments.length; g++) { var f = arguments[g] != null ? arguments[g] : {}; g % 2 ? qe(Object(f), !0).forEach(function(p) { t(l, p, f[p]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(l, Object.getOwnPropertyDescriptors(f)) : qe(Object(f)).forEach(function(p) { Object.defineProperty(l, p, Object.getOwnPropertyDescriptor(f, p)); }); } return l; } function u(l, g) { return g || (g = l.slice(0)), Object.freeze(Object.defineProperties(l, { raw: { value: Object.freeze(g) } })); } var Ue, Ze, Ve, Je, Ke, Qe, er, rr, nr, ar, or, tr, lr, ir, cr, sr, ur, dr, gr, hr, fr, br, pr, kr, vr, yr, Dr, mr, xr, Fr, Hr, wr, Sr, Pr, Or, Er, Lr, $r, Ir, zr, jr, Br, Nr, Gr, d = { Default: "default", Primary: "primary", PrimaryOutline: "primaryOutline", Danger: "danger", DangerOutline: "dangerOutline", BaseGreen: "baseGreen" }, N = { XSmall: "xsmall", Small: "small", Default: "default", Large: "large" }, Pe = 0.76, na = t(t({}, h.Light, t(t(t(t(t(t({}, d.Default, o.gray.light2), d.Primary, o.green.dark1), d.PrimaryOutline, X(Pe, o.green.base)), d.Danger, o.red.light1), d.DangerOutline, X(Pe, o.red.base)), d.BaseGreen, o.green.light1)), h.Dark, t(t(t(t(t(t({}, d.Default, o.gray.base), d.Primary, o.green.dark1), d.PrimaryOutline, X(Pe, o.green.base)), d.Danger, o.red.dark2), d.DangerOutline, X(Pe, o.red.light1)), d.BaseGreen, o.green.dark1)), aa = s(Ue || (Ue = u([` overflow: hidden; position: absolute; top: 0; left: 0; right: 0; bottom: 0; border-radius: 5px; `]))), oa = s(Ze || (Ze = u([` justify-content: space-between; `]))), xn = s(Ve || (Ve = u([` display: grid; grid-auto-flow: column; justify-content: center; align-items: center; height: 100%; width: 100%; position: relative; user-select: none; z-index: 0; transition: all `, ` ease-in-out; `])), mn.default), Fn = t(t(t(t({}, N.XSmall, s(Je || (Je = u([` padding: 0 7px; // 8px - 1px border gap: 6px; `])))), N.Small, s(Ke || (Ke = u([` padding: 0 11px; // 12px - 1px border gap: 6px; `])))), N.Default, s(Qe || (Qe = u([` padding: 0 11px; // 12px - 1px border gap: 6px; `])))), N.Large, s(er || (er = u([` padding: 0 15px; // 16px - 1px border gap: 8px; `])))), ta = s(rr || (rr = u([` position: absolute; `]))), la = s(nr || (nr = u([` position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); `]))), ia = t(t(t(t({}, N.XSmall, 16), N.Small, 16), N.Default, 16), N.Large, 20), ca = t(t({}, h.Dark, o.gray.light1), h.Light, o.gray.dark1), sa = s(ar || (ar = u([` visibility: hidden; `]))), ua = s(or || (or = u([` justify-self: right; `]))), da = s(tr || (tr = u([` justify-self: left; `]))), Hn = Tn("button"), ga = t(t({}, h.Light, t(t(t(t(t(t({}, d.Default, s(lr || (lr = u([` color: `, `; `])), o.gray.base)), d.Primary, s(ir || (ir = u([` color: `, `; `])), o.green.light2)), d.PrimaryOutline, s(cr || (cr = u([` color: `, `; `])), o.green.dark2)), d.Danger, s(sr || (sr = u([` color: `, `; `])), o.red.light3)), d.DangerOutline, s(ur || (ur = u([` color: `, `; `])), o.red.light1)), d.BaseGreen, s(dr || (dr = u([` color: `, `; `])), o.green.dark2))), h.Dark, t(t(t(t(t(t({}, d.Default, s(gr || (gr = u([` color: `, `; `])), o.gray.light2)), d.Primary, s(hr || (hr = u([` color: `, `; `])), o.green.light2)), d.PrimaryOutline, s(fr || (fr = u([` color: `, `; `])), o.green.base)), d.Danger, s(br || (br = u([` color: `, `; `])), o.red.light2)), d.DangerOutline, s(pr || (pr = u([` color: `, `; `])), o.red.light1)), d.BaseGreen, s(kr || (kr = u([` color: `, `; `])), o.green.dark2))), ha = t(t({}, h.Light, t(t(t(t(t(t({}, d.Default, s(vr || (vr = u([` color: `, `; `])), o.black)), d.Primary, s(yr || (yr = u([` color: `, `; `])), o.white)), d.PrimaryOutline, s(Dr || (Dr = u([` color: `, `; `])), o.green.dark2)), d.Danger, s(mr || (mr = u([` color: `, `; `])), o.white)), d.DangerOutline, s(xr || (xr = u([` color: `, `; `])), o.red.base)), d.BaseGreen, s(Fr || (Fr = u([` color: `, `; `])), o.green.dark3))), h.Dark, t(t(t(t(t(t({}, d.Default, s(Hr || (Hr = u([` color: `, `; `])), o.white)), d.Primary, s(wr || (wr = u([` color: `, `; `])), o.white)), d.PrimaryOutline, s(Sr || (Sr = u([` color: `, `; `])), o.green.base)), d.Danger, s(Pr || (Pr = u([` color: `, `; `])), o.white)), d.DangerOutline, s(Or || (Or = u([` color: `, `; `])), o.red.light1)), d.BaseGreen, s(Er || (Er = u([` color: `, `; `])), o.green.dark3))), fa = s(Lr || (Lr = u([` .`, ` { &:hover, &:active { color: currentColor; } } `])), Hn), ba = t(t(t(t({}, N.XSmall, s($r || ($r = u([` height: 14px; width: 14px; `])))), N.Small, s(Ir || (Ir = u([` height: 16px; width: 16px; `])))), N.Default, s(zr || (zr = u([` height: 16px; width: 16px; `])))), N.Large, s(jr || (jr = u([` height: 20px; width: 20px; `])))), pa = t(t({}, h.Light, s(Br || (Br = u([` color: `, `; `])), o.gray.base)), h.Dark, s(Nr || (Nr = u([` color: `, `; `])), o.gray.dark1)), ka = s(Gr || (Gr = u([` color: `, `; `])), o.gray.dark1); function Be(l) { var g = l.glyph, f = l.variant, p = l.size, F = l.darkMode, b = l.disabled, m = l.isIconOnlyButton, E = l.className, O = !m && { "aria-hidden": !0, role: "presentation" }, A = Dn(F), U = m ? ha : ga; return M.cloneElement(g, De({ className: K(U[A][f], ba[p], t(t(t({}, fa, m), pa[A], b), ka, b && m && F), E) }, O)); } Be.displayName = "ButtonIcon"; var Tr, _r, Mr, Rr, Cr, Wr, Xr, Ar, Yr, qr, Ur, Zr, Vr, Jr, Kr, Qr, en, rn, nn, an, on, tn, ln, cn, sn, un, dn, gn, hn, fn, bn, pn, kn, vn = function(l) { var g, f = l.leftGlyph, p = l.rightGlyph, F = l.className, b = l.children, m = l.variant, E = l.size, O = l.darkMode, A = { variant: m, size: E, darkMode: O, disabled: l.disabled, isIconOnlyButton: (g = (f || p) && !b) !== null && g !== void 0 && g }; return M.createElement("div", { className: K(xn, Fn[E], t({}, oa, !!p && O), F) }, f && M.createElement(Be, ye({ glyph: f, className: ua }, A)), b, p && M.createElement(Be, ye({ glyph: p, className: da }, A))); }, va = function(l) { var g, f = l.darkMode, p = l.disabled, F = l.variant, b = l.size, m = l.isLoading, E = l.loadingText, O = l.loadingIndicator, A = l.className, U = yn(f), me = U.darkMode, ge = U.theme, Q = Nn(null); Gn(function() { var xe, $e = na[ge][F]; return Q.current == null || p || (xe = ea(Q.current, { backgroundColor: $e })), xe; }, [Q, F, me, p, ge]); var Le = O && M.cloneElement(O, De(De({}, O.props), {}, t({ className: K(t({}, la, !E), (g = O.props) === null || g === void 0 ? void 0 : g.className), sizeOverride: ia[b], colorOverride: ca[ge] }, "data-testid", "lg-button-spinner"))); return m ? M.createElement(M.Fragment, null, M.createElement("div", { className: K(xn, Fn[b], t({}, ta, !E)) }, Le, E), !E && M.createElement(vn, ye({}, l, { className: K(sa, A) }))) : M.createElement(M.Fragment, null, M.createElement("div", { className: aa, ref: Q }), M.createElement(vn, l)); }, ke = "#00593F", x = '&:focus-visible, &[data-focus="true"]', R = '&:hover, &[data-hover="true"]', _ = '&:active, &[data-active="true"]', C = function(l) { return ` 0 0 0 2px `.concat(l, `, 0 0 0 4px `).concat(o.blue.light1, `; `); }, ya = s(Tr || (Tr = u([` // unset browser default appearance: none; padding: 0; margin: 0; background-color: transparent; border: 1px solid transparent; display: inline-flex; align-items: stretch; transition: all `, `ms ease-in-out; position: relative; text-decoration: none; cursor: pointer; z-index: 0; font-family: `, `; border-radius: 6px; `, ` { outline: none; } `, `, &:focus, &:hover { text-decoration: none; } `])), mn.default, Xn.default, x, _), Da = t(t({}, h.Light, t(t(t(t(t(t({}, d.Default, s(_r || (_r = u([` background-color: `, `; border-color: `, `; color: `, `; // needed to override any global button styles `, ` { color: `, `; } `, `, `, ` { color: `, `; background-color: `, `; box-shadow: 0 0 0 3px `, `; } `])), o.gray.light3, o.gray.base, o.black, x, o.black, R, _, o.black, o.white, o.gray.light2)), d.Primary, s(Mr || (Mr = u([` background-color: `, `; border-color: `, `; color: `, `; `, ` { color: `, `; } `, `, `, ` { color: `, `; background-color: `, `; border-color: `, `; box-shadow: 0 0 0 3px `, `; } `])), o.green.dark2, o.green.dark2, o.white, x, o.white, R, _, o.white, ke, ke, o.green.light2)), d.PrimaryOutline, s(Rr || (Rr = u([` background-color: transparent; border-color: `, `; color: `, `; `, ` { color: `, `; } `, `, `, ` { color: `, `; background-color: `, `; box-shadow: 0px 0px 0px 3px `, `; } `])), o.green.dark2, o.green.dark2, x, o.green.dark2, R, _, o.green.dark2, X(0.96, o.green.base), o.green.light2)), d.Danger, s(Cr || (Cr = u([` background-color: `, `; border-color: `, `; color: `, `; `, ` { color: `, `; } `, `, `, ` { color: `, `; background-color: #c82222; // not quite dark1 border-color: #c82222; // not quite dark1 box-shadow: 0px 0px 0px 3px `, `; } `])), o.red.base, o.red.base, o.white, x, o.white, R, _, o.white, o.red.light3)), d.DangerOutline, s(Wr || (Wr = u([` background-color: transparent; border-color: `, `; color: `, `; `, ` { color: `, `; } `, `, `, ` { color: `, `; background-color: `, `; border-color: `, `; box-shadow: 0px 0px 0px 3px `, `; } `])), o.red.light1, o.red.base, x, o.red.base, R, _, o.red.dark2, X(0.96, o.red.base), o.red.base, o.red.light3)), d.BaseGreen, s(Xr || (Xr = u([` background-color: `, `; border-color: `, `; color: `, `; `, ` { color: `, `; } `, `, `, ` { color: `, `; background-color: `, `; box-shadow: 0px 0px 0px 3px `, `; } `])), o.green.base, o.green.dark2, o.green.dark3, x, o.green.dark3, R, _, o.green.dark3, Ce(0.96, o.green.base, o.green.dark3), o.green.light2))), h.Dark, t(t(t(t(t(t({}, d.Default, s(Ar || (Ar = u([` background-color: `, `; border-color: `, `; color: `, `; `, ` { color: `, `; } `, `, `, ` { background-color: `, `; border-color: `, `; color: `, `; box-shadow: 0px 0px 0px 3px `, `; } `])), o.gray.dark2, o.gray.base, o.white, x, o.white, R, _, o.gray.dark1, o.gray.base, o.white, o.gray.dark2)), d.Primary, s(Yr || (Yr = u([` background-color: `, `; border: 1px solid `, `; color: `, `; `, ` { color: `, `; } `, `, `, ` { color: `, `; background-color: `, `; // Off palette box-shadow: 0 0 0 3px `, `; } `])), o.green.dark2, o.green.base, o.white, x, o.white, R, _, o.white, ke, o.green.dark3)), d.PrimaryOutline, s(qr || (qr = u([` background-color: transparent; border-color: `, `; color: `, `; `, ` { color: `, `; } `, `, `, ` { color: `, `; background-color: `, `; border-color: `, `; box-shadow: 0px 0px 0px 3px `, `; } `])), o.green.base, o.green.base, x, o.green.base, R, _, o.green.base, X(0.96, o.green.base), o.green.base, o.green.dark3)), d.Danger, s(Ur || (Ur = u([` background-color: `, `; border-color: `, `; color: `, `; `, ` { color: `, `; } `, `, `, ` { border-color: `, `; color: `, `; background-color: #c82222; // Off palette box-shadow: 0px 0px 0px 3px `, `; // yes, yellow } `])), o.red.base, o.red.light1, o.white, x, o.white, R, _, o.red.light1, o.white, o.yellow.dark3)), d.DangerOutline, s(Zr || (Zr = u([` border-color: `, `; color: `, `; `, ` { color: `, `; } `, `, `, ` { color: `, `; background-color: `, `; box-shadow: 0px 0px 0px 3px `, `; // yes, yellow } `])), o.red.light1, o.red.light1, x, o.red.light1, R, _, o.red.light1, X(0.96, o.red.base), o.yellow.dark3)), d.BaseGreen, s(Vr || (Vr = u([` background-color: `, `; border-color: `, `; color: `, `; `, ` { color: `, `; } `, `, `, ` { color: `, `; background-color: `, `; border-color: `, `; box-shadow: 0px 0px 0px 3px `, `; } `])), o.green.base, o.green.dark2, o.green.dark3, x, o.green.dark3, R, _, o.green.dark3, Ce(0.96, o.green.base, o.green.light3), o.green.dark2, o.green.dark3))), ma = t(t({}, h.Light, t(t(t(t(t(t({}, d.Default, s(Jr || (Jr = u([` `, ` { background-color: `, `; box-shadow: `, `; } `])), x, o.white, C(o.white))), d.Primary, s(Kr || (Kr = u([` `, ` { color: `, `; background-color: `, `; box-shadow: `, `; } `])), x, o.white, ke, C(o.white))), d.PrimaryOutline, s(Qr || (Qr = u([` `, ` { background-color: `, `; box-shadow: `, `; } `])), x, X(0.96, o.green.base), C(o.white))), d.Danger, s(en || (en = u([` `, ` { color: `, `; background-color: #c82222; // not quite dark1 box-shadow: `, `; } `])), x, o.white, C(o.white))), d.DangerOutline, s(rn || (rn = u([` `, ` { color: `, `; box-shadow: `, `; } `])), x, o.red.dark2, C(o.white))), d.BaseGreen, s(nn || (nn = u([` `, ` { box-shadow: `, `; } `])), x, C(o.white)))), h.Dark, t(t(t(t(t(t({}, d.Default, s(an || (an = u([` `, ` { background-color: `, `; box-shadow: `, `; } `])), x, o.gray.dark1, C(o.black))), d.Primary, s(on || (on = u([` `, ` { background-color: `, `; // Off palette box-shadow: `, `; } `])), x, ke, C(o.black))), d.PrimaryOutline, s(tn || (tn = u([` `, ` { background-color: `, `; border-color: `, `; box-shadow: `, `; } `])), x, X(0.96, o.green.base), o.green.base, C(o.black))), d.Danger, s(ln || (ln = u([` `, ` { background-color: #c82222; // Off palette box-shadow: `, `; } `])), x, C(o.black))), d.DangerOutline, s(cn || (cn = u([` `, ` { background-color: `, `; border-color: `, `; box-shadow: `, `; } `])), x, X(0.96, o.red.base), o.red.light1, C(o.black))), d.BaseGreen, s(sn || (sn = u([` `, ` { background-color: `, `; box-shadow: `, `; } `])), x, o.green.base, C(o.black)))), xa = t(t({}, h.Light, s(un || (un = u([` &, `, ", ", ` { background-color: `, `; border-color: `, `; color: `, `; box-shadow: none; cursor: not-allowed; } `, ` { color: `, `; box-shadow: `, `; } `])), R, _, o.gray.light2, o.gray.light1, o.gray.base, x, o.gray.base, C(o.white))), h.Dark, s(dn || (dn = u([` &, `, ", ", ` { background-color: `, `; border-color: `, `; color: `, `; box-shadow: none; cursor: not-allowed; } `, ` { color: `, `; box-shadow: `, `; } `])), R, _, o.gray.dark3, o.gray.dark2, o.gray.dark1, x, o.gray.dark1, C(o.black))), Fa = t(t(t(t({}, N.XSmall, s(gn || (gn = u([` height: 22px; text-transform: uppercase; font-size: 12px; line-height: 1em; font-weight: `, `; letter-spacing: 0.4px; `])), je.semiBold)), N.Small, s(hn || (hn = u([` height: 28px; `])))), N.Default, s(fn || (fn = u([` height: 36px; `])))), N.Large, s(bn || (bn = u([` height: 48px; font-size: 18px; line-height: 24px; `])))), Ha = t(t({}, ve.Body1, s(pn || (pn = u([` font-size: `, `px; line-height: `, `px; font-weight: `, `; `])), Se.body1.fontSize, Se.body1.lineHeight, je.medium)), ve.Body2, s(kn || (kn = u([` font-size: `, `px; line-height: `, `px; // Pixel pushing for optical alignment purposes transform: translateY(1px); font-weight: `, `; `])), Se.body2.fontSize, Se.body2.lineHeight, je.medium)), wa = ["variant", "size", "darkMode", "data-lgid", "baseFontSize", "disabled", "onClick", "leftGlyph", "rightGlyph", "children", "className", "as", "type", "isLoading", "loadingIndicator", "loadingText"], Sa = _n(function(l, g) { var f = l.variant, p = f === void 0 ? d.Default : f, F = l.size, b = F === void 0 ? N.Default : F, m = l.darkMode, E = l["data-lgid"], O = l.baseFontSize, A = O === void 0 ? ve.Body1 : O, U = l.disabled, me = U !== void 0 && U, ge = l.onClick, Q = l.leftGlyph, Le = l.rightGlyph, xe = l.children, $e = l.className, wn = l.as, Sn = l.type, Ne = l.isLoading, Ge = Ne !== void 0 && Ne, Pn = l.loadingIndicator, On = l.loadingText, En = function(W, he) { if (W == null) return {}; var Z, ee, He = function(q, Ie) { if (q == null) return {}; var we = {}; for (var re in q) if ({}.hasOwnProperty.call(q, re)) { if (Ie.indexOf(re) !== -1) continue; we[re] = q[re]; } return we; }(W, he); if (Object.getOwnPropertySymbols) { var fe = Object.getOwnPropertySymbols(W); for (ee = 0; ee < fe.length; ee++) Z = fe[ee], he.indexOf(Z) === -1 && {}.propertyIsEnumerable.call(W, Z) && (He[Z] = W[Z]); } return He; }(l, wa), Te = Mn(wn, En, "button"), _e = Te.Component, Me = Te.rest, Re = yn(m).darkMode, Ln = _e === "a", Fe = !(me || Ge), $n = function() { return { root: arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "lg-button" }; }(E), In = function(W) { var he = W.variant, Z = W.size, ee = W.darkMode, He = W.baseFontSize, fe = W.disabled, q = Dn(ee), Ie = Da[q][he], we = ma[q][he], re = Fa[Z], Bn = Ha[He]; return K(ya, Ie, Bn, re, t({}, we, !fe), t({}, xa[q], fe)); }({ variant: p, size: b, darkMode: Re, baseFontSize: A, disabled: !Fe }), zn = De(De({ "data-lgid": $n.root, type: Ln ? void 0 : Sn || "button", className: K(Hn, In, $e), ref: g, "aria-disabled": !Fe, onClick: Fe ? ge : function(W) { return W.preventDefault(); } }, Me), {}, { href: Fe ? Me.href : void 0 }), jn = { rightGlyph: Le, leftGlyph: Q, darkMode: Re, disabled: me, variant: p, size: b, isLoading: Ge, loadingIndicator: Pn, loadingText: On }; return M.createElement(_e, zn, M.createElement(va, jn, xe)); }); Sa.displayName = "Button"; export { Sa as N, d as f, N as y };