@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.
- package/README.md +3 -0
- package/dist/components/{auth.js → auth-form.js} +689 -805
- package/dist/components/base-button.js +894 -0
- package/dist/components/base-card.js +879 -0
- package/dist/components/base-date-picker.js +1458 -0
- package/dist/components/base-datetime-picker.js +1697 -0
- package/dist/components/base-drawer.js +1300 -0
- package/dist/components/base-input.js +883 -0
- package/dist/components/base-select.js +1076 -0
- package/dist/components/base-tab.js +653 -0
- package/dist/components/base-tabs.js +1246 -0
- package/dist/components/base-textarea.js +921 -0
- package/dist/components/base-time-picker.js +1141 -0
- package/dist/components/favicon.ico +0 -0
- package/dist/components/index.d.ts +399 -33
- package/dist/components/quantity-select.js +859 -0
- package/dist/components/theme-toggle.js +185 -165
- package/dist/favicon.ico +0 -0
- package/dist/index.d.ts +399 -33
- package/dist/index.js +7365 -2352
- package/dist/stylesheets/main.css +1 -1
- package/package.json +2 -1
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
const
|
|
2
|
-
let
|
|
3
|
-
constructor(t, s,
|
|
4
|
-
if (this._$cssResult$ = !0,
|
|
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
|
|
12
|
-
|
|
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
|
|
21
|
-
const s = e.length === 1 ? e[0] : t.reduce(((
|
|
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
|
-
})(
|
|
26
|
-
return new
|
|
27
|
-
},
|
|
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
|
|
31
|
-
|
|
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
|
|
36
|
-
return
|
|
35
|
+
for (const r of t.cssRules) s += r.cssText;
|
|
36
|
+
return St(s);
|
|
37
37
|
})(e) : e;
|
|
38
|
-
const { is:
|
|
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 ?
|
|
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) => !
|
|
67
|
-
Symbol.metadata ??= Symbol("metadata"),
|
|
68
|
-
let
|
|
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
|
|
78
|
-
|
|
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,
|
|
82
|
-
const { 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:
|
|
88
|
-
const
|
|
89
|
-
o?.call(this, a), this.requestUpdate(t,
|
|
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 =
|
|
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,
|
|
104
|
-
for (const
|
|
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 [
|
|
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,
|
|
113
|
-
const
|
|
114
|
-
|
|
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
|
|
122
|
-
for (const
|
|
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
|
|
128
|
-
return
|
|
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
|
|
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
|
|
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,
|
|
160
|
-
this._$AK(t,
|
|
159
|
+
attributeChangedCallback(t, s, r) {
|
|
160
|
+
this._$AK(t, r);
|
|
161
161
|
}
|
|
162
162
|
_$ET(t, s) {
|
|
163
|
-
const
|
|
164
|
-
if (
|
|
165
|
-
const o = (
|
|
166
|
-
this._$Em = t, o == null ? this.removeAttribute(
|
|
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
|
|
171
|
-
if (
|
|
172
|
-
const o =
|
|
173
|
-
this._$Em =
|
|
174
|
-
const
|
|
175
|
-
this[
|
|
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,
|
|
178
|
+
requestUpdate(t, s, r) {
|
|
179
179
|
if (t !== void 0) {
|
|
180
|
-
const
|
|
181
|
-
if (
|
|
182
|
-
this.C(t, s,
|
|
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:
|
|
187
|
-
|
|
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 [
|
|
206
|
+
for (const [i, o] of this._$Ep) this[i] = o;
|
|
207
207
|
this._$Ep = void 0;
|
|
208
208
|
}
|
|
209
|
-
const
|
|
210
|
-
if (
|
|
211
|
-
const { wrapped: a } = o,
|
|
212
|
-
a !== !0 || this._$AL.has(
|
|
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(((
|
|
219
|
-
} catch (
|
|
220
|
-
throw t = !1, this._$EM(),
|
|
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
|
-
|
|
250
|
-
const tt = globalThis,
|
|
251
|
-
\f\r]`, N = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, ct = /-->/g, dt = />/g,
|
|
252
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"), pt = /'/g, ut = /"/g,
|
|
253
|
-
function
|
|
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
|
|
258
|
-
const s = e.length - 1,
|
|
259
|
-
let
|
|
260
|
-
for (let
|
|
261
|
-
const n = e[
|
|
262
|
-
let h,
|
|
263
|
-
for (;
|
|
264
|
-
const u = a ===
|
|
265
|
-
o += a === N ? n +
|
|
266
|
-
}
|
|
267
|
-
return [
|
|
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
|
|
270
|
-
constructor({ strings: t, _$litType$: s },
|
|
271
|
-
let
|
|
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
|
|
275
|
-
if (this.el =
|
|
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 (; (
|
|
280
|
-
if (
|
|
281
|
-
if (
|
|
282
|
-
const
|
|
283
|
-
n.push({ type: 1, index: o, name:
|
|
284
|
-
} else l.startsWith(
|
|
285
|
-
if (
|
|
286
|
-
const l =
|
|
287
|
-
if (
|
|
288
|
-
|
|
289
|
-
for (let u = 0; u <
|
|
290
|
-
|
|
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 (
|
|
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 =
|
|
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
|
|
303
|
-
return
|
|
302
|
+
const r = O.createElement("template");
|
|
303
|
+
return r.innerHTML = t, r;
|
|
304
304
|
}
|
|
305
305
|
}
|
|
306
|
-
function
|
|
307
|
-
if (t ===
|
|
308
|
-
let
|
|
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
|
|
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
|
|
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:
|
|
324
|
-
|
|
325
|
-
let o =
|
|
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
|
|
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 =
|
|
331
|
+
a !== n?.index && (o = P.nextNode(), a++);
|
|
332
332
|
}
|
|
333
|
-
return
|
|
333
|
+
return P.currentNode = O, i;
|
|
334
334
|
}
|
|
335
335
|
p(t) {
|
|
336
336
|
let s = 0;
|
|
337
|
-
for (const
|
|
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,
|
|
345
|
-
this.type = 2, this._$AH = g, this._$AN = void 0, this._$AA = t, this._$AB = s, this._$AM =
|
|
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 =
|
|
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(
|
|
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$:
|
|
372
|
-
if (this._$AH?._$AD ===
|
|
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
|
|
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
|
|
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
|
|
386
|
-
for (const o of t)
|
|
387
|
-
|
|
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
|
|
392
|
-
t.remove(), t =
|
|
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,
|
|
407
|
-
this.type = 1, this._$AH = g, this._$AN = void 0, this.element = t, this.name = s, this._$AM =
|
|
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,
|
|
409
|
+
_$AI(t, s = this, r, i) {
|
|
410
410
|
const o = this.strings;
|
|
411
411
|
let a = !1;
|
|
412
|
-
if (o === void 0) 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
|
|
414
|
+
const p = t;
|
|
415
415
|
let n, h;
|
|
416
|
-
for (t = o[0], n = 0; n < o.length - 1; 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 && !
|
|
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
|
|
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
|
|
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
|
|
441
|
-
constructor(t, s,
|
|
442
|
-
super(t, s,
|
|
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 =
|
|
446
|
-
const
|
|
447
|
-
|
|
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
|
|
454
|
-
constructor(t, s,
|
|
455
|
-
this.element = t, this.type = 6, this._$AN = void 0, this._$AM = s, this.options =
|
|
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
|
-
|
|
461
|
+
D(this, t);
|
|
462
462
|
}
|
|
463
463
|
}
|
|
464
|
-
const
|
|
465
|
-
|
|
466
|
-
const
|
|
467
|
-
const
|
|
468
|
-
let
|
|
469
|
-
if (
|
|
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
|
-
|
|
471
|
+
r._$litPart$ = i = new I(t.insertBefore(j(), o), o, void 0, s ?? {});
|
|
472
472
|
}
|
|
473
|
-
return
|
|
473
|
+
return i._$AI(e), i;
|
|
474
474
|
};
|
|
475
475
|
const st = globalThis;
|
|
476
|
-
let H = class extends
|
|
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 =
|
|
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
|
|
495
|
+
return U;
|
|
496
496
|
}
|
|
497
497
|
};
|
|
498
498
|
H._$litElement$ = !0, H.finalized = !0, st.litElementHydrateSupport?.({ LitElement: H });
|
|
499
|
-
const
|
|
500
|
-
|
|
499
|
+
const Vt = st.litElementPolyfillSupport;
|
|
500
|
+
Vt?.({ LitElement: H });
|
|
501
501
|
(st.litElementVersions ??= []).push("4.2.1");
|
|
502
|
-
const
|
|
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
|
|
508
|
-
const { kind:
|
|
509
|
-
let o = globalThis.litPropertyMetadata.get(
|
|
510
|
-
if (o === void 0 && globalThis.litPropertyMetadata.set(
|
|
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(
|
|
512
|
+
return { set(p) {
|
|
513
513
|
const n = t.get.call(this);
|
|
514
|
-
t.set.call(this,
|
|
515
|
-
}, init(
|
|
516
|
-
return
|
|
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 (
|
|
519
|
+
if (r === "setter") {
|
|
520
520
|
const { name: a } = s;
|
|
521
|
-
return function(
|
|
521
|
+
return function(p) {
|
|
522
522
|
const n = this[a];
|
|
523
|
-
t.call(this,
|
|
523
|
+
t.call(this, p), this.requestUpdate(a, n, e);
|
|
524
524
|
};
|
|
525
525
|
}
|
|
526
|
-
throw Error("Unsupported decorator location: " +
|
|
526
|
+
throw Error("Unsupported decorator location: " + r);
|
|
527
527
|
};
|
|
528
528
|
function S(e) {
|
|
529
|
-
return (t, s) => typeof s == "object" ?
|
|
530
|
-
const a =
|
|
531
|
-
return
|
|
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
|
|
534
|
+
function v(e) {
|
|
535
535
|
return S({ ...e, state: !0, attribute: !1 });
|
|
536
536
|
}
|
|
537
|
-
const
|
|
538
|
-
function
|
|
539
|
-
return (s,
|
|
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
|
|
541
|
+
return Zt(s, r, { get() {
|
|
542
542
|
return o(this);
|
|
543
543
|
} });
|
|
544
544
|
};
|
|
545
545
|
}
|
|
546
|
-
const
|
|
547
|
-
class
|
|
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,
|
|
554
|
-
this._$Ct = t, this._$AM = s, this._$Ci =
|
|
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 =
|
|
564
|
-
|
|
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 =
|
|
589
|
-
s = new
|
|
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,
|
|
592
|
-
if (
|
|
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 !==
|
|
574
|
+
if (o !== i || p) {
|
|
597
575
|
let n = s._$AA;
|
|
598
576
|
for (; n !== o; ) {
|
|
599
577
|
const h = n.nextSibling;
|
|
600
|
-
|
|
578
|
+
r.insertBefore(n, i), n = h;
|
|
601
579
|
}
|
|
602
580
|
}
|
|
603
581
|
}
|
|
604
582
|
return s;
|
|
605
|
-
},
|
|
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
|
|
609
|
-
const
|
|
610
|
-
for (let
|
|
611
|
-
return
|
|
612
|
-
},
|
|
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 !==
|
|
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
|
|
618
|
-
s === void 0 ? s = t : t !== void 0 && (
|
|
619
|
-
const
|
|
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
|
|
622
|
-
return { values: o, keys:
|
|
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,
|
|
628
|
-
const
|
|
629
|
-
if (!Array.isArray(
|
|
630
|
-
const
|
|
631
|
-
let h,
|
|
632
|
-
for (; l <=
|
|
633
|
-
else if (
|
|
634
|
-
else if (
|
|
635
|
-
else if (
|
|
636
|
-
else if (
|
|
637
|
-
else if (
|
|
638
|
-
else if (h === void 0 && (h =
|
|
639
|
-
const
|
|
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
|
|
642
|
-
|
|
643
|
-
} else n[u] =
|
|
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
|
|
646
|
-
else
|
|
647
|
-
for (; u <=
|
|
648
|
-
const
|
|
649
|
-
|
|
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 <=
|
|
652
|
-
const
|
|
653
|
-
|
|
629
|
+
for (; l <= d; ) {
|
|
630
|
+
const w = i[l++];
|
|
631
|
+
w !== null && J(w);
|
|
654
632
|
}
|
|
655
|
-
return this.ut = a,
|
|
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
|
-
}
|
|
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:
|
|
688
|
+
password: c,
|
|
673
689
|
accessToken: l,
|
|
674
|
-
refreshToken:
|
|
690
|
+
refreshToken: d,
|
|
675
691
|
idToken: u
|
|
676
692
|
}) => {
|
|
677
|
-
const
|
|
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:
|
|
700
|
+
password: c,
|
|
685
701
|
accessToken: l,
|
|
686
|
-
refreshToken:
|
|
702
|
+
refreshToken: d,
|
|
687
703
|
idToken: u
|
|
688
704
|
})
|
|
689
705
|
});
|
|
690
|
-
if (
|
|
691
|
-
const
|
|
692
|
-
throw new Error(
|
|
706
|
+
if (!f.ok) {
|
|
707
|
+
const w = await f.json();
|
|
708
|
+
throw new Error(w.message || w.error || "Login failed");
|
|
693
709
|
}
|
|
694
|
-
return
|
|
710
|
+
return f.json();
|
|
695
711
|
},
|
|
696
712
|
logout: async ({
|
|
697
713
|
accessToken: h,
|
|
698
|
-
refreshToken:
|
|
714
|
+
refreshToken: c,
|
|
699
715
|
authToken: l
|
|
700
716
|
}) => {
|
|
701
|
-
const
|
|
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:
|
|
725
|
+
refreshToken: c
|
|
710
726
|
})
|
|
711
727
|
});
|
|
712
|
-
if (!
|
|
713
|
-
const u = await
|
|
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
|
|
732
|
+
return d.json();
|
|
717
733
|
},
|
|
718
734
|
refresh: async ({ refreshToken: h }) => {
|
|
719
|
-
const
|
|
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 (!
|
|
729
|
-
const l = await
|
|
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
|
|
748
|
+
return c.json();
|
|
733
749
|
},
|
|
734
750
|
requestRegisterOtp: async ({ email: h }) => {
|
|
735
|
-
const
|
|
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 (!
|
|
745
|
-
const l = await
|
|
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
|
|
764
|
+
return c.json();
|
|
749
765
|
},
|
|
750
766
|
register: async ({
|
|
751
767
|
email: h,
|
|
752
|
-
password:
|
|
768
|
+
password: c,
|
|
753
769
|
phone_number: l,
|
|
754
|
-
family_name:
|
|
770
|
+
family_name: d,
|
|
755
771
|
given_name: u,
|
|
756
|
-
code:
|
|
772
|
+
code: f
|
|
757
773
|
}) => {
|
|
758
|
-
const
|
|
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:
|
|
781
|
+
password: c,
|
|
766
782
|
phone_number: l,
|
|
767
|
-
family_name:
|
|
783
|
+
family_name: d,
|
|
768
784
|
given_name: u,
|
|
769
|
-
code:
|
|
785
|
+
code: f
|
|
770
786
|
})
|
|
771
787
|
});
|
|
772
|
-
if (!
|
|
773
|
-
const A = await
|
|
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
|
|
792
|
+
return w.json();
|
|
777
793
|
},
|
|
778
794
|
requestResetPassword: async ({ email: h }) => {
|
|
779
|
-
const
|
|
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 (!
|
|
789
|
-
const l = await
|
|
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
|
|
808
|
+
return c.json();
|
|
793
809
|
},
|
|
794
810
|
resetPassword: async ({
|
|
795
811
|
email: h,
|
|
796
|
-
otp:
|
|
812
|
+
otp: c,
|
|
797
813
|
newPassword: l
|
|
798
814
|
}) => {
|
|
799
|
-
const
|
|
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:
|
|
822
|
+
otp: c,
|
|
807
823
|
newPassword: l
|
|
808
824
|
})
|
|
809
825
|
});
|
|
810
|
-
if (!
|
|
811
|
-
const u = await
|
|
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
|
|
830
|
+
return d.json();
|
|
815
831
|
}
|
|
816
832
|
};
|
|
817
|
-
},
|
|
833
|
+
}, Y = {
|
|
818
834
|
AUTH_TOKEN: "authToken",
|
|
819
835
|
ACCESS_TOKEN: "accessToken",
|
|
820
836
|
REFRESH_TOKEN: "refreshToken"
|
|
821
|
-
},
|
|
837
|
+
}, le = {
|
|
822
838
|
maxAge: 3600 * 24 * 7,
|
|
823
839
|
// 7 days
|
|
824
840
|
secure: !0,
|
|
825
841
|
sameSite: "lax",
|
|
826
842
|
path: "/"
|
|
827
|
-
},
|
|
828
|
-
const e = (n, h,
|
|
843
|
+
}, he = () => {
|
|
844
|
+
const e = (n, h, c = {}) => {
|
|
829
845
|
const {
|
|
830
846
|
maxAge: l,
|
|
831
|
-
path:
|
|
847
|
+
path: d = "/",
|
|
832
848
|
secure: u = window.location.protocol === "https:",
|
|
833
|
-
sameSite:
|
|
834
|
-
domain:
|
|
835
|
-
} =
|
|
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=${
|
|
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) + "=",
|
|
840
|
-
for (let l = 0; l <
|
|
841
|
-
let
|
|
842
|
-
for (;
|
|
843
|
-
|
|
844
|
-
if (
|
|
845
|
-
return decodeURIComponent(
|
|
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
|
-
},
|
|
854
|
-
e(
|
|
855
|
-
}, o = (n) => t(
|
|
856
|
-
s(
|
|
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:
|
|
863
|
-
setAuthToken:
|
|
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
|
-
},
|
|
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
|
|
874
|
-
},
|
|
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:
|
|
879
|
-
redirectUri:
|
|
894
|
+
clientId: r,
|
|
895
|
+
redirectUri: i
|
|
880
896
|
}) => {
|
|
881
897
|
const o = {
|
|
882
898
|
domain: e,
|
|
883
|
-
clientId:
|
|
884
|
-
redirectUri:
|
|
885
|
-
}, a = (
|
|
886
|
-
const _ = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~", k = new Uint8Array(
|
|
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
|
-
},
|
|
889
|
-
const k = new TextEncoder().encode(
|
|
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
|
|
893
|
-
return sessionStorage.setItem("pkce_code_verifier",
|
|
908
|
+
const b = a(128), _ = await p(b);
|
|
909
|
+
return sessionStorage.setItem("pkce_code_verifier", b), { codeVerifier: b, codeChallenge: _ };
|
|
894
910
|
}, h = () => {
|
|
895
|
-
const
|
|
896
|
-
return sessionStorage.setItem("oauth_state",
|
|
897
|
-
},
|
|
898
|
-
const { codeChallenge:
|
|
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:
|
|
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
|
|
912
|
-
window.location.href =
|
|
913
|
-
},
|
|
914
|
-
const { codeChallenge:
|
|
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:
|
|
938
|
+
code_challenge: b
|
|
923
939
|
});
|
|
924
940
|
return `${o.domain}/oauth2/authorize?${k.toString()}`;
|
|
925
941
|
}, u = async () => {
|
|
926
|
-
const
|
|
927
|
-
window.location.href =
|
|
928
|
-
},
|
|
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"), _ ===
|
|
931
|
-
},
|
|
932
|
-
const
|
|
933
|
-
return sessionStorage.removeItem("pkce_code_verifier"),
|
|
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:
|
|
940
|
-
exchangeCodeForTokens: async (
|
|
941
|
-
const _ =
|
|
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:
|
|
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
|
-
},
|
|
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
|
|
1465
|
-
for (var
|
|
1466
|
-
(a = e[o]) && (
|
|
1467
|
-
return
|
|
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
|
|
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
|
|
1496
|
+
let y = class extends it {
|
|
1481
1497
|
constructor() {
|
|
1482
|
-
super(...arguments), this.
|
|
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.
|
|
1527
|
-
return 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 =
|
|
1512
|
+
return this.apiService || (this.apiService = ne({
|
|
1533
1513
|
baseUrl: this.getNormalizedBaseUrl()
|
|
1534
1514
|
})), this.apiService;
|
|
1535
1515
|
}
|
|
1536
1516
|
connectedCallback() {
|
|
1537
|
-
super.connectedCallback()
|
|
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
|
-
|
|
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)
|
|
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
|
-
|
|
1559
|
-
|
|
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.
|
|
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),
|
|
1591
|
-
(!t || !s || !
|
|
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),
|
|
1607
|
-
(!s || !
|
|
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,
|
|
1666
|
-
this.cookies.setAuthToken("ACCESS_TOKEN", e), this.cookies.setAuthToken("AUTH_TOKEN", t), this.cookies.setAuthToken("REFRESH_TOKEN", s), this.cookies.setCookie("USER_EMAIL",
|
|
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:
|
|
1678
|
-
this.setAuthTokens(t, s,
|
|
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 =
|
|
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
|
|
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(),
|
|
1707
|
-
window.history.replaceState({}, document.title,
|
|
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"),
|
|
1712
|
-
if ((t || s ||
|
|
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.
|
|
1683
|
+
this.hasHandledOAuthCallback = !0, this.isLoading = !0, this.error = "";
|
|
1718
1684
|
try {
|
|
1719
1685
|
if (a)
|
|
1720
|
-
throw new Error(
|
|
1721
|
-
if (t && s &&
|
|
1722
|
-
const { accessToken: h, idToken:
|
|
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:
|
|
1690
|
+
refreshToken: r,
|
|
1725
1691
|
idToken: s
|
|
1726
1692
|
});
|
|
1727
|
-
this.setAuthTokens(h,
|
|
1728
|
-
} else if (
|
|
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
|
|
1737
|
-
accessToken:
|
|
1738
|
-
refreshToken:
|
|
1739
|
-
idToken:
|
|
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,
|
|
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
|
|
1805
|
-
redirectUrl:
|
|
1770
|
+
const r = this.getApiService(), {
|
|
1771
|
+
redirectUrl: i,
|
|
1806
1772
|
requiresRedirect: o
|
|
1807
|
-
} = await
|
|
1773
|
+
} = await r.logout({
|
|
1808
1774
|
accessToken: e,
|
|
1809
1775
|
refreshToken: s,
|
|
1810
1776
|
authToken: t
|
|
1811
1777
|
});
|
|
1812
|
-
if (o &&
|
|
1778
|
+
if (o && i) {
|
|
1813
1779
|
const a = window.location.host;
|
|
1814
|
-
new URL(
|
|
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}`,
|
|
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
|
|
1839
|
-
if (!
|
|
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 =
|
|
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
|
-
|
|
1816
|
+
r.blur();
|
|
1851
1817
|
}
|
|
1852
1818
|
handleOtpKeydown(e, t, s) {
|
|
1853
|
-
const
|
|
1819
|
+
const r = s ? this.signupOtpDigits : this.otpDigits;
|
|
1854
1820
|
if (t.key === "Backspace") {
|
|
1855
|
-
if (
|
|
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
|
|
1826
|
+
const i = this.shadowRoot?.querySelector(
|
|
1861
1827
|
`${s ? ".signup-otp-input" : ".reset-otp-input"}[data-index="${e - 1}"]`
|
|
1862
1828
|
);
|
|
1863
|
-
|
|
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
|
|
1833
|
+
const i = this.shadowRoot?.querySelector(
|
|
1868
1834
|
`${s ? ".signup-otp-input" : ".reset-otp-input"}[data-index="${e - 1}"]`
|
|
1869
1835
|
);
|
|
1870
|
-
|
|
1836
|
+
i?.focus(), i?.select(), t.preventDefault();
|
|
1871
1837
|
}
|
|
1872
1838
|
if (t.key === "ArrowRight" && e < 5) {
|
|
1873
|
-
const
|
|
1839
|
+
const i = this.shadowRoot?.querySelector(
|
|
1874
1840
|
`${s ? ".signup-otp-input" : ".reset-otp-input"}[data-index="${e + 1}"]`
|
|
1875
1841
|
);
|
|
1876
|
-
|
|
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
|
|
1882
|
-
if (
|
|
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] =
|
|
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
|
|
1888
|
-
if (
|
|
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="${
|
|
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
|
|
1953
|
-
${this.logoUrl.length > 0 ?
|
|
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 ?
|
|
1977
|
-
${this.logoUrl.length > 0 ?
|
|
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
|
|
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 ?
|
|
1923
|
+
` : this.isLoggedIn ? m`
|
|
2002
1924
|
<!-- Header -->
|
|
2003
|
-
${this.logoUrl.length > 0 ?
|
|
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
|
|
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
|
-
` :
|
|
1955
|
+
` : m`
|
|
2027
1956
|
<!-- Header -->
|
|
2028
|
-
${(!this.mode || this.resetStep === "none") && this.logoUrl.length > 0 && this.mode === "signin" ?
|
|
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
|
|
1991
|
+
return m`
|
|
2063
1992
|
<!-- Email -->
|
|
2064
|
-
<
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
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
|
-
<
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
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" ?
|
|
2025
|
+
${this.mode === "signup" ? m`
|
|
2103
2026
|
<!-- Confirm Password -->
|
|
2104
|
-
<
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
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
|
-
<
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
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
|
-
<
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
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
|
|
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
|
-
${
|
|
2068
|
+
${yt(
|
|
2155
2069
|
Array.from({ length: 6 }, (e, t) => t),
|
|
2156
2070
|
(e) => e,
|
|
2157
|
-
(e) =>
|
|
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 ?
|
|
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
|
|
2184
|
-
<
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
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
|
|
2207
|
-
<
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
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
|
-
${
|
|
2132
|
+
${yt(
|
|
2225
2133
|
Array.from({ length: 6 }, (t, s) => s),
|
|
2226
2134
|
(t) => t,
|
|
2227
|
-
(t) =>
|
|
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 ?
|
|
2152
|
+
${this.errors.otp ? m`<p class="otp-error">${this.errors.otp}</p>` : g}
|
|
2245
2153
|
</div>
|
|
2246
2154
|
|
|
2247
|
-
${e ?
|
|
2155
|
+
${e ? m`
|
|
2248
2156
|
<div class="new-password-fields">
|
|
2249
|
-
<
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
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
|
|
2291
|
-
<button
|
|
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)) ?
|
|
2297
|
-
<button
|
|
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
|
|
2304
|
-
<button
|
|
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
|
|
2310
|
-
<button
|
|
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" ?
|
|
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
|
|
2339
|
-
${this.notice ?
|
|
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 ?
|
|
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 :
|
|
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
|
-
` :
|
|
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
|
|
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
|
|
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:
|
|
2337
|
+
const { accessToken: r, idToken: i, refreshToken: o } = await this.getApiService().refresh({
|
|
2418
2338
|
refreshToken: e
|
|
2419
2339
|
});
|
|
2420
|
-
this.cookies.setAuthToken("ACCESS_TOKEN",
|
|
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
|
-
|
|
2430
|
-
|
|
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
|
-
],
|
|
2436
|
-
|
|
2352
|
+
], y.prototype, "initialMode", 2);
|
|
2353
|
+
$([
|
|
2437
2354
|
S({ type: String, attribute: "logo-url" })
|
|
2438
|
-
],
|
|
2439
|
-
|
|
2355
|
+
], y.prototype, "logoUrl", 2);
|
|
2356
|
+
$([
|
|
2440
2357
|
S({ type: String, attribute: "api-domain" })
|
|
2441
|
-
],
|
|
2442
|
-
|
|
2358
|
+
], y.prototype, "baseUrl", 2);
|
|
2359
|
+
$([
|
|
2443
2360
|
S({ type: String, attribute: "oauth-domain" })
|
|
2444
|
-
],
|
|
2445
|
-
|
|
2361
|
+
], y.prototype, "oauthDomain", 2);
|
|
2362
|
+
$([
|
|
2446
2363
|
S({ type: String, attribute: "oauth-region" })
|
|
2447
|
-
],
|
|
2448
|
-
|
|
2364
|
+
], y.prototype, "oauthRegion", 2);
|
|
2365
|
+
$([
|
|
2449
2366
|
S({ type: String, attribute: "oauth-user-pool-id" })
|
|
2450
|
-
],
|
|
2451
|
-
|
|
2367
|
+
], y.prototype, "oauthUserPoolId", 2);
|
|
2368
|
+
$([
|
|
2452
2369
|
S({ type: String, attribute: "oauth-client-id" })
|
|
2453
|
-
],
|
|
2454
|
-
|
|
2370
|
+
], y.prototype, "oauthClientId", 2);
|
|
2371
|
+
$([
|
|
2455
2372
|
S({ type: String, attribute: "oauth-redirect-uri" })
|
|
2456
|
-
],
|
|
2457
|
-
|
|
2373
|
+
], y.prototype, "oauthRedirectUri", 2);
|
|
2374
|
+
$([
|
|
2458
2375
|
S({ type: String, attribute: "oauth-spa-domain" })
|
|
2459
|
-
],
|
|
2460
|
-
|
|
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
|
-
],
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
],
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
],
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
],
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
],
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
],
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
],
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
],
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
],
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
],
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
],
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
],
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
],
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
],
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
],
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
],
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
],
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
],
|
|
2520
|
-
y([
|
|
2521
|
-
|
|
2522
|
-
],
|
|
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
|
-
|
|
2435
|
+
y as AuthForm
|
|
2552
2436
|
};
|