@masonitestudios/spartanauth-widgets 0.2.0 → 1.0.0
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/sa-widgets.mjs +1322 -1172
- package/dist/sa-widgets.umd.js +4 -4
- package/package.json +1 -1
package/dist/sa-widgets.mjs
CHANGED
|
@@ -1,195 +1,195 @@
|
|
|
1
|
-
const
|
|
2
|
-
equals:
|
|
1
|
+
const Vt = (e, t) => e === t, Me = {
|
|
2
|
+
equals: Vt
|
|
3
3
|
};
|
|
4
|
-
let
|
|
5
|
-
const
|
|
4
|
+
let bt = wt;
|
|
5
|
+
const we = 1, je = 2, Ct = {
|
|
6
6
|
owned: null,
|
|
7
7
|
cleanups: null,
|
|
8
8
|
context: null,
|
|
9
9
|
owner: null
|
|
10
10
|
};
|
|
11
|
-
var
|
|
12
|
-
let Ke = null,
|
|
13
|
-
function
|
|
14
|
-
const
|
|
11
|
+
var re = null;
|
|
12
|
+
let Ke = null, Kt = null, V = null, ee = null, ve = null, Je = 0;
|
|
13
|
+
function Gt(e, t) {
|
|
14
|
+
const n = V, r = re, s = e.length === 0, u = t === void 0 ? r : t, a = s ? Ct : {
|
|
15
15
|
owned: null,
|
|
16
16
|
cleanups: null,
|
|
17
17
|
context: u ? u.context : null,
|
|
18
18
|
owner: u
|
|
19
|
-
},
|
|
20
|
-
|
|
19
|
+
}, o = s ? e : () => e(() => Ve(() => Oe(a)));
|
|
20
|
+
re = a, V = null;
|
|
21
21
|
try {
|
|
22
|
-
return Pe(
|
|
22
|
+
return Pe(o, !0);
|
|
23
23
|
} finally {
|
|
24
|
-
|
|
24
|
+
V = n, re = r;
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
|
-
function
|
|
28
|
-
t = t ? Object.assign({},
|
|
29
|
-
const
|
|
27
|
+
function F(e, t) {
|
|
28
|
+
t = t ? Object.assign({}, Me, t) : Me;
|
|
29
|
+
const n = {
|
|
30
30
|
value: e,
|
|
31
31
|
observers: null,
|
|
32
32
|
observerSlots: null,
|
|
33
33
|
comparator: t.equals || void 0
|
|
34
|
-
},
|
|
35
|
-
return [
|
|
36
|
-
}
|
|
37
|
-
function
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
function
|
|
42
|
-
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
function
|
|
47
|
-
|
|
48
|
-
const
|
|
49
|
-
return
|
|
50
|
-
}
|
|
51
|
-
function
|
|
52
|
-
if (
|
|
53
|
-
const t =
|
|
54
|
-
|
|
34
|
+
}, r = (s) => (typeof s == "function" && (s = s(n.value)), At(n, s));
|
|
35
|
+
return [vt.bind(n), r];
|
|
36
|
+
}
|
|
37
|
+
function x(e, t, n) {
|
|
38
|
+
const r = et(e, t, !1, we);
|
|
39
|
+
Ie(r);
|
|
40
|
+
}
|
|
41
|
+
function Ht(e, t, n) {
|
|
42
|
+
bt = Yt;
|
|
43
|
+
const r = et(e, t, !1, we);
|
|
44
|
+
r.user = !0, ve ? ve.push(r) : Ie(r);
|
|
45
|
+
}
|
|
46
|
+
function m(e, t, n) {
|
|
47
|
+
n = n ? Object.assign({}, Me, n) : Me;
|
|
48
|
+
const r = et(e, t, !0, 0);
|
|
49
|
+
return r.observers = null, r.observerSlots = null, r.comparator = n.equals || void 0, Ie(r), vt.bind(r);
|
|
50
|
+
}
|
|
51
|
+
function Ve(e) {
|
|
52
|
+
if (V === null) return e();
|
|
53
|
+
const t = V;
|
|
54
|
+
V = null;
|
|
55
55
|
try {
|
|
56
56
|
return e();
|
|
57
57
|
} finally {
|
|
58
|
-
|
|
58
|
+
V = t;
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
|
-
function
|
|
62
|
-
|
|
61
|
+
function Qe(e) {
|
|
62
|
+
Ht(() => Ve(e));
|
|
63
63
|
}
|
|
64
|
-
function
|
|
64
|
+
function vt() {
|
|
65
65
|
if (this.sources && this.state)
|
|
66
|
-
if (this.state ===
|
|
66
|
+
if (this.state === we) Ie(this);
|
|
67
67
|
else {
|
|
68
|
-
const e =
|
|
69
|
-
|
|
68
|
+
const e = ee;
|
|
69
|
+
ee = null, Pe(() => Le(this), !1), ee = e;
|
|
70
70
|
}
|
|
71
|
-
if (
|
|
71
|
+
if (V) {
|
|
72
72
|
const e = this.observers ? this.observers.length : 0;
|
|
73
|
-
|
|
73
|
+
V.sources ? (V.sources.push(this), V.sourceSlots.push(e)) : (V.sources = [this], V.sourceSlots = [e]), this.observers ? (this.observers.push(V), this.observerSlots.push(V.sources.length - 1)) : (this.observers = [V], this.observerSlots = [V.sources.length - 1]);
|
|
74
74
|
}
|
|
75
75
|
return this.value;
|
|
76
76
|
}
|
|
77
|
-
function
|
|
78
|
-
let
|
|
79
|
-
return (!e.comparator || !e.comparator(
|
|
77
|
+
function At(e, t, n) {
|
|
78
|
+
let r = e.value;
|
|
79
|
+
return (!e.comparator || !e.comparator(r, t)) && (e.value = t, e.observers && e.observers.length && Pe(() => {
|
|
80
80
|
for (let s = 0; s < e.observers.length; s += 1) {
|
|
81
|
-
const u = e.observers[s],
|
|
82
|
-
|
|
81
|
+
const u = e.observers[s], a = Ke && Ke.running;
|
|
82
|
+
a && Ke.disposed.has(u), (a ? !u.tState : !u.state) && (u.pure ? ee.push(u) : ve.push(u), u.observers && Et(u)), a || (u.state = we);
|
|
83
83
|
}
|
|
84
|
-
if (
|
|
85
|
-
throw
|
|
84
|
+
if (ee.length > 1e6)
|
|
85
|
+
throw ee = [], new Error();
|
|
86
86
|
}, !1)), t;
|
|
87
87
|
}
|
|
88
|
-
function
|
|
88
|
+
function Ie(e) {
|
|
89
89
|
if (!e.fn) return;
|
|
90
90
|
Oe(e);
|
|
91
|
-
const t =
|
|
92
|
-
|
|
91
|
+
const t = Je;
|
|
92
|
+
Wt(
|
|
93
93
|
e,
|
|
94
94
|
e.value,
|
|
95
95
|
t
|
|
96
96
|
);
|
|
97
97
|
}
|
|
98
|
-
function
|
|
99
|
-
let
|
|
100
|
-
const s =
|
|
101
|
-
|
|
98
|
+
function Wt(e, t, n) {
|
|
99
|
+
let r;
|
|
100
|
+
const s = re, u = V;
|
|
101
|
+
V = re = e;
|
|
102
102
|
try {
|
|
103
|
-
|
|
104
|
-
} catch (
|
|
105
|
-
return e.pure && (e.state =
|
|
103
|
+
r = e.fn(t);
|
|
104
|
+
} catch (a) {
|
|
105
|
+
return e.pure && (e.state = we, e.owned && e.owned.forEach(Oe), e.owned = null), e.updatedAt = n + 1, Ft(a);
|
|
106
106
|
} finally {
|
|
107
|
-
|
|
107
|
+
V = u, re = s;
|
|
108
108
|
}
|
|
109
|
-
(!e.updatedAt || e.updatedAt <=
|
|
109
|
+
(!e.updatedAt || e.updatedAt <= n) && (e.updatedAt != null && "observers" in e ? At(e, r) : e.value = r, e.updatedAt = n);
|
|
110
110
|
}
|
|
111
|
-
function
|
|
111
|
+
function et(e, t, n, r = we, s) {
|
|
112
112
|
const u = {
|
|
113
113
|
fn: e,
|
|
114
|
-
state:
|
|
114
|
+
state: r,
|
|
115
115
|
updatedAt: null,
|
|
116
116
|
owned: null,
|
|
117
117
|
sources: null,
|
|
118
118
|
sourceSlots: null,
|
|
119
119
|
cleanups: null,
|
|
120
120
|
value: t,
|
|
121
|
-
owner:
|
|
122
|
-
context:
|
|
123
|
-
pure:
|
|
121
|
+
owner: re,
|
|
122
|
+
context: re ? re.context : null,
|
|
123
|
+
pure: n
|
|
124
124
|
};
|
|
125
|
-
return
|
|
125
|
+
return re === null || re !== Ct && (re.owned ? re.owned.push(u) : re.owned = [u]), u;
|
|
126
126
|
}
|
|
127
|
-
function
|
|
127
|
+
function Re(e) {
|
|
128
128
|
if (e.state === 0) return;
|
|
129
|
-
if (e.state ===
|
|
130
|
-
if (e.suspense &&
|
|
129
|
+
if (e.state === je) return Le(e);
|
|
130
|
+
if (e.suspense && Ve(e.suspense.inFallback)) return e.suspense.effects.push(e);
|
|
131
131
|
const t = [e];
|
|
132
|
-
for (; (e = e.owner) && (!e.updatedAt || e.updatedAt <
|
|
132
|
+
for (; (e = e.owner) && (!e.updatedAt || e.updatedAt < Je); )
|
|
133
133
|
e.state && t.push(e);
|
|
134
|
-
for (let
|
|
135
|
-
if (e = t[
|
|
136
|
-
|
|
137
|
-
else if (e.state ===
|
|
138
|
-
const
|
|
139
|
-
|
|
134
|
+
for (let n = t.length - 1; n >= 0; n--)
|
|
135
|
+
if (e = t[n], e.state === we)
|
|
136
|
+
Ie(e);
|
|
137
|
+
else if (e.state === je) {
|
|
138
|
+
const r = ee;
|
|
139
|
+
ee = null, Pe(() => Le(e, t[0]), !1), ee = r;
|
|
140
140
|
}
|
|
141
141
|
}
|
|
142
142
|
function Pe(e, t) {
|
|
143
|
-
if (
|
|
144
|
-
let
|
|
145
|
-
t || (
|
|
143
|
+
if (ee) return e();
|
|
144
|
+
let n = !1;
|
|
145
|
+
t || (ee = []), ve ? n = !0 : ve = [], Je++;
|
|
146
146
|
try {
|
|
147
|
-
const
|
|
148
|
-
return
|
|
149
|
-
} catch (
|
|
150
|
-
|
|
147
|
+
const r = e();
|
|
148
|
+
return Zt(n), r;
|
|
149
|
+
} catch (r) {
|
|
150
|
+
n || (ve = null), ee = null, Ft(r);
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
|
-
function
|
|
154
|
-
if (
|
|
155
|
-
const t =
|
|
156
|
-
|
|
153
|
+
function Zt(e) {
|
|
154
|
+
if (ee && (wt(ee), ee = null), e) return;
|
|
155
|
+
const t = ve;
|
|
156
|
+
ve = null, t.length && Pe(() => bt(t), !1);
|
|
157
157
|
}
|
|
158
|
-
function
|
|
159
|
-
for (let t = 0; t < e.length; t++)
|
|
158
|
+
function wt(e) {
|
|
159
|
+
for (let t = 0; t < e.length; t++) Re(e[t]);
|
|
160
160
|
}
|
|
161
|
-
function
|
|
162
|
-
let t,
|
|
161
|
+
function Yt(e) {
|
|
162
|
+
let t, n = 0;
|
|
163
163
|
for (t = 0; t < e.length; t++) {
|
|
164
|
-
const
|
|
165
|
-
|
|
164
|
+
const r = e[t];
|
|
165
|
+
r.user ? e[n++] = r : Re(r);
|
|
166
166
|
}
|
|
167
|
-
for (t = 0; t <
|
|
167
|
+
for (t = 0; t < n; t++) Re(e[t]);
|
|
168
168
|
}
|
|
169
|
-
function
|
|
169
|
+
function Le(e, t) {
|
|
170
170
|
e.state = 0;
|
|
171
|
-
for (let
|
|
172
|
-
const
|
|
173
|
-
if (
|
|
174
|
-
const s =
|
|
175
|
-
s ===
|
|
171
|
+
for (let n = 0; n < e.sources.length; n += 1) {
|
|
172
|
+
const r = e.sources[n];
|
|
173
|
+
if (r.sources) {
|
|
174
|
+
const s = r.state;
|
|
175
|
+
s === we ? r !== t && (!r.updatedAt || r.updatedAt < Je) && Re(r) : s === je && Le(r, t);
|
|
176
176
|
}
|
|
177
177
|
}
|
|
178
178
|
}
|
|
179
|
-
function
|
|
179
|
+
function Et(e) {
|
|
180
180
|
for (let t = 0; t < e.observers.length; t += 1) {
|
|
181
|
-
const
|
|
182
|
-
|
|
181
|
+
const n = e.observers[t];
|
|
182
|
+
n.state || (n.state = je, n.pure ? ee.push(n) : ve.push(n), n.observers && Et(n));
|
|
183
183
|
}
|
|
184
184
|
}
|
|
185
185
|
function Oe(e) {
|
|
186
186
|
let t;
|
|
187
187
|
if (e.sources)
|
|
188
188
|
for (; e.sources.length; ) {
|
|
189
|
-
const
|
|
189
|
+
const n = e.sources.pop(), r = e.sourceSlots.pop(), s = n.observers;
|
|
190
190
|
if (s && s.length) {
|
|
191
|
-
const u = s.pop(),
|
|
192
|
-
|
|
191
|
+
const u = s.pop(), a = n.observerSlots.pop();
|
|
192
|
+
r < s.length && (u.sourceSlots[a] = r, s[r] = u, n.observerSlots[r] = a);
|
|
193
193
|
}
|
|
194
194
|
}
|
|
195
195
|
if (e.tOwned) {
|
|
@@ -206,93 +206,93 @@ function Oe(e) {
|
|
|
206
206
|
}
|
|
207
207
|
e.state = 0;
|
|
208
208
|
}
|
|
209
|
-
function
|
|
209
|
+
function Xt(e) {
|
|
210
210
|
return e instanceof Error ? e : new Error(typeof e == "string" ? e : "Unknown error", {
|
|
211
211
|
cause: e
|
|
212
212
|
});
|
|
213
213
|
}
|
|
214
|
-
function Ft(e, t =
|
|
215
|
-
throw
|
|
214
|
+
function Ft(e, t = re) {
|
|
215
|
+
throw Xt(e);
|
|
216
216
|
}
|
|
217
|
-
function
|
|
218
|
-
let
|
|
219
|
-
for (;
|
|
220
|
-
if (t[
|
|
221
|
-
|
|
217
|
+
function Qt(e, t, n) {
|
|
218
|
+
let r = n.length, s = t.length, u = r, a = 0, o = 0, A = t[s - 1].nextSibling, $ = null;
|
|
219
|
+
for (; a < s || o < u; ) {
|
|
220
|
+
if (t[a] === n[o]) {
|
|
221
|
+
a++, o++;
|
|
222
222
|
continue;
|
|
223
223
|
}
|
|
224
|
-
for (; t[s - 1] ===
|
|
224
|
+
for (; t[s - 1] === n[u - 1]; )
|
|
225
225
|
s--, u--;
|
|
226
|
-
if (s ===
|
|
227
|
-
const
|
|
228
|
-
for (;
|
|
229
|
-
} else if (u ===
|
|
230
|
-
for (;
|
|
231
|
-
(
|
|
232
|
-
else if (t[
|
|
233
|
-
const
|
|
234
|
-
e.insertBefore(
|
|
226
|
+
if (s === a) {
|
|
227
|
+
const h = u < r ? o ? n[o - 1].nextSibling : n[u - o] : A;
|
|
228
|
+
for (; o < u; ) e.insertBefore(n[o++], h);
|
|
229
|
+
} else if (u === o)
|
|
230
|
+
for (; a < s; )
|
|
231
|
+
(!$ || !$.has(t[a])) && t[a].remove(), a++;
|
|
232
|
+
else if (t[a] === n[u - 1] && n[o] === t[s - 1]) {
|
|
233
|
+
const h = t[--s].nextSibling;
|
|
234
|
+
e.insertBefore(n[o++], t[a++].nextSibling), e.insertBefore(n[--u], h), t[s] = n[u];
|
|
235
235
|
} else {
|
|
236
|
-
if (
|
|
237
|
-
|
|
238
|
-
let
|
|
239
|
-
for (;
|
|
236
|
+
if (!$) {
|
|
237
|
+
$ = /* @__PURE__ */ new Map();
|
|
238
|
+
let _ = o;
|
|
239
|
+
for (; _ < u; ) $.set(n[_], _++);
|
|
240
240
|
}
|
|
241
|
-
const
|
|
242
|
-
if (
|
|
243
|
-
if (
|
|
244
|
-
let
|
|
245
|
-
for (; ++
|
|
246
|
-
|
|
247
|
-
if (
|
|
248
|
-
const
|
|
249
|
-
for (;
|
|
250
|
-
} else e.replaceChild(
|
|
251
|
-
} else
|
|
252
|
-
else t[
|
|
241
|
+
const h = $.get(t[a]);
|
|
242
|
+
if (h != null)
|
|
243
|
+
if (o < h && h < u) {
|
|
244
|
+
let _ = a, te = 1, se;
|
|
245
|
+
for (; ++_ < s && _ < u && !((se = $.get(t[_])) == null || se !== h + te); )
|
|
246
|
+
te++;
|
|
247
|
+
if (te > h - o) {
|
|
248
|
+
const De = t[a];
|
|
249
|
+
for (; o < h; ) e.insertBefore(n[o++], De);
|
|
250
|
+
} else e.replaceChild(n[o++], t[a++]);
|
|
251
|
+
} else a++;
|
|
252
|
+
else t[a++].remove();
|
|
253
253
|
}
|
|
254
254
|
}
|
|
255
255
|
}
|
|
256
|
-
const
|
|
257
|
-
function
|
|
256
|
+
const at = "_$DX_DELEGATE";
|
|
257
|
+
function y(e, t, n, r) {
|
|
258
258
|
let s;
|
|
259
259
|
const u = () => {
|
|
260
|
-
const
|
|
261
|
-
return
|
|
262
|
-
},
|
|
263
|
-
return
|
|
260
|
+
const o = document.createElement("template");
|
|
261
|
+
return o.innerHTML = e, o.content.firstChild;
|
|
262
|
+
}, a = () => (s || (s = u())).cloneNode(!0);
|
|
263
|
+
return a.cloneNode = a, a;
|
|
264
264
|
}
|
|
265
|
-
function
|
|
266
|
-
const
|
|
267
|
-
for (let
|
|
268
|
-
const u = e[
|
|
269
|
-
|
|
265
|
+
function tt(e, t = window.document) {
|
|
266
|
+
const n = t[at] || (t[at] = /* @__PURE__ */ new Set());
|
|
267
|
+
for (let r = 0, s = e.length; r < s; r++) {
|
|
268
|
+
const u = e[r];
|
|
269
|
+
n.has(u) || (n.add(u), t.addEventListener(u, en));
|
|
270
270
|
}
|
|
271
271
|
}
|
|
272
|
-
function
|
|
273
|
-
|
|
272
|
+
function le(e, t, n) {
|
|
273
|
+
n == null ? e.removeAttribute(t) : e.setAttribute(t, n);
|
|
274
274
|
}
|
|
275
|
-
function
|
|
276
|
-
return
|
|
275
|
+
function yt(e, t, n) {
|
|
276
|
+
return Ve(() => e(t, n));
|
|
277
277
|
}
|
|
278
|
-
function d(e, t,
|
|
279
|
-
if (
|
|
280
|
-
|
|
278
|
+
function d(e, t, n, r) {
|
|
279
|
+
if (n !== void 0 && !r && (r = []), typeof t != "function") return qe(e, t, r, n);
|
|
280
|
+
x((s) => qe(e, t(), s, n), r);
|
|
281
281
|
}
|
|
282
|
-
function
|
|
282
|
+
function en(e) {
|
|
283
283
|
let t = e.target;
|
|
284
|
-
const
|
|
284
|
+
const n = `$$${e.type}`, r = e.target, s = e.currentTarget, u = (A) => Object.defineProperty(e, "target", {
|
|
285
285
|
configurable: !0,
|
|
286
|
-
value:
|
|
287
|
-
}),
|
|
288
|
-
const
|
|
289
|
-
if (
|
|
290
|
-
const
|
|
291
|
-
if (
|
|
286
|
+
value: A
|
|
287
|
+
}), a = () => {
|
|
288
|
+
const A = t[n];
|
|
289
|
+
if (A && !t.disabled) {
|
|
290
|
+
const $ = t[`${n}Data`];
|
|
291
|
+
if ($ !== void 0 ? A.call(t, $, e) : A.call(t, e), e.cancelBubble) return;
|
|
292
292
|
}
|
|
293
293
|
return t.host && typeof t.host != "string" && !t.host._$host && t.contains(e.target) && u(t.host), !0;
|
|
294
|
-
},
|
|
295
|
-
for (;
|
|
294
|
+
}, o = () => {
|
|
295
|
+
for (; a() && (t = t._$host || t.parentNode || t.host); ) ;
|
|
296
296
|
};
|
|
297
297
|
if (Object.defineProperty(e, "currentTarget", {
|
|
298
298
|
configurable: !0,
|
|
@@ -300,138 +300,138 @@ function Zt(e) {
|
|
|
300
300
|
return t || document;
|
|
301
301
|
}
|
|
302
302
|
}), e.composedPath) {
|
|
303
|
-
const
|
|
304
|
-
u(
|
|
305
|
-
for (let
|
|
303
|
+
const A = e.composedPath();
|
|
304
|
+
u(A[0]);
|
|
305
|
+
for (let $ = 0; $ < A.length - 2 && (t = A[$], !!a()); $++) {
|
|
306
306
|
if (t._$host) {
|
|
307
|
-
t = t._$host,
|
|
307
|
+
t = t._$host, o();
|
|
308
308
|
break;
|
|
309
309
|
}
|
|
310
310
|
if (t.parentNode === s)
|
|
311
311
|
break;
|
|
312
312
|
}
|
|
313
|
-
} else
|
|
314
|
-
u(
|
|
315
|
-
}
|
|
316
|
-
function
|
|
317
|
-
for (; typeof
|
|
318
|
-
if (t ===
|
|
319
|
-
const u = typeof t,
|
|
320
|
-
if (e =
|
|
321
|
-
if (u === "number" && (t = t.toString(), t ===
|
|
322
|
-
return
|
|
323
|
-
if (
|
|
324
|
-
let
|
|
325
|
-
|
|
313
|
+
} else o();
|
|
314
|
+
u(r);
|
|
315
|
+
}
|
|
316
|
+
function qe(e, t, n, r, s) {
|
|
317
|
+
for (; typeof n == "function"; ) n = n();
|
|
318
|
+
if (t === n) return n;
|
|
319
|
+
const u = typeof t, a = r !== void 0;
|
|
320
|
+
if (e = a && n[0] && n[0].parentNode || e, u === "string" || u === "number") {
|
|
321
|
+
if (u === "number" && (t = t.toString(), t === n))
|
|
322
|
+
return n;
|
|
323
|
+
if (a) {
|
|
324
|
+
let o = n[0];
|
|
325
|
+
o && o.nodeType === 3 ? o.data !== t && (o.data = t) : o = document.createTextNode(t), n = ke(e, n, r, o);
|
|
326
326
|
} else
|
|
327
|
-
|
|
327
|
+
n !== "" && typeof n == "string" ? n = e.firstChild.data = t : n = e.textContent = t;
|
|
328
328
|
} else if (t == null || u === "boolean")
|
|
329
|
-
|
|
329
|
+
n = ke(e, n, r);
|
|
330
330
|
else {
|
|
331
331
|
if (u === "function")
|
|
332
|
-
return
|
|
333
|
-
let
|
|
334
|
-
for (; typeof
|
|
335
|
-
|
|
336
|
-
}), () =>
|
|
332
|
+
return x(() => {
|
|
333
|
+
let o = t();
|
|
334
|
+
for (; typeof o == "function"; ) o = o();
|
|
335
|
+
n = qe(e, o, n, r);
|
|
336
|
+
}), () => n;
|
|
337
337
|
if (Array.isArray(t)) {
|
|
338
|
-
const
|
|
339
|
-
if (
|
|
340
|
-
return
|
|
341
|
-
if (
|
|
342
|
-
if (
|
|
343
|
-
} else
|
|
344
|
-
|
|
338
|
+
const o = [], A = n && Array.isArray(n);
|
|
339
|
+
if (Ze(o, t, n, s))
|
|
340
|
+
return x(() => n = qe(e, o, n, r, !0)), () => n;
|
|
341
|
+
if (o.length === 0) {
|
|
342
|
+
if (n = ke(e, n, r), a) return n;
|
|
343
|
+
} else A ? n.length === 0 ? ot(e, o, r) : Qt(e, n, o) : (n && ke(e), ot(e, o));
|
|
344
|
+
n = o;
|
|
345
345
|
} else if (t.nodeType) {
|
|
346
|
-
if (Array.isArray(
|
|
347
|
-
if (
|
|
348
|
-
|
|
349
|
-
} else
|
|
350
|
-
|
|
346
|
+
if (Array.isArray(n)) {
|
|
347
|
+
if (a) return n = ke(e, n, r, t);
|
|
348
|
+
ke(e, n, null, t);
|
|
349
|
+
} else n == null || n === "" || !e.firstChild ? e.appendChild(t) : e.replaceChild(t, e.firstChild);
|
|
350
|
+
n = t;
|
|
351
351
|
}
|
|
352
352
|
}
|
|
353
|
-
return
|
|
353
|
+
return n;
|
|
354
354
|
}
|
|
355
|
-
function
|
|
355
|
+
function Ze(e, t, n, r) {
|
|
356
356
|
let s = !1;
|
|
357
|
-
for (let u = 0,
|
|
358
|
-
let
|
|
359
|
-
if (!(
|
|
360
|
-
e.push(
|
|
361
|
-
else if (Array.isArray(
|
|
362
|
-
s =
|
|
363
|
-
else if (
|
|
364
|
-
if (
|
|
365
|
-
for (; typeof
|
|
366
|
-
s =
|
|
357
|
+
for (let u = 0, a = t.length; u < a; u++) {
|
|
358
|
+
let o = t[u], A = n && n[e.length], $;
|
|
359
|
+
if (!(o == null || o === !0 || o === !1)) if (($ = typeof o) == "object" && o.nodeType)
|
|
360
|
+
e.push(o);
|
|
361
|
+
else if (Array.isArray(o))
|
|
362
|
+
s = Ze(e, o, A) || s;
|
|
363
|
+
else if ($ === "function")
|
|
364
|
+
if (r) {
|
|
365
|
+
for (; typeof o == "function"; ) o = o();
|
|
366
|
+
s = Ze(
|
|
367
367
|
e,
|
|
368
|
-
Array.isArray(
|
|
369
|
-
Array.isArray(
|
|
368
|
+
Array.isArray(o) ? o : [o],
|
|
369
|
+
Array.isArray(A) ? A : [A]
|
|
370
370
|
) || s;
|
|
371
371
|
} else
|
|
372
|
-
e.push(
|
|
372
|
+
e.push(o), s = !0;
|
|
373
373
|
else {
|
|
374
|
-
const
|
|
375
|
-
|
|
374
|
+
const h = String(o);
|
|
375
|
+
A && A.nodeType === 3 && A.data === h ? e.push(A) : e.push(document.createTextNode(h));
|
|
376
376
|
}
|
|
377
377
|
}
|
|
378
378
|
return s;
|
|
379
379
|
}
|
|
380
|
-
function
|
|
381
|
-
for (let
|
|
380
|
+
function ot(e, t, n = null) {
|
|
381
|
+
for (let r = 0, s = t.length; r < s; r++) e.insertBefore(t[r], n);
|
|
382
382
|
}
|
|
383
|
-
function
|
|
384
|
-
if (
|
|
385
|
-
const s =
|
|
383
|
+
function ke(e, t, n, r) {
|
|
384
|
+
if (n === void 0) return e.textContent = "";
|
|
385
|
+
const s = r || document.createTextNode("");
|
|
386
386
|
if (t.length) {
|
|
387
387
|
let u = !1;
|
|
388
|
-
for (let
|
|
389
|
-
const
|
|
390
|
-
if (s !==
|
|
391
|
-
const
|
|
392
|
-
!u && !
|
|
388
|
+
for (let a = t.length - 1; a >= 0; a--) {
|
|
389
|
+
const o = t[a];
|
|
390
|
+
if (s !== o) {
|
|
391
|
+
const A = o.parentNode === e;
|
|
392
|
+
!u && !a ? A ? e.replaceChild(s, o) : e.insertBefore(s, n) : A && o.remove();
|
|
393
393
|
} else u = !0;
|
|
394
394
|
}
|
|
395
|
-
} else e.insertBefore(s,
|
|
395
|
+
} else e.insertBefore(s, n);
|
|
396
396
|
return [s];
|
|
397
397
|
}
|
|
398
|
-
function
|
|
399
|
-
return Object.keys(e).reduce((
|
|
400
|
-
const s = e[
|
|
401
|
-
return r
|
|
398
|
+
function tn(e) {
|
|
399
|
+
return Object.keys(e).reduce((n, r) => {
|
|
400
|
+
const s = e[r];
|
|
401
|
+
return n[r] = Object.assign({}, s), Bt(s.value) && !an(s.value) && !Array.isArray(s.value) && (n[r].value = Object.assign({}, s.value)), Array.isArray(s.value) && (n[r].value = s.value.slice(0)), n;
|
|
402
402
|
}, {});
|
|
403
403
|
}
|
|
404
|
-
function
|
|
405
|
-
return e ? Object.keys(e).reduce((
|
|
406
|
-
const s = e[
|
|
407
|
-
return r
|
|
404
|
+
function nn(e) {
|
|
405
|
+
return e ? Object.keys(e).reduce((n, r) => {
|
|
406
|
+
const s = e[r];
|
|
407
|
+
return n[r] = Bt(s) && "value" in s ? s : {
|
|
408
408
|
value: s
|
|
409
|
-
}, r
|
|
409
|
+
}, n[r].attribute || (n[r].attribute = un(r)), n[r].parse = "parse" in n[r] ? n[r].parse : typeof n[r].value != "string", n;
|
|
410
410
|
}, {}) : {};
|
|
411
411
|
}
|
|
412
|
-
function
|
|
413
|
-
return Object.keys(e).reduce((
|
|
412
|
+
function rn(e) {
|
|
413
|
+
return Object.keys(e).reduce((n, r) => (n[r] = e[r].value, n), {});
|
|
414
414
|
}
|
|
415
|
-
function
|
|
416
|
-
const
|
|
415
|
+
function sn(e, t) {
|
|
416
|
+
const n = tn(t);
|
|
417
417
|
return Object.keys(t).forEach((s) => {
|
|
418
|
-
const u =
|
|
419
|
-
|
|
418
|
+
const u = n[s], a = e.getAttribute(u.attribute), o = e[s];
|
|
419
|
+
a != null && (u.value = u.parse ? $t(a) : a), o != null && (u.value = Array.isArray(o) ? o.slice(0) : o), u.reflect && lt(e, u.attribute, u.value, !!u.parse), Object.defineProperty(e, s, {
|
|
420
420
|
get() {
|
|
421
421
|
return u.value;
|
|
422
422
|
},
|
|
423
|
-
set(
|
|
424
|
-
const
|
|
425
|
-
u.value =
|
|
426
|
-
for (let
|
|
427
|
-
this.__propertyChangedCallbacks[
|
|
423
|
+
set(A) {
|
|
424
|
+
const $ = u.value;
|
|
425
|
+
u.value = A, u.reflect && lt(this, u.attribute, u.value, !!u.parse);
|
|
426
|
+
for (let h = 0, _ = this.__propertyChangedCallbacks.length; h < _; h++)
|
|
427
|
+
this.__propertyChangedCallbacks[h](s, A, $);
|
|
428
428
|
},
|
|
429
429
|
enumerable: !0,
|
|
430
430
|
configurable: !0
|
|
431
431
|
});
|
|
432
|
-
}),
|
|
432
|
+
}), n;
|
|
433
433
|
}
|
|
434
|
-
function
|
|
434
|
+
function $t(e) {
|
|
435
435
|
if (e)
|
|
436
436
|
try {
|
|
437
437
|
return JSON.parse(e);
|
|
@@ -439,45 +439,45 @@ function wt(e) {
|
|
|
439
439
|
return e;
|
|
440
440
|
}
|
|
441
441
|
}
|
|
442
|
-
function
|
|
443
|
-
if (
|
|
444
|
-
let s =
|
|
442
|
+
function lt(e, t, n, r) {
|
|
443
|
+
if (n == null || n === !1) return e.removeAttribute(t);
|
|
444
|
+
let s = r ? JSON.stringify(n) : n;
|
|
445
445
|
e.__updating[t] = !0, s === "true" && (s = ""), e.setAttribute(t, s), Promise.resolve().then(() => delete e.__updating[t]);
|
|
446
446
|
}
|
|
447
|
-
function
|
|
448
|
-
return e.replace(/\.?([A-Z]+)/g, (t,
|
|
447
|
+
function un(e) {
|
|
448
|
+
return e.replace(/\.?([A-Z]+)/g, (t, n) => "-" + n.toLowerCase()).replace("_", "-").replace(/^-/, "");
|
|
449
449
|
}
|
|
450
|
-
function
|
|
450
|
+
function Bt(e) {
|
|
451
451
|
return e != null && (typeof e == "object" || typeof e == "function");
|
|
452
452
|
}
|
|
453
|
-
function
|
|
453
|
+
function an(e) {
|
|
454
454
|
return Object.prototype.toString.call(e) === "[object Function]";
|
|
455
455
|
}
|
|
456
|
-
function
|
|
456
|
+
function on(e) {
|
|
457
457
|
return typeof e == "function" && e.toString().indexOf("class") === 0;
|
|
458
458
|
}
|
|
459
459
|
let Ge;
|
|
460
|
-
function
|
|
461
|
-
const
|
|
460
|
+
function ln(e, t) {
|
|
461
|
+
const n = Object.keys(t);
|
|
462
462
|
return class extends e {
|
|
463
463
|
static get observedAttributes() {
|
|
464
|
-
return
|
|
464
|
+
return n.map((s) => t[s].attribute);
|
|
465
465
|
}
|
|
466
466
|
constructor() {
|
|
467
467
|
super(), this.__initialized = !1, this.__released = !1, this.__releaseCallbacks = [], this.__propertyChangedCallbacks = [], this.__updating = {}, this.props = {};
|
|
468
468
|
}
|
|
469
469
|
connectedCallback() {
|
|
470
470
|
if (this.__initialized) return;
|
|
471
|
-
this.__releaseCallbacks = [], this.__propertyChangedCallbacks = [], this.__updating = {}, this.props =
|
|
472
|
-
const s =
|
|
471
|
+
this.__releaseCallbacks = [], this.__propertyChangedCallbacks = [], this.__updating = {}, this.props = sn(this, t);
|
|
472
|
+
const s = rn(this.props), u = this.Component, a = Ge;
|
|
473
473
|
try {
|
|
474
|
-
Ge = this, this.__initialized = !0,
|
|
474
|
+
Ge = this, this.__initialized = !0, on(u) ? new u(s, {
|
|
475
475
|
element: this
|
|
476
476
|
}) : u(s, {
|
|
477
477
|
element: this
|
|
478
478
|
});
|
|
479
479
|
} finally {
|
|
480
|
-
Ge =
|
|
480
|
+
Ge = a;
|
|
481
481
|
}
|
|
482
482
|
}
|
|
483
483
|
async disconnectedCallback() {
|
|
@@ -487,15 +487,15 @@ function sr(e, t) {
|
|
|
487
487
|
for (; s = this.__releaseCallbacks.pop(); ) s(this);
|
|
488
488
|
delete this.__initialized, this.__released = !0;
|
|
489
489
|
}
|
|
490
|
-
attributeChangedCallback(s, u,
|
|
490
|
+
attributeChangedCallback(s, u, a) {
|
|
491
491
|
if (this.__initialized && !this.__updating[s] && (s = this.lookupProp(s), s in t)) {
|
|
492
|
-
if (
|
|
493
|
-
this[s] = t[s].parse ?
|
|
492
|
+
if (a == null && !this[s]) return;
|
|
493
|
+
this[s] = t[s].parse ? $t(a) : a;
|
|
494
494
|
}
|
|
495
495
|
}
|
|
496
496
|
lookupProp(s) {
|
|
497
497
|
if (t)
|
|
498
|
-
return
|
|
498
|
+
return n.find((u) => s === u || s === t[u].attribute);
|
|
499
499
|
}
|
|
500
500
|
get renderRoot() {
|
|
501
501
|
return this.shadowRoot || this.attachShadow({
|
|
@@ -510,92 +510,92 @@ function sr(e, t) {
|
|
|
510
510
|
}
|
|
511
511
|
};
|
|
512
512
|
}
|
|
513
|
-
function
|
|
513
|
+
function cn(e, t = {}, n = {}) {
|
|
514
514
|
const {
|
|
515
|
-
BaseElement:
|
|
515
|
+
BaseElement: r = HTMLElement,
|
|
516
516
|
extension: s,
|
|
517
517
|
customElements: u = window.customElements
|
|
518
|
-
} =
|
|
519
|
-
return (
|
|
518
|
+
} = n;
|
|
519
|
+
return (a) => {
|
|
520
520
|
if (!e) throw new Error("tag is required to register a Component");
|
|
521
|
-
let
|
|
522
|
-
return
|
|
521
|
+
let o = u.get(e);
|
|
522
|
+
return o ? (o.prototype.Component = a, o) : (o = ln(r, nn(t)), o.prototype.Component = a, o.prototype.registeredTag = e, u.define(e, o, s), o);
|
|
523
523
|
};
|
|
524
524
|
}
|
|
525
|
-
function
|
|
526
|
-
const t = Object.keys(e),
|
|
527
|
-
for (let
|
|
528
|
-
const [s, u] =
|
|
529
|
-
Object.defineProperty(
|
|
525
|
+
function dn(e) {
|
|
526
|
+
const t = Object.keys(e), n = {};
|
|
527
|
+
for (let r = 0; r < t.length; r++) {
|
|
528
|
+
const [s, u] = F(e[t[r]]);
|
|
529
|
+
Object.defineProperty(n, t[r], {
|
|
530
530
|
get: s,
|
|
531
|
-
set(
|
|
532
|
-
u(() =>
|
|
531
|
+
set(a) {
|
|
532
|
+
u(() => a);
|
|
533
533
|
}
|
|
534
534
|
});
|
|
535
535
|
}
|
|
536
|
-
return
|
|
536
|
+
return n;
|
|
537
537
|
}
|
|
538
|
-
function
|
|
538
|
+
function fn(e) {
|
|
539
539
|
if (e.assignedSlot && e.assignedSlot._$owner) return e.assignedSlot._$owner;
|
|
540
540
|
let t = e.parentNode;
|
|
541
541
|
for (; t && !t._$owner && !(t.assignedSlot && t.assignedSlot._$owner); )
|
|
542
542
|
t = t.parentNode;
|
|
543
543
|
return t && t.assignedSlot ? t.assignedSlot._$owner : e._$owner;
|
|
544
544
|
}
|
|
545
|
-
function
|
|
546
|
-
return (t,
|
|
547
|
-
const { element:
|
|
548
|
-
return
|
|
549
|
-
const u =
|
|
550
|
-
|
|
551
|
-
|
|
545
|
+
function hn(e) {
|
|
546
|
+
return (t, n) => {
|
|
547
|
+
const { element: r } = n;
|
|
548
|
+
return Gt((s) => {
|
|
549
|
+
const u = dn(t);
|
|
550
|
+
r.addPropertyChangedCallback((o, A) => u[o] = A), r.addReleaseCallback(() => {
|
|
551
|
+
r.renderRoot.textContent = "", s();
|
|
552
552
|
});
|
|
553
|
-
const
|
|
554
|
-
return d(
|
|
555
|
-
},
|
|
553
|
+
const a = e(u, n);
|
|
554
|
+
return d(r.renderRoot, a);
|
|
555
|
+
}, fn(r));
|
|
556
556
|
};
|
|
557
557
|
}
|
|
558
|
-
function
|
|
559
|
-
return arguments.length === 2 && (
|
|
558
|
+
function nt(e, t, n) {
|
|
559
|
+
return arguments.length === 2 && (n = t, t = {}), cn(e, t)(hn(n));
|
|
560
560
|
}
|
|
561
|
-
var
|
|
562
|
-
let
|
|
561
|
+
var Dn = "٠١٢٣٤٥٦٧٨٩", pn = "۰۱۲۳۴۵۶۷۸۹", gn = "൦൧൨൩൪൫൬൭൮൯", mn = "೦೧೨೩೪೫೬೭೮೯", bn = "໐໑໒໓໔໕໖໗໘໙", Cn = "୦୧୨୩୪୫୬୭୮୯", vn = "០១២៣៤៥៦៧៨៩", An = "߀߁߂߃߄߅߆߇߈߉", wn = "੦੧੨੩੪੫੬੭੮੯", En = "૦૧૨૩૪૫૬૭૮૯", Fn = "०१२३४५६७८९", yn = "၀၁၂၃၄၅၆၇၈၉", $n = "௦௧௨௩௪௫௬௭௮௯", Bn = "౦౧౨౩౪౫౬౭౮౯", kn = "๐๑๒๓๔๕๖๗๘๙", xn = "༠༡༢༣༤༥༦༧༨༩", ct = { ar: Dn, fa: pn, ml: gn, kn: mn, lo: bn, or: Cn, kh: vn, nqo: An, pa: wn, gu: En, hi: Fn, my: yn, ta: $n, te: Bn, th: kn, bo: xn }, _n = ["ru"], Sn = ["id"], Tn = ["id"], On = ["ady-cyrl"], In = ["aeb-arab"], Pn = ["sq"], zn = ["ru"], Nn = ["zh-hant"], Mn = ["es"], jn = ["hi"], Rn = ["es"], Ln = ["ar"], qn = ["ar"], Un = ["ar"], Jn = ["es"], Vn = ["fr"], Kn = ["ru"], Gn = ["fr", "es", "ru"], Hn = ["hi"], Wn = ["es"], Zn = ["fa"], Yn = ["ru"], Xn = ["id"], Qn = ["de"], er = ["bbc-latn"], tr = ["fa"], nr = ["fa"], rr = ["bho"], sr = ["en"], ur = ["id"], ir = ["fr"], ar = ["bn"], or = ["fa"], lr = ["fr"], cr = ["id"], dr = ["id"], fr = ["ru"], hr = ["oc"], Dr = ["nan", "zh-hant"], pr = ["ru"], gr = ["it"], mr = ["crh-latn"], br = ["sk"], Cr = ["pl"], vr = ["ru"], Ar = ["hsb", "de"], wr = ["ms"], Er = ["ne"], Fr = ["it"], yr = ["it"], $r = ["es"], Br = ["fr"], kr = ["fi"], xr = ["fr"], _r = ["fr"], Sr = ["de"], Tr = ["it"], Or = ["tr"], Ir = ["gan-hant", "zh-hant", "zh-hans"], Pr = ["fr"], zr = ["pt"], Nr = ["fa"], Mr = ["es"], jr = ["gom-deva"], Rr = ["id"], Lr = ["de"], qr = ["es"], Ur = ["zh-hant"], Jr = ["hif-latn"], Vr = ["de"], Kr = ["dsb", "de"], Gr = ["fr"], Hr = ["hy"], Wr = ["zh-cn", "zh-hans"], Zr = ["ru"], Yr = ["eo"], Xr = ["ike-cans"], Qr = ["en"], es = ["da"], ts = ["id"], ns = ["kk-latn", "kk-cyrl"], rs = ["fr"], ss = ["kbd-cyrl"], us = ["fr"], is = ["ur"], as = ["tr"], os = ["my"], ls = ["kk-cyrl"], cs = ["da"], ds = ["ru"], fs = ["ru"], hs = ["fi"], Ds = ["ks-arab"], ps = ["de"], gs = ["ku-latn"], ms = ["ru"], bs = ["ru"], Cs = ["es"], vs = ["de"], As = ["ru"], ws = ["ru", "az"], Es = ["nl"], Fs = ["it"], ys = ["et"], $s = ["fa"], Bs = ["it", "rm", "fur"], ks = ["pms", "eml", "lij", "vec", "it"], xs = ["fr"], _s = ["fa"], Ss = ["lv"], Ts = ["fa"], Os = ["zh-hant"], Is = ["tr"], Ps = ["id"], zs = ["hi"], Ns = ["myv", "ru"], Ms = ["fr"], js = ["mrj", "ru"], Rs = ["id"], Ls = ["my"], qs = ["ro"], Us = ["mhr", "ru"], Js = ["pt"], Vs = ["mdf", "ru"], Ks = ["fa"], Gs = ["es"], Hs = ["cdo", "zh-hant"], Ws = ["it"], Zs = ["nn"], Ys = ["de"], Xs = ["id"], Qs = ["nb"], eu = ["fr"], tu = ["ca", "fr"], nu = ["fi"], ru = ["ru"], su = ["fr"], uu = ["de"], iu = ["de"], au = ["de"], ou = ["en"], lu = ["it"], cu = ["el"], du = ["pt-br"], fu = ["qug", "es"], hu = ["qu", "es"], Du = ["it"], pu = ["ro"], gu = ["uk", "ru"], mu = ["ro"], bu = ["ruq-latn", "ro"], Cu = ["hi"], vu = ["ru"], Au = ["it"], wu = ["en"], Eu = ["it"], Fu = ["cbk", "fa"], yu = ["fr"], $u = ["fr"], Bu = ["lt"], ku = ["bs", "sr-el", "hr"], xu = ["fr"], _u = ["shy-latn"], Su = ["cs"], Tu = ["skr-arab"], Ou = ["de"], Iu = ["fi"], Pu = ["sr-ec"], zu = ["nl"], Nu = ["de"], Mu = ["ru"], ju = ["id"], Ru = ["pl"], Lu = ["zh-tw", "zh-hant", "zh-hans"], qu = ["zh-tw", "zh-hant", "zh-hans"], Uu = ["kn"], Ju = ["pt"], Vu = ["tg-cyrl"], Ku = ["zh-tw", "zh-hant", "zh-hans"], Gu = ["tt-cyrl", "ru"], Hu = ["fr"], Wu = ["ru"], Zu = ["ru"], Yu = ["ug-arab"], Xu = ["it"], Qu = ["et"], ei = ["nl"], ti = ["de"], ni = ["fi"], ri = ["et"], si = ["fr"], ui = ["fr"], ii = ["zh-hans"], ai = ["ru"], oi = ["ka"], li = ["he"], ci = ["zh-hans"], di = ["nl"], fi = ["kab"], hi = ["zh-hans"], kt = { ab: _n, abs: Sn, ace: Tn, ady: On, aeb: In, "aeb-arab": ["ar"], aln: Pn, alt: zn, ami: Nn, an: Mn, anp: jn, arn: Rn, arq: Ln, ary: qn, arz: Un, ast: Jn, atj: Vn, av: Kn, avk: Gn, awa: Hn, ay: Wn, azb: Zn, ba: Yn, ban: Xn, "ban-bali": ["ban"], bar: Qn, bbc: er, "bbc-latn": ["id"], bcc: tr, "be-tarask": ["be"], bgn: nr, bh: rr, bi: sr, bjn: ur, bm: ir, bpy: ar, bqi: or, br: lr, btm: cr, bug: dr, bxr: fr, ca: hr, "cbk-zam": ["es"], cdo: Dr, ce: pr, co: gr, crh: mr, "crh-cyrl": ["ru"], cs: br, csb: Cr, cv: vr, "de-at": ["de"], "de-ch": ["de"], "de-formal": ["de"], dsb: Ar, dtp: wr, dty: Er, egl: Fr, eml: yr, "en-ca": ["en"], "en-gb": ["en"], "es-419": ["es"], "es-formal": ["es"], ext: $r, ff: Br, fit: kr, frc: xr, frp: _r, frr: Sr, fur: Tr, gag: Or, gan: Ir, "gan-hans": ["zh-hans"], "gan-hant": ["zh-hant", "zh-hans"], gcr: Pr, gl: zr, glk: Nr, gn: Mr, gom: jr, "gom-deva": ["hi"], gor: Rr, gsw: Lr, guc: qr, hak: Ur, hif: Jr, hrx: Vr, hsb: Kr, ht: Gr, "hu-formal": ["hu"], hyw: Hr, ii: Wr, inh: Zr, io: Yr, iu: Xr, jam: Qr, jut: es, jv: ts, kaa: ns, kab: rs, kbd: ss, kbp: us, khw: is, kiu: as, kjp: os, kk: ls, "kk-arab": ["kk-cyrl"], "kk-cn": ["kk-arab", "kk-cyrl"], "kk-kz": ["kk-cyrl"], "kk-latn": ["kk-cyrl"], "kk-tr": ["kk-latn", "kk-cyrl"], kl: cs, "ko-kp": ["ko"], koi: ds, krc: fs, krl: hs, ks: Ds, ksh: ps, ku: gs, "ku-arab": ["ckb"], kum: ms, kv: bs, lad: Cs, lb: vs, lbe: As, lez: ws, li: Es, lij: Fs, liv: ys, lki: $s, lld: Bs, lmo: ks, ln: xs, lrc: _s, ltg: Ss, luz: Ts, lzh: Os, lzz: Is, mad: Ps, mai: zs, "map-bms": ["jv", "id"], mdf: Ns, mg: Ms, mhr: js, min: Rs, mnw: Ls, mo: qs, mrj: Us, "ms-arab": ["ms"], mwl: Js, myv: Vs, mzn: Ks, nah: Gs, nan: Hs, nap: Ws, nb: Zs, nds: Ys, "nds-nl": ["nl"], nia: Xs, "nl-informal": ["nl"], nn: Qs, nrm: eu, oc: tu, olo: nu, os: ru, pcd: su, pdc: uu, pdt: iu, pfl: au, pih: ou, pms: lu, pnt: cu, pt: du, "pt-br": ["pt"], qu: fu, qug: hu, rgn: Du, rmy: pu, "roa-tara": ["it"], rue: gu, rup: mu, ruq: bu, "ruq-cyrl": ["mk"], "ruq-latn": ["ro"], sa: Cu, sah: vu, scn: Au, sco: wu, sdc: Eu, sdh: Fu, ses: yu, sg: $u, sgs: Bu, sh: ku, shi: xu, shy: _u, "shy-latn": ["fr"], sk: Su, skr: Tu, "skr-arab": ["ur", "pnb"], sli: Ou, smn: Iu, sr: Pu, srn: zu, stq: Nu, sty: Mu, su: ju, szl: Ru, szy: Lu, tay: qu, tcy: Uu, tet: Ju, tg: Vu, trv: Ku, tt: Gu, "tt-cyrl": ["ru"], ty: Hu, tyv: Wu, udm: Zu, ug: Yu, vec: Xu, vep: Qu, vls: ei, vmf: ti, vot: ni, vro: ri, wa: si, wo: ui, wuu: ii, xal: ai, xmf: oi, yi: li, za: ci, zea: di, zgh: fi, zh: hi, "zh-cn": ["zh-hans"], "zh-hant": ["zh-hans"], "zh-hk": ["zh-hant", "zh-hans"], "zh-mo": ["zh-hk", "zh-hant", "zh-hans"], "zh-my": ["zh-sg", "zh-hans"], "zh-sg": ["zh-hans"], "zh-tw": ["zh-hant", "zh-hans"] };
|
|
562
|
+
let ae = class {
|
|
563
563
|
constructor(e) {
|
|
564
564
|
this.locale = e;
|
|
565
565
|
}
|
|
566
566
|
convertPlural(e, t) {
|
|
567
|
-
const
|
|
567
|
+
const n = /\d+=/i;
|
|
568
568
|
if (!t || t.length === 0) return "";
|
|
569
569
|
for (let s = 0; s < t.length; s++) {
|
|
570
570
|
const u = t[s];
|
|
571
|
-
if (
|
|
571
|
+
if (n.test(u)) {
|
|
572
572
|
if (parseInt(u.slice(0, u.indexOf("=")), 10) === e) return u.slice(u.indexOf("=") + 1);
|
|
573
573
|
t[s] = void 0;
|
|
574
574
|
}
|
|
575
575
|
}
|
|
576
576
|
t = t.filter((s) => !!s);
|
|
577
|
-
let
|
|
578
|
-
return
|
|
577
|
+
let r = this.getPluralForm(e, this.locale);
|
|
578
|
+
return r = Math.min(r, t.length - 1), t[r];
|
|
579
579
|
}
|
|
580
580
|
getPluralForm(e, t) {
|
|
581
|
-
const
|
|
582
|
-
return
|
|
581
|
+
const n = ["zero", "one", "two", "few", "many", "other"], r = new Intl.PluralRules(t), s = r.resolvedOptions().pluralCategories, u = r.select(e);
|
|
582
|
+
return n.filter((a) => s.includes(a)).indexOf(u);
|
|
583
583
|
}
|
|
584
584
|
convertNumber(e, t = !1) {
|
|
585
|
-
let
|
|
585
|
+
let n = this.digitTransformTable(this.locale), r = "";
|
|
586
586
|
if (t) {
|
|
587
|
-
if (parseFloat(e, 10) === e || !
|
|
587
|
+
if (parseFloat(e, 10) === e || !n) return e;
|
|
588
588
|
const s = [];
|
|
589
|
-
for (const
|
|
590
|
-
|
|
589
|
+
for (const a in n) s[n[a]] = a;
|
|
590
|
+
n = s;
|
|
591
591
|
const u = String(e);
|
|
592
|
-
for (let
|
|
593
|
-
return parseFloat(
|
|
592
|
+
for (let a = 0; a < u.length; a++) r += n[u[a]] || u[a];
|
|
593
|
+
return parseFloat(r, 10);
|
|
594
594
|
}
|
|
595
595
|
if (Intl.NumberFormat) {
|
|
596
596
|
let s;
|
|
597
|
-
const u = [
|
|
598
|
-
return Intl.NumberFormat.supportedLocalesOf(this.locale).length ? s = [this.locale] : s = u,
|
|
597
|
+
const u = [...kt[this.locale] || [], "en"];
|
|
598
|
+
return Intl.NumberFormat.supportedLocalesOf(this.locale).length ? s = [this.locale] : s = u, r = new Intl.NumberFormat(s).format(e), r === "NaN" && (r = e), r;
|
|
599
599
|
}
|
|
600
600
|
}
|
|
601
601
|
convertGrammar(e) {
|
|
@@ -607,9 +607,9 @@ let ue = class {
|
|
|
607
607
|
return e === "male" ? t[0] : e === "female" ? t[1] : t.length === 3 ? t[2] : t[0];
|
|
608
608
|
}
|
|
609
609
|
digitTransformTable(e) {
|
|
610
|
-
return
|
|
610
|
+
return ct[e] ? ct[e].split("") : !1;
|
|
611
611
|
}
|
|
612
|
-
},
|
|
612
|
+
}, Di = class extends ae {
|
|
613
613
|
convertGrammar(e, t) {
|
|
614
614
|
switch (t) {
|
|
615
615
|
case "prefixed":
|
|
@@ -618,9 +618,9 @@ let ue = class {
|
|
|
618
618
|
}
|
|
619
619
|
return e;
|
|
620
620
|
}
|
|
621
|
-
},
|
|
622
|
-
convertGrammar(t,
|
|
623
|
-
switch (
|
|
621
|
+
}, pi = class extends ae {
|
|
622
|
+
convertGrammar(t, n) {
|
|
623
|
+
switch (n) {
|
|
624
624
|
case "instrumental":
|
|
625
625
|
t = "s " + t;
|
|
626
626
|
break;
|
|
@@ -630,7 +630,7 @@ let ue = class {
|
|
|
630
630
|
}
|
|
631
631
|
return t;
|
|
632
632
|
}
|
|
633
|
-
},
|
|
633
|
+
}, gi = class extends ae {
|
|
634
634
|
convertGrammar(e, t) {
|
|
635
635
|
switch (t) {
|
|
636
636
|
case "instrumental":
|
|
@@ -642,7 +642,7 @@ let ue = class {
|
|
|
642
642
|
}
|
|
643
643
|
return e;
|
|
644
644
|
}
|
|
645
|
-
},
|
|
645
|
+
}, mi = class extends ae {
|
|
646
646
|
convertGrammar(e, t) {
|
|
647
647
|
switch (t) {
|
|
648
648
|
case "instrumental":
|
|
@@ -654,40 +654,40 @@ let ue = class {
|
|
|
654
654
|
}
|
|
655
655
|
return e;
|
|
656
656
|
}
|
|
657
|
-
},
|
|
657
|
+
}, bi = class extends ae {
|
|
658
658
|
convertGrammar(e, t) {
|
|
659
|
-
let
|
|
660
|
-
const
|
|
661
|
-
switch (e.match(/wiki$/i) && (
|
|
659
|
+
let n = e.match(/[aou][^äöy]*$/i);
|
|
660
|
+
const r = e;
|
|
661
|
+
switch (e.match(/wiki$/i) && (n = !1), e.match(/[bcdfghjklmnpqrstvwxz]$/i) && (e += "i"), t) {
|
|
662
662
|
case "genitive":
|
|
663
663
|
e += "n";
|
|
664
664
|
break;
|
|
665
665
|
case "elative":
|
|
666
|
-
e +=
|
|
666
|
+
e += n ? "sta" : "stä";
|
|
667
667
|
break;
|
|
668
668
|
case "partitive":
|
|
669
|
-
e +=
|
|
669
|
+
e += n ? "a" : "ä";
|
|
670
670
|
break;
|
|
671
671
|
case "illative":
|
|
672
672
|
e += e.slice(-1) + "n";
|
|
673
673
|
break;
|
|
674
674
|
case "inessive":
|
|
675
|
-
e +=
|
|
675
|
+
e += n ? "ssa" : "ssä";
|
|
676
676
|
break;
|
|
677
677
|
default:
|
|
678
|
-
e =
|
|
678
|
+
e = r;
|
|
679
679
|
break;
|
|
680
680
|
}
|
|
681
681
|
return e;
|
|
682
682
|
}
|
|
683
|
-
},
|
|
683
|
+
}, Ci = class extends ae {
|
|
684
684
|
convertGrammar(e, t) {
|
|
685
685
|
return t === "genitive" && (e.slice(-1) === "ь" ? e = e.slice(0, -1) + "я" : e.slice(-2) === "ия" ? e = e.slice(0, -2) + "ии" : e.slice(-2) === "ка" ? e = e.slice(0, -2) + "ки" : e.slice(-2) === "ти" ? e = e.slice(0, -2) + "тей" : e.slice(-2) === "ды" ? e = e.slice(0, -2) + "дов" : e.slice(-3) === "ник" && (e = e.slice(0, -3) + "ника")), e;
|
|
686
686
|
}
|
|
687
687
|
};
|
|
688
|
-
class
|
|
689
|
-
convertGrammar(t,
|
|
690
|
-
switch (
|
|
688
|
+
class vi extends ae {
|
|
689
|
+
convertGrammar(t, n) {
|
|
690
|
+
switch (n) {
|
|
691
691
|
case "mestnik":
|
|
692
692
|
t = "o " + t;
|
|
693
693
|
break;
|
|
@@ -698,7 +698,7 @@ class gi extends ue {
|
|
|
698
698
|
return t;
|
|
699
699
|
}
|
|
700
700
|
}
|
|
701
|
-
let
|
|
701
|
+
let Ai = class extends ae {
|
|
702
702
|
convertGrammar(e, t) {
|
|
703
703
|
switch (t) {
|
|
704
704
|
case "genitive":
|
|
@@ -714,12 +714,12 @@ let mi = class extends ue {
|
|
|
714
714
|
return e;
|
|
715
715
|
}
|
|
716
716
|
};
|
|
717
|
-
class
|
|
718
|
-
convertGrammar(t,
|
|
719
|
-
return
|
|
717
|
+
class wi extends ae {
|
|
718
|
+
convertGrammar(t, n) {
|
|
719
|
+
return n === "genitive" && (t.slice(-1) === "ա" ? t = t.slice(0, -1) + "այի" : t.slice(-1) === "ո" ? t = t.slice(0, -1) + "ոյի" : t.slice(-4) === "գիրք" ? t = t.slice(0, -4) + "գրքի" : t = t + "ի"), t;
|
|
720
720
|
}
|
|
721
721
|
}
|
|
722
|
-
let
|
|
722
|
+
let Ei = class extends ae {
|
|
723
723
|
convertGrammar(e, t) {
|
|
724
724
|
if (t === "ainmlae") switch (e) {
|
|
725
725
|
case "an Domhnach":
|
|
@@ -746,7 +746,7 @@ let Ci = class extends ue {
|
|
|
746
746
|
}
|
|
747
747
|
return e;
|
|
748
748
|
}
|
|
749
|
-
},
|
|
749
|
+
}, Fi = class extends ae {
|
|
750
750
|
convertGrammar(e, t) {
|
|
751
751
|
switch (t) {
|
|
752
752
|
case "rol":
|
|
@@ -761,27 +761,27 @@ let Ci = class extends ue {
|
|
|
761
761
|
}
|
|
762
762
|
return e;
|
|
763
763
|
}
|
|
764
|
-
},
|
|
764
|
+
}, yi = class extends ae {
|
|
765
765
|
convertGrammar(e, t) {
|
|
766
|
-
let
|
|
767
|
-
switch (
|
|
766
|
+
let n, r, s, u;
|
|
767
|
+
switch (n = "мæ", r = "", s = "", u = "", e.match(/тæ$/i) ? (e = e.slice(0, -1), n = "æм") : e.match(/[аæеёиоыэюя]$/i) ? r = "й" : e.match(/у$/i) ? e.slice(-2, -1).match(/[аæеёиоыэюя]$/i) || (r = "й") : e.match(/[бвгджзйклмнопрстфхцчшщьъ]$/i) || (s = "-"), t) {
|
|
768
768
|
case "genitive":
|
|
769
|
-
u = s +
|
|
769
|
+
u = s + r + "ы";
|
|
770
770
|
break;
|
|
771
771
|
case "dative":
|
|
772
|
-
u = s +
|
|
772
|
+
u = s + r + "æн";
|
|
773
773
|
break;
|
|
774
774
|
case "allative":
|
|
775
|
-
u = s +
|
|
775
|
+
u = s + n;
|
|
776
776
|
break;
|
|
777
777
|
case "ablative":
|
|
778
|
-
|
|
778
|
+
r === "й" ? u = s + r + "æ" : u = s + r + "æй";
|
|
779
779
|
break;
|
|
780
780
|
case "superessive":
|
|
781
|
-
u = s +
|
|
781
|
+
u = s + r + "ыл";
|
|
782
782
|
break;
|
|
783
783
|
case "equative":
|
|
784
|
-
u = s +
|
|
784
|
+
u = s + r + "ау";
|
|
785
785
|
break;
|
|
786
786
|
case "comitative":
|
|
787
787
|
u = s + "имæ";
|
|
@@ -790,9 +790,9 @@ let Ci = class extends ue {
|
|
|
790
790
|
return e + u;
|
|
791
791
|
}
|
|
792
792
|
};
|
|
793
|
-
class
|
|
794
|
-
convertGrammar(t,
|
|
795
|
-
switch (
|
|
793
|
+
class $i extends ae {
|
|
794
|
+
convertGrammar(t, n) {
|
|
795
|
+
switch (n) {
|
|
796
796
|
case "genitive":
|
|
797
797
|
t.slice(-1) === "ь" ? t = t.slice(0, -1) + "я" : t.slice(-2) === "ія" ? t = t.slice(0, -2) + "ії" : t.slice(-2) === "ка" ? t = t.slice(0, -2) + "ки" : t.slice(-2) === "ти" ? t = t.slice(0, -2) + "тей" : t.slice(-2) === "ды" ? t = t.slice(0, -2) + "дов" : t.slice(-3) === "ник" && (t = t.slice(0, -3) + "ника");
|
|
798
798
|
break;
|
|
@@ -803,346 +803,346 @@ class Fi extends ue {
|
|
|
803
803
|
return t;
|
|
804
804
|
}
|
|
805
805
|
}
|
|
806
|
-
var
|
|
807
|
-
const
|
|
808
|
-
let
|
|
806
|
+
var dt = { bs: pi, default: ae, dsb: gi, fi: bi, ga: Ei, he: Di, hsb: mi, hu: Fi, hy: wi, la: Ai, os: yi, ru: Ci, sl: vi, uk: $i };
|
|
807
|
+
const Bi = new RegExp("(?:([A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁːˑˠ-ˤˮͰ-ͳͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-҂Ҋ-ԯԱ-Ֆՙ-՟ա-և։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ঀংঃঅ-ঌএঐও-নপ-রলশ-হঽ-ীেৈোৌৎৗড়ঢ়য়-ৡ০-ৱ৴-৺ਃਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਾ-ੀਖ਼-ੜਫ਼੦-੯ੲ-ੴઃઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽ-ીૉોૌૐૠૡ૦-૰ૹଂଃଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽାୀେୈୋୌୗଡ଼ଢ଼ୟ-ୡ୦-୷ஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹாிுூெ-ைொ-ௌௐௗ௦-௲ఁ-ఃఅ-ఌఎ-ఐఒ-నప-హఽు-ౄౘ-ౚౠౡ౦-౯౿ಂಃಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽ-ೄೆ-ೈೊೋೕೖೞೠೡ೦-೯ೱೲംഃഅ-ഌഎ-ഐഒ-ഺഽ-ീെ-ൈൊ-ൌൎൗൟ-ൡ൦-൵൹-ൿංඃඅ-ඖක-නඳ-රලව-ෆා-ෑෘ-ෟ෦-෯ෲ-෴ก-ะาำเ-ๆ๏-๛ກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆ໐-໙ໜ-ໟༀ-༗༚-༴༶༸༾-ཇཉ-ཬཿ྅ྈ-ྌ྾-࿅࿇-࿌࿎-࿚က-ာေးျြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃႄႇ-ႌႎ-ႜ႞-ჅჇჍა-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚ፠-፼ᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙿᚁ-ᚚᚠ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱ᜵᜶ᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳាើ-ៅះៈ។-៚ៜ០-៩᠐-᠙ᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᤣ-ᤦᤩ-ᤫᤰᤱᤳ-ᤸ᥆-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉ᧐-᧚ᨀ-ᨖᨙᨚ᨞-ᩕᩗᩡᩣᩤᩭ-ᩲ᪀-᪉᪐-᪙᪠-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-ᭋ᭐-᭪᭴-᭼ᮂ-ᮡᮦᮧ᮪ᮮ-ᯥᯧᯪ-ᯬᯮ᯲᯳᯼-ᰫᰴᰵ᰻-᱉ᱍ-᱿᳀-᳇᳓᳡ᳩ-ᳬᳮ-ᳳᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯ⵰ⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〮〯〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎ㆐-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㋾㌀-㍶㍻-㏝㏠-㏾㐀-䶵一-鿕ꀀ-ꒌꓐ-ꘌꘐ-ꘫꙀ-ꙮꚀ-ꚝꚠ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꞭꞰ-ꞷꟷ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꣽ꤀-ꤥ꤮-ꥆꥒ꥓꥟-ꥼꦃ-ꦲꦴꦵꦺꦻꦽ-꧍ꧏ-꧙꧞-ꧤꧦ-ꧾꨀ-ꨨꨯꨰꨳꨴꩀ-ꩂꩄ-ꩋꩍ꩐-꩙꩜-ꩻꩽ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫫꫮ-ꫵꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭥꭰ-ꯤꯦꯧꯩ-꯬꯰-꯹가-힣ힰ-ퟆퟋ-ퟻ-舘並-龎ff-stﬓ-ﬗA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]|\uD800[\uDC00-\uDC0B]|\uD800[\uDC0D-\uDC26]|\uD800[\uDC28-\uDC3A]|𐀼|𐀽|\uD800[\uDC3F-\uDC4D]|\uD800[\uDC50-\uDC5D]|\uD800[\uDC80-\uDCFA]|𐄀|𐄂|\uD800[\uDD07-\uDD33]|\uD800[\uDD37-\uDD3F]|\uD800[\uDDD0-\uDDFC]|\uD800[\uDE80-\uDE9C]|\uD800[\uDEA0-\uDED0]|\uD800[\uDF00-\uDF23]|\uD800[\uDF30-\uDF4A]|\uD800[\uDF50-\uDF75]|\uD800[\uDF80-\uDF9D]|\uD800[\uDF9F-\uDFC3]|\uD800[\uDFC8-\uDFD5]|\uD801[\uDC00-\uDC9D]|\uD801[\uDCA0-\uDCA9]|\uD801[\uDD00-\uDD27]|\uD801[\uDD30-\uDD63]|𐕯|\uD801[\uDE00-\uDF36]|\uD801[\uDF40-\uDF55]|\uD801[\uDF60-\uDF67]|𑀀|\uD804[\uDC02-\uDC37]|\uD804[\uDC47-\uDC4D]|\uD804[\uDC66-\uDC6F]|\uD804[\uDC82-\uDCB2]|𑂷|𑂸|\uD804[\uDCBB-\uDCC1]|\uD804[\uDCD0-\uDCE8]|\uD804[\uDCF0-\uDCF9]|\uD804[\uDD03-\uDD26]|𑄬|\uD804[\uDD36-\uDD43]|\uD804[\uDD50-\uDD72]|\uD804[\uDD74-\uDD76]|\uD804[\uDD82-\uDDB5]|\uD804[\uDDBF-\uDDC9]|𑇍|\uD804[\uDDD0-\uDDDF]|\uD804[\uDDE1-\uDDF4]|\uD804[\uDE00-\uDE11]|\uD804[\uDE13-\uDE2E]|𑈲|𑈳|𑈵|\uD804[\uDE38-\uDE3D]|\uD804[\uDE80-\uDE86]|𑊈|\uD804[\uDE8A-\uDE8D]|\uD804[\uDE8F-\uDE9D]|\uD804[\uDE9F-\uDEA9]|\uD804[\uDEB0-\uDEDE]|\uD804[\uDEE0-\uDEE2]|\uD804[\uDEF0-\uDEF9]|𑌂|𑌃|\uD804[\uDF05-\uDF0C]|𑌏|𑌐|\uD804[\uDF13-\uDF28]|\uD804[\uDF2A-\uDF30]|𑌲|𑌳|\uD804[\uDF35-\uDF39]|\uD804[\uDF3D-\uDF3F]|\uD804[\uDF41-\uDF44]|𑍇|𑍈|\uD804[\uDF4B-\uDF4D]|𑍐|𑍗|\uD804[\uDF5D-\uDF63]|\uD805[\uDC80-\uDCB2]|𑒹|\uD805[\uDCBB-\uDCBE]|𑓁|\uD805[\uDCC4-\uDCC7]|\uD805[\uDCD0-\uDCD9]|\uD805[\uDD80-\uDDB1]|\uD805[\uDDB8-\uDDBB]|𑖾|\uD805[\uDDC1-\uDDDB]|\uD805[\uDE00-\uDE32]|𑘻|𑘼|𑘾|\uD805[\uDE41-\uDE44]|\uD805[\uDE50-\uDE59]|\uD805[\uDE80-\uDEAA]|𑚬|𑚮|𑚯|𑚶|\uD805[\uDEC0-\uDEC9]|\uD805[\uDF00-\uDF19]|𑜠|𑜡|𑜦|\uD805[\uDF30-\uDF3F]|\uD806[\uDCA0-\uDCF2]|𑣿|\uD806[\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E]|\uD809[\uDC70-\uDC74]|\uD809[\uDC80-\uDD43]|\uD80C[\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38]|\uD81A[\uDE40-\uDE5E]|\uD81A[\uDE60-\uDE69]|𖩮|𖩯|\uD81A[\uDED0-\uDEED]|𖫵|\uD81A[\uDF00-\uDF2F]|\uD81A[\uDF37-\uDF45]|\uD81A[\uDF50-\uDF59]|\uD81A[\uDF5B-\uDF61]|\uD81A[\uDF63-\uDF77]|\uD81A[\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44]|\uD81B[\uDF50-\uDF7E]|\uD81B[\uDF93-\uDF9F]|𛀀|𛀁|\uD82F[\uDC00-\uDC6A]|\uD82F[\uDC70-\uDC7C]|\uD82F[\uDC80-\uDC88]|\uD82F[\uDC90-\uDC99]|𛲜|𛲟|\uD834[\uDC00-\uDCF5]|\uD834[\uDD00-\uDD26]|\uD834[\uDD29-\uDD66]|\uD834[\uDD6A-\uDD72]|𝆃|𝆄|\uD834[\uDD8C-\uDDA9]|\uD834[\uDDAE-\uDDE8]|\uD834[\uDF60-\uDF71]|\uD835[\uDC00-\uDC54]|\uD835[\uDC56-\uDC9C]|𝒞|𝒟|𝒢|𝒥|𝒦|\uD835[\uDCA9-\uDCAC]|\uD835[\uDCAE-\uDCB9]|𝒻|\uD835[\uDCBD-\uDCC3]|\uD835[\uDCC5-\uDD05]|\uD835[\uDD07-\uDD0A]|\uD835[\uDD0D-\uDD14]|\uD835[\uDD16-\uDD1C]|\uD835[\uDD1E-\uDD39]|\uD835[\uDD3B-\uDD3E]|\uD835[\uDD40-\uDD44]|𝕆|\uD835[\uDD4A-\uDD50]|\uD835[\uDD52-\uDEA5]|\uD835[\uDEA8-\uDEDA]|\uD835[\uDEDC-\uDF14]|\uD835[\uDF16-\uDF4E]|\uD835[\uDF50-\uDF88]|\uD835[\uDF8A-\uDFC2]|\uD835[\uDFC4-\uDFCB]|\uD836[\uDC00-\uDDFF]|\uD836[\uDE37-\uDE3A]|\uD836[\uDE6D-\uDE74]|\uD836[\uDE76-\uDE83]|\uD836[\uDE85-\uDE8B]|\uD83C[\uDD10-\uDD2E]|\uD83C[\uDD30-\uDD69]|\uD83C[\uDD70-\uDD9A]|\uD83C[\uDDE6-\uDE02]|\uD83C[\uDE10-\uDE3A]|\uD83C[\uDE40-\uDE48]|🉐|🉑|[\uD840-\uD868][\uDC00-\uDFFF]|\uD869[\uDC00-\uDED6]|\uD869[\uDF00-\uDFFF]|[\uD86A-\uD86C][\uDC00-\uDFFF]|\uD86D[\uDC00-\uDF34]|\uD86D[\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D]|\uD86E[\uDC20-\uDFFF]|[\uD86F-\uD872][\uDC00-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|[\uDB80-\uDBBE][\uDC00-\uDFFF]|\uDBBF[\uDC00-\uDFFD]|[\uDBC0-\uDBFE][\uDC00-\uDFFF]|\uDBFF[\uDC00-\uDFFD])|([־׀׃׆-߀-ߪߴߵߺ-ࠕࠚࠤࠨ-ࡘ-࢟יִײַ-ﬨשׁ-ﭏ؈؋؍؛-ي٭-ٯٱ-ەۥۦۮۯۺ-ܐܒ-ܯ-ޥޱ-ࢠ-ﭐ-ﴽ﵀-﷏ﷰ-﷼﷾﷿ﹰ-]|\uD802[\uDC00-\uDD1E]|\uD802[\uDD20-\uDE00]||\uD802[\uDE07-\uDE0B]|\uD802[\uDE10-\uDE37]|\uD802[\uDE3B-\uDE3E]|\uD802[\uDE40-\uDEE4]|\uD802[\uDEE7-\uDF38]|\uD802[\uDF40-\uDFFF]|\uD803[\uDC00-\uDE5F]|\uD803[\uDE7F-\uDFFF]|\uD83A[\uDC00-\uDCCF]|\uD83A[\uDCD7-\uDFFF]|\uD83B[\uDC00-\uDDFF]|\uD83B[\uDF00-\uDFFF]|\uD83B[\uDF00-\uDFFF]|\uD83B[\uDF00-\uDFFF]|\uD83B[\uDF00-\uDFFF]|\uD83B[\uDF00-\uDFFF]|\uD83B[\uDF00-\uDFFF]|\uD83B[\uDF00-\uDFFF]|\uD83B[\uDF00-\uDFFF]|\uD83B[\uDF00-\uDFFF]|\uD83B[\uDF00-\uDFFF]|\uD83B[\uDF00-\uDFFF]|\uD83B[\uDF00-\uDFFF]|\uD83B[\uDF00-\uDFFF]|\uD83B[\uDE00-\uDEEF]|\uD83B[\uDEF2-\uDEFF]))");
|
|
808
|
+
let xt = class {
|
|
809
809
|
constructor(e) {
|
|
810
|
-
this.locale =
|
|
810
|
+
this.locale = xe(e), this.language = new (dt[this.locale] || dt.default)(this.locale);
|
|
811
811
|
}
|
|
812
812
|
emit(e, t) {
|
|
813
|
-
let
|
|
813
|
+
let n, r, s;
|
|
814
814
|
switch (typeof e) {
|
|
815
815
|
case "string":
|
|
816
816
|
case "number":
|
|
817
|
-
|
|
817
|
+
n = e;
|
|
818
818
|
break;
|
|
819
819
|
case "object":
|
|
820
|
-
if (
|
|
820
|
+
if (r = e.slice(1).map((u) => this.emit(u, t)), s = e[0].toLowerCase(), typeof this[s] == "function") n = this[s](r, t);
|
|
821
821
|
else throw new Error('unknown operation "' + s + '"');
|
|
822
822
|
break;
|
|
823
823
|
case "undefined":
|
|
824
|
-
|
|
824
|
+
n = "";
|
|
825
825
|
break;
|
|
826
826
|
default:
|
|
827
827
|
throw new Error("unexpected type in AST: " + typeof e);
|
|
828
828
|
}
|
|
829
|
-
return
|
|
829
|
+
return n;
|
|
830
830
|
}
|
|
831
831
|
concat(e) {
|
|
832
832
|
let t = "";
|
|
833
|
-
return e.forEach((
|
|
834
|
-
t +=
|
|
833
|
+
return e.forEach((n) => {
|
|
834
|
+
t += n;
|
|
835
835
|
}), t;
|
|
836
836
|
}
|
|
837
837
|
replace(e, t) {
|
|
838
|
-
const
|
|
839
|
-
return
|
|
838
|
+
const n = parseInt(e[0], 10);
|
|
839
|
+
return n < t.length ? t[n] : "$" + (n + 1);
|
|
840
840
|
}
|
|
841
841
|
plural(e) {
|
|
842
|
-
const t = parseFloat(this.language.convertNumber(e[0], 10)),
|
|
843
|
-
return
|
|
842
|
+
const t = parseFloat(this.language.convertNumber(e[0], 10)), n = e.slice(1);
|
|
843
|
+
return n.length ? this.language.convertPlural(t, n) : "";
|
|
844
844
|
}
|
|
845
845
|
gender(e) {
|
|
846
|
-
const t = e[0],
|
|
847
|
-
return this.language.gender(t,
|
|
846
|
+
const t = e[0], n = e.slice(1);
|
|
847
|
+
return this.language.gender(t, n);
|
|
848
848
|
}
|
|
849
849
|
grammar(e) {
|
|
850
|
-
const t = e[0],
|
|
851
|
-
return
|
|
850
|
+
const t = e[0], n = e[1];
|
|
851
|
+
return n && t && this.language.convertGrammar(n, t);
|
|
852
852
|
}
|
|
853
853
|
wikilink(e) {
|
|
854
|
-
let t,
|
|
855
|
-
|
|
856
|
-
const
|
|
857
|
-
return e.length === 1 ? t =
|
|
854
|
+
let t, n = e[0];
|
|
855
|
+
n.charAt(0) === ":" && (n = n.slice(1));
|
|
856
|
+
const r = `./${n}`;
|
|
857
|
+
return e.length === 1 ? t = n : t = e[1], `<a href="${r}" title="${n}">${t}</a>`;
|
|
858
858
|
}
|
|
859
859
|
extlink(e) {
|
|
860
860
|
if (e.length !== 2) throw new Error("Expected two items in the node");
|
|
861
861
|
return `<a href="${e[0]}">${e[1]}</a>`;
|
|
862
862
|
}
|
|
863
863
|
bidi(e) {
|
|
864
|
-
const t =
|
|
864
|
+
const t = ki(e[0]);
|
|
865
865
|
return t === "ltr" ? "" + e[0] + "" : t === "rtl" ? "" + e[0] + "" : e[0];
|
|
866
866
|
}
|
|
867
867
|
formatnum(e) {
|
|
868
|
-
const t = !!e[1] && e[1] === "R",
|
|
869
|
-
return typeof
|
|
868
|
+
const t = !!e[1] && e[1] === "R", n = e[0];
|
|
869
|
+
return typeof n == "string" || typeof n == "number" ? this.language.convertNumber(n, t) : n;
|
|
870
870
|
}
|
|
871
871
|
htmlattributes(e) {
|
|
872
872
|
const t = {};
|
|
873
|
-
for (let
|
|
873
|
+
for (let n = 0, r = e.length; n < r; n += 2) t[e[n]] = e[n + 1];
|
|
874
874
|
return t;
|
|
875
875
|
}
|
|
876
876
|
htmlelement(e) {
|
|
877
|
-
const t = e.shift(),
|
|
878
|
-
let
|
|
879
|
-
for (const
|
|
880
|
-
Array.isArray(
|
|
881
|
-
const u =
|
|
877
|
+
const t = e.shift(), n = e.shift();
|
|
878
|
+
let r = e, s = "";
|
|
879
|
+
for (const a in n) s += ` ${a}="${n[a]}"`;
|
|
880
|
+
Array.isArray(r) || (r = [r]);
|
|
881
|
+
const u = r.join("");
|
|
882
882
|
return `<${t}${s}>${u}</${t}>`;
|
|
883
883
|
}
|
|
884
884
|
};
|
|
885
|
-
function
|
|
885
|
+
function xe(e) {
|
|
886
886
|
return typeof e == "string" ? e.toLowerCase() : e;
|
|
887
887
|
}
|
|
888
|
-
function
|
|
889
|
-
const t = e.match(
|
|
888
|
+
function ki(e) {
|
|
889
|
+
const t = e.match(Bi);
|
|
890
890
|
return t ? t[2] === void 0 ? "ltr" : "rtl" : null;
|
|
891
891
|
}
|
|
892
|
-
function
|
|
893
|
-
let
|
|
894
|
-
function
|
|
892
|
+
function xi(e, { wikilinks: t = !1 } = {}) {
|
|
893
|
+
let n = 0;
|
|
894
|
+
function r(l) {
|
|
895
895
|
return () => {
|
|
896
|
-
for (let
|
|
897
|
-
const
|
|
898
|
-
if (
|
|
896
|
+
for (let f = 0; f < l.length; f++) {
|
|
897
|
+
const B = l[f]();
|
|
898
|
+
if (B !== null) return B;
|
|
899
899
|
}
|
|
900
900
|
return null;
|
|
901
901
|
};
|
|
902
902
|
}
|
|
903
903
|
function s(l) {
|
|
904
|
-
const
|
|
905
|
-
for (let
|
|
906
|
-
const
|
|
907
|
-
if (
|
|
908
|
-
|
|
904
|
+
const f = n, B = [];
|
|
905
|
+
for (let D = 0; D < l.length; D++) {
|
|
906
|
+
const c = l[D]();
|
|
907
|
+
if (c === null) return n = f, null;
|
|
908
|
+
B.push(c);
|
|
909
909
|
}
|
|
910
|
-
return
|
|
910
|
+
return B;
|
|
911
911
|
}
|
|
912
|
-
function u(l,
|
|
912
|
+
function u(l, f) {
|
|
913
913
|
return () => {
|
|
914
|
-
const
|
|
915
|
-
let
|
|
916
|
-
for (;
|
|
917
|
-
return
|
|
914
|
+
const B = n, D = [];
|
|
915
|
+
let c = f();
|
|
916
|
+
for (; c !== null; ) D.push(c), c = f();
|
|
917
|
+
return D.length < l ? (n = B, null) : D;
|
|
918
918
|
};
|
|
919
919
|
}
|
|
920
|
-
function
|
|
921
|
-
const
|
|
920
|
+
function a(l) {
|
|
921
|
+
const f = l.length;
|
|
922
922
|
return () => {
|
|
923
|
-
let
|
|
924
|
-
return e.slice(
|
|
923
|
+
let B = null;
|
|
924
|
+
return e.slice(n, n + f) === l && (B = l, n += f), B;
|
|
925
925
|
};
|
|
926
926
|
}
|
|
927
|
-
function
|
|
927
|
+
function o(l) {
|
|
928
928
|
return () => {
|
|
929
|
-
const
|
|
930
|
-
return
|
|
929
|
+
const f = e.slice(n).match(l);
|
|
930
|
+
return f === null ? null : (n += f[0].length, f[0]);
|
|
931
931
|
};
|
|
932
932
|
}
|
|
933
|
-
const
|
|
934
|
-
function
|
|
933
|
+
const A = o(/^\s+/), $ = a("|"), h = a(":"), _ = a("\\"), te = o(/^./), se = a("$"), De = o(/^\d+/), N = a('"'), ne = a("'"), Q = o(t ? /^[^{}[\]$<\\]/ : /^[^{}$<\\]/), ue = o(t ? /^[^{}[\]$\\|]/ : /^[^{}$\\|]/), R = o(t ? /^[^{}[\]$\s]/ : /^[^{}$\s]/);
|
|
934
|
+
function X(l, f) {
|
|
935
935
|
return () => {
|
|
936
|
-
const
|
|
937
|
-
return
|
|
936
|
+
const B = l();
|
|
937
|
+
return B === null ? null : f(B);
|
|
938
938
|
};
|
|
939
939
|
}
|
|
940
|
-
function
|
|
941
|
-
const l = u(1,
|
|
940
|
+
function K() {
|
|
941
|
+
const l = u(1, G)();
|
|
942
942
|
return l === null ? null : l.join("");
|
|
943
943
|
}
|
|
944
|
-
function
|
|
945
|
-
const l = u(1,
|
|
944
|
+
function de() {
|
|
945
|
+
const l = u(1, pe)();
|
|
946
946
|
return l === null ? null : l.join("");
|
|
947
947
|
}
|
|
948
|
-
const
|
|
949
|
-
function
|
|
950
|
-
const l = u(1,
|
|
948
|
+
const fe = r([k, R]);
|
|
949
|
+
function he() {
|
|
950
|
+
const l = u(1, fe)();
|
|
951
951
|
return l === null ? null : l.join("");
|
|
952
952
|
}
|
|
953
|
-
function
|
|
954
|
-
const l = s([
|
|
953
|
+
function k() {
|
|
954
|
+
const l = s([_, te]);
|
|
955
955
|
return l === null ? null : l[1];
|
|
956
956
|
}
|
|
957
|
-
const
|
|
958
|
-
function
|
|
959
|
-
const l = s([
|
|
957
|
+
const G = r([k, ue]), pe = r([k, Q]);
|
|
958
|
+
function v() {
|
|
959
|
+
const l = s([se, De]);
|
|
960
960
|
return l === null ? null : ["REPLACE", parseInt(l[1], 10) - 1];
|
|
961
961
|
}
|
|
962
|
-
const
|
|
962
|
+
const ie = X(o(/^[ !"$&'()*,./0-9;=?@A-Z^_`a-z~\x80-\xFF+-]+/), function(l) {
|
|
963
963
|
return l.toString();
|
|
964
964
|
});
|
|
965
|
-
function
|
|
966
|
-
const l = s([
|
|
965
|
+
function ge() {
|
|
966
|
+
const l = s([$, u(0, i)]);
|
|
967
967
|
if (l === null) return null;
|
|
968
|
-
const
|
|
969
|
-
return
|
|
968
|
+
const f = l[1];
|
|
969
|
+
return f.length > 1 ? ["CONCAT"].concat(f) : f[0];
|
|
970
970
|
}
|
|
971
|
-
function
|
|
972
|
-
const l = s([
|
|
971
|
+
function oe() {
|
|
972
|
+
const l = s([ie, h, v]);
|
|
973
973
|
return l === null ? null : [l[0], l[2]];
|
|
974
974
|
}
|
|
975
|
-
function
|
|
976
|
-
const l = s([
|
|
975
|
+
function ye() {
|
|
976
|
+
const l = s([ie, h, i]);
|
|
977
977
|
return l === null ? null : [l[0], l[2]];
|
|
978
978
|
}
|
|
979
|
-
function
|
|
980
|
-
const l = s([
|
|
979
|
+
function Se() {
|
|
980
|
+
const l = s([ie, h]);
|
|
981
981
|
return l === null ? null : [l[0], ""];
|
|
982
982
|
}
|
|
983
|
-
const
|
|
984
|
-
const l = s([
|
|
983
|
+
const Te = r([function() {
|
|
984
|
+
const l = s([r([oe, ye, Se]), u(0, ge)]);
|
|
985
985
|
return l === null ? null : l[0].concat(l[1]);
|
|
986
986
|
}, function() {
|
|
987
|
-
const l = s([
|
|
987
|
+
const l = s([ie, u(0, ge)]);
|
|
988
988
|
return l === null ? null : [l[0]].concat(l[1]);
|
|
989
|
-
}]),
|
|
989
|
+
}]), Ee = a("{{"), p = a("}}"), me = a("[["), Ae = a("]]"), be = a("["), $e = a("]");
|
|
990
990
|
function Fe() {
|
|
991
|
-
const l = s([
|
|
991
|
+
const l = s([Ee, Te, p]);
|
|
992
992
|
return l === null ? null : l[1];
|
|
993
993
|
}
|
|
994
994
|
function E() {
|
|
995
|
-
const l = s([u(1,
|
|
995
|
+
const l = s([u(1, i), $, u(1, Y)]);
|
|
996
996
|
return l === null ? null : [["CONCAT"].concat(l[0]), ["CONCAT"].concat(l[2])];
|
|
997
997
|
}
|
|
998
|
-
function
|
|
999
|
-
const l = s([u(1,
|
|
998
|
+
function w() {
|
|
999
|
+
const l = s([u(1, i)]);
|
|
1000
1000
|
return l === null ? null : [["CONCAT"].concat(l[0])];
|
|
1001
1001
|
}
|
|
1002
|
-
const
|
|
1002
|
+
const T = r([E, w]);
|
|
1003
1003
|
function L() {
|
|
1004
1004
|
let l = null;
|
|
1005
|
-
const
|
|
1006
|
-
if (
|
|
1007
|
-
const
|
|
1008
|
-
l = ["WIKILINK"].concat(
|
|
1005
|
+
const f = s([me, T, Ae]);
|
|
1006
|
+
if (f !== null) {
|
|
1007
|
+
const B = f[1];
|
|
1008
|
+
l = ["WIKILINK"].concat(B);
|
|
1009
1009
|
}
|
|
1010
1010
|
return l;
|
|
1011
1011
|
}
|
|
1012
|
-
function
|
|
1012
|
+
function M() {
|
|
1013
1013
|
let l = null;
|
|
1014
|
-
const
|
|
1015
|
-
return
|
|
1016
|
-
}
|
|
1017
|
-
const
|
|
1018
|
-
function
|
|
1019
|
-
if (l = l.toLowerCase(),
|
|
1020
|
-
const
|
|
1021
|
-
for (let
|
|
1022
|
-
const
|
|
1023
|
-
if (
|
|
1014
|
+
const f = s([be, u(1, Z), A, u(1, Y), $e]);
|
|
1015
|
+
return f !== null && (l = ["EXTLINK", f[1].length === 1 ? f[1][0] : ["CONCAT"].concat(f[1]), ["CONCAT"].concat(f[3])]), l;
|
|
1016
|
+
}
|
|
1017
|
+
const O = o(/^[A-Za-z]+/);
|
|
1018
|
+
function j(l, f, B, D = { allowedHtmlElements: ["b", "bdi", "del", "i", "ins", "u", "font", "big", "small", "sub", "sup", "h1", "h2", "h3", "h4", "h5", "h6", "cite", "code", "em", "s", "strike", "strong", "tt", "var", "div", "center", "blockquote", "ol", "ul", "dl", "table", "caption", "pre", "ruby", "rb", "rp", "rt", "rtc", "p", "span", "abbr", "dfn", "kbd", "samp", "data", "time", "mark", "li", "dt", "dd"], allowedHtmlCommonAttributes: ["id", "class", "style", "lang", "dir", "title", "aria-describedby", "aria-flowto", "aria-hidden", "aria-label", "aria-labelledby", "aria-owns", "role", "about", "property", "resource", "datatype", "typeof", "itemid", "itemprop", "itemref", "itemscope", "itemtype"], allowedHtmlAttributesByElement: {} }) {
|
|
1019
|
+
if (l = l.toLowerCase(), f = f.toLowerCase(), l !== f || D.allowedHtmlElements.indexOf(l) === -1) return !1;
|
|
1020
|
+
const c = /[\000-\010\013\016-\037\177]|expression|filter\s*:|accelerator\s*:|-o-link\s*:|-o-link-source\s*:|-o-replace\s*:|url\s*\(|image\s*\(|image-set\s*\(/i;
|
|
1021
|
+
for (let C = 0, P = B.length; C < P; C += 2) {
|
|
1022
|
+
const Ce = B[C];
|
|
1023
|
+
if (D.allowedHtmlCommonAttributes.indexOf(Ce) === -1 && (D.allowedHtmlAttributesByElement[l] || []).indexOf(Ce) === -1 || Ce === "style" && B[C + 1].search(c) !== -1) return !1;
|
|
1024
1024
|
}
|
|
1025
1025
|
return !0;
|
|
1026
1026
|
}
|
|
1027
|
-
function
|
|
1028
|
-
const l =
|
|
1029
|
-
return
|
|
1027
|
+
function q() {
|
|
1028
|
+
const l = o(/^[^"]*/), f = s([N, l, N]);
|
|
1029
|
+
return f === null ? null : f[1];
|
|
1030
1030
|
}
|
|
1031
|
-
function
|
|
1032
|
-
const l =
|
|
1033
|
-
return
|
|
1031
|
+
function I() {
|
|
1032
|
+
const l = o(/^[^']*/), f = s([ne, l, ne]);
|
|
1033
|
+
return f === null ? null : f[1];
|
|
1034
1034
|
}
|
|
1035
|
-
function
|
|
1036
|
-
const l =
|
|
1037
|
-
return
|
|
1035
|
+
function H() {
|
|
1036
|
+
const l = o(/^\s*=\s*/), f = s([A, O, l, r([q, I])]);
|
|
1037
|
+
return f === null ? null : [f[1], f[3]];
|
|
1038
1038
|
}
|
|
1039
|
-
function
|
|
1040
|
-
const l = u(0,
|
|
1039
|
+
function U() {
|
|
1040
|
+
const l = u(0, H)();
|
|
1041
1041
|
return Array.prototype.concat.apply(["HTMLATTRIBUTES"], l);
|
|
1042
1042
|
}
|
|
1043
|
-
function
|
|
1043
|
+
function W() {
|
|
1044
1044
|
let l = null;
|
|
1045
|
-
const
|
|
1046
|
-
if (
|
|
1047
|
-
const
|
|
1048
|
-
if (
|
|
1049
|
-
const
|
|
1050
|
-
if (
|
|
1045
|
+
const f = n, B = a("<"), D = o(/^\/?/), c = o(/^\s*>/), C = s([B, O, U, D, c]);
|
|
1046
|
+
if (C === null) return null;
|
|
1047
|
+
const P = n, Ce = C[1], Be = u(0, Y)(), jt = n, Rt = a("</"), st = s([Rt, O, c]);
|
|
1048
|
+
if (st === null) return ["CONCAT", e.slice(f, P)].concat(Be);
|
|
1049
|
+
const Lt = n, qt = st[1], ut = C[2], Ut = ut.slice(1);
|
|
1050
|
+
if (j(Ce, qt, Ut)) l = ["HTMLELEMENT", Ce, ut].concat(Be);
|
|
1051
1051
|
else {
|
|
1052
|
-
const
|
|
1053
|
-
l = ["CONCAT",
|
|
1052
|
+
const it = (Jt) => Jt.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
1053
|
+
l = ["CONCAT", it(e.slice(f, P))].concat(Be, it(e.slice(jt, Lt)));
|
|
1054
1054
|
}
|
|
1055
1055
|
return l;
|
|
1056
1056
|
}
|
|
1057
|
-
const
|
|
1058
|
-
function
|
|
1059
|
-
const l = u(0,
|
|
1057
|
+
const Z = r([Fe, v, L, M, he]), Y = r([Fe, v, L, M, W, de]), i = r([Fe, v, K]);
|
|
1058
|
+
function g() {
|
|
1059
|
+
const l = u(0, Y)();
|
|
1060
1060
|
return l === null ? null : ["CONCAT"].concat(l);
|
|
1061
1061
|
}
|
|
1062
|
-
const
|
|
1063
|
-
if (
|
|
1064
|
-
return
|
|
1062
|
+
const b = g();
|
|
1063
|
+
if (b === null || n !== e.length) throw new Error("Parse error at position " + n.toString() + " in input: " + e);
|
|
1064
|
+
return b;
|
|
1065
1065
|
}
|
|
1066
|
-
class
|
|
1067
|
-
constructor(t, { wikilinks:
|
|
1068
|
-
this.locale =
|
|
1066
|
+
class ft {
|
|
1067
|
+
constructor(t, { wikilinks: n = !1 } = {}) {
|
|
1068
|
+
this.locale = xe(t), this.wikilinks = n, this.emitter = new xt(this.locale);
|
|
1069
1069
|
}
|
|
1070
|
-
parse(t,
|
|
1070
|
+
parse(t, n) {
|
|
1071
1071
|
if (t.includes("{{") || t.includes("<") || this.wikilinks && t.includes("[")) {
|
|
1072
|
-
const
|
|
1073
|
-
return this.emitter.emit(
|
|
1074
|
-
} else return this.simpleParse(t,
|
|
1072
|
+
const r = xi(t, { wikilinks: this.wikilinks });
|
|
1073
|
+
return this.emitter.emit(r, n);
|
|
1074
|
+
} else return this.simpleParse(t, n);
|
|
1075
1075
|
}
|
|
1076
|
-
simpleParse(t,
|
|
1077
|
-
return t.replace(/\$(\d+)/g, (
|
|
1076
|
+
simpleParse(t, n) {
|
|
1077
|
+
return t.replace(/\$(\d+)/g, (r, s) => {
|
|
1078
1078
|
const u = parseInt(s, 10) - 1;
|
|
1079
|
-
return
|
|
1079
|
+
return n[u] !== void 0 ? n[u] : "$" + s;
|
|
1080
1080
|
});
|
|
1081
1081
|
}
|
|
1082
1082
|
}
|
|
1083
|
-
class
|
|
1083
|
+
class _i {
|
|
1084
1084
|
constructor() {
|
|
1085
1085
|
this.sourceMap = /* @__PURE__ */ new Map();
|
|
1086
1086
|
}
|
|
1087
|
-
load(t,
|
|
1087
|
+
load(t, n) {
|
|
1088
1088
|
if (typeof t != "object") throw new Error("Invalid message source. Must be an object");
|
|
1089
|
-
if (
|
|
1090
|
-
if (!/^[a-zA-Z0-9-]+$/.test(
|
|
1091
|
-
for (const
|
|
1092
|
-
if (typeof t[
|
|
1093
|
-
if (typeof t[
|
|
1089
|
+
if (n = xe(n), n) {
|
|
1090
|
+
if (!/^[a-zA-Z0-9-]+$/.test(n)) throw new Error(`Invalid locale ${n}`);
|
|
1091
|
+
for (const r in t) if (r.indexOf("@") !== 0) {
|
|
1092
|
+
if (typeof t[r] == "object") return this.load(t);
|
|
1093
|
+
if (typeof t[r] != "string") throw new Error(`Invalid message for message ${r} in ${n} locale.`);
|
|
1094
1094
|
break;
|
|
1095
1095
|
}
|
|
1096
|
-
this.sourceMap.has(
|
|
1097
|
-
} else for (
|
|
1096
|
+
this.sourceMap.has(n) ? this.sourceMap.set(n, Object.assign(this.sourceMap.get(n), t)) : this.sourceMap.set(n, t);
|
|
1097
|
+
} else for (n in t) this.load(t[n], n);
|
|
1098
1098
|
}
|
|
1099
|
-
getMessage(t,
|
|
1100
|
-
const
|
|
1101
|
-
return
|
|
1099
|
+
getMessage(t, n) {
|
|
1100
|
+
const r = this.sourceMap.get(xe(n));
|
|
1101
|
+
return r ? r[t] : null;
|
|
1102
1102
|
}
|
|
1103
1103
|
hasLocale(t) {
|
|
1104
1104
|
return this.sourceMap.has(t);
|
|
1105
1105
|
}
|
|
1106
1106
|
}
|
|
1107
|
-
class
|
|
1108
|
-
constructor(t, { finalFallback:
|
|
1109
|
-
this.locale =
|
|
1107
|
+
class Si {
|
|
1108
|
+
constructor(t, { finalFallback: n = "en", messages: r = void 0, wikilinks: s = !1 } = {}) {
|
|
1109
|
+
this.locale = xe(t), this.parser = new ft(this.locale, { wikilinks: s }), this.messageStore = new _i(), r && this.load(r, this.locale), this.finalFallback = n, this.wikilinks = s;
|
|
1110
1110
|
}
|
|
1111
|
-
load(t,
|
|
1112
|
-
return this.messageStore.load(t,
|
|
1111
|
+
load(t, n) {
|
|
1112
|
+
return this.messageStore.load(t, n || this.locale);
|
|
1113
1113
|
}
|
|
1114
|
-
i18n(t, ...
|
|
1115
|
-
return this.parser.parse(this.getMessage(t),
|
|
1114
|
+
i18n(t, ...n) {
|
|
1115
|
+
return this.parser.parse(this.getMessage(t), n);
|
|
1116
1116
|
}
|
|
1117
1117
|
setLocale(t) {
|
|
1118
|
-
this.locale =
|
|
1118
|
+
this.locale = xe(t), this.parser = new ft(this.locale, { wikilinks: this.wikilinks });
|
|
1119
1119
|
}
|
|
1120
1120
|
getFallbackLocales() {
|
|
1121
|
-
return [
|
|
1121
|
+
return [...kt[this.locale] || [], this.finalFallback];
|
|
1122
1122
|
}
|
|
1123
1123
|
getMessage(t) {
|
|
1124
|
-
let
|
|
1124
|
+
let n = this.locale, r = 0;
|
|
1125
1125
|
const s = this.getFallbackLocales(this.locale);
|
|
1126
|
-
for (;
|
|
1127
|
-
const u =
|
|
1128
|
-
let
|
|
1126
|
+
for (; n; ) {
|
|
1127
|
+
const u = n.split("-");
|
|
1128
|
+
let a = u.length;
|
|
1129
1129
|
do {
|
|
1130
|
-
const
|
|
1131
|
-
if (typeof
|
|
1132
|
-
|
|
1133
|
-
} while (
|
|
1134
|
-
|
|
1130
|
+
const o = u.slice(0, a).join("-"), A = this.messageStore.getMessage(t, o);
|
|
1131
|
+
if (typeof A == "string") return A;
|
|
1132
|
+
a--;
|
|
1133
|
+
} while (a);
|
|
1134
|
+
n = s[r], r++;
|
|
1135
1135
|
}
|
|
1136
1136
|
return t;
|
|
1137
1137
|
}
|
|
1138
|
-
registerParserPlugin(t,
|
|
1139
|
-
|
|
1138
|
+
registerParserPlugin(t, n) {
|
|
1139
|
+
xt.prototype[t] = n;
|
|
1140
1140
|
}
|
|
1141
1141
|
}
|
|
1142
|
-
const
|
|
1142
|
+
const _t = {
|
|
1143
1143
|
"@metadata": { authors: ["Mason Payne"], "last-updated": "2024-01-08", locale: "en" },
|
|
1144
1144
|
"sa-login": "Login",
|
|
1145
|
-
"sa-username": "
|
|
1145
|
+
"sa-username": "Email",
|
|
1146
1146
|
"sa-password": "Password",
|
|
1147
1147
|
"sa-use-password": "Use Password",
|
|
1148
1148
|
"sa-code": "Code",
|
|
@@ -1153,8 +1153,8 @@ const kt = {
|
|
|
1153
1153
|
"sa-remember": "Remember me",
|
|
1154
1154
|
"sa-forgot": "Forgot your password?",
|
|
1155
1155
|
"sa-register": "Register",
|
|
1156
|
-
"sa-error.login": "Invalid
|
|
1157
|
-
"sa-error.register": "Invalid
|
|
1156
|
+
"sa-error.login": "Invalid email or password",
|
|
1157
|
+
"sa-error.register": "Invalid email or password",
|
|
1158
1158
|
"sa-error.unknown": "Unknown error",
|
|
1159
1159
|
"sa-account-settings": "Account Settings",
|
|
1160
1160
|
"sa-webauthn-security-keys": "Your passkeys",
|
|
@@ -1215,19 +1215,26 @@ const kt = {
|
|
|
1215
1215
|
"sa-social-github": "Continue with GitHub",
|
|
1216
1216
|
"sa-social-apple": "Continue with Apple",
|
|
1217
1217
|
"sa-social-oidc": "Continue with SSO",
|
|
1218
|
-
"sa-social-error": "Error starting social login"
|
|
1219
|
-
|
|
1218
|
+
"sa-social-error": "Error starting social login",
|
|
1219
|
+
"sa-signup-mfa-title": "Verify Your Email",
|
|
1220
|
+
"sa-signup-verify-prompt": "A verification code has been sent to your email. Enter it below to activate multi-factor authentication.",
|
|
1221
|
+
"sa-signup-verify-error": "Invalid or expired verification code.",
|
|
1222
|
+
"sa-signup-webauthn-prompt": "Your account is secure! Optionally, add a passkey for faster and easier logins.",
|
|
1223
|
+
"sa-signup-webauthn-setup": "Set Up Passkey",
|
|
1224
|
+
"sa-signup-webauthn-done": "Skip for now",
|
|
1225
|
+
"sa-signup-webauthn-error": "Error setting up passkey. Please try again from your account settings."
|
|
1226
|
+
}, Ti = {
|
|
1220
1227
|
"@metadata": { authors: ["Mason Payne"], "last-updated": "2022-05-28", locale: "fr" },
|
|
1221
1228
|
"sa-login": "Connexion",
|
|
1222
|
-
"sa-username": "
|
|
1229
|
+
"sa-username": "Adresse e-mail",
|
|
1223
1230
|
"sa-password": "Mot de passe",
|
|
1224
1231
|
"sa-use-password": "Utiliser le mot de passe",
|
|
1225
1232
|
"sa-code": "code à deux facteurs",
|
|
1226
1233
|
"sa-remember": "Souviens-toi de moi",
|
|
1227
1234
|
"sa-forgot": "Mot de passe oublié?",
|
|
1228
1235
|
"sa-register": "S'inscrire",
|
|
1229
|
-
"sa-error.login": "
|
|
1230
|
-
"sa-error.register": "
|
|
1236
|
+
"sa-error.login": "E-mail ou mot de passe invalide",
|
|
1237
|
+
"sa-error.register": "E-mail ou mot de passe invalide",
|
|
1231
1238
|
"sa-error.unknown": "Erreur inconnue",
|
|
1232
1239
|
"sa-otp-required": "Un code à usage unique est requis.",
|
|
1233
1240
|
"sa-otp-choose": "Choisissez comment recevoir votre code :",
|
|
@@ -1260,19 +1267,26 @@ const kt = {
|
|
|
1260
1267
|
"sa-social-github": "Continuer avec GitHub",
|
|
1261
1268
|
"sa-social-apple": "Continuer avec Apple",
|
|
1262
1269
|
"sa-social-oidc": "Continuer avec SSO",
|
|
1263
|
-
"sa-social-error": "Erreur lors de la connexion sociale"
|
|
1264
|
-
|
|
1270
|
+
"sa-social-error": "Erreur lors de la connexion sociale",
|
|
1271
|
+
"sa-signup-mfa-title": "Vérifiez votre e-mail",
|
|
1272
|
+
"sa-signup-verify-prompt": "Un code de vérification a été envoyé à votre e-mail. Entrez-le ci-dessous pour activer l'authentification multi-facteurs.",
|
|
1273
|
+
"sa-signup-verify-error": "Code de vérification invalide ou expiré.",
|
|
1274
|
+
"sa-signup-webauthn-prompt": "Votre compte est sécurisé ! Ajoutez optionnellement une clé d'accès pour des connexions plus rapides.",
|
|
1275
|
+
"sa-signup-webauthn-setup": "Configurer la clé d'accès",
|
|
1276
|
+
"sa-signup-webauthn-done": "Ignorer pour l'instant",
|
|
1277
|
+
"sa-signup-webauthn-error": "Erreur lors de la configuration de la clé d'accès. Veuillez réessayer depuis les paramètres de votre compte."
|
|
1278
|
+
}, Oi = {
|
|
1265
1279
|
"@metadata": { authors: ["Mason Payne"], "last-updated": "2022-05-28", locale: "es" },
|
|
1266
1280
|
"sa-login": "Acceso",
|
|
1267
|
-
"sa-username": "
|
|
1281
|
+
"sa-username": "Correo electrónico",
|
|
1268
1282
|
"sa-password": "Clave",
|
|
1269
1283
|
"sa-use-password": "Usar contraseña",
|
|
1270
1284
|
"sa-code": "Código",
|
|
1271
1285
|
"sa-remember": "Acuérdate de mí",
|
|
1272
1286
|
"sa-forgot": "¿Olvidaste tu contraseña?",
|
|
1273
1287
|
"sa-register": "Registro",
|
|
1274
|
-
"sa-error.login": "
|
|
1275
|
-
"sa-error.register": "
|
|
1288
|
+
"sa-error.login": "Correo electrónico o contraseña inválidos",
|
|
1289
|
+
"sa-error.register": "Correo electrónico o contraseña inválidos",
|
|
1276
1290
|
"sa-error.unknown": "Error desconocido",
|
|
1277
1291
|
"sa-otp-required": "Se requiere un código de un solo uso.",
|
|
1278
1292
|
"sa-otp-choose": "Elige cómo recibir tu código:",
|
|
@@ -1303,19 +1317,26 @@ const kt = {
|
|
|
1303
1317
|
"sa-social-github": "Continuar con GitHub",
|
|
1304
1318
|
"sa-social-apple": "Continuar con Apple",
|
|
1305
1319
|
"sa-social-oidc": "Continuar con SSO",
|
|
1306
|
-
"sa-social-error": "Error al iniciar sesión social"
|
|
1307
|
-
|
|
1320
|
+
"sa-social-error": "Error al iniciar sesión social",
|
|
1321
|
+
"sa-signup-mfa-title": "Verifica tu correo electrónico",
|
|
1322
|
+
"sa-signup-verify-prompt": "Se ha enviado un código de verificación a tu correo. Ingrésalo para activar la autenticación multifactor.",
|
|
1323
|
+
"sa-signup-verify-error": "Código de verificación inválido o expirado.",
|
|
1324
|
+
"sa-signup-webauthn-prompt": "¡Tu cuenta está protegida! Opcionalmente, agrega una clave de acceso para inicios de sesión más rápidos.",
|
|
1325
|
+
"sa-signup-webauthn-setup": "Configurar clave de acceso",
|
|
1326
|
+
"sa-signup-webauthn-done": "Omitir por ahora",
|
|
1327
|
+
"sa-signup-webauthn-error": "Error al configurar la clave de acceso. Intenta de nuevo desde la configuración de tu cuenta."
|
|
1328
|
+
}, Ii = {
|
|
1308
1329
|
"@metadata": { authors: ["Mason Payne"], "last-updated": "2022-05-28", locale: "ja" },
|
|
1309
1330
|
"sa-login": "ログイン",
|
|
1310
|
-
"sa-username": "
|
|
1331
|
+
"sa-username": "メールアドレス",
|
|
1311
1332
|
"sa-password": "パスワード",
|
|
1312
1333
|
"sa-use-password": "パスワードを使用する",
|
|
1313
1334
|
"sa-code": "コード",
|
|
1314
1335
|
"sa-remember": "私を覚えてますか",
|
|
1315
1336
|
"sa-forgot": "パスワードをお忘れですか?",
|
|
1316
1337
|
"sa-register": "登録",
|
|
1317
|
-
"sa-error.login": "
|
|
1318
|
-
"sa-error.register": "
|
|
1338
|
+
"sa-error.login": "メールアドレスかパスワードが無効",
|
|
1339
|
+
"sa-error.register": "メールアドレスかパスワードが無効",
|
|
1319
1340
|
"sa-error.unknown": "未知のエラー",
|
|
1320
1341
|
"sa-otp-required": "ワンタイムコードが必要です。",
|
|
1321
1342
|
"sa-otp-choose": "コードの受け取り方法を選択してください:",
|
|
@@ -1348,69 +1369,76 @@ const kt = {
|
|
|
1348
1369
|
"sa-social-github": "GitHubで続ける",
|
|
1349
1370
|
"sa-social-apple": "Appleで続ける",
|
|
1350
1371
|
"sa-social-oidc": "SSOで続ける",
|
|
1351
|
-
"sa-social-error": "ソーシャルログイン開始エラー"
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1372
|
+
"sa-social-error": "ソーシャルログイン開始エラー",
|
|
1373
|
+
"sa-signup-mfa-title": "メールを確認してください",
|
|
1374
|
+
"sa-signup-verify-prompt": "確認コードがメールに送信されました。多要素認証を有効にするために入力してください。",
|
|
1375
|
+
"sa-signup-verify-error": "無効または期限切れの確認コードです。",
|
|
1376
|
+
"sa-signup-webauthn-prompt": "アカウントが保護されました!パスキーを追加してより速く簡単にログインできます(任意)。",
|
|
1377
|
+
"sa-signup-webauthn-setup": "パスキーを設定",
|
|
1378
|
+
"sa-signup-webauthn-done": "今はスキップ",
|
|
1379
|
+
"sa-signup-webauthn-error": "パスキーの設定中にエラーが発生しました。アカウント設定から再試行してください。"
|
|
1380
|
+
}, Pi = {
|
|
1381
|
+
en: _t,
|
|
1382
|
+
fr: Ti,
|
|
1383
|
+
es: Oi,
|
|
1384
|
+
ja: Ii
|
|
1357
1385
|
};
|
|
1358
1386
|
function rt(e) {
|
|
1359
|
-
const t = new
|
|
1360
|
-
messages:
|
|
1387
|
+
const t = new Si("en", {
|
|
1388
|
+
messages: _t
|
|
1361
1389
|
});
|
|
1362
|
-
return e !== "en" && (t.load(
|
|
1390
|
+
return e !== "en" && (t.load(Pi[e], e), t.setLocale(e)), t;
|
|
1363
1391
|
}
|
|
1364
|
-
function
|
|
1365
|
-
const t = "==".slice(0, (4 - e.length % 4) % 4),
|
|
1366
|
-
for (let
|
|
1367
|
-
u[
|
|
1392
|
+
function St(e) {
|
|
1393
|
+
const t = "==".slice(0, (4 - e.length % 4) % 4), n = e.replace(/-/g, "+").replace(/_/g, "/") + t, r = atob(n), s = new ArrayBuffer(r.length), u = new Uint8Array(s);
|
|
1394
|
+
for (let a = 0; a < r.length; a++)
|
|
1395
|
+
u[a] = r.charCodeAt(a);
|
|
1368
1396
|
return s;
|
|
1369
1397
|
}
|
|
1370
|
-
function
|
|
1398
|
+
function Tt(e) {
|
|
1371
1399
|
const t = new Uint8Array(e);
|
|
1372
|
-
let
|
|
1400
|
+
let n = "";
|
|
1373
1401
|
for (const u of t)
|
|
1374
|
-
|
|
1375
|
-
return btoa(
|
|
1402
|
+
n += String.fromCharCode(u);
|
|
1403
|
+
return btoa(n).replace(/\+/g, "-").replace(
|
|
1376
1404
|
/\//g,
|
|
1377
1405
|
"_"
|
|
1378
1406
|
).replace(/=/g, "");
|
|
1379
1407
|
}
|
|
1380
|
-
var
|
|
1381
|
-
function
|
|
1382
|
-
if (t ===
|
|
1383
|
-
return
|
|
1384
|
-
if (t ===
|
|
1385
|
-
return e(
|
|
1408
|
+
var S = "copy", ce = "convert";
|
|
1409
|
+
function _e(e, t, n) {
|
|
1410
|
+
if (t === S)
|
|
1411
|
+
return n;
|
|
1412
|
+
if (t === ce)
|
|
1413
|
+
return e(n);
|
|
1386
1414
|
if (t instanceof Array)
|
|
1387
|
-
return
|
|
1415
|
+
return n.map((r) => _e(e, t[0], r));
|
|
1388
1416
|
if (t instanceof Object) {
|
|
1389
|
-
const
|
|
1417
|
+
const r = {};
|
|
1390
1418
|
for (const [s, u] of Object.entries(t)) {
|
|
1391
1419
|
if (u.derive) {
|
|
1392
|
-
const
|
|
1393
|
-
|
|
1420
|
+
const a = u.derive(n);
|
|
1421
|
+
a !== void 0 && (n[s] = a);
|
|
1394
1422
|
}
|
|
1395
|
-
if (!(s in
|
|
1423
|
+
if (!(s in n)) {
|
|
1396
1424
|
if (u.required)
|
|
1397
1425
|
throw new Error(`Missing key: ${s}`);
|
|
1398
1426
|
continue;
|
|
1399
1427
|
}
|
|
1400
|
-
if (
|
|
1401
|
-
|
|
1428
|
+
if (n[s] == null) {
|
|
1429
|
+
r[s] = null;
|
|
1402
1430
|
continue;
|
|
1403
1431
|
}
|
|
1404
|
-
|
|
1432
|
+
r[s] = _e(
|
|
1405
1433
|
e,
|
|
1406
1434
|
u.schema,
|
|
1407
|
-
|
|
1435
|
+
n[s]
|
|
1408
1436
|
);
|
|
1409
1437
|
}
|
|
1410
|
-
return
|
|
1438
|
+
return r;
|
|
1411
1439
|
}
|
|
1412
1440
|
}
|
|
1413
|
-
function
|
|
1441
|
+
function Ye(e, t) {
|
|
1414
1442
|
return {
|
|
1415
1443
|
required: !0,
|
|
1416
1444
|
schema: e,
|
|
@@ -1423,131 +1451,131 @@ function z(e) {
|
|
|
1423
1451
|
schema: e
|
|
1424
1452
|
};
|
|
1425
1453
|
}
|
|
1426
|
-
function
|
|
1454
|
+
function J(e) {
|
|
1427
1455
|
return {
|
|
1428
1456
|
required: !1,
|
|
1429
1457
|
schema: e
|
|
1430
1458
|
};
|
|
1431
1459
|
}
|
|
1432
|
-
var
|
|
1433
|
-
type: z(
|
|
1434
|
-
id: z(
|
|
1435
|
-
transports:
|
|
1436
|
-
},
|
|
1437
|
-
appid:
|
|
1438
|
-
appidExclude:
|
|
1439
|
-
credProps:
|
|
1440
|
-
},
|
|
1441
|
-
appid:
|
|
1442
|
-
appidExclude:
|
|
1443
|
-
credProps:
|
|
1444
|
-
},
|
|
1460
|
+
var Ot = {
|
|
1461
|
+
type: z(S),
|
|
1462
|
+
id: z(ce),
|
|
1463
|
+
transports: J(S)
|
|
1464
|
+
}, It = {
|
|
1465
|
+
appid: J(S),
|
|
1466
|
+
appidExclude: J(S),
|
|
1467
|
+
credProps: J(S)
|
|
1468
|
+
}, Pt = {
|
|
1469
|
+
appid: J(S),
|
|
1470
|
+
appidExclude: J(S),
|
|
1471
|
+
credProps: J(S)
|
|
1472
|
+
}, zi = {
|
|
1445
1473
|
publicKey: z({
|
|
1446
|
-
rp: z(
|
|
1474
|
+
rp: z(S),
|
|
1447
1475
|
user: z({
|
|
1448
|
-
id: z(
|
|
1449
|
-
name: z(
|
|
1450
|
-
displayName: z(
|
|
1476
|
+
id: z(ce),
|
|
1477
|
+
name: z(S),
|
|
1478
|
+
displayName: z(S)
|
|
1451
1479
|
}),
|
|
1452
|
-
challenge: z(
|
|
1453
|
-
pubKeyCredParams: z(
|
|
1454
|
-
timeout:
|
|
1455
|
-
excludeCredentials:
|
|
1456
|
-
authenticatorSelection:
|
|
1457
|
-
attestation:
|
|
1458
|
-
extensions:
|
|
1480
|
+
challenge: z(ce),
|
|
1481
|
+
pubKeyCredParams: z(S),
|
|
1482
|
+
timeout: J(S),
|
|
1483
|
+
excludeCredentials: J([Ot]),
|
|
1484
|
+
authenticatorSelection: J(S),
|
|
1485
|
+
attestation: J(S),
|
|
1486
|
+
extensions: J(It)
|
|
1459
1487
|
}),
|
|
1460
|
-
signal:
|
|
1461
|
-
},
|
|
1462
|
-
type: z(
|
|
1463
|
-
id: z(
|
|
1464
|
-
rawId: z(
|
|
1465
|
-
authenticatorAttachment:
|
|
1488
|
+
signal: J(S)
|
|
1489
|
+
}, Ni = {
|
|
1490
|
+
type: z(S),
|
|
1491
|
+
id: z(S),
|
|
1492
|
+
rawId: z(ce),
|
|
1493
|
+
authenticatorAttachment: J(S),
|
|
1466
1494
|
response: z({
|
|
1467
|
-
clientDataJSON: z(
|
|
1468
|
-
attestationObject: z(
|
|
1469
|
-
transports:
|
|
1470
|
-
|
|
1495
|
+
clientDataJSON: z(ce),
|
|
1496
|
+
attestationObject: z(ce),
|
|
1497
|
+
transports: Ye(
|
|
1498
|
+
S,
|
|
1471
1499
|
(e) => {
|
|
1472
1500
|
var t;
|
|
1473
1501
|
return ((t = e.getTransports) == null ? void 0 : t.call(e)) || [];
|
|
1474
1502
|
}
|
|
1475
1503
|
)
|
|
1476
1504
|
}),
|
|
1477
|
-
clientExtensionResults:
|
|
1478
|
-
|
|
1505
|
+
clientExtensionResults: Ye(
|
|
1506
|
+
Pt,
|
|
1479
1507
|
(e) => e.getClientExtensionResults()
|
|
1480
1508
|
)
|
|
1481
|
-
},
|
|
1482
|
-
mediation:
|
|
1509
|
+
}, Mi = {
|
|
1510
|
+
mediation: J(S),
|
|
1483
1511
|
publicKey: z({
|
|
1484
|
-
challenge: z(
|
|
1485
|
-
timeout:
|
|
1486
|
-
rpId:
|
|
1487
|
-
allowCredentials:
|
|
1488
|
-
userVerification:
|
|
1489
|
-
extensions:
|
|
1512
|
+
challenge: z(ce),
|
|
1513
|
+
timeout: J(S),
|
|
1514
|
+
rpId: J(S),
|
|
1515
|
+
allowCredentials: J([Ot]),
|
|
1516
|
+
userVerification: J(S),
|
|
1517
|
+
extensions: J(It)
|
|
1490
1518
|
}),
|
|
1491
|
-
signal:
|
|
1492
|
-
},
|
|
1493
|
-
type: z(
|
|
1494
|
-
id: z(
|
|
1495
|
-
rawId: z(
|
|
1496
|
-
authenticatorAttachment:
|
|
1519
|
+
signal: J(S)
|
|
1520
|
+
}, ji = {
|
|
1521
|
+
type: z(S),
|
|
1522
|
+
id: z(S),
|
|
1523
|
+
rawId: z(ce),
|
|
1524
|
+
authenticatorAttachment: J(S),
|
|
1497
1525
|
response: z({
|
|
1498
|
-
clientDataJSON: z(
|
|
1499
|
-
authenticatorData: z(
|
|
1500
|
-
signature: z(
|
|
1501
|
-
userHandle: z(
|
|
1526
|
+
clientDataJSON: z(ce),
|
|
1527
|
+
authenticatorData: z(ce),
|
|
1528
|
+
signature: z(ce),
|
|
1529
|
+
userHandle: z(ce)
|
|
1502
1530
|
}),
|
|
1503
|
-
clientExtensionResults:
|
|
1504
|
-
|
|
1531
|
+
clientExtensionResults: Ye(
|
|
1532
|
+
Pt,
|
|
1505
1533
|
(e) => e.getClientExtensionResults()
|
|
1506
1534
|
)
|
|
1507
1535
|
};
|
|
1508
|
-
function
|
|
1509
|
-
return
|
|
1536
|
+
function zt(e) {
|
|
1537
|
+
return _e(St, zi, e);
|
|
1510
1538
|
}
|
|
1511
|
-
function
|
|
1512
|
-
return
|
|
1513
|
-
|
|
1514
|
-
|
|
1539
|
+
function Ri(e) {
|
|
1540
|
+
return _e(
|
|
1541
|
+
Tt,
|
|
1542
|
+
Ni,
|
|
1515
1543
|
e
|
|
1516
1544
|
);
|
|
1517
1545
|
}
|
|
1518
|
-
function
|
|
1519
|
-
return
|
|
1546
|
+
function Li(e) {
|
|
1547
|
+
return _e(St, Mi, e);
|
|
1520
1548
|
}
|
|
1521
|
-
function
|
|
1522
|
-
return
|
|
1523
|
-
|
|
1524
|
-
|
|
1549
|
+
function qi(e) {
|
|
1550
|
+
return _e(
|
|
1551
|
+
Tt,
|
|
1552
|
+
ji,
|
|
1525
1553
|
e
|
|
1526
1554
|
);
|
|
1527
1555
|
}
|
|
1528
|
-
async function
|
|
1556
|
+
async function Nt(e) {
|
|
1529
1557
|
const t = await navigator.credentials.create(
|
|
1530
1558
|
e
|
|
1531
1559
|
);
|
|
1532
|
-
return t.toJSON = () =>
|
|
1560
|
+
return t.toJSON = () => Ri(t), t;
|
|
1533
1561
|
}
|
|
1534
|
-
async function
|
|
1562
|
+
async function Ui(e) {
|
|
1535
1563
|
const t = await navigator.credentials.get(
|
|
1536
1564
|
e
|
|
1537
1565
|
);
|
|
1538
|
-
return t.toJSON = () =>
|
|
1566
|
+
return t.toJSON = () => qi(t), t;
|
|
1539
1567
|
}
|
|
1540
|
-
function
|
|
1568
|
+
function Xe(e) {
|
|
1541
1569
|
this.message = e;
|
|
1542
1570
|
}
|
|
1543
|
-
|
|
1544
|
-
var
|
|
1571
|
+
Xe.prototype = new Error(), Xe.prototype.name = "InvalidCharacterError";
|
|
1572
|
+
var ht = typeof window < "u" && window.atob && window.atob.bind(window) || function(e) {
|
|
1545
1573
|
var t = String(e).replace(/=+$/, "");
|
|
1546
|
-
if (t.length % 4 == 1) throw new
|
|
1547
|
-
for (var
|
|
1548
|
-
return
|
|
1574
|
+
if (t.length % 4 == 1) throw new Xe("'atob' failed: The string to be decoded is not correctly encoded.");
|
|
1575
|
+
for (var n, r, s = 0, u = 0, a = ""; r = t.charAt(u++); ~r && (n = s % 4 ? 64 * n + r : r, s++ % 4) ? a += String.fromCharCode(255 & n >> (-2 * s & 6)) : 0) r = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(r);
|
|
1576
|
+
return a;
|
|
1549
1577
|
};
|
|
1550
|
-
function
|
|
1578
|
+
function Ji(e) {
|
|
1551
1579
|
var t = e.replace(/-/g, "+").replace(/_/g, "/");
|
|
1552
1580
|
switch (t.length % 4) {
|
|
1553
1581
|
case 0:
|
|
@@ -1562,51 +1590,51 @@ function qi(e) {
|
|
|
1562
1590
|
throw "Illegal base64url string!";
|
|
1563
1591
|
}
|
|
1564
1592
|
try {
|
|
1565
|
-
return function(
|
|
1566
|
-
return decodeURIComponent(
|
|
1593
|
+
return function(n) {
|
|
1594
|
+
return decodeURIComponent(ht(n).replace(/(.)/g, function(r, s) {
|
|
1567
1595
|
var u = s.charCodeAt(0).toString(16).toUpperCase();
|
|
1568
1596
|
return u.length < 2 && (u = "0" + u), "%" + u;
|
|
1569
1597
|
}));
|
|
1570
1598
|
}(t);
|
|
1571
1599
|
} catch {
|
|
1572
|
-
return
|
|
1600
|
+
return ht(t);
|
|
1573
1601
|
}
|
|
1574
1602
|
}
|
|
1575
|
-
function
|
|
1603
|
+
function Ue(e) {
|
|
1576
1604
|
this.message = e;
|
|
1577
1605
|
}
|
|
1578
|
-
function
|
|
1579
|
-
if (typeof e != "string") throw new
|
|
1580
|
-
var
|
|
1606
|
+
function Vi(e, t) {
|
|
1607
|
+
if (typeof e != "string") throw new Ue("Invalid token specified");
|
|
1608
|
+
var n = (t = t || {}).header === !0 ? 0 : 1;
|
|
1581
1609
|
try {
|
|
1582
|
-
return JSON.parse(
|
|
1583
|
-
} catch (
|
|
1584
|
-
throw new
|
|
1610
|
+
return JSON.parse(Ji(e.split(".")[n]));
|
|
1611
|
+
} catch (r) {
|
|
1612
|
+
throw new Ue("Invalid token specified: " + r.message);
|
|
1585
1613
|
}
|
|
1586
1614
|
}
|
|
1587
|
-
|
|
1588
|
-
const
|
|
1589
|
-
function
|
|
1590
|
-
const e = localStorage.getItem(
|
|
1615
|
+
Ue.prototype = new Error(), Ue.prototype.name = "InvalidTokenError";
|
|
1616
|
+
const Ne = "spartan-token";
|
|
1617
|
+
function Mt() {
|
|
1618
|
+
const e = localStorage.getItem(Ne);
|
|
1591
1619
|
let t = null;
|
|
1592
1620
|
if (e)
|
|
1593
1621
|
try {
|
|
1594
|
-
if (t =
|
|
1622
|
+
if (t = Vi(e), t.exp > Gi())
|
|
1595
1623
|
return t;
|
|
1596
|
-
localStorage.removeItem(
|
|
1597
|
-
} catch (
|
|
1598
|
-
console.error("Error decoding token",
|
|
1624
|
+
localStorage.removeItem(Ne);
|
|
1625
|
+
} catch (n) {
|
|
1626
|
+
console.error("Error decoding token", n), localStorage.removeItem(Ne);
|
|
1599
1627
|
}
|
|
1600
1628
|
return null;
|
|
1601
1629
|
}
|
|
1602
|
-
function
|
|
1603
|
-
const e = localStorage.getItem(
|
|
1630
|
+
function Ki() {
|
|
1631
|
+
const e = localStorage.getItem(Ne);
|
|
1604
1632
|
return e || null;
|
|
1605
1633
|
}
|
|
1606
|
-
function
|
|
1634
|
+
function Gi() {
|
|
1607
1635
|
return Math.round((/* @__PURE__ */ new Date()).getTime() / 1e3);
|
|
1608
1636
|
}
|
|
1609
|
-
var
|
|
1637
|
+
var Hi = /* @__PURE__ */ y(`<form class=login-frame><style>.login-frame {
|
|
1610
1638
|
display: flex;
|
|
1611
1639
|
flex-direction: column;
|
|
1612
1640
|
justify-content: center;
|
|
@@ -1712,8 +1740,8 @@ var Gi = /* @__PURE__ */ B(`<form class=login-frame><style>.login-frame {
|
|
|
1712
1740
|
opacity: 0.6;
|
|
1713
1741
|
cursor: not-allowed;
|
|
1714
1742
|
}
|
|
1715
|
-
</style><style></style><h1></h1><input type=text
|
|
1716
|
-
const
|
|
1743
|
+
</style><style></style><h1></h1><input type=text>`), Wi = /* @__PURE__ */ y("<span class=error-message>"), He = /* @__PURE__ */ y("<span>"), Dt = /* @__PURE__ */ y("<input type=password>"), We = /* @__PURE__ */ y("<p>"), Zi = /* @__PURE__ */ y("<select>"), Yi = /* @__PURE__ */ y("<option> (<!>)"), Xi = /* @__PURE__ */ y("<input type=text>"), pt = /* @__PURE__ */ y("<input type=text autocomplete=one-time-code>"), Qi = /* @__PURE__ */ y("<input type=password autocomplete=new-password>"), ea = /* @__PURE__ */ y("<span class=checkbox-wrapper><input type=checkbox><span> "), ta = /* @__PURE__ */ y("<button type=submit>"), na = /* @__PURE__ */ y("<button type=button>"), ze = /* @__PURE__ */ y("<a class=centered-text href=#>"), ra = /* @__PURE__ */ y("<div class=social-divider><span>"), sa = /* @__PURE__ */ y("<button type=button class=social-btn>"), ua = /* @__PURE__ */ y('<svg width=18 height=18 viewBox="0 0 18 18"xmlns=http://www.w3.org/2000/svg><path d="M17.64 9.2c0-.637-.057-1.251-.164-1.84H9v3.481h4.844c-.209 1.125-.843 2.078-1.796 2.717v2.258h2.908c1.702-1.567 2.684-3.875 2.684-6.615z"fill=#4285F4></path><path d="M9 18c2.43 0 4.467-.806 5.956-2.184l-2.908-2.258c-.806.54-1.837.86-3.048.86-2.344 0-4.328-1.584-5.036-3.711H.957v2.332C2.438 15.983 5.482 18 9 18z"fill=#34A853></path><path d="M3.964 10.707c-.18-.54-.282-1.117-.282-1.707s.102-1.167.282-1.707V4.961H.957C.347 6.175 0 7.548 0 9s.348 2.825.957 4.039l3.007-2.332z"fill=#FBBC05></path><path d="M9 3.58c1.321 0 2.508.454 3.44 1.345l2.582-2.58C13.463.891 11.426 0 9 0 5.482 0 2.438 2.017.957 4.961L3.964 7.293C4.672 5.166 6.656 3.58 9 3.58z"fill=#EA4335>'), ia = /* @__PURE__ */ y('<svg width=18 height=18 viewBox="0 0 16 16"xmlns=http://www.w3.org/2000/svg><path fill-rule=evenodd d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"fill=currentColor>'), aa = /* @__PURE__ */ y('<svg width=18 height=18 viewBox="20 16 16 19"xmlns=http://www.w3.org/2000/svg><path d="M28.2226562,20.3846154 C29.0546875,20.3846154 30.0976562,19.8048315 30.71875,19.0317864 C31.28125,18.3312142 31.6914062,17.352829 31.6914062,16.3744437 C31.6914062,16.2415766 31.6796875,16.1087095 31.65625,16 C30.7304687,16.0362365 29.6171875,16.640178 28.9492187,17.4494596 C28.421875,18.06548 27.9414062,19.0317864 27.9414062,20.0222505 C27.9414062,20.1671964 27.9648438,20.3121424 27.9765625,20.3604577 C28.0351562,20.3725366 28.1289062,20.3846154 28.2226562,20.3846154 Z M25.2929688,35 C26.4296875,35 26.9335938,34.214876 28.3515625,34.214876 C29.7929688,34.214876 30.109375,34.9758423 31.375,34.9758423 C32.6171875,34.9758423 33.4492188,33.792117 34.234375,32.6325493 C35.1132812,31.3038779 35.4765625,29.9993643 35.5,29.9389701 C35.4179688,29.9148125 33.0390625,28.9122695 33.0390625,26.0979021 C33.0390625,23.6579784 34.9140625,22.5588048 35.0195312,22.474253 C33.7773438,20.6382708 31.890625,20.5899555 31.375,20.5899555 C29.9804688,20.5899555 28.84375,21.4596313 28.1289062,21.4596313 C27.3554688,21.4596313 26.3359375,20.6382708 25.1289062,20.6382708 C22.8320312,20.6382708 20.5,22.5950413 20.5,26.2911634 C20.5,28.5861411 21.3671875,31.013986 22.4335938,32.5842339 C23.3476562,33.9129053 24.1445312,35 25.2929688,35 Z"fill=currentColor fill-rule=nonzero>'), oa = /* @__PURE__ */ y('<svg width=18 height=18 viewBox="0 0 24 24"xmlns=http://www.w3.org/2000/svg><path d="M12 1L3 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5l-9-4zm0 4a3 3 0 110 6 3 3 0 010-6zm0 14c-2.5 0-4.71-1.28-6-3.22.03-1.99 4-3.08 6-3.08s5.97 1.09 6 3.08c-1.29 1.94-3.5 3.22-6 3.22z"fill=currentColor>');
|
|
1744
|
+
const la = {
|
|
1717
1745
|
domain: "http://127.0.0.1:11000",
|
|
1718
1746
|
sector: "0ad5c3e5-0186-4557-8b32-4b36f247bf09",
|
|
1719
1747
|
// defaults to the admin sector
|
|
@@ -1722,27 +1750,27 @@ const aa = {
|
|
|
1722
1750
|
locale: "en",
|
|
1723
1751
|
redirect: ""
|
|
1724
1752
|
};
|
|
1725
|
-
|
|
1726
|
-
const [t,
|
|
1727
|
-
let
|
|
1753
|
+
nt("spartan-login", la, (e) => {
|
|
1754
|
+
const [t, n] = F((e.startMode || "password").toLowerCase()), [r, s] = F(""), [u, a] = F(""), [o, A] = F(""), [$, h] = F(""), [_] = F(e.redirect), [te, se] = F(!1), [De, N] = F(!1), [ne, Q] = F(!1), [ue, R] = F(""), [X, K] = F(""), [de, fe] = F([]), [he, k] = F(""), [G, pe] = F([]), [v, ie] = F(""), [ge, oe] = F(!1), [ye, Se] = F(""), [Te, Ee] = F(""), p = rt(e.locale);
|
|
1755
|
+
let me, Ae;
|
|
1728
1756
|
try {
|
|
1729
|
-
|
|
1757
|
+
Ae = e.styles;
|
|
1730
1758
|
} catch {
|
|
1731
|
-
|
|
1759
|
+
Ae = "";
|
|
1732
1760
|
}
|
|
1733
|
-
console.log(
|
|
1734
|
-
const
|
|
1735
|
-
if (
|
|
1761
|
+
console.log(Ae), Qe(async () => {
|
|
1762
|
+
const i = new URLSearchParams(window.location.search);
|
|
1763
|
+
if (i.get("error")) {
|
|
1736
1764
|
history.replaceState({}, "", window.location.pathname);
|
|
1737
|
-
const
|
|
1738
|
-
|
|
1765
|
+
const f = i.get("error_description");
|
|
1766
|
+
h(f || p.i18n("sa-social-error")), be(), $e();
|
|
1739
1767
|
return;
|
|
1740
1768
|
}
|
|
1741
|
-
const
|
|
1742
|
-
if (
|
|
1769
|
+
const b = i.get("code");
|
|
1770
|
+
if (b) {
|
|
1743
1771
|
history.replaceState({}, "", window.location.pathname);
|
|
1744
1772
|
try {
|
|
1745
|
-
const
|
|
1773
|
+
const f = await fetch(`${e.domain}/api/v1/oauth/exchange`, {
|
|
1746
1774
|
method: "POST",
|
|
1747
1775
|
mode: "cors",
|
|
1748
1776
|
cache: "no-cache",
|
|
@@ -1750,30 +1778,30 @@ tt("spartan-login", aa, (e) => {
|
|
|
1750
1778
|
"Content-Type": "application/json"
|
|
1751
1779
|
},
|
|
1752
1780
|
body: JSON.stringify({
|
|
1753
|
-
code:
|
|
1781
|
+
code: b
|
|
1754
1782
|
})
|
|
1755
1783
|
});
|
|
1756
|
-
if (!
|
|
1757
|
-
const
|
|
1758
|
-
localStorage.setItem("spartan-token",
|
|
1784
|
+
if (!f.ok) throw new Error(p.i18n("sa-social-error"));
|
|
1785
|
+
const B = await f.json();
|
|
1786
|
+
localStorage.setItem("spartan-token", B.token), me.getRootNode().host.dispatchEvent(new CustomEvent("spartan-login", {
|
|
1759
1787
|
bubbles: !0,
|
|
1760
1788
|
cancelable: !0,
|
|
1761
1789
|
detail: {
|
|
1762
|
-
token:
|
|
1790
|
+
token: B.token
|
|
1763
1791
|
}
|
|
1764
1792
|
})), e.redirect !== "" && (window.location.href = e.redirect);
|
|
1765
|
-
} catch (
|
|
1766
|
-
|
|
1793
|
+
} catch (f) {
|
|
1794
|
+
h(f.message || p.i18n("sa-social-error"));
|
|
1767
1795
|
}
|
|
1768
1796
|
return;
|
|
1769
1797
|
}
|
|
1770
|
-
if (
|
|
1798
|
+
if (Mt() && e.redirect !== "" && window.location.pathname !== e.redirect) {
|
|
1771
1799
|
window.location.href = e.redirect;
|
|
1772
1800
|
return;
|
|
1773
1801
|
}
|
|
1774
|
-
|
|
1802
|
+
be(), $e();
|
|
1775
1803
|
});
|
|
1776
|
-
function
|
|
1804
|
+
function be() {
|
|
1777
1805
|
fetch(`${e.domain}/api/v1/sectors/${e.sector}/publicsettings`, {
|
|
1778
1806
|
method: "GET",
|
|
1779
1807
|
mode: "cors",
|
|
@@ -1781,35 +1809,56 @@ tt("spartan-login", aa, (e) => {
|
|
|
1781
1809
|
headers: {
|
|
1782
1810
|
"Content-Type": "application/json"
|
|
1783
1811
|
}
|
|
1784
|
-
}).then((
|
|
1785
|
-
if (
|
|
1786
|
-
return
|
|
1812
|
+
}).then((i) => {
|
|
1813
|
+
if (i.ok)
|
|
1814
|
+
return i.json();
|
|
1787
1815
|
throw new Error("Network response was not ok.");
|
|
1788
|
-
}).then((
|
|
1789
|
-
console.log(
|
|
1790
|
-
}).catch((
|
|
1791
|
-
console.log(
|
|
1816
|
+
}).then((i) => {
|
|
1817
|
+
console.log(i), se(i.SelfSignUpAllowed), oe(i.MFARequired || !1);
|
|
1818
|
+
}).catch((i) => {
|
|
1819
|
+
console.log(i), h(i.message);
|
|
1792
1820
|
});
|
|
1793
1821
|
}
|
|
1794
|
-
function
|
|
1822
|
+
function $e() {
|
|
1795
1823
|
fetch(`${e.domain}/api/v1/sectors/${e.sector}/oauth/providers`, {
|
|
1796
1824
|
method: "GET",
|
|
1797
1825
|
mode: "cors",
|
|
1798
1826
|
cache: "no-cache"
|
|
1799
|
-
}).then((
|
|
1800
|
-
if (
|
|
1827
|
+
}).then((i) => {
|
|
1828
|
+
if (i.ok) return i.json();
|
|
1801
1829
|
throw new Error("Failed to load social providers");
|
|
1802
|
-
}).then((
|
|
1803
|
-
const
|
|
1804
|
-
|
|
1830
|
+
}).then((i) => {
|
|
1831
|
+
const g = (i.providers || []).filter((b) => b.enabled);
|
|
1832
|
+
pe(g);
|
|
1805
1833
|
}).catch(() => {
|
|
1806
1834
|
});
|
|
1807
1835
|
}
|
|
1808
|
-
function
|
|
1809
|
-
if (
|
|
1810
|
-
|
|
1811
|
-
const
|
|
1812
|
-
fetch(`${e.domain}/api/v1/oauth/${
|
|
1836
|
+
function Fe(i) {
|
|
1837
|
+
if (v()) return;
|
|
1838
|
+
ie(i), h("");
|
|
1839
|
+
const g = window.location.origin + window.location.pathname;
|
|
1840
|
+
fetch(`${e.domain}/api/v1/oauth/${i}/initiate`, {
|
|
1841
|
+
method: "POST",
|
|
1842
|
+
mode: "cors",
|
|
1843
|
+
cache: "no-cache",
|
|
1844
|
+
headers: {
|
|
1845
|
+
"Content-Type": "application/json"
|
|
1846
|
+
},
|
|
1847
|
+
body: JSON.stringify({
|
|
1848
|
+
sectorID: e.sector,
|
|
1849
|
+
redirectURI: g
|
|
1850
|
+
})
|
|
1851
|
+
}).then((b) => {
|
|
1852
|
+
if (b.ok) return b.json();
|
|
1853
|
+
throw new Error(p.i18n("sa-social-error"));
|
|
1854
|
+
}).then((b) => {
|
|
1855
|
+
window.location.href = b.authURL;
|
|
1856
|
+
}).catch((b) => {
|
|
1857
|
+
ie(""), h(b.message);
|
|
1858
|
+
});
|
|
1859
|
+
}
|
|
1860
|
+
function E(i, g) {
|
|
1861
|
+
h(""), Ee(g), fetch(`${e.domain}/api/v1/signup/mfa/begin`, {
|
|
1813
1862
|
method: "POST",
|
|
1814
1863
|
mode: "cors",
|
|
1815
1864
|
cache: "no-cache",
|
|
@@ -1817,169 +1866,240 @@ tt("spartan-login", aa, (e) => {
|
|
|
1817
1866
|
"Content-Type": "application/json"
|
|
1818
1867
|
},
|
|
1819
1868
|
body: JSON.stringify({
|
|
1869
|
+
email: i,
|
|
1820
1870
|
sectorID: e.sector,
|
|
1821
|
-
|
|
1871
|
+
transactionId: g
|
|
1822
1872
|
})
|
|
1823
|
-
}).then((
|
|
1824
|
-
if (
|
|
1825
|
-
|
|
1826
|
-
}).then((
|
|
1827
|
-
|
|
1828
|
-
}).catch((
|
|
1829
|
-
|
|
1873
|
+
}).then((b) => {
|
|
1874
|
+
if (!b.ok)
|
|
1875
|
+
throw new Error(p.i18n("sa-signup-verify-error"));
|
|
1876
|
+
}).then(() => {
|
|
1877
|
+
n("signup-verify");
|
|
1878
|
+
}).catch((b) => {
|
|
1879
|
+
h(b.message);
|
|
1830
1880
|
});
|
|
1831
1881
|
}
|
|
1832
|
-
function
|
|
1833
|
-
|
|
1882
|
+
function w() {
|
|
1883
|
+
h(""), fetch(`${e.domain}/api/v1/signup/mfa/verify`, {
|
|
1884
|
+
method: "POST",
|
|
1885
|
+
mode: "cors",
|
|
1886
|
+
cache: "no-cache",
|
|
1887
|
+
headers: {
|
|
1888
|
+
"Content-Type": "application/json"
|
|
1889
|
+
},
|
|
1890
|
+
body: JSON.stringify({
|
|
1891
|
+
email: r(),
|
|
1892
|
+
code: o().toUpperCase().trim(),
|
|
1893
|
+
sectorID: e.sector,
|
|
1894
|
+
transactionId: Te()
|
|
1895
|
+
})
|
|
1896
|
+
}).then((i) => {
|
|
1897
|
+
if (i.ok) return i.json();
|
|
1898
|
+
throw i.status === 400 ? new Error(p.i18n("sa-signup-verify-error")) : new Error(p.i18n("sa-signup-verify-error"));
|
|
1899
|
+
}).then((i) => {
|
|
1900
|
+
Se(i.token), localStorage.setItem("spartan-token", i.token), me.getRootNode().host.dispatchEvent(new CustomEvent("spartan-login", {
|
|
1901
|
+
bubbles: !0,
|
|
1902
|
+
cancelable: !0,
|
|
1903
|
+
detail: {
|
|
1904
|
+
token: i.token
|
|
1905
|
+
}
|
|
1906
|
+
})), A(""), n("signup-webauthn");
|
|
1907
|
+
}).catch((i) => {
|
|
1908
|
+
h(i.message);
|
|
1909
|
+
});
|
|
1910
|
+
}
|
|
1911
|
+
async function T() {
|
|
1912
|
+
h("");
|
|
1913
|
+
try {
|
|
1914
|
+
const i = await fetch(`${e.domain}/api/v1/webauthn/registration/begin`, {
|
|
1915
|
+
method: "POST",
|
|
1916
|
+
mode: "cors",
|
|
1917
|
+
cache: "no-cache",
|
|
1918
|
+
headers: {
|
|
1919
|
+
"Content-Type": "application/json",
|
|
1920
|
+
Authorization: `bearer ${ye()}`
|
|
1921
|
+
},
|
|
1922
|
+
body: JSON.stringify({
|
|
1923
|
+
keyName: "Default",
|
|
1924
|
+
sectorID: e.sector
|
|
1925
|
+
})
|
|
1926
|
+
});
|
|
1927
|
+
if (!i.ok) throw new Error(p.i18n("sa-signup-webauthn-error"));
|
|
1928
|
+
const g = await i.json(), b = zt(g.Options), l = await Nt(b);
|
|
1929
|
+
let f = JSON.parse(JSON.stringify(l));
|
|
1930
|
+
if (f.transactionID = g.TransactionID, !(await fetch(`${e.domain}/api/v1/webauthn/registration/finish`, {
|
|
1931
|
+
method: "POST",
|
|
1932
|
+
mode: "cors",
|
|
1933
|
+
cache: "no-cache",
|
|
1934
|
+
headers: {
|
|
1935
|
+
"Content-Type": "application/json",
|
|
1936
|
+
Authorization: `bearer ${ye()}`
|
|
1937
|
+
},
|
|
1938
|
+
body: JSON.stringify(f)
|
|
1939
|
+
})).ok) throw new Error(p.i18n("sa-signup-webauthn-error"));
|
|
1940
|
+
L();
|
|
1941
|
+
} catch (i) {
|
|
1942
|
+
h((i == null ? void 0 : i.message) || String(i));
|
|
1943
|
+
}
|
|
1944
|
+
}
|
|
1945
|
+
function L() {
|
|
1946
|
+
n(e.startMode), e.redirect !== "" && (window.location.href = e.redirect);
|
|
1947
|
+
}
|
|
1948
|
+
function M(i) {
|
|
1949
|
+
i.preventDefault(), console.log("login"), h(""), t() === "password" ? q() : t() === "webauthn" ? j() : t() === "otp-pick" ? U(he()) : t() === "otp" ? W() : t() === "reset-email" ? Z() : t() === "reset-code" && Y();
|
|
1834
1950
|
}
|
|
1835
|
-
function
|
|
1836
|
-
|
|
1951
|
+
function O(i) {
|
|
1952
|
+
i.preventDefault(), console.log("signup"), h(""), N(!1), fetch(`${e.domain}/api/v1/users`, {
|
|
1837
1953
|
method: "POST",
|
|
1838
1954
|
mode: "cors",
|
|
1839
1955
|
cache: "no-cache",
|
|
1840
1956
|
body: JSON.stringify({
|
|
1841
|
-
username:
|
|
1957
|
+
username: r(),
|
|
1842
1958
|
password: u(),
|
|
1843
1959
|
sectorID: e.sector
|
|
1844
1960
|
})
|
|
1845
|
-
}).then((
|
|
1846
|
-
if (
|
|
1847
|
-
return
|
|
1848
|
-
throw new Error(
|
|
1849
|
-
}).then((
|
|
1850
|
-
console.log(
|
|
1851
|
-
}).catch((
|
|
1852
|
-
N(!1),
|
|
1961
|
+
}).then((g) => {
|
|
1962
|
+
if (g.ok)
|
|
1963
|
+
return g.json();
|
|
1964
|
+
throw new Error(p.i18n("sa-error-creating-user"));
|
|
1965
|
+
}).then((g) => {
|
|
1966
|
+
console.log(g), ge() ? E(r(), g.enrollmentTransactionId || "") : (N(!0), n(e.startMode));
|
|
1967
|
+
}).catch((g) => {
|
|
1968
|
+
N(!1), h(g.message), console.log(g);
|
|
1853
1969
|
});
|
|
1854
1970
|
}
|
|
1855
|
-
function
|
|
1971
|
+
function j() {
|
|
1856
1972
|
console.log("webauthnLogin"), fetch(`${e.domain}/api/v1/login/webauthn/begin`, {
|
|
1857
1973
|
method: "POST",
|
|
1858
1974
|
mode: "cors",
|
|
1859
1975
|
cache: "no-cache",
|
|
1860
1976
|
body: JSON.stringify({
|
|
1861
|
-
username:
|
|
1977
|
+
username: r(),
|
|
1862
1978
|
sectorID: e.sector
|
|
1863
1979
|
})
|
|
1864
|
-
}).then((
|
|
1865
|
-
if (
|
|
1866
|
-
return
|
|
1867
|
-
throw
|
|
1868
|
-
}).then((
|
|
1869
|
-
console.log(
|
|
1870
|
-
const
|
|
1871
|
-
return console.log("Parsed WebAuthn request options:",
|
|
1872
|
-
const
|
|
1873
|
-
let
|
|
1874
|
-
return
|
|
1980
|
+
}).then((i) => {
|
|
1981
|
+
if (i.ok)
|
|
1982
|
+
return i.json();
|
|
1983
|
+
throw i.status === 401 ? (n("password"), h(p.i18n("webauthn-not-enrolled")), new Error(p.i18n("webauthn-not-enrolled"))) : new Error(`${i.status} ${i.statusText}: Network response was not ok.`);
|
|
1984
|
+
}).then((i) => {
|
|
1985
|
+
console.log(i);
|
|
1986
|
+
const g = Li(i.CredentialAssertion);
|
|
1987
|
+
return console.log("Parsed WebAuthn request options:", g), Ui(g).then((b) => {
|
|
1988
|
+
const l = JSON.stringify(b);
|
|
1989
|
+
let f = JSON.parse(l);
|
|
1990
|
+
return f.transactionID = i.TransactionID, f;
|
|
1875
1991
|
});
|
|
1876
|
-
}).then((
|
|
1992
|
+
}).then((i) => fetch(`${e.domain}/api/v1/login/webauthn/finish`, {
|
|
1877
1993
|
method: "POST",
|
|
1878
1994
|
mode: "cors",
|
|
1879
1995
|
cache: "no-cache",
|
|
1880
|
-
body: JSON.stringify(
|
|
1881
|
-
})).then(
|
|
1882
|
-
|
|
1996
|
+
body: JSON.stringify(i)
|
|
1997
|
+
})).then(I).catch((i) => {
|
|
1998
|
+
h(i.message), console.log(i);
|
|
1883
1999
|
});
|
|
1884
2000
|
}
|
|
1885
|
-
function
|
|
2001
|
+
function q() {
|
|
1886
2002
|
console.log("password login"), fetch(e.domain + "/api/v1/login/password", {
|
|
1887
2003
|
method: "post",
|
|
1888
2004
|
mode: "cors",
|
|
1889
2005
|
cache: "no-cache",
|
|
1890
2006
|
body: JSON.stringify({
|
|
1891
|
-
username:
|
|
2007
|
+
username: r(),
|
|
1892
2008
|
password: u(),
|
|
1893
2009
|
sectorID: e.sector
|
|
1894
2010
|
})
|
|
1895
|
-
}).then(
|
|
2011
|
+
}).then(I);
|
|
1896
2012
|
}
|
|
1897
|
-
async function
|
|
1898
|
-
let
|
|
1899
|
-
return
|
|
1900
|
-
if (
|
|
1901
|
-
return
|
|
2013
|
+
async function I(i) {
|
|
2014
|
+
let g = Promise.resolve(i);
|
|
2015
|
+
return g.then((b) => {
|
|
2016
|
+
if (i.ok)
|
|
2017
|
+
return i.json();
|
|
1902
2018
|
throw new Error("Network response was not ok.");
|
|
1903
|
-
}).then((
|
|
1904
|
-
if (console.log(
|
|
1905
|
-
|
|
2019
|
+
}).then((b) => {
|
|
2020
|
+
if (console.log(b), localStorage.setItem("spartan-txid", b.transactionID), !b.token) {
|
|
2021
|
+
if (b.challengeType === "email_enrollment") {
|
|
2022
|
+
E(r(), b.transactionID || "");
|
|
2023
|
+
return;
|
|
2024
|
+
}
|
|
2025
|
+
b.challengeType.indexOf("otp") !== -1 ? H() : b.challengeType.indexOf("webauthn") !== -1 ? (n("webauthn"), h(p.i18n("sa-webauthn-required"))) : h(p.i18n("sa-unknown-challenge"));
|
|
1906
2026
|
return;
|
|
1907
2027
|
}
|
|
1908
|
-
localStorage.setItem("spartan-token",
|
|
1909
|
-
const
|
|
2028
|
+
localStorage.setItem("spartan-token", b.token);
|
|
2029
|
+
const l = new CustomEvent("spartan-login", {
|
|
1910
2030
|
bubbles: !0,
|
|
1911
2031
|
cancelable: !0,
|
|
1912
2032
|
detail: {
|
|
1913
|
-
token:
|
|
1914
|
-
transactionID:
|
|
2033
|
+
token: b.token,
|
|
2034
|
+
transactionID: b.transactionID
|
|
1915
2035
|
}
|
|
1916
2036
|
});
|
|
1917
|
-
|
|
1918
|
-
}).catch((
|
|
1919
|
-
|
|
1920
|
-
console.log(
|
|
1921
|
-
}).catch((
|
|
1922
|
-
console.log(
|
|
1923
|
-
}), console.log(
|
|
1924
|
-
}),
|
|
1925
|
-
}
|
|
1926
|
-
function
|
|
1927
|
-
const
|
|
1928
|
-
fetch(e.domain + `/api/v1/otp/${encodeURIComponent(
|
|
2037
|
+
me.getRootNode().host.dispatchEvent(l), _() !== "" && (window.location.href = _());
|
|
2038
|
+
}).catch((b) => {
|
|
2039
|
+
b.json().then((l) => {
|
|
2040
|
+
console.log(l.message), h(l.message);
|
|
2041
|
+
}).catch((l) => {
|
|
2042
|
+
console.log(l);
|
|
2043
|
+
}), console.log(b);
|
|
2044
|
+
}), g;
|
|
2045
|
+
}
|
|
2046
|
+
function H() {
|
|
2047
|
+
const i = localStorage.getItem("spartan-txid") || "";
|
|
2048
|
+
fetch(e.domain + `/api/v1/otp/${encodeURIComponent(r())}?transactionID=${encodeURIComponent(i)}§orID=${encodeURIComponent(e.sector)}`, {
|
|
1929
2049
|
method: "get",
|
|
1930
2050
|
mode: "cors",
|
|
1931
2051
|
cache: "no-cache"
|
|
1932
|
-
}).then((
|
|
1933
|
-
if (
|
|
1934
|
-
return
|
|
1935
|
-
throw new Error(
|
|
1936
|
-
}).then((
|
|
1937
|
-
const
|
|
1938
|
-
if (
|
|
1939
|
-
p
|
|
2052
|
+
}).then((g) => {
|
|
2053
|
+
if (g.ok)
|
|
2054
|
+
return g.json();
|
|
2055
|
+
throw new Error(p.i18n("error-otp-list"));
|
|
2056
|
+
}).then((g) => {
|
|
2057
|
+
const b = g.registrations || [];
|
|
2058
|
+
if (b.length === 0) {
|
|
2059
|
+
h(p.i18n("sa-otp-no-registrations"));
|
|
1940
2060
|
return;
|
|
1941
2061
|
}
|
|
1942
|
-
|
|
1943
|
-
}).catch((
|
|
1944
|
-
|
|
2062
|
+
b.length === 1 ? U(b[0].ID || "") : (fe(b), k(b[0].ID || ""), n("otp-pick"), h(""));
|
|
2063
|
+
}).catch((g) => {
|
|
2064
|
+
h(g.message), console.log(g);
|
|
1945
2065
|
});
|
|
1946
2066
|
}
|
|
1947
|
-
function
|
|
1948
|
-
console.log("begin OTP, registrationID:",
|
|
2067
|
+
function U(i) {
|
|
2068
|
+
console.log("begin OTP, registrationID:", i), fetch(e.domain + "/api/v1/login/otp/begin", {
|
|
1949
2069
|
method: "post",
|
|
1950
2070
|
mode: "cors",
|
|
1951
2071
|
cache: "no-cache",
|
|
1952
2072
|
body: JSON.stringify({
|
|
1953
|
-
username:
|
|
2073
|
+
username: r(),
|
|
1954
2074
|
transactionID: localStorage.getItem("spartan-txid"),
|
|
1955
|
-
registrationID:
|
|
2075
|
+
registrationID: i,
|
|
1956
2076
|
sectorID: e.sector
|
|
1957
2077
|
})
|
|
1958
|
-
}).then((
|
|
1959
|
-
if (
|
|
1960
|
-
return
|
|
1961
|
-
throw new Error(`${
|
|
1962
|
-
}).then((
|
|
1963
|
-
console.log(
|
|
1964
|
-
}).catch((
|
|
1965
|
-
|
|
2078
|
+
}).then((g) => {
|
|
2079
|
+
if (g.ok)
|
|
2080
|
+
return g.json();
|
|
2081
|
+
throw new Error(`${g.status} ${g.statusText}`);
|
|
2082
|
+
}).then((g) => {
|
|
2083
|
+
console.log(g), g.transactionID && localStorage.setItem("spartan-txid", g.transactionID), A(""), h(""), n("otp");
|
|
2084
|
+
}).catch((g) => {
|
|
2085
|
+
h(g.message), console.log(g);
|
|
1966
2086
|
});
|
|
1967
2087
|
}
|
|
1968
|
-
function
|
|
2088
|
+
function W() {
|
|
1969
2089
|
console.log("OTP login submit"), fetch(e.domain + "/api/v1/login/otp", {
|
|
1970
2090
|
method: "post",
|
|
1971
2091
|
mode: "cors",
|
|
1972
2092
|
cache: "no-cache",
|
|
1973
2093
|
body: JSON.stringify({
|
|
1974
|
-
username:
|
|
1975
|
-
password:
|
|
2094
|
+
username: r(),
|
|
2095
|
+
password: o(),
|
|
1976
2096
|
transactionID: localStorage.getItem("spartan-txid"),
|
|
1977
2097
|
sectorID: e.sector
|
|
1978
2098
|
})
|
|
1979
|
-
}).then(
|
|
2099
|
+
}).then(I);
|
|
1980
2100
|
}
|
|
1981
|
-
function
|
|
1982
|
-
console.log("begin password reset"),
|
|
2101
|
+
function Z() {
|
|
2102
|
+
console.log("begin password reset"), h(""), Q(!1), fetch(`${e.domain}/api/v1/password/reset/begin`, {
|
|
1983
2103
|
method: "POST",
|
|
1984
2104
|
mode: "cors",
|
|
1985
2105
|
cache: "no-cache",
|
|
@@ -1987,21 +2107,21 @@ tt("spartan-login", aa, (e) => {
|
|
|
1987
2107
|
"Content-Type": "application/json"
|
|
1988
2108
|
},
|
|
1989
2109
|
body: JSON.stringify({
|
|
1990
|
-
email:
|
|
2110
|
+
email: r(),
|
|
1991
2111
|
sectorID: e.sector
|
|
1992
2112
|
})
|
|
1993
|
-
}).then((
|
|
1994
|
-
if (
|
|
1995
|
-
return
|
|
1996
|
-
throw new Error(
|
|
1997
|
-
}).then((
|
|
1998
|
-
console.log(
|
|
1999
|
-
}).catch((
|
|
2000
|
-
|
|
2113
|
+
}).then((i) => {
|
|
2114
|
+
if (i.ok)
|
|
2115
|
+
return i.json();
|
|
2116
|
+
throw new Error(p.i18n("sa-reset-error"));
|
|
2117
|
+
}).then((i) => {
|
|
2118
|
+
console.log(i), h(p.i18n("sa-reset-email-sent")), R(""), K(""), n("reset-code");
|
|
2119
|
+
}).catch((i) => {
|
|
2120
|
+
h(i.message), console.log(i);
|
|
2001
2121
|
});
|
|
2002
2122
|
}
|
|
2003
|
-
function
|
|
2004
|
-
console.log("complete password reset"),
|
|
2123
|
+
function Y() {
|
|
2124
|
+
console.log("complete password reset"), h(""), fetch(`${e.domain}/api/v1/password/reset/complete`, {
|
|
2005
2125
|
method: "POST",
|
|
2006
2126
|
mode: "cors",
|
|
2007
2127
|
cache: "no-cache",
|
|
@@ -2009,142 +2129,172 @@ tt("spartan-login", aa, (e) => {
|
|
|
2009
2129
|
"Content-Type": "application/json"
|
|
2010
2130
|
},
|
|
2011
2131
|
body: JSON.stringify({
|
|
2012
|
-
email:
|
|
2013
|
-
code:
|
|
2014
|
-
newPassword:
|
|
2132
|
+
email: r(),
|
|
2133
|
+
code: ue().toUpperCase().trim(),
|
|
2134
|
+
newPassword: X(),
|
|
2015
2135
|
sectorID: e.sector
|
|
2016
2136
|
})
|
|
2017
|
-
}).then((
|
|
2018
|
-
if (
|
|
2019
|
-
return
|
|
2020
|
-
throw
|
|
2021
|
-
}).then((
|
|
2022
|
-
console.log(
|
|
2023
|
-
}).catch((
|
|
2024
|
-
|
|
2137
|
+
}).then((i) => {
|
|
2138
|
+
if (i.ok)
|
|
2139
|
+
return i.json();
|
|
2140
|
+
throw i.status === 400 ? new Error(p.i18n("sa-reset-error-code")) : new Error(p.i18n("sa-reset-error"));
|
|
2141
|
+
}).then((i) => {
|
|
2142
|
+
console.log(i), Q(!0), R(""), K(""), a(""), n(e.startMode);
|
|
2143
|
+
}).catch((i) => {
|
|
2144
|
+
h(i.message), console.log(i);
|
|
2025
2145
|
});
|
|
2026
2146
|
}
|
|
2027
2147
|
return (() => {
|
|
2028
|
-
var
|
|
2029
|
-
return typeof
|
|
2030
|
-
t() === "sign-up" ?
|
|
2031
|
-
}), d(
|
|
2032
|
-
var
|
|
2033
|
-
return () =>
|
|
2034
|
-
})()), d(
|
|
2035
|
-
var
|
|
2036
|
-
return d(
|
|
2037
|
-
})(),
|
|
2038
|
-
var
|
|
2039
|
-
return () =>
|
|
2040
|
-
var c =
|
|
2041
|
-
return d(c, () =>
|
|
2148
|
+
var i = Hi(), g = i.firstChild, b = g.nextSibling, l = b.nextSibling, f = l.nextSibling, B = me;
|
|
2149
|
+
return typeof B == "function" ? yt(B, i) : me = i, i.addEventListener("submit", (D) => {
|
|
2150
|
+
D.preventDefault(), t() === "sign-up" ? O(D) : t() === "signup-verify" ? (D.preventDefault(), w()) : M(D);
|
|
2151
|
+
}), d(b, Ae), d(l, (() => {
|
|
2152
|
+
var D = m(() => t() === "reset-email" || t() === "reset-code");
|
|
2153
|
+
return () => D() ? p.i18n("sa-reset-password") : m(() => t() === "signup-verify" || t() === "signup-webauthn")() ? p.i18n("sa-signup-mfa-title") : p.i18n("sa-login");
|
|
2154
|
+
})()), d(i, $ && (() => {
|
|
2155
|
+
var D = Wi();
|
|
2156
|
+
return d(D, $), D;
|
|
2157
|
+
})(), f), d(i, (() => {
|
|
2158
|
+
var D = m(() => !!De());
|
|
2159
|
+
return () => D() && (() => {
|
|
2160
|
+
var c = He();
|
|
2161
|
+
return d(c, () => p.i18n("sa-signup-complete")), c;
|
|
2042
2162
|
})();
|
|
2043
|
-
})(),
|
|
2044
|
-
var
|
|
2045
|
-
return () =>
|
|
2046
|
-
var c =
|
|
2047
|
-
return d(c, () =>
|
|
2163
|
+
})(), f), d(i, (() => {
|
|
2164
|
+
var D = m(() => !!ne());
|
|
2165
|
+
return () => D() && (() => {
|
|
2166
|
+
var c = He();
|
|
2167
|
+
return d(c, () => p.i18n("sa-reset-success")), c;
|
|
2048
2168
|
})();
|
|
2049
|
-
})(),
|
|
2050
|
-
var
|
|
2051
|
-
return () =>
|
|
2052
|
-
var c =
|
|
2053
|
-
return c.$$input = (
|
|
2054
|
-
})()),
|
|
2055
|
-
var c =
|
|
2056
|
-
return d(c, () =>
|
|
2169
|
+
})(), f), f.$$input = (D) => s(D.currentTarget.value), d(i, (() => {
|
|
2170
|
+
var D = m(() => t() !== "sign-up" && t() !== "signup-verify" && t() !== "signup-webauthn");
|
|
2171
|
+
return () => D() && [m(() => m(() => t() === "password")() && (() => {
|
|
2172
|
+
var c = Dt();
|
|
2173
|
+
return c.$$input = (C) => a(C.currentTarget.value), x(() => le(c, "placeholder", p.i18n("sa-password"))), x(() => c.value = u()), c;
|
|
2174
|
+
})()), m(() => m(() => t() === "webauthn")() && He()), m(() => m(() => t() === "otp-pick")() && [(() => {
|
|
2175
|
+
var c = We();
|
|
2176
|
+
return d(c, () => p.i18n("sa-otp-choose")), c;
|
|
2057
2177
|
})(), (() => {
|
|
2058
|
-
var c =
|
|
2059
|
-
return c.addEventListener("change", (
|
|
2060
|
-
var
|
|
2061
|
-
return
|
|
2062
|
-
})())),
|
|
2063
|
-
})()]),
|
|
2064
|
-
var c = Yi();
|
|
2065
|
-
return c.$$input = (g) => F(g.currentTarget.value), O(() => oe(c, "placeholder", b.i18n("sa-code"))), O(() => c.value = a()), c;
|
|
2066
|
-
})()), C(() => C(() => t() === "reset-code")() && [(() => {
|
|
2178
|
+
var c = Zi();
|
|
2179
|
+
return c.addEventListener("change", (C) => k(C.currentTarget.value)), d(c, () => de().map((C) => (() => {
|
|
2180
|
+
var P = Yi(), Ce = P.firstChild, Be = Ce.nextSibling;
|
|
2181
|
+
return Be.nextSibling, d(P, () => C.DisplayName || C.ID, Ce), d(P, () => C.Type, Be), x(() => P.value = C.ID), P;
|
|
2182
|
+
})())), x(() => c.value = he()), c;
|
|
2183
|
+
})()]), m(() => m(() => t() === "otp")() && (() => {
|
|
2067
2184
|
var c = Xi();
|
|
2068
|
-
return c.$$input = (
|
|
2185
|
+
return c.$$input = (C) => A(C.currentTarget.value), x(() => le(c, "placeholder", p.i18n("sa-code"))), x(() => c.value = o()), c;
|
|
2186
|
+
})()), m(() => m(() => t() === "reset-code")() && [(() => {
|
|
2187
|
+
var c = pt();
|
|
2188
|
+
return c.$$input = (C) => R(C.currentTarget.value), x(() => le(c, "placeholder", p.i18n("sa-reset-code"))), x(() => c.value = ue()), c;
|
|
2069
2189
|
})(), (() => {
|
|
2070
2190
|
var c = Qi();
|
|
2071
|
-
return c.$$input = (
|
|
2072
|
-
})()]),
|
|
2073
|
-
var c = ea(),
|
|
2074
|
-
return
|
|
2191
|
+
return c.$$input = (C) => K(C.currentTarget.value), x(() => le(c, "placeholder", p.i18n("sa-new-password"))), x(() => c.value = X()), c;
|
|
2192
|
+
})()]), m(() => m(() => t() === "password" || t() === "webauthn")() && (() => {
|
|
2193
|
+
var c = ea(), C = c.firstChild, P = C.nextSibling;
|
|
2194
|
+
return P.firstChild, c.$$click = () => n(t() === "password" ? "webauthn" : "password"), d(P, () => p.i18n("sa-use-password"), null), x(() => C.checked = t() === "password"), c;
|
|
2075
2195
|
})())];
|
|
2076
|
-
})(),
|
|
2077
|
-
var
|
|
2078
|
-
return () =>
|
|
2079
|
-
var c =
|
|
2080
|
-
return c.$$input = (
|
|
2196
|
+
})(), null), d(i, (() => {
|
|
2197
|
+
var D = m(() => t() === "sign-up");
|
|
2198
|
+
return () => D() && (() => {
|
|
2199
|
+
var c = Dt();
|
|
2200
|
+
return c.$$input = (C) => a(C.currentTarget.value), x(() => le(c, "placeholder", p.i18n("sa-password"))), x(() => c.value = u()), c;
|
|
2081
2201
|
})();
|
|
2082
|
-
})(),
|
|
2083
|
-
var
|
|
2084
|
-
return () =>
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
var c =
|
|
2202
|
+
})(), null), d(i, (() => {
|
|
2203
|
+
var D = m(() => t() === "signup-verify");
|
|
2204
|
+
return () => D() && [(() => {
|
|
2205
|
+
var c = We();
|
|
2206
|
+
return d(c, () => p.i18n("sa-signup-verify-prompt")), c;
|
|
2207
|
+
})(), (() => {
|
|
2208
|
+
var c = pt();
|
|
2209
|
+
return c.$$input = (C) => A(C.currentTarget.value), x(() => le(c, "placeholder", p.i18n("sa-code"))), x(() => c.value = o()), c;
|
|
2210
|
+
})()];
|
|
2211
|
+
})(), null), d(i, (() => {
|
|
2212
|
+
var D = m(() => t() === "signup-webauthn");
|
|
2213
|
+
return () => D() && (() => {
|
|
2214
|
+
var c = We();
|
|
2215
|
+
return d(c, () => p.i18n("sa-signup-webauthn-prompt")), c;
|
|
2216
|
+
})();
|
|
2217
|
+
})(), null), d(i, (() => {
|
|
2218
|
+
var D = m(() => t() !== "signup-webauthn");
|
|
2219
|
+
return () => D() && (() => {
|
|
2220
|
+
var c = ta();
|
|
2221
|
+
return d(c, (() => {
|
|
2222
|
+
var C = m(() => t() === "sign-up");
|
|
2223
|
+
return () => C() ? p.i18n("sa-signup") : m(() => t() === "otp-pick")() ? p.i18n("sa-otp-send-code") : m(() => t() === "otp")() ? p.i18n("sa-otp-verify") : m(() => t() === "reset-email")() ? p.i18n("sa-otp-send-code") : m(() => t() === "reset-code")() ? p.i18n("sa-reset-submit") : m(() => t() === "signup-verify")() ? p.i18n("sa-otp-verify") : p.i18n("sa-login");
|
|
2224
|
+
})()), c;
|
|
2225
|
+
})();
|
|
2226
|
+
})(), null), d(i, (() => {
|
|
2227
|
+
var D = m(() => t() === "signup-webauthn");
|
|
2228
|
+
return () => D() && [(() => {
|
|
2229
|
+
var c = na();
|
|
2230
|
+
return c.$$click = () => T(), d(c, () => p.i18n("sa-signup-webauthn-setup")), c;
|
|
2231
|
+
})(), (() => {
|
|
2232
|
+
var c = ze();
|
|
2233
|
+
return c.$$click = () => L(), d(c, () => p.i18n("sa-signup-webauthn-done")), c;
|
|
2234
|
+
})()];
|
|
2235
|
+
})(), null), d(i, (() => {
|
|
2236
|
+
var D = m(() => t() === "password");
|
|
2237
|
+
return () => D() && (() => {
|
|
2238
|
+
var c = ze();
|
|
2089
2239
|
return c.$$click = () => {
|
|
2090
|
-
|
|
2091
|
-
}, d(c, () =>
|
|
2240
|
+
h(""), Q(!1), n("reset-email");
|
|
2241
|
+
}, d(c, () => p.i18n("sa-forgot-password")), c;
|
|
2092
2242
|
})();
|
|
2093
|
-
})(), null), d(
|
|
2094
|
-
var
|
|
2095
|
-
return () =>
|
|
2096
|
-
var c =
|
|
2243
|
+
})(), null), d(i, (() => {
|
|
2244
|
+
var D = m(() => t() === "reset-email" || t() === "reset-code");
|
|
2245
|
+
return () => D() && (() => {
|
|
2246
|
+
var c = ze();
|
|
2097
2247
|
return c.$$click = () => {
|
|
2098
|
-
|
|
2099
|
-
}, d(c, () =>
|
|
2248
|
+
h(""), R(""), K(""), n(e.startMode);
|
|
2249
|
+
}, d(c, () => p.i18n("sa-back")), c;
|
|
2100
2250
|
})();
|
|
2101
|
-
})(), null), d(
|
|
2102
|
-
var
|
|
2103
|
-
return () =>
|
|
2104
|
-
var c =
|
|
2105
|
-
return c.$$click = () => t() === "sign-up" ?
|
|
2106
|
-
var
|
|
2107
|
-
return () =>
|
|
2251
|
+
})(), null), d(i, (() => {
|
|
2252
|
+
var D = m(() => !!(te() && t() !== "reset-email" && t() !== "reset-code" && t() !== "signup-verify" && t() !== "signup-webauthn"));
|
|
2253
|
+
return () => D() && (() => {
|
|
2254
|
+
var c = ze();
|
|
2255
|
+
return c.$$click = () => t() === "sign-up" ? n(e.startMode) : n("sign-up"), d(c, (() => {
|
|
2256
|
+
var C = m(() => t() === "sign-up");
|
|
2257
|
+
return () => C() ? p.i18n("sa-back") : p.i18n("sa-signup");
|
|
2108
2258
|
})()), c;
|
|
2109
2259
|
})();
|
|
2110
|
-
})(), null), d(
|
|
2111
|
-
var
|
|
2112
|
-
return () =>
|
|
2113
|
-
var c =
|
|
2114
|
-
return d(
|
|
2115
|
-
})(),
|
|
2116
|
-
var
|
|
2117
|
-
return
|
|
2118
|
-
var
|
|
2119
|
-
return () =>
|
|
2120
|
-
})(), null), d(
|
|
2121
|
-
var
|
|
2122
|
-
return () =>
|
|
2123
|
-
})(), null), d(
|
|
2124
|
-
var
|
|
2125
|
-
return () =>
|
|
2260
|
+
})(), null), d(i, (() => {
|
|
2261
|
+
var D = m(() => G().length > 0 && (t() === "password" || t() === "webauthn" || t() === "sign-up"));
|
|
2262
|
+
return () => D() && [(() => {
|
|
2263
|
+
var c = ra(), C = c.firstChild;
|
|
2264
|
+
return d(C, () => p.i18n("sa-or")), c;
|
|
2265
|
+
})(), m(() => G().map((c) => (() => {
|
|
2266
|
+
var C = sa();
|
|
2267
|
+
return C.$$click = () => Fe(c.provider), d(C, (() => {
|
|
2268
|
+
var P = m(() => c.provider === "google");
|
|
2269
|
+
return () => P() && ua();
|
|
2270
|
+
})(), null), d(C, (() => {
|
|
2271
|
+
var P = m(() => c.provider === "github");
|
|
2272
|
+
return () => P() && ia();
|
|
2273
|
+
})(), null), d(C, (() => {
|
|
2274
|
+
var P = m(() => c.provider === "apple");
|
|
2275
|
+
return () => P() && // <svg width="18" height="18" viewBox="0 0 814 1000" xmlns="http://www.w3.org/2000/svg">
|
|
2126
2276
|
// <path d="M788.1 340.9c-5.8 4.5-108.2 62.2-108.2 190.5 0 148.4 130.3 200.9 134.2 202.2-.6 3.2-20.7 71.9-68.7 141.9-42.8 61.6-87.5 123.1-155.5 123.1s-85.5-39.5-164-39.5c-76 0-103.7 40.8-165.9 40.8s-105-57.8-155.5-127.4C46 790.7 0 663 0 541.8c0-207.8 134.4-317.3 266.5-317.3 100.3 0 183.4 67.7 244.6 67.7 57.3 0 147.4-71.6 260.1-71.6zm-174.5-92.5c-50.9 67-123.1 110.6-195.7 110.6-8.3 0-16.6-.8-24.8-2.5 1.7-63.2 43.3-131.2 94.1-179.3 52.7-49.9 132.7-85.3 207.3-87.5 1.6 8.8 2.4 17.7 2.4 26.7 0 61.6-28.4 127-83.3 131.9z" fill="currentColor"/>
|
|
2127
2277
|
// </svg>
|
|
2128
|
-
|
|
2129
|
-
})(), null), d(
|
|
2130
|
-
var
|
|
2131
|
-
return () =>
|
|
2132
|
-
})(), null), d(
|
|
2133
|
-
var
|
|
2134
|
-
return () =>
|
|
2135
|
-
})(), null),
|
|
2278
|
+
aa();
|
|
2279
|
+
})(), null), d(C, (() => {
|
|
2280
|
+
var P = m(() => c.provider === "oidc");
|
|
2281
|
+
return () => P() && oa();
|
|
2282
|
+
})(), null), d(C, (() => {
|
|
2283
|
+
var P = m(() => c.provider === "google");
|
|
2284
|
+
return () => P() ? p.i18n("sa-social-google") : m(() => c.provider === "github")() ? p.i18n("sa-social-github") : m(() => c.provider === "apple")() ? p.i18n("sa-social-apple") : p.i18n("sa-social-oidc");
|
|
2285
|
+
})(), null), x(() => C.disabled = !!v()), C;
|
|
2136
2286
|
})()))];
|
|
2137
|
-
})(), null),
|
|
2138
|
-
var c =
|
|
2139
|
-
return c !==
|
|
2287
|
+
})(), null), x((D) => {
|
|
2288
|
+
var c = p.i18n("sa-username"), C = t() === "otp" || t() === "otp-pick" || t() === "reset-code" || t() === "signup-verify" || t() === "signup-webauthn";
|
|
2289
|
+
return c !== D.e && le(f, "placeholder", D.e = c), C !== D.t && (f.disabled = D.t = C), D;
|
|
2140
2290
|
}, {
|
|
2141
2291
|
e: void 0,
|
|
2142
2292
|
t: void 0
|
|
2143
|
-
}),
|
|
2293
|
+
}), x(() => f.value = r()), i;
|
|
2144
2294
|
})();
|
|
2145
2295
|
});
|
|
2146
|
-
|
|
2147
|
-
var
|
|
2296
|
+
tt(["input", "click"]);
|
|
2297
|
+
var ca = /* @__PURE__ */ y(`<div class=container><style>.container {
|
|
2148
2298
|
background-color: #ffffff;
|
|
2149
2299
|
border-radius: 10px;
|
|
2150
2300
|
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
|
|
@@ -2317,8 +2467,8 @@ var oa = /* @__PURE__ */ B(`<div class=container><style>.container {
|
|
|
2317
2467
|
.modal-content .btn.verify:hover {
|
|
2318
2468
|
background-color: #0056b3;
|
|
2319
2469
|
}
|
|
2320
|
-
</style><style></style><h1 class=header>`),
|
|
2321
|
-
const
|
|
2470
|
+
</style><style></style><h1 class=header>`), gt = /* @__PURE__ */ y("<span class=error-message>"), da = /* @__PURE__ */ y("<div class=section><h2></h2><div class=security-keys>"), fa = /* @__PURE__ */ y('<div class=key-item><span></span><button class="btn remove">'), mt = /* @__PURE__ */ y("<span>"), ha = /* @__PURE__ */ y("<div class=section><div class=security-keys>"), Da = /* @__PURE__ */ y('<button class="btn add">+ '), pa = /* @__PURE__ */ y('<div class=add-key-form><div class=add-key-item><label for=keyName style=display:none;></label><input id=keyName type=text><button class="btn remove"></button><button class="btn add">'), ga = /* @__PURE__ */ y("<div class=section><h2></h2><table><thead><tr><th></th><th></th><th></th></tr></thead><tbody>"), ma = /* @__PURE__ */ y('<tr class=mfa-list-item><td></td><td></td><td><button class="btn remove">'), ba = /* @__PURE__ */ y('<span> <button class="btn validate">'), Ca = /* @__PURE__ */ y('<div class=section><div class=mfa-manage><button class="btn add">+ '), va = /* @__PURE__ */ y('<div class=section><h2></h2><div class=mfa-manage><div class=mfa-item><label for=email></label><input id=email type=text><button class="btn add"></button></div><div class=mfa-item><label for=phone></label><input id=phone type=text><button class="btn add"></button></div><div class=mfa-item><button class="btn remove">'), Aa = /* @__PURE__ */ y('<div class=modal id=mfaModal><div class=modal-content><span class=close id=closeModal>×</span><h2>MFA Verification</h2><p>Please enter the verification code sent to your email or phone:</p><input type=text id=mfaCode placeholder="Enter verification code"><button class="btn verify"id=verifyMfa>Verify');
|
|
2471
|
+
const wa = {
|
|
2322
2472
|
domain: "http://127.0.0.1:11000",
|
|
2323
2473
|
sector: "0ad5c3e5-0186-4557-8b32-4b36f247bf09",
|
|
2324
2474
|
// defaults to the admin sector
|
|
@@ -2328,174 +2478,174 @@ const Aa = {
|
|
|
2328
2478
|
redirect: "/",
|
|
2329
2479
|
redirectOnUnauthenticated: !0
|
|
2330
2480
|
};
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
const [t,
|
|
2334
|
-
let
|
|
2481
|
+
nt("spartan-account-settings", wa, (e) => {
|
|
2482
|
+
F(""), F("");
|
|
2483
|
+
const [t, n] = F(""), [r, s] = F(""), [u, a] = F(""), [o] = F(e.showWebAuthn), [A, $] = F(!1), [h, _] = F(!1), [te, se] = F(!1), [De, N] = F(!1), [ne, Q] = F([]), [ue, R] = F([]), [X, K] = F(""), [de, fe] = F(""), [he, k] = F(""), [G, pe] = F(""), v = rt(e.locale);
|
|
2484
|
+
let ie;
|
|
2335
2485
|
try {
|
|
2336
|
-
|
|
2486
|
+
ie = e.styles;
|
|
2337
2487
|
} catch {
|
|
2338
|
-
|
|
2488
|
+
ie = "";
|
|
2339
2489
|
}
|
|
2340
|
-
|
|
2341
|
-
if (
|
|
2342
|
-
|
|
2490
|
+
Qe(async () => {
|
|
2491
|
+
if (Mt())
|
|
2492
|
+
_(!0), s("");
|
|
2343
2493
|
else {
|
|
2344
2494
|
if (e.redirectOnUnauthenticated) {
|
|
2345
2495
|
window.location.href = e.redirect;
|
|
2346
2496
|
return;
|
|
2347
2497
|
}
|
|
2348
|
-
|
|
2498
|
+
_(!1), s(v.i18n("not-authenticated"));
|
|
2349
2499
|
}
|
|
2350
|
-
|
|
2351
|
-
console.log(
|
|
2352
|
-
}), await
|
|
2353
|
-
|
|
2500
|
+
ge().then((w) => {
|
|
2501
|
+
console.log(w);
|
|
2502
|
+
}), await Ee(), be().then((w) => {
|
|
2503
|
+
R(w.registrations);
|
|
2354
2504
|
});
|
|
2355
2505
|
});
|
|
2356
|
-
async function
|
|
2357
|
-
return await (await fetch(`${e.domain}/api/v1/users/self`,
|
|
2506
|
+
async function ge() {
|
|
2507
|
+
return await (await fetch(`${e.domain}/api/v1/users/self`, oe("get"))).json();
|
|
2358
2508
|
}
|
|
2359
|
-
function
|
|
2509
|
+
function oe(E = "get") {
|
|
2360
2510
|
return {
|
|
2361
2511
|
method: E,
|
|
2362
2512
|
mode: "cors",
|
|
2363
2513
|
cache: "no-cache",
|
|
2364
2514
|
headers: {
|
|
2365
2515
|
"Content-Type": "application",
|
|
2366
|
-
Authorization: `bearer ${
|
|
2516
|
+
Authorization: `bearer ${Ki()}`
|
|
2367
2517
|
}
|
|
2368
2518
|
};
|
|
2369
2519
|
}
|
|
2370
|
-
function
|
|
2371
|
-
let E =
|
|
2520
|
+
function ye() {
|
|
2521
|
+
let E = oe("post");
|
|
2372
2522
|
E.body = JSON.stringify({
|
|
2373
2523
|
keyName: t(),
|
|
2374
2524
|
sectorID: e.sector
|
|
2375
|
-
}), fetch(`${e.domain}/api/v1/webauthn/registration/begin`, E).then((
|
|
2376
|
-
if (
|
|
2377
|
-
return
|
|
2378
|
-
throw
|
|
2379
|
-
}).then((
|
|
2380
|
-
|
|
2381
|
-
s(
|
|
2382
|
-
}) : s(
|
|
2525
|
+
}), fetch(`${e.domain}/api/v1/webauthn/registration/begin`, E).then((w) => {
|
|
2526
|
+
if (w.status === 200)
|
|
2527
|
+
return w.json();
|
|
2528
|
+
throw w;
|
|
2529
|
+
}).then((w) => (console.log(w), Se(w))).catch((w) => {
|
|
2530
|
+
w.json ? w.json().then((T) => {
|
|
2531
|
+
s(T.message);
|
|
2532
|
+
}) : s(w);
|
|
2383
2533
|
});
|
|
2384
2534
|
}
|
|
2385
|
-
async function
|
|
2535
|
+
async function Se(E) {
|
|
2386
2536
|
try {
|
|
2387
|
-
const
|
|
2388
|
-
console.log("Parsed WebAuthn creation options:",
|
|
2389
|
-
const
|
|
2390
|
-
let
|
|
2391
|
-
|
|
2392
|
-
let
|
|
2393
|
-
|
|
2394
|
-
const
|
|
2395
|
-
if (
|
|
2396
|
-
const
|
|
2397
|
-
s(
|
|
2537
|
+
const w = zt(E.Options);
|
|
2538
|
+
console.log("Parsed WebAuthn creation options:", w);
|
|
2539
|
+
const T = await Nt(w), L = JSON.stringify(T);
|
|
2540
|
+
let M = JSON.parse(L);
|
|
2541
|
+
M.transactionID = E.TransactionID;
|
|
2542
|
+
let O = oe("post");
|
|
2543
|
+
O.body = JSON.stringify(M);
|
|
2544
|
+
const j = await fetch(`${e.domain}/api/v1/webauthn/registration/finish`, O);
|
|
2545
|
+
if (j.status !== 200) {
|
|
2546
|
+
const q = await j.json();
|
|
2547
|
+
s(q.message);
|
|
2398
2548
|
return;
|
|
2399
2549
|
}
|
|
2400
|
-
|
|
2401
|
-
} catch (
|
|
2402
|
-
console.error("WebAuthn registration error:",
|
|
2550
|
+
$(!1), n(""), Ee();
|
|
2551
|
+
} catch (w) {
|
|
2552
|
+
console.error("WebAuthn registration error:", w), s((w == null ? void 0 : w.message) || String(w));
|
|
2403
2553
|
}
|
|
2404
2554
|
}
|
|
2405
|
-
async function
|
|
2406
|
-
let
|
|
2407
|
-
|
|
2555
|
+
async function Te(E) {
|
|
2556
|
+
let w = oe("delete");
|
|
2557
|
+
w.body = JSON.stringify({
|
|
2408
2558
|
ID: E
|
|
2409
2559
|
});
|
|
2410
2560
|
try {
|
|
2411
|
-
if ((await fetch(`${e.domain}/api/v1/webauthn/${E}`,
|
|
2412
|
-
s(
|
|
2561
|
+
if ((await fetch(`${e.domain}/api/v1/webauthn/${E}`, w)).status !== 200) {
|
|
2562
|
+
s(v.i18n("error-webauthn-remove"));
|
|
2413
2563
|
return;
|
|
2414
2564
|
}
|
|
2415
|
-
|
|
2416
|
-
} catch (
|
|
2417
|
-
console.error(
|
|
2565
|
+
Ee();
|
|
2566
|
+
} catch (T) {
|
|
2567
|
+
console.error(T), s(v.i18n("error-webauthn-remove"));
|
|
2418
2568
|
return;
|
|
2419
2569
|
}
|
|
2420
2570
|
}
|
|
2421
|
-
async function
|
|
2422
|
-
let E =
|
|
2571
|
+
async function Ee() {
|
|
2572
|
+
let E = oe("get");
|
|
2423
2573
|
try {
|
|
2424
|
-
const
|
|
2425
|
-
|
|
2426
|
-
} catch (
|
|
2427
|
-
console.error(
|
|
2574
|
+
const T = await (await fetch(`${e.domain}/api/v1/webauthn/registration/list`, E)).json();
|
|
2575
|
+
Q(T.registrations || []);
|
|
2576
|
+
} catch (w) {
|
|
2577
|
+
console.error(w), Q([]);
|
|
2428
2578
|
}
|
|
2429
2579
|
}
|
|
2430
|
-
async function
|
|
2431
|
-
const
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
}),
|
|
2580
|
+
async function p(E, w) {
|
|
2581
|
+
const T = await me(E, w);
|
|
2582
|
+
T && (be().then((L) => {
|
|
2583
|
+
R(L.registrations);
|
|
2584
|
+
}), K(T.transactionID), N(!0));
|
|
2435
2585
|
}
|
|
2436
|
-
async function
|
|
2437
|
-
let
|
|
2438
|
-
|
|
2586
|
+
async function me(E, w) {
|
|
2587
|
+
let T = oe("post");
|
|
2588
|
+
T.body = JSON.stringify({
|
|
2439
2589
|
destination: E,
|
|
2440
|
-
OTPType: Fe(
|
|
2590
|
+
OTPType: Fe(w),
|
|
2441
2591
|
sectorID: e.sector
|
|
2442
2592
|
});
|
|
2443
2593
|
try {
|
|
2444
|
-
const L = await fetch(`${e.domain}/api/v1/otp/begin`,
|
|
2594
|
+
const L = await fetch(`${e.domain}/api/v1/otp/begin`, T);
|
|
2445
2595
|
if (L.status !== 200) {
|
|
2446
|
-
s(
|
|
2596
|
+
s(v.i18n("error-otp-verification"));
|
|
2447
2597
|
return;
|
|
2448
2598
|
}
|
|
2449
2599
|
return await L.json();
|
|
2450
2600
|
} catch (L) {
|
|
2451
|
-
console.error(L), s(
|
|
2601
|
+
console.error(L), s(v.i18n("error-otp-registration"));
|
|
2452
2602
|
return;
|
|
2453
2603
|
}
|
|
2454
2604
|
}
|
|
2455
|
-
async function
|
|
2456
|
-
let
|
|
2457
|
-
|
|
2605
|
+
async function Ae(E, w) {
|
|
2606
|
+
let T = oe("post");
|
|
2607
|
+
T.body = JSON.stringify({
|
|
2458
2608
|
transactionID: E,
|
|
2459
|
-
password:
|
|
2609
|
+
password: w
|
|
2460
2610
|
});
|
|
2461
2611
|
try {
|
|
2462
|
-
const L = await fetch(`${e.domain}/api/v1/otp/finish`,
|
|
2612
|
+
const L = await fetch(`${e.domain}/api/v1/otp/finish`, T);
|
|
2463
2613
|
if (L.status !== 200) {
|
|
2464
|
-
|
|
2614
|
+
a(v.i18n("error-otp-verification"));
|
|
2465
2615
|
return;
|
|
2466
2616
|
}
|
|
2467
|
-
return N(!1),
|
|
2468
|
-
|
|
2617
|
+
return N(!1), fe(""), se(!1), pe(""), k(""), be().then((M) => {
|
|
2618
|
+
R(M.registrations);
|
|
2469
2619
|
}), await L.json();
|
|
2470
2620
|
} catch (L) {
|
|
2471
|
-
console.error(L),
|
|
2621
|
+
console.error(L), a(v.i18n("error-otp-registration"));
|
|
2472
2622
|
return;
|
|
2473
2623
|
}
|
|
2474
2624
|
}
|
|
2475
|
-
async function
|
|
2476
|
-
let E =
|
|
2625
|
+
async function be() {
|
|
2626
|
+
let E = oe("get");
|
|
2477
2627
|
try {
|
|
2478
2628
|
return await (await fetch(`${e.domain}/api/v1/otp/list`, E)).json();
|
|
2479
|
-
} catch (
|
|
2480
|
-
console.error(
|
|
2629
|
+
} catch (w) {
|
|
2630
|
+
console.error(w), s(v.i18n("error-otp-list"));
|
|
2481
2631
|
return;
|
|
2482
2632
|
}
|
|
2483
2633
|
}
|
|
2484
|
-
async function
|
|
2485
|
-
let
|
|
2486
|
-
|
|
2634
|
+
async function $e(E) {
|
|
2635
|
+
let w = oe("delete");
|
|
2636
|
+
w.body = JSON.stringify({
|
|
2487
2637
|
ID: E
|
|
2488
2638
|
});
|
|
2489
2639
|
try {
|
|
2490
|
-
if ((await fetch(`${e.domain}/api/v1/otp/${E}`,
|
|
2491
|
-
s(
|
|
2640
|
+
if ((await fetch(`${e.domain}/api/v1/otp/${E}`, w)).status !== 200) {
|
|
2641
|
+
s(v.i18n("error-otp-remove"));
|
|
2492
2642
|
return;
|
|
2493
2643
|
}
|
|
2494
|
-
|
|
2495
|
-
|
|
2644
|
+
be().then((L) => {
|
|
2645
|
+
R(L.registrations);
|
|
2496
2646
|
});
|
|
2497
|
-
} catch (
|
|
2498
|
-
console.error(
|
|
2647
|
+
} catch (T) {
|
|
2648
|
+
console.error(T), s(v.i18n("error-otp-remove"));
|
|
2499
2649
|
return;
|
|
2500
2650
|
}
|
|
2501
2651
|
}
|
|
@@ -2503,108 +2653,108 @@ tt("spartan-account-settings", Aa, (e) => {
|
|
|
2503
2653
|
return E === "EMAIL" ? 2 : 1;
|
|
2504
2654
|
}
|
|
2505
2655
|
return (() => {
|
|
2506
|
-
var E =
|
|
2507
|
-
return d(
|
|
2508
|
-
var
|
|
2509
|
-
return d(
|
|
2656
|
+
var E = ca(), w = E.firstChild, T = w.nextSibling, L = T.nextSibling;
|
|
2657
|
+
return d(T, ie), d(L, () => v.i18n("sa-account-settings")), d(E, r && (() => {
|
|
2658
|
+
var M = gt();
|
|
2659
|
+
return d(M, r), M;
|
|
2510
2660
|
})(), null), d(E, (() => {
|
|
2511
|
-
var
|
|
2512
|
-
return () =>
|
|
2513
|
-
var
|
|
2514
|
-
return d(
|
|
2515
|
-
var
|
|
2516
|
-
return d(
|
|
2517
|
-
confirm(
|
|
2518
|
-
}, d(
|
|
2519
|
-
})()), null), d(
|
|
2520
|
-
var
|
|
2521
|
-
return () =>
|
|
2522
|
-
var
|
|
2523
|
-
return d(
|
|
2661
|
+
var M = m(() => !!(o() && ne().length));
|
|
2662
|
+
return () => M() && (() => {
|
|
2663
|
+
var O = da(), j = O.firstChild, q = j.nextSibling;
|
|
2664
|
+
return d(j, () => v.i18n("sa-webauthn-security-keys")), d(q, () => ne().map((I) => (() => {
|
|
2665
|
+
var H = fa(), U = H.firstChild, W = U.nextSibling;
|
|
2666
|
+
return d(U, () => I.keyName), W.$$click = () => {
|
|
2667
|
+
confirm(v.i18n("sa-confirm-delete-key")) && Te(I.keyName);
|
|
2668
|
+
}, d(W, () => v.i18n("sa-remove")), H;
|
|
2669
|
+
})()), null), d(q, (() => {
|
|
2670
|
+
var I = m(() => ne().length <= 0);
|
|
2671
|
+
return () => I() && (() => {
|
|
2672
|
+
var H = mt();
|
|
2673
|
+
return d(H, () => v.i18n("sa-no-security-keys")), H;
|
|
2524
2674
|
})();
|
|
2525
|
-
})(), null),
|
|
2675
|
+
})(), null), O;
|
|
2526
2676
|
})();
|
|
2527
2677
|
})(), null), d(E, (() => {
|
|
2528
|
-
var
|
|
2529
|
-
return () =>
|
|
2530
|
-
var
|
|
2531
|
-
return d(
|
|
2532
|
-
var
|
|
2533
|
-
return () =>
|
|
2534
|
-
var
|
|
2535
|
-
return
|
|
2678
|
+
var M = m(() => !!o());
|
|
2679
|
+
return () => M() && (() => {
|
|
2680
|
+
var O = ha(), j = O.firstChild;
|
|
2681
|
+
return d(j, (() => {
|
|
2682
|
+
var q = m(() => !A());
|
|
2683
|
+
return () => q() && (() => {
|
|
2684
|
+
var I = Da();
|
|
2685
|
+
return I.firstChild, I.$$click = () => $(!0), d(I, () => v.i18n("sa-add-security-key"), null), I;
|
|
2536
2686
|
})();
|
|
2537
|
-
})(), null), d(
|
|
2538
|
-
var
|
|
2539
|
-
return () =>
|
|
2540
|
-
var
|
|
2541
|
-
return d(
|
|
2542
|
-
var
|
|
2543
|
-
return
|
|
2687
|
+
})(), null), d(j, (() => {
|
|
2688
|
+
var q = m(() => !!A());
|
|
2689
|
+
return () => q() && (() => {
|
|
2690
|
+
var I = pa(), H = I.firstChild, U = H.firstChild, W = U.nextSibling, Z = W.nextSibling, Y = Z.nextSibling;
|
|
2691
|
+
return d(U, () => v.i18n("sa-webauthn-key-name")), W.$$input = (i) => n(i.currentTarget.value), Z.$$click = () => $(!1), d(Z, () => v.i18n("sa-cancel")), Y.$$click = () => t() !== "" && ye(), d(Y, () => v.i18n("sa-register")), x((i) => {
|
|
2692
|
+
var g = v.i18n("sa-webauthn-key-name"), b = t() === "";
|
|
2693
|
+
return g !== i.e && le(W, "placeholder", i.e = g), b !== i.t && (Y.disabled = i.t = b), i;
|
|
2544
2694
|
}, {
|
|
2545
2695
|
e: void 0,
|
|
2546
2696
|
t: void 0
|
|
2547
|
-
}),
|
|
2697
|
+
}), x(() => W.value = t()), I;
|
|
2548
2698
|
})();
|
|
2549
|
-
})(), null),
|
|
2699
|
+
})(), null), O;
|
|
2550
2700
|
})();
|
|
2551
2701
|
})(), null), d(E, (() => {
|
|
2552
|
-
var
|
|
2553
|
-
return () =>
|
|
2554
|
-
var
|
|
2555
|
-
return d(
|
|
2556
|
-
var
|
|
2557
|
-
return d(
|
|
2558
|
-
var
|
|
2559
|
-
return () =>
|
|
2560
|
-
var
|
|
2561
|
-
return d(
|
|
2702
|
+
var M = m(() => ue().length > 0);
|
|
2703
|
+
return () => M() && (() => {
|
|
2704
|
+
var O = ga(), j = O.firstChild, q = j.nextSibling, I = q.firstChild, H = I.firstChild, U = H.firstChild, W = U.nextSibling, Z = W.nextSibling, Y = I.nextSibling;
|
|
2705
|
+
return d(j, () => v.i18n("sa-mfa")), d(U, () => v.i18n("sa-mfa-destination")), d(W, () => v.i18n("sa-mfa-validated")), d(Z, () => v.i18n("sa-mfa-action")), d(Y, () => ue().map((i) => (() => {
|
|
2706
|
+
var g = ma(), b = g.firstChild, l = b.nextSibling, f = l.nextSibling, B = f.firstChild;
|
|
2707
|
+
return d(b, () => i.DisplayName), d(l, (() => {
|
|
2708
|
+
var D = m(() => !!i.Validated);
|
|
2709
|
+
return () => D() ? (() => {
|
|
2710
|
+
var c = mt();
|
|
2711
|
+
return d(c, () => v.i18n("sa-yes")), c;
|
|
2562
2712
|
})() : (() => {
|
|
2563
|
-
var
|
|
2564
|
-
return d(
|
|
2565
|
-
|
|
2566
|
-
}, d(
|
|
2713
|
+
var c = ba(), C = c.firstChild, P = C.nextSibling;
|
|
2714
|
+
return d(c, () => v.i18n("sa-no"), C), P.$$click = () => {
|
|
2715
|
+
p(i.DisplayName, i.Type === "email" ? "EMAIL" : "SMS");
|
|
2716
|
+
}, d(P, () => v.i18n("sa-validate")), c;
|
|
2567
2717
|
})();
|
|
2568
|
-
})()),
|
|
2569
|
-
confirm(
|
|
2570
|
-
}, d(
|
|
2571
|
-
})())),
|
|
2718
|
+
})()), B.$$click = () => {
|
|
2719
|
+
confirm(v.i18n("sa-confirm-delete-key")) && $e(i.ID);
|
|
2720
|
+
}, d(B, () => v.i18n("sa-remove")), x(() => le(b, "title", i.DisplayName)), g;
|
|
2721
|
+
})())), O;
|
|
2572
2722
|
})();
|
|
2573
2723
|
})(), null), d(E, (() => {
|
|
2574
|
-
var
|
|
2575
|
-
return () =>
|
|
2576
|
-
var
|
|
2577
|
-
return
|
|
2724
|
+
var M = m(() => !te());
|
|
2725
|
+
return () => M() && (() => {
|
|
2726
|
+
var O = Ca(), j = O.firstChild, q = j.firstChild;
|
|
2727
|
+
return q.firstChild, q.$$click = () => se(!0), d(q, () => v.i18n("sa-register-mfa"), null), O;
|
|
2578
2728
|
})();
|
|
2579
2729
|
})(), null), d(E, (() => {
|
|
2580
|
-
var
|
|
2581
|
-
return () =>
|
|
2582
|
-
var
|
|
2583
|
-
return d(
|
|
2584
|
-
var
|
|
2585
|
-
return
|
|
2730
|
+
var M = m(() => !!te());
|
|
2731
|
+
return () => M() && (() => {
|
|
2732
|
+
var O = va(), j = O.firstChild, q = j.nextSibling, I = q.firstChild, H = I.firstChild, U = H.nextSibling, W = U.nextSibling, Z = I.nextSibling, Y = Z.firstChild, i = Y.nextSibling, g = i.nextSibling, b = Z.nextSibling, l = b.firstChild;
|
|
2733
|
+
return d(j, () => v.i18n("sa-add-mfa")), d(H, () => v.i18n("sa-email")), U.$$input = (f) => k(f.currentTarget.value), W.$$click = () => p(he(), "EMAIL"), d(W, () => v.i18n("sa-add-email")), d(Y, () => v.i18n("sa-phone")), i.$$input = (f) => pe(f.currentTarget.value), g.$$click = () => p(G(), "SMS"), d(g, () => v.i18n("sa-add-sms")), l.$$click = () => se(!1), d(l, () => v.i18n("sa-cancel")), x((f) => {
|
|
2734
|
+
var B = v.i18n("sa-email"), D = v.i18n("sa-phone");
|
|
2735
|
+
return B !== f.e && le(U, "placeholder", f.e = B), D !== f.t && le(i, "placeholder", f.t = D), f;
|
|
2586
2736
|
}, {
|
|
2587
2737
|
e: void 0,
|
|
2588
2738
|
t: void 0
|
|
2589
|
-
}),
|
|
2739
|
+
}), x(() => U.value = he()), x(() => i.value = G()), O;
|
|
2590
2740
|
})();
|
|
2591
2741
|
})(), null), d(E, (() => {
|
|
2592
|
-
var
|
|
2593
|
-
return () =>
|
|
2594
|
-
var
|
|
2595
|
-
return
|
|
2596
|
-
var
|
|
2597
|
-
return () =>
|
|
2598
|
-
var
|
|
2599
|
-
return d(
|
|
2742
|
+
var M = m(() => !!De());
|
|
2743
|
+
return () => M() && (() => {
|
|
2744
|
+
var O = Aa(), j = O.firstChild, q = j.firstChild, I = q.nextSibling, H = I.nextSibling, U = H.nextSibling, W = U.nextSibling;
|
|
2745
|
+
return O.$$click = () => N(!1), j.$$click = (Z) => Z.stopPropagation(), q.$$click = () => N(!1), d(j, (() => {
|
|
2746
|
+
var Z = m(() => !!u());
|
|
2747
|
+
return () => Z() && (() => {
|
|
2748
|
+
var Y = gt();
|
|
2749
|
+
return d(Y, u), Y;
|
|
2600
2750
|
})();
|
|
2601
|
-
})(),
|
|
2751
|
+
})(), H), U.$$input = (Z) => fe(Z.currentTarget.value), W.$$click = () => Ae(X(), de()), x(() => U.value = de()), O;
|
|
2602
2752
|
})();
|
|
2603
2753
|
})(), null), E;
|
|
2604
2754
|
})();
|
|
2605
2755
|
});
|
|
2606
|
-
|
|
2607
|
-
var
|
|
2756
|
+
tt(["click", "input"]);
|
|
2757
|
+
var Ea = /* @__PURE__ */ y(`<form class=invite-frame><style>.invite-frame {
|
|
2608
2758
|
display: flex;
|
|
2609
2759
|
flex-direction: column;
|
|
2610
2760
|
justify-content: center;
|
|
@@ -2664,8 +2814,8 @@ var va = /* @__PURE__ */ B(`<form class=invite-frame><style>.invite-frame {
|
|
|
2664
2814
|
margin-bottom: 10px;
|
|
2665
2815
|
display: block;
|
|
2666
2816
|
}
|
|
2667
|
-
</style><style></style><h1></h1><input type=text autocomplete=one-time-code required><span class=hint></span><input type=password autocomplete=new-password required minlength=8><span class=hint></span><button type=submit>`), Fa = /* @__PURE__ */
|
|
2668
|
-
const
|
|
2817
|
+
</style><style></style><h1></h1><input type=text autocomplete=one-time-code required><span class=hint></span><input type=password autocomplete=new-password required minlength=8><span class=hint></span><button type=submit>`), Fa = /* @__PURE__ */ y("<span class=info-message>"), ya = /* @__PURE__ */ y("<span class=error-message>"), $a = /* @__PURE__ */ y("<span class=success-message>");
|
|
2818
|
+
const Ba = {
|
|
2669
2819
|
domain: "http://127.0.0.1:11000",
|
|
2670
2820
|
sector: "0ad5c3e5-0186-4557-8b32-4b36f247bf09",
|
|
2671
2821
|
// defaults to the admin sector
|
|
@@ -2678,36 +2828,36 @@ const ya = {
|
|
|
2678
2828
|
redirect: ""
|
|
2679
2829
|
// where to redirect after successful completion
|
|
2680
2830
|
};
|
|
2681
|
-
|
|
2682
|
-
const [t,
|
|
2683
|
-
let
|
|
2831
|
+
nt("spartan-invite", Ba, (e) => {
|
|
2832
|
+
const [t, n] = F(""), [r, s] = F(""), [u, a] = F(""), [o, A] = F(""), [$, h] = F(!1), _ = rt(e.locale);
|
|
2833
|
+
let te, se;
|
|
2684
2834
|
try {
|
|
2685
|
-
|
|
2835
|
+
se = e.styles;
|
|
2686
2836
|
} catch {
|
|
2687
|
-
|
|
2837
|
+
se = "";
|
|
2688
2838
|
}
|
|
2689
|
-
|
|
2690
|
-
e.sub || new URLSearchParams(window.location.search).get("sub") ||
|
|
2691
|
-
const
|
|
2692
|
-
|
|
2839
|
+
Qe(async () => {
|
|
2840
|
+
e.sub || new URLSearchParams(window.location.search).get("sub") || a("Missing invitation information. Please use the link from your invite email.");
|
|
2841
|
+
const ne = new URLSearchParams(window.location.hash.replace("#", "")).get("otp");
|
|
2842
|
+
ne && n(ne);
|
|
2693
2843
|
});
|
|
2694
|
-
async function
|
|
2695
|
-
var
|
|
2696
|
-
if (N.preventDefault(),
|
|
2697
|
-
|
|
2844
|
+
async function De(N) {
|
|
2845
|
+
var ue, R;
|
|
2846
|
+
if (N.preventDefault(), a(""), A(""), h(!0), !t() || t().trim().length === 0) {
|
|
2847
|
+
a("Please enter your verification code"), h(!1);
|
|
2698
2848
|
return;
|
|
2699
2849
|
}
|
|
2700
|
-
if (!
|
|
2701
|
-
|
|
2850
|
+
if (!r() || r().length < 8) {
|
|
2851
|
+
a("Password must be at least 8 characters"), h(!1);
|
|
2702
2852
|
return;
|
|
2703
2853
|
}
|
|
2704
|
-
const
|
|
2705
|
-
if (!
|
|
2706
|
-
|
|
2854
|
+
const ne = new URLSearchParams(window.location.search), Q = e.sub || ne.get("sub") || "";
|
|
2855
|
+
if (!Q) {
|
|
2856
|
+
a("Missing invitation information"), h(!1);
|
|
2707
2857
|
return;
|
|
2708
2858
|
}
|
|
2709
2859
|
try {
|
|
2710
|
-
const
|
|
2860
|
+
const X = await fetch(`${e.domain}/api/v1/users/invite/complete`, {
|
|
2711
2861
|
method: "POST",
|
|
2712
2862
|
mode: "cors",
|
|
2713
2863
|
cache: "no-cache",
|
|
@@ -2715,67 +2865,67 @@ tt("spartan-invite", ya, (e) => {
|
|
|
2715
2865
|
"Content-Type": "application/json"
|
|
2716
2866
|
},
|
|
2717
2867
|
body: JSON.stringify({
|
|
2718
|
-
sub:
|
|
2868
|
+
sub: Q,
|
|
2719
2869
|
otp: t().toUpperCase().trim(),
|
|
2720
|
-
password:
|
|
2870
|
+
password: r(),
|
|
2721
2871
|
sectorID: e.sector
|
|
2722
2872
|
})
|
|
2723
2873
|
});
|
|
2724
|
-
if (
|
|
2725
|
-
const
|
|
2726
|
-
|
|
2727
|
-
const
|
|
2874
|
+
if (X.ok) {
|
|
2875
|
+
const K = await X.json();
|
|
2876
|
+
A(_.i18n("sa-invite-success"));
|
|
2877
|
+
const de = new CustomEvent("spartan-invite-complete", {
|
|
2728
2878
|
bubbles: !0,
|
|
2729
2879
|
cancelable: !0,
|
|
2730
2880
|
detail: {
|
|
2731
|
-
sub:
|
|
2881
|
+
sub: Q,
|
|
2732
2882
|
success: !0
|
|
2733
2883
|
}
|
|
2734
2884
|
});
|
|
2735
|
-
|
|
2885
|
+
te && te.getRootNode().host.dispatchEvent(de), setTimeout(() => {
|
|
2736
2886
|
e.redirect && e.redirect !== "" && (window.location.href = e.redirect);
|
|
2737
2887
|
}, 2e3);
|
|
2738
2888
|
} else {
|
|
2739
|
-
const
|
|
2740
|
-
|
|
2889
|
+
const K = await X.json().catch(() => ({}));
|
|
2890
|
+
X.status === 400 || (ue = K.message) != null && ue.includes("invalid OTP") ? a(_.i18n("sa-invite-error-otp")) : X.status === 504 || (R = K.message) != null && R.includes("expired") ? a(_.i18n("sa-invite-error-expired")) : a(K.message || _.i18n("sa-invite-error-generic")), h(!1);
|
|
2741
2891
|
}
|
|
2742
|
-
} catch (
|
|
2743
|
-
console.error("Error completing invite:",
|
|
2892
|
+
} catch (X) {
|
|
2893
|
+
console.error("Error completing invite:", X), a(_.i18n("sa-invite-error-generic")), h(!1);
|
|
2744
2894
|
}
|
|
2745
2895
|
}
|
|
2746
2896
|
return (() => {
|
|
2747
|
-
var N =
|
|
2748
|
-
return typeof
|
|
2749
|
-
var
|
|
2750
|
-
return () =>
|
|
2751
|
-
var
|
|
2752
|
-
return d(
|
|
2897
|
+
var N = Ea(), ne = N.firstChild, Q = ne.nextSibling, ue = Q.nextSibling, R = ue.nextSibling, X = R.nextSibling, K = X.nextSibling, de = K.nextSibling, fe = de.nextSibling, he = te;
|
|
2898
|
+
return typeof he == "function" ? yt(he, N) : te = N, N.addEventListener("submit", De), d(Q, se), d(ue, () => _.i18n("sa-complete-invite")), d(N, (() => {
|
|
2899
|
+
var k = m(() => !!e.email);
|
|
2900
|
+
return () => k() && (() => {
|
|
2901
|
+
var G = Fa();
|
|
2902
|
+
return d(G, () => e.email), G;
|
|
2753
2903
|
})();
|
|
2754
|
-
})(),
|
|
2755
|
-
var
|
|
2756
|
-
return () =>
|
|
2757
|
-
var
|
|
2758
|
-
return d(
|
|
2904
|
+
})(), R), d(N, (() => {
|
|
2905
|
+
var k = m(() => !!u());
|
|
2906
|
+
return () => k() && (() => {
|
|
2907
|
+
var G = ya();
|
|
2908
|
+
return d(G, u), G;
|
|
2759
2909
|
})();
|
|
2760
|
-
})(),
|
|
2761
|
-
var
|
|
2762
|
-
return () =>
|
|
2763
|
-
var
|
|
2764
|
-
return d(
|
|
2910
|
+
})(), R), d(N, (() => {
|
|
2911
|
+
var k = m(() => !!o());
|
|
2912
|
+
return () => k() && (() => {
|
|
2913
|
+
var G = $a();
|
|
2914
|
+
return d(G, o), G;
|
|
2765
2915
|
})();
|
|
2766
|
-
})(),
|
|
2767
|
-
var
|
|
2768
|
-
return () =>
|
|
2769
|
-
})()),
|
|
2770
|
-
var
|
|
2771
|
-
return
|
|
2916
|
+
})(), R), R.$$input = (k) => n(k.currentTarget.value), d(X, () => _.i18n("sa-invite-otp-hint")), K.$$input = (k) => s(k.currentTarget.value), d(de, () => _.i18n("sa-invite-password-hint")), d(fe, (() => {
|
|
2917
|
+
var k = m(() => !!$());
|
|
2918
|
+
return () => k() ? _.i18n("sa-invite-completing") : _.i18n("sa-invite-submit");
|
|
2919
|
+
})()), x((k) => {
|
|
2920
|
+
var G = _.i18n("sa-invite-otp"), pe = $() || o() !== "", v = _.i18n("sa-invite-password"), ie = $() || o() !== "", ge = $() || o() !== "";
|
|
2921
|
+
return G !== k.e && le(R, "placeholder", k.e = G), pe !== k.t && (R.disabled = k.t = pe), v !== k.a && le(K, "placeholder", k.a = v), ie !== k.o && (K.disabled = k.o = ie), ge !== k.i && (fe.disabled = k.i = ge), k;
|
|
2772
2922
|
}, {
|
|
2773
2923
|
e: void 0,
|
|
2774
2924
|
t: void 0,
|
|
2775
2925
|
a: void 0,
|
|
2776
2926
|
o: void 0,
|
|
2777
2927
|
i: void 0
|
|
2778
|
-
}),
|
|
2928
|
+
}), x(() => R.value = t()), x(() => K.value = r()), N;
|
|
2779
2929
|
})();
|
|
2780
2930
|
});
|
|
2781
|
-
|
|
2931
|
+
tt(["input"]);
|