@getauthui/core 0.1.9 → 0.1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/{authui-user-button-lt0fIem4.js → authui-user-button-BErNabVH.js} +847 -670
- package/dist/authui.cdn.js +320 -226
- package/dist/authui.cdn.mjs +896 -719
- package/dist/authui.js +2 -2
- package/dist/components/authui-config.d.ts +4 -0
- package/dist/components/authui-config.d.ts.map +1 -1
- package/dist/components/authui-sign-in.d.ts +12 -0
- 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/i18n.d.ts.map +1 -1
- package/dist/react/index.d.ts +4 -1
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react.js +56 -35
- package/dist/store.d.ts.map +1 -1
- package/dist/styles/base.d.ts.map +1 -1
- package/dist/types.d.ts +27 -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 c, property as m, customElement as T, query as at } from "lit/decorators.js";
|
|
2
|
+
import { css as L, LitElement as nt, nothing as n, html as r, svg as u } from "lit";
|
|
3
|
+
import { Client as ct, Account as dt, Teams as kt, ID as W, Avatars as Ct } from "appwrite";
|
|
4
|
+
const St = {
|
|
5
5
|
signIn: "Sign in",
|
|
6
6
|
dialogSignIn: "Sign in",
|
|
7
7
|
signUp: "Sign up",
|
|
@@ -171,15 +171,17 @@ const Ct = {
|
|
|
171
171
|
lastActive: "Last active",
|
|
172
172
|
guestAccount: "Guest account",
|
|
173
173
|
guestAccountDescription: "Add an email and password to keep your data.",
|
|
174
|
-
preview: "Preview"
|
|
174
|
+
preview: "Preview",
|
|
175
|
+
acceptLegal: "I agree to the",
|
|
176
|
+
errorLegalRequired: "Accept the terms to continue."
|
|
175
177
|
};
|
|
176
|
-
function
|
|
178
|
+
function At(e, t = {}) {
|
|
177
179
|
return e.replace(
|
|
178
180
|
/\{(\w+)\}/g,
|
|
179
181
|
(i, s) => s in t ? String(t[s]) : `{${s}}`
|
|
180
182
|
);
|
|
181
183
|
}
|
|
182
|
-
const
|
|
184
|
+
const Pt = {
|
|
183
185
|
amazon: "Amazon",
|
|
184
186
|
apple: "Apple",
|
|
185
187
|
appwrite: "Appwrite",
|
|
@@ -230,10 +232,10 @@ const At = {
|
|
|
230
232
|
zoho: "Zoho",
|
|
231
233
|
zoom: "Zoom"
|
|
232
234
|
};
|
|
233
|
-
function
|
|
234
|
-
return
|
|
235
|
+
function N(e) {
|
|
236
|
+
return Pt[e] ?? e.charAt(0).toUpperCase() + e.slice(1);
|
|
235
237
|
}
|
|
236
|
-
const
|
|
238
|
+
const K = (e, t, i = 401) => Object.assign(new Error(t), { type: e, code: i }), P = () => (/* @__PURE__ */ new Date()).toISOString(), M = (e) => new Date(Date.now() - e * 6e4).toISOString(), G = [
|
|
237
239
|
"amber",
|
|
238
240
|
"brave",
|
|
239
241
|
"calm",
|
|
@@ -246,13 +248,13 @@ const H = (e, t, i = 401) => Object.assign(new Error(t), { type: e, code: i }),
|
|
|
246
248
|
"juniper",
|
|
247
249
|
"kite",
|
|
248
250
|
"lumen"
|
|
249
|
-
],
|
|
251
|
+
], ht = () => `${G[Math.floor(Math.random() * G.length)]}-${G[Math.floor(Math.random() * G.length)]}`, D = () => Math.random().toString(36).slice(2, 12), ut = () => Array.from({ length: 2 }, () => Math.random().toString(36).slice(2, 7)).join("-"), Et = {
|
|
250
252
|
name: "Ada Lovelace",
|
|
251
253
|
email: "ada@example.com",
|
|
252
254
|
phone: "+15550100"
|
|
253
255
|
};
|
|
254
256
|
class It {
|
|
255
|
-
constructor(t =
|
|
257
|
+
constructor(t = Et) {
|
|
256
258
|
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;
|
|
257
259
|
}
|
|
258
260
|
// ───────────────────────── helpers ─────────────────────────
|
|
@@ -260,13 +262,13 @@ class It {
|
|
|
260
262
|
const i = t.anonymous ?? !1;
|
|
261
263
|
return this.user = {
|
|
262
264
|
$id: "preview-user",
|
|
263
|
-
$createdAt:
|
|
264
|
-
$updatedAt:
|
|
265
|
+
$createdAt: M(1440 * 30),
|
|
266
|
+
$updatedAt: P(),
|
|
265
267
|
name: i ? "" : t.name ?? this.seed.name,
|
|
266
|
-
registration:
|
|
268
|
+
registration: M(1440 * 30),
|
|
267
269
|
status: !0,
|
|
268
270
|
labels: [],
|
|
269
|
-
passwordUpdate: i ? "" :
|
|
271
|
+
passwordUpdate: i ? "" : M(1440 * 7),
|
|
270
272
|
email: i ? "" : t.email ?? this.seed.email,
|
|
271
273
|
phone: i ? "" : t.phone ?? this.seed.phone,
|
|
272
274
|
emailVerification: !i,
|
|
@@ -274,14 +276,14 @@ class It {
|
|
|
274
276
|
mfa: this.mfaEnabled,
|
|
275
277
|
prefs: {},
|
|
276
278
|
targets: [],
|
|
277
|
-
accessedAt:
|
|
279
|
+
accessedAt: P()
|
|
278
280
|
}, this.seedActivity(i ? "anonymous" : "email"), this.user;
|
|
279
281
|
}
|
|
280
282
|
seedActivity(t) {
|
|
281
283
|
if (this.sessions.length > 0) return;
|
|
282
284
|
const i = {
|
|
283
|
-
$createdAt:
|
|
284
|
-
$updatedAt:
|
|
285
|
+
$createdAt: P(),
|
|
286
|
+
$updatedAt: P(),
|
|
285
287
|
userId: "preview-user",
|
|
286
288
|
expire: new Date(Date.now() + 365 * 864e5).toISOString(),
|
|
287
289
|
providerUid: "",
|
|
@@ -317,7 +319,7 @@ class It {
|
|
|
317
319
|
{
|
|
318
320
|
...i,
|
|
319
321
|
$id: D(),
|
|
320
|
-
$createdAt:
|
|
322
|
+
$createdAt: M(300),
|
|
321
323
|
provider: t,
|
|
322
324
|
ip: "198.51.100.7",
|
|
323
325
|
osCode: "IOS",
|
|
@@ -334,7 +336,7 @@ class It {
|
|
|
334
336
|
{
|
|
335
337
|
...i,
|
|
336
338
|
$id: D(),
|
|
337
|
-
$createdAt:
|
|
339
|
+
$createdAt: M(1440 * 3),
|
|
338
340
|
provider: "oauth2",
|
|
339
341
|
ip: "192.0.2.90",
|
|
340
342
|
osCode: "WIN",
|
|
@@ -349,8 +351,8 @@ class It {
|
|
|
349
351
|
], this.identities = [
|
|
350
352
|
{
|
|
351
353
|
$id: "identity-github",
|
|
352
|
-
$createdAt:
|
|
353
|
-
$updatedAt:
|
|
354
|
+
$createdAt: M(1440 * 20),
|
|
355
|
+
$updatedAt: M(1440 * 20),
|
|
354
356
|
userId: "preview-user",
|
|
355
357
|
provider: "github",
|
|
356
358
|
providerUid: "8675309",
|
|
@@ -362,7 +364,7 @@ class It {
|
|
|
362
364
|
], this.logs = [
|
|
363
365
|
{
|
|
364
366
|
event: "session.create",
|
|
365
|
-
time:
|
|
367
|
+
time: P(),
|
|
366
368
|
clientName: "Chrome",
|
|
367
369
|
osName: "macOS",
|
|
368
370
|
countryName: "Germany",
|
|
@@ -370,7 +372,7 @@ class It {
|
|
|
370
372
|
},
|
|
371
373
|
{
|
|
372
374
|
event: "user.update.name",
|
|
373
|
-
time:
|
|
375
|
+
time: M(1440 * 2),
|
|
374
376
|
clientName: "Safari",
|
|
375
377
|
osName: "iOS",
|
|
376
378
|
countryName: "Germany",
|
|
@@ -378,7 +380,7 @@ class It {
|
|
|
378
380
|
},
|
|
379
381
|
{
|
|
380
382
|
event: "session.create",
|
|
381
|
-
time:
|
|
383
|
+
time: M(1440 * 3),
|
|
382
384
|
clientName: "Firefox",
|
|
383
385
|
osName: "Windows",
|
|
384
386
|
countryName: "United States",
|
|
@@ -388,9 +390,9 @@ class It {
|
|
|
388
390
|
}
|
|
389
391
|
requireUser() {
|
|
390
392
|
if (!this.user)
|
|
391
|
-
throw
|
|
393
|
+
throw K("general_unauthorized_scope", "User (role: guests) missing scope (account)");
|
|
392
394
|
if (this.mfaPending)
|
|
393
|
-
throw
|
|
395
|
+
throw K(
|
|
394
396
|
"user_more_factors_required",
|
|
395
397
|
"More factors are required to complete the sign in process."
|
|
396
398
|
);
|
|
@@ -398,7 +400,7 @@ class It {
|
|
|
398
400
|
}
|
|
399
401
|
requireRecentChallenge() {
|
|
400
402
|
if (Date.now() - this.lastChallenge > 30 * 6e4)
|
|
401
|
-
throw
|
|
403
|
+
throw K(
|
|
402
404
|
"user_challenge_required",
|
|
403
405
|
"A recently successful challenge is required to complete this action."
|
|
404
406
|
);
|
|
@@ -435,25 +437,25 @@ class It {
|
|
|
435
437
|
async createMagicURLToken(t, i) {
|
|
436
438
|
return this.tokens.set(t, { email: i }), this.delay({
|
|
437
439
|
$id: D(),
|
|
438
|
-
$createdAt:
|
|
440
|
+
$createdAt: P(),
|
|
439
441
|
userId: t,
|
|
440
442
|
secret: "",
|
|
441
443
|
expire: "",
|
|
442
|
-
phrase:
|
|
444
|
+
phrase: ht()
|
|
443
445
|
});
|
|
444
446
|
}
|
|
445
447
|
async createEmailToken(t, i) {
|
|
446
448
|
return this.tokens.set(t, { email: i }), this.delay({
|
|
447
449
|
$id: D(),
|
|
448
|
-
$createdAt:
|
|
450
|
+
$createdAt: P(),
|
|
449
451
|
userId: t,
|
|
450
452
|
secret: "",
|
|
451
453
|
expire: "",
|
|
452
|
-
phrase:
|
|
454
|
+
phrase: ht()
|
|
453
455
|
});
|
|
454
456
|
}
|
|
455
457
|
async createPhoneToken(t, i) {
|
|
456
|
-
return this.tokens.set(t, { phone: i }), this.delay({ $id: D(), $createdAt:
|
|
458
|
+
return this.tokens.set(t, { phone: i }), this.delay({ $id: D(), $createdAt: P(), userId: t, secret: "", expire: "", phrase: "" });
|
|
457
459
|
}
|
|
458
460
|
async createSession(t) {
|
|
459
461
|
return this.delay(() => {
|
|
@@ -494,7 +496,7 @@ class It {
|
|
|
494
496
|
async updateEmail(t) {
|
|
495
497
|
return this.delay(() => {
|
|
496
498
|
const i = this.requireUser();
|
|
497
|
-
return i.email = t, i.emailVerification = !1, i.passwordUpdate =
|
|
499
|
+
return i.email = t, i.emailVerification = !1, i.passwordUpdate = P(), i;
|
|
498
500
|
});
|
|
499
501
|
}
|
|
500
502
|
async updatePhone(t) {
|
|
@@ -506,7 +508,7 @@ class It {
|
|
|
506
508
|
async updatePassword() {
|
|
507
509
|
return this.delay(() => {
|
|
508
510
|
const t = this.requireUser();
|
|
509
|
-
return t.passwordUpdate =
|
|
511
|
+
return t.passwordUpdate = P(), t;
|
|
510
512
|
});
|
|
511
513
|
}
|
|
512
514
|
async updateStatus() {
|
|
@@ -545,7 +547,7 @@ class It {
|
|
|
545
547
|
});
|
|
546
548
|
}
|
|
547
549
|
async createMFAChallenge() {
|
|
548
|
-
return this.delay({ $id: D(), $createdAt:
|
|
550
|
+
return this.delay({ $id: D(), $createdAt: P(), userId: "preview-user", expire: "" });
|
|
549
551
|
}
|
|
550
552
|
async updateMFAChallenge() {
|
|
551
553
|
return this.delay(() => (this.mfaPending = !1, this.lastChallenge = Date.now(), this.sessions[0]));
|
|
@@ -574,35 +576,35 @@ class It {
|
|
|
574
576
|
async createMFARecoveryCodes() {
|
|
575
577
|
return this.delay(() => {
|
|
576
578
|
if (this.recoveryCodes.length > 0)
|
|
577
|
-
throw
|
|
578
|
-
return this.recoveryCodes = Array.from({ length: 6 },
|
|
579
|
+
throw K("user_recovery_codes_already_exists", "Recovery codes already generated.", 409);
|
|
580
|
+
return this.recoveryCodes = Array.from({ length: 6 }, ut), { recoveryCodes: this.recoveryCodes };
|
|
579
581
|
});
|
|
580
582
|
}
|
|
581
583
|
async getMFARecoveryCodes() {
|
|
582
584
|
return this.delay(() => (this.requireRecentChallenge(), { recoveryCodes: this.recoveryCodes }));
|
|
583
585
|
}
|
|
584
586
|
async updateMFARecoveryCodes() {
|
|
585
|
-
return this.delay(() => (this.requireRecentChallenge(), this.recoveryCodes = Array.from({ length: 6 },
|
|
587
|
+
return this.delay(() => (this.requireRecentChallenge(), this.recoveryCodes = Array.from({ length: 6 }, ut), { recoveryCodes: this.recoveryCodes }));
|
|
586
588
|
}
|
|
587
589
|
/** Forget everything, as a sign out would. */
|
|
588
590
|
reset() {
|
|
589
591
|
this.user = null, this.mfaPending = !1, this.sessions = [], this.identities = [], this.logs = [], this.tokens.clear();
|
|
590
592
|
}
|
|
591
593
|
}
|
|
592
|
-
function
|
|
594
|
+
function Ut(e) {
|
|
593
595
|
let t = 2166136261;
|
|
594
596
|
const i = () => (t ^= t << 13, t ^= t >>> 17, t ^= t << 5, (t >>> 0) / 4294967296);
|
|
595
|
-
for (const
|
|
597
|
+
for (const g of e) t = (t ^ g.charCodeAt(0)) * 16777619;
|
|
596
598
|
const s = 25;
|
|
597
599
|
let a = "";
|
|
598
|
-
const
|
|
599
|
-
for (let
|
|
600
|
-
for (let
|
|
601
|
-
!(
|
|
602
|
-
const
|
|
603
|
-
return `data:image/svg+xml;utf8,${encodeURIComponent(
|
|
600
|
+
const h = (g, y) => `<rect x="${g}" y="${y}" width="7" height="7"/><rect x="${g + 1}" y="${y + 1}" width="5" height="5" fill="#fff"/><rect x="${g + 2}" y="${y + 2}" width="3" height="3"/>`;
|
|
601
|
+
for (let g = 0; g < s; g++)
|
|
602
|
+
for (let y = 0; y < s; y++)
|
|
603
|
+
!(y < 8 && g < 8 || y >= s - 8 && g < 8 || y < 8 && g >= s - 8) && i() < 0.45 && (a += `<rect x="${y}" y="${g}" width="1" height="1"/>`);
|
|
604
|
+
const d = `<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">${h(0, 0)}${h(s - 7, 0)}${h(0, s - 7)}${a}</g></svg>`;
|
|
605
|
+
return `data:image/svg+xml;utf8,${encodeURIComponent(d)}`;
|
|
604
606
|
}
|
|
605
|
-
const
|
|
607
|
+
const v = {
|
|
606
608
|
moreFactorsRequired: "user_more_factors_required",
|
|
607
609
|
invalidCredentials: "user_invalid_credentials",
|
|
608
610
|
userAlreadyExists: "user_already_exists",
|
|
@@ -637,7 +639,7 @@ const f = {
|
|
|
637
639
|
targetAlreadyExists: "user_target_already_exists",
|
|
638
640
|
argumentInvalid: "general_argument_invalid"
|
|
639
641
|
};
|
|
640
|
-
function
|
|
642
|
+
function q(e) {
|
|
641
643
|
if (e && typeof e == "object") {
|
|
642
644
|
const t = e;
|
|
643
645
|
let i = typeof t.message == "string" ? t.message : "Unknown error";
|
|
@@ -649,80 +651,80 @@ function _(e) {
|
|
|
649
651
|
}
|
|
650
652
|
return { message: String(e), type: "", code: 0 };
|
|
651
653
|
}
|
|
652
|
-
function
|
|
653
|
-
return
|
|
654
|
+
function j(e, t) {
|
|
655
|
+
return q(e).type === t;
|
|
654
656
|
}
|
|
655
|
-
function
|
|
656
|
-
const s =
|
|
657
|
+
function Y(e, t, i = "link") {
|
|
658
|
+
const s = q(e);
|
|
657
659
|
switch (s.type) {
|
|
658
|
-
case
|
|
660
|
+
case v.invalidCredentials:
|
|
659
661
|
return i === "password" ? t.errorCurrentPassword : t.errorInvalidCredentials;
|
|
660
|
-
case
|
|
661
|
-
case
|
|
662
|
-
case
|
|
662
|
+
case v.userAlreadyExists:
|
|
663
|
+
case v.emailAlreadyExists:
|
|
664
|
+
case v.phoneAlreadyExists:
|
|
663
665
|
return t.errorUserExists;
|
|
664
|
-
case
|
|
666
|
+
case v.userBlocked:
|
|
665
667
|
return t.errorUserBlocked;
|
|
666
|
-
case
|
|
668
|
+
case v.rateLimit:
|
|
667
669
|
return t.errorRateLimit;
|
|
668
|
-
case
|
|
670
|
+
case v.invalidToken:
|
|
669
671
|
return i === "code" ? t.errorInvalidCode : t.errorInvalidToken;
|
|
670
|
-
case
|
|
672
|
+
case v.invalidCode:
|
|
671
673
|
return t.errorInvalidCode;
|
|
672
|
-
case
|
|
674
|
+
case v.passwordMismatch:
|
|
673
675
|
return t.errorPasswordMismatch;
|
|
674
|
-
case
|
|
676
|
+
case v.passwordRecentlyUsed:
|
|
675
677
|
return t.errorPasswordRecentlyUsed;
|
|
676
|
-
case
|
|
678
|
+
case v.passwordPersonalData:
|
|
677
679
|
return t.errorPasswordPersonalData;
|
|
678
|
-
case
|
|
680
|
+
case v.passwordWeak:
|
|
679
681
|
return t.errorPasswordWeak;
|
|
680
|
-
case
|
|
682
|
+
case v.passwordPwned:
|
|
681
683
|
return t.errorPasswordPwned;
|
|
682
|
-
case
|
|
684
|
+
case v.challengeRequired:
|
|
683
685
|
return t.errorChallengeRequired;
|
|
684
|
-
case
|
|
686
|
+
case v.sessionAlreadyExists:
|
|
685
687
|
return t.errorSessionExists;
|
|
686
|
-
case
|
|
687
|
-
case
|
|
688
|
+
case v.oauthUnauthorized:
|
|
689
|
+
case v.oauthBadRequest:
|
|
688
690
|
return t.errorOAuth;
|
|
689
|
-
case
|
|
691
|
+
case v.authMethodUnsupported:
|
|
690
692
|
return t.errorMethodDisabled;
|
|
691
693
|
}
|
|
692
|
-
if (s.type ===
|
|
694
|
+
if (s.type === v.argumentInvalid || /Invalid `\w+` param/i.test(s.message)) {
|
|
693
695
|
const a = s.message.match(/Invalid `([^`]+)` param/i)?.[1]?.toLowerCase();
|
|
694
696
|
return a === "email" ? t.errorInvalidEmail : a === "password" ? t.errorInvalidPassword : a === "phone" ? t.errorInvalidPhone : a === "name" ? t.errorInvalidName : t.errorGeneric;
|
|
695
697
|
}
|
|
696
|
-
return s.type ===
|
|
698
|
+
return s.type === v.projectNotFound || s.type === v.unknownOrigin ? t.errorConfig : s.type === v.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 === v.routeNotFound ? t.errorConfigEndpoint : t.errorGeneric;
|
|
697
699
|
}
|
|
698
|
-
function
|
|
699
|
-
const t =
|
|
700
|
-
return !!(t.type ===
|
|
700
|
+
function Mt(e) {
|
|
701
|
+
const t = q(e);
|
|
702
|
+
return !!(t.type === v.projectNotFound || t.type === v.unknownOrigin || t.type === v.routeNotFound || !t.message && t.code === 404 || t.code === 0 && /fetch|network|load failed|failed to fetch/i.test(t.message));
|
|
701
703
|
}
|
|
702
|
-
const
|
|
703
|
-
function
|
|
704
|
+
const et = (e) => `authui:active-team:${e}`;
|
|
705
|
+
function pt(e) {
|
|
704
706
|
if (typeof localStorage > "u" || !e) return null;
|
|
705
707
|
try {
|
|
706
|
-
return localStorage.getItem(
|
|
708
|
+
return localStorage.getItem(et(e));
|
|
707
709
|
} catch {
|
|
708
710
|
return null;
|
|
709
711
|
}
|
|
710
712
|
}
|
|
711
|
-
function
|
|
713
|
+
function Ot(e, t) {
|
|
712
714
|
if (!(typeof localStorage > "u" || !e))
|
|
713
715
|
try {
|
|
714
|
-
t ? localStorage.setItem(
|
|
716
|
+
t ? localStorage.setItem(et(e), t) : localStorage.removeItem(et(e));
|
|
715
717
|
} catch {
|
|
716
718
|
}
|
|
717
719
|
}
|
|
718
|
-
const
|
|
719
|
-
function
|
|
720
|
+
const ot = "authui:last-method";
|
|
721
|
+
function _(e) {
|
|
720
722
|
if (!(typeof localStorage > "u")) {
|
|
721
723
|
if (!e || e === "mfa" || e === "sign-up")
|
|
722
724
|
if (e === "sign-up") e = "email-password";
|
|
723
725
|
else return;
|
|
724
726
|
try {
|
|
725
|
-
localStorage.setItem(
|
|
727
|
+
localStorage.setItem(ot, e);
|
|
726
728
|
} catch {
|
|
727
729
|
}
|
|
728
730
|
}
|
|
@@ -730,42 +732,42 @@ function V(e) {
|
|
|
730
732
|
function z() {
|
|
731
733
|
if (typeof localStorage > "u") return null;
|
|
732
734
|
try {
|
|
733
|
-
return localStorage.getItem(
|
|
735
|
+
return localStorage.getItem(ot);
|
|
734
736
|
} catch {
|
|
735
737
|
return null;
|
|
736
738
|
}
|
|
737
739
|
}
|
|
738
|
-
function
|
|
740
|
+
function le() {
|
|
739
741
|
if (!(typeof localStorage > "u"))
|
|
740
742
|
try {
|
|
741
|
-
localStorage.removeItem(
|
|
743
|
+
localStorage.removeItem(ot);
|
|
742
744
|
} catch {
|
|
743
745
|
}
|
|
744
746
|
}
|
|
745
|
-
const
|
|
746
|
-
function
|
|
747
|
+
const Z = "authui:pending-oauth";
|
|
748
|
+
function Ft(e) {
|
|
747
749
|
if (!(typeof sessionStorage > "u"))
|
|
748
750
|
try {
|
|
749
|
-
sessionStorage.setItem(
|
|
751
|
+
sessionStorage.setItem(Z, e);
|
|
750
752
|
} catch {
|
|
751
753
|
}
|
|
752
754
|
}
|
|
753
|
-
function
|
|
755
|
+
function $t() {
|
|
754
756
|
if (!(typeof sessionStorage > "u"))
|
|
755
757
|
try {
|
|
756
|
-
const e = sessionStorage.getItem(
|
|
757
|
-
sessionStorage.removeItem(
|
|
758
|
+
const e = sessionStorage.getItem(Z);
|
|
759
|
+
sessionStorage.removeItem(Z), e && _(`oauth:${e}`);
|
|
758
760
|
} catch {
|
|
759
761
|
}
|
|
760
762
|
}
|
|
761
|
-
function
|
|
763
|
+
function mt() {
|
|
762
764
|
if (!(typeof sessionStorage > "u"))
|
|
763
765
|
try {
|
|
764
|
-
sessionStorage.removeItem(
|
|
766
|
+
sessionStorage.removeItem(Z);
|
|
765
767
|
} catch {
|
|
766
768
|
}
|
|
767
769
|
}
|
|
768
|
-
function
|
|
770
|
+
function A(e, t, i) {
|
|
769
771
|
for (const s of t) {
|
|
770
772
|
const a = e[s];
|
|
771
773
|
if (typeof a == "function")
|
|
@@ -775,7 +777,7 @@ function S(e, t, i) {
|
|
|
775
777
|
new Error(`Appwrite SDK is missing ${t[0]}(). Update the appwrite package.`)
|
|
776
778
|
);
|
|
777
779
|
}
|
|
778
|
-
const
|
|
780
|
+
const it = "authui", ft = ["userId", "secret", "expire", "project", "error", it], gt = () => ({
|
|
779
781
|
status: "loading",
|
|
780
782
|
user: null,
|
|
781
783
|
mfaFactors: null,
|
|
@@ -783,9 +785,9 @@ const tt = "authui", mt = ["userId", "secret", "expire", "project", "error", tt]
|
|
|
783
785
|
configured: !1,
|
|
784
786
|
configError: null
|
|
785
787
|
});
|
|
786
|
-
class
|
|
788
|
+
class Lt {
|
|
787
789
|
constructor() {
|
|
788
|
-
this.client = null, this.account = null, this.config = null, this.state =
|
|
790
|
+
this.client = null, this.account = null, this.config = null, this.state = gt(), this.listeners = /* @__PURE__ */ new Map(), this.refreshPromise = null, this.preview = null, this.teams = null, this.activeTeamId = null;
|
|
789
791
|
}
|
|
790
792
|
// ───────────────────────────── configuration ─────────────────────────────
|
|
791
793
|
/** Configure the Appwrite client. Safe to call more than once; the last call wins. */
|
|
@@ -793,7 +795,7 @@ class Ft {
|
|
|
793
795
|
const i = t.endpoint.trim().replace(/\/+$/, "");
|
|
794
796
|
i && !i.endsWith("/v1") && console.warn(
|
|
795
797
|
`[authui] endpoint should end with /v1 (got "${t.endpoint}"). Without it Appwrite returns HTML 404 pages.`
|
|
796
|
-
), this.config = t, this.client = new
|
|
798
|
+
), this.config = t, this.client = new ct().setEndpoint(t.endpoint).setProject(t.project), this.preview = t.preview ? new It() : null, this.account = this.preview ? this.preview : new dt(this.client), this.teams = null, this.activeTeamId = pt(t.project), this.setState({ configured: !0, status: "loading", configError: null }), this.preview ? this.refresh() : typeof window < "u" && this.handleRedirect().then(() => this.refresh());
|
|
797
799
|
}
|
|
798
800
|
/**
|
|
799
801
|
* Called by <authui-config> when it is on the page but missing endpoint or project.
|
|
@@ -839,7 +841,7 @@ class Ft {
|
|
|
839
841
|
/** List teams the signed-in user belongs to. Empty in preview or when signed out. */
|
|
840
842
|
async listTeams() {
|
|
841
843
|
if (this.preview || !this.client || this.state.status !== "signed-in") return [];
|
|
842
|
-
this.teams ??= new
|
|
844
|
+
this.teams ??= new kt(this.client);
|
|
843
845
|
try {
|
|
844
846
|
return (await this.teams.list()).teams ?? [];
|
|
845
847
|
} catch (t) {
|
|
@@ -849,7 +851,7 @@ class Ft {
|
|
|
849
851
|
getActiveTeamId() {
|
|
850
852
|
if (this.activeTeamId) return this.activeTeamId;
|
|
851
853
|
const t = this.config?.project;
|
|
852
|
-
return t ? (this.activeTeamId =
|
|
854
|
+
return t ? (this.activeTeamId = pt(t), this.activeTeamId) : null;
|
|
853
855
|
}
|
|
854
856
|
/**
|
|
855
857
|
* Remember the active team locally and emit `active-team`.
|
|
@@ -857,10 +859,10 @@ class Ft {
|
|
|
857
859
|
*/
|
|
858
860
|
setActiveTeam(t) {
|
|
859
861
|
const i = this.config?.project;
|
|
860
|
-
i &&
|
|
862
|
+
i && Ot(i, t?.$id ?? null), this.activeTeamId = t?.$id ?? null, this.emit("active-team", { teamId: this.activeTeamId, team: t });
|
|
861
863
|
}
|
|
862
864
|
getStrings() {
|
|
863
|
-
return { ...
|
|
865
|
+
return { ...St, ...this.config?.strings ?? {} };
|
|
864
866
|
}
|
|
865
867
|
getState() {
|
|
866
868
|
return { ...this.state };
|
|
@@ -886,7 +888,7 @@ class Ft {
|
|
|
886
888
|
this.state = { ...this.state, ...t }, this.emit("change", this.getState());
|
|
887
889
|
}
|
|
888
890
|
fail(t) {
|
|
889
|
-
const i =
|
|
891
|
+
const i = q(t);
|
|
890
892
|
throw this.emit("error", i), t;
|
|
891
893
|
}
|
|
892
894
|
acct() {
|
|
@@ -906,10 +908,10 @@ class Ft {
|
|
|
906
908
|
const i = await this.account.get();
|
|
907
909
|
this.setState({ status: "signed-in", user: i, mfaFactors: null, configError: null }), t || this.emit("signed-in", i);
|
|
908
910
|
} catch (i) {
|
|
909
|
-
if (
|
|
911
|
+
if (j(i, v.moreFactorsRequired)) {
|
|
910
912
|
let s = null;
|
|
911
913
|
try {
|
|
912
|
-
s = await
|
|
914
|
+
s = await A(
|
|
913
915
|
this.account,
|
|
914
916
|
["listMFAFactors", "listMfaFactors"],
|
|
915
917
|
[]
|
|
@@ -917,7 +919,7 @@ class Ft {
|
|
|
917
919
|
} catch {
|
|
918
920
|
}
|
|
919
921
|
this.setState({ status: "mfa-required", user: null, mfaFactors: s });
|
|
920
|
-
} else if (
|
|
922
|
+
} else if (j(i, v.userBlocked))
|
|
921
923
|
await this.purgeLocalSession(), this.setState({
|
|
922
924
|
status: "signed-out",
|
|
923
925
|
user: null,
|
|
@@ -928,13 +930,13 @@ class Ft {
|
|
|
928
930
|
message: this.getStrings().errorUserBlocked
|
|
929
931
|
}
|
|
930
932
|
}), t && this.emit("signed-out", void 0);
|
|
931
|
-
else if (!t &&
|
|
932
|
-
const a =
|
|
933
|
+
else if (!t && Mt(i)) {
|
|
934
|
+
const a = Y(i, this.getStrings()) || this.getStrings().errorConfig;
|
|
933
935
|
console.warn(
|
|
934
936
|
`[authui] ${a} (endpoint=${this.config?.endpoint ?? "?"}, project=${this.config?.project ?? "?"})`
|
|
935
937
|
);
|
|
936
|
-
const
|
|
937
|
-
this.emit("error", { message: a, type:
|
|
938
|
+
const h = q(i);
|
|
939
|
+
this.emit("error", { message: a, type: h.type, code: h.code }), this.setState({
|
|
938
940
|
status: "signed-out",
|
|
939
941
|
user: null,
|
|
940
942
|
mfaFactors: null,
|
|
@@ -953,7 +955,7 @@ class Ft {
|
|
|
953
955
|
const i = this.state.pending;
|
|
954
956
|
if (i?.type === "notice" && i.tone === "error")
|
|
955
957
|
throw Object.assign(new Error(i.message), {
|
|
956
|
-
type:
|
|
958
|
+
type: v.userBlocked,
|
|
957
959
|
code: 401
|
|
958
960
|
});
|
|
959
961
|
}
|
|
@@ -978,7 +980,7 @@ class Ft {
|
|
|
978
980
|
localStorage.removeItem("cookieFallback");
|
|
979
981
|
} catch {
|
|
980
982
|
}
|
|
981
|
-
this.config && !this.preview && (this.client = new
|
|
983
|
+
this.config && !this.preview && (this.client = new ct().setEndpoint(this.config.endpoint).setProject(this.config.project), this.account = new dt(this.client));
|
|
982
984
|
}
|
|
983
985
|
// ─────────────────────────────── sign in ───────────────────────────────
|
|
984
986
|
async signInWithEmailPassword(t, i) {
|
|
@@ -991,7 +993,7 @@ class Ft {
|
|
|
991
993
|
}
|
|
992
994
|
async signUp(t, i, s) {
|
|
993
995
|
try {
|
|
994
|
-
await this.acct().create(
|
|
996
|
+
await this.acct().create(W.unique(), t.trim(), i, s?.trim() || void 0), await this.acct().createEmailPasswordSession(t.trim(), i);
|
|
995
997
|
} catch (a) {
|
|
996
998
|
this.fail(a);
|
|
997
999
|
}
|
|
@@ -1034,7 +1036,7 @@ class Ft {
|
|
|
1034
1036
|
async sendMagicUrl(t) {
|
|
1035
1037
|
try {
|
|
1036
1038
|
return await this.acct().createMagicURLToken(
|
|
1037
|
-
|
|
1039
|
+
W.unique(),
|
|
1038
1040
|
t.trim(),
|
|
1039
1041
|
this.redirectUrl("magic-url"),
|
|
1040
1042
|
this.config?.securityPhrase ?? !0
|
|
@@ -1046,7 +1048,7 @@ class Ft {
|
|
|
1046
1048
|
async sendEmailOtp(t) {
|
|
1047
1049
|
try {
|
|
1048
1050
|
return await this.acct().createEmailToken(
|
|
1049
|
-
|
|
1051
|
+
W.unique(),
|
|
1050
1052
|
t.trim(),
|
|
1051
1053
|
this.config?.securityPhrase ?? !0
|
|
1052
1054
|
);
|
|
@@ -1056,7 +1058,7 @@ class Ft {
|
|
|
1056
1058
|
}
|
|
1057
1059
|
async sendPhoneOtp(t) {
|
|
1058
1060
|
try {
|
|
1059
|
-
return await this.acct().createPhoneToken(
|
|
1061
|
+
return await this.acct().createPhoneToken(W.unique(), t.replace(/[\s()-]/g, ""));
|
|
1060
1062
|
} catch (i) {
|
|
1061
1063
|
return this.fail(i);
|
|
1062
1064
|
}
|
|
@@ -1073,7 +1075,7 @@ class Ft {
|
|
|
1073
1075
|
// ─────────────────────────────── MFA ───────────────────────────────
|
|
1074
1076
|
async createMfaChallenge(t) {
|
|
1075
1077
|
try {
|
|
1076
|
-
return await
|
|
1078
|
+
return await A(
|
|
1077
1079
|
this.acct(),
|
|
1078
1080
|
["createMFAChallenge", "createMfaChallenge"],
|
|
1079
1081
|
[t]
|
|
@@ -1085,7 +1087,7 @@ class Ft {
|
|
|
1085
1087
|
/** Verify a challenge. Completes a pending sign in, or acts as a step-up for protected actions. */
|
|
1086
1088
|
async completeMfaChallenge(t, i, s = {}) {
|
|
1087
1089
|
try {
|
|
1088
|
-
await
|
|
1090
|
+
await A(
|
|
1089
1091
|
this.acct(),
|
|
1090
1092
|
["updateMFAChallenge", "updateMfaChallenge"],
|
|
1091
1093
|
[t, i.trim()]
|
|
@@ -1097,7 +1099,7 @@ class Ft {
|
|
|
1097
1099
|
}
|
|
1098
1100
|
async listMfaFactors() {
|
|
1099
1101
|
try {
|
|
1100
|
-
return await
|
|
1102
|
+
return await A(this.acct(), ["listMFAFactors", "listMfaFactors"], []);
|
|
1101
1103
|
} catch (t) {
|
|
1102
1104
|
return this.fail(t);
|
|
1103
1105
|
}
|
|
@@ -1112,7 +1114,7 @@ class Ft {
|
|
|
1112
1114
|
}
|
|
1113
1115
|
async addAuthenticator() {
|
|
1114
1116
|
try {
|
|
1115
|
-
return await
|
|
1117
|
+
return await A(
|
|
1116
1118
|
this.acct(),
|
|
1117
1119
|
["createMFAAuthenticator", "createMfaAuthenticator"],
|
|
1118
1120
|
["totp"]
|
|
@@ -1123,7 +1125,7 @@ class Ft {
|
|
|
1123
1125
|
}
|
|
1124
1126
|
async verifyAuthenticator(t) {
|
|
1125
1127
|
try {
|
|
1126
|
-
await
|
|
1128
|
+
await A(
|
|
1127
1129
|
this.acct(),
|
|
1128
1130
|
["updateMFAAuthenticator", "updateMfaAuthenticator"],
|
|
1129
1131
|
["totp", t.trim()]
|
|
@@ -1136,7 +1138,7 @@ class Ft {
|
|
|
1136
1138
|
/** Requires a recent MFA challenge (server rejects with user_challenge_required otherwise). */
|
|
1137
1139
|
async removeAuthenticator() {
|
|
1138
1140
|
try {
|
|
1139
|
-
await
|
|
1141
|
+
await A(this.acct(), ["deleteMFAAuthenticator", "deleteMfaAuthenticator"], ["totp"]);
|
|
1140
1142
|
} catch (t) {
|
|
1141
1143
|
this.fail(t);
|
|
1142
1144
|
}
|
|
@@ -1144,7 +1146,7 @@ class Ft {
|
|
|
1144
1146
|
}
|
|
1145
1147
|
async createRecoveryCodes() {
|
|
1146
1148
|
try {
|
|
1147
|
-
return (await
|
|
1149
|
+
return (await A(
|
|
1148
1150
|
this.acct(),
|
|
1149
1151
|
["createMFARecoveryCodes", "createMfaRecoveryCodes"],
|
|
1150
1152
|
[]
|
|
@@ -1156,7 +1158,7 @@ class Ft {
|
|
|
1156
1158
|
/** Requires a recent MFA challenge. */
|
|
1157
1159
|
async regenerateRecoveryCodes() {
|
|
1158
1160
|
try {
|
|
1159
|
-
return (await
|
|
1161
|
+
return (await A(
|
|
1160
1162
|
this.acct(),
|
|
1161
1163
|
["updateMFARecoveryCodes", "updateMfaRecoveryCodes"],
|
|
1162
1164
|
[]
|
|
@@ -1168,7 +1170,7 @@ class Ft {
|
|
|
1168
1170
|
/** Requires a recent MFA challenge. */
|
|
1169
1171
|
async getRecoveryCodes() {
|
|
1170
1172
|
try {
|
|
1171
|
-
return (await
|
|
1173
|
+
return (await A(
|
|
1172
1174
|
this.acct(),
|
|
1173
1175
|
["getMFARecoveryCodes", "getMfaRecoveryCodes"],
|
|
1174
1176
|
[]
|
|
@@ -1290,7 +1292,7 @@ class Ft {
|
|
|
1290
1292
|
}
|
|
1291
1293
|
async sendEmailVerification() {
|
|
1292
1294
|
try {
|
|
1293
|
-
await
|
|
1295
|
+
await A(
|
|
1294
1296
|
this.acct(),
|
|
1295
1297
|
["createEmailVerification", "createVerification"],
|
|
1296
1298
|
[this.redirectUrl("verify-email")]
|
|
@@ -1330,8 +1332,8 @@ class Ft {
|
|
|
1330
1332
|
/** Build the URL Appwrite should send the user back to for a given flow. */
|
|
1331
1333
|
redirectUrl(t) {
|
|
1332
1334
|
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);
|
|
1333
|
-
for (const a of
|
|
1334
|
-
return s.searchParams.set(
|
|
1335
|
+
for (const a of ft) s.searchParams.delete(a);
|
|
1336
|
+
return s.searchParams.set(it, t), s.toString();
|
|
1335
1337
|
}
|
|
1336
1338
|
setPending(t) {
|
|
1337
1339
|
this.setState({ pending: t });
|
|
@@ -1342,11 +1344,11 @@ class Ft {
|
|
|
1342
1344
|
*/
|
|
1343
1345
|
async handleRedirect() {
|
|
1344
1346
|
if (typeof window > "u") return !1;
|
|
1345
|
-
const t = new URLSearchParams(window.location.search), i = t.get(
|
|
1347
|
+
const t = new URLSearchParams(window.location.search), i = t.get(it);
|
|
1346
1348
|
if (!i) return !1;
|
|
1347
1349
|
const s = t.get("userId") ?? "", a = t.get("secret") ?? "";
|
|
1348
1350
|
this.cleanUrl();
|
|
1349
|
-
const
|
|
1351
|
+
const h = () => {
|
|
1350
1352
|
this.setState({
|
|
1351
1353
|
pending: {
|
|
1352
1354
|
type: "notice",
|
|
@@ -1359,10 +1361,10 @@ class Ft {
|
|
|
1359
1361
|
switch (i) {
|
|
1360
1362
|
case "oauth":
|
|
1361
1363
|
case "magic-url":
|
|
1362
|
-
s && a ? (await this.acct().createSession(s, a), i === "oauth"
|
|
1364
|
+
s && a ? (await this.acct().createSession(s, a), i === "oauth" ? $t() : _("magic-url")) : (i === "oauth" && mt(), h());
|
|
1363
1365
|
break;
|
|
1364
1366
|
case "oauth-failed":
|
|
1365
|
-
|
|
1367
|
+
mt(), this.setState({
|
|
1366
1368
|
pending: {
|
|
1367
1369
|
type: "notice",
|
|
1368
1370
|
tone: "error",
|
|
@@ -1371,10 +1373,10 @@ class Ft {
|
|
|
1371
1373
|
});
|
|
1372
1374
|
break;
|
|
1373
1375
|
case "recovery":
|
|
1374
|
-
s && a ? this.setState({ pending: { type: "reset-password", userId: s, secret: a } }) :
|
|
1376
|
+
s && a ? this.setState({ pending: { type: "reset-password", userId: s, secret: a } }) : h();
|
|
1375
1377
|
break;
|
|
1376
1378
|
case "verify-email":
|
|
1377
|
-
s && a ? (await
|
|
1379
|
+
s && a ? (await A(
|
|
1378
1380
|
this.acct(),
|
|
1379
1381
|
["updateEmailVerification", "updateVerification"],
|
|
1380
1382
|
[s, a]
|
|
@@ -1384,26 +1386,26 @@ class Ft {
|
|
|
1384
1386
|
message: this.getStrings().emailVerified,
|
|
1385
1387
|
tone: "success"
|
|
1386
1388
|
}
|
|
1387
|
-
})) :
|
|
1389
|
+
})) : h();
|
|
1388
1390
|
break;
|
|
1389
1391
|
}
|
|
1390
|
-
} catch (
|
|
1391
|
-
const
|
|
1392
|
-
this.emit("error",
|
|
1392
|
+
} catch (d) {
|
|
1393
|
+
const g = q(d), y = Y(d, this.getStrings(), "link");
|
|
1394
|
+
this.emit("error", g), this.setState({ pending: { type: "notice", message: y, tone: "error" } });
|
|
1393
1395
|
}
|
|
1394
1396
|
return !0;
|
|
1395
1397
|
}
|
|
1396
1398
|
cleanUrl() {
|
|
1397
1399
|
const t = new URL(window.location.href);
|
|
1398
|
-
for (const i of
|
|
1400
|
+
for (const i of ft) t.searchParams.delete(i);
|
|
1399
1401
|
window.history.replaceState(window.history.state, "", t.toString());
|
|
1400
1402
|
}
|
|
1401
1403
|
/** Test helper. */
|
|
1402
1404
|
reset() {
|
|
1403
|
-
this.client = null, this.account = null, this.teams = null, this.activeTeamId = null, this.preview = null, this.config = null, this.state =
|
|
1405
|
+
this.client = null, this.account = null, this.teams = null, this.activeTeamId = null, this.preview = null, this.config = null, this.state = gt(), this.listeners.clear();
|
|
1404
1406
|
}
|
|
1405
1407
|
}
|
|
1406
|
-
const o = new
|
|
1408
|
+
const o = new Lt();
|
|
1407
1409
|
class Rt {
|
|
1408
1410
|
constructor() {
|
|
1409
1411
|
this.listeners = /* @__PURE__ */ new Set(), this.observer = null, this.media = null, this.notify = () => {
|
|
@@ -1432,14 +1434,14 @@ class Rt {
|
|
|
1432
1434
|
this.observer?.disconnect(), this.observer = null, this.media?.removeEventListener?.("change", this.notify), this.media = null;
|
|
1433
1435
|
}
|
|
1434
1436
|
}
|
|
1435
|
-
const
|
|
1437
|
+
const vt = new Rt(), bt = {
|
|
1436
1438
|
none: "0px",
|
|
1437
1439
|
sm: "0.25rem",
|
|
1438
1440
|
md: "0.625rem",
|
|
1439
1441
|
lg: "0.875rem",
|
|
1440
1442
|
xl: "1.125rem",
|
|
1441
1443
|
full: "1.5rem"
|
|
1442
|
-
}, Tt =
|
|
1444
|
+
}, Tt = L`
|
|
1443
1445
|
:host {
|
|
1444
1446
|
/* Light theme (matches :root in the console) */
|
|
1445
1447
|
--authui-background: oklch(1 0 0);
|
|
@@ -1517,7 +1519,7 @@ const gt = new Rt(), vt = {
|
|
|
1517
1519
|
--authui-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.5);
|
|
1518
1520
|
color-scheme: dark;
|
|
1519
1521
|
}
|
|
1520
|
-
`, Dt =
|
|
1522
|
+
`, Dt = L`
|
|
1521
1523
|
*,
|
|
1522
1524
|
*::before,
|
|
1523
1525
|
*::after {
|
|
@@ -2209,6 +2211,34 @@ const gt = new Rt(), vt = {
|
|
|
2209
2211
|
.legal a:hover {
|
|
2210
2212
|
color: var(--authui-foreground);
|
|
2211
2213
|
}
|
|
2214
|
+
.legal-accept {
|
|
2215
|
+
display: flex;
|
|
2216
|
+
align-items: flex-start;
|
|
2217
|
+
gap: 10px;
|
|
2218
|
+
font-size: 12px;
|
|
2219
|
+
color: var(--authui-muted-foreground);
|
|
2220
|
+
line-height: 1.5;
|
|
2221
|
+
text-align: start;
|
|
2222
|
+
cursor: pointer;
|
|
2223
|
+
user-select: none;
|
|
2224
|
+
}
|
|
2225
|
+
.legal-accept input {
|
|
2226
|
+
margin-top: 2px;
|
|
2227
|
+
width: 16px;
|
|
2228
|
+
height: 16px;
|
|
2229
|
+
flex-shrink: 0;
|
|
2230
|
+
accent-color: var(--authui-brand);
|
|
2231
|
+
cursor: pointer;
|
|
2232
|
+
}
|
|
2233
|
+
.legal-accept a {
|
|
2234
|
+
color: inherit;
|
|
2235
|
+
text-decoration: underline;
|
|
2236
|
+
text-decoration-style: dotted;
|
|
2237
|
+
text-underline-offset: 3px;
|
|
2238
|
+
}
|
|
2239
|
+
.legal-accept a:hover {
|
|
2240
|
+
color: var(--authui-foreground);
|
|
2241
|
+
}
|
|
2212
2242
|
.links {
|
|
2213
2243
|
display: flex;
|
|
2214
2244
|
justify-content: center;
|
|
@@ -2232,6 +2262,32 @@ const gt = new Rt(), vt = {
|
|
|
2232
2262
|
width: 18px;
|
|
2233
2263
|
height: 18px;
|
|
2234
2264
|
}
|
|
2265
|
+
/* Compact icon-only OAuth row (oauthLayout: icon / horizontal). */
|
|
2266
|
+
.providers.icon {
|
|
2267
|
+
display: flex;
|
|
2268
|
+
flex-wrap: wrap;
|
|
2269
|
+
gap: 8px;
|
|
2270
|
+
justify-content: center;
|
|
2271
|
+
}
|
|
2272
|
+
.providers.icon .btn {
|
|
2273
|
+
width: 40px;
|
|
2274
|
+
height: 40px;
|
|
2275
|
+
padding: 0;
|
|
2276
|
+
justify-content: center;
|
|
2277
|
+
position: relative;
|
|
2278
|
+
}
|
|
2279
|
+
.providers.icon .btn svg {
|
|
2280
|
+
width: 18px;
|
|
2281
|
+
height: 18px;
|
|
2282
|
+
}
|
|
2283
|
+
.providers.icon .last-used-badge,
|
|
2284
|
+
.providers.icon .oauth-last-used-pill {
|
|
2285
|
+
display: none;
|
|
2286
|
+
}
|
|
2287
|
+
.providers.icon .oauth-last-used-dot {
|
|
2288
|
+
top: 4px;
|
|
2289
|
+
inset-inline-end: 4px;
|
|
2290
|
+
}
|
|
2235
2291
|
/* OAuth accordion: last-used (or focused) expands; others stay icon-compact. */
|
|
2236
2292
|
.providers.accordion {
|
|
2237
2293
|
display: flex;
|
|
@@ -2467,24 +2523,24 @@ const gt = new Rt(), vt = {
|
|
|
2467
2523
|
}
|
|
2468
2524
|
`;
|
|
2469
2525
|
var zt = Object.defineProperty, _t = (e, t, i, s) => {
|
|
2470
|
-
for (var a = void 0,
|
|
2471
|
-
(
|
|
2526
|
+
for (var a = void 0, h = e.length - 1, d; h >= 0; h--)
|
|
2527
|
+
(d = e[h]) && (a = d(t, i, a) || a);
|
|
2472
2528
|
return a && zt(t, i, a), a;
|
|
2473
|
-
},
|
|
2474
|
-
const
|
|
2529
|
+
}, O;
|
|
2530
|
+
const xt = (O = class extends nt {
|
|
2475
2531
|
constructor() {
|
|
2476
2532
|
super(...arguments), this.auth = o.getState(), this.unsubscribeStore = null, this.unsubscribeTheme = null, this.stopKeys = (t) => t.stopPropagation();
|
|
2477
2533
|
}
|
|
2478
2534
|
connectedCallback() {
|
|
2479
2535
|
super.connectedCallback();
|
|
2480
|
-
for (const t of
|
|
2536
|
+
for (const t of O.KEY_EVENTS) this.addEventListener(t, this.stopKeys);
|
|
2481
2537
|
this.auth = o.getState(), this.unsubscribeStore = o.on("change", (t) => {
|
|
2482
2538
|
this.auth = t, this.applyBranding();
|
|
2483
|
-
}), this.unsubscribeTheme =
|
|
2539
|
+
}), this.unsubscribeTheme = vt.subscribe(() => this.applyBranding()), this.applyBranding();
|
|
2484
2540
|
}
|
|
2485
2541
|
disconnectedCallback() {
|
|
2486
2542
|
super.disconnectedCallback();
|
|
2487
|
-
for (const t of
|
|
2543
|
+
for (const t of O.KEY_EVENTS) this.removeEventListener(t, this.stopKeys);
|
|
2488
2544
|
this.unsubscribeStore?.(), this.unsubscribeTheme?.(), this.unsubscribeStore = null, this.unsubscribeTheme = null;
|
|
2489
2545
|
}
|
|
2490
2546
|
get strings() {
|
|
@@ -2492,7 +2548,7 @@ const $t = (M = class extends rt {
|
|
|
2492
2548
|
}
|
|
2493
2549
|
/** Translate a string key with optional `{placeholders}`. */
|
|
2494
2550
|
t(t, i) {
|
|
2495
|
-
return
|
|
2551
|
+
return At(this.strings[t], i);
|
|
2496
2552
|
}
|
|
2497
2553
|
get config() {
|
|
2498
2554
|
return o.getConfig();
|
|
@@ -2502,29 +2558,29 @@ const $t = (M = class extends rt {
|
|
|
2502
2558
|
}
|
|
2503
2559
|
/** Push theme and branding from config onto the host element. */
|
|
2504
2560
|
applyBranding() {
|
|
2505
|
-
const t = this.config?.branding, i =
|
|
2561
|
+
const t = this.config?.branding, i = vt.isDark(t?.theme ?? "auto");
|
|
2506
2562
|
this.setAttribute("data-theme", i ? "dark" : "light"), t?.primary && (this.style.setProperty("--authui-primary", t.primary), this.style.setProperty(
|
|
2507
2563
|
"--authui-primary-foreground",
|
|
2508
2564
|
t.primaryForeground ?? "#ffffff"
|
|
2509
|
-
)), t?.radius &&
|
|
2565
|
+
)), t?.radius && bt[t.radius] && this.style.setProperty("--authui-radius", bt[t.radius]);
|
|
2510
2566
|
}
|
|
2511
2567
|
/** Emit a composed custom event from this element. */
|
|
2512
2568
|
fire(t, i) {
|
|
2513
2569
|
this.dispatchEvent(new CustomEvent(t, { detail: i, bubbles: !0, composed: !0 }));
|
|
2514
2570
|
}
|
|
2515
|
-
},
|
|
2571
|
+
}, O.styles = [Tt, Dt], O.KEY_EVENTS = ["keydown", "keyup", "keypress"], O);
|
|
2516
2572
|
_t([
|
|
2517
|
-
|
|
2518
|
-
],
|
|
2519
|
-
let
|
|
2520
|
-
var
|
|
2521
|
-
for (var a = s > 1 ? void 0 : s ? Vt(t, i) : t,
|
|
2522
|
-
(
|
|
2523
|
-
return s && a &&
|
|
2573
|
+
c()
|
|
2574
|
+
], xt.prototype, "auth");
|
|
2575
|
+
let U = xt;
|
|
2576
|
+
var qt = Object.defineProperty, Vt = Object.getOwnPropertyDescriptor, x = (e, t, i, s) => {
|
|
2577
|
+
for (var a = s > 1 ? void 0 : s ? Vt(t, i) : t, h = e.length - 1, d; h >= 0; h--)
|
|
2578
|
+
(d = e[h]) && (a = (s ? d(t, i, a) : d(a)) || a);
|
|
2579
|
+
return s && a && qt(t, i, a), a;
|
|
2524
2580
|
};
|
|
2525
|
-
let
|
|
2581
|
+
let w = class extends nt {
|
|
2526
2582
|
constructor() {
|
|
2527
|
-
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 = "";
|
|
2583
|
+
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.requireAcceptance = "", this.oauthLayout = "", this.preview = "";
|
|
2528
2584
|
}
|
|
2529
2585
|
connectedCallback() {
|
|
2530
2586
|
super.connectedCallback(), this.configure();
|
|
@@ -2546,7 +2602,7 @@ let y = class extends rt {
|
|
|
2546
2602
|
const e = { oauth: [] }, t = this.methods.split(/[\s,]+/).filter(Boolean);
|
|
2547
2603
|
for (const i of t)
|
|
2548
2604
|
i.startsWith("oauth:") ? e.oauth.push(i.slice(6)) : i === "email-password" ? e.emailPassword = !0 : i === "magic-url" ? e.magicUrl = !0 : i === "email-otp" ? e.emailOtp = !0 : i === "phone" ? e.phone = !0 : (i === "anonymous" || i === "guest") && (e.anonymous = !0);
|
|
2549
|
-
return e.emailPassword = t.length > 0 ? t.includes("email-password") : !0, {
|
|
2605
|
+
return e.emailPassword = t.length > 0 ? t.includes("email-password") : !0, this.oauthLayout && (e.oauthLayout = this.oauthLayout), {
|
|
2550
2606
|
endpoint: this.endpoint,
|
|
2551
2607
|
project: this.project,
|
|
2552
2608
|
redirectUrl: this.redirectUrl || void 0,
|
|
@@ -2566,108 +2622,115 @@ let y = class extends rt {
|
|
|
2566
2622
|
},
|
|
2567
2623
|
legal: {
|
|
2568
2624
|
termsUrl: this.termsUrl || void 0,
|
|
2569
|
-
privacyUrl: this.privacyUrl || void 0
|
|
2625
|
+
privacyUrl: this.privacyUrl || void 0,
|
|
2626
|
+
requireAcceptance: this.requireAcceptance !== "" && this.requireAcceptance !== "false" ? !0 : void 0
|
|
2570
2627
|
},
|
|
2571
2628
|
preview: this.preview === "" || this.preview === "false" ? void 0 : !0
|
|
2572
2629
|
};
|
|
2573
2630
|
}
|
|
2574
2631
|
};
|
|
2575
|
-
|
|
2632
|
+
w.styles = L`
|
|
2576
2633
|
:host {
|
|
2577
2634
|
display: none;
|
|
2578
2635
|
}
|
|
2579
2636
|
`;
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
],
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
],
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
],
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
],
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
],
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
],
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
],
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
],
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
],
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
],
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
],
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
],
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
],
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
],
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
],
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
],
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
],
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
],
|
|
2634
|
-
|
|
2637
|
+
x([
|
|
2638
|
+
m({ type: String })
|
|
2639
|
+
], w.prototype, "endpoint", 2);
|
|
2640
|
+
x([
|
|
2641
|
+
m({ type: String })
|
|
2642
|
+
], w.prototype, "project", 2);
|
|
2643
|
+
x([
|
|
2644
|
+
m({ type: String, attribute: "redirect-url" })
|
|
2645
|
+
], w.prototype, "redirectUrl", 2);
|
|
2646
|
+
x([
|
|
2647
|
+
m({ type: String, attribute: "success-url" })
|
|
2648
|
+
], w.prototype, "successUrl", 2);
|
|
2649
|
+
x([
|
|
2650
|
+
m({ type: String })
|
|
2651
|
+
], w.prototype, "methods", 2);
|
|
2652
|
+
x([
|
|
2653
|
+
m({ type: String, attribute: "sign-up" })
|
|
2654
|
+
], w.prototype, "signUp", 2);
|
|
2655
|
+
x([
|
|
2656
|
+
m({ type: String, attribute: "require-name" })
|
|
2657
|
+
], w.prototype, "requireName", 2);
|
|
2658
|
+
x([
|
|
2659
|
+
m({ type: String })
|
|
2660
|
+
], w.prototype, "mfa", 2);
|
|
2661
|
+
x([
|
|
2662
|
+
m({ type: String, attribute: "security-phrase" })
|
|
2663
|
+
], w.prototype, "securityPhrase", 2);
|
|
2664
|
+
x([
|
|
2665
|
+
m({ type: String })
|
|
2666
|
+
], w.prototype, "name", 2);
|
|
2667
|
+
x([
|
|
2668
|
+
m({ type: String })
|
|
2669
|
+
], w.prototype, "logo", 2);
|
|
2670
|
+
x([
|
|
2671
|
+
m({ type: String })
|
|
2672
|
+
], w.prototype, "theme", 2);
|
|
2673
|
+
x([
|
|
2674
|
+
m({ type: String })
|
|
2675
|
+
], w.prototype, "radius", 2);
|
|
2676
|
+
x([
|
|
2677
|
+
m({ type: String })
|
|
2678
|
+
], w.prototype, "primary", 2);
|
|
2679
|
+
x([
|
|
2680
|
+
m({ type: String, attribute: "primary-foreground" })
|
|
2681
|
+
], w.prototype, "primaryForeground", 2);
|
|
2682
|
+
x([
|
|
2683
|
+
m({ type: String, attribute: "terms-url" })
|
|
2684
|
+
], w.prototype, "termsUrl", 2);
|
|
2685
|
+
x([
|
|
2686
|
+
m({ type: String, attribute: "privacy-url" })
|
|
2687
|
+
], w.prototype, "privacyUrl", 2);
|
|
2688
|
+
x([
|
|
2689
|
+
m({ type: String, attribute: "require-acceptance" })
|
|
2690
|
+
], w.prototype, "requireAcceptance", 2);
|
|
2691
|
+
x([
|
|
2692
|
+
m({ type: String, attribute: "oauth-layout" })
|
|
2693
|
+
], w.prototype, "oauthLayout", 2);
|
|
2694
|
+
x([
|
|
2695
|
+
m({ type: String })
|
|
2696
|
+
], w.prototype, "preview", 2);
|
|
2697
|
+
w = x([
|
|
2635
2698
|
T("authui-config")
|
|
2636
|
-
],
|
|
2637
|
-
var
|
|
2638
|
-
for (var a = s > 1 ? void 0 : s ?
|
|
2639
|
-
(
|
|
2640
|
-
return s && a &&
|
|
2699
|
+
], w);
|
|
2700
|
+
var Nt = Object.defineProperty, Bt = Object.getOwnPropertyDescriptor, Q = (e, t, i, s) => {
|
|
2701
|
+
for (var a = s > 1 ? void 0 : s ? Bt(t, i) : t, h = e.length - 1, d; h >= 0; h--)
|
|
2702
|
+
(d = e[h]) && (a = (s ? d(t, i, a) : d(a)) || a);
|
|
2703
|
+
return s && a && Nt(t, i, a), a;
|
|
2641
2704
|
};
|
|
2642
|
-
const
|
|
2643
|
-
let
|
|
2644
|
-
function
|
|
2645
|
-
if (!(typeof document > "u" ||
|
|
2646
|
-
|
|
2705
|
+
const yt = "authui-show:not([ready]){display:none}", ce = "authui-show:not([ready]){display:none}authui-button:not(:defined),authui-user-button:not(:defined){visibility:hidden}";
|
|
2706
|
+
let wt = !1;
|
|
2707
|
+
function jt() {
|
|
2708
|
+
if (!(typeof document > "u" || wt)) {
|
|
2709
|
+
wt = !0;
|
|
2647
2710
|
try {
|
|
2648
2711
|
if (typeof CSSStyleSheet < "u" && "adoptedStyleSheets" in Document.prototype) {
|
|
2649
2712
|
const e = new CSSStyleSheet();
|
|
2650
|
-
e.replaceSync(
|
|
2713
|
+
e.replaceSync(yt), document.adoptedStyleSheets = [...document.adoptedStyleSheets, e];
|
|
2651
2714
|
return;
|
|
2652
2715
|
}
|
|
2653
2716
|
} catch {
|
|
2654
2717
|
}
|
|
2655
2718
|
if (!document.getElementById("authui-fouc")) {
|
|
2656
2719
|
const e = document.createElement("style");
|
|
2657
|
-
e.id = "authui-fouc", e.textContent =
|
|
2720
|
+
e.id = "authui-fouc", e.textContent = yt, document.head.appendChild(e);
|
|
2658
2721
|
}
|
|
2659
2722
|
}
|
|
2660
2723
|
}
|
|
2661
|
-
|
|
2724
|
+
jt();
|
|
2662
2725
|
const Ht = ["loading", "signed-out", "signed-in", "mfa-required"];
|
|
2663
|
-
function
|
|
2726
|
+
function st(e) {
|
|
2664
2727
|
return e ? e.split(/[\s,]+/).map((t) => t.trim()).filter((t) => Ht.includes(t)) : [];
|
|
2665
2728
|
}
|
|
2666
|
-
function
|
|
2667
|
-
const s =
|
|
2729
|
+
function Wt(e, t, i) {
|
|
2730
|
+
const s = st(t), a = st(i);
|
|
2668
2731
|
return !(e === "loading" && !s.includes("loading") || s.length > 0 && !s.includes(e) || a.includes(e));
|
|
2669
2732
|
}
|
|
2670
|
-
let
|
|
2733
|
+
let H = class extends nt {
|
|
2671
2734
|
constructor() {
|
|
2672
2735
|
super(...arguments), this.when = "", this.unless = "", this.status = o.getState().status, this.unsubscribe = null;
|
|
2673
2736
|
}
|
|
@@ -2679,28 +2742,28 @@ let N = class extends rt {
|
|
|
2679
2742
|
}
|
|
2680
2743
|
/** Whether the current status satisfies `when` and `unless`. */
|
|
2681
2744
|
get visible() {
|
|
2682
|
-
return
|
|
2745
|
+
return Wt(this.status, this.when, this.unless);
|
|
2683
2746
|
}
|
|
2684
2747
|
updated() {
|
|
2685
|
-
(this.status !== "loading" ||
|
|
2748
|
+
(this.status !== "loading" || st(this.when).includes("loading")) && (this.setAttribute("ready", ""), this.style.display = "contents");
|
|
2686
2749
|
}
|
|
2687
2750
|
render() {
|
|
2688
2751
|
return this.visible ? r`<slot></slot>` : n;
|
|
2689
2752
|
}
|
|
2690
2753
|
};
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
],
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
],
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
],
|
|
2700
|
-
|
|
2754
|
+
Q([
|
|
2755
|
+
m({ type: String })
|
|
2756
|
+
], H.prototype, "when", 2);
|
|
2757
|
+
Q([
|
|
2758
|
+
m({ type: String })
|
|
2759
|
+
], H.prototype, "unless", 2);
|
|
2760
|
+
Q([
|
|
2761
|
+
c()
|
|
2762
|
+
], H.prototype, "status", 2);
|
|
2763
|
+
H = Q([
|
|
2701
2764
|
T("authui-show")
|
|
2702
|
-
],
|
|
2703
|
-
const
|
|
2765
|
+
], H);
|
|
2766
|
+
const Kt = L`
|
|
2704
2767
|
:host {
|
|
2705
2768
|
display: block;
|
|
2706
2769
|
width: 100%;
|
|
@@ -2754,7 +2817,7 @@ const Wt = O`
|
|
|
2754
2817
|
height: 14px;
|
|
2755
2818
|
margin: 0;
|
|
2756
2819
|
}
|
|
2757
|
-
`,
|
|
2820
|
+
`, b = (e) => r`<svg
|
|
2758
2821
|
xmlns="http://www.w3.org/2000/svg"
|
|
2759
2822
|
viewBox="0 0 24 24"
|
|
2760
2823
|
fill="none"
|
|
@@ -2766,159 +2829,159 @@ const Wt = O`
|
|
|
2766
2829
|
>
|
|
2767
2830
|
${e}
|
|
2768
2831
|
</svg>`, l = {
|
|
2769
|
-
mail:
|
|
2770
|
-
|
|
2832
|
+
mail: b(
|
|
2833
|
+
u`<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"/>`
|
|
2771
2834
|
),
|
|
2772
|
-
phone:
|
|
2773
|
-
|
|
2835
|
+
phone: b(
|
|
2836
|
+
u`<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"/>`
|
|
2774
2837
|
),
|
|
2775
|
-
user:
|
|
2776
|
-
|
|
2838
|
+
user: b(
|
|
2839
|
+
u`<path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"/><circle cx="12" cy="7" r="4"/>`
|
|
2777
2840
|
),
|
|
2778
|
-
userX:
|
|
2779
|
-
|
|
2841
|
+
userX: b(
|
|
2842
|
+
u`<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"/>`
|
|
2780
2843
|
),
|
|
2781
|
-
lock:
|
|
2782
|
-
|
|
2844
|
+
lock: b(
|
|
2845
|
+
u`<rect width="18" height="11" x="3" y="11" rx="2" ry="2"/><path d="M7 11V7a5 5 0 0 1 10 0v4"/>`
|
|
2783
2846
|
),
|
|
2784
|
-
key:
|
|
2785
|
-
|
|
2847
|
+
key: b(
|
|
2848
|
+
u`<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"/>`
|
|
2786
2849
|
),
|
|
2787
|
-
shield:
|
|
2788
|
-
|
|
2850
|
+
shield: b(
|
|
2851
|
+
u`<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"/>`
|
|
2789
2852
|
),
|
|
2790
|
-
shieldCheck:
|
|
2791
|
-
|
|
2853
|
+
shieldCheck: b(
|
|
2854
|
+
u`<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"/>`
|
|
2792
2855
|
),
|
|
2793
|
-
smartphone:
|
|
2794
|
-
|
|
2856
|
+
smartphone: b(
|
|
2857
|
+
u`<rect width="14" height="20" x="5" y="2" rx="2" ry="2"/><path d="M12 18h.01"/>`
|
|
2795
2858
|
),
|
|
2796
|
-
monitor:
|
|
2797
|
-
|
|
2859
|
+
monitor: b(
|
|
2860
|
+
u`<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"/>`
|
|
2798
2861
|
),
|
|
2799
|
-
globe:
|
|
2800
|
-
|
|
2862
|
+
globe: b(
|
|
2863
|
+
u`<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"/>`
|
|
2801
2864
|
),
|
|
2802
|
-
logOut:
|
|
2803
|
-
|
|
2865
|
+
logOut: b(
|
|
2866
|
+
u`<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"/>`
|
|
2804
2867
|
),
|
|
2805
|
-
settings:
|
|
2806
|
-
|
|
2868
|
+
settings: b(
|
|
2869
|
+
u`<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"/>`
|
|
2807
2870
|
),
|
|
2808
|
-
x:
|
|
2809
|
-
check:
|
|
2810
|
-
users:
|
|
2811
|
-
|
|
2871
|
+
x: b(u`<path d="M18 6 6 18"/><path d="m6 6 12 12"/>`),
|
|
2872
|
+
check: b(u`<path d="M20 6 9 17l-5-5"/>`),
|
|
2873
|
+
users: b(
|
|
2874
|
+
u`<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"/>`
|
|
2812
2875
|
),
|
|
2813
|
-
copy:
|
|
2814
|
-
|
|
2876
|
+
copy: b(
|
|
2877
|
+
u`<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"/>`
|
|
2815
2878
|
),
|
|
2816
|
-
eye:
|
|
2817
|
-
|
|
2879
|
+
eye: b(
|
|
2880
|
+
u`<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"/>`
|
|
2818
2881
|
),
|
|
2819
|
-
eyeOff:
|
|
2820
|
-
|
|
2882
|
+
eyeOff: b(
|
|
2883
|
+
u`<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"/>`
|
|
2821
2884
|
),
|
|
2822
|
-
arrowLeft:
|
|
2823
|
-
alert:
|
|
2824
|
-
|
|
2885
|
+
arrowLeft: b(u`<path d="m12 19-7-7 7-7"/><path d="M19 12H5"/>`),
|
|
2886
|
+
alert: b(
|
|
2887
|
+
u`<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"/>`
|
|
2825
2888
|
),
|
|
2826
|
-
info:
|
|
2827
|
-
checkCircle:
|
|
2828
|
-
link:
|
|
2829
|
-
|
|
2889
|
+
info: b(u`<circle cx="12" cy="12" r="10"/><path d="M12 16v-4"/><path d="M12 8h.01"/>`),
|
|
2890
|
+
checkCircle: b(u`<circle cx="12" cy="12" r="10"/><path d="m9 12 2 2 4-4"/>`),
|
|
2891
|
+
link: b(
|
|
2892
|
+
u`<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"/>`
|
|
2830
2893
|
),
|
|
2831
|
-
activity:
|
|
2832
|
-
|
|
2894
|
+
activity: b(
|
|
2895
|
+
u`<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"/>`
|
|
2833
2896
|
),
|
|
2834
|
-
trash:
|
|
2835
|
-
|
|
2897
|
+
trash: b(
|
|
2898
|
+
u`<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"/>`
|
|
2836
2899
|
),
|
|
2837
|
-
sparkles:
|
|
2838
|
-
|
|
2900
|
+
sparkles: b(
|
|
2901
|
+
u`<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"/>`
|
|
2839
2902
|
),
|
|
2840
|
-
refresh:
|
|
2841
|
-
|
|
2903
|
+
refresh: b(
|
|
2904
|
+
u`<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"/>`
|
|
2842
2905
|
),
|
|
2843
|
-
chevronDown:
|
|
2844
|
-
ghost:
|
|
2845
|
-
|
|
2906
|
+
chevronDown: b(u`<path d="m6 9 6 6 6-6"/>`),
|
|
2907
|
+
ghost: b(
|
|
2908
|
+
u`<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"/>`
|
|
2846
2909
|
),
|
|
2847
|
-
qr:
|
|
2848
|
-
|
|
2910
|
+
qr: b(
|
|
2911
|
+
u`<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"/>`
|
|
2849
2912
|
)
|
|
2850
|
-
},
|
|
2851
|
-
google:
|
|
2852
|
-
|
|
2913
|
+
}, S = (e, t = "0 0 24 24") => r`<svg xmlns="http://www.w3.org/2000/svg" viewBox=${t} aria-hidden="true">${e}</svg>`, Gt = {
|
|
2914
|
+
google: S(
|
|
2915
|
+
u`<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"/>`
|
|
2853
2916
|
),
|
|
2854
|
-
github:
|
|
2855
|
-
|
|
2917
|
+
github: S(
|
|
2918
|
+
u`<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"/>`
|
|
2856
2919
|
),
|
|
2857
|
-
apple:
|
|
2858
|
-
|
|
2920
|
+
apple: S(
|
|
2921
|
+
u`<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"/>`
|
|
2859
2922
|
),
|
|
2860
|
-
facebook:
|
|
2861
|
-
|
|
2923
|
+
facebook: S(
|
|
2924
|
+
u`<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"/>`
|
|
2862
2925
|
),
|
|
2863
|
-
x:
|
|
2864
|
-
|
|
2926
|
+
x: S(
|
|
2927
|
+
u`<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"/>`
|
|
2865
2928
|
),
|
|
2866
|
-
microsoft:
|
|
2867
|
-
|
|
2929
|
+
microsoft: S(
|
|
2930
|
+
u`<path fill="#F25022" d="M1 1h10v10H1z"/><path fill="#7FBA00" d="M13 1h10v10H13z"/><path fill="#00A4EF" d="M1 13h10v10H1z"/><path fill="#FFB900" d="M13 13h10v10H13z"/>`
|
|
2868
2931
|
),
|
|
2869
|
-
discord:
|
|
2870
|
-
|
|
2932
|
+
discord: S(
|
|
2933
|
+
u`<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"/>`
|
|
2871
2934
|
),
|
|
2872
|
-
gitlab:
|
|
2873
|
-
|
|
2935
|
+
gitlab: S(
|
|
2936
|
+
u`<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"/>`
|
|
2874
2937
|
),
|
|
2875
|
-
linkedin:
|
|
2876
|
-
|
|
2938
|
+
linkedin: S(
|
|
2939
|
+
u`<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"/>`
|
|
2877
2940
|
),
|
|
2878
|
-
slack:
|
|
2879
|
-
|
|
2941
|
+
slack: S(
|
|
2942
|
+
u`<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"/>`
|
|
2880
2943
|
),
|
|
2881
|
-
twitch:
|
|
2882
|
-
|
|
2944
|
+
twitch: S(
|
|
2945
|
+
u`<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"/>`
|
|
2883
2946
|
),
|
|
2884
|
-
spotify:
|
|
2885
|
-
|
|
2947
|
+
spotify: S(
|
|
2948
|
+
u`<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"/>`
|
|
2886
2949
|
),
|
|
2887
|
-
notion:
|
|
2888
|
-
|
|
2950
|
+
notion: S(
|
|
2951
|
+
u`<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"/>`
|
|
2889
2952
|
),
|
|
2890
|
-
dropbox:
|
|
2891
|
-
|
|
2953
|
+
dropbox: S(
|
|
2954
|
+
u`<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"/>`
|
|
2892
2955
|
),
|
|
2893
|
-
figma:
|
|
2894
|
-
|
|
2956
|
+
figma: S(
|
|
2957
|
+
u`<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"/>`
|
|
2895
2958
|
),
|
|
2896
|
-
bitbucket:
|
|
2897
|
-
|
|
2959
|
+
bitbucket: S(
|
|
2960
|
+
u`<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"/>`
|
|
2898
2961
|
),
|
|
2899
|
-
amazon:
|
|
2900
|
-
|
|
2962
|
+
amazon: S(
|
|
2963
|
+
u`<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"/>`
|
|
2901
2964
|
),
|
|
2902
|
-
paypal:
|
|
2903
|
-
|
|
2965
|
+
paypal: S(
|
|
2966
|
+
u`<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"/>`
|
|
2904
2967
|
)
|
|
2905
2968
|
};
|
|
2906
|
-
function
|
|
2907
|
-
return
|
|
2969
|
+
function B(e) {
|
|
2970
|
+
return Gt[e] ?? l.globe;
|
|
2908
2971
|
}
|
|
2909
|
-
function
|
|
2972
|
+
function lt(e) {
|
|
2910
2973
|
const t = (e.trim()[0] ?? "?").toUpperCase();
|
|
2911
2974
|
return /[A-Z0-9]/i.test(t) ? t : l.user;
|
|
2912
2975
|
}
|
|
2913
|
-
function
|
|
2976
|
+
function X(e) {
|
|
2914
2977
|
typeof document > "u" || (document.querySelector("authui-modal") || document.body.appendChild(document.createElement("authui-modal")), queueMicrotask(() => {
|
|
2915
2978
|
window.dispatchEvent(new CustomEvent("authui:open", { detail: { view: e } }));
|
|
2916
2979
|
}));
|
|
2917
2980
|
}
|
|
2918
|
-
function
|
|
2981
|
+
function de() {
|
|
2919
2982
|
typeof window > "u" || window.dispatchEvent(new CustomEvent("authui:close"));
|
|
2920
2983
|
}
|
|
2921
|
-
function
|
|
2984
|
+
function rt(e) {
|
|
2922
2985
|
const t = {
|
|
2923
2986
|
length: e.length >= 8,
|
|
2924
2987
|
long: e.length >= 12,
|
|
@@ -2934,29 +2997,33 @@ function it(e) {
|
|
|
2934
2997
|
let s, a;
|
|
2935
2998
|
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 };
|
|
2936
2999
|
}
|
|
2937
|
-
var
|
|
2938
|
-
for (var a = s > 1 ? void 0 : s ?
|
|
2939
|
-
(
|
|
2940
|
-
return s && a &&
|
|
3000
|
+
var Yt = Object.defineProperty, Zt = Object.getOwnPropertyDescriptor, k = (e, t, i, s) => {
|
|
3001
|
+
for (var a = s > 1 ? void 0 : s ? Zt(t, i) : t, h = e.length - 1, d; h >= 0; h--)
|
|
3002
|
+
(d = e[h]) && (a = (s ? d(t, i, a) : d(a)) || a);
|
|
3003
|
+
return s && a && Yt(t, i, a), a;
|
|
2941
3004
|
};
|
|
2942
|
-
let
|
|
3005
|
+
let $ = class extends U {
|
|
2943
3006
|
constructor() {
|
|
2944
|
-
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.expandedOAuth = null, 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) => {
|
|
3007
|
+
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.showPasswordConfirm = !1, this.expandedOAuth = null, 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.legalAccepted = !1, this.legalErrorFromOAuth = !1, this.onSignIn = (e) => {
|
|
2945
3008
|
e.preventDefault(), this.requireValid(e) && this.run(async () => {
|
|
2946
|
-
await o.signInWithEmailPassword(this.email, this.password), this.password = "",
|
|
3009
|
+
await o.signInWithEmailPassword(this.email, this.password), this.password = "", _("email-password"), this.fire("authui-success", { method: "email-password" });
|
|
2947
3010
|
});
|
|
2948
3011
|
}, this.onSignUp = (e) => {
|
|
2949
|
-
e.preventDefault(), this.requireValid(e) && this.run(async () => {
|
|
2950
|
-
await o.signUp(this.email, this.password, this.name), this.password = "",
|
|
2951
|
-
});
|
|
3012
|
+
e.preventDefault(), this.requireValid(e) && (this.legalErrorFromOAuth = !1, this.ensureLegalAccepted() && this.run(async () => {
|
|
3013
|
+
await o.signUp(this.email, this.password, this.name), this.password = "", _("email-password"), this.fire("authui-success", { method: "sign-up" });
|
|
3014
|
+
}));
|
|
2952
3015
|
}, this.onGuest = () => {
|
|
2953
3016
|
this.run(async () => {
|
|
2954
|
-
await o.signInAnonymously(),
|
|
3017
|
+
await o.signInAnonymously(), _("anonymous"), this.fire("authui-success", { method: "anonymous" });
|
|
2955
3018
|
});
|
|
2956
3019
|
}, this.onOAuth = (e) => {
|
|
2957
|
-
this.
|
|
2958
|
-
|
|
2959
|
-
|
|
3020
|
+
if (this.step === "sign-up" && !this.ensureLegalAccepted()) {
|
|
3021
|
+
this.legalErrorFromOAuth = !0;
|
|
3022
|
+
return;
|
|
3023
|
+
}
|
|
3024
|
+
this.legalErrorFromOAuth = !1, this.run(async () => {
|
|
3025
|
+
if (Ft(e), await o.signInWithOAuth(e), o.isPreview) {
|
|
3026
|
+
$t(), this.fire("authui-success", { method: "oauth" });
|
|
2960
3027
|
return;
|
|
2961
3028
|
}
|
|
2962
3029
|
await new Promise((t) => setTimeout(t, 4e3));
|
|
@@ -2993,18 +3060,18 @@ let k = class extends E {
|
|
|
2993
3060
|
kind: "email-otp",
|
|
2994
3061
|
target: this.email,
|
|
2995
3062
|
phrase: t.phrase
|
|
2996
|
-
}, this.code = "";
|
|
3063
|
+
}, this.code = "", this.resendCooldownUntil = Date.now() + 3e4, window.setTimeout(() => this.requestUpdate(), 3e4);
|
|
2997
3064
|
});
|
|
2998
3065
|
}, this.onPhoneOtp = (e) => {
|
|
2999
3066
|
e.preventDefault(), this.requireValid(e) && this.run(async () => {
|
|
3000
3067
|
const t = await o.sendPhoneOtp(this.phone);
|
|
3001
|
-
this.token = { userId: t.userId, kind: "phone", target: this.phone }, this.code = "";
|
|
3068
|
+
this.token = { userId: t.userId, kind: "phone", target: this.phone }, this.code = "", this.resendCooldownUntil = Date.now() + 3e4, window.setTimeout(() => this.requestUpdate(), 3e4);
|
|
3002
3069
|
});
|
|
3003
3070
|
}, this.onVerifyCode = (e) => {
|
|
3004
3071
|
if (e.preventDefault(), !this.requireValid(e)) return;
|
|
3005
3072
|
const t = this.token;
|
|
3006
3073
|
t && this.run(async () => {
|
|
3007
|
-
await o.signInWithToken(t.userId, this.code), this.code = "", this.token = null,
|
|
3074
|
+
await o.signInWithToken(t.userId, this.code), this.code = "", this.token = null, _(t.kind), this.fire("authui-success", { method: t.kind });
|
|
3008
3075
|
}, "code");
|
|
3009
3076
|
}, this.onChooseFactor = (e) => {
|
|
3010
3077
|
this.run(async () => {
|
|
@@ -3022,7 +3089,7 @@ let k = class extends E {
|
|
|
3022
3089
|
try {
|
|
3023
3090
|
await o.signOut();
|
|
3024
3091
|
} catch (e) {
|
|
3025
|
-
if (!
|
|
3092
|
+
if (!j(e, v.sessionNotFound)) throw e;
|
|
3026
3093
|
}
|
|
3027
3094
|
this.go("sign-in");
|
|
3028
3095
|
});
|
|
@@ -3054,7 +3121,7 @@ let k = class extends E {
|
|
|
3054
3121
|
this.notice = null, this.auth.pending?.type === "notice" && o.setPending(null);
|
|
3055
3122
|
}
|
|
3056
3123
|
go(e) {
|
|
3057
|
-
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 });
|
|
3124
|
+
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.showPasswordConfirm = !1, this.password = "", this.passwordConfirm = "", this.legalAccepted = !1, this.legalErrorFromOAuth = !1, e !== "mfa" && (this.challenge = null), e !== "email-otp" && e !== "phone" && e !== "magic-url" && (this.token = null), this.fire("authui-view", { view: e });
|
|
3058
3125
|
}
|
|
3059
3126
|
// ───────────────────────────── actions ─────────────────────────────
|
|
3060
3127
|
async run(e, t = "link") {
|
|
@@ -3063,7 +3130,7 @@ let k = class extends E {
|
|
|
3063
3130
|
try {
|
|
3064
3131
|
await e();
|
|
3065
3132
|
} catch (i) {
|
|
3066
|
-
this.error =
|
|
3133
|
+
this.error = Y(i, this.strings, t);
|
|
3067
3134
|
} finally {
|
|
3068
3135
|
this.busy = !1;
|
|
3069
3136
|
}
|
|
@@ -3156,7 +3223,7 @@ let k = class extends E {
|
|
|
3156
3223
|
</button>`;
|
|
3157
3224
|
}
|
|
3158
3225
|
passwordField(e) {
|
|
3159
|
-
const t = this[e.field], i = e.meter ?
|
|
3226
|
+
const t = this[e.field], i = e.field === "passwordConfirm" ? this.showPasswordConfirm : this.showPassword, s = e.meter ? rt(t) : null;
|
|
3160
3227
|
return r`
|
|
3161
3228
|
<div class="field">
|
|
3162
3229
|
<div class="field-header">
|
|
@@ -3173,7 +3240,7 @@ let k = class extends E {
|
|
|
3173
3240
|
<input
|
|
3174
3241
|
class="input"
|
|
3175
3242
|
id=${e.id}
|
|
3176
|
-
type=${
|
|
3243
|
+
type=${i ? "text" : "password"}
|
|
3177
3244
|
autocomplete=${e.autocomplete}
|
|
3178
3245
|
required
|
|
3179
3246
|
minlength="8"
|
|
@@ -3183,26 +3250,28 @@ let k = class extends E {
|
|
|
3183
3250
|
<button
|
|
3184
3251
|
type="button"
|
|
3185
3252
|
class="btn btn-ghost btn-icon"
|
|
3186
|
-
@click=${() =>
|
|
3187
|
-
|
|
3253
|
+
@click=${() => {
|
|
3254
|
+
e.field === "passwordConfirm" ? this.showPasswordConfirm = !this.showPasswordConfirm : this.showPassword = !this.showPassword;
|
|
3255
|
+
}}
|
|
3256
|
+
aria-label=${i ? this.t("hidePassword") : this.t("showPassword")}
|
|
3188
3257
|
>
|
|
3189
|
-
${
|
|
3258
|
+
${i ? l.eyeOff : l.eye}
|
|
3190
3259
|
</button>
|
|
3191
3260
|
</div>
|
|
3192
|
-
${
|
|
3261
|
+
${s && t ? r`<div class="strength" aria-live="polite">
|
|
3193
3262
|
<div
|
|
3194
3263
|
class="strength-meter"
|
|
3195
|
-
data-level=${String(
|
|
3264
|
+
data-level=${String(s.level)}
|
|
3196
3265
|
role="meter"
|
|
3197
3266
|
aria-label=${this.t("passwordStrengthLabel")}
|
|
3198
3267
|
aria-valuemin="0"
|
|
3199
3268
|
aria-valuemax="4"
|
|
3200
|
-
aria-valuenow=${String(
|
|
3201
|
-
aria-valuetext=${this.t(
|
|
3269
|
+
aria-valuenow=${String(s.level)}
|
|
3270
|
+
aria-valuetext=${this.t(s.labelKey)}
|
|
3202
3271
|
>
|
|
3203
3272
|
<span></span><span></span><span></span><span></span>
|
|
3204
3273
|
</div>
|
|
3205
|
-
<p class="strength-label">${this.t(
|
|
3274
|
+
<p class="strength-label">${this.t(s.labelKey)}</p>
|
|
3206
3275
|
</div>` : e.hint ? r`<p class="hint">${e.hint}</p>` : n}
|
|
3207
3276
|
</div>
|
|
3208
3277
|
`;
|
|
@@ -3243,14 +3312,35 @@ let k = class extends E {
|
|
|
3243
3312
|
</div>
|
|
3244
3313
|
`;
|
|
3245
3314
|
}
|
|
3315
|
+
/** True when sign-up must show/enforce the legal checkbox. */
|
|
3316
|
+
needsLegalAcceptance() {
|
|
3317
|
+
const e = this.config?.legal;
|
|
3318
|
+
return e?.requireAcceptance ? !!(e.termsUrl || e.privacyUrl) : !1;
|
|
3319
|
+
}
|
|
3320
|
+
/** Block sign-up / OAuth when the required legal checkbox is unchecked. */
|
|
3321
|
+
ensureLegalAccepted() {
|
|
3322
|
+
return !this.needsLegalAcceptance() || this.legalAccepted ? !0 : (this.error = this.t("errorLegalRequired"), !1);
|
|
3323
|
+
}
|
|
3324
|
+
legalLinks() {
|
|
3325
|
+
const e = this.config?.legal;
|
|
3326
|
+
return !e?.termsUrl && !e?.privacyUrl ? n : r`${e.termsUrl ? r`<a href=${e.termsUrl} target="_blank" rel="noopener">${this.t("terms")}</a>` : n}${e.termsUrl && e.privacyUrl ? r` ${this.t("and")} ` : n}${e.privacyUrl ? r`<a href=${e.privacyUrl} target="_blank" rel="noopener">${this.t("privacy")}</a>` : n}`;
|
|
3327
|
+
}
|
|
3246
3328
|
legal() {
|
|
3247
3329
|
const e = this.config?.legal;
|
|
3248
|
-
return !e?.termsUrl && !e?.privacyUrl ? n : r`<p class="legal"
|
|
3249
|
-
|
|
3250
|
-
|
|
3251
|
-
|
|
3252
|
-
|
|
3253
|
-
|
|
3330
|
+
return !e?.termsUrl && !e?.privacyUrl ? n : this.step === "sign-up" && this.needsLegalAcceptance() ? n : r`<p class="legal">${this.t("agreeTo")} ${this.legalLinks()}.</p>`;
|
|
3331
|
+
}
|
|
3332
|
+
/** Required acceptance checkbox on sign-up when legal.requireAcceptance is set. */
|
|
3333
|
+
legalAcceptField() {
|
|
3334
|
+
return this.needsLegalAcceptance() ? r`<label class="legal-accept">
|
|
3335
|
+
<input
|
|
3336
|
+
type="checkbox"
|
|
3337
|
+
.checked=${this.legalAccepted}
|
|
3338
|
+
@change=${(e) => {
|
|
3339
|
+
this.legalAccepted = e.target.checked, this.legalAccepted && this.error === this.t("errorLegalRequired") && (this.error = "", this.legalErrorFromOAuth = !1);
|
|
3340
|
+
}}
|
|
3341
|
+
/>
|
|
3342
|
+
<span>${this.t("acceptLegal")} ${this.legalLinks()}.</span>
|
|
3343
|
+
</label>` : n;
|
|
3254
3344
|
}
|
|
3255
3345
|
backLink(e = "sign-in") {
|
|
3256
3346
|
return r`<div class="links">
|
|
@@ -3298,7 +3388,7 @@ let k = class extends E {
|
|
|
3298
3388
|
<div class="stack">
|
|
3299
3389
|
<div class="row">
|
|
3300
3390
|
<div class="inline">
|
|
3301
|
-
<span class="avatar">${
|
|
3391
|
+
<span class="avatar">${lt(t)}</span>
|
|
3302
3392
|
<div class="row-main">
|
|
3303
3393
|
<span class="row-title" title=${t}>${t}</span>
|
|
3304
3394
|
${e.email && e.name ? r`<span class="row-sub" title=${e.email}>${e.email}</span>` : n}
|
|
@@ -3313,7 +3403,7 @@ let k = class extends E {
|
|
|
3313
3403
|
<button
|
|
3314
3404
|
class="btn btn-outline btn-block"
|
|
3315
3405
|
@click=${() => {
|
|
3316
|
-
this.embedded ? this.fire("authui-open", { view: "account" }) :
|
|
3406
|
+
this.embedded ? this.fire("authui-open", { view: "account" }) : X("account");
|
|
3317
3407
|
}}
|
|
3318
3408
|
>
|
|
3319
3409
|
${l.settings} ${this.t("manageAccount")}
|
|
@@ -3328,32 +3418,56 @@ let k = class extends E {
|
|
|
3328
3418
|
renderProviders() {
|
|
3329
3419
|
const e = [...this.config?.methods?.oauth ?? []];
|
|
3330
3420
|
if (e.length === 0) return n;
|
|
3331
|
-
const t = z(), i = e.find((
|
|
3332
|
-
if (
|
|
3333
|
-
const
|
|
3334
|
-
const
|
|
3335
|
-
return
|
|
3421
|
+
const t = z(), i = e.find((d) => t === `oauth:${d}`) ?? null, s = this.config?.methods?.oauthLayout, a = s === "horizontal" || s === "icon" ? "icon" : s === "stack" || s === "accordion" ? s : e.length <= 2 ? "stack" : "accordion";
|
|
3422
|
+
if (a === "icon") {
|
|
3423
|
+
const d = [...e].sort((g, y) => {
|
|
3424
|
+
const C = t === `oauth:${g}` ? 0 : 1, tt = t === `oauth:${y}` ? 0 : 1;
|
|
3425
|
+
return C - tt;
|
|
3426
|
+
});
|
|
3427
|
+
return r`
|
|
3428
|
+
<div class="providers icon">
|
|
3429
|
+
${d.map((g) => {
|
|
3430
|
+
const y = t === `oauth:${g}`, C = this.t("continueWith", { provider: N(g) });
|
|
3431
|
+
return r`<button
|
|
3432
|
+
type="button"
|
|
3433
|
+
class="btn btn-outline ${y ? "last-used" : ""}"
|
|
3434
|
+
@click=${() => this.onOAuth(g)}
|
|
3435
|
+
?disabled=${this.busy}
|
|
3436
|
+
aria-label=${y ? `${C}. ${this.t("lastUsed")}` : C}
|
|
3437
|
+
title=${C}
|
|
3438
|
+
>
|
|
3439
|
+
${B(g)}
|
|
3440
|
+
${y ? r`<span class="oauth-last-used-dot" aria-hidden="true"></span>` : n}
|
|
3441
|
+
</button>`;
|
|
3442
|
+
})}
|
|
3443
|
+
</div>
|
|
3444
|
+
`;
|
|
3445
|
+
}
|
|
3446
|
+
if (a === "stack") {
|
|
3447
|
+
const d = [...e].sort((g, y) => {
|
|
3448
|
+
const C = t === `oauth:${g}` ? 0 : 1, tt = t === `oauth:${y}` ? 0 : 1;
|
|
3449
|
+
return C - tt;
|
|
3336
3450
|
});
|
|
3337
3451
|
return r`
|
|
3338
3452
|
<div class="providers">
|
|
3339
|
-
${
|
|
3340
|
-
const
|
|
3453
|
+
${d.map((g) => {
|
|
3454
|
+
const y = t === `oauth:${g}`, C = this.t("continueWith", { provider: N(g) });
|
|
3341
3455
|
return r`<button
|
|
3342
3456
|
type="button"
|
|
3343
|
-
class="btn btn-outline ${
|
|
3344
|
-
@click=${() => this.onOAuth(
|
|
3457
|
+
class="btn btn-outline ${y ? "last-used" : ""}"
|
|
3458
|
+
@click=${() => this.onOAuth(g)}
|
|
3345
3459
|
?disabled=${this.busy}
|
|
3346
|
-
aria-label=${
|
|
3460
|
+
aria-label=${y ? `${C}. ${this.t("lastUsed")}` : C}
|
|
3347
3461
|
>
|
|
3348
|
-
${
|
|
3349
|
-
<span>${
|
|
3350
|
-
${
|
|
3462
|
+
${B(g)}
|
|
3463
|
+
<span>${C}</span>
|
|
3464
|
+
${y ? r`<span class="last-used-badge">${this.t("lastUsed")}</span>` : n}
|
|
3351
3465
|
</button>`;
|
|
3352
3466
|
})}
|
|
3353
3467
|
</div>
|
|
3354
3468
|
`;
|
|
3355
3469
|
}
|
|
3356
|
-
const
|
|
3470
|
+
const h = this.expandedOAuth && e.includes(this.expandedOAuth) ? this.expandedOAuth : i ?? e[0];
|
|
3357
3471
|
return r`
|
|
3358
3472
|
<div
|
|
3359
3473
|
class="providers accordion"
|
|
@@ -3361,29 +3475,29 @@ let k = class extends E {
|
|
|
3361
3475
|
this.expandedOAuth = i ?? e[0];
|
|
3362
3476
|
}}
|
|
3363
3477
|
>
|
|
3364
|
-
${e.map((
|
|
3365
|
-
const
|
|
3478
|
+
${e.map((d) => {
|
|
3479
|
+
const g = t === `oauth:${d}`, y = h === d, C = this.t("continueWith", { provider: N(d) });
|
|
3366
3480
|
return r`<div
|
|
3367
|
-
class="provider-slot ${
|
|
3481
|
+
class="provider-slot ${y ? "is-expanded" : ""}"
|
|
3368
3482
|
@mouseenter=${() => {
|
|
3369
|
-
this.expandedOAuth =
|
|
3483
|
+
this.expandedOAuth = d;
|
|
3370
3484
|
}}
|
|
3371
3485
|
>
|
|
3372
3486
|
<button
|
|
3373
3487
|
type="button"
|
|
3374
3488
|
class="btn btn-outline"
|
|
3375
|
-
@click=${() => this.onOAuth(
|
|
3489
|
+
@click=${() => this.onOAuth(d)}
|
|
3376
3490
|
@focus=${() => {
|
|
3377
|
-
this.expandedOAuth =
|
|
3491
|
+
this.expandedOAuth = d;
|
|
3378
3492
|
}}
|
|
3379
3493
|
?disabled=${this.busy}
|
|
3380
|
-
aria-label=${
|
|
3494
|
+
aria-label=${g ? `${C}. ${this.t("lastUsed")}` : C}
|
|
3381
3495
|
>
|
|
3382
|
-
${
|
|
3496
|
+
${B(d)}
|
|
3383
3497
|
<span class="provider-label"
|
|
3384
|
-
><span><span class="provider-label-text">${
|
|
3498
|
+
><span><span class="provider-label-text">${C}</span></span></span
|
|
3385
3499
|
>
|
|
3386
|
-
${
|
|
3500
|
+
${g ? r`<span class="oauth-last-used" data-last-used=${d} aria-hidden="true">
|
|
3387
3501
|
<span class="oauth-last-used-dot"></span>
|
|
3388
3502
|
<span class="oauth-last-used-pill">${this.t("lastUsed")}</span>
|
|
3389
3503
|
</span>` : n}
|
|
@@ -3417,14 +3531,15 @@ let k = class extends E {
|
|
|
3417
3531
|
</form>` : this.renderError()}
|
|
3418
3532
|
${s.length > 0 ? r`<div class="stack-sm">
|
|
3419
3533
|
${s.map((a) => {
|
|
3420
|
-
const
|
|
3534
|
+
const h = z() === a.step;
|
|
3421
3535
|
return r`<button
|
|
3422
3536
|
type="button"
|
|
3423
|
-
class="btn btn-secondary btn-block ${
|
|
3537
|
+
class="btn btn-secondary btn-block ${h ? "last-used" : ""}"
|
|
3424
3538
|
@click=${() => this.go(a.step)}
|
|
3539
|
+
?disabled=${this.busy}
|
|
3425
3540
|
>
|
|
3426
3541
|
${a.icon} ${a.label}
|
|
3427
|
-
${
|
|
3542
|
+
${h ? r`<span class="last-used-badge">${this.t("lastUsed")}</span>` : n}
|
|
3428
3543
|
</button>`;
|
|
3429
3544
|
})}
|
|
3430
3545
|
</div>` : n}
|
|
@@ -3448,9 +3563,10 @@ let k = class extends E {
|
|
|
3448
3563
|
`;
|
|
3449
3564
|
}
|
|
3450
3565
|
renderSignUp() {
|
|
3566
|
+
const e = this.legalErrorFromOAuth && this.error === this.t("errorLegalRequired");
|
|
3451
3567
|
return r`
|
|
3452
3568
|
<div class="stack">
|
|
3453
|
-
${this.renderProviders()}
|
|
3569
|
+
${this.renderProviders()} ${e ? this.renderError() : n}
|
|
3454
3570
|
${(this.config?.methods?.oauth?.length ?? 0) > 0 ? r`<div class="separator-text">${this.t("or")}</div>` : n}
|
|
3455
3571
|
<form class="form" @submit=${this.onSignUp} novalidate>
|
|
3456
3572
|
${this.config?.requireName !== !1 ? r`<div class="field">
|
|
@@ -3467,7 +3583,8 @@ let k = class extends E {
|
|
|
3467
3583
|
</div>` : n}
|
|
3468
3584
|
${this.emailField()}
|
|
3469
3585
|
${this.passwordField({ label: this.t("password"), autocomplete: "new-password", id: "authui-password", field: "password", hint: this.t("passwordHint"), meter: !0 })}
|
|
3470
|
-
${this.
|
|
3586
|
+
${this.legalAcceptField()} ${e ? n : this.renderError()}
|
|
3587
|
+
${this.submitButton(this.t("createAccount"))}
|
|
3471
3588
|
</form>
|
|
3472
3589
|
<div class="links">
|
|
3473
3590
|
<span>${this.t("haveAccount")}</span>
|
|
@@ -3721,60 +3838,75 @@ let k = class extends E {
|
|
|
3721
3838
|
`;
|
|
3722
3839
|
}
|
|
3723
3840
|
};
|
|
3724
|
-
|
|
3725
|
-
|
|
3726
|
-
|
|
3727
|
-
],
|
|
3728
|
-
|
|
3729
|
-
|
|
3730
|
-
],
|
|
3731
|
-
|
|
3732
|
-
|
|
3733
|
-
],
|
|
3734
|
-
|
|
3735
|
-
|
|
3736
|
-
],
|
|
3737
|
-
|
|
3738
|
-
|
|
3739
|
-
],
|
|
3740
|
-
|
|
3741
|
-
|
|
3742
|
-
],
|
|
3743
|
-
|
|
3744
|
-
|
|
3745
|
-
],
|
|
3746
|
-
|
|
3747
|
-
|
|
3748
|
-
],
|
|
3749
|
-
|
|
3750
|
-
|
|
3751
|
-
],
|
|
3752
|
-
|
|
3753
|
-
|
|
3754
|
-
],
|
|
3755
|
-
|
|
3756
|
-
|
|
3757
|
-
],
|
|
3758
|
-
|
|
3759
|
-
|
|
3760
|
-
],
|
|
3761
|
-
|
|
3762
|
-
|
|
3763
|
-
],
|
|
3764
|
-
k
|
|
3841
|
+
$.styles = [...U.styles, Kt];
|
|
3842
|
+
k([
|
|
3843
|
+
m({ type: String })
|
|
3844
|
+
], $.prototype, "view", 2);
|
|
3845
|
+
k([
|
|
3846
|
+
m({ type: Boolean })
|
|
3847
|
+
], $.prototype, "embedded", 2);
|
|
3848
|
+
k([
|
|
3849
|
+
c()
|
|
3850
|
+
], $.prototype, "step", 2);
|
|
3851
|
+
k([
|
|
3852
|
+
c()
|
|
3853
|
+
], $.prototype, "busy", 2);
|
|
3854
|
+
k([
|
|
3855
|
+
c()
|
|
3856
|
+
], $.prototype, "error", 2);
|
|
3857
|
+
k([
|
|
3858
|
+
c()
|
|
3859
|
+
], $.prototype, "notice", 2);
|
|
3860
|
+
k([
|
|
3861
|
+
c()
|
|
3862
|
+
], $.prototype, "showPassword", 2);
|
|
3863
|
+
k([
|
|
3864
|
+
c()
|
|
3865
|
+
], $.prototype, "showPasswordConfirm", 2);
|
|
3866
|
+
k([
|
|
3867
|
+
c()
|
|
3868
|
+
], $.prototype, "expandedOAuth", 2);
|
|
3869
|
+
k([
|
|
3870
|
+
c()
|
|
3871
|
+
], $.prototype, "token", 2);
|
|
3872
|
+
k([
|
|
3873
|
+
c()
|
|
3874
|
+
], $.prototype, "resendCooldownUntil", 2);
|
|
3875
|
+
k([
|
|
3876
|
+
c()
|
|
3877
|
+
], $.prototype, "challenge", 2);
|
|
3878
|
+
k([
|
|
3879
|
+
c()
|
|
3880
|
+
], $.prototype, "recovery", 2);
|
|
3881
|
+
k([
|
|
3882
|
+
at("form input:not([type=hidden])")
|
|
3883
|
+
], $.prototype, "firstInput", 2);
|
|
3884
|
+
k([
|
|
3885
|
+
c()
|
|
3886
|
+
], $.prototype, "password", 2);
|
|
3887
|
+
k([
|
|
3888
|
+
c()
|
|
3889
|
+
], $.prototype, "passwordConfirm", 2);
|
|
3890
|
+
k([
|
|
3891
|
+
c()
|
|
3892
|
+
], $.prototype, "legalAccepted", 2);
|
|
3893
|
+
k([
|
|
3894
|
+
c()
|
|
3895
|
+
], $.prototype, "legalErrorFromOAuth", 2);
|
|
3896
|
+
$ = k([
|
|
3765
3897
|
T("authui-sign-in")
|
|
3766
|
-
],
|
|
3767
|
-
var
|
|
3768
|
-
for (var a = s > 1 ? void 0 : s ?
|
|
3769
|
-
(
|
|
3770
|
-
return s && a &&
|
|
3898
|
+
], $);
|
|
3899
|
+
var Xt = Object.defineProperty, Qt = Object.getOwnPropertyDescriptor, f = (e, t, i, s) => {
|
|
3900
|
+
for (var a = s > 1 ? void 0 : s ? Qt(t, i) : t, h = e.length - 1, d; h >= 0; h--)
|
|
3901
|
+
(d = e[h]) && (a = (s ? d(t, i, a) : d(a)) || a);
|
|
3902
|
+
return s && a && Xt(t, i, a), a;
|
|
3771
3903
|
};
|
|
3772
|
-
let p = class extends
|
|
3904
|
+
let p = class extends U {
|
|
3773
3905
|
constructor() {
|
|
3774
3906
|
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.verifyEmailCooldownTimer = null, this.onTabsKeydown = (e) => {
|
|
3775
3907
|
const t = [...this.renderRoot?.querySelectorAll('[role="tab"]') ?? []];
|
|
3776
3908
|
if (!t.length) return;
|
|
3777
|
-
const i = t.findIndex((
|
|
3909
|
+
const i = t.findIndex((h) => h.getAttribute("aria-selected") === "true");
|
|
3778
3910
|
let s = i;
|
|
3779
3911
|
if (e.key === "ArrowRight" || e.key === "ArrowDown") s = (i + 1) % t.length;
|
|
3780
3912
|
else if (e.key === "ArrowLeft" || e.key === "ArrowUp")
|
|
@@ -3875,7 +4007,7 @@ let p = class extends E {
|
|
|
3875
4007
|
try {
|
|
3876
4008
|
this.recoveryCodes = await o.createRecoveryCodes();
|
|
3877
4009
|
} catch (e) {
|
|
3878
|
-
if (!
|
|
4010
|
+
if (!j(e, v.recoveryCodesExist)) throw e;
|
|
3879
4011
|
this.recoveryCodes = await o.getRecoveryCodes();
|
|
3880
4012
|
}
|
|
3881
4013
|
await this.loadFactors();
|
|
@@ -3998,9 +4130,9 @@ let p = class extends E {
|
|
|
3998
4130
|
try {
|
|
3999
4131
|
await t(), i && this.setNotice("success", i);
|
|
4000
4132
|
} catch (s) {
|
|
4001
|
-
|
|
4133
|
+
j(s, v.challengeRequired) ? this.stepUp = { retry: () => this.run(e, t, i) } : this.errors = {
|
|
4002
4134
|
...this.errors,
|
|
4003
|
-
[e]:
|
|
4135
|
+
[e]: Y(
|
|
4004
4136
|
s,
|
|
4005
4137
|
this.strings,
|
|
4006
4138
|
e.includes("code") ? "code" : e === "password" ? "password" : "link"
|
|
@@ -4147,7 +4279,7 @@ let p = class extends E {
|
|
|
4147
4279
|
return r`
|
|
4148
4280
|
<div class="between">
|
|
4149
4281
|
<div class="identity">
|
|
4150
|
-
<span class="avatar">${
|
|
4282
|
+
<span class="avatar">${lt(t)}</span>
|
|
4151
4283
|
<div class="row-main">
|
|
4152
4284
|
<span class="row-title" title=${t}>
|
|
4153
4285
|
${t}
|
|
@@ -4272,7 +4404,7 @@ let p = class extends E {
|
|
|
4272
4404
|
autocomplete="new-password"
|
|
4273
4405
|
/>
|
|
4274
4406
|
${this.emailPassword ? (() => {
|
|
4275
|
-
const t =
|
|
4407
|
+
const t = rt(this.emailPassword);
|
|
4276
4408
|
return r`<div class="strength" aria-live="polite">
|
|
4277
4409
|
<div
|
|
4278
4410
|
class="strength-meter"
|
|
@@ -4533,7 +4665,7 @@ let p = class extends E {
|
|
|
4533
4665
|
autocomplete="new-password"
|
|
4534
4666
|
/>
|
|
4535
4667
|
${this.newPassword ? (() => {
|
|
4536
|
-
const i =
|
|
4668
|
+
const i = rt(this.newPassword);
|
|
4537
4669
|
return r`<div class="strength" aria-live="polite">
|
|
4538
4670
|
<div
|
|
4539
4671
|
class="strength-meter"
|
|
@@ -4582,7 +4714,7 @@ let p = class extends E {
|
|
|
4582
4714
|
</div>`;
|
|
4583
4715
|
}
|
|
4584
4716
|
renderMfaCard() {
|
|
4585
|
-
const e = this.user, t = this.factors?.totp ?? !1, i = this.authenticator ? o.isPreview ?
|
|
4717
|
+
const e = this.user, t = this.factors?.totp ?? !1, i = this.authenticator ? o.isPreview ? Ut(this.authenticator.uri) : new Ct(o.getClient()).getQR(this.authenticator.uri, 400, 1).toString() : "";
|
|
4586
4718
|
return this.card(
|
|
4587
4719
|
this.t("twoFactor"),
|
|
4588
4720
|
this.t("twoFactorDescription"),
|
|
@@ -4917,9 +5049,9 @@ let p = class extends E {
|
|
|
4917
5049
|
) : e.map(
|
|
4918
5050
|
(i) => r`<div class="row">
|
|
4919
5051
|
<div class="inline">
|
|
4920
|
-
<span class="device">${
|
|
5052
|
+
<span class="device">${B(i.provider)}</span>
|
|
4921
5053
|
<div class="row-main">
|
|
4922
|
-
<span class="row-title">${
|
|
5054
|
+
<span class="row-title">${N(i.provider)}</span>
|
|
4923
5055
|
<span class="row-sub">${i.providerEmail || i.providerUid}</span>
|
|
4924
5056
|
</div>
|
|
4925
5057
|
</div>
|
|
@@ -4962,8 +5094,8 @@ let p = class extends E {
|
|
|
4962
5094
|
}}
|
|
4963
5095
|
?disabled=${!!this.busy}
|
|
4964
5096
|
>
|
|
4965
|
-
${this.spinner(`connect-${i}`)} ${
|
|
4966
|
-
${this.t("connectProvider", { provider:
|
|
5097
|
+
${this.spinner(`connect-${i}`)} ${B(i)}
|
|
5098
|
+
${this.t("connectProvider", { provider: N(i) })}
|
|
4967
5099
|
</button>`
|
|
4968
5100
|
)}` : void 0
|
|
4969
5101
|
)}
|
|
@@ -4996,8 +5128,8 @@ let p = class extends E {
|
|
|
4996
5128
|
}
|
|
4997
5129
|
};
|
|
4998
5130
|
p.styles = [
|
|
4999
|
-
...
|
|
5000
|
-
|
|
5131
|
+
...U.styles,
|
|
5132
|
+
L`
|
|
5001
5133
|
:host {
|
|
5002
5134
|
display: block;
|
|
5003
5135
|
width: 100%;
|
|
@@ -5093,117 +5225,117 @@ p.styles = [
|
|
|
5093
5225
|
}
|
|
5094
5226
|
`
|
|
5095
5227
|
];
|
|
5096
|
-
|
|
5097
|
-
|
|
5228
|
+
f([
|
|
5229
|
+
m({ type: Boolean })
|
|
5098
5230
|
], p.prototype, "embedded", 2);
|
|
5099
|
-
|
|
5100
|
-
|
|
5231
|
+
f([
|
|
5232
|
+
m({ type: String })
|
|
5101
5233
|
], p.prototype, "tab", 2);
|
|
5102
|
-
|
|
5103
|
-
|
|
5234
|
+
f([
|
|
5235
|
+
c()
|
|
5104
5236
|
], p.prototype, "active", 2);
|
|
5105
|
-
|
|
5106
|
-
|
|
5237
|
+
f([
|
|
5238
|
+
c()
|
|
5107
5239
|
], p.prototype, "busy", 2);
|
|
5108
|
-
|
|
5109
|
-
|
|
5240
|
+
f([
|
|
5241
|
+
c()
|
|
5110
5242
|
], p.prototype, "notice", 2);
|
|
5111
|
-
|
|
5112
|
-
|
|
5243
|
+
f([
|
|
5244
|
+
c()
|
|
5113
5245
|
], p.prototype, "errors", 2);
|
|
5114
|
-
|
|
5115
|
-
|
|
5246
|
+
f([
|
|
5247
|
+
c()
|
|
5116
5248
|
], p.prototype, "nameInput", 2);
|
|
5117
|
-
|
|
5118
|
-
|
|
5249
|
+
f([
|
|
5250
|
+
c()
|
|
5119
5251
|
], p.prototype, "emailInput", 2);
|
|
5120
|
-
|
|
5121
|
-
|
|
5252
|
+
f([
|
|
5253
|
+
c()
|
|
5122
5254
|
], p.prototype, "emailPassword", 2);
|
|
5123
|
-
|
|
5124
|
-
|
|
5255
|
+
f([
|
|
5256
|
+
c()
|
|
5125
5257
|
], p.prototype, "phoneInput", 2);
|
|
5126
|
-
|
|
5127
|
-
|
|
5258
|
+
f([
|
|
5259
|
+
c()
|
|
5128
5260
|
], p.prototype, "phonePassword", 2);
|
|
5129
|
-
|
|
5130
|
-
|
|
5261
|
+
f([
|
|
5262
|
+
c()
|
|
5131
5263
|
], p.prototype, "phoneCode", 2);
|
|
5132
|
-
|
|
5133
|
-
|
|
5264
|
+
f([
|
|
5265
|
+
c()
|
|
5134
5266
|
], p.prototype, "phoneCodeSent", 2);
|
|
5135
|
-
|
|
5136
|
-
|
|
5267
|
+
f([
|
|
5268
|
+
c()
|
|
5137
5269
|
], p.prototype, "guestName", 2);
|
|
5138
|
-
|
|
5139
|
-
|
|
5270
|
+
f([
|
|
5271
|
+
c()
|
|
5140
5272
|
], p.prototype, "oldPassword", 2);
|
|
5141
|
-
|
|
5142
|
-
|
|
5273
|
+
f([
|
|
5274
|
+
c()
|
|
5143
5275
|
], p.prototype, "newPassword", 2);
|
|
5144
|
-
|
|
5145
|
-
|
|
5276
|
+
f([
|
|
5277
|
+
c()
|
|
5146
5278
|
], p.prototype, "newPasswordConfirm", 2);
|
|
5147
|
-
|
|
5148
|
-
|
|
5279
|
+
f([
|
|
5280
|
+
c()
|
|
5149
5281
|
], p.prototype, "authenticator", 2);
|
|
5150
|
-
|
|
5151
|
-
|
|
5282
|
+
f([
|
|
5283
|
+
c()
|
|
5152
5284
|
], p.prototype, "authenticatorCode", 2);
|
|
5153
|
-
|
|
5154
|
-
|
|
5285
|
+
f([
|
|
5286
|
+
c()
|
|
5155
5287
|
], p.prototype, "factors", 2);
|
|
5156
|
-
|
|
5157
|
-
|
|
5288
|
+
f([
|
|
5289
|
+
c()
|
|
5158
5290
|
], p.prototype, "recoveryCodes", 2);
|
|
5159
|
-
|
|
5160
|
-
|
|
5291
|
+
f([
|
|
5292
|
+
c()
|
|
5161
5293
|
], p.prototype, "stepUp", 2);
|
|
5162
|
-
|
|
5163
|
-
|
|
5294
|
+
f([
|
|
5295
|
+
c()
|
|
5164
5296
|
], p.prototype, "stepUpCode", 2);
|
|
5165
|
-
|
|
5166
|
-
|
|
5297
|
+
f([
|
|
5298
|
+
c()
|
|
5167
5299
|
], p.prototype, "copied", 2);
|
|
5168
|
-
|
|
5169
|
-
|
|
5300
|
+
f([
|
|
5301
|
+
c()
|
|
5170
5302
|
], p.prototype, "sessions", 2);
|
|
5171
|
-
|
|
5172
|
-
|
|
5303
|
+
f([
|
|
5304
|
+
c()
|
|
5173
5305
|
], p.prototype, "identities", 2);
|
|
5174
|
-
|
|
5175
|
-
|
|
5306
|
+
f([
|
|
5307
|
+
c()
|
|
5176
5308
|
], p.prototype, "logs", 2);
|
|
5177
|
-
|
|
5178
|
-
|
|
5309
|
+
f([
|
|
5310
|
+
c()
|
|
5179
5311
|
], p.prototype, "logsSupported", 2);
|
|
5180
|
-
|
|
5181
|
-
|
|
5312
|
+
f([
|
|
5313
|
+
c()
|
|
5182
5314
|
], p.prototype, "confirmDelete", 2);
|
|
5183
|
-
|
|
5184
|
-
|
|
5315
|
+
f([
|
|
5316
|
+
c()
|
|
5185
5317
|
], p.prototype, "confirmRegenerate", 2);
|
|
5186
|
-
|
|
5187
|
-
|
|
5318
|
+
f([
|
|
5319
|
+
c()
|
|
5188
5320
|
], p.prototype, "confirmRemoveAuthenticator", 2);
|
|
5189
|
-
|
|
5190
|
-
|
|
5321
|
+
f([
|
|
5322
|
+
c()
|
|
5191
5323
|
], p.prototype, "confirmSignOutAll", 2);
|
|
5192
|
-
|
|
5193
|
-
|
|
5324
|
+
f([
|
|
5325
|
+
c()
|
|
5194
5326
|
], p.prototype, "confirmDisconnectId", 2);
|
|
5195
|
-
|
|
5196
|
-
|
|
5327
|
+
f([
|
|
5328
|
+
c()
|
|
5197
5329
|
], p.prototype, "verifyEmailCooldownUntil", 2);
|
|
5198
|
-
p =
|
|
5330
|
+
p = f([
|
|
5199
5331
|
T("authui-account")
|
|
5200
5332
|
], p);
|
|
5201
|
-
var
|
|
5202
|
-
for (var a = s > 1 ? void 0 : s ?
|
|
5203
|
-
(
|
|
5204
|
-
return s && a &&
|
|
5333
|
+
var Jt = Object.defineProperty, te = Object.getOwnPropertyDescriptor, R = (e, t, i, s) => {
|
|
5334
|
+
for (var a = s > 1 ? void 0 : s ? te(t, i) : t, h = e.length - 1, d; h >= 0; h--)
|
|
5335
|
+
(d = e[h]) && (a = (s ? d(t, i, a) : d(a)) || a);
|
|
5336
|
+
return s && a && Jt(t, i, a), a;
|
|
5205
5337
|
};
|
|
5206
|
-
let
|
|
5338
|
+
let I = class extends U {
|
|
5207
5339
|
constructor() {
|
|
5208
5340
|
super(...arguments), this.open = !1, this.view = "sign-in", this.closeOnSuccess = !0, this.handledPending = null, this.scrollCue = !1, this.bodyResizeObserver = null, this.onOpenEvent = (e) => {
|
|
5209
5341
|
const t = e.detail ?? {};
|
|
@@ -5299,9 +5431,9 @@ let P = class extends E {
|
|
|
5299
5431
|
`;
|
|
5300
5432
|
}
|
|
5301
5433
|
};
|
|
5302
|
-
|
|
5303
|
-
...
|
|
5304
|
-
|
|
5434
|
+
I.styles = [
|
|
5435
|
+
...U.styles,
|
|
5436
|
+
L`
|
|
5305
5437
|
:host {
|
|
5306
5438
|
display: contents;
|
|
5307
5439
|
}
|
|
@@ -5389,14 +5521,14 @@ P.styles = [
|
|
|
5389
5521
|
}
|
|
5390
5522
|
`
|
|
5391
5523
|
];
|
|
5392
|
-
|
|
5393
|
-
|
|
5394
|
-
],
|
|
5395
|
-
|
|
5396
|
-
|
|
5397
|
-
],
|
|
5398
|
-
|
|
5399
|
-
|
|
5524
|
+
R([
|
|
5525
|
+
m({ type: Boolean, reflect: !0 })
|
|
5526
|
+
], I.prototype, "open", 2);
|
|
5527
|
+
R([
|
|
5528
|
+
m({ type: String })
|
|
5529
|
+
], I.prototype, "view", 2);
|
|
5530
|
+
R([
|
|
5531
|
+
m({
|
|
5400
5532
|
attribute: "close-on-success",
|
|
5401
5533
|
reflect: !0,
|
|
5402
5534
|
converter: {
|
|
@@ -5410,28 +5542,28 @@ F([
|
|
|
5410
5542
|
}
|
|
5411
5543
|
}
|
|
5412
5544
|
})
|
|
5413
|
-
],
|
|
5414
|
-
|
|
5415
|
-
|
|
5416
|
-
],
|
|
5417
|
-
|
|
5418
|
-
|
|
5419
|
-
],
|
|
5420
|
-
|
|
5421
|
-
|
|
5422
|
-
],
|
|
5423
|
-
|
|
5424
|
-
|
|
5425
|
-
],
|
|
5426
|
-
|
|
5545
|
+
], I.prototype, "closeOnSuccess", 2);
|
|
5546
|
+
R([
|
|
5547
|
+
c()
|
|
5548
|
+
], I.prototype, "handledPending", 2);
|
|
5549
|
+
R([
|
|
5550
|
+
c()
|
|
5551
|
+
], I.prototype, "scrollCue", 2);
|
|
5552
|
+
R([
|
|
5553
|
+
at("dialog")
|
|
5554
|
+
], I.prototype, "dialog", 2);
|
|
5555
|
+
R([
|
|
5556
|
+
at(".body")
|
|
5557
|
+
], I.prototype, "bodyEl", 2);
|
|
5558
|
+
I = R([
|
|
5427
5559
|
T("authui-modal")
|
|
5428
|
-
],
|
|
5429
|
-
var
|
|
5430
|
-
for (var a = s > 1 ? void 0 : s ?
|
|
5431
|
-
(
|
|
5432
|
-
return s && a &&
|
|
5560
|
+
], I);
|
|
5561
|
+
var ee = Object.defineProperty, ie = Object.getOwnPropertyDescriptor, J = (e, t, i, s) => {
|
|
5562
|
+
for (var a = s > 1 ? void 0 : s ? ie(t, i) : t, h = e.length - 1, d; h >= 0; h--)
|
|
5563
|
+
(d = e[h]) && (a = (s ? d(t, i, a) : d(a)) || a);
|
|
5564
|
+
return s && a && ee(t, i, a), a;
|
|
5433
5565
|
};
|
|
5434
|
-
let
|
|
5566
|
+
let V = class extends U {
|
|
5435
5567
|
constructor() {
|
|
5436
5568
|
super(...arguments), this.view = "sign-in", this.variant = "primary", this.size = "md";
|
|
5437
5569
|
}
|
|
@@ -5439,7 +5571,7 @@ let L = class extends E {
|
|
|
5439
5571
|
const e = this.size === "md" ? "" : `btn-${this.size}`;
|
|
5440
5572
|
return r`<button
|
|
5441
5573
|
class="btn btn-${this.variant} ${e}"
|
|
5442
|
-
@click=${() =>
|
|
5574
|
+
@click=${() => X(this.view)}
|
|
5443
5575
|
part="button"
|
|
5444
5576
|
>
|
|
5445
5577
|
<slot
|
|
@@ -5448,9 +5580,9 @@ let L = class extends E {
|
|
|
5448
5580
|
</button>`;
|
|
5449
5581
|
}
|
|
5450
5582
|
};
|
|
5451
|
-
|
|
5452
|
-
...
|
|
5453
|
-
|
|
5583
|
+
V.styles = [
|
|
5584
|
+
...U.styles,
|
|
5585
|
+
L`
|
|
5454
5586
|
:host {
|
|
5455
5587
|
display: inline-block;
|
|
5456
5588
|
}
|
|
@@ -5459,26 +5591,26 @@ L.styles = [
|
|
|
5459
5591
|
}
|
|
5460
5592
|
`
|
|
5461
5593
|
];
|
|
5462
|
-
|
|
5463
|
-
|
|
5464
|
-
],
|
|
5465
|
-
|
|
5466
|
-
|
|
5467
|
-
],
|
|
5468
|
-
|
|
5469
|
-
|
|
5470
|
-
],
|
|
5471
|
-
|
|
5594
|
+
J([
|
|
5595
|
+
m({ type: String })
|
|
5596
|
+
], V.prototype, "view", 2);
|
|
5597
|
+
J([
|
|
5598
|
+
m({ type: String })
|
|
5599
|
+
], V.prototype, "variant", 2);
|
|
5600
|
+
J([
|
|
5601
|
+
m({ type: String })
|
|
5602
|
+
], V.prototype, "size", 2);
|
|
5603
|
+
V = J([
|
|
5472
5604
|
T("authui-button")
|
|
5473
|
-
],
|
|
5474
|
-
var
|
|
5475
|
-
for (var a = s > 1 ? void 0 : s ?
|
|
5476
|
-
(
|
|
5477
|
-
return s && a &&
|
|
5605
|
+
], V);
|
|
5606
|
+
var se = Object.defineProperty, re = Object.getOwnPropertyDescriptor, F = (e, t, i, s) => {
|
|
5607
|
+
for (var a = s > 1 ? void 0 : s ? re(t, i) : t, h = e.length - 1, d; h >= 0; h--)
|
|
5608
|
+
(d = e[h]) && (a = (s ? d(t, i, a) : d(a)) || a);
|
|
5609
|
+
return s && a && se(t, i, a), a;
|
|
5478
5610
|
};
|
|
5479
|
-
let
|
|
5611
|
+
let E = class extends U {
|
|
5480
5612
|
constructor() {
|
|
5481
|
-
super(...arguments), this.showTeams = !1, this.src = "", this.menuOpen = !1, this.menuAbove = !1, this.teams = [], this.teamsLoading = !1, this.activeTeamId = null, this.onReposition = () => {
|
|
5613
|
+
super(...arguments), this.showTeams = !1, this.menuItems = [], this.src = "", this.menuOpen = !1, this.menuAbove = !1, this.teams = [], this.teamsLoading = !1, this.activeTeamId = null, this.onReposition = () => {
|
|
5482
5614
|
this.menuOpen && this.placeMenu();
|
|
5483
5615
|
}, this.onDocumentClick = (e) => {
|
|
5484
5616
|
e.composedPath().includes(this) || (this.menuOpen = !1);
|
|
@@ -5521,10 +5653,10 @@ let I = class extends E {
|
|
|
5521
5653
|
if (!e || !t) return;
|
|
5522
5654
|
const i = e.getBoundingClientRect(), s = 6, a = 8;
|
|
5523
5655
|
t.style.maxHeight = "";
|
|
5524
|
-
const
|
|
5525
|
-
|
|
5526
|
-
const
|
|
5527
|
-
t.style.maxHeight = `${
|
|
5656
|
+
const h = t.offsetHeight + s, d = window.innerHeight - i.bottom, g = i.top, y = d < h && g > d;
|
|
5657
|
+
y !== this.menuAbove && (this.menuAbove = y);
|
|
5658
|
+
const C = Math.max(80, (y ? g : d) - s - a);
|
|
5659
|
+
t.style.maxHeight = `${C}px`;
|
|
5528
5660
|
}
|
|
5529
5661
|
focusMenuItem(e) {
|
|
5530
5662
|
[
|
|
@@ -5551,7 +5683,7 @@ let I = class extends E {
|
|
|
5551
5683
|
if (e === "loading" && i)
|
|
5552
5684
|
return r`<span class="avatar"><span class="spinner"></span></span>`;
|
|
5553
5685
|
if (e !== "signed-in" || !t)
|
|
5554
|
-
return r`<button class="btn btn-primary btn-sm" @click=${() =>
|
|
5686
|
+
return r`<button class="btn btn-primary btn-sm" @click=${() => X("sign-in")}>
|
|
5555
5687
|
<slot>${this.t("signIn")}</slot>
|
|
5556
5688
|
</button>`;
|
|
5557
5689
|
const s = t.name || t.email || t.phone || this.t("guestAccount");
|
|
@@ -5564,7 +5696,7 @@ let I = class extends E {
|
|
|
5564
5696
|
aria-label=${s}
|
|
5565
5697
|
>
|
|
5566
5698
|
<span class="avatar"
|
|
5567
|
-
>${this.src ? r`<img src=${this.src} alt="" />` :
|
|
5699
|
+
>${this.src ? r`<img src=${this.src} alt="" />` : lt(s)}</span
|
|
5568
5700
|
>
|
|
5569
5701
|
</button>
|
|
5570
5702
|
${this.menuOpen ? r`<div class="menu ${this.menuAbove ? "above" : ""}" role="menu">
|
|
@@ -5589,11 +5721,13 @@ let I = class extends E {
|
|
|
5589
5721
|
</button>`
|
|
5590
5722
|
)}
|
|
5591
5723
|
</div>` : n}
|
|
5724
|
+
${this.renderCustomMenuItems()}
|
|
5725
|
+
<slot name="menu-items"></slot>
|
|
5592
5726
|
<button
|
|
5593
5727
|
class="menu-item"
|
|
5594
5728
|
role="menuitem"
|
|
5595
5729
|
@click=${() => {
|
|
5596
|
-
this.menuOpen = !1,
|
|
5730
|
+
this.menuOpen = !1, X("account");
|
|
5597
5731
|
}}
|
|
5598
5732
|
>
|
|
5599
5733
|
${l.settings} ${this.t("manageAccount")}
|
|
@@ -5610,10 +5744,46 @@ let I = class extends E {
|
|
|
5610
5744
|
</div>` : n}
|
|
5611
5745
|
`;
|
|
5612
5746
|
}
|
|
5747
|
+
renderCustomMenuItems() {
|
|
5748
|
+
return this.menuItems?.length ? this.menuItems.map((e) => {
|
|
5749
|
+
if (e.href) {
|
|
5750
|
+
const i = e.target;
|
|
5751
|
+
return r`<a
|
|
5752
|
+
class="menu-item"
|
|
5753
|
+
role="menuitem"
|
|
5754
|
+
href=${e.href}
|
|
5755
|
+
target=${i || n}
|
|
5756
|
+
rel=${i === "_blank" ? "noopener noreferrer" : n}
|
|
5757
|
+
@click=${() => {
|
|
5758
|
+
this.menuOpen = !1;
|
|
5759
|
+
}}
|
|
5760
|
+
>
|
|
5761
|
+
${e.label}
|
|
5762
|
+
</a>`;
|
|
5763
|
+
}
|
|
5764
|
+
const t = e.actionId;
|
|
5765
|
+
return r`<button
|
|
5766
|
+
class="menu-item"
|
|
5767
|
+
role="menuitem"
|
|
5768
|
+
type="button"
|
|
5769
|
+
@click=${() => {
|
|
5770
|
+
this.menuOpen = !1, t && this.dispatchEvent(
|
|
5771
|
+
new CustomEvent("authui-menu-action", {
|
|
5772
|
+
detail: { actionId: t },
|
|
5773
|
+
bubbles: !0,
|
|
5774
|
+
composed: !0
|
|
5775
|
+
})
|
|
5776
|
+
);
|
|
5777
|
+
}}
|
|
5778
|
+
>
|
|
5779
|
+
${e.label}
|
|
5780
|
+
</button>`;
|
|
5781
|
+
}) : n;
|
|
5782
|
+
}
|
|
5613
5783
|
};
|
|
5614
|
-
|
|
5615
|
-
...
|
|
5616
|
-
|
|
5784
|
+
E.styles = [
|
|
5785
|
+
...U.styles,
|
|
5786
|
+
L`
|
|
5617
5787
|
:host {
|
|
5618
5788
|
display: inline-block;
|
|
5619
5789
|
position: relative;
|
|
@@ -5702,6 +5872,10 @@ I.styles = [
|
|
|
5702
5872
|
height: 16px;
|
|
5703
5873
|
color: var(--authui-muted-foreground);
|
|
5704
5874
|
}
|
|
5875
|
+
a.menu-item {
|
|
5876
|
+
text-decoration: none;
|
|
5877
|
+
box-sizing: border-box;
|
|
5878
|
+
}
|
|
5705
5879
|
.menu-section {
|
|
5706
5880
|
border-top: 1px solid var(--authui-border);
|
|
5707
5881
|
margin-top: 4px;
|
|
@@ -5729,60 +5903,63 @@ I.styles = [
|
|
|
5729
5903
|
}
|
|
5730
5904
|
`
|
|
5731
5905
|
];
|
|
5732
|
-
|
|
5733
|
-
|
|
5734
|
-
],
|
|
5735
|
-
|
|
5736
|
-
|
|
5737
|
-
],
|
|
5738
|
-
|
|
5739
|
-
|
|
5740
|
-
],
|
|
5741
|
-
|
|
5742
|
-
|
|
5743
|
-
],
|
|
5744
|
-
|
|
5745
|
-
|
|
5746
|
-
],
|
|
5747
|
-
|
|
5748
|
-
|
|
5749
|
-
],
|
|
5750
|
-
|
|
5751
|
-
|
|
5752
|
-
],
|
|
5753
|
-
|
|
5906
|
+
F([
|
|
5907
|
+
m({ type: Boolean, attribute: "show-teams" })
|
|
5908
|
+
], E.prototype, "showTeams", 2);
|
|
5909
|
+
F([
|
|
5910
|
+
m({ attribute: !1 })
|
|
5911
|
+
], E.prototype, "menuItems", 2);
|
|
5912
|
+
F([
|
|
5913
|
+
m({ type: String })
|
|
5914
|
+
], E.prototype, "src", 2);
|
|
5915
|
+
F([
|
|
5916
|
+
c()
|
|
5917
|
+
], E.prototype, "menuOpen", 2);
|
|
5918
|
+
F([
|
|
5919
|
+
c()
|
|
5920
|
+
], E.prototype, "menuAbove", 2);
|
|
5921
|
+
F([
|
|
5922
|
+
c()
|
|
5923
|
+
], E.prototype, "teams", 2);
|
|
5924
|
+
F([
|
|
5925
|
+
c()
|
|
5926
|
+
], E.prototype, "teamsLoading", 2);
|
|
5927
|
+
F([
|
|
5928
|
+
c()
|
|
5929
|
+
], E.prototype, "activeTeamId", 2);
|
|
5930
|
+
E = F([
|
|
5754
5931
|
T("authui-user-button")
|
|
5755
|
-
],
|
|
5932
|
+
], E);
|
|
5756
5933
|
export {
|
|
5757
|
-
|
|
5758
|
-
|
|
5759
|
-
|
|
5760
|
-
|
|
5934
|
+
Lt as A,
|
|
5935
|
+
ce as C,
|
|
5936
|
+
v as E,
|
|
5937
|
+
yt as F,
|
|
5761
5938
|
It as P,
|
|
5762
5939
|
o as a,
|
|
5763
5940
|
p as b,
|
|
5764
|
-
|
|
5765
|
-
|
|
5766
|
-
|
|
5767
|
-
|
|
5768
|
-
|
|
5769
|
-
|
|
5770
|
-
|
|
5771
|
-
|
|
5772
|
-
|
|
5773
|
-
|
|
5774
|
-
|
|
5775
|
-
|
|
5776
|
-
|
|
5941
|
+
de as c,
|
|
5942
|
+
V as d,
|
|
5943
|
+
w as e,
|
|
5944
|
+
U as f,
|
|
5945
|
+
I as g,
|
|
5946
|
+
H as h,
|
|
5947
|
+
$ as i,
|
|
5948
|
+
E as j,
|
|
5949
|
+
le as k,
|
|
5950
|
+
mt as l,
|
|
5951
|
+
St as m,
|
|
5952
|
+
Y as n,
|
|
5953
|
+
X as o,
|
|
5777
5954
|
z as p,
|
|
5778
|
-
|
|
5779
|
-
|
|
5780
|
-
|
|
5781
|
-
|
|
5782
|
-
|
|
5783
|
-
|
|
5784
|
-
|
|
5785
|
-
|
|
5786
|
-
|
|
5787
|
-
|
|
5955
|
+
pt as q,
|
|
5956
|
+
Mt as r,
|
|
5957
|
+
N as s,
|
|
5958
|
+
_ as t,
|
|
5959
|
+
$t as u,
|
|
5960
|
+
rt as v,
|
|
5961
|
+
Ot as w,
|
|
5962
|
+
Ft as x,
|
|
5963
|
+
q as y,
|
|
5964
|
+
Wt as z
|
|
5788
5965
|
};
|