@saas-support/react 0.7.3 → 0.7.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +29 -20
- package/dist/react.cjs +2 -2
- package/dist/react.d.ts +6 -1
- package/dist/react.js +1205 -1198
- package/package.json +1 -1
package/dist/react.js
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import { jsx as e, jsxs as t, Fragment as
|
|
2
|
-
import { createContext as ma, useContext as fa, useState as
|
|
3
|
-
import { SaaSSupport as
|
|
4
|
-
import { SaaSError as
|
|
5
|
-
import { createPortal as
|
|
1
|
+
import { jsx as e, jsxs as t, Fragment as H } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as ma, useContext as fa, useState as h, useEffect as U, useRef as W, useCallback as $, forwardRef as ba, useImperativeHandle as xa, useMemo as G } from "react";
|
|
3
|
+
import { SaaSSupport as ya, isMfaRequired as va, BillingClient as wa, Transport as Q, ReportClient as ta } from "./index.js";
|
|
4
|
+
import { SaaSError as $e } from "./index.js";
|
|
5
|
+
import { createPortal as Na } from "react-dom";
|
|
6
6
|
const ra = ma(null);
|
|
7
|
-
function
|
|
7
|
+
function D() {
|
|
8
8
|
const a = fa(ra);
|
|
9
9
|
if (!a)
|
|
10
10
|
throw new Error("useSaaSContext must be used within a <SaaSProvider>");
|
|
11
11
|
return a;
|
|
12
12
|
}
|
|
13
|
-
function
|
|
14
|
-
const [u] =
|
|
15
|
-
return
|
|
16
|
-
let
|
|
13
|
+
function re({ publishableKey: a, apiKey: r, baseUrl: s, appearance: l, children: n }) {
|
|
14
|
+
const [u] = h(() => new ya({ publishableKey: a, apiKey: r, baseUrl: s })), [c, d] = h(null), [i, o] = h(!1), [m, p] = h(null);
|
|
15
|
+
return U(() => {
|
|
16
|
+
let g = !1;
|
|
17
17
|
u.load().then(async () => {
|
|
18
|
-
if (
|
|
19
|
-
const
|
|
20
|
-
|
|
18
|
+
if (g) return;
|
|
19
|
+
const x = await u.auth.getUser(), y = await u.auth.getSettings();
|
|
20
|
+
d(x), p(y), o(!0);
|
|
21
21
|
});
|
|
22
|
-
const
|
|
23
|
-
|
|
22
|
+
const v = u.auth.onAuthStateChange((x) => {
|
|
23
|
+
g || d(x);
|
|
24
24
|
});
|
|
25
25
|
return () => {
|
|
26
|
-
|
|
26
|
+
g = !0, v(), u.destroy();
|
|
27
27
|
};
|
|
28
|
-
}, [u]), /* @__PURE__ */ e(ra.Provider, { value: { client: u, user:
|
|
28
|
+
}, [u]), /* @__PURE__ */ e(ra.Provider, { value: { client: u, user: c, isLoaded: i, appearance: l, settings: m }, children: n });
|
|
29
29
|
}
|
|
30
|
-
const
|
|
30
|
+
const Sa = {
|
|
31
31
|
// Legacy (unchanged)
|
|
32
32
|
colorPrimary: "#6366f1",
|
|
33
33
|
colorPrimaryHover: "#4f46e5",
|
|
@@ -61,7 +61,7 @@ const wa = {
|
|
|
61
61
|
authSuccess: "#22c55e",
|
|
62
62
|
authFontHeadline: "'Manrope', sans-serif",
|
|
63
63
|
authFontBody: "'Inter', sans-serif"
|
|
64
|
-
},
|
|
64
|
+
}, $a = {
|
|
65
65
|
// Legacy (unchanged)
|
|
66
66
|
colorPrimary: "#818cf8",
|
|
67
67
|
colorPrimaryHover: "#6366f1",
|
|
@@ -97,50 +97,50 @@ const wa = {
|
|
|
97
97
|
authFontBody: "'Inter', sans-serif"
|
|
98
98
|
};
|
|
99
99
|
function aa(a) {
|
|
100
|
-
const
|
|
100
|
+
const r = (a == null ? void 0 : a.baseTheme) === "dark" ? $a : Sa, s = a == null ? void 0 : a.variables, l = (s == null ? void 0 : s.colorPrimary) ?? r.authPrimary;
|
|
101
101
|
return {
|
|
102
102
|
// Legacy
|
|
103
|
-
colorPrimary: (
|
|
104
|
-
colorPrimaryHover:
|
|
105
|
-
colorBackground: (
|
|
106
|
-
colorText: (
|
|
107
|
-
colorTextSecondary:
|
|
108
|
-
colorInputBackground: (
|
|
109
|
-
colorInputBorder: (
|
|
110
|
-
colorError: (
|
|
111
|
-
colorSuccess: (
|
|
112
|
-
colorWarning: (
|
|
113
|
-
fontFamily: (
|
|
114
|
-
borderRadius: (
|
|
103
|
+
colorPrimary: (s == null ? void 0 : s.colorPrimary) ?? r.colorPrimary,
|
|
104
|
+
colorPrimaryHover: s != null && s.colorPrimary ? ka(s.colorPrimary, 10) : r.colorPrimaryHover,
|
|
105
|
+
colorBackground: (s == null ? void 0 : s.colorBackground) ?? r.colorBackground,
|
|
106
|
+
colorText: (s == null ? void 0 : s.colorText) ?? r.colorText,
|
|
107
|
+
colorTextSecondary: r.colorTextSecondary,
|
|
108
|
+
colorInputBackground: (s == null ? void 0 : s.colorInputBackground) ?? r.colorInputBackground,
|
|
109
|
+
colorInputBorder: (s == null ? void 0 : s.colorInputBorder) ?? r.colorInputBorder,
|
|
110
|
+
colorError: (s == null ? void 0 : s.colorError) ?? r.colorError,
|
|
111
|
+
colorSuccess: (s == null ? void 0 : s.colorSuccess) ?? r.colorSuccess,
|
|
112
|
+
colorWarning: (s == null ? void 0 : s.colorWarning) ?? r.colorWarning,
|
|
113
|
+
fontFamily: (s == null ? void 0 : s.fontFamily) ?? r.fontFamily,
|
|
114
|
+
borderRadius: (s == null ? void 0 : s.borderRadius) ?? r.borderRadius,
|
|
115
115
|
// MD3 auth — derive from user overrides where applicable
|
|
116
|
-
authPrimary:
|
|
117
|
-
authPrimaryContainer:
|
|
118
|
-
authOnPrimary:
|
|
119
|
-
authPrimaryFixed:
|
|
120
|
-
authSurface: (
|
|
121
|
-
authSurfaceContainerLowest:
|
|
122
|
-
authSurfaceContainerLow: (
|
|
123
|
-
authSurfaceContainer:
|
|
124
|
-
authSurfaceContainerHigh:
|
|
125
|
-
authSurfaceContainerHighest:
|
|
126
|
-
authOnSurface: (
|
|
127
|
-
authOnSurfaceVariant:
|
|
128
|
-
authOutline:
|
|
129
|
-
authOutlineVariant: (
|
|
130
|
-
authError: (
|
|
131
|
-
authErrorContainer:
|
|
132
|
-
authSuccess: (
|
|
133
|
-
authFontHeadline: (
|
|
134
|
-
authFontBody: (
|
|
116
|
+
authPrimary: l,
|
|
117
|
+
authPrimaryContainer: s != null && s.colorPrimary ? Ca(l, 15) : r.authPrimaryContainer,
|
|
118
|
+
authOnPrimary: r.authOnPrimary,
|
|
119
|
+
authPrimaryFixed: r.authPrimaryFixed,
|
|
120
|
+
authSurface: (s == null ? void 0 : s.colorBackground) ?? r.authSurface,
|
|
121
|
+
authSurfaceContainerLowest: r.authSurfaceContainerLowest,
|
|
122
|
+
authSurfaceContainerLow: (s == null ? void 0 : s.colorInputBackground) ?? r.authSurfaceContainerLow,
|
|
123
|
+
authSurfaceContainer: r.authSurfaceContainer,
|
|
124
|
+
authSurfaceContainerHigh: r.authSurfaceContainerHigh,
|
|
125
|
+
authSurfaceContainerHighest: r.authSurfaceContainerHighest,
|
|
126
|
+
authOnSurface: (s == null ? void 0 : s.colorText) ?? r.authOnSurface,
|
|
127
|
+
authOnSurfaceVariant: r.authOnSurfaceVariant,
|
|
128
|
+
authOutline: r.authOutline,
|
|
129
|
+
authOutlineVariant: (s == null ? void 0 : s.colorInputBorder) ?? r.authOutlineVariant,
|
|
130
|
+
authError: (s == null ? void 0 : s.colorError) ?? r.authError,
|
|
131
|
+
authErrorContainer: r.authErrorContainer,
|
|
132
|
+
authSuccess: (s == null ? void 0 : s.colorSuccess) ?? r.authSuccess,
|
|
133
|
+
authFontHeadline: (s == null ? void 0 : s.fontFamily) ?? r.authFontHeadline,
|
|
134
|
+
authFontBody: (s == null ? void 0 : s.fontFamily) ?? r.authFontBody
|
|
135
135
|
};
|
|
136
136
|
}
|
|
137
|
-
function
|
|
138
|
-
const
|
|
139
|
-
return `#${(
|
|
137
|
+
function ka(a, r) {
|
|
138
|
+
const s = parseInt(a.replace("#", ""), 16), l = Math.max(0, (s >> 16) - Math.round(2.55 * r)), n = Math.max(0, (s >> 8 & 255) - Math.round(2.55 * r)), u = Math.max(0, (s & 255) - Math.round(2.55 * r));
|
|
139
|
+
return `#${(l << 16 | n << 8 | u).toString(16).padStart(6, "0")}`;
|
|
140
140
|
}
|
|
141
|
-
function
|
|
142
|
-
const
|
|
143
|
-
return `#${(
|
|
141
|
+
function Ca(a, r) {
|
|
142
|
+
const s = parseInt(a.replace("#", ""), 16), l = Math.min(255, (s >> 16) + Math.round(2.55 * r)), n = Math.min(255, (s >> 8 & 255) + Math.round(2.55 * r)), u = Math.min(255, (s & 255) + Math.round(2.55 * r));
|
|
143
|
+
return `#${(l << 16 | n << 8 | u).toString(16).padStart(6, "0")}`;
|
|
144
144
|
}
|
|
145
145
|
function ea(a) {
|
|
146
146
|
return `
|
|
@@ -2501,280 +2501,280 @@ function ea(a) {
|
|
|
2501
2501
|
}
|
|
2502
2502
|
`;
|
|
2503
2503
|
}
|
|
2504
|
-
function
|
|
2505
|
-
const
|
|
2506
|
-
|
|
2507
|
-
var
|
|
2508
|
-
if (!
|
|
2509
|
-
n(((
|
|
2504
|
+
function j({ children: a, appearance: r }) {
|
|
2505
|
+
const s = W(null), [l, n] = h(null);
|
|
2506
|
+
U(() => {
|
|
2507
|
+
var m;
|
|
2508
|
+
if (!s.current || s.current.shadowRoot) {
|
|
2509
|
+
n(((m = s.current) == null ? void 0 : m.shadowRoot) ?? null);
|
|
2510
2510
|
return;
|
|
2511
2511
|
}
|
|
2512
|
-
const
|
|
2513
|
-
if ((
|
|
2514
|
-
const p = (
|
|
2512
|
+
const c = s.current.attachShadow({ mode: "open" });
|
|
2513
|
+
if ((r == null ? void 0 : r.fontUrl) !== null) {
|
|
2514
|
+
const p = (r == null ? void 0 : r.fontUrl) ?? "https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Inter:wght@400;500;600&family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=swap";
|
|
2515
2515
|
if (!document.querySelector(`link[href="${p}"]`)) {
|
|
2516
|
-
const
|
|
2517
|
-
|
|
2516
|
+
const v = document.createElement("link");
|
|
2517
|
+
v.rel = "stylesheet", v.href = p, document.head.appendChild(v);
|
|
2518
2518
|
}
|
|
2519
|
-
const
|
|
2520
|
-
|
|
2521
|
-
}
|
|
2522
|
-
const
|
|
2523
|
-
|
|
2524
|
-
const
|
|
2525
|
-
|
|
2526
|
-
}, []),
|
|
2527
|
-
if (!
|
|
2528
|
-
const
|
|
2529
|
-
if (
|
|
2530
|
-
const
|
|
2531
|
-
|
|
2532
|
-
}
|
|
2533
|
-
}, [
|
|
2534
|
-
const u = (
|
|
2535
|
-
return /* @__PURE__ */ e("div", { ref:
|
|
2519
|
+
const g = document.createElement("link");
|
|
2520
|
+
g.rel = "stylesheet", g.href = p, c.appendChild(g);
|
|
2521
|
+
}
|
|
2522
|
+
const d = aa(r), i = document.createElement("style");
|
|
2523
|
+
i.textContent = ea(d), c.appendChild(i);
|
|
2524
|
+
const o = document.createElement("div");
|
|
2525
|
+
c.appendChild(o), n(c);
|
|
2526
|
+
}, []), U(() => {
|
|
2527
|
+
if (!l) return;
|
|
2528
|
+
const c = l.querySelector("style");
|
|
2529
|
+
if (c) {
|
|
2530
|
+
const d = aa(r);
|
|
2531
|
+
c.textContent = ea(d);
|
|
2532
|
+
}
|
|
2533
|
+
}, [r, l]);
|
|
2534
|
+
const u = (l == null ? void 0 : l.querySelector("div")) ?? null;
|
|
2535
|
+
return /* @__PURE__ */ e("div", { ref: s, style: { display: "contents" }, children: u && Na(a, u) });
|
|
2536
2536
|
}
|
|
2537
2537
|
function sa() {
|
|
2538
|
-
const { client: a, user:
|
|
2538
|
+
const { client: a, user: r, isLoaded: s } = D();
|
|
2539
2539
|
return {
|
|
2540
|
-
isLoaded:
|
|
2541
|
-
isSignedIn: !!
|
|
2542
|
-
user:
|
|
2543
|
-
signOut:
|
|
2544
|
-
getToken:
|
|
2545
|
-
refreshUser:
|
|
2540
|
+
isLoaded: s,
|
|
2541
|
+
isSignedIn: !!r,
|
|
2542
|
+
user: r,
|
|
2543
|
+
signOut: $(() => a.auth.signOut(), [a]),
|
|
2544
|
+
getToken: $(() => a.auth.getToken(), [a]),
|
|
2545
|
+
refreshUser: $(() => a.auth.refreshUser(), [a])
|
|
2546
2546
|
};
|
|
2547
2547
|
}
|
|
2548
|
-
function
|
|
2549
|
-
const { user: a, isLoaded:
|
|
2550
|
-
return { user: a, isLoaded:
|
|
2548
|
+
function ne() {
|
|
2549
|
+
const { user: a, isLoaded: r } = D();
|
|
2550
|
+
return { user: a, isLoaded: r };
|
|
2551
2551
|
}
|
|
2552
2552
|
function na() {
|
|
2553
|
-
const { client: a } =
|
|
2554
|
-
async (
|
|
2555
|
-
|
|
2553
|
+
const { client: a } = D(), [r, s] = h(!1), [l, n] = h(null), u = $(
|
|
2554
|
+
async (i, o) => {
|
|
2555
|
+
s(!0), n(null);
|
|
2556
2556
|
try {
|
|
2557
|
-
return await a.auth.signIn(
|
|
2558
|
-
} catch (
|
|
2559
|
-
return n(
|
|
2557
|
+
return await a.auth.signIn(i, o);
|
|
2558
|
+
} catch (m) {
|
|
2559
|
+
return n(m instanceof Error ? m.message : "Sign in failed"), null;
|
|
2560
2560
|
} finally {
|
|
2561
|
-
|
|
2561
|
+
s(!1);
|
|
2562
2562
|
}
|
|
2563
2563
|
},
|
|
2564
2564
|
[a]
|
|
2565
|
-
),
|
|
2566
|
-
async (
|
|
2567
|
-
|
|
2565
|
+
), c = $(
|
|
2566
|
+
async (i) => {
|
|
2567
|
+
s(!0), n(null);
|
|
2568
2568
|
try {
|
|
2569
|
-
return await a.auth.signInWithOAuth(
|
|
2570
|
-
} catch (
|
|
2571
|
-
return n(
|
|
2569
|
+
return await a.auth.signInWithOAuth(i);
|
|
2570
|
+
} catch (o) {
|
|
2571
|
+
return n(o instanceof Error ? o.message : "OAuth sign in failed"), null;
|
|
2572
2572
|
} finally {
|
|
2573
|
-
|
|
2573
|
+
s(!1);
|
|
2574
2574
|
}
|
|
2575
2575
|
},
|
|
2576
2576
|
[a]
|
|
2577
|
-
),
|
|
2578
|
-
async (
|
|
2579
|
-
|
|
2577
|
+
), d = $(
|
|
2578
|
+
async (i, o) => {
|
|
2579
|
+
s(!0), n(null);
|
|
2580
2580
|
try {
|
|
2581
|
-
return await a.auth.submitMfaCode(
|
|
2582
|
-
} catch (
|
|
2583
|
-
return n(
|
|
2581
|
+
return await a.auth.submitMfaCode(i, o);
|
|
2582
|
+
} catch (m) {
|
|
2583
|
+
return n(m instanceof Error ? m.message : "MFA verification failed"), null;
|
|
2584
2584
|
} finally {
|
|
2585
|
-
|
|
2585
|
+
s(!1);
|
|
2586
2586
|
}
|
|
2587
2587
|
},
|
|
2588
2588
|
[a]
|
|
2589
2589
|
);
|
|
2590
|
-
return { signIn: u, signInWithOAuth:
|
|
2590
|
+
return { signIn: u, signInWithOAuth: c, submitMfaCode: d, isLoading: r, error: l, setError: n };
|
|
2591
2591
|
}
|
|
2592
|
-
function
|
|
2593
|
-
const { client: a } =
|
|
2594
|
-
return { signUp:
|
|
2595
|
-
async (
|
|
2596
|
-
|
|
2592
|
+
function za() {
|
|
2593
|
+
const { client: a } = D(), [r, s] = h(!1), [l, n] = h(null);
|
|
2594
|
+
return { signUp: $(
|
|
2595
|
+
async (c, d) => {
|
|
2596
|
+
s(!0), n(null);
|
|
2597
2597
|
try {
|
|
2598
|
-
return await a.auth.signUp(
|
|
2599
|
-
} catch (
|
|
2600
|
-
return n(
|
|
2598
|
+
return await a.auth.signUp(c, d);
|
|
2599
|
+
} catch (i) {
|
|
2600
|
+
return n(i instanceof Error ? i.message : "Sign up failed"), null;
|
|
2601
2601
|
} finally {
|
|
2602
|
-
|
|
2602
|
+
s(!1);
|
|
2603
2603
|
}
|
|
2604
2604
|
},
|
|
2605
2605
|
[a]
|
|
2606
|
-
), isLoading:
|
|
2606
|
+
), isLoading: r, error: l, setError: n };
|
|
2607
2607
|
}
|
|
2608
2608
|
function Y() {
|
|
2609
|
-
const { client: a } =
|
|
2610
|
-
|
|
2609
|
+
const { client: a } = D(), [r, s] = h([]), [l, n] = h(null), [u, c] = h([]), [d, i] = h([]), [o, m] = h(!1), [p, g] = h(null), v = W(!1), x = $(async () => {
|
|
2610
|
+
m(!0), g(null);
|
|
2611
2611
|
try {
|
|
2612
|
-
const
|
|
2613
|
-
if (
|
|
2614
|
-
const
|
|
2615
|
-
if (
|
|
2616
|
-
n(
|
|
2612
|
+
const b = await a.auth.listOrgs();
|
|
2613
|
+
if (s(b), !v.current && b.length > 0) {
|
|
2614
|
+
const w = typeof window < "u" ? localStorage.getItem("ss_selected_org") : null, z = (w ? b.find((M) => M.id === w) : null) ?? (b.length === 1 ? b[0] : null);
|
|
2615
|
+
if (z) {
|
|
2616
|
+
v.current = !0, n(z), typeof window < "u" && localStorage.setItem("ss_selected_org", z.id);
|
|
2617
2617
|
try {
|
|
2618
|
-
const
|
|
2619
|
-
|
|
2618
|
+
const M = await a.auth.listMembers(z.id);
|
|
2619
|
+
c(M);
|
|
2620
2620
|
} catch {
|
|
2621
2621
|
}
|
|
2622
2622
|
}
|
|
2623
2623
|
}
|
|
2624
|
-
} catch (
|
|
2625
|
-
|
|
2624
|
+
} catch (b) {
|
|
2625
|
+
g(b instanceof Error ? b.message : "Failed to load organizations");
|
|
2626
2626
|
} finally {
|
|
2627
|
-
|
|
2627
|
+
m(!1);
|
|
2628
2628
|
}
|
|
2629
|
-
}, [a
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
}, [
|
|
2633
|
-
const
|
|
2629
|
+
}, [a]);
|
|
2630
|
+
U(() => {
|
|
2631
|
+
x();
|
|
2632
|
+
}, [x]);
|
|
2633
|
+
const y = $(async (b) => {
|
|
2634
2634
|
try {
|
|
2635
|
-
const
|
|
2636
|
-
n(
|
|
2637
|
-
const
|
|
2638
|
-
|
|
2639
|
-
} catch (
|
|
2640
|
-
|
|
2641
|
-
}
|
|
2642
|
-
}, [a]),
|
|
2635
|
+
const w = await a.auth.getOrg(b);
|
|
2636
|
+
n(w), typeof window < "u" && localStorage.setItem("ss_selected_org", b);
|
|
2637
|
+
const B = await a.auth.listMembers(b);
|
|
2638
|
+
c(B);
|
|
2639
|
+
} catch (w) {
|
|
2640
|
+
g(w instanceof Error ? w.message : "Failed to load organization");
|
|
2641
|
+
}
|
|
2642
|
+
}, [a]), P = $(async (b, w) => {
|
|
2643
2643
|
try {
|
|
2644
|
-
const
|
|
2645
|
-
return
|
|
2646
|
-
} catch (
|
|
2647
|
-
return
|
|
2644
|
+
const B = await a.auth.createOrg(b, w);
|
|
2645
|
+
return s((z) => [...z, B]), B;
|
|
2646
|
+
} catch (B) {
|
|
2647
|
+
return g(B instanceof Error ? B.message : "Failed to create organization"), null;
|
|
2648
2648
|
}
|
|
2649
|
-
}, [a]),
|
|
2649
|
+
}, [a]), N = $(async (b, w) => {
|
|
2650
2650
|
try {
|
|
2651
|
-
const
|
|
2652
|
-
return
|
|
2653
|
-
} catch (
|
|
2654
|
-
return
|
|
2651
|
+
const B = await a.auth.updateOrg(b, w);
|
|
2652
|
+
return s((z) => z.map((M) => M.id === b ? B : M)), (l == null ? void 0 : l.id) === b && n(B), B;
|
|
2653
|
+
} catch (B) {
|
|
2654
|
+
return g(B instanceof Error ? B.message : "Failed to update organization"), null;
|
|
2655
2655
|
}
|
|
2656
|
-
}, [a,
|
|
2656
|
+
}, [a, l]), E = $(async (b) => {
|
|
2657
2657
|
try {
|
|
2658
|
-
return await a.auth.deleteOrg(
|
|
2659
|
-
} catch (
|
|
2660
|
-
return
|
|
2658
|
+
return await a.auth.deleteOrg(b), s((w) => w.filter((B) => B.id !== b)), (l == null ? void 0 : l.id) === b && (n(null), c([]), i([]), typeof window < "u" && localStorage.removeItem("ss_selected_org")), !0;
|
|
2659
|
+
} catch (w) {
|
|
2660
|
+
return g(w instanceof Error ? w.message : "Failed to delete organization"), !1;
|
|
2661
2661
|
}
|
|
2662
|
-
}, [a,
|
|
2662
|
+
}, [a, l]), C = $(async (b, w, B) => {
|
|
2663
2663
|
try {
|
|
2664
|
-
return await a.auth.sendInvite(
|
|
2665
|
-
} catch (
|
|
2666
|
-
return
|
|
2664
|
+
return await a.auth.sendInvite(b, w, B);
|
|
2665
|
+
} catch (z) {
|
|
2666
|
+
return g(z instanceof Error ? z.message : "Failed to send invite"), null;
|
|
2667
2667
|
}
|
|
2668
|
-
}, [a]),
|
|
2668
|
+
}, [a]), f = $(async (b) => {
|
|
2669
2669
|
try {
|
|
2670
|
-
const
|
|
2671
|
-
|
|
2672
|
-
} catch (
|
|
2673
|
-
|
|
2670
|
+
const w = await a.auth.listInvites(b);
|
|
2671
|
+
i(w);
|
|
2672
|
+
} catch (w) {
|
|
2673
|
+
g(w instanceof Error ? w.message : "Failed to load invites");
|
|
2674
2674
|
}
|
|
2675
|
-
}, [a]),
|
|
2675
|
+
}, [a]), O = $(async (b, w) => {
|
|
2676
2676
|
try {
|
|
2677
|
-
return await a.auth.revokeInvite(
|
|
2678
|
-
} catch (
|
|
2679
|
-
return
|
|
2677
|
+
return await a.auth.revokeInvite(b, w), i((B) => B.filter((z) => z.id !== w)), !0;
|
|
2678
|
+
} catch (B) {
|
|
2679
|
+
return g(B instanceof Error ? B.message : "Failed to revoke invite"), !1;
|
|
2680
2680
|
}
|
|
2681
|
-
}, [a]), I =
|
|
2681
|
+
}, [a]), I = $(async (b, w, B) => {
|
|
2682
2682
|
try {
|
|
2683
|
-
return await a.auth.updateMemberRole(
|
|
2684
|
-
} catch (
|
|
2685
|
-
return
|
|
2683
|
+
return await a.auth.updateMemberRole(b, w, B), c((z) => z.map((M) => M.userId === w ? { ...M, role: B } : M)), !0;
|
|
2684
|
+
} catch (z) {
|
|
2685
|
+
return g(z instanceof Error ? z.message : "Failed to update member role"), !1;
|
|
2686
2686
|
}
|
|
2687
|
-
}, [a]),
|
|
2687
|
+
}, [a]), F = $(async (b, w) => {
|
|
2688
2688
|
try {
|
|
2689
|
-
return await a.auth.removeMember(
|
|
2690
|
-
} catch (
|
|
2691
|
-
return
|
|
2689
|
+
return await a.auth.removeMember(b, w), c((B) => B.filter((z) => z.userId !== w)), !0;
|
|
2690
|
+
} catch (B) {
|
|
2691
|
+
return g(B instanceof Error ? B.message : "Failed to remove member"), !1;
|
|
2692
2692
|
}
|
|
2693
|
-
}, [a]),
|
|
2693
|
+
}, [a]), A = $(async (b) => {
|
|
2694
2694
|
try {
|
|
2695
|
-
const
|
|
2696
|
-
|
|
2697
|
-
} catch (
|
|
2698
|
-
|
|
2695
|
+
const w = await a.auth.listMembers(b);
|
|
2696
|
+
c(w);
|
|
2697
|
+
} catch (w) {
|
|
2698
|
+
g(w instanceof Error ? w.message : "Failed to load members");
|
|
2699
2699
|
}
|
|
2700
2700
|
}, [a]);
|
|
2701
2701
|
return {
|
|
2702
|
-
orgs:
|
|
2703
|
-
selectedOrg:
|
|
2702
|
+
orgs: r,
|
|
2703
|
+
selectedOrg: l,
|
|
2704
2704
|
members: u,
|
|
2705
|
-
invites:
|
|
2706
|
-
isLoading:
|
|
2705
|
+
invites: d,
|
|
2706
|
+
isLoading: o,
|
|
2707
2707
|
error: p,
|
|
2708
|
-
setError:
|
|
2709
|
-
refresh:
|
|
2710
|
-
selectOrg:
|
|
2711
|
-
createOrg:
|
|
2712
|
-
updateOrg:
|
|
2713
|
-
deleteOrg:
|
|
2714
|
-
sendInvite:
|
|
2715
|
-
refreshInvites:
|
|
2716
|
-
revokeInvite:
|
|
2708
|
+
setError: g,
|
|
2709
|
+
refresh: x,
|
|
2710
|
+
selectOrg: y,
|
|
2711
|
+
createOrg: P,
|
|
2712
|
+
updateOrg: N,
|
|
2713
|
+
deleteOrg: E,
|
|
2714
|
+
sendInvite: C,
|
|
2715
|
+
refreshInvites: f,
|
|
2716
|
+
revokeInvite: O,
|
|
2717
2717
|
updateMemberRole: I,
|
|
2718
|
-
removeMember:
|
|
2719
|
-
refreshMembers:
|
|
2718
|
+
removeMember: F,
|
|
2719
|
+
refreshMembers: A
|
|
2720
2720
|
};
|
|
2721
2721
|
}
|
|
2722
|
-
function
|
|
2723
|
-
const { client: a } =
|
|
2724
|
-
return { deleteAccount:
|
|
2725
|
-
|
|
2722
|
+
function Pa() {
|
|
2723
|
+
const { client: a } = D(), [r, s] = h(!1), [l, n] = h(null);
|
|
2724
|
+
return { deleteAccount: $(async () => {
|
|
2725
|
+
s(!0), n(null);
|
|
2726
2726
|
try {
|
|
2727
2727
|
return await a.auth.deleteAccount(), !0;
|
|
2728
|
-
} catch (
|
|
2729
|
-
return n(
|
|
2728
|
+
} catch (c) {
|
|
2729
|
+
return n(c instanceof Error ? c.message : "Failed to delete account"), !1;
|
|
2730
2730
|
} finally {
|
|
2731
|
-
|
|
2731
|
+
s(!1);
|
|
2732
2732
|
}
|
|
2733
|
-
}, [a]), isLoading:
|
|
2733
|
+
}, [a]), isLoading: r, error: l, setError: n };
|
|
2734
2734
|
}
|
|
2735
2735
|
function oa() {
|
|
2736
|
-
const { client: a, user:
|
|
2736
|
+
const { client: a, user: r } = D(), [s, l] = h(!1), [n, u] = h(null), [c, d] = h(null), i = $(
|
|
2737
2737
|
async (p) => {
|
|
2738
|
-
|
|
2738
|
+
l(!0), u(null), d(null);
|
|
2739
2739
|
try {
|
|
2740
|
-
const
|
|
2741
|
-
return
|
|
2742
|
-
} catch (
|
|
2743
|
-
return u(
|
|
2740
|
+
const g = await a.auth.updateProfile(p);
|
|
2741
|
+
return d("Profile updated"), g;
|
|
2742
|
+
} catch (g) {
|
|
2743
|
+
return u(g instanceof Error ? g.message : "Failed to update profile"), null;
|
|
2744
2744
|
} finally {
|
|
2745
|
-
|
|
2745
|
+
l(!1);
|
|
2746
2746
|
}
|
|
2747
2747
|
},
|
|
2748
2748
|
[a]
|
|
2749
|
-
),
|
|
2750
|
-
async (p,
|
|
2751
|
-
|
|
2749
|
+
), o = $(
|
|
2750
|
+
async (p, g) => {
|
|
2751
|
+
l(!0), u(null), d(null);
|
|
2752
2752
|
try {
|
|
2753
|
-
return await a.auth.changePassword(p,
|
|
2754
|
-
} catch (
|
|
2755
|
-
return u(
|
|
2753
|
+
return await a.auth.changePassword(p, g), d("Password changed successfully"), !0;
|
|
2754
|
+
} catch (v) {
|
|
2755
|
+
return u(v instanceof Error ? v.message : "Failed to change password"), !1;
|
|
2756
2756
|
} finally {
|
|
2757
|
-
|
|
2757
|
+
l(!1);
|
|
2758
2758
|
}
|
|
2759
2759
|
},
|
|
2760
2760
|
[a]
|
|
2761
|
-
),
|
|
2761
|
+
), m = $(
|
|
2762
2762
|
async (p) => {
|
|
2763
|
-
|
|
2763
|
+
l(!0), u(null), d(null);
|
|
2764
2764
|
try {
|
|
2765
|
-
const
|
|
2766
|
-
return
|
|
2767
|
-
} catch (
|
|
2768
|
-
return u(
|
|
2765
|
+
const g = await a.auth.uploadAvatar(p);
|
|
2766
|
+
return d("Avatar updated"), g;
|
|
2767
|
+
} catch (g) {
|
|
2768
|
+
return u(g instanceof Error ? g.message : "Failed to upload avatar"), null;
|
|
2769
2769
|
} finally {
|
|
2770
|
-
|
|
2770
|
+
l(!1);
|
|
2771
2771
|
}
|
|
2772
2772
|
},
|
|
2773
2773
|
[a]
|
|
2774
2774
|
);
|
|
2775
|
-
return { user:
|
|
2775
|
+
return { user: r, updateProfile: i, uploadAvatar: m, changePassword: o, isLoading: s, error: n, success: c, setError: u, setSuccess: d };
|
|
2776
2776
|
}
|
|
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>',
|
|
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>', S = {
|
|
2778
2778
|
close: "close",
|
|
2779
2779
|
person: "person",
|
|
2780
2780
|
logout: "logout",
|
|
@@ -2808,49 +2808,49 @@ const ia = '<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d=
|
|
|
2808
2808
|
send: "send",
|
|
2809
2809
|
personRemove: "person_remove"
|
|
2810
2810
|
};
|
|
2811
|
-
function
|
|
2812
|
-
const { appearance:
|
|
2813
|
-
async (
|
|
2814
|
-
if (
|
|
2815
|
-
await
|
|
2811
|
+
function oe({ appearance: a, signUpUrl: r, onSignUp: s }) {
|
|
2812
|
+
const { appearance: l, settings: n } = D(), { signIn: u, signInWithOAuth: c, submitMfaCode: d, isLoading: i, error: o, setError: m } = na(), p = a ?? l, [g, v] = h(""), [x, y] = h(""), [P, N] = h(!1), [E, C] = h(!1), [f, O] = h(""), [I, F] = h(["", "", "", "", "", ""]), A = W([]), b = $(
|
|
2813
|
+
async (L) => {
|
|
2814
|
+
if (L.preventDefault(), E) {
|
|
2815
|
+
await d(f, I.join(""));
|
|
2816
2816
|
return;
|
|
2817
2817
|
}
|
|
2818
|
-
const
|
|
2819
|
-
|
|
2818
|
+
const k = await u(g, x);
|
|
2819
|
+
k && va(k) && (O(k.mfaToken), C(!0), m(null));
|
|
2820
2820
|
},
|
|
2821
|
-
[
|
|
2822
|
-
),
|
|
2823
|
-
async (
|
|
2824
|
-
await
|
|
2821
|
+
[g, x, E, f, I, u, d, m]
|
|
2822
|
+
), w = $(
|
|
2823
|
+
async (L) => {
|
|
2824
|
+
await c(L);
|
|
2825
2825
|
},
|
|
2826
|
-
[
|
|
2827
|
-
),
|
|
2828
|
-
var
|
|
2829
|
-
if (!/^\d*$/.test(
|
|
2830
|
-
const
|
|
2826
|
+
[c]
|
|
2827
|
+
), B = $((L, k) => {
|
|
2828
|
+
var _;
|
|
2829
|
+
if (!/^\d*$/.test(k)) return;
|
|
2830
|
+
const T = k.slice(-1);
|
|
2831
2831
|
F((K) => {
|
|
2832
2832
|
const J = [...K];
|
|
2833
|
-
return J[
|
|
2834
|
-
}),
|
|
2835
|
-
}, []),
|
|
2836
|
-
var
|
|
2837
|
-
|
|
2838
|
-
}, [
|
|
2839
|
-
return /* @__PURE__ */ e(
|
|
2833
|
+
return J[L] = T, J;
|
|
2834
|
+
}), T && L < 5 && ((_ = A.current[L + 1]) == null || _.focus());
|
|
2835
|
+
}, []), z = $((L, k) => {
|
|
2836
|
+
var T;
|
|
2837
|
+
k.key === "Backspace" && !I[L] && L > 0 && ((T = A.current[L - 1]) == null || T.focus());
|
|
2838
|
+
}, [I]), M = (n == null ? void 0 : n.googleEnabled) || (n == null ? void 0 : n.githubEnabled);
|
|
2839
|
+
return /* @__PURE__ */ e(j, { appearance: p, children: /* @__PURE__ */ e("div", { className: "ss-auth-card", children: /* @__PURE__ */ t("div", { className: "ss-auth-card-body", children: [
|
|
2840
2840
|
/* @__PURE__ */ t("div", { className: "ss-auth-header", children: [
|
|
2841
|
-
/* @__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: S.token }) }),
|
|
2842
2842
|
/* @__PURE__ */ e("h1", { className: "ss-auth-title", children: "Sign in to your account" }),
|
|
2843
2843
|
/* @__PURE__ */ e("p", { className: "ss-auth-subtitle", children: "Welcome back to your workspace" })
|
|
2844
2844
|
] }),
|
|
2845
|
-
!
|
|
2845
|
+
!E && M && /* @__PURE__ */ t(H, { children: [
|
|
2846
2846
|
/* @__PURE__ */ t("div", { className: "ss-auth-oauth-grid", children: [
|
|
2847
2847
|
(n == null ? void 0 : n.googleEnabled) && /* @__PURE__ */ t(
|
|
2848
2848
|
"button",
|
|
2849
2849
|
{
|
|
2850
2850
|
type: "button",
|
|
2851
2851
|
className: "ss-auth-btn-social",
|
|
2852
|
-
onClick: () =>
|
|
2853
|
-
disabled:
|
|
2852
|
+
onClick: () => w("google"),
|
|
2853
|
+
disabled: i,
|
|
2854
2854
|
children: [
|
|
2855
2855
|
/* @__PURE__ */ e("span", { dangerouslySetInnerHTML: { __html: ia } }),
|
|
2856
2856
|
"Google"
|
|
@@ -2862,8 +2862,8 @@ function re({ appearance: a, signUpUrl: s, onSignUp: r }) {
|
|
|
2862
2862
|
{
|
|
2863
2863
|
type: "button",
|
|
2864
2864
|
className: "ss-auth-btn-social",
|
|
2865
|
-
onClick: () =>
|
|
2866
|
-
disabled:
|
|
2865
|
+
onClick: () => w("github"),
|
|
2866
|
+
disabled: i,
|
|
2867
2867
|
children: [
|
|
2868
2868
|
/* @__PURE__ */ e("span", { dangerouslySetInnerHTML: { __html: la } }),
|
|
2869
2869
|
"GitHub"
|
|
@@ -2873,35 +2873,35 @@ function re({ appearance: a, signUpUrl: s, onSignUp: r }) {
|
|
|
2873
2873
|
] }),
|
|
2874
2874
|
/* @__PURE__ */ e("div", { className: "ss-auth-divider", children: "or continue with" })
|
|
2875
2875
|
] }),
|
|
2876
|
-
|
|
2877
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
2878
|
-
/* @__PURE__ */ e("span", { children:
|
|
2876
|
+
o && /* @__PURE__ */ t("div", { className: "ss-auth-error", children: [
|
|
2877
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.errorOutline }),
|
|
2878
|
+
/* @__PURE__ */ e("span", { children: o })
|
|
2879
2879
|
] }),
|
|
2880
|
-
/* @__PURE__ */ t("form", { onSubmit:
|
|
2881
|
-
|
|
2880
|
+
/* @__PURE__ */ t("form", { onSubmit: b, children: [
|
|
2881
|
+
E ? /* @__PURE__ */ t(H, { children: [
|
|
2882
2882
|
/* @__PURE__ */ e("div", { className: "ss-auth-mfa-divider", children: /* @__PURE__ */ e("span", { children: "Verification Required" }) }),
|
|
2883
2883
|
/* @__PURE__ */ t("div", { className: "ss-auth-field", children: [
|
|
2884
2884
|
/* @__PURE__ */ e("label", { className: "ss-auth-label", children: "6-Digit Code" }),
|
|
2885
|
-
/* @__PURE__ */ e("div", { className: "ss-auth-mfa-group", children:
|
|
2885
|
+
/* @__PURE__ */ e("div", { className: "ss-auth-mfa-group", children: I.map((L, k) => /* @__PURE__ */ e(
|
|
2886
2886
|
"input",
|
|
2887
2887
|
{
|
|
2888
|
-
ref: (
|
|
2889
|
-
|
|
2888
|
+
ref: (T) => {
|
|
2889
|
+
A.current[k] = T;
|
|
2890
2890
|
},
|
|
2891
2891
|
className: "ss-auth-mfa-digit",
|
|
2892
2892
|
type: "text",
|
|
2893
2893
|
inputMode: "numeric",
|
|
2894
2894
|
maxLength: 1,
|
|
2895
|
-
value:
|
|
2896
|
-
onChange: (
|
|
2897
|
-
onKeyDown: (
|
|
2898
|
-
autoFocus:
|
|
2895
|
+
value: L,
|
|
2896
|
+
onChange: (T) => B(k, T.target.value),
|
|
2897
|
+
onKeyDown: (T) => z(k, T),
|
|
2898
|
+
autoFocus: k === 0
|
|
2899
2899
|
},
|
|
2900
|
-
|
|
2900
|
+
k
|
|
2901
2901
|
)) }),
|
|
2902
2902
|
/* @__PURE__ */ e("p", { className: "ss-auth-mfa-hint", children: "We sent a 6-digit code to your registered email." })
|
|
2903
2903
|
] })
|
|
2904
|
-
] }) : /* @__PURE__ */ t(
|
|
2904
|
+
] }) : /* @__PURE__ */ t(H, { children: [
|
|
2905
2905
|
/* @__PURE__ */ t("div", { className: "ss-auth-field", children: [
|
|
2906
2906
|
/* @__PURE__ */ e("label", { className: "ss-auth-label", htmlFor: "ss-email", children: "Email Address" }),
|
|
2907
2907
|
/* @__PURE__ */ e(
|
|
@@ -2912,8 +2912,8 @@ function re({ appearance: a, signUpUrl: s, onSignUp: r }) {
|
|
|
2912
2912
|
type: "email",
|
|
2913
2913
|
autoComplete: "email",
|
|
2914
2914
|
placeholder: "name@company.com",
|
|
2915
|
-
value:
|
|
2916
|
-
onChange: (
|
|
2915
|
+
value: g,
|
|
2916
|
+
onChange: (L) => v(L.target.value),
|
|
2917
2917
|
required: !0
|
|
2918
2918
|
}
|
|
2919
2919
|
)
|
|
@@ -2929,11 +2929,11 @@ function re({ appearance: a, signUpUrl: s, onSignUp: r }) {
|
|
|
2929
2929
|
{
|
|
2930
2930
|
id: "ss-password",
|
|
2931
2931
|
className: "ss-auth-input",
|
|
2932
|
-
type:
|
|
2932
|
+
type: P ? "text" : "password",
|
|
2933
2933
|
autoComplete: "current-password",
|
|
2934
2934
|
placeholder: "••••••••",
|
|
2935
|
-
value:
|
|
2936
|
-
onChange: (
|
|
2935
|
+
value: x,
|
|
2936
|
+
onChange: (L) => y(L.target.value),
|
|
2937
2937
|
required: !0
|
|
2938
2938
|
}
|
|
2939
2939
|
),
|
|
@@ -2942,72 +2942,72 @@ function re({ appearance: a, signUpUrl: s, onSignUp: r }) {
|
|
|
2942
2942
|
{
|
|
2943
2943
|
type: "button",
|
|
2944
2944
|
className: "ss-auth-visibility-toggle",
|
|
2945
|
-
onClick: () =>
|
|
2946
|
-
children: /* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
2945
|
+
onClick: () => N(!P),
|
|
2946
|
+
children: /* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: P ? S.visibilityOff : S.visibility })
|
|
2947
2947
|
}
|
|
2948
2948
|
)
|
|
2949
2949
|
] })
|
|
2950
2950
|
] })
|
|
2951
2951
|
] }),
|
|
2952
|
-
/* @__PURE__ */ t("button", { type: "submit", className: "ss-auth-btn-primary", disabled:
|
|
2953
|
-
|
|
2954
|
-
|
|
2955
|
-
!
|
|
2952
|
+
/* @__PURE__ */ t("button", { type: "submit", className: "ss-auth-btn-primary", disabled: i, children: [
|
|
2953
|
+
i && /* @__PURE__ */ e("span", { className: "ss-auth-spinner" }),
|
|
2954
|
+
E ? "Verify" : "Sign in",
|
|
2955
|
+
!i && /* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.arrowForward })
|
|
2956
2956
|
] })
|
|
2957
2957
|
] }),
|
|
2958
|
-
|
|
2958
|
+
E ? /* @__PURE__ */ e("div", { className: "ss-auth-footer", children: /* @__PURE__ */ e(
|
|
2959
2959
|
"span",
|
|
2960
2960
|
{
|
|
2961
2961
|
className: "ss-auth-link",
|
|
2962
2962
|
onClick: () => {
|
|
2963
|
-
C(!1), F(["", "", "", "", "", ""]),
|
|
2963
|
+
C(!1), F(["", "", "", "", "", ""]), m(null);
|
|
2964
2964
|
},
|
|
2965
2965
|
children: "Back to sign in"
|
|
2966
2966
|
}
|
|
2967
2967
|
) }) : /* @__PURE__ */ t("div", { className: "ss-auth-footer", children: [
|
|
2968
2968
|
"Don't have an account?",
|
|
2969
2969
|
" ",
|
|
2970
|
-
|
|
2970
|
+
s ? /* @__PURE__ */ e("span", { className: "ss-auth-link", onClick: s, children: "Sign up" }) : r ? /* @__PURE__ */ e("a", { className: "ss-auth-link", href: r, children: "Sign up" }) : /* @__PURE__ */ e("span", { className: "ss-auth-link", children: "Sign up" })
|
|
2971
2971
|
] })
|
|
2972
2972
|
] }) }) });
|
|
2973
2973
|
}
|
|
2974
|
-
function
|
|
2975
|
-
const { appearance:
|
|
2976
|
-
async (
|
|
2977
|
-
if (
|
|
2978
|
-
|
|
2974
|
+
function ie({ appearance: a, signInUrl: r, onSignIn: s }) {
|
|
2975
|
+
const { appearance: l, settings: n } = D(), { signUp: u, isLoading: c, error: d, setError: i } = za(), { signInWithOAuth: o } = na(), m = a ?? l, [p, g] = h(""), [v, x] = h(""), [y, P] = h(""), [N, E] = h(!1), [C, f] = h(null), O = $(
|
|
2976
|
+
async (b) => {
|
|
2977
|
+
if (b.preventDefault(), f(null), v !== y) {
|
|
2978
|
+
f("Passwords do not match");
|
|
2979
2979
|
return;
|
|
2980
2980
|
}
|
|
2981
|
-
const
|
|
2982
|
-
if (
|
|
2983
|
-
|
|
2981
|
+
const w = (n == null ? void 0 : n.passwordMinLength) ?? 8;
|
|
2982
|
+
if (v.length < w) {
|
|
2983
|
+
f(`Password must be at least ${w} characters`);
|
|
2984
2984
|
return;
|
|
2985
2985
|
}
|
|
2986
|
-
await u(p,
|
|
2986
|
+
await u(p, v);
|
|
2987
2987
|
},
|
|
2988
|
-
[p,
|
|
2989
|
-
),
|
|
2990
|
-
async (
|
|
2991
|
-
await
|
|
2988
|
+
[p, v, y, n, u]
|
|
2989
|
+
), I = $(
|
|
2990
|
+
async (b) => {
|
|
2991
|
+
await o(b);
|
|
2992
2992
|
},
|
|
2993
|
-
[
|
|
2994
|
-
), F = (n == null ? void 0 : n.googleEnabled) || (n == null ? void 0 : n.githubEnabled),
|
|
2995
|
-
return /* @__PURE__ */ e(
|
|
2993
|
+
[o]
|
|
2994
|
+
), F = (n == null ? void 0 : n.googleEnabled) || (n == null ? void 0 : n.githubEnabled), A = C || d;
|
|
2995
|
+
return /* @__PURE__ */ e(j, { appearance: m, children: /* @__PURE__ */ t("div", { style: { display: "flex", flexDirection: "column", alignItems: "center", width: "100%", maxWidth: "520px" }, children: [
|
|
2996
2996
|
/* @__PURE__ */ t("div", { className: "ss-auth-header", children: [
|
|
2997
|
-
/* @__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: S.autoAwesome }) }),
|
|
2998
2998
|
/* @__PURE__ */ e("h1", { className: "ss-auth-title ss-auth-title-lg", children: "Create your account" }),
|
|
2999
2999
|
/* @__PURE__ */ e("p", { className: "ss-auth-subtitle", children: "Join the ecosystem" })
|
|
3000
3000
|
] }),
|
|
3001
3001
|
/* @__PURE__ */ e("div", { className: "ss-auth-card", children: /* @__PURE__ */ t("div", { className: "ss-auth-card-body", children: [
|
|
3002
|
-
F && /* @__PURE__ */ t(
|
|
3002
|
+
F && /* @__PURE__ */ t(H, { children: [
|
|
3003
3003
|
/* @__PURE__ */ t("div", { className: "ss-auth-oauth-grid", children: [
|
|
3004
3004
|
(n == null ? void 0 : n.googleEnabled) && /* @__PURE__ */ t(
|
|
3005
3005
|
"button",
|
|
3006
3006
|
{
|
|
3007
3007
|
type: "button",
|
|
3008
3008
|
className: "ss-auth-btn-social",
|
|
3009
|
-
onClick: () =>
|
|
3010
|
-
disabled:
|
|
3009
|
+
onClick: () => I("google"),
|
|
3010
|
+
disabled: c,
|
|
3011
3011
|
children: [
|
|
3012
3012
|
/* @__PURE__ */ e("span", { dangerouslySetInnerHTML: { __html: ia } }),
|
|
3013
3013
|
"Google"
|
|
@@ -3019,8 +3019,8 @@ function ne({ appearance: a, signInUrl: s, onSignIn: r }) {
|
|
|
3019
3019
|
{
|
|
3020
3020
|
type: "button",
|
|
3021
3021
|
className: "ss-auth-btn-social",
|
|
3022
|
-
onClick: () =>
|
|
3023
|
-
disabled:
|
|
3022
|
+
onClick: () => I("github"),
|
|
3023
|
+
disabled: c,
|
|
3024
3024
|
children: [
|
|
3025
3025
|
/* @__PURE__ */ e("span", { dangerouslySetInnerHTML: { __html: la } }),
|
|
3026
3026
|
"GitHub"
|
|
@@ -3030,11 +3030,11 @@ function ne({ appearance: a, signInUrl: s, onSignIn: r }) {
|
|
|
3030
3030
|
] }),
|
|
3031
3031
|
/* @__PURE__ */ e("div", { className: "ss-auth-divider", children: "or sign up with email" })
|
|
3032
3032
|
] }),
|
|
3033
|
-
|
|
3034
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
3035
|
-
/* @__PURE__ */ e("span", { children:
|
|
3033
|
+
A && /* @__PURE__ */ t("div", { className: "ss-auth-error", children: [
|
|
3034
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.errorOutline }),
|
|
3035
|
+
/* @__PURE__ */ e("span", { children: A })
|
|
3036
3036
|
] }),
|
|
3037
|
-
/* @__PURE__ */ t("form", { onSubmit:
|
|
3037
|
+
/* @__PURE__ */ t("form", { onSubmit: O, children: [
|
|
3038
3038
|
/* @__PURE__ */ t("div", { className: "ss-auth-field", children: [
|
|
3039
3039
|
/* @__PURE__ */ e("label", { className: "ss-auth-label", htmlFor: "ss-signup-email", children: "Email" }),
|
|
3040
3040
|
/* @__PURE__ */ e(
|
|
@@ -3046,7 +3046,7 @@ function ne({ appearance: a, signInUrl: s, onSignIn: r }) {
|
|
|
3046
3046
|
autoComplete: "email",
|
|
3047
3047
|
placeholder: "name@company.com",
|
|
3048
3048
|
value: p,
|
|
3049
|
-
onChange: (
|
|
3049
|
+
onChange: (b) => g(b.target.value),
|
|
3050
3050
|
required: !0
|
|
3051
3051
|
}
|
|
3052
3052
|
)
|
|
@@ -3059,12 +3059,12 @@ function ne({ appearance: a, signInUrl: s, onSignIn: r }) {
|
|
|
3059
3059
|
{
|
|
3060
3060
|
id: "ss-signup-password",
|
|
3061
3061
|
className: "ss-auth-input",
|
|
3062
|
-
type:
|
|
3062
|
+
type: N ? "text" : "password",
|
|
3063
3063
|
autoComplete: "new-password",
|
|
3064
3064
|
placeholder: "••••••••",
|
|
3065
|
-
value:
|
|
3066
|
-
onChange: (
|
|
3067
|
-
|
|
3065
|
+
value: v,
|
|
3066
|
+
onChange: (b) => {
|
|
3067
|
+
x(b.target.value), f(null);
|
|
3068
3068
|
},
|
|
3069
3069
|
required: !0
|
|
3070
3070
|
}
|
|
@@ -3074,8 +3074,8 @@ function ne({ appearance: a, signInUrl: s, onSignIn: r }) {
|
|
|
3074
3074
|
{
|
|
3075
3075
|
type: "button",
|
|
3076
3076
|
className: "ss-auth-visibility-toggle",
|
|
3077
|
-
onClick: () =>
|
|
3078
|
-
children: /* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
3077
|
+
onClick: () => E(!N),
|
|
3078
|
+
children: /* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: N ? S.visibilityOff : S.visibility })
|
|
3079
3079
|
}
|
|
3080
3080
|
)
|
|
3081
3081
|
] })
|
|
@@ -3091,86 +3091,85 @@ function ne({ appearance: a, signInUrl: s, onSignIn: r }) {
|
|
|
3091
3091
|
autoComplete: "new-password",
|
|
3092
3092
|
placeholder: "••••••••",
|
|
3093
3093
|
value: y,
|
|
3094
|
-
onChange: (
|
|
3095
|
-
|
|
3094
|
+
onChange: (b) => {
|
|
3095
|
+
P(b.target.value), f(null);
|
|
3096
3096
|
},
|
|
3097
3097
|
required: !0
|
|
3098
3098
|
}
|
|
3099
3099
|
)
|
|
3100
3100
|
] }),
|
|
3101
|
-
/* @__PURE__ */ t("button", { type: "submit", className: "ss-auth-btn-primary", disabled:
|
|
3102
|
-
|
|
3101
|
+
/* @__PURE__ */ t("button", { type: "submit", className: "ss-auth-btn-primary", disabled: c, children: [
|
|
3102
|
+
c && /* @__PURE__ */ e("span", { className: "ss-auth-spinner" }),
|
|
3103
3103
|
"Sign up",
|
|
3104
|
-
!
|
|
3104
|
+
!c && /* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.arrowForward })
|
|
3105
3105
|
] })
|
|
3106
3106
|
] }),
|
|
3107
3107
|
/* @__PURE__ */ t("div", { className: "ss-auth-footer", children: [
|
|
3108
3108
|
"Already have an account?",
|
|
3109
3109
|
" ",
|
|
3110
|
-
|
|
3110
|
+
s ? /* @__PURE__ */ e("span", { className: "ss-auth-link", onClick: s, children: "Sign in" }) : r ? /* @__PURE__ */ e("a", { className: "ss-auth-link", href: r, children: "Sign in" }) : /* @__PURE__ */ e("span", { className: "ss-auth-link", children: "Sign in" })
|
|
3111
3111
|
] })
|
|
3112
3112
|
] }) })
|
|
3113
3113
|
] }) });
|
|
3114
3114
|
}
|
|
3115
|
-
const
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
|
|
3134
|
-
f(!0), p.current = { x: h.clientX, y: h.clientY, ox: l.x, oy: l.y }, h.target.setPointerCapture(h.pointerId);
|
|
3115
|
+
const V = 320, q = 128, Oa = ba(function({ file: r, onCrop: s, onCancel: l }, n) {
|
|
3116
|
+
const u = W(null), c = W(null), [d, i] = h(1), [o, m] = h({ x: 0, y: 0 }), [p, g] = h(!1), v = W({ x: 0, y: 0, ox: 0, oy: 0 }), [x, y] = h(!1);
|
|
3117
|
+
U(() => {
|
|
3118
|
+
const f = new Image(), O = URL.createObjectURL(r);
|
|
3119
|
+
return f.onload = () => {
|
|
3120
|
+
c.current = f, y(!0), m({ x: 0, y: 0 }), i(1);
|
|
3121
|
+
}, f.src = O, () => URL.revokeObjectURL(O);
|
|
3122
|
+
}, [r]), U(() => {
|
|
3123
|
+
if (!x || !c.current || !u.current) return;
|
|
3124
|
+
const f = u.current.getContext("2d");
|
|
3125
|
+
if (!f) return;
|
|
3126
|
+
const O = c.current;
|
|
3127
|
+
f.clearRect(0, 0, V, V), f.fillStyle = "#111", f.fillRect(0, 0, V, V);
|
|
3128
|
+
const I = Math.max(V / O.width, V / O.height) * d, F = O.width * I, A = O.height * I, b = (V - F) / 2 + o.x, w = (V - A) / 2 + o.y;
|
|
3129
|
+
f.save(), f.beginPath(), f.arc(V / 2, V / 2, q, 0, Math.PI * 2), f.clip(), f.drawImage(O, b, w, F, A), f.restore(), f.save(), f.fillStyle = "rgba(0, 0, 0, 0.6)", f.fillRect(0, 0, V, V), f.globalCompositeOperation = "destination-out", f.beginPath(), f.arc(V / 2, V / 2, q, 0, Math.PI * 2), f.fill(), f.restore(), f.save(), f.beginPath(), f.arc(V / 2, V / 2, q, 0, Math.PI * 2), f.clip(), f.drawImage(O, b, w, F, A), f.restore(), f.strokeStyle = "rgba(255, 255, 255, 0.4)", f.lineWidth = 2, f.beginPath(), f.arc(V / 2, V / 2, q, 0, Math.PI * 2), f.stroke();
|
|
3130
|
+
}, [d, o, x]);
|
|
3131
|
+
const P = $(
|
|
3132
|
+
(f) => {
|
|
3133
|
+
g(!0), v.current = { x: f.clientX, y: f.clientY, ox: o.x, oy: o.y }, f.target.setPointerCapture(f.pointerId);
|
|
3135
3134
|
},
|
|
3136
|
-
[
|
|
3137
|
-
),
|
|
3138
|
-
(
|
|
3139
|
-
|
|
3140
|
-
x:
|
|
3141
|
-
y:
|
|
3135
|
+
[o]
|
|
3136
|
+
), N = $(
|
|
3137
|
+
(f) => {
|
|
3138
|
+
p && m({
|
|
3139
|
+
x: v.current.ox + (f.clientX - v.current.x),
|
|
3140
|
+
y: v.current.oy + (f.clientY - v.current.y)
|
|
3142
3141
|
});
|
|
3143
3142
|
},
|
|
3144
|
-
[
|
|
3145
|
-
),
|
|
3146
|
-
|
|
3147
|
-
|
|
3148
|
-
|
|
3149
|
-
|
|
3150
|
-
|
|
3151
|
-
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
S && s(S);
|
|
3143
|
+
[p]
|
|
3144
|
+
), E = $(() => g(!1), []), C = $(() => {
|
|
3145
|
+
if (!c.current) return;
|
|
3146
|
+
const f = document.createElement("canvas"), O = q * 2;
|
|
3147
|
+
f.width = O, f.height = O;
|
|
3148
|
+
const I = f.getContext("2d");
|
|
3149
|
+
if (!I) return;
|
|
3150
|
+
const F = c.current, A = Math.max(V / F.width, V / F.height) * d, b = F.width * A, w = F.height * A, B = (V - b) / 2 + o.x - (V / 2 - q), z = (V - w) / 2 + o.y - (V / 2 - q);
|
|
3151
|
+
I.beginPath(), I.arc(q, q, q, 0, Math.PI * 2), I.clip(), I.drawImage(F, B, z, b, w), f.toBlob((M) => {
|
|
3152
|
+
M && s(M);
|
|
3155
3153
|
}, "image/png");
|
|
3156
|
-
}, [
|
|
3154
|
+
}, [d, o, s]);
|
|
3155
|
+
return xa(n, () => ({ triggerCrop: () => C() }), [C]), /* @__PURE__ */ t("div", { style: { display: "flex", flexDirection: "column", alignItems: "center", gap: "24px" }, children: [
|
|
3157
3156
|
/* @__PURE__ */ t("div", { className: "ss-auth-crop-area", children: [
|
|
3158
3157
|
/* @__PURE__ */ e(
|
|
3159
3158
|
"canvas",
|
|
3160
3159
|
{
|
|
3161
|
-
ref:
|
|
3162
|
-
width:
|
|
3163
|
-
height:
|
|
3164
|
-
style: { cursor:
|
|
3165
|
-
onPointerDown:
|
|
3166
|
-
onPointerMove:
|
|
3167
|
-
onPointerUp:
|
|
3160
|
+
ref: u,
|
|
3161
|
+
width: V,
|
|
3162
|
+
height: V,
|
|
3163
|
+
style: { cursor: p ? "grabbing" : "grab", width: "100%", height: "100%" },
|
|
3164
|
+
onPointerDown: P,
|
|
3165
|
+
onPointerMove: N,
|
|
3166
|
+
onPointerUp: E
|
|
3168
3167
|
}
|
|
3169
3168
|
),
|
|
3170
3169
|
/* @__PURE__ */ e("div", { className: "ss-auth-crop-size-badge", children: "256 x 256 px" })
|
|
3171
3170
|
] }),
|
|
3172
3171
|
/* @__PURE__ */ t("div", { className: "ss-auth-zoom-control", style: { width: "100%", maxWidth: "280px" }, children: [
|
|
3173
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
3172
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.zoomOut }),
|
|
3174
3173
|
/* @__PURE__ */ e(
|
|
3175
3174
|
"input",
|
|
3176
3175
|
{
|
|
@@ -3178,161 +3177,158 @@ function za({ file: a, onCrop: s, onCancel: r }) {
|
|
|
3178
3177
|
min: "1",
|
|
3179
3178
|
max: "3",
|
|
3180
3179
|
step: "0.01",
|
|
3181
|
-
value:
|
|
3182
|
-
onChange: (
|
|
3180
|
+
value: d,
|
|
3181
|
+
onChange: (f) => i(parseFloat(f.target.value)),
|
|
3183
3182
|
className: "ss-auth-zoom-slider"
|
|
3184
3183
|
}
|
|
3185
3184
|
),
|
|
3186
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
3185
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.zoomIn })
|
|
3187
3186
|
] })
|
|
3188
3187
|
] });
|
|
3189
|
-
}
|
|
3190
|
-
function ca({ onUpload: a, onClose:
|
|
3191
|
-
const [
|
|
3192
|
-
if (!
|
|
3193
|
-
|
|
3188
|
+
});
|
|
3189
|
+
function ca({ onUpload: a, onClose: r, isLoading: s }) {
|
|
3190
|
+
const [l, n] = h(null), [u, c] = h(!1), [d, i] = h(null), o = W(null), m = W(null), p = $((x) => {
|
|
3191
|
+
if (!x.type.startsWith("image/")) {
|
|
3192
|
+
i("Please select an image file");
|
|
3194
3193
|
return;
|
|
3195
3194
|
}
|
|
3196
|
-
if (
|
|
3197
|
-
|
|
3195
|
+
if (x.size > 5 * 1024 * 1024) {
|
|
3196
|
+
i("Image must be smaller than 5 MB");
|
|
3198
3197
|
return;
|
|
3199
3198
|
}
|
|
3200
|
-
|
|
3201
|
-
}, []),
|
|
3202
|
-
(
|
|
3203
|
-
|
|
3204
|
-
const
|
|
3205
|
-
|
|
3199
|
+
i(null), n(x);
|
|
3200
|
+
}, []), g = $(
|
|
3201
|
+
(x) => {
|
|
3202
|
+
x.preventDefault(), c(!1);
|
|
3203
|
+
const y = x.dataTransfer.files[0];
|
|
3204
|
+
y && p(y);
|
|
3206
3205
|
},
|
|
3207
|
-
[
|
|
3208
|
-
),
|
|
3209
|
-
async (
|
|
3210
|
-
await a(
|
|
3206
|
+
[p]
|
|
3207
|
+
), v = $(
|
|
3208
|
+
async (x) => {
|
|
3209
|
+
await a(x);
|
|
3211
3210
|
},
|
|
3212
3211
|
[a]
|
|
3213
3212
|
);
|
|
3214
|
-
return /* @__PURE__ */ e("div", { className: "ss-auth-modal-overlay", onClick: (
|
|
3215
|
-
|
|
3216
|
-
}, children: /* @__PURE__ */ t("div", { className: "ss-auth-modal
|
|
3213
|
+
return /* @__PURE__ */ e("div", { className: "ss-auth-modal-overlay", onClick: (x) => {
|
|
3214
|
+
x.target === x.currentTarget && r();
|
|
3215
|
+
}, children: /* @__PURE__ */ t("div", { className: "ss-auth-modal", style: { maxWidth: "480px" }, children: [
|
|
3217
3216
|
/* @__PURE__ */ t("div", { className: "ss-auth-modal-header", children: [
|
|
3218
3217
|
/* @__PURE__ */ e("h2", { children: "Upload avatar" }),
|
|
3219
|
-
/* @__PURE__ */ e("button", { type: "button", className: "ss-auth-modal-close", onClick:
|
|
3218
|
+
/* @__PURE__ */ e("button", { type: "button", className: "ss-auth-modal-close", onClick: r, children: /* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.close }) })
|
|
3220
3219
|
] }),
|
|
3221
3220
|
/* @__PURE__ */ t("div", { className: "ss-auth-modal-body", children: [
|
|
3222
|
-
|
|
3223
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
3224
|
-
/* @__PURE__ */ e("span", { children:
|
|
3221
|
+
d && /* @__PURE__ */ t("div", { className: "ss-auth-error", style: { marginBottom: "16px" }, children: [
|
|
3222
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.errorOutline }),
|
|
3223
|
+
/* @__PURE__ */ e("span", { children: d })
|
|
3225
3224
|
] }),
|
|
3226
|
-
/* @__PURE__ */ t(
|
|
3227
|
-
/* @__PURE__ */ e(
|
|
3228
|
-
|
|
3225
|
+
l ? /* @__PURE__ */ t(H, { children: [
|
|
3226
|
+
/* @__PURE__ */ e(Oa, { ref: m, file: l, onCrop: v, onCancel: () => n(null) }),
|
|
3227
|
+
/* @__PURE__ */ e("div", { style: { textAlign: "center", marginTop: "8px" }, children: /* @__PURE__ */ t(
|
|
3228
|
+
"button",
|
|
3229
3229
|
{
|
|
3230
|
-
|
|
3231
|
-
|
|
3232
|
-
|
|
3233
|
-
|
|
3234
|
-
|
|
3235
|
-
|
|
3236
|
-
gap: "8px",
|
|
3237
|
-
width: "100%",
|
|
3238
|
-
aspectRatio: "1"
|
|
3230
|
+
type: "button",
|
|
3231
|
+
className: "ss-auth-btn-ghost",
|
|
3232
|
+
style: { fontSize: "13px" },
|
|
3233
|
+
onClick: () => {
|
|
3234
|
+
var x;
|
|
3235
|
+
return (x = o.current) == null ? void 0 : x.click();
|
|
3239
3236
|
},
|
|
3240
3237
|
children: [
|
|
3241
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", style: { fontSize: "
|
|
3242
|
-
|
|
3238
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", style: { fontSize: "16px" }, children: S.image }),
|
|
3239
|
+
"Change image"
|
|
3243
3240
|
]
|
|
3244
3241
|
}
|
|
3245
|
-
) })
|
|
3246
|
-
|
|
3247
|
-
|
|
3248
|
-
|
|
3249
|
-
|
|
3250
|
-
|
|
3251
|
-
|
|
3252
|
-
|
|
3253
|
-
|
|
3254
|
-
|
|
3255
|
-
|
|
3256
|
-
|
|
3257
|
-
|
|
3258
|
-
|
|
3259
|
-
|
|
3260
|
-
|
|
3261
|
-
|
|
3262
|
-
|
|
3263
|
-
|
|
3264
|
-
|
|
3265
|
-
|
|
3266
|
-
|
|
3267
|
-
|
|
3268
|
-
|
|
3269
|
-
|
|
3270
|
-
|
|
3271
|
-
|
|
3272
|
-
|
|
3273
|
-
|
|
3274
|
-
|
|
3275
|
-
|
|
3276
|
-
|
|
3277
|
-
|
|
3278
|
-
|
|
3279
|
-
|
|
3280
|
-
|
|
3281
|
-
|
|
3282
|
-
|
|
3283
|
-
|
|
3284
|
-
|
|
3285
|
-
|
|
3286
|
-
|
|
3287
|
-
|
|
3288
|
-
/* @__PURE__ */ e("span", { children: "Your profile photo will be visible to all members of your organization." })
|
|
3289
|
-
] })
|
|
3290
|
-
] })
|
|
3242
|
+
) })
|
|
3243
|
+
] }) : /* @__PURE__ */ t(
|
|
3244
|
+
"div",
|
|
3245
|
+
{
|
|
3246
|
+
className: `ss-auth-dropzone${u ? " ss-auth-dropzone-active" : ""}`,
|
|
3247
|
+
onDragOver: (x) => {
|
|
3248
|
+
x.preventDefault(), c(!0);
|
|
3249
|
+
},
|
|
3250
|
+
onDragLeave: () => c(!1),
|
|
3251
|
+
onDrop: g,
|
|
3252
|
+
onClick: () => {
|
|
3253
|
+
var x;
|
|
3254
|
+
return (x = o.current) == null ? void 0 : x.click();
|
|
3255
|
+
},
|
|
3256
|
+
style: { minHeight: "240px" },
|
|
3257
|
+
children: [
|
|
3258
|
+
/* @__PURE__ */ e("div", { className: "ss-auth-dropzone-icon", children: /* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.cloudUpload }) }),
|
|
3259
|
+
/* @__PURE__ */ e("span", { className: "ss-auth-dropzone-title", children: "Drag and drop" }),
|
|
3260
|
+
/* @__PURE__ */ t("span", { className: "ss-auth-dropzone-desc", children: [
|
|
3261
|
+
"JPG, PNG or WEBP",
|
|
3262
|
+
/* @__PURE__ */ e("br", {}),
|
|
3263
|
+
"Max file size 5 MB"
|
|
3264
|
+
] }),
|
|
3265
|
+
/* @__PURE__ */ e("button", { type: "button", className: "ss-auth-dropzone-btn", children: "Choose File" })
|
|
3266
|
+
]
|
|
3267
|
+
}
|
|
3268
|
+
),
|
|
3269
|
+
/* @__PURE__ */ e(
|
|
3270
|
+
"input",
|
|
3271
|
+
{
|
|
3272
|
+
ref: o,
|
|
3273
|
+
type: "file",
|
|
3274
|
+
accept: "image/*",
|
|
3275
|
+
style: { display: "none" },
|
|
3276
|
+
onChange: (x) => {
|
|
3277
|
+
var y;
|
|
3278
|
+
(y = x.target.files) != null && y[0] && p(x.target.files[0]);
|
|
3279
|
+
}
|
|
3280
|
+
}
|
|
3281
|
+
),
|
|
3282
|
+
/* @__PURE__ */ t("div", { className: "ss-auth-info-box", style: { marginTop: "16px" }, children: [
|
|
3283
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.info }),
|
|
3284
|
+
/* @__PURE__ */ e("span", { children: "Your profile photo will be visible to all members of your organization." })
|
|
3291
3285
|
] })
|
|
3292
3286
|
] }),
|
|
3293
3287
|
/* @__PURE__ */ t("div", { className: "ss-auth-modal-footer", children: [
|
|
3294
|
-
/* @__PURE__ */ e("button", { type: "button", className: "ss-auth-btn-ghost", onClick:
|
|
3288
|
+
/* @__PURE__ */ e("button", { type: "button", className: "ss-auth-btn-ghost", onClick: r, children: "Cancel" }),
|
|
3295
3289
|
/* @__PURE__ */ t(
|
|
3296
3290
|
"button",
|
|
3297
3291
|
{
|
|
3298
3292
|
type: "button",
|
|
3299
3293
|
className: "ss-auth-btn-primary ss-auth-btn-sm",
|
|
3300
3294
|
onClick: () => {
|
|
3295
|
+
var x;
|
|
3296
|
+
return (x = m.current) == null ? void 0 : x.triggerCrop();
|
|
3301
3297
|
},
|
|
3302
|
-
disabled: !
|
|
3298
|
+
disabled: !l || s,
|
|
3303
3299
|
style: { width: "auto" },
|
|
3304
3300
|
children: [
|
|
3305
|
-
|
|
3301
|
+
s && /* @__PURE__ */ e("span", { className: "ss-auth-spinner" }),
|
|
3306
3302
|
"Save Profile",
|
|
3307
|
-
!
|
|
3303
|
+
!s && /* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.check })
|
|
3308
3304
|
]
|
|
3309
3305
|
}
|
|
3310
3306
|
)
|
|
3311
3307
|
] })
|
|
3312
3308
|
] }) });
|
|
3313
3309
|
}
|
|
3314
|
-
function
|
|
3315
|
-
const [
|
|
3316
|
-
{ key: "profile", label: "Profile", icon:
|
|
3317
|
-
{ key: "organization", label: "Organization", icon:
|
|
3318
|
-
{ key: "people", label: "People", icon:
|
|
3319
|
-
{ key: "billing", label: "Billing", icon:
|
|
3310
|
+
function Ea({ onClose: a, afterDeleteAccountUrl: r, defaultTab: s = "profile", onOrgDeleted: l, onOrgUpdated: n }) {
|
|
3311
|
+
const [u, c] = h(s), d = [
|
|
3312
|
+
{ key: "profile", label: "Profile", icon: S.person },
|
|
3313
|
+
{ key: "organization", label: "Organization", icon: S.corporateFare },
|
|
3314
|
+
{ key: "people", label: "People", icon: S.group },
|
|
3315
|
+
{ key: "billing", label: "Billing", icon: S.creditCard }
|
|
3320
3316
|
];
|
|
3321
3317
|
return /* @__PURE__ */ t("div", { className: "ss-auth-settings-page", children: [
|
|
3322
3318
|
/* @__PURE__ */ t("div", { className: "ss-auth-settings-header", children: [
|
|
3323
3319
|
/* @__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:
|
|
3320
|
+
/* @__PURE__ */ e("button", { type: "button", className: "ss-auth-settings-back", onClick: a, children: /* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.arrowBack }) }),
|
|
3325
3321
|
/* @__PURE__ */ e("h2", { children: "Settings" })
|
|
3326
3322
|
] }),
|
|
3327
|
-
/* @__PURE__ */ e("button", { type: "button", className: "ss-auth-modal-close", onClick: a, children: /* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
3323
|
+
/* @__PURE__ */ e("button", { type: "button", className: "ss-auth-modal-close", onClick: a, children: /* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.close }) })
|
|
3328
3324
|
] }),
|
|
3329
3325
|
/* @__PURE__ */ t("div", { className: "ss-auth-settings-layout", children: [
|
|
3330
|
-
/* @__PURE__ */ e("nav", { className: "ss-auth-settings-nav", children:
|
|
3326
|
+
/* @__PURE__ */ e("nav", { className: "ss-auth-settings-nav", children: d.map((i) => /* @__PURE__ */ t(
|
|
3331
3327
|
"button",
|
|
3332
3328
|
{
|
|
3333
3329
|
type: "button",
|
|
3334
|
-
className: `ss-auth-settings-nav-item${
|
|
3335
|
-
onClick: () =>
|
|
3330
|
+
className: `ss-auth-settings-nav-item${u === i.key ? " ss-auth-settings-nav-item-active" : ""}`,
|
|
3331
|
+
onClick: () => c(i.key),
|
|
3336
3332
|
children: [
|
|
3337
3333
|
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: i.icon }),
|
|
3338
3334
|
i.label
|
|
@@ -3341,48 +3337,48 @@ function Pa({ onClose: a, afterDeleteAccountUrl: s, defaultTab: r = "profile" })
|
|
|
3341
3337
|
i.key
|
|
3342
3338
|
)) }),
|
|
3343
3339
|
/* @__PURE__ */ t("div", { className: "ss-auth-settings-content", children: [
|
|
3344
|
-
|
|
3345
|
-
|
|
3346
|
-
|
|
3347
|
-
|
|
3340
|
+
u === "profile" && /* @__PURE__ */ e(Ia, { afterDeleteAccountUrl: r }),
|
|
3341
|
+
u === "organization" && /* @__PURE__ */ e(Ba, { onOrgDeleted: l, onOrgUpdated: n }),
|
|
3342
|
+
u === "people" && /* @__PURE__ */ e(Fa, {}),
|
|
3343
|
+
u === "billing" && /* @__PURE__ */ e(La, {})
|
|
3348
3344
|
] })
|
|
3349
3345
|
] })
|
|
3350
3346
|
] });
|
|
3351
3347
|
}
|
|
3352
|
-
function
|
|
3353
|
-
const { user:
|
|
3348
|
+
function Ia({ afterDeleteAccountUrl: a }) {
|
|
3349
|
+
const { user: r, updateProfile: s, uploadAvatar: l, changePassword: n, isLoading: u, error: c, success: d, setError: i, setSuccess: o } = oa(), { signOut: m } = sa(), { deleteAccount: p, isLoading: g, error: v, setError: x } = Pa(), [y, P] = h((r == null ? void 0 : r.name) ?? ""), [N, E] = h((r == null ? void 0 : r.avatarUrl) ?? ""), [C, f] = h(!1), [O, I] = h(""), [F, A] = h(""), [b, w] = h(""), [B, z] = h(null), [M, L] = h(!1), [k, T] = h(""), _ = $(
|
|
3354
3350
|
async (R) => {
|
|
3355
|
-
R.preventDefault(),
|
|
3351
|
+
R.preventDefault(), i(null), o(null), await s({ name: y, avatarUrl: N || void 0 });
|
|
3356
3352
|
},
|
|
3357
|
-
[y,
|
|
3358
|
-
), K =
|
|
3353
|
+
[y, N, s, i, o]
|
|
3354
|
+
), K = $(
|
|
3359
3355
|
async (R) => {
|
|
3360
|
-
const X = await
|
|
3361
|
-
X && (
|
|
3356
|
+
const X = await l(R);
|
|
3357
|
+
X && (E(X.avatarUrl), f(!1));
|
|
3362
3358
|
},
|
|
3363
|
-
[
|
|
3364
|
-
), J =
|
|
3359
|
+
[l]
|
|
3360
|
+
), J = $(
|
|
3365
3361
|
async (R) => {
|
|
3366
|
-
if (R.preventDefault(),
|
|
3367
|
-
|
|
3362
|
+
if (R.preventDefault(), z(null), i(null), o(null), F !== b) {
|
|
3363
|
+
z("Passwords do not match");
|
|
3368
3364
|
return;
|
|
3369
3365
|
}
|
|
3370
3366
|
if (F.length < 8) {
|
|
3371
|
-
|
|
3367
|
+
z("Password must be at least 8 characters");
|
|
3372
3368
|
return;
|
|
3373
3369
|
}
|
|
3374
|
-
await n(
|
|
3370
|
+
await n(O, F) && (I(""), A(""), w(""));
|
|
3375
3371
|
},
|
|
3376
|
-
[
|
|
3377
|
-
), ua =
|
|
3378
|
-
await p() && (await
|
|
3379
|
-
}, [p,
|
|
3380
|
-
return /* @__PURE__ */ t(
|
|
3372
|
+
[O, F, b, n, i, o]
|
|
3373
|
+
), ua = $(async () => {
|
|
3374
|
+
await p() && (await m(), a && (window.location.href = a));
|
|
3375
|
+
}, [p, m, a]), pa = (r == null ? void 0 : r.provider) === "email", ha = k === (r == null ? void 0 : r.email), ga = ((r == null ? void 0 : r.name) || (r == null ? void 0 : r.email) || "?").charAt(0).toUpperCase();
|
|
3376
|
+
return /* @__PURE__ */ t(H, { children: [
|
|
3381
3377
|
/* @__PURE__ */ e("h3", { children: "Profile" }),
|
|
3382
3378
|
/* @__PURE__ */ t("div", { className: "ss-auth-settings-card", children: [
|
|
3383
3379
|
/* @__PURE__ */ t("div", { className: "ss-auth-profile-header", style: { border: "none", background: "none", padding: 0, marginBottom: 16 }, children: [
|
|
3384
|
-
/* @__PURE__ */ t("div", { className: "ss-auth-avatar-lg", onClick: () =>
|
|
3385
|
-
|
|
3380
|
+
/* @__PURE__ */ t("div", { className: "ss-auth-avatar-lg", onClick: () => f(!0), children: [
|
|
3381
|
+
N ? /* @__PURE__ */ e("img", { src: N, alt: "" }) : /* @__PURE__ */ e("div", { style: {
|
|
3386
3382
|
width: "100%",
|
|
3387
3383
|
height: "100%",
|
|
3388
3384
|
display: "flex",
|
|
@@ -3393,30 +3389,30 @@ function Oa({ afterDeleteAccountUrl: a }) {
|
|
|
3393
3389
|
opacity: 0.4
|
|
3394
3390
|
}, children: ga }),
|
|
3395
3391
|
/* @__PURE__ */ t("div", { className: "ss-auth-avatar-overlay", children: [
|
|
3396
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
3392
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.camera }),
|
|
3397
3393
|
/* @__PURE__ */ e("span", { children: "Edit" })
|
|
3398
3394
|
] })
|
|
3399
3395
|
] }),
|
|
3400
3396
|
/* @__PURE__ */ t("div", { className: "ss-auth-profile-info", children: [
|
|
3401
3397
|
/* @__PURE__ */ t("h2", { className: "ss-auth-profile-name", children: [
|
|
3402
|
-
(
|
|
3403
|
-
(
|
|
3404
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", style: { fontSize: "12px", fontVariationSettings: "'FILL' 1" }, children:
|
|
3398
|
+
(r == null ? void 0 : r.name) || "Unnamed User",
|
|
3399
|
+
(r == null ? void 0 : r.emailVerified) && /* @__PURE__ */ t("span", { className: "ss-auth-badge ss-auth-badge-success", children: [
|
|
3400
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", style: { fontSize: "12px", fontVariationSettings: "'FILL' 1" }, children: S.verified }),
|
|
3405
3401
|
"Verified"
|
|
3406
3402
|
] })
|
|
3407
3403
|
] }),
|
|
3408
|
-
/* @__PURE__ */ e("p", { className: "ss-auth-profile-desc", children:
|
|
3404
|
+
/* @__PURE__ */ e("p", { className: "ss-auth-profile-desc", children: r == null ? void 0 : r.email })
|
|
3409
3405
|
] })
|
|
3410
3406
|
] }),
|
|
3411
|
-
|
|
3412
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
3413
|
-
/* @__PURE__ */ e("span", { children:
|
|
3407
|
+
c && /* @__PURE__ */ t("div", { className: "ss-auth-error", children: [
|
|
3408
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.errorOutline }),
|
|
3409
|
+
/* @__PURE__ */ e("span", { children: c })
|
|
3414
3410
|
] }),
|
|
3415
|
-
|
|
3416
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
3417
|
-
/* @__PURE__ */ e("span", { children:
|
|
3411
|
+
d && /* @__PURE__ */ t("div", { className: "ss-auth-info-box", style: { marginBottom: "16px" }, children: [
|
|
3412
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.check }),
|
|
3413
|
+
/* @__PURE__ */ e("span", { children: d })
|
|
3418
3414
|
] }),
|
|
3419
|
-
/* @__PURE__ */ t("form", { onSubmit:
|
|
3415
|
+
/* @__PURE__ */ t("form", { onSubmit: _, children: [
|
|
3420
3416
|
/* @__PURE__ */ t("div", { className: "ss-auth-field", children: [
|
|
3421
3417
|
/* @__PURE__ */ e("label", { className: "ss-auth-label", children: "Full Name" }),
|
|
3422
3418
|
/* @__PURE__ */ e(
|
|
@@ -3426,7 +3422,7 @@ function Oa({ afterDeleteAccountUrl: a }) {
|
|
|
3426
3422
|
type: "text",
|
|
3427
3423
|
placeholder: "Your name",
|
|
3428
3424
|
value: y,
|
|
3429
|
-
onChange: (R) =>
|
|
3425
|
+
onChange: (R) => P(R.target.value)
|
|
3430
3426
|
}
|
|
3431
3427
|
)
|
|
3432
3428
|
] }),
|
|
@@ -3434,13 +3430,13 @@ function Oa({ afterDeleteAccountUrl: a }) {
|
|
|
3434
3430
|
/* @__PURE__ */ t("div", { children: [
|
|
3435
3431
|
/* @__PURE__ */ e("label", { className: "ss-auth-label", children: "Email Address" }),
|
|
3436
3432
|
/* @__PURE__ */ t("div", { style: { position: "relative" }, children: [
|
|
3437
|
-
/* @__PURE__ */ e("input", { className: "ss-auth-input ss-auth-input-readonly", type: "email", value: (
|
|
3438
|
-
/* @__PURE__ */ e("span", { className: "ss-auth-visibility-toggle", style: { cursor: "default" }, children: /* @__PURE__ */ e("span", { className: "material-symbols-outlined", style: { fontSize: "18px" }, children:
|
|
3433
|
+
/* @__PURE__ */ e("input", { className: "ss-auth-input ss-auth-input-readonly", type: "email", value: (r == null ? void 0 : r.email) ?? "", readOnly: !0 }),
|
|
3434
|
+
/* @__PURE__ */ e("span", { className: "ss-auth-visibility-toggle", style: { cursor: "default" }, children: /* @__PURE__ */ e("span", { className: "material-symbols-outlined", style: { fontSize: "18px" }, children: S.lock }) })
|
|
3439
3435
|
] })
|
|
3440
3436
|
] }),
|
|
3441
3437
|
/* @__PURE__ */ t("div", { children: [
|
|
3442
3438
|
/* @__PURE__ */ e("label", { className: "ss-auth-label", children: "Auth Provider" }),
|
|
3443
|
-
/* @__PURE__ */ e("input", { className: "ss-auth-input ss-auth-input-readonly", type: "text", value: (
|
|
3439
|
+
/* @__PURE__ */ e("input", { className: "ss-auth-input ss-auth-input-readonly", type: "text", value: (r == null ? void 0 : r.provider) ?? "", readOnly: !0 })
|
|
3444
3440
|
] })
|
|
3445
3441
|
] }),
|
|
3446
3442
|
/* @__PURE__ */ e("div", { style: { display: "flex", justifyContent: "flex-end" }, children: /* @__PURE__ */ t("button", { type: "submit", className: "ss-auth-btn-primary ss-auth-btn-sm", disabled: u, style: { width: "auto" }, children: [
|
|
@@ -3451,26 +3447,26 @@ function Oa({ afterDeleteAccountUrl: a }) {
|
|
|
3451
3447
|
] }),
|
|
3452
3448
|
pa && /* @__PURE__ */ t("div", { className: "ss-auth-settings-card", children: [
|
|
3453
3449
|
/* @__PURE__ */ t("h4", { children: [
|
|
3454
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
3450
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.security }),
|
|
3455
3451
|
"Security Credentials"
|
|
3456
3452
|
] }),
|
|
3457
|
-
|
|
3458
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
3459
|
-
/* @__PURE__ */ e("span", { children:
|
|
3453
|
+
B && /* @__PURE__ */ t("div", { className: "ss-auth-error", style: { marginBottom: "16px" }, children: [
|
|
3454
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.errorOutline }),
|
|
3455
|
+
/* @__PURE__ */ e("span", { children: B })
|
|
3460
3456
|
] }),
|
|
3461
3457
|
/* @__PURE__ */ t("form", { onSubmit: J, children: [
|
|
3462
3458
|
/* @__PURE__ */ t("div", { className: "ss-auth-field", children: [
|
|
3463
3459
|
/* @__PURE__ */ e("label", { className: "ss-auth-label", children: "Current Password" }),
|
|
3464
|
-
/* @__PURE__ */ e("input", { className: "ss-auth-input", type: "password", placeholder: "••••••••••••", value:
|
|
3460
|
+
/* @__PURE__ */ e("input", { className: "ss-auth-input", type: "password", placeholder: "••••••••••••", value: O, onChange: (R) => I(R.target.value), required: !0 })
|
|
3465
3461
|
] }),
|
|
3466
3462
|
/* @__PURE__ */ t("div", { className: "ss-auth-profile-grid", style: { marginBottom: "16px" }, children: [
|
|
3467
3463
|
/* @__PURE__ */ t("div", { children: [
|
|
3468
3464
|
/* @__PURE__ */ e("label", { className: "ss-auth-label", children: "New Password" }),
|
|
3469
|
-
/* @__PURE__ */ e("input", { className: "ss-auth-input", type: "password", placeholder: "Min. 8 characters", value: F, onChange: (R) =>
|
|
3465
|
+
/* @__PURE__ */ e("input", { className: "ss-auth-input", type: "password", placeholder: "Min. 8 characters", value: F, onChange: (R) => A(R.target.value), required: !0 })
|
|
3470
3466
|
] }),
|
|
3471
3467
|
/* @__PURE__ */ t("div", { children: [
|
|
3472
3468
|
/* @__PURE__ */ e("label", { className: "ss-auth-label", children: "Confirm New Password" }),
|
|
3473
|
-
/* @__PURE__ */ e("input", { className: "ss-auth-input", type: "password", placeholder: "Repeat new password", value:
|
|
3469
|
+
/* @__PURE__ */ e("input", { className: "ss-auth-input", type: "password", placeholder: "Repeat new password", value: b, onChange: (R) => w(R.target.value), required: !0 })
|
|
3474
3470
|
] })
|
|
3475
3471
|
] }),
|
|
3476
3472
|
/* @__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" }) })
|
|
@@ -3479,11 +3475,11 @@ function Oa({ afterDeleteAccountUrl: a }) {
|
|
|
3479
3475
|
/* @__PURE__ */ t("div", { className: "ss-auth-settings-card ss-auth-settings-danger", children: [
|
|
3480
3476
|
/* @__PURE__ */ e("h4", { children: "Danger Zone" }),
|
|
3481
3477
|
/* @__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." }),
|
|
3482
|
-
|
|
3483
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
3484
|
-
/* @__PURE__ */ e("span", { children:
|
|
3478
|
+
v && /* @__PURE__ */ t("div", { className: "ss-auth-error", children: [
|
|
3479
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.errorOutline }),
|
|
3480
|
+
/* @__PURE__ */ e("span", { children: v })
|
|
3485
3481
|
] }),
|
|
3486
|
-
|
|
3482
|
+
M ? /* @__PURE__ */ t("div", { children: [
|
|
3487
3483
|
/* @__PURE__ */ t("div", { className: "ss-auth-field", children: [
|
|
3488
3484
|
/* @__PURE__ */ e("label", { className: "ss-auth-label", children: "Type your email to confirm" }),
|
|
3489
3485
|
/* @__PURE__ */ e(
|
|
@@ -3491,9 +3487,9 @@ function Oa({ afterDeleteAccountUrl: a }) {
|
|
|
3491
3487
|
{
|
|
3492
3488
|
className: "ss-auth-input",
|
|
3493
3489
|
type: "email",
|
|
3494
|
-
placeholder:
|
|
3495
|
-
value:
|
|
3496
|
-
onChange: (R) =>
|
|
3490
|
+
placeholder: r == null ? void 0 : r.email,
|
|
3491
|
+
value: k,
|
|
3492
|
+
onChange: (R) => T(R.target.value),
|
|
3497
3493
|
autoFocus: !0
|
|
3498
3494
|
}
|
|
3499
3495
|
)
|
|
@@ -3505,7 +3501,7 @@ function Oa({ afterDeleteAccountUrl: a }) {
|
|
|
3505
3501
|
type: "button",
|
|
3506
3502
|
className: "ss-auth-btn-ghost",
|
|
3507
3503
|
onClick: () => {
|
|
3508
|
-
|
|
3504
|
+
L(!1), T(""), x(null);
|
|
3509
3505
|
},
|
|
3510
3506
|
children: "Cancel"
|
|
3511
3507
|
}
|
|
@@ -3516,10 +3512,10 @@ function Oa({ afterDeleteAccountUrl: a }) {
|
|
|
3516
3512
|
type: "button",
|
|
3517
3513
|
className: "ss-auth-btn-primary ss-auth-btn-sm",
|
|
3518
3514
|
style: { width: "auto", background: "linear-gradient(135deg, #ef4444, #dc2626)" },
|
|
3519
|
-
disabled: !ha ||
|
|
3515
|
+
disabled: !ha || g,
|
|
3520
3516
|
onClick: ua,
|
|
3521
3517
|
children: [
|
|
3522
|
-
|
|
3518
|
+
g && /* @__PURE__ */ e("span", { className: "ss-auth-spinner" }),
|
|
3523
3519
|
"Delete account"
|
|
3524
3520
|
]
|
|
3525
3521
|
}
|
|
@@ -3531,7 +3527,7 @@ function Oa({ afterDeleteAccountUrl: a }) {
|
|
|
3531
3527
|
type: "button",
|
|
3532
3528
|
className: "ss-auth-btn-outline",
|
|
3533
3529
|
style: { borderColor: "currentColor", width: "auto" },
|
|
3534
|
-
onClick: () =>
|
|
3530
|
+
onClick: () => L(!0),
|
|
3535
3531
|
children: "Delete my account"
|
|
3536
3532
|
}
|
|
3537
3533
|
)
|
|
@@ -3540,48 +3536,57 @@ function Oa({ afterDeleteAccountUrl: a }) {
|
|
|
3540
3536
|
ca,
|
|
3541
3537
|
{
|
|
3542
3538
|
onUpload: K,
|
|
3543
|
-
onClose: () =>
|
|
3539
|
+
onClose: () => f(!1),
|
|
3544
3540
|
isLoading: u
|
|
3545
3541
|
}
|
|
3546
3542
|
)
|
|
3547
3543
|
] });
|
|
3548
3544
|
}
|
|
3549
|
-
function
|
|
3550
|
-
const { selectedOrg:
|
|
3551
|
-
if (
|
|
3552
|
-
|
|
3553
|
-
}, [
|
|
3554
|
-
return /* @__PURE__ */ t(
|
|
3545
|
+
function Ba({ onOrgDeleted: a, onOrgUpdated: r }) {
|
|
3546
|
+
const { selectedOrg: s, updateOrg: l, deleteOrg: n, isLoading: u, error: c, setError: d } = Y(), [i, o] = h((s == null ? void 0 : s.name) ?? ""), [m, p] = h(!1), [g, v] = h(!1), [x, y] = h(!1), [P, N] = h(!1), [E, C] = h("");
|
|
3547
|
+
if (U(() => {
|
|
3548
|
+
s && (o(s.name), y(!1));
|
|
3549
|
+
}, [s]), x)
|
|
3550
|
+
return /* @__PURE__ */ t(H, { children: [
|
|
3551
|
+
/* @__PURE__ */ e("h3", { children: "Organization" }),
|
|
3552
|
+
/* @__PURE__ */ t("div", { className: "ss-auth-settings-card", style: { textAlign: "center", padding: "48px 24px" }, children: [
|
|
3553
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", style: { fontSize: "48px", opacity: 0.4, marginBottom: "16px", display: "block" }, children: S.check }),
|
|
3554
|
+
/* @__PURE__ */ e("h4", { style: { margin: "0 0 8px" }, children: "Organization deleted" }),
|
|
3555
|
+
/* @__PURE__ */ e("p", { className: "ss-auth-section-desc", children: "The organization has been permanently deleted." })
|
|
3556
|
+
] })
|
|
3557
|
+
] });
|
|
3558
|
+
if (!s)
|
|
3559
|
+
return /* @__PURE__ */ t(H, { children: [
|
|
3555
3560
|
/* @__PURE__ */ e("h3", { children: "Organization" }),
|
|
3556
3561
|
/* @__PURE__ */ t("div", { className: "ss-auth-settings-empty", children: [
|
|
3557
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
3562
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.corporateFare }),
|
|
3558
3563
|
/* @__PURE__ */ e("div", { children: "Select an organization from the user menu to manage its settings." })
|
|
3559
3564
|
] })
|
|
3560
3565
|
] });
|
|
3561
|
-
const
|
|
3562
|
-
if (
|
|
3563
|
-
|
|
3564
|
-
const
|
|
3565
|
-
|
|
3566
|
-
},
|
|
3567
|
-
await
|
|
3566
|
+
const f = async (I) => {
|
|
3567
|
+
if (I.preventDefault(), !i.trim()) return;
|
|
3568
|
+
p(!0), v(!1);
|
|
3569
|
+
const F = await l(s.id, { name: i.trim() });
|
|
3570
|
+
p(!1), F && (v(!0), r == null || r());
|
|
3571
|
+
}, O = async () => {
|
|
3572
|
+
await n(s.id) && (N(!1), y(!0), a == null || a());
|
|
3568
3573
|
};
|
|
3569
|
-
return /* @__PURE__ */ t(
|
|
3574
|
+
return /* @__PURE__ */ t(H, { children: [
|
|
3570
3575
|
/* @__PURE__ */ e("h3", { children: "Organization" }),
|
|
3571
3576
|
/* @__PURE__ */ t("div", { className: "ss-auth-settings-card", children: [
|
|
3572
3577
|
/* @__PURE__ */ t("h4", { children: [
|
|
3573
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
3578
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.corporateFare }),
|
|
3574
3579
|
"General"
|
|
3575
3580
|
] }),
|
|
3576
|
-
|
|
3577
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
3578
|
-
/* @__PURE__ */ e("span", { children:
|
|
3581
|
+
c && /* @__PURE__ */ t("div", { className: "ss-auth-error", style: { marginBottom: "16px" }, children: [
|
|
3582
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.errorOutline }),
|
|
3583
|
+
/* @__PURE__ */ e("span", { children: c })
|
|
3579
3584
|
] }),
|
|
3580
|
-
|
|
3581
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
3585
|
+
g && /* @__PURE__ */ t("div", { className: "ss-auth-info-box", style: { marginBottom: "16px" }, children: [
|
|
3586
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.check }),
|
|
3582
3587
|
/* @__PURE__ */ e("span", { children: "Organization updated" })
|
|
3583
3588
|
] }),
|
|
3584
|
-
/* @__PURE__ */ t("form", { onSubmit:
|
|
3589
|
+
/* @__PURE__ */ t("form", { onSubmit: f, children: [
|
|
3585
3590
|
/* @__PURE__ */ t("div", { className: "ss-auth-field", children: [
|
|
3586
3591
|
/* @__PURE__ */ e("label", { className: "ss-auth-label", children: "Organization Name" }),
|
|
3587
3592
|
/* @__PURE__ */ e(
|
|
@@ -3590,18 +3595,18 @@ function Ea() {
|
|
|
3590
3595
|
className: "ss-auth-input",
|
|
3591
3596
|
type: "text",
|
|
3592
3597
|
value: i,
|
|
3593
|
-
onChange: (
|
|
3594
|
-
|
|
3598
|
+
onChange: (I) => {
|
|
3599
|
+
o(I.target.value), v(!1);
|
|
3595
3600
|
}
|
|
3596
3601
|
}
|
|
3597
3602
|
)
|
|
3598
3603
|
] }),
|
|
3599
3604
|
/* @__PURE__ */ t("div", { className: "ss-auth-field", children: [
|
|
3600
3605
|
/* @__PURE__ */ e("label", { className: "ss-auth-label", children: "Slug" }),
|
|
3601
|
-
/* @__PURE__ */ e("input", { className: "ss-auth-input ss-auth-input-readonly", type: "text", value:
|
|
3606
|
+
/* @__PURE__ */ e("input", { className: "ss-auth-input ss-auth-input-readonly", type: "text", value: s.slug, readOnly: !0 })
|
|
3602
3607
|
] }),
|
|
3603
|
-
/* @__PURE__ */ e("div", { style: { display: "flex", justifyContent: "flex-end" }, children: /* @__PURE__ */ t("button", { type: "submit", className: "ss-auth-btn-primary ss-auth-btn-sm", disabled:
|
|
3604
|
-
|
|
3608
|
+
/* @__PURE__ */ e("div", { style: { display: "flex", justifyContent: "flex-end" }, children: /* @__PURE__ */ t("button", { type: "submit", className: "ss-auth-btn-primary ss-auth-btn-sm", disabled: m, style: { width: "auto" }, children: [
|
|
3609
|
+
m && /* @__PURE__ */ e("span", { className: "ss-auth-spinner" }),
|
|
3605
3610
|
"Save"
|
|
3606
3611
|
] }) })
|
|
3607
3612
|
] })
|
|
@@ -3609,7 +3614,7 @@ function Ea() {
|
|
|
3609
3614
|
/* @__PURE__ */ t("div", { className: "ss-auth-settings-card ss-auth-settings-danger", children: [
|
|
3610
3615
|
/* @__PURE__ */ e("h4", { children: "Danger Zone" }),
|
|
3611
3616
|
/* @__PURE__ */ e("p", { className: "ss-auth-section-desc", style: { marginBottom: "16px" }, children: "Deleting this organization is permanent and will remove all members." }),
|
|
3612
|
-
|
|
3617
|
+
P ? /* @__PURE__ */ t("div", { children: [
|
|
3613
3618
|
/* @__PURE__ */ t("div", { className: "ss-auth-field", children: [
|
|
3614
3619
|
/* @__PURE__ */ e("label", { className: "ss-auth-label", children: "Type the organization name to confirm" }),
|
|
3615
3620
|
/* @__PURE__ */ e(
|
|
@@ -3617,16 +3622,16 @@ function Ea() {
|
|
|
3617
3622
|
{
|
|
3618
3623
|
className: "ss-auth-input",
|
|
3619
3624
|
type: "text",
|
|
3620
|
-
placeholder:
|
|
3621
|
-
value:
|
|
3622
|
-
onChange: (
|
|
3625
|
+
placeholder: s.name,
|
|
3626
|
+
value: E,
|
|
3627
|
+
onChange: (I) => C(I.target.value),
|
|
3623
3628
|
autoFocus: !0
|
|
3624
3629
|
}
|
|
3625
3630
|
)
|
|
3626
3631
|
] }),
|
|
3627
3632
|
/* @__PURE__ */ t("div", { style: { display: "flex", gap: "8px", justifyContent: "flex-end" }, children: [
|
|
3628
3633
|
/* @__PURE__ */ e("button", { type: "button", className: "ss-auth-btn-ghost", onClick: () => {
|
|
3629
|
-
|
|
3634
|
+
N(!1), C("");
|
|
3630
3635
|
}, children: "Cancel" }),
|
|
3631
3636
|
/* @__PURE__ */ t(
|
|
3632
3637
|
"button",
|
|
@@ -3634,10 +3639,10 @@ function Ea() {
|
|
|
3634
3639
|
type: "button",
|
|
3635
3640
|
className: "ss-auth-btn-primary ss-auth-btn-sm",
|
|
3636
3641
|
style: { width: "auto", background: "linear-gradient(135deg, #ef4444, #dc2626)" },
|
|
3637
|
-
disabled:
|
|
3638
|
-
onClick:
|
|
3642
|
+
disabled: E !== s.name || u,
|
|
3643
|
+
onClick: O,
|
|
3639
3644
|
children: [
|
|
3640
|
-
|
|
3645
|
+
u && /* @__PURE__ */ e("span", { className: "ss-auth-spinner" }),
|
|
3641
3646
|
"Delete organization"
|
|
3642
3647
|
]
|
|
3643
3648
|
}
|
|
@@ -3649,63 +3654,63 @@ function Ea() {
|
|
|
3649
3654
|
type: "button",
|
|
3650
3655
|
className: "ss-auth-btn-outline",
|
|
3651
3656
|
style: { borderColor: "currentColor", width: "auto" },
|
|
3652
|
-
onClick: () =>
|
|
3657
|
+
onClick: () => N(!0),
|
|
3653
3658
|
children: "Delete this organization"
|
|
3654
3659
|
}
|
|
3655
3660
|
)
|
|
3656
3661
|
] })
|
|
3657
3662
|
] });
|
|
3658
3663
|
}
|
|
3659
|
-
function
|
|
3664
|
+
function Fa() {
|
|
3660
3665
|
const {
|
|
3661
3666
|
selectedOrg: a,
|
|
3662
|
-
members:
|
|
3663
|
-
invites:
|
|
3664
|
-
isLoading:
|
|
3667
|
+
members: r,
|
|
3668
|
+
invites: s,
|
|
3669
|
+
isLoading: l,
|
|
3665
3670
|
error: n,
|
|
3666
3671
|
setError: u,
|
|
3667
|
-
sendInvite:
|
|
3668
|
-
refreshInvites:
|
|
3669
|
-
revokeInvite:
|
|
3670
|
-
updateMemberRole:
|
|
3671
|
-
removeMember:
|
|
3672
|
+
sendInvite: c,
|
|
3673
|
+
refreshInvites: d,
|
|
3674
|
+
revokeInvite: i,
|
|
3675
|
+
updateMemberRole: o,
|
|
3676
|
+
removeMember: m,
|
|
3672
3677
|
refreshMembers: p
|
|
3673
|
-
} = Y(), [
|
|
3674
|
-
if (
|
|
3675
|
-
a && (p(a.id),
|
|
3676
|
-
}, [a, p,
|
|
3677
|
-
return /* @__PURE__ */ t(
|
|
3678
|
+
} = Y(), [g, v] = h(""), [x, y] = h("member"), [P, N] = h(!1), [E, C] = h(!1), [f, O] = h(null), [I, F] = h(""), [A, b] = h(null);
|
|
3679
|
+
if (U(() => {
|
|
3680
|
+
a && (p(a.id), d(a.id));
|
|
3681
|
+
}, [a, p, d]), !a)
|
|
3682
|
+
return /* @__PURE__ */ t(H, { children: [
|
|
3678
3683
|
/* @__PURE__ */ e("h3", { children: "People" }),
|
|
3679
3684
|
/* @__PURE__ */ t("div", { className: "ss-auth-settings-empty", children: [
|
|
3680
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
3685
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.group }),
|
|
3681
3686
|
/* @__PURE__ */ e("div", { children: "Select an organization from the user menu to manage members." })
|
|
3682
3687
|
] })
|
|
3683
3688
|
] });
|
|
3684
|
-
const
|
|
3685
|
-
|
|
3686
|
-
},
|
|
3687
|
-
if (!
|
|
3688
|
-
await
|
|
3689
|
-
},
|
|
3690
|
-
if (
|
|
3691
|
-
await
|
|
3692
|
-
},
|
|
3693
|
-
await
|
|
3694
|
-
},
|
|
3695
|
-
return /* @__PURE__ */ t(
|
|
3689
|
+
const w = async (k) => {
|
|
3690
|
+
k.preventDefault(), C(!1), await c(a.id, g, x) && (v(""), y("member"), C(!0), N(!1), d(a.id));
|
|
3691
|
+
}, B = async () => {
|
|
3692
|
+
if (!f) return;
|
|
3693
|
+
await o(a.id, f.userId, I) && O(null);
|
|
3694
|
+
}, z = async () => {
|
|
3695
|
+
if (!A) return;
|
|
3696
|
+
await m(a.id, A.userId) && b(null);
|
|
3697
|
+
}, M = async (k) => {
|
|
3698
|
+
await i(a.id, k);
|
|
3699
|
+
}, L = (k) => k === "owner" ? "ss-auth-role-badge ss-auth-role-badge-owner" : k === "admin" ? "ss-auth-role-badge ss-auth-role-badge-admin" : "ss-auth-role-badge ss-auth-role-badge-member";
|
|
3700
|
+
return /* @__PURE__ */ t(H, { children: [
|
|
3696
3701
|
/* @__PURE__ */ e("h3", { children: "People" }),
|
|
3697
3702
|
n && /* @__PURE__ */ t("div", { className: "ss-auth-error", style: { marginBottom: "16px" }, children: [
|
|
3698
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
3703
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.errorOutline }),
|
|
3699
3704
|
/* @__PURE__ */ e("span", { children: n })
|
|
3700
3705
|
] }),
|
|
3701
|
-
|
|
3702
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
3706
|
+
E && /* @__PURE__ */ t("div", { className: "ss-auth-info-box", style: { marginBottom: "16px" }, children: [
|
|
3707
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.check }),
|
|
3703
3708
|
/* @__PURE__ */ e("span", { children: "Invitation sent" })
|
|
3704
3709
|
] }),
|
|
3705
3710
|
/* @__PURE__ */ t("div", { className: "ss-auth-settings-card", children: [
|
|
3706
3711
|
/* @__PURE__ */ t("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", marginBottom: "16px" }, children: [
|
|
3707
3712
|
/* @__PURE__ */ t("h4", { style: { margin: 0 }, children: [
|
|
3708
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
3713
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.group }),
|
|
3709
3714
|
"Members"
|
|
3710
3715
|
] }),
|
|
3711
3716
|
/* @__PURE__ */ t(
|
|
@@ -3714,15 +3719,15 @@ function Ia() {
|
|
|
3714
3719
|
type: "button",
|
|
3715
3720
|
className: "ss-auth-btn-primary ss-auth-btn-sm",
|
|
3716
3721
|
style: { width: "auto" },
|
|
3717
|
-
onClick: () =>
|
|
3722
|
+
onClick: () => N(!P),
|
|
3718
3723
|
children: [
|
|
3719
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", style: { fontSize: "16px" }, children:
|
|
3724
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", style: { fontSize: "16px" }, children: S.add }),
|
|
3720
3725
|
"Invite"
|
|
3721
3726
|
]
|
|
3722
3727
|
}
|
|
3723
3728
|
)
|
|
3724
3729
|
] }),
|
|
3725
|
-
|
|
3730
|
+
P && /* @__PURE__ */ e("form", { onSubmit: w, 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: [
|
|
3726
3731
|
/* @__PURE__ */ t("div", { style: { flex: 1 }, children: [
|
|
3727
3732
|
/* @__PURE__ */ e("label", { className: "ss-auth-label", children: "Email" }),
|
|
3728
3733
|
/* @__PURE__ */ e(
|
|
@@ -3731,8 +3736,8 @@ function Ia() {
|
|
|
3731
3736
|
className: "ss-auth-input",
|
|
3732
3737
|
type: "email",
|
|
3733
3738
|
placeholder: "member@example.com",
|
|
3734
|
-
value:
|
|
3735
|
-
onChange: (
|
|
3739
|
+
value: g,
|
|
3740
|
+
onChange: (k) => v(k.target.value),
|
|
3736
3741
|
required: !0
|
|
3737
3742
|
}
|
|
3738
3743
|
)
|
|
@@ -3743,8 +3748,8 @@ function Ia() {
|
|
|
3743
3748
|
"select",
|
|
3744
3749
|
{
|
|
3745
3750
|
className: "ss-auth-input",
|
|
3746
|
-
value:
|
|
3747
|
-
onChange: (
|
|
3751
|
+
value: x,
|
|
3752
|
+
onChange: (k) => y(k.target.value),
|
|
3748
3753
|
style: { cursor: "pointer" },
|
|
3749
3754
|
children: [
|
|
3750
3755
|
/* @__PURE__ */ e("option", { value: "admin", children: "Admin" }),
|
|
@@ -3753,18 +3758,18 @@ function Ia() {
|
|
|
3753
3758
|
}
|
|
3754
3759
|
)
|
|
3755
3760
|
] }),
|
|
3756
|
-
/* @__PURE__ */ e("button", { type: "submit", className: "ss-auth-btn-primary ss-auth-btn-sm", disabled:
|
|
3761
|
+
/* @__PURE__ */ e("button", { type: "submit", className: "ss-auth-btn-primary ss-auth-btn-sm", disabled: l, style: { width: "auto", marginBottom: "0" }, children: "Send" })
|
|
3757
3762
|
] }) }),
|
|
3758
|
-
|
|
3763
|
+
r.length === 0 ? /* @__PURE__ */ e("div", { className: "ss-auth-settings-empty", style: { padding: "20px" }, children: /* @__PURE__ */ e("div", { children: "No members yet." }) }) : /* @__PURE__ */ t("table", { className: "ss-auth-settings-table", children: [
|
|
3759
3764
|
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ t("tr", { children: [
|
|
3760
3765
|
/* @__PURE__ */ e("th", { children: "Email" }),
|
|
3761
3766
|
/* @__PURE__ */ e("th", { children: "Role" }),
|
|
3762
3767
|
/* @__PURE__ */ e("th", { style: { width: "80px" }, children: "Actions" })
|
|
3763
3768
|
] }) }),
|
|
3764
|
-
/* @__PURE__ */ e("tbody", { children:
|
|
3765
|
-
/* @__PURE__ */ e("td", { children:
|
|
3766
|
-
/* @__PURE__ */ e("td", { children: /* @__PURE__ */ e("span", { className:
|
|
3767
|
-
/* @__PURE__ */ e("td", { children:
|
|
3769
|
+
/* @__PURE__ */ e("tbody", { children: r.map((k) => /* @__PURE__ */ t("tr", { children: [
|
|
3770
|
+
/* @__PURE__ */ e("td", { children: k.email }),
|
|
3771
|
+
/* @__PURE__ */ e("td", { children: /* @__PURE__ */ e("span", { className: L(k.role), children: k.role }) }),
|
|
3772
|
+
/* @__PURE__ */ e("td", { children: k.role === "owner" ? /* @__PURE__ */ e("span", { style: { fontSize: "12px", opacity: 0.4 }, children: "—" }) : /* @__PURE__ */ t("div", { className: "ss-auth-settings-actions", children: [
|
|
3768
3773
|
/* @__PURE__ */ e(
|
|
3769
3774
|
"button",
|
|
3770
3775
|
{
|
|
@@ -3772,9 +3777,9 @@ function Ia() {
|
|
|
3772
3777
|
className: "ss-auth-icon-btn",
|
|
3773
3778
|
title: "Edit role",
|
|
3774
3779
|
onClick: () => {
|
|
3775
|
-
|
|
3780
|
+
O(k), F(k.role);
|
|
3776
3781
|
},
|
|
3777
|
-
children: /* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
3782
|
+
children: /* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.edit })
|
|
3778
3783
|
}
|
|
3779
3784
|
),
|
|
3780
3785
|
/* @__PURE__ */ e(
|
|
@@ -3783,17 +3788,17 @@ function Ia() {
|
|
|
3783
3788
|
type: "button",
|
|
3784
3789
|
className: "ss-auth-icon-btn ss-auth-icon-btn-danger",
|
|
3785
3790
|
title: "Remove member",
|
|
3786
|
-
onClick: () =>
|
|
3787
|
-
children: /* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
3791
|
+
onClick: () => b(k),
|
|
3792
|
+
children: /* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.personRemove })
|
|
3788
3793
|
}
|
|
3789
3794
|
)
|
|
3790
3795
|
] }) })
|
|
3791
|
-
] },
|
|
3796
|
+
] }, k.userId)) })
|
|
3792
3797
|
] })
|
|
3793
3798
|
] }),
|
|
3794
|
-
|
|
3799
|
+
s.length > 0 && /* @__PURE__ */ t("div", { className: "ss-auth-settings-card", children: [
|
|
3795
3800
|
/* @__PURE__ */ t("h4", { children: [
|
|
3796
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
3801
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.send }),
|
|
3797
3802
|
"Pending Invites"
|
|
3798
3803
|
] }),
|
|
3799
3804
|
/* @__PURE__ */ t("table", { className: "ss-auth-settings-table", children: [
|
|
@@ -3802,33 +3807,33 @@ function Ia() {
|
|
|
3802
3807
|
/* @__PURE__ */ e("th", { children: "Role" }),
|
|
3803
3808
|
/* @__PURE__ */ e("th", { style: { width: "80px" }, children: "Actions" })
|
|
3804
3809
|
] }) }),
|
|
3805
|
-
/* @__PURE__ */ e("tbody", { children:
|
|
3806
|
-
/* @__PURE__ */ e("td", { children:
|
|
3807
|
-
/* @__PURE__ */ e("td", { children: /* @__PURE__ */ e("span", { className:
|
|
3810
|
+
/* @__PURE__ */ e("tbody", { children: s.map((k) => /* @__PURE__ */ t("tr", { children: [
|
|
3811
|
+
/* @__PURE__ */ e("td", { children: k.email }),
|
|
3812
|
+
/* @__PURE__ */ e("td", { children: /* @__PURE__ */ e("span", { className: L(k.role), children: k.role }) }),
|
|
3808
3813
|
/* @__PURE__ */ e("td", { children: /* @__PURE__ */ e(
|
|
3809
3814
|
"button",
|
|
3810
3815
|
{
|
|
3811
3816
|
type: "button",
|
|
3812
3817
|
className: "ss-auth-icon-btn ss-auth-icon-btn-danger",
|
|
3813
3818
|
title: "Revoke invite",
|
|
3814
|
-
onClick: () =>
|
|
3815
|
-
children: /* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
3819
|
+
onClick: () => M(k.id),
|
|
3820
|
+
children: /* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.close })
|
|
3816
3821
|
}
|
|
3817
3822
|
) })
|
|
3818
|
-
] },
|
|
3823
|
+
] }, k.id)) })
|
|
3819
3824
|
] })
|
|
3820
3825
|
] }),
|
|
3821
|
-
|
|
3822
|
-
|
|
3826
|
+
f && /* @__PURE__ */ e("div", { className: "ss-auth-modal-overlay", onClick: (k) => {
|
|
3827
|
+
k.target === k.currentTarget && O(null);
|
|
3823
3828
|
}, children: /* @__PURE__ */ t("div", { className: "ss-auth-modal", style: { maxWidth: "400px" }, children: [
|
|
3824
3829
|
/* @__PURE__ */ t("div", { className: "ss-auth-modal-header", children: [
|
|
3825
3830
|
/* @__PURE__ */ e("h2", { children: "Edit Role" }),
|
|
3826
|
-
/* @__PURE__ */ e("button", { type: "button", className: "ss-auth-modal-close", onClick: () =>
|
|
3831
|
+
/* @__PURE__ */ e("button", { type: "button", className: "ss-auth-modal-close", onClick: () => O(null), children: /* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.close }) })
|
|
3827
3832
|
] }),
|
|
3828
3833
|
/* @__PURE__ */ t("div", { className: "ss-auth-modal-body", children: [
|
|
3829
3834
|
/* @__PURE__ */ t("p", { style: { fontSize: "14px", marginBottom: "16px", margin: "0 0 16px 0" }, children: [
|
|
3830
3835
|
"Change role for ",
|
|
3831
|
-
/* @__PURE__ */ e("strong", { children:
|
|
3836
|
+
/* @__PURE__ */ e("strong", { children: f.email })
|
|
3832
3837
|
] }),
|
|
3833
3838
|
/* @__PURE__ */ t("div", { className: "ss-auth-field", children: [
|
|
3834
3839
|
/* @__PURE__ */ e("label", { className: "ss-auth-label", children: "Role" }),
|
|
@@ -3836,8 +3841,8 @@ function Ia() {
|
|
|
3836
3841
|
"select",
|
|
3837
3842
|
{
|
|
3838
3843
|
className: "ss-auth-input",
|
|
3839
|
-
value:
|
|
3840
|
-
onChange: (
|
|
3844
|
+
value: I,
|
|
3845
|
+
onChange: (k) => F(k.target.value),
|
|
3841
3846
|
style: { cursor: "pointer" },
|
|
3842
3847
|
children: [
|
|
3843
3848
|
/* @__PURE__ */ e("option", { value: "admin", children: "Admin" }),
|
|
@@ -3847,33 +3852,33 @@ function Ia() {
|
|
|
3847
3852
|
)
|
|
3848
3853
|
] }),
|
|
3849
3854
|
/* @__PURE__ */ t("div", { style: { display: "flex", gap: "8px", justifyContent: "flex-end" }, children: [
|
|
3850
|
-
/* @__PURE__ */ e("button", { type: "button", className: "ss-auth-btn-ghost", onClick: () =>
|
|
3851
|
-
/* @__PURE__ */ e("button", { type: "button", className: "ss-auth-btn-primary ss-auth-btn-sm", style: { width: "auto" }, onClick:
|
|
3855
|
+
/* @__PURE__ */ e("button", { type: "button", className: "ss-auth-btn-ghost", onClick: () => O(null), children: "Cancel" }),
|
|
3856
|
+
/* @__PURE__ */ e("button", { type: "button", className: "ss-auth-btn-primary ss-auth-btn-sm", style: { width: "auto" }, onClick: B, children: "Save" })
|
|
3852
3857
|
] })
|
|
3853
3858
|
] })
|
|
3854
3859
|
] }) }),
|
|
3855
|
-
|
|
3856
|
-
|
|
3860
|
+
A && /* @__PURE__ */ e("div", { className: "ss-auth-modal-overlay", onClick: (k) => {
|
|
3861
|
+
k.target === k.currentTarget && b(null);
|
|
3857
3862
|
}, children: /* @__PURE__ */ t("div", { className: "ss-auth-modal", style: { maxWidth: "400px" }, children: [
|
|
3858
3863
|
/* @__PURE__ */ t("div", { className: "ss-auth-modal-header", children: [
|
|
3859
3864
|
/* @__PURE__ */ e("h2", { children: "Remove Member" }),
|
|
3860
|
-
/* @__PURE__ */ e("button", { type: "button", className: "ss-auth-modal-close", onClick: () =>
|
|
3865
|
+
/* @__PURE__ */ e("button", { type: "button", className: "ss-auth-modal-close", onClick: () => b(null), children: /* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.close }) })
|
|
3861
3866
|
] }),
|
|
3862
3867
|
/* @__PURE__ */ t("div", { className: "ss-auth-modal-body", children: [
|
|
3863
3868
|
/* @__PURE__ */ t("p", { style: { fontSize: "14px", margin: "0 0 16px 0" }, children: [
|
|
3864
3869
|
"Are you sure you want to remove ",
|
|
3865
|
-
/* @__PURE__ */ e("strong", { children:
|
|
3870
|
+
/* @__PURE__ */ e("strong", { children: A.email }),
|
|
3866
3871
|
" from the organization?"
|
|
3867
3872
|
] }),
|
|
3868
3873
|
/* @__PURE__ */ t("div", { style: { display: "flex", gap: "8px", justifyContent: "flex-end" }, children: [
|
|
3869
|
-
/* @__PURE__ */ e("button", { type: "button", className: "ss-auth-btn-ghost", onClick: () =>
|
|
3874
|
+
/* @__PURE__ */ e("button", { type: "button", className: "ss-auth-btn-ghost", onClick: () => b(null), children: "Cancel" }),
|
|
3870
3875
|
/* @__PURE__ */ e(
|
|
3871
3876
|
"button",
|
|
3872
3877
|
{
|
|
3873
3878
|
type: "button",
|
|
3874
3879
|
className: "ss-auth-btn-primary ss-auth-btn-sm",
|
|
3875
3880
|
style: { width: "auto", background: "linear-gradient(135deg, #ef4444, #dc2626)" },
|
|
3876
|
-
onClick:
|
|
3881
|
+
onClick: z,
|
|
3877
3882
|
children: "Remove"
|
|
3878
3883
|
}
|
|
3879
3884
|
)
|
|
@@ -3882,71 +3887,71 @@ function Ia() {
|
|
|
3882
3887
|
] }) })
|
|
3883
3888
|
] });
|
|
3884
3889
|
}
|
|
3885
|
-
function
|
|
3890
|
+
function La() {
|
|
3886
3891
|
const { selectedOrg: a } = Y();
|
|
3887
|
-
return a ? /* @__PURE__ */ t(
|
|
3892
|
+
return a ? /* @__PURE__ */ t(H, { children: [
|
|
3888
3893
|
/* @__PURE__ */ e("h3", { children: "Billing" }),
|
|
3889
3894
|
/* @__PURE__ */ t("div", { className: "ss-auth-settings-card", children: [
|
|
3890
3895
|
/* @__PURE__ */ t("h4", { children: [
|
|
3891
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
3896
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.creditCard }),
|
|
3892
3897
|
"Plan & Billing"
|
|
3893
3898
|
] }),
|
|
3894
3899
|
/* @__PURE__ */ e("div", { className: "ss-auth-settings-empty", style: { padding: "20px" }, children: /* @__PURE__ */ e("div", { children: "No billing plan configured for this organization." }) })
|
|
3895
3900
|
] })
|
|
3896
|
-
] }) : /* @__PURE__ */ t(
|
|
3901
|
+
] }) : /* @__PURE__ */ t(H, { children: [
|
|
3897
3902
|
/* @__PURE__ */ e("h3", { children: "Billing" }),
|
|
3898
3903
|
/* @__PURE__ */ t("div", { className: "ss-auth-settings-empty", children: [
|
|
3899
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
3904
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.creditCard }),
|
|
3900
3905
|
/* @__PURE__ */ e("div", { children: "Select an organization from the user menu to manage billing." })
|
|
3901
3906
|
] })
|
|
3902
3907
|
] });
|
|
3903
3908
|
}
|
|
3904
|
-
function
|
|
3909
|
+
function le({
|
|
3905
3910
|
appearance: a,
|
|
3906
|
-
afterSignOutUrl:
|
|
3907
|
-
afterDeleteAccountUrl:
|
|
3908
|
-
showOrgSwitcher:
|
|
3911
|
+
afterSignOutUrl: r,
|
|
3912
|
+
afterDeleteAccountUrl: s,
|
|
3913
|
+
showOrgSwitcher: l = !0,
|
|
3909
3914
|
onOrgChange: n,
|
|
3910
3915
|
onOrgSettingsClick: u
|
|
3911
3916
|
}) {
|
|
3912
|
-
const { appearance:
|
|
3913
|
-
|
|
3917
|
+
const { appearance: c } = D(), { user: d, signOut: i } = sa(), o = a ?? c, [m, p] = h(!1), [g, v] = h(!1), [x, y] = h(""), [P, N] = h(null), [E, C] = h(!1), f = W(null), { orgs: O, selectedOrg: I, selectOrg: F, createOrg: A, refresh: b } = Y(), w = $((z) => {
|
|
3918
|
+
f.current && !z.composedPath().includes(f.current) && p(!1);
|
|
3914
3919
|
}, []);
|
|
3915
|
-
|
|
3916
|
-
if (
|
|
3917
|
-
const
|
|
3918
|
-
document.addEventListener("click",
|
|
3920
|
+
U(() => {
|
|
3921
|
+
if (m) {
|
|
3922
|
+
const z = setTimeout(() => {
|
|
3923
|
+
document.addEventListener("click", w);
|
|
3919
3924
|
}, 0);
|
|
3920
3925
|
return () => {
|
|
3921
|
-
clearTimeout(
|
|
3926
|
+
clearTimeout(z), document.removeEventListener("click", w);
|
|
3922
3927
|
};
|
|
3923
3928
|
}
|
|
3924
|
-
}, [
|
|
3925
|
-
const
|
|
3926
|
-
async (
|
|
3927
|
-
|
|
3928
|
-
const
|
|
3929
|
+
}, [m, w]);
|
|
3930
|
+
const B = $(
|
|
3931
|
+
async (z) => {
|
|
3932
|
+
z.preventDefault(), N(null), C(!0);
|
|
3933
|
+
const M = x.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "");
|
|
3929
3934
|
try {
|
|
3930
|
-
const
|
|
3931
|
-
|
|
3932
|
-
} catch (
|
|
3933
|
-
|
|
3935
|
+
const L = await A(x, M);
|
|
3936
|
+
L && (await F(L.id), n == null || n(L), y(""), p(!1));
|
|
3937
|
+
} catch (L) {
|
|
3938
|
+
N(L instanceof Error ? L.message : "Failed to create organization");
|
|
3934
3939
|
} finally {
|
|
3935
3940
|
C(!1);
|
|
3936
3941
|
}
|
|
3937
3942
|
},
|
|
3938
|
-
[
|
|
3943
|
+
[x, A, F, n]
|
|
3939
3944
|
);
|
|
3940
|
-
return
|
|
3945
|
+
return d ? /* @__PURE__ */ e(j, { appearance: o, children: /* @__PURE__ */ t("div", { style: { position: "relative", display: "inline-block" }, ref: f, children: [
|
|
3941
3946
|
/* @__PURE__ */ t(
|
|
3942
3947
|
"button",
|
|
3943
3948
|
{
|
|
3944
3949
|
type: "button",
|
|
3945
3950
|
className: "ss-auth-user-trigger",
|
|
3946
|
-
onClick: () => p(!
|
|
3951
|
+
onClick: () => p(!m),
|
|
3947
3952
|
"aria-label": "User menu",
|
|
3948
3953
|
children: [
|
|
3949
|
-
/* @__PURE__ */ e("span", { className: "ss-auth-avatar-trigger", children:
|
|
3954
|
+
/* @__PURE__ */ e("span", { className: "ss-auth-avatar-trigger", children: d.avatarUrl ? /* @__PURE__ */ e("img", { src: d.avatarUrl, alt: "" }) : /* @__PURE__ */ e("div", { style: {
|
|
3950
3955
|
width: "100%",
|
|
3951
3956
|
height: "100%",
|
|
3952
3957
|
display: "flex",
|
|
@@ -3954,14 +3959,14 @@ function oe({
|
|
|
3954
3959
|
justifyContent: "center",
|
|
3955
3960
|
fontSize: "16px",
|
|
3956
3961
|
fontWeight: 700
|
|
3957
|
-
}, children: (
|
|
3958
|
-
|
|
3962
|
+
}, children: (d.name || d.email).charAt(0).toUpperCase() }) }),
|
|
3963
|
+
I && /* @__PURE__ */ e("span", { className: "ss-auth-trigger-org-name", children: I.name })
|
|
3959
3964
|
]
|
|
3960
3965
|
}
|
|
3961
3966
|
),
|
|
3962
|
-
|
|
3967
|
+
m && /* @__PURE__ */ t("div", { className: "ss-auth-dropdown ss-auth-glass-panel", style: { minWidth: "320px" }, children: [
|
|
3963
3968
|
/* @__PURE__ */ t("div", { className: "ss-auth-dropdown-header", children: [
|
|
3964
|
-
/* @__PURE__ */ e("div", { className: "ss-auth-dropdown-avatar", children:
|
|
3969
|
+
/* @__PURE__ */ e("div", { className: "ss-auth-dropdown-avatar", children: d.avatarUrl ? /* @__PURE__ */ e("img", { src: d.avatarUrl, alt: "" }) : /* @__PURE__ */ e("div", { style: {
|
|
3965
3970
|
width: "100%",
|
|
3966
3971
|
height: "100%",
|
|
3967
3972
|
display: "flex",
|
|
@@ -3969,10 +3974,10 @@ function oe({
|
|
|
3969
3974
|
justifyContent: "center",
|
|
3970
3975
|
fontSize: "20px",
|
|
3971
3976
|
fontWeight: 800
|
|
3972
|
-
}, children: (
|
|
3977
|
+
}, children: (d.name || d.email).charAt(0).toUpperCase() }) }),
|
|
3973
3978
|
/* @__PURE__ */ t("div", { children: [
|
|
3974
|
-
|
|
3975
|
-
/* @__PURE__ */ e("div", { className: "ss-auth-dropdown-email", children:
|
|
3979
|
+
d.name && /* @__PURE__ */ e("div", { className: "ss-auth-dropdown-name", children: d.name }),
|
|
3980
|
+
/* @__PURE__ */ e("div", { className: "ss-auth-dropdown-email", children: d.email })
|
|
3976
3981
|
] })
|
|
3977
3982
|
] }),
|
|
3978
3983
|
/* @__PURE__ */ e("div", { style: { padding: "4px 8px" }, children: /* @__PURE__ */ t(
|
|
@@ -3981,49 +3986,49 @@ function oe({
|
|
|
3981
3986
|
type: "button",
|
|
3982
3987
|
className: "ss-auth-dropdown-action",
|
|
3983
3988
|
onClick: () => {
|
|
3984
|
-
p(!1),
|
|
3989
|
+
p(!1), v(!0);
|
|
3985
3990
|
},
|
|
3986
3991
|
children: [
|
|
3987
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
3992
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.settings }),
|
|
3988
3993
|
"Settings"
|
|
3989
3994
|
]
|
|
3990
3995
|
}
|
|
3991
3996
|
) }),
|
|
3992
|
-
|
|
3997
|
+
l && /* @__PURE__ */ t(H, { children: [
|
|
3993
3998
|
/* @__PURE__ */ e("div", { className: "ss-auth-section-label", children: "Organizations" }),
|
|
3994
|
-
/* @__PURE__ */ e("div", { style: { padding: "0 8px 4px" }, children:
|
|
3995
|
-
const
|
|
3999
|
+
/* @__PURE__ */ e("div", { style: { padding: "0 8px 4px" }, children: O.map((z) => {
|
|
4000
|
+
const M = (I == null ? void 0 : I.id) === z.id, L = z.name.split(" ").map((k) => k[0]).join("").slice(0, 2).toUpperCase();
|
|
3996
4001
|
return /* @__PURE__ */ t(
|
|
3997
4002
|
"button",
|
|
3998
4003
|
{
|
|
3999
4004
|
type: "button",
|
|
4000
|
-
className: `ss-auth-org-item${
|
|
4005
|
+
className: `ss-auth-org-item${M ? " ss-auth-org-item-active" : ""}`,
|
|
4001
4006
|
onClick: async () => {
|
|
4002
|
-
p(!1), await F(
|
|
4007
|
+
p(!1), await F(z.id), n == null || n(z);
|
|
4003
4008
|
},
|
|
4004
4009
|
children: [
|
|
4005
4010
|
/* @__PURE__ */ t("div", { className: "ss-auth-org-item-inner", children: [
|
|
4006
|
-
/* @__PURE__ */ e("div", { className: `ss-auth-org-avatar${
|
|
4007
|
-
/* @__PURE__ */ e("span", { style: { fontFamily: "'Manrope', sans-serif", letterSpacing: "-0.01em" }, children:
|
|
4008
|
-
|
|
4011
|
+
/* @__PURE__ */ e("div", { className: `ss-auth-org-avatar${M ? "" : " ss-auth-org-avatar-inactive"}`, children: L }),
|
|
4012
|
+
/* @__PURE__ */ e("span", { style: { fontFamily: "'Manrope', sans-serif", letterSpacing: "-0.01em" }, children: z.name }),
|
|
4013
|
+
z.planName && /* @__PURE__ */ e("span", { className: "ss-auth-plan-badge", children: z.planName })
|
|
4009
4014
|
] }),
|
|
4010
|
-
|
|
4015
|
+
M && /* @__PURE__ */ e("span", { className: "material-symbols-outlined ss-auth-org-check", style: { fontSize: "18px" }, children: S.checkCircle })
|
|
4011
4016
|
]
|
|
4012
4017
|
},
|
|
4013
|
-
|
|
4018
|
+
z.id
|
|
4014
4019
|
);
|
|
4015
4020
|
}) }),
|
|
4016
4021
|
/* @__PURE__ */ t("div", { className: "ss-auth-inline-create", children: [
|
|
4017
|
-
|
|
4018
|
-
/* @__PURE__ */ e("form", { onSubmit:
|
|
4022
|
+
P && /* @__PURE__ */ e("div", { className: "ss-auth-error", style: { marginBottom: "8px", fontSize: "12px" }, children: /* @__PURE__ */ e("span", { children: P }) }),
|
|
4023
|
+
/* @__PURE__ */ e("form", { onSubmit: B, children: /* @__PURE__ */ t("div", { className: "ss-auth-inline-create-input", children: [
|
|
4019
4024
|
/* @__PURE__ */ e(
|
|
4020
4025
|
"input",
|
|
4021
4026
|
{
|
|
4022
4027
|
className: "ss-auth-input",
|
|
4023
4028
|
type: "text",
|
|
4024
4029
|
placeholder: "New organization name",
|
|
4025
|
-
value:
|
|
4026
|
-
onChange: (
|
|
4030
|
+
value: x,
|
|
4031
|
+
onChange: (z) => y(z.target.value),
|
|
4027
4032
|
required: !0,
|
|
4028
4033
|
style: { fontSize: "13px", padding: "10px 40px 10px 12px" }
|
|
4029
4034
|
}
|
|
@@ -4033,22 +4038,22 @@ function oe({
|
|
|
4033
4038
|
{
|
|
4034
4039
|
type: "submit",
|
|
4035
4040
|
className: "ss-auth-inline-create-btn",
|
|
4036
|
-
disabled:
|
|
4037
|
-
children: /* @__PURE__ */ e("span", { className: "material-symbols-outlined", style: { fontSize: "20px" }, children:
|
|
4041
|
+
disabled: E || !x.trim(),
|
|
4042
|
+
children: /* @__PURE__ */ e("span", { className: "material-symbols-outlined", style: { fontSize: "20px" }, children: S.add })
|
|
4038
4043
|
}
|
|
4039
4044
|
)
|
|
4040
4045
|
] }) })
|
|
4041
4046
|
] }),
|
|
4042
|
-
|
|
4047
|
+
I && u && /* @__PURE__ */ e("div", { style: { padding: "0 8px 4px" }, children: /* @__PURE__ */ t(
|
|
4043
4048
|
"button",
|
|
4044
4049
|
{
|
|
4045
4050
|
type: "button",
|
|
4046
4051
|
className: "ss-auth-dropdown-action",
|
|
4047
4052
|
onClick: () => {
|
|
4048
|
-
p(!1), u(
|
|
4053
|
+
p(!1), u(I);
|
|
4049
4054
|
},
|
|
4050
4055
|
children: [
|
|
4051
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
4056
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.corporateFare }),
|
|
4052
4057
|
"Org settings"
|
|
4053
4058
|
]
|
|
4054
4059
|
}
|
|
@@ -4060,56 +4065,58 @@ function oe({
|
|
|
4060
4065
|
type: "button",
|
|
4061
4066
|
className: "ss-auth-dropdown-action",
|
|
4062
4067
|
onClick: async () => {
|
|
4063
|
-
p(!1), await
|
|
4068
|
+
p(!1), await i(), r && (window.location.href = r);
|
|
4064
4069
|
},
|
|
4065
4070
|
style: { color: "inherit" },
|
|
4066
4071
|
children: [
|
|
4067
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", style: { color: "inherit" }, children:
|
|
4072
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", style: { color: "inherit" }, children: S.logout }),
|
|
4068
4073
|
"Sign out"
|
|
4069
4074
|
]
|
|
4070
4075
|
}
|
|
4071
4076
|
) })
|
|
4072
4077
|
] }),
|
|
4073
|
-
|
|
4074
|
-
|
|
4078
|
+
g && /* @__PURE__ */ e(
|
|
4079
|
+
Ea,
|
|
4075
4080
|
{
|
|
4076
|
-
onClose: () =>
|
|
4077
|
-
afterDeleteAccountUrl:
|
|
4081
|
+
onClose: () => v(!1),
|
|
4082
|
+
afterDeleteAccountUrl: s,
|
|
4083
|
+
onOrgDeleted: b,
|
|
4084
|
+
onOrgUpdated: b
|
|
4078
4085
|
}
|
|
4079
4086
|
)
|
|
4080
4087
|
] }) }) : null;
|
|
4081
4088
|
}
|
|
4082
|
-
function
|
|
4083
|
-
const { appearance:
|
|
4084
|
-
async (
|
|
4085
|
-
|
|
4089
|
+
function ce({ appearance: a }) {
|
|
4090
|
+
const { appearance: r } = D(), { user: s, signOut: l } = sa(), { updateProfile: n, uploadAvatar: u, changePassword: c, isLoading: d, error: i, success: o, setError: m, setSuccess: p } = oa(), g = a ?? r, [v, x] = h((s == null ? void 0 : s.name) ?? ""), [y, P] = h((s == null ? void 0 : s.avatarUrl) ?? ""), [N, E] = h(!1), [C, f] = h(""), [O, I] = h(""), [F, A] = h(""), [b, w] = h(null), B = $(
|
|
4091
|
+
async (T) => {
|
|
4092
|
+
T.preventDefault(), m(null), p(null), await n({ name: v, avatarUrl: y || void 0 });
|
|
4086
4093
|
},
|
|
4087
|
-
[
|
|
4088
|
-
),
|
|
4089
|
-
async (
|
|
4090
|
-
const
|
|
4091
|
-
|
|
4094
|
+
[v, y, n, m, p]
|
|
4095
|
+
), z = $(
|
|
4096
|
+
async (T) => {
|
|
4097
|
+
const _ = await u(T);
|
|
4098
|
+
_ && (P(_.avatarUrl), E(!1));
|
|
4092
4099
|
},
|
|
4093
4100
|
[u]
|
|
4094
|
-
),
|
|
4095
|
-
async (
|
|
4096
|
-
if (
|
|
4097
|
-
|
|
4101
|
+
), M = $(
|
|
4102
|
+
async (T) => {
|
|
4103
|
+
if (T.preventDefault(), w(null), m(null), p(null), O !== F) {
|
|
4104
|
+
w("Passwords do not match");
|
|
4098
4105
|
return;
|
|
4099
4106
|
}
|
|
4100
|
-
if (
|
|
4101
|
-
|
|
4107
|
+
if (O.length < 8) {
|
|
4108
|
+
w("Password must be at least 8 characters");
|
|
4102
4109
|
return;
|
|
4103
4110
|
}
|
|
4104
|
-
await
|
|
4111
|
+
await c(C, O) && (f(""), I(""), A(""));
|
|
4105
4112
|
},
|
|
4106
|
-
[C,
|
|
4113
|
+
[C, O, F, c, m, p]
|
|
4107
4114
|
);
|
|
4108
|
-
if (!
|
|
4109
|
-
const
|
|
4110
|
-
return /* @__PURE__ */ e(
|
|
4115
|
+
if (!s) return null;
|
|
4116
|
+
const L = s.provider === "email", k = (s.name || s.email).charAt(0).toUpperCase();
|
|
4117
|
+
return /* @__PURE__ */ e(j, { appearance: g, children: /* @__PURE__ */ t("div", { className: "ss-auth-card", style: { maxWidth: "640px" }, children: [
|
|
4111
4118
|
/* @__PURE__ */ t("div", { className: "ss-auth-profile-header", children: [
|
|
4112
|
-
/* @__PURE__ */ t("div", { className: "ss-auth-avatar-lg", onClick: () =>
|
|
4119
|
+
/* @__PURE__ */ t("div", { className: "ss-auth-avatar-lg", onClick: () => E(!0), children: [
|
|
4113
4120
|
y ? /* @__PURE__ */ e("img", { src: y, alt: "" }) : /* @__PURE__ */ e("div", { style: {
|
|
4114
4121
|
width: "100%",
|
|
4115
4122
|
height: "100%",
|
|
@@ -4119,33 +4126,33 @@ function ie({ appearance: a }) {
|
|
|
4119
4126
|
fontSize: "48px",
|
|
4120
4127
|
fontWeight: 800,
|
|
4121
4128
|
opacity: 0.4
|
|
4122
|
-
}, children:
|
|
4129
|
+
}, children: k }),
|
|
4123
4130
|
/* @__PURE__ */ t("div", { className: "ss-auth-avatar-overlay", children: [
|
|
4124
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
4131
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.camera }),
|
|
4125
4132
|
/* @__PURE__ */ e("span", { children: "Edit" })
|
|
4126
4133
|
] })
|
|
4127
4134
|
] }),
|
|
4128
4135
|
/* @__PURE__ */ t("div", { className: "ss-auth-profile-info", children: [
|
|
4129
4136
|
/* @__PURE__ */ t("h2", { className: "ss-auth-profile-name", children: [
|
|
4130
|
-
|
|
4131
|
-
|
|
4132
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", style: { fontSize: "12px", fontVariationSettings: "'FILL' 1" }, children:
|
|
4137
|
+
s.name || "Unnamed User",
|
|
4138
|
+
s.emailVerified && /* @__PURE__ */ t("span", { className: "ss-auth-badge ss-auth-badge-success", children: [
|
|
4139
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", style: { fontSize: "12px", fontVariationSettings: "'FILL' 1" }, children: S.verified }),
|
|
4133
4140
|
"Verified"
|
|
4134
4141
|
] })
|
|
4135
4142
|
] }),
|
|
4136
|
-
/* @__PURE__ */ e("p", { className: "ss-auth-profile-desc", children:
|
|
4143
|
+
/* @__PURE__ */ e("p", { className: "ss-auth-profile-desc", children: s.email })
|
|
4137
4144
|
] })
|
|
4138
4145
|
] }),
|
|
4139
4146
|
/* @__PURE__ */ t("div", { className: "ss-auth-card-body", children: [
|
|
4140
|
-
|
|
4141
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
4142
|
-
/* @__PURE__ */ e("span", { children:
|
|
4147
|
+
i && /* @__PURE__ */ t("div", { className: "ss-auth-error", children: [
|
|
4148
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.errorOutline }),
|
|
4149
|
+
/* @__PURE__ */ e("span", { children: i })
|
|
4143
4150
|
] }),
|
|
4144
|
-
|
|
4145
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
4146
|
-
/* @__PURE__ */ e("span", { children:
|
|
4151
|
+
o && /* @__PURE__ */ t("div", { className: "ss-auth-info-box", style: { marginBottom: "16px" }, children: [
|
|
4152
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.check }),
|
|
4153
|
+
/* @__PURE__ */ e("span", { children: o })
|
|
4147
4154
|
] }),
|
|
4148
|
-
/* @__PURE__ */ t("form", { onSubmit:
|
|
4155
|
+
/* @__PURE__ */ t("form", { onSubmit: B, children: [
|
|
4149
4156
|
/* @__PURE__ */ t("div", { className: "ss-auth-field", children: [
|
|
4150
4157
|
/* @__PURE__ */ e("label", { className: "ss-auth-label", children: "Full Name" }),
|
|
4151
4158
|
/* @__PURE__ */ e(
|
|
@@ -4154,8 +4161,8 @@ function ie({ appearance: a }) {
|
|
|
4154
4161
|
className: "ss-auth-input",
|
|
4155
4162
|
type: "text",
|
|
4156
4163
|
placeholder: "Your name",
|
|
4157
|
-
value:
|
|
4158
|
-
onChange: (
|
|
4164
|
+
value: v,
|
|
4165
|
+
onChange: (T) => x(T.target.value)
|
|
4159
4166
|
}
|
|
4160
4167
|
)
|
|
4161
4168
|
] }),
|
|
@@ -4163,34 +4170,34 @@ function ie({ appearance: a }) {
|
|
|
4163
4170
|
/* @__PURE__ */ t("div", { children: [
|
|
4164
4171
|
/* @__PURE__ */ e("label", { className: "ss-auth-label", children: "Email Address" }),
|
|
4165
4172
|
/* @__PURE__ */ t("div", { style: { position: "relative" }, children: [
|
|
4166
|
-
/* @__PURE__ */ e("input", { className: "ss-auth-input ss-auth-input-readonly", type: "email", value:
|
|
4167
|
-
/* @__PURE__ */ e("span", { className: "ss-auth-visibility-toggle", style: { cursor: "default" }, children: /* @__PURE__ */ e("span", { className: "material-symbols-outlined", style: { fontSize: "18px" }, children:
|
|
4173
|
+
/* @__PURE__ */ e("input", { className: "ss-auth-input ss-auth-input-readonly", type: "email", value: s.email, readOnly: !0 }),
|
|
4174
|
+
/* @__PURE__ */ e("span", { className: "ss-auth-visibility-toggle", style: { cursor: "default" }, children: /* @__PURE__ */ e("span", { className: "material-symbols-outlined", style: { fontSize: "18px" }, children: S.lock }) })
|
|
4168
4175
|
] })
|
|
4169
4176
|
] }),
|
|
4170
4177
|
/* @__PURE__ */ t("div", { children: [
|
|
4171
4178
|
/* @__PURE__ */ e("label", { className: "ss-auth-label", children: "Auth Provider" }),
|
|
4172
4179
|
/* @__PURE__ */ t("div", { style: { position: "relative" }, children: [
|
|
4173
|
-
/* @__PURE__ */ e("input", { className: "ss-auth-input ss-auth-input-readonly", type: "text", value:
|
|
4174
|
-
/* @__PURE__ */ e("span", { className: "ss-auth-visibility-toggle", style: { cursor: "default" }, children: /* @__PURE__ */ e("span", { className: "material-symbols-outlined", style: { fontSize: "18px" }, children:
|
|
4180
|
+
/* @__PURE__ */ e("input", { className: "ss-auth-input ss-auth-input-readonly", type: "text", value: s.provider, readOnly: !0 }),
|
|
4181
|
+
/* @__PURE__ */ e("span", { className: "ss-auth-visibility-toggle", style: { cursor: "default" }, children: /* @__PURE__ */ e("span", { className: "material-symbols-outlined", style: { fontSize: "18px" }, children: S.cloudDone }) })
|
|
4175
4182
|
] })
|
|
4176
4183
|
] })
|
|
4177
4184
|
] }),
|
|
4178
|
-
/* @__PURE__ */ e("div", { style: { display: "flex", justifyContent: "flex-end" }, children: /* @__PURE__ */ t("button", { type: "submit", className: "ss-auth-btn-primary ss-auth-btn-sm", disabled:
|
|
4179
|
-
|
|
4185
|
+
/* @__PURE__ */ e("div", { style: { display: "flex", justifyContent: "flex-end" }, children: /* @__PURE__ */ t("button", { type: "submit", className: "ss-auth-btn-primary ss-auth-btn-sm", disabled: d, style: { width: "auto" }, children: [
|
|
4186
|
+
d && /* @__PURE__ */ e("span", { className: "ss-auth-spinner" }),
|
|
4180
4187
|
"Save changes"
|
|
4181
4188
|
] }) })
|
|
4182
4189
|
] }),
|
|
4183
|
-
|
|
4190
|
+
L && /* @__PURE__ */ t("div", { className: "ss-auth-section", children: [
|
|
4184
4191
|
/* @__PURE__ */ t("div", { className: "ss-auth-section-title", children: [
|
|
4185
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
4192
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.security }),
|
|
4186
4193
|
"Security Credentials"
|
|
4187
4194
|
] }),
|
|
4188
4195
|
/* @__PURE__ */ e("p", { className: "ss-auth-section-desc", style: { marginBottom: "24px" }, children: "Update your password to keep your account secure." }),
|
|
4189
|
-
|
|
4190
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
4191
|
-
/* @__PURE__ */ e("span", { children:
|
|
4196
|
+
b && /* @__PURE__ */ t("div", { className: "ss-auth-error", children: [
|
|
4197
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.errorOutline }),
|
|
4198
|
+
/* @__PURE__ */ e("span", { children: b })
|
|
4192
4199
|
] }),
|
|
4193
|
-
/* @__PURE__ */ t("form", { onSubmit:
|
|
4200
|
+
/* @__PURE__ */ t("form", { onSubmit: M, children: [
|
|
4194
4201
|
/* @__PURE__ */ t("div", { className: "ss-auth-field", children: [
|
|
4195
4202
|
/* @__PURE__ */ e("label", { className: "ss-auth-label", children: "Current Password" }),
|
|
4196
4203
|
/* @__PURE__ */ e(
|
|
@@ -4200,7 +4207,7 @@ function ie({ appearance: a }) {
|
|
|
4200
4207
|
type: "password",
|
|
4201
4208
|
placeholder: "••••••••••••",
|
|
4202
4209
|
value: C,
|
|
4203
|
-
onChange: (
|
|
4210
|
+
onChange: (T) => f(T.target.value),
|
|
4204
4211
|
required: !0
|
|
4205
4212
|
}
|
|
4206
4213
|
)
|
|
@@ -4214,8 +4221,8 @@ function ie({ appearance: a }) {
|
|
|
4214
4221
|
className: "ss-auth-input",
|
|
4215
4222
|
type: "password",
|
|
4216
4223
|
placeholder: "Min. 8 characters",
|
|
4217
|
-
value:
|
|
4218
|
-
onChange: (
|
|
4224
|
+
value: O,
|
|
4225
|
+
onChange: (T) => I(T.target.value),
|
|
4219
4226
|
required: !0
|
|
4220
4227
|
}
|
|
4221
4228
|
)
|
|
@@ -4229,22 +4236,22 @@ function ie({ appearance: a }) {
|
|
|
4229
4236
|
type: "password",
|
|
4230
4237
|
placeholder: "Repeat new password",
|
|
4231
4238
|
value: F,
|
|
4232
|
-
onChange: (
|
|
4239
|
+
onChange: (T) => A(T.target.value),
|
|
4233
4240
|
required: !0
|
|
4234
4241
|
}
|
|
4235
4242
|
)
|
|
4236
4243
|
] })
|
|
4237
4244
|
] }),
|
|
4238
4245
|
/* @__PURE__ */ t("div", { className: "ss-auth-info-box", style: { marginBottom: "16px" }, children: [
|
|
4239
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
4246
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.info }),
|
|
4240
4247
|
/* @__PURE__ */ e("span", { children: "Password must be at least 8 characters long." })
|
|
4241
4248
|
] }),
|
|
4242
|
-
/* @__PURE__ */ e("div", { style: { display: "flex", justifyContent: "flex-end" }, children: /* @__PURE__ */ e("button", { type: "submit", className: "ss-auth-btn-ghost", disabled:
|
|
4249
|
+
/* @__PURE__ */ e("div", { style: { display: "flex", justifyContent: "flex-end" }, children: /* @__PURE__ */ e("button", { type: "submit", className: "ss-auth-btn-ghost", disabled: d, children: "Update Security" }) })
|
|
4243
4250
|
] })
|
|
4244
4251
|
] }),
|
|
4245
4252
|
/* @__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: [
|
|
4246
4253
|
/* @__PURE__ */ t("div", { className: "ss-auth-signout-info", children: [
|
|
4247
|
-
/* @__PURE__ */ e("div", { className: "ss-auth-signout-icon", children: /* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
4254
|
+
/* @__PURE__ */ e("div", { className: "ss-auth-signout-icon", children: /* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.logout }) }),
|
|
4248
4255
|
/* @__PURE__ */ t("div", { children: [
|
|
4249
4256
|
/* @__PURE__ */ e("div", { className: "ss-auth-signout-title", children: "End Session" }),
|
|
4250
4257
|
/* @__PURE__ */ e("div", { className: "ss-auth-signout-desc", children: "Terminate your active session" })
|
|
@@ -4255,104 +4262,104 @@ function ie({ appearance: a }) {
|
|
|
4255
4262
|
{
|
|
4256
4263
|
type: "button",
|
|
4257
4264
|
className: "ss-auth-btn-outline",
|
|
4258
|
-
onClick: () =>
|
|
4265
|
+
onClick: () => l(),
|
|
4259
4266
|
style: { width: "auto", flexShrink: 0 },
|
|
4260
4267
|
children: "Sign out"
|
|
4261
4268
|
}
|
|
4262
4269
|
)
|
|
4263
4270
|
] }) }) })
|
|
4264
4271
|
] }),
|
|
4265
|
-
|
|
4272
|
+
N && /* @__PURE__ */ e(
|
|
4266
4273
|
ca,
|
|
4267
4274
|
{
|
|
4268
|
-
onUpload:
|
|
4269
|
-
onClose: () =>
|
|
4270
|
-
isLoading:
|
|
4275
|
+
onUpload: z,
|
|
4276
|
+
onClose: () => E(!1),
|
|
4277
|
+
isLoading: d
|
|
4271
4278
|
}
|
|
4272
4279
|
)
|
|
4273
4280
|
] }) });
|
|
4274
4281
|
}
|
|
4275
|
-
function
|
|
4276
|
-
const { appearance:
|
|
4277
|
-
C.current && !
|
|
4282
|
+
function de({ appearance: a, onOrgChange: r }) {
|
|
4283
|
+
const { appearance: s } = D(), { orgs: l, selectedOrg: n, selectOrg: u, createOrg: c, isLoading: d } = Y(), i = a ?? s, [o, m] = h(!1), [p, g] = h(""), [v, x] = h(""), [y, P] = h(null), [N, E] = h(!1), C = W(null), f = $((b) => {
|
|
4284
|
+
C.current && !b.composedPath().includes(C.current) && m(!1);
|
|
4278
4285
|
}, []);
|
|
4279
|
-
|
|
4280
|
-
if (
|
|
4281
|
-
const
|
|
4282
|
-
document.addEventListener("click",
|
|
4286
|
+
U(() => {
|
|
4287
|
+
if (o) {
|
|
4288
|
+
const b = setTimeout(() => {
|
|
4289
|
+
document.addEventListener("click", f);
|
|
4283
4290
|
}, 0);
|
|
4284
4291
|
return () => {
|
|
4285
|
-
clearTimeout(
|
|
4292
|
+
clearTimeout(b), document.removeEventListener("click", f);
|
|
4286
4293
|
};
|
|
4287
4294
|
}
|
|
4288
|
-
}, [
|
|
4289
|
-
const
|
|
4290
|
-
|
|
4291
|
-
}, []),
|
|
4292
|
-
async (
|
|
4293
|
-
|
|
4295
|
+
}, [o, f]);
|
|
4296
|
+
const O = $((b) => {
|
|
4297
|
+
g(b), x(b.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, ""));
|
|
4298
|
+
}, []), I = $(
|
|
4299
|
+
async (b) => {
|
|
4300
|
+
b.preventDefault(), P(null), E(!0);
|
|
4294
4301
|
try {
|
|
4295
|
-
const
|
|
4296
|
-
|
|
4297
|
-
} catch (
|
|
4298
|
-
|
|
4302
|
+
const w = await c(p, v);
|
|
4303
|
+
w && (await u(w.id), r == null || r(w), g(""), x(""), m(!1));
|
|
4304
|
+
} catch (w) {
|
|
4305
|
+
P(w instanceof Error ? w.message : "Failed to create organization");
|
|
4299
4306
|
} finally {
|
|
4300
|
-
|
|
4307
|
+
E(!1);
|
|
4301
4308
|
}
|
|
4302
4309
|
},
|
|
4303
|
-
[p,
|
|
4310
|
+
[p, v, c, u, r]
|
|
4304
4311
|
);
|
|
4305
|
-
if (
|
|
4306
|
-
const F = (n == null ? void 0 : n.name) ?? (
|
|
4307
|
-
return /* @__PURE__ */ e(
|
|
4312
|
+
if (d) return null;
|
|
4313
|
+
const F = (n == null ? void 0 : n.name) ?? (l.length === 0 ? "No organization" : "Select organization"), A = n ? n.name.split(" ").map((b) => b[0]).join("").slice(0, 2).toUpperCase() : "--";
|
|
4314
|
+
return /* @__PURE__ */ e(j, { appearance: i, children: /* @__PURE__ */ t("div", { style: { position: "relative", display: "inline-block", width: "100%", maxWidth: "360px" }, ref: C, children: [
|
|
4308
4315
|
/* @__PURE__ */ t(
|
|
4309
4316
|
"button",
|
|
4310
4317
|
{
|
|
4311
4318
|
type: "button",
|
|
4312
4319
|
className: "ss-auth-org-trigger",
|
|
4313
|
-
onClick: () =>
|
|
4320
|
+
onClick: () => m(!o),
|
|
4314
4321
|
children: [
|
|
4315
4322
|
/* @__PURE__ */ t("div", { className: "ss-auth-org-trigger-inner", children: [
|
|
4316
|
-
/* @__PURE__ */ e("div", { className: "ss-auth-org-avatar", children:
|
|
4323
|
+
/* @__PURE__ */ e("div", { className: "ss-auth-org-avatar", children: A }),
|
|
4317
4324
|
/* @__PURE__ */ t("div", { style: { textAlign: "left" }, children: [
|
|
4318
4325
|
/* @__PURE__ */ e("div", { className: "ss-auth-org-trigger-label", children: "Current Organization" }),
|
|
4319
4326
|
/* @__PURE__ */ e("div", { className: "ss-auth-org-trigger-name", children: F })
|
|
4320
4327
|
] })
|
|
4321
4328
|
] }),
|
|
4322
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
4329
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.unfoldMore })
|
|
4323
4330
|
]
|
|
4324
4331
|
}
|
|
4325
4332
|
),
|
|
4326
|
-
|
|
4333
|
+
o && /* @__PURE__ */ t("div", { className: "ss-auth-dropdown ss-auth-dropdown-left ss-auth-glass-panel", style: { width: "100%" }, children: [
|
|
4327
4334
|
/* @__PURE__ */ e("div", { className: "ss-auth-section-label", children: "Your Organizations" }),
|
|
4328
|
-
/* @__PURE__ */ e("div", { style: { padding: "0 8px 4px" }, children:
|
|
4329
|
-
const
|
|
4335
|
+
/* @__PURE__ */ e("div", { style: { padding: "0 8px 4px" }, children: l.map((b) => {
|
|
4336
|
+
const w = (n == null ? void 0 : n.id) === b.id, B = b.name.split(" ").map((z) => z[0]).join("").slice(0, 2).toUpperCase();
|
|
4330
4337
|
return /* @__PURE__ */ t(
|
|
4331
4338
|
"button",
|
|
4332
4339
|
{
|
|
4333
4340
|
type: "button",
|
|
4334
|
-
className: `ss-auth-org-item${
|
|
4341
|
+
className: `ss-auth-org-item${w ? " ss-auth-org-item-active" : ""}`,
|
|
4335
4342
|
onClick: async () => {
|
|
4336
|
-
|
|
4343
|
+
m(!1), await u(b.id), r == null || r(b);
|
|
4337
4344
|
},
|
|
4338
4345
|
children: [
|
|
4339
4346
|
/* @__PURE__ */ t("div", { className: "ss-auth-org-item-inner", children: [
|
|
4340
|
-
/* @__PURE__ */ e("div", { className: `ss-auth-org-avatar${
|
|
4341
|
-
/* @__PURE__ */ e("span", { style: { fontFamily: "'Manrope', sans-serif", letterSpacing: "-0.01em" }, children:
|
|
4347
|
+
/* @__PURE__ */ e("div", { className: `ss-auth-org-avatar${w ? "" : " ss-auth-org-avatar-inactive"}`, children: B }),
|
|
4348
|
+
/* @__PURE__ */ e("span", { style: { fontFamily: "'Manrope', sans-serif", letterSpacing: "-0.01em" }, children: b.name })
|
|
4342
4349
|
] }),
|
|
4343
|
-
|
|
4350
|
+
w && /* @__PURE__ */ e("span", { className: "material-symbols-outlined ss-auth-org-check", style: { fontSize: "18px" }, children: S.checkCircle })
|
|
4344
4351
|
]
|
|
4345
4352
|
},
|
|
4346
|
-
|
|
4353
|
+
b.id
|
|
4347
4354
|
);
|
|
4348
4355
|
}) }),
|
|
4349
4356
|
/* @__PURE__ */ t("div", { className: "ss-auth-org-create", children: [
|
|
4350
4357
|
/* @__PURE__ */ t("div", { className: "ss-auth-org-create-header", children: [
|
|
4351
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
4358
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.addCircle }),
|
|
4352
4359
|
/* @__PURE__ */ e("span", { children: "Create organization" })
|
|
4353
4360
|
] }),
|
|
4354
4361
|
y && /* @__PURE__ */ e("div", { className: "ss-auth-error", style: { marginBottom: "12px", fontSize: "12px" }, children: /* @__PURE__ */ e("span", { children: y }) }),
|
|
4355
|
-
/* @__PURE__ */ t("form", { onSubmit:
|
|
4362
|
+
/* @__PURE__ */ t("form", { onSubmit: I, children: [
|
|
4356
4363
|
/* @__PURE__ */ t("div", { className: "ss-auth-field", children: [
|
|
4357
4364
|
/* @__PURE__ */ e("label", { className: "ss-auth-label", style: { fontSize: "10px" }, children: "Org Name" }),
|
|
4358
4365
|
/* @__PURE__ */ e(
|
|
@@ -4362,7 +4369,7 @@ function le({ appearance: a, onOrgChange: s }) {
|
|
|
4362
4369
|
type: "text",
|
|
4363
4370
|
placeholder: "e.g. Nexus Dynamics",
|
|
4364
4371
|
value: p,
|
|
4365
|
-
onChange: (
|
|
4372
|
+
onChange: (b) => O(b.target.value),
|
|
4366
4373
|
required: !0,
|
|
4367
4374
|
style: { fontSize: "13px", padding: "10px 12px" }
|
|
4368
4375
|
}
|
|
@@ -4378,8 +4385,8 @@ function le({ appearance: a, onOrgChange: s }) {
|
|
|
4378
4385
|
className: "ss-auth-input",
|
|
4379
4386
|
type: "text",
|
|
4380
4387
|
placeholder: "nexus-dynamics",
|
|
4381
|
-
value:
|
|
4382
|
-
onChange: (
|
|
4388
|
+
value: v,
|
|
4389
|
+
onChange: (b) => x(b.target.value),
|
|
4383
4390
|
required: !0,
|
|
4384
4391
|
style: { fontSize: "13px", padding: "10px 12px 10px 22px" }
|
|
4385
4392
|
}
|
|
@@ -4391,10 +4398,10 @@ function le({ appearance: a, onOrgChange: s }) {
|
|
|
4391
4398
|
{
|
|
4392
4399
|
type: "submit",
|
|
4393
4400
|
className: "ss-auth-btn-primary",
|
|
4394
|
-
disabled:
|
|
4401
|
+
disabled: N || !p.trim(),
|
|
4395
4402
|
style: { marginTop: "8px" },
|
|
4396
4403
|
children: [
|
|
4397
|
-
|
|
4404
|
+
N && /* @__PURE__ */ e("span", { className: "ss-auth-spinner" }),
|
|
4398
4405
|
"Initialize Organization"
|
|
4399
4406
|
]
|
|
4400
4407
|
}
|
|
@@ -4404,205 +4411,205 @@ function le({ appearance: a, onOrgChange: s }) {
|
|
|
4404
4411
|
] })
|
|
4405
4412
|
] }) });
|
|
4406
4413
|
}
|
|
4407
|
-
function
|
|
4414
|
+
function Aa(a, r = "USD") {
|
|
4408
4415
|
return new Intl.NumberFormat("en-US", {
|
|
4409
4416
|
style: "currency",
|
|
4410
|
-
currency:
|
|
4417
|
+
currency: r,
|
|
4411
4418
|
minimumFractionDigits: a % 100 === 0 ? 0 : 2
|
|
4412
4419
|
}).format(a / 100);
|
|
4413
4420
|
}
|
|
4414
|
-
function
|
|
4415
|
-
const { appearance: u } =
|
|
4416
|
-
return /* @__PURE__ */ e(
|
|
4417
|
-
const
|
|
4418
|
-
return /* @__PURE__ */ t("div", { className: `ss-pricing-card ${
|
|
4421
|
+
function ue({ plans: a, currentPlanId: r, onSelectPlan: s, interval: l, appearance: n }) {
|
|
4422
|
+
const { appearance: u } = D(), c = n ?? u, d = l ? a.filter((i) => i.interval === l || i.isFree) : a;
|
|
4423
|
+
return /* @__PURE__ */ e(j, { appearance: c, children: /* @__PURE__ */ e("div", { className: "ss-pricing-grid", children: d.map((i) => {
|
|
4424
|
+
const o = i.id === r;
|
|
4425
|
+
return /* @__PURE__ */ t("div", { className: `ss-pricing-card ${o ? "ss-pricing-card-current" : ""}`, children: [
|
|
4419
4426
|
/* @__PURE__ */ t("div", { className: "ss-pricing-header", children: [
|
|
4420
|
-
/* @__PURE__ */ e("h3", { className: "ss-pricing-name", children:
|
|
4421
|
-
|
|
4422
|
-
|
|
4427
|
+
/* @__PURE__ */ e("h3", { className: "ss-pricing-name", children: i.name }),
|
|
4428
|
+
i.trialDays > 0 && /* @__PURE__ */ t("span", { className: "ss-badge ss-badge-trialing", children: [
|
|
4429
|
+
i.trialDays,
|
|
4423
4430
|
"-day trial"
|
|
4424
4431
|
] }),
|
|
4425
|
-
|
|
4432
|
+
i.isFree && /* @__PURE__ */ e("span", { className: "ss-badge ss-badge-active", children: "Free" })
|
|
4426
4433
|
] }),
|
|
4427
|
-
/* @__PURE__ */ e("div", { className: "ss-pricing-price", children:
|
|
4428
|
-
/* @__PURE__ */ e("span", { className: "ss-pricing-amount", children:
|
|
4434
|
+
/* @__PURE__ */ e("div", { className: "ss-pricing-price", children: i.isFree ? /* @__PURE__ */ e("span", { className: "ss-pricing-amount", children: "Free" }) : /* @__PURE__ */ t(H, { children: [
|
|
4435
|
+
/* @__PURE__ */ e("span", { className: "ss-pricing-amount", children: Aa(i.amountCents, i.currency) }),
|
|
4429
4436
|
/* @__PURE__ */ t("span", { className: "ss-pricing-interval", children: [
|
|
4430
4437
|
"/",
|
|
4431
|
-
|
|
4438
|
+
i.interval
|
|
4432
4439
|
] })
|
|
4433
4440
|
] }) }),
|
|
4434
|
-
|
|
4435
|
-
|
|
4441
|
+
i.description && /* @__PURE__ */ e("p", { className: "ss-pricing-desc", children: i.description }),
|
|
4442
|
+
i.features.length > 0 && /* @__PURE__ */ e("ul", { className: "ss-pricing-features", children: i.features.map((m, p) => /* @__PURE__ */ t("li", { className: "ss-pricing-feature", children: [
|
|
4436
4443
|
/* @__PURE__ */ e("span", { className: "ss-check", children: "✓" }),
|
|
4437
4444
|
" ",
|
|
4438
|
-
|
|
4445
|
+
m
|
|
4439
4446
|
] }, p)) }),
|
|
4440
4447
|
/* @__PURE__ */ e(
|
|
4441
4448
|
"button",
|
|
4442
4449
|
{
|
|
4443
4450
|
type: "button",
|
|
4444
|
-
className: `ss-btn ${
|
|
4445
|
-
disabled:
|
|
4446
|
-
onClick: () =>
|
|
4447
|
-
children:
|
|
4451
|
+
className: `ss-btn ${o ? "ss-btn-current" : "ss-btn-primary"}`,
|
|
4452
|
+
disabled: o,
|
|
4453
|
+
onClick: () => s(i.id),
|
|
4454
|
+
children: o ? "Current plan" : "Select plan"
|
|
4448
4455
|
}
|
|
4449
4456
|
)
|
|
4450
|
-
] },
|
|
4457
|
+
] }, i.id);
|
|
4451
4458
|
}) }) });
|
|
4452
4459
|
}
|
|
4453
|
-
function
|
|
4454
|
-
const { client: a } =
|
|
4460
|
+
function pe() {
|
|
4461
|
+
const { client: a } = D();
|
|
4455
4462
|
return { billing: a.billing };
|
|
4456
4463
|
}
|
|
4457
4464
|
function Z(a) {
|
|
4458
|
-
const { client:
|
|
4465
|
+
const { client: r } = D();
|
|
4459
4466
|
return G(() => {
|
|
4460
4467
|
if (a) {
|
|
4461
|
-
const
|
|
4462
|
-
return new
|
|
4468
|
+
const s = new Q("https://api.saas-support.com/v1", { type: "portalToken", token: a });
|
|
4469
|
+
return new wa(s);
|
|
4463
4470
|
}
|
|
4464
|
-
return
|
|
4465
|
-
}, [
|
|
4471
|
+
return r.billing;
|
|
4472
|
+
}, [r, a]);
|
|
4466
4473
|
}
|
|
4467
|
-
function
|
|
4468
|
-
const
|
|
4469
|
-
|
|
4474
|
+
function Ta(a, r) {
|
|
4475
|
+
const s = Z(r), [l, n] = h(null), [u, c] = h(!0), [d, i] = h(null), o = $(async () => {
|
|
4476
|
+
c(!0), i(null);
|
|
4470
4477
|
try {
|
|
4471
|
-
const
|
|
4472
|
-
n(
|
|
4473
|
-
} catch (
|
|
4474
|
-
|
|
4478
|
+
const m = await s.getCustomer(a);
|
|
4479
|
+
n(m);
|
|
4480
|
+
} catch (m) {
|
|
4481
|
+
i(m instanceof Error ? m.message : "Failed to load subscription");
|
|
4475
4482
|
} finally {
|
|
4476
|
-
|
|
4483
|
+
c(!1);
|
|
4477
4484
|
}
|
|
4478
|
-
}, [
|
|
4479
|
-
return
|
|
4480
|
-
|
|
4481
|
-
}, [
|
|
4485
|
+
}, [s, a]);
|
|
4486
|
+
return U(() => {
|
|
4487
|
+
o();
|
|
4488
|
+
}, [o]), { customer: l, isLoading: u, error: d, refresh: o };
|
|
4482
4489
|
}
|
|
4483
|
-
function
|
|
4484
|
-
const
|
|
4485
|
-
|
|
4490
|
+
function Da(a, r) {
|
|
4491
|
+
const s = Z(r), [l, n] = h([]), [u, c] = h(!0), [d, i] = h(null), o = $(async () => {
|
|
4492
|
+
c(!0), i(null);
|
|
4486
4493
|
try {
|
|
4487
|
-
const
|
|
4488
|
-
n(
|
|
4489
|
-
} catch (
|
|
4490
|
-
|
|
4494
|
+
const m = await s.getInvoices(a);
|
|
4495
|
+
n(m);
|
|
4496
|
+
} catch (m) {
|
|
4497
|
+
i(m instanceof Error ? m.message : "Failed to load invoices");
|
|
4491
4498
|
} finally {
|
|
4492
|
-
|
|
4499
|
+
c(!1);
|
|
4493
4500
|
}
|
|
4494
|
-
}, [
|
|
4495
|
-
return
|
|
4496
|
-
|
|
4497
|
-
}, [
|
|
4501
|
+
}, [s, a]);
|
|
4502
|
+
return U(() => {
|
|
4503
|
+
o();
|
|
4504
|
+
}, [o]), { invoices: l, isLoading: u, error: d, refresh: o };
|
|
4498
4505
|
}
|
|
4499
|
-
function
|
|
4500
|
-
const
|
|
4501
|
-
|
|
4506
|
+
function Ma(a, r) {
|
|
4507
|
+
const s = Z(r), [l, n] = h([]), [u, c] = h(!0), [d, i] = h(null), o = $(async () => {
|
|
4508
|
+
c(!0), i(null);
|
|
4502
4509
|
try {
|
|
4503
|
-
const
|
|
4504
|
-
n(
|
|
4505
|
-
} catch (
|
|
4506
|
-
|
|
4510
|
+
const m = await s.getCurrentUsage(a);
|
|
4511
|
+
n(m);
|
|
4512
|
+
} catch (m) {
|
|
4513
|
+
i(m instanceof Error ? m.message : "Failed to load usage");
|
|
4507
4514
|
} finally {
|
|
4508
|
-
|
|
4515
|
+
c(!1);
|
|
4509
4516
|
}
|
|
4510
|
-
}, [
|
|
4511
|
-
return
|
|
4512
|
-
|
|
4513
|
-
}, [
|
|
4517
|
+
}, [s, a]);
|
|
4518
|
+
return U(() => {
|
|
4519
|
+
o();
|
|
4520
|
+
}, [o]), { usage: l, isLoading: u, error: d, refresh: o };
|
|
4514
4521
|
}
|
|
4515
|
-
const
|
|
4522
|
+
const Va = {
|
|
4516
4523
|
active: "ss-badge-active"
|
|
4517
4524
|
};
|
|
4518
|
-
function
|
|
4525
|
+
function Ua({
|
|
4519
4526
|
customerId: a,
|
|
4520
|
-
portalToken:
|
|
4521
|
-
onChangePlan:
|
|
4522
|
-
onCancel:
|
|
4527
|
+
portalToken: r,
|
|
4528
|
+
onChangePlan: s,
|
|
4529
|
+
onCancel: l,
|
|
4523
4530
|
appearance: n
|
|
4524
4531
|
}) {
|
|
4525
|
-
const { appearance: u } =
|
|
4526
|
-
return /* @__PURE__ */ e(
|
|
4532
|
+
const { appearance: u } = D(), { customer: c, isLoading: d, error: i } = Ta(a, r);
|
|
4533
|
+
return /* @__PURE__ */ e(j, { appearance: n ?? u, children: /* @__PURE__ */ t("div", { className: "ss-card", children: [
|
|
4527
4534
|
/* @__PURE__ */ e("h2", { className: "ss-title", children: "Subscription" }),
|
|
4528
|
-
|
|
4535
|
+
d && /* @__PURE__ */ t("div", { className: "ss-loading", children: [
|
|
4529
4536
|
/* @__PURE__ */ e("span", { className: "ss-spinner" }),
|
|
4530
4537
|
" Loading..."
|
|
4531
4538
|
] }),
|
|
4532
|
-
|
|
4533
|
-
|
|
4539
|
+
i && /* @__PURE__ */ e("div", { className: "ss-global-error", children: i }),
|
|
4540
|
+
c && !d && /* @__PURE__ */ t(H, { children: [
|
|
4534
4541
|
/* @__PURE__ */ t("div", { className: "ss-field", children: [
|
|
4535
4542
|
/* @__PURE__ */ e("label", { className: "ss-label", children: "Customer" }),
|
|
4536
|
-
/* @__PURE__ */ e("input", { className: "ss-input", value:
|
|
4543
|
+
/* @__PURE__ */ e("input", { className: "ss-input", value: c.name || c.email, disabled: !0, readOnly: !0 })
|
|
4537
4544
|
] }),
|
|
4538
4545
|
/* @__PURE__ */ t("div", { className: "ss-field", children: [
|
|
4539
4546
|
/* @__PURE__ */ e("label", { className: "ss-label", children: "Status" }),
|
|
4540
|
-
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e("span", { className: `ss-badge ${
|
|
4547
|
+
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e("span", { className: `ss-badge ${Va.active}`, children: "Active" }) })
|
|
4541
4548
|
] }),
|
|
4542
4549
|
/* @__PURE__ */ t("div", { className: "ss-btn-group", children: [
|
|
4543
|
-
|
|
4544
|
-
|
|
4550
|
+
s && /* @__PURE__ */ e("button", { type: "button", className: "ss-btn ss-btn-primary", onClick: s, children: "Change plan" }),
|
|
4551
|
+
l && /* @__PURE__ */ e("button", { type: "button", className: "ss-btn ss-btn-danger", onClick: l, children: "Cancel subscription" })
|
|
4545
4552
|
] })
|
|
4546
4553
|
] })
|
|
4547
4554
|
] }) });
|
|
4548
4555
|
}
|
|
4549
|
-
const
|
|
4556
|
+
const Ra = {
|
|
4550
4557
|
paid: "ss-badge-active",
|
|
4551
4558
|
open: "ss-badge-trialing",
|
|
4552
4559
|
draft: "ss-badge-paused",
|
|
4553
4560
|
void: "ss-badge-canceled",
|
|
4554
4561
|
uncollectible: "ss-badge-past-due"
|
|
4555
4562
|
};
|
|
4556
|
-
function
|
|
4563
|
+
function Ha(a) {
|
|
4557
4564
|
return new Date(a).toLocaleDateString("en-US", { year: "numeric", month: "short", day: "numeric" });
|
|
4558
4565
|
}
|
|
4559
|
-
function
|
|
4566
|
+
function ja(a) {
|
|
4560
4567
|
return new Intl.NumberFormat("en-US", { style: "currency", currency: "USD", minimumFractionDigits: 2 }).format(a / 100);
|
|
4561
4568
|
}
|
|
4562
|
-
function
|
|
4563
|
-
const { appearance:
|
|
4564
|
-
return /* @__PURE__ */ e(
|
|
4569
|
+
function qa({ customerId: a, portalToken: r, appearance: s }) {
|
|
4570
|
+
const { appearance: l } = D(), { invoices: n, isLoading: u, error: c } = Da(a, r), d = s ?? l, i = [...n].sort((o, m) => new Date(m.createdAt).getTime() - new Date(o.createdAt).getTime());
|
|
4571
|
+
return /* @__PURE__ */ e(j, { appearance: d, children: /* @__PURE__ */ t("div", { className: "ss-card ss-card-wide", children: [
|
|
4565
4572
|
/* @__PURE__ */ e("h2", { className: "ss-title", children: "Invoices" }),
|
|
4566
4573
|
u && /* @__PURE__ */ t("div", { className: "ss-loading", children: [
|
|
4567
4574
|
/* @__PURE__ */ e("span", { className: "ss-spinner" }),
|
|
4568
4575
|
" Loading..."
|
|
4569
4576
|
] }),
|
|
4570
|
-
|
|
4571
|
-
!u &&
|
|
4572
|
-
!u &&
|
|
4577
|
+
c && /* @__PURE__ */ e("div", { className: "ss-global-error", children: c }),
|
|
4578
|
+
!u && i.length === 0 && /* @__PURE__ */ e("p", { className: "ss-empty", children: "No invoices yet." }),
|
|
4579
|
+
!u && i.length > 0 && /* @__PURE__ */ t("table", { className: "ss-table", children: [
|
|
4573
4580
|
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ t("tr", { children: [
|
|
4574
4581
|
/* @__PURE__ */ e("th", { className: "ss-th", children: "Date" }),
|
|
4575
4582
|
/* @__PURE__ */ e("th", { className: "ss-th", children: "Amount" }),
|
|
4576
4583
|
/* @__PURE__ */ e("th", { className: "ss-th", children: "Status" }),
|
|
4577
4584
|
/* @__PURE__ */ e("th", { className: "ss-th", children: "PDF" })
|
|
4578
4585
|
] }) }),
|
|
4579
|
-
/* @__PURE__ */ e("tbody", { children:
|
|
4580
|
-
/* @__PURE__ */ e("td", { className: "ss-td", children:
|
|
4581
|
-
/* @__PURE__ */ e("td", { className: "ss-td", children:
|
|
4582
|
-
/* @__PURE__ */ e("td", { className: "ss-td", children: /* @__PURE__ */ e("span", { className: `ss-badge ${
|
|
4583
|
-
/* @__PURE__ */ e("td", { className: "ss-td", children:
|
|
4584
|
-
] },
|
|
4586
|
+
/* @__PURE__ */ e("tbody", { children: i.map((o) => /* @__PURE__ */ t("tr", { className: "ss-tr", children: [
|
|
4587
|
+
/* @__PURE__ */ e("td", { className: "ss-td", children: Ha(o.createdAt) }),
|
|
4588
|
+
/* @__PURE__ */ e("td", { className: "ss-td", children: ja(o.amountCents) }),
|
|
4589
|
+
/* @__PURE__ */ e("td", { className: "ss-td", children: /* @__PURE__ */ e("span", { className: `ss-badge ${Ra[o.status] || ""}`, children: o.status }) }),
|
|
4590
|
+
/* @__PURE__ */ e("td", { className: "ss-td", children: o.pdfUrl ? /* @__PURE__ */ e("a", { className: "ss-link", href: o.pdfUrl, target: "_blank", rel: "noopener noreferrer", children: "Download" }) : "—" })
|
|
4591
|
+
] }, o.id)) })
|
|
4585
4592
|
] })
|
|
4586
4593
|
] }) });
|
|
4587
4594
|
}
|
|
4588
|
-
function
|
|
4589
|
-
const { appearance: n } =
|
|
4590
|
-
return /* @__PURE__ */ e(
|
|
4595
|
+
function Wa({ customerId: a, limits: r, portalToken: s, appearance: l }) {
|
|
4596
|
+
const { appearance: n } = D(), { usage: u, isLoading: c, error: d } = Ma(a, s);
|
|
4597
|
+
return /* @__PURE__ */ e(j, { appearance: l ?? n, children: /* @__PURE__ */ t("div", { className: "ss-card", children: [
|
|
4591
4598
|
/* @__PURE__ */ e("h2", { className: "ss-title", children: "Usage" }),
|
|
4592
|
-
|
|
4599
|
+
c && /* @__PURE__ */ t("div", { className: "ss-loading", children: [
|
|
4593
4600
|
/* @__PURE__ */ e("span", { className: "ss-spinner" }),
|
|
4594
4601
|
" Loading..."
|
|
4595
4602
|
] }),
|
|
4596
|
-
|
|
4597
|
-
!
|
|
4598
|
-
!
|
|
4599
|
-
const
|
|
4603
|
+
d && /* @__PURE__ */ e("div", { className: "ss-global-error", children: d }),
|
|
4604
|
+
!c && u.length === 0 && /* @__PURE__ */ e("p", { className: "ss-empty", children: "No usage data." }),
|
|
4605
|
+
!c && u.map((o) => {
|
|
4606
|
+
const m = r == null ? void 0 : r[o.metric], p = m ? Math.min(100, o.total / m * 100) : null;
|
|
4600
4607
|
return /* @__PURE__ */ t("div", { className: "ss-usage-item", children: [
|
|
4601
4608
|
/* @__PURE__ */ t("div", { className: "ss-usage-header", children: [
|
|
4602
|
-
/* @__PURE__ */ e("span", { className: "ss-usage-metric", children:
|
|
4609
|
+
/* @__PURE__ */ e("span", { className: "ss-usage-metric", children: o.metric }),
|
|
4603
4610
|
/* @__PURE__ */ t("span", { className: "ss-usage-value", children: [
|
|
4604
|
-
|
|
4605
|
-
|
|
4611
|
+
o.total.toLocaleString(),
|
|
4612
|
+
m ? ` / ${m.toLocaleString()}` : ""
|
|
4606
4613
|
] })
|
|
4607
4614
|
] }),
|
|
4608
4615
|
p !== null && /* @__PURE__ */ e("div", { className: "ss-progress-bar", children: /* @__PURE__ */ e(
|
|
@@ -4612,20 +4619,20 @@ function ja({ customerId: a, limits: s, portalToken: r, appearance: o }) {
|
|
|
4612
4619
|
style: { width: `${p}%` }
|
|
4613
4620
|
}
|
|
4614
4621
|
) })
|
|
4615
|
-
] },
|
|
4622
|
+
] }, o.metric);
|
|
4616
4623
|
})
|
|
4617
4624
|
] }) });
|
|
4618
4625
|
}
|
|
4619
|
-
function
|
|
4626
|
+
function he({
|
|
4620
4627
|
customerId: a,
|
|
4621
|
-
portalToken:
|
|
4622
|
-
limits:
|
|
4623
|
-
onChangePlan:
|
|
4628
|
+
portalToken: r,
|
|
4629
|
+
limits: s,
|
|
4630
|
+
onChangePlan: l,
|
|
4624
4631
|
onCancel: n,
|
|
4625
4632
|
appearance: u
|
|
4626
4633
|
}) {
|
|
4627
|
-
const { appearance:
|
|
4628
|
-
return /* @__PURE__ */ e(
|
|
4634
|
+
const { appearance: c } = D(), d = u ?? c, [i, o] = h("subscription");
|
|
4635
|
+
return /* @__PURE__ */ e(j, { appearance: d, children: /* @__PURE__ */ t("div", { className: "ss-card ss-card-wide", children: [
|
|
4629
4636
|
/* @__PURE__ */ e("h2", { className: "ss-title", children: "Billing" }),
|
|
4630
4637
|
/* @__PURE__ */ e("div", { className: "ss-tab-group", children: [
|
|
4631
4638
|
{ id: "subscription", label: "Subscription" },
|
|
@@ -4635,45 +4642,45 @@ function ue({
|
|
|
4635
4642
|
"button",
|
|
4636
4643
|
{
|
|
4637
4644
|
type: "button",
|
|
4638
|
-
className: `ss-tab ${
|
|
4639
|
-
onClick: () =>
|
|
4645
|
+
className: `ss-tab ${i === p.id ? "ss-tab-active" : ""}`,
|
|
4646
|
+
onClick: () => o(p.id),
|
|
4640
4647
|
children: p.label
|
|
4641
4648
|
},
|
|
4642
4649
|
p.id
|
|
4643
4650
|
)) }),
|
|
4644
4651
|
/* @__PURE__ */ t("div", { className: "ss-tab-content", children: [
|
|
4645
|
-
|
|
4646
|
-
|
|
4652
|
+
i === "subscription" && /* @__PURE__ */ e(
|
|
4653
|
+
Ua,
|
|
4647
4654
|
{
|
|
4648
4655
|
customerId: a,
|
|
4649
|
-
portalToken:
|
|
4650
|
-
onChangePlan:
|
|
4656
|
+
portalToken: r,
|
|
4657
|
+
onChangePlan: l,
|
|
4651
4658
|
onCancel: n
|
|
4652
4659
|
}
|
|
4653
4660
|
),
|
|
4654
|
-
|
|
4655
|
-
|
|
4661
|
+
i === "invoices" && /* @__PURE__ */ e(qa, { customerId: a, portalToken: r }),
|
|
4662
|
+
i === "usage" && /* @__PURE__ */ e(Wa, { customerId: a, portalToken: r, limits: s })
|
|
4656
4663
|
] })
|
|
4657
4664
|
] }) });
|
|
4658
4665
|
}
|
|
4659
|
-
function
|
|
4660
|
-
const { appearance: n } =
|
|
4661
|
-
if (
|
|
4662
|
-
|
|
4666
|
+
function ge({ customerId: a, portalToken: r, onApplied: s, appearance: l }) {
|
|
4667
|
+
const { appearance: n } = D(), u = Z(r), c = l ?? n, [d, i] = h(""), [o, m] = h(!1), [p, g] = h(null), [v, x] = h(null), y = $(async (P) => {
|
|
4668
|
+
if (P.preventDefault(), !!d.trim()) {
|
|
4669
|
+
m(!0), g(null), x(null);
|
|
4663
4670
|
try {
|
|
4664
|
-
const
|
|
4665
|
-
|
|
4666
|
-
} catch (
|
|
4667
|
-
|
|
4671
|
+
const N = await u.applyCoupon(a, d.trim());
|
|
4672
|
+
x(`Coupon applied! ${N.discountType === "percent" ? `${N.amount}% off` : `$${(N.amount / 100).toFixed(2)} off`}`), i(""), s == null || s(N);
|
|
4673
|
+
} catch (N) {
|
|
4674
|
+
g(N instanceof Error ? N.message : "Invalid coupon code");
|
|
4668
4675
|
} finally {
|
|
4669
|
-
|
|
4676
|
+
m(!1);
|
|
4670
4677
|
}
|
|
4671
4678
|
}
|
|
4672
|
-
}, [u, a,
|
|
4673
|
-
return /* @__PURE__ */ e(
|
|
4679
|
+
}, [u, a, d, s]);
|
|
4680
|
+
return /* @__PURE__ */ e(j, { appearance: c, children: /* @__PURE__ */ t("div", { className: "ss-card", children: [
|
|
4674
4681
|
/* @__PURE__ */ e("h2", { className: "ss-title", children: "Apply coupon" }),
|
|
4675
4682
|
p && /* @__PURE__ */ e("div", { className: "ss-global-error", children: p }),
|
|
4676
|
-
|
|
4683
|
+
v && /* @__PURE__ */ e("div", { className: "ss-success-msg", children: v }),
|
|
4677
4684
|
/* @__PURE__ */ t("form", { onSubmit: y, children: [
|
|
4678
4685
|
/* @__PURE__ */ t("div", { className: "ss-field", children: [
|
|
4679
4686
|
/* @__PURE__ */ e("label", { className: "ss-label", htmlFor: "ss-coupon-code", children: "Coupon code" }),
|
|
@@ -4684,102 +4691,102 @@ function pe({ customerId: a, portalToken: s, onApplied: r, appearance: o }) {
|
|
|
4684
4691
|
className: "ss-input",
|
|
4685
4692
|
type: "text",
|
|
4686
4693
|
placeholder: "Enter coupon code",
|
|
4687
|
-
value:
|
|
4688
|
-
onChange: (
|
|
4694
|
+
value: d,
|
|
4695
|
+
onChange: (P) => i(P.target.value),
|
|
4689
4696
|
required: !0
|
|
4690
4697
|
}
|
|
4691
4698
|
)
|
|
4692
4699
|
] }),
|
|
4693
|
-
/* @__PURE__ */ t("button", { type: "submit", className: "ss-btn ss-btn-primary", disabled:
|
|
4694
|
-
|
|
4700
|
+
/* @__PURE__ */ t("button", { type: "submit", className: "ss-btn ss-btn-primary", disabled: o || !d.trim(), children: [
|
|
4701
|
+
o && /* @__PURE__ */ e("span", { className: "ss-spinner" }),
|
|
4695
4702
|
"Apply"
|
|
4696
4703
|
] })
|
|
4697
4704
|
] })
|
|
4698
4705
|
] }) });
|
|
4699
4706
|
}
|
|
4700
|
-
function
|
|
4701
|
-
const { client: a } =
|
|
4707
|
+
function me() {
|
|
4708
|
+
const { client: a } = D();
|
|
4702
4709
|
return { report: a.report };
|
|
4703
4710
|
}
|
|
4704
4711
|
function da() {
|
|
4705
|
-
const { client: a } =
|
|
4706
|
-
n(!0),
|
|
4712
|
+
const { client: a } = D(), [r, s] = h(null), [l, n] = h(!1), [u, c] = h(null), d = $(async (i) => {
|
|
4713
|
+
n(!0), c(null);
|
|
4707
4714
|
try {
|
|
4708
|
-
const
|
|
4709
|
-
return
|
|
4710
|
-
} catch (
|
|
4711
|
-
return
|
|
4715
|
+
const o = await a.report.executeQuery(i);
|
|
4716
|
+
return s(o), o;
|
|
4717
|
+
} catch (o) {
|
|
4718
|
+
return c(o instanceof Error ? o.message : "Query failed"), null;
|
|
4712
4719
|
} finally {
|
|
4713
4720
|
n(!1);
|
|
4714
4721
|
}
|
|
4715
4722
|
}, [a]);
|
|
4716
|
-
return { result:
|
|
4723
|
+
return { result: r, execute: d, isLoading: l, error: u };
|
|
4717
4724
|
}
|
|
4718
|
-
function
|
|
4719
|
-
const { client:
|
|
4720
|
-
u(!0),
|
|
4725
|
+
function _a(a) {
|
|
4726
|
+
const { client: r } = D(), [s, l] = h(null), [n, u] = h(!0), [c, d] = h(null), i = $(async () => {
|
|
4727
|
+
u(!0), d(null);
|
|
4721
4728
|
try {
|
|
4722
|
-
const
|
|
4723
|
-
o
|
|
4724
|
-
} catch (
|
|
4725
|
-
|
|
4729
|
+
const o = await r.report.listQueries(a);
|
|
4730
|
+
l(o);
|
|
4731
|
+
} catch (o) {
|
|
4732
|
+
d(o instanceof Error ? o.message : "Failed to load queries");
|
|
4726
4733
|
} finally {
|
|
4727
4734
|
u(!1);
|
|
4728
4735
|
}
|
|
4729
|
-
}, [
|
|
4730
|
-
return
|
|
4731
|
-
|
|
4732
|
-
}, [
|
|
4736
|
+
}, [r, a]);
|
|
4737
|
+
return U(() => {
|
|
4738
|
+
i();
|
|
4739
|
+
}, [i]), { queries: (s == null ? void 0 : s.data) ?? [], meta: s == null ? void 0 : s.meta, isLoading: n, error: c, refresh: i };
|
|
4733
4740
|
}
|
|
4734
|
-
function
|
|
4735
|
-
const { client:
|
|
4736
|
-
u(!0),
|
|
4741
|
+
function fe(a) {
|
|
4742
|
+
const { client: r } = D(), [s, l] = h(null), [n, u] = h(!0), [c, d] = h(null), i = $(async () => {
|
|
4743
|
+
u(!0), d(null);
|
|
4737
4744
|
try {
|
|
4738
|
-
const
|
|
4739
|
-
o
|
|
4740
|
-
} catch (
|
|
4741
|
-
|
|
4745
|
+
const o = await r.report.getDashboard(a);
|
|
4746
|
+
l(o);
|
|
4747
|
+
} catch (o) {
|
|
4748
|
+
d(o instanceof Error ? o.message : "Failed to load dashboard");
|
|
4742
4749
|
} finally {
|
|
4743
4750
|
u(!1);
|
|
4744
4751
|
}
|
|
4745
|
-
}, [
|
|
4746
|
-
return
|
|
4747
|
-
|
|
4748
|
-
}, [
|
|
4752
|
+
}, [r, a]);
|
|
4753
|
+
return U(() => {
|
|
4754
|
+
i();
|
|
4755
|
+
}, [i]), { dashboard: s, isLoading: n, error: c, refresh: i };
|
|
4749
4756
|
}
|
|
4750
|
-
function
|
|
4751
|
-
const
|
|
4752
|
-
const p = new Q(
|
|
4757
|
+
function be(a, r, s = "https://api.saas-support.com/v1") {
|
|
4758
|
+
const l = G(() => {
|
|
4759
|
+
const p = new Q(s, { type: "embedToken", token: a });
|
|
4753
4760
|
return new ta(p);
|
|
4754
|
-
}, [a,
|
|
4755
|
-
|
|
4761
|
+
}, [a, s]), [n, u] = h(null), [c, d] = h(!0), [i, o] = h(null), m = $(async () => {
|
|
4762
|
+
d(!0), o(null);
|
|
4756
4763
|
try {
|
|
4757
|
-
const p = await
|
|
4764
|
+
const p = await l.getDashboard(r);
|
|
4758
4765
|
u(p);
|
|
4759
4766
|
} catch (p) {
|
|
4760
|
-
|
|
4767
|
+
o(p instanceof Error ? p.message : "Failed to load dashboard");
|
|
4761
4768
|
} finally {
|
|
4762
|
-
|
|
4769
|
+
d(!1);
|
|
4763
4770
|
}
|
|
4764
|
-
}, [
|
|
4765
|
-
return
|
|
4766
|
-
|
|
4767
|
-
}, [
|
|
4771
|
+
}, [l, r]);
|
|
4772
|
+
return U(() => {
|
|
4773
|
+
m();
|
|
4774
|
+
}, [m]), { dashboard: n, reportClient: l, isLoading: c, error: i, refresh: m };
|
|
4768
4775
|
}
|
|
4769
|
-
function
|
|
4770
|
-
const { appearance: n } =
|
|
4771
|
-
if (
|
|
4772
|
-
const
|
|
4773
|
-
|
|
4774
|
-
}, [
|
|
4775
|
-
return /* @__PURE__ */ e(
|
|
4776
|
-
|
|
4776
|
+
function xe({ onResult: a, mode: r = "both", placeholder: s, appearance: l }) {
|
|
4777
|
+
const { appearance: n } = D(), { execute: u, isLoading: c, error: d } = da(), i = l ?? n, [o, m] = h(""), [p, g] = h(r === "sql" ? "sql" : "nl"), v = $(async (x) => {
|
|
4778
|
+
if (x.preventDefault(), !o.trim()) return;
|
|
4779
|
+
const P = await u(p === "sql" ? { sql: o } : { naturalLanguage: o });
|
|
4780
|
+
P && (a == null || a(P));
|
|
4781
|
+
}, [o, p, u, a]);
|
|
4782
|
+
return /* @__PURE__ */ e(j, { appearance: i, children: /* @__PURE__ */ t("div", { className: "ss-card ss-card-wide", children: [
|
|
4783
|
+
r === "both" && /* @__PURE__ */ t("div", { className: "ss-tab-group ss-tab-group-sm", children: [
|
|
4777
4784
|
/* @__PURE__ */ e(
|
|
4778
4785
|
"button",
|
|
4779
4786
|
{
|
|
4780
4787
|
type: "button",
|
|
4781
4788
|
className: `ss-tab ${p === "nl" ? "ss-tab-active" : ""}`,
|
|
4782
|
-
onClick: () =>
|
|
4789
|
+
onClick: () => g("nl"),
|
|
4783
4790
|
children: "Natural Language"
|
|
4784
4791
|
}
|
|
4785
4792
|
),
|
|
@@ -4788,228 +4795,228 @@ function fe({ onResult: a, mode: s = "both", placeholder: r, appearance: o }) {
|
|
|
4788
4795
|
{
|
|
4789
4796
|
type: "button",
|
|
4790
4797
|
className: `ss-tab ${p === "sql" ? "ss-tab-active" : ""}`,
|
|
4791
|
-
onClick: () =>
|
|
4798
|
+
onClick: () => g("sql"),
|
|
4792
4799
|
children: "SQL"
|
|
4793
4800
|
}
|
|
4794
4801
|
)
|
|
4795
4802
|
] }),
|
|
4796
|
-
|
|
4797
|
-
/* @__PURE__ */ t("form", { onSubmit:
|
|
4803
|
+
d && /* @__PURE__ */ e("div", { className: "ss-global-error", children: d }),
|
|
4804
|
+
/* @__PURE__ */ t("form", { onSubmit: v, children: [
|
|
4798
4805
|
/* @__PURE__ */ e("div", { className: "ss-field", children: /* @__PURE__ */ e(
|
|
4799
4806
|
"textarea",
|
|
4800
4807
|
{
|
|
4801
4808
|
className: "ss-input ss-query-textarea",
|
|
4802
|
-
placeholder:
|
|
4803
|
-
value:
|
|
4804
|
-
onChange: (
|
|
4809
|
+
placeholder: s ?? (p === "sql" ? "SELECT ..." : "Ask a question about your data..."),
|
|
4810
|
+
value: o,
|
|
4811
|
+
onChange: (x) => m(x.target.value),
|
|
4805
4812
|
rows: 3
|
|
4806
4813
|
}
|
|
4807
4814
|
) }),
|
|
4808
|
-
/* @__PURE__ */ t("button", { type: "submit", className: "ss-btn ss-btn-primary", disabled:
|
|
4809
|
-
|
|
4815
|
+
/* @__PURE__ */ t("button", { type: "submit", className: "ss-btn ss-btn-primary", disabled: c || !o.trim(), children: [
|
|
4816
|
+
c && /* @__PURE__ */ e("span", { className: "ss-spinner" }),
|
|
4810
4817
|
"Run query"
|
|
4811
4818
|
] })
|
|
4812
4819
|
] })
|
|
4813
4820
|
] }) });
|
|
4814
4821
|
}
|
|
4815
|
-
function
|
|
4816
|
-
const { appearance: u } =
|
|
4817
|
-
const
|
|
4818
|
-
if (
|
|
4819
|
-
if (
|
|
4820
|
-
if (
|
|
4821
|
-
if (typeof
|
|
4822
|
-
return
|
|
4823
|
-
const C = String(
|
|
4824
|
-
return
|
|
4825
|
-
}) :
|
|
4826
|
-
|
|
4822
|
+
function Ga({ columns: a, rows: r, sortable: s = !0, maxRows: l, appearance: n }) {
|
|
4823
|
+
const { appearance: u } = D(), c = n ?? u, [d, i] = h(null), [o, m] = h("asc"), p = G(() => d ? [...r].sort((y, P) => {
|
|
4824
|
+
const N = y[d], E = P[d];
|
|
4825
|
+
if (N == null && E == null) return 0;
|
|
4826
|
+
if (N == null) return 1;
|
|
4827
|
+
if (E == null) return -1;
|
|
4828
|
+
if (typeof N == "number" && typeof E == "number")
|
|
4829
|
+
return o === "asc" ? N - E : E - N;
|
|
4830
|
+
const C = String(N), f = String(E);
|
|
4831
|
+
return o === "asc" ? C.localeCompare(f) : f.localeCompare(C);
|
|
4832
|
+
}) : r, [r, d, o]), g = l ? p.slice(0, l) : p, v = (y) => {
|
|
4833
|
+
s && (d === y ? m((P) => P === "asc" ? "desc" : "asc") : (i(y), m("asc")));
|
|
4827
4834
|
};
|
|
4828
|
-
function
|
|
4835
|
+
function x(y) {
|
|
4829
4836
|
return y == null ? "" : typeof y == "object" ? JSON.stringify(y) : String(y);
|
|
4830
4837
|
}
|
|
4831
|
-
return /* @__PURE__ */ e(
|
|
4838
|
+
return /* @__PURE__ */ e(j, { appearance: c, children: /* @__PURE__ */ t("div", { className: "ss-table-container", children: [
|
|
4832
4839
|
/* @__PURE__ */ t("table", { className: "ss-table", children: [
|
|
4833
4840
|
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ e("tr", { children: a.map((y) => /* @__PURE__ */ t(
|
|
4834
4841
|
"th",
|
|
4835
4842
|
{
|
|
4836
|
-
className: `ss-th ${
|
|
4837
|
-
onClick: () =>
|
|
4843
|
+
className: `ss-th ${s ? "ss-th-sortable" : ""} ${d === y ? o === "asc" ? "ss-sorted-asc" : "ss-sorted-desc" : ""}`,
|
|
4844
|
+
onClick: () => v(y),
|
|
4838
4845
|
children: [
|
|
4839
4846
|
y,
|
|
4840
|
-
|
|
4847
|
+
d === y && /* @__PURE__ */ e("span", { className: "ss-sort-indicator", children: o === "asc" ? " ▲" : " ▼" })
|
|
4841
4848
|
]
|
|
4842
4849
|
},
|
|
4843
4850
|
y
|
|
4844
4851
|
)) }) }),
|
|
4845
|
-
/* @__PURE__ */ e("tbody", { children:
|
|
4852
|
+
/* @__PURE__ */ e("tbody", { children: g.map((y, P) => /* @__PURE__ */ e("tr", { className: "ss-tr", children: a.map((N) => /* @__PURE__ */ e("td", { className: "ss-td", children: x(y[N]) }, N)) }, P)) })
|
|
4846
4853
|
] }),
|
|
4847
|
-
|
|
4854
|
+
l && r.length > l && /* @__PURE__ */ t("div", { className: "ss-table-footer", children: [
|
|
4848
4855
|
"Showing ",
|
|
4849
|
-
|
|
4856
|
+
l,
|
|
4850
4857
|
" of ",
|
|
4851
|
-
|
|
4858
|
+
r.length,
|
|
4852
4859
|
" rows"
|
|
4853
4860
|
] })
|
|
4854
4861
|
] }) });
|
|
4855
4862
|
}
|
|
4856
|
-
function
|
|
4857
|
-
const
|
|
4863
|
+
function Ya(a, r = "#6366f1") {
|
|
4864
|
+
const s = parseInt(r.replace("#", "").slice(0, 2), 16), l = [];
|
|
4858
4865
|
for (let n = 0; n < a; n++) {
|
|
4859
|
-
const u = (
|
|
4860
|
-
|
|
4866
|
+
const u = (s + n * Math.floor(360 / Math.max(a, 1))) % 360;
|
|
4867
|
+
l.push(`hsl(${u}, 65%, 55%)`);
|
|
4861
4868
|
}
|
|
4862
|
-
return
|
|
4869
|
+
return l;
|
|
4863
4870
|
}
|
|
4864
|
-
function
|
|
4865
|
-
const u = Math.max(...
|
|
4871
|
+
function Ja({ labels: a, values: r, w: s, h: l, colors: n }) {
|
|
4872
|
+
const u = Math.max(...r, 1), c = 40, d = s - c * 2, i = l - c * 2, o = Math.max(1, d / a.length - 4);
|
|
4866
4873
|
return /* @__PURE__ */ t("g", { children: [
|
|
4867
|
-
/* @__PURE__ */ e("line", { x1:
|
|
4868
|
-
|
|
4869
|
-
const
|
|
4874
|
+
/* @__PURE__ */ e("line", { x1: c, y1: l - c, x2: s - c, y2: l - c, stroke: "#ccc", strokeWidth: 1 }),
|
|
4875
|
+
r.map((m, p) => {
|
|
4876
|
+
const g = m / u * i, v = c + d / a.length * p + 2, x = l - c - g;
|
|
4870
4877
|
return /* @__PURE__ */ t("g", { children: [
|
|
4871
|
-
/* @__PURE__ */ e("rect", { x:
|
|
4872
|
-
/* @__PURE__ */ e("text", { x:
|
|
4878
|
+
/* @__PURE__ */ e("rect", { x: v, y: x, width: o, height: g, fill: n[p % n.length], rx: 2 }),
|
|
4879
|
+
/* @__PURE__ */ e("text", { x: v + o / 2, y: l - c + 14, textAnchor: "middle", fontSize: 10, fill: "#666", children: a[p].length > 8 ? a[p].slice(0, 8) + "..." : a[p] })
|
|
4873
4880
|
] }, p);
|
|
4874
4881
|
})
|
|
4875
4882
|
] });
|
|
4876
4883
|
}
|
|
4877
|
-
function
|
|
4878
|
-
const u = Math.max(...
|
|
4879
|
-
const
|
|
4880
|
-
return `${
|
|
4884
|
+
function Qa({ labels: a, values: r, w: s, h: l, colors: n }) {
|
|
4885
|
+
const u = Math.max(...r, 1), c = 40, d = s - c * 2, i = l - c * 2, o = a.length > 1 ? d / (a.length - 1) : 0, m = r.map((p, g) => {
|
|
4886
|
+
const v = c + o * g, x = l - c - p / u * i;
|
|
4887
|
+
return `${v},${x}`;
|
|
4881
4888
|
});
|
|
4882
4889
|
return /* @__PURE__ */ t("g", { children: [
|
|
4883
4890
|
[0.25, 0.5, 0.75, 1].map((p) => {
|
|
4884
|
-
const
|
|
4885
|
-
return /* @__PURE__ */ e("line", { x1:
|
|
4891
|
+
const g = l - c - p * i;
|
|
4892
|
+
return /* @__PURE__ */ e("line", { x1: c, y1: g, x2: s - c, y2: g, stroke: "#eee", strokeWidth: 1 }, p);
|
|
4886
4893
|
}),
|
|
4887
|
-
/* @__PURE__ */ e("polyline", { points:
|
|
4888
|
-
|
|
4889
|
-
const
|
|
4890
|
-
return /* @__PURE__ */ e("circle", { cx:
|
|
4894
|
+
/* @__PURE__ */ e("polyline", { points: m.join(" "), fill: "none", stroke: n[0], strokeWidth: 2 }),
|
|
4895
|
+
r.map((p, g) => {
|
|
4896
|
+
const v = c + o * g, x = l - c - p / u * i;
|
|
4897
|
+
return /* @__PURE__ */ e("circle", { cx: v, cy: x, r: 4, fill: n[0] }, g);
|
|
4891
4898
|
})
|
|
4892
4899
|
] });
|
|
4893
4900
|
}
|
|
4894
|
-
function
|
|
4895
|
-
const u =
|
|
4896
|
-
let
|
|
4897
|
-
const p =
|
|
4898
|
-
const
|
|
4899
|
-
return
|
|
4901
|
+
function Za({ labels: a, values: r, w: s, h: l, colors: n }) {
|
|
4902
|
+
const u = r.reduce((g, v) => g + v, 0) || 1, c = s / 2, d = l / 2 - 20, i = Math.min(s, l) / 2 - 40, o = 2 * Math.PI * i;
|
|
4903
|
+
let m = 0;
|
|
4904
|
+
const p = r.map((g, v) => {
|
|
4905
|
+
const x = g / u, y = x * o, P = { dash: y, offset: m, color: n[v % n.length], label: a[v], pct: x };
|
|
4906
|
+
return m += y, P;
|
|
4900
4907
|
});
|
|
4901
4908
|
return /* @__PURE__ */ t("g", { children: [
|
|
4902
|
-
p.map((
|
|
4909
|
+
p.map((g, v) => /* @__PURE__ */ e(
|
|
4903
4910
|
"circle",
|
|
4904
4911
|
{
|
|
4905
|
-
cx:
|
|
4906
|
-
cy:
|
|
4907
|
-
r:
|
|
4912
|
+
cx: c,
|
|
4913
|
+
cy: d,
|
|
4914
|
+
r: i,
|
|
4908
4915
|
fill: "none",
|
|
4909
|
-
stroke:
|
|
4910
|
-
strokeWidth:
|
|
4911
|
-
strokeDasharray: `${
|
|
4912
|
-
strokeDashoffset: -
|
|
4913
|
-
transform: `rotate(-90 ${
|
|
4916
|
+
stroke: g.color,
|
|
4917
|
+
strokeWidth: i * 0.6,
|
|
4918
|
+
strokeDasharray: `${g.dash} ${o - g.dash}`,
|
|
4919
|
+
strokeDashoffset: -g.offset,
|
|
4920
|
+
transform: `rotate(-90 ${c} ${d})`
|
|
4914
4921
|
},
|
|
4915
|
-
|
|
4922
|
+
v
|
|
4916
4923
|
)),
|
|
4917
|
-
/* @__PURE__ */ e("g", { transform: `translate(${
|
|
4918
|
-
/* @__PURE__ */ e("rect", { width: 10, height: 10, fill:
|
|
4919
|
-
/* @__PURE__ */ e("text", { x: 14, y: 9, fontSize: 9, fill: "#666", children:
|
|
4920
|
-
] },
|
|
4924
|
+
/* @__PURE__ */ e("g", { transform: `translate(${c - a.length * 30}, ${l - 20})`, children: p.slice(0, 6).map((g, v) => /* @__PURE__ */ t("g", { transform: `translate(${v * 60}, 0)`, children: [
|
|
4925
|
+
/* @__PURE__ */ e("rect", { width: 10, height: 10, fill: g.color, rx: 2 }),
|
|
4926
|
+
/* @__PURE__ */ e("text", { x: 14, y: 9, fontSize: 9, fill: "#666", children: g.label.length > 6 ? g.label.slice(0, 6) + ".." : g.label })
|
|
4927
|
+
] }, v)) })
|
|
4921
4928
|
] });
|
|
4922
4929
|
}
|
|
4923
|
-
function
|
|
4924
|
-
const { appearance:
|
|
4925
|
-
return /* @__PURE__ */ e(
|
|
4926
|
-
|
|
4927
|
-
/* @__PURE__ */ t("svg", { viewBox: `0 0 ${
|
|
4928
|
-
a === "bar" && /* @__PURE__ */ e(
|
|
4929
|
-
a === "line" && /* @__PURE__ */ e(
|
|
4930
|
-
a === "pie" && /* @__PURE__ */ e(
|
|
4930
|
+
function Ka({ type: a, data: r, title: s, width: l = 400, height: n = 300, appearance: u }) {
|
|
4931
|
+
const { appearance: c } = D(), d = u ?? c, i = G(() => Ya(r.labels.length), [r.labels.length]);
|
|
4932
|
+
return /* @__PURE__ */ e(j, { appearance: d, children: /* @__PURE__ */ t("div", { className: "ss-chart-container", children: [
|
|
4933
|
+
s && /* @__PURE__ */ e("h3", { className: "ss-chart-title", children: s }),
|
|
4934
|
+
/* @__PURE__ */ t("svg", { viewBox: `0 0 ${l} ${n}`, width: "100%", style: { maxWidth: l }, children: [
|
|
4935
|
+
a === "bar" && /* @__PURE__ */ e(Ja, { labels: r.labels, values: r.values, w: l, h: n, colors: i }),
|
|
4936
|
+
a === "line" && /* @__PURE__ */ e(Qa, { labels: r.labels, values: r.values, w: l, h: n, colors: i }),
|
|
4937
|
+
a === "pie" && /* @__PURE__ */ e(Za, { labels: r.labels, values: r.values, w: l, h: n, colors: i })
|
|
4931
4938
|
] })
|
|
4932
4939
|
] }) });
|
|
4933
4940
|
}
|
|
4934
|
-
function
|
|
4935
|
-
const u =
|
|
4936
|
-
if (
|
|
4937
|
-
const
|
|
4938
|
-
return new ta(
|
|
4941
|
+
function ye({ dashboardId: a, embedToken: r, baseUrl: s, refreshInterval: l, appearance: n }) {
|
|
4942
|
+
const u = D(), c = n ?? (u == null ? void 0 : u.appearance), d = G(() => {
|
|
4943
|
+
if (r) {
|
|
4944
|
+
const N = s ?? "https://api.saas-support.com/v1", E = new Q(N, { type: "embedToken", token: r });
|
|
4945
|
+
return new ta(E);
|
|
4939
4946
|
}
|
|
4940
4947
|
return u.client.report;
|
|
4941
|
-
}, [
|
|
4942
|
-
|
|
4948
|
+
}, [r, s, u]), [i, o] = h([]), [m, p] = h({}), [g, v] = h(!0), [x, y] = h(null), P = $(async () => {
|
|
4949
|
+
v(!0), y(null);
|
|
4943
4950
|
try {
|
|
4944
|
-
const
|
|
4945
|
-
|
|
4951
|
+
const N = await d.getDashboard(a), E = JSON.parse(N.layoutJson || "[]");
|
|
4952
|
+
o(E);
|
|
4946
4953
|
const C = {};
|
|
4947
|
-
for (const
|
|
4954
|
+
for (const f of E)
|
|
4948
4955
|
try {
|
|
4949
|
-
const
|
|
4950
|
-
if (
|
|
4951
|
-
const
|
|
4952
|
-
C[
|
|
4956
|
+
const O = await d.listQueries({ search: f.queryId, perPage: 1 });
|
|
4957
|
+
if (O.data.length > 0 && O.data[0].generatedSql) {
|
|
4958
|
+
const I = await d.executeQuery({ sql: O.data[0].generatedSql });
|
|
4959
|
+
C[f.queryId] = I;
|
|
4953
4960
|
}
|
|
4954
4961
|
} catch {
|
|
4955
4962
|
}
|
|
4956
4963
|
p(C);
|
|
4957
|
-
} catch (
|
|
4958
|
-
y(
|
|
4964
|
+
} catch (N) {
|
|
4965
|
+
y(N instanceof Error ? N.message : "Failed to load dashboard");
|
|
4959
4966
|
} finally {
|
|
4960
|
-
|
|
4961
|
-
}
|
|
4962
|
-
}, [
|
|
4963
|
-
return
|
|
4964
|
-
|
|
4965
|
-
}, [
|
|
4966
|
-
if (!
|
|
4967
|
-
const
|
|
4968
|
-
return () => clearInterval(
|
|
4969
|
-
}, [
|
|
4970
|
-
|
|
4967
|
+
v(!1);
|
|
4968
|
+
}
|
|
4969
|
+
}, [d, a]);
|
|
4970
|
+
return U(() => {
|
|
4971
|
+
P();
|
|
4972
|
+
}, [P]), U(() => {
|
|
4973
|
+
if (!l || l <= 0) return;
|
|
4974
|
+
const N = setInterval(P, l * 1e3);
|
|
4975
|
+
return () => clearInterval(N);
|
|
4976
|
+
}, [l, P]), /* @__PURE__ */ e(j, { appearance: c, children: /* @__PURE__ */ t("div", { className: "ss-dashboard-grid", children: [
|
|
4977
|
+
g && /* @__PURE__ */ t("div", { className: "ss-loading", children: [
|
|
4971
4978
|
/* @__PURE__ */ e("span", { className: "ss-spinner" }),
|
|
4972
4979
|
" Loading dashboard..."
|
|
4973
4980
|
] }),
|
|
4974
|
-
|
|
4975
|
-
!
|
|
4976
|
-
const C =
|
|
4981
|
+
x && /* @__PURE__ */ e("div", { className: "ss-global-error", children: x }),
|
|
4982
|
+
!g && i.map((N, E) => {
|
|
4983
|
+
const C = m[N.queryId];
|
|
4977
4984
|
if (!C) return null;
|
|
4978
|
-
const
|
|
4979
|
-
labels: C.rows.map((
|
|
4980
|
-
values: C.rows.map((
|
|
4985
|
+
const f = C.columns.length >= 2 ? {
|
|
4986
|
+
labels: C.rows.map((O) => String(O[C.columns[0]] ?? "")),
|
|
4987
|
+
values: C.rows.map((O) => Number(O[C.columns[1]] ?? 0))
|
|
4981
4988
|
} : { labels: [], values: [] };
|
|
4982
4989
|
return /* @__PURE__ */ t("div", { className: "ss-widget", children: [
|
|
4983
|
-
|
|
4984
|
-
|
|
4985
|
-
|
|
4990
|
+
N.title && /* @__PURE__ */ e("h4", { className: "ss-widget-header", children: N.title }),
|
|
4991
|
+
N.chartType === "table" ? /* @__PURE__ */ e(Ga, { columns: C.columns, rows: C.rows, maxRows: 50 }) : /* @__PURE__ */ e(
|
|
4992
|
+
Ka,
|
|
4986
4993
|
{
|
|
4987
|
-
type:
|
|
4988
|
-
data:
|
|
4989
|
-
width:
|
|
4990
|
-
height:
|
|
4994
|
+
type: N.chartType || "bar",
|
|
4995
|
+
data: f,
|
|
4996
|
+
width: N.w,
|
|
4997
|
+
height: N.h
|
|
4991
4998
|
}
|
|
4992
4999
|
)
|
|
4993
|
-
] },
|
|
5000
|
+
] }, E);
|
|
4994
5001
|
})
|
|
4995
5002
|
] }) });
|
|
4996
5003
|
}
|
|
4997
|
-
function
|
|
5004
|
+
function Xa(a) {
|
|
4998
5005
|
return new Date(a).toLocaleDateString("en-US", { year: "numeric", month: "short", day: "numeric" });
|
|
4999
5006
|
}
|
|
5000
|
-
function
|
|
5001
|
-
const { appearance:
|
|
5007
|
+
function ve({ onSelectQuery: a, onRunQuery: r, appearance: s }) {
|
|
5008
|
+
const { appearance: l } = D(), { queries: n, isLoading: u, error: c } = _a(), { execute: d, isLoading: i } = da(), o = s ?? l, m = $(async (p) => {
|
|
5002
5009
|
if (!p.generatedSql) return;
|
|
5003
|
-
const
|
|
5004
|
-
|
|
5005
|
-
}, [
|
|
5006
|
-
return /* @__PURE__ */ e(
|
|
5010
|
+
const g = await d({ sql: p.generatedSql });
|
|
5011
|
+
g && (r == null || r(g));
|
|
5012
|
+
}, [d, r]);
|
|
5013
|
+
return /* @__PURE__ */ e(j, { appearance: o, children: /* @__PURE__ */ t("div", { className: "ss-card ss-card-wide", children: [
|
|
5007
5014
|
/* @__PURE__ */ e("h2", { className: "ss-title", children: "Saved Queries" }),
|
|
5008
5015
|
u && /* @__PURE__ */ t("div", { className: "ss-loading", children: [
|
|
5009
5016
|
/* @__PURE__ */ e("span", { className: "ss-spinner" }),
|
|
5010
5017
|
" Loading..."
|
|
5011
5018
|
] }),
|
|
5012
|
-
|
|
5019
|
+
c && /* @__PURE__ */ e("div", { className: "ss-global-error", children: c }),
|
|
5013
5020
|
!u && n.length === 0 && /* @__PURE__ */ e("p", { className: "ss-empty", children: "No saved queries." }),
|
|
5014
5021
|
!u && n.map((p) => /* @__PURE__ */ t(
|
|
5015
5022
|
"div",
|
|
@@ -5023,17 +5030,17 @@ function xe({ onSelectQuery: a, onRunQuery: s, appearance: r }) {
|
|
|
5023
5030
|
] }),
|
|
5024
5031
|
p.naturalLanguage && /* @__PURE__ */ e("p", { className: "ss-saved-query-desc", children: p.naturalLanguage }),
|
|
5025
5032
|
/* @__PURE__ */ t("div", { className: "ss-saved-query-footer", children: [
|
|
5026
|
-
/* @__PURE__ */ e("span", { className: "ss-saved-query-date", children:
|
|
5033
|
+
/* @__PURE__ */ e("span", { className: "ss-saved-query-date", children: Xa(p.createdAt) }),
|
|
5027
5034
|
/* @__PURE__ */ e(
|
|
5028
5035
|
"button",
|
|
5029
5036
|
{
|
|
5030
5037
|
type: "button",
|
|
5031
5038
|
className: "ss-btn ss-btn-sm ss-btn-primary",
|
|
5032
|
-
disabled:
|
|
5033
|
-
onClick: (
|
|
5034
|
-
|
|
5039
|
+
disabled: i || !p.generatedSql,
|
|
5040
|
+
onClick: (g) => {
|
|
5041
|
+
g.stopPropagation(), m(p);
|
|
5035
5042
|
},
|
|
5036
|
-
children:
|
|
5043
|
+
children: i ? /* @__PURE__ */ e("span", { className: "ss-spinner" }) : "Run"
|
|
5037
5044
|
}
|
|
5038
5045
|
)
|
|
5039
5046
|
] })
|
|
@@ -5043,107 +5050,107 @@ function xe({ onSelectQuery: a, onRunQuery: s, appearance: r }) {
|
|
|
5043
5050
|
))
|
|
5044
5051
|
] }) });
|
|
5045
5052
|
}
|
|
5046
|
-
function
|
|
5053
|
+
function we({ embedToken: a, dashboardId: r, baseUrl: s = "https://api.saas-support.com/v1", refreshInterval: l, appearance: n }) {
|
|
5047
5054
|
const u = G(() => {
|
|
5048
|
-
const y = new Q(
|
|
5055
|
+
const y = new Q(s, { type: "embedToken", token: a });
|
|
5049
5056
|
return new ta(y);
|
|
5050
|
-
}, [a,
|
|
5051
|
-
|
|
5057
|
+
}, [a, s]), [c, d] = h([]), [i, o] = h(!0), [m, p] = h(null), g = G(() => aa(n), [n]), v = G(() => ea(g), [g]), x = $(async () => {
|
|
5058
|
+
o(!0), p(null);
|
|
5052
5059
|
try {
|
|
5053
|
-
const y = await u.getDashboard(
|
|
5054
|
-
|
|
5060
|
+
const y = await u.getDashboard(r), P = JSON.parse(y.layoutJson || "[]"), N = await Promise.all(
|
|
5061
|
+
P.map(async (E) => {
|
|
5055
5062
|
try {
|
|
5056
|
-
const C = await u.listQueries({ search:
|
|
5063
|
+
const C = await u.listQueries({ search: E.queryId, perPage: 1 });
|
|
5057
5064
|
if (C.data.length > 0 && C.data[0].generatedSql) {
|
|
5058
|
-
const
|
|
5059
|
-
return { ...
|
|
5065
|
+
const f = await u.executeQuery({ sql: C.data[0].generatedSql });
|
|
5066
|
+
return { ...E, result: f };
|
|
5060
5067
|
}
|
|
5061
5068
|
} catch {
|
|
5062
5069
|
}
|
|
5063
|
-
return
|
|
5070
|
+
return E;
|
|
5064
5071
|
})
|
|
5065
5072
|
);
|
|
5066
|
-
|
|
5073
|
+
d(N);
|
|
5067
5074
|
} catch (y) {
|
|
5068
5075
|
p(y instanceof Error ? y.message : "Failed to load dashboard");
|
|
5069
5076
|
} finally {
|
|
5070
|
-
|
|
5071
|
-
}
|
|
5072
|
-
}, [u,
|
|
5073
|
-
return
|
|
5074
|
-
|
|
5075
|
-
}, [
|
|
5076
|
-
if (!
|
|
5077
|
-
const y = setInterval(
|
|
5077
|
+
o(!1);
|
|
5078
|
+
}
|
|
5079
|
+
}, [u, r]);
|
|
5080
|
+
return U(() => {
|
|
5081
|
+
x();
|
|
5082
|
+
}, [x]), U(() => {
|
|
5083
|
+
if (!l || l <= 0) return;
|
|
5084
|
+
const y = setInterval(x, l * 1e3);
|
|
5078
5085
|
return () => clearInterval(y);
|
|
5079
|
-
}, [
|
|
5086
|
+
}, [l, x]), /* @__PURE__ */ e(
|
|
5080
5087
|
"div",
|
|
5081
5088
|
{
|
|
5082
5089
|
ref: (y) => {
|
|
5083
5090
|
if (!y || y.shadowRoot) return;
|
|
5084
|
-
const
|
|
5085
|
-
|
|
5086
|
-
const
|
|
5087
|
-
|
|
5091
|
+
const P = y.attachShadow({ mode: "open" }), N = document.createElement("style");
|
|
5092
|
+
N.textContent = v, P.appendChild(N);
|
|
5093
|
+
const E = document.createElement("div");
|
|
5094
|
+
P.appendChild(E);
|
|
5088
5095
|
},
|
|
5089
5096
|
style: { display: "contents" },
|
|
5090
5097
|
children: /* @__PURE__ */ t("div", { className: "ss-dashboard-grid", children: [
|
|
5091
|
-
|
|
5092
|
-
|
|
5093
|
-
!
|
|
5098
|
+
i && /* @__PURE__ */ e("div", { className: "ss-loading", children: "Loading dashboard..." }),
|
|
5099
|
+
m && /* @__PURE__ */ e("div", { className: "ss-global-error", children: m }),
|
|
5100
|
+
!i && c.map((y, P) => {
|
|
5094
5101
|
if (!y.result) return null;
|
|
5095
|
-
const { columns:
|
|
5102
|
+
const { columns: N, rows: E } = y.result;
|
|
5096
5103
|
return /* @__PURE__ */ t("div", { className: "ss-widget", children: [
|
|
5097
5104
|
y.title && /* @__PURE__ */ e("h4", { className: "ss-widget-header", children: y.title }),
|
|
5098
5105
|
/* @__PURE__ */ t("table", { className: "ss-table", children: [
|
|
5099
|
-
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ e("tr", { children:
|
|
5100
|
-
/* @__PURE__ */ e("tbody", { children:
|
|
5106
|
+
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ e("tr", { children: N.map((C) => /* @__PURE__ */ e("th", { className: "ss-th", children: C }, C)) }) }),
|
|
5107
|
+
/* @__PURE__ */ e("tbody", { children: E.slice(0, 50).map((C, f) => /* @__PURE__ */ e("tr", { className: "ss-tr", children: N.map((O) => /* @__PURE__ */ e("td", { className: "ss-td", children: String(C[O] ?? "") }, O)) }, f)) })
|
|
5101
5108
|
] })
|
|
5102
|
-
] },
|
|
5109
|
+
] }, P);
|
|
5103
5110
|
})
|
|
5104
5111
|
] })
|
|
5105
5112
|
}
|
|
5106
5113
|
);
|
|
5107
5114
|
}
|
|
5108
5115
|
export {
|
|
5109
|
-
|
|
5110
|
-
|
|
5111
|
-
|
|
5112
|
-
|
|
5113
|
-
|
|
5114
|
-
|
|
5115
|
-
|
|
5116
|
-
|
|
5117
|
-
|
|
5118
|
-
|
|
5116
|
+
Ka as Chart,
|
|
5117
|
+
ge as CouponInput,
|
|
5118
|
+
ye as DashboardView,
|
|
5119
|
+
Ga as DataTable,
|
|
5120
|
+
qa as InvoiceHistory,
|
|
5121
|
+
de as OrgSwitcher,
|
|
5122
|
+
he as PaymentPortal,
|
|
5123
|
+
ue as PricingTable,
|
|
5124
|
+
xe as QueryInput,
|
|
5125
|
+
we as ReportEmbed,
|
|
5119
5126
|
ra as SaaSContext,
|
|
5120
|
-
|
|
5121
|
-
|
|
5122
|
-
|
|
5123
|
-
|
|
5124
|
-
|
|
5125
|
-
|
|
5126
|
-
|
|
5127
|
-
|
|
5128
|
-
|
|
5129
|
-
|
|
5130
|
-
|
|
5131
|
-
|
|
5127
|
+
$e as SaaSError,
|
|
5128
|
+
re as SaaSProvider,
|
|
5129
|
+
ya as SaaSSupport,
|
|
5130
|
+
ve as SavedQueryList,
|
|
5131
|
+
Ea as SettingsPanel,
|
|
5132
|
+
oe as SignIn,
|
|
5133
|
+
ie as SignUp,
|
|
5134
|
+
Ua as SubscriptionStatus,
|
|
5135
|
+
Wa as UsageDisplay,
|
|
5136
|
+
le as UserButton,
|
|
5137
|
+
ce as UserProfile,
|
|
5138
|
+
va as isMfaRequired,
|
|
5132
5139
|
sa as useAuth,
|
|
5133
|
-
|
|
5134
|
-
|
|
5135
|
-
|
|
5136
|
-
|
|
5137
|
-
|
|
5140
|
+
pe as useBilling,
|
|
5141
|
+
fe as useDashboard,
|
|
5142
|
+
Pa as useDeleteAccount,
|
|
5143
|
+
be as useEmbedDashboard,
|
|
5144
|
+
Da as useInvoices,
|
|
5138
5145
|
Y as useOrg,
|
|
5139
5146
|
oa as useProfile,
|
|
5140
5147
|
da as useQuery,
|
|
5141
|
-
|
|
5142
|
-
|
|
5143
|
-
|
|
5148
|
+
me as useReport,
|
|
5149
|
+
D as useSaaSContext,
|
|
5150
|
+
_a as useSavedQueries,
|
|
5144
5151
|
na as useSignIn,
|
|
5145
|
-
|
|
5146
|
-
|
|
5147
|
-
|
|
5148
|
-
|
|
5152
|
+
za as useSignUp,
|
|
5153
|
+
Ta as useSubscription,
|
|
5154
|
+
Ma as useUsage,
|
|
5155
|
+
ne as useUser
|
|
5149
5156
|
};
|