@cal.macconnachie/web-components 0.0.20 → 1.0.1

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.
@@ -1,15 +1,15 @@
1
- const z = globalThis, Z = z.ShadowRoot && (z.ShadyCSS === void 0 || z.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, Q = Symbol(), ot = /* @__PURE__ */ new WeakMap();
2
- let wt = class {
3
- constructor(t, s, i) {
4
- if (this._$cssResult$ = !0, i !== Q) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
1
+ const B = globalThis, Z = B.ShadowRoot && (B.ShadyCSS === void 0 || B.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, Q = Symbol(), ot = /* @__PURE__ */ new WeakMap();
2
+ let $t = class {
3
+ constructor(t, s, r) {
4
+ if (this._$cssResult$ = !0, r !== Q) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
5
5
  this.cssText = t, this.t = s;
6
6
  }
7
7
  get styleSheet() {
8
8
  let t = this.o;
9
9
  const s = this.t;
10
10
  if (Z && t === void 0) {
11
- const i = s !== void 0 && s.length === 1;
12
- i && (t = ot.get(s)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), i && ot.set(s, t));
11
+ const r = s !== void 0 && s.length === 1;
12
+ r && (t = ot.get(s)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), r && ot.set(s, t));
13
13
  }
14
14
  return t;
15
15
  }
@@ -17,28 +17,28 @@ let wt = class {
17
17
  return this.cssText;
18
18
  }
19
19
  };
20
- const Et = (e) => new wt(typeof e == "string" ? e : e + "", void 0, Q), xt = (e, ...t) => {
21
- const s = e.length === 1 ? e[0] : t.reduce(((i, r, o) => i + ((a) => {
20
+ const St = (e) => new $t(typeof e == "string" ? e : e + "", void 0, Q), kt = (e, ...t) => {
21
+ const s = e.length === 1 ? e[0] : t.reduce(((r, i, o) => r + ((a) => {
22
22
  if (a._$cssResult$ === !0) return a.cssText;
23
23
  if (typeof a == "number") return a;
24
24
  throw Error("Value passed to 'css' function must be a 'css' function result: " + a + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
25
- })(r) + e[o + 1]), e[0]);
26
- return new wt(s, e, Q);
27
- }, Tt = (e, t) => {
25
+ })(i) + e[o + 1]), e[0]);
26
+ return new $t(s, e, Q);
27
+ }, Et = (e, t) => {
28
28
  if (Z) e.adoptedStyleSheets = t.map(((s) => s instanceof CSSStyleSheet ? s : s.styleSheet));
29
29
  else for (const s of t) {
30
- const i = document.createElement("style"), r = z.litNonce;
31
- r !== void 0 && i.setAttribute("nonce", r), i.textContent = s.cssText, e.appendChild(i);
30
+ const r = document.createElement("style"), i = B.litNonce;
31
+ i !== void 0 && r.setAttribute("nonce", i), r.textContent = s.cssText, e.appendChild(r);
32
32
  }
33
33
  }, at = Z ? (e) => e : (e) => e instanceof CSSStyleSheet ? ((t) => {
34
34
  let s = "";
35
- for (const i of t.cssRules) s += i.cssText;
36
- return Et(s);
35
+ for (const r of t.cssRules) s += r.cssText;
36
+ return St(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, M = (e, t) => e, Y = { toAttribute(e, t) {
38
+ const { is: xt, defineProperty: Ct, getOwnPropertyDescriptor: Tt, getOwnPropertyNames: Pt, getOwnPropertySymbols: Ot, getPrototypeOf: Ut } = Object, W = globalThis, nt = W.trustedTypes, Rt = nt ? nt.emptyScript : "", Dt = W.reactiveElementPolyfillSupport, M = (e, t) => e, K = { toAttribute(e, t) {
39
39
  switch (t) {
40
40
  case Boolean:
41
- e = e ? Nt : null;
41
+ e = e ? Rt : null;
42
42
  break;
43
43
  case Object:
44
44
  case Array:
@@ -63,9 +63,9 @@ const { is: Pt, defineProperty: Ot, getOwnPropertyDescriptor: Dt, getOwnProperty
63
63
  }
64
64
  }
65
65
  return s;
66
- } }, X = (e, t) => !Pt(e, t), lt = { attribute: !0, type: String, converter: Y, reflect: !1, useDefault: !1, hasChanged: X };
67
- Symbol.metadata ??= Symbol("metadata"), F.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
68
- let U = class extends HTMLElement {
66
+ } }, X = (e, t) => !xt(e, t), lt = { attribute: !0, type: String, converter: K, reflect: !1, useDefault: !1, hasChanged: X };
67
+ Symbol.metadata ??= Symbol("metadata"), W.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
68
+ let R = class extends HTMLElement {
69
69
  static addInitializer(t) {
70
70
  this._$Ei(), (this.l ??= []).push(t);
71
71
  }
@@ -74,19 +74,19 @@ let U = class extends HTMLElement {
74
74
  }
75
75
  static createProperty(t, s = lt) {
76
76
  if (s.state && (s.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(t) && ((s = Object.create(s)).wrapped = !0), this.elementProperties.set(t, s), !s.noAccessor) {
77
- const i = Symbol(), r = this.getPropertyDescriptor(t, i, s);
78
- r !== void 0 && Ot(this.prototype, t, r);
77
+ const r = Symbol(), i = this.getPropertyDescriptor(t, r, s);
78
+ i !== void 0 && Ct(this.prototype, t, i);
79
79
  }
80
80
  }
81
- static getPropertyDescriptor(t, s, i) {
82
- const { get: r, set: o } = Dt(this.prototype, t) ?? { get() {
81
+ static getPropertyDescriptor(t, s, r) {
82
+ const { get: i, set: o } = Tt(this.prototype, t) ?? { get() {
83
83
  return this[s];
84
84
  }, set(a) {
85
85
  this[s] = a;
86
86
  } };
87
- return { get: r, set(a) {
88
- const c = r?.call(this);
89
- o?.call(this, a), this.requestUpdate(t, c, i);
87
+ return { get: i, set(a) {
88
+ const p = i?.call(this);
89
+ o?.call(this, a), this.requestUpdate(t, p, r);
90
90
  }, configurable: !0, enumerable: !0 };
91
91
  }
92
92
  static getPropertyOptions(t) {
@@ -94,38 +94,38 @@ let U = class extends HTMLElement {
94
94
  }
95
95
  static _$Ei() {
96
96
  if (this.hasOwnProperty(M("elementProperties"))) return;
97
- const t = It(this);
97
+ const t = Ut(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
101
  if (this.hasOwnProperty(M("finalized"))) return;
102
102
  if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(M("properties"))) {
103
- const s = this.properties, i = [...Ut(s), ...Rt(s)];
104
- for (const r of i) this.createProperty(r, s[r]);
103
+ const s = this.properties, r = [...Pt(s), ...Ot(s)];
104
+ for (const i of r) this.createProperty(i, s[i]);
105
105
  }
106
106
  const t = this[Symbol.metadata];
107
107
  if (t !== null) {
108
108
  const s = litPropertyMetadata.get(t);
109
- if (s !== void 0) for (const [i, r] of s) this.elementProperties.set(i, r);
109
+ if (s !== void 0) for (const [r, i] of s) this.elementProperties.set(r, i);
110
110
  }
111
111
  this._$Eh = /* @__PURE__ */ new Map();
112
- for (const [s, i] of this.elementProperties) {
113
- const r = this._$Eu(s, i);
114
- r !== void 0 && this._$Eh.set(r, s);
112
+ for (const [s, r] of this.elementProperties) {
113
+ const i = this._$Eu(s, r);
114
+ i !== void 0 && this._$Eh.set(i, s);
115
115
  }
116
116
  this.elementStyles = this.finalizeStyles(this.styles);
117
117
  }
118
118
  static finalizeStyles(t) {
119
119
  const s = [];
120
120
  if (Array.isArray(t)) {
121
- const i = new Set(t.flat(1 / 0).reverse());
122
- for (const r of i) s.unshift(at(r));
121
+ const r = new Set(t.flat(1 / 0).reverse());
122
+ for (const i of r) s.unshift(at(i));
123
123
  } else t !== void 0 && s.push(at(t));
124
124
  return s;
125
125
  }
126
126
  static _$Eu(t, s) {
127
- const i = s.attribute;
128
- return i === !1 ? void 0 : typeof i == "string" ? i : typeof t == "string" ? t.toLowerCase() : void 0;
127
+ const r = s.attribute;
128
+ return r === !1 ? void 0 : typeof r == "string" ? r : typeof t == "string" ? t.toLowerCase() : void 0;
129
129
  }
130
130
  constructor() {
131
131
  super(), this._$Ep = void 0, this.isUpdatePending = !1, this.hasUpdated = !1, this._$Em = null, this._$Ev();
@@ -141,12 +141,12 @@ let U = class extends HTMLElement {
141
141
  }
142
142
  _$E_() {
143
143
  const t = /* @__PURE__ */ new Map(), s = this.constructor.elementProperties;
144
- for (const i of s.keys()) this.hasOwnProperty(i) && (t.set(i, this[i]), delete this[i]);
144
+ for (const r of s.keys()) this.hasOwnProperty(r) && (t.set(r, this[r]), delete this[r]);
145
145
  t.size > 0 && (this._$Ep = t);
146
146
  }
147
147
  createRenderRoot() {
148
148
  const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
149
- return Tt(t, this.constructor.elementStyles), t;
149
+ return Et(t, this.constructor.elementStyles), t;
150
150
  }
151
151
  connectedCallback() {
152
152
  this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(!0), this._$EO?.forEach(((t) => t.hostConnected?.()));
@@ -156,35 +156,35 @@ let U = class extends HTMLElement {
156
156
  disconnectedCallback() {
157
157
  this._$EO?.forEach(((t) => t.hostDisconnected?.()));
158
158
  }
159
- attributeChangedCallback(t, s, i) {
160
- this._$AK(t, i);
159
+ attributeChangedCallback(t, s, r) {
160
+ this._$AK(t, r);
161
161
  }
162
162
  _$ET(t, s) {
163
- const i = this.constructor.elementProperties.get(t), r = this.constructor._$Eu(t, i);
164
- if (r !== void 0 && i.reflect === !0) {
165
- const o = (i.converter?.toAttribute !== void 0 ? i.converter : Y).toAttribute(s, i.type);
166
- this._$Em = t, o == null ? this.removeAttribute(r) : this.setAttribute(r, o), this._$Em = null;
163
+ const r = this.constructor.elementProperties.get(t), i = this.constructor._$Eu(t, r);
164
+ if (i !== void 0 && r.reflect === !0) {
165
+ const o = (r.converter?.toAttribute !== void 0 ? r.converter : K).toAttribute(s, r.type);
166
+ this._$Em = t, o == null ? this.removeAttribute(i) : this.setAttribute(i, o), this._$Em = null;
167
167
  }
168
168
  }
169
169
  _$AK(t, s) {
170
- const i = this.constructor, r = i._$Eh.get(t);
171
- if (r !== void 0 && this._$Em !== r) {
172
- const o = i.getPropertyOptions(r), a = typeof o.converter == "function" ? { fromAttribute: o.converter } : o.converter?.fromAttribute !== void 0 ? o.converter : Y;
173
- this._$Em = r;
174
- const c = a.fromAttribute(s, o.type);
175
- this[r] = c ?? this._$Ej?.get(r) ?? c, this._$Em = null;
170
+ const r = this.constructor, i = r._$Eh.get(t);
171
+ if (i !== void 0 && this._$Em !== i) {
172
+ const o = r.getPropertyOptions(i), a = typeof o.converter == "function" ? { fromAttribute: o.converter } : o.converter?.fromAttribute !== void 0 ? o.converter : K;
173
+ this._$Em = i;
174
+ const p = a.fromAttribute(s, o.type);
175
+ this[i] = p ?? this._$Ej?.get(i) ?? p, this._$Em = null;
176
176
  }
177
177
  }
178
- requestUpdate(t, s, i) {
178
+ requestUpdate(t, s, r) {
179
179
  if (t !== void 0) {
180
- const r = this.constructor, o = this[t];
181
- if (i ??= r.getPropertyOptions(t), !((i.hasChanged ?? X)(o, s) || i.useDefault && i.reflect && o === this._$Ej?.get(t) && !this.hasAttribute(r._$Eu(t, i)))) return;
182
- this.C(t, s, i);
180
+ const i = this.constructor, o = this[t];
181
+ if (r ??= i.getPropertyOptions(t), !((r.hasChanged ?? X)(o, s) || r.useDefault && r.reflect && o === this._$Ej?.get(t) && !this.hasAttribute(i._$Eu(t, r)))) return;
182
+ this.C(t, s, r);
183
183
  }
184
184
  this.isUpdatePending === !1 && (this._$ES = this._$EP());
185
185
  }
186
- C(t, s, { useDefault: i, reflect: r, wrapped: o }, a) {
187
- i && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(t) && (this._$Ej.set(t, a ?? s ?? this[t]), o !== !0 || a !== void 0) || (this._$AL.has(t) || (this.hasUpdated || i || (s = void 0), this._$AL.set(t, s)), r === !0 && this._$Em !== t && (this._$Eq ??= /* @__PURE__ */ new Set()).add(t));
186
+ C(t, s, { useDefault: r, reflect: i, wrapped: o }, a) {
187
+ r && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(t) && (this._$Ej.set(t, a ?? s ?? this[t]), o !== !0 || a !== void 0) || (this._$AL.has(t) || (this.hasUpdated || r || (s = void 0), this._$AL.set(t, s)), i === !0 && this._$Em !== t && (this._$Eq ??= /* @__PURE__ */ new Set()).add(t));
188
188
  }
189
189
  async _$EP() {
190
190
  this.isUpdatePending = !0;
@@ -203,21 +203,21 @@ let U = class extends HTMLElement {
203
203
  if (!this.isUpdatePending) return;
204
204
  if (!this.hasUpdated) {
205
205
  if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) {
206
- for (const [r, o] of this._$Ep) this[r] = o;
206
+ for (const [i, o] of this._$Ep) this[i] = o;
207
207
  this._$Ep = void 0;
208
208
  }
209
- const i = this.constructor.elementProperties;
210
- if (i.size > 0) for (const [r, o] of i) {
211
- const { wrapped: a } = o, c = this[r];
212
- a !== !0 || this._$AL.has(r) || c === void 0 || this.C(r, void 0, o, c);
209
+ const r = this.constructor.elementProperties;
210
+ if (r.size > 0) for (const [i, o] of r) {
211
+ const { wrapped: a } = o, p = this[i];
212
+ a !== !0 || this._$AL.has(i) || p === void 0 || this.C(i, void 0, o, p);
213
213
  }
214
214
  }
215
215
  let t = !1;
216
216
  const s = this._$AL;
217
217
  try {
218
- t = this.shouldUpdate(s), t ? (this.willUpdate(s), this._$EO?.forEach(((i) => i.hostUpdate?.())), this.update(s)) : this._$EM();
219
- } catch (i) {
220
- throw t = !1, this._$EM(), i;
218
+ t = this.shouldUpdate(s), t ? (this.willUpdate(s), this._$EO?.forEach(((r) => r.hostUpdate?.())), this.update(s)) : this._$EM();
219
+ } catch (r) {
220
+ throw t = !1, this._$EM(), r;
221
221
  }
222
222
  t && this._$AE(s);
223
223
  }
@@ -246,70 +246,70 @@ let U = class extends HTMLElement {
246
246
  firstUpdated(t) {
247
247
  }
248
248
  };
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
- \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), E = Symbol.for("lit-noChange"), g = Symbol.for("lit-nothing"), gt = /* @__PURE__ */ new WeakMap(), O = D.createTreeWalker(D, 129);
253
- function _t(e, t) {
249
+ R.elementStyles = [], R.shadowRootOptions = { mode: "open" }, R[M("elementProperties")] = /* @__PURE__ */ new Map(), R[M("finalized")] = /* @__PURE__ */ new Map(), Dt?.({ ReactiveElement: R }), (W.reactiveElementVersions ??= []).push("2.1.1");
250
+ const tt = globalThis, F = tt.trustedTypes, ht = F ? F.createPolicy("lit-html", { createHTML: (e) => e }) : void 0, bt = "$lit$", E = `lit$${Math.random().toFixed(9).slice(2)}$`, wt = "?" + E, It = `<${wt}>`, O = document, j = () => O.createComment(""), q = (e) => e === null || typeof e != "object" && typeof e != "function", et = Array.isArray, Nt = (e) => et(e) || typeof e?.[Symbol.iterator] == "function", G = `[
251
+ \f\r]`, N = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, ct = /-->/g, dt = />/g, C = RegExp(`>|${G}(?:([^\\s"'>=/]+)(${G}*=${G}*(?:[^
252
+ \f\r"'\`<>=]|("|')|))|$)`, "g"), pt = /'/g, ut = /"/g, vt = /^(?:script|style|textarea|title)$/i, Lt = (e) => (t, ...s) => ({ _$litType$: e, strings: t, values: s }), m = Lt(1), U = Symbol.for("lit-noChange"), g = Symbol.for("lit-nothing"), gt = /* @__PURE__ */ new WeakMap(), P = O.createTreeWalker(O, 129);
253
+ function At(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;
256
256
  }
257
- const qt = (e, t) => {
258
- const s = e.length - 1, i = [];
259
- let r, o = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", a = N;
260
- for (let c = 0; c < s; c++) {
261
- const n = e[c];
262
- let h, d, l = -1, p = 0;
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
- const u = a === T && e[c + 1].startsWith("/>") ? " " : "";
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
- }
267
- return [_t(e, o + (e[s] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), i];
257
+ const Mt = (e, t) => {
258
+ const s = e.length - 1, r = [];
259
+ let i, o = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", a = N;
260
+ for (let p = 0; p < s; p++) {
261
+ const n = e[p];
262
+ let h, c, l = -1, d = 0;
263
+ for (; d < n.length && (a.lastIndex = d, c = a.exec(n), c !== null); ) d = a.lastIndex, a === N ? c[1] === "!--" ? a = ct : c[1] !== void 0 ? a = dt : c[2] !== void 0 ? (vt.test(c[2]) && (i = RegExp("</" + c[2], "g")), a = C) : c[3] !== void 0 && (a = C) : a === C ? c[0] === ">" ? (a = i ?? N, l = -1) : c[1] === void 0 ? l = -2 : (l = a.lastIndex - c[2].length, h = c[1], a = c[3] === void 0 ? C : c[3] === '"' ? ut : pt) : a === ut || a === pt ? a = C : a === ct || a === dt ? a = N : (a = C, i = void 0);
264
+ const u = a === C && e[p + 1].startsWith("/>") ? " " : "";
265
+ o += a === N ? n + It : l >= 0 ? (r.push(h), n.slice(0, l) + bt + n.slice(l) + E + u) : n + E + (l === -2 ? p : u);
266
+ }
267
+ return [At(e, o + (e[s] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), r];
268
268
  };
269
- class B {
270
- constructor({ strings: t, _$litType$: s }, i) {
271
- let r;
269
+ class z {
270
+ constructor({ strings: t, _$litType$: s }, r) {
271
+ let i;
272
272
  this.parts = [];
273
273
  let o = 0, a = 0;
274
- const c = t.length - 1, n = this.parts, [h, d] = qt(t, s);
275
- if (this.el = B.createElement(h, i), O.currentNode = this.el.content, s === 2 || s === 3) {
274
+ const p = t.length - 1, n = this.parts, [h, c] = Mt(t, s);
275
+ if (this.el = z.createElement(h, r), P.currentNode = this.el.content, s === 2 || s === 3) {
276
276
  const l = this.el.content.firstChild;
277
277
  l.replaceWith(...l.childNodes);
278
278
  }
279
- for (; (r = O.nextNode()) !== null && n.length < c; ) {
280
- if (r.nodeType === 1) {
281
- if (r.hasAttributes()) for (const l of r.getAttributeNames()) if (l.endsWith(bt)) {
282
- const p = d[a++], u = r.getAttribute(l).split(C), $ = /([.?@])?(.*)/.exec(p);
283
- n.push({ type: 1, index: o, name: $[2], strings: u, ctor: $[1] === "." ? zt : $[1] === "?" ? Yt : $[1] === "@" ? Kt : V }), r.removeAttribute(l);
284
- } else l.startsWith(C) && (n.push({ type: 6, index: o }), r.removeAttribute(l));
285
- if (At.test(r.tagName)) {
286
- const l = r.textContent.split(C), p = l.length - 1;
287
- if (p > 0) {
288
- r.textContent = K ? K.emptyScript : "";
289
- for (let u = 0; u < p; u++) r.append(l[u], j()), O.nextNode(), n.push({ type: 2, index: ++o });
290
- r.append(l[p], j());
279
+ for (; (i = P.nextNode()) !== null && n.length < p; ) {
280
+ if (i.nodeType === 1) {
281
+ if (i.hasAttributes()) for (const l of i.getAttributeNames()) if (l.endsWith(bt)) {
282
+ const d = c[a++], u = i.getAttribute(l).split(E), f = /([.?@])?(.*)/.exec(d);
283
+ n.push({ type: 1, index: o, name: f[2], strings: u, ctor: f[1] === "." ? jt : f[1] === "?" ? qt : f[1] === "@" ? zt : V }), i.removeAttribute(l);
284
+ } else l.startsWith(E) && (n.push({ type: 6, index: o }), i.removeAttribute(l));
285
+ if (vt.test(i.tagName)) {
286
+ const l = i.textContent.split(E), d = l.length - 1;
287
+ if (d > 0) {
288
+ i.textContent = F ? F.emptyScript : "";
289
+ for (let u = 0; u < d; u++) i.append(l[u], j()), P.nextNode(), n.push({ type: 2, index: ++o });
290
+ i.append(l[d], j());
291
291
  }
292
292
  }
293
- } else if (r.nodeType === 8) if (r.data === vt) n.push({ type: 2, index: o });
293
+ } else if (i.nodeType === 8) if (i.data === wt) n.push({ type: 2, index: o });
294
294
  else {
295
295
  let l = -1;
296
- for (; (l = r.data.indexOf(C, l + 1)) !== -1; ) n.push({ type: 7, index: o }), l += C.length - 1;
296
+ for (; (l = i.data.indexOf(E, l + 1)) !== -1; ) n.push({ type: 7, index: o }), l += E.length - 1;
297
297
  }
298
298
  o++;
299
299
  }
300
300
  }
301
301
  static createElement(t, s) {
302
- const i = D.createElement("template");
303
- return i.innerHTML = t, i;
302
+ const r = O.createElement("template");
303
+ return r.innerHTML = t, r;
304
304
  }
305
305
  }
306
- function R(e, t, s = e, i) {
307
- if (t === E) return t;
308
- let r = i !== void 0 ? s._$Co?.[i] : s._$Cl;
306
+ function D(e, t, s = e, r) {
307
+ if (t === U) return t;
308
+ let i = r !== void 0 ? s._$Co?.[r] : s._$Cl;
309
309
  const o = q(t) ? void 0 : t._$litDirective$;
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;
310
+ return i?.constructor !== o && (i?._$AO?.(!1), o === void 0 ? i = void 0 : (i = new o(e), i._$AT(e, s, r)), r !== void 0 ? (s._$Co ??= [])[r] = i : s._$Cl = i), i !== void 0 && (t = D(e, i._$AS(e, t.values), i, r)), t;
311
311
  }
312
- let Bt = class {
312
+ let Ht = class {
313
313
  constructor(t, s) {
314
314
  this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = s;
315
315
  }
@@ -320,29 +320,29 @@ let Bt = class {
320
320
  return this._$AM._$AU;
321
321
  }
322
322
  u(t) {
323
- const { el: { content: s }, parts: i } = this._$AD, r = (t?.creationScope ?? D).importNode(s, !0);
324
- O.currentNode = r;
325
- let o = O.nextNode(), a = 0, c = 0, n = i[0];
323
+ const { el: { content: s }, parts: r } = this._$AD, i = (t?.creationScope ?? O).importNode(s, !0);
324
+ P.currentNode = i;
325
+ let o = P.nextNode(), a = 0, p = 0, n = r[0];
326
326
  for (; n !== void 0; ) {
327
327
  if (a === n.index) {
328
328
  let h;
329
- n.type === 2 ? h = new I(o, o.nextSibling, this, t) : n.type === 1 ? h = new n.ctor(o, n.name, n.strings, this, t) : n.type === 6 && (h = new Ft(o, this, t)), this._$AV.push(h), n = i[++c];
329
+ n.type === 2 ? h = new I(o, o.nextSibling, this, t) : n.type === 1 ? h = new n.ctor(o, n.name, n.strings, this, t) : n.type === 6 && (h = new Bt(o, this, t)), this._$AV.push(h), n = r[++p];
330
330
  }
331
- a !== n?.index && (o = O.nextNode(), a++);
331
+ a !== n?.index && (o = P.nextNode(), a++);
332
332
  }
333
- return O.currentNode = D, r;
333
+ return P.currentNode = O, i;
334
334
  }
335
335
  p(t) {
336
336
  let s = 0;
337
- for (const i of this._$AV) i !== void 0 && (i.strings !== void 0 ? (i._$AI(t, i, s), s += i.strings.length - 2) : i._$AI(t[s])), s++;
337
+ for (const r of this._$AV) r !== void 0 && (r.strings !== void 0 ? (r._$AI(t, r, s), s += r.strings.length - 2) : r._$AI(t[s])), s++;
338
338
  }
339
339
  };
340
340
  class I {
341
341
  get _$AU() {
342
342
  return this._$AM?._$AU ?? this._$Cv;
343
343
  }
344
- constructor(t, s, i, r) {
345
- this.type = 2, this._$AH = g, this._$AN = void 0, this._$AA = t, this._$AB = s, this._$AM = i, this.options = r, this._$Cv = r?.isConnected ?? !0;
344
+ constructor(t, s, r, i) {
345
+ this.type = 2, this._$AH = g, this._$AN = void 0, this._$AA = t, this._$AB = s, this._$AM = r, this.options = i, this._$Cv = i?.isConnected ?? !0;
346
346
  }
347
347
  get parentNode() {
348
348
  let t = this._$AA.parentNode;
@@ -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 !== E && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : Ht(t) ? this.k(t) : this._(t);
359
+ t = D(this, t, s), q(t) ? t === g || t == null || t === "" ? (this._$AH !== g && this._$AR(), this._$AH = g) : t !== this._$AH && t !== U && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : Nt(t) ? this.k(t) : this._(t);
360
360
  }
361
361
  O(t) {
362
362
  return this._$AA.parentNode.insertBefore(t, this._$AB);
@@ -365,31 +365,31 @@ class I {
365
365
  this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
366
366
  }
367
367
  _(t) {
368
- this._$AH !== g && q(this._$AH) ? this._$AA.nextSibling.data = t : this.T(D.createTextNode(t)), this._$AH = t;
368
+ this._$AH !== g && q(this._$AH) ? this._$AA.nextSibling.data = t : this.T(O.createTextNode(t)), this._$AH = t;
369
369
  }
370
370
  $(t) {
371
- const { values: s, _$litType$: i } = t, r = typeof i == "number" ? this._$AC(t) : (i.el === void 0 && (i.el = B.createElement(_t(i.h, i.h[0]), this.options)), i);
372
- if (this._$AH?._$AD === r) this._$AH.p(s);
371
+ const { values: s, _$litType$: r } = t, i = typeof r == "number" ? this._$AC(t) : (r.el === void 0 && (r.el = z.createElement(At(r.h, r.h[0]), this.options)), r);
372
+ if (this._$AH?._$AD === i) this._$AH.p(s);
373
373
  else {
374
- const o = new Bt(r, this), a = o.u(this.options);
374
+ const o = new Ht(i, this), a = o.u(this.options);
375
375
  o.p(s), this.T(a), this._$AH = o;
376
376
  }
377
377
  }
378
378
  _$AC(t) {
379
379
  let s = gt.get(t.strings);
380
- return s === void 0 && gt.set(t.strings, s = new B(t)), s;
380
+ return s === void 0 && gt.set(t.strings, s = new z(t)), s;
381
381
  }
382
382
  k(t) {
383
383
  et(this._$AH) || (this._$AH = [], this._$AR());
384
384
  const s = this._$AH;
385
- let i, r = 0;
386
- for (const o of t) r === s.length ? s.push(i = new I(this.O(j()), this.O(j()), this, this.options)) : i = s[r], i._$AI(o), r++;
387
- r < s.length && (this._$AR(i && i._$AB.nextSibling, r), s.length = r);
385
+ let r, i = 0;
386
+ for (const o of t) i === s.length ? s.push(r = new I(this.O(j()), this.O(j()), this, this.options)) : r = s[i], r._$AI(o), i++;
387
+ i < s.length && (this._$AR(r && r._$AB.nextSibling, i), s.length = i);
388
388
  }
389
389
  _$AR(t = this._$AA.nextSibling, s) {
390
390
  for (this._$AP?.(!1, !0, s); t !== this._$AB; ) {
391
- const i = t.nextSibling;
392
- t.remove(), t = i;
391
+ const r = t.nextSibling;
392
+ t.remove(), t = r;
393
393
  }
394
394
  }
395
395
  setConnected(t) {
@@ -403,25 +403,25 @@ class V {
403
403
  get _$AU() {
404
404
  return this._$AM._$AU;
405
405
  }
406
- constructor(t, s, i, r, o) {
407
- this.type = 1, this._$AH = g, this._$AN = void 0, this.element = t, this.name = s, this._$AM = r, this.options = o, i.length > 2 || i[0] !== "" || i[1] !== "" ? (this._$AH = Array(i.length - 1).fill(new String()), this.strings = i) : this._$AH = g;
406
+ constructor(t, s, r, i, o) {
407
+ this.type = 1, this._$AH = g, this._$AN = void 0, this.element = t, this.name = s, this._$AM = i, this.options = o, r.length > 2 || r[0] !== "" || r[1] !== "" ? (this._$AH = Array(r.length - 1).fill(new String()), this.strings = r) : this._$AH = g;
408
408
  }
409
- _$AI(t, s = this, i, r) {
409
+ _$AI(t, s = this, r, i) {
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 !== E, a && (this._$AH = t);
412
+ if (o === void 0) t = D(this, t, s, 0), a = !q(t) || t !== this._$AH && t !== U, a && (this._$AH = t);
413
413
  else {
414
- const c = t;
414
+ const p = 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 === 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;
416
+ for (t = o[0], n = 0; n < o.length - 1; n++) h = D(this, p[r + n], s, n), h === U && (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
- a && !r && this.j(t);
418
+ a && !i && this.j(t);
419
419
  }
420
420
  j(t) {
421
421
  t === g ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
422
422
  }
423
423
  }
424
- class zt extends V {
424
+ class jt extends V {
425
425
  constructor() {
426
426
  super(...arguments), this.type = 3;
427
427
  }
@@ -429,7 +429,7 @@ class zt extends V {
429
429
  this.element[this.name] = t === g ? void 0 : t;
430
430
  }
431
431
  }
432
- class Yt extends V {
432
+ class qt extends V {
433
433
  constructor() {
434
434
  super(...arguments), this.type = 4;
435
435
  }
@@ -437,43 +437,43 @@ class Yt extends V {
437
437
  this.element.toggleAttribute(this.name, !!t && t !== g);
438
438
  }
439
439
  }
440
- class Kt extends V {
441
- constructor(t, s, i, r, o) {
442
- super(t, s, i, r, o), this.type = 5;
440
+ class zt extends V {
441
+ constructor(t, s, r, i, o) {
442
+ super(t, s, r, i, o), this.type = 5;
443
443
  }
444
444
  _$AI(t, s = this) {
445
- if ((t = R(this, t, s, 0) ?? g) === E) return;
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
- r && this.element.removeEventListener(this.name, this, i), o && this.element.addEventListener(this.name, this, t), this._$AH = t;
445
+ if ((t = D(this, t, s, 0) ?? g) === U) return;
446
+ const r = this._$AH, i = t === g && r !== g || t.capture !== r.capture || t.once !== r.once || t.passive !== r.passive, o = t !== g && (r === g || i);
447
+ i && this.element.removeEventListener(this.name, this, r), o && this.element.addEventListener(this.name, this, t), this._$AH = t;
448
448
  }
449
449
  handleEvent(t) {
450
450
  typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, t) : this._$AH.handleEvent(t);
451
451
  }
452
452
  }
453
- class Ft {
454
- constructor(t, s, i) {
455
- this.element = t, this.type = 6, this._$AN = void 0, this._$AM = s, this.options = i;
453
+ class Bt {
454
+ constructor(t, s, r) {
455
+ this.element = t, this.type = 6, this._$AN = void 0, this._$AM = s, this.options = r;
456
456
  }
457
457
  get _$AU() {
458
458
  return this._$AM._$AU;
459
459
  }
460
460
  _$AI(t) {
461
- R(this, t);
461
+ D(this, t);
462
462
  }
463
463
  }
464
- const Vt = { I }, Wt = tt.litHtmlPolyfillSupport;
465
- Wt?.(B, I), (tt.litHtmlVersions ??= []).push("3.3.1");
466
- const Gt = (e, t, s) => {
467
- const i = s?.renderBefore ?? t;
468
- let r = i._$litPart$;
469
- if (r === void 0) {
464
+ const Kt = { I }, Ft = tt.litHtmlPolyfillSupport;
465
+ Ft?.(z, I), (tt.litHtmlVersions ??= []).push("3.3.1");
466
+ const Wt = (e, t, s) => {
467
+ const r = s?.renderBefore ?? t;
468
+ let i = r._$litPart$;
469
+ if (i === void 0) {
470
470
  const o = s?.renderBefore ?? null;
471
- i._$litPart$ = r = new I(t.insertBefore(j(), o), o, void 0, s ?? {});
471
+ r._$litPart$ = i = new I(t.insertBefore(j(), o), o, void 0, s ?? {});
472
472
  }
473
- return r._$AI(e), r;
473
+ return i._$AI(e), i;
474
474
  };
475
475
  const st = globalThis;
476
- let H = class extends U {
476
+ let H = class extends R {
477
477
  constructor() {
478
478
  super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
479
479
  }
@@ -483,7 +483,7 @@ let H = class extends U {
483
483
  }
484
484
  update(t) {
485
485
  const s = this.render();
486
- this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = Gt(s, this.renderRoot, this.renderOptions);
486
+ this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = Wt(s, this.renderRoot, this.renderOptions);
487
487
  }
488
488
  connectedCallback() {
489
489
  super.connectedCallback(), this._$Do?.setConnected(!0);
@@ -492,66 +492,66 @@ let H = class extends U {
492
492
  super.disconnectedCallback(), this._$Do?.setConnected(!1);
493
493
  }
494
494
  render() {
495
- return E;
495
+ return U;
496
496
  }
497
497
  };
498
498
  H._$litElement$ = !0, H.finalized = !0, st.litElementHydrateSupport?.({ LitElement: H });
499
- const Jt = st.litElementPolyfillSupport;
500
- Jt?.({ LitElement: H });
499
+ const Vt = st.litElementPolyfillSupport;
500
+ Vt?.({ LitElement: H });
501
501
  (st.litElementVersions ??= []).push("4.2.1");
502
- const Zt = (e) => (t, s) => {
502
+ const Gt = (e) => (t, s) => {
503
503
  s !== void 0 ? s.addInitializer((() => {
504
504
  customElements.define(e, t);
505
505
  })) : customElements.define(e, t);
506
506
  };
507
- const Qt = { attribute: !0, type: String, converter: Y, reflect: !1, hasChanged: X }, Xt = (e = Qt, t, s) => {
508
- const { kind: i, metadata: r } = s;
509
- let o = globalThis.litPropertyMetadata.get(r);
510
- if (o === void 0 && globalThis.litPropertyMetadata.set(r, o = /* @__PURE__ */ new Map()), i === "setter" && ((e = Object.create(e)).wrapped = !0), o.set(s.name, e), i === "accessor") {
507
+ const Jt = { attribute: !0, type: String, converter: K, reflect: !1, hasChanged: X }, Yt = (e = Jt, t, s) => {
508
+ const { kind: r, metadata: i } = s;
509
+ let o = globalThis.litPropertyMetadata.get(i);
510
+ if (o === void 0 && globalThis.litPropertyMetadata.set(i, o = /* @__PURE__ */ new Map()), r === "setter" && ((e = Object.create(e)).wrapped = !0), o.set(s.name, e), r === "accessor") {
511
511
  const { name: a } = s;
512
- return { set(c) {
512
+ return { set(p) {
513
513
  const n = t.get.call(this);
514
- t.set.call(this, c), this.requestUpdate(a, n, e);
515
- }, init(c) {
516
- return c !== void 0 && this.C(a, void 0, e, c), c;
514
+ t.set.call(this, p), this.requestUpdate(a, n, e);
515
+ }, init(p) {
516
+ return p !== void 0 && this.C(a, void 0, e, p), p;
517
517
  } };
518
518
  }
519
- if (i === "setter") {
519
+ if (r === "setter") {
520
520
  const { name: a } = s;
521
- return function(c) {
521
+ return function(p) {
522
522
  const n = this[a];
523
- t.call(this, c), this.requestUpdate(a, n, e);
523
+ t.call(this, p), this.requestUpdate(a, n, e);
524
524
  };
525
525
  }
526
- throw Error("Unsupported decorator location: " + i);
526
+ throw Error("Unsupported decorator location: " + r);
527
527
  };
528
528
  function S(e) {
529
- return (t, s) => typeof s == "object" ? Xt(e, t, s) : ((i, r, o) => {
530
- const a = r.hasOwnProperty(o);
531
- return r.constructor.createProperty(o, i), a ? Object.getOwnPropertyDescriptor(r, o) : void 0;
529
+ return (t, s) => typeof s == "object" ? Yt(e, t, s) : ((r, i, o) => {
530
+ const a = i.hasOwnProperty(o);
531
+ return i.constructor.createProperty(o, r), a ? Object.getOwnPropertyDescriptor(i, o) : void 0;
532
532
  })(e, t, s);
533
533
  }
534
- function b(e) {
534
+ function v(e) {
535
535
  return S({ ...e, state: !0, attribute: !1 });
536
536
  }
537
- const te = (e, t, s) => (s.configurable = !0, s.enumerable = !0, Reflect.decorate && typeof t != "object" && Object.defineProperty(e, t, s), s);
538
- function it(e, t) {
539
- return (s, i, r) => {
537
+ const Zt = (e, t, s) => (s.configurable = !0, s.enumerable = !0, Reflect.decorate && typeof t != "object" && Object.defineProperty(e, t, s), s);
538
+ function Qt(e, t) {
539
+ return (s, r, i) => {
540
540
  const o = (a) => a.renderRoot?.querySelector(e) ?? null;
541
- return te(s, i, { get() {
541
+ return Zt(s, r, { get() {
542
542
  return o(this);
543
543
  } });
544
544
  };
545
545
  }
546
- const St = { ATTRIBUTE: 1, CHILD: 2 }, kt = (e) => (...t) => ({ _$litDirective$: e, values: t });
547
- class Ct {
546
+ const Xt = { CHILD: 2 }, te = (e) => (...t) => ({ _$litDirective$: e, values: t });
547
+ class ee {
548
548
  constructor(t) {
549
549
  }
550
550
  get _$AU() {
551
551
  return this._$AM._$AU;
552
552
  }
553
- _$AT(t, s, i) {
554
- this._$Ct = t, this._$AM = s, this._$Ci = i;
553
+ _$AT(t, s, r) {
554
+ this._$Ct = t, this._$AM = s, this._$Ci = r;
555
555
  }
556
556
  _$AS(t, s) {
557
557
  return this.update(t, s);
@@ -560,101 +560,117 @@ class Ct {
560
560
  return this.render(...s);
561
561
  }
562
562
  }
563
- const mt = kt(class extends Ct {
564
- constructor(e) {
565
- if (super(e), e.type !== St.ATTRIBUTE || e.name !== "class" || e.strings?.length > 2) throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.");
566
- }
567
- render(e) {
568
- return " " + Object.keys(e).filter(((t) => e[t])).join(" ") + " ";
569
- }
570
- update(e, [t]) {
571
- if (this.st === void 0) {
572
- this.st = /* @__PURE__ */ new Set(), e.strings !== void 0 && (this.nt = new Set(e.strings.join(" ").split(/\s/).filter(((i) => i !== ""))));
573
- for (const i in t) t[i] && !this.nt?.has(i) && this.st.add(i);
574
- return this.render(t);
575
- }
576
- const s = e.element.classList;
577
- for (const i of this.st) i in t || (s.remove(i), this.st.delete(i));
578
- for (const i in t) {
579
- const r = !!t[i];
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
- }
582
- return E;
583
- }
584
- });
585
- const { I: ee } = Vt, ft = () => document.createComment(""), L = (e, t, s) => {
586
- const i = e._$AA.parentNode, r = t === void 0 ? e._$AB : t._$AA;
563
+ const { I: se } = Kt, mt = () => document.createComment(""), L = (e, t, s) => {
564
+ const r = e._$AA.parentNode, i = t === void 0 ? e._$AB : t._$AA;
587
565
  if (s === void 0) {
588
- const o = i.insertBefore(ft(), r), a = i.insertBefore(ft(), r);
589
- s = new ee(o, a, e, e.options);
566
+ const o = r.insertBefore(mt(), i), a = r.insertBefore(mt(), i);
567
+ s = new se(o, a, e, e.options);
590
568
  } else {
591
- const o = s._$AB.nextSibling, a = s._$AM, c = a !== e;
592
- if (c) {
569
+ const o = s._$AB.nextSibling, a = s._$AM, p = a !== e;
570
+ if (p) {
593
571
  let n;
594
572
  s._$AQ?.(e), s._$AM = e, s._$AP !== void 0 && (n = e._$AU) !== a._$AU && s._$AP(n);
595
573
  }
596
- if (o !== r || c) {
574
+ if (o !== i || p) {
597
575
  let n = s._$AA;
598
576
  for (; n !== o; ) {
599
577
  const h = n.nextSibling;
600
- i.insertBefore(n, r), n = h;
578
+ r.insertBefore(n, i), n = h;
601
579
  }
602
580
  }
603
581
  }
604
582
  return s;
605
- }, P = (e, t, s = e) => (e._$AI(t, s), e), se = {}, ie = (e, t = se) => e._$AH = t, re = (e) => e._$AH, G = (e) => {
583
+ }, T = (e, t, s = e) => (e._$AI(t, s), e), ie = {}, re = (e, t = ie) => e._$AH = t, oe = (e) => e._$AH, J = (e) => {
606
584
  e._$AR(), e._$AA.remove();
607
585
  };
608
- const yt = (e, t, s) => {
609
- const i = /* @__PURE__ */ new Map();
610
- for (let r = t; r <= s; r++) i.set(e[r], r);
611
- return i;
612
- }, $t = kt(class extends Ct {
586
+ const ft = (e, t, s) => {
587
+ const r = /* @__PURE__ */ new Map();
588
+ for (let i = t; i <= s; i++) r.set(e[i], i);
589
+ return r;
590
+ }, yt = te(class extends ee {
613
591
  constructor(e) {
614
- if (super(e), e.type !== St.CHILD) throw Error("repeat() can only be used in text expressions");
592
+ if (super(e), e.type !== Xt.CHILD) throw Error("repeat() can only be used in text expressions");
615
593
  }
616
594
  dt(e, t, s) {
617
- let i;
618
- s === void 0 ? s = t : t !== void 0 && (i = t);
619
- const r = [], o = [];
595
+ let r;
596
+ s === void 0 ? s = t : t !== void 0 && (r = t);
597
+ const i = [], o = [];
620
598
  let a = 0;
621
- for (const c of e) r[a] = i ? i(c, a) : a, o[a] = s(c, a), a++;
622
- return { values: o, keys: r };
599
+ for (const p of e) i[a] = r ? r(p, a) : a, o[a] = s(p, a), a++;
600
+ return { values: o, keys: i };
623
601
  }
624
602
  render(e, t, s) {
625
603
  return this.dt(e, t, s).values;
626
604
  }
627
- update(e, [t, s, i]) {
628
- const r = re(e), { values: o, keys: a } = this.dt(t, s, i);
629
- if (!Array.isArray(r)) return this.ut = a, o;
630
- const c = this.ut ??= [], n = [];
631
- let h, d, l = 0, p = r.length - 1, u = 0, $ = o.length - 1;
632
- for (; l <= p && u <= $; ) if (r[l] === null) l++;
633
- else if (r[p] === null) p--;
634
- else if (c[l] === a[u]) n[u] = P(r[l], o[u]), l++, u++;
635
- else if (c[p] === a[$]) n[$] = P(r[p], o[$]), p--, $--;
636
- else if (c[l] === a[$]) n[$] = P(r[l], o[$]), L(e, n[$ + 1], r[l]), l++, $--;
637
- else if (c[p] === a[u]) n[u] = P(r[p], o[u]), L(e, r[l], r[p]), p--, u++;
638
- else if (h === void 0 && (h = yt(a, u, $), d = yt(c, l, p)), h.has(c[l])) if (h.has(c[p])) {
639
- const v = d.get(a[u]), A = v !== void 0 ? r[v] : null;
605
+ update(e, [t, s, r]) {
606
+ const i = oe(e), { values: o, keys: a } = this.dt(t, s, r);
607
+ if (!Array.isArray(i)) return this.ut = a, o;
608
+ const p = this.ut ??= [], n = [];
609
+ let h, c, l = 0, d = i.length - 1, u = 0, f = o.length - 1;
610
+ for (; l <= d && u <= f; ) if (i[l] === null) l++;
611
+ else if (i[d] === null) d--;
612
+ else if (p[l] === a[u]) n[u] = T(i[l], o[u]), l++, u++;
613
+ else if (p[d] === a[f]) n[f] = T(i[d], o[f]), d--, f--;
614
+ else if (p[l] === a[f]) n[f] = T(i[l], o[f]), L(e, n[f + 1], i[l]), l++, f--;
615
+ else if (p[d] === a[u]) n[u] = T(i[d], o[u]), L(e, i[l], i[d]), d--, u++;
616
+ else if (h === void 0 && (h = ft(a, u, f), c = ft(p, l, d)), h.has(p[l])) if (h.has(p[d])) {
617
+ const w = c.get(a[u]), A = w !== void 0 ? i[w] : null;
640
618
  if (A === null) {
641
- const w = L(e, r[l]);
642
- P(w, o[u]), n[u] = w;
643
- } else n[u] = P(A, o[u]), L(e, r[l], A), r[v] = null;
619
+ const b = L(e, i[l]);
620
+ T(b, o[u]), n[u] = b;
621
+ } else n[u] = T(A, o[u]), L(e, i[l], A), i[w] = null;
644
622
  u++;
645
- } else G(r[p]), p--;
646
- else G(r[l]), l++;
647
- for (; u <= $; ) {
648
- const v = L(e, n[$ + 1]);
649
- P(v, o[u]), n[u++] = v;
623
+ } else J(i[d]), d--;
624
+ else J(i[l]), l++;
625
+ for (; u <= f; ) {
626
+ const w = L(e, n[f + 1]);
627
+ T(w, o[u]), n[u++] = w;
650
628
  }
651
- for (; l <= p; ) {
652
- const v = r[l++];
653
- v !== null && G(v);
629
+ for (; l <= d; ) {
630
+ const w = i[l++];
631
+ w !== null && J(w);
654
632
  }
655
- return this.ut = a, ie(e, n), E;
633
+ return this.ut = a, re(e, n), U;
634
+ }
635
+ });
636
+ var ae = Object.defineProperty, _t = (e, t, s, r) => {
637
+ for (var i = void 0, o = e.length - 1, a; o >= 0; o--)
638
+ (a = e[o]) && (i = a(t, s, i) || i);
639
+ return i && ae(t, s, i), i;
640
+ };
641
+ class it extends H {
642
+ constructor() {
643
+ super(...arguments), this.theme = "light", this.storageKey = "theme-preference", this.boundThemeChangeHandler = this.handleGlobalThemeChange.bind(this);
644
+ }
645
+ connectedCallback() {
646
+ super.connectedCallback();
647
+ const t = document.documentElement.getAttribute("data-theme"), s = localStorage.getItem(this.storageKey), r = window.matchMedia("(prefers-color-scheme: dark)").matches;
648
+ t ? this.theme = t : s ? (this.theme = s, this.applyTheme()) : r ? (this.theme = "dark", this.applyTheme()) : this.applyTheme(), window.addEventListener("theme-changed", this.boundThemeChangeHandler);
649
+ }
650
+ disconnectedCallback() {
651
+ window.removeEventListener("theme-changed", this.boundThemeChangeHandler), super.disconnectedCallback();
652
+ }
653
+ handleGlobalThemeChange(t) {
654
+ const s = t;
655
+ s.target !== this && s.detail.theme !== this.theme && (this.theme = s.detail.theme);
656
+ }
657
+ applyTheme() {
658
+ document.documentElement.setAttribute("data-theme", this.theme), localStorage.setItem(this.storageKey, this.theme), this.dispatchEvent(
659
+ new CustomEvent("theme-changed", {
660
+ detail: { theme: this.theme },
661
+ bubbles: !0,
662
+ composed: !0
663
+ })
664
+ );
656
665
  }
657
- }), oe = ({
666
+ }
667
+ _t([
668
+ S({ type: String, attribute: "data-theme", reflect: !0 })
669
+ ], it.prototype, "theme");
670
+ _t([
671
+ S({ type: String, attribute: "storage-key" })
672
+ ], it.prototype, "storageKey");
673
+ const ne = ({
658
674
  baseUrl: e
659
675
  }) => {
660
676
  const t = {
@@ -669,36 +685,36 @@ const yt = (e, t, s) => {
669
685
  return {
670
686
  login: async ({
671
687
  email: h,
672
- password: d,
688
+ password: c,
673
689
  accessToken: l,
674
- refreshToken: p,
690
+ refreshToken: d,
675
691
  idToken: u
676
692
  }) => {
677
- const $ = await fetch(`${e}${t.login}`, {
693
+ const f = await fetch(`${e}${t.login}`, {
678
694
  method: "POST",
679
695
  headers: {
680
696
  "Content-Type": "application/json"
681
697
  },
682
698
  body: JSON.stringify({
683
699
  email: h,
684
- password: d,
700
+ password: c,
685
701
  accessToken: l,
686
- refreshToken: p,
702
+ refreshToken: d,
687
703
  idToken: u
688
704
  })
689
705
  });
690
- if (!$.ok) {
691
- const v = await $.json();
692
- throw new Error(v.message || v.error || "Login failed");
706
+ if (!f.ok) {
707
+ const w = await f.json();
708
+ throw new Error(w.message || w.error || "Login failed");
693
709
  }
694
- return $.json();
710
+ return f.json();
695
711
  },
696
712
  logout: async ({
697
713
  accessToken: h,
698
- refreshToken: d,
714
+ refreshToken: c,
699
715
  authToken: l
700
716
  }) => {
701
- const p = await fetch(`${e}${t.logout}`, {
717
+ const d = await fetch(`${e}${t.logout}`, {
702
718
  method: "POST",
703
719
  headers: {
704
720
  "Content-Type": "application/json",
@@ -706,17 +722,17 @@ const yt = (e, t, s) => {
706
722
  },
707
723
  body: JSON.stringify({
708
724
  accessToken: h,
709
- refreshToken: d
725
+ refreshToken: c
710
726
  })
711
727
  });
712
- if (!p.ok) {
713
- const u = await p.json();
728
+ if (!d.ok) {
729
+ const u = await d.json();
714
730
  throw new Error(u.message || u.error || "Logout failed");
715
731
  }
716
- return p.json();
732
+ return d.json();
717
733
  },
718
734
  refresh: async ({ refreshToken: h }) => {
719
- const d = await fetch(`${e}${t.refresh}`, {
735
+ const c = await fetch(`${e}${t.refresh}`, {
720
736
  method: "POST",
721
737
  headers: {
722
738
  "Content-Type": "application/json"
@@ -725,14 +741,14 @@ const yt = (e, t, s) => {
725
741
  refreshToken: h
726
742
  })
727
743
  });
728
- if (!d.ok) {
729
- const l = await d.json();
744
+ if (!c.ok) {
745
+ const l = await c.json();
730
746
  throw new Error(l.message || l.error || "Failed to refresh token");
731
747
  }
732
- return d.json();
748
+ return c.json();
733
749
  },
734
750
  requestRegisterOtp: async ({ email: h }) => {
735
- const d = await fetch(`${e}${t.requestRegisterOtp}`, {
751
+ const c = await fetch(`${e}${t.requestRegisterOtp}`, {
736
752
  method: "POST",
737
753
  headers: {
738
754
  "Content-Type": "application/json"
@@ -741,42 +757,42 @@ const yt = (e, t, s) => {
741
757
  email: h
742
758
  })
743
759
  });
744
- if (!d.ok) {
745
- const l = await d.json();
760
+ if (!c.ok) {
761
+ const l = await c.json();
746
762
  throw new Error(l.message || l.error || "Failed to request OTP");
747
763
  }
748
- return d.json();
764
+ return c.json();
749
765
  },
750
766
  register: async ({
751
767
  email: h,
752
- password: d,
768
+ password: c,
753
769
  phone_number: l,
754
- family_name: p,
770
+ family_name: d,
755
771
  given_name: u,
756
- code: $
772
+ code: f
757
773
  }) => {
758
- const v = await fetch(`${e}${t.register}`, {
774
+ const w = await fetch(`${e}${t.register}`, {
759
775
  method: "POST",
760
776
  headers: {
761
777
  "Content-Type": "application/json"
762
778
  },
763
779
  body: JSON.stringify({
764
780
  email: h,
765
- password: d,
781
+ password: c,
766
782
  phone_number: l,
767
- family_name: p,
783
+ family_name: d,
768
784
  given_name: u,
769
- code: $
785
+ code: f
770
786
  })
771
787
  });
772
- if (!v.ok) {
773
- const A = await v.json();
788
+ if (!w.ok) {
789
+ const A = await w.json();
774
790
  throw new Error(A.message || A.error || "Registration failed");
775
791
  }
776
- return v.json();
792
+ return w.json();
777
793
  },
778
794
  requestResetPassword: async ({ email: h }) => {
779
- const d = await fetch(`${e}${t.requestResetPassword}`, {
795
+ const c = await fetch(`${e}${t.requestResetPassword}`, {
780
796
  method: "POST",
781
797
  headers: {
782
798
  "Content-Type": "application/json"
@@ -785,64 +801,64 @@ const yt = (e, t, s) => {
785
801
  email: h
786
802
  })
787
803
  });
788
- if (!d.ok) {
789
- const l = await d.json();
804
+ if (!c.ok) {
805
+ const l = await c.json();
790
806
  throw new Error(l.message || l.error || "Failed to request password reset");
791
807
  }
792
- return d.json();
808
+ return c.json();
793
809
  },
794
810
  resetPassword: async ({
795
811
  email: h,
796
- otp: d,
812
+ otp: c,
797
813
  newPassword: l
798
814
  }) => {
799
- const p = await fetch(`${e}${t.resetPassword}`, {
815
+ const d = await fetch(`${e}${t.resetPassword}`, {
800
816
  method: "POST",
801
817
  headers: {
802
818
  "Content-Type": "application/json"
803
819
  },
804
820
  body: JSON.stringify({
805
821
  email: h,
806
- otp: d,
822
+ otp: c,
807
823
  newPassword: l
808
824
  })
809
825
  });
810
- if (!p.ok) {
811
- const u = await p.json();
826
+ if (!d.ok) {
827
+ const u = await d.json();
812
828
  throw new Error(u.message || u.error || "Failed to reset password");
813
829
  }
814
- return p.json();
830
+ return d.json();
815
831
  }
816
832
  };
817
- }, J = {
833
+ }, Y = {
818
834
  AUTH_TOKEN: "authToken",
819
835
  ACCESS_TOKEN: "accessToken",
820
836
  REFRESH_TOKEN: "refreshToken"
821
- }, ae = {
837
+ }, le = {
822
838
  maxAge: 3600 * 24 * 7,
823
839
  // 7 days
824
840
  secure: !0,
825
841
  sameSite: "lax",
826
842
  path: "/"
827
- }, ne = () => {
828
- const e = (n, h, d = {}) => {
843
+ }, he = () => {
844
+ const e = (n, h, c = {}) => {
829
845
  const {
830
846
  maxAge: l,
831
- path: p = "/",
847
+ path: d = "/",
832
848
  secure: u = window.location.protocol === "https:",
833
- sameSite: $ = "lax",
834
- domain: v
835
- } = d;
849
+ sameSite: f = "lax",
850
+ domain: w
851
+ } = c;
836
852
  let A = `${encodeURIComponent(n)}=${encodeURIComponent(h)}`;
837
- l !== void 0 && (A += `; Max-Age=${l}`), A += `; Path=${p}`, u && (A += "; Secure"), A += `; SameSite=${$}`, v && (A += `; Domain=${v}`), document.cookie = A;
853
+ l !== void 0 && (A += `; Max-Age=${l}`), A += `; Path=${d}`, u && (A += "; Secure"), A += `; SameSite=${f}`, w && (A += `; Domain=${w}`), document.cookie = A;
838
854
  }, t = (n) => {
839
- const h = encodeURIComponent(n) + "=", d = document.cookie.split(";");
840
- for (let l = 0; l < d.length; l++) {
841
- let p = d[l];
842
- for (; p.charAt(0) === " "; )
843
- p = p.substring(1);
844
- if (p.indexOf(h) === 0)
845
- return decodeURIComponent(p.substring(h.length));
855
+ const h = encodeURIComponent(n) + "=", c = document.cookie.split(";");
856
+ for (let l = 0; l < c.length; l++) {
857
+ let d = c[l];
858
+ for (; d.charAt(0) === " "; )
859
+ d = d.substring(1);
860
+ if (d.indexOf(h) === 0)
861
+ return decodeURIComponent(d.substring(h.length));
846
862
  }
847
863
  return null;
848
864
  }, s = (n, h = {}) => {
@@ -850,52 +866,52 @@ const yt = (e, t, s) => {
850
866
  ...h,
851
867
  maxAge: -1
852
868
  });
853
- }, i = (n) => t(n) !== null, r = (n, h) => {
854
- e(J[n], h, ae);
855
- }, o = (n) => t(J[n]), a = (n) => {
856
- s(J[n]);
869
+ }, r = (n) => t(n) !== null, i = (n, h) => {
870
+ e(Y[n], h, le);
871
+ }, o = (n) => t(Y[n]), a = (n) => {
872
+ s(Y[n]);
857
873
  };
858
874
  return {
859
875
  setCookie: e,
860
876
  getCookie: t,
861
877
  removeCookie: s,
862
- hasCookie: i,
863
- setAuthToken: r,
878
+ hasCookie: r,
879
+ setAuthToken: i,
864
880
  getAuthToken: o,
865
881
  removeAuthToken: a,
866
882
  clearAllAuthTokens: () => {
867
883
  a("AUTH_TOKEN"), a("ACCESS_TOKEN"), a("REFRESH_TOKEN");
868
884
  }
869
885
  };
870
- }, le = ["code", "state", "error", "error_description"], he = (e) => {
886
+ }, ce = ["code", "state", "error", "error_description"], de = (e) => {
871
887
  if (e) return e;
872
888
  const t = new URL(window.location.href);
873
- return le.forEach((s) => t.searchParams.delete(s)), t.toString();
874
- }, ce = ({
889
+ return ce.forEach((s) => t.searchParams.delete(s)), t.toString();
890
+ }, pe = ({
875
891
  domain: e,
876
892
  cognitoRegion: t,
877
893
  userPoolId: s,
878
- clientId: i,
879
- redirectUri: r
894
+ clientId: r,
895
+ redirectUri: i
880
896
  }) => {
881
897
  const o = {
882
898
  domain: e,
883
- clientId: i,
884
- redirectUri: he(r)
885
- }, a = (w) => {
886
- const _ = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~", k = new Uint8Array(w);
899
+ clientId: r,
900
+ redirectUri: de(i)
901
+ }, a = (b) => {
902
+ const _ = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~", k = new Uint8Array(b);
887
903
  return crypto.getRandomValues(k), Array.from(k).map((x) => _[x % _.length]).join("");
888
- }, c = async (w) => {
889
- const k = new TextEncoder().encode(w), x = await crypto.subtle.digest("SHA-256", k);
904
+ }, p = async (b) => {
905
+ const k = new TextEncoder().encode(b), x = await crypto.subtle.digest("SHA-256", k);
890
906
  return btoa(String.fromCharCode(...new Uint8Array(x))).replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
891
907
  }, n = async () => {
892
- const w = a(128), _ = await c(w);
893
- return sessionStorage.setItem("pkce_code_verifier", w), { codeVerifier: w, codeChallenge: _ };
908
+ const b = a(128), _ = await p(b);
909
+ return sessionStorage.setItem("pkce_code_verifier", b), { codeVerifier: b, codeChallenge: _ };
894
910
  }, h = () => {
895
- const w = a(32);
896
- return sessionStorage.setItem("oauth_state", w), w;
897
- }, d = async () => {
898
- const { codeChallenge: w } = await n(), _ = h(), k = new URLSearchParams({
911
+ const b = a(32);
912
+ return sessionStorage.setItem("oauth_state", b), b;
913
+ }, c = async () => {
914
+ const { codeChallenge: b } = await n(), _ = h(), k = new URLSearchParams({
899
915
  response_type: "code",
900
916
  client_id: o.clientId,
901
917
  redirect_uri: o.redirectUri,
@@ -903,15 +919,15 @@ const yt = (e, t, s) => {
903
919
  scope: "openid email profile",
904
920
  state: _,
905
921
  code_challenge_method: "S256",
906
- code_challenge: w,
922
+ code_challenge: b,
907
923
  prompt: "select_account"
908
924
  });
909
925
  return `${o.domain}/oauth2/authorize?${k.toString()}`;
910
926
  }, l = async () => {
911
- const w = await d();
912
- window.location.href = w;
913
- }, p = async () => {
914
- const { codeChallenge: w } = await n(), _ = h(), k = new URLSearchParams({
927
+ const b = await c();
928
+ window.location.href = b;
929
+ }, d = async () => {
930
+ const { codeChallenge: b } = await n(), _ = h(), k = new URLSearchParams({
915
931
  response_type: "code",
916
932
  client_id: o.clientId,
917
933
  redirect_uri: o.redirectUri,
@@ -919,32 +935,32 @@ const yt = (e, t, s) => {
919
935
  scope: "openid email profile",
920
936
  state: _,
921
937
  code_challenge_method: "S256",
922
- code_challenge: w
938
+ code_challenge: b
923
939
  });
924
940
  return `${o.domain}/oauth2/authorize?${k.toString()}`;
925
941
  }, u = async () => {
926
- const w = await p();
927
- window.location.href = w;
928
- }, $ = (w) => {
942
+ const b = await d();
943
+ window.location.href = b;
944
+ }, f = (b) => {
929
945
  const _ = sessionStorage.getItem("oauth_state");
930
- return sessionStorage.removeItem("oauth_state"), _ === w;
931
- }, v = () => {
932
- const w = sessionStorage.getItem("pkce_code_verifier");
933
- return sessionStorage.removeItem("pkce_code_verifier"), w;
946
+ return sessionStorage.removeItem("oauth_state"), _ === b;
947
+ }, w = () => {
948
+ const b = sessionStorage.getItem("pkce_code_verifier");
949
+ return sessionStorage.removeItem("pkce_code_verifier"), b;
934
950
  };
935
951
  return {
936
952
  redirectToGoogleAuth: l,
937
953
  redirectToAppleAuth: u,
938
- validateState: $,
939
- getCodeVerifier: v,
940
- exchangeCodeForTokens: async (w) => {
941
- const _ = v();
954
+ validateState: f,
955
+ getCodeVerifier: w,
956
+ exchangeCodeForTokens: async (b) => {
957
+ const _ = w();
942
958
  if (!_)
943
959
  throw new Error("PKCE code verifier not found. Please restart the authentication flow.");
944
960
  const k = new URLSearchParams({
945
961
  grant_type: "authorization_code",
946
962
  client_id: o.clientId,
947
- code: w,
963
+ code: b,
948
964
  redirect_uri: o.redirectUri,
949
965
  code_verifier: _
950
966
  }), x = await fetch(`${o.domain}/oauth2/token`, {
@@ -961,7 +977,7 @@ const yt = (e, t, s) => {
961
977
  return x.json();
962
978
  }
963
979
  };
964
- }, de = () => xt`
980
+ }, ue = () => kt`
965
981
  :host {
966
982
  display: inline-block;
967
983
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
@@ -1461,12 +1477,12 @@ const yt = (e, t, s) => {
1461
1477
  transition: none !important;
1462
1478
  }
1463
1479
  }`;
1464
- var pe = Object.defineProperty, ue = Object.getOwnPropertyDescriptor, y = (e, t, s, i) => {
1465
- for (var r = i > 1 ? void 0 : i ? ue(t, s) : t, o = e.length - 1, a; o >= 0; o--)
1466
- (a = e[o]) && (r = (i ? a(t, s, r) : a(r)) || r);
1467
- return i && r && pe(t, s, r), r;
1480
+ var ge = Object.defineProperty, me = Object.getOwnPropertyDescriptor, $ = (e, t, s, r) => {
1481
+ for (var i = r > 1 ? void 0 : r ? me(t, s) : t, o = e.length - 1, a; o >= 0; o--)
1482
+ (a = e[o]) && (i = (r ? a(t, s, i) : a(i)) || i);
1483
+ return r && i && ge(t, s, i), i;
1468
1484
  };
1469
- const ge = [
1485
+ const fe = [
1470
1486
  "code",
1471
1487
  "state",
1472
1488
  "error",
@@ -1477,45 +1493,9 @@ const ge = [
1477
1493
  "token_type",
1478
1494
  "expires_in"
1479
1495
  ];
1480
- let m = class extends H {
1496
+ let y = class extends it {
1481
1497
  constructor() {
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
- e.key === "Escape" && this.isVisible && this.handleClose();
1484
- }, this.baseUrlErrorMessage = "Authentication service is not configured correctly. Please add an API domain or contact support.", this.handleClose = () => {
1485
- this.isClosing || !this.isVisible || (this.cleanupInlineStyles(), this.isDragging = !1, this.dragStartY = 0, this.dragCurrentY = 0, this.dragStartTime = 0, this.isClosing = !0, setTimeout(() => {
1486
- this.isClosing = !1, this.isVisible = !1, this.open = !1;
1487
- }, this.transitionDuration));
1488
- }, this.handleOverlayClick = () => {
1489
- this.handleClose();
1490
- }, this.handleDragStart = (e) => {
1491
- if (!this.modalContainer || this.modalBody && this.modalBody.scrollTop > 0)
1492
- return;
1493
- const t = e.target;
1494
- !(t.classList.contains("drawer-handle") || t.classList.contains("drawer-handle-bar") || t.closest(".drawer-handle")) && this.modalBody && this.modalBody.scrollTop > 0 || (this.modalContainer.style.transition = "", this.modalContainer.style.transform = "", this.isDragging = !0, this.dragStartTime = Date.now(), e instanceof TouchEvent ? (this.dragStartY = e.touches[0].clientY, this.dragCurrentY = e.touches[0].clientY) : (this.dragStartY = e.clientY, this.dragCurrentY = e.clientY));
1495
- }, this.handleDragMove = (e) => {
1496
- if (!this.isDragging || !this.modalContainer) return;
1497
- e instanceof TouchEvent ? this.dragCurrentY = e.touches[0].clientY : this.dragCurrentY = e.clientY;
1498
- const t = this.dragCurrentY - this.dragStartY;
1499
- t > 0 && (e.preventDefault(), this.modalContainer.style.transform = `translateY(${t}px)`, this.modalContainer.style.transition = "none");
1500
- }, this.handleDragEnd = () => {
1501
- if (!this.isDragging || !this.modalContainer) return;
1502
- const e = Math.max(0, this.dragCurrentY - this.dragStartY);
1503
- e > 5 && (this.lastDragEndTime = Date.now());
1504
- const t = Date.now() - this.dragStartTime, s = e / t, i = this.modalContainer.offsetHeight, r = Math.max(150, i * 0.3), a = e > r || s > 0.5;
1505
- this.isDragging = !1;
1506
- const c = this.modalContainer, n = a ? i + i * 0.1 : 0;
1507
- c.style.transition = "none", c.style.transform = `translateY(${e}px)`, requestAnimationFrame(() => {
1508
- c.style.transition = `transform ${this.transitionDuration}ms cubic-bezier(0.4, 0, 0.2, 1)`, c.style.transform = `translateY(${n}px)`;
1509
- }), setTimeout(() => {
1510
- this.dragStartY = 0, this.dragCurrentY = 0, this.dragStartTime = 0, a ? (this.isVisible = !1, this.open = !1) : this.modalContainer && (this.modalContainer.style.transition = "", this.modalContainer.style.transform = "");
1511
- }, this.transitionDuration);
1512
- }, this.handleHandleClick = (e) => {
1513
- if (Date.now() - this.lastDragEndTime < 200) {
1514
- e.preventDefault(), e.stopPropagation();
1515
- return;
1516
- }
1517
- this.handleClose();
1518
- };
1498
+ super(...arguments), this.initialMode = "signin", this.logoUrl = "", this.baseUrl = "", this.oauthDomain = "", this.oauthRegion = "", this.oauthUserPoolId = "", this.oauthClientId = "", this.oauthRedirectUri = "", this.oauthSpaDomain = "", this.disableSignup = !1, this.mode = "signin", this.resetStep = "none", this.signupStep = "form", this.isLoading = !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.cookies = he(), this.hasHandledOAuthCallback = !1, this.baseUrlErrorMessage = "Authentication service is not configured correctly. Please add an API domain or contact support.";
1519
1499
  }
1520
1500
  hasApiBaseUrl() {
1521
1501
  return this.baseUrl.trim().length > 0;
@@ -1523,45 +1503,31 @@ let m = class extends H {
1523
1503
  getNormalizedBaseUrl() {
1524
1504
  const e = this.baseUrl.trim();
1525
1505
  if (!e) return "";
1526
- const t = e.endsWith("/") ? e : `${e}/`;
1527
- return t.startsWith("http://") || t.startsWith("https://") ? t : `https://${t}`;
1506
+ const t = e.startsWith("http://") || e.startsWith("https://") ? e : `https://${e}`;
1507
+ return t.endsWith("/") ? t : `${t}/`;
1528
1508
  }
1529
1509
  getApiService() {
1530
1510
  if (!this.hasApiBaseUrl())
1531
1511
  throw new Error("API domain is not set");
1532
- return this.apiService || (this.apiService = oe({
1512
+ return this.apiService || (this.apiService = ne({
1533
1513
  baseUrl: this.getNormalizedBaseUrl()
1534
1514
  })), this.apiService;
1535
1515
  }
1536
1516
  connectedCallback() {
1537
- super.connectedCallback(), window.addEventListener("keyup", this.boundKeyHandler);
1517
+ super.connectedCallback();
1538
1518
  const e = this.cookies.getAuthToken("AUTH_TOKEN"), t = this.cookies.getAuthToken("REFRESH_TOKEN");
1539
1519
  this.isLoggedIn = !!(e && t), this.mode = this.disableSignup && this.initialMode === "signup" ? "signin" : this.initialMode, this.hasApiBaseUrl() || (this.error = this.baseUrlErrorMessage), this.handleOAuthCallbackIfPresent();
1540
1520
  }
1541
- disconnectedCallback() {
1542
- window.removeEventListener("keyup", this.boundKeyHandler), this.unlockBodyScroll(), super.disconnectedCallback();
1543
- }
1544
1521
  firstUpdated() {
1545
- this.open && (this.isVisible = !0);
1546
- }
1547
- updated(e) {
1548
- e.has("disableSignup") && this.disableSignup && this.mode === "signup" && (this.mode = "signin", this.signupStep = "form"), e.has("baseUrl") && (this.apiService = void 0, this.hasApiBaseUrl() ? (this.error === this.baseUrlErrorMessage && (this.error = ""), this.hasHandledOAuthCallback || this.handleOAuthCallbackIfPresent()) : this.error = this.baseUrlErrorMessage), (e.has("oauthDomain") || e.has("oauthRegion") || e.has("oauthUserPoolId") || e.has("oauthClientId") || e.has("oauthRedirectUri")) && (this.oauthService = void 0, this.handleOAuthCallbackIfPresent()), e.has("open") && (this.open ? (this.isVisible = !0, this.lockBodyScroll(), setTimeout(() => {
1522
+ setTimeout(() => {
1549
1523
  this.emailInput?.focus();
1550
- }, 100)) : this.isVisible && this.handleClose()), e.has("isVisible") && (this.isVisible ? (this.lockBodyScroll(), this.cleanupInlineStyles()) : (this.unlockBodyScroll(), this.resetState()));
1551
- }
1552
- lockBodyScroll() {
1553
- this.scrollPosition = window.scrollY, document.body.classList.add("modal-open"), document.body.style.top = `-${this.scrollPosition}px`;
1554
- }
1555
- unlockBodyScroll() {
1556
- document.body.classList.remove("modal-open"), document.body.style.top = "", window.scrollTo(0, this.scrollPosition);
1524
+ }, 100);
1557
1525
  }
1558
- cleanupInlineStyles() {
1559
- setTimeout(() => {
1560
- this.modalContainer && (this.modalContainer.style.transition = "", this.modalContainer.style.transform = "");
1561
- }, 0);
1526
+ updated(e) {
1527
+ e.has("disableSignup") && this.disableSignup && this.mode === "signup" && (this.mode = "signin", this.signupStep = "form"), e.has("baseUrl") && (this.apiService = void 0, this.hasApiBaseUrl() ? (this.error === this.baseUrlErrorMessage && (this.error = ""), this.hasHandledOAuthCallback || this.handleOAuthCallbackIfPresent()) : this.error = this.baseUrlErrorMessage), (e.has("oauthDomain") || e.has("oauthRegion") || e.has("oauthUserPoolId") || e.has("oauthClientId") || e.has("oauthRedirectUri")) && (this.oauthService = void 0, this.handleOAuthCallbackIfPresent());
1562
1528
  }
1563
1529
  resetState() {
1564
- this.isDragging = !1, this.lastDragEndTime = 0, this.dragStartY = 0, this.dragCurrentY = 0, this.dragStartTime = 0, this.error = "", this.notice = "", this.errors = {}, this.email = "", this.password = "", this.givenName = "", this.familyName = "", this.newPassword = "", this.confirmPassword = "", this.otpDigits = ["", "", "", "", "", ""], this.signupOtpDigits = ["", "", "", "", "", ""], this.resetStep = "none", this.signupStep = "form", this.mode = this.initialMode;
1530
+ this.error = "", this.notice = "", this.errors = {}, this.email = "", this.password = "", this.givenName = "", this.familyName = "", this.newPassword = "", this.confirmPassword = "", this.otpDigits = ["", "", "", "", "", ""], this.signupOtpDigits = ["", "", "", "", "", ""], this.resetStep = "none", this.signupStep = "form", this.mode = this.initialMode;
1565
1531
  }
1566
1532
  toggleMode() {
1567
1533
  this.resetStep === "none" && (this.disableSignup && this.mode === "signin" || (this.mode = this.mode === "signin" ? "signup" : "signin", this.signupStep = "form", this.error = "", this.notice = "", this.errors = {}, this.confirmPassword = "", this.mode === "signin" && (this.givenName = "", this.familyName = "", this.signupOtpDigits = ["", "", "", "", "", ""])));
@@ -1587,8 +1553,8 @@ let m = class extends H {
1587
1553
  else if (this.password.length < 8)
1588
1554
  e.password = "Password must be at least 8 characters";
1589
1555
  else if (this.mode === "signup") {
1590
- const t = /[A-Z]/.test(this.password), s = /[a-z]/.test(this.password), i = /[0-9]/.test(this.password);
1591
- (!t || !s || !i) && (e.password = "Password must contain uppercase, lowercase, and number");
1556
+ const t = /[A-Z]/.test(this.password), s = /[a-z]/.test(this.password), r = /[0-9]/.test(this.password);
1557
+ (!t || !s || !r) && (e.password = "Password must contain uppercase, lowercase, and number");
1592
1558
  }
1593
1559
  }
1594
1560
  if (this.mode === "signup" && this.resetStep === "none" && this.signupStep === "form" && (this.givenName.trim() ? /^[a-zA-Z\s-']+$/.test(this.givenName.trim()) || (e.givenName = "Invalid first name") : e.givenName = "First name is required", this.familyName.trim() ? /^[a-zA-Z\s-']+$/.test(this.familyName.trim()) || (e.familyName = "Invalid last name") : e.familyName = "Last name is required", this.confirmPassword ? this.password !== this.confirmPassword && (e.confirm_password = "Passwords must match") : e.confirm_password = "Please confirm your password"), this.signupStep === "otp") {
@@ -1603,8 +1569,8 @@ let m = class extends H {
1603
1569
  else if (this.newPassword.length < 8)
1604
1570
  e.new_password = "Password must be at least 8 characters";
1605
1571
  else {
1606
- const s = /[A-Z]/.test(this.newPassword), i = /[a-z]/.test(this.newPassword), r = /[0-9]/.test(this.newPassword);
1607
- (!s || !i || !r) && (e.new_password = "Password must contain uppercase, lowercase, and number");
1572
+ const s = /[A-Z]/.test(this.newPassword), r = /[a-z]/.test(this.newPassword), i = /[0-9]/.test(this.newPassword);
1573
+ (!s || !r || !i) && (e.new_password = "Password must contain uppercase, lowercase, and number");
1608
1574
  }
1609
1575
  this.confirmPassword ? this.newPassword !== this.confirmPassword && (e.confirm_password = "Passwords must match") : e.confirm_password = "Please confirm your password";
1610
1576
  }
@@ -1662,8 +1628,8 @@ let m = class extends H {
1662
1628
  }
1663
1629
  }
1664
1630
  }
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(
1631
+ setAuthTokens(e, t, s, r) {
1632
+ this.cookies.setAuthToken("ACCESS_TOKEN", e), this.cookies.setAuthToken("AUTH_TOKEN", t), this.cookies.setAuthToken("REFRESH_TOKEN", s), this.cookies.setCookie("USER_EMAIL", r.email), this.isLoggedIn = !0, this.dispatchEvent(
1667
1633
  new CustomEvent("auth-success", {
1668
1634
  bubbles: !0,
1669
1635
  composed: !0
@@ -1674,8 +1640,8 @@ let m = class extends H {
1674
1640
  const e = {
1675
1641
  email: this.email.trim(),
1676
1642
  password: this.password
1677
- }, { accessToken: t, idToken: s, refreshToken: i, user: r } = await this.getApiService().login(e);
1678
- this.setAuthTokens(t, s, i, r), this.handleClose();
1643
+ }, { accessToken: t, idToken: s, refreshToken: r, user: i } = await this.getApiService().login(e);
1644
+ this.setAuthTokens(t, s, r, i);
1679
1645
  }
1680
1646
  isOAuthConfigured() {
1681
1647
  return [this.oauthDomain, this.oauthRegion, this.oauthUserPoolId, this.oauthClientId].every(
@@ -1687,7 +1653,7 @@ let m = class extends H {
1687
1653
  return null;
1688
1654
  if (!this.oauthService) {
1689
1655
  const e = this.oauthRedirectUri?.trim() ? this.oauthRedirectUri.trim() : void 0;
1690
- this.oauthService = ce({
1656
+ this.oauthService = pe({
1691
1657
  domain: this.oauthDomain.trim(),
1692
1658
  cognitoRegion: this.oauthRegion.trim(),
1693
1659
  userPoolId: this.oauthUserPoolId.trim(),
@@ -1700,32 +1666,32 @@ let m = class extends H {
1700
1666
  stripOAuthParamsFromUrl() {
1701
1667
  const e = new URL(window.location.href);
1702
1668
  let t = !1;
1703
- for (const s of ge)
1669
+ for (const s of fe)
1704
1670
  e.searchParams.has(s) && (e.searchParams.delete(s), t = !0);
1705
1671
  if (t) {
1706
- const s = e.searchParams.toString(), i = `${e.pathname}${s ? `?${s}` : ""}${e.hash}`;
1707
- window.history.replaceState({}, document.title, i);
1672
+ const s = e.searchParams.toString(), r = `${e.pathname}${s ? `?${s}` : ""}${e.hash}`;
1673
+ window.history.replaceState({}, document.title, r);
1708
1674
  }
1709
1675
  }
1710
1676
  async handleOAuthCallbackIfPresent() {
1711
- const e = new URLSearchParams(window.location.search), t = e.get("access_token"), s = e.get("id_token"), i = e.get("refresh_token"), r = e.get("code"), o = e.get("state"), a = e.get("error"), c = e.get("error_description");
1712
- if ((t || s || r || a) && !this.hasHandledOAuthCallback) {
1677
+ const e = new URLSearchParams(window.location.search), t = e.get("access_token"), s = e.get("id_token"), r = e.get("refresh_token"), i = e.get("code"), o = e.get("state"), a = e.get("error"), p = e.get("error_description");
1678
+ if ((t || s || i || a) && !this.hasHandledOAuthCallback) {
1713
1679
  if (!this.hasApiBaseUrl()) {
1714
1680
  this.error = this.baseUrlErrorMessage;
1715
1681
  return;
1716
1682
  }
1717
- this.open = !0, this.isVisible = !0, this.hasHandledOAuthCallback = !0, this.isLoading = !0, this.error = "";
1683
+ this.hasHandledOAuthCallback = !0, this.isLoading = !0, this.error = "";
1718
1684
  try {
1719
1685
  if (a)
1720
- throw new Error(c || `OAuth error: ${a}`);
1721
- if (t && s && i) {
1722
- const { accessToken: h, idToken: d, refreshToken: l, user: p } = await this.getApiService().login({
1686
+ throw new Error(p || `OAuth error: ${a}`);
1687
+ if (t && s && r) {
1688
+ const { accessToken: h, idToken: c, refreshToken: l, user: d } = await this.getApiService().login({
1723
1689
  accessToken: t,
1724
- refreshToken: i,
1690
+ refreshToken: r,
1725
1691
  idToken: s
1726
1692
  });
1727
- this.setAuthTokens(h, d, l ?? i, p), this.handleClose();
1728
- } else if (r && o) {
1693
+ this.setAuthTokens(h, c, l ?? r, d);
1694
+ } else if (i && o) {
1729
1695
  if (!this.isOAuthConfigured())
1730
1696
  throw new Error("OAuth is not configured correctly. Please try again later.");
1731
1697
  const h = this.getOAuthService();
@@ -1733,12 +1699,12 @@ let m = class extends H {
1733
1699
  throw new Error("OAuth is not configured correctly. Please try again later.");
1734
1700
  if (!h.validateState(o))
1735
1701
  throw new Error("Invalid state parameter. Please try signing in again.");
1736
- const d = await h.exchangeCodeForTokens(r), { accessToken: l, idToken: p, refreshToken: u, user: $ } = await this.getApiService().login({
1737
- accessToken: d.access_token,
1738
- refreshToken: d.refresh_token,
1739
- idToken: d.id_token
1702
+ const c = await h.exchangeCodeForTokens(i), { accessToken: l, idToken: d, refreshToken: u, user: f } = await this.getApiService().login({
1703
+ accessToken: c.access_token,
1704
+ refreshToken: c.refresh_token,
1705
+ idToken: c.id_token
1740
1706
  });
1741
- this.setAuthTokens(l, p, u ?? d.refresh_token, $), this.handleClose();
1707
+ this.setAuthTokens(l, d, u ?? c.refresh_token, f);
1742
1708
  } else
1743
1709
  throw new Error("Missing required OAuth parameters");
1744
1710
  } catch (h) {
@@ -1801,17 +1767,17 @@ let m = class extends H {
1801
1767
  this.error = this.baseUrlErrorMessage;
1802
1768
  return;
1803
1769
  }
1804
- const i = this.getApiService(), {
1805
- redirectUrl: r,
1770
+ const r = this.getApiService(), {
1771
+ redirectUrl: i,
1806
1772
  requiresRedirect: o
1807
- } = await i.logout({
1773
+ } = await r.logout({
1808
1774
  accessToken: e,
1809
1775
  refreshToken: s,
1810
1776
  authToken: t
1811
1777
  });
1812
- if (o && r) {
1778
+ if (o && i) {
1813
1779
  const a = window.location.host;
1814
- new URL(r).host !== a ? window.open(r, "newWindow", "width=400,height=500,resizable=yes,scrollbars=yes,status=yes") : window.location.href = r;
1780
+ new URL(i).host !== a ? window.open(i, "newWindow", "width=400,height=500,resizable=yes,scrollbars=yes,status=yes") : window.location.href = i;
1815
1781
  }
1816
1782
  } catch {
1817
1783
  } finally {
@@ -1827,7 +1793,7 @@ let m = class extends H {
1827
1793
  }
1828
1794
  handleOAuthSignIn(e) {
1829
1795
  if (this.oauthSpaDomain?.trim()) {
1830
- const t = this.oauthSpaDomain.trim(), s = t.startsWith("http://") || t.startsWith("https://") ? t : `https://${t}`, i = s.endsWith("/") ? s.slice(0, -1) : s, r = window.location.href, o = `${i}?return_url=${encodeURIComponent(r)}&provider=${e}&theme=${this.theme}`;
1796
+ const t = this.oauthSpaDomain.trim(), s = t.startsWith("http://") || t.startsWith("https://") ? t : `https://${t}`, r = s.endsWith("/") ? s.slice(0, -1) : s, i = window.location.href, o = `${r}?return_url=${encodeURIComponent(i)}&provider=${e}&theme=${this.theme}`;
1831
1797
  window.location.href = o;
1832
1798
  return;
1833
1799
  }
@@ -1835,122 +1801,72 @@ let m = class extends H {
1835
1801
  }
1836
1802
  // OTP input handlers
1837
1803
  handleOtpInput(e, t, s) {
1838
- const i = t.target, r = i.value.replace(/\D/g, "");
1839
- if (!r) {
1804
+ const r = t.target, i = r.value.replace(/\D/g, "");
1805
+ if (!i) {
1840
1806
  s ? (this.signupOtpDigits[e] = "", this.signupOtpDigits = [...this.signupOtpDigits]) : (this.otpDigits[e] = "", this.otpDigits = [...this.otpDigits]);
1841
1807
  return;
1842
1808
  }
1843
- const o = r[r.length - 1];
1809
+ const o = i[i.length - 1];
1844
1810
  if (s ? (this.signupOtpDigits[e] = o, this.signupOtpDigits = [...this.signupOtpDigits]) : (this.otpDigits[e] = o, this.otpDigits = [...this.otpDigits]), e < 5) {
1845
1811
  const a = this.shadowRoot?.querySelector(
1846
1812
  `${s ? ".signup-otp-input" : ".reset-otp-input"}[data-index="${e + 1}"]`
1847
1813
  );
1848
1814
  a?.focus(), a?.select();
1849
1815
  } else
1850
- i.blur();
1816
+ r.blur();
1851
1817
  }
1852
1818
  handleOtpKeydown(e, t, s) {
1853
- const i = s ? this.signupOtpDigits : this.otpDigits;
1819
+ const r = s ? this.signupOtpDigits : this.otpDigits;
1854
1820
  if (t.key === "Backspace") {
1855
- if (i[e]) {
1821
+ if (r[e]) {
1856
1822
  s ? (this.signupOtpDigits[e] = "", this.signupOtpDigits = [...this.signupOtpDigits]) : (this.otpDigits[e] = "", this.otpDigits = [...this.otpDigits]);
1857
1823
  return;
1858
1824
  }
1859
1825
  if (e > 0) {
1860
- const r = this.shadowRoot?.querySelector(
1826
+ const i = this.shadowRoot?.querySelector(
1861
1827
  `${s ? ".signup-otp-input" : ".reset-otp-input"}[data-index="${e - 1}"]`
1862
1828
  );
1863
- r?.focus(), r?.select(), s ? (this.signupOtpDigits[e - 1] = "", this.signupOtpDigits = [...this.signupOtpDigits]) : (this.otpDigits[e - 1] = "", this.otpDigits = [...this.otpDigits]);
1829
+ i?.focus(), i?.select(), s ? (this.signupOtpDigits[e - 1] = "", this.signupOtpDigits = [...this.signupOtpDigits]) : (this.otpDigits[e - 1] = "", this.otpDigits = [...this.otpDigits]);
1864
1830
  }
1865
1831
  }
1866
1832
  if (t.key === "ArrowLeft" && e > 0) {
1867
- const r = this.shadowRoot?.querySelector(
1833
+ const i = this.shadowRoot?.querySelector(
1868
1834
  `${s ? ".signup-otp-input" : ".reset-otp-input"}[data-index="${e - 1}"]`
1869
1835
  );
1870
- r?.focus(), r?.select(), t.preventDefault();
1836
+ i?.focus(), i?.select(), t.preventDefault();
1871
1837
  }
1872
1838
  if (t.key === "ArrowRight" && e < 5) {
1873
- const r = this.shadowRoot?.querySelector(
1839
+ const i = this.shadowRoot?.querySelector(
1874
1840
  `${s ? ".signup-otp-input" : ".reset-otp-input"}[data-index="${e + 1}"]`
1875
1841
  );
1876
- r?.focus(), r?.select(), t.preventDefault();
1842
+ i?.focus(), i?.select(), t.preventDefault();
1877
1843
  }
1878
1844
  t.key.length === 1 && /\D/.test(t.key) && t.preventDefault();
1879
1845
  }
1880
1846
  handleOtpPaste(e, t) {
1881
- const i = (e.clipboardData?.getData("text") || "").replace(/\D/g, "").slice(0, 6).split("");
1882
- if (i.length === 0) return;
1847
+ const r = (e.clipboardData?.getData("text") || "").replace(/\D/g, "").slice(0, 6).split("");
1848
+ if (r.length === 0) return;
1883
1849
  e.preventDefault();
1884
1850
  for (let o = 0; o < 6; o++)
1885
- t ? this.signupOtpDigits[o] = i[o] || "" : this.otpDigits[o] = i[o] || "";
1851
+ t ? this.signupOtpDigits[o] = r[o] || "" : this.otpDigits[o] = r[o] || "";
1886
1852
  t ? this.signupOtpDigits = [...this.signupOtpDigits] : this.otpDigits = [...this.otpDigits];
1887
- const r = (t ? this.signupOtpDigits : this.otpDigits).findIndex((o) => !o);
1888
- if (r === -1)
1853
+ const i = (t ? this.signupOtpDigits : this.otpDigits).findIndex((o) => !o);
1854
+ if (i === -1)
1889
1855
  this.shadowRoot?.querySelector(
1890
1856
  `${t ? ".signup-otp-input" : ".reset-otp-input"}[data-index="5"]`
1891
1857
  )?.blur();
1892
1858
  else {
1893
1859
  const o = this.shadowRoot?.querySelector(
1894
- `${t ? ".signup-otp-input" : ".reset-otp-input"}[data-index="${r}"]`
1860
+ `${t ? ".signup-otp-input" : ".reset-otp-input"}[data-index="${i}"]`
1895
1861
  );
1896
1862
  o?.focus(), o?.select();
1897
1863
  }
1898
1864
  }
1899
1865
  render() {
1900
- if (!this.isVisible)
1901
- return g;
1902
- const e = {
1903
- "modal-overlay": !0,
1904
- "modal-overlay--closing": this.isClosing
1905
- }, t = {
1906
- "modal-container": !0,
1907
- "modal-container--drawer": !0,
1908
- "modal-container--closing": this.isClosing,
1909
- "modal-container--dragging": this.isDragging,
1910
- [`modal-container--${this.size}`]: !0
1911
- };
1912
- return f`
1913
- <!-- Modal/Drawer -->
1914
- <div
1915
- class=${mt(e)}
1916
- @click=${this.handleOverlayClick}
1917
- @touchstart=${this.handleDragStart}
1918
- @touchmove=${this.handleDragMove}
1919
- @touchend=${this.handleDragEnd}
1920
- @mousedown=${this.handleDragStart}
1921
- >
1922
- <div
1923
- class=${mt(t)}
1924
- @click=${(s) => s.stopPropagation()}
1925
- role="dialog"
1926
- aria-modal="true"
1927
- @mousemove=${this.handleDragMove}
1928
- @mouseup=${this.handleDragEnd}
1929
- >
1930
- <!-- Drawer Handle -->
1931
- <div
1932
- class="drawer-handle"
1933
- @click=${this.handleHandleClick}
1934
- role="button"
1935
- tabindex="0"
1936
- aria-label="Close drawer"
1937
- >
1938
- <div class="drawer-handle-bar"></div>
1939
- </div>
1940
-
1941
- <!-- Drawer Content Wrapper -->
1942
- <div class="drawer-content drawer-content--${this.size}">
1943
- ${this.renderContent()}
1944
- </div>
1945
- </div>
1946
- </div>
1947
- `;
1948
- }
1949
- renderContent() {
1950
1866
  if (!this.hasApiBaseUrl()) {
1951
1867
  const e = this.baseUrlErrorMessage;
1952
- return f`
1953
- ${this.logoUrl.length > 0 ? f`
1868
+ return m`
1869
+ ${this.logoUrl.length > 0 ? m`
1954
1870
  <header class="modal-header">
1955
1871
  <div class="auth-header">
1956
1872
  <img
@@ -1973,8 +1889,8 @@ let m = class extends H {
1973
1889
  </div>
1974
1890
  `;
1975
1891
  }
1976
- return this.isLoading && this.hasHandledOAuthCallback ? f`
1977
- ${this.logoUrl.length > 0 ? f`
1892
+ return this.isLoading && this.hasHandledOAuthCallback ? m`
1893
+ ${this.logoUrl.length > 0 ? m`
1978
1894
  <header class="modal-header">
1979
1895
  <div class="auth-header">
1980
1896
  <img
@@ -1991,16 +1907,22 @@ let m = class extends H {
1991
1907
  <div class="modal-body">
1992
1908
  <div class="auth-form">
1993
1909
  <div class="form-actions">
1994
- <button type="button" class="cta" disabled>
1910
+ <base-button
1911
+ type="button"
1912
+ variant="primary"
1913
+ full-width
1914
+ loading
1915
+ disabled
1916
+ >
1995
1917
  Signing in...
1996
- </button>
1918
+ </base-button>
1997
1919
  </div>
1998
1920
  ${this.renderAlerts()}
1999
1921
  </div>
2000
1922
  </div>
2001
- ` : this.isLoggedIn ? f`
1923
+ ` : this.isLoggedIn ? m`
2002
1924
  <!-- Header -->
2003
- ${this.logoUrl.length > 0 ? f`
1925
+ ${this.logoUrl.length > 0 ? m`
2004
1926
  <header class="modal-header">
2005
1927
  <div class="auth-header">
2006
1928
  <img
@@ -2018,14 +1940,21 @@ let m = class extends H {
2018
1940
  <div class="modal-body">
2019
1941
  <div class="auth-form">
2020
1942
  <div class="form-actions">
2021
- <button type="button" class="cta" @click=${this.logout}>Logout</button>
1943
+ <base-button
1944
+ type="button"
1945
+ variant="primary"
1946
+ full-width
1947
+ @click=${this.logout}
1948
+ >
1949
+ Logout
1950
+ </base-button>
2022
1951
  </div>
2023
1952
  ${this.renderAlerts()}
2024
1953
  </div>
2025
1954
  </div>
2026
- ` : f`
1955
+ ` : m`
2027
1956
  <!-- Header -->
2028
- ${(!this.mode || this.resetStep === "none") && this.logoUrl.length > 0 && this.mode === "signin" ? f`
1957
+ ${(!this.mode || this.resetStep === "none") && this.logoUrl.length > 0 && this.mode === "signin" ? m`
2029
1958
  <header class="modal-header">
2030
1959
 
2031
1960
  <div class="auth-header">
@@ -2059,39 +1988,33 @@ let m = class extends H {
2059
1988
  }
2060
1989
  renderFormContent() {
2061
1990
  if (this.resetStep === "none" && (!this.mode || this.mode === "signin" || this.signupStep === "form"))
2062
- return f`
1991
+ return m`
2063
1992
  <!-- Email -->
2064
- <label class="field">
2065
- <span class="field-label">Email Address</span>
2066
- <input
2067
- id="email-input"
2068
- type="email"
2069
- class="field-input ${this.errors.email ? "field-input--error" : ""}"
2070
- placeholder="Enter your email"
2071
- .value=${this.email}
2072
- @input=${(e) => this.email = e.target.value}
2073
- required
2074
- autocomplete="email"
2075
- />
2076
- ${this.errors.email ? f`<span class="field-error">${this.errors.email}</span>` : g}
2077
- </label>
1993
+ <base-input
1994
+ id="email-input"
1995
+ type="email"
1996
+ label="Email Address"
1997
+ placeholder="Enter your email"
1998
+ .value=${this.email}
1999
+ .error=${this.errors.email}
2000
+ ?required=${!0}
2001
+ autocomplete="email"
2002
+ @input=${(e) => this.email = e.detail.value}
2003
+ ></base-input>
2078
2004
 
2079
2005
  <!-- Password -->
2080
- <label class="field">
2081
- <span class="field-label">Password</span>
2082
- <input
2083
- type="password"
2084
- class="field-input ${this.errors.password ? "field-input--error" : ""}"
2085
- placeholder="Enter your password"
2086
- .value=${this.password}
2087
- @input=${(e) => this.password = e.target.value}
2088
- required
2089
- autocomplete=${this.mode === "signup" ? "new-password" : "current-password"}
2090
- />
2091
- ${this.errors.password ? f`<span class="field-error">${this.errors.password}</span>` : g}
2092
- </label>
2093
-
2094
- ${this.mode === "signin" && this.error ? f`
2006
+ <base-input
2007
+ type="password"
2008
+ label="Password"
2009
+ placeholder="Enter your password"
2010
+ .value=${this.password}
2011
+ .error=${this.errors.password}
2012
+ ?required=${!0}
2013
+ autocomplete=${this.mode === "signup" ? "new-password" : "current-password"}
2014
+ @input=${(e) => this.password = e.detail.value}
2015
+ ></base-input>
2016
+
2017
+ ${this.mode === "signin" && this.error ? m`
2095
2018
  <div class="forgot-row">
2096
2019
  <button type="button" class="text-btn" @click=${this.startReset}>
2097
2020
  Forgot your password?
@@ -2099,62 +2022,53 @@ let m = class extends H {
2099
2022
  </div>
2100
2023
  ` : g}
2101
2024
 
2102
- ${this.mode === "signup" ? f`
2025
+ ${this.mode === "signup" ? m`
2103
2026
  <!-- Confirm Password -->
2104
- <label class="field">
2105
- <span class="field-label">Confirm Password</span>
2106
- <input
2107
- type="password"
2108
- class="field-input ${this.errors.confirm_password ? "field-input--error" : ""}"
2109
- placeholder="Re-enter your password"
2110
- .value=${this.confirmPassword}
2111
- @input=${(e) => this.confirmPassword = e.target.value}
2112
- required
2113
- autocomplete="new-password"
2114
- />
2115
- ${this.errors.confirm_password ? f`<span class="field-error">${this.errors.confirm_password}</span>` : g}
2116
- </label>
2027
+ <base-input
2028
+ type="password"
2029
+ label="Confirm Password"
2030
+ placeholder="Re-enter your password"
2031
+ .value=${this.confirmPassword}
2032
+ .error=${this.errors.confirm_password}
2033
+ ?required=${!0}
2034
+ autocomplete="new-password"
2035
+ @input=${(e) => this.confirmPassword = e.detail.value}
2036
+ ></base-input>
2117
2037
 
2118
2038
  <!-- First Name -->
2119
- <label class="field">
2120
- <span class="field-label">First Name</span>
2121
- <input
2122
- type="text"
2123
- class="field-input ${this.errors.givenName ? "field-input--error" : ""}"
2124
- placeholder="Enter your first name"
2125
- .value=${this.givenName}
2126
- @input=${(e) => this.givenName = e.target.value}
2127
- required
2128
- autocomplete="given-name"
2129
- />
2130
- ${this.errors.givenName ? f`<span class="field-error">${this.errors.givenName}</span>` : g}
2131
- </label>
2039
+ <base-input
2040
+ type="text"
2041
+ label="First Name"
2042
+ placeholder="Enter your first name"
2043
+ .value=${this.givenName}
2044
+ .error=${this.errors.givenName}
2045
+ ?required=${!0}
2046
+ autocomplete="given-name"
2047
+ @input=${(e) => this.givenName = e.detail.value}
2048
+ ></base-input>
2132
2049
 
2133
2050
  <!-- Last Name -->
2134
- <label class="field">
2135
- <span class="field-label">Last Name</span>
2136
- <input
2137
- type="text"
2138
- class="field-input ${this.errors.familyName ? "field-input--error" : ""}"
2139
- placeholder="Enter your last name"
2140
- .value=${this.familyName}
2141
- @input=${(e) => this.familyName = e.target.value}
2142
- required
2143
- autocomplete="family-name"
2144
- />
2145
- ${this.errors.familyName ? f`<span class="field-error">${this.errors.familyName}</span>` : g}
2146
- </label>
2051
+ <base-input
2052
+ type="text"
2053
+ label="Last Name"
2054
+ placeholder="Enter your last name"
2055
+ .value=${this.familyName}
2056
+ .error=${this.errors.familyName}
2057
+ ?required=${!0}
2058
+ autocomplete="family-name"
2059
+ @input=${(e) => this.familyName = e.detail.value}
2060
+ ></base-input>
2147
2061
  ` : g}
2148
2062
  `;
2149
2063
  if (this.mode === "signup" && this.signupStep === "otp")
2150
- return f`
2064
+ return m`
2151
2065
  <div class="otp-section">
2152
2066
  <label class="otp-label">Enter 6-digit code</label>
2153
2067
  <div class="otp-inputs" role="group" aria-label="One time code">
2154
- ${$t(
2068
+ ${yt(
2155
2069
  Array.from({ length: 6 }, (e, t) => t),
2156
2070
  (e) => e,
2157
- (e) => f`
2071
+ (e) => m`
2158
2072
  <input
2159
2073
  class="otp-input signup-otp-input ${this.errors.signup_otp ? "otp-input--error" : ""}"
2160
2074
  type="text"
@@ -2171,7 +2085,7 @@ let m = class extends H {
2171
2085
  `
2172
2086
  )}
2173
2087
  </div>
2174
- ${this.errors.signup_otp ? f`<p class="otp-error">${this.errors.signup_otp}</p>` : g}
2088
+ ${this.errors.signup_otp ? m`<p class="otp-error">${this.errors.signup_otp}</p>` : g}
2175
2089
  </div>
2176
2090
  <div class="forgot-row">
2177
2091
  <button type="button" class="text-btn" @click=${this.backToSignupForm}>
@@ -2180,21 +2094,18 @@ let m = class extends H {
2180
2094
  </div>
2181
2095
  `;
2182
2096
  if (this.resetStep === "request")
2183
- return f`
2184
- <label class="field">
2185
- <span class="field-label">Email Address</span>
2186
- <input
2187
- id="email-input"
2188
- type="email"
2189
- class="field-input ${this.errors.email ? "field-input--error" : ""}"
2190
- placeholder="Enter your email"
2191
- .value=${this.email}
2192
- @input=${(e) => this.email = e.target.value}
2193
- required
2194
- autocomplete="email"
2195
- />
2196
- ${this.errors.email ? f`<span class="field-error">${this.errors.email}</span>` : g}
2197
- </label>
2097
+ return m`
2098
+ <base-input
2099
+ id="email-input"
2100
+ type="email"
2101
+ label="Email Address"
2102
+ placeholder="Enter your email"
2103
+ .value=${this.email}
2104
+ .error=${this.errors.email}
2105
+ ?required=${!0}
2106
+ autocomplete="email"
2107
+ @input=${(e) => this.email = e.detail.value}
2108
+ ></base-input>
2198
2109
  <div class="forgot-row">
2199
2110
  <button type="button" class="text-btn" @click=${this.cancelReset}>
2200
2111
  Back to Sign In
@@ -2203,28 +2114,25 @@ let m = class extends H {
2203
2114
  `;
2204
2115
  if (this.resetStep === "confirm") {
2205
2116
  const e = this.otpDigits.every((t) => /^\d$/.test(t));
2206
- return f`
2207
- <label class="field">
2208
- <span class="field-label">Email Address</span>
2209
- <input
2210
- type="email"
2211
- class="field-input ${this.errors.email ? "field-input--error" : ""}"
2212
- placeholder="Enter your email"
2213
- .value=${this.email}
2214
- @input=${(t) => this.email = t.target.value}
2215
- required
2216
- autocomplete="email"
2217
- />
2218
- ${this.errors.email ? f`<span class="field-error">${this.errors.email}</span>` : g}
2219
- </label>
2117
+ return m`
2118
+ <base-input
2119
+ type="email"
2120
+ label="Email Address"
2121
+ placeholder="Enter your email"
2122
+ .value=${this.email}
2123
+ .error=${this.errors.email}
2124
+ ?required=${!0}
2125
+ autocomplete="email"
2126
+ @input=${(t) => this.email = t.detail.value}
2127
+ ></base-input>
2220
2128
 
2221
2129
  <div class="otp-section">
2222
2130
  <label class="otp-label">Enter 6-digit code</label>
2223
2131
  <div class="otp-inputs" role="group" aria-label="One time code">
2224
- ${$t(
2132
+ ${yt(
2225
2133
  Array.from({ length: 6 }, (t, s) => s),
2226
2134
  (t) => t,
2227
- (t) => f`
2135
+ (t) => m`
2228
2136
  <input
2229
2137
  class="otp-input reset-otp-input ${this.errors.otp ? "otp-input--error" : ""}"
2230
2138
  type="text"
@@ -2241,38 +2149,32 @@ let m = class extends H {
2241
2149
  `
2242
2150
  )}
2243
2151
  </div>
2244
- ${this.errors.otp ? f`<p class="otp-error">${this.errors.otp}</p>` : g}
2152
+ ${this.errors.otp ? m`<p class="otp-error">${this.errors.otp}</p>` : g}
2245
2153
  </div>
2246
2154
 
2247
- ${e ? f`
2155
+ ${e ? m`
2248
2156
  <div class="new-password-fields">
2249
- <label class="field">
2250
- <span class="field-label">New Password</span>
2251
- <input
2252
- type="password"
2253
- class="field-input ${this.errors.new_password ? "field-input--error" : ""}"
2254
- placeholder="Enter your new password"
2255
- .value=${this.newPassword}
2256
- @input=${(t) => this.newPassword = t.target.value}
2257
- required
2258
- autocomplete="new-password"
2259
- />
2260
- ${this.errors.new_password ? f`<span class="field-error">${this.errors.new_password}</span>` : g}
2261
- </label>
2262
-
2263
- <label class="field">
2264
- <span class="field-label">Confirm New Password</span>
2265
- <input
2266
- type="password"
2267
- class="field-input ${this.errors.confirm_password ? "field-input--error" : ""}"
2268
- placeholder="Re-enter your new password"
2269
- .value=${this.confirmPassword}
2270
- @input=${(t) => this.confirmPassword = t.target.value}
2271
- required
2272
- autocomplete="new-password"
2273
- />
2274
- ${this.errors.confirm_password ? f`<span class="field-error">${this.errors.confirm_password}</span>` : g}
2275
- </label>
2157
+ <base-input
2158
+ type="password"
2159
+ label="New Password"
2160
+ placeholder="Enter your new password"
2161
+ .value=${this.newPassword}
2162
+ .error=${this.errors.new_password}
2163
+ ?required=${!0}
2164
+ autocomplete="new-password"
2165
+ @input=${(t) => this.newPassword = t.detail.value}
2166
+ ></base-input>
2167
+
2168
+ <base-input
2169
+ type="password"
2170
+ label="Confirm New Password"
2171
+ placeholder="Re-enter your new password"
2172
+ .value=${this.confirmPassword}
2173
+ .error=${this.errors.confirm_password}
2174
+ ?required=${!0}
2175
+ autocomplete="new-password"
2176
+ @input=${(t) => this.confirmPassword = t.detail.value}
2177
+ ></base-input>
2276
2178
  </div>
2277
2179
  ` : g}
2278
2180
 
@@ -2287,31 +2189,55 @@ let m = class extends H {
2287
2189
  }
2288
2190
  renderActions() {
2289
2191
  if (this.resetStep === "request")
2290
- return f`
2291
- <button type="submit" class="cta" ?disabled=${this.isLoading}>
2192
+ return m`
2193
+ <base-button
2194
+ type="submit"
2195
+ variant="primary"
2196
+ full-width
2197
+ ?loading=${this.isLoading}
2198
+ ?disabled=${this.isLoading}
2199
+ >
2292
2200
  ${this.isLoading ? "Sending..." : "Send Reset Code"}
2293
- </button>
2201
+ </base-button>
2294
2202
  `;
2295
2203
  if (this.resetStep === "confirm")
2296
- return this.otpDigits.every((t) => /^\d$/.test(t)) ? f`
2297
- <button type="submit" class="cta" ?disabled=${this.isLoading}>
2204
+ return this.otpDigits.every((t) => /^\d$/.test(t)) ? m`
2205
+ <base-button
2206
+ type="submit"
2207
+ variant="primary"
2208
+ full-width
2209
+ ?loading=${this.isLoading}
2210
+ ?disabled=${this.isLoading}
2211
+ >
2298
2212
  ${this.isLoading ? "Resetting..." : "Reset Password"}
2299
- </button>
2213
+ </base-button>
2300
2214
  ` : g;
2301
2215
  if (this.mode === "signup" && this.signupStep === "otp") {
2302
2216
  const e = this.signupOtpDigits.every((t) => /^\d$/.test(t));
2303
- return f`
2304
- <button type="submit" class="cta" ?disabled=${!e || this.isLoading}>
2217
+ return m`
2218
+ <base-button
2219
+ type="submit"
2220
+ variant="primary"
2221
+ full-width
2222
+ ?loading=${this.isLoading}
2223
+ ?disabled=${!e || this.isLoading}
2224
+ >
2305
2225
  ${this.isLoading ? "Completing..." : "Complete Registration"}
2306
- </button>
2226
+ </base-button>
2307
2227
  `;
2308
2228
  }
2309
- return f`
2310
- <button type="submit" class="cta" ?disabled=${this.isLoading}>
2229
+ return m`
2230
+ <base-button
2231
+ type="submit"
2232
+ variant="primary"
2233
+ full-width
2234
+ ?loading=${this.isLoading}
2235
+ ?disabled=${this.isLoading}
2236
+ >
2311
2237
  ${this.isLoading ? "Loading..." : this.mode === "signup" ? "Continue" : "Sign In"}
2312
- </button>
2238
+ </base-button>
2313
2239
 
2314
- ${this.isOAuthConfigured() && this.mode === "signin" ? f`
2240
+ ${this.isOAuthConfigured() && this.mode === "signin" ? m`
2315
2241
  <div class="button-row">
2316
2242
  <button
2317
2243
  type="button"
@@ -2335,8 +2261,8 @@ let m = class extends H {
2335
2261
  `;
2336
2262
  }
2337
2263
  renderAlerts() {
2338
- return f`
2339
- ${this.notice ? f`
2264
+ return m`
2265
+ ${this.notice ? m`
2340
2266
  <div class="alert alert--success">
2341
2267
  ${this.notice}
2342
2268
  <button class="alert-close" @click=${() => this.notice = ""} aria-label="Dismiss">
@@ -2344,7 +2270,7 @@ let m = class extends H {
2344
2270
  </button>
2345
2271
  </div>
2346
2272
  ` : g}
2347
- ${this.error ? f`
2273
+ ${this.error ? m`
2348
2274
  <div class="alert alert--error">
2349
2275
  ${this.error}
2350
2276
  <button class="alert-close" @click=${() => this.error = ""} aria-label="Dismiss">
@@ -2355,7 +2281,7 @@ let m = class extends H {
2355
2281
  `;
2356
2282
  }
2357
2283
  renderFooter() {
2358
- return this.isLoggedIn ? g : this.resetStep === "none" && (!this.mode || this.mode === "signin" || this.signupStep === "form") ? this.disableSignup ? g : f`
2284
+ return this.isLoggedIn ? g : this.resetStep === "none" && (!this.mode || this.mode === "signin" || this.signupStep === "form") ? this.disableSignup ? g : m`
2359
2285
  <div class="auth-footer">
2360
2286
  <p class="toggle-text">
2361
2287
  ${this.mode === "signup" ? "Already have an account?" : "Don't have an account?"}
@@ -2364,7 +2290,7 @@ let m = class extends H {
2364
2290
  ${this.mode === "signup" ? "Sign In" : "Sign Up"}
2365
2291
  </button>
2366
2292
  </div>
2367
- ` : f`
2293
+ ` : m`
2368
2294
  <div class="auth-footer">
2369
2295
  <p class="toggle-text">
2370
2296
  Having trouble? Email
@@ -2374,7 +2300,7 @@ let m = class extends H {
2374
2300
  `;
2375
2301
  }
2376
2302
  renderGoogleIcon() {
2377
- return f`
2303
+ return m`
2378
2304
  <svg viewBox="-0.5 0 48 48" width="18" height="18" fill="none">
2379
2305
  <path d="M9.82727273,24 C9.82727273,22.4757333 10.0804318,21.0144 10.5322727,19.6437333 L2.62345455,13.6042667 C1.08206818,16.7338667 0.213636364,20.2602667 0.213636364,24 C0.213636364,27.7365333 1.081,31.2608 2.62025,34.3882667 L10.5247955,28.3370667 C10.0772273,26.9728 9.82727273,25.5168 9.82727273,24" fill="#FBBC05"></path>
2380
2306
  <path d="M23.7136364,10.1333333 C27.025,10.1333333 30.0159091,11.3066667 32.3659091,13.2266667 L39.2022727,6.4 C35.0363636,2.77333333 29.6954545,0.533333333 23.7136364,0.533333333 C14.4268636,0.533333333 6.44540909,5.84426667 2.62345455,13.6042667 L10.5322727,19.6437333 C12.3545909,14.112 17.5491591,10.1333333 23.7136364,10.1333333" fill="#EB4335"></path>
@@ -2384,7 +2310,7 @@ let m = class extends H {
2384
2310
  `;
2385
2311
  }
2386
2312
  renderAppleIcon() {
2387
- return f`
2313
+ return m`
2388
2314
  <svg viewBox="-3.5 0 48 48" width="18" height="18" class="apple-icon">
2389
2315
  <path d="M231.174735,567.792499 C232.740177,565.771699 233.926883,562.915484 233.497649,560 C230.939077,560.177808 227.948466,561.814769 226.203475,563.948463 C224.612784,565.88177 223.305444,568.757742 223.816036,571.549042 C226.613071,571.636535 229.499881,569.960061 231.174735,567.792499 L231.174735,567.792499 Z M245,595.217241 C243.880625,597.712195 243.341978,598.827022 241.899976,601.03692 C239.888467,604.121745 237.052156,607.962958 233.53412,607.991182 C230.411652,608.02505 229.606488,605.94498 225.367451,605.970382 C221.128414,605.99296 220.244696,608.030695 217.116618,607.999649 C213.601387,607.968603 210.913765,604.502761 208.902256,601.417937 C203.27452,592.79849 202.68257,582.680377 206.152914,577.298162 C208.621711,573.476705 212.515678,571.241407 216.173986,571.241407 C219.89682,571.241407 222.239372,573.296075 225.322563,573.296075 C228.313175,573.296075 230.133913,571.235762 234.440281,571.235762 C237.700215,571.235762 241.153726,573.022307 243.611302,576.10431 C235.554045,580.546683 236.85858,592.121127 245,595.217241 L245,595.217241 Z" transform="translate(-204.000000, -560.000000)" fill="#0b0b0a"></path>
2390
2316
  </svg>
@@ -2397,12 +2323,6 @@ let m = class extends H {
2397
2323
  setNotice(e) {
2398
2324
  this.notice = e;
2399
2325
  }
2400
- closeModal() {
2401
- this.handleClose();
2402
- }
2403
- openModal() {
2404
- this.open = !0, this.isVisible = !0;
2405
- }
2406
2326
  async refresh() {
2407
2327
  try {
2408
2328
  if (!this.hasApiBaseUrl()) {
@@ -2414,10 +2334,10 @@ let m = class extends H {
2414
2334
  this.cookies.clearAllAuthTokens(), this.isLoggedIn = !1;
2415
2335
  return;
2416
2336
  }
2417
- const { accessToken: i, idToken: r, refreshToken: o } = await this.getApiService().refresh({
2337
+ const { accessToken: r, idToken: i, refreshToken: o } = await this.getApiService().refresh({
2418
2338
  refreshToken: e
2419
2339
  });
2420
- this.cookies.setAuthToken("ACCESS_TOKEN", i), this.cookies.setAuthToken("AUTH_TOKEN", r), this.cookies.setAuthToken("REFRESH_TOKEN", o ?? e);
2340
+ this.cookies.setAuthToken("ACCESS_TOKEN", r), this.cookies.setAuthToken("AUTH_TOKEN", i), this.cookies.setAuthToken("REFRESH_TOKEN", o ?? e);
2421
2341
  } catch {
2422
2342
  this.cookies.clearAllAuthTokens(), this.isLoggedIn = !1;
2423
2343
  }
@@ -2426,127 +2346,91 @@ let m = class extends H {
2426
2346
  return this.cookies.getCookie("USER_EMAIL") || null;
2427
2347
  }
2428
2348
  };
2429
- m.styles = de();
2430
- y([
2431
- S({ type: Boolean, reflect: !0 })
2432
- ], m.prototype, "open", 2);
2433
- y([
2349
+ y.styles = ue();
2350
+ $([
2434
2351
  S({ type: String, attribute: "initial-mode" })
2435
- ], m.prototype, "initialMode", 2);
2436
- y([
2352
+ ], y.prototype, "initialMode", 2);
2353
+ $([
2437
2354
  S({ type: String, attribute: "logo-url" })
2438
- ], m.prototype, "logoUrl", 2);
2439
- y([
2355
+ ], y.prototype, "logoUrl", 2);
2356
+ $([
2440
2357
  S({ type: String, attribute: "api-domain" })
2441
- ], m.prototype, "baseUrl", 2);
2442
- y([
2358
+ ], y.prototype, "baseUrl", 2);
2359
+ $([
2443
2360
  S({ type: String, attribute: "oauth-domain" })
2444
- ], m.prototype, "oauthDomain", 2);
2445
- y([
2361
+ ], y.prototype, "oauthDomain", 2);
2362
+ $([
2446
2363
  S({ type: String, attribute: "oauth-region" })
2447
- ], m.prototype, "oauthRegion", 2);
2448
- y([
2364
+ ], y.prototype, "oauthRegion", 2);
2365
+ $([
2449
2366
  S({ type: String, attribute: "oauth-user-pool-id" })
2450
- ], m.prototype, "oauthUserPoolId", 2);
2451
- y([
2367
+ ], y.prototype, "oauthUserPoolId", 2);
2368
+ $([
2452
2369
  S({ type: String, attribute: "oauth-client-id" })
2453
- ], m.prototype, "oauthClientId", 2);
2454
- y([
2370
+ ], y.prototype, "oauthClientId", 2);
2371
+ $([
2455
2372
  S({ type: String, attribute: "oauth-redirect-uri" })
2456
- ], m.prototype, "oauthRedirectUri", 2);
2457
- y([
2373
+ ], y.prototype, "oauthRedirectUri", 2);
2374
+ $([
2458
2375
  S({ type: String, attribute: "oauth-spa-domain" })
2459
- ], m.prototype, "oauthSpaDomain", 2);
2460
- y([
2461
- S({ type: String, attribute: "size" })
2462
- ], m.prototype, "size", 2);
2463
- y([
2464
- S({ type: String, attribute: "data-theme", reflect: !0 })
2465
- ], m.prototype, "theme", 2);
2466
- y([
2376
+ ], y.prototype, "oauthSpaDomain", 2);
2377
+ $([
2467
2378
  S({ type: Boolean, attribute: "disable-signup" })
2468
- ], m.prototype, "disableSignup", 2);
2469
- y([
2470
- b()
2471
- ], m.prototype, "mode", 2);
2472
- y([
2473
- b()
2474
- ], m.prototype, "resetStep", 2);
2475
- y([
2476
- b()
2477
- ], m.prototype, "signupStep", 2);
2478
- y([
2479
- b()
2480
- ], m.prototype, "isLoading", 2);
2481
- y([
2482
- b()
2483
- ], m.prototype, "isClosing", 2);
2484
- y([
2485
- b()
2486
- ], m.prototype, "isVisible", 2);
2487
- y([
2488
- b()
2489
- ], m.prototype, "isLoggedIn", 2);
2490
- y([
2491
- b()
2492
- ], m.prototype, "email", 2);
2493
- y([
2494
- b()
2495
- ], m.prototype, "password", 2);
2496
- y([
2497
- b()
2498
- ], m.prototype, "givenName", 2);
2499
- y([
2500
- b()
2501
- ], m.prototype, "familyName", 2);
2502
- y([
2503
- b()
2504
- ], m.prototype, "newPassword", 2);
2505
- y([
2506
- b()
2507
- ], m.prototype, "confirmPassword", 2);
2508
- y([
2509
- b()
2510
- ], m.prototype, "notice", 2);
2511
- y([
2512
- b()
2513
- ], m.prototype, "error", 2);
2514
- y([
2515
- b()
2516
- ], m.prototype, "errors", 2);
2517
- y([
2518
- b()
2519
- ], m.prototype, "otpDigits", 2);
2520
- y([
2521
- b()
2522
- ], m.prototype, "signupOtpDigits", 2);
2523
- y([
2524
- b()
2525
- ], m.prototype, "isDragging", 2);
2526
- y([
2527
- b()
2528
- ], m.prototype, "dragStartY", 2);
2529
- y([
2530
- b()
2531
- ], m.prototype, "dragCurrentY", 2);
2532
- y([
2533
- b()
2534
- ], m.prototype, "dragStartTime", 2);
2535
- y([
2536
- b()
2537
- ], m.prototype, "lastDragEndTime", 2);
2538
- y([
2539
- it(".modal-container")
2540
- ], m.prototype, "modalContainer", 2);
2541
- y([
2542
- it("#email-input")
2543
- ], m.prototype, "emailInput", 2);
2544
- y([
2545
- it(".modal-body")
2546
- ], m.prototype, "modalBody", 2);
2547
- m = y([
2548
- Zt("auth-drawer")
2549
- ], m);
2379
+ ], y.prototype, "disableSignup", 2);
2380
+ $([
2381
+ v()
2382
+ ], y.prototype, "mode", 2);
2383
+ $([
2384
+ v()
2385
+ ], y.prototype, "resetStep", 2);
2386
+ $([
2387
+ v()
2388
+ ], y.prototype, "signupStep", 2);
2389
+ $([
2390
+ v()
2391
+ ], y.prototype, "isLoading", 2);
2392
+ $([
2393
+ v()
2394
+ ], y.prototype, "isLoggedIn", 2);
2395
+ $([
2396
+ v()
2397
+ ], y.prototype, "email", 2);
2398
+ $([
2399
+ v()
2400
+ ], y.prototype, "password", 2);
2401
+ $([
2402
+ v()
2403
+ ], y.prototype, "givenName", 2);
2404
+ $([
2405
+ v()
2406
+ ], y.prototype, "familyName", 2);
2407
+ $([
2408
+ v()
2409
+ ], y.prototype, "newPassword", 2);
2410
+ $([
2411
+ v()
2412
+ ], y.prototype, "confirmPassword", 2);
2413
+ $([
2414
+ v()
2415
+ ], y.prototype, "notice", 2);
2416
+ $([
2417
+ v()
2418
+ ], y.prototype, "error", 2);
2419
+ $([
2420
+ v()
2421
+ ], y.prototype, "errors", 2);
2422
+ $([
2423
+ v()
2424
+ ], y.prototype, "otpDigits", 2);
2425
+ $([
2426
+ v()
2427
+ ], y.prototype, "signupOtpDigits", 2);
2428
+ $([
2429
+ Qt("#email-input")
2430
+ ], y.prototype, "emailInput", 2);
2431
+ y = $([
2432
+ Gt("auth-form")
2433
+ ], y);
2550
2434
  export {
2551
- m as Auth
2435
+ y as AuthForm
2552
2436
  };