@saas-support/react 0.7.1 → 0.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/react.cjs +30 -6
- package/dist/react.js +440 -414
- package/package.json +1 -1
package/dist/react.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as e, jsxs as t, Fragment as j } from "react/jsx-runtime";
|
|
2
|
-
import { createContext as ma, useContext as fa, useState as g, useEffect as
|
|
2
|
+
import { createContext as ma, useContext as fa, useState as g, useEffect as V, useRef as _, useCallback as k, useMemo as G } from "react";
|
|
3
3
|
import { SaaSSupport as ba, isMfaRequired as xa, BillingClient as ya, Transport as Q, ReportClient as ta } from "./index.js";
|
|
4
4
|
import { SaaSError as Ne } from "./index.js";
|
|
5
5
|
import { createPortal as va } from "react-dom";
|
|
@@ -12,15 +12,15 @@ function A() {
|
|
|
12
12
|
}
|
|
13
13
|
function te({ publishableKey: a, apiKey: s, baseUrl: r, appearance: o, children: n }) {
|
|
14
14
|
const [u] = g(() => new ba({ publishableKey: a, apiKey: s, baseUrl: r })), [i, l] = g(null), [d, c] = g(!1), [f, p] = g(null);
|
|
15
|
-
return
|
|
15
|
+
return V(() => {
|
|
16
16
|
let m = !1;
|
|
17
17
|
u.load().then(async () => {
|
|
18
18
|
if (m) return;
|
|
19
|
-
const
|
|
20
|
-
l(
|
|
19
|
+
const w = await u.auth.getUser(), y = await u.auth.getSettings();
|
|
20
|
+
l(w), p(y), c(!0);
|
|
21
21
|
});
|
|
22
|
-
const b = u.auth.onAuthStateChange((
|
|
23
|
-
m || l(
|
|
22
|
+
const b = u.auth.onAuthStateChange((w) => {
|
|
23
|
+
m || l(w);
|
|
24
24
|
});
|
|
25
25
|
return () => {
|
|
26
26
|
m = !0, b(), u.destroy();
|
|
@@ -1424,6 +1424,7 @@ function ea(a) {
|
|
|
1424
1424
|
cursor: pointer;
|
|
1425
1425
|
transition: background 0.15s, box-shadow 0.15s;
|
|
1426
1426
|
font-family: ${a.authFontBody};
|
|
1427
|
+
max-width: 200px;
|
|
1427
1428
|
}
|
|
1428
1429
|
|
|
1429
1430
|
.ss-auth-user-trigger:hover {
|
|
@@ -2213,14 +2214,15 @@ function ea(a) {
|
|
|
2213
2214
|
animation: ss-spin 0.6s linear infinite;
|
|
2214
2215
|
}
|
|
2215
2216
|
|
|
2216
|
-
/* Settings Panel (full
|
|
2217
|
+
/* Settings Panel (full page) */
|
|
2217
2218
|
.ss-auth-settings-page {
|
|
2218
|
-
|
|
2219
|
-
|
|
2219
|
+
position: fixed;
|
|
2220
|
+
inset: 0;
|
|
2221
|
+
z-index: 99999;
|
|
2220
2222
|
display: flex;
|
|
2221
2223
|
flex-direction: column;
|
|
2222
2224
|
background: ${a.authSurface};
|
|
2223
|
-
animation: ss-auth-
|
|
2225
|
+
animation: ss-auth-fade-in 0.2s ease-out;
|
|
2224
2226
|
}
|
|
2225
2227
|
|
|
2226
2228
|
.ss-auth-settings-header {
|
|
@@ -2242,6 +2244,25 @@ function ea(a) {
|
|
|
2242
2244
|
margin: 0;
|
|
2243
2245
|
}
|
|
2244
2246
|
|
|
2247
|
+
.ss-auth-settings-back {
|
|
2248
|
+
display: flex;
|
|
2249
|
+
align-items: center;
|
|
2250
|
+
justify-content: center;
|
|
2251
|
+
width: 36px;
|
|
2252
|
+
height: 36px;
|
|
2253
|
+
border-radius: 8px;
|
|
2254
|
+
border: none;
|
|
2255
|
+
background: none;
|
|
2256
|
+
cursor: pointer;
|
|
2257
|
+
color: ${a.authOnSurfaceVariant};
|
|
2258
|
+
transition: background 0.15s, color 0.15s;
|
|
2259
|
+
}
|
|
2260
|
+
.ss-auth-settings-back:hover {
|
|
2261
|
+
background: ${a.authSurfaceContainer};
|
|
2262
|
+
color: ${a.authOnSurface};
|
|
2263
|
+
}
|
|
2264
|
+
.ss-auth-settings-back .material-symbols-outlined { font-size: 22px; }
|
|
2265
|
+
|
|
2245
2266
|
.ss-auth-settings-layout {
|
|
2246
2267
|
display: flex;
|
|
2247
2268
|
flex: 1;
|
|
@@ -2300,6 +2321,9 @@ function ea(a) {
|
|
|
2300
2321
|
flex: 1;
|
|
2301
2322
|
overflow-y: auto;
|
|
2302
2323
|
padding: 32px;
|
|
2324
|
+
max-width: 720px;
|
|
2325
|
+
margin: 0 auto;
|
|
2326
|
+
width: 100%;
|
|
2303
2327
|
}
|
|
2304
2328
|
|
|
2305
2329
|
.ss-auth-settings-content h3 {
|
|
@@ -2479,7 +2503,7 @@ function ea(a) {
|
|
|
2479
2503
|
}
|
|
2480
2504
|
function H({ children: a, appearance: s }) {
|
|
2481
2505
|
const r = _(null), [o, n] = g(null);
|
|
2482
|
-
|
|
2506
|
+
V(() => {
|
|
2483
2507
|
var f;
|
|
2484
2508
|
if (!r.current || r.current.shadowRoot) {
|
|
2485
2509
|
n(((f = r.current) == null ? void 0 : f.shadowRoot) ?? null);
|
|
@@ -2499,7 +2523,7 @@ function H({ children: a, appearance: s }) {
|
|
|
2499
2523
|
d.textContent = ea(l), i.appendChild(d);
|
|
2500
2524
|
const c = document.createElement("div");
|
|
2501
2525
|
i.appendChild(c), n(i);
|
|
2502
|
-
}, []),
|
|
2526
|
+
}, []), V(() => {
|
|
2503
2527
|
if (!o) return;
|
|
2504
2528
|
const i = o.querySelector("style");
|
|
2505
2529
|
if (i) {
|
|
@@ -2516,9 +2540,9 @@ function sa() {
|
|
|
2516
2540
|
isLoaded: r,
|
|
2517
2541
|
isSignedIn: !!s,
|
|
2518
2542
|
user: s,
|
|
2519
|
-
signOut:
|
|
2520
|
-
getToken:
|
|
2521
|
-
refreshUser:
|
|
2543
|
+
signOut: k(() => a.auth.signOut(), [a]),
|
|
2544
|
+
getToken: k(() => a.auth.getToken(), [a]),
|
|
2545
|
+
refreshUser: k(() => a.auth.refreshUser(), [a])
|
|
2522
2546
|
};
|
|
2523
2547
|
}
|
|
2524
2548
|
function se() {
|
|
@@ -2526,7 +2550,7 @@ function se() {
|
|
|
2526
2550
|
return { user: a, isLoaded: s };
|
|
2527
2551
|
}
|
|
2528
2552
|
function na() {
|
|
2529
|
-
const { client: a } = A(), [s, r] = g(!1), [o, n] = g(null), u =
|
|
2553
|
+
const { client: a } = A(), [s, r] = g(!1), [o, n] = g(null), u = k(
|
|
2530
2554
|
async (d, c) => {
|
|
2531
2555
|
r(!0), n(null);
|
|
2532
2556
|
try {
|
|
@@ -2538,7 +2562,7 @@ function na() {
|
|
|
2538
2562
|
}
|
|
2539
2563
|
},
|
|
2540
2564
|
[a]
|
|
2541
|
-
), i =
|
|
2565
|
+
), i = k(
|
|
2542
2566
|
async (d) => {
|
|
2543
2567
|
r(!0), n(null);
|
|
2544
2568
|
try {
|
|
@@ -2550,7 +2574,7 @@ function na() {
|
|
|
2550
2574
|
}
|
|
2551
2575
|
},
|
|
2552
2576
|
[a]
|
|
2553
|
-
), l =
|
|
2577
|
+
), l = k(
|
|
2554
2578
|
async (d, c) => {
|
|
2555
2579
|
r(!0), n(null);
|
|
2556
2580
|
try {
|
|
@@ -2567,7 +2591,7 @@ function na() {
|
|
|
2567
2591
|
}
|
|
2568
2592
|
function ka() {
|
|
2569
2593
|
const { client: a } = A(), [s, r] = g(!1), [o, n] = g(null);
|
|
2570
|
-
return { signUp:
|
|
2594
|
+
return { signUp: k(
|
|
2571
2595
|
async (i, l) => {
|
|
2572
2596
|
r(!0), n(null);
|
|
2573
2597
|
try {
|
|
@@ -2582,93 +2606,93 @@ function ka() {
|
|
|
2582
2606
|
), isLoading: s, error: o, setError: n };
|
|
2583
2607
|
}
|
|
2584
2608
|
function Y() {
|
|
2585
|
-
const { client: a } = A(), [s, r] = g([]), [o, n] = g(null), [u, i] = g([]), [l, d] = g([]), [c, f] = g(!1), [p, m] = g(null), b =
|
|
2609
|
+
const { client: a } = A(), [s, r] = g([]), [o, n] = g(null), [u, i] = g([]), [l, d] = g([]), [c, f] = g(!1), [p, m] = g(null), b = k(async () => {
|
|
2586
2610
|
f(!0), m(null);
|
|
2587
2611
|
try {
|
|
2588
|
-
const
|
|
2589
|
-
r(
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
|
|
2612
|
+
const $ = await a.auth.listOrgs();
|
|
2613
|
+
if (r($), !o && $.length > 0) {
|
|
2614
|
+
const x = typeof window < "u" ? localStorage.getItem("ss_selected_org") : null, E = (x ? $.find((D) => D.id === x) : null) ?? ($.length === 1 ? $[0] : null);
|
|
2615
|
+
if (E) {
|
|
2616
|
+
n(E), typeof window < "u" && localStorage.setItem("ss_selected_org", E.id);
|
|
2617
|
+
try {
|
|
2618
|
+
const D = await a.auth.listMembers(E.id);
|
|
2619
|
+
i(D);
|
|
2620
|
+
} catch {
|
|
2621
|
+
}
|
|
2598
2622
|
}
|
|
2599
2623
|
}
|
|
2600
|
-
} catch (
|
|
2601
|
-
m(
|
|
2624
|
+
} catch ($) {
|
|
2625
|
+
m($ instanceof Error ? $.message : "Failed to load organizations");
|
|
2602
2626
|
} finally {
|
|
2603
2627
|
f(!1);
|
|
2604
2628
|
}
|
|
2605
2629
|
}, [a, o]);
|
|
2606
|
-
|
|
2630
|
+
V(() => {
|
|
2607
2631
|
b();
|
|
2608
2632
|
}, [b]);
|
|
2609
|
-
const
|
|
2633
|
+
const w = k(async ($) => {
|
|
2610
2634
|
try {
|
|
2611
|
-
const x = await a.auth.getOrg(
|
|
2612
|
-
n(x), typeof window < "u" && localStorage.setItem("ss_selected_org",
|
|
2613
|
-
const
|
|
2614
|
-
i(
|
|
2635
|
+
const x = await a.auth.getOrg($);
|
|
2636
|
+
n(x), typeof window < "u" && localStorage.setItem("ss_selected_org", $);
|
|
2637
|
+
const S = await a.auth.listMembers($);
|
|
2638
|
+
i(S);
|
|
2615
2639
|
} catch (x) {
|
|
2616
2640
|
m(x instanceof Error ? x.message : "Failed to load organization");
|
|
2617
2641
|
}
|
|
2618
|
-
}, [a]), y =
|
|
2642
|
+
}, [a]), y = k(async ($, x) => {
|
|
2619
2643
|
try {
|
|
2620
|
-
const
|
|
2621
|
-
return r((E) => [...E,
|
|
2622
|
-
} catch (
|
|
2623
|
-
return m(
|
|
2644
|
+
const S = await a.auth.createOrg($, x);
|
|
2645
|
+
return r((E) => [...E, S]), S;
|
|
2646
|
+
} catch (S) {
|
|
2647
|
+
return m(S instanceof Error ? S.message : "Failed to create organization"), null;
|
|
2624
2648
|
}
|
|
2625
|
-
}, [a]), O =
|
|
2649
|
+
}, [a]), O = k(async ($, x) => {
|
|
2626
2650
|
try {
|
|
2627
|
-
const
|
|
2628
|
-
return r((E) => E.map((
|
|
2629
|
-
} catch (
|
|
2630
|
-
return m(
|
|
2651
|
+
const S = await a.auth.updateOrg($, x);
|
|
2652
|
+
return r((E) => E.map((D) => D.id === $ ? S : D)), (o == null ? void 0 : o.id) === $ && n(S), S;
|
|
2653
|
+
} catch (S) {
|
|
2654
|
+
return m(S instanceof Error ? S.message : "Failed to update organization"), null;
|
|
2631
2655
|
}
|
|
2632
|
-
}, [a, o]), h =
|
|
2656
|
+
}, [a, o]), h = k(async ($) => {
|
|
2633
2657
|
try {
|
|
2634
|
-
return await a.auth.deleteOrg(
|
|
2658
|
+
return await a.auth.deleteOrg($), r((x) => x.filter((S) => S.id !== $)), (o == null ? void 0 : o.id) === $ && (n(null), i([]), d([]), typeof window < "u" && localStorage.removeItem("ss_selected_org")), !0;
|
|
2635
2659
|
} catch (x) {
|
|
2636
2660
|
return m(x instanceof Error ? x.message : "Failed to delete organization"), !1;
|
|
2637
2661
|
}
|
|
2638
|
-
}, [a, o]),
|
|
2662
|
+
}, [a, o]), N = k(async ($, x, S) => {
|
|
2639
2663
|
try {
|
|
2640
|
-
return await a.auth.sendInvite(
|
|
2664
|
+
return await a.auth.sendInvite($, x, S);
|
|
2641
2665
|
} catch (E) {
|
|
2642
2666
|
return m(E instanceof Error ? E.message : "Failed to send invite"), null;
|
|
2643
2667
|
}
|
|
2644
|
-
}, [a]),
|
|
2668
|
+
}, [a]), C = k(async ($) => {
|
|
2645
2669
|
try {
|
|
2646
|
-
const x = await a.auth.listInvites(
|
|
2670
|
+
const x = await a.auth.listInvites($);
|
|
2647
2671
|
d(x);
|
|
2648
2672
|
} catch (x) {
|
|
2649
2673
|
m(x instanceof Error ? x.message : "Failed to load invites");
|
|
2650
2674
|
}
|
|
2651
|
-
}, [a]), P =
|
|
2675
|
+
}, [a]), P = k(async ($, x) => {
|
|
2652
2676
|
try {
|
|
2653
|
-
return await a.auth.revokeInvite(
|
|
2654
|
-
} catch (
|
|
2655
|
-
return m(
|
|
2677
|
+
return await a.auth.revokeInvite($, x), d((S) => S.filter((E) => E.id !== x)), !0;
|
|
2678
|
+
} catch (S) {
|
|
2679
|
+
return m(S instanceof Error ? S.message : "Failed to revoke invite"), !1;
|
|
2656
2680
|
}
|
|
2657
|
-
}, [a]), I =
|
|
2681
|
+
}, [a]), I = k(async ($, x, S) => {
|
|
2658
2682
|
try {
|
|
2659
|
-
return await a.auth.updateMemberRole(
|
|
2683
|
+
return await a.auth.updateMemberRole($, x, S), i((E) => E.map((D) => D.userId === x ? { ...D, role: S } : D)), !0;
|
|
2660
2684
|
} catch (E) {
|
|
2661
2685
|
return m(E instanceof Error ? E.message : "Failed to update member role"), !1;
|
|
2662
2686
|
}
|
|
2663
|
-
}, [a]),
|
|
2687
|
+
}, [a]), B = k(async ($, x) => {
|
|
2664
2688
|
try {
|
|
2665
|
-
return await a.auth.removeMember(
|
|
2666
|
-
} catch (
|
|
2667
|
-
return m(
|
|
2689
|
+
return await a.auth.removeMember($, x), i((S) => S.filter((E) => E.userId !== x)), !0;
|
|
2690
|
+
} catch (S) {
|
|
2691
|
+
return m(S instanceof Error ? S.message : "Failed to remove member"), !1;
|
|
2668
2692
|
}
|
|
2669
|
-
}, [a]),
|
|
2693
|
+
}, [a]), F = k(async ($) => {
|
|
2670
2694
|
try {
|
|
2671
|
-
const x = await a.auth.listMembers(
|
|
2695
|
+
const x = await a.auth.listMembers($);
|
|
2672
2696
|
i(x);
|
|
2673
2697
|
} catch (x) {
|
|
2674
2698
|
m(x instanceof Error ? x.message : "Failed to load members");
|
|
@@ -2683,21 +2707,21 @@ function Y() {
|
|
|
2683
2707
|
error: p,
|
|
2684
2708
|
setError: m,
|
|
2685
2709
|
refresh: b,
|
|
2686
|
-
selectOrg:
|
|
2710
|
+
selectOrg: w,
|
|
2687
2711
|
createOrg: y,
|
|
2688
2712
|
updateOrg: O,
|
|
2689
2713
|
deleteOrg: h,
|
|
2690
|
-
sendInvite:
|
|
2691
|
-
refreshInvites:
|
|
2714
|
+
sendInvite: N,
|
|
2715
|
+
refreshInvites: C,
|
|
2692
2716
|
revokeInvite: P,
|
|
2693
2717
|
updateMemberRole: I,
|
|
2694
|
-
removeMember:
|
|
2695
|
-
refreshMembers:
|
|
2718
|
+
removeMember: B,
|
|
2719
|
+
refreshMembers: F
|
|
2696
2720
|
};
|
|
2697
2721
|
}
|
|
2698
2722
|
function Ca() {
|
|
2699
2723
|
const { client: a } = A(), [s, r] = g(!1), [o, n] = g(null);
|
|
2700
|
-
return { deleteAccount:
|
|
2724
|
+
return { deleteAccount: k(async () => {
|
|
2701
2725
|
r(!0), n(null);
|
|
2702
2726
|
try {
|
|
2703
2727
|
return await a.auth.deleteAccount(), !0;
|
|
@@ -2709,7 +2733,7 @@ function Ca() {
|
|
|
2709
2733
|
}, [a]), isLoading: s, error: o, setError: n };
|
|
2710
2734
|
}
|
|
2711
2735
|
function oa() {
|
|
2712
|
-
const { client: a, user: s } = A(), [r, o] = g(!1), [n, u] = g(null), [i, l] = g(null), d =
|
|
2736
|
+
const { client: a, user: s } = A(), [r, o] = g(!1), [n, u] = g(null), [i, l] = g(null), d = k(
|
|
2713
2737
|
async (p) => {
|
|
2714
2738
|
o(!0), u(null), l(null);
|
|
2715
2739
|
try {
|
|
@@ -2722,7 +2746,7 @@ function oa() {
|
|
|
2722
2746
|
}
|
|
2723
2747
|
},
|
|
2724
2748
|
[a]
|
|
2725
|
-
), c =
|
|
2749
|
+
), c = k(
|
|
2726
2750
|
async (p, m) => {
|
|
2727
2751
|
o(!0), u(null), l(null);
|
|
2728
2752
|
try {
|
|
@@ -2734,7 +2758,7 @@ function oa() {
|
|
|
2734
2758
|
}
|
|
2735
2759
|
},
|
|
2736
2760
|
[a]
|
|
2737
|
-
), f =
|
|
2761
|
+
), f = k(
|
|
2738
2762
|
async (p) => {
|
|
2739
2763
|
o(!0), u(null), l(null);
|
|
2740
2764
|
try {
|
|
@@ -2750,7 +2774,7 @@ function oa() {
|
|
|
2750
2774
|
);
|
|
2751
2775
|
return { user: s, updateProfile: d, uploadAvatar: f, changePassword: c, isLoading: r, error: n, success: i, setError: u, setSuccess: l };
|
|
2752
2776
|
}
|
|
2753
|
-
const ia = '<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92a5.06 5.06 0 0 1-2.2 3.32v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.1z" fill="#4285F4"/><path d="M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z" fill="#34A853"/><path d="M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z" fill="#FBBC05"/><path d="M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z" fill="#EA4335"/></svg>', la = '<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path 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" fill="currentColor"/></svg>',
|
|
2777
|
+
const ia = '<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92a5.06 5.06 0 0 1-2.2 3.32v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.1z" fill="#4285F4"/><path d="M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z" fill="#34A853"/><path d="M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z" fill="#FBBC05"/><path d="M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z" fill="#EA4335"/></svg>', la = '<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path 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" fill="currentColor"/></svg>', v = {
|
|
2754
2778
|
close: "close",
|
|
2755
2779
|
person: "person",
|
|
2756
2780
|
logout: "logout",
|
|
@@ -2768,6 +2792,7 @@ const ia = '<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d=
|
|
|
2768
2792
|
security: "security",
|
|
2769
2793
|
errorOutline: "error_outline",
|
|
2770
2794
|
info: "info",
|
|
2795
|
+
arrowBack: "arrow_back",
|
|
2771
2796
|
arrowForward: "arrow_forward",
|
|
2772
2797
|
verified: "verified",
|
|
2773
2798
|
token: "token",
|
|
@@ -2784,47 +2809,47 @@ const ia = '<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d=
|
|
|
2784
2809
|
personRemove: "person_remove"
|
|
2785
2810
|
};
|
|
2786
2811
|
function re({ appearance: a, signUpUrl: s, onSignUp: r }) {
|
|
2787
|
-
const { appearance: o, settings: n } = A(), { signIn: u, signInWithOAuth: i, submitMfaCode: l, isLoading: d, error: c, setError: f } = na(), p = a ?? o, [m, b] = g(""), [
|
|
2788
|
-
async (
|
|
2789
|
-
if (
|
|
2790
|
-
await l(P,
|
|
2812
|
+
const { appearance: o, settings: n } = A(), { signIn: u, signInWithOAuth: i, submitMfaCode: l, isLoading: d, error: c, setError: f } = na(), p = a ?? o, [m, b] = g(""), [w, y] = g(""), [O, h] = g(!1), [N, C] = g(!1), [P, I] = g(""), [B, F] = g(["", "", "", "", "", ""]), $ = _([]), x = k(
|
|
2813
|
+
async (T) => {
|
|
2814
|
+
if (T.preventDefault(), N) {
|
|
2815
|
+
await l(P, B.join(""));
|
|
2791
2816
|
return;
|
|
2792
2817
|
}
|
|
2793
|
-
const z = await u(m,
|
|
2794
|
-
z && xa(z) && (I(z.mfaToken),
|
|
2818
|
+
const z = await u(m, w);
|
|
2819
|
+
z && xa(z) && (I(z.mfaToken), C(!0), f(null));
|
|
2795
2820
|
},
|
|
2796
|
-
[m,
|
|
2797
|
-
),
|
|
2798
|
-
async (
|
|
2799
|
-
await i(
|
|
2821
|
+
[m, w, N, P, B, u, l, f]
|
|
2822
|
+
), S = k(
|
|
2823
|
+
async (T) => {
|
|
2824
|
+
await i(T);
|
|
2800
2825
|
},
|
|
2801
2826
|
[i]
|
|
2802
|
-
), E =
|
|
2827
|
+
), E = k((T, z) => {
|
|
2803
2828
|
var W;
|
|
2804
2829
|
if (!/^\d*$/.test(z)) return;
|
|
2805
2830
|
const L = z.slice(-1);
|
|
2806
|
-
|
|
2831
|
+
F((K) => {
|
|
2807
2832
|
const J = [...K];
|
|
2808
|
-
return J[
|
|
2809
|
-
}), L &&
|
|
2810
|
-
}, []),
|
|
2833
|
+
return J[T] = L, J;
|
|
2834
|
+
}), L && T < 5 && ((W = $.current[T + 1]) == null || W.focus());
|
|
2835
|
+
}, []), D = k((T, z) => {
|
|
2811
2836
|
var L;
|
|
2812
|
-
z.key === "Backspace" && !
|
|
2813
|
-
}, [
|
|
2837
|
+
z.key === "Backspace" && !B[T] && T > 0 && ((L = $.current[T - 1]) == null || L.focus());
|
|
2838
|
+
}, [B]), U = (n == null ? void 0 : n.googleEnabled) || (n == null ? void 0 : n.githubEnabled);
|
|
2814
2839
|
return /* @__PURE__ */ e(H, { appearance: p, children: /* @__PURE__ */ e("div", { className: "ss-auth-card", children: /* @__PURE__ */ t("div", { className: "ss-auth-card-body", children: [
|
|
2815
2840
|
/* @__PURE__ */ t("div", { className: "ss-auth-header", children: [
|
|
2816
|
-
/* @__PURE__ */ e("div", { className: "ss-auth-brand-icon", children: /* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
2841
|
+
/* @__PURE__ */ e("div", { className: "ss-auth-brand-icon", children: /* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: v.token }) }),
|
|
2817
2842
|
/* @__PURE__ */ e("h1", { className: "ss-auth-title", children: "Sign in to your account" }),
|
|
2818
2843
|
/* @__PURE__ */ e("p", { className: "ss-auth-subtitle", children: "Welcome back to your workspace" })
|
|
2819
2844
|
] }),
|
|
2820
|
-
!
|
|
2845
|
+
!N && U && /* @__PURE__ */ t(j, { children: [
|
|
2821
2846
|
/* @__PURE__ */ t("div", { className: "ss-auth-oauth-grid", children: [
|
|
2822
2847
|
(n == null ? void 0 : n.googleEnabled) && /* @__PURE__ */ t(
|
|
2823
2848
|
"button",
|
|
2824
2849
|
{
|
|
2825
2850
|
type: "button",
|
|
2826
2851
|
className: "ss-auth-btn-social",
|
|
2827
|
-
onClick: () =>
|
|
2852
|
+
onClick: () => S("google"),
|
|
2828
2853
|
disabled: d,
|
|
2829
2854
|
children: [
|
|
2830
2855
|
/* @__PURE__ */ e("span", { dangerouslySetInnerHTML: { __html: ia } }),
|
|
@@ -2837,7 +2862,7 @@ function re({ appearance: a, signUpUrl: s, onSignUp: r }) {
|
|
|
2837
2862
|
{
|
|
2838
2863
|
type: "button",
|
|
2839
2864
|
className: "ss-auth-btn-social",
|
|
2840
|
-
onClick: () =>
|
|
2865
|
+
onClick: () => S("github"),
|
|
2841
2866
|
disabled: d,
|
|
2842
2867
|
children: [
|
|
2843
2868
|
/* @__PURE__ */ e("span", { dangerouslySetInnerHTML: { __html: la } }),
|
|
@@ -2849,27 +2874,27 @@ function re({ appearance: a, signUpUrl: s, onSignUp: r }) {
|
|
|
2849
2874
|
/* @__PURE__ */ e("div", { className: "ss-auth-divider", children: "or continue with" })
|
|
2850
2875
|
] }),
|
|
2851
2876
|
c && /* @__PURE__ */ t("div", { className: "ss-auth-error", children: [
|
|
2852
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
2877
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: v.errorOutline }),
|
|
2853
2878
|
/* @__PURE__ */ e("span", { children: c })
|
|
2854
2879
|
] }),
|
|
2855
2880
|
/* @__PURE__ */ t("form", { onSubmit: x, children: [
|
|
2856
|
-
|
|
2881
|
+
N ? /* @__PURE__ */ t(j, { children: [
|
|
2857
2882
|
/* @__PURE__ */ e("div", { className: "ss-auth-mfa-divider", children: /* @__PURE__ */ e("span", { children: "Verification Required" }) }),
|
|
2858
2883
|
/* @__PURE__ */ t("div", { className: "ss-auth-field", children: [
|
|
2859
2884
|
/* @__PURE__ */ e("label", { className: "ss-auth-label", children: "6-Digit Code" }),
|
|
2860
|
-
/* @__PURE__ */ e("div", { className: "ss-auth-mfa-group", children:
|
|
2885
|
+
/* @__PURE__ */ e("div", { className: "ss-auth-mfa-group", children: B.map((T, z) => /* @__PURE__ */ e(
|
|
2861
2886
|
"input",
|
|
2862
2887
|
{
|
|
2863
2888
|
ref: (L) => {
|
|
2864
|
-
|
|
2889
|
+
$.current[z] = L;
|
|
2865
2890
|
},
|
|
2866
2891
|
className: "ss-auth-mfa-digit",
|
|
2867
2892
|
type: "text",
|
|
2868
2893
|
inputMode: "numeric",
|
|
2869
2894
|
maxLength: 1,
|
|
2870
|
-
value:
|
|
2895
|
+
value: T,
|
|
2871
2896
|
onChange: (L) => E(z, L.target.value),
|
|
2872
|
-
onKeyDown: (L) =>
|
|
2897
|
+
onKeyDown: (L) => D(z, L),
|
|
2873
2898
|
autoFocus: z === 0
|
|
2874
2899
|
},
|
|
2875
2900
|
z
|
|
@@ -2888,7 +2913,7 @@ function re({ appearance: a, signUpUrl: s, onSignUp: r }) {
|
|
|
2888
2913
|
autoComplete: "email",
|
|
2889
2914
|
placeholder: "name@company.com",
|
|
2890
2915
|
value: m,
|
|
2891
|
-
onChange: (
|
|
2916
|
+
onChange: (T) => b(T.target.value),
|
|
2892
2917
|
required: !0
|
|
2893
2918
|
}
|
|
2894
2919
|
)
|
|
@@ -2907,8 +2932,8 @@ function re({ appearance: a, signUpUrl: s, onSignUp: r }) {
|
|
|
2907
2932
|
type: O ? "text" : "password",
|
|
2908
2933
|
autoComplete: "current-password",
|
|
2909
2934
|
placeholder: "••••••••",
|
|
2910
|
-
value:
|
|
2911
|
-
onChange: (
|
|
2935
|
+
value: w,
|
|
2936
|
+
onChange: (T) => y(T.target.value),
|
|
2912
2937
|
required: !0
|
|
2913
2938
|
}
|
|
2914
2939
|
),
|
|
@@ -2918,7 +2943,7 @@ function re({ appearance: a, signUpUrl: s, onSignUp: r }) {
|
|
|
2918
2943
|
type: "button",
|
|
2919
2944
|
className: "ss-auth-visibility-toggle",
|
|
2920
2945
|
onClick: () => h(!O),
|
|
2921
|
-
children: /* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: O ?
|
|
2946
|
+
children: /* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: O ? v.visibilityOff : v.visibility })
|
|
2922
2947
|
}
|
|
2923
2948
|
)
|
|
2924
2949
|
] })
|
|
@@ -2926,16 +2951,16 @@ function re({ appearance: a, signUpUrl: s, onSignUp: r }) {
|
|
|
2926
2951
|
] }),
|
|
2927
2952
|
/* @__PURE__ */ t("button", { type: "submit", className: "ss-auth-btn-primary", disabled: d, children: [
|
|
2928
2953
|
d && /* @__PURE__ */ e("span", { className: "ss-auth-spinner" }),
|
|
2929
|
-
|
|
2930
|
-
!d && /* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
2954
|
+
N ? "Verify" : "Sign in",
|
|
2955
|
+
!d && /* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: v.arrowForward })
|
|
2931
2956
|
] })
|
|
2932
2957
|
] }),
|
|
2933
|
-
|
|
2958
|
+
N ? /* @__PURE__ */ e("div", { className: "ss-auth-footer", children: /* @__PURE__ */ e(
|
|
2934
2959
|
"span",
|
|
2935
2960
|
{
|
|
2936
2961
|
className: "ss-auth-link",
|
|
2937
2962
|
onClick: () => {
|
|
2938
|
-
|
|
2963
|
+
C(!1), F(["", "", "", "", "", ""]), f(null);
|
|
2939
2964
|
},
|
|
2940
2965
|
children: "Back to sign in"
|
|
2941
2966
|
}
|
|
@@ -2947,41 +2972,41 @@ function re({ appearance: a, signUpUrl: s, onSignUp: r }) {
|
|
|
2947
2972
|
] }) }) });
|
|
2948
2973
|
}
|
|
2949
2974
|
function ne({ appearance: a, signInUrl: s, onSignIn: r }) {
|
|
2950
|
-
const { appearance: o, settings: n } = A(), { signUp: u, isLoading: i, error: l, setError: d } = ka(), { signInWithOAuth: c } = na(), f = a ?? o, [p, m] = g(""), [b,
|
|
2975
|
+
const { appearance: o, settings: n } = A(), { signUp: u, isLoading: i, error: l, setError: d } = ka(), { signInWithOAuth: c } = na(), f = a ?? o, [p, m] = g(""), [b, w] = g(""), [y, O] = g(""), [h, N] = g(!1), [C, P] = g(null), I = k(
|
|
2951
2976
|
async (x) => {
|
|
2952
2977
|
if (x.preventDefault(), P(null), b !== y) {
|
|
2953
2978
|
P("Passwords do not match");
|
|
2954
2979
|
return;
|
|
2955
2980
|
}
|
|
2956
|
-
const
|
|
2957
|
-
if (b.length <
|
|
2958
|
-
P(`Password must be at least ${
|
|
2981
|
+
const S = (n == null ? void 0 : n.passwordMinLength) ?? 8;
|
|
2982
|
+
if (b.length < S) {
|
|
2983
|
+
P(`Password must be at least ${S} characters`);
|
|
2959
2984
|
return;
|
|
2960
2985
|
}
|
|
2961
2986
|
await u(p, b);
|
|
2962
2987
|
},
|
|
2963
2988
|
[p, b, y, n, u]
|
|
2964
|
-
),
|
|
2989
|
+
), B = k(
|
|
2965
2990
|
async (x) => {
|
|
2966
2991
|
await c(x);
|
|
2967
2992
|
},
|
|
2968
2993
|
[c]
|
|
2969
|
-
),
|
|
2994
|
+
), F = (n == null ? void 0 : n.googleEnabled) || (n == null ? void 0 : n.githubEnabled), $ = C || l;
|
|
2970
2995
|
return /* @__PURE__ */ e(H, { appearance: f, children: /* @__PURE__ */ t("div", { style: { display: "flex", flexDirection: "column", alignItems: "center", width: "100%", maxWidth: "520px" }, children: [
|
|
2971
2996
|
/* @__PURE__ */ t("div", { className: "ss-auth-header", children: [
|
|
2972
|
-
/* @__PURE__ */ e("div", { className: "ss-auth-brand-icon-gradient", children: /* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
2997
|
+
/* @__PURE__ */ e("div", { className: "ss-auth-brand-icon-gradient", children: /* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: v.autoAwesome }) }),
|
|
2973
2998
|
/* @__PURE__ */ e("h1", { className: "ss-auth-title ss-auth-title-lg", children: "Create your account" }),
|
|
2974
2999
|
/* @__PURE__ */ e("p", { className: "ss-auth-subtitle", children: "Join the ecosystem" })
|
|
2975
3000
|
] }),
|
|
2976
3001
|
/* @__PURE__ */ e("div", { className: "ss-auth-card", children: /* @__PURE__ */ t("div", { className: "ss-auth-card-body", children: [
|
|
2977
|
-
|
|
3002
|
+
F && /* @__PURE__ */ t(j, { children: [
|
|
2978
3003
|
/* @__PURE__ */ t("div", { className: "ss-auth-oauth-grid", children: [
|
|
2979
3004
|
(n == null ? void 0 : n.googleEnabled) && /* @__PURE__ */ t(
|
|
2980
3005
|
"button",
|
|
2981
3006
|
{
|
|
2982
3007
|
type: "button",
|
|
2983
3008
|
className: "ss-auth-btn-social",
|
|
2984
|
-
onClick: () =>
|
|
3009
|
+
onClick: () => B("google"),
|
|
2985
3010
|
disabled: i,
|
|
2986
3011
|
children: [
|
|
2987
3012
|
/* @__PURE__ */ e("span", { dangerouslySetInnerHTML: { __html: ia } }),
|
|
@@ -2994,7 +3019,7 @@ function ne({ appearance: a, signInUrl: s, onSignIn: r }) {
|
|
|
2994
3019
|
{
|
|
2995
3020
|
type: "button",
|
|
2996
3021
|
className: "ss-auth-btn-social",
|
|
2997
|
-
onClick: () =>
|
|
3022
|
+
onClick: () => B("github"),
|
|
2998
3023
|
disabled: i,
|
|
2999
3024
|
children: [
|
|
3000
3025
|
/* @__PURE__ */ e("span", { dangerouslySetInnerHTML: { __html: la } }),
|
|
@@ -3005,9 +3030,9 @@ function ne({ appearance: a, signInUrl: s, onSignIn: r }) {
|
|
|
3005
3030
|
] }),
|
|
3006
3031
|
/* @__PURE__ */ e("div", { className: "ss-auth-divider", children: "or sign up with email" })
|
|
3007
3032
|
] }),
|
|
3008
|
-
|
|
3009
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
3010
|
-
/* @__PURE__ */ e("span", { children:
|
|
3033
|
+
$ && /* @__PURE__ */ t("div", { className: "ss-auth-error", children: [
|
|
3034
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: v.errorOutline }),
|
|
3035
|
+
/* @__PURE__ */ e("span", { children: $ })
|
|
3011
3036
|
] }),
|
|
3012
3037
|
/* @__PURE__ */ t("form", { onSubmit: I, children: [
|
|
3013
3038
|
/* @__PURE__ */ t("div", { className: "ss-auth-field", children: [
|
|
@@ -3039,7 +3064,7 @@ function ne({ appearance: a, signInUrl: s, onSignIn: r }) {
|
|
|
3039
3064
|
placeholder: "••••••••",
|
|
3040
3065
|
value: b,
|
|
3041
3066
|
onChange: (x) => {
|
|
3042
|
-
|
|
3067
|
+
w(x.target.value), P(null);
|
|
3043
3068
|
},
|
|
3044
3069
|
required: !0
|
|
3045
3070
|
}
|
|
@@ -3049,8 +3074,8 @@ function ne({ appearance: a, signInUrl: s, onSignIn: r }) {
|
|
|
3049
3074
|
{
|
|
3050
3075
|
type: "button",
|
|
3051
3076
|
className: "ss-auth-visibility-toggle",
|
|
3052
|
-
onClick: () =>
|
|
3053
|
-
children: /* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: h ?
|
|
3077
|
+
onClick: () => N(!h),
|
|
3078
|
+
children: /* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: h ? v.visibilityOff : v.visibility })
|
|
3054
3079
|
}
|
|
3055
3080
|
)
|
|
3056
3081
|
] })
|
|
@@ -3076,7 +3101,7 @@ function ne({ appearance: a, signInUrl: s, onSignIn: r }) {
|
|
|
3076
3101
|
/* @__PURE__ */ t("button", { type: "submit", className: "ss-auth-btn-primary", disabled: i, children: [
|
|
3077
3102
|
i && /* @__PURE__ */ e("span", { className: "ss-auth-spinner" }),
|
|
3078
3103
|
"Sign up",
|
|
3079
|
-
!i && /* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
3104
|
+
!i && /* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: v.arrowForward })
|
|
3080
3105
|
] })
|
|
3081
3106
|
] }),
|
|
3082
3107
|
/* @__PURE__ */ t("div", { className: "ss-auth-footer", children: [
|
|
@@ -3087,29 +3112,29 @@ function ne({ appearance: a, signInUrl: s, onSignIn: r }) {
|
|
|
3087
3112
|
] }) })
|
|
3088
3113
|
] }) });
|
|
3089
3114
|
}
|
|
3090
|
-
const
|
|
3115
|
+
const M = 320, q = 128;
|
|
3091
3116
|
function za({ file: a, onCrop: s, onCancel: r }) {
|
|
3092
3117
|
const o = _(null), n = _(null), [u, i] = g(1), [l, d] = g({ x: 0, y: 0 }), [c, f] = g(!1), p = _({ x: 0, y: 0, ox: 0, oy: 0 }), [m, b] = g(!1);
|
|
3093
|
-
|
|
3094
|
-
const h = new Image(),
|
|
3118
|
+
V(() => {
|
|
3119
|
+
const h = new Image(), N = URL.createObjectURL(a);
|
|
3095
3120
|
return h.onload = () => {
|
|
3096
3121
|
n.current = h, b(!0), d({ x: 0, y: 0 }), i(1);
|
|
3097
|
-
}, h.src =
|
|
3098
|
-
}, [a]),
|
|
3122
|
+
}, h.src = N, () => URL.revokeObjectURL(N);
|
|
3123
|
+
}, [a]), V(() => {
|
|
3099
3124
|
if (!m || !n.current || !o.current) return;
|
|
3100
3125
|
const h = o.current.getContext("2d");
|
|
3101
3126
|
if (!h) return;
|
|
3102
|
-
const
|
|
3103
|
-
h.clearRect(0, 0,
|
|
3104
|
-
const
|
|
3105
|
-
h.save(), h.beginPath(), h.arc(
|
|
3127
|
+
const N = n.current;
|
|
3128
|
+
h.clearRect(0, 0, M, M), h.fillStyle = "#111", h.fillRect(0, 0, M, M);
|
|
3129
|
+
const C = Math.max(M / N.width, M / N.height) * u, P = N.width * C, I = N.height * C, B = (M - P) / 2 + l.x, F = (M - I) / 2 + l.y;
|
|
3130
|
+
h.save(), h.beginPath(), h.arc(M / 2, M / 2, q, 0, Math.PI * 2), h.clip(), h.drawImage(N, B, F, P, I), h.restore(), h.save(), h.fillStyle = "rgba(0, 0, 0, 0.6)", h.fillRect(0, 0, M, M), h.globalCompositeOperation = "destination-out", h.beginPath(), h.arc(M / 2, M / 2, q, 0, Math.PI * 2), h.fill(), h.restore(), h.save(), h.beginPath(), h.arc(M / 2, M / 2, q, 0, Math.PI * 2), h.clip(), h.drawImage(N, B, F, P, I), h.restore(), h.strokeStyle = "rgba(255, 255, 255, 0.4)", h.lineWidth = 2, h.beginPath(), h.arc(M / 2, M / 2, q, 0, Math.PI * 2), h.stroke();
|
|
3106
3131
|
}, [u, l, m]);
|
|
3107
|
-
const
|
|
3132
|
+
const w = k(
|
|
3108
3133
|
(h) => {
|
|
3109
3134
|
f(!0), p.current = { x: h.clientX, y: h.clientY, ox: l.x, oy: l.y }, h.target.setPointerCapture(h.pointerId);
|
|
3110
3135
|
},
|
|
3111
3136
|
[l]
|
|
3112
|
-
), y =
|
|
3137
|
+
), y = k(
|
|
3113
3138
|
(h) => {
|
|
3114
3139
|
c && d({
|
|
3115
3140
|
x: p.current.ox + (h.clientX - p.current.x),
|
|
@@ -3117,16 +3142,16 @@ function za({ file: a, onCrop: s, onCancel: r }) {
|
|
|
3117
3142
|
});
|
|
3118
3143
|
},
|
|
3119
3144
|
[c]
|
|
3120
|
-
), O =
|
|
3121
|
-
return
|
|
3145
|
+
), O = k(() => f(!1), []);
|
|
3146
|
+
return k(() => {
|
|
3122
3147
|
if (!n.current) return;
|
|
3123
|
-
const h = document.createElement("canvas"),
|
|
3124
|
-
h.width =
|
|
3125
|
-
const
|
|
3126
|
-
if (!
|
|
3127
|
-
const P = n.current, I = Math.max(
|
|
3128
|
-
|
|
3129
|
-
|
|
3148
|
+
const h = document.createElement("canvas"), N = q * 2;
|
|
3149
|
+
h.width = N, h.height = N;
|
|
3150
|
+
const C = h.getContext("2d");
|
|
3151
|
+
if (!C) return;
|
|
3152
|
+
const P = n.current, I = Math.max(M / P.width, M / P.height) * u, B = P.width * I, F = P.height * I, $ = (M - B) / 2 + l.x - (M / 2 - q), x = (M - F) / 2 + l.y - (M / 2 - q);
|
|
3153
|
+
C.beginPath(), C.arc(q, q, q, 0, Math.PI * 2), C.clip(), C.drawImage(P, $, x, B, F), h.toBlob((S) => {
|
|
3154
|
+
S && s(S);
|
|
3130
3155
|
}, "image/png");
|
|
3131
3156
|
}, [u, l, s]), /* @__PURE__ */ t("div", { style: { display: "flex", flexDirection: "column", alignItems: "center", gap: "24px" }, children: [
|
|
3132
3157
|
/* @__PURE__ */ t("div", { className: "ss-auth-crop-area", children: [
|
|
@@ -3134,10 +3159,10 @@ function za({ file: a, onCrop: s, onCancel: r }) {
|
|
|
3134
3159
|
"canvas",
|
|
3135
3160
|
{
|
|
3136
3161
|
ref: o,
|
|
3137
|
-
width:
|
|
3138
|
-
height:
|
|
3162
|
+
width: M,
|
|
3163
|
+
height: M,
|
|
3139
3164
|
style: { cursor: c ? "grabbing" : "grab", width: "100%", height: "100%" },
|
|
3140
|
-
onPointerDown:
|
|
3165
|
+
onPointerDown: w,
|
|
3141
3166
|
onPointerMove: y,
|
|
3142
3167
|
onPointerUp: O
|
|
3143
3168
|
}
|
|
@@ -3145,7 +3170,7 @@ function za({ file: a, onCrop: s, onCancel: r }) {
|
|
|
3145
3170
|
/* @__PURE__ */ e("div", { className: "ss-auth-crop-size-badge", children: "256 x 256 px" })
|
|
3146
3171
|
] }),
|
|
3147
3172
|
/* @__PURE__ */ t("div", { className: "ss-auth-zoom-control", style: { width: "100%", maxWidth: "280px" }, children: [
|
|
3148
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
3173
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: v.zoomOut }),
|
|
3149
3174
|
/* @__PURE__ */ e(
|
|
3150
3175
|
"input",
|
|
3151
3176
|
{
|
|
@@ -3158,12 +3183,12 @@ function za({ file: a, onCrop: s, onCancel: r }) {
|
|
|
3158
3183
|
className: "ss-auth-zoom-slider"
|
|
3159
3184
|
}
|
|
3160
3185
|
),
|
|
3161
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
3186
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: v.zoomIn })
|
|
3162
3187
|
] })
|
|
3163
3188
|
] });
|
|
3164
3189
|
}
|
|
3165
3190
|
function ca({ onUpload: a, onClose: s, isLoading: r }) {
|
|
3166
|
-
const [o, n] = g(null), [u, i] = g(!1), [l, d] = g(null), c = _(null), f =
|
|
3191
|
+
const [o, n] = g(null), [u, i] = g(!1), [l, d] = g(null), c = _(null), f = k((b) => {
|
|
3167
3192
|
if (!b.type.startsWith("image/")) {
|
|
3168
3193
|
d("Please select an image file");
|
|
3169
3194
|
return;
|
|
@@ -3173,14 +3198,14 @@ function ca({ onUpload: a, onClose: s, isLoading: r }) {
|
|
|
3173
3198
|
return;
|
|
3174
3199
|
}
|
|
3175
3200
|
d(null), n(b);
|
|
3176
|
-
}, []), p =
|
|
3201
|
+
}, []), p = k(
|
|
3177
3202
|
(b) => {
|
|
3178
3203
|
b.preventDefault(), i(!1);
|
|
3179
|
-
const
|
|
3180
|
-
|
|
3204
|
+
const w = b.dataTransfer.files[0];
|
|
3205
|
+
w && f(w);
|
|
3181
3206
|
},
|
|
3182
3207
|
[f]
|
|
3183
|
-
), m =
|
|
3208
|
+
), m = k(
|
|
3184
3209
|
async (b) => {
|
|
3185
3210
|
await a(b);
|
|
3186
3211
|
},
|
|
@@ -3191,11 +3216,11 @@ function ca({ onUpload: a, onClose: s, isLoading: r }) {
|
|
|
3191
3216
|
}, children: /* @__PURE__ */ t("div", { className: "ss-auth-modal ss-auth-card-wide", children: [
|
|
3192
3217
|
/* @__PURE__ */ t("div", { className: "ss-auth-modal-header", children: [
|
|
3193
3218
|
/* @__PURE__ */ e("h2", { children: "Upload avatar" }),
|
|
3194
|
-
/* @__PURE__ */ e("button", { type: "button", className: "ss-auth-modal-close", onClick: s, children: /* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
3219
|
+
/* @__PURE__ */ e("button", { type: "button", className: "ss-auth-modal-close", onClick: s, children: /* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: v.close }) })
|
|
3195
3220
|
] }),
|
|
3196
3221
|
/* @__PURE__ */ t("div", { className: "ss-auth-modal-body", children: [
|
|
3197
3222
|
l && /* @__PURE__ */ t("div", { className: "ss-auth-error", style: { marginBottom: "24px" }, children: [
|
|
3198
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
3223
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: v.errorOutline }),
|
|
3199
3224
|
/* @__PURE__ */ e("span", { children: l })
|
|
3200
3225
|
] }),
|
|
3201
3226
|
/* @__PURE__ */ t("div", { className: "ss-auth-upload-grid", children: [
|
|
@@ -3213,7 +3238,7 @@ function ca({ onUpload: a, onClose: s, isLoading: r }) {
|
|
|
3213
3238
|
aspectRatio: "1"
|
|
3214
3239
|
},
|
|
3215
3240
|
children: [
|
|
3216
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", style: { fontSize: "48px", opacity: 0.3 }, children:
|
|
3241
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", style: { fontSize: "48px", opacity: 0.3 }, children: v.image }),
|
|
3217
3242
|
/* @__PURE__ */ e("span", { style: { fontSize: "12px", opacity: 0.4 }, children: "No image selected" })
|
|
3218
3243
|
]
|
|
3219
3244
|
}
|
|
@@ -3234,7 +3259,7 @@ function ca({ onUpload: a, onClose: s, isLoading: r }) {
|
|
|
3234
3259
|
},
|
|
3235
3260
|
style: { minHeight: "180px" },
|
|
3236
3261
|
children: [
|
|
3237
|
-
/* @__PURE__ */ e("div", { className: "ss-auth-dropzone-icon", children: /* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
3262
|
+
/* @__PURE__ */ e("div", { className: "ss-auth-dropzone-icon", children: /* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: v.cloudUpload }) }),
|
|
3238
3263
|
/* @__PURE__ */ e("span", { className: "ss-auth-dropzone-title", children: "Drag and drop" }),
|
|
3239
3264
|
/* @__PURE__ */ t("span", { className: "ss-auth-dropzone-desc", children: [
|
|
3240
3265
|
"JPG, PNG or WEBP",
|
|
@@ -3250,8 +3275,8 @@ function ca({ onUpload: a, onClose: s, isLoading: r }) {
|
|
|
3250
3275
|
accept: "image/*",
|
|
3251
3276
|
style: { display: "none" },
|
|
3252
3277
|
onChange: (b) => {
|
|
3253
|
-
var
|
|
3254
|
-
(
|
|
3278
|
+
var w;
|
|
3279
|
+
(w = b.target.files) != null && w[0] && f(b.target.files[0]);
|
|
3255
3280
|
}
|
|
3256
3281
|
}
|
|
3257
3282
|
)
|
|
@@ -3259,7 +3284,7 @@ function ca({ onUpload: a, onClose: s, isLoading: r }) {
|
|
|
3259
3284
|
}
|
|
3260
3285
|
),
|
|
3261
3286
|
/* @__PURE__ */ t("div", { className: "ss-auth-info-box", children: [
|
|
3262
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
3287
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: v.info }),
|
|
3263
3288
|
/* @__PURE__ */ e("span", { children: "Your profile photo will be visible to all members of your organization." })
|
|
3264
3289
|
] })
|
|
3265
3290
|
] })
|
|
@@ -3279,7 +3304,7 @@ function ca({ onUpload: a, onClose: s, isLoading: r }) {
|
|
|
3279
3304
|
children: [
|
|
3280
3305
|
r && /* @__PURE__ */ e("span", { className: "ss-auth-spinner" }),
|
|
3281
3306
|
"Save Profile",
|
|
3282
|
-
!r && /* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
3307
|
+
!r && /* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: v.check })
|
|
3283
3308
|
]
|
|
3284
3309
|
}
|
|
3285
3310
|
)
|
|
@@ -3288,17 +3313,18 @@ function ca({ onUpload: a, onClose: s, isLoading: r }) {
|
|
|
3288
3313
|
}
|
|
3289
3314
|
function Pa({ onClose: a, afterDeleteAccountUrl: s, defaultTab: r = "profile" }) {
|
|
3290
3315
|
const [o, n] = g(r), u = [
|
|
3291
|
-
{ key: "profile", label: "Profile", icon:
|
|
3292
|
-
{ key: "organization", label: "Organization", icon:
|
|
3293
|
-
{ key: "people", label: "People", icon:
|
|
3294
|
-
{ key: "billing", label: "Billing", icon:
|
|
3316
|
+
{ key: "profile", label: "Profile", icon: v.person },
|
|
3317
|
+
{ key: "organization", label: "Organization", icon: v.corporateFare },
|
|
3318
|
+
{ key: "people", label: "People", icon: v.group },
|
|
3319
|
+
{ key: "billing", label: "Billing", icon: v.creditCard }
|
|
3295
3320
|
];
|
|
3296
|
-
return /* @__PURE__ */
|
|
3297
|
-
i.target === i.currentTarget && a();
|
|
3298
|
-
}, children: /* @__PURE__ */ t("div", { className: "ss-auth-settings-page", children: [
|
|
3321
|
+
return /* @__PURE__ */ t("div", { className: "ss-auth-settings-page", children: [
|
|
3299
3322
|
/* @__PURE__ */ t("div", { className: "ss-auth-settings-header", children: [
|
|
3300
|
-
/* @__PURE__ */
|
|
3301
|
-
|
|
3323
|
+
/* @__PURE__ */ t("div", { style: { display: "flex", alignItems: "center", gap: "12px" }, children: [
|
|
3324
|
+
/* @__PURE__ */ e("button", { type: "button", className: "ss-auth-settings-back", onClick: a, children: /* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: v.arrowBack }) }),
|
|
3325
|
+
/* @__PURE__ */ e("h2", { children: "Settings" })
|
|
3326
|
+
] }),
|
|
3327
|
+
/* @__PURE__ */ e("button", { type: "button", className: "ss-auth-modal-close", onClick: a, children: /* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: v.close }) })
|
|
3302
3328
|
] }),
|
|
3303
3329
|
/* @__PURE__ */ t("div", { className: "ss-auth-settings-layout", children: [
|
|
3304
3330
|
/* @__PURE__ */ e("nav", { className: "ss-auth-settings-nav", children: u.map((i) => /* @__PURE__ */ t(
|
|
@@ -3318,37 +3344,37 @@ function Pa({ onClose: a, afterDeleteAccountUrl: s, defaultTab: r = "profile" })
|
|
|
3318
3344
|
o === "profile" && /* @__PURE__ */ e(Oa, { afterDeleteAccountUrl: s }),
|
|
3319
3345
|
o === "organization" && /* @__PURE__ */ e(Ea, {}),
|
|
3320
3346
|
o === "people" && /* @__PURE__ */ e(Ia, {}),
|
|
3321
|
-
o === "billing" && /* @__PURE__ */ e(
|
|
3347
|
+
o === "billing" && /* @__PURE__ */ e(Ba, {})
|
|
3322
3348
|
] })
|
|
3323
3349
|
] })
|
|
3324
|
-
] })
|
|
3350
|
+
] });
|
|
3325
3351
|
}
|
|
3326
3352
|
function Oa({ afterDeleteAccountUrl: a }) {
|
|
3327
|
-
const { user: s, updateProfile: r, uploadAvatar: o, changePassword: n, isLoading: u, error: i, success: l, setError: d, setSuccess: c } = oa(), { signOut: f } = sa(), { deleteAccount: p, isLoading: m, error: b, setError:
|
|
3353
|
+
const { user: s, updateProfile: r, uploadAvatar: o, changePassword: n, isLoading: u, error: i, success: l, setError: d, setSuccess: c } = oa(), { signOut: f } = sa(), { deleteAccount: p, isLoading: m, error: b, setError: w } = Ca(), [y, O] = g((s == null ? void 0 : s.name) ?? ""), [h, N] = g((s == null ? void 0 : s.avatarUrl) ?? ""), [C, P] = g(!1), [I, B] = g(""), [F, $] = g(""), [x, S] = g(""), [E, D] = g(null), [U, T] = g(!1), [z, L] = g(""), W = k(
|
|
3328
3354
|
async (R) => {
|
|
3329
3355
|
R.preventDefault(), d(null), c(null), await r({ name: y, avatarUrl: h || void 0 });
|
|
3330
3356
|
},
|
|
3331
3357
|
[y, h, r, d, c]
|
|
3332
|
-
), K =
|
|
3358
|
+
), K = k(
|
|
3333
3359
|
async (R) => {
|
|
3334
3360
|
const X = await o(R);
|
|
3335
|
-
X && (
|
|
3361
|
+
X && (N(X.avatarUrl), P(!1));
|
|
3336
3362
|
},
|
|
3337
3363
|
[o]
|
|
3338
|
-
), J =
|
|
3364
|
+
), J = k(
|
|
3339
3365
|
async (R) => {
|
|
3340
|
-
if (R.preventDefault(),
|
|
3341
|
-
|
|
3366
|
+
if (R.preventDefault(), D(null), d(null), c(null), F !== x) {
|
|
3367
|
+
D("Passwords do not match");
|
|
3342
3368
|
return;
|
|
3343
3369
|
}
|
|
3344
|
-
if (
|
|
3345
|
-
|
|
3370
|
+
if (F.length < 8) {
|
|
3371
|
+
D("Password must be at least 8 characters");
|
|
3346
3372
|
return;
|
|
3347
3373
|
}
|
|
3348
|
-
await n(I,
|
|
3374
|
+
await n(I, F) && (B(""), $(""), S(""));
|
|
3349
3375
|
},
|
|
3350
|
-
[I,
|
|
3351
|
-
), ua =
|
|
3376
|
+
[I, F, x, n, d, c]
|
|
3377
|
+
), ua = k(async () => {
|
|
3352
3378
|
await p() && (await f(), a && (window.location.href = a));
|
|
3353
3379
|
}, [p, f, a]), pa = (s == null ? void 0 : s.provider) === "email", ha = z === (s == null ? void 0 : s.email), ga = ((s == null ? void 0 : s.name) || (s == null ? void 0 : s.email) || "?").charAt(0).toUpperCase();
|
|
3354
3380
|
return /* @__PURE__ */ t(j, { children: [
|
|
@@ -3367,7 +3393,7 @@ function Oa({ afterDeleteAccountUrl: a }) {
|
|
|
3367
3393
|
opacity: 0.4
|
|
3368
3394
|
}, children: ga }),
|
|
3369
3395
|
/* @__PURE__ */ t("div", { className: "ss-auth-avatar-overlay", children: [
|
|
3370
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
3396
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: v.camera }),
|
|
3371
3397
|
/* @__PURE__ */ e("span", { children: "Edit" })
|
|
3372
3398
|
] })
|
|
3373
3399
|
] }),
|
|
@@ -3375,7 +3401,7 @@ function Oa({ afterDeleteAccountUrl: a }) {
|
|
|
3375
3401
|
/* @__PURE__ */ t("h2", { className: "ss-auth-profile-name", children: [
|
|
3376
3402
|
(s == null ? void 0 : s.name) || "Unnamed User",
|
|
3377
3403
|
(s == null ? void 0 : s.emailVerified) && /* @__PURE__ */ t("span", { className: "ss-auth-badge ss-auth-badge-success", children: [
|
|
3378
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", style: { fontSize: "12px", fontVariationSettings: "'FILL' 1" }, children:
|
|
3404
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", style: { fontSize: "12px", fontVariationSettings: "'FILL' 1" }, children: v.verified }),
|
|
3379
3405
|
"Verified"
|
|
3380
3406
|
] })
|
|
3381
3407
|
] }),
|
|
@@ -3383,11 +3409,11 @@ function Oa({ afterDeleteAccountUrl: a }) {
|
|
|
3383
3409
|
] })
|
|
3384
3410
|
] }),
|
|
3385
3411
|
i && /* @__PURE__ */ t("div", { className: "ss-auth-error", children: [
|
|
3386
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
3412
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: v.errorOutline }),
|
|
3387
3413
|
/* @__PURE__ */ e("span", { children: i })
|
|
3388
3414
|
] }),
|
|
3389
3415
|
l && /* @__PURE__ */ t("div", { className: "ss-auth-info-box", style: { marginBottom: "16px" }, children: [
|
|
3390
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
3416
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: v.check }),
|
|
3391
3417
|
/* @__PURE__ */ e("span", { children: l })
|
|
3392
3418
|
] }),
|
|
3393
3419
|
/* @__PURE__ */ t("form", { onSubmit: W, children: [
|
|
@@ -3409,7 +3435,7 @@ function Oa({ afterDeleteAccountUrl: a }) {
|
|
|
3409
3435
|
/* @__PURE__ */ e("label", { className: "ss-auth-label", children: "Email Address" }),
|
|
3410
3436
|
/* @__PURE__ */ t("div", { style: { position: "relative" }, children: [
|
|
3411
3437
|
/* @__PURE__ */ e("input", { className: "ss-auth-input ss-auth-input-readonly", type: "email", value: (s == null ? void 0 : s.email) ?? "", readOnly: !0 }),
|
|
3412
|
-
/* @__PURE__ */ e("span", { className: "ss-auth-visibility-toggle", style: { cursor: "default" }, children: /* @__PURE__ */ e("span", { className: "material-symbols-outlined", style: { fontSize: "18px" }, children:
|
|
3438
|
+
/* @__PURE__ */ e("span", { className: "ss-auth-visibility-toggle", style: { cursor: "default" }, children: /* @__PURE__ */ e("span", { className: "material-symbols-outlined", style: { fontSize: "18px" }, children: v.lock }) })
|
|
3413
3439
|
] })
|
|
3414
3440
|
] }),
|
|
3415
3441
|
/* @__PURE__ */ t("div", { children: [
|
|
@@ -3425,26 +3451,26 @@ function Oa({ afterDeleteAccountUrl: a }) {
|
|
|
3425
3451
|
] }),
|
|
3426
3452
|
pa && /* @__PURE__ */ t("div", { className: "ss-auth-settings-card", children: [
|
|
3427
3453
|
/* @__PURE__ */ t("h4", { children: [
|
|
3428
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
3454
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: v.security }),
|
|
3429
3455
|
"Security Credentials"
|
|
3430
3456
|
] }),
|
|
3431
3457
|
E && /* @__PURE__ */ t("div", { className: "ss-auth-error", style: { marginBottom: "16px" }, children: [
|
|
3432
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
3458
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: v.errorOutline }),
|
|
3433
3459
|
/* @__PURE__ */ e("span", { children: E })
|
|
3434
3460
|
] }),
|
|
3435
3461
|
/* @__PURE__ */ t("form", { onSubmit: J, children: [
|
|
3436
3462
|
/* @__PURE__ */ t("div", { className: "ss-auth-field", children: [
|
|
3437
3463
|
/* @__PURE__ */ e("label", { className: "ss-auth-label", children: "Current Password" }),
|
|
3438
|
-
/* @__PURE__ */ e("input", { className: "ss-auth-input", type: "password", placeholder: "••••••••••••", value: I, onChange: (R) =>
|
|
3464
|
+
/* @__PURE__ */ e("input", { className: "ss-auth-input", type: "password", placeholder: "••••••••••••", value: I, onChange: (R) => B(R.target.value), required: !0 })
|
|
3439
3465
|
] }),
|
|
3440
3466
|
/* @__PURE__ */ t("div", { className: "ss-auth-profile-grid", style: { marginBottom: "16px" }, children: [
|
|
3441
3467
|
/* @__PURE__ */ t("div", { children: [
|
|
3442
3468
|
/* @__PURE__ */ e("label", { className: "ss-auth-label", children: "New Password" }),
|
|
3443
|
-
/* @__PURE__ */ e("input", { className: "ss-auth-input", type: "password", placeholder: "Min. 8 characters", value:
|
|
3469
|
+
/* @__PURE__ */ e("input", { className: "ss-auth-input", type: "password", placeholder: "Min. 8 characters", value: F, onChange: (R) => $(R.target.value), required: !0 })
|
|
3444
3470
|
] }),
|
|
3445
3471
|
/* @__PURE__ */ t("div", { children: [
|
|
3446
3472
|
/* @__PURE__ */ e("label", { className: "ss-auth-label", children: "Confirm New Password" }),
|
|
3447
|
-
/* @__PURE__ */ e("input", { className: "ss-auth-input", type: "password", placeholder: "Repeat new password", value: x, onChange: (R) =>
|
|
3473
|
+
/* @__PURE__ */ e("input", { className: "ss-auth-input", type: "password", placeholder: "Repeat new password", value: x, onChange: (R) => S(R.target.value), required: !0 })
|
|
3448
3474
|
] })
|
|
3449
3475
|
] }),
|
|
3450
3476
|
/* @__PURE__ */ e("div", { style: { display: "flex", justifyContent: "flex-end" }, children: /* @__PURE__ */ e("button", { type: "submit", className: "ss-auth-btn-ghost", disabled: u, children: "Update Security" }) })
|
|
@@ -3454,10 +3480,10 @@ function Oa({ afterDeleteAccountUrl: a }) {
|
|
|
3454
3480
|
/* @__PURE__ */ e("h4", { children: "Danger Zone" }),
|
|
3455
3481
|
/* @__PURE__ */ e("p", { className: "ss-auth-section-desc", style: { marginBottom: "16px" }, children: "Deleting your account is permanent. All organizations you own will also be deleted." }),
|
|
3456
3482
|
b && /* @__PURE__ */ t("div", { className: "ss-auth-error", children: [
|
|
3457
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
3483
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: v.errorOutline }),
|
|
3458
3484
|
/* @__PURE__ */ e("span", { children: b })
|
|
3459
3485
|
] }),
|
|
3460
|
-
|
|
3486
|
+
U ? /* @__PURE__ */ t("div", { children: [
|
|
3461
3487
|
/* @__PURE__ */ t("div", { className: "ss-auth-field", children: [
|
|
3462
3488
|
/* @__PURE__ */ e("label", { className: "ss-auth-label", children: "Type your email to confirm" }),
|
|
3463
3489
|
/* @__PURE__ */ e(
|
|
@@ -3479,7 +3505,7 @@ function Oa({ afterDeleteAccountUrl: a }) {
|
|
|
3479
3505
|
type: "button",
|
|
3480
3506
|
className: "ss-auth-btn-ghost",
|
|
3481
3507
|
onClick: () => {
|
|
3482
|
-
|
|
3508
|
+
T(!1), L(""), w(null);
|
|
3483
3509
|
},
|
|
3484
3510
|
children: "Cancel"
|
|
3485
3511
|
}
|
|
@@ -3505,12 +3531,12 @@ function Oa({ afterDeleteAccountUrl: a }) {
|
|
|
3505
3531
|
type: "button",
|
|
3506
3532
|
className: "ss-auth-btn-outline",
|
|
3507
3533
|
style: { borderColor: "currentColor", width: "auto" },
|
|
3508
|
-
onClick: () =>
|
|
3534
|
+
onClick: () => T(!0),
|
|
3509
3535
|
children: "Delete my account"
|
|
3510
3536
|
}
|
|
3511
3537
|
)
|
|
3512
3538
|
] }),
|
|
3513
|
-
|
|
3539
|
+
C && /* @__PURE__ */ e(
|
|
3514
3540
|
ca,
|
|
3515
3541
|
{
|
|
3516
3542
|
onUpload: K,
|
|
@@ -3521,22 +3547,22 @@ function Oa({ afterDeleteAccountUrl: a }) {
|
|
|
3521
3547
|
] });
|
|
3522
3548
|
}
|
|
3523
3549
|
function Ea() {
|
|
3524
|
-
const { selectedOrg: a, updateOrg: s, deleteOrg: r, isLoading: o, error: n, setError: u } = Y(), [i, l] = g((a == null ? void 0 : a.name) ?? ""), [d, c] = g(!1), [f, p] = g(!1), [m, b] = g(!1), [
|
|
3525
|
-
if (
|
|
3550
|
+
const { selectedOrg: a, updateOrg: s, deleteOrg: r, isLoading: o, error: n, setError: u } = Y(), [i, l] = g((a == null ? void 0 : a.name) ?? ""), [d, c] = g(!1), [f, p] = g(!1), [m, b] = g(!1), [w, y] = g("");
|
|
3551
|
+
if (V(() => {
|
|
3526
3552
|
a && l(a.name);
|
|
3527
3553
|
}, [a]), !a)
|
|
3528
3554
|
return /* @__PURE__ */ t(j, { children: [
|
|
3529
3555
|
/* @__PURE__ */ e("h3", { children: "Organization" }),
|
|
3530
3556
|
/* @__PURE__ */ t("div", { className: "ss-auth-settings-empty", children: [
|
|
3531
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
3557
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: v.corporateFare }),
|
|
3532
3558
|
/* @__PURE__ */ e("div", { children: "Select an organization from the user menu to manage its settings." })
|
|
3533
3559
|
] })
|
|
3534
3560
|
] });
|
|
3535
|
-
const O = async (
|
|
3536
|
-
if (
|
|
3561
|
+
const O = async (N) => {
|
|
3562
|
+
if (N.preventDefault(), !i.trim()) return;
|
|
3537
3563
|
c(!0), p(!1);
|
|
3538
|
-
const
|
|
3539
|
-
c(!1),
|
|
3564
|
+
const C = await s(a.id, { name: i.trim() });
|
|
3565
|
+
c(!1), C && p(!0);
|
|
3540
3566
|
}, h = async () => {
|
|
3541
3567
|
await r(a.id) && b(!1);
|
|
3542
3568
|
};
|
|
@@ -3544,15 +3570,15 @@ function Ea() {
|
|
|
3544
3570
|
/* @__PURE__ */ e("h3", { children: "Organization" }),
|
|
3545
3571
|
/* @__PURE__ */ t("div", { className: "ss-auth-settings-card", children: [
|
|
3546
3572
|
/* @__PURE__ */ t("h4", { children: [
|
|
3547
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
3573
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: v.corporateFare }),
|
|
3548
3574
|
"General"
|
|
3549
3575
|
] }),
|
|
3550
3576
|
n && /* @__PURE__ */ t("div", { className: "ss-auth-error", style: { marginBottom: "16px" }, children: [
|
|
3551
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
3577
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: v.errorOutline }),
|
|
3552
3578
|
/* @__PURE__ */ e("span", { children: n })
|
|
3553
3579
|
] }),
|
|
3554
3580
|
f && /* @__PURE__ */ t("div", { className: "ss-auth-info-box", style: { marginBottom: "16px" }, children: [
|
|
3555
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
3581
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: v.check }),
|
|
3556
3582
|
/* @__PURE__ */ e("span", { children: "Organization updated" })
|
|
3557
3583
|
] }),
|
|
3558
3584
|
/* @__PURE__ */ t("form", { onSubmit: O, children: [
|
|
@@ -3564,8 +3590,8 @@ function Ea() {
|
|
|
3564
3590
|
className: "ss-auth-input",
|
|
3565
3591
|
type: "text",
|
|
3566
3592
|
value: i,
|
|
3567
|
-
onChange: (
|
|
3568
|
-
l(
|
|
3593
|
+
onChange: (N) => {
|
|
3594
|
+
l(N.target.value), p(!1);
|
|
3569
3595
|
}
|
|
3570
3596
|
}
|
|
3571
3597
|
)
|
|
@@ -3592,8 +3618,8 @@ function Ea() {
|
|
|
3592
3618
|
className: "ss-auth-input",
|
|
3593
3619
|
type: "text",
|
|
3594
3620
|
placeholder: a.name,
|
|
3595
|
-
value:
|
|
3596
|
-
onChange: (
|
|
3621
|
+
value: w,
|
|
3622
|
+
onChange: (N) => y(N.target.value),
|
|
3597
3623
|
autoFocus: !0
|
|
3598
3624
|
}
|
|
3599
3625
|
)
|
|
@@ -3608,7 +3634,7 @@ function Ea() {
|
|
|
3608
3634
|
type: "button",
|
|
3609
3635
|
className: "ss-auth-btn-primary ss-auth-btn-sm",
|
|
3610
3636
|
style: { width: "auto", background: "linear-gradient(135deg, #ef4444, #dc2626)" },
|
|
3611
|
-
disabled:
|
|
3637
|
+
disabled: w !== a.name || o,
|
|
3612
3638
|
onClick: h,
|
|
3613
3639
|
children: [
|
|
3614
3640
|
o && /* @__PURE__ */ e("span", { className: "ss-auth-spinner" }),
|
|
@@ -3644,42 +3670,42 @@ function Ia() {
|
|
|
3644
3670
|
updateMemberRole: c,
|
|
3645
3671
|
removeMember: f,
|
|
3646
3672
|
refreshMembers: p
|
|
3647
|
-
} = Y(), [m, b] = g(""), [
|
|
3648
|
-
if (
|
|
3673
|
+
} = Y(), [m, b] = g(""), [w, y] = g("member"), [O, h] = g(!1), [N, C] = g(!1), [P, I] = g(null), [B, F] = g(""), [$, x] = g(null);
|
|
3674
|
+
if (V(() => {
|
|
3649
3675
|
a && (p(a.id), l(a.id));
|
|
3650
3676
|
}, [a, p, l]), !a)
|
|
3651
3677
|
return /* @__PURE__ */ t(j, { children: [
|
|
3652
3678
|
/* @__PURE__ */ e("h3", { children: "People" }),
|
|
3653
3679
|
/* @__PURE__ */ t("div", { className: "ss-auth-settings-empty", children: [
|
|
3654
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
3680
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: v.group }),
|
|
3655
3681
|
/* @__PURE__ */ e("div", { children: "Select an organization from the user menu to manage members." })
|
|
3656
3682
|
] })
|
|
3657
3683
|
] });
|
|
3658
|
-
const
|
|
3659
|
-
z.preventDefault(),
|
|
3684
|
+
const S = async (z) => {
|
|
3685
|
+
z.preventDefault(), C(!1), await i(a.id, m, w) && (b(""), y("member"), C(!0), h(!1), l(a.id));
|
|
3660
3686
|
}, E = async () => {
|
|
3661
3687
|
if (!P) return;
|
|
3662
|
-
await c(a.id, P.userId,
|
|
3663
|
-
},
|
|
3664
|
-
if (
|
|
3665
|
-
await f(a.id,
|
|
3666
|
-
},
|
|
3688
|
+
await c(a.id, P.userId, B) && I(null);
|
|
3689
|
+
}, D = async () => {
|
|
3690
|
+
if (!$) return;
|
|
3691
|
+
await f(a.id, $.userId) && x(null);
|
|
3692
|
+
}, U = async (z) => {
|
|
3667
3693
|
await d(a.id, z);
|
|
3668
|
-
},
|
|
3694
|
+
}, T = (z) => z === "owner" ? "ss-auth-role-badge ss-auth-role-badge-owner" : z === "admin" ? "ss-auth-role-badge ss-auth-role-badge-admin" : "ss-auth-role-badge ss-auth-role-badge-member";
|
|
3669
3695
|
return /* @__PURE__ */ t(j, { children: [
|
|
3670
3696
|
/* @__PURE__ */ e("h3", { children: "People" }),
|
|
3671
3697
|
n && /* @__PURE__ */ t("div", { className: "ss-auth-error", style: { marginBottom: "16px" }, children: [
|
|
3672
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
3698
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: v.errorOutline }),
|
|
3673
3699
|
/* @__PURE__ */ e("span", { children: n })
|
|
3674
3700
|
] }),
|
|
3675
|
-
|
|
3676
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
3701
|
+
N && /* @__PURE__ */ t("div", { className: "ss-auth-info-box", style: { marginBottom: "16px" }, children: [
|
|
3702
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: v.check }),
|
|
3677
3703
|
/* @__PURE__ */ e("span", { children: "Invitation sent" })
|
|
3678
3704
|
] }),
|
|
3679
3705
|
/* @__PURE__ */ t("div", { className: "ss-auth-settings-card", children: [
|
|
3680
3706
|
/* @__PURE__ */ t("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", marginBottom: "16px" }, children: [
|
|
3681
3707
|
/* @__PURE__ */ t("h4", { style: { margin: 0 }, children: [
|
|
3682
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
3708
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: v.group }),
|
|
3683
3709
|
"Members"
|
|
3684
3710
|
] }),
|
|
3685
3711
|
/* @__PURE__ */ t(
|
|
@@ -3690,13 +3716,13 @@ function Ia() {
|
|
|
3690
3716
|
style: { width: "auto" },
|
|
3691
3717
|
onClick: () => h(!O),
|
|
3692
3718
|
children: [
|
|
3693
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", style: { fontSize: "16px" }, children:
|
|
3719
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", style: { fontSize: "16px" }, children: v.add }),
|
|
3694
3720
|
"Invite"
|
|
3695
3721
|
]
|
|
3696
3722
|
}
|
|
3697
3723
|
)
|
|
3698
3724
|
] }),
|
|
3699
|
-
O && /* @__PURE__ */ e("form", { onSubmit:
|
|
3725
|
+
O && /* @__PURE__ */ e("form", { onSubmit: S, style: { marginBottom: "16px", padding: "16px", background: "rgba(0,0,0,0.05)", borderRadius: "8px" }, children: /* @__PURE__ */ t("div", { style: { display: "flex", gap: "8px", alignItems: "flex-end" }, children: [
|
|
3700
3726
|
/* @__PURE__ */ t("div", { style: { flex: 1 }, children: [
|
|
3701
3727
|
/* @__PURE__ */ e("label", { className: "ss-auth-label", children: "Email" }),
|
|
3702
3728
|
/* @__PURE__ */ e(
|
|
@@ -3717,7 +3743,7 @@ function Ia() {
|
|
|
3717
3743
|
"select",
|
|
3718
3744
|
{
|
|
3719
3745
|
className: "ss-auth-input",
|
|
3720
|
-
value:
|
|
3746
|
+
value: w,
|
|
3721
3747
|
onChange: (z) => y(z.target.value),
|
|
3722
3748
|
style: { cursor: "pointer" },
|
|
3723
3749
|
children: [
|
|
@@ -3737,7 +3763,7 @@ function Ia() {
|
|
|
3737
3763
|
] }) }),
|
|
3738
3764
|
/* @__PURE__ */ e("tbody", { children: s.map((z) => /* @__PURE__ */ t("tr", { children: [
|
|
3739
3765
|
/* @__PURE__ */ e("td", { children: z.email }),
|
|
3740
|
-
/* @__PURE__ */ e("td", { children: /* @__PURE__ */ e("span", { className:
|
|
3766
|
+
/* @__PURE__ */ e("td", { children: /* @__PURE__ */ e("span", { className: T(z.role), children: z.role }) }),
|
|
3741
3767
|
/* @__PURE__ */ e("td", { children: z.role === "owner" ? /* @__PURE__ */ e("span", { style: { fontSize: "12px", opacity: 0.4 }, children: "—" }) : /* @__PURE__ */ t("div", { className: "ss-auth-settings-actions", children: [
|
|
3742
3768
|
/* @__PURE__ */ e(
|
|
3743
3769
|
"button",
|
|
@@ -3746,9 +3772,9 @@ function Ia() {
|
|
|
3746
3772
|
className: "ss-auth-icon-btn",
|
|
3747
3773
|
title: "Edit role",
|
|
3748
3774
|
onClick: () => {
|
|
3749
|
-
I(z),
|
|
3775
|
+
I(z), F(z.role);
|
|
3750
3776
|
},
|
|
3751
|
-
children: /* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
3777
|
+
children: /* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: v.edit })
|
|
3752
3778
|
}
|
|
3753
3779
|
),
|
|
3754
3780
|
/* @__PURE__ */ e(
|
|
@@ -3758,7 +3784,7 @@ function Ia() {
|
|
|
3758
3784
|
className: "ss-auth-icon-btn ss-auth-icon-btn-danger",
|
|
3759
3785
|
title: "Remove member",
|
|
3760
3786
|
onClick: () => x(z),
|
|
3761
|
-
children: /* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
3787
|
+
children: /* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: v.personRemove })
|
|
3762
3788
|
}
|
|
3763
3789
|
)
|
|
3764
3790
|
] }) })
|
|
@@ -3767,7 +3793,7 @@ function Ia() {
|
|
|
3767
3793
|
] }),
|
|
3768
3794
|
r.length > 0 && /* @__PURE__ */ t("div", { className: "ss-auth-settings-card", children: [
|
|
3769
3795
|
/* @__PURE__ */ t("h4", { children: [
|
|
3770
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
3796
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: v.send }),
|
|
3771
3797
|
"Pending Invites"
|
|
3772
3798
|
] }),
|
|
3773
3799
|
/* @__PURE__ */ t("table", { className: "ss-auth-settings-table", children: [
|
|
@@ -3778,15 +3804,15 @@ function Ia() {
|
|
|
3778
3804
|
] }) }),
|
|
3779
3805
|
/* @__PURE__ */ e("tbody", { children: r.map((z) => /* @__PURE__ */ t("tr", { children: [
|
|
3780
3806
|
/* @__PURE__ */ e("td", { children: z.email }),
|
|
3781
|
-
/* @__PURE__ */ e("td", { children: /* @__PURE__ */ e("span", { className:
|
|
3807
|
+
/* @__PURE__ */ e("td", { children: /* @__PURE__ */ e("span", { className: T(z.role), children: z.role }) }),
|
|
3782
3808
|
/* @__PURE__ */ e("td", { children: /* @__PURE__ */ e(
|
|
3783
3809
|
"button",
|
|
3784
3810
|
{
|
|
3785
3811
|
type: "button",
|
|
3786
3812
|
className: "ss-auth-icon-btn ss-auth-icon-btn-danger",
|
|
3787
3813
|
title: "Revoke invite",
|
|
3788
|
-
onClick: () =>
|
|
3789
|
-
children: /* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
3814
|
+
onClick: () => U(z.id),
|
|
3815
|
+
children: /* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: v.close })
|
|
3790
3816
|
}
|
|
3791
3817
|
) })
|
|
3792
3818
|
] }, z.id)) })
|
|
@@ -3797,7 +3823,7 @@ function Ia() {
|
|
|
3797
3823
|
}, children: /* @__PURE__ */ t("div", { className: "ss-auth-modal", style: { maxWidth: "400px" }, children: [
|
|
3798
3824
|
/* @__PURE__ */ t("div", { className: "ss-auth-modal-header", children: [
|
|
3799
3825
|
/* @__PURE__ */ e("h2", { children: "Edit Role" }),
|
|
3800
|
-
/* @__PURE__ */ e("button", { type: "button", className: "ss-auth-modal-close", onClick: () => I(null), children: /* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
3826
|
+
/* @__PURE__ */ e("button", { type: "button", className: "ss-auth-modal-close", onClick: () => I(null), children: /* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: v.close }) })
|
|
3801
3827
|
] }),
|
|
3802
3828
|
/* @__PURE__ */ t("div", { className: "ss-auth-modal-body", children: [
|
|
3803
3829
|
/* @__PURE__ */ t("p", { style: { fontSize: "14px", marginBottom: "16px", margin: "0 0 16px 0" }, children: [
|
|
@@ -3810,8 +3836,8 @@ function Ia() {
|
|
|
3810
3836
|
"select",
|
|
3811
3837
|
{
|
|
3812
3838
|
className: "ss-auth-input",
|
|
3813
|
-
value:
|
|
3814
|
-
onChange: (z) =>
|
|
3839
|
+
value: B,
|
|
3840
|
+
onChange: (z) => F(z.target.value),
|
|
3815
3841
|
style: { cursor: "pointer" },
|
|
3816
3842
|
children: [
|
|
3817
3843
|
/* @__PURE__ */ e("option", { value: "admin", children: "Admin" }),
|
|
@@ -3826,17 +3852,17 @@ function Ia() {
|
|
|
3826
3852
|
] })
|
|
3827
3853
|
] })
|
|
3828
3854
|
] }) }),
|
|
3829
|
-
|
|
3855
|
+
$ && /* @__PURE__ */ e("div", { className: "ss-auth-modal-overlay", onClick: (z) => {
|
|
3830
3856
|
z.target === z.currentTarget && x(null);
|
|
3831
3857
|
}, children: /* @__PURE__ */ t("div", { className: "ss-auth-modal", style: { maxWidth: "400px" }, children: [
|
|
3832
3858
|
/* @__PURE__ */ t("div", { className: "ss-auth-modal-header", children: [
|
|
3833
3859
|
/* @__PURE__ */ e("h2", { children: "Remove Member" }),
|
|
3834
|
-
/* @__PURE__ */ e("button", { type: "button", className: "ss-auth-modal-close", onClick: () => x(null), children: /* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
3860
|
+
/* @__PURE__ */ e("button", { type: "button", className: "ss-auth-modal-close", onClick: () => x(null), children: /* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: v.close }) })
|
|
3835
3861
|
] }),
|
|
3836
3862
|
/* @__PURE__ */ t("div", { className: "ss-auth-modal-body", children: [
|
|
3837
3863
|
/* @__PURE__ */ t("p", { style: { fontSize: "14px", margin: "0 0 16px 0" }, children: [
|
|
3838
3864
|
"Are you sure you want to remove ",
|
|
3839
|
-
/* @__PURE__ */ e("strong", { children:
|
|
3865
|
+
/* @__PURE__ */ e("strong", { children: $.email }),
|
|
3840
3866
|
" from the organization?"
|
|
3841
3867
|
] }),
|
|
3842
3868
|
/* @__PURE__ */ t("div", { style: { display: "flex", gap: "8px", justifyContent: "flex-end" }, children: [
|
|
@@ -3847,7 +3873,7 @@ function Ia() {
|
|
|
3847
3873
|
type: "button",
|
|
3848
3874
|
className: "ss-auth-btn-primary ss-auth-btn-sm",
|
|
3849
3875
|
style: { width: "auto", background: "linear-gradient(135deg, #ef4444, #dc2626)" },
|
|
3850
|
-
onClick:
|
|
3876
|
+
onClick: D,
|
|
3851
3877
|
children: "Remove"
|
|
3852
3878
|
}
|
|
3853
3879
|
)
|
|
@@ -3856,13 +3882,13 @@ function Ia() {
|
|
|
3856
3882
|
] }) })
|
|
3857
3883
|
] });
|
|
3858
3884
|
}
|
|
3859
|
-
function
|
|
3885
|
+
function Ba() {
|
|
3860
3886
|
const { selectedOrg: a } = Y();
|
|
3861
3887
|
return a ? /* @__PURE__ */ t(j, { children: [
|
|
3862
3888
|
/* @__PURE__ */ e("h3", { children: "Billing" }),
|
|
3863
3889
|
/* @__PURE__ */ t("div", { className: "ss-auth-settings-card", children: [
|
|
3864
3890
|
/* @__PURE__ */ t("h4", { children: [
|
|
3865
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
3891
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: v.creditCard }),
|
|
3866
3892
|
"Plan & Billing"
|
|
3867
3893
|
] }),
|
|
3868
3894
|
/* @__PURE__ */ e("div", { className: "ss-auth-settings-empty", style: { padding: "20px" }, children: /* @__PURE__ */ e("div", { children: "No billing plan configured for this organization." }) })
|
|
@@ -3870,7 +3896,7 @@ function Fa() {
|
|
|
3870
3896
|
] }) : /* @__PURE__ */ t(j, { children: [
|
|
3871
3897
|
/* @__PURE__ */ e("h3", { children: "Billing" }),
|
|
3872
3898
|
/* @__PURE__ */ t("div", { className: "ss-auth-settings-empty", children: [
|
|
3873
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
3899
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: v.creditCard }),
|
|
3874
3900
|
/* @__PURE__ */ e("div", { children: "Select an organization from the user menu to manage billing." })
|
|
3875
3901
|
] })
|
|
3876
3902
|
] });
|
|
@@ -3883,10 +3909,10 @@ function oe({
|
|
|
3883
3909
|
onOrgChange: n,
|
|
3884
3910
|
onOrgSettingsClick: u
|
|
3885
3911
|
}) {
|
|
3886
|
-
const { appearance: i } = A(), { user: l, signOut: d } = sa(), c = a ?? i, [f, p] = g(!1), [m, b] = g(!1), [
|
|
3912
|
+
const { appearance: i } = A(), { user: l, signOut: d } = sa(), c = a ?? i, [f, p] = g(!1), [m, b] = g(!1), [w, y] = g(""), [O, h] = g(null), [N, C] = g(!1), P = _(null), { orgs: I, selectedOrg: B, selectOrg: F, createOrg: $ } = Y(), x = k((E) => {
|
|
3887
3913
|
P.current && !E.composedPath().includes(P.current) && p(!1);
|
|
3888
3914
|
}, []);
|
|
3889
|
-
|
|
3915
|
+
V(() => {
|
|
3890
3916
|
if (f) {
|
|
3891
3917
|
const E = setTimeout(() => {
|
|
3892
3918
|
document.addEventListener("click", x);
|
|
@@ -3896,20 +3922,20 @@ function oe({
|
|
|
3896
3922
|
};
|
|
3897
3923
|
}
|
|
3898
3924
|
}, [f, x]);
|
|
3899
|
-
const
|
|
3925
|
+
const S = k(
|
|
3900
3926
|
async (E) => {
|
|
3901
|
-
E.preventDefault(), h(null),
|
|
3902
|
-
const
|
|
3927
|
+
E.preventDefault(), h(null), C(!0);
|
|
3928
|
+
const D = w.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "");
|
|
3903
3929
|
try {
|
|
3904
|
-
const
|
|
3905
|
-
|
|
3906
|
-
} catch (
|
|
3907
|
-
h(
|
|
3930
|
+
const U = await $(w, D);
|
|
3931
|
+
U && (await F(U.id), n == null || n(U), y(""), p(!1));
|
|
3932
|
+
} catch (U) {
|
|
3933
|
+
h(U instanceof Error ? U.message : "Failed to create organization");
|
|
3908
3934
|
} finally {
|
|
3909
|
-
|
|
3935
|
+
C(!1);
|
|
3910
3936
|
}
|
|
3911
3937
|
},
|
|
3912
|
-
[
|
|
3938
|
+
[w, $, F, n]
|
|
3913
3939
|
);
|
|
3914
3940
|
return l ? /* @__PURE__ */ e(H, { appearance: c, children: /* @__PURE__ */ t("div", { style: { position: "relative", display: "inline-block" }, ref: P, children: [
|
|
3915
3941
|
/* @__PURE__ */ t(
|
|
@@ -3929,7 +3955,7 @@ function oe({
|
|
|
3929
3955
|
fontSize: "16px",
|
|
3930
3956
|
fontWeight: 700
|
|
3931
3957
|
}, children: (l.name || l.email).charAt(0).toUpperCase() }) }),
|
|
3932
|
-
|
|
3958
|
+
B && /* @__PURE__ */ e("span", { className: "ss-auth-trigger-org-name", children: B.name })
|
|
3933
3959
|
]
|
|
3934
3960
|
}
|
|
3935
3961
|
),
|
|
@@ -3958,7 +3984,7 @@ function oe({
|
|
|
3958
3984
|
p(!1), b(!0);
|
|
3959
3985
|
},
|
|
3960
3986
|
children: [
|
|
3961
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
3987
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: v.settings }),
|
|
3962
3988
|
"Settings"
|
|
3963
3989
|
]
|
|
3964
3990
|
}
|
|
@@ -3966,22 +3992,22 @@ function oe({
|
|
|
3966
3992
|
o && /* @__PURE__ */ t(j, { children: [
|
|
3967
3993
|
/* @__PURE__ */ e("div", { className: "ss-auth-section-label", children: "Organizations" }),
|
|
3968
3994
|
/* @__PURE__ */ e("div", { style: { padding: "0 8px 4px" }, children: I.map((E) => {
|
|
3969
|
-
const
|
|
3995
|
+
const D = (B == null ? void 0 : B.id) === E.id, U = E.name.split(" ").map((T) => T[0]).join("").slice(0, 2).toUpperCase();
|
|
3970
3996
|
return /* @__PURE__ */ t(
|
|
3971
3997
|
"button",
|
|
3972
3998
|
{
|
|
3973
3999
|
type: "button",
|
|
3974
|
-
className: `ss-auth-org-item${
|
|
4000
|
+
className: `ss-auth-org-item${D ? " ss-auth-org-item-active" : ""}`,
|
|
3975
4001
|
onClick: async () => {
|
|
3976
|
-
p(!1), await
|
|
4002
|
+
p(!1), await F(E.id), n == null || n(E);
|
|
3977
4003
|
},
|
|
3978
4004
|
children: [
|
|
3979
4005
|
/* @__PURE__ */ t("div", { className: "ss-auth-org-item-inner", children: [
|
|
3980
|
-
/* @__PURE__ */ e("div", { className: `ss-auth-org-avatar${
|
|
4006
|
+
/* @__PURE__ */ e("div", { className: `ss-auth-org-avatar${D ? "" : " ss-auth-org-avatar-inactive"}`, children: U }),
|
|
3981
4007
|
/* @__PURE__ */ e("span", { style: { fontFamily: "'Manrope', sans-serif", letterSpacing: "-0.01em" }, children: E.name }),
|
|
3982
4008
|
E.planName && /* @__PURE__ */ e("span", { className: "ss-auth-plan-badge", children: E.planName })
|
|
3983
4009
|
] }),
|
|
3984
|
-
|
|
4010
|
+
D && /* @__PURE__ */ e("span", { className: "material-symbols-outlined ss-auth-org-check", style: { fontSize: "18px" }, children: v.checkCircle })
|
|
3985
4011
|
]
|
|
3986
4012
|
},
|
|
3987
4013
|
E.id
|
|
@@ -3989,14 +4015,14 @@ function oe({
|
|
|
3989
4015
|
}) }),
|
|
3990
4016
|
/* @__PURE__ */ t("div", { className: "ss-auth-inline-create", children: [
|
|
3991
4017
|
O && /* @__PURE__ */ e("div", { className: "ss-auth-error", style: { marginBottom: "8px", fontSize: "12px" }, children: /* @__PURE__ */ e("span", { children: O }) }),
|
|
3992
|
-
/* @__PURE__ */ e("form", { onSubmit:
|
|
4018
|
+
/* @__PURE__ */ e("form", { onSubmit: S, children: /* @__PURE__ */ t("div", { className: "ss-auth-inline-create-input", children: [
|
|
3993
4019
|
/* @__PURE__ */ e(
|
|
3994
4020
|
"input",
|
|
3995
4021
|
{
|
|
3996
4022
|
className: "ss-auth-input",
|
|
3997
4023
|
type: "text",
|
|
3998
4024
|
placeholder: "New organization name",
|
|
3999
|
-
value:
|
|
4025
|
+
value: w,
|
|
4000
4026
|
onChange: (E) => y(E.target.value),
|
|
4001
4027
|
required: !0,
|
|
4002
4028
|
style: { fontSize: "13px", padding: "10px 40px 10px 12px" }
|
|
@@ -4007,22 +4033,22 @@ function oe({
|
|
|
4007
4033
|
{
|
|
4008
4034
|
type: "submit",
|
|
4009
4035
|
className: "ss-auth-inline-create-btn",
|
|
4010
|
-
disabled:
|
|
4011
|
-
children: /* @__PURE__ */ e("span", { className: "material-symbols-outlined", style: { fontSize: "20px" }, children:
|
|
4036
|
+
disabled: N || !w.trim(),
|
|
4037
|
+
children: /* @__PURE__ */ e("span", { className: "material-symbols-outlined", style: { fontSize: "20px" }, children: v.add })
|
|
4012
4038
|
}
|
|
4013
4039
|
)
|
|
4014
4040
|
] }) })
|
|
4015
4041
|
] }),
|
|
4016
|
-
|
|
4042
|
+
B && u && /* @__PURE__ */ e("div", { style: { padding: "0 8px 4px" }, children: /* @__PURE__ */ t(
|
|
4017
4043
|
"button",
|
|
4018
4044
|
{
|
|
4019
4045
|
type: "button",
|
|
4020
4046
|
className: "ss-auth-dropdown-action",
|
|
4021
4047
|
onClick: () => {
|
|
4022
|
-
p(!1), u(
|
|
4048
|
+
p(!1), u(B);
|
|
4023
4049
|
},
|
|
4024
4050
|
children: [
|
|
4025
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
4051
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: v.corporateFare }),
|
|
4026
4052
|
"Org settings"
|
|
4027
4053
|
]
|
|
4028
4054
|
}
|
|
@@ -4038,7 +4064,7 @@ function oe({
|
|
|
4038
4064
|
},
|
|
4039
4065
|
style: { color: "inherit" },
|
|
4040
4066
|
children: [
|
|
4041
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", style: { color: "inherit" }, children:
|
|
4067
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", style: { color: "inherit" }, children: v.logout }),
|
|
4042
4068
|
"Sign out"
|
|
4043
4069
|
]
|
|
4044
4070
|
}
|
|
@@ -4054,36 +4080,36 @@ function oe({
|
|
|
4054
4080
|
] }) }) : null;
|
|
4055
4081
|
}
|
|
4056
4082
|
function ie({ appearance: a }) {
|
|
4057
|
-
const { appearance: s } = A(), { user: r, signOut: o } = sa(), { updateProfile: n, uploadAvatar: u, changePassword: i, isLoading: l, error: d, success: c, setError: f, setSuccess: p } = oa(), m = a ?? s, [b,
|
|
4083
|
+
const { appearance: s } = A(), { user: r, signOut: o } = sa(), { updateProfile: n, uploadAvatar: u, changePassword: i, isLoading: l, error: d, success: c, setError: f, setSuccess: p } = oa(), m = a ?? s, [b, w] = g((r == null ? void 0 : r.name) ?? ""), [y, O] = g((r == null ? void 0 : r.avatarUrl) ?? ""), [h, N] = g(!1), [C, P] = g(""), [I, B] = g(""), [F, $] = g(""), [x, S] = g(null), E = k(
|
|
4058
4084
|
async (L) => {
|
|
4059
4085
|
L.preventDefault(), f(null), p(null), await n({ name: b, avatarUrl: y || void 0 });
|
|
4060
4086
|
},
|
|
4061
4087
|
[b, y, n, f, p]
|
|
4062
|
-
),
|
|
4088
|
+
), D = k(
|
|
4063
4089
|
async (L) => {
|
|
4064
4090
|
const W = await u(L);
|
|
4065
|
-
W && (O(W.avatarUrl),
|
|
4091
|
+
W && (O(W.avatarUrl), N(!1));
|
|
4066
4092
|
},
|
|
4067
4093
|
[u]
|
|
4068
|
-
),
|
|
4094
|
+
), U = k(
|
|
4069
4095
|
async (L) => {
|
|
4070
|
-
if (L.preventDefault(),
|
|
4071
|
-
|
|
4096
|
+
if (L.preventDefault(), S(null), f(null), p(null), I !== F) {
|
|
4097
|
+
S("Passwords do not match");
|
|
4072
4098
|
return;
|
|
4073
4099
|
}
|
|
4074
4100
|
if (I.length < 8) {
|
|
4075
|
-
|
|
4101
|
+
S("Password must be at least 8 characters");
|
|
4076
4102
|
return;
|
|
4077
4103
|
}
|
|
4078
|
-
await i(
|
|
4104
|
+
await i(C, I) && (P(""), B(""), $(""));
|
|
4079
4105
|
},
|
|
4080
|
-
[
|
|
4106
|
+
[C, I, F, i, f, p]
|
|
4081
4107
|
);
|
|
4082
4108
|
if (!r) return null;
|
|
4083
|
-
const
|
|
4109
|
+
const T = r.provider === "email", z = (r.name || r.email).charAt(0).toUpperCase();
|
|
4084
4110
|
return /* @__PURE__ */ e(H, { appearance: m, children: /* @__PURE__ */ t("div", { className: "ss-auth-card", style: { maxWidth: "640px" }, children: [
|
|
4085
4111
|
/* @__PURE__ */ t("div", { className: "ss-auth-profile-header", children: [
|
|
4086
|
-
/* @__PURE__ */ t("div", { className: "ss-auth-avatar-lg", onClick: () =>
|
|
4112
|
+
/* @__PURE__ */ t("div", { className: "ss-auth-avatar-lg", onClick: () => N(!0), children: [
|
|
4087
4113
|
y ? /* @__PURE__ */ e("img", { src: y, alt: "" }) : /* @__PURE__ */ e("div", { style: {
|
|
4088
4114
|
width: "100%",
|
|
4089
4115
|
height: "100%",
|
|
@@ -4095,7 +4121,7 @@ function ie({ appearance: a }) {
|
|
|
4095
4121
|
opacity: 0.4
|
|
4096
4122
|
}, children: z }),
|
|
4097
4123
|
/* @__PURE__ */ t("div", { className: "ss-auth-avatar-overlay", children: [
|
|
4098
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
4124
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: v.camera }),
|
|
4099
4125
|
/* @__PURE__ */ e("span", { children: "Edit" })
|
|
4100
4126
|
] })
|
|
4101
4127
|
] }),
|
|
@@ -4103,7 +4129,7 @@ function ie({ appearance: a }) {
|
|
|
4103
4129
|
/* @__PURE__ */ t("h2", { className: "ss-auth-profile-name", children: [
|
|
4104
4130
|
r.name || "Unnamed User",
|
|
4105
4131
|
r.emailVerified && /* @__PURE__ */ t("span", { className: "ss-auth-badge ss-auth-badge-success", children: [
|
|
4106
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", style: { fontSize: "12px", fontVariationSettings: "'FILL' 1" }, children:
|
|
4132
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", style: { fontSize: "12px", fontVariationSettings: "'FILL' 1" }, children: v.verified }),
|
|
4107
4133
|
"Verified"
|
|
4108
4134
|
] })
|
|
4109
4135
|
] }),
|
|
@@ -4112,11 +4138,11 @@ function ie({ appearance: a }) {
|
|
|
4112
4138
|
] }),
|
|
4113
4139
|
/* @__PURE__ */ t("div", { className: "ss-auth-card-body", children: [
|
|
4114
4140
|
d && /* @__PURE__ */ t("div", { className: "ss-auth-error", children: [
|
|
4115
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
4141
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: v.errorOutline }),
|
|
4116
4142
|
/* @__PURE__ */ e("span", { children: d })
|
|
4117
4143
|
] }),
|
|
4118
4144
|
c && /* @__PURE__ */ t("div", { className: "ss-auth-info-box", style: { marginBottom: "16px" }, children: [
|
|
4119
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
4145
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: v.check }),
|
|
4120
4146
|
/* @__PURE__ */ e("span", { children: c })
|
|
4121
4147
|
] }),
|
|
4122
4148
|
/* @__PURE__ */ t("form", { onSubmit: E, children: [
|
|
@@ -4129,7 +4155,7 @@ function ie({ appearance: a }) {
|
|
|
4129
4155
|
type: "text",
|
|
4130
4156
|
placeholder: "Your name",
|
|
4131
4157
|
value: b,
|
|
4132
|
-
onChange: (L) =>
|
|
4158
|
+
onChange: (L) => w(L.target.value)
|
|
4133
4159
|
}
|
|
4134
4160
|
)
|
|
4135
4161
|
] }),
|
|
@@ -4138,14 +4164,14 @@ function ie({ appearance: a }) {
|
|
|
4138
4164
|
/* @__PURE__ */ e("label", { className: "ss-auth-label", children: "Email Address" }),
|
|
4139
4165
|
/* @__PURE__ */ t("div", { style: { position: "relative" }, children: [
|
|
4140
4166
|
/* @__PURE__ */ e("input", { className: "ss-auth-input ss-auth-input-readonly", type: "email", value: r.email, readOnly: !0 }),
|
|
4141
|
-
/* @__PURE__ */ e("span", { className: "ss-auth-visibility-toggle", style: { cursor: "default" }, children: /* @__PURE__ */ e("span", { className: "material-symbols-outlined", style: { fontSize: "18px" }, children:
|
|
4167
|
+
/* @__PURE__ */ e("span", { className: "ss-auth-visibility-toggle", style: { cursor: "default" }, children: /* @__PURE__ */ e("span", { className: "material-symbols-outlined", style: { fontSize: "18px" }, children: v.lock }) })
|
|
4142
4168
|
] })
|
|
4143
4169
|
] }),
|
|
4144
4170
|
/* @__PURE__ */ t("div", { children: [
|
|
4145
4171
|
/* @__PURE__ */ e("label", { className: "ss-auth-label", children: "Auth Provider" }),
|
|
4146
4172
|
/* @__PURE__ */ t("div", { style: { position: "relative" }, children: [
|
|
4147
4173
|
/* @__PURE__ */ e("input", { className: "ss-auth-input ss-auth-input-readonly", type: "text", value: r.provider, readOnly: !0 }),
|
|
4148
|
-
/* @__PURE__ */ e("span", { className: "ss-auth-visibility-toggle", style: { cursor: "default" }, children: /* @__PURE__ */ e("span", { className: "material-symbols-outlined", style: { fontSize: "18px" }, children:
|
|
4174
|
+
/* @__PURE__ */ e("span", { className: "ss-auth-visibility-toggle", style: { cursor: "default" }, children: /* @__PURE__ */ e("span", { className: "material-symbols-outlined", style: { fontSize: "18px" }, children: v.cloudDone }) })
|
|
4149
4175
|
] })
|
|
4150
4176
|
] })
|
|
4151
4177
|
] }),
|
|
@@ -4154,17 +4180,17 @@ function ie({ appearance: a }) {
|
|
|
4154
4180
|
"Save changes"
|
|
4155
4181
|
] }) })
|
|
4156
4182
|
] }),
|
|
4157
|
-
|
|
4183
|
+
T && /* @__PURE__ */ t("div", { className: "ss-auth-section", children: [
|
|
4158
4184
|
/* @__PURE__ */ t("div", { className: "ss-auth-section-title", children: [
|
|
4159
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
4185
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: v.security }),
|
|
4160
4186
|
"Security Credentials"
|
|
4161
4187
|
] }),
|
|
4162
4188
|
/* @__PURE__ */ e("p", { className: "ss-auth-section-desc", style: { marginBottom: "24px" }, children: "Update your password to keep your account secure." }),
|
|
4163
4189
|
x && /* @__PURE__ */ t("div", { className: "ss-auth-error", children: [
|
|
4164
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
4190
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: v.errorOutline }),
|
|
4165
4191
|
/* @__PURE__ */ e("span", { children: x })
|
|
4166
4192
|
] }),
|
|
4167
|
-
/* @__PURE__ */ t("form", { onSubmit:
|
|
4193
|
+
/* @__PURE__ */ t("form", { onSubmit: U, children: [
|
|
4168
4194
|
/* @__PURE__ */ t("div", { className: "ss-auth-field", children: [
|
|
4169
4195
|
/* @__PURE__ */ e("label", { className: "ss-auth-label", children: "Current Password" }),
|
|
4170
4196
|
/* @__PURE__ */ e(
|
|
@@ -4173,7 +4199,7 @@ function ie({ appearance: a }) {
|
|
|
4173
4199
|
className: "ss-auth-input",
|
|
4174
4200
|
type: "password",
|
|
4175
4201
|
placeholder: "••••••••••••",
|
|
4176
|
-
value:
|
|
4202
|
+
value: C,
|
|
4177
4203
|
onChange: (L) => P(L.target.value),
|
|
4178
4204
|
required: !0
|
|
4179
4205
|
}
|
|
@@ -4189,7 +4215,7 @@ function ie({ appearance: a }) {
|
|
|
4189
4215
|
type: "password",
|
|
4190
4216
|
placeholder: "Min. 8 characters",
|
|
4191
4217
|
value: I,
|
|
4192
|
-
onChange: (L) =>
|
|
4218
|
+
onChange: (L) => B(L.target.value),
|
|
4193
4219
|
required: !0
|
|
4194
4220
|
}
|
|
4195
4221
|
)
|
|
@@ -4202,15 +4228,15 @@ function ie({ appearance: a }) {
|
|
|
4202
4228
|
className: "ss-auth-input",
|
|
4203
4229
|
type: "password",
|
|
4204
4230
|
placeholder: "Repeat new password",
|
|
4205
|
-
value:
|
|
4206
|
-
onChange: (L) =>
|
|
4231
|
+
value: F,
|
|
4232
|
+
onChange: (L) => $(L.target.value),
|
|
4207
4233
|
required: !0
|
|
4208
4234
|
}
|
|
4209
4235
|
)
|
|
4210
4236
|
] })
|
|
4211
4237
|
] }),
|
|
4212
4238
|
/* @__PURE__ */ t("div", { className: "ss-auth-info-box", style: { marginBottom: "16px" }, children: [
|
|
4213
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
4239
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: v.info }),
|
|
4214
4240
|
/* @__PURE__ */ e("span", { children: "Password must be at least 8 characters long." })
|
|
4215
4241
|
] }),
|
|
4216
4242
|
/* @__PURE__ */ e("div", { style: { display: "flex", justifyContent: "flex-end" }, children: /* @__PURE__ */ e("button", { type: "submit", className: "ss-auth-btn-ghost", disabled: l, children: "Update Security" }) })
|
|
@@ -4218,7 +4244,7 @@ function ie({ appearance: a }) {
|
|
|
4218
4244
|
] }),
|
|
4219
4245
|
/* @__PURE__ */ e("div", { className: "ss-auth-section", style: { borderTop: "none", paddingTop: 0, marginTop: "24px" }, children: /* @__PURE__ */ e("div", { className: "ss-auth-signout-section", style: { borderRadius: "12px", padding: "16px 20px" }, children: /* @__PURE__ */ t("div", { className: "ss-auth-signout-row", children: [
|
|
4220
4246
|
/* @__PURE__ */ t("div", { className: "ss-auth-signout-info", children: [
|
|
4221
|
-
/* @__PURE__ */ e("div", { className: "ss-auth-signout-icon", children: /* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
4247
|
+
/* @__PURE__ */ e("div", { className: "ss-auth-signout-icon", children: /* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: v.logout }) }),
|
|
4222
4248
|
/* @__PURE__ */ t("div", { children: [
|
|
4223
4249
|
/* @__PURE__ */ e("div", { className: "ss-auth-signout-title", children: "End Session" }),
|
|
4224
4250
|
/* @__PURE__ */ e("div", { className: "ss-auth-signout-desc", children: "Terminate your active session" })
|
|
@@ -4239,18 +4265,18 @@ function ie({ appearance: a }) {
|
|
|
4239
4265
|
h && /* @__PURE__ */ e(
|
|
4240
4266
|
ca,
|
|
4241
4267
|
{
|
|
4242
|
-
onUpload:
|
|
4243
|
-
onClose: () =>
|
|
4268
|
+
onUpload: D,
|
|
4269
|
+
onClose: () => N(!1),
|
|
4244
4270
|
isLoading: l
|
|
4245
4271
|
}
|
|
4246
4272
|
)
|
|
4247
4273
|
] }) });
|
|
4248
4274
|
}
|
|
4249
4275
|
function le({ appearance: a, onOrgChange: s }) {
|
|
4250
|
-
const { appearance: r } = A(), { orgs: o, selectedOrg: n, selectOrg: u, createOrg: i, isLoading: l } = Y(), d = a ?? r, [c, f] = g(!1), [p, m] = g(""), [b,
|
|
4251
|
-
|
|
4276
|
+
const { appearance: r } = A(), { orgs: o, selectedOrg: n, selectOrg: u, createOrg: i, isLoading: l } = Y(), d = a ?? r, [c, f] = g(!1), [p, m] = g(""), [b, w] = g(""), [y, O] = g(null), [h, N] = g(!1), C = _(null), P = k((x) => {
|
|
4277
|
+
C.current && !x.composedPath().includes(C.current) && f(!1);
|
|
4252
4278
|
}, []);
|
|
4253
|
-
|
|
4279
|
+
V(() => {
|
|
4254
4280
|
if (c) {
|
|
4255
4281
|
const x = setTimeout(() => {
|
|
4256
4282
|
document.addEventListener("click", P);
|
|
@@ -4260,25 +4286,25 @@ function le({ appearance: a, onOrgChange: s }) {
|
|
|
4260
4286
|
};
|
|
4261
4287
|
}
|
|
4262
4288
|
}, [c, P]);
|
|
4263
|
-
const I =
|
|
4264
|
-
m(x),
|
|
4265
|
-
}, []),
|
|
4289
|
+
const I = k((x) => {
|
|
4290
|
+
m(x), w(x.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, ""));
|
|
4291
|
+
}, []), B = k(
|
|
4266
4292
|
async (x) => {
|
|
4267
|
-
x.preventDefault(), O(null),
|
|
4293
|
+
x.preventDefault(), O(null), N(!0);
|
|
4268
4294
|
try {
|
|
4269
|
-
const
|
|
4270
|
-
|
|
4271
|
-
} catch (
|
|
4272
|
-
O(
|
|
4295
|
+
const S = await i(p, b);
|
|
4296
|
+
S && (await u(S.id), s == null || s(S), m(""), w(""), f(!1));
|
|
4297
|
+
} catch (S) {
|
|
4298
|
+
O(S instanceof Error ? S.message : "Failed to create organization");
|
|
4273
4299
|
} finally {
|
|
4274
|
-
|
|
4300
|
+
N(!1);
|
|
4275
4301
|
}
|
|
4276
4302
|
},
|
|
4277
4303
|
[p, b, i, u, s]
|
|
4278
4304
|
);
|
|
4279
4305
|
if (l) return null;
|
|
4280
|
-
const
|
|
4281
|
-
return /* @__PURE__ */ e(H, { appearance: d, children: /* @__PURE__ */ t("div", { style: { position: "relative", display: "inline-block", width: "100%", maxWidth: "360px" }, ref:
|
|
4306
|
+
const F = (n == null ? void 0 : n.name) ?? (o.length === 0 ? "No organization" : "Select organization"), $ = n ? n.name.split(" ").map((x) => x[0]).join("").slice(0, 2).toUpperCase() : "--";
|
|
4307
|
+
return /* @__PURE__ */ e(H, { appearance: d, children: /* @__PURE__ */ t("div", { style: { position: "relative", display: "inline-block", width: "100%", maxWidth: "360px" }, ref: C, children: [
|
|
4282
4308
|
/* @__PURE__ */ t(
|
|
4283
4309
|
"button",
|
|
4284
4310
|
{
|
|
@@ -4287,34 +4313,34 @@ function le({ appearance: a, onOrgChange: s }) {
|
|
|
4287
4313
|
onClick: () => f(!c),
|
|
4288
4314
|
children: [
|
|
4289
4315
|
/* @__PURE__ */ t("div", { className: "ss-auth-org-trigger-inner", children: [
|
|
4290
|
-
/* @__PURE__ */ e("div", { className: "ss-auth-org-avatar", children:
|
|
4316
|
+
/* @__PURE__ */ e("div", { className: "ss-auth-org-avatar", children: $ }),
|
|
4291
4317
|
/* @__PURE__ */ t("div", { style: { textAlign: "left" }, children: [
|
|
4292
4318
|
/* @__PURE__ */ e("div", { className: "ss-auth-org-trigger-label", children: "Current Organization" }),
|
|
4293
|
-
/* @__PURE__ */ e("div", { className: "ss-auth-org-trigger-name", children:
|
|
4319
|
+
/* @__PURE__ */ e("div", { className: "ss-auth-org-trigger-name", children: F })
|
|
4294
4320
|
] })
|
|
4295
4321
|
] }),
|
|
4296
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
4322
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: v.unfoldMore })
|
|
4297
4323
|
]
|
|
4298
4324
|
}
|
|
4299
4325
|
),
|
|
4300
4326
|
c && /* @__PURE__ */ t("div", { className: "ss-auth-dropdown ss-auth-dropdown-left ss-auth-glass-panel", style: { width: "100%" }, children: [
|
|
4301
4327
|
/* @__PURE__ */ e("div", { className: "ss-auth-section-label", children: "Your Organizations" }),
|
|
4302
4328
|
/* @__PURE__ */ e("div", { style: { padding: "0 8px 4px" }, children: o.map((x) => {
|
|
4303
|
-
const
|
|
4329
|
+
const S = (n == null ? void 0 : n.id) === x.id, E = x.name.split(" ").map((D) => D[0]).join("").slice(0, 2).toUpperCase();
|
|
4304
4330
|
return /* @__PURE__ */ t(
|
|
4305
4331
|
"button",
|
|
4306
4332
|
{
|
|
4307
4333
|
type: "button",
|
|
4308
|
-
className: `ss-auth-org-item${
|
|
4334
|
+
className: `ss-auth-org-item${S ? " ss-auth-org-item-active" : ""}`,
|
|
4309
4335
|
onClick: async () => {
|
|
4310
4336
|
f(!1), await u(x.id), s == null || s(x);
|
|
4311
4337
|
},
|
|
4312
4338
|
children: [
|
|
4313
4339
|
/* @__PURE__ */ t("div", { className: "ss-auth-org-item-inner", children: [
|
|
4314
|
-
/* @__PURE__ */ e("div", { className: `ss-auth-org-avatar${
|
|
4340
|
+
/* @__PURE__ */ e("div", { className: `ss-auth-org-avatar${S ? "" : " ss-auth-org-avatar-inactive"}`, children: E }),
|
|
4315
4341
|
/* @__PURE__ */ e("span", { style: { fontFamily: "'Manrope', sans-serif", letterSpacing: "-0.01em" }, children: x.name })
|
|
4316
4342
|
] }),
|
|
4317
|
-
|
|
4343
|
+
S && /* @__PURE__ */ e("span", { className: "material-symbols-outlined ss-auth-org-check", style: { fontSize: "18px" }, children: v.checkCircle })
|
|
4318
4344
|
]
|
|
4319
4345
|
},
|
|
4320
4346
|
x.id
|
|
@@ -4322,11 +4348,11 @@ function le({ appearance: a, onOrgChange: s }) {
|
|
|
4322
4348
|
}) }),
|
|
4323
4349
|
/* @__PURE__ */ t("div", { className: "ss-auth-org-create", children: [
|
|
4324
4350
|
/* @__PURE__ */ t("div", { className: "ss-auth-org-create-header", children: [
|
|
4325
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
4351
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: v.addCircle }),
|
|
4326
4352
|
/* @__PURE__ */ e("span", { children: "Create organization" })
|
|
4327
4353
|
] }),
|
|
4328
4354
|
y && /* @__PURE__ */ e("div", { className: "ss-auth-error", style: { marginBottom: "12px", fontSize: "12px" }, children: /* @__PURE__ */ e("span", { children: y }) }),
|
|
4329
|
-
/* @__PURE__ */ t("form", { onSubmit:
|
|
4355
|
+
/* @__PURE__ */ t("form", { onSubmit: B, children: [
|
|
4330
4356
|
/* @__PURE__ */ t("div", { className: "ss-auth-field", children: [
|
|
4331
4357
|
/* @__PURE__ */ e("label", { className: "ss-auth-label", style: { fontSize: "10px" }, children: "Org Name" }),
|
|
4332
4358
|
/* @__PURE__ */ e(
|
|
@@ -4353,7 +4379,7 @@ function le({ appearance: a, onOrgChange: s }) {
|
|
|
4353
4379
|
type: "text",
|
|
4354
4380
|
placeholder: "nexus-dynamics",
|
|
4355
4381
|
value: b,
|
|
4356
|
-
onChange: (x) =>
|
|
4382
|
+
onChange: (x) => w(x.target.value),
|
|
4357
4383
|
required: !0,
|
|
4358
4384
|
style: { fontSize: "13px", padding: "10px 12px 10px 22px" }
|
|
4359
4385
|
}
|
|
@@ -4378,7 +4404,7 @@ function le({ appearance: a, onOrgChange: s }) {
|
|
|
4378
4404
|
] })
|
|
4379
4405
|
] }) });
|
|
4380
4406
|
}
|
|
4381
|
-
function
|
|
4407
|
+
function Fa(a, s = "USD") {
|
|
4382
4408
|
return new Intl.NumberFormat("en-US", {
|
|
4383
4409
|
style: "currency",
|
|
4384
4410
|
currency: s,
|
|
@@ -4399,7 +4425,7 @@ function ce({ plans: a, currentPlanId: s, onSelectPlan: r, interval: o, appearan
|
|
|
4399
4425
|
d.isFree && /* @__PURE__ */ e("span", { className: "ss-badge ss-badge-active", children: "Free" })
|
|
4400
4426
|
] }),
|
|
4401
4427
|
/* @__PURE__ */ e("div", { className: "ss-pricing-price", children: d.isFree ? /* @__PURE__ */ e("span", { className: "ss-pricing-amount", children: "Free" }) : /* @__PURE__ */ t(j, { children: [
|
|
4402
|
-
/* @__PURE__ */ e("span", { className: "ss-pricing-amount", children:
|
|
4428
|
+
/* @__PURE__ */ e("span", { className: "ss-pricing-amount", children: Fa(d.amountCents, d.currency) }),
|
|
4403
4429
|
/* @__PURE__ */ t("span", { className: "ss-pricing-interval", children: [
|
|
4404
4430
|
"/",
|
|
4405
4431
|
d.interval
|
|
@@ -4439,7 +4465,7 @@ function Z(a) {
|
|
|
4439
4465
|
}, [s, a]);
|
|
4440
4466
|
}
|
|
4441
4467
|
function La(a, s) {
|
|
4442
|
-
const r = Z(s), [o, n] = g(null), [u, i] = g(!0), [l, d] = g(null), c =
|
|
4468
|
+
const r = Z(s), [o, n] = g(null), [u, i] = g(!0), [l, d] = g(null), c = k(async () => {
|
|
4443
4469
|
i(!0), d(null);
|
|
4444
4470
|
try {
|
|
4445
4471
|
const f = await r.getCustomer(a);
|
|
@@ -4450,12 +4476,12 @@ function La(a, s) {
|
|
|
4450
4476
|
i(!1);
|
|
4451
4477
|
}
|
|
4452
4478
|
}, [r, a]);
|
|
4453
|
-
return
|
|
4479
|
+
return V(() => {
|
|
4454
4480
|
c();
|
|
4455
4481
|
}, [c]), { customer: o, isLoading: u, error: l, refresh: c };
|
|
4456
4482
|
}
|
|
4457
4483
|
function Aa(a, s) {
|
|
4458
|
-
const r = Z(s), [o, n] = g([]), [u, i] = g(!0), [l, d] = g(null), c =
|
|
4484
|
+
const r = Z(s), [o, n] = g([]), [u, i] = g(!0), [l, d] = g(null), c = k(async () => {
|
|
4459
4485
|
i(!0), d(null);
|
|
4460
4486
|
try {
|
|
4461
4487
|
const f = await r.getInvoices(a);
|
|
@@ -4466,12 +4492,12 @@ function Aa(a, s) {
|
|
|
4466
4492
|
i(!1);
|
|
4467
4493
|
}
|
|
4468
4494
|
}, [r, a]);
|
|
4469
|
-
return
|
|
4495
|
+
return V(() => {
|
|
4470
4496
|
c();
|
|
4471
4497
|
}, [c]), { invoices: o, isLoading: u, error: l, refresh: c };
|
|
4472
4498
|
}
|
|
4473
4499
|
function Da(a, s) {
|
|
4474
|
-
const r = Z(s), [o, n] = g([]), [u, i] = g(!0), [l, d] = g(null), c =
|
|
4500
|
+
const r = Z(s), [o, n] = g([]), [u, i] = g(!0), [l, d] = g(null), c = k(async () => {
|
|
4475
4501
|
i(!0), d(null);
|
|
4476
4502
|
try {
|
|
4477
4503
|
const f = await r.getCurrentUsage(a);
|
|
@@ -4482,7 +4508,7 @@ function Da(a, s) {
|
|
|
4482
4508
|
i(!1);
|
|
4483
4509
|
}
|
|
4484
4510
|
}, [r, a]);
|
|
4485
|
-
return
|
|
4511
|
+
return V(() => {
|
|
4486
4512
|
c();
|
|
4487
4513
|
}, [c]), { usage: o, isLoading: u, error: l, refresh: c };
|
|
4488
4514
|
}
|
|
@@ -4520,14 +4546,14 @@ function Ma({
|
|
|
4520
4546
|
] })
|
|
4521
4547
|
] }) });
|
|
4522
4548
|
}
|
|
4523
|
-
const
|
|
4549
|
+
const Va = {
|
|
4524
4550
|
paid: "ss-badge-active",
|
|
4525
4551
|
open: "ss-badge-trialing",
|
|
4526
4552
|
draft: "ss-badge-paused",
|
|
4527
4553
|
void: "ss-badge-canceled",
|
|
4528
4554
|
uncollectible: "ss-badge-past-due"
|
|
4529
4555
|
};
|
|
4530
|
-
function
|
|
4556
|
+
function Ua(a) {
|
|
4531
4557
|
return new Date(a).toLocaleDateString("en-US", { year: "numeric", month: "short", day: "numeric" });
|
|
4532
4558
|
}
|
|
4533
4559
|
function Ra(a) {
|
|
@@ -4551,9 +4577,9 @@ function Ha({ customerId: a, portalToken: s, appearance: r }) {
|
|
|
4551
4577
|
/* @__PURE__ */ e("th", { className: "ss-th", children: "PDF" })
|
|
4552
4578
|
] }) }),
|
|
4553
4579
|
/* @__PURE__ */ e("tbody", { children: d.map((c) => /* @__PURE__ */ t("tr", { className: "ss-tr", children: [
|
|
4554
|
-
/* @__PURE__ */ e("td", { className: "ss-td", children:
|
|
4580
|
+
/* @__PURE__ */ e("td", { className: "ss-td", children: Ua(c.createdAt) }),
|
|
4555
4581
|
/* @__PURE__ */ e("td", { className: "ss-td", children: Ra(c.amountCents) }),
|
|
4556
|
-
/* @__PURE__ */ e("td", { className: "ss-td", children: /* @__PURE__ */ e("span", { className: `ss-badge ${
|
|
4582
|
+
/* @__PURE__ */ e("td", { className: "ss-td", children: /* @__PURE__ */ e("span", { className: `ss-badge ${Va[c.status] || ""}`, children: c.status }) }),
|
|
4557
4583
|
/* @__PURE__ */ e("td", { className: "ss-td", children: c.pdfUrl ? /* @__PURE__ */ e("a", { className: "ss-link", href: c.pdfUrl, target: "_blank", rel: "noopener noreferrer", children: "Download" }) : "—" })
|
|
4558
4584
|
] }, c.id)) })
|
|
4559
4585
|
] })
|
|
@@ -4631,12 +4657,12 @@ function ue({
|
|
|
4631
4657
|
] }) });
|
|
4632
4658
|
}
|
|
4633
4659
|
function pe({ customerId: a, portalToken: s, onApplied: r, appearance: o }) {
|
|
4634
|
-
const { appearance: n } = A(), u = Z(s), i = o ?? n, [l, d] = g(""), [c, f] = g(!1), [p, m] = g(null), [b,
|
|
4660
|
+
const { appearance: n } = A(), u = Z(s), i = o ?? n, [l, d] = g(""), [c, f] = g(!1), [p, m] = g(null), [b, w] = g(null), y = k(async (O) => {
|
|
4635
4661
|
if (O.preventDefault(), !!l.trim()) {
|
|
4636
|
-
f(!0), m(null),
|
|
4662
|
+
f(!0), m(null), w(null);
|
|
4637
4663
|
try {
|
|
4638
4664
|
const h = await u.applyCoupon(a, l.trim());
|
|
4639
|
-
|
|
4665
|
+
w(`Coupon applied! ${h.discountType === "percent" ? `${h.amount}% off` : `$${(h.amount / 100).toFixed(2)} off`}`), d(""), r == null || r(h);
|
|
4640
4666
|
} catch (h) {
|
|
4641
4667
|
m(h instanceof Error ? h.message : "Invalid coupon code");
|
|
4642
4668
|
} finally {
|
|
@@ -4676,7 +4702,7 @@ function he() {
|
|
|
4676
4702
|
return { report: a.report };
|
|
4677
4703
|
}
|
|
4678
4704
|
function da() {
|
|
4679
|
-
const { client: a } = A(), [s, r] = g(null), [o, n] = g(!1), [u, i] = g(null), l =
|
|
4705
|
+
const { client: a } = A(), [s, r] = g(null), [o, n] = g(!1), [u, i] = g(null), l = k(async (d) => {
|
|
4680
4706
|
n(!0), i(null);
|
|
4681
4707
|
try {
|
|
4682
4708
|
const c = await a.report.executeQuery(d);
|
|
@@ -4690,7 +4716,7 @@ function da() {
|
|
|
4690
4716
|
return { result: s, execute: l, isLoading: o, error: u };
|
|
4691
4717
|
}
|
|
4692
4718
|
function qa(a) {
|
|
4693
|
-
const { client: s } = A(), [r, o] = g(null), [n, u] = g(!0), [i, l] = g(null), d =
|
|
4719
|
+
const { client: s } = A(), [r, o] = g(null), [n, u] = g(!0), [i, l] = g(null), d = k(async () => {
|
|
4694
4720
|
u(!0), l(null);
|
|
4695
4721
|
try {
|
|
4696
4722
|
const c = await s.report.listQueries(a);
|
|
@@ -4701,12 +4727,12 @@ function qa(a) {
|
|
|
4701
4727
|
u(!1);
|
|
4702
4728
|
}
|
|
4703
4729
|
}, [s, a]);
|
|
4704
|
-
return
|
|
4730
|
+
return V(() => {
|
|
4705
4731
|
d();
|
|
4706
4732
|
}, [d]), { queries: (r == null ? void 0 : r.data) ?? [], meta: r == null ? void 0 : r.meta, isLoading: n, error: i, refresh: d };
|
|
4707
4733
|
}
|
|
4708
4734
|
function ge(a) {
|
|
4709
|
-
const { client: s } = A(), [r, o] = g(null), [n, u] = g(!0), [i, l] = g(null), d =
|
|
4735
|
+
const { client: s } = A(), [r, o] = g(null), [n, u] = g(!0), [i, l] = g(null), d = k(async () => {
|
|
4710
4736
|
u(!0), l(null);
|
|
4711
4737
|
try {
|
|
4712
4738
|
const c = await s.report.getDashboard(a);
|
|
@@ -4717,7 +4743,7 @@ function ge(a) {
|
|
|
4717
4743
|
u(!1);
|
|
4718
4744
|
}
|
|
4719
4745
|
}, [s, a]);
|
|
4720
|
-
return
|
|
4746
|
+
return V(() => {
|
|
4721
4747
|
d();
|
|
4722
4748
|
}, [d]), { dashboard: r, isLoading: n, error: i, refresh: d };
|
|
4723
4749
|
}
|
|
@@ -4725,7 +4751,7 @@ function me(a, s, r = "https://api.saas-support.com/v1") {
|
|
|
4725
4751
|
const o = G(() => {
|
|
4726
4752
|
const p = new Q(r, { type: "embedToken", token: a });
|
|
4727
4753
|
return new ta(p);
|
|
4728
|
-
}, [a, r]), [n, u] = g(null), [i, l] = g(!0), [d, c] = g(null), f =
|
|
4754
|
+
}, [a, r]), [n, u] = g(null), [i, l] = g(!0), [d, c] = g(null), f = k(async () => {
|
|
4729
4755
|
l(!0), c(null);
|
|
4730
4756
|
try {
|
|
4731
4757
|
const p = await o.getDashboard(s);
|
|
@@ -4736,13 +4762,13 @@ function me(a, s, r = "https://api.saas-support.com/v1") {
|
|
|
4736
4762
|
l(!1);
|
|
4737
4763
|
}
|
|
4738
4764
|
}, [o, s]);
|
|
4739
|
-
return
|
|
4765
|
+
return V(() => {
|
|
4740
4766
|
f();
|
|
4741
4767
|
}, [f]), { dashboard: n, reportClient: o, isLoading: i, error: d, refresh: f };
|
|
4742
4768
|
}
|
|
4743
4769
|
function fe({ onResult: a, mode: s = "both", placeholder: r, appearance: o }) {
|
|
4744
|
-
const { appearance: n } = A(), { execute: u, isLoading: i, error: l } = da(), d = o ?? n, [c, f] = g(""), [p, m] = g(s === "sql" ? "sql" : "nl"), b =
|
|
4745
|
-
if (
|
|
4770
|
+
const { appearance: n } = A(), { execute: u, isLoading: i, error: l } = da(), d = o ?? n, [c, f] = g(""), [p, m] = g(s === "sql" ? "sql" : "nl"), b = k(async (w) => {
|
|
4771
|
+
if (w.preventDefault(), !c.trim()) return;
|
|
4746
4772
|
const O = await u(p === "sql" ? { sql: c } : { naturalLanguage: c });
|
|
4747
4773
|
O && (a == null || a(O));
|
|
4748
4774
|
}, [c, p, u, a]);
|
|
@@ -4775,7 +4801,7 @@ function fe({ onResult: a, mode: s = "both", placeholder: r, appearance: o }) {
|
|
|
4775
4801
|
className: "ss-input ss-query-textarea",
|
|
4776
4802
|
placeholder: r ?? (p === "sql" ? "SELECT ..." : "Ask a question about your data..."),
|
|
4777
4803
|
value: c,
|
|
4778
|
-
onChange: (
|
|
4804
|
+
onChange: (w) => f(w.target.value),
|
|
4779
4805
|
rows: 3
|
|
4780
4806
|
}
|
|
4781
4807
|
) }),
|
|
@@ -4788,18 +4814,18 @@ function fe({ onResult: a, mode: s = "both", placeholder: r, appearance: o }) {
|
|
|
4788
4814
|
}
|
|
4789
4815
|
function Wa({ columns: a, rows: s, sortable: r = !0, maxRows: o, appearance: n }) {
|
|
4790
4816
|
const { appearance: u } = A(), i = n ?? u, [l, d] = g(null), [c, f] = g("asc"), p = G(() => l ? [...s].sort((y, O) => {
|
|
4791
|
-
const h = y[l],
|
|
4792
|
-
if (h == null &&
|
|
4817
|
+
const h = y[l], N = O[l];
|
|
4818
|
+
if (h == null && N == null) return 0;
|
|
4793
4819
|
if (h == null) return 1;
|
|
4794
|
-
if (
|
|
4795
|
-
if (typeof h == "number" && typeof
|
|
4796
|
-
return c === "asc" ? h -
|
|
4797
|
-
const
|
|
4798
|
-
return c === "asc" ?
|
|
4820
|
+
if (N == null) return -1;
|
|
4821
|
+
if (typeof h == "number" && typeof N == "number")
|
|
4822
|
+
return c === "asc" ? h - N : N - h;
|
|
4823
|
+
const C = String(h), P = String(N);
|
|
4824
|
+
return c === "asc" ? C.localeCompare(P) : P.localeCompare(C);
|
|
4799
4825
|
}) : s, [s, l, c]), m = o ? p.slice(0, o) : p, b = (y) => {
|
|
4800
4826
|
r && (l === y ? f((O) => O === "asc" ? "desc" : "asc") : (d(y), f("asc")));
|
|
4801
4827
|
};
|
|
4802
|
-
function
|
|
4828
|
+
function w(y) {
|
|
4803
4829
|
return y == null ? "" : typeof y == "object" ? JSON.stringify(y) : String(y);
|
|
4804
4830
|
}
|
|
4805
4831
|
return /* @__PURE__ */ e(H, { appearance: i, children: /* @__PURE__ */ t("div", { className: "ss-table-container", children: [
|
|
@@ -4816,7 +4842,7 @@ function Wa({ columns: a, rows: s, sortable: r = !0, maxRows: o, appearance: n }
|
|
|
4816
4842
|
},
|
|
4817
4843
|
y
|
|
4818
4844
|
)) }) }),
|
|
4819
|
-
/* @__PURE__ */ e("tbody", { children: m.map((y, O) => /* @__PURE__ */ e("tr", { className: "ss-tr", children: a.map((h) => /* @__PURE__ */ e("td", { className: "ss-td", children:
|
|
4845
|
+
/* @__PURE__ */ e("tbody", { children: m.map((y, O) => /* @__PURE__ */ e("tr", { className: "ss-tr", children: a.map((h) => /* @__PURE__ */ e("td", { className: "ss-td", children: w(y[h]) }, h)) }, O)) })
|
|
4820
4846
|
] }),
|
|
4821
4847
|
o && s.length > o && /* @__PURE__ */ t("div", { className: "ss-table-footer", children: [
|
|
4822
4848
|
"Showing ",
|
|
@@ -4840,9 +4866,9 @@ function Ga({ labels: a, values: s, w: r, h: o, colors: n }) {
|
|
|
4840
4866
|
return /* @__PURE__ */ t("g", { children: [
|
|
4841
4867
|
/* @__PURE__ */ e("line", { x1: i, y1: o - i, x2: r - i, y2: o - i, stroke: "#ccc", strokeWidth: 1 }),
|
|
4842
4868
|
s.map((f, p) => {
|
|
4843
|
-
const m = f / u * d, b = i + l / a.length * p + 2,
|
|
4869
|
+
const m = f / u * d, b = i + l / a.length * p + 2, w = o - i - m;
|
|
4844
4870
|
return /* @__PURE__ */ t("g", { children: [
|
|
4845
|
-
/* @__PURE__ */ e("rect", { x: b, y:
|
|
4871
|
+
/* @__PURE__ */ e("rect", { x: b, y: w, width: c, height: m, fill: n[p % n.length], rx: 2 }),
|
|
4846
4872
|
/* @__PURE__ */ e("text", { x: b + c / 2, y: o - i + 14, textAnchor: "middle", fontSize: 10, fill: "#666", children: a[p].length > 8 ? a[p].slice(0, 8) + "..." : a[p] })
|
|
4847
4873
|
] }, p);
|
|
4848
4874
|
})
|
|
@@ -4850,8 +4876,8 @@ function Ga({ labels: a, values: s, w: r, h: o, colors: n }) {
|
|
|
4850
4876
|
}
|
|
4851
4877
|
function Ya({ labels: a, values: s, w: r, h: o, colors: n }) {
|
|
4852
4878
|
const u = Math.max(...s, 1), i = 40, l = r - i * 2, d = o - i * 2, c = a.length > 1 ? l / (a.length - 1) : 0, f = s.map((p, m) => {
|
|
4853
|
-
const b = i + c * m,
|
|
4854
|
-
return `${b},${
|
|
4879
|
+
const b = i + c * m, w = o - i - p / u * d;
|
|
4880
|
+
return `${b},${w}`;
|
|
4855
4881
|
});
|
|
4856
4882
|
return /* @__PURE__ */ t("g", { children: [
|
|
4857
4883
|
[0.25, 0.5, 0.75, 1].map((p) => {
|
|
@@ -4860,8 +4886,8 @@ function Ya({ labels: a, values: s, w: r, h: o, colors: n }) {
|
|
|
4860
4886
|
}),
|
|
4861
4887
|
/* @__PURE__ */ e("polyline", { points: f.join(" "), fill: "none", stroke: n[0], strokeWidth: 2 }),
|
|
4862
4888
|
s.map((p, m) => {
|
|
4863
|
-
const b = i + c * m,
|
|
4864
|
-
return /* @__PURE__ */ e("circle", { cx: b, cy:
|
|
4889
|
+
const b = i + c * m, w = o - i - p / u * d;
|
|
4890
|
+
return /* @__PURE__ */ e("circle", { cx: b, cy: w, r: 4, fill: n[0] }, m);
|
|
4865
4891
|
})
|
|
4866
4892
|
] });
|
|
4867
4893
|
}
|
|
@@ -4869,7 +4895,7 @@ function Ja({ labels: a, values: s, w: r, h: o, colors: n }) {
|
|
|
4869
4895
|
const u = s.reduce((m, b) => m + b, 0) || 1, i = r / 2, l = o / 2 - 20, d = Math.min(r, o) / 2 - 40, c = 2 * Math.PI * d;
|
|
4870
4896
|
let f = 0;
|
|
4871
4897
|
const p = s.map((m, b) => {
|
|
4872
|
-
const
|
|
4898
|
+
const w = m / u, y = w * c, O = { dash: y, offset: f, color: n[b % n.length], label: a[b], pct: w };
|
|
4873
4899
|
return f += y, O;
|
|
4874
4900
|
});
|
|
4875
4901
|
return /* @__PURE__ */ t("g", { children: [
|
|
@@ -4908,35 +4934,35 @@ function Qa({ type: a, data: s, title: r, width: o = 400, height: n = 300, appea
|
|
|
4908
4934
|
function be({ dashboardId: a, embedToken: s, baseUrl: r, refreshInterval: o, appearance: n }) {
|
|
4909
4935
|
const u = A(), i = n ?? (u == null ? void 0 : u.appearance), l = G(() => {
|
|
4910
4936
|
if (s) {
|
|
4911
|
-
const h = r ?? "https://api.saas-support.com/v1",
|
|
4912
|
-
return new ta(
|
|
4937
|
+
const h = r ?? "https://api.saas-support.com/v1", N = new Q(h, { type: "embedToken", token: s });
|
|
4938
|
+
return new ta(N);
|
|
4913
4939
|
}
|
|
4914
4940
|
return u.client.report;
|
|
4915
|
-
}, [s, r, u]), [d, c] = g([]), [f, p] = g({}), [m, b] = g(!0), [
|
|
4941
|
+
}, [s, r, u]), [d, c] = g([]), [f, p] = g({}), [m, b] = g(!0), [w, y] = g(null), O = k(async () => {
|
|
4916
4942
|
b(!0), y(null);
|
|
4917
4943
|
try {
|
|
4918
|
-
const h = await l.getDashboard(a),
|
|
4919
|
-
c(
|
|
4920
|
-
const
|
|
4921
|
-
for (const P of
|
|
4944
|
+
const h = await l.getDashboard(a), N = JSON.parse(h.layoutJson || "[]");
|
|
4945
|
+
c(N);
|
|
4946
|
+
const C = {};
|
|
4947
|
+
for (const P of N)
|
|
4922
4948
|
try {
|
|
4923
4949
|
const I = await l.listQueries({ search: P.queryId, perPage: 1 });
|
|
4924
4950
|
if (I.data.length > 0 && I.data[0].generatedSql) {
|
|
4925
|
-
const
|
|
4926
|
-
|
|
4951
|
+
const B = await l.executeQuery({ sql: I.data[0].generatedSql });
|
|
4952
|
+
C[P.queryId] = B;
|
|
4927
4953
|
}
|
|
4928
4954
|
} catch {
|
|
4929
4955
|
}
|
|
4930
|
-
p(
|
|
4956
|
+
p(C);
|
|
4931
4957
|
} catch (h) {
|
|
4932
4958
|
y(h instanceof Error ? h.message : "Failed to load dashboard");
|
|
4933
4959
|
} finally {
|
|
4934
4960
|
b(!1);
|
|
4935
4961
|
}
|
|
4936
4962
|
}, [l, a]);
|
|
4937
|
-
return
|
|
4963
|
+
return V(() => {
|
|
4938
4964
|
O();
|
|
4939
|
-
}, [O]),
|
|
4965
|
+
}, [O]), V(() => {
|
|
4940
4966
|
if (!o || o <= 0) return;
|
|
4941
4967
|
const h = setInterval(O, o * 1e3);
|
|
4942
4968
|
return () => clearInterval(h);
|
|
@@ -4945,17 +4971,17 @@ function be({ dashboardId: a, embedToken: s, baseUrl: r, refreshInterval: o, app
|
|
|
4945
4971
|
/* @__PURE__ */ e("span", { className: "ss-spinner" }),
|
|
4946
4972
|
" Loading dashboard..."
|
|
4947
4973
|
] }),
|
|
4948
|
-
|
|
4949
|
-
!m && d.map((h,
|
|
4950
|
-
const
|
|
4951
|
-
if (!
|
|
4952
|
-
const P =
|
|
4953
|
-
labels:
|
|
4954
|
-
values:
|
|
4974
|
+
w && /* @__PURE__ */ e("div", { className: "ss-global-error", children: w }),
|
|
4975
|
+
!m && d.map((h, N) => {
|
|
4976
|
+
const C = f[h.queryId];
|
|
4977
|
+
if (!C) return null;
|
|
4978
|
+
const P = C.columns.length >= 2 ? {
|
|
4979
|
+
labels: C.rows.map((I) => String(I[C.columns[0]] ?? "")),
|
|
4980
|
+
values: C.rows.map((I) => Number(I[C.columns[1]] ?? 0))
|
|
4955
4981
|
} : { labels: [], values: [] };
|
|
4956
4982
|
return /* @__PURE__ */ t("div", { className: "ss-widget", children: [
|
|
4957
4983
|
h.title && /* @__PURE__ */ e("h4", { className: "ss-widget-header", children: h.title }),
|
|
4958
|
-
h.chartType === "table" ? /* @__PURE__ */ e(Wa, { columns:
|
|
4984
|
+
h.chartType === "table" ? /* @__PURE__ */ e(Wa, { columns: C.columns, rows: C.rows, maxRows: 50 }) : /* @__PURE__ */ e(
|
|
4959
4985
|
Qa,
|
|
4960
4986
|
{
|
|
4961
4987
|
type: h.chartType || "bar",
|
|
@@ -4964,7 +4990,7 @@ function be({ dashboardId: a, embedToken: s, baseUrl: r, refreshInterval: o, app
|
|
|
4964
4990
|
height: h.h
|
|
4965
4991
|
}
|
|
4966
4992
|
)
|
|
4967
|
-
] },
|
|
4993
|
+
] }, N);
|
|
4968
4994
|
})
|
|
4969
4995
|
] }) });
|
|
4970
4996
|
}
|
|
@@ -4972,7 +4998,7 @@ function Za(a) {
|
|
|
4972
4998
|
return new Date(a).toLocaleDateString("en-US", { year: "numeric", month: "short", day: "numeric" });
|
|
4973
4999
|
}
|
|
4974
5000
|
function xe({ onSelectQuery: a, onRunQuery: s, appearance: r }) {
|
|
4975
|
-
const { appearance: o } = A(), { queries: n, isLoading: u, error: i } = qa(), { execute: l, isLoading: d } = da(), c = r ?? o, f =
|
|
5001
|
+
const { appearance: o } = A(), { queries: n, isLoading: u, error: i } = qa(), { execute: l, isLoading: d } = da(), c = r ?? o, f = k(async (p) => {
|
|
4976
5002
|
if (!p.generatedSql) return;
|
|
4977
5003
|
const m = await l({ sql: p.generatedSql });
|
|
4978
5004
|
m && (s == null || s(m));
|
|
@@ -5021,20 +5047,20 @@ function ye({ embedToken: a, dashboardId: s, baseUrl: r = "https://api.saas-supp
|
|
|
5021
5047
|
const u = G(() => {
|
|
5022
5048
|
const y = new Q(r, { type: "embedToken", token: a });
|
|
5023
5049
|
return new ta(y);
|
|
5024
|
-
}, [a, r]), [i, l] = g([]), [d, c] = g(!0), [f, p] = g(null), m = G(() => aa(n), [n]), b = G(() => ea(m), [m]),
|
|
5050
|
+
}, [a, r]), [i, l] = g([]), [d, c] = g(!0), [f, p] = g(null), m = G(() => aa(n), [n]), b = G(() => ea(m), [m]), w = k(async () => {
|
|
5025
5051
|
c(!0), p(null);
|
|
5026
5052
|
try {
|
|
5027
5053
|
const y = await u.getDashboard(s), O = JSON.parse(y.layoutJson || "[]"), h = await Promise.all(
|
|
5028
|
-
O.map(async (
|
|
5054
|
+
O.map(async (N) => {
|
|
5029
5055
|
try {
|
|
5030
|
-
const
|
|
5031
|
-
if (
|
|
5032
|
-
const P = await u.executeQuery({ sql:
|
|
5033
|
-
return { ...
|
|
5056
|
+
const C = await u.listQueries({ search: N.queryId, perPage: 1 });
|
|
5057
|
+
if (C.data.length > 0 && C.data[0].generatedSql) {
|
|
5058
|
+
const P = await u.executeQuery({ sql: C.data[0].generatedSql });
|
|
5059
|
+
return { ...N, result: P };
|
|
5034
5060
|
}
|
|
5035
5061
|
} catch {
|
|
5036
5062
|
}
|
|
5037
|
-
return
|
|
5063
|
+
return N;
|
|
5038
5064
|
})
|
|
5039
5065
|
);
|
|
5040
5066
|
l(h);
|
|
@@ -5044,21 +5070,21 @@ function ye({ embedToken: a, dashboardId: s, baseUrl: r = "https://api.saas-supp
|
|
|
5044
5070
|
c(!1);
|
|
5045
5071
|
}
|
|
5046
5072
|
}, [u, s]);
|
|
5047
|
-
return
|
|
5048
|
-
|
|
5049
|
-
}, [
|
|
5073
|
+
return V(() => {
|
|
5074
|
+
w();
|
|
5075
|
+
}, [w]), V(() => {
|
|
5050
5076
|
if (!o || o <= 0) return;
|
|
5051
|
-
const y = setInterval(
|
|
5077
|
+
const y = setInterval(w, o * 1e3);
|
|
5052
5078
|
return () => clearInterval(y);
|
|
5053
|
-
}, [o,
|
|
5079
|
+
}, [o, w]), /* @__PURE__ */ e(
|
|
5054
5080
|
"div",
|
|
5055
5081
|
{
|
|
5056
5082
|
ref: (y) => {
|
|
5057
5083
|
if (!y || y.shadowRoot) return;
|
|
5058
5084
|
const O = y.attachShadow({ mode: "open" }), h = document.createElement("style");
|
|
5059
5085
|
h.textContent = b, O.appendChild(h);
|
|
5060
|
-
const
|
|
5061
|
-
O.appendChild(
|
|
5086
|
+
const N = document.createElement("div");
|
|
5087
|
+
O.appendChild(N);
|
|
5062
5088
|
},
|
|
5063
5089
|
style: { display: "contents" },
|
|
5064
5090
|
children: /* @__PURE__ */ t("div", { className: "ss-dashboard-grid", children: [
|
|
@@ -5066,12 +5092,12 @@ function ye({ embedToken: a, dashboardId: s, baseUrl: r = "https://api.saas-supp
|
|
|
5066
5092
|
f && /* @__PURE__ */ e("div", { className: "ss-global-error", children: f }),
|
|
5067
5093
|
!d && i.map((y, O) => {
|
|
5068
5094
|
if (!y.result) return null;
|
|
5069
|
-
const { columns: h, rows:
|
|
5095
|
+
const { columns: h, rows: N } = y.result;
|
|
5070
5096
|
return /* @__PURE__ */ t("div", { className: "ss-widget", children: [
|
|
5071
5097
|
y.title && /* @__PURE__ */ e("h4", { className: "ss-widget-header", children: y.title }),
|
|
5072
5098
|
/* @__PURE__ */ t("table", { className: "ss-table", children: [
|
|
5073
|
-
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ e("tr", { children: h.map((
|
|
5074
|
-
/* @__PURE__ */ e("tbody", { children:
|
|
5099
|
+
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ e("tr", { children: h.map((C) => /* @__PURE__ */ e("th", { className: "ss-th", children: C }, C)) }) }),
|
|
5100
|
+
/* @__PURE__ */ e("tbody", { children: N.slice(0, 50).map((C, P) => /* @__PURE__ */ e("tr", { className: "ss-tr", children: h.map((I) => /* @__PURE__ */ e("td", { className: "ss-td", children: String(C[I] ?? "") }, I)) }, P)) })
|
|
5075
5101
|
] })
|
|
5076
5102
|
] }, O);
|
|
5077
5103
|
})
|