@flowselections/floriday-klanten-module 1.0.91 → 1.0.92
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-lib/assets/floriday-logo.png.asset.json +11 -0
- package/dist-lib/components/klanten/BewerkKlant.js +3 -3
- package/dist-lib/components/klanten/CarrierPicker.d.ts +43 -19
- package/dist-lib/components/klanten/CarrierPicker.d.ts.map +1 -1
- package/dist-lib/components/klanten/DeliveryLocationsTab.js +1 -1
- package/dist-lib/components/klanten/GroupedKlantDetail.js +13 -13
- package/dist-lib/components/klanten/ImportKlanten.js +1 -1
- package/dist-lib/components/klanten/KlantDetail.js +17 -17
- package/dist-lib/components/klanten/KlantFormulier.js +2 -2
- package/dist-lib/components/klanten/LocationGlns.d.ts +2 -2
- package/dist-lib/components/klanten/LocationGlns.d.ts.map +1 -1
- package/dist-lib/components/klanten/LogisticsStrategyCard.d.ts +7 -0
- package/dist-lib/components/klanten/LogisticsStrategyCard.d.ts.map +1 -0
- package/dist-lib/components/klanten/LogisticsStrategyCard.js +35 -0
- package/dist-lib/components/klanten/NetwerkPagina.js +1 -1
- package/dist-lib/components/klanten/NieuweKlant.js +3 -3
- package/dist-lib/components/klanten/OvernemenTwinfieldKlant.js +2 -2
- package/dist-lib/integrations/supabase/client.js +1 -1
- package/dist-lib/integrations/supabase/client.server.js +1 -1
- package/dist-lib/lib/accounting/twinfield/sandbox-rmw.server.d.ts +2 -2
- package/dist-lib/lib/accounting/twinfield/sandbox-rmw.server.js +2 -2
- package/dist-lib/lib/floriday.server.d.ts +55 -0
- package/dist-lib/lib/floriday.server.d.ts.map +1 -0
- package/dist-lib/lib/floriday.server.js +765 -0
- package/package.json +2 -2
- package/dist-lib/components/klanten/CarrierAdminCard.d.ts +0 -3
- package/dist-lib/components/klanten/CarrierAdminCard.d.ts.map +0 -1
- package/dist-lib/components/klanten/CarrierAdminCard.js +0 -23
- package/dist-lib/components/klanten/FloridayAutoPromoteCard.d.ts +0 -3
- package/dist-lib/components/klanten/FloridayAutoPromoteCard.d.ts.map +0 -1
- package/dist-lib/components/klanten/FloridayAutoPromoteCard.js +0 -31
- package/dist-lib/components/klanten/StickerSizePreviewCard.d.ts +0 -3
- package/dist-lib/components/klanten/StickerSizePreviewCard.d.ts.map +0 -1
- package/dist-lib/components/klanten/StickerSizePreviewCard.js +0 -27
- package/dist-lib/components/klanten/TwinfieldQueueAdminCard.d.ts +0 -3
- package/dist-lib/components/klanten/TwinfieldQueueAdminCard.d.ts.map +0 -1
- package/dist-lib/components/klanten/TwinfieldQueueAdminCard.js +0 -36
- package/dist-lib/lib/accounting/twinfield/field-coverage.test.d.ts +0 -2
- package/dist-lib/lib/accounting/twinfield/field-coverage.test.d.ts.map +0 -1
- package/dist-lib/lib/accounting/twinfield/field-coverage.test.js +0 -179
- package/dist-lib/lib/countries.test.d.ts +0 -2
- package/dist-lib/lib/countries.test.d.ts.map +0 -1
- package/dist-lib/lib/countries.test.js +0 -13
- package/dist-lib/lib/customer-defaults.test.d.ts +0 -2
- package/dist-lib/lib/customer-defaults.test.d.ts.map +0 -1
- package/dist-lib/lib/customer-defaults.test.js +0 -26
- package/dist-lib/lib/customer-schemas.test.d.ts +0 -2
- package/dist-lib/lib/customer-schemas.test.d.ts.map +0 -1
- package/dist-lib/lib/customer-schemas.test.js +0 -22
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 1,
|
|
3
|
+
"asset_id": "3e27c03f-e308-40e7-ac35-07bf1161c1e2",
|
|
4
|
+
"project_id": "dfdc14cf-30fe-4e0b-8abc-a3ae973943d8",
|
|
5
|
+
"url": "/__l5e/assets-v1/3e27c03f-e308-40e7-ac35-07bf1161c1e2/floriday-logo.png",
|
|
6
|
+
"r2_key": "a/v1/dfdc14cf-30fe-4e0b-8abc-a3ae973943d8/3e27c03f-e308-40e7-ac35-07bf1161c1e2/floriday-logo.png",
|
|
7
|
+
"original_filename": "floriday-logo.png",
|
|
8
|
+
"size": 6921,
|
|
9
|
+
"content_type": "image/png",
|
|
10
|
+
"created_at": "2026-07-07T13:17:11Z"
|
|
11
|
+
}
|
|
@@ -9,11 +9,11 @@ import { useServerFn } from "@tanstack/react-start";
|
|
|
9
9
|
import { toast } from "@flowselections/core";
|
|
10
10
|
import { getCustomer, updateCustomer } from "../../lib/customers.functions.js";
|
|
11
11
|
import { decodeDeep } from "../../lib/decode-html.js";
|
|
12
|
-
import { BackLink } from "
|
|
13
|
-
import { KlantFormulier, emptyKlantFormValues, } from "
|
|
12
|
+
import { BackLink } from "../../components/klanten/BackLink.js";
|
|
13
|
+
import { KlantFormulier, emptyKlantFormValues, } from "../../components/klanten/KlantFormulier.js";
|
|
14
14
|
import { resolveCustomerKeyForLocalCustomer } from "../../lib/price-groups-local.functions.js";
|
|
15
15
|
import { getCustomerStickerSettings } from "../../lib/customer-stickers.functions.js";
|
|
16
|
-
import { CustomerStickerFormatDialog } from "
|
|
16
|
+
import { CustomerStickerFormatDialog } from "../../components/klanten/CustomerStickerFormatDialog.js";
|
|
17
17
|
function StickerFormatSection({ customerId }) {
|
|
18
18
|
const resolveKey = useServerFn(resolveCustomerKeyForLocalCustomer);
|
|
19
19
|
const getFormat = useServerFn(getCustomerStickerSettings);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { type LocationCarrierChoice, type ProposalResult } from "../../lib/carrier-choice.js";
|
|
2
2
|
export declare function useCarrierOptions(): {
|
|
3
3
|
ordered: import("../../lib/carrier-choice.js").CarrierOption[];
|
|
4
|
-
data: {
|
|
4
|
+
data: NoInfer<{
|
|
5
5
|
carriers: import("../../lib/carrier-choice.js").CarrierOption[];
|
|
6
6
|
usage: Record<string, number>;
|
|
7
|
-
}
|
|
7
|
+
}>;
|
|
8
8
|
error: Error;
|
|
9
9
|
isError: true;
|
|
10
10
|
isPending: false;
|
|
@@ -27,17 +27,21 @@ export declare function useCarrierOptions(): {
|
|
|
27
27
|
isRefetching: boolean;
|
|
28
28
|
isStale: boolean;
|
|
29
29
|
isEnabled: boolean;
|
|
30
|
-
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<{
|
|
30
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<NoInfer<{
|
|
31
31
|
carriers: import("../../lib/carrier-choice.js").CarrierOption[];
|
|
32
32
|
usage: Record<string, number>;
|
|
33
|
-
}
|
|
33
|
+
}>, Error>>;
|
|
34
34
|
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
35
|
+
promise: Promise<NoInfer<{
|
|
36
|
+
carriers: import("../../lib/carrier-choice.js").CarrierOption[];
|
|
37
|
+
usage: Record<string, number>;
|
|
38
|
+
}>>;
|
|
35
39
|
} | {
|
|
36
40
|
ordered: import("../../lib/carrier-choice.js").CarrierOption[];
|
|
37
|
-
data: {
|
|
41
|
+
data: NoInfer<{
|
|
38
42
|
carriers: import("../../lib/carrier-choice.js").CarrierOption[];
|
|
39
43
|
usage: Record<string, number>;
|
|
40
|
-
}
|
|
44
|
+
}>;
|
|
41
45
|
error: null;
|
|
42
46
|
isError: false;
|
|
43
47
|
isPending: false;
|
|
@@ -60,11 +64,15 @@ export declare function useCarrierOptions(): {
|
|
|
60
64
|
isRefetching: boolean;
|
|
61
65
|
isStale: boolean;
|
|
62
66
|
isEnabled: boolean;
|
|
63
|
-
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<{
|
|
67
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<NoInfer<{
|
|
64
68
|
carriers: import("../../lib/carrier-choice.js").CarrierOption[];
|
|
65
69
|
usage: Record<string, number>;
|
|
66
|
-
}
|
|
70
|
+
}>, Error>>;
|
|
67
71
|
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
72
|
+
promise: Promise<NoInfer<{
|
|
73
|
+
carriers: import("../../lib/carrier-choice.js").CarrierOption[];
|
|
74
|
+
usage: Record<string, number>;
|
|
75
|
+
}>>;
|
|
68
76
|
} | {
|
|
69
77
|
ordered: import("../../lib/carrier-choice.js").CarrierOption[];
|
|
70
78
|
data: undefined;
|
|
@@ -90,11 +98,15 @@ export declare function useCarrierOptions(): {
|
|
|
90
98
|
isRefetching: boolean;
|
|
91
99
|
isStale: boolean;
|
|
92
100
|
isEnabled: boolean;
|
|
93
|
-
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<{
|
|
101
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<NoInfer<{
|
|
94
102
|
carriers: import("../../lib/carrier-choice.js").CarrierOption[];
|
|
95
103
|
usage: Record<string, number>;
|
|
96
|
-
}
|
|
104
|
+
}>, Error>>;
|
|
97
105
|
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
106
|
+
promise: Promise<NoInfer<{
|
|
107
|
+
carriers: import("../../lib/carrier-choice.js").CarrierOption[];
|
|
108
|
+
usage: Record<string, number>;
|
|
109
|
+
}>>;
|
|
98
110
|
} | {
|
|
99
111
|
ordered: import("../../lib/carrier-choice.js").CarrierOption[];
|
|
100
112
|
data: undefined;
|
|
@@ -120,11 +132,15 @@ export declare function useCarrierOptions(): {
|
|
|
120
132
|
isRefetching: boolean;
|
|
121
133
|
isStale: boolean;
|
|
122
134
|
isEnabled: boolean;
|
|
123
|
-
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<{
|
|
135
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<NoInfer<{
|
|
124
136
|
carriers: import("../../lib/carrier-choice.js").CarrierOption[];
|
|
125
137
|
usage: Record<string, number>;
|
|
126
|
-
}
|
|
138
|
+
}>, Error>>;
|
|
127
139
|
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
140
|
+
promise: Promise<NoInfer<{
|
|
141
|
+
carriers: import("../../lib/carrier-choice.js").CarrierOption[];
|
|
142
|
+
usage: Record<string, number>;
|
|
143
|
+
}>>;
|
|
128
144
|
} | {
|
|
129
145
|
ordered: import("../../lib/carrier-choice.js").CarrierOption[];
|
|
130
146
|
data: undefined;
|
|
@@ -150,17 +166,21 @@ export declare function useCarrierOptions(): {
|
|
|
150
166
|
isRefetching: boolean;
|
|
151
167
|
isStale: boolean;
|
|
152
168
|
isEnabled: boolean;
|
|
153
|
-
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<{
|
|
169
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<NoInfer<{
|
|
154
170
|
carriers: import("../../lib/carrier-choice.js").CarrierOption[];
|
|
155
171
|
usage: Record<string, number>;
|
|
156
|
-
}
|
|
172
|
+
}>, Error>>;
|
|
157
173
|
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
174
|
+
promise: Promise<NoInfer<{
|
|
175
|
+
carriers: import("../../lib/carrier-choice.js").CarrierOption[];
|
|
176
|
+
usage: Record<string, number>;
|
|
177
|
+
}>>;
|
|
158
178
|
} | {
|
|
159
179
|
ordered: import("../../lib/carrier-choice.js").CarrierOption[];
|
|
160
|
-
data: {
|
|
180
|
+
data: NoInfer<{
|
|
161
181
|
carriers: import("../../lib/carrier-choice.js").CarrierOption[];
|
|
162
182
|
usage: Record<string, number>;
|
|
163
|
-
}
|
|
183
|
+
}>;
|
|
164
184
|
isError: false;
|
|
165
185
|
error: null;
|
|
166
186
|
isPending: false;
|
|
@@ -183,11 +203,15 @@ export declare function useCarrierOptions(): {
|
|
|
183
203
|
isRefetching: boolean;
|
|
184
204
|
isStale: boolean;
|
|
185
205
|
isEnabled: boolean;
|
|
186
|
-
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<{
|
|
206
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<NoInfer<{
|
|
187
207
|
carriers: import("../../lib/carrier-choice.js").CarrierOption[];
|
|
188
208
|
usage: Record<string, number>;
|
|
189
|
-
}
|
|
209
|
+
}>, Error>>;
|
|
190
210
|
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
211
|
+
promise: Promise<NoInfer<{
|
|
212
|
+
carriers: import("../../lib/carrier-choice.js").CarrierOption[];
|
|
213
|
+
usage: Record<string, number>;
|
|
214
|
+
}>>;
|
|
191
215
|
};
|
|
192
216
|
export type ProposalItem = {
|
|
193
217
|
key: string;
|
|
@@ -195,7 +219,7 @@ export type ProposalItem = {
|
|
|
195
219
|
customer_id: string | null;
|
|
196
220
|
};
|
|
197
221
|
/** Live voorstel van de Logistieke Engine; wordt nooit opgeslagen. */
|
|
198
|
-
export declare function useCarrierProposals(items: ProposalItem[], enabled?: boolean): import("@tanstack/react-query").UseQueryResult<Record<string, ProposalResult
|
|
222
|
+
export declare function useCarrierProposals(items: ProposalItem[], enabled?: boolean): import("@tanstack/react-query").UseQueryResult<NoInfer<Record<string, ProposalResult>>, Error>;
|
|
199
223
|
/** Eén regel: welke vervoerder het wordt en waarom, plus de waarschuwing van de Engine. */
|
|
200
224
|
export declare function ProposalLine({ result, loading, error, onRetry, compact, }: {
|
|
201
225
|
result: ProposalResult | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CarrierPicker.d.ts","sourceRoot":"","sources":["../../../src/components/klanten/CarrierPicker.tsx"],"names":[],"mappings":"AAOA,OAAO,EAIL,KAAK,qBAAqB,EAC1B,KAAK,cAAc,EACpB,MAAM,0BAA0B,CAAC;AAGlC,wBAAgB,iBAAiB
|
|
1
|
+
{"version":3,"file":"CarrierPicker.d.ts","sourceRoot":"","sources":["../../../src/components/klanten/CarrierPicker.tsx"],"names":[],"mappings":"AAOA,OAAO,EAIL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C,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;CACtC,+BA+CN"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { friendlyError } from "../../lib/errors.js";
|
|
3
|
-
import { useCustomerDefaults } from "
|
|
3
|
+
import { useCustomerDefaults } from "../../components/klanten/useCustomerDefaults.js";
|
|
4
4
|
import { useMemo, useRef, useState } from "react";
|
|
5
5
|
import { useQuery, useMutation, useQueryClient } from "@tanstack/react-query";
|
|
6
6
|
import { useServerFn } from "@tanstack/react-start";
|
|
@@ -8,27 +8,27 @@ import { useEffect, useState } from "react";
|
|
|
8
8
|
import { Card, CardContent, Badge, Button, toast, Tabs, TabsList, TabsTrigger, TabsContent, Table, TableBody, TableCell, TableHead, TableHeader, TableRow, } from "@flowselections/core";
|
|
9
9
|
import { Mail, MapPin, Phone, Pencil, UserX } from "lucide-react";
|
|
10
10
|
import { TableSkeleton, InlineAlert, EmptyState as FsEmptyState } from "../fs-ui/index.js";
|
|
11
|
-
import { BackLink } from "
|
|
11
|
+
import { BackLink } from "../../components/klanten/BackLink.js";
|
|
12
12
|
import { getGroupedCustomerDetail, } from "../../lib/external-customers.functions.js";
|
|
13
|
-
import { ProfileCard, KpiStrip, BadgeList, EmptyState, adaptGroupedToProfile, } from "
|
|
13
|
+
import { ProfileCard, KpiStrip, BadgeList, EmptyState, adaptGroupedToProfile, } from "../../components/klanten/KlantDetailLayout.js";
|
|
14
14
|
import { countryNameToFlag } from "../../lib/countries.js";
|
|
15
|
-
import { DiscountsTab } from "
|
|
16
|
-
import { PriceGroupBadges } from "
|
|
17
|
-
import { CustomerPriceGroupSelect } from "
|
|
15
|
+
import { DiscountsTab } from "../../components/klanten/DiscountsTab.js";
|
|
16
|
+
import { PriceGroupBadges } from "../../components/klanten/PriceGroupBadges.js";
|
|
17
|
+
import { CustomerPriceGroupSelect } from "../../components/klanten/pricegroups/CustomerPriceGroupSelect.js";
|
|
18
18
|
import { listPriceGroupsForOrganizations } from "../../lib/price-groups.functions.js";
|
|
19
|
-
import { FloridayDeeplinkButton } from "
|
|
20
|
-
import { CustomerAssortmentTab } from "
|
|
21
|
-
import { FloridayAssortmentTab } from "
|
|
19
|
+
import { FloridayDeeplinkButton } from "../../components/klanten/FloridayDeeplinkButton.js";
|
|
20
|
+
import { CustomerAssortmentTab } from "../../components/klanten/CustomerAssortmentTab.js";
|
|
21
|
+
import { FloridayAssortmentTab } from "../../components/klanten/FloridayAssortmentTab.js";
|
|
22
22
|
import { decodeDeep } from "../../lib/decode-html.js";
|
|
23
|
-
import { DeliveryLocationsTab } from "
|
|
24
|
-
import { KlantBewerkenDialog } from "
|
|
25
|
-
import { FactureringKredietCard, hasBillingInfo, useLocalCustomer } from "
|
|
23
|
+
import { DeliveryLocationsTab } from "../../components/klanten/DeliveryLocationsTab.js";
|
|
24
|
+
import { KlantBewerkenDialog } from "../../components/klanten/KlantBewerkenDialog.js";
|
|
25
|
+
import { FactureringKredietCard, hasBillingInfo, useLocalCustomer } from "../../components/klanten/FactureringKredietCard.js";
|
|
26
26
|
import { getCustomerNote, upsertCustomerNote } from "../../lib/customer-notes.functions.js";
|
|
27
27
|
import { supabase } from "../../integrations/supabase/client.js";
|
|
28
28
|
import { formatPaymentMethodLabel } from "../../lib/payment-method.js";
|
|
29
|
-
import { CustomerOrdersTab } from "
|
|
29
|
+
import { CustomerOrdersTab } from "../../components/klanten/CustomerOrdersTab.js";
|
|
30
30
|
import { listCustomerOrders } from "../../lib/customer-orders.functions.js";
|
|
31
|
-
import { FloridayTradeSettingsCard } from "
|
|
31
|
+
import { FloridayTradeSettingsCard } from "../../components/klanten/FloridayTradeSettingsCard.js";
|
|
32
32
|
export function GroupedKlantDetail({ groupKey }) {
|
|
33
33
|
const navigate = useNavigate();
|
|
34
34
|
const qc = useQueryClient();
|
|
@@ -7,7 +7,7 @@ import { useMutation, useQueryClient } from "@tanstack/react-query";
|
|
|
7
7
|
import { useServerFn } from "@tanstack/react-start";
|
|
8
8
|
import { Button, Card, CardContent, CardHeader, CardTitle, Input, Label, toast, Table, TableBody, TableCell, TableHead, TableHeader, TableRow, Badge, Checkbox, } from "@flowselections/core";
|
|
9
9
|
import { Upload, Download, FileText, CheckCircle2, AlertTriangle, XCircle } from "lucide-react";
|
|
10
|
-
import { BackLink } from "
|
|
10
|
+
import { BackLink } from "../../components/klanten/BackLink.js";
|
|
11
11
|
import * as XLSX from "xlsx";
|
|
12
12
|
import { bulkImportCustomers } from "../../lib/customers.functions.js";
|
|
13
13
|
import { customerImportRowSchema } from "../../lib/customer-schemas.js";
|
|
@@ -7,33 +7,33 @@ import { useEffect, useState } from "react";
|
|
|
7
7
|
import { Card, CardContent, CardHeader, CardTitle, Badge, Button, toast, Tabs, TabsContent, TabsList, TabsTrigger, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, } from "@flowselections/core";
|
|
8
8
|
import { Trash2, Mail, Phone, Power, Pencil, MoreHorizontal, } from "lucide-react";
|
|
9
9
|
import { getCustomer, deleteCustomer, updateCustomer } from "../../lib/customers.functions.js";
|
|
10
|
-
import { ProfileCard, BadgeList, EmptyState, ActivityItem, adaptLocalToProfile, } from "
|
|
11
|
-
import { DeliveryLocationsTab } from "
|
|
12
|
-
import { CustomerCarrierCard } from "
|
|
13
|
-
import { BackLink } from "
|
|
10
|
+
import { ProfileCard, BadgeList, EmptyState, ActivityItem, adaptLocalToProfile, } from "../../components/klanten/KlantDetailLayout.js";
|
|
11
|
+
import { DeliveryLocationsTab } from "../../components/klanten/DeliveryLocationsTab.js";
|
|
12
|
+
import { CustomerCarrierCard } from "../../components/klanten/CustomerCarrierCard.js";
|
|
13
|
+
import { BackLink } from "../../components/klanten/BackLink.js";
|
|
14
14
|
import { NoticeBar, TableSkeleton, EmptyState as FsEmptyState } from "../fs-ui/index.js";
|
|
15
15
|
import { UserX } from "lucide-react";
|
|
16
|
-
import { CustomerAnalyticsTab } from "
|
|
17
|
-
import { LocalDiscountsTab } from "
|
|
18
|
-
import { PriceGroupBadges } from "
|
|
19
|
-
import { CustomerPriceGroupSelect } from "
|
|
16
|
+
import { CustomerAnalyticsTab } from "../../components/klanten/CustomerAnalyticsTab.js";
|
|
17
|
+
import { LocalDiscountsTab } from "../../components/klanten/LocalDiscountsTab.js";
|
|
18
|
+
import { PriceGroupBadges } from "../../components/klanten/PriceGroupBadges.js";
|
|
19
|
+
import { CustomerPriceGroupSelect } from "../../components/klanten/pricegroups/CustomerPriceGroupSelect.js";
|
|
20
20
|
import { resolveCustomerKeyForLocalCustomer } from "../../lib/price-groups-local.functions.js";
|
|
21
|
-
import { FloridayDeeplinkButton } from "
|
|
22
|
-
import { FloridayAssortmentTab } from "
|
|
23
|
-
import { CustomerAssortmentTab } from "
|
|
24
|
-
import { SyncStatusChip } from "
|
|
21
|
+
import { FloridayDeeplinkButton } from "../../components/klanten/FloridayDeeplinkButton.js";
|
|
22
|
+
import { FloridayAssortmentTab } from "../../components/klanten/FloridayAssortmentTab.js";
|
|
23
|
+
import { CustomerAssortmentTab } from "../../components/klanten/CustomerAssortmentTab.js";
|
|
24
|
+
import { SyncStatusChip } from "../../components/klanten/SyncStatusChip.js";
|
|
25
25
|
import { decodeDeep } from "../../lib/decode-html.js";
|
|
26
26
|
import { getMissingTwinfieldFields } from "../../lib/twinfield-required-fields.js";
|
|
27
27
|
import { missingInvoiceAddressFields } from "../../lib/invoice-address.js";
|
|
28
|
-
import { FactureringKredietCard, hasBillingInfo, BlockedBadge } from "
|
|
28
|
+
import { FactureringKredietCard, hasBillingInfo, BlockedBadge } from "../../components/klanten/FactureringKredietCard.js";
|
|
29
29
|
import { getCustomerNote, upsertCustomerNote } from "../../lib/customer-notes.functions.js";
|
|
30
30
|
import { supabase } from "../../integrations/supabase/client.js";
|
|
31
|
-
import { KlantBewerkenDialog } from "
|
|
32
|
-
import { CustomerOrdersTab } from "
|
|
31
|
+
import { KlantBewerkenDialog } from "../../components/klanten/KlantBewerkenDialog.js";
|
|
32
|
+
import { CustomerOrdersTab } from "../../components/klanten/CustomerOrdersTab.js";
|
|
33
33
|
import { formatDateTime } from "../../lib/format-date.js";
|
|
34
34
|
import { listCustomerOrders } from "../../lib/customer-orders.functions.js";
|
|
35
|
-
import { CustomerKpis } from "
|
|
36
|
-
import { FloridayTradeSettingsCard } from "
|
|
35
|
+
import { CustomerKpis } from "../../components/klanten/CustomerKpis.js";
|
|
36
|
+
import { FloridayTradeSettingsCard } from "../../components/klanten/FloridayTradeSettingsCard.js";
|
|
37
37
|
export function KlantDetail({ id }) {
|
|
38
38
|
const navigate = useNavigate();
|
|
39
39
|
const qc = useQueryClient();
|
|
@@ -7,14 +7,14 @@ import { useServerFn } from "@tanstack/react-start";
|
|
|
7
7
|
import { Button, Card, CardContent, Input, Label, Textarea, Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from "@flowselections/core";
|
|
8
8
|
import { MapPin, Landmark, ReceiptText, ChevronDown, Check, AlertCircle, Users, BookOpen, } from "lucide-react";
|
|
9
9
|
import { PageHeader, NoticeBar } from "../fs-ui/index.js";
|
|
10
|
-
import { BackLink } from "
|
|
10
|
+
import { BackLink } from "../../components/klanten/BackLink.js";
|
|
11
11
|
import { listCustomerClasses } from "../../lib/customers.functions.js";
|
|
12
12
|
import { listTwinfieldLedgerAccounts } from "../../lib/twinfield-ledger.functions.js";
|
|
13
13
|
import { customerCreateSchema } from "../../lib/customer-schemas.js";
|
|
14
14
|
import { requiresVatNumber } from "../../lib/twinfield-required-fields.js";
|
|
15
15
|
import { TWINFIELD_FIELD_MAX, TWINFIELD_READONLY_FIELDS, TWINFIELD_READONLY_HINT } from "../../lib/twinfield-limits.js";
|
|
16
16
|
import { countryNameToFlag, COUNTRY_NAMES, toIsoCountry } from "../../lib/countries.js";
|
|
17
|
-
import { SearchableSelect } from "
|
|
17
|
+
import { SearchableSelect } from "../../components/klanten/SearchableSelect.js";
|
|
18
18
|
import { checkVatFormat, isTwinfieldVatError } from "../../lib/vat-format.js";
|
|
19
19
|
import { creditManagerDisplay } from "../../lib/credit-management.js";
|
|
20
20
|
import { TWINFIELD_DEFAULTS, VAT_DISPLAY_OPTIONS, PAYMENT_SPEC_METHOD_OPTIONS, INVOICE_SEND_AS_OPTIONS, SEND_REMINDER_OPTIONS, DISCOUNT_SURCHARGE_OPTIONS, } from "../../lib/twinfield-defaults.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { type LocationGln } from "../../lib/delivery-locations.functions.js";
|
|
2
2
|
import { type DupLocation, type GlnAdd, type LinkedGln, type PendingGlns } from "../../lib/delivery-gln.js";
|
|
3
|
-
export declare function useLocationGlns(locationIds: string[]): import("@tanstack/react-query").UseQueryResult<{
|
|
3
|
+
export declare function useLocationGlns(locationIds: string[]): import("@tanstack/react-query").UseQueryResult<NoInfer<{
|
|
4
4
|
glns: LocationGln[];
|
|
5
5
|
mergeEnabled: boolean;
|
|
6
|
-
}
|
|
6
|
+
}>, Error>;
|
|
7
7
|
/** Zoekbare keuzelijst "GLN koppelen…": vrije GLN's van deze klant + "Andere GLN invoeren…". */
|
|
8
8
|
export declare function GlnPicker({ customerId, locationId, exclude, onPick, busy }: {
|
|
9
9
|
customerId: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LocationGlns.d.ts","sourceRoot":"","sources":["../../../src/components/klanten/LocationGlns.tsx"],"names":[],"mappings":"AAUA,OAAO,EAEoD,KAAK,WAAW,EAC1E,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAGL,KAAK,WAAW,EAAqB,KAAK,MAAM,EAAe,KAAK,SAAS,EAAE,KAAK,WAAW,EAChG,MAAM,wBAAwB,CAAC;AAEhC,wBAAgB,eAAe,CAAC,WAAW,EAAE,MAAM,EAAE;;;
|
|
1
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AC,CAAC,EAAE,WAAW,KAAK,IAAI,CAAC;CAC/H,+BAiBA;AAED,8FAA8F;AAC9F,wBAAgB,eAAe,CAAC,CAAC,SAAS,WAAW,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,EAAE;IAC/F,KAAK,EAAE,CAAC,EAAE,CAAC;IAAC,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,MAAM,CAAC;IAAC,YAAY,EAAE,OAAO,CAAC;IAAC,QAAQ,EAAE,MAAM,IAAI,CAAC;CAClF,+BA+DA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type StrategyScope } from "../../lib/logistics-strategy.functions.js";
|
|
2
|
+
export declare function LogisticsStrategyCard({ scope, refKey, description, }: {
|
|
3
|
+
scope: StrategyScope;
|
|
4
|
+
refKey: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
}): import("react").JSX.Element;
|
|
7
|
+
//# sourceMappingURL=LogisticsStrategyCard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LogisticsStrategyCard.d.ts","sourceRoot":"","sources":["../../../src/components/klanten/LogisticsStrategyCard.tsx"],"names":[],"mappings":"AAQA,OAAO,EAIL,KAAK,aAAa,EACnB,MAAM,oCAAoC,CAAC;AAI5C,wBAAgB,qBAAqB,CAAC,EACpC,KAAK,EACL,MAAM,EACN,WAAW,GACZ,EAAE;IACD,KAAK,EAAE,aAAa,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,+BAuEA"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { friendlyError } from "../../lib/errors.js";
|
|
3
|
+
import { useQuery, useMutation, useQueryClient } from "@tanstack/react-query";
|
|
4
|
+
import { useServerFn } from "@tanstack/react-start";
|
|
5
|
+
import { Card, CardContent, CardHeader, CardTitle, Badge, toast, Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from "@flowselections/core";
|
|
6
|
+
import { Truck } from "lucide-react";
|
|
7
|
+
import { listLogisticsStrategies, getLogisticsStrategyBinding, setLogisticsStrategyBinding, } from "../../lib/logistics-strategy.functions.js";
|
|
8
|
+
const NONE = "__none__";
|
|
9
|
+
export function LogisticsStrategyCard({ scope, refKey, description, }) {
|
|
10
|
+
const qc = useQueryClient();
|
|
11
|
+
const list = useServerFn(listLogisticsStrategies);
|
|
12
|
+
const get = useServerFn(getLogisticsStrategyBinding);
|
|
13
|
+
const save = useServerFn(setLogisticsStrategyBinding);
|
|
14
|
+
const { data: strategiesData } = useQuery({
|
|
15
|
+
queryKey: ["logistics-strategies"],
|
|
16
|
+
queryFn: () => list({}),
|
|
17
|
+
});
|
|
18
|
+
const { data: bindingData, isLoading } = useQuery({
|
|
19
|
+
queryKey: ["logistics-strategy-binding", scope, refKey],
|
|
20
|
+
queryFn: () => get({ data: { scope, refKey } }),
|
|
21
|
+
enabled: !!refKey,
|
|
22
|
+
});
|
|
23
|
+
const mut = useMutation({
|
|
24
|
+
mutationFn: (strategyId) => save({ data: { scope, refKey, strategyId } }),
|
|
25
|
+
onSuccess: () => {
|
|
26
|
+
toast.success("Logistieke strategie bijgewerkt");
|
|
27
|
+
qc.invalidateQueries({ queryKey: ["logistics-strategy-binding", scope, refKey] });
|
|
28
|
+
},
|
|
29
|
+
onError: (e) => toast.error(friendlyError(e, "Opslaan mislukt")),
|
|
30
|
+
});
|
|
31
|
+
const strategies = strategiesData?.strategies ?? [];
|
|
32
|
+
const current = bindingData?.binding?.strategy_id ?? null;
|
|
33
|
+
return (_jsxs(Card, { children: [_jsxs(CardHeader, { className: "flex flex-row items-center justify-between space-y-0", children: [_jsxs(CardTitle, { className: "flex items-center gap-2", children: [_jsx(Truck, { className: "h-4 w-4 text-muted-foreground" }), "Logistieke strategie"] }), current && _jsx(Badge, { variant: "secondary", children: "Gekoppeld" })] }), _jsxs(CardContent, { className: "space-y-3", children: [_jsx("p", { className: "text-sm text-muted-foreground", children: description ??
|
|
34
|
+
"Bepaalt welke regelset de Logistics Engine gebruikt voor orders van deze klant. Deze keuze wordt als strategyId meegestuurd." }), _jsxs(Select, { value: current ?? NONE, disabled: isLoading || mut.isPending, onValueChange: (v) => mut.mutate(v === NONE ? null : v), children: [_jsx(SelectTrigger, { className: "max-w-md", children: _jsx(SelectValue, { placeholder: "Kies een strategie" }) }), _jsxs(SelectContent, { children: [_jsx(SelectItem, { value: NONE, children: "Geen (Engine kiest zelf)" }), strategies.map((s) => (_jsxs(SelectItem, { value: s.id, children: [s.name, s.is_active === false ? " (inactief)" : ""] }, s.id)))] })] }), strategies.length === 0 && (_jsx("p", { className: "text-xs text-muted-foreground", children: "Er zijn nog geen logistieke strategie\u00EBn ingesteld in de Logistics Engine." }))] })] }));
|
|
35
|
+
}
|
|
@@ -6,7 +6,7 @@ import { useServerFn } from "@tanstack/react-start";
|
|
|
6
6
|
import { useState } from "react";
|
|
7
7
|
import { Button, Card, CardContent, Badge, Table, TableBody, TableCell, TableHead, TableHeader, TableRow, Switch, Label, } from "@flowselections/core";
|
|
8
8
|
import { MapPin, Globe } from "lucide-react";
|
|
9
|
-
import { BackLink } from "
|
|
9
|
+
import { BackLink } from "../../components/klanten/BackLink.js";
|
|
10
10
|
import { countryNameToFlag } from "../../lib/countries.js";
|
|
11
11
|
import { listFloridayNetwork } from "../../lib/customers.functions.js";
|
|
12
12
|
import { CustomerAvatar } from "../CustomerAvatar.js";
|
|
@@ -8,9 +8,9 @@ import { useServerFn } from "@tanstack/react-start";
|
|
|
8
8
|
import { toast, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, } from "@flowselections/core";
|
|
9
9
|
import { createCustomer, getActiveTwinfieldAdministration } from "../../lib/customers.functions.js";
|
|
10
10
|
import { upsertDeliveryLocation } from "../../lib/delivery-locations.functions.js";
|
|
11
|
-
import { KlantFormulier, emptyKlantFormValues, } from "
|
|
12
|
-
import { useCustomerDefaults, MISSING_DEFAULT_MESSAGE } from "
|
|
13
|
-
import { NieuweKlantLocaties, } from "
|
|
11
|
+
import { KlantFormulier, emptyKlantFormValues, } from "../../components/klanten/KlantFormulier.js";
|
|
12
|
+
import { useCustomerDefaults, MISSING_DEFAULT_MESSAGE } from "../../components/klanten/useCustomerDefaults.js";
|
|
13
|
+
import { NieuweKlantLocaties, } from "../../components/klanten/NieuweKlantLocaties.js";
|
|
14
14
|
export function NieuweKlant() {
|
|
15
15
|
const navigate = useNavigate();
|
|
16
16
|
const qc = useQueryClient();
|
|
@@ -8,8 +8,8 @@ import { useServerFn } from "@tanstack/react-start";
|
|
|
8
8
|
import { toast } from "@flowselections/core";
|
|
9
9
|
import { prepareTwinfieldAdoption, adoptTwinfieldCustomer, } from "../../lib/twinfield-adopt.functions.js";
|
|
10
10
|
import { decodeDeep } from "../../lib/decode-html.js";
|
|
11
|
-
import { BackLink } from "
|
|
12
|
-
import { KlantFormulier, emptyKlantFormValues, } from "
|
|
11
|
+
import { BackLink } from "../../components/klanten/BackLink.js";
|
|
12
|
+
import { KlantFormulier, emptyKlantFormValues, } from "../../components/klanten/KlantFormulier.js";
|
|
13
13
|
/** Zet een tekstwaarde uit de Twinfield-cache om naar een getal (of undefined). */
|
|
14
14
|
function num(v) {
|
|
15
15
|
const s = (v ?? "").trim().replace(",", ".");
|
|
@@ -19,7 +19,7 @@ function createSupabaseClient() {
|
|
|
19
19
|
}
|
|
20
20
|
let _supabase;
|
|
21
21
|
// Import the supabase client like this:
|
|
22
|
-
// import { supabase } from "
|
|
22
|
+
// import { supabase } from "../../integrations/supabase/client.js";
|
|
23
23
|
export const supabase = new Proxy({}, {
|
|
24
24
|
get(_, prop, receiver) {
|
|
25
25
|
if (!_supabase)
|
|
@@ -40,7 +40,7 @@ function createSupabaseAdminClient() {
|
|
|
40
40
|
let _supabaseAdmin;
|
|
41
41
|
// Server-side Supabase client with service role - bypasses RLS
|
|
42
42
|
// SECURITY: Only use this for trusted server-side operations, never expose to client code
|
|
43
|
-
// Import like: import { supabaseAdmin } from "
|
|
43
|
+
// Import like: import { supabaseAdmin } from "../../integrations/supabase/client.server.js";
|
|
44
44
|
export const supabaseAdmin = new Proxy({}, {
|
|
45
45
|
get(_, prop, receiver) {
|
|
46
46
|
if (!_supabaseAdmin)
|
|
@@ -438,7 +438,7 @@ export declare function runNoAddressTest(): Promise<{
|
|
|
438
438
|
/** Nieuwe debiteur met alleen een naam, via dezelfde opbouw als de klant-aanmaak (standaardwaarden van de administratie). */
|
|
439
439
|
export declare function runDefaultsTest(): Promise<{
|
|
440
440
|
error: string;
|
|
441
|
-
defaults: import("
|
|
441
|
+
defaults: import("../../../lib/twinfield-customer-defaults.server.js").CustomerDefaults;
|
|
442
442
|
erpRij: Record<string, unknown>;
|
|
443
443
|
verzonden: string;
|
|
444
444
|
antwoord: string;
|
|
@@ -449,7 +449,7 @@ export declare function runDefaultsTest(): Promise<{
|
|
|
449
449
|
statusNa?: undefined;
|
|
450
450
|
} | {
|
|
451
451
|
code: string;
|
|
452
|
-
defaults: import("
|
|
452
|
+
defaults: import("../../../lib/twinfield-customer-defaults.server.js").CustomerDefaults;
|
|
453
453
|
erpRij: {
|
|
454
454
|
country: unknown;
|
|
455
455
|
icp_country_code: unknown;
|
|
@@ -548,8 +548,8 @@ export async function runNoAddressTest() {
|
|
|
548
548
|
/** Nieuwe debiteur met alleen een naam, via dezelfde opbouw als de klant-aanmaak (standaardwaarden van de administratie). */
|
|
549
549
|
export async function runDefaultsTest() {
|
|
550
550
|
const { conn, office } = await sandboxConn();
|
|
551
|
-
const { loadCustomerDefaults } = await import("
|
|
552
|
-
const { buildCustomerInsertRow } = await import("
|
|
551
|
+
const { loadCustomerDefaults } = await import("../../../lib/twinfield-customer-defaults.server.js");
|
|
552
|
+
const { buildCustomerInsertRow } = await import("../../../lib/customer-insert.js");
|
|
553
553
|
const defaults = await loadCustomerDefaults(supabaseAdmin);
|
|
554
554
|
const row = buildCustomerInsertRow({ company_name: "Testdebiteur standaardwaarden" }, defaults);
|
|
555
555
|
const { data: cacheRow } = await supabaseAdmin.from("twinfield_dimension_types_cache").select("mask,label1,label2,label3,label4,label5,label6").eq("office_code", office).eq("dim_type", "DEB").maybeSingle();
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
export interface FloridayCustomer {
|
|
2
|
+
organization_id: string;
|
|
3
|
+
connection_id: string;
|
|
4
|
+
company_name: string;
|
|
5
|
+
vat_number: string | null;
|
|
6
|
+
email: string | null;
|
|
7
|
+
phone: string | null;
|
|
8
|
+
contact_person: string | null;
|
|
9
|
+
street: string | null;
|
|
10
|
+
house_number: string | null;
|
|
11
|
+
postal_code: string | null;
|
|
12
|
+
city: string | null;
|
|
13
|
+
country: string | null;
|
|
14
|
+
gln: string | null;
|
|
15
|
+
commercial_name: string | null;
|
|
16
|
+
bio: string | null;
|
|
17
|
+
segments: string[];
|
|
18
|
+
trade_forms: string[];
|
|
19
|
+
markets: string[];
|
|
20
|
+
product_groups: string[];
|
|
21
|
+
payment_methods: string[];
|
|
22
|
+
organization_type: string | null;
|
|
23
|
+
website: string | null;
|
|
24
|
+
logo_url: string | null;
|
|
25
|
+
custom_fields: Record<string, unknown>;
|
|
26
|
+
raw: unknown;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Realtime sync — alleen handelsrelaties (trade-partners) van elke actieve
|
|
30
|
+
* connectie. Dit is wat de "Synchroniseer Floriday"-knop aanroept en wat de
|
|
31
|
+
* uurlijkse token-cron triggert. Het volledige Floriday-netwerk wordt apart
|
|
32
|
+
* 's nachts gesynchroniseerd via syncFloridayNetwork().
|
|
33
|
+
*/
|
|
34
|
+
export declare function syncAllFloridayCustomers(): Promise<{
|
|
35
|
+
synced: number;
|
|
36
|
+
errors: Array<{
|
|
37
|
+
connectionId: string;
|
|
38
|
+
message: string;
|
|
39
|
+
}>;
|
|
40
|
+
}>;
|
|
41
|
+
/**
|
|
42
|
+
* Nachtelijke sync van het volledige Floriday-netwerk (alle organisaties
|
|
43
|
+
* waar de connectie zicht op heeft). Wordt incrementeel opgehaald via een
|
|
44
|
+
* per-connectie sequence number en in `floriday_network_cache` opgeslagen.
|
|
45
|
+
* Raakt de `customers`-tabel níet aan — die wordt door
|
|
46
|
+
* syncAllFloridayCustomers() (= trade-partners) gevuld.
|
|
47
|
+
*/
|
|
48
|
+
export declare function syncFloridayNetwork(): Promise<{
|
|
49
|
+
upserted: number;
|
|
50
|
+
errors: Array<{
|
|
51
|
+
connectionId: string;
|
|
52
|
+
message: string;
|
|
53
|
+
}>;
|
|
54
|
+
}>;
|
|
55
|
+
//# sourceMappingURL=floriday.server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"floriday.server.d.ts","sourceRoot":"","sources":["../../src/lib/floriday.server.ts"],"names":[],"mappings":"AA6FA,MAAM,WAAW,gBAAgB;IAC/B,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,QAAQ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