@cal.macconnachie/web-components 0.0.18 → 0.0.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -17,7 +17,7 @@ let wt = class {
17
17
  return this.cssText;
18
18
  }
19
19
  };
20
- const xt = (e) => new wt(typeof e == "string" ? e : e + "", void 0, Q), Et = (e, ...t) => {
20
+ const Et = (e) => new wt(typeof e == "string" ? e : e + "", void 0, Q), xt = (e, ...t) => {
21
21
  const s = e.length === 1 ? e[0] : t.reduce(((i, r, o) => i + ((a) => {
22
22
  if (a._$cssResult$ === !0) return a.cssText;
23
23
  if (typeof a == "number") return a;
@@ -33,9 +33,9 @@ const xt = (e) => new wt(typeof e == "string" ? e : e + "", void 0, Q), Et = (e,
33
33
  }, at = Z ? (e) => e : (e) => e instanceof CSSStyleSheet ? ((t) => {
34
34
  let s = "";
35
35
  for (const i of t.cssRules) s += i.cssText;
36
- return xt(s);
36
+ return Et(s);
37
37
  })(e) : e;
38
- const { is: Pt, defineProperty: Ot, getOwnPropertyDescriptor: Dt, getOwnPropertyNames: Ut, getOwnPropertySymbols: Rt, getPrototypeOf: It } = Object, F = globalThis, nt = F.trustedTypes, Nt = nt ? nt.emptyScript : "", Lt = F.reactiveElementPolyfillSupport, H = (e, t) => e, Y = { toAttribute(e, t) {
38
+ const { is: Pt, defineProperty: Ot, getOwnPropertyDescriptor: Dt, getOwnPropertyNames: Ut, getOwnPropertySymbols: Rt, getPrototypeOf: It } = Object, F = globalThis, nt = F.trustedTypes, Nt = nt ? nt.emptyScript : "", Lt = F.reactiveElementPolyfillSupport, M = (e, t) => e, Y = { toAttribute(e, t) {
39
39
  switch (t) {
40
40
  case Boolean:
41
41
  e = e ? Nt : null;
@@ -93,13 +93,13 @@ let U = class extends HTMLElement {
93
93
  return this.elementProperties.get(t) ?? lt;
94
94
  }
95
95
  static _$Ei() {
96
- if (this.hasOwnProperty(H("elementProperties"))) return;
96
+ if (this.hasOwnProperty(M("elementProperties"))) return;
97
97
  const t = It(this);
98
98
  t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
99
99
  }
100
100
  static finalize() {
101
- if (this.hasOwnProperty(H("finalized"))) return;
102
- if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(H("properties"))) {
101
+ if (this.hasOwnProperty(M("finalized"))) return;
102
+ if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(M("properties"))) {
103
103
  const s = this.properties, i = [...Ut(s), ...Rt(s)];
104
104
  for (const r of i) this.createProperty(r, s[r]);
105
105
  }
@@ -246,10 +246,10 @@ let U = class extends HTMLElement {
246
246
  firstUpdated(t) {
247
247
  }
248
248
  };
249
- U.elementStyles = [], U.shadowRootOptions = { mode: "open" }, U[H("elementProperties")] = /* @__PURE__ */ new Map(), U[H("finalized")] = /* @__PURE__ */ new Map(), Lt?.({ ReactiveElement: U }), (F.reactiveElementVersions ??= []).push("2.1.1");
250
- const tt = globalThis, K = tt.trustedTypes, ht = K ? K.createPolicy("lit-html", { createHTML: (e) => e }) : void 0, bt = "$lit$", C = `lit$${Math.random().toFixed(9).slice(2)}$`, vt = "?" + C, Ht = `<${vt}>`, D = document, j = () => D.createComment(""), q = (e) => e === null || typeof e != "object" && typeof e != "function", et = Array.isArray, Mt = (e) => et(e) || typeof e?.[Symbol.iterator] == "function", W = `[
249
+ U.elementStyles = [], U.shadowRootOptions = { mode: "open" }, U[M("elementProperties")] = /* @__PURE__ */ new Map(), U[M("finalized")] = /* @__PURE__ */ new Map(), Lt?.({ ReactiveElement: U }), (F.reactiveElementVersions ??= []).push("2.1.1");
250
+ const tt = globalThis, K = tt.trustedTypes, ht = K ? K.createPolicy("lit-html", { createHTML: (e) => e }) : void 0, bt = "$lit$", C = `lit$${Math.random().toFixed(9).slice(2)}$`, vt = "?" + C, Mt = `<${vt}>`, D = document, j = () => D.createComment(""), q = (e) => e === null || typeof e != "object" && typeof e != "function", et = Array.isArray, Ht = (e) => et(e) || typeof e?.[Symbol.iterator] == "function", W = `[
251
251
  \f\r]`, N = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, ct = /-->/g, dt = />/g, T = RegExp(`>|${W}(?:([^\\s"'>=/]+)(${W}*=${W}*(?:[^
252
- \f\r"'\`<>=]|("|')|))|$)`, "g"), pt = /'/g, ut = /"/g, At = /^(?:script|style|textarea|title)$/i, jt = (e) => (t, ...s) => ({ _$litType$: e, strings: t, values: s }), f = jt(1), x = Symbol.for("lit-noChange"), g = Symbol.for("lit-nothing"), gt = /* @__PURE__ */ new WeakMap(), O = D.createTreeWalker(D, 129);
252
+ \f\r"'\`<>=]|("|')|))|$)`, "g"), pt = /'/g, ut = /"/g, At = /^(?:script|style|textarea|title)$/i, jt = (e) => (t, ...s) => ({ _$litType$: e, strings: t, values: s }), f = jt(1), E = Symbol.for("lit-noChange"), g = Symbol.for("lit-nothing"), gt = /* @__PURE__ */ new WeakMap(), O = D.createTreeWalker(D, 129);
253
253
  function _t(e, t) {
254
254
  if (!et(e) || !e.hasOwnProperty("raw")) throw Error("invalid template strings array");
255
255
  return ht !== void 0 ? ht.createHTML(t) : t;
@@ -262,7 +262,7 @@ const qt = (e, t) => {
262
262
  let h, d, l = -1, p = 0;
263
263
  for (; p < n.length && (a.lastIndex = p, d = a.exec(n), d !== null); ) p = a.lastIndex, a === N ? d[1] === "!--" ? a = ct : d[1] !== void 0 ? a = dt : d[2] !== void 0 ? (At.test(d[2]) && (r = RegExp("</" + d[2], "g")), a = T) : d[3] !== void 0 && (a = T) : a === T ? d[0] === ">" ? (a = r ?? N, l = -1) : d[1] === void 0 ? l = -2 : (l = a.lastIndex - d[2].length, h = d[1], a = d[3] === void 0 ? T : d[3] === '"' ? ut : pt) : a === ut || a === pt ? a = T : a === ct || a === dt ? a = N : (a = T, r = void 0);
264
264
  const u = a === T && e[c + 1].startsWith("/>") ? " " : "";
265
- o += a === N ? n + Ht : l >= 0 ? (i.push(h), n.slice(0, l) + bt + n.slice(l) + C + u) : n + C + (l === -2 ? c : u);
265
+ o += a === N ? n + Mt : l >= 0 ? (i.push(h), n.slice(0, l) + bt + n.slice(l) + C + u) : n + C + (l === -2 ? c : u);
266
266
  }
267
267
  return [_t(e, o + (e[s] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), i];
268
268
  };
@@ -304,7 +304,7 @@ class B {
304
304
  }
305
305
  }
306
306
  function R(e, t, s = e, i) {
307
- if (t === x) return t;
307
+ if (t === E) return t;
308
308
  let r = i !== void 0 ? s._$Co?.[i] : s._$Cl;
309
309
  const o = q(t) ? void 0 : t._$litDirective$;
310
310
  return r?.constructor !== o && (r?._$AO?.(!1), o === void 0 ? r = void 0 : (r = new o(e), r._$AT(e, s, i)), i !== void 0 ? (s._$Co ??= [])[i] = r : s._$Cl = r), r !== void 0 && (t = R(e, r._$AS(e, t.values), r, i)), t;
@@ -356,7 +356,7 @@ class I {
356
356
  return this._$AB;
357
357
  }
358
358
  _$AI(t, s = this) {
359
- t = R(this, t, s), q(t) ? t === g || t == null || t === "" ? (this._$AH !== g && this._$AR(), this._$AH = g) : t !== this._$AH && t !== x && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : Mt(t) ? this.k(t) : this._(t);
359
+ t = R(this, t, s), q(t) ? t === g || t == null || t === "" ? (this._$AH !== g && this._$AR(), this._$AH = g) : t !== this._$AH && t !== E && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : Ht(t) ? this.k(t) : this._(t);
360
360
  }
361
361
  O(t) {
362
362
  return this._$AA.parentNode.insertBefore(t, this._$AB);
@@ -409,11 +409,11 @@ class V {
409
409
  _$AI(t, s = this, i, r) {
410
410
  const o = this.strings;
411
411
  let a = !1;
412
- if (o === void 0) t = R(this, t, s, 0), a = !q(t) || t !== this._$AH && t !== x, a && (this._$AH = t);
412
+ if (o === void 0) t = R(this, t, s, 0), a = !q(t) || t !== this._$AH && t !== E, a && (this._$AH = t);
413
413
  else {
414
414
  const c = t;
415
415
  let n, h;
416
- for (t = o[0], n = 0; n < o.length - 1; n++) h = R(this, c[i + n], s, n), h === x && (h = this._$AH[n]), a ||= !q(h) || h !== this._$AH[n], h === g ? t = g : t !== g && (t += (h ?? "") + o[n + 1]), this._$AH[n] = h;
416
+ for (t = o[0], n = 0; n < o.length - 1; n++) h = R(this, c[i + n], s, n), h === E && (h = this._$AH[n]), a ||= !q(h) || h !== this._$AH[n], h === g ? t = g : t !== g && (t += (h ?? "") + o[n + 1]), this._$AH[n] = h;
417
417
  }
418
418
  a && !r && this.j(t);
419
419
  }
@@ -442,7 +442,7 @@ class Kt extends V {
442
442
  super(t, s, i, r, o), this.type = 5;
443
443
  }
444
444
  _$AI(t, s = this) {
445
- if ((t = R(this, t, s, 0) ?? g) === x) return;
445
+ if ((t = R(this, t, s, 0) ?? g) === E) return;
446
446
  const i = this._$AH, r = t === g && i !== g || t.capture !== i.capture || t.once !== i.once || t.passive !== i.passive, o = t !== g && (i === g || r);
447
447
  r && this.element.removeEventListener(this.name, this, i), o && this.element.addEventListener(this.name, this, t), this._$AH = t;
448
448
  }
@@ -473,7 +473,7 @@ const Gt = (e, t, s) => {
473
473
  return r._$AI(e), r;
474
474
  };
475
475
  const st = globalThis;
476
- let M = class extends U {
476
+ let H = class extends U {
477
477
  constructor() {
478
478
  super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
479
479
  }
@@ -492,12 +492,12 @@ let M = class extends U {
492
492
  super.disconnectedCallback(), this._$Do?.setConnected(!1);
493
493
  }
494
494
  render() {
495
- return x;
495
+ return E;
496
496
  }
497
497
  };
498
- M._$litElement$ = !0, M.finalized = !0, st.litElementHydrateSupport?.({ LitElement: M });
498
+ H._$litElement$ = !0, H.finalized = !0, st.litElementHydrateSupport?.({ LitElement: H });
499
499
  const Jt = st.litElementPolyfillSupport;
500
- Jt?.({ LitElement: M });
500
+ Jt?.({ LitElement: H });
501
501
  (st.litElementVersions ??= []).push("4.2.1");
502
502
  const Zt = (e) => (t, s) => {
503
503
  s !== void 0 ? s.addInitializer((() => {
@@ -579,7 +579,7 @@ const mt = kt(class extends Ct {
579
579
  const r = !!t[i];
580
580
  r === this.st.has(i) || this.nt?.has(i) || (r ? (s.add(i), this.st.add(i)) : (s.remove(i), this.st.delete(i)));
581
581
  }
582
- return x;
582
+ return E;
583
583
  }
584
584
  });
585
585
  const { I: ee } = Vt, ft = () => document.createComment(""), L = (e, t, s) => {
@@ -652,7 +652,7 @@ const yt = (e, t, s) => {
652
652
  const v = r[l++];
653
653
  v !== null && G(v);
654
654
  }
655
- return this.ut = a, ie(e, n), x;
655
+ return this.ut = a, ie(e, n), E;
656
656
  }
657
657
  }), oe = ({
658
658
  baseUrl: e
@@ -884,10 +884,10 @@ const yt = (e, t, s) => {
884
884
  redirectUri: he(r)
885
885
  }, a = (w) => {
886
886
  const _ = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~", k = new Uint8Array(w);
887
- return crypto.getRandomValues(k), Array.from(k).map((E) => _[E % _.length]).join("");
887
+ return crypto.getRandomValues(k), Array.from(k).map((x) => _[x % _.length]).join("");
888
888
  }, c = async (w) => {
889
- const k = new TextEncoder().encode(w), E = await crypto.subtle.digest("SHA-256", k);
890
- return btoa(String.fromCharCode(...new Uint8Array(E))).replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
889
+ const k = new TextEncoder().encode(w), x = await crypto.subtle.digest("SHA-256", k);
890
+ return btoa(String.fromCharCode(...new Uint8Array(x))).replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
891
891
  }, n = async () => {
892
892
  const w = a(128), _ = await c(w);
893
893
  return sessionStorage.setItem("pkce_code_verifier", w), { codeVerifier: w, codeChallenge: _ };
@@ -947,21 +947,21 @@ const yt = (e, t, s) => {
947
947
  code: w,
948
948
  redirect_uri: o.redirectUri,
949
949
  code_verifier: _
950
- }), E = await fetch(`${o.domain}/oauth2/token`, {
950
+ }), x = await fetch(`${o.domain}/oauth2/token`, {
951
951
  method: "POST",
952
952
  headers: {
953
953
  "Content-Type": "application/x-www-form-urlencoded"
954
954
  },
955
955
  body: k.toString()
956
956
  });
957
- if (!E.ok) {
958
- const rt = await E.text();
957
+ if (!x.ok) {
958
+ const rt = await x.text();
959
959
  throw new Error(`Token exchange failed: ${rt}`);
960
960
  }
961
- return E.json();
961
+ return x.json();
962
962
  }
963
963
  };
964
- }, de = () => Et`
964
+ }, de = () => xt`
965
965
  :host {
966
966
  display: inline-block;
967
967
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
@@ -1477,7 +1477,7 @@ const ge = [
1477
1477
  "token_type",
1478
1478
  "expires_in"
1479
1479
  ];
1480
- let m = class extends M {
1480
+ let m = class extends H {
1481
1481
  constructor() {
1482
1482
  super(...arguments), this.open = !1, this.initialMode = "signin", this.logoUrl = "", this.baseUrl = "", this.oauthDomain = "", this.oauthRegion = "", this.oauthUserPoolId = "", this.oauthClientId = "", this.oauthRedirectUri = "", this.oauthSpaDomain = "", this.size = "sm", this.theme = "light", this.disableSignup = !1, this.mode = "signin", this.resetStep = "none", this.signupStep = "form", this.isLoading = !1, this.isClosing = !1, this.isVisible = !1, this.isLoggedIn = !1, this.email = "", this.password = "", this.givenName = "", this.familyName = "", this.newPassword = "", this.confirmPassword = "", this.notice = "", this.error = "", this.errors = {}, this.otpDigits = ["", "", "", "", "", ""], this.signupOtpDigits = ["", "", "", "", "", ""], this.isDragging = !1, this.dragStartY = 0, this.dragCurrentY = 0, this.dragStartTime = 0, this.lastDragEndTime = 0, this.cookies = ne(), this.scrollPosition = 0, this.transitionDuration = 300, this.hasHandledOAuthCallback = !1, this.boundKeyHandler = (e) => {
1483
1483
  e.key === "Escape" && this.isVisible && this.handleClose();
@@ -1662,8 +1662,8 @@ let m = class extends M {
1662
1662
  }
1663
1663
  }
1664
1664
  }
1665
- setAuthTokens(e, t, s) {
1666
- this.cookies.setAuthToken("ACCESS_TOKEN", e), this.cookies.setAuthToken("AUTH_TOKEN", t), this.cookies.setAuthToken("REFRESH_TOKEN", s), this.isLoggedIn = !0, this.dispatchEvent(
1665
+ setAuthTokens(e, t, s, i) {
1666
+ this.cookies.setAuthToken("ACCESS_TOKEN", e), this.cookies.setAuthToken("AUTH_TOKEN", t), this.cookies.setAuthToken("REFRESH_TOKEN", s), this.cookies.setCookie("USER_EMAIL", i.email), this.isLoggedIn = !0, this.dispatchEvent(
1667
1667
  new CustomEvent("auth-success", {
1668
1668
  bubbles: !0,
1669
1669
  composed: !0
@@ -1674,8 +1674,8 @@ let m = class extends M {
1674
1674
  const e = {
1675
1675
  email: this.email.trim(),
1676
1676
  password: this.password
1677
- }, { accessToken: t, idToken: s, refreshToken: i } = await this.getApiService().login(e);
1678
- this.setAuthTokens(t, s, i), this.handleClose();
1677
+ }, { accessToken: t, idToken: s, refreshToken: i, user: r } = await this.getApiService().login(e);
1678
+ this.setAuthTokens(t, s, i, r), this.handleClose();
1679
1679
  }
1680
1680
  isOAuthConfigured() {
1681
1681
  return [this.oauthDomain, this.oauthRegion, this.oauthUserPoolId, this.oauthClientId].every(
@@ -1719,12 +1719,12 @@ let m = class extends M {
1719
1719
  if (a)
1720
1720
  throw new Error(c || `OAuth error: ${a}`);
1721
1721
  if (t && s && i) {
1722
- const { accessToken: h, idToken: d, refreshToken: l } = await this.getApiService().login({
1722
+ const { accessToken: h, idToken: d, refreshToken: l, user: p } = await this.getApiService().login({
1723
1723
  accessToken: t,
1724
1724
  refreshToken: i,
1725
1725
  idToken: s
1726
1726
  });
1727
- this.setAuthTokens(h, d, l ?? i), this.handleClose();
1727
+ this.setAuthTokens(h, d, l ?? i, p), this.handleClose();
1728
1728
  } else if (r && o) {
1729
1729
  if (!this.isOAuthConfigured())
1730
1730
  throw new Error("OAuth is not configured correctly. Please try again later.");
@@ -1733,12 +1733,12 @@ let m = class extends M {
1733
1733
  throw new Error("OAuth is not configured correctly. Please try again later.");
1734
1734
  if (!h.validateState(o))
1735
1735
  throw new Error("Invalid state parameter. Please try signing in again.");
1736
- const d = await h.exchangeCodeForTokens(r), { accessToken: l, idToken: p, refreshToken: u } = await this.getApiService().login({
1736
+ const d = await h.exchangeCodeForTokens(r), { accessToken: l, idToken: p, refreshToken: u, user: $ } = await this.getApiService().login({
1737
1737
  accessToken: d.access_token,
1738
1738
  refreshToken: d.refresh_token,
1739
1739
  idToken: d.id_token
1740
1740
  });
1741
- this.setAuthTokens(l, p, u ?? d.refresh_token), this.handleClose();
1741
+ this.setAuthTokens(l, p, u ?? d.refresh_token, $), this.handleClose();
1742
1742
  } else
1743
1743
  throw new Error("Missing required OAuth parameters");
1744
1744
  } catch (h) {
@@ -2422,6 +2422,9 @@ let m = class extends M {
2422
2422
  this.cookies.clearAllAuthTokens(), this.isLoggedIn = !1;
2423
2423
  }
2424
2424
  }
2425
+ getUserEmail() {
2426
+ return this.cookies.getCookie("USER_EMAIL") || null;
2427
+ }
2425
2428
  };
2426
2429
  m.styles = de();
2427
2430
  y([
@@ -115,6 +115,7 @@ export declare class Auth extends LitElement {
115
115
  closeModal(): void;
116
116
  openModal(): void;
117
117
  refresh(): Promise<void>;
118
+ getUserEmail(): string | null;
118
119
  static styles: CSSResult;
119
120
  }
120
121
 
package/dist/index.d.ts CHANGED
@@ -115,6 +115,7 @@ export declare class Auth extends LitElement {
115
115
  closeModal(): void;
116
116
  openModal(): void;
117
117
  refresh(): Promise<void>;
118
+ getUserEmail(): string | null;
118
119
  static styles: CSSResult;
119
120
  }
120
121
 
package/dist/index.js CHANGED
@@ -63,7 +63,7 @@ const { is: Cs, defineProperty: Os, getOwnPropertyDescriptor: xs, getOwnProperty
63
63
  }
64
64
  }
65
65
  return s;
66
- } }, Ze = (t, e) => !Cs(t, e), gt = { attribute: !0, type: String, converter: ke, reflect: !1, useDefault: !1, hasChanged: Ze };
66
+ } }, Xe = (t, e) => !Cs(t, e), gt = { attribute: !0, type: String, converter: ke, reflect: !1, useDefault: !1, hasChanged: Xe };
67
67
  Symbol.metadata ??= Symbol("metadata"), xe.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
68
68
  let Q = class extends HTMLElement {
69
69
  static addInitializer(e) {
@@ -178,7 +178,7 @@ let Q = class extends HTMLElement {
178
178
  requestUpdate(e, s, r) {
179
179
  if (e !== void 0) {
180
180
  const i = this.constructor, o = this[e];
181
- if (r ??= i.getPropertyOptions(e), !((r.hasChanged ?? Ze)(o, s) || r.useDefault && r.reflect && o === this._$Ej?.get(e) && !this.hasAttribute(i._$Eu(e, r)))) return;
181
+ if (r ??= i.getPropertyOptions(e), !((r.hasChanged ?? Xe)(o, s) || r.useDefault && r.reflect && o === this._$Ej?.get(e) && !this.hasAttribute(i._$Eu(e, r)))) return;
182
182
  this.C(e, s, r);
183
183
  }
184
184
  this.isUpdatePending === !1 && (this._$ES = this._$EP());
@@ -247,9 +247,9 @@ let Q = class extends HTMLElement {
247
247
  }
248
248
  };
249
249
  Q.elementStyles = [], Q.shadowRootOptions = { mode: "open" }, Q[de("elementProperties")] = /* @__PURE__ */ new Map(), Q[de("finalized")] = /* @__PURE__ */ new Map(), Ns?.({ ReactiveElement: Q }), (xe.reactiveElementVersions ??= []).push("2.1.1");
250
- const Xe = globalThis, Ce = Xe.trustedTypes, yt = Ce ? Ce.createPolicy("lit-html", { createHTML: (t) => t }) : void 0, Vt = "$lit$", j = `lit$${Math.random().toFixed(9).slice(2)}$`, Wt = "?" + j, Ls = `<${Wt}>`, G = document, ue = () => G.createComment(""), pe = (t) => t === null || typeof t != "object" && typeof t != "function", Qe = Array.isArray, Is = (t) => Qe(t) || typeof t?.[Symbol.iterator] == "function", He = `[
250
+ const Ze = globalThis, Ce = Ze.trustedTypes, yt = Ce ? Ce.createPolicy("lit-html", { createHTML: (t) => t }) : void 0, Vt = "$lit$", j = `lit$${Math.random().toFixed(9).slice(2)}$`, Wt = "?" + j, Ls = `<${Wt}>`, G = document, ue = () => G.createComment(""), pe = (t) => t === null || typeof t != "object" && typeof t != "function", Qe = Array.isArray, Is = (t) => Qe(t) || typeof t?.[Symbol.iterator] == "function", He = `[
251
251
  \f\r]`, le = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, bt = /-->/g, wt = />/g, K = RegExp(`>|${He}(?:([^\\s"'>=/]+)(${He}*=${He}*(?:[^
252
- \f\r"'\`<>=]|("|')|))|$)`, "g"), St = /'/g, $t = /"/g, Yt = /^(?:script|style|textarea|title)$/i, Bs = (t) => (e, ...s) => ({ _$litType$: t, strings: e, values: s }), w = Bs(1), F = Symbol.for("lit-noChange"), S = Symbol.for("lit-nothing"), At = /* @__PURE__ */ new WeakMap(), W = G.createTreeWalker(G, 129);
252
+ \f\r"'\`<>=]|("|')|))|$)`, "g"), St = /'/g, $t = /"/g, Yt = /^(?:script|style|textarea|title)$/i, Bs = (t) => (e, ...s) => ({ _$litType$: t, strings: e, values: s }), w = Bs(1), M = Symbol.for("lit-noChange"), S = Symbol.for("lit-nothing"), At = /* @__PURE__ */ new WeakMap(), W = G.createTreeWalker(G, 129);
253
253
  function Jt(t, e) {
254
254
  if (!Qe(t) || !t.hasOwnProperty("raw")) throw Error("invalid template strings array");
255
255
  return yt !== void 0 ? yt.createHTML(e) : e;
@@ -280,7 +280,7 @@ class fe {
280
280
  if (i.nodeType === 1) {
281
281
  if (i.hasAttributes()) for (const u of i.getAttributeNames()) if (u.endsWith(Vt)) {
282
282
  const f = c[n++], y = i.getAttribute(u).split(j), p = /([.?@])?(.*)/.exec(f);
283
- l.push({ type: 1, index: o, name: p[2], strings: y, ctor: p[1] === "." ? Fs : p[1] === "?" ? Ms : p[1] === "@" ? qs : Re }), i.removeAttribute(u);
283
+ l.push({ type: 1, index: o, name: p[2], strings: y, ctor: p[1] === "." ? Ms : p[1] === "?" ? Fs : p[1] === "@" ? qs : Re }), i.removeAttribute(u);
284
284
  } else u.startsWith(j) && (l.push({ type: 6, index: o }), i.removeAttribute(u));
285
285
  if (Yt.test(i.tagName)) {
286
286
  const u = i.textContent.split(j), f = u.length - 1;
@@ -304,7 +304,7 @@ class fe {
304
304
  }
305
305
  }
306
306
  function te(t, e, s = t, r) {
307
- if (e === F) return e;
307
+ if (e === M) return e;
308
308
  let i = r !== void 0 ? s._$Co?.[r] : s._$Cl;
309
309
  const o = pe(e) ? void 0 : e._$litDirective$;
310
310
  return i?.constructor !== o && (i?._$AO?.(!1), o === void 0 ? i = void 0 : (i = new o(t), i._$AT(t, s, r)), r !== void 0 ? (s._$Co ??= [])[r] = i : s._$Cl = i), i !== void 0 && (e = te(t, i._$AS(t, e.values), i, r)), e;
@@ -356,7 +356,7 @@ class re {
356
356
  return this._$AB;
357
357
  }
358
358
  _$AI(e, s = this) {
359
- e = te(this, e, s), pe(e) ? e === S || e == null || e === "" ? (this._$AH !== S && this._$AR(), this._$AH = S) : e !== this._$AH && e !== F && this._(e) : e._$litType$ !== void 0 ? this.$(e) : e.nodeType !== void 0 ? this.T(e) : Is(e) ? this.k(e) : this._(e);
359
+ e = te(this, e, s), pe(e) ? e === S || e == null || e === "" ? (this._$AH !== S && this._$AR(), this._$AH = S) : e !== this._$AH && e !== M && this._(e) : e._$litType$ !== void 0 ? this.$(e) : e.nodeType !== void 0 ? this.T(e) : Is(e) ? this.k(e) : this._(e);
360
360
  }
361
361
  O(e) {
362
362
  return this._$AA.parentNode.insertBefore(e, this._$AB);
@@ -409,11 +409,11 @@ class Re {
409
409
  _$AI(e, s = this, r, i) {
410
410
  const o = this.strings;
411
411
  let n = !1;
412
- if (o === void 0) e = te(this, e, s, 0), n = !pe(e) || e !== this._$AH && e !== F, n && (this._$AH = e);
412
+ if (o === void 0) e = te(this, e, s, 0), n = !pe(e) || e !== this._$AH && e !== M, n && (this._$AH = e);
413
413
  else {
414
414
  const a = e;
415
415
  let l, h;
416
- for (e = o[0], l = 0; l < o.length - 1; l++) h = te(this, a[r + l], s, l), h === F && (h = this._$AH[l]), n ||= !pe(h) || h !== this._$AH[l], h === S ? e = S : e !== S && (e += (h ?? "") + o[l + 1]), this._$AH[l] = h;
416
+ for (e = o[0], l = 0; l < o.length - 1; l++) h = te(this, a[r + l], s, l), h === M && (h = this._$AH[l]), n ||= !pe(h) || h !== this._$AH[l], h === S ? e = S : e !== S && (e += (h ?? "") + o[l + 1]), this._$AH[l] = h;
417
417
  }
418
418
  n && !i && this.j(e);
419
419
  }
@@ -421,7 +421,7 @@ class Re {
421
421
  e === S ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, e ?? "");
422
422
  }
423
423
  }
424
- class Fs extends Re {
424
+ class Ms extends Re {
425
425
  constructor() {
426
426
  super(...arguments), this.type = 3;
427
427
  }
@@ -429,7 +429,7 @@ class Fs extends Re {
429
429
  this.element[this.name] = e === S ? void 0 : e;
430
430
  }
431
431
  }
432
- class Ms extends Re {
432
+ class Fs extends Re {
433
433
  constructor() {
434
434
  super(...arguments), this.type = 4;
435
435
  }
@@ -442,7 +442,7 @@ class qs extends Re {
442
442
  super(e, s, r, i, o), this.type = 5;
443
443
  }
444
444
  _$AI(e, s = this) {
445
- if ((e = te(this, e, s, 0) ?? S) === F) return;
445
+ if ((e = te(this, e, s, 0) ?? S) === M) return;
446
446
  const r = this._$AH, i = e === S && r !== S || e.capture !== r.capture || e.once !== r.once || e.passive !== r.passive, o = e !== S && (r === S || i);
447
447
  i && this.element.removeEventListener(this.name, this, r), o && this.element.addEventListener(this.name, this, e), this._$AH = e;
448
448
  }
@@ -461,8 +461,8 @@ class zs {
461
461
  te(this, e);
462
462
  }
463
463
  }
464
- const Ks = { I: re }, Vs = Xe.litHtmlPolyfillSupport;
465
- Vs?.(fe, re), (Xe.litHtmlVersions ??= []).push("3.3.1");
464
+ const Ks = { I: re }, Vs = Ze.litHtmlPolyfillSupport;
465
+ Vs?.(fe, re), (Ze.litHtmlVersions ??= []).push("3.3.1");
466
466
  const Ws = (t, e, s) => {
467
467
  const r = s?.renderBefore ?? e;
468
468
  let i = r._$litPart$;
@@ -492,7 +492,7 @@ let ee = class extends Q {
492
492
  super.disconnectedCallback(), this._$Do?.setConnected(!1);
493
493
  }
494
494
  render() {
495
- return F;
495
+ return M;
496
496
  }
497
497
  };
498
498
  ee._$litElement$ = !0, ee.finalized = !0, et.litElementHydrateSupport?.({ LitElement: ee });
@@ -504,7 +504,7 @@ const Gt = (t) => (e, s) => {
504
504
  customElements.define(t, e);
505
505
  })) : customElements.define(t, e);
506
506
  };
507
- const Js = { attribute: !0, type: String, converter: ke, reflect: !1, hasChanged: Ze }, Gs = (t = Js, e, s) => {
507
+ const Js = { attribute: !0, type: String, converter: ke, reflect: !1, hasChanged: Xe }, Gs = (t = Js, e, s) => {
508
508
  const { kind: r, metadata: i } = s;
509
509
  let o = globalThis.litPropertyMetadata.get(i);
510
510
  if (o === void 0 && globalThis.litPropertyMetadata.set(i, o = /* @__PURE__ */ new Map()), r === "setter" && ((t = Object.create(t)).wrapped = !0), o.set(s.name, t), r === "accessor") {
@@ -534,16 +534,16 @@ function O(t) {
534
534
  function T(t) {
535
535
  return O({ ...t, state: !0, attribute: !1 });
536
536
  }
537
- const Zs = (t, e, s) => (s.configurable = !0, s.enumerable = !0, Reflect.decorate && typeof e != "object" && Object.defineProperty(t, e, s), s);
537
+ const Xs = (t, e, s) => (s.configurable = !0, s.enumerable = !0, Reflect.decorate && typeof e != "object" && Object.defineProperty(t, e, s), s);
538
538
  function tt(t, e) {
539
539
  return (s, r, i) => {
540
540
  const o = (n) => n.renderRoot?.querySelector(t) ?? null;
541
- return Zs(s, r, { get() {
541
+ return Xs(s, r, { get() {
542
542
  return o(this);
543
543
  } });
544
544
  };
545
545
  }
546
- const Zt = { ATTRIBUTE: 1, CHILD: 2 }, Xt = (t) => (...e) => ({ _$litDirective$: t, values: e });
546
+ const Xt = { ATTRIBUTE: 1, CHILD: 2 }, Zt = (t) => (...e) => ({ _$litDirective$: t, values: e });
547
547
  class Qt {
548
548
  constructor(e) {
549
549
  }
@@ -560,9 +560,9 @@ class Qt {
560
560
  return this.render(...s);
561
561
  }
562
562
  }
563
- const vt = Xt(class extends Qt {
563
+ const vt = Zt(class extends Qt {
564
564
  constructor(t) {
565
- if (super(t), t.type !== Zt.ATTRIBUTE || t.name !== "class" || t.strings?.length > 2) throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.");
565
+ if (super(t), t.type !== Xt.ATTRIBUTE || t.name !== "class" || t.strings?.length > 2) throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.");
566
566
  }
567
567
  render(t) {
568
568
  return " " + Object.keys(t).filter(((e) => t[e])).join(" ") + " ";
@@ -579,14 +579,14 @@ const vt = Xt(class extends Qt {
579
579
  const i = !!e[r];
580
580
  i === this.st.has(r) || this.nt?.has(r) || (i ? (s.add(r), this.st.add(r)) : (s.remove(r), this.st.delete(r)));
581
581
  }
582
- return F;
582
+ return M;
583
583
  }
584
584
  });
585
- const { I: Xs } = Ks, Et = () => document.createComment(""), ce = (t, e, s) => {
585
+ const { I: Zs } = Ks, Et = () => document.createComment(""), ce = (t, e, s) => {
586
586
  const r = t._$AA.parentNode, i = e === void 0 ? t._$AB : e._$AA;
587
587
  if (s === void 0) {
588
588
  const o = r.insertBefore(Et(), i), n = r.insertBefore(Et(), i);
589
- s = new Xs(o, n, t, t.options);
589
+ s = new Zs(o, n, t, t.options);
590
590
  } else {
591
591
  const o = s._$AB.nextSibling, n = s._$AM, a = n !== t;
592
592
  if (a) {
@@ -609,9 +609,9 @@ const _t = (t, e, s) => {
609
609
  const r = /* @__PURE__ */ new Map();
610
610
  for (let i = e; i <= s; i++) r.set(t[i], i);
611
611
  return r;
612
- }, Tt = Xt(class extends Qt {
612
+ }, Tt = Zt(class extends Qt {
613
613
  constructor(t) {
614
- if (super(t), t.type !== Zt.CHILD) throw Error("repeat() can only be used in text expressions");
614
+ if (super(t), t.type !== Xt.CHILD) throw Error("repeat() can only be used in text expressions");
615
615
  }
616
616
  dt(t, e, s) {
617
617
  let r;
@@ -652,7 +652,7 @@ const _t = (t, e, s) => {
652
652
  const g = i[u++];
653
653
  g !== null && je(g);
654
654
  }
655
- return this.ut = n, er(t, l), F;
655
+ return this.ut = n, er(t, l), M;
656
656
  }
657
657
  }), es = ({
658
658
  baseUrl: t
@@ -814,7 +814,7 @@ const _t = (t, e, s) => {
814
814
  return f.json();
815
815
  }
816
816
  };
817
- }, Fe = {
817
+ }, Me = {
818
818
  AUTH_TOKEN: "authToken",
819
819
  ACCESS_TOKEN: "accessToken",
820
820
  REFRESH_TOKEN: "refreshToken"
@@ -851,9 +851,9 @@ const _t = (t, e, s) => {
851
851
  maxAge: -1
852
852
  });
853
853
  }, r = (l) => e(l) !== null, i = (l, h) => {
854
- t(Fe[l], h, sr);
855
- }, o = (l) => e(Fe[l]), n = (l) => {
856
- s(Fe[l]);
854
+ t(Me[l], h, sr);
855
+ }, o = (l) => e(Me[l]), n = (l) => {
856
+ s(Me[l]);
857
857
  };
858
858
  return {
859
859
  setCookie: t,
@@ -1662,8 +1662,8 @@ let A = class extends ee {
1662
1662
  }
1663
1663
  }
1664
1664
  }
1665
- setAuthTokens(t, e, s) {
1666
- this.cookies.setAuthToken("ACCESS_TOKEN", t), this.cookies.setAuthToken("AUTH_TOKEN", e), this.cookies.setAuthToken("REFRESH_TOKEN", s), this.isLoggedIn = !0, this.dispatchEvent(
1665
+ setAuthTokens(t, e, s, r) {
1666
+ this.cookies.setAuthToken("ACCESS_TOKEN", t), this.cookies.setAuthToken("AUTH_TOKEN", e), this.cookies.setAuthToken("REFRESH_TOKEN", s), this.cookies.setCookie("USER_EMAIL", r.email), this.isLoggedIn = !0, this.dispatchEvent(
1667
1667
  new CustomEvent("auth-success", {
1668
1668
  bubbles: !0,
1669
1669
  composed: !0
@@ -1674,8 +1674,8 @@ let A = class extends ee {
1674
1674
  const t = {
1675
1675
  email: this.email.trim(),
1676
1676
  password: this.password
1677
- }, { accessToken: e, idToken: s, refreshToken: r } = await this.getApiService().login(t);
1678
- this.setAuthTokens(e, s, r), this.handleClose();
1677
+ }, { accessToken: e, idToken: s, refreshToken: r, user: i } = await this.getApiService().login(t);
1678
+ this.setAuthTokens(e, s, r, i), this.handleClose();
1679
1679
  }
1680
1680
  isOAuthConfigured() {
1681
1681
  return [this.oauthDomain, this.oauthRegion, this.oauthUserPoolId, this.oauthClientId].every(
@@ -1719,12 +1719,12 @@ let A = class extends ee {
1719
1719
  if (n)
1720
1720
  throw new Error(a || `OAuth error: ${n}`);
1721
1721
  if (e && s && r) {
1722
- const { accessToken: h, idToken: c, refreshToken: u } = await this.getApiService().login({
1722
+ const { accessToken: h, idToken: c, refreshToken: u, user: f } = await this.getApiService().login({
1723
1723
  accessToken: e,
1724
1724
  refreshToken: r,
1725
1725
  idToken: s
1726
1726
  });
1727
- this.setAuthTokens(h, c, u ?? r), this.handleClose();
1727
+ this.setAuthTokens(h, c, u ?? r, f), this.handleClose();
1728
1728
  } else if (i && o) {
1729
1729
  if (!this.isOAuthConfigured())
1730
1730
  throw new Error("OAuth is not configured correctly. Please try again later.");
@@ -1733,12 +1733,12 @@ let A = class extends ee {
1733
1733
  throw new Error("OAuth is not configured correctly. Please try again later.");
1734
1734
  if (!h.validateState(o))
1735
1735
  throw new Error("Invalid state parameter. Please try signing in again.");
1736
- const c = await h.exchangeCodeForTokens(i), { accessToken: u, idToken: f, refreshToken: y } = await this.getApiService().login({
1736
+ const c = await h.exchangeCodeForTokens(i), { accessToken: u, idToken: f, refreshToken: y, user: p } = await this.getApiService().login({
1737
1737
  accessToken: c.access_token,
1738
1738
  refreshToken: c.refresh_token,
1739
1739
  idToken: c.id_token
1740
1740
  });
1741
- this.setAuthTokens(u, f, y ?? c.refresh_token), this.handleClose();
1741
+ this.setAuthTokens(u, f, y ?? c.refresh_token, p), this.handleClose();
1742
1742
  } else
1743
1743
  throw new Error("Missing required OAuth parameters");
1744
1744
  } catch (h) {
@@ -2422,6 +2422,9 @@ let A = class extends ee {
2422
2422
  this.cookies.clearAllAuthTokens(), this.isLoggedIn = !1;
2423
2423
  }
2424
2424
  }
2425
+ getUserEmail() {
2426
+ return this.cookies.getCookie("USER_EMAIL") || null;
2427
+ }
2425
2428
  };
2426
2429
  A.styles = nr();
2427
2430
  v([
@@ -2549,7 +2552,7 @@ var hr = Object.defineProperty, dr = Object.getOwnPropertyDescriptor, ie = (t, e
2549
2552
  (n = t[o]) && (i = (r ? n(e, s, i) : n(i)) || i);
2550
2553
  return r && i && hr(e, s, i), i;
2551
2554
  };
2552
- let M = class extends ee {
2555
+ let F = class extends ee {
2553
2556
  constructor() {
2554
2557
  super(...arguments), this.theme = "light", this.storageKey = "theme-preference", this.size = "sm", this.variant = "ghost", this.isDark = !1;
2555
2558
  }
@@ -2624,7 +2627,7 @@ let M = class extends ee {
2624
2627
  `;
2625
2628
  }
2626
2629
  };
2627
- M.styles = Kt`
2630
+ F.styles = Kt`
2628
2631
  :host {
2629
2632
  display: inline-block;
2630
2633
  }
@@ -2776,22 +2779,22 @@ M.styles = Kt`
2776
2779
  `;
2777
2780
  ie([
2778
2781
  O({ type: String, reflect: !0 })
2779
- ], M.prototype, "theme", 2);
2782
+ ], F.prototype, "theme", 2);
2780
2783
  ie([
2781
2784
  O({ type: String, attribute: "storage-key" })
2782
- ], M.prototype, "storageKey", 2);
2785
+ ], F.prototype, "storageKey", 2);
2783
2786
  ie([
2784
2787
  O({ type: String, attribute: "size" })
2785
- ], M.prototype, "size", 2);
2788
+ ], F.prototype, "size", 2);
2786
2789
  ie([
2787
2790
  O({ type: String, attribute: "variant" })
2788
- ], M.prototype, "variant", 2);
2791
+ ], F.prototype, "variant", 2);
2789
2792
  ie([
2790
2793
  T()
2791
- ], M.prototype, "isDark", 2);
2792
- M = ie([
2794
+ ], F.prototype, "isDark", 2);
2795
+ F = ie([
2793
2796
  Gt("theme-toggle")
2794
- ], M);
2797
+ ], F);
2795
2798
  function ss(t, e) {
2796
2799
  return function() {
2797
2800
  return t.apply(e, arguments);
@@ -2917,7 +2920,7 @@ const Or = (t, e, s, { allOwnKeys: r } = {}) => (ye(e, (i, o) => {
2917
2920
  let n;
2918
2921
  (n = e(i, o, t)) !== !1 && (r[o] = n || i);
2919
2922
  }), Object.defineProperties(t, r);
2920
- }, Fr = (t) => {
2923
+ }, Mr = (t) => {
2921
2924
  ls(t, (e, s) => {
2922
2925
  if (P(t) && ["arguments", "caller", "callee"].indexOf(s) !== -1)
2923
2926
  return !1;
@@ -2932,7 +2935,7 @@ const Or = (t, e, s, { allOwnKeys: r } = {}) => (ye(e, (i, o) => {
2932
2935
  });
2933
2936
  }
2934
2937
  });
2935
- }, Mr = (t, e) => {
2938
+ }, Fr = (t, e) => {
2936
2939
  const s = {}, r = (i) => {
2937
2940
  i.forEach((o) => {
2938
2941
  s[o] = !0;
@@ -3014,8 +3017,8 @@ const Vr = (t) => {
3014
3017
  hasOwnProp: kt,
3015
3018
  // an alias to avoid ESLint no-prototype-builtins detection
3016
3019
  reduceDescriptors: ls,
3017
- freezeMethods: Fr,
3018
- toObjectSet: Mr,
3020
+ freezeMethods: Mr,
3021
+ toObjectSet: Fr,
3019
3022
  toCamelCase: Hr,
3020
3023
  noop: qr,
3021
3024
  toFiniteNumber: zr,
@@ -3082,7 +3085,7 @@ $.from = (t, e, s, r, i, o) => {
3082
3085
  const a = t && t.message ? t.message : "Error", l = e == null && t ? t.code : e;
3083
3086
  return $.call(n, a, l, s, r, i), t && n.cause == null && Object.defineProperty(n, "cause", { value: t, configurable: !0 }), n.name = t && t.name || "Error", o && Object.assign(n, o), n;
3084
3087
  };
3085
- const Zr = null;
3088
+ const Xr = null;
3086
3089
  function Ve(t) {
3087
3090
  return d.isPlainObject(t) || d.isArray(t);
3088
3091
  }
@@ -3094,7 +3097,7 @@ function Ct(t, e, s) {
3094
3097
  return i = us(i), !s && o ? "[" + i + "]" : i;
3095
3098
  }).join(s ? "." : "") : e;
3096
3099
  }
3097
- function Xr(t) {
3100
+ function Zr(t) {
3098
3101
  return d.isArray(t) && !t.some(Ve);
3099
3102
  }
3100
3103
  const Qr = d.toFlatObject(d, {}, null, function(e) {
@@ -3128,7 +3131,7 @@ function Ne(t, e, s) {
3128
3131
  if (p && !m && typeof p == "object") {
3129
3132
  if (d.endsWith(g, "{}"))
3130
3133
  g = r ? g : g.slice(0, -2), p = JSON.stringify(p);
3131
- else if (d.isArray(p) && Xr(p) || (d.isFileList(p) || d.endsWith(g, "[]")) && (b = d.toArray(p)))
3134
+ else if (d.isArray(p) && Zr(p) || (d.isFileList(p) || d.endsWith(g, "[]")) && (b = d.toArray(p)))
3132
3135
  return g = us(g), b.forEach(function(E, k) {
3133
3136
  !(d.isUndefined(E) || E === null) && e.append(
3134
3137
  // eslint-disable-next-line no-nested-ternary
@@ -3442,7 +3445,7 @@ function mi(t) {
3442
3445
  return e;
3443
3446
  }
3444
3447
  const gi = (t) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());
3445
- function Me(t, e, s, r, i) {
3448
+ function Fe(t, e, s, r, i) {
3446
3449
  if (d.isFunction(r))
3447
3450
  return r.call(this, e, s);
3448
3451
  if (i && (e = s), !!d.isString(e)) {
@@ -3516,7 +3519,7 @@ class D {
3516
3519
  has(e, s) {
3517
3520
  if (e = he(e), e) {
3518
3521
  const r = d.findKey(this, e);
3519
- return !!(r && this[r] !== void 0 && (!s || Me(this, this[r], r, s)));
3522
+ return !!(r && this[r] !== void 0 && (!s || Fe(this, this[r], r, s)));
3520
3523
  }
3521
3524
  return !1;
3522
3525
  }
@@ -3526,7 +3529,7 @@ class D {
3526
3529
  function o(n) {
3527
3530
  if (n = he(n), n) {
3528
3531
  const a = d.findKey(r, n);
3529
- a && (!s || Me(r, r[a], a, s)) && (delete r[a], i = !0);
3532
+ a && (!s || Fe(r, r[a], a, s)) && (delete r[a], i = !0);
3530
3533
  }
3531
3534
  }
3532
3535
  return d.isArray(e) ? e.forEach(o) : o(e), i;
@@ -3536,7 +3539,7 @@ class D {
3536
3539
  let r = s.length, i = !1;
3537
3540
  for (; r--; ) {
3538
3541
  const o = s[r];
3539
- (!e || Me(this, this[o], o, e, !0)) && (delete this[o], i = !0);
3542
+ (!e || Fe(this, this[o], o, e, !0)) && (delete this[o], i = !0);
3540
3543
  }
3541
3544
  return i;
3542
3545
  }
@@ -3730,7 +3733,7 @@ function ws(t, e, s) {
3730
3733
  return t && (r || s == !1) ? _i(t, e) : e;
3731
3734
  }
3732
3735
  const Ut = (t) => t instanceof D ? { ...t } : t;
3733
- function Z(t, e) {
3736
+ function X(t, e) {
3734
3737
  e = e || {};
3735
3738
  const s = {};
3736
3739
  function r(h, c, u, f) {
@@ -3795,7 +3798,7 @@ function Z(t, e) {
3795
3798
  }), s;
3796
3799
  }
3797
3800
  const Ss = (t) => {
3798
- const e = Z({}, t);
3801
+ const e = X({}, t);
3799
3802
  let { data: s, withXSRFToken: r, xsrfHeaderName: i, xsrfCookieName: o, headers: n, auth: a } = e;
3800
3803
  if (e.headers = n = D.from(n), e.url = fs(ws(e.baseURL, e.url, e.allowAbsoluteUrls), t.params, t.paramsSerializer), a && n.set(
3801
3804
  "Authorization",
@@ -4038,8 +4041,8 @@ const Ss = (t) => {
4038
4041
  method: "POST",
4039
4042
  body: b,
4040
4043
  duplex: "half"
4041
- }), X;
4042
- if (d.isFormData(b) && (X = H.headers.get("content-type")) && Ie.setContentType(X), H.body) {
4044
+ }), Z;
4045
+ if (d.isFormData(b) && (Z = H.headers.get("content-type")) && Ie.setContentType(Z), H.body) {
4043
4046
  const [Be, $e] = Pt(
4044
4047
  ct,
4045
4048
  Oe(Dt(q))
@@ -4065,8 +4068,8 @@ const Ss = (t) => {
4065
4068
  ["status", "statusText", "headers"].forEach((ut) => {
4066
4069
  H[ut] = B[ut];
4067
4070
  });
4068
- const X = d.toFiniteNumber(B.headers.get("content-length")), [Be, $e] = R && Pt(
4069
- X,
4071
+ const Z = d.toFiniteNumber(B.headers.get("content-length")), [Be, $e] = R && Pt(
4072
+ Z,
4070
4073
  Oe(Dt(R), !0)
4071
4074
  ) || [];
4072
4075
  B = new r(
@@ -4078,8 +4081,8 @@ const Ss = (t) => {
4078
4081
  }
4079
4082
  U = U || "text";
4080
4083
  let _s = await u[d.findKey(u, U) || "text"](B, p);
4081
- return !dt && z && z(), await new Promise((H, X) => {
4082
- bs(H, X, {
4084
+ return !dt && z && z(), await new Promise((H, Z) => {
4085
+ bs(H, Z, {
4083
4086
  data: _s,
4084
4087
  headers: D.from(B.headers),
4085
4088
  status: B.status,
@@ -4111,7 +4114,7 @@ const Ss = (t) => {
4111
4114
  };
4112
4115
  $s();
4113
4116
  const ot = {
4114
- http: Zr,
4117
+ http: Xr,
4115
4118
  xhr: ki,
4116
4119
  fetch: {
4117
4120
  get: $s
@@ -4171,7 +4174,7 @@ function ze(t) {
4171
4174
  if (t.cancelToken && t.cancelToken.throwIfRequested(), t.signal && t.signal.aborted)
4172
4175
  throw new ne(null, t);
4173
4176
  }
4174
- function Ft(t) {
4177
+ function Mt(t) {
4175
4178
  return ze(t), t.headers = D.from(t.headers), t.data = qe.call(
4176
4179
  t,
4177
4180
  t.transformRequest
@@ -4195,7 +4198,7 @@ const vs = "1.13.2", Le = {};
4195
4198
  return typeof r === t || "a" + (e < 1 ? "n " : " ") + t;
4196
4199
  };
4197
4200
  });
4198
- const Mt = {};
4201
+ const Ft = {};
4199
4202
  Le.transitional = function(e, s, r) {
4200
4203
  function i(o, n) {
4201
4204
  return "[Axios v" + vs + "] Transitional option '" + o + "'" + n + (r ? ". " + r : "");
@@ -4206,7 +4209,7 @@ Le.transitional = function(e, s, r) {
4206
4209
  i(n, " has been removed" + (s ? " in " + s : "")),
4207
4210
  $.ERR_DEPRECATED
4208
4211
  );
4209
- return s && !Mt[n] && (Mt[n] = !0), e ? e(o, n, a) : !0;
4212
+ return s && !Ft[n] && (Ft[n] = !0), e ? e(o, n, a) : !0;
4210
4213
  };
4211
4214
  };
4212
4215
  Le.spelling = function(e) {
@@ -4266,7 +4269,7 @@ class J {
4266
4269
  }
4267
4270
  }
4268
4271
  _request(e, s) {
4269
- typeof e == "string" ? (s = s || {}, s.url = e) : s = e || {}, s = Z(this.defaults, s);
4272
+ typeof e == "string" ? (s = s || {}, s.url = e) : s = e || {}, s = X(this.defaults, s);
4270
4273
  const { transitional: r, paramsSerializer: i, headers: o } = s;
4271
4274
  r !== void 0 && Te.assertOptions(r, {
4272
4275
  silentJSONParsing: I.transitional(I.boolean),
@@ -4302,7 +4305,7 @@ class J {
4302
4305
  });
4303
4306
  let c, u = 0, f;
4304
4307
  if (!l) {
4305
- const p = [Ft.bind(this), void 0];
4308
+ const p = [Mt.bind(this), void 0];
4306
4309
  for (p.unshift(...a), p.push(...h), f = p.length, c = Promise.resolve(s); u < f; )
4307
4310
  c = c.then(p[u++], p[u++]);
4308
4311
  return c;
@@ -4319,7 +4322,7 @@ class J {
4319
4322
  }
4320
4323
  }
4321
4324
  try {
4322
- c = Ft.call(this, y);
4325
+ c = Mt.call(this, y);
4323
4326
  } catch (p) {
4324
4327
  return Promise.reject(p);
4325
4328
  }
@@ -4328,14 +4331,14 @@ class J {
4328
4331
  return c;
4329
4332
  }
4330
4333
  getUri(e) {
4331
- e = Z(this.defaults, e);
4334
+ e = X(this.defaults, e);
4332
4335
  const s = ws(e.baseURL, e.url, e.allowAbsoluteUrls);
4333
4336
  return fs(s, e.params, e.paramsSerializer);
4334
4337
  }
4335
4338
  }
4336
4339
  d.forEach(["delete", "get", "head", "options"], function(e) {
4337
4340
  J.prototype[e] = function(s, r) {
4338
- return this.request(Z(r || {}, {
4341
+ return this.request(X(r || {}, {
4339
4342
  method: e,
4340
4343
  url: s,
4341
4344
  data: (r || {}).data
@@ -4345,7 +4348,7 @@ d.forEach(["delete", "get", "head", "options"], function(e) {
4345
4348
  d.forEach(["post", "put", "patch"], function(e) {
4346
4349
  function s(r) {
4347
4350
  return function(o, n, a) {
4348
- return this.request(Z(a || {}, {
4351
+ return this.request(X(a || {}, {
4349
4352
  method: e,
4350
4353
  headers: r ? {
4351
4354
  "Content-Type": "multipart/form-data"
@@ -4515,7 +4518,7 @@ Object.entries(Ye).forEach(([t, e]) => {
4515
4518
  function Es(t) {
4516
4519
  const e = new J(t), s = ss(J.prototype.request, e);
4517
4520
  return d.extend(s, J.prototype, e, { allOwnKeys: !0 }), d.extend(s, e, null, { allOwnKeys: !0 }), s.create = function(i) {
4518
- return Es(Z(t, i));
4521
+ return Es(X(t, i));
4519
4522
  }, s;
4520
4523
  }
4521
4524
  const C = Es(be);
@@ -4532,7 +4535,7 @@ C.all = function(e) {
4532
4535
  };
4533
4536
  C.spread = Bi;
4534
4537
  C.isAxiosError = Hi;
4535
- C.mergeConfig = Z;
4538
+ C.mergeConfig = X;
4536
4539
  C.AxiosHeaders = D;
4537
4540
  C.formToJSON = (t) => gs(d.isHTMLForm(t) ? new FormData(t) : t);
4538
4541
  C.getAdapter = As.getAdapter;
@@ -4553,8 +4556,8 @@ const ji = ({ baseUrl: t, apiBaseUrl: e }) => {
4553
4556
  let o = !1, n = null;
4554
4557
  return i.interceptors.request.use(
4555
4558
  (a) => {
4556
- const l = s.getAuthToken("AUTH_TOKEN");
4557
- return l && a.headers && (a.headers.Authorization = `Bearer ${l}`), a;
4559
+ const l = s.getAuthToken("AUTH_TOKEN"), h = s.getAuthToken("ACCESS_TOKEN");
4560
+ return l && a.headers && (a.headers.Authorization = `Bearer ${l}`, a.headers["X-Access-Token"] = h), a;
4558
4561
  },
4559
4562
  (a) => Promise.reject(a)
4560
4563
  ), i.interceptors.response.use(
@@ -4600,7 +4603,7 @@ const ji = ({ baseUrl: t, apiBaseUrl: e }) => {
4600
4603
  export {
4601
4604
  A as Auth,
4602
4605
  qt as AuthRefreshError,
4603
- M as ThemeToggle,
4606
+ F as ThemeToggle,
4604
4607
  Ki as apiClient,
4605
4608
  ji as createApiClient
4606
4609
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cal.macconnachie/web-components",
3
- "version": "0.0.18",
3
+ "version": "0.0.20",
4
4
  "description": "Web components hosted on a CDN",
5
5
  "keywords": [
6
6
  "lit",