@masonitestudios/spartanauth-widgets 1.0.0 → 1.0.2
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 +1336 -1206
- package/dist/sa-widgets.umd.js +32 -4
- package/package.json +1 -1
package/dist/sa-widgets.mjs
CHANGED
|
@@ -1,115 +1,115 @@
|
|
|
1
|
-
const
|
|
2
|
-
equals:
|
|
1
|
+
const Yt = (e, t) => e === t, He = {
|
|
2
|
+
equals: Yt
|
|
3
3
|
};
|
|
4
|
-
let
|
|
5
|
-
const
|
|
4
|
+
let St = It;
|
|
5
|
+
const _e = 1, We = 2, _t = {
|
|
6
6
|
owned: null,
|
|
7
7
|
cleanups: null,
|
|
8
8
|
context: null,
|
|
9
9
|
owner: null
|
|
10
10
|
};
|
|
11
|
-
var
|
|
12
|
-
let
|
|
13
|
-
function
|
|
14
|
-
const n =
|
|
11
|
+
var ce = null;
|
|
12
|
+
let rt = null, Xt = null, Y = null, ie = null, ke = null, et = 0;
|
|
13
|
+
function Qt(e, t) {
|
|
14
|
+
const n = Y, r = ce, s = e.length === 0, i = t === void 0 ? r : t, u = s ? _t : {
|
|
15
15
|
owned: null,
|
|
16
16
|
cleanups: null,
|
|
17
|
-
context:
|
|
18
|
-
owner:
|
|
19
|
-
},
|
|
20
|
-
|
|
17
|
+
context: i ? i.context : null,
|
|
18
|
+
owner: i
|
|
19
|
+
}, l = s ? e : () => e(() => tt(() => Ue(u)));
|
|
20
|
+
ce = u, Y = null;
|
|
21
21
|
try {
|
|
22
|
-
return
|
|
22
|
+
return Ve(l, !0);
|
|
23
23
|
} finally {
|
|
24
|
-
|
|
24
|
+
Y = n, ce = r;
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
|
-
function
|
|
28
|
-
t = t ? Object.assign({},
|
|
27
|
+
function w(e, t) {
|
|
28
|
+
t = t ? Object.assign({}, He, t) : He;
|
|
29
29
|
const n = {
|
|
30
30
|
value: e,
|
|
31
31
|
observers: null,
|
|
32
32
|
observerSlots: null,
|
|
33
33
|
comparator: t.equals || void 0
|
|
34
|
-
}, r = (s) => (typeof s == "function" && (s = s(n.value)),
|
|
35
|
-
return [
|
|
36
|
-
}
|
|
37
|
-
function
|
|
38
|
-
const r =
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
function
|
|
42
|
-
|
|
43
|
-
const r =
|
|
44
|
-
r.user = !0,
|
|
45
|
-
}
|
|
46
|
-
function
|
|
47
|
-
n = n ? Object.assign({},
|
|
48
|
-
const r =
|
|
49
|
-
return r.observers = null, r.observerSlots = null, r.comparator = n.equals || void 0,
|
|
50
|
-
}
|
|
51
|
-
function
|
|
52
|
-
if (
|
|
53
|
-
const t =
|
|
54
|
-
|
|
34
|
+
}, r = (s) => (typeof s == "function" && (s = s(n.value)), Ot(n, s));
|
|
35
|
+
return [Tt.bind(n), r];
|
|
36
|
+
}
|
|
37
|
+
function y(e, t, n) {
|
|
38
|
+
const r = dt(e, t, !1, _e);
|
|
39
|
+
Je(r);
|
|
40
|
+
}
|
|
41
|
+
function en(e, t, n) {
|
|
42
|
+
St = rn;
|
|
43
|
+
const r = dt(e, t, !1, _e);
|
|
44
|
+
r.user = !0, ke ? ke.push(r) : Je(r);
|
|
45
|
+
}
|
|
46
|
+
function h(e, t, n) {
|
|
47
|
+
n = n ? Object.assign({}, He, n) : He;
|
|
48
|
+
const r = dt(e, t, !0, 0);
|
|
49
|
+
return r.observers = null, r.observerSlots = null, r.comparator = n.equals || void 0, Je(r), Tt.bind(r);
|
|
50
|
+
}
|
|
51
|
+
function tt(e) {
|
|
52
|
+
if (Y === null) return e();
|
|
53
|
+
const t = Y;
|
|
54
|
+
Y = null;
|
|
55
55
|
try {
|
|
56
56
|
return e();
|
|
57
57
|
} finally {
|
|
58
|
-
|
|
58
|
+
Y = t;
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
|
-
function
|
|
62
|
-
|
|
61
|
+
function ct(e) {
|
|
62
|
+
en(() => tt(e));
|
|
63
63
|
}
|
|
64
|
-
function
|
|
64
|
+
function Tt() {
|
|
65
65
|
if (this.sources && this.state)
|
|
66
|
-
if (this.state ===
|
|
66
|
+
if (this.state === _e) Je(this);
|
|
67
67
|
else {
|
|
68
|
-
const e =
|
|
69
|
-
|
|
68
|
+
const e = ie;
|
|
69
|
+
ie = null, Ve(() => Ye(this), !1), ie = e;
|
|
70
70
|
}
|
|
71
|
-
if (
|
|
71
|
+
if (Y) {
|
|
72
72
|
const e = this.observers ? this.observers.length : 0;
|
|
73
|
-
|
|
73
|
+
Y.sources ? (Y.sources.push(this), Y.sourceSlots.push(e)) : (Y.sources = [this], Y.sourceSlots = [e]), this.observers ? (this.observers.push(Y), this.observerSlots.push(Y.sources.length - 1)) : (this.observers = [Y], this.observerSlots = [Y.sources.length - 1]);
|
|
74
74
|
}
|
|
75
75
|
return this.value;
|
|
76
76
|
}
|
|
77
|
-
function
|
|
77
|
+
function Ot(e, t, n) {
|
|
78
78
|
let r = e.value;
|
|
79
|
-
return (!e.comparator || !e.comparator(r, t)) && (e.value = t, e.observers && e.observers.length &&
|
|
79
|
+
return (!e.comparator || !e.comparator(r, t)) && (e.value = t, e.observers && e.observers.length && Ve(() => {
|
|
80
80
|
for (let s = 0; s < e.observers.length; s += 1) {
|
|
81
|
-
const
|
|
82
|
-
|
|
81
|
+
const i = e.observers[s], u = rt && rt.running;
|
|
82
|
+
u && rt.disposed.has(i), (u ? !i.tState : !i.state) && (i.pure ? ie.push(i) : ke.push(i), i.observers && Pt(i)), u || (i.state = _e);
|
|
83
83
|
}
|
|
84
|
-
if (
|
|
85
|
-
throw
|
|
84
|
+
if (ie.length > 1e6)
|
|
85
|
+
throw ie = [], new Error();
|
|
86
86
|
}, !1)), t;
|
|
87
87
|
}
|
|
88
|
-
function
|
|
88
|
+
function Je(e) {
|
|
89
89
|
if (!e.fn) return;
|
|
90
|
-
|
|
91
|
-
const t =
|
|
92
|
-
|
|
90
|
+
Ue(e);
|
|
91
|
+
const t = et;
|
|
92
|
+
tn(
|
|
93
93
|
e,
|
|
94
94
|
e.value,
|
|
95
95
|
t
|
|
96
96
|
);
|
|
97
97
|
}
|
|
98
|
-
function
|
|
98
|
+
function tn(e, t, n) {
|
|
99
99
|
let r;
|
|
100
|
-
const s =
|
|
101
|
-
|
|
100
|
+
const s = ce, i = Y;
|
|
101
|
+
Y = ce = e;
|
|
102
102
|
try {
|
|
103
103
|
r = e.fn(t);
|
|
104
|
-
} catch (
|
|
105
|
-
return e.pure && (e.state =
|
|
104
|
+
} catch (u) {
|
|
105
|
+
return e.pure && (e.state = _e, e.owned && e.owned.forEach(Ue), e.owned = null), e.updatedAt = n + 1, zt(u);
|
|
106
106
|
} finally {
|
|
107
|
-
|
|
107
|
+
Y = i, ce = s;
|
|
108
108
|
}
|
|
109
|
-
(!e.updatedAt || e.updatedAt <= n) && (e.updatedAt != null && "observers" in e ?
|
|
109
|
+
(!e.updatedAt || e.updatedAt <= n) && (e.updatedAt != null && "observers" in e ? Ot(e, r) : e.value = r, e.updatedAt = n);
|
|
110
110
|
}
|
|
111
|
-
function
|
|
112
|
-
const
|
|
111
|
+
function dt(e, t, n, r = _e, s) {
|
|
112
|
+
const i = {
|
|
113
113
|
fn: e,
|
|
114
114
|
state: r,
|
|
115
115
|
updatedAt: null,
|
|
@@ -118,86 +118,86 @@ function et(e, t, n, r = we, s) {
|
|
|
118
118
|
sourceSlots: null,
|
|
119
119
|
cleanups: null,
|
|
120
120
|
value: t,
|
|
121
|
-
owner:
|
|
122
|
-
context:
|
|
121
|
+
owner: ce,
|
|
122
|
+
context: ce ? ce.context : null,
|
|
123
123
|
pure: n
|
|
124
124
|
};
|
|
125
|
-
return
|
|
125
|
+
return ce === null || ce !== _t && (ce.owned ? ce.owned.push(i) : ce.owned = [i]), i;
|
|
126
126
|
}
|
|
127
|
-
function
|
|
127
|
+
function Ze(e) {
|
|
128
128
|
if (e.state === 0) return;
|
|
129
|
-
if (e.state ===
|
|
130
|
-
if (e.suspense &&
|
|
129
|
+
if (e.state === We) return Ye(e);
|
|
130
|
+
if (e.suspense && tt(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 < et); )
|
|
133
133
|
e.state && t.push(e);
|
|
134
134
|
for (let n = t.length - 1; n >= 0; n--)
|
|
135
|
-
if (e = t[n], e.state ===
|
|
136
|
-
|
|
137
|
-
else if (e.state ===
|
|
138
|
-
const r =
|
|
139
|
-
|
|
135
|
+
if (e = t[n], e.state === _e)
|
|
136
|
+
Je(e);
|
|
137
|
+
else if (e.state === We) {
|
|
138
|
+
const r = ie;
|
|
139
|
+
ie = null, Ve(() => Ye(e, t[0]), !1), ie = r;
|
|
140
140
|
}
|
|
141
141
|
}
|
|
142
|
-
function
|
|
143
|
-
if (
|
|
142
|
+
function Ve(e, t) {
|
|
143
|
+
if (ie) return e();
|
|
144
144
|
let n = !1;
|
|
145
|
-
t || (
|
|
145
|
+
t || (ie = []), ke ? n = !0 : ke = [], et++;
|
|
146
146
|
try {
|
|
147
147
|
const r = e();
|
|
148
|
-
return
|
|
148
|
+
return nn(n), r;
|
|
149
149
|
} catch (r) {
|
|
150
|
-
n || (
|
|
150
|
+
n || (ke = null), ie = null, zt(r);
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
|
-
function
|
|
154
|
-
if (
|
|
155
|
-
const t =
|
|
156
|
-
|
|
153
|
+
function nn(e) {
|
|
154
|
+
if (ie && (It(ie), ie = null), e) return;
|
|
155
|
+
const t = ke;
|
|
156
|
+
ke = null, t.length && Ve(() => St(t), !1);
|
|
157
157
|
}
|
|
158
|
-
function
|
|
159
|
-
for (let t = 0; t < e.length; t++)
|
|
158
|
+
function It(e) {
|
|
159
|
+
for (let t = 0; t < e.length; t++) Ze(e[t]);
|
|
160
160
|
}
|
|
161
|
-
function
|
|
161
|
+
function rn(e) {
|
|
162
162
|
let t, n = 0;
|
|
163
163
|
for (t = 0; t < e.length; t++) {
|
|
164
164
|
const r = e[t];
|
|
165
|
-
r.user ? e[n++] = r :
|
|
165
|
+
r.user ? e[n++] = r : Ze(r);
|
|
166
166
|
}
|
|
167
|
-
for (t = 0; t < n; t++)
|
|
167
|
+
for (t = 0; t < n; t++) Ze(e[t]);
|
|
168
168
|
}
|
|
169
|
-
function
|
|
169
|
+
function Ye(e, t) {
|
|
170
170
|
e.state = 0;
|
|
171
171
|
for (let n = 0; n < e.sources.length; n += 1) {
|
|
172
172
|
const r = e.sources[n];
|
|
173
173
|
if (r.sources) {
|
|
174
174
|
const s = r.state;
|
|
175
|
-
s ===
|
|
175
|
+
s === _e ? r !== t && (!r.updatedAt || r.updatedAt < et) && Ze(r) : s === We && Ye(r, t);
|
|
176
176
|
}
|
|
177
177
|
}
|
|
178
178
|
}
|
|
179
|
-
function
|
|
179
|
+
function Pt(e) {
|
|
180
180
|
for (let t = 0; t < e.observers.length; t += 1) {
|
|
181
181
|
const n = e.observers[t];
|
|
182
|
-
n.state || (n.state =
|
|
182
|
+
n.state || (n.state = We, n.pure ? ie.push(n) : ke.push(n), n.observers && Pt(n));
|
|
183
183
|
}
|
|
184
184
|
}
|
|
185
|
-
function
|
|
185
|
+
function Ue(e) {
|
|
186
186
|
let t;
|
|
187
187
|
if (e.sources)
|
|
188
188
|
for (; e.sources.length; ) {
|
|
189
189
|
const n = e.sources.pop(), r = e.sourceSlots.pop(), s = n.observers;
|
|
190
190
|
if (s && s.length) {
|
|
191
|
-
const
|
|
192
|
-
r < s.length && (
|
|
191
|
+
const i = s.pop(), u = n.observerSlots.pop();
|
|
192
|
+
r < s.length && (i.sourceSlots[u] = r, s[r] = i, n.observerSlots[r] = u);
|
|
193
193
|
}
|
|
194
194
|
}
|
|
195
195
|
if (e.tOwned) {
|
|
196
|
-
for (t = e.tOwned.length - 1; t >= 0; t--)
|
|
196
|
+
for (t = e.tOwned.length - 1; t >= 0; t--) Ue(e.tOwned[t]);
|
|
197
197
|
delete e.tOwned;
|
|
198
198
|
}
|
|
199
199
|
if (e.owned) {
|
|
200
|
-
for (t = e.owned.length - 1; t >= 0; t--)
|
|
200
|
+
for (t = e.owned.length - 1; t >= 0; t--) Ue(e.owned[t]);
|
|
201
201
|
e.owned = null;
|
|
202
202
|
}
|
|
203
203
|
if (e.cleanups) {
|
|
@@ -206,93 +206,93 @@ function Oe(e) {
|
|
|
206
206
|
}
|
|
207
207
|
e.state = 0;
|
|
208
208
|
}
|
|
209
|
-
function
|
|
209
|
+
function sn(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
|
|
215
|
-
throw
|
|
214
|
+
function zt(e, t = ce) {
|
|
215
|
+
throw sn(e);
|
|
216
216
|
}
|
|
217
|
-
function
|
|
218
|
-
let r = n.length, s = t.length,
|
|
219
|
-
for (;
|
|
220
|
-
if (t[
|
|
221
|
-
|
|
217
|
+
function an(e, t, n) {
|
|
218
|
+
let r = n.length, s = t.length, i = r, u = 0, l = 0, C = t[s - 1].nextSibling, $ = null;
|
|
219
|
+
for (; u < s || l < i; ) {
|
|
220
|
+
if (t[u] === n[l]) {
|
|
221
|
+
u++, l++;
|
|
222
222
|
continue;
|
|
223
223
|
}
|
|
224
|
-
for (; t[s - 1] === n[
|
|
225
|
-
s--,
|
|
226
|
-
if (s ===
|
|
227
|
-
const
|
|
228
|
-
for (;
|
|
229
|
-
} else if (
|
|
230
|
-
for (;
|
|
231
|
-
(!$ || !$.has(t[
|
|
232
|
-
else if (t[
|
|
233
|
-
const
|
|
234
|
-
e.insertBefore(n[
|
|
224
|
+
for (; t[s - 1] === n[i - 1]; )
|
|
225
|
+
s--, i--;
|
|
226
|
+
if (s === u) {
|
|
227
|
+
const D = i < r ? l ? n[l - 1].nextSibling : n[i - l] : C;
|
|
228
|
+
for (; l < i; ) e.insertBefore(n[l++], D);
|
|
229
|
+
} else if (i === l)
|
|
230
|
+
for (; u < s; )
|
|
231
|
+
(!$ || !$.has(t[u])) && t[u].remove(), u++;
|
|
232
|
+
else if (t[u] === n[i - 1] && n[l] === t[s - 1]) {
|
|
233
|
+
const D = t[--s].nextSibling;
|
|
234
|
+
e.insertBefore(n[l++], t[u++].nextSibling), e.insertBefore(n[--i], D), t[s] = n[i];
|
|
235
235
|
} else {
|
|
236
236
|
if (!$) {
|
|
237
237
|
$ = /* @__PURE__ */ new Map();
|
|
238
|
-
let
|
|
239
|
-
for (;
|
|
238
|
+
let B = l;
|
|
239
|
+
for (; B < i; ) $.set(n[B], B++);
|
|
240
240
|
}
|
|
241
|
-
const
|
|
242
|
-
if (
|
|
243
|
-
if (
|
|
244
|
-
let
|
|
245
|
-
for (; ++
|
|
246
|
-
|
|
247
|
-
if (
|
|
248
|
-
const
|
|
249
|
-
for (;
|
|
250
|
-
} else e.replaceChild(n[
|
|
251
|
-
} else
|
|
252
|
-
else t[
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
const
|
|
257
|
-
function
|
|
241
|
+
const D = $.get(t[u]);
|
|
242
|
+
if (D != null)
|
|
243
|
+
if (l < D && D < i) {
|
|
244
|
+
let B = u, ae = 1, de;
|
|
245
|
+
for (; ++B < s && B < i && !((de = $.get(t[B])) == null || de !== D + ae); )
|
|
246
|
+
ae++;
|
|
247
|
+
if (ae > D - l) {
|
|
248
|
+
const Ee = t[u];
|
|
249
|
+
for (; l < D; ) e.insertBefore(n[l++], Ee);
|
|
250
|
+
} else e.replaceChild(n[l++], t[u++]);
|
|
251
|
+
} else u++;
|
|
252
|
+
else t[u++].remove();
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
const gt = "_$DX_DELEGATE";
|
|
257
|
+
function F(e, t, n, r) {
|
|
258
258
|
let s;
|
|
259
|
-
const
|
|
260
|
-
const
|
|
261
|
-
return
|
|
262
|
-
},
|
|
263
|
-
return
|
|
264
|
-
}
|
|
265
|
-
function
|
|
266
|
-
const n = t[
|
|
259
|
+
const i = () => {
|
|
260
|
+
const l = document.createElement("template");
|
|
261
|
+
return l.innerHTML = e, l.content.firstChild;
|
|
262
|
+
}, u = () => (s || (s = i())).cloneNode(!0);
|
|
263
|
+
return u.cloneNode = u, u;
|
|
264
|
+
}
|
|
265
|
+
function ft(e, t = window.document) {
|
|
266
|
+
const n = t[gt] || (t[gt] = /* @__PURE__ */ new Set());
|
|
267
267
|
for (let r = 0, s = e.length; r < s; r++) {
|
|
268
|
-
const
|
|
269
|
-
n.has(
|
|
268
|
+
const i = e[r];
|
|
269
|
+
n.has(i) || (n.add(i), t.addEventListener(i, un));
|
|
270
270
|
}
|
|
271
271
|
}
|
|
272
272
|
function le(e, t, n) {
|
|
273
273
|
n == null ? e.removeAttribute(t) : e.setAttribute(t, n);
|
|
274
274
|
}
|
|
275
|
-
function
|
|
276
|
-
return
|
|
275
|
+
function Nt(e, t, n) {
|
|
276
|
+
return tt(() => e(t, n));
|
|
277
277
|
}
|
|
278
|
-
function
|
|
279
|
-
if (n !== void 0 && !r && (r = []), typeof t != "function") return
|
|
280
|
-
|
|
278
|
+
function f(e, t, n, r) {
|
|
279
|
+
if (n !== void 0 && !r && (r = []), typeof t != "function") return Xe(e, t, r, n);
|
|
280
|
+
y((s) => Xe(e, t(), s, n), r);
|
|
281
281
|
}
|
|
282
|
-
function
|
|
282
|
+
function un(e) {
|
|
283
283
|
let t = e.target;
|
|
284
|
-
const n = `$$${e.type}`, r = e.target, s = e.currentTarget,
|
|
284
|
+
const n = `$$${e.type}`, r = e.target, s = e.currentTarget, i = (C) => Object.defineProperty(e, "target", {
|
|
285
285
|
configurable: !0,
|
|
286
|
-
value:
|
|
287
|
-
}),
|
|
288
|
-
const
|
|
289
|
-
if (
|
|
286
|
+
value: C
|
|
287
|
+
}), u = () => {
|
|
288
|
+
const C = t[n];
|
|
289
|
+
if (C && !t.disabled) {
|
|
290
290
|
const $ = t[`${n}Data`];
|
|
291
|
-
if ($ !== void 0 ?
|
|
291
|
+
if ($ !== void 0 ? C.call(t, $, e) : C.call(t, e), e.cancelBubble) return;
|
|
292
292
|
}
|
|
293
|
-
return t.host && typeof t.host != "string" && !t.host._$host && t.contains(e.target) &&
|
|
294
|
-
},
|
|
295
|
-
for (;
|
|
293
|
+
return t.host && typeof t.host != "string" && !t.host._$host && t.contains(e.target) && i(t.host), !0;
|
|
294
|
+
}, l = () => {
|
|
295
|
+
for (; u() && (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 en(e) {
|
|
|
300
300
|
return t || document;
|
|
301
301
|
}
|
|
302
302
|
}), e.composedPath) {
|
|
303
|
-
const
|
|
304
|
-
|
|
305
|
-
for (let $ = 0; $ <
|
|
303
|
+
const C = e.composedPath();
|
|
304
|
+
i(C[0]);
|
|
305
|
+
for (let $ = 0; $ < C.length - 2 && (t = C[$], !!u()); $++) {
|
|
306
306
|
if (t._$host) {
|
|
307
|
-
t = t._$host,
|
|
307
|
+
t = t._$host, l();
|
|
308
308
|
break;
|
|
309
309
|
}
|
|
310
310
|
if (t.parentNode === s)
|
|
311
311
|
break;
|
|
312
312
|
}
|
|
313
|
-
} else
|
|
314
|
-
|
|
313
|
+
} else l();
|
|
314
|
+
i(r);
|
|
315
315
|
}
|
|
316
|
-
function
|
|
316
|
+
function Xe(e, t, n, r, s) {
|
|
317
317
|
for (; typeof n == "function"; ) n = n();
|
|
318
318
|
if (t === n) return n;
|
|
319
|
-
const
|
|
320
|
-
if (e =
|
|
321
|
-
if (
|
|
319
|
+
const i = typeof t, u = r !== void 0;
|
|
320
|
+
if (e = u && n[0] && n[0].parentNode || e, i === "string" || i === "number") {
|
|
321
|
+
if (i === "number" && (t = t.toString(), t === n))
|
|
322
322
|
return n;
|
|
323
|
-
if (
|
|
324
|
-
let
|
|
325
|
-
|
|
323
|
+
if (u) {
|
|
324
|
+
let l = n[0];
|
|
325
|
+
l && l.nodeType === 3 ? l.data !== t && (l.data = t) : l = document.createTextNode(t), n = Ne(e, n, r, l);
|
|
326
326
|
} else
|
|
327
327
|
n !== "" && typeof n == "string" ? n = e.firstChild.data = t : n = e.textContent = t;
|
|
328
|
-
} else if (t == null ||
|
|
329
|
-
n =
|
|
328
|
+
} else if (t == null || i === "boolean")
|
|
329
|
+
n = Ne(e, n, r);
|
|
330
330
|
else {
|
|
331
|
-
if (
|
|
332
|
-
return
|
|
333
|
-
let
|
|
334
|
-
for (; typeof
|
|
335
|
-
n =
|
|
331
|
+
if (i === "function")
|
|
332
|
+
return y(() => {
|
|
333
|
+
let l = t();
|
|
334
|
+
for (; typeof l == "function"; ) l = l();
|
|
335
|
+
n = Xe(e, l, n, r);
|
|
336
336
|
}), () => n;
|
|
337
337
|
if (Array.isArray(t)) {
|
|
338
|
-
const
|
|
339
|
-
if (
|
|
340
|
-
return
|
|
341
|
-
if (
|
|
342
|
-
if (n =
|
|
343
|
-
} else
|
|
344
|
-
n =
|
|
338
|
+
const l = [], C = n && Array.isArray(n);
|
|
339
|
+
if (ut(l, t, n, s))
|
|
340
|
+
return y(() => n = Xe(e, l, n, r, !0)), () => n;
|
|
341
|
+
if (l.length === 0) {
|
|
342
|
+
if (n = Ne(e, n, r), u) return n;
|
|
343
|
+
} else C ? n.length === 0 ? mt(e, l, r) : an(e, n, l) : (n && Ne(e), mt(e, l));
|
|
344
|
+
n = l;
|
|
345
345
|
} else if (t.nodeType) {
|
|
346
346
|
if (Array.isArray(n)) {
|
|
347
|
-
if (
|
|
348
|
-
|
|
347
|
+
if (u) return n = Ne(e, n, r, t);
|
|
348
|
+
Ne(e, n, null, t);
|
|
349
349
|
} else n == null || n === "" || !e.firstChild ? e.appendChild(t) : e.replaceChild(t, e.firstChild);
|
|
350
350
|
n = t;
|
|
351
351
|
}
|
|
352
352
|
}
|
|
353
353
|
return n;
|
|
354
354
|
}
|
|
355
|
-
function
|
|
355
|
+
function ut(e, t, n, r) {
|
|
356
356
|
let s = !1;
|
|
357
|
-
for (let
|
|
358
|
-
let
|
|
359
|
-
if (!(
|
|
360
|
-
e.push(
|
|
361
|
-
else if (Array.isArray(
|
|
362
|
-
s =
|
|
357
|
+
for (let i = 0, u = t.length; i < u; i++) {
|
|
358
|
+
let l = t[i], C = n && n[e.length], $;
|
|
359
|
+
if (!(l == null || l === !0 || l === !1)) if (($ = typeof l) == "object" && l.nodeType)
|
|
360
|
+
e.push(l);
|
|
361
|
+
else if (Array.isArray(l))
|
|
362
|
+
s = ut(e, l, C) || s;
|
|
363
363
|
else if ($ === "function")
|
|
364
364
|
if (r) {
|
|
365
|
-
for (; typeof
|
|
366
|
-
s =
|
|
365
|
+
for (; typeof l == "function"; ) l = l();
|
|
366
|
+
s = ut(
|
|
367
367
|
e,
|
|
368
|
-
Array.isArray(
|
|
369
|
-
Array.isArray(
|
|
368
|
+
Array.isArray(l) ? l : [l],
|
|
369
|
+
Array.isArray(C) ? C : [C]
|
|
370
370
|
) || s;
|
|
371
371
|
} else
|
|
372
|
-
e.push(
|
|
372
|
+
e.push(l), s = !0;
|
|
373
373
|
else {
|
|
374
|
-
const
|
|
375
|
-
|
|
374
|
+
const D = String(l);
|
|
375
|
+
C && C.nodeType === 3 && C.data === D ? e.push(C) : e.push(document.createTextNode(D));
|
|
376
376
|
}
|
|
377
377
|
}
|
|
378
378
|
return s;
|
|
379
379
|
}
|
|
380
|
-
function
|
|
380
|
+
function mt(e, t, n = null) {
|
|
381
381
|
for (let r = 0, s = t.length; r < s; r++) e.insertBefore(t[r], n);
|
|
382
382
|
}
|
|
383
|
-
function
|
|
383
|
+
function Ne(e, t, n, r) {
|
|
384
384
|
if (n === void 0) return e.textContent = "";
|
|
385
385
|
const s = r || document.createTextNode("");
|
|
386
386
|
if (t.length) {
|
|
387
|
-
let
|
|
388
|
-
for (let
|
|
389
|
-
const
|
|
390
|
-
if (s !==
|
|
391
|
-
const
|
|
392
|
-
!
|
|
393
|
-
} else
|
|
387
|
+
let i = !1;
|
|
388
|
+
for (let u = t.length - 1; u >= 0; u--) {
|
|
389
|
+
const l = t[u];
|
|
390
|
+
if (s !== l) {
|
|
391
|
+
const C = l.parentNode === e;
|
|
392
|
+
!i && !u ? C ? e.replaceChild(s, l) : e.insertBefore(s, n) : C && l.remove();
|
|
393
|
+
} else i = !0;
|
|
394
394
|
}
|
|
395
395
|
} else e.insertBefore(s, n);
|
|
396
396
|
return [s];
|
|
397
397
|
}
|
|
398
|
-
function
|
|
398
|
+
function on(e) {
|
|
399
399
|
return Object.keys(e).reduce((n, r) => {
|
|
400
400
|
const s = e[r];
|
|
401
|
-
return n[r] = Object.assign({}, s),
|
|
401
|
+
return n[r] = Object.assign({}, s), jt(s.value) && !hn(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
|
|
404
|
+
function ln(e) {
|
|
405
405
|
return e ? Object.keys(e).reduce((n, r) => {
|
|
406
406
|
const s = e[r];
|
|
407
|
-
return n[r] =
|
|
407
|
+
return n[r] = jt(s) && "value" in s ? s : {
|
|
408
408
|
value: s
|
|
409
|
-
}, n[r].attribute || (n[r].attribute =
|
|
409
|
+
}, n[r].attribute || (n[r].attribute = fn(r)), n[r].parse = "parse" in n[r] ? n[r].parse : typeof n[r].value != "string", n;
|
|
410
410
|
}, {}) : {};
|
|
411
411
|
}
|
|
412
|
-
function
|
|
412
|
+
function cn(e) {
|
|
413
413
|
return Object.keys(e).reduce((n, r) => (n[r] = e[r].value, n), {});
|
|
414
414
|
}
|
|
415
|
-
function
|
|
416
|
-
const n =
|
|
415
|
+
function dn(e, t) {
|
|
416
|
+
const n = on(t);
|
|
417
417
|
return Object.keys(t).forEach((s) => {
|
|
418
|
-
const
|
|
419
|
-
|
|
418
|
+
const i = n[s], u = e.getAttribute(i.attribute), l = e[s];
|
|
419
|
+
u != null && (i.value = i.parse ? Mt(u) : u), l != null && (i.value = Array.isArray(l) ? l.slice(0) : l), i.reflect && bt(e, i.attribute, i.value, !!i.parse), Object.defineProperty(e, s, {
|
|
420
420
|
get() {
|
|
421
|
-
return
|
|
421
|
+
return i.value;
|
|
422
422
|
},
|
|
423
|
-
set(
|
|
424
|
-
const $ =
|
|
425
|
-
|
|
426
|
-
for (let
|
|
427
|
-
this.__propertyChangedCallbacks[
|
|
423
|
+
set(C) {
|
|
424
|
+
const $ = i.value;
|
|
425
|
+
i.value = C, i.reflect && bt(this, i.attribute, i.value, !!i.parse);
|
|
426
|
+
for (let D = 0, B = this.__propertyChangedCallbacks.length; D < B; D++)
|
|
427
|
+
this.__propertyChangedCallbacks[D](s, C, $);
|
|
428
428
|
},
|
|
429
429
|
enumerable: !0,
|
|
430
430
|
configurable: !0
|
|
431
431
|
});
|
|
432
432
|
}), n;
|
|
433
433
|
}
|
|
434
|
-
function
|
|
434
|
+
function Mt(e) {
|
|
435
435
|
if (e)
|
|
436
436
|
try {
|
|
437
437
|
return JSON.parse(e);
|
|
@@ -439,25 +439,25 @@ function $t(e) {
|
|
|
439
439
|
return e;
|
|
440
440
|
}
|
|
441
441
|
}
|
|
442
|
-
function
|
|
442
|
+
function bt(e, t, n, r) {
|
|
443
443
|
if (n == null || n === !1) return e.removeAttribute(t);
|
|
444
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
|
|
447
|
+
function fn(e) {
|
|
448
448
|
return e.replace(/\.?([A-Z]+)/g, (t, n) => "-" + n.toLowerCase()).replace("_", "-").replace(/^-/, "");
|
|
449
449
|
}
|
|
450
|
-
function
|
|
450
|
+
function jt(e) {
|
|
451
451
|
return e != null && (typeof e == "object" || typeof e == "function");
|
|
452
452
|
}
|
|
453
|
-
function
|
|
453
|
+
function hn(e) {
|
|
454
454
|
return Object.prototype.toString.call(e) === "[object Function]";
|
|
455
455
|
}
|
|
456
|
-
function
|
|
456
|
+
function pn(e) {
|
|
457
457
|
return typeof e == "function" && e.toString().indexOf("class") === 0;
|
|
458
458
|
}
|
|
459
|
-
let
|
|
460
|
-
function
|
|
459
|
+
let st;
|
|
460
|
+
function Dn(e, t) {
|
|
461
461
|
const n = Object.keys(t);
|
|
462
462
|
return class extends e {
|
|
463
463
|
static get observedAttributes() {
|
|
@@ -468,16 +468,16 @@ function ln(e, t) {
|
|
|
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 = dn(this, t);
|
|
472
|
+
const s = cn(this.props), i = this.Component, u = st;
|
|
473
473
|
try {
|
|
474
|
-
|
|
474
|
+
st = this, this.__initialized = !0, pn(i) ? new i(s, {
|
|
475
475
|
element: this
|
|
476
|
-
}) :
|
|
476
|
+
}) : i(s, {
|
|
477
477
|
element: this
|
|
478
478
|
});
|
|
479
479
|
} finally {
|
|
480
|
-
|
|
480
|
+
st = u;
|
|
481
481
|
}
|
|
482
482
|
}
|
|
483
483
|
async disconnectedCallback() {
|
|
@@ -487,15 +487,15 @@ function ln(e, t) {
|
|
|
487
487
|
for (; s = this.__releaseCallbacks.pop(); ) s(this);
|
|
488
488
|
delete this.__initialized, this.__released = !0;
|
|
489
489
|
}
|
|
490
|
-
attributeChangedCallback(s,
|
|
490
|
+
attributeChangedCallback(s, i, u) {
|
|
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 (u == null && !this[s]) return;
|
|
493
|
+
this[s] = t[s].parse ? Mt(u) : u;
|
|
494
494
|
}
|
|
495
495
|
}
|
|
496
496
|
lookupProp(s) {
|
|
497
497
|
if (t)
|
|
498
|
-
return n.find((
|
|
498
|
+
return n.find((i) => s === i || s === t[i].attribute);
|
|
499
499
|
}
|
|
500
500
|
get renderRoot() {
|
|
501
501
|
return this.shadowRoot || this.attachShadow({
|
|
@@ -510,56 +510,56 @@ function ln(e, t) {
|
|
|
510
510
|
}
|
|
511
511
|
};
|
|
512
512
|
}
|
|
513
|
-
function
|
|
513
|
+
function gn(e, t = {}, n = {}) {
|
|
514
514
|
const {
|
|
515
515
|
BaseElement: r = HTMLElement,
|
|
516
516
|
extension: s,
|
|
517
|
-
customElements:
|
|
517
|
+
customElements: i = window.customElements
|
|
518
518
|
} = n;
|
|
519
|
-
return (
|
|
519
|
+
return (u) => {
|
|
520
520
|
if (!e) throw new Error("tag is required to register a Component");
|
|
521
|
-
let
|
|
522
|
-
return
|
|
521
|
+
let l = i.get(e);
|
|
522
|
+
return l ? (l.prototype.Component = u, l) : (l = Dn(r, ln(t)), l.prototype.Component = u, l.prototype.registeredTag = e, i.define(e, l, s), l);
|
|
523
523
|
};
|
|
524
524
|
}
|
|
525
|
-
function
|
|
525
|
+
function mn(e) {
|
|
526
526
|
const t = Object.keys(e), n = {};
|
|
527
527
|
for (let r = 0; r < t.length; r++) {
|
|
528
|
-
const [s,
|
|
528
|
+
const [s, i] = w(e[t[r]]);
|
|
529
529
|
Object.defineProperty(n, t[r], {
|
|
530
530
|
get: s,
|
|
531
|
-
set(
|
|
532
|
-
|
|
531
|
+
set(u) {
|
|
532
|
+
i(() => u);
|
|
533
533
|
}
|
|
534
534
|
});
|
|
535
535
|
}
|
|
536
536
|
return n;
|
|
537
537
|
}
|
|
538
|
-
function
|
|
538
|
+
function bn(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
|
|
545
|
+
function vn(e) {
|
|
546
546
|
return (t, n) => {
|
|
547
547
|
const { element: r } = n;
|
|
548
|
-
return
|
|
549
|
-
const
|
|
550
|
-
r.addPropertyChangedCallback((
|
|
548
|
+
return Qt((s) => {
|
|
549
|
+
const i = mn(t);
|
|
550
|
+
r.addPropertyChangedCallback((l, C) => i[l] = C), r.addReleaseCallback(() => {
|
|
551
551
|
r.renderRoot.textContent = "", s();
|
|
552
552
|
});
|
|
553
|
-
const
|
|
554
|
-
return
|
|
555
|
-
},
|
|
553
|
+
const u = e(i, n);
|
|
554
|
+
return f(r.renderRoot, u);
|
|
555
|
+
}, bn(r));
|
|
556
556
|
};
|
|
557
557
|
}
|
|
558
|
-
function
|
|
559
|
-
return arguments.length === 2 && (n = t, t = {}),
|
|
558
|
+
function ht(e, t, n) {
|
|
559
|
+
return arguments.length === 2 && (n = t, t = {}), gn(e, t)(vn(n));
|
|
560
560
|
}
|
|
561
|
-
var
|
|
562
|
-
let
|
|
561
|
+
var Cn = "٠١٢٣٤٥٦٧٨٩", wn = "۰۱۲۳۴۵۶۷۸۹", An = "൦൧൨൩൪൫൬൭൮൯", En = "೦೧೨೩೪೫೬೭೮೯", Fn = "໐໑໒໓໔໕໖໗໘໙", yn = "୦୧୨୩୪୫୬୭୮୯", $n = "០១២៣៤៥៦៧៨៩", Bn = "߀߁߂߃߄߅߆߇߈߉", kn = "੦੧੨੩੪੫੬੭੮੯", xn = "૦૧૨૩૪૫૬૭૮૯", Sn = "०१२३४५६७८९", _n = "၀၁၂၃၄၅၆၇၈၉", Tn = "௦௧௨௩௪௫௬௭௮௯", On = "౦౧౨౩౪౫౬౭౮౯", In = "๐๑๒๓๔๕๖๗๘๙", Pn = "༠༡༢༣༤༥༦༧༨༩", vt = { ar: Cn, fa: wn, ml: An, kn: En, lo: Fn, or: yn, kh: $n, nqo: Bn, pa: kn, gu: xn, hi: Sn, my: _n, ta: Tn, te: On, th: In, bo: Pn }, zn = ["ru"], Nn = ["id"], Mn = ["id"], jn = ["ady-cyrl"], Rn = ["aeb-arab"], Ln = ["sq"], qn = ["ru"], Un = ["zh-hant"], Jn = ["es"], Vn = ["hi"], Kn = ["es"], Gn = ["ar"], Hn = ["ar"], Wn = ["ar"], Zn = ["es"], Yn = ["fr"], Xn = ["ru"], Qn = ["fr", "es", "ru"], er = ["hi"], tr = ["es"], nr = ["fa"], rr = ["ru"], sr = ["id"], ir = ["de"], ar = ["bbc-latn"], ur = ["fa"], or = ["fa"], lr = ["bho"], cr = ["en"], dr = ["id"], fr = ["fr"], hr = ["bn"], pr = ["fa"], Dr = ["fr"], gr = ["id"], mr = ["id"], br = ["ru"], vr = ["oc"], Cr = ["nan", "zh-hant"], wr = ["ru"], Ar = ["it"], Er = ["crh-latn"], Fr = ["sk"], yr = ["pl"], $r = ["ru"], Br = ["hsb", "de"], kr = ["ms"], xr = ["ne"], Sr = ["it"], _r = ["it"], Tr = ["es"], Or = ["fr"], Ir = ["fi"], Pr = ["fr"], zr = ["fr"], Nr = ["de"], Mr = ["it"], jr = ["tr"], Rr = ["gan-hant", "zh-hant", "zh-hans"], Lr = ["fr"], qr = ["pt"], Ur = ["fa"], Jr = ["es"], Vr = ["gom-deva"], Kr = ["id"], Gr = ["de"], Hr = ["es"], Wr = ["zh-hant"], Zr = ["hif-latn"], Yr = ["de"], Xr = ["dsb", "de"], Qr = ["fr"], es = ["hy"], ts = ["zh-cn", "zh-hans"], ns = ["ru"], rs = ["eo"], ss = ["ike-cans"], is = ["en"], as = ["da"], us = ["id"], os = ["kk-latn", "kk-cyrl"], ls = ["fr"], cs = ["kbd-cyrl"], ds = ["fr"], fs = ["ur"], hs = ["tr"], ps = ["my"], Ds = ["kk-cyrl"], gs = ["da"], ms = ["ru"], bs = ["ru"], vs = ["fi"], Cs = ["ks-arab"], ws = ["de"], As = ["ku-latn"], Es = ["ru"], Fs = ["ru"], ys = ["es"], $s = ["de"], Bs = ["ru"], ks = ["ru", "az"], xs = ["nl"], Ss = ["it"], _s = ["et"], Ts = ["fa"], Os = ["it", "rm", "fur"], Is = ["pms", "eml", "lij", "vec", "it"], Ps = ["fr"], zs = ["fa"], Ns = ["lv"], Ms = ["fa"], js = ["zh-hant"], Rs = ["tr"], Ls = ["id"], qs = ["hi"], Us = ["myv", "ru"], Js = ["fr"], Vs = ["mrj", "ru"], Ks = ["id"], Gs = ["my"], Hs = ["ro"], Ws = ["mhr", "ru"], Zs = ["pt"], Ys = ["mdf", "ru"], Xs = ["fa"], Qs = ["es"], ei = ["cdo", "zh-hant"], ti = ["it"], ni = ["nn"], ri = ["de"], si = ["id"], ii = ["nb"], ai = ["fr"], ui = ["ca", "fr"], oi = ["fi"], li = ["ru"], ci = ["fr"], di = ["de"], fi = ["de"], hi = ["de"], pi = ["en"], Di = ["it"], gi = ["el"], mi = ["pt-br"], bi = ["qug", "es"], vi = ["qu", "es"], Ci = ["it"], wi = ["ro"], Ai = ["uk", "ru"], Ei = ["ro"], Fi = ["ruq-latn", "ro"], yi = ["hi"], $i = ["ru"], Bi = ["it"], ki = ["en"], xi = ["it"], Si = ["cbk", "fa"], _i = ["fr"], Ti = ["fr"], Oi = ["lt"], Ii = ["bs", "sr-el", "hr"], Pi = ["fr"], zi = ["shy-latn"], Ni = ["cs"], Mi = ["skr-arab"], ji = ["de"], Ri = ["fi"], Li = ["sr-ec"], qi = ["nl"], Ui = ["de"], Ji = ["ru"], Vi = ["id"], Ki = ["pl"], Gi = ["zh-tw", "zh-hant", "zh-hans"], Hi = ["zh-tw", "zh-hant", "zh-hans"], Wi = ["kn"], Zi = ["pt"], Yi = ["tg-cyrl"], Xi = ["zh-tw", "zh-hant", "zh-hans"], Qi = ["tt-cyrl", "ru"], ea = ["fr"], ta = ["ru"], na = ["ru"], ra = ["ug-arab"], sa = ["it"], ia = ["et"], aa = ["nl"], ua = ["de"], oa = ["fi"], la = ["et"], ca = ["fr"], da = ["fr"], fa = ["zh-hans"], ha = ["ru"], pa = ["ka"], Da = ["he"], ga = ["zh-hans"], ma = ["nl"], ba = ["kab"], va = ["zh-hans"], Rt = { ab: zn, abs: Nn, ace: Mn, ady: jn, aeb: Rn, "aeb-arab": ["ar"], aln: Ln, alt: qn, ami: Un, an: Jn, anp: Vn, arn: Kn, arq: Gn, ary: Hn, arz: Wn, ast: Zn, atj: Yn, av: Xn, avk: Qn, awa: er, ay: tr, azb: nr, ba: rr, ban: sr, "ban-bali": ["ban"], bar: ir, bbc: ar, "bbc-latn": ["id"], bcc: ur, "be-tarask": ["be"], bgn: or, bh: lr, bi: cr, bjn: dr, bm: fr, bpy: hr, bqi: pr, br: Dr, btm: gr, bug: mr, bxr: br, ca: vr, "cbk-zam": ["es"], cdo: Cr, ce: wr, co: Ar, crh: Er, "crh-cyrl": ["ru"], cs: Fr, csb: yr, cv: $r, "de-at": ["de"], "de-ch": ["de"], "de-formal": ["de"], dsb: Br, dtp: kr, dty: xr, egl: Sr, eml: _r, "en-ca": ["en"], "en-gb": ["en"], "es-419": ["es"], "es-formal": ["es"], ext: Tr, ff: Or, fit: Ir, frc: Pr, frp: zr, frr: Nr, fur: Mr, gag: jr, gan: Rr, "gan-hans": ["zh-hans"], "gan-hant": ["zh-hant", "zh-hans"], gcr: Lr, gl: qr, glk: Ur, gn: Jr, gom: Vr, "gom-deva": ["hi"], gor: Kr, gsw: Gr, guc: Hr, hak: Wr, hif: Zr, hrx: Yr, hsb: Xr, ht: Qr, "hu-formal": ["hu"], hyw: es, ii: ts, inh: ns, io: rs, iu: ss, jam: is, jut: as, jv: us, kaa: os, kab: ls, kbd: cs, kbp: ds, khw: fs, kiu: hs, kjp: ps, kk: Ds, "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: gs, "ko-kp": ["ko"], koi: ms, krc: bs, krl: vs, ks: Cs, ksh: ws, ku: As, "ku-arab": ["ckb"], kum: Es, kv: Fs, lad: ys, lb: $s, lbe: Bs, lez: ks, li: xs, lij: Ss, liv: _s, lki: Ts, lld: Os, lmo: Is, ln: Ps, lrc: zs, ltg: Ns, luz: Ms, lzh: js, lzz: Rs, mad: Ls, mai: qs, "map-bms": ["jv", "id"], mdf: Us, mg: Js, mhr: Vs, min: Ks, mnw: Gs, mo: Hs, mrj: Ws, "ms-arab": ["ms"], mwl: Zs, myv: Ys, mzn: Xs, nah: Qs, nan: ei, nap: ti, nb: ni, nds: ri, "nds-nl": ["nl"], nia: si, "nl-informal": ["nl"], nn: ii, nrm: ai, oc: ui, olo: oi, os: li, pcd: ci, pdc: di, pdt: fi, pfl: hi, pih: pi, pms: Di, pnt: gi, pt: mi, "pt-br": ["pt"], qu: bi, qug: vi, rgn: Ci, rmy: wi, "roa-tara": ["it"], rue: Ai, rup: Ei, ruq: Fi, "ruq-cyrl": ["mk"], "ruq-latn": ["ro"], sa: yi, sah: $i, scn: Bi, sco: ki, sdc: xi, sdh: Si, ses: _i, sg: Ti, sgs: Oi, sh: Ii, shi: Pi, shy: zi, "shy-latn": ["fr"], sk: Ni, skr: Mi, "skr-arab": ["ur", "pnb"], sli: ji, smn: Ri, sr: Li, srn: qi, stq: Ui, sty: Ji, su: Vi, szl: Ki, szy: Gi, tay: Hi, tcy: Wi, tet: Zi, tg: Yi, trv: Xi, tt: Qi, "tt-cyrl": ["ru"], ty: ea, tyv: ta, udm: na, ug: ra, vec: sa, vep: ia, vls: aa, vmf: ua, vot: oa, vro: la, wa: ca, wo: da, wuu: fa, xal: ha, xmf: pa, yi: Da, za: ga, zea: ma, zgh: ba, zh: va, "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 he = class {
|
|
563
563
|
constructor(e) {
|
|
564
564
|
this.locale = e;
|
|
565
565
|
}
|
|
@@ -567,9 +567,9 @@ let ae = class {
|
|
|
567
567
|
const n = /\d+=/i;
|
|
568
568
|
if (!t || t.length === 0) return "";
|
|
569
569
|
for (let s = 0; s < t.length; s++) {
|
|
570
|
-
const
|
|
571
|
-
if (n.test(
|
|
572
|
-
if (parseInt(
|
|
570
|
+
const i = t[s];
|
|
571
|
+
if (n.test(i)) {
|
|
572
|
+
if (parseInt(i.slice(0, i.indexOf("=")), 10) === e) return i.slice(i.indexOf("=") + 1);
|
|
573
573
|
t[s] = void 0;
|
|
574
574
|
}
|
|
575
575
|
}
|
|
@@ -578,24 +578,24 @@ let ae = class {
|
|
|
578
578
|
return r = Math.min(r, t.length - 1), t[r];
|
|
579
579
|
}
|
|
580
580
|
getPluralForm(e, t) {
|
|
581
|
-
const n = ["zero", "one", "two", "few", "many", "other"], r = new Intl.PluralRules(t), s = r.resolvedOptions().pluralCategories,
|
|
582
|
-
return n.filter((
|
|
581
|
+
const n = ["zero", "one", "two", "few", "many", "other"], r = new Intl.PluralRules(t), s = r.resolvedOptions().pluralCategories, i = r.select(e);
|
|
582
|
+
return n.filter((u) => s.includes(u)).indexOf(i);
|
|
583
583
|
}
|
|
584
584
|
convertNumber(e, t = !1) {
|
|
585
585
|
let n = this.digitTransformTable(this.locale), r = "";
|
|
586
586
|
if (t) {
|
|
587
587
|
if (parseFloat(e, 10) === e || !n) return e;
|
|
588
588
|
const s = [];
|
|
589
|
-
for (const
|
|
589
|
+
for (const u in n) s[n[u]] = u;
|
|
590
590
|
n = s;
|
|
591
|
-
const
|
|
592
|
-
for (let
|
|
591
|
+
const i = String(e);
|
|
592
|
+
for (let u = 0; u < i.length; u++) r += n[i[u]] || i[u];
|
|
593
593
|
return parseFloat(r, 10);
|
|
594
594
|
}
|
|
595
595
|
if (Intl.NumberFormat) {
|
|
596
596
|
let s;
|
|
597
|
-
const
|
|
598
|
-
return Intl.NumberFormat.supportedLocalesOf(this.locale).length ? s = [this.locale] : s =
|
|
597
|
+
const i = [...Rt[this.locale] || [], "en"];
|
|
598
|
+
return Intl.NumberFormat.supportedLocalesOf(this.locale).length ? s = [this.locale] : s = i, 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 ae = 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 vt[e] ? vt[e].split("") : !1;
|
|
611
611
|
}
|
|
612
|
-
},
|
|
612
|
+
}, Ca = class extends he {
|
|
613
613
|
convertGrammar(e, t) {
|
|
614
614
|
switch (t) {
|
|
615
615
|
case "prefixed":
|
|
@@ -618,7 +618,7 @@ let ae = class {
|
|
|
618
618
|
}
|
|
619
619
|
return e;
|
|
620
620
|
}
|
|
621
|
-
},
|
|
621
|
+
}, wa = class extends he {
|
|
622
622
|
convertGrammar(t, n) {
|
|
623
623
|
switch (n) {
|
|
624
624
|
case "instrumental":
|
|
@@ -630,7 +630,7 @@ let ae = class {
|
|
|
630
630
|
}
|
|
631
631
|
return t;
|
|
632
632
|
}
|
|
633
|
-
},
|
|
633
|
+
}, Aa = class extends he {
|
|
634
634
|
convertGrammar(e, t) {
|
|
635
635
|
switch (t) {
|
|
636
636
|
case "instrumental":
|
|
@@ -642,7 +642,7 @@ let ae = class {
|
|
|
642
642
|
}
|
|
643
643
|
return e;
|
|
644
644
|
}
|
|
645
|
-
},
|
|
645
|
+
}, Ea = class extends he {
|
|
646
646
|
convertGrammar(e, t) {
|
|
647
647
|
switch (t) {
|
|
648
648
|
case "instrumental":
|
|
@@ -654,7 +654,7 @@ let ae = class {
|
|
|
654
654
|
}
|
|
655
655
|
return e;
|
|
656
656
|
}
|
|
657
|
-
},
|
|
657
|
+
}, Fa = class extends he {
|
|
658
658
|
convertGrammar(e, t) {
|
|
659
659
|
let n = e.match(/[aou][^äöy]*$/i);
|
|
660
660
|
const r = e;
|
|
@@ -680,12 +680,12 @@ let ae = class {
|
|
|
680
680
|
}
|
|
681
681
|
return e;
|
|
682
682
|
}
|
|
683
|
-
},
|
|
683
|
+
}, ya = class extends he {
|
|
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
|
|
688
|
+
class $a extends he {
|
|
689
689
|
convertGrammar(t, n) {
|
|
690
690
|
switch (n) {
|
|
691
691
|
case "mestnik":
|
|
@@ -698,7 +698,7 @@ class vi extends ae {
|
|
|
698
698
|
return t;
|
|
699
699
|
}
|
|
700
700
|
}
|
|
701
|
-
let
|
|
701
|
+
let Ba = class extends he {
|
|
702
702
|
convertGrammar(e, t) {
|
|
703
703
|
switch (t) {
|
|
704
704
|
case "genitive":
|
|
@@ -714,12 +714,12 @@ let Ai = class extends ae {
|
|
|
714
714
|
return e;
|
|
715
715
|
}
|
|
716
716
|
};
|
|
717
|
-
class
|
|
717
|
+
class ka extends he {
|
|
718
718
|
convertGrammar(t, n) {
|
|
719
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 xa = class extends he {
|
|
723
723
|
convertGrammar(e, t) {
|
|
724
724
|
if (t === "ainmlae") switch (e) {
|
|
725
725
|
case "an Domhnach":
|
|
@@ -746,7 +746,7 @@ let Ei = class extends ae {
|
|
|
746
746
|
}
|
|
747
747
|
return e;
|
|
748
748
|
}
|
|
749
|
-
},
|
|
749
|
+
}, Sa = class extends he {
|
|
750
750
|
convertGrammar(e, t) {
|
|
751
751
|
switch (t) {
|
|
752
752
|
case "rol":
|
|
@@ -761,36 +761,36 @@ let Ei = class extends ae {
|
|
|
761
761
|
}
|
|
762
762
|
return e;
|
|
763
763
|
}
|
|
764
|
-
},
|
|
764
|
+
}, _a = class extends he {
|
|
765
765
|
convertGrammar(e, t) {
|
|
766
|
-
let n, r, s,
|
|
767
|
-
switch (n = "мæ", r = "", s = "",
|
|
766
|
+
let n, r, s, i;
|
|
767
|
+
switch (n = "мæ", r = "", s = "", i = "", 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
|
-
|
|
769
|
+
i = s + r + "ы";
|
|
770
770
|
break;
|
|
771
771
|
case "dative":
|
|
772
|
-
|
|
772
|
+
i = s + r + "æн";
|
|
773
773
|
break;
|
|
774
774
|
case "allative":
|
|
775
|
-
|
|
775
|
+
i = s + n;
|
|
776
776
|
break;
|
|
777
777
|
case "ablative":
|
|
778
|
-
r === "й" ?
|
|
778
|
+
r === "й" ? i = s + r + "æ" : i = s + r + "æй";
|
|
779
779
|
break;
|
|
780
780
|
case "superessive":
|
|
781
|
-
|
|
781
|
+
i = s + r + "ыл";
|
|
782
782
|
break;
|
|
783
783
|
case "equative":
|
|
784
|
-
|
|
784
|
+
i = s + r + "ау";
|
|
785
785
|
break;
|
|
786
786
|
case "comitative":
|
|
787
|
-
|
|
787
|
+
i = s + "имæ";
|
|
788
788
|
break;
|
|
789
789
|
}
|
|
790
|
-
return e +
|
|
790
|
+
return e + i;
|
|
791
791
|
}
|
|
792
792
|
};
|
|
793
|
-
class
|
|
793
|
+
class Ta extends he {
|
|
794
794
|
convertGrammar(t, n) {
|
|
795
795
|
switch (n) {
|
|
796
796
|
case "genitive":
|
|
@@ -803,11 +803,11 @@ class $i extends ae {
|
|
|
803
803
|
return t;
|
|
804
804
|
}
|
|
805
805
|
}
|
|
806
|
-
var
|
|
807
|
-
const
|
|
808
|
-
let
|
|
806
|
+
var Ct = { bs: wa, default: he, dsb: Aa, fi: Fa, ga: xa, he: Ca, hsb: Ea, hu: Sa, hy: ka, la: Ba, os: _a, ru: ya, sl: $a, uk: Ta };
|
|
807
|
+
const Oa = 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 Lt = class {
|
|
809
809
|
constructor(e) {
|
|
810
|
-
this.locale =
|
|
810
|
+
this.locale = Me(e), this.language = new (Ct[this.locale] || Ct.default)(this.locale);
|
|
811
811
|
}
|
|
812
812
|
emit(e, t) {
|
|
813
813
|
let n, r, s;
|
|
@@ -817,7 +817,7 @@ let xt = class {
|
|
|
817
817
|
n = e;
|
|
818
818
|
break;
|
|
819
819
|
case "object":
|
|
820
|
-
if (r = e.slice(1).map((
|
|
820
|
+
if (r = e.slice(1).map((i) => this.emit(i, 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":
|
|
@@ -861,7 +861,7 @@ let xt = class {
|
|
|
861
861
|
return `<a href="${e[0]}">${e[1]}</a>`;
|
|
862
862
|
}
|
|
863
863
|
bidi(e) {
|
|
864
|
-
const t =
|
|
864
|
+
const t = Ia(e[0]);
|
|
865
865
|
return t === "ltr" ? "" + e[0] + "" : t === "rtl" ? "" + e[0] + "" : e[0];
|
|
866
866
|
}
|
|
867
867
|
formatnum(e) {
|
|
@@ -876,217 +876,217 @@ let xt = class {
|
|
|
876
876
|
htmlelement(e) {
|
|
877
877
|
const t = e.shift(), n = e.shift();
|
|
878
878
|
let r = e, s = "";
|
|
879
|
-
for (const
|
|
879
|
+
for (const u in n) s += ` ${u}="${n[u]}"`;
|
|
880
880
|
Array.isArray(r) || (r = [r]);
|
|
881
|
-
const
|
|
882
|
-
return `<${t}${s}>${
|
|
881
|
+
const i = r.join("");
|
|
882
|
+
return `<${t}${s}>${i}</${t}>`;
|
|
883
883
|
}
|
|
884
884
|
};
|
|
885
|
-
function
|
|
885
|
+
function Me(e) {
|
|
886
886
|
return typeof e == "string" ? e.toLowerCase() : e;
|
|
887
887
|
}
|
|
888
|
-
function
|
|
889
|
-
const t = e.match(
|
|
888
|
+
function Ia(e) {
|
|
889
|
+
const t = e.match(Oa);
|
|
890
890
|
return t ? t[2] === void 0 ? "ltr" : "rtl" : null;
|
|
891
891
|
}
|
|
892
|
-
function
|
|
892
|
+
function Pa(e, { wikilinks: t = !1 } = {}) {
|
|
893
893
|
let n = 0;
|
|
894
|
-
function r(
|
|
894
|
+
function r(c) {
|
|
895
895
|
return () => {
|
|
896
|
-
for (let
|
|
897
|
-
const
|
|
898
|
-
if (
|
|
896
|
+
for (let m = 0; m < c.length; m++) {
|
|
897
|
+
const O = c[m]();
|
|
898
|
+
if (O !== null) return O;
|
|
899
899
|
}
|
|
900
900
|
return null;
|
|
901
901
|
};
|
|
902
902
|
}
|
|
903
|
-
function s(
|
|
904
|
-
const
|
|
905
|
-
for (let
|
|
906
|
-
const
|
|
907
|
-
if (
|
|
908
|
-
|
|
903
|
+
function s(c) {
|
|
904
|
+
const m = n, O = [];
|
|
905
|
+
for (let x = 0; x < c.length; x++) {
|
|
906
|
+
const ee = c[x]();
|
|
907
|
+
if (ee === null) return n = m, null;
|
|
908
|
+
O.push(ee);
|
|
909
909
|
}
|
|
910
|
-
return
|
|
910
|
+
return O;
|
|
911
911
|
}
|
|
912
|
-
function
|
|
912
|
+
function i(c, m) {
|
|
913
913
|
return () => {
|
|
914
|
-
const
|
|
915
|
-
let
|
|
916
|
-
for (;
|
|
917
|
-
return
|
|
914
|
+
const O = n, x = [];
|
|
915
|
+
let ee = m();
|
|
916
|
+
for (; ee !== null; ) x.push(ee), ee = m();
|
|
917
|
+
return x.length < c ? (n = O, null) : x;
|
|
918
918
|
};
|
|
919
919
|
}
|
|
920
|
-
function
|
|
921
|
-
const
|
|
920
|
+
function u(c) {
|
|
921
|
+
const m = c.length;
|
|
922
922
|
return () => {
|
|
923
|
-
let
|
|
924
|
-
return e.slice(n, n +
|
|
923
|
+
let O = null;
|
|
924
|
+
return e.slice(n, n + m) === c && (O = c, n += m), O;
|
|
925
925
|
};
|
|
926
926
|
}
|
|
927
|
-
function
|
|
927
|
+
function l(c) {
|
|
928
928
|
return () => {
|
|
929
|
-
const
|
|
930
|
-
return
|
|
929
|
+
const m = e.slice(n).match(c);
|
|
930
|
+
return m === null ? null : (n += m[0].length, m[0]);
|
|
931
931
|
};
|
|
932
932
|
}
|
|
933
|
-
const
|
|
934
|
-
function
|
|
933
|
+
const C = l(/^\s+/), $ = u("|"), D = u(":"), B = u("\\"), ae = l(/^./), de = u("$"), Ee = l(/^\d+/), L = u('"'), W = u("'"), Z = l(t ? /^[^{}[\]$<\\]/ : /^[^{}$<\\]/), ue = l(t ? /^[^{}[\]$\\|]/ : /^[^{}$\\|]/), G = l(t ? /^[^{}[\]$\s]/ : /^[^{}$\s]/);
|
|
934
|
+
function te(c, m) {
|
|
935
935
|
return () => {
|
|
936
|
-
const
|
|
937
|
-
return
|
|
936
|
+
const O = c();
|
|
937
|
+
return O === null ? null : m(O);
|
|
938
938
|
};
|
|
939
939
|
}
|
|
940
|
-
function
|
|
941
|
-
const
|
|
942
|
-
return
|
|
940
|
+
function J() {
|
|
941
|
+
const c = i(1, X)();
|
|
942
|
+
return c === null ? null : c.join("");
|
|
943
943
|
}
|
|
944
|
-
function
|
|
945
|
-
const
|
|
946
|
-
return
|
|
944
|
+
function we() {
|
|
945
|
+
const c = i(1, ye)();
|
|
946
|
+
return c === null ? null : c.join("");
|
|
947
947
|
}
|
|
948
|
-
const
|
|
949
|
-
function
|
|
950
|
-
const
|
|
951
|
-
return
|
|
948
|
+
const Fe = r([k, G]);
|
|
949
|
+
function Ae() {
|
|
950
|
+
const c = i(1, Fe)();
|
|
951
|
+
return c === null ? null : c.join("");
|
|
952
952
|
}
|
|
953
953
|
function k() {
|
|
954
|
-
const
|
|
955
|
-
return
|
|
954
|
+
const c = s([B, ae]);
|
|
955
|
+
return c === null ? null : c[1];
|
|
956
956
|
}
|
|
957
|
-
const
|
|
958
|
-
function
|
|
959
|
-
const
|
|
960
|
-
return
|
|
957
|
+
const X = r([k, ue]), ye = r([k, Z]);
|
|
958
|
+
function pe() {
|
|
959
|
+
const c = s([de, Ee]);
|
|
960
|
+
return c === null ? null : ["REPLACE", parseInt(c[1], 10) - 1];
|
|
961
961
|
}
|
|
962
|
-
const
|
|
963
|
-
return
|
|
962
|
+
const De = te(l(/^[ !"$&'()*,./0-9;=?@A-Z^_`a-z~\x80-\xFF+-]+/), function(c) {
|
|
963
|
+
return c.toString();
|
|
964
964
|
});
|
|
965
|
+
function b() {
|
|
966
|
+
const c = s([$, i(0, H)]);
|
|
967
|
+
if (c === null) return null;
|
|
968
|
+
const m = c[1];
|
|
969
|
+
return m.length > 1 ? ["CONCAT"].concat(m) : m[0];
|
|
970
|
+
}
|
|
965
971
|
function ge() {
|
|
966
|
-
const
|
|
967
|
-
|
|
968
|
-
const f = l[1];
|
|
969
|
-
return f.length > 1 ? ["CONCAT"].concat(f) : f[0];
|
|
972
|
+
const c = s([De, D, pe]);
|
|
973
|
+
return c === null ? null : [c[0], c[2]];
|
|
970
974
|
}
|
|
971
|
-
function
|
|
972
|
-
const
|
|
973
|
-
return
|
|
975
|
+
function Re() {
|
|
976
|
+
const c = s([De, D, H]);
|
|
977
|
+
return c === null ? null : [c[0], c[2]];
|
|
974
978
|
}
|
|
975
|
-
function
|
|
976
|
-
const
|
|
977
|
-
return
|
|
979
|
+
function me() {
|
|
980
|
+
const c = s([De, D]);
|
|
981
|
+
return c === null ? null : [c[0], ""];
|
|
978
982
|
}
|
|
979
|
-
|
|
980
|
-
const
|
|
981
|
-
return
|
|
982
|
-
}
|
|
983
|
-
const Te = r([function() {
|
|
984
|
-
const l = s([r([oe, ye, Se]), u(0, ge)]);
|
|
985
|
-
return l === null ? null : l[0].concat(l[1]);
|
|
983
|
+
const Pe = r([function() {
|
|
984
|
+
const c = s([r([ge, Re, me]), i(0, b)]);
|
|
985
|
+
return c === null ? null : c[0].concat(c[1]);
|
|
986
986
|
}, function() {
|
|
987
|
-
const
|
|
988
|
-
return
|
|
989
|
-
}]),
|
|
990
|
-
function
|
|
991
|
-
const
|
|
992
|
-
return
|
|
993
|
-
}
|
|
994
|
-
function E() {
|
|
995
|
-
const l = s([u(1, i), $, u(1, Y)]);
|
|
996
|
-
return l === null ? null : [["CONCAT"].concat(l[0]), ["CONCAT"].concat(l[2])];
|
|
997
|
-
}
|
|
998
|
-
function w() {
|
|
999
|
-
const l = s([u(1, i)]);
|
|
1000
|
-
return l === null ? null : [["CONCAT"].concat(l[0])];
|
|
1001
|
-
}
|
|
1002
|
-
const T = r([E, w]);
|
|
1003
|
-
function L() {
|
|
1004
|
-
let l = null;
|
|
1005
|
-
const f = s([me, T, Ae]);
|
|
1006
|
-
if (f !== null) {
|
|
1007
|
-
const B = f[1];
|
|
1008
|
-
l = ["WIKILINK"].concat(B);
|
|
1009
|
-
}
|
|
1010
|
-
return l;
|
|
1011
|
-
}
|
|
1012
|
-
function M() {
|
|
1013
|
-
let l = null;
|
|
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
|
-
}
|
|
1025
|
-
return !0;
|
|
987
|
+
const c = s([De, i(0, b)]);
|
|
988
|
+
return c === null ? null : [c[0]].concat(c[1]);
|
|
989
|
+
}]), Le = u("{{"), qe = u("}}"), Te = u("[["), Oe = u("]]"), Ie = u("["), ze = u("]");
|
|
990
|
+
function ve() {
|
|
991
|
+
const c = s([Le, Pe, qe]);
|
|
992
|
+
return c === null ? null : c[1];
|
|
1026
993
|
}
|
|
1027
|
-
function
|
|
1028
|
-
const
|
|
1029
|
-
return
|
|
994
|
+
function xe() {
|
|
995
|
+
const c = s([i(1, H), $, i(1, q)]);
|
|
996
|
+
return c === null ? null : [["CONCAT"].concat(c[0]), ["CONCAT"].concat(c[2])];
|
|
1030
997
|
}
|
|
1031
|
-
function
|
|
1032
|
-
const
|
|
1033
|
-
return
|
|
998
|
+
function Se() {
|
|
999
|
+
const c = s([i(1, H)]);
|
|
1000
|
+
return c === null ? null : [["CONCAT"].concat(c[0])];
|
|
1034
1001
|
}
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1002
|
+
const A = r([xe, Se]);
|
|
1003
|
+
function v() {
|
|
1004
|
+
let c = null;
|
|
1005
|
+
const m = s([Te, A, Oe]);
|
|
1006
|
+
if (m !== null) {
|
|
1007
|
+
const O = m[1];
|
|
1008
|
+
c = ["WIKILINK"].concat(O);
|
|
1009
|
+
}
|
|
1010
|
+
return c;
|
|
1011
|
+
}
|
|
1012
|
+
function S() {
|
|
1013
|
+
let c = null;
|
|
1014
|
+
const m = s([Ie, i(1, V), C, i(1, q), ze]);
|
|
1015
|
+
return m !== null && (c = ["EXTLINK", m[1].length === 1 ? m[1][0] : ["CONCAT"].concat(m[1]), ["CONCAT"].concat(m[3])]), c;
|
|
1016
|
+
}
|
|
1017
|
+
const R = l(/^[A-Za-z]+/);
|
|
1018
|
+
function d(c, m, O, x = { 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 (c = c.toLowerCase(), m = m.toLowerCase(), c !== m || x.allowedHtmlElements.indexOf(c) === -1) return !1;
|
|
1020
|
+
const ee = /[\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 re = 0, se = O.length; re < se; re += 2) {
|
|
1022
|
+
const fe = O[re];
|
|
1023
|
+
if (x.allowedHtmlCommonAttributes.indexOf(fe) === -1 && (x.allowedHtmlAttributesByElement[c] || []).indexOf(fe) === -1 || fe === "style" && O[re + 1].search(ee) !== -1) return !1;
|
|
1024
|
+
}
|
|
1025
|
+
return !0;
|
|
1038
1026
|
}
|
|
1039
|
-
function
|
|
1040
|
-
const l =
|
|
1041
|
-
return
|
|
1042
|
-
}
|
|
1043
|
-
function
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1027
|
+
function _() {
|
|
1028
|
+
const c = l(/^[^"]*/), m = s([L, c, L]);
|
|
1029
|
+
return m === null ? null : m[1];
|
|
1030
|
+
}
|
|
1031
|
+
function z() {
|
|
1032
|
+
const c = l(/^[^']*/), m = s([W, c, W]);
|
|
1033
|
+
return m === null ? null : m[1];
|
|
1034
|
+
}
|
|
1035
|
+
function P() {
|
|
1036
|
+
const c = l(/^\s*=\s*/), m = s([C, R, c, r([_, z])]);
|
|
1037
|
+
return m === null ? null : [m[1], m[3]];
|
|
1038
|
+
}
|
|
1039
|
+
function T() {
|
|
1040
|
+
const c = i(0, P)();
|
|
1041
|
+
return Array.prototype.concat.apply(["HTMLATTRIBUTES"], c);
|
|
1042
|
+
}
|
|
1043
|
+
function Q() {
|
|
1044
|
+
let c = null;
|
|
1045
|
+
const m = n, O = u("<"), x = l(/^\/?/), ee = l(/^\s*>/), re = s([O, R, T, x, ee]);
|
|
1046
|
+
if (re === null) return null;
|
|
1047
|
+
const se = n, fe = re[1], $e = i(0, q)(), nt = n, o = u("</"), g = s([o, R, ee]);
|
|
1048
|
+
if (g === null) return ["CONCAT", e.slice(m, se)].concat($e);
|
|
1049
|
+
const E = n, oe = g[1], Be = re[2], M = Be.slice(1);
|
|
1050
|
+
if (d(fe, oe, M)) c = ["HTMLELEMENT", fe, Be].concat($e);
|
|
1051
1051
|
else {
|
|
1052
|
-
const
|
|
1053
|
-
|
|
1052
|
+
const a = (p) => p.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
1053
|
+
c = ["CONCAT", a(e.slice(m, se))].concat($e, a(e.slice(nt, E)));
|
|
1054
1054
|
}
|
|
1055
|
-
return
|
|
1055
|
+
return c;
|
|
1056
1056
|
}
|
|
1057
|
-
const
|
|
1058
|
-
function
|
|
1059
|
-
const
|
|
1060
|
-
return
|
|
1057
|
+
const V = r([ve, pe, v, S, Ae]), q = r([ve, pe, v, S, Q, we]), H = r([ve, pe, J]);
|
|
1058
|
+
function ne() {
|
|
1059
|
+
const c = i(0, q)();
|
|
1060
|
+
return c === null ? null : ["CONCAT"].concat(c);
|
|
1061
1061
|
}
|
|
1062
|
-
const
|
|
1063
|
-
if (
|
|
1064
|
-
return
|
|
1062
|
+
const U = ne();
|
|
1063
|
+
if (U === null || n !== e.length) throw new Error("Parse error at position " + n.toString() + " in input: " + e);
|
|
1064
|
+
return U;
|
|
1065
1065
|
}
|
|
1066
|
-
class
|
|
1066
|
+
class wt {
|
|
1067
1067
|
constructor(t, { wikilinks: n = !1 } = {}) {
|
|
1068
|
-
this.locale =
|
|
1068
|
+
this.locale = Me(t), this.wikilinks = n, this.emitter = new Lt(this.locale);
|
|
1069
1069
|
}
|
|
1070
1070
|
parse(t, n) {
|
|
1071
1071
|
if (t.includes("{{") || t.includes("<") || this.wikilinks && t.includes("[")) {
|
|
1072
|
-
const r =
|
|
1072
|
+
const r = Pa(t, { wikilinks: this.wikilinks });
|
|
1073
1073
|
return this.emitter.emit(r, n);
|
|
1074
1074
|
} else return this.simpleParse(t, n);
|
|
1075
1075
|
}
|
|
1076
1076
|
simpleParse(t, n) {
|
|
1077
1077
|
return t.replace(/\$(\d+)/g, (r, s) => {
|
|
1078
|
-
const
|
|
1079
|
-
return n[
|
|
1078
|
+
const i = parseInt(s, 10) - 1;
|
|
1079
|
+
return n[i] !== void 0 ? n[i] : "$" + s;
|
|
1080
1080
|
});
|
|
1081
1081
|
}
|
|
1082
1082
|
}
|
|
1083
|
-
class
|
|
1083
|
+
class za {
|
|
1084
1084
|
constructor() {
|
|
1085
1085
|
this.sourceMap = /* @__PURE__ */ new Map();
|
|
1086
1086
|
}
|
|
1087
1087
|
load(t, n) {
|
|
1088
1088
|
if (typeof t != "object") throw new Error("Invalid message source. Must be an object");
|
|
1089
|
-
if (n =
|
|
1089
|
+
if (n = Me(n), n) {
|
|
1090
1090
|
if (!/^[a-zA-Z0-9-]+$/.test(n)) throw new Error(`Invalid locale ${n}`);
|
|
1091
1091
|
for (const r in t) if (r.indexOf("@") !== 0) {
|
|
1092
1092
|
if (typeof t[r] == "object") return this.load(t);
|
|
@@ -1097,16 +1097,16 @@ class _i {
|
|
|
1097
1097
|
} else for (n in t) this.load(t[n], n);
|
|
1098
1098
|
}
|
|
1099
1099
|
getMessage(t, n) {
|
|
1100
|
-
const r = this.sourceMap.get(
|
|
1100
|
+
const r = this.sourceMap.get(Me(n));
|
|
1101
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
|
|
1107
|
+
class Na {
|
|
1108
1108
|
constructor(t, { finalFallback: n = "en", messages: r = void 0, wikilinks: s = !1 } = {}) {
|
|
1109
|
-
this.locale =
|
|
1109
|
+
this.locale = Me(t), this.parser = new wt(this.locale, { wikilinks: s }), this.messageStore = new za(), r && this.load(r, this.locale), this.finalFallback = n, this.wikilinks = s;
|
|
1110
1110
|
}
|
|
1111
1111
|
load(t, n) {
|
|
1112
1112
|
return this.messageStore.load(t, n || this.locale);
|
|
@@ -1115,31 +1115,31 @@ class Si {
|
|
|
1115
1115
|
return this.parser.parse(this.getMessage(t), n);
|
|
1116
1116
|
}
|
|
1117
1117
|
setLocale(t) {
|
|
1118
|
-
this.locale =
|
|
1118
|
+
this.locale = Me(t), this.parser = new wt(this.locale, { wikilinks: this.wikilinks });
|
|
1119
1119
|
}
|
|
1120
1120
|
getFallbackLocales() {
|
|
1121
|
-
return [...
|
|
1121
|
+
return [...Rt[this.locale] || [], this.finalFallback];
|
|
1122
1122
|
}
|
|
1123
1123
|
getMessage(t) {
|
|
1124
1124
|
let n = this.locale, r = 0;
|
|
1125
1125
|
const s = this.getFallbackLocales(this.locale);
|
|
1126
1126
|
for (; n; ) {
|
|
1127
|
-
const
|
|
1128
|
-
let
|
|
1127
|
+
const i = n.split("-");
|
|
1128
|
+
let u = i.length;
|
|
1129
1129
|
do {
|
|
1130
|
-
const
|
|
1131
|
-
if (typeof
|
|
1132
|
-
|
|
1133
|
-
} while (
|
|
1130
|
+
const l = i.slice(0, u).join("-"), C = this.messageStore.getMessage(t, l);
|
|
1131
|
+
if (typeof C == "string") return C;
|
|
1132
|
+
u--;
|
|
1133
|
+
} while (u);
|
|
1134
1134
|
n = s[r], r++;
|
|
1135
1135
|
}
|
|
1136
1136
|
return t;
|
|
1137
1137
|
}
|
|
1138
1138
|
registerParserPlugin(t, n) {
|
|
1139
|
-
|
|
1139
|
+
Lt.prototype[t] = n;
|
|
1140
1140
|
}
|
|
1141
1141
|
}
|
|
1142
|
-
const
|
|
1142
|
+
const qt = {
|
|
1143
1143
|
"@metadata": { authors: ["Mason Payne"], "last-updated": "2024-01-08", locale: "en" },
|
|
1144
1144
|
"sa-login": "Login",
|
|
1145
1145
|
"sa-username": "Email",
|
|
@@ -1191,6 +1191,7 @@ const _t = {
|
|
|
1191
1191
|
"sa-otp-send-code": "Send Code",
|
|
1192
1192
|
"sa-otp-verify": "Verify Code",
|
|
1193
1193
|
"sa-unknown-challenge": "Unknown challenge type.",
|
|
1194
|
+
"sa-complete-invite": "Complete Your Invitation",
|
|
1194
1195
|
"sa-invite-otp": "Verification Code",
|
|
1195
1196
|
"sa-invite-otp-hint": "Enter the code from your invite email",
|
|
1196
1197
|
"sa-invite-password": "Choose a Password",
|
|
@@ -1215,6 +1216,7 @@ const _t = {
|
|
|
1215
1216
|
"sa-social-github": "Continue with GitHub",
|
|
1216
1217
|
"sa-social-apple": "Continue with Apple",
|
|
1217
1218
|
"sa-social-oidc": "Continue with SSO",
|
|
1219
|
+
"sa-loading": "Loading...",
|
|
1218
1220
|
"sa-social-error": "Error starting social login",
|
|
1219
1221
|
"sa-signup-mfa-title": "Verify Your Email",
|
|
1220
1222
|
"sa-signup-verify-prompt": "A verification code has been sent to your email. Enter it below to activate multi-factor authentication.",
|
|
@@ -1223,7 +1225,7 @@ const _t = {
|
|
|
1223
1225
|
"sa-signup-webauthn-setup": "Set Up Passkey",
|
|
1224
1226
|
"sa-signup-webauthn-done": "Skip for now",
|
|
1225
1227
|
"sa-signup-webauthn-error": "Error setting up passkey. Please try again from your account settings."
|
|
1226
|
-
},
|
|
1228
|
+
}, Ma = {
|
|
1227
1229
|
"@metadata": { authors: ["Mason Payne"], "last-updated": "2022-05-28", locale: "fr" },
|
|
1228
1230
|
"sa-login": "Connexion",
|
|
1229
1231
|
"sa-username": "Adresse e-mail",
|
|
@@ -1267,6 +1269,7 @@ const _t = {
|
|
|
1267
1269
|
"sa-social-github": "Continuer avec GitHub",
|
|
1268
1270
|
"sa-social-apple": "Continuer avec Apple",
|
|
1269
1271
|
"sa-social-oidc": "Continuer avec SSO",
|
|
1272
|
+
"sa-loading": "Chargement...",
|
|
1270
1273
|
"sa-social-error": "Erreur lors de la connexion sociale",
|
|
1271
1274
|
"sa-signup-mfa-title": "Vérifiez votre e-mail",
|
|
1272
1275
|
"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.",
|
|
@@ -1275,7 +1278,7 @@ const _t = {
|
|
|
1275
1278
|
"sa-signup-webauthn-setup": "Configurer la clé d'accès",
|
|
1276
1279
|
"sa-signup-webauthn-done": "Ignorer pour l'instant",
|
|
1277
1280
|
"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
|
-
},
|
|
1281
|
+
}, ja = {
|
|
1279
1282
|
"@metadata": { authors: ["Mason Payne"], "last-updated": "2022-05-28", locale: "es" },
|
|
1280
1283
|
"sa-login": "Acceso",
|
|
1281
1284
|
"sa-username": "Correo electrónico",
|
|
@@ -1317,6 +1320,7 @@ const _t = {
|
|
|
1317
1320
|
"sa-social-github": "Continuar con GitHub",
|
|
1318
1321
|
"sa-social-apple": "Continuar con Apple",
|
|
1319
1322
|
"sa-social-oidc": "Continuar con SSO",
|
|
1323
|
+
"sa-loading": "Cargando...",
|
|
1320
1324
|
"sa-social-error": "Error al iniciar sesión social",
|
|
1321
1325
|
"sa-signup-mfa-title": "Verifica tu correo electrónico",
|
|
1322
1326
|
"sa-signup-verify-prompt": "Se ha enviado un código de verificación a tu correo. Ingrésalo para activar la autenticación multifactor.",
|
|
@@ -1325,7 +1329,7 @@ const _t = {
|
|
|
1325
1329
|
"sa-signup-webauthn-setup": "Configurar clave de acceso",
|
|
1326
1330
|
"sa-signup-webauthn-done": "Omitir por ahora",
|
|
1327
1331
|
"sa-signup-webauthn-error": "Error al configurar la clave de acceso. Intenta de nuevo desde la configuración de tu cuenta."
|
|
1328
|
-
},
|
|
1332
|
+
}, Ra = {
|
|
1329
1333
|
"@metadata": { authors: ["Mason Payne"], "last-updated": "2022-05-28", locale: "ja" },
|
|
1330
1334
|
"sa-login": "ログイン",
|
|
1331
1335
|
"sa-username": "メールアドレス",
|
|
@@ -1369,6 +1373,7 @@ const _t = {
|
|
|
1369
1373
|
"sa-social-github": "GitHubで続ける",
|
|
1370
1374
|
"sa-social-apple": "Appleで続ける",
|
|
1371
1375
|
"sa-social-oidc": "SSOで続ける",
|
|
1376
|
+
"sa-loading": "読み込み中...",
|
|
1372
1377
|
"sa-social-error": "ソーシャルログイン開始エラー",
|
|
1373
1378
|
"sa-signup-mfa-title": "メールを確認してください",
|
|
1374
1379
|
"sa-signup-verify-prompt": "確認コードがメールに送信されました。多要素認証を有効にするために入力してください。",
|
|
@@ -1377,51 +1382,51 @@ const _t = {
|
|
|
1377
1382
|
"sa-signup-webauthn-setup": "パスキーを設定",
|
|
1378
1383
|
"sa-signup-webauthn-done": "今はスキップ",
|
|
1379
1384
|
"sa-signup-webauthn-error": "パスキーの設定中にエラーが発生しました。アカウント設定から再試行してください。"
|
|
1380
|
-
},
|
|
1381
|
-
en:
|
|
1382
|
-
fr:
|
|
1383
|
-
es:
|
|
1384
|
-
ja:
|
|
1385
|
+
}, La = {
|
|
1386
|
+
en: qt,
|
|
1387
|
+
fr: Ma,
|
|
1388
|
+
es: ja,
|
|
1389
|
+
ja: Ra
|
|
1385
1390
|
};
|
|
1386
|
-
function
|
|
1387
|
-
const t = new
|
|
1388
|
-
messages:
|
|
1391
|
+
function pt(e) {
|
|
1392
|
+
const t = new Na("en", {
|
|
1393
|
+
messages: qt
|
|
1389
1394
|
});
|
|
1390
|
-
return e !== "en" && (t.load(
|
|
1395
|
+
return e !== "en" && (t.load(La[e], e), t.setLocale(e)), t;
|
|
1391
1396
|
}
|
|
1392
|
-
function
|
|
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),
|
|
1394
|
-
for (let
|
|
1395
|
-
u
|
|
1397
|
+
function Ut(e) {
|
|
1398
|
+
const t = "==".slice(0, (4 - e.length % 4) % 4), n = e.replace(/-/g, "+").replace(/_/g, "/") + t, r = atob(n), s = new ArrayBuffer(r.length), i = new Uint8Array(s);
|
|
1399
|
+
for (let u = 0; u < r.length; u++)
|
|
1400
|
+
i[u] = r.charCodeAt(u);
|
|
1396
1401
|
return s;
|
|
1397
1402
|
}
|
|
1398
|
-
function
|
|
1403
|
+
function Jt(e) {
|
|
1399
1404
|
const t = new Uint8Array(e);
|
|
1400
1405
|
let n = "";
|
|
1401
|
-
for (const
|
|
1402
|
-
n += String.fromCharCode(
|
|
1406
|
+
for (const i of t)
|
|
1407
|
+
n += String.fromCharCode(i);
|
|
1403
1408
|
return btoa(n).replace(/\+/g, "-").replace(
|
|
1404
1409
|
/\//g,
|
|
1405
1410
|
"_"
|
|
1406
1411
|
).replace(/=/g, "");
|
|
1407
1412
|
}
|
|
1408
|
-
var
|
|
1409
|
-
function
|
|
1410
|
-
if (t ===
|
|
1413
|
+
var I = "copy", be = "convert";
|
|
1414
|
+
function je(e, t, n) {
|
|
1415
|
+
if (t === I)
|
|
1411
1416
|
return n;
|
|
1412
|
-
if (t ===
|
|
1417
|
+
if (t === be)
|
|
1413
1418
|
return e(n);
|
|
1414
1419
|
if (t instanceof Array)
|
|
1415
|
-
return n.map((r) =>
|
|
1420
|
+
return n.map((r) => je(e, t[0], r));
|
|
1416
1421
|
if (t instanceof Object) {
|
|
1417
1422
|
const r = {};
|
|
1418
|
-
for (const [s,
|
|
1419
|
-
if (
|
|
1420
|
-
const
|
|
1421
|
-
|
|
1423
|
+
for (const [s, i] of Object.entries(t)) {
|
|
1424
|
+
if (i.derive) {
|
|
1425
|
+
const u = i.derive(n);
|
|
1426
|
+
u !== void 0 && (n[s] = u);
|
|
1422
1427
|
}
|
|
1423
1428
|
if (!(s in n)) {
|
|
1424
|
-
if (
|
|
1429
|
+
if (i.required)
|
|
1425
1430
|
throw new Error(`Missing key: ${s}`);
|
|
1426
1431
|
continue;
|
|
1427
1432
|
}
|
|
@@ -1429,153 +1434,153 @@ function _e(e, t, n) {
|
|
|
1429
1434
|
r[s] = null;
|
|
1430
1435
|
continue;
|
|
1431
1436
|
}
|
|
1432
|
-
r[s] =
|
|
1437
|
+
r[s] = je(
|
|
1433
1438
|
e,
|
|
1434
|
-
|
|
1439
|
+
i.schema,
|
|
1435
1440
|
n[s]
|
|
1436
1441
|
);
|
|
1437
1442
|
}
|
|
1438
1443
|
return r;
|
|
1439
1444
|
}
|
|
1440
1445
|
}
|
|
1441
|
-
function
|
|
1446
|
+
function ot(e, t) {
|
|
1442
1447
|
return {
|
|
1443
1448
|
required: !0,
|
|
1444
1449
|
schema: e,
|
|
1445
1450
|
derive: t
|
|
1446
1451
|
};
|
|
1447
1452
|
}
|
|
1448
|
-
function
|
|
1453
|
+
function j(e) {
|
|
1449
1454
|
return {
|
|
1450
1455
|
required: !0,
|
|
1451
1456
|
schema: e
|
|
1452
1457
|
};
|
|
1453
1458
|
}
|
|
1454
|
-
function
|
|
1459
|
+
function K(e) {
|
|
1455
1460
|
return {
|
|
1456
1461
|
required: !1,
|
|
1457
1462
|
schema: e
|
|
1458
1463
|
};
|
|
1459
1464
|
}
|
|
1460
|
-
var
|
|
1461
|
-
type:
|
|
1462
|
-
id:
|
|
1463
|
-
transports:
|
|
1464
|
-
},
|
|
1465
|
-
appid:
|
|
1466
|
-
appidExclude:
|
|
1467
|
-
credProps:
|
|
1468
|
-
},
|
|
1469
|
-
appid:
|
|
1470
|
-
appidExclude:
|
|
1471
|
-
credProps:
|
|
1472
|
-
},
|
|
1473
|
-
publicKey:
|
|
1474
|
-
rp:
|
|
1475
|
-
user:
|
|
1476
|
-
id:
|
|
1477
|
-
name:
|
|
1478
|
-
displayName:
|
|
1465
|
+
var Vt = {
|
|
1466
|
+
type: j(I),
|
|
1467
|
+
id: j(be),
|
|
1468
|
+
transports: K(I)
|
|
1469
|
+
}, Kt = {
|
|
1470
|
+
appid: K(I),
|
|
1471
|
+
appidExclude: K(I),
|
|
1472
|
+
credProps: K(I)
|
|
1473
|
+
}, Gt = {
|
|
1474
|
+
appid: K(I),
|
|
1475
|
+
appidExclude: K(I),
|
|
1476
|
+
credProps: K(I)
|
|
1477
|
+
}, qa = {
|
|
1478
|
+
publicKey: j({
|
|
1479
|
+
rp: j(I),
|
|
1480
|
+
user: j({
|
|
1481
|
+
id: j(be),
|
|
1482
|
+
name: j(I),
|
|
1483
|
+
displayName: j(I)
|
|
1479
1484
|
}),
|
|
1480
|
-
challenge:
|
|
1481
|
-
pubKeyCredParams:
|
|
1482
|
-
timeout:
|
|
1483
|
-
excludeCredentials:
|
|
1484
|
-
authenticatorSelection:
|
|
1485
|
-
attestation:
|
|
1486
|
-
extensions:
|
|
1485
|
+
challenge: j(be),
|
|
1486
|
+
pubKeyCredParams: j(I),
|
|
1487
|
+
timeout: K(I),
|
|
1488
|
+
excludeCredentials: K([Vt]),
|
|
1489
|
+
authenticatorSelection: K(I),
|
|
1490
|
+
attestation: K(I),
|
|
1491
|
+
extensions: K(Kt)
|
|
1487
1492
|
}),
|
|
1488
|
-
signal:
|
|
1489
|
-
},
|
|
1490
|
-
type:
|
|
1491
|
-
id:
|
|
1492
|
-
rawId:
|
|
1493
|
-
authenticatorAttachment:
|
|
1494
|
-
response:
|
|
1495
|
-
clientDataJSON:
|
|
1496
|
-
attestationObject:
|
|
1497
|
-
transports:
|
|
1498
|
-
|
|
1493
|
+
signal: K(I)
|
|
1494
|
+
}, Ua = {
|
|
1495
|
+
type: j(I),
|
|
1496
|
+
id: j(I),
|
|
1497
|
+
rawId: j(be),
|
|
1498
|
+
authenticatorAttachment: K(I),
|
|
1499
|
+
response: j({
|
|
1500
|
+
clientDataJSON: j(be),
|
|
1501
|
+
attestationObject: j(be),
|
|
1502
|
+
transports: ot(
|
|
1503
|
+
I,
|
|
1499
1504
|
(e) => {
|
|
1500
1505
|
var t;
|
|
1501
1506
|
return ((t = e.getTransports) == null ? void 0 : t.call(e)) || [];
|
|
1502
1507
|
}
|
|
1503
1508
|
)
|
|
1504
1509
|
}),
|
|
1505
|
-
clientExtensionResults:
|
|
1506
|
-
|
|
1510
|
+
clientExtensionResults: ot(
|
|
1511
|
+
Gt,
|
|
1507
1512
|
(e) => e.getClientExtensionResults()
|
|
1508
1513
|
)
|
|
1509
|
-
},
|
|
1510
|
-
mediation:
|
|
1511
|
-
publicKey:
|
|
1512
|
-
challenge:
|
|
1513
|
-
timeout:
|
|
1514
|
-
rpId:
|
|
1515
|
-
allowCredentials:
|
|
1516
|
-
userVerification:
|
|
1517
|
-
extensions:
|
|
1514
|
+
}, Ja = {
|
|
1515
|
+
mediation: K(I),
|
|
1516
|
+
publicKey: j({
|
|
1517
|
+
challenge: j(be),
|
|
1518
|
+
timeout: K(I),
|
|
1519
|
+
rpId: K(I),
|
|
1520
|
+
allowCredentials: K([Vt]),
|
|
1521
|
+
userVerification: K(I),
|
|
1522
|
+
extensions: K(Kt)
|
|
1518
1523
|
}),
|
|
1519
|
-
signal:
|
|
1520
|
-
},
|
|
1521
|
-
type:
|
|
1522
|
-
id:
|
|
1523
|
-
rawId:
|
|
1524
|
-
authenticatorAttachment:
|
|
1525
|
-
response:
|
|
1526
|
-
clientDataJSON:
|
|
1527
|
-
authenticatorData:
|
|
1528
|
-
signature:
|
|
1529
|
-
userHandle:
|
|
1524
|
+
signal: K(I)
|
|
1525
|
+
}, Va = {
|
|
1526
|
+
type: j(I),
|
|
1527
|
+
id: j(I),
|
|
1528
|
+
rawId: j(be),
|
|
1529
|
+
authenticatorAttachment: K(I),
|
|
1530
|
+
response: j({
|
|
1531
|
+
clientDataJSON: j(be),
|
|
1532
|
+
authenticatorData: j(be),
|
|
1533
|
+
signature: j(be),
|
|
1534
|
+
userHandle: j(be)
|
|
1530
1535
|
}),
|
|
1531
|
-
clientExtensionResults:
|
|
1532
|
-
|
|
1536
|
+
clientExtensionResults: ot(
|
|
1537
|
+
Gt,
|
|
1533
1538
|
(e) => e.getClientExtensionResults()
|
|
1534
1539
|
)
|
|
1535
1540
|
};
|
|
1536
|
-
function
|
|
1537
|
-
return
|
|
1541
|
+
function Ht(e) {
|
|
1542
|
+
return je(Ut, qa, e);
|
|
1538
1543
|
}
|
|
1539
|
-
function
|
|
1540
|
-
return
|
|
1541
|
-
|
|
1542
|
-
|
|
1544
|
+
function Ka(e) {
|
|
1545
|
+
return je(
|
|
1546
|
+
Jt,
|
|
1547
|
+
Ua,
|
|
1543
1548
|
e
|
|
1544
1549
|
);
|
|
1545
1550
|
}
|
|
1546
|
-
function
|
|
1547
|
-
return
|
|
1551
|
+
function Ga(e) {
|
|
1552
|
+
return je(Ut, Ja, e);
|
|
1548
1553
|
}
|
|
1549
|
-
function
|
|
1550
|
-
return
|
|
1551
|
-
|
|
1552
|
-
|
|
1554
|
+
function Ha(e) {
|
|
1555
|
+
return je(
|
|
1556
|
+
Jt,
|
|
1557
|
+
Va,
|
|
1553
1558
|
e
|
|
1554
1559
|
);
|
|
1555
1560
|
}
|
|
1556
|
-
async function
|
|
1561
|
+
async function Wt(e) {
|
|
1557
1562
|
const t = await navigator.credentials.create(
|
|
1558
1563
|
e
|
|
1559
1564
|
);
|
|
1560
|
-
return t.toJSON = () =>
|
|
1565
|
+
return t.toJSON = () => Ka(t), t;
|
|
1561
1566
|
}
|
|
1562
|
-
async function
|
|
1567
|
+
async function Wa(e) {
|
|
1563
1568
|
const t = await navigator.credentials.get(
|
|
1564
1569
|
e
|
|
1565
1570
|
);
|
|
1566
|
-
return t.toJSON = () =>
|
|
1571
|
+
return t.toJSON = () => Ha(t), t;
|
|
1567
1572
|
}
|
|
1568
|
-
function
|
|
1573
|
+
function lt(e) {
|
|
1569
1574
|
this.message = e;
|
|
1570
1575
|
}
|
|
1571
|
-
|
|
1572
|
-
var
|
|
1576
|
+
lt.prototype = new Error(), lt.prototype.name = "InvalidCharacterError";
|
|
1577
|
+
var At = typeof window < "u" && window.atob && window.atob.bind(window) || function(e) {
|
|
1573
1578
|
var t = String(e).replace(/=+$/, "");
|
|
1574
|
-
if (t.length % 4 == 1) throw new
|
|
1575
|
-
for (var n, r, s = 0,
|
|
1576
|
-
return
|
|
1579
|
+
if (t.length % 4 == 1) throw new lt("'atob' failed: The string to be decoded is not correctly encoded.");
|
|
1580
|
+
for (var n, r, s = 0, i = 0, u = ""; r = t.charAt(i++); ~r && (n = s % 4 ? 64 * n + r : r, s++ % 4) ? u += String.fromCharCode(255 & n >> (-2 * s & 6)) : 0) r = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(r);
|
|
1581
|
+
return u;
|
|
1577
1582
|
};
|
|
1578
|
-
function
|
|
1583
|
+
function Za(e) {
|
|
1579
1584
|
var t = e.replace(/-/g, "+").replace(/_/g, "/");
|
|
1580
1585
|
switch (t.length % 4) {
|
|
1581
1586
|
case 0:
|
|
@@ -1591,50 +1596,50 @@ function Ji(e) {
|
|
|
1591
1596
|
}
|
|
1592
1597
|
try {
|
|
1593
1598
|
return function(n) {
|
|
1594
|
-
return decodeURIComponent(
|
|
1595
|
-
var
|
|
1596
|
-
return
|
|
1599
|
+
return decodeURIComponent(At(n).replace(/(.)/g, function(r, s) {
|
|
1600
|
+
var i = s.charCodeAt(0).toString(16).toUpperCase();
|
|
1601
|
+
return i.length < 2 && (i = "0" + i), "%" + i;
|
|
1597
1602
|
}));
|
|
1598
1603
|
}(t);
|
|
1599
1604
|
} catch {
|
|
1600
|
-
return
|
|
1605
|
+
return At(t);
|
|
1601
1606
|
}
|
|
1602
1607
|
}
|
|
1603
|
-
function
|
|
1608
|
+
function Qe(e) {
|
|
1604
1609
|
this.message = e;
|
|
1605
1610
|
}
|
|
1606
|
-
function
|
|
1607
|
-
if (typeof e != "string") throw new
|
|
1611
|
+
function Ya(e, t) {
|
|
1612
|
+
if (typeof e != "string") throw new Qe("Invalid token specified");
|
|
1608
1613
|
var n = (t = t || {}).header === !0 ? 0 : 1;
|
|
1609
1614
|
try {
|
|
1610
|
-
return JSON.parse(
|
|
1615
|
+
return JSON.parse(Za(e.split(".")[n]));
|
|
1611
1616
|
} catch (r) {
|
|
1612
|
-
throw new
|
|
1617
|
+
throw new Qe("Invalid token specified: " + r.message);
|
|
1613
1618
|
}
|
|
1614
1619
|
}
|
|
1615
|
-
|
|
1616
|
-
const
|
|
1617
|
-
function
|
|
1618
|
-
const e = localStorage.getItem(
|
|
1620
|
+
Qe.prototype = new Error(), Qe.prototype.name = "InvalidTokenError";
|
|
1621
|
+
const Ge = "spartan-token";
|
|
1622
|
+
function Zt() {
|
|
1623
|
+
const e = localStorage.getItem(Ge);
|
|
1619
1624
|
let t = null;
|
|
1620
1625
|
if (e)
|
|
1621
1626
|
try {
|
|
1622
|
-
if (t =
|
|
1627
|
+
if (t = Ya(e), t.exp > Qa())
|
|
1623
1628
|
return t;
|
|
1624
|
-
localStorage.removeItem(
|
|
1629
|
+
localStorage.removeItem(Ge);
|
|
1625
1630
|
} catch (n) {
|
|
1626
|
-
console.error("Error decoding token", n), localStorage.removeItem(
|
|
1631
|
+
console.error("Error decoding token", n), localStorage.removeItem(Ge);
|
|
1627
1632
|
}
|
|
1628
1633
|
return null;
|
|
1629
1634
|
}
|
|
1630
|
-
function
|
|
1631
|
-
const e = localStorage.getItem(
|
|
1635
|
+
function Xa() {
|
|
1636
|
+
const e = localStorage.getItem(Ge);
|
|
1632
1637
|
return e || null;
|
|
1633
1638
|
}
|
|
1634
|
-
function
|
|
1639
|
+
function Qa() {
|
|
1635
1640
|
return Math.round((/* @__PURE__ */ new Date()).getTime() / 1e3);
|
|
1636
1641
|
}
|
|
1637
|
-
var
|
|
1642
|
+
var eu = /* @__PURE__ */ F(`<form class=login-frame><style>.login-frame {
|
|
1638
1643
|
display: flex;
|
|
1639
1644
|
flex-direction: column;
|
|
1640
1645
|
justify-content: center;
|
|
@@ -1669,6 +1674,11 @@ var Hi = /* @__PURE__ */ y(`<form class=login-frame><style>.login-frame {
|
|
|
1669
1674
|
border-radius: 10px;
|
|
1670
1675
|
}
|
|
1671
1676
|
|
|
1677
|
+
.login-frame button:disabled {
|
|
1678
|
+
opacity: 0.6;
|
|
1679
|
+
cursor: not-allowed;
|
|
1680
|
+
}
|
|
1681
|
+
|
|
1672
1682
|
.login-frame select {
|
|
1673
1683
|
background-color: #ffffff;
|
|
1674
1684
|
border: 1px solid #ccc;
|
|
@@ -1740,8 +1750,26 @@ var Hi = /* @__PURE__ */ y(`<form class=login-frame><style>.login-frame {
|
|
|
1740
1750
|
opacity: 0.6;
|
|
1741
1751
|
cursor: not-allowed;
|
|
1742
1752
|
}
|
|
1743
|
-
|
|
1744
|
-
|
|
1753
|
+
.login-frame .success-message {
|
|
1754
|
+
color: green;
|
|
1755
|
+
margin: 10px 0;
|
|
1756
|
+
}
|
|
1757
|
+
|
|
1758
|
+
.login-frame .info-message {
|
|
1759
|
+
color: #666;
|
|
1760
|
+
margin: 10px 0;
|
|
1761
|
+
font-size: 0.9em;
|
|
1762
|
+
}
|
|
1763
|
+
|
|
1764
|
+
.login-frame .hint {
|
|
1765
|
+
color: #666;
|
|
1766
|
+
font-size: 0.85em;
|
|
1767
|
+
margin-top: 5px;
|
|
1768
|
+
margin-bottom: 0;
|
|
1769
|
+
display: block;
|
|
1770
|
+
}
|
|
1771
|
+
</style><style></style><h1>`), tu = /* @__PURE__ */ F("<span class=error-message>"), it = /* @__PURE__ */ F("<span>"), nu = /* @__PURE__ */ F("<input type=text autocomplete=one-time-code required>"), Et = /* @__PURE__ */ F("<span class=hint>"), ru = /* @__PURE__ */ F("<input type=password autocomplete=new-password required>"), Ft = /* @__PURE__ */ F("<button type=submit>"), su = /* @__PURE__ */ F("<span class=info-message>"), iu = /* @__PURE__ */ F("<span class=success-message>"), yt = /* @__PURE__ */ F("<input type=text>"), $t = /* @__PURE__ */ F("<input type=password>"), at = /* @__PURE__ */ F("<p>"), au = /* @__PURE__ */ F("<select>"), uu = /* @__PURE__ */ F("<option> (<!>)"), Bt = /* @__PURE__ */ F("<input type=text autocomplete=one-time-code>"), ou = /* @__PURE__ */ F("<input type=password autocomplete=new-password>"), lu = /* @__PURE__ */ F("<span class=checkbox-wrapper><input type=checkbox><span> "), cu = /* @__PURE__ */ F("<button type=button>"), Ke = /* @__PURE__ */ F("<a class=centered-text href=#>"), du = /* @__PURE__ */ F("<div class=social-divider><span>"), fu = /* @__PURE__ */ F("<button type=button class=social-btn>"), hu = /* @__PURE__ */ F('<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>'), pu = /* @__PURE__ */ F('<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>'), Du = /* @__PURE__ */ F('<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>'), gu = /* @__PURE__ */ F('<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>');
|
|
1772
|
+
const mu = {
|
|
1745
1773
|
domain: "http://127.0.0.1:11000",
|
|
1746
1774
|
sector: "0ad5c3e5-0186-4557-8b32-4b36f247bf09",
|
|
1747
1775
|
// defaults to the admin sector
|
|
@@ -1750,27 +1778,27 @@ const la = {
|
|
|
1750
1778
|
locale: "en",
|
|
1751
1779
|
redirect: ""
|
|
1752
1780
|
};
|
|
1753
|
-
|
|
1754
|
-
const [t, n] =
|
|
1755
|
-
let
|
|
1781
|
+
ht("spartan-login", mu, (e) => {
|
|
1782
|
+
const [t, n] = w((e.startMode || "password").toLowerCase()), [r, s] = w(""), [i, u] = w(""), [l, C] = w(""), [$, D] = w(""), [B] = w(e.redirect), [ae, de] = w(!1), [Ee, L] = w(!1), [W, Z] = w(!1), [ue, G] = w(""), [te, J] = w(""), [we, Fe] = w([]), [Ae, k] = w(""), [X, ye] = w([]), [pe, De] = w(""), [b, ge] = w(!1), [Re, me] = w(!1), [Pe, Le] = w(""), [qe, Te] = w(""), [Oe, Ie] = w(""), [ze, ve] = w(""), [xe, Se] = w(""), [A, v] = w(""), [S, R] = w(!1), d = pt(e.locale);
|
|
1783
|
+
let _, z;
|
|
1756
1784
|
try {
|
|
1757
|
-
|
|
1785
|
+
z = e.styles;
|
|
1758
1786
|
} catch {
|
|
1759
|
-
|
|
1787
|
+
z = "";
|
|
1760
1788
|
}
|
|
1761
|
-
console.log(
|
|
1762
|
-
const
|
|
1763
|
-
if (
|
|
1789
|
+
console.log(z), ct(async () => {
|
|
1790
|
+
const o = new URLSearchParams(window.location.search);
|
|
1791
|
+
if (o.get("error")) {
|
|
1764
1792
|
history.replaceState({}, "", window.location.pathname);
|
|
1765
|
-
const
|
|
1766
|
-
|
|
1793
|
+
const M = o.get("error_description");
|
|
1794
|
+
D(M || d.i18n("sa-social-error")), P(), T();
|
|
1767
1795
|
return;
|
|
1768
1796
|
}
|
|
1769
|
-
const
|
|
1770
|
-
if (
|
|
1771
|
-
history.replaceState({}, "", window.location.pathname);
|
|
1797
|
+
const E = o.get("code");
|
|
1798
|
+
if (E) {
|
|
1799
|
+
history.replaceState({}, "", window.location.pathname), ge(!0);
|
|
1772
1800
|
try {
|
|
1773
|
-
const
|
|
1801
|
+
const M = await fetch(`${e.domain}/api/v1/oauth/exchange`, {
|
|
1774
1802
|
method: "POST",
|
|
1775
1803
|
mode: "cors",
|
|
1776
1804
|
cache: "no-cache",
|
|
@@ -1778,30 +1806,39 @@ nt("spartan-login", la, (e) => {
|
|
|
1778
1806
|
"Content-Type": "application/json"
|
|
1779
1807
|
},
|
|
1780
1808
|
body: JSON.stringify({
|
|
1781
|
-
code:
|
|
1809
|
+
code: E
|
|
1782
1810
|
})
|
|
1783
1811
|
});
|
|
1784
|
-
if (!
|
|
1785
|
-
const
|
|
1786
|
-
localStorage.setItem("spartan-token",
|
|
1812
|
+
if (!M.ok) throw new Error(d.i18n("sa-social-error"));
|
|
1813
|
+
const a = await M.json();
|
|
1814
|
+
localStorage.setItem("spartan-token", a.token), _.getRootNode().host.dispatchEvent(new CustomEvent("spartan-login", {
|
|
1787
1815
|
bubbles: !0,
|
|
1788
1816
|
cancelable: !0,
|
|
1789
1817
|
detail: {
|
|
1790
|
-
token:
|
|
1818
|
+
token: a.token
|
|
1791
1819
|
}
|
|
1792
|
-
})), e.redirect !== ""
|
|
1793
|
-
} catch (
|
|
1794
|
-
|
|
1820
|
+
})), e.redirect !== "" ? window.location.href = e.redirect : (ge(!1), P(), T());
|
|
1821
|
+
} catch (M) {
|
|
1822
|
+
D(M.message || d.i18n("sa-social-error")), ge(!1), P(), T();
|
|
1795
1823
|
}
|
|
1796
1824
|
return;
|
|
1797
1825
|
}
|
|
1798
|
-
|
|
1826
|
+
const oe = o.get("sub");
|
|
1827
|
+
if (oe) {
|
|
1828
|
+
Ie(oe);
|
|
1829
|
+
const M = o.get("email");
|
|
1830
|
+
M && ve(M);
|
|
1831
|
+
const p = new URLSearchParams(window.location.hash.replace(/^#/, "")).get("otp");
|
|
1832
|
+
p && Se(p), n("invite");
|
|
1833
|
+
return;
|
|
1834
|
+
}
|
|
1835
|
+
if (Zt() && e.redirect !== "" && window.location.pathname !== e.redirect) {
|
|
1799
1836
|
window.location.href = e.redirect;
|
|
1800
1837
|
return;
|
|
1801
1838
|
}
|
|
1802
|
-
|
|
1839
|
+
P(), T();
|
|
1803
1840
|
});
|
|
1804
|
-
function
|
|
1841
|
+
function P() {
|
|
1805
1842
|
fetch(`${e.domain}/api/v1/sectors/${e.sector}/publicsettings`, {
|
|
1806
1843
|
method: "GET",
|
|
1807
1844
|
mode: "cors",
|
|
@@ -1809,35 +1846,35 @@ nt("spartan-login", la, (e) => {
|
|
|
1809
1846
|
headers: {
|
|
1810
1847
|
"Content-Type": "application/json"
|
|
1811
1848
|
}
|
|
1812
|
-
}).then((
|
|
1813
|
-
if (
|
|
1814
|
-
return
|
|
1849
|
+
}).then((o) => {
|
|
1850
|
+
if (o.ok)
|
|
1851
|
+
return o.json();
|
|
1815
1852
|
throw new Error("Network response was not ok.");
|
|
1816
|
-
}).then((
|
|
1817
|
-
console.log(
|
|
1818
|
-
}).catch((
|
|
1819
|
-
console.log(
|
|
1853
|
+
}).then((o) => {
|
|
1854
|
+
console.log(o), de(o.SelfSignUpAllowed), me(o.MFARequired || !1);
|
|
1855
|
+
}).catch((o) => {
|
|
1856
|
+
console.log(o), D(o.message);
|
|
1820
1857
|
});
|
|
1821
1858
|
}
|
|
1822
|
-
function
|
|
1859
|
+
function T() {
|
|
1823
1860
|
fetch(`${e.domain}/api/v1/sectors/${e.sector}/oauth/providers`, {
|
|
1824
1861
|
method: "GET",
|
|
1825
1862
|
mode: "cors",
|
|
1826
1863
|
cache: "no-cache"
|
|
1827
|
-
}).then((
|
|
1828
|
-
if (
|
|
1864
|
+
}).then((o) => {
|
|
1865
|
+
if (o.ok) return o.json();
|
|
1829
1866
|
throw new Error("Failed to load social providers");
|
|
1830
|
-
}).then((
|
|
1831
|
-
const g = (
|
|
1832
|
-
|
|
1867
|
+
}).then((o) => {
|
|
1868
|
+
const g = (o.providers || []).filter((E) => E.enabled);
|
|
1869
|
+
ye(g);
|
|
1833
1870
|
}).catch(() => {
|
|
1834
1871
|
});
|
|
1835
1872
|
}
|
|
1836
|
-
function
|
|
1837
|
-
if (
|
|
1838
|
-
|
|
1873
|
+
function Q(o) {
|
|
1874
|
+
if (pe()) return;
|
|
1875
|
+
De(o), D("");
|
|
1839
1876
|
const g = window.location.origin + window.location.pathname;
|
|
1840
|
-
fetch(`${e.domain}/api/v1/oauth/${
|
|
1877
|
+
fetch(`${e.domain}/api/v1/oauth/${o}/initiate`, {
|
|
1841
1878
|
method: "POST",
|
|
1842
1879
|
mode: "cors",
|
|
1843
1880
|
cache: "no-cache",
|
|
@@ -1848,17 +1885,17 @@ nt("spartan-login", la, (e) => {
|
|
|
1848
1885
|
sectorID: e.sector,
|
|
1849
1886
|
redirectURI: g
|
|
1850
1887
|
})
|
|
1851
|
-
}).then((
|
|
1852
|
-
if (
|
|
1853
|
-
throw new Error(
|
|
1854
|
-
}).then((
|
|
1855
|
-
window.location.href =
|
|
1856
|
-
}).catch((
|
|
1857
|
-
|
|
1888
|
+
}).then((E) => {
|
|
1889
|
+
if (E.ok) return E.json();
|
|
1890
|
+
throw new Error(d.i18n("sa-social-error"));
|
|
1891
|
+
}).then((E) => {
|
|
1892
|
+
window.location.href = E.authURL;
|
|
1893
|
+
}).catch((E) => {
|
|
1894
|
+
De(""), D(E.message);
|
|
1858
1895
|
});
|
|
1859
1896
|
}
|
|
1860
|
-
function
|
|
1861
|
-
|
|
1897
|
+
function V(o, g) {
|
|
1898
|
+
return D(""), Te(g), fetch(`${e.domain}/api/v1/signup/mfa/begin`, {
|
|
1862
1899
|
method: "POST",
|
|
1863
1900
|
mode: "cors",
|
|
1864
1901
|
cache: "no-cache",
|
|
@@ -1866,21 +1903,21 @@ nt("spartan-login", la, (e) => {
|
|
|
1866
1903
|
"Content-Type": "application/json"
|
|
1867
1904
|
},
|
|
1868
1905
|
body: JSON.stringify({
|
|
1869
|
-
email:
|
|
1906
|
+
email: o,
|
|
1870
1907
|
sectorID: e.sector,
|
|
1871
1908
|
transactionId: g
|
|
1872
1909
|
})
|
|
1873
|
-
}).then((
|
|
1874
|
-
if (!
|
|
1875
|
-
throw new Error(
|
|
1910
|
+
}).then((E) => {
|
|
1911
|
+
if (!E.ok)
|
|
1912
|
+
throw new Error(d.i18n("sa-signup-verify-error"));
|
|
1876
1913
|
}).then(() => {
|
|
1877
1914
|
n("signup-verify");
|
|
1878
|
-
}).catch((
|
|
1879
|
-
|
|
1915
|
+
}).catch((E) => {
|
|
1916
|
+
D(E.message);
|
|
1880
1917
|
});
|
|
1881
1918
|
}
|
|
1882
|
-
function
|
|
1883
|
-
|
|
1919
|
+
function q() {
|
|
1920
|
+
return D(""), fetch(`${e.domain}/api/v1/signup/mfa/verify`, {
|
|
1884
1921
|
method: "POST",
|
|
1885
1922
|
mode: "cors",
|
|
1886
1923
|
cache: "no-cache",
|
|
@@ -1889,87 +1926,95 @@ nt("spartan-login", la, (e) => {
|
|
|
1889
1926
|
},
|
|
1890
1927
|
body: JSON.stringify({
|
|
1891
1928
|
email: r(),
|
|
1892
|
-
code:
|
|
1929
|
+
code: l().toUpperCase().trim(),
|
|
1893
1930
|
sectorID: e.sector,
|
|
1894
|
-
transactionId:
|
|
1931
|
+
transactionId: qe()
|
|
1895
1932
|
})
|
|
1896
|
-
}).then((
|
|
1897
|
-
if (
|
|
1898
|
-
throw
|
|
1899
|
-
}).then((
|
|
1900
|
-
|
|
1933
|
+
}).then((o) => {
|
|
1934
|
+
if (o.ok) return o.json();
|
|
1935
|
+
throw o.status === 400 ? new Error(d.i18n("sa-signup-verify-error")) : new Error(d.i18n("sa-signup-verify-error"));
|
|
1936
|
+
}).then((o) => {
|
|
1937
|
+
Le(o.token), localStorage.setItem("spartan-token", o.token), _.getRootNode().host.dispatchEvent(new CustomEvent("spartan-login", {
|
|
1901
1938
|
bubbles: !0,
|
|
1902
1939
|
cancelable: !0,
|
|
1903
1940
|
detail: {
|
|
1904
|
-
token:
|
|
1941
|
+
token: o.token
|
|
1905
1942
|
}
|
|
1906
|
-
})),
|
|
1907
|
-
}).catch((
|
|
1908
|
-
|
|
1943
|
+
})), C(""), n("signup-webauthn");
|
|
1944
|
+
}).catch((o) => {
|
|
1945
|
+
D(o.message);
|
|
1909
1946
|
});
|
|
1910
1947
|
}
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1948
|
+
function H() {
|
|
1949
|
+
b() || (ge(!0), D(""), fetch(`${e.domain}/api/v1/webauthn/registration/begin`, {
|
|
1950
|
+
method: "POST",
|
|
1951
|
+
mode: "cors",
|
|
1952
|
+
cache: "no-cache",
|
|
1953
|
+
headers: {
|
|
1954
|
+
"Content-Type": "application/json",
|
|
1955
|
+
Authorization: `bearer ${Pe()}`
|
|
1956
|
+
},
|
|
1957
|
+
body: JSON.stringify({
|
|
1958
|
+
keyName: "Default",
|
|
1959
|
+
sectorID: e.sector
|
|
1960
|
+
})
|
|
1961
|
+
}).then((o) => {
|
|
1962
|
+
if (!o.ok) throw new Error(d.i18n("sa-signup-webauthn-error"));
|
|
1963
|
+
return o.json();
|
|
1964
|
+
}).then((o) => {
|
|
1965
|
+
const g = Ht(o.Options);
|
|
1966
|
+
return Wt(g).then((E) => {
|
|
1967
|
+
let oe = JSON.parse(JSON.stringify(E));
|
|
1968
|
+
return oe.transactionID = o.TransactionID, oe;
|
|
1926
1969
|
});
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
}
|
|
1942
|
-
|
|
1943
|
-
}
|
|
1944
|
-
}
|
|
1945
|
-
function
|
|
1970
|
+
}).then((o) => fetch(`${e.domain}/api/v1/webauthn/registration/finish`, {
|
|
1971
|
+
method: "POST",
|
|
1972
|
+
mode: "cors",
|
|
1973
|
+
cache: "no-cache",
|
|
1974
|
+
headers: {
|
|
1975
|
+
"Content-Type": "application/json",
|
|
1976
|
+
Authorization: `bearer ${Pe()}`
|
|
1977
|
+
},
|
|
1978
|
+
body: JSON.stringify(o)
|
|
1979
|
+
})).then((o) => {
|
|
1980
|
+
if (!o.ok) throw new Error(d.i18n("sa-signup-webauthn-error"));
|
|
1981
|
+
ne();
|
|
1982
|
+
}).catch((o) => {
|
|
1983
|
+
D((o == null ? void 0 : o.message) || String(o));
|
|
1984
|
+
}).finally(() => {
|
|
1985
|
+
ge(!1);
|
|
1986
|
+
}));
|
|
1987
|
+
}
|
|
1988
|
+
function ne() {
|
|
1946
1989
|
n(e.startMode), e.redirect !== "" && (window.location.href = e.redirect);
|
|
1947
1990
|
}
|
|
1948
|
-
function
|
|
1949
|
-
|
|
1991
|
+
function U() {
|
|
1992
|
+
return console.log("login"), D(""), t() === "password" ? O() : t() === "webauthn" ? m() : t() === "otp-pick" ? re(Ae()) : t() === "otp" ? se() : t() === "reset-email" ? fe() : t() === "reset-code" ? $e() : Promise.resolve();
|
|
1950
1993
|
}
|
|
1951
|
-
function
|
|
1952
|
-
|
|
1994
|
+
function c() {
|
|
1995
|
+
return console.log("signup"), D(""), L(!1), fetch(`${e.domain}/api/v1/users`, {
|
|
1953
1996
|
method: "POST",
|
|
1954
1997
|
mode: "cors",
|
|
1955
1998
|
cache: "no-cache",
|
|
1956
1999
|
body: JSON.stringify({
|
|
1957
2000
|
username: r(),
|
|
1958
|
-
password:
|
|
2001
|
+
password: i(),
|
|
1959
2002
|
sectorID: e.sector
|
|
1960
2003
|
})
|
|
1961
|
-
}).then((
|
|
1962
|
-
if (
|
|
1963
|
-
return
|
|
1964
|
-
throw new Error(
|
|
1965
|
-
}).then((
|
|
1966
|
-
console.log(
|
|
1967
|
-
|
|
1968
|
-
|
|
2004
|
+
}).then((o) => {
|
|
2005
|
+
if (o.ok)
|
|
2006
|
+
return o.json();
|
|
2007
|
+
throw new Error(d.i18n("sa-error-creating-user"));
|
|
2008
|
+
}).then((o) => {
|
|
2009
|
+
if (console.log(o), Re())
|
|
2010
|
+
return V(r(), o.enrollmentTransactionId || "");
|
|
2011
|
+
L(!0), n(e.startMode);
|
|
2012
|
+
}).catch((o) => {
|
|
2013
|
+
L(!1), D(o.message), console.log(o);
|
|
1969
2014
|
});
|
|
1970
2015
|
}
|
|
1971
|
-
function
|
|
1972
|
-
console.log("webauthnLogin"), fetch(`${e.domain}/api/v1/login/webauthn/begin`, {
|
|
2016
|
+
function m() {
|
|
2017
|
+
return console.log("webauthnLogin"), fetch(`${e.domain}/api/v1/login/webauthn/begin`, {
|
|
1973
2018
|
method: "POST",
|
|
1974
2019
|
mode: "cors",
|
|
1975
2020
|
cache: "no-cache",
|
|
@@ -1977,102 +2022,101 @@ nt("spartan-login", la, (e) => {
|
|
|
1977
2022
|
username: r(),
|
|
1978
2023
|
sectorID: e.sector
|
|
1979
2024
|
})
|
|
1980
|
-
}).then((
|
|
1981
|
-
if (
|
|
1982
|
-
return
|
|
1983
|
-
throw
|
|
1984
|
-
}).then((
|
|
1985
|
-
console.log(
|
|
1986
|
-
const g =
|
|
1987
|
-
return console.log("Parsed WebAuthn request options:", g),
|
|
1988
|
-
const
|
|
1989
|
-
let
|
|
1990
|
-
return
|
|
2025
|
+
}).then((o) => {
|
|
2026
|
+
if (o.ok)
|
|
2027
|
+
return o.json();
|
|
2028
|
+
throw o.status === 401 ? (n("password"), D(d.i18n("webauthn-not-enrolled")), new Error(d.i18n("webauthn-not-enrolled"))) : new Error(`${o.status} ${o.statusText}: Network response was not ok.`);
|
|
2029
|
+
}).then((o) => {
|
|
2030
|
+
console.log(o);
|
|
2031
|
+
const g = Ga(o.CredentialAssertion);
|
|
2032
|
+
return console.log("Parsed WebAuthn request options:", g), Wa(g).then((E) => {
|
|
2033
|
+
const oe = JSON.stringify(E);
|
|
2034
|
+
let Be = JSON.parse(oe);
|
|
2035
|
+
return Be.transactionID = o.TransactionID, Be;
|
|
1991
2036
|
});
|
|
1992
|
-
}).then((
|
|
2037
|
+
}).then((o) => fetch(`${e.domain}/api/v1/login/webauthn/finish`, {
|
|
1993
2038
|
method: "POST",
|
|
1994
2039
|
mode: "cors",
|
|
1995
2040
|
cache: "no-cache",
|
|
1996
|
-
body: JSON.stringify(
|
|
1997
|
-
})).then(
|
|
1998
|
-
|
|
2041
|
+
body: JSON.stringify(o)
|
|
2042
|
+
})).then(x).catch((o) => {
|
|
2043
|
+
D(o.message), console.log(o);
|
|
1999
2044
|
});
|
|
2000
2045
|
}
|
|
2001
|
-
function
|
|
2002
|
-
console.log("password login"), fetch(e.domain + "/api/v1/login/password", {
|
|
2046
|
+
function O() {
|
|
2047
|
+
return console.log("password login"), fetch(e.domain + "/api/v1/login/password", {
|
|
2003
2048
|
method: "post",
|
|
2004
2049
|
mode: "cors",
|
|
2005
2050
|
cache: "no-cache",
|
|
2006
2051
|
body: JSON.stringify({
|
|
2007
2052
|
username: r(),
|
|
2008
|
-
password:
|
|
2053
|
+
password: i(),
|
|
2009
2054
|
sectorID: e.sector
|
|
2010
2055
|
})
|
|
2011
|
-
}).then(
|
|
2056
|
+
}).then(x);
|
|
2012
2057
|
}
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
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"));
|
|
2058
|
+
function x(o) {
|
|
2059
|
+
return Promise.resolve(o).then((g) => {
|
|
2060
|
+
if (g.ok)
|
|
2061
|
+
return g.json();
|
|
2062
|
+
throw g;
|
|
2063
|
+
}).then((g) => {
|
|
2064
|
+
if (console.log(g), localStorage.setItem("spartan-txid", g.transactionID), !g.token) {
|
|
2065
|
+
if (g.challengeType === "email_enrollment")
|
|
2066
|
+
return V(r(), g.transactionID || "");
|
|
2067
|
+
if (g.challengeType.indexOf("otp") !== -1)
|
|
2068
|
+
return ee();
|
|
2069
|
+
g.challengeType.indexOf("webauthn") !== -1 ? (n("webauthn"), D(d.i18n("sa-webauthn-required"))) : D(d.i18n("sa-unknown-challenge"));
|
|
2026
2070
|
return;
|
|
2027
2071
|
}
|
|
2028
|
-
localStorage.setItem("spartan-token",
|
|
2029
|
-
const
|
|
2072
|
+
localStorage.setItem("spartan-token", g.token);
|
|
2073
|
+
const E = new CustomEvent("spartan-login", {
|
|
2030
2074
|
bubbles: !0,
|
|
2031
2075
|
cancelable: !0,
|
|
2032
2076
|
detail: {
|
|
2033
|
-
token:
|
|
2034
|
-
transactionID:
|
|
2077
|
+
token: g.token,
|
|
2078
|
+
transactionID: g.transactionID
|
|
2035
2079
|
}
|
|
2036
2080
|
});
|
|
2037
|
-
|
|
2038
|
-
}).catch((
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
const i = localStorage.getItem("spartan-txid") || "";
|
|
2048
|
-
fetch(e.domain + `/api/v1/otp/${encodeURIComponent(r())}?transactionID=${encodeURIComponent(i)}§orID=${encodeURIComponent(e.sector)}`, {
|
|
2081
|
+
_.getRootNode().host.dispatchEvent(E), B() !== "" && (window.location.href = B());
|
|
2082
|
+
}).catch((g) => g.json().then((E) => {
|
|
2083
|
+
console.log(E.message), D(E.message);
|
|
2084
|
+
}).catch((E) => {
|
|
2085
|
+
console.log(E);
|
|
2086
|
+
}));
|
|
2087
|
+
}
|
|
2088
|
+
function ee() {
|
|
2089
|
+
const o = localStorage.getItem("spartan-txid") || "";
|
|
2090
|
+
return fetch(e.domain + `/api/v1/otp/${encodeURIComponent(r())}?transactionID=${encodeURIComponent(o)}§orID=${encodeURIComponent(e.sector)}`, {
|
|
2049
2091
|
method: "get",
|
|
2050
2092
|
mode: "cors",
|
|
2051
2093
|
cache: "no-cache"
|
|
2052
2094
|
}).then((g) => {
|
|
2053
2095
|
if (g.ok)
|
|
2054
2096
|
return g.json();
|
|
2055
|
-
throw new Error(
|
|
2097
|
+
throw new Error(d.i18n("error-otp-list"));
|
|
2056
2098
|
}).then((g) => {
|
|
2057
|
-
const
|
|
2058
|
-
if (
|
|
2059
|
-
|
|
2099
|
+
const E = g.registrations || [];
|
|
2100
|
+
if (E.length === 0) {
|
|
2101
|
+
D(d.i18n("sa-otp-no-registrations"));
|
|
2060
2102
|
return;
|
|
2061
2103
|
}
|
|
2062
|
-
|
|
2104
|
+
if (E.length === 1)
|
|
2105
|
+
return re(E[0].ID || "");
|
|
2106
|
+
Fe(E), k(E[0].ID || ""), n("otp-pick"), D("");
|
|
2063
2107
|
}).catch((g) => {
|
|
2064
|
-
|
|
2108
|
+
D(g.message), console.log(g);
|
|
2065
2109
|
});
|
|
2066
2110
|
}
|
|
2067
|
-
function
|
|
2068
|
-
console.log("begin OTP, registrationID:",
|
|
2111
|
+
function re(o) {
|
|
2112
|
+
return console.log("begin OTP, registrationID:", o), fetch(e.domain + "/api/v1/login/otp/begin", {
|
|
2069
2113
|
method: "post",
|
|
2070
2114
|
mode: "cors",
|
|
2071
2115
|
cache: "no-cache",
|
|
2072
2116
|
body: JSON.stringify({
|
|
2073
2117
|
username: r(),
|
|
2074
2118
|
transactionID: localStorage.getItem("spartan-txid"),
|
|
2075
|
-
registrationID:
|
|
2119
|
+
registrationID: o,
|
|
2076
2120
|
sectorID: e.sector
|
|
2077
2121
|
})
|
|
2078
2122
|
}).then((g) => {
|
|
@@ -2080,26 +2124,26 @@ nt("spartan-login", la, (e) => {
|
|
|
2080
2124
|
return g.json();
|
|
2081
2125
|
throw new Error(`${g.status} ${g.statusText}`);
|
|
2082
2126
|
}).then((g) => {
|
|
2083
|
-
console.log(g), g.transactionID && localStorage.setItem("spartan-txid", g.transactionID),
|
|
2127
|
+
console.log(g), g.transactionID && localStorage.setItem("spartan-txid", g.transactionID), C(""), D(""), n("otp");
|
|
2084
2128
|
}).catch((g) => {
|
|
2085
|
-
|
|
2129
|
+
D(g.message), console.log(g);
|
|
2086
2130
|
});
|
|
2087
2131
|
}
|
|
2088
|
-
function
|
|
2089
|
-
console.log("OTP login submit"), fetch(e.domain + "/api/v1/login/otp", {
|
|
2132
|
+
function se() {
|
|
2133
|
+
return console.log("OTP login submit"), fetch(e.domain + "/api/v1/login/otp", {
|
|
2090
2134
|
method: "post",
|
|
2091
2135
|
mode: "cors",
|
|
2092
2136
|
cache: "no-cache",
|
|
2093
2137
|
body: JSON.stringify({
|
|
2094
2138
|
username: r(),
|
|
2095
|
-
password:
|
|
2139
|
+
password: l(),
|
|
2096
2140
|
transactionID: localStorage.getItem("spartan-txid"),
|
|
2097
2141
|
sectorID: e.sector
|
|
2098
2142
|
})
|
|
2099
|
-
}).then(
|
|
2143
|
+
}).then(x);
|
|
2100
2144
|
}
|
|
2101
|
-
function
|
|
2102
|
-
console.log("begin password reset"),
|
|
2145
|
+
function fe() {
|
|
2146
|
+
return console.log("begin password reset"), D(""), Z(!1), fetch(`${e.domain}/api/v1/password/reset/begin`, {
|
|
2103
2147
|
method: "POST",
|
|
2104
2148
|
mode: "cors",
|
|
2105
2149
|
cache: "no-cache",
|
|
@@ -2110,18 +2154,18 @@ nt("spartan-login", la, (e) => {
|
|
|
2110
2154
|
email: r(),
|
|
2111
2155
|
sectorID: e.sector
|
|
2112
2156
|
})
|
|
2113
|
-
}).then((
|
|
2114
|
-
if (
|
|
2115
|
-
return
|
|
2116
|
-
throw new Error(
|
|
2117
|
-
}).then((
|
|
2118
|
-
console.log(
|
|
2119
|
-
}).catch((
|
|
2120
|
-
|
|
2157
|
+
}).then((o) => {
|
|
2158
|
+
if (o.ok)
|
|
2159
|
+
return o.json();
|
|
2160
|
+
throw new Error(d.i18n("sa-reset-error"));
|
|
2161
|
+
}).then((o) => {
|
|
2162
|
+
console.log(o), D(d.i18n("sa-reset-email-sent")), G(""), J(""), n("reset-code");
|
|
2163
|
+
}).catch((o) => {
|
|
2164
|
+
D(o.message), console.log(o);
|
|
2121
2165
|
});
|
|
2122
2166
|
}
|
|
2123
|
-
function
|
|
2124
|
-
console.log("complete password reset"),
|
|
2167
|
+
function $e() {
|
|
2168
|
+
return console.log("complete password reset"), D(""), fetch(`${e.domain}/api/v1/password/reset/complete`, {
|
|
2125
2169
|
method: "POST",
|
|
2126
2170
|
mode: "cors",
|
|
2127
2171
|
cache: "no-cache",
|
|
@@ -2131,170 +2175,242 @@ nt("spartan-login", la, (e) => {
|
|
|
2131
2175
|
body: JSON.stringify({
|
|
2132
2176
|
email: r(),
|
|
2133
2177
|
code: ue().toUpperCase().trim(),
|
|
2134
|
-
newPassword:
|
|
2178
|
+
newPassword: te(),
|
|
2135
2179
|
sectorID: e.sector
|
|
2136
2180
|
})
|
|
2137
|
-
}).then((
|
|
2138
|
-
if (
|
|
2139
|
-
return
|
|
2140
|
-
throw
|
|
2141
|
-
}).then((
|
|
2142
|
-
console.log(
|
|
2143
|
-
}).catch((
|
|
2144
|
-
|
|
2181
|
+
}).then((o) => {
|
|
2182
|
+
if (o.ok)
|
|
2183
|
+
return o.json();
|
|
2184
|
+
throw o.status === 400 ? new Error(d.i18n("sa-reset-error-code")) : new Error(d.i18n("sa-reset-error"));
|
|
2185
|
+
}).then((o) => {
|
|
2186
|
+
console.log(o), Z(!0), G(""), J(""), u(""), n(e.startMode);
|
|
2187
|
+
}).catch((o) => {
|
|
2188
|
+
D(o.message), console.log(o);
|
|
2145
2189
|
});
|
|
2146
2190
|
}
|
|
2191
|
+
async function nt() {
|
|
2192
|
+
if (D(""), !xe() || xe().trim().length === 0) {
|
|
2193
|
+
D(d.i18n("sa-invite-error-otp"));
|
|
2194
|
+
return;
|
|
2195
|
+
}
|
|
2196
|
+
if (!A() || A().length < 8) {
|
|
2197
|
+
D("Password must be at least 8 characters");
|
|
2198
|
+
return;
|
|
2199
|
+
}
|
|
2200
|
+
const o = Oe();
|
|
2201
|
+
if (!o) {
|
|
2202
|
+
D("Missing invitation information");
|
|
2203
|
+
return;
|
|
2204
|
+
}
|
|
2205
|
+
const g = await fetch(`${e.domain}/api/v1/users/invite/complete`, {
|
|
2206
|
+
method: "POST",
|
|
2207
|
+
mode: "cors",
|
|
2208
|
+
cache: "no-cache",
|
|
2209
|
+
headers: {
|
|
2210
|
+
"Content-Type": "application/json"
|
|
2211
|
+
},
|
|
2212
|
+
body: JSON.stringify({
|
|
2213
|
+
sub: o,
|
|
2214
|
+
otp: xe().toUpperCase().trim(),
|
|
2215
|
+
password: A(),
|
|
2216
|
+
sectorID: e.sector
|
|
2217
|
+
})
|
|
2218
|
+
}).catch(() => null);
|
|
2219
|
+
if (!g) {
|
|
2220
|
+
D(d.i18n("sa-invite-error-generic"));
|
|
2221
|
+
return;
|
|
2222
|
+
}
|
|
2223
|
+
if (g.ok) {
|
|
2224
|
+
history.replaceState({}, "", window.location.pathname);
|
|
2225
|
+
const E = await g.json().catch(() => ({})), oe = _.getRootNode().host;
|
|
2226
|
+
E.token ? (localStorage.setItem("spartan-token", E.token), oe.dispatchEvent(new CustomEvent("spartan-login", {
|
|
2227
|
+
bubbles: !0,
|
|
2228
|
+
cancelable: !0,
|
|
2229
|
+
detail: {
|
|
2230
|
+
token: E.token
|
|
2231
|
+
}
|
|
2232
|
+
})), B() !== "" ? window.location.href = B() : e.redirect !== "" ? window.location.href = e.redirect : (R(!1), Ie(""), ve(""), Se(""), v(""), n(e.startMode), P(), T())) : (R(!0), oe.dispatchEvent(new CustomEvent("spartan-invite-complete", {
|
|
2233
|
+
bubbles: !0,
|
|
2234
|
+
cancelable: !0,
|
|
2235
|
+
detail: {
|
|
2236
|
+
sub: o,
|
|
2237
|
+
success: !0
|
|
2238
|
+
}
|
|
2239
|
+
})), setTimeout(() => {
|
|
2240
|
+
B() !== "" ? window.location.href = B() : e.redirect !== "" ? window.location.href = e.redirect : (R(!1), Ie(""), ve(""), Se(""), v(""), n(e.startMode), P(), T());
|
|
2241
|
+
}, 2e3));
|
|
2242
|
+
} else {
|
|
2243
|
+
const E = await g.json().catch(() => ({}));
|
|
2244
|
+
g.status === 400 || String(E.message).includes("invalid OTP") ? D(d.i18n("sa-invite-error-otp")) : g.status === 504 || String(E.message).includes("expired") ? D(d.i18n("sa-invite-error-expired")) : D(E.message || d.i18n("sa-invite-error-generic"));
|
|
2245
|
+
}
|
|
2246
|
+
}
|
|
2147
2247
|
return (() => {
|
|
2148
|
-
var
|
|
2149
|
-
return typeof
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2248
|
+
var o = eu(), g = o.firstChild, E = g.nextSibling, oe = E.nextSibling, Be = _;
|
|
2249
|
+
return typeof Be == "function" ? Nt(Be, o) : _ = o, o.addEventListener("submit", (M) => {
|
|
2250
|
+
if (M.preventDefault(), b()) return;
|
|
2251
|
+
ge(!0), (t() === "sign-up" ? c() : t() === "signup-verify" ? q() : t() === "invite" ? Promise.resolve(nt()) : U()).finally(() => ge(!1));
|
|
2252
|
+
}), f(E, z), f(oe, (() => {
|
|
2253
|
+
var M = h(() => t() === "reset-email" || t() === "reset-code");
|
|
2254
|
+
return () => M() ? d.i18n("sa-reset-password") : h(() => t() === "signup-verify" || t() === "signup-webauthn")() ? d.i18n("sa-signup-mfa-title") : h(() => t() === "invite")() ? d.i18n("sa-complete-invite") : d.i18n("sa-login");
|
|
2255
|
+
})()), f(o, $ && (() => {
|
|
2256
|
+
var M = tu();
|
|
2257
|
+
return f(M, $), M;
|
|
2258
|
+
})(), null), f(o, (() => {
|
|
2259
|
+
var M = h(() => !!Ee());
|
|
2260
|
+
return () => M() && (() => {
|
|
2261
|
+
var a = it();
|
|
2262
|
+
return f(a, () => d.i18n("sa-signup-complete")), a;
|
|
2162
2263
|
})();
|
|
2163
|
-
})(),
|
|
2164
|
-
var
|
|
2165
|
-
return () =>
|
|
2166
|
-
var
|
|
2167
|
-
return
|
|
2264
|
+
})(), null), f(o, (() => {
|
|
2265
|
+
var M = h(() => !!W());
|
|
2266
|
+
return () => M() && (() => {
|
|
2267
|
+
var a = it();
|
|
2268
|
+
return f(a, () => d.i18n("sa-reset-success")), a;
|
|
2168
2269
|
})();
|
|
2169
|
-
})(),
|
|
2170
|
-
var
|
|
2171
|
-
return () =>
|
|
2172
|
-
var
|
|
2173
|
-
return
|
|
2174
|
-
})()),
|
|
2175
|
-
var
|
|
2176
|
-
return
|
|
2270
|
+
})(), null), f(o, (() => {
|
|
2271
|
+
var M = h(() => t() === "invite");
|
|
2272
|
+
return () => M() && [h(() => h(() => !!ze())() && (() => {
|
|
2273
|
+
var a = su();
|
|
2274
|
+
return f(a, ze), a;
|
|
2275
|
+
})()), h(() => h(() => !!S())() && (() => {
|
|
2276
|
+
var a = iu();
|
|
2277
|
+
return f(a, () => d.i18n("sa-invite-success")), a;
|
|
2278
|
+
})()), (() => {
|
|
2279
|
+
var a = nu();
|
|
2280
|
+
return a.$$input = (p) => Se(p.currentTarget.value), y((p) => {
|
|
2281
|
+
var N = d.i18n("sa-invite-otp"), Ce = b() || S();
|
|
2282
|
+
return N !== p.e && le(a, "placeholder", p.e = N), Ce !== p.t && (a.disabled = p.t = Ce), p;
|
|
2283
|
+
}, {
|
|
2284
|
+
e: void 0,
|
|
2285
|
+
t: void 0
|
|
2286
|
+
}), y(() => a.value = xe()), a;
|
|
2177
2287
|
})(), (() => {
|
|
2178
|
-
var
|
|
2179
|
-
return
|
|
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")() && (() => {
|
|
2184
|
-
var c = Xi();
|
|
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;
|
|
2288
|
+
var a = Et();
|
|
2289
|
+
return f(a, () => d.i18n("sa-invite-otp-hint")), a;
|
|
2189
2290
|
})(), (() => {
|
|
2190
|
-
var
|
|
2191
|
-
return
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
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;
|
|
2201
|
-
})();
|
|
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;
|
|
2291
|
+
var a = ru();
|
|
2292
|
+
return a.$$input = (p) => v(p.currentTarget.value), y((p) => {
|
|
2293
|
+
var N = d.i18n("sa-invite-password"), Ce = b() || S();
|
|
2294
|
+
return N !== p.e && le(a, "placeholder", p.e = N), Ce !== p.t && (a.disabled = p.t = Ce), p;
|
|
2295
|
+
}, {
|
|
2296
|
+
e: void 0,
|
|
2297
|
+
t: void 0
|
|
2298
|
+
}), y(() => a.value = A()), a;
|
|
2207
2299
|
})(), (() => {
|
|
2208
|
-
var
|
|
2209
|
-
return
|
|
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;
|
|
2300
|
+
var a = Et();
|
|
2301
|
+
return f(a, () => d.i18n("sa-invite-password-hint")), a;
|
|
2231
2302
|
})(), (() => {
|
|
2232
|
-
var
|
|
2233
|
-
return
|
|
2303
|
+
var a = Ft();
|
|
2304
|
+
return f(a, (() => {
|
|
2305
|
+
var p = h(() => !!b());
|
|
2306
|
+
return () => p() ? d.i18n("sa-invite-completing") : d.i18n("sa-invite-submit");
|
|
2307
|
+
})()), y(() => a.disabled = b() || S()), a;
|
|
2234
2308
|
})()];
|
|
2235
|
-
})(), null),
|
|
2236
|
-
var
|
|
2237
|
-
return () =>
|
|
2238
|
-
var
|
|
2239
|
-
return
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2309
|
+
})(), null), f(o, (() => {
|
|
2310
|
+
var M = h(() => t() !== "invite");
|
|
2311
|
+
return () => M() && [(() => {
|
|
2312
|
+
var a = yt();
|
|
2313
|
+
return a.$$input = (p) => s(p.currentTarget.value), y((p) => {
|
|
2314
|
+
var N = d.i18n("sa-username"), Ce = t() === "otp" || t() === "otp-pick" || t() === "reset-code" || t() === "signup-verify" || t() === "signup-webauthn";
|
|
2315
|
+
return N !== p.e && le(a, "placeholder", p.e = N), Ce !== p.t && (a.disabled = p.t = Ce), p;
|
|
2316
|
+
}, {
|
|
2317
|
+
e: void 0,
|
|
2318
|
+
t: void 0
|
|
2319
|
+
}), y(() => a.value = r()), a;
|
|
2320
|
+
})(), h(() => h(() => t() !== "sign-up" && t() !== "signup-verify" && t() !== "signup-webauthn")() && [h(() => h(() => t() === "password")() && (() => {
|
|
2321
|
+
var a = $t();
|
|
2322
|
+
return a.$$input = (p) => u(p.currentTarget.value), y(() => le(a, "placeholder", d.i18n("sa-password"))), y(() => a.value = i()), a;
|
|
2323
|
+
})()), h(() => h(() => t() === "webauthn")() && it()), h(() => h(() => t() === "otp-pick")() && [(() => {
|
|
2324
|
+
var a = at();
|
|
2325
|
+
return f(a, () => d.i18n("sa-otp-choose")), a;
|
|
2326
|
+
})(), (() => {
|
|
2327
|
+
var a = au();
|
|
2328
|
+
return a.addEventListener("change", (p) => k(p.currentTarget.value)), f(a, () => we().map((p) => (() => {
|
|
2329
|
+
var N = uu(), Ce = N.firstChild, Dt = Ce.nextSibling;
|
|
2330
|
+
return Dt.nextSibling, f(N, () => p.DisplayName || p.ID, Ce), f(N, () => p.Type, Dt), y(() => N.value = p.ID), N;
|
|
2331
|
+
})())), y(() => a.value = Ae()), a;
|
|
2332
|
+
})()]), h(() => h(() => t() === "otp")() && (() => {
|
|
2333
|
+
var a = yt();
|
|
2334
|
+
return a.$$input = (p) => C(p.currentTarget.value), y(() => le(a, "placeholder", d.i18n("sa-code"))), y(() => a.value = l()), a;
|
|
2335
|
+
})()), h(() => h(() => t() === "reset-code")() && [(() => {
|
|
2336
|
+
var a = Bt();
|
|
2337
|
+
return a.$$input = (p) => G(p.currentTarget.value), y(() => le(a, "placeholder", d.i18n("sa-reset-code"))), y(() => a.value = ue()), a;
|
|
2338
|
+
})(), (() => {
|
|
2339
|
+
var a = ou();
|
|
2340
|
+
return a.$$input = (p) => J(p.currentTarget.value), y(() => le(a, "placeholder", d.i18n("sa-new-password"))), y(() => a.value = te()), a;
|
|
2341
|
+
})()]), h(() => h(() => t() === "password" || t() === "webauthn")() && (() => {
|
|
2342
|
+
var a = lu(), p = a.firstChild, N = p.nextSibling;
|
|
2343
|
+
return N.firstChild, a.$$click = () => n(t() === "password" ? "webauthn" : "password"), f(N, () => d.i18n("sa-use-password"), null), y(() => p.checked = t() === "password"), a;
|
|
2344
|
+
})())]), h(() => h(() => t() === "sign-up")() && (() => {
|
|
2345
|
+
var a = $t();
|
|
2346
|
+
return a.$$input = (p) => u(p.currentTarget.value), y(() => le(a, "placeholder", d.i18n("sa-password"))), y(() => a.value = i()), a;
|
|
2347
|
+
})()), h(() => h(() => t() === "signup-verify")() && [(() => {
|
|
2348
|
+
var a = at();
|
|
2349
|
+
return f(a, () => d.i18n("sa-signup-verify-prompt")), a;
|
|
2350
|
+
})(), (() => {
|
|
2351
|
+
var a = Bt();
|
|
2352
|
+
return a.$$input = (p) => C(p.currentTarget.value), y(() => le(a, "placeholder", d.i18n("sa-code"))), y(() => a.value = l()), a;
|
|
2353
|
+
})()]), h(() => h(() => t() === "signup-webauthn")() && (() => {
|
|
2354
|
+
var a = at();
|
|
2355
|
+
return f(a, () => d.i18n("sa-signup-webauthn-prompt")), a;
|
|
2356
|
+
})()), h(() => h(() => t() !== "signup-webauthn")() && (() => {
|
|
2357
|
+
var a = Ft();
|
|
2358
|
+
return f(a, (() => {
|
|
2359
|
+
var p = h(() => !!b());
|
|
2360
|
+
return () => p() ? d.i18n("sa-loading") : h(() => t() === "sign-up")() ? d.i18n("sa-signup") : h(() => t() === "otp-pick")() ? d.i18n("sa-otp-send-code") : h(() => t() === "otp")() ? d.i18n("sa-otp-verify") : h(() => t() === "reset-email")() ? d.i18n("sa-otp-send-code") : h(() => t() === "reset-code")() ? d.i18n("sa-reset-submit") : h(() => t() === "signup-verify")() ? d.i18n("sa-otp-verify") : d.i18n("sa-login");
|
|
2361
|
+
})()), y(() => a.disabled = b()), a;
|
|
2362
|
+
})()), h(() => h(() => t() === "signup-webauthn")() && [(() => {
|
|
2363
|
+
var a = cu();
|
|
2364
|
+
return a.$$click = () => H(), f(a, (() => {
|
|
2365
|
+
var p = h(() => !!b());
|
|
2366
|
+
return () => p() ? d.i18n("sa-loading") : d.i18n("sa-signup-webauthn-setup");
|
|
2367
|
+
})()), y(() => a.disabled = b()), a;
|
|
2368
|
+
})(), (() => {
|
|
2369
|
+
var a = Ke();
|
|
2370
|
+
return a.$$click = () => ne(), f(a, () => d.i18n("sa-signup-webauthn-done")), a;
|
|
2371
|
+
})()]), h(() => h(() => t() === "password")() && (() => {
|
|
2372
|
+
var a = Ke();
|
|
2373
|
+
return a.$$click = () => {
|
|
2374
|
+
D(""), Z(!1), n("reset-email");
|
|
2375
|
+
}, f(a, () => d.i18n("sa-forgot-password")), a;
|
|
2376
|
+
})()), h(() => h(() => t() === "reset-email" || t() === "reset-code")() && (() => {
|
|
2377
|
+
var a = Ke();
|
|
2378
|
+
return a.$$click = () => {
|
|
2379
|
+
D(""), G(""), J(""), n(e.startMode);
|
|
2380
|
+
}, f(a, () => d.i18n("sa-back")), a;
|
|
2381
|
+
})()), h(() => h(() => !!(ae() && t() !== "reset-email" && t() !== "reset-code" && t() !== "signup-verify" && t() !== "signup-webauthn"))() && (() => {
|
|
2382
|
+
var a = Ke();
|
|
2383
|
+
return a.$$click = () => t() === "sign-up" ? n(e.startMode) : n("sign-up"), f(a, (() => {
|
|
2384
|
+
var p = h(() => t() === "sign-up");
|
|
2385
|
+
return () => p() ? d.i18n("sa-back") : d.i18n("sa-signup");
|
|
2386
|
+
})()), a;
|
|
2387
|
+
})()), h(() => h(() => X().length > 0 && (t() === "password" || t() === "webauthn" || t() === "sign-up"))() && [(() => {
|
|
2388
|
+
var a = du(), p = a.firstChild;
|
|
2389
|
+
return f(p, () => d.i18n("sa-or")), a;
|
|
2390
|
+
})(), h(() => X().map((a) => (() => {
|
|
2391
|
+
var p = fu();
|
|
2392
|
+
return p.$$click = () => Q(a.provider), f(p, (() => {
|
|
2393
|
+
var N = h(() => a.provider === "google");
|
|
2394
|
+
return () => N() && hu();
|
|
2395
|
+
})(), null), f(p, (() => {
|
|
2396
|
+
var N = h(() => a.provider === "github");
|
|
2397
|
+
return () => N() && pu();
|
|
2398
|
+
})(), null), f(p, (() => {
|
|
2399
|
+
var N = h(() => a.provider === "apple");
|
|
2400
|
+
return () => N() && Du();
|
|
2401
|
+
})(), null), f(p, (() => {
|
|
2402
|
+
var N = h(() => a.provider === "oidc");
|
|
2403
|
+
return () => N() && gu();
|
|
2404
|
+
})(), null), f(p, (() => {
|
|
2405
|
+
var N = h(() => a.provider === "google");
|
|
2406
|
+
return () => N() ? d.i18n("sa-social-google") : h(() => a.provider === "github")() ? d.i18n("sa-social-github") : h(() => a.provider === "apple")() ? d.i18n("sa-social-apple") : d.i18n("sa-social-oidc");
|
|
2407
|
+
})(), null), y(() => p.disabled = !!pe() || b()), p;
|
|
2408
|
+
})()))])];
|
|
2409
|
+
})(), null), o;
|
|
2294
2410
|
})();
|
|
2295
2411
|
});
|
|
2296
|
-
|
|
2297
|
-
var
|
|
2412
|
+
ft(["input", "click"]);
|
|
2413
|
+
var bu = /* @__PURE__ */ F(`<div class=container><style>.container {
|
|
2298
2414
|
background-color: #ffffff;
|
|
2299
2415
|
border-radius: 10px;
|
|
2300
2416
|
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
|
|
@@ -2362,6 +2478,11 @@ var ca = /* @__PURE__ */ y(`<div class=container><style>.container {
|
|
|
2362
2478
|
cursor: pointer;
|
|
2363
2479
|
}
|
|
2364
2480
|
|
|
2481
|
+
.btn:disabled {
|
|
2482
|
+
opacity: 0.6;
|
|
2483
|
+
cursor: not-allowed;
|
|
2484
|
+
}
|
|
2485
|
+
|
|
2365
2486
|
.btn.add {
|
|
2366
2487
|
background-color: #007bff;
|
|
2367
2488
|
color: #ffffff;
|
|
@@ -2467,8 +2588,8 @@ var ca = /* @__PURE__ */ y(`<div class=container><style>.container {
|
|
|
2467
2588
|
.modal-content .btn.verify:hover {
|
|
2468
2589
|
background-color: #0056b3;
|
|
2469
2590
|
}
|
|
2470
|
-
</style><style></style><h1 class=header>`),
|
|
2471
|
-
const
|
|
2591
|
+
</style><style></style><h1 class=header>`), kt = /* @__PURE__ */ F("<span class=error-message>"), vu = /* @__PURE__ */ F("<div class=section><h2></h2><div class=security-keys>"), Cu = /* @__PURE__ */ F('<div class=key-item><span></span><button class="btn remove">'), xt = /* @__PURE__ */ F("<span>"), wu = /* @__PURE__ */ F("<div class=section><div class=security-keys>"), Au = /* @__PURE__ */ F('<button class="btn add">+ '), Eu = /* @__PURE__ */ F('<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">'), Fu = /* @__PURE__ */ F("<div class=section><h2></h2><table><thead><tr><th></th><th></th><th></th></tr></thead><tbody>"), yu = /* @__PURE__ */ F('<tr class=mfa-list-item><td></td><td></td><td><button class="btn remove">'), $u = /* @__PURE__ */ F('<span> <button class="btn validate">'), Bu = /* @__PURE__ */ F('<div class=section><div class=mfa-manage><button class="btn add">+ '), ku = /* @__PURE__ */ F('<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">'), xu = /* @__PURE__ */ F('<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');
|
|
2592
|
+
const Su = {
|
|
2472
2593
|
domain: "http://127.0.0.1:11000",
|
|
2473
2594
|
sector: "0ad5c3e5-0186-4557-8b32-4b36f247bf09",
|
|
2474
2595
|
// defaults to the admin sector
|
|
@@ -2478,283 +2599,291 @@ const wa = {
|
|
|
2478
2599
|
redirect: "/",
|
|
2479
2600
|
redirectOnUnauthenticated: !0
|
|
2480
2601
|
};
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
const [t, n] =
|
|
2484
|
-
let
|
|
2602
|
+
ht("spartan-account-settings", Su, (e) => {
|
|
2603
|
+
w(""), w("");
|
|
2604
|
+
const [t, n] = w(""), [r, s] = w(""), [i, u] = w(""), [l] = w(e.showWebAuthn), [C, $] = w(!1), [D, B] = w(!1), [ae, de] = w(!1), [Ee, L] = w(!1), [W, Z] = w(!1), [ue, G] = w([]), [te, J] = w([]), [we, Fe] = w(""), [Ae, k] = w(""), [X, ye] = w(""), [pe, De] = w(""), b = pt(e.locale);
|
|
2605
|
+
let ge;
|
|
2485
2606
|
try {
|
|
2486
|
-
|
|
2607
|
+
ge = e.styles;
|
|
2487
2608
|
} catch {
|
|
2488
|
-
|
|
2609
|
+
ge = "";
|
|
2489
2610
|
}
|
|
2490
|
-
|
|
2491
|
-
if (
|
|
2492
|
-
|
|
2611
|
+
ct(async () => {
|
|
2612
|
+
if (Zt())
|
|
2613
|
+
B(!0), s("");
|
|
2493
2614
|
else {
|
|
2494
2615
|
if (e.redirectOnUnauthenticated) {
|
|
2495
2616
|
window.location.href = e.redirect;
|
|
2496
2617
|
return;
|
|
2497
2618
|
}
|
|
2498
|
-
|
|
2619
|
+
B(!1), s(b.i18n("not-authenticated"));
|
|
2499
2620
|
}
|
|
2500
|
-
|
|
2501
|
-
console.log(
|
|
2502
|
-
}), await
|
|
2503
|
-
|
|
2621
|
+
Re().then((v) => {
|
|
2622
|
+
console.log(v);
|
|
2623
|
+
}), await Te(), ve().then((v) => {
|
|
2624
|
+
J(v.registrations);
|
|
2504
2625
|
});
|
|
2505
2626
|
});
|
|
2506
|
-
async function
|
|
2507
|
-
return await (await fetch(`${e.domain}/api/v1/users/self`,
|
|
2627
|
+
async function Re() {
|
|
2628
|
+
return await (await fetch(`${e.domain}/api/v1/users/self`, me("get"))).json();
|
|
2508
2629
|
}
|
|
2509
|
-
function
|
|
2630
|
+
function me(A = "get") {
|
|
2510
2631
|
return {
|
|
2511
|
-
method:
|
|
2632
|
+
method: A,
|
|
2512
2633
|
mode: "cors",
|
|
2513
2634
|
cache: "no-cache",
|
|
2514
2635
|
headers: {
|
|
2515
2636
|
"Content-Type": "application",
|
|
2516
|
-
Authorization: `bearer ${
|
|
2637
|
+
Authorization: `bearer ${Xa()}`
|
|
2517
2638
|
}
|
|
2518
2639
|
};
|
|
2519
2640
|
}
|
|
2520
|
-
function
|
|
2521
|
-
|
|
2522
|
-
|
|
2641
|
+
function Pe() {
|
|
2642
|
+
if (W()) return;
|
|
2643
|
+
Z(!0);
|
|
2644
|
+
let A = me("post");
|
|
2645
|
+
A.body = JSON.stringify({
|
|
2523
2646
|
keyName: t(),
|
|
2524
2647
|
sectorID: e.sector
|
|
2525
|
-
}), fetch(`${e.domain}/api/v1/webauthn/registration/begin`,
|
|
2526
|
-
if (
|
|
2527
|
-
return
|
|
2528
|
-
throw
|
|
2529
|
-
}).then((
|
|
2530
|
-
|
|
2531
|
-
s(
|
|
2532
|
-
}) : s(
|
|
2648
|
+
}), fetch(`${e.domain}/api/v1/webauthn/registration/begin`, A).then((v) => {
|
|
2649
|
+
if (v.status === 200)
|
|
2650
|
+
return v.json();
|
|
2651
|
+
throw v;
|
|
2652
|
+
}).then((v) => (console.log(v), Le(v))).catch((v) => {
|
|
2653
|
+
v.json ? v.json().then((S) => {
|
|
2654
|
+
s(S.message);
|
|
2655
|
+
}) : s(v);
|
|
2656
|
+
}).finally(() => {
|
|
2657
|
+
Z(!1);
|
|
2533
2658
|
});
|
|
2534
2659
|
}
|
|
2535
|
-
async function
|
|
2660
|
+
async function Le(A) {
|
|
2536
2661
|
try {
|
|
2537
|
-
const
|
|
2538
|
-
console.log("Parsed WebAuthn creation options:",
|
|
2539
|
-
const
|
|
2540
|
-
let
|
|
2541
|
-
|
|
2542
|
-
let
|
|
2543
|
-
|
|
2544
|
-
const
|
|
2545
|
-
if (
|
|
2546
|
-
const
|
|
2547
|
-
s(
|
|
2662
|
+
const v = Ht(A.Options);
|
|
2663
|
+
console.log("Parsed WebAuthn creation options:", v);
|
|
2664
|
+
const S = await Wt(v), R = JSON.stringify(S);
|
|
2665
|
+
let d = JSON.parse(R);
|
|
2666
|
+
d.transactionID = A.TransactionID;
|
|
2667
|
+
let _ = me("post");
|
|
2668
|
+
_.body = JSON.stringify(d);
|
|
2669
|
+
const z = await fetch(`${e.domain}/api/v1/webauthn/registration/finish`, _);
|
|
2670
|
+
if (z.status !== 200) {
|
|
2671
|
+
const P = await z.json();
|
|
2672
|
+
s(P.message);
|
|
2548
2673
|
return;
|
|
2549
2674
|
}
|
|
2550
|
-
$(!1), n(""),
|
|
2551
|
-
} catch (
|
|
2552
|
-
console.error("WebAuthn registration error:",
|
|
2675
|
+
$(!1), n(""), Te();
|
|
2676
|
+
} catch (v) {
|
|
2677
|
+
console.error("WebAuthn registration error:", v), s((v == null ? void 0 : v.message) || String(v));
|
|
2553
2678
|
}
|
|
2554
2679
|
}
|
|
2555
|
-
async function
|
|
2556
|
-
let
|
|
2557
|
-
|
|
2558
|
-
ID:
|
|
2680
|
+
async function qe(A) {
|
|
2681
|
+
let v = me("delete");
|
|
2682
|
+
v.body = JSON.stringify({
|
|
2683
|
+
ID: A
|
|
2559
2684
|
});
|
|
2560
2685
|
try {
|
|
2561
|
-
if ((await fetch(`${e.domain}/api/v1/webauthn/${
|
|
2562
|
-
s(
|
|
2686
|
+
if ((await fetch(`${e.domain}/api/v1/webauthn/${A}`, v)).status !== 200) {
|
|
2687
|
+
s(b.i18n("error-webauthn-remove"));
|
|
2563
2688
|
return;
|
|
2564
2689
|
}
|
|
2565
|
-
|
|
2566
|
-
} catch (
|
|
2567
|
-
console.error(
|
|
2690
|
+
Te();
|
|
2691
|
+
} catch (S) {
|
|
2692
|
+
console.error(S), s(b.i18n("error-webauthn-remove"));
|
|
2568
2693
|
return;
|
|
2569
2694
|
}
|
|
2570
2695
|
}
|
|
2571
|
-
async function
|
|
2572
|
-
let
|
|
2696
|
+
async function Te() {
|
|
2697
|
+
let A = me("get");
|
|
2573
2698
|
try {
|
|
2574
|
-
const
|
|
2575
|
-
|
|
2576
|
-
} catch (
|
|
2577
|
-
console.error(
|
|
2578
|
-
}
|
|
2579
|
-
}
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2699
|
+
const S = await (await fetch(`${e.domain}/api/v1/webauthn/registration/list`, A)).json();
|
|
2700
|
+
G(S.registrations || []);
|
|
2701
|
+
} catch (v) {
|
|
2702
|
+
console.error(v), G([]);
|
|
2703
|
+
}
|
|
2704
|
+
}
|
|
2705
|
+
function Oe(A, v) {
|
|
2706
|
+
W() || (Z(!0), Ie(A, v).then((S) => {
|
|
2707
|
+
if (S)
|
|
2708
|
+
return ve().then((R) => {
|
|
2709
|
+
J(R.registrations), Fe(S.transactionID), L(!0);
|
|
2710
|
+
});
|
|
2711
|
+
}).finally(() => {
|
|
2712
|
+
Z(!1);
|
|
2713
|
+
}));
|
|
2714
|
+
}
|
|
2715
|
+
function Ie(A, v) {
|
|
2716
|
+
let S = me("post");
|
|
2717
|
+
return S.body = JSON.stringify({
|
|
2718
|
+
destination: A,
|
|
2719
|
+
OTPType: Se(v),
|
|
2591
2720
|
sectorID: e.sector
|
|
2592
|
-
})
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
if (L.status !== 200) {
|
|
2596
|
-
s(v.i18n("error-otp-verification"));
|
|
2721
|
+
}), fetch(`${e.domain}/api/v1/otp/begin`, S).then((R) => {
|
|
2722
|
+
if (R.status !== 200) {
|
|
2723
|
+
s(b.i18n("error-otp-verification"));
|
|
2597
2724
|
return;
|
|
2598
2725
|
}
|
|
2599
|
-
return
|
|
2600
|
-
}
|
|
2601
|
-
console.error(
|
|
2602
|
-
return;
|
|
2603
|
-
}
|
|
2604
|
-
}
|
|
2605
|
-
async function Ae(E, w) {
|
|
2606
|
-
let T = oe("post");
|
|
2607
|
-
T.body = JSON.stringify({
|
|
2608
|
-
transactionID: E,
|
|
2609
|
-
password: w
|
|
2726
|
+
return R.json();
|
|
2727
|
+
}).catch((R) => {
|
|
2728
|
+
console.error(R), s(b.i18n("error-otp-registration"));
|
|
2610
2729
|
});
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
|
|
2730
|
+
}
|
|
2731
|
+
function ze(A, v) {
|
|
2732
|
+
if (W()) return;
|
|
2733
|
+
Z(!0);
|
|
2734
|
+
let S = me("post");
|
|
2735
|
+
S.body = JSON.stringify({
|
|
2736
|
+
transactionID: A,
|
|
2737
|
+
password: v
|
|
2738
|
+
}), fetch(`${e.domain}/api/v1/otp/finish`, S).then((R) => {
|
|
2739
|
+
if (R.status !== 200) {
|
|
2740
|
+
u(b.i18n("error-otp-verification"));
|
|
2615
2741
|
return;
|
|
2616
2742
|
}
|
|
2617
|
-
return
|
|
2618
|
-
|
|
2619
|
-
}),
|
|
2620
|
-
}
|
|
2621
|
-
console.error(
|
|
2622
|
-
|
|
2623
|
-
|
|
2743
|
+
return L(!1), k(""), de(!1), De(""), ye(""), ve().then((d) => {
|
|
2744
|
+
J(d.registrations);
|
|
2745
|
+
}), R.json();
|
|
2746
|
+
}).catch((R) => {
|
|
2747
|
+
console.error(R), u(b.i18n("error-otp-registration"));
|
|
2748
|
+
}).finally(() => {
|
|
2749
|
+
Z(!1);
|
|
2750
|
+
});
|
|
2624
2751
|
}
|
|
2625
|
-
async function
|
|
2626
|
-
let
|
|
2752
|
+
async function ve() {
|
|
2753
|
+
let A = me("get");
|
|
2627
2754
|
try {
|
|
2628
|
-
return await (await fetch(`${e.domain}/api/v1/otp/list`,
|
|
2629
|
-
} catch (
|
|
2630
|
-
console.error(
|
|
2755
|
+
return await (await fetch(`${e.domain}/api/v1/otp/list`, A)).json();
|
|
2756
|
+
} catch (v) {
|
|
2757
|
+
console.error(v), s(b.i18n("error-otp-list"));
|
|
2631
2758
|
return;
|
|
2632
2759
|
}
|
|
2633
2760
|
}
|
|
2634
|
-
async function
|
|
2635
|
-
let
|
|
2636
|
-
|
|
2637
|
-
ID:
|
|
2761
|
+
async function xe(A) {
|
|
2762
|
+
let v = me("delete");
|
|
2763
|
+
v.body = JSON.stringify({
|
|
2764
|
+
ID: A
|
|
2638
2765
|
});
|
|
2639
2766
|
try {
|
|
2640
|
-
if ((await fetch(`${e.domain}/api/v1/otp/${
|
|
2641
|
-
s(
|
|
2767
|
+
if ((await fetch(`${e.domain}/api/v1/otp/${A}`, v)).status !== 200) {
|
|
2768
|
+
s(b.i18n("error-otp-remove"));
|
|
2642
2769
|
return;
|
|
2643
2770
|
}
|
|
2644
|
-
|
|
2645
|
-
R
|
|
2771
|
+
ve().then((R) => {
|
|
2772
|
+
J(R.registrations);
|
|
2646
2773
|
});
|
|
2647
|
-
} catch (
|
|
2648
|
-
console.error(
|
|
2774
|
+
} catch (S) {
|
|
2775
|
+
console.error(S), s(b.i18n("error-otp-remove"));
|
|
2649
2776
|
return;
|
|
2650
2777
|
}
|
|
2651
2778
|
}
|
|
2652
|
-
function
|
|
2653
|
-
return
|
|
2779
|
+
function Se(A) {
|
|
2780
|
+
return A === "EMAIL" ? 2 : 1;
|
|
2654
2781
|
}
|
|
2655
2782
|
return (() => {
|
|
2656
|
-
var
|
|
2657
|
-
return
|
|
2658
|
-
var
|
|
2659
|
-
return d
|
|
2660
|
-
})(), null),
|
|
2661
|
-
var
|
|
2662
|
-
return () =>
|
|
2663
|
-
var
|
|
2664
|
-
return
|
|
2665
|
-
var
|
|
2666
|
-
return
|
|
2667
|
-
confirm(
|
|
2668
|
-
},
|
|
2669
|
-
})()), null),
|
|
2670
|
-
var
|
|
2671
|
-
return () =>
|
|
2672
|
-
var
|
|
2673
|
-
return
|
|
2783
|
+
var A = bu(), v = A.firstChild, S = v.nextSibling, R = S.nextSibling;
|
|
2784
|
+
return f(S, ge), f(R, () => b.i18n("sa-account-settings")), f(A, r && (() => {
|
|
2785
|
+
var d = kt();
|
|
2786
|
+
return f(d, r), d;
|
|
2787
|
+
})(), null), f(A, (() => {
|
|
2788
|
+
var d = h(() => !!(l() && ue().length));
|
|
2789
|
+
return () => d() && (() => {
|
|
2790
|
+
var _ = vu(), z = _.firstChild, P = z.nextSibling;
|
|
2791
|
+
return f(z, () => b.i18n("sa-webauthn-security-keys")), f(P, () => ue().map((T) => (() => {
|
|
2792
|
+
var Q = Cu(), V = Q.firstChild, q = V.nextSibling;
|
|
2793
|
+
return f(V, () => T.keyName), q.$$click = () => {
|
|
2794
|
+
confirm(b.i18n("sa-confirm-delete-key")) && qe(T.keyName);
|
|
2795
|
+
}, f(q, () => b.i18n("sa-remove")), Q;
|
|
2796
|
+
})()), null), f(P, (() => {
|
|
2797
|
+
var T = h(() => ue().length <= 0);
|
|
2798
|
+
return () => T() && (() => {
|
|
2799
|
+
var Q = xt();
|
|
2800
|
+
return f(Q, () => b.i18n("sa-no-security-keys")), Q;
|
|
2674
2801
|
})();
|
|
2675
|
-
})(), null),
|
|
2802
|
+
})(), null), _;
|
|
2676
2803
|
})();
|
|
2677
|
-
})(), null),
|
|
2678
|
-
var
|
|
2679
|
-
return () =>
|
|
2680
|
-
var
|
|
2681
|
-
return
|
|
2682
|
-
var
|
|
2683
|
-
return () =>
|
|
2684
|
-
var
|
|
2685
|
-
return
|
|
2804
|
+
})(), null), f(A, (() => {
|
|
2805
|
+
var d = h(() => !!l());
|
|
2806
|
+
return () => d() && (() => {
|
|
2807
|
+
var _ = wu(), z = _.firstChild;
|
|
2808
|
+
return f(z, (() => {
|
|
2809
|
+
var P = h(() => !C());
|
|
2810
|
+
return () => P() && (() => {
|
|
2811
|
+
var T = Au();
|
|
2812
|
+
return T.firstChild, T.$$click = () => $(!0), f(T, () => b.i18n("sa-add-security-key"), null), T;
|
|
2686
2813
|
})();
|
|
2687
|
-
})(), null),
|
|
2688
|
-
var
|
|
2689
|
-
return () =>
|
|
2690
|
-
var
|
|
2691
|
-
return
|
|
2692
|
-
var
|
|
2693
|
-
return
|
|
2814
|
+
})(), null), f(z, (() => {
|
|
2815
|
+
var P = h(() => !!C());
|
|
2816
|
+
return () => P() && (() => {
|
|
2817
|
+
var T = Eu(), Q = T.firstChild, V = Q.firstChild, q = V.nextSibling, H = q.nextSibling, ne = H.nextSibling;
|
|
2818
|
+
return f(V, () => b.i18n("sa-webauthn-key-name")), q.$$input = (U) => n(U.currentTarget.value), H.$$click = () => $(!1), f(H, () => b.i18n("sa-cancel")), ne.$$click = () => t() !== "" && Pe(), f(ne, () => b.i18n("sa-register")), y((U) => {
|
|
2819
|
+
var c = b.i18n("sa-webauthn-key-name"), m = t() === "" || W();
|
|
2820
|
+
return c !== U.e && le(q, "placeholder", U.e = c), m !== U.t && (ne.disabled = U.t = m), U;
|
|
2694
2821
|
}, {
|
|
2695
2822
|
e: void 0,
|
|
2696
2823
|
t: void 0
|
|
2697
|
-
}),
|
|
2824
|
+
}), y(() => q.value = t()), T;
|
|
2698
2825
|
})();
|
|
2699
|
-
})(), null),
|
|
2826
|
+
})(), null), _;
|
|
2700
2827
|
})();
|
|
2701
|
-
})(), null),
|
|
2702
|
-
var
|
|
2703
|
-
return () =>
|
|
2704
|
-
var
|
|
2705
|
-
return
|
|
2706
|
-
var
|
|
2707
|
-
return
|
|
2708
|
-
var
|
|
2709
|
-
return () =>
|
|
2710
|
-
var
|
|
2711
|
-
return
|
|
2828
|
+
})(), null), f(A, (() => {
|
|
2829
|
+
var d = h(() => te().length > 0);
|
|
2830
|
+
return () => d() && (() => {
|
|
2831
|
+
var _ = Fu(), z = _.firstChild, P = z.nextSibling, T = P.firstChild, Q = T.firstChild, V = Q.firstChild, q = V.nextSibling, H = q.nextSibling, ne = T.nextSibling;
|
|
2832
|
+
return f(z, () => b.i18n("sa-mfa")), f(V, () => b.i18n("sa-mfa-destination")), f(q, () => b.i18n("sa-mfa-validated")), f(H, () => b.i18n("sa-mfa-action")), f(ne, () => te().map((U) => (() => {
|
|
2833
|
+
var c = yu(), m = c.firstChild, O = m.nextSibling, x = O.nextSibling, ee = x.firstChild;
|
|
2834
|
+
return f(m, () => U.DisplayName), f(O, (() => {
|
|
2835
|
+
var re = h(() => !!U.Validated);
|
|
2836
|
+
return () => re() ? (() => {
|
|
2837
|
+
var se = xt();
|
|
2838
|
+
return f(se, () => b.i18n("sa-yes")), se;
|
|
2712
2839
|
})() : (() => {
|
|
2713
|
-
var
|
|
2714
|
-
return
|
|
2715
|
-
|
|
2716
|
-
},
|
|
2840
|
+
var se = $u(), fe = se.firstChild, $e = fe.nextSibling;
|
|
2841
|
+
return f(se, () => b.i18n("sa-no"), fe), $e.$$click = () => {
|
|
2842
|
+
Oe(U.DisplayName, U.Type === "email" ? "EMAIL" : "SMS");
|
|
2843
|
+
}, f($e, () => b.i18n("sa-validate")), y(() => $e.disabled = W()), se;
|
|
2717
2844
|
})();
|
|
2718
|
-
})()),
|
|
2719
|
-
confirm(
|
|
2720
|
-
},
|
|
2721
|
-
})())),
|
|
2845
|
+
})()), ee.$$click = () => {
|
|
2846
|
+
confirm(b.i18n("sa-confirm-delete-key")) && xe(U.ID);
|
|
2847
|
+
}, f(ee, () => b.i18n("sa-remove")), y(() => le(m, "title", U.DisplayName)), c;
|
|
2848
|
+
})())), _;
|
|
2722
2849
|
})();
|
|
2723
|
-
})(), null),
|
|
2724
|
-
var
|
|
2725
|
-
return () =>
|
|
2726
|
-
var
|
|
2727
|
-
return
|
|
2850
|
+
})(), null), f(A, (() => {
|
|
2851
|
+
var d = h(() => !ae());
|
|
2852
|
+
return () => d() && (() => {
|
|
2853
|
+
var _ = Bu(), z = _.firstChild, P = z.firstChild;
|
|
2854
|
+
return P.firstChild, P.$$click = () => de(!0), f(P, () => b.i18n("sa-register-mfa"), null), _;
|
|
2728
2855
|
})();
|
|
2729
|
-
})(), null),
|
|
2730
|
-
var
|
|
2731
|
-
return () =>
|
|
2732
|
-
var
|
|
2733
|
-
return
|
|
2734
|
-
var
|
|
2735
|
-
return
|
|
2856
|
+
})(), null), f(A, (() => {
|
|
2857
|
+
var d = h(() => !!ae());
|
|
2858
|
+
return () => d() && (() => {
|
|
2859
|
+
var _ = ku(), z = _.firstChild, P = z.nextSibling, T = P.firstChild, Q = T.firstChild, V = Q.nextSibling, q = V.nextSibling, H = T.nextSibling, ne = H.firstChild, U = ne.nextSibling, c = U.nextSibling, m = H.nextSibling, O = m.firstChild;
|
|
2860
|
+
return f(z, () => b.i18n("sa-add-mfa")), f(Q, () => b.i18n("sa-email")), V.$$input = (x) => ye(x.currentTarget.value), q.$$click = () => Oe(X(), "EMAIL"), f(q, () => b.i18n("sa-add-email")), f(ne, () => b.i18n("sa-phone")), U.$$input = (x) => De(x.currentTarget.value), c.$$click = () => Oe(pe(), "SMS"), f(c, () => b.i18n("sa-add-sms")), O.$$click = () => de(!1), f(O, () => b.i18n("sa-cancel")), y((x) => {
|
|
2861
|
+
var ee = b.i18n("sa-email"), re = W(), se = b.i18n("sa-phone"), fe = W();
|
|
2862
|
+
return ee !== x.e && le(V, "placeholder", x.e = ee), re !== x.t && (q.disabled = x.t = re), se !== x.a && le(U, "placeholder", x.a = se), fe !== x.o && (c.disabled = x.o = fe), x;
|
|
2736
2863
|
}, {
|
|
2737
2864
|
e: void 0,
|
|
2738
|
-
t: void 0
|
|
2739
|
-
|
|
2865
|
+
t: void 0,
|
|
2866
|
+
a: void 0,
|
|
2867
|
+
o: void 0
|
|
2868
|
+
}), y(() => V.value = X()), y(() => U.value = pe()), _;
|
|
2740
2869
|
})();
|
|
2741
|
-
})(), null),
|
|
2742
|
-
var
|
|
2743
|
-
return () =>
|
|
2744
|
-
var
|
|
2745
|
-
return
|
|
2746
|
-
var
|
|
2747
|
-
return () =>
|
|
2748
|
-
var
|
|
2749
|
-
return
|
|
2870
|
+
})(), null), f(A, (() => {
|
|
2871
|
+
var d = h(() => !!Ee());
|
|
2872
|
+
return () => d() && (() => {
|
|
2873
|
+
var _ = xu(), z = _.firstChild, P = z.firstChild, T = P.nextSibling, Q = T.nextSibling, V = Q.nextSibling, q = V.nextSibling;
|
|
2874
|
+
return _.$$click = () => L(!1), z.$$click = (H) => H.stopPropagation(), P.$$click = () => L(!1), f(z, (() => {
|
|
2875
|
+
var H = h(() => !!i());
|
|
2876
|
+
return () => H() && (() => {
|
|
2877
|
+
var ne = kt();
|
|
2878
|
+
return f(ne, i), ne;
|
|
2750
2879
|
})();
|
|
2751
|
-
})(),
|
|
2880
|
+
})(), Q), V.$$input = (H) => k(H.currentTarget.value), q.$$click = () => ze(we(), Ae()), y(() => q.disabled = W()), y(() => V.value = Ae()), _;
|
|
2752
2881
|
})();
|
|
2753
|
-
})(), null),
|
|
2882
|
+
})(), null), A;
|
|
2754
2883
|
})();
|
|
2755
2884
|
});
|
|
2756
|
-
|
|
2757
|
-
var
|
|
2885
|
+
ft(["click", "input"]);
|
|
2886
|
+
var _u = /* @__PURE__ */ F(`<form class=invite-frame><style>.invite-frame {
|
|
2758
2887
|
display: flex;
|
|
2759
2888
|
flex-direction: column;
|
|
2760
2889
|
justify-content: center;
|
|
@@ -2814,8 +2943,8 @@ var Ea = /* @__PURE__ */ y(`<form class=invite-frame><style>.invite-frame {
|
|
|
2814
2943
|
margin-bottom: 10px;
|
|
2815
2944
|
display: block;
|
|
2816
2945
|
}
|
|
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>`),
|
|
2818
|
-
const
|
|
2946
|
+
</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>`), Tu = /* @__PURE__ */ F("<span class=info-message>"), Ou = /* @__PURE__ */ F("<span class=error-message>"), Iu = /* @__PURE__ */ F("<span class=success-message>");
|
|
2947
|
+
const Pu = {
|
|
2819
2948
|
domain: "http://127.0.0.1:11000",
|
|
2820
2949
|
sector: "0ad5c3e5-0186-4557-8b32-4b36f247bf09",
|
|
2821
2950
|
// defaults to the admin sector
|
|
@@ -2828,36 +2957,37 @@ const Ba = {
|
|
|
2828
2957
|
redirect: ""
|
|
2829
2958
|
// where to redirect after successful completion
|
|
2830
2959
|
};
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
|
|
2960
|
+
ht("spartan-invite", Pu, (e) => {
|
|
2961
|
+
console.warn("[spartan-invite] <spartan-invite> is deprecated. Use <spartan-login> instead — it now handles invite links by detecting ?sub= URL params automatically.");
|
|
2962
|
+
const [t, n] = w(""), [r, s] = w(""), [i, u] = w(""), [l, C] = w(""), [$, D] = w(!1), B = pt(e.locale);
|
|
2963
|
+
let ae, de;
|
|
2834
2964
|
try {
|
|
2835
|
-
|
|
2965
|
+
de = e.styles;
|
|
2836
2966
|
} catch {
|
|
2837
|
-
|
|
2967
|
+
de = "";
|
|
2838
2968
|
}
|
|
2839
|
-
|
|
2840
|
-
e.sub || new URLSearchParams(window.location.search).get("sub") ||
|
|
2841
|
-
const
|
|
2842
|
-
|
|
2969
|
+
ct(async () => {
|
|
2970
|
+
e.sub || new URLSearchParams(window.location.search).get("sub") || u("Missing invitation information. Please use the link from your invite email.");
|
|
2971
|
+
const W = new URLSearchParams(window.location.hash.replace("#", "")).get("otp");
|
|
2972
|
+
W && n(W);
|
|
2843
2973
|
});
|
|
2844
|
-
async function
|
|
2845
|
-
var ue,
|
|
2846
|
-
if (
|
|
2847
|
-
|
|
2974
|
+
async function Ee(L) {
|
|
2975
|
+
var ue, G;
|
|
2976
|
+
if (L.preventDefault(), u(""), C(""), D(!0), !t() || t().trim().length === 0) {
|
|
2977
|
+
u("Please enter your verification code"), D(!1);
|
|
2848
2978
|
return;
|
|
2849
2979
|
}
|
|
2850
2980
|
if (!r() || r().length < 8) {
|
|
2851
|
-
|
|
2981
|
+
u("Password must be at least 8 characters"), D(!1);
|
|
2852
2982
|
return;
|
|
2853
2983
|
}
|
|
2854
|
-
const
|
|
2855
|
-
if (!
|
|
2856
|
-
|
|
2984
|
+
const W = new URLSearchParams(window.location.search), Z = e.sub || W.get("sub") || "";
|
|
2985
|
+
if (!Z) {
|
|
2986
|
+
u("Missing invitation information"), D(!1);
|
|
2857
2987
|
return;
|
|
2858
2988
|
}
|
|
2859
2989
|
try {
|
|
2860
|
-
const
|
|
2990
|
+
const te = await fetch(`${e.domain}/api/v1/users/invite/complete`, {
|
|
2861
2991
|
method: "POST",
|
|
2862
2992
|
mode: "cors",
|
|
2863
2993
|
cache: "no-cache",
|
|
@@ -2865,67 +2995,67 @@ nt("spartan-invite", Ba, (e) => {
|
|
|
2865
2995
|
"Content-Type": "application/json"
|
|
2866
2996
|
},
|
|
2867
2997
|
body: JSON.stringify({
|
|
2868
|
-
sub:
|
|
2998
|
+
sub: Z,
|
|
2869
2999
|
otp: t().toUpperCase().trim(),
|
|
2870
3000
|
password: r(),
|
|
2871
3001
|
sectorID: e.sector
|
|
2872
3002
|
})
|
|
2873
3003
|
});
|
|
2874
|
-
if (
|
|
2875
|
-
const
|
|
2876
|
-
|
|
2877
|
-
const
|
|
3004
|
+
if (te.ok) {
|
|
3005
|
+
const J = await te.json();
|
|
3006
|
+
C(B.i18n("sa-invite-success"));
|
|
3007
|
+
const we = new CustomEvent("spartan-invite-complete", {
|
|
2878
3008
|
bubbles: !0,
|
|
2879
3009
|
cancelable: !0,
|
|
2880
3010
|
detail: {
|
|
2881
|
-
sub:
|
|
3011
|
+
sub: Z,
|
|
2882
3012
|
success: !0
|
|
2883
3013
|
}
|
|
2884
3014
|
});
|
|
2885
|
-
|
|
3015
|
+
ae && ae.getRootNode().host.dispatchEvent(we), setTimeout(() => {
|
|
2886
3016
|
e.redirect && e.redirect !== "" && (window.location.href = e.redirect);
|
|
2887
3017
|
}, 2e3);
|
|
2888
3018
|
} else {
|
|
2889
|
-
const
|
|
2890
|
-
|
|
3019
|
+
const J = await te.json().catch(() => ({}));
|
|
3020
|
+
te.status === 400 || (ue = J.message) != null && ue.includes("invalid OTP") ? u(B.i18n("sa-invite-error-otp")) : te.status === 504 || (G = J.message) != null && G.includes("expired") ? u(B.i18n("sa-invite-error-expired")) : u(J.message || B.i18n("sa-invite-error-generic")), D(!1);
|
|
2891
3021
|
}
|
|
2892
|
-
} catch (
|
|
2893
|
-
console.error("Error completing invite:",
|
|
3022
|
+
} catch (te) {
|
|
3023
|
+
console.error("Error completing invite:", te), u(B.i18n("sa-invite-error-generic")), D(!1);
|
|
2894
3024
|
}
|
|
2895
3025
|
}
|
|
2896
3026
|
return (() => {
|
|
2897
|
-
var
|
|
2898
|
-
return typeof
|
|
2899
|
-
var k =
|
|
3027
|
+
var L = _u(), W = L.firstChild, Z = W.nextSibling, ue = Z.nextSibling, G = ue.nextSibling, te = G.nextSibling, J = te.nextSibling, we = J.nextSibling, Fe = we.nextSibling, Ae = ae;
|
|
3028
|
+
return typeof Ae == "function" ? Nt(Ae, L) : ae = L, L.addEventListener("submit", Ee), f(Z, de), f(ue, () => B.i18n("sa-complete-invite")), f(L, (() => {
|
|
3029
|
+
var k = h(() => !!e.email);
|
|
2900
3030
|
return () => k() && (() => {
|
|
2901
|
-
var
|
|
2902
|
-
return
|
|
3031
|
+
var X = Tu();
|
|
3032
|
+
return f(X, () => e.email), X;
|
|
2903
3033
|
})();
|
|
2904
|
-
})(),
|
|
2905
|
-
var k =
|
|
3034
|
+
})(), G), f(L, (() => {
|
|
3035
|
+
var k = h(() => !!i());
|
|
2906
3036
|
return () => k() && (() => {
|
|
2907
|
-
var
|
|
2908
|
-
return
|
|
3037
|
+
var X = Ou();
|
|
3038
|
+
return f(X, i), X;
|
|
2909
3039
|
})();
|
|
2910
|
-
})(),
|
|
2911
|
-
var k =
|
|
3040
|
+
})(), G), f(L, (() => {
|
|
3041
|
+
var k = h(() => !!l());
|
|
2912
3042
|
return () => k() && (() => {
|
|
2913
|
-
var
|
|
2914
|
-
return
|
|
3043
|
+
var X = Iu();
|
|
3044
|
+
return f(X, l), X;
|
|
2915
3045
|
})();
|
|
2916
|
-
})(),
|
|
2917
|
-
var k =
|
|
2918
|
-
return () => k() ?
|
|
2919
|
-
})()),
|
|
2920
|
-
var
|
|
2921
|
-
return
|
|
3046
|
+
})(), G), G.$$input = (k) => n(k.currentTarget.value), f(te, () => B.i18n("sa-invite-otp-hint")), J.$$input = (k) => s(k.currentTarget.value), f(we, () => B.i18n("sa-invite-password-hint")), f(Fe, (() => {
|
|
3047
|
+
var k = h(() => !!$());
|
|
3048
|
+
return () => k() ? B.i18n("sa-invite-completing") : B.i18n("sa-invite-submit");
|
|
3049
|
+
})()), y((k) => {
|
|
3050
|
+
var X = B.i18n("sa-invite-otp"), ye = $() || l() !== "", pe = B.i18n("sa-invite-password"), De = $() || l() !== "", b = $() || l() !== "";
|
|
3051
|
+
return X !== k.e && le(G, "placeholder", k.e = X), ye !== k.t && (G.disabled = k.t = ye), pe !== k.a && le(J, "placeholder", k.a = pe), De !== k.o && (J.disabled = k.o = De), b !== k.i && (Fe.disabled = k.i = b), k;
|
|
2922
3052
|
}, {
|
|
2923
3053
|
e: void 0,
|
|
2924
3054
|
t: void 0,
|
|
2925
3055
|
a: void 0,
|
|
2926
3056
|
o: void 0,
|
|
2927
3057
|
i: void 0
|
|
2928
|
-
}),
|
|
3058
|
+
}), y(() => G.value = t()), y(() => J.value = r()), L;
|
|
2929
3059
|
})();
|
|
2930
3060
|
});
|
|
2931
|
-
|
|
3061
|
+
ft(["input"]);
|