@layerfi/components 0.1.89-alpha → 0.1.91-alpha
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/cjs/index.cjs +1610 -431
- package/dist/esm/index.mjs +1613 -435
- package/dist/index.css +359 -48
- package/dist/index.d.ts +411 -29
- package/package.json +5 -4
package/dist/esm/index.mjs
CHANGED
|
@@ -29,10 +29,7 @@ var __objRest = (source, exclude2) => {
|
|
|
29
29
|
}
|
|
30
30
|
return target;
|
|
31
31
|
};
|
|
32
|
-
var __publicField = (obj, key, value) =>
|
|
33
|
-
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
34
|
-
return value;
|
|
35
|
-
};
|
|
32
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
36
33
|
var __async = (__this, __arguments, generator) => {
|
|
37
34
|
return new Promise((resolve, reject) => {
|
|
38
35
|
var fulfilled = (value) => {
|
|
@@ -61,7 +58,7 @@ import { useState as useState8 } from "react";
|
|
|
61
58
|
import { useReducer, useEffect as useEffect4 } from "react";
|
|
62
59
|
|
|
63
60
|
// package.json
|
|
64
|
-
var version = "0.1.
|
|
61
|
+
var version = "0.1.91-alpha";
|
|
65
62
|
|
|
66
63
|
// src/models/APIError.ts
|
|
67
64
|
var APIError = class _APIError extends Error {
|
|
@@ -305,6 +302,9 @@ var createBillPayment = post(
|
|
|
305
302
|
|
|
306
303
|
// src/api/layer/business.ts
|
|
307
304
|
var getBusiness = get(({ businessId }) => `/v1/businesses/${businessId}`);
|
|
305
|
+
var updateBusiness = put(
|
|
306
|
+
({ businessId }) => `/v1/businesses/${businessId}`
|
|
307
|
+
);
|
|
308
308
|
|
|
309
309
|
// src/api/layer/categories.ts
|
|
310
310
|
var getCategories = get(({ businessId, mode }) => {
|
|
@@ -443,7 +443,10 @@ var getCashflowStatementCSV = get(
|
|
|
443
443
|
|
|
444
444
|
// src/api/layer/tasks.ts
|
|
445
445
|
var getTasks = get(
|
|
446
|
-
({ businessId, startDate, endDate }) =>
|
|
446
|
+
({ businessId, startDate, endDate }) => {
|
|
447
|
+
const parameters = toDefinedSearchParameters({ startDate, endDate });
|
|
448
|
+
return `/v1/businesses/${businessId}/tasks?${parameters}`;
|
|
449
|
+
}
|
|
447
450
|
);
|
|
448
451
|
var submitResponseToTask = post(
|
|
449
452
|
({ businessId, taskId }) => `/v1/businesses/${businessId}/tasks/${taskId}/user-response`
|
|
@@ -703,14 +706,14 @@ function ToastsContainer() {
|
|
|
703
706
|
// src/components/GlobalWidgets/GlobalWidgets.tsx
|
|
704
707
|
import { Fragment as Fragment2, jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
705
708
|
var DrawerWidget = () => {
|
|
706
|
-
const { content, close } = useContext3(DrawerContext);
|
|
709
|
+
const { content, close: close2 } = useContext3(DrawerContext);
|
|
707
710
|
const { isMobile, isTablet } = useSizeClass();
|
|
708
711
|
useEffect(() => {
|
|
709
712
|
if (!isMobile && !isTablet && content) {
|
|
710
|
-
|
|
713
|
+
close2();
|
|
711
714
|
}
|
|
712
715
|
}, [isMobile]);
|
|
713
|
-
return /* @__PURE__ */ jsx3(Drawer, { isOpen: Boolean(content), onClose:
|
|
716
|
+
return /* @__PURE__ */ jsx3(Drawer, { isOpen: Boolean(content), onClose: close2, children: content });
|
|
714
717
|
};
|
|
715
718
|
var GlobalWidgets = () => {
|
|
716
719
|
return /* @__PURE__ */ jsxs2(Fragment2, { children: [
|
|
@@ -815,7 +818,7 @@ import { useState as useState3 } from "react";
|
|
|
815
818
|
var useDrawer = () => {
|
|
816
819
|
const [content, setContent] = useState3(void 0);
|
|
817
820
|
const [isClosing, setIsClosing] = useState3(false);
|
|
818
|
-
const
|
|
821
|
+
const close2 = () => {
|
|
819
822
|
setIsClosing(true);
|
|
820
823
|
};
|
|
821
824
|
const finishClosing = () => {
|
|
@@ -827,7 +830,7 @@ var useDrawer = () => {
|
|
|
827
830
|
setContent,
|
|
828
831
|
finishClosing,
|
|
829
832
|
isClosing,
|
|
830
|
-
close
|
|
833
|
+
close: close2
|
|
831
834
|
};
|
|
832
835
|
};
|
|
833
836
|
|
|
@@ -849,6 +852,15 @@ function hasSuggestions(categorization) {
|
|
|
849
852
|
return categorization != null && categorization.suggestions !== void 0 && categorization.suggestions.length > 0;
|
|
850
853
|
}
|
|
851
854
|
|
|
855
|
+
// src/types/business.ts
|
|
856
|
+
var ENTITY_TYPES = [
|
|
857
|
+
{ value: "SOLE_PROP", label: "Sole Proprietorship" },
|
|
858
|
+
{ value: "C_CORP", label: "C Corporation" },
|
|
859
|
+
{ value: "LLC", label: "Limited Liability Company" },
|
|
860
|
+
{ value: "S_CORP", label: "S Corporation" },
|
|
861
|
+
{ value: "PARTNERSHIP", label: "Partnership" }
|
|
862
|
+
];
|
|
863
|
+
|
|
852
864
|
// src/config/theme.ts
|
|
853
865
|
var SHADES = {
|
|
854
866
|
50: { s: 1, l: 98 },
|
|
@@ -1047,16 +1059,11 @@ var buildColorShade = (shade, darkColorHsl) => {
|
|
|
1047
1059
|
return { hsl, rgb, hex };
|
|
1048
1060
|
};
|
|
1049
1061
|
var hueToRgb = (p, q, t) => {
|
|
1050
|
-
if (t < 0)
|
|
1051
|
-
|
|
1052
|
-
if (t
|
|
1053
|
-
|
|
1054
|
-
if (t <
|
|
1055
|
-
return p + (q - p) * 6 * t;
|
|
1056
|
-
if (t < 1 / 2)
|
|
1057
|
-
return q;
|
|
1058
|
-
if (t < 2 / 3)
|
|
1059
|
-
return p + (q - p) * (2 / 3 - t) * 6;
|
|
1062
|
+
if (t < 0) t += 1;
|
|
1063
|
+
if (t > 1) t -= 1;
|
|
1064
|
+
if (t < 1 / 6) return p + (q - p) * 6 * t;
|
|
1065
|
+
if (t < 1 / 2) return q;
|
|
1066
|
+
if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6;
|
|
1060
1067
|
return p;
|
|
1061
1068
|
};
|
|
1062
1069
|
var hslToRgb = (hsl) => {
|
|
@@ -2401,7 +2408,7 @@ var BusinessProvider = ({
|
|
|
2401
2408
|
setOnboardingStep,
|
|
2402
2409
|
addToast,
|
|
2403
2410
|
removeToast,
|
|
2404
|
-
onError: errorHandler.onError,
|
|
2411
|
+
onError: (payload) => errorHandler.onError(payload),
|
|
2405
2412
|
touch,
|
|
2406
2413
|
read,
|
|
2407
2414
|
syncTimestamps,
|
|
@@ -3335,8 +3342,7 @@ var TooltipContent = forwardRef3(function TooltipContent2(_a, propRef) {
|
|
|
3335
3342
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
3336
3343
|
const context = useTooltipContext();
|
|
3337
3344
|
const ref = useMergeRefs([context.refs.setFloating, propRef]);
|
|
3338
|
-
if (!context.open || context.disabled)
|
|
3339
|
-
return null;
|
|
3345
|
+
if (!context.open || context.disabled) return null;
|
|
3340
3346
|
return /* @__PURE__ */ jsx22(FloatingPortal, { children: /* @__PURE__ */ jsx22(
|
|
3341
3347
|
"div",
|
|
3342
3348
|
__spreadProps(__spreadValues({
|
|
@@ -3484,8 +3490,7 @@ var IconButton = (_a) => {
|
|
|
3484
3490
|
download,
|
|
3485
3491
|
className: baseClassName,
|
|
3486
3492
|
onClick: (e) => {
|
|
3487
|
-
if (props.disabled)
|
|
3488
|
-
e.preventDefault();
|
|
3493
|
+
if (props.disabled) e.preventDefault();
|
|
3489
3494
|
},
|
|
3490
3495
|
children: icon
|
|
3491
3496
|
}
|
|
@@ -3745,7 +3750,8 @@ var SubmitButton = (_a) => {
|
|
|
3745
3750
|
children,
|
|
3746
3751
|
action = "save" /* SAVE */,
|
|
3747
3752
|
noIcon,
|
|
3748
|
-
variant = "primary" /* primary
|
|
3753
|
+
variant = "primary" /* primary */,
|
|
3754
|
+
withRetry
|
|
3749
3755
|
} = _b, props = __objRest(_b, [
|
|
3750
3756
|
"active",
|
|
3751
3757
|
"className",
|
|
@@ -3755,12 +3761,24 @@ var SubmitButton = (_a) => {
|
|
|
3755
3761
|
"children",
|
|
3756
3762
|
"action",
|
|
3757
3763
|
"noIcon",
|
|
3758
|
-
"variant"
|
|
3764
|
+
"variant",
|
|
3765
|
+
"withRetry"
|
|
3759
3766
|
]);
|
|
3760
3767
|
const baseClassName = classNames7(
|
|
3761
3768
|
active ? "Layer__btn--active" : "",
|
|
3762
3769
|
className
|
|
3763
3770
|
);
|
|
3771
|
+
if (withRetry && error) {
|
|
3772
|
+
return /* @__PURE__ */ jsx30(
|
|
3773
|
+
RetryButton,
|
|
3774
|
+
__spreadProps(__spreadValues({}, props), {
|
|
3775
|
+
className: baseClassName,
|
|
3776
|
+
disabled: processing || disabled,
|
|
3777
|
+
error: typeof error === "string" ? error : "Something went wrong",
|
|
3778
|
+
children
|
|
3779
|
+
})
|
|
3780
|
+
);
|
|
3781
|
+
}
|
|
3764
3782
|
return /* @__PURE__ */ jsx30(
|
|
3765
3783
|
Button,
|
|
3766
3784
|
__spreadProps(__spreadValues({}, props), {
|
|
@@ -4216,7 +4234,8 @@ var Text = (_a) => {
|
|
|
4216
4234
|
weight = "normal" /* normal */,
|
|
4217
4235
|
withTooltip,
|
|
4218
4236
|
ellipsis,
|
|
4219
|
-
status
|
|
4237
|
+
status,
|
|
4238
|
+
pb
|
|
4220
4239
|
} = _b, props = __objRest(_b, [
|
|
4221
4240
|
"as",
|
|
4222
4241
|
"className",
|
|
@@ -4225,9 +4244,10 @@ var Text = (_a) => {
|
|
|
4225
4244
|
"weight",
|
|
4226
4245
|
"withTooltip",
|
|
4227
4246
|
"ellipsis",
|
|
4228
|
-
"status"
|
|
4247
|
+
"status",
|
|
4248
|
+
"pb"
|
|
4229
4249
|
]);
|
|
4230
|
-
const dataProperties = toDataProperties({ status, ellipsis });
|
|
4250
|
+
const dataProperties = toDataProperties({ status, ellipsis, pb });
|
|
4231
4251
|
const baseClassName = classNames15(
|
|
4232
4252
|
`Layer__text Layer__text--${size} Layer__text--${weight}`,
|
|
4233
4253
|
className
|
|
@@ -4309,10 +4329,12 @@ var Heading = ({
|
|
|
4309
4329
|
as: Component2 = "h2",
|
|
4310
4330
|
className,
|
|
4311
4331
|
children,
|
|
4312
|
-
size = "primary" /* primary
|
|
4332
|
+
size = "primary" /* primary */,
|
|
4333
|
+
align = "center"
|
|
4313
4334
|
}) => {
|
|
4314
4335
|
const baseClassName = classNames16(
|
|
4315
4336
|
`Layer__heading Layer__heading--${size}`,
|
|
4337
|
+
`Layer__heading--${align}`,
|
|
4316
4338
|
className
|
|
4317
4339
|
);
|
|
4318
4340
|
return /* @__PURE__ */ jsx45(Component2, { className: baseClassName, children });
|
|
@@ -5437,7 +5459,7 @@ var LinkedAccountItemThumb = ({
|
|
|
5437
5459
|
};
|
|
5438
5460
|
|
|
5439
5461
|
// src/components/LinkedAccounts/LinkedAccountsContent.tsx
|
|
5440
|
-
import
|
|
5462
|
+
import classNames25 from "classnames";
|
|
5441
5463
|
|
|
5442
5464
|
// src/components/LinkedAccounts/ConfirmationModal/LinkedAccountsConfirmationModal.tsx
|
|
5443
5465
|
import { useState as useState14 } from "react";
|
|
@@ -5620,12 +5642,13 @@ function ModalActions({ children }) {
|
|
|
5620
5642
|
}
|
|
5621
5643
|
|
|
5622
5644
|
// src/components/ui/Stack/Stack.tsx
|
|
5645
|
+
import classNames23 from "classnames";
|
|
5623
5646
|
import { jsx as jsx69 } from "react/jsx-runtime";
|
|
5624
5647
|
var CLASS_NAME2 = "Layer__Stack";
|
|
5625
5648
|
function Stack(_a) {
|
|
5626
|
-
var _b = _a, { align, children, direction, gap, justify, pbs, pbe } = _b, restProps = __objRest(_b, ["align", "children", "direction", "gap", "justify", "pbs", "pbe"]);
|
|
5649
|
+
var _b = _a, { align, children, direction, gap, justify, pbs, pbe, className } = _b, restProps = __objRest(_b, ["align", "children", "direction", "gap", "justify", "pbs", "pbe", "className"]);
|
|
5627
5650
|
const dataProperties = toDataProperties({ align, direction, gap, justify, pbs, pbe });
|
|
5628
|
-
return /* @__PURE__ */ jsx69("div", __spreadProps(__spreadValues(__spreadValues({}, restProps), dataProperties), { className: CLASS_NAME2, children }));
|
|
5651
|
+
return /* @__PURE__ */ jsx69("div", __spreadProps(__spreadValues(__spreadValues({}, restProps), dataProperties), { className: classNames23(CLASS_NAME2, className), children }));
|
|
5629
5652
|
}
|
|
5630
5653
|
function VStack(props) {
|
|
5631
5654
|
return /* @__PURE__ */ jsx69(Stack, __spreadProps(__spreadValues({}, props), { direction: "column" }));
|
|
@@ -5673,7 +5696,7 @@ function withRenderProp(renderProp, callback) {
|
|
|
5673
5696
|
}
|
|
5674
5697
|
|
|
5675
5698
|
// src/components/ui/Checkbox/Checkbox.tsx
|
|
5676
|
-
import
|
|
5699
|
+
import classNames24 from "classnames";
|
|
5677
5700
|
import { Fragment as Fragment8, jsx as jsx71, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
5678
5701
|
var CLASS_NAME3 = "Layer__Checkbox";
|
|
5679
5702
|
function Checkbox(_a) {
|
|
@@ -5686,7 +5709,7 @@ function Checkbox(_a) {
|
|
|
5686
5709
|
return /* @__PURE__ */ jsx71(
|
|
5687
5710
|
ReactAriaCheckbox,
|
|
5688
5711
|
__spreadProps(__spreadValues(__spreadValues({}, dataProperties), props), {
|
|
5689
|
-
className:
|
|
5712
|
+
className: classNames24(CLASS_NAME3, className),
|
|
5690
5713
|
children: withRenderProp(children, (node) => /* @__PURE__ */ jsxs35(Fragment8, { children: [
|
|
5691
5714
|
/* @__PURE__ */ jsx71("div", { slot: "checkbox", children: /* @__PURE__ */ jsx71(Check, { size: size === "lg" ? 16 : 12 }) }),
|
|
5692
5715
|
node
|
|
@@ -5704,7 +5727,7 @@ function BasicLinkedAccountContainer({ children, isSelected }) {
|
|
|
5704
5727
|
}
|
|
5705
5728
|
function BasicLinkedAccountLogo({ account }) {
|
|
5706
5729
|
var _a, _b, _c;
|
|
5707
|
-
return /* @__PURE__ */ jsx72(VStack, { justify: "center", children: ((_a = account.institution) == null ? void 0 : _a.logo) ? /* @__PURE__ */ jsx72(
|
|
5730
|
+
return /* @__PURE__ */ jsx72(VStack, { justify: "center", className: "Layer__BasicLinkedAccountLogo", children: ((_a = account.institution) == null ? void 0 : _a.logo) ? /* @__PURE__ */ jsx72(
|
|
5708
5731
|
"img",
|
|
5709
5732
|
{
|
|
5710
5733
|
width: 28,
|
|
@@ -5712,17 +5735,17 @@ function BasicLinkedAccountLogo({ account }) {
|
|
|
5712
5735
|
src: `data:image/png;base64,${account.institution.logo}`,
|
|
5713
5736
|
alt: ((_b = account.institution) == null ? void 0 : _b.name) ? (_c = account.institution) == null ? void 0 : _c.name : account.external_account_name
|
|
5714
5737
|
}
|
|
5715
|
-
) : /* @__PURE__ */ jsx72(InstitutionIcon_default, {
|
|
5738
|
+
) : /* @__PURE__ */ jsx72(InstitutionIcon_default, {}) });
|
|
5716
5739
|
}
|
|
5717
5740
|
function BasicLinkedAccountContent({ account }) {
|
|
5718
5741
|
var _a;
|
|
5719
5742
|
return /* @__PURE__ */ jsxs36(HStack, { gap: "md", children: [
|
|
5720
5743
|
/* @__PURE__ */ jsx72(BasicLinkedAccountLogo, { account }),
|
|
5721
5744
|
/* @__PURE__ */ jsxs36(VStack, { children: [
|
|
5722
|
-
/* @__PURE__ */ jsx72(Heading2, { level: 3, size: "
|
|
5745
|
+
/* @__PURE__ */ jsx72(Heading2, { level: 3, size: "xs", pbe: "3xs", children: account.external_account_name }),
|
|
5723
5746
|
/* @__PURE__ */ jsxs36(HStack, { gap: "xs", children: [
|
|
5724
|
-
/* @__PURE__ */ jsx72(P, { children: (_a = account.institution) == null ? void 0 : _a.name }),
|
|
5725
|
-
/* @__PURE__ */ jsxs36(P, { variant: "subtle", children: [
|
|
5747
|
+
/* @__PURE__ */ jsx72(P, { size: "sm", children: (_a = account.institution) == null ? void 0 : _a.name }),
|
|
5748
|
+
/* @__PURE__ */ jsxs36(P, { variant: "subtle", size: "sm", children: [
|
|
5726
5749
|
"\u2022\u2022\u2022",
|
|
5727
5750
|
" ",
|
|
5728
5751
|
account.mask
|
|
@@ -5894,13 +5917,8 @@ function useLinkedAccountsConfirmationModal() {
|
|
|
5894
5917
|
}, baseInfo);
|
|
5895
5918
|
}
|
|
5896
5919
|
function LinkedAccountsConfirmationModalPreloadedContent({ onClose }) {
|
|
5897
|
-
const { onDismiss } = useLinkedAccountsConfirmationModal();
|
|
5898
|
-
const handleDismiss = () => {
|
|
5899
|
-
onDismiss();
|
|
5900
|
-
onClose();
|
|
5901
|
-
};
|
|
5902
5920
|
return /* @__PURE__ */ jsxs38(Fragment9, { children: [
|
|
5903
|
-
/* @__PURE__ */ jsx75(ModalContextBar, { onClose
|
|
5921
|
+
/* @__PURE__ */ jsx75(ModalContextBar, { onClose }),
|
|
5904
5922
|
/* @__PURE__ */ jsx75(ModalHeading, { pbe: "md", children: "Loading Your Accounts..." }),
|
|
5905
5923
|
/* @__PURE__ */ jsx75(ModalContent, { children: /* @__PURE__ */ jsxs38(VStack, { slot: "center", align: "center", gap: "md", children: [
|
|
5906
5924
|
/* @__PURE__ */ jsx75(LoadingSpinner, { size: 48 }),
|
|
@@ -5909,16 +5927,12 @@ function LinkedAccountsConfirmationModalPreloadedContent({ onClose }) {
|
|
|
5909
5927
|
] });
|
|
5910
5928
|
}
|
|
5911
5929
|
function LinkedAccountsConfirmationModalContent({ onClose }) {
|
|
5912
|
-
const { accounts,
|
|
5930
|
+
const { accounts, onFinish, refetchAccounts } = useLinkedAccountsConfirmationModal();
|
|
5913
5931
|
const [formState, setFormState] = useState14(() => Object.fromEntries(
|
|
5914
5932
|
accounts.map(({ id }) => [id, true])
|
|
5915
5933
|
));
|
|
5916
5934
|
const { trigger, isMutating, error } = useConfirmAndExcludeMultiple({ onSuccess: refetchAccounts });
|
|
5917
5935
|
const hasError = Boolean(error);
|
|
5918
|
-
const handleDismiss = () => {
|
|
5919
|
-
onDismiss();
|
|
5920
|
-
onClose();
|
|
5921
|
-
};
|
|
5922
5936
|
const handleFinish = () => __async(this, null, function* () {
|
|
5923
5937
|
const success = yield trigger(formState);
|
|
5924
5938
|
if (success) {
|
|
@@ -5926,9 +5940,12 @@ function LinkedAccountsConfirmationModalContent({ onClose }) {
|
|
|
5926
5940
|
onClose();
|
|
5927
5941
|
}
|
|
5928
5942
|
});
|
|
5943
|
+
const handleDismiss = () => {
|
|
5944
|
+
onClose();
|
|
5945
|
+
};
|
|
5929
5946
|
const { descriptionLabel, buttonLabel } = getFormComponentLabels(formState);
|
|
5930
5947
|
return /* @__PURE__ */ jsxs38(Fragment9, { children: [
|
|
5931
|
-
/* @__PURE__ */ jsx75(ModalContextBar, { onClose
|
|
5948
|
+
/* @__PURE__ */ jsx75(ModalContextBar, { onClose }),
|
|
5932
5949
|
/* @__PURE__ */ jsx75(ModalHeading, { pbe: "2xs", children: "Confirm Business Accounts" }),
|
|
5933
5950
|
/* @__PURE__ */ jsx75(ModalDescription, { pbe: "md", children: descriptionLabel }),
|
|
5934
5951
|
/* @__PURE__ */ jsx75(ModalContent, { children: /* @__PURE__ */ jsx75(
|
|
@@ -5956,13 +5973,26 @@ function LinkedAccountsConfirmationModalContent({ onClose }) {
|
|
|
5956
5973
|
/* @__PURE__ */ jsx75(ModalActions, { children: /* @__PURE__ */ jsx75(VStack, { gap: "md", children: hasError ? /* @__PURE__ */ jsxs38(Fragment9, { children: [
|
|
5957
5974
|
/* @__PURE__ */ jsx75(P, { size: "sm", children: "An error occurred while confirming accounts. You will have an opportunity to try again later." }),
|
|
5958
5975
|
/* @__PURE__ */ jsx75(P, { size: "sm", children: "No data will be synced until you confirm." }),
|
|
5959
|
-
/* @__PURE__ */ jsx75(Button2, { size: "lg", onPress:
|
|
5960
|
-
] }) : /* @__PURE__ */ jsx75(Button2, { size: "lg", onPress:
|
|
5976
|
+
/* @__PURE__ */ jsx75(Button2, { size: "lg", onPress: close, children: "Close" })
|
|
5977
|
+
] }) : /* @__PURE__ */ jsx75(Button2, { size: "lg", onPress: () => {
|
|
5978
|
+
void handleFinish();
|
|
5979
|
+
}, isPending: isMutating, children: buttonLabel }) }) })
|
|
5961
5980
|
] });
|
|
5962
5981
|
}
|
|
5963
5982
|
function LinkedAccountsConfirmationModal() {
|
|
5964
|
-
const { preloadIsOpen, mainIsOpen } = useLinkedAccountsConfirmationModal();
|
|
5965
|
-
return /* @__PURE__ */ jsx75(
|
|
5983
|
+
const { preloadIsOpen, mainIsOpen, onDismiss } = useLinkedAccountsConfirmationModal();
|
|
5984
|
+
return /* @__PURE__ */ jsx75(
|
|
5985
|
+
Modal,
|
|
5986
|
+
{
|
|
5987
|
+
isOpen: preloadIsOpen || mainIsOpen,
|
|
5988
|
+
onOpenChange: (isOpen) => {
|
|
5989
|
+
if (!isOpen) {
|
|
5990
|
+
onDismiss();
|
|
5991
|
+
}
|
|
5992
|
+
},
|
|
5993
|
+
children: ({ close: close2 }) => preloadIsOpen ? /* @__PURE__ */ jsx75(LinkedAccountsConfirmationModalPreloadedContent, { onClose: close2 }) : /* @__PURE__ */ jsx75(LinkedAccountsConfirmationModalContent, { onClose: close2 })
|
|
5994
|
+
}
|
|
5995
|
+
);
|
|
5966
5996
|
}
|
|
5967
5997
|
|
|
5968
5998
|
// src/components/LinkedAccounts/LinkedAccountsContent.tsx
|
|
@@ -5974,7 +6004,7 @@ var LinkedAccountsContent = ({
|
|
|
5974
6004
|
showBreakConnection
|
|
5975
6005
|
}) => {
|
|
5976
6006
|
const { data, addConnection } = useContext13(LinkedAccountsContext);
|
|
5977
|
-
const linkedAccountsNewAccountClassName =
|
|
6007
|
+
const linkedAccountsNewAccountClassName = classNames25(
|
|
5978
6008
|
"Layer__linked-accounts__new-account",
|
|
5979
6009
|
asWidget && "--as-widget",
|
|
5980
6010
|
showLedgerBalance && "--show-ledger-balance",
|
|
@@ -6050,7 +6080,7 @@ var isDateAllowedToBrowse = (date, business) => {
|
|
|
6050
6080
|
import { useMemo as useMemo10 } from "react";
|
|
6051
6081
|
|
|
6052
6082
|
// src/components/Input/Input.tsx
|
|
6053
|
-
import
|
|
6083
|
+
import classNames26 from "classnames";
|
|
6054
6084
|
import { jsx as jsx77, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
6055
6085
|
var Input = (_a) => {
|
|
6056
6086
|
var _b = _a, {
|
|
@@ -6064,7 +6094,7 @@ var Input = (_a) => {
|
|
|
6064
6094
|
"errorMessage",
|
|
6065
6095
|
"leftText"
|
|
6066
6096
|
]);
|
|
6067
|
-
const baseClassName =
|
|
6097
|
+
const baseClassName = classNames26(
|
|
6068
6098
|
"Layer__input",
|
|
6069
6099
|
isInvalid ? "Layer__input--error" : "",
|
|
6070
6100
|
leftText ? "Layer__input--with-left-text" : "",
|
|
@@ -6080,7 +6110,7 @@ var Input = (_a) => {
|
|
|
6080
6110
|
};
|
|
6081
6111
|
|
|
6082
6112
|
// src/components/Input/InputGroup.tsx
|
|
6083
|
-
import
|
|
6113
|
+
import classNames27 from "classnames";
|
|
6084
6114
|
import { jsx as jsx78, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
6085
6115
|
var InputGroup = ({
|
|
6086
6116
|
label,
|
|
@@ -6089,7 +6119,7 @@ var InputGroup = ({
|
|
|
6089
6119
|
inline,
|
|
6090
6120
|
children
|
|
6091
6121
|
}) => {
|
|
6092
|
-
const baseClassName =
|
|
6122
|
+
const baseClassName = classNames27(
|
|
6093
6123
|
"Layer__input-group",
|
|
6094
6124
|
className,
|
|
6095
6125
|
inline && "Layer__input-group--inline"
|
|
@@ -6268,7 +6298,7 @@ var ChevronDownFill = (_a) => {
|
|
|
6268
6298
|
var ChevronDownFill_default = ChevronDownFill;
|
|
6269
6299
|
|
|
6270
6300
|
// src/components/Input/Select.tsx
|
|
6271
|
-
import
|
|
6301
|
+
import classNames28 from "classnames";
|
|
6272
6302
|
import { jsx as jsx82, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
6273
6303
|
var Select = ({
|
|
6274
6304
|
name,
|
|
@@ -6282,7 +6312,7 @@ var Select = ({
|
|
|
6282
6312
|
isInvalid,
|
|
6283
6313
|
errorMessage
|
|
6284
6314
|
}) => {
|
|
6285
|
-
const baseClassName =
|
|
6315
|
+
const baseClassName = classNames28(
|
|
6286
6316
|
"Layer__select",
|
|
6287
6317
|
isInvalid ? "Layer__select--error" : "",
|
|
6288
6318
|
className
|
|
@@ -6310,7 +6340,7 @@ var Select = ({
|
|
|
6310
6340
|
};
|
|
6311
6341
|
|
|
6312
6342
|
// src/components/Input/InputWithBadge.tsx
|
|
6313
|
-
import
|
|
6343
|
+
import classNames29 from "classnames";
|
|
6314
6344
|
import { jsx as jsx83, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
6315
6345
|
var InputWithBadge = (_a) => {
|
|
6316
6346
|
var _b = _a, {
|
|
@@ -6328,7 +6358,7 @@ var InputWithBadge = (_a) => {
|
|
|
6328
6358
|
"badge",
|
|
6329
6359
|
"variant"
|
|
6330
6360
|
]);
|
|
6331
|
-
const baseClassName =
|
|
6361
|
+
const baseClassName = classNames29(
|
|
6332
6362
|
"Layer__input",
|
|
6333
6363
|
isInvalid ? "Layer__input--error" : "",
|
|
6334
6364
|
leftText ? "Layer__input--with-left-text" : "",
|
|
@@ -6351,7 +6381,7 @@ import { useCallback as useCallback2 } from "react";
|
|
|
6351
6381
|
import ReactSelect2, {
|
|
6352
6382
|
components as components2
|
|
6353
6383
|
} from "react-select";
|
|
6354
|
-
import
|
|
6384
|
+
import classNames30 from "classnames";
|
|
6355
6385
|
import { jsx as jsx84, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
6356
6386
|
var MultiSelect = ({
|
|
6357
6387
|
name,
|
|
@@ -6367,7 +6397,7 @@ var MultiSelect = ({
|
|
|
6367
6397
|
errorMessage,
|
|
6368
6398
|
styles
|
|
6369
6399
|
}) => {
|
|
6370
|
-
const baseClassName =
|
|
6400
|
+
const baseClassName = classNames30(
|
|
6371
6401
|
"Layer__select",
|
|
6372
6402
|
isInvalid ? "Layer__select--error" : "",
|
|
6373
6403
|
className
|
|
@@ -6399,7 +6429,7 @@ var MultiSelect = ({
|
|
|
6399
6429
|
};
|
|
6400
6430
|
|
|
6401
6431
|
// src/components/Input/AmountInput.tsx
|
|
6402
|
-
import
|
|
6432
|
+
import classNames31 from "classnames";
|
|
6403
6433
|
import CurrencyInput from "react-currency-input-field";
|
|
6404
6434
|
import { jsx as jsx85, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
6405
6435
|
var AmountInput = (_a) => {
|
|
@@ -6418,7 +6448,7 @@ var AmountInput = (_a) => {
|
|
|
6418
6448
|
"isInvalid",
|
|
6419
6449
|
"placeholder"
|
|
6420
6450
|
]);
|
|
6421
|
-
const baseClassName =
|
|
6451
|
+
const baseClassName = classNames31(
|
|
6422
6452
|
"Layer__input Layer__amount-input",
|
|
6423
6453
|
isInvalid ? "Layer__input--error" : "",
|
|
6424
6454
|
leftText ? "Layer__input--with-left-text" : "",
|
|
@@ -6546,14 +6576,43 @@ var DatePickerOptions = ({
|
|
|
6546
6576
|
};
|
|
6547
6577
|
|
|
6548
6578
|
// src/components/DatePicker/DatePicker.tsx
|
|
6549
|
-
import
|
|
6550
|
-
import { endOfDay as endOfDay2, endOfMonth as endOfMonth4, endOfYear as endOfYear3 } from "date-fns";
|
|
6579
|
+
import classNames32 from "classnames";
|
|
6580
|
+
import { endOfDay as endOfDay2, endOfMonth as endOfMonth4, endOfYear as endOfYear3, getYear } from "date-fns";
|
|
6551
6581
|
import { Fragment as Fragment13, jsx as jsx88, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
6552
6582
|
var ReactDatePicker = RDP.default.default || RDP.default || RDP;
|
|
6553
6583
|
var isRangeMode = (displayMode) => displayMode === "dayRangePicker" || displayMode === "monthRangePicker";
|
|
6554
6584
|
var showNavigationArrows = (navigateArrows, isDesktop) => {
|
|
6555
6585
|
return navigateArrows && (isDesktop && navigateArrows.includes("desktop") || !isDesktop && navigateArrows.includes("mobile"));
|
|
6556
6586
|
};
|
|
6587
|
+
var renderYearContent = (calendarYear, highlightYears) => {
|
|
6588
|
+
if (!highlightYears || !highlightYears.includes(calendarYear)) {
|
|
6589
|
+
return /* @__PURE__ */ jsx88("span", { className: "Layer__datepicker__year-content", children: calendarYear });
|
|
6590
|
+
}
|
|
6591
|
+
return /* @__PURE__ */ jsxs49("span", { className: "Layer__datepicker__year-content", children: [
|
|
6592
|
+
calendarYear,
|
|
6593
|
+
/* @__PURE__ */ jsx88("span", { className: "Layer__datepicker__date-dot" })
|
|
6594
|
+
] });
|
|
6595
|
+
};
|
|
6596
|
+
var highlightBackArrow = ({
|
|
6597
|
+
currentDate,
|
|
6598
|
+
modePicker,
|
|
6599
|
+
highlightYears
|
|
6600
|
+
}) => {
|
|
6601
|
+
if (modePicker === "yearPicker") {
|
|
6602
|
+
return Boolean(highlightYears == null ? void 0 : highlightYears.find((year) => year < getYear(currentDate)));
|
|
6603
|
+
}
|
|
6604
|
+
return false;
|
|
6605
|
+
};
|
|
6606
|
+
var highlightNextArrow = ({
|
|
6607
|
+
currentDate,
|
|
6608
|
+
modePicker,
|
|
6609
|
+
highlightYears
|
|
6610
|
+
}) => {
|
|
6611
|
+
if (modePicker === "yearPicker") {
|
|
6612
|
+
return Boolean(highlightYears == null ? void 0 : highlightYears.find((year) => year > getYear(currentDate)));
|
|
6613
|
+
}
|
|
6614
|
+
return false;
|
|
6615
|
+
};
|
|
6557
6616
|
var DatePicker = (_a) => {
|
|
6558
6617
|
var _b = _a, {
|
|
6559
6618
|
selected,
|
|
@@ -6573,6 +6632,7 @@ var DatePicker = (_a) => {
|
|
|
6573
6632
|
maxDate = /* @__PURE__ */ new Date(),
|
|
6574
6633
|
currentDateOption = true,
|
|
6575
6634
|
navigateArrows = displayMode === "monthPicker" ? ["mobile"] : void 0,
|
|
6635
|
+
highlightYears,
|
|
6576
6636
|
onChangeMode,
|
|
6577
6637
|
slots
|
|
6578
6638
|
} = _b, props = __objRest(_b, [
|
|
@@ -6593,6 +6653,7 @@ var DatePicker = (_a) => {
|
|
|
6593
6653
|
"maxDate",
|
|
6594
6654
|
"currentDateOption",
|
|
6595
6655
|
"navigateArrows",
|
|
6656
|
+
"highlightYears",
|
|
6596
6657
|
"onChangeMode",
|
|
6597
6658
|
"slots"
|
|
6598
6659
|
]);
|
|
@@ -6621,21 +6682,21 @@ var DatePicker = (_a) => {
|
|
|
6621
6682
|
return [selected[0], null];
|
|
6622
6683
|
}, [selected, displayMode]);
|
|
6623
6684
|
const { isDesktop } = useSizeClass();
|
|
6624
|
-
const wrapperClassNames =
|
|
6685
|
+
const wrapperClassNames = classNames32(
|
|
6625
6686
|
"Layer__datepicker__wrapper",
|
|
6626
6687
|
displayMode === "timePicker" && "Layer__datepicker__time__wrapper",
|
|
6627
6688
|
showNavigationArrows(navigateArrows, isDesktop) && "Layer__datepicker__wrapper--arrows"
|
|
6628
6689
|
);
|
|
6629
|
-
const datePickerWrapperClassNames =
|
|
6690
|
+
const datePickerWrapperClassNames = classNames32(
|
|
6630
6691
|
"Layer__datepicker",
|
|
6631
6692
|
displayMode === "timePicker" && "Layer__datepicker__time",
|
|
6632
6693
|
wrapperClassName
|
|
6633
6694
|
);
|
|
6634
|
-
const calendarClassNames =
|
|
6695
|
+
const calendarClassNames = classNames32(
|
|
6635
6696
|
"Layer__datepicker__calendar",
|
|
6636
6697
|
calendarClassName
|
|
6637
6698
|
);
|
|
6638
|
-
const popperClassNames =
|
|
6699
|
+
const popperClassNames = classNames32(
|
|
6639
6700
|
"Layer__datepicker__popper",
|
|
6640
6701
|
displayMode === "timePicker" && "Layer__datepicker__time__popper",
|
|
6641
6702
|
popperClassName
|
|
@@ -6778,7 +6839,8 @@ var DatePicker = (_a) => {
|
|
|
6778
6839
|
onFocus: (e) => {
|
|
6779
6840
|
e.target.blur();
|
|
6780
6841
|
},
|
|
6781
|
-
disabled
|
|
6842
|
+
disabled,
|
|
6843
|
+
renderYearContent: (d) => renderYearContent(d, highlightYears)
|
|
6782
6844
|
}, props), {
|
|
6783
6845
|
children: [
|
|
6784
6846
|
ModeSelector && pickerMode !== "timePicker" ? /* @__PURE__ */ jsx88(
|
|
@@ -6800,38 +6862,52 @@ var DatePicker = (_a) => {
|
|
|
6800
6862
|
})
|
|
6801
6863
|
),
|
|
6802
6864
|
showNavigationArrows(navigateArrows, isDesktop) && /* @__PURE__ */ jsxs49(Fragment13, { children: [
|
|
6803
|
-
/* @__PURE__ */
|
|
6865
|
+
/* @__PURE__ */ jsxs49(
|
|
6804
6866
|
Button,
|
|
6805
6867
|
{
|
|
6806
6868
|
"aria-label": "Previous Date",
|
|
6807
|
-
className:
|
|
6869
|
+
className: classNames32(
|
|
6808
6870
|
"Layer__datepicker__prev-button",
|
|
6809
6871
|
isBeforeMinDate && "Layer__datepicker__button--disabled"
|
|
6810
6872
|
),
|
|
6811
6873
|
onClick: () => handleNavigateDate(-1),
|
|
6812
6874
|
variant: "secondary" /* secondary */,
|
|
6813
6875
|
disabled: isBeforeMinDate || disabled,
|
|
6814
|
-
children:
|
|
6876
|
+
children: [
|
|
6877
|
+
/* @__PURE__ */ jsx88(ChevronLeft_default, { className: "Layer__datepicker__button-icon", size: 16 }),
|
|
6878
|
+
highlightBackArrow({
|
|
6879
|
+
currentDate: firstDate,
|
|
6880
|
+
modePicker: pickerMode,
|
|
6881
|
+
highlightYears
|
|
6882
|
+
}) && /* @__PURE__ */ jsx88("span", { className: "Layer__datepicker__nav-arrow-highlight" })
|
|
6883
|
+
]
|
|
6815
6884
|
}
|
|
6816
6885
|
),
|
|
6817
|
-
/* @__PURE__ */
|
|
6886
|
+
/* @__PURE__ */ jsxs49(
|
|
6818
6887
|
Button,
|
|
6819
6888
|
{
|
|
6820
6889
|
"aria-label": "Next Date",
|
|
6821
6890
|
variant: "secondary" /* secondary */,
|
|
6822
|
-
className:
|
|
6891
|
+
className: classNames32(
|
|
6823
6892
|
"Layer__datepicker__next-button",
|
|
6824
6893
|
isTodayOrAfter ? "Layer__datepicker__button--disabled" : void 0
|
|
6825
6894
|
),
|
|
6826
6895
|
onClick: () => handleNavigateDate(1),
|
|
6827
6896
|
disabled: isTodayOrAfter || disabled,
|
|
6828
|
-
children:
|
|
6829
|
-
|
|
6830
|
-
|
|
6831
|
-
|
|
6832
|
-
|
|
6833
|
-
|
|
6834
|
-
|
|
6897
|
+
children: [
|
|
6898
|
+
/* @__PURE__ */ jsx88(
|
|
6899
|
+
ChevronRight_default,
|
|
6900
|
+
{
|
|
6901
|
+
className: "Layer__datepicker__button-icon",
|
|
6902
|
+
size: 16
|
|
6903
|
+
}
|
|
6904
|
+
),
|
|
6905
|
+
highlightNextArrow({
|
|
6906
|
+
currentDate: firstDate,
|
|
6907
|
+
modePicker: pickerMode,
|
|
6908
|
+
highlightYears
|
|
6909
|
+
}) && /* @__PURE__ */ jsx88("span", { className: "Layer__datepicker__nav-arrow-highlight" })
|
|
6910
|
+
]
|
|
6835
6911
|
}
|
|
6836
6912
|
)
|
|
6837
6913
|
] }),
|
|
@@ -7072,8 +7148,7 @@ var humanizeEnum = (text) => {
|
|
|
7072
7148
|
return capitalizeFirstLetter(text.replace(/_/gi, " ").toLowerCase());
|
|
7073
7149
|
};
|
|
7074
7150
|
var convertNumberToCurrency = (amount) => {
|
|
7075
|
-
if (typeof amount !== "number" || isNaN(amount))
|
|
7076
|
-
return "";
|
|
7151
|
+
if (typeof amount !== "number" || isNaN(amount)) return "";
|
|
7077
7152
|
const formattedValue = amount.toLocaleString("en-US");
|
|
7078
7153
|
return formattedValue.length > 0 ? `$${formattedValue}` : "";
|
|
7079
7154
|
};
|
|
@@ -7212,11 +7287,11 @@ function OpeningBalanceModal({
|
|
|
7212
7287
|
setAccountsToAddOpeningBalanceInModal([]);
|
|
7213
7288
|
}
|
|
7214
7289
|
},
|
|
7215
|
-
children: ({ close }) => /* @__PURE__ */ jsx90(
|
|
7290
|
+
children: ({ close: close2 }) => /* @__PURE__ */ jsx90(
|
|
7216
7291
|
LinkedAccountsOpeningBalanceModalContent,
|
|
7217
7292
|
{
|
|
7218
7293
|
accounts: accountsToAddOpeningBalanceInModal,
|
|
7219
|
-
onClose:
|
|
7294
|
+
onClose: close2,
|
|
7220
7295
|
stringOverrides
|
|
7221
7296
|
}
|
|
7222
7297
|
)
|
|
@@ -7727,7 +7802,7 @@ import { useContext as useContext16 } from "react";
|
|
|
7727
7802
|
import { useState as useState18 } from "react";
|
|
7728
7803
|
|
|
7729
7804
|
// src/components/ActionableList/ActionableList.tsx
|
|
7730
|
-
import
|
|
7805
|
+
import classNames33 from "classnames";
|
|
7731
7806
|
import { jsx as jsx98, jsxs as jsxs57 } from "react/jsx-runtime";
|
|
7732
7807
|
var ActionableList = ({
|
|
7733
7808
|
options,
|
|
@@ -7740,7 +7815,7 @@ var ActionableList = ({
|
|
|
7740
7815
|
{
|
|
7741
7816
|
role: "button",
|
|
7742
7817
|
onClick: () => onClick(x),
|
|
7743
|
-
className:
|
|
7818
|
+
className: classNames33(
|
|
7744
7819
|
x.secondary && "Layer__actionable-list-item--secondary",
|
|
7745
7820
|
x.asLink && "Layer__actionable-list-item--as-link",
|
|
7746
7821
|
selectedId === x.id && "Layer__actionable-list__item--selected"
|
|
@@ -7882,7 +7957,7 @@ var BusinessCategories = ({
|
|
|
7882
7957
|
};
|
|
7883
7958
|
|
|
7884
7959
|
// src/components/CategorySelect/CategorySelectDrawer.tsx
|
|
7885
|
-
import
|
|
7960
|
+
import classNames34 from "classnames";
|
|
7886
7961
|
import { jsx as jsx100, jsxs as jsxs59 } from "react/jsx-runtime";
|
|
7887
7962
|
var CategorySelectDrawer = ({
|
|
7888
7963
|
onSelect,
|
|
@@ -7890,16 +7965,16 @@ var CategorySelectDrawer = ({
|
|
|
7890
7965
|
showTooltips: _showTooltips
|
|
7891
7966
|
}) => {
|
|
7892
7967
|
var _a, _b;
|
|
7893
|
-
const { setContent, close } = useContext16(DrawerContext);
|
|
7968
|
+
const { setContent, close: close2 } = useContext16(DrawerContext);
|
|
7894
7969
|
const onDrawerCategorySelect = (value) => {
|
|
7895
|
-
|
|
7970
|
+
close2();
|
|
7896
7971
|
onSelect(value);
|
|
7897
7972
|
};
|
|
7898
7973
|
return /* @__PURE__ */ jsxs59(
|
|
7899
7974
|
"button",
|
|
7900
7975
|
{
|
|
7901
7976
|
"aria-label": "Select category",
|
|
7902
|
-
className:
|
|
7977
|
+
className: classNames34(
|
|
7903
7978
|
"Layer__category-menu__drawer-btn",
|
|
7904
7979
|
selected && "Layer__category-menu__drawer-btn--selected"
|
|
7905
7980
|
),
|
|
@@ -7948,7 +8023,7 @@ var CategorySelectDrawerContent = ({
|
|
|
7948
8023
|
};
|
|
7949
8024
|
|
|
7950
8025
|
// src/components/CategorySelect/CategorySelect.tsx
|
|
7951
|
-
import
|
|
8026
|
+
import classNames35 from "classnames";
|
|
7952
8027
|
import { parseISO as parseISO4, format as formatTime } from "date-fns";
|
|
7953
8028
|
import { jsx as jsx101, jsxs as jsxs60 } from "react/jsx-runtime";
|
|
7954
8029
|
var mapCategoryToOption2 = (category) => {
|
|
@@ -8000,7 +8075,7 @@ var GroupHeading = (props) => {
|
|
|
8000
8075
|
return /* @__PURE__ */ jsx101(
|
|
8001
8076
|
components3.GroupHeading,
|
|
8002
8077
|
__spreadValues({
|
|
8003
|
-
className:
|
|
8078
|
+
className: classNames35(
|
|
8004
8079
|
props.className,
|
|
8005
8080
|
props.children === "Match" || props.children === "All categories" ? "Layer__select__group-heading--main" : ""
|
|
8006
8081
|
)
|
|
@@ -8338,8 +8413,7 @@ var useReceiptsContext = () => useContext17(ReceiptsContext);
|
|
|
8338
8413
|
import { useEffect as useEffect10, useState as useState19 } from "react";
|
|
8339
8414
|
import { parseISO as parseISO5, format as formatTime2 } from "date-fns";
|
|
8340
8415
|
var readDate = (date) => {
|
|
8341
|
-
if (!date)
|
|
8342
|
-
return void 0;
|
|
8416
|
+
if (!date) return void 0;
|
|
8343
8417
|
return date && formatTime2(parseISO5(date), DATE_FORMAT);
|
|
8344
8418
|
};
|
|
8345
8419
|
var useReceipts = ({
|
|
@@ -8424,8 +8498,7 @@ var useReceipts = ({
|
|
|
8424
8498
|
}
|
|
8425
8499
|
});
|
|
8426
8500
|
const archiveDocument = (document2) => __async(void 0, null, function* () {
|
|
8427
|
-
if (!document2.id)
|
|
8428
|
-
return;
|
|
8501
|
+
if (!document2.id) return;
|
|
8429
8502
|
try {
|
|
8430
8503
|
if (document2.error) {
|
|
8431
8504
|
setReceiptUrls(receiptUrls.filter((url) => url.id !== document2.id));
|
|
@@ -8520,7 +8593,7 @@ var Eye = (_a) => {
|
|
|
8520
8593
|
var Eye_default = Eye;
|
|
8521
8594
|
|
|
8522
8595
|
// src/components/FileThumb/FileThumb.tsx
|
|
8523
|
-
import
|
|
8596
|
+
import classNames36 from "classnames";
|
|
8524
8597
|
import { jsx as jsx106, jsxs as jsxs64 } from "react/jsx-runtime";
|
|
8525
8598
|
var FileThumb = ({
|
|
8526
8599
|
url,
|
|
@@ -8539,7 +8612,7 @@ var FileThumb = ({
|
|
|
8539
8612
|
return /* @__PURE__ */ jsxs64(
|
|
8540
8613
|
"div",
|
|
8541
8614
|
{
|
|
8542
|
-
className:
|
|
8615
|
+
className: classNames36(
|
|
8543
8616
|
"Layer__file-thumb",
|
|
8544
8617
|
floatingActions && "Layer__file-thumb--floating"
|
|
8545
8618
|
),
|
|
@@ -8572,7 +8645,7 @@ var FileThumb = ({
|
|
|
8572
8645
|
enableOpen || enableDownload || onDelete ? /* @__PURE__ */ jsxs64(
|
|
8573
8646
|
"div",
|
|
8574
8647
|
{
|
|
8575
|
-
className:
|
|
8648
|
+
className: classNames36(
|
|
8576
8649
|
"Layer__file-thumb__actions",
|
|
8577
8650
|
floatingActions && "Layer__file-thumb__actions--floating"
|
|
8578
8651
|
),
|
|
@@ -8730,7 +8803,7 @@ var MatchBadge = ({
|
|
|
8730
8803
|
};
|
|
8731
8804
|
|
|
8732
8805
|
// src/components/MatchForm/MatchForm.tsx
|
|
8733
|
-
import
|
|
8806
|
+
import classNames37 from "classnames";
|
|
8734
8807
|
import { parseISO as parseISO7, format as formatTime4 } from "date-fns";
|
|
8735
8808
|
import { jsx as jsx109, jsxs as jsxs67 } from "react/jsx-runtime";
|
|
8736
8809
|
var MatchForm = ({
|
|
@@ -8759,7 +8832,7 @@ var MatchForm = ({
|
|
|
8759
8832
|
return /* @__PURE__ */ jsxs67(
|
|
8760
8833
|
"div",
|
|
8761
8834
|
{
|
|
8762
|
-
className:
|
|
8835
|
+
className: classNames37(
|
|
8763
8836
|
`${classNamePrefix}__match-row`,
|
|
8764
8837
|
match.id === selectedMatchId ? `${classNamePrefix}__match-row--selected` : ""
|
|
8765
8838
|
),
|
|
@@ -8836,7 +8909,7 @@ var MatchForm = ({
|
|
|
8836
8909
|
};
|
|
8837
8910
|
|
|
8838
8911
|
// src/components/MatchForm/MatchFormMobile.tsx
|
|
8839
|
-
import
|
|
8912
|
+
import classNames38 from "classnames";
|
|
8840
8913
|
import { parseISO as parseISO8, format as formatTime5 } from "date-fns";
|
|
8841
8914
|
import { jsx as jsx110, jsxs as jsxs68 } from "react/jsx-runtime";
|
|
8842
8915
|
var MatchFormMobile = ({
|
|
@@ -8852,7 +8925,7 @@ var MatchFormMobile = ({
|
|
|
8852
8925
|
return /* @__PURE__ */ jsxs68(
|
|
8853
8926
|
"div",
|
|
8854
8927
|
{
|
|
8855
|
-
className:
|
|
8928
|
+
className: classNames38(
|
|
8856
8929
|
`${classNamePrefix}__match-item`,
|
|
8857
8930
|
match.id === selectedMatchId ? `${classNamePrefix}__match-item--selected` : ""
|
|
8858
8931
|
),
|
|
@@ -8913,7 +8986,7 @@ var MatchFormMobile = ({
|
|
|
8913
8986
|
};
|
|
8914
8987
|
|
|
8915
8988
|
// src/components/Textarea/Textarea.tsx
|
|
8916
|
-
import
|
|
8989
|
+
import classNames39 from "classnames";
|
|
8917
8990
|
import { jsx as jsx111, jsxs as jsxs69 } from "react/jsx-runtime";
|
|
8918
8991
|
var Textarea = (_a) => {
|
|
8919
8992
|
var _b = _a, {
|
|
@@ -8925,7 +8998,7 @@ var Textarea = (_a) => {
|
|
|
8925
8998
|
"isInvalid",
|
|
8926
8999
|
"errorMessage"
|
|
8927
9000
|
]);
|
|
8928
|
-
const baseClassName =
|
|
9001
|
+
const baseClassName = classNames39(
|
|
8929
9002
|
"Layer__textarea",
|
|
8930
9003
|
isInvalid ? "Layer__textarea--error" : "",
|
|
8931
9004
|
className
|
|
@@ -8942,7 +9015,7 @@ import {
|
|
|
8942
9015
|
useMemo as useMemo12,
|
|
8943
9016
|
useState as useState20
|
|
8944
9017
|
} from "react";
|
|
8945
|
-
import
|
|
9018
|
+
import classNames40 from "classnames";
|
|
8946
9019
|
import { jsx as jsx112, jsxs as jsxs70 } from "react/jsx-runtime";
|
|
8947
9020
|
import { createElement } from "react";
|
|
8948
9021
|
var Toggle = ({
|
|
@@ -8963,7 +9036,7 @@ var Toggle = ({
|
|
|
8963
9036
|
setCurrentWidth(c.width);
|
|
8964
9037
|
}
|
|
8965
9038
|
});
|
|
8966
|
-
const baseClassName =
|
|
9039
|
+
const baseClassName = classNames40(
|
|
8967
9040
|
"Layer__toggle",
|
|
8968
9041
|
`Layer__toggle--${size}`,
|
|
8969
9042
|
initialized ? "Layer__toggle--initialized" : ""
|
|
@@ -9048,7 +9121,7 @@ var ToggleOption = ({
|
|
|
9048
9121
|
style,
|
|
9049
9122
|
index
|
|
9050
9123
|
}) => {
|
|
9051
|
-
const optionClassName =
|
|
9124
|
+
const optionClassName = classNames40("Layer__toggle-option", {
|
|
9052
9125
|
"Layer__toggle-option--active": checked
|
|
9053
9126
|
});
|
|
9054
9127
|
if (disabled) {
|
|
@@ -9213,7 +9286,7 @@ var Notification = ({
|
|
|
9213
9286
|
};
|
|
9214
9287
|
|
|
9215
9288
|
// src/components/ExpandedBankTransactionRow/ExpandedBankTransactionRow.tsx
|
|
9216
|
-
import
|
|
9289
|
+
import classNames41 from "classnames";
|
|
9217
9290
|
|
|
9218
9291
|
// src/hooks/bookkeeping/useBookkeepingStatus.ts
|
|
9219
9292
|
import useSWR4 from "swr";
|
|
@@ -9236,7 +9309,12 @@ function LegacyModeProvider({
|
|
|
9236
9309
|
}
|
|
9237
9310
|
|
|
9238
9311
|
// src/hooks/bookkeeping/useBookkeepingStatus.ts
|
|
9239
|
-
var BOOKKEEPING_STATUSES = [
|
|
9312
|
+
var BOOKKEEPING_STATUSES = [
|
|
9313
|
+
"NOT_PURCHASED",
|
|
9314
|
+
"ACTIVE",
|
|
9315
|
+
"ONBOARDING",
|
|
9316
|
+
"BOOKKEEPING_PAUSED"
|
|
9317
|
+
];
|
|
9240
9318
|
function constrainToKnownBookkeepingStatus(status) {
|
|
9241
9319
|
if (BOOKKEEPING_STATUSES.includes(status)) {
|
|
9242
9320
|
return status;
|
|
@@ -9256,7 +9334,7 @@ function buildKey4({
|
|
|
9256
9334
|
accessToken,
|
|
9257
9335
|
apiUrl,
|
|
9258
9336
|
businessId,
|
|
9259
|
-
tags: ["#bookkeeping, #status"]
|
|
9337
|
+
tags: ["#bookkeeping", "#status"]
|
|
9260
9338
|
};
|
|
9261
9339
|
}
|
|
9262
9340
|
}
|
|
@@ -9327,7 +9405,7 @@ var ExpandedBankTransactionRow = forwardRef10(
|
|
|
9327
9405
|
({
|
|
9328
9406
|
bankTransaction,
|
|
9329
9407
|
isOpen = false,
|
|
9330
|
-
close,
|
|
9408
|
+
close: close2,
|
|
9331
9409
|
categorized,
|
|
9332
9410
|
asListItem = false,
|
|
9333
9411
|
submitBtnText = "Save",
|
|
@@ -9472,7 +9550,7 @@ var ExpandedBankTransactionRow = forwardRef10(
|
|
|
9472
9550
|
yield onMatchSubmit(selectedMatchId);
|
|
9473
9551
|
return;
|
|
9474
9552
|
}
|
|
9475
|
-
|
|
9553
|
+
close2();
|
|
9476
9554
|
return;
|
|
9477
9555
|
}
|
|
9478
9556
|
if (!validateSplit(rowState)) {
|
|
@@ -9498,7 +9576,7 @@ var ExpandedBankTransactionRow = forwardRef10(
|
|
|
9498
9576
|
}))
|
|
9499
9577
|
}
|
|
9500
9578
|
);
|
|
9501
|
-
|
|
9579
|
+
close2();
|
|
9502
9580
|
});
|
|
9503
9581
|
const fetchMemos = () => __async(void 0, null, function* () {
|
|
9504
9582
|
const getBankTransactionMetadata2 = Layer.getBankTransactionMetadata(
|
|
@@ -9512,8 +9590,7 @@ var ExpandedBankTransactionRow = forwardRef10(
|
|
|
9512
9590
|
}
|
|
9513
9591
|
);
|
|
9514
9592
|
const result = yield getBankTransactionMetadata2();
|
|
9515
|
-
if (result.data.memo)
|
|
9516
|
-
setMemoText(result.data.memo);
|
|
9593
|
+
if (result.data.memo) setMemoText(result.data.memo);
|
|
9517
9594
|
});
|
|
9518
9595
|
useImperativeHandle2(ref, () => ({
|
|
9519
9596
|
save
|
|
@@ -9527,7 +9604,7 @@ var ExpandedBankTransactionRow = forwardRef10(
|
|
|
9527
9604
|
return;
|
|
9528
9605
|
}
|
|
9529
9606
|
yield matchBankTransaction2(bankTransaction.id, foundMatch.id);
|
|
9530
|
-
|
|
9607
|
+
close2();
|
|
9531
9608
|
});
|
|
9532
9609
|
const getDivHeight = useCallback3(() => {
|
|
9533
9610
|
const { height: height2 } = bodyRef.current ? bodyRef.current.getBoundingClientRect() : { height: void 0 };
|
|
@@ -9563,8 +9640,7 @@ var ExpandedBankTransactionRow = forwardRef10(
|
|
|
9563
9640
|
}, [getDivHeight, isOpen]);
|
|
9564
9641
|
useEffect13(() => {
|
|
9565
9642
|
const loadDocumentsAndMetadata = () => __async(void 0, null, function* () {
|
|
9566
|
-
if (showDescriptions && isOpen)
|
|
9567
|
-
yield fetchMemos();
|
|
9643
|
+
if (showDescriptions && isOpen) yield fetchMemos();
|
|
9568
9644
|
setIsLoaded(true);
|
|
9569
9645
|
setOver(true);
|
|
9570
9646
|
});
|
|
@@ -9612,7 +9688,7 @@ var ExpandedBankTransactionRow = forwardRef10(
|
|
|
9612
9688
|
/* @__PURE__ */ jsx115(
|
|
9613
9689
|
"div",
|
|
9614
9690
|
{
|
|
9615
|
-
className:
|
|
9691
|
+
className: classNames41(
|
|
9616
9692
|
`${className}__match`,
|
|
9617
9693
|
`${className}__content-panel`,
|
|
9618
9694
|
purpose === "match" /* match */ ? `${className}__content-panel--active` : ""
|
|
@@ -9636,7 +9712,7 @@ var ExpandedBankTransactionRow = forwardRef10(
|
|
|
9636
9712
|
/* @__PURE__ */ jsx115(
|
|
9637
9713
|
"div",
|
|
9638
9714
|
{
|
|
9639
|
-
className:
|
|
9715
|
+
className: classNames41(
|
|
9640
9716
|
`${className}__splits`,
|
|
9641
9717
|
`${className}__content-panel`,
|
|
9642
9718
|
purpose === "categorize" /* categorize */ ? `${className}__content-panel--active` : ""
|
|
@@ -9830,7 +9906,7 @@ var SplitTooltipDetails = ({
|
|
|
9830
9906
|
};
|
|
9831
9907
|
|
|
9832
9908
|
// src/components/BankTransactionRow/BankTransactionRow.tsx
|
|
9833
|
-
import
|
|
9909
|
+
import classNames42 from "classnames";
|
|
9834
9910
|
import { parseISO as parseISO9, format as formatTime6 } from "date-fns";
|
|
9835
9911
|
import { Fragment as Fragment16, jsx as jsx118, jsxs as jsxs74 } from "react/jsx-runtime";
|
|
9836
9912
|
var extractDescriptionForSplit = (category) => {
|
|
@@ -9944,7 +10020,7 @@ var BankTransactionRow = ({
|
|
|
9944
10020
|
const categorized = isCategorized(bankTransaction);
|
|
9945
10021
|
const className = "Layer__bank-transaction-row";
|
|
9946
10022
|
const openClassName = open ? `${className}--expanded` : "";
|
|
9947
|
-
const rowClassName =
|
|
10023
|
+
const rowClassName = classNames42(
|
|
9948
10024
|
className,
|
|
9949
10025
|
bankTransaction.recently_categorized && editable && shouldHideAfterCategorize(bankTransaction) ? "Layer__bank-transaction-row--removing" : "",
|
|
9950
10026
|
open ? openClassName : "",
|
|
@@ -10022,7 +10098,7 @@ var BankTransactionRow = ({
|
|
|
10022
10098
|
/* @__PURE__ */ jsx118(
|
|
10023
10099
|
"td",
|
|
10024
10100
|
{
|
|
10025
|
-
className:
|
|
10101
|
+
className: classNames42(
|
|
10026
10102
|
"Layer__table-cell",
|
|
10027
10103
|
"Layer__table-cell__category-col",
|
|
10028
10104
|
`${className}__actions-cell`,
|
|
@@ -10204,7 +10280,7 @@ var Assignment = ({ bankTransaction }) => {
|
|
|
10204
10280
|
};
|
|
10205
10281
|
|
|
10206
10282
|
// src/components/BankTransactionList/BankTransactionListItem.tsx
|
|
10207
|
-
import
|
|
10283
|
+
import classNames43 from "classnames";
|
|
10208
10284
|
import { parseISO as parseISO11, format as formatTime8 } from "date-fns";
|
|
10209
10285
|
import { jsx as jsx120, jsxs as jsxs76 } from "react/jsx-runtime";
|
|
10210
10286
|
var BankTransactionListItem = ({
|
|
@@ -10275,7 +10351,7 @@ var BankTransactionListItem = ({
|
|
|
10275
10351
|
const categorized = isCategorized(bankTransaction);
|
|
10276
10352
|
const className = "Layer__bank-transaction-list-item";
|
|
10277
10353
|
const openClassName = open ? `${className}--expanded` : "";
|
|
10278
|
-
const rowClassName =
|
|
10354
|
+
const rowClassName = classNames43(
|
|
10279
10355
|
className,
|
|
10280
10356
|
bankTransaction.recently_categorized && editable && shouldHideAfterCategorize(bankTransaction) ? "Layer__bank-transaction-row--removing" : "",
|
|
10281
10357
|
open ? openClassName : "",
|
|
@@ -10486,8 +10562,7 @@ var useMemoText = ({ bankTransaction, isActive }) => {
|
|
|
10486
10562
|
}
|
|
10487
10563
|
);
|
|
10488
10564
|
const result = yield getBankTransactionMetadata2();
|
|
10489
|
-
if (result.data.memo)
|
|
10490
|
-
setMemoText(result.data.memo);
|
|
10565
|
+
if (result.data.memo) setMemoText(result.data.memo);
|
|
10491
10566
|
} catch (error) {
|
|
10492
10567
|
console.error(error);
|
|
10493
10568
|
}
|
|
@@ -10525,7 +10600,7 @@ var MemoTextProvider = ({
|
|
|
10525
10600
|
};
|
|
10526
10601
|
|
|
10527
10602
|
// src/components/BankTransactionMobileList/BusinessForm.tsx
|
|
10528
|
-
import
|
|
10603
|
+
import classNames44 from "classnames";
|
|
10529
10604
|
import { jsx as jsx124, jsxs as jsxs77 } from "react/jsx-runtime";
|
|
10530
10605
|
var BusinessForm = ({
|
|
10531
10606
|
bankTransaction,
|
|
@@ -10535,7 +10610,7 @@ var BusinessForm = ({
|
|
|
10535
10610
|
showDescriptions
|
|
10536
10611
|
}) => {
|
|
10537
10612
|
const receiptsRef = useRef12(null);
|
|
10538
|
-
const { setContent, close } = useContext20(DrawerContext);
|
|
10613
|
+
const { setContent, close: close2 } = useContext20(DrawerContext);
|
|
10539
10614
|
const { categorize: categorizeBankTransaction2, isLoading } = useBankTransactionsContext();
|
|
10540
10615
|
const [selectedCategory, setSelectedCategory] = useState26(
|
|
10541
10616
|
getAssignedValue(bankTransaction)
|
|
@@ -10569,7 +10644,7 @@ var BusinessForm = ({
|
|
|
10569
10644
|
return options2;
|
|
10570
10645
|
}, [bankTransaction, selectedCategory]);
|
|
10571
10646
|
const onDrawerCategorySelect = (value) => {
|
|
10572
|
-
|
|
10647
|
+
close2();
|
|
10573
10648
|
setSelectedCategory(value);
|
|
10574
10649
|
};
|
|
10575
10650
|
const openDrawer = () => {
|
|
@@ -10659,7 +10734,7 @@ var BusinessForm = ({
|
|
|
10659
10734
|
/* @__PURE__ */ jsx124(
|
|
10660
10735
|
"div",
|
|
10661
10736
|
{
|
|
10662
|
-
className:
|
|
10737
|
+
className: classNames44(
|
|
10663
10738
|
"Layer__bank-transaction-mobile-list-item__receipts",
|
|
10664
10739
|
hasReceipts(bankTransaction) ? "Layer__bank-transaction-mobile-list-item__actions--with-receipts" : void 0
|
|
10665
10740
|
),
|
|
@@ -10721,7 +10796,7 @@ var PersonalCategories = /* @__PURE__ */ ((PersonalCategories2) => {
|
|
|
10721
10796
|
})(PersonalCategories || {});
|
|
10722
10797
|
|
|
10723
10798
|
// src/components/BankTransactionMobileList/PersonalForm.tsx
|
|
10724
|
-
import
|
|
10799
|
+
import classNames45 from "classnames";
|
|
10725
10800
|
import { jsx as jsx125, jsxs as jsxs78 } from "react/jsx-runtime";
|
|
10726
10801
|
var isAlreadyAssigned = (bankTransaction) => {
|
|
10727
10802
|
if (bankTransaction.categorization_status === "MATCHED" /* MATCHED */ || (bankTransaction == null ? void 0 : bankTransaction.categorization_status) === "SPLIT" /* SPLIT */) {
|
|
@@ -10794,7 +10869,7 @@ var PersonalForm = ({
|
|
|
10794
10869
|
/* @__PURE__ */ jsx125(
|
|
10795
10870
|
"div",
|
|
10796
10871
|
{
|
|
10797
|
-
className:
|
|
10872
|
+
className: classNames45(
|
|
10798
10873
|
"Layer__bank-transaction-mobile-list-item__receipts",
|
|
10799
10874
|
hasReceipts(bankTransaction) ? "Layer__bank-transaction-mobile-list-item__actions--with-receipts" : void 0
|
|
10800
10875
|
),
|
|
@@ -10841,7 +10916,7 @@ import { useState as useState30 } from "react";
|
|
|
10841
10916
|
|
|
10842
10917
|
// src/components/BankTransactionMobileList/MatchForm.tsx
|
|
10843
10918
|
import { useEffect as useEffect19, useRef as useRef14, useState as useState28 } from "react";
|
|
10844
|
-
import
|
|
10919
|
+
import classNames46 from "classnames";
|
|
10845
10920
|
import { jsx as jsx126, jsxs as jsxs79 } from "react/jsx-runtime";
|
|
10846
10921
|
var MatchForm2 = ({
|
|
10847
10922
|
bankTransaction,
|
|
@@ -10928,7 +11003,7 @@ var MatchForm2 = ({
|
|
|
10928
11003
|
/* @__PURE__ */ jsx126(
|
|
10929
11004
|
"div",
|
|
10930
11005
|
{
|
|
10931
|
-
className:
|
|
11006
|
+
className: classNames46(
|
|
10932
11007
|
"Layer__bank-transaction-mobile-list-item__receipts",
|
|
10933
11008
|
hasReceipts(bankTransaction) ? "Layer__bank-transaction-mobile-list-item__actions--with-receipts" : void 0
|
|
10934
11009
|
),
|
|
@@ -10973,7 +11048,7 @@ var MatchForm2 = ({
|
|
|
10973
11048
|
|
|
10974
11049
|
// src/components/BankTransactionMobileList/SplitForm.tsx
|
|
10975
11050
|
import { useEffect as useEffect20, useRef as useRef15, useState as useState29 } from "react";
|
|
10976
|
-
import
|
|
11051
|
+
import classNames47 from "classnames";
|
|
10977
11052
|
import { Fragment as Fragment18, jsx as jsx127, jsxs as jsxs80 } from "react/jsx-runtime";
|
|
10978
11053
|
var SplitForm = ({
|
|
10979
11054
|
bankTransaction,
|
|
@@ -11150,7 +11225,7 @@ var SplitForm = ({
|
|
|
11150
11225
|
{
|
|
11151
11226
|
type: "text",
|
|
11152
11227
|
name: `split-${index}`,
|
|
11153
|
-
className:
|
|
11228
|
+
className: classNames47(
|
|
11154
11229
|
"Layer__split-amount-input",
|
|
11155
11230
|
index === 0 && "Layer__split-amount-input--first"
|
|
11156
11231
|
),
|
|
@@ -11217,7 +11292,7 @@ var SplitForm = ({
|
|
|
11217
11292
|
/* @__PURE__ */ jsx127(
|
|
11218
11293
|
"div",
|
|
11219
11294
|
{
|
|
11220
|
-
className:
|
|
11295
|
+
className: classNames47(
|
|
11221
11296
|
"Layer__bank-transaction-mobile-list-item__receipts",
|
|
11222
11297
|
hasReceipts(bankTransaction) ? "Layer__bank-transaction-mobile-list-item__actions--with-receipts" : void 0
|
|
11223
11298
|
),
|
|
@@ -11366,7 +11441,7 @@ var TransactionToOpenContext = createContext13({
|
|
|
11366
11441
|
});
|
|
11367
11442
|
|
|
11368
11443
|
// src/components/BankTransactionMobileList/BankTransactionMobileListItem.tsx
|
|
11369
|
-
import
|
|
11444
|
+
import classNames48 from "classnames";
|
|
11370
11445
|
import { parseISO as parseISO12, format as formatTime9 } from "date-fns";
|
|
11371
11446
|
import { jsx as jsx130, jsxs as jsxs82 } from "react/jsx-runtime";
|
|
11372
11447
|
var DATE_FORMAT2 = "LLL d";
|
|
@@ -11435,7 +11510,7 @@ var BankTransactionMobileListItem = ({
|
|
|
11435
11510
|
setRemoveAnim(true);
|
|
11436
11511
|
openNext();
|
|
11437
11512
|
} else {
|
|
11438
|
-
|
|
11513
|
+
close2();
|
|
11439
11514
|
}
|
|
11440
11515
|
}
|
|
11441
11516
|
}, [
|
|
@@ -11449,7 +11524,7 @@ var BankTransactionMobileListItem = ({
|
|
|
11449
11524
|
}
|
|
11450
11525
|
setOpen(!open);
|
|
11451
11526
|
};
|
|
11452
|
-
const
|
|
11527
|
+
const close2 = () => {
|
|
11453
11528
|
setOpen(false);
|
|
11454
11529
|
setHeight(0);
|
|
11455
11530
|
};
|
|
@@ -11476,7 +11551,7 @@ var BankTransactionMobileListItem = ({
|
|
|
11476
11551
|
const categorized = isCategorized(bankTransaction);
|
|
11477
11552
|
const className = "Layer__bank-transaction-mobile-list-item";
|
|
11478
11553
|
const openClassName = open ? `${className}--expanded` : "";
|
|
11479
|
-
const rowClassName =
|
|
11554
|
+
const rowClassName = classNames48(
|
|
11480
11555
|
className,
|
|
11481
11556
|
removeAnim ? "Layer__bank-transaction-row--removing" : "",
|
|
11482
11557
|
open ? openClassName : "",
|
|
@@ -11554,7 +11629,7 @@ var BankTransactionMobileListItem = ({
|
|
|
11554
11629
|
onChange: onChangePurpose
|
|
11555
11630
|
}
|
|
11556
11631
|
),
|
|
11557
|
-
/* @__PURE__ */ jsx130(CloseButton, { onClick: () =>
|
|
11632
|
+
/* @__PURE__ */ jsx130(CloseButton, { onClick: () => close2() })
|
|
11558
11633
|
] }) : null,
|
|
11559
11634
|
/* @__PURE__ */ jsx130(
|
|
11560
11635
|
BankTransactionMobileForms,
|
|
@@ -11611,14 +11686,14 @@ var BankTransactionMobileList = ({
|
|
|
11611
11686
|
import { useMemo as useMemo16 } from "react";
|
|
11612
11687
|
|
|
11613
11688
|
// src/components/SkeletonLoader/SkeletonLoader.tsx
|
|
11614
|
-
import
|
|
11689
|
+
import classNames49 from "classnames";
|
|
11615
11690
|
import { jsx as jsx132 } from "react/jsx-runtime";
|
|
11616
11691
|
var SkeletonLoader = ({
|
|
11617
11692
|
height,
|
|
11618
11693
|
width,
|
|
11619
11694
|
className
|
|
11620
11695
|
}) => {
|
|
11621
|
-
const baseClassName =
|
|
11696
|
+
const baseClassName = classNames49(
|
|
11622
11697
|
"Layer__skeleton-loader Layer__anim--skeleton-loading",
|
|
11623
11698
|
className
|
|
11624
11699
|
);
|
|
@@ -11718,7 +11793,7 @@ var BankTransactionsLoader = ({
|
|
|
11718
11793
|
};
|
|
11719
11794
|
|
|
11720
11795
|
// src/components/SyncingComponent/SyncingComponent.tsx
|
|
11721
|
-
import
|
|
11796
|
+
import classNames50 from "classnames";
|
|
11722
11797
|
import { jsx as jsx135, jsxs as jsxs84 } from "react/jsx-runtime";
|
|
11723
11798
|
var SyncingComponent = ({
|
|
11724
11799
|
title = "Syncing account data",
|
|
@@ -11740,7 +11815,7 @@ var SyncingComponent = ({
|
|
|
11740
11815
|
return /* @__PURE__ */ jsxs84(
|
|
11741
11816
|
"div",
|
|
11742
11817
|
{
|
|
11743
|
-
className:
|
|
11818
|
+
className: classNames50(
|
|
11744
11819
|
"Layer__syncing-component",
|
|
11745
11820
|
inProgress ? "Layer__syncing-component--with-border" : ""
|
|
11746
11821
|
),
|
|
@@ -12035,7 +12110,7 @@ var PaginationContent = ({
|
|
|
12035
12110
|
|
|
12036
12111
|
// src/components/BankTransactions/BankTransactionsHeader.tsx
|
|
12037
12112
|
import { useState as useState33 } from "react";
|
|
12038
|
-
import
|
|
12113
|
+
import classNames51 from "classnames";
|
|
12039
12114
|
import { endOfMonth as endOfMonth5, startOfMonth as startOfMonth5 } from "date-fns";
|
|
12040
12115
|
import { jsx as jsx140, jsxs as jsxs87 } from "react/jsx-runtime";
|
|
12041
12116
|
var DownloadButton2 = ({
|
|
@@ -12105,7 +12180,7 @@ var BankTransactionsHeader = ({
|
|
|
12105
12180
|
return /* @__PURE__ */ jsxs87(
|
|
12106
12181
|
Header,
|
|
12107
12182
|
{
|
|
12108
|
-
className:
|
|
12183
|
+
className: classNames51(
|
|
12109
12184
|
"Layer__bank-transactions__header",
|
|
12110
12185
|
withDatePicker && "Layer__bank-transactions__header--with-date-picker",
|
|
12111
12186
|
mobileComponent && listView ? "Layer__bank-transactions__header--mobile" : void 0
|
|
@@ -13068,7 +13143,7 @@ var useProfitAndLoss = ({
|
|
|
13068
13143
|
import { useMemo as useMemo21, useState as useState38 } from "react";
|
|
13069
13144
|
|
|
13070
13145
|
// src/hooks/useProfitAndLossComparison/utils.ts
|
|
13071
|
-
import { getMonth, getYear, startOfMonth as startOfMonth9, startOfYear as startOfYear4, subMonths as subMonths3, subYears as subYears3 } from "date-fns";
|
|
13146
|
+
import { getMonth, getYear as getYear2, startOfMonth as startOfMonth9, startOfYear as startOfYear4, subMonths as subMonths3, subYears as subYears3 } from "date-fns";
|
|
13072
13147
|
|
|
13073
13148
|
// src/utils/array/range.ts
|
|
13074
13149
|
function range2(start, end) {
|
|
@@ -13091,25 +13166,36 @@ function prepareFiltersBody(compareOptions) {
|
|
|
13091
13166
|
const noneFilters = compareOptions.filter(
|
|
13092
13167
|
({ tagFilterConfig: { tagFilters: tagFilters2 } }) => tagFilters2 === "None"
|
|
13093
13168
|
);
|
|
13094
|
-
const tagFilters = compareOptions.flatMap(({ tagFilterConfig: { tagFilters: tagFilters2 } }) => {
|
|
13169
|
+
const tagFilters = compareOptions.flatMap(({ tagFilterConfig: { tagFilters: tagFilters2, structure } }) => {
|
|
13095
13170
|
if (tagFilters2 === "None") {
|
|
13096
13171
|
return null;
|
|
13097
13172
|
}
|
|
13098
13173
|
if (tagFilters2.tagValues.length === 0) {
|
|
13099
|
-
|
|
13100
|
-
|
|
13101
|
-
|
|
13102
|
-
|
|
13103
|
-
|
|
13104
|
-
|
|
13105
|
-
|
|
13106
|
-
|
|
13174
|
+
const filter = {
|
|
13175
|
+
structure,
|
|
13176
|
+
required_tags: []
|
|
13177
|
+
};
|
|
13178
|
+
return filter;
|
|
13179
|
+
}
|
|
13180
|
+
return tagFilters2.tagValues.map((tagValue) => {
|
|
13181
|
+
const filter = {
|
|
13182
|
+
structure,
|
|
13183
|
+
required_tags: [{
|
|
13184
|
+
key: tagFilters2.tagKey,
|
|
13185
|
+
value: tagValue
|
|
13186
|
+
}]
|
|
13187
|
+
};
|
|
13188
|
+
return filter;
|
|
13189
|
+
});
|
|
13107
13190
|
}).filter((item) => item !== null);
|
|
13108
13191
|
if (tagFilters.length === 0) {
|
|
13109
13192
|
return;
|
|
13110
13193
|
}
|
|
13111
13194
|
const allFilters = [
|
|
13112
|
-
noneFilters.length > 0 ? {
|
|
13195
|
+
noneFilters.length > 0 ? {
|
|
13196
|
+
structure: noneFilters[0].tagFilterConfig.structure,
|
|
13197
|
+
required_tags: []
|
|
13198
|
+
} : null,
|
|
13113
13199
|
...tagFilters
|
|
13114
13200
|
].filter((item) => item !== null);
|
|
13115
13201
|
return isArrayWithAtLeastOne(allFilters) ? allFilters : void 0;
|
|
@@ -13119,7 +13205,7 @@ function preparePeriodsBodyForMonths(dateRange, comparePeriods) {
|
|
|
13119
13205
|
const rawPeriods = range2(0, comparePeriods).map((index) => {
|
|
13120
13206
|
const currentPeriod = subMonths3(adjustedStartDate, index);
|
|
13121
13207
|
return {
|
|
13122
|
-
year:
|
|
13208
|
+
year: getYear2(currentPeriod),
|
|
13123
13209
|
month: getMonth(currentPeriod) + 1
|
|
13124
13210
|
};
|
|
13125
13211
|
});
|
|
@@ -13142,7 +13228,7 @@ function preparePeriodsBodyForYears(dateRange, comparePeriods) {
|
|
|
13142
13228
|
const rawPeriods = range2(0, comparePeriods).map((index) => {
|
|
13143
13229
|
const currentPeriod = subYears3(adjustedStartDate, index);
|
|
13144
13230
|
return {
|
|
13145
|
-
year:
|
|
13231
|
+
year: getYear2(currentPeriod)
|
|
13146
13232
|
};
|
|
13147
13233
|
});
|
|
13148
13234
|
const sortedPeriods = rawPeriods.sort((a, b) => {
|
|
@@ -13417,7 +13503,7 @@ var Indicator = ({
|
|
|
13417
13503
|
};
|
|
13418
13504
|
|
|
13419
13505
|
// src/components/ProfitAndLossChart/ProfitAndLossChart.tsx
|
|
13420
|
-
import
|
|
13506
|
+
import classNames52 from "classnames";
|
|
13421
13507
|
import {
|
|
13422
13508
|
add,
|
|
13423
13509
|
differenceInMonths as differenceInMonths2,
|
|
@@ -13845,7 +13931,7 @@ var ProfitAndLossChart = ({
|
|
|
13845
13931
|
/* @__PURE__ */ jsx148(
|
|
13846
13932
|
ResponsiveContainer,
|
|
13847
13933
|
{
|
|
13848
|
-
className:
|
|
13934
|
+
className: classNames52(
|
|
13849
13935
|
"Layer__chart-container",
|
|
13850
13936
|
loaded !== "complete" && "Layer__chart-container--loading"
|
|
13851
13937
|
),
|
|
@@ -13965,7 +14051,7 @@ var ProfitAndLossChart = ({
|
|
|
13965
14051
|
isAnimationActive: barAnimActive,
|
|
13966
14052
|
animationDuration: 100,
|
|
13967
14053
|
radius: [2, 2, 0, 0],
|
|
13968
|
-
className:
|
|
14054
|
+
className: classNames52(
|
|
13969
14055
|
"Layer__profit-and-loss-chart__bar--loading",
|
|
13970
14056
|
loaded !== "complete" && "Layer__profit-and-loss-chart__bar--loading-anim"
|
|
13971
14057
|
),
|
|
@@ -13981,7 +14067,7 @@ var ProfitAndLossChart = ({
|
|
|
13981
14067
|
isAnimationActive: barAnimActive,
|
|
13982
14068
|
animationDuration: 100,
|
|
13983
14069
|
radius: [2, 2, 0, 0],
|
|
13984
|
-
className:
|
|
14070
|
+
className: classNames52(
|
|
13985
14071
|
"Layer__profit-and-loss-chart__bar--loading",
|
|
13986
14072
|
loaded !== "complete" && "Layer__profit-and-loss-chart__bar--loading-anim"
|
|
13987
14073
|
),
|
|
@@ -14538,7 +14624,7 @@ var SortArrows = (_a) => {
|
|
|
14538
14624
|
var SortArrows_default = SortArrows;
|
|
14539
14625
|
|
|
14540
14626
|
// src/components/ProfitAndLossDetailedCharts/DetailedTable.tsx
|
|
14541
|
-
import
|
|
14627
|
+
import classNames53 from "classnames";
|
|
14542
14628
|
import { jsx as jsx154, jsxs as jsxs98 } from "react/jsx-runtime";
|
|
14543
14629
|
var mapTypesToColors = (data, colorList = DEFAULT_CHART_COLOR_TYPE) => {
|
|
14544
14630
|
const typeToColor = {};
|
|
@@ -14632,7 +14718,7 @@ var DetailedTable = ({
|
|
|
14632
14718
|
}) => {
|
|
14633
14719
|
const buildColClass = (column) => {
|
|
14634
14720
|
var _a, _b, _c;
|
|
14635
|
-
return
|
|
14721
|
+
return classNames53(
|
|
14636
14722
|
"Layer__sortable-col",
|
|
14637
14723
|
sidebarScope && ((_a = filters[sidebarScope]) == null ? void 0 : _a.sortBy) === column ? `sort--${(_c = sidebarScope && ((_b = filters[sidebarScope]) == null ? void 0 : _b.sortDirection)) != null ? _c : "desc"}` : ""
|
|
14638
14724
|
);
|
|
@@ -14684,7 +14770,7 @@ var DetailedTable = ({
|
|
|
14684
14770
|
return /* @__PURE__ */ jsxs98(
|
|
14685
14771
|
"tr",
|
|
14686
14772
|
{
|
|
14687
|
-
className:
|
|
14773
|
+
className: classNames53(
|
|
14688
14774
|
"Layer__profit-and-loss-detailed-table__row",
|
|
14689
14775
|
hoveredItem && hoveredItem === item.display_name ? "active" : ""
|
|
14690
14776
|
),
|
|
@@ -14717,7 +14803,7 @@ var DetailedTable = ({
|
|
|
14717
14803
|
};
|
|
14718
14804
|
|
|
14719
14805
|
// src/components/ProfitAndLossDetailedCharts/DetailedChart.tsx
|
|
14720
|
-
import
|
|
14806
|
+
import classNames54 from "classnames";
|
|
14721
14807
|
import {
|
|
14722
14808
|
PieChart,
|
|
14723
14809
|
Pie,
|
|
@@ -14818,7 +14904,7 @@ var DetailedChart = ({
|
|
|
14818
14904
|
return /* @__PURE__ */ jsx155(
|
|
14819
14905
|
Cell2,
|
|
14820
14906
|
{
|
|
14821
|
-
className:
|
|
14907
|
+
className: classNames54(
|
|
14822
14908
|
"Layer__profit-and-loss-detailed-charts__pie",
|
|
14823
14909
|
hoveredItem && active ? "active" : "inactive",
|
|
14824
14910
|
entry.type === "Uncategorized" && "Layer__profit-and-loss-detailed-charts__pie--border"
|
|
@@ -15286,11 +15372,11 @@ import { useContext as useContext25 } from "react";
|
|
|
15286
15372
|
import {
|
|
15287
15373
|
forwardRef as forwardRef11
|
|
15288
15374
|
} from "react";
|
|
15289
|
-
import
|
|
15375
|
+
import classNames55 from "classnames";
|
|
15290
15376
|
import { jsx as jsx161 } from "react/jsx-runtime";
|
|
15291
15377
|
var Header2 = forwardRef11(
|
|
15292
15378
|
({ className, children, style, sticky, asHeader, rounded }, ref) => {
|
|
15293
|
-
const baseClassName =
|
|
15379
|
+
const baseClassName = classNames55(
|
|
15294
15380
|
"Layer__header",
|
|
15295
15381
|
sticky && "Layer__header--sticky",
|
|
15296
15382
|
rounded && "Layer__header--top-rounded",
|
|
@@ -15313,24 +15399,24 @@ var Header2 = forwardRef11(
|
|
|
15313
15399
|
Header2.displayName = "Header";
|
|
15314
15400
|
|
|
15315
15401
|
// src/components/Header/HeaderRow.tsx
|
|
15316
|
-
import
|
|
15402
|
+
import classNames56 from "classnames";
|
|
15317
15403
|
import { jsx as jsx162 } from "react/jsx-runtime";
|
|
15318
15404
|
var HeaderRow = ({ className, children, direction, style }) => {
|
|
15319
15405
|
const dataProps = toDataProperties({ direction });
|
|
15320
|
-
return /* @__PURE__ */ jsx162("div", __spreadProps(__spreadValues({}, dataProps), { className:
|
|
15406
|
+
return /* @__PURE__ */ jsx162("div", __spreadProps(__spreadValues({}, dataProps), { className: classNames56("Layer__header__row", className), style, children }));
|
|
15321
15407
|
};
|
|
15322
15408
|
|
|
15323
15409
|
// src/components/Header/HeaderCol.tsx
|
|
15324
|
-
import
|
|
15410
|
+
import classNames57 from "classnames";
|
|
15325
15411
|
import { jsx as jsx163 } from "react/jsx-runtime";
|
|
15326
15412
|
var HeaderCol = ({ className, children, style, noPadding = false }) => {
|
|
15327
15413
|
const dataProperties = toDataProperties({ "no-padding": noPadding });
|
|
15328
|
-
return /* @__PURE__ */ jsx163("div", __spreadProps(__spreadValues({}, dataProperties), { className:
|
|
15414
|
+
return /* @__PURE__ */ jsx163("div", __spreadProps(__spreadValues({}, dataProperties), { className: classNames57("Layer__header__col", className), style, children }));
|
|
15329
15415
|
};
|
|
15330
15416
|
|
|
15331
15417
|
// src/components/Panel/Panel.tsx
|
|
15332
15418
|
import { useEffect as useEffect28, useState as useState43 } from "react";
|
|
15333
|
-
import
|
|
15419
|
+
import classNames58 from "classnames";
|
|
15334
15420
|
import { jsx as jsx164, jsxs as jsxs103 } from "react/jsx-runtime";
|
|
15335
15421
|
var Panel = ({
|
|
15336
15422
|
children,
|
|
@@ -15350,7 +15436,7 @@ var Panel = ({
|
|
|
15350
15436
|
setSidebarHeight((_b = parentRef == null ? void 0 : parentRef.current) == null ? void 0 : _b.offsetHeight);
|
|
15351
15437
|
}
|
|
15352
15438
|
}, [parentRef, (_a = parentRef == null ? void 0 : parentRef.current) == null ? void 0 : _a.offsetHeight, sidebarIsOpen]);
|
|
15353
|
-
const sidebarClass =
|
|
15439
|
+
const sidebarClass = classNames58(
|
|
15354
15440
|
"Layer__panel__sidebar",
|
|
15355
15441
|
defaultSidebarHeight && "Layer__panel__sidebar--default",
|
|
15356
15442
|
floating && "Layer__panel__sidebar--floating"
|
|
@@ -15358,7 +15444,7 @@ var Panel = ({
|
|
|
15358
15444
|
return /* @__PURE__ */ jsxs103(
|
|
15359
15445
|
"div",
|
|
15360
15446
|
{
|
|
15361
|
-
className:
|
|
15447
|
+
className: classNames58(
|
|
15362
15448
|
"Layer__panel",
|
|
15363
15449
|
className,
|
|
15364
15450
|
sidebarIsOpen && "Layer__panel--open"
|
|
@@ -15387,17 +15473,17 @@ var Panel = ({
|
|
|
15387
15473
|
import { forwardRef as forwardRef12 } from "react";
|
|
15388
15474
|
|
|
15389
15475
|
// src/components/ViewHeader/ViewHeader.tsx
|
|
15390
|
-
import
|
|
15476
|
+
import classNames59 from "classnames";
|
|
15391
15477
|
import { jsx as jsx165, jsxs as jsxs104 } from "react/jsx-runtime";
|
|
15392
15478
|
var ViewHeader = ({ title, className, children }) => {
|
|
15393
|
-
return /* @__PURE__ */ jsx165("div", { className:
|
|
15479
|
+
return /* @__PURE__ */ jsx165("div", { className: classNames59("Layer__view-header", className), children: /* @__PURE__ */ jsxs104("div", { className: "Layer__view-header__content", children: [
|
|
15394
15480
|
title && /* @__PURE__ */ jsx165(Heading, { className: "Layer__view-header__title", children: title }),
|
|
15395
15481
|
children && /* @__PURE__ */ jsx165("div", { className: "Layer__view-header__children", children })
|
|
15396
15482
|
] }) });
|
|
15397
15483
|
};
|
|
15398
15484
|
|
|
15399
15485
|
// src/components/View/View.tsx
|
|
15400
|
-
import
|
|
15486
|
+
import classNames60 from "classnames";
|
|
15401
15487
|
import { jsx as jsx166, jsxs as jsxs105 } from "react/jsx-runtime";
|
|
15402
15488
|
var View = forwardRef12(
|
|
15403
15489
|
({
|
|
@@ -15413,7 +15499,7 @@ var View = forwardRef12(
|
|
|
15413
15499
|
}, ref) => {
|
|
15414
15500
|
const { theme } = useLayerContext();
|
|
15415
15501
|
const styles = parseStylesFromThemeConfig(theme);
|
|
15416
|
-
const viewClassNames =
|
|
15502
|
+
const viewClassNames = classNames60(
|
|
15417
15503
|
"Layer__view",
|
|
15418
15504
|
type === "panel" && "Layer__view--panel",
|
|
15419
15505
|
viewClassName
|
|
@@ -15423,7 +15509,7 @@ var View = forwardRef12(
|
|
|
15423
15509
|
ViewHeader,
|
|
15424
15510
|
{
|
|
15425
15511
|
title,
|
|
15426
|
-
className:
|
|
15512
|
+
className: classNames60(
|
|
15427
15513
|
headerControls ? "Layer__view-header--paddings" : void 0
|
|
15428
15514
|
),
|
|
15429
15515
|
children: header != null ? header : headerControls
|
|
@@ -15932,7 +16018,7 @@ var TableBody = ({ children }) => {
|
|
|
15932
16018
|
};
|
|
15933
16019
|
|
|
15934
16020
|
// src/components/TableCell/TableCell.tsx
|
|
15935
|
-
import
|
|
16021
|
+
import classNames61 from "classnames";
|
|
15936
16022
|
import { jsx as jsx176, jsxs as jsxs109 } from "react/jsx-runtime";
|
|
15937
16023
|
var TableCell = ({
|
|
15938
16024
|
children,
|
|
@@ -15952,7 +16038,7 @@ var TableCell = ({
|
|
|
15952
16038
|
const amount = typeof children === "number" ? children : 0;
|
|
15953
16039
|
const isPositive = amount >= 0;
|
|
15954
16040
|
const amountString = centsToDollars(Math.abs(amount));
|
|
15955
|
-
const cellClassNames =
|
|
16041
|
+
const cellClassNames = classNames61(
|
|
15956
16042
|
"Layer__table-cell",
|
|
15957
16043
|
(primary || isHeaderCell) && "Layer__table-cell--primary",
|
|
15958
16044
|
isHeaderCell && "Layer__table-header",
|
|
@@ -15995,7 +16081,7 @@ var TableHead = ({ children }) => {
|
|
|
15995
16081
|
};
|
|
15996
16082
|
|
|
15997
16083
|
// src/components/TableRow/TableRow.tsx
|
|
15998
|
-
import
|
|
16084
|
+
import classNames62 from "classnames";
|
|
15999
16085
|
import { Fragment as Fragment21, jsx as jsx178, jsxs as jsxs110 } from "react/jsx-runtime";
|
|
16000
16086
|
var TableRow = ({
|
|
16001
16087
|
rowKey,
|
|
@@ -16015,12 +16101,11 @@ var TableRow = ({
|
|
|
16015
16101
|
if (onClick) {
|
|
16016
16102
|
onClick(e);
|
|
16017
16103
|
} else {
|
|
16018
|
-
if (variant === "summation" || !expandable)
|
|
16019
|
-
return;
|
|
16104
|
+
if (variant === "summation" || !expandable) return;
|
|
16020
16105
|
handleExpand && handleExpand();
|
|
16021
16106
|
}
|
|
16022
16107
|
};
|
|
16023
|
-
const rowClassNames =
|
|
16108
|
+
const rowClassNames = classNames62([
|
|
16024
16109
|
"Layer__table-row",
|
|
16025
16110
|
!isHeadRow && `Layer__table-row--depth-${depth}`,
|
|
16026
16111
|
!isHeadRow && `Layer__table-row--variant-${variant}`,
|
|
@@ -16044,7 +16129,7 @@ var TableRow = ({
|
|
|
16044
16129
|
|
|
16045
16130
|
// src/components/Table/Table.tsx
|
|
16046
16131
|
import { useEffect as useEffect29, useRef as useRef19 } from "react";
|
|
16047
|
-
import
|
|
16132
|
+
import classNames63 from "classnames";
|
|
16048
16133
|
import { jsx as jsx179 } from "react/jsx-runtime";
|
|
16049
16134
|
var Table = ({
|
|
16050
16135
|
componentName,
|
|
@@ -16085,11 +16170,11 @@ var Table = ({
|
|
|
16085
16170
|
prevChildrenRef.current = newChildrenKeys;
|
|
16086
16171
|
}
|
|
16087
16172
|
}, [children]);
|
|
16088
|
-
const tableWrapperClassNames =
|
|
16173
|
+
const tableWrapperClassNames = classNames63(
|
|
16089
16174
|
"Layer__table-wrapper",
|
|
16090
16175
|
bottomSpacing && "Layer__table-wrapper--bottom-spacing"
|
|
16091
16176
|
);
|
|
16092
|
-
const tableClassNames =
|
|
16177
|
+
const tableClassNames = classNames63(
|
|
16093
16178
|
"Layer__table",
|
|
16094
16179
|
componentName && `Layer__${componentName}__table`,
|
|
16095
16180
|
borderCollapse && `Layer__table__${borderCollapse}-rows`
|
|
@@ -16098,7 +16183,7 @@ var Table = ({
|
|
|
16098
16183
|
};
|
|
16099
16184
|
|
|
16100
16185
|
// src/components/ProfitAndLossTable/ProfitAndLossCompareTable.tsx
|
|
16101
|
-
import
|
|
16186
|
+
import classNames64 from "classnames";
|
|
16102
16187
|
import { Fragment as Fragment23, jsx as jsx180, jsxs as jsxs111 } from "react/jsx-runtime";
|
|
16103
16188
|
var ProfitAndLossCompareTable = ({
|
|
16104
16189
|
stringOverrides
|
|
@@ -16119,7 +16204,7 @@ var ProfitAndLossCompareTable = ({
|
|
|
16119
16204
|
return /* @__PURE__ */ jsx180(
|
|
16120
16205
|
"div",
|
|
16121
16206
|
{
|
|
16122
|
-
className:
|
|
16207
|
+
className: classNames64("Layer__profit-and-loss-table__loader-container"),
|
|
16123
16208
|
children: /* @__PURE__ */ jsx180(Loader2, {})
|
|
16124
16209
|
}
|
|
16125
16210
|
);
|
|
@@ -16309,7 +16394,7 @@ var empty_profit_and_loss_report_default = {
|
|
|
16309
16394
|
};
|
|
16310
16395
|
|
|
16311
16396
|
// src/components/ProfitAndLossTable/ProfitAndLossTableComponent.tsx
|
|
16312
|
-
import
|
|
16397
|
+
import classNames65 from "classnames";
|
|
16313
16398
|
import { jsx as jsx182, jsxs as jsxs113 } from "react/jsx-runtime";
|
|
16314
16399
|
var ProfitAndLossTableComponent = ({
|
|
16315
16400
|
asContainer,
|
|
@@ -16330,7 +16415,7 @@ var ProfitAndLossTableComponent = ({
|
|
|
16330
16415
|
return /* @__PURE__ */ jsx182(
|
|
16331
16416
|
"div",
|
|
16332
16417
|
{
|
|
16333
|
-
className:
|
|
16418
|
+
className: classNames65(
|
|
16334
16419
|
"Layer__profit-and-loss-table__loader-container",
|
|
16335
16420
|
asContainer && "Layer__component-container"
|
|
16336
16421
|
),
|
|
@@ -18648,10 +18733,10 @@ var lineEntryNumber = (ledgerEntryLine) => {
|
|
|
18648
18733
|
};
|
|
18649
18734
|
|
|
18650
18735
|
// src/components/Card/Card.tsx
|
|
18651
|
-
import
|
|
18736
|
+
import classNames66 from "classnames";
|
|
18652
18737
|
import { jsx as jsx203 } from "react/jsx-runtime";
|
|
18653
18738
|
var Card = ({ children, className }) => {
|
|
18654
|
-
return /* @__PURE__ */ jsx203("div", { className:
|
|
18739
|
+
return /* @__PURE__ */ jsx203("div", { className: classNames66("Layer__card", className), children });
|
|
18655
18740
|
};
|
|
18656
18741
|
|
|
18657
18742
|
// src/components/DateTime/DateTime.tsx
|
|
@@ -18695,7 +18780,7 @@ var DateTime = ({
|
|
|
18695
18780
|
};
|
|
18696
18781
|
|
|
18697
18782
|
// src/components/DetailsList/DetailsList.tsx
|
|
18698
|
-
import
|
|
18783
|
+
import classNames67 from "classnames";
|
|
18699
18784
|
import { jsx as jsx205, jsxs as jsxs126 } from "react/jsx-runtime";
|
|
18700
18785
|
var DetailsList = ({
|
|
18701
18786
|
title,
|
|
@@ -18704,7 +18789,7 @@ var DetailsList = ({
|
|
|
18704
18789
|
titleClassName,
|
|
18705
18790
|
actions
|
|
18706
18791
|
}) => {
|
|
18707
|
-
return /* @__PURE__ */ jsxs126("div", { className:
|
|
18792
|
+
return /* @__PURE__ */ jsxs126("div", { className: classNames67("Layer__details-list", className), children: [
|
|
18708
18793
|
title && /* @__PURE__ */ jsxs126(Header, { className: titleClassName, children: [
|
|
18709
18794
|
/* @__PURE__ */ jsx205(Heading, { size: "secondary" /* secondary */, children: title }),
|
|
18710
18795
|
actions && /* @__PURE__ */ jsx205("div", { className: "Layer__details-list__actions", children: actions })
|
|
@@ -19019,7 +19104,7 @@ var LedgerAccountEntryDetails = ({
|
|
|
19019
19104
|
|
|
19020
19105
|
// src/components/LedgerAccount/LedgerAccountRow.tsx
|
|
19021
19106
|
import { useContext as useContext36, useEffect as useEffect36, useState as useState50 } from "react";
|
|
19022
|
-
import
|
|
19107
|
+
import classNames68 from "classnames";
|
|
19023
19108
|
import { parseISO as parseISO14, format as formatTime11 } from "date-fns";
|
|
19024
19109
|
import { jsx as jsx208, jsxs as jsxs129 } from "react/jsx-runtime";
|
|
19025
19110
|
var LedgerAccountRow = ({
|
|
@@ -19045,7 +19130,7 @@ var LedgerAccountRow = ({
|
|
|
19045
19130
|
return /* @__PURE__ */ jsxs129(
|
|
19046
19131
|
"tr",
|
|
19047
19132
|
{
|
|
19048
|
-
className:
|
|
19133
|
+
className: classNames68(
|
|
19049
19134
|
"Layer__table-row",
|
|
19050
19135
|
row.entry_id === selectedEntryId && "Layer__table-row--active",
|
|
19051
19136
|
initialLoad && "initial-load",
|
|
@@ -19086,7 +19171,7 @@ var LedgerAccountRow = ({
|
|
|
19086
19171
|
return /* @__PURE__ */ jsx208(
|
|
19087
19172
|
"tr",
|
|
19088
19173
|
{
|
|
19089
|
-
className:
|
|
19174
|
+
className: classNames68(
|
|
19090
19175
|
"Layer__table-row",
|
|
19091
19176
|
row.entry_id === selectedEntryId && "Layer__table-row--active",
|
|
19092
19177
|
initialLoad && "initial-load",
|
|
@@ -19138,7 +19223,7 @@ var LedgerAccountRow = ({
|
|
|
19138
19223
|
return /* @__PURE__ */ jsxs129(
|
|
19139
19224
|
"tr",
|
|
19140
19225
|
{
|
|
19141
|
-
className:
|
|
19226
|
+
className: classNames68(
|
|
19142
19227
|
"Layer__table-row",
|
|
19143
19228
|
row.entry_id === selectedEntryId && "Layer__table-row--active",
|
|
19144
19229
|
initialLoad && "initial-load",
|
|
@@ -19166,7 +19251,7 @@ var LedgerAccountRow = ({
|
|
|
19166
19251
|
};
|
|
19167
19252
|
|
|
19168
19253
|
// src/components/LedgerAccount/LedgerAccountIndex.tsx
|
|
19169
|
-
import
|
|
19254
|
+
import classNames69 from "classnames";
|
|
19170
19255
|
import { Fragment as Fragment32, jsx as jsx209, jsxs as jsxs130 } from "react/jsx-runtime";
|
|
19171
19256
|
var LedgerAccount = ({
|
|
19172
19257
|
containerRef,
|
|
@@ -19197,7 +19282,7 @@ var LedgerAccount = ({
|
|
|
19197
19282
|
return () => clearTimeout(timeoutLoad);
|
|
19198
19283
|
}
|
|
19199
19284
|
}, [isLoading]);
|
|
19200
|
-
const baseClassName =
|
|
19285
|
+
const baseClassName = classNames69(
|
|
19201
19286
|
"Layer__ledger-account__index",
|
|
19202
19287
|
accountId && "open"
|
|
19203
19288
|
);
|
|
@@ -19212,7 +19297,7 @@ var LedgerAccount = ({
|
|
|
19212
19297
|
const lastPageIndex = firstPageIndex + pageSize;
|
|
19213
19298
|
return (_a2 = rawData == null ? void 0 : rawData.sort((a, b) => Date.parse(b.date) - Date.parse(a.date))) == null ? void 0 : _a2.slice(firstPageIndex, lastPageIndex);
|
|
19214
19299
|
}, [rawData, currentPage]);
|
|
19215
|
-
const
|
|
19300
|
+
const close2 = () => {
|
|
19216
19301
|
setAccountId(void 0);
|
|
19217
19302
|
closeSelectedEntry();
|
|
19218
19303
|
};
|
|
@@ -19230,7 +19315,7 @@ var LedgerAccount = ({
|
|
|
19230
19315
|
className: "Layer__ledger-account__panel",
|
|
19231
19316
|
children: /* @__PURE__ */ jsxs130("div", { className: baseClassName, children: [
|
|
19232
19317
|
/* @__PURE__ */ jsx209(Header2, { className: "Layer__ledger-account__header", children: /* @__PURE__ */ jsx209(HeaderRow, { children: /* @__PURE__ */ jsxs130(HeaderCol, { children: [
|
|
19233
|
-
/* @__PURE__ */ jsx209(BackButton, { onClick:
|
|
19318
|
+
/* @__PURE__ */ jsx209(BackButton, { onClick: close2 }),
|
|
19234
19319
|
/* @__PURE__ */ jsxs130("div", { className: "Layer__ledger-account__title-container", children: [
|
|
19235
19320
|
/* @__PURE__ */ jsx209(
|
|
19236
19321
|
Text,
|
|
@@ -20740,7 +20825,7 @@ var mockData = [
|
|
|
20740
20825
|
|
|
20741
20826
|
// src/hooks/useTasks/useTasks.tsx
|
|
20742
20827
|
import useSWR14 from "swr";
|
|
20743
|
-
import { endOfYear as endOfYear5, formatISO as formatISO4, getMonth as getMonth2, getYear as
|
|
20828
|
+
import { endOfYear as endOfYear5, formatISO as formatISO4, getMonth as getMonth2, getYear as getYear3, parseISO as parseISO16, startOfYear as startOfYear6 } from "date-fns";
|
|
20744
20829
|
var DEBUG_MODE = false;
|
|
20745
20830
|
var useTasks = ({
|
|
20746
20831
|
startDate: initialStartDate = startOfYear6(/* @__PURE__ */ new Date()),
|
|
@@ -20774,7 +20859,7 @@ var useTasks = ({
|
|
|
20774
20859
|
if (data == null ? void 0 : data.data) {
|
|
20775
20860
|
const grouped = data.data.reduce((acc, task) => {
|
|
20776
20861
|
const effectiveDate = task.effective_date ? parseISO16(task.effective_date) : parseISO16(task.created_at);
|
|
20777
|
-
const year =
|
|
20862
|
+
const year = getYear3(effectiveDate);
|
|
20778
20863
|
const month = getMonth2(effectiveDate);
|
|
20779
20864
|
const key = `${year}-${month}`;
|
|
20780
20865
|
if (!acc[key]) {
|
|
@@ -20844,8 +20929,7 @@ var useTasks = ({
|
|
|
20844
20929
|
}).then(refetch);
|
|
20845
20930
|
});
|
|
20846
20931
|
const submitResponseToTask2 = (taskId, userResponse) => {
|
|
20847
|
-
if (!taskId || !userResponse || userResponse.length === 0)
|
|
20848
|
-
return;
|
|
20932
|
+
if (!taskId || !userResponse || userResponse.length === 0) return;
|
|
20849
20933
|
const data2 = {
|
|
20850
20934
|
type: "FreeResponse",
|
|
20851
20935
|
user_response: userResponse
|
|
@@ -20997,8 +21081,8 @@ var ProgressIcon = (_a) => {
|
|
|
20997
21081
|
var ProgressIcon_default = ProgressIcon;
|
|
20998
21082
|
|
|
20999
21083
|
// src/components/TasksHeader/TasksHeader.tsx
|
|
21000
|
-
import { endOfYear as endOfYear6, getYear as
|
|
21001
|
-
import
|
|
21084
|
+
import { endOfYear as endOfYear6, getYear as getYear4, startOfYear as startOfYear7 } from "date-fns";
|
|
21085
|
+
import classNames70 from "classnames";
|
|
21002
21086
|
import { jsx as jsx220, jsxs as jsxs138 } from "react/jsx-runtime";
|
|
21003
21087
|
var ICONS = {
|
|
21004
21088
|
loading: {
|
|
@@ -21026,7 +21110,8 @@ var TasksHeader = ({
|
|
|
21026
21110
|
tasksHeader = "Bookkeeping Tasks",
|
|
21027
21111
|
collapsable,
|
|
21028
21112
|
open,
|
|
21029
|
-
toggleContent
|
|
21113
|
+
toggleContent,
|
|
21114
|
+
highlightYears
|
|
21030
21115
|
}) => {
|
|
21031
21116
|
const {
|
|
21032
21117
|
data: tasks,
|
|
@@ -21040,13 +21125,15 @@ var TasksHeader = ({
|
|
|
21040
21125
|
const completedTasks = tasks == null ? void 0 : tasks.filter((task) => isComplete(task.status)).length;
|
|
21041
21126
|
const badgeVariant = completedTasks === (tasks == null ? void 0 : tasks.length) ? ICONS.done : ICONS.pending;
|
|
21042
21127
|
const minDate = getEarliestDateToBrowse(business);
|
|
21043
|
-
return /* @__PURE__ */ jsx220("div", { className:
|
|
21128
|
+
return /* @__PURE__ */ jsx220("div", { className: classNames70("Layer__tasks-header", collapsable && "Layer__tasks-header--collapsable"), children: /* @__PURE__ */ jsxs138("div", { className: "Layer__tasks-header__left-col", children: [
|
|
21044
21129
|
/* @__PURE__ */ jsxs138("div", { className: "Layer__tasks-header__left-col__title", children: [
|
|
21045
21130
|
/* @__PURE__ */ jsx220(Text, { size: "lg" /* lg */, children: tasksHeader }),
|
|
21046
21131
|
loadedStatus !== "complete" && !open ? /* @__PURE__ */ jsx220(Badge, { variant: ICONS.loading.badge, icon: ICONS.loading.icon, children: ICONS.loading.text }) : loadedStatus === "complete" && !open && (!tasks || error) ? /* @__PURE__ */ jsx220(
|
|
21047
21132
|
Badge,
|
|
21048
21133
|
{
|
|
21049
|
-
onClick: () =>
|
|
21134
|
+
onClick: () => {
|
|
21135
|
+
void refetch();
|
|
21136
|
+
},
|
|
21050
21137
|
variant: ICONS.refresh.badge,
|
|
21051
21138
|
icon: ICONS.refresh.icon,
|
|
21052
21139
|
children: ICONS.refresh.text
|
|
@@ -21072,7 +21159,8 @@ var TasksHeader = ({
|
|
|
21072
21159
|
maxDate: endOfYear6(/* @__PURE__ */ new Date()),
|
|
21073
21160
|
currentDateOption: false,
|
|
21074
21161
|
navigateArrows: ["mobile", "desktop"],
|
|
21075
|
-
disabled: minDate &&
|
|
21162
|
+
disabled: minDate && getYear4(minDate) === getYear4(/* @__PURE__ */ new Date()),
|
|
21163
|
+
highlightYears
|
|
21076
21164
|
}
|
|
21077
21165
|
),
|
|
21078
21166
|
collapsable && /* @__PURE__ */ jsx220("div", { className: "Layer__tasks-header__left-col__expand", children: /* @__PURE__ */ jsx220(ExpandButton, { onClick: toggleContent, collapsed: !open }) })
|
|
@@ -21141,7 +21229,7 @@ var SmileIcon_default = SmileIcon;
|
|
|
21141
21229
|
|
|
21142
21230
|
// src/components/TasksListItem/TasksListItem.tsx
|
|
21143
21231
|
import { useContext as useContext46, useEffect as useEffect41, useMemo as useMemo37, useState as useState56 } from "react";
|
|
21144
|
-
import
|
|
21232
|
+
import classNames71 from "classnames";
|
|
21145
21233
|
import { Fragment as Fragment36, jsx as jsx222, jsxs as jsxs140 } from "react/jsx-runtime";
|
|
21146
21234
|
var TasksListItem = ({
|
|
21147
21235
|
task,
|
|
@@ -21158,16 +21246,16 @@ var TasksListItem = ({
|
|
|
21158
21246
|
deleteUploadsForTask,
|
|
21159
21247
|
updateDocUploadTaskDescription
|
|
21160
21248
|
} = useContext46(TasksContext);
|
|
21161
|
-
const taskBodyClassName =
|
|
21249
|
+
const taskBodyClassName = classNames71(
|
|
21162
21250
|
"Layer__tasks-list-item__body",
|
|
21163
21251
|
isOpen && "Layer__tasks-list-item__body--expanded",
|
|
21164
21252
|
isComplete(task.status) && "Layer__tasks-list-item--completed"
|
|
21165
21253
|
);
|
|
21166
|
-
const taskHeadClassName =
|
|
21254
|
+
const taskHeadClassName = classNames71(
|
|
21167
21255
|
"Layer__tasks-list-item__head-info",
|
|
21168
21256
|
isComplete(task.status) ? "Layer__tasks-list-item--completed" : "Layer__tasks-list-item--pending"
|
|
21169
21257
|
);
|
|
21170
|
-
const taskItemClassName =
|
|
21258
|
+
const taskItemClassName = classNames71(
|
|
21171
21259
|
"Layer__tasks-list-item",
|
|
21172
21260
|
isOpen && "Layer__tasks-list-item__expanded"
|
|
21173
21261
|
);
|
|
@@ -21376,7 +21464,7 @@ var TasksList = ({ pageSize = 10 }) => {
|
|
|
21376
21464
|
|
|
21377
21465
|
// src/components/TasksPending/TasksPending.tsx
|
|
21378
21466
|
import { useContext as useContext48, useMemo as useMemo39 } from "react";
|
|
21379
|
-
import
|
|
21467
|
+
import classNames72 from "classnames";
|
|
21380
21468
|
import { endOfMonth as endOfMonth15, format as format4, isAfter as isAfter2, isBefore as isBefore2, parseISO as parseISO18, startOfMonth as startOfMonth17 } from "date-fns";
|
|
21381
21469
|
import { Cell as Cell4, Pie as Pie3, PieChart as PieChart4 } from "recharts";
|
|
21382
21470
|
import { jsx as jsx224, jsxs as jsxs142 } from "react/jsx-runtime";
|
|
@@ -21399,7 +21487,7 @@ var TasksPending = () => {
|
|
|
21399
21487
|
value: data == null ? void 0 : data.filter((task) => !isComplete(task.status)).length
|
|
21400
21488
|
}
|
|
21401
21489
|
];
|
|
21402
|
-
const taskStatusClassName =
|
|
21490
|
+
const taskStatusClassName = classNames72(
|
|
21403
21491
|
completedTasks && completedTasks > 0 ? "Layer__tasks-pending-bar__status--done" : "Layer__tasks-pending-bar__status--pending"
|
|
21404
21492
|
);
|
|
21405
21493
|
return /* @__PURE__ */ jsxs142("div", { className: "Layer__tasks-pending", children: [
|
|
@@ -21445,14 +21533,14 @@ var TasksPending = () => {
|
|
|
21445
21533
|
|
|
21446
21534
|
// src/components/TasksMonthSelector/TasksMonthSelector.tsx
|
|
21447
21535
|
import { useMemo as useMemo40 } from "react";
|
|
21448
|
-
import { endOfMonth as endOfMonth16, format as format5, getMonth as getMonth3, getYear as
|
|
21536
|
+
import { endOfMonth as endOfMonth16, format as format5, getMonth as getMonth3, getYear as getYear5, isAfter as isAfter3, isBefore as isBefore3, set, startOfMonth as startOfMonth18 } from "date-fns";
|
|
21449
21537
|
|
|
21450
21538
|
// src/components/TasksMonthSelector/TaskMonthTile.tsx
|
|
21451
|
-
import
|
|
21539
|
+
import classNames73 from "classnames";
|
|
21452
21540
|
import { jsx as jsx225, jsxs as jsxs143 } from "react/jsx-runtime";
|
|
21453
21541
|
var TaskMonthTile = ({ monthData, onClick, active, disabled }) => {
|
|
21454
21542
|
const isCompleted = monthData.total === monthData.completed;
|
|
21455
|
-
const baseClass =
|
|
21543
|
+
const baseClass = classNames73(
|
|
21456
21544
|
"Layer__tasks-month-selector__month",
|
|
21457
21545
|
isCompleted && "Layer__tasks-month-selector__month--completed",
|
|
21458
21546
|
active && "Layer__tasks-month-selector__month--active",
|
|
@@ -21476,7 +21564,7 @@ var DEFAULT_TASK_DATA = {
|
|
|
21476
21564
|
completed: 0,
|
|
21477
21565
|
tasks: []
|
|
21478
21566
|
};
|
|
21479
|
-
var isCurrentMonth = (monthDate, currentDate) => getMonth3(currentDate) === getMonth3(monthDate) &&
|
|
21567
|
+
var isCurrentMonth = (monthDate, currentDate) => getMonth3(currentDate) === getMonth3(monthDate) && getYear5(currentDate) === getYear5(monthDate);
|
|
21480
21568
|
var TasksMonthSelector = ({ tasks, year, currentDate, onClick }) => {
|
|
21481
21569
|
const { business } = useLayerContext();
|
|
21482
21570
|
const minDate = useMemo40(() => {
|
|
@@ -21496,7 +21584,6 @@ var TasksMonthSelector = ({ tasks, year, currentDate, onClick }) => {
|
|
|
21496
21584
|
{ year, month: i, date: 1, hours: 0, minutes: 0, seconds: 0, milliseconds: 0 }
|
|
21497
21585
|
);
|
|
21498
21586
|
const endDate = endOfMonth16(startDate);
|
|
21499
|
-
const disabled = minDate && isBefore3(startDate, minDate) || isAfter3(startDate, startOfMonth18(/* @__PURE__ */ new Date()));
|
|
21500
21587
|
const taskData = (_a = tasks == null ? void 0 : tasks.find((x) => x.month === i && x.year === year)) != null ? _a : __spreadValues({
|
|
21501
21588
|
monthStr: format5(startDate, "MMM"),
|
|
21502
21589
|
year,
|
|
@@ -21504,6 +21591,7 @@ var TasksMonthSelector = ({ tasks, year, currentDate, onClick }) => {
|
|
|
21504
21591
|
startDate,
|
|
21505
21592
|
endDate
|
|
21506
21593
|
}, DEFAULT_TASK_DATA);
|
|
21594
|
+
const disabled = taskData.total === 0 && (minDate && isBefore3(startDate, minDate) || isAfter3(startDate, startOfMonth18(/* @__PURE__ */ new Date())));
|
|
21507
21595
|
return __spreadValues({
|
|
21508
21596
|
monthStr: format5(startDate, "MMM"),
|
|
21509
21597
|
startDate,
|
|
@@ -21527,8 +21615,8 @@ var TasksMonthSelector = ({ tasks, year, currentDate, onClick }) => {
|
|
|
21527
21615
|
};
|
|
21528
21616
|
|
|
21529
21617
|
// src/components/Tasks/Tasks.tsx
|
|
21530
|
-
import
|
|
21531
|
-
import { endOfYear as endOfYear7, getYear as
|
|
21618
|
+
import classNames74 from "classnames";
|
|
21619
|
+
import { endOfYear as endOfYear7, getYear as getYear6, startOfYear as startOfYear8 } from "date-fns";
|
|
21532
21620
|
import { Fragment as Fragment38, jsx as jsx227, jsxs as jsxs144 } from "react/jsx-runtime";
|
|
21533
21621
|
var UseTasksContext = createContext21({
|
|
21534
21622
|
data: void 0,
|
|
@@ -21617,7 +21705,7 @@ var TasksComponent = ({
|
|
|
21617
21705
|
return /* @__PURE__ */ jsxs144(
|
|
21618
21706
|
"div",
|
|
21619
21707
|
{
|
|
21620
|
-
className:
|
|
21708
|
+
className: classNames74(
|
|
21621
21709
|
"Layer__tasks-component",
|
|
21622
21710
|
collapsable && "Layer__tasks-component--collapsable"
|
|
21623
21711
|
),
|
|
@@ -21628,13 +21716,14 @@ var TasksComponent = ({
|
|
|
21628
21716
|
tasksHeader: (stringOverrides == null ? void 0 : stringOverrides.header) || tasksHeader,
|
|
21629
21717
|
collapsable,
|
|
21630
21718
|
open,
|
|
21631
|
-
toggleContent: () => setOpen(!open)
|
|
21719
|
+
toggleContent: () => setOpen(!open),
|
|
21720
|
+
highlightYears: yearlyData == null ? void 0 : yearlyData.map((x) => x.year)
|
|
21632
21721
|
}
|
|
21633
21722
|
),
|
|
21634
21723
|
/* @__PURE__ */ jsx227(
|
|
21635
21724
|
"div",
|
|
21636
21725
|
{
|
|
21637
|
-
className:
|
|
21726
|
+
className: classNames74(
|
|
21638
21727
|
"Layer__tasks__content",
|
|
21639
21728
|
!open && "Layer__tasks__content--collapsed"
|
|
21640
21729
|
),
|
|
@@ -21645,7 +21734,7 @@ var TasksComponent = ({
|
|
|
21645
21734
|
tasks: monthlyData,
|
|
21646
21735
|
currentDate,
|
|
21647
21736
|
onClick: setCurrentDate,
|
|
21648
|
-
year:
|
|
21737
|
+
year: getYear6(dateRange.startDate)
|
|
21649
21738
|
}
|
|
21650
21739
|
),
|
|
21651
21740
|
/* @__PURE__ */ jsx227(TasksPending, {}),
|
|
@@ -21796,7 +21885,7 @@ function LinkAccountsConfirmationStep() {
|
|
|
21796
21885
|
) }, index)
|
|
21797
21886
|
}
|
|
21798
21887
|
) }),
|
|
21799
|
-
/* @__PURE__ */ jsxs146(HStack, { pbs: "lg",
|
|
21888
|
+
/* @__PURE__ */ jsxs146(HStack, { pbs: "lg", gap: "sm", children: [
|
|
21800
21889
|
/* @__PURE__ */ jsx229(Button, { variant: "secondary" /* secondary */, onClick: previous, children: "Back" }),
|
|
21801
21890
|
/* @__PURE__ */ jsx229(
|
|
21802
21891
|
Subscribe,
|
|
@@ -21828,7 +21917,16 @@ function LinkAccountsConfirmationStep() {
|
|
|
21828
21917
|
// src/components/PlatformOnboarding/Steps/LinkAccountsLinkStep.tsx
|
|
21829
21918
|
import { useContext as useContext52 } from "react";
|
|
21830
21919
|
import pluralize from "pluralize";
|
|
21831
|
-
|
|
21920
|
+
|
|
21921
|
+
// src/components/Separator/Separator.tsx
|
|
21922
|
+
import { jsx as jsx230 } from "react/jsx-runtime";
|
|
21923
|
+
var Separator = ({ mbs, mbe }) => {
|
|
21924
|
+
const dataProperties = toDataProperties({ mbs, mbe });
|
|
21925
|
+
return /* @__PURE__ */ jsx230("div", __spreadValues({ className: "Layer__separator" }, dataProperties));
|
|
21926
|
+
};
|
|
21927
|
+
|
|
21928
|
+
// src/components/PlatformOnboarding/Steps/LinkAccountsLinkStep.tsx
|
|
21929
|
+
import { Fragment as Fragment39, jsx as jsx231, jsxs as jsxs147 } from "react/jsx-runtime";
|
|
21832
21930
|
function LinkAccountsLinkStep() {
|
|
21833
21931
|
const {
|
|
21834
21932
|
data,
|
|
@@ -21840,47 +21938,56 @@ function LinkAccountsLinkStep() {
|
|
|
21840
21938
|
const { next } = useWizard();
|
|
21841
21939
|
const effectiveAccounts = data != null ? data : [];
|
|
21842
21940
|
return /* @__PURE__ */ jsxs147(Fragment39, { children: [
|
|
21843
|
-
/* @__PURE__ */
|
|
21941
|
+
/* @__PURE__ */ jsx231(
|
|
21844
21942
|
ConditionalList,
|
|
21845
21943
|
{
|
|
21846
21944
|
list: effectiveAccounts,
|
|
21847
|
-
Empty: /* @__PURE__ */ jsxs147(VStack, { gap: "
|
|
21848
|
-
/* @__PURE__ */
|
|
21849
|
-
/* @__PURE__ */
|
|
21850
|
-
|
|
21945
|
+
Empty: /* @__PURE__ */ jsxs147(VStack, { gap: "xl", pbe: "md", children: [
|
|
21946
|
+
/* @__PURE__ */ jsx231(Text, { status: "disabled", children: "Connect your bank accounts and credit cards to automatically import your business transactions." }),
|
|
21947
|
+
/* @__PURE__ */ jsx231(
|
|
21948
|
+
ActionableRow,
|
|
21851
21949
|
{
|
|
21852
|
-
|
|
21853
|
-
|
|
21854
|
-
|
|
21855
|
-
|
|
21856
|
-
|
|
21857
|
-
|
|
21950
|
+
iconBox: /* @__PURE__ */ jsx231(PlaidIcon_default, {}),
|
|
21951
|
+
title: "Connect my bank",
|
|
21952
|
+
description: "Import data with one simple integration.",
|
|
21953
|
+
button: /* @__PURE__ */ jsx231(
|
|
21954
|
+
Button,
|
|
21955
|
+
{
|
|
21956
|
+
onClick: () => addConnection("PLAID"),
|
|
21957
|
+
rightIcon: /* @__PURE__ */ jsx231(Link_default, { size: 12 }),
|
|
21958
|
+
disabled: loadingStatus !== "complete",
|
|
21959
|
+
children: "Connect"
|
|
21960
|
+
}
|
|
21961
|
+
)
|
|
21858
21962
|
}
|
|
21859
|
-
)
|
|
21963
|
+
)
|
|
21860
21964
|
] }),
|
|
21861
21965
|
Container: ({ children }) => /* @__PURE__ */ jsxs147(VStack, { children: [
|
|
21862
21966
|
/* @__PURE__ */ jsxs147(VStack, { gap: "2xs", pbe: "md", children: [
|
|
21863
|
-
/* @__PURE__ */
|
|
21864
|
-
/* @__PURE__ */
|
|
21967
|
+
/* @__PURE__ */ jsx231(Heading2, { level: 3, size: "sm", children: `We've found ${pluralize("account", effectiveAccounts.length, true)}` }),
|
|
21968
|
+
/* @__PURE__ */ jsx231(Text, { status: "disabled", children: "You'll have the chance to remove any accounts you don't use for your business in the next step." })
|
|
21865
21969
|
] }),
|
|
21866
|
-
/* @__PURE__ */
|
|
21867
|
-
/* @__PURE__ */
|
|
21868
|
-
|
|
21869
|
-
|
|
21870
|
-
|
|
21871
|
-
|
|
21872
|
-
|
|
21873
|
-
|
|
21874
|
-
|
|
21875
|
-
|
|
21876
|
-
|
|
21877
|
-
|
|
21878
|
-
|
|
21879
|
-
|
|
21880
|
-
|
|
21970
|
+
/* @__PURE__ */ jsx231(LinkAccountsListContainer, { children }),
|
|
21971
|
+
/* @__PURE__ */ jsx231(VStack, { pbs: "xl", children: /* @__PURE__ */ jsx231(
|
|
21972
|
+
ActionableRow,
|
|
21973
|
+
{
|
|
21974
|
+
iconBox: /* @__PURE__ */ jsx231(PlaidIcon_default, {}),
|
|
21975
|
+
title: "Connect my next bank account",
|
|
21976
|
+
description: "Import data with one simple integration.",
|
|
21977
|
+
button: /* @__PURE__ */ jsx231(
|
|
21978
|
+
Button,
|
|
21979
|
+
{
|
|
21980
|
+
onClick: () => addConnection("PLAID"),
|
|
21981
|
+
rightIcon: /* @__PURE__ */ jsx231(Link_default, { size: 12 }),
|
|
21982
|
+
disabled: loadingStatus !== "complete",
|
|
21983
|
+
children: "Connect next"
|
|
21984
|
+
}
|
|
21985
|
+
)
|
|
21986
|
+
}
|
|
21987
|
+
) })
|
|
21881
21988
|
] }),
|
|
21882
21989
|
isError: Boolean(error),
|
|
21883
|
-
Error: /* @__PURE__ */
|
|
21990
|
+
Error: /* @__PURE__ */ jsx231(
|
|
21884
21991
|
DataState,
|
|
21885
21992
|
{
|
|
21886
21993
|
status: "failed" /* failed */,
|
|
@@ -21892,20 +21999,23 @@ function LinkAccountsLinkStep() {
|
|
|
21892
21999
|
}
|
|
21893
22000
|
),
|
|
21894
22001
|
isLoading: loadingStatus === "loading" || loadingStatus === "initial",
|
|
21895
|
-
Loading: /* @__PURE__ */
|
|
21896
|
-
children: ({ item: account }) => /* @__PURE__ */
|
|
22002
|
+
Loading: /* @__PURE__ */ jsx231(Loader2, {}),
|
|
22003
|
+
children: ({ item: account }) => /* @__PURE__ */ jsx231(BasicLinkedAccountContainer, { isSelected: true, children: /* @__PURE__ */ jsx231(BasicLinkedAccountContent, { account }) }, account.id)
|
|
21897
22004
|
}
|
|
21898
22005
|
),
|
|
21899
|
-
effectiveAccounts.length > 0 ? /* @__PURE__ */
|
|
21900
|
-
|
|
21901
|
-
|
|
22006
|
+
effectiveAccounts.length > 0 ? /* @__PURE__ */ jsxs147(Fragment39, { children: [
|
|
22007
|
+
/* @__PURE__ */ jsx231(Separator, { mbs: "lg", mbe: "lg" }),
|
|
22008
|
+
/* @__PURE__ */ jsx231(HStack, { justify: "start", gap: "sm", children: /* @__PURE__ */ jsx231(Button, { onClick: () => {
|
|
22009
|
+
void next();
|
|
22010
|
+
}, rightIcon: /* @__PURE__ */ jsx231(ChevronRight_default, {}), children: "I\u2019m done linking my banks" }) })
|
|
22011
|
+
] }) : null
|
|
21902
22012
|
] });
|
|
21903
22013
|
}
|
|
21904
22014
|
|
|
21905
22015
|
// src/components/PlatformOnboarding/LinkAccounts.tsx
|
|
21906
|
-
import { jsx as
|
|
22016
|
+
import { jsx as jsx232, jsxs as jsxs148 } from "react/jsx-runtime";
|
|
21907
22017
|
function LinkAccounts(props) {
|
|
21908
|
-
return /* @__PURE__ */
|
|
22018
|
+
return /* @__PURE__ */ jsx232(LinkedAccountsProvider, { children: /* @__PURE__ */ jsx232(LinkAccountsContent, __spreadValues({}, props)) });
|
|
21909
22019
|
}
|
|
21910
22020
|
function LinkAccountsContent({
|
|
21911
22021
|
onComplete
|
|
@@ -21913,54 +22023,1121 @@ function LinkAccountsContent({
|
|
|
21913
22023
|
const { data: linkedAccounts, loadingStatus } = useContext53(LinkedAccountsContext);
|
|
21914
22024
|
const linkedAccountsNeedingConfirmation = linkedAccounts ? getAccountsNeedingConfirmation(linkedAccounts) : [];
|
|
21915
22025
|
const hideConfirmationStep = loadingStatus === "complete" && linkedAccountsNeedingConfirmation.length === 0;
|
|
21916
|
-
return /* @__PURE__ */
|
|
22026
|
+
return /* @__PURE__ */ jsx232("section", { className: "Layer__link-accounts Layer__component", children: /* @__PURE__ */ jsxs148(
|
|
21917
22027
|
Wizard,
|
|
21918
22028
|
{
|
|
21919
|
-
Header: /* @__PURE__ */
|
|
22029
|
+
Header: /* @__PURE__ */ jsx232(Heading2, { children: "Link your bank accounts and credit cards" }),
|
|
21920
22030
|
Footer: null,
|
|
21921
22031
|
onComplete,
|
|
21922
22032
|
children: [
|
|
21923
|
-
/* @__PURE__ */
|
|
21924
|
-
hideConfirmationStep ? null : /* @__PURE__ */
|
|
22033
|
+
/* @__PURE__ */ jsx232(LinkAccountsLinkStep, {}),
|
|
22034
|
+
hideConfirmationStep ? null : /* @__PURE__ */ jsx232(LinkAccountsConfirmationStep, {})
|
|
21925
22035
|
]
|
|
21926
22036
|
}
|
|
21927
22037
|
) });
|
|
21928
22038
|
}
|
|
21929
22039
|
|
|
21930
|
-
// src/
|
|
21931
|
-
import {
|
|
21932
|
-
|
|
21933
|
-
|
|
21934
|
-
|
|
22040
|
+
// src/components/PlatformOnboarding/PlatformOnboarding.tsx
|
|
22041
|
+
import { useState as useState61 } from "react";
|
|
22042
|
+
|
|
22043
|
+
// src/components/ProgressSteps/ProgressSteps.tsx
|
|
22044
|
+
import { jsx as jsx233, jsxs as jsxs149 } from "react/jsx-runtime";
|
|
22045
|
+
var ProgressSteps = ({ steps, currentStep }) => {
|
|
22046
|
+
return /* @__PURE__ */ jsx233("div", { className: "Layer__progress-steps", children: steps.map((step, index) => {
|
|
22047
|
+
const dataProperties = toDataProperties({ active: index <= currentStep, complete: currentStep > index });
|
|
22048
|
+
return /* @__PURE__ */ jsx233(
|
|
22049
|
+
"div",
|
|
22050
|
+
{
|
|
22051
|
+
className: "Layer__progress-steps--step-wrapper",
|
|
22052
|
+
children: /* @__PURE__ */ jsxs149("div", __spreadProps(__spreadValues({ className: "Layer__progress-steps--step" }, dataProperties), { children: [
|
|
22053
|
+
index < steps.length - 1 && /* @__PURE__ */ jsx233("div", { className: "Layer__progress-steps--step-line" }),
|
|
22054
|
+
/* @__PURE__ */ jsx233("div", { className: "Layer__progress-steps--circle", children: index < currentStep && /* @__PURE__ */ jsx233(Check_default, { size: 10 }) }),
|
|
22055
|
+
/* @__PURE__ */ jsx233("div", { className: "Layer__progress-steps--label", children: /* @__PURE__ */ jsx233(Text, { size: "sm" /* sm */, children: step }) })
|
|
22056
|
+
] }))
|
|
22057
|
+
},
|
|
22058
|
+
index
|
|
22059
|
+
);
|
|
22060
|
+
}) });
|
|
22061
|
+
};
|
|
22062
|
+
|
|
22063
|
+
// src/icons/Document.tsx
|
|
22064
|
+
import { jsx as jsx234, jsxs as jsxs150 } from "react/jsx-runtime";
|
|
22065
|
+
var Document = (_a) => {
|
|
22066
|
+
var _b = _a, { size = 20 } = _b, props = __objRest(_b, ["size"]);
|
|
22067
|
+
return /* @__PURE__ */ jsxs150(
|
|
21935
22068
|
"svg",
|
|
21936
22069
|
__spreadProps(__spreadValues({
|
|
21937
22070
|
xmlns: "http://www.w3.org/2000/svg",
|
|
21938
|
-
viewBox: "0 0
|
|
22071
|
+
viewBox: "0 0 20 20",
|
|
21939
22072
|
fill: "none"
|
|
21940
22073
|
}, props), {
|
|
21941
22074
|
width: size,
|
|
21942
22075
|
height: size,
|
|
21943
22076
|
children: [
|
|
21944
|
-
/* @__PURE__ */
|
|
21945
|
-
|
|
21946
|
-
|
|
21947
|
-
|
|
21948
|
-
|
|
21949
|
-
|
|
21950
|
-
|
|
21951
|
-
|
|
21952
|
-
|
|
21953
|
-
|
|
21954
|
-
|
|
21955
|
-
|
|
21956
|
-
|
|
22077
|
+
/* @__PURE__ */ jsx234(
|
|
22078
|
+
"path",
|
|
22079
|
+
{
|
|
22080
|
+
d: "M11.6667 1.66666H5.00004C4.55801 1.66666 4.13409 1.84226 3.82153 2.15482C3.50897 2.46738 3.33337 2.8913 3.33337 3.33333V16.6667C3.33337 17.1087 3.50897 17.5326 3.82153 17.8452C4.13409 18.1577 4.55801 18.3333 5.00004 18.3333H15C15.4421 18.3333 15.866 18.1577 16.1786 17.8452C16.4911 17.5326 16.6667 17.1087 16.6667 16.6667V6.66666L11.6667 1.66666Z",
|
|
22081
|
+
stroke: "white",
|
|
22082
|
+
strokeLinecap: "round",
|
|
22083
|
+
strokeLinejoin: "round"
|
|
22084
|
+
}
|
|
22085
|
+
),
|
|
22086
|
+
/* @__PURE__ */ jsx234(
|
|
22087
|
+
"path",
|
|
22088
|
+
{
|
|
22089
|
+
d: "M11.6667 1.66666H5.00004C4.55801 1.66666 4.13409 1.84226 3.82153 2.15482C3.50897 2.46738 3.33337 2.8913 3.33337 3.33333V16.6667C3.33337 17.1087 3.50897 17.5326 3.82153 17.8452C4.13409 18.1577 4.55801 18.3333 5.00004 18.3333H15C15.4421 18.3333 15.866 18.1577 16.1786 17.8452C16.4911 17.5326 16.6667 17.1087 16.6667 16.6667V6.66666L11.6667 1.66666Z",
|
|
22090
|
+
stroke: "currentColor",
|
|
22091
|
+
strokeLinecap: "round",
|
|
22092
|
+
strokeLinejoin: "round"
|
|
22093
|
+
}
|
|
22094
|
+
),
|
|
22095
|
+
/* @__PURE__ */ jsx234(
|
|
22096
|
+
"path",
|
|
22097
|
+
{
|
|
22098
|
+
d: "M11.6666 1.66666V6.66666H16.6666",
|
|
22099
|
+
stroke: "white",
|
|
22100
|
+
strokeLinecap: "round",
|
|
22101
|
+
strokeLinejoin: "round"
|
|
22102
|
+
}
|
|
22103
|
+
),
|
|
22104
|
+
/* @__PURE__ */ jsx234(
|
|
22105
|
+
"path",
|
|
22106
|
+
{
|
|
22107
|
+
d: "M11.6666 1.66666V6.66666H16.6666",
|
|
22108
|
+
stroke: "currentColor",
|
|
22109
|
+
strokeLinecap: "round",
|
|
22110
|
+
strokeLinejoin: "round"
|
|
22111
|
+
}
|
|
22112
|
+
),
|
|
22113
|
+
/* @__PURE__ */ jsx234(
|
|
22114
|
+
"path",
|
|
22115
|
+
{
|
|
22116
|
+
d: "M13.3333 10.8333H6.66663",
|
|
22117
|
+
stroke: "white",
|
|
22118
|
+
strokeLinecap: "round",
|
|
22119
|
+
strokeLinejoin: "round"
|
|
22120
|
+
}
|
|
22121
|
+
),
|
|
22122
|
+
/* @__PURE__ */ jsx234(
|
|
22123
|
+
"path",
|
|
22124
|
+
{
|
|
22125
|
+
d: "M13.3333 10.8333H6.66663",
|
|
22126
|
+
stroke: "currentColor",
|
|
22127
|
+
strokeLinecap: "round",
|
|
22128
|
+
strokeLinejoin: "round"
|
|
22129
|
+
}
|
|
22130
|
+
),
|
|
22131
|
+
/* @__PURE__ */ jsx234(
|
|
22132
|
+
"path",
|
|
22133
|
+
{
|
|
22134
|
+
d: "M13.3333 14.1667H6.66663",
|
|
22135
|
+
stroke: "white",
|
|
22136
|
+
strokeLinecap: "round",
|
|
22137
|
+
strokeLinejoin: "round"
|
|
22138
|
+
}
|
|
22139
|
+
),
|
|
22140
|
+
/* @__PURE__ */ jsx234(
|
|
22141
|
+
"path",
|
|
22142
|
+
{
|
|
22143
|
+
d: "M13.3333 14.1667H6.66663",
|
|
22144
|
+
stroke: "currentColor",
|
|
22145
|
+
strokeLinecap: "round",
|
|
22146
|
+
strokeLinejoin: "round"
|
|
22147
|
+
}
|
|
22148
|
+
),
|
|
22149
|
+
/* @__PURE__ */ jsx234(
|
|
22150
|
+
"path",
|
|
22151
|
+
{
|
|
22152
|
+
d: "M8.33329 7.5H7.49996H6.66663",
|
|
22153
|
+
stroke: "white",
|
|
22154
|
+
strokeLinecap: "round",
|
|
22155
|
+
strokeLinejoin: "round"
|
|
22156
|
+
}
|
|
22157
|
+
),
|
|
22158
|
+
/* @__PURE__ */ jsx234(
|
|
22159
|
+
"path",
|
|
22160
|
+
{
|
|
22161
|
+
d: "M8.33329 7.5H7.49996H6.66663",
|
|
22162
|
+
stroke: "currentColor",
|
|
22163
|
+
strokeLinecap: "round",
|
|
22164
|
+
strokeLinejoin: "round"
|
|
22165
|
+
}
|
|
22166
|
+
)
|
|
22167
|
+
]
|
|
22168
|
+
})
|
|
22169
|
+
);
|
|
22170
|
+
};
|
|
22171
|
+
var Document_default = Document;
|
|
22172
|
+
|
|
22173
|
+
// src/icons/TrendingUp.tsx
|
|
22174
|
+
import { jsx as jsx235, jsxs as jsxs151 } from "react/jsx-runtime";
|
|
22175
|
+
var TrendingUp = (_a) => {
|
|
22176
|
+
var _b = _a, { size = 20 } = _b, props = __objRest(_b, ["size"]);
|
|
22177
|
+
return /* @__PURE__ */ jsxs151(
|
|
22178
|
+
"svg",
|
|
22179
|
+
__spreadProps(__spreadValues({
|
|
22180
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
22181
|
+
viewBox: "0 0 20 20",
|
|
22182
|
+
fill: "none"
|
|
22183
|
+
}, props), {
|
|
22184
|
+
width: size,
|
|
22185
|
+
height: size,
|
|
22186
|
+
children: [
|
|
22187
|
+
/* @__PURE__ */ jsx235(
|
|
22188
|
+
"path",
|
|
22189
|
+
{
|
|
22190
|
+
d: "M19.1667 5L11.25 12.9167L7.08337 8.75L0.833374 15",
|
|
22191
|
+
stroke: "white",
|
|
22192
|
+
strokeLinecap: "round",
|
|
22193
|
+
strokeLinejoin: "round"
|
|
22194
|
+
}
|
|
22195
|
+
),
|
|
22196
|
+
/* @__PURE__ */ jsx235(
|
|
22197
|
+
"path",
|
|
22198
|
+
{
|
|
22199
|
+
d: "M19.1667 5L11.25 12.9167L7.08337 8.75L0.833374 15",
|
|
22200
|
+
stroke: "currentColor",
|
|
22201
|
+
strokeLinecap: "round",
|
|
22202
|
+
strokeLinejoin: "round"
|
|
22203
|
+
}
|
|
22204
|
+
),
|
|
22205
|
+
/* @__PURE__ */ jsx235(
|
|
22206
|
+
"path",
|
|
22207
|
+
{
|
|
22208
|
+
d: "M14.1666 5H19.1666V10",
|
|
22209
|
+
stroke: "white",
|
|
22210
|
+
strokeLinecap: "round",
|
|
22211
|
+
strokeLinejoin: "round"
|
|
22212
|
+
}
|
|
22213
|
+
),
|
|
22214
|
+
/* @__PURE__ */ jsx235(
|
|
22215
|
+
"path",
|
|
22216
|
+
{
|
|
22217
|
+
d: "M14.1666 5H19.1666V10",
|
|
22218
|
+
stroke: "currentColor",
|
|
22219
|
+
strokeLinecap: "round",
|
|
22220
|
+
strokeLinejoin: "round"
|
|
22221
|
+
}
|
|
22222
|
+
)
|
|
22223
|
+
]
|
|
22224
|
+
})
|
|
22225
|
+
);
|
|
22226
|
+
};
|
|
22227
|
+
var TrendingUp_default = TrendingUp;
|
|
22228
|
+
|
|
22229
|
+
// src/components/PlatformOnboarding/Steps/WelcomeStep.tsx
|
|
22230
|
+
import { Fragment as Fragment40, jsx as jsx236, jsxs as jsxs152 } from "react/jsx-runtime";
|
|
22231
|
+
var defaultTitle = "Welcome";
|
|
22232
|
+
var defaultDescription = "Welcome to the platform onboarding process";
|
|
22233
|
+
var WelcomeStep = ({ onNext, title = defaultTitle, description, stepsEnabled }) => {
|
|
22234
|
+
const buildDescription = () => {
|
|
22235
|
+
if (description) {
|
|
22236
|
+
return description;
|
|
22237
|
+
}
|
|
22238
|
+
if (stepsEnabled) {
|
|
22239
|
+
let text = "In this flow we\u2019ll ";
|
|
22240
|
+
if (stepsEnabled.includes("business-info")) {
|
|
22241
|
+
text += "confirm your business information, ";
|
|
22242
|
+
}
|
|
22243
|
+
if (stepsEnabled.includes("link-accounts")) {
|
|
22244
|
+
text += "connect your financial accounts, ";
|
|
22245
|
+
}
|
|
22246
|
+
text += "and start managing your books like a pro.";
|
|
22247
|
+
return text;
|
|
22248
|
+
}
|
|
22249
|
+
return defaultDescription;
|
|
22250
|
+
};
|
|
22251
|
+
return /* @__PURE__ */ jsxs152(Fragment40, { children: [
|
|
22252
|
+
/* @__PURE__ */ jsxs152("div", { className: "Layer__platform-onboarding__welcome", children: [
|
|
22253
|
+
/* @__PURE__ */ jsx236(Heading, { className: "Layer__platform-onboarding__heading", align: "left", children: title }),
|
|
22254
|
+
/* @__PURE__ */ jsx236(Text, { status: "disabled", children: buildDescription() })
|
|
22255
|
+
] }),
|
|
22256
|
+
/* @__PURE__ */ jsx236(Button, { onClick: onNext, children: "Get started" })
|
|
22257
|
+
] });
|
|
22258
|
+
};
|
|
22259
|
+
var WelcomeStepFooter = () => {
|
|
22260
|
+
return /* @__PURE__ */ jsxs152("div", { className: "Layer__platform-onboarding__welcome-footer", children: [
|
|
22261
|
+
/* @__PURE__ */ jsxs152("div", { className: "Layer__platform-onboarding__welcome-footer__content", children: [
|
|
22262
|
+
/* @__PURE__ */ jsxs152("div", { className: "Layer__platform-onboarding__welcome-footer__header", children: [
|
|
22263
|
+
/* @__PURE__ */ jsx236(Heading, { align: "left", children: "How it works" }),
|
|
22264
|
+
/* @__PURE__ */ jsx236(Text, { status: "disabled", children: "Discover how seamless accounting can transform your business." })
|
|
22265
|
+
] }),
|
|
22266
|
+
/* @__PURE__ */ jsxs152(VStack, { gap: "lg", children: [
|
|
22267
|
+
/* @__PURE__ */ jsxs152(VStack, { gap: "xs", children: [
|
|
22268
|
+
/* @__PURE__ */ jsxs152(HStack, { gap: "xs", children: [
|
|
22269
|
+
/* @__PURE__ */ jsx236(TrendingUp_default, {}),
|
|
22270
|
+
/* @__PURE__ */ jsx236(Heading, { size: "secondary" /* secondary */, children: "Understand your business health" })
|
|
22271
|
+
] }),
|
|
22272
|
+
/* @__PURE__ */ jsx236(Text, { status: "disabled", children: "Get an accurate picture of your financial performance and insight into how to grow your profit." })
|
|
22273
|
+
] }),
|
|
22274
|
+
/* @__PURE__ */ jsxs152(VStack, { gap: "xs", children: [
|
|
22275
|
+
/* @__PURE__ */ jsxs152(HStack, { gap: "xs", children: [
|
|
22276
|
+
/* @__PURE__ */ jsx236(Document_default, {}),
|
|
22277
|
+
/* @__PURE__ */ jsx236(Heading, { size: "secondary" /* secondary */, children: "Be ready for tax time" })
|
|
22278
|
+
] }),
|
|
22279
|
+
/* @__PURE__ */ jsx236(Text, { status: "disabled", children: "Keep your business finances organized to avoid paying more taxes than needed or IRS fines at tax time." })
|
|
22280
|
+
] })
|
|
22281
|
+
] })
|
|
22282
|
+
] }),
|
|
22283
|
+
/* @__PURE__ */ jsxs152("div", { className: "Layer__platform-onboarding__welcome-footer__images", children: [
|
|
22284
|
+
/* @__PURE__ */ jsxs152("div", { className: "Layer__platform-onboarding__welcome-footer__image", children: [
|
|
22285
|
+
/* @__PURE__ */ jsx236("div", { className: "Layer__platform__onboarding__welcome-footer__image-wrapper", children: /* @__PURE__ */ jsx236(
|
|
22286
|
+
"img",
|
|
22287
|
+
{
|
|
22288
|
+
src: "https://layer-public.s3.us-west-2.amazonaws.com/site-images/linked-accounts.png",
|
|
22289
|
+
alt: "Connect your accounts"
|
|
22290
|
+
}
|
|
22291
|
+
) }),
|
|
22292
|
+
/* @__PURE__ */ jsxs152("div", { className: "Layer__platform__onboarding__welcome-footer__image-text", children: [
|
|
22293
|
+
/* @__PURE__ */ jsx236(Heading, { size: "secondary" /* secondary */, children: "Connect your accounts" }),
|
|
22294
|
+
/* @__PURE__ */ jsx236(Text, { as: "p", children: "Connect your bank accounts and credit cards to see a complete picture of your business finances." })
|
|
22295
|
+
] })
|
|
22296
|
+
] }),
|
|
22297
|
+
/* @__PURE__ */ jsxs152("div", { className: "Layer__platform-onboarding__welcome-footer__image", children: [
|
|
22298
|
+
/* @__PURE__ */ jsx236("div", { className: "Layer__platform__onboarding__welcome-footer__image-wrapper", children: /* @__PURE__ */ jsx236(
|
|
22299
|
+
"img",
|
|
22300
|
+
{
|
|
22301
|
+
src: "https://layer-public.s3.us-west-2.amazonaws.com/site-images/bookkeeping-tasks.png",
|
|
22302
|
+
alt: "Bookkeeping tasks"
|
|
22303
|
+
}
|
|
22304
|
+
) }),
|
|
22305
|
+
/* @__PURE__ */ jsxs152("div", { className: "Layer__platform__onboarding__welcome-footer__image-text", children: [
|
|
22306
|
+
/* @__PURE__ */ jsx236(Heading, { size: "secondary" /* secondary */, children: "Ongoing monthly bookkeeping" }),
|
|
22307
|
+
/* @__PURE__ */ jsx236(Text, { as: "p", children: "Receive a monthly report of your financial performance to review with your PSM." })
|
|
22308
|
+
] })
|
|
22309
|
+
] }),
|
|
22310
|
+
/* @__PURE__ */ jsxs152("div", { className: "Layer__platform-onboarding__welcome-footer__image", children: [
|
|
22311
|
+
/* @__PURE__ */ jsx236("div", { className: "Layer__platform__onboarding__welcome-footer__image-wrapper", children: /* @__PURE__ */ jsx236(
|
|
22312
|
+
"img",
|
|
22313
|
+
{
|
|
22314
|
+
src: "https://layer-public.s3.us-west-2.amazonaws.com/site-images/revenue.png",
|
|
22315
|
+
alt: "Profitability"
|
|
22316
|
+
}
|
|
22317
|
+
) }),
|
|
22318
|
+
/* @__PURE__ */ jsxs152("div", { className: "Layer__platform__onboarding__welcome-footer__image-text", children: [
|
|
22319
|
+
/* @__PURE__ */ jsx236(Heading, { size: "secondary" /* secondary */, children: "See your profitability" }),
|
|
22320
|
+
/* @__PURE__ */ jsx236(Text, { as: "p", children: "Our bookkeeping team organized and categorizes your business transactions." })
|
|
22321
|
+
] })
|
|
22322
|
+
] })
|
|
22323
|
+
] })
|
|
22324
|
+
] });
|
|
22325
|
+
};
|
|
22326
|
+
|
|
22327
|
+
// src/components/PlatformOnboarding/Steps/SummaryStep.tsx
|
|
22328
|
+
import { Fragment as Fragment41, jsx as jsx237, jsxs as jsxs153 } from "react/jsx-runtime";
|
|
22329
|
+
var defaultTitle2 = "You\u2019re all set!";
|
|
22330
|
+
var defaultDescription2 = "We\u2019re syncing your accounts. This process may take a while to complete.";
|
|
22331
|
+
var defaultNextBtnText = "Go to dashboard";
|
|
22332
|
+
var SummaryStep = ({ onNext, title = defaultTitle2, description = defaultDescription2, nextBtnText = defaultNextBtnText }) => {
|
|
22333
|
+
return /* @__PURE__ */ jsxs153(Fragment41, { children: [
|
|
22334
|
+
/* @__PURE__ */ jsxs153("div", { className: "Layer__platform-onboarding__summary", children: [
|
|
22335
|
+
/* @__PURE__ */ jsx237(Heading, { className: "Layer__platform-onboarding__heading", align: "left", children: title }),
|
|
22336
|
+
/* @__PURE__ */ jsx237(Text, { status: "disabled", children: description })
|
|
22337
|
+
] }),
|
|
22338
|
+
/* @__PURE__ */ jsx237(Button, { onClick: onNext, children: nextBtnText })
|
|
22339
|
+
] });
|
|
22340
|
+
};
|
|
22341
|
+
|
|
22342
|
+
// src/utils/form.ts
|
|
22343
|
+
var notEmpty = (value) => {
|
|
22344
|
+
if (!value) {
|
|
22345
|
+
return false;
|
|
22346
|
+
}
|
|
22347
|
+
return value.trim().length > 0;
|
|
22348
|
+
};
|
|
22349
|
+
var validateEmailFormat = (email, required = false) => {
|
|
22350
|
+
if (!email) {
|
|
22351
|
+
return !required;
|
|
22352
|
+
}
|
|
22353
|
+
return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email);
|
|
22354
|
+
};
|
|
22355
|
+
|
|
22356
|
+
// src/components/BusinessForm/useBusinessForm.ts
|
|
22357
|
+
import { useForm as useForm2, useStore as useStore3 } from "@tanstack/react-form";
|
|
22358
|
+
|
|
22359
|
+
// src/hooks/businessPersonnel/useBusinessPersonnel.ts
|
|
22360
|
+
import useSWR15 from "swr";
|
|
22361
|
+
|
|
22362
|
+
// src/utils/array/readonlyTransformations.ts
|
|
22363
|
+
function mapReadonly(array, callbackFn) {
|
|
22364
|
+
return array.map(callbackFn);
|
|
22365
|
+
}
|
|
22366
|
+
function filterReadonly(array, predicate) {
|
|
22367
|
+
return array.filter(predicate);
|
|
22368
|
+
}
|
|
22369
|
+
|
|
22370
|
+
// src/hooks/businessPersonnel/types.ts
|
|
22371
|
+
var PERSONNEL_ROLES = ["ACCOUNTANT", "ADMINISTRATOR", "OWNER"];
|
|
22372
|
+
function isPersonnelRole(role) {
|
|
22373
|
+
return PERSONNEL_ROLES.includes(role);
|
|
22374
|
+
}
|
|
22375
|
+
|
|
22376
|
+
// src/hooks/businessPersonnel/useBusinessPersonnel.ts
|
|
22377
|
+
var BUSINESS_PERSONNEL_TAG_KEY = "#business-personnel";
|
|
22378
|
+
function buildKey13({
|
|
22379
|
+
access_token: accessToken,
|
|
22380
|
+
apiUrl,
|
|
22381
|
+
businessId
|
|
22382
|
+
}) {
|
|
22383
|
+
if (accessToken && apiUrl) {
|
|
22384
|
+
return {
|
|
22385
|
+
accessToken,
|
|
22386
|
+
apiUrl,
|
|
22387
|
+
businessId,
|
|
22388
|
+
tags: [BUSINESS_PERSONNEL_TAG_KEY]
|
|
22389
|
+
};
|
|
22390
|
+
}
|
|
22391
|
+
}
|
|
22392
|
+
var getBusinessPersonnel = get(({ businessId }) => `/v1/businesses/${businessId}/personnel`);
|
|
22393
|
+
function useBusinessPersonnel() {
|
|
22394
|
+
const { data } = useAuth();
|
|
22395
|
+
const { businessId } = useLayerContext();
|
|
22396
|
+
return useSWR15(
|
|
22397
|
+
() => buildKey13(__spreadProps(__spreadValues({}, data), {
|
|
22398
|
+
businessId
|
|
22399
|
+
})),
|
|
22400
|
+
({ accessToken, apiUrl, businessId: businessId2 }) => getBusinessPersonnel(
|
|
22401
|
+
apiUrl,
|
|
22402
|
+
accessToken,
|
|
22403
|
+
{
|
|
22404
|
+
params: { businessId: businessId2 }
|
|
22405
|
+
}
|
|
22406
|
+
)().then(({ data: data2 }) => data2.map(({
|
|
22407
|
+
id,
|
|
22408
|
+
full_name: fullName,
|
|
22409
|
+
preferred_name: preferredName,
|
|
22410
|
+
external_id: externalId,
|
|
22411
|
+
email_addresses,
|
|
22412
|
+
phone_numbers,
|
|
22413
|
+
roles
|
|
22414
|
+
}) => ({
|
|
22415
|
+
id,
|
|
22416
|
+
fullName,
|
|
22417
|
+
preferredName,
|
|
22418
|
+
externalId,
|
|
22419
|
+
emailAddresses: mapReadonly(
|
|
22420
|
+
email_addresses,
|
|
22421
|
+
({ id: id2, email_address: emailAddress }) => ({ id: id2, emailAddress })
|
|
22422
|
+
),
|
|
22423
|
+
phoneNumbers: mapReadonly(
|
|
22424
|
+
phone_numbers,
|
|
22425
|
+
({ id: id2, phone_number: phoneNumber }) => ({ id: id2, phoneNumber })
|
|
22426
|
+
),
|
|
22427
|
+
roles: filterReadonly(
|
|
22428
|
+
roles,
|
|
22429
|
+
(roleEntity) => isPersonnelRole(roleEntity.role)
|
|
22430
|
+
)
|
|
22431
|
+
})))
|
|
22432
|
+
);
|
|
22433
|
+
}
|
|
22434
|
+
|
|
22435
|
+
// src/hooks/businessPersonnel/useCreateBusinessPersonnel.ts
|
|
22436
|
+
import useSWRMutation7 from "swr/mutation";
|
|
22437
|
+
import { useSWRConfig } from "swr";
|
|
22438
|
+
|
|
22439
|
+
// src/utils/swr/withSWRKeyTags.ts
|
|
22440
|
+
function withSWRKeyTags(key, predicate) {
|
|
22441
|
+
if (typeof key !== "object" || key === null || !("tags" in key)) {
|
|
22442
|
+
return false;
|
|
22443
|
+
}
|
|
22444
|
+
return isStringArray(key.tags) ? predicate(key.tags) : false;
|
|
22445
|
+
}
|
|
22446
|
+
|
|
22447
|
+
// src/hooks/businessPersonnel/useCreateBusinessPersonnel.ts
|
|
22448
|
+
var createBusinessPersonnel = post(({ businessId }) => `/v1/businesses/${businessId}/personnel`);
|
|
22449
|
+
function buildKey14({
|
|
22450
|
+
access_token: accessToken,
|
|
22451
|
+
apiUrl,
|
|
22452
|
+
businessId
|
|
22453
|
+
}) {
|
|
22454
|
+
if (accessToken && apiUrl) {
|
|
22455
|
+
return {
|
|
22456
|
+
accessToken,
|
|
22457
|
+
apiUrl,
|
|
22458
|
+
businessId,
|
|
22459
|
+
tags: [`${BUSINESS_PERSONNEL_TAG_KEY}:create`]
|
|
22460
|
+
};
|
|
22461
|
+
}
|
|
22462
|
+
}
|
|
22463
|
+
function useCreateBusinessPersonnel() {
|
|
22464
|
+
const { data } = useAuth();
|
|
22465
|
+
const { businessId } = useLayerContext();
|
|
22466
|
+
const { mutate } = useSWRConfig();
|
|
22467
|
+
const mutationResponse = useSWRMutation7(
|
|
22468
|
+
() => buildKey14(__spreadProps(__spreadValues({}, data), {
|
|
22469
|
+
businessId
|
|
22470
|
+
})),
|
|
22471
|
+
({ accessToken, apiUrl, businessId: businessId2 }, { arg: body }) => createBusinessPersonnel(
|
|
22472
|
+
apiUrl,
|
|
22473
|
+
accessToken,
|
|
22474
|
+
{
|
|
22475
|
+
params: { businessId: businessId2 },
|
|
22476
|
+
body
|
|
22477
|
+
}
|
|
22478
|
+
).then(({ data: data2 }) => data2),
|
|
22479
|
+
{
|
|
22480
|
+
revalidate: false,
|
|
22481
|
+
throwOnError: false
|
|
22482
|
+
}
|
|
22483
|
+
);
|
|
22484
|
+
const { trigger: originalTrigger } = mutationResponse;
|
|
22485
|
+
return Object.assign(
|
|
22486
|
+
mutationResponse,
|
|
22487
|
+
{
|
|
22488
|
+
trigger: (...triggerParameters) => __async(this, null, function* () {
|
|
22489
|
+
const data2 = yield originalTrigger(...triggerParameters);
|
|
22490
|
+
if (data2) {
|
|
22491
|
+
yield mutate((key) => withSWRKeyTags(key, (tags) => tags.includes(BUSINESS_PERSONNEL_TAG_KEY)));
|
|
22492
|
+
}
|
|
22493
|
+
return data2;
|
|
22494
|
+
})
|
|
22495
|
+
}
|
|
22496
|
+
);
|
|
22497
|
+
}
|
|
22498
|
+
|
|
22499
|
+
// src/hooks/businessPersonnel/useUpdateBusinessPersonnel.ts
|
|
22500
|
+
import useSWRMutation8 from "swr/mutation";
|
|
22501
|
+
import { useSWRConfig as useSWRConfig2 } from "swr";
|
|
22502
|
+
|
|
22503
|
+
// src/api/layer/businessPersonnel/updateBusinessPersonnel.ts
|
|
22504
|
+
var updateBusinessPersonnel = post(({ businessId, businessPersonnelId }) => {
|
|
22505
|
+
return `/v1/businesses/${businessId}/personnel/${businessPersonnelId}/update`;
|
|
22506
|
+
});
|
|
22507
|
+
|
|
22508
|
+
// src/hooks/businessPersonnel/useUpdateBusinessPersonnel.ts
|
|
22509
|
+
function buildKey15({
|
|
22510
|
+
access_token: accessToken,
|
|
22511
|
+
apiUrl,
|
|
22512
|
+
businessId,
|
|
22513
|
+
businessPersonnelId
|
|
22514
|
+
}) {
|
|
22515
|
+
if (accessToken && apiUrl && businessPersonnelId) {
|
|
22516
|
+
return {
|
|
22517
|
+
accessToken,
|
|
22518
|
+
apiUrl,
|
|
22519
|
+
businessId,
|
|
22520
|
+
businessPersonnelId,
|
|
22521
|
+
tags: [`${BUSINESS_PERSONNEL_TAG_KEY}:${businessPersonnelId}`]
|
|
22522
|
+
};
|
|
22523
|
+
}
|
|
22524
|
+
}
|
|
22525
|
+
function useUpdateBusinessPersonnel({ businessPersonnelId }) {
|
|
22526
|
+
const { data } = useAuth();
|
|
22527
|
+
const { businessId } = useLayerContext();
|
|
22528
|
+
const { mutate } = useSWRConfig2();
|
|
22529
|
+
const mutationResponse = useSWRMutation8(
|
|
22530
|
+
() => buildKey15(__spreadProps(__spreadValues({}, data), {
|
|
22531
|
+
businessId,
|
|
22532
|
+
businessPersonnelId
|
|
22533
|
+
})),
|
|
22534
|
+
({ accessToken, apiUrl, businessId: businessId2, businessPersonnelId: businessPersonnelId2 }, { arg: body }) => updateBusinessPersonnel(
|
|
22535
|
+
apiUrl,
|
|
22536
|
+
accessToken,
|
|
22537
|
+
{
|
|
22538
|
+
params: {
|
|
22539
|
+
businessId: businessId2,
|
|
22540
|
+
businessPersonnelId: businessPersonnelId2
|
|
22541
|
+
},
|
|
22542
|
+
body
|
|
22543
|
+
}
|
|
22544
|
+
).then(({ data: data2 }) => data2),
|
|
22545
|
+
{
|
|
22546
|
+
revalidate: false,
|
|
22547
|
+
throwOnError: false
|
|
22548
|
+
}
|
|
22549
|
+
);
|
|
22550
|
+
const { trigger: originalTrigger } = mutationResponse;
|
|
22551
|
+
return Object.assign(
|
|
22552
|
+
mutationResponse,
|
|
22553
|
+
{
|
|
22554
|
+
trigger: (...triggerParameters) => __async(this, null, function* () {
|
|
22555
|
+
const data2 = yield originalTrigger(...triggerParameters);
|
|
22556
|
+
if (data2) {
|
|
22557
|
+
yield mutate((key) => withSWRKeyTags(key, (tags) => tags.includes(BUSINESS_PERSONNEL_TAG_KEY)));
|
|
22558
|
+
}
|
|
22559
|
+
return data2;
|
|
22560
|
+
})
|
|
22561
|
+
}
|
|
22562
|
+
);
|
|
22563
|
+
}
|
|
22564
|
+
|
|
22565
|
+
// src/hooks/business/useUpdateBusiness.ts
|
|
22566
|
+
import useSWRMutation9 from "swr/mutation";
|
|
22567
|
+
import { useSWRConfig as useSWRConfig3 } from "swr";
|
|
22568
|
+
var BUSINESS_TAG_KEY = "business";
|
|
22569
|
+
function buildKey16({
|
|
22570
|
+
access_token: accessToken,
|
|
22571
|
+
apiUrl,
|
|
22572
|
+
businessId
|
|
22573
|
+
}) {
|
|
22574
|
+
if (accessToken && apiUrl && businessId) {
|
|
22575
|
+
return {
|
|
22576
|
+
accessToken,
|
|
22577
|
+
apiUrl,
|
|
22578
|
+
businessId,
|
|
22579
|
+
tags: [`${BUSINESS_TAG_KEY}:${businessId}`]
|
|
22580
|
+
};
|
|
22581
|
+
}
|
|
22582
|
+
}
|
|
22583
|
+
function useUpdateBusiness() {
|
|
22584
|
+
const { data } = useAuth();
|
|
22585
|
+
const { businessId } = useLayerContext();
|
|
22586
|
+
const { mutate } = useSWRConfig3();
|
|
22587
|
+
const mutationResponse = useSWRMutation9(
|
|
22588
|
+
() => buildKey16(__spreadProps(__spreadValues({}, data), {
|
|
22589
|
+
businessId
|
|
22590
|
+
})),
|
|
22591
|
+
({ accessToken, apiUrl, businessId: businessId2 }, { arg: body }) => updateBusiness(
|
|
22592
|
+
apiUrl,
|
|
22593
|
+
accessToken,
|
|
22594
|
+
{
|
|
22595
|
+
params: { businessId: businessId2 },
|
|
22596
|
+
body
|
|
22597
|
+
}
|
|
22598
|
+
).then(({ data: data2 }) => data2),
|
|
22599
|
+
{
|
|
22600
|
+
revalidate: false,
|
|
22601
|
+
throwOnError: false
|
|
22602
|
+
}
|
|
22603
|
+
);
|
|
22604
|
+
const { trigger: originalTrigger } = mutationResponse;
|
|
22605
|
+
return Object.assign(
|
|
22606
|
+
mutationResponse,
|
|
22607
|
+
{
|
|
22608
|
+
trigger: (...triggerParameters) => __async(this, null, function* () {
|
|
22609
|
+
const data2 = yield originalTrigger(...triggerParameters);
|
|
22610
|
+
if (data2) {
|
|
22611
|
+
yield mutate((key) => withSWRKeyTags(key, (tags) => tags.includes(BUSINESS_TAG_KEY)));
|
|
22612
|
+
}
|
|
22613
|
+
return data2;
|
|
22614
|
+
})
|
|
22615
|
+
}
|
|
22616
|
+
);
|
|
22617
|
+
}
|
|
22618
|
+
|
|
22619
|
+
// src/components/BusinessForm/useBusinessForm.ts
|
|
22620
|
+
import { useState as useState60 } from "react";
|
|
22621
|
+
var getPerson = (personnel) => {
|
|
22622
|
+
const owners = personnel == null ? void 0 : personnel.filter((p) => p.roles.find((x) => x.role === "OWNER"));
|
|
22623
|
+
if (owners && owners.length > 0) {
|
|
22624
|
+
return owners[0];
|
|
22625
|
+
}
|
|
22626
|
+
return personnel == null ? void 0 : personnel[0];
|
|
22627
|
+
};
|
|
22628
|
+
var useBusinessForm = ({ onSuccess }) => {
|
|
22629
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
22630
|
+
const { business } = useLayerContext();
|
|
22631
|
+
const [submitError, setSubmitError] = useState60(void 0);
|
|
22632
|
+
const { data: personnel } = useBusinessPersonnel();
|
|
22633
|
+
const person = getPerson(personnel);
|
|
22634
|
+
const { trigger: createBusinessPersonnel2 } = useCreateBusinessPersonnel();
|
|
22635
|
+
const { trigger: updateBusinessPersonnel2 } = useUpdateBusinessPersonnel({ businessPersonnelId: person == null ? void 0 : person.id });
|
|
22636
|
+
const { trigger: updateBusiness2 } = useUpdateBusiness();
|
|
22637
|
+
const form = useForm2({
|
|
22638
|
+
defaultValues: {
|
|
22639
|
+
full_name: (_a = person == null ? void 0 : person.fullName) != null ? _a : void 0,
|
|
22640
|
+
preferred_name: (_b = person == null ? void 0 : person.preferredName) != null ? _b : void 0,
|
|
22641
|
+
phone_number: (_d = (_c = person == null ? void 0 : person.phoneNumbers) == null ? void 0 : _c[0]) == null ? void 0 : _d.phoneNumber,
|
|
22642
|
+
email: (_f = (_e = person == null ? void 0 : person.emailAddresses) == null ? void 0 : _e[0]) == null ? void 0 : _f.emailAddress,
|
|
22643
|
+
legal_name: (_g = business == null ? void 0 : business.legal_name) != null ? _g : void 0,
|
|
22644
|
+
entity_type: (_h = business == null ? void 0 : business.entity_type) != null ? _h : void 0,
|
|
22645
|
+
us_state: (_i = business == null ? void 0 : business.us_state) != null ? _i : void 0,
|
|
22646
|
+
tin: business == null ? void 0 : business.tin
|
|
22647
|
+
},
|
|
22648
|
+
onSubmit: (_0) => __async(void 0, [_0], function* ({ value }) {
|
|
22649
|
+
var _a2;
|
|
22650
|
+
try {
|
|
22651
|
+
setSubmitError(void 0);
|
|
22652
|
+
if (person) {
|
|
22653
|
+
yield updateBusinessPersonnel2({
|
|
22654
|
+
id: person.id,
|
|
22655
|
+
full_name: value.full_name,
|
|
22656
|
+
preferred_name: value.preferred_name,
|
|
22657
|
+
email_addresses: value.email ? [{ email_address: value.email }] : [],
|
|
22658
|
+
phone_numbers: value.phone_number ? [{ phone_number: value.phone_number }] : []
|
|
22659
|
+
});
|
|
22660
|
+
} else {
|
|
22661
|
+
if (value.full_name) {
|
|
22662
|
+
yield createBusinessPersonnel2({
|
|
22663
|
+
full_name: value.full_name,
|
|
22664
|
+
preferred_name: (_a2 = value.preferred_name) != null ? _a2 : null,
|
|
22665
|
+
email_addresses: value.email ? [{ email_address: value.email }] : [],
|
|
22666
|
+
phone_numbers: value.phone_number ? [{ phone_number: value.phone_number }] : [],
|
|
22667
|
+
external_id: null,
|
|
22668
|
+
roles: [{ role: "OWNER" }]
|
|
22669
|
+
});
|
|
22670
|
+
}
|
|
22671
|
+
}
|
|
22672
|
+
yield updateBusiness2({
|
|
22673
|
+
legal_name: value.legal_name,
|
|
22674
|
+
entity_type: value.entity_type,
|
|
22675
|
+
us_state: value.us_state,
|
|
22676
|
+
tin: value.tin
|
|
22677
|
+
});
|
|
22678
|
+
onSuccess == null ? void 0 : onSuccess();
|
|
22679
|
+
} catch (e) {
|
|
22680
|
+
setSubmitError("Something went wrong. Please try again.");
|
|
22681
|
+
}
|
|
22682
|
+
})
|
|
22683
|
+
});
|
|
22684
|
+
const isFormValid = useStore3(form.store, (state) => state.isValid);
|
|
22685
|
+
return { form, submitError, isFormValid };
|
|
22686
|
+
};
|
|
22687
|
+
|
|
22688
|
+
// src/components/Input/FormSection.tsx
|
|
22689
|
+
import { jsx as jsx238, jsxs as jsxs154 } from "react/jsx-runtime";
|
|
22690
|
+
var FormSection = ({ children, title }) => {
|
|
22691
|
+
return /* @__PURE__ */ jsxs154(VStack, { className: "Layer__form-section", gap: "sm", children: [
|
|
22692
|
+
title && /* @__PURE__ */ jsx238(
|
|
22693
|
+
Text,
|
|
22694
|
+
{
|
|
22695
|
+
className: "Layer__form-section__title",
|
|
22696
|
+
size: "sm" /* sm */,
|
|
22697
|
+
weight: "bold" /* bold */,
|
|
22698
|
+
children: title
|
|
22699
|
+
}
|
|
22700
|
+
),
|
|
22701
|
+
children
|
|
22702
|
+
] });
|
|
22703
|
+
};
|
|
22704
|
+
|
|
22705
|
+
// src/components/Input/BusinessTypeSelect.tsx
|
|
22706
|
+
import { jsx as jsx239 } from "react/jsx-runtime";
|
|
22707
|
+
var findSelectOption = (options, value) => {
|
|
22708
|
+
if (!value) {
|
|
22709
|
+
return void 0;
|
|
22710
|
+
}
|
|
22711
|
+
return options.find((o) => o.value === value);
|
|
22712
|
+
};
|
|
22713
|
+
var BusinessTypeSelect = ({ value, onChange }) => {
|
|
22714
|
+
const entityTypeOptions = ENTITY_TYPES;
|
|
22715
|
+
return /* @__PURE__ */ jsx239(
|
|
22716
|
+
Select,
|
|
22717
|
+
{
|
|
22718
|
+
options: entityTypeOptions,
|
|
22719
|
+
value: findSelectOption(entityTypeOptions, value),
|
|
22720
|
+
onChange: (option) => onChange(option == null ? void 0 : option.value)
|
|
22721
|
+
}
|
|
22722
|
+
);
|
|
22723
|
+
};
|
|
22724
|
+
|
|
22725
|
+
// src/types/location.ts
|
|
22726
|
+
var US_STATES = [
|
|
22727
|
+
{ value: "AL", label: "Alabama" },
|
|
22728
|
+
{ value: "AK", label: "Alaska" },
|
|
22729
|
+
{ value: "AZ", label: "Arizona" },
|
|
22730
|
+
{ value: "AR", label: "Arkansas" },
|
|
22731
|
+
{ value: "CA", label: "California" },
|
|
22732
|
+
{ value: "CO", label: "Colorado" },
|
|
22733
|
+
{ value: "CT", label: "Connecticut" },
|
|
22734
|
+
{ value: "DE", label: "Delaware" },
|
|
22735
|
+
{ value: "DC", label: "District of Columbia" },
|
|
22736
|
+
{ value: "FL", label: "Florida" },
|
|
22737
|
+
{ value: "GA", label: "Georgia" },
|
|
22738
|
+
{ value: "HI", label: "Hawaii" },
|
|
22739
|
+
{ value: "ID", label: "Idaho" },
|
|
22740
|
+
{ value: "IL", label: "Illinois" },
|
|
22741
|
+
{ value: "IN", label: "Indiana" },
|
|
22742
|
+
{ value: "IA", label: "Iowa" },
|
|
22743
|
+
{ value: "KS", label: "Kansas" },
|
|
22744
|
+
{ value: "KY", label: "Kentucky" },
|
|
22745
|
+
{ value: "LA", label: "Louisiana" },
|
|
22746
|
+
{ value: "ME", label: "Maine" },
|
|
22747
|
+
{ value: "MD", label: "Maryland" },
|
|
22748
|
+
{ value: "MA", label: "Massachusetts" },
|
|
22749
|
+
{ value: "MI", label: "Michigan" },
|
|
22750
|
+
{ value: "MN", label: "Minnesota" },
|
|
22751
|
+
{ value: "MS", label: "Mississippi" },
|
|
22752
|
+
{ value: "MO", label: "Missouri" },
|
|
22753
|
+
{ value: "MT", label: "Montana" },
|
|
22754
|
+
{ value: "NE", label: "Nebraska" },
|
|
22755
|
+
{ value: "NV", label: "Nevada" },
|
|
22756
|
+
{ value: "NH", label: "New Hampshire" },
|
|
22757
|
+
{ value: "NJ", label: "New Jersey" },
|
|
22758
|
+
{ value: "NM", label: "New Mexico" },
|
|
22759
|
+
{ value: "NY", label: "New York" },
|
|
22760
|
+
{ value: "NC", label: "North Carolina" },
|
|
22761
|
+
{ value: "ND", label: "North Dakota" },
|
|
22762
|
+
{ value: "OH", label: "Ohio" },
|
|
22763
|
+
{ value: "OK", label: "Oklahoma" },
|
|
22764
|
+
{ value: "OR", label: "Oregon" },
|
|
22765
|
+
{ value: "PA", label: "Pennsylvania" },
|
|
22766
|
+
{ value: "RI", label: "Rhode Island" },
|
|
22767
|
+
{ value: "SC", label: "South Carolina" },
|
|
22768
|
+
{ value: "SD", label: "South Dakota" },
|
|
22769
|
+
{ value: "TN", label: "Tennessee" },
|
|
22770
|
+
{ value: "TX", label: "Texas" },
|
|
22771
|
+
{ value: "UT", label: "Utah" },
|
|
22772
|
+
{ value: "VT", label: "Vermont" },
|
|
22773
|
+
{ value: "VA", label: "Virginia" },
|
|
22774
|
+
{ value: "WA", label: "Washington" },
|
|
22775
|
+
{ value: "WV", label: "West Virginia" },
|
|
22776
|
+
{ value: "WI", label: "Wisconsin" },
|
|
22777
|
+
{ value: "WY", label: "Wyoming" },
|
|
22778
|
+
{ value: "PR", label: "Puerto Rico" }
|
|
22779
|
+
];
|
|
22780
|
+
|
|
22781
|
+
// src/components/Input/USStateSelect.tsx
|
|
22782
|
+
import { jsx as jsx240 } from "react/jsx-runtime";
|
|
22783
|
+
var findSelectOption2 = (options, selected) => {
|
|
22784
|
+
if (!selected) {
|
|
22785
|
+
return void 0;
|
|
22786
|
+
}
|
|
22787
|
+
return options.find(
|
|
22788
|
+
(o) => String(o.value).toLowerCase() === String(selected).toLowerCase() || String(o.label).toLowerCase() === String(selected).toLowerCase()
|
|
22789
|
+
);
|
|
22790
|
+
};
|
|
22791
|
+
var USStateSelect = ({ value, onChange }) => {
|
|
22792
|
+
const usStateOptions = US_STATES.map((state) => ({
|
|
22793
|
+
label: state.label,
|
|
22794
|
+
value: state.value
|
|
22795
|
+
}));
|
|
22796
|
+
return /* @__PURE__ */ jsx240(
|
|
22797
|
+
Select,
|
|
22798
|
+
{
|
|
22799
|
+
options: usStateOptions,
|
|
22800
|
+
value: findSelectOption2(usStateOptions, value),
|
|
22801
|
+
onChange: (option) => onChange(option),
|
|
22802
|
+
placeholder: "US state"
|
|
22803
|
+
}
|
|
22804
|
+
);
|
|
22805
|
+
};
|
|
22806
|
+
|
|
22807
|
+
// src/components/Input/PhoneInput.tsx
|
|
22808
|
+
import { formatIncompletePhoneNumber } from "libphonenumber-js";
|
|
22809
|
+
import { jsx as jsx241 } from "react/jsx-runtime";
|
|
22810
|
+
var PhoneInput = (_a) => {
|
|
22811
|
+
var _b = _a, {
|
|
22812
|
+
value,
|
|
22813
|
+
onChange,
|
|
22814
|
+
placeholder = "Phone number"
|
|
22815
|
+
} = _b, props = __objRest(_b, [
|
|
22816
|
+
"value",
|
|
22817
|
+
"onChange",
|
|
22818
|
+
"placeholder"
|
|
22819
|
+
]);
|
|
22820
|
+
const handleChange = (e) => {
|
|
22821
|
+
const input = e.target.value;
|
|
22822
|
+
const formattedNumber = formatIncompletePhoneNumber(input, "US");
|
|
22823
|
+
onChange(formattedNumber != null ? formattedNumber : input);
|
|
22824
|
+
};
|
|
22825
|
+
return /* @__PURE__ */ jsx241(
|
|
22826
|
+
Input,
|
|
22827
|
+
__spreadValues({
|
|
22828
|
+
type: "tel",
|
|
22829
|
+
value: value ? formatIncompletePhoneNumber(value, "US") : void 0,
|
|
22830
|
+
onChange: handleChange,
|
|
22831
|
+
placeholder,
|
|
22832
|
+
"aria-label": "Phone number input"
|
|
22833
|
+
}, props)
|
|
22834
|
+
);
|
|
22835
|
+
};
|
|
22836
|
+
|
|
22837
|
+
// src/components/BusinessForm/BusinessForm.tsx
|
|
22838
|
+
import { isPossiblePhoneNumber } from "libphonenumber-js";
|
|
22839
|
+
import { Fragment as Fragment42, jsx as jsx242, jsxs as jsxs155 } from "react/jsx-runtime";
|
|
22840
|
+
var BusinessForm2 = ({ stringOverrides, onSuccess }) => {
|
|
22841
|
+
var _a;
|
|
22842
|
+
const { form, submitError, isFormValid } = useBusinessForm({ onSuccess });
|
|
22843
|
+
const { isSubmitting } = form.state;
|
|
22844
|
+
return /* @__PURE__ */ jsxs155(
|
|
22845
|
+
"form",
|
|
22846
|
+
{
|
|
22847
|
+
className: "Layer__form Layer__business-form",
|
|
22848
|
+
onSubmit: (e) => {
|
|
22849
|
+
e.preventDefault();
|
|
22850
|
+
e.stopPropagation();
|
|
22851
|
+
void form.handleSubmit();
|
|
22852
|
+
},
|
|
22853
|
+
children: [
|
|
22854
|
+
/* @__PURE__ */ jsxs155(FormSection, { title: "Contact information", children: [
|
|
22855
|
+
/* @__PURE__ */ jsxs155("div", { className: "Layer__business-form__name-fields", children: [
|
|
22856
|
+
/* @__PURE__ */ jsx242(
|
|
22857
|
+
form.Field,
|
|
22858
|
+
{
|
|
22859
|
+
name: "full_name",
|
|
22860
|
+
validators: {
|
|
22861
|
+
onSubmit: ({ value }) => notEmpty(value) ? void 0 : "Full name is required"
|
|
22862
|
+
},
|
|
22863
|
+
children: (field) => /* @__PURE__ */ jsx242(Fragment42, { children: /* @__PURE__ */ jsx242(InputGroup, { name: "full_name", label: "Full name", children: /* @__PURE__ */ jsx242(
|
|
22864
|
+
Input,
|
|
22865
|
+
{
|
|
22866
|
+
name: "full_name",
|
|
22867
|
+
placeholder: "John Doe",
|
|
22868
|
+
value: field.state.value,
|
|
22869
|
+
onChange: (e) => field.handleChange(e.target.value),
|
|
22870
|
+
isInvalid: field.state.meta.errors.length > 0,
|
|
22871
|
+
errorMessage: field.state.meta.errors.join(", ")
|
|
22872
|
+
}
|
|
22873
|
+
) }) })
|
|
22874
|
+
}
|
|
22875
|
+
),
|
|
22876
|
+
/* @__PURE__ */ jsx242(form.Field, { name: "preferred_name", children: (field) => /* @__PURE__ */ jsx242(Fragment42, { children: /* @__PURE__ */ jsx242(InputGroup, { name: "preferred_name", label: "Preferred name", children: /* @__PURE__ */ jsx242(
|
|
22877
|
+
Input,
|
|
22878
|
+
{
|
|
22879
|
+
name: "preferred_name",
|
|
22880
|
+
placeholder: "John",
|
|
22881
|
+
value: field.state.value,
|
|
22882
|
+
onChange: (e) => field.handleChange(e.target.value)
|
|
22883
|
+
}
|
|
22884
|
+
) }) }) })
|
|
22885
|
+
] }),
|
|
22886
|
+
/* @__PURE__ */ jsx242(
|
|
22887
|
+
form.Field,
|
|
22888
|
+
{
|
|
22889
|
+
name: "email",
|
|
22890
|
+
validators: {
|
|
22891
|
+
onSubmit: ({ value }) => validateEmailFormat(value, true) ? void 0 : "Email is invalid"
|
|
22892
|
+
},
|
|
22893
|
+
children: (field) => /* @__PURE__ */ jsx242(Fragment42, { children: /* @__PURE__ */ jsx242(
|
|
22894
|
+
InputGroup,
|
|
22895
|
+
{
|
|
22896
|
+
name: "email",
|
|
22897
|
+
label: "What\u2019s the email you want to use for bookkeeping communication?",
|
|
22898
|
+
children: /* @__PURE__ */ jsx242(
|
|
22899
|
+
Input,
|
|
22900
|
+
{
|
|
22901
|
+
name: "email",
|
|
22902
|
+
placeholder: "john@company.com",
|
|
22903
|
+
value: field.state.value,
|
|
22904
|
+
onChange: (e) => field.handleChange(e.target.value),
|
|
22905
|
+
isInvalid: field.state.meta.errors.length > 0,
|
|
22906
|
+
errorMessage: field.state.meta.errors.join(", ")
|
|
22907
|
+
}
|
|
22908
|
+
)
|
|
22909
|
+
}
|
|
22910
|
+
) })
|
|
22911
|
+
}
|
|
22912
|
+
),
|
|
22913
|
+
/* @__PURE__ */ jsx242(
|
|
22914
|
+
form.Field,
|
|
22915
|
+
{
|
|
22916
|
+
name: "phone_number",
|
|
22917
|
+
validators: {
|
|
22918
|
+
onSubmit: ({ value }) => isPossiblePhoneNumber(value != null ? value : "", "US") ? void 0 : "Phone number is invalid"
|
|
22919
|
+
},
|
|
22920
|
+
children: (field) => /* @__PURE__ */ jsx242(Fragment42, { children: /* @__PURE__ */ jsx242(
|
|
22921
|
+
InputGroup,
|
|
22922
|
+
{
|
|
22923
|
+
name: "phone_number",
|
|
22924
|
+
label: "What\u2019s the phone number you want to use for bookkeeping communication?",
|
|
22925
|
+
children: /* @__PURE__ */ jsx242(
|
|
22926
|
+
PhoneInput,
|
|
22927
|
+
{
|
|
22928
|
+
value: field.state.value,
|
|
22929
|
+
onChange: (value) => field.handleChange(value),
|
|
22930
|
+
isInvalid: field.state.meta.errors.length > 0,
|
|
22931
|
+
errorMessage: field.state.meta.errors.join(", ")
|
|
22932
|
+
}
|
|
22933
|
+
)
|
|
22934
|
+
}
|
|
22935
|
+
) })
|
|
22936
|
+
}
|
|
22937
|
+
)
|
|
22938
|
+
] }),
|
|
22939
|
+
/* @__PURE__ */ jsxs155(FormSection, { title: "Business information", children: [
|
|
22940
|
+
/* @__PURE__ */ jsx242(
|
|
22941
|
+
form.Field,
|
|
22942
|
+
{
|
|
22943
|
+
name: "legal_name",
|
|
22944
|
+
validators: {
|
|
22945
|
+
onBlur: ({ value }) => notEmpty(value) ? void 0 : "Company name is required"
|
|
22946
|
+
},
|
|
22947
|
+
children: (field) => /* @__PURE__ */ jsx242(Fragment42, { children: /* @__PURE__ */ jsx242(InputGroup, { name: "legal_name", label: "Company", children: /* @__PURE__ */ jsx242(
|
|
22948
|
+
Input,
|
|
22949
|
+
{
|
|
22950
|
+
name: "legal_name",
|
|
22951
|
+
placeholder: "Company",
|
|
22952
|
+
value: field.state.value,
|
|
22953
|
+
onChange: (e) => field.handleChange(e.target.value),
|
|
22954
|
+
isInvalid: field.state.meta.errors.length > 0,
|
|
22955
|
+
errorMessage: field.state.meta.errors.join(", ")
|
|
22956
|
+
}
|
|
22957
|
+
) }) })
|
|
22958
|
+
}
|
|
22959
|
+
),
|
|
22960
|
+
/* @__PURE__ */ jsx242(form.Field, { name: "dba", children: (field) => /* @__PURE__ */ jsx242(Fragment42, { children: /* @__PURE__ */ jsx242(InputGroup, { name: "dba", label: "DBA (optional)", children: /* @__PURE__ */ jsx242(
|
|
22961
|
+
Input,
|
|
22962
|
+
{
|
|
22963
|
+
name: "dba",
|
|
22964
|
+
placeholder: "Alternative name",
|
|
22965
|
+
value: field.state.value,
|
|
22966
|
+
onChange: (e) => field.handleChange(e.target.value),
|
|
22967
|
+
isInvalid: field.state.meta.errors.length > 0,
|
|
22968
|
+
errorMessage: field.state.meta.errors.join(", ")
|
|
22969
|
+
}
|
|
22970
|
+
) }) }) }),
|
|
22971
|
+
/* @__PURE__ */ jsx242(form.Field, { name: "entity_type", children: (field) => /* @__PURE__ */ jsx242(Fragment42, { children: /* @__PURE__ */ jsx242(InputGroup, { name: "entity_type", label: "Entity type", children: /* @__PURE__ */ jsx242(
|
|
22972
|
+
BusinessTypeSelect,
|
|
22973
|
+
{
|
|
22974
|
+
value: field.state.value,
|
|
22975
|
+
onChange: (value) => field.handleChange(value)
|
|
22976
|
+
}
|
|
22977
|
+
) }) }) }),
|
|
22978
|
+
/* @__PURE__ */ jsxs155("div", { className: "Layer__business-form__state-tin-fields", children: [
|
|
22979
|
+
/* @__PURE__ */ jsx242(form.Field, { name: "us_state", children: (field) => /* @__PURE__ */ jsx242(Fragment42, { children: /* @__PURE__ */ jsx242(InputGroup, { name: "us_state", label: "State", className: "Layer__business-form__state", children: /* @__PURE__ */ jsx242(
|
|
22980
|
+
USStateSelect,
|
|
22981
|
+
{
|
|
22982
|
+
value: field.state.value,
|
|
22983
|
+
onChange: (option) => field.handleChange(option.value)
|
|
22984
|
+
}
|
|
22985
|
+
) }) }) }),
|
|
22986
|
+
/* @__PURE__ */ jsx242(form.Field, { name: "tin", children: (field) => /* @__PURE__ */ jsx242(Fragment42, { children: /* @__PURE__ */ jsx242(InputGroup, { name: "tin", label: "Tax ID number (optional)", children: /* @__PURE__ */ jsx242(
|
|
22987
|
+
Input,
|
|
22988
|
+
{
|
|
22989
|
+
name: "tin",
|
|
22990
|
+
placeholder: "Tax ID number",
|
|
22991
|
+
value: field.state.value,
|
|
22992
|
+
onChange: (e) => field.handleChange(e.target.value),
|
|
22993
|
+
isInvalid: field.state.meta.errors.length > 0,
|
|
22994
|
+
errorMessage: field.state.meta.errors.join(", ")
|
|
22995
|
+
}
|
|
22996
|
+
) }) }) })
|
|
22997
|
+
] })
|
|
22998
|
+
] }),
|
|
22999
|
+
/* @__PURE__ */ jsx242(
|
|
23000
|
+
SubmitButton,
|
|
23001
|
+
{
|
|
23002
|
+
type: "submit",
|
|
23003
|
+
processing: isSubmitting,
|
|
23004
|
+
noIcon: true,
|
|
23005
|
+
withRetry: true,
|
|
23006
|
+
error: submitError,
|
|
23007
|
+
children: (_a = stringOverrides == null ? void 0 : stringOverrides.saveButton) != null ? _a : "Save"
|
|
23008
|
+
}
|
|
23009
|
+
),
|
|
23010
|
+
!isFormValid && /* @__PURE__ */ jsx242(ErrorText, { pb: "xs", children: "Please check all fields." })
|
|
23011
|
+
]
|
|
23012
|
+
}
|
|
23013
|
+
);
|
|
23014
|
+
};
|
|
23015
|
+
|
|
23016
|
+
// src/components/PlatformOnboarding/Steps/BusinessInfoStep.tsx
|
|
23017
|
+
import { Fragment as Fragment43, jsx as jsx243, jsxs as jsxs156 } from "react/jsx-runtime";
|
|
23018
|
+
var defaultTitle3 = "We\u2019ll use this information to contact you whenever we have questions on your books.";
|
|
23019
|
+
var BusinessInfoStep = ({ title = defaultTitle3, onNext }) => {
|
|
23020
|
+
return /* @__PURE__ */ jsxs156(Fragment43, { children: [
|
|
23021
|
+
/* @__PURE__ */ jsx243(Heading2, { children: title }),
|
|
23022
|
+
/* @__PURE__ */ jsx243(BusinessForm2, { onSuccess: onNext })
|
|
23023
|
+
] });
|
|
23024
|
+
};
|
|
23025
|
+
|
|
23026
|
+
// src/components/PlatformOnboarding/PlatformOnboarding.tsx
|
|
23027
|
+
import { jsx as jsx244, jsxs as jsxs157 } from "react/jsx-runtime";
|
|
23028
|
+
var PLATFORM_ONBOARDING_STEPS = [
|
|
23029
|
+
{
|
|
23030
|
+
id: "welcome",
|
|
23031
|
+
label: "Get started"
|
|
23032
|
+
},
|
|
23033
|
+
{
|
|
23034
|
+
id: "business-info",
|
|
23035
|
+
label: "Confirm your informations"
|
|
23036
|
+
},
|
|
23037
|
+
{
|
|
23038
|
+
id: "link-accounts",
|
|
23039
|
+
label: "Connect accounts"
|
|
23040
|
+
},
|
|
23041
|
+
{
|
|
23042
|
+
id: "summary",
|
|
23043
|
+
label: "Summary"
|
|
23044
|
+
}
|
|
23045
|
+
];
|
|
23046
|
+
var PlatformOnboarding = ({ onComplete }) => {
|
|
23047
|
+
const [step, setStep] = useState61(PLATFORM_ONBOARDING_STEPS[0].id);
|
|
23048
|
+
const isFirstStep = PLATFORM_ONBOARDING_STEPS[0].id === step;
|
|
23049
|
+
const nextStep = () => {
|
|
23050
|
+
const currentStepIndex = PLATFORM_ONBOARDING_STEPS.findIndex((s) => s.id === step);
|
|
23051
|
+
if (currentStepIndex === PLATFORM_ONBOARDING_STEPS.length - 1) {
|
|
23052
|
+
onComplete == null ? void 0 : onComplete();
|
|
23053
|
+
return;
|
|
23054
|
+
}
|
|
23055
|
+
const nextStep2 = PLATFORM_ONBOARDING_STEPS[currentStepIndex + 1];
|
|
23056
|
+
if (nextStep2) {
|
|
23057
|
+
setStep(nextStep2.id);
|
|
23058
|
+
}
|
|
23059
|
+
};
|
|
23060
|
+
const previousStep = () => {
|
|
23061
|
+
const currentStepIndex = PLATFORM_ONBOARDING_STEPS.findIndex((s) => s.id === step);
|
|
23062
|
+
const previousStep2 = PLATFORM_ONBOARDING_STEPS[currentStepIndex - 1];
|
|
23063
|
+
if (previousStep2) {
|
|
23064
|
+
setStep(previousStep2.id);
|
|
23065
|
+
}
|
|
23066
|
+
};
|
|
23067
|
+
const renderStepContent = () => {
|
|
23068
|
+
switch (step) {
|
|
23069
|
+
case "welcome":
|
|
23070
|
+
return /* @__PURE__ */ jsx244(WelcomeStep, { onNext: nextStep, stepsEnabled: PLATFORM_ONBOARDING_STEPS.map((s) => s.id) });
|
|
23071
|
+
case "business-info":
|
|
23072
|
+
return /* @__PURE__ */ jsx244(BusinessInfoStep, { onNext: nextStep });
|
|
23073
|
+
case "link-accounts":
|
|
23074
|
+
return /* @__PURE__ */ jsx244(LinkAccounts, { onComplete: nextStep });
|
|
23075
|
+
case "summary":
|
|
23076
|
+
return /* @__PURE__ */ jsx244(SummaryStep, { onNext: nextStep });
|
|
23077
|
+
}
|
|
23078
|
+
};
|
|
23079
|
+
const renderStepFooter = () => {
|
|
23080
|
+
if (step === "welcome") {
|
|
23081
|
+
return /* @__PURE__ */ jsx244(WelcomeStepFooter, {});
|
|
23082
|
+
}
|
|
23083
|
+
};
|
|
23084
|
+
return /* @__PURE__ */ jsx244("div", { className: "Layer__component Layer__platform-onboarding", children: /* @__PURE__ */ jsxs157("div", { className: "Layer__platform-onboarding-layout", children: [
|
|
23085
|
+
!isFirstStep && /* @__PURE__ */ jsx244("div", { className: "Layer__platform-onboarding__back-button-container", children: /* @__PURE__ */ jsx244(
|
|
23086
|
+
Button,
|
|
23087
|
+
{
|
|
23088
|
+
onClick: previousStep,
|
|
23089
|
+
variant: "secondary" /* secondary */,
|
|
23090
|
+
children: "Back"
|
|
23091
|
+
}
|
|
23092
|
+
) }),
|
|
23093
|
+
/* @__PURE__ */ jsxs157("div", { className: "Layer__platfom-onboarding-layout__box", children: [
|
|
23094
|
+
PLATFORM_ONBOARDING_STEPS.length > 1 && /* @__PURE__ */ jsx244(
|
|
23095
|
+
ProgressSteps,
|
|
23096
|
+
{
|
|
23097
|
+
steps: PLATFORM_ONBOARDING_STEPS.map((step2) => step2.label),
|
|
23098
|
+
currentStep: step === "summary" ? PLATFORM_ONBOARDING_STEPS.length : PLATFORM_ONBOARDING_STEPS.findIndex((s) => s.id === step)
|
|
23099
|
+
}
|
|
23100
|
+
),
|
|
23101
|
+
/* @__PURE__ */ jsx244("div", { className: "Layer__platform-onboarding-layout__content", children: renderStepContent() })
|
|
23102
|
+
] }),
|
|
23103
|
+
/* @__PURE__ */ jsx244("div", { className: "Layer__platform-onboarding-layout__footer", children: renderStepFooter() })
|
|
23104
|
+
] }) });
|
|
23105
|
+
};
|
|
23106
|
+
|
|
23107
|
+
// src/icons/Coffee.tsx
|
|
23108
|
+
import { jsx as jsx245, jsxs as jsxs158 } from "react/jsx-runtime";
|
|
23109
|
+
var CoffeeIcon = (_a) => {
|
|
23110
|
+
var _b = _a, { size = 11 } = _b, props = __objRest(_b, ["size"]);
|
|
23111
|
+
return /* @__PURE__ */ jsxs158(
|
|
23112
|
+
"svg",
|
|
23113
|
+
__spreadProps(__spreadValues({
|
|
23114
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
23115
|
+
viewBox: "0 0 12 12",
|
|
23116
|
+
fill: "none"
|
|
23117
|
+
}, props), {
|
|
23118
|
+
width: size,
|
|
23119
|
+
height: size,
|
|
23120
|
+
children: [
|
|
23121
|
+
/* @__PURE__ */ jsxs158("g", { clipPath: "url(#clip0_5018_10141)", children: [
|
|
23122
|
+
/* @__PURE__ */ jsx245(
|
|
23123
|
+
"path",
|
|
23124
|
+
{
|
|
23125
|
+
d: "M3.25 4.16666H2.79167C2.30544 4.16666 1.83912 4.35981 1.4953 4.70363C1.15149 5.04744 0.958333 5.51376 0.958333 5.99999C0.958333 6.48622 1.15149 6.95254 1.4953 7.29635C1.83912 7.64017 2.30544 7.83332 2.79167 7.83332H3.25",
|
|
23126
|
+
stroke: "currentColor",
|
|
23127
|
+
strokeLinecap: "round",
|
|
23128
|
+
strokeLinejoin: "round"
|
|
23129
|
+
}
|
|
23130
|
+
),
|
|
23131
|
+
/* @__PURE__ */ jsx245(
|
|
23132
|
+
"path",
|
|
23133
|
+
{
|
|
21957
23134
|
d: "M10.5834 4.16666H3.25004V8.29166C3.25004 8.77789 3.4432 9.2442 3.78701 9.58802C4.13083 9.93184 4.59714 10.125 5.08337 10.125H8.75004C9.23627 10.125 9.70259 9.93184 10.0464 9.58802C10.3902 9.2442 10.5834 8.77789 10.5834 8.29166V4.16666Z",
|
|
21958
23135
|
stroke: "currentColor",
|
|
21959
23136
|
strokeLinecap: "round",
|
|
21960
23137
|
strokeLinejoin: "round"
|
|
21961
23138
|
}
|
|
21962
23139
|
),
|
|
21963
|
-
/* @__PURE__ */
|
|
23140
|
+
/* @__PURE__ */ jsx245(
|
|
21964
23141
|
"path",
|
|
21965
23142
|
{
|
|
21966
23143
|
d: "M8.75 0.958344V2.33334",
|
|
@@ -21969,7 +23146,7 @@ var CoffeeIcon = (_a) => {
|
|
|
21969
23146
|
strokeLinejoin: "round"
|
|
21970
23147
|
}
|
|
21971
23148
|
),
|
|
21972
|
-
/* @__PURE__ */
|
|
23149
|
+
/* @__PURE__ */ jsx245(
|
|
21973
23150
|
"path",
|
|
21974
23151
|
{
|
|
21975
23152
|
d: "M6.91663 0.958344V2.33334",
|
|
@@ -21978,7 +23155,7 @@ var CoffeeIcon = (_a) => {
|
|
|
21978
23155
|
strokeLinejoin: "round"
|
|
21979
23156
|
}
|
|
21980
23157
|
),
|
|
21981
|
-
/* @__PURE__ */
|
|
23158
|
+
/* @__PURE__ */ jsx245(
|
|
21982
23159
|
"path",
|
|
21983
23160
|
{
|
|
21984
23161
|
d: "M5.08337 0.958344V2.33334",
|
|
@@ -21988,7 +23165,7 @@ var CoffeeIcon = (_a) => {
|
|
|
21988
23165
|
}
|
|
21989
23166
|
)
|
|
21990
23167
|
] }),
|
|
21991
|
-
/* @__PURE__ */
|
|
23168
|
+
/* @__PURE__ */ jsx245("defs", { children: /* @__PURE__ */ jsx245("clipPath", { id: "clip0_5018_10141", children: /* @__PURE__ */ jsx245(
|
|
21992
23169
|
"rect",
|
|
21993
23170
|
{
|
|
21994
23171
|
width: "11",
|
|
@@ -22004,17 +23181,17 @@ var CoffeeIcon = (_a) => {
|
|
|
22004
23181
|
var Coffee_default = CoffeeIcon;
|
|
22005
23182
|
|
|
22006
23183
|
// src/components/UpsellBanner/BookkeepingUpsellBar.tsx
|
|
22007
|
-
import { jsx as
|
|
23184
|
+
import { jsx as jsx246, jsxs as jsxs159 } from "react/jsx-runtime";
|
|
22008
23185
|
var BookkeepingUpsellBar = ({
|
|
22009
23186
|
onClick,
|
|
22010
23187
|
href
|
|
22011
23188
|
}) => {
|
|
22012
|
-
return /* @__PURE__ */
|
|
22013
|
-
/* @__PURE__ */
|
|
22014
|
-
/* @__PURE__ */
|
|
22015
|
-
/* @__PURE__ */
|
|
22016
|
-
/* @__PURE__ */
|
|
22017
|
-
/* @__PURE__ */
|
|
23189
|
+
return /* @__PURE__ */ jsxs159("div", { className: "Layer__bar-banner Layer__bar-banner--bookkeeping", children: [
|
|
23190
|
+
/* @__PURE__ */ jsxs159("div", { className: "Layer__bar-banner__left-col", children: [
|
|
23191
|
+
/* @__PURE__ */ jsx246(IconBox, { children: /* @__PURE__ */ jsx246(Coffee_default, {}) }),
|
|
23192
|
+
/* @__PURE__ */ jsxs159("div", { className: "Layer__bar-banner__text-container", children: [
|
|
23193
|
+
/* @__PURE__ */ jsx246(Text, { size: "md" /* md */, weight: "bold" /* bold */, children: "Need help with your books?" }),
|
|
23194
|
+
/* @__PURE__ */ jsx246(
|
|
22018
23195
|
Text,
|
|
22019
23196
|
{
|
|
22020
23197
|
size: "sm" /* sm */,
|
|
@@ -22024,25 +23201,25 @@ var BookkeepingUpsellBar = ({
|
|
|
22024
23201
|
)
|
|
22025
23202
|
] })
|
|
22026
23203
|
] }),
|
|
22027
|
-
onClick ? /* @__PURE__ */
|
|
23204
|
+
onClick ? /* @__PURE__ */ jsx246(Button, { variant: "secondary" /* secondary */, onClick, children: "Schedule a demo" }) : href ? /* @__PURE__ */ jsx246(Link2, { href, target: "_blank", variant: "secondary" /* secondary */, children: "Schedule a demo" }) : null
|
|
22028
23205
|
] });
|
|
22029
23206
|
};
|
|
22030
23207
|
|
|
22031
23208
|
// src/views/BookkeepingOverview/BookkeepingOverview.tsx
|
|
22032
|
-
import { useState as
|
|
23209
|
+
import { useState as useState62 } from "react";
|
|
22033
23210
|
|
|
22034
23211
|
// src/views/BookkeepingOverview/internal/BookkeepingProfitAndLossSummariesContainer.tsx
|
|
22035
|
-
import { jsx as
|
|
23212
|
+
import { jsx as jsx247 } from "react/jsx-runtime";
|
|
22036
23213
|
var CLASS_NAME10 = "Layer__BookkeepingProfitAndLossSummariesContainer";
|
|
22037
23214
|
function BookkeepingProfitAndLossSummariesContainer({
|
|
22038
23215
|
children
|
|
22039
23216
|
}) {
|
|
22040
|
-
return /* @__PURE__ */
|
|
23217
|
+
return /* @__PURE__ */ jsx247("div", { className: CLASS_NAME10, children });
|
|
22041
23218
|
}
|
|
22042
23219
|
|
|
22043
23220
|
// src/views/BookkeepingOverview/BookkeepingOverview.tsx
|
|
22044
|
-
import
|
|
22045
|
-
import { jsx as
|
|
23221
|
+
import classNames75 from "classnames";
|
|
23222
|
+
import { jsx as jsx248, jsxs as jsxs160 } from "react/jsx-runtime";
|
|
22046
23223
|
var BookkeepingOverview = ({
|
|
22047
23224
|
title,
|
|
22048
23225
|
showTitle = true,
|
|
@@ -22050,19 +23227,19 @@ var BookkeepingOverview = ({
|
|
|
22050
23227
|
slotProps
|
|
22051
23228
|
}) => {
|
|
22052
23229
|
var _a, _b, _c, _d, _e, _f;
|
|
22053
|
-
const [pnlToggle, setPnlToggle] =
|
|
23230
|
+
const [pnlToggle, setPnlToggle] = useState62("expenses");
|
|
22054
23231
|
const [width] = useWindowSize();
|
|
22055
23232
|
const profitAndLossSummariesVariants = (_b = (_a = slotProps == null ? void 0 : slotProps.profitAndLoss) == null ? void 0 : _a.summaries) == null ? void 0 : _b.variants;
|
|
22056
|
-
return /* @__PURE__ */
|
|
23233
|
+
return /* @__PURE__ */ jsx248(ProfitAndLoss, { asContainer: false, children: /* @__PURE__ */ jsx248(TasksProvider, { children: /* @__PURE__ */ jsxs160(
|
|
22057
23234
|
View,
|
|
22058
23235
|
{
|
|
22059
23236
|
viewClassName: "Layer__bookkeeping-overview--view",
|
|
22060
23237
|
title: (stringOverrides == null ? void 0 : stringOverrides.title) || title || "Bookkeeping overview",
|
|
22061
23238
|
withSidebar: width > 1100,
|
|
22062
|
-
sidebar: /* @__PURE__ */
|
|
23239
|
+
sidebar: /* @__PURE__ */ jsx248(TasksComponent, { stringOverrides: stringOverrides == null ? void 0 : stringOverrides.tasks }),
|
|
22063
23240
|
showHeader: showTitle,
|
|
22064
23241
|
children: [
|
|
22065
|
-
width <= 1100 && /* @__PURE__ */
|
|
23242
|
+
width <= 1100 && /* @__PURE__ */ jsx248(
|
|
22066
23243
|
TasksComponent,
|
|
22067
23244
|
{
|
|
22068
23245
|
collapsable: true,
|
|
@@ -22070,33 +23247,33 @@ var BookkeepingOverview = ({
|
|
|
22070
23247
|
stringOverrides: stringOverrides == null ? void 0 : stringOverrides.tasks
|
|
22071
23248
|
}
|
|
22072
23249
|
),
|
|
22073
|
-
/* @__PURE__ */
|
|
23250
|
+
/* @__PURE__ */ jsxs160(
|
|
22074
23251
|
Container,
|
|
22075
23252
|
{
|
|
22076
23253
|
name: "bookkeeping-overview-profit-and-loss",
|
|
22077
23254
|
asWidget: true,
|
|
22078
23255
|
elevated: true,
|
|
22079
23256
|
children: [
|
|
22080
|
-
/* @__PURE__ */
|
|
23257
|
+
/* @__PURE__ */ jsx248(
|
|
22081
23258
|
ProfitAndLoss.Header,
|
|
22082
23259
|
{
|
|
22083
23260
|
text: ((_c = stringOverrides == null ? void 0 : stringOverrides.profitAndLoss) == null ? void 0 : _c.header) || "Profit & Loss",
|
|
22084
23261
|
withDatePicker: true
|
|
22085
23262
|
}
|
|
22086
23263
|
),
|
|
22087
|
-
/* @__PURE__ */
|
|
23264
|
+
/* @__PURE__ */ jsx248(BookkeepingProfitAndLossSummariesContainer, { children: /* @__PURE__ */ jsx248(
|
|
22088
23265
|
ProfitAndLoss.Summaries,
|
|
22089
23266
|
{
|
|
22090
23267
|
stringOverrides: (_d = stringOverrides == null ? void 0 : stringOverrides.profitAndLoss) == null ? void 0 : _d.summaries,
|
|
22091
23268
|
variants: profitAndLossSummariesVariants
|
|
22092
23269
|
}
|
|
22093
23270
|
) }),
|
|
22094
|
-
/* @__PURE__ */
|
|
23271
|
+
/* @__PURE__ */ jsx248(ProfitAndLoss.Chart, {})
|
|
22095
23272
|
]
|
|
22096
23273
|
}
|
|
22097
23274
|
),
|
|
22098
|
-
/* @__PURE__ */
|
|
22099
|
-
/* @__PURE__ */
|
|
23275
|
+
/* @__PURE__ */ jsxs160("div", { className: "Layer__bookkeeping-overview-profit-and-loss-charts", children: [
|
|
23276
|
+
/* @__PURE__ */ jsx248(
|
|
22100
23277
|
Toggle,
|
|
22101
23278
|
{
|
|
22102
23279
|
name: "pnl-detailed-charts",
|
|
@@ -22114,14 +23291,14 @@ var BookkeepingOverview = ({
|
|
|
22114
23291
|
onChange: (e) => setPnlToggle(e.target.value)
|
|
22115
23292
|
}
|
|
22116
23293
|
),
|
|
22117
|
-
/* @__PURE__ */
|
|
23294
|
+
/* @__PURE__ */ jsx248(
|
|
22118
23295
|
Container,
|
|
22119
23296
|
{
|
|
22120
|
-
name:
|
|
23297
|
+
name: classNames75(
|
|
22121
23298
|
"bookkeeping-overview-profit-and-loss-chart",
|
|
22122
23299
|
pnlToggle !== "revenue" && "bookkeeping-overview-profit-and-loss-chart--hidden"
|
|
22123
23300
|
),
|
|
22124
|
-
children: /* @__PURE__ */
|
|
23301
|
+
children: /* @__PURE__ */ jsx248(
|
|
22125
23302
|
ProfitAndLoss.DetailedCharts,
|
|
22126
23303
|
{
|
|
22127
23304
|
scope: "revenue",
|
|
@@ -22131,14 +23308,14 @@ var BookkeepingOverview = ({
|
|
|
22131
23308
|
)
|
|
22132
23309
|
}
|
|
22133
23310
|
),
|
|
22134
|
-
/* @__PURE__ */
|
|
23311
|
+
/* @__PURE__ */ jsx248(
|
|
22135
23312
|
Container,
|
|
22136
23313
|
{
|
|
22137
|
-
name:
|
|
23314
|
+
name: classNames75(
|
|
22138
23315
|
"bookkeeping-overview-profit-and-loss-chart",
|
|
22139
23316
|
pnlToggle !== "expenses" && "bookkeeping-overview-profit-and-loss-chart--hidden"
|
|
22140
23317
|
),
|
|
22141
|
-
children: /* @__PURE__ */
|
|
23318
|
+
children: /* @__PURE__ */ jsx248(
|
|
22142
23319
|
ProfitAndLoss.DetailedCharts,
|
|
22143
23320
|
{
|
|
22144
23321
|
scope: "expenses",
|
|
@@ -22155,23 +23332,23 @@ var BookkeepingOverview = ({
|
|
|
22155
23332
|
};
|
|
22156
23333
|
|
|
22157
23334
|
// src/views/AccountingOverview/AccountingOverview.tsx
|
|
22158
|
-
import { useState as
|
|
23335
|
+
import { useState as useState64 } from "react";
|
|
22159
23336
|
|
|
22160
23337
|
// src/views/AccountingOverview/internal/TransactionsToReview.tsx
|
|
22161
|
-
import { useContext as useContext54, useEffect as useEffect43, useState as
|
|
23338
|
+
import { useContext as useContext54, useEffect as useEffect43, useState as useState63 } from "react";
|
|
22162
23339
|
|
|
22163
23340
|
// src/components/BadgeLoader/BadgeLoader.tsx
|
|
22164
|
-
import { jsx as
|
|
23341
|
+
import { jsx as jsx249, jsxs as jsxs161 } from "react/jsx-runtime";
|
|
22165
23342
|
var BadgeLoader = ({ children }) => {
|
|
22166
|
-
return /* @__PURE__ */
|
|
22167
|
-
/* @__PURE__ */
|
|
23343
|
+
return /* @__PURE__ */ jsxs161("span", { className: "Layer__loader Layer__loader--as-badge", children: [
|
|
23344
|
+
/* @__PURE__ */ jsx249(Loader_default, { size: 11, className: "Layer__anim--rotating" }),
|
|
22168
23345
|
children
|
|
22169
23346
|
] });
|
|
22170
23347
|
};
|
|
22171
23348
|
|
|
22172
23349
|
// src/views/AccountingOverview/internal/TransactionsToReview.tsx
|
|
22173
|
-
import { getMonth as getMonth4, getYear as
|
|
22174
|
-
import { jsx as
|
|
23350
|
+
import { getMonth as getMonth4, getYear as getYear7, startOfMonth as startOfMonth19 } from "date-fns";
|
|
23351
|
+
import { jsx as jsx250, jsxs as jsxs162 } from "react/jsx-runtime";
|
|
22175
23352
|
var CLASS_NAME11 = "Layer__TransactionsToReview";
|
|
22176
23353
|
function TransactionsToReview({
|
|
22177
23354
|
onClick,
|
|
@@ -22182,7 +23359,7 @@ function TransactionsToReview({
|
|
|
22182
23359
|
const { size = "sm" } = variants != null ? variants : {};
|
|
22183
23360
|
const { dateRange: contextDateRange } = useContext54(ProfitAndLoss.Context);
|
|
22184
23361
|
const dateRange = usePnlDateRange ? contextDateRange : void 0;
|
|
22185
|
-
const [toReview, setToReview] =
|
|
23362
|
+
const [toReview, setToReview] = useState63(0);
|
|
22186
23363
|
const { data, loaded, error, refetch } = useProfitAndLossLTM({
|
|
22187
23364
|
currentDate: dateRange ? dateRange.startDate : startOfMonth19(/* @__PURE__ */ new Date()),
|
|
22188
23365
|
tagFilter
|
|
@@ -22196,7 +23373,7 @@ function TransactionsToReview({
|
|
|
22196
23373
|
const checkTransactionsToReview = () => {
|
|
22197
23374
|
if (data && dateRange) {
|
|
22198
23375
|
const monthTx = data.filter(
|
|
22199
|
-
(x) => x.month - 1 === getMonth4(dateRange.startDate) && x.year ===
|
|
23376
|
+
(x) => x.month - 1 === getMonth4(dateRange.startDate) && x.year === getYear7(dateRange.startDate)
|
|
22200
23377
|
);
|
|
22201
23378
|
if (monthTx.length > 0) {
|
|
22202
23379
|
setToReview(monthTx[0].uncategorized_transactions);
|
|
@@ -22212,26 +23389,26 @@ function TransactionsToReview({
|
|
|
22212
23389
|
verticalGap = "sm";
|
|
22213
23390
|
break;
|
|
22214
23391
|
}
|
|
22215
|
-
return /* @__PURE__ */
|
|
22216
|
-
/* @__PURE__ */
|
|
22217
|
-
/* @__PURE__ */
|
|
22218
|
-
loaded === "initial" || loaded === "loading" ? /* @__PURE__ */
|
|
22219
|
-
loaded === "complete" && error ? /* @__PURE__ */
|
|
23392
|
+
return /* @__PURE__ */ jsxs162("div", { onClick, className: CLASS_NAME11, children: [
|
|
23393
|
+
/* @__PURE__ */ jsxs162(VStack, { gap: verticalGap, align: "start", children: [
|
|
23394
|
+
/* @__PURE__ */ jsx250(ProfitAndLossSummariesHeading, { variants, children: "Transactions to review" }),
|
|
23395
|
+
loaded === "initial" || loaded === "loading" ? /* @__PURE__ */ jsx250(BadgeLoader, {}) : null,
|
|
23396
|
+
loaded === "complete" && error ? /* @__PURE__ */ jsx250(
|
|
22220
23397
|
Badge,
|
|
22221
23398
|
{
|
|
22222
23399
|
variant: "error" /* ERROR */,
|
|
22223
23400
|
size: "small" /* SMALL */,
|
|
22224
|
-
icon: /* @__PURE__ */
|
|
23401
|
+
icon: /* @__PURE__ */ jsx250(RefreshCcw_default, { size: 12 }),
|
|
22225
23402
|
onClick: () => refetch(),
|
|
22226
23403
|
children: "Refresh"
|
|
22227
23404
|
}
|
|
22228
23405
|
) : null,
|
|
22229
|
-
loaded === "complete" && !error && toReview > 0 ? /* @__PURE__ */
|
|
23406
|
+
loaded === "complete" && !error && toReview > 0 ? /* @__PURE__ */ jsxs162(
|
|
22230
23407
|
Badge,
|
|
22231
23408
|
{
|
|
22232
23409
|
variant: "warning" /* WARNING */,
|
|
22233
23410
|
size: "small" /* SMALL */,
|
|
22234
|
-
icon: /* @__PURE__ */
|
|
23411
|
+
icon: /* @__PURE__ */ jsx250(Bell_default, { size: 12 }),
|
|
22235
23412
|
children: [
|
|
22236
23413
|
toReview,
|
|
22237
23414
|
" ",
|
|
@@ -22239,23 +23416,23 @@ function TransactionsToReview({
|
|
|
22239
23416
|
]
|
|
22240
23417
|
}
|
|
22241
23418
|
) : null,
|
|
22242
|
-
loaded === "complete" && !error && toReview === 0 ? /* @__PURE__ */
|
|
23419
|
+
loaded === "complete" && !error && toReview === 0 ? /* @__PURE__ */ jsx250(
|
|
22243
23420
|
Badge,
|
|
22244
23421
|
{
|
|
22245
23422
|
variant: "success" /* SUCCESS */,
|
|
22246
23423
|
size: "small" /* SMALL */,
|
|
22247
|
-
icon: /* @__PURE__ */
|
|
23424
|
+
icon: /* @__PURE__ */ jsx250(Check_default, { size: 12 }),
|
|
22248
23425
|
children: "All done"
|
|
22249
23426
|
}
|
|
22250
23427
|
) : null
|
|
22251
23428
|
] }),
|
|
22252
|
-
/* @__PURE__ */
|
|
23429
|
+
/* @__PURE__ */ jsx250(IconButton, { icon: /* @__PURE__ */ jsx250(ChevronRight_default, {}), withBorder: true, onClick })
|
|
22253
23430
|
] });
|
|
22254
23431
|
}
|
|
22255
23432
|
|
|
22256
23433
|
// src/views/AccountingOverview/AccountingOverview.tsx
|
|
22257
|
-
import
|
|
22258
|
-
import { jsx as
|
|
23434
|
+
import classNames76 from "classnames";
|
|
23435
|
+
import { jsx as jsx251, jsxs as jsxs163 } from "react/jsx-runtime";
|
|
22259
23436
|
var AccountingOverview = ({
|
|
22260
23437
|
title = "Accounting overview",
|
|
22261
23438
|
showTitle = true,
|
|
@@ -22270,35 +23447,35 @@ var AccountingOverview = ({
|
|
|
22270
23447
|
slotProps
|
|
22271
23448
|
}) => {
|
|
22272
23449
|
var _a, _b, _c, _d, _e;
|
|
22273
|
-
const [pnlToggle, setPnlToggle] =
|
|
23450
|
+
const [pnlToggle, setPnlToggle] = useState64("expenses");
|
|
22274
23451
|
const profitAndLossSummariesVariants = (_b = (_a = slotProps == null ? void 0 : slotProps.profitAndLoss) == null ? void 0 : _a.summaries) == null ? void 0 : _b.variants;
|
|
22275
|
-
return /* @__PURE__ */
|
|
23452
|
+
return /* @__PURE__ */ jsx251(
|
|
22276
23453
|
ProfitAndLoss,
|
|
22277
23454
|
{
|
|
22278
23455
|
asContainer: false,
|
|
22279
23456
|
tagFilter: tagFilter ? { key: tagFilter.tagKey, values: tagFilter.tagValues } : void 0,
|
|
22280
|
-
children: /* @__PURE__ */
|
|
23457
|
+
children: /* @__PURE__ */ jsxs163(
|
|
22281
23458
|
View,
|
|
22282
23459
|
{
|
|
22283
23460
|
title,
|
|
22284
23461
|
showHeader: showTitle,
|
|
22285
|
-
header: /* @__PURE__ */
|
|
23462
|
+
header: /* @__PURE__ */ jsx251(Header2, { children: /* @__PURE__ */ jsx251(HeaderRow, { children: /* @__PURE__ */ jsx251(HeaderCol, { children: /* @__PURE__ */ jsx251(ProfitAndLoss.DatePicker, {}) }) }) }),
|
|
22286
23463
|
children: [
|
|
22287
|
-
enableOnboarding && /* @__PURE__ */
|
|
23464
|
+
enableOnboarding && /* @__PURE__ */ jsx251(
|
|
22288
23465
|
Onboarding,
|
|
22289
23466
|
{
|
|
22290
23467
|
onTransactionsToReviewClick,
|
|
22291
23468
|
onboardingStepOverride
|
|
22292
23469
|
}
|
|
22293
23470
|
),
|
|
22294
|
-
/* @__PURE__ */
|
|
23471
|
+
/* @__PURE__ */ jsx251(
|
|
22295
23472
|
Internal_ProfitAndLossSummaries,
|
|
22296
23473
|
{
|
|
22297
23474
|
stringOverrides: (_c = stringOverrides == null ? void 0 : stringOverrides.profitAndLoss) == null ? void 0 : _c.summaries,
|
|
22298
23475
|
chartColorsList,
|
|
22299
23476
|
slots: {
|
|
22300
23477
|
unstable_AdditionalListItems: showTransactionsToReview ? [
|
|
22301
|
-
/* @__PURE__ */
|
|
23478
|
+
/* @__PURE__ */ jsx251(
|
|
22302
23479
|
TransactionsToReview,
|
|
22303
23480
|
{
|
|
22304
23481
|
usePnlDateRange: true,
|
|
@@ -22312,20 +23489,20 @@ var AccountingOverview = ({
|
|
|
22312
23489
|
variants: profitAndLossSummariesVariants
|
|
22313
23490
|
}
|
|
22314
23491
|
),
|
|
22315
|
-
/* @__PURE__ */
|
|
23492
|
+
/* @__PURE__ */ jsxs163(
|
|
22316
23493
|
Container,
|
|
22317
23494
|
{
|
|
22318
23495
|
name: "accounting-overview-profit-and-loss",
|
|
22319
23496
|
asWidget: true,
|
|
22320
23497
|
elevated: true,
|
|
22321
23498
|
children: [
|
|
22322
|
-
/* @__PURE__ */
|
|
23499
|
+
/* @__PURE__ */ jsx251(
|
|
22323
23500
|
ProfitAndLoss.Header,
|
|
22324
23501
|
{
|
|
22325
23502
|
text: (stringOverrides == null ? void 0 : stringOverrides.header) || "Profit & Loss"
|
|
22326
23503
|
}
|
|
22327
23504
|
),
|
|
22328
|
-
/* @__PURE__ */
|
|
23505
|
+
/* @__PURE__ */ jsx251(
|
|
22329
23506
|
ProfitAndLoss.Chart,
|
|
22330
23507
|
{
|
|
22331
23508
|
tagFilter: tagFilter ? { key: tagFilter.tagKey, values: tagFilter.tagValues } : void 0
|
|
@@ -22334,9 +23511,9 @@ var AccountingOverview = ({
|
|
|
22334
23511
|
]
|
|
22335
23512
|
}
|
|
22336
23513
|
),
|
|
22337
|
-
middleBanner && /* @__PURE__ */
|
|
22338
|
-
/* @__PURE__ */
|
|
22339
|
-
/* @__PURE__ */
|
|
23514
|
+
middleBanner && /* @__PURE__ */ jsx251(Container, { name: "accounting-overview-middle-banner", children: middleBanner }),
|
|
23515
|
+
/* @__PURE__ */ jsxs163("div", { className: "Layer__accounting-overview-profit-and-loss-charts", children: [
|
|
23516
|
+
/* @__PURE__ */ jsx251(
|
|
22340
23517
|
Toggle,
|
|
22341
23518
|
{
|
|
22342
23519
|
name: "pnl-detailed-charts",
|
|
@@ -22354,14 +23531,14 @@ var AccountingOverview = ({
|
|
|
22354
23531
|
onChange: (e) => setPnlToggle(e.target.value)
|
|
22355
23532
|
}
|
|
22356
23533
|
),
|
|
22357
|
-
/* @__PURE__ */
|
|
23534
|
+
/* @__PURE__ */ jsx251(
|
|
22358
23535
|
Container,
|
|
22359
23536
|
{
|
|
22360
|
-
name:
|
|
23537
|
+
name: classNames76(
|
|
22361
23538
|
"accounting-overview-profit-and-loss-chart",
|
|
22362
23539
|
pnlToggle !== "revenue" && "accounting-overview-profit-and-loss-chart--hidden"
|
|
22363
23540
|
),
|
|
22364
|
-
children: /* @__PURE__ */
|
|
23541
|
+
children: /* @__PURE__ */ jsx251(
|
|
22365
23542
|
ProfitAndLoss.DetailedCharts,
|
|
22366
23543
|
{
|
|
22367
23544
|
scope: "revenue",
|
|
@@ -22372,14 +23549,14 @@ var AccountingOverview = ({
|
|
|
22372
23549
|
)
|
|
22373
23550
|
}
|
|
22374
23551
|
),
|
|
22375
|
-
/* @__PURE__ */
|
|
23552
|
+
/* @__PURE__ */ jsx251(
|
|
22376
23553
|
Container,
|
|
22377
23554
|
{
|
|
22378
|
-
name:
|
|
23555
|
+
name: classNames76(
|
|
22379
23556
|
"accounting-overview-profit-and-loss-chart",
|
|
22380
23557
|
pnlToggle !== "expenses" && "accounting-overview-profit-and-loss-chart--hidden"
|
|
22381
23558
|
),
|
|
22382
|
-
children: /* @__PURE__ */
|
|
23559
|
+
children: /* @__PURE__ */ jsx251(
|
|
22383
23560
|
ProfitAndLoss.DetailedCharts,
|
|
22384
23561
|
{
|
|
22385
23562
|
scope: "expenses",
|
|
@@ -22399,7 +23576,7 @@ var AccountingOverview = ({
|
|
|
22399
23576
|
};
|
|
22400
23577
|
|
|
22401
23578
|
// src/views/BankTransactionsWithLinkedAccounts/BankTransactionsWithLinkedAccounts.tsx
|
|
22402
|
-
import { jsx as
|
|
23579
|
+
import { jsx as jsx252, jsxs as jsxs164 } from "react/jsx-runtime";
|
|
22403
23580
|
var BankTransactionsWithLinkedAccounts = ({
|
|
22404
23581
|
title,
|
|
22405
23582
|
// deprecated
|
|
@@ -22415,13 +23592,13 @@ var BankTransactionsWithLinkedAccounts = ({
|
|
|
22415
23592
|
mobileComponent,
|
|
22416
23593
|
stringOverrides
|
|
22417
23594
|
}) => {
|
|
22418
|
-
return /* @__PURE__ */
|
|
23595
|
+
return /* @__PURE__ */ jsxs164(
|
|
22419
23596
|
View,
|
|
22420
23597
|
{
|
|
22421
23598
|
title: (stringOverrides == null ? void 0 : stringOverrides.title) || title || "Bank transactions",
|
|
22422
23599
|
showHeader: showTitle,
|
|
22423
23600
|
children: [
|
|
22424
|
-
/* @__PURE__ */
|
|
23601
|
+
/* @__PURE__ */ jsx252(
|
|
22425
23602
|
LinkedAccounts,
|
|
22426
23603
|
{
|
|
22427
23604
|
elevated: elevatedLinkedAccounts,
|
|
@@ -22431,7 +23608,7 @@ var BankTransactionsWithLinkedAccounts = ({
|
|
|
22431
23608
|
stringOverrides: stringOverrides == null ? void 0 : stringOverrides.linkedAccounts
|
|
22432
23609
|
}
|
|
22433
23610
|
),
|
|
22434
|
-
/* @__PURE__ */
|
|
23611
|
+
/* @__PURE__ */ jsx252(
|
|
22435
23612
|
BankTransactions,
|
|
22436
23613
|
{
|
|
22437
23614
|
asWidget: true,
|
|
@@ -22449,8 +23626,8 @@ var BankTransactionsWithLinkedAccounts = ({
|
|
|
22449
23626
|
};
|
|
22450
23627
|
|
|
22451
23628
|
// src/views/GeneralLedger/GeneralLedger.tsx
|
|
22452
|
-
import { useState as
|
|
22453
|
-
import { jsx as
|
|
23629
|
+
import { useState as useState65 } from "react";
|
|
23630
|
+
import { jsx as jsx253, jsxs as jsxs165 } from "react/jsx-runtime";
|
|
22454
23631
|
var GeneralLedgerView = ({
|
|
22455
23632
|
title,
|
|
22456
23633
|
// deprecated
|
|
@@ -22458,14 +23635,14 @@ var GeneralLedgerView = ({
|
|
|
22458
23635
|
stringOverrides,
|
|
22459
23636
|
chartOfAccountsOptions
|
|
22460
23637
|
}) => {
|
|
22461
|
-
const [activeTab, setActiveTab] =
|
|
22462
|
-
return /* @__PURE__ */
|
|
23638
|
+
const [activeTab, setActiveTab] = useState65("chartOfAccounts");
|
|
23639
|
+
return /* @__PURE__ */ jsx253(ProfitAndLoss, { asContainer: false, children: /* @__PURE__ */ jsxs165(
|
|
22463
23640
|
View,
|
|
22464
23641
|
{
|
|
22465
23642
|
title: (stringOverrides == null ? void 0 : stringOverrides.title) || title || "General Ledger",
|
|
22466
23643
|
showHeader: showTitle,
|
|
22467
23644
|
children: [
|
|
22468
|
-
/* @__PURE__ */
|
|
23645
|
+
/* @__PURE__ */ jsx253(
|
|
22469
23646
|
Toggle,
|
|
22470
23647
|
{
|
|
22471
23648
|
name: "general-ledger-tabs",
|
|
@@ -22483,7 +23660,7 @@ var GeneralLedgerView = ({
|
|
|
22483
23660
|
onChange: (opt) => setActiveTab(opt.target.value)
|
|
22484
23661
|
}
|
|
22485
23662
|
),
|
|
22486
|
-
activeTab === "chartOfAccounts" ? /* @__PURE__ */
|
|
23663
|
+
activeTab === "chartOfAccounts" ? /* @__PURE__ */ jsx253(
|
|
22487
23664
|
ChartOfAccounts,
|
|
22488
23665
|
{
|
|
22489
23666
|
asWidget: true,
|
|
@@ -22493,16 +23670,16 @@ var GeneralLedgerView = ({
|
|
|
22493
23670
|
templateAccountsEditable: chartOfAccountsOptions == null ? void 0 : chartOfAccountsOptions.templateAccountsEditable,
|
|
22494
23671
|
showReversalEntries: chartOfAccountsOptions == null ? void 0 : chartOfAccountsOptions.showReversalEntries
|
|
22495
23672
|
}
|
|
22496
|
-
) : /* @__PURE__ */
|
|
23673
|
+
) : /* @__PURE__ */ jsx253(Journal, { stringOverrides: stringOverrides == null ? void 0 : stringOverrides.journal })
|
|
22497
23674
|
]
|
|
22498
23675
|
}
|
|
22499
23676
|
) });
|
|
22500
23677
|
};
|
|
22501
23678
|
|
|
22502
23679
|
// src/views/ProjectProfitability/ProjectProfitability.tsx
|
|
22503
|
-
import { useState as
|
|
23680
|
+
import { useState as useState66 } from "react";
|
|
22504
23681
|
import Select4 from "react-select";
|
|
22505
|
-
import { Fragment as
|
|
23682
|
+
import { Fragment as Fragment44, jsx as jsx254, jsxs as jsxs166 } from "react/jsx-runtime";
|
|
22506
23683
|
var ProjectProfitabilityView = ({
|
|
22507
23684
|
valueOptions,
|
|
22508
23685
|
showTitle,
|
|
@@ -22510,9 +23687,9 @@ var ProjectProfitabilityView = ({
|
|
|
22510
23687
|
datePickerMode = "monthPicker",
|
|
22511
23688
|
csvMoneyFormat = "DOLLAR_STRING"
|
|
22512
23689
|
}) => {
|
|
22513
|
-
const [activeTab, setActiveTab] =
|
|
22514
|
-
const [tagFilter, setTagFilter] =
|
|
22515
|
-
const [pnlTagFilter, setPnlTagFilter] =
|
|
23690
|
+
const [activeTab, setActiveTab] = useState66("overview");
|
|
23691
|
+
const [tagFilter, setTagFilter] = useState66(null);
|
|
23692
|
+
const [pnlTagFilter, setPnlTagFilter] = useState66(
|
|
22516
23693
|
void 0
|
|
22517
23694
|
);
|
|
22518
23695
|
const isOptionSelected = (option, selectValue) => {
|
|
@@ -22526,15 +23703,15 @@ var ProjectProfitabilityView = ({
|
|
|
22526
23703
|
values: tagFilter2.tagValues
|
|
22527
23704
|
} : void 0;
|
|
22528
23705
|
};
|
|
22529
|
-
return /* @__PURE__ */
|
|
23706
|
+
return /* @__PURE__ */ jsxs166(
|
|
22530
23707
|
View,
|
|
22531
23708
|
{
|
|
22532
23709
|
title: (stringOverrides == null ? void 0 : stringOverrides.title) || "",
|
|
22533
23710
|
showHeader: showTitle,
|
|
22534
23711
|
viewClassName: "Layer__project-view",
|
|
22535
23712
|
children: [
|
|
22536
|
-
/* @__PURE__ */
|
|
22537
|
-
/* @__PURE__ */
|
|
23713
|
+
/* @__PURE__ */ jsxs166("div", { className: "Layer__component Layer__header__actions", children: [
|
|
23714
|
+
/* @__PURE__ */ jsx254("div", { className: "Layer__component", children: /* @__PURE__ */ jsx254(
|
|
22538
23715
|
Toggle,
|
|
22539
23716
|
{
|
|
22540
23717
|
name: "project-tabs",
|
|
@@ -22556,7 +23733,7 @@ var ProjectProfitabilityView = ({
|
|
|
22556
23733
|
onChange: (opt) => setActiveTab(opt.target.value)
|
|
22557
23734
|
}
|
|
22558
23735
|
) }),
|
|
22559
|
-
/* @__PURE__ */
|
|
23736
|
+
/* @__PURE__ */ jsx254(
|
|
22560
23737
|
Select4,
|
|
22561
23738
|
{
|
|
22562
23739
|
className: "Layer__category-menu Layer__select",
|
|
@@ -22575,8 +23752,8 @@ var ProjectProfitabilityView = ({
|
|
|
22575
23752
|
}
|
|
22576
23753
|
)
|
|
22577
23754
|
] }),
|
|
22578
|
-
/* @__PURE__ */
|
|
22579
|
-
activeTab === "overview" && /* @__PURE__ */
|
|
23755
|
+
/* @__PURE__ */ jsx254(Container, { name: "project", children: /* @__PURE__ */ jsxs166(Fragment44, { children: [
|
|
23756
|
+
activeTab === "overview" && /* @__PURE__ */ jsx254(
|
|
22580
23757
|
AccountingOverview,
|
|
22581
23758
|
{
|
|
22582
23759
|
stringOverrides: { header: "Project Overview" },
|
|
@@ -22587,7 +23764,7 @@ var ProjectProfitabilityView = ({
|
|
|
22587
23764
|
showTitle: false
|
|
22588
23765
|
}
|
|
22589
23766
|
),
|
|
22590
|
-
activeTab === "transactions" && /* @__PURE__ */
|
|
23767
|
+
activeTab === "transactions" && /* @__PURE__ */ jsx254(
|
|
22591
23768
|
BankTransactions,
|
|
22592
23769
|
{
|
|
22593
23770
|
hideHeader: true,
|
|
@@ -22597,7 +23774,7 @@ var ProjectProfitabilityView = ({
|
|
|
22597
23774
|
}
|
|
22598
23775
|
}
|
|
22599
23776
|
),
|
|
22600
|
-
activeTab === "report" && /* @__PURE__ */
|
|
23777
|
+
activeTab === "report" && /* @__PURE__ */ jsx254(ProfitAndLoss, { asContainer: false, tagFilter: pnlTagFilter, children: /* @__PURE__ */ jsx254(
|
|
22601
23778
|
ProfitAndLoss.Report,
|
|
22602
23779
|
{
|
|
22603
23780
|
stringOverrides,
|
|
@@ -22612,8 +23789,8 @@ var ProjectProfitabilityView = ({
|
|
|
22612
23789
|
};
|
|
22613
23790
|
|
|
22614
23791
|
// src/views/Reports/Reports.tsx
|
|
22615
|
-
import { useState as
|
|
22616
|
-
import { Fragment as
|
|
23792
|
+
import { useState as useState67 } from "react";
|
|
23793
|
+
import { Fragment as Fragment45, jsx as jsx255, jsxs as jsxs167 } from "react/jsx-runtime";
|
|
22617
23794
|
var getOptions = (enabledReports) => {
|
|
22618
23795
|
return [
|
|
22619
23796
|
enabledReports.includes("profitAndLoss") ? {
|
|
@@ -22640,17 +23817,17 @@ var Reports = ({
|
|
|
22640
23817
|
statementOfCashFlowConfig
|
|
22641
23818
|
}) => {
|
|
22642
23819
|
var _a;
|
|
22643
|
-
const [activeTab, setActiveTab] =
|
|
23820
|
+
const [activeTab, setActiveTab] = useState67(enabledReports[0]);
|
|
22644
23821
|
const { view, containerRef } = useElementViewSize();
|
|
22645
23822
|
const options = getOptions(enabledReports);
|
|
22646
|
-
const
|
|
22647
|
-
return /* @__PURE__ */
|
|
23823
|
+
const defaultTitle4 = enabledReports.length > 1 ? "Reports" : (_a = options.find((option) => option.value = enabledReports[0])) == null ? void 0 : _a.label;
|
|
23824
|
+
return /* @__PURE__ */ jsxs167(
|
|
22648
23825
|
View,
|
|
22649
23826
|
{
|
|
22650
|
-
title: (stringOverrides == null ? void 0 : stringOverrides.title) || title ||
|
|
23827
|
+
title: (stringOverrides == null ? void 0 : stringOverrides.title) || title || defaultTitle4,
|
|
22651
23828
|
showHeader: showTitle,
|
|
22652
23829
|
children: [
|
|
22653
|
-
enabledReports.length > 1 && /* @__PURE__ */
|
|
23830
|
+
enabledReports.length > 1 && /* @__PURE__ */ jsx255("div", { className: "Layer__component Layer__header__actions", children: /* @__PURE__ */ jsx255(
|
|
22654
23831
|
Toggle,
|
|
22655
23832
|
{
|
|
22656
23833
|
name: "reports-tabs",
|
|
@@ -22659,7 +23836,7 @@ var Reports = ({
|
|
|
22659
23836
|
onChange: (opt) => setActiveTab(opt.target.value)
|
|
22660
23837
|
}
|
|
22661
23838
|
) }),
|
|
22662
|
-
/* @__PURE__ */
|
|
23839
|
+
/* @__PURE__ */ jsx255(Container, { name: "reports", ref: containerRef, children: /* @__PURE__ */ jsx255(ProfitAndLoss, { asContainer: false, comparisonConfig, children: /* @__PURE__ */ jsx255(
|
|
22663
23840
|
ReportsPanel,
|
|
22664
23841
|
{
|
|
22665
23842
|
containerRef,
|
|
@@ -22682,8 +23859,8 @@ var ReportsPanel = ({
|
|
|
22682
23859
|
statementOfCashFlowConfig,
|
|
22683
23860
|
view
|
|
22684
23861
|
}) => {
|
|
22685
|
-
return /* @__PURE__ */
|
|
22686
|
-
openReport === "profitAndLoss" && /* @__PURE__ */
|
|
23862
|
+
return /* @__PURE__ */ jsxs167(Fragment45, { children: [
|
|
23863
|
+
openReport === "profitAndLoss" && /* @__PURE__ */ jsx255(
|
|
22687
23864
|
ProfitAndLoss.Report,
|
|
22688
23865
|
__spreadValues({
|
|
22689
23866
|
stringOverrides,
|
|
@@ -22691,8 +23868,8 @@ var ReportsPanel = ({
|
|
|
22691
23868
|
view
|
|
22692
23869
|
}, profitAndLossConfig)
|
|
22693
23870
|
),
|
|
22694
|
-
openReport === "balanceSheet" && /* @__PURE__ */
|
|
22695
|
-
openReport === "statementOfCashFlow" && /* @__PURE__ */
|
|
23871
|
+
openReport === "balanceSheet" && /* @__PURE__ */ jsx255(BalanceSheet, { stringOverrides: stringOverrides == null ? void 0 : stringOverrides.balanceSheet }),
|
|
23872
|
+
openReport === "statementOfCashFlow" && /* @__PURE__ */ jsx255(
|
|
22696
23873
|
StatementOfCashFlow,
|
|
22697
23874
|
__spreadValues({
|
|
22698
23875
|
stringOverrides: stringOverrides == null ? void 0 : stringOverrides.statementOfCashflow
|
|
@@ -22703,11 +23880,11 @@ var ReportsPanel = ({
|
|
|
22703
23880
|
|
|
22704
23881
|
// src/components/ProfitAndLossView/ProfitAndLossView.tsx
|
|
22705
23882
|
import { useContext as useContext55, useRef as useRef22 } from "react";
|
|
22706
|
-
import { Fragment as
|
|
23883
|
+
import { Fragment as Fragment46, jsx as jsx256, jsxs as jsxs168 } from "react/jsx-runtime";
|
|
22707
23884
|
var COMPONENT_NAME7 = "profit-and-loss";
|
|
22708
23885
|
var ProfitAndLossView = (props) => {
|
|
22709
23886
|
const containerRef = useRef22(null);
|
|
22710
|
-
return /* @__PURE__ */
|
|
23887
|
+
return /* @__PURE__ */ jsx256(Container, { name: COMPONENT_NAME7, ref: containerRef, children: /* @__PURE__ */ jsx256(ProfitAndLoss, { children: /* @__PURE__ */ jsx256(ProfitAndLossPanel, __spreadValues({ containerRef }, props)) }) });
|
|
22711
23888
|
};
|
|
22712
23889
|
var ProfitAndLossPanel = (_a) => {
|
|
22713
23890
|
var _b = _a, {
|
|
@@ -22718,10 +23895,10 @@ var ProfitAndLossPanel = (_a) => {
|
|
|
22718
23895
|
"stringOverrides"
|
|
22719
23896
|
]);
|
|
22720
23897
|
const { sidebarScope } = useContext55(ProfitAndLoss.Context);
|
|
22721
|
-
return /* @__PURE__ */
|
|
23898
|
+
return /* @__PURE__ */ jsxs168(
|
|
22722
23899
|
Panel,
|
|
22723
23900
|
{
|
|
22724
|
-
sidebar: /* @__PURE__ */
|
|
23901
|
+
sidebar: /* @__PURE__ */ jsx256(
|
|
22725
23902
|
ProfitAndLossDetailedCharts,
|
|
22726
23903
|
{
|
|
22727
23904
|
stringOverrides: stringOverrides == null ? void 0 : stringOverrides.profitAndLossDetailedCharts
|
|
@@ -22730,7 +23907,7 @@ var ProfitAndLossPanel = (_a) => {
|
|
|
22730
23907
|
sidebarIsOpen: Boolean(sidebarScope),
|
|
22731
23908
|
parentRef: containerRef,
|
|
22732
23909
|
children: [
|
|
22733
|
-
/* @__PURE__ */
|
|
23910
|
+
/* @__PURE__ */ jsx256(
|
|
22734
23911
|
ProfitAndLoss.Header,
|
|
22735
23912
|
{
|
|
22736
23913
|
text: (stringOverrides == null ? void 0 : stringOverrides.header) || "Profit & Loss",
|
|
@@ -22738,7 +23915,7 @@ var ProfitAndLossPanel = (_a) => {
|
|
|
22738
23915
|
headingClassName: "Layer__profit-and-loss__title"
|
|
22739
23916
|
}
|
|
22740
23917
|
),
|
|
22741
|
-
/* @__PURE__ */
|
|
23918
|
+
/* @__PURE__ */ jsx256(Components, __spreadValues({ stringOverrides }, props))
|
|
22742
23919
|
]
|
|
22743
23920
|
}
|
|
22744
23921
|
);
|
|
@@ -22752,7 +23929,7 @@ var Components = ({
|
|
|
22752
23929
|
ProfitAndLoss.Context
|
|
22753
23930
|
);
|
|
22754
23931
|
if (!isLoading && error) {
|
|
22755
|
-
return /* @__PURE__ */
|
|
23932
|
+
return /* @__PURE__ */ jsx256("div", { className: "Layer__table-state-container", children: /* @__PURE__ */ jsx256(
|
|
22756
23933
|
DataState,
|
|
22757
23934
|
{
|
|
22758
23935
|
status: "failed" /* failed */,
|
|
@@ -22763,15 +23940,15 @@ var Components = ({
|
|
|
22763
23940
|
}
|
|
22764
23941
|
) });
|
|
22765
23942
|
}
|
|
22766
|
-
return /* @__PURE__ */
|
|
22767
|
-
!hideChart && /* @__PURE__ */
|
|
22768
|
-
/* @__PURE__ */
|
|
23943
|
+
return /* @__PURE__ */ jsxs168(Fragment46, { children: [
|
|
23944
|
+
!hideChart && /* @__PURE__ */ jsxs168("div", { className: `Layer__${COMPONENT_NAME7}__chart_with_summaries`, children: [
|
|
23945
|
+
/* @__PURE__ */ jsxs168(
|
|
22769
23946
|
"div",
|
|
22770
23947
|
{
|
|
22771
23948
|
className: `Layer__${COMPONENT_NAME7}__chart_with_summaries__summary-col`,
|
|
22772
23949
|
children: [
|
|
22773
|
-
/* @__PURE__ */
|
|
22774
|
-
/* @__PURE__ */
|
|
23950
|
+
/* @__PURE__ */ jsx256(ProfitAndLoss.DatePicker, {}),
|
|
23951
|
+
/* @__PURE__ */ jsx256(
|
|
22775
23952
|
ProfitAndLoss.Summaries,
|
|
22776
23953
|
{
|
|
22777
23954
|
actionable: true,
|
|
@@ -22781,15 +23958,15 @@ var Components = ({
|
|
|
22781
23958
|
]
|
|
22782
23959
|
}
|
|
22783
23960
|
),
|
|
22784
|
-
/* @__PURE__ */
|
|
23961
|
+
/* @__PURE__ */ jsx256(
|
|
22785
23962
|
"div",
|
|
22786
23963
|
{
|
|
22787
23964
|
className: `Layer__${COMPONENT_NAME7}__chart_with_summaries__chart-col`,
|
|
22788
|
-
children: /* @__PURE__ */
|
|
23965
|
+
children: /* @__PURE__ */ jsx256(ProfitAndLoss.Chart, {})
|
|
22789
23966
|
}
|
|
22790
23967
|
)
|
|
22791
23968
|
] }),
|
|
22792
|
-
!hideTable && /* @__PURE__ */
|
|
23969
|
+
!hideTable && /* @__PURE__ */ jsx256(
|
|
22793
23970
|
ProfitAndLoss.Table,
|
|
22794
23971
|
{
|
|
22795
23972
|
stringOverrides: stringOverrides == null ? void 0 : stringOverrides.profitAndLossTable
|
|
@@ -22814,6 +23991,7 @@ export {
|
|
|
22814
23991
|
LinkAccounts,
|
|
22815
23992
|
LinkedAccounts,
|
|
22816
23993
|
Onboarding,
|
|
23994
|
+
PlatformOnboarding,
|
|
22817
23995
|
ProfitAndLoss,
|
|
22818
23996
|
ProfitAndLossView,
|
|
22819
23997
|
ProjectProfitabilityView,
|