@getauthui/core 0.1.3 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -5
- package/dist/active-team.d.ts +4 -0
- package/dist/active-team.d.ts.map +1 -0
- package/dist/{authui-user-button-PQdLnij_.js → authui-user-button-BeDiMjWw.js} +1028 -635
- package/dist/authui.cdn.js +391 -250
- package/dist/authui.cdn.mjs +1785 -1392
- package/dist/authui.js +61 -49
- package/dist/components/authui-account.d.ts.map +1 -1
- package/dist/components/authui-config.d.ts +1 -1
- package/dist/components/authui-config.d.ts.map +1 -1
- package/dist/components/authui-show.d.ts +10 -0
- package/dist/components/authui-show.d.ts.map +1 -1
- package/dist/components/authui-sign-in.d.ts.map +1 -1
- package/dist/components/authui-user-button.d.ts +8 -0
- package/dist/components/authui-user-button.d.ts.map +1 -1
- package/dist/errors.d.ts +4 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/i18n.d.ts.map +1 -1
- package/dist/icons.d.ts +1 -0
- package/dist/icons.d.ts.map +1 -1
- package/dist/index.d.ts +6 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/last-method.d.ts +13 -0
- package/dist/last-method.d.ts.map +1 -0
- package/dist/password-strength.d.ts +21 -0
- package/dist/password-strength.d.ts.map +1 -0
- package/dist/react/index.d.ts +1 -0
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react.js +1 -1
- package/dist/store.d.ts +18 -0
- package/dist/store.d.ts.map +1 -1
- package/dist/styles/base.d.ts.map +1 -1
- package/dist/types.d.ts +30 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { state as
|
|
2
|
-
import { css as
|
|
3
|
-
import { Client as
|
|
4
|
-
const
|
|
1
|
+
import { state as h, property as g, customElement as O, query as bt } from "lit/decorators.js";
|
|
2
|
+
import { css as F, LitElement as st, nothing as o, html as r, svg as d } from "lit";
|
|
3
|
+
import { Client as nt, Account as ot, Teams as $t, ID as j, Avatars as xt } from "appwrite";
|
|
4
|
+
const kt = {
|
|
5
5
|
signIn: "Sign in",
|
|
6
6
|
dialogSignIn: "Sign in",
|
|
7
7
|
signUp: "Sign up",
|
|
@@ -145,7 +145,20 @@ const ht = {
|
|
|
145
145
|
errorNetwork: "Could not reach the server. Check your connection.",
|
|
146
146
|
errorMethodDisabled: "This sign-in method is disabled for this project.",
|
|
147
147
|
errorNotConfigured: "Auth UI is not configured. Call AuthUI.init() or add <authui-config>.",
|
|
148
|
+
errorConfigIncomplete: "Auth UI is missing endpoint or project. Set them on <authui-config> or pass them to AuthUI.init().",
|
|
149
|
+
errorConfig: "Auth UI cannot reach this Appwrite project. Check that endpoint ends with /v1, the project ID is correct, and this hostname is registered as a Web platform.",
|
|
150
|
+
errorConfigEndpoint: "Check that endpoint ends with /v1. Appwrite API URLs look like https://cloud.appwrite.io/v1.",
|
|
148
151
|
passwordHint: "At least 8 characters.",
|
|
152
|
+
passwordStrengthLabel: "Password strength",
|
|
153
|
+
passwordStrengthTooWeak: "Too weak",
|
|
154
|
+
passwordStrengthWeak: "Weak",
|
|
155
|
+
passwordStrengthFair: "Fair",
|
|
156
|
+
passwordStrengthStrong: "Strong",
|
|
157
|
+
passwordStrengthVeryStrong: "Very strong",
|
|
158
|
+
lastUsed: "Last used",
|
|
159
|
+
teamsLabel: "Teams",
|
|
160
|
+
noTeams: "You are not on any teams yet.",
|
|
161
|
+
activeTeam: "Active",
|
|
149
162
|
signedInAs: "Signed in as",
|
|
150
163
|
manageAccount: "Manage account",
|
|
151
164
|
dialogAccount: "Account",
|
|
@@ -156,13 +169,13 @@ const ht = {
|
|
|
156
169
|
guestAccountDescription: "Add an email and password to keep your data.",
|
|
157
170
|
preview: "Preview"
|
|
158
171
|
};
|
|
159
|
-
function
|
|
172
|
+
function Ct(e, t = {}) {
|
|
160
173
|
return e.replace(
|
|
161
174
|
/\{(\w+)\}/g,
|
|
162
175
|
(i, s) => s in t ? String(t[s]) : `{${s}}`
|
|
163
176
|
);
|
|
164
177
|
}
|
|
165
|
-
const
|
|
178
|
+
const St = {
|
|
166
179
|
amazon: "Amazon",
|
|
167
180
|
apple: "Apple",
|
|
168
181
|
appwrite: "Appwrite",
|
|
@@ -213,10 +226,10 @@ const pt = {
|
|
|
213
226
|
zoho: "Zoho",
|
|
214
227
|
zoom: "Zoom"
|
|
215
228
|
};
|
|
216
|
-
function
|
|
217
|
-
return
|
|
229
|
+
function q(e) {
|
|
230
|
+
return St[e] ?? e.charAt(0).toUpperCase() + e.slice(1);
|
|
218
231
|
}
|
|
219
|
-
const
|
|
232
|
+
const H = (e, t, i = 401) => Object.assign(new Error(t), { type: e, code: i }), A = () => (/* @__PURE__ */ new Date()).toISOString(), I = (e) => new Date(Date.now() - e * 6e4).toISOString(), W = [
|
|
220
233
|
"amber",
|
|
221
234
|
"brave",
|
|
222
235
|
"calm",
|
|
@@ -229,13 +242,13 @@ const T = (e, t, i = 401) => Object.assign(new Error(t), { type: e, code: i }),
|
|
|
229
242
|
"juniper",
|
|
230
243
|
"kite",
|
|
231
244
|
"lumen"
|
|
232
|
-
],
|
|
245
|
+
], ct = () => `${W[Math.floor(Math.random() * W.length)]}-${W[Math.floor(Math.random() * W.length)]}`, T = () => Math.random().toString(36).slice(2, 12), lt = () => Array.from({ length: 2 }, () => Math.random().toString(36).slice(2, 7)).join("-"), At = {
|
|
233
246
|
name: "Ada Lovelace",
|
|
234
247
|
email: "ada@example.com",
|
|
235
248
|
phone: "+15550100"
|
|
236
249
|
};
|
|
237
|
-
class
|
|
238
|
-
constructor(t =
|
|
250
|
+
class Pt {
|
|
251
|
+
constructor(t = At) {
|
|
239
252
|
this.seed = t, this.user = null, this.mfaPending = !1, this.mfaEnabled = !1, this.totpEnrolled = !1, this.recoveryCodes = [], this.lastChallenge = 0, this.sessions = [], this.identities = [], this.logs = [], this.tokens = /* @__PURE__ */ new Map(), this.pendingAuthenticator = null;
|
|
240
253
|
}
|
|
241
254
|
// ───────────────────────── helpers ─────────────────────────
|
|
@@ -243,13 +256,13 @@ class mt {
|
|
|
243
256
|
const i = t.anonymous ?? !1;
|
|
244
257
|
return this.user = {
|
|
245
258
|
$id: "preview-user",
|
|
246
|
-
$createdAt:
|
|
247
|
-
$updatedAt:
|
|
259
|
+
$createdAt: I(1440 * 30),
|
|
260
|
+
$updatedAt: A(),
|
|
248
261
|
name: i ? "" : t.name ?? this.seed.name,
|
|
249
|
-
registration:
|
|
262
|
+
registration: I(1440 * 30),
|
|
250
263
|
status: !0,
|
|
251
264
|
labels: [],
|
|
252
|
-
passwordUpdate: i ? "" :
|
|
265
|
+
passwordUpdate: i ? "" : I(1440 * 7),
|
|
253
266
|
email: i ? "" : t.email ?? this.seed.email,
|
|
254
267
|
phone: i ? "" : t.phone ?? this.seed.phone,
|
|
255
268
|
emailVerification: !i,
|
|
@@ -257,14 +270,14 @@ class mt {
|
|
|
257
270
|
mfa: this.mfaEnabled,
|
|
258
271
|
prefs: {},
|
|
259
272
|
targets: [],
|
|
260
|
-
accessedAt:
|
|
273
|
+
accessedAt: A()
|
|
261
274
|
}, this.seedActivity(i ? "anonymous" : "email"), this.user;
|
|
262
275
|
}
|
|
263
276
|
seedActivity(t) {
|
|
264
277
|
if (this.sessions.length > 0) return;
|
|
265
278
|
const i = {
|
|
266
|
-
$createdAt:
|
|
267
|
-
$updatedAt:
|
|
279
|
+
$createdAt: A(),
|
|
280
|
+
$updatedAt: A(),
|
|
268
281
|
userId: "preview-user",
|
|
269
282
|
expire: new Date(Date.now() + 365 * 864e5).toISOString(),
|
|
270
283
|
providerUid: "",
|
|
@@ -299,8 +312,8 @@ class mt {
|
|
|
299
312
|
},
|
|
300
313
|
{
|
|
301
314
|
...i,
|
|
302
|
-
$id:
|
|
303
|
-
$createdAt:
|
|
315
|
+
$id: T(),
|
|
316
|
+
$createdAt: I(300),
|
|
304
317
|
provider: t,
|
|
305
318
|
ip: "198.51.100.7",
|
|
306
319
|
osCode: "IOS",
|
|
@@ -316,8 +329,8 @@ class mt {
|
|
|
316
329
|
},
|
|
317
330
|
{
|
|
318
331
|
...i,
|
|
319
|
-
$id:
|
|
320
|
-
$createdAt:
|
|
332
|
+
$id: T(),
|
|
333
|
+
$createdAt: I(1440 * 3),
|
|
321
334
|
provider: "oauth2",
|
|
322
335
|
ip: "192.0.2.90",
|
|
323
336
|
osCode: "WIN",
|
|
@@ -332,8 +345,8 @@ class mt {
|
|
|
332
345
|
], this.identities = [
|
|
333
346
|
{
|
|
334
347
|
$id: "identity-github",
|
|
335
|
-
$createdAt:
|
|
336
|
-
$updatedAt:
|
|
348
|
+
$createdAt: I(1440 * 20),
|
|
349
|
+
$updatedAt: I(1440 * 20),
|
|
337
350
|
userId: "preview-user",
|
|
338
351
|
provider: "github",
|
|
339
352
|
providerUid: "8675309",
|
|
@@ -345,7 +358,7 @@ class mt {
|
|
|
345
358
|
], this.logs = [
|
|
346
359
|
{
|
|
347
360
|
event: "session.create",
|
|
348
|
-
time:
|
|
361
|
+
time: A(),
|
|
349
362
|
clientName: "Chrome",
|
|
350
363
|
osName: "macOS",
|
|
351
364
|
countryName: "Germany",
|
|
@@ -353,7 +366,7 @@ class mt {
|
|
|
353
366
|
},
|
|
354
367
|
{
|
|
355
368
|
event: "user.update.name",
|
|
356
|
-
time:
|
|
369
|
+
time: I(1440 * 2),
|
|
357
370
|
clientName: "Safari",
|
|
358
371
|
osName: "iOS",
|
|
359
372
|
countryName: "Germany",
|
|
@@ -361,7 +374,7 @@ class mt {
|
|
|
361
374
|
},
|
|
362
375
|
{
|
|
363
376
|
event: "session.create",
|
|
364
|
-
time:
|
|
377
|
+
time: I(1440 * 3),
|
|
365
378
|
clientName: "Firefox",
|
|
366
379
|
osName: "Windows",
|
|
367
380
|
countryName: "United States",
|
|
@@ -371,9 +384,9 @@ class mt {
|
|
|
371
384
|
}
|
|
372
385
|
requireUser() {
|
|
373
386
|
if (!this.user)
|
|
374
|
-
throw
|
|
387
|
+
throw H("general_unauthorized_scope", "User (role: guests) missing scope (account)");
|
|
375
388
|
if (this.mfaPending)
|
|
376
|
-
throw
|
|
389
|
+
throw H(
|
|
377
390
|
"user_more_factors_required",
|
|
378
391
|
"More factors are required to complete the sign in process."
|
|
379
392
|
);
|
|
@@ -381,7 +394,7 @@ class mt {
|
|
|
381
394
|
}
|
|
382
395
|
requireRecentChallenge() {
|
|
383
396
|
if (Date.now() - this.lastChallenge > 30 * 6e4)
|
|
384
|
-
throw
|
|
397
|
+
throw H(
|
|
385
398
|
"user_challenge_required",
|
|
386
399
|
"A recently successful challenge is required to complete this action."
|
|
387
400
|
);
|
|
@@ -417,26 +430,26 @@ class mt {
|
|
|
417
430
|
}
|
|
418
431
|
async createMagicURLToken(t, i) {
|
|
419
432
|
return this.tokens.set(t, { email: i }), this.delay({
|
|
420
|
-
$id:
|
|
421
|
-
$createdAt:
|
|
433
|
+
$id: T(),
|
|
434
|
+
$createdAt: A(),
|
|
422
435
|
userId: t,
|
|
423
436
|
secret: "",
|
|
424
437
|
expire: "",
|
|
425
|
-
phrase:
|
|
438
|
+
phrase: ct()
|
|
426
439
|
});
|
|
427
440
|
}
|
|
428
441
|
async createEmailToken(t, i) {
|
|
429
442
|
return this.tokens.set(t, { email: i }), this.delay({
|
|
430
|
-
$id:
|
|
431
|
-
$createdAt:
|
|
443
|
+
$id: T(),
|
|
444
|
+
$createdAt: A(),
|
|
432
445
|
userId: t,
|
|
433
446
|
secret: "",
|
|
434
447
|
expire: "",
|
|
435
|
-
phrase:
|
|
448
|
+
phrase: ct()
|
|
436
449
|
});
|
|
437
450
|
}
|
|
438
451
|
async createPhoneToken(t, i) {
|
|
439
|
-
return this.tokens.set(t, { phone: i }), this.delay({ $id:
|
|
452
|
+
return this.tokens.set(t, { phone: i }), this.delay({ $id: T(), $createdAt: A(), userId: t, secret: "", expire: "", phrase: "" });
|
|
440
453
|
}
|
|
441
454
|
async createSession(t) {
|
|
442
455
|
return this.delay(() => {
|
|
@@ -477,7 +490,7 @@ class mt {
|
|
|
477
490
|
async updateEmail(t) {
|
|
478
491
|
return this.delay(() => {
|
|
479
492
|
const i = this.requireUser();
|
|
480
|
-
return i.email = t, i.emailVerification = !1, i.passwordUpdate =
|
|
493
|
+
return i.email = t, i.emailVerification = !1, i.passwordUpdate = A(), i;
|
|
481
494
|
});
|
|
482
495
|
}
|
|
483
496
|
async updatePhone(t) {
|
|
@@ -489,7 +502,7 @@ class mt {
|
|
|
489
502
|
async updatePassword() {
|
|
490
503
|
return this.delay(() => {
|
|
491
504
|
const t = this.requireUser();
|
|
492
|
-
return t.passwordUpdate =
|
|
505
|
+
return t.passwordUpdate = A(), t;
|
|
493
506
|
});
|
|
494
507
|
}
|
|
495
508
|
async updateStatus() {
|
|
@@ -528,7 +541,7 @@ class mt {
|
|
|
528
541
|
});
|
|
529
542
|
}
|
|
530
543
|
async createMFAChallenge() {
|
|
531
|
-
return this.delay({ $id:
|
|
544
|
+
return this.delay({ $id: T(), $createdAt: A(), userId: "preview-user", expire: "" });
|
|
532
545
|
}
|
|
533
546
|
async updateMFAChallenge() {
|
|
534
547
|
return this.delay(() => (this.mfaPending = !1, this.lastChallenge = Date.now(), this.sessions[0]));
|
|
@@ -557,35 +570,35 @@ class mt {
|
|
|
557
570
|
async createMFARecoveryCodes() {
|
|
558
571
|
return this.delay(() => {
|
|
559
572
|
if (this.recoveryCodes.length > 0)
|
|
560
|
-
throw
|
|
561
|
-
return this.recoveryCodes = Array.from({ length: 6 },
|
|
573
|
+
throw H("user_recovery_codes_already_exists", "Recovery codes already generated.", 409);
|
|
574
|
+
return this.recoveryCodes = Array.from({ length: 6 }, lt), { recoveryCodes: this.recoveryCodes };
|
|
562
575
|
});
|
|
563
576
|
}
|
|
564
577
|
async getMFARecoveryCodes() {
|
|
565
578
|
return this.delay(() => (this.requireRecentChallenge(), { recoveryCodes: this.recoveryCodes }));
|
|
566
579
|
}
|
|
567
580
|
async updateMFARecoveryCodes() {
|
|
568
|
-
return this.delay(() => (this.requireRecentChallenge(), this.recoveryCodes = Array.from({ length: 6 },
|
|
581
|
+
return this.delay(() => (this.requireRecentChallenge(), this.recoveryCodes = Array.from({ length: 6 }, lt), { recoveryCodes: this.recoveryCodes }));
|
|
569
582
|
}
|
|
570
583
|
/** Forget everything, as a sign out would. */
|
|
571
584
|
reset() {
|
|
572
585
|
this.user = null, this.mfaPending = !1, this.sessions = [], this.identities = [], this.logs = [], this.tokens.clear();
|
|
573
586
|
}
|
|
574
587
|
}
|
|
575
|
-
function
|
|
588
|
+
function It(e) {
|
|
576
589
|
let t = 2166136261;
|
|
577
590
|
const i = () => (t ^= t << 13, t ^= t >>> 17, t ^= t << 5, (t >>> 0) / 4294967296);
|
|
578
591
|
for (const x of e) t = (t ^ x.charCodeAt(0)) * 16777619;
|
|
579
592
|
const s = 25;
|
|
580
593
|
let a = "";
|
|
581
|
-
const
|
|
594
|
+
const l = (x, C) => `<rect x="${x}" y="${C}" width="7" height="7"/><rect x="${x + 1}" y="${C + 1}" width="5" height="5" fill="#fff"/><rect x="${x + 2}" y="${C + 2}" width="3" height="3"/>`;
|
|
582
595
|
for (let x = 0; x < s; x++)
|
|
583
596
|
for (let C = 0; C < s; C++)
|
|
584
597
|
!(C < 8 && x < 8 || C >= s - 8 && x < 8 || C < 8 && x >= s - 8) && i() < 0.45 && (a += `<rect x="${C}" y="${x}" width="1" height="1"/>`);
|
|
585
|
-
const
|
|
586
|
-
return `data:image/svg+xml;utf8,${encodeURIComponent(
|
|
598
|
+
const u = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${s} ${s}" shape-rendering="crispEdges"><rect width="${s}" height="${s}" fill="#fff"/><g fill="#000">${l(0, 0)}${l(s - 7, 0)}${l(0, s - 7)}${a}</g></svg>`;
|
|
599
|
+
return `data:image/svg+xml;utf8,${encodeURIComponent(u)}`;
|
|
587
600
|
}
|
|
588
|
-
const
|
|
601
|
+
const f = {
|
|
589
602
|
moreFactorsRequired: "user_more_factors_required",
|
|
590
603
|
invalidCredentials: "user_invalid_credentials",
|
|
591
604
|
userAlreadyExists: "user_already_exists",
|
|
@@ -605,6 +618,8 @@ const v = {
|
|
|
605
618
|
recoveryCodesNotFound: "user_recovery_codes_not_found",
|
|
606
619
|
authenticatorNotFound: "user_authenticator_not_found",
|
|
607
620
|
routeNotFound: "general_route_not_found",
|
|
621
|
+
projectNotFound: "project_not_found",
|
|
622
|
+
unknownOrigin: "general_unknown_origin",
|
|
608
623
|
emailAlreadyVerified: "user_email_already_verified",
|
|
609
624
|
sessionNotFound: "user_session_not_found",
|
|
610
625
|
wafChallenged: "waf_request_challenged",
|
|
@@ -618,7 +633,7 @@ const v = {
|
|
|
618
633
|
targetAlreadyExists: "user_target_already_exists",
|
|
619
634
|
argumentInvalid: "general_argument_invalid"
|
|
620
635
|
};
|
|
621
|
-
function
|
|
636
|
+
function R(e) {
|
|
622
637
|
if (e && typeof e == "object") {
|
|
623
638
|
const t = e;
|
|
624
639
|
let i = typeof t.message == "string" ? t.message : "Unknown error";
|
|
@@ -630,51 +645,121 @@ function B(e) {
|
|
|
630
645
|
}
|
|
631
646
|
return { message: String(e), type: "", code: 0 };
|
|
632
647
|
}
|
|
633
|
-
function
|
|
634
|
-
return
|
|
648
|
+
function N(e, t) {
|
|
649
|
+
return R(e).type === t;
|
|
635
650
|
}
|
|
636
|
-
function
|
|
637
|
-
const s =
|
|
651
|
+
function K(e, t, i = "link") {
|
|
652
|
+
const s = R(e);
|
|
638
653
|
switch (s.type) {
|
|
639
|
-
case
|
|
654
|
+
case f.invalidCredentials:
|
|
640
655
|
return i === "password" ? t.errorCurrentPassword : t.errorInvalidCredentials;
|
|
641
|
-
case
|
|
642
|
-
case
|
|
643
|
-
case
|
|
656
|
+
case f.userAlreadyExists:
|
|
657
|
+
case f.emailAlreadyExists:
|
|
658
|
+
case f.phoneAlreadyExists:
|
|
644
659
|
return t.errorUserExists;
|
|
645
|
-
case
|
|
660
|
+
case f.userBlocked:
|
|
646
661
|
return t.errorUserBlocked;
|
|
647
|
-
case
|
|
662
|
+
case f.rateLimit:
|
|
648
663
|
return t.errorRateLimit;
|
|
649
|
-
case
|
|
664
|
+
case f.invalidToken:
|
|
650
665
|
return i === "code" ? t.errorInvalidCode : t.errorInvalidToken;
|
|
651
|
-
case
|
|
666
|
+
case f.invalidCode:
|
|
652
667
|
return t.errorInvalidCode;
|
|
653
|
-
case
|
|
668
|
+
case f.passwordMismatch:
|
|
654
669
|
return t.errorPasswordMismatch;
|
|
655
|
-
case
|
|
670
|
+
case f.passwordRecentlyUsed:
|
|
656
671
|
return t.errorPasswordRecentlyUsed;
|
|
657
|
-
case
|
|
672
|
+
case f.passwordPersonalData:
|
|
658
673
|
return t.errorPasswordPersonalData;
|
|
659
|
-
case
|
|
674
|
+
case f.passwordWeak:
|
|
660
675
|
return t.errorPasswordWeak;
|
|
661
|
-
case
|
|
676
|
+
case f.passwordPwned:
|
|
662
677
|
return t.errorPasswordPwned;
|
|
663
|
-
case
|
|
678
|
+
case f.challengeRequired:
|
|
664
679
|
return t.errorChallengeRequired;
|
|
665
|
-
case
|
|
680
|
+
case f.sessionAlreadyExists:
|
|
666
681
|
return t.errorSessionExists;
|
|
667
|
-
case
|
|
668
|
-
case
|
|
682
|
+
case f.oauthUnauthorized:
|
|
683
|
+
case f.oauthBadRequest:
|
|
669
684
|
return t.errorOAuth;
|
|
670
|
-
case
|
|
685
|
+
case f.authMethodUnsupported:
|
|
671
686
|
return t.errorMethodDisabled;
|
|
672
687
|
}
|
|
673
|
-
if (s.type ===
|
|
688
|
+
if (s.type === f.argumentInvalid || /Invalid `\w+` param/i.test(s.message)) {
|
|
674
689
|
const a = s.message.match(/Invalid `([^`]+)` param/i)?.[1]?.toLowerCase();
|
|
675
690
|
return a === "email" ? t.errorInvalidEmail : a === "password" ? t.errorInvalidPassword : a === "phone" ? t.errorInvalidPhone : a === "name" ? t.errorInvalidName : t.errorGeneric;
|
|
676
691
|
}
|
|
677
|
-
return s.code === 0 && /fetch|network/i.test(s.message) ? t.errorNetwork : /Invalid `\w+` param/i.test(s.message)
|
|
692
|
+
return s.type === f.projectNotFound || s.type === f.unknownOrigin ? t.errorConfig : s.type === f.routeNotFound ? t.errorConfigEndpoint : s.code === 0 && /fetch|network/i.test(s.message) ? t.errorNetwork : /Invalid `\w+` param/i.test(s.message) ? t.errorGeneric : s.message ? s.message || t.errorGeneric : s.code === 404 || s.type === f.routeNotFound ? t.errorConfigEndpoint : t.errorGeneric;
|
|
693
|
+
}
|
|
694
|
+
function Ut(e) {
|
|
695
|
+
const t = R(e);
|
|
696
|
+
return !!(t.type === f.projectNotFound || t.type === f.unknownOrigin || t.type === f.routeNotFound || !t.message && t.code === 404 || t.code === 0 && /fetch|network|load failed|failed to fetch/i.test(t.message));
|
|
697
|
+
}
|
|
698
|
+
const J = (e) => `authui:active-team:${e}`;
|
|
699
|
+
function dt(e) {
|
|
700
|
+
if (typeof localStorage > "u" || !e) return null;
|
|
701
|
+
try {
|
|
702
|
+
return localStorage.getItem(J(e));
|
|
703
|
+
} catch {
|
|
704
|
+
return null;
|
|
705
|
+
}
|
|
706
|
+
}
|
|
707
|
+
function Et(e, t) {
|
|
708
|
+
if (!(typeof localStorage > "u" || !e))
|
|
709
|
+
try {
|
|
710
|
+
t ? localStorage.setItem(J(e), t) : localStorage.removeItem(J(e));
|
|
711
|
+
} catch {
|
|
712
|
+
}
|
|
713
|
+
}
|
|
714
|
+
const rt = "authui:last-method";
|
|
715
|
+
function V(e) {
|
|
716
|
+
if (!(typeof localStorage > "u")) {
|
|
717
|
+
if (!e || e === "mfa" || e === "sign-up")
|
|
718
|
+
if (e === "sign-up") e = "email-password";
|
|
719
|
+
else return;
|
|
720
|
+
try {
|
|
721
|
+
localStorage.setItem(rt, e);
|
|
722
|
+
} catch {
|
|
723
|
+
}
|
|
724
|
+
}
|
|
725
|
+
}
|
|
726
|
+
function D() {
|
|
727
|
+
if (typeof localStorage > "u") return null;
|
|
728
|
+
try {
|
|
729
|
+
return localStorage.getItem(rt);
|
|
730
|
+
} catch {
|
|
731
|
+
return null;
|
|
732
|
+
}
|
|
733
|
+
}
|
|
734
|
+
function ne() {
|
|
735
|
+
if (!(typeof localStorage > "u"))
|
|
736
|
+
try {
|
|
737
|
+
localStorage.removeItem(rt);
|
|
738
|
+
} catch {
|
|
739
|
+
}
|
|
740
|
+
}
|
|
741
|
+
const G = "authui:pending-oauth";
|
|
742
|
+
function Mt(e) {
|
|
743
|
+
if (!(typeof sessionStorage > "u"))
|
|
744
|
+
try {
|
|
745
|
+
sessionStorage.setItem(G, e);
|
|
746
|
+
} catch {
|
|
747
|
+
}
|
|
748
|
+
}
|
|
749
|
+
function yt() {
|
|
750
|
+
if (!(typeof sessionStorage > "u"))
|
|
751
|
+
try {
|
|
752
|
+
const e = sessionStorage.getItem(G);
|
|
753
|
+
sessionStorage.removeItem(G), e && V(`oauth:${e}`);
|
|
754
|
+
} catch {
|
|
755
|
+
}
|
|
756
|
+
}
|
|
757
|
+
function ht() {
|
|
758
|
+
if (!(typeof sessionStorage > "u"))
|
|
759
|
+
try {
|
|
760
|
+
sessionStorage.removeItem(G);
|
|
761
|
+
} catch {
|
|
762
|
+
}
|
|
678
763
|
}
|
|
679
764
|
function S(e, t, i) {
|
|
680
765
|
for (const s of t) {
|
|
@@ -686,21 +771,41 @@ function S(e, t, i) {
|
|
|
686
771
|
new Error(`Appwrite SDK is missing ${t[0]}(). Update the appwrite package.`)
|
|
687
772
|
);
|
|
688
773
|
}
|
|
689
|
-
const
|
|
774
|
+
const tt = "authui", ut = ["userId", "secret", "expire", "project", "error", tt], pt = () => ({
|
|
690
775
|
status: "loading",
|
|
691
776
|
user: null,
|
|
692
777
|
mfaFactors: null,
|
|
693
778
|
pending: null,
|
|
694
|
-
configured: !1
|
|
779
|
+
configured: !1,
|
|
780
|
+
configError: null
|
|
695
781
|
});
|
|
696
|
-
class
|
|
782
|
+
class Ft {
|
|
697
783
|
constructor() {
|
|
698
|
-
this.client = null, this.account = null, this.config = null, this.state =
|
|
784
|
+
this.client = null, this.account = null, this.config = null, this.state = pt(), this.listeners = /* @__PURE__ */ new Map(), this.refreshPromise = null, this.preview = null, this.teams = null, this.activeTeamId = null;
|
|
699
785
|
}
|
|
700
786
|
// ───────────────────────────── configuration ─────────────────────────────
|
|
701
787
|
/** Configure the Appwrite client. Safe to call more than once; the last call wins. */
|
|
702
788
|
configure(t) {
|
|
703
|
-
|
|
789
|
+
const i = t.endpoint.trim().replace(/\/+$/, "");
|
|
790
|
+
i && !i.endsWith("/v1") && console.warn(
|
|
791
|
+
`[authui] endpoint should end with /v1 (got "${t.endpoint}"). Without it Appwrite returns HTML 404 pages.`
|
|
792
|
+
), this.config = t, this.client = new nt().setEndpoint(t.endpoint).setProject(t.project), this.preview = t.preview ? new Pt() : null, this.account = this.preview ? this.preview : new ot(this.client), this.teams = null, this.activeTeamId = dt(t.project), this.setState({ configured: !0, status: "loading", configError: null }), this.preview ? this.refresh() : typeof window < "u" && this.handleRedirect().then(() => this.refresh());
|
|
793
|
+
}
|
|
794
|
+
/**
|
|
795
|
+
* Called by <authui-config> when it is on the page but missing endpoint or project.
|
|
796
|
+
* Moves status off "loading" so the UI can show a developer-facing message.
|
|
797
|
+
*/
|
|
798
|
+
notifyConfigIncomplete() {
|
|
799
|
+
if (this.config) return;
|
|
800
|
+
const t = this.getStrings().errorConfigIncomplete;
|
|
801
|
+
console.warn(`[authui] ${t}`), this.setState({
|
|
802
|
+
status: "signed-out",
|
|
803
|
+
user: null,
|
|
804
|
+
mfaFactors: null,
|
|
805
|
+
configured: !1,
|
|
806
|
+
configError: t,
|
|
807
|
+
pending: { type: "notice", tone: "error", message: t }
|
|
808
|
+
});
|
|
704
809
|
}
|
|
705
810
|
get isConfigured() {
|
|
706
811
|
return this.config !== null;
|
|
@@ -727,8 +832,31 @@ class vt {
|
|
|
727
832
|
getAccount() {
|
|
728
833
|
return this.account;
|
|
729
834
|
}
|
|
835
|
+
/** List teams the signed-in user belongs to. Empty in preview or when signed out. */
|
|
836
|
+
async listTeams() {
|
|
837
|
+
if (this.preview || !this.client || this.state.status !== "signed-in") return [];
|
|
838
|
+
this.teams ??= new $t(this.client);
|
|
839
|
+
try {
|
|
840
|
+
return (await this.teams.list()).teams ?? [];
|
|
841
|
+
} catch (t) {
|
|
842
|
+
this.fail(t);
|
|
843
|
+
}
|
|
844
|
+
}
|
|
845
|
+
getActiveTeamId() {
|
|
846
|
+
if (this.activeTeamId) return this.activeTeamId;
|
|
847
|
+
const t = this.config?.project;
|
|
848
|
+
return t ? (this.activeTeamId = dt(t), this.activeTeamId) : null;
|
|
849
|
+
}
|
|
850
|
+
/**
|
|
851
|
+
* Remember the active team locally and emit `active-team`.
|
|
852
|
+
* Does not call Appwrite; membership is already required to appear in listTeams().
|
|
853
|
+
*/
|
|
854
|
+
setActiveTeam(t) {
|
|
855
|
+
const i = this.config?.project;
|
|
856
|
+
i && Et(i, t?.$id ?? null), this.activeTeamId = t?.$id ?? null, this.emit("active-team", { teamId: this.activeTeamId, team: t });
|
|
857
|
+
}
|
|
730
858
|
getStrings() {
|
|
731
|
-
return { ...
|
|
859
|
+
return { ...kt, ...this.config?.strings ?? {} };
|
|
732
860
|
}
|
|
733
861
|
getState() {
|
|
734
862
|
return { ...this.state };
|
|
@@ -754,7 +882,7 @@ class vt {
|
|
|
754
882
|
this.state = { ...this.state, ...t }, this.emit("change", this.getState());
|
|
755
883
|
}
|
|
756
884
|
fail(t) {
|
|
757
|
-
const i =
|
|
885
|
+
const i = R(t);
|
|
758
886
|
throw this.emit("error", i), t;
|
|
759
887
|
}
|
|
760
888
|
acct() {
|
|
@@ -772,9 +900,9 @@ class vt {
|
|
|
772
900
|
const t = this.state.status === "signed-in";
|
|
773
901
|
try {
|
|
774
902
|
const i = await this.account.get();
|
|
775
|
-
this.setState({ status: "signed-in", user: i, mfaFactors: null }), t || this.emit("signed-in", i);
|
|
903
|
+
this.setState({ status: "signed-in", user: i, mfaFactors: null, configError: null }), t || this.emit("signed-in", i);
|
|
776
904
|
} catch (i) {
|
|
777
|
-
if (
|
|
905
|
+
if (N(i, f.moreFactorsRequired)) {
|
|
778
906
|
let s = null;
|
|
779
907
|
try {
|
|
780
908
|
s = await S(
|
|
@@ -785,16 +913,32 @@ class vt {
|
|
|
785
913
|
} catch {
|
|
786
914
|
}
|
|
787
915
|
this.setState({ status: "mfa-required", user: null, mfaFactors: s });
|
|
788
|
-
} else
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
916
|
+
} else if (N(i, f.userBlocked))
|
|
917
|
+
await this.purgeLocalSession(), this.setState({
|
|
918
|
+
status: "signed-out",
|
|
919
|
+
user: null,
|
|
920
|
+
mfaFactors: null,
|
|
921
|
+
pending: {
|
|
922
|
+
type: "notice",
|
|
923
|
+
tone: "error",
|
|
924
|
+
message: this.getStrings().errorUserBlocked
|
|
925
|
+
}
|
|
926
|
+
}), t && this.emit("signed-out", void 0);
|
|
927
|
+
else if (!t && Ut(i)) {
|
|
928
|
+
const a = K(i, this.getStrings()) || this.getStrings().errorConfig;
|
|
929
|
+
console.warn(
|
|
930
|
+
`[authui] ${a} (endpoint=${this.config?.endpoint ?? "?"}, project=${this.config?.project ?? "?"})`
|
|
931
|
+
);
|
|
932
|
+
const l = R(i);
|
|
933
|
+
this.emit("error", { message: a, type: l.type, code: l.code }), this.setState({
|
|
934
|
+
status: "signed-out",
|
|
935
|
+
user: null,
|
|
936
|
+
mfaFactors: null,
|
|
937
|
+
configError: a,
|
|
938
|
+
pending: { type: "notice", tone: "error", message: a }
|
|
939
|
+
});
|
|
940
|
+
} else
|
|
941
|
+
this.setState({ status: "signed-out", user: null, mfaFactors: null, configError: null }), t && this.emit("signed-out", void 0);
|
|
798
942
|
}
|
|
799
943
|
})().finally(() => {
|
|
800
944
|
this.refreshPromise = null;
|
|
@@ -805,7 +949,7 @@ class vt {
|
|
|
805
949
|
const i = this.state.pending;
|
|
806
950
|
if (i?.type === "notice" && i.tone === "error")
|
|
807
951
|
throw Object.assign(new Error(i.message), {
|
|
808
|
-
type:
|
|
952
|
+
type: f.userBlocked,
|
|
809
953
|
code: 401
|
|
810
954
|
});
|
|
811
955
|
}
|
|
@@ -830,7 +974,7 @@ class vt {
|
|
|
830
974
|
localStorage.removeItem("cookieFallback");
|
|
831
975
|
} catch {
|
|
832
976
|
}
|
|
833
|
-
this.config && !this.preview && (this.client = new
|
|
977
|
+
this.config && !this.preview && (this.client = new nt().setEndpoint(this.config.endpoint).setProject(this.config.project), this.account = new ot(this.client));
|
|
834
978
|
}
|
|
835
979
|
// ─────────────────────────────── sign in ───────────────────────────────
|
|
836
980
|
async signInWithEmailPassword(t, i) {
|
|
@@ -843,7 +987,7 @@ class vt {
|
|
|
843
987
|
}
|
|
844
988
|
async signUp(t, i, s) {
|
|
845
989
|
try {
|
|
846
|
-
await this.acct().create(
|
|
990
|
+
await this.acct().create(j.unique(), t.trim(), i, s?.trim() || void 0), await this.acct().createEmailPasswordSession(t.trim(), i);
|
|
847
991
|
} catch (a) {
|
|
848
992
|
this.fail(a);
|
|
849
993
|
}
|
|
@@ -886,7 +1030,7 @@ class vt {
|
|
|
886
1030
|
async sendMagicUrl(t) {
|
|
887
1031
|
try {
|
|
888
1032
|
return await this.acct().createMagicURLToken(
|
|
889
|
-
|
|
1033
|
+
j.unique(),
|
|
890
1034
|
t.trim(),
|
|
891
1035
|
this.redirectUrl("magic-url"),
|
|
892
1036
|
this.config?.securityPhrase ?? !0
|
|
@@ -898,7 +1042,7 @@ class vt {
|
|
|
898
1042
|
async sendEmailOtp(t) {
|
|
899
1043
|
try {
|
|
900
1044
|
return await this.acct().createEmailToken(
|
|
901
|
-
|
|
1045
|
+
j.unique(),
|
|
902
1046
|
t.trim(),
|
|
903
1047
|
this.config?.securityPhrase ?? !0
|
|
904
1048
|
);
|
|
@@ -908,7 +1052,7 @@ class vt {
|
|
|
908
1052
|
}
|
|
909
1053
|
async sendPhoneOtp(t) {
|
|
910
1054
|
try {
|
|
911
|
-
return await this.acct().createPhoneToken(
|
|
1055
|
+
return await this.acct().createPhoneToken(j.unique(), t.replace(/[\s()-]/g, ""));
|
|
912
1056
|
} catch (i) {
|
|
913
1057
|
return this.fail(i);
|
|
914
1058
|
}
|
|
@@ -1182,8 +1326,8 @@ class vt {
|
|
|
1182
1326
|
/** Build the URL Appwrite should send the user back to for a given flow. */
|
|
1183
1327
|
redirectUrl(t) {
|
|
1184
1328
|
const i = this.config?.redirectUrl ?? (typeof window < "u" ? window.location.origin + window.location.pathname : ""), s = new URL(i, typeof window < "u" ? window.location.href : void 0);
|
|
1185
|
-
for (const a of
|
|
1186
|
-
return s.searchParams.set(
|
|
1329
|
+
for (const a of ut) s.searchParams.delete(a);
|
|
1330
|
+
return s.searchParams.set(tt, t), s.toString();
|
|
1187
1331
|
}
|
|
1188
1332
|
setPending(t) {
|
|
1189
1333
|
this.setState({ pending: t });
|
|
@@ -1194,11 +1338,11 @@ class vt {
|
|
|
1194
1338
|
*/
|
|
1195
1339
|
async handleRedirect() {
|
|
1196
1340
|
if (typeof window > "u") return !1;
|
|
1197
|
-
const t = new URLSearchParams(window.location.search), i = t.get(
|
|
1341
|
+
const t = new URLSearchParams(window.location.search), i = t.get(tt);
|
|
1198
1342
|
if (!i) return !1;
|
|
1199
1343
|
const s = t.get("userId") ?? "", a = t.get("secret") ?? "";
|
|
1200
1344
|
this.cleanUrl();
|
|
1201
|
-
const
|
|
1345
|
+
const l = () => {
|
|
1202
1346
|
this.setState({
|
|
1203
1347
|
pending: {
|
|
1204
1348
|
type: "notice",
|
|
@@ -1211,13 +1355,19 @@ class vt {
|
|
|
1211
1355
|
switch (i) {
|
|
1212
1356
|
case "oauth":
|
|
1213
1357
|
case "magic-url":
|
|
1214
|
-
s && a ? await this.acct().createSession(s, a) :
|
|
1358
|
+
s && a ? (await this.acct().createSession(s, a), i === "oauth" && yt()) : (i === "oauth" && ht(), l());
|
|
1215
1359
|
break;
|
|
1216
1360
|
case "oauth-failed":
|
|
1217
|
-
this.setState({
|
|
1361
|
+
ht(), this.setState({
|
|
1362
|
+
pending: {
|
|
1363
|
+
type: "notice",
|
|
1364
|
+
tone: "error",
|
|
1365
|
+
message: this.getStrings().errorOAuth
|
|
1366
|
+
}
|
|
1367
|
+
});
|
|
1218
1368
|
break;
|
|
1219
1369
|
case "recovery":
|
|
1220
|
-
s && a ? this.setState({ pending: { type: "reset-password", userId: s, secret: a } }) :
|
|
1370
|
+
s && a ? this.setState({ pending: { type: "reset-password", userId: s, secret: a } }) : l();
|
|
1221
1371
|
break;
|
|
1222
1372
|
case "verify-email":
|
|
1223
1373
|
s && a ? (await S(
|
|
@@ -1230,27 +1380,27 @@ class vt {
|
|
|
1230
1380
|
message: this.getStrings().emailVerified,
|
|
1231
1381
|
tone: "success"
|
|
1232
1382
|
}
|
|
1233
|
-
})) :
|
|
1383
|
+
})) : l();
|
|
1234
1384
|
break;
|
|
1235
1385
|
}
|
|
1236
|
-
} catch (
|
|
1237
|
-
const x =
|
|
1386
|
+
} catch (u) {
|
|
1387
|
+
const x = R(u), C = K(u, this.getStrings(), "link");
|
|
1238
1388
|
this.emit("error", x), this.setState({ pending: { type: "notice", message: C, tone: "error" } });
|
|
1239
1389
|
}
|
|
1240
1390
|
return !0;
|
|
1241
1391
|
}
|
|
1242
1392
|
cleanUrl() {
|
|
1243
1393
|
const t = new URL(window.location.href);
|
|
1244
|
-
for (const i of
|
|
1394
|
+
for (const i of ut) t.searchParams.delete(i);
|
|
1245
1395
|
window.history.replaceState(window.history.state, "", t.toString());
|
|
1246
1396
|
}
|
|
1247
1397
|
/** Test helper. */
|
|
1248
1398
|
reset() {
|
|
1249
|
-
this.client = null, this.account = null, this.preview = null, this.config = null, this.state =
|
|
1399
|
+
this.client = null, this.account = null, this.teams = null, this.activeTeamId = null, this.preview = null, this.config = null, this.state = pt(), this.listeners.clear();
|
|
1250
1400
|
}
|
|
1251
1401
|
}
|
|
1252
|
-
const n = new
|
|
1253
|
-
class
|
|
1402
|
+
const n = new Ft();
|
|
1403
|
+
class Ot {
|
|
1254
1404
|
constructor() {
|
|
1255
1405
|
this.listeners = /* @__PURE__ */ new Set(), this.observer = null, this.media = null, this.notify = () => {
|
|
1256
1406
|
const t = this.isDark("auto");
|
|
@@ -1278,14 +1428,14 @@ class bt {
|
|
|
1278
1428
|
this.observer?.disconnect(), this.observer = null, this.media?.removeEventListener?.("change", this.notify), this.media = null;
|
|
1279
1429
|
}
|
|
1280
1430
|
}
|
|
1281
|
-
const
|
|
1431
|
+
const mt = new Ot(), ft = {
|
|
1282
1432
|
none: "0px",
|
|
1283
1433
|
sm: "0.25rem",
|
|
1284
1434
|
md: "0.625rem",
|
|
1285
1435
|
lg: "0.875rem",
|
|
1286
1436
|
xl: "1.125rem",
|
|
1287
1437
|
full: "1.5rem"
|
|
1288
|
-
},
|
|
1438
|
+
}, _t = F`
|
|
1289
1439
|
:host {
|
|
1290
1440
|
/* Light theme (matches :root in the console) */
|
|
1291
1441
|
--authui-background: oklch(1 0 0);
|
|
@@ -1363,7 +1513,7 @@ const nt = new bt(), ot = {
|
|
|
1363
1513
|
--authui-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.5);
|
|
1364
1514
|
color-scheme: dark;
|
|
1365
1515
|
}
|
|
1366
|
-
`,
|
|
1516
|
+
`, Tt = F`
|
|
1367
1517
|
*,
|
|
1368
1518
|
*::before,
|
|
1369
1519
|
*::after {
|
|
@@ -1628,6 +1778,57 @@ const nt = new bt(), ot = {
|
|
|
1628
1778
|
color: var(--authui-muted-foreground);
|
|
1629
1779
|
margin: 0;
|
|
1630
1780
|
}
|
|
1781
|
+
.strength {
|
|
1782
|
+
display: grid;
|
|
1783
|
+
gap: 6px;
|
|
1784
|
+
margin-top: 6px;
|
|
1785
|
+
}
|
|
1786
|
+
.strength-meter {
|
|
1787
|
+
display: grid;
|
|
1788
|
+
grid-template-columns: repeat(4, 1fr);
|
|
1789
|
+
gap: 4px;
|
|
1790
|
+
height: 4px;
|
|
1791
|
+
}
|
|
1792
|
+
.strength-meter span {
|
|
1793
|
+
border-radius: 999px;
|
|
1794
|
+
background: var(--authui-muted);
|
|
1795
|
+
transition: background-color 120ms ease;
|
|
1796
|
+
}
|
|
1797
|
+
.strength-meter[data-level="1"] span:nth-child(-n + 1) {
|
|
1798
|
+
background: var(--authui-destructive);
|
|
1799
|
+
}
|
|
1800
|
+
.strength-meter[data-level="2"] span:nth-child(-n + 2) {
|
|
1801
|
+
background: var(--authui-warning-foreground);
|
|
1802
|
+
}
|
|
1803
|
+
.strength-meter[data-level="3"] span:nth-child(-n + 3) {
|
|
1804
|
+
background: var(--authui-warning-foreground);
|
|
1805
|
+
}
|
|
1806
|
+
.strength-meter[data-level="4"] span {
|
|
1807
|
+
background: var(--authui-success);
|
|
1808
|
+
}
|
|
1809
|
+
.strength-label {
|
|
1810
|
+
font-size: 12px;
|
|
1811
|
+
color: var(--authui-muted-foreground);
|
|
1812
|
+
margin: 0;
|
|
1813
|
+
}
|
|
1814
|
+
|
|
1815
|
+
.btn.last-used {
|
|
1816
|
+
border-color: var(--authui-brand);
|
|
1817
|
+
box-shadow: 0 0 0 1px color-mix(in oklab, var(--authui-brand) 35%, transparent);
|
|
1818
|
+
}
|
|
1819
|
+
.last-used-badge {
|
|
1820
|
+
display: inline-flex;
|
|
1821
|
+
align-items: center;
|
|
1822
|
+
margin-inline-start: auto;
|
|
1823
|
+
padding: 1px 6px;
|
|
1824
|
+
border-radius: 999px;
|
|
1825
|
+
font-size: 10px;
|
|
1826
|
+
font-weight: 600;
|
|
1827
|
+
letter-spacing: 0.02em;
|
|
1828
|
+
text-transform: uppercase;
|
|
1829
|
+
color: var(--authui-brand);
|
|
1830
|
+
background: color-mix(in oklab, var(--authui-brand) 12%, transparent);
|
|
1831
|
+
}
|
|
1631
1832
|
.form {
|
|
1632
1833
|
display: flex;
|
|
1633
1834
|
flex-direction: column;
|
|
@@ -2117,25 +2318,25 @@ const nt = new bt(), ot = {
|
|
|
2117
2318
|
}
|
|
2118
2319
|
}
|
|
2119
2320
|
`;
|
|
2120
|
-
var
|
|
2121
|
-
for (var a = void 0,
|
|
2122
|
-
(
|
|
2123
|
-
return a &&
|
|
2124
|
-
},
|
|
2125
|
-
const
|
|
2321
|
+
var Dt = Object.defineProperty, Rt = (e, t, i, s) => {
|
|
2322
|
+
for (var a = void 0, l = e.length - 1, u; l >= 0; l--)
|
|
2323
|
+
(u = e[l]) && (a = u(t, i, a) || a);
|
|
2324
|
+
return a && Dt(t, i, a), a;
|
|
2325
|
+
}, U;
|
|
2326
|
+
const wt = (U = class extends st {
|
|
2126
2327
|
constructor() {
|
|
2127
2328
|
super(...arguments), this.auth = n.getState(), this.unsubscribeStore = null, this.unsubscribeTheme = null, this.stopKeys = (t) => t.stopPropagation();
|
|
2128
2329
|
}
|
|
2129
2330
|
connectedCallback() {
|
|
2130
2331
|
super.connectedCallback();
|
|
2131
|
-
for (const t of
|
|
2332
|
+
for (const t of U.KEY_EVENTS) this.addEventListener(t, this.stopKeys);
|
|
2132
2333
|
this.auth = n.getState(), this.unsubscribeStore = n.on("change", (t) => {
|
|
2133
2334
|
this.auth = t, this.applyBranding();
|
|
2134
|
-
}), this.unsubscribeTheme =
|
|
2335
|
+
}), this.unsubscribeTheme = mt.subscribe(() => this.applyBranding()), this.applyBranding();
|
|
2135
2336
|
}
|
|
2136
2337
|
disconnectedCallback() {
|
|
2137
2338
|
super.disconnectedCallback();
|
|
2138
|
-
for (const t of
|
|
2339
|
+
for (const t of U.KEY_EVENTS) this.removeEventListener(t, this.stopKeys);
|
|
2139
2340
|
this.unsubscribeStore?.(), this.unsubscribeTheme?.(), this.unsubscribeStore = null, this.unsubscribeTheme = null;
|
|
2140
2341
|
}
|
|
2141
2342
|
get strings() {
|
|
@@ -2143,7 +2344,7 @@ const lt = (E = class extends X {
|
|
|
2143
2344
|
}
|
|
2144
2345
|
/** Translate a string key with optional `{placeholders}`. */
|
|
2145
2346
|
t(t, i) {
|
|
2146
|
-
return
|
|
2347
|
+
return Ct(this.strings[t], i);
|
|
2147
2348
|
}
|
|
2148
2349
|
get config() {
|
|
2149
2350
|
return n.getConfig();
|
|
@@ -2153,27 +2354,27 @@ const lt = (E = class extends X {
|
|
|
2153
2354
|
}
|
|
2154
2355
|
/** Push theme and branding from config onto the host element. */
|
|
2155
2356
|
applyBranding() {
|
|
2156
|
-
const t = this.config?.branding, i =
|
|
2357
|
+
const t = this.config?.branding, i = mt.isDark(t?.theme ?? "auto");
|
|
2157
2358
|
this.setAttribute("data-theme", i ? "dark" : "light"), t?.primary && (this.style.setProperty("--authui-primary", t.primary), this.style.setProperty(
|
|
2158
2359
|
"--authui-primary-foreground",
|
|
2159
2360
|
t.primaryForeground ?? "#ffffff"
|
|
2160
|
-
)), t?.radius &&
|
|
2361
|
+
)), t?.radius && ft[t.radius] && this.style.setProperty("--authui-radius", ft[t.radius]);
|
|
2161
2362
|
}
|
|
2162
2363
|
/** Emit a composed custom event from this element. */
|
|
2163
2364
|
fire(t, i) {
|
|
2164
2365
|
this.dispatchEvent(new CustomEvent(t, { detail: i, bubbles: !0, composed: !0 }));
|
|
2165
2366
|
}
|
|
2166
|
-
},
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
],
|
|
2170
|
-
let
|
|
2171
|
-
var
|
|
2172
|
-
for (var a = s > 1 ? void 0 : s ?
|
|
2173
|
-
(
|
|
2174
|
-
return s && a &&
|
|
2367
|
+
}, U.styles = [_t, Tt], U.KEY_EVENTS = ["keydown", "keyup", "keypress"], U);
|
|
2368
|
+
Rt([
|
|
2369
|
+
h()
|
|
2370
|
+
], wt.prototype, "auth");
|
|
2371
|
+
let P = wt;
|
|
2372
|
+
var zt = Object.defineProperty, Lt = Object.getOwnPropertyDescriptor, y = (e, t, i, s) => {
|
|
2373
|
+
for (var a = s > 1 ? void 0 : s ? Lt(t, i) : t, l = e.length - 1, u; l >= 0; l--)
|
|
2374
|
+
(u = e[l]) && (a = (s ? u(t, i, a) : u(a)) || a);
|
|
2375
|
+
return s && a && zt(t, i, a), a;
|
|
2175
2376
|
};
|
|
2176
|
-
let b = class extends
|
|
2377
|
+
let b = class extends st {
|
|
2177
2378
|
constructor() {
|
|
2178
2379
|
super(...arguments), this.endpoint = "", this.project = "", this.redirectUrl = "", this.successUrl = "", this.methods = "email-password", this.signUp = "true", this.requireName = "true", this.mfa = "true", this.securityPhrase = "true", this.name = "", this.logo = "", this.theme = "auto", this.radius = "", this.primary = "", this.primaryForeground = "", this.termsUrl = "", this.privacyUrl = "", this.preview = "";
|
|
2179
2380
|
}
|
|
@@ -2184,7 +2385,12 @@ let b = class extends X {
|
|
|
2184
2385
|
this.configure();
|
|
2185
2386
|
}
|
|
2186
2387
|
configure() {
|
|
2187
|
-
if (!this.endpoint || !this.project)
|
|
2388
|
+
if (!this.endpoint || !this.project) {
|
|
2389
|
+
queueMicrotask(() => {
|
|
2390
|
+
(!this.endpoint || !this.project) && n.notifyConfigIncomplete();
|
|
2391
|
+
});
|
|
2392
|
+
return;
|
|
2393
|
+
}
|
|
2188
2394
|
const e = this.toConfig(), t = n.getConfig();
|
|
2189
2395
|
t && JSON.stringify(t) === JSON.stringify(e) || n.configure(e);
|
|
2190
2396
|
}
|
|
@@ -2218,82 +2424,98 @@ let b = class extends X {
|
|
|
2218
2424
|
};
|
|
2219
2425
|
}
|
|
2220
2426
|
};
|
|
2221
|
-
b.styles =
|
|
2427
|
+
b.styles = F`
|
|
2222
2428
|
:host {
|
|
2223
2429
|
display: none;
|
|
2224
2430
|
}
|
|
2225
2431
|
`;
|
|
2226
2432
|
y([
|
|
2227
|
-
|
|
2433
|
+
g({ type: String })
|
|
2228
2434
|
], b.prototype, "endpoint", 2);
|
|
2229
2435
|
y([
|
|
2230
|
-
|
|
2436
|
+
g({ type: String })
|
|
2231
2437
|
], b.prototype, "project", 2);
|
|
2232
2438
|
y([
|
|
2233
|
-
|
|
2439
|
+
g({ type: String, attribute: "redirect-url" })
|
|
2234
2440
|
], b.prototype, "redirectUrl", 2);
|
|
2235
2441
|
y([
|
|
2236
|
-
|
|
2442
|
+
g({ type: String, attribute: "success-url" })
|
|
2237
2443
|
], b.prototype, "successUrl", 2);
|
|
2238
2444
|
y([
|
|
2239
|
-
|
|
2445
|
+
g({ type: String })
|
|
2240
2446
|
], b.prototype, "methods", 2);
|
|
2241
2447
|
y([
|
|
2242
|
-
|
|
2448
|
+
g({ type: String, attribute: "sign-up" })
|
|
2243
2449
|
], b.prototype, "signUp", 2);
|
|
2244
2450
|
y([
|
|
2245
|
-
|
|
2451
|
+
g({ type: String, attribute: "require-name" })
|
|
2246
2452
|
], b.prototype, "requireName", 2);
|
|
2247
2453
|
y([
|
|
2248
|
-
|
|
2454
|
+
g({ type: String })
|
|
2249
2455
|
], b.prototype, "mfa", 2);
|
|
2250
2456
|
y([
|
|
2251
|
-
|
|
2457
|
+
g({ type: String, attribute: "security-phrase" })
|
|
2252
2458
|
], b.prototype, "securityPhrase", 2);
|
|
2253
2459
|
y([
|
|
2254
|
-
|
|
2460
|
+
g({ type: String })
|
|
2255
2461
|
], b.prototype, "name", 2);
|
|
2256
2462
|
y([
|
|
2257
|
-
|
|
2463
|
+
g({ type: String })
|
|
2258
2464
|
], b.prototype, "logo", 2);
|
|
2259
2465
|
y([
|
|
2260
|
-
|
|
2466
|
+
g({ type: String })
|
|
2261
2467
|
], b.prototype, "theme", 2);
|
|
2262
2468
|
y([
|
|
2263
|
-
|
|
2469
|
+
g({ type: String })
|
|
2264
2470
|
], b.prototype, "radius", 2);
|
|
2265
2471
|
y([
|
|
2266
|
-
|
|
2472
|
+
g({ type: String })
|
|
2267
2473
|
], b.prototype, "primary", 2);
|
|
2268
2474
|
y([
|
|
2269
|
-
|
|
2475
|
+
g({ type: String, attribute: "primary-foreground" })
|
|
2270
2476
|
], b.prototype, "primaryForeground", 2);
|
|
2271
2477
|
y([
|
|
2272
|
-
|
|
2478
|
+
g({ type: String, attribute: "terms-url" })
|
|
2273
2479
|
], b.prototype, "termsUrl", 2);
|
|
2274
2480
|
y([
|
|
2275
|
-
|
|
2481
|
+
g({ type: String, attribute: "privacy-url" })
|
|
2276
2482
|
], b.prototype, "privacyUrl", 2);
|
|
2277
2483
|
y([
|
|
2278
|
-
|
|
2484
|
+
g({ type: String })
|
|
2279
2485
|
], b.prototype, "preview", 2);
|
|
2280
2486
|
b = y([
|
|
2281
2487
|
O("authui-config")
|
|
2282
2488
|
], b);
|
|
2283
|
-
var
|
|
2284
|
-
for (var a = s > 1 ? void 0 : s ?
|
|
2285
|
-
(
|
|
2286
|
-
return s && a &&
|
|
2489
|
+
var Vt = Object.defineProperty, qt = Object.getOwnPropertyDescriptor, Z = (e, t, i, s) => {
|
|
2490
|
+
for (var a = s > 1 ? void 0 : s ? qt(t, i) : t, l = e.length - 1, u; l >= 0; l--)
|
|
2491
|
+
(u = e[l]) && (a = (s ? u(t, i, a) : u(a)) || a);
|
|
2492
|
+
return s && a && Vt(t, i, a), a;
|
|
2287
2493
|
};
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2494
|
+
const gt = "authui-show:not([ready]){display:none}", oe = "authui-show:not([ready]){display:none}authui-button:not(:defined),authui-user-button:not(:defined){visibility:hidden}";
|
|
2495
|
+
let vt = !1;
|
|
2496
|
+
function Nt() {
|
|
2497
|
+
if (!(typeof document > "u" || vt)) {
|
|
2498
|
+
vt = !0;
|
|
2499
|
+
try {
|
|
2500
|
+
if (typeof CSSStyleSheet < "u" && "adoptedStyleSheets" in Document.prototype) {
|
|
2501
|
+
const e = new CSSStyleSheet();
|
|
2502
|
+
e.replaceSync(gt), document.adoptedStyleSheets = [...document.adoptedStyleSheets, e];
|
|
2503
|
+
return;
|
|
2504
|
+
}
|
|
2505
|
+
} catch {
|
|
2506
|
+
}
|
|
2507
|
+
if (!document.getElementById("authui-fouc")) {
|
|
2508
|
+
const e = document.createElement("style");
|
|
2509
|
+
e.id = "authui-fouc", e.textContent = gt, document.head.appendChild(e);
|
|
2510
|
+
}
|
|
2511
|
+
}
|
|
2291
2512
|
}
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2513
|
+
Nt();
|
|
2514
|
+
const Bt = ["loading", "signed-out", "signed-in", "mfa-required"];
|
|
2515
|
+
function Q(e) {
|
|
2516
|
+
return e ? e.split(/[\s,]+/).map((t) => t.trim()).filter((t) => Bt.includes(t)) : [];
|
|
2295
2517
|
}
|
|
2296
|
-
let
|
|
2518
|
+
let B = class extends st {
|
|
2297
2519
|
constructor() {
|
|
2298
2520
|
super(...arguments), this.when = "", this.unless = "", this.status = n.getState().status, this.unsubscribe = null;
|
|
2299
2521
|
}
|
|
@@ -2305,29 +2527,29 @@ let V = class extends X {
|
|
|
2305
2527
|
}
|
|
2306
2528
|
/** Whether the current status satisfies `when` and `unless`. */
|
|
2307
2529
|
get visible() {
|
|
2308
|
-
const e =
|
|
2530
|
+
const e = Q(this.when), t = Q(this.unless);
|
|
2309
2531
|
return !(this.status === "loading" && !e.includes("loading") || e.length > 0 && !e.includes(this.status) || t.includes(this.status));
|
|
2310
2532
|
}
|
|
2311
2533
|
updated() {
|
|
2312
|
-
(this.status !== "loading" ||
|
|
2534
|
+
(this.status !== "loading" || Q(this.when).includes("loading")) && (this.setAttribute("ready", ""), this.style.display = "contents");
|
|
2313
2535
|
}
|
|
2314
2536
|
render() {
|
|
2315
|
-
return this.visible ? r`<slot></slot>` :
|
|
2537
|
+
return this.visible ? r`<slot></slot>` : o;
|
|
2316
2538
|
}
|
|
2317
2539
|
};
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
],
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
],
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
],
|
|
2327
|
-
|
|
2540
|
+
Z([
|
|
2541
|
+
g({ type: String })
|
|
2542
|
+
], B.prototype, "when", 2);
|
|
2543
|
+
Z([
|
|
2544
|
+
g({ type: String })
|
|
2545
|
+
], B.prototype, "unless", 2);
|
|
2546
|
+
Z([
|
|
2547
|
+
h()
|
|
2548
|
+
], B.prototype, "status", 2);
|
|
2549
|
+
B = Z([
|
|
2328
2550
|
O("authui-show")
|
|
2329
|
-
],
|
|
2330
|
-
const
|
|
2551
|
+
], B);
|
|
2552
|
+
const jt = F`
|
|
2331
2553
|
:host {
|
|
2332
2554
|
display: block;
|
|
2333
2555
|
width: 100%;
|
|
@@ -2381,7 +2603,7 @@ const Ut = I`
|
|
|
2381
2603
|
height: 14px;
|
|
2382
2604
|
margin: 0;
|
|
2383
2605
|
}
|
|
2384
|
-
`,
|
|
2606
|
+
`, v = (e) => r`<svg
|
|
2385
2607
|
xmlns="http://www.w3.org/2000/svg"
|
|
2386
2608
|
viewBox="0 0 24 24"
|
|
2387
2609
|
fill="none"
|
|
@@ -2392,179 +2614,198 @@ const Ut = I`
|
|
|
2392
2614
|
aria-hidden="true"
|
|
2393
2615
|
>
|
|
2394
2616
|
${e}
|
|
2395
|
-
</svg>`,
|
|
2396
|
-
mail:
|
|
2397
|
-
|
|
2617
|
+
</svg>`, c = {
|
|
2618
|
+
mail: v(
|
|
2619
|
+
d`<rect width="20" height="16" x="2" y="4" rx="2"/><path d="m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7"/>`
|
|
2398
2620
|
),
|
|
2399
|
-
phone:
|
|
2400
|
-
|
|
2621
|
+
phone: v(
|
|
2622
|
+
d`<path d="M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z"/>`
|
|
2401
2623
|
),
|
|
2402
|
-
user:
|
|
2403
|
-
|
|
2624
|
+
user: v(
|
|
2625
|
+
d`<path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"/><circle cx="12" cy="7" r="4"/>`
|
|
2404
2626
|
),
|
|
2405
|
-
userX:
|
|
2406
|
-
|
|
2627
|
+
userX: v(
|
|
2628
|
+
d`<path d="M2 21a8 8 0 0 1 11.873-7"/><circle cx="10" cy="8" r="5"/><path d="m17 17 5 5"/><path d="m22 17-5 5"/>`
|
|
2407
2629
|
),
|
|
2408
|
-
lock:
|
|
2409
|
-
|
|
2630
|
+
lock: v(
|
|
2631
|
+
d`<rect width="18" height="11" x="3" y="11" rx="2" ry="2"/><path d="M7 11V7a5 5 0 0 1 10 0v4"/>`
|
|
2410
2632
|
),
|
|
2411
|
-
key:
|
|
2412
|
-
|
|
2633
|
+
key: v(
|
|
2634
|
+
d`<path d="m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4"/><path d="m21 2-9.6 9.6"/><circle cx="7.5" cy="15.5" r="5.5"/>`
|
|
2413
2635
|
),
|
|
2414
|
-
shield:
|
|
2415
|
-
|
|
2636
|
+
shield: v(
|
|
2637
|
+
d`<path d="M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z"/>`
|
|
2416
2638
|
),
|
|
2417
|
-
shieldCheck:
|
|
2418
|
-
|
|
2639
|
+
shieldCheck: v(
|
|
2640
|
+
d`<path d="M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z"/><path d="m9 12 2 2 4-4"/>`
|
|
2419
2641
|
),
|
|
2420
|
-
smartphone:
|
|
2421
|
-
|
|
2642
|
+
smartphone: v(
|
|
2643
|
+
d`<rect width="14" height="20" x="5" y="2" rx="2" ry="2"/><path d="M12 18h.01"/>`
|
|
2422
2644
|
),
|
|
2423
|
-
monitor:
|
|
2424
|
-
|
|
2645
|
+
monitor: v(
|
|
2646
|
+
d`<rect width="20" height="14" x="2" y="3" rx="2"/><line x1="8" x2="16" y1="21" y2="21"/><line x1="12" x2="12" y1="17" y2="21"/>`
|
|
2425
2647
|
),
|
|
2426
|
-
globe:
|
|
2427
|
-
|
|
2648
|
+
globe: v(
|
|
2649
|
+
d`<circle cx="12" cy="12" r="10"/><path d="M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20"/><path d="M2 12h20"/>`
|
|
2428
2650
|
),
|
|
2429
|
-
logOut:
|
|
2430
|
-
|
|
2651
|
+
logOut: v(
|
|
2652
|
+
d`<path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"/><polyline points="16 17 21 12 16 7"/><line x1="21" x2="9" y1="12" y2="12"/>`
|
|
2431
2653
|
),
|
|
2432
|
-
settings:
|
|
2433
|
-
|
|
2654
|
+
settings: v(
|
|
2655
|
+
d`<path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"/><circle cx="12" cy="12" r="3"/>`
|
|
2434
2656
|
),
|
|
2435
|
-
x:
|
|
2436
|
-
check:
|
|
2437
|
-
|
|
2438
|
-
|
|
2657
|
+
x: v(d`<path d="M18 6 6 18"/><path d="m6 6 12 12"/>`),
|
|
2658
|
+
check: v(d`<path d="M20 6 9 17l-5-5"/>`),
|
|
2659
|
+
users: v(
|
|
2660
|
+
d`<path d="M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"/><circle cx="9" cy="7" r="4"/><path d="M22 21v-2a4 4 0 0 0-3-3.87"/><path d="M16 3.13a4 4 0 0 1 0 7.75"/>`
|
|
2439
2661
|
),
|
|
2440
|
-
|
|
2441
|
-
|
|
2662
|
+
copy: v(
|
|
2663
|
+
d`<rect width="14" height="14" x="8" y="8" rx="2" ry="2"/><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"/>`
|
|
2442
2664
|
),
|
|
2443
|
-
|
|
2444
|
-
|
|
2665
|
+
eye: v(
|
|
2666
|
+
d`<path d="M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"/><circle cx="12" cy="12" r="3"/>`
|
|
2445
2667
|
),
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
l`<circle cx="12" cy="12" r="10"/><line x1="12" x2="12" y1="8" y2="12"/><line x1="12" x2="12.01" y1="16" y2="16"/>`
|
|
2668
|
+
eyeOff: v(
|
|
2669
|
+
d`<path d="M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49"/><path d="M14.084 14.158a3 3 0 0 1-4.242-4.242"/><path d="M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143"/><path d="m2 2 20 20"/>`
|
|
2449
2670
|
),
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
l`<path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/>`
|
|
2671
|
+
arrowLeft: v(d`<path d="m12 19-7-7 7-7"/><path d="M19 12H5"/>`),
|
|
2672
|
+
alert: v(
|
|
2673
|
+
d`<circle cx="12" cy="12" r="10"/><line x1="12" x2="12" y1="8" y2="12"/><line x1="12" x2="12.01" y1="16" y2="16"/>`
|
|
2454
2674
|
),
|
|
2455
|
-
|
|
2456
|
-
|
|
2675
|
+
info: v(d`<circle cx="12" cy="12" r="10"/><path d="M12 16v-4"/><path d="M12 8h.01"/>`),
|
|
2676
|
+
checkCircle: v(d`<circle cx="12" cy="12" r="10"/><path d="m9 12 2 2 4-4"/>`),
|
|
2677
|
+
link: v(
|
|
2678
|
+
d`<path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/>`
|
|
2457
2679
|
),
|
|
2458
|
-
|
|
2459
|
-
|
|
2680
|
+
activity: v(
|
|
2681
|
+
d`<path d="M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2"/>`
|
|
2460
2682
|
),
|
|
2461
|
-
|
|
2462
|
-
|
|
2683
|
+
trash: v(
|
|
2684
|
+
d`<path d="M3 6h18"/><path d="M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"/><path d="M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"/>`
|
|
2463
2685
|
),
|
|
2464
|
-
|
|
2465
|
-
|
|
2686
|
+
sparkles: v(
|
|
2687
|
+
d`<path d="M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z"/>`
|
|
2466
2688
|
),
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
l`<path d="M9 10h.01"/><path d="M15 10h.01"/><path d="M12 2a8 8 0 0 0-8 8v12l3-3 2.5 2.5L12 19l2.5 2.5L17 19l3 3V10a8 8 0 0 0-8-8z"/>`
|
|
2689
|
+
refresh: v(
|
|
2690
|
+
d`<path d="M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8"/><path d="M21 3v5h-5"/><path d="M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16"/><path d="M8 16H3v5"/>`
|
|
2470
2691
|
),
|
|
2471
|
-
|
|
2472
|
-
|
|
2692
|
+
chevronDown: v(d`<path d="m6 9 6 6 6-6"/>`),
|
|
2693
|
+
ghost: v(
|
|
2694
|
+
d`<path d="M9 10h.01"/><path d="M15 10h.01"/><path d="M12 2a8 8 0 0 0-8 8v12l3-3 2.5 2.5L12 19l2.5 2.5L17 19l3 3V10a8 8 0 0 0-8-8z"/>`
|
|
2695
|
+
),
|
|
2696
|
+
qr: v(
|
|
2697
|
+
d`<rect width="5" height="5" x="3" y="3" rx="1"/><rect width="5" height="5" x="16" y="3" rx="1"/><rect width="5" height="5" x="3" y="16" rx="1"/><path d="M21 16h-3a2 2 0 0 0-2 2v3"/><path d="M21 21v.01"/><path d="M12 7v3a2 2 0 0 1-2 2H7"/><path d="M3 12h.01"/><path d="M12 3h.01"/><path d="M12 16v.01"/><path d="M16 12h1"/><path d="M21 12v.01"/><path d="M12 21v-1"/>`
|
|
2473
2698
|
)
|
|
2474
|
-
}, w = (e, t = "0 0 24 24") => r`<svg xmlns="http://www.w3.org/2000/svg" viewBox=${t} aria-hidden="true">${e}</svg>`,
|
|
2699
|
+
}, w = (e, t = "0 0 24 24") => r`<svg xmlns="http://www.w3.org/2000/svg" viewBox=${t} aria-hidden="true">${e}</svg>`, Ht = {
|
|
2475
2700
|
google: w(
|
|
2476
|
-
|
|
2701
|
+
d`<path fill="#4285F4" d="M23.49 12.27c0-.79-.07-1.54-.19-2.27H12v4.51h6.47a5.57 5.57 0 0 1-2.4 3.58v3h3.86c2.26-2.09 3.56-5.17 3.56-8.82z"/><path fill="#34A853" d="M12 24c3.24 0 5.95-1.08 7.93-2.91l-3.86-3c-1.08.72-2.45 1.16-4.07 1.16-3.13 0-5.78-2.11-6.73-4.96H1.29v3.09A11.99 11.99 0 0 0 12 24z"/><path fill="#FBBC05" d="M5.27 14.29A7.2 7.2 0 0 1 4.89 12c0-.8.14-1.57.38-2.29V6.62H1.29A11.97 11.97 0 0 0 0 12c0 1.94.46 3.77 1.29 5.38l3.98-3.09z"/><path fill="#EA4335" d="M12 4.75c1.77 0 3.35.61 4.6 1.8l3.42-3.42C17.95 1.19 15.24 0 12 0 7.31 0 3.26 2.69 1.29 6.62l3.98 3.09C6.22 6.86 8.87 4.75 12 4.75z"/>`
|
|
2477
2702
|
),
|
|
2478
2703
|
github: w(
|
|
2479
|
-
|
|
2704
|
+
d`<path fill="currentColor" d="M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0 0 24 12c0-6.63-5.37-12-12-12z"/>`
|
|
2480
2705
|
),
|
|
2481
2706
|
apple: w(
|
|
2482
|
-
|
|
2707
|
+
d`<path fill="currentColor" d="M17.05 20.28c-.98.95-2.05.8-3.08.35-1.09-.46-2.09-.48-3.24 0-1.44.62-2.2.44-3.06-.35C2.79 15.25 3.51 7.59 9.05 7.31c1.35.07 2.29.74 3.08.8 1.18-.24 2.31-.93 3.57-.84 1.51.12 2.65.72 3.4 1.8-3.12 1.87-2.38 5.98.48 7.13-.57 1.5-1.31 2.99-2.54 4.09zM12.03 7.25c-.15-2.23 1.66-4.07 3.74-4.25.29 2.58-2.34 4.5-3.74 4.25z"/>`
|
|
2483
2708
|
),
|
|
2484
2709
|
facebook: w(
|
|
2485
|
-
|
|
2710
|
+
d`<path fill="#1877F2" d="M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z"/>`
|
|
2486
2711
|
),
|
|
2487
2712
|
x: w(
|
|
2488
|
-
|
|
2713
|
+
d`<path fill="currentColor" d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"/>`
|
|
2489
2714
|
),
|
|
2490
2715
|
microsoft: w(
|
|
2491
|
-
|
|
2716
|
+
d`<path fill="#F25022" d="M1 1h10v10H1z"/><path fill="#7FBA00" d="M13 1h10v10H13z"/><path fill="#00A4EF" d="M1 13h10v10H1z"/><path fill="#FFB900" d="M13 13h10v10H13z"/>`
|
|
2492
2717
|
),
|
|
2493
2718
|
discord: w(
|
|
2494
|
-
|
|
2719
|
+
d`<path fill="#5865F2" d="M20.317 4.37a19.791 19.791 0 0 0-4.885-1.515.074.074 0 0 0-.079.037c-.21.375-.444.864-.608 1.25a18.27 18.27 0 0 0-5.487 0 12.64 12.64 0 0 0-.617-1.25.077.077 0 0 0-.079-.037A19.736 19.736 0 0 0 3.677 4.37a.07.07 0 0 0-.032.027C.533 9.046-.32 13.58.099 18.057a.082.082 0 0 0 .031.057 19.9 19.9 0 0 0 5.993 3.03.078.078 0 0 0 .084-.028c.462-.63.874-1.295 1.226-1.994a.076.076 0 0 0-.041-.106 13.107 13.107 0 0 1-1.872-.892.077.077 0 0 1-.008-.128 10.2 10.2 0 0 0 .372-.292.074.074 0 0 1 .077-.01c3.928 1.793 8.18 1.793 12.062 0a.074.074 0 0 1 .078.01c.12.098.246.198.373.292a.077.077 0 0 1-.006.127 12.299 12.299 0 0 1-1.873.892.077.077 0 0 0-.041.107c.36.698.772 1.362 1.225 1.993a.076.076 0 0 0 .084.028 19.839 19.839 0 0 0 6.002-3.03.077.077 0 0 0 .032-.054c.5-5.177-.838-9.674-3.549-13.66a.061.061 0 0 0-.031-.03zM8.02 15.33c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.956-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.956 2.418-2.157 2.418zm7.975 0c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.955-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.946 2.418-2.157 2.418z"/>`
|
|
2495
2720
|
),
|
|
2496
2721
|
gitlab: w(
|
|
2497
|
-
|
|
2722
|
+
d`<path fill="#FC6D26" d="m23.6 9.593-.033-.086L20.3.98a.851.851 0 0 0-.336-.405.876.876 0 0 0-1.001.054.874.874 0 0 0-.29.44l-2.205 6.748H7.535L5.33 1.069a.857.857 0 0 0-.29-.441.876.876 0 0 0-1.001-.054.86.86 0 0 0-.336.405L.436 9.502l-.032.086a6.066 6.066 0 0 0 2.012 7.01l.011.009.03.021 4.976 3.727 2.462 1.863 1.5 1.132a1.009 1.009 0 0 0 1.22 0l1.5-1.132 2.461-1.863 5.006-3.75.013-.01a6.068 6.068 0 0 0 2.006-7.002z"/>`
|
|
2498
2723
|
),
|
|
2499
2724
|
linkedin: w(
|
|
2500
|
-
|
|
2725
|
+
d`<path fill="#0A66C2" d="M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433a2.062 2.062 0 0 1-2.063-2.065 2.064 2.064 0 1 1 2.063 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z"/>`
|
|
2501
2726
|
),
|
|
2502
2727
|
slack: w(
|
|
2503
|
-
|
|
2728
|
+
d`<path fill="#E01E5A" d="M5.042 15.165a2.528 2.528 0 0 1-2.52 2.523A2.528 2.528 0 0 1 0 15.165a2.527 2.527 0 0 1 2.522-2.52h2.52v2.52zm1.271 0a2.527 2.527 0 0 1 2.521-2.52 2.527 2.527 0 0 1 2.521 2.52v6.313A2.528 2.528 0 0 1 8.834 24a2.528 2.528 0 0 1-2.521-2.522v-6.313z"/><path fill="#36C5F0" d="M8.834 5.042a2.528 2.528 0 0 1-2.521-2.52A2.528 2.528 0 0 1 8.834 0a2.528 2.528 0 0 1 2.521 2.522v2.52H8.834zm0 1.271a2.528 2.528 0 0 1 2.521 2.521 2.528 2.528 0 0 1-2.521 2.521H2.522A2.528 2.528 0 0 1 0 8.834a2.528 2.528 0 0 1 2.522-2.521h6.312z"/><path fill="#2EB67D" d="M18.956 8.834a2.528 2.528 0 0 1 2.522-2.521A2.528 2.528 0 0 1 24 8.834a2.528 2.528 0 0 1-2.522 2.521h-2.522V8.834zm-1.27 0a2.528 2.528 0 0 1-2.523 2.521 2.527 2.527 0 0 1-2.52-2.521V2.522A2.527 2.527 0 0 1 15.163 0a2.528 2.528 0 0 1 2.523 2.522v6.312z"/><path fill="#ECB22E" d="M15.163 18.956a2.528 2.528 0 0 1 2.523 2.522A2.528 2.528 0 0 1 15.163 24a2.527 2.527 0 0 1-2.52-2.522v-2.522h2.52zm0-1.27a2.527 2.527 0 0 1-2.52-2.523 2.526 2.526 0 0 1 2.52-2.52h6.315A2.527 2.527 0 0 1 24 15.163a2.528 2.528 0 0 1-2.522 2.523h-6.315z"/>`
|
|
2504
2729
|
),
|
|
2505
2730
|
twitch: w(
|
|
2506
|
-
|
|
2731
|
+
d`<path fill="#9146FF" d="M11.571 4.714h1.715v5.143H11.57zm4.715 0H18v5.143h-1.714zM6 0 1.714 4.286v15.428h5.143V24l4.286-4.286h3.428L22.286 12V0zm14.571 11.143-3.428 3.428h-3.429l-3 3v-3H6.857V1.714h13.714Z"/>`
|
|
2507
2732
|
),
|
|
2508
2733
|
spotify: w(
|
|
2509
|
-
|
|
2734
|
+
d`<path fill="#1DB954" d="M12 0C5.4 0 0 5.4 0 12s5.4 12 12 12 12-5.4 12-12S18.66 0 12 0zm5.521 17.34c-.24.359-.66.48-1.021.24-2.82-1.74-6.36-2.101-10.561-1.141-.418.122-.779-.179-.899-.539-.12-.421.18-.78.54-.9 4.56-1.021 8.52-.6 11.64 1.32.42.18.479.659.301 1.02zm1.44-3.3c-.301.42-.841.6-1.262.3-3.239-1.98-8.159-2.58-11.939-1.38-.479.12-1.02-.12-1.14-.6-.12-.48.12-1.021.6-1.141C9.6 9.9 15 10.561 18.72 12.84c.361.181.54.78.241 1.2zm.12-3.36C15.24 8.4 8.82 8.16 5.16 9.301c-.6.179-1.2-.181-1.38-.721-.18-.601.18-1.2.72-1.381 4.26-1.26 11.28-1.02 15.721 1.621.539.3.719 1.02.419 1.56-.299.421-1.02.599-1.559.3z"/>`
|
|
2510
2735
|
),
|
|
2511
2736
|
notion: w(
|
|
2512
|
-
|
|
2737
|
+
d`<path fill="currentColor" d="M4.459 4.208c.746.606 1.026.56 2.428.466l13.215-.793c.28 0 .047-.28-.046-.326L17.86 1.968c-.42-.326-.981-.7-2.055-.607L3.01 2.295c-.466.046-.56.28-.374.466zm.793 3.08v13.904c0 .747.373 1.027 1.214.98l14.523-.84c.841-.046.935-.56.935-1.167V6.354c0-.606-.233-.933-.748-.887l-15.177.887c-.56.047-.747.327-.747.933zm14.337.745c.093.42 0 .84-.42.888l-.7.14v10.264c-.608.327-1.168.514-1.635.514-.748 0-.935-.234-1.495-.933l-4.577-7.186v6.952L12.21 19s0 .84-1.168.84l-3.222.186c-.093-.186 0-.653.327-.746l.84-.233V9.854L7.822 9.76c-.094-.42.14-1.026.793-1.073l3.456-.233 4.764 7.279v-6.44l-1.215-.139c-.093-.514.28-.887.747-.933zM1.936 1.035l13.31-.98c1.634-.14 2.055-.047 3.082.7l4.249 2.986c.7.513.934.653.934 1.213v16.378c0 1.026-.373 1.634-1.68 1.726l-15.458.934c-.98.047-1.448-.093-1.962-.747l-3.129-4.06c-.56-.747-.793-1.306-.793-1.96V2.667c0-.839.374-1.54 1.447-1.632z"/>`
|
|
2513
2738
|
),
|
|
2514
2739
|
dropbox: w(
|
|
2515
|
-
|
|
2740
|
+
d`<path fill="#0061FF" d="M6 1.807 0 5.629l6 3.822 6.001-3.822L6 1.807zm12 0-6 3.822 6 3.822 6-3.822-6-3.822zM0 13.274l6 3.822 6.001-3.822L6 9.452l-6 3.822zm18-3.822-6 3.822 6 3.822 6-3.822-6-3.822zM6 18.371l6.001 3.822 6-3.822-6-3.822L6 18.371z"/>`
|
|
2516
2741
|
),
|
|
2517
2742
|
figma: w(
|
|
2518
|
-
|
|
2743
|
+
d`<path fill="#F24E1E" d="M8 24a4 4 0 0 0 4-4v-4H8a4 4 0 0 0 0 8z"/><path fill="#A259FF" d="M4 12a4 4 0 0 1 4-4h4v8H8a4 4 0 0 1-4-4z"/><path fill="#FF7262" d="M4 4a4 4 0 0 1 4-4h4v8H8a4 4 0 0 1-4-4z"/><path fill="#1ABCFE" d="M12 0h4a4 4 0 0 1 0 8h-4V0z"/><path fill="#0ACF83" d="M20 12a4 4 0 1 1-8 0 4 4 0 0 1 8 0z"/>`
|
|
2519
2744
|
),
|
|
2520
2745
|
bitbucket: w(
|
|
2521
|
-
|
|
2746
|
+
d`<path fill="#2684FF" d="M.778 1.213a.768.768 0 0 0-.768.892l3.263 19.81c.084.5.515.868 1.022.873H19.95a.772.772 0 0 0 .77-.646l3.27-20.03a.768.768 0 0 0-.768-.891zM14.52 15.53H9.522L8.17 8.466h7.561z"/>`
|
|
2522
2747
|
),
|
|
2523
2748
|
amazon: w(
|
|
2524
|
-
|
|
2749
|
+
d`<path fill="currentColor" d="M.045 18.02c.072-.116.187-.124.348-.022 3.636 2.11 7.594 3.166 11.87 3.166 2.852 0 5.668-.533 8.447-1.595l.315-.14c.138-.06.234-.1.293-.13.226-.088.39-.046.525.13.12.174.09.336-.12.48-.256.19-.6.41-1.006.654-1.244.743-2.64 1.316-4.185 1.726a17.617 17.617 0 0 1-10.951-.577 17.88 17.88 0 0 1-5.43-3.35c-.1-.074-.151-.15-.151-.22 0-.047.021-.09.051-.13zm6.565-6.218c0-1.005.247-1.863.743-2.577.495-.71 1.17-1.25 2.04-1.615.796-.335 1.756-.575 2.912-.72.39-.046 1.033-.103 1.92-.174v-.37c0-.93-.105-1.558-.3-1.875-.302-.43-.78-.65-1.44-.65h-.182c-.48.046-.896.196-1.246.46-.35.27-.575.63-.675 1.096-.06.3-.206.465-.435.51l-2.52-.315c-.248-.06-.372-.18-.372-.39 0-.046.007-.09.022-.15.247-1.29.855-2.25 1.82-2.88.976-.616 2.1-.975 3.39-1.05h.54c1.65 0 2.957.434 3.888 1.29.135.15.27.3.405.48.12.165.224.314.283.45.075.134.15.33.195.57.06.254.105.42.135.51.03.104.062.3.076.615.01.313.02.493.02.553v5.28c0 .376.06.72.165 1.036.105.313.21.54.315.674l.51.674c.09.136.136.256.136.36 0 .12-.06.226-.18.314-1.2 1.05-1.86 1.62-1.963 1.71-.165.135-.373.15-.61.045a6.62 6.62 0 0 1-.526-.496l-.31-.347a9.858 9.858 0 0 1-.317-.42l-.3-.435c-.81.886-1.603 1.44-2.4 1.665-.494.15-1.093.227-1.83.227-1.11 0-2.04-.343-2.76-1.034-.72-.69-1.08-1.665-1.08-2.94l-.05-.076zm3.753-.438c0 .566.14 1.02.425 1.364.285.34.675.512 1.155.512.045 0 .106-.007.195-.02.09-.016.134-.023.166-.023.614-.16 1.08-.553 1.424-1.178.165-.28.285-.58.36-.91.09-.32.12-.59.135-.8.015-.195.015-.54.015-1.005v-.54c-.84 0-1.484.06-1.92.18-1.275.36-1.92 1.17-1.92 2.43l-.035-.01zm9.162 7.027c.03-.06.075-.11.132-.17.362-.243.714-.41 1.05-.5a8.094 8.094 0 0 1 1.612-.24c.14-.012.28 0 .41.03.65.06 1.05.168 1.172.33.063.09.099.228.099.39v.15c0 .51-.149 1.11-.424 1.8-.278.69-.664 1.248-1.156 1.68-.073.06-.14.09-.197.09-.03 0-.06 0-.09-.012-.09-.044-.107-.12-.064-.24.54-1.26.806-2.143.806-2.64 0-.15-.03-.27-.087-.344-.145-.166-.55-.257-1.224-.257-.243 0-.533.016-.87.045-.363.045-.7.09-1 .135-.09 0-.148-.014-.18-.044-.03-.03-.036-.06-.02-.106 0-.014.007-.03.02-.06z"/>`
|
|
2525
2750
|
),
|
|
2526
2751
|
paypal: w(
|
|
2527
|
-
|
|
2752
|
+
d`<path fill="#003087" d="M7.076 21.337H2.47a.641.641 0 0 1-.633-.74L4.944.901C5.026.382 5.474 0 5.998 0h7.46c2.57 0 4.578.543 5.69 1.81 1.01 1.15 1.304 2.42 1.012 4.287-.023.143-.047.288-.077.437-.983 5.05-4.349 6.797-8.647 6.797h-2.19c-.524 0-.968.382-1.05.9l-1.12 7.106zm14.146-14.42a3.35 3.35 0 0 0-.607-.541c-.013.076-.026.175-.041.254-.93 4.778-4.005 7.201-9.138 7.201h-2.19a.563.563 0 0 0-.556.479l-1.187 7.527h-.506l-.24 1.516a.56.56 0 0 0 .554.647h3.882c.46 0 .85-.334.922-.788.06-.26.76-4.852.816-5.09a.932.932 0 0 1 .923-.788h.58c3.76 0 6.705-1.528 7.565-5.946.36-1.847.174-3.388-.777-4.471z"/>`
|
|
2528
2753
|
)
|
|
2529
2754
|
};
|
|
2530
|
-
function
|
|
2531
|
-
return
|
|
2755
|
+
function et(e) {
|
|
2756
|
+
return Ht[e] ?? c.globe;
|
|
2532
2757
|
}
|
|
2533
|
-
function
|
|
2758
|
+
function at(e) {
|
|
2534
2759
|
const t = (e.trim()[0] ?? "?").toUpperCase();
|
|
2535
|
-
return /[A-Z0-9]/i.test(t) ? t :
|
|
2760
|
+
return /[A-Z0-9]/i.test(t) ? t : c.user;
|
|
2536
2761
|
}
|
|
2537
|
-
function
|
|
2762
|
+
function Y(e) {
|
|
2538
2763
|
typeof document > "u" || (document.querySelector("authui-modal") || document.body.appendChild(document.createElement("authui-modal")), queueMicrotask(() => {
|
|
2539
2764
|
window.dispatchEvent(new CustomEvent("authui:open", { detail: { view: e } }));
|
|
2540
2765
|
}));
|
|
2541
2766
|
}
|
|
2542
|
-
function
|
|
2767
|
+
function ce() {
|
|
2543
2768
|
typeof window > "u" || window.dispatchEvent(new CustomEvent("authui:close"));
|
|
2544
2769
|
}
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2770
|
+
function it(e) {
|
|
2771
|
+
const t = {
|
|
2772
|
+
length: e.length >= 8,
|
|
2773
|
+
long: e.length >= 12,
|
|
2774
|
+
lower: /[a-z]/.test(e),
|
|
2775
|
+
upper: /[A-Z]/.test(e),
|
|
2776
|
+
number: /\d/.test(e),
|
|
2777
|
+
symbol: /[^A-Za-z0-9]/.test(e)
|
|
2778
|
+
};
|
|
2779
|
+
if (!e)
|
|
2780
|
+
return { level: 0, percent: 0, labelKey: "passwordStrengthTooWeak", checks: t };
|
|
2781
|
+
let i = 0;
|
|
2782
|
+
t.length && (i += 1), t.long && (i += 1), t.lower && t.upper && (i += 1), t.number && (i += 1), t.symbol && (i += 1), e.length < 8 ? i = Math.min(i, 1) : e.length < 10 && (i = Math.min(i, 3));
|
|
2783
|
+
let s, a;
|
|
2784
|
+
return !t.length || i <= 1 ? (s = 1, a = "passwordStrengthTooWeak") : i === 2 ? (s = 2, a = "passwordStrengthWeak") : i === 3 ? (s = 3, a = "passwordStrengthFair") : i >= 5 && t.long && t.lower && t.upper && t.number && t.symbol ? (s = 4, a = "passwordStrengthVeryStrong") : (s = 4, a = "passwordStrengthStrong"), { level: s, percent: s * 25, labelKey: a, checks: t };
|
|
2785
|
+
}
|
|
2786
|
+
var Wt = Object.defineProperty, Kt = Object.getOwnPropertyDescriptor, k = (e, t, i, s) => {
|
|
2787
|
+
for (var a = s > 1 ? void 0 : s ? Kt(t, i) : t, l = e.length - 1, u; l >= 0; l--)
|
|
2788
|
+
(u = e[l]) && (a = (s ? u(t, i, a) : u(a)) || a);
|
|
2789
|
+
return s && a && Wt(t, i, a), a;
|
|
2549
2790
|
};
|
|
2550
|
-
let $ = class extends
|
|
2791
|
+
let $ = class extends P {
|
|
2551
2792
|
constructor() {
|
|
2552
2793
|
super(...arguments), this.view = "sign-in", this.embedded = !1, this.step = "sign-in", this.busy = !1, this.error = "", this.notice = null, this.showPassword = !1, this.token = null, this.focusOnStep = !1, this.resendCooldownUntil = 0, this.challenge = null, this.recovery = null, this.email = "", this.password = "", this.passwordConfirm = "", this.name = "", this.phone = "", this.code = "", this.onSignIn = (e) => {
|
|
2553
2794
|
e.preventDefault(), this.requireValid(e) && this.run(async () => {
|
|
2554
|
-
await n.signInWithEmailPassword(this.email, this.password), this.password = "", this.fire("authui-success", { method: "email-password" });
|
|
2795
|
+
await n.signInWithEmailPassword(this.email, this.password), this.password = "", V("email-password"), this.fire("authui-success", { method: "email-password" });
|
|
2555
2796
|
});
|
|
2556
2797
|
}, this.onSignUp = (e) => {
|
|
2557
2798
|
e.preventDefault(), this.requireValid(e) && this.run(async () => {
|
|
2558
|
-
await n.signUp(this.email, this.password, this.name), this.password = "", this.fire("authui-success", { method: "sign-up" });
|
|
2799
|
+
await n.signUp(this.email, this.password, this.name), this.password = "", V("email-password"), this.fire("authui-success", { method: "sign-up" });
|
|
2559
2800
|
});
|
|
2560
2801
|
}, this.onGuest = () => {
|
|
2561
2802
|
this.run(async () => {
|
|
2562
|
-
await n.signInAnonymously(), this.fire("authui-success", { method: "anonymous" });
|
|
2803
|
+
await n.signInAnonymously(), V("anonymous"), this.fire("authui-success", { method: "anonymous" });
|
|
2563
2804
|
});
|
|
2564
2805
|
}, this.onOAuth = (e) => {
|
|
2565
2806
|
this.run(async () => {
|
|
2566
|
-
if (await n.signInWithOAuth(e), n.isPreview) {
|
|
2567
|
-
this.fire("authui-success", { method: "oauth" });
|
|
2807
|
+
if (Mt(e), await n.signInWithOAuth(e), n.isPreview) {
|
|
2808
|
+
yt(), this.fire("authui-success", { method: "oauth" });
|
|
2568
2809
|
return;
|
|
2569
2810
|
}
|
|
2570
2811
|
await new Promise((t) => setTimeout(t, 4e3));
|
|
@@ -2581,7 +2822,7 @@ let $ = class extends A {
|
|
|
2581
2822
|
}
|
|
2582
2823
|
const t = this.recovery;
|
|
2583
2824
|
t && this.run(async () => {
|
|
2584
|
-
await n.completePasswordRecovery(t.userId, t.secret, this.password), this.password = "", this.passwordConfirm = "", this.recovery = null, this.auth.pending?.type === "reset-password" && n.setPending(null), this.notice = { tone: "success", message: this.t("passwordUpdated") }
|
|
2825
|
+
await n.completePasswordRecovery(t.userId, t.secret, this.password), this.password = "", this.passwordConfirm = "", this.recovery = null, this.auth.pending?.type === "reset-password" && n.setPending(null), this.go("sign-in"), this.notice = { tone: "success", message: this.t("passwordUpdated") };
|
|
2585
2826
|
});
|
|
2586
2827
|
}, this.onMagicUrl = (e) => {
|
|
2587
2828
|
e.preventDefault(), this.requireValid(e) && this.run(async () => {
|
|
@@ -2612,7 +2853,7 @@ let $ = class extends A {
|
|
|
2612
2853
|
if (e.preventDefault(), !this.requireValid(e)) return;
|
|
2613
2854
|
const t = this.token;
|
|
2614
2855
|
t && this.run(async () => {
|
|
2615
|
-
await n.signInWithToken(t.userId, this.code), this.code = "", this.token = null, this.fire("authui-success", { method: t.kind });
|
|
2856
|
+
await n.signInWithToken(t.userId, this.code), this.code = "", this.token = null, V(t.kind), this.fire("authui-success", { method: t.kind });
|
|
2616
2857
|
}, "code");
|
|
2617
2858
|
}, this.onChooseFactor = (e) => {
|
|
2618
2859
|
this.run(async () => {
|
|
@@ -2630,7 +2871,7 @@ let $ = class extends A {
|
|
|
2630
2871
|
try {
|
|
2631
2872
|
await n.signOut();
|
|
2632
2873
|
} catch (e) {
|
|
2633
|
-
if (!
|
|
2874
|
+
if (!N(e, f.sessionNotFound)) throw e;
|
|
2634
2875
|
}
|
|
2635
2876
|
this.go("sign-in");
|
|
2636
2877
|
});
|
|
@@ -2652,7 +2893,7 @@ let $ = class extends A {
|
|
|
2652
2893
|
const { status: e, pending: t } = this.auth;
|
|
2653
2894
|
e === "mfa-required" && this.step !== "mfa" && this.go("mfa");
|
|
2654
2895
|
const i = this.step === "reset-password" || t?.type === "reset-password" || this.recovery !== null;
|
|
2655
|
-
(e === "signed-in" || e === "signed-out") && !i && (this.step === "mfa" || this.step === "phone" || this.step === "email-otp" || this.step === "magic-url" || this.step === "forgot-password" || this.token !== null || this.challenge !== null || e === "signed-out") && (this.token = null, this.challenge = null, this.code = "", this.password = "", this.notice = null, this.go(this.view === "sign-up" ? "sign-up" : "sign-in")), t?.type === "reset-password" && this.step !== "reset-password" && (this.recovery = { userId: t.userId, secret: t.secret }, this.go("reset-password")), t?.type === "oauth-failed" && (this.notice = { tone: "error", message: this.t("errorOAuth") }
|
|
2896
|
+
(e === "signed-in" || e === "signed-out") && !i && (this.step === "mfa" || this.step === "phone" || this.step === "email-otp" || this.step === "magic-url" || this.step === "forgot-password" || this.token !== null || this.challenge !== null || e === "signed-out") && (this.token = null, this.challenge = null, this.code = "", this.password = "", this.notice = null, this.go(this.view === "sign-up" ? "sign-up" : "sign-in")), t?.type === "reset-password" && this.step !== "reset-password" && (this.recovery = { userId: t.userId, secret: t.secret }, this.go("reset-password")), t?.type === "oauth-failed" && (this.notice = { tone: "error", message: this.t("errorOAuth") }), t?.type === "notice" && !this.notice && (this.notice = {
|
|
2656
2897
|
tone: t.tone === "error" ? "error" : t.tone,
|
|
2657
2898
|
message: t.message
|
|
2658
2899
|
});
|
|
@@ -2662,7 +2903,7 @@ let $ = class extends A {
|
|
|
2662
2903
|
this.notice = null, this.auth.pending?.type === "notice" && n.setPending(null);
|
|
2663
2904
|
}
|
|
2664
2905
|
go(e) {
|
|
2665
|
-
e === "sign-up" && this.config?.signUp === !1 && (e = "sign-in"), this.focusOnStep = !0, this.step = e, this.error = "", this.notice = null, this.
|
|
2906
|
+
e === "sign-up" && this.config?.signUp === !1 && (e = "sign-in"), this.focusOnStep = !0, this.step = e, this.error = "", this.notice = null, this.busy = !1, this.showPassword = !1, this.password = "", this.passwordConfirm = "", e !== "mfa" && (this.challenge = null), e !== "email-otp" && e !== "phone" && e !== "magic-url" && (this.token = null), this.fire("authui-view", { view: e });
|
|
2666
2907
|
}
|
|
2667
2908
|
// ───────────────────────────── actions ─────────────────────────────
|
|
2668
2909
|
async run(e, t = "link") {
|
|
@@ -2671,7 +2912,7 @@ let $ = class extends A {
|
|
|
2671
2912
|
try {
|
|
2672
2913
|
await e();
|
|
2673
2914
|
} catch (i) {
|
|
2674
|
-
this.error =
|
|
2915
|
+
this.error = K(i, this.strings, t);
|
|
2675
2916
|
} finally {
|
|
2676
2917
|
this.busy = !1;
|
|
2677
2918
|
}
|
|
@@ -2694,16 +2935,16 @@ let $ = class extends A {
|
|
|
2694
2935
|
<div class="panel ${this.embedded ? "embedded" : ""}" part="panel">
|
|
2695
2936
|
${this.renderHeader()}
|
|
2696
2937
|
${this.notice ? r`<div class="alert alert-${this.notice.tone}" role="status">
|
|
2697
|
-
${this.notice.tone === "success" ?
|
|
2938
|
+
${this.notice.tone === "success" ? c.checkCircle : this.notice.tone === "error" ? c.alert : c.info}
|
|
2698
2939
|
<div class="alert-body">${this.notice.message}</div>
|
|
2699
2940
|
<button
|
|
2700
2941
|
class="btn btn-ghost btn-icon dismiss"
|
|
2701
2942
|
@click=${() => this.dismissNotice()}
|
|
2702
2943
|
aria-label=${this.t("close")}
|
|
2703
2944
|
>
|
|
2704
|
-
${
|
|
2945
|
+
${c.x}
|
|
2705
2946
|
</button>
|
|
2706
|
-
</div>` :
|
|
2947
|
+
</div>` : o}
|
|
2707
2948
|
${e}
|
|
2708
2949
|
</div>
|
|
2709
2950
|
`;
|
|
@@ -2745,25 +2986,26 @@ let $ = class extends A {
|
|
|
2745
2986
|
@error=${(a) => {
|
|
2746
2987
|
a.target.hidden = !0;
|
|
2747
2988
|
}}
|
|
2748
|
-
/>` :
|
|
2749
|
-
${n.isPreview ? r`<span class="badge badge-info preview">${this.t("preview")}</span>` :
|
|
2989
|
+
/>` : o}
|
|
2990
|
+
${n.isPreview ? r`<span class="badge badge-info preview">${this.t("preview")}</span>` : o}
|
|
2750
2991
|
<h2 class="title" id="authui-title">${i}</h2>
|
|
2751
|
-
${s ? r`<p class="description">${s}</p>` :
|
|
2992
|
+
${s ? r`<p class="description">${s}</p>` : o}
|
|
2752
2993
|
</div>
|
|
2753
2994
|
`;
|
|
2754
2995
|
}
|
|
2755
2996
|
renderError() {
|
|
2756
2997
|
return this.error ? r`<div class="alert alert-error" role="alert">
|
|
2757
|
-
${
|
|
2998
|
+
${c.alert}
|
|
2758
2999
|
<div class="alert-body">${this.error}</div>
|
|
2759
|
-
</div>` :
|
|
3000
|
+
</div>` : o;
|
|
2760
3001
|
}
|
|
2761
3002
|
submitButton(e, t = "btn-primary") {
|
|
2762
3003
|
return r`<button class="btn ${t} btn-block" type="submit" ?disabled=${this.busy}>
|
|
2763
|
-
${this.busy ? r`<span class="spinner" aria-hidden="true"></span>` :
|
|
3004
|
+
${this.busy ? r`<span class="spinner" aria-hidden="true"></span>` : o} ${e}
|
|
2764
3005
|
</button>`;
|
|
2765
3006
|
}
|
|
2766
3007
|
passwordField(e) {
|
|
3008
|
+
const t = this[e.field], i = e.meter ? it(t) : null;
|
|
2767
3009
|
return r`
|
|
2768
3010
|
<div class="field">
|
|
2769
3011
|
<label class="label" for=${e.id}>
|
|
@@ -2774,7 +3016,7 @@ let $ = class extends A {
|
|
|
2774
3016
|
@click=${() => this.go("forgot-password")}
|
|
2775
3017
|
>
|
|
2776
3018
|
${this.t("forgotPassword")}
|
|
2777
|
-
</button>` :
|
|
3019
|
+
</button>` : o}
|
|
2778
3020
|
</label>
|
|
2779
3021
|
<div class="input-wrap">
|
|
2780
3022
|
<input
|
|
@@ -2784,7 +3026,7 @@ let $ = class extends A {
|
|
|
2784
3026
|
autocomplete=${e.autocomplete}
|
|
2785
3027
|
required
|
|
2786
3028
|
minlength="8"
|
|
2787
|
-
.value=${
|
|
3029
|
+
.value=${t}
|
|
2788
3030
|
@input=${this.bind(e.field)}
|
|
2789
3031
|
/>
|
|
2790
3032
|
<button
|
|
@@ -2794,10 +3036,24 @@ let $ = class extends A {
|
|
|
2794
3036
|
aria-label=${this.showPassword ? this.t("hidePassword") : this.t("showPassword")}
|
|
2795
3037
|
tabindex="-1"
|
|
2796
3038
|
>
|
|
2797
|
-
${this.showPassword ?
|
|
3039
|
+
${this.showPassword ? c.eyeOff : c.eye}
|
|
2798
3040
|
</button>
|
|
2799
3041
|
</div>
|
|
2800
|
-
${
|
|
3042
|
+
${i && t ? r`<div class="strength" aria-live="polite">
|
|
3043
|
+
<div
|
|
3044
|
+
class="strength-meter"
|
|
3045
|
+
data-level=${String(i.level)}
|
|
3046
|
+
role="meter"
|
|
3047
|
+
aria-label=${this.t("passwordStrengthLabel")}
|
|
3048
|
+
aria-valuemin="0"
|
|
3049
|
+
aria-valuemax="4"
|
|
3050
|
+
aria-valuenow=${String(i.level)}
|
|
3051
|
+
aria-valuetext=${this.t(i.labelKey)}
|
|
3052
|
+
>
|
|
3053
|
+
<span></span><span></span><span></span><span></span>
|
|
3054
|
+
</div>
|
|
3055
|
+
<p class="strength-label">${this.t(i.labelKey)}</p>
|
|
3056
|
+
</div>` : e.hint ? r`<p class="hint">${e.hint}</p>` : o}
|
|
2801
3057
|
</div>
|
|
2802
3058
|
`;
|
|
2803
3059
|
}
|
|
@@ -2839,24 +3095,29 @@ let $ = class extends A {
|
|
|
2839
3095
|
}
|
|
2840
3096
|
legal() {
|
|
2841
3097
|
const e = this.config?.legal;
|
|
2842
|
-
return !e?.termsUrl && !e?.privacyUrl ?
|
|
3098
|
+
return !e?.termsUrl && !e?.privacyUrl ? o : r`<p class="legal">
|
|
2843
3099
|
${this.t("agreeTo")}
|
|
2844
|
-
${e.termsUrl ? r`<a href=${e.termsUrl} target="_blank" rel="noopener">${this.t("terms")}</a>` :
|
|
2845
|
-
${e.termsUrl && e.privacyUrl ? r` ${this.t("and")} ` :
|
|
2846
|
-
${e.privacyUrl ? r`<a href=${e.privacyUrl} target="_blank" rel="noopener">${this.t("privacy")}</a>` :
|
|
3100
|
+
${e.termsUrl ? r`<a href=${e.termsUrl} target="_blank" rel="noopener">${this.t("terms")}</a>` : o}
|
|
3101
|
+
${e.termsUrl && e.privacyUrl ? r` ${this.t("and")} ` : o}
|
|
3102
|
+
${e.privacyUrl ? r`<a href=${e.privacyUrl} target="_blank" rel="noopener">${this.t("privacy")}</a>` : o}.
|
|
2847
3103
|
</p>`;
|
|
2848
3104
|
}
|
|
2849
3105
|
backLink(e = "sign-in") {
|
|
2850
3106
|
return r`<div class="links">
|
|
2851
3107
|
<button type="button" class="btn btn-link" @click=${() => this.go(e)}>
|
|
2852
|
-
${
|
|
3108
|
+
${c.arrowLeft} ${this.t("back")}
|
|
2853
3109
|
</button>
|
|
2854
3110
|
</div>`;
|
|
2855
3111
|
}
|
|
2856
3112
|
renderStep() {
|
|
3113
|
+
if (this.auth.configError)
|
|
3114
|
+
return r`<div class="alert alert-error" role="alert">
|
|
3115
|
+
${c.alert}
|
|
3116
|
+
<div class="alert-body">${this.auth.configError}</div>
|
|
3117
|
+
</div>`;
|
|
2857
3118
|
if (!this.auth.configured)
|
|
2858
3119
|
return r`<div class="alert alert-error" role="alert">
|
|
2859
|
-
${
|
|
3120
|
+
${c.alert}
|
|
2860
3121
|
<div class="alert-body">${this.t("errorNotConfigured")}</div>
|
|
2861
3122
|
</div>`;
|
|
2862
3123
|
if (this.auth.status === "loading")
|
|
@@ -2887,10 +3148,10 @@ let $ = class extends A {
|
|
|
2887
3148
|
<div class="stack">
|
|
2888
3149
|
<div class="row">
|
|
2889
3150
|
<div class="inline">
|
|
2890
|
-
<span class="avatar">${
|
|
3151
|
+
<span class="avatar">${at(t)}</span>
|
|
2891
3152
|
<div class="row-main">
|
|
2892
3153
|
<span class="row-title" title=${t}>${t}</span>
|
|
2893
|
-
${e.email && e.name ? r`<span class="row-sub" title=${e.email}>${e.email}</span>` :
|
|
3154
|
+
${e.email && e.name ? r`<span class="row-sub" title=${e.email}>${e.email}</span>` : o}
|
|
2894
3155
|
</div>
|
|
2895
3156
|
</div>
|
|
2896
3157
|
</div>
|
|
@@ -2898,85 +3159,102 @@ let $ = class extends A {
|
|
|
2898
3159
|
<div class="stack-sm">
|
|
2899
3160
|
${this.config?.successUrl ? r`<a class="btn btn-primary btn-block" href=${this.config.successUrl}
|
|
2900
3161
|
>${this.t("continue")}</a
|
|
2901
|
-
>` :
|
|
3162
|
+
>` : o}
|
|
2902
3163
|
<button
|
|
2903
3164
|
class="btn btn-outline btn-block"
|
|
2904
3165
|
@click=${() => {
|
|
2905
|
-
this.embedded ? this.fire("authui-open", { view: "account" }) :
|
|
3166
|
+
this.embedded ? this.fire("authui-open", { view: "account" }) : Y("account");
|
|
2906
3167
|
}}
|
|
2907
3168
|
>
|
|
2908
|
-
${
|
|
3169
|
+
${c.settings} ${this.t("manageAccount")}
|
|
2909
3170
|
</button>
|
|
2910
3171
|
<button class="btn btn-ghost btn-block" @click=${this.onSignOut} ?disabled=${this.busy}>
|
|
2911
|
-
${
|
|
3172
|
+
${c.logOut} ${this.t("signOut")}
|
|
2912
3173
|
</button>
|
|
2913
3174
|
</div>
|
|
2914
3175
|
</div>
|
|
2915
3176
|
`;
|
|
2916
3177
|
}
|
|
2917
3178
|
renderProviders() {
|
|
2918
|
-
const e = this.config?.methods?.oauth ?? [];
|
|
2919
|
-
if (e.length === 0) return
|
|
2920
|
-
const t =
|
|
3179
|
+
const e = [...this.config?.methods?.oauth ?? []];
|
|
3180
|
+
if (e.length === 0) return o;
|
|
3181
|
+
const t = D();
|
|
3182
|
+
e.sort((s, a) => {
|
|
3183
|
+
const l = t === `oauth:${s}` ? 0 : 1, u = t === `oauth:${a}` ? 0 : 1;
|
|
3184
|
+
return l - u;
|
|
3185
|
+
});
|
|
3186
|
+
const i = e.length > 2;
|
|
2921
3187
|
return r`
|
|
2922
|
-
<div class="providers ${
|
|
2923
|
-
${e.map(
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
|
|
3188
|
+
<div class="providers ${i ? "two" : ""}">
|
|
3189
|
+
${e.map((s) => {
|
|
3190
|
+
const a = t === `oauth:${s}`;
|
|
3191
|
+
return r`<button
|
|
3192
|
+
type="button"
|
|
3193
|
+
class="btn btn-outline ${a ? "last-used" : ""}"
|
|
3194
|
+
@click=${() => this.onOAuth(s)}
|
|
3195
|
+
?disabled=${this.busy}
|
|
3196
|
+
aria-label=${this.t("continueWith", { provider: q(s) })}
|
|
3197
|
+
>
|
|
3198
|
+
${et(s)}
|
|
3199
|
+
<span
|
|
3200
|
+
>${i ? q(s) : this.t("continueWith", { provider: q(s) })}</span
|
|
2930
3201
|
>
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
>
|
|
2935
|
-
</button>`
|
|
2936
|
-
)}
|
|
3202
|
+
${a ? r`<span class="last-used-badge">${this.t("lastUsed")}</span>` : o}
|
|
3203
|
+
</button>`;
|
|
3204
|
+
})}
|
|
2937
3205
|
</div>
|
|
2938
3206
|
`;
|
|
2939
3207
|
}
|
|
2940
3208
|
renderSignIn() {
|
|
2941
3209
|
const e = this.config?.methods ?? {}, t = e.emailPassword !== !1, i = (e.oauth?.length ?? 0) > 0, s = [
|
|
2942
|
-
e.magicUrl ? { step: "magic-url", icon:
|
|
2943
|
-
e.emailOtp ? { step: "email-otp", icon:
|
|
2944
|
-
e.phone ? { step: "phone", icon:
|
|
3210
|
+
e.magicUrl ? { step: "magic-url", icon: c.link, label: this.t("sendMagicLink") } : null,
|
|
3211
|
+
e.emailOtp ? { step: "email-otp", icon: c.mail, label: this.t("continueWithEmail") } : null,
|
|
3212
|
+
e.phone ? { step: "phone", icon: c.smartphone, label: this.t("continueWithPhone") } : null
|
|
2945
3213
|
].filter(Boolean);
|
|
2946
3214
|
return r`
|
|
2947
3215
|
<div class="stack">
|
|
2948
3216
|
${this.renderProviders()}
|
|
2949
|
-
${i && (t || s.length > 0) ? r`<div class="separator-text">${this.t("or")}</div>` :
|
|
2950
|
-
${t ? r`<form
|
|
3217
|
+
${i && (t || s.length > 0) ? r`<div class="separator-text">${this.t("or")}</div>` : o}
|
|
3218
|
+
${t ? r`<form
|
|
3219
|
+
class="form ${D() === "email-password" ? "last-used-form" : ""}"
|
|
3220
|
+
@submit=${this.onSignIn}
|
|
3221
|
+
novalidate
|
|
3222
|
+
>
|
|
3223
|
+
${D() === "email-password" ? r`<p class="hint">
|
|
3224
|
+
<span class="last-used-badge">${this.t("lastUsed")}</span>
|
|
3225
|
+
</p>` : o}
|
|
2951
3226
|
${this.emailField()}
|
|
2952
3227
|
${this.passwordField({ label: this.t("password"), autocomplete: "current-password", id: "authui-password", field: "password", forgot: !0 })}
|
|
2953
3228
|
${this.renderError()} ${this.submitButton(this.t("signIn"))}
|
|
2954
3229
|
</form>` : this.renderError()}
|
|
2955
3230
|
${s.length > 0 ? r`<div class="stack-sm">
|
|
2956
|
-
${s.map(
|
|
2957
|
-
(
|
|
2958
|
-
|
|
2959
|
-
|
|
2960
|
-
|
|
2961
|
-
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
|
|
3231
|
+
${s.map((a) => {
|
|
3232
|
+
const l = D() === a.step;
|
|
3233
|
+
return r`<button
|
|
3234
|
+
type="button"
|
|
3235
|
+
class="btn btn-secondary btn-block ${l ? "last-used" : ""}"
|
|
3236
|
+
@click=${() => this.go(a.step)}
|
|
3237
|
+
>
|
|
3238
|
+
${a.icon} ${a.label}
|
|
3239
|
+
${l ? r`<span class="last-used-badge">${this.t("lastUsed")}</span>` : o}
|
|
3240
|
+
</button>`;
|
|
3241
|
+
})}
|
|
3242
|
+
</div>` : o}
|
|
2966
3243
|
${e.anonymous ? r`<button
|
|
2967
3244
|
type="button"
|
|
2968
|
-
class="btn btn-ghost btn-block"
|
|
3245
|
+
class="btn btn-ghost btn-block ${D() === "anonymous" ? "last-used" : ""}"
|
|
2969
3246
|
@click=${this.onGuest}
|
|
2970
3247
|
?disabled=${this.busy}
|
|
2971
3248
|
>
|
|
2972
|
-
${
|
|
2973
|
-
|
|
3249
|
+
${c.ghost} ${this.t("continueAsGuest")}
|
|
3250
|
+
${D() === "anonymous" ? r`<span class="last-used-badge">${this.t("lastUsed")}</span>` : o}
|
|
3251
|
+
</button>` : o}
|
|
2974
3252
|
${t && this.config?.signUp !== !1 ? r`<div class="links">
|
|
2975
3253
|
<span>${this.t("noAccount")}</span>
|
|
2976
3254
|
<button type="button" class="btn btn-link" @click=${() => this.go("sign-up")}>
|
|
2977
3255
|
${this.t("signUp")}
|
|
2978
3256
|
</button>
|
|
2979
|
-
</div>` :
|
|
3257
|
+
</div>` : o}
|
|
2980
3258
|
${this.legal()}
|
|
2981
3259
|
</div>
|
|
2982
3260
|
`;
|
|
@@ -2985,7 +3263,7 @@ let $ = class extends A {
|
|
|
2985
3263
|
return r`
|
|
2986
3264
|
<div class="stack">
|
|
2987
3265
|
${this.renderProviders()}
|
|
2988
|
-
${(this.config?.methods?.oauth?.length ?? 0) > 0 ? r`<div class="separator-text">${this.t("or")}</div>` :
|
|
3266
|
+
${(this.config?.methods?.oauth?.length ?? 0) > 0 ? r`<div class="separator-text">${this.t("or")}</div>` : o}
|
|
2989
3267
|
<form class="form" @submit=${this.onSignUp} novalidate>
|
|
2990
3268
|
${this.config?.requireName !== !1 ? r`<div class="field">
|
|
2991
3269
|
<label class="label" for="authui-name">${this.t("name")}</label>
|
|
@@ -2998,9 +3276,9 @@ let $ = class extends A {
|
|
|
2998
3276
|
.value=${this.name}
|
|
2999
3277
|
@input=${this.bind("name")}
|
|
3000
3278
|
/>
|
|
3001
|
-
</div>` :
|
|
3279
|
+
</div>` : o}
|
|
3002
3280
|
${this.emailField()}
|
|
3003
|
-
${this.passwordField({ label: this.t("password"), autocomplete: "new-password", id: "authui-password", field: "password", hint: this.t("passwordHint") })}
|
|
3281
|
+
${this.passwordField({ label: this.t("password"), autocomplete: "new-password", id: "authui-password", field: "password", hint: this.t("passwordHint"), meter: !0 })}
|
|
3004
3282
|
${this.renderError()} ${this.submitButton(this.t("createAccount"))}
|
|
3005
3283
|
</form>
|
|
3006
3284
|
<div class="links">
|
|
@@ -3027,7 +3305,7 @@ let $ = class extends A {
|
|
|
3027
3305
|
return this.recovery ? r`
|
|
3028
3306
|
<div class="stack">
|
|
3029
3307
|
<form class="form" @submit=${this.onReset} novalidate>
|
|
3030
|
-
${this.passwordField({ label: this.t("newPassword"), autocomplete: "new-password", id: "authui-password", field: "password", hint: this.t("passwordHint") })}
|
|
3308
|
+
${this.passwordField({ label: this.t("newPassword"), autocomplete: "new-password", id: "authui-password", field: "password", hint: this.t("passwordHint"), meter: !0 })}
|
|
3031
3309
|
${this.passwordField({ label: this.t("confirmPassword"), autocomplete: "new-password", id: "authui-password-confirm", field: "passwordConfirm" })}
|
|
3032
3310
|
${this.renderError()} ${this.submitButton(this.t("resetPassword"))}
|
|
3033
3311
|
</form>
|
|
@@ -3039,13 +3317,13 @@ let $ = class extends A {
|
|
|
3039
3317
|
this.step = "sign-in", this.error = "", this.notice = null, this.focusOnStep = !0, this.fire("authui-view", { view: "sign-in" });
|
|
3040
3318
|
}}
|
|
3041
3319
|
>
|
|
3042
|
-
${
|
|
3320
|
+
${c.arrowLeft} ${this.t("back")}
|
|
3043
3321
|
</button>
|
|
3044
3322
|
</div>
|
|
3045
3323
|
</div>
|
|
3046
3324
|
` : r`<div class="stack">
|
|
3047
3325
|
<div class="alert alert-error" role="alert">
|
|
3048
|
-
${
|
|
3326
|
+
${c.alert}
|
|
3049
3327
|
<div class="alert-body">${this.t("errorInvalidToken")}</div>
|
|
3050
3328
|
</div>
|
|
3051
3329
|
<div class="links">
|
|
@@ -3063,17 +3341,17 @@ let $ = class extends A {
|
|
|
3063
3341
|
}
|
|
3064
3342
|
phraseBox(e) {
|
|
3065
3343
|
return e ? r`<div class="alert alert-info">
|
|
3066
|
-
${
|
|
3344
|
+
${c.shield}
|
|
3067
3345
|
<div class="alert-title">
|
|
3068
3346
|
${this.t("securityPhrase")}: <span class="code">${e}</span>
|
|
3069
3347
|
</div>
|
|
3070
3348
|
<div class="alert-body">${this.t("securityPhraseHint")}</div>
|
|
3071
|
-
</div>` :
|
|
3349
|
+
</div>` : o;
|
|
3072
3350
|
}
|
|
3073
3351
|
renderMagicUrl() {
|
|
3074
3352
|
return this.token ? r`<div class="stack">
|
|
3075
3353
|
<div class="alert alert-success" role="status">
|
|
3076
|
-
${
|
|
3354
|
+
${c.mail}
|
|
3077
3355
|
<div class="alert-body">${this.t("magicLinkSent", { email: this.token.target })}</div>
|
|
3078
3356
|
</div>
|
|
3079
3357
|
${this.phraseBox(this.token.phrase)} ${this.backLink()}
|
|
@@ -3108,7 +3386,7 @@ let $ = class extends A {
|
|
|
3108
3386
|
const e = this.token?.kind === "phone", t = Date.now() < this.resendCooldownUntil;
|
|
3109
3387
|
return r`
|
|
3110
3388
|
<div class="alert alert-info" role="status">
|
|
3111
|
-
${e ?
|
|
3389
|
+
${e ? c.smartphone : c.mail}
|
|
3112
3390
|
<div class="alert-body">${this.t("codeSent", { target: this.token.target })}</div>
|
|
3113
3391
|
</div>
|
|
3114
3392
|
${this.phraseBox(this.token.phrase)}
|
|
@@ -3178,25 +3456,25 @@ let $ = class extends A {
|
|
|
3178
3456
|
const i = [
|
|
3179
3457
|
{
|
|
3180
3458
|
factor: "totp",
|
|
3181
|
-
icon:
|
|
3459
|
+
icon: c.smartphone,
|
|
3182
3460
|
label: this.t("mfaUseAuthenticator"),
|
|
3183
3461
|
available: e?.totp ?? !0
|
|
3184
3462
|
},
|
|
3185
3463
|
{
|
|
3186
3464
|
factor: "email",
|
|
3187
|
-
icon:
|
|
3465
|
+
icon: c.mail,
|
|
3188
3466
|
label: this.t("mfaUseEmail"),
|
|
3189
3467
|
available: e?.email ?? !0
|
|
3190
3468
|
},
|
|
3191
3469
|
{
|
|
3192
3470
|
factor: "phone",
|
|
3193
|
-
icon:
|
|
3471
|
+
icon: c.phone,
|
|
3194
3472
|
label: this.t("mfaUsePhone"),
|
|
3195
3473
|
available: e?.phone ?? !0
|
|
3196
3474
|
},
|
|
3197
3475
|
{
|
|
3198
3476
|
factor: "recoverycode",
|
|
3199
|
-
icon:
|
|
3477
|
+
icon: c.key,
|
|
3200
3478
|
label: this.t("mfaUseRecoveryCode"),
|
|
3201
3479
|
available: e?.recoveryCode ?? !0
|
|
3202
3480
|
}
|
|
@@ -3244,7 +3522,7 @@ let $ = class extends A {
|
|
|
3244
3522
|
</form>
|
|
3245
3523
|
<div class="links">
|
|
3246
3524
|
<button type="button" class="btn btn-link" @click=${() => this.challenge = null}>
|
|
3247
|
-
${
|
|
3525
|
+
${c.arrowLeft} ${this.t("back")}
|
|
3248
3526
|
</button>
|
|
3249
3527
|
<span aria-hidden="true">·</span>
|
|
3250
3528
|
<button type="button" class="btn btn-link" @click=${this.onCancelMfa}>
|
|
@@ -3255,57 +3533,57 @@ let $ = class extends A {
|
|
|
3255
3533
|
`;
|
|
3256
3534
|
}
|
|
3257
3535
|
};
|
|
3258
|
-
$.styles = [...
|
|
3536
|
+
$.styles = [...P.styles, jt];
|
|
3259
3537
|
k([
|
|
3260
|
-
|
|
3538
|
+
g({ type: String })
|
|
3261
3539
|
], $.prototype, "view", 2);
|
|
3262
3540
|
k([
|
|
3263
|
-
|
|
3541
|
+
g({ type: Boolean })
|
|
3264
3542
|
], $.prototype, "embedded", 2);
|
|
3265
3543
|
k([
|
|
3266
|
-
|
|
3544
|
+
h()
|
|
3267
3545
|
], $.prototype, "step", 2);
|
|
3268
3546
|
k([
|
|
3269
|
-
|
|
3547
|
+
h()
|
|
3270
3548
|
], $.prototype, "busy", 2);
|
|
3271
3549
|
k([
|
|
3272
|
-
|
|
3550
|
+
h()
|
|
3273
3551
|
], $.prototype, "error", 2);
|
|
3274
3552
|
k([
|
|
3275
|
-
|
|
3553
|
+
h()
|
|
3276
3554
|
], $.prototype, "notice", 2);
|
|
3277
3555
|
k([
|
|
3278
|
-
|
|
3556
|
+
h()
|
|
3279
3557
|
], $.prototype, "showPassword", 2);
|
|
3280
3558
|
k([
|
|
3281
|
-
|
|
3559
|
+
h()
|
|
3282
3560
|
], $.prototype, "token", 2);
|
|
3283
3561
|
k([
|
|
3284
|
-
|
|
3562
|
+
h()
|
|
3285
3563
|
], $.prototype, "resendCooldownUntil", 2);
|
|
3286
3564
|
k([
|
|
3287
|
-
|
|
3565
|
+
h()
|
|
3288
3566
|
], $.prototype, "challenge", 2);
|
|
3289
3567
|
k([
|
|
3290
|
-
|
|
3568
|
+
h()
|
|
3291
3569
|
], $.prototype, "recovery", 2);
|
|
3292
3570
|
k([
|
|
3293
|
-
|
|
3571
|
+
bt("form input:not([type=hidden])")
|
|
3294
3572
|
], $.prototype, "firstInput", 2);
|
|
3295
3573
|
$ = k([
|
|
3296
3574
|
O("authui-sign-in")
|
|
3297
3575
|
], $);
|
|
3298
|
-
var
|
|
3299
|
-
for (var a = s > 1 ? void 0 : s ?
|
|
3300
|
-
(
|
|
3301
|
-
return s && a &&
|
|
3576
|
+
var Gt = Object.defineProperty, Yt = Object.getOwnPropertyDescriptor, m = (e, t, i, s) => {
|
|
3577
|
+
for (var a = s > 1 ? void 0 : s ? Yt(t, i) : t, l = e.length - 1, u; l >= 0; l--)
|
|
3578
|
+
(u = e[l]) && (a = (s ? u(t, i, a) : u(a)) || a);
|
|
3579
|
+
return s && a && Gt(t, i, a), a;
|
|
3302
3580
|
};
|
|
3303
|
-
let
|
|
3581
|
+
let p = class extends P {
|
|
3304
3582
|
constructor() {
|
|
3305
3583
|
super(...arguments), this.embedded = !1, this.tab = "profile", this.active = "profile", this.busy = "", this.notice = null, this.errors = {}, this.nameInput = "", this.emailInput = "", this.emailPassword = "", this.phoneInput = "", this.phonePassword = "", this.phoneCode = "", this.phoneCodeSent = !1, this.guestName = "", this.oldPassword = "", this.newPassword = "", this.newPasswordConfirm = "", this.authenticator = null, this.authenticatorCode = "", this.factors = null, this.recoveryCodes = null, this.stepUp = null, this.stepUpCode = "", this.copied = !1, this.sessions = null, this.identities = null, this.logs = null, this.logsSupported = null, this.logsProbeStarted = !1, this.confirmDelete = !1, this.confirmRegenerate = !1, this.confirmRemoveAuthenticator = !1, this.confirmSignOutAll = !1, this.confirmDisconnectId = null, this.verifyEmailCooldownUntil = 0, this.onTabsKeydown = (e) => {
|
|
3306
3584
|
const t = [...this.renderRoot?.querySelectorAll('[role="tab"]') ?? []];
|
|
3307
3585
|
if (!t.length) return;
|
|
3308
|
-
const i = t.findIndex((
|
|
3586
|
+
const i = t.findIndex((l) => l.getAttribute("aria-selected") === "true");
|
|
3309
3587
|
let s = i;
|
|
3310
3588
|
if (e.key === "ArrowRight" || e.key === "ArrowDown") s = (i + 1) % t.length;
|
|
3311
3589
|
else if (e.key === "ArrowLeft" || e.key === "ArrowUp")
|
|
@@ -3406,7 +3684,7 @@ let u = class extends A {
|
|
|
3406
3684
|
try {
|
|
3407
3685
|
this.recoveryCodes = await n.createRecoveryCodes();
|
|
3408
3686
|
} catch (e) {
|
|
3409
|
-
if (!
|
|
3687
|
+
if (!N(e, f.recoveryCodesExist)) throw e;
|
|
3410
3688
|
this.recoveryCodes = await n.getRecoveryCodes();
|
|
3411
3689
|
}
|
|
3412
3690
|
await this.loadFactors();
|
|
@@ -3519,9 +3797,9 @@ let u = class extends A {
|
|
|
3519
3797
|
try {
|
|
3520
3798
|
await t(), i && this.setNotice("success", i);
|
|
3521
3799
|
} catch (s) {
|
|
3522
|
-
|
|
3800
|
+
N(s, f.challengeRequired) ? this.stepUp = { retry: () => this.run(e, t, i) } : this.errors = {
|
|
3523
3801
|
...this.errors,
|
|
3524
|
-
[e]:
|
|
3802
|
+
[e]: K(
|
|
3525
3803
|
s,
|
|
3526
3804
|
this.strings,
|
|
3527
3805
|
e.includes("code") ? "code" : e === "password" ? "password" : "link"
|
|
@@ -3595,7 +3873,7 @@ let u = class extends A {
|
|
|
3595
3873
|
render() {
|
|
3596
3874
|
if (!this.auth.configured)
|
|
3597
3875
|
return r`<div class="alert alert-error" role="alert">
|
|
3598
|
-
${
|
|
3876
|
+
${c.alert}
|
|
3599
3877
|
<div class="alert-body">${this.t("errorNotConfigured")}</div>
|
|
3600
3878
|
</div>`;
|
|
3601
3879
|
if (this.auth.status === "loading")
|
|
@@ -3632,7 +3910,7 @@ let u = class extends A {
|
|
|
3632
3910
|
)}
|
|
3633
3911
|
</div>
|
|
3634
3912
|
${this.notice ? r`<div class="alert alert-${this.notice.tone}" role="status">
|
|
3635
|
-
${this.notice.tone === "success" ?
|
|
3913
|
+
${this.notice.tone === "success" ? c.checkCircle : c.info}
|
|
3636
3914
|
<div class="alert-body">${this.notice.message}</div>
|
|
3637
3915
|
<button
|
|
3638
3916
|
class="btn btn-ghost btn-icon dismiss"
|
|
@@ -3641,9 +3919,9 @@ let u = class extends A {
|
|
|
3641
3919
|
}}
|
|
3642
3920
|
aria-label=${this.t("close")}
|
|
3643
3921
|
>
|
|
3644
|
-
${
|
|
3922
|
+
${c.x}
|
|
3645
3923
|
</button>
|
|
3646
|
-
</div>` :
|
|
3924
|
+
</div>` : o}
|
|
3647
3925
|
${this.stepUp ? this.renderStepUp() : r`<div
|
|
3648
3926
|
class="tabpanel"
|
|
3649
3927
|
role="tabpanel"
|
|
@@ -3660,18 +3938,18 @@ let u = class extends A {
|
|
|
3660
3938
|
return r`
|
|
3661
3939
|
<div class="between">
|
|
3662
3940
|
<div class="identity">
|
|
3663
|
-
<span class="avatar">${
|
|
3941
|
+
<span class="avatar">${at(t)}</span>
|
|
3664
3942
|
<div class="row-main">
|
|
3665
3943
|
<span class="row-title" title=${t}>
|
|
3666
3944
|
${t}
|
|
3667
|
-
${e.mfa ? r`<span class="badge badge-success">${
|
|
3668
|
-
${n.isPreview ? r`<span class="badge badge-info">${this.t("preview")}</span>` :
|
|
3945
|
+
${e.mfa ? r`<span class="badge badge-success">${c.shieldCheck} ${this.t("mfaBadge")}</span>` : o}
|
|
3946
|
+
${n.isPreview ? r`<span class="badge badge-info">${this.t("preview")}</span>` : o}
|
|
3669
3947
|
</span>
|
|
3670
|
-
${e.email && e.name ? r`<span class="row-sub" title=${e.email}>${e.email}</span>` :
|
|
3948
|
+
${e.email && e.name ? r`<span class="row-sub" title=${e.email}>${e.email}</span>` : o}
|
|
3671
3949
|
</div>
|
|
3672
3950
|
</div>
|
|
3673
3951
|
<button class="btn btn-outline btn-sm" @click=${() => n.signOut()}>
|
|
3674
|
-
${
|
|
3952
|
+
${c.logOut} ${this.t("signOut")}
|
|
3675
3953
|
</button>
|
|
3676
3954
|
</div>
|
|
3677
3955
|
`;
|
|
@@ -3693,25 +3971,25 @@ let u = class extends A {
|
|
|
3693
3971
|
error(e) {
|
|
3694
3972
|
const t = this.errors[e];
|
|
3695
3973
|
return t ? r`<div class="alert alert-error" role="alert">
|
|
3696
|
-
${
|
|
3974
|
+
${c.alert}
|
|
3697
3975
|
<div class="alert-body">${t}</div>
|
|
3698
|
-
</div>` :
|
|
3976
|
+
</div>` : o;
|
|
3699
3977
|
}
|
|
3700
3978
|
spinner(e) {
|
|
3701
|
-
return this.busy === e ? r`<span class="spinner" aria-hidden="true"></span>` :
|
|
3979
|
+
return this.busy === e ? r`<span class="spinner" aria-hidden="true"></span>` : o;
|
|
3702
3980
|
}
|
|
3703
3981
|
card(e, t, i, s, a = !1) {
|
|
3704
3982
|
return r`<section class="card ${a ? "card-danger" : ""}">
|
|
3705
3983
|
<div class="card-header">
|
|
3706
3984
|
<h3 class="card-title">${e}</h3>
|
|
3707
|
-
${t ? r`<p class="card-description">${t}</p>` :
|
|
3985
|
+
${t ? r`<p class="card-description">${t}</p>` : o}
|
|
3708
3986
|
</div>
|
|
3709
3987
|
<div class="card-body">${i}</div>
|
|
3710
|
-
${s ? r`<div class="card-footer">${s}</div>` :
|
|
3988
|
+
${s ? r`<div class="card-footer">${s}</div>` : o}
|
|
3711
3989
|
</section>`;
|
|
3712
3990
|
}
|
|
3713
3991
|
verifiedBadge(e) {
|
|
3714
|
-
return e ? r`<span class="badge badge-success">${
|
|
3992
|
+
return e ? r`<span class="badge badge-success">${c.check} ${this.t("verified")}</span>` : r`<span class="badge badge-warning">${this.t("unverified")}</span>`;
|
|
3715
3993
|
}
|
|
3716
3994
|
// ── Profile ──
|
|
3717
3995
|
renderProfile() {
|
|
@@ -3755,7 +4033,24 @@ let u = class extends A {
|
|
|
3755
4033
|
@input=${this.bind("emailPassword")}
|
|
3756
4034
|
autocomplete="new-password"
|
|
3757
4035
|
/>
|
|
3758
|
-
|
|
4036
|
+
${this.emailPassword ? (() => {
|
|
4037
|
+
const t = it(this.emailPassword);
|
|
4038
|
+
return r`<div class="strength" aria-live="polite">
|
|
4039
|
+
<div
|
|
4040
|
+
class="strength-meter"
|
|
4041
|
+
data-level=${String(t.level)}
|
|
4042
|
+
role="meter"
|
|
4043
|
+
aria-label=${this.t("passwordStrengthLabel")}
|
|
4044
|
+
aria-valuemin="0"
|
|
4045
|
+
aria-valuemax="4"
|
|
4046
|
+
aria-valuenow=${String(t.level)}
|
|
4047
|
+
aria-valuetext=${this.t(t.labelKey)}
|
|
4048
|
+
>
|
|
4049
|
+
<span></span><span></span><span></span><span></span>
|
|
4050
|
+
</div>
|
|
4051
|
+
<p class="strength-label">${this.t(t.labelKey)}</p>
|
|
4052
|
+
</div>`;
|
|
4053
|
+
})() : r`<p class="hint">${this.t("passwordHint")}</p>`}
|
|
3759
4054
|
</div>
|
|
3760
4055
|
${this.error("guest")}
|
|
3761
4056
|
</form>`,
|
|
@@ -3802,7 +4097,7 @@ let u = class extends A {
|
|
|
3802
4097
|
<div class="field">
|
|
3803
4098
|
<label class="label" for="acc-email"
|
|
3804
4099
|
>${this.t("email")}
|
|
3805
|
-
${e.email ? this.verifiedBadge(e.emailVerification) :
|
|
4100
|
+
${e.email ? this.verifiedBadge(e.emailVerification) : o}</label
|
|
3806
4101
|
>
|
|
3807
4102
|
<input
|
|
3808
4103
|
class="input"
|
|
@@ -3827,8 +4122,8 @@ let u = class extends A {
|
|
|
3827
4122
|
autocomplete=${e.passwordUpdate ? "current-password" : "new-password"}
|
|
3828
4123
|
required
|
|
3829
4124
|
/>
|
|
3830
|
-
${e.passwordUpdate ?
|
|
3831
|
-
</div>` :
|
|
4125
|
+
${e.passwordUpdate ? o : r`<p class="hint">${this.t("createPasswordHint")}</p>`}
|
|
4126
|
+
</div>` : o}
|
|
3832
4127
|
${this.error("email")} ${this.error("verify")}
|
|
3833
4128
|
</form>`,
|
|
3834
4129
|
r`
|
|
@@ -3845,7 +4140,7 @@ let u = class extends A {
|
|
|
3845
4140
|
Math.ceil((this.verifyEmailCooldownUntil - Date.now()) / 1e3)
|
|
3846
4141
|
)
|
|
3847
4142
|
}) : this.t("verifyEmail")}
|
|
3848
|
-
</button>` :
|
|
4143
|
+
</button>` : o}
|
|
3849
4144
|
<button
|
|
3850
4145
|
class="btn btn-primary btn-sm"
|
|
3851
4146
|
type="submit"
|
|
@@ -3863,7 +4158,7 @@ let u = class extends A {
|
|
|
3863
4158
|
<div class="field">
|
|
3864
4159
|
<label class="label" for="acc-phone"
|
|
3865
4160
|
>${this.t("phone")}
|
|
3866
|
-
${e.phone ? this.verifiedBadge(e.phoneVerification) :
|
|
4161
|
+
${e.phone ? this.verifiedBadge(e.phoneVerification) : o}</label
|
|
3867
4162
|
>
|
|
3868
4163
|
<input
|
|
3869
4164
|
class="input"
|
|
@@ -3888,8 +4183,8 @@ let u = class extends A {
|
|
|
3888
4183
|
autocomplete=${e.passwordUpdate ? "current-password" : "new-password"}
|
|
3889
4184
|
required
|
|
3890
4185
|
/>
|
|
3891
|
-
${e.passwordUpdate ?
|
|
3892
|
-
</div>` :
|
|
4186
|
+
${e.passwordUpdate ? o : r`<p class="hint">${this.t("createPasswordHint")}</p>`}
|
|
4187
|
+
</div>` : o}
|
|
3893
4188
|
${this.phoneCodeSent ? r`<div class="field">
|
|
3894
4189
|
<label class="label" for="acc-phone-code">${this.t("code")}</label>
|
|
3895
4190
|
<input
|
|
@@ -3906,7 +4201,7 @@ let u = class extends A {
|
|
|
3906
4201
|
t.key === "Enter" && (t.preventDefault(), this.onConfirmPhoneVerification(t));
|
|
3907
4202
|
}}
|
|
3908
4203
|
/>
|
|
3909
|
-
</div>` :
|
|
4204
|
+
</div>` : o}
|
|
3910
4205
|
${this.error("phone")} ${this.error("verify-phone")} ${this.error("verify-phone-code")}
|
|
3911
4206
|
</form>`,
|
|
3912
4207
|
r`
|
|
@@ -3917,7 +4212,7 @@ let u = class extends A {
|
|
|
3917
4212
|
?disabled=${!!this.busy}
|
|
3918
4213
|
>
|
|
3919
4214
|
${this.spinner("verify-phone")} ${this.t("sendCode")}
|
|
3920
|
-
</button>` :
|
|
4215
|
+
</button>` : o}
|
|
3921
4216
|
${this.phoneCodeSent ? r`<button
|
|
3922
4217
|
class="btn btn-outline btn-sm"
|
|
3923
4218
|
type="button"
|
|
@@ -3925,7 +4220,7 @@ let u = class extends A {
|
|
|
3925
4220
|
?disabled=${!!this.busy}
|
|
3926
4221
|
>
|
|
3927
4222
|
${this.spinner("verify-phone-code")} ${this.t("verifyCode")}
|
|
3928
|
-
</button>` :
|
|
4223
|
+
</button>` : o}
|
|
3929
4224
|
<button
|
|
3930
4225
|
class="btn btn-primary btn-sm"
|
|
3931
4226
|
type="submit"
|
|
@@ -3959,7 +4254,7 @@ let u = class extends A {
|
|
|
3959
4254
|
class="btn btn-outline btn-sm warn"
|
|
3960
4255
|
@click=${() => this.confirmDelete = !0}
|
|
3961
4256
|
>
|
|
3962
|
-
${
|
|
4257
|
+
${c.userX} ${this.t("deleteAccount")}
|
|
3963
4258
|
</button>`}`,
|
|
3964
4259
|
void 0,
|
|
3965
4260
|
!0
|
|
@@ -3969,7 +4264,7 @@ let u = class extends A {
|
|
|
3969
4264
|
renderSecurity() {
|
|
3970
4265
|
const e = this.user, t = this.config?.mfa !== !1;
|
|
3971
4266
|
return r`<div class="section">
|
|
3972
|
-
${this.isGuest ?
|
|
4267
|
+
${this.isGuest ? o : this.card(
|
|
3973
4268
|
this.t("changePassword"),
|
|
3974
4269
|
void 0,
|
|
3975
4270
|
r`<form
|
|
@@ -3991,7 +4286,7 @@ let u = class extends A {
|
|
|
3991
4286
|
autocomplete="current-password"
|
|
3992
4287
|
required
|
|
3993
4288
|
/>
|
|
3994
|
-
</div>` :
|
|
4289
|
+
</div>` : o}
|
|
3995
4290
|
<div class="field">
|
|
3996
4291
|
<label class="label" for="acc-new-password">${this.t("newPassword")}</label>
|
|
3997
4292
|
<input
|
|
@@ -4004,7 +4299,24 @@ let u = class extends A {
|
|
|
4004
4299
|
@input=${this.bind("newPassword")}
|
|
4005
4300
|
autocomplete="new-password"
|
|
4006
4301
|
/>
|
|
4007
|
-
|
|
4302
|
+
${this.newPassword ? (() => {
|
|
4303
|
+
const i = it(this.newPassword);
|
|
4304
|
+
return r`<div class="strength" aria-live="polite">
|
|
4305
|
+
<div
|
|
4306
|
+
class="strength-meter"
|
|
4307
|
+
data-level=${String(i.level)}
|
|
4308
|
+
role="meter"
|
|
4309
|
+
aria-label=${this.t("passwordStrengthLabel")}
|
|
4310
|
+
aria-valuemin="0"
|
|
4311
|
+
aria-valuemax="4"
|
|
4312
|
+
aria-valuenow=${String(i.level)}
|
|
4313
|
+
aria-valuetext=${this.t(i.labelKey)}
|
|
4314
|
+
>
|
|
4315
|
+
<span></span><span></span><span></span><span></span>
|
|
4316
|
+
</div>
|
|
4317
|
+
<p class="strength-label">${this.t(i.labelKey)}</p>
|
|
4318
|
+
</div>`;
|
|
4319
|
+
})() : r`<p class="hint">${this.t("passwordHint")}</p>`}
|
|
4008
4320
|
</div>
|
|
4009
4321
|
<div class="field">
|
|
4010
4322
|
<label class="label" for="acc-new-password-confirm"
|
|
@@ -4032,12 +4344,12 @@ let u = class extends A {
|
|
|
4032
4344
|
${this.spinner("password")} ${this.t("update")}
|
|
4033
4345
|
</button>`
|
|
4034
4346
|
)}
|
|
4035
|
-
${t ? this.renderMfaCard() :
|
|
4036
|
-
${t ? this.renderRecoveryCard() :
|
|
4347
|
+
${t ? this.renderMfaCard() : o}
|
|
4348
|
+
${t ? this.renderRecoveryCard() : o}
|
|
4037
4349
|
</div>`;
|
|
4038
4350
|
}
|
|
4039
4351
|
renderMfaCard() {
|
|
4040
|
-
const e = this.user, t = this.factors?.totp ?? !1, i = this.authenticator ? n.isPreview ?
|
|
4352
|
+
const e = this.user, t = this.factors?.totp ?? !1, i = this.authenticator ? n.isPreview ? It(this.authenticator.uri) : new xt(n.getClient()).getQR(this.authenticator.uri, 400, 1).toString() : "";
|
|
4041
4353
|
return this.card(
|
|
4042
4354
|
this.t("twoFactor"),
|
|
4043
4355
|
this.t("twoFactorDescription"),
|
|
@@ -4057,10 +4369,10 @@ let u = class extends A {
|
|
|
4057
4369
|
></button>
|
|
4058
4370
|
</div>
|
|
4059
4371
|
${e.mfa && !(this.factors?.totp || e.emailVerification || e.phoneVerification) ? r`<div class="alert alert-warning" role="status">
|
|
4060
|
-
${
|
|
4372
|
+
${c.alert}
|
|
4061
4373
|
<div class="alert-body">
|
|
4062
4374
|
${this.t("mfaNoFactorWarning")}
|
|
4063
|
-
${this.factors?.totp ?
|
|
4375
|
+
${this.factors?.totp ? o : r`<div class="links">
|
|
4064
4376
|
<button
|
|
4065
4377
|
type="button"
|
|
4066
4378
|
class="btn btn-link"
|
|
@@ -4071,14 +4383,14 @@ let u = class extends A {
|
|
|
4071
4383
|
</button>
|
|
4072
4384
|
</div>`}
|
|
4073
4385
|
</div>
|
|
4074
|
-
</div>` :
|
|
4386
|
+
</div>` : o}
|
|
4075
4387
|
${this.error("mfa")}
|
|
4076
4388
|
<div class="separator"></div>
|
|
4077
4389
|
<div class="toggle-row">
|
|
4078
4390
|
<div class="row-main">
|
|
4079
4391
|
<span class="row-title"
|
|
4080
|
-
>${
|
|
4081
|
-
${t ? this.verifiedBadge(!0) :
|
|
4392
|
+
>${c.smartphone} ${this.t("authenticatorApp")}
|
|
4393
|
+
${t ? this.verifiedBadge(!0) : o}</span
|
|
4082
4394
|
>
|
|
4083
4395
|
</div>
|
|
4084
4396
|
${t ? this.confirmRemoveAuthenticator ? r`<div class="inline">
|
|
@@ -4101,7 +4413,7 @@ let u = class extends A {
|
|
|
4101
4413
|
?disabled=${!!this.busy}
|
|
4102
4414
|
>
|
|
4103
4415
|
${this.spinner("remove-authenticator")} ${this.t("remove")}
|
|
4104
|
-
</button>` : this.authenticator ?
|
|
4416
|
+
</button>` : this.authenticator ? o : r`<button
|
|
4105
4417
|
class="btn btn-outline btn-sm"
|
|
4106
4418
|
@click=${this.onAddAuthenticator}
|
|
4107
4419
|
?disabled=${!!this.busy}
|
|
@@ -4125,7 +4437,7 @@ let u = class extends A {
|
|
|
4125
4437
|
this.onCopySecret();
|
|
4126
4438
|
}}
|
|
4127
4439
|
>
|
|
4128
|
-
${this.copied ?
|
|
4440
|
+
${this.copied ? c.check : c.copy}
|
|
4129
4441
|
${this.copied ? this.t("copied") : this.t("authenticatorCopyKey")}
|
|
4130
4442
|
</button>
|
|
4131
4443
|
</div>
|
|
@@ -4156,7 +4468,7 @@ let u = class extends A {
|
|
|
4156
4468
|
${this.t("cancel")}
|
|
4157
4469
|
</button>
|
|
4158
4470
|
</div>
|
|
4159
|
-
</form>` :
|
|
4471
|
+
</form>` : o}
|
|
4160
4472
|
</div>`
|
|
4161
4473
|
);
|
|
4162
4474
|
}
|
|
@@ -4167,7 +4479,7 @@ let u = class extends A {
|
|
|
4167
4479
|
this.t("recoveryCodesDescription") + " " + this.t("recoveryCodesOnceHint"),
|
|
4168
4480
|
r`<div class="kv">
|
|
4169
4481
|
${this.recoveryCodes ? r`<div class="alert alert-warning">
|
|
4170
|
-
${
|
|
4482
|
+
${c.alert}
|
|
4171
4483
|
<div class="alert-body">${this.t("recoveryCodesWarning")}</div>
|
|
4172
4484
|
</div>
|
|
4173
4485
|
<div class="codes">
|
|
@@ -4175,7 +4487,7 @@ let u = class extends A {
|
|
|
4175
4487
|
</div>
|
|
4176
4488
|
<div class="inline">
|
|
4177
4489
|
<button class="btn btn-outline btn-sm" @click=${this.onCopyCodes}>
|
|
4178
|
-
${this.copied ?
|
|
4490
|
+
${this.copied ? c.check : c.copy}
|
|
4179
4491
|
${this.copied ? this.t("copied") : this.t("copy")}
|
|
4180
4492
|
</button>
|
|
4181
4493
|
<button class="btn btn-ghost btn-sm" @click=${() => this.recoveryCodes = null}>
|
|
@@ -4187,7 +4499,7 @@ let u = class extends A {
|
|
|
4187
4499
|
@click=${this.onRecoveryCodes}
|
|
4188
4500
|
?disabled=${!!this.busy}
|
|
4189
4501
|
>
|
|
4190
|
-
${this.spinner("recovery")} ${
|
|
4502
|
+
${this.spinner("recovery")} ${c.key}
|
|
4191
4503
|
${e ? this.t("viewRecoveryCodes") : this.t("generateRecoveryCodes")}
|
|
4192
4504
|
</button>
|
|
4193
4505
|
${e ? this.confirmRegenerate ? r`<div class="inline">
|
|
@@ -4196,7 +4508,7 @@ let u = class extends A {
|
|
|
4196
4508
|
@click=${this.onRegenerateRecoveryCodes}
|
|
4197
4509
|
?disabled=${!!this.busy}
|
|
4198
4510
|
>
|
|
4199
|
-
${
|
|
4511
|
+
${c.refresh} ${this.t("regenerateRecoveryCodes")}
|
|
4200
4512
|
</button>
|
|
4201
4513
|
<button
|
|
4202
4514
|
class="btn btn-ghost btn-sm"
|
|
@@ -4209,8 +4521,8 @@ let u = class extends A {
|
|
|
4209
4521
|
@click=${this.onRegenerateRecoveryCodes}
|
|
4210
4522
|
?disabled=${!!this.busy}
|
|
4211
4523
|
>
|
|
4212
|
-
${
|
|
4213
|
-
</button>` :
|
|
4524
|
+
${c.refresh} ${this.t("regenerateRecoveryCodes")}
|
|
4525
|
+
</button>` : o}
|
|
4214
4526
|
</div>`}
|
|
4215
4527
|
${this.error("recovery")}
|
|
4216
4528
|
</div>`
|
|
@@ -4221,25 +4533,25 @@ let u = class extends A {
|
|
|
4221
4533
|
const e = this.stepUp, t = this.factors, i = [
|
|
4222
4534
|
{
|
|
4223
4535
|
factor: "totp",
|
|
4224
|
-
icon:
|
|
4536
|
+
icon: c.smartphone,
|
|
4225
4537
|
label: this.t("mfaUseAuthenticator"),
|
|
4226
4538
|
available: t?.totp ?? !0
|
|
4227
4539
|
},
|
|
4228
4540
|
{
|
|
4229
4541
|
factor: "email",
|
|
4230
|
-
icon:
|
|
4542
|
+
icon: c.mail,
|
|
4231
4543
|
label: this.t("mfaUseEmail"),
|
|
4232
4544
|
available: t?.email ?? !0
|
|
4233
4545
|
},
|
|
4234
4546
|
{
|
|
4235
4547
|
factor: "phone",
|
|
4236
|
-
icon:
|
|
4548
|
+
icon: c.phone,
|
|
4237
4549
|
label: this.t("mfaUsePhone"),
|
|
4238
4550
|
available: t?.phone ?? !0
|
|
4239
4551
|
},
|
|
4240
4552
|
{
|
|
4241
4553
|
factor: "recoverycode",
|
|
4242
|
-
icon:
|
|
4554
|
+
icon: c.key,
|
|
4243
4555
|
label: this.t("mfaUseRecoveryCode"),
|
|
4244
4556
|
available: t?.recoveryCode ?? !0
|
|
4245
4557
|
}
|
|
@@ -4290,7 +4602,7 @@ let u = class extends A {
|
|
|
4290
4602
|
// ── Sessions ──
|
|
4291
4603
|
deviceIcon(e) {
|
|
4292
4604
|
const t = (e.deviceName || "").toLowerCase(), i = (e.osName || e.osCode || "").toLowerCase();
|
|
4293
|
-
return /phone|tablet|mobile/.test(t) || /ios|android|ipados/.test(i) ?
|
|
4605
|
+
return /phone|tablet|mobile/.test(t) || /ios|android|ipados/.test(i) ? c.smartphone : /desktop|browser/.test(t) || /mac|windows|linux|chrome os/.test(i) ? c.monitor : c.globe;
|
|
4294
4606
|
}
|
|
4295
4607
|
renderSessions() {
|
|
4296
4608
|
const e = this.sessions;
|
|
@@ -4306,8 +4618,8 @@ let u = class extends A {
|
|
|
4306
4618
|
<div class="row-main">
|
|
4307
4619
|
<span class="row-title">
|
|
4308
4620
|
${t.clientName || t.provider}
|
|
4309
|
-
${t.clientVersion ? r`<span class="muted small">${t.clientVersion}</span>` :
|
|
4310
|
-
${t.current ? r`<span class="badge badge-info">${this.t("currentSession")}</span>` :
|
|
4621
|
+
${t.clientVersion ? r`<span class="muted small">${t.clientVersion}</span>` : o}
|
|
4622
|
+
${t.current ? r`<span class="badge badge-info">${this.t("currentSession")}</span>` : o}
|
|
4311
4623
|
</span>
|
|
4312
4624
|
<span class="row-sub"
|
|
4313
4625
|
>${[t.osName, t.countryName || t.countryCode, t.ip].filter(Boolean).join(" · ")}</span
|
|
@@ -4315,14 +4627,14 @@ let u = class extends A {
|
|
|
4315
4627
|
</div>
|
|
4316
4628
|
</div>
|
|
4317
4629
|
<div class="row-actions">
|
|
4318
|
-
${this.busy === `session-${t.$id}` ? r`<span class="spinner"></span>` :
|
|
4630
|
+
${this.busy === `session-${t.$id}` ? r`<span class="spinner"></span>` : o}
|
|
4319
4631
|
<button
|
|
4320
4632
|
class="btn btn-ghost btn-sm"
|
|
4321
4633
|
@click=${() => this.onDeleteSession(t.$id)}
|
|
4322
4634
|
?disabled=${!!this.busy}
|
|
4323
4635
|
aria-label=${this.t("signOutSession")}
|
|
4324
4636
|
>
|
|
4325
|
-
${
|
|
4637
|
+
${c.logOut}
|
|
4326
4638
|
</button>
|
|
4327
4639
|
</div>
|
|
4328
4640
|
</div>`
|
|
@@ -4338,7 +4650,7 @@ let u = class extends A {
|
|
|
4338
4650
|
@click=${this.onSignOutAll}
|
|
4339
4651
|
?disabled=${!!this.busy}
|
|
4340
4652
|
>
|
|
4341
|
-
${this.spinner("sessions-all")} ${
|
|
4653
|
+
${this.spinner("sessions-all")} ${c.logOut} ${this.t("signOutAllSessions")}
|
|
4342
4654
|
</button>
|
|
4343
4655
|
<button
|
|
4344
4656
|
class="btn btn-ghost btn-sm"
|
|
@@ -4351,7 +4663,7 @@ let u = class extends A {
|
|
|
4351
4663
|
@click=${this.onSignOutAll}
|
|
4352
4664
|
?disabled=${!!this.busy}
|
|
4353
4665
|
>
|
|
4354
|
-
${this.spinner("sessions-all")} ${
|
|
4666
|
+
${this.spinner("sessions-all")} ${c.logOut} ${this.t("signOutAllSessions")}
|
|
4355
4667
|
</button>`}`,
|
|
4356
4668
|
void 0,
|
|
4357
4669
|
!0
|
|
@@ -4369,9 +4681,9 @@ let u = class extends A {
|
|
|
4369
4681
|
${e === null ? r`<div class="empty"><span class="spinner"></span></div>` : e.length === 0 ? r`<div class="empty">${this.t("noConnections")}</div>` : e.map(
|
|
4370
4682
|
(i) => r`<div class="row">
|
|
4371
4683
|
<div class="inline">
|
|
4372
|
-
<span class="device">${
|
|
4684
|
+
<span class="device">${et(i.provider)}</span>
|
|
4373
4685
|
<div class="row-main">
|
|
4374
|
-
<span class="row-title">${
|
|
4686
|
+
<span class="row-title">${q(i.provider)}</span>
|
|
4375
4687
|
<span class="row-sub">${i.providerEmail || i.providerUid}</span>
|
|
4376
4688
|
</div>
|
|
4377
4689
|
</div>
|
|
@@ -4382,7 +4694,7 @@ let u = class extends A {
|
|
|
4382
4694
|
@click=${() => this.onDeleteIdentity(i.$id)}
|
|
4383
4695
|
?disabled=${!!this.busy}
|
|
4384
4696
|
>
|
|
4385
|
-
${this.busy === `identity-${i.$id}` ? r`<span class="spinner"></span>` :
|
|
4697
|
+
${this.busy === `identity-${i.$id}` ? r`<span class="spinner"></span>` : o}
|
|
4386
4698
|
${this.t("disconnect")}
|
|
4387
4699
|
</button>
|
|
4388
4700
|
<button
|
|
@@ -4396,7 +4708,7 @@ let u = class extends A {
|
|
|
4396
4708
|
@click=${() => this.onDeleteIdentity(i.$id)}
|
|
4397
4709
|
?disabled=${!!this.busy}
|
|
4398
4710
|
>
|
|
4399
|
-
${this.busy === `identity-${i.$id}` ? r`<span class="spinner"></span>` :
|
|
4711
|
+
${this.busy === `identity-${i.$id}` ? r`<span class="spinner"></span>` : o}
|
|
4400
4712
|
${this.t("disconnect")}
|
|
4401
4713
|
</button>`}
|
|
4402
4714
|
</div>
|
|
@@ -4410,8 +4722,8 @@ let u = class extends A {
|
|
|
4410
4722
|
}}
|
|
4411
4723
|
?disabled=${!!this.busy}
|
|
4412
4724
|
>
|
|
4413
|
-
${this.spinner(`connect-${i}`)} ${
|
|
4414
|
-
${this.t("connectProvider", { provider:
|
|
4725
|
+
${this.spinner(`connect-${i}`)} ${et(i)}
|
|
4726
|
+
${this.t("connectProvider", { provider: q(i) })}
|
|
4415
4727
|
</button>`
|
|
4416
4728
|
)}` : void 0
|
|
4417
4729
|
)}
|
|
@@ -4439,9 +4751,9 @@ let u = class extends A {
|
|
|
4439
4751
|
</div>`;
|
|
4440
4752
|
}
|
|
4441
4753
|
};
|
|
4442
|
-
|
|
4443
|
-
...
|
|
4444
|
-
|
|
4754
|
+
p.styles = [
|
|
4755
|
+
...P.styles,
|
|
4756
|
+
F`
|
|
4445
4757
|
:host {
|
|
4446
4758
|
display: block;
|
|
4447
4759
|
width: 100%;
|
|
@@ -4537,117 +4849,117 @@ u.styles = [
|
|
|
4537
4849
|
}
|
|
4538
4850
|
`
|
|
4539
4851
|
];
|
|
4540
|
-
|
|
4541
|
-
|
|
4542
|
-
],
|
|
4543
|
-
|
|
4544
|
-
|
|
4545
|
-
],
|
|
4546
|
-
|
|
4547
|
-
|
|
4548
|
-
],
|
|
4549
|
-
|
|
4550
|
-
|
|
4551
|
-
],
|
|
4552
|
-
|
|
4553
|
-
|
|
4554
|
-
],
|
|
4555
|
-
|
|
4556
|
-
|
|
4557
|
-
],
|
|
4558
|
-
|
|
4559
|
-
|
|
4560
|
-
],
|
|
4561
|
-
|
|
4562
|
-
|
|
4563
|
-
],
|
|
4564
|
-
|
|
4565
|
-
|
|
4566
|
-
],
|
|
4567
|
-
|
|
4568
|
-
|
|
4569
|
-
],
|
|
4570
|
-
|
|
4571
|
-
|
|
4572
|
-
],
|
|
4573
|
-
|
|
4574
|
-
|
|
4575
|
-
],
|
|
4576
|
-
|
|
4577
|
-
|
|
4578
|
-
],
|
|
4579
|
-
|
|
4580
|
-
|
|
4581
|
-
],
|
|
4582
|
-
|
|
4583
|
-
|
|
4584
|
-
],
|
|
4585
|
-
|
|
4586
|
-
|
|
4587
|
-
],
|
|
4588
|
-
|
|
4589
|
-
|
|
4590
|
-
],
|
|
4591
|
-
|
|
4592
|
-
|
|
4593
|
-
],
|
|
4594
|
-
|
|
4595
|
-
|
|
4596
|
-
],
|
|
4597
|
-
|
|
4598
|
-
|
|
4599
|
-
],
|
|
4600
|
-
|
|
4601
|
-
|
|
4602
|
-
],
|
|
4603
|
-
|
|
4604
|
-
|
|
4605
|
-
],
|
|
4606
|
-
|
|
4607
|
-
|
|
4608
|
-
],
|
|
4609
|
-
|
|
4610
|
-
|
|
4611
|
-
],
|
|
4612
|
-
|
|
4613
|
-
|
|
4614
|
-
],
|
|
4615
|
-
|
|
4616
|
-
|
|
4617
|
-
],
|
|
4618
|
-
|
|
4619
|
-
|
|
4620
|
-
],
|
|
4621
|
-
|
|
4622
|
-
|
|
4623
|
-
],
|
|
4624
|
-
|
|
4625
|
-
|
|
4626
|
-
],
|
|
4627
|
-
|
|
4628
|
-
|
|
4629
|
-
],
|
|
4630
|
-
|
|
4631
|
-
|
|
4632
|
-
],
|
|
4633
|
-
|
|
4634
|
-
|
|
4635
|
-
],
|
|
4636
|
-
|
|
4637
|
-
|
|
4638
|
-
],
|
|
4639
|
-
|
|
4640
|
-
|
|
4641
|
-
],
|
|
4642
|
-
|
|
4852
|
+
m([
|
|
4853
|
+
g({ type: Boolean })
|
|
4854
|
+
], p.prototype, "embedded", 2);
|
|
4855
|
+
m([
|
|
4856
|
+
g({ type: String })
|
|
4857
|
+
], p.prototype, "tab", 2);
|
|
4858
|
+
m([
|
|
4859
|
+
h()
|
|
4860
|
+
], p.prototype, "active", 2);
|
|
4861
|
+
m([
|
|
4862
|
+
h()
|
|
4863
|
+
], p.prototype, "busy", 2);
|
|
4864
|
+
m([
|
|
4865
|
+
h()
|
|
4866
|
+
], p.prototype, "notice", 2);
|
|
4867
|
+
m([
|
|
4868
|
+
h()
|
|
4869
|
+
], p.prototype, "errors", 2);
|
|
4870
|
+
m([
|
|
4871
|
+
h()
|
|
4872
|
+
], p.prototype, "nameInput", 2);
|
|
4873
|
+
m([
|
|
4874
|
+
h()
|
|
4875
|
+
], p.prototype, "emailInput", 2);
|
|
4876
|
+
m([
|
|
4877
|
+
h()
|
|
4878
|
+
], p.prototype, "emailPassword", 2);
|
|
4879
|
+
m([
|
|
4880
|
+
h()
|
|
4881
|
+
], p.prototype, "phoneInput", 2);
|
|
4882
|
+
m([
|
|
4883
|
+
h()
|
|
4884
|
+
], p.prototype, "phonePassword", 2);
|
|
4885
|
+
m([
|
|
4886
|
+
h()
|
|
4887
|
+
], p.prototype, "phoneCode", 2);
|
|
4888
|
+
m([
|
|
4889
|
+
h()
|
|
4890
|
+
], p.prototype, "phoneCodeSent", 2);
|
|
4891
|
+
m([
|
|
4892
|
+
h()
|
|
4893
|
+
], p.prototype, "guestName", 2);
|
|
4894
|
+
m([
|
|
4895
|
+
h()
|
|
4896
|
+
], p.prototype, "oldPassword", 2);
|
|
4897
|
+
m([
|
|
4898
|
+
h()
|
|
4899
|
+
], p.prototype, "newPassword", 2);
|
|
4900
|
+
m([
|
|
4901
|
+
h()
|
|
4902
|
+
], p.prototype, "newPasswordConfirm", 2);
|
|
4903
|
+
m([
|
|
4904
|
+
h()
|
|
4905
|
+
], p.prototype, "authenticator", 2);
|
|
4906
|
+
m([
|
|
4907
|
+
h()
|
|
4908
|
+
], p.prototype, "authenticatorCode", 2);
|
|
4909
|
+
m([
|
|
4910
|
+
h()
|
|
4911
|
+
], p.prototype, "factors", 2);
|
|
4912
|
+
m([
|
|
4913
|
+
h()
|
|
4914
|
+
], p.prototype, "recoveryCodes", 2);
|
|
4915
|
+
m([
|
|
4916
|
+
h()
|
|
4917
|
+
], p.prototype, "stepUp", 2);
|
|
4918
|
+
m([
|
|
4919
|
+
h()
|
|
4920
|
+
], p.prototype, "stepUpCode", 2);
|
|
4921
|
+
m([
|
|
4922
|
+
h()
|
|
4923
|
+
], p.prototype, "copied", 2);
|
|
4924
|
+
m([
|
|
4925
|
+
h()
|
|
4926
|
+
], p.prototype, "sessions", 2);
|
|
4927
|
+
m([
|
|
4928
|
+
h()
|
|
4929
|
+
], p.prototype, "identities", 2);
|
|
4930
|
+
m([
|
|
4931
|
+
h()
|
|
4932
|
+
], p.prototype, "logs", 2);
|
|
4933
|
+
m([
|
|
4934
|
+
h()
|
|
4935
|
+
], p.prototype, "logsSupported", 2);
|
|
4936
|
+
m([
|
|
4937
|
+
h()
|
|
4938
|
+
], p.prototype, "confirmDelete", 2);
|
|
4939
|
+
m([
|
|
4940
|
+
h()
|
|
4941
|
+
], p.prototype, "confirmRegenerate", 2);
|
|
4942
|
+
m([
|
|
4943
|
+
h()
|
|
4944
|
+
], p.prototype, "confirmRemoveAuthenticator", 2);
|
|
4945
|
+
m([
|
|
4946
|
+
h()
|
|
4947
|
+
], p.prototype, "confirmSignOutAll", 2);
|
|
4948
|
+
m([
|
|
4949
|
+
h()
|
|
4950
|
+
], p.prototype, "confirmDisconnectId", 2);
|
|
4951
|
+
m([
|
|
4952
|
+
h()
|
|
4953
|
+
], p.prototype, "verifyEmailCooldownUntil", 2);
|
|
4954
|
+
p = m([
|
|
4643
4955
|
O("authui-account")
|
|
4644
|
-
],
|
|
4645
|
-
var
|
|
4646
|
-
for (var a = s > 1 ? void 0 : s ?
|
|
4647
|
-
(
|
|
4648
|
-
return s && a &&
|
|
4956
|
+
], p);
|
|
4957
|
+
var Zt = Object.defineProperty, Xt = Object.getOwnPropertyDescriptor, L = (e, t, i, s) => {
|
|
4958
|
+
for (var a = s > 1 ? void 0 : s ? Xt(t, i) : t, l = e.length - 1, u; l >= 0; l--)
|
|
4959
|
+
(u = e[l]) && (a = (s ? u(t, i, a) : u(a)) || a);
|
|
4960
|
+
return s && a && Zt(t, i, a), a;
|
|
4649
4961
|
};
|
|
4650
|
-
let M = class extends
|
|
4962
|
+
let M = class extends P {
|
|
4651
4963
|
constructor() {
|
|
4652
4964
|
super(...arguments), this.open = !1, this.view = "sign-in", this.closeOnSuccess = !0, this.handledPending = null, this.onOpenEvent = (e) => {
|
|
4653
4965
|
const t = e.detail ?? {};
|
|
@@ -4707,20 +5019,20 @@ let M = class extends A {
|
|
|
4707
5019
|
@click=${this.hide}
|
|
4708
5020
|
aria-label=${this.t("close")}
|
|
4709
5021
|
>
|
|
4710
|
-
${
|
|
5022
|
+
${c.x}
|
|
4711
5023
|
</button>
|
|
4712
5024
|
${this.open ? t ? r`<authui-account embedded></authui-account>` : r`<authui-sign-in
|
|
4713
5025
|
embedded
|
|
4714
5026
|
.view=${this.view === "account" ? "sign-in" : this.view}
|
|
4715
|
-
></authui-sign-in>` :
|
|
5027
|
+
></authui-sign-in>` : o}
|
|
4716
5028
|
</div>
|
|
4717
5029
|
</dialog>
|
|
4718
5030
|
`;
|
|
4719
5031
|
}
|
|
4720
5032
|
};
|
|
4721
5033
|
M.styles = [
|
|
4722
|
-
...
|
|
4723
|
-
|
|
5034
|
+
...P.styles,
|
|
5035
|
+
F`
|
|
4724
5036
|
:host {
|
|
4725
5037
|
display: contents;
|
|
4726
5038
|
}
|
|
@@ -4780,30 +5092,30 @@ M.styles = [
|
|
|
4780
5092
|
}
|
|
4781
5093
|
`
|
|
4782
5094
|
];
|
|
4783
|
-
|
|
4784
|
-
|
|
5095
|
+
L([
|
|
5096
|
+
g({ type: Boolean, reflect: !0 })
|
|
4785
5097
|
], M.prototype, "open", 2);
|
|
4786
|
-
|
|
4787
|
-
|
|
5098
|
+
L([
|
|
5099
|
+
g({ type: String })
|
|
4788
5100
|
], M.prototype, "view", 2);
|
|
4789
|
-
|
|
4790
|
-
|
|
5101
|
+
L([
|
|
5102
|
+
g({ type: Boolean, attribute: "close-on-success" })
|
|
4791
5103
|
], M.prototype, "closeOnSuccess", 2);
|
|
4792
|
-
|
|
4793
|
-
|
|
5104
|
+
L([
|
|
5105
|
+
h()
|
|
4794
5106
|
], M.prototype, "handledPending", 2);
|
|
4795
|
-
|
|
4796
|
-
|
|
5107
|
+
L([
|
|
5108
|
+
bt("dialog")
|
|
4797
5109
|
], M.prototype, "dialog", 2);
|
|
4798
|
-
M =
|
|
5110
|
+
M = L([
|
|
4799
5111
|
O("authui-modal")
|
|
4800
5112
|
], M);
|
|
4801
|
-
var
|
|
4802
|
-
for (var a = s > 1 ? void 0 : s ?
|
|
4803
|
-
(
|
|
4804
|
-
return s && a &&
|
|
5113
|
+
var Qt = Object.defineProperty, Jt = Object.getOwnPropertyDescriptor, X = (e, t, i, s) => {
|
|
5114
|
+
for (var a = s > 1 ? void 0 : s ? Jt(t, i) : t, l = e.length - 1, u; l >= 0; l--)
|
|
5115
|
+
(u = e[l]) && (a = (s ? u(t, i, a) : u(a)) || a);
|
|
5116
|
+
return s && a && Qt(t, i, a), a;
|
|
4805
5117
|
};
|
|
4806
|
-
let
|
|
5118
|
+
let z = class extends P {
|
|
4807
5119
|
constructor() {
|
|
4808
5120
|
super(...arguments), this.view = "sign-in", this.variant = "primary", this.size = "md";
|
|
4809
5121
|
}
|
|
@@ -4811,7 +5123,7 @@ let D = class extends A {
|
|
|
4811
5123
|
const e = this.size === "md" ? "" : `btn-${this.size}`;
|
|
4812
5124
|
return r`<button
|
|
4813
5125
|
class="btn btn-${this.variant} ${e}"
|
|
4814
|
-
@click=${() =>
|
|
5126
|
+
@click=${() => Y(this.view)}
|
|
4815
5127
|
part="button"
|
|
4816
5128
|
>
|
|
4817
5129
|
<slot
|
|
@@ -4820,9 +5132,9 @@ let D = class extends A {
|
|
|
4820
5132
|
</button>`;
|
|
4821
5133
|
}
|
|
4822
5134
|
};
|
|
4823
|
-
|
|
4824
|
-
...
|
|
4825
|
-
|
|
5135
|
+
z.styles = [
|
|
5136
|
+
...P.styles,
|
|
5137
|
+
F`
|
|
4826
5138
|
:host {
|
|
4827
5139
|
display: inline-block;
|
|
4828
5140
|
}
|
|
@@ -4831,26 +5143,26 @@ D.styles = [
|
|
|
4831
5143
|
}
|
|
4832
5144
|
`
|
|
4833
5145
|
];
|
|
4834
|
-
|
|
4835
|
-
|
|
4836
|
-
],
|
|
4837
|
-
|
|
4838
|
-
|
|
4839
|
-
],
|
|
4840
|
-
|
|
4841
|
-
|
|
4842
|
-
],
|
|
4843
|
-
|
|
5146
|
+
X([
|
|
5147
|
+
g({ type: String })
|
|
5148
|
+
], z.prototype, "view", 2);
|
|
5149
|
+
X([
|
|
5150
|
+
g({ type: String })
|
|
5151
|
+
], z.prototype, "variant", 2);
|
|
5152
|
+
X([
|
|
5153
|
+
g({ type: String })
|
|
5154
|
+
], z.prototype, "size", 2);
|
|
5155
|
+
z = X([
|
|
4844
5156
|
O("authui-button")
|
|
4845
|
-
],
|
|
4846
|
-
var
|
|
4847
|
-
for (var a = s > 1 ? void 0 : s ?
|
|
4848
|
-
(
|
|
4849
|
-
return s && a &&
|
|
5157
|
+
], z);
|
|
5158
|
+
var te = Object.defineProperty, ee = Object.getOwnPropertyDescriptor, _ = (e, t, i, s) => {
|
|
5159
|
+
for (var a = s > 1 ? void 0 : s ? ee(t, i) : t, l = e.length - 1, u; l >= 0; l--)
|
|
5160
|
+
(u = e[l]) && (a = (s ? u(t, i, a) : u(a)) || a);
|
|
5161
|
+
return s && a && te(t, i, a), a;
|
|
4850
5162
|
};
|
|
4851
|
-
let
|
|
5163
|
+
let E = class extends P {
|
|
4852
5164
|
constructor() {
|
|
4853
|
-
super(...arguments), this.src = "", this.menuOpen = !1, this.onDocumentClick = (e) => {
|
|
5165
|
+
super(...arguments), this.showTeams = !1, this.src = "", this.menuOpen = !1, this.teams = [], this.teamsLoading = !1, this.activeTeamId = null, this.onDocumentClick = (e) => {
|
|
4854
5166
|
e.composedPath().includes(this) || (this.menuOpen = !1);
|
|
4855
5167
|
}, this.onKeydown = (e) => {
|
|
4856
5168
|
if (!this.menuOpen) {
|
|
@@ -4867,6 +5179,16 @@ let q = class extends A {
|
|
|
4867
5179
|
e.key === "ArrowDown" ? (e.preventDefault(), this.focusMenuItem(i < 0 ? 0 : (i + 1) % t.length)) : e.key === "ArrowUp" ? (e.preventDefault(), this.focusMenuItem(
|
|
4868
5180
|
i < 0 ? t.length - 1 : (i - 1 + t.length) % t.length
|
|
4869
5181
|
)) : e.key === "Home" ? (e.preventDefault(), this.focusMenuItem(0)) : e.key === "End" && (e.preventDefault(), this.focusMenuItem(t.length - 1));
|
|
5182
|
+
}, this.toggleMenu = () => {
|
|
5183
|
+
this.menuOpen = !this.menuOpen, this.menuOpen && this.showTeams && this.loadTeams();
|
|
5184
|
+
}, this.selectTeam = (e) => {
|
|
5185
|
+
n.setActiveTeam({ $id: e.$id, name: e.name }), this.activeTeamId = e.$id, this.dispatchEvent(
|
|
5186
|
+
new CustomEvent("authui-active-team", {
|
|
5187
|
+
detail: { teamId: e.$id, team: e },
|
|
5188
|
+
bubbles: !0,
|
|
5189
|
+
composed: !0
|
|
5190
|
+
})
|
|
5191
|
+
);
|
|
4870
5192
|
};
|
|
4871
5193
|
}
|
|
4872
5194
|
connectedCallback() {
|
|
@@ -4881,42 +5203,69 @@ let q = class extends A {
|
|
|
4881
5203
|
][e]?.focus();
|
|
4882
5204
|
}
|
|
4883
5205
|
updated(e) {
|
|
4884
|
-
e.has("menuOpen") && this.menuOpen && requestAnimationFrame(() => this.focusMenuItem(0));
|
|
5206
|
+
e.has("menuOpen") && this.menuOpen && (this.showTeams && this.loadTeams(), requestAnimationFrame(() => this.focusMenuItem(0)));
|
|
5207
|
+
}
|
|
5208
|
+
async loadTeams() {
|
|
5209
|
+
this.teamsLoading = !0, this.activeTeamId = n.getActiveTeamId();
|
|
5210
|
+
try {
|
|
5211
|
+
this.teams = await n.listTeams(), this.activeTeamId && !this.teams.some((e) => e.$id === this.activeTeamId) && (this.activeTeamId = null, n.setActiveTeam(null));
|
|
5212
|
+
} catch {
|
|
5213
|
+
this.teams = [];
|
|
5214
|
+
} finally {
|
|
5215
|
+
this.teamsLoading = !1;
|
|
5216
|
+
}
|
|
4885
5217
|
}
|
|
4886
5218
|
render() {
|
|
4887
|
-
const { status: e, user: t } = this.auth;
|
|
4888
|
-
if (e === "loading")
|
|
5219
|
+
const { status: e, user: t, configured: i } = this.auth;
|
|
5220
|
+
if (e === "loading" && i)
|
|
4889
5221
|
return r`<span class="avatar"><span class="spinner"></span></span>`;
|
|
4890
5222
|
if (e !== "signed-in" || !t)
|
|
4891
|
-
return r`<button class="btn btn-primary btn-sm" @click=${() =>
|
|
5223
|
+
return r`<button class="btn btn-primary btn-sm" @click=${() => Y("sign-in")}>
|
|
4892
5224
|
<slot>${this.t("signIn")}</slot>
|
|
4893
5225
|
</button>`;
|
|
4894
|
-
const
|
|
5226
|
+
const s = t.name || t.email || t.phone || this.t("guestAccount");
|
|
4895
5227
|
return r`
|
|
4896
5228
|
<button
|
|
4897
5229
|
class="trigger"
|
|
4898
5230
|
aria-haspopup="menu"
|
|
4899
5231
|
aria-expanded=${this.menuOpen ? "true" : "false"}
|
|
4900
|
-
@click=${
|
|
4901
|
-
aria-label=${
|
|
5232
|
+
@click=${this.toggleMenu}
|
|
5233
|
+
aria-label=${s}
|
|
4902
5234
|
>
|
|
4903
5235
|
<span class="avatar"
|
|
4904
|
-
>${this.src ? r`<img src=${this.src} alt="" />` :
|
|
5236
|
+
>${this.src ? r`<img src=${this.src} alt="" />` : at(s)}</span
|
|
4905
5237
|
>
|
|
4906
5238
|
</button>
|
|
4907
5239
|
${this.menuOpen ? r`<div class="menu" role="menu">
|
|
4908
5240
|
<div class="menu-header">
|
|
4909
|
-
<span class="row-title" title=${
|
|
4910
|
-
${t.email && t.name ? r`<span class="row-sub" title=${t.email}>${t.email}</span>` :
|
|
5241
|
+
<span class="row-title" title=${s}>${s}</span>
|
|
5242
|
+
${t.email && t.name ? r`<span class="row-sub" title=${t.email}>${t.email}</span>` : o}
|
|
4911
5243
|
</div>
|
|
5244
|
+
${this.showTeams ? r`<div class="menu-section">
|
|
5245
|
+
<div class="menu-section-label">${this.t("teamsLabel")}</div>
|
|
5246
|
+
${this.teamsLoading ? r`<div class="menu-item" aria-busy="true">
|
|
5247
|
+
<span class="spinner"></span>
|
|
5248
|
+
</div>` : this.teams.length === 0 ? r`<div class="menu-item" role="note">${this.t("noTeams")}</div>` : this.teams.map(
|
|
5249
|
+
(a) => r`<button
|
|
5250
|
+
class="menu-item ${a.$id === this.activeTeamId ? "active" : ""}"
|
|
5251
|
+
role="menuitemradio"
|
|
5252
|
+
aria-checked=${a.$id === this.activeTeamId ? "true" : "false"}
|
|
5253
|
+
@click=${() => this.selectTeam(a)}
|
|
5254
|
+
>
|
|
5255
|
+
${c.users}
|
|
5256
|
+
<span title=${a.name}>${a.name}</span>
|
|
5257
|
+
${a.$id === this.activeTeamId ? r`<span class="check">${c.check}</span>` : o}
|
|
5258
|
+
</button>`
|
|
5259
|
+
)}
|
|
5260
|
+
</div>` : o}
|
|
4912
5261
|
<button
|
|
4913
5262
|
class="menu-item"
|
|
4914
5263
|
role="menuitem"
|
|
4915
5264
|
@click=${() => {
|
|
4916
|
-
this.menuOpen = !1,
|
|
5265
|
+
this.menuOpen = !1, Y("account");
|
|
4917
5266
|
}}
|
|
4918
5267
|
>
|
|
4919
|
-
${
|
|
5268
|
+
${c.settings} ${this.t("manageAccount")}
|
|
4920
5269
|
</button>
|
|
4921
5270
|
<button
|
|
4922
5271
|
class="menu-item"
|
|
@@ -4925,15 +5274,15 @@ let q = class extends A {
|
|
|
4925
5274
|
this.menuOpen = !1, n.signOut();
|
|
4926
5275
|
}}
|
|
4927
5276
|
>
|
|
4928
|
-
${
|
|
5277
|
+
${c.logOut} ${this.t("signOut")}
|
|
4929
5278
|
</button>
|
|
4930
|
-
</div>` :
|
|
5279
|
+
</div>` : o}
|
|
4931
5280
|
`;
|
|
4932
5281
|
}
|
|
4933
5282
|
};
|
|
4934
|
-
|
|
4935
|
-
...
|
|
4936
|
-
|
|
5283
|
+
E.styles = [
|
|
5284
|
+
...P.styles,
|
|
5285
|
+
F`
|
|
4937
5286
|
:host {
|
|
4938
5287
|
display: inline-block;
|
|
4939
5288
|
position: relative;
|
|
@@ -5015,6 +5364,26 @@ q.styles = [
|
|
|
5015
5364
|
height: 16px;
|
|
5016
5365
|
color: var(--authui-muted-foreground);
|
|
5017
5366
|
}
|
|
5367
|
+
.menu-section {
|
|
5368
|
+
border-top: 1px solid var(--authui-border);
|
|
5369
|
+
margin-top: 4px;
|
|
5370
|
+
padding-top: 4px;
|
|
5371
|
+
}
|
|
5372
|
+
.menu-section-label {
|
|
5373
|
+
padding: 6px 10px 2px;
|
|
5374
|
+
font-size: 11px;
|
|
5375
|
+
font-weight: 600;
|
|
5376
|
+
letter-spacing: 0.04em;
|
|
5377
|
+
text-transform: uppercase;
|
|
5378
|
+
color: var(--authui-muted-foreground);
|
|
5379
|
+
}
|
|
5380
|
+
.menu-item.active {
|
|
5381
|
+
background: var(--authui-accent);
|
|
5382
|
+
}
|
|
5383
|
+
.menu-item .check {
|
|
5384
|
+
margin-inline-start: auto;
|
|
5385
|
+
color: var(--authui-brand);
|
|
5386
|
+
}
|
|
5018
5387
|
.avatar {
|
|
5019
5388
|
width: 32px;
|
|
5020
5389
|
height: 32px;
|
|
@@ -5022,32 +5391,56 @@ q.styles = [
|
|
|
5022
5391
|
}
|
|
5023
5392
|
`
|
|
5024
5393
|
];
|
|
5025
|
-
|
|
5026
|
-
|
|
5027
|
-
],
|
|
5028
|
-
|
|
5029
|
-
|
|
5030
|
-
],
|
|
5031
|
-
|
|
5394
|
+
_([
|
|
5395
|
+
g({ type: Boolean, attribute: "show-teams" })
|
|
5396
|
+
], E.prototype, "showTeams", 2);
|
|
5397
|
+
_([
|
|
5398
|
+
g({ type: String })
|
|
5399
|
+
], E.prototype, "src", 2);
|
|
5400
|
+
_([
|
|
5401
|
+
h()
|
|
5402
|
+
], E.prototype, "menuOpen", 2);
|
|
5403
|
+
_([
|
|
5404
|
+
h()
|
|
5405
|
+
], E.prototype, "teams", 2);
|
|
5406
|
+
_([
|
|
5407
|
+
h()
|
|
5408
|
+
], E.prototype, "teamsLoading", 2);
|
|
5409
|
+
_([
|
|
5410
|
+
h()
|
|
5411
|
+
], E.prototype, "activeTeamId", 2);
|
|
5412
|
+
E = _([
|
|
5032
5413
|
O("authui-user-button")
|
|
5033
|
-
],
|
|
5414
|
+
], E);
|
|
5034
5415
|
export {
|
|
5035
|
-
|
|
5036
|
-
|
|
5037
|
-
|
|
5416
|
+
Ft as A,
|
|
5417
|
+
oe as C,
|
|
5418
|
+
f as E,
|
|
5419
|
+
gt as F,
|
|
5420
|
+
Pt as P,
|
|
5038
5421
|
n as a,
|
|
5039
|
-
|
|
5040
|
-
|
|
5041
|
-
|
|
5422
|
+
p as b,
|
|
5423
|
+
ce as c,
|
|
5424
|
+
z as d,
|
|
5042
5425
|
b as e,
|
|
5043
|
-
|
|
5426
|
+
P as f,
|
|
5044
5427
|
M as g,
|
|
5045
|
-
|
|
5428
|
+
B as h,
|
|
5046
5429
|
$ as i,
|
|
5047
|
-
|
|
5048
|
-
|
|
5049
|
-
|
|
5050
|
-
|
|
5051
|
-
|
|
5052
|
-
|
|
5430
|
+
E as j,
|
|
5431
|
+
ne as k,
|
|
5432
|
+
ht as l,
|
|
5433
|
+
kt as m,
|
|
5434
|
+
K as n,
|
|
5435
|
+
Y as o,
|
|
5436
|
+
D as p,
|
|
5437
|
+
dt as q,
|
|
5438
|
+
Ut as r,
|
|
5439
|
+
q as s,
|
|
5440
|
+
V as t,
|
|
5441
|
+
yt as u,
|
|
5442
|
+
it as v,
|
|
5443
|
+
Et as w,
|
|
5444
|
+
Mt as x,
|
|
5445
|
+
R as y
|
|
5053
5446
|
};
|