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