@cedros/login-react 0.0.14 → 0.0.16

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.
Files changed (125) hide show
  1. package/dist/{AuthenticationSettings-vowmQPXz.js → AuthenticationSettings-BipaLyGg.js} +20 -20
  2. package/dist/{AuthenticationSettings-vowmQPXz.js.map → AuthenticationSettings-BipaLyGg.js.map} +1 -1
  3. package/dist/{AuthenticationSettings-D739nNul.cjs → AuthenticationSettings-Cb80XWPm.cjs} +1 -1
  4. package/dist/{AuthenticationSettings-D739nNul.cjs.map → AuthenticationSettings-Cb80XWPm.cjs.map} +1 -1
  5. package/dist/{AuthenticationSettings-Dx3JCI3m.js → AuthenticationSettings-Cfn0No6U.js} +1 -1
  6. package/dist/{AuthenticationSettings-Dx3JCI3m.js.map → AuthenticationSettings-Cfn0No6U.js.map} +1 -1
  7. package/dist/{AuthenticationSettings-DtLoxQ2z.cjs → AuthenticationSettings-Cu0S0Z7s.cjs} +1 -1
  8. package/dist/{AuthenticationSettings-DtLoxQ2z.cjs.map → AuthenticationSettings-Cu0S0Z7s.cjs.map} +1 -1
  9. package/dist/{AutosaveStatus-Ciyt350A.js → AutosaveStatus-BKc7T2Tw.js} +323 -248
  10. package/dist/AutosaveStatus-BKc7T2Tw.js.map +1 -0
  11. package/dist/AutosaveStatus-BjLMt52a.cjs +1 -0
  12. package/dist/AutosaveStatus-BjLMt52a.cjs.map +1 -0
  13. package/dist/{CreditSystemSettings-BQ3h4CyM.js → CreditSystemSettings-CvcacgMM.js} +1 -1
  14. package/dist/{CreditSystemSettings-BQ3h4CyM.js.map → CreditSystemSettings-CvcacgMM.js.map} +1 -1
  15. package/dist/{CreditSystemSettings-bVuNLsqp.js → CreditSystemSettings-D13lZbIw.js} +1 -1
  16. package/dist/{CreditSystemSettings-bVuNLsqp.js.map → CreditSystemSettings-D13lZbIw.js.map} +1 -1
  17. package/dist/{CreditSystemSettings-CBot8EPW.cjs → CreditSystemSettings-DO-dUcxN.cjs} +1 -1
  18. package/dist/{CreditSystemSettings-CBot8EPW.cjs.map → CreditSystemSettings-DO-dUcxN.cjs.map} +1 -1
  19. package/dist/{CreditSystemSettings-C6dUsu72.cjs → CreditSystemSettings-DV0VkPIe.cjs} +1 -1
  20. package/dist/{CreditSystemSettings-C6dUsu72.cjs.map → CreditSystemSettings-DV0VkPIe.cjs.map} +1 -1
  21. package/dist/{EmailRegisterForm-Pvm3I8GP.cjs → EmailRegisterForm-DcpT5LU6.cjs} +1 -1
  22. package/dist/{EmailRegisterForm-Pvm3I8GP.cjs.map → EmailRegisterForm-DcpT5LU6.cjs.map} +1 -1
  23. package/dist/{EmailRegisterForm-nI0BOIxR.js → EmailRegisterForm-HMcnD3KA.js} +1 -1
  24. package/dist/{EmailRegisterForm-nI0BOIxR.js.map → EmailRegisterForm-HMcnD3KA.js.map} +1 -1
  25. package/dist/{EmailSettings-B9qwPSiM.cjs → EmailSettings-BkR7vlWL.cjs} +1 -1
  26. package/dist/{EmailSettings-B9qwPSiM.cjs.map → EmailSettings-BkR7vlWL.cjs.map} +1 -1
  27. package/dist/EmailSettings-CLMdw3rB.js +78 -0
  28. package/dist/EmailSettings-CLMdw3rB.js.map +1 -0
  29. package/dist/EmailSettings-Dq3mfUr2.cjs +1 -0
  30. package/dist/EmailSettings-Dq3mfUr2.cjs.map +1 -0
  31. package/dist/{EmailSettings-mxlKNcPl.js → EmailSettings-ulEHtH2y.js} +1 -1
  32. package/dist/{EmailSettings-mxlKNcPl.js.map → EmailSettings-ulEHtH2y.js.map} +1 -1
  33. package/dist/{EmbeddedWalletSettings-BInZvFZf.js → EmbeddedWalletSettings-BTTV8Nqi.js} +46 -31
  34. package/dist/EmbeddedWalletSettings-BTTV8Nqi.js.map +1 -0
  35. package/dist/EmbeddedWalletSettings-C7H0E8Uz.cjs +1 -0
  36. package/dist/EmbeddedWalletSettings-C7H0E8Uz.cjs.map +1 -0
  37. package/dist/{EmbeddedWalletSettings-CXlZFFDw.js → EmbeddedWalletSettings-CLWh2TbV.js} +1 -1
  38. package/dist/{EmbeddedWalletSettings-CXlZFFDw.js.map → EmbeddedWalletSettings-CLWh2TbV.js.map} +1 -1
  39. package/dist/{EmbeddedWalletSettings-D5JXae1L.cjs → EmbeddedWalletSettings-DGmCVyex.cjs} +1 -1
  40. package/dist/{EmbeddedWalletSettings-D5JXae1L.cjs.map → EmbeddedWalletSettings-DGmCVyex.cjs.map} +1 -1
  41. package/dist/PermissionsSection-BPbE-hNx.cjs.map +1 -1
  42. package/dist/PermissionsSection-CighC1p6.js.map +1 -1
  43. package/dist/{ServerSettings-CYTlQ2xy.cjs → ServerSettings-CPAoiDtn.cjs} +1 -1
  44. package/dist/{ServerSettings-CYTlQ2xy.cjs.map → ServerSettings-CPAoiDtn.cjs.map} +1 -1
  45. package/dist/ServerSettings-Ch8MCmAY.js +91 -0
  46. package/dist/ServerSettings-Ch8MCmAY.js.map +1 -0
  47. package/dist/ServerSettings-CqDd59iM.cjs +1 -0
  48. package/dist/ServerSettings-CqDd59iM.cjs.map +1 -0
  49. package/dist/{ServerSettings-pSmWDC1d.js → ServerSettings-DooVeOet.js} +1 -1
  50. package/dist/{ServerSettings-pSmWDC1d.js.map → ServerSettings-DooVeOet.js.map} +1 -1
  51. package/dist/{WebhookSettings-Bb70MbFj.js → WebhookSettings-B6mjH90_.js} +1 -1
  52. package/dist/{WebhookSettings-Bb70MbFj.js.map → WebhookSettings-B6mjH90_.js.map} +1 -1
  53. package/dist/WebhookSettings-BG77iqJC.js +63 -0
  54. package/dist/WebhookSettings-BG77iqJC.js.map +1 -0
  55. package/dist/{WebhookSettings-CGyDKjrm.cjs → WebhookSettings-BeiUAcKs.cjs} +1 -1
  56. package/dist/{WebhookSettings-CGyDKjrm.cjs.map → WebhookSettings-BeiUAcKs.cjs.map} +1 -1
  57. package/dist/WebhookSettings-WMJ5zPjY.cjs +1 -0
  58. package/dist/WebhookSettings-WMJ5zPjY.cjs.map +1 -0
  59. package/dist/admin-only.cjs +1 -1
  60. package/dist/admin-only.d.ts +109 -14
  61. package/dist/admin-only.js +4 -3
  62. package/dist/email-only.cjs +1 -1
  63. package/dist/email-only.d.ts +56 -6
  64. package/dist/email-only.js +2 -2
  65. package/dist/google-only.cjs +1 -1
  66. package/dist/google-only.d.ts +56 -6
  67. package/dist/google-only.js +1 -1
  68. package/dist/index.cjs +13 -13
  69. package/dist/index.cjs.map +1 -1
  70. package/dist/index.d.ts +330 -34
  71. package/dist/index.js +2505 -3559
  72. package/dist/index.js.map +1 -1
  73. package/dist/login-react.css +1 -1
  74. package/dist/mobileWalletAdapter-Dp4yFxCm.cjs +1 -0
  75. package/dist/mobileWalletAdapter-Dp4yFxCm.cjs.map +1 -0
  76. package/dist/mobileWalletAdapter-coZRD4Yx.js +291 -0
  77. package/dist/mobileWalletAdapter-coZRD4Yx.js.map +1 -0
  78. package/dist/{plugin-8_dpq7tC.cjs → plugin-BgMAc6DA.cjs} +1 -1
  79. package/dist/{plugin-8_dpq7tC.cjs.map → plugin-BgMAc6DA.cjs.map} +1 -1
  80. package/dist/{plugin-D1NdppqC.js → plugin-Bhf9zaly.js} +82 -70
  81. package/dist/{plugin-D1NdppqC.js.map → plugin-Bhf9zaly.js.map} +1 -1
  82. package/dist/{shamir-L-s-Tp1Z.js → shamir-CDbZS8I1.js} +1 -1
  83. package/dist/{shamir-L-s-Tp1Z.js.map → shamir-CDbZS8I1.js.map} +1 -1
  84. package/dist/{shamir-4DyQMJCk.cjs → shamir-DAa54dMh.cjs} +1 -1
  85. package/dist/{shamir-4DyQMJCk.cjs.map → shamir-DAa54dMh.cjs.map} +1 -1
  86. package/dist/{silentWalletEnroll-DWt6Pr3B.js → silentWalletEnroll-CRHzr4Zy.js} +2 -2
  87. package/dist/{silentWalletEnroll-DWt6Pr3B.js.map → silentWalletEnroll-CRHzr4Zy.js.map} +1 -1
  88. package/dist/{silentWalletEnroll-BgTb4H5I.cjs → silentWalletEnroll-Dl_oFapH.cjs} +1 -1
  89. package/dist/{silentWalletEnroll-BgTb4H5I.cjs.map → silentWalletEnroll-Dl_oFapH.cjs.map} +1 -1
  90. package/dist/solana-only.cjs +1 -1
  91. package/dist/solana-only.d.ts +112 -6
  92. package/dist/solana-only.js +6 -5
  93. package/dist/{useAuth-C3dpk0po.js → useAuth-D1NSN6yY.js} +822 -777
  94. package/dist/useAuth-D1NSN6yY.js.map +1 -0
  95. package/dist/{useAuth-D3Pk_H3z.cjs → useAuth-dS_6wAMp.cjs} +1 -1
  96. package/dist/useAuth-dS_6wAMp.cjs.map +1 -0
  97. package/package.json +4 -1
  98. package/dist/AutosaveStatus-CCrZszKA.cjs +0 -1
  99. package/dist/AutosaveStatus-CCrZszKA.cjs.map +0 -1
  100. package/dist/AutosaveStatus-Ciyt350A.js.map +0 -1
  101. package/dist/EmailSettings-CCA8dNCi.js +0 -17
  102. package/dist/EmailSettings-CCA8dNCi.js.map +0 -1
  103. package/dist/EmailSettings-RbgAq9FB.cjs +0 -1
  104. package/dist/EmailSettings-RbgAq9FB.cjs.map +0 -1
  105. package/dist/EmbeddedWalletSettings-B4h-8rxB.cjs +0 -1
  106. package/dist/EmbeddedWalletSettings-B4h-8rxB.cjs.map +0 -1
  107. package/dist/EmbeddedWalletSettings-BInZvFZf.js.map +0 -1
  108. package/dist/ServerSettings-BE8fsE5k.js +0 -84
  109. package/dist/ServerSettings-BE8fsE5k.js.map +0 -1
  110. package/dist/ServerSettings-DFs9jQ3f.cjs +0 -1
  111. package/dist/ServerSettings-DFs9jQ3f.cjs.map +0 -1
  112. package/dist/SettingsPageLayout--GZ_iHLc.js +0 -50
  113. package/dist/SettingsPageLayout--GZ_iHLc.js.map +0 -1
  114. package/dist/SettingsPageLayout-j5lMjEID.cjs +0 -1
  115. package/dist/SettingsPageLayout-j5lMjEID.cjs.map +0 -1
  116. package/dist/SolanaLoginButton-BjOxpE1C.cjs +0 -1
  117. package/dist/SolanaLoginButton-BjOxpE1C.cjs.map +0 -1
  118. package/dist/SolanaLoginButton-P22QjBaO.js +0 -262
  119. package/dist/SolanaLoginButton-P22QjBaO.js.map +0 -1
  120. package/dist/WebhookSettings-C-gvNAW1.cjs +0 -1
  121. package/dist/WebhookSettings-C-gvNAW1.cjs.map +0 -1
  122. package/dist/WebhookSettings-kIstSjZi.js +0 -17
  123. package/dist/WebhookSettings-kIstSjZi.js.map +0 -1
  124. package/dist/useAuth-C3dpk0po.js.map +0 -1
  125. package/dist/useAuth-D3Pk_H3z.cjs.map +0 -1
@@ -1,77 +1,15 @@
1
- import { useState as k, useRef as T, useEffect as O, useCallback as d, useMemo as S } from "react";
2
- import { u as E } from "./useSystemSettings-DBlAMjFi.js";
3
1
  import { jsx as t, jsxs as u, Fragment as f } from "react/jsx-runtime";
4
- const U = 800, I = 2e3;
5
- function X() {
6
- const { settings: e, isLoading: l, error: a, fetchSettings: n, updateSettings: s } = E(), [i, p] = k({}), [r, o] = k("idle"), [c, m] = k(null), h = T(null), y = T(null), w = T({});
7
- O(() => () => {
8
- h.current && clearTimeout(h.current), y.current && clearTimeout(y.current);
9
- }, []);
10
- const N = d(async () => {
11
- const _ = { ...w.current };
12
- if (Object.keys(_).length === 0) {
13
- o("idle");
14
- return;
15
- }
16
- o("saving"), m(null);
17
- const v = Object.entries(_).map(([b, g]) => ({
18
- key: b,
19
- value: g
20
- }));
21
- try {
22
- await s(v), p((b) => {
23
- const g = { ...b };
24
- for (const C of Object.keys(_))
25
- delete g[C];
26
- return g;
27
- });
28
- for (const b of Object.keys(_))
29
- delete w.current[b];
30
- o("saved"), y.current && clearTimeout(y.current), y.current = setTimeout(() => {
31
- o("idle");
32
- }, I);
33
- } catch (b) {
34
- o("error"), m(b instanceof Error ? b.message : "Failed to save");
35
- }
36
- }, [s]), D = d(
37
- (_, v) => {
38
- p((b) => ({ ...b, [_]: v })), w.current[_] = v, m(null), o("pending"), h.current && clearTimeout(h.current), h.current = setTimeout(() => {
39
- N();
40
- }, U);
41
- },
42
- [N]
43
- ), A = d(
44
- (_) => {
45
- if (i[_] !== void 0) return i[_];
46
- for (const v of Object.values(e)) {
47
- const b = v.find((g) => g.key === _);
48
- if (b) return b.value;
49
- }
50
- return "";
51
- },
52
- [i, e]
53
- );
54
- return {
55
- settings: e,
56
- edits: i,
57
- isLoading: l,
58
- autosaveStatus: r,
59
- autosaveError: c,
60
- error: a,
61
- fetchSettings: n,
62
- handleChange: D,
63
- getEffectiveValue: A
64
- };
2
+ import { useMemo as T, useCallback as d, useState as w, useRef as S, useEffect as O } from "react";
3
+ import { u as E } from "./useSystemSettings-DBlAMjFi.js";
4
+ function I(e) {
5
+ const s = Math.floor(e / 86400), a = Math.floor(e % 86400 / 3600), r = Math.floor(e % 3600 / 60), l = e % 60;
6
+ return { days: s, hours: a, minutes: r, seconds: l };
65
7
  }
66
8
  function M(e) {
67
- const l = Math.floor(e / 86400), a = Math.floor(e % 86400 / 3600), n = Math.floor(e % 3600 / 60), s = e % 60;
68
- return { days: l, hours: a, minutes: n, seconds: s };
9
+ const { days: s, hours: a, minutes: r } = I(e), l = [];
10
+ return s > 0 && l.push(`${s}d`), a > 0 && l.push(`${a}h`), r > 0 && l.push(`${r}m`), l.length === 0 && l.push(`${e}s`), l.join(" ");
69
11
  }
70
- function R(e) {
71
- const { days: l, hours: a, minutes: n } = M(e), s = [];
72
- return l > 0 && s.push(`${l}d`), a > 0 && s.push(`${a}h`), n > 0 && s.push(`${n}m`), s.length === 0 && s.push(`${e}s`), s.join(" ");
73
- }
74
- const q = {
12
+ const R = {
75
13
  // ============= Authentication Providers =============
76
14
  // Email auth
77
15
  auth_email_enabled: {
@@ -96,53 +34,35 @@ const q = {
96
34
  auth_google_enabled: {
97
35
  key: "auth_google_enabled",
98
36
  label: "Enable Google Sign-In",
99
- description: "Allow users to authenticate with their Google account.",
37
+ description: 'Allow users to authenticate with their Google account. Configure at <a href="https://console.cloud.google.com/apis/credentials" target="_blank" rel="noopener">Google Cloud Console &gt; Credentials</a>.',
100
38
  inputType: "boolean"
101
39
  },
102
40
  auth_google_client_id: {
103
41
  key: "auth_google_client_id",
104
42
  label: "Google Client ID",
105
- description: "OAuth 2.0 client ID from Google Cloud Console.",
43
+ description: "OAuth 2.0 client ID from Google Cloud Console. Create a Web application credential and add your frontend URL to Authorized JavaScript origins.",
106
44
  inputType: "text"
107
45
  },
108
- auth_google_client_secret: {
109
- key: "auth_google_client_secret",
110
- label: "Google Client Secret",
111
- description: "OAuth 2.0 client secret from Google Cloud Console.",
112
- inputType: "secret"
113
- },
114
46
  // Apple OAuth
115
47
  auth_apple_enabled: {
116
48
  key: "auth_apple_enabled",
117
49
  label: "Enable Sign in with Apple",
118
- description: "Allow users to authenticate with their Apple ID.",
50
+ description: 'Allow users to authenticate with their Apple ID. Configure at <a href="https://developer.apple.com/account/resources/identifiers" target="_blank" rel="noopener">Apple Developer &gt; Identifiers</a>.',
119
51
  inputType: "boolean"
120
52
  },
121
53
  auth_apple_client_id: {
122
54
  key: "auth_apple_client_id",
123
55
  label: "Apple Services ID",
124
- description: "The Services ID configured in your Apple Developer account.",
125
- inputType: "text"
56
+ description: "Your Client ID (e.g. com.yourdomain.service). Create at Identifiers &gt; Services IDs, then enable Sign in with Apple and add your frontend URL as a Return URL (e.g. https://yourdomain.com).",
57
+ inputType: "text",
58
+ placeholder: "com.yourdomain.service"
126
59
  },
127
60
  auth_apple_team_id: {
128
61
  key: "auth_apple_team_id",
129
62
  label: "Apple Team ID",
130
- description: "Your Apple Developer Team ID.",
131
- inputType: "text"
132
- },
133
- auth_apple_key_id: {
134
- key: "auth_apple_key_id",
135
- label: "Apple Key ID",
136
- description: "The Key ID for your Sign in with Apple private key.",
63
+ description: 'Identifies your developer account. Found at the top-right of <a href="https://developer.apple.com/account" target="_blank" rel="noopener">Apple Developer</a>.',
137
64
  inputType: "text"
138
65
  },
139
- auth_apple_private_key: {
140
- key: "auth_apple_private_key",
141
- label: "Apple Private Key",
142
- description: "The private key file contents (PEM format) for Sign in with Apple.",
143
- inputType: "secret",
144
- multiline: !0
145
- },
146
66
  // Solana auth
147
67
  auth_solana_enabled: {
148
68
  key: "auth_solana_enabled",
@@ -247,12 +167,12 @@ const q = {
247
167
  wallet_recovery_mode: {
248
168
  key: "wallet_recovery_mode",
249
169
  label: "Recovery Mode",
250
- description: "How users can recover their wallet if they lose access.",
170
+ description: "Controls whether users can recover their embedded wallet seed. <b>Share C Only</b> lets users export a single key share (cannot reconstruct the full seed). <b>Full Seed</b> lets users export the complete seed phrase. <b>No Recovery</b> prevents any seed export — required when Private Deposits are enabled, because recoverable seeds would let users front-run privacy withdrawals.",
251
171
  inputType: "select",
252
172
  presets: [
253
173
  { label: "Share C Only (Recommended)", value: "share_c_only" },
254
174
  { label: "Full Seed Phrase", value: "full_seed" },
255
- { label: "No Recovery", value: "none" }
175
+ { label: "No Recovery (Required for Private Deposits)", value: "none" }
256
176
  ]
257
177
  },
258
178
  feature_credits: {
@@ -264,7 +184,7 @@ const q = {
264
184
  feature_user_withdrawals: {
265
185
  key: "feature_user_withdrawals",
266
186
  label: "User Withdrawals",
267
- description: "Allow users to withdraw SOL/SPL tokens from their embedded wallet to external addresses.",
187
+ description: "Allow users to initiate withdrawals from their embedded wallet to external addresses. This is separate from the automated privacy withdrawal worker, which moves funds from the privacy pool to the treasury.",
268
188
  inputType: "boolean"
269
189
  },
270
190
  // ============= Security Settings =============
@@ -326,7 +246,7 @@ const q = {
326
246
  email_provider: {
327
247
  key: "email_provider",
328
248
  label: "Email Provider",
329
- description: "Select your email service provider for automatic configuration.",
249
+ description: "Select a provider to auto-configure SMTP host, port, and TLS. Choose Custom SMTP to enter settings manually.",
330
250
  inputType: "select",
331
251
  presets: [
332
252
  { label: "Mailgun", value: "mailgun" },
@@ -340,13 +260,14 @@ const q = {
340
260
  email_smtp_host: {
341
261
  key: "email_smtp_host",
342
262
  label: "SMTP Host",
343
- description: "SMTP server hostname (e.g., smtp.sendgrid.net).",
344
- inputType: "text"
263
+ description: "SMTP server hostname. Auto-filled when selecting a provider above.",
264
+ inputType: "text",
265
+ placeholder: "smtp.example.com"
345
266
  },
346
267
  email_smtp_port: {
347
268
  key: "email_smtp_port",
348
269
  label: "SMTP Port",
349
- description: "SMTP server port. Common: 587 (TLS), 465 (SSL), 25 (unencrypted).",
270
+ description: "SMTP server port. Most providers use 587 (TLS).",
350
271
  inputType: "select",
351
272
  presets: [
352
273
  { label: "587 (TLS)", value: "587" },
@@ -357,32 +278,34 @@ const q = {
357
278
  email_smtp_user: {
358
279
  key: "email_smtp_user",
359
280
  label: "SMTP Username",
360
- description: "Username for SMTP authentication.",
281
+ description: 'Username for SMTP authentication. For SendGrid use "apikey", for Postmark use your server API token, for Mailgun use your full Mailgun SMTP login.',
361
282
  inputType: "text"
362
283
  },
363
284
  email_smtp_password: {
364
285
  key: "email_smtp_password",
365
286
  label: "API Key",
366
- description: "API key or password for your email provider.",
287
+ description: "API key or password for your email provider. For SendGrid this is your API key, for Postmark your server API token, for Mailgun your SMTP password.",
367
288
  inputType: "secret"
368
289
  },
369
290
  email_smtp_tls: {
370
291
  key: "email_smtp_tls",
371
292
  label: "Use TLS",
372
- description: "Enable TLS encryption for SMTP connections.",
293
+ description: "Enable TLS encryption for SMTP connections. Required by most providers.",
373
294
  inputType: "boolean"
374
295
  },
375
296
  email_from_address: {
376
297
  key: "email_from_address",
377
298
  label: "From Address",
378
- description: "Default sender email address (e.g., noreply@example.com).",
379
- inputType: "text"
299
+ description: "Sender email address for verification, password reset, and instant link emails. Must be verified with your provider.",
300
+ inputType: "text",
301
+ placeholder: "noreply@yourdomain.com"
380
302
  },
381
303
  email_from_name: {
382
304
  key: "email_from_name",
383
305
  label: "From Name",
384
- description: 'Default sender display name (e.g., "My App").',
385
- inputType: "text"
306
+ description: 'Display name shown in the "From" field of outbound emails.',
307
+ inputType: "text",
308
+ placeholder: "My App"
386
309
  },
387
310
  // ============= Webhook Settings =============
388
311
  webhook_enabled: {
@@ -435,6 +358,12 @@ const q = {
435
358
  description: "Trust X-Forwarded-For headers. Enable if behind a reverse proxy.",
436
359
  inputType: "boolean"
437
360
  },
361
+ feature_cedros_pay: {
362
+ key: "feature_cedros_pay",
363
+ label: "Cedros Pay Integration",
364
+ description: "Enable Cedros Pay integration. When enabled, shows the Integrations tab with API key configuration. Not needed for co-located deployments using JWT/JWKS inter-service auth.",
365
+ inputType: "boolean"
366
+ },
438
367
  server_cedros_pay_api_key: {
439
368
  key: "server_cedros_pay_api_key",
440
369
  label: "Cedros Pay API Key",
@@ -940,7 +869,89 @@ const q = {
940
869
  message: "Very small withdrawals may lose significant value to fees."
941
870
  }
942
871
  }
943
- }, L = [
872
+ }, X = {
873
+ // Auth providers (sorted alphabetically by subcategory)
874
+ "auth.apple": {
875
+ label: "Apple Sign-In",
876
+ description: "Configure Sign in with Apple OAuth integration.",
877
+ icon: ""
878
+ },
879
+ "auth.email": {
880
+ label: "Email Authentication",
881
+ description: "Configure email/password authentication settings.",
882
+ icon: ""
883
+ },
884
+ "auth.google": {
885
+ label: "Google Sign-In",
886
+ description: "Configure Google OAuth integration.",
887
+ icon: ""
888
+ },
889
+ "auth.solana": {
890
+ label: "Solana Wallet Auth",
891
+ description: "Configure Solana wallet signature authentication.",
892
+ icon: ""
893
+ },
894
+ "auth.webauthn": {
895
+ label: "WebAuthn / Passkeys",
896
+ description: "Configure FIDO2/WebAuthn passwordless authentication.",
897
+ icon: ""
898
+ },
899
+ "auth.instantlink": {
900
+ label: "Instant Link",
901
+ description: "Configure magic link passwordless authentication via email.",
902
+ icon: ""
903
+ },
904
+ "deposit.general": {
905
+ label: "General",
906
+ description: "Core deposit and credit system configuration.",
907
+ icon: ""
908
+ },
909
+ deposit: {
910
+ label: "Deposit Settings",
911
+ description: "Configure deposit tokens, fees, and related settings.",
912
+ icon: ""
913
+ },
914
+ email: {
915
+ label: "Email / SMTP",
916
+ description: "Configure outbound email delivery for verification, password reset, and notifications.",
917
+ icon: ""
918
+ },
919
+ features: {
920
+ label: "Feature Flags",
921
+ description: "Enable or disable major platform features.",
922
+ icon: ""
923
+ },
924
+ privacy: {
925
+ label: "Privacy Settings",
926
+ description: "Control the privacy period for deposits. Longer periods provide better timing privacy but delay fund availability.",
927
+ icon: ""
928
+ },
929
+ rate_limit: {
930
+ label: "Rate Limiting",
931
+ description: "Protect the system from abuse by limiting request rates. Balance security with user experience.",
932
+ icon: ""
933
+ },
934
+ security: {
935
+ label: "Security",
936
+ description: "Configure CORS, cookies, sessions, and JWT settings.",
937
+ icon: ""
938
+ },
939
+ server: {
940
+ label: "Server",
941
+ description: "Server infrastructure settings. Some may be overridden by environment variables.",
942
+ icon: ""
943
+ },
944
+ webhook: {
945
+ label: "Webhooks",
946
+ description: "Configure HTTP webhook notifications for auth events.",
947
+ icon: ""
948
+ },
949
+ withdrawal: {
950
+ label: "Withdrawal Worker",
951
+ description: "Configure how the automated withdrawal processor handles pending withdrawals. These settings affect throughput and privacy.",
952
+ icon: ""
953
+ }
954
+ }, C = [
944
955
  "SOL",
945
956
  "USDC",
946
957
  "USDT",
@@ -952,49 +963,49 @@ const q = {
952
963
  "BONK",
953
964
  "ORE"
954
965
  ];
955
- function x(e) {
956
- const l = e.split(/(<a\s[^>]*>.*?<\/a>)/g);
957
- return l.length === 1 ? e : l.map((a, n) => {
958
- const s = a.match(/^<a\s+href="([^"]+)"[^>]*>([^<]+)<\/a>$/);
959
- return s ? /* @__PURE__ */ t("a", { href: s[1], target: "_blank", rel: "noopener noreferrer", children: s[2] }, n) : a;
966
+ function P(e) {
967
+ const s = e.split(/(<a\s[^>]*>.*?<\/a>)/g);
968
+ return s.length === 1 ? e : s.map((a, r) => {
969
+ const l = a.match(/^<a\s+href="([^"]+)"[^>]*>([^<]+)<\/a>$/);
970
+ return l ? /* @__PURE__ */ t("a", { href: l[1], target: "_blank", rel: "noopener noreferrer", children: l[2] }, r) : a;
960
971
  });
961
972
  }
962
973
  function Q({
963
974
  settings: e,
964
- edits: l,
975
+ edits: s,
965
976
  onChange: a,
966
- externalWarnings: n
977
+ externalWarnings: r
967
978
  }) {
968
- return /* @__PURE__ */ t("div", { className: "cedros-settings-grid", children: e.map((s) => /* @__PURE__ */ t(
969
- F,
979
+ return /* @__PURE__ */ t("div", { className: "cedros-settings-grid", children: e.map((l) => /* @__PURE__ */ t(
980
+ U,
970
981
  {
971
- setting: s,
972
- editValue: l[s.key],
982
+ setting: l,
983
+ editValue: s[l.key],
973
984
  onChange: a,
974
- externalWarning: n?.[s.key]
985
+ externalWarning: r?.[l.key]
975
986
  },
976
- s.key
987
+ l.key
977
988
  )) });
978
989
  }
979
- function F({ setting: e, editValue: l, onChange: a, externalWarning: n }) {
980
- const s = q[e.key], i = l ?? e.value, p = l !== void 0 && l !== e.value, r = s?.inputType === "boolean", o = S(() => {
981
- if (n) return n;
982
- if (!s?.warningThreshold) return null;
990
+ function U({ setting: e, editValue: s, onChange: a, externalWarning: r }) {
991
+ const l = R[e.key], i = s ?? e.value, p = s !== void 0 && s !== e.value, n = l?.inputType === "boolean", o = T(() => {
992
+ if (r) return r;
993
+ if (!l?.warningThreshold) return null;
983
994
  const c = parseInt(i, 10);
984
995
  if (isNaN(c)) return null;
985
- const { above: m, below: h, message: y } = s.warningThreshold;
986
- return m !== void 0 && c > m || h !== void 0 && c < h ? y : null;
987
- }, [i, s?.warningThreshold, n]);
988
- return s ? /* @__PURE__ */ t(
996
+ const { above: m, below: y, message: _ } = l.warningThreshold;
997
+ return m !== void 0 && c > m || y !== void 0 && c < y ? _ : null;
998
+ }, [i, l?.warningThreshold, r]);
999
+ return l ? /* @__PURE__ */ t(
989
1000
  "div",
990
1001
  {
991
- className: `cedros-setting-row ${p ? "cedros-setting-row-changed" : ""} ${o ? "cedros-setting-row-warning" : ""} ${r ? "cedros-setting-row-toggle" : ""}`,
992
- children: r ? /* @__PURE__ */ u(f, { children: [
1002
+ className: `cedros-setting-row ${p ? "cedros-setting-row-changed" : ""} ${o ? "cedros-setting-row-warning" : ""} ${n ? "cedros-setting-row-toggle" : ""}`,
1003
+ children: n ? /* @__PURE__ */ u(f, { children: [
993
1004
  /* @__PURE__ */ u("div", { className: "cedros-setting-control cedros-setting-control-toggle", children: [
994
1005
  /* @__PURE__ */ t(
995
- P,
1006
+ x,
996
1007
  {
997
- meta: s,
1008
+ meta: l,
998
1009
  value: i,
999
1010
  onChange: (c) => a(e.key, c)
1000
1011
  }
@@ -1002,19 +1013,19 @@ function F({ setting: e, editValue: l, onChange: a, externalWarning: n }) {
1002
1013
  o && /* @__PURE__ */ t("div", { className: "cedros-setting-warning", children: o })
1003
1014
  ] }),
1004
1015
  /* @__PURE__ */ u("div", { className: "cedros-setting-label", children: [
1005
- /* @__PURE__ */ t("span", { className: "cedros-setting-name", children: s.label }),
1006
- /* @__PURE__ */ t("span", { className: "cedros-setting-description", children: x(s.description) })
1016
+ /* @__PURE__ */ t("span", { className: "cedros-setting-name", children: l.label }),
1017
+ /* @__PURE__ */ t("span", { className: "cedros-setting-description", children: P(l.description) })
1007
1018
  ] })
1008
1019
  ] }) : /* @__PURE__ */ u(f, { children: [
1009
1020
  /* @__PURE__ */ u("div", { className: "cedros-setting-label", children: [
1010
- /* @__PURE__ */ t("span", { className: "cedros-setting-name", children: s.label }),
1011
- /* @__PURE__ */ t("span", { className: "cedros-setting-description", children: x(s.description) })
1021
+ /* @__PURE__ */ t("span", { className: "cedros-setting-name", children: l.label }),
1022
+ /* @__PURE__ */ t("span", { className: "cedros-setting-description", children: P(l.description) })
1012
1023
  ] }),
1013
1024
  /* @__PURE__ */ u("div", { className: "cedros-setting-control", children: [
1014
1025
  /* @__PURE__ */ t(
1015
- P,
1026
+ x,
1016
1027
  {
1017
- meta: s,
1028
+ meta: l,
1018
1029
  value: i,
1019
1030
  onChange: (c) => a(e.key, c)
1020
1031
  }
@@ -1039,15 +1050,15 @@ function F({ setting: e, editValue: l, onChange: a, externalWarning: n }) {
1039
1050
  ) })
1040
1051
  ] });
1041
1052
  }
1042
- function P({ meta: e, value: l, onChange: a }) {
1053
+ function x({ meta: e, value: s, onChange: a }) {
1043
1054
  switch (e.inputType) {
1044
1055
  case "duration":
1045
- return /* @__PURE__ */ t($, { value: l, onChange: a, presets: e.presets, min: e.min });
1056
+ return /* @__PURE__ */ t(F, { value: s, onChange: a, presets: e.presets, min: e.min });
1046
1057
  case "percentage":
1047
1058
  return /* @__PURE__ */ t(
1048
- j,
1059
+ W,
1049
1060
  {
1050
- value: l,
1061
+ value: s,
1051
1062
  onChange: a,
1052
1063
  min: e.min ?? 1,
1053
1064
  max: e.max ?? 100,
@@ -1057,9 +1068,9 @@ function P({ meta: e, value: l, onChange: a }) {
1057
1068
  );
1058
1069
  case "select":
1059
1070
  return /* @__PURE__ */ t(
1060
- W,
1071
+ q,
1061
1072
  {
1062
- value: l,
1073
+ value: s,
1063
1074
  onChange: a,
1064
1075
  presets: e.presets ?? [],
1065
1076
  unit: e.unit
@@ -1067,9 +1078,9 @@ function P({ meta: e, value: l, onChange: a }) {
1067
1078
  );
1068
1079
  case "number":
1069
1080
  return /* @__PURE__ */ t(
1070
- H,
1081
+ $,
1071
1082
  {
1072
- value: l,
1083
+ value: s,
1073
1084
  onChange: a,
1074
1085
  min: e.min,
1075
1086
  max: e.max,
@@ -1077,48 +1088,48 @@ function P({ meta: e, value: l, onChange: a }) {
1077
1088
  }
1078
1089
  );
1079
1090
  case "tokenList":
1080
- return /* @__PURE__ */ t(V, { value: l, onChange: a });
1091
+ return /* @__PURE__ */ t(B, { value: s, onChange: a });
1081
1092
  case "text":
1082
1093
  return /* @__PURE__ */ t(
1083
1094
  "input",
1084
1095
  {
1085
1096
  type: "text",
1086
- value: l,
1087
- onChange: (n) => a(n.target.value),
1097
+ value: s,
1098
+ onChange: (r) => a(r.target.value),
1088
1099
  className: "cedros-setting-input",
1089
1100
  placeholder: e.label
1090
1101
  }
1091
1102
  );
1092
1103
  case "boolean":
1093
- return /* @__PURE__ */ t(B, { value: l, onChange: a });
1104
+ return /* @__PURE__ */ t(j, { value: s, onChange: a });
1094
1105
  case "secret":
1095
- return /* @__PURE__ */ t(J, { value: l, onChange: a, multiline: e.multiline });
1106
+ return /* @__PURE__ */ t(J, { value: s, onChange: a, multiline: e.multiline });
1096
1107
  case "tokenSymbolList":
1097
- return /* @__PURE__ */ t(G, { value: l, onChange: a });
1108
+ return /* @__PURE__ */ t(G, { value: s, onChange: a });
1098
1109
  default:
1099
1110
  return /* @__PURE__ */ t(
1100
1111
  "input",
1101
1112
  {
1102
1113
  type: "text",
1103
- value: l,
1104
- onChange: (n) => a(n.target.value),
1114
+ value: s,
1115
+ onChange: (r) => a(r.target.value),
1105
1116
  className: "cedros-setting-input"
1106
1117
  }
1107
1118
  );
1108
1119
  }
1109
1120
  }
1110
- function $({ value: e, onChange: l, presets: a, min: n = 0 }) {
1111
- const s = parseInt(e, 10) || 0, i = R(s), p = d(
1121
+ function F({ value: e, onChange: s, presets: a, min: r = 0 }) {
1122
+ const l = parseInt(e, 10) || 0, i = M(l), p = d(
1112
1123
  (o) => {
1113
- o.target.value && l(o.target.value);
1124
+ o.target.value && s(o.target.value);
1114
1125
  },
1115
- [l]
1116
- ), r = d(
1126
+ [s]
1127
+ ), n = d(
1117
1128
  (o) => {
1118
- const c = Math.max(n, parseInt(o.target.value, 10) || 0);
1119
- l(String(c));
1129
+ const c = Math.max(r, parseInt(o.target.value, 10) || 0);
1130
+ s(String(c));
1120
1131
  },
1121
- [l, n]
1132
+ [s, r]
1122
1133
  );
1123
1134
  return /* @__PURE__ */ u("div", { className: "cedros-duration-input", children: [
1124
1135
  a && a.length > 0 && /* @__PURE__ */ u(
@@ -1138,9 +1149,9 @@ function $({ value: e, onChange: l, presets: a, min: n = 0 }) {
1138
1149
  "input",
1139
1150
  {
1140
1151
  type: "number",
1141
- value: s,
1142
- onChange: r,
1143
- min: n,
1152
+ value: l,
1153
+ onChange: n,
1154
+ min: r,
1144
1155
  className: "cedros-setting-input cedros-setting-input-sm"
1145
1156
  }
1146
1157
  ),
@@ -1152,24 +1163,24 @@ function $({ value: e, onChange: l, presets: a, min: n = 0 }) {
1152
1163
  ] })
1153
1164
  ] });
1154
1165
  }
1155
- function j({
1166
+ function W({
1156
1167
  value: e,
1157
- onChange: l,
1168
+ onChange: s,
1158
1169
  min: a,
1159
- max: n,
1160
- step: s,
1170
+ max: r,
1171
+ step: l,
1161
1172
  presets: i
1162
1173
  }) {
1163
- const p = parseInt(e, 10) || a, r = d(
1174
+ const p = parseInt(e, 10) || a, n = d(
1164
1175
  (c) => {
1165
- l(c.target.value);
1176
+ s(c.target.value);
1166
1177
  },
1167
- [l]
1178
+ [s]
1168
1179
  ), o = d(
1169
1180
  (c) => {
1170
- l(c);
1181
+ s(c);
1171
1182
  },
1172
- [l]
1183
+ [s]
1173
1184
  );
1174
1185
  return /* @__PURE__ */ u("div", { className: "cedros-percentage-input", children: [
1175
1186
  /* @__PURE__ */ u("div", { className: "cedros-percentage-slider-row", children: [
@@ -1178,10 +1189,10 @@ function j({
1178
1189
  {
1179
1190
  type: "range",
1180
1191
  value: p,
1181
- onChange: r,
1192
+ onChange: n,
1182
1193
  min: a,
1183
- max: n,
1184
- step: s,
1194
+ max: r,
1195
+ step: l,
1185
1196
  className: "cedros-percentage-slider"
1186
1197
  }
1187
1198
  ),
@@ -1202,32 +1213,32 @@ function j({
1202
1213
  )) })
1203
1214
  ] });
1204
1215
  }
1205
- function W({ value: e, onChange: l, presets: a, unit: n }) {
1206
- const s = !a.some((r) => r.value === e), i = d(
1207
- (r) => {
1208
- r.target.value !== "__custom__" && l(r.target.value);
1216
+ function q({ value: e, onChange: s, presets: a, unit: r }) {
1217
+ const l = !a.some((n) => n.value === e), i = d(
1218
+ (n) => {
1219
+ n.target.value !== "__custom__" && s(n.target.value);
1209
1220
  },
1210
- [l]
1221
+ [s]
1211
1222
  ), p = d(
1212
- (r) => {
1213
- l(r.target.value);
1223
+ (n) => {
1224
+ s(n.target.value);
1214
1225
  },
1215
- [l]
1226
+ [s]
1216
1227
  );
1217
1228
  return /* @__PURE__ */ u("div", { className: "cedros-select-input", children: [
1218
1229
  /* @__PURE__ */ u(
1219
1230
  "select",
1220
1231
  {
1221
- value: s ? "__custom__" : e,
1232
+ value: l ? "__custom__" : e,
1222
1233
  onChange: i,
1223
1234
  className: "cedros-setting-select",
1224
1235
  children: [
1225
- a.map((r) => /* @__PURE__ */ t("option", { value: r.value, children: r.label }, r.value)),
1236
+ a.map((n) => /* @__PURE__ */ t("option", { value: n.value, children: n.label }, n.value)),
1226
1237
  /* @__PURE__ */ t("option", { value: "__custom__", children: "Custom..." })
1227
1238
  ]
1228
1239
  }
1229
1240
  ),
1230
- s && /* @__PURE__ */ u("div", { className: "cedros-select-custom", children: [
1241
+ l && /* @__PURE__ */ u("div", { className: "cedros-select-custom", children: [
1231
1242
  /* @__PURE__ */ t(
1232
1243
  "input",
1233
1244
  {
@@ -1237,16 +1248,16 @@ function W({ value: e, onChange: l, presets: a, unit: n }) {
1237
1248
  className: "cedros-setting-input cedros-setting-input-sm"
1238
1249
  }
1239
1250
  ),
1240
- n && /* @__PURE__ */ t("span", { className: "cedros-setting-unit", children: n })
1251
+ r && /* @__PURE__ */ t("span", { className: "cedros-setting-unit", children: r })
1241
1252
  ] })
1242
1253
  ] });
1243
1254
  }
1244
- function H({ value: e, onChange: l, min: a, max: n, unit: s }) {
1255
+ function $({ value: e, onChange: s, min: a, max: r, unit: l }) {
1245
1256
  const i = d(
1246
1257
  (p) => {
1247
- l(p.target.value);
1258
+ s(p.target.value);
1248
1259
  },
1249
- [l]
1260
+ [s]
1250
1261
  );
1251
1262
  return /* @__PURE__ */ u("div", { className: "cedros-number-input", children: [
1252
1263
  /* @__PURE__ */ t(
@@ -1256,17 +1267,17 @@ function H({ value: e, onChange: l, min: a, max: n, unit: s }) {
1256
1267
  value: e,
1257
1268
  onChange: i,
1258
1269
  min: a,
1259
- max: n,
1270
+ max: r,
1260
1271
  className: "cedros-setting-input"
1261
1272
  }
1262
1273
  ),
1263
- s && /* @__PURE__ */ t("span", { className: "cedros-setting-unit", children: s })
1274
+ l && /* @__PURE__ */ t("span", { className: "cedros-setting-unit", children: l })
1264
1275
  ] });
1265
1276
  }
1266
- function B({ value: e, onChange: l }) {
1267
- const a = e === "true", n = d(() => {
1268
- l(a ? "false" : "true");
1269
- }, [a, l]);
1277
+ function j({ value: e, onChange: s }) {
1278
+ const a = e === "true", r = d(() => {
1279
+ s(a ? "false" : "true");
1280
+ }, [a, s]);
1270
1281
  return /* @__PURE__ */ u(
1271
1282
  "button",
1272
1283
  {
@@ -1274,7 +1285,7 @@ function B({ value: e, onChange: l }) {
1274
1285
  role: "switch",
1275
1286
  "aria-checked": a,
1276
1287
  className: `cedros-toggle ${a ? "cedros-toggle-on" : "cedros-toggle-off"}`,
1277
- onClick: n,
1288
+ onClick: r,
1278
1289
  children: [
1279
1290
  /* @__PURE__ */ t("span", { className: "cedros-toggle-track", children: /* @__PURE__ */ t("span", { className: "cedros-toggle-thumb" }) }),
1280
1291
  /* @__PURE__ */ t("span", { className: "cedros-toggle-label", children: a ? "Enabled" : "Disabled" })
@@ -1282,18 +1293,18 @@ function B({ value: e, onChange: l }) {
1282
1293
  }
1283
1294
  );
1284
1295
  }
1285
- function J({ value: e, onChange: l, multiline: a }) {
1286
- const [n, s] = k(!1), [i, p] = k(!1), r = e && e.length > 0, o = d(() => {
1287
- s(!0), p(!0);
1296
+ function J({ value: e, onChange: s, multiline: a }) {
1297
+ const [r, l] = w(!1), [i, p] = w(!1), n = e && e.length > 0, o = d(() => {
1298
+ l(!0), p(!0);
1288
1299
  }, []), c = d(() => {
1289
- s(!1), p(!1);
1300
+ l(!1), p(!1);
1290
1301
  }, []), m = d(
1291
- (h) => {
1292
- l(h.target.value);
1302
+ (y) => {
1303
+ s(y.target.value);
1293
1304
  },
1294
- [l]
1305
+ [s]
1295
1306
  );
1296
- return !n && r ? /* @__PURE__ */ u("div", { className: "cedros-secret-input cedros-secret-input-masked", children: [
1307
+ return !r && n ? /* @__PURE__ */ u("div", { className: "cedros-secret-input cedros-secret-input-masked", children: [
1297
1308
  /* @__PURE__ */ t("span", { className: "cedros-secret-masked", children: "•".repeat(Math.min(e.length, 20)) }),
1298
1309
  /* @__PURE__ */ t("button", { type: "button", className: "cedros-secret-edit-btn", onClick: o, children: "Edit" })
1299
1310
  ] }) : /* @__PURE__ */ u("div", { className: "cedros-secret-input", children: [
@@ -1326,50 +1337,50 @@ function J({ value: e, onChange: l, multiline: a }) {
1326
1337
  children: i ? "Hide" : "Show"
1327
1338
  }
1328
1339
  ),
1329
- n && /* @__PURE__ */ t("button", { type: "button", className: "cedros-secret-done-btn", onClick: c, children: "Done" })
1340
+ r && /* @__PURE__ */ t("button", { type: "button", className: "cedros-secret-done-btn", onClick: c, children: "Done" })
1330
1341
  ] })
1331
1342
  ] });
1332
1343
  }
1333
- function V({ value: e, onChange: l }) {
1334
- const a = S(() => {
1344
+ function B({ value: e, onChange: s }) {
1345
+ const a = T(() => {
1335
1346
  try {
1336
1347
  return JSON.parse(e || "[]");
1337
1348
  } catch {
1338
1349
  return [];
1339
1350
  }
1340
- }, [e]), n = d(
1341
- (r) => {
1342
- l(JSON.stringify(r));
1351
+ }, [e]), r = d(
1352
+ (n) => {
1353
+ s(JSON.stringify(n));
1343
1354
  },
1344
- [l]
1345
- ), s = d(() => {
1346
- n([...a, { symbol: "", mint: "", decimals: 6 }]);
1347
- }, [a, n]), i = d(
1348
- (r, o, c) => {
1355
+ [s]
1356
+ ), l = d(() => {
1357
+ r([...a, { symbol: "", mint: "", decimals: 6 }]);
1358
+ }, [a, r]), i = d(
1359
+ (n, o, c) => {
1349
1360
  const m = [...a];
1350
- m[r] = { ...m[r], [o]: c }, n(m);
1361
+ m[n] = { ...m[n], [o]: c }, r(m);
1351
1362
  },
1352
- [a, n]
1363
+ [a, r]
1353
1364
  ), p = d(
1354
- (r) => {
1355
- n(a.filter((o, c) => c !== r));
1365
+ (n) => {
1366
+ r(a.filter((o, c) => c !== n));
1356
1367
  },
1357
- [a, n]
1368
+ [a, r]
1358
1369
  );
1359
1370
  return /* @__PURE__ */ u("div", { className: "cedros-token-list-input", children: [
1360
1371
  /* @__PURE__ */ u("div", { className: "cedros-token-presets", children: [
1361
1372
  /* @__PURE__ */ t("span", { className: "cedros-token-presets-label", children: "Built-in tokens:" }),
1362
- /* @__PURE__ */ t("div", { className: "cedros-token-presets-list", children: L.map((r) => /* @__PURE__ */ t("span", { className: "cedros-token-preset-chip", children: r }, r)) })
1373
+ /* @__PURE__ */ t("div", { className: "cedros-token-presets-list", children: C.map((n) => /* @__PURE__ */ t("span", { className: "cedros-token-preset-chip", children: n }, n)) })
1363
1374
  ] }),
1364
1375
  a.length === 0 && /* @__PURE__ */ t("p", { className: "cedros-token-list-empty", children: "No custom tokens added. Use the built-in tokens above or add your own." }),
1365
- a.map((r, o) => /* @__PURE__ */ u("div", { className: "cedros-token-row", children: [
1376
+ a.map((n, o) => /* @__PURE__ */ u("div", { className: "cedros-token-row", children: [
1366
1377
  /* @__PURE__ */ u("div", { className: "cedros-token-row-fields", children: [
1367
1378
  /* @__PURE__ */ t(
1368
1379
  "input",
1369
1380
  {
1370
1381
  type: "text",
1371
1382
  placeholder: "Symbol",
1372
- value: r.symbol,
1383
+ value: n.symbol,
1373
1384
  onChange: (c) => i(o, "symbol", c.target.value.toUpperCase()),
1374
1385
  className: "cedros-setting-input cedros-token-input-symbol",
1375
1386
  maxLength: 10
@@ -1380,7 +1391,7 @@ function V({ value: e, onChange: l }) {
1380
1391
  {
1381
1392
  type: "text",
1382
1393
  placeholder: "Mint address",
1383
- value: r.mint,
1394
+ value: n.mint,
1384
1395
  onChange: (c) => i(o, "mint", c.target.value),
1385
1396
  className: "cedros-setting-input cedros-token-input-mint"
1386
1397
  }
@@ -1390,7 +1401,7 @@ function V({ value: e, onChange: l }) {
1390
1401
  {
1391
1402
  type: "number",
1392
1403
  placeholder: "Decimals",
1393
- value: r.decimals,
1404
+ value: n.decimals,
1394
1405
  onChange: (c) => i(o, "decimals", parseInt(c.target.value, 10) || 0),
1395
1406
  className: "cedros-setting-input cedros-token-input-decimals",
1396
1407
  min: 0,
@@ -1402,7 +1413,7 @@ function V({ value: e, onChange: l }) {
1402
1413
  {
1403
1414
  type: "text",
1404
1415
  placeholder: "Logo URL (optional)",
1405
- value: r.logoUrl || "",
1416
+ value: n.logoUrl || "",
1406
1417
  onChange: (c) => i(o, "logoUrl", c.target.value || void 0),
1407
1418
  className: "cedros-setting-input cedros-token-input-logo"
1408
1419
  }
@@ -1419,35 +1430,35 @@ function V({ value: e, onChange: l }) {
1419
1430
  }
1420
1431
  )
1421
1432
  ] }, o)),
1422
- /* @__PURE__ */ t("button", { type: "button", className: "cedros-token-add-btn", onClick: s, children: "+ Add Token" })
1433
+ /* @__PURE__ */ t("button", { type: "button", className: "cedros-token-add-btn", onClick: l, children: "+ Add Token" })
1423
1434
  ] });
1424
1435
  }
1425
- function G({ value: e, onChange: l }) {
1426
- const a = S(() => e.split(",").map((i) => i.trim()).filter(Boolean), [e]), n = d(
1436
+ function G({ value: e, onChange: s }) {
1437
+ const a = T(() => e.split(",").map((i) => i.trim()).filter(Boolean), [e]), r = d(
1427
1438
  (i) => {
1428
1439
  if (!i || a.includes(i)) return;
1429
1440
  const p = [...a, i].join(", ");
1430
- l(p);
1441
+ s(p);
1431
1442
  },
1432
- [a, l]
1433
- ), s = d(
1443
+ [a, s]
1444
+ ), l = d(
1434
1445
  (i) => {
1435
- const p = a.filter((r) => r !== i).join(", ");
1436
- l(p);
1446
+ const p = a.filter((n) => n !== i).join(", ");
1447
+ s(p);
1437
1448
  },
1438
- [a, l]
1449
+ [a, s]
1439
1450
  );
1440
1451
  return /* @__PURE__ */ u("div", { className: "cedros-token-symbol-list-input", children: [
1441
1452
  /* @__PURE__ */ u("div", { className: "cedros-token-presets", children: [
1442
1453
  /* @__PURE__ */ t("span", { className: "cedros-token-presets-label", children: "Click to add:" }),
1443
- /* @__PURE__ */ t("div", { className: "cedros-token-presets-list", children: L.map((i) => {
1454
+ /* @__PURE__ */ t("div", { className: "cedros-token-presets-list", children: C.map((i) => {
1444
1455
  const p = a.includes(i);
1445
1456
  return /* @__PURE__ */ u(
1446
1457
  "button",
1447
1458
  {
1448
1459
  type: "button",
1449
1460
  className: `cedros-token-preset-chip ${p ? "cedros-token-preset-chip-selected" : ""}`,
1450
- onClick: () => p ? s(i) : n(i),
1461
+ onClick: () => p ? l(i) : r(i),
1451
1462
  title: p ? `Remove ${i}` : `Add ${i}`,
1452
1463
  children: [
1453
1464
  i,
@@ -1463,14 +1474,76 @@ function G({ value: e, onChange: l }) {
1463
1474
  {
1464
1475
  type: "text",
1465
1476
  value: e,
1466
- onChange: (i) => l(i.target.value),
1477
+ onChange: (i) => s(i.target.value),
1467
1478
  className: "cedros-setting-input",
1468
1479
  placeholder: "USDC, SOL, BONK..."
1469
1480
  }
1470
1481
  )
1471
1482
  ] });
1472
1483
  }
1473
- function Z({ status: e, error: l }) {
1484
+ const H = 800, V = 2e3;
1485
+ function Z() {
1486
+ const { settings: e, isLoading: s, error: a, fetchSettings: r, updateSettings: l } = E(), [i, p] = w({}), [n, o] = w("idle"), [c, m] = w(null), y = S(null), _ = S(null), k = S({});
1487
+ O(() => () => {
1488
+ y.current && clearTimeout(y.current), _.current && clearTimeout(_.current);
1489
+ }, []);
1490
+ const N = d(async () => {
1491
+ const h = { ...k.current };
1492
+ if (Object.keys(h).length === 0) {
1493
+ o("idle");
1494
+ return;
1495
+ }
1496
+ o("saving"), m(null);
1497
+ const v = Object.entries(h).map(([b, g]) => ({
1498
+ key: b,
1499
+ value: g
1500
+ }));
1501
+ try {
1502
+ await l(v), p((b) => {
1503
+ const g = { ...b };
1504
+ for (const D of Object.keys(h))
1505
+ delete g[D];
1506
+ return g;
1507
+ });
1508
+ for (const b of Object.keys(h))
1509
+ delete k.current[b];
1510
+ o("saved"), _.current && clearTimeout(_.current), _.current = setTimeout(() => {
1511
+ o("idle");
1512
+ }, V);
1513
+ } catch (b) {
1514
+ o("error"), m(b instanceof Error ? b.message : "Failed to save");
1515
+ }
1516
+ }, [l]), A = d(
1517
+ (h, v) => {
1518
+ p((b) => ({ ...b, [h]: v })), k.current[h] = v, m(null), o("pending"), y.current && clearTimeout(y.current), y.current = setTimeout(() => {
1519
+ N();
1520
+ }, H);
1521
+ },
1522
+ [N]
1523
+ ), L = d(
1524
+ (h) => {
1525
+ if (i[h] !== void 0) return i[h];
1526
+ for (const v of Object.values(e)) {
1527
+ const b = v.find((g) => g.key === h);
1528
+ if (b) return b.value;
1529
+ }
1530
+ return "";
1531
+ },
1532
+ [i, e]
1533
+ );
1534
+ return {
1535
+ settings: e,
1536
+ edits: i,
1537
+ isLoading: s,
1538
+ autosaveStatus: n,
1539
+ autosaveError: c,
1540
+ error: a,
1541
+ fetchSettings: r,
1542
+ handleChange: A,
1543
+ getEffectiveValue: L
1544
+ };
1545
+ }
1546
+ function ee({ status: e, error: s }) {
1474
1547
  return e === "idle" ? null : /* @__PURE__ */ u("div", { className: `cedros-autosave-status cedros-autosave-status--${e}`, children: [
1475
1548
  e === "pending" && /* @__PURE__ */ u(f, { children: [
1476
1549
  /* @__PURE__ */ t("span", { className: "cedros-autosave-dot" }),
@@ -1486,12 +1559,14 @@ function Z({ status: e, error: l }) {
1486
1559
  ] }),
1487
1560
  e === "error" && /* @__PURE__ */ u(f, { children: [
1488
1561
  /* @__PURE__ */ t("span", { className: "cedros-autosave-error-icon", children: "!" }),
1489
- /* @__PURE__ */ t("span", { children: l || "Save failed" })
1562
+ /* @__PURE__ */ t("span", { children: s || "Save failed" })
1490
1563
  ] })
1491
1564
  ] });
1492
1565
  }
1493
1566
  export {
1494
- Z as A,
1567
+ ee as A,
1568
+ X as C,
1495
1569
  Q as S,
1496
- X as u
1570
+ R as a,
1571
+ Z as u
1497
1572
  };