@pfm-platform/shared 0.1.0

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 ADDED
@@ -0,0 +1,1469 @@
1
+ 'use strict';
2
+
3
+ var react = require('react');
4
+ var jsxRuntime = require('react/jsx-runtime');
5
+ var zod = require('zod');
6
+
7
+ // src/contexts/AppModeContext.tsx
8
+ var AppModeContext = react.createContext({
9
+ mode: "user",
10
+ setMode: () => {
11
+ console.warn("AppModeContext.setMode called outside of AppModeProvider");
12
+ }
13
+ });
14
+ function AppModeProvider({
15
+ children,
16
+ initialMode = "user"
17
+ }) {
18
+ const [mode, setMode] = react.useState(initialMode);
19
+ return /* @__PURE__ */ jsxRuntime.jsx(AppModeContext.Provider, { value: { mode, setMode }, children });
20
+ }
21
+ function useAppMode() {
22
+ const context = react.useContext(AppModeContext);
23
+ if (!context) {
24
+ throw new Error("useAppMode must be used within AppModeProvider");
25
+ }
26
+ return context;
27
+ }
28
+ var AccountTypeSchema = zod.z.enum([
29
+ "checking",
30
+ "savings",
31
+ "cards",
32
+ "student_loans",
33
+ "bill",
34
+ "autos",
35
+ "home",
36
+ "investment",
37
+ "loan",
38
+ "asset",
39
+ "cd",
40
+ "money_market",
41
+ "certificates",
42
+ "commercial",
43
+ "creditline"
44
+ ]);
45
+ var AccountStateSchema = zod.z.enum([
46
+ "active",
47
+ "closed",
48
+ "archived",
49
+ "pending_deletion"
50
+ ]);
51
+ var AggregationTypeSchema = zod.z.enum([
52
+ "finicity",
53
+ "cashedge",
54
+ "partner"
55
+ ]);
56
+ var PreferredBalanceTypeSchema = zod.z.enum([
57
+ "Available",
58
+ "Current",
59
+ "Outstanding"
60
+ ]);
61
+ var FinancialInstitutionSchema = zod.z.object({
62
+ id: zod.z.number().int(),
63
+ name: zod.z.string()
64
+ }).nullable();
65
+ var CashEdgeAccountTypeSchema = zod.z.object({
66
+ name: zod.z.string(),
67
+ acct_type: zod.z.string(),
68
+ ext_type: zod.z.string(),
69
+ group: zod.z.string()
70
+ }).nullable();
71
+ var AccountErrorSchema = zod.z.object({
72
+ message: zod.z.string(),
73
+ code: zod.z.string(),
74
+ actionable: zod.z.boolean(),
75
+ description: zod.z.string().optional()
76
+ // Finicity-specific field
77
+ }).nullable();
78
+ var OtherBalanceSchema = zod.z.object({
79
+ balance_type: zod.z.string(),
80
+ balance: zod.z.string().regex(/^\d+\.\d+$/)
81
+ });
82
+ var AccountSchema = zod.z.object({
83
+ // ========================================
84
+ // Core Identifiers
85
+ // ========================================
86
+ id: zod.z.number().int().positive(),
87
+ name: zod.z.string().min(1),
88
+ // ========================================
89
+ // Balance Fields (STRINGS, not numbers!)
90
+ // ========================================
91
+ balance: zod.z.string().regex(/^-?\d+\.\d{1,2}$/, {
92
+ message: 'Balance must be a string in format "1234.56" with 1-2 decimal places'
93
+ }),
94
+ locked_balance: zod.z.string().regex(/^-?\d+\.\d+$/).nullable().optional(),
95
+ preferred_balance_type: PreferredBalanceTypeSchema.nullable().optional(),
96
+ // ========================================
97
+ // Type and State
98
+ // ========================================
99
+ account_type: AccountTypeSchema,
100
+ display_account_type: zod.z.string().optional(),
101
+ state: AccountStateSchema,
102
+ // ========================================
103
+ // Aggregation Fields
104
+ // ========================================
105
+ aggregation_type: AggregationTypeSchema,
106
+ reference_id: zod.z.string().optional(),
107
+ harvest_updated_at: zod.z.string().datetime().nullable(),
108
+ // ========================================
109
+ // Include Flags (6 booleans)
110
+ // ========================================
111
+ include_in_expenses: zod.z.boolean(),
112
+ include_in_budget: zod.z.boolean(),
113
+ include_in_cashflow: zod.z.boolean(),
114
+ include_in_dashboard: zod.z.boolean(),
115
+ include_in_goals: zod.z.boolean(),
116
+ include_in_networth: zod.z.boolean(),
117
+ // ========================================
118
+ // Nested Objects
119
+ // ========================================
120
+ fi: FinancialInstitutionSchema,
121
+ cashedge_account_type: CashEdgeAccountTypeSchema,
122
+ error: AccountErrorSchema.optional(),
123
+ other_balances: zod.z.array(OtherBalanceSchema).optional()
124
+ });
125
+ var AccountsResponseSchema = zod.z.object({
126
+ accounts: zod.z.array(AccountSchema)
127
+ });
128
+ var AccountCreateSchemaAdmin = zod.z.object({
129
+ name: zod.z.string().optional().default("Test Account"),
130
+ balance: zod.z.string().optional().default("1000.00"),
131
+ account_type: AccountTypeSchema.optional().default("checking"),
132
+ state: AccountStateSchema.optional().default("active"),
133
+ aggregation_type: AggregationTypeSchema.optional().default("partner"),
134
+ // Include flags - all optional with defaults
135
+ include_in_expenses: zod.z.boolean().optional().default(true),
136
+ include_in_budget: zod.z.boolean().optional().default(true),
137
+ include_in_cashflow: zod.z.boolean().optional().default(true),
138
+ include_in_dashboard: zod.z.boolean().optional().default(true),
139
+ include_in_goals: zod.z.boolean().optional().default(false),
140
+ include_in_networth: zod.z.boolean().optional().default(true),
141
+ // Optional fields
142
+ locked_balance: zod.z.string().regex(/^-?\d+\.\d+$/).nullable().optional(),
143
+ preferred_balance_type: PreferredBalanceTypeSchema.nullable().optional(),
144
+ display_account_type: zod.z.string().optional(),
145
+ reference_id: zod.z.string().optional(),
146
+ harvest_updated_at: zod.z.string().datetime().nullable().optional(),
147
+ other_balances: zod.z.array(OtherBalanceSchema).optional().default([]),
148
+ // Nested objects
149
+ fi: FinancialInstitutionSchema.optional(),
150
+ cashedge_account_type: CashEdgeAccountTypeSchema.optional(),
151
+ error: AccountErrorSchema.optional()
152
+ }).strict();
153
+ var AccountCreateSchemaUser = AccountSchema.omit({
154
+ id: true
155
+ }).strict();
156
+ var AccountCreateSchema = AccountCreateSchemaUser;
157
+ var AccountUpdateSchema = AccountSchema.partial().required({
158
+ id: true
159
+ });
160
+ var AccountDeleteSchema = zod.z.object({
161
+ id: zod.z.number().int().positive()
162
+ });
163
+ var AccountArchiveSchema = zod.z.object({
164
+ id: zod.z.number().int().positive()
165
+ });
166
+ var PendingAccountSchema = zod.z.object({
167
+ account_ids: zod.z.array(zod.z.number().int()),
168
+ institution_id: zod.z.number().int()
169
+ });
170
+ var PendingAccountsResponseSchema = zod.z.object({
171
+ pending_accounts: zod.z.array(PendingAccountSchema)
172
+ });
173
+ var PendingAccountDeleteSchema = zod.z.object({
174
+ accountId: zod.z.number().int().positive()
175
+ });
176
+ var InvestmentHoldingSchema = zod.z.object({
177
+ symbol: zod.z.string(),
178
+ description: zod.z.string().optional(),
179
+ quantity: zod.z.number().finite(),
180
+ price: zod.z.number().finite().positive(),
181
+ value: zod.z.string().regex(/^\d+\.\d{2}$/),
182
+ // String format like other amounts
183
+ cost_basis: zod.z.string().regex(/^\d+\.\d{2}$/).optional(),
184
+ unrealized_gain_loss: zod.z.string().regex(/^-?\d+\.\d{2}$/).optional()
185
+ });
186
+ var InvestmentSchema = zod.z.object({
187
+ account_id: zod.z.number().int(),
188
+ holdings: zod.z.array(InvestmentHoldingSchema),
189
+ total_value: zod.z.string().regex(/^\d+\.\d{2}$/)
190
+ });
191
+ var InvestmentsResponseSchema = zod.z.object({
192
+ investments: zod.z.array(InvestmentSchema)
193
+ });
194
+ var TransactionTypeSchema = zod.z.enum(["Debit", "Credit"]);
195
+ var TransactionTagSchema = zod.z.object({
196
+ name: zod.z.string(),
197
+ balance: zod.z.number().finite()
198
+ });
199
+ var TransactionLinksSchema = zod.z.object({
200
+ account: zod.z.number().int()
201
+ });
202
+ var TransactionSchema = zod.z.object({
203
+ // ========================================
204
+ // Core Identifiers
205
+ // ========================================
206
+ id: zod.z.string().regex(/^\d{4}_\d{2}_\d{2}_\w+_\d+$/, {
207
+ message: "Transaction ID must be in format YYYY_MM_DD_referenceId_accountId"
208
+ }),
209
+ reference_id: zod.z.string(),
210
+ // ========================================
211
+ // Transaction Details
212
+ // ========================================
213
+ transaction_type: TransactionTypeSchema,
214
+ memo: zod.z.string().nullable().optional(),
215
+ balance: zod.z.number().finite().positive(),
216
+ // NUMBER in legacy data, not string
217
+ // ========================================
218
+ // Timestamps
219
+ // ========================================
220
+ // Note: Legacy uses RFC 3339 format with offset (e.g., "2020-08-06T00:00:00.000+00:00")
221
+ // Zod's .datetime() is too strict (requires 'Z'), so we use string validation
222
+ posted_at: zod.z.string(),
223
+ created_at: zod.z.string(),
224
+ deleted_at: zod.z.string().nullable().optional(),
225
+ // ========================================
226
+ // Names
227
+ // ========================================
228
+ nickname: zod.z.string(),
229
+ original_name: zod.z.string(),
230
+ // ========================================
231
+ // Optional Fields
232
+ // ========================================
233
+ check_number: zod.z.string().nullable().optional(),
234
+ // ========================================
235
+ // Nested Objects
236
+ // ========================================
237
+ tags: zod.z.array(TransactionTagSchema),
238
+ links: TransactionLinksSchema
239
+ });
240
+ var TransactionsResponseSchema = zod.z.object({
241
+ transactions: zod.z.array(TransactionSchema)
242
+ });
243
+ var TransactionCreateSchemaAdmin = zod.z.object({
244
+ reference_id: zod.z.string(),
245
+ transaction_type: TransactionTypeSchema,
246
+ balance: zod.z.number().positive(),
247
+ posted_at: zod.z.string(),
248
+ nickname: zod.z.string().optional().default("Test Transaction"),
249
+ original_name: zod.z.string().optional().default("Test Transaction"),
250
+ memo: zod.z.string().nullable().optional(),
251
+ check_number: zod.z.string().nullable().optional(),
252
+ deleted_at: zod.z.string().nullable().optional(),
253
+ tags: zod.z.array(TransactionTagSchema).optional().default([]),
254
+ links: TransactionLinksSchema
255
+ }).strict();
256
+ var TransactionCreateSchemaUser = TransactionSchema.omit({
257
+ id: true,
258
+ created_at: true
259
+ }).strict();
260
+ var TransactionCreateSchema = TransactionCreateSchemaUser;
261
+ var TransactionUpdateSchema = TransactionSchema.pick({
262
+ id: true,
263
+ nickname: true,
264
+ tags: true
265
+ }).strict();
266
+ var TransactionTaggingRegularSchema = zod.z.object({
267
+ type: zod.z.literal("regular"),
268
+ repeat: zod.z.boolean(),
269
+ // Apply to all future matching transactions
270
+ regular: zod.z.array(zod.z.string())
271
+ // Tag names
272
+ });
273
+ var TransactionTaggingSplitItemSchema = zod.z.object({
274
+ name: zod.z.string(),
275
+ // Tag name
276
+ value: zod.z.number().finite().positive()
277
+ // Split amount
278
+ });
279
+ var TransactionTaggingSplitSchema = zod.z.object({
280
+ type: zod.z.literal("split"),
281
+ split: zod.z.array(TransactionTaggingSplitItemSchema)
282
+ });
283
+ var TransactionTaggingSchema = zod.z.discriminatedUnion("type", [
284
+ TransactionTaggingRegularSchema,
285
+ TransactionTaggingSplitSchema
286
+ ]);
287
+ var TransactionSearchParamsSchema = zod.z.object({
288
+ begin_on: zod.z.string().regex(/^\d{4}-\d{2}-\d{2}$/),
289
+ // RFC 3339 date "2020-01-01"
290
+ end_on: zod.z.string().regex(/^\d{4}-\d{2}-\d{2}$/),
291
+ // RFC 3339 date "2020-12-31"
292
+ q: zod.z.string().optional(),
293
+ // Search query
294
+ untagged: zod.z.enum(["0", "1"]).optional(),
295
+ // "0" = false, "1" = true
296
+ tags: zod.z.array(zod.z.string()).optional()
297
+ // Filter by tag names
298
+ });
299
+ var TransactionDeleteSchema = zod.z.object({
300
+ id: zod.z.string().regex(/^\d{4}_\d{2}_\d{2}_\w+_\d+$/, {
301
+ message: "Transaction ID must be in format YYYY_MM_DD_referenceId_accountId"
302
+ })
303
+ });
304
+ var CashflowEventTypeSchema = zod.z.enum(["bill", "income"]);
305
+ var RecurrenceFrequencySchema = zod.z.enum([
306
+ "once",
307
+ "weekly",
308
+ "biweekly",
309
+ "monthly",
310
+ "quarterly",
311
+ "yearly"
312
+ ]);
313
+ var CashflowEventSchema = zod.z.object({
314
+ // ========================================
315
+ // Core Identifiers
316
+ // ========================================
317
+ id: zod.z.string().uuid(),
318
+ event_id: zod.z.string(),
319
+ // Links to recurring series if applicable
320
+ // ========================================
321
+ // Event Details
322
+ // ========================================
323
+ name: zod.z.string().min(1).max(255),
324
+ amount: zod.z.number().finite().positive(),
325
+ memo: zod.z.string().nullable().optional(),
326
+ // ========================================
327
+ // Scheduling
328
+ // ========================================
329
+ scheduled_date: zod.z.string().regex(/^\d{4}-\d{2}-\d{2}$/, {
330
+ message: "Scheduled date must be in format YYYY-MM-DD"
331
+ }),
332
+ // ========================================
333
+ // Type and Status
334
+ // ========================================
335
+ event_type: CashflowEventTypeSchema,
336
+ is_paid: zod.z.boolean().default(false),
337
+ is_recurring: zod.z.boolean().default(false),
338
+ recurrence_frequency: RecurrenceFrequencySchema.optional(),
339
+ // ========================================
340
+ // Metadata
341
+ // ========================================
342
+ created_at: zod.z.string(),
343
+ updated_at: zod.z.string(),
344
+ // ========================================
345
+ // Links
346
+ // ========================================
347
+ account_id: zod.z.number().int().nullable().optional(),
348
+ transaction_id: zod.z.string().nullable().optional()
349
+ // Links to actual transaction when paid
350
+ });
351
+ var CashflowEventCreateSchema = CashflowEventSchema.omit({
352
+ id: true,
353
+ created_at: true,
354
+ updated_at: true,
355
+ transaction_id: true
356
+ // Cannot link to transaction at creation
357
+ }).strict();
358
+ var CashflowEventUpdateSchema = CashflowEventSchema.pick({
359
+ id: true,
360
+ name: true,
361
+ amount: true,
362
+ memo: true,
363
+ scheduled_date: true,
364
+ is_paid: true
365
+ }).strict();
366
+ var CashflowEventFilterSchema = zod.z.object({
367
+ start_date: zod.z.string().regex(/^\d{4}-\d{2}-\d{2}$/),
368
+ end_date: zod.z.string().regex(/^\d{4}-\d{2}-\d{2}$/),
369
+ event_type: zod.z.enum(["all", "bill", "income"]).default("all"),
370
+ include_paid: zod.z.boolean().default(false)
371
+ });
372
+ var CashflowEventsResponseSchema = zod.z.object({
373
+ events: zod.z.array(CashflowEventSchema)
374
+ });
375
+ var BudgetStateSchema = zod.z.enum(["under", "risk", "over"]);
376
+ var BudgetLinksSchema = zod.z.object({
377
+ accounts: zod.z.array(zod.z.number().int()),
378
+ budget_histories: zod.z.array(zod.z.number().int())
379
+ });
380
+ var BudgetSchema = zod.z.object({
381
+ // ========================================
382
+ // Core Identifiers
383
+ // ========================================
384
+ id: zod.z.number().int().positive(),
385
+ // ========================================
386
+ // Time Period
387
+ // ========================================
388
+ month: zod.z.number().int().min(1).max(12),
389
+ year: zod.z.number().int(),
390
+ // ========================================
391
+ // Budget Details
392
+ // ========================================
393
+ name: zod.z.string().max(255),
394
+ state: BudgetStateSchema,
395
+ spent: zod.z.number().finite(),
396
+ // NUMBER in legacy data, not string
397
+ budget_amount: zod.z.number().finite().positive(),
398
+ // NUMBER in legacy data, not string
399
+ // ========================================
400
+ // Category Association
401
+ // ========================================
402
+ tag_names: zod.z.array(zod.z.string()),
403
+ // ========================================
404
+ // Related Resources
405
+ // ========================================
406
+ links: BudgetLinksSchema
407
+ });
408
+ var BudgetsResponseSchema = zod.z.object({
409
+ budgets: zod.z.array(BudgetSchema)
410
+ });
411
+ var BudgetCreateSchema = zod.z.object({
412
+ name: zod.z.string().max(255),
413
+ budget_amount: zod.z.number().finite().positive(),
414
+ tag_names: zod.z.array(zod.z.string()),
415
+ account_list: zod.z.array(zod.z.number().int()).optional(),
416
+ // Becomes links.accounts in response
417
+ show_on_dashboard: zod.z.boolean().optional(),
418
+ other: zod.z.boolean().optional()
419
+ }).strict();
420
+ var BudgetUpdateSchema = zod.z.object({
421
+ id: zod.z.number().int().positive(),
422
+ name: zod.z.string().max(255),
423
+ budget_amount: zod.z.number().finite().positive(),
424
+ tag_names: zod.z.array(zod.z.string()),
425
+ account_list: zod.z.array(zod.z.number().int()).optional(),
426
+ show_on_dashboard: zod.z.boolean().optional(),
427
+ other: zod.z.boolean().optional()
428
+ }).strict();
429
+ var GoalStateSchema = zod.z.enum(["active", "completed", "archived"]);
430
+ var GoalStatusSchema = zod.z.enum(["complete", "over", "risk", "under"]);
431
+ var GoalLinksSchema = zod.z.object({
432
+ accounts: zod.z.array(zod.z.number().int())
433
+ });
434
+ var BaseGoalSchema = zod.z.object({
435
+ // ========================================
436
+ // Core Identifiers
437
+ // ========================================
438
+ id: zod.z.number().int().positive(),
439
+ // ========================================
440
+ // Goal Details
441
+ // ========================================
442
+ name: zod.z.string().max(255),
443
+ state: GoalStateSchema,
444
+ status: GoalStatusSchema,
445
+ // ========================================
446
+ // Visual Elements
447
+ // ========================================
448
+ image_name: zod.z.string(),
449
+ image_url: zod.z.string(),
450
+ // ========================================
451
+ // Progress Tracking
452
+ // ========================================
453
+ percent_complete: zod.z.number().int().min(0).max(100),
454
+ complete: zod.z.boolean(),
455
+ // ========================================
456
+ // Monetary Values (STRINGS with decimal pattern)
457
+ // ========================================
458
+ initial_value: zod.z.string().regex(/^\d+\.\d{2}$/),
459
+ current_value: zod.z.string().regex(/^\d+\.\d{2}$/),
460
+ target_value: zod.z.string().regex(/^\d+\.\d{2}$/),
461
+ monthly_contribution: zod.z.string().regex(/^\d+\.\d{2}$/),
462
+ remaining_monthly_contribution: zod.z.string().regex(/^\d+\.\d{2}$/),
463
+ // ========================================
464
+ // Optional Fields
465
+ // ========================================
466
+ current_progress: zod.z.string().regex(/^\d+\.\d{2}$/).optional(),
467
+ target_contribution: zod.z.string().regex(/^\d+\.\d{2}$/).optional(),
468
+ target_completion_on: zod.z.string(),
469
+ // Date string YYYY-MM-DD
470
+ // ========================================
471
+ // Timestamps
472
+ // ========================================
473
+ // Note: Using string validation (not .datetime()) for legacy RFC 3339 format
474
+ created_at: zod.z.string(),
475
+ updated_at: zod.z.string(),
476
+ // ========================================
477
+ // Related Resources
478
+ // ========================================
479
+ links: GoalLinksSchema
480
+ });
481
+ var SavingsGoalSchema = BaseGoalSchema.extend({
482
+ // Savings goals may have weight for distributing account balance
483
+ weight: zod.z.number().int().min(1).max(99).optional()
484
+ });
485
+ var PayoffGoalSchema = BaseGoalSchema;
486
+ var GoalCreateSchema = zod.z.object({
487
+ name: zod.z.string().max(255),
488
+ state: GoalStateSchema.optional(),
489
+ image_name: zod.z.string(),
490
+ target_value: zod.z.string().regex(/^\d+\.\d{2}$/),
491
+ target_completion_on: zod.z.string().optional(),
492
+ target_contribution: zod.z.string().regex(/^\d+\.\d{2}$/).optional(),
493
+ account_ids: zod.z.array(zod.z.number().int()).optional()
494
+ // Becomes links.accounts in response
495
+ }).strict();
496
+ var GoalUpdateSchema = zod.z.object({
497
+ id: zod.z.number().int().positive(),
498
+ name: zod.z.string().max(255),
499
+ state: GoalStateSchema.optional(),
500
+ image_name: zod.z.string(),
501
+ target_value: zod.z.string().regex(/^\d+\.\d{2}$/),
502
+ target_completion_on: zod.z.string().optional(),
503
+ target_contribution: zod.z.string().regex(/^\d+\.\d{2}$/).optional(),
504
+ account_ids: zod.z.array(zod.z.number().int()).optional()
505
+ }).strict();
506
+ var SavingsGoalsResponseSchema = zod.z.object({
507
+ savings_goals: zod.z.array(SavingsGoalSchema)
508
+ });
509
+ var PayoffGoalsResponseSchema = zod.z.object({
510
+ payoff_goals: zod.z.array(PayoffGoalSchema)
511
+ });
512
+ var GoalImagesResponseSchema = zod.z.object({
513
+ images: zod.z.array(
514
+ zod.z.object({
515
+ id: zod.z.number().int().positive(),
516
+ name: zod.z.string(),
517
+ url: zod.z.string()
518
+ })
519
+ )
520
+ });
521
+ var UserSexSchema = zod.z.enum(["Male", "Female"]);
522
+ var UserSchema = zod.z.object({
523
+ // ========================================
524
+ // Core Identifiers
525
+ // ========================================
526
+ id: zod.z.string(),
527
+ // Partner customer ID (STRING, not integer)
528
+ login: zod.z.string(),
529
+ email: zod.z.string().email(),
530
+ // ========================================
531
+ // Login Tracking
532
+ // ========================================
533
+ login_count: zod.z.number().int().nonnegative(),
534
+ last_login_at: zod.z.string(),
535
+ // RFC 3339 datetime format
536
+ // ========================================
537
+ // Customization
538
+ // ========================================
539
+ custom_tags: zod.z.array(zod.z.string()),
540
+ custom_settings: zod.z.object({}).passthrough(),
541
+ // Arbitrary key-value pairs
542
+ // ========================================
543
+ // Profile Information
544
+ // ========================================
545
+ first_name: zod.z.string(),
546
+ last_name: zod.z.string(),
547
+ postal_code: zod.z.string(),
548
+ birth_year: zod.z.number().int().min(1901),
549
+ sex: UserSexSchema,
550
+ // ========================================
551
+ // Optional Location Fields
552
+ // ========================================
553
+ // Note: city and state appear in OpenAPI but not in legacy mock data
554
+ city: zod.z.string().optional(),
555
+ state: zod.z.string().optional()
556
+ });
557
+ var UserCreateSchemaAdmin = zod.z.object({
558
+ login: zod.z.string(),
559
+ email: zod.z.string(),
560
+ // Simple validation for test data
561
+ first_name: zod.z.string().optional().default("Test"),
562
+ last_name: zod.z.string().optional().default("User"),
563
+ postal_code: zod.z.string().optional().default("00000"),
564
+ birth_year: zod.z.number().int().min(1901).optional().default(1990),
565
+ sex: UserSexSchema.optional().default("Male"),
566
+ custom_tags: zod.z.array(zod.z.string()).optional().default([]),
567
+ custom_settings: zod.z.object({}).passthrough().optional().default({}),
568
+ city: zod.z.string().optional(),
569
+ state: zod.z.string().optional()
570
+ }).strict();
571
+ var UserCreateSchemaUser = zod.z.object({
572
+ login: zod.z.string().min(3, "Login must be at least 3 characters"),
573
+ email: zod.z.string().email("Valid email address required"),
574
+ first_name: zod.z.string().min(1, "First name is required"),
575
+ last_name: zod.z.string().min(1, "Last name is required"),
576
+ postal_code: zod.z.string().min(5, "Valid postal code required"),
577
+ birth_year: zod.z.number().int().min(1901).max((/* @__PURE__ */ new Date()).getFullYear() - 13, "Must be at least 13 years old"),
578
+ sex: UserSexSchema,
579
+ custom_tags: zod.z.array(zod.z.string()).optional(),
580
+ custom_settings: zod.z.object({}).passthrough().optional(),
581
+ city: zod.z.string().optional(),
582
+ state: zod.z.string().optional()
583
+ }).strict();
584
+ var UserCreateSchema = UserCreateSchemaUser;
585
+ var UserUpdateSchemaAdmin = zod.z.object({
586
+ email: zod.z.string().optional(),
587
+ first_name: zod.z.string().optional(),
588
+ last_name: zod.z.string().optional(),
589
+ postal_code: zod.z.string().optional(),
590
+ birth_year: zod.z.number().int().min(1901).optional(),
591
+ sex: UserSexSchema.optional(),
592
+ custom_tags: zod.z.array(zod.z.string()).optional(),
593
+ custom_settings: zod.z.object({}).passthrough().optional(),
594
+ city: zod.z.string().optional(),
595
+ state: zod.z.string().optional()
596
+ }).strict();
597
+ var UserUpdateSchemaUser = zod.z.object({
598
+ email: zod.z.string().email("Valid email address required"),
599
+ first_name: zod.z.string().min(1, "First name is required"),
600
+ last_name: zod.z.string().min(1, "Last name is required"),
601
+ postal_code: zod.z.string().min(5, "Valid postal code required"),
602
+ birth_year: zod.z.number().int().min(1901).max((/* @__PURE__ */ new Date()).getFullYear() - 13, "Must be at least 13 years old"),
603
+ sex: UserSexSchema,
604
+ custom_tags: zod.z.array(zod.z.string()).optional(),
605
+ custom_settings: zod.z.object({}).passthrough().optional(),
606
+ city: zod.z.string().optional(),
607
+ state: zod.z.string().optional()
608
+ }).strict();
609
+ var UserUpdateSchema = UserUpdateSchemaUser;
610
+ var UserTagsSchema = zod.z.object({
611
+ userTags: zod.z.array(zod.z.string())
612
+ });
613
+ var DefaultTagsSchema = zod.z.object({
614
+ defaultTags: zod.z.array(zod.z.string())
615
+ });
616
+ var TagsResponseSchema = zod.z.object({
617
+ userTags: zod.z.array(zod.z.string()),
618
+ defaultTags: zod.z.array(zod.z.string())
619
+ });
620
+ var TagsUpdateSchema = zod.z.array(zod.z.string()).min(0);
621
+ var TagCreateSchemaAdmin = zod.z.object({
622
+ name: zod.z.string()
623
+ });
624
+ var TagCreateSchemaUser = zod.z.object({
625
+ name: zod.z.string().min(1, "Tag name is required").max(50, "Tag name must be 50 characters or less").regex(/^[a-zA-Z0-9\s\-_]+$/, "Tag name can only contain letters, numbers, spaces, hyphens, and underscores")
626
+ });
627
+ var TagDeleteSchema = zod.z.object({
628
+ name: zod.z.string().min(1)
629
+ });
630
+ var TagUsageStatSchema = zod.z.object({
631
+ tag: zod.z.string(),
632
+ count: zod.z.number().int().nonnegative()
633
+ });
634
+ var TagUsageStatsSchema = zod.z.object({
635
+ stats: zod.z.array(TagUsageStatSchema)
636
+ });
637
+ var TagColorSchema = zod.z.object({
638
+ color: zod.z.string().regex(/^#[0-9A-Fa-f]{6}$/, "Color must be a valid hex code")
639
+ });
640
+ var TagUsageDataPointSchema = zod.z.object({
641
+ date: zod.z.string(),
642
+ // ISO date string
643
+ count: zod.z.number().int().nonnegative()
644
+ });
645
+ var TagReportItemSchema = zod.z.object({
646
+ tag: zod.z.string(),
647
+ totalCount: zod.z.number().int().nonnegative(),
648
+ dataPoints: zod.z.array(TagUsageDataPointSchema)
649
+ });
650
+ var TagUsageReportSchema = zod.z.object({
651
+ report: zod.z.array(TagReportItemSchema),
652
+ startDate: zod.z.string().optional(),
653
+ endDate: zod.z.string().optional()
654
+ });
655
+ var AlertTypeSchema = zod.z.enum([
656
+ "AccountThresholdAlert",
657
+ "GoalAlert",
658
+ "MerchantNameAlert",
659
+ "SpendingTargetAlert",
660
+ "TransactionLimitAlert",
661
+ "UpcomingBillAlert"
662
+ ]);
663
+ var AlertSourceTypeSchema = zod.z.enum([
664
+ "Account",
665
+ "Budget",
666
+ "CashflowTransaction",
667
+ "PayoffGoal",
668
+ "SavingsGoal"
669
+ ]).nullable();
670
+ var AlertDestinationsSchema = zod.z.object({
671
+ email_address: zod.z.string().email().nullable(),
672
+ sms_number: zod.z.string().regex(/^\d{10}$/).nullable(),
673
+ partner_sms_enabled: zod.z.boolean()
674
+ });
675
+ var AlertSchema = zod.z.object({
676
+ // ========================================
677
+ // Core Identifiers
678
+ // ========================================
679
+ id: zod.z.number().int().positive(),
680
+ type: AlertTypeSchema,
681
+ // ========================================
682
+ // Alert Configuration
683
+ // ========================================
684
+ options: zod.z.object({}).passthrough(),
685
+ // Dynamic options per alert type
686
+ // ========================================
687
+ // Delivery Settings
688
+ // ========================================
689
+ email_delivery: zod.z.boolean(),
690
+ sms_delivery: zod.z.boolean(),
691
+ // ========================================
692
+ // Source Object Reference
693
+ // ========================================
694
+ source_type: AlertSourceTypeSchema,
695
+ source_id: zod.z.union([zod.z.string(), zod.z.number().int()]).optional(),
696
+ // STRING in legacy ("41"), but can be int
697
+ // ========================================
698
+ // Full Source Object (Nested)
699
+ // ========================================
700
+ // Note: Source is fully nested Account, Goal, Budget, etc. object
701
+ // Using unknown for flexibility since it's a oneOf in OpenAPI
702
+ source: zod.z.unknown().optional()
703
+ });
704
+ var AlertCreateSchema = zod.z.object({
705
+ options: zod.z.object({}).passthrough(),
706
+ email_delivery: zod.z.boolean(),
707
+ sms_delivery: zod.z.boolean(),
708
+ source_type: AlertSourceTypeSchema.optional(),
709
+ source_id: zod.z.union([zod.z.string(), zod.z.number().int()]).optional()
710
+ }).strict();
711
+ var AlertUpdateSchema = zod.z.object({
712
+ options: zod.z.object({}).passthrough(),
713
+ email_delivery: zod.z.boolean(),
714
+ sms_delivery: zod.z.boolean(),
715
+ source_type: AlertSourceTypeSchema.optional(),
716
+ source_id: zod.z.union([zod.z.string(), zod.z.number().int()]).optional()
717
+ }).strict();
718
+ var AlertDestinationsUpdateSchema = AlertDestinationsSchema;
719
+ var AlertsResponseSchema = zod.z.object({
720
+ alerts: zod.z.array(AlertSchema)
721
+ });
722
+ var NotificationSchema = zod.z.object({
723
+ // ========================================
724
+ // Core Identifiers
725
+ // ========================================
726
+ id: zod.z.number().int().positive(),
727
+ // User ID - links notification to specific user
728
+ user_id: zod.z.string(),
729
+ // Alert ID - references the source alert that triggered this notification
730
+ alert_id: zod.z.number().int().positive(),
731
+ // ========================================
732
+ // Notification Content
733
+ // ========================================
734
+ message: zod.z.string(),
735
+ // ========================================
736
+ // Alert Reference
737
+ // ========================================
738
+ // Links to Alert domain - uses same AlertType enum
739
+ alert_type: AlertTypeSchema,
740
+ // ========================================
741
+ // Read Status
742
+ // ========================================
743
+ // Tracks whether user has read this notification
744
+ is_read: zod.z.boolean().default(false),
745
+ // ========================================
746
+ // Timestamps
747
+ // ========================================
748
+ // RFC 3339 datetime string (e.g., "2018-01-01T16:54:15Z")
749
+ created_at: zod.z.string()
750
+ });
751
+ var NotificationsResponseSchema = zod.z.object({
752
+ notifications: zod.z.array(NotificationSchema)
753
+ });
754
+ var NotificationCreateSchemaAdmin = zod.z.object({
755
+ message: zod.z.string(),
756
+ alert_type: AlertTypeSchema,
757
+ created_at: zod.z.string().optional()
758
+ // Optional, defaults to now
759
+ });
760
+ var NotificationCreateSchemaUser = zod.z.never();
761
+ var NotificationUpdateSchemaAdmin = zod.z.object({
762
+ message: zod.z.string().optional(),
763
+ alert_type: AlertTypeSchema.optional()
764
+ });
765
+ var NotificationUpdateSchemaUser = zod.z.object({
766
+ is_read: zod.z.boolean().optional()
767
+ });
768
+ var NotificationFrequencySchema = zod.z.enum(["realtime", "daily", "weekly"]);
769
+ var NotificationPreferencesSchema = zod.z.object({
770
+ emailNotifications: zod.z.boolean(),
771
+ pushNotifications: zod.z.boolean(),
772
+ frequency: NotificationFrequencySchema
773
+ });
774
+ var NotificationPreferencesUpdateSchema = zod.z.object({
775
+ emailNotifications: zod.z.boolean().optional(),
776
+ pushNotifications: zod.z.boolean().optional(),
777
+ frequency: NotificationFrequencySchema.optional()
778
+ });
779
+ var PartnerSchema = zod.z.object({
780
+ // ========================================
781
+ // Core Identifiers
782
+ // ========================================
783
+ id: zod.z.number().int().positive(),
784
+ // ========================================
785
+ // Partner Configuration
786
+ // ========================================
787
+ domain: zod.z.string(),
788
+ product_name: zod.z.string(),
789
+ browser_title: zod.z.string(),
790
+ // ========================================
791
+ // Feature Flags
792
+ // ========================================
793
+ partner_alerts_enabled: zod.z.boolean(),
794
+ demo: zod.z.boolean(),
795
+ // ========================================
796
+ // Dynamic Configuration Objects
797
+ // ========================================
798
+ // Modules contains partner-specific feature configuration
799
+ // Structure varies by partner (aggregation, mobile, etc.)
800
+ modules: zod.z.object({}).passthrough(),
801
+ // Featured searches configuration array
802
+ featured_searches: zod.z.array(zod.z.unknown())
803
+ });
804
+ var PartnersResponseSchema = zod.z.object({
805
+ partners: zod.z.array(PartnerSchema)
806
+ });
807
+ var PartnerCreateSchemaAdmin = zod.z.object({
808
+ domain: zod.z.string(),
809
+ product_name: zod.z.string(),
810
+ browser_title: zod.z.string(),
811
+ partner_alerts_enabled: zod.z.boolean().optional().default(false),
812
+ demo: zod.z.boolean().optional().default(false),
813
+ modules: zod.z.object({}).passthrough().optional().default({}),
814
+ featured_searches: zod.z.array(zod.z.unknown()).optional().default([])
815
+ });
816
+ var PartnerCreateSchemaUser = zod.z.never();
817
+ var PartnerUpdateSchemaAdmin = zod.z.object({
818
+ domain: zod.z.string().optional(),
819
+ product_name: zod.z.string().optional(),
820
+ browser_title: zod.z.string().optional(),
821
+ partner_alerts_enabled: zod.z.boolean().optional(),
822
+ demo: zod.z.boolean().optional(),
823
+ modules: zod.z.object({}).passthrough().optional(),
824
+ featured_searches: zod.z.array(zod.z.unknown()).optional()
825
+ });
826
+ var PartnerUpdateSchemaUser = zod.z.never();
827
+ var PartnerDeleteSchema = zod.z.object({
828
+ id: zod.z.number().int().positive()
829
+ });
830
+ var ExpenseSchema = zod.z.object({
831
+ // ========================================
832
+ // Tag Reference
833
+ // ========================================
834
+ // Transaction tag/category name
835
+ // Uses lowercase tag names (health, diningout, insurance, etc.)
836
+ tag: zod.z.string(),
837
+ // ========================================
838
+ // Aggregated Amount
839
+ // ========================================
840
+ // Total expense amount for this tag in the period
841
+ // STRING with decimal format: "1.74", "102.19", "1219.83"
842
+ amount: zod.z.string().regex(/^\d+\.\d{2}$/)
843
+ });
844
+ var ExpensesResponseSchema = zod.z.object({
845
+ expenses: zod.z.array(ExpenseSchema)
846
+ });
847
+ var ExpenseCreateSchemaAdmin = zod.z.object({
848
+ tag: zod.z.string(),
849
+ amount: zod.z.string()
850
+ // Will be formatted to 2 decimal places
851
+ });
852
+ var ExpenseCreateSchemaUser = zod.z.never();
853
+ var ExpenseUpdateSchemaAdmin = zod.z.object({
854
+ amount: zod.z.string().optional()
855
+ });
856
+ var ExpenseUpdateSchemaUser = zod.z.never();
857
+ var ExpenseDeleteSchema = zod.z.object({
858
+ tag: zod.z.string()
859
+ });
860
+ var ExpenseSearchParamsSchema = zod.z.object({
861
+ begin_on: zod.z.string().regex(/^\d{4}-\d{2}-\d{2}$/).optional(),
862
+ // RFC 3339 date "2020-01-01"
863
+ end_on: zod.z.string().regex(/^\d{4}-\d{2}-\d{2}$/).optional(),
864
+ // RFC 3339 date "2020-12-31"
865
+ threshold: zod.z.number().int().positive().optional()
866
+ // Minimum amount filter
867
+ }).refine(
868
+ (data) => {
869
+ const hasBeginOn = data.begin_on !== void 0;
870
+ const hasEndOn = data.end_on !== void 0;
871
+ return hasBeginOn === hasEndOn;
872
+ },
873
+ {
874
+ message: "Both begin_on and end_on must be provided together"
875
+ }
876
+ );
877
+ var NetWorthMetaSchema = zod.z.object({
878
+ net_worth: zod.z.string().regex(/^-?\d+\.\d{2}$/),
879
+ net_worth_change: zod.z.string().regex(/^-?\d+\.\d{2}$/),
880
+ total_assets: zod.z.string().regex(/^-?\d+\.\d{2}$/),
881
+ total_debts: zod.z.string().regex(/^-?\d+\.\d{2}$/)
882
+ });
883
+ var NetWorthAssetSchema = zod.z.object({
884
+ id: zod.z.number().int(),
885
+ name: zod.z.string(),
886
+ balance: zod.z.string().regex(/^\d+\.\d{2}$/),
887
+ additional_networth_account: zod.z.boolean()
888
+ // true = manual account, false = aggregated
889
+ });
890
+ var NetWorthDebtSchema = zod.z.object({
891
+ id: zod.z.number().int(),
892
+ name: zod.z.string(),
893
+ balance: zod.z.string().regex(/^\d+\.\d{2}$/),
894
+ additional_networth_account: zod.z.boolean()
895
+ // true = manual account, false = aggregated
896
+ });
897
+ var NetWorthHistorySchema = zod.z.object({
898
+ total: zod.z.string().regex(/^-?\d+\.\d{2}$/),
899
+ // Net worth for month
900
+ total_asset: zod.z.string().regex(/^\d+\.\d{2}$/),
901
+ total_debt: zod.z.string().regex(/^\d+\.\d{2}$/),
902
+ month: zod.z.string().regex(/^\d{2}$/),
903
+ // "04"
904
+ year: zod.z.string().regex(/^\d{4}$/),
905
+ // "2019"
906
+ since_last_month: zod.z.string().regex(/^-?\d+\.\d{2}$/)
907
+ // Change from previous month
908
+ });
909
+ var NetWorthSchema = zod.z.object({
910
+ meta: NetWorthMetaSchema,
911
+ assets: zod.z.array(NetWorthAssetSchema),
912
+ debts: zod.z.array(NetWorthDebtSchema),
913
+ networth_histories: zod.z.array(NetWorthHistorySchema)
914
+ });
915
+ var NetWorthResponseSchema = NetWorthSchema;
916
+ var NetWorthAccountTypeSchema = zod.z.enum(["asset", "debt"]);
917
+ var NetWorthAccountCreateSchema = zod.z.object({
918
+ networth_account: zod.z.object({
919
+ account_type: NetWorthAccountTypeSchema,
920
+ balance: zod.z.string(),
921
+ // Will be validated as decimal
922
+ name: zod.z.string().min(1).max(255)
923
+ })
924
+ });
925
+ var NetWorthAccountUpdateSchema = zod.z.object({
926
+ networth_account: zod.z.object({
927
+ account_type: NetWorthAccountTypeSchema.optional(),
928
+ balance: zod.z.string().optional(),
929
+ // Will be validated as decimal
930
+ name: zod.z.string().min(1).max(255).optional()
931
+ })
932
+ });
933
+ var NetWorthAccountDeleteSchema = zod.z.object({
934
+ id: zod.z.number().int().positive()
935
+ });
936
+ var InstitutionLoginParameterSchema = zod.z.object({
937
+ parameter_id: zod.z.string(),
938
+ // e.g., "username", "password", "security_question"
939
+ label: zod.z.string(),
940
+ // Display label: "User ID", "Password"
941
+ type: zod.z.string()
942
+ // Input type: "text", "password", "select"
943
+ });
944
+ var InstitutionSearchMetaSchema = zod.z.object({
945
+ page: zod.z.number().int().positive(),
946
+ total_pages: zod.z.number().int().nonnegative(),
947
+ total_results: zod.z.number().int().nonnegative()
948
+ });
949
+ var InstitutionSchema = zod.z.object({
950
+ id: zod.z.number().int(),
951
+ name: zod.z.string(),
952
+ home_url: zod.z.string().url(),
953
+ ce_login_parameters: zod.z.array(InstitutionLoginParameterSchema)
954
+ });
955
+ var InstitutionsResponseSchema = zod.z.object({
956
+ ce_fis: zod.z.array(InstitutionSchema),
957
+ meta: InstitutionSearchMetaSchema
958
+ });
959
+ var AuthenticateRequestSchema = zod.z.object({
960
+ id: zod.z.number().int(),
961
+ // Institution ID
962
+ credentials: zod.z.object({
963
+ login_params: zod.z.record(zod.z.string(), zod.z.string())
964
+ // Dynamic key-value pairs
965
+ })
966
+ });
967
+ var AuthenticateResponseSchema = zod.z.object({
968
+ harvest_id: zod.z.string(),
969
+ login_id: zod.z.string(),
970
+ status: zod.z.string()
971
+ // "pending", "success", "mfa_required", "error"
972
+ });
973
+ var MFARequestSchema = zod.z.object({
974
+ harvest_id: zod.z.string(),
975
+ login_id: zod.z.string(),
976
+ session_key: zod.z.string(),
977
+ mfa_responses: zod.z.record(zod.z.string(), zod.z.string())
978
+ // Dynamic MFA responses
979
+ });
980
+ var MFAResponseSchema = zod.z.object({
981
+ status: zod.z.string(),
982
+ // "success", "error", "pending"
983
+ message: zod.z.string().optional()
984
+ });
985
+ var UpdateCredentialsRequestSchema = zod.z.object({
986
+ id: zod.z.number().int(),
987
+ // Institution ID
988
+ credentials: zod.z.object({
989
+ login_params: zod.z.record(zod.z.string(), zod.z.string())
990
+ // Dynamic key-value pairs
991
+ })
992
+ });
993
+ var UpdateCredentialsResponseSchema = zod.z.object({
994
+ status: zod.z.string(),
995
+ // "success", "error"
996
+ message: zod.z.string().optional()
997
+ });
998
+ var ClassifyAccountsRequestSchema = zod.z.object({
999
+ accounts: zod.z.record(
1000
+ zod.z.string(),
1001
+ // Account ID as string key
1002
+ zod.z.object({
1003
+ type_code: zod.z.string()
1004
+ // "DDA,DDA" or "SAV,SAV" or "ignore"
1005
+ })
1006
+ )
1007
+ });
1008
+ var CashEdgeLoginRequestSchema = zod.z.object({
1009
+ session_token: zod.z.string().optional(),
1010
+ context: zod.z.record(zod.z.string(), zod.z.unknown()).optional()
1011
+ });
1012
+ var CashEdgeLoginResponseSchema = zod.z.object({
1013
+ session_id: zod.z.string(),
1014
+ session_token: zod.z.string().optional(),
1015
+ expires_at: zod.z.string().optional(),
1016
+ status: zod.z.string().optional()
1017
+ });
1018
+
1019
+ // src/utils/chartUtils.ts
1020
+ function formatCurrency(value) {
1021
+ return new Intl.NumberFormat("en-US", {
1022
+ style: "currency",
1023
+ currency: "USD",
1024
+ minimumFractionDigits: 0,
1025
+ maximumFractionDigits: 0
1026
+ }).format(value);
1027
+ }
1028
+ function formatCurrencyAbbreviated(value) {
1029
+ const absValue = Math.abs(value);
1030
+ const sign = value < 0 ? "-" : "";
1031
+ if (absValue >= 1e6) {
1032
+ return `${sign}$${(absValue / 1e6).toFixed(1)}M`;
1033
+ }
1034
+ if (absValue >= 1e3) {
1035
+ return `${sign}$${(absValue / 1e3).toFixed(1)}K`;
1036
+ }
1037
+ return formatCurrency(value);
1038
+ }
1039
+ function formatPercentage(value) {
1040
+ return `${value.toFixed(1)}%`;
1041
+ }
1042
+ function getChartColors(theme) {
1043
+ return [
1044
+ theme.palette.primary.main,
1045
+ theme.palette.secondary.main,
1046
+ theme.palette.success.main,
1047
+ theme.palette.warning.main,
1048
+ theme.palette.error.main,
1049
+ theme.palette.info.main,
1050
+ theme.palette.primary.light,
1051
+ theme.palette.secondary.light,
1052
+ theme.palette.success.light,
1053
+ theme.palette.warning.light
1054
+ ];
1055
+ }
1056
+ function getColorByIndex(colors, index) {
1057
+ if (colors.length === 0) {
1058
+ return "#000000";
1059
+ }
1060
+ return colors[index % colors.length];
1061
+ }
1062
+ var CHART_DIMENSIONS = {
1063
+ donut: {
1064
+ width: 200,
1065
+ height: 200,
1066
+ innerRadius: 60,
1067
+ outerRadius: 95
1068
+ },
1069
+ lineChart: {
1070
+ width: 300,
1071
+ height: 150,
1072
+ margin: { top: 10, right: 20, bottom: 20, left: 50 }
1073
+ },
1074
+ barChart: {
1075
+ width: 300,
1076
+ height: 160,
1077
+ margin: { top: 20, left: 50, bottom: 40, right: 20 }
1078
+ }
1079
+ };
1080
+ function getChartThemeConfig(theme) {
1081
+ return {
1082
+ backgroundColor: theme.palette.background.paper,
1083
+ textColor: theme.palette.text.primary,
1084
+ gridColor: theme.palette.divider,
1085
+ tooltipBackgroundColor: theme.palette.background.paper,
1086
+ tooltipBorderColor: theme.palette.divider
1087
+ };
1088
+ }
1089
+
1090
+ // src/utils/animations.ts
1091
+ var ANIMATION_DURATIONS = {
1092
+ /** Arc/pie slice transitions (D3: 1000ms) */
1093
+ arc: 1e3,
1094
+ /** Text transitions (D3: 200ms) */
1095
+ text: 200,
1096
+ /** Meter/progress bar (D3: 600ms) */
1097
+ meter: 600,
1098
+ /** Settings panel slide */
1099
+ panel: 300,
1100
+ /** Tooltip/hover states */
1101
+ hover: 150
1102
+ };
1103
+ var ANIMATION_EASING = {
1104
+ /** D3 easeInOut equivalent */
1105
+ default: [0.4, 0, 0.2, 1],
1106
+ /** D3 easeOut equivalent */
1107
+ easeOut: [0, 0, 0.2, 1],
1108
+ /** D3 easeIn equivalent */
1109
+ easeIn: [0.4, 0, 1, 1],
1110
+ /** D3 easeLinear equivalent */
1111
+ linear: [0, 0, 1, 1]
1112
+ };
1113
+ var arcVariants = {
1114
+ initial: {
1115
+ opacity: 0,
1116
+ scale: 0.8
1117
+ },
1118
+ enter: {
1119
+ opacity: 1,
1120
+ scale: 1,
1121
+ transition: {
1122
+ duration: ANIMATION_DURATIONS.arc / 1e3,
1123
+ ease: ANIMATION_EASING.default
1124
+ }
1125
+ },
1126
+ exit: {
1127
+ opacity: 0,
1128
+ scale: 0.8,
1129
+ transition: {
1130
+ duration: ANIMATION_DURATIONS.arc / 1e3,
1131
+ ease: ANIMATION_EASING.default
1132
+ }
1133
+ },
1134
+ hover: {
1135
+ scale: 1.05,
1136
+ transition: {
1137
+ duration: ANIMATION_DURATIONS.hover / 1e3,
1138
+ ease: ANIMATION_EASING.easeOut
1139
+ }
1140
+ },
1141
+ selected: {
1142
+ scale: 1.1,
1143
+ transition: {
1144
+ duration: ANIMATION_DURATIONS.hover / 1e3,
1145
+ ease: ANIMATION_EASING.easeOut
1146
+ }
1147
+ }
1148
+ };
1149
+ var textVariants = {
1150
+ initial: {
1151
+ opacity: 0,
1152
+ y: -10
1153
+ },
1154
+ enter: {
1155
+ opacity: 1,
1156
+ y: 0,
1157
+ transition: {
1158
+ duration: ANIMATION_DURATIONS.text / 1e3,
1159
+ ease: ANIMATION_EASING.default
1160
+ }
1161
+ },
1162
+ exit: {
1163
+ opacity: 0,
1164
+ y: 10,
1165
+ transition: {
1166
+ duration: ANIMATION_DURATIONS.text / 1e3,
1167
+ ease: ANIMATION_EASING.default
1168
+ }
1169
+ },
1170
+ selected: {
1171
+ y: 5,
1172
+ transition: {
1173
+ duration: ANIMATION_DURATIONS.text / 1e3,
1174
+ ease: ANIMATION_EASING.default
1175
+ }
1176
+ },
1177
+ deselected: {
1178
+ y: -4,
1179
+ transition: {
1180
+ duration: ANIMATION_DURATIONS.text / 1e3,
1181
+ ease: ANIMATION_EASING.default
1182
+ }
1183
+ }
1184
+ };
1185
+ var panelVariants = {
1186
+ initial: {
1187
+ opacity: 0,
1188
+ x: 20
1189
+ },
1190
+ enter: {
1191
+ opacity: 1,
1192
+ x: 0,
1193
+ transition: {
1194
+ duration: ANIMATION_DURATIONS.panel / 1e3,
1195
+ ease: ANIMATION_EASING.easeOut
1196
+ }
1197
+ },
1198
+ exit: {
1199
+ opacity: 0,
1200
+ x: 20,
1201
+ transition: {
1202
+ duration: ANIMATION_DURATIONS.panel / 1e3,
1203
+ ease: ANIMATION_EASING.easeIn
1204
+ }
1205
+ }
1206
+ };
1207
+ var fadeVariants = {
1208
+ initial: {
1209
+ opacity: 0
1210
+ },
1211
+ enter: {
1212
+ opacity: 1,
1213
+ transition: {
1214
+ duration: ANIMATION_DURATIONS.text / 1e3,
1215
+ ease: ANIMATION_EASING.default
1216
+ }
1217
+ },
1218
+ exit: {
1219
+ opacity: 0,
1220
+ transition: {
1221
+ duration: ANIMATION_DURATIONS.text / 1e3,
1222
+ ease: ANIMATION_EASING.default
1223
+ }
1224
+ }
1225
+ };
1226
+ var progressVariants = {
1227
+ initial: {
1228
+ scaleX: 0,
1229
+ transformOrigin: "left"
1230
+ },
1231
+ enter: {
1232
+ scaleX: 1,
1233
+ transition: {
1234
+ duration: ANIMATION_DURATIONS.meter / 1e3,
1235
+ ease: ANIMATION_EASING.default
1236
+ }
1237
+ },
1238
+ exit: {
1239
+ scaleX: 0,
1240
+ transition: {
1241
+ duration: ANIMATION_DURATIONS.meter / 1e3,
1242
+ ease: ANIMATION_EASING.default
1243
+ }
1244
+ }
1245
+ };
1246
+ var listContainerVariants = {
1247
+ initial: {
1248
+ opacity: 0
1249
+ },
1250
+ enter: {
1251
+ opacity: 1,
1252
+ transition: {
1253
+ staggerChildren: 0.05,
1254
+ delayChildren: 0.1
1255
+ }
1256
+ },
1257
+ exit: {
1258
+ opacity: 0,
1259
+ transition: {
1260
+ staggerChildren: 0.03,
1261
+ staggerDirection: -1
1262
+ }
1263
+ }
1264
+ };
1265
+ var listItemVariants = {
1266
+ initial: {
1267
+ opacity: 0,
1268
+ y: 10
1269
+ },
1270
+ enter: {
1271
+ opacity: 1,
1272
+ y: 0,
1273
+ transition: {
1274
+ duration: ANIMATION_DURATIONS.text / 1e3,
1275
+ ease: ANIMATION_EASING.easeOut
1276
+ }
1277
+ },
1278
+ exit: {
1279
+ opacity: 0,
1280
+ y: -10,
1281
+ transition: {
1282
+ duration: ANIMATION_DURATIONS.text / 1e3,
1283
+ ease: ANIMATION_EASING.easeIn
1284
+ }
1285
+ }
1286
+ };
1287
+ function createTransition(duration, ease = ANIMATION_EASING.default) {
1288
+ return {
1289
+ duration: duration / 1e3,
1290
+ ease
1291
+ };
1292
+ }
1293
+ var SPRING_CONFIG = {
1294
+ default: {
1295
+ type: "spring",
1296
+ stiffness: 300,
1297
+ damping: 30
1298
+ },
1299
+ bouncy: {
1300
+ type: "spring",
1301
+ stiffness: 400,
1302
+ damping: 20
1303
+ },
1304
+ slow: {
1305
+ type: "spring",
1306
+ stiffness: 200,
1307
+ damping: 40
1308
+ }
1309
+ };
1310
+
1311
+ exports.ANIMATION_DURATIONS = ANIMATION_DURATIONS;
1312
+ exports.ANIMATION_EASING = ANIMATION_EASING;
1313
+ exports.AccountArchiveSchema = AccountArchiveSchema;
1314
+ exports.AccountCreateSchema = AccountCreateSchema;
1315
+ exports.AccountCreateSchemaAdmin = AccountCreateSchemaAdmin;
1316
+ exports.AccountCreateSchemaUser = AccountCreateSchemaUser;
1317
+ exports.AccountDeleteSchema = AccountDeleteSchema;
1318
+ exports.AccountErrorSchema = AccountErrorSchema;
1319
+ exports.AccountSchema = AccountSchema;
1320
+ exports.AccountStateSchema = AccountStateSchema;
1321
+ exports.AccountTypeSchema = AccountTypeSchema;
1322
+ exports.AccountUpdateSchema = AccountUpdateSchema;
1323
+ exports.AccountsResponseSchema = AccountsResponseSchema;
1324
+ exports.AggregationTypeSchema = AggregationTypeSchema;
1325
+ exports.AlertCreateSchema = AlertCreateSchema;
1326
+ exports.AlertDestinationsSchema = AlertDestinationsSchema;
1327
+ exports.AlertDestinationsUpdateSchema = AlertDestinationsUpdateSchema;
1328
+ exports.AlertSchema = AlertSchema;
1329
+ exports.AlertSourceTypeSchema = AlertSourceTypeSchema;
1330
+ exports.AlertTypeSchema = AlertTypeSchema;
1331
+ exports.AlertUpdateSchema = AlertUpdateSchema;
1332
+ exports.AlertsResponseSchema = AlertsResponseSchema;
1333
+ exports.AppModeContext = AppModeContext;
1334
+ exports.AppModeProvider = AppModeProvider;
1335
+ exports.AuthenticateRequestSchema = AuthenticateRequestSchema;
1336
+ exports.AuthenticateResponseSchema = AuthenticateResponseSchema;
1337
+ exports.BudgetCreateSchema = BudgetCreateSchema;
1338
+ exports.BudgetLinksSchema = BudgetLinksSchema;
1339
+ exports.BudgetSchema = BudgetSchema;
1340
+ exports.BudgetStateSchema = BudgetStateSchema;
1341
+ exports.BudgetUpdateSchema = BudgetUpdateSchema;
1342
+ exports.BudgetsResponseSchema = BudgetsResponseSchema;
1343
+ exports.CHART_DIMENSIONS = CHART_DIMENSIONS;
1344
+ exports.CashEdgeAccountTypeSchema = CashEdgeAccountTypeSchema;
1345
+ exports.CashEdgeLoginRequestSchema = CashEdgeLoginRequestSchema;
1346
+ exports.CashEdgeLoginResponseSchema = CashEdgeLoginResponseSchema;
1347
+ exports.CashflowEventCreateSchema = CashflowEventCreateSchema;
1348
+ exports.CashflowEventFilterSchema = CashflowEventFilterSchema;
1349
+ exports.CashflowEventSchema = CashflowEventSchema;
1350
+ exports.CashflowEventTypeSchema = CashflowEventTypeSchema;
1351
+ exports.CashflowEventUpdateSchema = CashflowEventUpdateSchema;
1352
+ exports.CashflowEventsResponseSchema = CashflowEventsResponseSchema;
1353
+ exports.ClassifyAccountsRequestSchema = ClassifyAccountsRequestSchema;
1354
+ exports.DefaultTagsSchema = DefaultTagsSchema;
1355
+ exports.ExpenseCreateSchemaAdmin = ExpenseCreateSchemaAdmin;
1356
+ exports.ExpenseCreateSchemaUser = ExpenseCreateSchemaUser;
1357
+ exports.ExpenseDeleteSchema = ExpenseDeleteSchema;
1358
+ exports.ExpenseSchema = ExpenseSchema;
1359
+ exports.ExpenseSearchParamsSchema = ExpenseSearchParamsSchema;
1360
+ exports.ExpenseUpdateSchemaAdmin = ExpenseUpdateSchemaAdmin;
1361
+ exports.ExpenseUpdateSchemaUser = ExpenseUpdateSchemaUser;
1362
+ exports.ExpensesResponseSchema = ExpensesResponseSchema;
1363
+ exports.FinancialInstitutionSchema = FinancialInstitutionSchema;
1364
+ exports.GoalCreateSchema = GoalCreateSchema;
1365
+ exports.GoalImagesResponseSchema = GoalImagesResponseSchema;
1366
+ exports.GoalLinksSchema = GoalLinksSchema;
1367
+ exports.GoalStateSchema = GoalStateSchema;
1368
+ exports.GoalStatusSchema = GoalStatusSchema;
1369
+ exports.GoalUpdateSchema = GoalUpdateSchema;
1370
+ exports.InstitutionLoginParameterSchema = InstitutionLoginParameterSchema;
1371
+ exports.InstitutionSchema = InstitutionSchema;
1372
+ exports.InstitutionSearchMetaSchema = InstitutionSearchMetaSchema;
1373
+ exports.InstitutionsResponseSchema = InstitutionsResponseSchema;
1374
+ exports.InvestmentHoldingSchema = InvestmentHoldingSchema;
1375
+ exports.InvestmentSchema = InvestmentSchema;
1376
+ exports.InvestmentsResponseSchema = InvestmentsResponseSchema;
1377
+ exports.MFARequestSchema = MFARequestSchema;
1378
+ exports.MFAResponseSchema = MFAResponseSchema;
1379
+ exports.NetWorthAccountCreateSchema = NetWorthAccountCreateSchema;
1380
+ exports.NetWorthAccountDeleteSchema = NetWorthAccountDeleteSchema;
1381
+ exports.NetWorthAccountTypeSchema = NetWorthAccountTypeSchema;
1382
+ exports.NetWorthAccountUpdateSchema = NetWorthAccountUpdateSchema;
1383
+ exports.NetWorthAssetSchema = NetWorthAssetSchema;
1384
+ exports.NetWorthDebtSchema = NetWorthDebtSchema;
1385
+ exports.NetWorthHistorySchema = NetWorthHistorySchema;
1386
+ exports.NetWorthMetaSchema = NetWorthMetaSchema;
1387
+ exports.NetWorthResponseSchema = NetWorthResponseSchema;
1388
+ exports.NetWorthSchema = NetWorthSchema;
1389
+ exports.NotificationCreateSchemaAdmin = NotificationCreateSchemaAdmin;
1390
+ exports.NotificationCreateSchemaUser = NotificationCreateSchemaUser;
1391
+ exports.NotificationFrequencySchema = NotificationFrequencySchema;
1392
+ exports.NotificationPreferencesSchema = NotificationPreferencesSchema;
1393
+ exports.NotificationPreferencesUpdateSchema = NotificationPreferencesUpdateSchema;
1394
+ exports.NotificationSchema = NotificationSchema;
1395
+ exports.NotificationUpdateSchemaAdmin = NotificationUpdateSchemaAdmin;
1396
+ exports.NotificationUpdateSchemaUser = NotificationUpdateSchemaUser;
1397
+ exports.NotificationsResponseSchema = NotificationsResponseSchema;
1398
+ exports.OtherBalanceSchema = OtherBalanceSchema;
1399
+ exports.PartnerCreateSchemaAdmin = PartnerCreateSchemaAdmin;
1400
+ exports.PartnerCreateSchemaUser = PartnerCreateSchemaUser;
1401
+ exports.PartnerDeleteSchema = PartnerDeleteSchema;
1402
+ exports.PartnerSchema = PartnerSchema;
1403
+ exports.PartnerUpdateSchemaAdmin = PartnerUpdateSchemaAdmin;
1404
+ exports.PartnerUpdateSchemaUser = PartnerUpdateSchemaUser;
1405
+ exports.PartnersResponseSchema = PartnersResponseSchema;
1406
+ exports.PayoffGoalSchema = PayoffGoalSchema;
1407
+ exports.PayoffGoalsResponseSchema = PayoffGoalsResponseSchema;
1408
+ exports.PendingAccountDeleteSchema = PendingAccountDeleteSchema;
1409
+ exports.PendingAccountSchema = PendingAccountSchema;
1410
+ exports.PendingAccountsResponseSchema = PendingAccountsResponseSchema;
1411
+ exports.PreferredBalanceTypeSchema = PreferredBalanceTypeSchema;
1412
+ exports.RecurrenceFrequencySchema = RecurrenceFrequencySchema;
1413
+ exports.SPRING_CONFIG = SPRING_CONFIG;
1414
+ exports.SavingsGoalSchema = SavingsGoalSchema;
1415
+ exports.SavingsGoalsResponseSchema = SavingsGoalsResponseSchema;
1416
+ exports.TagColorSchema = TagColorSchema;
1417
+ exports.TagCreateSchemaAdmin = TagCreateSchemaAdmin;
1418
+ exports.TagCreateSchemaUser = TagCreateSchemaUser;
1419
+ exports.TagDeleteSchema = TagDeleteSchema;
1420
+ exports.TagReportItemSchema = TagReportItemSchema;
1421
+ exports.TagUsageDataPointSchema = TagUsageDataPointSchema;
1422
+ exports.TagUsageReportSchema = TagUsageReportSchema;
1423
+ exports.TagUsageStatSchema = TagUsageStatSchema;
1424
+ exports.TagUsageStatsSchema = TagUsageStatsSchema;
1425
+ exports.TagsResponseSchema = TagsResponseSchema;
1426
+ exports.TagsUpdateSchema = TagsUpdateSchema;
1427
+ exports.TransactionCreateSchema = TransactionCreateSchema;
1428
+ exports.TransactionCreateSchemaAdmin = TransactionCreateSchemaAdmin;
1429
+ exports.TransactionCreateSchemaUser = TransactionCreateSchemaUser;
1430
+ exports.TransactionDeleteSchema = TransactionDeleteSchema;
1431
+ exports.TransactionLinksSchema = TransactionLinksSchema;
1432
+ exports.TransactionSchema = TransactionSchema;
1433
+ exports.TransactionSearchParamsSchema = TransactionSearchParamsSchema;
1434
+ exports.TransactionTagSchema = TransactionTagSchema;
1435
+ exports.TransactionTaggingRegularSchema = TransactionTaggingRegularSchema;
1436
+ exports.TransactionTaggingSchema = TransactionTaggingSchema;
1437
+ exports.TransactionTaggingSplitItemSchema = TransactionTaggingSplitItemSchema;
1438
+ exports.TransactionTaggingSplitSchema = TransactionTaggingSplitSchema;
1439
+ exports.TransactionTypeSchema = TransactionTypeSchema;
1440
+ exports.TransactionUpdateSchema = TransactionUpdateSchema;
1441
+ exports.TransactionsResponseSchema = TransactionsResponseSchema;
1442
+ exports.UpdateCredentialsRequestSchema = UpdateCredentialsRequestSchema;
1443
+ exports.UpdateCredentialsResponseSchema = UpdateCredentialsResponseSchema;
1444
+ exports.UserCreateSchema = UserCreateSchema;
1445
+ exports.UserCreateSchemaAdmin = UserCreateSchemaAdmin;
1446
+ exports.UserCreateSchemaUser = UserCreateSchemaUser;
1447
+ exports.UserSchema = UserSchema;
1448
+ exports.UserSexSchema = UserSexSchema;
1449
+ exports.UserTagsSchema = UserTagsSchema;
1450
+ exports.UserUpdateSchema = UserUpdateSchema;
1451
+ exports.UserUpdateSchemaAdmin = UserUpdateSchemaAdmin;
1452
+ exports.UserUpdateSchemaUser = UserUpdateSchemaUser;
1453
+ exports.arcVariants = arcVariants;
1454
+ exports.createTransition = createTransition;
1455
+ exports.fadeVariants = fadeVariants;
1456
+ exports.formatCurrency = formatCurrency;
1457
+ exports.formatCurrencyAbbreviated = formatCurrencyAbbreviated;
1458
+ exports.formatPercentage = formatPercentage;
1459
+ exports.getChartColors = getChartColors;
1460
+ exports.getChartThemeConfig = getChartThemeConfig;
1461
+ exports.getColorByIndex = getColorByIndex;
1462
+ exports.listContainerVariants = listContainerVariants;
1463
+ exports.listItemVariants = listItemVariants;
1464
+ exports.panelVariants = panelVariants;
1465
+ exports.progressVariants = progressVariants;
1466
+ exports.textVariants = textVariants;
1467
+ exports.useAppMode = useAppMode;
1468
+ //# sourceMappingURL=index.cjs.map
1469
+ //# sourceMappingURL=index.cjs.map