braid-ui 1.0.38 → 1.0.40

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -22,11 +22,11 @@ var TooltipPrimitive = require('@radix-ui/react-tooltip');
22
22
  var dateFns = require('date-fns');
23
23
  var reactDayPicker = require('react-day-picker');
24
24
  var PopoverPrimitive = require('@radix-ui/react-popover');
25
+ var sonner = require('sonner');
25
26
  var LabelPrimitive = require('@radix-ui/react-label');
26
27
  var CheckboxPrimitive = require('@radix-ui/react-checkbox');
27
28
  var DropdownMenuPrimitive = require('@radix-ui/react-dropdown-menu');
28
29
  var nextThemes = require('next-themes');
29
- var sonner = require('sonner');
30
30
  var TabsPrimitive = require('@radix-ui/react-tabs');
31
31
  var ToastPrimitives = require('@radix-ui/react-toast');
32
32
 
@@ -556,8 +556,8 @@ var reducer = (state, action) => {
556
556
  if (toastId) {
557
557
  addToRemoveQueue(toastId);
558
558
  } else {
559
- state.toasts.forEach((toast4) => {
560
- addToRemoveQueue(toast4.id);
559
+ state.toasts.forEach((toast5) => {
560
+ addToRemoveQueue(toast5.id);
561
561
  });
562
562
  }
563
563
  return {
@@ -3588,24 +3588,26 @@ var BusinessProfileCard = ({
3588
3588
  }
3589
3589
  )
3590
3590
  ] }),
3591
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6", children: /* @__PURE__ */ jsxRuntime.jsx(
3592
- FormInput,
3593
- {
3594
- name: "achCompanyId",
3595
- label: "ACH Company ID",
3596
- placeholder: "10-digit company ID"
3597
- }
3598
- ) }),
3599
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6", children: /* @__PURE__ */ jsxRuntime.jsx(
3600
- FormInput,
3601
- {
3602
- name: "productId",
3603
- label: "Product ID",
3604
- type: "number",
3605
- placeholder: "Product ID",
3606
- disabled: true
3607
- }
3608
- ) }),
3591
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6", children: [
3592
+ /* @__PURE__ */ jsxRuntime.jsx(
3593
+ FormInput,
3594
+ {
3595
+ name: "achCompanyId",
3596
+ label: "ACH Company ID",
3597
+ placeholder: "10-digit company ID"
3598
+ }
3599
+ ),
3600
+ /* @__PURE__ */ jsxRuntime.jsx(
3601
+ FormInput,
3602
+ {
3603
+ name: "productId",
3604
+ label: "Product ID",
3605
+ type: "number",
3606
+ placeholder: "Product ID",
3607
+ disabled: true
3608
+ }
3609
+ )
3610
+ ] }),
3609
3611
  /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "text-sm font-medium text-muted-foreground mt-6", children: "Contact Person" }),
3610
3612
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6", children: [
3611
3613
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -3664,6 +3666,34 @@ var BusinessProfileCard = ({
3664
3666
  /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Website", value: formValues?.website || "-", layout: "horizontal" })
3665
3667
  ] }),
3666
3668
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-2 gap-4", children: /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Business Phone", value: formValues?.mobilePhone || "-", layout: "horizontal" }) }),
3669
+ /* @__PURE__ */ jsxRuntime.jsx(
3670
+ InfoField,
3671
+ {
3672
+ label: "Address",
3673
+ value: formValues?.address ? (() => {
3674
+ const parts = [];
3675
+ if (formValues.address.line1) parts.push(formValues.address.line1);
3676
+ if (formValues.address.line2) parts.push(formValues.address.line2);
3677
+ const cityStateZip = [
3678
+ formValues.address.city,
3679
+ formValues.address.state,
3680
+ formValues.address.postalCode
3681
+ ].filter(Boolean).join(" ");
3682
+ if (cityStateZip) parts.push(cityStateZip);
3683
+ if (formValues.address.countryCode) parts.push(formValues.address.countryCode);
3684
+ return parts.length > 0 ? parts.join(", ") : "-";
3685
+ })() : "-",
3686
+ layout: "horizontal"
3687
+ }
3688
+ ),
3689
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
3690
+ /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "MCC", value: formValues?.mcc || "-", layout: "horizontal" }),
3691
+ /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "NAICS", value: formValues?.naics || "-", layout: "horizontal" })
3692
+ ] }),
3693
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
3694
+ /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "ACH Company ID", value: formValues?.achCompanyId || "-", layout: "horizontal" }),
3695
+ /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Product ID", value: formValues?.productId?.toString() || "-", layout: "horizontal" })
3696
+ ] }),
3667
3697
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
3668
3698
  /* @__PURE__ */ jsxRuntime.jsx(
3669
3699
  InfoField,
@@ -3689,32 +3719,6 @@ var BusinessProfileCard = ({
3689
3719
  }
3690
3720
  )
3691
3721
  ] }),
3692
- /* @__PURE__ */ jsxRuntime.jsx(
3693
- InfoField,
3694
- {
3695
- label: "Address",
3696
- value: formValues?.address ? (() => {
3697
- const parts = [];
3698
- if (formValues.address.line1) parts.push(formValues.address.line1);
3699
- if (formValues.address.line2) parts.push(formValues.address.line2);
3700
- const cityStateZip = [
3701
- formValues.address.city,
3702
- formValues.address.state,
3703
- formValues.address.postalCode
3704
- ].filter(Boolean).join(" ");
3705
- if (cityStateZip) parts.push(cityStateZip);
3706
- if (formValues.address.countryCode) parts.push(formValues.address.countryCode);
3707
- return parts.length > 0 ? parts.join(", ") : "-";
3708
- })() : "-",
3709
- layout: "horizontal"
3710
- }
3711
- ),
3712
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
3713
- /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "MCC", value: formValues?.mcc || "-", layout: "horizontal" }),
3714
- /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "NAICS", value: formValues?.naics || "-", layout: "horizontal" })
3715
- ] }),
3716
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-2 gap-4", children: /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "ACH Company ID", value: formValues?.achCompanyId || "-", layout: "horizontal" }) }),
3717
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-2 gap-4", children: /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Product ID", value: formValues?.productId?.toString() || "-", layout: "horizontal" }) }),
3718
3722
  /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "text-sm font-medium text-muted-foreground mt-6", children: "Contact Person" }),
3719
3723
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
3720
3724
  /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "First Name", value: formValues?.contactPersonFirstName || "-", layout: "horizontal" }),
@@ -4288,1109 +4292,1970 @@ var PageLayout = React15__namespace.forwardRef(
4288
4292
  }
4289
4293
  );
4290
4294
  PageLayout.displayName = "PageLayout";
4291
- var UBOCard = ({ ubos, onUBOClick }) => {
4292
- const columns3 = [
4293
- {
4294
- key: "name",
4295
- title: "Name",
4296
- sortable: true,
4297
- width: "40%",
4298
- render: (value, row) => /* @__PURE__ */ jsxRuntime.jsx(
4299
- "button",
4300
- {
4301
- onClick: () => onUBOClick(row.customerId),
4302
- className: "text-primary hover:underline font-medium text-left",
4303
- children: value
4304
- }
4305
- )
4306
- },
4307
- {
4308
- key: "title",
4309
- title: "Title",
4310
- sortable: true,
4311
- width: "40%"
4312
- },
4313
- {
4314
- key: "ownershipPercentage",
4315
- title: "Ownership %",
4316
- sortable: true,
4317
- width: "20%",
4318
- align: "right",
4319
- render: (value) => `${value}%`
4320
- }
4321
- ];
4322
- return /* @__PURE__ */ jsxRuntime.jsxs(Card, { children: [
4323
- /* @__PURE__ */ jsxRuntime.jsxs(CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-4", children: [
4324
- /* @__PURE__ */ jsxRuntime.jsx(CardTitle, { children: "Ultimate Beneficial Owners (UBO)" }),
4325
- /* @__PURE__ */ jsxRuntime.jsxs(Button, { size: "sm", variant: "ghost", children: [
4326
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Plus, { className: "h-4 w-4 mr-1" }),
4327
- "Add UBO"
4328
- ] })
4329
- ] }),
4330
- /* @__PURE__ */ jsxRuntime.jsx(CardContent, { children: ubos.length === 0 ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-center gap-2 py-4 text-sm text-muted-foreground", children: [
4331
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Users, { className: "h-5 w-5 opacity-50" }),
4332
- /* @__PURE__ */ jsxRuntime.jsx("p", { children: "No UBOs recorded" })
4333
- ] }) : /* @__PURE__ */ jsxRuntime.jsx(
4334
- DataTable,
4295
+ var FormField = React15__namespace.forwardRef(
4296
+ ({ label, description, error, required, children, className, layout = "vertical" }, ref) => {
4297
+ const isHorizontal = layout === "horizontal";
4298
+ return /* @__PURE__ */ jsxRuntime.jsxs(
4299
+ "div",
4335
4300
  {
4336
- columns: columns3,
4337
- data: ubos
4301
+ ref,
4302
+ className: cn(
4303
+ "space-y-2",
4304
+ isHorizontal && "grid grid-cols-1 md:grid-cols-3 gap-4 items-start space-y-0",
4305
+ className
4306
+ ),
4307
+ children: [
4308
+ label && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("space-y-1", isHorizontal && "pt-2"), children: [
4309
+ /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "text-sm font-medium text-foreground", children: [
4310
+ label,
4311
+ required && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-destructive ml-1", children: "*" })
4312
+ ] }),
4313
+ description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground", children: description })
4314
+ ] }),
4315
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn(isHorizontal && "md:col-span-2"), children: [
4316
+ children,
4317
+ error && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-destructive mt-1", children: error })
4318
+ ] })
4319
+ ]
4338
4320
  }
4339
- ) })
4340
- ] });
4321
+ );
4322
+ }
4323
+ );
4324
+ FormField.displayName = "FormField";
4325
+ var spacingClasses = {
4326
+ sm: "space-y-3",
4327
+ md: "space-y-4",
4328
+ lg: "space-y-6"
4341
4329
  };
4342
- var BusinessDocuments = ({ businessId, documents, onDocumentUpload }) => {
4343
- const [isUploading, setIsUploading] = React15.useState(false);
4344
- const [showUploadDialog, setShowUploadDialog] = React15.useState(false);
4345
- const [selectedFile, setSelectedFile] = React15.useState(null);
4346
- const [documentName, setDocumentName] = React15.useState("");
4347
- const [description, setDescription] = React15.useState("");
4348
- const [documentType, setDocumentType] = React15.useState("");
4349
- const handleFileSelect = (e) => {
4350
- const file = e.target.files?.[0];
4351
- if (!file) return;
4352
- setSelectedFile(file);
4353
- setDocumentName(file.name);
4354
- };
4355
- const handleUploadSubmit = async () => {
4356
- if (!selectedFile || !documentName || !documentType) {
4357
- toast({
4358
- title: "Missing Information",
4359
- description: "Please fill in all required fields",
4360
- variant: "destructive"
4361
- });
4362
- return;
4330
+ var gridClasses = {
4331
+ 1: "grid-cols-1",
4332
+ 2: "grid-cols-1 md:grid-cols-2",
4333
+ 3: "grid-cols-1 md:grid-cols-2 lg:grid-cols-3",
4334
+ 4: "grid-cols-1 md:grid-cols-2 lg:grid-cols-4"
4335
+ };
4336
+ var FormSection = React15__namespace.forwardRef(
4337
+ ({
4338
+ title,
4339
+ description,
4340
+ children,
4341
+ className,
4342
+ spacing: spacing2 = "md",
4343
+ layout = "vertical",
4344
+ columns: columns3 = 2
4345
+ }, ref) => {
4346
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref, className: cn("space-y-4", className), children: [
4347
+ (title || description) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1", children: [
4348
+ title && /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-lg font-semibold text-foreground", children: title }),
4349
+ description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: description })
4350
+ ] }),
4351
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(
4352
+ layout === "grid" ? `grid gap-4 ${gridClasses[columns3]}` : spacingClasses[spacing2]
4353
+ ), children })
4354
+ ] });
4355
+ }
4356
+ );
4357
+ FormSection.displayName = "FormSection";
4358
+ function Calendar({
4359
+ className,
4360
+ classNames,
4361
+ showOutsideDays = true,
4362
+ ...props
4363
+ }) {
4364
+ return /* @__PURE__ */ jsxRuntime.jsx(
4365
+ reactDayPicker.DayPicker,
4366
+ {
4367
+ showOutsideDays,
4368
+ className: cn("p-3 pointer-events-auto", className),
4369
+ classNames: {
4370
+ months: "flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",
4371
+ month: "space-y-4",
4372
+ caption: "flex justify-center pt-1 relative items-center",
4373
+ caption_label: "text-sm font-medium",
4374
+ nav: "space-x-1 flex items-center",
4375
+ button_previous: "absolute left-1 h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100",
4376
+ button_next: "absolute right-1 h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100",
4377
+ month_grid: "w-full border-collapse space-y-1",
4378
+ weekdays: "flex",
4379
+ weekday: "text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]",
4380
+ week: "flex w-full mt-2",
4381
+ day: "h-9 w-9 text-center text-sm p-0 relative hover:bg-accent hover:text-accent-foreground rounded-md",
4382
+ day_button: cn(
4383
+ buttonVariants({ variant: "ghost" }),
4384
+ "h-9 w-9 p-0 font-normal"
4385
+ ),
4386
+ selected: "bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground",
4387
+ today: "bg-accent text-accent-foreground",
4388
+ outside: "text-muted-foreground opacity-50",
4389
+ disabled: "text-muted-foreground opacity-50",
4390
+ hidden: "invisible",
4391
+ ...classNames
4392
+ },
4393
+ ...props
4363
4394
  }
4364
- setIsUploading(true);
4365
- try {
4366
- await onDocumentUpload(selectedFile, {
4367
- name: documentName,
4368
- description,
4369
- type: documentType
4370
- });
4371
- toast({
4372
- title: "Upload Successful",
4373
- description: `${documentName} uploaded successfully`
4374
- });
4375
- setShowUploadDialog(false);
4376
- resetForm();
4377
- } catch (error) {
4378
- toast({
4379
- title: "Upload Failed",
4380
- description: "Failed to upload document. Please try again.",
4381
- variant: "destructive"
4382
- });
4395
+ );
4396
+ }
4397
+ Calendar.displayName = "Calendar";
4398
+ var Popover = PopoverPrimitive__namespace.Root;
4399
+ var PopoverTrigger = PopoverPrimitive__namespace.Trigger;
4400
+ var PopoverContent = React15__namespace.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(PopoverPrimitive__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
4401
+ PopoverPrimitive__namespace.Content,
4402
+ {
4403
+ ref,
4404
+ align,
4405
+ sideOffset,
4406
+ className: cn(
4407
+ "z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
4408
+ className
4409
+ ),
4410
+ ...props
4411
+ }
4412
+ ) }));
4413
+ PopoverContent.displayName = PopoverPrimitive__namespace.Content.displayName;
4414
+ function DatePicker({
4415
+ date,
4416
+ onDateChange,
4417
+ placeholder = "Pick a date",
4418
+ disabled = false,
4419
+ className,
4420
+ buttonClassName,
4421
+ calendarClassName,
4422
+ align = "start",
4423
+ disabledDates,
4424
+ label,
4425
+ wrapperClassName
4426
+ }) {
4427
+ const [open, setOpen] = React15__namespace.useState(false);
4428
+ const handleSelect = (selectedDate) => {
4429
+ onDateChange?.(selectedDate);
4430
+ setOpen(false);
4431
+ };
4432
+ const picker = /* @__PURE__ */ jsxRuntime.jsxs(Popover, { open, onOpenChange: setOpen, children: [
4433
+ /* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
4434
+ Button,
4435
+ {
4436
+ variant: "outline",
4437
+ disabled,
4438
+ className: cn(
4439
+ "justify-start text-left font-normal",
4440
+ !date && "text-muted-foreground",
4441
+ buttonClassName
4442
+ ),
4443
+ children: [
4444
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CalendarIcon, { className: "mr-2 h-4 w-4" }),
4445
+ date ? dateFns.format(date, "MM/dd/yyyy") : placeholder
4446
+ ]
4447
+ }
4448
+ ) }),
4449
+ /* @__PURE__ */ jsxRuntime.jsx(PopoverContent, { className: cn("w-auto p-0", className), align, children: /* @__PURE__ */ jsxRuntime.jsx(
4450
+ Calendar,
4451
+ {
4452
+ mode: "single",
4453
+ selected: date,
4454
+ onSelect: handleSelect,
4455
+ disabled: disabledDates,
4456
+ initialFocus: true,
4457
+ className: cn("pointer-events-auto", calendarClassName)
4458
+ }
4459
+ ) })
4460
+ ] });
4461
+ if (label) {
4462
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("space-y-2", wrapperClassName), children: [
4463
+ /* @__PURE__ */ jsxRuntime.jsx("label", { className: "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70", children: label }),
4464
+ picker
4465
+ ] });
4466
+ }
4467
+ return picker;
4468
+ }
4469
+ var uboSchema = zod.z.object({
4470
+ legalFirstName: zod.z.string().min(1, "Legal first name is required"),
4471
+ legalLastName: zod.z.string().min(1, "Legal last name is required"),
4472
+ email: zod.z.string().email("Invalid email address"),
4473
+ title: zod.z.string().min(1, "Title is required"),
4474
+ ownershipPercentage: zod.z.number().min(0).max(100, "Must be between 0 and 100"),
4475
+ idNumber: zod.z.string().min(1, "ID number is required"),
4476
+ ssn: zod.z.string().min(1, "SSN is required"),
4477
+ dateOfBirth: zod.z.date({
4478
+ message: "Date of birth is required"
4479
+ }),
4480
+ street: zod.z.string().min(1, "Street is required"),
4481
+ apartment: zod.z.string().optional(),
4482
+ city: zod.z.string().min(1, "City is required"),
4483
+ state: zod.z.string().min(1, "State is required"),
4484
+ country: zod.z.string().min(1, "Country is required")
4485
+ });
4486
+ var titleOptions = [
4487
+ { value: "CEO", label: "CEO" },
4488
+ { value: "CFO", label: "CFO" },
4489
+ { value: "CTO", label: "CTO" },
4490
+ { value: "COO", label: "COO" },
4491
+ { value: "President", label: "President" },
4492
+ { value: "Vice President", label: "Vice President" },
4493
+ { value: "Director", label: "Director" },
4494
+ { value: "Manager", label: "Manager" },
4495
+ { value: "Board Member", label: "Board Member" },
4496
+ { value: "Partner", label: "Partner" },
4497
+ { value: "Other", label: "Other" }
4498
+ ];
4499
+ var AddUBODialog = ({ open, onOpenChange, onSubmit }) => {
4500
+ const [isSubmitting, setIsSubmitting] = React15.useState(false);
4501
+ const form = reactHookForm.useForm({
4502
+ resolver: zod$1.zodResolver(uboSchema),
4503
+ defaultValues: {
4504
+ legalFirstName: "",
4505
+ legalLastName: "",
4506
+ email: "",
4507
+ title: "",
4508
+ ownershipPercentage: 0,
4509
+ idNumber: "",
4510
+ ssn: "",
4511
+ street: "",
4512
+ apartment: "",
4513
+ city: "",
4514
+ state: "",
4515
+ country: "US"
4516
+ }
4517
+ });
4518
+ const handleSubmit = async (data) => {
4519
+ setIsSubmitting(true);
4520
+ try {
4521
+ await onSubmit(data);
4522
+ form.reset();
4523
+ onOpenChange(false);
4524
+ } catch (error) {
4525
+ console.error("Error adding UBO:", error);
4383
4526
  } finally {
4384
- setIsUploading(false);
4527
+ setIsSubmitting(false);
4385
4528
  }
4386
4529
  };
4387
- const resetForm = () => {
4388
- setSelectedFile(null);
4389
- setDocumentName("");
4390
- setDescription("");
4391
- setDocumentType("");
4392
- const fileInput = document.getElementById("file-upload");
4393
- if (fileInput) fileInput.value = "";
4394
- };
4395
- const handleCancelUpload = () => {
4396
- setShowUploadDialog(false);
4397
- resetForm();
4398
- };
4399
- const isImageType = (name) => {
4400
- const imageExtensions = [".jpg", ".jpeg", ".png", ".gif", ".webp", ".bmp"];
4401
- return imageExtensions.some((ext) => name.toLowerCase().endsWith(ext));
4402
- };
4403
- const getFileIcon = (type) => {
4404
- return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.FileText, { className: "h-5 w-5" });
4405
- };
4406
- const getFileTypeColor = (type) => {
4407
- switch (type.toUpperCase()) {
4408
- case "PDF":
4409
- return "text-red-500";
4410
- case "DOCX":
4411
- case "DOC":
4412
- return "text-blue-500";
4413
- case "XLSX":
4414
- case "XLS":
4415
- return "text-green-500";
4416
- case "JPG":
4417
- case "JPEG":
4418
- case "PNG":
4419
- return "text-purple-500";
4420
- default:
4421
- return "text-muted-foreground";
4422
- }
4530
+ const handleCancel = () => {
4531
+ form.reset();
4532
+ onOpenChange(false);
4423
4533
  };
4424
- const documentTypeOptions = [
4425
- { value: "BUSINESS_LICENSE", label: "Business License" },
4426
- { value: "TAX_DOCUMENT", label: "Tax Document" },
4427
- { value: "PROOF_OF_ADDRESS", label: "Proof of Address" },
4428
- { value: "BANK_STATEMENT", label: "Bank Statement" },
4429
- { value: "INCORPORATION_DOCS", label: "Incorporation Documents" },
4430
- { value: "OPERATING_AGREEMENT", label: "Operating Agreement" },
4431
- { value: "OTHER", label: "Other" }
4432
- ];
4433
- return /* @__PURE__ */ jsxRuntime.jsxs(Card, { children: [
4434
- /* @__PURE__ */ jsxRuntime.jsxs(CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-4", children: [
4435
- /* @__PURE__ */ jsxRuntime.jsx(CardTitle, { children: "Documents" }),
4436
- /* @__PURE__ */ jsxRuntime.jsxs(
4437
- Button,
4534
+ return /* @__PURE__ */ jsxRuntime.jsx(Dialog, { open, onOpenChange, children: /* @__PURE__ */ jsxRuntime.jsxs(DialogContent, { className: "max-w-3xl max-h-[90vh] overflow-y-auto", children: [
4535
+ /* @__PURE__ */ jsxRuntime.jsx(DialogHeader, { children: /* @__PURE__ */ jsxRuntime.jsx(DialogTitle, { children: "Add Ultimate Beneficial Owner" }) }),
4536
+ /* @__PURE__ */ jsxRuntime.jsx(reactHookForm.FormProvider, { ...form, children: /* @__PURE__ */ jsxRuntime.jsxs("form", { onSubmit: form.handleSubmit(handleSubmit), className: "space-y-6", children: [
4537
+ /* @__PURE__ */ jsxRuntime.jsxs(FormSection, { layout: "grid", columns: 2, spacing: "md", children: [
4538
+ /* @__PURE__ */ jsxRuntime.jsx(
4539
+ FormInput,
4540
+ {
4541
+ name: "legalFirstName",
4542
+ label: "Legal first name",
4543
+ placeholder: "Enter first name"
4544
+ }
4545
+ ),
4546
+ /* @__PURE__ */ jsxRuntime.jsx(
4547
+ FormInput,
4548
+ {
4549
+ name: "legalLastName",
4550
+ label: "Legal last name",
4551
+ placeholder: "Enter last name"
4552
+ }
4553
+ )
4554
+ ] }),
4555
+ /* @__PURE__ */ jsxRuntime.jsx(FormSection, { layout: "vertical", spacing: "md", children: /* @__PURE__ */ jsxRuntime.jsx(
4556
+ FormInput,
4438
4557
  {
4439
- onClick: () => setShowUploadDialog(true),
4440
- size: "sm",
4441
- variant: "ghost",
4442
- className: "gap-2",
4443
- children: [
4444
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Upload, { className: "h-4 w-4" }),
4445
- "Upload"
4446
- ]
4558
+ name: "email",
4559
+ label: "Email",
4560
+ type: "email",
4561
+ placeholder: "Enter email address"
4447
4562
  }
4448
- )
4449
- ] }),
4450
- /* @__PURE__ */ jsxRuntime.jsxs(CardContent, { children: [
4451
- showUploadDialog && reactDom.createPortal(
4452
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "fixed inset-0 z-[100] flex items-center justify-center p-4", children: [
4563
+ ) }),
4564
+ /* @__PURE__ */ jsxRuntime.jsxs(FormSection, { layout: "grid", columns: 2, spacing: "md", children: [
4565
+ /* @__PURE__ */ jsxRuntime.jsx(
4566
+ FormSelect,
4567
+ {
4568
+ name: "title",
4569
+ label: "Title",
4570
+ placeholder: "Select title",
4571
+ options: titleOptions
4572
+ }
4573
+ ),
4574
+ /* @__PURE__ */ jsxRuntime.jsx(
4575
+ FormInput,
4576
+ {
4577
+ name: "ownershipPercentage",
4578
+ label: "Ownership %",
4579
+ type: "number",
4580
+ placeholder: "Enter ownership percentage"
4581
+ }
4582
+ )
4583
+ ] }),
4584
+ /* @__PURE__ */ jsxRuntime.jsxs(FormSection, { layout: "grid", columns: 2, spacing: "md", children: [
4585
+ /* @__PURE__ */ jsxRuntime.jsx(
4586
+ FormInput,
4587
+ {
4588
+ name: "idNumber",
4589
+ label: "ID Number",
4590
+ placeholder: "Enter ID number"
4591
+ }
4592
+ ),
4593
+ /* @__PURE__ */ jsxRuntime.jsx(
4594
+ FormInput,
4595
+ {
4596
+ name: "ssn",
4597
+ label: "SSN",
4598
+ placeholder: "Enter SSN"
4599
+ }
4600
+ )
4601
+ ] }),
4602
+ /* @__PURE__ */ jsxRuntime.jsx(FormSection, { layout: "vertical", spacing: "md", children: /* @__PURE__ */ jsxRuntime.jsx(FormField, { label: "Date of birth", children: /* @__PURE__ */ jsxRuntime.jsx(
4603
+ reactHookForm.Controller,
4604
+ {
4605
+ name: "dateOfBirth",
4606
+ control: form.control,
4607
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsx(
4608
+ DatePicker,
4609
+ {
4610
+ date: field.value,
4611
+ onDateChange: field.onChange,
4612
+ placeholder: "MM/DD/YYYY"
4613
+ }
4614
+ )
4615
+ }
4616
+ ) }) }),
4617
+ /* @__PURE__ */ jsxRuntime.jsxs(FormSection, { title: "Address Details", layout: "vertical", spacing: "md", children: [
4618
+ /* @__PURE__ */ jsxRuntime.jsx(
4619
+ FormInput,
4620
+ {
4621
+ name: "street",
4622
+ label: "Street",
4623
+ placeholder: "Enter street address"
4624
+ }
4625
+ ),
4626
+ /* @__PURE__ */ jsxRuntime.jsx(
4627
+ FormInput,
4628
+ {
4629
+ name: "apartment",
4630
+ label: "Apartment, suite, or floor",
4631
+ placeholder: "Enter apartment, suite, or floor (optional)"
4632
+ }
4633
+ ),
4634
+ /* @__PURE__ */ jsxRuntime.jsxs(FormSection, { layout: "grid", columns: 2, spacing: "md", children: [
4453
4635
  /* @__PURE__ */ jsxRuntime.jsx(
4454
- "div",
4636
+ FormInput,
4455
4637
  {
4456
- className: "fixed inset-0 bg-background/80 backdrop-blur-sm",
4457
- onClick: handleCancelUpload
4638
+ name: "city",
4639
+ label: "City",
4640
+ placeholder: "Enter city"
4458
4641
  }
4459
4642
  ),
4460
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative bg-card border rounded-lg shadow-lg max-w-lg w-full p-6 z-[101]", children: [
4461
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between mb-6", children: [
4462
- /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-2xl font-bold", children: "Upload Document" }),
4463
- /* @__PURE__ */ jsxRuntime.jsx(
4464
- Button,
4465
- {
4466
- variant: "ghost",
4467
- size: "sm",
4468
- className: "h-8 w-8 p-0",
4469
- onClick: handleCancelUpload,
4470
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "h-4 w-4" })
4471
- }
4472
- )
4473
- ] }),
4474
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
4475
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "border-2 border-dashed rounded-lg p-6 text-center hover:border-primary/50 transition-colors", children: [
4476
- /* @__PURE__ */ jsxRuntime.jsx(
4477
- "input",
4478
- {
4479
- type: "file",
4480
- id: "file-upload-dialog",
4481
- className: "hidden",
4482
- onChange: handleFileSelect,
4483
- disabled: isUploading
4484
- }
4485
- ),
4486
- /* @__PURE__ */ jsxRuntime.jsxs(
4487
- "label",
4488
- {
4489
- htmlFor: "file-upload-dialog",
4490
- className: cn(
4491
- "cursor-pointer flex flex-col items-center gap-2",
4492
- isUploading && "opacity-50 cursor-not-allowed"
4493
- ),
4494
- children: [
4495
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Upload, { className: "h-8 w-8 text-muted-foreground" }),
4496
- /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
4497
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-medium text-foreground", children: selectedFile ? "Change file" : "Click to upload or drag and drop" }),
4498
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground mt-1", children: "PDF, DOC, DOCX, JPG, PNG up to 10MB" })
4499
- ] })
4500
- ]
4501
- }
4502
- )
4503
- ] }),
4504
- selectedFile && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-3 bg-muted/50 rounded-lg", children: [
4505
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: "Selected file:" }),
4506
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-medium", children: selectedFile.name }),
4507
- /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-xs text-muted-foreground", children: [
4508
- (selectedFile.size / 1024 / 1024).toFixed(2),
4509
- " MB"
4510
- ] })
4511
- ] }),
4512
- /* @__PURE__ */ jsxRuntime.jsx(
4513
- EnhancedInput,
4514
- {
4515
- label: "Document name",
4516
- value: documentName,
4517
- onChange: (e) => setDocumentName(e.target.value),
4518
- placeholder: "Enter document name"
4519
- }
4520
- ),
4521
- /* @__PURE__ */ jsxRuntime.jsx(
4522
- EnhancedTextarea,
4523
- {
4524
- label: "Description",
4525
- value: description,
4526
- onChange: (e) => setDescription(e.target.value),
4527
- placeholder: "Enter document description (optional)",
4528
- rows: 3
4529
- }
4530
- ),
4531
- /* @__PURE__ */ jsxRuntime.jsx(
4532
- EnhancedSelect,
4533
- {
4534
- label: "Document type",
4535
- value: documentType,
4536
- onValueChange: setDocumentType,
4537
- placeholder: "Select document type",
4538
- options: documentTypeOptions
4539
- }
4540
- )
4541
- ] }),
4542
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-3 mt-6", children: [
4543
- /* @__PURE__ */ jsxRuntime.jsx(
4544
- Button,
4545
- {
4546
- variant: "outline",
4547
- onClick: handleCancelUpload,
4548
- disabled: isUploading,
4549
- className: "flex-1",
4550
- children: "Cancel"
4551
- }
4552
- ),
4553
- /* @__PURE__ */ jsxRuntime.jsx(
4554
- Button,
4555
- {
4556
- onClick: handleUploadSubmit,
4557
- disabled: isUploading,
4558
- className: "flex-1",
4559
- children: isUploading ? "Uploading..." : "Upload"
4560
- }
4561
- )
4562
- ] })
4563
- ] })
4643
+ /* @__PURE__ */ jsxRuntime.jsx(
4644
+ FormInput,
4645
+ {
4646
+ name: "state",
4647
+ label: "State",
4648
+ placeholder: "Enter state"
4649
+ }
4650
+ )
4564
4651
  ] }),
4565
- document.body
4566
- ),
4567
- documents.length === 0 ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-center gap-2 py-4 text-sm text-muted-foreground", children: [
4568
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.FileText, { className: "h-5 w-5 opacity-50" }),
4569
- /* @__PURE__ */ jsxRuntime.jsx("p", { children: "No documents uploaded yet" })
4570
- ] }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-2", children: documents.map((doc) => /* @__PURE__ */ jsxRuntime.jsxs(
4571
- "div",
4572
- {
4573
- className: "border rounded-lg hover:bg-muted/30 transition-colors overflow-hidden",
4574
- children: [
4575
- isImageType(doc.name) && doc.url && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full bg-muted/50", children: /* @__PURE__ */ jsxRuntime.jsx(
4576
- "img",
4577
- {
4578
- src: doc.url,
4579
- alt: doc.name,
4580
- className: "w-full h-48 object-cover"
4581
- }
4582
- ) }),
4583
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between p-3", children: [
4584
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3 flex-1 min-w-0", children: [
4585
- !isImageType(doc.name) && /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(getFileTypeColor(doc.type)), children: getFileIcon(doc.type) }),
4586
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 min-w-0", children: [
4587
- /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "font-medium text-sm truncate", children: doc.name }),
4588
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn("text-xs px-2 py-0.5 rounded-full bg-muted inline-block mt-1", getFileTypeColor(doc.type)), children: doc.type }),
4589
- doc.description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-foreground mt-1", children: doc.description }),
4590
- /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-xs text-muted-foreground mt-1", children: [
4591
- doc.size,
4592
- " \u2022 Uploaded by ",
4593
- doc.uploadedBy,
4594
- " \u2022 ",
4595
- new Date(doc.uploadedAt).toLocaleDateString()
4596
- ] })
4597
- ] })
4598
- ] }),
4599
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1", children: [
4600
- /* @__PURE__ */ jsxRuntime.jsx(
4601
- Button,
4602
- {
4603
- variant: "ghost",
4604
- size: "sm",
4605
- className: "h-8 w-8 p-0",
4606
- onClick: () => toast({ title: "Preview", description: `Viewing ${doc.name}` }),
4607
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Eye, { className: "h-4 w-4" })
4608
- }
4609
- ),
4610
- /* @__PURE__ */ jsxRuntime.jsx(
4611
- Button,
4612
- {
4613
- variant: "ghost",
4614
- size: "sm",
4615
- className: "h-8 w-8 p-0",
4616
- onClick: () => toast({ title: "Download", description: `Downloading ${doc.name}` }),
4617
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Download, { className: "h-4 w-4" })
4618
- }
4619
- ),
4620
- /* @__PURE__ */ jsxRuntime.jsx(
4621
- Button,
4622
- {
4623
- variant: "ghost",
4624
- size: "sm",
4625
- className: "h-8 w-8 p-0 text-muted-foreground hover:text-foreground",
4626
- onClick: () => toast({ title: "Delete", description: `Deleted ${doc.name}` }),
4627
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Trash2, { className: "h-4 w-4" })
4628
- }
4629
- )
4630
- ] })
4631
- ] })
4632
- ]
4633
- },
4634
- doc.id
4635
- )) })
4636
- ] })
4637
- ] });
4638
- };
4639
- var accountColumns = [
4640
- {
4641
- key: "number",
4642
- title: "Account Number",
4643
- sortable: true,
4644
- width: "40%"
4645
- },
4646
- {
4647
- key: "routingNumber",
4648
- title: "Routing Number",
4649
- sortable: true,
4650
- width: "40%"
4651
- },
4652
- {
4653
- key: "type",
4654
- title: "Account Type",
4655
- sortable: true,
4656
- width: "20%",
4657
- align: "right",
4658
- render: (value) => /* @__PURE__ */ jsxRuntime.jsx("span", { className: "capitalize", children: value })
4659
- }
4660
- ];
4661
- var BusinessDetailView = ({
4662
- business,
4663
- businessProfile,
4664
- identityVerification,
4665
- businessUBOs,
4666
- businessDocuments,
4667
- businessAccounts,
4668
- currentStatus,
4669
- isEditingProfile,
4670
- onStatusChange,
4671
- onProfileDataChange,
4672
- onToggleProfileEdit,
4673
- onNavigateToAccounts,
4674
- onNavigateToCounterparty,
4675
- onAddAccount,
4676
- onUBOClick,
4677
- onDocumentUpload
4678
- }) => {
4679
- return /* @__PURE__ */ jsxRuntime.jsx(
4680
- PageLayout,
4681
- {
4682
- title: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3", children: [
4683
- /* @__PURE__ */ jsxRuntime.jsx("span", { children: business.businessName }),
4684
4652
  /* @__PURE__ */ jsxRuntime.jsx(
4685
- EditableInfoField,
4653
+ FormInput,
4686
4654
  {
4687
- label: "",
4688
- value: currentStatus,
4689
- options: [
4690
- { value: "active", label: "Active" },
4691
- { value: "inactive", label: "Inactive" },
4692
- { value: "suspended", label: "Suspended" }
4693
- ],
4694
- onChange: onStatusChange,
4695
- renderValue: (value) => /* @__PURE__ */ jsxRuntime.jsx(StatusBadge, { status: value.toUpperCase() }),
4696
- className: "inline-block"
4655
+ name: "country",
4656
+ label: "Country",
4657
+ placeholder: "Enter country"
4697
4658
  }
4698
- ),
4699
- /* @__PURE__ */ jsxRuntime.jsx(CIPStatusBadge, { status: business.cipStatus }),
4700
- /* @__PURE__ */ jsxRuntime.jsx(EntityTypeBadge, { type: business.type }),
4701
- /* @__PURE__ */ jsxRuntime.jsx(SubTypeBadge, { subType: business.subType })
4659
+ )
4702
4660
  ] }),
4703
- actions: [
4704
- {
4705
- label: "Account",
4706
- variant: "outline",
4707
- onClick: onNavigateToAccounts,
4708
- icon: lucideReact.Wallet
4709
- },
4661
+ /* @__PURE__ */ jsxRuntime.jsxs(DialogFooter, { children: [
4662
+ /* @__PURE__ */ jsxRuntime.jsx(Button, { type: "button", variant: "outline", onClick: handleCancel, children: "Cancel" }),
4663
+ /* @__PURE__ */ jsxRuntime.jsx(Button, { type: "submit", disabled: isSubmitting, children: isSubmitting ? "Adding..." : "Add UBO" })
4664
+ ] })
4665
+ ] }) })
4666
+ ] }) });
4667
+ };
4668
+ var UBOCard = ({ ubos, onUBOClick }) => {
4669
+ const [isDialogOpen, setIsDialogOpen] = React15.useState(false);
4670
+ const handleAddUBO = (data) => {
4671
+ console.log("New UBO data:", data);
4672
+ sonner.toast.success("UBO added successfully");
4673
+ };
4674
+ const columns3 = [
4675
+ {
4676
+ key: "name",
4677
+ title: "Name",
4678
+ sortable: true,
4679
+ width: "40%",
4680
+ render: (value, row) => /* @__PURE__ */ jsxRuntime.jsx(
4681
+ "button",
4710
4682
  {
4711
- label: "Counterparty",
4712
- variant: "outline",
4713
- onClick: onNavigateToCounterparty,
4714
- icon: lucideReact.Users
4683
+ onClick: () => onUBOClick(row.customerId),
4684
+ className: "text-primary hover:underline font-medium text-left",
4685
+ children: value
4715
4686
  }
4716
- ],
4717
- maxWidth: "full",
4718
- children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col lg:flex-row items-start gap-4", children: [
4719
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 space-y-4", children: [
4720
- /* @__PURE__ */ jsxRuntime.jsx(
4721
- BusinessProfileCard,
4722
- {
4723
- data: businessProfile,
4724
- identityVerification,
4725
- isEditing: isEditingProfile,
4726
- onToggleEdit: onToggleProfileEdit,
4727
- onDataChange: onProfileDataChange
4728
- }
4729
- ),
4730
- /* @__PURE__ */ jsxRuntime.jsx(UBOCard, { ubos: businessUBOs, onUBOClick }),
4731
- /* @__PURE__ */ jsxRuntime.jsxs(Card, { children: [
4732
- /* @__PURE__ */ jsxRuntime.jsxs(CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-4", children: [
4733
- /* @__PURE__ */ jsxRuntime.jsx(CardTitle, { children: "External Accounts" }),
4734
- /* @__PURE__ */ jsxRuntime.jsxs(Button, { size: "sm", variant: "ghost", onClick: onAddAccount, children: [
4735
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Plus, { className: "h-4 w-4 mr-1" }),
4736
- "Account"
4737
- ] })
4738
- ] }),
4739
- /* @__PURE__ */ jsxRuntime.jsx(CardContent, { children: businessAccounts.length === 0 ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-center gap-2 py-4 text-sm text-muted-foreground", children: [
4740
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Wallet, { className: "h-5 w-5 opacity-50" }),
4741
- /* @__PURE__ */ jsxRuntime.jsx("p", { children: "No external accounts found" })
4742
- ] }) : /* @__PURE__ */ jsxRuntime.jsx(
4743
- DataTable,
4744
- {
4745
- columns: accountColumns,
4746
- data: businessAccounts
4747
- }
4748
- ) })
4749
- ] }),
4750
- /* @__PURE__ */ jsxRuntime.jsx(
4751
- BusinessDocuments,
4752
- {
4753
- businessId: business.id,
4754
- documents: businessDocuments,
4755
- onDocumentUpload
4756
- }
4757
- )
4758
- ] }),
4759
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "lg:w-64", children: /* @__PURE__ */ jsxRuntime.jsx(BusinessStatusCard, { isEditing: false, onToggleEdit: () => {
4760
- } }) })
4761
- ] })
4762
- }
4763
- );
4764
- };
4765
- function Calendar({
4766
- className,
4767
- classNames,
4768
- showOutsideDays = true,
4769
- ...props
4770
- }) {
4771
- return /* @__PURE__ */ jsxRuntime.jsx(
4772
- reactDayPicker.DayPicker,
4687
+ )
4688
+ },
4773
4689
  {
4774
- showOutsideDays,
4775
- className: cn("p-3 pointer-events-auto", className),
4776
- classNames: {
4777
- months: "flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",
4778
- month: "space-y-4",
4779
- caption: "flex justify-center pt-1 relative items-center",
4780
- caption_label: "text-sm font-medium",
4781
- nav: "space-x-1 flex items-center",
4782
- button_previous: "absolute left-1 h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100",
4783
- button_next: "absolute right-1 h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100",
4784
- month_grid: "w-full border-collapse space-y-1",
4785
- weekdays: "flex",
4786
- weekday: "text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]",
4787
- week: "flex w-full mt-2",
4788
- day: "h-9 w-9 text-center text-sm p-0 relative hover:bg-accent hover:text-accent-foreground rounded-md",
4789
- day_button: cn(
4790
- buttonVariants({ variant: "ghost" }),
4791
- "h-9 w-9 p-0 font-normal"
4792
- ),
4793
- selected: "bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground",
4794
- today: "bg-accent text-accent-foreground",
4795
- outside: "text-muted-foreground opacity-50",
4796
- disabled: "text-muted-foreground opacity-50",
4797
- hidden: "invisible",
4798
- ...classNames
4799
- },
4800
- ...props
4690
+ key: "title",
4691
+ title: "Title",
4692
+ sortable: true,
4693
+ width: "40%"
4694
+ },
4695
+ {
4696
+ key: "ownershipPercentage",
4697
+ title: "Ownership %",
4698
+ sortable: true,
4699
+ width: "20%",
4700
+ align: "right",
4701
+ render: (value) => `${value}%`
4801
4702
  }
4802
- );
4803
- }
4804
- Calendar.displayName = "Calendar";
4805
- var Popover = PopoverPrimitive__namespace.Root;
4806
- var PopoverTrigger = PopoverPrimitive__namespace.Trigger;
4807
- var PopoverContent = React15__namespace.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(PopoverPrimitive__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
4808
- PopoverPrimitive__namespace.Content,
4809
- {
4810
- ref,
4811
- align,
4812
- sideOffset,
4813
- className: cn(
4814
- "z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
4815
- className
4816
- ),
4817
- ...props
4818
- }
4819
- ) }));
4820
- PopoverContent.displayName = PopoverPrimitive__namespace.Content.displayName;
4821
- function DatePicker({
4822
- date,
4823
- onDateChange,
4824
- placeholder = "Pick a date",
4825
- disabled = false,
4826
- className,
4827
- buttonClassName,
4828
- calendarClassName,
4829
- align = "start",
4830
- disabledDates,
4831
- label,
4832
- wrapperClassName
4833
- }) {
4834
- const [open, setOpen] = React15__namespace.useState(false);
4835
- const handleSelect = (selectedDate) => {
4836
- onDateChange?.(selectedDate);
4837
- setOpen(false);
4838
- };
4839
- const picker = /* @__PURE__ */ jsxRuntime.jsxs(Popover, { open, onOpenChange: setOpen, children: [
4840
- /* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
4841
- Button,
4703
+ ];
4704
+ return /* @__PURE__ */ jsxRuntime.jsxs(Card, { children: [
4705
+ /* @__PURE__ */ jsxRuntime.jsxs(CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-4", children: [
4706
+ /* @__PURE__ */ jsxRuntime.jsx(CardTitle, { children: "Ultimate Beneficial Owners (UBO)" }),
4707
+ /* @__PURE__ */ jsxRuntime.jsxs(Button, { size: "sm", variant: "ghost", onClick: () => setIsDialogOpen(true), children: [
4708
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Plus, { className: "h-4 w-4 mr-1" }),
4709
+ "Add UBO"
4710
+ ] })
4711
+ ] }),
4712
+ /* @__PURE__ */ jsxRuntime.jsx(CardContent, { children: ubos.length === 0 ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-center gap-2 py-4 text-sm text-muted-foreground", children: [
4713
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Users, { className: "h-5 w-5 opacity-50" }),
4714
+ /* @__PURE__ */ jsxRuntime.jsx("p", { children: "No UBOs recorded" })
4715
+ ] }) : /* @__PURE__ */ jsxRuntime.jsx(
4716
+ DataTable,
4842
4717
  {
4843
- variant: "outline",
4844
- disabled,
4845
- className: cn(
4846
- "justify-start text-left font-normal",
4847
- !date && "text-muted-foreground",
4848
- buttonClassName
4849
- ),
4850
- children: [
4851
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CalendarIcon, { className: "mr-2 h-4 w-4" }),
4852
- date ? dateFns.format(date, "MM/dd/yyyy") : placeholder
4853
- ]
4718
+ columns: columns3,
4719
+ data: ubos
4854
4720
  }
4855
4721
  ) }),
4856
- /* @__PURE__ */ jsxRuntime.jsx(PopoverContent, { className: cn("w-auto p-0", className), align, children: /* @__PURE__ */ jsxRuntime.jsx(
4857
- Calendar,
4722
+ /* @__PURE__ */ jsxRuntime.jsx(
4723
+ AddUBODialog,
4858
4724
  {
4859
- mode: "single",
4860
- selected: date,
4861
- onSelect: handleSelect,
4862
- disabled: disabledDates,
4863
- initialFocus: true,
4864
- className: cn("pointer-events-auto", calendarClassName)
4725
+ open: isDialogOpen,
4726
+ onOpenChange: setIsDialogOpen,
4727
+ onSubmit: handleAddUBO
4865
4728
  }
4866
- ) })
4729
+ )
4867
4730
  ] });
4868
- if (label) {
4869
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("space-y-2", wrapperClassName), children: [
4870
- /* @__PURE__ */ jsxRuntime.jsx("label", { className: "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70", children: label }),
4871
- picker
4872
- ] });
4873
- }
4874
- return picker;
4875
- }
4876
- var BusinessFiltersSheet = ({
4877
- filters,
4878
- onFilterChange,
4879
- onResetFilters
4731
+ };
4732
+ var accountSchema = zod.z.object({
4733
+ accountName: zod.z.string().min(1, "Account name is required"),
4734
+ accountType: zod.z.string().min(1, "Account type is required"),
4735
+ fundingFromAccount: zod.z.string().optional(),
4736
+ sweepToAccount: zod.z.string().optional()
4737
+ });
4738
+ var AddAccountDialog = ({
4739
+ open,
4740
+ onOpenChange,
4741
+ onSubmit,
4742
+ existingAccounts = []
4880
4743
  }) => {
4881
- const [localFilters, setLocalFilters] = React15.useState(filters);
4882
- const [open, setOpen] = React15.useState(false);
4883
- React15.useEffect(() => {
4884
- setLocalFilters(filters);
4885
- }, [filters]);
4886
- const handleLocalFilterChange = (field, value) => {
4887
- setLocalFilters((prev) => ({ ...prev, [field]: value }));
4888
- };
4889
- const handleApplyFilters = () => {
4890
- Object.entries(localFilters).forEach(([key, value]) => {
4891
- onFilterChange(key, value);
4892
- });
4893
- setOpen(false);
4894
- };
4895
- const handleResetFilters = () => {
4896
- const resetFilters = {
4897
- name: "",
4898
- productName: "",
4899
- status: "",
4900
- createdDateStart: void 0,
4901
- createdDateEnd: void 0
4902
- };
4903
- setLocalFilters(resetFilters);
4904
- onResetFilters();
4905
- setOpen(false);
4744
+ const [isLoading, setIsLoading] = React15.useState(false);
4745
+ const form = reactHookForm.useForm({
4746
+ resolver: zod$1.zodResolver(accountSchema),
4747
+ defaultValues: {
4748
+ accountName: "",
4749
+ accountType: void 0,
4750
+ fundingFromAccount: "",
4751
+ sweepToAccount: ""
4752
+ }
4753
+ });
4754
+ const handleSubmit = async (data) => {
4755
+ setIsLoading(true);
4756
+ try {
4757
+ await onSubmit?.(data);
4758
+ form.reset();
4759
+ onOpenChange(false);
4760
+ } catch (error) {
4761
+ console.error("Error creating account:", error);
4762
+ } finally {
4763
+ setIsLoading(false);
4764
+ }
4906
4765
  };
4907
- return /* @__PURE__ */ jsxRuntime.jsxs(Sheet, { open, onOpenChange: setOpen, children: [
4908
- /* @__PURE__ */ jsxRuntime.jsx(SheetTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(Button, { variant: "outline", className: "gap-2", children: [
4909
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Filter, { className: "h-4 w-4" }),
4910
- "Filters"
4911
- ] }) }),
4912
- /* @__PURE__ */ jsxRuntime.jsxs(SheetContent, { side: "right", className: "w-full sm:max-w-xl overflow-y-auto", children: [
4913
- /* @__PURE__ */ jsxRuntime.jsx(SheetHeader, { children: /* @__PURE__ */ jsxRuntime.jsx(SheetTitle, { children: "Business Filters" }) }),
4914
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-6 py-6", children: [
4766
+ existingAccounts.map((acc) => ({
4767
+ value: acc.id,
4768
+ label: `${acc.number}${acc.type ? ` (${acc.type})` : ""}`
4769
+ }));
4770
+ return /* @__PURE__ */ jsxRuntime.jsx(Dialog, { open, onOpenChange, children: /* @__PURE__ */ jsxRuntime.jsxs(DialogContent, { className: "sm:max-w-[600px] max-h-[90vh] overflow-y-auto", children: [
4771
+ /* @__PURE__ */ jsxRuntime.jsx(DialogHeader, { children: /* @__PURE__ */ jsxRuntime.jsx(DialogTitle, { children: "Add Account" }) }),
4772
+ /* @__PURE__ */ jsxRuntime.jsx(FormProvider, { form, children: /* @__PURE__ */ jsxRuntime.jsxs("form", { onSubmit: form.handleSubmit(handleSubmit), className: "space-y-4", children: [
4773
+ /* @__PURE__ */ jsxRuntime.jsxs(FormSection, { spacing: "md", children: [
4915
4774
  /* @__PURE__ */ jsxRuntime.jsx(
4916
- EnhancedInput,
4775
+ FormInput,
4917
4776
  {
4918
- label: "Name",
4919
- value: localFilters.name,
4920
- onChange: (e) => handleLocalFilterChange("name", e.target.value),
4921
- placeholder: "Enter business name"
4777
+ name: "accountName",
4778
+ label: "Account Name",
4779
+ placeholder: "Enter account name",
4780
+ required: true
4922
4781
  }
4923
4782
  ),
4924
4783
  /* @__PURE__ */ jsxRuntime.jsx(
4925
- EnhancedInput,
4784
+ FormSelect,
4926
4785
  {
4927
- label: "Product Name",
4928
- value: localFilters.productName,
4929
- onChange: (e) => handleLocalFilterChange("productName", e.target.value),
4930
- placeholder: "Enter product name"
4786
+ name: "accountType",
4787
+ label: "Account Type",
4788
+ placeholder: "Select account type",
4789
+ options: [
4790
+ { value: "CHECKING", label: "Checking" },
4791
+ { value: "SAVINGS", label: "Savings" }
4792
+ ]
4931
4793
  }
4932
4794
  ),
4933
4795
  /* @__PURE__ */ jsxRuntime.jsx(
4934
- EnhancedSelect,
4796
+ FormInput,
4935
4797
  {
4936
- label: "Status",
4937
- value: localFilters.status,
4938
- onValueChange: (value) => handleLocalFilterChange("status", value),
4939
- placeholder: "Select status",
4940
- options: [
4941
- { value: "ACTIVE", label: "Active" },
4942
- { value: "INACTIVE", label: "Inactive" },
4943
- { value: "BLOCKED", label: "Blocked" },
4944
- { value: "PENDING_APPROVAL", label: "Pending Approval" },
4945
- { value: "PENDING", label: "Pending" },
4946
- { value: "INITIALIZED", label: "Initialized" },
4947
- { value: "PENDING_UNBLOCKED", label: "Pending Unblocked" }
4948
- ]
4949
- }
4950
- ),
4951
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
4952
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
4953
- /* @__PURE__ */ jsxRuntime.jsx("label", { className: "text-sm font-medium", children: "Created Date Start" }),
4954
- /* @__PURE__ */ jsxRuntime.jsx(
4955
- DatePicker,
4956
- {
4957
- date: localFilters.createdDateStart,
4958
- onDateChange: (date) => handleLocalFilterChange("createdDateStart", date),
4959
- placeholder: "MM/DD/YYYY",
4960
- buttonClassName: "w-full",
4961
- className: "bg-background z-50"
4962
- }
4963
- )
4964
- ] }),
4965
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
4966
- /* @__PURE__ */ jsxRuntime.jsx("label", { className: "text-sm font-medium", children: "Created Date End" }),
4967
- /* @__PURE__ */ jsxRuntime.jsx(
4968
- DatePicker,
4969
- {
4970
- date: localFilters.createdDateEnd,
4971
- onDateChange: (date) => handleLocalFilterChange("createdDateEnd", date),
4972
- placeholder: "MM/DD/YYYY",
4973
- buttonClassName: "w-full",
4974
- className: "bg-background z-50"
4975
- }
4976
- )
4977
- ] })
4978
- ] })
4979
- ] }),
4980
- /* @__PURE__ */ jsxRuntime.jsxs(SheetFooter, { className: "gap-2", children: [
4981
- /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "outline", onClick: handleResetFilters, children: "Reset Filters" }),
4982
- /* @__PURE__ */ jsxRuntime.jsx(Button, { onClick: handleApplyFilters, children: "Apply Filters" })
4983
- ] })
4984
- ] })
4985
- ] });
4986
- };
4987
- var BusinessForm = ({
4988
- form,
4989
- businessType,
4990
- onBusinessTypeChange,
4991
- onSubmit
4992
- }) => {
4993
- return /* @__PURE__ */ jsxRuntime.jsx(FormProvider, { form, children: /* @__PURE__ */ jsxRuntime.jsxs("form", { onSubmit: form.handleSubmit(onSubmit), className: "space-y-6", children: [
4994
- /* @__PURE__ */ jsxRuntime.jsxs(Card, { className: "p-6", children: [
4995
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-b border-border pb-4 mb-6", children: /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-lg font-semibold text-foreground", children: "Business Information" }) }),
4996
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6", children: [
4997
- /* @__PURE__ */ jsxRuntime.jsx(
4998
- FormInput,
4999
- {
5000
- name: "name",
5001
- label: "Business Name",
5002
- placeholder: "Enter business name",
5003
- required: true
5004
- }
5005
- ),
5006
- /* @__PURE__ */ jsxRuntime.jsx(
5007
- FormInput,
5008
- {
5009
- name: "productId",
5010
- label: "Product ID",
5011
- placeholder: "Enter product ID",
5012
- type: "number",
5013
- required: true
5014
- }
5015
- ),
5016
- /* @__PURE__ */ jsxRuntime.jsx(
5017
- FormSelect,
5018
- {
5019
- name: "businessIdType",
5020
- label: "ID Number Type",
5021
- placeholder: "Select ID type",
5022
- options: [
5023
- { value: "EIN", label: "EIN" },
5024
- { value: "SSN", label: "SSN" },
5025
- { value: "TIN", label: "TIN" },
5026
- { value: "OTHER_ID", label: "Other ID" }
5027
- ]
5028
- }
5029
- ),
5030
- /* @__PURE__ */ jsxRuntime.jsx(
5031
- FormInput,
5032
- {
5033
- name: "idNumber",
5034
- label: "ID Number",
5035
- placeholder: "Enter ID number",
5036
- required: true
5037
- }
5038
- ),
5039
- /* @__PURE__ */ jsxRuntime.jsx(
5040
- FormInput,
5041
- {
5042
- name: "dba",
5043
- label: "DBA Name",
5044
- placeholder: "Enter DBA name",
5045
- hint: "Doing Business As name"
5046
- }
5047
- ),
5048
- /* @__PURE__ */ jsxRuntime.jsx(
5049
- FormSelect,
5050
- {
5051
- name: "businessEntityType",
5052
- label: "Business Entity Type",
5053
- placeholder: "Select business type",
5054
- options: [
5055
- { value: "SOLE_PROPRIETOR", label: "Sole Proprietor" },
5056
- { value: "LIMITED_LIABILITY_COMPANY", label: "Limited Liability Company (LLC)" },
5057
- { value: "CORPORATION", label: "S or C Corporation" },
5058
- { value: "GENERAL_PARTNERSHIP", label: "General Partnership" },
5059
- { value: "LIMITED_LIABILITY_PARTNERSHIP", label: "Limited Liability Partnership" },
5060
- { value: "NON_PROFIT", label: "Non-Profit Corporation" },
5061
- { value: "GOVERNMENT_ORGANIZATION", label: "Government Organization" },
5062
- { value: "PUBLICLY_TRADED_COMPANY", label: "Publicly Traded Company" },
5063
- { value: "TRUSTS", label: "Trusts" }
5064
- ]
5065
- }
5066
- ),
5067
- /* @__PURE__ */ jsxRuntime.jsx(
5068
- FormInput,
5069
- {
5070
- name: "incorporationState",
5071
- label: "Incorporation State",
5072
- placeholder: "Enter state"
5073
- }
5074
- ),
5075
- /* @__PURE__ */ jsxRuntime.jsx(
5076
- FormInput,
5077
- {
5078
- name: "formationDate",
5079
- label: "Formation Date",
5080
- placeholder: "YYYY-MM-DD",
5081
- type: "date"
5082
- }
5083
- ),
5084
- /* @__PURE__ */ jsxRuntime.jsx(
5085
- FormInput,
5086
- {
5087
- name: "website",
5088
- label: "Website",
5089
- placeholder: "https://www.business.com"
5090
- }
5091
- ),
5092
- /* @__PURE__ */ jsxRuntime.jsx(
5093
- FormInput,
5094
- {
5095
- name: "mobilePhone",
5096
- label: "Mobile Phone",
5097
- placeholder: "+1 (555) 123-4567",
5098
- hint: "Format: +1 (555) 123-4567"
5099
- }
5100
- ),
5101
- /* @__PURE__ */ jsxRuntime.jsx(
5102
- FormInput,
5103
- {
5104
- name: "mcc",
5105
- label: "MCC",
5106
- placeholder: "1234",
5107
- hint: "4-digit Merchant Category Code"
5108
- }
5109
- ),
5110
- /* @__PURE__ */ jsxRuntime.jsx(
5111
- FormInput,
5112
- {
5113
- name: "naics",
5114
- label: "NAICS",
5115
- placeholder: "123456",
5116
- hint: "6-digit industry classification"
4798
+ name: "fundingFromAccount",
4799
+ label: "Funding from Account",
4800
+ placeholder: "Enter funding account"
5117
4801
  }
5118
4802
  ),
5119
4803
  /* @__PURE__ */ jsxRuntime.jsx(
5120
4804
  FormInput,
5121
4805
  {
5122
- name: "achCompanyId",
5123
- label: "ACH Company ID",
5124
- placeholder: "Enter ACH company ID"
4806
+ name: "sweepToAccount",
4807
+ label: "Sweep to Account",
4808
+ placeholder: "Enter sweep account"
5125
4809
  }
5126
4810
  )
5127
- ] })
5128
- ] }),
5129
- /* @__PURE__ */ jsxRuntime.jsxs(Card, { className: "p-6", children: [
5130
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-b border-border pb-4 mb-6", children: /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-lg font-semibold text-foreground", children: "Business Address" }) }),
5131
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6", children: [
5132
- /* @__PURE__ */ jsxRuntime.jsx(
5133
- FormInput,
5134
- {
5135
- name: "address.line1",
5136
- label: "Street Address",
5137
- placeholder: "Enter street address"
5138
- }
5139
- ),
5140
- /* @__PURE__ */ jsxRuntime.jsx(
5141
- FormInput,
5142
- {
5143
- name: "address.line2",
5144
- label: "Apartment/Suite",
5145
- placeholder: "Enter apartment or suite number"
5146
- }
5147
- ),
5148
- /* @__PURE__ */ jsxRuntime.jsx(
5149
- FormInput,
5150
- {
5151
- name: "address.city",
5152
- label: "City",
5153
- placeholder: "Enter city"
5154
- }
5155
- ),
5156
- /* @__PURE__ */ jsxRuntime.jsx(
5157
- FormInput,
5158
- {
5159
- name: "address.state",
5160
- label: "State",
5161
- placeholder: "Enter state"
5162
- }
5163
- ),
5164
- /* @__PURE__ */ jsxRuntime.jsx(
5165
- FormInput,
5166
- {
5167
- name: "address.postalCode",
5168
- label: "Postal Code",
5169
- placeholder: "12345"
5170
- }
5171
- ),
4811
+ ] }),
4812
+ /* @__PURE__ */ jsxRuntime.jsxs(DialogFooter, { children: [
5172
4813
  /* @__PURE__ */ jsxRuntime.jsx(
5173
- FormInput,
4814
+ Button,
5174
4815
  {
5175
- name: "address.countryCode",
5176
- label: "Country Code",
5177
- placeholder: "e.g., US",
5178
- required: true
4816
+ type: "button",
4817
+ variant: "outline",
4818
+ onClick: () => onOpenChange(false),
4819
+ disabled: isLoading,
4820
+ children: "Cancel"
5179
4821
  }
5180
4822
  ),
5181
- /* @__PURE__ */ jsxRuntime.jsx(
5182
- FormInput,
5183
- {
5184
- name: "address.type",
5185
- label: "Address Type",
5186
- placeholder: "e.g., MAILING"
5187
- }
5188
- )
4823
+ /* @__PURE__ */ jsxRuntime.jsx(Button, { type: "submit", disabled: isLoading, children: isLoading ? "Creating..." : "Create Account" })
5189
4824
  ] })
5190
- ] }),
5191
- /* @__PURE__ */ jsxRuntime.jsxs(Card, { className: "p-6", children: [
5192
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-b border-border pb-4 mb-6", children: /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-lg font-semibold text-foreground", children: "Contact Information" }) }),
5193
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6", children: [
5194
- /* @__PURE__ */ jsxRuntime.jsx(
5195
- FormInput,
5196
- {
5197
- name: "contactPersonFirstName",
5198
- label: "Contact First Name",
5199
- placeholder: "Enter first name"
5200
- }
5201
- ),
5202
- /* @__PURE__ */ jsxRuntime.jsx(
5203
- FormInput,
5204
- {
5205
- name: "contactPersonLastName",
5206
- label: "Contact Last Name",
5207
- placeholder: "Enter last name"
5208
- }
5209
- ),
5210
- /* @__PURE__ */ jsxRuntime.jsx(
5211
- FormInput,
5212
- {
5213
- name: "contactPersonEmail",
5214
- label: "Contact Email",
5215
- placeholder: "contact@business.com",
5216
- type: "email"
5217
- }
5218
- ),
5219
- /* @__PURE__ */ jsxRuntime.jsx(
5220
- FormInput,
5221
- {
5222
- name: "contactPersonPhone",
4825
+ ] }) })
4826
+ ] }) });
4827
+ };
4828
+ var BusinessDocuments = ({ businessId, documents, onDocumentUpload }) => {
4829
+ const [isUploading, setIsUploading] = React15.useState(false);
4830
+ const [showUploadDialog, setShowUploadDialog] = React15.useState(false);
4831
+ const [selectedFile, setSelectedFile] = React15.useState(null);
4832
+ const [documentName, setDocumentName] = React15.useState("");
4833
+ const [description, setDescription] = React15.useState("");
4834
+ const [documentType, setDocumentType] = React15.useState("");
4835
+ const handleFileSelect = (e) => {
4836
+ const file = e.target.files?.[0];
4837
+ if (!file) return;
4838
+ setSelectedFile(file);
4839
+ setDocumentName(file.name);
4840
+ };
4841
+ const handleUploadSubmit = async () => {
4842
+ if (!selectedFile || !documentName || !documentType) {
4843
+ toast({
4844
+ title: "Missing Information",
4845
+ description: "Please fill in all required fields",
4846
+ variant: "destructive"
4847
+ });
4848
+ return;
4849
+ }
4850
+ setIsUploading(true);
4851
+ try {
4852
+ await onDocumentUpload(selectedFile, {
4853
+ name: documentName,
4854
+ description,
4855
+ type: documentType
4856
+ });
4857
+ toast({
4858
+ title: "Upload Successful",
4859
+ description: `${documentName} uploaded successfully`
4860
+ });
4861
+ setShowUploadDialog(false);
4862
+ resetForm();
4863
+ } catch (error) {
4864
+ toast({
4865
+ title: "Upload Failed",
4866
+ description: "Failed to upload document. Please try again.",
4867
+ variant: "destructive"
4868
+ });
4869
+ } finally {
4870
+ setIsUploading(false);
4871
+ }
4872
+ };
4873
+ const resetForm = () => {
4874
+ setSelectedFile(null);
4875
+ setDocumentName("");
4876
+ setDescription("");
4877
+ setDocumentType("");
4878
+ const fileInput = document.getElementById("file-upload");
4879
+ if (fileInput) fileInput.value = "";
4880
+ };
4881
+ const handleCancelUpload = () => {
4882
+ setShowUploadDialog(false);
4883
+ resetForm();
4884
+ };
4885
+ const isImageType = (name) => {
4886
+ const imageExtensions = [".jpg", ".jpeg", ".png", ".gif", ".webp", ".bmp"];
4887
+ return imageExtensions.some((ext) => name.toLowerCase().endsWith(ext));
4888
+ };
4889
+ const getFileIcon = (type) => {
4890
+ return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.FileText, { className: "h-5 w-5" });
4891
+ };
4892
+ const getFileTypeColor = (type) => {
4893
+ switch (type.toUpperCase()) {
4894
+ case "PDF":
4895
+ return "text-red-500";
4896
+ case "DOCX":
4897
+ case "DOC":
4898
+ return "text-blue-500";
4899
+ case "XLSX":
4900
+ case "XLS":
4901
+ return "text-green-500";
4902
+ case "JPG":
4903
+ case "JPEG":
4904
+ case "PNG":
4905
+ return "text-purple-500";
4906
+ default:
4907
+ return "text-muted-foreground";
4908
+ }
4909
+ };
4910
+ const documentTypeOptions = [
4911
+ { value: "BUSINESS_LICENSE", label: "Business License" },
4912
+ { value: "TAX_DOCUMENT", label: "Tax Document" },
4913
+ { value: "PROOF_OF_ADDRESS", label: "Proof of Address" },
4914
+ { value: "BANK_STATEMENT", label: "Bank Statement" },
4915
+ { value: "INCORPORATION_DOCS", label: "Incorporation Documents" },
4916
+ { value: "OPERATING_AGREEMENT", label: "Operating Agreement" },
4917
+ { value: "OTHER", label: "Other" }
4918
+ ];
4919
+ return /* @__PURE__ */ jsxRuntime.jsxs(Card, { children: [
4920
+ /* @__PURE__ */ jsxRuntime.jsxs(CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-4", children: [
4921
+ /* @__PURE__ */ jsxRuntime.jsx(CardTitle, { children: "Documents" }),
4922
+ /* @__PURE__ */ jsxRuntime.jsxs(
4923
+ Button,
4924
+ {
4925
+ onClick: () => setShowUploadDialog(true),
4926
+ size: "sm",
4927
+ variant: "ghost",
4928
+ className: "gap-2",
4929
+ children: [
4930
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Upload, { className: "h-4 w-4" }),
4931
+ "Upload"
4932
+ ]
4933
+ }
4934
+ )
4935
+ ] }),
4936
+ /* @__PURE__ */ jsxRuntime.jsxs(CardContent, { children: [
4937
+ showUploadDialog && reactDom.createPortal(
4938
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "fixed inset-0 z-[100] flex items-center justify-center p-4", children: [
4939
+ /* @__PURE__ */ jsxRuntime.jsx(
4940
+ "div",
4941
+ {
4942
+ className: "fixed inset-0 bg-background/80 backdrop-blur-sm",
4943
+ onClick: handleCancelUpload
4944
+ }
4945
+ ),
4946
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative bg-card border rounded-lg shadow-lg max-w-lg w-full p-6 z-[101]", children: [
4947
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between mb-6", children: [
4948
+ /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-2xl font-bold", children: "Upload Document" }),
4949
+ /* @__PURE__ */ jsxRuntime.jsx(
4950
+ Button,
4951
+ {
4952
+ variant: "ghost",
4953
+ size: "sm",
4954
+ className: "h-8 w-8 p-0",
4955
+ onClick: handleCancelUpload,
4956
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "h-4 w-4" })
4957
+ }
4958
+ )
4959
+ ] }),
4960
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
4961
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "border-2 border-dashed rounded-lg p-6 text-center hover:border-primary/50 transition-colors", children: [
4962
+ /* @__PURE__ */ jsxRuntime.jsx(
4963
+ "input",
4964
+ {
4965
+ type: "file",
4966
+ id: "file-upload-dialog",
4967
+ className: "hidden",
4968
+ onChange: handleFileSelect,
4969
+ disabled: isUploading
4970
+ }
4971
+ ),
4972
+ /* @__PURE__ */ jsxRuntime.jsxs(
4973
+ "label",
4974
+ {
4975
+ htmlFor: "file-upload-dialog",
4976
+ className: cn(
4977
+ "cursor-pointer flex flex-col items-center gap-2",
4978
+ isUploading && "opacity-50 cursor-not-allowed"
4979
+ ),
4980
+ children: [
4981
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Upload, { className: "h-8 w-8 text-muted-foreground" }),
4982
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
4983
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-medium text-foreground", children: selectedFile ? "Change file" : "Click to upload or drag and drop" }),
4984
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground mt-1", children: "PDF, DOC, DOCX, JPG, PNG up to 10MB" })
4985
+ ] })
4986
+ ]
4987
+ }
4988
+ )
4989
+ ] }),
4990
+ selectedFile && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-3 bg-muted/50 rounded-lg", children: [
4991
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: "Selected file:" }),
4992
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-medium", children: selectedFile.name }),
4993
+ /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-xs text-muted-foreground", children: [
4994
+ (selectedFile.size / 1024 / 1024).toFixed(2),
4995
+ " MB"
4996
+ ] })
4997
+ ] }),
4998
+ /* @__PURE__ */ jsxRuntime.jsx(
4999
+ EnhancedInput,
5000
+ {
5001
+ label: "Document name",
5002
+ value: documentName,
5003
+ onChange: (e) => setDocumentName(e.target.value),
5004
+ placeholder: "Enter document name"
5005
+ }
5006
+ ),
5007
+ /* @__PURE__ */ jsxRuntime.jsx(
5008
+ EnhancedTextarea,
5009
+ {
5010
+ label: "Description",
5011
+ value: description,
5012
+ onChange: (e) => setDescription(e.target.value),
5013
+ placeholder: "Enter document description (optional)",
5014
+ rows: 3
5015
+ }
5016
+ ),
5017
+ /* @__PURE__ */ jsxRuntime.jsx(
5018
+ EnhancedSelect,
5019
+ {
5020
+ label: "Document type",
5021
+ value: documentType,
5022
+ onValueChange: setDocumentType,
5023
+ placeholder: "Select document type",
5024
+ options: documentTypeOptions
5025
+ }
5026
+ )
5027
+ ] }),
5028
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-3 mt-6", children: [
5029
+ /* @__PURE__ */ jsxRuntime.jsx(
5030
+ Button,
5031
+ {
5032
+ variant: "outline",
5033
+ onClick: handleCancelUpload,
5034
+ disabled: isUploading,
5035
+ className: "flex-1",
5036
+ children: "Cancel"
5037
+ }
5038
+ ),
5039
+ /* @__PURE__ */ jsxRuntime.jsx(
5040
+ Button,
5041
+ {
5042
+ onClick: handleUploadSubmit,
5043
+ disabled: isUploading,
5044
+ className: "flex-1",
5045
+ children: isUploading ? "Uploading..." : "Upload"
5046
+ }
5047
+ )
5048
+ ] })
5049
+ ] })
5050
+ ] }),
5051
+ document.body
5052
+ ),
5053
+ documents.length === 0 ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-center gap-2 py-4 text-sm text-muted-foreground", children: [
5054
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.FileText, { className: "h-5 w-5 opacity-50" }),
5055
+ /* @__PURE__ */ jsxRuntime.jsx("p", { children: "No documents uploaded yet" })
5056
+ ] }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-2", children: documents.map((doc) => /* @__PURE__ */ jsxRuntime.jsxs(
5057
+ "div",
5058
+ {
5059
+ className: "border rounded-lg hover:bg-muted/30 transition-colors overflow-hidden",
5060
+ children: [
5061
+ isImageType(doc.name) && doc.url && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full bg-muted/50", children: /* @__PURE__ */ jsxRuntime.jsx(
5062
+ "img",
5063
+ {
5064
+ src: doc.url,
5065
+ alt: doc.name,
5066
+ className: "w-full h-48 object-cover"
5067
+ }
5068
+ ) }),
5069
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between p-3", children: [
5070
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3 flex-1 min-w-0", children: [
5071
+ !isImageType(doc.name) && /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(getFileTypeColor(doc.type)), children: getFileIcon(doc.type) }),
5072
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 min-w-0", children: [
5073
+ /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "font-medium text-sm truncate", children: doc.name }),
5074
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn("text-xs px-2 py-0.5 rounded-full bg-muted inline-block mt-1", getFileTypeColor(doc.type)), children: doc.type }),
5075
+ doc.description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-foreground mt-1", children: doc.description }),
5076
+ /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-xs text-muted-foreground mt-1", children: [
5077
+ doc.size,
5078
+ " \u2022 Uploaded by ",
5079
+ doc.uploadedBy,
5080
+ " \u2022 ",
5081
+ new Date(doc.uploadedAt).toLocaleDateString()
5082
+ ] })
5083
+ ] })
5084
+ ] }),
5085
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1", children: [
5086
+ /* @__PURE__ */ jsxRuntime.jsx(
5087
+ Button,
5088
+ {
5089
+ variant: "ghost",
5090
+ size: "sm",
5091
+ className: "h-8 w-8 p-0",
5092
+ onClick: () => toast({ title: "Preview", description: `Viewing ${doc.name}` }),
5093
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Eye, { className: "h-4 w-4" })
5094
+ }
5095
+ ),
5096
+ /* @__PURE__ */ jsxRuntime.jsx(
5097
+ Button,
5098
+ {
5099
+ variant: "ghost",
5100
+ size: "sm",
5101
+ className: "h-8 w-8 p-0",
5102
+ onClick: () => toast({ title: "Download", description: `Downloading ${doc.name}` }),
5103
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Download, { className: "h-4 w-4" })
5104
+ }
5105
+ ),
5106
+ /* @__PURE__ */ jsxRuntime.jsx(
5107
+ Button,
5108
+ {
5109
+ variant: "ghost",
5110
+ size: "sm",
5111
+ className: "h-8 w-8 p-0 text-muted-foreground hover:text-foreground",
5112
+ onClick: () => toast({ title: "Delete", description: `Deleted ${doc.name}` }),
5113
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Trash2, { className: "h-4 w-4" })
5114
+ }
5115
+ )
5116
+ ] })
5117
+ ] })
5118
+ ]
5119
+ },
5120
+ doc.id
5121
+ )) })
5122
+ ] })
5123
+ ] });
5124
+ };
5125
+ var accountColumns = [
5126
+ {
5127
+ key: "number",
5128
+ title: "Account Number",
5129
+ sortable: true,
5130
+ width: "40%"
5131
+ },
5132
+ {
5133
+ key: "routingNumber",
5134
+ title: "Routing Number",
5135
+ sortable: true,
5136
+ width: "40%"
5137
+ },
5138
+ {
5139
+ key: "type",
5140
+ title: "Account Type",
5141
+ sortable: true,
5142
+ width: "20%",
5143
+ align: "right",
5144
+ render: (value) => /* @__PURE__ */ jsxRuntime.jsx("span", { className: "capitalize", children: value })
5145
+ }
5146
+ ];
5147
+ var BusinessDetailView = ({
5148
+ business,
5149
+ businessProfile,
5150
+ identityVerification,
5151
+ businessUBOs,
5152
+ businessDocuments,
5153
+ businessAccounts,
5154
+ currentStatus,
5155
+ isEditingProfile,
5156
+ onStatusChange,
5157
+ onProfileDataChange,
5158
+ onToggleProfileEdit,
5159
+ onNavigateToAccounts,
5160
+ onNavigateToCounterparty,
5161
+ onAddAccount,
5162
+ onUBOClick,
5163
+ onDocumentUpload
5164
+ }) => {
5165
+ const [showAddAccountDialog, setShowAddAccountDialog] = React15.useState(false);
5166
+ const handleAddAccount = (data) => {
5167
+ console.log("New account data:", data);
5168
+ };
5169
+ return /* @__PURE__ */ jsxRuntime.jsxs(
5170
+ PageLayout,
5171
+ {
5172
+ title: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3", children: [
5173
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: business.businessName }),
5174
+ /* @__PURE__ */ jsxRuntime.jsx(
5175
+ EditableInfoField,
5176
+ {
5177
+ label: "",
5178
+ value: currentStatus,
5179
+ options: [
5180
+ { value: "active", label: "Active" },
5181
+ { value: "inactive", label: "Inactive" },
5182
+ { value: "suspended", label: "Suspended" }
5183
+ ],
5184
+ onChange: onStatusChange,
5185
+ renderValue: (value) => /* @__PURE__ */ jsxRuntime.jsx(StatusBadge, { status: value.toUpperCase() }),
5186
+ className: "inline-block"
5187
+ }
5188
+ ),
5189
+ /* @__PURE__ */ jsxRuntime.jsx(CIPStatusBadge, { status: business.cipStatus }),
5190
+ /* @__PURE__ */ jsxRuntime.jsx(EntityTypeBadge, { type: business.type }),
5191
+ /* @__PURE__ */ jsxRuntime.jsx(SubTypeBadge, { subType: business.subType })
5192
+ ] }),
5193
+ actions: [
5194
+ {
5195
+ label: "Account",
5196
+ variant: "outline",
5197
+ onClick: onNavigateToAccounts,
5198
+ icon: lucideReact.Wallet
5199
+ },
5200
+ {
5201
+ label: "Counterparty",
5202
+ variant: "outline",
5203
+ onClick: onNavigateToCounterparty,
5204
+ icon: lucideReact.Users
5205
+ }
5206
+ ],
5207
+ maxWidth: "full",
5208
+ children: [
5209
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col lg:flex-row items-start gap-4", children: [
5210
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 space-y-4", children: [
5211
+ /* @__PURE__ */ jsxRuntime.jsx(
5212
+ BusinessProfileCard,
5213
+ {
5214
+ data: businessProfile,
5215
+ identityVerification,
5216
+ isEditing: isEditingProfile,
5217
+ onToggleEdit: onToggleProfileEdit,
5218
+ onDataChange: onProfileDataChange
5219
+ }
5220
+ ),
5221
+ /* @__PURE__ */ jsxRuntime.jsx(UBOCard, { ubos: businessUBOs, onUBOClick }),
5222
+ /* @__PURE__ */ jsxRuntime.jsxs(Card, { children: [
5223
+ /* @__PURE__ */ jsxRuntime.jsxs(CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-4", children: [
5224
+ /* @__PURE__ */ jsxRuntime.jsx(CardTitle, { children: "External Accounts" }),
5225
+ /* @__PURE__ */ jsxRuntime.jsxs(Button, { size: "sm", variant: "ghost", onClick: () => setShowAddAccountDialog(true), children: [
5226
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Plus, { className: "h-4 w-4 mr-1" }),
5227
+ "Account"
5228
+ ] })
5229
+ ] }),
5230
+ /* @__PURE__ */ jsxRuntime.jsx(CardContent, { children: businessAccounts.length === 0 ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-center gap-2 py-4 text-sm text-muted-foreground", children: [
5231
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Wallet, { className: "h-5 w-5 opacity-50" }),
5232
+ /* @__PURE__ */ jsxRuntime.jsx("p", { children: "No external accounts found" })
5233
+ ] }) : /* @__PURE__ */ jsxRuntime.jsx(
5234
+ DataTable,
5235
+ {
5236
+ columns: accountColumns,
5237
+ data: businessAccounts
5238
+ }
5239
+ ) })
5240
+ ] }),
5241
+ /* @__PURE__ */ jsxRuntime.jsx(
5242
+ BusinessDocuments,
5243
+ {
5244
+ businessId: business.id,
5245
+ documents: businessDocuments,
5246
+ onDocumentUpload
5247
+ }
5248
+ )
5249
+ ] }),
5250
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "lg:w-64", children: /* @__PURE__ */ jsxRuntime.jsx(BusinessStatusCard, { isEditing: false, onToggleEdit: () => {
5251
+ } }) })
5252
+ ] }),
5253
+ /* @__PURE__ */ jsxRuntime.jsx(
5254
+ AddAccountDialog,
5255
+ {
5256
+ open: showAddAccountDialog,
5257
+ onOpenChange: setShowAddAccountDialog,
5258
+ onSubmit: handleAddAccount,
5259
+ existingAccounts: businessAccounts
5260
+ }
5261
+ )
5262
+ ]
5263
+ }
5264
+ );
5265
+ };
5266
+ var BusinessFiltersSheet = ({
5267
+ filters,
5268
+ onFilterChange,
5269
+ onResetFilters
5270
+ }) => {
5271
+ const [localFilters, setLocalFilters] = React15.useState(filters);
5272
+ const [open, setOpen] = React15.useState(false);
5273
+ React15.useEffect(() => {
5274
+ setLocalFilters(filters);
5275
+ }, [filters]);
5276
+ const handleLocalFilterChange = (field, value) => {
5277
+ setLocalFilters((prev) => ({ ...prev, [field]: value }));
5278
+ };
5279
+ const handleApplyFilters = () => {
5280
+ Object.entries(localFilters).forEach(([key, value]) => {
5281
+ onFilterChange(key, value);
5282
+ });
5283
+ setOpen(false);
5284
+ };
5285
+ const handleResetFilters = () => {
5286
+ const resetFilters = {
5287
+ name: "",
5288
+ productName: "",
5289
+ status: "",
5290
+ createdDateStart: void 0,
5291
+ createdDateEnd: void 0
5292
+ };
5293
+ setLocalFilters(resetFilters);
5294
+ onResetFilters();
5295
+ setOpen(false);
5296
+ };
5297
+ return /* @__PURE__ */ jsxRuntime.jsxs(Sheet, { open, onOpenChange: setOpen, children: [
5298
+ /* @__PURE__ */ jsxRuntime.jsx(SheetTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(Button, { variant: "outline", className: "gap-2", children: [
5299
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Filter, { className: "h-4 w-4" }),
5300
+ "Filters"
5301
+ ] }) }),
5302
+ /* @__PURE__ */ jsxRuntime.jsxs(SheetContent, { side: "right", className: "w-full sm:max-w-xl overflow-y-auto", children: [
5303
+ /* @__PURE__ */ jsxRuntime.jsx(SheetHeader, { children: /* @__PURE__ */ jsxRuntime.jsx(SheetTitle, { children: "Business Filters" }) }),
5304
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-6 py-6", children: [
5305
+ /* @__PURE__ */ jsxRuntime.jsx(
5306
+ EnhancedInput,
5307
+ {
5308
+ label: "Name",
5309
+ value: localFilters.name,
5310
+ onChange: (e) => handleLocalFilterChange("name", e.target.value),
5311
+ placeholder: "Enter business name"
5312
+ }
5313
+ ),
5314
+ /* @__PURE__ */ jsxRuntime.jsx(
5315
+ EnhancedInput,
5316
+ {
5317
+ label: "Product Name",
5318
+ value: localFilters.productName,
5319
+ onChange: (e) => handleLocalFilterChange("productName", e.target.value),
5320
+ placeholder: "Enter product name"
5321
+ }
5322
+ ),
5323
+ /* @__PURE__ */ jsxRuntime.jsx(
5324
+ EnhancedSelect,
5325
+ {
5326
+ label: "Status",
5327
+ value: localFilters.status,
5328
+ onValueChange: (value) => handleLocalFilterChange("status", value),
5329
+ placeholder: "Select status",
5330
+ options: [
5331
+ { value: "ACTIVE", label: "Active" },
5332
+ { value: "INACTIVE", label: "Inactive" },
5333
+ { value: "BLOCKED", label: "Blocked" },
5334
+ { value: "PENDING_APPROVAL", label: "Pending Approval" },
5335
+ { value: "PENDING", label: "Pending" },
5336
+ { value: "INITIALIZED", label: "Initialized" },
5337
+ { value: "PENDING_UNBLOCKED", label: "Pending Unblocked" }
5338
+ ]
5339
+ }
5340
+ ),
5341
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
5342
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
5343
+ /* @__PURE__ */ jsxRuntime.jsx("label", { className: "text-sm font-medium", children: "Created Date Start" }),
5344
+ /* @__PURE__ */ jsxRuntime.jsx(
5345
+ DatePicker,
5346
+ {
5347
+ date: localFilters.createdDateStart,
5348
+ onDateChange: (date) => handleLocalFilterChange("createdDateStart", date),
5349
+ placeholder: "MM/DD/YYYY",
5350
+ buttonClassName: "w-full",
5351
+ className: "bg-background z-50"
5352
+ }
5353
+ )
5354
+ ] }),
5355
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
5356
+ /* @__PURE__ */ jsxRuntime.jsx("label", { className: "text-sm font-medium", children: "Created Date End" }),
5357
+ /* @__PURE__ */ jsxRuntime.jsx(
5358
+ DatePicker,
5359
+ {
5360
+ date: localFilters.createdDateEnd,
5361
+ onDateChange: (date) => handleLocalFilterChange("createdDateEnd", date),
5362
+ placeholder: "MM/DD/YYYY",
5363
+ buttonClassName: "w-full",
5364
+ className: "bg-background z-50"
5365
+ }
5366
+ )
5367
+ ] })
5368
+ ] })
5369
+ ] }),
5370
+ /* @__PURE__ */ jsxRuntime.jsxs(SheetFooter, { className: "gap-2", children: [
5371
+ /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "outline", onClick: handleResetFilters, children: "Reset Filters" }),
5372
+ /* @__PURE__ */ jsxRuntime.jsx(Button, { onClick: handleApplyFilters, children: "Apply Filters" })
5373
+ ] })
5374
+ ] })
5375
+ ] });
5376
+ };
5377
+ var BusinessForm = ({
5378
+ form,
5379
+ businessType,
5380
+ onBusinessTypeChange,
5381
+ onSubmit
5382
+ }) => {
5383
+ return /* @__PURE__ */ jsxRuntime.jsx(FormProvider, { form, children: /* @__PURE__ */ jsxRuntime.jsxs("form", { onSubmit: form.handleSubmit(onSubmit), className: "space-y-6", children: [
5384
+ /* @__PURE__ */ jsxRuntime.jsxs(Card, { className: "p-6", children: [
5385
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-b border-border pb-4 mb-6", children: /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-lg font-semibold text-foreground", children: "Business Information" }) }),
5386
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6", children: [
5387
+ /* @__PURE__ */ jsxRuntime.jsx(
5388
+ FormInput,
5389
+ {
5390
+ name: "name",
5391
+ label: "Business Name",
5392
+ placeholder: "Enter business name",
5393
+ required: true
5394
+ }
5395
+ ),
5396
+ /* @__PURE__ */ jsxRuntime.jsx(
5397
+ FormInput,
5398
+ {
5399
+ name: "productId",
5400
+ label: "Product ID",
5401
+ placeholder: "Enter product ID",
5402
+ type: "number",
5403
+ required: true
5404
+ }
5405
+ ),
5406
+ /* @__PURE__ */ jsxRuntime.jsx(
5407
+ FormSelect,
5408
+ {
5409
+ name: "businessIdType",
5410
+ label: "ID Number Type",
5411
+ placeholder: "Select ID type",
5412
+ options: [
5413
+ { value: "EIN", label: "EIN" },
5414
+ { value: "SSN", label: "SSN" },
5415
+ { value: "TIN", label: "TIN" },
5416
+ { value: "OTHER_ID", label: "Other ID" }
5417
+ ]
5418
+ }
5419
+ ),
5420
+ /* @__PURE__ */ jsxRuntime.jsx(
5421
+ FormInput,
5422
+ {
5423
+ name: "idNumber",
5424
+ label: "ID Number",
5425
+ placeholder: "Enter ID number",
5426
+ required: true
5427
+ }
5428
+ ),
5429
+ /* @__PURE__ */ jsxRuntime.jsx(
5430
+ FormInput,
5431
+ {
5432
+ name: "dba",
5433
+ label: "DBA Name",
5434
+ placeholder: "Enter DBA name",
5435
+ hint: "Doing Business As name"
5436
+ }
5437
+ ),
5438
+ /* @__PURE__ */ jsxRuntime.jsx(
5439
+ FormSelect,
5440
+ {
5441
+ name: "businessEntityType",
5442
+ label: "Business Entity Type",
5443
+ placeholder: "Select business type",
5444
+ options: [
5445
+ { value: "SOLE_PROPRIETOR", label: "Sole Proprietor" },
5446
+ { value: "LIMITED_LIABILITY_COMPANY", label: "Limited Liability Company (LLC)" },
5447
+ { value: "CORPORATION", label: "S or C Corporation" },
5448
+ { value: "GENERAL_PARTNERSHIP", label: "General Partnership" },
5449
+ { value: "LIMITED_LIABILITY_PARTNERSHIP", label: "Limited Liability Partnership" },
5450
+ { value: "NON_PROFIT", label: "Non-Profit Corporation" },
5451
+ { value: "GOVERNMENT_ORGANIZATION", label: "Government Organization" },
5452
+ { value: "PUBLICLY_TRADED_COMPANY", label: "Publicly Traded Company" },
5453
+ { value: "TRUSTS", label: "Trusts" }
5454
+ ]
5455
+ }
5456
+ ),
5457
+ /* @__PURE__ */ jsxRuntime.jsx(
5458
+ FormInput,
5459
+ {
5460
+ name: "incorporationState",
5461
+ label: "Incorporation State",
5462
+ placeholder: "Enter state"
5463
+ }
5464
+ ),
5465
+ /* @__PURE__ */ jsxRuntime.jsx(
5466
+ FormInput,
5467
+ {
5468
+ name: "formationDate",
5469
+ label: "Formation Date",
5470
+ placeholder: "YYYY-MM-DD",
5471
+ type: "date"
5472
+ }
5473
+ ),
5474
+ /* @__PURE__ */ jsxRuntime.jsx(
5475
+ FormInput,
5476
+ {
5477
+ name: "website",
5478
+ label: "Website",
5479
+ placeholder: "https://www.business.com"
5480
+ }
5481
+ ),
5482
+ /* @__PURE__ */ jsxRuntime.jsx(
5483
+ FormInput,
5484
+ {
5485
+ name: "mobilePhone",
5486
+ label: "Mobile Phone",
5487
+ placeholder: "+1 (555) 123-4567",
5488
+ hint: "Format: +1 (555) 123-4567"
5489
+ }
5490
+ ),
5491
+ /* @__PURE__ */ jsxRuntime.jsx(
5492
+ FormInput,
5493
+ {
5494
+ name: "mcc",
5495
+ label: "MCC",
5496
+ placeholder: "1234",
5497
+ hint: "4-digit Merchant Category Code"
5498
+ }
5499
+ ),
5500
+ /* @__PURE__ */ jsxRuntime.jsx(
5501
+ FormInput,
5502
+ {
5503
+ name: "naics",
5504
+ label: "NAICS",
5505
+ placeholder: "123456",
5506
+ hint: "6-digit industry classification"
5507
+ }
5508
+ ),
5509
+ /* @__PURE__ */ jsxRuntime.jsx(
5510
+ FormInput,
5511
+ {
5512
+ name: "achCompanyId",
5513
+ label: "ACH Company ID",
5514
+ placeholder: "Enter ACH company ID"
5515
+ }
5516
+ )
5517
+ ] })
5518
+ ] }),
5519
+ /* @__PURE__ */ jsxRuntime.jsxs(Card, { className: "p-6", children: [
5520
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-b border-border pb-4 mb-6", children: /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-lg font-semibold text-foreground", children: "Business Address" }) }),
5521
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6", children: [
5522
+ /* @__PURE__ */ jsxRuntime.jsx(
5523
+ FormInput,
5524
+ {
5525
+ name: "address.line1",
5526
+ label: "Street Address",
5527
+ placeholder: "Enter street address"
5528
+ }
5529
+ ),
5530
+ /* @__PURE__ */ jsxRuntime.jsx(
5531
+ FormInput,
5532
+ {
5533
+ name: "address.line2",
5534
+ label: "Apartment/Suite",
5535
+ placeholder: "Enter apartment or suite number"
5536
+ }
5537
+ ),
5538
+ /* @__PURE__ */ jsxRuntime.jsx(
5539
+ FormInput,
5540
+ {
5541
+ name: "address.city",
5542
+ label: "City",
5543
+ placeholder: "Enter city"
5544
+ }
5545
+ ),
5546
+ /* @__PURE__ */ jsxRuntime.jsx(
5547
+ FormInput,
5548
+ {
5549
+ name: "address.state",
5550
+ label: "State",
5551
+ placeholder: "Enter state"
5552
+ }
5553
+ ),
5554
+ /* @__PURE__ */ jsxRuntime.jsx(
5555
+ FormInput,
5556
+ {
5557
+ name: "address.postalCode",
5558
+ label: "Postal Code",
5559
+ placeholder: "12345"
5560
+ }
5561
+ ),
5562
+ /* @__PURE__ */ jsxRuntime.jsx(
5563
+ FormInput,
5564
+ {
5565
+ name: "address.countryCode",
5566
+ label: "Country Code",
5567
+ placeholder: "e.g., US",
5568
+ required: true
5569
+ }
5570
+ ),
5571
+ /* @__PURE__ */ jsxRuntime.jsx(
5572
+ FormInput,
5573
+ {
5574
+ name: "address.type",
5575
+ label: "Address Type",
5576
+ placeholder: "e.g., MAILING"
5577
+ }
5578
+ )
5579
+ ] })
5580
+ ] }),
5581
+ /* @__PURE__ */ jsxRuntime.jsxs(Card, { className: "p-6", children: [
5582
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-b border-border pb-4 mb-6", children: /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-lg font-semibold text-foreground", children: "Contact Information" }) }),
5583
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6", children: [
5584
+ /* @__PURE__ */ jsxRuntime.jsx(
5585
+ FormInput,
5586
+ {
5587
+ name: "contactPersonFirstName",
5588
+ label: "Contact First Name",
5589
+ placeholder: "Enter first name"
5590
+ }
5591
+ ),
5592
+ /* @__PURE__ */ jsxRuntime.jsx(
5593
+ FormInput,
5594
+ {
5595
+ name: "contactPersonLastName",
5596
+ label: "Contact Last Name",
5597
+ placeholder: "Enter last name"
5598
+ }
5599
+ ),
5600
+ /* @__PURE__ */ jsxRuntime.jsx(
5601
+ FormInput,
5602
+ {
5603
+ name: "contactPersonEmail",
5604
+ label: "Contact Email",
5605
+ placeholder: "contact@business.com",
5606
+ type: "email"
5607
+ }
5608
+ ),
5609
+ /* @__PURE__ */ jsxRuntime.jsx(
5610
+ FormInput,
5611
+ {
5612
+ name: "contactPersonPhone",
5223
5613
  label: "Contact Phone",
5224
5614
  placeholder: "+1 (555) 123-4567"
5225
5615
  }
5226
- )
5616
+ )
5617
+ ] })
5618
+ ] })
5619
+ ] }) });
5620
+ };
5621
+ var CreateBusinessView = ({
5622
+ form,
5623
+ businessType,
5624
+ onBusinessTypeChange,
5625
+ onSubmit,
5626
+ onCancel
5627
+ }) => {
5628
+ return /* @__PURE__ */ jsxRuntime.jsx(
5629
+ PageLayout,
5630
+ {
5631
+ title: "Create Business",
5632
+ actions: [
5633
+ { label: "Cancel", variant: "outline", onClick: onCancel },
5634
+ { label: "Create Business", variant: "default", onClick: form.handleSubmit(onSubmit) }
5635
+ ],
5636
+ children: /* @__PURE__ */ jsxRuntime.jsx(
5637
+ BusinessForm,
5638
+ {
5639
+ form,
5640
+ businessType,
5641
+ onBusinessTypeChange,
5642
+ onSubmit
5643
+ }
5644
+ )
5645
+ }
5646
+ );
5647
+ };
5648
+ var CounterpartyFiltersSheet = ({
5649
+ filters,
5650
+ onFilterChange,
5651
+ onResetFilters
5652
+ }) => {
5653
+ const [localFilters, setLocalFilters] = React15.useState(filters);
5654
+ const [open, setOpen] = React15.useState(false);
5655
+ React15.useEffect(() => {
5656
+ setLocalFilters(filters);
5657
+ }, [filters]);
5658
+ const handleLocalFilterChange = (field, value) => {
5659
+ setLocalFilters((prev) => ({ ...prev, [field]: value }));
5660
+ };
5661
+ const handleApplyFilters = () => {
5662
+ Object.entries(localFilters).forEach(([key, value]) => {
5663
+ onFilterChange(key, value);
5664
+ });
5665
+ setOpen(false);
5666
+ };
5667
+ const handleResetFilters = () => {
5668
+ const resetFilters = {
5669
+ name: "",
5670
+ type: "",
5671
+ status: "",
5672
+ createdDateStart: void 0,
5673
+ createdDateEnd: void 0
5674
+ };
5675
+ setLocalFilters(resetFilters);
5676
+ onResetFilters();
5677
+ setOpen(false);
5678
+ };
5679
+ return /* @__PURE__ */ jsxRuntime.jsxs(Sheet, { open, onOpenChange: setOpen, children: [
5680
+ /* @__PURE__ */ jsxRuntime.jsx(SheetTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(Button, { variant: "outline", className: "gap-2", children: [
5681
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Filter, { className: "h-4 w-4" }),
5682
+ "Filters"
5683
+ ] }) }),
5684
+ /* @__PURE__ */ jsxRuntime.jsxs(SheetContent, { side: "right", className: "w-full sm:max-w-xl overflow-y-auto", children: [
5685
+ /* @__PURE__ */ jsxRuntime.jsx(SheetHeader, { children: /* @__PURE__ */ jsxRuntime.jsx(SheetTitle, { children: "Counterparty Filters" }) }),
5686
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-6 py-6", children: [
5687
+ /* @__PURE__ */ jsxRuntime.jsx(
5688
+ EnhancedInput,
5689
+ {
5690
+ label: "Name",
5691
+ value: localFilters.name,
5692
+ onChange: (e) => handleLocalFilterChange("name", e.target.value),
5693
+ placeholder: "Enter counterparty name"
5694
+ }
5695
+ ),
5696
+ /* @__PURE__ */ jsxRuntime.jsx(
5697
+ EnhancedSelect,
5698
+ {
5699
+ label: "Type",
5700
+ value: localFilters.type,
5701
+ onValueChange: (value) => handleLocalFilterChange("type", value),
5702
+ placeholder: "Select type",
5703
+ options: [
5704
+ { value: "BUSINESS", label: "Business" },
5705
+ { value: "INDIVIDUAL", label: "Individual" }
5706
+ ]
5707
+ }
5708
+ ),
5709
+ /* @__PURE__ */ jsxRuntime.jsx(
5710
+ EnhancedSelect,
5711
+ {
5712
+ label: "Status",
5713
+ value: localFilters.status,
5714
+ onValueChange: (value) => handleLocalFilterChange("status", value),
5715
+ placeholder: "Select status",
5716
+ options: [
5717
+ { value: "ACTIVE", label: "Active" },
5718
+ { value: "INACTIVE", label: "Inactive" },
5719
+ { value: "PENDING", label: "Pending" },
5720
+ { value: "SUSPENDED", label: "Suspended" }
5721
+ ]
5722
+ }
5723
+ ),
5724
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
5725
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
5726
+ /* @__PURE__ */ jsxRuntime.jsx("label", { className: "text-sm font-medium", children: "Created Date Start" }),
5727
+ /* @__PURE__ */ jsxRuntime.jsx(
5728
+ DatePicker,
5729
+ {
5730
+ date: localFilters.createdDateStart,
5731
+ onDateChange: (date) => handleLocalFilterChange("createdDateStart", date),
5732
+ placeholder: "MM/DD/YYYY",
5733
+ buttonClassName: "w-full",
5734
+ className: "bg-background z-50"
5735
+ }
5736
+ )
5737
+ ] }),
5738
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
5739
+ /* @__PURE__ */ jsxRuntime.jsx("label", { className: "text-sm font-medium", children: "Created Date End" }),
5740
+ /* @__PURE__ */ jsxRuntime.jsx(
5741
+ DatePicker,
5742
+ {
5743
+ date: localFilters.createdDateEnd,
5744
+ onDateChange: (date) => handleLocalFilterChange("createdDateEnd", date),
5745
+ placeholder: "MM/DD/YYYY",
5746
+ buttonClassName: "w-full",
5747
+ className: "bg-background z-50"
5748
+ }
5749
+ )
5750
+ ] })
5751
+ ] })
5752
+ ] }),
5753
+ /* @__PURE__ */ jsxRuntime.jsxs(SheetFooter, { className: "flex gap-2", children: [
5754
+ /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "outline", onClick: handleResetFilters, className: "flex-1", children: "Reset Filters" }),
5755
+ /* @__PURE__ */ jsxRuntime.jsx(Button, { onClick: handleApplyFilters, className: "flex-1", children: "Apply Filters" })
5756
+ ] })
5757
+ ] })
5758
+ ] });
5759
+ };
5760
+ var CounterpartiesView = ({
5761
+ table,
5762
+ filters,
5763
+ onFilterChange,
5764
+ onResetFilters,
5765
+ onCreateCounterparty
5766
+ }) => {
5767
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col h-screen bg-gradient-subtle", children: [
5768
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-none border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "container mx-auto px-4 py-6 max-w-none", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
5769
+ /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-3xl font-bold text-foreground", children: "Counterparties" }) }),
5770
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
5771
+ /* @__PURE__ */ jsxRuntime.jsx(
5772
+ CounterpartyFiltersSheet,
5773
+ {
5774
+ filters,
5775
+ onFilterChange,
5776
+ onResetFilters
5777
+ }
5778
+ ),
5779
+ /* @__PURE__ */ jsxRuntime.jsx(Button, { onClick: onCreateCounterparty, children: "Create Counterparty" })
5227
5780
  ] })
5781
+ ] }) }) }),
5782
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "container mx-auto px-4 h-full max-w-none flex flex-col", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 mt-4 overflow-auto", children: table }) }) })
5783
+ ] });
5784
+ };
5785
+
5786
+ // src/lib/mock-data/counterparty-data.ts
5787
+ var defaultCounterpartyDetail = {
5788
+ email: "contact@acme.com",
5789
+ phone: "+1 (555) 123-4567",
5790
+ dateOfBirth: "1985-03-15",
5791
+ idNumber: "ID-123456789",
5792
+ idType: "product_id",
5793
+ idValue: "PROD-001",
5794
+ address: {
5795
+ line1: "123 Business Ave",
5796
+ line2: "Suite 100",
5797
+ city: "New York",
5798
+ state: "NY",
5799
+ postalCode: "10001",
5800
+ countryCode: "US",
5801
+ type: "MAILING"
5802
+ }
5803
+ };
5804
+ var CounterpartyProfileCard = ({
5805
+ data,
5806
+ onDataChange,
5807
+ isEditing = false,
5808
+ onToggleEdit,
5809
+ hideActions = false,
5810
+ className
5811
+ }) => {
5812
+ const navigate = reactRouterDom.useNavigate();
5813
+ const form = useFormWithEditState({
5814
+ schema: counterpartyDetailSchema,
5815
+ defaultValues: { ...defaultCounterpartyDetail, ...data },
5816
+ initialEditing: isEditing,
5817
+ onToggleEdit,
5818
+ onSave: onDataChange
5819
+ });
5820
+ const editContent = /* @__PURE__ */ jsxRuntime.jsx(FormProvider, { form, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
5821
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6", children: [
5822
+ /* @__PURE__ */ jsxRuntime.jsx(
5823
+ FormSelect,
5824
+ {
5825
+ name: "idType",
5826
+ label: "Associated with",
5827
+ placeholder: "Select association type",
5828
+ options: [
5829
+ { value: "product_id", label: "Product ID" },
5830
+ { value: "business_id", label: "Business ID" },
5831
+ { value: "individual_id", label: "Individual ID" },
5832
+ { value: "account_number", label: "Account Number" }
5833
+ ]
5834
+ }
5835
+ ),
5836
+ /* @__PURE__ */ jsxRuntime.jsx(
5837
+ FormInput,
5838
+ {
5839
+ name: "idValue",
5840
+ label: form.watch("idType") === "product_id" ? "Product ID" : form.watch("idType") === "business_id" ? "Business ID" : form.watch("idType") === "individual_id" ? "Individual ID" : "Account Number",
5841
+ placeholder: "Enter ID value"
5842
+ }
5843
+ ),
5844
+ /* @__PURE__ */ jsxRuntime.jsx(
5845
+ FormInput,
5846
+ {
5847
+ name: "email",
5848
+ label: "Email",
5849
+ type: "email",
5850
+ placeholder: "Enter email address"
5851
+ }
5852
+ ),
5853
+ /* @__PURE__ */ jsxRuntime.jsx(
5854
+ FormInput,
5855
+ {
5856
+ name: "phone",
5857
+ label: "Phone Number",
5858
+ type: "tel",
5859
+ placeholder: "Enter phone number"
5860
+ }
5861
+ ),
5862
+ /* @__PURE__ */ jsxRuntime.jsx(
5863
+ FormInput,
5864
+ {
5865
+ name: "dateOfBirth",
5866
+ label: "Date of Birth",
5867
+ type: "date",
5868
+ placeholder: "Select date of birth"
5869
+ }
5870
+ ),
5871
+ /* @__PURE__ */ jsxRuntime.jsx(
5872
+ FormInput,
5873
+ {
5874
+ name: "idNumber",
5875
+ label: "ID Number",
5876
+ placeholder: "Enter ID number"
5877
+ }
5878
+ )
5879
+ ] }),
5880
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-1 gap-4", children: [
5881
+ /* @__PURE__ */ jsxRuntime.jsx(
5882
+ FormInput,
5883
+ {
5884
+ name: "address.line1",
5885
+ label: "Street Address",
5886
+ placeholder: "Enter street address"
5887
+ }
5888
+ ),
5889
+ /* @__PURE__ */ jsxRuntime.jsx(
5890
+ FormInput,
5891
+ {
5892
+ name: "address.line2",
5893
+ label: "Apartment, suite, or floor",
5894
+ placeholder: "Enter apartment, suite, or floor"
5895
+ }
5896
+ )
5897
+ ] }),
5898
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6", children: [
5899
+ /* @__PURE__ */ jsxRuntime.jsx(
5900
+ FormInput,
5901
+ {
5902
+ name: "address.city",
5903
+ label: "City",
5904
+ placeholder: "Enter city"
5905
+ }
5906
+ ),
5907
+ /* @__PURE__ */ jsxRuntime.jsx(
5908
+ FormInput,
5909
+ {
5910
+ name: "address.state",
5911
+ label: "State",
5912
+ placeholder: "Enter state"
5913
+ }
5914
+ ),
5915
+ /* @__PURE__ */ jsxRuntime.jsx(
5916
+ FormInput,
5917
+ {
5918
+ name: "address.postalCode",
5919
+ label: "Postal Code",
5920
+ placeholder: "Enter postal code"
5921
+ }
5922
+ ),
5923
+ /* @__PURE__ */ jsxRuntime.jsx(
5924
+ FormInput,
5925
+ {
5926
+ name: "address.countryCode",
5927
+ label: "Country Code",
5928
+ placeholder: "e.g., US"
5929
+ }
5930
+ )
5228
5931
  ] })
5229
5932
  ] }) });
5933
+ const formValues = form.watch();
5934
+ const idTypeLabel = formValues?.idType === "product_id" ? "Product ID" : formValues?.idType === "business_id" ? "Business ID" : formValues?.idType === "individual_id" ? "Individual ID" : "Account Number";
5935
+ const getEntityLink = () => {
5936
+ if (!formValues?.idValue) return null;
5937
+ switch (formValues?.idType) {
5938
+ case "business_id":
5939
+ return `/business/${formValues.idValue}`;
5940
+ case "individual_id":
5941
+ return `/individual/${formValues.idValue}`;
5942
+ case "account_number":
5943
+ return `/account/${formValues.idValue}`;
5944
+ default:
5945
+ return null;
5946
+ }
5947
+ };
5948
+ const entityLink = getEntityLink();
5949
+ const viewContent = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-3", children: [
5950
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
5951
+ /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Associated with", value: formValues?.idType === "product_id" ? "Product ID" : formValues?.idType === "business_id" ? "Business ID" : formValues?.idType === "individual_id" ? "Individual ID" : "Account Number", layout: "horizontal" }),
5952
+ /* @__PURE__ */ jsxRuntime.jsx(
5953
+ InfoField,
5954
+ {
5955
+ label: idTypeLabel,
5956
+ value: entityLink ? /* @__PURE__ */ jsxRuntime.jsx(
5957
+ "button",
5958
+ {
5959
+ onClick: (e) => {
5960
+ e.preventDefault();
5961
+ navigate(entityLink);
5962
+ },
5963
+ className: "text-primary hover:underline font-medium text-left cursor-pointer",
5964
+ children: formValues?.idValue || "-"
5965
+ }
5966
+ ) : formValues?.idValue || "-",
5967
+ layout: "horizontal"
5968
+ }
5969
+ )
5970
+ ] }),
5971
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
5972
+ /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Email", value: formValues?.email || "-", layout: "horizontal" }),
5973
+ /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Phone Number", value: formValues?.phone || "-", layout: "horizontal" })
5974
+ ] }),
5975
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
5976
+ /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Date of Birth", value: formValues?.dateOfBirth || "-", layout: "horizontal" }),
5977
+ /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "ID Number", value: formValues?.idNumber || "-", layout: "horizontal" })
5978
+ ] }),
5979
+ /* @__PURE__ */ jsxRuntime.jsx(
5980
+ InfoField,
5981
+ {
5982
+ label: "Address",
5983
+ value: formValues?.address ? `${formValues.address.line1 || ""}${formValues.address.line2 ? ", " + formValues.address.line2 : ""}, ${formValues.address.city || ""}, ${formValues.address.state || ""} ${formValues.address.postalCode || ""}, ${formValues.address.countryCode || ""}` : "-",
5984
+ layout: "horizontal"
5985
+ }
5986
+ )
5987
+ ] });
5988
+ return /* @__PURE__ */ jsxRuntime.jsx(
5989
+ EditableFormCard,
5990
+ {
5991
+ title: "Profile Information",
5992
+ variant: "subtle",
5993
+ className,
5994
+ isEditing: form.isEditing,
5995
+ onToggleEdit: form.handleToggleEdit,
5996
+ onSave: form.handleSave,
5997
+ onCancel: form.handleCancel,
5998
+ hideActions,
5999
+ editContent,
6000
+ viewContent
6001
+ }
6002
+ );
5230
6003
  };
5231
- var CreateBusinessView = ({
5232
- form,
5233
- businessType,
5234
- onBusinessTypeChange,
5235
- onSubmit,
5236
- onCancel
5237
- }) => {
6004
+ var mockCounterpartyTimeline = [
6005
+ {
6006
+ id: "1",
6007
+ action: "Counterparty Created",
6008
+ user: "admin",
6009
+ details: "Initial counterparty setup",
6010
+ status: "Active",
6011
+ timestamp: "2024-01-15 10:30:00"
6012
+ },
6013
+ {
6014
+ id: "2",
6015
+ action: "Profile Updated",
6016
+ user: "admin",
6017
+ details: "Updated counterparty information",
6018
+ timestamp: "2024-01-20 14:22:00"
6019
+ },
6020
+ {
6021
+ id: "3",
6022
+ action: "OFAC Check Completed",
6023
+ user: "System",
6024
+ details: "Automated compliance check",
6025
+ status: "Verified",
6026
+ timestamp: "2024-01-20 14:30:00"
6027
+ }
6028
+ ];
6029
+ var CounterpartyStatusCard = ({ isEditing, onToggleEdit, className }) => {
6030
+ const getIcon = (action) => {
6031
+ if (action.includes("Created")) return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Circle, { className: "h-4 w-4" });
6032
+ if (action.includes("Assigned")) return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.UserPlus, { className: "h-4 w-4" });
6033
+ if (action.includes("Updated") || action.includes("Modified") || action.includes("Check")) return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Edit, { className: "h-4 w-4" });
6034
+ if (action.includes("Completed") || action.includes("Verified")) return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CheckCircle, { className: "h-4 w-4" });
6035
+ return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Circle, { className: "h-4 w-4" });
6036
+ };
6037
+ const getStatusColor2 = (status) => {
6038
+ switch (status) {
6039
+ case "Active":
6040
+ case "Verified":
6041
+ return "text-success";
6042
+ case "Pending":
6043
+ return "text-warning";
6044
+ default:
6045
+ return "text-muted-foreground";
6046
+ }
6047
+ };
5238
6048
  return /* @__PURE__ */ jsxRuntime.jsx(
5239
- PageLayout,
6049
+ FormCard,
5240
6050
  {
5241
- title: "Create Business",
5242
- actions: [
5243
- { label: "Cancel", variant: "outline", onClick: onCancel },
5244
- { label: "Create Business", variant: "default", onClick: form.handleSubmit(onSubmit) }
5245
- ],
5246
- children: /* @__PURE__ */ jsxRuntime.jsx(
5247
- BusinessForm,
5248
- {
5249
- form,
5250
- businessType,
5251
- onBusinessTypeChange,
5252
- onSubmit
5253
- }
5254
- )
6051
+ title: "Timeline",
6052
+ className,
6053
+ children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-3", children: mockCounterpartyTimeline.map((event, index) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative pl-6 pb-3", children: [
6054
+ index !== mockCounterpartyTimeline.length - 1 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute left-[7px] top-5 bottom-0 w-[2px] bg-border" }),
6055
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(
6056
+ "absolute left-0 top-0 flex-none",
6057
+ getStatusColor2(event.status)
6058
+ ), children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-4 w-4", children: getIcon(event.action) }) }),
6059
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-0.5", children: [
6060
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs font-medium text-foreground", children: event.action }),
6061
+ /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-xs text-muted-foreground", children: [
6062
+ "by ",
6063
+ event.user
6064
+ ] }),
6065
+ event.details && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground", children: event.details }),
6066
+ event.status && /* @__PURE__ */ jsxRuntime.jsxs("p", { className: cn("text-xs font-medium", getStatusColor2(event.status)), children: [
6067
+ "Status: ",
6068
+ event.status
6069
+ ] }),
6070
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground/70 pt-0.5", children: event.timestamp })
6071
+ ] })
6072
+ ] }, event.id)) })
5255
6073
  }
5256
6074
  );
5257
6075
  };
5258
- var CounterpartyFiltersSheet = ({
5259
- filters,
5260
- onFilterChange,
5261
- onResetFilters
6076
+ var typeConfig2 = {
6077
+ BUSINESS: {
6078
+ variant: "business",
6079
+ label: "Business",
6080
+ icon: lucideReact.Building2
6081
+ },
6082
+ INDIVIDUAL: {
6083
+ variant: "individual",
6084
+ label: "Individual",
6085
+ icon: lucideReact.User
6086
+ }
6087
+ };
6088
+ var CounterpartyTypeBadge = ({ type, className }) => {
6089
+ const config = typeConfig2[type];
6090
+ if (!config) {
6091
+ return /* @__PURE__ */ jsxRuntime.jsxs(Badge, { variant: "secondary", className, children: [
6092
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Building2, { className: "w-3 h-3 mr-1" }),
6093
+ type || "Unknown"
6094
+ ] });
6095
+ }
6096
+ const Icon2 = config.icon;
6097
+ return /* @__PURE__ */ jsxRuntime.jsxs(Badge, { variant: config.variant, className, children: [
6098
+ /* @__PURE__ */ jsxRuntime.jsx(Icon2, { className: "w-3 h-3 mr-1" }),
6099
+ config.label
6100
+ ] });
6101
+ };
6102
+ var PaymentMethodCard = ({
6103
+ type,
6104
+ fiId,
6105
+ accountNumber,
6106
+ bankName,
6107
+ accountType,
6108
+ beneficiaryBankName,
6109
+ correspondentBankId,
6110
+ intermediaryBankId,
6111
+ className
5262
6112
  }) => {
5263
- const [localFilters, setLocalFilters] = React15.useState(filters);
5264
- const [open, setOpen] = React15.useState(false);
5265
- React15.useEffect(() => {
5266
- setLocalFilters(filters);
5267
- }, [filters]);
5268
- const handleLocalFilterChange = (field, value) => {
5269
- setLocalFilters((prev) => ({ ...prev, [field]: value }));
5270
- };
5271
- const handleApplyFilters = () => {
5272
- Object.entries(localFilters).forEach(([key, value]) => {
5273
- onFilterChange(key, value);
5274
- });
5275
- setOpen(false);
5276
- };
5277
- const handleResetFilters = () => {
5278
- const resetFilters = {
5279
- name: "",
5280
- type: "",
5281
- status: "",
5282
- createdDateStart: void 0,
5283
- createdDateEnd: void 0
5284
- };
5285
- setLocalFilters(resetFilters);
5286
- onResetFilters();
5287
- setOpen(false);
6113
+ const getIcon = () => {
6114
+ switch (type) {
6115
+ case "ACH":
6116
+ return lucideReact.Building2;
6117
+ case "Domestic Wire":
6118
+ return lucideReact.Landmark;
6119
+ case "International Wire":
6120
+ return lucideReact.Globe;
6121
+ default:
6122
+ return lucideReact.Building2;
6123
+ }
5288
6124
  };
5289
- return /* @__PURE__ */ jsxRuntime.jsxs(Sheet, { open, onOpenChange: setOpen, children: [
5290
- /* @__PURE__ */ jsxRuntime.jsx(SheetTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(Button, { variant: "outline", className: "gap-2", children: [
5291
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Filter, { className: "h-4 w-4" }),
5292
- "Filters"
5293
- ] }) }),
5294
- /* @__PURE__ */ jsxRuntime.jsxs(SheetContent, { side: "right", className: "w-full sm:max-w-xl overflow-y-auto", children: [
5295
- /* @__PURE__ */ jsxRuntime.jsx(SheetHeader, { children: /* @__PURE__ */ jsxRuntime.jsx(SheetTitle, { children: "Counterparty Filters" }) }),
5296
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-6 py-6", children: [
5297
- /* @__PURE__ */ jsxRuntime.jsx(
5298
- EnhancedInput,
5299
- {
5300
- label: "Name",
5301
- value: localFilters.name,
5302
- onChange: (e) => handleLocalFilterChange("name", e.target.value),
5303
- placeholder: "Enter counterparty name"
5304
- }
5305
- ),
5306
- /* @__PURE__ */ jsxRuntime.jsx(
5307
- EnhancedSelect,
5308
- {
5309
- label: "Type",
5310
- value: localFilters.type,
5311
- onValueChange: (value) => handleLocalFilterChange("type", value),
5312
- placeholder: "Select type",
5313
- options: [
5314
- { value: "BUSINESS", label: "Business" },
5315
- { value: "INDIVIDUAL", label: "Individual" }
5316
- ]
5317
- }
5318
- ),
5319
- /* @__PURE__ */ jsxRuntime.jsx(
5320
- EnhancedSelect,
5321
- {
5322
- label: "Status",
5323
- value: localFilters.status,
5324
- onValueChange: (value) => handleLocalFilterChange("status", value),
5325
- placeholder: "Select status",
5326
- options: [
5327
- { value: "ACTIVE", label: "Active" },
5328
- { value: "INACTIVE", label: "Inactive" },
5329
- { value: "PENDING", label: "Pending" },
5330
- { value: "SUSPENDED", label: "Suspended" }
5331
- ]
5332
- }
5333
- ),
5334
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
5335
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
5336
- /* @__PURE__ */ jsxRuntime.jsx("label", { className: "text-sm font-medium", children: "Created Date Start" }),
5337
- /* @__PURE__ */ jsxRuntime.jsx(
5338
- DatePicker,
5339
- {
5340
- date: localFilters.createdDateStart,
5341
- onDateChange: (date) => handleLocalFilterChange("createdDateStart", date),
5342
- placeholder: "MM/DD/YYYY",
5343
- buttonClassName: "w-full",
5344
- className: "bg-background z-50"
5345
- }
5346
- )
5347
- ] }),
5348
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
5349
- /* @__PURE__ */ jsxRuntime.jsx("label", { className: "text-sm font-medium", children: "Created Date End" }),
5350
- /* @__PURE__ */ jsxRuntime.jsx(
5351
- DatePicker,
5352
- {
5353
- date: localFilters.createdDateEnd,
5354
- onDateChange: (date) => handleLocalFilterChange("createdDateEnd", date),
5355
- placeholder: "MM/DD/YYYY",
5356
- buttonClassName: "w-full",
5357
- className: "bg-background z-50"
5358
- }
5359
- )
5360
- ] })
5361
- ] })
6125
+ const Icon2 = getIcon();
6126
+ return /* @__PURE__ */ jsxRuntime.jsxs(Card, { className: cn("hover:bg-muted/50 transition-colors", className), children: [
6127
+ /* @__PURE__ */ jsxRuntime.jsxs(CardHeader, { className: "flex flex-row items-start justify-between space-y-0 pb-3", children: [
6128
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
6129
+ /* @__PURE__ */ jsxRuntime.jsx(Icon2, { className: "h-4 w-4 text-muted-foreground" }),
6130
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium text-sm", children: type })
5362
6131
  ] }),
5363
- /* @__PURE__ */ jsxRuntime.jsxs(SheetFooter, { className: "flex gap-2", children: [
5364
- /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "outline", onClick: handleResetFilters, className: "flex-1", children: "Reset Filters" }),
5365
- /* @__PURE__ */ jsxRuntime.jsx(Button, { onClick: handleApplyFilters, className: "flex-1", children: "Apply Filters" })
6132
+ /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "ghost", size: "sm", className: "h-8 w-8 p-0", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MoreVertical, { className: "h-4 w-4" }) })
6133
+ ] }),
6134
+ /* @__PURE__ */ jsxRuntime.jsxs(CardContent, { className: "space-y-3", children: [
6135
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-3", children: [
6136
+ /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Beneficiary FI ID", value: fiId }),
6137
+ /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Account Number", value: accountNumber })
6138
+ ] }),
6139
+ type === "ACH" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-3", children: [
6140
+ bankName && /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Bank Name", value: bankName }),
6141
+ accountType && /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Account Type", value: accountType })
6142
+ ] }),
6143
+ type === "Domestic Wire" && bankName && /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Bank Name", value: bankName }),
6144
+ type === "International Wire" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-3", children: [
6145
+ beneficiaryBankName && /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Beneficiary Bank Name", value: beneficiaryBankName }),
6146
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-3", children: [
6147
+ correspondentBankId && /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Correspondent Bank ID", value: correspondentBankId }),
6148
+ intermediaryBankId && /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Intermediary Bank ID", value: intermediaryBankId })
6149
+ ] })
5366
6150
  ] })
5367
6151
  ] })
5368
6152
  ] });
5369
6153
  };
5370
- var CounterpartiesView = ({
5371
- table,
5372
- filters,
5373
- onFilterChange,
5374
- onResetFilters,
5375
- onCreateCounterparty
6154
+ var typeClasses = {
6155
+ cards: "grid-cols-1 md:grid-cols-2 lg:grid-cols-3",
6156
+ forms: "grid-cols-1 lg:grid-cols-2",
6157
+ data: "grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",
6158
+ custom: ""
6159
+ };
6160
+ var gapClasses = {
6161
+ sm: "gap-3",
6162
+ md: "gap-4",
6163
+ lg: "gap-6",
6164
+ xl: "gap-8"
6165
+ };
6166
+ var ResponsiveGrid = React15__namespace.forwardRef(
6167
+ ({ children, type = "cards", gap = "md", editMode = false, className }, ref) => {
6168
+ const gridClasses2 = editMode ? "grid-cols-1" : typeClasses[type];
6169
+ return /* @__PURE__ */ jsxRuntime.jsx(
6170
+ "div",
6171
+ {
6172
+ ref,
6173
+ className: cn(
6174
+ "grid",
6175
+ gridClasses2,
6176
+ gapClasses[gap],
6177
+ className
6178
+ ),
6179
+ children
6180
+ }
6181
+ );
6182
+ }
6183
+ );
6184
+ ResponsiveGrid.displayName = "ResponsiveGrid";
6185
+ var CounterpartyDetailView = ({
6186
+ counterpartyName,
6187
+ counterpartyType,
6188
+ currentStatus,
6189
+ isEditingProfile,
6190
+ mockPaymentMethods: mockPaymentMethods2,
6191
+ documentsTable,
6192
+ onStatusChange,
6193
+ onToggleProfileEdit,
6194
+ onAddPaymentMethod,
6195
+ onAddDocument
5376
6196
  }) => {
5377
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col h-screen bg-gradient-subtle", children: [
5378
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-none border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "container mx-auto px-4 py-6 max-w-none", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
5379
- /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-3xl font-bold text-foreground", children: "Counterparties" }) }),
5380
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
6197
+ return /* @__PURE__ */ jsxRuntime.jsx(
6198
+ PageLayout,
6199
+ {
6200
+ title: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3", children: [
6201
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: counterpartyName }),
5381
6202
  /* @__PURE__ */ jsxRuntime.jsx(
5382
- CounterpartyFiltersSheet,
6203
+ EditableInfoField,
5383
6204
  {
5384
- filters,
5385
- onFilterChange,
5386
- onResetFilters
6205
+ label: "",
6206
+ value: currentStatus,
6207
+ options: [
6208
+ { value: "ACTIVE", label: "Active" },
6209
+ { value: "INACTIVE", label: "Inactive" },
6210
+ { value: "PENDING", label: "Pending" },
6211
+ { value: "SUSPENDED", label: "Suspended" }
6212
+ ],
6213
+ onChange: onStatusChange,
6214
+ renderValue: (value) => /* @__PURE__ */ jsxRuntime.jsx(StatusBadge, { status: value }),
6215
+ className: "inline-block"
5387
6216
  }
5388
6217
  ),
5389
- /* @__PURE__ */ jsxRuntime.jsx(Button, { onClick: onCreateCounterparty, children: "Create Counterparty" })
6218
+ /* @__PURE__ */ jsxRuntime.jsx(CounterpartyTypeBadge, { type: counterpartyType })
6219
+ ] }),
6220
+ maxWidth: "full",
6221
+ children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col lg:flex-row items-start gap-4", children: [
6222
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 space-y-4", children: [
6223
+ /* @__PURE__ */ jsxRuntime.jsx(
6224
+ CounterpartyProfileCard,
6225
+ {
6226
+ isEditing: isEditingProfile,
6227
+ onToggleEdit: onToggleProfileEdit
6228
+ }
6229
+ ),
6230
+ /* @__PURE__ */ jsxRuntime.jsxs(Card, { children: [
6231
+ /* @__PURE__ */ jsxRuntime.jsxs(CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-4", children: [
6232
+ /* @__PURE__ */ jsxRuntime.jsx(CardTitle, { children: "Payment Methods" }),
6233
+ /* @__PURE__ */ jsxRuntime.jsxs(Button, { size: "sm", variant: "ghost", onClick: onAddPaymentMethod, children: [
6234
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Plus, { className: "h-4 w-4 mr-1" }),
6235
+ "Method"
6236
+ ] })
6237
+ ] }),
6238
+ /* @__PURE__ */ jsxRuntime.jsx(CardContent, { children: mockPaymentMethods2.length === 0 ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-center gap-2 py-4 text-sm text-muted-foreground", children: [
6239
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Wallet, { className: "h-5 w-5 opacity-50" }),
6240
+ /* @__PURE__ */ jsxRuntime.jsx("p", { children: "No payment methods configured" })
6241
+ ] }) : /* @__PURE__ */ jsxRuntime.jsx(ResponsiveGrid, { type: "forms", gap: "md", children: mockPaymentMethods2.map((method, index) => /* @__PURE__ */ jsxRuntime.jsx(PaymentMethodCard, { ...method }, index)) }) })
6242
+ ] }),
6243
+ /* @__PURE__ */ jsxRuntime.jsxs(Card, { children: [
6244
+ /* @__PURE__ */ jsxRuntime.jsxs(CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-4", children: [
6245
+ /* @__PURE__ */ jsxRuntime.jsx(CardTitle, { children: "Documents" }),
6246
+ /* @__PURE__ */ jsxRuntime.jsxs(Button, { size: "sm", variant: "ghost", onClick: onAddDocument, children: [
6247
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Plus, { className: "h-4 w-4 mr-1" }),
6248
+ "Document"
6249
+ ] })
6250
+ ] }),
6251
+ /* @__PURE__ */ jsxRuntime.jsx(CardContent, { children: documentsTable })
6252
+ ] })
6253
+ ] }),
6254
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "lg:w-64", children: /* @__PURE__ */ jsxRuntime.jsx(CounterpartyStatusCard, { isEditing: false, onToggleEdit: () => {
6255
+ } }) })
5390
6256
  ] })
5391
- ] }) }) }),
5392
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "container mx-auto px-4 h-full max-w-none flex flex-col", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 mt-4 overflow-auto", children: table }) }) })
5393
- ] });
6257
+ }
6258
+ );
5394
6259
  };
5395
6260
 
5396
6261
  // src/lib/mock-data/banking-data.ts
@@ -5553,37 +6418,6 @@ var ACHBasicInfoCard = ({
5553
6418
  }
5554
6419
  );
5555
6420
  };
5556
- var typeClasses = {
5557
- cards: "grid-cols-1 md:grid-cols-2 lg:grid-cols-3",
5558
- forms: "grid-cols-1 lg:grid-cols-2",
5559
- data: "grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",
5560
- custom: ""
5561
- };
5562
- var gapClasses = {
5563
- sm: "gap-3",
5564
- md: "gap-4",
5565
- lg: "gap-6",
5566
- xl: "gap-8"
5567
- };
5568
- var ResponsiveGrid = React15__namespace.forwardRef(
5569
- ({ children, type = "cards", gap = "md", editMode = false, className }, ref) => {
5570
- const gridClasses2 = editMode ? "grid-cols-1" : typeClasses[type];
5571
- return /* @__PURE__ */ jsxRuntime.jsx(
5572
- "div",
5573
- {
5574
- ref,
5575
- className: cn(
5576
- "grid",
5577
- gridClasses2,
5578
- gapClasses[gap],
5579
- className
5580
- ),
5581
- children
5582
- }
5583
- );
5584
- }
5585
- );
5586
- ResponsiveGrid.displayName = "ResponsiveGrid";
5587
6421
  var BankAddressCard = ({
5588
6422
  data,
5589
6423
  onDataChange,
@@ -5800,329 +6634,84 @@ var BankingDetailsCard = ({ isEditing, onToggleEdit, className }) => {
5800
6634
  }
5801
6635
  );
5802
6636
  };
5803
- var typeConfig2 = {
5804
- BUSINESS: {
5805
- variant: "business",
5806
- label: "Business",
5807
- icon: lucideReact.Building2
5808
- },
5809
- INDIVIDUAL: {
5810
- variant: "individual",
5811
- label: "Individual",
5812
- icon: lucideReact.User
5813
- }
5814
- };
5815
- var CounterpartyTypeBadge = ({ type, className }) => {
5816
- const config = typeConfig2[type];
5817
- if (!config) {
5818
- return /* @__PURE__ */ jsxRuntime.jsxs(Badge, { variant: "secondary", className, children: [
5819
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Building2, { className: "w-3 h-3 mr-1" }),
5820
- type || "Unknown"
5821
- ] });
5822
- }
5823
- const Icon2 = config.icon;
5824
- return /* @__PURE__ */ jsxRuntime.jsxs(Badge, { variant: config.variant, className, children: [
5825
- /* @__PURE__ */ jsxRuntime.jsx(Icon2, { className: "w-3 h-3 mr-1" }),
5826
- config.label
5827
- ] });
5828
- };
5829
6637
  var BasicInfoCard = ({ isEditing, onToggleEdit, className, hideActions }) => {
5830
6638
  const [name, setName] = React15.useState("John wire hot");
5831
- const [status, setStatus] = React15.useState("ACTIVE");
5832
- const editContent = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-6", children: [
5833
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6", children: [
5834
- /* @__PURE__ */ jsxRuntime.jsx(
5835
- EnhancedInput,
5836
- {
5837
- label: "Name",
5838
- value: name,
5839
- onChange: (e) => setName(e.target.value),
5840
- placeholder: "Enter counterparty name"
5841
- }
5842
- ),
5843
- /* @__PURE__ */ jsxRuntime.jsx(
5844
- EnhancedSelect,
5845
- {
5846
- label: "Status",
5847
- value: status,
5848
- onValueChange: setStatus,
5849
- placeholder: "Select status",
5850
- options: [
5851
- { value: "ACTIVE", label: "Active" },
5852
- { value: "INACTIVE", label: "Inactive" },
5853
- { value: "PENDING", label: "Pending" },
5854
- { value: "SUSPENDED", label: "Suspended" }
5855
- ]
5856
- }
5857
- )
5858
- ] }),
5859
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4 pt-4 border-t border-border", children: [
5860
- /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "ID", value: "5000541", layout: "horizontal" }),
5861
- /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Counterparty Type", value: /* @__PURE__ */ jsxRuntime.jsx(CounterpartyTypeBadge, { type: "BUSINESS" }), layout: "horizontal" }),
5862
- /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "ID Number", value: "\u2022\u2022\u2022\u2022\u2022\u2022\u2022", layout: "horizontal" }),
5863
- /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "ID Type", value: "SSN", layout: "horizontal" }),
5864
- /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Date of Birth", value: "1985-8-20", layout: "horizontal" }),
5865
- /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Created By", value: "admin", layout: "horizontal" }),
5866
- /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Created At", value: "2025-07-14", layout: "horizontal" }),
5867
- /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Updated By", value: "admin", layout: "horizontal" }),
5868
- /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Updated At", value: "2025-07-14", layout: "horizontal" })
5869
- ] }),
5870
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "pt-3 border-t border-border", children: [
5871
- /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "text-sm font-medium text-foreground mb-2", children: "OFAC Details" }),
5872
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
5873
- /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Last OFAC date", value: "2025-07-14", layout: "horizontal" }),
5874
- /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Last OFAC status", value: "Verified", layout: "horizontal" })
5875
- ] })
5876
- ] })
5877
- ] });
5878
- const viewContent = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
5879
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
5880
- /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "ID", value: "5000541", layout: "horizontal" }),
5881
- /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Name", value: name, layout: "horizontal" }),
5882
- /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Counterparty Type", value: /* @__PURE__ */ jsxRuntime.jsx(CounterpartyTypeBadge, { type: "BUSINESS" }), layout: "horizontal" }),
5883
- /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Status", value: /* @__PURE__ */ jsxRuntime.jsx(StatusBadge, { status }), layout: "horizontal" }),
5884
- /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "ID Number", value: "\u2022\u2022\u2022\u2022\u2022\u2022\u2022", layout: "horizontal" }),
5885
- /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "ID Type", value: "SSN", layout: "horizontal" }),
5886
- /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Date of Birth", value: "1985-8-20", layout: "horizontal" }),
5887
- /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Created By", value: "admin", layout: "horizontal" }),
5888
- /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Created At", value: "2025-07-14", layout: "horizontal" }),
5889
- /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Updated By", value: "admin", layout: "horizontal" }),
5890
- /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Updated At", value: "2025-07-14", layout: "horizontal" })
5891
- ] }),
5892
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "pt-3 border-t border-border", children: [
5893
- /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "text-sm font-medium text-foreground mb-2", children: "OFAC Details" }),
5894
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
5895
- /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Last OFAC date", value: "2025-07-14", layout: "horizontal" }),
5896
- /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Last OFAC status", value: "Verified", layout: "horizontal" })
5897
- ] })
5898
- ] })
5899
- ] });
5900
- return /* @__PURE__ */ jsxRuntime.jsx(
5901
- EditableFormCard,
5902
- {
5903
- title: "Basic Info",
5904
- className,
5905
- isEditing,
5906
- onToggleEdit,
5907
- hideActions,
5908
- editContent,
5909
- viewContent
5910
- }
5911
- );
5912
- };
5913
-
5914
- // src/lib/mock-data/counterparty-data.ts
5915
- var defaultCounterpartyDetail = {
5916
- email: "contact@acme.com",
5917
- phone: "+1 (555) 123-4567",
5918
- dateOfBirth: "1985-03-15",
5919
- idNumber: "ID-123456789",
5920
- idType: "product_id",
5921
- idValue: "PROD-001",
5922
- address: {
5923
- line1: "123 Business Ave",
5924
- line2: "Suite 100",
5925
- city: "New York",
5926
- state: "NY",
5927
- postalCode: "10001",
5928
- countryCode: "US",
5929
- type: "MAILING"
5930
- }
5931
- };
5932
- var CounterpartyProfileCard = ({
5933
- data,
5934
- onDataChange,
5935
- isEditing = false,
5936
- onToggleEdit,
5937
- hideActions = false,
5938
- className
5939
- }) => {
5940
- const navigate = reactRouterDom.useNavigate();
5941
- const form = useFormWithEditState({
5942
- schema: counterpartyDetailSchema,
5943
- defaultValues: { ...defaultCounterpartyDetail, ...data },
5944
- initialEditing: isEditing,
5945
- onToggleEdit,
5946
- onSave: onDataChange
5947
- });
5948
- const editContent = /* @__PURE__ */ jsxRuntime.jsx(FormProvider, { form, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
6639
+ const [status, setStatus] = React15.useState("ACTIVE");
6640
+ const editContent = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-6", children: [
5949
6641
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6", children: [
5950
6642
  /* @__PURE__ */ jsxRuntime.jsx(
5951
- FormSelect,
5952
- {
5953
- name: "idType",
5954
- label: "Associated with",
5955
- placeholder: "Select association type",
5956
- options: [
5957
- { value: "product_id", label: "Product ID" },
5958
- { value: "business_id", label: "Business ID" },
5959
- { value: "individual_id", label: "Individual ID" },
5960
- { value: "account_number", label: "Account Number" }
5961
- ]
5962
- }
5963
- ),
5964
- /* @__PURE__ */ jsxRuntime.jsx(
5965
- FormInput,
5966
- {
5967
- name: "idValue",
5968
- label: form.watch("idType") === "product_id" ? "Product ID" : form.watch("idType") === "business_id" ? "Business ID" : form.watch("idType") === "individual_id" ? "Individual ID" : "Account Number",
5969
- placeholder: "Enter ID value"
5970
- }
5971
- ),
5972
- /* @__PURE__ */ jsxRuntime.jsx(
5973
- FormInput,
5974
- {
5975
- name: "email",
5976
- label: "Email",
5977
- type: "email",
5978
- placeholder: "Enter email address"
5979
- }
5980
- ),
5981
- /* @__PURE__ */ jsxRuntime.jsx(
5982
- FormInput,
5983
- {
5984
- name: "phone",
5985
- label: "Phone Number",
5986
- type: "tel",
5987
- placeholder: "Enter phone number"
5988
- }
5989
- ),
5990
- /* @__PURE__ */ jsxRuntime.jsx(
5991
- FormInput,
6643
+ EnhancedInput,
5992
6644
  {
5993
- name: "dateOfBirth",
5994
- label: "Date of Birth",
5995
- type: "date",
5996
- placeholder: "Select date of birth"
6645
+ label: "Name",
6646
+ value: name,
6647
+ onChange: (e) => setName(e.target.value),
6648
+ placeholder: "Enter counterparty name"
5997
6649
  }
5998
6650
  ),
5999
6651
  /* @__PURE__ */ jsxRuntime.jsx(
6000
- FormInput,
6652
+ EnhancedSelect,
6001
6653
  {
6002
- name: "idNumber",
6003
- label: "ID Number",
6004
- placeholder: "Enter ID number"
6654
+ label: "Status",
6655
+ value: status,
6656
+ onValueChange: setStatus,
6657
+ placeholder: "Select status",
6658
+ options: [
6659
+ { value: "ACTIVE", label: "Active" },
6660
+ { value: "INACTIVE", label: "Inactive" },
6661
+ { value: "PENDING", label: "Pending" },
6662
+ { value: "SUSPENDED", label: "Suspended" }
6663
+ ]
6005
6664
  }
6006
6665
  )
6007
6666
  ] }),
6008
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-1 gap-4", children: [
6009
- /* @__PURE__ */ jsxRuntime.jsx(
6010
- FormInput,
6011
- {
6012
- name: "address.line1",
6013
- label: "Street Address",
6014
- placeholder: "Enter street address"
6015
- }
6016
- ),
6017
- /* @__PURE__ */ jsxRuntime.jsx(
6018
- FormInput,
6019
- {
6020
- name: "address.line2",
6021
- label: "Apartment, suite, or floor",
6022
- placeholder: "Enter apartment, suite, or floor"
6023
- }
6024
- )
6667
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4 pt-4 border-t border-border", children: [
6668
+ /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "ID", value: "5000541", layout: "horizontal" }),
6669
+ /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Counterparty Type", value: /* @__PURE__ */ jsxRuntime.jsx(CounterpartyTypeBadge, { type: "BUSINESS" }), layout: "horizontal" }),
6670
+ /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "ID Number", value: "\u2022\u2022\u2022\u2022\u2022\u2022\u2022", layout: "horizontal" }),
6671
+ /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "ID Type", value: "SSN", layout: "horizontal" }),
6672
+ /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Date of Birth", value: "1985-8-20", layout: "horizontal" }),
6673
+ /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Created By", value: "admin", layout: "horizontal" }),
6674
+ /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Created At", value: "2025-07-14", layout: "horizontal" }),
6675
+ /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Updated By", value: "admin", layout: "horizontal" }),
6676
+ /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Updated At", value: "2025-07-14", layout: "horizontal" })
6025
6677
  ] }),
6026
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6", children: [
6027
- /* @__PURE__ */ jsxRuntime.jsx(
6028
- FormInput,
6029
- {
6030
- name: "address.city",
6031
- label: "City",
6032
- placeholder: "Enter city"
6033
- }
6034
- ),
6035
- /* @__PURE__ */ jsxRuntime.jsx(
6036
- FormInput,
6037
- {
6038
- name: "address.state",
6039
- label: "State",
6040
- placeholder: "Enter state"
6041
- }
6042
- ),
6043
- /* @__PURE__ */ jsxRuntime.jsx(
6044
- FormInput,
6045
- {
6046
- name: "address.postalCode",
6047
- label: "Postal Code",
6048
- placeholder: "Enter postal code"
6049
- }
6050
- ),
6051
- /* @__PURE__ */ jsxRuntime.jsx(
6052
- FormInput,
6053
- {
6054
- name: "address.countryCode",
6055
- label: "Country Code",
6056
- placeholder: "e.g., US"
6057
- }
6058
- )
6678
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "pt-3 border-t border-border", children: [
6679
+ /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "text-sm font-medium text-foreground mb-2", children: "OFAC Details" }),
6680
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
6681
+ /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Last OFAC date", value: "2025-07-14", layout: "horizontal" }),
6682
+ /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Last OFAC status", value: "Verified", layout: "horizontal" })
6683
+ ] })
6059
6684
  ] })
6060
- ] }) });
6061
- const formValues = form.watch();
6062
- const idTypeLabel = formValues?.idType === "product_id" ? "Product ID" : formValues?.idType === "business_id" ? "Business ID" : formValues?.idType === "individual_id" ? "Individual ID" : "Account Number";
6063
- const getEntityLink = () => {
6064
- if (!formValues?.idValue) return null;
6065
- switch (formValues?.idType) {
6066
- case "business_id":
6067
- return `/business/${formValues.idValue}`;
6068
- case "individual_id":
6069
- return `/individual/${formValues.idValue}`;
6070
- case "account_number":
6071
- return `/account/${formValues.idValue}`;
6072
- default:
6073
- return null;
6074
- }
6075
- };
6076
- const entityLink = getEntityLink();
6077
- const viewContent = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-3", children: [
6078
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
6079
- /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Associated with", value: formValues?.idType === "product_id" ? "Product ID" : formValues?.idType === "business_id" ? "Business ID" : formValues?.idType === "individual_id" ? "Individual ID" : "Account Number", layout: "horizontal" }),
6080
- /* @__PURE__ */ jsxRuntime.jsx(
6081
- InfoField,
6082
- {
6083
- label: idTypeLabel,
6084
- value: entityLink ? /* @__PURE__ */ jsxRuntime.jsx(
6085
- "button",
6086
- {
6087
- onClick: (e) => {
6088
- e.preventDefault();
6089
- navigate(entityLink);
6090
- },
6091
- className: "text-primary hover:underline font-medium text-left cursor-pointer",
6092
- children: formValues?.idValue || "-"
6093
- }
6094
- ) : formValues?.idValue || "-",
6095
- layout: "horizontal"
6096
- }
6097
- )
6098
- ] }),
6099
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
6100
- /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Email", value: formValues?.email || "-", layout: "horizontal" }),
6101
- /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Phone Number", value: formValues?.phone || "-", layout: "horizontal" })
6102
- ] }),
6685
+ ] });
6686
+ const viewContent = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
6103
6687
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
6104
- /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Date of Birth", value: formValues?.dateOfBirth || "-", layout: "horizontal" }),
6105
- /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "ID Number", value: formValues?.idNumber || "-", layout: "horizontal" })
6688
+ /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "ID", value: "5000541", layout: "horizontal" }),
6689
+ /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Name", value: name, layout: "horizontal" }),
6690
+ /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Counterparty Type", value: /* @__PURE__ */ jsxRuntime.jsx(CounterpartyTypeBadge, { type: "BUSINESS" }), layout: "horizontal" }),
6691
+ /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Status", value: /* @__PURE__ */ jsxRuntime.jsx(StatusBadge, { status }), layout: "horizontal" }),
6692
+ /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "ID Number", value: "\u2022\u2022\u2022\u2022\u2022\u2022\u2022", layout: "horizontal" }),
6693
+ /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "ID Type", value: "SSN", layout: "horizontal" }),
6694
+ /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Date of Birth", value: "1985-8-20", layout: "horizontal" }),
6695
+ /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Created By", value: "admin", layout: "horizontal" }),
6696
+ /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Created At", value: "2025-07-14", layout: "horizontal" }),
6697
+ /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Updated By", value: "admin", layout: "horizontal" }),
6698
+ /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Updated At", value: "2025-07-14", layout: "horizontal" })
6106
6699
  ] }),
6107
- /* @__PURE__ */ jsxRuntime.jsx(
6108
- InfoField,
6109
- {
6110
- label: "Address",
6111
- value: formValues?.address ? `${formValues.address.line1 || ""}${formValues.address.line2 ? ", " + formValues.address.line2 : ""}, ${formValues.address.city || ""}, ${formValues.address.state || ""} ${formValues.address.postalCode || ""}, ${formValues.address.countryCode || ""}` : "-",
6112
- layout: "horizontal"
6113
- }
6114
- )
6700
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "pt-3 border-t border-border", children: [
6701
+ /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "text-sm font-medium text-foreground mb-2", children: "OFAC Details" }),
6702
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
6703
+ /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Last OFAC date", value: "2025-07-14", layout: "horizontal" }),
6704
+ /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Last OFAC status", value: "Verified", layout: "horizontal" })
6705
+ ] })
6706
+ ] })
6115
6707
  ] });
6116
6708
  return /* @__PURE__ */ jsxRuntime.jsx(
6117
6709
  EditableFormCard,
6118
6710
  {
6119
- title: "Profile Information",
6120
- variant: "subtle",
6711
+ title: "Basic Info",
6121
6712
  className,
6122
- isEditing: form.isEditing,
6123
- onToggleEdit: form.handleToggleEdit,
6124
- onSave: form.handleSave,
6125
- onCancel: form.handleCancel,
6713
+ isEditing,
6714
+ onToggleEdit,
6126
6715
  hideActions,
6127
6716
  editContent,
6128
6717
  viewContent
@@ -6481,47 +7070,14 @@ var CounterpartyBasicInfo = ({ onDataChange }) => {
6481
7070
  EnhancedInput,
6482
7071
  {
6483
7072
  label: "ID Number",
6484
- value: formData.idNumber,
6485
- onChange: (e) => handleInputChange("idNumber", e.target.value),
6486
- placeholder: "Enter ID number"
6487
- }
6488
- )
6489
- ] })
6490
- ] });
6491
- };
6492
- var spacingClasses = {
6493
- sm: "space-y-3",
6494
- md: "space-y-4",
6495
- lg: "space-y-6"
6496
- };
6497
- var gridClasses = {
6498
- 1: "grid-cols-1",
6499
- 2: "grid-cols-1 md:grid-cols-2",
6500
- 3: "grid-cols-1 md:grid-cols-2 lg:grid-cols-3",
6501
- 4: "grid-cols-1 md:grid-cols-2 lg:grid-cols-4"
6502
- };
6503
- var FormSection = React15__namespace.forwardRef(
6504
- ({
6505
- title,
6506
- description,
6507
- children,
6508
- className,
6509
- spacing: spacing2 = "md",
6510
- layout = "vertical",
6511
- columns: columns3 = 2
6512
- }, ref) => {
6513
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref, className: cn("space-y-4", className), children: [
6514
- (title || description) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1", children: [
6515
- title && /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-lg font-semibold text-foreground", children: title }),
6516
- description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: description })
6517
- ] }),
6518
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(
6519
- layout === "grid" ? `grid gap-4 ${gridClasses[columns3]}` : spacingClasses[spacing2]
6520
- ), children })
6521
- ] });
6522
- }
6523
- );
6524
- FormSection.displayName = "FormSection";
7073
+ value: formData.idNumber,
7074
+ onChange: (e) => handleInputChange("idNumber", e.target.value),
7075
+ placeholder: "Enter ID number"
7076
+ }
7077
+ )
7078
+ ] })
7079
+ ] });
7080
+ };
6525
7081
  var IntermediaryFI = () => {
6526
7082
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-6", children: [
6527
7083
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "border-b border-border pb-4", children: [
@@ -7988,36 +8544,6 @@ var EntityCard = React15__namespace.forwardRef(
7988
8544
  }
7989
8545
  );
7990
8546
  EntityCard.displayName = "EntityCard";
7991
- var FormField = React15__namespace.forwardRef(
7992
- ({ label, description, error, required, children, className, layout = "vertical" }, ref) => {
7993
- const isHorizontal = layout === "horizontal";
7994
- return /* @__PURE__ */ jsxRuntime.jsxs(
7995
- "div",
7996
- {
7997
- ref,
7998
- className: cn(
7999
- "space-y-2",
8000
- isHorizontal && "grid grid-cols-1 md:grid-cols-3 gap-4 items-start space-y-0",
8001
- className
8002
- ),
8003
- children: [
8004
- label && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("space-y-1", isHorizontal && "pt-2"), children: [
8005
- /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "text-sm font-medium text-foreground", children: [
8006
- label,
8007
- required && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-destructive ml-1", children: "*" })
8008
- ] }),
8009
- description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground", children: description })
8010
- ] }),
8011
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn(isHorizontal && "md:col-span-2"), children: [
8012
- children,
8013
- error && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-destructive mt-1", children: error })
8014
- ] })
8015
- ]
8016
- }
8017
- );
8018
- }
8019
- );
8020
- FormField.displayName = "FormField";
8021
8547
  var variantStyles = {
8022
8548
  default: "",
8023
8549
  success: "border-success/20 bg-success/5",
@@ -9396,39 +9922,6 @@ var AccountStatusCard = ({ isEditing, onToggleEdit, className }) => {
9396
9922
  }
9397
9923
  );
9398
9924
  };
9399
- var AccountBalanceCard = React15__namespace.default.forwardRef(
9400
- ({ balance, availableBalance, accountNumber, accountType, className }, ref) => {
9401
- return /* @__PURE__ */ jsxRuntime.jsx(
9402
- Card,
9403
- {
9404
- ref,
9405
- className: cn(
9406
- "border-primary/20 bg-gradient-to-br from-primary/5 via-primary/3 to-background",
9407
- className
9408
- ),
9409
- children: /* @__PURE__ */ jsxRuntime.jsx(CardContent, { className: "p-6", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-4", children: [
9410
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
9411
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Wallet, { className: "h-4 w-4 text-primary" }),
9412
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: accountNumber }),
9413
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: "\u2022" }),
9414
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground capitalize", children: accountType })
9415
- ] }),
9416
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-end gap-8", children: [
9417
- /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
9418
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs font-medium text-muted-foreground mb-1", children: "Account Balance" }),
9419
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-3xl font-bold text-foreground tracking-tight", children: balance })
9420
- ] }),
9421
- availableBalance && /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
9422
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs font-medium text-muted-foreground mb-1", children: "Available Balance" }),
9423
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-3xl font-bold text-foreground tracking-tight", children: availableBalance })
9424
- ] })
9425
- ] })
9426
- ] }) })
9427
- }
9428
- );
9429
- }
9430
- );
9431
- AccountBalanceCard.displayName = "AccountBalanceCard";
9432
9925
  var accountInfoSchema = zod.z.object({
9433
9926
  accountName: zod.z.string().trim().min(1, "Account name is required").max(100, "Account name must be less than 100 characters"),
9434
9927
  canAcceptSweep: zod.z.enum(["Yes", "No"]),
@@ -9458,7 +9951,7 @@ var AccountDetail = () => {
9458
9951
  }
9459
9952
  const formValues = form.watch();
9460
9953
  const customerPath = account.customerType === "business" ? `/business/${account.customerId}` : `/individual/${account.customerId}`;
9461
- return /* @__PURE__ */ jsxRuntime.jsxs(
9954
+ return /* @__PURE__ */ jsxRuntime.jsx(
9462
9955
  PageLayout,
9463
9956
  {
9464
9957
  title: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3", children: [
@@ -9501,29 +9994,37 @@ var AccountDetail = () => {
9501
9994
  }
9502
9995
  ],
9503
9996
  maxWidth: "full",
9504
- children: [
9505
- /* @__PURE__ */ jsxRuntime.jsx(
9506
- AccountBalanceCard,
9507
- {
9508
- balance: account.balance,
9509
- availableBalance: account.balance,
9510
- accountNumber: account.number,
9511
- accountType: account.type,
9512
- className: "mb-4"
9513
- }
9514
- ),
9515
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col lg:flex-row items-start gap-4", children: [
9516
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 space-y-4", children: [
9517
- /* @__PURE__ */ jsxRuntime.jsx(
9518
- EditableFormCard,
9519
- {
9520
- title: "Account Information",
9521
- variant: "subtle",
9522
- isEditing: form.isEditing,
9523
- onToggleEdit: form.handleToggleEdit,
9524
- onSave: form.handleSave,
9525
- onCancel: form.handleCancel,
9526
- viewContent: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
9997
+ children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col lg:flex-row items-start gap-4", children: [
9998
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 space-y-4", children: [
9999
+ /* @__PURE__ */ jsxRuntime.jsx(
10000
+ EditableFormCard,
10001
+ {
10002
+ title: "Account Information",
10003
+ variant: "subtle",
10004
+ isEditing: form.isEditing,
10005
+ onToggleEdit: form.handleToggleEdit,
10006
+ onSave: form.handleSave,
10007
+ onCancel: form.handleCancel,
10008
+ viewContent: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
10009
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-6 p-6 rounded-lg bg-gradient-to-br from-primary/10 via-primary/5 to-background border border-primary/20", children: [
10010
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 mb-4", children: [
10011
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Wallet, { className: "h-4 w-4 text-primary" }),
10012
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: account.number }),
10013
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: "\u2022" }),
10014
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground capitalize", children: account.type })
10015
+ ] }),
10016
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-end gap-8", children: [
10017
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
10018
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs font-medium text-muted-foreground mb-1", children: "Account Balance" }),
10019
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-3xl font-bold text-foreground tracking-tight", children: account.balance })
10020
+ ] }),
10021
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
10022
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs font-medium text-muted-foreground mb-1", children: "Available Balance" }),
10023
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-3xl font-bold text-foreground tracking-tight", children: account.balance })
10024
+ ] })
10025
+ ] })
10026
+ ] }),
10027
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
9527
10028
  /* @__PURE__ */ jsxRuntime.jsx(
9528
10029
  InfoField,
9529
10030
  {
@@ -9587,8 +10088,28 @@ var AccountDetail = () => {
9587
10088
  value: formValues.sweepAccountNumber || "-"
9588
10089
  }
9589
10090
  )
10091
+ ] })
10092
+ ] }),
10093
+ editContent: /* @__PURE__ */ jsxRuntime.jsx(FormProvider, { form, children: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
10094
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-6 p-6 rounded-lg bg-gradient-to-br from-primary/10 via-primary/5 to-background border border-primary/20", children: [
10095
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 mb-4", children: [
10096
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Wallet, { className: "h-4 w-4 text-primary" }),
10097
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: account.number }),
10098
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: "\u2022" }),
10099
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground capitalize", children: account.type })
10100
+ ] }),
10101
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-end gap-8", children: [
10102
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
10103
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs font-medium text-muted-foreground mb-1", children: "Account Balance" }),
10104
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-3xl font-bold text-foreground tracking-tight", children: account.balance })
10105
+ ] }),
10106
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
10107
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs font-medium text-muted-foreground mb-1", children: "Available Balance" }),
10108
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-3xl font-bold text-foreground tracking-tight", children: account.balance })
10109
+ ] })
10110
+ ] })
9590
10111
  ] }),
9591
- editContent: /* @__PURE__ */ jsxRuntime.jsx(FormProvider, { form, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
10112
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
9592
10113
  /* @__PURE__ */ jsxRuntime.jsx(
9593
10114
  InfoField,
9594
10115
  {
@@ -9660,18 +10181,18 @@ var AccountDetail = () => {
9660
10181
  placeholder: "Enter sweep account number"
9661
10182
  }
9662
10183
  )
9663
- ] }) })
9664
- }
9665
- ),
9666
- /* @__PURE__ */ jsxRuntime.jsxs(Card, { children: [
9667
- /* @__PURE__ */ jsxRuntime.jsx(CardHeader, { children: /* @__PURE__ */ jsxRuntime.jsx(CardTitle, { children: "Fees" }) }),
9668
- /* @__PURE__ */ jsxRuntime.jsx(CardContent, { children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-center py-8 text-muted-foreground", children: /* @__PURE__ */ jsxRuntime.jsx("p", { children: "Fees information coming soon" }) }) })
9669
- ] })
9670
- ] }),
9671
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "lg:w-64", children: /* @__PURE__ */ jsxRuntime.jsx(AccountStatusCard, { isEditing: false, onToggleEdit: () => {
9672
- } }) })
9673
- ] })
9674
- ]
10184
+ ] })
10185
+ ] }) })
10186
+ }
10187
+ ),
10188
+ /* @__PURE__ */ jsxRuntime.jsxs(Card, { children: [
10189
+ /* @__PURE__ */ jsxRuntime.jsx(CardHeader, { children: /* @__PURE__ */ jsxRuntime.jsx(CardTitle, { children: "Fees" }) }),
10190
+ /* @__PURE__ */ jsxRuntime.jsx(CardContent, { children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-center py-8 text-muted-foreground", children: /* @__PURE__ */ jsxRuntime.jsx("p", { children: "Fees information coming soon" }) }) })
10191
+ ] })
10192
+ ] }),
10193
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "lg:w-64", children: /* @__PURE__ */ jsxRuntime.jsx(AccountStatusCard, { isEditing: false, onToggleEdit: () => {
10194
+ } }) })
10195
+ ] })
9675
10196
  }
9676
10197
  );
9677
10198
  };
@@ -10964,161 +11485,37 @@ var Counterparties = () => {
10964
11485
  {
10965
11486
  key: "created",
10966
11487
  title: "Created",
10967
- sortable: true
10968
- },
10969
- {
10970
- key: "modified",
10971
- title: "Modified",
10972
- sortable: true
10973
- }
10974
- ];
10975
- const table = React15.useMemo(() => /* @__PURE__ */ jsxRuntime.jsx(
10976
- DataTable,
10977
- {
10978
- columns: columns3,
10979
- data: sortedCounterparties,
10980
- sortBy,
10981
- sortDirection,
10982
- onSort: handleSort,
10983
- onRowClick: handleRowClick
10984
- }
10985
- ), [columns3, sortedCounterparties, sortBy, sortDirection, handleSort, handleRowClick]);
10986
- return /* @__PURE__ */ jsxRuntime.jsx(
10987
- CounterpartiesView,
10988
- {
10989
- table,
10990
- filters,
10991
- onFilterChange: handleFilterChange,
10992
- onResetFilters: handleResetFilters,
10993
- onCreateCounterparty: handleCreateCounterparty
10994
- }
10995
- );
10996
- };
10997
- var Counterparties_default = Counterparties;
10998
- var mockCounterpartyTimeline = [
10999
- {
11000
- id: "1",
11001
- action: "Counterparty Created",
11002
- user: "admin",
11003
- details: "Initial counterparty setup",
11004
- status: "Active",
11005
- timestamp: "2024-01-15 10:30:00"
11006
- },
11007
- {
11008
- id: "2",
11009
- action: "Profile Updated",
11010
- user: "admin",
11011
- details: "Updated counterparty information",
11012
- timestamp: "2024-01-20 14:22:00"
11013
- },
11014
- {
11015
- id: "3",
11016
- action: "OFAC Check Completed",
11017
- user: "System",
11018
- details: "Automated compliance check",
11019
- status: "Verified",
11020
- timestamp: "2024-01-20 14:30:00"
11021
- }
11022
- ];
11023
- var CounterpartyStatusCard = ({ isEditing, onToggleEdit, className }) => {
11024
- const getIcon = (action) => {
11025
- if (action.includes("Created")) return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Circle, { className: "h-4 w-4" });
11026
- if (action.includes("Assigned")) return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.UserPlus, { className: "h-4 w-4" });
11027
- if (action.includes("Updated") || action.includes("Modified") || action.includes("Check")) return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Edit, { className: "h-4 w-4" });
11028
- if (action.includes("Completed") || action.includes("Verified")) return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CheckCircle, { className: "h-4 w-4" });
11029
- return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Circle, { className: "h-4 w-4" });
11030
- };
11031
- const getStatusColor2 = (status) => {
11032
- switch (status) {
11033
- case "Active":
11034
- case "Verified":
11035
- return "text-success";
11036
- case "Pending":
11037
- return "text-warning";
11038
- default:
11039
- return "text-muted-foreground";
11040
- }
11041
- };
11042
- return /* @__PURE__ */ jsxRuntime.jsx(
11043
- FormCard,
11044
- {
11045
- title: "Timeline",
11046
- className,
11047
- children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-3", children: mockCounterpartyTimeline.map((event, index) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative pl-6 pb-3", children: [
11048
- index !== mockCounterpartyTimeline.length - 1 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute left-[7px] top-5 bottom-0 w-[2px] bg-border" }),
11049
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(
11050
- "absolute left-0 top-0 flex-none",
11051
- getStatusColor2(event.status)
11052
- ), children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-4 w-4", children: getIcon(event.action) }) }),
11053
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-0.5", children: [
11054
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs font-medium text-foreground", children: event.action }),
11055
- /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-xs text-muted-foreground", children: [
11056
- "by ",
11057
- event.user
11058
- ] }),
11059
- event.details && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground", children: event.details }),
11060
- event.status && /* @__PURE__ */ jsxRuntime.jsxs("p", { className: cn("text-xs font-medium", getStatusColor2(event.status)), children: [
11061
- "Status: ",
11062
- event.status
11063
- ] }),
11064
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground/70 pt-0.5", children: event.timestamp })
11065
- ] })
11066
- ] }, event.id)) })
11067
- }
11068
- );
11069
- };
11070
- var PaymentMethodCard = ({
11071
- type,
11072
- fiId,
11073
- accountNumber,
11074
- bankName,
11075
- accountType,
11076
- beneficiaryBankName,
11077
- correspondentBankId,
11078
- intermediaryBankId,
11079
- className
11080
- }) => {
11081
- const getIcon = () => {
11082
- switch (type) {
11083
- case "ACH":
11084
- return lucideReact.Building2;
11085
- case "Domestic Wire":
11086
- return lucideReact.Landmark;
11087
- case "International Wire":
11088
- return lucideReact.Globe;
11089
- default:
11090
- return lucideReact.Building2;
11091
- }
11092
- };
11093
- const Icon2 = getIcon();
11094
- return /* @__PURE__ */ jsxRuntime.jsxs(Card, { className: cn("hover:bg-muted/50 transition-colors", className), children: [
11095
- /* @__PURE__ */ jsxRuntime.jsxs(CardHeader, { className: "flex flex-row items-start justify-between space-y-0 pb-3", children: [
11096
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
11097
- /* @__PURE__ */ jsxRuntime.jsx(Icon2, { className: "h-4 w-4 text-muted-foreground" }),
11098
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium text-sm", children: type })
11099
- ] }),
11100
- /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "ghost", size: "sm", className: "h-8 w-8 p-0", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MoreVertical, { className: "h-4 w-4" }) })
11101
- ] }),
11102
- /* @__PURE__ */ jsxRuntime.jsxs(CardContent, { className: "space-y-3", children: [
11103
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-3", children: [
11104
- /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Beneficiary FI ID", value: fiId }),
11105
- /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Account Number", value: accountNumber })
11106
- ] }),
11107
- type === "ACH" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-3", children: [
11108
- bankName && /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Bank Name", value: bankName }),
11109
- accountType && /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Account Type", value: accountType })
11110
- ] }),
11111
- type === "Domestic Wire" && bankName && /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Bank Name", value: bankName }),
11112
- type === "International Wire" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-3", children: [
11113
- beneficiaryBankName && /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Beneficiary Bank Name", value: beneficiaryBankName }),
11114
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-3", children: [
11115
- correspondentBankId && /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Correspondent Bank ID", value: correspondentBankId }),
11116
- intermediaryBankId && /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Intermediary Bank ID", value: intermediaryBankId })
11117
- ] })
11118
- ] })
11119
- ] })
11120
- ] });
11488
+ sortable: true
11489
+ },
11490
+ {
11491
+ key: "modified",
11492
+ title: "Modified",
11493
+ sortable: true
11494
+ }
11495
+ ];
11496
+ const table = React15.useMemo(() => /* @__PURE__ */ jsxRuntime.jsx(
11497
+ DataTable,
11498
+ {
11499
+ columns: columns3,
11500
+ data: sortedCounterparties,
11501
+ sortBy,
11502
+ sortDirection,
11503
+ onSort: handleSort,
11504
+ onRowClick: handleRowClick
11505
+ }
11506
+ ), [columns3, sortedCounterparties, sortBy, sortDirection, handleSort, handleRowClick]);
11507
+ return /* @__PURE__ */ jsxRuntime.jsx(
11508
+ CounterpartiesView,
11509
+ {
11510
+ table,
11511
+ filters,
11512
+ onFilterChange: handleFilterChange,
11513
+ onResetFilters: handleResetFilters,
11514
+ onCreateCounterparty: handleCreateCounterparty
11515
+ }
11516
+ );
11121
11517
  };
11518
+ var Counterparties_default = Counterparties;
11122
11519
  var mockPaymentMethods = [
11123
11520
  {
11124
11521
  type: "ACH",
@@ -11177,6 +11574,33 @@ var CounterpartyDetail = () => {
11177
11574
  render: (value) => /* @__PURE__ */ jsxRuntime.jsx("span", { className: "capitalize", children: value })
11178
11575
  }
11179
11576
  ];
11577
+ const handleStatusChange = (newStatus) => {
11578
+ setCurrentStatus(newStatus);
11579
+ };
11580
+ const handleToggleProfileEdit = () => {
11581
+ setIsEditingProfile(!isEditingProfile);
11582
+ };
11583
+ const handleAddPaymentMethod = () => {
11584
+ console.log("Add payment method");
11585
+ };
11586
+ const handleAddDocument = () => {
11587
+ console.log("Add document");
11588
+ };
11589
+ const documentsTable = React15.useMemo(() => {
11590
+ if (counterpartyDocuments.length === 0) {
11591
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-center gap-2 py-4 text-sm text-muted-foreground", children: [
11592
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.FileText, { className: "h-5 w-5 opacity-50" }),
11593
+ /* @__PURE__ */ jsxRuntime.jsx("p", { children: "No documents found" })
11594
+ ] });
11595
+ }
11596
+ return /* @__PURE__ */ jsxRuntime.jsx(
11597
+ DataTable,
11598
+ {
11599
+ columns: documentColumns,
11600
+ data: counterpartyDocuments
11601
+ }
11602
+ );
11603
+ }, [counterpartyDocuments, documentColumns]);
11180
11604
  if (!counterparty) {
11181
11605
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "container mx-auto px-4 py-8", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-center", children: [
11182
11606
  /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-2xl font-bold mb-2", children: "Counterparty Not Found" }),
@@ -11184,74 +11608,18 @@ var CounterpartyDetail = () => {
11184
11608
  ] }) });
11185
11609
  }
11186
11610
  return /* @__PURE__ */ jsxRuntime.jsx(
11187
- PageLayout,
11611
+ CounterpartyDetailView,
11188
11612
  {
11189
- title: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3", children: [
11190
- /* @__PURE__ */ jsxRuntime.jsx("span", { children: counterparty.name }),
11191
- /* @__PURE__ */ jsxRuntime.jsx(
11192
- EditableInfoField,
11193
- {
11194
- label: "",
11195
- value: currentStatus,
11196
- options: [
11197
- { value: "ACTIVE", label: "Active" },
11198
- { value: "INACTIVE", label: "Inactive" },
11199
- { value: "PENDING", label: "Pending" },
11200
- { value: "SUSPENDED", label: "Suspended" }
11201
- ],
11202
- onChange: (newStatus) => setCurrentStatus(newStatus),
11203
- renderValue: (value) => /* @__PURE__ */ jsxRuntime.jsx(StatusBadge, { status: value }),
11204
- className: "inline-block"
11205
- }
11206
- ),
11207
- /* @__PURE__ */ jsxRuntime.jsx(CounterpartyTypeBadge, { type: counterparty.type })
11208
- ] }),
11209
- maxWidth: "full",
11210
- children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col lg:flex-row items-start gap-4", children: [
11211
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 space-y-4", children: [
11212
- /* @__PURE__ */ jsxRuntime.jsx(
11213
- CounterpartyProfileCard,
11214
- {
11215
- isEditing: isEditingProfile,
11216
- onToggleEdit: () => setIsEditingProfile(!isEditingProfile)
11217
- }
11218
- ),
11219
- /* @__PURE__ */ jsxRuntime.jsxs(Card, { children: [
11220
- /* @__PURE__ */ jsxRuntime.jsxs(CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-4", children: [
11221
- /* @__PURE__ */ jsxRuntime.jsx(CardTitle, { children: "Payment Methods" }),
11222
- /* @__PURE__ */ jsxRuntime.jsxs(Button, { size: "sm", variant: "ghost", children: [
11223
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Plus, { className: "h-4 w-4 mr-1" }),
11224
- "Method"
11225
- ] })
11226
- ] }),
11227
- /* @__PURE__ */ jsxRuntime.jsx(CardContent, { children: mockPaymentMethods.length === 0 ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-center gap-2 py-4 text-sm text-muted-foreground", children: [
11228
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Wallet, { className: "h-5 w-5 opacity-50" }),
11229
- /* @__PURE__ */ jsxRuntime.jsx("p", { children: "No payment methods configured" })
11230
- ] }) : /* @__PURE__ */ jsxRuntime.jsx(ResponsiveGrid, { type: "forms", gap: "md", children: mockPaymentMethods.map((method, index) => /* @__PURE__ */ jsxRuntime.jsx(PaymentMethodCard, { ...method }, index)) }) })
11231
- ] }),
11232
- /* @__PURE__ */ jsxRuntime.jsxs(Card, { children: [
11233
- /* @__PURE__ */ jsxRuntime.jsxs(CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-4", children: [
11234
- /* @__PURE__ */ jsxRuntime.jsx(CardTitle, { children: "Documents" }),
11235
- /* @__PURE__ */ jsxRuntime.jsxs(Button, { size: "sm", variant: "ghost", children: [
11236
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Plus, { className: "h-4 w-4 mr-1" }),
11237
- "Document"
11238
- ] })
11239
- ] }),
11240
- /* @__PURE__ */ jsxRuntime.jsx(CardContent, { children: counterpartyDocuments.length === 0 ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-center gap-2 py-4 text-sm text-muted-foreground", children: [
11241
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.FileText, { className: "h-5 w-5 opacity-50" }),
11242
- /* @__PURE__ */ jsxRuntime.jsx("p", { children: "No documents found" })
11243
- ] }) : /* @__PURE__ */ jsxRuntime.jsx(
11244
- DataTable,
11245
- {
11246
- columns: documentColumns,
11247
- data: counterpartyDocuments
11248
- }
11249
- ) })
11250
- ] })
11251
- ] }),
11252
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "lg:w-64", children: /* @__PURE__ */ jsxRuntime.jsx(CounterpartyStatusCard, { isEditing: false, onToggleEdit: () => {
11253
- } }) })
11254
- ] })
11613
+ counterpartyName: counterparty.name,
11614
+ counterpartyType: counterparty.type,
11615
+ currentStatus,
11616
+ isEditingProfile,
11617
+ mockPaymentMethods,
11618
+ documentsTable,
11619
+ onStatusChange: handleStatusChange,
11620
+ onToggleProfileEdit: handleToggleProfileEdit,
11621
+ onAddPaymentMethod: handleAddPaymentMethod,
11622
+ onAddDocument: handleAddDocument
11255
11623
  }
11256
11624
  );
11257
11625
  };
@@ -13889,7 +14257,7 @@ var TransactionDetail = () => {
13889
14257
  /* @__PURE__ */ jsxRuntime.jsx(Button, { onClick: () => navigate("/transactions/history"), children: "Back to Transaction History" })
13890
14258
  ] }) });
13891
14259
  }
13892
- const getStatusVariant = (status) => {
14260
+ const getStatusVariant2 = (status) => {
13893
14261
  switch (status) {
13894
14262
  case "POSTED":
13895
14263
  return "success";
@@ -13945,7 +14313,7 @@ var TransactionDetail = () => {
13945
14313
  isInbound: transaction.isInbound
13946
14314
  }
13947
14315
  ),
13948
- /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: getStatusVariant(transaction.status), children: transaction.status }),
14316
+ /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: getStatusVariant2(transaction.status), children: transaction.status }),
13949
14317
  /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: getProcessingStatusVariant(transaction.processingStatus), children: transaction.processingStatus })
13950
14318
  ] }),
13951
14319
  maxWidth: "full",
@@ -14044,6 +14412,341 @@ function UIKit() {
14044
14412
  ] })
14045
14413
  ] }) }) });
14046
14414
  }
14415
+ function OFACFiltersSheet({
14416
+ filters,
14417
+ onFilterChange,
14418
+ onResetFilters
14419
+ }) {
14420
+ const hasActiveFilters = filters.status !== "" || filters.entityType !== "" || filters.startDate !== void 0 || filters.endDate !== void 0;
14421
+ return /* @__PURE__ */ jsxRuntime.jsxs(Sheet, { children: [
14422
+ /* @__PURE__ */ jsxRuntime.jsx(SheetTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(Button, { variant: "outline", children: [
14423
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Filter, { className: "mr-2 h-4 w-4" }),
14424
+ "Filters",
14425
+ hasActiveFilters && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-2 flex h-5 w-5 items-center justify-center rounded-full bg-primary text-xs text-primary-foreground", children: [filters.status, filters.entityType, filters.startDate, filters.endDate].filter(Boolean).length })
14426
+ ] }) }),
14427
+ /* @__PURE__ */ jsxRuntime.jsxs(SheetContent, { className: "w-full sm:max-w-md overflow-y-auto", children: [
14428
+ /* @__PURE__ */ jsxRuntime.jsxs(SheetHeader, { children: [
14429
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
14430
+ /* @__PURE__ */ jsxRuntime.jsx(SheetTitle, { children: "Filter OFAC Checks" }),
14431
+ hasActiveFilters && /* @__PURE__ */ jsxRuntime.jsxs(
14432
+ Button,
14433
+ {
14434
+ variant: "ghost",
14435
+ size: "sm",
14436
+ onClick: onResetFilters,
14437
+ className: "h-8 px-2",
14438
+ children: [
14439
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "mr-1 h-4 w-4" }),
14440
+ "Clear all"
14441
+ ]
14442
+ }
14443
+ )
14444
+ ] }),
14445
+ /* @__PURE__ */ jsxRuntime.jsx(SheetDescription, { children: "Filter OFAC screening results by status, entity type, and date range" })
14446
+ ] }),
14447
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-6 mt-6", children: [
14448
+ /* @__PURE__ */ jsxRuntime.jsx(
14449
+ EnhancedSelect,
14450
+ {
14451
+ label: "Status",
14452
+ placeholder: "All statuses",
14453
+ options: [
14454
+ { value: "all", label: "All statuses" },
14455
+ { value: "NO MATCH", label: "No Match" },
14456
+ { value: "REVIEW", label: "Review" },
14457
+ { value: "CLEARED", label: "Cleared" },
14458
+ { value: "CONFIRMED", label: "Confirmed" }
14459
+ ],
14460
+ value: filters.status || "all",
14461
+ onValueChange: (value) => onFilterChange("status", value === "all" ? "" : value)
14462
+ }
14463
+ ),
14464
+ /* @__PURE__ */ jsxRuntime.jsx(
14465
+ EnhancedSelect,
14466
+ {
14467
+ label: "Entity Type",
14468
+ placeholder: "All entity types",
14469
+ options: [
14470
+ { value: "all", label: "All entity types" },
14471
+ { value: "Business", label: "Business" },
14472
+ { value: "Individual", label: "Individual" },
14473
+ { value: "Counterparty", label: "Counterparty" }
14474
+ ],
14475
+ value: filters.entityType || "all",
14476
+ onValueChange: (value) => onFilterChange("entityType", value === "all" ? "" : value)
14477
+ }
14478
+ ),
14479
+ /* @__PURE__ */ jsxRuntime.jsx(
14480
+ DatePicker,
14481
+ {
14482
+ date: filters.startDate,
14483
+ onDateChange: (date) => onFilterChange("startDate", date),
14484
+ label: "Start Date",
14485
+ placeholder: "MM/DD/YYYY"
14486
+ }
14487
+ ),
14488
+ /* @__PURE__ */ jsxRuntime.jsx(
14489
+ DatePicker,
14490
+ {
14491
+ date: filters.endDate,
14492
+ onDateChange: (date) => onFilterChange("endDate", date),
14493
+ label: "End Date",
14494
+ placeholder: "MM/DD/YYYY",
14495
+ disabledDates: (date) => filters.startDate ? date < filters.startDate : false
14496
+ }
14497
+ )
14498
+ ] })
14499
+ ] })
14500
+ ] });
14501
+ }
14502
+
14503
+ // src/lib/mock-data/ofac-data.ts
14504
+ var mockOFACChecks = [
14505
+ {
14506
+ id: "ofac-001",
14507
+ created: "2024-01-15T10:30:00Z",
14508
+ entityId: "8112488",
14509
+ entityName: "Acme Corporation",
14510
+ entityType: "Business",
14511
+ alertId: "ALT-001",
14512
+ status: "CLEARED"
14513
+ },
14514
+ {
14515
+ id: "ofac-002",
14516
+ created: "2024-01-14T14:22:00Z",
14517
+ entityId: "8111609",
14518
+ entityName: "Global Tech Industries",
14519
+ entityType: "Business",
14520
+ alertId: "ALT-002",
14521
+ status: "REVIEW"
14522
+ },
14523
+ {
14524
+ id: "ofac-003",
14525
+ created: "2024-01-14T09:15:00Z",
14526
+ entityId: "IND-001",
14527
+ entityName: "John Smith",
14528
+ entityType: "Individual",
14529
+ alertId: null,
14530
+ status: "NO MATCH"
14531
+ },
14532
+ {
14533
+ id: "ofac-004",
14534
+ created: "2024-01-13T16:45:00Z",
14535
+ entityId: "8111026",
14536
+ entityName: "Innovation Partners LLC",
14537
+ entityType: "Business",
14538
+ alertId: "ALT-003",
14539
+ status: "CONFIRMED"
14540
+ },
14541
+ {
14542
+ id: "ofac-005",
14543
+ created: "2024-01-13T11:20:00Z",
14544
+ entityId: "IND-002",
14545
+ entityName: "Jane Doe",
14546
+ entityType: "Individual",
14547
+ alertId: null,
14548
+ status: "NO MATCH"
14549
+ },
14550
+ {
14551
+ id: "ofac-006",
14552
+ created: "2024-01-12T13:30:00Z",
14553
+ entityId: "CP-001",
14554
+ entityName: "International Suppliers Inc",
14555
+ entityType: "Counterparty",
14556
+ alertId: "ALT-004",
14557
+ status: "REVIEW"
14558
+ },
14559
+ {
14560
+ id: "ofac-007",
14561
+ created: "2024-01-12T08:00:00Z",
14562
+ entityId: "8110892",
14563
+ entityName: "NextGen Solutions",
14564
+ entityType: "Business",
14565
+ alertId: null,
14566
+ status: "NO MATCH"
14567
+ },
14568
+ {
14569
+ id: "ofac-008",
14570
+ created: "2024-01-11T15:10:00Z",
14571
+ entityId: "IND-003",
14572
+ entityName: "Robert Johnson",
14573
+ entityType: "Individual",
14574
+ alertId: "ALT-005",
14575
+ status: "CLEARED"
14576
+ },
14577
+ {
14578
+ id: "ofac-009",
14579
+ created: "2024-01-11T10:45:00Z",
14580
+ entityId: "CP-002",
14581
+ entityName: "Overseas Trading Company",
14582
+ entityType: "Counterparty",
14583
+ alertId: "ALT-006",
14584
+ status: "REVIEW"
14585
+ },
14586
+ {
14587
+ id: "ofac-010",
14588
+ created: "2024-01-10T14:25:00Z",
14589
+ entityId: "8110654",
14590
+ entityName: "Digital Ventures Group",
14591
+ entityType: "Business",
14592
+ alertId: null,
14593
+ status: "NO MATCH"
14594
+ }
14595
+ ];
14596
+ var getStatusVariant = (status) => {
14597
+ switch (status) {
14598
+ case "NO MATCH":
14599
+ return "success";
14600
+ case "REVIEW":
14601
+ return "warning";
14602
+ case "CLEARED":
14603
+ return "active";
14604
+ case "CONFIRMED":
14605
+ return "destructive";
14606
+ default:
14607
+ return "secondary";
14608
+ }
14609
+ };
14610
+ var getEntityUrl = (entityType, entityId) => {
14611
+ switch (entityType) {
14612
+ case "Business":
14613
+ return `/business/${entityId}`;
14614
+ case "Individual":
14615
+ return `/individual/${entityId}`;
14616
+ case "Counterparty":
14617
+ return `/counterparty/${entityId}`;
14618
+ default:
14619
+ return "#";
14620
+ }
14621
+ };
14622
+ function OFAC() {
14623
+ const navigate = reactRouterDom.useNavigate();
14624
+ const [sortField, setSortField] = React15.useState("created");
14625
+ const [sortDirection, setSortDirection] = React15.useState("desc");
14626
+ const [filters, setFilters] = React15.useState({
14627
+ status: "",
14628
+ entityType: "",
14629
+ startDate: void 0,
14630
+ endDate: void 0
14631
+ });
14632
+ const handleFilterChange = (field, value) => {
14633
+ setFilters((prev) => ({ ...prev, [field]: value }));
14634
+ };
14635
+ const handleResetFilters = () => {
14636
+ setFilters({
14637
+ status: "",
14638
+ entityType: "",
14639
+ startDate: void 0,
14640
+ endDate: void 0
14641
+ });
14642
+ };
14643
+ const handleSort = (field) => {
14644
+ if (sortField === field) {
14645
+ setSortDirection(sortDirection === "asc" ? "desc" : "asc");
14646
+ } else {
14647
+ setSortField(field);
14648
+ setSortDirection("desc");
14649
+ }
14650
+ };
14651
+ const filteredChecks = React15.useMemo(() => {
14652
+ return mockOFACChecks.filter((check) => {
14653
+ if (filters.status && check.status !== filters.status) {
14654
+ return false;
14655
+ }
14656
+ if (filters.entityType && check.entityType !== filters.entityType) {
14657
+ return false;
14658
+ }
14659
+ if (filters.startDate || filters.endDate) {
14660
+ const checkDate = dateFns.parseISO(check.created);
14661
+ if (filters.startDate && dateFns.isBefore(checkDate, dateFns.startOfDay(filters.startDate))) {
14662
+ return false;
14663
+ }
14664
+ if (filters.endDate && dateFns.isAfter(checkDate, dateFns.endOfDay(filters.endDate))) {
14665
+ return false;
14666
+ }
14667
+ }
14668
+ return true;
14669
+ });
14670
+ }, [filters]);
14671
+ const sortedChecks = [...filteredChecks].sort((a, b) => {
14672
+ const aValue = a[sortField];
14673
+ const bValue = b[sortField];
14674
+ if (aValue == null) return 1;
14675
+ if (bValue == null) return -1;
14676
+ if (sortDirection === "asc") {
14677
+ return aValue > bValue ? 1 : -1;
14678
+ } else {
14679
+ return aValue < bValue ? 1 : -1;
14680
+ }
14681
+ });
14682
+ const columns3 = [
14683
+ {
14684
+ key: "created",
14685
+ title: "Created",
14686
+ sortable: true,
14687
+ render: (value) => /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-muted-foreground", children: dateFns.format(dateFns.parseISO(value), "MMM d, yyyy h:mm a") })
14688
+ },
14689
+ {
14690
+ key: "entityName",
14691
+ title: "Entity",
14692
+ render: (value, row) => /* @__PURE__ */ jsxRuntime.jsx(
14693
+ "button",
14694
+ {
14695
+ onClick: () => navigate(getEntityUrl(row.entityType, row.entityId)),
14696
+ className: "text-sm text-primary hover:underline font-medium",
14697
+ children: value
14698
+ }
14699
+ )
14700
+ },
14701
+ {
14702
+ key: "entityType",
14703
+ title: "Entity Type",
14704
+ sortable: true,
14705
+ render: (value) => /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm", children: value })
14706
+ },
14707
+ {
14708
+ key: "alertId",
14709
+ title: "Alert ID",
14710
+ render: (value) => value ? /* @__PURE__ */ jsxRuntime.jsx(
14711
+ "button",
14712
+ {
14713
+ onClick: () => navigate(`/alerts/${value}`),
14714
+ className: "text-sm text-primary hover:underline font-medium",
14715
+ children: value
14716
+ }
14717
+ ) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-muted-foreground", children: "\u2014" })
14718
+ },
14719
+ {
14720
+ key: "status",
14721
+ title: "Status",
14722
+ sortable: true,
14723
+ render: (value) => /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: getStatusVariant(value), children: value })
14724
+ }
14725
+ ];
14726
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col h-screen bg-gradient-subtle", children: [
14727
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-none border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "container mx-auto px-4 py-6 max-w-none", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
14728
+ /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-3xl font-bold text-foreground", children: "OFAC Checks" }) }),
14729
+ /* @__PURE__ */ jsxRuntime.jsx(
14730
+ OFACFiltersSheet,
14731
+ {
14732
+ filters,
14733
+ onFilterChange: handleFilterChange,
14734
+ onResetFilters: handleResetFilters
14735
+ }
14736
+ )
14737
+ ] }) }) }),
14738
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "container mx-auto px-4 h-full max-w-none flex flex-col", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 mt-4 overflow-auto", children: /* @__PURE__ */ jsxRuntime.jsx(
14739
+ DataTable,
14740
+ {
14741
+ columns: columns3,
14742
+ data: sortedChecks,
14743
+ sortBy: sortField,
14744
+ sortDirection,
14745
+ onSort: handleSort
14746
+ }
14747
+ ) }) }) })
14748
+ ] });
14749
+ }
14047
14750
 
14048
14751
  exports.ACHBankCard = ACHBankCard;
14049
14752
  exports.ACHBasicInfoCard = ACHBasicInfoCard;
@@ -14095,6 +14798,7 @@ exports.Counterparties = Counterparties_default;
14095
14798
  exports.CounterpartiesView = CounterpartiesView;
14096
14799
  exports.CounterpartyBasicInfo = CounterpartyBasicInfo;
14097
14800
  exports.CounterpartyDetail = CounterpartyDetail_default;
14801
+ exports.CounterpartyDetailView = CounterpartyDetailView;
14098
14802
  exports.CounterpartyProfileCard = CounterpartyProfileCard;
14099
14803
  exports.CounterpartyRecordsCard = CounterpartyRecordsCard;
14100
14804
  exports.CounterpartyTypeBadge = CounterpartyTypeBadge;
@@ -14148,6 +14852,7 @@ exports.MainLayout = MainLayout;
14148
14852
  exports.MetricCard = MetricCard;
14149
14853
  exports.NewTransaction = NewTransaction;
14150
14854
  exports.NotFound = NotFound_default;
14855
+ exports.OFAC = OFAC;
14151
14856
  exports.OFACAlertView = OFACAlertView;
14152
14857
  exports.OriginatorCard = OriginatorCard;
14153
14858
  exports.OriginatorFI = OriginatorFI;