@cal.macconnachie/web-components 0.0.4 → 0.0.7
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/dist/index.js +384 -342
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
s !== void 0 ? s.addInitializer((() => {
|
|
4
|
-
customElements.define(e, t);
|
|
5
|
-
})) : customElements.define(e, t);
|
|
6
|
-
};
|
|
7
|
-
const z = globalThis, Z = z.ShadowRoot && (z.ShadyCSS === void 0 || z.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, yt = Symbol(), it = /* @__PURE__ */ new WeakMap();
|
|
8
|
-
let Et = class {
|
|
1
|
+
const z = globalThis, Z = z.ShadowRoot && (z.ShadyCSS === void 0 || z.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, Q = Symbol(), ot = /* @__PURE__ */ new WeakMap();
|
|
2
|
+
let wt = class {
|
|
9
3
|
constructor(t, s, i) {
|
|
10
|
-
if (this._$cssResult$ = !0, i !==
|
|
4
|
+
if (this._$cssResult$ = !0, i !== Q) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
11
5
|
this.cssText = t, this.t = s;
|
|
12
6
|
}
|
|
13
7
|
get styleSheet() {
|
|
@@ -15,7 +9,7 @@ let Et = class {
|
|
|
15
9
|
const s = this.t;
|
|
16
10
|
if (Z && t === void 0) {
|
|
17
11
|
const i = s !== void 0 && s.length === 1;
|
|
18
|
-
i && (t =
|
|
12
|
+
i && (t = ot.get(s)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), i && ot.set(s, t));
|
|
19
13
|
}
|
|
20
14
|
return t;
|
|
21
15
|
}
|
|
@@ -23,21 +17,28 @@ let Et = class {
|
|
|
23
17
|
return this.cssText;
|
|
24
18
|
}
|
|
25
19
|
};
|
|
26
|
-
const
|
|
20
|
+
const xt = (e) => new wt(typeof e == "string" ? e : e + "", void 0, Q), Et = (e, ...t) => {
|
|
21
|
+
const s = e.length === 1 ? e[0] : t.reduce(((i, r, o) => i + ((a) => {
|
|
22
|
+
if (a._$cssResult$ === !0) return a.cssText;
|
|
23
|
+
if (typeof a == "number") return a;
|
|
24
|
+
throw Error("Value passed to 'css' function must be a 'css' function result: " + a + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
|
|
25
|
+
})(r) + e[o + 1]), e[0]);
|
|
26
|
+
return new wt(s, e, Q);
|
|
27
|
+
}, Tt = (e, t) => {
|
|
27
28
|
if (Z) e.adoptedStyleSheets = t.map(((s) => s instanceof CSSStyleSheet ? s : s.styleSheet));
|
|
28
29
|
else for (const s of t) {
|
|
29
30
|
const i = document.createElement("style"), r = z.litNonce;
|
|
30
31
|
r !== void 0 && i.setAttribute("nonce", r), i.textContent = s.cssText, e.appendChild(i);
|
|
31
32
|
}
|
|
32
|
-
},
|
|
33
|
+
}, at = Z ? (e) => e : (e) => e instanceof CSSStyleSheet ? ((t) => {
|
|
33
34
|
let s = "";
|
|
34
35
|
for (const i of t.cssRules) s += i.cssText;
|
|
35
|
-
return
|
|
36
|
+
return xt(s);
|
|
36
37
|
})(e) : e;
|
|
37
|
-
const { is:
|
|
38
|
+
const { is: Pt, defineProperty: Ot, getOwnPropertyDescriptor: Dt, getOwnPropertyNames: Ut, getOwnPropertySymbols: Rt, getPrototypeOf: It } = Object, F = globalThis, nt = F.trustedTypes, Nt = nt ? nt.emptyScript : "", Lt = F.reactiveElementPolyfillSupport, M = (e, t) => e, Y = { toAttribute(e, t) {
|
|
38
39
|
switch (t) {
|
|
39
40
|
case Boolean:
|
|
40
|
-
e = e ?
|
|
41
|
+
e = e ? Nt : null;
|
|
41
42
|
break;
|
|
42
43
|
case Object:
|
|
43
44
|
case Array:
|
|
@@ -62,23 +63,23 @@ const { is: Ot, defineProperty: Dt, getOwnPropertyDescriptor: Ut, getOwnProperty
|
|
|
62
63
|
}
|
|
63
64
|
}
|
|
64
65
|
return s;
|
|
65
|
-
} },
|
|
66
|
+
} }, X = (e, t) => !Pt(e, t), lt = { attribute: !0, type: String, converter: Y, reflect: !1, useDefault: !1, hasChanged: X };
|
|
66
67
|
Symbol.metadata ??= Symbol("metadata"), F.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
|
|
67
|
-
class
|
|
68
|
+
let U = class extends HTMLElement {
|
|
68
69
|
static addInitializer(t) {
|
|
69
70
|
this._$Ei(), (this.l ??= []).push(t);
|
|
70
71
|
}
|
|
71
72
|
static get observedAttributes() {
|
|
72
73
|
return this.finalize(), this._$Eh && [...this._$Eh.keys()];
|
|
73
74
|
}
|
|
74
|
-
static createProperty(t, s =
|
|
75
|
+
static createProperty(t, s = lt) {
|
|
75
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) {
|
|
76
77
|
const i = Symbol(), r = this.getPropertyDescriptor(t, i, s);
|
|
77
|
-
r !== void 0 &&
|
|
78
|
+
r !== void 0 && Ot(this.prototype, t, r);
|
|
78
79
|
}
|
|
79
80
|
}
|
|
80
81
|
static getPropertyDescriptor(t, s, i) {
|
|
81
|
-
const { get: r, set: o } =
|
|
82
|
+
const { get: r, set: o } = Dt(this.prototype, t) ?? { get() {
|
|
82
83
|
return this[s];
|
|
83
84
|
}, set(a) {
|
|
84
85
|
this[s] = a;
|
|
@@ -89,17 +90,17 @@ class I extends HTMLElement {
|
|
|
89
90
|
}, configurable: !0, enumerable: !0 };
|
|
90
91
|
}
|
|
91
92
|
static getPropertyOptions(t) {
|
|
92
|
-
return this.elementProperties.get(t) ??
|
|
93
|
+
return this.elementProperties.get(t) ?? lt;
|
|
93
94
|
}
|
|
94
95
|
static _$Ei() {
|
|
95
96
|
if (this.hasOwnProperty(M("elementProperties"))) return;
|
|
96
|
-
const t =
|
|
97
|
+
const t = It(this);
|
|
97
98
|
t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
|
|
98
99
|
}
|
|
99
100
|
static finalize() {
|
|
100
101
|
if (this.hasOwnProperty(M("finalized"))) return;
|
|
101
102
|
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(M("properties"))) {
|
|
102
|
-
const s = this.properties, i = [...
|
|
103
|
+
const s = this.properties, i = [...Ut(s), ...Rt(s)];
|
|
103
104
|
for (const r of i) this.createProperty(r, s[r]);
|
|
104
105
|
}
|
|
105
106
|
const t = this[Symbol.metadata];
|
|
@@ -118,8 +119,8 @@ class I extends HTMLElement {
|
|
|
118
119
|
const s = [];
|
|
119
120
|
if (Array.isArray(t)) {
|
|
120
121
|
const i = new Set(t.flat(1 / 0).reverse());
|
|
121
|
-
for (const r of i) s.unshift(
|
|
122
|
-
} else t !== void 0 && s.push(
|
|
122
|
+
for (const r of i) s.unshift(at(r));
|
|
123
|
+
} else t !== void 0 && s.push(at(t));
|
|
123
124
|
return s;
|
|
124
125
|
}
|
|
125
126
|
static _$Eu(t, s) {
|
|
@@ -145,7 +146,7 @@ class I extends HTMLElement {
|
|
|
145
146
|
}
|
|
146
147
|
createRenderRoot() {
|
|
147
148
|
const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
|
|
148
|
-
return
|
|
149
|
+
return Tt(t, this.constructor.elementStyles), t;
|
|
149
150
|
}
|
|
150
151
|
connectedCallback() {
|
|
151
152
|
this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(!0), this._$EO?.forEach(((t) => t.hostConnected?.()));
|
|
@@ -161,14 +162,14 @@ class I extends HTMLElement {
|
|
|
161
162
|
_$ET(t, s) {
|
|
162
163
|
const i = this.constructor.elementProperties.get(t), r = this.constructor._$Eu(t, i);
|
|
163
164
|
if (r !== void 0 && i.reflect === !0) {
|
|
164
|
-
const o = (i.converter?.toAttribute !== void 0 ? i.converter :
|
|
165
|
+
const o = (i.converter?.toAttribute !== void 0 ? i.converter : Y).toAttribute(s, i.type);
|
|
165
166
|
this._$Em = t, o == null ? this.removeAttribute(r) : this.setAttribute(r, o), this._$Em = null;
|
|
166
167
|
}
|
|
167
168
|
}
|
|
168
169
|
_$AK(t, s) {
|
|
169
170
|
const i = this.constructor, r = i._$Eh.get(t);
|
|
170
171
|
if (r !== void 0 && this._$Em !== r) {
|
|
171
|
-
const o = i.getPropertyOptions(r), a = typeof o.converter == "function" ? { fromAttribute: o.converter } : o.converter?.fromAttribute !== void 0 ? o.converter :
|
|
172
|
+
const o = i.getPropertyOptions(r), a = typeof o.converter == "function" ? { fromAttribute: o.converter } : o.converter?.fromAttribute !== void 0 ? o.converter : Y;
|
|
172
173
|
this._$Em = r;
|
|
173
174
|
const h = a.fromAttribute(s, o.type);
|
|
174
175
|
this[r] = h ?? this._$Ej?.get(r) ?? h, this._$Em = null;
|
|
@@ -177,7 +178,7 @@ class I extends HTMLElement {
|
|
|
177
178
|
requestUpdate(t, s, i) {
|
|
178
179
|
if (t !== void 0) {
|
|
179
180
|
const r = this.constructor, o = this[t];
|
|
180
|
-
if (i ??= r.getPropertyOptions(t), !((i.hasChanged ??
|
|
181
|
+
if (i ??= r.getPropertyOptions(t), !((i.hasChanged ?? X)(o, s) || i.useDefault && i.reflect && o === this._$Ej?.get(t) && !this.hasAttribute(r._$Eu(t, i)))) return;
|
|
181
182
|
this.C(t, s, i);
|
|
182
183
|
}
|
|
183
184
|
this.isUpdatePending === !1 && (this._$ES = this._$EP());
|
|
@@ -244,94 +245,55 @@ class I extends HTMLElement {
|
|
|
244
245
|
}
|
|
245
246
|
firstUpdated(t) {
|
|
246
247
|
}
|
|
247
|
-
}
|
|
248
|
-
I.elementStyles = [], I.shadowRootOptions = { mode: "open" }, I[M("elementProperties")] = /* @__PURE__ */ new Map(), I[M("finalized")] = /* @__PURE__ */ new Map(), Mt?.({ ReactiveElement: I }), (F.reactiveElementVersions ??= []).push("2.1.1");
|
|
249
|
-
const Ht = { attribute: !0, type: String, converter: B, reflect: !1, hasChanged: Q }, jt = (e = Ht, t, s) => {
|
|
250
|
-
const { kind: i, metadata: r } = s;
|
|
251
|
-
let o = globalThis.litPropertyMetadata.get(r);
|
|
252
|
-
if (o === void 0 && globalThis.litPropertyMetadata.set(r, o = /* @__PURE__ */ new Map()), i === "setter" && ((e = Object.create(e)).wrapped = !0), o.set(s.name, e), i === "accessor") {
|
|
253
|
-
const { name: a } = s;
|
|
254
|
-
return { set(h) {
|
|
255
|
-
const n = t.get.call(this);
|
|
256
|
-
t.set.call(this, h), this.requestUpdate(a, n, e);
|
|
257
|
-
}, init(h) {
|
|
258
|
-
return h !== void 0 && this.C(a, void 0, e, h), h;
|
|
259
|
-
} };
|
|
260
|
-
}
|
|
261
|
-
if (i === "setter") {
|
|
262
|
-
const { name: a } = s;
|
|
263
|
-
return function(h) {
|
|
264
|
-
const n = this[a];
|
|
265
|
-
t.call(this, h), this.requestUpdate(a, n, e);
|
|
266
|
-
};
|
|
267
|
-
}
|
|
268
|
-
throw Error("Unsupported decorator location: " + i);
|
|
269
248
|
};
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
}
|
|
276
|
-
function b(e) {
|
|
277
|
-
return k({ ...e, state: !0, attribute: !1 });
|
|
278
|
-
}
|
|
279
|
-
const qt = (e, t, s) => (s.configurable = !0, s.enumerable = !0, Reflect.decorate && typeof t != "object" && Object.defineProperty(e, t, s), s);
|
|
280
|
-
function X(e, t) {
|
|
281
|
-
return (s, i, r) => {
|
|
282
|
-
const o = (a) => a.renderRoot?.querySelector(e) ?? null;
|
|
283
|
-
return qt(s, i, { get() {
|
|
284
|
-
return o(this);
|
|
285
|
-
} });
|
|
286
|
-
};
|
|
287
|
-
}
|
|
288
|
-
const tt = globalThis, Y = tt.trustedTypes, nt = Y ? Y.createPolicy("lit-html", { createHTML: (e) => e }) : void 0, wt = "$lit$", x = `lit$${Math.random().toFixed(9).slice(2)}$`, $t = "?" + x, zt = `<${$t}>`, D = document, K = () => D.createComment(""), H = (e) => e === null || typeof e != "object" && typeof e != "function", et = Array.isArray, Bt = (e) => et(e) || typeof e?.[Symbol.iterator] == "function", W = `[
|
|
289
|
-
\f\r]`, N = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, lt = /-->/g, ht = />/g, T = RegExp(`>|${W}(?:([^\\s"'>=/]+)(${W}*=${W}*(?:[^
|
|
290
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"), ct = /'/g, dt = /"/g, bt = /^(?:script|style|textarea|title)$/i, U = Symbol.for("lit-noChange"), A = Symbol.for("lit-nothing"), pt = /* @__PURE__ */ new WeakMap(), O = D.createTreeWalker(D, 129);
|
|
291
|
-
function vt(e, t) {
|
|
249
|
+
U.elementStyles = [], U.shadowRootOptions = { mode: "open" }, U[M("elementProperties")] = /* @__PURE__ */ new Map(), U[M("finalized")] = /* @__PURE__ */ new Map(), Lt?.({ ReactiveElement: U }), (F.reactiveElementVersions ??= []).push("2.1.1");
|
|
250
|
+
const tt = globalThis, K = tt.trustedTypes, ht = K ? K.createPolicy("lit-html", { createHTML: (e) => e }) : void 0, bt = "$lit$", C = `lit$${Math.random().toFixed(9).slice(2)}$`, vt = "?" + C, Mt = `<${vt}>`, D = document, j = () => D.createComment(""), q = (e) => e === null || typeof e != "object" && typeof e != "function", et = Array.isArray, Ht = (e) => et(e) || typeof e?.[Symbol.iterator] == "function", W = `[
|
|
251
|
+
\f\r]`, N = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, ct = /-->/g, dt = />/g, T = RegExp(`>|${W}(?:([^\\s"'>=/]+)(${W}*=${W}*(?:[^
|
|
252
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), pt = /'/g, ut = /"/g, At = /^(?:script|style|textarea|title)$/i, jt = (e) => (t, ...s) => ({ _$litType$: e, strings: t, values: s }), f = jt(1), x = Symbol.for("lit-noChange"), g = Symbol.for("lit-nothing"), gt = /* @__PURE__ */ new WeakMap(), O = D.createTreeWalker(D, 129);
|
|
253
|
+
function _t(e, t) {
|
|
292
254
|
if (!et(e) || !e.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
293
|
-
return
|
|
255
|
+
return ht !== void 0 ? ht.createHTML(t) : t;
|
|
294
256
|
}
|
|
295
|
-
const
|
|
257
|
+
const qt = (e, t) => {
|
|
296
258
|
const s = e.length - 1, i = [];
|
|
297
259
|
let r, o = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", a = N;
|
|
298
260
|
for (let h = 0; h < s; h++) {
|
|
299
261
|
const n = e[h];
|
|
300
262
|
let c, p, l = -1, d = 0;
|
|
301
|
-
for (; d < n.length && (a.lastIndex = d, p = a.exec(n), p !== null); ) d = a.lastIndex, a === N ? p[1] === "!--" ? a =
|
|
263
|
+
for (; d < n.length && (a.lastIndex = d, p = a.exec(n), p !== null); ) d = a.lastIndex, a === N ? p[1] === "!--" ? a = ct : p[1] !== void 0 ? a = dt : p[2] !== void 0 ? (At.test(p[2]) && (r = RegExp("</" + p[2], "g")), a = T) : p[3] !== void 0 && (a = T) : a === T ? p[0] === ">" ? (a = r ?? N, l = -1) : p[1] === void 0 ? l = -2 : (l = a.lastIndex - p[2].length, c = p[1], a = p[3] === void 0 ? T : p[3] === '"' ? ut : pt) : a === ut || a === pt ? a = T : a === ct || a === dt ? a = N : (a = T, r = void 0);
|
|
302
264
|
const u = a === T && e[h + 1].startsWith("/>") ? " " : "";
|
|
303
|
-
o += a === N ? n +
|
|
265
|
+
o += a === N ? n + Mt : l >= 0 ? (i.push(c), n.slice(0, l) + bt + n.slice(l) + C + u) : n + C + (l === -2 ? h : u);
|
|
304
266
|
}
|
|
305
|
-
return [
|
|
267
|
+
return [_t(e, o + (e[s] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), i];
|
|
306
268
|
};
|
|
307
|
-
class
|
|
269
|
+
class B {
|
|
308
270
|
constructor({ strings: t, _$litType$: s }, i) {
|
|
309
271
|
let r;
|
|
310
272
|
this.parts = [];
|
|
311
273
|
let o = 0, a = 0;
|
|
312
|
-
const h = t.length - 1, n = this.parts, [c, p] =
|
|
313
|
-
if (this.el =
|
|
274
|
+
const h = t.length - 1, n = this.parts, [c, p] = qt(t, s);
|
|
275
|
+
if (this.el = B.createElement(c, i), O.currentNode = this.el.content, s === 2 || s === 3) {
|
|
314
276
|
const l = this.el.content.firstChild;
|
|
315
277
|
l.replaceWith(...l.childNodes);
|
|
316
278
|
}
|
|
317
279
|
for (; (r = O.nextNode()) !== null && n.length < h; ) {
|
|
318
280
|
if (r.nodeType === 1) {
|
|
319
|
-
if (r.hasAttributes()) for (const l of r.getAttributeNames()) if (l.endsWith(
|
|
320
|
-
const d = p[a++], u = r.getAttribute(l).split(
|
|
321
|
-
n.push({ type: 1, index: o, name:
|
|
322
|
-
} else l.startsWith(
|
|
323
|
-
if (
|
|
324
|
-
const l = r.textContent.split(
|
|
281
|
+
if (r.hasAttributes()) for (const l of r.getAttributeNames()) if (l.endsWith(bt)) {
|
|
282
|
+
const d = p[a++], u = r.getAttribute(l).split(C), $ = /([.?@])?(.*)/.exec(d);
|
|
283
|
+
n.push({ type: 1, index: o, name: $[2], strings: u, ctor: $[1] === "." ? zt : $[1] === "?" ? Yt : $[1] === "@" ? Kt : V }), r.removeAttribute(l);
|
|
284
|
+
} else l.startsWith(C) && (n.push({ type: 6, index: o }), r.removeAttribute(l));
|
|
285
|
+
if (At.test(r.tagName)) {
|
|
286
|
+
const l = r.textContent.split(C), d = l.length - 1;
|
|
325
287
|
if (d > 0) {
|
|
326
|
-
r.textContent =
|
|
327
|
-
for (let u = 0; u < d; u++) r.append(l[u],
|
|
328
|
-
r.append(l[d],
|
|
288
|
+
r.textContent = K ? K.emptyScript : "";
|
|
289
|
+
for (let u = 0; u < d; u++) r.append(l[u], j()), O.nextNode(), n.push({ type: 2, index: ++o });
|
|
290
|
+
r.append(l[d], j());
|
|
329
291
|
}
|
|
330
292
|
}
|
|
331
|
-
} else if (r.nodeType === 8) if (r.data ===
|
|
293
|
+
} else if (r.nodeType === 8) if (r.data === vt) n.push({ type: 2, index: o });
|
|
332
294
|
else {
|
|
333
295
|
let l = -1;
|
|
334
|
-
for (; (l = r.data.indexOf(
|
|
296
|
+
for (; (l = r.data.indexOf(C, l + 1)) !== -1; ) n.push({ type: 7, index: o }), l += C.length - 1;
|
|
335
297
|
}
|
|
336
298
|
o++;
|
|
337
299
|
}
|
|
@@ -342,12 +304,12 @@ class j {
|
|
|
342
304
|
}
|
|
343
305
|
}
|
|
344
306
|
function R(e, t, s = e, i) {
|
|
345
|
-
if (t ===
|
|
307
|
+
if (t === x) return t;
|
|
346
308
|
let r = i !== void 0 ? s._$Co?.[i] : s._$Cl;
|
|
347
|
-
const o =
|
|
309
|
+
const o = q(t) ? void 0 : t._$litDirective$;
|
|
348
310
|
return r?.constructor !== o && (r?._$AO?.(!1), o === void 0 ? r = void 0 : (r = new o(e), r._$AT(e, s, i)), i !== void 0 ? (s._$Co ??= [])[i] = r : s._$Cl = r), r !== void 0 && (t = R(e, r._$AS(e, t.values), r, i)), t;
|
|
349
311
|
}
|
|
350
|
-
let
|
|
312
|
+
let Bt = class {
|
|
351
313
|
constructor(t, s) {
|
|
352
314
|
this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = s;
|
|
353
315
|
}
|
|
@@ -364,7 +326,7 @@ let Kt = class {
|
|
|
364
326
|
for (; n !== void 0; ) {
|
|
365
327
|
if (a === n.index) {
|
|
366
328
|
let c;
|
|
367
|
-
n.type === 2 ? c = new
|
|
329
|
+
n.type === 2 ? c = new I(o, o.nextSibling, this, t) : n.type === 1 ? c = new n.ctor(o, n.name, n.strings, this, t) : n.type === 6 && (c = new Ft(o, this, t)), this._$AV.push(c), n = i[++h];
|
|
368
330
|
}
|
|
369
331
|
a !== n?.index && (o = O.nextNode(), a++);
|
|
370
332
|
}
|
|
@@ -375,12 +337,12 @@ let Kt = class {
|
|
|
375
337
|
for (const i of this._$AV) i !== void 0 && (i.strings !== void 0 ? (i._$AI(t, i, s), s += i.strings.length - 2) : i._$AI(t[s])), s++;
|
|
376
338
|
}
|
|
377
339
|
};
|
|
378
|
-
class
|
|
340
|
+
class I {
|
|
379
341
|
get _$AU() {
|
|
380
342
|
return this._$AM?._$AU ?? this._$Cv;
|
|
381
343
|
}
|
|
382
344
|
constructor(t, s, i, r) {
|
|
383
|
-
this.type = 2, this._$AH =
|
|
345
|
+
this.type = 2, this._$AH = g, this._$AN = void 0, this._$AA = t, this._$AB = s, this._$AM = i, this.options = r, this._$Cv = r?.isConnected ?? !0;
|
|
384
346
|
}
|
|
385
347
|
get parentNode() {
|
|
386
348
|
let t = this._$AA.parentNode;
|
|
@@ -394,7 +356,7 @@ class q {
|
|
|
394
356
|
return this._$AB;
|
|
395
357
|
}
|
|
396
358
|
_$AI(t, s = this) {
|
|
397
|
-
t = R(this, t, s),
|
|
359
|
+
t = R(this, t, s), q(t) ? t === g || t == null || t === "" ? (this._$AH !== g && this._$AR(), this._$AH = g) : t !== this._$AH && t !== x && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : Ht(t) ? this.k(t) : this._(t);
|
|
398
360
|
}
|
|
399
361
|
O(t) {
|
|
400
362
|
return this._$AA.parentNode.insertBefore(t, this._$AB);
|
|
@@ -403,25 +365,25 @@ class q {
|
|
|
403
365
|
this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
|
|
404
366
|
}
|
|
405
367
|
_(t) {
|
|
406
|
-
this._$AH !==
|
|
368
|
+
this._$AH !== g && q(this._$AH) ? this._$AA.nextSibling.data = t : this.T(D.createTextNode(t)), this._$AH = t;
|
|
407
369
|
}
|
|
408
370
|
$(t) {
|
|
409
|
-
const { values: s, _$litType$: i } = t, r = typeof i == "number" ? this._$AC(t) : (i.el === void 0 && (i.el =
|
|
371
|
+
const { values: s, _$litType$: i } = t, r = typeof i == "number" ? this._$AC(t) : (i.el === void 0 && (i.el = B.createElement(_t(i.h, i.h[0]), this.options)), i);
|
|
410
372
|
if (this._$AH?._$AD === r) this._$AH.p(s);
|
|
411
373
|
else {
|
|
412
|
-
const o = new
|
|
374
|
+
const o = new Bt(r, this), a = o.u(this.options);
|
|
413
375
|
o.p(s), this.T(a), this._$AH = o;
|
|
414
376
|
}
|
|
415
377
|
}
|
|
416
378
|
_$AC(t) {
|
|
417
|
-
let s =
|
|
418
|
-
return s === void 0 &&
|
|
379
|
+
let s = gt.get(t.strings);
|
|
380
|
+
return s === void 0 && gt.set(t.strings, s = new B(t)), s;
|
|
419
381
|
}
|
|
420
382
|
k(t) {
|
|
421
383
|
et(this._$AH) || (this._$AH = [], this._$AR());
|
|
422
384
|
const s = this._$AH;
|
|
423
385
|
let i, r = 0;
|
|
424
|
-
for (const o of t) r === s.length ? s.push(i = new
|
|
386
|
+
for (const o of t) r === s.length ? s.push(i = new I(this.O(j()), this.O(j()), this, this.options)) : i = s[r], i._$AI(o), r++;
|
|
425
387
|
r < s.length && (this._$AR(i && i._$AB.nextSibling, r), s.length = r);
|
|
426
388
|
}
|
|
427
389
|
_$AR(t = this._$AA.nextSibling, s) {
|
|
@@ -442,53 +404,53 @@ class V {
|
|
|
442
404
|
return this._$AM._$AU;
|
|
443
405
|
}
|
|
444
406
|
constructor(t, s, i, r, o) {
|
|
445
|
-
this.type = 1, this._$AH =
|
|
407
|
+
this.type = 1, this._$AH = g, this._$AN = void 0, this.element = t, this.name = s, this._$AM = r, this.options = o, i.length > 2 || i[0] !== "" || i[1] !== "" ? (this._$AH = Array(i.length - 1).fill(new String()), this.strings = i) : this._$AH = g;
|
|
446
408
|
}
|
|
447
409
|
_$AI(t, s = this, i, r) {
|
|
448
410
|
const o = this.strings;
|
|
449
411
|
let a = !1;
|
|
450
|
-
if (o === void 0) t = R(this, t, s, 0), a = !
|
|
412
|
+
if (o === void 0) t = R(this, t, s, 0), a = !q(t) || t !== this._$AH && t !== x, a && (this._$AH = t);
|
|
451
413
|
else {
|
|
452
414
|
const h = t;
|
|
453
415
|
let n, c;
|
|
454
|
-
for (t = o[0], n = 0; n < o.length - 1; n++) c = R(this, h[i + n], s, n), c ===
|
|
416
|
+
for (t = o[0], n = 0; n < o.length - 1; n++) c = R(this, h[i + n], s, n), c === x && (c = this._$AH[n]), a ||= !q(c) || c !== this._$AH[n], c === g ? t = g : t !== g && (t += (c ?? "") + o[n + 1]), this._$AH[n] = c;
|
|
455
417
|
}
|
|
456
418
|
a && !r && this.j(t);
|
|
457
419
|
}
|
|
458
420
|
j(t) {
|
|
459
|
-
t ===
|
|
421
|
+
t === g ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
|
|
460
422
|
}
|
|
461
423
|
}
|
|
462
|
-
class
|
|
424
|
+
class zt extends V {
|
|
463
425
|
constructor() {
|
|
464
426
|
super(...arguments), this.type = 3;
|
|
465
427
|
}
|
|
466
428
|
j(t) {
|
|
467
|
-
this.element[this.name] = t ===
|
|
429
|
+
this.element[this.name] = t === g ? void 0 : t;
|
|
468
430
|
}
|
|
469
431
|
}
|
|
470
|
-
class
|
|
432
|
+
class Yt extends V {
|
|
471
433
|
constructor() {
|
|
472
434
|
super(...arguments), this.type = 4;
|
|
473
435
|
}
|
|
474
436
|
j(t) {
|
|
475
|
-
this.element.toggleAttribute(this.name, !!t && t !==
|
|
437
|
+
this.element.toggleAttribute(this.name, !!t && t !== g);
|
|
476
438
|
}
|
|
477
439
|
}
|
|
478
|
-
class
|
|
440
|
+
class Kt extends V {
|
|
479
441
|
constructor(t, s, i, r, o) {
|
|
480
442
|
super(t, s, i, r, o), this.type = 5;
|
|
481
443
|
}
|
|
482
444
|
_$AI(t, s = this) {
|
|
483
|
-
if ((t = R(this, t, s, 0) ??
|
|
484
|
-
const i = this._$AH, r = t ===
|
|
445
|
+
if ((t = R(this, t, s, 0) ?? g) === x) return;
|
|
446
|
+
const i = this._$AH, r = t === g && i !== g || t.capture !== i.capture || t.once !== i.once || t.passive !== i.passive, o = t !== g && (i === g || r);
|
|
485
447
|
r && this.element.removeEventListener(this.name, this, i), o && this.element.addEventListener(this.name, this, t), this._$AH = t;
|
|
486
448
|
}
|
|
487
449
|
handleEvent(t) {
|
|
488
450
|
typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, t) : this._$AH.handleEvent(t);
|
|
489
451
|
}
|
|
490
452
|
}
|
|
491
|
-
class
|
|
453
|
+
class Ft {
|
|
492
454
|
constructor(t, s, i) {
|
|
493
455
|
this.element = t, this.type = 6, this._$AN = void 0, this._$AM = s, this.options = i;
|
|
494
456
|
}
|
|
@@ -499,10 +461,90 @@ class Gt {
|
|
|
499
461
|
R(this, t);
|
|
500
462
|
}
|
|
501
463
|
}
|
|
502
|
-
const
|
|
503
|
-
|
|
504
|
-
const
|
|
505
|
-
|
|
464
|
+
const Vt = { I }, Wt = tt.litHtmlPolyfillSupport;
|
|
465
|
+
Wt?.(B, I), (tt.litHtmlVersions ??= []).push("3.3.1");
|
|
466
|
+
const Gt = (e, t, s) => {
|
|
467
|
+
const i = s?.renderBefore ?? t;
|
|
468
|
+
let r = i._$litPart$;
|
|
469
|
+
if (r === void 0) {
|
|
470
|
+
const o = s?.renderBefore ?? null;
|
|
471
|
+
i._$litPart$ = r = new I(t.insertBefore(j(), o), o, void 0, s ?? {});
|
|
472
|
+
}
|
|
473
|
+
return r._$AI(e), r;
|
|
474
|
+
};
|
|
475
|
+
const st = globalThis;
|
|
476
|
+
let H = class extends U {
|
|
477
|
+
constructor() {
|
|
478
|
+
super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
|
|
479
|
+
}
|
|
480
|
+
createRenderRoot() {
|
|
481
|
+
const t = super.createRenderRoot();
|
|
482
|
+
return this.renderOptions.renderBefore ??= t.firstChild, t;
|
|
483
|
+
}
|
|
484
|
+
update(t) {
|
|
485
|
+
const s = this.render();
|
|
486
|
+
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = Gt(s, this.renderRoot, this.renderOptions);
|
|
487
|
+
}
|
|
488
|
+
connectedCallback() {
|
|
489
|
+
super.connectedCallback(), this._$Do?.setConnected(!0);
|
|
490
|
+
}
|
|
491
|
+
disconnectedCallback() {
|
|
492
|
+
super.disconnectedCallback(), this._$Do?.setConnected(!1);
|
|
493
|
+
}
|
|
494
|
+
render() {
|
|
495
|
+
return x;
|
|
496
|
+
}
|
|
497
|
+
};
|
|
498
|
+
H._$litElement$ = !0, H.finalized = !0, st.litElementHydrateSupport?.({ LitElement: H });
|
|
499
|
+
const Jt = st.litElementPolyfillSupport;
|
|
500
|
+
Jt?.({ LitElement: H });
|
|
501
|
+
(st.litElementVersions ??= []).push("4.2.1");
|
|
502
|
+
const Zt = (e) => (t, s) => {
|
|
503
|
+
s !== void 0 ? s.addInitializer((() => {
|
|
504
|
+
customElements.define(e, t);
|
|
505
|
+
})) : customElements.define(e, t);
|
|
506
|
+
};
|
|
507
|
+
const Qt = { attribute: !0, type: String, converter: Y, reflect: !1, hasChanged: X }, Xt = (e = Qt, t, s) => {
|
|
508
|
+
const { kind: i, metadata: r } = s;
|
|
509
|
+
let o = globalThis.litPropertyMetadata.get(r);
|
|
510
|
+
if (o === void 0 && globalThis.litPropertyMetadata.set(r, o = /* @__PURE__ */ new Map()), i === "setter" && ((e = Object.create(e)).wrapped = !0), o.set(s.name, e), i === "accessor") {
|
|
511
|
+
const { name: a } = s;
|
|
512
|
+
return { set(h) {
|
|
513
|
+
const n = t.get.call(this);
|
|
514
|
+
t.set.call(this, h), this.requestUpdate(a, n, e);
|
|
515
|
+
}, init(h) {
|
|
516
|
+
return h !== void 0 && this.C(a, void 0, e, h), h;
|
|
517
|
+
} };
|
|
518
|
+
}
|
|
519
|
+
if (i === "setter") {
|
|
520
|
+
const { name: a } = s;
|
|
521
|
+
return function(h) {
|
|
522
|
+
const n = this[a];
|
|
523
|
+
t.call(this, h), this.requestUpdate(a, n, e);
|
|
524
|
+
};
|
|
525
|
+
}
|
|
526
|
+
throw Error("Unsupported decorator location: " + i);
|
|
527
|
+
};
|
|
528
|
+
function S(e) {
|
|
529
|
+
return (t, s) => typeof s == "object" ? Xt(e, t, s) : ((i, r, o) => {
|
|
530
|
+
const a = r.hasOwnProperty(o);
|
|
531
|
+
return r.constructor.createProperty(o, i), a ? Object.getOwnPropertyDescriptor(r, o) : void 0;
|
|
532
|
+
})(e, t, s);
|
|
533
|
+
}
|
|
534
|
+
function b(e) {
|
|
535
|
+
return S({ ...e, state: !0, attribute: !1 });
|
|
536
|
+
}
|
|
537
|
+
const te = (e, t, s) => (s.configurable = !0, s.enumerable = !0, Reflect.decorate && typeof t != "object" && Object.defineProperty(e, t, s), s);
|
|
538
|
+
function it(e, t) {
|
|
539
|
+
return (s, i, r) => {
|
|
540
|
+
const o = (a) => a.renderRoot?.querySelector(e) ?? null;
|
|
541
|
+
return te(s, i, { get() {
|
|
542
|
+
return o(this);
|
|
543
|
+
} });
|
|
544
|
+
};
|
|
545
|
+
}
|
|
546
|
+
const St = { ATTRIBUTE: 1, CHILD: 2 }, kt = (e) => (...t) => ({ _$litDirective$: e, values: t });
|
|
547
|
+
class Ct {
|
|
506
548
|
constructor(t) {
|
|
507
549
|
}
|
|
508
550
|
get _$AU() {
|
|
@@ -518,9 +560,9 @@ class St {
|
|
|
518
560
|
return this.render(...s);
|
|
519
561
|
}
|
|
520
562
|
}
|
|
521
|
-
const
|
|
563
|
+
const mt = kt(class extends Ct {
|
|
522
564
|
constructor(e) {
|
|
523
|
-
if (super(e), e.type !==
|
|
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.");
|
|
524
566
|
}
|
|
525
567
|
render(e) {
|
|
526
568
|
return " " + Object.keys(e).filter(((t) => e[t])).join(" ") + " ";
|
|
@@ -537,14 +579,14 @@ const ut = _t(class extends St {
|
|
|
537
579
|
const r = !!t[i];
|
|
538
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)));
|
|
539
581
|
}
|
|
540
|
-
return
|
|
582
|
+
return x;
|
|
541
583
|
}
|
|
542
584
|
});
|
|
543
|
-
const { I:
|
|
585
|
+
const { I: ee } = Vt, ft = () => document.createComment(""), L = (e, t, s) => {
|
|
544
586
|
const i = e._$AA.parentNode, r = t === void 0 ? e._$AB : t._$AA;
|
|
545
587
|
if (s === void 0) {
|
|
546
|
-
const o = i.insertBefore(
|
|
547
|
-
s = new
|
|
588
|
+
const o = i.insertBefore(ft(), r), a = i.insertBefore(ft(), r);
|
|
589
|
+
s = new ee(o, a, e, e.options);
|
|
548
590
|
} else {
|
|
549
591
|
const o = s._$AB.nextSibling, a = s._$AM, h = a !== e;
|
|
550
592
|
if (h) {
|
|
@@ -560,16 +602,16 @@ const { I: Qt } = Jt, gt = () => document.createComment(""), L = (e, t, s) => {
|
|
|
560
602
|
}
|
|
561
603
|
}
|
|
562
604
|
return s;
|
|
563
|
-
}, P = (e, t, s = e) => (e._$AI(t, s), e),
|
|
605
|
+
}, P = (e, t, s = e) => (e._$AI(t, s), e), se = {}, ie = (e, t = se) => e._$AH = t, re = (e) => e._$AH, G = (e) => {
|
|
564
606
|
e._$AR(), e._$AA.remove();
|
|
565
607
|
};
|
|
566
|
-
const
|
|
608
|
+
const yt = (e, t, s) => {
|
|
567
609
|
const i = /* @__PURE__ */ new Map();
|
|
568
610
|
for (let r = t; r <= s; r++) i.set(e[r], r);
|
|
569
611
|
return i;
|
|
570
|
-
},
|
|
612
|
+
}, $t = kt(class extends Ct {
|
|
571
613
|
constructor(e) {
|
|
572
|
-
if (super(e), e.type !==
|
|
614
|
+
if (super(e), e.type !== St.CHILD) throw Error("repeat() can only be used in text expressions");
|
|
573
615
|
}
|
|
574
616
|
dt(e, t, s) {
|
|
575
617
|
let i;
|
|
@@ -583,36 +625,36 @@ const mt = (e, t, s) => {
|
|
|
583
625
|
return this.dt(e, t, s).values;
|
|
584
626
|
}
|
|
585
627
|
update(e, [t, s, i]) {
|
|
586
|
-
const r =
|
|
628
|
+
const r = re(e), { values: o, keys: a } = this.dt(t, s, i);
|
|
587
629
|
if (!Array.isArray(r)) return this.ut = a, o;
|
|
588
630
|
const h = this.ut ??= [], n = [];
|
|
589
|
-
let c, p, l = 0, d = r.length - 1, u = 0,
|
|
590
|
-
for (; l <= d && u <=
|
|
631
|
+
let c, p, l = 0, d = r.length - 1, u = 0, $ = o.length - 1;
|
|
632
|
+
for (; l <= d && u <= $; ) if (r[l] === null) l++;
|
|
591
633
|
else if (r[d] === null) d--;
|
|
592
634
|
else if (h[l] === a[u]) n[u] = P(r[l], o[u]), l++, u++;
|
|
593
|
-
else if (h[d] === a[
|
|
594
|
-
else if (h[l] === a[
|
|
635
|
+
else if (h[d] === a[$]) n[$] = P(r[d], o[$]), d--, $--;
|
|
636
|
+
else if (h[l] === a[$]) n[$] = P(r[l], o[$]), L(e, n[$ + 1], r[l]), l++, $--;
|
|
595
637
|
else if (h[d] === a[u]) n[u] = P(r[d], o[u]), L(e, r[l], r[d]), d--, u++;
|
|
596
|
-
else if (c === void 0 && (c =
|
|
597
|
-
const v = p.get(a[u]),
|
|
598
|
-
if (
|
|
638
|
+
else if (c === void 0 && (c = yt(a, u, $), p = yt(h, l, d)), c.has(h[l])) if (c.has(h[d])) {
|
|
639
|
+
const v = p.get(a[u]), A = v !== void 0 ? r[v] : null;
|
|
640
|
+
if (A === null) {
|
|
599
641
|
const w = L(e, r[l]);
|
|
600
642
|
P(w, o[u]), n[u] = w;
|
|
601
|
-
} else n[u] = P(
|
|
643
|
+
} else n[u] = P(A, o[u]), L(e, r[l], A), r[v] = null;
|
|
602
644
|
u++;
|
|
603
645
|
} else G(r[d]), d--;
|
|
604
646
|
else G(r[l]), l++;
|
|
605
|
-
for (; u <=
|
|
606
|
-
const v = L(e, n[
|
|
647
|
+
for (; u <= $; ) {
|
|
648
|
+
const v = L(e, n[$ + 1]);
|
|
607
649
|
P(v, o[u]), n[u++] = v;
|
|
608
650
|
}
|
|
609
651
|
for (; l <= d; ) {
|
|
610
652
|
const v = r[l++];
|
|
611
653
|
v !== null && G(v);
|
|
612
654
|
}
|
|
613
|
-
return this.ut = a,
|
|
655
|
+
return this.ut = a, ie(e, n), x;
|
|
614
656
|
}
|
|
615
|
-
}),
|
|
657
|
+
}), oe = ({
|
|
616
658
|
baseUrl: e
|
|
617
659
|
}) => {
|
|
618
660
|
const t = {
|
|
@@ -632,7 +674,7 @@ const mt = (e, t, s) => {
|
|
|
632
674
|
refreshToken: d,
|
|
633
675
|
idToken: u
|
|
634
676
|
}) => {
|
|
635
|
-
const
|
|
677
|
+
const $ = await fetch(`${e}${t.login}`, {
|
|
636
678
|
method: "POST",
|
|
637
679
|
headers: {
|
|
638
680
|
"Content-Type": "application/json"
|
|
@@ -645,11 +687,11 @@ const mt = (e, t, s) => {
|
|
|
645
687
|
idToken: u
|
|
646
688
|
})
|
|
647
689
|
});
|
|
648
|
-
if (
|
|
649
|
-
const v = await
|
|
690
|
+
if (!$.ok) {
|
|
691
|
+
const v = await $.json();
|
|
650
692
|
throw new Error(v.message || v.error || "Login failed");
|
|
651
693
|
}
|
|
652
|
-
return
|
|
694
|
+
return $.json();
|
|
653
695
|
},
|
|
654
696
|
logout: async ({
|
|
655
697
|
accessToken: c,
|
|
@@ -711,7 +753,7 @@ const mt = (e, t, s) => {
|
|
|
711
753
|
phone_number: l,
|
|
712
754
|
family_name: d,
|
|
713
755
|
given_name: u,
|
|
714
|
-
code:
|
|
756
|
+
code: $
|
|
715
757
|
}) => {
|
|
716
758
|
const v = await fetch(`${e}${t.register}`, {
|
|
717
759
|
method: "POST",
|
|
@@ -724,12 +766,12 @@ const mt = (e, t, s) => {
|
|
|
724
766
|
phone_number: l,
|
|
725
767
|
family_name: d,
|
|
726
768
|
given_name: u,
|
|
727
|
-
code:
|
|
769
|
+
code: $
|
|
728
770
|
})
|
|
729
771
|
});
|
|
730
772
|
if (!v.ok) {
|
|
731
|
-
const
|
|
732
|
-
throw new Error(
|
|
773
|
+
const A = await v.json();
|
|
774
|
+
throw new Error(A.message || A.error || "Registration failed");
|
|
733
775
|
}
|
|
734
776
|
return v.json();
|
|
735
777
|
},
|
|
@@ -776,23 +818,23 @@ const mt = (e, t, s) => {
|
|
|
776
818
|
AUTH_TOKEN: "authToken",
|
|
777
819
|
ACCESS_TOKEN: "accessToken",
|
|
778
820
|
REFRESH_TOKEN: "refreshToken"
|
|
779
|
-
},
|
|
821
|
+
}, ae = {
|
|
780
822
|
maxAge: 3600 * 24 * 7,
|
|
781
823
|
// 7 days
|
|
782
824
|
secure: !0,
|
|
783
825
|
sameSite: "lax",
|
|
784
826
|
path: "/"
|
|
785
|
-
},
|
|
827
|
+
}, ne = () => {
|
|
786
828
|
const e = (n, c, p = {}) => {
|
|
787
829
|
const {
|
|
788
830
|
maxAge: l,
|
|
789
831
|
path: d = "/",
|
|
790
832
|
secure: u = window.location.protocol === "https:",
|
|
791
|
-
sameSite:
|
|
833
|
+
sameSite: $ = "lax",
|
|
792
834
|
domain: v
|
|
793
835
|
} = p;
|
|
794
|
-
let
|
|
795
|
-
l !== void 0 && (
|
|
836
|
+
let A = `${encodeURIComponent(n)}=${encodeURIComponent(c)}`;
|
|
837
|
+
l !== void 0 && (A += `; Max-Age=${l}`), A += `; Path=${d}`, u && (A += "; Secure"), A += `; SameSite=${$}`, v && (A += `; Domain=${v}`), document.cookie = A;
|
|
796
838
|
}, t = (n) => {
|
|
797
839
|
const c = encodeURIComponent(n) + "=", p = document.cookie.split(";");
|
|
798
840
|
for (let l = 0; l < p.length; l++) {
|
|
@@ -809,7 +851,7 @@ const mt = (e, t, s) => {
|
|
|
809
851
|
maxAge: -1
|
|
810
852
|
});
|
|
811
853
|
}, i = (n) => t(n) !== null, r = (n, c) => {
|
|
812
|
-
e(J[n], c,
|
|
854
|
+
e(J[n], c, ae);
|
|
813
855
|
}, o = (n) => t(J[n]), a = (n) => {
|
|
814
856
|
s(J[n]);
|
|
815
857
|
};
|
|
@@ -825,11 +867,11 @@ const mt = (e, t, s) => {
|
|
|
825
867
|
a("AUTH_TOKEN"), a("ACCESS_TOKEN"), a("REFRESH_TOKEN");
|
|
826
868
|
}
|
|
827
869
|
};
|
|
828
|
-
},
|
|
870
|
+
}, le = ["code", "state", "error", "error_description"], he = (e) => {
|
|
829
871
|
if (e) return e;
|
|
830
872
|
const t = new URL(window.location.href);
|
|
831
|
-
return
|
|
832
|
-
},
|
|
873
|
+
return le.forEach((s) => t.searchParams.delete(s)), t.toString();
|
|
874
|
+
}, ce = ({
|
|
833
875
|
domain: e,
|
|
834
876
|
cognitoRegion: t,
|
|
835
877
|
userPoolId: s,
|
|
@@ -839,53 +881,53 @@ const mt = (e, t, s) => {
|
|
|
839
881
|
const o = {
|
|
840
882
|
domain: e,
|
|
841
883
|
clientId: i,
|
|
842
|
-
redirectUri:
|
|
884
|
+
redirectUri: he(r)
|
|
843
885
|
}, a = (w) => {
|
|
844
|
-
const
|
|
845
|
-
return crypto.getRandomValues(
|
|
886
|
+
const _ = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~", k = new Uint8Array(w);
|
|
887
|
+
return crypto.getRandomValues(k), Array.from(k).map((E) => _[E % _.length]).join("");
|
|
846
888
|
}, h = async (w) => {
|
|
847
|
-
const
|
|
889
|
+
const k = new TextEncoder().encode(w), E = await crypto.subtle.digest("SHA-256", k);
|
|
848
890
|
return btoa(String.fromCharCode(...new Uint8Array(E))).replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
|
|
849
891
|
}, n = async () => {
|
|
850
|
-
const w = a(128),
|
|
851
|
-
return sessionStorage.setItem("pkce_code_verifier", w), { codeVerifier: w, codeChallenge:
|
|
892
|
+
const w = a(128), _ = await h(w);
|
|
893
|
+
return sessionStorage.setItem("pkce_code_verifier", w), { codeVerifier: w, codeChallenge: _ };
|
|
852
894
|
}, c = () => {
|
|
853
895
|
const w = a(32);
|
|
854
896
|
return sessionStorage.setItem("oauth_state", w), w;
|
|
855
897
|
}, p = async () => {
|
|
856
|
-
const { codeChallenge: w } = await n(),
|
|
898
|
+
const { codeChallenge: w } = await n(), _ = c(), k = new URLSearchParams({
|
|
857
899
|
response_type: "code",
|
|
858
900
|
client_id: o.clientId,
|
|
859
901
|
redirect_uri: o.redirectUri,
|
|
860
902
|
identity_provider: "Google",
|
|
861
903
|
scope: "openid email profile",
|
|
862
|
-
state:
|
|
904
|
+
state: _,
|
|
863
905
|
code_challenge_method: "S256",
|
|
864
906
|
code_challenge: w,
|
|
865
907
|
prompt: "select_account"
|
|
866
908
|
});
|
|
867
|
-
return `${o.domain}/oauth2/authorize?${
|
|
909
|
+
return `${o.domain}/oauth2/authorize?${k.toString()}`;
|
|
868
910
|
}, l = async () => {
|
|
869
911
|
const w = await p();
|
|
870
912
|
window.location.href = w;
|
|
871
913
|
}, d = async () => {
|
|
872
|
-
const { codeChallenge: w } = await n(),
|
|
914
|
+
const { codeChallenge: w } = await n(), _ = c(), k = new URLSearchParams({
|
|
873
915
|
response_type: "code",
|
|
874
916
|
client_id: o.clientId,
|
|
875
917
|
redirect_uri: o.redirectUri,
|
|
876
918
|
identity_provider: "SignInWithApple",
|
|
877
919
|
scope: "openid email profile",
|
|
878
|
-
state:
|
|
920
|
+
state: _,
|
|
879
921
|
code_challenge_method: "S256",
|
|
880
922
|
code_challenge: w
|
|
881
923
|
});
|
|
882
|
-
return `${o.domain}/oauth2/authorize?${
|
|
924
|
+
return `${o.domain}/oauth2/authorize?${k.toString()}`;
|
|
883
925
|
}, u = async () => {
|
|
884
926
|
const w = await d();
|
|
885
927
|
window.location.href = w;
|
|
886
|
-
},
|
|
887
|
-
const
|
|
888
|
-
return sessionStorage.removeItem("oauth_state"),
|
|
928
|
+
}, $ = (w) => {
|
|
929
|
+
const _ = sessionStorage.getItem("oauth_state");
|
|
930
|
+
return sessionStorage.removeItem("oauth_state"), _ === w;
|
|
889
931
|
}, v = () => {
|
|
890
932
|
const w = sessionStorage.getItem("pkce_code_verifier");
|
|
891
933
|
return sessionStorage.removeItem("pkce_code_verifier"), w;
|
|
@@ -893,33 +935,33 @@ const mt = (e, t, s) => {
|
|
|
893
935
|
return {
|
|
894
936
|
redirectToGoogleAuth: l,
|
|
895
937
|
redirectToAppleAuth: u,
|
|
896
|
-
validateState:
|
|
938
|
+
validateState: $,
|
|
897
939
|
getCodeVerifier: v,
|
|
898
940
|
exchangeCodeForTokens: async (w) => {
|
|
899
|
-
const
|
|
900
|
-
if (!
|
|
941
|
+
const _ = v();
|
|
942
|
+
if (!_)
|
|
901
943
|
throw new Error("PKCE code verifier not found. Please restart the authentication flow.");
|
|
902
|
-
const
|
|
944
|
+
const k = new URLSearchParams({
|
|
903
945
|
grant_type: "authorization_code",
|
|
904
946
|
client_id: o.clientId,
|
|
905
947
|
code: w,
|
|
906
948
|
redirect_uri: o.redirectUri,
|
|
907
|
-
code_verifier:
|
|
949
|
+
code_verifier: _
|
|
908
950
|
}), E = await fetch(`${o.domain}/oauth2/token`, {
|
|
909
951
|
method: "POST",
|
|
910
952
|
headers: {
|
|
911
953
|
"Content-Type": "application/x-www-form-urlencoded"
|
|
912
954
|
},
|
|
913
|
-
body:
|
|
955
|
+
body: k.toString()
|
|
914
956
|
});
|
|
915
957
|
if (!E.ok) {
|
|
916
|
-
const
|
|
917
|
-
throw new Error(`Token exchange failed: ${
|
|
958
|
+
const rt = await E.text();
|
|
959
|
+
throw new Error(`Token exchange failed: ${rt}`);
|
|
918
960
|
}
|
|
919
961
|
return E.json();
|
|
920
962
|
}
|
|
921
963
|
};
|
|
922
|
-
},
|
|
964
|
+
}, de = () => Et`
|
|
923
965
|
:host {
|
|
924
966
|
display: inline-block;
|
|
925
967
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
|
|
@@ -1419,15 +1461,15 @@ const mt = (e, t, s) => {
|
|
|
1419
1461
|
transition: none !important;
|
|
1420
1462
|
}
|
|
1421
1463
|
}`;
|
|
1422
|
-
var
|
|
1423
|
-
for (var r = i > 1 ? void 0 : i ?
|
|
1464
|
+
var pe = Object.defineProperty, ue = Object.getOwnPropertyDescriptor, y = (e, t, s, i) => {
|
|
1465
|
+
for (var r = i > 1 ? void 0 : i ? ue(t, s) : t, o = e.length - 1, a; o >= 0; o--)
|
|
1424
1466
|
(a = e[o]) && (r = (i ? a(t, s, r) : a(r)) || r);
|
|
1425
|
-
return i && r &&
|
|
1467
|
+
return i && r && pe(t, s, r), r;
|
|
1426
1468
|
};
|
|
1427
|
-
const
|
|
1428
|
-
let
|
|
1469
|
+
const ge = ["code", "state", "error", "error_description"];
|
|
1470
|
+
let m = class extends H {
|
|
1429
1471
|
constructor() {
|
|
1430
|
-
super(...arguments), this.open = !1, this.initialMode = "signin", this.logoUrl = "", this.baseUrl = "", this.oauthDomain = "", this.oauthRegion = "", this.oauthUserPoolId = "", this.oauthClientId = "", this.oauthRedirectUri = "", this.size = "sm", this.theme = "light", this.mode = "signin", this.resetStep = "none", this.signupStep = "form", this.isLoading = !1, this.isClosing = !1, this.isVisible = !1, this.isLoggedIn = !1, this.email = "", this.password = "", this.givenName = "", this.familyName = "", this.newPassword = "", this.confirmPassword = "", this.notice = "", this.error = "", this.errors = {}, this.otpDigits = ["", "", "", "", "", ""], this.signupOtpDigits = ["", "", "", "", "", ""], this.isDragging = !1, this.dragStartY = 0, this.dragCurrentY = 0, this.dragStartTime = 0, this.lastDragEndTime = 0, this.cookies =
|
|
1472
|
+
super(...arguments), this.open = !1, this.initialMode = "signin", this.logoUrl = "", this.baseUrl = "", this.oauthDomain = "", this.oauthRegion = "", this.oauthUserPoolId = "", this.oauthClientId = "", this.oauthRedirectUri = "", this.size = "sm", this.theme = "light", this.mode = "signin", this.resetStep = "none", this.signupStep = "form", this.isLoading = !1, this.isClosing = !1, this.isVisible = !1, this.isLoggedIn = !1, this.email = "", this.password = "", this.givenName = "", this.familyName = "", this.newPassword = "", this.confirmPassword = "", this.notice = "", this.error = "", this.errors = {}, this.otpDigits = ["", "", "", "", "", ""], this.signupOtpDigits = ["", "", "", "", "", ""], this.isDragging = !1, this.dragStartY = 0, this.dragCurrentY = 0, this.dragStartTime = 0, this.lastDragEndTime = 0, this.cookies = ne(), this.scrollPosition = 0, this.transitionDuration = 300, this.hasHandledOAuthCallback = !1, this.boundKeyHandler = (e) => {
|
|
1431
1473
|
e.key === "Escape" && this.isVisible && this.handleClose();
|
|
1432
1474
|
}, this.baseUrlErrorMessage = "Authentication service is not configured correctly. Please add an API domain or contact support.", this.handleClose = () => {
|
|
1433
1475
|
this.isClosing || !this.isVisible || (this.cleanupInlineStyles(), this.isDragging = !1, this.dragStartY = 0, this.dragCurrentY = 0, this.dragStartTime = 0, this.isClosing = !0, setTimeout(() => {
|
|
@@ -1477,7 +1519,7 @@ let g = class extends Ct {
|
|
|
1477
1519
|
getApiService() {
|
|
1478
1520
|
if (!this.hasApiBaseUrl())
|
|
1479
1521
|
throw new Error("API domain is not set");
|
|
1480
|
-
return this.apiService || (this.apiService =
|
|
1522
|
+
return this.apiService || (this.apiService = oe({
|
|
1481
1523
|
baseUrl: this.getNormalizedBaseUrl()
|
|
1482
1524
|
})), this.apiService;
|
|
1483
1525
|
}
|
|
@@ -1630,7 +1672,7 @@ let g = class extends Ct {
|
|
|
1630
1672
|
return null;
|
|
1631
1673
|
if (!this.oauthService) {
|
|
1632
1674
|
const e = this.oauthRedirectUri?.trim() ? this.oauthRedirectUri.trim() : void 0;
|
|
1633
|
-
this.oauthService =
|
|
1675
|
+
this.oauthService = ce({
|
|
1634
1676
|
domain: this.oauthDomain.trim(),
|
|
1635
1677
|
cognitoRegion: this.oauthRegion.trim(),
|
|
1636
1678
|
userPoolId: this.oauthUserPoolId.trim(),
|
|
@@ -1643,7 +1685,7 @@ let g = class extends Ct {
|
|
|
1643
1685
|
stripOAuthParamsFromUrl() {
|
|
1644
1686
|
const e = new URL(window.location.href);
|
|
1645
1687
|
let t = !1;
|
|
1646
|
-
for (const s of
|
|
1688
|
+
for (const s of ge)
|
|
1647
1689
|
e.searchParams.has(s) && (e.searchParams.delete(s), t = !0);
|
|
1648
1690
|
if (t) {
|
|
1649
1691
|
const s = e.searchParams.toString(), i = `${e.pathname}${s ? `?${s}` : ""}${e.hash}`;
|
|
@@ -1817,7 +1859,7 @@ let g = class extends Ct {
|
|
|
1817
1859
|
}
|
|
1818
1860
|
render() {
|
|
1819
1861
|
if (!this.isVisible)
|
|
1820
|
-
return
|
|
1862
|
+
return g;
|
|
1821
1863
|
const e = {
|
|
1822
1864
|
"modal-overlay": !0,
|
|
1823
1865
|
"modal-overlay--closing": this.isClosing
|
|
@@ -1828,10 +1870,10 @@ let g = class extends Ct {
|
|
|
1828
1870
|
"modal-container--dragging": this.isDragging,
|
|
1829
1871
|
[`modal-container--${this.size}`]: !0
|
|
1830
1872
|
};
|
|
1831
|
-
return
|
|
1873
|
+
return f`
|
|
1832
1874
|
<!-- Modal/Drawer -->
|
|
1833
1875
|
<div
|
|
1834
|
-
class=${
|
|
1876
|
+
class=${mt(e)}
|
|
1835
1877
|
@click=${this.handleOverlayClick}
|
|
1836
1878
|
@touchstart=${this.handleDragStart}
|
|
1837
1879
|
@touchmove=${this.handleDragMove}
|
|
@@ -1839,7 +1881,7 @@ let g = class extends Ct {
|
|
|
1839
1881
|
@mousedown=${this.handleDragStart}
|
|
1840
1882
|
>
|
|
1841
1883
|
<div
|
|
1842
|
-
class=${
|
|
1884
|
+
class=${mt(t)}
|
|
1843
1885
|
@click=${(s) => s.stopPropagation()}
|
|
1844
1886
|
role="dialog"
|
|
1845
1887
|
aria-modal="true"
|
|
@@ -1868,8 +1910,8 @@ let g = class extends Ct {
|
|
|
1868
1910
|
renderContent() {
|
|
1869
1911
|
if (!this.hasApiBaseUrl()) {
|
|
1870
1912
|
const e = this.baseUrlErrorMessage;
|
|
1871
|
-
return
|
|
1872
|
-
${this.logoUrl.length > 0 ?
|
|
1913
|
+
return f`
|
|
1914
|
+
${this.logoUrl.length > 0 ? f`
|
|
1873
1915
|
<header class="modal-header">
|
|
1874
1916
|
<div class="auth-header">
|
|
1875
1917
|
<img
|
|
@@ -1881,7 +1923,7 @@ let g = class extends Ct {
|
|
|
1881
1923
|
/>
|
|
1882
1924
|
</div>
|
|
1883
1925
|
</header>
|
|
1884
|
-
` :
|
|
1926
|
+
` : g}
|
|
1885
1927
|
|
|
1886
1928
|
<div class="modal-body">
|
|
1887
1929
|
<div class="auth-form">
|
|
@@ -1892,9 +1934,9 @@ let g = class extends Ct {
|
|
|
1892
1934
|
</div>
|
|
1893
1935
|
`;
|
|
1894
1936
|
}
|
|
1895
|
-
return this.isLoggedIn ?
|
|
1937
|
+
return this.isLoggedIn ? f`
|
|
1896
1938
|
<!-- Header -->
|
|
1897
|
-
${this.logoUrl.length > 0 ?
|
|
1939
|
+
${this.logoUrl.length > 0 ? f`
|
|
1898
1940
|
<header class="modal-header">
|
|
1899
1941
|
<div class="auth-header">
|
|
1900
1942
|
<img
|
|
@@ -1906,7 +1948,7 @@ let g = class extends Ct {
|
|
|
1906
1948
|
/>
|
|
1907
1949
|
</div>
|
|
1908
1950
|
</header>
|
|
1909
|
-
` :
|
|
1951
|
+
` : g}
|
|
1910
1952
|
|
|
1911
1953
|
<!-- Body -->
|
|
1912
1954
|
<div class="modal-body">
|
|
@@ -1917,9 +1959,9 @@ let g = class extends Ct {
|
|
|
1917
1959
|
${this.renderAlerts()}
|
|
1918
1960
|
</div>
|
|
1919
1961
|
</div>
|
|
1920
|
-
` :
|
|
1962
|
+
` : f`
|
|
1921
1963
|
<!-- Header -->
|
|
1922
|
-
${(!this.mode || this.resetStep === "none") && this.logoUrl.length > 0 && this.mode === "signin" ?
|
|
1964
|
+
${(!this.mode || this.resetStep === "none") && this.logoUrl.length > 0 && this.mode === "signin" ? f`
|
|
1923
1965
|
<header class="modal-header">
|
|
1924
1966
|
|
|
1925
1967
|
<div class="auth-header">
|
|
@@ -1932,7 +1974,7 @@ let g = class extends Ct {
|
|
|
1932
1974
|
/>
|
|
1933
1975
|
</div>
|
|
1934
1976
|
</header>
|
|
1935
|
-
` :
|
|
1977
|
+
` : g}
|
|
1936
1978
|
|
|
1937
1979
|
<!-- Body -->
|
|
1938
1980
|
<div class="modal-body">
|
|
@@ -1953,7 +1995,7 @@ let g = class extends Ct {
|
|
|
1953
1995
|
}
|
|
1954
1996
|
renderFormContent() {
|
|
1955
1997
|
if (this.resetStep === "none" && (!this.mode || this.mode === "signin" || this.signupStep === "form"))
|
|
1956
|
-
return
|
|
1998
|
+
return f`
|
|
1957
1999
|
<!-- Email -->
|
|
1958
2000
|
<label class="field">
|
|
1959
2001
|
<span class="field-label">Email Address</span>
|
|
@@ -1967,7 +2009,7 @@ let g = class extends Ct {
|
|
|
1967
2009
|
required
|
|
1968
2010
|
autocomplete="email"
|
|
1969
2011
|
/>
|
|
1970
|
-
${this.errors.email ?
|
|
2012
|
+
${this.errors.email ? f`<span class="field-error">${this.errors.email}</span>` : g}
|
|
1971
2013
|
</label>
|
|
1972
2014
|
|
|
1973
2015
|
<!-- Password -->
|
|
@@ -1982,18 +2024,18 @@ let g = class extends Ct {
|
|
|
1982
2024
|
required
|
|
1983
2025
|
autocomplete=${this.mode === "signup" ? "new-password" : "current-password"}
|
|
1984
2026
|
/>
|
|
1985
|
-
${this.errors.password ?
|
|
2027
|
+
${this.errors.password ? f`<span class="field-error">${this.errors.password}</span>` : g}
|
|
1986
2028
|
</label>
|
|
1987
2029
|
|
|
1988
|
-
${this.mode === "signin" && this.error ?
|
|
2030
|
+
${this.mode === "signin" && this.error ? f`
|
|
1989
2031
|
<div class="forgot-row">
|
|
1990
2032
|
<button type="button" class="text-btn" @click=${this.startReset}>
|
|
1991
2033
|
Forgot your password?
|
|
1992
2034
|
</button>
|
|
1993
2035
|
</div>
|
|
1994
|
-
` :
|
|
2036
|
+
` : g}
|
|
1995
2037
|
|
|
1996
|
-
${this.mode === "signup" ?
|
|
2038
|
+
${this.mode === "signup" ? f`
|
|
1997
2039
|
<!-- Confirm Password -->
|
|
1998
2040
|
<label class="field">
|
|
1999
2041
|
<span class="field-label">Confirm Password</span>
|
|
@@ -2006,7 +2048,7 @@ let g = class extends Ct {
|
|
|
2006
2048
|
required
|
|
2007
2049
|
autocomplete="new-password"
|
|
2008
2050
|
/>
|
|
2009
|
-
${this.errors.confirm_password ?
|
|
2051
|
+
${this.errors.confirm_password ? f`<span class="field-error">${this.errors.confirm_password}</span>` : g}
|
|
2010
2052
|
</label>
|
|
2011
2053
|
|
|
2012
2054
|
<!-- First Name -->
|
|
@@ -2021,7 +2063,7 @@ let g = class extends Ct {
|
|
|
2021
2063
|
required
|
|
2022
2064
|
autocomplete="given-name"
|
|
2023
2065
|
/>
|
|
2024
|
-
${this.errors.givenName ?
|
|
2066
|
+
${this.errors.givenName ? f`<span class="field-error">${this.errors.givenName}</span>` : g}
|
|
2025
2067
|
</label>
|
|
2026
2068
|
|
|
2027
2069
|
<!-- Last Name -->
|
|
@@ -2036,19 +2078,19 @@ let g = class extends Ct {
|
|
|
2036
2078
|
required
|
|
2037
2079
|
autocomplete="family-name"
|
|
2038
2080
|
/>
|
|
2039
|
-
${this.errors.familyName ?
|
|
2081
|
+
${this.errors.familyName ? f`<span class="field-error">${this.errors.familyName}</span>` : g}
|
|
2040
2082
|
</label>
|
|
2041
|
-
` :
|
|
2083
|
+
` : g}
|
|
2042
2084
|
`;
|
|
2043
2085
|
if (this.mode === "signup" && this.signupStep === "otp")
|
|
2044
|
-
return
|
|
2086
|
+
return f`
|
|
2045
2087
|
<div class="otp-section">
|
|
2046
2088
|
<label class="otp-label">Enter 6-digit code</label>
|
|
2047
2089
|
<div class="otp-inputs" role="group" aria-label="One time code">
|
|
2048
|
-
${
|
|
2090
|
+
${$t(
|
|
2049
2091
|
Array.from({ length: 6 }, (e, t) => t),
|
|
2050
2092
|
(e) => e,
|
|
2051
|
-
(e) =>
|
|
2093
|
+
(e) => f`
|
|
2052
2094
|
<input
|
|
2053
2095
|
class="otp-input signup-otp-input ${this.errors.signup_otp ? "otp-input--error" : ""}"
|
|
2054
2096
|
type="text"
|
|
@@ -2065,7 +2107,7 @@ let g = class extends Ct {
|
|
|
2065
2107
|
`
|
|
2066
2108
|
)}
|
|
2067
2109
|
</div>
|
|
2068
|
-
${this.errors.signup_otp ?
|
|
2110
|
+
${this.errors.signup_otp ? f`<p class="otp-error">${this.errors.signup_otp}</p>` : g}
|
|
2069
2111
|
</div>
|
|
2070
2112
|
<div class="forgot-row">
|
|
2071
2113
|
<button type="button" class="text-btn" @click=${this.backToSignupForm}>
|
|
@@ -2074,7 +2116,7 @@ let g = class extends Ct {
|
|
|
2074
2116
|
</div>
|
|
2075
2117
|
`;
|
|
2076
2118
|
if (this.resetStep === "request")
|
|
2077
|
-
return
|
|
2119
|
+
return f`
|
|
2078
2120
|
<label class="field">
|
|
2079
2121
|
<span class="field-label">Email Address</span>
|
|
2080
2122
|
<input
|
|
@@ -2087,7 +2129,7 @@ let g = class extends Ct {
|
|
|
2087
2129
|
required
|
|
2088
2130
|
autocomplete="email"
|
|
2089
2131
|
/>
|
|
2090
|
-
${this.errors.email ?
|
|
2132
|
+
${this.errors.email ? f`<span class="field-error">${this.errors.email}</span>` : g}
|
|
2091
2133
|
</label>
|
|
2092
2134
|
<div class="forgot-row">
|
|
2093
2135
|
<button type="button" class="text-btn" @click=${this.cancelReset}>
|
|
@@ -2097,7 +2139,7 @@ let g = class extends Ct {
|
|
|
2097
2139
|
`;
|
|
2098
2140
|
if (this.resetStep === "confirm") {
|
|
2099
2141
|
const e = this.otpDigits.every((t) => /^\d$/.test(t));
|
|
2100
|
-
return
|
|
2142
|
+
return f`
|
|
2101
2143
|
<label class="field">
|
|
2102
2144
|
<span class="field-label">Email Address</span>
|
|
2103
2145
|
<input
|
|
@@ -2109,16 +2151,16 @@ let g = class extends Ct {
|
|
|
2109
2151
|
required
|
|
2110
2152
|
autocomplete="email"
|
|
2111
2153
|
/>
|
|
2112
|
-
${this.errors.email ?
|
|
2154
|
+
${this.errors.email ? f`<span class="field-error">${this.errors.email}</span>` : g}
|
|
2113
2155
|
</label>
|
|
2114
2156
|
|
|
2115
2157
|
<div class="otp-section">
|
|
2116
2158
|
<label class="otp-label">Enter 6-digit code</label>
|
|
2117
2159
|
<div class="otp-inputs" role="group" aria-label="One time code">
|
|
2118
|
-
${
|
|
2160
|
+
${$t(
|
|
2119
2161
|
Array.from({ length: 6 }, (t, s) => s),
|
|
2120
2162
|
(t) => t,
|
|
2121
|
-
(t) =>
|
|
2163
|
+
(t) => f`
|
|
2122
2164
|
<input
|
|
2123
2165
|
class="otp-input reset-otp-input ${this.errors.otp ? "otp-input--error" : ""}"
|
|
2124
2166
|
type="text"
|
|
@@ -2135,10 +2177,10 @@ let g = class extends Ct {
|
|
|
2135
2177
|
`
|
|
2136
2178
|
)}
|
|
2137
2179
|
</div>
|
|
2138
|
-
${this.errors.otp ?
|
|
2180
|
+
${this.errors.otp ? f`<p class="otp-error">${this.errors.otp}</p>` : g}
|
|
2139
2181
|
</div>
|
|
2140
2182
|
|
|
2141
|
-
${e ?
|
|
2183
|
+
${e ? f`
|
|
2142
2184
|
<div class="new-password-fields">
|
|
2143
2185
|
<label class="field">
|
|
2144
2186
|
<span class="field-label">New Password</span>
|
|
@@ -2151,7 +2193,7 @@ let g = class extends Ct {
|
|
|
2151
2193
|
required
|
|
2152
2194
|
autocomplete="new-password"
|
|
2153
2195
|
/>
|
|
2154
|
-
${this.errors.new_password ?
|
|
2196
|
+
${this.errors.new_password ? f`<span class="field-error">${this.errors.new_password}</span>` : g}
|
|
2155
2197
|
</label>
|
|
2156
2198
|
|
|
2157
2199
|
<label class="field">
|
|
@@ -2165,10 +2207,10 @@ let g = class extends Ct {
|
|
|
2165
2207
|
required
|
|
2166
2208
|
autocomplete="new-password"
|
|
2167
2209
|
/>
|
|
2168
|
-
${this.errors.confirm_password ?
|
|
2210
|
+
${this.errors.confirm_password ? f`<span class="field-error">${this.errors.confirm_password}</span>` : g}
|
|
2169
2211
|
</label>
|
|
2170
2212
|
</div>
|
|
2171
|
-
` :
|
|
2213
|
+
` : g}
|
|
2172
2214
|
|
|
2173
2215
|
<div class="forgot-row">
|
|
2174
2216
|
<button type="button" class="text-btn" @click=${this.backToRequest}>
|
|
@@ -2177,35 +2219,35 @@ let g = class extends Ct {
|
|
|
2177
2219
|
</div>
|
|
2178
2220
|
`;
|
|
2179
2221
|
}
|
|
2180
|
-
return
|
|
2222
|
+
return g;
|
|
2181
2223
|
}
|
|
2182
2224
|
renderActions() {
|
|
2183
2225
|
if (this.resetStep === "request")
|
|
2184
|
-
return
|
|
2226
|
+
return f`
|
|
2185
2227
|
<button type="submit" class="cta" ?disabled=${this.isLoading}>
|
|
2186
2228
|
${this.isLoading ? "Sending..." : "Send Reset Code"}
|
|
2187
2229
|
</button>
|
|
2188
2230
|
`;
|
|
2189
2231
|
if (this.resetStep === "confirm")
|
|
2190
|
-
return this.otpDigits.every((t) => /^\d$/.test(t)) ?
|
|
2232
|
+
return this.otpDigits.every((t) => /^\d$/.test(t)) ? f`
|
|
2191
2233
|
<button type="submit" class="cta" ?disabled=${this.isLoading}>
|
|
2192
2234
|
${this.isLoading ? "Resetting..." : "Reset Password"}
|
|
2193
2235
|
</button>
|
|
2194
|
-
` :
|
|
2236
|
+
` : g;
|
|
2195
2237
|
if (this.mode === "signup" && this.signupStep === "otp") {
|
|
2196
2238
|
const e = this.signupOtpDigits.every((t) => /^\d$/.test(t));
|
|
2197
|
-
return
|
|
2239
|
+
return f`
|
|
2198
2240
|
<button type="submit" class="cta" ?disabled=${!e || this.isLoading}>
|
|
2199
2241
|
${this.isLoading ? "Completing..." : "Complete Registration"}
|
|
2200
2242
|
</button>
|
|
2201
2243
|
`;
|
|
2202
2244
|
}
|
|
2203
|
-
return
|
|
2245
|
+
return f`
|
|
2204
2246
|
<button type="submit" class="cta" ?disabled=${this.isLoading}>
|
|
2205
2247
|
${this.isLoading ? "Loading..." : this.mode === "signup" ? "Continue" : "Sign In"}
|
|
2206
2248
|
</button>
|
|
2207
2249
|
|
|
2208
|
-
${this.isOAuthConfigured() && this.mode === "signin" ?
|
|
2250
|
+
${this.isOAuthConfigured() && this.mode === "signin" ? f`
|
|
2209
2251
|
<div class="button-row">
|
|
2210
2252
|
<button
|
|
2211
2253
|
type="button"
|
|
@@ -2225,31 +2267,31 @@ let g = class extends Ct {
|
|
|
2225
2267
|
${this.renderAppleIcon()}
|
|
2226
2268
|
</button>
|
|
2227
2269
|
</div>
|
|
2228
|
-
` :
|
|
2270
|
+
` : g}
|
|
2229
2271
|
`;
|
|
2230
2272
|
}
|
|
2231
2273
|
renderAlerts() {
|
|
2232
|
-
return
|
|
2233
|
-
${this.notice ?
|
|
2274
|
+
return f`
|
|
2275
|
+
${this.notice ? f`
|
|
2234
2276
|
<div class="alert alert--success">
|
|
2235
2277
|
${this.notice}
|
|
2236
2278
|
<button class="alert-close" @click=${() => this.notice = ""} aria-label="Dismiss">
|
|
2237
2279
|
×
|
|
2238
2280
|
</button>
|
|
2239
2281
|
</div>
|
|
2240
|
-
` :
|
|
2241
|
-
${this.error ?
|
|
2282
|
+
` : g}
|
|
2283
|
+
${this.error ? f`
|
|
2242
2284
|
<div class="alert alert--error">
|
|
2243
2285
|
${this.error}
|
|
2244
2286
|
<button class="alert-close" @click=${() => this.error = ""} aria-label="Dismiss">
|
|
2245
2287
|
×
|
|
2246
2288
|
</button>
|
|
2247
2289
|
</div>
|
|
2248
|
-
` :
|
|
2290
|
+
` : g}
|
|
2249
2291
|
`;
|
|
2250
2292
|
}
|
|
2251
2293
|
renderFooter() {
|
|
2252
|
-
return this.isLoggedIn ?
|
|
2294
|
+
return this.isLoggedIn ? g : this.resetStep === "none" && (!this.mode || this.mode === "signin" || this.signupStep === "form") ? f`
|
|
2253
2295
|
<div class="auth-footer">
|
|
2254
2296
|
<p class="toggle-text">
|
|
2255
2297
|
${this.mode === "signup" ? "Already have an account?" : "Don't have an account?"}
|
|
@@ -2258,7 +2300,7 @@ let g = class extends Ct {
|
|
|
2258
2300
|
${this.mode === "signup" ? "Sign In" : "Sign Up"}
|
|
2259
2301
|
</button>
|
|
2260
2302
|
</div>
|
|
2261
|
-
` :
|
|
2303
|
+
` : f`
|
|
2262
2304
|
<div class="auth-footer">
|
|
2263
2305
|
<p class="toggle-text">
|
|
2264
2306
|
Having trouble? Email
|
|
@@ -2268,7 +2310,7 @@ let g = class extends Ct {
|
|
|
2268
2310
|
`;
|
|
2269
2311
|
}
|
|
2270
2312
|
renderGoogleIcon() {
|
|
2271
|
-
return
|
|
2313
|
+
return f`
|
|
2272
2314
|
<svg viewBox="-0.5 0 48 48" width="18" height="18" fill="none">
|
|
2273
2315
|
<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>
|
|
2274
2316
|
<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>
|
|
@@ -2278,7 +2320,7 @@ let g = class extends Ct {
|
|
|
2278
2320
|
`;
|
|
2279
2321
|
}
|
|
2280
2322
|
renderAppleIcon() {
|
|
2281
|
-
return
|
|
2323
|
+
return f`
|
|
2282
2324
|
<svg viewBox="-3.5 0 48 48" width="18" height="18" class="apple-icon">
|
|
2283
2325
|
<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>
|
|
2284
2326
|
</svg>
|
|
@@ -2317,121 +2359,121 @@ let g = class extends Ct {
|
|
|
2317
2359
|
}
|
|
2318
2360
|
}
|
|
2319
2361
|
};
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
],
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
],
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
],
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
],
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
],
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
],
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
],
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
],
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
],
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
],
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
],
|
|
2354
|
-
|
|
2362
|
+
m.styles = de();
|
|
2363
|
+
y([
|
|
2364
|
+
S({ type: Boolean, reflect: !0 })
|
|
2365
|
+
], m.prototype, "open", 2);
|
|
2366
|
+
y([
|
|
2367
|
+
S({ type: String, attribute: "initial-mode" })
|
|
2368
|
+
], m.prototype, "initialMode", 2);
|
|
2369
|
+
y([
|
|
2370
|
+
S({ type: String, attribute: "logo-url" })
|
|
2371
|
+
], m.prototype, "logoUrl", 2);
|
|
2372
|
+
y([
|
|
2373
|
+
S({ type: String, attribute: "api-domain" })
|
|
2374
|
+
], m.prototype, "baseUrl", 2);
|
|
2375
|
+
y([
|
|
2376
|
+
S({ type: String, attribute: "oauth-domain" })
|
|
2377
|
+
], m.prototype, "oauthDomain", 2);
|
|
2378
|
+
y([
|
|
2379
|
+
S({ type: String, attribute: "oauth-region" })
|
|
2380
|
+
], m.prototype, "oauthRegion", 2);
|
|
2381
|
+
y([
|
|
2382
|
+
S({ type: String, attribute: "oauth-user-pool-id" })
|
|
2383
|
+
], m.prototype, "oauthUserPoolId", 2);
|
|
2384
|
+
y([
|
|
2385
|
+
S({ type: String, attribute: "oauth-client-id" })
|
|
2386
|
+
], m.prototype, "oauthClientId", 2);
|
|
2387
|
+
y([
|
|
2388
|
+
S({ type: String, attribute: "oauth-redirect-uri" })
|
|
2389
|
+
], m.prototype, "oauthRedirectUri", 2);
|
|
2390
|
+
y([
|
|
2391
|
+
S({ type: String, attribute: "size" })
|
|
2392
|
+
], m.prototype, "size", 2);
|
|
2393
|
+
y([
|
|
2394
|
+
S({ type: String, attribute: "data-theme", reflect: !0 })
|
|
2395
|
+
], m.prototype, "theme", 2);
|
|
2396
|
+
y([
|
|
2355
2397
|
b()
|
|
2356
|
-
],
|
|
2357
|
-
|
|
2398
|
+
], m.prototype, "mode", 2);
|
|
2399
|
+
y([
|
|
2358
2400
|
b()
|
|
2359
|
-
],
|
|
2360
|
-
|
|
2401
|
+
], m.prototype, "resetStep", 2);
|
|
2402
|
+
y([
|
|
2361
2403
|
b()
|
|
2362
|
-
],
|
|
2363
|
-
|
|
2404
|
+
], m.prototype, "signupStep", 2);
|
|
2405
|
+
y([
|
|
2364
2406
|
b()
|
|
2365
|
-
],
|
|
2366
|
-
|
|
2407
|
+
], m.prototype, "isLoading", 2);
|
|
2408
|
+
y([
|
|
2367
2409
|
b()
|
|
2368
|
-
],
|
|
2369
|
-
|
|
2410
|
+
], m.prototype, "isClosing", 2);
|
|
2411
|
+
y([
|
|
2370
2412
|
b()
|
|
2371
|
-
],
|
|
2372
|
-
|
|
2413
|
+
], m.prototype, "isVisible", 2);
|
|
2414
|
+
y([
|
|
2373
2415
|
b()
|
|
2374
|
-
],
|
|
2375
|
-
|
|
2416
|
+
], m.prototype, "isLoggedIn", 2);
|
|
2417
|
+
y([
|
|
2376
2418
|
b()
|
|
2377
|
-
],
|
|
2378
|
-
|
|
2419
|
+
], m.prototype, "email", 2);
|
|
2420
|
+
y([
|
|
2379
2421
|
b()
|
|
2380
|
-
],
|
|
2381
|
-
|
|
2422
|
+
], m.prototype, "password", 2);
|
|
2423
|
+
y([
|
|
2382
2424
|
b()
|
|
2383
|
-
],
|
|
2384
|
-
|
|
2425
|
+
], m.prototype, "givenName", 2);
|
|
2426
|
+
y([
|
|
2385
2427
|
b()
|
|
2386
|
-
],
|
|
2387
|
-
|
|
2428
|
+
], m.prototype, "familyName", 2);
|
|
2429
|
+
y([
|
|
2388
2430
|
b()
|
|
2389
|
-
],
|
|
2390
|
-
|
|
2431
|
+
], m.prototype, "newPassword", 2);
|
|
2432
|
+
y([
|
|
2391
2433
|
b()
|
|
2392
|
-
],
|
|
2393
|
-
|
|
2434
|
+
], m.prototype, "confirmPassword", 2);
|
|
2435
|
+
y([
|
|
2394
2436
|
b()
|
|
2395
|
-
],
|
|
2396
|
-
|
|
2437
|
+
], m.prototype, "notice", 2);
|
|
2438
|
+
y([
|
|
2397
2439
|
b()
|
|
2398
|
-
],
|
|
2399
|
-
|
|
2440
|
+
], m.prototype, "error", 2);
|
|
2441
|
+
y([
|
|
2400
2442
|
b()
|
|
2401
|
-
],
|
|
2402
|
-
|
|
2443
|
+
], m.prototype, "errors", 2);
|
|
2444
|
+
y([
|
|
2403
2445
|
b()
|
|
2404
|
-
],
|
|
2405
|
-
|
|
2446
|
+
], m.prototype, "otpDigits", 2);
|
|
2447
|
+
y([
|
|
2406
2448
|
b()
|
|
2407
|
-
],
|
|
2408
|
-
|
|
2449
|
+
], m.prototype, "signupOtpDigits", 2);
|
|
2450
|
+
y([
|
|
2409
2451
|
b()
|
|
2410
|
-
],
|
|
2411
|
-
|
|
2452
|
+
], m.prototype, "isDragging", 2);
|
|
2453
|
+
y([
|
|
2412
2454
|
b()
|
|
2413
|
-
],
|
|
2414
|
-
|
|
2455
|
+
], m.prototype, "dragStartY", 2);
|
|
2456
|
+
y([
|
|
2415
2457
|
b()
|
|
2416
|
-
],
|
|
2417
|
-
|
|
2458
|
+
], m.prototype, "dragCurrentY", 2);
|
|
2459
|
+
y([
|
|
2418
2460
|
b()
|
|
2419
|
-
],
|
|
2420
|
-
|
|
2461
|
+
], m.prototype, "dragStartTime", 2);
|
|
2462
|
+
y([
|
|
2421
2463
|
b()
|
|
2422
|
-
],
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
],
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
],
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
],
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
],
|
|
2464
|
+
], m.prototype, "lastDragEndTime", 2);
|
|
2465
|
+
y([
|
|
2466
|
+
it(".modal-container")
|
|
2467
|
+
], m.prototype, "modalContainer", 2);
|
|
2468
|
+
y([
|
|
2469
|
+
it("#email-input")
|
|
2470
|
+
], m.prototype, "emailInput", 2);
|
|
2471
|
+
y([
|
|
2472
|
+
it(".modal-body")
|
|
2473
|
+
], m.prototype, "modalBody", 2);
|
|
2474
|
+
m = y([
|
|
2475
|
+
Zt("cals-auth")
|
|
2476
|
+
], m);
|
|
2435
2477
|
export {
|
|
2436
|
-
|
|
2478
|
+
m as CalsAuth
|
|
2437
2479
|
};
|