@tight-embedded/react 1.0.1 → 1.2.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.css +530 -213
- package/dist/index.css.gz +0 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.js +1 -3382
- package/dist/index.js.gz +0 -0
- package/dist/index.js.map +1 -1
- package/dist/index.js.map.gz +0 -0
- package/package.json +24 -14
package/dist/index.js
CHANGED
|
@@ -1,3383 +1,2 @@
|
|
|
1
|
-
import { create as e } from "zustand";
|
|
2
|
-
import { devtools as t } from "zustand/middleware";
|
|
3
|
-
import { cloneDeep as r, entries as n, mapValues as o, isEqual as a, isEmpty as i } from "lodash-es";
|
|
4
|
-
import * as l from "zod";
|
|
5
|
-
import { z as s } from "zod";
|
|
6
|
-
import * as c from "react";
|
|
7
|
-
import { useRef as d, useMemo as u, createContext as h, useContext as g, Component as p, useState as v, useCallback as m, useEffect as b, createElement as f, forwardRef as y, useReducer as T, useLayoutEffect as x, useImperativeHandle as w } from "react";
|
|
8
|
-
import { jsx as k, Fragment as C, jsxs as S } from "react/jsx-runtime";
|
|
9
|
-
import { QueryClient as E, useIsRestoring as I, useQuery as P, keepPreviousData as A, useMutation as D } from "@tanstack/react-query";
|
|
10
|
-
import M from "yocto-queue";
|
|
11
|
-
import N from "big.js";
|
|
12
|
-
import { ResponsiveContainer as R, BarChart as O, Legend as _, CartesianGrid as L, XAxis as F, YAxis as W, Tooltip as B, Bar as H, ReferenceLine as z, Line as V } from "recharts";
|
|
13
|
-
import { flexRender as j, createColumnHelper as q, useReactTable as U, getCoreRowModel as K, getExpandedRowModel as $ } from "@tanstack/react-table";
|
|
14
|
-
import { useFloatingNodeId as Y, useFloating as G, offset as Q, flip as X, shift as Z, size as J, autoUpdate as ee, useClick as te, useDismiss as re, useRole as ne, useInteractions as oe, useFloatingParentNodeId as ae, FloatingTree as ie, FloatingNode as le, useMergeRefs as se, FloatingOverlay as ce, FloatingPortal as de, FloatingFocusManager as ue } from "@floating-ui/react";
|
|
15
|
-
import { usePlaidLink as he } from "react-plaid-link";
|
|
16
|
-
import { ContextAwareConfirmation as ge, confirmable as pe } from "react-confirm";
|
|
17
|
-
import ve from "fuse.js";
|
|
18
|
-
import { openDB as me } from "idb";
|
|
19
|
-
import { PersistQueryClientProvider as be } from "@tanstack/react-query-persist-client";
|
|
20
|
-
import { createFormHookContexts as fe, useStore as ye, createFormHook as Te } from "@tanstack/react-form";
|
|
21
|
-
import { NumericFormat as xe } from "react-number-format";
|
|
22
|
-
function we(e2, t2) {
|
|
23
|
-
return `${e2.trim()}:${t2.trim()}`;
|
|
24
|
-
}
|
|
25
|
-
const ke = (e2) => ({ hasBulkSelect: false, updateFlags: (t2) => e2((e3) => ({ ...e3, ...t2 }), void 0, we("featureFlags", "updateFlags")) }), Ce = "drawerNavigation", Se = (e2) => ({ drawerHistory: [], openDrawer: (t2, n2 = {}) => e2((e3) => {
|
|
26
|
-
const { replaceHistory: o2, routeProps: a2 } = n2, i2 = { [t2]: { routeProps: a2 } };
|
|
27
|
-
if (o2 || 0 === e3.drawerHistory.length) return { drawerHistory: [i2] };
|
|
28
|
-
{
|
|
29
|
-
const t3 = r(e3.drawerHistory);
|
|
30
|
-
return t3.push(i2), { drawerHistory: t3 };
|
|
31
|
-
}
|
|
32
|
-
}, void 0, we(Ce, "openDrawer")), closeDrawer: () => e2((e3) => {
|
|
33
|
-
const t2 = e3.drawerHistory;
|
|
34
|
-
return { drawerHistory: t2.slice(0, t2.length - 1) };
|
|
35
|
-
}, void 0, we(Ce, "closeDrawer")), closeAllDrawers: () => e2(() => ({ drawerHistory: [] }), void 0, we(Ce, "closeAllDrawers")) }), Ee = (e2) => ({ externalOptions: {}, setOptions: (t2, r2 = false) => e2((e3) => r2 ? { externalOptions: { ...t2 } } : { externalOptions: { ...e3.externalOptions, ...t2 } }, void 0, we("externalOptions", "setOptions")) });
|
|
36
|
-
function Ie(e2, t2) {
|
|
37
|
-
if (t2 > -1 && t2 <= e2.length - 1) {
|
|
38
|
-
return [...e2.slice(0, t2), ...e2.slice(t2 + 1)];
|
|
39
|
-
}
|
|
40
|
-
return [...e2];
|
|
41
|
-
}
|
|
42
|
-
function Pe(e2) {
|
|
43
|
-
return e2[e2.length - 1];
|
|
44
|
-
}
|
|
45
|
-
const Ae = "transactionsDashFilters", De = (e2) => ({ transactionsDashFilters: [], addTransactionsDashFilters: (t2) => e2((e3) => ({ ...e3, transactionsDashFilters: [...e3.transactionsDashFilters, ...t2] }), void 0, we(Ae, "addFilter")), removeTransactionsDashFilter: (t2) => e2((e3) => ({ ...e3, transactionsDashFilters: Ie(e3.transactionsDashFilters, t2) }), void 0, we(Ae, "removeFilter")), setTransactionsDashFilters: (t2) => e2((e3) => ({ ...e3, transactionsDashFilters: t2 }), void 0, we(Ae, "setFilters")) });
|
|
46
|
-
const Me = e()(t((...e2) => ({ ...ke(...e2), ...Se(...e2), ...Ee(...e2), ...De(...e2) }), { name: "globalStore", enabled: false, store: "globalStore" })), Ne = { SELECT: "select", EXPAND: "expand", DATE: "date", DESCRIPTION: "description", AMOUNT: "amount", CATEGORY: "category", CLASS_SEGMENT: "classSegment", REVIEW_STATUS: "reviewStatus", COMMENTS: "comments" }, Re = [Ne.COMMENTS, Ne.DATE, Ne.DESCRIPTION, Ne.AMOUNT, Ne.CATEGORY, Ne.CLASS_SEGMENT, Ne.REVIEW_STATUS], Oe = l.object({ pageSize: l.optional(l.int32().positive()), columns: l.optional(l.array(l.enum(Re))) }), _e = l.optional(l.string().trim()), Le = /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/, Fe = l.optional(l.array(l.string().trim())), We = { transactionsDashboard: (e2) => {
|
|
47
|
-
const t2 = Oe.safeParse(e2);
|
|
48
|
-
return t2.success ? t2.data : void 0;
|
|
49
|
-
}, accessToken: (e2) => {
|
|
50
|
-
const t2 = _e.safeParse(e2);
|
|
51
|
-
return t2.success ? t2.data : void 0;
|
|
52
|
-
}, dataVisualizationColors: (e2) => {
|
|
53
|
-
const t2 = Fe.safeParse(e2);
|
|
54
|
-
if (!t2.success || void 0 === t2.data) return;
|
|
55
|
-
const r2 = t2.data.filter((e3) => Le.test(e3));
|
|
56
|
-
return r2.length > 0 ? r2 : void 0;
|
|
57
|
-
} };
|
|
58
|
-
const Be = (e2, t2) => {
|
|
59
|
-
if (void 0 === We[e2]) return;
|
|
60
|
-
return (0, We[e2])(t2);
|
|
61
|
-
};
|
|
62
|
-
function He(e2) {
|
|
63
|
-
const t2 = d(false), o2 = Me((e3) => e3.setOptions);
|
|
64
|
-
if (e2 && !t2.current) {
|
|
65
|
-
const r2 = function(e3) {
|
|
66
|
-
let t3 = {};
|
|
67
|
-
for (const [r3, o3] of n(e3)) {
|
|
68
|
-
const e4 = Be(r3, o3);
|
|
69
|
-
void 0 !== e4 && (t3 = { ...t3, [r3]: e4 });
|
|
70
|
-
}
|
|
71
|
-
return t3;
|
|
72
|
-
}(e2);
|
|
73
|
-
o2(r2), t2.current = true;
|
|
74
|
-
}
|
|
75
|
-
const a2 = Me((e3) => e3.externalOptions);
|
|
76
|
-
return { options: u(() => r(a2), [a2]), setOptions: o2 };
|
|
77
|
-
}
|
|
78
|
-
function ze(e2) {
|
|
79
|
-
return "object" == typeof e2 && null != e2 && !Array.isArray(e2);
|
|
80
|
-
}
|
|
81
|
-
var Ve = (e2) => "object" == typeof e2 && null !== e2;
|
|
82
|
-
function je(e2) {
|
|
83
|
-
return Object.fromEntries(Object.entries(e2 ?? {}).filter(([e3, t2]) => void 0 !== t2));
|
|
84
|
-
}
|
|
85
|
-
var qe = (e2) => "base" === e2;
|
|
86
|
-
function Ue(e2) {
|
|
87
|
-
return String.fromCharCode(e2 + (e2 > 25 ? 39 : 97));
|
|
88
|
-
}
|
|
89
|
-
function Ke(e2) {
|
|
90
|
-
return function(e3) {
|
|
91
|
-
let t2, r2 = "";
|
|
92
|
-
for (t2 = Math.abs(e3); t2 > 52; t2 = t2 / 52 | 0) r2 = Ue(t2 % 52) + r2;
|
|
93
|
-
return Ue(t2 % 52) + r2;
|
|
94
|
-
}(function(e3, t2) {
|
|
95
|
-
let r2 = t2.length;
|
|
96
|
-
for (; r2; ) e3 = 33 * e3 ^ t2.charCodeAt(--r2);
|
|
97
|
-
return e3;
|
|
98
|
-
}(5381, e2) >>> 0);
|
|
99
|
-
}
|
|
100
|
-
var $e = /\s*!(important)?/i;
|
|
101
|
-
function Ye(e2) {
|
|
102
|
-
return "string" == typeof e2 ? e2.replaceAll(" ", "_") : e2;
|
|
103
|
-
}
|
|
104
|
-
var Ge = (e2) => {
|
|
105
|
-
const t2 = /* @__PURE__ */ new Map();
|
|
106
|
-
return (...r2) => {
|
|
107
|
-
const n2 = JSON.stringify(r2);
|
|
108
|
-
if (t2.has(n2)) return t2.get(n2);
|
|
109
|
-
const o2 = e2(...r2);
|
|
110
|
-
return t2.set(n2, o2), o2;
|
|
111
|
-
};
|
|
112
|
-
}, Qe = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]);
|
|
113
|
-
function Xe(...e2) {
|
|
114
|
-
return e2.reduce((e3, t2) => t2 ? (Object.keys(t2).forEach((r2) => {
|
|
115
|
-
if (Qe.has(r2)) return;
|
|
116
|
-
const n2 = e3[r2], o2 = t2[r2];
|
|
117
|
-
ze(n2) && ze(o2) ? e3[r2] = Xe(n2, o2) : e3[r2] = o2;
|
|
118
|
-
}), e3) : e3, {});
|
|
119
|
-
}
|
|
120
|
-
var Ze = (e2) => null != e2;
|
|
121
|
-
function Je(e2, t2, r2 = {}) {
|
|
122
|
-
const { stop: n2, getKey: o2 } = r2;
|
|
123
|
-
return function e3(r3, a2 = []) {
|
|
124
|
-
if (Ve(r3)) {
|
|
125
|
-
const i2 = {};
|
|
126
|
-
for (const [l2, s2] of Object.entries(r3)) {
|
|
127
|
-
const c2 = o2?.(l2, s2) ?? l2, d2 = [...a2, c2];
|
|
128
|
-
if (n2?.(r3, d2)) return t2(r3, a2);
|
|
129
|
-
const u2 = e3(s2, d2);
|
|
130
|
-
Ze(u2) && (i2[c2] = u2);
|
|
131
|
-
}
|
|
132
|
-
return i2;
|
|
133
|
-
}
|
|
134
|
-
return t2(r3, a2);
|
|
135
|
-
}(e2);
|
|
136
|
-
}
|
|
137
|
-
function et(e2, t2, r2 = true) {
|
|
138
|
-
const { utility: n2, conditions: o2 } = t2, { hasShorthand: a2, resolveShorthand: i2 } = n2;
|
|
139
|
-
return Je(e2, (e3) => {
|
|
140
|
-
return Array.isArray(e3) ? (t3 = e3, r3 = o2.breakpoints.keys, t3.reduce((e4, t4, n3) => {
|
|
141
|
-
const o3 = r3[n3];
|
|
142
|
-
return null != t4 && (e4[o3] = t4), e4;
|
|
143
|
-
}, {})) : e3;
|
|
144
|
-
var t3, r3;
|
|
145
|
-
}, { stop: (e3) => Array.isArray(e3), getKey: r2 ? (e3) => a2 ? i2(e3) : e3 : void 0 });
|
|
146
|
-
}
|
|
147
|
-
var tt = { shift: (e2) => e2, finalize: (e2) => e2, breakpoints: { keys: [] } };
|
|
148
|
-
var rt = /([A-Z])/g, nt = /^ms-/, ot = Ge((e2) => e2.startsWith("--") ? e2 : e2.replace(rt, "-$1").replace(nt, "-ms-").toLowerCase()), at = new RegExp(`^(${["min", "max", "clamp", "calc"].join("|")})\\(.*\\)`), it = `(?:${"cm,mm,Q,in,pc,pt,px,em,ex,ch,rem,lh,rlh,vw,vh,vmin,vmax,vb,vi,svw,svh,lvw,lvh,dvw,dvh,cqw,cqh,cqi,cqb,cqmin,cqmax,%".split(",").join("|")})`, lt = new RegExp(`^[+-]?[0-9]*.?[0-9]+(?:[eE][+-]?[0-9]+)?${it}$`), st = { map: function(e2, t2) {
|
|
149
|
-
return Array.isArray(e2) ? e2.map((e3) => t2(e3)) : ze(e2) ? Je(e2, (e3) => t2(e3)) : t2(e2);
|
|
150
|
-
}, isCssFunction: (e2) => "string" == typeof e2 && at.test(e2), isCssVar: (e2) => "string" == typeof e2 && /^var\(--.+\)$/.test(e2), isCssUnit: (e2) => "string" == typeof e2 && lt.test(e2) }, ct = (e2, t2) => {
|
|
151
|
-
if (!e2?.defaultValues) return t2;
|
|
152
|
-
const r2 = "function" == typeof e2.defaultValues ? e2.defaultValues(t2) : e2.defaultValues;
|
|
153
|
-
return Object.assign({}, r2, je(t2));
|
|
154
|
-
};
|
|
155
|
-
const dt = new Set("_hover,_focus,_focusWithin,_focusVisible,_disabled,_active,_visited,_target,_readOnly,_readWrite,_empty,_checked,_enabled,_expanded,_highlighted,_complete,_incomplete,_dragging,_before,_after,_firstLetter,_firstLine,_marker,_selection,_file,_backdrop,_first,_last,_only,_even,_odd,_firstOfType,_lastOfType,_onlyOfType,_peerFocus,_peerHover,_peerActive,_peerFocusWithin,_peerFocusVisible,_peerDisabled,_peerChecked,_peerInvalid,_peerExpanded,_peerPlaceholderShown,_groupFocus,_groupHover,_groupActive,_groupFocusWithin,_groupFocusVisible,_groupDisabled,_groupChecked,_groupExpanded,_groupInvalid,_indeterminate,_required,_valid,_invalid,_autofill,_inRange,_outOfRange,_placeholder,_placeholderShown,_pressed,_selected,_grabbed,_underValue,_overValue,_atValue,_default,_optional,_open,_closed,_fullscreen,_loading,_hidden,_current,_currentPage,_currentStep,_today,_unavailable,_rangeStart,_rangeEnd,_now,_topmost,_motionReduce,_motionSafe,_print,_landscape,_portrait,_dark,_light,_osDark,_osLight,_highContrast,_lessContrast,_moreContrast,_ltr,_rtl,_scrollbar,_scrollbarThumb,_scrollbarTrack,_horizontal,_vertical,_icon,_starting,_noscript,_invertedColors,_supportHover,_notDisabled,sm,smOnly,smDown,md,mdOnly,mdDown,lg,lgOnly,lgDown,xl,xlOnly,xlDown,1.5xl,1.5xlOnly,1.5xlDown,2xl,2xlOnly,2xlDown,smToMd,smToLg,smToXl,smTo1.5xl,smTo2xl,mdToLg,mdToXl,mdTo1.5xl,mdTo2xl,lgToXl,lgTo1.5xl,lgTo2xl,xlTo1.5xl,xlTo2xl,1.5xlTo2xl,base".split(",")), ut = /^@|&|&$/;
|
|
156
|
-
function ht(e2) {
|
|
157
|
-
return dt.has(e2) || ut.test(e2);
|
|
158
|
-
}
|
|
159
|
-
const gt = /^_/, pt = /&|@/;
|
|
160
|
-
const vt = /* @__PURE__ */ new Map();
|
|
161
|
-
"aspectRatio:asp,boxDecorationBreak:bx-db,zIndex:z,boxSizing:bx-s,objectPosition:obj-p,objectFit:obj-f,overscrollBehavior:ovs-b,overscrollBehaviorX:ovs-bx,overscrollBehaviorY:ovs-by,position:pos,top:top,left:left,inset:inset,insetInline:inset-x,insetBlock:inset-y,insetBlockEnd:inset-be,insetBlockStart:inset-bs,insetInlineEnd:inset-e,insetInlineStart:inset-s,right:right,bottom:bottom,float:float,visibility:vis,display:d,hideFrom:hide,hideBelow:show,flexBasis:flex-b,flex:flex,flexDirection:flex-d,flexGrow:flex-g,flexShrink:flex-sh,gridTemplateColumns:grid-tc,gridTemplateRows:grid-tr,gridColumn:grid-c,gridRow:grid-r,gridColumnStart:grid-cs,gridColumnEnd:grid-ce,gridAutoFlow:grid-af,gridAutoColumns:grid-ac,gridAutoRows:grid-ar,gap:gap,gridGap:grid-g,gridRowGap:grid-rg,gridColumnGap:grid-cg,rowGap:rg,columnGap:cg,justifyContent:jc,alignContent:ac,alignItems:ai,alignSelf:as,padding:p,paddingLeft:pl,paddingRight:pr,paddingTop:pt,paddingBottom:pb,paddingBlock:py,paddingBlockEnd:pbe,paddingBlockStart:pbs,paddingInline:px,paddingInlineEnd:pe,paddingInlineStart:ps,marginLeft:ml,marginRight:mr,marginTop:mt,marginBottom:mb,margin:m,marginBlock:my,marginBlockEnd:mbe,marginBlockStart:mbs,marginInline:mx,marginInlineEnd:me,marginInlineStart:ms,spaceX:sx,spaceY:sy,outlineWidth:ring-w,outlineColor:ring-c,outline:ring,outlineOffset:ring-o,divideX:dvd-x,divideY:dvd-y,divideColor:dvd-c,divideStyle:dvd-s,width:w,inlineSize:w-is,minWidth:min-w,minInlineSize:min-w-is,maxWidth:max-w,maxInlineSize:max-w-is,height:h,blockSize:h-bs,minHeight:min-h,minBlockSize:min-h-bs,maxHeight:max-h,maxBlockSize:max-b,boxSize:size,color:c,fontFamily:ff,fontSize:fs,fontSizeAdjust:fs-a,fontPalette:fp,fontKerning:fk,fontFeatureSettings:ff-s,fontWeight:fw,fontSmoothing:fsmt,fontVariant:fv,fontVariantAlternates:fv-alt,fontVariantCaps:fv-caps,fontVariationSettings:fv-s,fontVariantNumeric:fv-num,letterSpacing:ls,lineHeight:lh,textAlign:ta,textDecoration:td,textDecorationColor:td-c,textEmphasisColor:te-c,textDecorationStyle:td-s,textDecorationThickness:td-t,textUnderlineOffset:tu-o,textTransform:tt,textIndent:ti,textShadow:tsh,textShadowColor:tsh-c,textOverflow:tov,verticalAlign:va,wordBreak:wb,textWrap:tw,truncate:trunc,lineClamp:lc,listStyleType:li-t,listStylePosition:li-pos,listStyleImage:li-img,listStyle:li-s,backgroundPosition:bg-p,backgroundPositionX:bg-p-x,backgroundPositionY:bg-p-y,backgroundAttachment:bg-a,backgroundClip:bg-cp,background:bg,backgroundColor:bg-c,backgroundOrigin:bg-o,backgroundImage:bg-i,backgroundRepeat:bg-r,backgroundBlendMode:bg-bm,backgroundSize:bg-s,backgroundGradient:bg-grad,backgroundLinear:bg-linear,backgroundRadial:bg-radial,backgroundConic:bg-conic,textGradient:txt-grad,gradientFromPosition:grad-from-pos,gradientToPosition:grad-to-pos,gradientFrom:grad-from,gradientTo:grad-to,gradientVia:grad-via,gradientViaPosition:grad-via-pos,borderRadius:bdr,borderTopLeftRadius:bdr-tl,borderTopRightRadius:bdr-tr,borderBottomRightRadius:bdr-br,borderBottomLeftRadius:bdr-bl,borderTopRadius:bdr-t,borderRightRadius:bdr-r,borderBottomRadius:bdr-b,borderLeftRadius:bdr-l,borderStartStartRadius:bdr-ss,borderStartEndRadius:bdr-se,borderStartRadius:bdr-s,borderEndStartRadius:bdr-es,borderEndEndRadius:bdr-ee,borderEndRadius:bdr-e,border:bd,borderWidth:bd-w,borderTopWidth:bd-t-w,borderLeftWidth:bd-l-w,borderRightWidth:bd-r-w,borderBottomWidth:bd-b-w,borderBlockStartWidth:bd-bs-w,borderBlockEndWidth:bd-be-w,borderColor:bd-c,borderInline:bd-x,borderInlineWidth:bd-x-w,borderInlineColor:bd-x-c,borderBlock:bd-y,borderBlockWidth:bd-y-w,borderBlockColor:bd-y-c,borderLeft:bd-l,borderLeftColor:bd-l-c,borderInlineStart:bd-s,borderInlineStartWidth:bd-s-w,borderInlineStartColor:bd-s-c,borderRight:bd-r,borderRightColor:bd-r-c,borderInlineEnd:bd-e,borderInlineEndWidth:bd-e-w,borderInlineEndColor:bd-e-c,borderTop:bd-t,borderTopColor:bd-t-c,borderBottom:bd-b,borderBottomColor:bd-b-c,borderBlockEnd:bd-be,borderBlockEndColor:bd-be-c,borderBlockStart:bd-bs,borderBlockStartColor:bd-bs-c,opacity:op,boxShadow:bx-sh,boxShadowColor:bx-sh-c,mixBlendMode:mix-bm,filter:filter,brightness:brightness,contrast:contrast,grayscale:grayscale,hueRotate:hue-rotate,invert:invert,saturate:saturate,sepia:sepia,dropShadow:drop-shadow,blur:blur,backdropFilter:bkdp,backdropBlur:bkdp-blur,backdropBrightness:bkdp-brightness,backdropContrast:bkdp-contrast,backdropGrayscale:bkdp-grayscale,backdropHueRotate:bkdp-hue-rotate,backdropInvert:bkdp-invert,backdropOpacity:bkdp-opacity,backdropSaturate:bkdp-saturate,backdropSepia:bkdp-sepia,borderCollapse:bd-cl,borderSpacing:bd-sp,borderSpacingX:bd-sx,borderSpacingY:bd-sy,tableLayout:tbl,transitionTimingFunction:trs-tmf,transitionDelay:trs-dly,transitionDuration:trs-dur,transitionProperty:trs-prop,transition:trs,animation:anim,animationName:anim-n,animationTimingFunction:anim-tmf,animationDuration:anim-dur,animationDelay:anim-dly,animationPlayState:anim-ps,animationComposition:anim-comp,animationFillMode:anim-fm,animationDirection:anim-dir,animationIterationCount:anim-ic,animationRange:anim-r,animationState:anim-s,animationRangeStart:anim-rs,animationRangeEnd:anim-re,animationTimeline:anim-tl,transformOrigin:trf-o,transformBox:trf-b,transformStyle:trf-s,transform:trf,rotate:rotate,rotateX:rotate-x,rotateY:rotate-y,rotateZ:rotate-z,scale:scale,scaleX:scale-x,scaleY:scale-y,translate:translate,translateX:translate-x,translateY:translate-y,translateZ:translate-z,accentColor:ac-c,caretColor:ca-c,scrollBehavior:scr-bhv,scrollbar:scr-bar,scrollbarColor:scr-bar-c,scrollbarGutter:scr-bar-g,scrollbarWidth:scr-bar-w,scrollMargin:scr-m,scrollMarginLeft:scr-ml,scrollMarginRight:scr-mr,scrollMarginTop:scr-mt,scrollMarginBottom:scr-mb,scrollMarginBlock:scr-my,scrollMarginBlockEnd:scr-mbe,scrollMarginBlockStart:scr-mbt,scrollMarginInline:scr-mx,scrollMarginInlineEnd:scr-me,scrollMarginInlineStart:scr-ms,scrollPadding:scr-p,scrollPaddingBlock:scr-py,scrollPaddingBlockStart:scr-pbs,scrollPaddingBlockEnd:scr-pbe,scrollPaddingInline:scr-px,scrollPaddingInlineEnd:scr-pe,scrollPaddingInlineStart:scr-ps,scrollPaddingLeft:scr-pl,scrollPaddingRight:scr-pr,scrollPaddingTop:scr-pt,scrollPaddingBottom:scr-pb,scrollSnapAlign:scr-sa,scrollSnapStop:scrs-s,scrollSnapType:scrs-t,scrollSnapStrictness:scrs-strt,scrollSnapMargin:scrs-m,scrollSnapMarginTop:scrs-mt,scrollSnapMarginBottom:scrs-mb,scrollSnapMarginLeft:scrs-ml,scrollSnapMarginRight:scrs-mr,scrollSnapCoordinate:scrs-c,scrollSnapDestination:scrs-d,scrollSnapPointsX:scrs-px,scrollSnapPointsY:scrs-py,scrollSnapTypeX:scrs-tx,scrollSnapTypeY:scrs-ty,scrollTimeline:scrtl,scrollTimelineAxis:scrtl-a,scrollTimelineName:scrtl-n,touchAction:tch-a,userSelect:us,overflow:ov,overflowWrap:ov-wrap,overflowX:ov-x,overflowY:ov-y,overflowAnchor:ov-a,overflowBlock:ov-b,overflowInline:ov-i,overflowClipBox:ovcp-bx,overflowClipMargin:ovcp-m,overscrollBehaviorBlock:ovs-bb,overscrollBehaviorInline:ovs-bi,fill:fill,stroke:stk,strokeWidth:stk-w,strokeDasharray:stk-dsh,strokeDashoffset:stk-do,strokeLinecap:stk-lc,strokeLinejoin:stk-lj,strokeMiterlimit:stk-ml,strokeOpacity:stk-op,srOnly:sr,debug:debug,appearance:ap,backfaceVisibility:bfv,clipPath:cp-path,hyphens:hy,mask:msk,maskImage:msk-i,maskSize:msk-s,textSizeAdjust:txt-adj,container:cq,containerName:cq-n,containerType:cq-t,cursor:cursor".split(",").forEach((e2) => {
|
|
162
|
-
const [t2, r2] = e2.split(":");
|
|
163
|
-
vt.set(t2, r2);
|
|
164
|
-
});
|
|
165
|
-
const mt = { conditions: { shift: function(e2) {
|
|
166
|
-
return e2.sort((e3, t2) => {
|
|
167
|
-
const r2 = ht(e3), n2 = ht(t2);
|
|
168
|
-
return r2 && !n2 ? 1 : !r2 && n2 ? -1 : 0;
|
|
169
|
-
});
|
|
170
|
-
}, finalize: function(e2) {
|
|
171
|
-
return e2.map((e3) => dt.has(e3) ? e3.replace(gt, "") : pt.test(e3) ? `[${Ye(e3.trim())}]` : e3);
|
|
172
|
-
}, breakpoints: { keys: ["base", "sm", "md", "lg", "xl", "1.5xl", "2xl"] } }, utility: { prefix: "tsystem", transform: (e2, t2) => ({ className: `${vt.get(e2) || ot(e2)}_${Ye(t2)}` }), toHash: (e2, t2) => t2(e2.join(":")), resolveShorthand: (e2) => e2 } }, bt = function(e2) {
|
|
173
|
-
const { utility: t2, hash: r2, conditions: n2 = tt } = e2, o2 = (e3) => [t2.prefix, e3].filter(Boolean).join("-");
|
|
174
|
-
return Ge(({ base: a2, ...i2 } = {}) => {
|
|
175
|
-
const l2 = et(Object.assign(i2, a2), e2), s2 = /* @__PURE__ */ new Set();
|
|
176
|
-
return Je(l2, (e3, a3) => {
|
|
177
|
-
if (null == e3) return;
|
|
178
|
-
const i3 = function(e4) {
|
|
179
|
-
return "string" == typeof e4 && $e.test(e4);
|
|
180
|
-
}(e3), [l3, ...c2] = n2.shift(a3), d2 = c2.slice().filter((e4) => !qe(e4));
|
|
181
|
-
const u2 = t2.transform(l3, function(e4) {
|
|
182
|
-
return "string" == typeof e4 ? e4.replace($e, "").trim() : e4;
|
|
183
|
-
}(((e4) => "string" == typeof e4 ? e4.replaceAll(/[\n\s]+/g, " ") : e4)(e3)));
|
|
184
|
-
let h2 = ((e4, a4) => {
|
|
185
|
-
let i4;
|
|
186
|
-
if (r2) {
|
|
187
|
-
const r3 = [...n2.finalize(e4), a4];
|
|
188
|
-
i4 = o2(t2.toHash(r3, Ke));
|
|
189
|
-
} else i4 = [...n2.finalize(e4), o2(a4)].join(":");
|
|
190
|
-
return i4;
|
|
191
|
-
})(d2, u2.className);
|
|
192
|
-
i3 && (h2 = `${h2}!`), s2.add(h2);
|
|
193
|
-
}), Array.from(s2).join(" ");
|
|
194
|
-
});
|
|
195
|
-
}(mt), ft = (...e2) => bt(yt(...e2));
|
|
196
|
-
ft.raw = (...e2) => yt(...e2);
|
|
197
|
-
const { mergeCss: yt } = function(e2) {
|
|
198
|
-
function t2(t3) {
|
|
199
|
-
const r2 = function(...e3) {
|
|
200
|
-
return e3.flat().filter((e4) => ze(e4) && Object.keys(je(e4)).length > 0);
|
|
201
|
-
}(...t3);
|
|
202
|
-
return 1 === r2.length ? r2 : r2.map((t4) => et(t4, e2));
|
|
203
|
-
}
|
|
204
|
-
return { mergeCss: Ge(function(...e3) {
|
|
205
|
-
return Xe(...t2(e3));
|
|
206
|
-
}), assignCss: function(...e3) {
|
|
207
|
-
return Object.assign({}, ...t2(e3));
|
|
208
|
-
} };
|
|
209
|
-
}(mt);
|
|
210
|
-
function Tt() {
|
|
211
|
-
let e2, t2 = "", r2 = 0;
|
|
212
|
-
for (; r2 < arguments.length; ) (e2 = arguments[r2++]) && "string" == typeof e2 && (t2 && (t2 += " "), t2 += e2);
|
|
213
|
-
return t2;
|
|
214
|
-
}
|
|
215
|
-
const xt = (e2) => ({ base: {}, variants: {}, defaultVariants: {}, compoundVariants: [], ...e2 });
|
|
216
|
-
function wt(e2) {
|
|
217
|
-
const { base: t2, variants: r2, defaultVariants: n2, compoundVariants: o2 } = xt(e2), a2 = (e3) => ({ ...n2, ...je(e3) });
|
|
218
|
-
function i2(e3 = {}) {
|
|
219
|
-
const n3 = a2(e3);
|
|
220
|
-
let i3 = { ...t2 };
|
|
221
|
-
for (const [e4, t3] of Object.entries(n3)) r2[e4]?.[t3] && (i3 = yt(i3, r2[e4][t3]));
|
|
222
|
-
const l3 = function(e4, t3) {
|
|
223
|
-
let r3 = {};
|
|
224
|
-
return e4.forEach((e5) => {
|
|
225
|
-
Object.entries(e5).every(([e6, r4]) => {
|
|
226
|
-
if ("css" === e6) return true;
|
|
227
|
-
return (Array.isArray(r4) ? r4 : [r4]).some((r5) => t3[e6] === r5);
|
|
228
|
-
}) && (r3 = yt(r3, e5.css));
|
|
229
|
-
}), r3;
|
|
230
|
-
}(o2, n3);
|
|
231
|
-
return yt(i3, l3);
|
|
232
|
-
}
|
|
233
|
-
const l2 = Object.keys(r2);
|
|
234
|
-
const s2 = Object.fromEntries(Object.entries(r2).map(([e3, t3]) => [e3, Object.keys(t3)]));
|
|
235
|
-
return Object.assign(Ge(function(e3) {
|
|
236
|
-
return ft(i2(e3));
|
|
237
|
-
}), { __cva__: true, variantMap: s2, variantKeys: l2, raw: i2, config: e2, merge: function(e3) {
|
|
238
|
-
const a3 = xt(e3.config), i3 = ((...e4) => {
|
|
239
|
-
const t3 = e4.reduce((e5, t4) => (t4 && t4.forEach((t5) => e5.add(t5)), e5), /* @__PURE__ */ new Set([]));
|
|
240
|
-
return Array.from(t3);
|
|
241
|
-
})(e3.variantKeys, Object.keys(r2));
|
|
242
|
-
return wt({ base: yt(t2, a3.base), variants: Object.fromEntries(i3.map((e4) => [e4, yt(r2[e4], a3.variants[e4])])), defaultVariants: Xe(n2, a3.defaultVariants), compoundVariants: [...o2, ...a3.compoundVariants] });
|
|
243
|
-
}, splitVariantProps: function(e3) {
|
|
244
|
-
return function(e4, ...t3) {
|
|
245
|
-
const r3 = Object.getOwnPropertyDescriptors(e4), n3 = Object.keys(r3), o3 = (e5) => {
|
|
246
|
-
const t4 = {};
|
|
247
|
-
for (let n4 = 0; n4 < e5.length; n4++) {
|
|
248
|
-
const o4 = e5[n4];
|
|
249
|
-
r3[o4] && (Object.defineProperty(t4, o4, r3[o4]), delete r3[o4]);
|
|
250
|
-
}
|
|
251
|
-
return t4;
|
|
252
|
-
};
|
|
253
|
-
return t3.map((e5) => o3(Array.isArray(e5) ? e5 : n3.filter(e5))).concat(o3(n3));
|
|
254
|
-
}(e3, l2);
|
|
255
|
-
}, getVariantProps: a2 });
|
|
256
|
-
}
|
|
257
|
-
var kt = ((e2) => (e2.component = "component", e2["dashboard-placeholder-table"] = "dashboard-placeholder-table", e2["dashboard-header"] = "dashboard-header", e2["dashboard-table"] = "dashboard-table", e2["dashboard-table-body"] = "dashboard-table-body", e2["dashboard-table-cell"] = "dashboard-table-cell", e2["dashboard-table-column-header"] = "dashboard-table-column-header", e2["dashboard-table-header"] = "dashboard-table-header", e2.label = "label", e2.popup = "popup", e2["popup-sort-row"] = "popup-sort-row", e2["progress-bar"] = "progress-bar", e2["progress-bar-fill"] = "progress-bar-fill", e2.summation = "summation", e2["table-parent-row"] = "table-parent-row", e2["table-row"] = "table-row", e2["table-sub-row"] = "table-sub-row", e2.tile = "tile", e2["tile-bar-label"] = "tile-bar-label", e2["tile-body"] = "tile-body", e2["tile-filter-button"] = "tile-filter-button", e2["tile-filter-list"] = "tile-filter-list", e2["tile-filter-row"] = "tile-filter-row", e2["tile-header"] = "tile-header", e2["tile-title"] = "tile-title", e2.title = "title", e2["business-owner-dashboard"] = "business-owner-dashboard", e2["business-owner-dashboard-header"] = "business-owner-dashboard-header", e2["business-owner-table"] = "business-owner-table", e2["transaction-type-label"] = "transaction-type-label", e2["selector-row"] = "selector-row", e2["popup-list"] = "popup-list", e2.badge = "badge", e2["date-cell"] = "date-cell", e2["expander-cell"] = "expander-cell", e2["vertical-divider"] = "vertical-divider", e2["horizontal-divider"] = "horizontal-divider", e2["table-cell-divider"] = "table-cell-divider", e2["checkbox-input"] = "checkbox-input", e2["bulk-select"] = "bulk-select", e2["button-base"] = "button-base", e2["button-discrete-small"] = "button-discrete-small", e2["button-primary"] = "button-primary", e2["button-secondary"] = "button-secondary", e2["button-tertiary"] = "button-tertiary", e2["button-danger"] = "button-danger", e2["button-warning"] = "button-warning", e2["button-action"] = "button-action", e2.text = "text", e2["cell-button"] = "cell-button", e2["month-picker-left-button"] = "month-picker-left-button", e2["month-picker-right-button"] = "month-picker-right-button", e2["filter-bar"] = "filter-bar", e2["filter-search-bar"] = "filter-search-bar", e2["filter-pill"] = "filter-pill", e2["discrete-form-input"] = "discrete-form-input", e2["editable-form-input"] = "editable-form-input", e2["category-text"] = "category-text", e2["amount-input-container"] = "amount-input-container", e2["amount-input"] = "amount-input", e2["modal-popup"] = "modal-popup", e2["drawer-header"] = "drawer-header", e2["drawer-header-border"] = "drawer-header-border", e2["transaction-form-body"] = "transaction-form-body", e2.body = "body", e2.heading = "heading", e2["sub-label"] = "sub-label", e2["strong-label"] = "strong-label", e2["strong-sub-label"] = "strong-sub-label", e2["metric-xl"] = "metric-xl", e2["metric-md"] = "metric-md", e2["large-icon"] = "large-icon", e2["medium-icon"] = "medium-icon", e2["small-icon"] = "small-icon", e2["tiny-icon"] = "tiny-icon", e2["neutral-badge"] = "neutral-badge", e2["highlight-badge"] = "highlight-badge", e2["success-badge"] = "success-badge", e2["warning-badge"] = "warning-badge", e2["critical-badge"] = "critical-badge", e2["button-group"] = "button-group", e2["alert-dialog"] = "alert-dialog", e2["emphasis-label"] = "emphasis-label", e2["profit-loss-graph"] = "profit-loss-graph", e2.banner = "banner", e2["banner-high"] = "banner-high", e2["banner-medium"] = "banner-medium", e2["banner-low"] = "banner-low", e2["banner-urgent"] = "banner-urgent", e2["banner-button"] = "banner-button", e2["banner-button-text"] = "banner-button-text", e2["banner-button-icon"] = "banner-button-icon", e2["empty-dashboard-layout"] = "empty-dashboard-layout", e2["zero-state-layout"] = "zero-state-layout", e2["emphasis-sub-label"] = "emphasis-sub-label", e2))(kt || {});
|
|
258
|
-
const Ct = "Tight-", St = (e2) => `${Ct}${e2}`;
|
|
259
|
-
function Et(e2) {
|
|
260
|
-
return e2 in kt;
|
|
261
|
-
}
|
|
262
|
-
function It(e2) {
|
|
263
|
-
const t2 = e2.indexOf("-"), r2 = e2.slice(0, t2 + 1), n2 = e2.slice(t2 + 1);
|
|
264
|
-
return r2 === Ct && n2 in kt;
|
|
265
|
-
}
|
|
266
|
-
function Pt(e2) {
|
|
267
|
-
return !Et(e2) && !It(e2);
|
|
268
|
-
}
|
|
269
|
-
const At = (e2, ...t2) => {
|
|
270
|
-
const r2 = [], n2 = [];
|
|
271
|
-
return null !== e2 && r2.push(St(e2)), t2.forEach((e3) => {
|
|
272
|
-
void 0 !== e3 && (Pt(e3) ? n2.push(e3) : Et(e3) && r2.push(St(e3)));
|
|
273
|
-
}), { className: Tt(...r2, ...n2) };
|
|
274
|
-
}, Dt = At(kt["business-owner-dashboard-header"], ft({ display: "flex", flexDirection: "row", alignItems: "center", justifyContent: "space-between", height: 80 }));
|
|
275
|
-
function Mt({ children: e2 }) {
|
|
276
|
-
return k("div", { ...Dt, children: e2 });
|
|
277
|
-
}
|
|
278
|
-
function Nt(e2) {
|
|
279
|
-
return e2.reduce((e3, t2) => {
|
|
280
|
-
const r2 = t2.className.split(" ").reduce((e4, t3) => (It(t3) && e4.push(t3), e4), []);
|
|
281
|
-
return [...e3, ...r2];
|
|
282
|
-
}, []);
|
|
283
|
-
}
|
|
284
|
-
function Rt(e2) {
|
|
285
|
-
return e2.reduce((e3, t2) => {
|
|
286
|
-
const r2 = t2.className.split(" ").reduce((e4, t3) => (Pt(t3) && e4.push(t3), e4), []);
|
|
287
|
-
return [...e3, ...r2];
|
|
288
|
-
}, []);
|
|
289
|
-
}
|
|
290
|
-
function Ot(e2) {
|
|
291
|
-
const t2 = Array.isArray(e2) ? e2 : [e2];
|
|
292
|
-
return { className: Tt(...Nt(t2), ...Rt(t2)) };
|
|
293
|
-
}
|
|
294
|
-
const _t = wt({ base: {}, variants: { body: { default: { fontWeight: "body", fontSize: { sm: "body", base: "lg" }, fontFamily: "body", color: "typography.base", lineHeight: { sm: "16px", base: "18px" }, letterSpacing: "0.84px" } }, label: { default: { fontWeight: "label", fontSize: { sm: "label", base: "lg" }, fontFamily: "label", color: "typography.label", lineHeight: { sm: "16px", base: "18px" }, letterSpacing: "0.84px" }, subLabel: { fontWeight: "label.sub", fontSize: { sm: "label.sub", base: "md" }, fontFamily: "label", color: "typography.label.sub", lineHeight: { sm: "14px", base: "16px" }, letterSpacing: "0.66px" }, strongLabel: { fontWeight: "label.strong", fontSize: { sm: "label.strong", base: "lg" }, fontFamily: "label", color: "typography.label.strong", lineHeight: { sm: "16px", base: "18px" }, letterSpacing: "0.84px" }, strongSubLabel: { fontWeight: "label.strongSub", fontSize: { sm: "label.strongSub", base: "md" }, fontFamily: "label", color: "typography.label.strongSub", lineHeight: { sm: "14px", base: "16px" }, letterSpacing: "0.84px" }, emphasisSubLabel: { fontWeight: "label.emphasisSub", fontSize: { sm: "label.strongSub", base: "md" }, fontFamily: "label", color: "typography.label.emphasisSub", lineHeight: { sm: "14px", base: "16px" }, letterSpacing: "0.84px" } }, heading: { default: { fontWeight: "heading", fontSize: "heading", fontFamily: "heading", color: "typography.heading", lineHeight: "25px", letterSpacing: "2px" } }, metric: { sm: { fontWeight: "metric.sm", fontSize: "metric.sm", fontFamily: "metric", color: "typography.metric.sm" }, md: { fontWeight: "metric.md", fontSize: "metric.md", fontFamily: "metric", color: "typography.metric.md" }, lg: { fontWeight: "metric.lg", fontSize: "metric.lg", fontFamily: "metric", color: "typography.metric.lg" }, xl: { fontWeight: "metric.xl", fontSize: "metric.xl", fontFamily: "metric", color: "typography.metric.xl" } } } }), Lt = At(kt.heading, _t({ heading: "default" }));
|
|
295
|
-
function Ft({ children: e2, stylists: t2 = [] }) {
|
|
296
|
-
const r2 = Ot([Lt, ...t2]);
|
|
297
|
-
return k("div", { ...r2, children: e2 });
|
|
298
|
-
}
|
|
299
|
-
function Wt(e2) {
|
|
300
|
-
return `${e2.getFullYear()}-${String(e2.getMonth() + 1).padStart(2, "0")}-${String(e2.getDate()).padStart(2, "0")}`;
|
|
301
|
-
}
|
|
302
|
-
function Bt(e2, t2, r2) {
|
|
303
|
-
return new Date(e2, t2, r2);
|
|
304
|
-
}
|
|
305
|
-
function Ht(e2, t2) {
|
|
306
|
-
return Wt(Bt(t2, e2, 1));
|
|
307
|
-
}
|
|
308
|
-
const zt = { THIS_YEAR: "THIS_YEAR", THIS_MONTH: "THIS_MONTH", LAST_YEAR: "LAST_YEAR", LAST_MONTH: "LAST_MONTH", PAST_YEAR: "PAST_YEAR" };
|
|
309
|
-
const Vt = (e2) => {
|
|
310
|
-
switch (e2) {
|
|
311
|
-
case zt.THIS_YEAR:
|
|
312
|
-
return Wt(Bt((/* @__PURE__ */ new Date()).getFullYear(), 0, 1));
|
|
313
|
-
case zt.THIS_MONTH:
|
|
314
|
-
return function() {
|
|
315
|
-
const e3 = /* @__PURE__ */ new Date();
|
|
316
|
-
return Ht(e3.getMonth(), e3.getFullYear());
|
|
317
|
-
}();
|
|
318
|
-
case zt.LAST_YEAR:
|
|
319
|
-
return Wt(Bt((/* @__PURE__ */ new Date()).getFullYear() - 1, 0, 1));
|
|
320
|
-
case zt.LAST_MONTH:
|
|
321
|
-
return function() {
|
|
322
|
-
const e3 = /* @__PURE__ */ new Date();
|
|
323
|
-
return Wt(Bt(e3.getFullYear(), e3.getMonth() - 1, 1));
|
|
324
|
-
}();
|
|
325
|
-
case zt.PAST_YEAR:
|
|
326
|
-
return function() {
|
|
327
|
-
const e3 = /* @__PURE__ */ new Date();
|
|
328
|
-
return Wt(Bt(e3.getFullYear() - 1, e3.getMonth(), 1));
|
|
329
|
-
}();
|
|
330
|
-
default:
|
|
331
|
-
return "";
|
|
332
|
-
}
|
|
333
|
-
}, jt = (e2) => {
|
|
334
|
-
switch (e2) {
|
|
335
|
-
case zt.THIS_YEAR:
|
|
336
|
-
return Wt(Bt((/* @__PURE__ */ new Date()).getFullYear() + 1, 0, 0));
|
|
337
|
-
case zt.THIS_MONTH:
|
|
338
|
-
return function() {
|
|
339
|
-
const e3 = /* @__PURE__ */ new Date();
|
|
340
|
-
return Wt(Bt(e3.getFullYear(), e3.getMonth() + 1, 0));
|
|
341
|
-
}();
|
|
342
|
-
case zt.LAST_YEAR:
|
|
343
|
-
return Wt(Bt((/* @__PURE__ */ new Date()).getFullYear(), 0, 0));
|
|
344
|
-
case zt.PAST_YEAR:
|
|
345
|
-
case zt.LAST_MONTH:
|
|
346
|
-
return function() {
|
|
347
|
-
const e3 = /* @__PURE__ */ new Date();
|
|
348
|
-
return Wt(Bt(e3.getFullYear(), e3.getMonth(), 0));
|
|
349
|
-
}();
|
|
350
|
-
default:
|
|
351
|
-
return "";
|
|
352
|
-
}
|
|
353
|
-
}, qt = (e2) => {
|
|
354
|
-
return t2 = e2, Object.values(zt).includes(t2) ? { beginDate: Vt(e2), endDate: jt(e2) } : { beginDate: Wt((r2 = e2).beginDate), endDate: Wt(r2.endDate) };
|
|
355
|
-
var t2, r2;
|
|
356
|
-
}, Ut = ["SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"], Kt = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
|
|
357
|
-
function $t({ yearsBack: e2 = 10, startYear: t2 }) {
|
|
358
|
-
const r2 = t2 ?? (/* @__PURE__ */ new Date()).getFullYear(), n2 = [r2];
|
|
359
|
-
for (let t3 = r2 - 1; t3 >= r2 - e2; t3--) n2.push(t3);
|
|
360
|
-
return n2;
|
|
361
|
-
}
|
|
362
|
-
function Yt(e2, t2) {
|
|
363
|
-
return e2.toDateString() === t2.toDateString();
|
|
364
|
-
}
|
|
365
|
-
function Gt(e2) {
|
|
366
|
-
return Yt(e2, /* @__PURE__ */ new Date());
|
|
367
|
-
}
|
|
368
|
-
function Qt(e2, t2) {
|
|
369
|
-
const r2 = Bt(e2.getFullYear(), e2.getMonth(), e2.getDate()), n2 = Bt(t2.getFullYear(), t2.getMonth(), t2.getDate());
|
|
370
|
-
return r2.getTime() > n2.getTime();
|
|
371
|
-
}
|
|
372
|
-
function Xt(e2) {
|
|
373
|
-
if (!e2 || !(e2 instanceof Date) || isNaN(e2.getTime())) return "";
|
|
374
|
-
return `${String(e2.getMonth() + 1).padStart(2, "0")}/${String(e2.getDate()).padStart(2, "0")}/${e2.getFullYear()}`;
|
|
375
|
-
}
|
|
376
|
-
function Zt(e2, t2, r2) {
|
|
377
|
-
if (e2 < 1 || e2 > 12 || t2 < 1 || t2 > 31) return false;
|
|
378
|
-
const n2 = Bt(r2, e2 - 1, t2);
|
|
379
|
-
return !(n2.getFullYear() !== r2 || n2.getMonth() !== e2 - 1 || n2.getDate() !== t2);
|
|
380
|
-
}
|
|
381
|
-
function Jt(e2) {
|
|
382
|
-
if (!e2.trim()) return null;
|
|
383
|
-
const t2 = e2.match(/^(\d{1,2})\/(\d{1,2})\/(\d{1,4})$/);
|
|
384
|
-
if (!t2) return null;
|
|
385
|
-
const [, r2, n2, o2] = t2, a2 = parseInt(r2, 10), i2 = parseInt(n2, 10), l2 = parseInt(o2, 10);
|
|
386
|
-
return Zt(a2, i2, l2) ? Bt(l2, a2 - 1, i2) : null;
|
|
387
|
-
}
|
|
388
|
-
function er(e2) {
|
|
389
|
-
if (!e2.trim()) return null;
|
|
390
|
-
const t2 = e2.match(/^(\d{1,4})-(\d{1,2})-(\d{1,2})$/);
|
|
391
|
-
if (!t2) return null;
|
|
392
|
-
const [, r2, n2, o2] = t2, a2 = parseInt(r2, 10), i2 = parseInt(n2, 10), l2 = parseInt(o2, 10);
|
|
393
|
-
return Zt(i2, l2, a2) ? Bt(a2, i2 - 1, l2) : null;
|
|
394
|
-
}
|
|
395
|
-
function tr(e2) {
|
|
396
|
-
if (!e2 || !(e2 instanceof Date) || isNaN(e2.getTime())) return "";
|
|
397
|
-
return `${e2.getFullYear()}-${String(e2.getMonth() + 1).padStart(2, "0")}-${String(e2.getDate()).padStart(2, "0")}`;
|
|
398
|
-
}
|
|
399
|
-
const rr = (e2, t2) => {
|
|
400
|
-
const r2 = { month: t2.abbreviateMonth ? "short" : "long", year: t2.abbreviateYear ? "2-digit" : "numeric" };
|
|
401
|
-
return e2.toLocaleString("default", r2);
|
|
402
|
-
}, nr = (e2) => {
|
|
403
|
-
const t2 = new Date(e2 || ""), r2 = /* @__PURE__ */ new Date();
|
|
404
|
-
return Gt(t2) ? ((e3) => e3.toLocaleTimeString([], { hour: "numeric", minute: "2-digit" }))(t2) : t2.getFullYear() === r2.getFullYear() ? ((e3, t3) => e3.toLocaleString("default", { month: "short" }) + " " + e3.getDate())(t2) : rr(t2, { abbreviateMonth: true, abbreviateYear: false });
|
|
405
|
-
};
|
|
406
|
-
function or(e2, t2, r2) {
|
|
407
|
-
return [...e2, { accessToken: t2, environment: r2 }];
|
|
408
|
-
}
|
|
409
|
-
function ar(e2, t2) {
|
|
410
|
-
return [...e2, t2];
|
|
411
|
-
}
|
|
412
|
-
const ir = (e2) => null == e2, lr = (e2) => !ir(e2);
|
|
413
|
-
function sr(e2) {
|
|
414
|
-
return ir(e2) || function(e3) {
|
|
415
|
-
return "" === e3.trim();
|
|
416
|
-
}(e2);
|
|
417
|
-
}
|
|
418
|
-
function cr(e2) {
|
|
419
|
-
return !sr(e2);
|
|
420
|
-
}
|
|
421
|
-
const dr = h({ activeToken: void 0, accountantToken: void 0 });
|
|
422
|
-
function ur() {
|
|
423
|
-
const { activeToken: e2 } = g(dr);
|
|
424
|
-
return e2;
|
|
425
|
-
}
|
|
426
|
-
const hr = () => {
|
|
427
|
-
throw new Error("No access token provided");
|
|
428
|
-
}, gr = 72e5, pr = new E({ defaultOptions: { queries: { gcTime: gr, staleTime: 3e4, refetchInterval: 6e4 } } }), vr = h("SANDBOX");
|
|
429
|
-
function mr() {
|
|
430
|
-
return g(vr);
|
|
431
|
-
}
|
|
432
|
-
function br({ queryKey: e2, queryFn: t2, ...r2 }) {
|
|
433
|
-
const n2 = ur(), o2 = mr(), a2 = cr(n2), i2 = or(e2, n2 ?? "", o2), l2 = I(), s2 = P({ ...r2, queryKey: i2, queryFn: a2 ? t2 : hr, placeholderData: r2.keepPreviousDataPlaceholder ? A : void 0, ...a2 ? {} : { retry: false, staleTime: 1 / 0 } }, pr);
|
|
434
|
-
return { isRehydrating: l2, isFilling: l2 || s2.isLoading, query: s2 };
|
|
435
|
-
}
|
|
436
|
-
class fr {
|
|
437
|
-
constructor(e2) {
|
|
438
|
-
this.client = e2;
|
|
439
|
-
}
|
|
440
|
-
async sendEvent({ apiKey: e2, events: t2, notifier: r2, payloadVersion: n2 }) {
|
|
441
|
-
const o2 = (/* @__PURE__ */ new Date()).toISOString(), a2 = JSON.stringify({ apiKey: e2, payloadVersion: n2, notifier: r2, events: t2 });
|
|
442
|
-
await fetch(this.client.endpoints.notify, { method: "POST", mode: "cors", credentials: "omit", headers: { "Content-Type": "application/json", "Bugsnag-Api-Key": e2, "Bugsnag-Payload-Version": n2, "Bugsnag-Sent-At": o2 }, referrerPolicy: "no-referrer", body: a2 });
|
|
443
|
-
}
|
|
444
|
-
}
|
|
445
|
-
const yr = Symbol("Circular"), Tr = Symbol("AccessError");
|
|
446
|
-
function xr(e2, t2, r2) {
|
|
447
|
-
return wr({ key: "", value: e2, replacer: t2, seen: [], depth: 0, depthLimit: r2?.depthLimit, edgeIndex: 0, edgesLimit: r2?.edgesLimit });
|
|
448
|
-
}
|
|
449
|
-
function wr({ key: e2, value: t2, replacer: r2, seen: n2, depthLimit: o2 = 1 / 0, depth: a2, edgeIndex: i2, edgesLimit: l2 = 1 / 0 }) {
|
|
450
|
-
let s2 = t2;
|
|
451
|
-
if (n2.includes(s2) && (s2 = yr), r2 && (s2 = r2(e2, s2)), function(e3) {
|
|
452
|
-
return "object" == typeof e3 && null !== e3 && "toJSON" in e3 && "function" == typeof e3.toJSON;
|
|
453
|
-
}(s2) && (s2 = kr(() => s2.toJSON(String(e2)))), null === s2 || "object" != typeof s2) return s2;
|
|
454
|
-
if (a2 > o2 || i2 + 1 > l2) return "[...]";
|
|
455
|
-
if (n2.push(t2), Array.isArray(s2)) {
|
|
456
|
-
const e3 = [], t3 = Math.min(s2.length, l2);
|
|
457
|
-
for (let i3 = 0; i3 < t3; i3++) {
|
|
458
|
-
const t4 = kr(() => s2[i3]);
|
|
459
|
-
e3.push(wr({ key: i3, value: t4, replacer: r2, seen: n2, depth: a2, depthLimit: o2, edgeIndex: i3, edgesLimit: l2 }));
|
|
460
|
-
}
|
|
461
|
-
t3 < s2.length && e3.push("[...]"), s2 = e3;
|
|
462
|
-
} else {
|
|
463
|
-
const e3 = {}, t3 = Object.keys(s2);
|
|
464
|
-
for (let i3 = 0; i3 < t3.length; i3++) {
|
|
465
|
-
const c2 = t3[i3], d2 = kr(() => s2[c2]);
|
|
466
|
-
e3[c2] = wr({ key: c2, value: d2, replacer: r2, seen: n2, depth: a2, depthLimit: o2, edgeIndex: i3, edgesLimit: l2 });
|
|
467
|
-
}
|
|
468
|
-
s2 = e3;
|
|
469
|
-
}
|
|
470
|
-
return n2.pop(), s2;
|
|
471
|
-
}
|
|
472
|
-
function kr(e2) {
|
|
473
|
-
try {
|
|
474
|
-
return e2();
|
|
475
|
-
} catch {
|
|
476
|
-
return Tr;
|
|
477
|
-
}
|
|
478
|
-
}
|
|
479
|
-
const Cr = Object.prototype.toString, Sr = Object.getPrototypeOf, Er = "[object Error]";
|
|
480
|
-
function Ir(e2) {
|
|
481
|
-
return "object" == typeof e2 && null !== e2 && !Array.isArray(e2);
|
|
482
|
-
}
|
|
483
|
-
const Pr = /^\s*at .*(\S+:\d+|\(native\))/m, Ar = /^(eval@)?(\[native code])?$/;
|
|
484
|
-
function Dr(e2) {
|
|
485
|
-
const t2 = e2.match(Pr) ? function(e3) {
|
|
486
|
-
const t3 = e3.split("\n").filter((e4) => !!e4.match(Pr));
|
|
487
|
-
return t3.map((e4) => {
|
|
488
|
-
e4.indexOf("(eval ") > -1 && (e4 = e4.replace(/eval code/g, "eval").replace(/(\(eval at [^()]*)|(\),.*$)/g, ""));
|
|
489
|
-
let t4 = e4.replace(/^\s+/, "").replace(/\(eval code/g, "(");
|
|
490
|
-
const r2 = t4.match(/ (\((.+):(\d+):(\d+)\)$)/);
|
|
491
|
-
t4 = r2 ? t4.replace(r2[0], "") : t4;
|
|
492
|
-
const n2 = t4.split(/\s+/).slice(1), o2 = Mr(r2 ? r2[1] : n2.pop() || "(no location)"), a2 = n2.join(" ") || void 0;
|
|
493
|
-
return { file: ["eval", "<anonymous>"].indexOf(o2[0]) > -1 ? void 0 : o2[0], lineNumber: o2[1], columnNumber: o2[2], method: a2 };
|
|
494
|
-
});
|
|
495
|
-
}(e2) : function(e3) {
|
|
496
|
-
const t3 = e3.split("\n").filter((e4) => !e4.match(Ar));
|
|
497
|
-
return t3.map((e4) => {
|
|
498
|
-
if (e4.indexOf(" > eval") > -1 && (e4 = e4.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g, ":$1")), -1 === e4.indexOf("@") && -1 === e4.indexOf(":")) return { method: e4 };
|
|
499
|
-
{
|
|
500
|
-
const t4 = /((.*".+"[^@]*)?[^@]*)(?:@)/, r2 = e4.match(t4), n2 = r2 && r2[1] ? r2[1] : void 0, o2 = Mr(e4.replace(t4, ""));
|
|
501
|
-
return { file: o2[0], lineNumber: o2[1], columnNumber: o2[2], method: n2 };
|
|
502
|
-
}
|
|
503
|
-
});
|
|
504
|
-
}(e2);
|
|
505
|
-
return t2.reduce((e3, t3) => {
|
|
506
|
-
if ("{}" === JSON.stringify(t3)) return e3;
|
|
507
|
-
let r2 = t3.file || t3.method || "number" != typeof t3.lineNumber ? t3.file || "(unknown file)" : "global code";
|
|
508
|
-
r2 = r2.replace(/\?.*$/, "").replace(/#.*$/, "");
|
|
509
|
-
let n2 = t3.method || "(unknown function)";
|
|
510
|
-
return n2 = /^global code$/i.test(n2) ? "global code" : n2, e3.concat([{ file: r2, lineNumber: t3.lineNumber, columnNumber: t3.columnNumber, method: n2 }]);
|
|
511
|
-
}, []);
|
|
512
|
-
}
|
|
513
|
-
function Mr(e2) {
|
|
514
|
-
if (-1 === e2.indexOf(":")) return [e2];
|
|
515
|
-
const t2 = /(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e2.replace(/[()]/g, ""));
|
|
516
|
-
if (!t2) return [e2];
|
|
517
|
-
const r2 = t2[2] ? parseInt(t2[2], 10) : void 0, n2 = t2[3] ? parseInt(t2[3], 10) : void 0;
|
|
518
|
-
return [t2[1], r2, n2];
|
|
519
|
-
}
|
|
520
|
-
function Nr(e2, t2) {
|
|
521
|
-
const r2 = Rr(e2, t2);
|
|
522
|
-
let n2;
|
|
523
|
-
"InvalidError" === r2.name && (n2 = { [t2]: { "non-error parameter": e2 } }), void 0 !== r2.metadata && Ir(r2.metadata) && (n2 = { ...n2, [r2.name]: r2.metadata });
|
|
524
|
-
const o2 = [Or(r2)];
|
|
525
|
-
return o2.push(...Fr(r2).map((e3) => Or(e3, { backtrace: false }))), { exceptions: o2, metadata: n2 };
|
|
526
|
-
}
|
|
527
|
-
function Rr(e2, t2) {
|
|
528
|
-
if (function(e3) {
|
|
529
|
-
if (e3 instanceof Error) return true;
|
|
530
|
-
let t3 = e3;
|
|
531
|
-
for (; t3; ) {
|
|
532
|
-
if (Cr.call(t3) === Er) return true;
|
|
533
|
-
t3 = Sr(t3);
|
|
534
|
-
}
|
|
535
|
-
return false;
|
|
536
|
-
}(e2)) return e2;
|
|
537
|
-
let r2 = function(e3) {
|
|
538
|
-
if (!Ir(e3)) return null;
|
|
539
|
-
const t3 = (t4) => {
|
|
540
|
-
const r4 = e3[t4];
|
|
541
|
-
if ("string" == typeof r4 && e3[t4.length]) return r4;
|
|
542
|
-
}, r3 = t3("name") || t3("errorClass"), n2 = t3("message") || t3("errorMessage");
|
|
543
|
-
if (!r3 || !n2) return null;
|
|
544
|
-
const o2 = new Error(n2);
|
|
545
|
-
return o2.name = r3, o2;
|
|
546
|
-
}(e2);
|
|
547
|
-
if (r2) return r2;
|
|
548
|
-
switch (typeof r2) {
|
|
549
|
-
case "string":
|
|
550
|
-
case "number":
|
|
551
|
-
case "boolean":
|
|
552
|
-
return new Error(String(e2));
|
|
553
|
-
default:
|
|
554
|
-
return r2 = new Error(`${t2} received a non-error. See "${t2}" tab for more detail.`), r2.name = "InvalidError", r2;
|
|
555
|
-
}
|
|
556
|
-
}
|
|
557
|
-
function Or(e2, t2 = { backtrace: false }) {
|
|
558
|
-
return { errorClass: e2.name, message: e2.message, stacktrace: _r(e2, t2), type: "object" == typeof self && self.navigator ? "browserjs" : "nodejs" };
|
|
559
|
-
}
|
|
560
|
-
function _r(e2, { backtrace: t2 }) {
|
|
561
|
-
const r2 = function(e3) {
|
|
562
|
-
let t3 = e3.stack;
|
|
563
|
-
if (void 0 === t3) {
|
|
564
|
-
t3 = e3.stacktrace;
|
|
565
|
-
}
|
|
566
|
-
return "string" == typeof t3 && t3.length && t3 !== `${e3.name}: ${e3.message}` ? t3 : void 0;
|
|
567
|
-
}(e2);
|
|
568
|
-
return r2 ? Dr(r2) : t2 ? function() {
|
|
569
|
-
const e3 = [];
|
|
570
|
-
let t3;
|
|
571
|
-
try {
|
|
572
|
-
t3 = arguments.callee;
|
|
573
|
-
} catch {
|
|
574
|
-
return [];
|
|
575
|
-
}
|
|
576
|
-
for (; t3 && e3.length < Lr; ) {
|
|
577
|
-
t3.name ? e3.push({ method: t3.name, file: "(unknown file)" }) : /function(?:\s+([\w$]+))+\s*\(/.test(t3.toString()) && e3.push({ method: RegExp.$1, file: "(unknown file)" });
|
|
578
|
-
try {
|
|
579
|
-
t3 = t3.caller;
|
|
580
|
-
} catch {
|
|
581
|
-
break;
|
|
582
|
-
}
|
|
583
|
-
}
|
|
584
|
-
return e3;
|
|
585
|
-
}() : [];
|
|
586
|
-
}
|
|
587
|
-
const Lr = 20;
|
|
588
|
-
function Fr(e2) {
|
|
589
|
-
const t2 = e2;
|
|
590
|
-
if (t2.cause) {
|
|
591
|
-
const e3 = Rr(t2.cause, "cause");
|
|
592
|
-
return "InvalidError" === e3.name ? [] : [e3].concat(Fr(e3));
|
|
593
|
-
}
|
|
594
|
-
return [];
|
|
595
|
-
}
|
|
596
|
-
function Wr(...e2) {
|
|
597
|
-
console.error;
|
|
598
|
-
}
|
|
599
|
-
const Br = { name: "errorBreadcrumbs", load(e2) {
|
|
600
|
-
e2.addOnPostError((t2) => {
|
|
601
|
-
e2.leaveBreadcrumb(t2.exceptions[0].errorClass, { errorClass: t2.exceptions[0].errorClass, errorMessage: t2.exceptions[0].message, severity: t2.severity }, "error");
|
|
602
|
-
});
|
|
603
|
-
} };
|
|
604
|
-
let Hr = Date.now();
|
|
605
|
-
const zr = () => {
|
|
606
|
-
Hr = Date.now();
|
|
607
|
-
}, Vr = { name: "appDuration", load: (e2) => (e2.addOnError((e3) => {
|
|
608
|
-
const t2 = Date.now();
|
|
609
|
-
return e3.app = e3.app || {}, e3.app.duration = t2 - Hr, true;
|
|
610
|
-
}), { reset: zr }) };
|
|
611
|
-
const jr = [["Edge (EdgeHTML)", /Edge\/([0-9._]+)/], ["Edge (iOS)", /EdgiOS\/([0-9._]+)/], ["Yandex", /YaBrowser\/([0-9._]+)/], ["KakaoTalk", /KAKAOTALK\s([0-9.]+)/], ["Samsung", /SamsungBrowser\/([0-9.]+)/], ["Silk", /\bSilk\/([0-9._-]+)\b/], ["MIUI", /MiuiBrowser\/([0-9.]+)$/], ["Beaker", /BeakerBrowser\/([0-9.]+)/], ["Edge (Chromium)", /EdgA?\/([0-9.]+)/], ["Chromium WebView", /(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9.]+)(:?\s|$)/], ["Chrome", /(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9.]+)(:?\s|$)/], ["Chrome (iOS)", /CriOS\/([0-9.]+)(:?\s|$)/], ["Firefox", /Firefox\/([0-9.]+)(?:\s|$)/], ["Firefox (iOS)", /FxiOS\/([0-9.]+)/], ["Opera Mini", /Opera Mini.*Version\/([0-9.]+)/], ["Opera", /Opera\/([0-9.]+)(?:\s|$)/], ["Opera", /OPR\/([0-9.]+)(:?\s|$)/], ["Internet Explorer", /Trident\/7\.0.*rv:([0-9.]+).*\).*Gecko$/], ["Internet Explorer", /MSIE\s([0-9.]+);.*Trident\/[4-7].0/], ["Internet Explorer", /MSIE\s(7\.0)/], ["Blackberry", /BB10;\sTouch.*Version\/([0-9.]+)/], ["Android", /Android\s([0-9.]+)/], ["Safari (iOS)", /Version\/([0-9._]+).*Mobile.*Safari.*/], ["Safari", /Version\/([0-9._]+).*Safari/], ["Facebook", /FB[AS]V\/([0-9.]+)/], ["Instagram", /Instagram\s([0-9.]+)/], ["iOS WebView", /AppleWebKit\/([0-9.]+).*Mobile/], ["iOS WebView", /AppleWebKit\/([0-9.]+).*Gecko\)$/]];
|
|
612
|
-
const qr = [["iOS", void 0, /iP(hone|od|ad)/], ["Android", void 0, /Android/], ["BlackBerry", void 0, /BlackBerry|BB10/], ["Windows Mobile", void 0, /IEMobile/], ["Kindle", void 0, /Kindle/], ["Windows", "3.11", /Win16/], ["Windows", "95", /(Windows 95)|(Win95)|(Windows_95)/], ["Windows", "98", /(Windows 98)|(Win98)/], ["Windows", "2000", /(Windows NT 5.0)|(Windows 2000)/], ["Windows", "XP", /(Windows NT 5.1)|(Windows XP)/], ["Windows", "Server 2003", /(Windows NT 5.2)/], ["Windows", "Vista", /(Windows NT 6.0)/], ["Windows", "7", /(Windows NT 6.1)/], ["Windows", "8", /(Windows NT 6.2)/], ["Windows", "8.1", /(Windows NT 6.3)/], ["Windows", "10+", /(Windows NT 10.0)/], ["Windows", "ME", /Windows ME/], ["Open BSD", void 0, /OpenBSD/], ["Sun OS", void 0, /SunOS/], ["Chrome OS", void 0, /CrOS/], ["Linux", void 0, /(Linux)|(X11)/], ["Mac OS", void 0, /(Mac_PowerPC)|(Macintosh)/], ["QNX", void 0, /QNX/], ["BeOS", void 0, /BeOS/], ["OS/2", void 0, /OS\/2/]];
|
|
613
|
-
const Ur = (Kr = function(e2) {
|
|
614
|
-
const t2 = function(e3) {
|
|
615
|
-
return "" !== e3 && jr.reduce((t3, [r3, n3]) => {
|
|
616
|
-
if (t3) return t3;
|
|
617
|
-
const o3 = n3.exec(e3);
|
|
618
|
-
return !!o3 && [r3, o3];
|
|
619
|
-
}, false);
|
|
620
|
-
}(e2);
|
|
621
|
-
if (!t2) return {};
|
|
622
|
-
const [r2, n2] = t2, o2 = function(e3) {
|
|
623
|
-
for (const [t3, r3, n3] of qr) if (n3.exec(e3)) return { osName: t3, osVersion: r3 };
|
|
624
|
-
return null;
|
|
625
|
-
}(e2), a2 = "iOS" === o2?.osName ? function(e3) {
|
|
626
|
-
const t3 = /iPad|iPhone|iPod/.exec(e3);
|
|
627
|
-
return t3 ? { manufacturer: "Apple", model: t3[0] } : /MacIntel/.test(e3) && self.navigator && self.navigator.maxTouchPoints && self.navigator.maxTouchPoints > 2 ? { manufacturer: "Apple", model: "iPad" } : null;
|
|
628
|
-
}(e2) : {};
|
|
629
|
-
return { browserName: r2, browserVersion: n2[1], osName: o2?.osName, osVersion: o2?.osVersion, manufacturer: a2?.manufacturer, model: a2?.model };
|
|
630
|
-
}, { name: "browserContext", load(e2) {
|
|
631
|
-
e2.addOnError((e3) => {
|
|
632
|
-
e3.request = { ...e3.request, url: self.location.href }, e3.context = e3.context || self.location.pathname, e3.device = { ...e3.device, ...Kr(self.navigator.userAgent), locale: self.navigator.language, userAgent: self.navigator.userAgent };
|
|
633
|
-
let t2 = ["n/a"];
|
|
634
|
-
try {
|
|
635
|
-
t2 = self.navigator.languages;
|
|
636
|
-
} catch {
|
|
637
|
-
}
|
|
638
|
-
return e3.metaData = { ...e3.metaData, language: { language: self.navigator.language, languages: t2 } }, true;
|
|
639
|
-
});
|
|
640
|
-
} });
|
|
641
|
-
var Kr;
|
|
642
|
-
class $r {
|
|
643
|
-
limit;
|
|
644
|
-
period;
|
|
645
|
-
events;
|
|
646
|
-
constructor(e2, t2) {
|
|
647
|
-
this.limit = e2, this.period = t2, this.events = new M();
|
|
648
|
-
}
|
|
649
|
-
reset() {
|
|
650
|
-
this.events.clear();
|
|
651
|
-
}
|
|
652
|
-
increment() {
|
|
653
|
-
const e2 = (/* @__PURE__ */ new Date()).getTime();
|
|
654
|
-
if (void 0 !== this.period) {
|
|
655
|
-
let t3 = this.events.peek();
|
|
656
|
-
for (; void 0 !== t3 && e2 - this.period > t3; ) this.events.dequeue(), t3 = this.events.peek();
|
|
657
|
-
}
|
|
658
|
-
const t2 = this.events.size + 1 <= this.limit;
|
|
659
|
-
return t2 && this.events.enqueue(e2), t2;
|
|
660
|
-
}
|
|
661
|
-
get size() {
|
|
662
|
-
return this.events.size;
|
|
663
|
-
}
|
|
664
|
-
}
|
|
665
|
-
class Yr extends p {
|
|
666
|
-
constructor(e2) {
|
|
667
|
-
super(e2), this.state = { error: void 0, errorInfo: void 0 };
|
|
668
|
-
}
|
|
669
|
-
handleClearError() {
|
|
670
|
-
this.setState({ error: void 0, errorInfo: void 0 });
|
|
671
|
-
}
|
|
672
|
-
static getDerivedStateFromError(e2) {
|
|
673
|
-
return { error: e2 };
|
|
674
|
-
}
|
|
675
|
-
componentDidCatch(e2, t2) {
|
|
676
|
-
const { exceptions: r2, metadata: n2 } = Nr(e2, "notify");
|
|
677
|
-
t2 && t2.componentStack && (t2.componentStack = function(e3) {
|
|
678
|
-
const t3 = e3.split(/\s*\n\s*/g);
|
|
679
|
-
let r3 = "";
|
|
680
|
-
for (let e4 = 0, n3 = t3.length; e4 < n3; e4++) t3[e4].length && (r3 += `${r3.length ? "\n" : ""}${t3[e4]}`);
|
|
681
|
-
return r3;
|
|
682
|
-
}(t2.componentStack));
|
|
683
|
-
const { onError: o2, client: a2 } = this.props;
|
|
684
|
-
a2.notifyEvent({ exceptions: r2, unhandled: true, severity: "error", severityReason: { type: "unhandledException" }, metadata: { ...n2, react: t2 }, onError: o2 }, e2), this.setState({ errorInfo: t2 });
|
|
685
|
-
}
|
|
686
|
-
render() {
|
|
687
|
-
const { error: e2 } = this.state;
|
|
688
|
-
if (e2) {
|
|
689
|
-
const { FallbackComponent: e3 } = this.props;
|
|
690
|
-
if (e3) return k(e3, { error: this.state.error, errorInfo: this.state.errorInfo, clearError: () => this.handleClearError() });
|
|
691
|
-
}
|
|
692
|
-
return k(C, { children: this.props.children });
|
|
693
|
-
}
|
|
694
|
-
}
|
|
695
|
-
const Gr = { name: "react", load: (e2) => ({ BugsnagErrorBoundary: ({ onError: t2, fallbackComponent: r2, children: n2 }) => k(Yr, { client: e2, onError: t2, FallbackComponent: r2, children: n2 }) }) };
|
|
696
|
-
const Qr = new class {
|
|
697
|
-
breadcrumbs = [];
|
|
698
|
-
config;
|
|
699
|
-
delivery = new fr(this);
|
|
700
|
-
errorCallbacks = /* @__PURE__ */ new Set();
|
|
701
|
-
postErrorCallbacks = /* @__PURE__ */ new Set();
|
|
702
|
-
plugins = [];
|
|
703
|
-
start(e2) {
|
|
704
|
-
if (this.config) return Wr(), this;
|
|
705
|
-
let t2;
|
|
706
|
-
this.config = e2, this.config.onError && (t2 = Array.isArray(this.config.onError) ? this.config.onError : [this.config.onError]), this.errorCallbacks = new Set(t2);
|
|
707
|
-
for (const e3 of this.config.plugins || []) this.plugins.push({ name: e3.name || "unknown", plugin: e3.load(this) });
|
|
708
|
-
return this;
|
|
709
|
-
}
|
|
710
|
-
get endpoints() {
|
|
711
|
-
return { notify: this.config?.endpoints?.notify || "https://notify.bugsnag.com/" };
|
|
712
|
-
}
|
|
713
|
-
notify(e2, t2 = {}) {
|
|
714
|
-
const { exceptions: r2, metadata: n2 } = Nr(e2, "notify");
|
|
715
|
-
let o2, a2, i2 = n2;
|
|
716
|
-
return "function" == typeof t2 ? o2 = t2 : (a2 = t2.severity, t2.metadata && (i2 = { ...n2, ...t2.metadata })), this.notifyEvent({ exceptions: r2, metadata: i2, severity: a2, onError: o2 }, e2);
|
|
717
|
-
}
|
|
718
|
-
leaveBreadcrumb(e2, t2, r2) {
|
|
719
|
-
if (!this.config) return;
|
|
720
|
-
if ("string" != typeof e2) try {
|
|
721
|
-
e2 = String(e2);
|
|
722
|
-
} catch {
|
|
723
|
-
e2 = "Unable to stringify breadcrumb message";
|
|
724
|
-
}
|
|
725
|
-
if (!e2.length) return;
|
|
726
|
-
this.breadcrumbs.push({ name: e2, metaData: t2, type: r2 || "manual", timestamp: (/* @__PURE__ */ new Date()).toISOString() });
|
|
727
|
-
const { maxBreadcrumbs: n2 = 25 } = this.config;
|
|
728
|
-
this.breadcrumbs.length > n2 && this.breadcrumbs.splice(0, this.breadcrumbs.length - n2);
|
|
729
|
-
}
|
|
730
|
-
async notifyEvent({ exceptions: e2, unhandled: t2, severity: r2, severityReason: n2, metadata: o2, onError: a2 }, i2) {
|
|
731
|
-
if (!this.config) return;
|
|
732
|
-
const l2 = this.config.releaseStage || "production";
|
|
733
|
-
if (this.config.enabledReleaseStages && !this.config.enabledReleaseStages.includes(l2)) return;
|
|
734
|
-
const s2 = { exceptions: e2, breadcrumbs: this.breadcrumbs.length ? this.breadcrumbs : void 0, originalError: i2, unhandled: "boolean" == typeof t2 && t2, severity: r2 || "warning", severityReason: n2, user: this.config.user || void 0, app: { releaseStage: l2, version: this.config.appVersion, type: this.config.appType || ("object" == typeof window ? "browser" : "node") }, device: { time: (/* @__PURE__ */ new Date()).toISOString() }, metaData: o2 || {} }, c2 = [...this.errorCallbacks];
|
|
735
|
-
a2 && c2.push(a2);
|
|
736
|
-
const d2 = ["stringifyValues", "redact"];
|
|
737
|
-
c2.sort((e3, t3) => d2.includes(e3.name) && d2.includes(t3.name) ? 0 : d2.includes(e3.name) ? 1 : d2.includes(t3.name) ? -1 : 0);
|
|
738
|
-
for (const e3 of c2) {
|
|
739
|
-
const t3 = await e3(s2);
|
|
740
|
-
if ("boolean" == typeof t3 && !t3) return;
|
|
741
|
-
}
|
|
742
|
-
const u2 = xr(s2, (e3, t3) => {
|
|
743
|
-
if ("originalError" !== e3) return t3;
|
|
744
|
-
}, { depthLimit: 20, edgesLimit: 500 });
|
|
745
|
-
let h2;
|
|
746
|
-
const g2 = { apiKey: this.config.apiKey, payloadVersion: "5", notifier: { name: "Tight Components", version: "1", url: "https://github.com/Hurdlr/TraxComponents/tree/dev/src/bugsnag/README.md" }, events: [u2] };
|
|
747
|
-
try {
|
|
748
|
-
h2 = JSON.stringify(g2);
|
|
749
|
-
} catch {
|
|
750
|
-
u2.metaData = { notifier: "Unable to serialize metadata" }, h2 = JSON.stringify(g2);
|
|
751
|
-
}
|
|
752
|
-
if (h2.length > 1e6 && (u2.metaData = { notifier: `Payload was ${h2.length / 1e6}Mb. Metadata removed.` }, h2 = JSON.stringify(g2), h2.length > 1e6)) throw new Error("Payload exceeded 1Mb limit");
|
|
753
|
-
for (const e3 of this.postErrorCallbacks) e3(s2);
|
|
754
|
-
try {
|
|
755
|
-
await this.delivery.sendEvent(g2);
|
|
756
|
-
} catch (e3) {
|
|
757
|
-
Wr();
|
|
758
|
-
}
|
|
759
|
-
}
|
|
760
|
-
getUser() {
|
|
761
|
-
return this.config?.user || {};
|
|
762
|
-
}
|
|
763
|
-
setUser(e2, t2, r2) {
|
|
764
|
-
this.config && (this.config.user = { id: e2, email: t2, name: r2 });
|
|
765
|
-
}
|
|
766
|
-
setProperties(e2) {
|
|
767
|
-
this.config && (this.config.releaseStage = e2);
|
|
768
|
-
}
|
|
769
|
-
addOnError(e2) {
|
|
770
|
-
this.errorCallbacks.add(e2);
|
|
771
|
-
}
|
|
772
|
-
removeOnError(e2) {
|
|
773
|
-
this.errorCallbacks.delete(e2);
|
|
774
|
-
}
|
|
775
|
-
addOnPostError(e2) {
|
|
776
|
-
this.postErrorCallbacks.add(e2);
|
|
777
|
-
}
|
|
778
|
-
removeOnPostError(e2) {
|
|
779
|
-
this.postErrorCallbacks.delete(e2);
|
|
780
|
-
}
|
|
781
|
-
getPlugin(e2) {
|
|
782
|
-
return this.plugins.find((t2) => t2.name === e2)?.plugin;
|
|
783
|
-
}
|
|
784
|
-
setDelivery(e2) {
|
|
785
|
-
this.delivery = e2;
|
|
786
|
-
}
|
|
787
|
-
}();
|
|
788
|
-
let Xr = "";
|
|
789
|
-
const Zr = "prod", Jr = Qr.start({ apiKey: "899aec02393ac236377b73b483800d2c", appVersion: "1.0.1", appType: "browser", releaseStage: Zr, plugins: [Vr, Ur, Br, ((e2, t2) => {
|
|
790
|
-
const r2 = new $r(e2, t2);
|
|
791
|
-
return "undefined" != typeof window && window.addEventListener("popstate", r2.reset), { name: "limitEvents", load: (e3) => (e3.addOnError(function() {
|
|
792
|
-
return r2.increment();
|
|
793
|
-
}), { reset: r2.reset }) };
|
|
794
|
-
})(15, 1e3), Gr] }), en = (e2, t2) => {
|
|
795
|
-
try {
|
|
796
|
-
Qr.leaveBreadcrumb(e2, t2);
|
|
797
|
-
} catch (e3) {
|
|
798
|
-
e3 instanceof Error ? tn({ error: e3, severity: "error" }) : tn({ error: new Error("Unknown error in logging.breadcrumb"), severity: "error", extraData: { originalError: e3 } });
|
|
799
|
-
}
|
|
800
|
-
}, tn = async (e2) => {
|
|
801
|
-
try {
|
|
802
|
-
await Qr.notify(e2.error, (t2) => (t2.severity = e2.severity, e2.groupingHash && (t2.groupingHash = e2.groupingHash), t2.metaData = { ...t2.metaData, custom: { ...e2.extraData, accessToken: "", environment: Xr } }, true)), e2.error, e2.error.message, e2.extraData, console.warn;
|
|
803
|
-
} catch (e3) {
|
|
804
|
-
e3 instanceof Error ? await tn({ error: e3, severity: "error" }) : await tn({ error: new Error("Unknown error in logging.notify"), severity: "error", extraData: { originalError: e3 } });
|
|
805
|
-
}
|
|
806
|
-
}, rn = Jr.getPlugin("react"), nn = rn?.BugsnagErrorBoundary, on = { GET: "GET", POST: "POST", DELETE: "DELETE" }, an = "include", ln = (e2, t2) => `${encodeURIComponent(e2)}=${encodeURIComponent(t2)}`, sn = ({ url: e2, params: t2 }) => {
|
|
807
|
-
let r2 = e2;
|
|
808
|
-
const n2 = ((e3) => null == e3 ? "" : Object.entries(e3).map(([e4, t3]) => {
|
|
809
|
-
let r3;
|
|
810
|
-
return r3 = Array.isArray(t3) ? t3.map((t4) => ln(e4, t4)).join("&") : ln(e4, t3), r3;
|
|
811
|
-
}).join("&"))(t2);
|
|
812
|
-
return "" !== n2 && (r2 += `?${n2}`), r2;
|
|
813
|
-
}, cn = ({ accessToken: e2, extraHeaders: t2 }) => {
|
|
814
|
-
const r2 = { Accept: "application/json", "Content-Type": "application/json", Authorization: `Bearer ${e2}` };
|
|
815
|
-
if (void 0 !== t2) {
|
|
816
|
-
return { ...o(t2, (e3) => `${e3}`), ...r2 };
|
|
817
|
-
}
|
|
818
|
-
return r2;
|
|
819
|
-
}, dn = ({ extraHeaders: e2, authorization: t2 }) => {
|
|
820
|
-
const r2 = { ...e2 };
|
|
821
|
-
return void 0 !== t2 && (r2.Authorization = t2), r2;
|
|
822
|
-
}, un = async (e2) => {
|
|
823
|
-
const t2 = await e2.json();
|
|
824
|
-
return e2.ok ? t2 : Promise.reject(t2);
|
|
825
|
-
}, hn = (e2, t2) => (void 0 !== t2 && Object.entries(t2).forEach(([t3, r2]) => {
|
|
826
|
-
e2 = e2.replace(`{${t3}}`, r2);
|
|
827
|
-
}), e2), gn = (e2) => an, pn = { "hurdlr-cache-session": true, "hurdlr-auto-refresh-token": true };
|
|
828
|
-
function vn(e2) {
|
|
829
|
-
const t2 = cn({ accessToken: e2.accessToken, extraHeaders: { ...e2.extraHeaders, ...e2.pagination, ..."v5" === e2.endpointManager.apiVersion ? pn : {} } }), r2 = e2.endpointManager.getUrl(e2.path);
|
|
830
|
-
return { url: hn(r2, e2.pathParams), headers: t2 };
|
|
831
|
-
}
|
|
832
|
-
async function mn({ authorization: e2, extraHeaders: t2, includeCredentials: r2, method: n2 = on.POST, params: o2, url: a2 }) {
|
|
833
|
-
const i2 = dn({ extraHeaders: t2, authorization: e2 }), l2 = gn();
|
|
834
|
-
en("HTTP POST Request", { url: a2, accessToken: e2 });
|
|
835
|
-
try {
|
|
836
|
-
const e3 = await fetch(a2, { method: n2, headers: i2, credentials: l2, body: JSON.stringify(o2) });
|
|
837
|
-
return en("HTTP POST Response", { url: a2, status: e3.status, statusText: e3.statusText }), un(e3);
|
|
838
|
-
} catch (e3) {
|
|
839
|
-
return Promise.reject(e3);
|
|
840
|
-
}
|
|
841
|
-
}
|
|
842
|
-
async function bn(e2) {
|
|
843
|
-
const { url: t2, headers: r2 } = vn(e2);
|
|
844
|
-
return mn({ url: t2, params: e2.bodyParams, includeCredentials: true, extraHeaders: r2 });
|
|
845
|
-
}
|
|
846
|
-
async function fn(e2) {
|
|
847
|
-
return bn(e2);
|
|
848
|
-
}
|
|
849
|
-
async function yn(e2) {
|
|
850
|
-
return bn(e2);
|
|
851
|
-
}
|
|
852
|
-
const Tn = (e2, t2) => ({ getUrl: (t3) => ((e3, t4) => {
|
|
853
|
-
let r2 = t4;
|
|
854
|
-
for (; r2.length > 0 && "/" === r2.charAt(0); ) r2 = r2.slice(1);
|
|
855
|
-
return `${e3}/${r2}`;
|
|
856
|
-
})(e2, t3), baseUrl: e2, apiVersion: t2 }), xn = { DEVELOPMENT: "https://dev.hurdlr.com/rest", PRODUCTION: "https://prod.hurdlr.com/rest", SANDBOX: "https://sandbox.hurdlr.com/rest", LOCAL: "http://localhost:8081/TraxAngular/rest" }, wn = { DEVELOPMENT: "https://dev.tight.com", PRODUCTION: "https://prod.tight.com", SANDBOX: "https://sandbox.tight.com", LOCAL: "http://localhost:8080" };
|
|
857
|
-
function kn(e2) {
|
|
858
|
-
return Tn(`${function(e3) {
|
|
859
|
-
return xn[e3];
|
|
860
|
-
}(e2)}/v5`, "v5");
|
|
861
|
-
}
|
|
862
|
-
const Cn = { of: ({ filter: e2, grouping: t2 }) => ["reports", "profitAndLoss", { filter: e2, ...t2 && { grouping: t2 } }] }, Sn = async (e2) => {
|
|
863
|
-
const t2 = e2.queryKey, r2 = t2[2], n2 = t2[3].accessToken, o2 = t2[3].environment, a2 = { path: "/reports/profitAndLoss", bodyParams: { exportType: "JSON", ...qt(r2.filter), ...r2.grouping && { grouping: r2.grouping } }, accessToken: n2, endpointManager: kn(o2) };
|
|
864
|
-
return await yn(a2);
|
|
865
|
-
};
|
|
866
|
-
function En({ filter: e2, grouping: t2, select: r2 }) {
|
|
867
|
-
return br({ queryKey: Cn.of({ filter: e2, grouping: t2 }), queryFn: Sn, select: r2 });
|
|
868
|
-
}
|
|
869
|
-
const In = 0.03, Pn = 3, An = { income: "income", expenses: "expenses", profit: "profit", loss: "loss", netIncome: "netIncome", noDataHeight: "noDataHeight" };
|
|
870
|
-
function Dn(e2) {
|
|
871
|
-
const t2 = function(e3) {
|
|
872
|
-
const t3 = er(e3 ?? "");
|
|
873
|
-
return null !== t3 ? rr(t3, { abbreviateMonth: true, abbreviateYear: true }) : "";
|
|
874
|
-
}(e2.period?.beginDate), r2 = e2.netIncome ?? 0, { profit: n2, remainingIncome: o2, loss: a2, remainingExpenses: i2 } = function(e3, t3, r3) {
|
|
875
|
-
const n3 = e3 > 0 ? e3 : 0, o3 = e3 < 0 ? e3 : 0;
|
|
876
|
-
return { profit: n3, remainingIncome: void 0 !== t3 ? N(t3).minus(n3).toNumber() : 0, loss: o3, remainingExpenses: void 0 !== r3 ? N(r3).plus(o3).toNumber() : 0 };
|
|
877
|
-
}(r2, e2.income?.total, e2.expenses?.total), l2 = /* @__PURE__ */ function(e3, t3, r3) {
|
|
878
|
-
return 0 === e3 && 0 === t3 && 0 === r3;
|
|
879
|
-
}(r2, o2, i2);
|
|
880
|
-
return { month: { month: t2, income: o2, expenses: -i2, profit: n2, loss: a2, netIncome: r2, hasNoData: l2 }, netIncome: r2 };
|
|
881
|
-
}
|
|
882
|
-
function Mn(e2) {
|
|
883
|
-
const t2 = { total: 0, domain: [], months: [], hasAnyData: false };
|
|
884
|
-
if ("FAILURE_NO_DATA" === e2.result) return t2;
|
|
885
|
-
const r2 = e2.json?.data;
|
|
886
|
-
if (ir(r2)) return t2;
|
|
887
|
-
for (const e3 of r2) {
|
|
888
|
-
const { month: r3, netIncome: n3 } = Dn(e3);
|
|
889
|
-
t2.total = N(n3).plus(t2.total).toNumber(), t2.months.push(r3);
|
|
890
|
-
}
|
|
891
|
-
const { domainMin: n2, domainMax: o2 } = function(e3) {
|
|
892
|
-
return e3.reduce((e4, t3) => ({ domainMin: Math.min(e4.domainMin, -(t3.expenses?.total ?? 0)), domainMax: Math.max(e4.domainMax, t3.income?.total ?? 0) }), { domainMin: 0, domainMax: 0 });
|
|
893
|
-
}(r2);
|
|
894
|
-
t2.domain = [n2, o2], t2.hasAnyData = t2.months.some((e3) => !e3.hasNoData);
|
|
895
|
-
const a2 = function(e3, t3) {
|
|
896
|
-
const r3 = t3 - e3;
|
|
897
|
-
return r3 > 0 ? r3 * In : Pn;
|
|
898
|
-
}(n2, o2);
|
|
899
|
-
return t2.months = t2.months.map((e3) => e3.hasNoData ? { ...e3, noDataHeight: a2 } : e3), t2;
|
|
900
|
-
}
|
|
901
|
-
const Nn = { MONTHLY: "MONTHLY" }, Rn = At(kt["tile-header"], ft({ backgroundColor: "surface.foreground", border: "{borderWidths.lg} solid {colors.border.layout.strong}", borderTopRadius: "lg", display: "flex", justifyContent: "space-between", alignItems: "center", padding: "15px" }));
|
|
902
|
-
function On({ title: e2 }) {
|
|
903
|
-
return k("div", { ...Rn, children: k(Ft, { children: e2 }) });
|
|
904
|
-
}
|
|
905
|
-
const _n = At(kt["tile-body"], ft({ display: "flex", justifyContent: "start", alignItems: "start", flexDirection: "column", gap: "20px", height: "100%", padding: "20px 15px", backgroundColor: "surface.foreground", border: "{borderWidths.lg} solid {colors.border.layout.strong}", borderBottomRadius: "lg", borderTop: "hidden" }));
|
|
906
|
-
function Ln({ children: e2 }) {
|
|
907
|
-
return k("div", { ..._n, children: e2 });
|
|
908
|
-
}
|
|
909
|
-
const Fn = wt({ base: { display: "flex", flexDirection: "column", boxShadow: "box-shadow", transition: "height 0.5s, width 0.5s", position: "relative" }, variants: { type: { default: { width: "400px", flexShrink: 0, height: "300px" }, chart: { minWidth: "900px", maxWidth: "1440px", height: "481px" } }, isSample: { true: { pointerEvents: "none" }, false: {} } }, defaultVariants: { type: "default" } });
|
|
910
|
-
function Wn({ children: e2, type: t2, isSample: r2 = false }) {
|
|
911
|
-
const n2 = At(kt.tile, Fn({ type: t2, isSample: r2 }));
|
|
912
|
-
return k("div", { ...n2, children: e2 });
|
|
913
|
-
}
|
|
914
|
-
const Bn = ft({ overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }), Hn = ft.raw({ overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }), zn = ft({ fontSize: "sm", fontStyle: "normal", fontWeight: "sm", lineHeight: "12px", letterSpacing: "0.66px" }), Vn = At(kt.text, ft({ fontSize: "md", fontWeight: "sm", color: "typography.base", fontStyle: "normal", letterSpacing: "0.84px", maxWidth: "100%" }), Bn);
|
|
915
|
-
function jn({ children: e2 }) {
|
|
916
|
-
return k("div", { ...Vn, children: e2 });
|
|
917
|
-
}
|
|
918
|
-
const qn = At(kt["metric-xl"], _t({ metric: "xl" }));
|
|
919
|
-
function Un(e2) {
|
|
920
|
-
return k("div", { ...qn, children: e2.children });
|
|
921
|
-
}
|
|
922
|
-
const Kn = At(kt.summation, ft({ display: "flex", flexDirection: "column", flexShrink: 1, alignItems: "flex-start", justifyContent: "space-between" }));
|
|
923
|
-
function $n({ title: e2, label: t2 }) {
|
|
924
|
-
return S("div", { ...Kn, children: [k(Un, { children: e2 }), k(jn, { children: t2 })] });
|
|
925
|
-
}
|
|
926
|
-
const Yn = At(null, ft({ display: "flex", flexDirection: "column", justifyContent: "space-evenly", alignItems: "start", height: "100%", width: "100%" }));
|
|
927
|
-
function Gn({ children: e2 }) {
|
|
928
|
-
return k("div", { ...Yn, children: e2 });
|
|
929
|
-
}
|
|
930
|
-
const Qn = (e2) => Math.sign(e2) * Math.floor(Math.abs(e2)), Xn = (e2, t2 = 0) => {
|
|
931
|
-
const r2 = Math.abs(e2);
|
|
932
|
-
let n2;
|
|
933
|
-
if (t2 <= 0) n2 = Math.round(r2);
|
|
934
|
-
else {
|
|
935
|
-
const e3 = r2.toFixed(t2);
|
|
936
|
-
n2 = parseFloat(e3);
|
|
937
|
-
}
|
|
938
|
-
return Math.sign(e2) * n2;
|
|
939
|
-
}, Zn = (e2, t2 = 0, r2 = 2) => e2.toLocaleString(void 0, { useGrouping: true, minimumFractionDigits: t2, maximumFractionDigits: r2 }), Jn = 1e9, eo = 1e6;
|
|
940
|
-
function to(e2, { cents: t2 = "default", condense: r2 = false, dollarSign: n2 = false, signage: o2 = "default" } = {}) {
|
|
941
|
-
const a2 = "string" == typeof e2 ? parseFloat(e2) : e2;
|
|
942
|
-
if (Number.isNaN(a2)) return "";
|
|
943
|
-
let i2;
|
|
944
|
-
const l2 = Math.abs(a2);
|
|
945
|
-
let s2;
|
|
946
|
-
if (r2 && l2 > 99999) {
|
|
947
|
-
s2 = Math.sign(a2) < 0;
|
|
948
|
-
const e3 = Math.floor((c2 = 1e3, d2 = l2, Math.log(d2) / Math.log(c2))) - 1, t3 = Math.pow(1e3, e3), r3 = Math.round(l2 / t3), n3 = r3 * t3;
|
|
949
|
-
let o3, u3 = r3 / 1e3;
|
|
950
|
-
l2 < Jn && u3 >= 1e3 && (u3 /= 1e3), n3 >= Jn ? o3 = "B" : n3 >= eo ? o3 = "M" : (u3 = Math.round(u3), o3 = "K");
|
|
951
|
-
i2 = `${Zn(u3, 0, 1)}${o3}`;
|
|
952
|
-
} else {
|
|
953
|
-
let e3;
|
|
954
|
-
const r3 = 2, n3 = 0;
|
|
955
|
-
let o3, l3;
|
|
956
|
-
"floor" === t2 ? (o3 = n3, l3 = n3, e3 = Qn(a2)) : "round" === t2 ? (o3 = n3, l3 = n3, e3 = Xn(a2, o3)) : "always" === t2 ? (o3 = r3, l3 = r3, e3 = Xn(a2, o3)) : "default" === t2 && Math.abs(a2) >= 1e3 ? (o3 = n3, l3 = n3, e3 = Xn(a2, o3)) : (o3 = r3, e3 = Xn(a2, o3), l3 = e3 % 1 == 0 ? n3 : r3), s2 = Math.sign(e3) < 0;
|
|
957
|
-
const c3 = Math.abs(e3);
|
|
958
|
-
i2 = Zn(c3, l3, o3);
|
|
959
|
-
}
|
|
960
|
-
var c2, d2;
|
|
961
|
-
let u2 = i2;
|
|
962
|
-
const h2 = n2 ? "$" : "";
|
|
963
|
-
if (void 0 === o2 || "off" === o2) u2 = i2;
|
|
964
|
-
else if ("parens" === o2) {
|
|
965
|
-
u2 = `${h2}${s2 ? `(${i2})` : i2}`;
|
|
966
|
-
} else if ("always" === o2) {
|
|
967
|
-
u2 = `${s2 ? "-" : "+"}${h2}${i2}`;
|
|
968
|
-
} else if ("default" === o2) {
|
|
969
|
-
u2 = `${s2 ? "-" : ""}${h2}${i2}`;
|
|
970
|
-
}
|
|
971
|
-
return u2;
|
|
972
|
-
}
|
|
973
|
-
function ro(e2) {
|
|
974
|
-
return to(e2, { condense: true, dollarSign: true });
|
|
975
|
-
}
|
|
976
|
-
function no(e2) {
|
|
977
|
-
return to(e2, { cents: "always", condense: false, dollarSign: true, signage: "always" });
|
|
978
|
-
}
|
|
979
|
-
const oo = { "sm-sm": At(kt.text, ft({ fontSize: { sm: "sm", base: "md" }, fontWeight: "sm", color: "typography.base", fontStyle: "normal", letterSpacing: "0.84px", maxWidth: "100%" }), Bn), "sm-med": At(kt.text, ft({ fontSize: { sm: "sm", base: "md" }, fontWeight: "md", color: "typography.base", fontStyle: "normal", letterSpacing: "0.84px", maxWidth: "100%" }), Bn), "sm-lg": At(kt.text, ft({ fontSize: "sm", fontWeight: "lg", color: "typography.base", fontStyle: "normal", letterSpacing: "0.84px", maxWidth: "100%" }), Bn), "med-sm": At(kt.text, ft({ fontSize: { sm: "md", base: "lg" }, fontWeight: "sm", color: "typography.base", fontStyle: "normal", letterSpacing: "0.84px", maxWidth: "100%" }), Bn), "med-med": At(kt.text, ft({ fontSize: { sm: "md", base: "lg" }, fontWeight: "md", color: "typography.base", fontStyle: "normal", letterSpacing: "0.84px", maxWidth: "100%" }), Bn), "med-lg": At(kt.text, ft({ fontSize: { sm: "md", base: "lg" }, fontWeight: "lg", color: "typography.base", fontStyle: "normal", letterSpacing: "0.84px", maxWidth: "100%" }), Bn) };
|
|
980
|
-
function ao({ children: e2, size: t2, weight: r2, stylists: n2 = [] }) {
|
|
981
|
-
const o2 = Ot([oo[`${t2}-${r2}`], ...n2]);
|
|
982
|
-
return k("div", { title: e2, ...o2, children: e2 });
|
|
983
|
-
}
|
|
984
|
-
const io = At(kt["strong-label"], _t({ label: "strongLabel" }));
|
|
985
|
-
function lo({ children: e2, stylists: t2 = [] }) {
|
|
986
|
-
return sr(e2) ? null : k(ao, { size: "med", weight: "med", stylists: [io, ...t2], children: e2 });
|
|
987
|
-
}
|
|
988
|
-
const so = wt({ base: { fontWeight: "label.sub", fontSize: { sm: "label.sub", base: "md" }, fontFamily: "label", lineHeight: { sm: "14px", base: "16px" }, letterSpacing: "0.66px", fontStyle: "normal" }, variants: { intent: { normal: { color: "typography.label.sub" }, action: { color: "typography.intent.action" }, primary: { color: "typography.intent.primary" }, danger: { color: "typography.accent.danger" } }, accent: { action: { _supportHover: { color: "typography.accent.action", transition: "color 100ms ease-out" }, transition: "color 300ms ease-out" }, active: { color: "typography.accent.action" } }, wrap: { ellipsis: Hn, wrap: { whiteSpace: "normal", overflowWrap: "break-word" } } } });
|
|
989
|
-
function co({ intent: e2, wrap: t2 = "ellipsis", children: r2, accent: n2 }) {
|
|
990
|
-
const o2 = void 0 === e2 && void 0 === n2 ? "normal" : void 0, a2 = At(kt["sub-label"], so({ intent: o2, wrap: t2, accent: n2 }), Bn);
|
|
991
|
-
return sr(r2) ? null : k("div", { ...a2, children: r2 });
|
|
992
|
-
}
|
|
993
|
-
const uo = At(null, ft({ display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", border: "1px solid {colors.border.layout}", borderRadius: "sm", backgroundColor: "surface.background", boxShadow: "box-shadow", padding: "10px", width: "fit-content", height: "fit-content" }));
|
|
994
|
-
function ho({ active: e2, payload: t2 }) {
|
|
995
|
-
if (t2.length <= 0 || !e2 || t2[0].dataKey === An.noDataHeight) return null;
|
|
996
|
-
let r2 = t2[0].value ?? 0;
|
|
997
|
-
return "expenses" === t2[0].dataKey ? r2 += t2[0].payload.loss : "income" === t2[0].dataKey && (r2 += t2[0].payload.profit), S("div", { ...uo, children: [k(lo, { children: t2[0].name ?? "" }), k(co, { children: ro(Number(r2)) })] });
|
|
998
|
-
}
|
|
999
|
-
const go = { "colors.white100": { value: "#FFFFFF", variable: "var(--Tight-colors-white100)" }, "colors.white200": { value: "#F9F9F9", variable: "var(--Tight-colors-white200)" }, "colors.white300": { value: "#EDEDED", variable: "var(--Tight-colors-white300)" }, "colors.white600": { value: "#E7E8E9", variable: "var(--Tight-colors-white600)" }, "colors.black100": { value: "#CED1D2", variable: "var(--Tight-colors-black100)" }, "colors.black400": { value: "#6F7576", variable: "var(--Tight-colors-black400)" }, "colors.black600": { value: "#50595C", variable: "var(--Tight-colors-black600)" }, "colors.black700": { value: "#182428", variable: "var(--Tight-colors-black700)" }, "colors.blue300": { value: "#DAF4FA", variable: "var(--Tight-colors-blue300)" }, "colors.blue400": { value: "#CAECF3", variable: "var(--Tight-colors-blue400)" }, "colors.blue500": { value: "#94D8E8", variable: "var(--Tight-colors-blue500)" }, "colors.blue700": { value: "#2AB2D1", variable: "var(--Tight-colors-blue700)" }, "colors.blue900": { value: "#177F96", variable: "var(--Tight-colors-blue900)" }, "colors.green300": { value: "#B8F3D5", variable: "var(--Tight-colors-green300)" }, "colors.green400": { value: "#94E8BD", variable: "var(--Tight-colors-green400)" }, "colors.green500": { value: "#5FDD9C", variable: "var(--Tight-colors-green500)" }, "colors.green700": { value: "#009C75", variable: "var(--Tight-colors-green700)" }, "colors.yellow300": { value: "#FFE787", variable: "var(--Tight-colors-yellow300)" }, "colors.yellow400": { value: "#FCD34D", variable: "var(--Tight-colors-yellow400)" }, "colors.yellow500": { value: "#FBBF24", variable: "var(--Tight-colors-yellow500)" }, "colors.red300": { value: "#FF9797", variable: "var(--Tight-colors-red300)" }, "colors.red400": { value: "#F45C5C", variable: "var(--Tight-colors-red400)" }, "colors.red500": { value: "#E84747", variable: "var(--Tight-colors-red500)" }, "colors.red700": { value: "#E42525", variable: "var(--Tight-colors-red700)" }, "fonts.base": { value: "Duplet Regular, sans-serif", variable: "var(--Tight-fonts-base)" }, "fontSizes.sm": { value: "11px", variable: "var(--Tight-fontSizes-sm)" }, "fontSizes.md": { value: "14px", variable: "var(--Tight-fontSizes-md)" }, "fontSizes.lg": { value: "16px", variable: "var(--Tight-fontSizes-lg)" }, "fontSizes.xl": { value: "20px", variable: "var(--Tight-fontSizes-xl)" }, "fontSizes.2xl": { value: "36px", variable: "var(--Tight-fontSizes-2xl)" }, "fontWeights.sm": { value: "400", variable: "var(--Tight-fontWeights-sm)" }, "fontWeights.md": { value: "600", variable: "var(--Tight-fontWeights-md)" }, "fontWeights.lg": { value: "900", variable: "var(--Tight-fontWeights-lg)" }, "radii.zero": { value: "0", variable: "var(--Tight-radii-zero)" }, "radii.sm": { value: "1px", variable: "var(--Tight-radii-sm)" }, "radii.md": { value: "2px", variable: "var(--Tight-radii-md)" }, "radii.lg": { value: "4px", variable: "var(--Tight-radii-lg)" }, "borderWidths.sm": { value: "0.5px", variable: "var(--Tight-borderWidths-sm)" }, "borderWidths.md": { value: "0.75px", variable: "var(--Tight-borderWidths-md)" }, "borderWidths.lg": { value: "1px", variable: "var(--Tight-borderWidths-lg)" }, "borderWidths.xl": { value: "2px", variable: "var(--Tight-borderWidths-xl)" }, "animations.appear.instant": { value: "0.25s linear fade-in", variable: "var(--Tight-animations-appear-instant)" }, "animations.appear.delay": { value: "0.25s linear both 1.5s fade-in", variable: "var(--Tight-animations-appear-delay)" }, "animations.shimmer": { value: "2s ease-in-out infinite shimmer", variable: "var(--Tight-animations-shimmer)" }, "animations.spin": { value: "1.5s ease-in-out 0.1s spin infinite", variable: "var(--Tight-animations-spin)" }, "shadows.box-shadow": { value: "0px 10px 30px 0px rgba(24, 36, 40, 0.10)", variable: "var(--Tight-shadows-box-shadow)" }, "breakpoints.sm": { value: "640px", variable: "var(--Tight-breakpoints-sm)" }, "breakpoints.md": { value: "850px", variable: "var(--Tight-breakpoints-md)" }, "breakpoints.lg": { value: "1024px", variable: "var(--Tight-breakpoints-lg)" }, "breakpoints.xl": { value: "1280px", variable: "var(--Tight-breakpoints-xl)" }, "breakpoints.1.5xl": { value: "1400px", variable: "var(--Tight-breakpoints-1.5xl)" }, "breakpoints.2xl": { value: "1536px", variable: "var(--Tight-breakpoints-2xl)" }, "sizes.breakpoint-sm": { value: "640px", variable: "var(--Tight-sizes-breakpoint-sm)" }, "sizes.breakpoint-md": { value: "850px", variable: "var(--Tight-sizes-breakpoint-md)" }, "sizes.breakpoint-lg": { value: "1024px", variable: "var(--Tight-sizes-breakpoint-lg)" }, "sizes.breakpoint-xl": { value: "1280px", variable: "var(--Tight-sizes-breakpoint-xl)" }, "sizes.breakpoint-1.5xl": { value: "1400px", variable: "var(--Tight-sizes-breakpoint-1.5xl)" }, "sizes.breakpoint-2xl": { value: "1536px", variable: "var(--Tight-sizes-breakpoint-2xl)" }, "colors.brand.primary.weak": { value: "var(--Tight-colors-black400)", variable: "var(--Tight-colors-brand-primary-weak)" }, "colors.brand.primary": { value: "var(--Tight-colors-black600)", variable: "var(--Tight-colors-brand-primary)" }, "colors.brand.primary.strong": { value: "var(--Tight-colors-black700)", variable: "var(--Tight-colors-brand-primary-strong)" }, "colors.brand.secondary.weak": { value: "var(--Tight-colors-white200)", variable: "var(--Tight-colors-brand-secondary-weak)" }, "colors.brand.secondary": { value: "var(--Tight-colors-white600)", variable: "var(--Tight-colors-brand-secondary)" }, "colors.brand.secondary.strong": { value: "var(--Tight-colors-black100)", variable: "var(--Tight-colors-brand-secondary-strong)" }, "colors.brand.action.weak": { value: "var(--Tight-colors-blue300)", variable: "var(--Tight-colors-brand-action-weak)" }, "colors.brand.action": { value: "var(--Tight-colors-blue400)", variable: "var(--Tight-colors-brand-action)" }, "colors.brand.action.strong": { value: "var(--Tight-colors-blue500)", variable: "var(--Tight-colors-brand-action-strong)" }, "colors.brand.action.stronger": { value: "var(--Tight-colors-blue700)", variable: "var(--Tight-colors-brand-action-stronger)" }, "colors.brand.action.strongest": { value: "var(--Tight-colors-blue900)", variable: "var(--Tight-colors-brand-action-strongest)" }, "colors.brand.success.weak": { value: "var(--Tight-colors-green300)", variable: "var(--Tight-colors-brand-success-weak)" }, "colors.brand.success": { value: "var(--Tight-colors-green400)", variable: "var(--Tight-colors-brand-success)" }, "colors.brand.success.strong": { value: "var(--Tight-colors-green500)", variable: "var(--Tight-colors-brand-success-strong)" }, "colors.brand.warning.weak": { value: "var(--Tight-colors-yellow300)", variable: "var(--Tight-colors-brand-warning-weak)" }, "colors.brand.warning": { value: "var(--Tight-colors-yellow400)", variable: "var(--Tight-colors-brand-warning)" }, "colors.brand.warning.strong": { value: "var(--Tight-colors-yellow500)", variable: "var(--Tight-colors-brand-warning-strong)" }, "colors.brand.danger.weak": { value: "var(--Tight-colors-red300)", variable: "var(--Tight-colors-brand-danger-weak)" }, "colors.brand.danger": { value: "var(--Tight-colors-red400)", variable: "var(--Tight-colors-brand-danger)" }, "colors.brand.danger.strong": { value: "var(--Tight-colors-red500)", variable: "var(--Tight-colors-brand-danger-strong)" }, "colors.surface.background": { value: "var(--Tight-colors-white200)", variable: "var(--Tight-colors-surface-background)" }, "colors.surface.background.hover": { value: "var(--Tight-colors-white300)", variable: "var(--Tight-colors-surface-background-hover)" }, "colors.surface.foreground": { value: "var(--Tight-colors-white100)", variable: "var(--Tight-colors-surface-foreground)" }, "colors.surface.foreground.hover": { value: "var(--Tight-colors-white200)", variable: "var(--Tight-colors-surface-foreground-hover)" }, "colors.surface.foreground.disabled": { value: "var(--Tight-colors-white600)", variable: "var(--Tight-colors-surface-foreground-disabled)" }, "colors.surface.elevated": { value: "var(--Tight-colors-white300)", variable: "var(--Tight-colors-surface-elevated)" }, "colors.surface.elevated.hover": { value: "var(--Tight-colors-white600)", variable: "var(--Tight-colors-surface-elevated-hover)" }, "colors.surface.intent.primary": { value: "var(--Tight-colors-brand-primary-weak)", variable: "var(--Tight-colors-surface-intent-primary)" }, "colors.surface.intent.primary.hover": { value: "var(--Tight-colors-brand-primary)", variable: "var(--Tight-colors-surface-intent-primary-hover)" }, "colors.surface.intent.primary.active": { value: "var(--Tight-colors-brand-primary-strong)", variable: "var(--Tight-colors-surface-intent-primary-active)" }, "colors.surface.intent.primary.disabled": { value: "var(--Tight-colors-surface-foreground-disabled)", variable: "var(--Tight-colors-surface-intent-primary-disabled)" }, "colors.surface.intent.secondary": { value: "var(--Tight-colors-brand-secondary-weak)", variable: "var(--Tight-colors-surface-intent-secondary)" }, "colors.surface.intent.secondary.hover": { value: "var(--Tight-colors-brand-secondary)", variable: "var(--Tight-colors-surface-intent-secondary-hover)" }, "colors.surface.intent.secondary.active": { value: "var(--Tight-colors-brand-secondary-strong)", variable: "var(--Tight-colors-surface-intent-secondary-active)" }, "colors.surface.intent.secondary.disabled": { value: "var(--Tight-colors-surface-foreground-disabled)", variable: "var(--Tight-colors-surface-intent-secondary-disabled)" }, "colors.surface.intent.action": { value: "var(--Tight-colors-brand-action-weak)", variable: "var(--Tight-colors-surface-intent-action)" }, "colors.surface.intent.action.hover": { value: "var(--Tight-colors-brand-action)", variable: "var(--Tight-colors-surface-intent-action-hover)" }, "colors.surface.intent.action.active": { value: "var(--Tight-colors-brand-action-strong)", variable: "var(--Tight-colors-surface-intent-action-active)" }, "colors.surface.intent.action.disabled": { value: "var(--Tight-colors-surface-foreground-disabled)", variable: "var(--Tight-colors-surface-intent-action-disabled)" }, "colors.surface.intent.action.discrete": { value: "transparent", variable: "var(--Tight-colors-surface-intent-action-discrete)" }, "colors.surface.intent.action.discrete.hover": { value: "var(--Tight-colors-brand-action-weak)", variable: "var(--Tight-colors-surface-intent-action-discrete-hover)" }, "colors.surface.intent.action.discrete.active": { value: "var(--Tight-colors-brand-action)", variable: "var(--Tight-colors-surface-intent-action-discrete-active)" }, "colors.surface.intent.success": { value: "var(--Tight-colors-brand-success-weak)", variable: "var(--Tight-colors-surface-intent-success)" }, "colors.surface.intent.success.hover": { value: "var(--Tight-colors-brand-success)", variable: "var(--Tight-colors-surface-intent-success-hover)" }, "colors.surface.intent.success.active": { value: "var(--Tight-colors-brand-success-strong)", variable: "var(--Tight-colors-surface-intent-success-active)" }, "colors.surface.intent.success.disabled": { value: "var(--Tight-colors-surface-foreground-disabled)", variable: "var(--Tight-colors-surface-intent-success-disabled)" }, "colors.surface.intent.warning": { value: "var(--Tight-colors-brand-warning-weak)", variable: "var(--Tight-colors-surface-intent-warning)" }, "colors.surface.intent.warning.hover": { value: "var(--Tight-colors-brand-warning)", variable: "var(--Tight-colors-surface-intent-warning-hover)" }, "colors.surface.intent.warning.active": { value: "var(--Tight-colors-brand-warning-strong)", variable: "var(--Tight-colors-surface-intent-warning-active)" }, "colors.surface.intent.warning.disabled": { value: "var(--Tight-colors-surface-foreground-disabled)", variable: "var(--Tight-colors-surface-intent-warning-disabled)" }, "colors.surface.intent.danger": { value: "var(--Tight-colors-brand-danger-weak)", variable: "var(--Tight-colors-surface-intent-danger)" }, "colors.surface.intent.danger.hover": { value: "var(--Tight-colors-brand-danger)", variable: "var(--Tight-colors-surface-intent-danger-hover)" }, "colors.surface.intent.danger.active": { value: "var(--Tight-colors-brand-danger-strong)", variable: "var(--Tight-colors-surface-intent-danger-active)" }, "colors.surface.intent.danger.disabled": { value: "var(--Tight-colors-surface-foreground-disabled)", variable: "var(--Tight-colors-surface-intent-danger-disabled)" }, "colors.typography.base": { value: "var(--Tight-colors-black700)", variable: "var(--Tight-colors-typography-base)" }, "colors.typography.base.weak": { value: "var(--Tight-colors-black400)", variable: "var(--Tight-colors-typography-base-weak)" }, "colors.typography.contrast": { value: "var(--Tight-colors-white100)", variable: "var(--Tight-colors-typography-contrast)" }, "colors.typography.contrast.weak": { value: "var(--Tight-colors-black100)", variable: "var(--Tight-colors-typography-contrast-weak)" }, "colors.typography.intent.primary": { value: "var(--Tight-colors-white100)", variable: "var(--Tight-colors-typography-intent-primary)" }, "colors.typography.intent.primary.hover": { value: "var(--Tight-colors-white100)", variable: "var(--Tight-colors-typography-intent-primary-hover)" }, "colors.typography.intent.primary.active": { value: "var(--Tight-colors-white100)", variable: "var(--Tight-colors-typography-intent-primary-active)" }, "colors.typography.intent.secondary": { value: "var(--Tight-colors-typography-base)", variable: "var(--Tight-colors-typography-intent-secondary)" }, "colors.typography.intent.secondary.hover": { value: "var(--Tight-colors-typography-base)", variable: "var(--Tight-colors-typography-intent-secondary-hover)" }, "colors.typography.intent.secondary.active": { value: "var(--Tight-colors-typography-base)", variable: "var(--Tight-colors-typography-intent-secondary-active)" }, "colors.typography.intent.action": { value: "var(--Tight-colors-typography-base)", variable: "var(--Tight-colors-typography-intent-action)" }, "colors.typography.intent.action.hover": { value: "var(--Tight-colors-typography-base)", variable: "var(--Tight-colors-typography-intent-action-hover)" }, "colors.typography.intent.action.active": { value: "var(--Tight-colors-typography-base)", variable: "var(--Tight-colors-typography-intent-action-active)" }, "colors.typography.intent.success": { value: "var(--Tight-colors-typography-base)", variable: "var(--Tight-colors-typography-intent-success)" }, "colors.typography.intent.success.hover": { value: "var(--Tight-colors-typography-base)", variable: "var(--Tight-colors-typography-intent-success-hover)" }, "colors.typography.intent.success.active": { value: "var(--Tight-colors-typography-base)", variable: "var(--Tight-colors-typography-intent-success-active)" }, "colors.typography.intent.warning": { value: "var(--Tight-colors-typography-base)", variable: "var(--Tight-colors-typography-intent-warning)" }, "colors.typography.intent.warning.hover": { value: "var(--Tight-colors-typography-base)", variable: "var(--Tight-colors-typography-intent-warning-hover)" }, "colors.typography.intent.warning.active": { value: "var(--Tight-colors-typography-base)", variable: "var(--Tight-colors-typography-intent-warning-active)" }, "colors.typography.intent.danger": { value: "var(--Tight-colors-typography-base)", variable: "var(--Tight-colors-typography-intent-danger)" }, "colors.typography.intent.danger.hover": { value: "var(--Tight-colors-typography-base)", variable: "var(--Tight-colors-typography-intent-danger-hover)" }, "colors.typography.intent.danger.active": { value: "var(--Tight-colors-typography-base)", variable: "var(--Tight-colors-typography-intent-danger-active)" }, "colors.typography.accent.success": { value: "var(--Tight-colors-brand-success-strong)", variable: "var(--Tight-colors-typography-accent-success)" }, "colors.typography.accent.warning": { value: "var(--Tight-colors-brand-warning-strong)", variable: "var(--Tight-colors-typography-accent-warning)" }, "colors.typography.accent.danger": { value: "var(--Tight-colors-brand-danger-strong)", variable: "var(--Tight-colors-typography-accent-danger)" }, "colors.typography.accent.action": { value: "var(--Tight-colors-brand-action-strong)", variable: "var(--Tight-colors-typography-accent-action)" }, "colors.typography.body": { value: "var(--Tight-colors-typography-base)", variable: "var(--Tight-colors-typography-body)" }, "colors.typography.label": { value: "var(--Tight-colors-typography-base)", variable: "var(--Tight-colors-typography-label)" }, "colors.typography.label.sub": { value: "var(--Tight-colors-typography-base-weak)", variable: "var(--Tight-colors-typography-label-sub)" }, "colors.typography.label.strong": { value: "var(--Tight-colors-typography-base)", variable: "var(--Tight-colors-typography-label-strong)" }, "colors.typography.label.strongSub": { value: "var(--Tight-colors-typography-base)", variable: "var(--Tight-colors-typography-label-strongSub)" }, "colors.typography.label.emphasisSub": { value: "var(--Tight-colors-typography-base)", variable: "var(--Tight-colors-typography-label-emphasisSub)" }, "colors.typography.heading": { value: "var(--Tight-colors-typography-base)", variable: "var(--Tight-colors-typography-heading)" }, "colors.typography.metric.sm": { value: "var(--Tight-colors-typography-base)", variable: "var(--Tight-colors-typography-metric-sm)" }, "colors.typography.metric.md": { value: "var(--Tight-colors-typography-base)", variable: "var(--Tight-colors-typography-metric-md)" }, "colors.typography.metric.lg": { value: "var(--Tight-colors-typography-base)", variable: "var(--Tight-colors-typography-metric-lg)" }, "colors.typography.metric.xl": { value: "var(--Tight-colors-typography-base)", variable: "var(--Tight-colors-typography-metric-xl)" }, "colors.icon.base": { value: "var(--Tight-colors-typography-base)", variable: "var(--Tight-colors-icon-base)" }, "colors.icon.base.weak": { value: "var(--Tight-colors-typography-base-weak)", variable: "var(--Tight-colors-icon-base-weak)" }, "colors.icon.contrast": { value: "var(--Tight-colors-typography-contrast)", variable: "var(--Tight-colors-icon-contrast)" }, "colors.icon.contrast.weak": { value: "var(--Tight-colors-typography-contrast-weak)", variable: "var(--Tight-colors-icon-contrast-weak)" }, "colors.icon.intent.primary": { value: "var(--Tight-colors-typography-intent-primary)", variable: "var(--Tight-colors-icon-intent-primary)" }, "colors.icon.intent.primary.hover": { value: "var(--Tight-colors-typography-intent-primary-hover)", variable: "var(--Tight-colors-icon-intent-primary-hover)" }, "colors.icon.intent.primary.active": { value: "var(--Tight-colors-typography-intent-primary-active)", variable: "var(--Tight-colors-icon-intent-primary-active)" }, "colors.icon.intent.secondary": { value: "var(--Tight-colors-typography-intent-secondary)", variable: "var(--Tight-colors-icon-intent-secondary)" }, "colors.icon.intent.secondary.hover": { value: "var(--Tight-colors-typography-intent-secondary-hover)", variable: "var(--Tight-colors-icon-intent-secondary-hover)" }, "colors.icon.intent.secondary.active": { value: "var(--Tight-colors-typography-intent-secondary-active)", variable: "var(--Tight-colors-icon-intent-secondary-active)" }, "colors.icon.intent.action": { value: "var(--Tight-colors-typography-intent-action)", variable: "var(--Tight-colors-icon-intent-action)" }, "colors.icon.intent.action.hover": { value: "var(--Tight-colors-typography-intent-action-hover)", variable: "var(--Tight-colors-icon-intent-action-hover)" }, "colors.icon.intent.action.active": { value: "var(--Tight-colors-typography-intent-action-active)", variable: "var(--Tight-colors-icon-intent-action-active)" }, "colors.icon.intent.success": { value: "var(--Tight-colors-typography-intent-success)", variable: "var(--Tight-colors-icon-intent-success)" }, "colors.icon.intent.success.hover": { value: "var(--Tight-colors-typography-intent-success-hover)", variable: "var(--Tight-colors-icon-intent-success-hover)" }, "colors.icon.intent.success.active": { value: "var(--Tight-colors-typography-intent-success-active)", variable: "var(--Tight-colors-icon-intent-success-active)" }, "colors.icon.intent.warning": { value: "var(--Tight-colors-typography-intent-warning)", variable: "var(--Tight-colors-icon-intent-warning)" }, "colors.icon.intent.warning.hover": { value: "var(--Tight-colors-typography-intent-warning-hover)", variable: "var(--Tight-colors-icon-intent-warning-hover)" }, "colors.icon.intent.warning.active": { value: "var(--Tight-colors-typography-intent-warning-active)", variable: "var(--Tight-colors-icon-intent-warning-active)" }, "colors.icon.intent.danger": { value: "var(--Tight-colors-typography-intent-danger)", variable: "var(--Tight-colors-icon-intent-danger)" }, "colors.icon.intent.danger.hover": { value: "var(--Tight-colors-typography-intent-danger-hover)", variable: "var(--Tight-colors-icon-intent-danger-hover)" }, "colors.icon.intent.danger.active": { value: "var(--Tight-colors-typography-intent-danger-active)", variable: "var(--Tight-colors-icon-intent-danger-active)" }, "colors.icon.accent.success": { value: "var(--Tight-colors-typography-accent-success)", variable: "var(--Tight-colors-icon-accent-success)" }, "colors.icon.accent.warning": { value: "var(--Tight-colors-typography-accent-warning)", variable: "var(--Tight-colors-icon-accent-warning)" }, "colors.icon.accent.danger": { value: "var(--Tight-colors-typography-accent-danger)", variable: "var(--Tight-colors-icon-accent-danger)" }, "colors.border.layout.weak": { value: "var(--Tight-colors-white300)", variable: "var(--Tight-colors-border-layout-weak)" }, "colors.border.layout": { value: "var(--Tight-colors-black100)", variable: "var(--Tight-colors-border-layout)" }, "colors.border.layout.strong": { value: "var(--Tight-colors-black600)", variable: "var(--Tight-colors-border-layout-strong)" }, "colors.border.intent.primary.hover": { value: "var(--Tight-colors-brand-primary-strong)", variable: "var(--Tight-colors-border-intent-primary-hover)" }, "colors.border.intent.primary": { value: "var(--Tight-colors-brand-primary-strong)", variable: "var(--Tight-colors-border-intent-primary)" }, "colors.border.intent.primary.active": { value: "var(--Tight-colors-brand-primary-strong)", variable: "var(--Tight-colors-border-intent-primary-active)" }, "colors.border.intent.primary.disabled": { value: "var(--Tight-colors-border-layout)", variable: "var(--Tight-colors-border-intent-primary-disabled)" }, "colors.border.intent.secondary.hover": { value: "var(--Tight-colors-brand-secondary-strong)", variable: "var(--Tight-colors-border-intent-secondary-hover)" }, "colors.border.intent.secondary": { value: "var(--Tight-colors-brand-secondary-strong)", variable: "var(--Tight-colors-border-intent-secondary)" }, "colors.border.intent.secondary.active": { value: "var(--Tight-colors-brand-secondary-strong)", variable: "var(--Tight-colors-border-intent-secondary-active)" }, "colors.border.intent.secondary.disabled": { value: "var(--Tight-colors-border-layout)", variable: "var(--Tight-colors-border-intent-secondary-disabled)" }, "colors.border.intent.danger.hover": { value: "var(--Tight-colors-brand-danger-strong)", variable: "var(--Tight-colors-border-intent-danger-hover)" }, "colors.border.intent.danger": { value: "var(--Tight-colors-brand-danger-strong)", variable: "var(--Tight-colors-border-intent-danger)" }, "colors.border.intent.danger.active": { value: "var(--Tight-colors-brand-danger-strong)", variable: "var(--Tight-colors-border-intent-danger-active)" }, "colors.border.intent.danger.disabled": { value: "var(--Tight-colors-border-layout)", variable: "var(--Tight-colors-border-intent-danger-disabled)" }, "colors.border.intent.warning.hover": { value: "var(--Tight-colors-brand-warning-strong)", variable: "var(--Tight-colors-border-intent-warning-hover)" }, "colors.border.intent.warning": { value: "var(--Tight-colors-brand-warning-strong)", variable: "var(--Tight-colors-border-intent-warning)" }, "colors.border.intent.warning.active": { value: "var(--Tight-colors-brand-warning-strong)", variable: "var(--Tight-colors-border-intent-warning-active)" }, "colors.border.intent.warning.disabled": { value: "var(--Tight-colors-border-layout)", variable: "var(--Tight-colors-border-intent-warning-disabled)" }, "colors.border.intent.success.hover": { value: "var(--Tight-colors-brand-success-strong)", variable: "var(--Tight-colors-border-intent-success-hover)" }, "colors.border.intent.success": { value: "var(--Tight-colors-brand-success-strong)", variable: "var(--Tight-colors-border-intent-success)" }, "colors.border.intent.success.active": { value: "var(--Tight-colors-brand-success-strong)", variable: "var(--Tight-colors-border-intent-success-active)" }, "colors.border.intent.success.disabled": { value: "var(--Tight-colors-border-layout)", variable: "var(--Tight-colors-border-intent-success-disabled)" }, "colors.border.intent.action.hover": { value: "var(--Tight-colors-brand-action-strong)", variable: "var(--Tight-colors-border-intent-action-hover)" }, "colors.border.intent.action": { value: "var(--Tight-colors-brand-action-strong)", variable: "var(--Tight-colors-border-intent-action)" }, "colors.border.intent.action.active": { value: "var(--Tight-colors-brand-action-strong)", variable: "var(--Tight-colors-border-intent-action-active)" }, "colors.border.intent.action.disabled": { value: "var(--Tight-colors-border-layout)", variable: "var(--Tight-colors-border-intent-action-disabled)" }, "colors.money": { value: "var(--Tight-colors-typography-base)", variable: "var(--Tight-colors-money)" }, "colors.money.positive": { value: "var(--Tight-colors-green700)", variable: "var(--Tight-colors-money-positive)" }, "colors.money.positive.weak": { value: "var(--Tight-colors-green500)", variable: "var(--Tight-colors-money-positive-weak)" }, "colors.money.negative": { value: "var(--Tight-colors-red700)", variable: "var(--Tight-colors-money-negative)" }, "colors.money.negative.weak": { value: "var(--Tight-colors-red300)", variable: "var(--Tight-colors-money-negative-weak)" }, "colors.overlay": { value: "rgba(0, 0, 0, 0.5)", variable: "var(--Tight-colors-overlay)" }, "colors.transparent": { value: "transparent", variable: "var(--Tight-colors-transparent)" }, "colors.none": { value: "none", variable: "var(--Tight-colors-none)" }, "colors.inherit": { value: "inherit", variable: "var(--Tight-colors-inherit)" }, "colors.currentColor": { value: "currentColor", variable: "var(--Tight-colors-currentColor)" }, "fonts.body": { value: "var(--Tight-fonts-base)", variable: "var(--Tight-fonts-body)" }, "fonts.label": { value: "var(--Tight-fonts-base)", variable: "var(--Tight-fonts-label)" }, "fonts.heading": { value: "var(--Tight-fonts-base)", variable: "var(--Tight-fonts-heading)" }, "fonts.metric": { value: "var(--Tight-fonts-base)", variable: "var(--Tight-fonts-metric)" }, "fontWeights.global": { value: "var(--Tight-fontWeights-sm)", variable: "var(--Tight-fontWeights-global)" }, "fontWeights.body": { value: "var(--Tight-fontWeights-md)", variable: "var(--Tight-fontWeights-body)" }, "fontWeights.label": { value: "var(--Tight-fontWeights-sm)", variable: "var(--Tight-fontWeights-label)" }, "fontWeights.label.strong": { value: "var(--Tight-fontWeights-md)", variable: "var(--Tight-fontWeights-label-strong)" }, "fontWeights.label.sub": { value: "var(--Tight-fontWeights-sm)", variable: "var(--Tight-fontWeights-label-sub)" }, "fontWeights.label.strongSub": { value: "var(--Tight-fontWeights-md)", variable: "var(--Tight-fontWeights-label-strongSub)" }, "fontWeights.label.emphasisSub": { value: "var(--Tight-fontWeights-lg)", variable: "var(--Tight-fontWeights-label-emphasisSub)" }, "fontWeights.heading": { value: "var(--Tight-fontWeights-md)", variable: "var(--Tight-fontWeights-heading)" }, "fontWeights.title": { value: "var(--Tight-fontWeights-sm)", variable: "var(--Tight-fontWeights-title)" }, "fontWeights.metric.sm": { value: "var(--Tight-fontWeights-sm)", variable: "var(--Tight-fontWeights-metric-sm)" }, "fontWeights.metric.md": { value: "var(--Tight-fontWeights-sm)", variable: "var(--Tight-fontWeights-metric-md)" }, "fontWeights.metric.lg": { value: "var(--Tight-fontWeights-sm)", variable: "var(--Tight-fontWeights-metric-lg)" }, "fontWeights.metric.xl": { value: "var(--Tight-fontWeights-sm)", variable: "var(--Tight-fontWeights-metric-xl)" }, "fontSizes.title": { value: "var(--Tight-fontSizes-2xl)", variable: "var(--Tight-fontSizes-title)" }, "fontSizes.body": { value: "var(--Tight-fontSizes-md)", variable: "var(--Tight-fontSizes-body)" }, "fontSizes.label": { value: "var(--Tight-fontSizes-md)", variable: "var(--Tight-fontSizes-label)" }, "fontSizes.label.strong": { value: "var(--Tight-fontSizes-md)", variable: "var(--Tight-fontSizes-label-strong)" }, "fontSizes.label.sub": { value: "var(--Tight-fontSizes-sm)", variable: "var(--Tight-fontSizes-label-sub)" }, "fontSizes.label.strongSub": { value: "var(--Tight-fontSizes-sm)", variable: "var(--Tight-fontSizes-label-strongSub)" }, "fontSizes.label.emphasisSub": { value: "var(--Tight-fontSizes-sm)", variable: "var(--Tight-fontSizes-label-emphasisSub)" }, "fontSizes.heading": { value: "var(--Tight-fontSizes-xl)", variable: "var(--Tight-fontSizes-heading)" }, "fontSizes.metric.sm": { value: "var(--Tight-fontSizes-sm)", variable: "var(--Tight-fontSizes-metric-sm)" }, "fontSizes.metric.md": { value: "var(--Tight-fontSizes-md)", variable: "var(--Tight-fontSizes-metric-md)" }, "fontSizes.metric.lg": { value: "var(--Tight-fontSizes-xl)", variable: "var(--Tight-fontSizes-metric-lg)" }, "fontSizes.metric.xl": { value: "var(--Tight-fontSizes-2xl)", variable: "var(--Tight-fontSizes-metric-xl)" }, "colors.colorPalette": { value: "var(--Tight-colors-colorPalette)", variable: "var(--Tight-colors-colorPalette)" }, "colors.colorPalette.primary.weak": { value: "var(--Tight-colors-colorPalette-primary-weak)", variable: "var(--Tight-colors-colorPalette-primary-weak)" }, "colors.colorPalette.weak": { value: "var(--Tight-colors-colorPalette-weak)", variable: "var(--Tight-colors-colorPalette-weak)" }, "colors.colorPalette.primary": { value: "var(--Tight-colors-colorPalette-primary)", variable: "var(--Tight-colors-colorPalette-primary)" }, "colors.colorPalette.primary.strong": { value: "var(--Tight-colors-colorPalette-primary-strong)", variable: "var(--Tight-colors-colorPalette-primary-strong)" }, "colors.colorPalette.strong": { value: "var(--Tight-colors-colorPalette-strong)", variable: "var(--Tight-colors-colorPalette-strong)" }, "colors.colorPalette.secondary.weak": { value: "var(--Tight-colors-colorPalette-secondary-weak)", variable: "var(--Tight-colors-colorPalette-secondary-weak)" }, "colors.colorPalette.secondary": { value: "var(--Tight-colors-colorPalette-secondary)", variable: "var(--Tight-colors-colorPalette-secondary)" }, "colors.colorPalette.secondary.strong": { value: "var(--Tight-colors-colorPalette-secondary-strong)", variable: "var(--Tight-colors-colorPalette-secondary-strong)" }, "colors.colorPalette.action.weak": { value: "var(--Tight-colors-colorPalette-action-weak)", variable: "var(--Tight-colors-colorPalette-action-weak)" }, "colors.colorPalette.action": { value: "var(--Tight-colors-colorPalette-action)", variable: "var(--Tight-colors-colorPalette-action)" }, "colors.colorPalette.action.strong": { value: "var(--Tight-colors-colorPalette-action-strong)", variable: "var(--Tight-colors-colorPalette-action-strong)" }, "colors.colorPalette.action.stronger": { value: "var(--Tight-colors-colorPalette-action-stronger)", variable: "var(--Tight-colors-colorPalette-action-stronger)" }, "colors.colorPalette.stronger": { value: "var(--Tight-colors-colorPalette-stronger)", variable: "var(--Tight-colors-colorPalette-stronger)" }, "colors.colorPalette.action.strongest": { value: "var(--Tight-colors-colorPalette-action-strongest)", variable: "var(--Tight-colors-colorPalette-action-strongest)" }, "colors.colorPalette.strongest": { value: "var(--Tight-colors-colorPalette-strongest)", variable: "var(--Tight-colors-colorPalette-strongest)" }, "colors.colorPalette.success.weak": { value: "var(--Tight-colors-colorPalette-success-weak)", variable: "var(--Tight-colors-colorPalette-success-weak)" }, "colors.colorPalette.success": { value: "var(--Tight-colors-colorPalette-success)", variable: "var(--Tight-colors-colorPalette-success)" }, "colors.colorPalette.success.strong": { value: "var(--Tight-colors-colorPalette-success-strong)", variable: "var(--Tight-colors-colorPalette-success-strong)" }, "colors.colorPalette.warning.weak": { value: "var(--Tight-colors-colorPalette-warning-weak)", variable: "var(--Tight-colors-colorPalette-warning-weak)" }, "colors.colorPalette.warning": { value: "var(--Tight-colors-colorPalette-warning)", variable: "var(--Tight-colors-colorPalette-warning)" }, "colors.colorPalette.warning.strong": { value: "var(--Tight-colors-colorPalette-warning-strong)", variable: "var(--Tight-colors-colorPalette-warning-strong)" }, "colors.colorPalette.danger.weak": { value: "var(--Tight-colors-colorPalette-danger-weak)", variable: "var(--Tight-colors-colorPalette-danger-weak)" }, "colors.colorPalette.danger": { value: "var(--Tight-colors-colorPalette-danger)", variable: "var(--Tight-colors-colorPalette-danger)" }, "colors.colorPalette.danger.strong": { value: "var(--Tight-colors-colorPalette-danger-strong)", variable: "var(--Tight-colors-colorPalette-danger-strong)" }, "colors.colorPalette.background": { value: "var(--Tight-colors-colorPalette-background)", variable: "var(--Tight-colors-colorPalette-background)" }, "colors.colorPalette.background.hover": { value: "var(--Tight-colors-colorPalette-background-hover)", variable: "var(--Tight-colors-colorPalette-background-hover)" }, "colors.colorPalette.hover": { value: "var(--Tight-colors-colorPalette-hover)", variable: "var(--Tight-colors-colorPalette-hover)" }, "colors.colorPalette.foreground": { value: "var(--Tight-colors-colorPalette-foreground)", variable: "var(--Tight-colors-colorPalette-foreground)" }, "colors.colorPalette.foreground.hover": { value: "var(--Tight-colors-colorPalette-foreground-hover)", variable: "var(--Tight-colors-colorPalette-foreground-hover)" }, "colors.colorPalette.foreground.disabled": { value: "var(--Tight-colors-colorPalette-foreground-disabled)", variable: "var(--Tight-colors-colorPalette-foreground-disabled)" }, "colors.colorPalette.disabled": { value: "var(--Tight-colors-colorPalette-disabled)", variable: "var(--Tight-colors-colorPalette-disabled)" }, "colors.colorPalette.elevated": { value: "var(--Tight-colors-colorPalette-elevated)", variable: "var(--Tight-colors-colorPalette-elevated)" }, "colors.colorPalette.elevated.hover": { value: "var(--Tight-colors-colorPalette-elevated-hover)", variable: "var(--Tight-colors-colorPalette-elevated-hover)" }, "colors.colorPalette.intent.primary": { value: "var(--Tight-colors-colorPalette-intent-primary)", variable: "var(--Tight-colors-colorPalette-intent-primary)" }, "colors.colorPalette.intent.primary.hover": { value: "var(--Tight-colors-colorPalette-intent-primary-hover)", variable: "var(--Tight-colors-colorPalette-intent-primary-hover)" }, "colors.colorPalette.primary.hover": { value: "var(--Tight-colors-colorPalette-primary-hover)", variable: "var(--Tight-colors-colorPalette-primary-hover)" }, "colors.colorPalette.intent.primary.active": { value: "var(--Tight-colors-colorPalette-intent-primary-active)", variable: "var(--Tight-colors-colorPalette-intent-primary-active)" }, "colors.colorPalette.primary.active": { value: "var(--Tight-colors-colorPalette-primary-active)", variable: "var(--Tight-colors-colorPalette-primary-active)" }, "colors.colorPalette.active": { value: "var(--Tight-colors-colorPalette-active)", variable: "var(--Tight-colors-colorPalette-active)" }, "colors.colorPalette.intent.primary.disabled": { value: "var(--Tight-colors-colorPalette-intent-primary-disabled)", variable: "var(--Tight-colors-colorPalette-intent-primary-disabled)" }, "colors.colorPalette.primary.disabled": { value: "var(--Tight-colors-colorPalette-primary-disabled)", variable: "var(--Tight-colors-colorPalette-primary-disabled)" }, "colors.colorPalette.intent.secondary": { value: "var(--Tight-colors-colorPalette-intent-secondary)", variable: "var(--Tight-colors-colorPalette-intent-secondary)" }, "colors.colorPalette.intent.secondary.hover": { value: "var(--Tight-colors-colorPalette-intent-secondary-hover)", variable: "var(--Tight-colors-colorPalette-intent-secondary-hover)" }, "colors.colorPalette.secondary.hover": { value: "var(--Tight-colors-colorPalette-secondary-hover)", variable: "var(--Tight-colors-colorPalette-secondary-hover)" }, "colors.colorPalette.intent.secondary.active": { value: "var(--Tight-colors-colorPalette-intent-secondary-active)", variable: "var(--Tight-colors-colorPalette-intent-secondary-active)" }, "colors.colorPalette.secondary.active": { value: "var(--Tight-colors-colorPalette-secondary-active)", variable: "var(--Tight-colors-colorPalette-secondary-active)" }, "colors.colorPalette.intent.secondary.disabled": { value: "var(--Tight-colors-colorPalette-intent-secondary-disabled)", variable: "var(--Tight-colors-colorPalette-intent-secondary-disabled)" }, "colors.colorPalette.secondary.disabled": { value: "var(--Tight-colors-colorPalette-secondary-disabled)", variable: "var(--Tight-colors-colorPalette-secondary-disabled)" }, "colors.colorPalette.intent.action": { value: "var(--Tight-colors-colorPalette-intent-action)", variable: "var(--Tight-colors-colorPalette-intent-action)" }, "colors.colorPalette.intent.action.hover": { value: "var(--Tight-colors-colorPalette-intent-action-hover)", variable: "var(--Tight-colors-colorPalette-intent-action-hover)" }, "colors.colorPalette.action.hover": { value: "var(--Tight-colors-colorPalette-action-hover)", variable: "var(--Tight-colors-colorPalette-action-hover)" }, "colors.colorPalette.intent.action.active": { value: "var(--Tight-colors-colorPalette-intent-action-active)", variable: "var(--Tight-colors-colorPalette-intent-action-active)" }, "colors.colorPalette.action.active": { value: "var(--Tight-colors-colorPalette-action-active)", variable: "var(--Tight-colors-colorPalette-action-active)" }, "colors.colorPalette.intent.action.disabled": { value: "var(--Tight-colors-colorPalette-intent-action-disabled)", variable: "var(--Tight-colors-colorPalette-intent-action-disabled)" }, "colors.colorPalette.action.disabled": { value: "var(--Tight-colors-colorPalette-action-disabled)", variable: "var(--Tight-colors-colorPalette-action-disabled)" }, "colors.colorPalette.intent.action.discrete": { value: "var(--Tight-colors-colorPalette-intent-action-discrete)", variable: "var(--Tight-colors-colorPalette-intent-action-discrete)" }, "colors.colorPalette.action.discrete": { value: "var(--Tight-colors-colorPalette-action-discrete)", variable: "var(--Tight-colors-colorPalette-action-discrete)" }, "colors.colorPalette.discrete": { value: "var(--Tight-colors-colorPalette-discrete)", variable: "var(--Tight-colors-colorPalette-discrete)" }, "colors.colorPalette.intent.action.discrete.hover": { value: "var(--Tight-colors-colorPalette-intent-action-discrete-hover)", variable: "var(--Tight-colors-colorPalette-intent-action-discrete-hover)" }, "colors.colorPalette.action.discrete.hover": { value: "var(--Tight-colors-colorPalette-action-discrete-hover)", variable: "var(--Tight-colors-colorPalette-action-discrete-hover)" }, "colors.colorPalette.discrete.hover": { value: "var(--Tight-colors-colorPalette-discrete-hover)", variable: "var(--Tight-colors-colorPalette-discrete-hover)" }, "colors.colorPalette.intent.action.discrete.active": { value: "var(--Tight-colors-colorPalette-intent-action-discrete-active)", variable: "var(--Tight-colors-colorPalette-intent-action-discrete-active)" }, "colors.colorPalette.action.discrete.active": { value: "var(--Tight-colors-colorPalette-action-discrete-active)", variable: "var(--Tight-colors-colorPalette-action-discrete-active)" }, "colors.colorPalette.discrete.active": { value: "var(--Tight-colors-colorPalette-discrete-active)", variable: "var(--Tight-colors-colorPalette-discrete-active)" }, "colors.colorPalette.intent.success": { value: "var(--Tight-colors-colorPalette-intent-success)", variable: "var(--Tight-colors-colorPalette-intent-success)" }, "colors.colorPalette.intent.success.hover": { value: "var(--Tight-colors-colorPalette-intent-success-hover)", variable: "var(--Tight-colors-colorPalette-intent-success-hover)" }, "colors.colorPalette.success.hover": { value: "var(--Tight-colors-colorPalette-success-hover)", variable: "var(--Tight-colors-colorPalette-success-hover)" }, "colors.colorPalette.intent.success.active": { value: "var(--Tight-colors-colorPalette-intent-success-active)", variable: "var(--Tight-colors-colorPalette-intent-success-active)" }, "colors.colorPalette.success.active": { value: "var(--Tight-colors-colorPalette-success-active)", variable: "var(--Tight-colors-colorPalette-success-active)" }, "colors.colorPalette.intent.success.disabled": { value: "var(--Tight-colors-colorPalette-intent-success-disabled)", variable: "var(--Tight-colors-colorPalette-intent-success-disabled)" }, "colors.colorPalette.success.disabled": { value: "var(--Tight-colors-colorPalette-success-disabled)", variable: "var(--Tight-colors-colorPalette-success-disabled)" }, "colors.colorPalette.intent.warning": { value: "var(--Tight-colors-colorPalette-intent-warning)", variable: "var(--Tight-colors-colorPalette-intent-warning)" }, "colors.colorPalette.intent.warning.hover": { value: "var(--Tight-colors-colorPalette-intent-warning-hover)", variable: "var(--Tight-colors-colorPalette-intent-warning-hover)" }, "colors.colorPalette.warning.hover": { value: "var(--Tight-colors-colorPalette-warning-hover)", variable: "var(--Tight-colors-colorPalette-warning-hover)" }, "colors.colorPalette.intent.warning.active": { value: "var(--Tight-colors-colorPalette-intent-warning-active)", variable: "var(--Tight-colors-colorPalette-intent-warning-active)" }, "colors.colorPalette.warning.active": { value: "var(--Tight-colors-colorPalette-warning-active)", variable: "var(--Tight-colors-colorPalette-warning-active)" }, "colors.colorPalette.intent.warning.disabled": { value: "var(--Tight-colors-colorPalette-intent-warning-disabled)", variable: "var(--Tight-colors-colorPalette-intent-warning-disabled)" }, "colors.colorPalette.warning.disabled": { value: "var(--Tight-colors-colorPalette-warning-disabled)", variable: "var(--Tight-colors-colorPalette-warning-disabled)" }, "colors.colorPalette.intent.danger": { value: "var(--Tight-colors-colorPalette-intent-danger)", variable: "var(--Tight-colors-colorPalette-intent-danger)" }, "colors.colorPalette.intent.danger.hover": { value: "var(--Tight-colors-colorPalette-intent-danger-hover)", variable: "var(--Tight-colors-colorPalette-intent-danger-hover)" }, "colors.colorPalette.danger.hover": { value: "var(--Tight-colors-colorPalette-danger-hover)", variable: "var(--Tight-colors-colorPalette-danger-hover)" }, "colors.colorPalette.intent.danger.active": { value: "var(--Tight-colors-colorPalette-intent-danger-active)", variable: "var(--Tight-colors-colorPalette-intent-danger-active)" }, "colors.colorPalette.danger.active": { value: "var(--Tight-colors-colorPalette-danger-active)", variable: "var(--Tight-colors-colorPalette-danger-active)" }, "colors.colorPalette.intent.danger.disabled": { value: "var(--Tight-colors-colorPalette-intent-danger-disabled)", variable: "var(--Tight-colors-colorPalette-intent-danger-disabled)" }, "colors.colorPalette.danger.disabled": { value: "var(--Tight-colors-colorPalette-danger-disabled)", variable: "var(--Tight-colors-colorPalette-danger-disabled)" }, "colors.colorPalette.base": { value: "var(--Tight-colors-colorPalette-base)", variable: "var(--Tight-colors-colorPalette-base)" }, "colors.colorPalette.base.weak": { value: "var(--Tight-colors-colorPalette-base-weak)", variable: "var(--Tight-colors-colorPalette-base-weak)" }, "colors.colorPalette.contrast": { value: "var(--Tight-colors-colorPalette-contrast)", variable: "var(--Tight-colors-colorPalette-contrast)" }, "colors.colorPalette.contrast.weak": { value: "var(--Tight-colors-colorPalette-contrast-weak)", variable: "var(--Tight-colors-colorPalette-contrast-weak)" }, "colors.colorPalette.accent.success": { value: "var(--Tight-colors-colorPalette-accent-success)", variable: "var(--Tight-colors-colorPalette-accent-success)" }, "colors.colorPalette.accent.warning": { value: "var(--Tight-colors-colorPalette-accent-warning)", variable: "var(--Tight-colors-colorPalette-accent-warning)" }, "colors.colorPalette.accent.danger": { value: "var(--Tight-colors-colorPalette-accent-danger)", variable: "var(--Tight-colors-colorPalette-accent-danger)" }, "colors.colorPalette.accent.action": { value: "var(--Tight-colors-colorPalette-accent-action)", variable: "var(--Tight-colors-colorPalette-accent-action)" }, "colors.colorPalette.body": { value: "var(--Tight-colors-colorPalette-body)", variable: "var(--Tight-colors-colorPalette-body)" }, "colors.colorPalette.label": { value: "var(--Tight-colors-colorPalette-label)", variable: "var(--Tight-colors-colorPalette-label)" }, "colors.colorPalette.label.sub": { value: "var(--Tight-colors-colorPalette-label-sub)", variable: "var(--Tight-colors-colorPalette-label-sub)" }, "colors.colorPalette.sub": { value: "var(--Tight-colors-colorPalette-sub)", variable: "var(--Tight-colors-colorPalette-sub)" }, "colors.colorPalette.label.strong": { value: "var(--Tight-colors-colorPalette-label-strong)", variable: "var(--Tight-colors-colorPalette-label-strong)" }, "colors.colorPalette.label.strongSub": { value: "var(--Tight-colors-colorPalette-label-strongSub)", variable: "var(--Tight-colors-colorPalette-label-strongSub)" }, "colors.colorPalette.strongSub": { value: "var(--Tight-colors-colorPalette-strongSub)", variable: "var(--Tight-colors-colorPalette-strongSub)" }, "colors.colorPalette.label.emphasisSub": { value: "var(--Tight-colors-colorPalette-label-emphasisSub)", variable: "var(--Tight-colors-colorPalette-label-emphasisSub)" }, "colors.colorPalette.emphasisSub": { value: "var(--Tight-colors-colorPalette-emphasisSub)", variable: "var(--Tight-colors-colorPalette-emphasisSub)" }, "colors.colorPalette.heading": { value: "var(--Tight-colors-colorPalette-heading)", variable: "var(--Tight-colors-colorPalette-heading)" }, "colors.colorPalette.metric.sm": { value: "var(--Tight-colors-colorPalette-metric-sm)", variable: "var(--Tight-colors-colorPalette-metric-sm)" }, "colors.colorPalette.sm": { value: "var(--Tight-colors-colorPalette-sm)", variable: "var(--Tight-colors-colorPalette-sm)" }, "colors.colorPalette.metric.md": { value: "var(--Tight-colors-colorPalette-metric-md)", variable: "var(--Tight-colors-colorPalette-metric-md)" }, "colors.colorPalette.md": { value: "var(--Tight-colors-colorPalette-md)", variable: "var(--Tight-colors-colorPalette-md)" }, "colors.colorPalette.metric.lg": { value: "var(--Tight-colors-colorPalette-metric-lg)", variable: "var(--Tight-colors-colorPalette-metric-lg)" }, "colors.colorPalette.lg": { value: "var(--Tight-colors-colorPalette-lg)", variable: "var(--Tight-colors-colorPalette-lg)" }, "colors.colorPalette.metric.xl": { value: "var(--Tight-colors-colorPalette-metric-xl)", variable: "var(--Tight-colors-colorPalette-metric-xl)" }, "colors.colorPalette.xl": { value: "var(--Tight-colors-colorPalette-xl)", variable: "var(--Tight-colors-colorPalette-xl)" }, "colors.colorPalette.layout.weak": { value: "var(--Tight-colors-colorPalette-layout-weak)", variable: "var(--Tight-colors-colorPalette-layout-weak)" }, "colors.colorPalette.layout": { value: "var(--Tight-colors-colorPalette-layout)", variable: "var(--Tight-colors-colorPalette-layout)" }, "colors.colorPalette.layout.strong": { value: "var(--Tight-colors-colorPalette-layout-strong)", variable: "var(--Tight-colors-colorPalette-layout-strong)" }, "colors.colorPalette.positive": { value: "var(--Tight-colors-colorPalette-positive)", variable: "var(--Tight-colors-colorPalette-positive)" }, "colors.colorPalette.positive.weak": { value: "var(--Tight-colors-colorPalette-positive-weak)", variable: "var(--Tight-colors-colorPalette-positive-weak)" }, "colors.colorPalette.negative": { value: "var(--Tight-colors-colorPalette-negative)", variable: "var(--Tight-colors-colorPalette-negative)" }, "colors.colorPalette.negative.weak": { value: "var(--Tight-colors-colorPalette-negative-weak)", variable: "var(--Tight-colors-colorPalette-negative-weak)" } };
|
|
1000
|
-
function po(e2, t2) {
|
|
1001
|
-
return go[e2]?.value || t2;
|
|
1002
|
-
}
|
|
1003
|
-
po.var = function(e2, t2) {
|
|
1004
|
-
return go[e2]?.variable || t2;
|
|
1005
|
-
};
|
|
1006
|
-
const vo = At(null, ft({ borderRadius: "50%", flexShrink: 0 })), mo = At(null, ft({ display: "flex", flexDirection: "row", gap: "10px", alignItems: "center", minWidth: 0 })), bo = po.var("colors.surface.foreground.disabled");
|
|
1007
|
-
function fo({ color: e2 = bo, diameter: t2 = 17, label: r2 }) {
|
|
1008
|
-
return S("div", { ...mo, "data-testid": "bullet-row", children: [k("div", { ...vo, style: { backgroundColor: e2, width: `${t2}px`, height: `${t2}px` }, "data-testid": "bullet" }), r2 && k(co, { children: r2 })] });
|
|
1009
|
-
}
|
|
1010
|
-
const yo = At(null, ft({ display: "flex", flexDirection: "row", alignItems: "center", gap: "30px" }));
|
|
1011
|
-
function To({ payload: e2 }) {
|
|
1012
|
-
return void 0 === e2 ? null : k("div", { ...yo, children: e2.map((e3, t2) => "none" !== e3.type && k(fo, { color: e3.color, label: e3.value, diameter: 17 }, t2)) });
|
|
1013
|
-
}
|
|
1014
|
-
const xo = { right: 20, left: 20 }, wo = ["income", "profit", "expenses", "loss"], ko = (e2) => wo.findIndex((t2) => t2 === e2.dataKey), Co = { paddingBottom: "20px", marginLeft: "-20px" }, So = { stackId: "stack", isAnimationActive: false }, Eo = At(kt["profit-loss-graph"], ft({ "& .recharts-surface": { outline: "none" } })), Io = po.var("colors.money"), Po = po.var("colors.border.layout"), Ao = po.var("colors.border.layout.strong"), Do = { fill: po.var("colors.typography.base"), fontSize: po.var("fontSizes.metric.sm") }, Mo = { profit: po.var("colors.money.positive"), income: po.var("colors.money.positive.weak"), loss: po.var("colors.money.negative"), expenses: po.var("colors.money.negative.weak") }, No = [0, 100], Ro = ["auto", "auto"];
|
|
1015
|
-
function Oo({ data: e2 }) {
|
|
1016
|
-
const [t2, r2] = v(true);
|
|
1017
|
-
if (void 0 === e2) return null;
|
|
1018
|
-
const n2 = e2.hasAnyData ? Ro : No;
|
|
1019
|
-
return k(R, { width: "100%", height: "100%", ...Eo, children: S(O, { data: e2.months, stackOffset: "sign", accessibilityLayer: true, barSize: 35, margin: xo, children: [k(_, { verticalAlign: "top", itemSorter: ko, wrapperStyle: Co, content: ({ payload: e3 }) => k(To, { payload: e3 }) }), k(L, { strokeDasharray: "0", vertical: false, stroke: Po }), k(F, { dataKey: "month", interval: 0, tickLine: false, stroke: Po, tick: Do }), k(W, { type: "number", tickCount: 7, domain: n2, axisLine: false, tickLine: false, stroke: Po, tick: Do, tickFormatter: (e3) => ro(e3) }), k(B, { content: ({ active: e3, payload: t3 }) => k(ho, { active: e3, payload: t3 }), isAnimationActive: false, shared: false }), k(H, { name: "Profit", dataKey: An.profit, fill: Mo.profit, ...So }), k(H, { name: "Income", dataKey: An.income, fill: Mo.income, ...So }), k(H, { name: "Loss", dataKey: An.loss, fill: Mo.loss, ...So }), k(H, { name: "Expenses", dataKey: An.expenses, fill: Mo.expenses, ...So }), k(H, { dataKey: An.noDataHeight, fill: Po, legendType: "none", ...So }), k(z, { y: 0, stroke: Ao }), k(V, { dataKey: An.netIncome, fill: Io, stroke: Io, strokeWidth: 1, legendType: "none", activeDot: false, isAnimationActive: t2, onAnimationStart: () => r2(true), onAnimationEnd: () => r2(false) })] }) });
|
|
1020
|
-
}
|
|
1021
|
-
const _o = ft({ backgroundColor: "surface.elevated", borderRadius: "sm", backgroundImage: "linear-gradient(90deg, {colors.surface.elevated} 30%, {colors.surface.foreground} 50%, {colors.surface.elevated} 70%)", backgroundSize: "400%", backgroundPosition: "100% 0", animation: "shimmer" });
|
|
1022
|
-
function Lo({ styles: e2 }) {
|
|
1023
|
-
const t2 = At(null, _o, e2);
|
|
1024
|
-
return k("div", { ...t2 });
|
|
1025
|
-
}
|
|
1026
|
-
const Fo = ft({ width: "40%", minHeight: 65 });
|
|
1027
|
-
function Wo({ children: e2 }) {
|
|
1028
|
-
return S(C, { children: [k(Lo, { styles: Fo }), k(Gn, { children: e2 })] });
|
|
1029
|
-
}
|
|
1030
|
-
const Bo = At(null, ft({ display: "flex", flexDirection: "row", alignItems: "center", gap: 16 })), Ho = ft({ width: "80px", height: "17px", marginBottom: "10px" }), zo = ft({ width: "100%", height: "100%" });
|
|
1031
|
-
function Vo() {
|
|
1032
|
-
return S(C, { children: [S("div", { ...Bo, children: [k(Lo, { styles: Ho }), k(Lo, { styles: Ho }), k(Lo, { styles: Ho }), k(Lo, { styles: Ho })] }), k(Lo, { styles: zo })] });
|
|
1033
|
-
}
|
|
1034
|
-
function jo({ filter: e2 = zt.PAST_YEAR }) {
|
|
1035
|
-
const { query: { data: t2 }, isFilling: r2 } = function({ filter: e3, grouping: t3 }) {
|
|
1036
|
-
return En({ filter: e3, grouping: t3, select: Mn });
|
|
1037
|
-
}({ filter: e2, grouping: Nn.MONTHLY });
|
|
1038
|
-
return S(Wn, { type: "chart", children: [k(On, { title: "Profit + Loss" }), k(Ln, { children: r2 ? k(Wo, { children: k(Vo, {}) }) : S(C, { children: [k($n, { title: ro(t2?.total ?? 0), label: "Profit" }), k(Gn, { children: k(Oo, { data: t2 }) })] }) })] });
|
|
1039
|
-
}
|
|
1040
|
-
const qo = At(null, ft({ display: "flex", flexDirection: "column", justifyContent: "center", alignItems: "flex-start", gap: "10px", alignSelf: "stretch" }));
|
|
1041
|
-
function Uo({ children: e2 }) {
|
|
1042
|
-
return k("div", { ...qo, children: e2 });
|
|
1043
|
-
}
|
|
1044
|
-
const Ko = "conversations-section", $o = "transactions-section", Yo = { MESSAGE_REVIEW: Ko, TRANSACTION_REVIEW: $o, LINK_BANK: "", RULE_REVIEW: "", BANK_ERROR: "", CSV_IMPORT_REVIEW: "" }, Go = { reviewStatus: { values: ["USER_REVIEW_REQUIRED"], operator: "IN" }, status: { values: ["ACTIVE"], operator: "IN" }, category: { expand: true }, glAccount: { expand: true }, bankAccount: { expand: true } }, Qo = { resolutionStatus: { operator: "IN", values: ["OPEN"] } }, Xo = 10, Zo = [], Jo = [];
|
|
1045
|
-
function ea(e2) {
|
|
1046
|
-
return Tn(`${function(e3) {
|
|
1047
|
-
return wn[e3];
|
|
1048
|
-
}(e2)}`, "v6");
|
|
1049
|
-
}
|
|
1050
|
-
const ta = { base: () => ["tasks"], all: () => ["tasks", {}], of: (e2) => ["tasks", e2 ?? {}] }, ra = { URGENT: 0, HIGH: 1, MEDIUM: 2, LOW: 3 };
|
|
1051
|
-
const na = async (e2) => {
|
|
1052
|
-
const t2 = e2.queryKey, r2 = t2[1], n2 = { path: "/v6/tasks/query", accessToken: t2[2].accessToken, bodyParams: { ...r2 }, endpointManager: ea(t2[2].environment) }, o2 = await fn(n2);
|
|
1053
|
-
return "SUCCESS" === o2.result && void 0 !== o2.data ? { data: o2.data } : { data: void 0 };
|
|
1054
|
-
};
|
|
1055
|
-
const oa = wt({ base: { stroke: "currentColor" }, variants: { primary: { DEFAULT: { stroke: "icon.intent.primary" }, hover: { stroke: "icon.intent.primary.hover" }, active: { stroke: "icon.intent.primary.active" } }, secondary: { DEFAULT: { stroke: "icon.intent.secondary" }, hover: { stroke: "icon.intent.secondary.hover" }, active: { stroke: "icon.intent.secondary.active" } }, success: { DEFAULT: { stroke: "icon.intent.success" }, hover: { stroke: "icon.intent.success.hover" }, active: { stroke: "icon.intent.success.active" } }, warning: { DEFAULT: { stroke: "icon.intent.warning" }, hover: { stroke: "icon.intent.warning.hover" }, active: { stroke: "icon.intent.warning.active" } }, danger: { DEFAULT: { stroke: "icon.intent.danger" }, hover: { stroke: "icon.intent.danger.hover" }, active: { stroke: "icon.intent.danger.active" } }, action: { DEFAULT: { stroke: "icon.intent.action" }, hover: { stroke: "icon.intent.action.hover" }, active: { stroke: "icon.intent.action.active" } } } });
|
|
1056
|
-
function aa(e2, t2) {
|
|
1057
|
-
const r2 = ({ size: t3 = 24, fill: r3 = "transparent", stylists: n2 }) => {
|
|
1058
|
-
const o2 = Ot([At(null, oa()), ...n2]);
|
|
1059
|
-
return k(e2, { ...o2, style: { minHeight: t3, minWidth: t3 }, width: t3, height: t3, fill: r3 });
|
|
1060
|
-
};
|
|
1061
|
-
return r2.displayName = t2, r2;
|
|
1062
|
-
}
|
|
1063
|
-
const ia = aa((e2) => c.createElement("svg", { width: 13, height: 12, viewBox: "0 0 13 12", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e2 }, c.createElement("path", { d: "M8.31473 0.399963L2.71472 5.99997L8.31473 11.6", stroke: "#182428", strokeMiterlimit: 10 })), "ArrowLeft"), la = aa((e2) => c.createElement("svg", { width: 13, height: 12, viewBox: "0 0 13 12", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e2 }, c.createElement("path", { d: "M4.31472 11.6L9.91473 5.99997L4.31472 0.399959", stroke: "#182428", strokeMiterlimit: 10 })), "ArrowRight"), sa = ft({ transition: "background 300ms ease-out, background-color 300ms ease-out, border-color 300ms ease-out, box-shadow 0ms", _supportHover: { transition: "background 100ms ease-out, background-color 100ms ease-out, border-color 100ms ease-out, box-shadow 0ms" } }), ca = ft({ transition: "background 300ms ease-out, box-shadow 0ms", _supportHover: { transition: "background 100ms ease-out, box-shadow 0ms" } }), da = ft({ transition: "color 300ms ease-out", _supportHover: { transition: "color 100ms ease-out" } });
|
|
1064
|
-
ft({ "& > .Tight-text": { transition: "color 300ms ease-out", _supportHover: { transition: "color 100ms ease-out" } } });
|
|
1065
|
-
const ua = ft({ "& path": { transition: "stroke 300ms ease-out", _supportHover: { transition: "stroke 100ms ease-out" } } }), ha = h({ hasNextPage: false, hasPreviousPage: false, getFirstPage: () => {
|
|
1066
|
-
}, getLastPage: () => {
|
|
1067
|
-
}, pageBackwards: () => {
|
|
1068
|
-
}, pageForwards: () => {
|
|
1069
|
-
} });
|
|
1070
|
-
function ga({ Component: e2, stylists: t2 }) {
|
|
1071
|
-
return k(e2, { stylists: [At(kt["small-icon"]), ...t2 ?? []], size: 12 });
|
|
1072
|
-
}
|
|
1073
|
-
const pa = At(null, ft({ backgroundColor: "surface.foreground", border: "{borderWidths.lg} solid", borderRadius: "md", borderColor: "border.layout", color: "typography.base", display: "inline-flex", alignItems: "center", justifyContent: "center", height: { sm: "35px", base: "50px" }, gap: { sm: 0, base: 20 } })), va = At(null, ft({ border: "none", borderRadius: "sm", backgroundColor: "surface.intent.action.discrete", padding: { sm: "4px", base: "12px" }, margin: 0, cursor: "pointer", display: "flex", alignItems: "center", justifyContent: "center", outline: "none", boxShadow: "0 0 0 0 transparent", "&:focus-visible": { outline: "4px solid", outlineColor: "border.layout" }, "&:disabled": { opacity: 0.6, pointerEvents: "none" }, _supportHover: { backgroundColor: "surface.intent.action.discrete.hover" } }), ca), ma = At(null, ft({ display: "flex", gap: "9px", padding: "10px", justifyContent: "center", alignItems: "center" })), ba = At(null, ft({ height: { sm: "12px", base: "20px" }, width: { sm: "12px", base: "20px" } }));
|
|
1074
|
-
function fa() {
|
|
1075
|
-
const { hasNextPage: e2, hasPreviousPage: t2, pageForwards: r2, pageBackwards: n2 } = function() {
|
|
1076
|
-
const e3 = g(ha);
|
|
1077
|
-
if (void 0 === e3) throw new Error("usePaginationContext must be used within a PaginationProvider");
|
|
1078
|
-
return e3;
|
|
1079
|
-
}();
|
|
1080
|
-
return S("div", { ...pa, children: [k("div", { ...ma, children: k("button", { ...va, onClick: n2, disabled: !t2, children: k(ga, { Component: ia, stylists: [ba] }) }) }), k("div", { ...ma, children: k("button", { ...va, onClick: r2, disabled: !e2, children: k(ga, { Component: la, stylists: [ba] }) }) })] });
|
|
1081
|
-
}
|
|
1082
|
-
const ya = ft({ width: "100%", height: "50px" });
|
|
1083
|
-
function Ta() {
|
|
1084
|
-
return k(Lo, { styles: ya });
|
|
1085
|
-
}
|
|
1086
|
-
const xa = At(kt["dashboard-placeholder-table"], ft({ display: "flex", flexDirection: "column", gap: "4px" })), wa = At(null, ft({ display: "flex", flexDirection: "row", alignItems: "center", justifyContent: "space-between", height: "52px", paddingLeft: "64px", paddingRight: "64px" })), ka = ft({ width: "100px", height: "20px" });
|
|
1087
|
-
function Ca({ numColumns: e2 = 6 }) {
|
|
1088
|
-
return S("div", { ...xa, children: [k("div", { ...wa, children: Array.from({ length: e2 }, (e3, t2) => k(Lo, { styles: ka }, t2)) }), k(Ta, {}), k(Ta, {}), k(Ta, {}), k(Ta, {}), k(Ta, {}), k(Ta, {})] });
|
|
1089
|
-
}
|
|
1090
|
-
function Sa(e2, t2) {
|
|
1091
|
-
const r2 = ur(), n2 = mr();
|
|
1092
|
-
return m((o2) => {
|
|
1093
|
-
const a2 = cr(r2), i2 = a2 ? {} : { retry: false, staleTime: 1 / 0 };
|
|
1094
|
-
return pr.prefetchQuery({ queryKey: or(e2(o2), r2 ?? "", n2), queryFn: a2 ? t2 : hr, ...i2 });
|
|
1095
|
-
}, [e2, t2, r2, n2]);
|
|
1096
|
-
}
|
|
1097
|
-
const Ea = Object.freeze({}), Ia = Object.freeze({ cursor: "FINAL_PAGE" });
|
|
1098
|
-
function Pa({ queryKey: e2, queryFn: t2, ...r2 }) {
|
|
1099
|
-
const [n2, o2] = v(Ea), i2 = d(e2);
|
|
1100
|
-
a(i2.current, e2) || (i2.current = e2, o2(Ea));
|
|
1101
|
-
const l2 = br({ ...r2, queryKey: ar(e2, n2), queryFn: t2, keepPreviousDataPlaceholder: true }), s2 = u(() => {
|
|
1102
|
-
return e3 = l2.query.data?.cursor, t3 = o2, { getFirstPage: () => t3(Ea), getLastPage: () => t3(Ia), hasNextPage: lr(e3?.after), hasPreviousPage: lr(e3?.before), pageForwards: () => {
|
|
1103
|
-
e3?.after && t3({ cursor: e3.after });
|
|
1104
|
-
}, pageBackwards: () => {
|
|
1105
|
-
e3?.before && t3({ cursor: e3.before });
|
|
1106
|
-
} };
|
|
1107
|
-
var e3, t3;
|
|
1108
|
-
}, [l2.query.data?.cursor]), c2 = Sa(m((t3) => ar(e2, t3), [e2]), t2), h2 = Sa(m((t3) => ar(e2, t3), [e2]), t2);
|
|
1109
|
-
return b(() => {
|
|
1110
|
-
const e3 = l2.query.data?.cursor;
|
|
1111
|
-
!l2.query.isFetching && e3 && (e3.after && c2({ cursor: e3.after }).catch((e4) => {
|
|
1112
|
-
tn({ error: e4, severity: "error" });
|
|
1113
|
-
}), e3.before && h2({ cursor: e3.before }).catch((e4) => {
|
|
1114
|
-
tn({ error: e4, severity: "error" });
|
|
1115
|
-
}));
|
|
1116
|
-
}, [l2.query.data?.cursor, l2.query.isFetching, c2, h2]), { ...l2, paginationControls: s2 };
|
|
1117
|
-
}
|
|
1118
|
-
async function Aa({ authorization: e2, extraHeaders: t2, includeCredentials: r2, params: n2, url: o2, cache: a2 }) {
|
|
1119
|
-
const i2 = dn({ extraHeaders: t2, authorization: e2 }), l2 = sn({ url: o2, params: n2 }), s2 = gn();
|
|
1120
|
-
en("HTTP GET Request", { url: o2, accessToken: e2 });
|
|
1121
|
-
try {
|
|
1122
|
-
const e3 = await fetch(l2, { method: "GET", headers: i2, credentials: s2, cache: a2 });
|
|
1123
|
-
return en("HTTP GET Response", { url: o2, status: e3.status, statusText: e3.statusText }), un(e3);
|
|
1124
|
-
} catch (e3) {
|
|
1125
|
-
return Promise.reject(e3);
|
|
1126
|
-
}
|
|
1127
|
-
}
|
|
1128
|
-
async function Da(e2) {
|
|
1129
|
-
const { url: t2, headers: r2 } = vn(e2);
|
|
1130
|
-
return Aa({ url: t2, params: e2.params, includeCredentials: true, extraHeaders: r2 });
|
|
1131
|
-
}
|
|
1132
|
-
async function Ma(e2) {
|
|
1133
|
-
return Da({ ...e2, endpointManager: ea(e2.environment) });
|
|
1134
|
-
}
|
|
1135
|
-
async function Na(e2) {
|
|
1136
|
-
return Da({ ...e2, endpointManager: kn(e2.environment) });
|
|
1137
|
-
}
|
|
1138
|
-
function Ra({ delay: e2, callback: t2 }) {
|
|
1139
|
-
const r2 = u(() => function({ delay: e3, callback: t3 }) {
|
|
1140
|
-
let r3;
|
|
1141
|
-
const n2 = () => {
|
|
1142
|
-
r3 && (clearTimeout(r3), r3 = void 0);
|
|
1143
|
-
};
|
|
1144
|
-
return { startCallback: (o2) => {
|
|
1145
|
-
n2(), r3 = setTimeout(() => {
|
|
1146
|
-
t3(o2);
|
|
1147
|
-
}, e3);
|
|
1148
|
-
}, cancelCallback: () => n2() };
|
|
1149
|
-
}({ delay: e2, callback: t2 }), [e2, t2]);
|
|
1150
|
-
b(() => () => {
|
|
1151
|
-
r2.cancelCallback();
|
|
1152
|
-
}, [r2]);
|
|
1153
|
-
return { startCallback: m((e3) => {
|
|
1154
|
-
r2.startCallback(e3);
|
|
1155
|
-
}, [r2]), cancelCallback: m(() => {
|
|
1156
|
-
r2.cancelCallback();
|
|
1157
|
-
}, [r2]) };
|
|
1158
|
-
}
|
|
1159
|
-
function Oa({ prefetchFn: e2 }) {
|
|
1160
|
-
const { startCallback: t2, cancelCallback: r2 } = Ra({ delay: 250, callback: e2 });
|
|
1161
|
-
return { startPrefetch: t2, cancelPrefetch: r2 };
|
|
1162
|
-
}
|
|
1163
|
-
const _a = { CREATED_DATE_TIME: "CREATED_DATE_TIME", SUBJECT: "SUBJECT", EMAIL: "EMAIL", LAST_MESSAGE_CREATED_DATE_TIME: "LAST_MESSAGE_CREATED_DATE_TIME", LAST_MESSAGE_TEXT: "LAST_MESSAGE_TEXT" }, La = { ASC: "ASC", DESC: "DESC" }, Fa = { base: () => ["conversations"], all: () => ["conversations", {}], of: (e2) => ["conversations", e2 ?? {}], conversation: (e2) => ["conversations", "conversation", e2] }, Wa = async (e2) => {
|
|
1164
|
-
const t2 = e2.queryKey, r2 = { path: "/v6/conversations/query", bodyParams: { ...t2[1], cursor: t2[2].cursor }, accessToken: t2[3].accessToken, endpointManager: ea(t2[3].environment) }, n2 = await fn(r2);
|
|
1165
|
-
return "SUCCESS" === n2.result && void 0 !== n2.data ? { data: n2.data, cursor: n2.cursor } : { data: void 0, cursor: void 0 };
|
|
1166
|
-
};
|
|
1167
|
-
function Ba(e2) {
|
|
1168
|
-
return Pa({ queryKey: e2 ? Fa.of(e2) : Fa.all(), queryFn: Wa });
|
|
1169
|
-
}
|
|
1170
|
-
const Ha = async (e2) => {
|
|
1171
|
-
const t2 = e2.queryKey, { id: r2 } = t2[2], n2 = { path: "/v6/conversations/{id}", pathParams: { id: r2 }, accessToken: t2[3].accessToken, environment: t2[3].environment }, o2 = await Ma(n2);
|
|
1172
|
-
return "SUCCESS" === o2.result && void 0 !== o2.data ? o2.data : null;
|
|
1173
|
-
};
|
|
1174
|
-
function za(e2) {
|
|
1175
|
-
const t2 = lr(e2), r2 = { id: e2 ?? "" };
|
|
1176
|
-
return br({ queryKey: Fa.conversation(r2), queryFn: Ha, enabled: t2 });
|
|
1177
|
-
}
|
|
1178
|
-
const Va = async ({ data: e2, accessToken: t2, environment: r2 }) => {
|
|
1179
|
-
const n2 = { path: "/v6/conversations", bodyParams: e2, accessToken: t2, endpointManager: ea(r2) };
|
|
1180
|
-
return await fn(n2);
|
|
1181
|
-
};
|
|
1182
|
-
function ja() {
|
|
1183
|
-
return Oa({ prefetchFn: Sa(Fa.conversation, Ha) });
|
|
1184
|
-
}
|
|
1185
|
-
function qa(e2) {
|
|
1186
|
-
const t2 = e2.getSize(), r2 = e2.columnDef.maxSize;
|
|
1187
|
-
return { flex: `${t2} 0 auto`, width: t2, maxWidth: void 0 !== r2 ? `${r2}px` : "auto" };
|
|
1188
|
-
}
|
|
1189
|
-
function Ua({ header: e2 }) {
|
|
1190
|
-
const t2 = qa(e2.column);
|
|
1191
|
-
return k("div", { ...At(kt["dashboard-table-column-header"]), style: t2, children: e2.isPlaceholder ? null : j(e2.column.columnDef.header, e2.getContext()) });
|
|
1192
|
-
}
|
|
1193
|
-
const Ka = At(kt["dashboard-table-header"], ft({ display: "flex", flexDirection: "row", alignItems: "center", paddingBlock: "10px" }));
|
|
1194
|
-
function $a({ headerGroups: e2 }) {
|
|
1195
|
-
return k("div", { children: e2.map((e3) => f("div", { ...Ka, key: e3.id }, e3.headers.map((e4) => k(Ua, { header: e4 }, e4.id)))) });
|
|
1196
|
-
}
|
|
1197
|
-
const Ya = At(kt["dashboard-table-body"], ft({ display: "flex", flexDirection: "column" }));
|
|
1198
|
-
function Ga({ children: e2 }) {
|
|
1199
|
-
return k("div", { ...Ya, children: e2 });
|
|
1200
|
-
}
|
|
1201
|
-
const Qa = wt({ base: {}, variants: { alignment: { vertical: { width: "{borderWidths.md}", minWidth: "{borderWidths.md}", height: "100%" }, horizontal: { width: "100%", height: "{borderWidths.md}", minHeight: "{borderWidths.md}" } }, color: { normal: { backgroundColor: "border.layout" }, strong: { backgroundColor: "border.layout.strong" } } } });
|
|
1202
|
-
function Xa({ alignment: e2 = "vertical", color: t2 = "normal", additionalClassName: r2 }) {
|
|
1203
|
-
const n2 = At("vertical" === e2 ? kt["vertical-divider"] : kt["horizontal-divider"], r2, Qa({ alignment: e2, color: t2 }));
|
|
1204
|
-
return k("div", { ...n2 });
|
|
1205
|
-
}
|
|
1206
|
-
function Za() {
|
|
1207
|
-
return k(Xa, { additionalClassName: kt["table-cell-divider"] });
|
|
1208
|
-
}
|
|
1209
|
-
function Ja({ cell: e2, index: t2, onCellClick: r2, shouldDisplayDivider: n2 }) {
|
|
1210
|
-
const o2 = qa(e2.column), a2 = At(kt["dashboard-table-cell"], ft({ height: "100%", display: "flex", justifyContent: "center", flexDirection: "column" })), i2 = At(null, ft({ display: "flex", flexDirection: "row", height: "100%" })), l2 = n2(t2);
|
|
1211
|
-
return S("div", { ...i2, style: o2, onClick: () => {
|
|
1212
|
-
r2 && r2(e2);
|
|
1213
|
-
}, children: [l2 && k(Za, {}), k("div", { style: o2, ...a2, children: j(e2.column.columnDef.cell, e2.getContext()) })] });
|
|
1214
|
-
}
|
|
1215
|
-
const ei = At(kt["table-sub-row"], ft({ display: "flex", alignItems: "center", justifyContent: "flex-start", height: "60px", overflow: "hidden", minWidth: "fit-content", borderRadius: "zero" }));
|
|
1216
|
-
function ti({ rowData: e2, onCellClick: t2, shouldDisplayDivider: r2 }) {
|
|
1217
|
-
const n2 = e2.getVisibleCells();
|
|
1218
|
-
return k("div", { ...ei, children: n2.map((e3, n3) => k(Ja, { cell: e3, index: n3, onCellClick: t2, shouldDisplayDivider: r2, isChild: true }, e3.id)) });
|
|
1219
|
-
}
|
|
1220
|
-
const ri = ft({ display: "flex", flexDirection: "column", borderRadius: "zero", cursor: "pointer", minWidth: "fit-content" }), ni = ft({ background: "surface.background" }), oi = At(kt["table-row"], ft({ display: "flex", alignItems: "center", justifyContent: "flex-start", height: { sm: "60px", base: "85px" }, minWidth: "fit-content" }));
|
|
1221
|
-
function ai({ rowData: e2, onMouseEnter: t2, onMouseLeave: r2, onCellClick: n2, shouldDisplayDivider: o2 }) {
|
|
1222
|
-
const a2 = e2.getIsExpanded(), i2 = At(kt["table-parent-row"], ri, e2.index % 2 == 0 ? ni : void 0), l2 = e2.getVisibleCells();
|
|
1223
|
-
return S("div", { ...i2, onMouseEnter: t2, onMouseLeave: r2, children: [k("div", { ...oi, children: l2.map((e3, t3) => k(Ja, { cell: e3, index: t3, onCellClick: n2, shouldDisplayDivider: o2 }, e3.id)) }), a2 && k("div", { children: e2.subRows.map((e3) => k(ti, { rowData: e3, onCellClick: n2, shouldDisplayDivider: o2 }, e3.id)) })] });
|
|
1224
|
-
}
|
|
1225
|
-
const ii = (e2, t2 = {}) => {
|
|
1226
|
-
Me.getState().openDrawer(e2, t2);
|
|
1227
|
-
}, li = () => {
|
|
1228
|
-
Me.getState().closeAllDrawers();
|
|
1229
|
-
}, si = () => {
|
|
1230
|
-
Me.getState().closeDrawer();
|
|
1231
|
-
}, ci = { DATE: "DATE", DESCRIPTION: "DESCRIPTION", AMOUNT: "AMOUNT", STATUS: "STATUS", REVIEW_STATUS: "REVIEW_STATUS" }, di = { ASC: "ASC", DESC: "DESC" }, ui = { base: () => ["banks", "transactions"], all: () => ["banks", "transactions", {}], of: (e2) => ["banks", "transactions", e2 ?? {}], single: (e2) => ["banks", "transactions", e2.id] }, hi = async (e2) => {
|
|
1232
|
-
const t2 = e2.queryKey, r2 = { path: "/v6/banks/transactions/query", bodyParams: { ...t2[2], cursor: t2[3].cursor }, accessToken: t2[4].accessToken, endpointManager: ea(t2[4].environment) }, n2 = await fn(r2);
|
|
1233
|
-
return "SUCCESS" === n2.result && void 0 !== n2.data ? { data: n2.data, cursor: n2.cursor } : { data: void 0, cursor: void 0 };
|
|
1234
|
-
};
|
|
1235
|
-
function gi(e2) {
|
|
1236
|
-
return Pa({ queryKey: ui.of(e2), queryFn: hi });
|
|
1237
|
-
}
|
|
1238
|
-
const pi = async (e2) => {
|
|
1239
|
-
const t2 = e2.queryKey, r2 = { path: "/v6/banks/transactions/{id}", pathParams: { id: t2[2] }, accessToken: t2[3].accessToken, environment: t2[3].environment }, n2 = await Ma(r2);
|
|
1240
|
-
return "SUCCESS" === n2.result && void 0 !== n2.data ? n2.data : null;
|
|
1241
|
-
};
|
|
1242
|
-
function vi({ id: e2 }) {
|
|
1243
|
-
return br({ queryKey: ui.single({ id: e2 }), queryFn: pi });
|
|
1244
|
-
}
|
|
1245
|
-
function mi() {
|
|
1246
|
-
return Oa({ prefetchFn: Sa(ui.single, pi) });
|
|
1247
|
-
}
|
|
1248
|
-
const bi = { BANK_ACCOUNT: "bka", GL_ACCOUNT: "gla", TRANSACTION_CATEGORY: "ctg", BANK_TRANSACTION: "btxn", PROCESSOR_TRANSACTION: "ptxn", TRANSACTION_LINE_ITEM: "tli" };
|
|
1249
|
-
function fi(e2, t2) {
|
|
1250
|
-
return !sr(e2) && e2.startsWith(t2);
|
|
1251
|
-
}
|
|
1252
|
-
const yi = { all: () => ["messages"], of: (e2) => ["messages", e2] };
|
|
1253
|
-
function Ti(e2) {
|
|
1254
|
-
if (ir(e2) || 0 === e2.length) return null;
|
|
1255
|
-
const t2 = [[e2[0]]];
|
|
1256
|
-
for (let r2 = 1; r2 < e2.length; r2++) {
|
|
1257
|
-
const n2 = e2[r2], o2 = t2[t2.length - 1], a2 = o2[0].author.userId;
|
|
1258
|
-
n2.author.userId === a2 ? o2.push(n2) : t2.push([n2]);
|
|
1259
|
-
}
|
|
1260
|
-
return t2;
|
|
1261
|
-
}
|
|
1262
|
-
const xi = async (e2) => {
|
|
1263
|
-
const t2 = e2.queryKey, { id: r2 } = t2[1], n2 = { path: "/v6/conversations/{id}/messages", pathParams: { id: r2 }, accessToken: t2[2].accessToken, environment: t2[2].environment }, o2 = await Ma(n2);
|
|
1264
|
-
return "SUCCESS" === o2.result && void 0 !== o2.data ? o2.data : null;
|
|
1265
|
-
};
|
|
1266
|
-
const wi = async ({ data: e2, accessToken: t2, environment: r2 }) => {
|
|
1267
|
-
const n2 = { path: "/v6/messages", bodyParams: { data: [e2] }, endpointManager: ea(r2), accessToken: t2 };
|
|
1268
|
-
return await fn(n2);
|
|
1269
|
-
};
|
|
1270
|
-
function ki() {
|
|
1271
|
-
return Oa({ prefetchFn: Sa(yi.of, xi) });
|
|
1272
|
-
}
|
|
1273
|
-
const Ci = (e2, t2, r2, n2) => {
|
|
1274
|
-
n2 ? ii("MobileConversation", { routeProps: { conversationId: e2, transactionId: t2 } }) : lr(t2) && r2 ? ii("BankTransactionFormRouter", { routeProps: { transactionId: t2, initialTab: "conversation" } }) : function(e3) {
|
|
1275
|
-
ii("Conversation", { routeProps: { conversationId: e3 } });
|
|
1276
|
-
}(e2);
|
|
1277
|
-
};
|
|
1278
|
-
function Si({ rowData: e2, isMobile: t2 }) {
|
|
1279
|
-
const { startPrefetch: r2, cancelPrefetch: n2 } = ja(), { startPrefetch: o2, cancelPrefetch: a2 } = ki(), { startPrefetch: i2, cancelPrefetch: l2 } = mi(), s2 = fi(e2.original.attachedEntityId, bi.BANK_TRANSACTION), c2 = m(() => {
|
|
1280
|
-
lr(e2.original.attachedEntityId) && s2 && i2({ id: e2.original.attachedEntityId }), o2({ id: e2.original.id }), r2({ id: e2.original.id });
|
|
1281
|
-
}, [e2.original.attachedEntityId, e2.original.id, s2, o2, r2, i2]), d2 = m(() => {
|
|
1282
|
-
lr(e2.original.attachedEntityId) && s2 && l2(), a2(), n2();
|
|
1283
|
-
}, [l2, n2, s2, a2, e2.original.attachedEntityId]);
|
|
1284
|
-
return k(ai, { rowData: e2, onMouseEnter: c2, onMouseLeave: d2, shouldDisplayDivider: (e3) => 0 !== e3, onCellClick: () => Ci(e2.original.id, e2.original.attachedEntityId, s2, t2) });
|
|
1285
|
-
}
|
|
1286
|
-
const Ei = aa((e2) => c.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 15, height: 15, viewBox: "0 0 15 15", fill: "none", ...e2 }, c.createElement("path", { d: "M0.328064 7.5H14.6719", strokeMiterlimit: 10 }), c.createElement("path", { d: "M7.5 0.328064V14.6719", strokeMiterlimit: 10 })), "Plus"), Ii = ft({ display: "flex", alignItems: "center", justifyContent: "center", outline: "none", cursor: "pointer", borderRadius: "md", "&:focus-visible": { outline: "4px solid", outlineColor: "border.layout", outlineOffset: "-1px" }, "&:disabled": { cursor: "not-allowed", opacity: 0.6 } }), Pi = ft({ color: "typography.intent.secondary", border: "{borderWidths.md} solid", borderColor: "border.layout", backgroundColor: "surface.intent.action.discrete", _supportHover: { _notDisabled: { backgroundColor: "surface.intent.action.discrete.hover", borderColor: "border.layout", "& .Tight-text": { color: "typography.intent.secondary.hover" } } }, "&:active:enabled, &[data-active='true']:enabled": { backgroundColor: "surface.intent.action.discrete.active", "& .Tight-text": { color: "typography.intent.secondary.active" } }, "& .Tight-text": { color: "typography.intent.secondary" } }), Ai = ft({ padding: "10px", fontSize: "md", fontWeight: "md", gap: "9px" }), Di = { default: Ai, small: ft({ padding: "6px", fontSize: "sm", fontWeight: "sm", gap: "5px" }) }, Mi = (e2) => {
|
|
1287
|
-
const t2 = Di[e2];
|
|
1288
|
-
return At(kt["button-base"], ft({ width: "fit-content" }), t2, Ii, sa);
|
|
1289
|
-
}, Ni = ["default", "small"], Ri = { default: { className: "" }, small: { className: "" } };
|
|
1290
|
-
for (const e2 of Ni) Ri[e2] = Mi(e2);
|
|
1291
|
-
function Oi({ children: e2, stylists: t2 = [], type: r2 = "button", onClick: n2, disabled: o2, size: a2 = "default", active: i2 = false }) {
|
|
1292
|
-
const l2 = Ot([Ri[a2], ...t2]);
|
|
1293
|
-
return k("button", { ...l2, type: r2, onClick: n2, disabled: o2, "data-active": i2, children: e2 });
|
|
1294
|
-
}
|
|
1295
|
-
const _i = At(kt["button-primary"], Pi);
|
|
1296
|
-
function Li({ children: e2, active: t2, stylists: r2 = [], ...n2 }) {
|
|
1297
|
-
return k(Oi, { stylists: [_i, ...r2], active: t2, ...n2, children: e2 });
|
|
1298
|
-
}
|
|
1299
|
-
const Fi = () => {
|
|
1300
|
-
ii("Conversation", { routeProps: { conversationId: null } });
|
|
1301
|
-
};
|
|
1302
|
-
function Wi() {
|
|
1303
|
-
return k(Li, { onClick: Fi, children: k(ga, { Component: Ei }) });
|
|
1304
|
-
}
|
|
1305
|
-
const Bi = wt({ base: { display: "flex", flexDirection: "column", flexGrow: 1, animation: "appear.instant", overflow: "hidden" }, variants: { dashboard: { transactionDashboard: { border: "none" }, businessOwnerDashboard: { marginTop: "10px", border: "{borderWidths.lg} solid {colors.border.layout.strong}", borderRadius: "lg" } } } });
|
|
1306
|
-
function Hi({ children: e2, dashboard: t2 }) {
|
|
1307
|
-
const r2 = At(kt["dashboard-table"], Bi({ dashboard: t2 }));
|
|
1308
|
-
return k("div", { ...r2, children: e2 });
|
|
1309
|
-
}
|
|
1310
|
-
const zi = h(null), Vi = { FROM: "from", SUBJECT: "subject", MESSAGE: "message", DATE: "date", MOBILE: "mobile" }, ji = wt({ base: { fontWeight: "label", fontSize: { sm: "label", base: "lg" }, fontFamily: "label", lineHeight: { sm: "16px", base: "18px" }, letterSpacing: "0.84px", maxWidth: "100%" }, variants: { intent: { default: { color: "typography.label" }, primary: { color: "typography.intent.primary" }, contrast: { color: "typography.contrast" } }, wrap: { ellipsis: Hn, wrap: { whiteSpace: "normal", overflowWrap: "break-word" } } } });
|
|
1311
|
-
function qi({ children: e2, intent: t2 = "default", wrap: r2 = "ellipsis" }) {
|
|
1312
|
-
const n2 = At(kt.label, ji({ intent: t2, wrap: r2 }));
|
|
1313
|
-
return sr(e2) ? null : k("div", { title: "ellipsis" === r2 ? e2 : void 0, ...n2, children: e2 });
|
|
1314
|
-
}
|
|
1315
|
-
const Ui = At(kt["emphasis-label"], ft({ lineHeight: "16px" }));
|
|
1316
|
-
function Ki({ children: e2 }) {
|
|
1317
|
-
return k(ao, { size: "med", weight: "lg", stylists: [Ui], children: e2 });
|
|
1318
|
-
}
|
|
1319
|
-
function $i({ text: e2, isRead: t2 }) {
|
|
1320
|
-
return k(t2 ? qi : Ki, { children: e2 });
|
|
1321
|
-
}
|
|
1322
|
-
const Yi = wt({ base: { padding: "0 25px", height: "100%", display: "flex", justifyContent: "center", flexDirection: "column", width: "100%" }, variants: { alignVariant: { flexStart: { alignItems: "flex-start" }, center: { alignItems: "center" } } }, defaultVariants: { alignVariant: "flexStart" } });
|
|
1323
|
-
function Gi({ children: e2, alignVariant: t2 = "flexStart" }) {
|
|
1324
|
-
const r2 = At(null, Yi({ alignVariant: t2 }));
|
|
1325
|
-
return k("div", { ...r2, children: e2 });
|
|
1326
|
-
}
|
|
1327
|
-
function Qi({ date: e2, isRead: t2 = false }) {
|
|
1328
|
-
const r2 = nr(e2);
|
|
1329
|
-
return k($i, { text: r2, isRead: t2 });
|
|
1330
|
-
}
|
|
1331
|
-
const Xi = At(kt["strong-sub-label"], _t({ label: "strongSubLabel" }));
|
|
1332
|
-
function Zi({ children: e2, stylists: t2 = [] }) {
|
|
1333
|
-
return sr(e2) ? null : k(ao, { size: "sm", weight: "med", stylists: [Xi, ...t2], children: e2 });
|
|
1334
|
-
}
|
|
1335
|
-
const Ji = h(null), el = 314, tl = ft({ overflow: "auto", display: "flex", flexDirection: "column", width: "325px", maxHeight: `${el}px`, minWidth: "325px", "&:focus, &:focus-within": { outline: "none" }, scrollbar: "hidden" }), rl = 35, nl = At(kt["selector-row"], ft({ borderRadius: "zero", backgroundColor: "surface.intent.action.discrete", boxShadow: "none", border: "{borderWidths.md} solid", borderColor: "border.layout", display: "flex", width: "100%", minHeight: `${rl}px`, height: "fit-content", padding: "10px", alignItems: "flex-start", gap: "9px", flexShrink: 0, textAlign: "start", cursor: "pointer", "&[data-focused='true']": { boxShadow: "none", outline: "none", backgroundColor: "surface.intent.action.discrete.hover" } }));
|
|
1336
|
-
function ol(e2, t2, r2) {
|
|
1337
|
-
const [n2, o2] = v(e2);
|
|
1338
|
-
return [t2 ?? n2, r2 ?? o2];
|
|
1339
|
-
}
|
|
1340
|
-
function al({ children: e2 }) {
|
|
1341
|
-
return null === ae() ? k(ie, { children: e2 }) : e2;
|
|
1342
|
-
}
|
|
1343
|
-
function il({ children: e2, modal: t2 = false, initialOpen: r2, placement: n2, offsetPx: o2, open: a2, onOpenChange: i2, blockInteraction: l2 = true, enableClickMiddleware: s2 = true }) {
|
|
1344
|
-
const c2 = function({ initialOpen: e3 = false, placement: t3 = "bottom", offsetPx: r3 = 0, modal: n3, open: o3, onOpenChange: a3, enableClickMiddleware: i3 = true } = {}) {
|
|
1345
|
-
const [l3, s3] = v(), [c3, d3] = v(), [h3, g3] = ol(e3, o3, a3), p2 = Y(), m2 = rl + 2, b2 = 1.5 * m2, f2 = G({ placement: t3, open: h3, nodeId: p2, onOpenChange: (e4, t4) => {
|
|
1346
|
-
!e4 && t4 instanceof MouseEvent && (t4.clientX < 0 || t4.clientY < 0 || t4.clientX > window.innerWidth || t4.clientY > window.innerHeight) || g3(e4);
|
|
1347
|
-
}, whileElementsMounted: ee, middleware: [Q(r3), X({ crossAxis: t3.includes("-"), fallbackStrategy: "bestFit", fallbackAxisSideDirection: "none", padding: 8 }), Z({ padding: 8 }), J({ apply({ availableHeight: e4, elements: t4 }) {
|
|
1348
|
-
let r4 = e4;
|
|
1349
|
-
if (e4 < el) {
|
|
1350
|
-
const t5 = Math.floor(e4 / m2) * m2 - m2 / 2;
|
|
1351
|
-
r4 = Math.max(t5, b2);
|
|
1352
|
-
}
|
|
1353
|
-
Object.assign(t4.floating.style, { maxHeight: `${r4}px`, overflowY: "auto" });
|
|
1354
|
-
}, padding: 8 })] }), y2 = f2.context, T2 = te(y2, { enabled: i3 }), x2 = re(y2, { bubbles: { escapeKey: true } }), w2 = ne(y2), k2 = oe([T2, x2, w2]);
|
|
1355
|
-
return u(() => ({ open: h3, setOpen: g3, ...k2, ...f2, modal: n3, labelId: l3, descriptionId: c3, setLabelId: s3, setDescriptionId: d3, nodeId: p2 }), [h3, g3, k2, f2, n3, l3, c3, p2]);
|
|
1356
|
-
}({ modal: t2, initialOpen: r2, placement: n2, offsetPx: o2, open: a2, onOpenChange: i2, enableClickMiddleware: s2 }), d2 = ae(), h2 = l2 && null === d2, g2 = c2.nodeId;
|
|
1357
|
-
return k(al, { children: k(le, { id: g2, children: k(Ji.Provider, { value: { ...c2, popupParentNodeId: d2, blockInteraction: h2 }, children: e2 }) }) });
|
|
1358
|
-
}
|
|
1359
|
-
function ll() {
|
|
1360
|
-
const e2 = g(Ji);
|
|
1361
|
-
if (null == e2) throw new Error("Popup components must be wrapped in <PopupManager />");
|
|
1362
|
-
return e2;
|
|
1363
|
-
}
|
|
1364
|
-
function sl({ children: e2 }) {
|
|
1365
|
-
const t2 = ll(), r2 = t2.refs.setReference, n2 = t2.open ? "open" : "closed", o2 = { ...t2.getReferenceProps(), ref: r2, "data-state": n2 };
|
|
1366
|
-
return k(C, { children: e2(o2) });
|
|
1367
|
-
}
|
|
1368
|
-
const cl = aa((e2) => c.createElement("svg", { width: 10, height: 10, viewBox: "0 0 10 10", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e2 }, c.createElement("path", { d: "M1.23712 1.23718L8.76283 8.76289", stroke: "#182428", strokeWidth: 0.8, strokeMiterlimit: 10 }), c.createElement("path", { d: "M8.76288 1.23718L1.23717 8.76289", stroke: "#182428", strokeWidth: 0.8, strokeMiterlimit: 10 })), "Cross");
|
|
1369
|
-
function dl({ Component: e2, stylists: t2 }) {
|
|
1370
|
-
return k(e2, { stylists: [At(kt["tiny-icon"]), ...t2 ?? []], size: 9 });
|
|
1371
|
-
}
|
|
1372
|
-
const ul = aa((e2) => c.createElement("svg", { width: 11, height: 10, viewBox: "0 0 11 10", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e2 }, c.createElement("path", { d: "M1.03625 2.20312H9.96378", stroke: "#182428" }), c.createElement("path", { d: "M1.03625 5H9.96378", stroke: "#182428" }), c.createElement("path", { d: "M1.03625 7.79688H7.24223", stroke: "#182428" })), "Sort"), hl = At(null, ft({ display: "flex", alignItems: "center", borderRadius: "md", border: "{borderWidths.lg} solid transparent", maxWidth: "fit-content", justifyContent: "center", _supportHover: { borderColor: "border.intent.action.hover", backgroundColor: "surface.intent.action.discrete.hover" }, "&[data-active='true']": { backgroundColor: "surface.intent.action.discrete.active", borderColor: "border.intent.action.active" }, "&:has(button:focus-visible)": { outline: "4px solid", outlineColor: "border.layout" } }), sa), gl = At(null, ft({ display: "flex", alignItems: "center", justifyContent: "center", gap: "5px", backgroundColor: "transparent", padding: "6px 0 6px 6px", border: "none", outline: "none", cursor: "pointer" })), pl = At(null, ft({ display: "flex", alignItems: "center", justifyContent: "center", backgroundColor: "transparent", padding: 0, margin: "6px 6px 6px 5px", border: "none", outline: "none", position: "relative", cursor: "pointer", "&::before": { content: "''", position: "absolute", top: "-9px", right: "-7px", bottom: "-9px", left: "-5px" }, _focusVisible: { borderRadius: "sm", outline: "4px solid", outlineColor: "border.layout" } })), vl = At(null, ft({ padding: "0 6px 0 0", display: "flex", alignItems: "center" }));
|
|
1373
|
-
function ml({ onClearClick: e2, columnName: t2, active: r2, popupTriggerProps: n2 }) {
|
|
1374
|
-
const o2 = r2 || "open" === n2?.["data-state"];
|
|
1375
|
-
return S("div", { ...hl, "data-active": o2, children: [S("button", { ...gl, ...n2, children: [k(Zi, { children: t2 }), !o2 && k("div", { ...vl, children: k(dl, { Component: ul }) })] }), o2 && k("button", { ...pl, onClick: e2, children: k(dl, { Component: cl }) })] });
|
|
1376
|
-
}
|
|
1377
|
-
const bl = wt({ base: { border: "{borderWidths.md} solid", borderColor: "border.layout", background: "surface.background", borderRadius: "zero", boxShadow: "box-shadow", animation: "appear.instant", display: "flex", flexShrink: 1, width: "max-content", position: "absolute", top: 0, left: 0, "& *": { boxSizing: "border-box" } }, variants: { type: { reaction: { borderRadius: "sm" } } } });
|
|
1378
|
-
function fl({ initialFocus: e2 = true, style: t2, ref: r2, type: n2, ...o2 }) {
|
|
1379
|
-
const { context: a2, blockInteraction: i2, ...l2 } = ll(), s2 = se([l2.refs.setFloating, r2]), c2 = At(kt.popup, bl({ type: n2 }));
|
|
1380
|
-
return a2.open ? S(C, { children: [i2 && k(ce, { lockScroll: true }), k(de, { children: k(ue, { context: a2, modal: l2.modal, initialFocus: e2 ? void 0 : -1, children: k("div", { ref: s2, ...c2, style: { ...l2.floatingStyles, ...t2 }, ...l2.getFloatingProps(o2), "aria-labelledby": l2.labelId, "aria-describedby": l2.descriptionId, children: o2.children }) }) })] }) : null;
|
|
1381
|
-
}
|
|
1382
|
-
const yl = At(kt["popup-sort-row"], ft({ border: "none", background: "none", paddingLeft: "10px", paddingRight: "10px", paddingTop: "4px", paddingBottom: "4px", margin: 0, cursor: "pointer", display: "flex", alignItems: "center", width: "100%", outline: "none", _focusVisible: { outline: "4px solid", outlineOffset: "-2px", outlineColor: "border.layout" } }));
|
|
1383
|
-
function Tl({ onClick: e2, children: t2, active: r2 }) {
|
|
1384
|
-
return k("button", { onClick: e2, ...yl, children: k(co, { accent: r2 ? "active" : "action", children: t2 }) });
|
|
1385
|
-
}
|
|
1386
|
-
const xl = At(null, ft({ display: "flex", flexDirection: "column", alignItems: "flex-start", width: "100%" })), wl = At(null, ft({ paddingTop: "10px", paddingLeft: "10px", paddingRight: "10px", paddingBottom: "8px", color: "typography.base.weak" }));
|
|
1387
|
-
function kl({ sortDef: e2, sortAscDisplay: t2, sortDescDisplay: r2, handleSortClick: n2, sortInstance: o2 }) {
|
|
1388
|
-
const a2 = ll(), i2 = (e3) => {
|
|
1389
|
-
n2(e3), a2?.setOpen(false);
|
|
1390
|
-
}, l2 = o2?.orderBy === e2 && "ASC" === o2?.direction, s2 = o2?.orderBy === e2 && "DESC" === o2?.direction;
|
|
1391
|
-
return S("div", { ...xl, children: [k(Zi, { stylists: [wl], children: "Sort by:" }), k(Tl, { onClick: () => i2({ orderBy: e2, direction: "ASC" }), active: l2, children: t2 }), k(Tl, { onClick: () => i2({ orderBy: e2, direction: "DESC" }), active: s2, children: r2 })] });
|
|
1392
|
-
}
|
|
1393
|
-
const Cl = ft({ display: "flex", alignItems: "center", gap: "5px", backgroundColor: "surface.intent.action.discrete", padding: "6px", borderRadius: "md", border: "{borderWidths.md} solid transparent", outline: "none", boxShadow: "0 0 0 0 transparent", width: "fit-content", position: "relative", cursor: "pointer", color: "icon.base", "&:focus-visible": { outline: "4px solid", outlineColor: "border.layout" }, "&:disabled": { cursor: "default" }, _supportHover: { _enabled: { borderColor: "border.intent.action.hover", backgroundColor: "surface.intent.action.discrete.hover", color: "icon.intent.action.hover", fill: "icon.intent.action.hover" } }, "&:active:enabled, &[data-active='true']:enabled": { backgroundColor: "surface.intent.action.discrete.active", borderColor: "transparent", color: "icon.intent.action.active", fill: "icon.intent.action.active" }, "&::before": { content: "''", position: "absolute", top: "-11px", left: "-11px", right: "-11px", bottom: "-11px" } }), Sl = At(kt["button-discrete-small"], Cl, sa);
|
|
1394
|
-
function El({ children: e2, active: t2, disabled: r2, onClick: n2, popupTriggerProps: o2, ariaLabel: a2, ariaExpanded: i2 }) {
|
|
1395
|
-
const [l2, s2] = v(false), c2 = t2 ?? function(e3) {
|
|
1396
|
-
switch (e3) {
|
|
1397
|
-
case "open":
|
|
1398
|
-
return true;
|
|
1399
|
-
case "closed":
|
|
1400
|
-
return false;
|
|
1401
|
-
case void 0:
|
|
1402
|
-
return;
|
|
1403
|
-
}
|
|
1404
|
-
}(o2?.["data-state"]);
|
|
1405
|
-
return k("button", { type: "button", ...Sl, onClick: (e3) => {
|
|
1406
|
-
void 0 === c2 && s2(!l2), n2 && n2(e3);
|
|
1407
|
-
}, "data-active": c2 ?? l2, disabled: r2, ...o2, "aria-label": a2, "aria-expanded": i2, children: e2 });
|
|
1408
|
-
}
|
|
1409
|
-
const Il = { minWidth: "140px" };
|
|
1410
|
-
function Pl({ columnName: e2, sortDef: t2, sortAscDisplay: r2, sortDescDisplay: n2 }) {
|
|
1411
|
-
const o2 = g(zi);
|
|
1412
|
-
if (!o2) return null;
|
|
1413
|
-
const { sortInstance: a2, setSortInstance: i2 } = o2, l2 = a2?.orderBy === t2, s2 = () => {
|
|
1414
|
-
i2(void 0);
|
|
1415
|
-
};
|
|
1416
|
-
return t2 && r2 && n2 ? S(il, { placement: "bottom-start", children: [k(sl, { children: (t3) => k(ml, { active: l2, onClearClick: s2, columnName: e2, popupTriggerProps: t3 }) }), k(fl, { style: Il, children: k(kl, { sortDef: t2, sortAscDisplay: r2, sortDescDisplay: n2, handleSortClick: (e3) => {
|
|
1417
|
-
i2(e3);
|
|
1418
|
-
}, sortInstance: a2 }) })] }) : k(El, { disabled: true, children: k(Zi, { children: e2 }) });
|
|
1419
|
-
}
|
|
1420
|
-
const Al = At(null, ft({ paddingLeft: "19px" }));
|
|
1421
|
-
function Dl({ columnName: e2, sortDef: t2, sortAscDisplay: r2, sortDescDisplay: n2 }) {
|
|
1422
|
-
return k("div", { ...Al, children: k(Pl, { columnName: e2, sortDef: t2, sortAscDisplay: r2, sortDescDisplay: n2 }) });
|
|
1423
|
-
}
|
|
1424
|
-
const Ml = { ASC: "Oldest to Newest", DESC: "Newest to Oldest" };
|
|
1425
|
-
function Nl() {
|
|
1426
|
-
const [e2, t2] = v(void 0);
|
|
1427
|
-
return { sortInstance: e2, setSortInstance: m((e3) => {
|
|
1428
|
-
!function(e4) {
|
|
1429
|
-
if (void 0 === e4) return true;
|
|
1430
|
-
const t3 = (e4.orderBy && e4.orderBy in _a) ?? false, r2 = (e4.direction && e4.direction in La) ?? false;
|
|
1431
|
-
return t3 && r2;
|
|
1432
|
-
}(e3) ? t2(void 0) : t2(e3);
|
|
1433
|
-
}, [t2]), apiSort: e2 };
|
|
1434
|
-
}
|
|
1435
|
-
const Rl = h({ userId: void 0, userRole: void 0, userEmail: void 0 });
|
|
1436
|
-
function Ol({ authorUserId: e2, isRead: t2 }) {
|
|
1437
|
-
const { userRole: r2, userId: n2 } = g(Rl);
|
|
1438
|
-
let o2 = "";
|
|
1439
|
-
return e2 === n2 ? o2 = "Me" : "OWNER" === r2 ? o2 = "Bookkeeper" : "ACCOUNTANT" === r2 && (o2 = "User"), k($i, { text: o2, isRead: t2 });
|
|
1440
|
-
}
|
|
1441
|
-
const _l = At(kt.text, ft({ fontSize: "md", fontWeight: "lg", color: "typography.base", fontStyle: "normal", letterSpacing: "0.84px", lineHeight: "16px", maxWidth: "100%", fontFamily: "label" }), Bn);
|
|
1442
|
-
function Ll({ children: e2, stylists: t2 = [] }) {
|
|
1443
|
-
const r2 = Ot([_l, ...t2]);
|
|
1444
|
-
return k("div", { ...r2, children: e2 });
|
|
1445
|
-
}
|
|
1446
|
-
const Fl = At(kt["emphasis-sub-label"], _t({ label: "emphasisSubLabel" }));
|
|
1447
|
-
function Wl({ children: e2 }) {
|
|
1448
|
-
return sr(e2) ? null : k(ao, { size: "sm", weight: "lg", stylists: [Fl], children: e2 });
|
|
1449
|
-
}
|
|
1450
|
-
const Bl = ft({ display: "grid", gridTemplateColumns: "3fr 1fr", border: "none", borderRadius: 0, padding: "10px", width: "100%", cursor: "pointer", backgroundColor: "transparent", alignItems: "start" }), Hl = At(null, ft({ display: "flex", flexDirection: "column", alignItems: "start", gap: "2px", maxWidth: "100%" }), Bn), zl = ft({ display: "flex", flexDirection: "row", alignItems: "center", justifyContent: "end", gap: "2px" });
|
|
1451
|
-
function Vl({ sender: e2, subject: t2, date: r2, message: n2, isRead: o2, handleFormOpen: a2 }) {
|
|
1452
|
-
return S("button", { className: Bl, onTouchEnd: a2, children: [S("div", { ...Hl, children: [k(Ol, { authorUserId: e2, isRead: o2 }), k(o2 ? co : Wl, { children: t2 }), k(co, { children: n2 })] }), S("div", { className: zl, children: [k(Qi, { date: r2, isRead: o2 }), o2 ? k(ga, { Component: la }) : k(Ll, { children: k(ga, { Component: la }) })] })] });
|
|
1453
|
-
}
|
|
1454
|
-
const jl = q(), ql = At(null, ft({ paddingLeft: "25px" })), Ul = [jl.accessor("latestMessage.author.userId", { id: Vi.FROM, cell: ({ row: e2 }) => k(Gi, { children: k(Ol, { authorUserId: e2.original.latestMessage.author.userId, isRead: "READ" === e2.original.readStatus }) }), header: () => k(Zi, { stylists: [ql], children: "From" }), size: 150, maxSize: 150 }), jl.accessor("subject", { id: Vi.SUBJECT, cell: ({ row: e2 }) => k(Gi, { children: k($i, { text: e2.original.subject, isRead: "READ" === e2.original.readStatus }) }), header: () => k(Zi, { stylists: [ql], children: "Subject" }), size: 150 }), jl.accessor("latestMessage.text", { id: Vi.MESSAGE, cell: ({ row: e2 }) => k(Gi, { children: k($i, { text: e2.original.latestMessage.text, isRead: "READ" === e2.original.readStatus }) }), header: () => k(Zi, { stylists: [ql], children: "Message" }), size: 200 }), jl.accessor("lastUpdatedDateTime", { id: Vi.DATE, cell: ({ row: e2 }) => k(Gi, { children: k(Qi, { date: e2.original.lastUpdatedDateTime, isRead: "READ" === e2.original.readStatus }) }), header: () => k(Dl, { columnName: "Date", sortDef: "LAST_MESSAGE_CREATED_DATE_TIME", sortDescDisplay: Ml.DESC, sortAscDisplay: Ml.ASC }), size: 130, maxSize: 130 }), jl.display({ id: Vi.MOBILE, cell: ({ row: e2 }) => k(Vl, { sender: e2.original.latestMessage.author.userId, subject: e2.original.subject, date: e2.original.lastUpdatedDateTime, message: e2.original.latestMessage.text, isRead: "READ" === e2.original.readStatus, handleFormOpen: () => {
|
|
1455
|
-
} }) })];
|
|
1456
|
-
function Kl(e2) {
|
|
1457
|
-
return e2 ? Ul.filter((e3) => e3.id === Vi.MOBILE) : Ul.filter((e3) => e3.id !== Vi.MOBILE);
|
|
1458
|
-
}
|
|
1459
|
-
const $l = [];
|
|
1460
|
-
const Yl = ft({ display: "flex", flexDirection: "column", height: "250px", width: "100%", paddingBottom: "20px", alignItems: "center", justifyContent: "center", boxSizing: "border-box", textAlign: "center", backgroundColor: "surface.background", gap: "10px" }), Gl = At(kt["empty-dashboard-layout"], Yl);
|
|
1461
|
-
function Ql({ children: e2 }) {
|
|
1462
|
-
return k("div", { ...Gl, "data-testid": "empty-dashboard-layout", children: e2 });
|
|
1463
|
-
}
|
|
1464
|
-
function Xl({ Component: e2, stylists: t2 }) {
|
|
1465
|
-
return k(e2, { stylists: [At(kt["large-icon"]), ...t2 ?? []], size: 25 });
|
|
1466
|
-
}
|
|
1467
|
-
const Zl = aa((e2) => c.createElement("svg", { width: 15, height: 15, viewBox: "0 0 15 15", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e2 }, c.createElement("path", { d: "M14.0625 2.14374L1.5625 6.90624L11.6813 12.8562L14.0625 2.14374Z", strokeWidth: 0.9375, strokeMiterlimit: 10 }), c.createElement("path", { d: "M8.25624 10.8375L5.73124 12.8562L5.33749 9.12499L13.4687 2.73749", strokeWidth: 0.9375, strokeMiterlimit: 10 })), "Paperplane"), Jl = () => {
|
|
1468
|
-
ii("Conversation", { routeProps: { conversationId: null } });
|
|
1469
|
-
}, es = "Need help with your financials?", ts = "Talk to a bookkeeper", rs = At(null, ft({ whiteSpace: "wrap" }));
|
|
1470
|
-
function ns() {
|
|
1471
|
-
return S(C, { children: [k(Xl, { Component: Zl }), k(lo, { stylists: [rs], children: es }), k(Li, { onClick: Jl, children: k(lo, { children: ts }) })] });
|
|
1472
|
-
}
|
|
1473
|
-
const os = "All caught up", as = "We'll let you know if something comes up.", is = At(null, ft({ whiteSpace: "wrap" }));
|
|
1474
|
-
function ls() {
|
|
1475
|
-
return S(C, { children: [k(Xl, { Component: Zl }), k(lo, { stylists: [is], children: os }), k(co, { wrap: "wrap", children: as })] });
|
|
1476
|
-
}
|
|
1477
|
-
const ss = At(null, ft({ display: "flex", flexDirection: "row", gap: "5px" }));
|
|
1478
|
-
function cs({ children: e2 }) {
|
|
1479
|
-
return k("div", { ...ss, children: e2 });
|
|
1480
|
-
}
|
|
1481
|
-
const ds = wt({ variants: { isMobile: { true: {}, false: { minWidth: "900px" } } } });
|
|
1482
|
-
function us(e2) {
|
|
1483
|
-
return k(e2 ? ls : ns, {});
|
|
1484
|
-
}
|
|
1485
|
-
function hs({ sortInstance: e2, setSortInstance: t2, conversations: r2, paginationControls: n2, isFilling: o2, isMobile: a2 }) {
|
|
1486
|
-
const i2 = function({ conversations: e3, isMobile: t3 }) {
|
|
1487
|
-
return U({ data: e3 ?? $l, manualPagination: true, manualSorting: true, manualFiltering: true, manualGrouping: true, rowCount: e3?.length ?? $l.length, columns: Kl(t3), getCoreRowModel: K(), getRowId: (e4) => e4.id });
|
|
1488
|
-
}({ conversations: r2, isMobile: a2 }), { query: { data: l2 }, isFilling: s2 } = Ba({ limit: 1, filter: { resolutionStatus: { values: ["OPEN", "CLOSED"] } } }), c2 = !ir(l2?.data?.[0]) && !s2;
|
|
1489
|
-
return S("div", { className: ds({ isMobile: a2 }), children: [k("div", { id: Ko }), S(ha.Provider, { value: n2, children: [S(Mt, { children: [k(Ft, { children: "Conversations" }), S(cs, { children: [k(fa, {}), k(Wi, {})] })] }), k(Hi, { dashboard: "businessOwnerDashboard", children: o2 ? k(Ca, { numColumns: 4 }) : S(C, { children: [!a2 && k(zi.Provider, { value: { sortInstance: e2, setSortInstance: t2 }, children: k($a, { headerGroups: i2.getHeaderGroups() }) }), r2.length > 0 ? k(Ga, { children: i2.getRowModel().rows.map((e3) => k(Si, { rowData: e3, isMobile: a2 }, e3.id)) }) : k(Ql, { children: us(c2) })] }) })] })] });
|
|
1490
|
-
}
|
|
1491
|
-
const gs = { all: () => ["summaries", {}], of: (e2) => ["summaries", e2 ?? {}] }, ps = async (e2) => {
|
|
1492
|
-
const t2 = e2.queryKey, r2 = { path: "/v6/summaries/query", bodyParams: { ...t2[1] }, accessToken: t2[2].accessToken, endpointManager: ea(t2[2].environment) }, n2 = await fn(r2);
|
|
1493
|
-
return "SUCCESS" === n2.result && void 0 !== n2.data ? { data: n2.data } : { data: void 0 };
|
|
1494
|
-
};
|
|
1495
|
-
function vs(e2) {
|
|
1496
|
-
const t2 = Ht(e2.month, e2.year);
|
|
1497
|
-
return n2 = { select: (e3) => e3?.data?.[0]?.summary }, br({ queryKey: (r2 = { limit: 1, filter: { date: { value: t2, operator: "EQUALS" }, status: { values: ["ACTIVE"], operator: "IN" } }, sort: { direction: "DESC", orderBy: "DATE" } }) ? gs.of(r2) : gs.all(), queryFn: ps, ...n2 });
|
|
1498
|
-
var r2, n2;
|
|
1499
|
-
}
|
|
1500
|
-
const ms = At(kt.body, _t({ body: "default" }));
|
|
1501
|
-
function bs({ children: e2, stylists: t2 = [] }) {
|
|
1502
|
-
if (sr(e2)) return null;
|
|
1503
|
-
const r2 = Ot([ms, ...t2]);
|
|
1504
|
-
return k("div", { ...r2, children: e2 });
|
|
1505
|
-
}
|
|
1506
|
-
const fs = wt({ base: { color: "typography.base.weak", boxSizing: "border-box", position: "absolute", bottom: "0", left: "0", right: "0", top: "0", display: "flex", justifyContent: "center", alignItems: "center", pointerEvents: "none", margin: "0 auto", transform: "rotate(-20deg)", opacity: "80%" }, variants: { size: { sm: { fontSize: "4em" }, lg: { fontSize: "7em" } } }, defaultVariants: { size: "lg" } });
|
|
1507
|
-
function ys({ size: e2 }) {
|
|
1508
|
-
const t2 = At(null, fs({ size: e2 }));
|
|
1509
|
-
return k("div", { ...t2, children: "Sample" });
|
|
1510
|
-
}
|
|
1511
|
-
const Ts = At(null, ft({ display: "flex", flexDirection: "column", gap: "6px", width: "100%" })), xs = wt({ base: { height: 16 }, variants: { width: { w92: { width: "92%" }, w90: { width: "90%" }, w88: { width: "88%" }, w87: { width: "87%" }, w85: { width: "85%" }, w70: { width: "70%" } } } }), ws = [{ width: "w85" }, { width: "w90" }, { width: "w88" }, { width: "w85" }, { width: "w92" }, { width: "w87" }, { width: "w90" }, { width: "w85" }, { width: "w88" }, { width: "w90" }, { width: "w87" }, { width: "w85" }, { width: "w70" }];
|
|
1512
|
-
function ks() {
|
|
1513
|
-
return k("div", { ...Ts, children: ws.map((e2, t2) => k(Lo, { styles: xs({ width: e2?.width }) }, t2)) });
|
|
1514
|
-
}
|
|
1515
|
-
const Cs = ft({ borderRadius: "lg", overflow: "auto", height: "100%", width: "100%", padding: "10px" }), Ss = wt({ base: { display: "flex", flex: "1 1 0", maxHeight: "247px", minHeight: "247px", background: "surface.foreground", border: "{borderWidths.lg} solid {colors.border.layout.strong}", borderRadius: "lg", gap: "10px", alignItems: "flex-start", boxSizing: "border-box", position: "relative", minWidth: "900px", marginBottom: 10, overflow: "hidden" }, variants: { isSample: { true: { pointerEvents: "none" }, false: {} } } }), Es = At(null, ft({ whiteSpace: "pre-wrap", display: "flex", alignItems: "start", gap: "10px", height: "fit-content" }));
|
|
1516
|
-
function Is({ children: e2, stylists: t2 = [], isSample: r2, isFilling: n2 }) {
|
|
1517
|
-
const o2 = At(null, Ss({ isSample: r2 }));
|
|
1518
|
-
return k("div", { "data-testid": "financial-summary-layout", ...Ot([o2, ...t2]), children: n2 ? k(ks, {}) : S("div", { className: Cs, children: [k(bs, { stylists: [Es], children: e2 }), r2 && k(ys, {})] }) });
|
|
1519
|
-
}
|
|
1520
|
-
const Ps = { id: "mock_task_link_bank", priority: "HIGH", name: "Link your bank account", description: "Effortlessly track every dollar by linking your bank account", type: "LINK_BANK", dismissable: "DISMISSABLE", status: "ACTIVE" };
|
|
1521
|
-
function As(e2, t2, r2) {
|
|
1522
|
-
return { id: `${e2}_${t2}_${r2}_bank_error_task`, priority: "URGENT", name: "Fix your bank connection", description: `Please relink your ${e2} bank using your latest credentials`, type: "BANK_ERROR", dismissable: "DISMISSABLE", status: "ACTIVE", meta: { plaidItemId: t2 } };
|
|
1523
|
-
}
|
|
1524
|
-
async function Ds(e2) {
|
|
1525
|
-
const { url: t2, headers: r2 } = vn(e2);
|
|
1526
|
-
return async function(e3) {
|
|
1527
|
-
const { authorization: t3, extraHeaders: r3, params: n2, url: o2 } = e3, a2 = dn({ extraHeaders: r3, authorization: t3 }), i2 = gn();
|
|
1528
|
-
en("HTTP DELETE Request", { url: o2, accessToken: t3 });
|
|
1529
|
-
try {
|
|
1530
|
-
const e4 = await fetch(o2, { method: on.DELETE, headers: a2, credentials: i2, body: JSON.stringify(n2) });
|
|
1531
|
-
return en("HTTP DELETE Response", { url: o2, status: e4.status, statusText: e4.statusText }), un(e4);
|
|
1532
|
-
} catch (e4) {
|
|
1533
|
-
return Promise.reject(e4);
|
|
1534
|
-
}
|
|
1535
|
-
}({ url: t2, params: e2.bodyParams, extraHeaders: r2 });
|
|
1536
|
-
}
|
|
1537
|
-
function Ms({ mutationFn: e2, onMutateFn: t2, ...r2 }) {
|
|
1538
|
-
const n2 = ur(), o2 = mr(), a2 = !sr(n2);
|
|
1539
|
-
return D({ ...r2, mutationFn: a2 ? (t3) => e2({ data: t3, accessToken: n2, environment: o2 }) : hr, onMutate: a2 && lr(t2) ? (e3) => t2({ data: e3, accessToken: n2, environment: o2 }) : void 0 }, pr);
|
|
1540
|
-
}
|
|
1541
|
-
function Ns(e2) {
|
|
1542
|
-
return Tn(`${function(e3) {
|
|
1543
|
-
return xn[e3];
|
|
1544
|
-
}(e2)}/v1`, "v1");
|
|
1545
|
-
}
|
|
1546
|
-
const Rs = ["INVALID_CREDENTIALS", "INSUFFICIENT_CREDENTIALS", "INVALID_MFA", "ITEM_LOGIN_REQUIRED", "NO_ACCOUNTS", "OAUTH_ERROR", "PENDING_DISCONNECT", "ADDITIONAL_CONSENT_REQUIRED"], Os = { all: () => ["banks", "plaidItems"] }, _s = async (e2) => {
|
|
1547
|
-
const t2 = e2.queryKey, r2 = { path: "/banks/plaidItems", accessToken: t2[2].accessToken, environment: t2[2].environment };
|
|
1548
|
-
return await Na(r2);
|
|
1549
|
-
};
|
|
1550
|
-
function Ls(e2) {
|
|
1551
|
-
return br({ ...e2, queryKey: Os.all(), queryFn: _s });
|
|
1552
|
-
}
|
|
1553
|
-
function Fs() {
|
|
1554
|
-
return Ls({ select: (e2) => {
|
|
1555
|
-
return t2 = e2, t2?.filter((e3) => "ACTIVE" === e3.status && Rs.includes(e3.apiErrorCode || ""));
|
|
1556
|
-
var t2;
|
|
1557
|
-
} });
|
|
1558
|
-
}
|
|
1559
|
-
const Ws = async ({ data: e2, accessToken: t2, environment: r2 }) => {
|
|
1560
|
-
const n2 = { path: "/banks/integration", bodyParams: { id: e2.id, removeFromApi: true }, accessToken: t2, endpointManager: kn(r2) };
|
|
1561
|
-
return await async function(e3) {
|
|
1562
|
-
return Ds(e3);
|
|
1563
|
-
}(n2);
|
|
1564
|
-
};
|
|
1565
|
-
const Bs = { all: () => ["banks", "bankAccounts"] };
|
|
1566
|
-
const Hs = async (e2) => {
|
|
1567
|
-
const t2 = e2.queryKey, r2 = { path: "/banks/accounts", accessToken: t2[2].accessToken, environment: t2[2].environment }, n2 = await Na(r2), o2 = void 0 !== n2.data ? n2.data.map((e3) => ({ ...e3, id: `${bi.BANK_ACCOUNT}_${e3.id}` })) : [];
|
|
1568
|
-
return { ...n2, data: o2 };
|
|
1569
|
-
};
|
|
1570
|
-
function zs(e2) {
|
|
1571
|
-
return br({ ...e2, queryKey: Bs.all(), queryFn: Hs });
|
|
1572
|
-
}
|
|
1573
|
-
const Vs = (e2, t2) => {
|
|
1574
|
-
const r2 = Number(t2.split("_")[1]);
|
|
1575
|
-
return e2?.find((e3) => Number(e3.glAccountId) === r2);
|
|
1576
|
-
};
|
|
1577
|
-
const js = (e2) => {
|
|
1578
|
-
const { query: { data: t2 } } = zs({ select: (t3) => {
|
|
1579
|
-
return r2 = t3?.data, n2 = e2, r2?.find((e3) => e3.id === n2);
|
|
1580
|
-
var r2, n2;
|
|
1581
|
-
} });
|
|
1582
|
-
return t2;
|
|
1583
|
-
}, qs = () => zs({ select: (e2) => {
|
|
1584
|
-
return t2 = e2?.data, void 0 !== t2?.find((e3) => "PLAID" === e3.apiName);
|
|
1585
|
-
var t2;
|
|
1586
|
-
} }), Us = () => zs({ select: (e2) => {
|
|
1587
|
-
return t2 = e2?.data, t2?.filter((e3) => "PLAID" === e3.apiName && ("ACTIVE" === e3.status || false === e3.isSupported));
|
|
1588
|
-
var t2;
|
|
1589
|
-
} }), Ks = At(null, ft({ display: "flex", alignItems: "center", gap: "15px", borderRadius: "md", border: "1px solid {colors.border.layout}", background: "surface.foreground", width: "fit-content" })), $s = At(kt["month-picker-left-button"], ft({ border: "none", borderRight: "1px solid {colors.border.layout}", borderRightRadius: 0, _disabled: { cursor: "default" } })), Ys = At(kt["month-picker-right-button"], ft({ border: "none", borderLeft: "1px solid {colors.border.layout}", borderLeftRadius: 0, _disabled: { cursor: "default" } })), Gs = At(null, ft({ cursor: "default", display: "flex", justifyContent: "center", width: "75px" })), Qs = (e2) => 0 === e2.month ? { month: 11, year: e2.year - 1 } : { month: e2.month - 1, year: e2.year }, Xs = (e2) => 11 === e2.month ? { month: 0, year: e2.year + 1 } : { month: e2.month + 1, year: e2.year };
|
|
1590
|
-
function Zs({ period: e2, setPeriod: t2, disableNext: r2 = false, disablePrev: n2 = false }) {
|
|
1591
|
-
const o2 = Bt(e2.year, e2.month, 1), a2 = rr(o2, { abbreviateMonth: true });
|
|
1592
|
-
return S("div", { ...Ks, children: [k(Li, { stylists: [$s], onClick: () => t2(Qs(e2)), disabled: n2, children: k(ga, { Component: ia }) }), k("div", { ...Gs, children: k(lo, { children: a2 }) }), k(Li, { stylists: [Ys], onClick: () => t2(Xs(e2)), disabled: r2, children: k(ga, { Component: la }) })] });
|
|
1593
|
-
}
|
|
1594
|
-
const Js = ft({ display: "flex", flexWrap: "wrap", justifyContent: "space-evenly", gap: "10px", maxWidth: "1440px" });
|
|
1595
|
-
function ec({ children: e2 }) {
|
|
1596
|
-
return k("div", { className: Js, children: e2 });
|
|
1597
|
-
}
|
|
1598
|
-
const tc = At(kt["progress-bar"], ft({ height: "32px", backgroundColor: "surface.intent.secondary", display: "flex", flexDirection: "row", alignItems: "center", border: "{borderWidths.lg} solid {colors.border.layout.weak}", borderRadius: "sm" })), rc = At(kt["progress-bar-fill"], ft({ borderRadius: "sm", height: "100%", display: "flex", alignItems: "center" })), nc = At(kt["tile-bar-label"], ft({ paddingLeft: "10px" }));
|
|
1599
|
-
function oc({ label: e2 = "", percentage: t2, color: r2, width: n2 }) {
|
|
1600
|
-
const o2 = void 0 === n2 ? "100%" : `${n2}px`, a2 = t2 >= 50, i2 = Ot([rc, At(null, r2)]);
|
|
1601
|
-
return S("div", { ...tc, style: { width: o2 }, children: [k("div", { ...i2, style: { width: `${t2}%` }, children: a2 && k("div", { ...nc, children: k(qi, { children: e2 }) }) }), !a2 && k("div", { ...nc, children: k(qi, { children: e2 }) })] });
|
|
1602
|
-
}
|
|
1603
|
-
const ac = At(kt["metric-md"], _t({ metric: "md" }));
|
|
1604
|
-
function ic(e2) {
|
|
1605
|
-
return k("div", { ...ac, children: e2.children });
|
|
1606
|
-
}
|
|
1607
|
-
const lc = At(null, ft({ display: "flex", alignItems: "center", justifyContent: "space-between", gap: "45px", width: "100%" })), sc = At(null, ft({ overflow: "visible", width: "80px", display: "flex", justifyContent: "end" })), cc = ({ label: e2, amount: t2, total: r2, colorCss: n2 }) => {
|
|
1608
|
-
const o2 = r2 > 0 ? function(e3, t3, r3, n3 = 0, o3 = 100) {
|
|
1609
|
-
return n3 + (e3 - t3) * (o3 - n3) / (r3 - t3);
|
|
1610
|
-
}(t2, 0, r2) : 0;
|
|
1611
|
-
return S("div", { ...lc, children: [k(oc, { label: e2, percentage: o2, color: n2 }), k("div", { ...sc, children: k(ic, { children: ro(t2) }) })] });
|
|
1612
|
-
}, dc = { netIncome: 0, income: 0, expenses: 0, absoluteSum: 0 }, uc = (e2) => {
|
|
1613
|
-
if (void 0 === e2.result || "FAILURE_NO_DATA" === e2.result) return dc;
|
|
1614
|
-
const t2 = e2.json?.data?.[0];
|
|
1615
|
-
if (ir(t2)) return dc;
|
|
1616
|
-
const r2 = t2.income?.total ?? 0, n2 = t2.expenses?.total ?? 0, o2 = N(r2).plus(n2).toNumber();
|
|
1617
|
-
return { netIncome: t2.netIncome ?? 0, income: r2, expenses: n2, absoluteSum: o2 };
|
|
1618
|
-
};
|
|
1619
|
-
const hc = aa((e2) => c.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e2 }, c.createElement("path", { d: "M13.3131 0.489685V4.15097H9.65182", strokeMiterlimit: 10 }), c.createElement("path", { d: "M2.32925 15.1348V11.4735H5.99054", strokeMiterlimit: 10 }), c.createElement("path", { d: "M1.34228 9.57602C1.18256 9.00181 1.10327 8.40823 1.10669 7.81223C1.1074 6.38654 1.56211 4.99811 2.4049 3.8482C3.2477 2.69828 4.4348 1.84664 5.79412 1.41671C7.15345 0.986775 8.61437 1.00089 9.96513 1.45702C11.3159 1.91314 12.4863 2.78757 13.3067 3.95356", strokeMiterlimit: 10 }), c.createElement("path", { d: "M14.2937 6.04849C14.4534 6.6227 14.5327 7.21628 14.5293 7.81228C14.5286 9.23797 14.0739 10.6264 13.2311 11.7763C12.3883 12.9262 11.2012 13.7779 9.84185 14.2078C8.48253 14.6377 7.02161 14.6236 5.67085 14.1675C4.32008 13.7114 3.14967 12.8369 2.32925 11.671", strokeMiterlimit: 10 })), "Sync");
|
|
1620
|
-
function gc({ Component: e2, stylists: t2 }) {
|
|
1621
|
-
return k(e2, { stylists: [At(kt["medium-icon"]), ...t2 ?? []], size: 15 });
|
|
1622
|
-
}
|
|
1623
|
-
const pc = At(kt["button-danger"], ft({ color: "typography.intent.danger", border: "{borderWidths.md} solid", borderColor: "border.intent.danger", backgroundColor: "surface.intent.danger", _supportHover: { _notDisabled: { backgroundColor: "surface.intent.danger.hover", borderColor: "border.intent.danger.hover", "& .Tight-text": { color: "typography.intent.danger.hover" } } }, "&:active:enabled, &[data-active='true']:enabled": { backgroundColor: "surface.intent.danger.active", borderColor: "border.intent.danger.active", "& .Tight-text": { color: "typography.intent.danger.active" } }, "& .Tight-text": { color: "typography.intent.danger" } }));
|
|
1624
|
-
function vc({ children: e2, stylists: t2 = [], ...r2 }) {
|
|
1625
|
-
return k(Oi, { stylists: [pc, ...t2], ...r2, children: e2 });
|
|
1626
|
-
}
|
|
1627
|
-
const mc = At(kt["button-tertiary"], ft({ color: "typography.intent.success", border: "{borderWidths.md} solid", borderColor: "border.intent.success", backgroundColor: "surface.intent.success", "& .Tight-text": { color: "typography.intent.success" }, "& path": { stroke: "icon.intent.success" }, _supportHover: { _notDisabled: { backgroundColor: "surface.intent.success.hover", borderColor: "border.intent.success.hover", "& .Tight-text": { color: "typography.intent.success.hover" }, "& path": { stroke: "icon.intent.success.hover" } } }, "&:active:enabled, &[data-active='true']:enabled": { backgroundColor: "surface.intent.success.active", borderColor: "border.intent.success.active", "& .Tight-text": { color: "typography.intent.success.active" }, "& path": { stroke: "icon.intent.success.active" } } }));
|
|
1628
|
-
function bc({ children: e2, stylists: t2 = [], ...r2 }) {
|
|
1629
|
-
return k(Oi, { stylists: [mc, ...t2], ...r2, children: e2 });
|
|
1630
|
-
}
|
|
1631
|
-
const fc = At(null, ft({ position: "fixed", inset: 0, minHeight: "100dvh", display: "grid", placeItems: "center", backgroundColor: "overlay" })), yc = At(kt["alert-dialog"], ft({ background: "surface.background", borderRadius: "md", display: "flex", flexDirection: "column", padding: "16px", maxWidth: "360px", gap: "16px", minWidth: 0, margin: "32px" })), Tc = At(null, ft({ display: "flex", justifyContent: "flex-end", gap: "8px" })), xc = At(null, ft({ whiteSpace: "wrap", textOverflow: "wrap" }));
|
|
1632
|
-
const wc = ge.createConfirmation(pe(function({ show: e2, proceed: t2, title: r2, body: n2, buttons: o2 = [{ key: "ok", label: "OK" }] }) {
|
|
1633
|
-
const { context: a2 } = G({ open: e2, strategy: "fixed" }), i2 = re(a2, { outsidePress: false, escapeKey: true }), l2 = ne(a2, { role: "alertdialog" }), { getFloatingProps: s2 } = oe([i2, l2]);
|
|
1634
|
-
return e2 ? k(de, { children: k(ce, { lockScroll: true, ...fc, children: k(ue, { context: a2, modal: true, returnFocus: true, children: S("div", { ...s2(), ...yc, children: [k(lo, { stylists: [xc], children: r2 }), n2 && "string" == typeof n2 ? k(qi, { wrap: "wrap", children: n2 }) : k(C, { children: n2 }), k("div", { ...Tc, children: o2.map((e3) => {
|
|
1635
|
-
const r3 = ((e4) => {
|
|
1636
|
-
switch (e4) {
|
|
1637
|
-
case "delete":
|
|
1638
|
-
return vc;
|
|
1639
|
-
case "success":
|
|
1640
|
-
return bc;
|
|
1641
|
-
default:
|
|
1642
|
-
return Li;
|
|
1643
|
-
}
|
|
1644
|
-
})(e3.key);
|
|
1645
|
-
return k(r3, { onClick: () => e3.onClick ? t2(e3.onClick()) : t2(e3.key), children: k(lo, { children: e3.label }) }, e3.key);
|
|
1646
|
-
}) })] }) }) }) }) : null;
|
|
1647
|
-
}));
|
|
1648
|
-
function kc(e2, t2, r2, n2) {
|
|
1649
|
-
const o2 = 1 === r2 ? e2 : t2;
|
|
1650
|
-
return n2 ? `${r2} ${o2}` : o2;
|
|
1651
|
-
}
|
|
1652
|
-
const Cc = (e2) => {
|
|
1653
|
-
wc({ title: "Uh oh!", body: (e2 ? `${e2} failed to link.` : "Something went wrong.") + " Please try again later." });
|
|
1654
|
-
}, Sc = (e2, t2) => wc({ title: "All set! Ready to track your transactions?", body: `Your ${t2} ${e2} ${kc("account", "accounts", t2)} are now linked. All transactions will be organized into easy-to-understand categories.`, buttons: [{ key: "success", label: "Get started" }] });
|
|
1655
|
-
function Ec(e2, t2, r2) {
|
|
1656
|
-
return he({ token: e2, onSuccess: async (e3, n2) => {
|
|
1657
|
-
try {
|
|
1658
|
-
const { plaidItem: o2 } = await async function({ publicToken: e4, metadata: t3, accessToken: r3, environment: n3 }) {
|
|
1659
|
-
if (!r3) throw new Error("Access token is required to create Plaid link token");
|
|
1660
|
-
const o3 = { path: "/banks2/webPlaidPublicToken", accessToken: r3, endpointManager: Ns(n3) }, { url: a2, headers: i2 } = vn(o3);
|
|
1661
|
-
return await mn({ url: a2, params: { publicToken: e4, plaidMetadata: t3 }, includeCredentials: true, extraHeaders: i2 });
|
|
1662
|
-
}({ publicToken: e3, metadata: n2, accessToken: t2, environment: r2 });
|
|
1663
|
-
await Sc(o2.apiInstitutionName, o2.plaidItemAccounts.length), await pr.invalidateQueries();
|
|
1664
|
-
} catch {
|
|
1665
|
-
Cc();
|
|
1666
|
-
}
|
|
1667
|
-
}, onExit: (e3, t3) => {
|
|
1668
|
-
e3 && Cc(t3?.institution?.name);
|
|
1669
|
-
} });
|
|
1670
|
-
}
|
|
1671
|
-
function Ic(e2, t2) {
|
|
1672
|
-
const r2 = ur(), n2 = mr(), [o2, a2] = v(""), { open: i2, ready: l2 } = Ec(o2, r2, n2);
|
|
1673
|
-
b(() => {
|
|
1674
|
-
l2 && o2 && (i2(), t2?.());
|
|
1675
|
-
}, [l2, i2, o2, t2]);
|
|
1676
|
-
return { linkPlaid: async () => {
|
|
1677
|
-
try {
|
|
1678
|
-
const t3 = await async function({ accessToken: e3, plaidItemId: t4, environment: r3 }) {
|
|
1679
|
-
if (!e3) throw new Error("Access token is required to create Plaid link token");
|
|
1680
|
-
const n3 = { path: "/banks2/createPlaidLinkToken", accessToken: e3, endpointManager: Ns(r3) }, { url: o3, headers: a3 } = vn(n3);
|
|
1681
|
-
return Aa({ url: o3, includeCredentials: true, extraHeaders: a3, params: t4 ? { plaidItemId: t4 } : void 0 });
|
|
1682
|
-
}({ accessToken: r2, plaidItemId: e2, environment: n2 });
|
|
1683
|
-
a2(t3.link_token);
|
|
1684
|
-
} catch {
|
|
1685
|
-
Cc();
|
|
1686
|
-
}
|
|
1687
|
-
} };
|
|
1688
|
-
}
|
|
1689
|
-
const Pc = At(null, Ii, ft({ position: "absolute", left: 1, right: 1, bottom: 1, width: "calc(100% - 2)", height: "44px", background: "surface.intent.primary", border: "none", borderRadius: 0, gap: 9, color: "icon.intent.primary", pointerEvents: "all", _supportHover: { _notDisabled: { backgroundColor: "surface.intent.primary.hover", borderColor: "border.intent.primary.hover", "& .Tight-text": { color: "typography.intent.primary.hover" } } } }), sa);
|
|
1690
|
-
function Ac() {
|
|
1691
|
-
const { linkPlaid: e2 } = Ic();
|
|
1692
|
-
return S("button", { onClick: e2, ...Pc, children: [k(gc, { Component: hc }), k(qi, { intent: "primary", children: "Link Account" })] });
|
|
1693
|
-
}
|
|
1694
|
-
const Dc = ft({ width: 266, minHeight: 32 });
|
|
1695
|
-
function Mc() {
|
|
1696
|
-
return k(Lo, { styles: Dc });
|
|
1697
|
-
}
|
|
1698
|
-
const Nc = ft({ backgroundColor: "money.positive.weak" }), Rc = ft({ backgroundColor: "money.negative.weak" }), Oc = Object.freeze({ income: 20200, expenses: 5043, netIncome: 15157, absoluteSum: Math.abs(20200) + Math.abs(5043) }), _c = Object.freeze({ income: 0, expenses: 0, netIncome: 0, absoluteSum: 0 }), Lc = ({ defaultRange: e2 = zt.THIS_YEAR, isSample: t2 = false }) => {
|
|
1699
|
-
const { query: { data: r2 }, isFilling: n2 } = function({ filter: e3 }) {
|
|
1700
|
-
return En({ filter: e3, select: uc });
|
|
1701
|
-
}({ filter: e2 });
|
|
1702
|
-
let o2;
|
|
1703
|
-
return o2 = t2 ? Oc : r2 ?? _c, S(Wn, { isSample: t2, children: [k(On, { title: "Profit + Loss" }), k(Ln, { children: n2 ? S(Wo, { children: [k(Mc, {}), k(Mc, {})] }) : S(C, { children: [k($n, { title: ro(o2.netIncome), label: "Profit" }), S(Gn, { children: [k(cc, { amount: o2.income, total: o2.absoluteSum, colorCss: Nc, label: "Income" }), k(cc, { amount: o2.expenses, total: o2.absoluteSum, colorCss: Rc, label: "Expenses" })] })] }) }), t2 && k(ys, { size: "sm" }), t2 && k(Ac, {})] });
|
|
1704
|
-
}, Fc = ({ filter: e2 }) => ["reports", "cashflow", { filter: e2 }];
|
|
1705
|
-
const Wc = { moneyIn: 0, moneyOut: 0, netMoneyIn: 0 };
|
|
1706
|
-
function Bc(e2) {
|
|
1707
|
-
const t2 = void 0 === e2.result || "FAILURE_NO_DATA" === e2.result, r2 = e2.json?.data[0];
|
|
1708
|
-
return t2 || ir(r2) || ir(r2.operatingActivities) || !r2.operatingActivities.children ? Wc : function(e3) {
|
|
1709
|
-
let t3 = new N(0), r3 = new N(0);
|
|
1710
|
-
for (const n2 of e3.children) n2.total < 0 ? r3 = r3.plus(N(n2.total).abs()) : t3 = t3.plus(n2.total);
|
|
1711
|
-
return { moneyIn: t3.toNumber(), moneyOut: r3.toNumber(), netMoneyIn: e3.total };
|
|
1712
|
-
}(r2.operatingActivities);
|
|
1713
|
-
}
|
|
1714
|
-
const Hc = async (e2) => {
|
|
1715
|
-
const t2 = e2.queryKey, r2 = t2[2], n2 = t2[3].accessToken, o2 = t2[3].environment, a2 = { path: "/reports/cashFlowStatementDirect", bodyParams: { exportType: "JSON", ...qt(r2.filter) }, accessToken: n2, endpointManager: kn(o2) };
|
|
1716
|
-
return Bc(await yn(a2));
|
|
1717
|
-
};
|
|
1718
|
-
const zc = ft({ backgroundColor: "money.positive.weak" }), Vc = ft({ backgroundColor: "money.negative.weak" }), jc = Object.freeze({ moneyIn: 25300, moneyOut: 8150, netMoneyIn: 17150 }), qc = Object.freeze({ moneyIn: 0, moneyOut: 0, netMoneyIn: 0 }), Uc = ({ defaultRange: e2 = zt.THIS_YEAR, isSample: t2 = false }) => {
|
|
1719
|
-
const { query: { data: r2, isFetched: n2 }, isFilling: o2 } = function({ filter: e3 }) {
|
|
1720
|
-
return br({ queryKey: Fc({ filter: e3 }), queryFn: Hc });
|
|
1721
|
-
}({ filter: e2 });
|
|
1722
|
-
let a2;
|
|
1723
|
-
a2 = t2 ? jc : r2 ?? qc;
|
|
1724
|
-
let i2 = 0;
|
|
1725
|
-
return (t2 || n2) && (i2 = Math.abs(a2.moneyIn) + Math.abs(a2.moneyOut)), S(Wn, { isSample: t2, children: [k(On, { title: "Cash Flow" }), k(Ln, { children: o2 ? S(Wo, { children: [k(Mc, {}), k(Mc, {})] }) : S(C, { children: [k($n, { title: ro(a2.netMoneyIn), label: "Change in Cash" }), S(Gn, { children: [k(cc, { amount: a2.moneyIn, total: i2, colorCss: zc, label: "Money In" }), k(cc, { amount: a2.moneyOut, total: i2, colorCss: Vc, label: "Money Out" })] })] }) }), t2 && k(ys, { size: "sm" }), t2 && k(Ac, {})] });
|
|
1726
|
-
}, Kc = At(null, ft({ display: "flex", flexDirection: "row", alignItems: "center", justifyContent: "space-between", gap: "10px", width: "100%" })), $c = At(null, ft({ display: "flex", justifyContent: "end" }));
|
|
1727
|
-
function Yc({ color: e2, bulletLabel: t2, moneySummary: r2 }) {
|
|
1728
|
-
return S("div", { ...Kc, children: [k(fo, { color: e2, label: t2 }), k("div", { ...$c, children: k(qi, { children: r2 }) })] });
|
|
1729
|
-
}
|
|
1730
|
-
const Gc = { total: 0, children: [] }, Qc = (e2) => {
|
|
1731
|
-
const t2 = void 0 === e2.result || "FAILURE_NO_DATA" === e2.result, r2 = e2.json?.data?.[0];
|
|
1732
|
-
return t2 || ir(r2) || ir(r2.expenses) || !r2.expenses.children ? Gc : { total: r2.expenses.total ?? 0, children: (n2 = r2.expenses.children, n2.sort((e3, t3) => (t3.total ?? 0) - (e3.total ?? 0)).slice(0, 3).map((e3) => ({ name: e3.name ?? "", total: e3.total ?? 0 }))) };
|
|
1733
|
-
var n2;
|
|
1734
|
-
};
|
|
1735
|
-
const Xc = At(null, ft({ display: "flex", gap: "10px", alignItems: "center" })), Zc = ft({ width: "200px", height: "16px", backgroundColor: "brand.secondary" }), Jc = At(null, Zc);
|
|
1736
|
-
function ed({ bulletAmount: e2 = 3, shimmer: t2 = false }) {
|
|
1737
|
-
return k(C, { children: Array.from({ length: e2 }, (e3, r2) => S("div", { ...Xc, children: [k(fo, { color: po.var("colors.brand.secondary") }), t2 ? k(Lo, { styles: Zc }) : k("div", { ...Jc })] }, r2)) });
|
|
1738
|
-
}
|
|
1739
|
-
const td = At(null, ft({ display: "flex", flexDirection: "row", justifyContent: "space-between", alignItems: "center", width: "100%" })), rd = [po.var("colors.brand.primary"), po.var("colors.brand.success"), po.var("colors.brand.action")], nd = Object.freeze({ total: 5043, children: [{ name: "Plane/Train/Bus", total: 2500 }, { name: "Business Meals", total: 1800 }, { name: "Employee Entertainment", total: 743 }] }), od = Object.freeze({ total: 0, children: [] });
|
|
1740
|
-
function ad({ defaultRange: e2 = zt.THIS_YEAR, monthIndex: t2, isSample: r2 = false }) {
|
|
1741
|
-
const n2 = Me((e3) => e3.externalOptions).dataVisualizationColors ?? rd, { query: { data: o2 }, isFilling: a2 } = function({ filter: e3 }) {
|
|
1742
|
-
return En({ filter: e3, select: Qc });
|
|
1743
|
-
}({ filter: e2 });
|
|
1744
|
-
let i2;
|
|
1745
|
-
i2 = r2 ? nd : o2 ?? od;
|
|
1746
|
-
const l2 = void 0 === t2 ? "Total Expenses" : `${Kt[t2]} Total`, s2 = i2.children.length > 0;
|
|
1747
|
-
return S(Wn, { isSample: r2, children: [k(On, { title: "Expenses" }), k(Ln, { children: a2 ? k(Wo, { children: k(ed, { shimmer: true }) }) : S(C, { children: [k("div", { ...td, children: k($n, { title: ro(i2.total), label: l2 }) }), k(Gn, { children: s2 ? i2.children.map((e3, t3) => k(Yc, { color: n2[t3], bulletLabel: e3.name, moneySummary: ro(e3.total) }, t3)) : k(ed, {}) })] }) }), r2 && k(ys, { size: "sm" }), r2 && k(Ac, {})] });
|
|
1748
|
-
}
|
|
1749
|
-
const id = At(null, ft({ display: "flex", flexDirection: "column", gap: "10px", maxWidth: "1440px" }));
|
|
1750
|
-
function ld({ period: e2, handleDateChange: t2, todayPeriod: r2, showSamples: n2 }) {
|
|
1751
|
-
const o2 = (a2 = e2.month, { beginDate: Bt(i2 = e2.year, a2, 1), endDate: Bt(i2, a2 + 1, 0) });
|
|
1752
|
-
var a2, i2, l2, s2, c2, d2, u2, h2;
|
|
1753
|
-
return S("div", { ...id, children: [S(Mt, { children: [k(Ft, { children: "Monthly Review" }), k(Zs, { period: e2, setPeriod: t2, disableNext: (l2 = e2, s2 = r2, u2 = l2.month, h2 = s2.month, u2 === h2 && (c2 = l2.year, d2 = s2.year, c2 === d2)) })] }), S(ec, { children: [k(Lc, { defaultRange: o2, isSample: n2 }), k(Uc, { defaultRange: o2, isSample: n2 }), k(ad, { defaultRange: o2, monthIndex: e2.month, isSample: n2 })] })] });
|
|
1754
|
-
}
|
|
1755
|
-
const sd = ft({ width: "100%", height: 72, minWidth: "300px" });
|
|
1756
|
-
function cd() {
|
|
1757
|
-
return S(C, { children: [k(Lo, { styles: sd }), k(Lo, { styles: sd }), k(Lo, { styles: sd })] });
|
|
1758
|
-
}
|
|
1759
|
-
const dd = { ASC: "Oldest to Newest", DESC: "Newest to Oldest" }, ud = { ASC: "A-Z", DESC: "Z-A" }, hd = { ASC: "Lowest to Highest", DESC: "Highest to Lowest" }, gd = { ASC: "A-Z", DESC: "Z-A" };
|
|
1760
|
-
function pd() {
|
|
1761
|
-
const [e2, t2] = v(void 0), r2 = u(() => {
|
|
1762
|
-
if (e2 && (e2.orderBy || e2.direction)) return e2;
|
|
1763
|
-
}, [e2]);
|
|
1764
|
-
return { sortInstance: e2, setSortInstance: (e3) => {
|
|
1765
|
-
(function(e4) {
|
|
1766
|
-
if (void 0 === e4) return true;
|
|
1767
|
-
const t3 = (e4.orderBy && e4.orderBy in ci) ?? false, r3 = (e4.direction && e4.direction in di) ?? false;
|
|
1768
|
-
return t3 && r3;
|
|
1769
|
-
})(e3) && t2(e3);
|
|
1770
|
-
}, apiSort: r2 };
|
|
1771
|
-
}
|
|
1772
|
-
const vd = aa((e2) => c.createElement("svg", { width: 10, height: 10, viewBox: "0 0 10 10", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e2 }, c.createElement("g", { id: "icon/check" }, c.createElement("path", { id: "Vector", d: "M0.986511 5L3.66217 7.67566L9.01349 2.32434", stroke: "white", strokeWidth: 1.25, strokeMiterlimit: 10 }))), "Check"), md = ft({ width: "15px", height: "15px", borderRadius: "sm", cursor: "pointer", display: "flex", alignItems: "center", justifyContent: "center", padding: 0, margin: 0, position: "relative", "&::before": { content: "''", position: "absolute", top: "-10px", left: "-10px", right: "-10px", bottom: "-10px" }, _supportHover: { "&[data-is-checked='false']": { backgroundColor: "surface.background.hover" } } }), bd = ft({ border: "{borderWidths.lg} solid", borderColor: "border.layout.strong", background: "surface.foreground" }), fd = ft({ background: "brand.primary.strong", border: "none" });
|
|
1773
|
-
function yd({ checked: e2, onClick: t2 }) {
|
|
1774
|
-
const [r2, n2] = v(e2 ?? false), o2 = void 0 === e2 ? r2 : e2;
|
|
1775
|
-
return k("button", { ...At(kt["checkbox-input"], md, o2 ? fd : bd, ca), type: "button", onClick: (o3) => {
|
|
1776
|
-
void 0 === e2 && n2(!r2), t2 && t2(o3);
|
|
1777
|
-
}, "data-is-checked": o2, children: o2 && k(dl, { Component: vd }) });
|
|
1778
|
-
}
|
|
1779
|
-
const Td = At(null, ft({ paddingLeft: "20px", paddingRight: "5px" }));
|
|
1780
|
-
function xd({ checked: e2, onClick: t2 }) {
|
|
1781
|
-
return k("div", { ...Td, children: k(yd, { checked: e2, onClick: t2 }) });
|
|
1782
|
-
}
|
|
1783
|
-
const wd = At(kt.text, ft({ fontSize: "sm", fontWeight: "sm", color: "typography.base", fontStyle: "normal", letterSpacing: "0.66px", maxWidth: "100%" }), Bn);
|
|
1784
|
-
function kd({ children: e2 }) {
|
|
1785
|
-
return k("div", { ...wd, children: e2 });
|
|
1786
|
-
}
|
|
1787
|
-
const Cd = At(kt["date-cell"], ft({ display: "flex", flexDirection: "column", alignItems: "flex-start", justifyContent: "center" }));
|
|
1788
|
-
function Sd({ date: e2, annotation: t2 }) {
|
|
1789
|
-
return S("div", { ...Cd, children: [t2 && k(kd, { children: t2 }), k(qi, { children: e2 })] });
|
|
1790
|
-
}
|
|
1791
|
-
const Ed = ft({ color: "money.negative" }), Id = ft({ color: "money.positive" }), Pd = (e2) => {
|
|
1792
|
-
let t2;
|
|
1793
|
-
switch (e2.type) {
|
|
1794
|
-
case "EXPENSE":
|
|
1795
|
-
t2 = ((e3) => {
|
|
1796
|
-
const t3 = e3.amount > 0;
|
|
1797
|
-
let r2;
|
|
1798
|
-
return r2 = t3 ? "Expense Refund" : e3.children?.length > 0 ? "Split Expense" : "Expense", { type: "EXPENSE", displayName: r2, css: t3 ? Id : Ed };
|
|
1799
|
-
})(e2);
|
|
1800
|
-
break;
|
|
1801
|
-
case "REVENUE":
|
|
1802
|
-
t2 = ((e3) => {
|
|
1803
|
-
const t3 = e3.amount < 0;
|
|
1804
|
-
return { type: "REVENUE", displayName: t3 ? "Income Refund" : "Income", css: t3 ? Ed : Id };
|
|
1805
|
-
})(e2);
|
|
1806
|
-
break;
|
|
1807
|
-
case "BANK_TRANSFER":
|
|
1808
|
-
t2 = ((e3) => {
|
|
1809
|
-
let t3 = "Bank Transfer";
|
|
1810
|
-
return e3.children?.length > 0 && (t3 = "Payout"), { type: "BANK_TRANSFER", displayName: t3, css: e3.amount < 0 ? Ed : Id };
|
|
1811
|
-
})(e2);
|
|
1812
|
-
break;
|
|
1813
|
-
case "TAX_PAYMENT":
|
|
1814
|
-
t2 = { type: "TAX_PAYMENT", displayName: "Tax Payment", css: Ed };
|
|
1815
|
-
break;
|
|
1816
|
-
case "INVOICE_PAYMENT":
|
|
1817
|
-
t2 = ((e3) => {
|
|
1818
|
-
let t3 = "Invoice Payment", r2 = Id;
|
|
1819
|
-
return e3.amount < 0 && (t3 = "Invoice Payment Refund", r2 = Ed), { type: "INVOICE_PAYMENT", displayName: t3, css: r2 };
|
|
1820
|
-
})(e2);
|
|
1821
|
-
}
|
|
1822
|
-
return t2;
|
|
1823
|
-
};
|
|
1824
|
-
function Ad({ transaction: e2 }) {
|
|
1825
|
-
const t2 = Pd(e2), r2 = At(kt["transaction-type-label"], t2.css), n2 = k("span", { ...r2, children: t2.displayName });
|
|
1826
|
-
return k(Sd, { date: e2.date, annotation: n2 });
|
|
1827
|
-
}
|
|
1828
|
-
function Dd({ label: e2, subLabel: t2 }) {
|
|
1829
|
-
return S(C, { children: [k(lo, { children: e2 }), k(co, { children: t2 })] });
|
|
1830
|
-
}
|
|
1831
|
-
function Md({ bankTransaction: e2 }) {
|
|
1832
|
-
return k(Dd, { label: e2.description, subLabel: e2.bankAccount?.name });
|
|
1833
|
-
}
|
|
1834
|
-
function Nd(e2) {
|
|
1835
|
-
return new N(e2).div(100).toNumber();
|
|
1836
|
-
}
|
|
1837
|
-
function Rd(e2) {
|
|
1838
|
-
return new N(e2).times(100).toNumber();
|
|
1839
|
-
}
|
|
1840
|
-
function Od(e2) {
|
|
1841
|
-
return no(Nd(e2.amount));
|
|
1842
|
-
}
|
|
1843
|
-
function _d({ transaction: e2 }) {
|
|
1844
|
-
return k(qi, { children: Od(e2) });
|
|
1845
|
-
}
|
|
1846
|
-
const Ld = At(null, ft({ padding: "0 25px", height: "100%", display: "flex", flexDirection: "column", alignItems: "flex-start", justifyContent: "center", gap: "4px" }));
|
|
1847
|
-
function Fd({ annotation: e2, accountName: t2 }) {
|
|
1848
|
-
return S("div", { ...Ld, children: [e2 && k(co, { children: e2 }), t2 && k(lo, { children: t2 })] });
|
|
1849
|
-
}
|
|
1850
|
-
function Wd(e2, t2) {
|
|
1851
|
-
return `${e2 ? `#${e2}` : ""} ${t2 ?? ""}`.trim();
|
|
1852
|
-
}
|
|
1853
|
-
const Bd = At(kt["cell-button"], ft({ border: "none", backgroundColor: "transparent", padding: "0 25px", gap: "10px", margin: 0, cursor: "pointer", display: "flex", alignItems: "center", justifyContent: "flex-start", flexDirection: "row", flex: 1, outline: "none", borderRadius: "md", boxShadow: "0 0 0 0 transparent", "&:focus-visible": { transition: "none", position: "relative" }, "&:focus-visible::before": { content: "''", position: "absolute", top: 0, left: 0, right: 0, bottom: 0, borderRadius: "md", outline: "4px solid", outlineColor: "border.layout", pointerEvents: "none" }, _supportHover: { backgroundColor: "surface.intent.action.hover" }, "&[data-state='open']": { backgroundColor: "surface.intent.action.active" }, "& .Tight-text": { position: "relative" }, "& .Tight-text::after": { content: "''", position: "absolute", bottom: 0, left: 0, width: 0, height: "1px", backgroundColor: "currentColor", transition: "width 100ms ease-out", _supportHover: { width: "100%", transition: "width 300ms ease-out" } }, "&[data-state='open'] > .Tight-text::after": { width: "100%", transition: "width 300ms ease-out" } }), ca), Hd = y(function({ children: e2, ...t2 }, r2) {
|
|
1854
|
-
return k("button", { ref: r2, ...Bd, ...t2, children: e2 });
|
|
1855
|
-
}), zd = h(Object.freeze({ map: /* @__PURE__ */ new Map(), register: () => {
|
|
1856
|
-
}, unregister: () => {
|
|
1857
|
-
}, focusedIndex: null, isMousing: true, isScrolling: false, listRef: void 0, popupNodeId: void 0 })), Vd = (e2, t2) => {
|
|
1858
|
-
let r2;
|
|
1859
|
-
if (null === e2.focusedIndex) r2 = 0;
|
|
1860
|
-
else {
|
|
1861
|
-
const n2 = e2.focusedIndex + 1;
|
|
1862
|
-
r2 = !t2.repeat && n2 > e2.maxIndex ? 0 : Math.min(n2, e2.maxIndex);
|
|
1863
|
-
}
|
|
1864
|
-
return { ...e2, focusedIndex: r2 };
|
|
1865
|
-
}, jd = (e2, t2) => {
|
|
1866
|
-
let r2;
|
|
1867
|
-
if (null === e2.focusedIndex) r2 = e2.maxIndex;
|
|
1868
|
-
else {
|
|
1869
|
-
const n2 = e2.focusedIndex - 1;
|
|
1870
|
-
r2 = !t2.repeat && n2 < 0 ? e2.maxIndex : Math.max(n2, 0);
|
|
1871
|
-
}
|
|
1872
|
-
return { ...e2, focusedIndex: r2 };
|
|
1873
|
-
};
|
|
1874
|
-
function qd(e2, t2) {
|
|
1875
|
-
switch (t2.type) {
|
|
1876
|
-
case "increment":
|
|
1877
|
-
return Vd(e2, t2);
|
|
1878
|
-
case "decrement":
|
|
1879
|
-
return jd(e2, t2);
|
|
1880
|
-
case "set":
|
|
1881
|
-
return { ...e2, focusedIndex: Math.min(t2.focusedIndex, e2.maxIndex) };
|
|
1882
|
-
case "max":
|
|
1883
|
-
return { ...e2, maxIndex: t2.max };
|
|
1884
|
-
}
|
|
1885
|
-
}
|
|
1886
|
-
function Ud(e2, t2) {
|
|
1887
|
-
const r2 = e2.compareDocumentPosition(t2);
|
|
1888
|
-
return r2 & Node.DOCUMENT_POSITION_FOLLOWING || r2 & Node.DOCUMENT_POSITION_CONTAINED_BY ? -1 : r2 & Node.DOCUMENT_POSITION_PRECEDING || r2 & Node.DOCUMENT_POSITION_CONTAINS ? 1 : 0;
|
|
1889
|
-
}
|
|
1890
|
-
function Kd(e2, t2) {
|
|
1891
|
-
const r2 = t2.getBoundingClientRect(), n2 = e2.getBoundingClientRect();
|
|
1892
|
-
return n2.top >= r2.top && n2.bottom <= r2.bottom && n2.left >= r2.left && n2.right <= r2.right;
|
|
1893
|
-
}
|
|
1894
|
-
function $d(e2, t2, r2) {
|
|
1895
|
-
if (null === e2) return { node: void 0, metadata: void 0 };
|
|
1896
|
-
const n2 = t2[e2];
|
|
1897
|
-
return { node: n2, metadata: r2.get(n2) };
|
|
1898
|
-
}
|
|
1899
|
-
function Yd(e2, t2, r2, n2, o2, a2) {
|
|
1900
|
-
b(() => {
|
|
1901
|
-
const i2 = e2.current;
|
|
1902
|
-
if (!i2) return;
|
|
1903
|
-
const l2 = (e3) => {
|
|
1904
|
-
const { node: l3, metadata: s2 } = $d(n2, t2, r2), { shouldOpenCascade: c2, shouldCloseCascade: d2 } = function(e4, t3, r3) {
|
|
1905
|
-
const n3 = e4.placement.includes("left"), o3 = e4?.popupParentNodeId, a3 = o3 && r3?.hasCascading && n3 ? "ArrowLeft" : "ArrowRight", i3 = n3 ? "ArrowRight" : "ArrowLeft";
|
|
1906
|
-
return { shouldOpenCascade: r3?.hasCascading && t3.key === a3, shouldCloseCascade: o3 && t3.key === i3 };
|
|
1907
|
-
}(o2, e3, s2), u2 = !(e3.target instanceof HTMLInputElement && "" !== e3.target.value) && " " === e3.key;
|
|
1908
|
-
if (c2 || "Enter" === e3.key || u2) {
|
|
1909
|
-
const t3 = function(e4, t4, r3, n3, o3) {
|
|
1910
|
-
return !(!e4 || !e4.hasCascading || null === t4) && !(r3 && n3 && Kd(r3, n3) && (o3.setCascadeState(true, t4), o3.setFocus(true), 0));
|
|
1911
|
-
}(s2, n2, l3, i2, a2);
|
|
1912
|
-
t3 || function(e4) {
|
|
1913
|
-
const t4 = new MouseEvent("click", { view: window, bubbles: true, cancelable: true });
|
|
1914
|
-
e4?.dispatchEvent(t4);
|
|
1915
|
-
}(l3), e3.preventDefault();
|
|
1916
|
-
} else d2 && (e3.preventDefault(), o2.setOpen(false));
|
|
1917
|
-
};
|
|
1918
|
-
return i2.addEventListener("keydown", l2), () => {
|
|
1919
|
-
i2.removeEventListener("keydown", l2);
|
|
1920
|
-
};
|
|
1921
|
-
}, [e2, t2, n2, r2, o2, a2]);
|
|
1922
|
-
}
|
|
1923
|
-
function Gd(e2) {
|
|
1924
|
-
const [t2, r2] = v(() => /* @__PURE__ */ new Map()), { listRef: n2, focusedState: o2, isMousing: a2, isScrolling: i2 } = function(e3, t3) {
|
|
1925
|
-
const r3 = d(null), [n3, o3] = v(true), [a3, i3] = v(false), l3 = g(zd), [s3, c3] = T(qd, { focusedIndex: null, maxIndex: e3 });
|
|
1926
|
-
b(() => {
|
|
1927
|
-
const e4 = r3.current, t4 = () => {
|
|
1928
|
-
null == s3.focusedIndex && void 0 !== l3?.popupNodeId && c3({ type: "set", focusedIndex: 0 });
|
|
1929
|
-
};
|
|
1930
|
-
return e4?.addEventListener("focus", t4), () => {
|
|
1931
|
-
e4?.removeEventListener("focus", t4);
|
|
1932
|
-
};
|
|
1933
|
-
}, [r3, s3.focusedIndex, c3, l3?.popupNodeId]);
|
|
1934
|
-
const u2 = d(null);
|
|
1935
|
-
return b(() => {
|
|
1936
|
-
c3({ type: "max", max: e3 });
|
|
1937
|
-
}, [e3]), b(() => {
|
|
1938
|
-
const e4 = r3.current;
|
|
1939
|
-
if (null !== e4) {
|
|
1940
|
-
const r4 = (e5) => {
|
|
1941
|
-
i3(false);
|
|
1942
|
-
const r5 = e5.target instanceof HTMLElement && e5.target.getAttribute("data-listitem");
|
|
1943
|
-
if (!r5) return;
|
|
1944
|
-
const n5 = Number(e5.target.getAttribute("data-index"));
|
|
1945
|
-
s3.focusedIndex === n5 && u2.current === e5.target || (0 !== e5.movementX || 0 !== e5.movementY) && r5 && (o3(true), u2.current = e5.target, c3({ type: "set", focusedIndex: n5 }), t3.setCascadeState(true, n5));
|
|
1946
|
-
}, n4 = (e5) => {
|
|
1947
|
-
const t4 = "ArrowDown" === e5.key || "Tab" === e5.key && !e5.shiftKey, r5 = "ArrowUp" === e5.key || "Tab" === e5.key && e5.shiftKey;
|
|
1948
|
-
o3(false), i3(false), t4 ? (e5.preventDefault(), c3({ type: "increment", repeat: e5.repeat })) : r5 && (e5.preventDefault(), c3({ type: "decrement", repeat: e5.repeat }));
|
|
1949
|
-
}, a4 = () => i3(true);
|
|
1950
|
-
return e4.addEventListener("mousemove", r4), e4.addEventListener("keydown", n4), e4.addEventListener("scroll", a4), () => {
|
|
1951
|
-
e4.removeEventListener("mousemove", r4), e4.removeEventListener("keydown", n4), e4.removeEventListener("scroll", a4);
|
|
1952
|
-
};
|
|
1953
|
-
}
|
|
1954
|
-
}, [t3, s3.focusedIndex]), { listRef: r3, focusedState: s3, isMousing: n3, isScrolling: a3 };
|
|
1955
|
-
}(t2.size - 1, e2), l2 = ll(), s2 = m((e3, t3) => {
|
|
1956
|
-
r2((r3) => new Map(r3).set(e3, t3 ?? null));
|
|
1957
|
-
}, []), c2 = m((e3) => {
|
|
1958
|
-
r2((t3) => {
|
|
1959
|
-
const r3 = new Map(t3);
|
|
1960
|
-
return r3.delete(e3), r3;
|
|
1961
|
-
});
|
|
1962
|
-
}, []), { sortedNodes: h2, sortedMap: p2 } = function(e3, t3) {
|
|
1963
|
-
const r3 = u(() => {
|
|
1964
|
-
let r4 = [];
|
|
1965
|
-
return null !== t3.current && (r4 = Array.from(e3.keys()).sort(Ud)), r4;
|
|
1966
|
-
}, [e3, t3]), n3 = u(() => {
|
|
1967
|
-
const t4 = /* @__PURE__ */ new Map();
|
|
1968
|
-
return r3.forEach((r4, n4) => {
|
|
1969
|
-
const o3 = e3.get(r4) ?? {};
|
|
1970
|
-
t4.set(r4, { ...o3, index: n4 });
|
|
1971
|
-
}), t4;
|
|
1972
|
-
}, [r3, e3]);
|
|
1973
|
-
return { sortedNodes: r3, sortedMap: n3 };
|
|
1974
|
-
}(t2, n2);
|
|
1975
|
-
Yd(n2, h2, p2, o2.focusedIndex, l2, e2);
|
|
1976
|
-
const { startCallback: f2, cancelCallback: y2 } = Ra({ delay: 200, callback: ({ focusedIndex: t3, node: r3, listElement: n3 }) => {
|
|
1977
|
-
!(!r3 || !n3) && Kd(r3, n3) ? e2.setCascadeState(true, t3) : e2.closeCurrentCascade();
|
|
1978
|
-
} });
|
|
1979
|
-
return function(e3, t3, r3, n3, o3, a3, i3, l3) {
|
|
1980
|
-
b(() => {
|
|
1981
|
-
const s3 = o3.current;
|
|
1982
|
-
if (null === e3 || t3) return;
|
|
1983
|
-
const { node: c3, metadata: d2 } = $d(e3, r3, n3);
|
|
1984
|
-
return a3.lastOpenedIndex !== e3 && d2?.hasCascading && (a3.closeCurrentCascade(), i3({ focusedIndex: e3, node: c3, listElement: s3 })), () => l3();
|
|
1985
|
-
}, [e3, t3, o3, a3, l3, r3, n3, i3]);
|
|
1986
|
-
}(o2.focusedIndex, a2, h2, p2, n2, e2, f2, y2), function(e3, t3, r3, n3) {
|
|
1987
|
-
b(() => {
|
|
1988
|
-
const { metadata: o3 } = $d(e3, t3, r3);
|
|
1989
|
-
null === e3 || o3?.hasCascading || n3.closeCurrentCascade();
|
|
1990
|
-
}, [n3, e3, r3, t3]);
|
|
1991
|
-
}(o2.focusedIndex, h2, p2, e2), u(() => ({ register: s2, unregister: c2, map: p2, focusedIndex: o2.focusedIndex, listRef: n2, isMousing: a2, isScrolling: i2, popupNodeId: l2?.nodeId }), [s2, c2, p2, o2.focusedIndex, n2, a2, i2, l2?.nodeId]);
|
|
1992
|
-
}
|
|
1993
|
-
const Qd = h(Object.freeze({ cascadeIndex: null, setCascadeState: () => {
|
|
1994
|
-
}, onScroll: () => {
|
|
1995
|
-
}, focus: false, setFocus: () => {
|
|
1996
|
-
}, lastOpenedIndex: null, closeCurrentCascade: () => {
|
|
1997
|
-
} }));
|
|
1998
|
-
function Xd({ style: e2, children: t2 }) {
|
|
1999
|
-
const r2 = At(kt["popup-list"], tl, e2), n2 = function() {
|
|
2000
|
-
const [e3, t3] = v(null), [r3, n3] = v(false), [o3, a2] = v(null), i2 = m((r4, o4) => {
|
|
2001
|
-
r4 && e3 !== o4 ? (a2(o4), t3(o4)) : r4 || e3 !== o4 || (n3(false), t3(null));
|
|
2002
|
-
}, [e3, n3]), l2 = m(() => {
|
|
2003
|
-
t3(null), a2(null), n3(false);
|
|
2004
|
-
}, [t3, a2, n3]), s2 = m(() => {
|
|
2005
|
-
t3(null), a2(null), n3(false);
|
|
2006
|
-
}, []);
|
|
2007
|
-
return { cascadeIndex: e3, setCascadeState: i2, onScroll: l2, focus: r3, setFocus: n3, lastOpenedIndex: o3, closeCurrentCascade: s2 };
|
|
2008
|
-
}(), o2 = Gd(n2);
|
|
2009
|
-
return k("div", { ...r2, onScroll: n2.onScroll, ref: o2.listRef, tabIndex: 0, children: k(zd.Provider, { value: o2, children: k(Qd.Provider, { value: n2, children: t2 }) }) });
|
|
2010
|
-
}
|
|
2011
|
-
function Zd({ hasCascading: e2 = false } = {}) {
|
|
2012
|
-
const t2 = d(null), { register: r2, unregister: n2, map: o2, focusedIndex: a2, isMousing: i2, listRef: l2 } = g(zd);
|
|
2013
|
-
x(() => {
|
|
2014
|
-
const o3 = t2.current;
|
|
2015
|
-
if (o3) return r2(o3, { index: 0, hasCascading: e2 }), () => {
|
|
2016
|
-
n2(o3);
|
|
2017
|
-
};
|
|
2018
|
-
}, [r2, n2, e2]);
|
|
2019
|
-
const s2 = u(() => void 0 !== o2 && null !== t2.current ? o2.get(t2.current)?.index ?? -1 : -1, [o2]), c2 = s2 === a2;
|
|
2020
|
-
x(() => {
|
|
2021
|
-
c2 && (i2 || t2.current?.scrollIntoView({ behavior: "instant", block: "nearest", inline: "nearest" }));
|
|
2022
|
-
}, [c2, i2]);
|
|
2023
|
-
const h2 = m(() => {
|
|
2024
|
-
l2?.current?.focus();
|
|
2025
|
-
}, [l2]), p2 = u(() => ({ onFocus: h2, "data-focused": c2 }), [h2, c2]);
|
|
2026
|
-
return { itemRef: t2, isActive: c2, index: s2, itemProps: p2 };
|
|
2027
|
-
}
|
|
2028
|
-
const Jd = y(function({ onClick: e2, index: t2, children: r2, itemProps: n2, popupTriggerProps: o2 }, a2) {
|
|
2029
|
-
return k("button", { ...nl, onClick: e2, "data-listitem": true, "data-index": t2, ...o2, ...n2, ref: a2, children: r2 });
|
|
2030
|
-
}), eu = y(function({ onClick: e2, children: t2, popupTriggerProps: r2 }, n2) {
|
|
2031
|
-
const { index: o2, itemProps: a2, itemRef: i2 } = Zd(), l2 = se([i2, n2]);
|
|
2032
|
-
return k(Jd, { ...nl, onClick: e2, index: o2, ...r2, itemProps: a2, ref: l2, children: t2 });
|
|
2033
|
-
}), tu = At(kt.text, _t({ label: "strongLabel" }), ft({ maxWidth: "100%" }), Bn);
|
|
2034
|
-
function ru({ children: e2, stylists: t2 = [] }) {
|
|
2035
|
-
const r2 = Ot([tu, ...t2]);
|
|
2036
|
-
return k("div", { ...r2, children: e2 });
|
|
2037
|
-
}
|
|
2038
|
-
function nu({ text: e2 }) {
|
|
2039
|
-
return k("div", { ...nl, children: e2 ? k(lo, { children: e2 }) : k(Lo, { styles: ft({ width: "100%", height: "16px" }) }) });
|
|
2040
|
-
}
|
|
2041
|
-
const ou = At(kt["popup-list"], tl), au = () => S("div", { ...ou, children: [k(nu, {}), k(nu, {}), k(nu, {}), k(nu, {}), k(nu, {})] }), iu = ["LIABILITY", "EQUITY", "INCOME", "OTHER_INCOME"];
|
|
2042
|
-
function lu(e2, t2) {
|
|
2043
|
-
return u(() => e2?.filter((e3) => t2.includes(e3.type)) ?? [], [e2, t2]);
|
|
2044
|
-
}
|
|
2045
|
-
const su = (e2) => ({ id: e2.id || "", name: e2.name, accountNo: e2.accountNo }), cu = { all: () => ["accounting", "glAccounts"] }, du = async (e2) => {
|
|
2046
|
-
const t2 = e2.queryKey, r2 = { path: "/accounting/glAccounts", params: { leavesOnly: "false" }, accessToken: t2[2].accessToken, environment: t2[2].environment }, n2 = await Na(r2);
|
|
2047
|
-
return gu(n2);
|
|
2048
|
-
};
|
|
2049
|
-
function uu(e2) {
|
|
2050
|
-
return br({ ...e2, queryKey: cu.all(), queryFn: du });
|
|
2051
|
-
}
|
|
2052
|
-
function hu() {
|
|
2053
|
-
return uu({ select: bu });
|
|
2054
|
-
}
|
|
2055
|
-
const gu = (e2) => e2.map((e3) => ({ ...e3, id: `${bi.GL_ACCOUNT}_${e3.id}` }));
|
|
2056
|
-
function pu(e2, t2) {
|
|
2057
|
-
const r2 = t2.get(e2.accountNo) ?? [];
|
|
2058
|
-
return 0 === r2.length ? [{ ...e2, children: [] }] : r2.flatMap((e3) => pu(e3, t2));
|
|
2059
|
-
}
|
|
2060
|
-
const vu = (e2) => !e2.parentAccountNo;
|
|
2061
|
-
function mu(e2) {
|
|
2062
|
-
const t2 = function(e3) {
|
|
2063
|
-
const t3 = /* @__PURE__ */ new Map();
|
|
2064
|
-
for (const r2 of e3) if (r2.parentAccountNo) {
|
|
2065
|
-
const e4 = t3.get(r2.parentAccountNo) ?? [];
|
|
2066
|
-
e4.push(r2), t3.set(r2.parentAccountNo, e4);
|
|
2067
|
-
}
|
|
2068
|
-
return t3;
|
|
2069
|
-
}(e2);
|
|
2070
|
-
return e2.filter(vu).map((e3) => ({ ...e3, children: pu(e3, t2) }));
|
|
2071
|
-
}
|
|
2072
|
-
function bu(e2) {
|
|
2073
|
-
return mu(e2).flatMap((e3) => [e3, ...e3.children]);
|
|
2074
|
-
}
|
|
2075
|
-
const fu = [At(null, ft({ marginLeft: "6px", marginRight: "6px" }))], yu = At(null, ft({ whiteSpace: "normal" })), Tu = { keys: [{ name: "accountNo", weight: 0.3 }, { name: "name", weight: 0.7 }], threshold: 0.3, includeScore: true, minMatchCharLength: 1 };
|
|
2076
|
-
function xu(e2, t2, r2) {
|
|
2077
|
-
(function(e3, t3) {
|
|
2078
|
-
return t3.some(({ child: t4 }) => t4.accountNo === e3.accountNo);
|
|
2079
|
-
})(t2, r2) || r2.push({ parent: e2, child: t2 });
|
|
2080
|
-
}
|
|
2081
|
-
function wu(e2, t2) {
|
|
2082
|
-
const r2 = [];
|
|
2083
|
-
return e2.forEach((e3) => {
|
|
2084
|
-
const n2 = e3.item, o2 = function(e4, t3) {
|
|
2085
|
-
return t3.find((t4) => t4.children.some((t5) => t5.accountNo === e4.accountNo));
|
|
2086
|
-
}(n2, t2);
|
|
2087
|
-
!o2 && n2.children.length > 0 ? function(e4, t3) {
|
|
2088
|
-
e4.children.forEach((r3) => {
|
|
2089
|
-
xu(e4, r3, t3);
|
|
2090
|
-
});
|
|
2091
|
-
}(n2, r2) : o2 && xu(o2, n2, r2);
|
|
2092
|
-
}), r2;
|
|
2093
|
-
}
|
|
2094
|
-
function ku({ types: e2, onClick: t2, searchTerm: r2 }) {
|
|
2095
|
-
const { query: { data: n2 }, isFilling: o2 } = hu(), a2 = lu(n2, e2), i2 = u(() => new ve(a2, Tu), [a2]), l2 = u(() => wu(i2.search(r2), a2), [a2, r2, i2]);
|
|
2096
|
-
return o2 ? k(au, {}) : l2.map(({ parent: e3, child: r3 }) => k(eu, { onClick: () => t2(r3), children: S(ru, { stylists: [yu], children: [Wd(e3.accountNo, e3.name), k(ga, { Component: la, stylists: fu }), Wd(r3.accountNo, r3.name)] }) }, `${r3.accountNo}`));
|
|
2097
|
-
}
|
|
2098
|
-
const Cu = y(function({ index: e2, popupTriggerProps: t2, children: r2, itemProps: n2 }, o2) {
|
|
2099
|
-
const a2 = se([o2, t2?.ref]);
|
|
2100
|
-
return k(Jd, { index: e2, ref: a2, itemProps: n2, popupTriggerProps: t2, children: r2 });
|
|
2101
|
-
});
|
|
2102
|
-
function Su({ triggerChildren: e2, popupChildren: t2 }) {
|
|
2103
|
-
const { cascadeIndex: r2, setCascadeState: n2, focus: o2 } = g(Qd), { itemRef: a2, index: i2, itemProps: l2 } = Zd({ hasCascading: true }), { isScrolling: s2 } = g(zd);
|
|
2104
|
-
return S(il, { open: r2 === i2, onOpenChange: (e3) => {
|
|
2105
|
-
s2 || n2(e3, i2);
|
|
2106
|
-
}, placement: "right-start", children: [k(sl, { children: (t3) => k(Cu, { itemProps: l2, index: i2, ref: a2, popupTriggerProps: t3, children: e2 }) }), k(fl, { initialFocus: o2, children: t2 })] });
|
|
2107
|
-
}
|
|
2108
|
-
const Eu = At(null, ft({ display: "flex", width: "100%", justifyContent: "space-between", alignItems: "center" })), Iu = At(null, ft({ whiteSpace: "normal" }));
|
|
2109
|
-
function Pu({ icon: e2, displayLabel: t2 }) {
|
|
2110
|
-
return S("div", { ...Eu, children: [e2, k(lo, { stylists: [Iu], children: t2 }), k(ga, { Component: la })] });
|
|
2111
|
-
}
|
|
2112
|
-
function Au({ types: e2, onClick: t2 }) {
|
|
2113
|
-
const { query: { data: r2, isFetching: n2 }, isFilling: o2 } = uu({ select: mu }), a2 = lu(r2, e2);
|
|
2114
|
-
return o2 ? k(au, {}) : o2 || n2 || void 0 !== r2 ? a2.map((e3) => {
|
|
2115
|
-
const r3 = Wd(e3.accountNo, e3.name);
|
|
2116
|
-
return k(Su, { triggerChildren: k(Pu, { displayLabel: r3 }), popupChildren: k(Du, { glAccount: e3, onClick: t2 }) }, e3.accountNo);
|
|
2117
|
-
}) : k(nu, { text: "No data" });
|
|
2118
|
-
}
|
|
2119
|
-
function Du({ glAccount: e2, onClick: t2 }) {
|
|
2120
|
-
return k(Xd, { children: e2.children.map((e3) => k(eu, { onClick: () => t2(e3), children: k(lo, { children: Wd(e3.accountNo, e3.name) }) }, e3.accountNo)) });
|
|
2121
|
-
}
|
|
2122
|
-
const Mu = At(null, ft({ display: "flex", alignItems: "center", padding: "10px", flex: 1, border: "none", outline: "none", background: "transparent", fontSize: "sm", fontWeight: "sm", "&::placeholder": { color: "typography.base.weak" } }));
|
|
2123
|
-
function Nu({ searchTerm: e2, setSearchTerm: t2, placeholder: r2 }) {
|
|
2124
|
-
const n2 = d(null);
|
|
2125
|
-
return b(() => {
|
|
2126
|
-
n2.current?.focus({ preventScroll: true });
|
|
2127
|
-
const e3 = (e4) => {
|
|
2128
|
-
!n2.current || document.activeElement === n2.current || (1 !== e4.key.length || e4.ctrlKey || e4.altKey || e4.metaKey) && "Backspace" !== e4.key || n2.current.focus();
|
|
2129
|
-
};
|
|
2130
|
-
return document.addEventListener("keydown", e3), () => {
|
|
2131
|
-
document.removeEventListener("keydown", e3);
|
|
2132
|
-
};
|
|
2133
|
-
}, []), k("input", { ref: n2, type: "text", placeholder: r2, value: e2, onChange: (e3) => t2(e3.target.value), ...Mu });
|
|
2134
|
-
}
|
|
2135
|
-
const Ru = "Search revenue accounts...";
|
|
2136
|
-
function Ou({ onClick: e2, types: t2 }) {
|
|
2137
|
-
const r2 = ll(), [n2, o2] = v(""), a2 = cr(n2) ? ft({ maxWidth: "420px", width: "fit-content" }) : void 0, i2 = (t3) => {
|
|
2138
|
-
e2(t3), r2?.setOpen(false);
|
|
2139
|
-
};
|
|
2140
|
-
return k(fl, { children: S(Xd, { style: a2, children: [k(Nu, { searchTerm: n2, setSearchTerm: o2, placeholder: Ru }), cr(n2) ? k(ku, { types: t2, onClick: i2, searchTerm: n2 }) : k(Au, { types: t2, onClick: i2 })] }) });
|
|
2141
|
-
}
|
|
2142
|
-
const _u = async ({ data: e2, accessToken: t2, environment: r2 }) => Fu({ data: { data: e2 }, accessToken: t2, environment: r2 }), Lu = async ({ data: e2, accessToken: t2, environment: r2 }) => _u({ data: [e2], accessToken: t2, environment: r2 }), Fu = async ({ data: e2, accessToken: t2, environment: r2 }) => {
|
|
2143
|
-
const n2 = { path: "/v6/banks/transactions", bodyParams: e2, accessToken: t2, endpointManager: ea(r2) };
|
|
2144
|
-
return await fn(n2);
|
|
2145
|
-
};
|
|
2146
|
-
function Wu() {
|
|
2147
|
-
return function(e2) {
|
|
2148
|
-
return Ms({ onSuccess: async () => {
|
|
2149
|
-
const e3 = ui.base();
|
|
2150
|
-
return en("mutation successful, invalidating BT queries"), pr.invalidateQueries({ queryKey: e3 }).catch((e4) => tn({ error: e4, severity: "error" }));
|
|
2151
|
-
}, ...e2 });
|
|
2152
|
-
}({ mutationFn: _u });
|
|
2153
|
-
}
|
|
2154
|
-
function Bu() {
|
|
2155
|
-
return function(e2) {
|
|
2156
|
-
return Ms({ onSuccess: async () => (en("mutation successful, invalidating BT queries"), pr.invalidateQueries({ predicate: (e3) => e3.queryKey.includes(ta.base()) || ui.base().every((t2) => e3.queryKey.includes(t2)) || e3.queryKey.includes("reports") }).catch((e3) => tn({ error: e3, severity: "error" }))), ...e2 });
|
|
2157
|
-
}({ mutationFn: Lu });
|
|
2158
|
-
}
|
|
2159
|
-
function Hu({ transaction: e2, accountNo: t2, accountName: r2 }) {
|
|
2160
|
-
const { startPrefetch: n2, cancelPrefetch: o2 } = Oa({ prefetchFn: Sa(cu.all, du) }), { mutate: a2 } = Bu();
|
|
2161
|
-
return S(il, { placement: "bottom-start", children: [k(sl, { children: (e3) => k(Hd, { ...e3, onMouseEnter: n2, onMouseLeave: o2, children: k(lo, { children: Wd(t2, r2) }) }) }), k(Ou, { onClick: fi(e2.id, bi.TRANSACTION_LINE_ITEM) || fi(e2.id, bi.PROCESSOR_TRANSACTION) ? (t3) => {
|
|
2162
|
-
if (t3?.id) {
|
|
2163
|
-
const { parentId: r3, parentsChildren: n3, ...o3 } = e2, i2 = n3.map((r4) => r4.id === e2.id ? { ...o3, glAccountId: t3.id.toString() } : r4);
|
|
2164
|
-
a2({ id: r3, children: i2 });
|
|
2165
|
-
}
|
|
2166
|
-
} : (t3) => {
|
|
2167
|
-
a2({ id: e2.id, glAccountId: t3.id });
|
|
2168
|
-
}, types: iu })] });
|
|
2169
|
-
}
|
|
2170
|
-
const zu = { all: () => ["transactions", "expenseCategories"] }, Vu = async (e2) => {
|
|
2171
|
-
const t2 = e2.queryKey, r2 = { path: "/expenses/categories", accessToken: t2[2].accessToken, environment: t2[2].environment }, n2 = await Na(r2);
|
|
2172
|
-
return { ...n2, data: n2.data ? (o2 = n2.data, o2.map((e3) => ({ ...e3, id: `${bi.TRANSACTION_CATEGORY}_${e3.id}`, parentCategoryId: e3.parentCategoryId ? `${bi.TRANSACTION_CATEGORY}_${e3.parentCategoryId}` : void 0 }))) : void 0 };
|
|
2173
|
-
var o2;
|
|
2174
|
-
};
|
|
2175
|
-
function ju(e2) {
|
|
2176
|
-
return br({ ...e2, queryKey: zu.all(), queryFn: Vu });
|
|
2177
|
-
}
|
|
2178
|
-
function qu(e2) {
|
|
2179
|
-
const t2 = /* @__PURE__ */ new Map();
|
|
2180
|
-
for (const r2 of e2) if (r2.parentCategoryId) {
|
|
2181
|
-
const e3 = t2.get(r2.parentCategoryId) ?? [];
|
|
2182
|
-
e3.push(r2), t2.set(r2.parentCategoryId, e3);
|
|
2183
|
-
}
|
|
2184
|
-
return t2;
|
|
2185
|
-
}
|
|
2186
|
-
function Uu(e2) {
|
|
2187
|
-
if (0 === e2.length) return [];
|
|
2188
|
-
const t2 = qu(e2);
|
|
2189
|
-
return e2.map((e3) => ({ ...e3, children: e3.id ? t2.get(e3.id) : void 0 }));
|
|
2190
|
-
}
|
|
2191
|
-
function Ku(e2) {
|
|
2192
|
-
if (0 === e2.length) return [];
|
|
2193
|
-
const t2 = qu(e2);
|
|
2194
|
-
return e2.filter((e3) => !e3.parentCategoryId).map((e3) => ({ ...e3, children: e3.id ? t2.get(e3.id) : void 0 }));
|
|
2195
|
-
}
|
|
2196
|
-
const $u = (e2) => ({ id: e2.id, name: e2.name }), Yu = At(null, ft({ whiteSpace: "normal" })), Gu = [At(null, ft({ marginLeft: "6px", marginRight: "6px" }))], Qu = { keys: [{ name: "name" }], threshold: 0.2, includeScore: true, minMatchCharLength: 1 };
|
|
2197
|
-
function Xu(e2, t2, r2) {
|
|
2198
|
-
(function(e3, t3) {
|
|
2199
|
-
return t3.some((t4) => t4.child.id === e3.id);
|
|
2200
|
-
})(t2, r2) || r2.push({ parent: e2, child: t2 });
|
|
2201
|
-
}
|
|
2202
|
-
function Zu(e2, t2) {
|
|
2203
|
-
const r2 = [];
|
|
2204
|
-
return e2.forEach((e3) => {
|
|
2205
|
-
const n2 = e3.item, o2 = function(e4, t3) {
|
|
2206
|
-
return t3.find((t4) => t4.children?.some((t5) => t5.id === e4.id));
|
|
2207
|
-
}(n2, t2), a2 = !(o2 || 0 !== n2?.children?.length && n2.children), i2 = !o2 && n2.children && n2.children.length > 0;
|
|
2208
|
-
o2 ? Xu(o2, n2, r2) : a2 ? Xu(n2, n2, r2) : i2 && function(e4, t3) {
|
|
2209
|
-
e4.children && e4.children.forEach((r3) => {
|
|
2210
|
-
Xu(e4, r3, t3);
|
|
2211
|
-
});
|
|
2212
|
-
}(n2, r2);
|
|
2213
|
-
}), r2;
|
|
2214
|
-
}
|
|
2215
|
-
function Ju({ searchTerm: e2, onClick: t2 }) {
|
|
2216
|
-
const { query: { data: r2, isFetched: n2 }, isFilling: o2 } = ju({ select: (e3) => ({ ...e3, data: e3.data ? Uu(e3.data) : void 0 }) }), a2 = r2?.data, i2 = !o2 && n2 && (void 0 === a2 || 0 === a2.length), l2 = u(() => new ve(a2 ?? [], Qu), [a2]), s2 = u(() => {
|
|
2217
|
-
if (!a2) return [];
|
|
2218
|
-
return Zu(l2.search(e2), a2);
|
|
2219
|
-
}, [a2, e2, l2]);
|
|
2220
|
-
return o2 ? k(au, {}) : i2 ? k(nu, { text: "No data" }) : 0 === s2.length ? k(nu, { text: "No results found" }) : k(C, { children: s2.map(({ parent: e3, child: r3 }) => {
|
|
2221
|
-
const n3 = e3.id === r3.id;
|
|
2222
|
-
return k(eu, { onClick: () => t2($u(r3)), children: k(ru, { stylists: [Yu], children: n3 ? r3.name : S(C, { children: [e3.name, k(ga, { Component: la, stylists: Gu }), r3.name] }) }) }, `${e3.id}_${r3.id}`);
|
|
2223
|
-
}) });
|
|
2224
|
-
}
|
|
2225
|
-
const eh = At(null, ft({ whiteSpace: "normal" }));
|
|
2226
|
-
function th({ category: e2, handleCategoryChange: t2 }) {
|
|
2227
|
-
return k(Xd, { children: e2.children?.map((e3) => k(eu, { onClick: () => t2($u(e3)), children: k(lo, { stylists: [eh], children: e3.name }) }, e3.id)) });
|
|
2228
|
-
}
|
|
2229
|
-
function rh({ onClick: e2 }) {
|
|
2230
|
-
const { query: { data: t2, isFetched: r2 }, isFilling: n2 } = ju({ select: (e3) => ({ ...e3, data: e3.data ? Ku(e3.data) : void 0 }) }), o2 = t2?.data, a2 = !n2 && r2 && void 0 === o2;
|
|
2231
|
-
return n2 ? k(au, {}) : a2 ? k(nu, { text: "No data" }) : k(C, { children: o2?.map((t3) => t3.hasChilds ? k(Su, { triggerChildren: k(Pu, { displayLabel: t3.name }), popupChildren: k(th, { category: t3, handleCategoryChange: e2 }) }, t3.id) : k(eu, { onClick: () => e2($u(t3)), children: k(lo, { stylists: [eh], children: t3.name }) }, t3?.id)) });
|
|
2232
|
-
}
|
|
2233
|
-
const nh = ({ onClick: e2 }) => {
|
|
2234
|
-
const t2 = ll(), [r2, n2] = v(""), o2 = (r3) => {
|
|
2235
|
-
void 0 !== e2 && e2(r3), t2.setOpen(false);
|
|
2236
|
-
};
|
|
2237
|
-
return k(fl, { children: S(Xd, { children: [k(Nu, { searchTerm: r2, setSearchTerm: n2, placeholder: "Search expense categories..." }), cr(r2) ? k(Ju, { searchTerm: r2, onClick: o2 }) : k(rh, { onClick: o2 })] }) });
|
|
2238
|
-
}, oh = aa((e2) => c.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e2 }, c.createElement("path", { d: "M12.6809 12.4781H12.0645L6.49121 9.38327V4.42636L12.0645 1.33154H12.6809V12.4781Z", stroke: "#182428", strokeMiterlimit: 10 }), c.createElement("path", { d: "M4.01263 4.42627H6.49108V9.38317H4.01263C3.35531 9.38317 2.7249 9.12205 2.2601 8.65725C1.7953 8.19245 1.53418 7.56205 1.53418 6.90472C1.53418 6.2474 1.7953 5.61699 2.2601 5.15219C2.7249 4.68739 3.35531 4.42627 4.01263 4.42627Z", stroke: "#182428", strokeMiterlimit: 10 }), c.createElement("path", { d: "M4.0127 9.3833H6.49115L7.72389 14.9566H5.25192L4.0127 9.3833Z", stroke: "#182428", strokeMiterlimit: 10 }), c.createElement("path", { d: "M12.6807 5.66553H13.9199C14.2486 5.66553 14.5638 5.79609 14.7962 6.02849C15.0286 6.26089 15.1591 6.57609 15.1591 6.90475C15.1591 7.06749 15.1271 7.22864 15.0648 7.37898C15.0025 7.52933 14.9112 7.66595 14.7962 7.78102C14.6811 7.89609 14.5445 7.98737 14.3941 8.04965C14.2438 8.11193 14.0826 8.14398 13.9199 8.14398H12.6807V5.66553Z", stroke: "#182428", strokeMiterlimit: 10 })), "Advertising"), ah = aa((e2) => c.createElement("svg", { width: "16px", height: "16px", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e2 }, c.createElement("path", { d: "M7.84644 15.0764C11.6751 15.0764 14.7788 11.9727 14.7788 8.14405C14.7788 4.3154 11.6751 1.21167 7.84644 1.21167C4.0178 1.21167 0.914062 4.3154 0.914062 8.14405C0.914062 11.9727 4.0178 15.0764 7.84644 15.0764Z", stroke: "#182428", strokeMiterlimit: 10 }), c.createElement("path", { d: "M7.79217 9.6784V8.95116C7.79192 8.79114 7.82335 8.63265 7.88467 8.48484C7.94598 8.33703 8.03596 8.20282 8.14941 8.08996L8.65337 7.586C8.88132 7.35726 9.00972 7.04774 9.01061 6.7248V6.61636C9.00892 6.29431 8.8798 5.98603 8.65149 5.75891C8.42317 5.53179 8.11422 5.40429 7.79217 5.4043C7.47012 5.40429 7.16117 5.53179 6.93285 5.75891C6.70453 5.98603 6.57542 6.29431 6.57373 6.61636", stroke: "#182428", strokeMiterlimit: 10 }), c.createElement("path", { d: "M7.18604 10.8838H8.39809", stroke: "#182428", strokeMiterlimit: 10 })), "Uncategorized"), ih = aa((e2) => c.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e2 }, c.createElement("path", { d: "M7.71472 0.800293V4.79785C7.71535 5.25195 7.58889 5.69716 7.34964 6.08313C7.11039 6.46909 6.7679 6.78039 6.36091 6.98182C6.02094 7.15207 5.64596 7.24072 5.26574 7.24072C4.88552 7.24072 4.51053 7.15207 4.17056 6.98182C3.76928 6.77569 3.43283 6.4626 3.19841 6.07716C2.964 5.69173 2.84075 5.24897 2.8423 4.79785V0.800293", stroke: "#182428", strokeMiterlimit: 10 }), c.createElement("path", { d: "M5.29443 0.800293V15.4878", stroke: "#182428", strokeMiterlimit: 10 }), c.createElement("path", { d: "M10.1861 15.4879V1.43896C10.668 1.43896 11.1451 1.53399 11.5903 1.71859C12.0354 1.9032 12.4398 2.17377 12.7802 2.51482C13.1207 2.85587 13.3905 3.2607 13.5744 3.70616C13.7582 4.15161 13.8524 4.62894 13.8516 5.11084V8.78271L10.1797 10.6155", stroke: "#182428", strokeMiterlimit: 10 })), "Meals"), lh = aa((e2) => c.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e2 }, c.createElement("path", { d: "M14.9092 4.60259V6.39635H1.78418V4.60259L8.34669 1.62134L14.9092 4.60259Z", strokeMiterlimit: 10, strokeLinecap: "square" }), c.createElement("path", { d: "M14.9092 12.3589H1.78418V14.7464H14.9092V12.3589Z", strokeMiterlimit: 10, strokeLinecap: "square" }), c.createElement("path", { d: "M2.97803 6.39648V12.359", strokeMiterlimit: 10, strokeLinecap: "square" }), c.createElement("path", { d: "M6.55908 6.39648V12.359", strokeMiterlimit: 10, strokeLinecap: "square" }), c.createElement("path", { d: "M10.1343 6.39648V12.359", strokeMiterlimit: 10, strokeLinecap: "square" }), c.createElement("path", { d: "M13.7153 6.39648V12.359", strokeMiterlimit: 10, strokeLinecap: "square" })), "Bank"), sh = aa((e2) => c.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e2 }, c.createElement("path", { d: "M13.7665 10.8572H2.9268C2.60718 10.8572 2.30065 10.7302 2.07465 10.5042C1.84865 10.2782 1.72168 9.9717 1.72168 9.65208V4.97673C1.72168 4.87842 1.74114 4.78109 1.77895 4.69035C1.81676 4.5996 1.87217 4.51725 1.94197 4.44803C2.01178 4.37881 2.0946 4.3241 2.18566 4.28706C2.27672 4.25001 2.37421 4.23137 2.47251 4.2322C2.598 4.23423 2.7211 4.2669 2.83107 4.32739C2.94104 4.38787 3.03455 4.47433 3.10346 4.57923C4.03096 5.93577 7.14155 5.34899 7.14155 4.2322L13.3312 7.08411C13.8209 7.31135 14.2355 7.67379 14.5261 8.12874C14.8167 8.5837 14.9713 9.11222 14.9717 9.65208C14.9717 9.9717 14.8447 10.2782 14.6187 10.5042C14.3927 10.7302 14.0862 10.8572 13.7665 10.8572Z", stroke: "#182428", strokeMiterlimit: 10 }), c.createElement("path", { d: "M14.9717 9.6521V10.8572C14.97 11.4954 14.7153 12.1068 14.2635 12.5574C13.8117 13.0081 13.1996 13.2611 12.5614 13.2611H2.92681C2.76832 13.262 2.61124 13.2314 2.46465 13.1711C2.31806 13.1108 2.18487 13.0221 2.0728 12.91C1.96073 12.798 1.87199 12.6648 1.81173 12.5182C1.75146 12.3716 1.72086 12.2145 1.7217 12.056V9.6521", stroke: "#182428", strokeMiterlimit: 10 }), c.createElement("path", { d: "M6.54199 3.0271L7.1414 4.23222", stroke: "#182428", strokeMiterlimit: 10 }), c.createElement("path", { d: "M8.34668 7.24174L9.5518 5.43091", stroke: "#182428", strokeMiterlimit: 10 }), c.createElement("path", { d: "M10.1514 8.44706L11.3565 6.63623", stroke: "#182428", strokeMiterlimit: 10 })), "Sports"), ch = aa((e2) => c.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e2 }, c.createElement("path", { d: "M2.64551 15.0589V13.3516", stroke: "#182428", strokeMiterlimit: 10 }), c.createElement("path", { d: "M14.6148 10.5042H2.07861V13.3517H14.6148V10.5042Z", stroke: "#182428", strokeMiterlimit: 10 }), c.createElement("path", { d: "M5.07515 7.62671H11.6417C12.2861 7.62671 12.9041 7.88269 13.3598 8.33833C13.8154 8.79398 14.0714 9.41197 14.0714 10.0563V10.4742H2.64551V10.0563C2.64551 9.41197 2.90149 8.79398 3.35713 8.33833C3.81278 7.88269 4.43077 7.62671 5.07515 7.62671Z", stroke: "#182428", strokeMiterlimit: 10 }), c.createElement("path", { d: "M5.49942 5.37623H6.63962C6.86383 5.37623 7.08584 5.42039 7.29298 5.50619C7.50012 5.59199 7.68833 5.71775 7.84687 5.87629C8.00541 6.03483 8.13117 6.22304 8.21697 6.43018C8.30277 6.63733 8.34693 6.85934 8.34693 7.08355V7.68051H3.78613V7.08355C3.78613 6.85884 3.83049 6.63633 3.91666 6.4288C4.00284 6.22127 4.12913 6.03279 4.2883 5.87418C4.44747 5.71556 4.63639 5.58992 4.84422 5.50448C5.05205 5.41903 5.27471 5.37545 5.49942 5.37623Z", stroke: "#182428", strokeMiterlimit: 10 }), c.createElement("path", { d: "M10.054 5.37622H11.1942C11.647 5.37622 12.0813 5.5561 12.4014 5.87628C12.7216 6.19647 12.9015 6.63073 12.9015 7.08354V7.6805H8.34668V7.08354C8.34668 6.63073 8.52656 6.19647 8.84674 5.87628C9.16692 5.5561 9.60119 5.37622 10.054 5.37622Z", stroke: "#182428", strokeMiterlimit: 10 }), c.createElement("path", { d: "M12.9018 3.0957H3.78613V7.6565H12.9018V3.0957Z", stroke: "#182428", strokeMiterlimit: 10 }), c.createElement("path", { d: "M14.0479 15.0589V13.3516", stroke: "#182428", strokeMiterlimit: 10 }), c.createElement("path", { d: "M3.78613 1.38843V3.09574", stroke: "#182428", strokeMiterlimit: 10 }), c.createElement("path", { d: "M12.9077 1.38843V3.09574", stroke: "#182428", strokeMiterlimit: 10 })), "Bedding"), dh = aa((e2) => c.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e2 }, c.createElement("path", { d: "M3.58312 11.8285C3.40778 11.6564 3.29681 11.4294 3.26874 11.1854C3.24068 10.9414 3.29723 10.6951 3.42894 10.4878L6.01648 6.34502L10.8698 1.4917C11.2763 1.0884 11.8256 0.861929 12.3982 0.861572C12.6808 0.861572 12.9606 0.917231 13.2217 1.02537C13.4827 1.13351 13.7199 1.29201 13.9198 1.49183C14.1196 1.69164 14.2781 1.92885 14.3862 2.18992C14.4944 2.451 14.55 2.73081 14.55 3.01339C14.5497 3.586 14.3232 4.1353 13.9199 4.54178L9.06657 9.3951L4.92381 11.9826C4.71647 12.1144 4.47021 12.1709 4.22618 12.1428C3.98215 12.1148 3.75515 12.0038 3.58312 11.8285Z", stroke: "#182428", strokeMiterlimit: 10 }), c.createElement("path", { d: "M12.1101 6.34497L9.67676 8.78504L12.7201 14.2685L14.5502 13.0485L12.1101 6.34497Z", stroke: "#182428", strokeMiterlimit: 10 }), c.createElement("path", { d: "M9.06658 3.30164L6.62651 5.735L1.14307 2.69162L2.3631 0.861572L9.06658 3.30164Z", stroke: "#182428", strokeMiterlimit: 10 }), c.createElement("path", { d: "M4.49481 8.78516H1.75308L1.14307 10.6152L3.58313 11.8285L4.80317 14.2686L6.62651 13.6586V10.9169", stroke: "#182428", strokeMiterlimit: 10 })), "Airplane"), uh = aa((e2) => c.createElement("svg", { width: 15, height: 11, viewBox: "0 0 15 11", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e2 }, c.createElement("path", { d: "M8.58591 0.969731H4.86823C4.67602 0.970222 4.4865 1.01495 4.31436 1.10046C4.14222 1.18597 3.99207 1.30996 3.87555 1.46283L2.38978 3.44818L0.53418 4.06455V8.3986H2.38978C2.38978 8.06994 2.52034 7.75473 2.75274 7.52233C2.98514 7.28993 3.30034 7.15937 3.629 7.15937C3.95766 7.15937 4.27287 7.28993 4.50527 7.52233C4.73767 7.75473 4.86823 8.06994 4.86823 8.3986H9.20228C9.20228 8.06994 9.33284 7.75473 9.56524 7.52233C9.79764 7.28993 10.1128 7.15937 10.4415 7.15937C10.7702 7.15937 11.0854 7.28993 11.3178 7.52233C11.5502 7.75473 11.6807 8.06994 11.6807 8.3986H14.1592V5.52437C14.1588 5.27713 14.0844 5.03565 13.9457 4.831C13.8069 4.62636 13.6101 4.46789 13.3806 4.37598L11.0644 3.44818L9.57858 1.46283C9.46275 1.30922 9.31275 1.18469 9.14045 1.09911C8.96815 1.01352 8.77829 0.969227 8.58591 0.969731Z", stroke: "#182428", strokeMiterlimit: 10 }), c.createElement("path", { d: "M10.4414 9.63788C11.1258 9.63788 11.6806 9.08306 11.6806 8.39865C11.6806 7.71424 11.1258 7.15942 10.4414 7.15942C9.75697 7.15942 9.20215 7.71424 9.20215 8.39865C9.20215 9.08306 9.75697 9.63788 10.4414 9.63788Z", stroke: "#182428", strokeMiterlimit: 10 }), c.createElement("path", { d: "M3.62887 9.63788C4.31328 9.63788 4.8681 9.08306 4.8681 8.39865C4.8681 7.71424 4.31328 7.15942 3.62887 7.15942C2.94447 7.15942 2.38965 7.71424 2.38965 8.39865C2.38965 9.08306 2.94447 9.63788 3.62887 9.63788Z", stroke: "#182428", strokeMiterlimit: 10 }), c.createElement("path", { d: "M12.6021 4.06445H4.25195", stroke: "#182428", strokeMiterlimit: 10 }), c.createElement("path", { d: "M12.9199 6.54297H14.1591", stroke: "#182428", strokeMiterlimit: 10 }), c.createElement("path", { d: "M7.34668 2.20898V4.06458", stroke: "#182428", strokeMiterlimit: 10 })), "Vehicle");
|
|
2239
|
-
function hh(e2) {
|
|
2240
|
-
switch (e2) {
|
|
2241
|
-
case "Advertising":
|
|
2242
|
-
case "Advertising and Marketing":
|
|
2243
|
-
return oh;
|
|
2244
|
-
case "Bank Fees":
|
|
2245
|
-
case "Bank Charges & Fees":
|
|
2246
|
-
case "College Loans":
|
|
2247
|
-
case "Merchant Processing Fees":
|
|
2248
|
-
return lh;
|
|
2249
|
-
case "Health & Fitness":
|
|
2250
|
-
case "Sports":
|
|
2251
|
-
case "Sporting Goods":
|
|
2252
|
-
return sh;
|
|
2253
|
-
case "Linen/Key Service":
|
|
2254
|
-
case "Linens (sheets, towels, etc.)":
|
|
2255
|
-
case "Hotel":
|
|
2256
|
-
case "Hotels":
|
|
2257
|
-
return ch;
|
|
2258
|
-
case "Plane / Train / Bus":
|
|
2259
|
-
case "Airlines":
|
|
2260
|
-
case "Airfare":
|
|
2261
|
-
return dh;
|
|
2262
|
-
case "Vehicle":
|
|
2263
|
-
case "Taxi":
|
|
2264
|
-
case "Rental Car":
|
|
2265
|
-
case "Rental Cars":
|
|
2266
|
-
case "Car Payment":
|
|
2267
|
-
case "Auto Insurance":
|
|
2268
|
-
case "Other Vehicle Expenses":
|
|
2269
|
-
case "Parking and Tolls":
|
|
2270
|
-
case "Parking & Tolls":
|
|
2271
|
-
case "Transportation (Taxi, Rideshare, Train)":
|
|
2272
|
-
return uh;
|
|
2273
|
-
case "Meals & Entertainment":
|
|
2274
|
-
case "Meals":
|
|
2275
|
-
case "Business Meals":
|
|
2276
|
-
case "Food & Dining":
|
|
2277
|
-
case "Groceries":
|
|
2278
|
-
case "Restaurants":
|
|
2279
|
-
case "Other Food & Dining":
|
|
2280
|
-
case "Lead Gen - Meals":
|
|
2281
|
-
case "PAX Food & Drink":
|
|
2282
|
-
return ih;
|
|
2283
|
-
default:
|
|
2284
|
-
return ah;
|
|
2285
|
-
}
|
|
2286
|
-
}
|
|
2287
|
-
function gh({ transaction: e2 }) {
|
|
2288
|
-
const { startPrefetch: t2, cancelPrefetch: r2 } = Oa({ prefetchFn: Sa(zu.all, Vu) }), n2 = e2.category?.name ?? "Uncategorized", { mutate: o2 } = Bu();
|
|
2289
|
-
return S(il, { placement: "bottom-start", children: [k(sl, { children: (e3) => S(Hd, { ...e3, onMouseEnter: t2, onMouseLeave: r2, children: [k(gc, { Component: hh(n2) }), k(lo, { children: n2 })] }) }), k(nh, { onClick: fi(e2.id, bi.TRANSACTION_LINE_ITEM) ? (t3) => {
|
|
2290
|
-
if (t3?.id) {
|
|
2291
|
-
const { parentId: r3, parentsChildren: n3, ...a2 } = e2, i2 = n3.map((r4) => r4.id === e2.id ? { ...a2, categoryId: t3.id.toString() } : r4);
|
|
2292
|
-
o2({ id: r3, children: i2 });
|
|
2293
|
-
}
|
|
2294
|
-
} : (t3) => {
|
|
2295
|
-
t3?.id && o2({ id: e2.id, categoryId: t3.id.toString() });
|
|
2296
|
-
} })] });
|
|
2297
|
-
}
|
|
2298
|
-
const ph = aa((e2) => c.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e2 }, c.createElement("path", { d: "M4.31676 1.37476L1.67926 4.01226L4.31676 6.64976", stroke: "#182428", strokeMiterlimit: 10 }), c.createElement("path", { d: "M12.2292 6.64976L14.8667 4.01226L12.2292 1.37476", stroke: "#182428", strokeMiterlimit: 10 }), c.createElement("path", { d: "M8.27301 14.5623V7.96852C8.27301 6.91926 7.85619 5.91297 7.11425 5.17103C6.37231 4.42909 5.36602 4.01227 4.31676 4.01227H1.67926", stroke: "#182428", strokeMiterlimit: 10 }), c.createElement("path", { d: "M8.27301 14.5623V7.96852C8.27301 6.91926 8.68983 5.91297 9.43177 5.17103C10.1737 4.42909 11.18 4.01227 12.2293 4.01227H14.8668", stroke: "#182428", strokeMiterlimit: 10 })), "Split"), vh = At(null, ft({ flexDirection: "column", textAlign: "start", width: "100%", overflow: "hidden" })), mh = At(null, ft({ display: "flex", flexDirection: "row", alignItems: "center", justifyContent: "center", width: "100%", gap: "10px" }));
|
|
2299
|
-
function bh({ transaction: e2 }) {
|
|
2300
|
-
const t2 = e2.children.map((e3) => e3?.category?.name).filter((e3) => void 0 !== e3), r2 = new Set(t2), n2 = [...r2].join(", "), o2 = kc("Category", "Categories", r2.size, true);
|
|
2301
|
-
return k(Gi, { children: S("div", { ...mh, children: [k(gc, { Component: ph }), S("div", { ...vh, children: [k(lo, { children: o2 }), k(co, { children: n2 })] })] }) });
|
|
2302
|
-
}
|
|
2303
|
-
function fh({ transaction: e2 }) {
|
|
2304
|
-
return e2.children?.length > 0 ? k(bh, { transaction: e2 }) : k(gh, { transaction: e2 });
|
|
2305
|
-
}
|
|
2306
|
-
const yh = 4;
|
|
2307
|
-
function Th(e2) {
|
|
2308
|
-
const t2 = Math.max(yh - e2.length, 0);
|
|
2309
|
-
return `*${e2 + "*".repeat(t2)}`;
|
|
2310
|
-
}
|
|
2311
|
-
function xh(e2, t2) {
|
|
2312
|
-
return t2 ? `${e2} ${Th(t2)}` : e2 ?? "";
|
|
2313
|
-
}
|
|
2314
|
-
const wh = (e2) => e2 > 0 ? "Deposited to" : "Withdrawn from", kh = (e2, t2) => {
|
|
2315
|
-
const r2 = "BANK_TRANSFER" === t2.type, n2 = wh(t2.amount);
|
|
2316
|
-
return `${r2 ? `${n2} ` : ""}${xh(e2.apiAccountName, e2.apiAccountNo)}`;
|
|
2317
|
-
}, Ch = (e2, t2) => {
|
|
2318
|
-
const r2 = /* @__PURE__ */ new Map();
|
|
2319
|
-
return e2.forEach((e3) => r2.set(e3.id, { ...e3, plaidItemAccounts: [] })), t2.forEach((e3) => {
|
|
2320
|
-
r2.get(e3.integrationId)?.plaidItemAccounts.push(e3);
|
|
2321
|
-
}), [...r2.values()];
|
|
2322
|
-
};
|
|
2323
|
-
function Sh({ transaction: e2 }) {
|
|
2324
|
-
switch (e2.type) {
|
|
2325
|
-
case "EXPENSE":
|
|
2326
|
-
return k(fh, { transaction: e2 });
|
|
2327
|
-
case "BANK_TRANSFER":
|
|
2328
|
-
return k(Fd, { annotation: wh(e2.amount), accountName: e2.bankAccount?.name });
|
|
2329
|
-
default:
|
|
2330
|
-
return k(Hu, { transaction: e2, accountNo: e2.glAccount?.accountNo, accountName: e2.glAccount?.name });
|
|
2331
|
-
}
|
|
2332
|
-
}
|
|
2333
|
-
function Eh({ name: e2 }) {
|
|
2334
|
-
return k(C, { children: e2 && k(qi, { children: e2 }) });
|
|
2335
|
-
}
|
|
2336
|
-
const Ih = "USER_REVIEW_REQUIRED", Ph = "ACCOUNTANT_REVIEW_REQUIRED", Ah = aa((e2) => c.createElement("svg", { width: 13, height: 15, viewBox: "0 0 13 15", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e2 }, c.createElement("path", { d: "M0.743464 14.9687V0.96875H11.6465L9.22218 4.59886L11.6465 8.24166H0.743464", stroke: "#182428", strokeMiterlimit: 10 })), "Flag"), Dh = aa((e2) => c.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e2 }, c.createElement("path", { d: "M8.54708 2.09833H8.37602C8.21004 2.09808 8.04676 2.14026 7.90167 2.22087C7.75657 2.30147 7.6345 2.41783 7.54702 2.55888L1.70458 11.9081C1.60602 12.0636 1.55355 12.2438 1.55325 12.4279C1.55324 12.5569 1.57886 12.6846 1.62861 12.8036C1.67837 12.9226 1.75127 13.0305 1.84309 13.1211C1.93491 13.2117 2.04381 13.2832 2.16348 13.3313C2.28314 13.3795 2.41118 13.4034 2.54015 13.4016H14.3829C14.6412 13.4016 14.8889 13.299 15.0715 13.1164C15.2541 12.9338 15.3567 12.6861 15.3567 12.4279C15.3564 12.2438 15.3039 12.0636 15.2054 11.9081L9.37608 2.55888C9.2886 2.41783 9.16652 2.30147 9.02143 2.22087C8.87634 2.14026 8.71306 2.09808 8.54708 2.09833Z", stroke: "#182428", strokeMiterlimit: 10 }), c.createElement("path", { d: "M8.46158 5.23663V9.00659", stroke: "#182428", strokeMiterlimit: 10 }), c.createElement("path", { d: "M8.46158 10.2632V11.5199", stroke: "#182428", strokeMiterlimit: 10 })), "Attention"), Mh = aa((e2) => c.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e2 }, c.createElement("path", { d: "M8.32497 15.1744C12.1492 15.1744 15.2494 12.0742 15.2494 8.24998C15.2494 4.42573 12.1492 1.32556 8.32497 1.32556C4.50071 1.32556 1.40054 4.42573 1.40054 8.24998C1.40054 12.0742 4.50071 15.1744 8.32497 15.1744Z", stroke: "#182428", strokeMiterlimit: 10 }), c.createElement("path", { d: "M4.54623 8.25001L7.06541 10.7692L12.1037 5.73083", stroke: "#182428", strokeMiterlimit: 10 })), "CircleCheck"), Nh = aa((e2) => c.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e2 }, c.createElement("path", { d: "M7.81985 0.464722V3.49919", stroke: "black", strokeMiterlimit: 10 }), c.createElement("path", { d: "M7.81985 12.0008V15.0353", stroke: "black", strokeMiterlimit: 10 }), c.createElement("path", { d: "M15.1051 7.75H12.0706", stroke: "black", strokeMiterlimit: 10 }), c.createElement("path", { d: "M3.56907 7.75H0.534607", stroke: "black", strokeMiterlimit: 10 }), c.createElement("path", { d: "M12.9702 2.59967L10.8227 4.74724", stroke: "black", strokeMiterlimit: 10 }), c.createElement("path", { d: "M4.81706 10.7528L2.66949 12.9004", stroke: "black", strokeMiterlimit: 10 }), c.createElement("path", { d: "M12.9702 12.9004L10.8227 10.7528", stroke: "black", strokeMiterlimit: 10 }), c.createElement("path", { d: "M4.81706 4.74724L2.66949 2.59967", stroke: "black", strokeMiterlimit: 10 })), "Processing"), Rh = ft({ maxWidth: "100%", width: "fit-content", display: "inline-flex", padding: "4px 5px", justifyContent: "center", alignItems: "center", gap: "5px", borderRadius: "sm", border: "{borderWidths.md} solid", borderColor: "border.layout", background: "surface.background", cursor: "pointer", "&:focus": { outline: "none" }, "&[data-state='closed']": {}, "& .Tight-sub-label": { color: "typography.base" }, "& .Tight-medium-icon > path": { stroke: "icon.base" } }), Oh = ft({ background: "surface.intent.secondary", border: "{borderWidths.sm} solid", borderColor: "border.intent.secondary", "& .Tight-sub-label": { color: "typography.intent.secondary" }, "& .Tight-medium-icon > path": { stroke: "icon.intent.secondary" }, _supportHover: { background: "surface.intent.secondary.hover", borderColor: "border.intent.secondary.hover", "& .Tight-sub-label": { color: "typography.intent.secondary.hover" }, "& .Tight-medium-icon > path": { stroke: "icon.intent.secondary.hover" } }, "&:focus-visible, &[data-state='open']": { background: "surface.intent.secondary.hover", borderColor: "border.intent.secondary.hover", "& .Tight-sub-label": { color: "typography.intent.secondary.hover" }, "& .Tight-medium-icon > path": { stroke: "icon.intent.secondary.hover" } } }), _h = ft({ borderRadius: "sm", border: "{borderWidths.md} solid", borderColor: "border.intent.action", background: "surface.intent.action", "& .Tight-sub-label": { color: "typography.intent.action" }, "& .Tight-medium-icon > path": { stroke: "icon.intent.action" }, _supportHover: { background: "surface.intent.action.hover", borderColor: "border.intent.action.hover", "& .Tight-sub-label": { color: "typography.intent.action.hover" }, "& .Tight-medium-icon > path": { stroke: "icon.intent.action.hover" } }, "&:focus-visible, &[data-state='open']": { background: "surface.intent.action.hover", borderColor: "border.intent.action.hover", "& .Tight-sub-label": { color: "typography.intent.action.hover" }, "& .Tight-medium-icon > path": { stroke: "icon.intent.action.hover" } } }), Lh = ft({ borderRadius: "sm", border: "{borderWidths.md} solid", borderColor: "border.intent.success", background: "surface.intent.success", "& .Tight-sub-label": { color: "typography.intent.success" }, "& .Tight-medium-icon > path": { stroke: "icon.intent.success" }, _supportHover: { background: "surface.intent.success.hover", borderColor: "border.intent.success.hover", "& .Tight-sub-label": { color: "typography.intent.success.hover" }, "& .Tight-medium-icon > path": { stroke: "icon.intent.success.hover" } }, "&:focus-visible, &[data-state='open']": { background: "surface.intent.success.hover", borderColor: "border.intent.success.hover", "& .Tight-sub-label": { color: "typography.intent.success.hover" }, "& .Tight-medium-icon > path": { stroke: "icon.intent.success.hover" } } }), Fh = ft({ background: "surface.intent.warning", border: "{borderWidths.sm} solid", borderColor: "border.intent.warning", "& .Tight-sub-label": { color: "typography.intent.warning" }, "& .Tight-medium-icon > path": { stroke: "icon.intent.warning" }, _supportHover: { background: "surface.intent.warning.hover", borderColor: "border.intent.warning.hover", "& .Tight-sub-label": { color: "typography.intent.warning.hover" }, "& .Tight-medium-icon > path": { stroke: "icon.intent.warning.hover" } }, "&:focus-visible, &[data-state='open']": { background: "surface.intent.warning.hover", borderColor: "border.intent.warning.hover", "& .Tight-sub-label": { color: "typography.intent.warning.hover" }, "& .Tight-medium-icon > path": { stroke: "icon.intent.warning.hover" } } }), Wh = ft({ background: "surface.intent.danger", border: "{borderWidths.sm} solid", borderColor: "border.intent.danger", "& .Tight-sub-label": { color: "typography.intent.danger" }, "& .Tight-medium-icon > path": { stroke: "icon.intent.danger" }, _supportHover: { background: "surface.intent.danger.hover", borderColor: "border.intent.danger.hover", "& .Tight-sub-label": { color: "typography.intent.danger.hover" }, "& .Tight-medium-icon > path": { stroke: "icon.intent.danger.hover" } }, "&:focus-visible, &[data-state='open']": { background: "surface.intent.danger.hover", borderColor: "border.intent.danger.hover", "& .Tight-sub-label": { color: "typography.intent.danger.hover" }, "& .Tight-medium-icon > path": { stroke: "icon.intent.danger.hover" } } }), Bh = At(kt.badge, Rh), Hh = At(null, zn), zh = At(null, ca), Vh = At(kt["neutral-badge"], Oh), jh = At(kt["highlight-badge"], _h), qh = At(kt["success-badge"], Lh), Uh = At(kt["warning-badge"], Fh), Kh = At(kt["critical-badge"], Wh);
|
|
2337
|
-
function $h({ type: e2, children: t2, onClick: r2, popupTriggerProps: n2 }) {
|
|
2338
|
-
let o2;
|
|
2339
|
-
switch (e2) {
|
|
2340
|
-
case "critical":
|
|
2341
|
-
o2 = Kh;
|
|
2342
|
-
break;
|
|
2343
|
-
case "warning":
|
|
2344
|
-
o2 = Uh;
|
|
2345
|
-
break;
|
|
2346
|
-
case "neutral":
|
|
2347
|
-
o2 = Vh;
|
|
2348
|
-
break;
|
|
2349
|
-
case "success":
|
|
2350
|
-
o2 = qh;
|
|
2351
|
-
break;
|
|
2352
|
-
case "highlight":
|
|
2353
|
-
o2 = jh;
|
|
2354
|
-
}
|
|
2355
|
-
const a2 = Ot([Bh, Hh, o2, zh]);
|
|
2356
|
-
return k("button", { ...a2, onClick: r2, ...n2, children: t2 });
|
|
2357
|
-
}
|
|
2358
|
-
const Yh = [{ status: "USER_REVIEW_REQUIRED", displayName: "Needs my Review" }, { status: "ACCOUNTANT_REVIEW_REQUIRED", displayName: "Flag to Accountant" }, { status: "RECONCILED", displayName: "Reconciled" }], Gh = [{ status: "ACCOUNTANT_REVIEW_REQUIRED", displayName: "Needs my Review" }, { status: "RECONCILIATION_DISCREPANCY", displayName: "Discrepancy" }, { status: "USER_REVIEW_REQUIRED", displayName: "Flag to User" }, { status: "RECONCILED", displayName: "Reconciled" }], Qh = (e2) => {
|
|
2359
|
-
switch (e2) {
|
|
2360
|
-
case "OWNER":
|
|
2361
|
-
default:
|
|
2362
|
-
return Yh;
|
|
2363
|
-
case "ACCOUNTANT":
|
|
2364
|
-
return Gh;
|
|
2365
|
-
}
|
|
2366
|
-
};
|
|
2367
|
-
function Xh({ onClick: e2 }) {
|
|
2368
|
-
const t2 = ll(), { userRole: r2 } = g(Rl), n2 = Qh(r2) || [];
|
|
2369
|
-
return k(fl, { children: k(Xd, { children: n2.map(({ status: r3, displayName: n3 }) => k(eu, { onClick: () => ((r4) => {
|
|
2370
|
-
e2(r4), t2.setOpen(false);
|
|
2371
|
-
})(r3), children: n3 }, r3)) }) });
|
|
2372
|
-
}
|
|
2373
|
-
const Zh = (e2, t2) => {
|
|
2374
|
-
const r2 = ((e3, t3) => {
|
|
2375
|
-
switch (t3) {
|
|
2376
|
-
case "ACCOUNTANT":
|
|
2377
|
-
return e3 === Ph;
|
|
2378
|
-
case "OWNER":
|
|
2379
|
-
return e3 === Ih;
|
|
2380
|
-
}
|
|
2381
|
-
})(e2, t2), n2 = /* @__PURE__ */ ((e3, t3) => "OWNER" === t3 && e3 === Ph)(e2, t2), o2 = /* @__PURE__ */ ((e3, t3) => "ACCOUNTANT" === t3 && e3 === Ih)(e2, t2), a2 = /* @__PURE__ */ ((e3) => "RECONCILIATION_DISCREPANCY" === e3)(e2), i2 = /* @__PURE__ */ ((e3) => "RECONCILED" === e3)(e2);
|
|
2382
|
-
let l2, s2, c2;
|
|
2383
|
-
return n2 ? (l2 = "Pending Review", s2 = k(gc, { Component: Nh }), c2 = "neutral") : o2 ? (l2 = "Pending User Review", s2 = k(gc, { Component: Nh }), c2 = "neutral") : r2 ? (l2 = "Needs Review", s2 = k(gc, { Component: Ah }), c2 = "warning") : a2 ? (l2 = "Discrepancy", s2 = k(gc, { Component: Dh }), c2 = "critical") : i2 ? (l2 = "Reconciled", s2 = k(gc, { Component: Mh }), c2 = "success") : (l2 = "Processing", s2 = k(gc, { Component: Nh }), c2 = "neutral"), { text: l2, type: c2, Icon: s2 };
|
|
2384
|
-
};
|
|
2385
|
-
function Jh({ status: e2, transactionId: t2 }) {
|
|
2386
|
-
const [r2, n2] = v(false), { mutate: o2 } = Bu(), a2 = () => {
|
|
2387
|
-
n2(false);
|
|
2388
|
-
}, i2 = () => {
|
|
2389
|
-
n2(!r2);
|
|
2390
|
-
}, { userRole: l2 } = g(Rl), { text: s2, type: c2, Icon: d2 } = Zh(e2, l2);
|
|
2391
|
-
return t2 && !function(e3) {
|
|
2392
|
-
return e3.startsWith(bi.TRANSACTION_LINE_ITEM) || e3.startsWith(bi.PROCESSOR_TRANSACTION);
|
|
2393
|
-
}(t2) ? S(il, { open: r2, blockInteraction: false, onOpenChange: a2, enableClickMiddleware: false, children: [k(sl, { children: (e3) => S($h, { type: c2, popupTriggerProps: e3, onClick: i2, children: [d2, k(co, { children: s2 })] }) }), k(Xh, { onClick: (e3) => {
|
|
2394
|
-
o2({ id: t2, reviewStatus: e3 }), a2();
|
|
2395
|
-
} })] }) : null;
|
|
2396
|
-
}
|
|
2397
|
-
function eg({ status: e2, transactionId: t2 }) {
|
|
2398
|
-
return k(Jh, { status: e2, transactionId: t2 }, t2);
|
|
2399
|
-
}
|
|
2400
|
-
const tg = aa((e2) => c.createElement("svg", { width: 13, height: 12, viewBox: "0 0 13 12", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e2 }, c.createElement("g", { clipPath: "url(#clip0_9779_2940)" }, c.createElement("path", { d: "M11.9147 7.99997L6.31472 2.39996L0.714716 7.99997", stroke: "#182428", strokeMiterlimit: 10 })), c.createElement("defs", null, c.createElement("clipPath", { id: "clip0_9779_2940" }, c.createElement("rect", { width: 12, height: 12, fill: "white", transform: "translate(0.314728)" })))), "ArrowUp"), rg = aa((e2) => c.createElement("svg", { width: 13, height: 12, viewBox: "0 0 13 12", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e2 }, c.createElement("g", { clipPath: "url(#clip0_9779_2922)" }, c.createElement("path", { d: "M0.714706 3.99996L6.31472 9.59998L11.9147 3.99996", stroke: "#182428", strokeMiterlimit: 10 })), c.createElement("defs", null, c.createElement("clipPath", { id: "clip0_9779_2922" }, c.createElement("rect", { width: 12, height: 12, fill: "white", transform: "translate(0.314728)" })))), "ArrowDown");
|
|
2401
|
-
function ng({ row: e2 }) {
|
|
2402
|
-
const t2 = e2.getIsExpanded();
|
|
2403
|
-
return e2.getCanExpand() ? k(El, { "aria-label": t2 ? "Collapse row" : "Expand row", "aria-expanded": t2, children: k(ga, { Component: t2 ? tg : rg }) }) : k(El, { active: false, children: k(ga, { Component: la }) });
|
|
2404
|
-
}
|
|
2405
|
-
function og({ row: e2 }) {
|
|
2406
|
-
return k(ng, { row: e2 });
|
|
2407
|
-
}
|
|
2408
|
-
const ag = aa((e2) => c.createElement("svg", { width: 25, height: 24, viewBox: "0 0 25 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e2 }, c.createElement("path", { d: "M12 1.47998C6.2 1.47998 1.5 5.74998 1.5 11C1.52866 13.0153 2.23294 14.9626 3.5 16.53L2.5 21.53L9.16 20.2C10.1031 20.4499 11.0744 20.5776 12.05 20.58C17.85 20.58 22.55 16.3 22.55 11.03C22.55 5.75998 17.8 1.47998 12 1.47998Z", strokeWidth: 1.5, strokeMiterlimit: 10 }), c.createElement("path", { d: "M11.05 11.02H12.95", strokeWidth: 1.5, strokeMiterlimit: 10 }), c.createElement("path", { d: "M15.82 11.02H17.73", strokeWidth: 1.5, strokeMiterlimit: 10 }), c.createElement("path", { d: "M6.27 11.02H8.18", strokeWidth: 1.5, strokeMiterlimit: 10 })), "Comment"), ig = aa((e2) => c.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e2 }, c.createElement("path", { d: "M0.495239 8.15601H14.7767", strokeMiterlimit: 10 })), "Dash"), lg = At(null, ft({ position: "absolute", top: "-1", right: "-1", width: "10", height: "10", borderRadius: "999px", backgroundColor: "surface.intent.warning", boxShadow: "0 0 0 1px {colors.border.intent.warning}" })), sg = At(null, ft({ position: "relative", display: "inline-block" })), cg = At(null, ft({ stroke: "icon.base" })), dg = At(null, ft({ stroke: "icon.base.weak" }));
|
|
2409
|
-
function ug({ hasConversation: e2, hasRead: t2 = false }) {
|
|
2410
|
-
return k(C, { children: e2 ? S("div", { ...sg, children: [k(Xl, { Component: ag, stylists: [cg] }), !t2 && k("div", { "data-testid": "unread-comment-badge", ...lg, "aria-hidden": "true" })] }) : k("div", { "data-testid": "no-conversations-dash", children: k(dl, { Component: ig, stylists: [dg] }) }) });
|
|
2411
|
-
}
|
|
2412
|
-
function hg({ conversationId: e2 }) {
|
|
2413
|
-
const { query: { data: t2 } } = za(e2 ?? null), { startPrefetch: r2, cancelPrefetch: n2 } = ja(), { startPrefetch: o2, cancelPrefetch: a2 } = ki(), i2 = lr(t2), l2 = i2 && "READ" == t2?.readStatus, s2 = m(() => {
|
|
2414
|
-
lr(e2) && (r2({ id: e2 }), o2({ id: e2 }));
|
|
2415
|
-
}, [e2, r2, o2]), c2 = m(() => {
|
|
2416
|
-
lr(e2) && (n2(), a2());
|
|
2417
|
-
}, [e2, n2, a2]);
|
|
2418
|
-
return k("div", { onMouseEnter: s2, onMouseLeave: c2, children: k(ug, { hasConversation: i2, hasRead: l2 }) });
|
|
2419
|
-
}
|
|
2420
|
-
const gg = q(), pg = [gg.display({ id: Ne.SELECT, header: () => null, cell: ({ row: e2 }) => void 0 === e2.getParentRow() ? k(xd, { checked: e2.getIsSelected(), onClick: e2.getToggleSelectedHandler() }, e2.original.id) : null, maxSize: 35, meta: { clickable: true } }), gg.accessor("date", { id: Ne.DATE, cell: (e2) => k(Gi, { children: k(Ad, { transaction: e2.row.original }) }), header: () => k(Dl, { columnName: "Date", sortDef: "DATE", sortAscDisplay: dd.ASC, sortDescDisplay: dd.DESC }), size: 130, maxSize: 144 }), gg.accessor("description", { id: Ne.DESCRIPTION, cell: (e2) => k(Gi, { children: k(Md, { bankTransaction: e2.row.original }) }), header: () => k(Dl, { columnName: "Source", sortDef: "DESCRIPTION", sortAscDisplay: ud.ASC, sortDescDisplay: ud.DESC }), size: 180 }), gg.accessor("amount", { id: Ne.AMOUNT, cell: (e2) => k(Gi, { children: k(_d, { transaction: e2.row.original }) }), header: () => k(Dl, { columnName: "Amount", sortDef: "AMOUNT", sortAscDisplay: hd.ASC, sortDescDisplay: hd.DESC }), size: 130, maxSize: 180 }), gg.accessor("category.id", { id: Ne.CATEGORY, cell: (e2) => k(Sh, { transaction: e2.row.original }), header: () => k(Dl, { columnName: "Category" }), size: 130, meta: { clickable: true } }), gg.accessor((e2) => e2.classSegments[0]?.id, { id: Ne.CLASS_SEGMENT, cell: (e2) => k(Gi, { children: k(Eh, { name: e2.row.original.classSegments[0]?.name }) }), header: () => k(Dl, { columnName: "Business" }), size: 130 }), gg.accessor("reviewStatus", { id: Ne.REVIEW_STATUS, cell: (e2) => k(Gi, { children: k(eg, { status: e2.getValue(), transactionId: e2.row.original.id }) }), header: () => k(Dl, { columnName: "Reviewed", sortDef: "REVIEW_STATUS", sortAscDisplay: gd.ASC, sortDescDisplay: gd.DESC }), size: 130, maxSize: 160, meta: { clickable: true } }), gg.display({ id: Ne.COMMENTS, cell: (e2) => {
|
|
2421
|
-
const t2 = e2.row.original;
|
|
2422
|
-
return k(Gi, { alignVariant: "center", children: k(hg, { conversationId: t2.conversation?.id }) });
|
|
2423
|
-
}, header: () => k(Dl, { columnName: "Comments" }), size: 110, maxSize: 110, meta: { clickable: true } }), gg.display({ id: Ne.EXPAND, cell: (e2) => k(og, { row: e2.row }), size: 40, maxSize: 60 })];
|
|
2424
|
-
function vg(e2) {
|
|
2425
|
-
return e2 ? pg.filter((t2) => e2.includes(t2.id)) : pg;
|
|
2426
|
-
}
|
|
2427
|
-
function mg(e2) {
|
|
2428
|
-
if (e2) return Object.values(Ne).reduce((t2, r2) => (t2[r2] = e2.includes(r2), t2), {});
|
|
2429
|
-
}
|
|
2430
|
-
function bg({ transactions: e2, columns: t2 }) {
|
|
2431
|
-
return function({ transactions: e3, columns: t3 }) {
|
|
2432
|
-
return U({ data: e3 ?? fg, manualPagination: true, manualSorting: true, manualFiltering: true, manualGrouping: true, rowCount: e3?.length ?? fg.length, columns: vg(t3), getCoreRowModel: K(), getRowCanExpand: (e4) => e4.original.children.length > 0, getSubRows: (e4) => e4.children.map((t4) => function(e5, t5, r2) {
|
|
2433
|
-
return { parentId: t5, parentsChildren: r2, ...e5, matchingBankTransaction: null, rule: null, tax: { paymentInfo: null }, customData: null, children: [], conversation: null };
|
|
2434
|
-
}(t4, e4.id, e4.children)), getExpandedRowModel: $(), paginateExpandedRows: false, getRowId: (e4) => e4.id, state: { columnOrder: t3, columnVisibility: mg(t3) } });
|
|
2435
|
-
}({ transactions: e2, columns: t2 ? [...t2, Ne.EXPAND] : void 0 });
|
|
2436
|
-
}
|
|
2437
|
-
const fg = [];
|
|
2438
|
-
const yg = [Ne.COMMENTS, Ne.DATE, Ne.DESCRIPTION, Ne.AMOUNT, Ne.CATEGORY, Ne.REVIEW_STATUS];
|
|
2439
|
-
function Tg(e2, t2) {
|
|
2440
|
-
return ii("BankTransactionFormRouter", { routeProps: { transactionId: e2, initialTab: t2 } });
|
|
2441
|
-
}
|
|
2442
|
-
function xg(e2) {
|
|
2443
|
-
const t2 = e2.row, r2 = e2.column.columnDef.meta?.clickable, n2 = t2.getCanExpand(), o2 = "BANK_TRANSFER" === t2.original.type, a2 = "category" === e2.column.id && (n2 || o2);
|
|
2444
|
-
if ("comments" === e2.column.id) {
|
|
2445
|
-
const e3 = t2.getParentRow();
|
|
2446
|
-
Tg(e3?.original.id ?? t2.original.id, "conversation");
|
|
2447
|
-
} else if (!r2 || a2) if (n2) t2.toggleExpanded();
|
|
2448
|
-
else {
|
|
2449
|
-
const e3 = t2.getParentRow();
|
|
2450
|
-
Tg(e3?.original.id ?? t2.original.id);
|
|
2451
|
-
}
|
|
2452
|
-
}
|
|
2453
|
-
function wg({ rowData: e2, hasSelect: t2 = true }) {
|
|
2454
|
-
const { startPrefetch: r2, cancelPrefetch: n2 } = mi(), o2 = m(() => r2({ id: e2.original.id }), [r2, e2.original]);
|
|
2455
|
-
return k(ai, { rowData: e2, onMouseEnter: o2, onMouseLeave: n2, onCellClick: xg, shouldDisplayDivider: (r3) => function(e3, t3, r4) {
|
|
2456
|
-
return !(0 === e3 || t3 && 1 === e3 || e3 === r4 - 1 || t3 || 1 === e3);
|
|
2457
|
-
}(r3, t2, e2.getVisibleCells().length) });
|
|
2458
|
-
}
|
|
2459
|
-
const kg = "All caught up", Cg = "We'll let you know if something comes up.", Sg = At(null, ft({ whiteSpace: "wrap" }));
|
|
2460
|
-
function Eg() {
|
|
2461
|
-
return S(C, { children: [k(Xl, { Component: Mh }), k(lo, { stylists: [Sg], children: kg }), k(co, { wrap: "wrap", children: Cg })] });
|
|
2462
|
-
}
|
|
2463
|
-
const Ig = At(kt["button-warning"], ft({ color: "typography.intent.warning", border: "1px solid {colors.border.intent.warning}", backgroundColor: "surface.intent.warning", _supportHover: { _notDisabled: { backgroundColor: "surface.intent.warning.hover", borderColor: "border.intent.warning.hover", "& .Tight-text": { color: "typography.intent.warning.hover" } } }, "&:active:enabled, &[data-active='true']:enabled": { backgroundColor: "surface.intent.warning.active", borderColor: "border.intent.warning.active", "& .Tight-text": { color: "typography.intent.warning.active" } }, "& .Tight-text": { color: "typography.intent.warning" } }));
|
|
2464
|
-
function Pg({ children: e2, stylists: t2 = [], ...r2 }) {
|
|
2465
|
-
return k(Oi, { stylists: [Ig, ...t2], ...r2, children: e2 });
|
|
2466
|
-
}
|
|
2467
|
-
function Ag() {
|
|
2468
|
-
const { linkPlaid: e2 } = Ic();
|
|
2469
|
-
return k(Pg, { onClick: e2, children: k(lo, { children: "Link your bank" }) });
|
|
2470
|
-
}
|
|
2471
|
-
const Dg = "Your bank transactions will be categorized for you", Mg = "If any require your review, they'll be flagged here.", Ng = At(null, ft({ whiteSpace: "wrap" }));
|
|
2472
|
-
function Rg() {
|
|
2473
|
-
return S(C, { children: [k(Xl, { Component: lh }), k(lo, { stylists: [Ng], children: Dg }), k(co, { wrap: "wrap", children: Mg }), k(Ag, {})] });
|
|
2474
|
-
}
|
|
2475
|
-
const Og = ft({ animation: "spin", display: "flex", alignItems: "center", justifyContent: "center", width: "15px", height: "15px" }), _g = "Transactions are being processed", Lg = "Any transactions that require review will show up here.";
|
|
2476
|
-
function Fg() {
|
|
2477
|
-
return S(C, { children: [k("div", { className: Og, children: k(gc, { Component: Nh }) }), k(lo, { children: _g }), k(co, { children: Lg })] });
|
|
2478
|
-
}
|
|
2479
|
-
function Wg({ hasLinkedAccount: e2, sortInstance: t2, setSortInstance: r2, isFilling: n2, paginationControls: o2, transactions: a2 }) {
|
|
2480
|
-
const i2 = function({ transactions: e3 }) {
|
|
2481
|
-
return bg({ transactions: e3, columns: yg });
|
|
2482
|
-
}({ transactions: a2 }), { query: { data: l2 }, isFilling: s2 } = gi({ limit: 1, filter: { status: { values: ["ACTIVE", "INACTIVE", "REMOVED"] } } }), c2 = !ir(l2?.data?.[0]) && !s2, d2 = function(e3, t3, r3) {
|
|
2483
|
-
let n3;
|
|
2484
|
-
return e3 || t3 ? !e3 || r3 || t3 ? e3 && r3 && !t3 && (n3 = k(Eg, {})) : n3 = k(Fg, {}) : n3 = k(Rg, {}), n3;
|
|
2485
|
-
}(e2 ?? false, a2.length > 0, c2);
|
|
2486
|
-
return S(C, { children: [k("div", { id: $o }), S(ha.Provider, { value: o2, children: [S(Mt, { children: [k(Ft, { children: "Transactions For Your Review" }), k(cs, { children: k(fa, {}) })] }), k(Hi, { dashboard: "businessOwnerDashboard", children: n2 ? k(Ca, {}) : S(C, { children: [k(zi.Provider, { value: { sortInstance: t2, setSortInstance: r2 }, children: k($a, { headerGroups: i2.getHeaderGroups() }) }), ir(d2) ? k(Ga, { children: i2.getRowModel().rows.map((e3) => k(wg, { rowData: e3, hasSelect: false }, e3.id)) }) : k(Ql, { children: d2 })] }) })] })] });
|
|
2487
|
-
}
|
|
2488
|
-
function Bg() {
|
|
2489
|
-
const { sortInstance: e2, setSortInstance: t2, apiSort: r2 } = pd(), { query: { data: n2 }, isFilling: o2, paginationControls: a2 } = gi({ filter: Go, sort: r2, limit: Xo }), i2 = n2?.data ?? Zo, { query: { data: l2 }, isFilling: s2 } = qs();
|
|
2490
|
-
return k(Wg, { sortInstance: e2, setSortInstance: t2, isFilling: o2 || s2, paginationControls: a2, transactions: i2, hasLinkedAccount: l2 ?? false });
|
|
2491
|
-
}
|
|
2492
|
-
const Hg = At(kt["button-action"], ft({ color: "typography.intent.action", border: "1px solid {colors.border.intent.action}", backgroundColor: "surface.intent.action", _supportHover: { _notDisabled: { backgroundColor: "surface.intent.action.hover", borderColor: "border.intent.action.hover", "& .Tight-text": { color: "typography.intent.action.hover" } } }, "&:active:enabled, &[data-active='true']:enabled": { backgroundColor: "surface.intent.action.active", borderColor: "border.intent.action.active", "& .Tight-text": { color: "typography.intent.action.active" } }, "& .Tight-text": { color: "typography.intent.action" } }));
|
|
2493
|
-
function zg({ children: e2, stylists: t2 = [], ...r2 }) {
|
|
2494
|
-
return k(Oi, { stylists: [Hg, ...t2], ...r2, children: e2 });
|
|
2495
|
-
}
|
|
2496
|
-
const Vg = (e2) => {
|
|
2497
|
-
switch (e2) {
|
|
2498
|
-
case "URGENT":
|
|
2499
|
-
return { Button: vc };
|
|
2500
|
-
case "HIGH":
|
|
2501
|
-
return { Button: Pg };
|
|
2502
|
-
case "MEDIUM":
|
|
2503
|
-
return { Button: zg };
|
|
2504
|
-
default:
|
|
2505
|
-
return { Button: Oi };
|
|
2506
|
-
}
|
|
2507
|
-
}, jg = (e2) => {
|
|
2508
|
-
switch (e2) {
|
|
2509
|
-
case "MESSAGE_REVIEW":
|
|
2510
|
-
return { Icon: ag, buttonText: "Respond Now" };
|
|
2511
|
-
case "TRANSACTION_REVIEW":
|
|
2512
|
-
return { Icon: Ah, buttonText: "Review" };
|
|
2513
|
-
case "LINK_BANK":
|
|
2514
|
-
return { Icon: lh, buttonText: "Link your bank" };
|
|
2515
|
-
case "BANK_ERROR":
|
|
2516
|
-
return { Icon: Dh, buttonText: "Relink" };
|
|
2517
|
-
case "ALL_CAUGHT_UP":
|
|
2518
|
-
return { Icon: Mh, buttonText: "" };
|
|
2519
|
-
default:
|
|
2520
|
-
return { Icon: Dh, buttonText: "" };
|
|
2521
|
-
}
|
|
2522
|
-
}, qg = At(null, ft({ display: "flex", alignItems: "center", gap: "15px" })), Ug = At(null, ft({ width: "20px", height: "20px" }));
|
|
2523
|
-
function Kg({ title: e2, type: t2 }) {
|
|
2524
|
-
const { Icon: r2 } = jg(t2);
|
|
2525
|
-
return S("div", { ...qg, children: [k(gc, { Component: r2, stylists: [Ug] }), k(lo, { children: e2 })] });
|
|
2526
|
-
}
|
|
2527
|
-
const $g = At(null, ft({ display: "flex", flexDirection: "column", justifyContent: "center", alignItems: "flex-start", gap: "5px", flex: "1 1 0", minWidth: "200px", width: "100%" }));
|
|
2528
|
-
function Yg({ title: e2, description: t2, type: r2 }) {
|
|
2529
|
-
return S("div", { ...$g, children: [k(Kg, { title: e2, type: r2 }), k(co, { wrap: "wrap", children: t2 })] });
|
|
2530
|
-
}
|
|
2531
|
-
const Gg = At(kt["banner-button"], ft({ display: "flex", width: "202px", justifyContent: "flex-end", alignItems: "center", gap: "15px", flexShrink: "0" })), Qg = At(kt["banner-button-text"]), Xg = At(kt["banner-button-icon"]);
|
|
2532
|
-
function Zg({ priority: e2, type: t2, handleClick: r2 }) {
|
|
2533
|
-
const { buttonText: n2 } = jg(t2), { Button: o2 } = Vg(e2);
|
|
2534
|
-
return S(o2, { onClick: r2, stylists: [Gg], children: [k(lo, { stylists: [Qg], children: n2 }), k(ga, { stylists: [Xg], Component: la })] });
|
|
2535
|
-
}
|
|
2536
|
-
const Jg = wt({ base: { display: "flex", flexDirection: { sm: "row", base: "column" }, padding: "15px", justifyContent: "space-between", alignItems: { sm: "center", base: "flex-start" }, alignSelf: "stretch", flexWrap: "wrap", minWidth: "300px", gap: "15px", borderRadius: "lg", border: "1px solid", backgroundColor: "surface.foreground" }, variants: { priority: { HIGH: { borderColor: "border.intent.warning" }, MEDIUM: { borderColor: "border.intent.action" }, LOW: {}, URGENT: { borderColor: "border.intent.danger" }, DEFAULT: { borderColor: "border.intent.secondary" } } } }), ep = { HIGH: kt["banner-high"], MEDIUM: kt["banner-medium"], LOW: kt["banner-low"], URGENT: kt["banner-urgent"] };
|
|
2537
|
-
function tp({ task: e2, handleClick: t2 }) {
|
|
2538
|
-
const { name: r2, description: n2, type: o2, priority: a2 } = e2, i2 = At(kt.banner, ep[a2], Jg({ priority: a2 }));
|
|
2539
|
-
return S("div", { ...i2, children: [k(Yg, { title: r2, description: n2, type: o2 }), k(Zg, { priority: a2, type: o2, handleClick: t2 })] });
|
|
2540
|
-
}
|
|
2541
|
-
function rp({ task: e2 }) {
|
|
2542
|
-
const { linkPlaid: t2 } = Ic(e2?.meta?.plaidItemId);
|
|
2543
|
-
return k(tp, { task: e2, handleClick: t2 });
|
|
2544
|
-
}
|
|
2545
|
-
function np() {
|
|
2546
|
-
const e2 = At(kt.banner, Jg({ priority: "DEFAULT" }));
|
|
2547
|
-
return k("div", { ...e2, children: k(Yg, { title: "All caught up", description: "We'll let you know if a new action item comes up.", type: "ALL_CAUGHT_UP" }) });
|
|
2548
|
-
}
|
|
2549
|
-
function op({ taskBanners: e2, handleScrollAction: t2 }) {
|
|
2550
|
-
return e2.length > 0 ? e2.map((e3) => "LINK_BANK" === e3.type || "BANK_ERROR" === e3.type ? k(rp, { task: e3 }, e3.id) : k(tp, { task: e3, handleClick: () => t2(e3.type) }, e3.id)) : k(np, {});
|
|
2551
|
-
}
|
|
2552
|
-
function ap() {
|
|
2553
|
-
return S(Li, { onClick: () => ii("BanksAndIntegrations"), children: [k(ga, { Component: hc }), k(Zi, { children: "Banks & Integrations" })] });
|
|
2554
|
-
}
|
|
2555
|
-
const ip = h({ dimensions: { width: null, height: null } });
|
|
2556
|
-
function lp() {
|
|
2557
|
-
const { dimensions: e2 } = g(ip);
|
|
2558
|
-
return lr(e2.width) && e2.width < parseInt(po("sizes.breakpoint-sm"));
|
|
2559
|
-
}
|
|
2560
|
-
const sp = At(kt["business-owner-dashboard"], ft({ gap: 10, display: "flex", flexDirection: "column", width: "100%", maxWidth: 1440 })), cp = At(null, ft({ display: "flex", width: "100%", justifyContent: "center" })), dp = "In April 2025, your total income increased significantly to $7,500, up from $5,000 the previous month, reflecting strong revenue growth. However, expenses also rose slightly to $2,677.99, compared to $2,400 last month, which slightly narrowed your net profit margin despite a healthy $4,822.01 net profit. \n\nA key area for improvement is transaction categorization; with one transaction remaining uncategorized and only two user-categorized, enhancing categorization accuracy will improve financial tracking and insights. To maintain positive momentum, consider reviewing variable expenses to identify any controllable cost increases.\n\nGoing forward, continue focusing on revenue growth while keeping a close eye on expense management, and aim to fully categorize all transactions to gain more precise financial visibility. ", up = "A summary of this month's financials will appear here once more data is available.", hp = (e2) => {
|
|
2561
|
-
const t2 = Yo[e2], r2 = document.getElementById(t2);
|
|
2562
|
-
r2 && r2.scrollIntoView({ behavior: "smooth" });
|
|
2563
|
-
}, gp = { status: { operator: "IN", values: ["ACTIVE", "INACTIVE"] } };
|
|
2564
|
-
const pp = (e2, t2) => {
|
|
2565
|
-
const r2 = function(e3) {
|
|
2566
|
-
return ir(e3) || ir(e3.data) ? [] : [...e3.data].sort((e4, t3) => ra[e4.priority] - ra[t3.priority]);
|
|
2567
|
-
}(e2);
|
|
2568
|
-
return t2 ? r2.filter((e3) => "MESSAGE_REVIEW" === e3.type || "BANK_ERROR" === e3.type) : r2;
|
|
2569
|
-
}, vp = { filter: { status: { values: ["ACTIVE"], operator: "IN" } } };
|
|
2570
|
-
function mp({ period: e2, onChangePeriod: t2 }) {
|
|
2571
|
-
const { sortInstance: r2, setSortInstance: n2, apiSort: o2 } = Nl(), { query: { data: a2 }, isFilling: i2, paginationControls: l2 } = Ba({ limit: Xo, sort: o2, filter: Qo }), s2 = a2?.data ?? Jo, c2 = lp(), { query: { data: d2 }, isFilling: h2 } = (g2 = { select: (e3) => pp(e3, c2) }, p2 = vp, br({ ...g2, queryKey: p2 ? ta.of(p2) : ta.all(), queryFn: na }));
|
|
2572
|
-
var g2, p2;
|
|
2573
|
-
const { query: { data: v2 } } = qs(), { query: { data: m2 } } = Fs(), b2 = lp(), f2 = u(() => {
|
|
2574
|
-
let e3 = [];
|
|
2575
|
-
m2 && (e3 = m2.map((e4) => As(e4.apiInstitutionName, e4.id, e4.apiErrorCode)));
|
|
2576
|
-
let t3 = [];
|
|
2577
|
-
v2 || (t3 = [Ps]);
|
|
2578
|
-
const r3 = d2 ?? [];
|
|
2579
|
-
return [...e3, ...t3, ...r3];
|
|
2580
|
-
}, [d2, v2, m2]), y2 = function() {
|
|
2581
|
-
const { query: { data: e3 } } = gi({ filter: gp, limit: 1 });
|
|
2582
|
-
return (e3?.data?.length ?? 0) > 0;
|
|
2583
|
-
}(), T2 = false === v2 && !y2, x2 = /* @__PURE__ */ new Date(), w2 = (E2 = x2.getMonth(), I2 = x2.getFullYear(), { month: E2, year: I2 });
|
|
2584
|
-
var E2, I2;
|
|
2585
|
-
const [P2, A2] = ol(w2, e2, t2), D2 = function(e3, t3) {
|
|
2586
|
-
return { beginDate: Bt(t3 - 1, e3 + 1, 1), endDate: Bt(t3, e3 + 1, 0) };
|
|
2587
|
-
}(P2.month, P2.year), { query: { data: M2 }, isFilling: N2 } = vs(P2), R2 = T2 ? dp : M2 ?? up;
|
|
2588
|
-
return k("div", { ...cp, children: S("div", { ...sp, children: [S(Mt, { children: [k(Ft, { children: "Action Items" }), k(ap, {})] }), k(Uo, { children: h2 ? k(cd, {}) : k(op, { taskBanners: f2, handleScrollAction: hp }) }), !b2 && S(C, { children: [k(ld, { period: P2, handleDateChange: (e3) => {
|
|
2589
|
-
var t3, r3;
|
|
2590
|
-
(t3 = w2).year === (r3 = e3).year && r3.month > t3.month || r3.year > t3.year || A2(e3);
|
|
2591
|
-
}, todayPeriod: w2, showSamples: T2 }), k(Mt, { children: k(Ft, { children: "Financial Summary" }) }), k(Is, { isSample: T2, isFilling: N2, children: R2 }), k(jo, { filter: D2 })] }), k(hs, { sortInstance: r2, setSortInstance: n2, conversations: s2, paginationControls: l2, isFilling: i2, isMobile: b2 }), !b2 && k(Bg, {})] }) });
|
|
2592
|
-
}
|
|
2593
|
-
function bp(e2) {
|
|
2594
|
-
return k(nn || C, { children: e2.children });
|
|
2595
|
-
}
|
|
2596
|
-
const fp = "undefined" != typeof window ? x : b, yp = { x: 0, y: 0, width: 0, height: 0, top: 0, left: 0, bottom: 0, right: 0 };
|
|
2597
|
-
function Tp({ children: e2 }) {
|
|
2598
|
-
const [t2, { width: r2, height: n2 }] = function() {
|
|
2599
|
-
const [e3, t3] = v(null), [r3, n3] = v(yp), o2 = u(() => new window.ResizeObserver((e4) => {
|
|
2600
|
-
if (e4[0]) {
|
|
2601
|
-
const { x: t4, y: r4, width: o3, height: a2, top: i2, left: l2, bottom: s2, right: c2 } = e4[0].contentRect;
|
|
2602
|
-
n3({ x: t4, y: r4, width: o3, height: a2, top: i2, left: l2, bottom: s2, right: c2 });
|
|
2603
|
-
}
|
|
2604
|
-
}), []);
|
|
2605
|
-
return fp(() => {
|
|
2606
|
-
if (e3) return o2.observe(e3), () => {
|
|
2607
|
-
o2.disconnect();
|
|
2608
|
-
};
|
|
2609
|
-
}, [e3]), [t3, r3];
|
|
2610
|
-
}();
|
|
2611
|
-
return k(bp, { children: k(ip.Provider, { value: { dimensions: { width: r2, height: n2 } }, children: k("div", { ref: t2, className: St(kt.component), children: e2 }) }) });
|
|
2612
|
-
}
|
|
2613
|
-
function xp(e2) {
|
|
2614
|
-
return k(Tp, { children: k(mp, { ...e2 }) });
|
|
2615
|
-
}
|
|
2616
|
-
const wp = me("tight-component-store", 1, { upgrade(e2) {
|
|
2617
|
-
e2.createObjectStore("queryClient");
|
|
2618
|
-
} });
|
|
2619
|
-
const kp = { queryClient: pr, persister: /* @__PURE__ */ function(e2 = "reactQuery") {
|
|
2620
|
-
return { persistClient: async (t2) => {
|
|
2621
|
-
await async function(e3, t3) {
|
|
2622
|
-
return (await wp).put("queryClient", t3, e3);
|
|
2623
|
-
}(e2, t2);
|
|
2624
|
-
}, restoreClient: async () => await async function(e3) {
|
|
2625
|
-
return (await wp).get("queryClient", e3);
|
|
2626
|
-
}(e2), removeClient: async () => {
|
|
2627
|
-
await async function(e3) {
|
|
2628
|
-
return (await wp).delete("queryClient", e3);
|
|
2629
|
-
}(e2);
|
|
2630
|
-
} };
|
|
2631
|
-
}(), maxAge: gr, dehydrateOptions: { shouldDehydrateQuery: (e2) => !e2.isStale() } };
|
|
2632
|
-
function Cp({ children: e2 }) {
|
|
2633
|
-
return k(be, { client: pr, persistOptions: kp, children: e2 });
|
|
2634
|
-
}
|
|
2635
|
-
const Sp = ft({ position: "absolute", top: 0, left: 0, width: { base: 0, sm: "100dvw" }, height: { base: 0, sm: "100dvh" }, minWidth: { base: 0, sm: "100dvw" }, minHeight: { base: 0, sm: "100dvh" }, maxHeight: { base: 0, sm: "100dvh" }, maxWidth: { base: 0, sm: "100dvw" }, overflow: "hidden", backgroundColor: "overlay" }), Ep = ft({ position: "absolute", top: 0, left: { base: 0, sm: "auto" }, right: 0, bottom: { base: 0, sm: "auto" }, width: "100dvw", height: "100dvh", minWidth: "100dvw", minHeight: "100dvh", maxHeight: "100dvh", maxWidth: "100dvw", overflow: "hidden" }), Ip = At(null, kt.component, Ep);
|
|
2636
|
-
function Pp({ children: e2 }) {
|
|
2637
|
-
const t2 = d(null), r2 = d(null);
|
|
2638
|
-
return S(ce, { lockScroll: true, children: [k("div", { className: Sp }), k("div", { onMouseDown: (e3) => {
|
|
2639
|
-
r2.current = e3.target;
|
|
2640
|
-
}, onClick: (e3) => {
|
|
2641
|
-
const n2 = r2.current === t2.current, o2 = e3.target === t2.current;
|
|
2642
|
-
n2 && o2 && (r2.current = null, li());
|
|
2643
|
-
}, ref: t2, ...Ip, children: e2 })] });
|
|
2644
|
-
}
|
|
2645
|
-
const Ap = h({ drawerHistory: [] });
|
|
2646
|
-
function Dp({ children: e2 }) {
|
|
2647
|
-
const t2 = Me((e3) => e3.drawerHistory), r2 = u(() => ({ drawerHistory: t2 }), [t2]);
|
|
2648
|
-
return k(Ap.Provider, { value: r2, children: t2.length > 0 && k(Pp, { children: e2 }) });
|
|
2649
|
-
}
|
|
2650
|
-
function Mp({ Component: e2, name: t2 }) {
|
|
2651
|
-
const { drawerHistory: r2 } = g(Ap), n2 = r2.at(-1);
|
|
2652
|
-
if (void 0 === n2) return null;
|
|
2653
|
-
const o2 = n2[t2];
|
|
2654
|
-
return void 0 !== o2 ? k(e2, { ...o2.routeProps }) : void 0;
|
|
2655
|
-
}
|
|
2656
|
-
const Np = [At(null, ft({ color: "icon.accent.danger", "& path": { stroke: "icon.accent.danger" } }))], Rp = At(null, ft({ display: "flex", alignItems: "center", gap: "4px" }));
|
|
2657
|
-
function Op({ errorMessage: e2 }) {
|
|
2658
|
-
return S("div", { ...Rp, children: [k(gc, { Component: Dh, stylists: Np }), k(co, { intent: "danger", children: e2 })] });
|
|
2659
|
-
}
|
|
2660
|
-
const _p = ft({ display: "flex", flexDirection: "column", padding: "12px 16px", cursor: "pointer", outline: "none", gap: "8px", borderRadius: "md", backgroundColor: "surface.intent.action.discrete", "&[data-state='closed'][data-disablehover='false']": { _supportHover: { backgroundColor: "surface.intent.action.discrete.hover" } }, "&:not([data-state])[data-disablehover='false']:not(:focus-within)": { _supportHover: { backgroundColor: "surface.intent.action.discrete.hover" } }, "&[data-state='open']": { backgroundColor: "surface.intent.action.discrete.active" }, "&[data-clicked='false']:has(:focus-visible)": { outline: "4px solid", outlineColor: "border.layout" } }), Lp = ft({ "&[data-haserror='true']": { border: "{borderWidths.lg} solid", borderColor: "border.intent.danger" } });
|
|
2661
|
-
function Fp({ children: e2, inputRef: t2, popupTriggerProps: r2, label: n2, isDefaultValue: o2, className: a2, additionalStyles: i2, onClick: l2, onBlur: s2, errorMessage: c2, disableHover: d2 = false }) {
|
|
2662
|
-
const u2 = At(a2 || null, _p, i2, Lp, ca), [h2, g2] = v(true);
|
|
2663
|
-
return S(C, { children: [S("div", { ...u2, onClick: l2, ...r2, onMouseDown: (e3) => {
|
|
2664
|
-
g2(true), t2 && t2.current && e3.target !== t2.current && (e3.preventDefault(), t2.current.focus());
|
|
2665
|
-
}, onFocus: () => {
|
|
2666
|
-
t2 && t2.current && function(e3) {
|
|
2667
|
-
if ("setSelectionRange" in e3) {
|
|
2668
|
-
const t3 = e3.value.length;
|
|
2669
|
-
e3.setSelectionRange(t3, t3);
|
|
2670
|
-
}
|
|
2671
|
-
}(t2.current);
|
|
2672
|
-
}, onBlur: () => {
|
|
2673
|
-
g2(false), s2?.();
|
|
2674
|
-
}, "data-clicked": h2, "data-isdefaultvalue": o2, "data-haserror": void 0 !== c2, "data-disablehover": d2, children: [void 0 !== n2 && k(co, { children: n2 }), e2] }), c2 && k(Op, { errorMessage: c2 })] });
|
|
2675
|
-
}
|
|
2676
|
-
const { formContext: Wp, fieldContext: Bp, useFieldContext: Hp, useFormContext: zp } = fe(), Vp = ft({ backgroundColor: "surface.foreground.disabled", pointerEvents: "none", border: "{borderWidths.lg} solid", borderColor: "border.layout.strong" }), jp = wt({ base: { backgroundColor: "surface.foreground", border: "{borderWidths.lg} solid", borderColor: "border.layout.strong" }, variants: { kind: { text: { cursor: "text" }, button: { cursor: "pointer" }, container: { cursor: "default" } } } });
|
|
2677
|
-
function qp({ kind: e2, label: t2, children: r2, inputRef: n2, disabled: o2, popupTriggerProps: a2, onClick: i2, disableHover: l2 = false }) {
|
|
2678
|
-
const s2 = Hp(), c2 = ye(s2.store, (e3) => e3.meta.errors[0]?.message), d2 = o2 ? Vp : jp({ kind: e2 });
|
|
2679
|
-
return k(Fp, { label: t2, inputRef: n2, popupTriggerProps: a2, className: kt["editable-form-input"], additionalStyles: d2, errorMessage: c2, onBlur: s2.handleBlur, disableHover: l2, onClick: i2, children: r2 });
|
|
2680
|
-
}
|
|
2681
|
-
const Up = At(kt["button-secondary"], ft({ color: "typography.intent.primary", border: "{borderWidths.md} solid", borderColor: "border.intent.primary", backgroundColor: "surface.intent.primary", "& .Tight-text": { color: "typography.intent.primary" }, "& path": { stroke: "icon.intent.primary" }, _supportHover: { _notDisabled: { backgroundColor: "surface.intent.primary.hover", borderColor: "border.intent.primary.hover", "& .Tight-text": { color: "typography.intent.primary.hover" }, "& path": { stroke: "icon.intent.primary.hover" } } }, "&:active:enabled, &[data-active='true']:enabled": { backgroundColor: "surface.intent.primary.active", borderColor: "border.intent.primary.active", "& .Tight-text": { color: "typography.intent.primary.active" }, "& path": { stroke: "icon.intent.primary.active" } } }));
|
|
2682
|
-
function Kp({ children: e2, stylists: t2 = [], ...r2 }) {
|
|
2683
|
-
return k(Oi, { stylists: [Up, ...t2], ...r2, children: e2 });
|
|
2684
|
-
}
|
|
2685
|
-
const $p = [At(null, ft({ "& path": { stroke: "surface.foreground" } }))];
|
|
2686
|
-
function Yp({ onClick: e2 }) {
|
|
2687
|
-
return S(Kp, { size: "small", onClick: (t2) => {
|
|
2688
|
-
t2.stopPropagation(), t2.preventDefault(), e2();
|
|
2689
|
-
}, children: [k(ga, { stylists: $p, Component: ph }), k(co, { intent: "primary", children: "Add Split" })] });
|
|
2690
|
-
}
|
|
2691
|
-
const Gp = At(null, ft({ display: "flex", flexDirection: "row", alignItems: "center", gap: "10px", outline: "none", border: "none", background: "none", height: "39px", padding: 0 }));
|
|
2692
|
-
const Qp = ft({ border: "{borderWidths.lg} solid transparent", "&:focus-within, &[data-isdefaultvalue='false']": { backgroundColor: "surface.foreground", border: "{borderWidths.lg} solid", borderColor: "border.layout.strong" }, "&:focus-within": { cursor: "text" } });
|
|
2693
|
-
function Xp({ children: e2, inputRef: t2, popupTriggerProps: r2, label: n2, onClick: o2 }) {
|
|
2694
|
-
const a2 = Hp(), i2 = ye(a2.store, (e3) => e3.meta.errors[0]?.message), l2 = ye(a2.store, (e3) => e3.meta.isDefaultValue);
|
|
2695
|
-
return k(Fp, { label: n2, inputRef: t2, popupTriggerProps: r2, isDefaultValue: l2, className: kt["discrete-form-input"], additionalStyles: Qp, errorMessage: i2, onClick: o2, onBlur: a2.handleBlur, children: e2 });
|
|
2696
|
-
}
|
|
2697
|
-
const Zp = At(null, ft({ display: "flex", flexDirection: "column", maxHeight: "200px", overflowY: "auto", minWidth: "120px" }));
|
|
2698
|
-
function Jp({ options: e2, onSelect: t2, selectedLabel: r2 }) {
|
|
2699
|
-
const n2 = ll();
|
|
2700
|
-
return k("div", { ...Zp, children: e2.map((e3) => k(Tl, { onClick: () => {
|
|
2701
|
-
return r3 = Number(e3.value), n2?.setOpen(false), void t2(r3);
|
|
2702
|
-
var r3;
|
|
2703
|
-
}, active: r2 === e3.label, children: e3.label }, e3.value)) });
|
|
2704
|
-
}
|
|
2705
|
-
const ev = At(null, ft({ cursor: "pointer", display: "flex", alignItems: "center", justifyContent: "space-between", padding: "8px", borderRadius: "sm", gap: "7px", backgroundColor: "surface.intent.action.discrete", border: "{borderWidths.lg} solid transparent", _supportHover: { backgroundColor: "surface.intent.action.discrete.hover", border: "{borderWidths.lg} solid", borderColor: "border.intent.action.hover" } }), sa);
|
|
2706
|
-
function tv({ selectedLabel: e2, options: t2, onSelect: r2 }) {
|
|
2707
|
-
return S(il, { placement: "bottom-start", children: [k(sl, { children: (t3) => S("div", { ...ev, ...t3, children: [k(lo, { children: e2 }), k(dl, { Component: rg })] }) }), k(fl, { children: k(Jp, { options: t2, onSelect: r2, selectedLabel: e2 }) })] });
|
|
2708
|
-
}
|
|
2709
|
-
const rv = At(null, ft({ display: "flex", alignItems: "center", gap: "15px" })), nv = Kt.map((e2, t2) => ({ value: t2, label: e2 })), ov = $t({}).map((e2) => ({ value: e2, label: String(e2) }));
|
|
2710
|
-
function av({ currentMonthYear: e2, onMonthYearChange: t2 }) {
|
|
2711
|
-
const r2 = e2.getFullYear(), n2 = e2.getMonth(), o2 = (e3, r3) => {
|
|
2712
|
-
const n3 = new Date(e3, r3, 1);
|
|
2713
|
-
t2(n3);
|
|
2714
|
-
};
|
|
2715
|
-
return S("div", { ...rv, children: [k(tv, { selectedLabel: Kt[n2], options: nv, onSelect: (e3) => o2(r2, e3) }), k(tv, { selectedLabel: String(r2), options: ov, onSelect: (e3) => o2(e3, n2) })] });
|
|
2716
|
-
}
|
|
2717
|
-
const iv = At(null, ft({ background: "surface.foreground", padding: "25px", gap: "15px" })), lv = At(null, ft({ display: "flex", justifyContent: "space-between", alignItems: "center", gap: "8px", alignSelf: "stretch", marginBottom: "30px" })), sv = At(null, ft({ backgroundColor: "surface.intent.action.discrete", border: "{borderWidths.lg} solid transparent", padding: "8px", borderRadius: "sm", display: "flex", alignItems: "center", justifyContent: "center", cursor: "pointer", _supportHover: { backgroundColor: "surface.intent.action.discrete.hover", border: "{borderWidths.lg} solid", borderColor: "border.intent.action.hover" }, "&:disabled": { opacity: 0.6, pointerEvents: "none" } }), sa), cv = At(null, ft({ display: "grid", gridTemplateColumns: "repeat(7, 1fr)", gap: "2px 2px" })), dv = At(null, ft({ padding: "8px", textAlign: "center" })), uv = At(null, ft({ backgroundColor: "surface.intent.action.discrete", border: "{borderWidths.lg} solid transparent", padding: "6px", width: "36px", height: "36px", position: "relative", display: "flex", alignItems: "center", justifyContent: "center", borderRadius: "sm", cursor: "pointer", _supportHover: { _notDisabled: { backgroundColor: "surface.intent.action.discrete.hover", border: "{borderWidths.lg} solid", borderColor: "border.intent.action.hover" } }, "&[data-selected='true']": { backgroundColor: "surface.intent.action.discrete.active", border: "{borderWidths.lg} solid", borderColor: "border.intent.action.active" }, "&[data-today='true']::after": { content: "''", position: "absolute", bottom: "3px", width: "4px", height: "4px", borderRadius: "50%", backgroundColor: "brand.primary" }, "&:disabled": { cursor: "default" } }), sa), hv = At(null, ft({ color: "typography.base" }));
|
|
2718
|
-
function gv({ date: e2, selectedDate: t2, currentMonth: r2, onClick: n2, maxDate: o2 }) {
|
|
2719
|
-
const a2 = t2 && Yt(e2, t2), i2 = Gt(e2), l2 = e2.getMonth() !== r2, s2 = !!o2 && Qt(e2, o2);
|
|
2720
|
-
return k("button", { ...uv, onClick: () => n2(e2), "data-selected": a2, "data-today": i2, disabled: s2, children: k(lo, { stylists: l2 || s2 ? [hv] : [], children: e2.getDate().toString() }) });
|
|
2721
|
-
}
|
|
2722
|
-
function pv({ selectedDate: e2, onDateSelect: t2, viewDate: r2, onViewDateChange: n2, maxDate: o2 }) {
|
|
2723
|
-
const a2 = ll(), i2 = r2 || /* @__PURE__ */ new Date(), l2 = i2.getFullYear(), s2 = i2.getMonth(), c2 = function(e3, t3) {
|
|
2724
|
-
const r3 = Bt(e3, t3, 1), n3 = new Date(r3);
|
|
2725
|
-
return n3.setDate(n3.getDate() - r3.getDay()), Array.from({ length: 42 }, (e4, t4) => {
|
|
2726
|
-
const r4 = new Date(n3);
|
|
2727
|
-
return r4.setDate(n3.getDate() + t4), r4;
|
|
2728
|
-
});
|
|
2729
|
-
}(l2, s2), d2 = Pe(c2), u2 = void 0 === o2 || d2 && Qt(o2, d2), h2 = (e3) => {
|
|
2730
|
-
t2(e3), a2.setOpen(false);
|
|
2731
|
-
}, g2 = (e3) => {
|
|
2732
|
-
const t3 = new Date(i2);
|
|
2733
|
-
t3.setMonth(i2.getMonth() + e3), n2(t3);
|
|
2734
|
-
};
|
|
2735
|
-
return S("div", { ...iv, children: [S("div", { ...lv, children: [k("button", { ...sv, onClick: () => g2(-1), children: k(ga, { Component: ia }) }), k(av, { currentMonthYear: i2, onMonthYearChange: n2 }), k("button", { ...sv, onClick: () => g2(1), disabled: !u2, children: k(ga, { Component: la }) })] }), S("div", { ...cv, children: [Ut.map((e3) => k("div", { ...dv, children: k(co, { children: e3 }) }, e3)), c2.map((t3) => k(gv, { date: t3, selectedDate: e2, currentMonth: s2, onClick: h2, maxDate: o2 }, t3.toISOString()))] })] });
|
|
2736
|
-
}
|
|
2737
|
-
const vv = At(null, _t({ body: "default" }), ft({ outline: "none", border: "none", padding: 0, backgroundColor: "transparent", flex: 1, cursor: "pointer", "&:focus": { cursor: "text" } }));
|
|
2738
|
-
const mv = At(null, _t({ body: "default" }), ft({ outline: "none", border: "none", padding: 0, backgroundColor: "transparent", cursor: "text", overflowWrap: "break-word", minWidth: "100%", maxWidth: "100%", "&::placeholder": { color: "typography.base.weak" }, "&:focus": { outline: "none" } }));
|
|
2739
|
-
const bv = At(kt["category-text"], ft({ display: "flex", flexDirection: "row", alignItems: "center", gap: "10px", padding: 0, outline: "none", border: "none", background: "none", borderRadius: "md", color: "typography.intent.action", flex: "1 1 0", minWidth: 0, cursor: "pointer", _supportHover: { color: "typography.intent.action.hover" }, "&:focus-visible": { outline: "4px solid", outlineOffset: "2px", outlineColor: "border.layout" }, "& .Tight-medium-icon > path": { _supportHover: { stroke: "typography.intent.action.hover" } } }), da), fv = At(null, ft({ color: "inherit" }));
|
|
2740
|
-
function yv(e2) {
|
|
2741
|
-
((navigator.userAgent ? navigator.userAgent.toLowerCase().includes("mac") : navigator.platform.toLowerCase().includes("mac")) ? e2.metaKey : e2.ctrlKey) && "Enter" === e2.key && (e2.preventDefault(), e2.currentTarget.requestSubmit());
|
|
2742
|
-
}
|
|
2743
|
-
function Tv(e2) {
|
|
2744
|
-
"Enter" === e2.key && e2.currentTarget.blur();
|
|
2745
|
-
}
|
|
2746
|
-
const xv = At(kt["amount-input"], _t({ body: "default" }), ft({ outline: "none", border: "none", padding: 0, backgroundColor: "transparent", flex: 1, cursor: "pointer", width: "100%", "&:focus": { cursor: "text" } })), wv = At(null, ft({ display: "flex", alignItems: "center", gap: "2px" }));
|
|
2747
|
-
function kv({ value: e2, onChange: t2, inputRef: r2, onClick: n2, onBlur: o2, autofocus: a2 = false }) {
|
|
2748
|
-
return S("div", { ...wv, children: [k(bs, { children: "$" }), k(xe, { ...xv, getInputRef: r2, thousandSeparator: true, decimalScale: 2, value: e2, onValueChange: (e3) => {
|
|
2749
|
-
t2(void 0 === e3.floatValue ? null : e3.floatValue);
|
|
2750
|
-
}, fixedDecimalScale: true, onClick: n2, onBlur: o2, onKeyDown: Tv, autoFocus: a2 })] });
|
|
2751
|
-
}
|
|
2752
|
-
const Cv = At(kt["amount-input-container"], ft({ borderRadius: "md", border: "none", background: "transparent", color: "typography.intent.action", maxWidth: "120px", "&:not(:focus-within)": { _supportHover: { color: "typography.intent.action.hover" } }, "& .Tight-amount-input, & .Tight-text": { color: "inherit" }, "&[data-clicked='true']:focus-within": { outline: "1px solid", outlineOffset: "2px", outlineColor: "border.layout.strong" }, "&[data-clicked='false']:has(:focus-visible)": { outline: "4px solid", outlineOffset: "2px", outlineColor: "border.layout" } }), da);
|
|
2753
|
-
const Sv = s.object({ amount: s.number({ message: "Required" }).refine((e2) => 0 !== e2, { message: "Amount must not be 0" }), date: s.string("Required").refine((e2) => (function(e3, t2) {
|
|
2754
|
-
const r2 = Bt(e3.getFullYear(), e3.getMonth(), e3.getDate()), n2 = Bt(t2.getFullYear(), t2.getMonth(), t2.getDate());
|
|
2755
|
-
return r2.getTime() < n2.getTime();
|
|
2756
|
-
}(new Date(e2), /* @__PURE__ */ new Date()) || Yt(new Date(e2), /* @__PURE__ */ new Date())) && Qt(new Date(e2), /* @__PURE__ */ new Date("2000-01-01")), { message: "Invalid date" }), category: s.object({ id: s.string(), name: s.string().optional() }, { message: "Required" }).nullable(), classSegments: s.array(s.object({ id: s.string(), name: s.string().optional() })), bankAccount: s.object({ id: s.string(), name: s.string().optional() }, { message: "Required" }), glAccount: s.object({ id: s.string(), name: s.string().optional(), accountNo: s.string().optional() }, { message: "Required" }), notes: s.string().nullable(), children: s.array(s.object({ amount: s.number().refine((e2) => 0 !== e2, { message: "Child expense amounts must not be 0" }), category: s.object({ id: s.string(), name: s.string().optional() }, { message: "Required" }), glAccount: s.object({ id: s.string() }, { message: "Required" }), classSegments: s.array(s.object({ id: s.string(), name: s.string().optional() })) })) }), Ev = Sv.extend({}).check((e2) => {
|
|
2757
|
-
const t2 = e2.value?.children?.reduce((e3, t3) => e3 + t3.amount, 0);
|
|
2758
|
-
i(e2.value?.children) || t2 === e2.value.amount || e2.issues.push({ code: "custom", message: "Sum of children amounts must equal total amount", input: e2.value, path: ["children"] });
|
|
2759
|
-
}), Iv = Sv.extend({ matchingBankTransaction: s.object({ id: s.string(), description: s.string().optional(), amount: s.number().optional(), date: s.string().optional(), bankAccountId: s.string().optional(), apiName: s.enum({ BOX: "BOX", CLOVER: "CLOVER", STRIPE: "STRIPE", PLAID: "PLAID", KNOX: "KNOX", UBER: "UBER", FRESHBOOKS: "FRESHBOOKS", HARVEST: "HARVEST", KW: "KW", FRESHBOOKS2: "FRESHBOOKS2", CAPITAL_ONE: "CAPITAL_ONE", SQUARE: "SQUARE", DOTLOOP: "DOTLOOP", REALOGY: "REALOGY", UPWORK: "UPWORK", SHOPIFY: "SHOPIFY", DEDUCTR: "DEDUCTR", ENTERPRISE: "ENTERPRISE", MOXIWORKS: "MOXIWORKS", APPDIRECT: "APPDIRECT", LONEWOLF: "LONEWOLF", LONEWOLF_TRANSACTIONDESK: "LONEWOLF_TRANSACTIONDESK", SAMPLE_BANK: "SAMPLE_BANK", TAXBOT: "TAXBOT", GUSTO: "GUSTO", XERO: "XERO", UNIT: "UNIT", MOOV: "MOOV", QBO: "QBO", QUALPAY: "QUALPAY", BENCH: "BENCH", PARTNER_IMPLEMENTATION: "PARTNER_IMPLEMENTATION", CHECK: "CHECK", RUTTER: "RUTTER", WAVE: "WAVE", MANUAL_ENTRY: "MANUAL_ENTRY", CSV_IMPORT: "CSV_IMPORT" }).optional() }).nullish() }).refine((e2) => {
|
|
2760
|
-
const t2 = e2.matchingBankTransaction?.amount, r2 = e2.amount;
|
|
2761
|
-
return !!ir(t2) || t2 === r2;
|
|
2762
|
-
}, { message: "Transfer amount must equal the matching bank transaction amount", path: ["matchingBankTransaction"], when: (e2) => Iv.pick({ amount: true, matchingBankTransaction: true }).safeParse(e2.value).success }), Pv = (e2) => "MANUAL_ENTRY" === e2.apiName || "CSV_IMPORT" === e2.apiName, Av = (e2) => {
|
|
2763
|
-
const t2 = e2?.description;
|
|
2764
|
-
return `${t2} | ${to(Number(e2?.amount), { dollarSign: true })} | ${Xt(er(e2?.date || ""))}`;
|
|
2765
|
-
}, Dv = At(null, ft({ whiteSpace: "normal" })), Mv = ({ onClick: e2 }) => {
|
|
2766
|
-
const { query: { data: t2 }, isFilling: r2 } = zs(), n2 = t2?.data?.filter((e3) => e3.glAccountId && "ACTIVE" === e3.status), o2 = ll();
|
|
2767
|
-
return k(fl, { children: k(Xd, { children: r2 ? k(au, {}) : n2?.map((t3) => k(eu, { onClick: () => ((t4) => {
|
|
2768
|
-
void 0 !== e2 && e2(t4), o2.setOpen(false);
|
|
2769
|
-
})(t3), children: k(lo, { stylists: [Dv], children: xh(t3?.apiAccountName, t3?.apiAccountNo) }) }, t3?.id)) }) });
|
|
2770
|
-
}, Nv = At(null, ft({ display: "flex", flexDirection: "row", alignItems: "center", gap: "10px", outline: "none", border: "none", background: "none", padding: 0, cursor: "pointer" }));
|
|
2771
|
-
function Rv({ label: e2, disabled: t2, bankAccount: r2, onClick: n2 }) {
|
|
2772
|
-
return S(il, { placement: "bottom-start", children: [k(sl, { children: (n3) => k(qp, { label: e2, popupTriggerProps: n3, disabled: t2, children: k("button", { ...Nv, type: "button", disabled: t2, children: k(lo, { children: xh(r2?.apiAccountName, r2?.apiAccountNo) }) }) }) }), k(Mv, { onClick: n2 })] });
|
|
2773
|
-
}
|
|
2774
|
-
const Ov = { filter: { type: { values: ["BANK_TRANSFER"], operator: "IN" } } }, _v = At(null, ft({ whiteSpace: "normal" }));
|
|
2775
|
-
function Lv({ onClick: e2, transactionId: t2 }) {
|
|
2776
|
-
const { query: { data: r2 }, isFilling: n2 } = gi(Ov), o2 = r2?.data?.filter((e3) => e3.id !== t2), a2 = ll();
|
|
2777
|
-
return k(fl, { children: k(Xd, { children: n2 ? k(au, {}) : o2?.map((t3) => k(eu, { onClick: () => ((t4) => {
|
|
2778
|
-
e2(t4), a2?.setOpen(false);
|
|
2779
|
-
})(t3), children: k(lo, { stylists: [_v], children: Av(t3) }) }, t3.id)) }) });
|
|
2780
|
-
}
|
|
2781
|
-
const Fv = At(null, ft({ display: "flex", flexDirection: "row", alignItems: "center", gap: "10px", outline: "none", border: "none", background: "none", padding: 0, cursor: "pointer" })), Wv = At(null, ft({ color: "typography.base.weak" }));
|
|
2782
|
-
const Bv = Sv.extend({}), Hv = [{ value: "FEDERAL", label: "Federal" }, { value: "STATE", label: "State" }, { value: "SALES", label: "Sales" }], zv = [{ value: "Q1", label: "Q1" }, { value: "Q2", label: "Q2" }, { value: "Q3", label: "Q3" }, { value: "Q4", label: "Q4" }], Vv = ["FEDERAL", "STATE", "SALES"], jv = ["Q1", "Q2", "Q3", "Q4"], qv = Sv.extend({ tax: s.object({ paymentInfo: s.object({ region: s.enum(Vv, { message: `Tax region must be one of: ${Vv.join(", ")}` }), quarter: s.enum(jv, { message: `Tax quarter must be one of: ${jv.join(", ")}` }), year: s.number({ message: "Tax year is required" }) }).nullable() }) }).superRefine((e2, t2) => {
|
|
2783
|
-
e2.tax?.paymentInfo || (t2.addIssue({ path: ["tax", "paymentInfo", "region"], code: "custom", message: `Tax region must be one of: ${Vv.join(", ")}` }), t2.addIssue({ path: ["tax", "paymentInfo", "quarter"], code: "custom", message: `Tax quarter must be one of: ${jv.join(", ")}` }), t2.addIssue({ path: ["tax", "paymentInfo", "year"], code: "custom", message: "Tax year is required" }));
|
|
2784
|
-
}), Uv = At(null, ft({ display: "flex", flexDirection: "row", alignItems: "center", gap: "10px", outline: "none", border: "none", background: "none", height: "39px", padding: 0, cursor: "pointer" }));
|
|
2785
|
-
const Kv = At(null, ft({ display: "grid", textWrap: "nowrap" }));
|
|
2786
|
-
function $v({ children: e2, rows: t2, cols: r2 }) {
|
|
2787
|
-
return k("div", { ...Kv, style: { gridTemplateColumns: `repeat(${r2}, 1fr)`, gridTemplateRows: `repeat(${t2}, 1fr)` }, children: e2 });
|
|
2788
|
-
}
|
|
2789
|
-
const Yv = At(null, ft({ minWidth: 0, "&:focus": { zIndex: 1 } }), Ai, Ii, Pi, sa);
|
|
2790
|
-
function Gv({ option: e2, handleClick: t2, selected: r2 }) {
|
|
2791
|
-
return void 0 === e2 ? null : k("button", { type: "button", ...Yv, onClick: () => t2(e2), "data-active": r2 === e2, children: k(qi, { children: e2.label }) });
|
|
2792
|
-
}
|
|
2793
|
-
function Qv({ options: e2, handleClick: t2, selected: r2, rows: n2, cols: o2 }) {
|
|
2794
|
-
return k($v, { rows: n2, cols: o2, children: e2?.map((e3) => k(Gv, { option: e3, handleClick: t2, selected: r2 }, e3.value)) });
|
|
2795
|
-
}
|
|
2796
|
-
function Xv({ options: e2 }) {
|
|
2797
|
-
const t2 = ll(), r2 = Hp();
|
|
2798
|
-
return k(fl, { children: k(Xd, { children: e2.map((e3) => k(eu, { onClick: () => {
|
|
2799
|
-
r2.handleChange(e3.value), r2.handleBlur(), t2.setOpen(false);
|
|
2800
|
-
}, children: k(qi, { children: e3.label }) }, e3.value)) }) });
|
|
2801
|
-
}
|
|
2802
|
-
const Zv = At(null, ft({ display: "flex", flexDirection: "row", alignItems: "center", gap: "10px", outline: "none", border: "none", background: "none", padding: 0, cursor: "pointer" })), Jv = At(null, ft({ color: "typography.base.weak" }));
|
|
2803
|
-
const em = { amount: null, category: { id: "", name: "" }, bankAccount: { id: "", name: "" }, glAccount: { id: "", name: "", accountNo: "" }, date: "", notes: null, classSegments: [], children: [], matchingBankTransaction: { id: "", description: "", amount: 0, date: "", bankAccountId: "", apiName: void 0 }, tax: { paymentInfo: null } }, { useAppForm: tm, withForm: rm } = Te({ formContext: Wp, fieldContext: Bp, formComponents: { SaveButton: function({ showIcon: e2 = true, textContent: t2 = "Save" }) {
|
|
2804
|
-
return S(bc, { type: "submit", children: [e2 && k(ga, { Component: vd }), k(lo, { children: t2 })] });
|
|
2805
|
-
} }, fieldComponents: { DiscreteAmountField: function({ label: e2 }) {
|
|
2806
|
-
const t2 = d(null), r2 = Hp();
|
|
2807
|
-
return k(Xp, { inputRef: t2, label: e2, children: k(kv, { value: r2.state.value, onChange: r2.handleChange, inputRef: t2 }) });
|
|
2808
|
-
}, ExpenseCategoryField: function({ category: e2, onClick: t2, childrenField: r2, totalAmount: n2, glAccount: o2 }) {
|
|
2809
|
-
const a2 = () => {
|
|
2810
|
-
const t3 = Math.floor(n2 / 2 * 100) / 100, a3 = n2 - t3;
|
|
2811
|
-
r2?.pushValue({ amount: t3, category: e2, classSegments: [], glAccount: o2 }), r2?.pushValue({ amount: a3, category: e2, classSegments: [], glAccount: o2 });
|
|
2812
|
-
};
|
|
2813
|
-
return S(il, { placement: "bottom-start", children: [k(sl, { children: (t3) => S(qp, { label: "Category", popupTriggerProps: t3, children: [S("button", { ...Gp, type: "button", children: [k(gc, { Component: hh(e2?.name) }), k(lo, { children: e2?.name || "Uncategorized" })] }), r2 && k(Yp, { onClick: a2 })] }) }), k(nh, { onClick: t2 })] });
|
|
2814
|
-
}, DateInput: function({ label: e2, maxDate: t2, autofocus: r2 = false, editable: n2 = false }) {
|
|
2815
|
-
const o2 = Hp(), a2 = ye(o2.store, (e3) => e3.meta.isDefaultValue), i2 = d(null), [l2, s2] = v(() => o2.state.value ? er(o2.state.value) : /* @__PURE__ */ new Date()), c2 = o2.state.value ? er(o2.state.value) : null, [u2, h2] = v(""), g2 = (e3) => {
|
|
2816
|
-
const r3 = function(e4) {
|
|
2817
|
-
const t3 = e4.replace(/\D/g, "");
|
|
2818
|
-
return t3.length <= 2 ? t3 : t3.length <= 4 ? `${t3.slice(0, 2)}/${t3.slice(2)}` : `${t3.slice(0, 2)}/${t3.slice(2, 4)}/${t3.slice(4, 8)}`;
|
|
2819
|
-
}(e3.target.value);
|
|
2820
|
-
h2(r3);
|
|
2821
|
-
const n3 = Jt(r3);
|
|
2822
|
-
if (n3) {
|
|
2823
|
-
const e4 = t2 ? Qt(a3 = n3, i3 = t2) ? i3 : a3 : n3;
|
|
2824
|
-
o2.handleChange(tr(e4)), s2(e4);
|
|
2825
|
-
} else o2.handleChange("");
|
|
2826
|
-
var a3, i3;
|
|
2827
|
-
}, p2 = u2 || (c2 ? Xt(c2) : ""), [m2, b2] = v(false), f2 = (e3) => {
|
|
2828
|
-
m2 && (() => {
|
|
2829
|
-
if (t2 && c2 && !a2) {
|
|
2830
|
-
const e4 = Jt(u2);
|
|
2831
|
-
e4 && Qt(e4, t2) && h2(Xt(c2));
|
|
2832
|
-
}
|
|
2833
|
-
})(), b2(e3);
|
|
2834
|
-
}, y2 = (e3) => {
|
|
2835
|
-
"Enter" === e3.key && (e3.preventDefault(), f2(!m2));
|
|
2836
|
-
}, T2 = n2 ? qp : Xp;
|
|
2837
|
-
return S(il, { placement: "bottom-start", onOpenChange: f2, open: m2, children: [k(sl, { children: (t3) => k(T2, { label: e2, inputRef: i2, popupTriggerProps: t3, onClick: () => b2(true), children: k("input", { ...vv, ref: i2, type: "text", id: o2.name, value: p2, onChange: g2, placeholder: "MM/DD/YYYY", maxLength: 10, autoFocus: r2, onKeyDown: y2, autoComplete: "off" }) }) }), k(fl, { initialFocus: false, children: k(pv, { selectedDate: c2, onDateSelect: (e3) => {
|
|
2838
|
-
o2.handleChange(tr(e3)), h2(Xt(e3)), s2(e3);
|
|
2839
|
-
}, viewDate: l2, onViewDateChange: s2, maxDate: t2 }) })] });
|
|
2840
|
-
}, TextAreaInput: function({ label: e2, placeholder: t2, autofocus: r2 = false, resizeable: n2 = true }) {
|
|
2841
|
-
const o2 = Hp(), a2 = d(null);
|
|
2842
|
-
return k(qp, { label: e2, inputRef: a2, children: k("textarea", { ...mv, ref: a2, value: o2.state.value || "", onChange: (e3) => o2.handleChange(e3.target.value), placeholder: t2 ?? "Add note...", rows: 4, style: { resize: n2 ? "both" : "none" }, autoFocus: r2 }) });
|
|
2843
|
-
}, SplitExpenseCategoryField: function({ value: e2, onChange: t2 }) {
|
|
2844
|
-
return S(il, { placement: "bottom-start", children: [k(sl, { children: (t3) => S("button", { ...bv, ...t3, type: "button", children: [k(gc, { Component: hh(e2?.name) }), k(lo, { stylists: [fv], children: e2?.name || "Uncategorized" })] }) }), k(nh, { onClick: t2 })] });
|
|
2845
|
-
}, SplitExpenseAmountField: function({ value: e2, onChange: t2, onBlur: r2 }) {
|
|
2846
|
-
const [n2, o2] = v(false);
|
|
2847
|
-
return k("div", { ...Cv, "data-clicked": n2, children: k(kv, { value: e2, onChange: t2, onClick: () => o2(true), onBlur: () => (o2(false), void r2()) }) });
|
|
2848
|
-
}, BankAccountField: function({ transaction: e2 }) {
|
|
2849
|
-
const { state: { value: t2 }, handleChange: r2 } = Hp(), n2 = js(t2.id), o2 = ir(e2) || !Pv(e2);
|
|
2850
|
-
return k(Rv, { label: "Bank Account", disabled: o2, onClick: (e3) => {
|
|
2851
|
-
r2(((e4) => ({ id: e4.id, name: e4.apiAccountName }))(e3));
|
|
2852
|
-
}, bankAccount: n2 });
|
|
2853
|
-
}, GlAccountField: function() {
|
|
2854
|
-
const e2 = Hp(), t2 = e2.state.value;
|
|
2855
|
-
return S(il, { placement: "bottom-start", children: [k(sl, { children: (e3) => k(qp, { label: "Account", popupTriggerProps: e3, children: k("button", { ...Uv, type: "button", children: k(lo, { children: Wd(t2.accountNo, t2.name) }) }) }) }), k(Ou, { onClick: (t3) => {
|
|
2856
|
-
const r2 = su(t3);
|
|
2857
|
-
e2.handleChange(r2);
|
|
2858
|
-
}, types: iu })] });
|
|
2859
|
-
}, BankGlAccountField: function({ transaction: e2 }) {
|
|
2860
|
-
const { state: { value: t2 }, handleChange: r2 } = Hp(), { query: { data: n2 } } = hu(), { query: { data: o2 } } = (a2 = t2?.id, zs({ select: (e3) => Vs(e3.data, a2) }));
|
|
2861
|
-
var a2;
|
|
2862
|
-
const i2 = e2 ? wh(e2.amount) : "";
|
|
2863
|
-
return k(Rv, { label: i2, onClick: (e3) => {
|
|
2864
|
-
const t3 = ((e4, t4) => e4?.flatMap((e5) => [e5, ...e5.children ?? []]).find((e5) => Number(e5.id?.split("_")[1]) === t4.glAccountId))(n2, e3);
|
|
2865
|
-
t3 && r2(su(t3));
|
|
2866
|
-
}, bankAccount: o2 });
|
|
2867
|
-
}, MatchingBankTransferField: function({ transaction: e2 }) {
|
|
2868
|
-
const t2 = Hp(), r2 = t2.state.value, n2 = r2 ? Av(r2) : "Select", o2 = r2 ? [] : [Wv];
|
|
2869
|
-
return S(il, { placement: "bottom-start", children: [k(sl, { children: (e3) => k(qp, { label: "Matching Bank Transfer", popupTriggerProps: e3, children: k("button", { ...Fv, children: k(lo, { stylists: o2, children: n2 }) }) }) }), k(Lv, { onClick: (e3) => {
|
|
2870
|
-
const r3 = ((e4) => ({ id: e4.id, description: e4?.description, amount: e4?.amount, date: e4?.date, bankAccountId: e4?.bankAccount?.id, apiName: e4?.apiName }))(e3);
|
|
2871
|
-
t2.handleChange(r3), t2.handleBlur();
|
|
2872
|
-
}, transactionId: e2?.id })] });
|
|
2873
|
-
}, ButtonGroupField: function({ label: e2, options: t2 }) {
|
|
2874
|
-
const r2 = Hp(), n2 = t2.find((e3) => e3.value === r2.state.value);
|
|
2875
|
-
return k(qp, { label: e2, disableHover: true, children: k(Qv, { options: t2, selected: n2, handleClick: (e3) => {
|
|
2876
|
-
r2.handleChange(e3.value.toString());
|
|
2877
|
-
}, rows: 1, cols: t2.length }) });
|
|
2878
|
-
}, GenericSelectorField: function({ options: e2, label: t2 }) {
|
|
2879
|
-
const r2 = Hp();
|
|
2880
|
-
return S(il, { placement: "bottom-start", children: [k(sl, { children: (e3) => k(qp, { label: t2, popupTriggerProps: e3, children: k("button", { ...Zv, type: "button", children: r2.state.value ? k(lo, { children: r2.state.value.toString() }) : k(lo, { stylists: [Jv], children: `Select ${t2}...` }) }) }) }), k(Xv, { options: e2 })] });
|
|
2881
|
-
} } });
|
|
2882
|
-
function nm(e2) {
|
|
2883
|
-
const { mutate: t2 } = Bu(), r2 = e2 ? function(e3) {
|
|
2884
|
-
return { amount: Nd(e3.amount), category: e3.category, date: e3.date, bankAccount: e3.bankAccount, glAccount: e3.glAccount, notes: e3.notes, classSegments: e3.classSegments, children: e3.children.map((e4) => ({ amount: Nd(e4.amount), category: e4.category, glAccount: e4.glAccount, classSegments: e4.classSegments })), matchingBankTransaction: e3.matchingBankTransaction, tax: e3.tax };
|
|
2885
|
-
}(e2) : em, n2 = e2 ? function(e3) {
|
|
2886
|
-
switch (e3.type) {
|
|
2887
|
-
case "EXPENSE":
|
|
2888
|
-
return Ev;
|
|
2889
|
-
case "BANK_TRANSFER":
|
|
2890
|
-
return Iv;
|
|
2891
|
-
case "REVENUE":
|
|
2892
|
-
return Bv;
|
|
2893
|
-
case "TAX_PAYMENT":
|
|
2894
|
-
return qv;
|
|
2895
|
-
default:
|
|
2896
|
-
return;
|
|
2897
|
-
}
|
|
2898
|
-
}(e2) : void 0;
|
|
2899
|
-
return tm({ defaultValues: r2, validators: { onBlur: n2 }, onSubmit: (r3) => {
|
|
2900
|
-
var n3, o2;
|
|
2901
|
-
e2 && (t2((n3 = e2.id, o2 = r3.value, { id: n3, amount: o2.amount ? Rd(o2.amount) : 0, categoryId: o2.category?.id, bankAccountId: o2.bankAccount.id, glAccountId: o2.glAccount?.id, date: o2.date, notes: o2.notes, classSegmentIds: o2.classSegments.map((e3) => e3.id), children: o2.children.map((e3) => ({ amount: e3.amount ? Rd(e3.amount) : 0, categoryId: e3.category?.id, glAccountId: e3.glAccount?.id, classSegmentIds: o2.classSegments.map((e4) => e4.id) })), matchingBankTransactionId: o2.matchingBankTransaction?.id, tax: o2.tax })), r3.formApi.reset(r3.value, { keepDefaultValues: true }));
|
|
2902
|
-
}, onSubmitInvalid: () => {
|
|
2903
|
-
} });
|
|
2904
|
-
}
|
|
2905
|
-
const om = aa((e2) => c.createElement("svg", { width: 16, height: 16, viewBox: "0 0 15 15", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e2 }, c.createElement("path", { d: "M10.6196 14.2124H4.3803C4.06894 14.2128 3.7693 14.0937 3.54327 13.8795C3.31724 13.6654 3.18207 13.3726 3.16568 13.0617L2.61591 3.22968H12.384L11.8342 13.0617C11.8179 13.3726 11.6827 13.6654 11.4567 13.8795C11.2306 14.0937 10.931 14.2128 10.6196 14.2124Z", stroke: "#182428", strokeMiterlimit: 10 }), c.createElement("path", { d: "M1.3949 3.22968H13.605", stroke: "#182428", strokeMiterlimit: 10 }), c.createElement("path", { d: "M6.27894 0.787598H8.72097C9.0448 0.787598 9.35537 0.91624 9.58435 1.14522C9.81334 1.37421 9.94198 1.68478 9.94198 2.00861V3.22963H5.05792V2.00861C5.05792 1.68478 5.18656 1.37421 5.41555 1.14522C5.64453 0.91624 5.9551 0.787598 6.27894 0.787598Z", stroke: "#182428", strokeMiterlimit: 10 }), c.createElement("path", { d: "M9.09821 5.05792V12.384", stroke: "#182428", strokeMiterlimit: 10 }), c.createElement("path", { d: "M5.90167 5.05792V12.384", stroke: "#182428", strokeMiterlimit: 10 })), "Delete"), am = At(null, ft({ position: "relative", display: "flex", flexDirection: "row", alignItems: "center", justifyContent: "space-between", outline: "none", border: "none", background: "none", padding: "15px 0px", gap: "15px", width: "100%" })), im = At(null, ft({ backgroundColor: "border.layout", height: "25px", width: "1px", margin: 0 })), lm = At(null, ft({ backgroundColor: "border.layout", height: "1px", width: "100%" })), sm = At(null, ft({ background: "none", border: "none", outline: "none", marginLeft: "auto", display: "flex", alignItems: "center", justifyContent: "center", padding: "4px", borderRadius: "md", cursor: "pointer", "&:focus-visible": { outline: "4px solid", outlineColor: "border.layout" }, "&:hover": { "& svg": { "& path": { stroke: "icon.accent.danger" } } } }), ua), cm = At(null, ft({ display: "flex", flexDirection: "row", alignItems: "center", gap: "15px" })), dm = rm({ defaultValues: em, props: { index: 0, numRows: 1, removeSplit: () => {
|
|
2906
|
-
} }, render: function({ form: e2, index: t2, numRows: r2, removeSplit: n2 }) {
|
|
2907
|
-
return S(C, { children: [S("div", { ...am, children: [k(e2.AppField, { name: `children[${t2}].category`, children: (e3) => k(e3.SplitExpenseCategoryField, { value: e3.state.value, onChange: e3.handleChange }) }), S("div", { ...cm, children: [k("div", { ...im }), k(e2.AppField, { name: `children[${t2}].amount`, children: (e3) => k(e3.SplitExpenseAmountField, { value: e3.state.value, onChange: e3.handleChange, onBlur: e3.handleBlur }) }), k("button", { onClick: () => n2(t2), ...sm, children: k(gc, { Component: om }) })] })] }), t2 < r2 - 1 && k("div", { ...lm })] });
|
|
2908
|
-
} }), um = At(null, ft({ display: "flex", flexDirection: "column", alignItems: "flex-start", outline: "none", border: "none", background: "none" })), hm = ft({ backgroundColor: "surface.foreground", border: "{borderWidths.lg} solid", borderRadius: "md", borderColor: "border.layout.strong", display: "flex", flexDirection: "column", padding: "12px 16px", cursor: "pointer", outline: "none" }), gm = ft({ borderColor: "border.intent.danger" }), pm = rm({ defaultValues: em, render: function({ form: e2 }) {
|
|
2909
|
-
const t2 = ye(e2.store, (e3) => {
|
|
2910
|
-
const t3 = e3.errors?.[0] ?? {}, r3 = Object.values(t3).flat().filter((e4) => "object" == typeof e4 && null !== e4 && "message" in e4);
|
|
2911
|
-
return r3[0]?.message;
|
|
2912
|
-
}), r2 = At(null, hm, t2 ? gm : void 0);
|
|
2913
|
-
return S(C, { children: [S("div", { ...r2, children: [k(co, { children: "Category" }), k(e2.AppField, { name: "children", mode: "array", children: (t3) => {
|
|
2914
|
-
const r3 = (r4) => {
|
|
2915
|
-
t3.removeValue(r4), 1 === t3.state.value.length && (e2.setFieldValue("category", t3.state.value[0].category), t3.removeValue(0)), e2.validate("blur");
|
|
2916
|
-
};
|
|
2917
|
-
return S("div", { ...um, children: [t3.state.value.map((n2, o2) => k(dm, { form: e2, index: o2, numRows: t3.state.value.length, removeSplit: r3 }, `${n2?.category?.id}-${o2}`)), k(Yp, { onClick: () => {
|
|
2918
|
-
const e3 = Pe(t3.state.value)?.category, r4 = Pe(t3.state.value)?.classSegments, n2 = Pe(t3.state.value)?.glAccount;
|
|
2919
|
-
t3.pushValue({ amount: 0, category: e3 || { id: "", name: "" }, glAccount: n2 || { id: "" }, classSegments: r4 || [] });
|
|
2920
|
-
} })] });
|
|
2921
|
-
} })] }), t2 && k(Op, { errorMessage: t2 })] });
|
|
2922
|
-
} }), vm = rm({ defaultValues: em, render: function({ form: e2 }) {
|
|
2923
|
-
const t2 = ye(e2.store, (e3) => e3.values.amount) ?? 0;
|
|
2924
|
-
return k(e2.Subscribe, { selector: (e3) => e3.values.children, children: (r2) => Array.isArray(r2) && 0 !== r2.length ? k(pm, { form: e2 }) : k(e2.AppField, { name: "children", mode: "array", children: (r3) => k(e2.AppField, { name: "category", children: (n2) => k(n2.ExpenseCategoryField, { category: n2.state.value, glAccount: e2.state.values.glAccount, onClick: n2.handleChange, childrenField: r3, totalAmount: t2 }) }) }) });
|
|
2925
|
-
} }), mm = At(null, ft({ position: "absolute", right: 0, top: 0, left: { base: 0, sm: "auto" }, bottom: { base: 0, sm: "auto" }, height: "100%", maxHeight: "100%", maxWidth: "100%", backgroundColor: "surface.background", width: { base: "100%", sm: "512px" }, minWidth: { base: "100%", sm: "fit-content" }, display: "flex", _focus: { outline: "none" } }));
|
|
2926
|
-
function bm({ children: e2 }) {
|
|
2927
|
-
const t2 = d(null);
|
|
2928
|
-
return b(() => {
|
|
2929
|
-
t2.current?.focus();
|
|
2930
|
-
}, []), k("div", { ref: t2, tabIndex: -1, ...mm, children: e2 });
|
|
2931
|
-
}
|
|
2932
|
-
const fm = At(null, ft({ display: "flex", backgroundColor: "surface.foreground", flexDirection: "column", height: "100%", maxHeight: "100%", overflowY: "auto", overflowX: "hidden", minWidth: "fit-content", borderLeft: "1px solid {colors.border.layout.strong}", justifyContent: "flex-start", alignItems: "center", padding: 5, gap: "10px" }));
|
|
2933
|
-
function ym({ children: e2 }) {
|
|
2934
|
-
return k("div", { tabIndex: -1, ...fm, children: e2 });
|
|
2935
|
-
}
|
|
2936
|
-
function Tm({ active: e2, icon: t2, onClick: r2, ariaLabel: n2 }) {
|
|
2937
|
-
return k(El, { ariaLabel: n2, onClick: r2, active: e2, children: k(Xl, { Component: t2 }) });
|
|
2938
|
-
}
|
|
2939
|
-
const xm = At(null, ft({ display: "flex", height: "100%", maxHeight: "100%", minHeight: 0, flexDirection: "column", minWidth: { base: "100%", sm: "512px" }, flexGrow: 1, overflow: "hidden" }));
|
|
2940
|
-
function wm({ children: e2 }) {
|
|
2941
|
-
return k("div", { ...xm, children: e2 });
|
|
2942
|
-
}
|
|
2943
|
-
const km = Object.freeze({ thumbs_up: "👍", thumbs_down: "👎", red_heart: "❤️", hundred_points: "💯", eyes: "👀" });
|
|
2944
|
-
function Cm(e2) {
|
|
2945
|
-
return void 0 !== km[e2];
|
|
2946
|
-
}
|
|
2947
|
-
function Sm(e2) {
|
|
2948
|
-
return km[e2];
|
|
2949
|
-
}
|
|
2950
|
-
const Em = aa((e2) => c.createElement("svg", { id: "Layer_1", "data-name": "Layer 1", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", strokeWidth: 1.5, width: 24, height: 24, ...e2 }, c.createElement("defs", null, c.createElement("style", null, ".cls-63ce7444ea57ea6c838005ed-1{fill:none;stroke:currentColor;stroke-miterlimit:10;}")), c.createElement("path", { className: "cls-63ce7444ea57ea6c838005ed-1", d: "M6.27,21.55H8.5l2.33.95h7.92a2.86,2.86,0,0,0,2.85-2.59l.88-9.13c0-.14,0-.28,0-.42h0a2.18,2.18,0,0,0-2.18-2.18H15.63l.52-1.09a6.27,6.27,0,0,0,.62-2.73h0A2.86,2.86,0,0,0,13.91,1.5h0A1.9,1.9,0,0,0,12,3.41h0a6,6,0,0,1-1.25,3.66l-2.33,3H6.27" }), c.createElement("rect", { className: "cls-63ce7444ea57ea6c838005ed-1", x: 1.5, y: 9.14, width: 4.77, height: 13.36 })), "ThumbsUp"), Im = ft({ fontSize: "26px", lineHeight: "26px", width: "26px", userSelect: "none" });
|
|
2951
|
-
function Pm({ cldrShortName: e2 }) {
|
|
2952
|
-
return k("div", { className: Im, children: Sm(e2) });
|
|
2953
|
-
}
|
|
2954
|
-
const Am = wt({ base: { padding: 0, border: "none", outline: "none" }, variants: { type: { sent: { cursor: "default" }, received: { cursor: "pointer" } } } }), Dm = ft({ display: "flex", gap: "4px", backgroundColor: "surface.elevated", borderRadius: "sm", borderWidth: "sm", borderColor: "border.layout", borderStyle: "solid", padding: "4px 8px", alignItems: "center", justifyContent: "center", scrollbar: "hidden", overflow: "hidden" });
|
|
2955
|
-
function Mm({ reactions: e2, type: t2, handleClick: r2 }) {
|
|
2956
|
-
return k("div", { className: Dm, children: e2.map((e3, n2) => k("button", { className: Am({ type: t2 }), onClick: "received" === t2 ? () => r2(e3.emojiCode) : void 0, children: k(Pm, { cldrShortName: e3.emojiCode }) }, `${e3.emojiCode}_${n2}`)) });
|
|
2957
|
-
}
|
|
2958
|
-
const Nm = async ({ data: e2, accessToken: t2, environment: r2 }) => {
|
|
2959
|
-
const { id: n2, emojiCode: o2 } = e2, a2 = { path: "/v6/messages/{id}/reactions/{emojiCode}", pathParams: { id: n2, emojiCode: o2 }, accessToken: t2, endpointManager: ea(r2) };
|
|
2960
|
-
return await fn(a2);
|
|
2961
|
-
}, Rm = async ({ data: e2, accessToken: t2, environment: r2 }) => {
|
|
2962
|
-
const { id: n2, emojiCode: o2 } = e2, a2 = { path: "/v6/messages/{id}/reactions/{emojiCode}", pathParams: { id: n2, emojiCode: o2 }, accessToken: t2, endpointManager: ea(r2) };
|
|
2963
|
-
return await async function(e3) {
|
|
2964
|
-
return Ds(e3);
|
|
2965
|
-
}(a2);
|
|
2966
|
-
};
|
|
2967
|
-
function Om(e2, t2, r2) {
|
|
2968
|
-
return or(yi.of({ id: e2 }), t2, r2);
|
|
2969
|
-
}
|
|
2970
|
-
async function _m(e2) {
|
|
2971
|
-
const t2 = yi.of({ id: e2 });
|
|
2972
|
-
return en("mutation successful, invalidating messages queries"), pr.invalidateQueries({ queryKey: t2 }).catch((e3) => tn({ error: e3, severity: "error" }));
|
|
2973
|
-
}
|
|
2974
|
-
function Lm(e2, t2, r2) {
|
|
2975
|
-
const n2 = [...e2];
|
|
2976
|
-
return n2[r2] = t2, n2;
|
|
2977
|
-
}
|
|
2978
|
-
function Fm(e2) {
|
|
2979
|
-
const { userId: t2, userEmail: r2 } = g(Rl), n2 = { mutationFn: Nm, onMutateFn: ({ data: n3, accessToken: o2, environment: a2 }) => {
|
|
2980
|
-
if (void 0 !== t2) return async function({ data: e3, accessToken: t3, conversationId: r3, environment: n4, userId: o3, userEmail: a3 }) {
|
|
2981
|
-
const i2 = Om(r3, t3, n4);
|
|
2982
|
-
await pr.cancelQueries({ queryKey: i2 });
|
|
2983
|
-
const l2 = pr.getQueryData(i2);
|
|
2984
|
-
return pr.setQueryData(i2, (t4) => {
|
|
2985
|
-
const r4 = t4.findIndex((t5) => t5.id === e3.id);
|
|
2986
|
-
if (-1 === r4) return t4;
|
|
2987
|
-
const n5 = function(e4, t5, r5, n6) {
|
|
2988
|
-
return { ...e4, reactions: [...e4.reactions, { emojiCode: t5.emojiCode, authorInfo: [{ userId: r5, email: n6 }] }] };
|
|
2989
|
-
}(t4[r4], e3, o3, a3);
|
|
2990
|
-
return Lm(t4, n5, r4);
|
|
2991
|
-
}), { oldMessages: l2 };
|
|
2992
|
-
}({ data: n3, accessToken: o2, conversationId: e2, environment: a2, userId: t2, userEmail: r2 });
|
|
2993
|
-
}, onSettled: () => _m(e2) };
|
|
2994
|
-
return Ms(n2);
|
|
2995
|
-
}
|
|
2996
|
-
function Wm(e2) {
|
|
2997
|
-
const { userId: t2 } = g(Rl);
|
|
2998
|
-
return Ms({ mutationFn: Rm, onMutateFn: ({ data: r2, accessToken: n2, environment: o2 }) => {
|
|
2999
|
-
if (void 0 !== t2) return async function({ data: e3, accessToken: t3, conversationId: r3, environment: n3, userId: o3 }) {
|
|
3000
|
-
const a2 = Om(r3, t3, n3);
|
|
3001
|
-
await pr.cancelQueries({ queryKey: a2 });
|
|
3002
|
-
const i2 = pr.getQueryData(a2);
|
|
3003
|
-
return pr.setQueryData(a2, (t4) => {
|
|
3004
|
-
const r4 = t4.findIndex((t5) => t5.id === e3.id), n4 = t4[r4];
|
|
3005
|
-
if (ir(n4) || 0 === n4.reactions.length) return t4;
|
|
3006
|
-
const a3 = function(e4, t5, r5) {
|
|
3007
|
-
const n5 = e4.reactions.filter((e5) => e5.emojiCode !== t5 || !e5.authorInfo.some((e6) => e6.userId === r5));
|
|
3008
|
-
return { ...e4, reactions: n5 };
|
|
3009
|
-
}(n4, e3.emojiCode, o3);
|
|
3010
|
-
return Lm(t4, a3, r4);
|
|
3011
|
-
}), { oldMessages: i2 };
|
|
3012
|
-
}({ data: r2, accessToken: n2, conversationId: e2, environment: o2, userId: t2 });
|
|
3013
|
-
}, onSettled: () => _m(e2) });
|
|
3014
|
-
}
|
|
3015
|
-
const Bm = ft({ backgroundColor: "surface.elevated", borderRadius: "sm", borderWidth: "sm", borderColor: "border.layout", borderStyle: "solid", display: "flex", justifyContent: "center", alignItems: "center", padding: "8px", cursor: "pointer" }), Hm = Object.keys(km).filter(Cm).map((e2) => ({ emojiCode: e2, authorInfo: [] }));
|
|
3016
|
-
function zm({ conversationId: e2, messageId: t2, type: r2, reactions: n2, reactionIsOpen: o2, setReactionIsOpen: a2 }) {
|
|
3017
|
-
const { userId: i2 } = g(Rl), { mutate: l2 } = Fm(e2);
|
|
3018
|
-
return S(il, { placement: "top-end", open: o2, onOpenChange: a2, blockInteraction: true, children: [k(sl, { children: (e3) => k("button", { className: Bm, ...e3, children: k(gc, { Component: Em }) }) }), k(fl, { type: "reaction", children: k(Mm, { reactions: Hm, type: r2, handleClick: (e3) => {
|
|
3019
|
-
n2.some((t3) => {
|
|
3020
|
-
const r3 = t3.emojiCode === e3, n3 = t3.authorInfo.some((e4) => e4.userId === i2);
|
|
3021
|
-
return r3 && n3;
|
|
3022
|
-
}) || (l2({ id: t2, emojiCode: e3 }), a2(false));
|
|
3023
|
-
} }) })] });
|
|
3024
|
-
}
|
|
3025
|
-
function Vm(e2) {
|
|
3026
|
-
const [t2, r2] = v(false), [n2, o2] = v(false);
|
|
3027
|
-
return function(e3, t3, r3, n3) {
|
|
3028
|
-
b(() => {
|
|
3029
|
-
if (null === e3.current || !t3 || n3) return;
|
|
3030
|
-
const o3 = e3.current, a2 = (e4) => {
|
|
3031
|
-
e4.target === o3 || o3.contains(e4.target) || r3(false);
|
|
3032
|
-
};
|
|
3033
|
-
return window.addEventListener("mousemove", a2), () => {
|
|
3034
|
-
window.removeEventListener("mousemove", a2);
|
|
3035
|
-
};
|
|
3036
|
-
}, [t3, e3, n3, r3]);
|
|
3037
|
-
}(e2, t2, r2, n2), { isHover: t2, reactionIsOpen: n2, setIsHover: r2, setReactionIsOpen: o2 };
|
|
3038
|
-
}
|
|
3039
|
-
const jm = "data-hasscrolled";
|
|
3040
|
-
function qm(e2) {
|
|
3041
|
-
null !== e2.current && (e2.current.scrollIntoView({ behavior: "instant" }), e2.current.setAttribute(jm, "true"));
|
|
3042
|
-
}
|
|
3043
|
-
function Um(e2, t2, r2) {
|
|
3044
|
-
b(() => {
|
|
3045
|
-
const n2 = e2.current;
|
|
3046
|
-
if (null !== n2) {
|
|
3047
|
-
let e3 = n2.scrollTop, o2 = Date.now();
|
|
3048
|
-
const a2 = () => {
|
|
3049
|
-
if (t2) {
|
|
3050
|
-
const { scrollVelocity: t3, currentScrollTop: a3, currentTime: i2 } = function(e4, t4, r3) {
|
|
3051
|
-
const n3 = e4.scrollTop, o3 = Date.now(), a4 = Math.abs(n3 - t4), i3 = o3 - r3;
|
|
3052
|
-
return { scrollVelocity: i3 > 0 ? a4 / i3 : 0, currentScrollTop: n3, currentTime: o3 };
|
|
3053
|
-
}(n2, e3, o2);
|
|
3054
|
-
t3 > 5 && r2(), e3 = a3, o2 = i2;
|
|
3055
|
-
}
|
|
3056
|
-
};
|
|
3057
|
-
return n2.addEventListener("scroll", a2), () => {
|
|
3058
|
-
n2.removeEventListener("scroll", a2);
|
|
3059
|
-
};
|
|
3060
|
-
}
|
|
3061
|
-
}, [t2, r2, e2]);
|
|
3062
|
-
}
|
|
3063
|
-
const Km = wt({ base: { position: "absolute", bottom: "-25px" }, variants: { type: { sent: { right: "2px" }, received: { left: "2px" } } } });
|
|
3064
|
-
function $m({ reactions: e2, type: t2, handleClick: r2 }) {
|
|
3065
|
-
const n2 = Km({ type: t2 });
|
|
3066
|
-
return k("div", { className: n2, children: k(Mm, { reactions: e2, handleClick: r2, type: t2 }) });
|
|
3067
|
-
}
|
|
3068
|
-
const Ym = wt({ base: { display: "flex", alignItems: "center", gap: "10px" }, variants: { type: { sent: { flexDirection: "row-reverse" }, received: { flexDirection: "row" } }, hasReactionsOnMessage: { true: { marginBottom: "18px" } } } }), Gm = wt({ base: { position: "static", display: "flex", maxWidth: 325, padding: "12px 16px", flexDirection: "column", alignItems: "flex-start", borderRadius: "md", borderWidth: 1, borderStyle: "solid", flexShrink: 1, overflow: "wrap", wordBreak: "break-word", whiteSpace: "pre-wrap" }, variants: { type: { sent: { color: "typography.intent.primary", borderColor: "border.intent.primary", backgroundColor: "surface.intent.primary" }, received: { color: "typography.base", borderColor: "border.layout", backgroundColor: "surface.foreground" } } } }), Qm = ft({ position: "relative", display: "flex", flexDirection: "column" });
|
|
3069
|
-
function Xm({ conversationId: e2, messageId: t2, sentByCurrentUser: r2, children: n2, reactions: o2 = [] }) {
|
|
3070
|
-
const a2 = d(null), { isHover: i2, setIsHover: l2, reactionIsOpen: s2, setReactionIsOpen: c2 } = Vm(a2), { mutate: u2 } = Wm(e2), h2 = r2 ? "sent" : "received", g2 = o2.filter((e3) => Cm(e3.emojiCode)), p2 = g2.length > 0;
|
|
3071
|
-
return S("div", { className: Ym({ type: h2, hasReactionsOnMessage: p2 }), ref: a2, onMouseEnter: () => "received" === h2 && l2(true), children: [S("div", { className: Qm, children: [k("div", { className: Gm({ type: h2 }), children: n2 }), p2 && k($m, { reactions: g2, type: h2, handleClick: (e3) => u2({ id: t2, emojiCode: e3 }) })] }), i2 && k(zm, { conversationId: e2, messageId: t2, type: h2, reactions: g2, reactionIsOpen: s2, setReactionIsOpen: c2 })] });
|
|
3072
|
-
}
|
|
3073
|
-
const Zm = At(null, ft({ display: "flex", flexDirection: "column-reverse", justifyContent: "center", gap: "10px", alignSelf: "stretch" }));
|
|
3074
|
-
function Jm({ children: e2 }) {
|
|
3075
|
-
return k("div", { ...Zm, children: e2 });
|
|
3076
|
-
}
|
|
3077
|
-
const eb = At(null, ft({ display: "flex", flexDirection: "column-reverse", alignItems: "flex-start", gap: "26px", flex: "1 1 0%", alignSelf: "stretch", overflowY: "auto", overflowX: "hidden", flexFlow: "column", padding: 15, scrollbarWidth: "thin", maxHeight: "calc(100% + 15px)", marginBottom: "-15px" })), tb = ft({ minHeight: 1, width: "100%" }), rb = y(function({ children: e2, activeKeyboard: t2, setActiveKeyboard: r2, inputRef: n2 }, o2) {
|
|
3078
|
-
const a2 = d(null);
|
|
3079
|
-
t2 && n2?.current?.focus();
|
|
3080
|
-
const i2 = m(() => {
|
|
3081
|
-
t2 && lr(n2?.current) && (r2(false), n2.current.blur());
|
|
3082
|
-
}, [t2, n2, r2]);
|
|
3083
|
-
return Um(a2, t2, i2), S("div", { tabIndex: -1, ...eb, ref: a2, children: [k("div", { className: tb, ref: o2 }), e2] });
|
|
3084
|
-
}), nb = s.object({ message: s.string().refine((e2) => "" !== e2, { message: "Required" }) }), ob = ft.raw({ maxHeight: 150, maxWidth: "100%", whiteSpace: "pre-wrap", overflowWrap: "break-word", width: "100%", boxSizing: "border-box", margin: 0, padding: 0, fontFamily: "body" }), ab = ft.raw({ visibility: "hidden", fontSizeAdjust: "none", fontSize: "100%", fontStyle: "normal", letterSpacing: "normal", fontStretch: "normal", fontVariant: "normal", fontWeight: "normal", textAlign: "left", textAlignLast: "initial", textDecoration: "none", textEmphasis: "none", textIndent: "0px", textJustify: "auto", textShadow: "none", textTransform: "none" }), ib = ft(ab, ob), lb = ft.raw({ resize: "none", inset: 0, outline: "none", overflow: "auto", position: "absolute", appearance: "none", border: "none", backgroundColor: "transparent", fontSize: "16px" }), sb = ft(lb, ob, _t.raw({ body: "default" })), cb = ft({ display: "block", width: "100%" }), db = ft({ position: "relative" }), ub = ft({ display: "flex", justifyContent: "flex-end" }), hb = ft({ paddingInline: "8px", display: "flex", alignItems: "start", justifyContent: "center" }), gb = y(function({ blockSubmit: e2 = false, scrollRef: t2, setActiveKeyboard: r2 }, n2) {
|
|
3085
|
-
const o2 = Hp(), a2 = d(null), { startCallback: i2 } = Ra({ delay: 50, callback: (e3) => r2(e3) });
|
|
3086
|
-
w(n2, () => a2.current);
|
|
3087
|
-
const l2 = !e2 && nb.safeParse(o2.form.state.values).success;
|
|
3088
|
-
return k(qp, { kind: "text", inputRef: a2, disableHover: true, onClick: () => (qm(t2), void i2(true)), children: S("div", { className: cb, children: [S("div", { className: db, children: [S("pre", { className: ib, children: [o2.state.value, k("br", {})] }), k("textarea", { ref: a2, placeholder: "Message...", value: o2.state.value, className: sb, onChange: (e3) => o2.handleChange(e3.target.value) })] }), k("div", { className: ub, children: k(Li, { disabled: !l2, type: "submit", children: k("span", { className: hb, children: k(gc, { Component: Zl }) }) }) })] }) });
|
|
3089
|
-
}), pb = Object.freeze({ message: "" }), { useAppForm: vb } = Te({ formContext: Wp, fieldContext: Bp, formComponents: {}, fieldComponents: { MessageAreaInput: gb } });
|
|
3090
|
-
const mb = ft({ width: "100%" });
|
|
3091
|
-
function bb({ conversationId: e2, addMessage: t2, blockSubmit: r2, isMobile: n2, scrollRef: o2, setActiveKeyboard: a2, inputRef: i2 }) {
|
|
3092
|
-
const { form: l2 } = function({ onSubmit: e3 }) {
|
|
3093
|
-
return { form: vb({ defaultValues: pb, onSubmit: (t3) => {
|
|
3094
|
-
nb.safeParse(t3.value).success && (e3(t3), t3.formApi.reset());
|
|
3095
|
-
} }) };
|
|
3096
|
-
}({ onSubmit: t2 }), s2 = d(null);
|
|
3097
|
-
return k("form", { className: mb, ref: s2, onKeyDown: (e3) => function(e4, t3, r3, n3) {
|
|
3098
|
-
if (!n3 && !e4.shiftKey && "Enter" === e4.key && (e4.preventDefault(), e4.stopPropagation(), null !== t3 && !r3)) {
|
|
3099
|
-
const e5 = new SubmitEvent("submit", { bubbles: true, cancelable: true });
|
|
3100
|
-
t3.dispatchEvent(e5);
|
|
3101
|
-
}
|
|
3102
|
-
}(e3, s2.current, r2, n2), onSubmit: (e3) => {
|
|
3103
|
-
if (!r2) return e3.preventDefault(), e3.stopPropagation(), l2.handleSubmit();
|
|
3104
|
-
}, children: k(l2.AppField, { name: "message", children: (e3) => k(e3.MessageAreaInput, { blockSubmit: r2, scrollRef: o2, setActiveKeyboard: a2, ref: i2 }) }) });
|
|
3105
|
-
}
|
|
3106
|
-
function fb(e2, t2) {
|
|
3107
|
-
return { id: `placeholder_${e2.conversationId}_${Date.now()}`, conversationId: e2.conversationId, author: { userId: t2 ?? "placeholderUserId", email: "placeholderEmail" }, status: "ACTIVE", createdDateTime: "", lastUpdatedDateTime: "", text: e2.text, reactions: [] };
|
|
3108
|
-
}
|
|
3109
|
-
async function yb() {
|
|
3110
|
-
const e2 = yi.all(), t2 = ta.base(), r2 = Fa.base();
|
|
3111
|
-
return en("mutation successful, invalidating messages queries"), Promise.all([pr.invalidateQueries({ queryKey: e2 }), pr.invalidateQueries({ queryKey: t2 }), pr.invalidateQueries({ queryKey: r2 })]).catch((e3) => tn({ error: e3, severity: "error" }));
|
|
3112
|
-
}
|
|
3113
|
-
function Tb() {
|
|
3114
|
-
const { userId: e2 } = g(Rl), t2 = { mutationFn: wi, onMutateFn: ({ data: t3, accessToken: r2, environment: n2 }) => async function({ data: e3, accessToken: t4, environment: r3, userId: n3 }) {
|
|
3115
|
-
const o2 = or(yi.of({ id: e3.conversationId }), t4, r3);
|
|
3116
|
-
await pr.cancelQueries({ queryKey: o2 });
|
|
3117
|
-
const a2 = pr.getQueryData(o2);
|
|
3118
|
-
return pr.setQueryData(o2, (t5) => [fb(e3, n3), ...t5]), { oldMessages: a2 };
|
|
3119
|
-
}({ data: t3, accessToken: r2, environment: n2, userId: e2 }), onSettled: yb };
|
|
3120
|
-
return Ms(t2);
|
|
3121
|
-
}
|
|
3122
|
-
const xb = wt({ variants: { width: { xs: { width: "30px" }, sm: { width: "60px" }, md: { width: "120px" }, lg: { width: "240px" }, xl: { width: "420px" } }, height: { xs: { height: "5px" }, sm: { height: "10px" }, md: { height: "20px" }, lg: { height: "40px" }, xl: { height: "80px" } } } });
|
|
3123
|
-
function wb({ width: e2 = "md", height: t2 = "md" }) {
|
|
3124
|
-
return k(Lo, { styles: xb({ width: e2, height: t2 }) });
|
|
3125
|
-
}
|
|
3126
|
-
const kb = ft({ display: "flex", flexDirection: "row-reverse" });
|
|
3127
|
-
function Cb() {
|
|
3128
|
-
return S(C, { children: [k(wb, { width: "lg", height: "lg" }), k("div", { className: kb, children: k(wb, { width: "md", height: "lg" }) }), k("div", { className: kb, children: k(wb, { width: "lg", height: "xl" }) }), k(wb, { width: "md", height: "lg" })] });
|
|
3129
|
-
}
|
|
3130
|
-
function Sb({ isConversationLoading: e2, isFilling: t2, message: r2, activeKeyboard: n2, setActiveKeyboard: o2, inputRef: a2, scrollRef: i2 }) {
|
|
3131
|
-
return S(rb, { ref: i2, inputRef: a2, activeKeyboard: n2, setActiveKeyboard: o2, children: [e2 && k(Jm, { children: k(Xm, { conversationId: "", messageId: "", sentByCurrentUser: true, children: r2 }) }), !e2 && t2 && k(Jm, { children: k(Cb, {}) })] });
|
|
3132
|
-
}
|
|
3133
|
-
const Eb = async ({ data: e2, accessToken: t2, environment: r2 }) => (async ({ data: e3, accessToken: t3, environment: r3 }) => Va({ data: { data: e3 }, accessToken: t3, environment: r3 }))({ data: [e2], accessToken: t2, environment: r2 });
|
|
3134
|
-
const Ib = async ({ data: e2, accessToken: t2, environment: r2 }) => Va({ data: { data: [e2] }, accessToken: t2, environment: r2 });
|
|
3135
|
-
const Pb = ft({ minHeight: "{borderWidths.lg}", maxHeight: "{borderWidths.lg}", width: "100%", backgroundColor: "border.layout", flex: "1 1 0", display: "flex" }), Ab = ft({ display: "flex", flexDirection: "row", justifyContent: "space-between", alignItems: "center", width: "100%", gap: 5, paddingLeft: 15, paddingRight: 15 }), Db = ft({ wordBreak: "break-word", maxWidth: 250, textAlign: "center" }), Mb = "Marked As Resolved";
|
|
3136
|
-
function Nb({ resolver: e2 }) {
|
|
3137
|
-
const t2 = e2 ? `${e2} ${Mb}` : Mb;
|
|
3138
|
-
return S("div", { className: Ab, children: [k("div", { className: Pb }), k("div", { className: Db, children: t2 }), k("div", { className: Pb })] });
|
|
3139
|
-
}
|
|
3140
|
-
const Rb = At(null, ft({ display: "flex", alignItems: "center", justifyContent: "center", maxWidth: "100%", minHeight: 0, height: "auto", padding: "0 15px 15px", flexDirection: "column", position: "relative" })), Ob = (e2, t2) => ({ subject: e2.slice(0, 40), status: "ACTIVE", readStatus: "READ", resolutionStatus: "OPEN", ...t2 && { attachedEntityId: t2 }, message: { text: e2 } });
|
|
3141
|
-
function _b({ conversationId: e2, setConversationId: t2, isResolved: r2, isUnread: n2, transactionId: o2, isMobile: a2 = false }) {
|
|
3142
|
-
const { userId: i2 } = g(Rl), { mutate: l2 } = Tb(), { query: { data: s2 }, isFilling: c2 } = function(e3) {
|
|
3143
|
-
const t3 = lr(e3);
|
|
3144
|
-
return br({ queryKey: yi.of({ id: e3 ?? "" }), queryFn: xi, select: Ti, enabled: t3 });
|
|
3145
|
-
}(e2), { mutate: u2, isPending: h2, variables: p2 } = function(e3, t3) {
|
|
3146
|
-
return Ms({ mutationFn: Ib, onSuccess: (r3) => {
|
|
3147
|
-
const n3 = r3.data?.[0]?.data?.id;
|
|
3148
|
-
if (ir(r3) || ir(n3)) return;
|
|
3149
|
-
e3(n3);
|
|
3150
|
-
const o3 = Fa.base(), a3 = ui.all();
|
|
3151
|
-
return en("mutation successful, invalidating conversation, bank transaction, and message queries"), Promise.all([pr.invalidateQueries({ queryKey: o3 }), pr.invalidateQueries({ queryKey: a3 }), (async () => {
|
|
3152
|
-
if (lr(t3)) {
|
|
3153
|
-
const e4 = { id: t3 }, r4 = ui.single(e4);
|
|
3154
|
-
return await pr.invalidateQueries({ queryKey: r4 });
|
|
3155
|
-
}
|
|
3156
|
-
})()]).catch((e4) => tn({ error: e4, severity: "error" }));
|
|
3157
|
-
} });
|
|
3158
|
-
}(t2, o2), { mutate: m2 } = Ms({ mutationFn: Eb, onSuccess: async () => {
|
|
3159
|
-
const e3 = Fa.base(), t3 = ta.base();
|
|
3160
|
-
return en("mutation successful, invalidating conversations queries"), Promise.all([pr.invalidateQueries({ queryKey: e3 }), pr.invalidateQueries({ queryKey: t3 })]).catch((e4) => tn({ error: e4, severity: "error" }));
|
|
3161
|
-
} }), [f2, y2] = v(false), T2 = d(null), x2 = d(null);
|
|
3162
|
-
b(() => {
|
|
3163
|
-
r2 && n2 && e2 && m2({ id: e2, readStatus: "READ" });
|
|
3164
|
-
}, [r2, n2, e2, m2]), b(() => {
|
|
3165
|
-
qm(x2);
|
|
3166
|
-
}, [s2, x2]);
|
|
3167
|
-
const w2 = ir(e2) || ir(s2) || c2;
|
|
3168
|
-
return S(C, { children: [w2 ? k(Sb, { scrollRef: x2, inputRef: T2, isConversationLoading: h2, isFilling: c2, message: p2?.message?.text, activeKeyboard: f2, setActiveKeyboard: y2 }) : S(rb, { ref: x2, activeKeyboard: f2, setActiveKeyboard: y2, inputRef: T2, children: [r2 && k(Nb, { resolver: "Conversation" }), s2.map((t3, r3) => {
|
|
3169
|
-
const n3 = t3[0].author.userId === i2;
|
|
3170
|
-
return k(Jm, { children: t3.map((t4) => k(Xm, { conversationId: e2, messageId: t4.id, sentByCurrentUser: n3, reactions: t4.reactions, children: t4.text }, t4.id)) }, r3);
|
|
3171
|
-
})] }), k("div", { ...Rb, children: k(bb, { scrollRef: x2, inputRef: T2, conversationId: e2, blockSubmit: h2, isMobile: a2, addMessage: ({ value: t3 }) => {
|
|
3172
|
-
if (ir(e2)) {
|
|
3173
|
-
const e3 = Ob(t3.message, o2);
|
|
3174
|
-
u2(e3);
|
|
3175
|
-
} else l2({ conversationId: e2, text: t3.message });
|
|
3176
|
-
}, setActiveKeyboard: y2 }) })] });
|
|
3177
|
-
}
|
|
3178
|
-
const Lb = At(kt["drawer-header"], ft({ display: "flex", flexDirection: "row", justifyContent: "space-between", alignItems: "center", padding: "10px 25px 10px 15px", backgroundColor: "surface.foreground", height: "55px", minHeight: "55px" }));
|
|
3179
|
-
function Fb({ children: e2 }) {
|
|
3180
|
-
return S(C, { children: [k("div", { ...Lb, children: e2 }), k(Xa, { alignment: "horizontal", color: "strong" })] });
|
|
3181
|
-
}
|
|
3182
|
-
function Wb({ conversationId: e2, transactionId: t2 }) {
|
|
3183
|
-
const [r2, n2] = v(e2), { query: { data: o2 } } = za(r2), a2 = "CLOSED" === o2?.resolutionStatus;
|
|
3184
|
-
return S(wm, { children: [k(Fb, {}), k(_b, { conversationId: r2, setConversationId: n2, isResolved: a2, isUnread: "UNREAD" === o2?.readStatus, transactionId: t2 })] });
|
|
3185
|
-
}
|
|
3186
|
-
const Bb = At(null, ft({ display: "flex", flexDirection: "row", maxHeight: "100%", overflow: "hidden", flexShrink: 1, flexGrow: 1 })), Hb = At(null, ft({ display: "flex", flexDirection: "column", flex: 1, backgroundColor: "surface.background", maxHeight: "100%" })), zb = At(kt["transaction-form-body"], ft({ display: "flex", flexDirection: "column", flex: 1, padding: "15px", gap: "8px", overflow: "auto", width: "512px" })), Vb = ft({ maxWidth: 1, width: 1, display: "flex", flexGrow: 1, backgroundColor: "border.layout.strong" }), jb = (e2) => {
|
|
3187
|
-
yv(e2), function(e3) {
|
|
3188
|
-
"Escape" === e3.key && e3.target instanceof HTMLElement && e3.target.blur();
|
|
3189
|
-
}(e2);
|
|
3190
|
-
}, qb = ({ children: e2, onSubmit: t2, Header: r2, initialTab: n2, conversationId: o2, transactionId: a2 }) => {
|
|
3191
|
-
const [i2, l2] = v(n2 ?? null);
|
|
3192
|
-
return k(bm, { children: k(wm, { children: S("div", { ...Bb, children: [S("form", { onSubmit: (e3) => {
|
|
3193
|
-
e3.preventDefault(), t2();
|
|
3194
|
-
}, onKeyDown: jb, ...Hb, children: [r2, k("div", { ...zb, children: e2 })] }), null !== i2 && k("div", { className: Vb }), "conversation" === i2 && k(Wb, { conversationId: o2, transactionId: a2 }), k(ym, { children: k(Tm, { active: "conversation" === i2, onClick: () => {
|
|
3195
|
-
return l2((e3 = "conversation") === i2 ? null : e3);
|
|
3196
|
-
var e3;
|
|
3197
|
-
}, icon: ag, ariaLabel: "conversation-tab" }) })] }) }) });
|
|
3198
|
-
}, Ub = At(null, ft({ display: "flex", flexDirection: "column", margin: "0 0 7px 0", padding: 0, justifyContent: "center", minHeight: "36px", backgroundColor: "surface.background", gap: "4px" })), Kb = At(null, ft({ textWrap: "wrap" }));
|
|
3199
|
-
function $b({ transaction: e2, bankAccount: t2 }) {
|
|
3200
|
-
const r2 = e2 ? e2.description : "", n2 = ir(t2) || ir(e2) ? "" : kh(t2, e2);
|
|
3201
|
-
return S("div", { ...Ub, children: [k(lo, { stylists: [Kb], children: r2 }), t2 && k(co, { children: n2 })] });
|
|
3202
|
-
}
|
|
3203
|
-
const Yb = At(null, ft({ display: "flex", backgroundColor: "surface.intent.action.discrete", border: "none", padding: "6px", margin: 0, borderRadius: "sm", outline: "none", cursor: "pointer", _supportHover: { backgroundColor: "surface.intent.action.discrete.hover" }, "&:focus-visible": { outline: "4px solid", outlineColor: "border.layout" } }), ca);
|
|
3204
|
-
function Gb() {
|
|
3205
|
-
return k("button", { ...Yb, onClick: () => si(), type: "button", children: k(gc, { Component: cl, ...Yb }) });
|
|
3206
|
-
}
|
|
3207
|
-
const Qb = aa((e2) => c.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 15", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e2 }, c.createElement("g", { clipPath: "url(#clip0_9779_2768)" }, c.createElement("path", { d: "M2.70654 9.12132C3.60197 9.12132 4.32787 8.39543 4.32787 7.49999C4.32787 6.60456 3.60197 5.87866 2.70654 5.87866C1.8111 5.87866 1.08521 6.60456 1.08521 7.49999C1.08521 8.39543 1.8111 9.12132 2.70654 9.12132Z", fill: "currentColor" }), c.createElement("path", { d: "M8.32496 9.12132C9.22039 9.12132 9.94629 8.39543 9.94629 7.49999C9.94629 6.60456 9.22039 5.87866 8.32496 5.87866C7.42952 5.87866 6.70363 6.60456 6.70363 7.49999C6.70363 8.39543 7.42952 9.12132 8.32496 9.12132Z", fill: "currentColor" }), c.createElement("path", { d: "M13.9434 9.12132C14.8388 9.12132 15.5647 8.39543 15.5647 7.49999C15.5647 6.60456 14.8388 5.87866 13.9434 5.87866C13.048 5.87866 12.3221 6.60456 12.3221 7.49999C12.3221 8.39543 13.048 9.12132 13.9434 9.12132Z", fill: "currentColor" }))), "Dots");
|
|
3208
|
-
function Xb({ children: e2 }) {
|
|
3209
|
-
return S(il, { placement: "bottom-start", children: [k(sl, { children: (e3) => k(El, { popupTriggerProps: e3, children: k(ga, { Component: Qb }) }) }), k(fl, { children: e2 })] });
|
|
3210
|
-
}
|
|
3211
|
-
const Zb = "ACTIVE", Jb = "INACTIVE";
|
|
3212
|
-
function ef({ transaction: e2 }) {
|
|
3213
|
-
const { mutate: t2 } = Wu(), r2 = () => t2([e2].map((e3) => ({ id: e3.id, status: Jb })));
|
|
3214
|
-
return k(eu, { onClick: () => ((e3) => {
|
|
3215
|
-
wc({ title: "Delete transaction", body: "Are you sure you want to delete this transaction?", buttons: [{ key: "cancel", label: "Cancel" }, { key: "delete", label: "Delete" }] }).then((t3) => {
|
|
3216
|
-
"delete" === t3 && e3();
|
|
3217
|
-
});
|
|
3218
|
-
})(r2), children: k(lo, { children: "Delete" }) });
|
|
3219
|
-
}
|
|
3220
|
-
function tf({ transaction: e2 }) {
|
|
3221
|
-
const { mutate: t2 } = Wu(), r2 = () => {
|
|
3222
|
-
t2([e2].map((e3) => ({ id: e3.id, status: Zb })));
|
|
3223
|
-
};
|
|
3224
|
-
return k(eu, { onClick: () => r2(), children: k(lo, { children: "Restore" }) });
|
|
3225
|
-
}
|
|
3226
|
-
const rf = At(null, ft({ display: "flex", flexDirection: "row", alignItems: "center", gap: "15px", flexShrink: 1 }), Bn);
|
|
3227
|
-
function nf({ children: e2 }) {
|
|
3228
|
-
return k("div", { ...rf, children: e2 });
|
|
3229
|
-
}
|
|
3230
|
-
const of = rm({ defaultValues: em, props: { title: "Transaction", transaction: null }, render: function({ form: e2, title: t2, transaction: r2 }) {
|
|
3231
|
-
return S(Fb, { children: [S(nf, { children: [k(Gb, {}), k(lo, { children: t2 }), k(Xb, { children: S(Xd, { children: [r2?.status === Zb && k(ef, { transaction: r2 }), r2?.status === Jb && k(tf, { transaction: r2 })] }) })] }), k(e2.Subscribe, { selector: (e3) => e3.isDefaultValue, children: (t3) => t3 ? null : k(e2.SaveButton, {}) })] });
|
|
3232
|
-
} });
|
|
3233
|
-
function af({ transactionId: e2 }) {
|
|
3234
|
-
const { query: { data: t2, isFetching: r2 }, isFilling: n2 } = vi({ id: e2 });
|
|
3235
|
-
return { transaction: t2, form: nm(t2), bankAccount: js(t2?.bankAccount.id), showBankAccountField: !ir(t2) && Pv(t2), isLoading: n2 || r2 && !t2 };
|
|
3236
|
-
}
|
|
3237
|
-
function lf({ transactionId: e2, initialTab: t2 }) {
|
|
3238
|
-
const { transaction: r2, form: n2, bankAccount: o2, showBankAccountField: a2, isLoading: i2 } = af({ transactionId: e2 });
|
|
3239
|
-
if (i2) return null;
|
|
3240
|
-
const l2 = k(of, { form: n2, transaction: r2, title: "Expense" }), s2 = r2?.conversation?.id ?? null;
|
|
3241
|
-
return S(qb, { onSubmit: n2.handleSubmit, Header: l2, initialTab: t2, conversationId: s2, transactionId: e2, children: [r2?.description && k($b, { transaction: r2, bankAccount: o2 }), k(n2.AppField, { name: "amount", children: (e3) => k(e3.DiscreteAmountField, { label: "Total" }) }), k(n2.AppField, { name: "date", children: (e3) => k(e3.DateInput, { label: "Transaction Date", maxDate: /* @__PURE__ */ new Date() }) }), k(vm, { form: n2 }), a2 && k(n2.AppField, { name: "bankAccount", children: (e3) => k(e3.BankAccountField, { transaction: r2 }) }), k(n2.AppField, { name: "notes", children: (e3) => k(e3.TextAreaInput, { label: "Note" }) })] });
|
|
3242
|
-
}
|
|
3243
|
-
function sf({ transactionId: e2, initialTab: t2 }) {
|
|
3244
|
-
const { transaction: r2, form: n2, bankAccount: o2, isLoading: a2 } = af({ transactionId: e2 });
|
|
3245
|
-
if (a2) return null;
|
|
3246
|
-
const i2 = k(of, { form: n2, transaction: r2, title: "Bank Transfer" }), l2 = r2?.conversation?.id ?? null;
|
|
3247
|
-
return S(qb, { onSubmit: n2.handleSubmit, Header: i2, initialTab: t2, conversationId: l2, transactionId: e2, children: [r2?.description && k($b, { transaction: r2, bankAccount: o2 }), k(n2.AppField, { name: "amount", children: (e3) => k(e3.DiscreteAmountField, { label: "Total" }) }), k(n2.AppField, { name: "date", children: (e3) => k(e3.DateInput, { label: "Transaction Date", maxDate: /* @__PURE__ */ new Date() }) }), k(n2.AppField, { name: "bankAccount", children: (e3) => k(e3.BankAccountField, { transaction: r2 }) }), k(n2.AppField, { name: "glAccount", children: (e3) => k(e3.BankGlAccountField, { transaction: r2 }) }), k(n2.AppField, { name: "matchingBankTransaction", children: (e3) => k(e3.MatchingBankTransferField, { transaction: r2 }) }), k(n2.AppField, { name: "notes", children: (e3) => k(e3.TextAreaInput, { label: "Note" }) })] });
|
|
3248
|
-
}
|
|
3249
|
-
function cf({ transactionId: e2, initialTab: t2 }) {
|
|
3250
|
-
const { transaction: r2, form: n2, bankAccount: o2, showBankAccountField: a2, isLoading: i2 } = af({ transactionId: e2 });
|
|
3251
|
-
if (i2) return null;
|
|
3252
|
-
const l2 = k(of, { form: n2, transaction: r2, title: "Income" }), s2 = r2?.conversation?.id ?? null;
|
|
3253
|
-
return S(qb, { onSubmit: n2.handleSubmit, Header: l2, initialTab: t2, conversationId: s2, transactionId: e2, children: [r2?.description && k($b, { transaction: r2, bankAccount: o2 }), k(n2.AppField, { name: "amount", children: (e3) => k(e3.DiscreteAmountField, { label: "Total" }) }), k(n2.AppField, { name: "date", children: (e3) => k(e3.DateInput, { label: "Transaction Date", maxDate: /* @__PURE__ */ new Date() }) }), k(n2.AppField, { name: "glAccount", children: (e3) => k(e3.GlAccountField, {}) }), a2 && k(n2.AppField, { name: "bankAccount", children: (e3) => k(e3.BankAccountField, { transaction: r2 }) }), k(n2.AppField, { name: "notes", children: (e3) => k(e3.TextAreaInput, { label: "Note" }) })] });
|
|
3254
|
-
}
|
|
3255
|
-
function df({ transactionId: e2, initialTab: t2 }) {
|
|
3256
|
-
const { transaction: r2, form: n2, bankAccount: o2, showBankAccountField: a2, isLoading: i2 } = af({ transactionId: e2 });
|
|
3257
|
-
if (i2) return null;
|
|
3258
|
-
const l2 = k(of, { form: n2, transaction: r2, title: "Tax Payment" }), s2 = r2?.conversation?.id ?? null;
|
|
3259
|
-
return S(qb, { Header: l2, onSubmit: n2.handleSubmit, initialTab: t2, conversationId: s2, transactionId: e2, children: [r2?.description && k($b, { transaction: r2, bankAccount: o2 }), k(n2.AppField, { name: "amount", children: (e3) => k(e3.DiscreteAmountField, { label: "Total" }) }), k(n2.AppField, { name: "date", children: (e3) => k(e3.DateInput, { label: "Transaction Date", maxDate: /* @__PURE__ */ new Date() }) }), k(n2.AppField, { name: "tax.paymentInfo.region", children: (e3) => k(e3.ButtonGroupField, { label: "Region", options: Hv }) }), k(n2.AppField, { name: "tax.paymentInfo.quarter", children: (e3) => k(e3.ButtonGroupField, { label: "Quarter", options: zv }) }), k(n2.AppField, { name: "tax.paymentInfo.year", children: (e3) => k(e3.GenericSelectorField, { label: "Year", options: $t({ startYear: (/* @__PURE__ */ new Date()).getFullYear() + 1 }).map((e4) => ({ value: e4, label: String(e4) })) }) }), a2 && k(n2.AppField, { name: "bankAccount", children: (e3) => k(e3.BankAccountField, { transaction: r2 }) }), k(n2.AppField, { name: "notes", children: (e3) => k(e3.TextAreaInput, { label: "Note" }) })] });
|
|
3260
|
-
}
|
|
3261
|
-
function uf({ transactionId: e2, initialTab: t2 }) {
|
|
3262
|
-
const { query: { data: r2 }, isFilling: n2 } = vi({ id: e2 });
|
|
3263
|
-
if (b(() => {
|
|
3264
|
-
!n2 && ir(r2) && si();
|
|
3265
|
-
}, [r2, n2]), ir(r2)) return null;
|
|
3266
|
-
switch (r2.type) {
|
|
3267
|
-
case "EXPENSE":
|
|
3268
|
-
return k(lf, { transactionId: e2, initialTab: t2 });
|
|
3269
|
-
case "BANK_TRANSFER":
|
|
3270
|
-
return k(sf, { transactionId: e2, initialTab: t2 });
|
|
3271
|
-
case "REVENUE":
|
|
3272
|
-
return k(cf, { transactionId: e2, initialTab: t2 });
|
|
3273
|
-
case "TAX_PAYMENT":
|
|
3274
|
-
return k(df, { transactionId: e2, initialTab: t2 });
|
|
3275
|
-
}
|
|
3276
|
-
}
|
|
3277
|
-
const hf = { transform(e2) {
|
|
3278
|
-
const { justify: t2, gap: r2, ...n2 } = e2;
|
|
3279
|
-
return { display: "flex", alignItems: "center", justifyContent: t2, gap: r2, flexDirection: "column", ...n2 };
|
|
3280
|
-
}, defaultValues: { gap: "10px" } }, gf = (e2 = {}) => {
|
|
3281
|
-
const t2 = ct(hf, e2);
|
|
3282
|
-
return hf.transform(t2, st);
|
|
3283
|
-
}, pf = (e2) => ft(gf(e2));
|
|
3284
|
-
pf.raw = gf;
|
|
3285
|
-
const vf = { transform(e2) {
|
|
3286
|
-
const { justify: t2, gap: r2, ...n2 } = e2;
|
|
3287
|
-
return { display: "flex", alignItems: "center", justifyContent: t2, gap: r2, flexDirection: "row", ...n2 };
|
|
3288
|
-
}, defaultValues: { gap: "10px" } }, mf = (e2 = {}) => {
|
|
3289
|
-
const t2 = ct(vf, e2);
|
|
3290
|
-
return vf.transform(t2, st);
|
|
3291
|
-
}, bf = (e2) => ft(mf(e2));
|
|
3292
|
-
function ff({ subject: e2, children: t2 }) {
|
|
3293
|
-
return S(Fb, { children: [S(nf, { children: [k(Gb, {}), k(lo, { children: e2 })] }), k("div", { className: bf({ alignItems: "center", gap: 15 }), children: t2 })] });
|
|
3294
|
-
}
|
|
3295
|
-
function yf({ conversationId: e2 }) {
|
|
3296
|
-
const [t2, r2] = v(e2), { query: { data: n2 } } = za(t2), o2 = "CLOSED" === n2?.resolutionStatus;
|
|
3297
|
-
return k(bm, { children: S(wm, { children: [k(ff, { subject: n2?.subject ?? "Conversation" }), k(_b, { conversationId: t2, setConversationId: r2, isResolved: o2, isUnread: "UNREAD" === n2?.readStatus })] }) });
|
|
3298
|
-
}
|
|
3299
|
-
bf.raw = mf;
|
|
3300
|
-
const Tf = aa((e2) => c.createElement("svg", { width: 15, height: 15, viewBox: "0 0 15 15", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e2 }, c.createElement("g", { clipPath: "url(#clip0_18201_5557)" }, c.createElement("path", { d: "M7.5 14.0625C11.1244 14.0625 14.0625 11.1244 14.0625 7.5C14.0625 3.87563 11.1244 0.9375 7.5 0.9375C3.87563 0.9375 0.9375 3.87563 0.9375 7.5C0.9375 11.1244 3.87563 14.0625 7.5 14.0625Z", strokeWidth: 0.9375, strokeMiterlimit: 10 }), c.createElement("path", { d: "M7.49999 10.4812V6.30624H6.30624", strokeWidth: 0.9375, strokeMiterlimit: 10 }), c.createElement("path", { d: "M6.30624 10.4813H8.69374", strokeWidth: 0.9375, strokeMiterlimit: 10 }), c.createElement("path", { d: "M6.90625 4.51874H8.09375", strokeWidth: 0.9375, strokeMiterlimit: 10 })), c.createElement("defs", null, c.createElement("clipPath", { id: "clip0_18201_5557" }, c.createElement("rect", { width: 15, height: 15, fill: "white" })))), "Info");
|
|
3301
|
-
function xf({ onClick: e2, active: t2 }) {
|
|
3302
|
-
return k(Li, { type: "button", onClick: e2, active: t2, children: k(gc, { Component: Tf }) });
|
|
3303
|
-
}
|
|
3304
|
-
const wf = ft({ display: "flex", flexDirection: "column" }), kf = At(null, ft({ whiteSpace: "normal", overflowWrap: "break-word" }));
|
|
3305
|
-
function Cf({ label: e2, data: t2, isFilling: r2, shimmerWidth: n2 }) {
|
|
3306
|
-
return S("div", { className: wf, children: [k(co, { children: e2 }), r2 ? k(wb, { width: n2 }) : k(lo, { stylists: [kf], children: t2 ?? "" })] });
|
|
3307
|
-
}
|
|
3308
|
-
function Sf({ transactionId: e2, isOpen: t2 }) {
|
|
3309
|
-
const { query: { data: r2 }, isFilling: n2 } = vi({ id: e2 }), o2 = js(r2?.bankAccount.id);
|
|
3310
|
-
if (ir(r2)) return null;
|
|
3311
|
-
const a2 = pf({ alignItems: "stretch", gap: 5, paddingLeft: 16, paddingRight: 16, backgroundColor: "surface.foreground", borderWidth: 0, borderBottomStyle: "solid", borderColor: "border.layout.strong", maxHeight: 0, overflow: "hidden", transition: "all 300ms ease-out", "&[data-open='true']": { maxHeight: "1/3", paddingTop: 16, paddingBottom: 16, borderWidth: "lg", overflow: "scroll" } });
|
|
3312
|
-
return S("div", { "data-open": t2, className: a2, children: [S("div", { className: bf({ justifyContent: "space-between" }), children: [k(Cf, { label: "Date", data: r2?.date, isFilling: n2, shimmerWidth: "md" }), k(Cf, { label: "Amount", data: no(Nd(r2.amount)), isFilling: n2, shimmerWidth: "sm" })] }), k(Cf, { label: "Bank Account", data: xh(o2?.apiAccountName, o2?.apiAccountNo), isFilling: n2, shimmerWidth: "lg" }), k(Cf, { label: "Description", data: r2?.description, isFilling: n2, shimmerWidth: "lg" })] });
|
|
3313
|
-
}
|
|
3314
|
-
function Ef({ conversationId: e2, transactionId: t2 }) {
|
|
3315
|
-
const [r2, n2] = v(e2), [o2, a2] = v(true), { query: { data: i2 } } = za(r2), l2 = "CLOSED" === i2?.resolutionStatus;
|
|
3316
|
-
return k(bm, { children: S(wm, { children: [k(ff, { subject: i2?.subject ?? "Conversation", children: lr(t2) && k(xf, { onClick: () => a2(!o2), active: o2 }, "infoButton") }), lr(t2) && k(Sf, { transactionId: t2, isOpen: o2 }), k(_b, { conversationId: r2, setConversationId: n2, isResolved: l2, isUnread: "UNREAD" === i2?.readStatus })] }) });
|
|
3317
|
-
}
|
|
3318
|
-
const If = { DELETE: "delete" }, Pf = ft({ display: "flex", flexDirection: "column", gap: "16px" }), Af = async (e2) => wc({ title: "Remove Institution", body: k("div", { className: Pf, children: k(qi, { wrap: "wrap", children: `Would you like to unlink ${e2} altogether? If you unlink now and relink ${e2} again in the future, you may see duplicate transactions.` }) }), buttons: [{ key: "cancel", label: "Cancel" }, { key: "delete", label: "Remove" }] });
|
|
3319
|
-
function Df({ id: e2, apiInstitutionName: t2 }) {
|
|
3320
|
-
const { mutate: r2 } = Ms({ mutationFn: Ws, onSuccess: () => {
|
|
3321
|
-
const e3 = Os.all();
|
|
3322
|
-
return pr.invalidateQueries({ queryKey: e3 });
|
|
3323
|
-
} }), n2 = ll(), { linkPlaid: o2 } = Ic(e2, () => n2?.setOpen(false)), a2 = async () => {
|
|
3324
|
-
const o3 = await Af(t2);
|
|
3325
|
-
n2?.setOpen(false), o3 === If.DELETE && r2({ id: String(e2) });
|
|
3326
|
-
};
|
|
3327
|
-
return S(Xd, { children: [k(eu, { onClick: () => o2(), children: k(lo, { children: "Add Account" }) }), k(eu, { onClick: () => a2(), children: k(lo, { children: "Remove Institution" }) })] });
|
|
3328
|
-
}
|
|
3329
|
-
function Mf({ id: e2 }) {
|
|
3330
|
-
const { linkPlaid: t2 } = Ic(e2);
|
|
3331
|
-
return S($h, { type: "critical", onClick: async () => {
|
|
3332
|
-
"success" === await wc({ title: "Fix Bank Connection", body: "In order to continue syncing transactions, you must fix a connection error with your banking institution. You will be taken to Plaid to resolve this issue.", buttons: [{ key: "cancel", label: "Cancel" }, { key: "success", label: "Fix It" }] }) && await t2();
|
|
3333
|
-
}, children: [k(gc, { Component: Dh }), k(co, { children: "Fix Bank Error" }), k(ga, { Component: la })] });
|
|
3334
|
-
}
|
|
3335
|
-
const Nf = ft({ borderTop: "{borderWidths.md} solid", borderColor: "border.layout.strong" }), Rf = ft({ display: "flex", flexDirection: "row", alignItems: "center", justifyContent: "space-between", paddingTop: "20px", paddingBottom: "14px", paddingLeft: "15px", paddingRight: "15px", backgroundColor: "surface.foreground" }), Of = ft({ padding: "15px", borderBottom: "{borderWidths.md} solid", borderColor: "border.layout.weak", backgroundColor: "surface.foreground", gap: "8px", display: "flex", flexDirection: "column" }), _f = ft({ overflow: "hidden" }), Lf = (e2) => {
|
|
3336
|
-
let t2;
|
|
3337
|
-
return t2 = e2.isSupported ? e2.lastApiSyncedDate ? `Last synced ${nr(e2.lastApiSyncedDate)}` : e2.syncTransactions ? "Processing" : "Not Synced" : "Not Supported", t2;
|
|
3338
|
-
};
|
|
3339
|
-
function Ff({ id: e2, apiInstitutionName: t2, plaidItemAccounts: r2, itemIndex: n2, numPlaidItems: o2, hasError: a2 }) {
|
|
3340
|
-
const i2 = 1 === o2, [l2, s2] = v(i2), c2 = n2 === o2 - 1;
|
|
3341
|
-
return S("div", { className: Nf, children: [S("div", { className: Rf, children: [S(nf, { children: [k(lo, { children: t2 }), k(Xb, { children: k(Df, { id: e2, apiInstitutionName: t2 }) })] }), S(nf, { children: [a2 && k(Mf, { id: e2 }), k(El, { active: false, onClick: () => s2(!l2), children: k(ga, { Component: l2 ? tg : rg }) })] })] }), l2 && k("div", { className: _f, children: r2.map((e3) => {
|
|
3342
|
-
const t3 = Lf(e3);
|
|
3343
|
-
return S("div", { className: Of, children: [k(co, { intent: e3.isSupported ? "normal" : "danger", children: t3 }), k(lo, { children: e3.apiAccountName }), e3.apiAccountNo && k(lo, { children: Th(e3.apiAccountNo) })] }, e3.id);
|
|
3344
|
-
}) }), !c2 && k(Xa, { alignment: "horizontal", color: "strong" })] });
|
|
3345
|
-
}
|
|
3346
|
-
const Wf = ft({ display: "flex", flexDirection: "column", padding: "15px 15px 0 15px" });
|
|
3347
|
-
function Bf({ bankError: e2 }) {
|
|
3348
|
-
const { linkPlaid: t2 } = Ic(e2.meta?.plaidItemId);
|
|
3349
|
-
return k("div", { className: Wf, children: k(tp, { task: e2, handleClick: () => t2() }) });
|
|
3350
|
-
}
|
|
3351
|
-
const Hf = ft({ display: "flex", flexDirection: "column", gap: "15px", position: "relative", marginTop: "15px" }), zf = ft({ overflowY: "auto", position: "relative" }), Vf = wt({ base: { paddingTop: "20px", paddingBottom: "20px", display: "flex", justifyContent: "center", alignItems: "center", position: "sticky", bottom: 0 }, variants: { hasPlaidItems: { true: { borderTop: "{borderWidths.md} solid {colors.border.layout.strong}" } } } });
|
|
3352
|
-
function jf() {
|
|
3353
|
-
const { query: { data: e2 } } = Ls({ select: (e3) => {
|
|
3354
|
-
return t3 = e3, t3?.filter((e4) => "ACTIVE" === e4.status);
|
|
3355
|
-
var t3;
|
|
3356
|
-
} }), { query: { data: t2 } } = Us(), { linkPlaid: r2 } = Ic(), n2 = e2 && t2 && Ch(e2, t2), o2 = n2 ? n2.length : 0, a2 = e2?.find((e3) => Rs.includes(e3.apiErrorCode || "")), i2 = a2 && As(a2.apiInstitutionName, a2.id, a2.apiErrorCode);
|
|
3357
|
-
return k(bm, { children: S(wm, { children: [k(Fb, { children: S(nf, { children: [k(Gb, {}), k(lo, { children: "Banks & Integrations" })] }) }), i2 && k(Bf, { bankError: i2 }), k("div", { className: zf, children: k("div", { className: Hf, children: n2 && n2.map((e3, t3) => k(Ff, { id: e3.id, apiInstitutionName: e3.apiInstitutionName, plaidItemAccounts: e3.plaidItemAccounts, itemIndex: t3, numPlaidItems: o2, hasError: Rs.includes(e3.apiErrorCode || "") }, e3.id)) }) }), k("div", { className: Vf({ hasPlaidItems: o2 > 0 }), children: S(Kp, { onClick: () => r2(), children: [k(gc, { Component: Ei }), k(lo, { children: "Add New Connection" })] }) })] }) });
|
|
3358
|
-
}
|
|
3359
|
-
function qf() {
|
|
3360
|
-
return S(Dp, { children: [k(Mp, { name: "BankTransactionFormRouter", Component: uf }), k(Mp, { name: "Conversation", Component: yf }), k(Mp, { name: "MobileConversation", Component: Ef }), k(Mp, { name: "BanksAndIntegrations", Component: jf })] });
|
|
3361
|
-
}
|
|
3362
|
-
const Uf = ({ environment: e2, children: t2 }) => k(vr.Provider, { value: e2, children: t2 }), Kf = { all: () => ["sdk", "introspect"] }, $f = async (e2) => {
|
|
3363
|
-
const t2 = e2.queryKey, r2 = { path: "/sdk/introspect", accessToken: t2[2].accessToken, environment: t2[2].environment };
|
|
3364
|
-
return await Na(r2);
|
|
3365
|
-
};
|
|
3366
|
-
function Yf({ children: e2 }) {
|
|
3367
|
-
const { query: { data: t2 } } = br({ queryKey: Kf.all(), queryFn: $f });
|
|
3368
|
-
return k(Rl.Provider, { value: { userId: t2?.userId, userRole: t2?.userRole || "OWNER", userEmail: t2?.email }, children: e2 });
|
|
3369
|
-
}
|
|
3370
|
-
function Gf({ children: e2, environment: t2, accessToken: r2 }) {
|
|
3371
|
-
const n2 = { activeToken: r2, accountantToken: void 0 };
|
|
3372
|
-
return b(() => {
|
|
3373
|
-
((e3) => {
|
|
3374
|
-
Qr.setProperties(Zr), Xr = e3;
|
|
3375
|
-
})(t2);
|
|
3376
|
-
}, [t2]), k(Uf, { environment: t2, children: k(Cp, { children: k(dr.Provider, { value: n2, children: S(Yf, { children: [k(ge.ConfirmationRoot, {}), e2, k(qf, {})] }) }) }) });
|
|
3377
|
-
}
|
|
3378
|
-
export {
|
|
3379
|
-
xp as BusinessOwnerDashboard,
|
|
3380
|
-
Gf as Tight,
|
|
3381
|
-
He as useOptions
|
|
3382
|
-
};
|
|
1
|
+
import{create as e}from"zustand";import{devtools as t}from"zustand/middleware";import{cloneDeep as r,entries as n,mapValues as o,isEqual as a,isEmpty as i}from"lodash-es";import*as l from"zod";import{z as s}from"zod";import*as c from"react";import{useRef as d,useMemo as u,createContext as h,useContext as p,Component as g,useState as m,useCallback as v,useEffect as b,createElement as f,forwardRef as y,useReducer as T,useLayoutEffect as x,useImperativeHandle as k}from"react";import{jsx as w,Fragment as C,jsxs as E}from"react/jsx-runtime";import{QueryClient as I,useIsRestoring as S,useQuery as A,keepPreviousData as N,useMutation as P}from"@tanstack/react-query";import M from"yocto-queue";import D from"big.js";import{ResponsiveContainer as R,BarChart as O,Legend as _,CartesianGrid as L,XAxis as F,YAxis as B,Tooltip as W,Bar as H,ReferenceLine as U,Line as V}from"recharts";import{flexRender as z,createColumnHelper as j,useReactTable as K,getCoreRowModel as $,getExpandedRowModel as q}from"@tanstack/react-table";import{useFloatingNodeId as Y,useFloating as G,offset as Q,flip as X,shift as Z,size as J,autoUpdate as ee,useClick as te,useDismiss as re,useRole as ne,useInteractions as oe,useFloatingParentNodeId as ae,FloatingTree as ie,FloatingNode as le,useMergeRefs as se,FloatingOverlay as ce,FloatingPortal as de,FloatingFocusManager as ue}from"@floating-ui/react";import{ContextAwareConfirmation as he,confirmable as pe}from"react-confirm";import{usePlaidLink as ge}from"react-plaid-link";import me from"fuse.js";import{openDB as ve}from"idb";import{PersistQueryClientProvider as be}from"@tanstack/react-query-persist-client";import{createFormHookContexts as fe,useStore as ye,createFormHook as Te}from"@tanstack/react-form";import{NumericFormat as xe}from"react-number-format";import{fetchEventSource as ke}from"@microsoft/fetch-event-source";function we(e,t){return`${e.trim()}:${t.trim()}`}const Ce=e=>({FEATUREFLAG_BULK_SELECT:!1,FEATUREFLAG_HAS_MERGE_ACCOUNTS:!1,FEATUREFLAG_PLAID_CONNECTION_DRAWER:!1,FEATUREFLAG_SERVER_SIDE_EVENTS:!1,updateFlags:t=>e(e=>({...e,...t}),void 0,we("featureFlags","updateFlags"))});function Ee(){return Le(e=>e.FEATUREFLAG_PLAID_CONNECTION_DRAWER)}const Ie="drawerNavigation",Se=e=>({drawerHistory:[],openDrawer:(t,n={})=>e(e=>{const{replaceHistory:o,routeProps:a}=n,i={[t]:{routeProps:a}};if(o||0===e.drawerHistory.length)return{drawerHistory:[i]};{const t=r(e.drawerHistory);return t.push(i),{drawerHistory:t}}},void 0,we(Ie,"openDrawer")),closeDrawer:()=>e(e=>{const t=e.drawerHistory;return{drawerHistory:t.slice(0,t.length-1)}},void 0,we(Ie,"closeDrawer")),closeAllDrawers:()=>e(()=>({drawerHistory:[]}),void 0,we(Ie,"closeAllDrawers"))}),Ae=e=>({externalOptions:{},setOptions:(t,r=!1)=>e(e=>r?{externalOptions:{...t}}:{externalOptions:{...e.externalOptions,...t}},void 0,we("externalOptions","setOptions"))});function Ne(e,t){return t>-1&&t<=e.length-1?[...e.slice(0,t),...e.slice(t+1)]:[...e]}function Pe(e){return e[e.length-1]}const Me="transactionsDashFilters",De=e=>({transactionsDashFilters:[],addTransactionsDashFilters:t=>e(e=>({...e,transactionsDashFilters:[...e.transactionsDashFilters,...t]}),void 0,we(Me,"addFilter")),removeTransactionsDashFilter:t=>e(e=>({...e,transactionsDashFilters:Ne(e.transactionsDashFilters,t)}),void 0,we(Me,"removeFilter")),setTransactionsDashFilters:t=>e(e=>({...e,transactionsDashFilters:t}),void 0,we(Me,"setFilters"))}),Re={label:"Connected Accounts",value:"connected"},Oe="banksAndIntegrationsState",_e=e=>({banksAndIntegrationsSelectedTab:Re,expandedPlaidItems:[],hasExpandedUpdated:!1,setBanksAndIntegrationsSelectedTab:t=>e({banksAndIntegrationsSelectedTab:t},void 0,we(Oe,"setBanksAndIntegrationsSelectedTab")),toggleExpandedPlaidItem:(t,r)=>e(e=>({expandedPlaidItems:e.expandedPlaidItems.includes(t)||r&&!e.hasExpandedUpdated?e.expandedPlaidItems.filter(e=>e!==t):[...e.expandedPlaidItems,t],hasExpandedUpdated:!0}),void 0,we(Oe,"toggleExpandedPlaidItem"))}),Le=e()(t((...e)=>({...Ce(...e),...Se(...e),...Ae(...e),...De(...e),..._e(...e)}),{name:"globalStore",enabled:!1,store:"globalStore"})),Fe={SELECT:"select",EXPAND:"expand",DATE:"date",DESCRIPTION:"description",AMOUNT:"amount",CATEGORY:"category",CLASS_SEGMENT:"classSegment",REVIEW_STATUS:"reviewStatus",COMMENTS:"comments"},Be=[Fe.COMMENTS,Fe.DATE,Fe.DESCRIPTION,Fe.AMOUNT,Fe.CATEGORY,Fe.CLASS_SEGMENT,Fe.REVIEW_STATUS],We=l.object({pageSize:l.optional(l.int32().positive()),columns:l.optional(l.array(l.enum(Be)))}),He=l.optional(l.string().trim()),Ue=/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,Ve=l.optional(l.array(l.string().trim())),ze={transactionsDashboard:e=>{const t=We.safeParse(e);return t.success?t.data:void 0},accessToken:e=>{const t=He.safeParse(e);return t.success?t.data:void 0},dataVisualizationColors:e=>{const t=Ve.safeParse(e);if(!t.success||void 0===t.data)return;const r=t.data.filter(e=>Ue.test(e));return r.length>0?r:void 0}},je=(e,t)=>{if(void 0!==ze[e])return(0,ze[e])(t)};function Ke(e){const t=d(!1),o=Le(e=>e.setOptions);if(e&&!t.current){o(function(e){let t={};for(const[r,o]of n(e)){const e=je(r,o);void 0!==e&&(t={...t,[r]:e})}return t}(e)),t.current=!0}const a=Le(e=>e.externalOptions);return{options:u(()=>r(a),[a]),setOptions:o}}function $e(e){return"object"==typeof e&&null!=e&&!Array.isArray(e)}function qe(e){return Object.fromEntries(Object.entries(e??{}).filter(([e,t])=>void 0!==t))}function Ye(e){return String.fromCharCode(e+(e>25?39:97))}function Ge(e){return function(e){let t,r="";for(t=Math.abs(e);t>52;t=t/52|0)r=Ye(t%52)+r;return Ye(t%52)+r}(function(e,t){let r=t.length;for(;r;)e=33*e^t.charCodeAt(--r);return e}(5381,e)>>>0)}var Qe=/\s*!(important)?/i;function Xe(e){return"string"==typeof e?e.replaceAll(" ","_"):e}var Ze=e=>{const t=/* @__PURE__ */new Map;return(...r)=>{const n=JSON.stringify(r);if(t.has(n))return t.get(n);const o=e(...r);return t.set(n,o),o}},Je=/* @__PURE__ */new Set(["__proto__","constructor","prototype"]);function et(...e){return e.reduce((e,t)=>t?(Object.keys(t).forEach(r=>{if(Je.has(r))return;const n=e[r],o=t[r];$e(n)&&$e(o)?e[r]=et(n,o):e[r]=o}),e):e,{})}var tt=e=>null!=e;function rt(e,t,r={}){const{stop:n,getKey:o}=r;return function e(r,a=[]){if("object"==typeof(i=r)&&null!==i){const i={};for(const[l,s]of Object.entries(r)){const c=o?.(l,s)??l,d=[...a,c];if(n?.(r,d))return t(r,a);const u=e(s,d);tt(u)&&(i[c]=u)}return i}var i;return t(r,a)}(e)}function nt(e,t,r=!0){const{utility:n,conditions:o}=t,{hasShorthand:a,resolveShorthand:i}=n;return rt(e,e=>{return Array.isArray(e)?(t=e,r=o.breakpoints.keys,t.reduce((e,t,n)=>{const o=r[n];return null!=t&&(e[o]=t),e},{})):e;var t,r},{stop:e=>Array.isArray(e),getKey:r?e=>a?i(e):e:void 0})}var ot={shift:e=>e,finalize:e=>e,breakpoints:{keys:[]}},at=/([A-Z])/g,it=/^ms-/,lt=Ze(e=>e.startsWith("--")?e:e.replace(at,"-$1").replace(it,"-ms-").toLowerCase()),st=new RegExp(`^(${["min","max","clamp","calc"].join("|")})\\(.*\\)`),ct=`(?:${"cm,mm,Q,in,pc,pt,px,em,ex,ch,rem,lh,rlh,vw,vh,vmin,vmax,vb,vi,svw,svh,lvw,lvh,dvw,dvh,cqw,cqh,cqi,cqb,cqmin,cqmax,%".split(",").join("|")})`,dt=new RegExp(`^[+-]?[0-9]*.?[0-9]+(?:[eE][+-]?[0-9]+)?${ct}$`),ut={map:function(e,t){return Array.isArray(e)?e.map(e=>t(e)):$e(e)?rt(e,e=>t(e)):t(e)},isCssFunction:e=>"string"==typeof e&&st.test(e),isCssVar:e=>"string"==typeof e&&/^var\(--.+\)$/.test(e),isCssUnit:e=>"string"==typeof e&&dt.test(e)},ht=(e,t)=>{if(!e?.defaultValues)return t;const r="function"==typeof e.defaultValues?e.defaultValues(t):e.defaultValues;return Object.assign({},r,qe(t))};const pt=new Set("_hover,_focus,_focusWithin,_focusVisible,_disabled,_active,_visited,_target,_readOnly,_readWrite,_empty,_checked,_enabled,_expanded,_highlighted,_complete,_incomplete,_dragging,_before,_after,_firstLetter,_firstLine,_marker,_selection,_file,_backdrop,_first,_last,_only,_even,_odd,_firstOfType,_lastOfType,_onlyOfType,_peerFocus,_peerHover,_peerActive,_peerFocusWithin,_peerFocusVisible,_peerDisabled,_peerChecked,_peerInvalid,_peerExpanded,_peerPlaceholderShown,_groupFocus,_groupHover,_groupActive,_groupFocusWithin,_groupFocusVisible,_groupDisabled,_groupChecked,_groupExpanded,_groupInvalid,_indeterminate,_required,_valid,_invalid,_autofill,_inRange,_outOfRange,_placeholder,_placeholderShown,_pressed,_selected,_grabbed,_underValue,_overValue,_atValue,_default,_optional,_open,_closed,_fullscreen,_loading,_hidden,_current,_currentPage,_currentStep,_today,_unavailable,_rangeStart,_rangeEnd,_now,_topmost,_motionReduce,_motionSafe,_print,_landscape,_portrait,_dark,_light,_osDark,_osLight,_highContrast,_lessContrast,_moreContrast,_ltr,_rtl,_scrollbar,_scrollbarThumb,_scrollbarTrack,_horizontal,_vertical,_icon,_starting,_noscript,_invertedColors,_supportHover,_notDisabled,sm,smOnly,smDown,md,mdOnly,mdDown,lg,lgOnly,lgDown,xl,xlOnly,xlDown,1.5xl,1.5xlOnly,1.5xlDown,2xl,2xlOnly,2xlDown,smToMd,smToLg,smToXl,smTo1.5xl,smTo2xl,mdToLg,mdToXl,mdTo1.5xl,mdTo2xl,lgToXl,lgTo1.5xl,lgTo2xl,xlTo1.5xl,xlTo2xl,1.5xlTo2xl,base".split(",")),gt=/^@|&|&$/;function mt(e){return pt.has(e)||gt.test(e)}const vt=/^_/,bt=/&|@/,ft=/* @__PURE__ */new Map;"aspectRatio:asp,boxDecorationBreak:bx-db,zIndex:z,boxSizing:bx-s,objectPosition:obj-p,objectFit:obj-f,overscrollBehavior:ovs-b,overscrollBehaviorX:ovs-bx,overscrollBehaviorY:ovs-by,position:pos,top:top,left:left,inset:inset,insetInline:inset-x,insetBlock:inset-y,insetBlockEnd:inset-be,insetBlockStart:inset-bs,insetInlineEnd:inset-e,insetInlineStart:inset-s,right:right,bottom:bottom,float:float,visibility:vis,display:d,hideFrom:hide,hideBelow:show,flexBasis:flex-b,flex:flex,flexDirection:flex-d,flexGrow:flex-g,flexShrink:flex-sh,gridTemplateColumns:grid-tc,gridTemplateRows:grid-tr,gridColumn:grid-c,gridRow:grid-r,gridColumnStart:grid-cs,gridColumnEnd:grid-ce,gridAutoFlow:grid-af,gridAutoColumns:grid-ac,gridAutoRows:grid-ar,gap:gap,gridGap:grid-g,gridRowGap:grid-rg,gridColumnGap:grid-cg,rowGap:rg,columnGap:cg,justifyContent:jc,alignContent:ac,alignItems:ai,alignSelf:as,padding:p,paddingLeft:pl,paddingRight:pr,paddingTop:pt,paddingBottom:pb,paddingBlock:py,paddingBlockEnd:pbe,paddingBlockStart:pbs,paddingInline:px,paddingInlineEnd:pe,paddingInlineStart:ps,marginLeft:ml,marginRight:mr,marginTop:mt,marginBottom:mb,margin:m,marginBlock:my,marginBlockEnd:mbe,marginBlockStart:mbs,marginInline:mx,marginInlineEnd:me,marginInlineStart:ms,spaceX:sx,spaceY:sy,outlineWidth:ring-w,outlineColor:ring-c,outline:ring,outlineOffset:ring-o,divideX:dvd-x,divideY:dvd-y,divideColor:dvd-c,divideStyle:dvd-s,width:w,inlineSize:w-is,minWidth:min-w,minInlineSize:min-w-is,maxWidth:max-w,maxInlineSize:max-w-is,height:h,blockSize:h-bs,minHeight:min-h,minBlockSize:min-h-bs,maxHeight:max-h,maxBlockSize:max-b,boxSize:size,color:c,fontFamily:ff,fontSize:fs,fontSizeAdjust:fs-a,fontPalette:fp,fontKerning:fk,fontFeatureSettings:ff-s,fontWeight:fw,fontSmoothing:fsmt,fontVariant:fv,fontVariantAlternates:fv-alt,fontVariantCaps:fv-caps,fontVariationSettings:fv-s,fontVariantNumeric:fv-num,letterSpacing:ls,lineHeight:lh,textAlign:ta,textDecoration:td,textDecorationColor:td-c,textEmphasisColor:te-c,textDecorationStyle:td-s,textDecorationThickness:td-t,textUnderlineOffset:tu-o,textTransform:tt,textIndent:ti,textShadow:tsh,textShadowColor:tsh-c,textOverflow:tov,verticalAlign:va,wordBreak:wb,textWrap:tw,truncate:trunc,lineClamp:lc,listStyleType:li-t,listStylePosition:li-pos,listStyleImage:li-img,listStyle:li-s,backgroundPosition:bg-p,backgroundPositionX:bg-p-x,backgroundPositionY:bg-p-y,backgroundAttachment:bg-a,backgroundClip:bg-cp,background:bg,backgroundColor:bg-c,backgroundOrigin:bg-o,backgroundImage:bg-i,backgroundRepeat:bg-r,backgroundBlendMode:bg-bm,backgroundSize:bg-s,backgroundGradient:bg-grad,backgroundLinear:bg-linear,backgroundRadial:bg-radial,backgroundConic:bg-conic,textGradient:txt-grad,gradientFromPosition:grad-from-pos,gradientToPosition:grad-to-pos,gradientFrom:grad-from,gradientTo:grad-to,gradientVia:grad-via,gradientViaPosition:grad-via-pos,borderRadius:bdr,borderTopLeftRadius:bdr-tl,borderTopRightRadius:bdr-tr,borderBottomRightRadius:bdr-br,borderBottomLeftRadius:bdr-bl,borderTopRadius:bdr-t,borderRightRadius:bdr-r,borderBottomRadius:bdr-b,borderLeftRadius:bdr-l,borderStartStartRadius:bdr-ss,borderStartEndRadius:bdr-se,borderStartRadius:bdr-s,borderEndStartRadius:bdr-es,borderEndEndRadius:bdr-ee,borderEndRadius:bdr-e,border:bd,borderWidth:bd-w,borderTopWidth:bd-t-w,borderLeftWidth:bd-l-w,borderRightWidth:bd-r-w,borderBottomWidth:bd-b-w,borderBlockStartWidth:bd-bs-w,borderBlockEndWidth:bd-be-w,borderColor:bd-c,borderInline:bd-x,borderInlineWidth:bd-x-w,borderInlineColor:bd-x-c,borderBlock:bd-y,borderBlockWidth:bd-y-w,borderBlockColor:bd-y-c,borderLeft:bd-l,borderLeftColor:bd-l-c,borderInlineStart:bd-s,borderInlineStartWidth:bd-s-w,borderInlineStartColor:bd-s-c,borderRight:bd-r,borderRightColor:bd-r-c,borderInlineEnd:bd-e,borderInlineEndWidth:bd-e-w,borderInlineEndColor:bd-e-c,borderTop:bd-t,borderTopColor:bd-t-c,borderBottom:bd-b,borderBottomColor:bd-b-c,borderBlockEnd:bd-be,borderBlockEndColor:bd-be-c,borderBlockStart:bd-bs,borderBlockStartColor:bd-bs-c,opacity:op,boxShadow:bx-sh,boxShadowColor:bx-sh-c,mixBlendMode:mix-bm,filter:filter,brightness:brightness,contrast:contrast,grayscale:grayscale,hueRotate:hue-rotate,invert:invert,saturate:saturate,sepia:sepia,dropShadow:drop-shadow,blur:blur,backdropFilter:bkdp,backdropBlur:bkdp-blur,backdropBrightness:bkdp-brightness,backdropContrast:bkdp-contrast,backdropGrayscale:bkdp-grayscale,backdropHueRotate:bkdp-hue-rotate,backdropInvert:bkdp-invert,backdropOpacity:bkdp-opacity,backdropSaturate:bkdp-saturate,backdropSepia:bkdp-sepia,borderCollapse:bd-cl,borderSpacing:bd-sp,borderSpacingX:bd-sx,borderSpacingY:bd-sy,tableLayout:tbl,transitionTimingFunction:trs-tmf,transitionDelay:trs-dly,transitionDuration:trs-dur,transitionProperty:trs-prop,transition:trs,animation:anim,animationName:anim-n,animationTimingFunction:anim-tmf,animationDuration:anim-dur,animationDelay:anim-dly,animationPlayState:anim-ps,animationComposition:anim-comp,animationFillMode:anim-fm,animationDirection:anim-dir,animationIterationCount:anim-ic,animationRange:anim-r,animationState:anim-s,animationRangeStart:anim-rs,animationRangeEnd:anim-re,animationTimeline:anim-tl,transformOrigin:trf-o,transformBox:trf-b,transformStyle:trf-s,transform:trf,rotate:rotate,rotateX:rotate-x,rotateY:rotate-y,rotateZ:rotate-z,scale:scale,scaleX:scale-x,scaleY:scale-y,translate:translate,translateX:translate-x,translateY:translate-y,translateZ:translate-z,accentColor:ac-c,caretColor:ca-c,scrollBehavior:scr-bhv,scrollbar:scr-bar,scrollbarColor:scr-bar-c,scrollbarGutter:scr-bar-g,scrollbarWidth:scr-bar-w,scrollMargin:scr-m,scrollMarginLeft:scr-ml,scrollMarginRight:scr-mr,scrollMarginTop:scr-mt,scrollMarginBottom:scr-mb,scrollMarginBlock:scr-my,scrollMarginBlockEnd:scr-mbe,scrollMarginBlockStart:scr-mbt,scrollMarginInline:scr-mx,scrollMarginInlineEnd:scr-me,scrollMarginInlineStart:scr-ms,scrollPadding:scr-p,scrollPaddingBlock:scr-py,scrollPaddingBlockStart:scr-pbs,scrollPaddingBlockEnd:scr-pbe,scrollPaddingInline:scr-px,scrollPaddingInlineEnd:scr-pe,scrollPaddingInlineStart:scr-ps,scrollPaddingLeft:scr-pl,scrollPaddingRight:scr-pr,scrollPaddingTop:scr-pt,scrollPaddingBottom:scr-pb,scrollSnapAlign:scr-sa,scrollSnapStop:scrs-s,scrollSnapType:scrs-t,scrollSnapStrictness:scrs-strt,scrollSnapMargin:scrs-m,scrollSnapMarginTop:scrs-mt,scrollSnapMarginBottom:scrs-mb,scrollSnapMarginLeft:scrs-ml,scrollSnapMarginRight:scrs-mr,scrollSnapCoordinate:scrs-c,scrollSnapDestination:scrs-d,scrollSnapPointsX:scrs-px,scrollSnapPointsY:scrs-py,scrollSnapTypeX:scrs-tx,scrollSnapTypeY:scrs-ty,scrollTimeline:scrtl,scrollTimelineAxis:scrtl-a,scrollTimelineName:scrtl-n,touchAction:tch-a,userSelect:us,overflow:ov,overflowWrap:ov-wrap,overflowX:ov-x,overflowY:ov-y,overflowAnchor:ov-a,overflowBlock:ov-b,overflowInline:ov-i,overflowClipBox:ovcp-bx,overflowClipMargin:ovcp-m,overscrollBehaviorBlock:ovs-bb,overscrollBehaviorInline:ovs-bi,fill:fill,stroke:stk,strokeWidth:stk-w,strokeDasharray:stk-dsh,strokeDashoffset:stk-do,strokeLinecap:stk-lc,strokeLinejoin:stk-lj,strokeMiterlimit:stk-ml,strokeOpacity:stk-op,srOnly:sr,debug:debug,appearance:ap,backfaceVisibility:bfv,clipPath:cp-path,hyphens:hy,mask:msk,maskImage:msk-i,maskSize:msk-s,textSizeAdjust:txt-adj,container:cq,containerName:cq-n,containerType:cq-t,cursor:cursor".split(",").forEach(e=>{const[t,r]=e.split(":");ft.set(t,r)});const yt={conditions:{shift:function(e){return e.sort((e,t)=>{const r=mt(e),n=mt(t);return r&&!n?1:!r&&n?-1:0})},finalize:function(e){return e.map(e=>pt.has(e)?e.replace(vt,""):bt.test(e)?`[${Xe(e.trim())}]`:e)},breakpoints:{keys:["base","sm","md","lg","xl","1.5xl","2xl"]}},utility:{prefix:"tsystem",transform:(e,t)=>({className:`${ft.get(e)||lt(e)}_${Xe(t)}`}),toHash:(e,t)=>t(e.join(":")),resolveShorthand:e=>e}},Tt=function(e){const{utility:t,hash:r,conditions:n=ot}=e,o=e=>[t.prefix,e].filter(Boolean).join("-");return Ze(({base:a,...i}={})=>{const l=nt(Object.assign(i,a),e),s=/* @__PURE__ */new Set;return rt(l,(e,a)=>{if(null==e)return;const i="string"==typeof(u=e)&&Qe.test(u),[l,...c]=n.shift(a),d=c.slice().filter(e=>!/* @__PURE__ */(e=>"base"===e)(e));var u;const h=t.transform(l,function(e){return"string"==typeof e?e.replace(Qe,"").trim():e}((e=>"string"==typeof e?e.replaceAll(/[\n\s]+/g," "):e)(e)));let p=((e,a)=>{let i;if(r){const r=[...n.finalize(e),a];i=o(t.toHash(r,Ge))}else i=[...n.finalize(e),o(a)].join(":");return i})(d,h.className);i&&(p=`${p}!`),s.add(p)}),Array.from(s).join(" ")})}(yt),xt=(...e)=>Tt(kt(...e));xt.raw=(...e)=>kt(...e);const{mergeCss:kt}=function(e){function t(t){const r=function(...e){return e.flat().filter(e=>$e(e)&&Object.keys(qe(e)).length>0)}(...t);return 1===r.length?r:r.map(t=>nt(t,e))}return{mergeCss:Ze(function(...e){return et(...t(e))}),assignCss:function(...e){return Object.assign({},...t(e))}}}(yt);function wt(){let e,t="",r=0;for(;r<arguments.length;)(e=arguments[r++])&&"string"==typeof e&&(t&&(t+=" "),t+=e);return t}const Ct=e=>({base:{},variants:{},defaultVariants:{},compoundVariants:[],...e});function Et(e){const{base:t,variants:r,defaultVariants:n,compoundVariants:o}=Ct(e),a=e=>({...n,...qe(e)});function i(e={}){const n=a(e);let i={...t};for(const[t,o]of Object.entries(n))r[t]?.[o]&&(i=kt(i,r[t][o]));const l=function(e,t){let r={};return e.forEach(e=>{Object.entries(e).every(([e,r])=>"css"===e||(Array.isArray(r)?r:[r]).some(r=>t[e]===r))&&(r=kt(r,e.css))}),r}(o,n);return kt(i,l)}const l=Object.keys(r),s=Object.fromEntries(Object.entries(r).map(([e,t])=>[e,Object.keys(t)]));return Object.assign(Ze(function(e){return xt(i(e))}),{__cva__:!0,variantMap:s,variantKeys:l,raw:i,config:e,merge:function(e){const a=Ct(e.config),i=((...e)=>{const t=e.reduce((e,t)=>(t&&t.forEach(t=>e.add(t)),e),/* @__PURE__ */new Set([]));return Array.from(t)})(e.variantKeys,Object.keys(r));return Et({base:kt(t,a.base),variants:Object.fromEntries(i.map(e=>[e,kt(r[e],a.variants[e])])),defaultVariants:et(n,a.defaultVariants),compoundVariants:[...o,...a.compoundVariants]})},splitVariantProps:function(e){return function(e,...t){const r=Object.getOwnPropertyDescriptors(e),n=Object.keys(r),o=e=>{const t={};for(let n=0;n<e.length;n++){const o=e[n];r[o]&&(Object.defineProperty(t,o,r[o]),delete r[o])}return t};return t.map(e=>o(Array.isArray(e)?e:n.filter(e))).concat(o(n))}(e,l)},getVariantProps:a})}var It,St=((It=St||{}).component="component",It["dashboard-placeholder-table"]="dashboard-placeholder-table",It["dashboard-header"]="dashboard-header",It["dashboard-table"]="dashboard-table",It["dashboard-table-body"]="dashboard-table-body",It["dashboard-table-cell"]="dashboard-table-cell",It["dashboard-table-column-header"]="dashboard-table-column-header",It["dashboard-table-header"]="dashboard-table-header",It.label="label",It.popup="popup",It["popup-sort-row"]="popup-sort-row",It["progress-bar"]="progress-bar",It["progress-bar-fill"]="progress-bar-fill",It.summation="summation",It["table-parent-row"]="table-parent-row",It["table-row"]="table-row",It["table-sub-row"]="table-sub-row",It.tile="tile",It["tile-bar-label"]="tile-bar-label",It["tile-body"]="tile-body",It["tile-filter-button"]="tile-filter-button",It["tile-filter-list"]="tile-filter-list",It["tile-filter-row"]="tile-filter-row",It["tile-header"]="tile-header",It["tile-title"]="tile-title",It.title="title",It["business-owner-dashboard"]="business-owner-dashboard",It["business-owner-dashboard-header"]="business-owner-dashboard-header",It["business-owner-table"]="business-owner-table",It["transaction-type-label"]="transaction-type-label",It["selector-row"]="selector-row",It["popup-list"]="popup-list",It.badge="badge",It["date-cell"]="date-cell",It["expander-cell"]="expander-cell",It["vertical-divider"]="vertical-divider",It["horizontal-divider"]="horizontal-divider",It["table-cell-divider"]="table-cell-divider",It["checkbox-input"]="checkbox-input",It["bulk-select"]="bulk-select",It["button-base"]="button-base",It["button-discrete-small"]="button-discrete-small",It["button-primary"]="button-primary",It["button-secondary"]="button-secondary",It["button-tertiary"]="button-tertiary",It["button-danger"]="button-danger",It["button-warning"]="button-warning",It["button-action"]="button-action",It.text="text",It["cell-button"]="cell-button",It["month-picker-left-button"]="month-picker-left-button",It["month-picker-right-button"]="month-picker-right-button",It["filter-bar"]="filter-bar",It["filter-search-bar"]="filter-search-bar",It["filter-pill"]="filter-pill",It["discrete-form-input"]="discrete-form-input",It["editable-form-input"]="editable-form-input",It["category-text"]="category-text",It["amount-input-container"]="amount-input-container",It["amount-input"]="amount-input",It["modal-popup"]="modal-popup",It["drawer-header"]="drawer-header",It["drawer-header-border"]="drawer-header-border",It["form-body"]="form-body",It.body="body",It.heading="heading",It["sub-label"]="sub-label",It["strong-label"]="strong-label",It["strong-sub-label"]="strong-sub-label",It["metric-xl"]="metric-xl",It["metric-md"]="metric-md",It["large-icon"]="large-icon",It["medium-icon"]="medium-icon",It["small-icon"]="small-icon",It["tiny-icon"]="tiny-icon",It["neutral-badge"]="neutral-badge",It["highlight-badge"]="highlight-badge",It["success-badge"]="success-badge",It["warning-badge"]="warning-badge",It["critical-badge"]="critical-badge",It["button-group"]="button-group",It["alert-dialog"]="alert-dialog",It["emphasis-label"]="emphasis-label",It["profit-loss-graph"]="profit-loss-graph",It.banner="banner",It["banner-high"]="banner-high",It["banner-medium"]="banner-medium",It["banner-low"]="banner-low",It["banner-urgent"]="banner-urgent",It["banner-default"]="banner-default",It["banner-button"]="banner-button",It["banner-button-text"]="banner-button-text",It["banner-button-icon"]="banner-button-icon",It["empty-dashboard-layout"]="empty-dashboard-layout",It["zero-state-layout"]="zero-state-layout",It["emphasis-sub-label"]="emphasis-sub-label",It);const At="Tight-",Nt=e=>`${At}${e}`;function Pt(e){return e in St}function Mt(e){const t=e.indexOf("-"),r=e.slice(0,t+1),n=e.slice(t+1);return r===At&&n in St}function Dt(e){return!Pt(e)&&!Mt(e)}const Rt=(e,...t)=>{const r=[],n=[];return null!==e&&r.push(Nt(e)),t.forEach(e=>{void 0!==e&&(Dt(e)?n.push(e):Pt(e)&&r.push(Nt(e)))}),{className:wt(...r,...n)}},Ot=Rt(St["business-owner-dashboard-header"],xt({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",height:80}));function _t({children:e}){return w("div",{...Ot,children:e})}function Lt(e){return e.reduce((e,t)=>[...e,...t.className.split(" ").reduce((e,t)=>(Mt(t)&&e.push(t),e),[])],[])}function Ft(e){return e.reduce((e,t)=>[...e,...t.className.split(" ").reduce((e,t)=>(Dt(t)&&e.push(t),e),[])],[])}function Bt(e){const t=Array.isArray(e)?e:[e];return{className:wt(...Lt(t),...Ft(t))}}const Wt=Et({base:{},variants:{body:{default:{fontWeight:"body",fontSize:{sm:"body",base:"lg"},fontFamily:"body",color:"typography.base",lineHeight:{sm:"16px",base:"18px"},letterSpacing:"0.84px"}},label:{default:{fontWeight:"label",fontSize:{sm:"label",base:"lg"},fontFamily:"label",color:"typography.label",lineHeight:{sm:"16px",base:"18px"},letterSpacing:"0.84px"},subLabel:{fontWeight:"label.sub",fontSize:{sm:"label.sub",base:"md"},fontFamily:"label",color:"typography.label.sub",lineHeight:{sm:"14px",base:"16px"},letterSpacing:"0.66px"},strongLabel:{fontWeight:"label.strong",fontSize:{sm:"label.strong",base:"lg"},fontFamily:"label",color:"typography.label.strong",lineHeight:{sm:"16px",base:"18px"},letterSpacing:"0.84px"},strongSubLabel:{fontWeight:"label.strongSub",fontSize:{sm:"label.strongSub",base:"md"},fontFamily:"label",color:"typography.label.strongSub",lineHeight:{sm:"14px",base:"16px"},letterSpacing:"0.84px"},emphasisSubLabel:{fontWeight:"label.emphasisSub",fontSize:{sm:"label.strongSub",base:"md"},fontFamily:"label",color:"typography.label.emphasisSub",lineHeight:{sm:"14px",base:"16px"},letterSpacing:"0.84px"}},heading:{default:{fontWeight:"heading",fontSize:"heading",fontFamily:"heading",color:"typography.heading",lineHeight:"25px",letterSpacing:"2px"}},metric:{sm:{fontWeight:"metric.sm",fontSize:"metric.sm",fontFamily:"metric",color:"typography.metric.sm"},md:{fontWeight:"metric.md",fontSize:"metric.md",fontFamily:"metric",color:"typography.metric.md"},lg:{fontWeight:"metric.lg",fontSize:"metric.lg",fontFamily:"metric",color:"typography.metric.lg"},xl:{fontWeight:"metric.xl",fontSize:"metric.xl",fontFamily:"metric",color:"typography.metric.xl"}}}}),Ht=Rt(St.heading,Wt({heading:"default"}));function Ut({children:e,stylists:t=[]}){const r=Bt([Ht,...t]);return w("div",{...r,children:e})}function Vt(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function zt(e,t,r){return new Date(e,t,r)}function jt(e,t){return Vt(zt(t,e,1))}const Kt={THIS_YEAR:"THIS_YEAR",THIS_MONTH:"THIS_MONTH",LAST_YEAR:"LAST_YEAR",LAST_MONTH:"LAST_MONTH",PAST_YEAR:"PAST_YEAR"},$t=e=>{switch(e){case Kt.THIS_YEAR:return Vt(zt(/* @__PURE__ */(new Date).getFullYear(),0,1));case Kt.THIS_MONTH:return function(){const e=/* @__PURE__ */new Date;return jt(e.getMonth(),e.getFullYear())}();case Kt.LAST_YEAR:return Vt(zt(/* @__PURE__ */(new Date).getFullYear()-1,0,1));case Kt.LAST_MONTH:return function(){const e=/* @__PURE__ */new Date;return Vt(zt(e.getFullYear(),e.getMonth()-1,1))}();case Kt.PAST_YEAR:return function(){const e=/* @__PURE__ */new Date;return Vt(zt(e.getFullYear()-1,e.getMonth(),1))}();default:return""}},qt=e=>{switch(e){case Kt.THIS_YEAR:return Vt(zt(/* @__PURE__ */(new Date).getFullYear()+1,0,0));case Kt.THIS_MONTH:return function(){const e=/* @__PURE__ */new Date;return Vt(zt(e.getFullYear(),e.getMonth()+1,0))}();case Kt.LAST_YEAR:return Vt(zt(/* @__PURE__ */(new Date).getFullYear(),0,0));case Kt.PAST_YEAR:case Kt.LAST_MONTH:return function(){const e=/* @__PURE__ */new Date;return Vt(zt(e.getFullYear(),e.getMonth(),0))}();default:return""}},Yt=e=>{return t=e,Object.values(Kt).includes(t)?{beginDate:$t(e),endDate:qt(e)}:{beginDate:Vt((r=e).beginDate),endDate:Vt(r.endDate)};var t,r},Gt=["SUN","MON","TUE","WED","THU","FRI","SAT"],Qt=["January","February","March","April","May","June","July","August","September","October","November","December"];function Xt({yearsBack:e=10,startYear:t}){const r=t??/* @__PURE__ */(new Date).getFullYear(),n=[r];for(let o=r-1;o>=r-e;o--)n.push(o);return n}function Zt(e,t){return e.toDateString()===t.toDateString()}function Jt(e){return Zt(e,/* @__PURE__ */new Date)}function er(e,t){const r=zt(e.getFullYear(),e.getMonth(),e.getDate()),n=zt(t.getFullYear(),t.getMonth(),t.getDate());return r.getTime()>n.getTime()}function tr(e){return e&&e instanceof Date&&!isNaN(e.getTime())?`${String(e.getMonth()+1).padStart(2,"0")}/${String(e.getDate()).padStart(2,"0")}/${e.getFullYear()}`:""}function rr(e,t,r){if(e<1||e>12||t<1||t>31)return!1;const n=zt(r,e-1,t);return!(n.getFullYear()!==r||n.getMonth()!==e-1||n.getDate()!==t)}function nr(e){if(!e.trim())return null;const t=e.match(/^(\d{1,2})\/(\d{1,2})\/(\d{1,4})$/);if(!t)return null;const[,r,n,o]=t,a=parseInt(r,10),i=parseInt(n,10),l=parseInt(o,10);return rr(a,i,l)?zt(l,a-1,i):null}function or(e){if(!e.trim())return null;const t=e.match(/^(\d{1,4})-(\d{1,2})-(\d{1,2})$/);if(!t)return null;const[,r,n,o]=t,a=parseInt(r,10),i=parseInt(n,10),l=parseInt(o,10);return rr(i,l,a)?zt(a,i-1,l):null}function ar(e){return e&&e instanceof Date&&!isNaN(e.getTime())?`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`:""}const ir=(e,t)=>{const r={month:t.abbreviateMonth?"short":"long",year:t.abbreviateYear?"2-digit":"numeric"};return e.toLocaleString("default",r)},lr=e=>{const t=new Date(e||""),r=/* @__PURE__ */new Date;return Jt(t)?t.toLocaleTimeString([],{hour:"numeric",minute:"2-digit"}):t.getFullYear()===r.getFullYear()?(e=>e.toLocaleString("default",{month:"short"})+" "+e.getDate())(t):ir(t,{abbreviateMonth:!0,abbreviateYear:!1})};function sr(e,t,r){return[...e,{accessToken:t,environment:r}]}function cr(e,t){return[...e,t]}const dr=e=>null==e,ur=e=>!dr(e);function hr(e){return dr(e)||""===e.trim()}function pr(e){return!hr(e)}const gr=h({activeToken:void 0,accountantToken:void 0});function mr(){const{activeToken:e}=p(gr);return e}const vr=()=>{throw new Error("No access token provided")},br=72e5,fr=new I({defaultOptions:{queries:{gcTime:br,staleTime:3e4,refetchInterval:6e4}}}),yr=h("SANDBOX");function Tr(){return p(yr)}function xr({queryKey:e,queryFn:t,...r}){const n=mr(),o=Tr(),a=pr(n),i=sr(e,n??"",o),l=S(),s=A({...r,queryKey:i,queryFn:a?t:vr,placeholderData:r.keepPreviousDataPlaceholder?N:void 0,...a?{}:{retry:!1,staleTime:1/0}},fr);return{isRehydrating:l,isFilling:l||s.isLoading,query:s}}class kr{constructor(e){this.client=e}async sendEvent({apiKey:e,events:t,notifier:r,payloadVersion:n}){const o=/* @__PURE__ */(new Date).toISOString(),a=JSON.stringify({apiKey:e,payloadVersion:n,notifier:r,events:t});await fetch(this.client.endpoints.notify,{method:"POST",mode:"cors",credentials:"omit",headers:{"Content-Type":"application/json","Bugsnag-Api-Key":e,"Bugsnag-Payload-Version":n,"Bugsnag-Sent-At":o},referrerPolicy:"no-referrer",body:a})}}const wr=Symbol("Circular"),Cr=Symbol("AccessError");function Er(e,t,r){return Ir({key:"",value:e,replacer:t,seen:[],depth:0,depthLimit:r?.depthLimit,edgeIndex:0,edgesLimit:r?.edgesLimit})}function Ir({key:e,value:t,replacer:r,seen:n,depthLimit:o=1/0,depth:a,edgeIndex:i,edgesLimit:l=1/0}){let s=t;if(n.includes(s)&&(s=wr),r&&(s=r(e,s)),"object"==typeof(c=s)&&null!==c&&"toJSON"in c&&"function"==typeof c.toJSON&&(s=Sr(()=>s.toJSON(String(e)))),null===s||"object"!=typeof s)return s;var c;if(a>o||i+1>l)return"[...]";if(n.push(t),Array.isArray(s)){const e=[],t=Math.min(s.length,l);for(let i=0;i<t;i++){const t=Sr(()=>s[i]);e.push(Ir({key:i,value:t,replacer:r,seen:n,depth:a,depthLimit:o,edgeIndex:i,edgesLimit:l}))}t<s.length&&e.push("[...]"),s=e}else{const e={},t=Object.keys(s);for(let i=0;i<t.length;i++){const c=t[i],d=Sr(()=>s[c]);e[c]=Ir({key:c,value:d,replacer:r,seen:n,depth:a,depthLimit:o,edgeIndex:i,edgesLimit:l})}s=e}return n.pop(),s}function Sr(e){try{return e()}catch{return Cr}}const Ar=Object.prototype.toString,Nr=Object.getPrototypeOf;function Pr(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const Mr=/^\s*at .*(\S+:\d+|\(native\))/m,Dr=/^(eval@)?(\[native code])?$/;function Rr(e){if(-1===e.indexOf(":"))return[e];const t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!t)return[e];const r=t[2]?parseInt(t[2],10):void 0,n=t[3]?parseInt(t[3],10):void 0;return[t[1],r,n]}function Or(e,t){const r=_r(e,t);let n;"InvalidError"===r.name&&(n={[t]:{"non-error parameter":e}}),void 0!==r.metadata&&Pr(r.metadata)&&(n={...n,[r.name]:r.metadata});const o=[Lr(r)];return o.push(...Wr(r).map(e=>Lr(e,{backtrace:!1}))),{exceptions:o,metadata:n}}function _r(e,t){if(function(e){if(e instanceof Error)return!0;let t=e;for(;t;){if("[object Error]"===Ar.call(t))return!0;t=Nr(t)}return!1}(e))return e;let r=function(e){if(!Pr(e))return null;const t=t=>{const r=e[t];if("string"==typeof r&&e[t.length])return r},r=t("name")||t("errorClass"),n=t("message")||t("errorMessage");if(!r||!n)return null;const o=new Error(n);return o.name=r,o}(e);if(r)return r;switch(typeof r){case"string":case"number":case"boolean":return new Error(String(e));default:return r=new Error(`${t} received a non-error. See "${t}" tab for more detail.`),r.name="InvalidError",r}}function Lr(e,t={backtrace:!1}){return{errorClass:e.name,message:e.message,stacktrace:Fr(e,t),type:"object"==typeof self&&self.navigator?"browserjs":"nodejs"}}function Fr(e,{backtrace:t}){const r=function(e){let t=e.stack;return void 0===t&&(t=e.stacktrace),"string"==typeof t&&t.length&&t!==`${e.name}: ${e.message}`?t:void 0}(e);return r?function(e){return(e.match(Mr)?e.split("\n").filter(e=>!!e.match(Mr)).map(e=>{e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));let t=e.replace(/^\s+/,"").replace(/\(eval code/g,"(");const r=t.match(/ (\((.+):(\d+):(\d+)\)$)/);t=r?t.replace(r[0],""):t;const n=t.split(/\s+/).slice(1),o=Rr(r?r[1]:n.pop()||"(no location)"),a=n.join(" ")||void 0;return{file:["eval","<anonymous>"].indexOf(o[0])>-1?void 0:o[0],lineNumber:o[1],columnNumber:o[2],method:a}}):(t=e,t.split("\n").filter(e=>!e.match(Dr)).map(e=>{if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return{method:e};{const t=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=e.match(t),n=r&&r[1]?r[1]:void 0,o=Rr(e.replace(t,""));return{file:o[0],lineNumber:o[1],columnNumber:o[2],method:n}}}))).reduce((e,t)=>{if("{}"===JSON.stringify(t))return e;let r=t.file||t.method||"number"!=typeof t.lineNumber?t.file||"(unknown file)":"global code";r=r.replace(/\?.*$/,"").replace(/#.*$/,"");let n=t.method||"(unknown function)";return n=/^global code$/i.test(n)?"global code":n,e.concat([{file:r,lineNumber:t.lineNumber,columnNumber:t.columnNumber,method:n}])},[]);var t}(r):t?function(){const e=[];let t;try{t=arguments.callee}catch{return[]}for(;t&&e.length<Br;){t.name?e.push({method:t.name,file:"(unknown file)"}):/function(?:\s+([\w$]+))+\s*\(/.test(t.toString())&&e.push({method:RegExp.$1,file:"(unknown file)"});try{t=t.caller}catch{break}}return e}():[]}const Br=20;function Wr(e){const t=e;if(t.cause){const e=_r(t.cause,"cause");return"InvalidError"===e.name?[]:[e].concat(Wr(e))}return[]}function Hr(...e){console.error}const Ur={name:"errorBreadcrumbs",load(e){e.addOnPostError(t=>{e.leaveBreadcrumb(t.exceptions[0].errorClass,{errorClass:t.exceptions[0].errorClass,errorMessage:t.exceptions[0].message,severity:t.severity},"error")})}};let Vr=Date.now();const zr=()=>{Vr=Date.now()},jr={name:"appDuration",load:e=>(e.addOnError(e=>{const t=Date.now();return e.app=e.app||{},e.app.duration=t-Vr,!0}),{reset:zr})},Kr=[["Edge (EdgeHTML)",/Edge\/([0-9._]+)/],["Edge (iOS)",/EdgiOS\/([0-9._]+)/],["Yandex",/YaBrowser\/([0-9._]+)/],["KakaoTalk",/KAKAOTALK\s([0-9.]+)/],["Samsung",/SamsungBrowser\/([0-9.]+)/],["Silk",/\bSilk\/([0-9._-]+)\b/],["MIUI",/MiuiBrowser\/([0-9.]+)$/],["Beaker",/BeakerBrowser\/([0-9.]+)/],["Edge (Chromium)",/EdgA?\/([0-9.]+)/],["Chromium WebView",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9.]+)(:?\s|$)/],["Chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9.]+)(:?\s|$)/],["Chrome (iOS)",/CriOS\/([0-9.]+)(:?\s|$)/],["Firefox",/Firefox\/([0-9.]+)(?:\s|$)/],["Firefox (iOS)",/FxiOS\/([0-9.]+)/],["Opera Mini",/Opera Mini.*Version\/([0-9.]+)/],["Opera",/Opera\/([0-9.]+)(?:\s|$)/],["Opera",/OPR\/([0-9.]+)(:?\s|$)/],["Internet Explorer",/Trident\/7\.0.*rv:([0-9.]+).*\).*Gecko$/],["Internet Explorer",/MSIE\s([0-9.]+);.*Trident\/[4-7].0/],["Internet Explorer",/MSIE\s(7\.0)/],["Blackberry",/BB10;\sTouch.*Version\/([0-9.]+)/],["Android",/Android\s([0-9.]+)/],["Safari (iOS)",/Version\/([0-9._]+).*Mobile.*Safari.*/],["Safari",/Version\/([0-9._]+).*Safari/],["Facebook",/FB[AS]V\/([0-9.]+)/],["Instagram",/Instagram\s([0-9.]+)/],["iOS WebView",/AppleWebKit\/([0-9.]+).*Mobile/],["iOS WebView",/AppleWebKit\/([0-9.]+).*Gecko\)$/]],$r=[["iOS",void 0,/iP(hone|od|ad)/],["Android",void 0,/Android/],["BlackBerry",void 0,/BlackBerry|BB10/],["Windows Mobile",void 0,/IEMobile/],["Kindle",void 0,/Kindle/],["Windows","3.11",/Win16/],["Windows","95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows","98",/(Windows 98)|(Win98)/],["Windows","2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows","XP",/(Windows NT 5.1)|(Windows XP)/],["Windows","Server 2003",/(Windows NT 5.2)/],["Windows","Vista",/(Windows NT 6.0)/],["Windows","7",/(Windows NT 6.1)/],["Windows","8",/(Windows NT 6.2)/],["Windows","8.1",/(Windows NT 6.3)/],["Windows","10+",/(Windows NT 10.0)/],["Windows","ME",/Windows ME/],["Open BSD",void 0,/OpenBSD/],["Sun OS",void 0,/SunOS/],["Chrome OS",void 0,/CrOS/],["Linux",void 0,/(Linux)|(X11)/],["Mac OS",void 0,/(Mac_PowerPC)|(Macintosh)/],["QNX",void 0,/QNX/],["BeOS",void 0,/BeOS/],["OS/2",void 0,/OS\/2/]],qr=(Yr=function(e){const t=""!==(r=e)&&Kr.reduce((e,[t,n])=>{if(e)return e;const o=n.exec(r);return!!o&&[t,o]},!1);var r;if(!t)return{};const[n,o]=t,a=function(e){for(const[t,r,n]of $r)if(n.exec(e))return{osName:t,osVersion:r};return null}(e),i="iOS"===a?.osName?function(e){const t=/iPad|iPhone|iPod/.exec(e);return t?{manufacturer:"Apple",model:t[0]}:/MacIntel/.test(e)&&self.navigator&&self.navigator.maxTouchPoints&&self.navigator.maxTouchPoints>2?{manufacturer:"Apple",model:"iPad"}:null}(e):{};return{browserName:n,browserVersion:o[1],osName:a?.osName,osVersion:a?.osVersion,manufacturer:i?.manufacturer,model:i?.model}},{name:"browserContext",load(e){e.addOnError(e=>{e.request={...e.request,url:self.location.href},e.context=e.context||self.location.pathname,e.device={...e.device,...Yr(self.navigator.userAgent),locale:self.navigator.language,userAgent:self.navigator.userAgent};let t=["n/a"];try{t=self.navigator.languages}catch{}return e.metaData={...e.metaData,language:{language:self.navigator.language,languages:t}},!0})}});var Yr;class Gr{limit;period;events;constructor(e,t){this.limit=e,this.period=t,this.events=new M}reset(){this.events.clear()}increment(){const e=/* @__PURE__ */(new Date).getTime();if(void 0!==this.period){let t=this.events.peek();for(;void 0!==t&&e-this.period>t;)this.events.dequeue(),t=this.events.peek()}const t=this.events.size+1<=this.limit;return t&&this.events.enqueue(e),t}get size(){return this.events.size}}class Qr extends g{constructor(e){super(e),this.state={error:void 0,errorInfo:void 0}}handleClearError(){this.setState({error:void 0,errorInfo:void 0})}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){const{exceptions:r,metadata:n}=Or(e,"notify");t&&t.componentStack&&(t.componentStack=function(e){const t=e.split(/\s*\n\s*/g);let r="";for(let n=0,o=t.length;n<o;n++)t[n].length&&(r+=`${r.length?"\n":""}${t[n]}`);return r}(t.componentStack));const{onError:o,client:a}=this.props;a.notifyEvent({exceptions:r,unhandled:!0,severity:"error",severityReason:{type:"unhandledException"},metadata:{...n,react:t},onError:o},e),this.setState({errorInfo:t})}render(){const{error:e}=this.state;if(e){const{FallbackComponent:e}=this.props;if(e)return w(e,{error:this.state.error,errorInfo:this.state.errorInfo,clearError:()=>this.handleClearError()})}return w(C,{children:this.props.children})}}const Xr={name:"react",load:e=>({BugsnagErrorBoundary:({onError:t,fallbackComponent:r,children:n})=>w(Qr,{client:e,onError:t,FallbackComponent:r,children:n})})},Zr=new class{breadcrumbs=[];config;delivery=new kr(this);errorCallbacks=/* @__PURE__ */new Set;postErrorCallbacks=/* @__PURE__ */new Set;plugins=[];start(e){if(this.config)return Hr(),this;let t;this.config=e,this.config.onError&&(t=Array.isArray(this.config.onError)?this.config.onError:[this.config.onError]),this.errorCallbacks=new Set(t);for(const r of this.config.plugins||[])this.plugins.push({name:r.name||"unknown",plugin:r.load(this)});return this}get endpoints(){return{notify:this.config?.endpoints?.notify||"https://notify.bugsnag.com/"}}notify(e,t={}){const{exceptions:r,metadata:n}=Or(e,"notify");let o,a,i=n;return"function"==typeof t?o=t:(a=t.severity,t.metadata&&(i={...n,...t.metadata})),this.notifyEvent({exceptions:r,metadata:i,severity:a,onError:o},e)}leaveBreadcrumb(e,t,r){if(!this.config)return;if("string"!=typeof e)try{e=String(e)}catch{e="Unable to stringify breadcrumb message"}if(!e.length)return;this.breadcrumbs.push({name:e,metaData:t,type:r||"manual",timestamp:/* @__PURE__ */(new Date).toISOString()});const{maxBreadcrumbs:n=25}=this.config;this.breadcrumbs.length>n&&this.breadcrumbs.splice(0,this.breadcrumbs.length-n)}async notifyEvent({exceptions:e,unhandled:t,severity:r,severityReason:n,metadata:o,onError:a},i){if(!this.config)return;const l=this.config.releaseStage||"production";if(this.config.enabledReleaseStages&&!this.config.enabledReleaseStages.includes(l))return;const s={exceptions:e,breadcrumbs:this.breadcrumbs.length?this.breadcrumbs:void 0,originalError:i,unhandled:"boolean"==typeof t&&t,severity:r||"warning",severityReason:n,user:this.config.user||void 0,app:{releaseStage:l,version:this.config.appVersion,type:this.config.appType||("object"==typeof window?"browser":"node")},device:{time:/* @__PURE__ */(new Date).toISOString()},metaData:o||{}},c=[...this.errorCallbacks];a&&c.push(a);const d=["stringifyValues","redact"];c.sort((e,t)=>d.includes(e.name)&&d.includes(t.name)?0:d.includes(e.name)?1:d.includes(t.name)?-1:0);for(const m of c){const e=await m(s);if("boolean"==typeof e&&!e)return}const u=Er(s,(e,t)=>{if("originalError"!==e)return t},{depthLimit:20,edgesLimit:500});let h;const p={apiKey:this.config.apiKey,payloadVersion:"5",notifier:{name:"Tight Components",version:"1",url:"https://github.com/Hurdlr/TraxComponents/tree/dev/src/bugsnag/README.md"},events:[u]};try{h=JSON.stringify(p)}catch{u.metaData={notifier:"Unable to serialize metadata"},h=JSON.stringify(p)}if(h.length>1e6&&(u.metaData={notifier:`Payload was ${h.length/1e6}Mb. Metadata removed.`},h=JSON.stringify(p),h.length>1e6))throw new Error("Payload exceeded 1Mb limit");for(const m of this.postErrorCallbacks)m(s);try{await this.delivery.sendEvent(p)}catch(g){Hr()}}getUser(){return this.config?.user||{}}setUser(e,t,r){this.config&&(this.config.user={id:e,email:t,name:r})}setProperties(e){this.config&&(this.config.releaseStage=e)}addOnError(e){this.errorCallbacks.add(e)}removeOnError(e){this.errorCallbacks.delete(e)}addOnPostError(e){this.postErrorCallbacks.add(e)}removeOnPostError(e){this.postErrorCallbacks.delete(e)}getPlugin(e){return this.plugins.find(t=>t.name===e)?.plugin}setDelivery(e){this.delivery=e}};let Jr="",en="";const tn="prod",rn=Zr.start({apiKey:"899aec02393ac236377b73b483800d2c",appVersion:"1.2.0",appType:"browser",releaseStage:tn,plugins:[jr,qr,Ur,(()=>{const e=new Gr(15,1e3);return"undefined"!=typeof window&&window.addEventListener("popstate",e.reset),{name:"limitEvents",load:t=>(t.addOnError(function(){return e.increment()}),{reset:e.reset})}})(),Xr]}),nn=(e,t)=>{try{Zr.leaveBreadcrumb(e,t)}catch(r){r instanceof Error?on({error:r,severity:"error"}):on({error:new Error("Unknown error in logging.breadcrumb"),severity:"error",extraData:{originalError:r}})}},on=async e=>{try{await Zr.notify(e.error,t=>(t.severity=e.severity,e.groupingHash&&(t.groupingHash=e.groupingHash),t.metaData={...t.metaData,custom:{...e.extraData,accessToken:Jr,environment:en}},!0)),e.error,e.error.message,e.extraData,console.warn}catch(t){t instanceof Error?await on({error:t,severity:"error"}):await on({error:new Error("Unknown error in logging.notify"),severity:"error",extraData:{originalError:t}})}},an=rn.getPlugin("react"),ln=an?.BugsnagErrorBoundary,sn=(e,t)=>`${encodeURIComponent(e)}=${encodeURIComponent(t)}`,cn=({extraHeaders:e,authorization:t})=>{const r={...e};return void 0!==t&&(r.Authorization=t),r},dn=async e=>{const t=await e.json();return e.ok?t:Promise.reject(t)},un={"hurdlr-cache-session":!0,"hurdlr-auto-refresh-token":!0};function hn(e){const t=(({accessToken:e,extraHeaders:t})=>{const r={Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${e}`};return void 0!==t?{...o(t,e=>`${e}`),...r}:r})({accessToken:e.accessToken,extraHeaders:{...e.extraHeaders,...e.pagination,..."v5"===e.endpointManager.apiVersion?un:{}}});return{url:(r=e.endpointManager.getUrl(e.path),n=e.pathParams,void 0!==n&&Object.entries(n).forEach(([e,t])=>{r=r.replace(`{${e}}`,t)}),r),headers:t};var r,n}async function pn({authorization:e,extraHeaders:t,includeCredentials:r,method:n="POST",params:o,url:a}){const i=cn({extraHeaders:t,authorization:e});nn("HTTP POST Request",{url:a,accessToken:e});try{const e=await fetch(a,{method:n,headers:i,credentials:"include",body:JSON.stringify(o)});return nn("HTTP POST Response",{url:a,status:e.status,statusText:e.statusText}),dn(e)}catch(l){return Promise.reject(l)}}async function gn(e){const{url:t,headers:r}=hn(e);return pn({url:t,params:e.bodyParams,includeCredentials:!0,extraHeaders:r})}async function mn(e){return gn(e)}async function vn(e){return gn(e)}const bn=(e,t)=>({getUrl:t=>((e,t)=>{let r=t;for(;r.length>0&&"/"===r.charAt(0);)r=r.slice(1);return`${e}/${r}`})(e,t),baseUrl:e,apiVersion:t}),fn={DEVELOPMENT:"https://dev.hurdlr.com/rest",PRODUCTION:"https://prod.hurdlr.com/rest",SANDBOX:"https://sandbox.hurdlr.com/rest",LOCAL:"http://localhost:8081/TraxAngular/rest"},yn={DEVELOPMENT:"https://dev.tight.com",PRODUCTION:"https://prod.tight.com",SANDBOX:"https://sandbox.tight.com",LOCAL:"http://localhost:8080"},Tn={...yn,LOCAL:"http://localhost:8082"};function xn(e){return bn(`${t=e,fn[t]}/v5`,"v5");var t}const kn=({filter:e,grouping:t})=>["reports/profitAndLoss",{filter:e,...t&&{grouping:t}}],wn=async e=>{const t=e.queryKey,r=t[1],n=t[2].accessToken,o=t[2].environment,a={path:"/reports/profitAndLoss",bodyParams:{exportType:"JSON",...Yt(r.filter),...r.grouping&&{grouping:r.grouping}},accessToken:n,endpointManager:xn(o)};return await vn(a)};function Cn({filter:e,grouping:t,select:r}){return xr({queryKey:kn({filter:e,grouping:t}),queryFn:wn,select:r})}const En="noDataHeight";function In(e){const t=function(e){const t=or(e??"");return null!==t?ir(t,{abbreviateMonth:!0,abbreviateYear:!0}):""}(e.period?.beginDate),r=e.netIncome??0,{profit:n,remainingIncome:o,loss:a,remainingExpenses:i}=function(e,t,r){const n=e>0?e:0,o=e<0?e:0;return{profit:n,remainingIncome:void 0!==t?D(t).minus(n).toNumber():0,loss:o,remainingExpenses:void 0!==r?D(r).plus(o).toNumber():0}}(r,e.income?.total,e.expenses?.total);return{month:{month:t,income:o,expenses:-i,profit:n,loss:a,netIncome:r,hasNoData:/* @__PURE__ */function(e,t,r){return 0===e&&0===t&&0===r}(r,o,i)},netIncome:r}}function Sn(e){const t={total:0,domain:[],months:[],hasAnyData:!1};if("FAILURE_NO_DATA"===e.result)return t;const r=e.json?.data;if(dr(r))return t;for(const i of r){const{month:e,netIncome:r}=In(i);t.total=D(r).plus(t.total).toNumber(),t.months.push(e)}const{domainMin:n,domainMax:o}=r.reduce((e,t)=>({domainMin:Math.min(e.domainMin,-(t.expenses?.total??0)),domainMax:Math.max(e.domainMax,t.income?.total??0)}),{domainMin:0,domainMax:0});t.domain=[n,o],t.hasAnyData=t.months.some(e=>!e.hasNoData);const a=function(e,t){const r=t-e;return r>0?.03*r:3}(n,o);return t.months=t.months.map(e=>e.hasNoData?{...e,noDataHeight:a}:e),t}const An=Rt(St["tile-header"],xt({backgroundColor:"surface.foreground",border:"{borderWidths.lg} solid {colors.border.layout.strong}",borderTopRadius:"lg",display:"flex",justifyContent:"space-between",alignItems:"center",padding:"15px"}));function Nn({title:e}){return w("div",{...An,children:w(Ut,{children:e})})}const Pn=Rt(St["tile-body"],xt({display:"flex",justifyContent:"start",alignItems:"start",flexDirection:"column",gap:"20px",height:"100%",padding:"20px 15px",backgroundColor:"surface.foreground",border:"{borderWidths.lg} solid {colors.border.layout.strong}",borderBottomRadius:"lg",borderTop:"hidden"}));function Mn({children:e}){return w("div",{...Pn,children:e})}const Dn=Et({base:{display:"flex",flexDirection:"column",boxShadow:"box-shadow",transition:"height 0.5s, width 0.5s",position:"relative"},variants:{type:{default:{width:"400px",flexShrink:0,height:"300px"},chart:{minWidth:"900px",maxWidth:"1440px",height:"481px"}},isSample:{true:{pointerEvents:"none"},false:{}}},defaultVariants:{type:"default"}});function Rn({children:e,type:t,isSample:r=!1}){const n=Rt(St.tile,Dn({type:t,isSample:r}));return w("div",{...n,children:e})}const On=xt({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}),_n=xt.raw({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"100%"}),Ln=xt({fontSize:"sm",fontStyle:"normal",fontWeight:"sm",lineHeight:"12px",letterSpacing:"0.66px"}),Fn=Rt(St.text,xt({fontSize:"md",fontWeight:"sm",color:"typography.base",fontStyle:"normal",letterSpacing:"0.84px",maxWidth:"100%"}),On);function Bn({children:e}){return w("div",{...Fn,children:e})}const Wn=Rt(St["metric-xl"],Wt({metric:"xl"}));function Hn(e){return w("div",{...Wn,children:e.children})}const Un=Rt(St.summation,xt({display:"flex",flexDirection:"column",flexShrink:1,alignItems:"flex-start",justifyContent:"space-between"}));function Vn({title:e,label:t}){return E("div",{...Un,children:[w(Hn,{children:e}),w(Bn,{children:t})]})}const zn=Rt(null,xt({display:"flex",flexDirection:"column",justifyContent:"space-evenly",alignItems:"start",height:"100%",width:"100%"}));function jn({children:e}){return w("div",{...zn,children:e})}const Kn=(e,t=0)=>{const r=Math.abs(e);let n;if(t<=0)n=Math.round(r);else{const e=r.toFixed(t);n=parseFloat(e)}return Math.sign(e)*n},$n=(e,t=0,r=2)=>e.toLocaleString(void 0,{useGrouping:!0,minimumFractionDigits:t,maximumFractionDigits:r}),qn=1e9;function Yn(e,{cents:t="default",condense:r=!1,dollarSign:n=!1,signage:o="default"}={}){const a="string"==typeof e?parseFloat(e):e;if(Number.isNaN(a))return"";let i;const l=Math.abs(a);let s;if(r&&l>99999){s=Math.sign(a)<0;const e=Math.floor((d=l,Math.log(d)/Math.log(1e3)))-1,t=Math.pow(1e3,e),r=Math.round(l/t),n=r*t;let o,c=r/1e3;l<qn&&c>=1e3&&(c/=1e3),n>=qn?o="B":n>=1e6?o="M":(c=Math.round(c),o="K"),i=`${$n(c,0,1)}${o}`}else{let e;const r=2,n=0;let o,l;"floor"===t?(o=n,l=n,c=a,e=Math.sign(c)*Math.floor(Math.abs(c))):"round"===t?(o=n,l=n,e=Kn(a,o)):"always"===t?(o=r,l=r,e=Kn(a,o)):"default"===t&&Math.abs(a)>=1e3?(o=n,l=n,e=Kn(a,o)):(o=r,e=Kn(a,o),l=e%1==0?n:r),s=Math.sign(e)<0;const d=Math.abs(e);i=$n(d,l,o)}var c,d;let u=i;const h=n?"$":"";return void 0===o||"off"===o?u=i:"parens"===o?u=`${h}${s?`(${i})`:i}`:"always"===o?u=`${s?"-":"+"}${h}${i}`:"default"===o&&(u=`${s?"-":""}${h}${i}`),u}function Gn(e){return Yn(e,{condense:!0,dollarSign:!0})}function Qn(e){return Yn(e,{cents:"always",condense:!1,dollarSign:!0,signage:"always"})}const Xn={"sm-sm":Rt(St.text,xt({fontSize:{sm:"sm",base:"md"},fontWeight:"sm",color:"typography.base",fontStyle:"normal",letterSpacing:"0.84px",maxWidth:"100%"}),On),"sm-med":Rt(St.text,xt({fontSize:{sm:"sm",base:"md"},fontWeight:"md",color:"typography.base",fontStyle:"normal",letterSpacing:"0.84px",maxWidth:"100%"}),On),"sm-lg":Rt(St.text,xt({fontSize:"sm",fontWeight:"lg",color:"typography.base",fontStyle:"normal",letterSpacing:"0.84px",maxWidth:"100%"}),On),"med-sm":Rt(St.text,xt({fontSize:{sm:"md",base:"lg"},fontWeight:"sm",color:"typography.base",fontStyle:"normal",letterSpacing:"0.84px",maxWidth:"100%"}),On),"med-med":Rt(St.text,xt({fontSize:{sm:"md",base:"lg"},fontWeight:"md",color:"typography.base",fontStyle:"normal",letterSpacing:"0.84px",maxWidth:"100%"}),On),"med-lg":Rt(St.text,xt({fontSize:{sm:"md",base:"lg"},fontWeight:"lg",color:"typography.base",fontStyle:"normal",letterSpacing:"0.84px",maxWidth:"100%"}),On)};function Zn({children:e,size:t,weight:r,stylists:n=[]}){const o=Bt([Xn[`${t}-${r}`],...n]);return w("div",{title:e,...o,children:e})}const Jn=Et({variants:{wrap:{ellipsis:_n,wrap:{whiteSpace:"normal",overflowWrap:"break-word"}},textAlign:{start:{textAlign:"start"},center:{textAlign:"center"}}}});function eo({wrap:e="ellipsis",textAlign:t="start",children:r,stylists:n=[]}){if(hr(r))return null;const o=Rt(St["strong-label"],Wt({label:"strongLabel"}),Jn({wrap:e,textAlign:t}));return w(Zn,{size:"med",weight:"med",stylists:[o,...n],children:r})}const to=Et({base:{fontWeight:"label.sub",fontSize:{sm:"label.sub",base:"md"},fontFamily:"label",lineHeight:{sm:"14px",base:"16px"},letterSpacing:"0.66px",fontStyle:"normal"},variants:{intent:{normal:{color:"typography.label.sub"},action:{color:"typography.intent.action"},primary:{color:"typography.intent.primary"},danger:{color:"typography.accent.danger"}},accent:{action:{_supportHover:{color:"typography.accent.action",transition:"color 100ms ease-out"},transition:"color 300ms ease-out"},active:{color:"typography.accent.action"}},wrap:{ellipsis:_n,wrap:{whiteSpace:"normal",overflowWrap:"break-word"}}}});function ro({intent:e,wrap:t="ellipsis",children:r,accent:n}){const o=void 0===e&&void 0===n?"normal":void 0,a=Rt(St["sub-label"],to({intent:o,wrap:t,accent:n}),On);return hr(r)?null:w("div",{...a,children:r})}const no=Rt(null,xt({display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",border:"1px solid {colors.border.layout}",borderRadius:"sm",backgroundColor:"surface.background",boxShadow:"box-shadow",padding:"10px",width:"fit-content",height:"fit-content"}));function oo({active:e,payload:t}){if(t.length<=0||!e||t[0].dataKey===En)return null;let r=t[0].value??0;return"expenses"===t[0].dataKey?r+=t[0].payload.loss:"income"===t[0].dataKey&&(r+=t[0].payload.profit),E("div",{...no,children:[w(eo,{children:t[0].name??""}),w(ro,{children:Gn(Number(r))})]})}const ao={"colors.white100":{value:"#FFFFFF",variable:"var(--Tight-colors-white100)"},"colors.white200":{value:"#F9F9F9",variable:"var(--Tight-colors-white200)"},"colors.white300":{value:"#EDEDED",variable:"var(--Tight-colors-white300)"},"colors.white600":{value:"#E7E8E9",variable:"var(--Tight-colors-white600)"},"colors.black100":{value:"#CED1D2",variable:"var(--Tight-colors-black100)"},"colors.black400":{value:"#6F7576",variable:"var(--Tight-colors-black400)"},"colors.black600":{value:"#50595C",variable:"var(--Tight-colors-black600)"},"colors.black700":{value:"#182428",variable:"var(--Tight-colors-black700)"},"colors.blue300":{value:"#DAF4FA",variable:"var(--Tight-colors-blue300)"},"colors.blue400":{value:"#CAECF3",variable:"var(--Tight-colors-blue400)"},"colors.blue500":{value:"#94D8E8",variable:"var(--Tight-colors-blue500)"},"colors.blue700":{value:"#2AB2D1",variable:"var(--Tight-colors-blue700)"},"colors.blue900":{value:"#177F96",variable:"var(--Tight-colors-blue900)"},"colors.green300":{value:"#B8F3D5",variable:"var(--Tight-colors-green300)"},"colors.green400":{value:"#94E8BD",variable:"var(--Tight-colors-green400)"},"colors.green500":{value:"#5FDD9C",variable:"var(--Tight-colors-green500)"},"colors.green700":{value:"#009C75",variable:"var(--Tight-colors-green700)"},"colors.yellow300":{value:"#FFE787",variable:"var(--Tight-colors-yellow300)"},"colors.yellow400":{value:"#FCD34D",variable:"var(--Tight-colors-yellow400)"},"colors.yellow500":{value:"#FBBF24",variable:"var(--Tight-colors-yellow500)"},"colors.red300":{value:"#FF9797",variable:"var(--Tight-colors-red300)"},"colors.red400":{value:"#F45C5C",variable:"var(--Tight-colors-red400)"},"colors.red500":{value:"#E84747",variable:"var(--Tight-colors-red500)"},"colors.red700":{value:"#E42525",variable:"var(--Tight-colors-red700)"},"fonts.base":{value:"Duplet Regular, sans-serif",variable:"var(--Tight-fonts-base)"},"fontSizes.sm":{value:"11px",variable:"var(--Tight-fontSizes-sm)"},"fontSizes.md":{value:"14px",variable:"var(--Tight-fontSizes-md)"},"fontSizes.lg":{value:"16px",variable:"var(--Tight-fontSizes-lg)"},"fontSizes.xl":{value:"20px",variable:"var(--Tight-fontSizes-xl)"},"fontSizes.2xl":{value:"36px",variable:"var(--Tight-fontSizes-2xl)"},"fontWeights.sm":{value:"400",variable:"var(--Tight-fontWeights-sm)"},"fontWeights.md":{value:"600",variable:"var(--Tight-fontWeights-md)"},"fontWeights.lg":{value:"900",variable:"var(--Tight-fontWeights-lg)"},"radii.zero":{value:"0",variable:"var(--Tight-radii-zero)"},"radii.sm":{value:"1px",variable:"var(--Tight-radii-sm)"},"radii.md":{value:"2px",variable:"var(--Tight-radii-md)"},"radii.lg":{value:"4px",variable:"var(--Tight-radii-lg)"},"borderWidths.sm":{value:"0.5px",variable:"var(--Tight-borderWidths-sm)"},"borderWidths.md":{value:"1px",variable:"var(--Tight-borderWidths-md)"},"borderWidths.lg":{value:"1px",variable:"var(--Tight-borderWidths-lg)"},"borderWidths.xl":{value:"2px",variable:"var(--Tight-borderWidths-xl)"},"animations.appear.instant":{value:"0.25s linear fade-in",variable:"var(--Tight-animations-appear-instant)"},"animations.appear.delay":{value:"0.25s linear both 1.5s fade-in",variable:"var(--Tight-animations-appear-delay)"},"animations.shimmer":{value:"2s ease-in-out infinite shimmer",variable:"var(--Tight-animations-shimmer)"},"animations.spin":{value:"1.5s ease-in-out 0.1s spin infinite",variable:"var(--Tight-animations-spin)"},"shadows.box-shadow":{value:"0px 10px 30px 0px rgba(24, 36, 40, 0.10)",variable:"var(--Tight-shadows-box-shadow)"},"breakpoints.sm":{value:"640px",variable:"var(--Tight-breakpoints-sm)"},"breakpoints.md":{value:"850px",variable:"var(--Tight-breakpoints-md)"},"breakpoints.lg":{value:"1024px",variable:"var(--Tight-breakpoints-lg)"},"breakpoints.xl":{value:"1280px",variable:"var(--Tight-breakpoints-xl)"},"breakpoints.1.5xl":{value:"1400px",variable:"var(--Tight-breakpoints-1.5xl)"},"breakpoints.2xl":{value:"1536px",variable:"var(--Tight-breakpoints-2xl)"},"sizes.breakpoint-sm":{value:"640px",variable:"var(--Tight-sizes-breakpoint-sm)"},"sizes.breakpoint-md":{value:"850px",variable:"var(--Tight-sizes-breakpoint-md)"},"sizes.breakpoint-lg":{value:"1024px",variable:"var(--Tight-sizes-breakpoint-lg)"},"sizes.breakpoint-xl":{value:"1280px",variable:"var(--Tight-sizes-breakpoint-xl)"},"sizes.breakpoint-1.5xl":{value:"1400px",variable:"var(--Tight-sizes-breakpoint-1.5xl)"},"sizes.breakpoint-2xl":{value:"1536px",variable:"var(--Tight-sizes-breakpoint-2xl)"},"colors.brand.primary.weak":{value:"var(--Tight-colors-black400)",variable:"var(--Tight-colors-brand-primary-weak)"},"colors.brand.primary":{value:"var(--Tight-colors-black600)",variable:"var(--Tight-colors-brand-primary)"},"colors.brand.primary.strong":{value:"var(--Tight-colors-black700)",variable:"var(--Tight-colors-brand-primary-strong)"},"colors.brand.secondary.weak":{value:"var(--Tight-colors-white200)",variable:"var(--Tight-colors-brand-secondary-weak)"},"colors.brand.secondary":{value:"var(--Tight-colors-white600)",variable:"var(--Tight-colors-brand-secondary)"},"colors.brand.secondary.strong":{value:"var(--Tight-colors-black100)",variable:"var(--Tight-colors-brand-secondary-strong)"},"colors.brand.action.weak":{value:"var(--Tight-colors-blue300)",variable:"var(--Tight-colors-brand-action-weak)"},"colors.brand.action":{value:"var(--Tight-colors-blue400)",variable:"var(--Tight-colors-brand-action)"},"colors.brand.action.strong":{value:"var(--Tight-colors-blue500)",variable:"var(--Tight-colors-brand-action-strong)"},"colors.brand.action.stronger":{value:"var(--Tight-colors-blue700)",variable:"var(--Tight-colors-brand-action-stronger)"},"colors.brand.action.strongest":{value:"var(--Tight-colors-blue900)",variable:"var(--Tight-colors-brand-action-strongest)"},"colors.brand.success.weak":{value:"var(--Tight-colors-green300)",variable:"var(--Tight-colors-brand-success-weak)"},"colors.brand.success":{value:"var(--Tight-colors-green400)",variable:"var(--Tight-colors-brand-success)"},"colors.brand.success.strong":{value:"var(--Tight-colors-green500)",variable:"var(--Tight-colors-brand-success-strong)"},"colors.brand.warning.weak":{value:"var(--Tight-colors-yellow300)",variable:"var(--Tight-colors-brand-warning-weak)"},"colors.brand.warning":{value:"var(--Tight-colors-yellow400)",variable:"var(--Tight-colors-brand-warning)"},"colors.brand.warning.strong":{value:"var(--Tight-colors-yellow500)",variable:"var(--Tight-colors-brand-warning-strong)"},"colors.brand.danger.weak":{value:"var(--Tight-colors-red300)",variable:"var(--Tight-colors-brand-danger-weak)"},"colors.brand.danger":{value:"var(--Tight-colors-red400)",variable:"var(--Tight-colors-brand-danger)"},"colors.brand.danger.strong":{value:"var(--Tight-colors-red500)",variable:"var(--Tight-colors-brand-danger-strong)"},"colors.surface.background":{value:"var(--Tight-colors-white200)",variable:"var(--Tight-colors-surface-background)"},"colors.surface.background.hover":{value:"var(--Tight-colors-white300)",variable:"var(--Tight-colors-surface-background-hover)"},"colors.surface.foreground":{value:"var(--Tight-colors-white100)",variable:"var(--Tight-colors-surface-foreground)"},"colors.surface.foreground.hover":{value:"var(--Tight-colors-white200)",variable:"var(--Tight-colors-surface-foreground-hover)"},"colors.surface.foreground.disabled":{value:"var(--Tight-colors-white600)",variable:"var(--Tight-colors-surface-foreground-disabled)"},"colors.surface.elevated":{value:"var(--Tight-colors-white300)",variable:"var(--Tight-colors-surface-elevated)"},"colors.surface.elevated.hover":{value:"var(--Tight-colors-white600)",variable:"var(--Tight-colors-surface-elevated-hover)"},"colors.surface.intent.primary":{value:"var(--Tight-colors-brand-primary-weak)",variable:"var(--Tight-colors-surface-intent-primary)"},"colors.surface.intent.primary.hover":{value:"var(--Tight-colors-brand-primary)",variable:"var(--Tight-colors-surface-intent-primary-hover)"},"colors.surface.intent.primary.active":{value:"var(--Tight-colors-brand-primary-strong)",variable:"var(--Tight-colors-surface-intent-primary-active)"},"colors.surface.intent.primary.disabled":{value:"var(--Tight-colors-surface-foreground-disabled)",variable:"var(--Tight-colors-surface-intent-primary-disabled)"},"colors.surface.intent.secondary":{value:"var(--Tight-colors-brand-secondary-weak)",variable:"var(--Tight-colors-surface-intent-secondary)"},"colors.surface.intent.secondary.hover":{value:"var(--Tight-colors-brand-secondary)",variable:"var(--Tight-colors-surface-intent-secondary-hover)"},"colors.surface.intent.secondary.active":{value:"var(--Tight-colors-brand-secondary-strong)",variable:"var(--Tight-colors-surface-intent-secondary-active)"},"colors.surface.intent.secondary.disabled":{value:"var(--Tight-colors-surface-foreground-disabled)",variable:"var(--Tight-colors-surface-intent-secondary-disabled)"},"colors.surface.intent.action":{value:"var(--Tight-colors-brand-action-weak)",variable:"var(--Tight-colors-surface-intent-action)"},"colors.surface.intent.action.hover":{value:"var(--Tight-colors-brand-action)",variable:"var(--Tight-colors-surface-intent-action-hover)"},"colors.surface.intent.action.active":{value:"var(--Tight-colors-brand-action-strong)",variable:"var(--Tight-colors-surface-intent-action-active)"},"colors.surface.intent.action.disabled":{value:"var(--Tight-colors-surface-foreground-disabled)",variable:"var(--Tight-colors-surface-intent-action-disabled)"},"colors.surface.intent.action.discrete":{value:"transparent",variable:"var(--Tight-colors-surface-intent-action-discrete)"},"colors.surface.intent.action.discrete.hover":{value:"var(--Tight-colors-brand-action-weak)",variable:"var(--Tight-colors-surface-intent-action-discrete-hover)"},"colors.surface.intent.action.discrete.active":{value:"var(--Tight-colors-brand-action)",variable:"var(--Tight-colors-surface-intent-action-discrete-active)"},"colors.surface.intent.success":{value:"var(--Tight-colors-brand-success-weak)",variable:"var(--Tight-colors-surface-intent-success)"},"colors.surface.intent.success.hover":{value:"var(--Tight-colors-brand-success)",variable:"var(--Tight-colors-surface-intent-success-hover)"},"colors.surface.intent.success.active":{value:"var(--Tight-colors-brand-success-strong)",variable:"var(--Tight-colors-surface-intent-success-active)"},"colors.surface.intent.success.disabled":{value:"var(--Tight-colors-surface-foreground-disabled)",variable:"var(--Tight-colors-surface-intent-success-disabled)"},"colors.surface.intent.warning":{value:"var(--Tight-colors-brand-warning-weak)",variable:"var(--Tight-colors-surface-intent-warning)"},"colors.surface.intent.warning.hover":{value:"var(--Tight-colors-brand-warning)",variable:"var(--Tight-colors-surface-intent-warning-hover)"},"colors.surface.intent.warning.active":{value:"var(--Tight-colors-brand-warning-strong)",variable:"var(--Tight-colors-surface-intent-warning-active)"},"colors.surface.intent.warning.disabled":{value:"var(--Tight-colors-surface-foreground-disabled)",variable:"var(--Tight-colors-surface-intent-warning-disabled)"},"colors.surface.intent.danger":{value:"var(--Tight-colors-brand-danger-weak)",variable:"var(--Tight-colors-surface-intent-danger)"},"colors.surface.intent.danger.hover":{value:"var(--Tight-colors-brand-danger)",variable:"var(--Tight-colors-surface-intent-danger-hover)"},"colors.surface.intent.danger.active":{value:"var(--Tight-colors-brand-danger-strong)",variable:"var(--Tight-colors-surface-intent-danger-active)"},"colors.surface.intent.danger.disabled":{value:"var(--Tight-colors-surface-foreground-disabled)",variable:"var(--Tight-colors-surface-intent-danger-disabled)"},"colors.typography.base":{value:"var(--Tight-colors-black700)",variable:"var(--Tight-colors-typography-base)"},"colors.typography.base.weak":{value:"var(--Tight-colors-black400)",variable:"var(--Tight-colors-typography-base-weak)"},"colors.typography.contrast":{value:"var(--Tight-colors-white100)",variable:"var(--Tight-colors-typography-contrast)"},"colors.typography.contrast.weak":{value:"var(--Tight-colors-black100)",variable:"var(--Tight-colors-typography-contrast-weak)"},"colors.typography.intent.primary":{value:"var(--Tight-colors-white100)",variable:"var(--Tight-colors-typography-intent-primary)"},"colors.typography.intent.primary.hover":{value:"var(--Tight-colors-white100)",variable:"var(--Tight-colors-typography-intent-primary-hover)"},"colors.typography.intent.primary.active":{value:"var(--Tight-colors-white100)",variable:"var(--Tight-colors-typography-intent-primary-active)"},"colors.typography.intent.secondary":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-intent-secondary)"},"colors.typography.intent.secondary.hover":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-intent-secondary-hover)"},"colors.typography.intent.secondary.active":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-intent-secondary-active)"},"colors.typography.intent.action":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-intent-action)"},"colors.typography.intent.action.hover":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-intent-action-hover)"},"colors.typography.intent.action.active":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-intent-action-active)"},"colors.typography.intent.success":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-intent-success)"},"colors.typography.intent.success.hover":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-intent-success-hover)"},"colors.typography.intent.success.active":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-intent-success-active)"},"colors.typography.intent.warning":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-intent-warning)"},"colors.typography.intent.warning.hover":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-intent-warning-hover)"},"colors.typography.intent.warning.active":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-intent-warning-active)"},"colors.typography.intent.danger":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-intent-danger)"},"colors.typography.intent.danger.hover":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-intent-danger-hover)"},"colors.typography.intent.danger.active":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-intent-danger-active)"},"colors.typography.accent.success":{value:"var(--Tight-colors-brand-success-strong)",variable:"var(--Tight-colors-typography-accent-success)"},"colors.typography.accent.warning":{value:"var(--Tight-colors-brand-warning-strong)",variable:"var(--Tight-colors-typography-accent-warning)"},"colors.typography.accent.danger":{value:"var(--Tight-colors-brand-danger-strong)",variable:"var(--Tight-colors-typography-accent-danger)"},"colors.typography.accent.action":{value:"var(--Tight-colors-brand-action-strong)",variable:"var(--Tight-colors-typography-accent-action)"},"colors.typography.body":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-body)"},"colors.typography.label":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-label)"},"colors.typography.label.sub":{value:"var(--Tight-colors-typography-base-weak)",variable:"var(--Tight-colors-typography-label-sub)"},"colors.typography.label.strong":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-label-strong)"},"colors.typography.label.strongSub":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-label-strongSub)"},"colors.typography.label.emphasisSub":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-label-emphasisSub)"},"colors.typography.heading":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-heading)"},"colors.typography.metric.sm":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-metric-sm)"},"colors.typography.metric.md":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-metric-md)"},"colors.typography.metric.lg":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-metric-lg)"},"colors.typography.metric.xl":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-typography-metric-xl)"},"colors.icon.base":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-icon-base)"},"colors.icon.base.weak":{value:"var(--Tight-colors-typography-base-weak)",variable:"var(--Tight-colors-icon-base-weak)"},"colors.icon.contrast":{value:"var(--Tight-colors-typography-contrast)",variable:"var(--Tight-colors-icon-contrast)"},"colors.icon.contrast.weak":{value:"var(--Tight-colors-typography-contrast-weak)",variable:"var(--Tight-colors-icon-contrast-weak)"},"colors.icon.intent.primary":{value:"var(--Tight-colors-typography-intent-primary)",variable:"var(--Tight-colors-icon-intent-primary)"},"colors.icon.intent.primary.hover":{value:"var(--Tight-colors-typography-intent-primary-hover)",variable:"var(--Tight-colors-icon-intent-primary-hover)"},"colors.icon.intent.primary.active":{value:"var(--Tight-colors-typography-intent-primary-active)",variable:"var(--Tight-colors-icon-intent-primary-active)"},"colors.icon.intent.secondary":{value:"var(--Tight-colors-typography-intent-secondary)",variable:"var(--Tight-colors-icon-intent-secondary)"},"colors.icon.intent.secondary.hover":{value:"var(--Tight-colors-typography-intent-secondary-hover)",variable:"var(--Tight-colors-icon-intent-secondary-hover)"},"colors.icon.intent.secondary.active":{value:"var(--Tight-colors-typography-intent-secondary-active)",variable:"var(--Tight-colors-icon-intent-secondary-active)"},"colors.icon.intent.action":{value:"var(--Tight-colors-typography-intent-action)",variable:"var(--Tight-colors-icon-intent-action)"},"colors.icon.intent.action.hover":{value:"var(--Tight-colors-typography-intent-action-hover)",variable:"var(--Tight-colors-icon-intent-action-hover)"},"colors.icon.intent.action.active":{value:"var(--Tight-colors-typography-intent-action-active)",variable:"var(--Tight-colors-icon-intent-action-active)"},"colors.icon.intent.success":{value:"var(--Tight-colors-typography-intent-success)",variable:"var(--Tight-colors-icon-intent-success)"},"colors.icon.intent.success.hover":{value:"var(--Tight-colors-typography-intent-success-hover)",variable:"var(--Tight-colors-icon-intent-success-hover)"},"colors.icon.intent.success.active":{value:"var(--Tight-colors-typography-intent-success-active)",variable:"var(--Tight-colors-icon-intent-success-active)"},"colors.icon.intent.warning":{value:"var(--Tight-colors-typography-intent-warning)",variable:"var(--Tight-colors-icon-intent-warning)"},"colors.icon.intent.warning.hover":{value:"var(--Tight-colors-typography-intent-warning-hover)",variable:"var(--Tight-colors-icon-intent-warning-hover)"},"colors.icon.intent.warning.active":{value:"var(--Tight-colors-typography-intent-warning-active)",variable:"var(--Tight-colors-icon-intent-warning-active)"},"colors.icon.intent.danger":{value:"var(--Tight-colors-typography-intent-danger)",variable:"var(--Tight-colors-icon-intent-danger)"},"colors.icon.intent.danger.hover":{value:"var(--Tight-colors-typography-intent-danger-hover)",variable:"var(--Tight-colors-icon-intent-danger-hover)"},"colors.icon.intent.danger.active":{value:"var(--Tight-colors-typography-intent-danger-active)",variable:"var(--Tight-colors-icon-intent-danger-active)"},"colors.icon.accent.success":{value:"var(--Tight-colors-typography-accent-success)",variable:"var(--Tight-colors-icon-accent-success)"},"colors.icon.accent.warning":{value:"var(--Tight-colors-typography-accent-warning)",variable:"var(--Tight-colors-icon-accent-warning)"},"colors.icon.accent.danger":{value:"var(--Tight-colors-typography-accent-danger)",variable:"var(--Tight-colors-icon-accent-danger)"},"colors.border.layout.weak":{value:"var(--Tight-colors-white300)",variable:"var(--Tight-colors-border-layout-weak)"},"colors.border.layout":{value:"var(--Tight-colors-black100)",variable:"var(--Tight-colors-border-layout)"},"colors.border.layout.strong":{value:"var(--Tight-colors-black600)",variable:"var(--Tight-colors-border-layout-strong)"},"colors.border.intent.primary.hover":{value:"var(--Tight-colors-brand-primary-strong)",variable:"var(--Tight-colors-border-intent-primary-hover)"},"colors.border.intent.primary":{value:"var(--Tight-colors-brand-primary-strong)",variable:"var(--Tight-colors-border-intent-primary)"},"colors.border.intent.primary.active":{value:"var(--Tight-colors-brand-primary-strong)",variable:"var(--Tight-colors-border-intent-primary-active)"},"colors.border.intent.primary.disabled":{value:"var(--Tight-colors-border-layout)",variable:"var(--Tight-colors-border-intent-primary-disabled)"},"colors.border.intent.secondary.hover":{value:"var(--Tight-colors-brand-secondary-strong)",variable:"var(--Tight-colors-border-intent-secondary-hover)"},"colors.border.intent.secondary":{value:"var(--Tight-colors-brand-secondary-strong)",variable:"var(--Tight-colors-border-intent-secondary)"},"colors.border.intent.secondary.active":{value:"var(--Tight-colors-brand-secondary-strong)",variable:"var(--Tight-colors-border-intent-secondary-active)"},"colors.border.intent.secondary.disabled":{value:"var(--Tight-colors-border-layout)",variable:"var(--Tight-colors-border-intent-secondary-disabled)"},"colors.border.intent.danger.hover":{value:"var(--Tight-colors-brand-danger-strong)",variable:"var(--Tight-colors-border-intent-danger-hover)"},"colors.border.intent.danger":{value:"var(--Tight-colors-brand-danger-strong)",variable:"var(--Tight-colors-border-intent-danger)"},"colors.border.intent.danger.active":{value:"var(--Tight-colors-brand-danger-strong)",variable:"var(--Tight-colors-border-intent-danger-active)"},"colors.border.intent.danger.disabled":{value:"var(--Tight-colors-border-layout)",variable:"var(--Tight-colors-border-intent-danger-disabled)"},"colors.border.intent.warning.hover":{value:"var(--Tight-colors-brand-warning-strong)",variable:"var(--Tight-colors-border-intent-warning-hover)"},"colors.border.intent.warning":{value:"var(--Tight-colors-brand-warning-strong)",variable:"var(--Tight-colors-border-intent-warning)"},"colors.border.intent.warning.active":{value:"var(--Tight-colors-brand-warning-strong)",variable:"var(--Tight-colors-border-intent-warning-active)"},"colors.border.intent.warning.disabled":{value:"var(--Tight-colors-border-layout)",variable:"var(--Tight-colors-border-intent-warning-disabled)"},"colors.border.intent.success.hover":{value:"var(--Tight-colors-brand-success-strong)",variable:"var(--Tight-colors-border-intent-success-hover)"},"colors.border.intent.success":{value:"var(--Tight-colors-brand-success-strong)",variable:"var(--Tight-colors-border-intent-success)"},"colors.border.intent.success.active":{value:"var(--Tight-colors-brand-success-strong)",variable:"var(--Tight-colors-border-intent-success-active)"},"colors.border.intent.success.disabled":{value:"var(--Tight-colors-border-layout)",variable:"var(--Tight-colors-border-intent-success-disabled)"},"colors.border.intent.action.hover":{value:"var(--Tight-colors-brand-action-strong)",variable:"var(--Tight-colors-border-intent-action-hover)"},"colors.border.intent.action":{value:"var(--Tight-colors-brand-action-strong)",variable:"var(--Tight-colors-border-intent-action)"},"colors.border.intent.action.active":{value:"var(--Tight-colors-brand-action-strong)",variable:"var(--Tight-colors-border-intent-action-active)"},"colors.border.intent.action.disabled":{value:"var(--Tight-colors-border-layout)",variable:"var(--Tight-colors-border-intent-action-disabled)"},"colors.money":{value:"var(--Tight-colors-typography-base)",variable:"var(--Tight-colors-money)"},"colors.money.positive":{value:"var(--Tight-colors-green700)",variable:"var(--Tight-colors-money-positive)"},"colors.money.positive.weak":{value:"var(--Tight-colors-green500)",variable:"var(--Tight-colors-money-positive-weak)"},"colors.money.negative":{value:"var(--Tight-colors-red700)",variable:"var(--Tight-colors-money-negative)"},"colors.money.negative.weak":{value:"var(--Tight-colors-red300)",variable:"var(--Tight-colors-money-negative-weak)"},"colors.overlay":{value:"rgba(0, 0, 0, 0.5)",variable:"var(--Tight-colors-overlay)"},"colors.transparent":{value:"transparent",variable:"var(--Tight-colors-transparent)"},"colors.none":{value:"none",variable:"var(--Tight-colors-none)"},"colors.inherit":{value:"inherit",variable:"var(--Tight-colors-inherit)"},"colors.currentColor":{value:"currentColor",variable:"var(--Tight-colors-currentColor)"},"fonts.body":{value:"var(--Tight-fonts-base)",variable:"var(--Tight-fonts-body)"},"fonts.label":{value:"var(--Tight-fonts-base)",variable:"var(--Tight-fonts-label)"},"fonts.heading":{value:"var(--Tight-fonts-base)",variable:"var(--Tight-fonts-heading)"},"fonts.metric":{value:"var(--Tight-fonts-base)",variable:"var(--Tight-fonts-metric)"},"fontWeights.global":{value:"var(--Tight-fontWeights-sm)",variable:"var(--Tight-fontWeights-global)"},"fontWeights.body":{value:"var(--Tight-fontWeights-md)",variable:"var(--Tight-fontWeights-body)"},"fontWeights.label":{value:"var(--Tight-fontWeights-sm)",variable:"var(--Tight-fontWeights-label)"},"fontWeights.label.strong":{value:"var(--Tight-fontWeights-md)",variable:"var(--Tight-fontWeights-label-strong)"},"fontWeights.label.sub":{value:"var(--Tight-fontWeights-sm)",variable:"var(--Tight-fontWeights-label-sub)"},"fontWeights.label.strongSub":{value:"var(--Tight-fontWeights-md)",variable:"var(--Tight-fontWeights-label-strongSub)"},"fontWeights.label.emphasisSub":{value:"var(--Tight-fontWeights-lg)",variable:"var(--Tight-fontWeights-label-emphasisSub)"},"fontWeights.heading":{value:"var(--Tight-fontWeights-md)",variable:"var(--Tight-fontWeights-heading)"},"fontWeights.title":{value:"var(--Tight-fontWeights-sm)",variable:"var(--Tight-fontWeights-title)"},"fontWeights.metric.sm":{value:"var(--Tight-fontWeights-sm)",variable:"var(--Tight-fontWeights-metric-sm)"},"fontWeights.metric.md":{value:"var(--Tight-fontWeights-sm)",variable:"var(--Tight-fontWeights-metric-md)"},"fontWeights.metric.lg":{value:"var(--Tight-fontWeights-sm)",variable:"var(--Tight-fontWeights-metric-lg)"},"fontWeights.metric.xl":{value:"var(--Tight-fontWeights-sm)",variable:"var(--Tight-fontWeights-metric-xl)"},"fontSizes.title":{value:"var(--Tight-fontSizes-2xl)",variable:"var(--Tight-fontSizes-title)"},"fontSizes.body":{value:"var(--Tight-fontSizes-md)",variable:"var(--Tight-fontSizes-body)"},"fontSizes.label":{value:"var(--Tight-fontSizes-md)",variable:"var(--Tight-fontSizes-label)"},"fontSizes.label.strong":{value:"var(--Tight-fontSizes-md)",variable:"var(--Tight-fontSizes-label-strong)"},"fontSizes.label.sub":{value:"var(--Tight-fontSizes-sm)",variable:"var(--Tight-fontSizes-label-sub)"},"fontSizes.label.strongSub":{value:"var(--Tight-fontSizes-sm)",variable:"var(--Tight-fontSizes-label-strongSub)"},"fontSizes.label.emphasisSub":{value:"var(--Tight-fontSizes-sm)",variable:"var(--Tight-fontSizes-label-emphasisSub)"},"fontSizes.heading":{value:"var(--Tight-fontSizes-xl)",variable:"var(--Tight-fontSizes-heading)"},"fontSizes.metric.sm":{value:"var(--Tight-fontSizes-sm)",variable:"var(--Tight-fontSizes-metric-sm)"},"fontSizes.metric.md":{value:"var(--Tight-fontSizes-md)",variable:"var(--Tight-fontSizes-metric-md)"},"fontSizes.metric.lg":{value:"var(--Tight-fontSizes-xl)",variable:"var(--Tight-fontSizes-metric-lg)"},"fontSizes.metric.xl":{value:"var(--Tight-fontSizes-2xl)",variable:"var(--Tight-fontSizes-metric-xl)"},"colors.colorPalette":{value:"var(--Tight-colors-colorPalette)",variable:"var(--Tight-colors-colorPalette)"},"colors.colorPalette.primary.weak":{value:"var(--Tight-colors-colorPalette-primary-weak)",variable:"var(--Tight-colors-colorPalette-primary-weak)"},"colors.colorPalette.weak":{value:"var(--Tight-colors-colorPalette-weak)",variable:"var(--Tight-colors-colorPalette-weak)"},"colors.colorPalette.primary":{value:"var(--Tight-colors-colorPalette-primary)",variable:"var(--Tight-colors-colorPalette-primary)"},"colors.colorPalette.primary.strong":{value:"var(--Tight-colors-colorPalette-primary-strong)",variable:"var(--Tight-colors-colorPalette-primary-strong)"},"colors.colorPalette.strong":{value:"var(--Tight-colors-colorPalette-strong)",variable:"var(--Tight-colors-colorPalette-strong)"},"colors.colorPalette.secondary.weak":{value:"var(--Tight-colors-colorPalette-secondary-weak)",variable:"var(--Tight-colors-colorPalette-secondary-weak)"},"colors.colorPalette.secondary":{value:"var(--Tight-colors-colorPalette-secondary)",variable:"var(--Tight-colors-colorPalette-secondary)"},"colors.colorPalette.secondary.strong":{value:"var(--Tight-colors-colorPalette-secondary-strong)",variable:"var(--Tight-colors-colorPalette-secondary-strong)"},"colors.colorPalette.action.weak":{value:"var(--Tight-colors-colorPalette-action-weak)",variable:"var(--Tight-colors-colorPalette-action-weak)"},"colors.colorPalette.action":{value:"var(--Tight-colors-colorPalette-action)",variable:"var(--Tight-colors-colorPalette-action)"},"colors.colorPalette.action.strong":{value:"var(--Tight-colors-colorPalette-action-strong)",variable:"var(--Tight-colors-colorPalette-action-strong)"},"colors.colorPalette.action.stronger":{value:"var(--Tight-colors-colorPalette-action-stronger)",variable:"var(--Tight-colors-colorPalette-action-stronger)"},"colors.colorPalette.stronger":{value:"var(--Tight-colors-colorPalette-stronger)",variable:"var(--Tight-colors-colorPalette-stronger)"},"colors.colorPalette.action.strongest":{value:"var(--Tight-colors-colorPalette-action-strongest)",variable:"var(--Tight-colors-colorPalette-action-strongest)"},"colors.colorPalette.strongest":{value:"var(--Tight-colors-colorPalette-strongest)",variable:"var(--Tight-colors-colorPalette-strongest)"},"colors.colorPalette.success.weak":{value:"var(--Tight-colors-colorPalette-success-weak)",variable:"var(--Tight-colors-colorPalette-success-weak)"},"colors.colorPalette.success":{value:"var(--Tight-colors-colorPalette-success)",variable:"var(--Tight-colors-colorPalette-success)"},"colors.colorPalette.success.strong":{value:"var(--Tight-colors-colorPalette-success-strong)",variable:"var(--Tight-colors-colorPalette-success-strong)"},"colors.colorPalette.warning.weak":{value:"var(--Tight-colors-colorPalette-warning-weak)",variable:"var(--Tight-colors-colorPalette-warning-weak)"},"colors.colorPalette.warning":{value:"var(--Tight-colors-colorPalette-warning)",variable:"var(--Tight-colors-colorPalette-warning)"},"colors.colorPalette.warning.strong":{value:"var(--Tight-colors-colorPalette-warning-strong)",variable:"var(--Tight-colors-colorPalette-warning-strong)"},"colors.colorPalette.danger.weak":{value:"var(--Tight-colors-colorPalette-danger-weak)",variable:"var(--Tight-colors-colorPalette-danger-weak)"},"colors.colorPalette.danger":{value:"var(--Tight-colors-colorPalette-danger)",variable:"var(--Tight-colors-colorPalette-danger)"},"colors.colorPalette.danger.strong":{value:"var(--Tight-colors-colorPalette-danger-strong)",variable:"var(--Tight-colors-colorPalette-danger-strong)"},"colors.colorPalette.background":{value:"var(--Tight-colors-colorPalette-background)",variable:"var(--Tight-colors-colorPalette-background)"},"colors.colorPalette.background.hover":{value:"var(--Tight-colors-colorPalette-background-hover)",variable:"var(--Tight-colors-colorPalette-background-hover)"},"colors.colorPalette.hover":{value:"var(--Tight-colors-colorPalette-hover)",variable:"var(--Tight-colors-colorPalette-hover)"},"colors.colorPalette.foreground":{value:"var(--Tight-colors-colorPalette-foreground)",variable:"var(--Tight-colors-colorPalette-foreground)"},"colors.colorPalette.foreground.hover":{value:"var(--Tight-colors-colorPalette-foreground-hover)",variable:"var(--Tight-colors-colorPalette-foreground-hover)"},"colors.colorPalette.foreground.disabled":{value:"var(--Tight-colors-colorPalette-foreground-disabled)",variable:"var(--Tight-colors-colorPalette-foreground-disabled)"},"colors.colorPalette.disabled":{value:"var(--Tight-colors-colorPalette-disabled)",variable:"var(--Tight-colors-colorPalette-disabled)"},"colors.colorPalette.elevated":{value:"var(--Tight-colors-colorPalette-elevated)",variable:"var(--Tight-colors-colorPalette-elevated)"},"colors.colorPalette.elevated.hover":{value:"var(--Tight-colors-colorPalette-elevated-hover)",variable:"var(--Tight-colors-colorPalette-elevated-hover)"},"colors.colorPalette.intent.primary":{value:"var(--Tight-colors-colorPalette-intent-primary)",variable:"var(--Tight-colors-colorPalette-intent-primary)"},"colors.colorPalette.intent.primary.hover":{value:"var(--Tight-colors-colorPalette-intent-primary-hover)",variable:"var(--Tight-colors-colorPalette-intent-primary-hover)"},"colors.colorPalette.primary.hover":{value:"var(--Tight-colors-colorPalette-primary-hover)",variable:"var(--Tight-colors-colorPalette-primary-hover)"},"colors.colorPalette.intent.primary.active":{value:"var(--Tight-colors-colorPalette-intent-primary-active)",variable:"var(--Tight-colors-colorPalette-intent-primary-active)"},"colors.colorPalette.primary.active":{value:"var(--Tight-colors-colorPalette-primary-active)",variable:"var(--Tight-colors-colorPalette-primary-active)"},"colors.colorPalette.active":{value:"var(--Tight-colors-colorPalette-active)",variable:"var(--Tight-colors-colorPalette-active)"},"colors.colorPalette.intent.primary.disabled":{value:"var(--Tight-colors-colorPalette-intent-primary-disabled)",variable:"var(--Tight-colors-colorPalette-intent-primary-disabled)"},"colors.colorPalette.primary.disabled":{value:"var(--Tight-colors-colorPalette-primary-disabled)",variable:"var(--Tight-colors-colorPalette-primary-disabled)"},"colors.colorPalette.intent.secondary":{value:"var(--Tight-colors-colorPalette-intent-secondary)",variable:"var(--Tight-colors-colorPalette-intent-secondary)"},"colors.colorPalette.intent.secondary.hover":{value:"var(--Tight-colors-colorPalette-intent-secondary-hover)",variable:"var(--Tight-colors-colorPalette-intent-secondary-hover)"},"colors.colorPalette.secondary.hover":{value:"var(--Tight-colors-colorPalette-secondary-hover)",variable:"var(--Tight-colors-colorPalette-secondary-hover)"},"colors.colorPalette.intent.secondary.active":{value:"var(--Tight-colors-colorPalette-intent-secondary-active)",variable:"var(--Tight-colors-colorPalette-intent-secondary-active)"},"colors.colorPalette.secondary.active":{value:"var(--Tight-colors-colorPalette-secondary-active)",variable:"var(--Tight-colors-colorPalette-secondary-active)"},"colors.colorPalette.intent.secondary.disabled":{value:"var(--Tight-colors-colorPalette-intent-secondary-disabled)",variable:"var(--Tight-colors-colorPalette-intent-secondary-disabled)"},"colors.colorPalette.secondary.disabled":{value:"var(--Tight-colors-colorPalette-secondary-disabled)",variable:"var(--Tight-colors-colorPalette-secondary-disabled)"},"colors.colorPalette.intent.action":{value:"var(--Tight-colors-colorPalette-intent-action)",variable:"var(--Tight-colors-colorPalette-intent-action)"},"colors.colorPalette.intent.action.hover":{value:"var(--Tight-colors-colorPalette-intent-action-hover)",variable:"var(--Tight-colors-colorPalette-intent-action-hover)"},"colors.colorPalette.action.hover":{value:"var(--Tight-colors-colorPalette-action-hover)",variable:"var(--Tight-colors-colorPalette-action-hover)"},"colors.colorPalette.intent.action.active":{value:"var(--Tight-colors-colorPalette-intent-action-active)",variable:"var(--Tight-colors-colorPalette-intent-action-active)"},"colors.colorPalette.action.active":{value:"var(--Tight-colors-colorPalette-action-active)",variable:"var(--Tight-colors-colorPalette-action-active)"},"colors.colorPalette.intent.action.disabled":{value:"var(--Tight-colors-colorPalette-intent-action-disabled)",variable:"var(--Tight-colors-colorPalette-intent-action-disabled)"},"colors.colorPalette.action.disabled":{value:"var(--Tight-colors-colorPalette-action-disabled)",variable:"var(--Tight-colors-colorPalette-action-disabled)"},"colors.colorPalette.intent.action.discrete":{value:"var(--Tight-colors-colorPalette-intent-action-discrete)",variable:"var(--Tight-colors-colorPalette-intent-action-discrete)"},"colors.colorPalette.action.discrete":{value:"var(--Tight-colors-colorPalette-action-discrete)",variable:"var(--Tight-colors-colorPalette-action-discrete)"},"colors.colorPalette.discrete":{value:"var(--Tight-colors-colorPalette-discrete)",variable:"var(--Tight-colors-colorPalette-discrete)"},"colors.colorPalette.intent.action.discrete.hover":{value:"var(--Tight-colors-colorPalette-intent-action-discrete-hover)",variable:"var(--Tight-colors-colorPalette-intent-action-discrete-hover)"},"colors.colorPalette.action.discrete.hover":{value:"var(--Tight-colors-colorPalette-action-discrete-hover)",variable:"var(--Tight-colors-colorPalette-action-discrete-hover)"},"colors.colorPalette.discrete.hover":{value:"var(--Tight-colors-colorPalette-discrete-hover)",variable:"var(--Tight-colors-colorPalette-discrete-hover)"},"colors.colorPalette.intent.action.discrete.active":{value:"var(--Tight-colors-colorPalette-intent-action-discrete-active)",variable:"var(--Tight-colors-colorPalette-intent-action-discrete-active)"},"colors.colorPalette.action.discrete.active":{value:"var(--Tight-colors-colorPalette-action-discrete-active)",variable:"var(--Tight-colors-colorPalette-action-discrete-active)"},"colors.colorPalette.discrete.active":{value:"var(--Tight-colors-colorPalette-discrete-active)",variable:"var(--Tight-colors-colorPalette-discrete-active)"},"colors.colorPalette.intent.success":{value:"var(--Tight-colors-colorPalette-intent-success)",variable:"var(--Tight-colors-colorPalette-intent-success)"},"colors.colorPalette.intent.success.hover":{value:"var(--Tight-colors-colorPalette-intent-success-hover)",variable:"var(--Tight-colors-colorPalette-intent-success-hover)"},"colors.colorPalette.success.hover":{value:"var(--Tight-colors-colorPalette-success-hover)",variable:"var(--Tight-colors-colorPalette-success-hover)"},"colors.colorPalette.intent.success.active":{value:"var(--Tight-colors-colorPalette-intent-success-active)",variable:"var(--Tight-colors-colorPalette-intent-success-active)"},"colors.colorPalette.success.active":{value:"var(--Tight-colors-colorPalette-success-active)",variable:"var(--Tight-colors-colorPalette-success-active)"},"colors.colorPalette.intent.success.disabled":{value:"var(--Tight-colors-colorPalette-intent-success-disabled)",variable:"var(--Tight-colors-colorPalette-intent-success-disabled)"},"colors.colorPalette.success.disabled":{value:"var(--Tight-colors-colorPalette-success-disabled)",variable:"var(--Tight-colors-colorPalette-success-disabled)"},"colors.colorPalette.intent.warning":{value:"var(--Tight-colors-colorPalette-intent-warning)",variable:"var(--Tight-colors-colorPalette-intent-warning)"},"colors.colorPalette.intent.warning.hover":{value:"var(--Tight-colors-colorPalette-intent-warning-hover)",variable:"var(--Tight-colors-colorPalette-intent-warning-hover)"},"colors.colorPalette.warning.hover":{value:"var(--Tight-colors-colorPalette-warning-hover)",variable:"var(--Tight-colors-colorPalette-warning-hover)"},"colors.colorPalette.intent.warning.active":{value:"var(--Tight-colors-colorPalette-intent-warning-active)",variable:"var(--Tight-colors-colorPalette-intent-warning-active)"},"colors.colorPalette.warning.active":{value:"var(--Tight-colors-colorPalette-warning-active)",variable:"var(--Tight-colors-colorPalette-warning-active)"},"colors.colorPalette.intent.warning.disabled":{value:"var(--Tight-colors-colorPalette-intent-warning-disabled)",variable:"var(--Tight-colors-colorPalette-intent-warning-disabled)"},"colors.colorPalette.warning.disabled":{value:"var(--Tight-colors-colorPalette-warning-disabled)",variable:"var(--Tight-colors-colorPalette-warning-disabled)"},"colors.colorPalette.intent.danger":{value:"var(--Tight-colors-colorPalette-intent-danger)",variable:"var(--Tight-colors-colorPalette-intent-danger)"},"colors.colorPalette.intent.danger.hover":{value:"var(--Tight-colors-colorPalette-intent-danger-hover)",variable:"var(--Tight-colors-colorPalette-intent-danger-hover)"},"colors.colorPalette.danger.hover":{value:"var(--Tight-colors-colorPalette-danger-hover)",variable:"var(--Tight-colors-colorPalette-danger-hover)"},"colors.colorPalette.intent.danger.active":{value:"var(--Tight-colors-colorPalette-intent-danger-active)",variable:"var(--Tight-colors-colorPalette-intent-danger-active)"},"colors.colorPalette.danger.active":{value:"var(--Tight-colors-colorPalette-danger-active)",variable:"var(--Tight-colors-colorPalette-danger-active)"},"colors.colorPalette.intent.danger.disabled":{value:"var(--Tight-colors-colorPalette-intent-danger-disabled)",variable:"var(--Tight-colors-colorPalette-intent-danger-disabled)"},"colors.colorPalette.danger.disabled":{value:"var(--Tight-colors-colorPalette-danger-disabled)",variable:"var(--Tight-colors-colorPalette-danger-disabled)"},"colors.colorPalette.base":{value:"var(--Tight-colors-colorPalette-base)",variable:"var(--Tight-colors-colorPalette-base)"},"colors.colorPalette.base.weak":{value:"var(--Tight-colors-colorPalette-base-weak)",variable:"var(--Tight-colors-colorPalette-base-weak)"},"colors.colorPalette.contrast":{value:"var(--Tight-colors-colorPalette-contrast)",variable:"var(--Tight-colors-colorPalette-contrast)"},"colors.colorPalette.contrast.weak":{value:"var(--Tight-colors-colorPalette-contrast-weak)",variable:"var(--Tight-colors-colorPalette-contrast-weak)"},"colors.colorPalette.accent.success":{value:"var(--Tight-colors-colorPalette-accent-success)",variable:"var(--Tight-colors-colorPalette-accent-success)"},"colors.colorPalette.accent.warning":{value:"var(--Tight-colors-colorPalette-accent-warning)",variable:"var(--Tight-colors-colorPalette-accent-warning)"},"colors.colorPalette.accent.danger":{value:"var(--Tight-colors-colorPalette-accent-danger)",variable:"var(--Tight-colors-colorPalette-accent-danger)"},"colors.colorPalette.accent.action":{value:"var(--Tight-colors-colorPalette-accent-action)",variable:"var(--Tight-colors-colorPalette-accent-action)"},"colors.colorPalette.body":{value:"var(--Tight-colors-colorPalette-body)",variable:"var(--Tight-colors-colorPalette-body)"},"colors.colorPalette.label":{value:"var(--Tight-colors-colorPalette-label)",variable:"var(--Tight-colors-colorPalette-label)"},"colors.colorPalette.label.sub":{value:"var(--Tight-colors-colorPalette-label-sub)",variable:"var(--Tight-colors-colorPalette-label-sub)"},"colors.colorPalette.sub":{value:"var(--Tight-colors-colorPalette-sub)",variable:"var(--Tight-colors-colorPalette-sub)"},"colors.colorPalette.label.strong":{value:"var(--Tight-colors-colorPalette-label-strong)",variable:"var(--Tight-colors-colorPalette-label-strong)"},"colors.colorPalette.label.strongSub":{value:"var(--Tight-colors-colorPalette-label-strongSub)",variable:"var(--Tight-colors-colorPalette-label-strongSub)"},"colors.colorPalette.strongSub":{value:"var(--Tight-colors-colorPalette-strongSub)",variable:"var(--Tight-colors-colorPalette-strongSub)"},"colors.colorPalette.label.emphasisSub":{value:"var(--Tight-colors-colorPalette-label-emphasisSub)",variable:"var(--Tight-colors-colorPalette-label-emphasisSub)"},"colors.colorPalette.emphasisSub":{value:"var(--Tight-colors-colorPalette-emphasisSub)",variable:"var(--Tight-colors-colorPalette-emphasisSub)"},"colors.colorPalette.heading":{value:"var(--Tight-colors-colorPalette-heading)",variable:"var(--Tight-colors-colorPalette-heading)"},"colors.colorPalette.metric.sm":{value:"var(--Tight-colors-colorPalette-metric-sm)",variable:"var(--Tight-colors-colorPalette-metric-sm)"},"colors.colorPalette.sm":{value:"var(--Tight-colors-colorPalette-sm)",variable:"var(--Tight-colors-colorPalette-sm)"},"colors.colorPalette.metric.md":{value:"var(--Tight-colors-colorPalette-metric-md)",variable:"var(--Tight-colors-colorPalette-metric-md)"},"colors.colorPalette.md":{value:"var(--Tight-colors-colorPalette-md)",variable:"var(--Tight-colors-colorPalette-md)"},"colors.colorPalette.metric.lg":{value:"var(--Tight-colors-colorPalette-metric-lg)",variable:"var(--Tight-colors-colorPalette-metric-lg)"},"colors.colorPalette.lg":{value:"var(--Tight-colors-colorPalette-lg)",variable:"var(--Tight-colors-colorPalette-lg)"},"colors.colorPalette.metric.xl":{value:"var(--Tight-colors-colorPalette-metric-xl)",variable:"var(--Tight-colors-colorPalette-metric-xl)"},"colors.colorPalette.xl":{value:"var(--Tight-colors-colorPalette-xl)",variable:"var(--Tight-colors-colorPalette-xl)"},"colors.colorPalette.layout.weak":{value:"var(--Tight-colors-colorPalette-layout-weak)",variable:"var(--Tight-colors-colorPalette-layout-weak)"},"colors.colorPalette.layout":{value:"var(--Tight-colors-colorPalette-layout)",variable:"var(--Tight-colors-colorPalette-layout)"},"colors.colorPalette.layout.strong":{value:"var(--Tight-colors-colorPalette-layout-strong)",variable:"var(--Tight-colors-colorPalette-layout-strong)"},"colors.colorPalette.positive":{value:"var(--Tight-colors-colorPalette-positive)",variable:"var(--Tight-colors-colorPalette-positive)"},"colors.colorPalette.positive.weak":{value:"var(--Tight-colors-colorPalette-positive-weak)",variable:"var(--Tight-colors-colorPalette-positive-weak)"},"colors.colorPalette.negative":{value:"var(--Tight-colors-colorPalette-negative)",variable:"var(--Tight-colors-colorPalette-negative)"},"colors.colorPalette.negative.weak":{value:"var(--Tight-colors-colorPalette-negative-weak)",variable:"var(--Tight-colors-colorPalette-negative-weak)"}};function io(e,t){return ao[e]?.value||t}io.var=function(e,t){return ao[e]?.variable||t};const lo=Rt(null,xt({borderRadius:"50%",flexShrink:0})),so=Rt(null,xt({display:"flex",flexDirection:"row",gap:"10px",alignItems:"center",minWidth:0})),co=io.var("colors.surface.foreground.disabled");function uo({color:e=co,diameter:t=17,label:r}){return E("div",{...so,"data-testid":"bullet-row",children:[w("div",{...lo,style:{backgroundColor:e,width:`${t}px`,height:`${t}px`},"data-testid":"bullet"}),r&&w(ro,{children:r})]})}const ho=Rt(null,xt({display:"flex",flexDirection:"row",alignItems:"center",gap:"30px"}));function po({payload:e}){return void 0===e?null:w("div",{...ho,children:e.map((e,t)=>"none"!==e.type&&w(uo,{color:e.color,label:e.value,diameter:17},t))})}const go={right:20,left:20},mo=["income","profit","expenses","loss"],vo=e=>mo.findIndex(t=>t===e.dataKey),bo={paddingBottom:"20px",marginLeft:"-20px"},fo={stackId:"stack",isAnimationActive:!1},yo=Rt(St["profit-loss-graph"],xt({"& .recharts-surface":{outline:"none"}})),To=io.var("colors.money"),xo=io.var("colors.border.layout"),ko=io.var("colors.border.layout.strong"),wo={fill:io.var("colors.typography.base"),fontSize:io.var("fontSizes.metric.sm")},Co={profit:io.var("colors.money.positive"),income:io.var("colors.money.positive.weak"),loss:io.var("colors.money.negative"),expenses:io.var("colors.money.negative.weak")},Eo=[0,100],Io=["auto","auto"];function So({data:e}){const[t,r]=m(!0);if(void 0===e)return null;const n=e.hasAnyData?Io:Eo;return w(R,{width:"100%",height:"100%",...yo,children:E(O,{data:e.months,stackOffset:"sign",accessibilityLayer:!0,barSize:35,margin:go,children:[w(_,{verticalAlign:"top",itemSorter:vo,wrapperStyle:bo,content:({payload:e})=>w(po,{payload:e})}),w(L,{strokeDasharray:"0",vertical:!1,stroke:xo}),w(F,{dataKey:"month",interval:0,tickLine:!1,stroke:xo,tick:wo}),w(B,{type:"number",tickCount:7,domain:n,axisLine:!1,tickLine:!1,stroke:xo,tick:wo,tickFormatter:e=>Gn(e)}),w(W,{content:({active:e,payload:t})=>w(oo,{active:e,payload:t}),isAnimationActive:!1,shared:!1}),w(H,{name:"Profit",dataKey:"profit",fill:Co.profit,...fo}),w(H,{name:"Income",dataKey:"income",fill:Co.income,...fo}),w(H,{name:"Loss",dataKey:"loss",fill:Co.loss,...fo}),w(H,{name:"Expenses",dataKey:"expenses",fill:Co.expenses,...fo}),w(H,{dataKey:En,fill:xo,legendType:"none",...fo}),w(U,{y:0,stroke:ko}),w(V,{dataKey:"netIncome",fill:To,stroke:To,strokeWidth:1,legendType:"none",activeDot:!1,isAnimationActive:t,onAnimationStart:()=>r(!0),onAnimationEnd:()=>r(!1)})]})})}const Ao=xt({backgroundColor:"surface.elevated",borderRadius:"sm",backgroundImage:"linear-gradient(90deg, {colors.surface.elevated} 30%, {colors.surface.foreground} 50%, {colors.surface.elevated} 70%)",backgroundSize:"400%",backgroundPosition:"100% 0",animation:"shimmer"});function No({styles:e}){const t=Rt(null,Ao,e);return w("div",{...t,"data-testid":"shimmer-block"})}const Po=xt({width:"40%",minHeight:65});function Mo({children:e}){return E(C,{children:[w(No,{styles:Po}),w(jn,{children:e})]})}const Do=Rt(null,xt({display:"flex",flexDirection:"row",alignItems:"center",gap:16})),Ro=xt({width:"80px",height:"17px",marginBottom:"10px"}),Oo=xt({width:"100%",height:"100%"});function _o(){return E(C,{children:[E("div",{...Do,children:[w(No,{styles:Ro}),w(No,{styles:Ro}),w(No,{styles:Ro}),w(No,{styles:Ro})]}),w(No,{styles:Oo})]})}const Lo=Et({base:{color:"typography.base.weak",boxSizing:"border-box",position:"absolute",bottom:"0",left:"0",right:"0",top:"0",display:"flex",justifyContent:"center",alignItems:"center",pointerEvents:"none",margin:"0 auto",transform:"rotate(-20deg)",opacity:"80%"},variants:{size:{sm:{fontSize:"4em"},lg:{fontSize:"7em"},xl:{fontSize:"10em"}}}});function Fo({size:e}){const t=Lo({size:e});return w("div",{className:t,children:"Sample"})}const Bo=20200,Wo=5043,Ho=Object.freeze({income:Bo,expenses:Wo,netIncome:15157,absoluteSum:Math.abs(Bo)+Math.abs(Wo)}),Uo=Object.freeze({total:Wo,children:[{name:"Plane/Train/Bus",total:2500},{name:"Business Meals",total:1800},{name:"Employee Entertainment",total:743}]}),Vo=Object.freeze({moneyIn:25300,moneyOut:8150,netMoneyIn:17150}),zo=[{income:1247,expenses:7434},{income:2103,expenses:8672},{income:1876,expenses:7656},{income:3291,expenses:6623},{income:5647,expenses:7034},{income:8923,expenses:6456},{income:11547,expenses:5892},{income:9834,expenses:6721},{income:15283,expenses:5347},{income:18467,expenses:4923},{income:17924,expenses:4534},{income:20200,expenses:5043}];function jo({filter:e=Kt.PAST_YEAR,isSample:t=!1}){const{query:{data:r},isFilling:n}=function({filter:e,grouping:t}){return Cn({filter:e,grouping:t,select:Sn})}({filter:e,grouping:"MONTHLY"}),o=t?function(){const e=[],t=/* @__PURE__ */new Date;let r=0,n=0,o=0;for(let a=11;a>=0;a--){const i=new Date(t.getFullYear(),t.getMonth()-a,1),l=ir(i,{abbreviateMonth:!0,abbreviateYear:!0}),s=zo[11-a],c=s.income-s.expenses,d=c>0?c:0,u=c<0?c:0,h=s.income-d,p=s.expenses+u;e.push({month:l,income:h,expenses:-p,profit:d,loss:u,netIncome:c,hasNoData:!1}),r+=c,n=Math.max(n,s.income),o=Math.max(o,s.expenses)}return{total:r,domain:[-o,n],months:e,hasAnyData:!0}}():r;return E(Rn,{type:"chart",children:[w(Nn,{title:"Profit + Loss"}),w(Mn,{children:n?w(Mo,{children:w(_o,{})}):E(C,{children:[w(Vn,{title:Gn(o?.total??0),label:"Profit"}),w(jn,{children:w(So,{data:o})})]})}),t&&w(Fo,{size:"xl"})]})}const Ko=Rt(null,xt({display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"flex-start",gap:"10px",alignSelf:"stretch"}));function $o({children:e}){return w("div",{...Ko,children:e})}const qo="conversations-section",Yo="transactions-section",Go={MESSAGE_REVIEW:qo,TRANSACTION_REVIEW:Yo,RULE_REVIEW:"",CSV_IMPORT_REVIEW:""},Qo={reviewStatus:{in:["USER_REVIEW_REQUIRED"]},status:{in:["ACTIVE"]},category:{expand:!0},glAccount:{expand:!0},bankAccount:{expand:!0}},Xo={resolutionStatus:{in:["OPEN"]}},Zo=[],Jo=[];function ea(e){return bn(`${t=e,yn[t]}`,"v6");var t}const ta={LINK_BANK:"LINK_BANK",RELINK:"RELINK",UNLINK_RELINK:"UNLINK_RELINK",OPEN_BANK:"OPEN_BANK",DELETE_OR_RELINK:"DELETE_OR_RELINK",UNLINK_ONLY:"UNLINK_ONLY",CHAT:"CHAT",MESSAGE_REVIEW:"MESSAGE_REVIEW",TRANSACTION_REVIEW:"TRANSACTION_REVIEW",BANK_ERROR:"BANK_ERROR",RULE_REVIEW:"RULE_REVIEW",CSV_IMPORT_REVIEW:"CSV_IMPORT_REVIEW",ONBOARDING_FORM:"ONBOARDING_FORM"},ra=e=>["tasks",e??{}],na={URGENT:0,HIGH:1,MEDIUM:2,LOW:3},oa=async e=>{const t=e.queryKey,r=t[1],n={path:"/v6/tasks/query",accessToken:t[2].accessToken,bodyParams:{...r},endpointManager:ea(t[2].environment)},o=await mn(n);return"SUCCESS"===o.result&&void 0!==o.data?{data:o.data}:{data:void 0}},aa=Et({base:{stroke:"currentColor"},variants:{primary:{DEFAULT:{stroke:"icon.intent.primary"},hover:{stroke:"icon.intent.primary.hover"},active:{stroke:"icon.intent.primary.active"}},secondary:{DEFAULT:{stroke:"icon.intent.secondary"},hover:{stroke:"icon.intent.secondary.hover"},active:{stroke:"icon.intent.secondary.active"}},success:{DEFAULT:{stroke:"icon.intent.success"},hover:{stroke:"icon.intent.success.hover"},active:{stroke:"icon.intent.success.active"}},warning:{DEFAULT:{stroke:"icon.intent.warning"},hover:{stroke:"icon.intent.warning.hover"},active:{stroke:"icon.intent.warning.active"}},danger:{DEFAULT:{stroke:"icon.intent.danger"},hover:{stroke:"icon.intent.danger.hover"},active:{stroke:"icon.intent.danger.active"}},action:{DEFAULT:{stroke:"icon.intent.action"},hover:{stroke:"icon.intent.action.hover"},active:{stroke:"icon.intent.action.active"}}}});function ia(e,t){const r=({size:t=24,fill:r="transparent",stylists:n})=>{const o=Bt([Rt(null,aa()),...n]);return w(e,{...o,style:{minHeight:t,minWidth:t},width:t,height:t,fill:r})};return r.displayName=t,r}const la=ia(e=>c.createElement("svg",{width:13,height:12,viewBox:"0 0 13 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("path",{d:"M8.31473 0.399963L2.71472 5.99997L8.31473 11.6",stroke:"#182428",strokeMiterlimit:10})),"ArrowLeft"),sa=ia(e=>c.createElement("svg",{width:13,height:12,viewBox:"0 0 13 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("path",{d:"M4.31472 11.6L9.91473 5.99997L4.31472 0.399959",stroke:"#182428",strokeMiterlimit:10})),"ArrowRight"),ca=xt({transition:"background 300ms ease-out, background-color 300ms ease-out, border-color 300ms ease-out, box-shadow 0ms",_supportHover:{transition:"background 100ms ease-out, background-color 100ms ease-out, border-color 100ms ease-out, box-shadow 0ms"}}),da=xt({transition:"background 300ms ease-out, box-shadow 0ms",_supportHover:{transition:"background 100ms ease-out, box-shadow 0ms"}}),ua=xt({transition:"color 300ms ease-out",_supportHover:{transition:"color 100ms ease-out"}});xt({"& > .Tight-text":{transition:"color 300ms ease-out",_supportHover:{transition:"color 100ms ease-out"}}});const ha=xt({"& path":{transition:"stroke 300ms ease-out",_supportHover:{transition:"stroke 100ms ease-out"}}}),pa=h({hasNextPage:!1,hasPreviousPage:!1,getFirstPage:()=>{},getLastPage:()=>{},pageBackwards:()=>{},pageForwards:()=>{}});function ga({Component:e,stylists:t}){return w(e,{stylists:[Rt(St["small-icon"]),...t??[]],size:12})}const ma=Rt(null,xt({backgroundColor:"surface.foreground",border:"{borderWidths.lg} solid",borderRadius:"md",borderColor:"border.layout",color:"typography.base",display:"inline-flex",alignItems:"center",justifyContent:"center",height:{sm:"35px",base:"50px"},gap:{sm:0,base:20}})),va=Rt(null,xt({border:"none",borderRadius:"sm",backgroundColor:"surface.intent.action.discrete",padding:{sm:"4px",base:"12px"},margin:0,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",outline:"none",boxShadow:"0 0 0 0 transparent","&:focus-visible":{outline:"4px solid",outlineColor:"border.layout"},"&:disabled":{opacity:.6,pointerEvents:"none"},_supportHover:{backgroundColor:"surface.intent.action.discrete.hover"}}),da),ba=Rt(null,xt({display:"flex",gap:"9px",padding:"10px",justifyContent:"center",alignItems:"center"})),fa=Rt(null,xt({height:{sm:"12px",base:"20px"},width:{sm:"12px",base:"20px"}}));function ya(){const{hasNextPage:e,hasPreviousPage:t,pageForwards:r,pageBackwards:n}=function(){const e=p(pa);if(void 0===e)throw new Error("usePaginationContext must be used within a PaginationProvider");return e}();return E("div",{...ma,children:[w("div",{...ba,children:w("button",{...va,onClick:n,disabled:!t,children:w(ga,{Component:la,stylists:[fa]})})}),w("div",{...ba,children:w("button",{...va,onClick:r,disabled:!e,children:w(ga,{Component:sa,stylists:[fa]})})})]})}const Ta=xt({width:"100%",height:"50px"});function xa(){return w(No,{styles:Ta})}const ka=Rt(St["dashboard-placeholder-table"],xt({display:"flex",flexDirection:"column",gap:"4px"})),wa=Rt(null,xt({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",height:"52px",paddingLeft:"64px",paddingRight:"64px"})),Ca=xt({width:"100px",height:"20px"});function Ea({numColumns:e=6}){return E("div",{...ka,children:[w("div",{...wa,children:Array.from({length:e},(e,t)=>w(No,{styles:Ca},t))}),w(xa,{}),w(xa,{}),w(xa,{}),w(xa,{}),w(xa,{}),w(xa,{})]})}function Ia(e,t){const r=mr(),n=Tr();return v(o=>{const a=pr(r),i=a?{}:{retry:!1,staleTime:1/0};return fr.prefetchQuery({queryKey:sr(e(o),r??"",n),queryFn:a?t:vr,...i})},[e,t,r,n])}const Sa=Object.freeze({}),Aa=Object.freeze({cursor:"FINAL_PAGE"});function Na({queryKey:e,queryFn:t,...r}){const[n,o]=m(Sa),i=d(e);a(i.current,e)||(i.current=e,o(Sa));const l=xr({...r,queryKey:cr(e,n),queryFn:t,keepPreviousDataPlaceholder:!0}),s=u(()=>{return e=l.query.data?.cursor,t=o,{getFirstPage:()=>t(Sa),getLastPage:()=>t(Aa),hasNextPage:ur(e?.after),hasPreviousPage:ur(e?.before),pageForwards:()=>{e?.after&&t({cursor:e.after})},pageBackwards:()=>{e?.before&&t({cursor:e.before})}};var e,t},[l.query.data?.cursor]),c=Ia(v(t=>cr(e,t),[e]),t),h=Ia(v(t=>cr(e,t),[e]),t);return b(()=>{const e=l.query.data?.cursor;!l.query.isFetching&&e&&(e.after&&c({cursor:e.after}).catch(e=>{on({error:e,severity:"error"})}),e.before&&h({cursor:e.before}).catch(e=>{on({error:e,severity:"error"})}))},[l.query.data?.cursor,l.query.isFetching,c,h]),{...l,paginationControls:s}}async function Pa({authorization:e,extraHeaders:t,includeCredentials:r,params:n,url:o,cache:a}){const i=cn({extraHeaders:t,authorization:e}),l=(({url:e,params:t})=>{let r=e;const n=null==(o=t)?"":Object.entries(o).map(([e,t])=>{let r;return r=Array.isArray(t)?t.map(t=>sn(e,t)).join("&"):sn(e,t),r}).join("&");var o;return""!==n&&(r+=`?${n}`),r})({url:o,params:n});nn("HTTP GET Request",{url:o,accessToken:e});try{const e=await fetch(l,{method:"GET",headers:i,credentials:"include",cache:a});return nn("HTTP GET Response",{url:o,status:e.status,statusText:e.statusText}),dn(e)}catch(s){return Promise.reject(s)}}async function Ma(e){const{url:t,headers:r}=hn(e);return Pa({url:t,params:e.params,includeCredentials:!0,extraHeaders:r})}async function Da(e){return Ma({...e,endpointManager:ea(e.environment)})}async function Ra(e){return Ma({...e,endpointManager:xn(e.environment)})}function Oa({delay:e,callback:t}){const r=u(()=>function({delay:e,callback:t}){let r;const n=()=>{r&&(clearTimeout(r),r=void 0)};return{startCallback:o=>{n(),r=setTimeout(()=>{t(o)},e)},cancelCallback:()=>n()}}({delay:e,callback:t}),[e,t]);return b(()=>()=>{r.cancelCallback()},[r]),{startCallback:v(e=>{r.startCallback(e)},[r]),cancelCallback:v(()=>{r.cancelCallback()},[r])}}function _a({prefetchFn:e}){const{startCallback:t,cancelCallback:r}=Oa({delay:250,callback:e});return{startPrefetch:t,cancelPrefetch:r}}const La={CREATED_DATE_TIME:"CREATED_DATE_TIME",SUBJECT:"SUBJECT",EMAIL:"EMAIL",LAST_MESSAGE_CREATED_DATE_TIME:"LAST_MESSAGE_CREATED_DATE_TIME",LAST_MESSAGE_TEXT:"LAST_MESSAGE_TEXT"},Fa={ASC:"ASC",DESC:"DESC"},Ba=e=>["conversations",e??{}],Wa=e=>["conversations","conversation",e],Ha=async e=>{const t=e.queryKey,r={path:"/v6/conversations/query",bodyParams:{...t[1],cursor:t[2].cursor},accessToken:t[3].accessToken,endpointManager:ea(t[3].environment)},n=await mn(r);return"SUCCESS"===n.result&&void 0!==n.data?{data:n.data,cursor:n.cursor}:{data:void 0,cursor:void 0}};function Ua(e){return Na({queryKey:e?Ba(e):["conversations",{}],queryFn:Ha})}const Va=async e=>{const t=e.queryKey,{id:r}=t[2],n={path:"/v6/conversations/{id}",pathParams:{id:r},accessToken:t[3].accessToken,environment:t[3].environment},o=await Da(n);return"SUCCESS"===o.result&&void 0!==o.data?o.data:null};function za(e){const t=ur(e);return xr({queryKey:Wa({id:e??""}),queryFn:Va,enabled:t})}const ja=async({data:e,accessToken:t,environment:r})=>{const n={path:"/v6/conversations",bodyParams:e,accessToken:t,endpointManager:ea(r)};return await mn(n)};function Ka(){return _a({prefetchFn:Ia(Wa,Va)})}function $a(e){const t=e.getSize(),r=e.columnDef.maxSize;return{flex:`${t} 0 auto`,width:t,maxWidth:void 0!==r?`${r}px`:"auto"}}function qa({header:e}){const t=$a(e.column);return w("div",{...Rt(St["dashboard-table-column-header"]),style:t,children:e.isPlaceholder?null:z(e.column.columnDef.header,e.getContext())})}const Ya=Rt(St["dashboard-table-header"],xt({display:"flex",flexDirection:"row",alignItems:"center",paddingBlock:"10px"}));function Ga({headerGroups:e}){return w("div",{children:e.map(e=>f("div",{...Ya,key:e.id},e.headers.map(e=>w(qa,{header:e},e.id))))})}const Qa=Rt(St["dashboard-table-body"],xt({display:"flex",flexDirection:"column"}));function Xa({children:e}){return w("div",{...Qa,children:e})}const Za=Et({base:{},variants:{alignment:{vertical:{width:"{borderWidths.md}",minWidth:"{borderWidths.md}",height:"100%"},horizontal:{width:"100%",height:"{borderWidths.md}",minHeight:"{borderWidths.md}"}},color:{normal:{backgroundColor:"border.layout"},strong:{backgroundColor:"border.layout.strong"}}}});function Ja({alignment:e="vertical",color:t="normal",additionalClassName:r}){const n=Rt("vertical"===e?St["vertical-divider"]:St["horizontal-divider"],r,Za({alignment:e,color:t}));return w("div",{...n})}function ei(){return w(Ja,{additionalClassName:St["table-cell-divider"]})}function ti({cell:e,index:t,onCellClick:r,shouldDisplayDivider:n}){const o=$a(e.column),a=Rt(St["dashboard-table-cell"],xt({height:"100%",display:"flex",justifyContent:"center",flexDirection:"column"})),i=Rt(null,xt({display:"flex",flexDirection:"row",height:"100%"})),l=n(t);return E("div",{...i,style:o,onClick:()=>{r&&r(e)},children:[l&&w(ei,{}),w("div",{style:o,...a,children:z(e.column.columnDef.cell,e.getContext())})]})}const ri=Rt(St["table-sub-row"],xt({display:"flex",alignItems:"center",justifyContent:"flex-start",height:"60px",overflow:"hidden",minWidth:"fit-content",borderRadius:"zero"}));function ni({rowData:e,onCellClick:t,shouldDisplayDivider:r}){const n=e.getVisibleCells();return w("div",{...ri,children:n.map((e,n)=>w(ti,{cell:e,index:n,onCellClick:t,shouldDisplayDivider:r,isChild:!0},e.id))})}const oi=xt({display:"flex",flexDirection:"column",borderRadius:"zero",cursor:"pointer",minWidth:"fit-content"}),ai=xt({background:"surface.background"}),ii=Rt(St["table-row"],xt({display:"flex",alignItems:"center",justifyContent:"flex-start",height:{sm:"60px",base:"85px"},minWidth:"fit-content"}));function li({rowData:e,onMouseEnter:t,onMouseLeave:r,onCellClick:n,shouldDisplayDivider:o}){const a=e.getIsExpanded(),i=Rt(St["table-parent-row"],oi,e.index%2==0?ai:void 0),l=e.getVisibleCells();return E("div",{...i,onMouseEnter:t,onMouseLeave:r,children:[w("div",{...ii,children:l.map((e,t)=>w(ti,{cell:e,index:t,onCellClick:n,shouldDisplayDivider:o},e.id))}),a&&w("div",{children:e.subRows.map(e=>w(ni,{rowData:e,onCellClick:n,shouldDisplayDivider:o},e.id))})]})}const si=(e,t={})=>{Le.getState().openDrawer(e,t)},ci=()=>{Le.getState().closeDrawer()},di={DATE:"DATE",DESCRIPTION:"DESCRIPTION",AMOUNT:"AMOUNT",STATUS:"STATUS",REVIEW_STATUS:"REVIEW_STATUS"},ui={ASC:"ASC",DESC:"DESC"},hi=e=>["banks/transactions",e??{}],pi=e=>["banks/transactions",e.id],gi=async e=>{const t=e.queryKey,r={path:"/v6/banks/transactions/query",bodyParams:{...t[1],cursor:t[2].cursor},accessToken:t[3].accessToken,endpointManager:ea(t[3].environment)},n=await mn(r);return"SUCCESS"===n.result&&void 0!==n.data?{data:n.data,cursor:n.cursor}:{data:void 0,cursor:void 0}};function mi(e){return Na({queryKey:hi(e),queryFn:gi})}const vi=async e=>{const t=e.queryKey,r={path:"/v6/banks/transactions/{id}",pathParams:{id:t[1]},accessToken:t[2].accessToken,environment:t[2].environment},n=await Da(r);return"SUCCESS"===n.result&&void 0!==n.data?n.data:null};function bi({id:e}){return xr({queryKey:pi({id:e}),queryFn:vi})}function fi(){return _a({prefetchFn:Ia(pi,vi)})}const yi={COMPANY:"co",EMPLOYEE:"emp",CLASS_SEGMENT:"cls",CLASS_LABEL:"cll",CUSTOMER:"cus",BANK_ACCOUNT:"bka",GL_ACCOUNT:"gla",TRANSACTION_CATEGORY:"ctg",BANK_TRANSACTION:"btxn",PROCESSOR_TRANSACTION:"ptxn",TRANSACTION_LINE_ITEM:"tli",VENDOR:"vnd",TRANSACTION_RULE:"trl",INVOICE:"inv",INVOICE_LINE_ITEM:"ili",BILL:"bll",BILL_LINE_ITEM:"bli",PAYROLL:"prl",PAYROLL_LINE_ITEM:"pli",FINANCIAL_SUMMARY:"fsm",TASK:"tsk",CONVERSATION:"cnv",MESSAGE:"msg",REACTION:"rct",BUSINESS_TYPE:"bzt",TEMPLATE_CLASS_LABEL:"tcll",TEMPLATE_COA:"tcoa",TEMPLATE_GL_ACCOUNT:"tgla",TEMPLATE_TRANSACTION_RULES:"ttrl",MANUAL_JOURNAL_ENTRY:"mje",ASSET:"ast",ASSET_DEPRECIATION:"asd",EXPENSE_AMORTIZATION:"exa",REVENUE_RECOGNITION:"rvr",GL_TRANSACTION:"glt",ATTACHMENT:"att",CAR:"car",MILEAGE:"mlg",INTEGRATION:"int",TIME:"tme",TIME_TYPE:"tmt",TAX_RETURN:"txr"};function Ti(e,t){return!hr(e)&&e.startsWith(t)}function xi({id:e,prefix:t}){return void 0!==e?`${yi[t]}_${e}`:""}const ki=e=>["conversations/messages",e];function wi(e){if(dr(e)||0===e.length)return null;const t=[[e[0]]];for(let r=1;r<e.length;r++){const n=e[r],o=t[t.length-1],a=o[0].author.userId;n.author.userId===a?o.push(n):t.push([n])}return t}const Ci=async e=>{const t=e.queryKey,{id:r}=t[1],n={path:"/v6/conversations/{id}/messages",pathParams:{id:r},accessToken:t[2].accessToken,environment:t[2].environment},o=await Da(n);return"SUCCESS"===o.result&&void 0!==o.data?o.data:null},Ei=async({data:e,accessToken:t,environment:r})=>{const n={path:"/v6/messages",bodyParams:{data:[e]},endpointManager:ea(r),accessToken:t};return await mn(n)};function Ii(){return _a({prefetchFn:Ia(ki,Ci)})}const Si=e=>["summaries",e??{}],Ai=e=>["summaries",e.id],Ni=async e=>{const t=e.queryKey,r={path:"/v6/summaries/query",bodyParams:{...t[1]},accessToken:t[2].accessToken,endpointManager:ea(t[2].environment)},n=await mn(r);return"SUCCESS"===n.result&&void 0!==n.data?{data:n.data}:{data:void 0}};const Pi=async e=>{const t=e.queryKey,r={path:"/v6/summaries/{id}",pathParams:{id:t[1]},accessToken:t[2].accessToken,environment:t[2].environment},n=await Da(r);return"SUCCESS"===n.result&&void 0!==n.data?n.data:null};function Mi({rowData:e,isMobile:t}){const{startPrefetch:r,cancelPrefetch:n}=Ka(),{startPrefetch:o,cancelPrefetch:a}=Ii(),{startPrefetch:i,cancelPrefetch:l}=fi(),{startPrefetch:s,cancelPrefetch:c}=_a({prefetchFn:Ia(Ai,Pi)}),d=v(()=>{ur(e.original.attachedEntityId)&&Ti(e.original.attachedEntityId,yi.BANK_TRANSACTION)?i({id:e.original.attachedEntityId}):ur(e.original.attachedEntityId)&&Ti(e.original.attachedEntityId,yi.FINANCIAL_SUMMARY)&&s({id:e.original.attachedEntityId}),o({id:e.original.id}),r({id:e.original.id})},[e.original.attachedEntityId,e.original.id,o,r,i,s]),u=v(()=>{ur(e.original.attachedEntityId)&&Ti(e.original.attachedEntityId,yi.BANK_TRANSACTION)?l():ur(e.original.attachedEntityId)&&Ti(e.original.attachedEntityId,yi.FINANCIAL_SUMMARY)&&c(),a(),n()},[l,c,n,a,e.original.attachedEntityId]);return w(li,{rowData:e,onMouseEnter:d,onMouseLeave:u,shouldDisplayDivider:e=>0!==e,onCellClick:()=>((e,t,r)=>{r?si("MobileConversation",{routeProps:{conversationId:e,transactionId:t}}):ur(t)?Ti(t,yi.BANK_TRANSACTION)?si("BankTransactionFormRouter",{routeProps:{transactionId:t,initialTab:"conversation"}}):Ti(t,yi.FINANCIAL_SUMMARY)&&(n=e,o=t,si("FinancialSummary",{routeProps:{conversationId:n,summaryId:o}})):function(e){si("Conversation",{routeProps:{conversationId:e}})}(e);var n,o})(e.original.id,e.original.attachedEntityId,t)})}const Di=ia(e=>c.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:15,height:15,viewBox:"0 0 15 15",fill:"none",...e},c.createElement("path",{d:"M0.328064 7.5H14.6719",strokeMiterlimit:10}),c.createElement("path",{d:"M7.5 0.328064V14.6719",strokeMiterlimit:10})),"Plus"),Ri=xt({display:"flex",alignItems:"center",justifyContent:"center",outline:"none",cursor:"pointer",borderRadius:"md","&:focus-visible":{outline:"4px solid",outlineColor:"border.layout",outlineOffset:"-1px"},"&:disabled":{cursor:"not-allowed",opacity:.6}}),Oi=xt({color:"typography.intent.secondary",border:"{borderWidths.md} solid",borderColor:"border.layout",backgroundColor:"surface.intent.action.discrete",_supportHover:{_notDisabled:{backgroundColor:"surface.intent.action.discrete.hover",borderColor:"border.layout","& .Tight-text":{color:"typography.intent.secondary.hover"}}},"&:active:enabled, &[data-active='true']:enabled":{backgroundColor:"surface.intent.action.discrete.active","& .Tight-text":{color:"typography.intent.secondary.active"}},"& .Tight-text":{color:"typography.intent.secondary"}}),_i=xt({padding:"10px",fontSize:"md",fontWeight:"md",gap:"9px"}),Li=xt({padding:"6px",fontSize:"sm",fontWeight:"sm",gap:"5px"}),Fi=xt.raw({display:"flex",alignItems:"center",gap:"5px",backgroundColor:"surface.intent.action.discrete",borderRadius:"md",border:"{borderWidths.md} solid transparent",outline:"none",boxShadow:"0 0 0 0 transparent",position:"relative",cursor:"pointer",color:"icon.base","&:focus-visible":{outline:"4px solid",outlineColor:"border.layout"},"&:disabled":{cursor:"default"},_supportHover:{_enabled:{borderColor:"border.intent.action.hover",backgroundColor:"surface.intent.action.discrete.hover",color:"icon.intent.action.hover",fill:"icon.intent.action.hover"}},"&:active:enabled, &[data-active='true']:enabled":{backgroundColor:"surface.intent.action.discrete.active",borderColor:"transparent",color:"icon.intent.action.active",fill:"icon.intent.action.active"}}),Bi=Et({variants:{width:{default:{width:"fit-content"},"fill-parent":{width:"100%"}}}}),Wi={default:_i,small:Li},Hi=e=>{const t=Wi[e];return Rt(St["button-base"],t,Ri,ca)},Ui=["default","small"],Vi={default:{className:""},small:{className:""}};for(const kT of Ui)Vi[kT]=Hi(kT);const zi=y(function({children:e,stylists:t=[],type:r="button",onClick:n,disabled:o,size:a="default",width:i="default",active:l=!1,onMouseEnter:s,onMouseLeave:c,popupTriggerProps:d},u){const h=Bt([Vi[a],Rt(null,Bi({width:i})),...t]);return w("button",{ref:u,...h,type:r,onClick:n,disabled:o,"data-active":l,onMouseEnter:s,onMouseLeave:c,...d,children:e})}),ji=Rt(St["button-primary"],Oi),Ki=y(function({children:e,active:t,stylists:r=[],width:n,...o},a){return w(zi,{ref:a,stylists:[ji,...r],active:t,width:n,...o,children:e})}),$i=()=>{si("Conversation",{routeProps:{conversationId:null}})};function qi(){return w(Ki,{onClick:$i,children:w(ga,{Component:Di})})}const Yi=Et({base:{display:"flex",flexDirection:"column",flexGrow:1,animation:"appear.instant",overflow:"hidden"},variants:{dashboard:{transactionDashboard:{border:"none"},businessOwnerDashboard:{marginTop:"10px",border:"{borderWidths.lg} solid {colors.border.layout.strong}",borderRadius:"lg"}}}});function Gi({children:e,dashboard:t}){const r=Rt(St["dashboard-table"],Yi({dashboard:t}));return w("div",{...r,children:e})}const Qi=h(null),Xi="mobile",Zi=Et({base:{fontWeight:"label",fontSize:{sm:"label",base:"lg"},fontFamily:"label",lineHeight:{sm:"16px",base:"18px"},letterSpacing:"0.84px",maxWidth:"100%"},variants:{intent:{default:{color:"typography.label"},primary:{color:"typography.intent.primary"},contrast:{color:"typography.contrast"}},wrap:{ellipsis:_n,wrap:{whiteSpace:"normal",overflowWrap:"break-word"}},alignment:{left:{textAlign:"left"},center:{textAlign:"center"}}}});function Ji({children:e,intent:t="default",wrap:r="ellipsis",alignment:n="left"}){const o=Rt(St.label,Zi({intent:t,wrap:r,alignment:n}));return hr(e)?null:w("div",{title:"ellipsis"===r?e:void 0,...o,children:e})}const el=Rt(St["emphasis-label"],xt({lineHeight:"16px"}));function tl({children:e}){return w(Zn,{size:"med",weight:"lg",stylists:[el],children:e})}function rl({text:e,isRead:t}){return w(t?Ji:tl,{children:e})}const nl=Et({base:{padding:"0 25px",height:"100%",display:"flex",justifyContent:"center",flexDirection:"column",width:"100%"},variants:{alignVariant:{flexStart:{alignItems:"flex-start"},center:{alignItems:"center"}}},defaultVariants:{alignVariant:"flexStart"}});function ol({children:e,alignVariant:t="flexStart"}){const r=Rt(null,nl({alignVariant:t}));return w("div",{...r,children:e})}function al({date:e,isRead:t=!1}){const r=lr(e);return w(rl,{text:r,isRead:t})}const il=Rt(St["strong-sub-label"],Wt({label:"strongSubLabel"}));function ll({children:e,stylists:t=[]}){return hr(e)?null:w(Zn,{size:"sm",weight:"med",stylists:[il,...t],children:e})}const sl=h(null),cl=xt({overflow:"auto",display:"flex",flexDirection:"column",width:"325px",maxHeight:"314px",minWidth:"325px","&:focus, &:focus-within":{outline:"none"},scrollbar:"hidden"}),dl=Rt(St["selector-row"],xt({borderRadius:"zero",backgroundColor:"surface.intent.action.discrete",boxShadow:"none",border:"{borderWidths.md} solid",borderColor:"border.layout",display:"flex",width:"100%",minHeight:"35px",height:"fit-content",padding:"10px",alignItems:"flex-start",gap:"9px",flexShrink:0,textAlign:"start",cursor:"pointer","&[data-focused='true']":{boxShadow:"none",outline:"none",backgroundColor:"surface.intent.action.discrete.hover"}}));function ul(e,t,r){const[n,o]=m(e);return[t??n,r??o]}function hl({children:e}){return null===ae()?w(ie,{children:e}):e}function pl({children:e,modal:t=!1,initialOpen:r,placement:n,offsetPx:o,open:a,onOpenChange:i,blockInteraction:l=!0,enableClickMiddleware:s=!0}){const c=function({initialOpen:e=!1,placement:t="bottom",offsetPx:r=0,modal:n,open:o,onOpenChange:a,enableClickMiddleware:i=!0}={}){const[l,s]=m(),[c,d]=m(),[h,p]=ul(e,o,a),g=Y(),v=G({placement:t,open:h,nodeId:g,onOpenChange:(e,t)=>{!e&&t instanceof MouseEvent&&(t.clientX<0||t.clientY<0||t.clientX>window.innerWidth||t.clientY>window.innerHeight)||p(e)},whileElementsMounted:ee,middleware:[Q(r),X({crossAxis:t.includes("-"),fallbackStrategy:"bestFit",fallbackAxisSideDirection:"none",padding:8}),Z({padding:8}),J({apply({availableHeight:e,elements:t}){let r=e;if(e<314){const t=37*Math.floor(e/37)-18.5;r=Math.max(t,55.5)}Object.assign(t.floating.style,{maxHeight:`${r}px`,overflowY:"auto"})},padding:8})]}),b=v.context,f=te(b,{enabled:i}),y=re(b,{bubbles:{escapeKey:!0}}),T=ne(b),x=oe([f,y,T]);return u(()=>({open:h,setOpen:p,...x,...v,modal:n,labelId:l,descriptionId:c,setLabelId:s,setDescriptionId:d,nodeId:g}),[h,p,x,v,n,l,c,g])}({modal:t,initialOpen:r,placement:n,offsetPx:o,open:a,onOpenChange:i,enableClickMiddleware:s}),d=ae(),h=l&&null===d,p=c.nodeId;return w(hl,{children:w(le,{id:p,children:w(sl.Provider,{value:{...c,popupParentNodeId:d,blockInteraction:h},children:e})})})}function gl(){const e=p(sl);if(null==e)throw new Error("Popup components must be wrapped in <PopupManager />");return e}function ml({children:e}){const t=gl(),r=t.refs.setReference,n=t.open?"open":"closed",o={...t.getReferenceProps(),ref:r,"data-state":n};return w(C,{children:e(o)})}const vl=ia(e=>c.createElement("svg",{width:10,height:10,viewBox:"0 0 10 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("path",{d:"M1.23712 1.23718L8.76283 8.76289",stroke:"#182428",strokeWidth:.8,strokeMiterlimit:10}),c.createElement("path",{d:"M8.76288 1.23718L1.23717 8.76289",stroke:"#182428",strokeWidth:.8,strokeMiterlimit:10})),"Cross");function bl({Component:e,stylists:t}){return w(e,{stylists:[Rt(St["tiny-icon"]),...t??[]],size:9})}const fl=ia(e=>c.createElement("svg",{width:11,height:10,viewBox:"0 0 11 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("path",{d:"M1.03625 2.20312H9.96378",stroke:"#182428"}),c.createElement("path",{d:"M1.03625 5H9.96378",stroke:"#182428"}),c.createElement("path",{d:"M1.03625 7.79688H7.24223",stroke:"#182428"})),"Sort"),yl=Rt(null,xt({display:"flex",alignItems:"center",borderRadius:"md",border:"{borderWidths.lg} solid transparent",maxWidth:"fit-content",justifyContent:"center",_supportHover:{borderColor:"border.intent.action.hover",backgroundColor:"surface.intent.action.discrete.hover"},"&[data-active='true']":{backgroundColor:"surface.intent.action.discrete.active",borderColor:"border.intent.action.active"},"&:has(button:focus-visible)":{outline:"4px solid",outlineColor:"border.layout"}}),ca),Tl=Rt(null,xt({display:"flex",alignItems:"center",justifyContent:"center",gap:"5px",backgroundColor:"transparent",padding:"6px 0 6px 6px",border:"none",outline:"none",cursor:"pointer"})),xl=Rt(null,xt({display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"transparent",padding:0,margin:"6px 6px 6px 5px",border:"none",outline:"none",position:"relative",cursor:"pointer","&::before":{content:"''",position:"absolute",top:"-9px",right:"-7px",bottom:"-9px",left:"-5px"},_focusVisible:{borderRadius:"sm",outline:"4px solid",outlineColor:"border.layout"}})),kl=Rt(null,xt({padding:"0 6px 0 0",display:"flex",alignItems:"center"}));function wl({onClearClick:e,columnName:t,active:r,popupTriggerProps:n}){const o=r||"open"===n?.["data-state"];return E("div",{...yl,"data-active":o,children:[E("button",{...Tl,...n,children:[w(ll,{children:t}),!o&&w("div",{...kl,children:w(bl,{Component:fl})})]}),o&&w("button",{...xl,onClick:e,children:w(bl,{Component:vl})})]})}const Cl=Et({base:{border:"{borderWidths.md} solid",borderColor:"border.layout",background:"surface.background",borderRadius:"zero",boxShadow:"box-shadow",animation:"appear.instant",display:"flex",flexShrink:1,width:"max-content",position:"absolute",top:0,left:0,"& *":{boxSizing:"border-box"}},variants:{type:{reaction:{borderRadius:"sm"}}}});function El({initialFocus:e=!0,style:t,ref:r,type:n,...o}){const{context:a,blockInteraction:i,...l}=gl(),s=se([l.refs.setFloating,r]),c=Rt(St.popup,Cl({type:n}));return a.open?E(C,{children:[i&&w(ce,{lockScroll:!0}),w(de,{children:w(ue,{context:a,modal:l.modal,initialFocus:e?void 0:-1,children:w("div",{ref:s,...c,style:{...l.floatingStyles,...t},...l.getFloatingProps(o),"aria-labelledby":l.labelId,"aria-describedby":l.descriptionId,children:o.children})})})]}):null}const Il=Rt(St["popup-sort-row"],xt({border:"none",background:"none",paddingLeft:"10px",paddingRight:"10px",paddingTop:"4px",paddingBottom:"4px",margin:0,cursor:"pointer",display:"flex",alignItems:"center",width:"100%",outline:"none",_focusVisible:{outline:"4px solid",outlineOffset:"-2px",outlineColor:"border.layout"}}));function Sl({onClick:e,children:t,active:r}){return w("button",{onClick:e,...Il,children:w(ro,{accent:r?"active":"action",children:t})})}const Al=Rt(null,xt({display:"flex",flexDirection:"column",alignItems:"flex-start",width:"100%"})),Nl=Rt(null,xt({paddingTop:"10px",paddingLeft:"10px",paddingRight:"10px",paddingBottom:"8px",color:"typography.base.weak"}));function Pl({sortDef:e,sortAscDisplay:t,sortDescDisplay:r,handleSortClick:n,sortInstance:o}){const a=gl(),i=e=>{n(e),a?.setOpen(!1)},l=o?.orderBy===e&&"ASC"===o?.direction,s=o?.orderBy===e&&"DESC"===o?.direction;return E("div",{...Al,children:[w(ll,{stylists:[Nl],children:"Sort by:"}),w(Sl,{onClick:()=>i({orderBy:e,direction:"ASC"}),active:l,children:t}),w(Sl,{onClick:()=>i({orderBy:e,direction:"DESC"}),active:s,children:r})]})}const Ml=xt(Fi,{width:"fit-content",padding:"6px","&::before":{content:"''",position:"absolute",top:"-11px",left:"-11px",right:"-11px",bottom:"-11px"}}),Dl=Rt(St["button-discrete-small"],Ml,ca);function Rl({children:e,active:t,disabled:r,onClick:n,popupTriggerProps:o,ariaLabel:a,ariaExpanded:i}){const[l,s]=m(!1),c=t??function(e){switch(e){case"open":return!0;case"closed":return!1;case void 0:return}}(o?.["data-state"]);return w("button",{type:"button",...Dl,onClick:e=>{void 0===c&&s(!l),n&&n(e)},"data-active":c??l,disabled:r,...o,"aria-label":a,"aria-expanded":i,children:e})}const Ol={minWidth:"140px"};function _l({columnName:e,sortDef:t,sortAscDisplay:r,sortDescDisplay:n}){const o=p(Qi);if(!o)return null;const{sortInstance:a,setSortInstance:i}=o,l=a?.orderBy===t,s=()=>{i(void 0)};return t&&r&&n?E(pl,{placement:"bottom-start",children:[w(ml,{children:t=>w(wl,{active:l,onClearClick:s,columnName:e,popupTriggerProps:t})}),w(El,{style:Ol,children:w(Pl,{sortDef:t,sortAscDisplay:r,sortDescDisplay:n,handleSortClick:e=>{i(e)},sortInstance:a})})]}):w(Rl,{disabled:!0,children:w(ll,{children:e})})}const Ll=Rt(null,xt({paddingLeft:"19px"}));function Fl({columnName:e,sortDef:t,sortAscDisplay:r,sortDescDisplay:n}){return w("div",{...Ll,children:w(_l,{columnName:e,sortDef:t,sortAscDisplay:r,sortDescDisplay:n})})}const Bl="Oldest to Newest",Wl="Newest to Oldest";const Hl=h({userId:void 0,userRole:void 0,userEmail:void 0,companyId:void 0,customerPartnerId:void 0,apiPartnerName:void 0});function Ul({authorUserId:e,isRead:t}){const{userRole:r,userId:n}=p(Hl);let o="";return e===n?o="Me":"OWNER"===r?o="Bookkeeper":"ACCOUNTANT"===r&&(o="User"),w(rl,{text:o,isRead:t})}const Vl=Rt(St.text,xt({fontSize:"md",fontWeight:"lg",color:"typography.base",fontStyle:"normal",letterSpacing:"0.84px",lineHeight:"16px",maxWidth:"100%",fontFamily:"label"}),On);function zl({children:e,stylists:t=[]}){const r=Bt([Vl,...t]);return w("div",{...r,children:e})}const jl=Rt(St["emphasis-sub-label"],Wt({label:"emphasisSubLabel"}));function Kl({children:e}){return hr(e)?null:w(Zn,{size:"sm",weight:"lg",stylists:[jl],children:e})}const $l=xt({display:"grid",gridTemplateColumns:"3fr 1fr",border:"none",borderRadius:0,padding:"10px",width:"100%",cursor:"pointer",backgroundColor:"transparent",alignItems:"start"}),ql=wt(xt({display:"flex",flexDirection:"column",alignItems:"start",gap:"2px",maxWidth:"100%"}),On),Yl=xt({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"end",gap:"2px"});function Gl({sender:e,subject:t,date:r,message:n,isRead:o,handleFormOpen:a}){return E("button",{className:$l,onTouchEnd:a,children:[E("div",{className:ql,children:[w(Ul,{authorUserId:e,isRead:o}),w(o?ro:Kl,{children:t}),w(ro,{children:n})]}),E("div",{className:Yl,children:[w(al,{date:r,isRead:o}),o?w(ga,{Component:sa}):w(zl,{children:w(ga,{Component:sa})})]})]})}const Ql=j(),Xl=Rt(null,xt({paddingLeft:"25px"})),Zl=[Ql.accessor("latestMessage.author.userId",{id:"from",cell:({row:e})=>w(ol,{children:w(Ul,{authorUserId:e.original.latestMessage.author.userId,isRead:"READ"===e.original.readStatus})}),header:()=>w(ll,{stylists:[Xl],children:"From"}),size:150,maxSize:150}),Ql.accessor("subject",{id:"subject",cell:({row:e})=>w(ol,{children:w(rl,{text:e.original.subject,isRead:"READ"===e.original.readStatus})}),header:()=>w(ll,{stylists:[Xl],children:"Subject"}),size:150}),Ql.accessor("latestMessage.text",{id:"message",cell:({row:e})=>w(ol,{children:w(rl,{text:e.original.latestMessage.text,isRead:"READ"===e.original.readStatus})}),header:()=>w(ll,{stylists:[Xl],children:"Message"}),size:200}),Ql.accessor("lastUpdatedDateTime",{id:"date",cell:({row:e})=>w(ol,{children:w(al,{date:e.original.lastUpdatedDateTime,isRead:"READ"===e.original.readStatus})}),header:()=>w(Fl,{columnName:"Date",sortDef:"LAST_MESSAGE_CREATED_DATE_TIME",sortDescDisplay:Wl,sortAscDisplay:Bl}),size:130,maxSize:130}),Ql.display({id:Xi,cell:({row:e})=>w(Gl,{sender:e.original.latestMessage.author.userId,subject:e.original.subject,date:e.original.lastUpdatedDateTime,message:e.original.latestMessage.text,isRead:"READ"===e.original.readStatus,handleFormOpen:()=>{}})})];function Jl(e){return e?Zl.filter(e=>e.id===Xi):Zl.filter(e=>e.id!==Xi)}const es=[],ts=xt({display:"flex",flexDirection:"column",height:"250px",width:"100%",paddingBottom:"20px",alignItems:"center",justifyContent:"center",boxSizing:"border-box",textAlign:"center",backgroundColor:"surface.background",gap:"10px"}),rs=Rt(St["empty-dashboard-layout"],ts);function ns({children:e}){return w("div",{...rs,"data-testid":"empty-dashboard-layout",children:e})}function os({Component:e,stylists:t}){return w(e,{stylists:[Rt(St["large-icon"]),...t??[]],size:25})}const as=ia(e=>c.createElement("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("path",{d:"M14.0625 2.14374L1.5625 6.90624L11.6813 12.8562L14.0625 2.14374Z",strokeWidth:.9375,strokeMiterlimit:10}),c.createElement("path",{d:"M8.25624 10.8375L5.73124 12.8562L5.33749 9.12499L13.4687 2.73749",strokeWidth:.9375,strokeMiterlimit:10})),"Paperplane"),is=()=>{si("Conversation",{routeProps:{conversationId:null}})};function ls(){return E(C,{children:[w(os,{Component:as}),w(eo,{wrap:"wrap",children:"Need help with your financials?"}),w(Ki,{onClick:is,children:w(eo,{children:"Talk to a bookkeeper"})})]})}function ss(){return E(C,{children:[w(os,{Component:as}),w(eo,{wrap:"wrap",children:"All caught up"}),w(ro,{wrap:"wrap",children:"We'll let you know if something comes up."})]})}const cs=Rt(null,xt({display:"flex",flexDirection:"row",gap:"5px"}));function ds({children:e}){return w("div",{...cs,children:e})}const us=Et({variants:{isMobile:{true:{},false:{minWidth:"900px"}}}});function hs(e){return w(e?ss:ls,{})}function ps({sortInstance:e,setSortInstance:t,conversations:r,paginationControls:n,isFilling:o,isMobile:a}){const i=function({conversations:e,isMobile:t}){return K({data:e??es,manualPagination:!0,manualSorting:!0,manualFiltering:!0,manualGrouping:!0,rowCount:e?.length??es.length,columns:Jl(t),getCoreRowModel:$(),getRowId:e=>e.id})}({conversations:r,isMobile:a}),{query:{data:l},isFilling:s}=Ua({limit:1,filter:{resolutionStatus:{in:["OPEN","CLOSED"]}}}),c=!dr(l?.data?.[0])&&!s;return E("div",{className:us({isMobile:a}),children:[w("div",{id:qo}),E(pa.Provider,{value:n,children:[E(_t,{children:[w(Ut,{children:"Conversations"}),E(ds,{children:[w(ya,{}),w(qi,{})]})]}),w(Gi,{dashboard:"businessOwnerDashboard",children:o?w(Ea,{numColumns:4}):E(C,{children:[!a&&w(Qi.Provider,{value:{sortInstance:e,setSortInstance:t},children:w(Ga,{headerGroups:i.getHeaderGroups()})}),r.length>0?w(Xa,{children:i.getRowModel().rows.map(e=>w(Mi,{rowData:e,isMobile:a},e.id))}):w(ns,{children:hs(c)})]})})]})]})}const gs=Rt(St.body,Wt({body:"default"}));function ms({children:e,stylists:t=[]}){if(hr(e))return null;const r=Bt([gs,...t]);return w("div",{...r,children:e})}const vs=Rt(null,xt({display:"flex",flexDirection:"column",gap:"6px",width:"100%",padding:"10px"})),bs=Et({base:{height:16},variants:{width:{w92:{width:"92%"},w90:{width:"90%"},w88:{width:"88%"},w87:{width:"87%"},w85:{width:"85%"},w70:{width:"70%"}}}}),fs=[{width:"w85"},{width:"w90"},{width:"w88"},{width:"w85"},{width:"w92"},{width:"w87"},{width:"w90"},{width:"w85"},{width:"w88"}];function ys(){return w("div",{...vs,children:fs.map((e,t)=>w(No,{styles:bs({width:e?.width})},t))})}const Ts=ia(e=>c.createElement("svg",{width:25,height:24,viewBox:"0 0 25 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("path",{d:"M12 1.47998C6.2 1.47998 1.5 5.74998 1.5 11C1.52866 13.0153 2.23294 14.9626 3.5 16.53L2.5 21.53L9.16 20.2C10.1031 20.4499 11.0744 20.5776 12.05 20.58C17.85 20.58 22.55 16.3 22.55 11.03C22.55 5.75998 17.8 1.47998 12 1.47998Z",strokeWidth:1.5,strokeMiterlimit:10}),c.createElement("path",{d:"M11.05 11.02H12.95",strokeWidth:1.5,strokeMiterlimit:10}),c.createElement("path",{d:"M15.82 11.02H17.73",strokeWidth:1.5,strokeMiterlimit:10}),c.createElement("path",{d:"M6.27 11.02H8.18",strokeWidth:1.5,strokeMiterlimit:10})),"Comment"),xs=xt({position:"absolute",top:"-1",right:"-1",width:"10",height:"10",borderRadius:"999px",backgroundColor:"surface.intent.warning",boxShadow:"0 0 0 1px {colors.border.intent.warning}"}),ks=xt({position:"relative",width:"25px",height:"25px"});function ws({hasUnread:e}){return E("div",{className:ks,children:[w(os,{Component:Ts}),e&&w("div",{"data-testid":"unread-comment-badge",className:xs,"aria-hidden":"true"})]})}const Cs=xt({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"5px",padding:"10px",width:"100%",borderBottom:"{borderWidths.lg} solid {colors.border.layout.strong}",boxSizing:"border-box"});function Es({hasUnreadMessages:e=!1,showMessageIndicator:t}){return E("div",{className:Cs,children:[w(eo,{children:"Message Bookkeeper"}),t&&w(ws,{hasUnread:e})]})}const Is=xt({display:"flex",flexDirection:"column",gap:"10px",alignItems:"center",justifyContent:"center",width:"100%",height:"100%",textAlign:"center"});function Ss(){return E("div",{className:Is,children:[w(os,{Component:as}),w(eo,{wrap:"wrap",textAlign:"center",children:"Your financial summary will be ready soon"}),w(ro,{wrap:"wrap",children:"In the meantime, you can start a conversation with your bookkeeper."}),w(Ki,{onClick:()=>si("Conversation"),children:w(eo,{children:"Talk to a bookkeeper"})})]})}const As=xt({display:"flex",flexDirection:"column",gap:"10px",alignItems:"center",justifyContent:"center",width:"100%",height:"100%"});function Ns({summaryId:e,conversationId:t}){const{startPrefetch:r,cancelPrefetch:n}=Ka(),{startPrefetch:o,cancelPrefetch:a}=Ii(),i=v(()=>{o({id:t}),r({id:t})},[t,o,r]),l=v(()=>{a(),n()},[a,n]);return E("div",{className:As,children:[w(os,{Component:as}),w(eo,{wrap:"wrap",textAlign:"center",children:"Continue conversation with your bookkeeper"}),w(ro,{wrap:"wrap",children:"Pick up where you left off."}),w(Ki,{onClick:()=>si("FinancialSummary",{routeProps:{summaryId:e,conversationId:t}}),onMouseEnter:i,onMouseLeave:l,children:w(eo,{children:"Continue conversation"})})]})}const Ps=xt({display:"flex",flexDirection:"column",gap:"10px",alignItems:"center",justifyContent:"center",width:"100%",height:"100%"});function Ms({summaryId:e}){return E("div",{className:Ps,children:[w(os,{Component:as}),w(eo,{wrap:"wrap",textAlign:"center",children:"Ask questions about your financial summary"}),w(ro,{wrap:"wrap",children:"Your bookkeeper will respond here."}),w(Ki,{onClick:()=>si("FinancialSummary",{routeProps:{summaryId:e}}),children:w(eo,{children:"Talk to a bookkeeper"})})]})}function Ds({summaryId:e,conversationId:t}){const r=ur(t);return dr(e)?w(Ss,{}):r?w(Ns,{conversationId:t,summaryId:e}):w(Ms,{summaryId:e})}const Rs=xt({display:"flex",flexDirection:"column",flex:{base:"1 1 100%",md:"0 0 342px"},maxHeight:"247px",minHeight:"247px",width:"342px",background:"surface.foreground",border:"{borderWidths.lg} solid {colors.border.layout.strong}",borderRadius:"lg",alignItems:"center",overflow:"hidden",boxSizing:"border-box"}),Os=xt({display:"flex",flexDirection:"column",flex:"1 1 0",minHeight:0,width:"100%",backgroundColor:"surface.background",padding:"10px",gap:"10px",alignItems:"flex-start",boxSizing:"border-box"});function _s({summaryData:e}){const t=ur(e?.summary),r=ur(e?.conversation);return E("div",{className:Rs,children:[w(Es,{showMessageIndicator:t&&r,hasUnreadMessages:"UNREAD"===e?.conversation?.readStatus}),w("div",{className:Os,children:w(Ds,{summaryId:e?.id,conversationId:e?.conversation?.id})})]})}const Ls=xt({borderRadius:"lg",overflow:"auto",height:"100%",width:"100%",padding:"10px"}),Fs=Et({base:{display:"flex",flex:{base:"1 1 100%",md:"1 1 0"},maxHeight:"247px",minHeight:"247px",background:"surface.foreground",border:"{borderWidths.lg} solid {colors.border.layout.strong}",borderRadius:"lg",gap:"10px",alignItems:"flex-start",boxSizing:"border-box",position:"relative",marginBottom:10,overflow:"auto"},variants:{isSample:{true:{pointerEvents:"none",overflow:"hidden"},false:{}}}}),Bs=Rt(null,xt({whiteSpace:"pre-wrap",display:"flex",alignItems:"start",gap:"10px",height:"fit-content"})),Ws=xt({display:"flex",flexWrap:"wrap",gap:"10px",maxWidth:"1440px",alignItems:"flex-start"});function Hs({isSample:e,period:t}){const{query:{data:r},isFilling:n}=function(e){return r={select:e=>e?.data?.[0]},xr({queryKey:(t={limit:1,filter:{date:{equal:jt(e.month,e.year)},status:{in:["ACTIVE"]}},sort:{direction:"DESC",orderBy:"DATE"}})?Si(t):["summaries",{}],queryFn:Ni,...r});var t,r}(t),o=e?function(){const e=/* @__PURE__ */new Date;return`In ${e.toLocaleString("en-US",{month:"long"})} ${e.getFullYear()}, your total income increased significantly to $${Bo.toLocaleString()}, up from $${17924..toLocaleString()} the previous month, reflecting strong revenue growth. However, expenses also rose slightly to $${Wo.toLocaleString()}, compared to $${4534..toLocaleString()} last month, which slightly narrowed your net profit margin despite a healthy $${15157..toLocaleString()} net profit. \n\nA key area for improvement is transaction categorization; with one transaction remaining uncategorized and only two user-categorized, enhancing categorization accuracy will improve financial tracking and insights. To maintain positive momentum, consider reviewing variable expenses to identify any controllable cost increases.\n\nGoing forward, continue focusing on revenue growth while keeping a close eye on expense management, and aim to fully categorize all transactions to gain more precise financial visibility.`}():r?.summary??"A summary of this month's financials will appear here once more data is available.";return E("div",{className:Ws,children:[w("div",{"data-testid":"financial-summary-layout",className:Fs({isSample:e}),children:!e&&n?w(ys,{}):E("div",{className:Ls,children:[w(ms,{stylists:[Bs],children:o}),e&&w(Fo,{size:"lg"})]})}),w(_s,{summaryData:r})]})}async function Us(e){const{url:t,headers:r}=hn(e);return async function(e){const{authorization:t,extraHeaders:r,params:n,url:o}=e,a=cn({extraHeaders:r,authorization:t});nn("HTTP DELETE Request",{url:o,accessToken:t});try{const e=await fetch(o,{method:"DELETE",headers:a,credentials:"include",body:JSON.stringify(n)});return nn("HTTP DELETE Response",{url:o,status:e.status,statusText:e.statusText}),dn(e)}catch(i){return Promise.reject(i)}}({url:t,params:e.bodyParams,extraHeaders:r})}function Vs({mutationFn:e,onMutateFn:t,...r}){const n=mr(),o=Tr(),a=!hr(n);return P({...r,mutationFn:a?t=>e({data:t,accessToken:n,environment:o}):vr,onMutate:a&&ur(t)?e=>t({data:e,accessToken:n,environment:o}):void 0},fr)}const zs=async e=>{const t=e.queryKey,r={path:"/banks/plaidItems",accessToken:t[1].accessToken,environment:t[1].environment};return await Ra(r)};function js(e){return xr({...e,queryKey:["banks/plaidItems"],queryFn:zs})}function Ks(){return js({select:e=>{return t=e,t?.filter(e=>"ACTIVE"===e.status);var t}})}const $s=async({data:e,accessToken:t,environment:r})=>{const n={path:"/banks/integration",bodyParams:{id:e.id,removeFromApi:!0},accessToken:t,endpointManager:xn(r)};return await async function(e){return Us(e)}(n)};function qs(){return Vs({mutationFn:$s,onSuccess:()=>{const e=["banks/plaidItems"];return fr.invalidateQueries({queryKey:e})}})}const Ys=Rt(St["button-danger"],xt({color:"typography.intent.danger",border:"{borderWidths.md} solid",borderColor:"border.intent.danger",backgroundColor:"surface.intent.danger",_supportHover:{_notDisabled:{backgroundColor:"surface.intent.danger.hover",borderColor:"border.intent.danger.hover","& .Tight-text":{color:"typography.intent.danger.hover"}}},"&:active:enabled, &[data-active='true']:enabled":{backgroundColor:"surface.intent.danger.active",borderColor:"border.intent.danger.active","& .Tight-text":{color:"typography.intent.danger.active"}},"& .Tight-text":{color:"typography.intent.danger"}}));function Gs({children:e,stylists:t=[],...r}){return w(zi,{stylists:[Ys,...t],...r,children:e})}const Qs=Rt(St["button-tertiary"],xt({color:"typography.intent.success",border:"{borderWidths.md} solid",borderColor:"border.intent.success",backgroundColor:"surface.intent.success","& .Tight-text":{color:"typography.intent.success"},"& path":{stroke:"icon.intent.success"},_supportHover:{_notDisabled:{backgroundColor:"surface.intent.success.hover",borderColor:"border.intent.success.hover","& .Tight-text":{color:"typography.intent.success.hover"},"& path":{stroke:"icon.intent.success.hover"}}},"&:active:enabled, &[data-active='true']:enabled":{backgroundColor:"surface.intent.success.active",borderColor:"border.intent.success.active","& .Tight-text":{color:"typography.intent.success.active"},"& path":{stroke:"icon.intent.success.active"}}}));function Xs({children:e,stylists:t=[],...r}){return w(zi,{stylists:[Qs,...t],...r,children:e})}const Zs="cancel",Js="danger",ec="success",tc=Rt(null,xt({position:"fixed",inset:0,minHeight:"100dvh",display:"grid",placeItems:"center",backgroundColor:"overlay"})),rc=Rt(St["alert-dialog"],xt({background:"surface.background",borderRadius:"md",display:"flex",flexDirection:"column",padding:"16px",maxWidth:"360px",gap:"16px",minWidth:0,margin:"32px"})),nc=Rt(null,xt({display:"flex",justifyContent:"flex-end",gap:"8px"})),oc="success",ac="danger",ic=he.createConfirmation(pe(function({show:e,proceed:t,title:r,body:n,buttons:o=[{key:"ok",type:"default",label:"OK"}]}){const{context:a}=G({open:e,strategy:"fixed"}),i=re(a,{outsidePress:!1,escapeKey:!0}),l=ne(a,{role:"alertdialog"}),{getFloatingProps:s}=oe([i,l]);return e?w(de,{children:w(ce,{lockScroll:!0,...tc,children:w(ue,{context:a,modal:!0,returnFocus:!0,children:E("div",{...s(),...rc,children:[w(eo,{wrap:"wrap",children:r}),n&&"string"==typeof n?w(Ji,{wrap:"wrap",children:n}):w(C,{children:n}),w("div",{...nc,children:o.map(e=>{const r=(e=>{switch(e){case ac:return Gs;case oc:return Xs;default:return Ki}})(e.type);return w(r,{onClick:()=>e.onClick?t(e.onClick()):t(e.key),children:w(eo,{children:e.label})},e.key)})})]})})})}):null}));function lc(e){return bn(`${t=e,fn[t]}/v1`,"v1");var t}const sc=[{displayName:"Chase",institutionName:"ins_56"},{displayName:"Bank of America",institutionName:"ins_127989"},{displayName:"Capital One",institutionName:"ins_128026"},{displayName:"Wells Fargo",institutionName:"ins_127991"}];async function cc({institutionId:e,accessToken:t,environment:r}){if(!t)throw new Error("Access token is required to get Plaid item institution");const n={path:"/banks2/bankUrl",accessToken:t,endpointManager:lc(r)},{url:o,headers:a}=hn(n);return await Pa({url:o,includeCredentials:!0,extraHeaders:a,params:e?{institutionId:e}:void 0})}function dc(e,t,r,n){const o=1===r?e:t;return n?`${r} ${o}`:o}const uc=async({error:e,metadata:t,additionalInfo:r})=>{const n=await(e=>{const t=(e?.institution?.name?`${e.institution.name} failed to link.`:"Something went wrong.")+" Please try again later.";return ic({title:"Uh oh!",body:t,buttons:[{key:"cancel",label:"Cancel"},{key:"success",label:"Chat"}]})})(t);var o;"success"===n&&(o=e?.error_code?`I need help with my ${t?.institution?.name||"Plaid"} bank connection (code: ${e.error_code}).`:`I need help with my ${t?.institution?.name||"Plaid"} bank connection. ${r||""}`,si("Conversation",{routeProps:{conversationId:null,defaultValues:{message:o}}}))};function hc(e,t){const r=mr(),n=Tr(),[o,a]=m(""),{open:i,ready:l}=function(e,t,r){return ge({token:e,onSuccess:async(e,n)=>{try{const{plaidItem:i}=await async function({publicToken:e,metadata:t,accessToken:r,environment:n}){if(!r)throw new Error("Access token is required to create Plaid link token");const o={path:"/banks2/webPlaidPublicToken",accessToken:r,endpointManager:lc(n)},{url:a,headers:i}=hn(o);return await pn({url:a,params:{publicToken:e,plaidMetadata:t},includeCredentials:!0,extraHeaders:i})}({publicToken:e,metadata:n,accessToken:t,environment:r});await(o=i.apiInstitutionName,a=i.plaidItemAccounts.length,ic({title:"All set! Ready to track your transactions?",body:`Your ${a} ${o} ${dc("account","accounts",a)} are now linked. All transactions will be organized into easy-to-understand categories.`,buttons:[{key:ec,label:"Get started",type:oc}]})),on({error:new Error("Plaid Public Token exchanged successfully"),severity:"info",extraData:{metadata:n,publicToken:e}}),await fr.invalidateQueries()}catch(i){on({error:new Error("Plaid Public Token exchange failed"),severity:"error",extraData:{metadata:n,publicToken:e,error:i}}),uc({additionalInfo:"Error exchanging Plaid public token."})}var o,a},onExit:(t,r)=>{ur(t)?(on({error:new Error(t?.error_message),severity:"error",extraData:{metadata:r,error:t,token:e}}),uc({error:t,metadata:r})):on({error:new Error("Plaid Link exited by user without error"),severity:"info",extraData:{metadata:r,token:e}})},onEvent:(e,t)=>{on({error:new Error(`Plaid event: ${e}`),severity:"info",extraData:{metadata:t,eventName:e}})}})}(o,r,n);return b(()=>{l&&o&&(i(),t?.())},[l,i,o,t]),{linkPlaid:async()=>{try{const t=await async function({accessToken:e,plaidItemId:t,environment:r}){if(!e)throw new Error("Access token is required to create Plaid link token");const n={path:"/banks2/createPlaidLinkToken",accessToken:e,endpointManager:lc(r)},{url:o,headers:a}=hn(n);return Pa({url:o,includeCredentials:!0,extraHeaders:a,params:t?{plaidItemId:t}:void 0})}({accessToken:r,plaidItemId:e,environment:n});on({error:new Error("Plaid Link Token created successfully"),severity:"info",extraData:{accessToken:r,plaidItemId:e}}),a(t.link_token)}catch(t){on({error:new Error("Plaid Link Token creation failed"),severity:"error",extraData:{accessToken:r,plaidItemId:e,error:t}}),uc({additionalInfo:"Error creating Plaid link token."})}}}}const pc=h({dimensions:{width:null,height:null}});function gc(){const{dimensions:e}=p(pc);return ur(e.width)&&e.width<parseInt(io("sizes.breakpoint-sm"))}const mc={RELINK:"RELINK",UNLINK_RELINK:"UNLINK_RELINK",OPEN_BANK:"OPEN_BANK",DELETE_OR_RELINK:"DELETE_OR_RELINK",UNLINK_ONLY:"UNLINK_ONLY",CHAT:"CHAT"},vc={short:{credentialsChanged:e=>`${e} Credentials Changed`,accountLocked:e=>`${e} Account Locked`,supportChanged:e=>`${e} Support Changed`,updateNeeded:e=>`${e} Update Needed`,noAccountsAvailable:e=>`No ${e} Accounts Available`,connectionError:e=>`${e} Connection Error`,serverError:e=>`${e} Server Error`,temporarilyDown:e=>`${e} Temporarily Down`,serverDown:e=>`${e} Server Down`,requestError:e=>`${e} Request Error`,inputError:e=>`${e} Input Error`,volumeDown:e=>`${e} Down Due to Volume`,credentialsExpiring:e=>`${e} Credentials Expiring`,relinkNeeded:e=>`${e} Relink Needed`,generic:()=>"Bank Connection Error"},long:{relinkCredentials:()=>"Please relink your account using your latest credentials.",invalidUpdatedUsername:({isMobile:e})=>`Your bank account has an updated username and needs to the be relinked. To fix it, ${e?"tap":"click"} "Unlink." This will unlink your old account, so you can relink it. If you need any assistance, ${e?"tap":"click"} "Chat" to reach out to support.`,accountLocked:({isMobile:e})=>`Your bank account has been locked. To fix: 1. ${e?"Tap":"Click"} "Go to my Bank" and ask your financial institution to unlock your account. 2. After doing so, ${e?"tap":"click"} "Relink". If you need any assistance, ${e?"tap":"click"} "Chat" to reach out to support.`,supportChanged:({apiPartnerName:e})=>`Unfortunately, your bank has added restrictions that block services like ${e||"ours"} from linking with it. Please chat with support to resolve this issue.`,updateNeeded:({isMobile:e})=>`Your bank requires you to take some action. To fix: 1. ${e?"Tap":"Click"} "Go to my Bank" to log in and perform the requested action. 2. After doing so, ${e?"tap":"click"} "Relink". If you need any assistance, ${e?"tap":"click"} "Chat" to reach out to support.`,mfaUpdateNeeded:({isMobile:e})=>`You have an unsupported "Multi-Factor Authentication" enabled. To fix: 1. ${e?"Tap":"Click"} "Go to my Bank" to disable it on your banking site. 2. After doing so, ${e?"tap":"click"} "Relink". If you need any assistance, ${e?"tap":"click"} "Chat" to reach out to support.`,noAccountsUnlink:()=>"It seems that you have no active accounts with this bank. Please unlink this bank.",connectionError:()=>"Your bank connection encountered an error. Please chat with support to resolve the issue.",productNotReady:()=>"Your institution was not ready for transactions to be pulled. Please chat with support to resolve the issue.",permissionRevoked:({apiInstitutionName:e})=>`Access to your accounts with ${e} has been revoked. Please unlink and relink your account using your latest credentials.`,bankMaintenance:()=>"Your bank's server is down for maintenance, so it may take a little longer than normal to receive new transactions.",serverDown:()=>"Your bank's server is unexpectedly down. Please chat with support to resolve the issue.",bankConnectionMaintenance:()=>"Your bank connection is down for maintenance, so it may take a little longer than normal to receive new transactions.",partnerCredsChange:({isMobile:e})=>`Your bank account needs to the be relinked. To fix it, ${e?"tap":"click"} "Unlink." This will unlink your old account, so you can relink it. If you need any assistance, ${e?"tap":"click"} "Chat" to reach out to support.`,credentialsExpiring:({apiInstitutionName:e})=>`Your authorization for ${e} will expire soon. Please relink your bank with your latest credentials.`,relinkForStatements:()=>"Please relink your account using your latest credentials to enable automatic retrieval of bank statements.",generic:()=>"There was an error with your bank connection. Please chat with our team so they can resolve it."}},bc={ITEM_ERROR:{INVALID_CREDENTIALS:{shortMessage:vc.short.credentialsChanged,longMessage:vc.long.relinkCredentials,buttonType:mc.RELINK},INSUFFICIENT_CREDENTIALS:{shortMessage:vc.short.credentialsChanged,longMessage:vc.long.relinkCredentials,buttonType:mc.RELINK},INVALID_MFA:{shortMessage:vc.short.credentialsChanged,longMessage:vc.long.relinkCredentials,buttonType:mc.RELINK},INVALID_UPDATED_USERNAME:{shortMessage:vc.short.credentialsChanged,longMessage:vc.long.invalidUpdatedUsername,buttonType:mc.UNLINK_RELINK},ITEM_LOCKED:{shortMessage:vc.short.accountLocked,longMessage:vc.long.accountLocked,buttonType:mc.OPEN_BANK},ITEM_LOGIN_REQUIRED:{shortMessage:vc.short.credentialsChanged,longMessage:vc.long.relinkCredentials,buttonType:mc.DELETE_OR_RELINK},ITEM_NOT_SUPPORTED:{shortMessage:vc.short.supportChanged,longMessage:vc.long.supportChanged,buttonType:mc.CHAT},USER_SETUP_REQUIRED:{shortMessage:vc.short.updateNeeded,longMessage:vc.long.updateNeeded,buttonType:mc.OPEN_BANK},MFA_NOT_SUPPORTED:{shortMessage:vc.short.supportChanged,longMessage:vc.long.mfaUpdateNeeded,buttonType:mc.OPEN_BANK},NO_ACCOUNTS:{shortMessage:vc.short.noAccountsAvailable,longMessage:vc.long.noAccountsUnlink,buttonType:mc.UNLINK_ONLY},NO_AUTH_ACCOUNTS:{shortMessage:vc.short.noAccountsAvailable,longMessage:vc.long.noAccountsUnlink,buttonType:mc.UNLINK_ONLY},INVALID_SEND_METHOD:{shortMessage:vc.short.connectionError,longMessage:vc.long.connectionError,buttonType:mc.CHAT},NO_INVESTMENT_ACCOUNTS:{shortMessage:vc.short.serverError,longMessage:vc.long.connectionError,buttonType:mc.CHAT},NO_INVESTMENT_AUTH_ACCOUNTS:{shortMessage:vc.short.serverError,longMessage:vc.long.connectionError,buttonType:mc.CHAT},NO_LIABILITY_ACCOUNTS:{shortMessage:vc.short.serverError,longMessage:vc.long.connectionError,buttonType:mc.CHAT},PRODUCTS_NOT_SUPPORTED:{shortMessage:vc.short.serverError,longMessage:vc.long.connectionError,buttonType:mc.CHAT},ITEM_NOT_FOUND:{shortMessage:vc.short.serverError,longMessage:vc.long.connectionError,buttonType:mc.CHAT},PRODUCT_NOT_READY:{shortMessage:vc.short.serverError,longMessage:vc.long.productNotReady,buttonType:mc.CHAT},USER_PERMISSION_REVOKED:{shortMessage:vc.short.connectionError,longMessage:vc.long.permissionRevoked,buttonType:mc.UNLINK_RELINK}},INSTITUTION_ERROR:{INSTITUTION_DOWN:{shortMessage:vc.short.temporarilyDown,longMessage:vc.long.bankMaintenance,buttonType:mc.CHAT},INSTITUTION_NOT_RESPONDING:{shortMessage:vc.short.serverDown,longMessage:vc.long.serverDown,buttonType:mc.CHAT},INSTITUTION_NOT_AVAILABLE:{shortMessage:vc.short.temporarilyDown,longMessage:vc.long.bankMaintenance,buttonType:mc.CHAT},INSTITUTION_NO_LONGER_SUPPORTED:{shortMessage:vc.short.supportChanged,longMessage:vc.long.supportChanged,buttonType:mc.CHAT}},API_ERROR:{INTERNAL_SERVER_ERROR:{shortMessage:vc.short.connectionError,longMessage:vc.long.connectionError,buttonType:mc.CHAT},PLANNED_MAINTENANCE:{shortMessage:vc.short.temporarilyDown,longMessage:vc.long.bankConnectionMaintenance,buttonType:mc.CHAT}},INVALID_REQUEST:{DEFAULT:{shortMessage:vc.short.requestError,longMessage:vc.long.connectionError,buttonType:mc.CHAT}},INVALID_INPUT:{DEFAULT:{shortMessage:vc.short.inputError,longMessage:vc.long.connectionError,buttonType:mc.CHAT}},INVALID_RESULT:{DEFAULT:{shortMessage:vc.short.serverError,longMessage:vc.long.connectionError,buttonType:mc.CHAT}},RATE_LIMIT_EXCEEDED:{DEFAULT:{shortMessage:vc.short.volumeDown,longMessage:vc.long.bankMaintenance,buttonType:mc.CHAT}},OAUTH_ERROR:{DEFAULT:{shortMessage:vc.short.serverError,longMessage:vc.long.connectionError,buttonType:mc.RELINK}},CHANGE_TO_PARTNER_CREDS:{DEFAULT:{shortMessage:vc.short.updateNeeded,longMessage:vc.long.partnerCredsChange,buttonType:mc.UNLINK_RELINK}},PENDING_DISCONNECT:{DEFAULT:{shortMessage:vc.short.credentialsExpiring,longMessage:vc.long.credentialsExpiring,buttonType:mc.RELINK}},ADDITIONAL_CONSENT_REQUIRED:{DEFAULT:{shortMessage:vc.short.relinkNeeded,longMessage:vc.long.relinkForStatements,buttonType:mc.RELINK}},DEFAULT:{DEFAULT:{shortMessage:vc.short.connectionError,longMessage:vc.long.connectionError,buttonType:mc.CHAT}},UNKNOWN:{UNKNOWN:{shortMessage:vc.short.generic,longMessage:vc.long.generic,buttonType:mc.CHAT}}};function fc({apiErrorType:e,apiErrorCode:t}){if(!e||!t)return on({error:new Error("No bank error provided. Should not get here"),severity:"error"}),bc.DEFAULT.DEFAULT;const r=bc[e];if(!r)return on({error:new Error(`Unknown bank error type: ${e}`),severity:"error"}),bc.DEFAULT.DEFAULT;return(r[t]??r.DEFAULT)||(on({error:new Error(`Unknown bank error code: ${t} for type: ${e}`),severity:"error"}),bc.DEFAULT.DEFAULT)}function yc(e,t,r,n,o){return()=>ic({title:e?.shortMessage(t)||"Bank Error",body:e?.longMessage({apiInstitutionName:t,apiPartnerName:r,isMobile:n}),buttons:o})}function Tc(e,t,r,n,o,a){return{alert:yc(e,t,o,a,[{key:Zs,label:"Cancel"},{key:ec,label:"Chat",type:oc}]),actions:{success:()=>si("Conversation",{routeProps:{conversationId:null,defaultValues:{message:`I need help with my ${t} bank connection: ${r} - ${n}`}}})}}}function xc(e){const{mutate:t}=qs(),r=mr(),n=Tr(),{apiPartnerName:o}=p(Hl),a=gc(),{linkPlaid:i}=hc(e?.id);if(dr(e))return Tc(fc({apiErrorType:"UNKNOWN",apiErrorCode:"UNKNOWN"}),"UNKNOWN","UNKNOWN","UNKNOWN","",!1);const l=fc({apiErrorType:e.apiErrorType,apiErrorCode:e.apiErrorCode}),s="ITEM_LOCKED"===e.apiErrorCode;switch(l.buttonType){case mc.DELETE_OR_RELINK:case mc.RELINK:return c=l,d=e.apiInstitutionName,u=i,{alert:yc(c,d,o,a,[{key:Zs,label:"Cancel"},{key:ec,label:"Relink",type:oc}]),actions:{success:()=>{u()}}};case mc.UNLINK_RELINK:return function(e,t,r,n,o,a,i,l,s){return{alert:yc(e,t,l,s,[{key:Zs,label:"Cancel"},{key:mc.CHAT,label:"Chat"},{key:ec,label:"Unlink and Relink",type:oc}]),actions:{success:()=>{a({id:String(r)}),i()},[mc.CHAT]:()=>si("Conversation",{routeProps:{conversationId:null,defaultValues:{message:`I need help with my ${t} bank connection: ${n} - ${o}`}}})}}}(l,e.apiInstitutionName,e.id,e.apiErrorType,e.apiErrorCode,t,i,o,a);case mc.OPEN_BANK:return function(e,t,r,n,o,a,i,l,s,c,d){return{alert:yc(e,t,c,d,[{key:Zs,label:"Cancel"},{key:mc.CHAT,label:"Chat"},{key:mc.RELINK,label:"Relink"},{key:ec,label:"Go To Bank",type:oc}]),actions:{success:async()=>{const e=await cc({institutionId:r,accessToken:i,environment:l}),t=a?e.map.accountLockedUrl:e.map.accountSetupUrl;t&&window.open(t,"_blank")},[mc.RELINK]:()=>{s()},[mc.CHAT]:()=>si("Conversation",{routeProps:{conversationId:null,defaultValues:{message:`I need help with my ${t} bank connection: ${n} - ${o}`}}})}}}(l,e.apiInstitutionName,e.apiInstitutionId,e.apiErrorType,e.apiErrorCode,s,r,n,i,o,a);case mc.UNLINK_ONLY:return function(e,t,r,n,o,a){return{alert:yc(e,t,o,a,[{key:Zs,label:"Cancel"},{key:ec,label:"Unlink",type:oc}]),actions:{success:()=>{n({id:String(r)})}}}}(l,e.apiInstitutionName,e.id,t,o,a);default:return Tc(l,e.apiInstitutionName,e.apiErrorType,e.apiErrorCode,o,a)}var c,d,u}const kc=async(e,t)=>{const r=await e();"string"==typeof r&&t[r]&&await t[r]()},wc={id:"mock_task_link_bank",priority:"HIGH",name:"Link your bank account",description:"Effortlessly track every dollar by linking your bank account",type:"LINK_BANK",dismissable:"DISMISSABLE",status:"ACTIVE"};function Cc(e,t=!0){const r=fc({apiErrorType:e.apiErrorType,apiErrorCode:e.apiErrorCode});return{id:`${e.apiInstitutionName}_${e.id}_${e.apiErrorCode}_bank_error_task`,priority:"URGENT",name:r?.shortMessage(e.apiInstitutionName)||"",description:t&&"RELINK"===r?.buttonType&&r?.longMessage({apiInstitutionName:e.apiInstitutionName,isMobile:!1,apiPartnerName:""})||"",type:r?.buttonType||"CHAT",dismissable:"DISMISSABLE",status:"ACTIVE",meta:{plaidItem:e}}}const Ec=async e=>{const t=e.queryKey,r={path:"/banks/accounts",accessToken:t[1].accessToken,environment:t[1].environment},n=await Ra(r),o=void 0!==n.data?n.data.map(e=>({...e,id:xi({id:e.id,prefix:"BANK_ACCOUNT"})})):[];return{...n,data:o}};function Ic(e){return xr({...e,queryKey:["banks/accounts"],queryFn:Ec})}const Sc=e=>{const{query:{data:t}}=Ic({select:t=>{return r=t?.data,n=e,r?.find(e=>e.id===n);var r,n}});return t},Ac=e=>void 0!==e?.find(e=>"PLAID"===e.apiName),Nc=e=>{if(dr(e))return!1;const t=e.filter(e=>"PLAID"===e.apiName&&"ACTIVE"===e.status&&!0===e.isSupported);return void 0!==t&&t.length>0&&!t.some(e=>!e.syncTransactions||ur(e.lastApiSyncedDate))};function Pc(e){return e?.filter(e=>"USER_IMPORTED"===e.apiName&&"ACTIVE"===e.status)}const Mc=Rt(null,xt({display:"flex",alignItems:"center",gap:"15px",borderRadius:"md",border:"1px solid {colors.border.layout}",background:"surface.foreground",width:"fit-content"})),Dc=Rt(St["month-picker-left-button"],xt({border:"none",borderRight:"1px solid {colors.border.layout}",borderRightRadius:0,_disabled:{cursor:"default"}})),Rc=Rt(St["month-picker-right-button"],xt({border:"none",borderLeft:"1px solid {colors.border.layout}",borderLeftRadius:0,_disabled:{cursor:"default"}})),Oc=Rt(null,xt({cursor:"default",display:"flex",justifyContent:"center",width:"75px"}));function _c({period:e,setPeriod:t,disableNext:r=!1,disablePrev:n=!1}){const o=zt(e.year,e.month,1),a=ir(o,{abbreviateMonth:!0});return E("div",{...Mc,children:[w(Ki,{stylists:[Dc],onClick:()=>{return t(0===(r=e).month?{month:11,year:r.year-1}:{month:r.month-1,year:r.year});var r},disabled:n,children:w(ga,{Component:la})}),w("div",{...Oc,children:w(eo,{children:a})}),w(Ki,{stylists:[Rc],onClick:()=>{return t(11===(r=e).month?{month:0,year:r.year+1}:{month:r.month+1,year:r.year});var r},disabled:r,children:w(ga,{Component:sa})})]})}const Lc=xt({display:"flex",flexWrap:"wrap",justifyContent:"space-evenly",gap:"10px",maxWidth:"1440px"});function Fc({children:e}){return w("div",{className:Lc,children:e})}const Bc=Rt(St["progress-bar"],xt({height:"32px",backgroundColor:"surface.intent.secondary",display:"flex",flexDirection:"row",alignItems:"center",border:"{borderWidths.lg} solid {colors.border.layout.weak}",borderRadius:"sm"})),Wc=Rt(St["progress-bar-fill"],xt({borderRadius:"sm",height:"100%",display:"flex",alignItems:"center"})),Hc=Rt(St["tile-bar-label"],xt({paddingLeft:"10px"}));function Uc({label:e="",percentage:t,color:r,width:n}){const o=void 0===n?"100%":`${n}px`,a=t>=50,i=Bt([Wc,Rt(null,r)]);return E("div",{...Bc,style:{width:o},children:[w("div",{...i,style:{width:`${t}%`},children:a&&w("div",{...Hc,children:w(Ji,{children:e})})}),!a&&w("div",{...Hc,children:w(Ji,{children:e})})]})}const Vc=Rt(St["metric-md"],Wt({metric:"md"}));function zc(e){return w("div",{...Vc,children:e.children})}const jc=Rt(null,xt({display:"flex",alignItems:"center",justifyContent:"space-between",gap:"45px",width:"100%"})),Kc=Rt(null,xt({overflow:"visible",width:"80px",display:"flex",justifyContent:"end"})),$c=({label:e,amount:t,total:r,colorCss:n})=>{const o=r>0?function(e,t,r,n=0,o=100){return n+(e-t)*(o-n)/(r-t)}(t,0,r):0;return E("div",{...jc,children:[w(Uc,{label:e,percentage:o,color:n}),w("div",{...Kc,children:w(zc,{children:Gn(t)})})]})},qc={netIncome:0,income:0,expenses:0,absoluteSum:0},Yc=e=>{if(void 0===e.result||"FAILURE_NO_DATA"===e.result)return qc;const t=e.json?.data?.[0];if(dr(t))return qc;const r=t.income?.total??0,n=t.expenses?.total??0,o=D(r).plus(n).toNumber();return{netIncome:t.netIncome??0,income:r,expenses:n,absoluteSum:o}},Gc=ia(e=>c.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("path",{d:"M13.3131 0.489685V4.15097H9.65182",strokeMiterlimit:10}),c.createElement("path",{d:"M2.32925 15.1348V11.4735H5.99054",strokeMiterlimit:10}),c.createElement("path",{d:"M1.34228 9.57602C1.18256 9.00181 1.10327 8.40823 1.10669 7.81223C1.1074 6.38654 1.56211 4.99811 2.4049 3.8482C3.2477 2.69828 4.4348 1.84664 5.79412 1.41671C7.15345 0.986775 8.61437 1.00089 9.96513 1.45702C11.3159 1.91314 12.4863 2.78757 13.3067 3.95356",strokeMiterlimit:10}),c.createElement("path",{d:"M14.2937 6.04849C14.4534 6.6227 14.5327 7.21628 14.5293 7.81228C14.5286 9.23797 14.0739 10.6264 13.2311 11.7763C12.3883 12.9262 11.2012 13.7779 9.84185 14.2078C8.48253 14.6377 7.02161 14.6236 5.67085 14.1675C4.32008 13.7114 3.14967 12.8369 2.32925 11.671",strokeMiterlimit:10})),"Sync");function Qc({Component:e,stylists:t}){return w(e,{stylists:[Rt(St["medium-icon"]),...t??[]],size:15})}const Xc=Rt(null,Ri,xt({position:"absolute",left:1,right:1,bottom:1,width:"calc(100% - 2)",height:"44px",background:"surface.intent.primary",border:"none",borderRadius:0,gap:9,color:"icon.intent.primary",pointerEvents:"all",_supportHover:{_notDisabled:{backgroundColor:"surface.intent.primary.hover",borderColor:"border.intent.primary.hover","& .Tight-text":{color:"typography.intent.primary.hover"}}}}),ca);function Zc(){const{linkPlaid:e}=hc();return E("button",{onClick:()=>e(),...Xc,children:[w(Qc,{Component:Gc}),w(Ji,{intent:"primary",children:"Link Account"})]})}const Jc=xt({width:266,minHeight:32});function ed(){return w(No,{styles:Jc})}const td=xt({backgroundColor:"money.positive.weak"}),rd=xt({backgroundColor:"money.negative.weak"}),nd=Object.freeze({income:0,expenses:0,netIncome:0,absoluteSum:0}),od=({defaultRange:e=Kt.THIS_YEAR,isSample:t=!1,showLinkAccountButton:r})=>{const{query:{data:n},isFilling:o}=function({filter:e}){return Cn({filter:e,select:Yc})}({filter:e});let a;return a=t?Ho:n??nd,E(Rn,{isSample:t,children:[w(Nn,{title:"Profit + Loss"}),w(Mn,{children:o?E(Mo,{children:[w(ed,{}),w(ed,{})]}):E(C,{children:[w(Vn,{title:Gn(a.netIncome),label:"Profit"}),E(jn,{children:[w($c,{amount:a.income,total:a.absoluteSum,colorCss:td,label:"Income"}),w($c,{amount:a.expenses,total:a.absoluteSum,colorCss:rd,label:"Expenses"})]})]})}),t&&w(Fo,{size:"sm"}),r&&w(Zc,{})]})},ad=({filter:e})=>["reports/cashFlowStatementDirect","reports",{filter:e}],id={moneyIn:0,moneyOut:0,netMoneyIn:0};const ld=async e=>{const t=e.queryKey,r=t[2],n=t[3].accessToken,o=t[3].environment,a={path:"/reports/cashFlowStatementDirect",bodyParams:{exportType:"JSON",...Yt(r.filter)},accessToken:n,endpointManager:xn(o)};return function(e){const t=void 0===e.result||"FAILURE_NO_DATA"===e.result,r=e.json?.data[0];return t||dr(r)||dr(r.operatingActivities)||!r.operatingActivities.children?id:function(e){let t=new D(0),r=new D(0);for(const n of e.children)n.total<0?r=r.plus(D(n.total).abs()):t=t.plus(n.total);return{moneyIn:t.toNumber(),moneyOut:r.toNumber(),netMoneyIn:e.total}}(r.operatingActivities)}(await vn(a))},sd=xt({backgroundColor:"money.positive.weak"}),cd=xt({backgroundColor:"money.negative.weak"}),dd=Object.freeze({moneyIn:0,moneyOut:0,netMoneyIn:0}),ud=({defaultRange:e=Kt.THIS_YEAR,isSample:t=!1,showLinkAccountButton:r})=>{const{query:{data:n,isFetched:o},isFilling:a}=function({filter:e}){return xr({queryKey:ad({filter:e}),queryFn:ld})}({filter:e});let i;i=t?Vo:n??dd;let l=0;return(t||o)&&(l=Math.abs(i.moneyIn)+Math.abs(i.moneyOut)),E(Rn,{isSample:t,children:[w(Nn,{title:"Cash Flow"}),w(Mn,{children:a?E(Mo,{children:[w(ed,{}),w(ed,{})]}):E(C,{children:[w(Vn,{title:Gn(i.netMoneyIn),label:"Change in Cash"}),E(jn,{children:[w($c,{amount:i.moneyIn,total:l,colorCss:sd,label:"Money In"}),w($c,{amount:i.moneyOut,total:l,colorCss:cd,label:"Money Out"})]})]})}),t&&w(Fo,{size:"sm"}),r&&w(Zc,{})]})},hd=Rt(null,xt({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:"10px",width:"100%"})),pd=Rt(null,xt({display:"flex",justifyContent:"end"}));function gd({color:e,bulletLabel:t,moneySummary:r}){return E("div",{...hd,children:[w(uo,{color:e,label:t}),w("div",{...pd,children:w(Ji,{children:r})})]})}const md={total:0,children:[]},vd=e=>{const t=void 0===e.result||"FAILURE_NO_DATA"===e.result,r=e.json?.data?.[0];return t||dr(r)||dr(r.expenses)||!r.expenses.children?md:{total:r.expenses.total??0,children:(n=r.expenses.children,n.sort((e,t)=>(t.total??0)-(e.total??0)).slice(0,3).map(e=>({name:e.name??"",total:e.total??0})))};var n},bd=Rt(null,xt({display:"flex",gap:"10px",alignItems:"center"})),fd=xt({width:"200px",height:"16px",backgroundColor:"brand.secondary"}),yd=Rt(null,fd);function Td({bulletAmount:e=3,shimmer:t=!1}){return w(C,{children:Array.from({length:e},(e,r)=>E("div",{...bd,children:[w(uo,{color:io.var("colors.brand.secondary")}),t?w(No,{styles:fd}):w("div",{...yd})]},r))})}const xd=Rt(null,xt({display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",width:"100%"})),kd=[io.var("colors.brand.primary"),io.var("colors.brand.success"),io.var("colors.brand.action")],wd=Object.freeze({total:0,children:[]});function Cd({defaultRange:e=Kt.THIS_YEAR,monthIndex:t,isSample:r=!1,showLinkAccountButton:n}){const o=Le(e=>e.externalOptions).dataVisualizationColors??kd,{query:{data:a},isFilling:i}=function({filter:e}){return Cn({filter:e,select:vd})}({filter:e});let l;l=r?Uo:a??wd;const s=void 0===t?"Total Expenses":`${Qt[t]} Total`,c=l.children.length>0;return E(Rn,{isSample:r,children:[w(Nn,{title:"Expenses"}),w(Mn,{children:i?w(Mo,{children:w(Td,{shimmer:!0})}):E(C,{children:[w("div",{...xd,children:w(Vn,{title:Gn(l.total),label:s})}),w(jn,{children:c?l.children.map((e,t)=>w(gd,{color:o[t],bulletLabel:e.name,moneySummary:Gn(e.total)},t)):w(Td,{})})]})}),r&&w(Fo,{size:"sm"}),n&&w(Zc,{})]})}const Ed=Rt(null,xt({display:"flex",flexDirection:"column",gap:"10px",maxWidth:"1440px"}));function Id({period:e,handleDateChange:t,todayPeriod:r,showSamples:n,showLinkAccountButton:o}){const a=(i=e.month,{beginDate:zt(l=e.year,i,1),endDate:zt(l,i+1,0)});var i,l,s,c,d,u,h,p;return E("div",{...Ed,children:[E(_t,{children:[w(Ut,{children:"Monthly Review"}),w(_c,{period:e,setPeriod:t,disableNext:n||(s=e,c=r,h=s.month,p=c.month,h===p&&(d=s.year,u=c.year,d===u)),disablePrev:n})]}),E(Fc,{children:[w(od,{defaultRange:a,isSample:n,showLinkAccountButton:o}),w(ud,{defaultRange:a,isSample:n,showLinkAccountButton:o}),w(Cd,{defaultRange:a,monthIndex:e.month,isSample:n,showLinkAccountButton:o})]})]})}const Sd="Oldest to Newest",Ad="Newest to Oldest",Nd="A-Z",Pd="Z-A",Md="Lowest to Highest",Dd="Highest to Lowest",Rd="A-Z",Od="Z-A";const _d=ia(e=>c.createElement("svg",{width:10,height:10,viewBox:"0 0 10 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("g",{id:"icon/check"},c.createElement("path",{id:"Vector",d:"M0.986511 5L3.66217 7.67566L9.01349 2.32434",stroke:"white",strokeWidth:1.25,strokeMiterlimit:10}))),"Check"),Ld=xt({width:"15px",height:"15px",borderRadius:"sm",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",padding:0,margin:0,position:"relative","&::before":{content:"''",position:"absolute",top:"-10px",left:"-10px",right:"-10px",bottom:"-10px"},_supportHover:{"&[data-is-checked='false']":{backgroundColor:"surface.background.hover"}}}),Fd=xt({border:"{borderWidths.lg} solid",borderColor:"border.layout.strong",background:"surface.foreground"}),Bd=xt({background:"brand.primary.strong",border:"none"});function Wd({checked:e,onClick:t}){const[r,n]=m(e??!1),o=void 0===e?r:e;return w("button",{...Rt(St["checkbox-input"],Ld,o?Bd:Fd,da),type:"button",onClick:o=>{void 0===e&&n(!r),t&&t(o)},"data-is-checked":o,children:o&&w(bl,{Component:_d})})}const Hd=Rt(null,xt({paddingLeft:"20px",paddingRight:"5px"}));function Ud({checked:e,onClick:t}){return w("div",{...Hd,children:w(Wd,{checked:e,onClick:t})})}const Vd=Rt(St.text,xt({fontSize:"sm",fontWeight:"sm",color:"typography.base",fontStyle:"normal",letterSpacing:"0.66px",maxWidth:"100%"}),On);function zd({children:e}){return w("div",{...Vd,children:e})}const jd=Rt(St["date-cell"],xt({display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"center"}));function Kd({date:e,annotation:t}){return E("div",{...jd,children:[t&&w(zd,{children:t}),w(Ji,{children:e})]})}const $d=xt({color:"money.negative"}),qd=xt({color:"money.positive"});function Yd({transaction:e}){const t=(e=>{let t;switch(e.type){case"EXPENSE":t=(e=>{const t=e.amount>0;let r;return r=t?"Expense Refund":e.children?.length>0?"Split Expense":"Expense",{type:"EXPENSE",displayName:r,css:t?qd:$d}})(e);break;case"REVENUE":t=(e=>{const t=e.amount<0;return{type:"REVENUE",displayName:t?"Income Refund":"Income",css:t?$d:qd}})(e);break;case"BANK_TRANSFER":t=(e=>{let t="Bank Transfer";return e.children?.length>0&&(t="Payout"),{type:"BANK_TRANSFER",displayName:t,css:e.amount<0?$d:qd}})(e);break;case"TAX_PAYMENT":t={type:"TAX_PAYMENT",displayName:"Tax Payment",css:$d};break;case"INVOICE_PAYMENT":t=(e=>{let t="Invoice Payment",r=qd;return e.amount<0&&(t="Invoice Payment Refund",r=$d),{type:"INVOICE_PAYMENT",displayName:t,css:r}})(e)}return t})(e),r=Rt(St["transaction-type-label"],t.css),n=w("span",{...r,children:t.displayName});return w(Kd,{date:e.date,annotation:n})}function Gd({label:e,subLabel:t}){return E(C,{children:[w(eo,{children:e}),w(ro,{children:t})]})}function Qd({bankTransaction:e}){return w(Gd,{label:e.description,subLabel:e.bankAccount?.name})}function Xd(e){return new D(e).div(100).toNumber()}function Zd(e){return new D(e).times(100).toNumber()}function Jd(e){return Qn(Xd(e.amount))}function eu({transaction:e}){return w(Ji,{children:Jd(e)})}const tu=Rt(null,xt({padding:"0 25px",height:"100%",display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"center",gap:"4px"}));function ru({annotation:e,accountName:t}){return E("div",{...tu,children:[e&&w(ro,{children:e}),t&&w(eo,{children:t})]})}function nu(e,t){return`${e?`#${e}`:""} ${t??""}`.trim()}const ou=Rt(St["cell-button"],xt({border:"none",backgroundColor:"transparent",padding:"0 25px",gap:"10px",margin:0,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"flex-start",flexDirection:"row",flex:1,outline:"none",borderRadius:"md",boxShadow:"0 0 0 0 transparent","&:focus-visible":{transition:"none",position:"relative"},"&:focus-visible::before":{content:"''",position:"absolute",top:0,left:0,right:0,bottom:0,borderRadius:"md",outline:"4px solid",outlineColor:"border.layout",pointerEvents:"none"},_supportHover:{backgroundColor:"surface.intent.action.hover"},"&[data-state='open']":{backgroundColor:"surface.intent.action.active"},"& .Tight-text":{position:"relative"},"& .Tight-text::after":{content:"''",position:"absolute",bottom:0,left:0,width:0,height:"1px",backgroundColor:"currentColor",transition:"width 100ms ease-out",_supportHover:{width:"100%",transition:"width 300ms ease-out"}},"&[data-state='open'] > .Tight-text::after":{width:"100%",transition:"width 300ms ease-out"}}),da),au=y(function({children:e,...t},r){return w("button",{ref:r,...ou,...t,children:e})}),iu=h(Object.freeze({map:/* @__PURE__ */new Map,register:()=>{},unregister:()=>{},focusedIndex:null,isMousing:!0,isScrolling:!1,listRef:void 0,popupNodeId:void 0}));function lu(e,t){switch(t.type){case"increment":return((e,t)=>{let r;if(null===e.focusedIndex)r=0;else{const n=e.focusedIndex+1;r=!t.repeat&&n>e.maxIndex?0:Math.min(n,e.maxIndex)}return{...e,focusedIndex:r}})(e,t);case"decrement":return((e,t)=>{let r;if(null===e.focusedIndex)r=e.maxIndex;else{const n=e.focusedIndex-1;r=!t.repeat&&n<0?e.maxIndex:Math.max(n,0)}return{...e,focusedIndex:r}})(e,t);case"set":return{...e,focusedIndex:Math.min(t.focusedIndex,e.maxIndex)};case"max":return{...e,maxIndex:t.max}}}function su(e,t){const r=e.compareDocumentPosition(t);return r&Node.DOCUMENT_POSITION_FOLLOWING||r&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:r&Node.DOCUMENT_POSITION_PRECEDING||r&Node.DOCUMENT_POSITION_CONTAINS?1:0}function cu(e,t){const r=t.getBoundingClientRect(),n=e.getBoundingClientRect();return n.top>=r.top&&n.bottom<=r.bottom&&n.left>=r.left&&n.right<=r.right}function du(e,t,r){if(null===e)return{node:void 0,metadata:void 0};const n=t[e];return{node:n,metadata:r.get(n)}}function uu(e){const[t,r]=m(()=>/* @__PURE__ */new Map),{listRef:n,focusedState:o,isMousing:a,isScrolling:i}=function(e,t){const r=d(null),[n,o]=m(!0),[a,i]=m(!1),l=p(iu),[s,c]=T(lu,{focusedIndex:null,maxIndex:e});b(()=>{const e=r.current,t=()=>{null==s.focusedIndex&&void 0!==l?.popupNodeId&&c({type:"set",focusedIndex:0})};return e?.addEventListener("focus",t),()=>{e?.removeEventListener("focus",t)}},[r,s.focusedIndex,c,l?.popupNodeId]);const u=d(null);return b(()=>{c({type:"max",max:e})},[e]),b(()=>{const e=r.current;if(null!==e){const r=e=>{i(!1);const r=e.target instanceof HTMLElement&&e.target.getAttribute("data-listitem");if(!r)return;const n=Number(e.target.getAttribute("data-index"));s.focusedIndex===n&&u.current===e.target||(0!==e.movementX||0!==e.movementY)&&r&&(o(!0),u.current=e.target,c({type:"set",focusedIndex:n}),t.setCascadeState(!0,n))},n=e=>{const t="ArrowDown"===e.key||"Tab"===e.key&&!e.shiftKey,r="ArrowUp"===e.key||"Tab"===e.key&&e.shiftKey;o(!1),i(!1),t?(e.preventDefault(),c({type:"increment",repeat:e.repeat})):r&&(e.preventDefault(),c({type:"decrement",repeat:e.repeat}))},a=()=>i(!0);return e.addEventListener("mousemove",r),e.addEventListener("keydown",n),e.addEventListener("scroll",a),()=>{e.removeEventListener("mousemove",r),e.removeEventListener("keydown",n),e.removeEventListener("scroll",a)}}},[t,s.focusedIndex]),{listRef:r,focusedState:s,isMousing:n,isScrolling:a}}(t.size-1,e),l=gl(),s=v((e,t)=>{r(r=>new Map(r).set(e,t??null))},[]),c=v(e=>{r(t=>{const r=new Map(t);return r.delete(e),r})},[]),{sortedNodes:h,sortedMap:g}=function(e,t){const r=u(()=>{let r=[];return null!==t.current&&(r=Array.from(e.keys()).sort(su)),r},[e,t]),n=u(()=>{const t=/* @__PURE__ */new Map;return r.forEach((r,n)=>{const o=e.get(r)??{};t.set(r,{...o,index:n})}),t},[r,e]);return{sortedNodes:r,sortedMap:n}}(t,n);!function(e,t,r,n,o,a){b(()=>{const i=e.current;if(!i)return;const l=e=>{const{node:l,metadata:s}=du(n,t,r),{shouldOpenCascade:c,shouldCloseCascade:d}=function(e,t,r){const n=e.placement.includes("left"),o=e?.popupParentNodeId,a=o&&r?.hasCascading&&n?"ArrowLeft":"ArrowRight",i=n?"ArrowRight":"ArrowLeft";return{shouldOpenCascade:r?.hasCascading&&t.key===a,shouldCloseCascade:o&&t.key===i}}(o,e,s),u=!(e.target instanceof HTMLInputElement&&""!==e.target.value)&&" "===e.key;var h,p,g,m,v;c||"Enter"===e.key||u?(p=n,g=l,m=i,v=a,!(!(h=s)||!h.hasCascading||null===p||g&&m&&cu(g,m)&&(v.setCascadeState(!0,p),v.setFocus(!0),0))||function(e){const t=new MouseEvent("click",{view:window,bubbles:!0,cancelable:!0});e?.dispatchEvent(t)}(l),e.preventDefault()):d&&(e.preventDefault(),o.setOpen(!1))};return i.addEventListener("keydown",l),()=>{i.removeEventListener("keydown",l)}},[e,t,n,r,o,a])}(n,h,g,o.focusedIndex,l,e);const{startCallback:f,cancelCallback:y}=Oa({delay:200,callback:({focusedIndex:t,node:r,listElement:n})=>{r&&n&&cu(r,n)?e.setCascadeState(!0,t):e.closeCurrentCascade()}});return x=o.focusedIndex,b(()=>{const e=E.current;if(null===x||k)return;const{node:t,metadata:r}=du(x,w,C);return I.lastOpenedIndex!==x&&r?.hasCascading&&(I.closeCurrentCascade(),S({focusedIndex:x,node:t,listElement:e})),()=>A()},[x,k=a,E=n,I=e,A=y,w=h,C=g,S=f]),function(e,t,r,n){b(()=>{const{metadata:o}=du(e,t,r);null===e||o?.hasCascading||n.closeCurrentCascade()},[n,e,r,t])}(o.focusedIndex,h,g,e),u(()=>({register:s,unregister:c,map:g,focusedIndex:o.focusedIndex,listRef:n,isMousing:a,isScrolling:i,popupNodeId:l?.nodeId}),[s,c,g,o.focusedIndex,n,a,i,l?.nodeId]);var x,k,w,C,E,I,S,A}const hu=h(Object.freeze({cascadeIndex:null,setCascadeState:()=>{},onScroll:()=>{},focus:!1,setFocus:()=>{},lastOpenedIndex:null,closeCurrentCascade:()=>{}}));function pu({style:e,children:t}){const r=Rt(St["popup-list"],cl,e),n=function(){const[e,t]=m(null),[r,n]=m(!1),[o,a]=m(null),i=v((r,o)=>{r&&e!==o?(a(o),t(o)):r||e!==o||(n(!1),t(null))},[e,n]),l=v(()=>{t(null),a(null),n(!1)},[t,a,n]),s=v(()=>{t(null),a(null),n(!1)},[]);return{cascadeIndex:e,setCascadeState:i,onScroll:l,focus:r,setFocus:n,lastOpenedIndex:o,closeCurrentCascade:s}}(),o=uu(n);return w("div",{...r,onScroll:n.onScroll,ref:o.listRef,tabIndex:0,children:w(iu.Provider,{value:o,children:w(hu.Provider,{value:n,children:t})})})}function gu({hasCascading:e=!1}={}){const t=d(null),{register:r,unregister:n,map:o,focusedIndex:a,isMousing:i,listRef:l}=p(iu);x(()=>{const o=t.current;if(o)return r(o,{index:0,hasCascading:e}),()=>{n(o)}},[r,n,e]);const s=u(()=>void 0!==o&&null!==t.current?o.get(t.current)?.index??-1:-1,[o]),c=s===a;x(()=>{c&&(i||t.current?.scrollIntoView({behavior:"instant",block:"nearest",inline:"nearest"}))},[c,i]);const h=v(()=>{l?.current?.focus()},[l]),g=u(()=>({onFocus:h,"data-focused":c}),[h,c]);return{itemRef:t,isActive:c,index:s,itemProps:g}}const mu=y(function({onClick:e,index:t,children:r,itemProps:n,popupTriggerProps:o},a){return w("button",{...dl,onClick:e,"data-listitem":!0,"data-index":t,...o,...n,ref:a,children:r})}),vu=y(function({onClick:e,children:t,popupTriggerProps:r},n){const{index:o,itemProps:a,itemRef:i}=gu(),l=se([i,n]);return w(mu,{...dl,onClick:e,index:o,...r,itemProps:a,ref:l,children:t})}),bu=Rt(St.text,Wt({label:"strongLabel"}),xt({maxWidth:"100%"}),On);function fu({children:e,stylists:t=[]}){const r=Bt([bu,...t]);return w("div",{...r,children:e})}function yu({text:e}){return w("div",{...dl,children:e?w(eo,{children:e}):w(No,{styles:xt({width:"100%",height:"16px"})})})}const Tu=Rt(St["popup-list"],cl),xu=()=>E("div",{...Tu,children:[w(yu,{}),w(yu,{}),w(yu,{}),w(yu,{}),w(yu,{})]}),ku=["LIABILITY","EQUITY","INCOME","OTHER_INCOME"];function wu(e,t){return u(()=>e?.filter(e=>t.includes(e.type))??[],[e,t])}const Cu=e=>({id:e.id||"",name:e.name,accountNo:e.accountNo}),Eu=()=>["accounting/glAccounts"],Iu=async e=>{const t=e.queryKey,r={path:"/accounting/glAccounts",params:{leavesOnly:"false"},accessToken:t[1].accessToken,environment:t[1].environment},n=await Ra(r);return Nu(n)};function Su(e){return xr({...e,queryKey:["accounting/glAccounts"],queryFn:Iu})}function Au(){return Su({select:Ru})}const Nu=e=>e.map(e=>({...e,id:xi({id:e.id,prefix:"GL_ACCOUNT"})}));function Pu(e,t){const r=t.get(e.accountNo)??[];return 0===r.length?[{...e,children:[]}]:r.flatMap(e=>Pu(e,t))}const Mu=e=>!e.parentAccountNo;function Du(e){const t=function(e){const t=/* @__PURE__ */new Map;for(const r of e)if(r.parentAccountNo){const e=t.get(r.parentAccountNo)??[];e.push(r),t.set(r.parentAccountNo,e)}return t}(e);return e.filter(Mu).map(e=>({...e,children:Pu(e,t)}))}function Ru(e){return Du(e).flatMap(e=>[e,...e.children])}function Ou(e,t,r){var n;n=t,r.some(({child:e})=>e.accountNo===n.accountNo)||r.push({parent:e,child:t})}const _u=[Rt(null,xt({marginLeft:"6px",marginRight:"6px"}))],Lu=Rt(null,xt({whiteSpace:"normal"})),Fu={keys:[{name:"accountNo",weight:.3},{name:"name",weight:.7}],threshold:.3,includeScore:!0,minMatchCharLength:1};function Bu({types:e,onClick:t,searchTerm:r}){const{query:{data:n},isFilling:o}=Au(),a=wu(n,e),i=u(()=>new me(a,Fu),[a]),l=u(()=>function(e,t){const r=[];return e.forEach(e=>{const n=e.item,o=(a=n,t.find(e=>e.children.some(e=>e.accountNo===a.accountNo)));var a;!o&&n.children.length>0?function(e,t){e.children.forEach(r=>{Ou(e,r,t)})}(n,r):o&&Ou(o,n,r)}),r}(i.search(r),a),[a,r,i]);return o?w(xu,{}):l.map(({parent:e,child:r})=>w(vu,{onClick:()=>t(r),children:E(fu,{stylists:[Lu],children:[nu(e.accountNo,e.name),w(ga,{Component:sa,stylists:_u}),nu(r.accountNo,r.name)]})},`${r.accountNo}`))}const Wu=y(function({index:e,popupTriggerProps:t,children:r,itemProps:n},o){const a=se([o,t?.ref]);return w(mu,{index:e,ref:a,itemProps:n,popupTriggerProps:t,children:r})});function Hu({triggerChildren:e,popupChildren:t}){const{cascadeIndex:r,setCascadeState:n,focus:o}=p(hu),{itemRef:a,index:i,itemProps:l}=gu({hasCascading:!0}),{isScrolling:s}=p(iu);return E(pl,{open:r===i,onOpenChange:e=>{s||n(e,i)},placement:"right-start",children:[w(ml,{children:t=>w(Wu,{itemProps:l,index:i,ref:a,popupTriggerProps:t,children:e})}),w(El,{initialFocus:o,children:t})]})}const Uu=Rt(null,xt({display:"flex",width:"100%",justifyContent:"space-between",alignItems:"center"}));function Vu({icon:e,displayLabel:t}){return E("div",{...Uu,children:[e,w(eo,{wrap:"wrap",children:t}),w(ga,{Component:sa})]})}function zu({types:e,onClick:t}){const{query:{data:r,isFetching:n},isFilling:o}=Su({select:Du}),a=wu(r,e);return o?w(xu,{}):o||n||void 0!==r?a.map(e=>{const r=nu(e.accountNo,e.name);return w(Hu,{triggerChildren:w(Vu,{displayLabel:r}),popupChildren:w(ju,{glAccount:e,onClick:t})},e.accountNo)}):w(yu,{text:"No data"})}function ju({glAccount:e,onClick:t}){return w(pu,{children:e.children.map(e=>w(vu,{onClick:()=>t(e),children:w(eo,{children:nu(e.accountNo,e.name)})},e.accountNo))})}const Ku=Rt(null,xt({display:"flex",alignItems:"center",padding:"10px",flex:1,border:"none",outline:"none",background:"transparent",fontSize:"sm",fontWeight:"sm","&::placeholder":{color:"typography.base.weak"}}));function $u({searchTerm:e,setSearchTerm:t,placeholder:r}){const n=d(null);return b(()=>{n.current?.focus({preventScroll:!0});const e=e=>{!n.current||document.activeElement===n.current||(1!==e.key.length||e.ctrlKey||e.altKey||e.metaKey)&&"Backspace"!==e.key||n.current.focus()};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[]),w("input",{ref:n,type:"text",placeholder:r,value:e,onChange:e=>t(e.target.value),...Ku})}function qu({onClick:e,types:t}){const r=gl(),[n,o]=m(""),a=pr(n)?xt({maxWidth:"420px",width:"fit-content"}):void 0,i=t=>{e(t),r?.setOpen(!1)};return w(El,{children:E(pu,{style:a,children:[w($u,{searchTerm:n,setSearchTerm:o,placeholder:"Search revenue accounts..."}),pr(n)?w(Bu,{types:t,onClick:i,searchTerm:n}):w(zu,{types:t,onClick:i})]})})}const Yu=async({data:e,accessToken:t,environment:r})=>Qu({data:{data:e},accessToken:t,environment:r}),Gu=async({data:e,accessToken:t,environment:r})=>Yu({data:[e],accessToken:t,environment:r}),Qu=async({data:e,accessToken:t,environment:r})=>{const n={path:"/v6/banks/transactions",bodyParams:e,accessToken:t,endpointManager:ea(r)};return await mn(n)};function Xu(){return Vs({onSuccess:async()=>{const e=["banks/transactions"];return nn("mutation successful, invalidating BT queries"),fr.invalidateQueries({queryKey:e}).catch(e=>on({error:e,severity:"error"}))},mutationFn:Yu})}function Zu(){return Vs({onSuccess:async()=>(nn("mutation successful, invalidating BT queries"),fr.invalidateQueries({predicate:e=>e.queryKey.includes("tasks")||e.queryKey.includes("banks/transactions")||e.queryKey.includes("reports")}).catch(e=>on({error:e,severity:"error"}))),mutationFn:Gu})}function Ju({transaction:e,parentTransaction:t,accountNo:r,accountName:n}){const{startPrefetch:o,cancelPrefetch:a}=_a({prefetchFn:Ia(Eu,Iu)}),{mutate:i}=Zu(),l=void 0!==t;return E(pl,{placement:"bottom-start",children:[w(ml,{children:e=>w(au,{...e,onMouseEnter:o,onMouseLeave:a,children:w(eo,{children:nu(r,n)})})}),w(qu,{onClick:l?r=>{if(r?.id&&l){const{id:n,children:o}=t,{id:a}=e,l=o.map(e=>e.id===a?{...e,glAccountId:r.id.toString()}:e);i({id:n,children:l})}}:t=>{i({id:e.id,glAccountId:t.id})},types:ku})]})}const eh=()=>["expenses/categories"],th=async e=>{const t=e.queryKey,r={path:"/expenses/categories",accessToken:t[1].accessToken,environment:t[1].environment},n=await Ra(r);return{...n,data:n.data?(o=n.data,o.map(e=>({...e,id:xi({id:e.id,prefix:"TRANSACTION_CATEGORY"}),parentCategoryId:e.parentCategoryId?xi({id:e.parentCategoryId,prefix:"TRANSACTION_CATEGORY"}):void 0}))):void 0};var o};function rh(e){return xr({...e,queryKey:["expenses/categories"],queryFn:th})}function nh(e){const t=/* @__PURE__ */new Map;for(const r of e)if(r.parentCategoryId){const e=t.get(r.parentCategoryId)??[];e.push(r),t.set(r.parentCategoryId,e)}return t}function oh(e){if(0===e.length)return[];const t=nh(e);return e.map(e=>({...e,children:e.id?t.get(e.id):void 0}))}function ah(e){if(0===e.length)return[];const t=nh(e);return e.filter(e=>!e.parentCategoryId).map(e=>({...e,children:e.id?t.get(e.id):void 0}))}const ih=e=>({id:e.id,name:e.name});function lh(e,t,r){var n;n=t,r.some(e=>e.child.id===n.id)||r.push({parent:e,child:t})}const sh=Rt(null,xt({whiteSpace:"normal"})),ch=[Rt(null,xt({marginLeft:"6px",marginRight:"6px"}))],dh={keys:[{name:"name"}],threshold:.2,includeScore:!0,minMatchCharLength:1};function uh({searchTerm:e,onClick:t}){const{query:{data:r,isFetched:n},isFilling:o}=rh({select:e=>({...e,data:e.data?oh(e.data):void 0})}),a=r?.data,i=!o&&n&&(void 0===a||0===a.length),l=u(()=>new me(a??[],dh),[a]),s=u(()=>a?function(e,t){const r=[];return e.forEach(e=>{const n=e.item,o=(l=n,t.find(e=>e.children?.some(e=>e.id===l.id))),a=!(o||0!==n?.children?.length&&n.children),i=!o&&n.children&&n.children.length>0;var l;o?lh(o,n,r):a?lh(n,n,r):i&&function(e,t){e.children&&e.children.forEach(r=>{lh(e,r,t)})}(n,r)}),r}(l.search(e),a):[],[a,e,l]);return o?w(xu,{}):i?w(yu,{text:"No data"}):0===s.length?w(yu,{text:"No results found"}):w(C,{children:s.map(({parent:e,child:r})=>{const n=e.id===r.id;return w(vu,{onClick:()=>t(ih(r)),children:w(fu,{stylists:[sh],children:n?r.name:E(C,{children:[e.name,w(ga,{Component:sa,stylists:ch}),r.name]})})},`${e.id}_${r.id}`)})})}function hh({category:e,handleCategoryChange:t}){return w(pu,{children:e.children?.map(e=>w(vu,{onClick:()=>t(ih(e)),children:w(eo,{wrap:"wrap",children:e.name})},e.id))})}function ph({onClick:e}){const{query:{data:t,isFetched:r},isFilling:n}=rh({select:e=>({...e,data:e.data?ah(e.data):void 0})}),o=t?.data,a=!n&&r&&void 0===o;return n?w(xu,{}):a?w(yu,{text:"No data"}):w(C,{children:o?.map(t=>t.hasChilds?w(Hu,{triggerChildren:w(Vu,{displayLabel:t.name}),popupChildren:w(hh,{category:t,handleCategoryChange:e})},t.id):w(vu,{onClick:()=>e(ih(t)),children:w(eo,{wrap:"wrap",children:t.name})},t?.id))})}const gh=({onClick:e})=>{const t=gl(),[r,n]=m(""),o=r=>{void 0!==e&&e(r),t.setOpen(!1)};return w(El,{children:E(pu,{children:[w($u,{searchTerm:r,setSearchTerm:n,placeholder:"Search expense categories..."}),pr(r)?w(uh,{searchTerm:r,onClick:o}):w(ph,{onClick:o})]})})},mh=ia(e=>c.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("path",{d:"M12.6809 12.4781H12.0645L6.49121 9.38327V4.42636L12.0645 1.33154H12.6809V12.4781Z",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M4.01263 4.42627H6.49108V9.38317H4.01263C3.35531 9.38317 2.7249 9.12205 2.2601 8.65725C1.7953 8.19245 1.53418 7.56205 1.53418 6.90472C1.53418 6.2474 1.7953 5.61699 2.2601 5.15219C2.7249 4.68739 3.35531 4.42627 4.01263 4.42627Z",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M4.0127 9.3833H6.49115L7.72389 14.9566H5.25192L4.0127 9.3833Z",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M12.6807 5.66553H13.9199C14.2486 5.66553 14.5638 5.79609 14.7962 6.02849C15.0286 6.26089 15.1591 6.57609 15.1591 6.90475C15.1591 7.06749 15.1271 7.22864 15.0648 7.37898C15.0025 7.52933 14.9112 7.66595 14.7962 7.78102C14.6811 7.89609 14.5445 7.98737 14.3941 8.04965C14.2438 8.11193 14.0826 8.14398 13.9199 8.14398H12.6807V5.66553Z",stroke:"#182428",strokeMiterlimit:10})),"Advertising"),vh=ia(e=>c.createElement("svg",{width:"16px",height:"16px",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("path",{d:"M7.84644 15.0764C11.6751 15.0764 14.7788 11.9727 14.7788 8.14405C14.7788 4.3154 11.6751 1.21167 7.84644 1.21167C4.0178 1.21167 0.914062 4.3154 0.914062 8.14405C0.914062 11.9727 4.0178 15.0764 7.84644 15.0764Z",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M7.79217 9.6784V8.95116C7.79192 8.79114 7.82335 8.63265 7.88467 8.48484C7.94598 8.33703 8.03596 8.20282 8.14941 8.08996L8.65337 7.586C8.88132 7.35726 9.00972 7.04774 9.01061 6.7248V6.61636C9.00892 6.29431 8.8798 5.98603 8.65149 5.75891C8.42317 5.53179 8.11422 5.40429 7.79217 5.4043C7.47012 5.40429 7.16117 5.53179 6.93285 5.75891C6.70453 5.98603 6.57542 6.29431 6.57373 6.61636",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M7.18604 10.8838H8.39809",stroke:"#182428",strokeMiterlimit:10})),"Uncategorized"),bh=ia(e=>c.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("path",{d:"M7.71472 0.800293V4.79785C7.71535 5.25195 7.58889 5.69716 7.34964 6.08313C7.11039 6.46909 6.7679 6.78039 6.36091 6.98182C6.02094 7.15207 5.64596 7.24072 5.26574 7.24072C4.88552 7.24072 4.51053 7.15207 4.17056 6.98182C3.76928 6.77569 3.43283 6.4626 3.19841 6.07716C2.964 5.69173 2.84075 5.24897 2.8423 4.79785V0.800293",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M5.29443 0.800293V15.4878",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M10.1861 15.4879V1.43896C10.668 1.43896 11.1451 1.53399 11.5903 1.71859C12.0354 1.9032 12.4398 2.17377 12.7802 2.51482C13.1207 2.85587 13.3905 3.2607 13.5744 3.70616C13.7582 4.15161 13.8524 4.62894 13.8516 5.11084V8.78271L10.1797 10.6155",stroke:"#182428",strokeMiterlimit:10})),"Meals"),fh=ia(e=>c.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("path",{d:"M14.9092 4.60259V6.39635H1.78418V4.60259L8.34669 1.62134L14.9092 4.60259Z",strokeMiterlimit:10,strokeLinecap:"square"}),c.createElement("path",{d:"M14.9092 12.3589H1.78418V14.7464H14.9092V12.3589Z",strokeMiterlimit:10,strokeLinecap:"square"}),c.createElement("path",{d:"M2.97803 6.39648V12.359",strokeMiterlimit:10,strokeLinecap:"square"}),c.createElement("path",{d:"M6.55908 6.39648V12.359",strokeMiterlimit:10,strokeLinecap:"square"}),c.createElement("path",{d:"M10.1343 6.39648V12.359",strokeMiterlimit:10,strokeLinecap:"square"}),c.createElement("path",{d:"M13.7153 6.39648V12.359",strokeMiterlimit:10,strokeLinecap:"square"})),"Bank"),yh=ia(e=>c.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("path",{d:"M13.7665 10.8572H2.9268C2.60718 10.8572 2.30065 10.7302 2.07465 10.5042C1.84865 10.2782 1.72168 9.9717 1.72168 9.65208V4.97673C1.72168 4.87842 1.74114 4.78109 1.77895 4.69035C1.81676 4.5996 1.87217 4.51725 1.94197 4.44803C2.01178 4.37881 2.0946 4.3241 2.18566 4.28706C2.27672 4.25001 2.37421 4.23137 2.47251 4.2322C2.598 4.23423 2.7211 4.2669 2.83107 4.32739C2.94104 4.38787 3.03455 4.47433 3.10346 4.57923C4.03096 5.93577 7.14155 5.34899 7.14155 4.2322L13.3312 7.08411C13.8209 7.31135 14.2355 7.67379 14.5261 8.12874C14.8167 8.5837 14.9713 9.11222 14.9717 9.65208C14.9717 9.9717 14.8447 10.2782 14.6187 10.5042C14.3927 10.7302 14.0862 10.8572 13.7665 10.8572Z",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M14.9717 9.6521V10.8572C14.97 11.4954 14.7153 12.1068 14.2635 12.5574C13.8117 13.0081 13.1996 13.2611 12.5614 13.2611H2.92681C2.76832 13.262 2.61124 13.2314 2.46465 13.1711C2.31806 13.1108 2.18487 13.0221 2.0728 12.91C1.96073 12.798 1.87199 12.6648 1.81173 12.5182C1.75146 12.3716 1.72086 12.2145 1.7217 12.056V9.6521",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M6.54199 3.0271L7.1414 4.23222",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M8.34668 7.24174L9.5518 5.43091",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M10.1514 8.44706L11.3565 6.63623",stroke:"#182428",strokeMiterlimit:10})),"Sports"),Th=ia(e=>c.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("path",{d:"M2.64551 15.0589V13.3516",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M14.6148 10.5042H2.07861V13.3517H14.6148V10.5042Z",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M5.07515 7.62671H11.6417C12.2861 7.62671 12.9041 7.88269 13.3598 8.33833C13.8154 8.79398 14.0714 9.41197 14.0714 10.0563V10.4742H2.64551V10.0563C2.64551 9.41197 2.90149 8.79398 3.35713 8.33833C3.81278 7.88269 4.43077 7.62671 5.07515 7.62671Z",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M5.49942 5.37623H6.63962C6.86383 5.37623 7.08584 5.42039 7.29298 5.50619C7.50012 5.59199 7.68833 5.71775 7.84687 5.87629C8.00541 6.03483 8.13117 6.22304 8.21697 6.43018C8.30277 6.63733 8.34693 6.85934 8.34693 7.08355V7.68051H3.78613V7.08355C3.78613 6.85884 3.83049 6.63633 3.91666 6.4288C4.00284 6.22127 4.12913 6.03279 4.2883 5.87418C4.44747 5.71556 4.63639 5.58992 4.84422 5.50448C5.05205 5.41903 5.27471 5.37545 5.49942 5.37623Z",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M10.054 5.37622H11.1942C11.647 5.37622 12.0813 5.5561 12.4014 5.87628C12.7216 6.19647 12.9015 6.63073 12.9015 7.08354V7.6805H8.34668V7.08354C8.34668 6.63073 8.52656 6.19647 8.84674 5.87628C9.16692 5.5561 9.60119 5.37622 10.054 5.37622Z",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M12.9018 3.0957H3.78613V7.6565H12.9018V3.0957Z",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M14.0479 15.0589V13.3516",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M3.78613 1.38843V3.09574",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M12.9077 1.38843V3.09574",stroke:"#182428",strokeMiterlimit:10})),"Bedding"),xh=ia(e=>c.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("path",{d:"M3.58312 11.8285C3.40778 11.6564 3.29681 11.4294 3.26874 11.1854C3.24068 10.9414 3.29723 10.6951 3.42894 10.4878L6.01648 6.34502L10.8698 1.4917C11.2763 1.0884 11.8256 0.861929 12.3982 0.861572C12.6808 0.861572 12.9606 0.917231 13.2217 1.02537C13.4827 1.13351 13.7199 1.29201 13.9198 1.49183C14.1196 1.69164 14.2781 1.92885 14.3862 2.18992C14.4944 2.451 14.55 2.73081 14.55 3.01339C14.5497 3.586 14.3232 4.1353 13.9199 4.54178L9.06657 9.3951L4.92381 11.9826C4.71647 12.1144 4.47021 12.1709 4.22618 12.1428C3.98215 12.1148 3.75515 12.0038 3.58312 11.8285Z",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M12.1101 6.34497L9.67676 8.78504L12.7201 14.2685L14.5502 13.0485L12.1101 6.34497Z",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M9.06658 3.30164L6.62651 5.735L1.14307 2.69162L2.3631 0.861572L9.06658 3.30164Z",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M4.49481 8.78516H1.75308L1.14307 10.6152L3.58313 11.8285L4.80317 14.2686L6.62651 13.6586V10.9169",stroke:"#182428",strokeMiterlimit:10})),"Airplane"),kh=ia(e=>c.createElement("svg",{width:15,height:11,viewBox:"0 0 15 11",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("path",{d:"M8.58591 0.969731H4.86823C4.67602 0.970222 4.4865 1.01495 4.31436 1.10046C4.14222 1.18597 3.99207 1.30996 3.87555 1.46283L2.38978 3.44818L0.53418 4.06455V8.3986H2.38978C2.38978 8.06994 2.52034 7.75473 2.75274 7.52233C2.98514 7.28993 3.30034 7.15937 3.629 7.15937C3.95766 7.15937 4.27287 7.28993 4.50527 7.52233C4.73767 7.75473 4.86823 8.06994 4.86823 8.3986H9.20228C9.20228 8.06994 9.33284 7.75473 9.56524 7.52233C9.79764 7.28993 10.1128 7.15937 10.4415 7.15937C10.7702 7.15937 11.0854 7.28993 11.3178 7.52233C11.5502 7.75473 11.6807 8.06994 11.6807 8.3986H14.1592V5.52437C14.1588 5.27713 14.0844 5.03565 13.9457 4.831C13.8069 4.62636 13.6101 4.46789 13.3806 4.37598L11.0644 3.44818L9.57858 1.46283C9.46275 1.30922 9.31275 1.18469 9.14045 1.09911C8.96815 1.01352 8.77829 0.969227 8.58591 0.969731Z",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M10.4414 9.63788C11.1258 9.63788 11.6806 9.08306 11.6806 8.39865C11.6806 7.71424 11.1258 7.15942 10.4414 7.15942C9.75697 7.15942 9.20215 7.71424 9.20215 8.39865C9.20215 9.08306 9.75697 9.63788 10.4414 9.63788Z",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M3.62887 9.63788C4.31328 9.63788 4.8681 9.08306 4.8681 8.39865C4.8681 7.71424 4.31328 7.15942 3.62887 7.15942C2.94447 7.15942 2.38965 7.71424 2.38965 8.39865C2.38965 9.08306 2.94447 9.63788 3.62887 9.63788Z",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M12.6021 4.06445H4.25195",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M12.9199 6.54297H14.1591",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M7.34668 2.20898V4.06458",stroke:"#182428",strokeMiterlimit:10})),"Vehicle");function wh(e){switch(e){case"Advertising":case"Advertising and Marketing":return mh;case"Bank Fees":case"Bank Charges & Fees":case"College Loans":case"Merchant Processing Fees":return fh;case"Health & Fitness":case"Sports":case"Sporting Goods":return yh;case"Linen/Key Service":case"Linens (sheets, towels, etc.)":case"Hotel":case"Hotels":return Th;case"Plane / Train / Bus":case"Airlines":case"Airfare":return xh;case"Vehicle":case"Taxi":case"Rental Car":case"Rental Cars":case"Car Payment":case"Auto Insurance":case"Other Vehicle Expenses":case"Parking and Tolls":case"Parking & Tolls":case"Transportation (Taxi, Rideshare, Train)":return kh;case"Meals & Entertainment":case"Meals":case"Business Meals":case"Food & Dining":case"Groceries":case"Restaurants":case"Other Food & Dining":case"Lead Gen - Meals":case"PAX Food & Drink":return bh;default:return vh}}function Ch({transaction:e,parentTransaction:t}){const{startPrefetch:r,cancelPrefetch:n}=_a({prefetchFn:Ia(eh,th)}),o=e.category?.name??"Uncategorized",{mutate:a}=Zu(),i=void 0!==t;return E(pl,{placement:"bottom-start",children:[w(ml,{children:e=>E(au,{...e,onMouseEnter:r,onMouseLeave:n,children:[w(Qc,{Component:wh(o)}),w(eo,{children:o})]})}),w(gh,{onClick:i?r=>{if(r?.id&&i){const{id:n,children:o}=t,{id:i}=e,l=o.map(e=>e.id===i?{...e,categoryId:r.id.toString()}:e);a({id:n,children:l})}}:t=>{t?.id&&a({id:e.id,categoryId:t.id.toString()})}})]})}const Eh=ia(e=>c.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("path",{d:"M4.31676 1.37476L1.67926 4.01226L4.31676 6.64976",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M12.2292 6.64976L14.8667 4.01226L12.2292 1.37476",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M8.27301 14.5623V7.96852C8.27301 6.91926 7.85619 5.91297 7.11425 5.17103C6.37231 4.42909 5.36602 4.01227 4.31676 4.01227H1.67926",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M8.27301 14.5623V7.96852C8.27301 6.91926 8.68983 5.91297 9.43177 5.17103C10.1737 4.42909 11.18 4.01227 12.2293 4.01227H14.8668",stroke:"#182428",strokeMiterlimit:10})),"Split"),Ih=Rt(null,xt({flexDirection:"column",textAlign:"start",width:"100%",overflow:"hidden"})),Sh=Rt(null,xt({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",width:"100%",gap:"10px"}));function Ah({transaction:e}){const t=e.children.map(e=>e?.category?.name).filter(e=>void 0!==e),r=new Set(t),n=[...r].join(", "),o=dc("Category","Categories",r.size,!0);return w(ol,{children:E("div",{...Sh,children:[w(Qc,{Component:Eh}),E("div",{...Ih,children:[w(eo,{children:o}),w(ro,{children:n})]})]})})}function Nh({transaction:e,parentTransaction:t}){return e.children?.length>0?w(Ah,{transaction:e}):w(Ch,{transaction:e,parentTransaction:t})}function Ph(e){const t=Math.max(4-e.length,0);return`*${e+"*".repeat(t)}`}function Mh(e,t){return t?e?`${e} ${Ph(t)}`:t?Ph(t):"":e??""}const Dh=e=>e>0?"Deposited to":"Withdrawn from",Rh=e=>Number(e.split("_")[1]),Oh=e=>({id:Rh(e.id),apiAccountName:e.apiAccountName,apiAccountNo:e.apiAccountNo,apiAccountType:e.apiAccountType,duplicateBankAccountIds:[]});function _h({transaction:e,parentTransaction:t}){switch(e.type){case"EXPENSE":return w(Nh,{transaction:e,parentTransaction:t});case"BANK_TRANSFER":return w(ru,{annotation:Dh(e.amount),accountName:e.bankAccount?.name});default:return w(Ju,{transaction:e,parentTransaction:t,accountNo:e.glAccount?.accountNo,accountName:e.glAccount?.name})}}function Lh({name:e}){return w(C,{children:e&&w(Ji,{children:e})})}const Fh="USER_REVIEW_REQUIRED",Bh="ACCOUNTANT_REVIEW_REQUIRED",Wh=ia(e=>c.createElement("svg",{width:13,height:15,viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("path",{d:"M0.743464 14.9687V0.96875H11.6465L9.22218 4.59886L11.6465 8.24166H0.743464",stroke:"#182428",strokeMiterlimit:10})),"Flag"),Hh=ia(e=>c.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("path",{d:"M8.54708 2.09833H8.37602C8.21004 2.09808 8.04676 2.14026 7.90167 2.22087C7.75657 2.30147 7.6345 2.41783 7.54702 2.55888L1.70458 11.9081C1.60602 12.0636 1.55355 12.2438 1.55325 12.4279C1.55324 12.5569 1.57886 12.6846 1.62861 12.8036C1.67837 12.9226 1.75127 13.0305 1.84309 13.1211C1.93491 13.2117 2.04381 13.2832 2.16348 13.3313C2.28314 13.3795 2.41118 13.4034 2.54015 13.4016H14.3829C14.6412 13.4016 14.8889 13.299 15.0715 13.1164C15.2541 12.9338 15.3567 12.6861 15.3567 12.4279C15.3564 12.2438 15.3039 12.0636 15.2054 11.9081L9.37608 2.55888C9.2886 2.41783 9.16652 2.30147 9.02143 2.22087C8.87634 2.14026 8.71306 2.09808 8.54708 2.09833Z",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M8.46158 5.23663V9.00659",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M8.46158 10.2632V11.5199",stroke:"#182428",strokeMiterlimit:10})),"Attention"),Uh=ia(e=>c.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("path",{d:"M8.32497 15.1744C12.1492 15.1744 15.2494 12.0742 15.2494 8.24998C15.2494 4.42573 12.1492 1.32556 8.32497 1.32556C4.50071 1.32556 1.40054 4.42573 1.40054 8.24998C1.40054 12.0742 4.50071 15.1744 8.32497 15.1744Z",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M4.54623 8.25001L7.06541 10.7692L12.1037 5.73083",stroke:"#182428",strokeMiterlimit:10})),"CircleCheck"),Vh=ia(e=>c.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("path",{d:"M7.81985 0.464722V3.49919",stroke:"black",strokeMiterlimit:10}),c.createElement("path",{d:"M7.81985 12.0008V15.0353",stroke:"black",strokeMiterlimit:10}),c.createElement("path",{d:"M15.1051 7.75H12.0706",stroke:"black",strokeMiterlimit:10}),c.createElement("path",{d:"M3.56907 7.75H0.534607",stroke:"black",strokeMiterlimit:10}),c.createElement("path",{d:"M12.9702 2.59967L10.8227 4.74724",stroke:"black",strokeMiterlimit:10}),c.createElement("path",{d:"M4.81706 10.7528L2.66949 12.9004",stroke:"black",strokeMiterlimit:10}),c.createElement("path",{d:"M12.9702 12.9004L10.8227 10.7528",stroke:"black",strokeMiterlimit:10}),c.createElement("path",{d:"M4.81706 4.74724L2.66949 2.59967",stroke:"black",strokeMiterlimit:10})),"Processing"),zh=xt({maxWidth:"100%",width:"fit-content",display:"inline-flex",padding:"4px 5px",justifyContent:"center",alignItems:"center",gap:"5px",borderRadius:"sm",border:"{borderWidths.md} solid",borderColor:"border.layout",background:"surface.background",cursor:"pointer","&:focus":{outline:"none"},"&[data-state='closed']":{},"& .Tight-sub-label":{color:"typography.base"},"& .Tight-medium-icon > path":{stroke:"icon.base"}}),jh=xt({background:"surface.intent.secondary",border:"{borderWidths.sm} solid",borderColor:"border.intent.secondary","& .Tight-sub-label":{color:"typography.intent.secondary"},"& .Tight-medium-icon > path":{stroke:"icon.intent.secondary"},_supportHover:{background:"surface.intent.secondary.hover",borderColor:"border.intent.secondary.hover","& .Tight-sub-label":{color:"typography.intent.secondary.hover"},"& .Tight-medium-icon > path":{stroke:"icon.intent.secondary.hover"}},"&:focus-visible, &[data-state='open']":{background:"surface.intent.secondary.hover",borderColor:"border.intent.secondary.hover","& .Tight-sub-label":{color:"typography.intent.secondary.hover"},"& .Tight-medium-icon > path":{stroke:"icon.intent.secondary.hover"}}}),Kh=xt({borderRadius:"sm",border:"{borderWidths.md} solid",borderColor:"border.intent.action",background:"surface.intent.action","& .Tight-sub-label":{color:"typography.intent.action"},"& .Tight-medium-icon > path":{stroke:"icon.intent.action"},_supportHover:{background:"surface.intent.action.hover",borderColor:"border.intent.action.hover","& .Tight-sub-label":{color:"typography.intent.action.hover"},"& .Tight-medium-icon > path":{stroke:"icon.intent.action.hover"}},"&:focus-visible, &[data-state='open']":{background:"surface.intent.action.hover",borderColor:"border.intent.action.hover","& .Tight-sub-label":{color:"typography.intent.action.hover"},"& .Tight-medium-icon > path":{stroke:"icon.intent.action.hover"}}}),$h=xt({borderRadius:"sm",border:"{borderWidths.md} solid",borderColor:"border.intent.success",background:"surface.intent.success","& .Tight-sub-label":{color:"typography.intent.success"},"& .Tight-medium-icon > path":{stroke:"icon.intent.success"},_supportHover:{background:"surface.intent.success.hover",borderColor:"border.intent.success.hover","& .Tight-sub-label":{color:"typography.intent.success.hover"},"& .Tight-medium-icon > path":{stroke:"icon.intent.success.hover"}},"&:focus-visible, &[data-state='open']":{background:"surface.intent.success.hover",borderColor:"border.intent.success.hover","& .Tight-sub-label":{color:"typography.intent.success.hover"},"& .Tight-medium-icon > path":{stroke:"icon.intent.success.hover"}}}),qh=xt({background:"surface.intent.warning",border:"{borderWidths.sm} solid",borderColor:"border.intent.warning","& .Tight-sub-label":{color:"typography.intent.warning"},"& .Tight-medium-icon > path":{stroke:"icon.intent.warning"},_supportHover:{background:"surface.intent.warning.hover",borderColor:"border.intent.warning.hover","& .Tight-sub-label":{color:"typography.intent.warning.hover"},"& .Tight-medium-icon > path":{stroke:"icon.intent.warning.hover"}},"&:focus-visible, &[data-state='open']":{background:"surface.intent.warning.hover",borderColor:"border.intent.warning.hover","& .Tight-sub-label":{color:"typography.intent.warning.hover"},"& .Tight-medium-icon > path":{stroke:"icon.intent.warning.hover"}}}),Yh=xt({background:"surface.intent.danger",border:"{borderWidths.sm} solid",borderColor:"border.intent.danger","& .Tight-sub-label":{color:"typography.intent.danger"},"& .Tight-medium-icon > path":{stroke:"icon.intent.danger"},_supportHover:{background:"surface.intent.danger.hover",borderColor:"border.intent.danger.hover","& .Tight-sub-label":{color:"typography.intent.danger.hover"},"& .Tight-medium-icon > path":{stroke:"icon.intent.danger.hover"}},"&:focus-visible, &[data-state='open']":{background:"surface.intent.danger.hover",borderColor:"border.intent.danger.hover","& .Tight-sub-label":{color:"typography.intent.danger.hover"},"& .Tight-medium-icon > path":{stroke:"icon.intent.danger.hover"}}}),Gh=Rt(St.badge,zh),Qh=Rt(null,Ln),Xh=Rt(null,da),Zh=Rt(St["neutral-badge"],jh),Jh=Rt(St["highlight-badge"],Kh),ep=Rt(St["success-badge"],$h),tp=Rt(St["warning-badge"],qh),rp=Rt(St["critical-badge"],Yh);function np({type:e,children:t,onClick:r,popupTriggerProps:n}){let o;switch(e){case"critical":o=rp;break;case"warning":o=tp;break;case"neutral":o=Zh;break;case"success":o=ep;break;case"highlight":o=Jh}const a=Bt([Gh,Qh,o,Xh]);return w("button",{...a,onClick:r,...n,children:t})}const op=[{status:"USER_REVIEW_REQUIRED",displayName:"Needs my Review"},{status:"ACCOUNTANT_REVIEW_REQUIRED",displayName:"Flag to Accountant"},{status:"RECONCILED",displayName:"Reconciled"}],ap=[{status:"ACCOUNTANT_REVIEW_REQUIRED",displayName:"Needs my Review"},{status:"RECONCILIATION_DISCREPANCY",displayName:"Discrepancy"},{status:"USER_REVIEW_REQUIRED",displayName:"Flag to User"},{status:"RECONCILED",displayName:"Reconciled"}];function ip({onClick:e}){const t=gl(),{userRole:r}=p(Hl),n=(e=>{switch(e){case"OWNER":default:return op;case"ACCOUNTANT":return ap}})(r)||[];return w(El,{children:w(pu,{children:n.map(({status:r,displayName:n})=>w(vu,{onClick:()=>(e(r),void t.setOpen(!1)),children:n},r))})})}function lp({status:e,transactionId:t}){const[r,n]=m(!1),{mutate:o}=Zu(),a=()=>{n(!1)},i=()=>{n(!r)},{userRole:l}=p(Hl),{text:s,type:c,Icon:d}=((e,t)=>{const r=((e,t)=>{switch(t){case"ACCOUNTANT":return e===Bh;case"OWNER":return e===Fh}})(e,t),n=/* @__PURE__ */((e,t)=>"OWNER"===t&&e===Bh)(e,t),o=/* @__PURE__ */((e,t)=>"ACCOUNTANT"===t&&e===Fh)(e,t),a=/* @__PURE__ */(e=>"RECONCILIATION_DISCREPANCY"===e)(e),i=/* @__PURE__ */(e=>"RECONCILED"===e)(e);let l,s,c;return n?(l="Pending Review",s=w(Qc,{Component:Vh}),c="neutral"):o?(l="Pending User Review",s=w(Qc,{Component:Vh}),c="neutral"):r?(l="Needs Review",s=w(Qc,{Component:Wh}),c="warning"):a?(l="Discrepancy",s=w(Qc,{Component:Hh}),c="critical"):i?(l="Reconciled",s=w(Qc,{Component:Uh}),c="success"):(l="Processing",s=w(Qc,{Component:Vh}),c="neutral"),{text:l,type:c,Icon:s}})(e,l);return!t||((u=t).startsWith(yi.TRANSACTION_LINE_ITEM)||u.startsWith(yi.PROCESSOR_TRANSACTION))?null:E(pl,{open:r,blockInteraction:!1,onOpenChange:a,enableClickMiddleware:!1,children:[w(ml,{children:e=>E(np,{type:c,popupTriggerProps:e,onClick:i,children:[d,w(ro,{children:s})]})}),w(ip,{onClick:e=>{o({id:t,reviewStatus:e}),a()}})]});var u}function sp({status:e,transactionId:t}){return w(lp,{status:e,transactionId:t},t)}const cp=ia(e=>c.createElement("svg",{width:13,height:12,viewBox:"0 0 13 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("g",{clipPath:"url(#clip0_9779_2940)"},c.createElement("path",{d:"M11.9147 7.99997L6.31472 2.39996L0.714716 7.99997",stroke:"#182428",strokeMiterlimit:10})),c.createElement("defs",null,c.createElement("clipPath",{id:"clip0_9779_2940"},c.createElement("rect",{width:12,height:12,fill:"white",transform:"translate(0.314728)"})))),"ArrowUp"),dp=ia(e=>c.createElement("svg",{width:13,height:12,viewBox:"0 0 13 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("g",{clipPath:"url(#clip0_9779_2922)"},c.createElement("path",{d:"M0.714706 3.99996L6.31472 9.59998L11.9147 3.99996",stroke:"#182428",strokeMiterlimit:10})),c.createElement("defs",null,c.createElement("clipPath",{id:"clip0_9779_2922"},c.createElement("rect",{width:12,height:12,fill:"white",transform:"translate(0.314728)"})))),"ArrowDown");function up({row:e}){const t=e.getIsExpanded();return e.getCanExpand()?w(Rl,{"aria-label":t?"Collapse row":"Expand row","aria-expanded":t,children:w(ga,{Component:t?cp:dp})}):w(Rl,{active:!1,children:w(ga,{Component:sa})})}function hp({row:e}){return w(up,{row:e})}const pp=ia(e=>c.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("path",{d:"M0.495239 8.15601H14.7767",strokeMiterlimit:10})),"Dash"),gp=Rt(null,xt({stroke:"icon.base.weak"}));function mp({hasConversation:e,hasUnread:t=!1}){return w(C,{children:e?w(ws,{hasUnread:t}):w("div",{"data-testid":"no-conversations-dash",children:w(bl,{Component:pp,stylists:[gp]})})})}function vp({conversationId:e}){const{query:{data:t}}=za(e??null),{startPrefetch:r,cancelPrefetch:n}=Ka(),{startPrefetch:o,cancelPrefetch:a}=Ii(),i=ur(t),l=i&&"READ"==t?.readStatus,s=v(()=>{ur(e)&&(r({id:e}),o({id:e}))},[e,r,o]),c=v(()=>{ur(e)&&(n(),a())},[e,n,a]);return w("div",{onMouseEnter:s,onMouseLeave:c,children:w(mp,{hasConversation:i,hasUnread:!l})})}const bp=j(),fp=[bp.display({id:Fe.SELECT,header:()=>null,cell:({row:e})=>void 0===e.getParentRow()?w(Ud,{checked:e.getIsSelected(),onClick:e.getToggleSelectedHandler()},e.original.id):null,maxSize:35,meta:{clickable:!0}}),bp.accessor("date",{id:Fe.DATE,cell:e=>w(ol,{children:w(Yd,{transaction:e.row.original})}),header:()=>w(Fl,{columnName:"Date",sortDef:"DATE",sortAscDisplay:Sd,sortDescDisplay:Ad}),size:130,maxSize:144}),bp.accessor("description",{id:Fe.DESCRIPTION,cell:e=>w(ol,{children:w(Qd,{bankTransaction:e.row.original})}),header:()=>w(Fl,{columnName:"Source",sortDef:"DESCRIPTION",sortAscDisplay:Nd,sortDescDisplay:Pd}),size:180}),bp.accessor("amount",{id:Fe.AMOUNT,cell:e=>w(ol,{children:w(eu,{transaction:e.row.original})}),header:()=>w(Fl,{columnName:"Amount",sortDef:"AMOUNT",sortAscDisplay:Md,sortDescDisplay:Dd}),size:130,maxSize:180}),bp.accessor("category.id",{id:Fe.CATEGORY,cell:({row:e})=>w(_h,{transaction:e.original,parentTransaction:e.getParentRow()?.original}),header:()=>w(Fl,{columnName:"Category"}),size:130,meta:{clickable:!0}}),bp.accessor(e=>e.classSegments[0]?.id,{id:Fe.CLASS_SEGMENT,cell:e=>w(ol,{children:w(Lh,{name:e.row.original.classSegments[0]?.name})}),header:()=>w(Fl,{columnName:"Business"}),size:130}),bp.accessor("reviewStatus",{id:Fe.REVIEW_STATUS,cell:e=>w(ol,{children:w(sp,{status:e.getValue(),transactionId:e.row.original.id})}),header:()=>w(Fl,{columnName:"Reviewed",sortDef:"REVIEW_STATUS",sortAscDisplay:Rd,sortDescDisplay:Od}),size:130,maxSize:160,meta:{clickable:!0}}),bp.display({id:Fe.COMMENTS,cell:e=>{const t=e.row.original;return w(ol,{alignVariant:"center",children:w(vp,{conversationId:t.conversation?.id})})},header:()=>w(Fl,{columnName:"Comments"}),size:110,maxSize:110,meta:{clickable:!0}}),bp.display({id:Fe.EXPAND,cell:e=>w(hp,{row:e.row}),size:40,maxSize:60})];function yp(e){return e?fp.filter(t=>e.includes(t.id)):fp}function Tp(e){if(e)return Object.values(Fe).reduce((t,r)=>(t[r]=e.includes(r),t),{})}const xp=[],kp=[Fe.COMMENTS,Fe.DATE,Fe.DESCRIPTION,Fe.AMOUNT,Fe.CATEGORY,Fe.REVIEW_STATUS];function wp(e,t){return si("BankTransactionFormRouter",{routeProps:{transactionId:e,initialTab:t}})}function Cp(e){const t=e.row,r=e.column.columnDef.meta?.clickable,n=t.getCanExpand(),o="BANK_TRANSFER"===t.original.type,a="category"===e.column.id&&(n||o);if("comments"===e.column.id){const e=t.getParentRow();wp(e?.original.id??t.original.id,"conversation")}else if(!r||a)if(n)t.toggleExpanded();else{const e=t.getParentRow();wp(e?.original.id??t.original.id)}}function Ep({rowData:e,hasSelect:t=!0}){const{startPrefetch:r,cancelPrefetch:n}=fi(),o=v(()=>r({id:e.original.id}),[r,e.original]);return w(li,{rowData:e,onMouseEnter:o,onMouseLeave:n,onCellClick:Cp,shouldDisplayDivider:r=>{return n=r,o=t,a=e.getVisibleCells().length,!(0===n||o&&1===n||n===a-1||o||1===n);var n,o,a}})}function Ip(){return E(C,{children:[w(os,{Component:Uh}),w(eo,{wrap:"wrap",children:"All caught up"}),w(ro,{wrap:"wrap",children:"We'll let you know if something comes up."})]})}const Sp=Rt(St["button-warning"],xt({color:"typography.intent.warning",border:"1px solid {colors.border.intent.warning}",backgroundColor:"surface.intent.warning",_supportHover:{_notDisabled:{backgroundColor:"surface.intent.warning.hover",borderColor:"border.intent.warning.hover","& .Tight-text":{color:"typography.intent.warning.hover"}}},"&:active:enabled, &[data-active='true']:enabled":{backgroundColor:"surface.intent.warning.active",borderColor:"border.intent.warning.active","& .Tight-text":{color:"typography.intent.warning.active"}},"& .Tight-text":{color:"typography.intent.warning"}}));function Ap({children:e,stylists:t=[],...r}){return w(zi,{stylists:[Sp,...t],...r,children:e})}function Np(){const{linkPlaid:e}=hc();return w(Ap,{onClick:e,children:w(eo,{children:"Link your bank"})})}const Pp=Rt(null,xt({whiteSpace:"wrap"}));function Mp(){return E(C,{children:[w(os,{Component:fh}),w(eo,{stylists:[Pp],children:"Your bank transactions will be categorized for you"}),w(ro,{wrap:"wrap",children:"If any require your review, they'll be flagged here."}),w(Np,{})]})}const Dp=xt({animation:"spin",display:"flex",alignItems:"center",justifyContent:"center",width:"15px",height:"15px"});function Rp(){return E(C,{children:[w("div",{className:Dp,children:w(Qc,{Component:Vh})}),w(eo,{children:"Transactions are being processed"}),w(ro,{children:"Any transactions that require review will show up here."})]})}function Op({hasLinkedAccount:e,sortInstance:t,setSortInstance:r,isFilling:n,paginationControls:o,transactions:a}){const i=function({transactions:e}){return function({transactions:e,columns:t}){return function({transactions:e,columns:t}){return K({data:e??xp,manualPagination:!0,manualSorting:!0,manualFiltering:!0,manualGrouping:!0,rowCount:e?.length??xp.length,columns:yp(t),getCoreRowModel:$(),getRowCanExpand:e=>e.original.children.length>0,getSubRows:e=>e.children.map(e=>{return t=e,{...t,matchingBankTransaction:null,rule:null,tax:{paymentInfo:null},customData:null,children:[],conversation:null};var t}),getExpandedRowModel:q(),paginateExpandedRows:!1,getRowId:e=>e.id,state:{columnOrder:t,columnVisibility:Tp(t)}})}({transactions:e,columns:t?[...t,Fe.EXPAND]:void 0})}({transactions:e,columns:kp})}({transactions:a}),{query:{data:l},isFilling:s}=mi({limit:1,filter:{status:{in:["ACTIVE","INACTIVE","REMOVED"]}}}),c=!dr(l?.data?.[0])&&!s,d=function(e,t,r){let n;return e||t?!e||r||t?e&&r&&!t&&(n=w(Ip,{})):n=w(Rp,{}):n=w(Mp,{}),n}(e??!1,a.length>0,c);return E(C,{children:[w("div",{id:Yo}),E(pa.Provider,{value:o,children:[E(_t,{children:[w(Ut,{children:"Transactions For Your Review"}),w(ds,{children:w(ya,{})})]}),w(Gi,{dashboard:"businessOwnerDashboard",children:n?w(Ea,{}):E(C,{children:[w(Qi.Provider,{value:{sortInstance:t,setSortInstance:r},children:w(Ga,{headerGroups:i.getHeaderGroups()})}),dr(d)?w(Xa,{children:i.getRowModel().rows.map(e=>w(Ep,{rowData:e,hasSelect:!1},e.id))}):w(ns,{children:d})]})})]})]})}function _p(){const{sortInstance:e,setSortInstance:t,apiSort:r}=function(){const[e,t]=m(void 0),r=u(()=>{if(e&&(e.orderBy||e.direction))return e},[e]);return{sortInstance:e,setSortInstance:e=>{(function(e){if(void 0===e)return!0;const t=(e.orderBy&&e.orderBy in di)??!1,r=(e.direction&&e.direction in ui)??!1;return t&&r})(e)&&t(e)},apiSort:r}}(),{query:{data:n},isFilling:o,paginationControls:a}=mi({filter:Qo,sort:r,limit:10}),i=n?.data??Zo,{query:{data:l},isFilling:s}=Ic({select:e=>Ac(e?.data)});return w(Op,{sortInstance:e,setSortInstance:t,isFilling:o||s,paginationControls:a,transactions:i,hasLinkedAccount:l??!1})}const Lp=Rt(St["button-action"],xt({color:"typography.intent.action",border:"1px solid {colors.border.intent.action}",backgroundColor:"surface.intent.action",_supportHover:{_notDisabled:{backgroundColor:"surface.intent.action.hover",borderColor:"border.intent.action.hover","& .Tight-text":{color:"typography.intent.action.hover"}}},"&:active:enabled, &[data-active='true']:enabled":{backgroundColor:"surface.intent.action.active",borderColor:"border.intent.action.active","& .Tight-text":{color:"typography.intent.action.active"}},"& .Tight-text":{color:"typography.intent.action"}}));function Fp({children:e,stylists:t=[],...r}){return w(zi,{stylists:[Lp,...t],...r,children:e})}const Bp=ia(e=>c.createElement("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("path",{d:"M4.66504 7.91458H10.335",strokeMiterlimit:10,strokeLinecap:"square"}),c.createElement("path",{d:"M4.66504 10.6418H10.335",strokeMiterlimit:10,strokeLinecap:"square"}),c.createElement("path",{d:"M12.8125 3.95627V13.9937H2.1875V1.00626H9.86248L12.8125 3.95627Z",strokeMiterlimit:10}),c.createElement("path",{d:"M12.8125 3.95627V4.54998H9.26877V1.00626H9.86248L12.8125 3.95627Z",strokeMiterlimit:10})),"Doc"),Wp=e=>{switch(e){case"MESSAGE_REVIEW":return{Icon:Ts,buttonText:"Respond now"};case"TRANSACTION_REVIEW":return{Icon:Wh,buttonText:"Review"};case"LINK_BANK":return{Icon:fh,buttonText:"Link your bank"};case"DELETE_OR_RELINK":case"UNLINK_RELINK":case"OPEN_BANK":return{Icon:fh,buttonText:"Fix now"};case"RELINK":return{Icon:fh,buttonText:"Relink"};case"CHAT":return{Icon:Hh,buttonText:"Learn more"};case"ONBOARDING_FORM":return{Icon:Bp,buttonText:"Fill out form"};case"ALL_CAUGHT_UP":case"NO_ACTION_ITEMS":return{Icon:Uh,buttonText:""};default:return{Icon:Hh,buttonText:""}}},Hp=Rt(null,xt({display:"flex",alignItems:"center",gap:"15px"})),Up=Rt(null,xt({width:"20px",height:"20px"}));function Vp({title:e,type:t}){const{Icon:r}=Wp(t);return E("div",{...Hp,children:[w(Qc,{Component:r,stylists:[Up]}),w(eo,{wrap:"wrap",children:e})]})}const zp=Rt(null,xt({display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"flex-start",gap:"5px",flex:"1 1 0",minWidth:"200px",width:"100%"}));function jp({title:e,description:t,type:r}){return E("div",{...zp,children:[w(Vp,{title:e,type:r}),w(ro,{wrap:"wrap",children:t})]})}const Kp=Rt(St["banner-button"],xt({display:"flex",width:"202px",justifyContent:"flex-end",alignItems:"center",gap:"15px",flexShrink:"0"})),$p=Rt(St["banner-button-text"]),qp=Rt(St["banner-button-icon"]);function Yp({priority:e,type:t,handleClick:r}){const{buttonText:n}=Wp(t),{Button:o}=(e=>{switch(e){case"URGENT":return{Button:Gs};case"HIGH":return{Button:Ap};case"MEDIUM":return{Button:Fp};default:return{Button:zi}}})(e);return E(o,{onClick:r,stylists:[Kp],children:[w(eo,{stylists:[$p],children:n}),w(ga,{stylists:[qp],Component:sa})]})}const Gp=Et({base:{display:"flex",flexDirection:{sm:"row",base:"column"},padding:"15px",justifyContent:"space-between",alignItems:{sm:"center",base:"flex-start"},alignSelf:"stretch",flexWrap:"wrap",minWidth:"300px",gap:"15px",borderRadius:"lg",border:"1px solid",backgroundColor:"surface.foreground"},variants:{priority:{HIGH:{borderColor:"border.intent.warning"},MEDIUM:{borderColor:"border.intent.action"},LOW:{borderColor:"border.intent.success"},URGENT:{borderColor:"border.intent.danger"},DEFAULT:{borderColor:"border.intent.secondary"}}}}),Qp={HIGH:St["banner-high"],MEDIUM:St["banner-medium"],LOW:St["banner-low"],URGENT:St["banner-urgent"]};function Xp({task:e,handleClick:t}){const{name:r,description:n,type:o,priority:a}=e,i=Rt(St.banner,Qp[a],Gp({priority:a}));return E("div",{...i,children:[w(jp,{title:r,description:n,type:o}),w(Yp,{priority:a,type:o,handleClick:t})]})}function Zp({task:e}){const t=Ee(),{linkPlaid:r}=hc(e?.meta?.plaidItem?.id),{alert:n,actions:o}=xc(e?.meta?.plaidItem);return w(Xp,{task:e,handleClick:()=>{"RELINK"===e.type?r():"LINK_BANK"===e.type?t?si("NewPlaidConnection"):r():kc(n,o)}})}const Jp=Rt(St.banner,St["banner-default"],Gp({priority:"DEFAULT"}));function eg(){const e=gc()?"We'll let you know of new items":"We'll let you know if a new action item comes up";return w("div",{...Jp,children:w(jp,{title:"All Caught Up",description:e,type:"ALL_CAUGHT_UP"})})}const tg=Rt(St.banner,St["banner-default"],Gp({priority:"DEFAULT"}));function rg(){const e=gc()?"No action items yet":"No action items yet as your bookkeeper is setting up your books";return w("div",{...tg,children:w(jp,{title:"Onboarding In Progress",description:e,type:"NO_ACTION_ITEMS"})})}const ng=xt({width:"100%",height:72,minWidth:"300px"});function og(){return E(C,{children:[w(No,{styles:ng}),w(No,{styles:ng}),w(No,{styles:ng})]})}function ag({taskBanners:e,handleScrollAction:t,isWaitingForPlaidItemAccountsSync:r,isFilling:n}){const o=e.length>0;return n?w(og,{}):o?e.map(e=>{if(void 0===ta[e.type]||"ONBOARDING_FORM"===e.type&&dr(e.actionLink))return null;if("LINK_BANK"===e.type||"BANK_ERROR"===e.type||Object.values(mc).includes(e.type))return w(Zp,{task:e},e.id);const r=e.actionLink,n=ur(r)?()=>window.open(r,"_blank"):()=>t(e.type);return w(Xp,{task:e,handleClick:n},e.id)}):w(r?rg:eg,{})}function ig(){return E(Ki,{onClick:()=>si("BanksAndIntegrations"),children:[w(ga,{Component:Gc}),w(ll,{children:"Banks & Integrations"})]})}const lg=Rt(St["business-owner-dashboard"],xt({gap:10,display:"flex",flexDirection:"column",width:"100%",maxWidth:1440})),sg=xt({display:"flex",width:"100%",justifyContent:"center"}),cg=e=>{const t=Go[e];if(t){const e=document.getElementById(t);e&&e.scrollIntoView({behavior:"smooth"})}},dg={status:{in:["ACTIVE","INACTIVE"]}},ug={filter:{status:{in:["ACTIVE"]}}};function hg({period:e,onChangePeriod:t}){const{sortInstance:r,setSortInstance:n,apiSort:o}=function(){const[e,t]=m(void 0);return{sortInstance:e,setSortInstance:v(e=>{!function(e){if(void 0===e)return!0;const t=(e.orderBy&&e.orderBy in La)??!1,r=(e.direction&&e.direction in Fa)??!1;return t&&r}(e)?t(void 0):t(e)},[t]),apiSort:e}}(),{query:{data:a},isFilling:i,paginationControls:l}=Ua({limit:10,sort:o,filter:Xo}),s=a?.data??Jo,c=gc(),{query:{data:d},isFilling:h}=(p={select:e=>((e,t)=>{const r=dr(n=e)||dr(n.data)?[]:[...n.data].sort((e,t)=>na[e.priority]-na[t.priority]);var n;return t?r.filter(e=>"MESSAGE_REVIEW"===e.type||"BANK_ERROR"===e.type):r})(e,c)},g=ug,xr({...p,queryKey:g?ra(g):["tasks",{}],queryFn:oa}));var p,g;const{query:{data:b}}=Ic({select:e=>({plaidItemAccountsReadyToSync:Nc(e?.data),hasPlaidLinkedBankAccount:Ac(e?.data)})}),{query:{data:f}}=js({select:e=>{return t=e,t?.filter(({status:e,apiErrorType:t,apiErrorCode:r})=>"ACTIVE"===e&&t&&r);var t}}),y=gc(),T=u(()=>{let e=[];f&&(e=f.map(e=>Cc(e)));let t=[];!1===b?.hasPlaidLinkedBankAccount&&(t=[wc]);const r=d??[];return[...e,...t,...r]},[d,b,f]),x=function(){const{query:{data:e}}=mi({filter:dg,limit:1});return(e?.data?.length??0)>0}(),k=function(e,t){const r=!(void 0===t||t.hasPlaidLinkedBankAccount&&!t.plaidItemAccountsReadyToSync);return!e&&r}(x,b),I=/* @__PURE__ */new Date,S={month:I.getMonth(),year:I.getFullYear()};const[A,N]=ul(S,e,t),P=(M=A.month,{beginDate:zt((D=A.year)-1,M+1,1),endDate:zt(D,M+1,0)});var M,D;return w("div",{className:sg,children:E("div",{...lg,children:[E(_t,{children:[w(Ut,{children:"Action Items"}),w(ig,{})]}),w($o,{children:w(ag,{taskBanners:T,handleScrollAction:cg,isWaitingForPlaidItemAccountsSync:!x&&!0===b?.plaidItemAccountsReadyToSync,isFilling:h})}),!y&&E(C,{children:[w(Id,{period:A,handleDateChange:e=>{var t,r;(t=S).year===(r=e).year&&r.month>t.month||r.year>t.year||N(e)},todayPeriod:S,showSamples:k,showLinkAccountButton:k&&!b?.plaidItemAccountsReadyToSync}),w(_t,{children:w(Ut,{children:"Financial Summary"})}),w(Hs,{isSample:k,period:A}),w(jo,{filter:P,isSample:k})]}),w(ps,{sortInstance:r,setSortInstance:n,conversations:s,paginationControls:l,isFilling:i,isMobile:y}),!y&&w(_p,{})]})})}function pg(e){return w(ln||C,{children:e.children})}const gg="undefined"!=typeof window?x:b,mg={x:0,y:0,width:0,height:0,top:0,left:0,bottom:0,right:0};function vg({children:e}){const[t,{width:r,height:n}]=function(e={}){const{debounceMs:t=0}=e,[r,n]=m(null),[o,a]=m(mg),i=u(()=>{let e=null;return new window.ResizeObserver(r=>{if(r[0]){const{x:n,y:o,width:i,height:l,top:s,left:c,bottom:d,right:u}=r[0].contentRect;t>0?(null!==e&&clearTimeout(e),e=setTimeout(()=>{a({x:n,y:o,width:i,height:l,top:s,left:c,bottom:d,right:u}),e=null},t)):a({x:n,y:o,width:i,height:l,top:s,left:c,bottom:d,right:u})}})},[t]);return gg(()=>{if(r)return i.observe(r),()=>{i.disconnect()}},[r]),[n,o]}({debounceMs:150});return w(pg,{children:w(pc.Provider,{value:{dimensions:{width:r,height:n}},children:w("div",{ref:t,className:Nt(St.component),children:e})})})}function bg(e){return w(vg,{children:w(hg,{...e})})}const fg=ve("tight-component-store",1,{upgrade(e){e.createObjectStore("queryClient")}}),yg={queryClient:fr,persister:/* @__PURE__ */function(e="reactQuery"){return{persistClient:async t=>{await async function(e,t){return(await fg).put("queryClient",t,e)}(e,t)},restoreClient:async()=>await async function(e){return(await fg).get("queryClient",e)}(e),removeClient:async()=>{await async function(e){return(await fg).delete("queryClient",e)}(e)}}}(),maxAge:br,dehydrateOptions:{shouldDehydrateQuery:e=>!e.isStale()}};function Tg({children:e}){return w(be,{client:fr,persistOptions:yg,children:e})}const xg=xt({position:"absolute",top:0,left:0,width:{base:0,sm:"100dvw"},height:{base:0,sm:"100dvh"},minWidth:{base:0,sm:"100dvw"},minHeight:{base:0,sm:"100dvh"},maxHeight:{base:0,sm:"100dvh"},maxWidth:{base:0,sm:"100dvw"},overflow:"hidden",backgroundColor:"overlay"}),kg=xt({position:"absolute",top:0,left:{base:0,sm:"auto"},right:0,bottom:{base:0,sm:"auto"},width:"100dvw",height:"100dvh",minWidth:"100dvw",minHeight:"100dvh",maxHeight:"100dvh",maxWidth:"100dvw",overflow:"hidden"}),wg=Rt(null,St.component,kg);function Cg({children:e}){const t=d(null),r=d(null);return E(ce,{lockScroll:!0,children:[w("div",{className:xg}),w("div",{onMouseDown:e=>{r.current=e.target},onClick:e=>{const n=r.current===t.current,o=e.target===t.current;n&&o&&(r.current=null,Le.getState().closeAllDrawers())},ref:t,...wg,children:e})]})}const Eg=h({drawerHistory:[]});function Ig({children:e}){const t=Le(e=>e.drawerHistory),r=u(()=>({drawerHistory:t}),[t]);return w(Eg.Provider,{value:r,children:t.length>0&&w(Cg,{children:e})})}function Sg({Component:e,name:t}){const{drawerHistory:r}=p(Eg),n=r.at(-1);if(void 0===n)return null;const o=n[t];return void 0!==o?w(e,{...o.routeProps}):void 0}const{formContext:Ag,fieldContext:Ng,useFieldContext:Pg,useFormContext:Mg}=fe();function Dg({showIcon:e=!0,textContent:t="Save",disabled:r=!1}){return E(Xs,{type:"submit",disabled:r,children:[e&&w(ga,{Component:_d}),w(eo,{children:t})]})}const Rg=[Rt(null,xt({color:"icon.accent.danger","& path":{stroke:"icon.accent.danger"}}))],Og=Rt(null,xt({display:"flex",alignItems:"center",gap:"4px"}));function _g({errorMessage:e}){return E("div",{...Og,children:[w(Qc,{Component:Hh,stylists:Rg}),w(ro,{intent:"danger",children:e})]})}const Lg=xt({display:"flex",flexDirection:"column",padding:"12px 16px",cursor:"pointer",outline:"none",gap:"8px",borderRadius:"md",backgroundColor:"surface.intent.action.discrete","&[data-state='closed'][data-disablehover='false']":{_supportHover:{backgroundColor:"surface.intent.action.discrete.hover"}},"&:not([data-state])[data-disablehover='false']:not(:focus-within)":{_supportHover:{backgroundColor:"surface.intent.action.discrete.hover"}},"&[data-state='open']":{backgroundColor:"surface.intent.action.discrete.active"},"&[data-clicked='false']:has(:focus-visible)":{outline:"4px solid",outlineColor:"border.layout"}}),Fg=xt({"&[data-haserror='true']":{border:"{borderWidths.lg} solid",borderColor:"border.intent.danger"}}),Bg=xt({display:"flex",justifyContent:"space-between",alignItems:"center"});function Wg({children:e,inputRef:t,popupTriggerProps:r,label:n,isDefaultValue:o,isTouched:a,className:i,additionalStyles:l,onClick:s,onBlur:c,errorMessage:d,disableHover:u=!1,type:h,remainingChars:p}){const g=Rt(i||null,Lg,l,Fg,da),[v,b]=m(!0);return E(C,{children:[E("div",{...g,onClick:s,...r,onMouseDown:e=>{b(!0),t&&t.current&&e.target!==t.current&&(e.preventDefault(),t.current.focus())},onFocus:()=>{t&&t.current&&function(e,t){if("setSelectionRange"in e&&"number"!==t){const t=e.value.length;e.setSelectionRange(t,t)}}(t.current,h)},onBlur:()=>{b(!1),c?.()},"data-clicked":v,"data-isdefaultvalue":o,"data-haserror":a&&void 0!==d,"data-disablehover":u,children:[E("div",{className:Bg,children:[void 0!==n&&w(ro,{children:n}),ur(p)&&w(ro,{intent:p&&p<0?"danger":"normal",children:`${p}`})]}),e]}),a&&d&&w(_g,{errorMessage:d})]})}const Hg=xt({border:"{borderWidths.lg} solid transparent","&:focus-within, &[data-isdefaultvalue='false']":{backgroundColor:"surface.foreground",border:"{borderWidths.lg} solid",borderColor:"border.layout.strong"},"&:focus-within":{cursor:"text"}});function Ug({children:e,inputRef:t,popupTriggerProps:r,label:n,onClick:o}){const a=Pg(),i=ye(a.store,e=>e.meta.errors[0]?.message),l=ye(a.store,e=>e.meta.isDefaultValue),s=ye(a.store,e=>e.meta.isTouched);return w(Wg,{label:n,inputRef:t,popupTriggerProps:r,isDefaultValue:l,isTouched:s,className:St["discrete-form-input"],additionalStyles:Hg,errorMessage:i,onClick:o,onBlur:a.handleBlur,children:e})}function Vg(e){((navigator.userAgent?navigator.userAgent.toLowerCase().includes("mac"):navigator.platform.toLowerCase().includes("mac"))?e.metaKey:e.ctrlKey)&&"Enter"===e.key&&(e.preventDefault(),e.currentTarget.requestSubmit())}function zg(e){"Escape"===e.key&&e.target instanceof HTMLElement&&e.target.blur()}function jg(e){"Enter"===e.key&&e.currentTarget.blur()}const Kg=Rt(St["amount-input"],Wt({body:"default"}),xt({outline:"none",border:"none",padding:0,backgroundColor:"transparent",flex:1,cursor:"pointer",width:"100%",_focus:{cursor:"text"}})),$g=Rt(null,xt({display:"flex",alignItems:"center",gap:"2px"}));function qg({value:e,onChange:t,inputRef:r,onClick:n,onBlur:o,autofocus:a=!1}){return E("div",{...$g,children:[w(ms,{children:"$"}),w(xe,{...Kg,getInputRef:r,thousandSeparator:!0,decimalScale:2,value:e,onValueChange:e=>{t(void 0===e.floatValue?null:e.floatValue)},fixedDecimalScale:!0,onClick:n,onBlur:o,onKeyDown:jg,autoFocus:a})]})}const Yg=xt({backgroundColor:"surface.foreground.disabled",pointerEvents:"none",border:"{borderWidths.lg} solid",borderColor:"border.layout.strong"}),Gg=Et({base:{backgroundColor:"surface.foreground",border:"{borderWidths.lg} solid",borderColor:"border.layout.strong"},variants:{kind:{text:{cursor:"text"},button:{cursor:"pointer"},container:{cursor:"default"}}}});function Qg({kind:e,label:t,children:r,inputRef:n,disabled:o,popupTriggerProps:a,onClick:i,disableHover:l=!1,type:s,maxLength:c}){const d=Pg(),u=ye(d.store,e=>e.meta.errors[0]?.message),h=ye(d.store,e=>e.meta.isTouched),p="string"==typeof d.state.value?d.state.value.length:0,g=ur(c)?c-p:void 0,m=o?Yg:Gg({kind:e});return w(Wg,{label:t,inputRef:n,popupTriggerProps:a,className:St["editable-form-input"],additionalStyles:m,errorMessage:u,onBlur:d.handleBlur,disableHover:l,onClick:i,type:s,isTouched:h,remainingChars:g,children:r})}const Xg=Rt(St["button-secondary"],xt({color:"typography.intent.primary",border:"{borderWidths.md} solid",borderColor:"border.intent.primary",backgroundColor:"surface.intent.primary","& .Tight-text":{color:"typography.intent.primary"},"& path":{stroke:"icon.intent.primary"},_supportHover:{_notDisabled:{backgroundColor:"surface.intent.primary.hover",borderColor:"border.intent.primary.hover","& .Tight-text":{color:"typography.intent.primary.hover"},"& path":{stroke:"icon.intent.primary.hover"}}},"&:active:enabled, &[data-active='true']:enabled":{backgroundColor:"surface.intent.primary.active",borderColor:"border.intent.primary.active","& .Tight-text":{color:"typography.intent.primary.active"},"& path":{stroke:"icon.intent.primary.active"}}}));function Zg({children:e,stylists:t=[],...r}){return w(zi,{stylists:[Xg,...t],...r,children:e})}const Jg=[Rt(null,xt({"& path":{stroke:"surface.foreground"}}))];function em({onClick:e}){return E(Zg,{size:"small",onClick:t=>{t.stopPropagation(),t.preventDefault(),e()},children:[w(ga,{stylists:Jg,Component:Eh}),w(ro,{intent:"primary",children:"Add Split"})]})}const tm=Rt(null,xt({display:"flex",flexDirection:"row",alignItems:"center",gap:"10px",outline:"none",border:"none",background:"none",height:"39px",padding:0})),rm=Rt(null,xt({display:"flex",flexDirection:"column",maxHeight:"200px",overflowY:"auto",minWidth:"120px"}));function nm({options:e,onSelect:t,selectedLabel:r}){const n=gl();return w("div",{...rm,children:e.map(e=>w(Sl,{onClick:()=>{return r=Number(e.value),n?.setOpen(!1),void t(r);var r},active:r===e.label,children:e.label},e.value))})}const om=Rt(null,xt({cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px",borderRadius:"sm",gap:"7px",backgroundColor:"surface.intent.action.discrete",border:"{borderWidths.lg} solid transparent",_supportHover:{backgroundColor:"surface.intent.action.discrete.hover",border:"{borderWidths.lg} solid",borderColor:"border.intent.action.hover"}}),ca);function am({selectedLabel:e,options:t,onSelect:r}){return E(pl,{placement:"bottom-start",children:[w(ml,{children:t=>E("div",{...om,...t,children:[w(eo,{children:e}),w(bl,{Component:dp})]})}),w(El,{children:w(nm,{options:t,onSelect:r,selectedLabel:e})})]})}const im=Rt(null,xt({display:"flex",alignItems:"center",gap:"15px"})),lm=Qt.map((e,t)=>({value:t,label:e})),sm=Xt({}).map(e=>({value:e,label:String(e)}));function cm({currentMonthYear:e,onMonthYearChange:t}){const r=e.getFullYear(),n=e.getMonth(),o=(e,r)=>{const n=new Date(e,r,1);t(n)};return E("div",{...im,children:[w(am,{selectedLabel:Qt[n],options:lm,onSelect:e=>o(r,e)}),w(am,{selectedLabel:String(r),options:sm,onSelect:e=>o(e,n)})]})}const dm=Rt(null,xt({background:"surface.foreground",padding:"25px",gap:"15px"})),um=Rt(null,xt({display:"flex",justifyContent:"space-between",alignItems:"center",gap:"8px",alignSelf:"stretch",marginBottom:"30px"})),hm=Rt(null,xt({backgroundColor:"surface.intent.action.discrete",border:"{borderWidths.lg} solid transparent",padding:"8px",borderRadius:"sm",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",_supportHover:{backgroundColor:"surface.intent.action.discrete.hover",border:"{borderWidths.lg} solid",borderColor:"border.intent.action.hover"},"&:disabled":{opacity:.6,pointerEvents:"none"}}),ca),pm=Rt(null,xt({display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:"2px 2px"})),gm=Rt(null,xt({padding:"8px",textAlign:"center"})),mm=Rt(null,xt({backgroundColor:"surface.intent.action.discrete",border:"{borderWidths.lg} solid transparent",padding:"6px",width:"36px",height:"36px",position:"relative",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"sm",cursor:"pointer",_supportHover:{_notDisabled:{backgroundColor:"surface.intent.action.discrete.hover",border:"{borderWidths.lg} solid",borderColor:"border.intent.action.hover"}},"&[data-selected='true']":{backgroundColor:"surface.intent.action.discrete.active",border:"{borderWidths.lg} solid",borderColor:"border.intent.action.active"},"&[data-today='true']::after":{content:"''",position:"absolute",bottom:"3px",width:"4px",height:"4px",borderRadius:"50%",backgroundColor:"brand.primary"},"&:disabled":{cursor:"default"}}),ca),vm=Rt(null,xt({color:"typography.base"}));function bm({date:e,selectedDate:t,currentMonth:r,onClick:n,maxDate:o}){const a=t&&Zt(e,t),i=Jt(e),l=e.getMonth()!==r,s=!!o&&er(e,o);return w("button",{...mm,onClick:()=>n(e),"data-selected":a,"data-today":i,disabled:s,children:w(eo,{stylists:l||s?[vm]:[],children:e.getDate().toString()})})}function fm({selectedDate:e,onDateSelect:t,viewDate:r,onViewDateChange:n,maxDate:o}){const a=gl(),i=r||/* @__PURE__ */new Date,l=i.getFullYear(),s=i.getMonth(),c=function(e,t){const r=zt(e,t,1),n=new Date(r);return n.setDate(n.getDate()-r.getDay()),Array.from({length:42},(e,t)=>{const r=new Date(n);return r.setDate(n.getDate()+t),r})}(l,s),d=Pe(c),u=void 0===o||d&&er(o,d),h=e=>{t(e),a.setOpen(!1)},p=e=>{const t=new Date(i);t.setMonth(i.getMonth()+e),n(t)};return E("div",{...dm,children:[E("div",{...um,children:[w("button",{...hm,onClick:()=>p(-1),children:w(ga,{Component:la})}),w(cm,{currentMonthYear:i,onMonthYearChange:n}),w("button",{...hm,onClick:()=>p(1),disabled:!u,children:w(ga,{Component:sa})})]}),E("div",{...pm,children:[Gt.map(e=>w("div",{...gm,children:w(ro,{children:e})},e)),c.map(t=>w(bm,{date:t,selectedDate:e,currentMonth:s,onClick:h,maxDate:o},t.toISOString()))]})]})}const ym=Rt(null,Wt({body:"default"}),xt({outline:"none",border:"none",padding:0,backgroundColor:"transparent",flex:1,cursor:"pointer","&:focus":{cursor:"text"}})),Tm=Rt(null,Wt({body:"default"}),xt({outline:"none",border:"none",padding:0,backgroundColor:"transparent",cursor:"text",overflowWrap:"break-word",minWidth:"100%",maxWidth:"100%","&::placeholder":{color:"typography.base.weak"},"&:focus":{outline:"none"}})),xm=s.object({message:s.string().refine(e=>""!==e,{message:"Required"})});function km(e){null!==e.current&&(e.current.scrollIntoView({behavior:"instant"}),e.current.setAttribute("data-hasscrolled","true"))}const wm=xt.raw({maxHeight:150,maxWidth:"100%",whiteSpace:"pre-wrap",overflowWrap:"break-word",width:"100%",boxSizing:"border-box",margin:0,padding:0,fontFamily:"body"}),Cm=xt.raw({visibility:"hidden",fontSizeAdjust:"none",fontSize:"100%",fontStyle:"normal",letterSpacing:"normal",fontStretch:"normal",fontVariant:"normal",fontWeight:"normal",textAlign:"left",textAlignLast:"initial",textDecoration:"none",textEmphasis:"none",textIndent:"0px",textJustify:"auto",textShadow:"none",textTransform:"none"}),Em=xt(Cm,wm),Im=xt.raw({resize:"none",inset:0,outline:"none",overflow:"auto",position:"absolute",appearance:"none",border:"none",backgroundColor:"transparent",fontSize:"16px"}),Sm=xt(Im,wm,Wt.raw({body:"default"})),Am=xt({display:"block",width:"100%"}),Nm=xt({position:"relative"}),Pm=xt({display:"flex",justifyContent:"flex-end"}),Mm=xt({paddingInline:"8px",display:"flex",alignItems:"start",justifyContent:"center"}),Dm=y(function({blockSubmit:e=!1,scrollRef:t,setActiveKeyboard:r},n){const o=Pg(),a=d(null),{startCallback:i}=Oa({delay:50,callback:e=>r(e)});k(n,()=>a.current);const l=!e&&xm.safeParse(o.form.state.values).success;return w(Qg,{kind:"text",inputRef:a,disableHover:!0,onClick:()=>(km(t),void i(!0)),children:E("div",{className:Am,children:[E("div",{className:Nm,children:[E("pre",{className:Em,children:[o.state.value,w("br",{})]}),w("textarea",{ref:a,placeholder:"Message...",value:o.state.value,className:Sm,onChange:e=>o.handleChange(e.target.value)})]}),w("div",{className:Pm,children:w(Ki,{disabled:!l,type:"submit",children:w("span",{className:Mm,children:w(Qc,{Component:as})})})})]})})}),Rm=Rt(St["category-text"],xt({display:"flex",flexDirection:"row",alignItems:"center",gap:"10px",padding:0,outline:"none",border:"none",background:"none",borderRadius:"md",color:"typography.intent.action",flex:"1 1 0",minWidth:0,cursor:"pointer",_supportHover:{color:"typography.intent.action.hover"},"&:focus-visible":{outline:"4px solid",outlineOffset:"2px",outlineColor:"border.layout"},"& .Tight-medium-icon > path":{_supportHover:{stroke:"typography.intent.action.hover"}}}),ua),Om=Rt(null,xt({color:"inherit"})),_m=Rt(St["amount-input-container"],xt({borderRadius:"md",border:"none",background:"transparent",color:"typography.intent.action",maxWidth:"120px","&:not(:focus-within)":{_supportHover:{color:"typography.intent.action.hover"}},"& .Tight-amount-input, & .Tight-text":{color:"inherit"},"&[data-clicked='true']:focus-within":{outline:"1px solid",outlineOffset:"2px",outlineColor:"border.layout.strong"},"&[data-clicked='false']:has(:focus-visible)":{outline:"4px solid",outlineOffset:"2px",outlineColor:"border.layout"}}),ua),Lm=e=>"MANUAL_ENTRY"===e.apiName||"CSV_IMPORT"===e.apiName,Fm=e=>{const t=e?.description;return`${t} | ${Yn(Number(e?.amount),{dollarSign:!0})} | ${tr(or(e?.date||""))}`},Bm=({bankAccounts:e,onClick:t,isFilling:r})=>{const n=gl();return w(El,{children:w(pu,{children:r?w(xu,{}):e?.map(e=>w(vu,{onClick:()=>{return r=e,void 0!==t&&t(r),void n.setOpen(!1);var r},children:w(eo,{wrap:"wrap",children:Mh(e?.apiAccountName,e?.apiAccountNo)})},e?.id))})})};function Wm({onClick:e}){const{query:{data:t},isFilling:r}=Ic(),n=t?.data?.filter(e=>e.glAccountId&&"ACTIVE"===e.status&&e.isSupported);return w(Bm,{bankAccounts:n,isFilling:r,onClick:e})}const Hm=Rt(null,xt({display:"flex",flexDirection:"row",alignItems:"center",gap:"10px",outline:"none",border:"none",background:"none",padding:0,cursor:"pointer"}));function Um({label:e,disabled:t,bankAccount:r,onClick:n}){return E(pl,{placement:"bottom-start",children:[w(ml,{children:n=>w(Qg,{label:e,popupTriggerProps:n,disabled:t,children:w("button",{...Hm,type:"button",disabled:t,children:w(eo,{children:Mh(r?.apiAccountName,r?.apiAccountNo)})})})}),w(Wm,{onClick:n})]})}const Vm=Rt(null,xt({display:"flex",flexDirection:"row",alignItems:"center",gap:"10px",outline:"none",border:"none",background:"none",height:"39px",padding:0,cursor:"pointer"})),zm={filter:{type:{in:["BANK_TRANSFER"]}}},jm=Rt(null,xt({whiteSpace:"normal"}));function Km({onClick:e,transactionId:t}){const{query:{data:r},isFilling:n}=mi(zm),o=r?.data?.filter(e=>e.id!==t),a=gl();return w(El,{children:w(pu,{children:n?w(xu,{}):o?.map(t=>w(vu,{onClick:()=>(e(t),void a?.setOpen(!1)),children:w(eo,{stylists:[jm],children:Fm(t)})},t.id))})})}const $m=Rt(null,xt({display:"flex",flexDirection:"row",alignItems:"center",gap:"10px",outline:"none",border:"none",background:"none",padding:0,cursor:"pointer"})),qm=Rt(null,xt({color:"typography.base.weak"})),Ym=Rt(null,xt({display:"grid",textWrap:"nowrap"}));function Gm({children:e,rows:t,cols:r}){return w("div",{...Ym,style:{gridTemplateColumns:`repeat(${r}, 1fr)`,gridTemplateRows:`repeat(${t}, 1fr)`},children:e})}const Qm=Et({base:{minWidth:0,borderRadius:"zero",_focus:{zIndex:1}},variants:{width:{full:{width:"100%"}},backgroundColor:{foreground:{backgroundColor:"surface.foreground"}}}});function Xm({option:e,handleClick:t,selected:r,width:n,backgroundColor:o}){const a=wt(Qm({width:n,backgroundColor:o}),_i,Ri,Oi,ca);return void 0===e?null:w("button",{type:"button",className:a,onClick:()=>t(e),"data-active":r?.value===e.value,children:w(Ji,{wrap:"wrap",alignment:"center",children:e.label})})}function Zm({options:e,handleClick:t,selected:r,rows:n,cols:o}){return w(Gm,{rows:n,cols:o,children:e?.map(e=>w(Xm,{option:e,handleClick:t,selected:r},e.value))})}function Jm({options:e}){const t=gl(),r=Pg();return w(El,{children:w(pu,{children:e.map(e=>w(vu,{onClick:()=>{r.handleChange(e.value),r.handleBlur(),t.setOpen(!1)},children:w(Ji,{children:e.label})},e.value))})})}const ev=Rt(null,xt({display:"flex",flexDirection:"row",alignItems:"center",gap:"10px",outline:"none",border:"none",background:"none",padding:0,cursor:"pointer"})),tv=Rt(null,xt({color:"typography.base.weak"})),rv=(e,t)=>{const r=e.find(e=>e.value===t);return r?.label},nv=xt({border:"none",outline:"none",backgroundColor:"transparent",fontWeight:"label.strong",fontSize:{sm:"label.strong",base:"lg"},fontFamily:"label",color:"typography.label.strong",lineHeight:{sm:"16px",base:"18px"},letterSpacing:"0.84px"}),{useAppForm:ov,withForm:av}=Te({formContext:Ag,fieldContext:Ng,formComponents:{SaveButton:Dg},fieldComponents:{DiscreteAmountField:function({label:e}){const t=d(null),r=Pg();return w(Ug,{inputRef:t,label:e,children:w(qg,{value:r.state.value,onChange:r.handleChange,inputRef:t})})},EditableAmountField:function({label:e,autofocus:t=!1}){const r=d(null),n=Pg();return w(Qg,{inputRef:r,label:e,children:w(qg,{value:n.state.value,onChange:n.handleChange,inputRef:r,autofocus:t})})},ExpenseCategoryField:function({category:e,onClick:t,childrenField:r,totalAmount:n,glAccount:o}){const a=()=>{const t=Math.floor(n/2*100)/100,a=n-t;r?.pushValue({amount:t,category:e,classSegments:[],glAccount:o}),r?.pushValue({amount:a,category:e,classSegments:[],glAccount:o})};return E(pl,{placement:"bottom-start",children:[w(ml,{children:t=>E(Qg,{label:"Category",popupTriggerProps:t,children:[E("button",{...tm,type:"button",children:[w(Qc,{Component:wh(e?.name)}),w(eo,{children:e?.name||"Uncategorized"})]}),r&&w(em,{onClick:a})]})}),w(gh,{onClick:t})]})},DateInput:function({label:e,maxDate:t,autofocus:r=!1,editable:n=!1}){const o=Pg(),a=ye(o.store,e=>e.meta.isDefaultValue),i=d(null),[l,s]=m(()=>o.state.value?or(o.state.value):/* @__PURE__ */new Date),c=o.state.value?or(o.state.value):null,[u,h]=m(""),p=e=>{const r=function(e){const t=e.replace(/\D/g,"");return t.length<=2?t:t.length<=4?`${t.slice(0,2)}/${t.slice(2)}`:`${t.slice(0,2)}/${t.slice(2,4)}/${t.slice(4,8)}`}(e.target.value);h(r);const n=nr(r);if(n){const e=t?er(a=n,i=t)?i:a:n;o.handleChange(ar(e)),s(e)}else o.handleChange("");var a,i},g=u||(c?tr(c):""),[v,b]=m(!1),f=e=>{v&&(()=>{if(t&&c&&!a){const e=nr(u);e&&er(e,t)&&h(tr(c))}})(),b(e)},y=e=>{"Enter"===e.key&&(e.preventDefault(),f(!v))},T=n?Qg:Ug;return E(pl,{placement:"bottom-start",onOpenChange:f,open:v,children:[w(ml,{children:t=>w(T,{label:e,inputRef:i,popupTriggerProps:t,onClick:()=>b(!0),children:w("input",{...ym,ref:i,type:"text",id:o.name,value:g,onChange:p,placeholder:"MM/DD/YYYY",maxLength:10,autoFocus:r,onKeyDown:y,autoComplete:"off"})})}),w(El,{initialFocus:!1,children:w(fm,{selectedDate:c,onDateSelect:e=>{o.handleChange(ar(e)),h(tr(e)),s(e)},viewDate:l,onViewDateChange:s,maxDate:t})})]})},TextAreaInput:function({label:e,placeholder:t,autofocus:r=!1,resizeable:n=!0}){const o=Pg(),a=d(null);return w(Qg,{label:e,inputRef:a,children:w("textarea",{...Tm,ref:a,value:o.state.value||"",onChange:e=>o.handleChange(e.target.value),placeholder:t??"Add note...",rows:4,style:{resize:n?"both":"none"},autoFocus:r})})},MessageAreaInput:Dm,SplitExpenseCategoryField:function({value:e,onChange:t}){return E(pl,{placement:"bottom-start",children:[w(ml,{children:t=>E("button",{...Rm,...t,type:"button",children:[w(Qc,{Component:wh(e?.name)}),w(eo,{stylists:[Om],children:e?.name||"Uncategorized"})]})}),w(gh,{onClick:t})]})},SplitExpenseAmountField:function({value:e,onChange:t,onBlur:r}){const[n,o]=m(!1);return w("div",{..._m,"data-clicked":n,children:w(qg,{value:e,onChange:t,onClick:()=>o(!0),onBlur:()=>(o(!1),void r())})})},BankAccountField:function({transaction:e}){const{state:{value:t},handleChange:r}=Pg(),n=Sc(t.id),o=dr(e)||!Lm(e);return w(Um,{label:"Bank Account",disabled:o,onClick:e=>{var t;r({id:(t=e).id,name:t.apiAccountName})},bankAccount:n})},GlAccountField:function(){const e=Pg(),t=e.state.value;return E(pl,{placement:"bottom-start",children:[w(ml,{children:e=>w(Qg,{label:"Account",popupTriggerProps:e,children:w("button",{...Vm,type:"button",children:w(eo,{children:nu(t.accountNo,t.name)})})})}),w(qu,{onClick:t=>{const r=Cu(t);e.handleChange(r)},types:ku})]})},BankGlAccountField:function({transaction:e}){const{state:{value:t},handleChange:r}=Pg(),{query:{data:n}}=Au(),{query:{data:o}}=function(e){return Ic({select:t=>((e,t)=>{const r=Number(t.split("_")[1]);return e?.find(e=>Number(e.glAccountId)===r)})(t.data,e)})}(t?.id),a=e?Dh(e.amount):"";return w(Um,{label:a,onClick:e=>{const t=(o=n,a=e,o?.flatMap(e=>[e,...e.children??[]]).find(e=>Number(e.id?.split("_")[1])===a.glAccountId));var o,a;t&&r(Cu(t))},bankAccount:o})},MatchingBankTransferField:function({transaction:e}){const t=Pg(),r=t.state.value,n=r?Fm(r):"Select",o=r?[]:[qm];return E(pl,{placement:"bottom-start",children:[w(ml,{children:e=>w(Qg,{label:"Matching Bank Transfer",popupTriggerProps:e,children:w("button",{...$m,children:w(eo,{stylists:o,children:n})})})}),w(Km,{onClick:e=>{const r={id:(n=e).id,description:n?.description,amount:n?.amount,date:n?.date,bankAccountId:n?.bankAccount?.id,apiName:n?.apiName};var n;t.handleChange(r),t.handleBlur()},transactionId:e?.id})]})},ButtonGroupField:function({label:e,options:t}){const r=Pg(),n=t.find(e=>e.value===r.state.value);return w(Qg,{label:e,disableHover:!0,children:w(Zm,{options:t,selected:n,handleClick:e=>{r.handleChange(e.value.toString())},rows:1,cols:t.length})})},ButtonGrid:Zm,GenericSelectorField:function({options:e,label:t,disabled:r}){const n=Pg();return E(pl,{placement:"bottom-start",children:[w(ml,{children:o=>w(Qg,{label:t,popupTriggerProps:o,disabled:r,children:w("button",{...ev,type:"button",children:n.state.value?w(eo,{children:rv(e,n.state.value)}):w(eo,{stylists:[tv],children:`Select ${t}...`})})})}),w(Jm,{options:e})]})},TextField:function({label:e,type:t="text",maxLength:r,disabled:n,placeholder:o="Enter value..."}){const a=Pg(),i=d(null);return w(Qg,{label:e,disabled:n,inputRef:i,kind:"text",type:t,maxLength:r,children:w("input",{className:nv,value:a.state.value,onChange:e=>a.handleChange(e.target.value),type:t,maxLength:r,ref:i,placeholder:o})})}}}),iv=s.object({amount:s.number({message:"Required"}).refine(e=>0!==e,{message:"Amount must not be 0"}),date:s.string("Required").refine(e=>(function(e,t){const r=zt(e.getFullYear(),e.getMonth(),e.getDate()),n=zt(t.getFullYear(),t.getMonth(),t.getDate());return r.getTime()<n.getTime()}(new Date(e),/* @__PURE__ */new Date)||Zt(new Date(e),/* @__PURE__ */new Date))&&er(new Date(e),/* @__PURE__ */new Date("2000-01-01")),{message:"Invalid date"}),category:s.object({id:s.string(),name:s.string().optional()},{message:"Required"}).nullable(),classSegments:s.array(s.object({id:s.string(),name:s.string().optional()})),bankAccount:s.object({id:s.string(),name:s.string().optional()},{message:"Required"}),glAccount:s.object({id:s.string(),name:s.string().optional(),accountNo:s.string().optional()},{message:"Required"}),notes:s.string().nullable(),children:s.array(s.object({amount:s.number().refine(e=>0!==e,{message:"Child expense amounts must not be 0"}),category:s.object({id:s.string(),name:s.string().optional()},{message:"Required"}),glAccount:s.object({id:s.string()},{message:"Required"}),classSegments:s.array(s.object({id:s.string(),name:s.string().optional()}))}))}),lv=iv.extend({}).check(e=>{const t=e.value?.children?.reduce((e,t)=>e+t.amount,0);i(e.value?.children)||t===e.value.amount||e.issues.push({code:"custom",message:"Sum of children amounts must equal total amount",input:e.value,path:["children"]})}),sv=iv.extend({matchingBankTransaction:s.object({id:s.string(),description:s.string().optional(),amount:s.number().optional(),date:s.string().optional(),bankAccountId:s.string().optional(),apiName:s.enum({BOX:"BOX",CLOVER:"CLOVER",STRIPE:"STRIPE",PLAID:"PLAID",KNOX:"KNOX",UBER:"UBER",FRESHBOOKS:"FRESHBOOKS",HARVEST:"HARVEST",KW:"KW",FRESHBOOKS2:"FRESHBOOKS2",CAPITAL_ONE:"CAPITAL_ONE",SQUARE:"SQUARE",DOTLOOP:"DOTLOOP",REALOGY:"REALOGY",UPWORK:"UPWORK",SHOPIFY:"SHOPIFY",DEDUCTR:"DEDUCTR",ENTERPRISE:"ENTERPRISE",MOXIWORKS:"MOXIWORKS",APPDIRECT:"APPDIRECT",LONEWOLF:"LONEWOLF",LONEWOLF_TRANSACTIONDESK:"LONEWOLF_TRANSACTIONDESK",SAMPLE_BANK:"SAMPLE_BANK",TAXBOT:"TAXBOT",GUSTO:"GUSTO",XERO:"XERO",UNIT:"UNIT",MOOV:"MOOV",QBO:"QBO",QUALPAY:"QUALPAY",BENCH:"BENCH",PARTNER_IMPLEMENTATION:"PARTNER_IMPLEMENTATION",CHECK:"CHECK",RUTTER:"RUTTER",WAVE:"WAVE",MANUAL_ENTRY:"MANUAL_ENTRY",CSV_IMPORT:"CSV_IMPORT"}).optional()}).nullish()}).refine(e=>{const t=e.matchingBankTransaction?.amount,r=e.amount;return!!dr(t)||t===r},{message:"Transfer amount must equal the matching bank transaction amount",path:["matchingBankTransaction"],when:e=>sv.pick({amount:!0,matchingBankTransaction:!0}).safeParse(e.value).success}),cv=iv.extend({}),dv=[{value:"FEDERAL",label:"Federal"},{value:"STATE",label:"State"},{value:"SALES",label:"Sales"}],uv=[{value:"Q1",label:"Q1"},{value:"Q2",label:"Q2"},{value:"Q3",label:"Q3"},{value:"Q4",label:"Q4"}],hv=["FEDERAL","STATE","SALES"],pv=["Q1","Q2","Q3","Q4"],gv=iv.extend({tax:s.object({paymentInfo:s.object({region:s.enum(hv,{message:`Tax region must be one of: ${hv.join(", ")}`}),quarter:s.enum(pv,{message:`Tax quarter must be one of: ${pv.join(", ")}`}),year:s.number({message:"Tax year is required"})}).nullable()})}).superRefine((e,t)=>{e.tax?.paymentInfo||(t.addIssue({path:["tax","paymentInfo","region"],code:"custom",message:`Tax region must be one of: ${hv.join(", ")}`}),t.addIssue({path:["tax","paymentInfo","quarter"],code:"custom",message:`Tax quarter must be one of: ${pv.join(", ")}`}),t.addIssue({path:["tax","paymentInfo","year"],code:"custom",message:"Tax year is required"}))}),mv={amount:null,category:{id:"",name:""},bankAccount:{id:"",name:""},glAccount:{id:"",name:"",accountNo:""},date:"",notes:null,classSegments:[],children:[],matchingBankTransaction:{id:"",description:"",amount:0,date:"",bankAccountId:"",apiName:void 0},tax:{paymentInfo:null}};function vv(e){const{mutate:t}=Zu(),r=e?{amount:Xd((o=e).amount),category:o.category,date:o.date,bankAccount:o.bankAccount,glAccount:o.glAccount,notes:o.notes,classSegments:o.classSegments,children:o.children.map(e=>({amount:Xd(e.amount),category:e.category,glAccount:e.glAccount,classSegments:e.classSegments})),matchingBankTransaction:o.matchingBankTransaction,tax:o.tax}:mv,n=e?function(e){switch(e.type){case"EXPENSE":return lv;case"BANK_TRANSFER":return sv;case"REVENUE":return cv;case"TAX_PAYMENT":return gv;default:return}}(e):void 0;var o;return ov({defaultValues:r,validators:{onBlur:n},onSubmit:r=>{var n;e&&(t({id:e.id,amount:(n=r.value).amount?Zd(n.amount):0,categoryId:n.category?.id,bankAccountId:n.bankAccount.id,glAccountId:n.glAccount?.id,date:n.date,notes:n.notes,classSegmentIds:n.classSegments.map(e=>e.id),children:n.children.map(e=>({amount:e.amount?Zd(e.amount):0,categoryId:e.category?.id,glAccountId:e.glAccount?.id,classSegmentIds:n.classSegments.map(e=>e.id)})),matchingBankTransactionId:n.matchingBankTransaction?.id,tax:n.tax}),r.formApi.reset(r.value,{keepDefaultValues:!0}))},onSubmitInvalid:()=>{}})}const bv=ia(e=>c.createElement("svg",{width:16,height:16,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("path",{d:"M10.6196 14.2124H4.3803C4.06894 14.2128 3.7693 14.0937 3.54327 13.8795C3.31724 13.6654 3.18207 13.3726 3.16568 13.0617L2.61591 3.22968H12.384L11.8342 13.0617C11.8179 13.3726 11.6827 13.6654 11.4567 13.8795C11.2306 14.0937 10.931 14.2128 10.6196 14.2124Z",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M1.3949 3.22968H13.605",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M6.27894 0.787598H8.72097C9.0448 0.787598 9.35537 0.91624 9.58435 1.14522C9.81334 1.37421 9.94198 1.68478 9.94198 2.00861V3.22963H5.05792V2.00861C5.05792 1.68478 5.18656 1.37421 5.41555 1.14522C5.64453 0.91624 5.9551 0.787598 6.27894 0.787598Z",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M9.09821 5.05792V12.384",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M5.90167 5.05792V12.384",stroke:"#182428",strokeMiterlimit:10})),"Delete"),fv=Rt(null,xt({position:"relative",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",outline:"none",border:"none",background:"none",padding:"15px 0px",gap:"15px",width:"100%"})),yv=Rt(null,xt({backgroundColor:"border.layout",height:"25px",width:"1px",margin:0})),Tv=Rt(null,xt({backgroundColor:"border.layout",height:"1px",width:"100%"})),xv=Rt(null,xt({background:"none",border:"none",outline:"none",marginLeft:"auto",display:"flex",alignItems:"center",justifyContent:"center",padding:"4px",borderRadius:"md",cursor:"pointer","&:focus-visible":{outline:"4px solid",outlineColor:"border.layout"},"&:hover":{"& svg":{"& path":{stroke:"icon.accent.danger"}}}}),ha),kv=Rt(null,xt({display:"flex",flexDirection:"row",alignItems:"center",gap:"15px"})),wv=av({defaultValues:mv,props:{index:0,numRows:1,removeSplit:()=>{}},render:function({form:e,index:t,numRows:r,removeSplit:n}){return E(C,{children:[E("div",{...fv,children:[w(e.AppField,{name:`children[${t}].category`,children:e=>w(e.SplitExpenseCategoryField,{value:e.state.value,onChange:e.handleChange})}),E("div",{...kv,children:[w("div",{...yv}),w(e.AppField,{name:`children[${t}].amount`,children:e=>w(e.SplitExpenseAmountField,{value:e.state.value,onChange:e.handleChange,onBlur:e.handleBlur})}),w("button",{onClick:()=>n(t),...xv,children:w(Qc,{Component:bv})})]})]}),t<r-1&&w("div",{...Tv})]})}}),Cv=Rt(null,xt({display:"flex",flexDirection:"column",alignItems:"flex-start",outline:"none",border:"none",background:"none"})),Ev=xt({backgroundColor:"surface.foreground",border:"{borderWidths.lg} solid",borderRadius:"md",borderColor:"border.layout.strong",display:"flex",flexDirection:"column",padding:"12px 16px",cursor:"pointer",outline:"none"}),Iv=xt({borderColor:"border.intent.danger"}),Sv=av({defaultValues:mv,render:function({form:e}){const t=ye(e.store,e=>{const t=e.errors?.[0]??{},r=Object.values(t).flat().filter(e=>"object"==typeof e&&null!==e&&"message"in e);return r[0]?.message}),r=Rt(null,Ev,t?Iv:void 0);return E(C,{children:[E("div",{...r,children:[w(ro,{children:"Category"}),w(e.AppField,{name:"children",mode:"array",children:t=>{const r=r=>{t.removeValue(r),1===t.state.value.length&&(e.setFieldValue("category",t.state.value[0].category),t.removeValue(0)),e.validate("blur")};return E("div",{...Cv,children:[t.state.value.map((n,o)=>w(wv,{form:e,index:o,numRows:t.state.value.length,removeSplit:r},`${n?.category?.id}-${o}`)),w(em,{onClick:()=>{const e=Pe(t.state.value)?.category,r=Pe(t.state.value)?.classSegments,n=Pe(t.state.value)?.glAccount;t.pushValue({amount:0,category:e||{id:"",name:""},glAccount:n||{id:""},classSegments:r||[]})}})]})}})]}),t&&w(_g,{errorMessage:t})]})}}),Av=av({defaultValues:mv,render:function({form:e}){const t=ye(e.store,e=>e.values.amount)??0;return w(e.Subscribe,{selector:e=>e.values.children,children:r=>Array.isArray(r)&&0!==r.length?w(Sv,{form:e}):w(e.AppField,{name:"children",mode:"array",children:r=>w(e.AppField,{name:"category",children:n=>w(n.ExpenseCategoryField,{category:n.state.value,glAccount:e.state.values.glAccount,onClick:n.handleChange,childrenField:r,totalAmount:t})})})})}}),Nv=Rt(null,xt({position:"absolute",right:0,top:0,left:{base:0,sm:"auto"},bottom:{base:0,sm:"auto"},height:"100%",maxHeight:"100%",maxWidth:"100%",backgroundColor:"surface.background",width:{base:"100%",sm:"512px"},minWidth:{base:"100%",sm:"fit-content"},display:"flex",_focus:{outline:"none"}}));function Pv({children:e}){const t=d(null);return b(()=>{t.current?.focus()},[]),w("div",{ref:t,tabIndex:-1,...Nv,children:e})}const Mv=Rt(null,xt({display:"flex",backgroundColor:"surface.foreground",flexDirection:"column",height:"100%",maxHeight:"100%",overflowY:"auto",overflowX:"hidden",minWidth:"fit-content",borderLeft:"1px solid {colors.border.layout.strong}",justifyContent:"flex-start",alignItems:"center",padding:5,gap:"10px"}));function Dv({children:e}){return w("div",{tabIndex:-1,...Mv,children:e})}function Rv({active:e,icon:t,onClick:r,ariaLabel:n}){return w(Rl,{ariaLabel:n,onClick:r,active:e,children:w(os,{Component:t})})}const Ov=Rt(null,xt({display:"flex",height:"100%",maxHeight:"100%",minHeight:0,flexDirection:"column",minWidth:{base:"128px",sm:"512px"},maxWidth:{base:"100%",sm:"512px"},flexGrow:1,overflow:"hidden"}));function _v({children:e}){return w("div",{...Ov,children:e})}const Lv=Object.freeze({thumbs_up:"👍",thumbs_down:"👎",red_heart:"❤️",hundred_points:"💯",eyes:"👀"});function Fv(e){return void 0!==Lv[e]}function Bv(e){return Lv[e]}const Wv=ia(e=>c.createElement("svg",{id:"Layer_1","data-name":"Layer 1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",strokeWidth:1.5,width:24,height:24,...e},c.createElement("defs",null,c.createElement("style",null,".cls-63ce7444ea57ea6c838005ed-1{fill:none;stroke:currentColor;stroke-miterlimit:10;}")),c.createElement("path",{className:"cls-63ce7444ea57ea6c838005ed-1",d:"M6.27,21.55H8.5l2.33.95h7.92a2.86,2.86,0,0,0,2.85-2.59l.88-9.13c0-.14,0-.28,0-.42h0a2.18,2.18,0,0,0-2.18-2.18H15.63l.52-1.09a6.27,6.27,0,0,0,.62-2.73h0A2.86,2.86,0,0,0,13.91,1.5h0A1.9,1.9,0,0,0,12,3.41h0a6,6,0,0,1-1.25,3.66l-2.33,3H6.27"}),c.createElement("rect",{className:"cls-63ce7444ea57ea6c838005ed-1",x:1.5,y:9.14,width:4.77,height:13.36})),"ThumbsUp"),Hv=xt({fontSize:"26px",lineHeight:"26px",width:"26px",userSelect:"none"});function Uv({cldrShortName:e}){return w("div",{className:Hv,children:Bv(e)})}const Vv=Et({base:{padding:0,border:"none",outline:"none"},variants:{type:{sent:{cursor:"default"},received:{cursor:"pointer"}}}}),zv=xt({display:"flex",gap:"4px",backgroundColor:"surface.elevated",borderRadius:"sm",borderWidth:"sm",borderColor:"border.layout",borderStyle:"solid",padding:"4px 8px",alignItems:"center",justifyContent:"center",scrollbar:"hidden",overflow:"hidden"});function jv({reactions:e,type:t,handleClick:r}){return w("div",{className:zv,children:e.map((e,n)=>w("button",{className:Vv({type:t}),onClick:"received"===t?()=>r(e.emojiCode):void 0,children:w(Uv,{cldrShortName:e.emojiCode})},`${e.emojiCode}_${n}`))})}const Kv=async({data:e,accessToken:t,environment:r})=>{const{id:n,emojiCode:o}=e,a={path:"/v6/messages/{id}/reactions/{emojiCode}",pathParams:{id:n,emojiCode:o},accessToken:t,endpointManager:ea(r)};return await mn(a)},$v=async({data:e,accessToken:t,environment:r})=>{const{id:n,emojiCode:o}=e,a={path:"/v6/messages/{id}/reactions/{emojiCode}",pathParams:{id:n,emojiCode:o},accessToken:t,endpointManager:ea(r)};return await async function(e){return Us(e)}(a)};function qv(e,t,r){return sr(ki({id:e}),t,r)}async function Yv(e){const t=ki({id:e});return nn("mutation successful, invalidating messages queries"),fr.invalidateQueries({queryKey:t}).catch(e=>on({error:e,severity:"error"}))}function Gv(e,t,r){const n=[...e];return n[r]=t,n}const Qv=xt({backgroundColor:"surface.elevated",borderRadius:"sm",borderWidth:"sm",borderColor:"border.layout",borderStyle:"solid",display:"flex",justifyContent:"center",alignItems:"center",padding:"8px",cursor:"pointer"}),Xv=Object.keys(Lv).filter(Fv).map(e=>({emojiCode:e,authorInfo:[]}));function Zv({conversationId:e,messageId:t,type:r,reactions:n,reactionIsOpen:o,setReactionIsOpen:a}){const{userId:i}=p(Hl),{mutate:l}=function(e){const{userId:t,userEmail:r}=p(Hl);return Vs({mutationFn:Kv,onMutateFn:({data:n,accessToken:o,environment:a})=>{if(void 0!==t)return async function({data:e,accessToken:t,conversationId:r,environment:n,userId:o,userEmail:a}){const i=qv(r,t,n);await fr.cancelQueries({queryKey:i});const l=fr.getQueryData(i);return fr.setQueryData(i,t=>{const r=t.findIndex(t=>t.id===e.id);return-1===r?t:Gv(t,(n=t[r],i=e,l=o,s=a,{...n,reactions:[...n.reactions,{emojiCode:i.emojiCode,authorInfo:[{userId:l,email:s}]}]}),r);var n,i,l,s}),{oldMessages:l}}({data:n,accessToken:o,conversationId:e,environment:a,userId:t,userEmail:r})},onSettled:()=>Yv(e)})}(e);return E(pl,{placement:"top-end",open:o,onOpenChange:a,blockInteraction:!0,children:[w(ml,{children:e=>w("button",{className:Qv,...e,children:w(Qc,{Component:Wv})})}),w(El,{type:"reaction",children:w(jv,{reactions:Xv,type:r,handleClick:e=>{n.some(t=>{const r=t.emojiCode===e,n=t.authorInfo.some(e=>e.userId===i);return r&&n})||(l({id:t,emojiCode:e}),a(!1))}})})]})}const Jv=Et({base:{position:"absolute",bottom:"-25px"},variants:{type:{sent:{right:"2px"},received:{left:"2px"}}}});function eb({reactions:e,type:t,handleClick:r}){const n=Jv({type:t});return w("div",{className:n,children:w(jv,{reactions:e,handleClick:r,type:t})})}const tb=Et({base:{display:"flex",alignItems:"center",gap:"10px"},variants:{type:{sent:{flexDirection:"row-reverse"},received:{flexDirection:"row"}},hasReactionsOnMessage:{true:{marginBottom:"18px"}}}}),rb=Et({base:{position:"static",display:"flex",maxWidth:325,padding:"12px 16px",flexDirection:"column",alignItems:"flex-start",borderRadius:"md",borderWidth:1,borderStyle:"solid",flexShrink:1,overflow:"wrap",wordBreak:"break-word",whiteSpace:"pre-wrap"},variants:{type:{sent:{color:"typography.intent.primary",borderColor:"border.intent.primary",backgroundColor:"surface.intent.primary"},received:{color:"typography.base",borderColor:"border.layout",backgroundColor:"surface.foreground"}}}}),nb=xt({position:"relative",display:"flex",flexDirection:"column"});function ob({conversationId:e,messageId:t,sentByCurrentUser:r,children:n,reactions:o=[]}){const a=d(null),{isHover:i,setIsHover:l,reactionIsOpen:s,setReactionIsOpen:c}=function(e){const[t,r]=m(!1),[n,o]=m(!1);return b(()=>{if(null===a.current||!i||s)return;const e=a.current,t=t=>{t.target===e||e.contains(t.target)||l(!1)};return window.addEventListener("mousemove",t),()=>{window.removeEventListener("mousemove",t)}},[i=t,a=e,s=n,l=r]),{isHover:t,reactionIsOpen:n,setIsHover:r,setReactionIsOpen:o};var a,i,l,s}(a),{mutate:u}=function(e){const{userId:t}=p(Hl);return Vs({mutationFn:$v,onMutateFn:({data:r,accessToken:n,environment:o})=>{if(void 0!==t)return async function({data:e,accessToken:t,conversationId:r,environment:n,userId:o}){const a=qv(r,t,n);await fr.cancelQueries({queryKey:a});const i=fr.getQueryData(a);return fr.setQueryData(a,t=>{const r=t.findIndex(t=>t.id===e.id),n=t[r];return dr(n)||0===n.reactions.length?t:Gv(t,function(e,t,r){const n=e.reactions.filter(e=>e.emojiCode!==t||!e.authorInfo.some(e=>e.userId===r));return{...e,reactions:n}}(n,e.emojiCode,o),r)}),{oldMessages:i}}({data:r,accessToken:n,conversationId:e,environment:o,userId:t})},onSettled:()=>Yv(e)})}(e),h=r?"sent":"received",g=o.filter(e=>Fv(e.emojiCode)),v=g.length>0;return E("div",{className:tb({type:h,hasReactionsOnMessage:v}),ref:a,onMouseEnter:()=>"received"===h&&l(!0),children:[E("div",{className:nb,children:[w("div",{className:rb({type:h}),children:n}),v&&w(eb,{reactions:g,type:h,handleClick:e=>u({id:t,emojiCode:e})})]}),i&&w(Zv,{conversationId:e,messageId:t,type:h,reactions:g,reactionIsOpen:s,setReactionIsOpen:c})]})}const ab=Rt(null,xt({display:"flex",flexDirection:"column-reverse",justifyContent:"center",gap:"10px",alignSelf:"stretch"}));function ib({children:e}){return w("div",{...ab,children:e})}const lb=Rt(null,xt({display:"flex",flexDirection:"column-reverse",alignItems:"flex-start",gap:"26px",flex:"1 1 0%",alignSelf:"stretch",overflowY:"auto",overflowX:"hidden",flexFlow:"column",padding:15,scrollbarWidth:"thin",maxHeight:"calc(100% + 15px)",marginBottom:"-15px"})),sb=xt({minHeight:1,width:"100%"}),cb=y(function({children:e,activeKeyboard:t,setActiveKeyboard:r,inputRef:n},o){const a=d(null);t&&n?.current?.focus();const i=v(()=>{t&&ur(n?.current)&&(r(!1),n.current.blur())},[t,n,r]);return function(e,t,r){b(()=>{const n=e.current;if(null!==n){let e=n.scrollTop,o=Date.now();const a=()=>{if(t){const{scrollVelocity:t,currentScrollTop:a,currentTime:i}=function(e,t,r){const n=e.scrollTop,o=Date.now(),a=Math.abs(n-t),i=o-r;return{scrollVelocity:i>0?a/i:0,currentScrollTop:n,currentTime:o}}(n,e,o);t>5&&r(),e=a,o=i}};return n.addEventListener("scroll",a),()=>{n.removeEventListener("scroll",a)}}},[t,r,e])}(a,t,i),E("div",{tabIndex:-1,...lb,ref:a,children:[w("div",{className:sb,ref:o}),e]})}),db=Object.freeze({message:""}),ub=xt({width:"100%"});function hb({conversationId:e,addMessage:t,blockSubmit:r,isMobile:n,scrollRef:o,setActiveKeyboard:a,inputRef:i,defaultValues:l}){const{form:s}=function({onSubmit:e,defaultValues:t}){return{form:ov({defaultValues:t??db,onSubmit:t=>{xm.safeParse(t.value).success&&(e(t),t.formApi.reset())}})}}({onSubmit:t,defaultValues:l}),c=d(null);return w("form",{className:ub,ref:c,onKeyDown:e=>function(e,t,r,n){if(!n&&!e.shiftKey&&"Enter"===e.key&&(e.preventDefault(),e.stopPropagation(),null!==t&&!r)){const e=new SubmitEvent("submit",{bubbles:!0,cancelable:!0});t.dispatchEvent(e)}}(e,c.current,r,n),onSubmit:e=>{if(!r)return e.preventDefault(),e.stopPropagation(),s.handleSubmit()},children:w(s.AppField,{name:"message",children:e=>w(e.MessageAreaInput,{blockSubmit:r,scrollRef:o,setActiveKeyboard:a,ref:i})})})}function pb(e,t){return{id:`placeholder_${e.conversationId}_${Date.now()}`,conversationId:e.conversationId,author:{userId:t??"placeholderUserId",email:"placeholderEmail"},status:"ACTIVE",createdDateTime:"",lastUpdatedDateTime:"",text:e.text,reactions:[]}}async function gb(){const e=["conversations/messages"],t=["tasks"],r=["conversations"];return nn("mutation successful, invalidating messages queries"),Promise.all([fr.invalidateQueries({queryKey:e}),fr.invalidateQueries({queryKey:t}),fr.invalidateQueries({queryKey:r})]).catch(e=>on({error:e,severity:"error"}))}const mb=async({data:e,accessToken:t,environment:r})=>(async({data:e,accessToken:t,environment:r})=>ja({data:{data:e},accessToken:t,environment:r}))({data:[e],accessToken:t,environment:r}),vb=async({data:e,accessToken:t,environment:r})=>ja({data:{data:[e]},accessToken:t,environment:r}),bb=xt({minHeight:"{borderWidths.lg}",maxHeight:"{borderWidths.lg}",width:"100%",backgroundColor:"border.layout",flex:"1 1 0",display:"flex"}),fb=xt({display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",width:"100%",gap:5,paddingLeft:15,paddingRight:15}),yb=xt({wordBreak:"break-word",maxWidth:250,textAlign:"center"}),Tb="Marked As Resolved";function xb({resolver:e}){const t=e?`${e} ${Tb}`:Tb;return E("div",{className:fb,children:[w("div",{className:bb}),w("div",{className:yb,children:t}),w("div",{className:bb})]})}const kb=Et({variants:{width:{xs:{width:"30px"},sm:{width:"60px"},md:{width:"120px"},lg:{width:"240px"},xl:{width:"420px"}},height:{xs:{height:"5px"},sm:{height:"10px"},md:{height:"20px"},lg:{height:"40px"},xl:{height:"80px"}}}});function wb({width:e="md",height:t="md"}){return w(No,{styles:kb({width:e,height:t})})}const Cb=xt({display:"flex",flexDirection:"row-reverse"});function Eb(){return E(C,{children:[w(wb,{width:"lg",height:"lg"}),w("div",{className:Cb,children:w(wb,{width:"md",height:"lg"})}),w("div",{className:Cb,children:w(wb,{width:"lg",height:"xl"})}),w(wb,{width:"md",height:"lg"})]})}const Ib=xt({height:"100%",width:"100%",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",gap:"8px"});function Sb({isConversationLoading:e,isFilling:t,message:r}){return e?w(ib,{children:w(ob,{conversationId:"",messageId:"",sentByCurrentUser:!0,children:r})}):!e&&t?w(ib,{children:w(Eb,{})}):E("div",{className:Ib,children:[w(eo,{stylists:[Rt(null,xt({whiteSpace:"normal",textAlign:"center"}))],children:"Send your bookkeeper a message"}),w(Ji,{wrap:"wrap",alignment:"center",children:"Typical response time is within one business day"})]})}const Ab=Rt(null,xt({display:"flex",alignItems:"center",justifyContent:"center",maxWidth:"100%",minHeight:0,height:"auto",padding:"0 15px 15px",flexDirection:"column",position:"relative"}));function Nb({conversationId:e,setConversationId:t,isResolved:r,isUnread:n,isMobile:o=!1,attachedEntityId:a,defaultValues:i}){const{userId:l}=p(Hl),{mutate:s}=function(){const{userId:e}=p(Hl);return Vs({mutationFn:Ei,onMutateFn:({data:t,accessToken:r,environment:n})=>async function({data:e,accessToken:t,environment:r,userId:n}){const o=sr(ki({id:e.conversationId}),t,r);await fr.cancelQueries({queryKey:o});const a=fr.getQueryData(o);return fr.setQueryData(o,t=>[pb(e,n),...t]),{oldMessages:a}}({data:t,accessToken:r,environment:n,userId:e}),onSettled:gb})}(),{query:{data:c},isFilling:u}=function(e){const t=ur(e);return xr({queryKey:ki({id:e??""}),queryFn:Ci,select:wi,enabled:t})}(e),{mutate:h,isPending:g,variables:v}=(I=t,S=a,Vs({mutationFn:vb,onSuccess:e=>{const t=e.data?.[0]?.data?.id;if(dr(e)||dr(t))return;I(t);const r=["conversations"],n=["banks/transactions",{}],o=["summaries",{}];let a=async()=>{},i=async()=>{};if(ur(S)){const e={id:S};Ti(S,yi.BANK_TRANSACTION)?a=async()=>{const t=pi(e);return await fr.invalidateQueries({queryKey:t})}:Ti(S,yi.FINANCIAL_SUMMARY)&&(i=async()=>await fr.invalidateQueries({queryKey:o}))}return nn("mutation successful, invalidating conversation, bank transaction, financial summary, and message queries"),Promise.all([fr.invalidateQueries({queryKey:r}),fr.invalidateQueries({queryKey:n}),a(),i()]).catch(e=>on({error:e,severity:"error"}))}})),{mutate:f}=Vs({mutationFn:mb,onSuccess:async()=>{const e=["conversations"],t=["tasks"];return nn("mutation successful, invalidating conversations queries"),Promise.all([fr.invalidateQueries({queryKey:e}),fr.invalidateQueries({queryKey:t})]).catch(e=>on({error:e,severity:"error"}))}}),[y,T]=m(!1),x=d(null),k=d(null);var I,S;b(()=>{r&&n&&e&&f({id:e,readStatus:"READ"})},[r,n,e,f]),b(()=>{km(k)},[c,k]);const A=dr(e)||dr(c)||u;return E(C,{children:[A?w(cb,{ref:k,inputRef:x,activeKeyboard:y,setActiveKeyboard:T,children:w(Sb,{isConversationLoading:g,isFilling:u,message:v?.message?.text})}):E(cb,{ref:k,activeKeyboard:y,setActiveKeyboard:T,inputRef:x,children:[r&&w(xb,{resolver:"Conversation"}),c.map((t,r)=>{const n=t[0].author.userId===l;return w(ib,{children:t.map(t=>w(ob,{conversationId:e,messageId:t.id,sentByCurrentUser:n,reactions:t.reactions,children:t.text},t.id))},r)})]}),w("div",{...Ab,children:w(hb,{scrollRef:k,inputRef:x,conversationId:e,blockSubmit:g,isMobile:o,addMessage:({value:t})=>{if(dr(e)){const e=(r=t.message,n=a,{subject:r.slice(0,40),status:"ACTIVE",readStatus:"READ",resolutionStatus:"OPEN",...ur(n)&&{attachedEntityId:n},message:{text:r}});h(e)}else s({conversationId:e,text:t.message});var r,n},setActiveKeyboard:T,defaultValues:i})})]})}const Pb=Rt(St["drawer-header"],xt({display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",padding:"10px 25px 10px 15px",backgroundColor:"surface.foreground",height:"55px",minHeight:"55px"}));function Mb({children:e}){return E(C,{children:[w("div",{...Pb,children:e}),w(Ja,{alignment:"horizontal",color:"strong"})]})}function Db({conversationId:e,attachedEntityId:t}){const[r,n]=m(e),{query:{data:o}}=za(r),a="CLOSED"===o?.resolutionStatus;return E(_v,{children:[w(Mb,{}),w(Nb,{conversationId:r,setConversationId:n,isResolved:a,isUnread:"UNREAD"===o?.readStatus,attachedEntityId:t})]})}const Rb=Rt(St["form-body"],xt({display:"flex",flexDirection:"column",flex:1,padding:"15px",gap:"8px",overflow:"auto",width:"512px"}));function Ob({children:e}){return w("div",{...Rb,children:e})}const _b=Rt(null,xt({display:"flex",flexDirection:"row",maxHeight:"100%",overflow:"hidden",flexShrink:1,flexGrow:1})),Lb=Rt(null,xt({display:"flex",flexDirection:"column",flex:1,backgroundColor:"surface.background",maxHeight:"100%"})),Fb=xt({maxWidth:1,width:1,display:"flex",flexGrow:1,backgroundColor:"border.layout.strong"}),Bb=e=>{Vg(e),zg(e)},Wb=({children:e,onSubmit:t,Header:r,initialTab:n,conversationId:o,transactionId:a})=>{const[i,l]=m(n??null);return w(Pv,{children:E("div",{..._b,children:[w(_v,{children:E("form",{onSubmit:e=>{e.preventDefault(),t()},onKeyDown:Bb,...Lb,children:[r,w(Ob,{children:e})]})}),null!==i&&w("div",{className:Fb}),"conversation"===i&&w(Db,{conversationId:o,attachedEntityId:a}),w(Dv,{children:w(Rv,{active:"conversation"===i,onClick:()=>l("conversation"===i?null:"conversation"),icon:Ts,ariaLabel:"conversation-tab"})})]})})},Hb=Rt(null,xt({display:"flex",flexDirection:"column",margin:"0 0 7px 0",padding:0,justifyContent:"center",minHeight:"36px",backgroundColor:"surface.background",gap:"4px"}));function Ub({transaction:e,bankAccount:t}){const r=e?e.description:"",n=dr(t)||dr(e)?"":((e,t)=>{const r="BANK_TRANSFER"===t.type,n=Dh(t.amount);return`${r?`${n} `:""}${Mh(e.apiAccountName,e.apiAccountNo)}`})(t,e);return E("div",{...Hb,children:[w(eo,{wrap:"wrap",children:r}),t&&w(ro,{children:n})]})}const Vb=Rt(null,xt({display:"flex",backgroundColor:"surface.intent.action.discrete",border:"none",padding:"6px",margin:0,borderRadius:"sm",outline:"none",cursor:"pointer",_supportHover:{backgroundColor:"surface.intent.action.discrete.hover"},"&:focus-visible":{outline:"4px solid",outlineColor:"border.layout"}}),da);function zb({Icon:e=vl}={}){return w("button",{...Vb,onClick:()=>ci(),type:"button",children:w(Qc,{Component:e,...Vb})})}const jb=ia(e=>c.createElement("svg",{width:16,height:16,viewBox:"0 0 16 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("g",{clipPath:"url(#clip0_9779_2768)"},c.createElement("path",{d:"M2.70654 9.12132C3.60197 9.12132 4.32787 8.39543 4.32787 7.49999C4.32787 6.60456 3.60197 5.87866 2.70654 5.87866C1.8111 5.87866 1.08521 6.60456 1.08521 7.49999C1.08521 8.39543 1.8111 9.12132 2.70654 9.12132Z",fill:"currentColor"}),c.createElement("path",{d:"M8.32496 9.12132C9.22039 9.12132 9.94629 8.39543 9.94629 7.49999C9.94629 6.60456 9.22039 5.87866 8.32496 5.87866C7.42952 5.87866 6.70363 6.60456 6.70363 7.49999C6.70363 8.39543 7.42952 9.12132 8.32496 9.12132Z",fill:"currentColor"}),c.createElement("path",{d:"M13.9434 9.12132C14.8388 9.12132 15.5647 8.39543 15.5647 7.49999C15.5647 6.60456 14.8388 5.87866 13.9434 5.87866C13.048 5.87866 12.3221 6.60456 12.3221 7.49999C12.3221 8.39543 13.048 9.12132 13.9434 9.12132Z",fill:"currentColor"}))),"Dots");function Kb({children:e}){return E(pl,{placement:"bottom-start",children:[w(ml,{children:e=>w(Rl,{popupTriggerProps:e,children:w(ga,{Component:jb})})}),w(El,{children:e})]})}const $b="ACTIVE",qb="INACTIVE";function Yb({transaction:e}){const{mutate:t}=Xu(),r=()=>t([e].map(e=>({id:e.id,status:qb})));return w(vu,{onClick:()=>{return e=r,void ic({title:"Delete transaction",body:"Are you sure you want to delete this transaction?",buttons:[{key:Zs,label:"Cancel"},{key:Js,label:"Delete",type:ac}]}).then(t=>{t===Js&&e()});var e},children:w(eo,{children:"Delete"})})}function Gb({transaction:e}){const{mutate:t}=Xu();return w(vu,{onClick:()=>{t([e].map(e=>({id:e.id,status:$b})))},children:w(eo,{children:"Restore"})})}const Qb=Rt(null,xt({display:"flex",flexDirection:"row",alignItems:"center",gap:"15px",flexShrink:1}),On);function Xb({children:e}){return w("div",{...Qb,children:e})}const Zb=av({defaultValues:mv,props:{title:"Transaction",transaction:null},render:function({form:e,title:t,transaction:r}){return E(Mb,{children:[E(Xb,{children:[w(zb,{}),w(eo,{children:t}),w(Kb,{children:E(pu,{children:[r?.status===$b&&w(Yb,{transaction:r}),r?.status===qb&&w(Gb,{transaction:r})]})})]}),w(e.Subscribe,{selector:e=>e.isDefaultValue,children:t=>t?null:w(e.SaveButton,{})})]})}});function Jb({transactionId:e}){const{query:{data:t,isFetching:r},isFilling:n}=bi({id:e});return{transaction:t,form:vv(t),bankAccount:Sc(t?.bankAccount.id),showBankAccountField:!dr(t)&&Lm(t),isLoading:n||r&&!t}}function ef({transactionId:e,initialTab:t}){const{transaction:r,form:n,bankAccount:o,showBankAccountField:a,isLoading:i}=Jb({transactionId:e});if(i)return null;const l=w(Zb,{form:n,transaction:r,title:"Expense"}),s=r?.conversation?.id??null;return E(Wb,{onSubmit:n.handleSubmit,Header:l,initialTab:t,conversationId:s,transactionId:e,children:[r?.description&&w(Ub,{transaction:r,bankAccount:o}),w(n.AppField,{name:"amount",children:e=>w(e.DiscreteAmountField,{label:"Total"})}),w(n.AppField,{name:"date",children:e=>w(e.DateInput,{label:"Transaction Date",maxDate:/* @__PURE__ */new Date})}),w(Av,{form:n}),a&&w(n.AppField,{name:"bankAccount",children:e=>w(e.BankAccountField,{transaction:r})}),w(n.AppField,{name:"notes",children:e=>w(e.TextAreaInput,{label:"Note"})})]})}function tf({transactionId:e,initialTab:t}){const{transaction:r,form:n,bankAccount:o,isLoading:a}=Jb({transactionId:e});if(a)return null;const i=w(Zb,{form:n,transaction:r,title:"Bank Transfer"}),l=r?.conversation?.id??null;return E(Wb,{onSubmit:n.handleSubmit,Header:i,initialTab:t,conversationId:l,transactionId:e,children:[r?.description&&w(Ub,{transaction:r,bankAccount:o}),w(n.AppField,{name:"amount",children:e=>w(e.DiscreteAmountField,{label:"Total"})}),w(n.AppField,{name:"date",children:e=>w(e.DateInput,{label:"Transaction Date",maxDate:/* @__PURE__ */new Date})}),w(n.AppField,{name:"bankAccount",children:e=>w(e.BankAccountField,{transaction:r})}),w(n.AppField,{name:"glAccount",children:e=>w(e.BankGlAccountField,{transaction:r})}),w(n.AppField,{name:"matchingBankTransaction",children:e=>w(e.MatchingBankTransferField,{transaction:r})}),w(n.AppField,{name:"notes",children:e=>w(e.TextAreaInput,{label:"Note"})})]})}function rf({transactionId:e,initialTab:t}){const{transaction:r,form:n,bankAccount:o,showBankAccountField:a,isLoading:i}=Jb({transactionId:e});if(i)return null;const l=w(Zb,{form:n,transaction:r,title:"Income"}),s=r?.conversation?.id??null;return E(Wb,{onSubmit:n.handleSubmit,Header:l,initialTab:t,conversationId:s,transactionId:e,children:[r?.description&&w(Ub,{transaction:r,bankAccount:o}),w(n.AppField,{name:"amount",children:e=>w(e.DiscreteAmountField,{label:"Total"})}),w(n.AppField,{name:"date",children:e=>w(e.DateInput,{label:"Transaction Date",maxDate:/* @__PURE__ */new Date})}),w(n.AppField,{name:"glAccount",children:e=>w(e.GlAccountField,{})}),a&&w(n.AppField,{name:"bankAccount",children:e=>w(e.BankAccountField,{transaction:r})}),w(n.AppField,{name:"notes",children:e=>w(e.TextAreaInput,{label:"Note"})})]})}function nf({transactionId:e,initialTab:t}){const{transaction:r,form:n,bankAccount:o,showBankAccountField:a,isLoading:i}=Jb({transactionId:e});if(i)return null;const l=w(Zb,{form:n,transaction:r,title:"Tax Payment"}),s=r?.conversation?.id??null;return E(Wb,{Header:l,onSubmit:n.handleSubmit,initialTab:t,conversationId:s,transactionId:e,children:[r?.description&&w(Ub,{transaction:r,bankAccount:o}),w(n.AppField,{name:"amount",children:e=>w(e.DiscreteAmountField,{label:"Total"})}),w(n.AppField,{name:"date",children:e=>w(e.DateInput,{label:"Transaction Date",maxDate:/* @__PURE__ */new Date})}),w(n.AppField,{name:"tax.paymentInfo.region",children:e=>w(e.ButtonGroupField,{label:"Region",options:dv})}),w(n.AppField,{name:"tax.paymentInfo.quarter",children:e=>w(e.ButtonGroupField,{label:"Quarter",options:uv})}),w(n.AppField,{name:"tax.paymentInfo.year",children:e=>w(e.GenericSelectorField,{label:"Year",options:Xt({startYear:/* @__PURE__ */(new Date).getFullYear()+1}).map(e=>({value:e,label:String(e)}))})}),a&&w(n.AppField,{name:"bankAccount",children:e=>w(e.BankAccountField,{transaction:r})}),w(n.AppField,{name:"notes",children:e=>w(e.TextAreaInput,{label:"Note"})})]})}function of({transactionId:e,initialTab:t}){const{query:{data:r},isFilling:n}=bi({id:e});if(b(()=>{!n&&dr(r)&&ci()},[r,n]),dr(r))return null;switch(r.type){case"EXPENSE":return w(ef,{transactionId:e,initialTab:t});case"BANK_TRANSFER":return w(tf,{transactionId:e,initialTab:t});case"REVENUE":return w(rf,{transactionId:e,initialTab:t});case"TAX_PAYMENT":return w(nf,{transactionId:e,initialTab:t})}}const af={transform(e){const{justify:t,gap:r,...n}=e;return{display:"flex",alignItems:"center",justifyContent:t,gap:r,flexDirection:"column",...n}},defaultValues:{gap:"10px"}},lf=(e={})=>{const t=ht(af,e);return af.transform(t,ut)},sf=e=>xt(lf(e));sf.raw=lf;const cf={transform(e){const{justify:t,gap:r,...n}=e;return{display:"flex",alignItems:"center",justifyContent:t,gap:r,flexDirection:"row",...n}},defaultValues:{gap:"10px"}},df=(e={})=>{const t=ht(cf,e);return cf.transform(t,ut)},uf=e=>xt(df(e));function hf({subject:e,children:t}){return E(Mb,{children:[E(Xb,{children:[w(zb,{}),w(eo,{children:e})]}),w("div",{className:uf({alignItems:"center",gap:15}),children:t})]})}function pf({conversationId:e,defaultValues:t}){const[r,n]=m(e),{query:{data:o}}=za(r),a="CLOSED"===o?.resolutionStatus;return w(Pv,{children:E(_v,{children:[w(hf,{subject:o?.subject??"Conversation"}),w(Nb,{conversationId:r,setConversationId:n,isResolved:a,isUnread:"UNREAD"===o?.readStatus,defaultValues:t})]})})}uf.raw=df;const gf=ia(e=>c.createElement("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("g",{clipPath:"url(#clip0_18201_5557)"},c.createElement("path",{d:"M7.5 14.0625C11.1244 14.0625 14.0625 11.1244 14.0625 7.5C14.0625 3.87563 11.1244 0.9375 7.5 0.9375C3.87563 0.9375 0.9375 3.87563 0.9375 7.5C0.9375 11.1244 3.87563 14.0625 7.5 14.0625Z",strokeWidth:.9375,strokeMiterlimit:10}),c.createElement("path",{d:"M7.49999 10.4812V6.30624H6.30624",strokeWidth:.9375,strokeMiterlimit:10}),c.createElement("path",{d:"M6.30624 10.4813H8.69374",strokeWidth:.9375,strokeMiterlimit:10}),c.createElement("path",{d:"M6.90625 4.51874H8.09375",strokeWidth:.9375,strokeMiterlimit:10})),c.createElement("defs",null,c.createElement("clipPath",{id:"clip0_18201_5557"},c.createElement("rect",{width:15,height:15,fill:"white"})))),"Info");function mf({onClick:e,active:t}){return w(Ki,{type:"button",onClick:e,active:t,children:w(Qc,{Component:gf})})}const vf=xt({display:"flex",flexDirection:"column"});function bf({label:e,data:t,isFilling:r,shimmerWidth:n}){return E("div",{className:vf,children:[w(ro,{children:e}),r?w(wb,{width:n}):w(eo,{wrap:"wrap",children:t??""})]})}function ff({transactionId:e,isOpen:t}){const{query:{data:r},isFilling:n}=bi({id:e}),o=Sc(r?.bankAccount.id);if(dr(r))return null;const a=sf({alignItems:"stretch",gap:5,paddingLeft:16,paddingRight:16,backgroundColor:"surface.foreground",borderWidth:0,borderBottomStyle:"solid",borderColor:"border.layout.strong",maxHeight:0,overflow:"hidden",transition:"all 300ms ease-out","&[data-open='true']":{maxHeight:"1/3",paddingTop:16,paddingBottom:16,borderWidth:"lg",overflow:"scroll"}});return E("div",{"data-open":t,className:a,children:[E("div",{className:uf({justifyContent:"space-between"}),children:[w(bf,{label:"Date",data:r?.date,isFilling:n,shimmerWidth:"md"}),w(bf,{label:"Amount",data:Qn(Xd(r.amount)),isFilling:n,shimmerWidth:"sm"})]}),w(bf,{label:"Bank Account",data:Mh(o?.apiAccountName,o?.apiAccountNo),isFilling:n,shimmerWidth:"lg"}),w(bf,{label:"Description",data:r?.description,isFilling:n,shimmerWidth:"lg"})]})}function yf({conversationId:e,transactionId:t}){const[r,n]=m(e),[o,a]=m(!0),{query:{data:i}}=za(r),l="CLOSED"===i?.resolutionStatus;return w(Pv,{children:E(_v,{children:[w(hf,{subject:i?.subject??"Conversation",children:ur(t)&&w(mf,{onClick:()=>a(!o),active:o},"infoButton")}),ur(t)&&w(ff,{transactionId:t,isOpen:o}),w(Nb,{conversationId:r,setConversationId:n,isResolved:l,isUnread:"UNREAD"===i?.readStatus})]})})}const Tf=xt({marginBottom:"20px"}),xf=xt({display:"flex",marginBlock:"20px",flexDirection:"column",gap:"15px"});function kf({title:e,children:t}){return E("div",{className:Tf,children:[w(ro,{children:e}),w("div",{className:xf,children:t}),w(Ja,{alignment:"horizontal"})]})}const wf=e=>["plaidInstitutionLogo",e??{}];function Cf(e){const t=mr(),r=Tr();return A({queryKey:wf({institutionId:e,accessToken:t,environment:r}),queryFn:async()=>await cc({institutionId:e,accessToken:t,environment:r}),staleTime:864e5}).data?.map.logo}const Ef=xt(Fi,{minWidth:"100%",padding:"10px"}),If=xt({display:"flex",justifyContent:"space-between",alignItems:"center",minWidth:"100%",width:"100%",height:"25px",gap:"15px"}),Sf=xt({display:"flex",flexDirection:"row",justifyContent:"start",alignItems:"center",gap:"12px"}),Af=xt({display:"flex",alignItems:"center",justifyContent:"center",gap:"5px"});function Nf({plaidItem:e}){const{linkPlaid:t}=hc(e.id),r=Cf(e.apiInstitutionId);return w("button",{className:Ef,onClick:()=>t(),children:E("span",{className:If,children:[E("div",{className:Sf,children:[r?w("img",{src:r,alt:`${e.apiInstitutionName} logo`,width:"25px",height:"25px"}):w(os,{Component:fh}),w(eo,{children:e.apiInstitutionName})]}),E("div",{className:Af,children:[w(ga,{Component:Gc}),w(Ji,{children:"Relink"})]})]})})}const Pf=ia(e=>c.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("path",{d:"M6.19899 11.5105C8.9944 11.5105 11.2605 9.2444 11.2605 6.44899C11.2605 3.65358 8.9944 1.38745 6.19899 1.38745C3.40358 1.38745 1.13745 3.65358 1.13745 6.44899C1.13745 9.2444 3.40358 11.5105 6.19899 11.5105Z",stroke:"#182428",strokeMiterlimit:10}),c.createElement("path",{d:"M15.05 15.3L9.67714 9.92712",stroke:"#182428",strokeMiterlimit:10})),"Search"),Mf=xt(Fi,{minWidth:"100%",justifyContent:"start",paddingBlock:"10px",marginBottom:"5px"}),Df=xt({display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%"}),Rf=xt({display:"flex",flexDirection:"column",alignItems:"start",width:"100%",marginInline:"15px"});function Of(){const{linkPlaid:e}=hc();return w("button",{className:Mf,onClick:()=>e(),children:E("div",{className:Df,children:[w(Qc,{Component:Pf}),E("div",{className:Rf,children:[w(eo,{children:"Connect your bank"}),w(ro,{children:"Find your banking institution with Plaid"})]}),w(Qc,{Component:sa})]})})}const _f=xt({padding:"10px 20px",minWidth:"100%",height:"45px"}),Lf=xt({height:"25px",display:"flex",alignItems:"center",justifyContent:"start",gap:"12px"});function Ff({bank:e}){const t=Cf(e.institutionName);return w("div",{className:_f,children:E("div",{className:Lf,children:[t?w("img",{src:t,alt:`${e.displayName} logo`,width:"25px",height:"25px"}):w(os,{Component:fh}),w(eo,{children:e.displayName})]})})}const Bf=xt({minWidth:"100%",height:"45px"});function Wf(){return E(C,{children:[w(No,{styles:Bf}),w(No,{styles:Bf}),w(No,{styles:Bf})]})}const Hf=xt({margin:"15px"});function Uf(){const{query:{data:e},isFilling:t}=Ks(),r=ur(e)&&e.length>0,n=Le(e=>e.drawerHistory).length>1,o=new Set(e?.map(e=>e.apiInstitutionName)??[]),a=sc.filter(e=>!o.has(e.displayName));return w(Pv,{children:E(_v,{children:[w(Mb,{children:E(Xb,{children:[w(zb,n?{Icon:la}:{}),w(eo,{children:"Add New Connection"})]})}),E("div",{className:Hf,children:[(t||r)&&w(kf,{title:"Already Connected",children:t?w(Wf,{}):e?.map(e=>w(Nf,{plaidItem:e},e.id))}),E(kf,{title:"Banks",children:[w(Of,{}),a.length>0&&E(C,{children:[w("div",{className:xt({display:"flex",flexDirection:"column",gap:"8px",marginBottom:"8px"}),children:a.map(e=>w(Ff,{bank:e},e.institutionName))}),w(eo,{children:"...and 12,000+"})]})]})]})]})})}function Vf(){return w(Mb,{children:E(Xb,{children:[w(zb,{}),w(eo,{children:"Financial Summary"})]})})}const zf=xt({display:"flex",flexDirection:"column",flex:1,padding:"15px",gap:"8px",width:"512px",overflow:"scroll"}),jf=Wt.raw({body:"default"}),Kf=xt({backgroundColor:"surface.foreground",border:"{borderWidths.lg} solid {colors.border.layout}",borderRadius:"md",padding:"12px",whiteSpace:"pre-wrap",overflowWrap:"break-word"},jf);function $f({summaryText:e}){return w("div",{className:zf,children:w("div",{className:Kf,children:e})})}const qf=xt({display:"flex",flexDirection:"column",overflow:"auto"});function Yf({summary:e}){return E("div",{className:qf,children:[w(Vf,{}),w($f,{summaryText:e})]})}const Gf=xt({display:"flex",flexDirection:"row",maxHeight:"100%",overflow:"hidden",flexShrink:1,flexGrow:1});function Qf({summaryId:e,conversationId:t}){const{query:{data:r}}=function({id:e}){return xr({queryKey:Ai({id:e}),queryFn:Pi})}({id:e});return w(Pv,{children:E("div",{className:Gf,children:[w(_v,{children:w(Yf,{summary:r?.summary})}),w(Ja,{}),w(Db,{conversationId:t??null,attachedEntityId:e})]})})}const Xf=xt({display:"flex",flexDirection:"column",gap:"16px"});function Zf({id:e,apiInstitutionName:t}){const{mutate:r}=qs(),n=gl(),{linkPlaid:o}=hc(e,()=>n?.setOpen(!1));return E(pu,{children:[w(vu,{onClick:()=>o(),children:w(eo,{children:"Add Account"})}),w(vu,{onClick:()=>(async()=>{const o=await(async e=>ic({title:"Remove Institution",body:w("div",{className:Xf,children:w(Ji,{wrap:"wrap",children:`Would you like to unlink ${e} altogether? If you unlink now and relink ${e} again in the future, you may see duplicate transactions.`})}),buttons:[{key:Zs,label:"Cancel"},{key:Js,label:"Remove",type:ac}]}))(t);n?.setOpen(!1),o===Js&&r({id:String(e)})})(),children:w(eo,{children:"Remove Institution"})})]})}const Jf=xt({borderTop:"{colors.border.layout.strong} {borderWidths.md} solid"});function ey({children:e}){return w("div",{className:Jf,children:e})}const ty=xt({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingTop:"20px",paddingBottom:"14px",paddingLeft:"15px",paddingRight:"15px",backgroundColor:"surface.foreground"});function ry({children:e}){return w("div",{className:ty,children:e})}function ny({plaidItem:e}){const{alert:t,actions:r}=xc(e);return E(np,{type:"critical",onClick:()=>{kc(t,r)},children:[w(Qc,{Component:Hh}),w(ro,{children:"Fix Bank Error"}),w(ga,{Component:sa})]})}const oy=xt({display:"flex",flexDirection:"column",alignItems:"start",justifyContent:"flex-start",textAlign:"start",gap:"5px",maxWidth:"100%"});function ay({accountName:e,accountNo:t,syncText:r,active:n=!0}){return E("div",{className:oy,children:[r&&w(ro,{intent:n?"normal":"danger",children:r}),w(eo,{children:e}),t&&w(eo,{children:Ph(t)})]})}const iy=Et({base:{padding:"15px",borderBottom:"{borderWidths.md} solid",borderColor:"border.layout.weak",backgroundColor:"surface.foreground",display:"flex",borderTop:"none",borderLeft:"none",borderRight:"none",width:"100%",justifyContent:"space-between",alignItems:"center"},variants:{active:{true:{_supportHover:{backgroundColor:"surface.intent.action.discrete.hover",cursor:"pointer"}}}}});function ly({bankAccountId:e,apiAccountName:t,apiAccountNo:r,syncText:n,active:o}){const a=wt(iy({active:o}),da);return E("button",{className:a,onClick:()=>{si("BankAccountForm",{routeProps:{bankAccountId:e}})},disabled:!o,children:[w(ay,{accountName:t,accountNo:r,syncText:n,active:o}),o&&w(Qc,{Component:sa})]})}const sy=xt({overflow:"hidden"}),cy=e=>{let t;return t=e.isSupported?e.lastApiSyncedDate?`Last synced ${lr(e.lastApiSyncedDate)}`:e.syncTransactions?"Processing":"Not Synced":"Not Supported",t};function dy({plaidItem:e,plaidItemAccounts:t,itemIndex:r,numPlaidItems:n}){const o=1===n,{expanded:a,toggleExpanded:i}=function(e,t){const r=Le(e=>e.toggleExpandedPlaidItem),n=Le(e=>e.expandedPlaidItems);return{toggleExpanded:r,expanded:Le(e=>e.hasExpandedUpdated)?n.includes(e):t}}(e.id,o),l=r===n-1;return E(ey,{children:[E(ry,{children:[E(Xb,{children:[w(eo,{children:e.apiInstitutionName}),w(Kb,{children:w(Zf,{id:e.id,apiInstitutionName:e.apiInstitutionName})})]}),E(Xb,{children:[ur(e.apiErrorCode)&&w(ny,{plaidItem:e}),w(Rl,{active:!1,onClick:()=>i(e.id,o),children:w(ga,{Component:a?cp:dp})})]})]}),a&&w("div",{className:sy,children:t.map(e=>w(ly,{bankAccountId:e.id,apiAccountNo:e.apiAccountNo,apiAccountName:e.apiAccountName,syncText:cy(e),active:e.isSupported},e.id))}),!l&&w(Ja,{alignment:"horizontal",color:"strong"})]})}const uy=xt({overflow:"hidden"});function hy({manualBankAccounts:e}){return E(ey,{children:[w(ry,{children:w(Xb,{children:w(eo,{children:"Manually Tracked Accounts"})})}),w("div",{className:uy,children:e.map(e=>w(ly,{bankAccountId:e.id,apiAccountName:e.apiAccountName,apiAccountNo:e.apiAccountNo,active:"ACTIVE"===e.status},e.id))})]})}const py=Et({base:{display:"flex",flexDirection:"row",border:"{borderWidths.lg} solid",borderColor:"border.layout"},variants:{width:{full:{width:"100%"}}}});function gy({width:e,children:t}){return w("div",{className:py({width:e}),children:t})}function my({options:e,handleClick:t,selected:r}){return w(gy,{width:"full",children:e.map(e=>w(Xm,{option:e,handleClick:t,selected:r,width:"full",backgroundColor:"foreground"},e.value))})}const vy=xt({display:"flex",flexDirection:"column",padding:"15px"});function by({task:e}){return w("div",{className:vy,children:w(Zp,{task:e})})}const fy=xt({display:"flex",flexDirection:"column",gap:"15px",position:"relative",marginTop:"15px"}),yy=xt({overflowY:"auto",position:"relative"}),Ty=Et({base:{paddingTop:"20px",paddingBottom:"20px",display:"flex",justifyContent:"center",alignItems:"center",position:"sticky",bottom:0},variants:{hasPlaidItems:{true:{borderTop:"{borderWidths.md} solid {colors.border.layout.strong}"}}}}),xy=[{label:"Connected Accounts",value:"connected"},{label:"Manually Tracked Banks",value:"manual"}];function ky(){const e=Ee(),{linkPlaid:t}=hc(),{query:{data:r}}=Ks(),{query:{data:n}}=Ic({select:e=>{return{plaidItemAccounts:(t=e?.data,t?.filter(e=>"PLAID"===e.apiName&&("ACTIVE"===e.status||!1===e.isSupported))),manualAccounts:Pc(e?.data)};var t}}),o=n?n.plaidItemAccounts:null,a=n?n.manualAccounts:null,i=r&&o&&((e,t)=>{const r=/* @__PURE__ */new Map;return e.forEach(e=>r.set(e.id,{...e,plaidItemAccounts:[]})),t.forEach(e=>{r.get(e.integrationId)?.plaidItemAccounts.push(e)}),[...r.values()]})(r,o),l=i?i.length:0,s=r?.find(e=>e.apiErrorCode),c=s&&Cc(s,!1),d=Le(e=>e.banksAndIntegrationsSelectedTab),u=Le(e=>e.setBanksAndIntegrationsSelectedTab),h="connected"===d.value,p=h?"Add New Connection":"Add New Account";return w(Pv,{children:E(_v,{children:[w(Mb,{children:E(Xb,{children:[w(zb,{}),w(eo,{children:"Banks & Integrations"})]})}),c&&w(by,{task:c}),w(my,{options:xy,handleClick:e=>u(e),selected:d}),w("div",{className:yy,children:w("div",{className:fy,children:h?i&&i.map((e,t)=>w(dy,{plaidItem:e,plaidItemAccounts:e.plaidItemAccounts,itemIndex:t,numPlaidItems:l},e.id)):a&&w(hy,{manualBankAccounts:a})})}),w("div",{className:Ty({hasPlaidItems:l>0}),children:E(Zg,{onClick:()=>{h?e?si("NewPlaidConnection"):t():si("BankAccountForm")},children:[w(Qc,{Component:Di}),w(eo,{children:p})]})})]})})}const wy=async({data:e,accessToken:t,environment:r})=>{const n={path:"/banks/account",bodyParams:{account:e},accessToken:t,endpointManager:xn(r)};return await vn(n)},Cy=async({data:e,accessToken:t,environment:r})=>wy({data:e,accessToken:t,environment:r}),Ey=async({data:e,accessToken:t,environment:r})=>wy({data:e,accessToken:t,environment:r});function Iy(e){return Vs({onSuccess:async()=>{nn("mutation successful, invalidating bank account queries");try{return fr.invalidateQueries({queryKey:["banks/accounts"]})}catch(e){e instanceof Error&&on({error:e,severity:"error"})}},...e})}function Sy(){return Iy({mutationFn:Ey})}const Ay=s.object({id:s.string(),apiAccountName:s.string({message:"Required"}).refine(e=>e.trim().length>0,{message:"Required"}),apiAccountNo:s.string({message:"Required"}).refine(e=>e.trim().length<=4,{message:"Must be 4 digits or less"}).refine(e=>e.trim().length>0,{message:"Required"}),apiAccountType:s.enum(["DEPOSITORY","CREDIT"],{message:"Required"})}),Ny=ia(e=>c.createElement("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("path",{d:"M11.7346 14.5L11.7346 12.9152C11.7333 12.2895 11.5704 11.6747 11.2616 11.1305C10.9528 10.5863 10.5087 10.1311 9.97233 9.80895L7.43662 8.29386C6.90079 7.97055 6.45795 7.51384 6.1513 6.96831C5.84465 6.42279 5.68467 5.80708 5.68698 5.18127L5.68698 3.60913",strokeMiterlimit:10}),c.createElement("path",{d:"M5.68701 1.1875L5.68701 14.5",strokeMiterlimit:10}),c.createElement("path",{d:"M3.26538 3.60911L5.68699 1.1875L8.10859 3.60911",strokeMiterlimit:10}),c.createElement("path",{d:"M5.68701 7.24146L5.68701 2.39825",strokeMiterlimit:10})),"Merge"),Py={transform:"none",willChange:"auto"};function My({children:e}){return w(El,{style:Py,children:e})}const Dy=xt({backgroundColor:"overlay",display:"flex",justifyContent:"center",alignItems:"center"}),Ry=Rt(null,Dy);function Oy({children:e,clickHandler:t}){const r=gl();return t||(t=()=>{r.setOpen(!1)}),w(ce,{lockScroll:!0,...Ry,onClick:t,children:e})}const _y=Rt(St["modal-popup"],xt({display:"flex",justifyContent:"center",flexDirection:"column",minWidth:{sm:"600px",base:"100dvw"},maxWidth:{sm:"900px",base:"100dvw"},minHeight:"200px",height:"fit-content",backgroundColor:"surface.background",borderRadius:"md",padding:"15px",position:"relative"}));function Ly({children:e}){return w("div",{..._y,onClick:e=>{e.stopPropagation()},children:e})}const Fy=xt({display:"flex",gap:"10px",maxWidth:"100%"});function By({accountName:e,accountNo:t,institutionId:r,syncText:n,active:o=!0,showIcon:a=!0}){const i=Cf(r);return E("div",{className:Fy,children:[i&&a?w("img",{src:i,alt:"Bank Logo",width:"25px",height:"25px"}):w(os,{Component:fh}),w(ay,{accountName:e,accountNo:t,active:o,syncText:n})]})}const Wy="TRIGGER_ACCOUNT",Hy="FORM_SELECTABLE_ACCOUNT";function Uy({onClick:e,excludedAccountId:t}){const{query:{data:r},isFilling:n}=Ic(),o=r?.data?.filter(e=>e.glAccountId&&e.isSupported&&e.id!==t);return w(Bm,{bankAccounts:o,isFilling:n,onClick:e})}const Vy=xt({maxWidth:"100%",display:"flex",gap:"10px",alignItems:"center"});function zy({selectedAccount:e,setSelectedAccount:t,mergeDestination:r,excludedAccountId:n}){return E(pl,{placement:"bottom-start",children:[w(ml,{children:t=>w(Ki,{...t,width:"fill-parent",children:w(fu,{children:e?Mh(e?.apiAccountName,e?.apiAccountNo):E("div",{className:Vy,children:[w(Ji,{children:r===Wy?"Select Duplicate Bank Account":"Select Destination Bank Account"}),w(ga,{Component:Di})]})})})}),w(Uy,{onClick:t,excludedAccountId:n})]})}const jy=[Rt(null,xt({"& path":{stroke:"icon.base"}}))];function Ky({showIcon:e=!0,textContent:t="Cancel",onClick:r}){return E(Ki,{type:"button",onClick:r,children:[e&&w(ga,{Component:vl,stylists:jy}),w(eo,{children:t})]})}const $y=xt({display:"flex",flexDirection:"column",gap:"16px"}),qy={mergeDestination:Hy,selectedAccount:null};const Yy=xt({display:"flex",flexDirection:"column",gap:"20px"}),Gy=xt({display:"grid",gridTemplateColumns:{sm:"300px auto 300px",base:"100%"},gap:"10px",rowGap:"25px",justifyContent:"space-between",paddingLeft:"10px",paddingRight:"10px"}),Qy=xt.raw({display:"flex",flexDirection:"column",gap:"15px",width:"100%",maxWidth:"300px",height:"100%",justifyContent:"space-between"}),Xy=xt(Qy,{placeSelf:{sm:"flex-start",base:"center"},alignItems:{sm:"flex-start",base:"center"},maxWidth:{sm:"300",base:"auto"}}),Zy=xt(Qy,{placeSelf:"center",alignItems:"center"}),Jy=xt(Qy,{placeSelf:{sm:"flex-end",base:"center"},alignItems:{sm:"flex-end",base:"center"},maxWidth:{sm:"300",base:"auto"}}),eT=xt({display:"flex",flexDirection:"row",gap:"15px",justifyContent:"flex-end"}),tT=xt({justifyContent:"center",display:"flex",transform:{sm:"none",base:"rotate(90deg)"}}),rT=xt({width:"100%",display:"flex",justifyContent:"flex-start"}),nT=xt({width:"100%",display:"flex",justifyContent:{sm:"center",base:"flex-start"}}),oT=xt({width:"100%",display:"flex",justifyContent:{sm:"flex-end",base:"flex-start"}}),aT=e=>{Vg(e),zg(e)};function iT({account:e}){const t=gl(),r=function(e,t){const{mutateAsync:r}=Sy();return ov({defaultValues:qy,onSubmit:async n=>{if(await(async()=>ic({title:"Merge Accounts",body:E("div",{className:$y,children:[w(Ji,{wrap:"wrap",children:"The selected accounts and their transactions will be merged into your linked accounts."}),w(Ji,{wrap:"wrap",children:"This action can't be undone."}),w(Ji,{wrap:"wrap",children:"It may take a few minutes for this process to complete."})]}),buttons:[{key:Zs,label:"Cancel"},{key:Js,label:"Continue",type:ac}]}))()===Js&&ur(e)&&ur(n.value.selectedAccount)){const l=(o=e,a=n.value.mergeDestination,i=n.value.selectedAccount,a===Hy?{...Oh(i),duplicateBankAccountIds:[Rh(o.id)]}:{...Oh(o),duplicateBankAccountIds:[Rh(i.id)]});r(l).then(()=>{t.setOpen(!1),n.value.mergeDestination===Hy&&ci()}).catch(()=>{ic({title:"Merge Failed",body:w(Ji,{wrap:"wrap",children:"There was an error merging your bank accounts. Please try again later."}),buttons:[{key:Zs,label:"OK"}]})})}var o,a,i},onSubmitInvalid:()=>{}})}(e,t);return E("form",{className:Yy,onSubmit:e=>{e.preventDefault(),e.stopPropagation(),r.handleSubmit()},onKeyDown:aT,children:[w(eo,{children:"Merge Accounts"}),w("div",{className:Gy,children:w(r.Subscribe,{selector:e=>e.values.mergeDestination,children:t=>E(C,{children:[E("div",{className:Xy,children:[w("div",{className:rT,children:w(eo,{children:"Duplicate Account"})}),t===Hy?w(By,{accountName:e?.apiAccountName,accountNo:e?.apiAccountNo,institutionId:e?.apiInstitutionId}):w(r.AppField,{name:"selectedAccount",children:r=>w(zy,{selectedAccount:r.state.value,setSelectedAccount:r.handleChange,mergeDestination:t,excludedAccountId:e?.id})})]}),E("div",{className:Zy,children:[w("div",{className:nT,children:w(eo,{children:"Into"})}),w(r.AppField,{name:"mergeDestination",children:e=>w("div",{className:tT,children:w(Ki,{onClick:()=>e.handleChange(e.state.value===Hy?Wy:Hy),children:w(Qc,{Component:sa})})})})]}),E("div",{className:Jy,children:[w("div",{className:oT,children:w(eo,{children:"Destination Account"})}),t===Hy?w(r.AppField,{name:"selectedAccount",children:r=>w(zy,{selectedAccount:r.state.value,setSelectedAccount:r.handleChange,mergeDestination:t,excludedAccountId:e?.id})}):w(By,{accountName:e?.apiAccountName,accountNo:e?.apiAccountNo,institutionId:e?.apiInstitutionId})]})]})})}),E("div",{className:eT,children:[w(Ky,{showIcon:!1,onClick:()=>{t.setOpen(!1)}}),w(r.Subscribe,{selector:e=>e.values.selectedAccount,children:e=>w(Dg,{disabled:dr(e),showIcon:!1,textContent:"Merge"})})]})]})}function lT({bankAccount:e}){return w(pu,{children:E(pl,{placement:"right-start",modal:!0,children:[w(ml,{children:e=>E(vu,{...e,children:[w(Qc,{Component:Ny}),w(eo,{children:"Merge Accounts"})]})}),w(My,{children:w(Oy,{children:w(Ly,{children:w(iT,{account:e})})})})]})})}const sT={id:"",apiAccountName:"",apiAccountNo:"",apiAccountType:void 0};const cT=[{value:"DEPOSITORY",label:"Bank Account"},{value:"CREDIT",label:"Credit Card"}],dT=e=>{Vg(e),zg(e)};function uT({bankAccountId:e}){const t=Sc(e),[r,n]=m(t??sT),o=function(e,t){const{mutate:r}=Sy(),{mutateAsync:n}=Iy({mutationFn:Cy}),o=pr(String(e.id));return ov({defaultValues:e,validators:{onBlur:Ay},onSubmit:async e=>{if(o)r(Oh(e.value)),t(e.value),e.formApi.reset(e.value,{keepDefaultValues:!0});else{const r=await n((a=e.value,{apiAccountName:a.apiAccountName,apiAccountNo:a.apiAccountNo,apiAccountType:a.apiAccountType,duplicateBankAccountIds:[]}));t(r.dataObject||sT),e.formApi.reset(r.dataObject,{keepDefaultValues:!0})}var a},onSubmitInvalid:()=>{}})}(r,n),a="PLAID"===t?.apiName,i=Mh(r?.apiAccountName,r?.apiAccountNo),l=pr(i)?i:"New Bank Account",s=Le(e=>e.FEATUREFLAG_HAS_MERGE_ACCOUNTS);return w(Pv,{children:w(_v,{children:E("form",{onSubmit:e=>{e.preventDefault(),o.handleSubmit()},onKeyDown:dT,children:[E(Mb,{children:[E(Xb,{children:[w(zb,{}),w(eo,{children:l}),s&&w(Kb,{children:w(lT,{bankAccount:t})})]}),w(o.Subscribe,{selector:e=>e.isDefaultValue,children:e=>e?null:w(o.SaveButton,{})})]}),E(Ob,{children:[w(o.AppField,{name:"apiAccountName",children:e=>w(e.TextField,{label:"Name",disabled:a,placeholder:"Enter name..."})}),w(o.AppField,{name:"apiAccountNo",children:e=>w(e.TextField,{label:"Last 4 Digits (Mask)",type:"number",disabled:a,placeholder:"0000",maxLength:4})}),w(o.AppField,{name:"apiAccountType",children:e=>w(e.GenericSelectorField,{label:"Account Type",options:cT,disabled:a})})]})]})})})}function hT(){return E(Ig,{children:[w(Sg,{name:"BankTransactionFormRouter",Component:of}),w(Sg,{name:"Conversation",Component:pf}),w(Sg,{name:"MobileConversation",Component:yf}),w(Sg,{name:"FinancialSummary",Component:Qf}),w(Sg,{name:"BanksAndIntegrations",Component:ky}),w(Sg,{name:"BankAccountForm",Component:uT}),w(Sg,{name:"NewPlaidConnection",Component:Uf})]})}const pT=({environment:e,children:t})=>w(yr.Provider,{value:e,children:t}),gT=async e=>{const t=e.queryKey,r={path:"/sdk/introspect",accessToken:t[1].accessToken,environment:t[1].environment};return await Ra(r)};function mT({children:e}){const{query:{data:t}}=xr({queryKey:["sdk/introspect"],queryFn:gT}),r={userId:t?.userId,userRole:t?.userRole||"OWNER",userEmail:t?.email,companyId:t?.companyId?xi({id:t.companyId,prefix:"COMPANY"}):void 0,customerPartnerId:t?.customerPartnerId,apiPartnerName:t?.apiPartnerName};return w(Hl.Provider,{value:r,children:e})}const vT=Object.freeze({CACHE_BUST:"CACHE_BUST",CONNECTED:"CONNECTED",HEARTBEAT:"HEARTBEAT",ERROR:"ERROR"});const bT="SSE connection failed with status";function fT({companyId:e,customerPartnerId:t,sseTypes:r,enabled:n=!1}){const o=Tr();b(()=>{if(!n||!t)return;const a=new AbortController,i=function(e,t,r,n){const o=new URL(`${a=e,Tn[a]}/sse/v1/subscribe`);var a;return o.searchParams.append("customerPartnerId",r),t.forEach(e=>o.searchParams.append("events",e)),n&&o.searchParams.append("companyId",n),o.toString()}(o,r,t,e);let l=0;return ke(i,{onopen:async e=>async function(e){if(e.status>=400&&e.status<500)throw new Error(`${bT} ${e.status}`)}(e),onmessage:n=>function({event:e,data:t,env:r,sseTypes:n,customerPartnerId:o,companyId:a}){switch(e){case vT.CONNECTED:return void nn("SSE connection established",{env:r,customerPartnerId:o,companyId:a,sseTypes:JSON.stringify(Array.from(n))});case vT.ERROR:throw on({error:{name:"SSE error message from server",message:t},severity:"error"}),new Error("SSE error message from server");case vT.CACHE_BUST:return nn("cache bust event received",{sseTypes:JSON.stringify(Array.from(n))}),void function(e){try{const t=JSON.parse(e);Array.isArray(t)&&t.forEach(e=>{setTimeout(()=>{fr.invalidateQueries({predicate:t=>t.queryKey.includes(e)&&"fetching"!==t.state.fetchStatus}).catch(e=>on({error:e,severity:"error"}))},500*Math.random()),nn(`invalidated query key: ${e} due to cache bust event`)})}catch(t){return void on({error:t instanceof Error?t:new Error("JSON parse error"),severity:"error",extraData:{data:e}})}}(t)}}({event:n.event,data:n.data,env:o,sseTypes:r,customerPartnerId:t,companyId:e}),onclose:()=>function(){throw on({error:new Error("SSE connection closed by server"),severity:"warning"}),new Error("Connection closed unexpectedly")}(),onerror:e=>function(e,t){if(e.message.includes(bT))throw e;return 3e3*2**Math.min(t,3)}(e,l++),signal:a.signal}).catch(e=>on({error:e,severity:"error"})),()=>a.abort("Closing SSE connection")},[o,t,e,r,n])}const yT=[vT.CACHE_BUST];function TT({children:e}){const{companyId:t,customerPartnerId:r}=p(Hl),n=Le(e=>e.FEATUREFLAG_SERVER_SIDE_EVENTS);return fT({companyId:t,customerPartnerId:r,sseTypes:yT,enabled:n}),e}function xT({children:e,environment:t,accessToken:r}){const n={activeToken:r,accountantToken:void 0};return b(()=>{var e,n;e=r,n=t,Zr.setProperties(tn),en=n,Jr=e},[r,t]),w(pT,{environment:t,children:w(Tg,{children:w(gr.Provider,{value:n,children:w(mT,{children:E(TT,{children:[w(he.ConfirmationRoot,{}),e,w(hT,{})]})})})})})}export{bg as BusinessOwnerDashboard,xT as Tight,Ke as useOptions};
|
|
3383
2
|
//# sourceMappingURL=index.js.map
|