ptechcore_ui 1.0.14 → 1.0.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -4,13 +4,14 @@ var PrimaryButton = ({
4
4
  loading = false,
5
5
  children,
6
6
  classname = "",
7
+ variant = "full",
7
8
  ...props
8
9
  }) => /* @__PURE__ */ jsx(
9
10
  "button",
10
11
  {
11
12
  type: "submit",
12
13
  disabled: loading || props.disabled,
13
- className: `px-4 py-2 text-sm bg-[#6A8A82] text-white rounded-lg hover:bg-[#5A7A72] transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex justify-center items-center ${classname}`,
14
+ className: `px-4 py-2 text-sm rounded-lg hover:bg-opacity-80 transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex justify-center items-center ${classname} ${variant === "full" ? "bg-[#6A8A82] text-white" : variant === "outline" ? "border border-[#6A8A82] text-[#6A8A82] bg-transparent" : "bg-transparent text-[#6A8A82]"}`,
14
15
  ...props,
15
16
  children: loading ? "Connexion en cours..." : children
16
17
  }
@@ -18,13 +19,14 @@ var PrimaryButton = ({
18
19
  var SecondaryButton = ({
19
20
  loading = false,
20
21
  children,
22
+ variant = "full",
21
23
  ...props
22
24
  }) => /* @__PURE__ */ jsx(
23
25
  "button",
24
26
  {
25
27
  type: "button",
26
28
  disabled: loading || props.disabled,
27
- className: "px-4 py-2 bg-[#B87333] text-white rounded-lg hover:bg-[#A66B2A] transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center",
29
+ className: `px-4 py-2 rounded-lg hover:bg-opacity-80 transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center ${variant === "full" ? "bg-[#B87333] text-white" : variant === "outline" ? "border border-[#B87333] text-[#B87333] bg-transparent" : "bg-transparent text-[#B87333]"}`,
28
30
  ...props,
29
31
  children: loading ? "Connexion en cours..." : children
30
32
  }
@@ -35,7 +37,7 @@ var Buttons_default = PrimaryButton;
35
37
  import { jsx as jsx2, jsxs } from "react/jsx-runtime";
36
38
  var Modal = ({ title, description, width, open, onClose, children }) => {
37
39
  if (!open) return null;
38
- return /* @__PURE__ */ jsx2("div", { className: "fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50", children: /* @__PURE__ */ jsxs("div", { className: `bg-white rounded-lg py-4 px-6 mx-4 w-[${width ? width : "60%"}]`, children: [
40
+ return /* @__PURE__ */ jsx2("div", { className: "fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50", children: /* @__PURE__ */ jsxs("div", { className: `bg-white rounded-lg pt-4 px-6 mx-4 `, children: [
39
41
  /* @__PURE__ */ jsxs("div", { className: "flex justify-between items-start mb-6", children: [
40
42
  /* @__PURE__ */ jsxs("div", { children: [
41
43
  /* @__PURE__ */ jsx2("h3", { className: "text-xl font-semibold text-tuatara flex items-center space-x-2", children: /* @__PURE__ */ jsx2("span", { children: title }) }),
@@ -51,7 +53,7 @@ var Modal = ({ title, description, width, open, onClose, children }) => {
51
53
  }
52
54
  )
53
55
  ] }),
54
- /* @__PURE__ */ jsx2("div", { className: "w-full max-h-[80vh] overflow-y-auto mb-4", children })
56
+ /* @__PURE__ */ jsx2("div", { className: "w-full max-h-[80vh] overflow-y-auto mb-1", children })
55
57
  ] }) });
56
58
  };
57
59
  var Modals_default = Modal;
@@ -2545,7 +2547,7 @@ import { useState as useState10, useEffect as useEffect8 } from "react";
2545
2547
 
2546
2548
  // src/components/common/SearchableSelect.tsx
2547
2549
  import { useState as useState9, useRef, useEffect as useEffect7 } from "react";
2548
- import { Search as Search3, ChevronDown, X as X4 } from "lucide-react";
2550
+ import { Search as Search3, ChevronDown, X as X4, RefreshCw, Plus } from "lucide-react";
2549
2551
  import { Fragment as Fragment5, jsx as jsx13, jsxs as jsxs9 } from "react/jsx-runtime";
2550
2552
  var SearchableSelect = ({
2551
2553
  options,
@@ -2556,7 +2558,9 @@ var SearchableSelect = ({
2556
2558
  onRemove,
2557
2559
  disabled = false,
2558
2560
  allowClear = false,
2559
- filterFunction
2561
+ filterFunction,
2562
+ addElement,
2563
+ refresh
2560
2564
  }) => {
2561
2565
  const [isOpen, setIsOpen] = useState9(false);
2562
2566
  const [searchTerm, setSearchTerm] = useState9("");
@@ -2643,20 +2647,43 @@ var SearchableSelect = ({
2643
2647
  }
2644
2648
  ),
2645
2649
  isOpen && /* @__PURE__ */ jsxs9("div", { className: "absolute z-50 w-full mt-1 bg-white border border-gray-200 rounded-lg shadow-lg", children: [
2646
- /* @__PURE__ */ jsx13("div", { className: "p-3 border-b border-gray-200", children: /* @__PURE__ */ jsxs9("div", { className: "relative", children: [
2647
- /* @__PURE__ */ jsx13(Search3, { className: "absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4" }),
2650
+ /* @__PURE__ */ jsxs9("div", { className: "p-3 border-b border-gray-200 flex", children: [
2651
+ /* @__PURE__ */ jsxs9("div", { className: "relative w-full", children: [
2652
+ /* @__PURE__ */ jsx13(Search3, { className: "absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4" }),
2653
+ /* @__PURE__ */ jsx13(
2654
+ "input",
2655
+ {
2656
+ ref: inputRef,
2657
+ type: "text",
2658
+ placeholder: searchPlaceholder,
2659
+ value: searchTerm,
2660
+ onChange: (e) => setSearchTerm(e.target.value),
2661
+ className: "w-full pl-10 pr-4 py-2 border border-gray-200 rounded-lg focus:ring-2 focus:ring-[#6B7C92] focus:border-transparent"
2662
+ }
2663
+ )
2664
+ ] }),
2648
2665
  /* @__PURE__ */ jsx13(
2649
- "input",
2666
+ "button",
2650
2667
  {
2651
- ref: inputRef,
2652
- type: "text",
2653
- placeholder: searchPlaceholder,
2654
- value: searchTerm,
2655
- onChange: (e) => setSearchTerm(e.target.value),
2656
- className: "w-full pl-10 pr-4 py-2 border border-gray-200 rounded-lg focus:ring-2 focus:ring-[#6B7C92] focus:border-transparent"
2668
+ type: "button",
2669
+ onClick: refresh,
2670
+ disabled,
2671
+ className: "px-3 py-2 border border-gray-300 text-gray-700 rounded-lg hover:bg-gray-50 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",
2672
+ title: "Rafra\xEEchir la liste",
2673
+ children: /* @__PURE__ */ jsx13(RefreshCw, { className: `w-4 h-4 ${disabled ? "animate-spin" : ""}` })
2674
+ }
2675
+ ),
2676
+ addElement && /* @__PURE__ */ jsx13(
2677
+ "button",
2678
+ {
2679
+ type: "button",
2680
+ onClick: addElement,
2681
+ className: "px-3 py-2 border border-gray-300 text-gray-700 rounded-lg hover:bg-gray-50 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",
2682
+ title: "Rafra\xEEchir la liste",
2683
+ children: /* @__PURE__ */ jsx13(Plus, { className: "w-4 h-4" })
2657
2684
  }
2658
2685
  )
2659
- ] }) }),
2686
+ ] }),
2660
2687
  /* @__PURE__ */ jsx13("div", { className: "max-h-60 overflow-y-auto", children: filteredOptions.length > 0 ? filteredOptions.map((option) => /* @__PURE__ */ jsxs9(
2661
2688
  "div",
2662
2689
  {
@@ -2681,7 +2708,7 @@ var SearchableSelect = ({
2681
2708
  };
2682
2709
 
2683
2710
  // src/components/common/ApprovalWorkflow.tsx
2684
- import { X as X5, Plus, Trash2, Users, Loader as Loader2, RotateCcw, Ban, Eye as Eye2, FileText as FileText2, History } from "lucide-react";
2711
+ import { X as X5, Plus as Plus2, Trash2, Users, Loader as Loader2, RotateCcw, Ban, Eye as Eye2, FileText as FileText2, History } from "lucide-react";
2685
2712
  import { Fragment as Fragment6, jsx as jsx14, jsxs as jsxs10 } from "react/jsx-runtime";
2686
2713
  var ApprovalWorkflow = ({
2687
2714
  process,
@@ -2752,7 +2779,7 @@ var ApprovalWorkflow = ({
2752
2779
  const caseInfo = response.data;
2753
2780
  setCaseData(caseInfo);
2754
2781
  setFormData({
2755
- title: caseInfo.title || "",
2782
+ title: caseInfo.title || title,
2756
2783
  file: null,
2757
2784
  description: caseInfo.description || "",
2758
2785
  status: caseInfo.status
@@ -3418,7 +3445,7 @@ var AddStageButton = ({
3418
3445
  onClick: () => setShowModal(true),
3419
3446
  classname: "gap-2",
3420
3447
  children: [
3421
- /* @__PURE__ */ jsx14(Plus, { className: "w-4 h-4" }),
3448
+ /* @__PURE__ */ jsx14(Plus2, { className: "w-4 h-4" }),
3422
3449
  /* @__PURE__ */ jsx14("span", { children: "Ajouter une personne" })
3423
3450
  ]
3424
3451
  }
@@ -3660,6 +3687,1123 @@ var useAlert = () => {
3660
3687
  }
3661
3688
  return context;
3662
3689
  };
3690
+
3691
+ // src/components/common/CommonSelect.tsx
3692
+ import { useEffect as useEffect12, useState as useState16 } from "react";
3693
+
3694
+ // src/services/VendorServices.ts
3695
+ var VENDORS_API_URL = `${API_URL}/accounting/vendors/`;
3696
+ var VendorServices = {
3697
+ createVendor: (data, token) => {
3698
+ const payload = { ...data };
3699
+ if (!payload.logo) {
3700
+ delete payload.logo;
3701
+ }
3702
+ return FetchApi.post(`${VENDORS_API_URL}`, payload, token);
3703
+ },
3704
+ getVendor: (id, token) => FetchApi.get(`${VENDORS_API_URL}${id}/`, token),
3705
+ getVendors: (token, params) => FetchApi.get(`${VENDORS_API_URL}?${new URLSearchParams(params).toString()}`, token),
3706
+ updateVendor: (id, data, token) => {
3707
+ const payload = { ...data };
3708
+ if (!payload.logo) {
3709
+ delete payload.logo;
3710
+ }
3711
+ return FetchApi.put(`${VENDORS_API_URL}${id}/`, payload, token);
3712
+ },
3713
+ deleteVendor: (id, token) => FetchApi.delete(`${VENDORS_API_URL}${id}/`, token)
3714
+ };
3715
+
3716
+ // dist/index.js
3717
+ import { jsx as jsx17 } from "react/jsx-runtime";
3718
+ import { jsx as jsx22, jsxs as jsxs13 } from "react/jsx-runtime";
3719
+ import { Link as Link3 } from "react-router-dom";
3720
+ import { jsx as jsx32, jsxs as jsxs22 } from "react/jsx-runtime";
3721
+ import React42, { useState as useState52, useEffect as useEffect42 } from "react";
3722
+ import { useLocation as useLocation3, useNavigate as useNavigate3 } from "react-router-dom";
3723
+ import {
3724
+ Settings as Settings3,
3725
+ ChevronLeft as ChevronLeft3,
3726
+ ChevronRight as ChevronRight2,
3727
+ Search as Search4,
3728
+ Bell as Bell2,
3729
+ User as User2,
3730
+ LogOut as LogOut2,
3731
+ Menu as Menu3,
3732
+ X as X22,
3733
+ Palette as Palette2,
3734
+ DollarSign as DollarSign2,
3735
+ HelpCircle as HelpCircle2,
3736
+ Building2 as Building22
3737
+ } from "lucide-react";
3738
+ import { clsx as clsx2 } from "clsx";
3739
+ import { twMerge as twMerge2 } from "tailwind-merge";
3740
+ import { createContext as createContext5, useContext as useContext5, useState as useState12, useEffect as useEffect9 } from "react";
3741
+ import { jsx as jsx42 } from "react/jsx-runtime";
3742
+ import { createContext as createContext22, useContext as useContext22, useEffect as useEffect22, useState as useState22 } from "react";
3743
+ import { jsx as jsx52 } from "react/jsx-runtime";
3744
+ import { createContext as createContext32, useContext as useContext32, useState as useState32, useCallback as useCallback3 } from "react";
3745
+ import { jsx as jsx62 } from "react/jsx-runtime";
3746
+ import { useState as useState42, useEffect as useEffect32 } from "react";
3747
+ import { jsx as jsx72, jsxs as jsxs32 } from "react/jsx-runtime";
3748
+ import { X as X6, Loader as Loader3, Eye as Eye3, FileText as FileText3, Check as Check2, XCircle as XCircle3, Edit as Edit2, CheckCircle as CheckCircle3, Clock as Clock2, AlertCircle as AlertCircle2, User as UserIcon2, Send as Send2 } from "lucide-react";
3749
+ import { useParams as useParams2, useSearchParams as useSearchParams3 } from "react-router-dom";
3750
+ import { Fragment as Fragment7, jsx as jsx82, jsxs as jsxs42 } from "react/jsx-runtime";
3751
+ import { Fragment as Fragment22, jsx as jsx92, jsxs as jsxs52 } from "react/jsx-runtime";
3752
+ import { useEffect as useEffect52, useState as useState62 } from "react";
3753
+ import { CheckCircle as CheckCircle22, XCircle as XCircle22, AlertTriangle as AlertTriangle2, Info as Info2, X as X32 } from "lucide-react";
3754
+ import { jsx as jsx102, jsxs as jsxs62 } from "react/jsx-runtime";
3755
+ import { ChevronLeft as ChevronLeft22, Download as Download3, Menu as Menu22, Settings as Settings22 } from "lucide-react";
3756
+ import { useState as useState72 } from "react";
3757
+ import { Fragment as Fragment32, jsx as jsx112, jsxs as jsxs72 } from "react/jsx-runtime";
3758
+ import { useEffect as useEffect62, useState as useState82 } from "react";
3759
+ import { useLocation as useLocation22, useNavigate as useNavigate22, useSearchParams as useSearchParams22, Link as Link22 } from "react-router-dom";
3760
+ import { ArrowDownAZ as ArrowDownAZ2, ArrowDownUp as ArrowDownUp2, ArrowUpAZ as ArrowUpAZ2, Download as Download22, Filter as Filter2, MoreVertical as MoreVertical2, Printer as Printer2, Search as Search22 } from "lucide-react";
3761
+ import { Fragment as Fragment42, jsx as jsx122, jsxs as jsxs82 } from "react/jsx-runtime";
3762
+ import { useState as useState102, useEffect as useEffect82 } from "react";
3763
+ import { useState as useState92, useRef as useRef2, useEffect as useEffect72 } from "react";
3764
+ import { Search as Search32, ChevronDown as ChevronDown2, X as X42, RefreshCw as RefreshCw2, Plus as Plus3 } from "lucide-react";
3765
+ import { Fragment as Fragment52, jsx as jsx132, jsxs as jsxs92 } from "react/jsx-runtime";
3766
+ import { X as X52, Plus as Plus22, Trash2 as Trash22, Users as Users2, Loader as Loader22, RotateCcw as RotateCcw2, Ban as Ban2, Eye as Eye22, FileText as FileText22, History as History2 } from "lucide-react";
3767
+ import { Fragment as Fragment62, jsx as jsx142, jsxs as jsxs102 } from "react/jsx-runtime";
3768
+ import { createContext as createContext42, useContext as useContext42, useState as useState112, useCallback as useCallback22 } from "react";
3769
+ import { jsx as jsx152, jsxs as jsxs112 } from "react/jsx-runtime";
3770
+ import { jsx as jsx162, jsxs as jsxs122 } from "react/jsx-runtime";
3771
+ import { useEffect as useEffect11, useState as useState14 } from "react";
3772
+ import { jsx as jsx172 } from "react/jsx-runtime";
3773
+ import { jsx as jsx222, jsxs as jsxs132 } from "react/jsx-runtime";
3774
+ import { Link as Link32 } from "react-router-dom";
3775
+ import { jsx as jsx322, jsxs as jsxs222 } from "react/jsx-runtime";
3776
+ import React422, { useState as useState522, useEffect as useEffect422 } from "react";
3777
+ import { useLocation as useLocation32, useNavigate as useNavigate32 } from "react-router-dom";
3778
+ import {
3779
+ Settings as Settings32,
3780
+ ChevronLeft as ChevronLeft32,
3781
+ ChevronRight as ChevronRight22,
3782
+ Search as Search42,
3783
+ Bell as Bell22,
3784
+ User as User22,
3785
+ LogOut as LogOut22,
3786
+ Menu as Menu32,
3787
+ X as X222,
3788
+ Palette as Palette22,
3789
+ DollarSign as DollarSign22,
3790
+ HelpCircle as HelpCircle22,
3791
+ Building2 as Building222
3792
+ } from "lucide-react";
3793
+ import { clsx as clsx22 } from "clsx";
3794
+ import { twMerge as twMerge22 } from "tailwind-merge";
3795
+ import { createContext as createContext52, useContext as useContext52, useState as useState122, useEffect as useEffect92 } from "react";
3796
+ import { jsx as jsx422 } from "react/jsx-runtime";
3797
+ import { createContext as createContext222, useContext as useContext222, useEffect as useEffect222, useState as useState222 } from "react";
3798
+ import { jsx as jsx522 } from "react/jsx-runtime";
3799
+ import { createContext as createContext322, useContext as useContext322, useState as useState322, useCallback as useCallback32 } from "react";
3800
+ import { jsx as jsx622 } from "react/jsx-runtime";
3801
+ import { useState as useState422, useEffect as useEffect322 } from "react";
3802
+ import { jsx as jsx722, jsxs as jsxs322 } from "react/jsx-runtime";
3803
+ import { X as X62, Loader as Loader32, Eye as Eye32, FileText as FileText32, Check as Check22, XCircle as XCircle32, Edit as Edit22, CheckCircle as CheckCircle32, Clock as Clock22, AlertCircle as AlertCircle22, User as UserIcon22, Send as Send22 } from "lucide-react";
3804
+ import { useParams as useParams22, useSearchParams as useSearchParams32 } from "react-router-dom";
3805
+ import { Fragment as Fragment72, jsx as jsx822, jsxs as jsxs422 } from "react/jsx-runtime";
3806
+ import { Fragment as Fragment222, jsx as jsx922, jsxs as jsxs522 } from "react/jsx-runtime";
3807
+ import { useEffect as useEffect522, useState as useState622 } from "react";
3808
+ import { CheckCircle as CheckCircle222, XCircle as XCircle222, AlertTriangle as AlertTriangle22, Info as Info22, X as X322 } from "lucide-react";
3809
+ import { jsx as jsx1022, jsxs as jsxs622 } from "react/jsx-runtime";
3810
+ import { ChevronLeft as ChevronLeft222, Download as Download32, Menu as Menu222, Settings as Settings222 } from "lucide-react";
3811
+ import { useState as useState722 } from "react";
3812
+ import { Fragment as Fragment322, jsx as jsx1122, jsxs as jsxs722 } from "react/jsx-runtime";
3813
+ import { useEffect as useEffect622, useState as useState822 } from "react";
3814
+ import { useLocation as useLocation222, useNavigate as useNavigate222, useSearchParams as useSearchParams222, Link as Link222 } from "react-router-dom";
3815
+ import { ArrowDownAZ as ArrowDownAZ22, ArrowDownUp as ArrowDownUp22, ArrowUpAZ as ArrowUpAZ22, Download as Download222, Filter as Filter22, MoreVertical as MoreVertical22, Printer as Printer22, Search as Search222 } from "lucide-react";
3816
+ import { Fragment as Fragment422, jsx as jsx1222, jsxs as jsxs822 } from "react/jsx-runtime";
3817
+ import { useState as useState1022, useEffect as useEffect822 } from "react";
3818
+ import { useState as useState922, useRef as useRef22, useEffect as useEffect722 } from "react";
3819
+ import { Search as Search322, ChevronDown as ChevronDown22, X as X422 } from "lucide-react";
3820
+ import { Fragment as Fragment522, jsx as jsx1322, jsxs as jsxs922 } from "react/jsx-runtime";
3821
+ import { X as X522, Plus as Plus32, Trash2 as Trash222, Users as Users22, Loader as Loader222, RotateCcw as RotateCcw22, Ban as Ban22, Eye as Eye222, FileText as FileText222, History as History22 } from "lucide-react";
3822
+ import { Fragment as Fragment622, jsx as jsx1422, jsxs as jsxs1022 } from "react/jsx-runtime";
3823
+ import { createContext as createContext422, useContext as useContext422, useState as useState1122, useCallback as useCallback222 } from "react";
3824
+ import { jsx as jsx1522, jsxs as jsxs1122 } from "react/jsx-runtime";
3825
+ import { jsx as jsx1622, jsxs as jsxs1222 } from "react/jsx-runtime";
3826
+ import { useState as useState13 } from "react";
3827
+ import { jsx as jsx18, jsxs as jsxs14 } from "react/jsx-runtime";
3828
+ import { jsx as jsx19, jsxs as jsxs15 } from "react/jsx-runtime";
3829
+ var PrimaryButton2 = ({
3830
+ loading = false,
3831
+ children,
3832
+ classname = "",
3833
+ variant = "full",
3834
+ ...props
3835
+ }) => /* @__PURE__ */ jsx17(
3836
+ "button",
3837
+ {
3838
+ type: "submit",
3839
+ disabled: loading || props.disabled,
3840
+ className: `px-4 py-2 text-sm rounded-lg hover:bg-opacity-80 transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex justify-center items-center ${classname} ${variant === "full" ? "bg-[#6A8A82] text-white" : variant === "outline" ? "border border-[#6A8A82] text-[#6A8A82] bg-transparent" : "bg-transparent text-[#6A8A82]"}`,
3841
+ ...props,
3842
+ children: loading ? "Connexion en cours..." : children
3843
+ }
3844
+ );
3845
+ var Buttons_default2 = PrimaryButton2;
3846
+ var Modal2 = ({ title, description, width, open, onClose, children }) => {
3847
+ if (!open) return null;
3848
+ return /* @__PURE__ */ jsx22("div", { className: "fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50", children: /* @__PURE__ */ jsxs13("div", { className: `bg-white rounded-lg pt-4 px-6 mx-4 `, children: [
3849
+ /* @__PURE__ */ jsxs13("div", { className: "flex justify-between items-start mb-6", children: [
3850
+ /* @__PURE__ */ jsxs13("div", { children: [
3851
+ /* @__PURE__ */ jsx22("h3", { className: "text-xl font-semibold text-tuatara flex items-center space-x-2", children: /* @__PURE__ */ jsx22("span", { children: title }) }),
3852
+ description && /* @__PURE__ */ jsx22("p", { className: "text-sm text-gray-600 mt-1", children: description })
3853
+ ] }),
3854
+ /* @__PURE__ */ jsx22(
3855
+ "button",
3856
+ {
3857
+ onClick: onClose,
3858
+ className: "text-gray-400 hover:text-gray-600 text-xl",
3859
+ "aria-label": "Close modal",
3860
+ children: "\u2715"
3861
+ }
3862
+ )
3863
+ ] }),
3864
+ /* @__PURE__ */ jsx22("div", { className: "w-full max-h-[80vh] overflow-y-auto mb-1", children })
3865
+ ] }) });
3866
+ };
3867
+ var Modals_default2 = Modal2;
3868
+ var InputField2 = ({
3869
+ label,
3870
+ name,
3871
+ type = "text",
3872
+ value,
3873
+ placeholder,
3874
+ required = false,
3875
+ disabled = false,
3876
+ error,
3877
+ onChange,
3878
+ onBlur
3879
+ }) => {
3880
+ return /* @__PURE__ */ jsxs22("div", { className: "flex flex-col gap-1 w-full", children: [
3881
+ label && /* @__PURE__ */ jsxs22("label", { htmlFor: name, className: "block text-gray-700 text-sm font-medium mb-2", children: [
3882
+ label,
3883
+ " ",
3884
+ required && /* @__PURE__ */ jsx32("span", { className: "text-red-500", children: "*" })
3885
+ ] }),
3886
+ /* @__PURE__ */ jsx32(
3887
+ "input",
3888
+ {
3889
+ id: name,
3890
+ name,
3891
+ type,
3892
+ value,
3893
+ placeholder,
3894
+ required,
3895
+ disabled,
3896
+ onChange,
3897
+ onBlur,
3898
+ className: `w-full px-3 py-2 border border-[#D9D9D9] focus:ring-2 focus:ring-[#6A8A82]/20
3899
+ ${error ? "border-red-500" : "border-gray-300"}
3900
+ ${disabled ? "bg-gray-100 cursor-not-allowed" : ""}
3901
+ `
3902
+ }
3903
+ ),
3904
+ error && /* @__PURE__ */ jsx32("p", { className: "text-xs text-red-500", children: error })
3905
+ ] });
3906
+ };
3907
+ var TextInput2 = (props) => {
3908
+ return /* @__PURE__ */ jsx32(InputField2, { ...props, type: "text" });
3909
+ };
3910
+ var ThemeContext2 = createContext5(void 0);
3911
+ var ADDRESS_IP2 = "localhost:8000";
3912
+ var ADDRESS_IP_URL2 = `http://${ADDRESS_IP2}/`;
3913
+ var API_URL2 = `${ADDRESS_IP_URL2}api`;
3914
+ var API_BASE_URL3 = `${API_URL2}/core/auth/`;
3915
+ var SessionContext2 = createContext22(void 0);
3916
+ var API_BASE_URL22 = `${API_URL2}/core/auth/`;
3917
+ var USERS_API_URL2 = `${API_URL2}/core/users/`;
3918
+ var ToastContext2 = createContext32(void 0);
3919
+ var APPROVAL_API_URL2 = `${API_URL2}/approvals/cases/`;
3920
+ var AlertContext2 = createContext42(void 0);
3921
+ var VENDORS_API_URL2 = `${API_URL2}/accounting/vendors/`;
3922
+ var ThemeContext22 = createContext52(void 0);
3923
+ var ADDRESS_IP22 = "localhost:8000";
3924
+ var ADDRESS_IP_URL22 = `http://${ADDRESS_IP22}/`;
3925
+ var API_URL22 = `${ADDRESS_IP_URL22}api`;
3926
+ var API_BASE_URL32 = `${API_URL22}/core/auth/`;
3927
+ var SessionContext22 = createContext222(void 0);
3928
+ var API_BASE_URL222 = `${API_URL22}/core/auth/`;
3929
+ var USERS_API_URL22 = `${API_URL22}/core/users/`;
3930
+ var ToastContext22 = createContext322(void 0);
3931
+ var APPROVAL_API_URL22 = `${API_URL22}/approvals/cases/`;
3932
+ var AlertContext22 = createContext422(void 0);
3933
+ var URI = `${API_URL2}/core/departments/`;
3934
+ var URI2 = `${API_URL2}/accounting/profit-or-cost-center/`;
3935
+ var COST_URI = `${API_URL2}/accounting/cost-center/`;
3936
+ var PROFIT_URI = `${API_URL2}/accounting/profit-center/`;
3937
+
3938
+ // src/components/common/FormVendor.tsx
3939
+ import { useState as useState15 } from "react";
3940
+ import { jsx as jsx20, jsxs as jsxs16 } from "react/jsx-runtime";
3941
+ var MinimalVendorForm = ({
3942
+ isOpen,
3943
+ onClose,
3944
+ object,
3945
+ from = "procurement",
3946
+ refresh = () => {
3947
+ }
3948
+ }) => {
3949
+ const [formData, setFormData] = useState15(object || {
3950
+ from_module: from ?? null,
3951
+ legal_name: "",
3952
+ trading_name: ""
3953
+ });
3954
+ const [errors, setErrors] = useState15({});
3955
+ const [loading, setLoading] = useState15(false);
3956
+ const { token } = useSession();
3957
+ const { success, error: showError } = useToast();
3958
+ const handleInputChange = (e) => {
3959
+ const { name, value } = e.target;
3960
+ setFormData((prev) => ({ ...prev, [name]: value }));
3961
+ if (errors[name]) {
3962
+ setErrors((prev) => ({ ...prev, [name]: void 0 }));
3963
+ }
3964
+ };
3965
+ const handleSelectChange = (e) => {
3966
+ const { name, value } = e.target;
3967
+ setFormData((prev) => ({ ...prev, [name]: value }));
3968
+ };
3969
+ const handleTextareaChange = (e) => {
3970
+ const { name, value } = e.target;
3971
+ setFormData((prev) => ({ ...prev, [name]: value }));
3972
+ };
3973
+ const validateForm = () => {
3974
+ const newErrors = {};
3975
+ if (!formData.legal_name?.trim()) {
3976
+ newErrors.legal_name = "La raison sociale est obligatoire";
3977
+ }
3978
+ if (formData.email && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(formData.email)) {
3979
+ newErrors.email = "Format d'email invalide";
3980
+ }
3981
+ if (formData.iban && formData.iban.length > 0 && formData.iban.length < 15) {
3982
+ newErrors.iban = "Format IBAN invalide";
3983
+ }
3984
+ setErrors(newErrors);
3985
+ return Object.keys(newErrors).length === 0;
3986
+ };
3987
+ const handleSaveVendor = async (entityData) => {
3988
+ try {
3989
+ if (object && object.id) {
3990
+ await VendorServices.updateVendor(object.id, entityData, token);
3991
+ success("Entit\xE9 modifi\xE9e avec succ\xE8s !");
3992
+ } else {
3993
+ await VendorServices.createVendor(entityData, token);
3994
+ success("Entit\xE9 cr\xE9\xE9e avec succ\xE8s !");
3995
+ }
3996
+ refresh();
3997
+ onClose();
3998
+ } catch (error) {
3999
+ console.error(error);
4000
+ showError("Erreur lors de l'enregistrement de l'entit\xE9");
4001
+ }
4002
+ };
4003
+ const handleSubmit = async (e) => {
4004
+ e.preventDefault();
4005
+ if (!validateForm()) return;
4006
+ setLoading(true);
4007
+ try {
4008
+ await handleSaveVendor(formData);
4009
+ } finally {
4010
+ setLoading(false);
4011
+ }
4012
+ };
4013
+ if (!isOpen) return null;
4014
+ return /* @__PURE__ */ jsx20(
4015
+ Modals_default2,
4016
+ {
4017
+ title: "Ajouter un fournisseur",
4018
+ width: "w-[100%]",
4019
+ description: ``,
4020
+ open: isOpen,
4021
+ onClose,
4022
+ children: /* @__PURE__ */ jsxs16("form", { onSubmit: handleSubmit, className: "p-", children: [
4023
+ /* @__PURE__ */ jsx20("div", { className: "space-y-4", children: /* @__PURE__ */ jsxs16("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
4024
+ /* @__PURE__ */ jsx20(
4025
+ TextInput2,
4026
+ {
4027
+ label: "Raison sociale",
4028
+ name: "legal_name",
4029
+ value: formData.legal_name || "",
4030
+ placeholder: "Nom l\xE9gal de l'entit\xE9",
4031
+ required: true,
4032
+ error: errors.legal_name,
4033
+ onChange: handleInputChange
4034
+ }
4035
+ ),
4036
+ /* @__PURE__ */ jsx20(
4037
+ TextInput2,
4038
+ {
4039
+ label: "Nom commercial",
4040
+ name: "trading_name",
4041
+ value: formData.trading_name || "",
4042
+ placeholder: "Nom commercial (optionnel)",
4043
+ onChange: handleInputChange
4044
+ }
4045
+ )
4046
+ ] }) }),
4047
+ /* @__PURE__ */ jsxs16("div", { className: "flex justify-between pt-6 mt-8", children: [
4048
+ /* @__PURE__ */ jsx20(
4049
+ "button",
4050
+ {
4051
+ type: "button",
4052
+ onClick: onClose,
4053
+ className: "px-6 py-2 border border-gray-300 text-gray-700 rounded-lg hover:bg-gray-50 transition-colors",
4054
+ children: "Annuler"
4055
+ }
4056
+ ),
4057
+ /* @__PURE__ */ jsx20(
4058
+ Buttons_default2,
4059
+ {
4060
+ type: "button",
4061
+ onClick: handleSubmit,
4062
+ disabled: loading,
4063
+ children: loading ? "chargement..." : "Enregistrer l'entit\xE9"
4064
+ }
4065
+ )
4066
+ ] })
4067
+ ] })
4068
+ }
4069
+ );
4070
+ };
4071
+
4072
+ // src/services/DepartmentServices.ts
4073
+ var URI3 = `${API_URL}/core/departments/`;
4074
+ var DepartmentServices = {
4075
+ create: (data) => FetchApi.post(`${URI3}`, data),
4076
+ get: (id) => FetchApi.get(`${URI3}${id}/`),
4077
+ list: (params) => FetchApi.get(`${URI3}?${new URLSearchParams(params).toString()}`),
4078
+ update: (id, data) => FetchApi.put(`${URI3}${id}/`, data),
4079
+ delete: (id) => FetchApi.delete(`${URI3}${id}/`)
4080
+ };
4081
+
4082
+ // src/services/ProfitCostsServices.ts
4083
+ var URI4 = `${API_URL}/accounting/profit-or-cost-center/`;
4084
+ var COST_URI2 = `${API_URL}/accounting/cost-center/`;
4085
+ var CostServices = {
4086
+ create: (data) => FetchApi.post(`${COST_URI2}`, data),
4087
+ get: (id) => FetchApi.get(`${COST_URI2}${id}/`),
4088
+ list: (params) => FetchApi.get(`${COST_URI2}?${new URLSearchParams(params).toString()}`),
4089
+ update: (id, data) => FetchApi.put(`${COST_URI2}${id}/`, data),
4090
+ delete: (id) => FetchApi.delete(`${COST_URI2}${id}/`)
4091
+ };
4092
+ var PROFIT_URI2 = `${API_URL}/accounting/profit-center/`;
4093
+
4094
+ // src/components/common/CommonSelect.tsx
4095
+ import { jsx as jsx21, jsxs as jsxs17 } from "react/jsx-runtime";
4096
+ var SelectVendor = ({
4097
+ value,
4098
+ onSelect
4099
+ }) => {
4100
+ const [showModal, setShowModal] = useState16(false);
4101
+ const [selectedVendor, setSelectedVendor] = useState16(null);
4102
+ const { token, activeBusinessEntity } = useSession();
4103
+ const [vendors, setVendors] = useState16(() => {
4104
+ const cacheKey = `vendors_cache_${activeBusinessEntity?.id || "default"}`;
4105
+ const cached = sessionStorage.getItem(cacheKey);
4106
+ return cached ? JSON.parse(cached) : [];
4107
+ });
4108
+ const [loadingVendors, setLoadingVendors] = useState16(false);
4109
+ useEffect12(() => {
4110
+ const cacheKey = `vendors_cache_${activeBusinessEntity?.id || "default"}`;
4111
+ const cached = sessionStorage.getItem(cacheKey);
4112
+ if (!cached) {
4113
+ loadVendors();
4114
+ } else {
4115
+ setVendors(JSON.parse(cached));
4116
+ }
4117
+ }, [activeBusinessEntity?.id]);
4118
+ const getVendorOptions = () => {
4119
+ return vendors.filter((vendor) => vendor.id !== void 0).map((vendor) => ({
4120
+ value: vendor.id,
4121
+ label: `${vendor.legal_name} [${vendor.trading_name}]`,
4122
+ object: vendor
4123
+ }));
4124
+ };
4125
+ const loadVendors = async () => {
4126
+ if (!token) {
4127
+ console.error("Vous devez etre connect\xE9 pour voir les organisations");
4128
+ return;
4129
+ }
4130
+ try {
4131
+ setLoadingVendors(true);
4132
+ const result = await VendorServices.getVendors(token, { business_entity_id: activeBusinessEntity?.id });
4133
+ setVendors(result.data);
4134
+ const cacheKey = `vendors_cache_${activeBusinessEntity?.id || "default"}`;
4135
+ sessionStorage.setItem(cacheKey, JSON.stringify(result.data));
4136
+ } catch (error) {
4137
+ console.error(error);
4138
+ } finally {
4139
+ setLoadingVendors(false);
4140
+ }
4141
+ };
4142
+ const handleRefresh = () => {
4143
+ const cacheKey = `vendors_cache_${activeBusinessEntity?.id || "default"}`;
4144
+ sessionStorage.removeItem(cacheKey);
4145
+ loadVendors();
4146
+ };
4147
+ return /* @__PURE__ */ jsxs17("div", { children: [
4148
+ /* @__PURE__ */ jsx21("div", { className: "flex justify-between ", children: /* @__PURE__ */ jsx21("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Ajouter un fournisseur" }) }),
4149
+ /* @__PURE__ */ jsx21(
4150
+ SearchableSelect,
4151
+ {
4152
+ value,
4153
+ options: getVendorOptions(),
4154
+ placeholder: "S\xE9lectionner un fournisseur...",
4155
+ searchPlaceholder: "Rechercher...",
4156
+ onSelect,
4157
+ disabled: loadingVendors,
4158
+ refresh: handleRefresh,
4159
+ addElement: () => {
4160
+ setShowModal(true);
4161
+ }
4162
+ },
4163
+ "fourni" + value
4164
+ ),
4165
+ loadingVendors && /* @__PURE__ */ jsx21("p", { className: "text-sm text-gray-500 mt-2", children: "Chargement des fournisseurs..." }),
4166
+ showModal && /* @__PURE__ */ jsx21(
4167
+ MinimalVendorForm,
4168
+ {
4169
+ object: selectedVendor,
4170
+ isOpen: showModal,
4171
+ onClose: () => setShowModal(false),
4172
+ refresh: handleRefresh
4173
+ },
4174
+ `entity-modal-${selectedVendor?.id}`
4175
+ )
4176
+ ] });
4177
+ };
4178
+ var SelectUser = ({
4179
+ value,
4180
+ onSelect
4181
+ }) => {
4182
+ const { token, activeBusinessEntity } = useSession();
4183
+ const [users, setUsers] = useState16(() => {
4184
+ const cacheKey = `users_cache_${activeBusinessEntity?.id || "default"}`;
4185
+ const cached = sessionStorage.getItem(cacheKey);
4186
+ return cached ? JSON.parse(cached) : [];
4187
+ });
4188
+ const [loading, setLoading] = useState16(false);
4189
+ useEffect12(() => {
4190
+ const cacheKey = `users_cache_${activeBusinessEntity?.id || "default"}`;
4191
+ const cached = sessionStorage.getItem(cacheKey);
4192
+ if (!cached) {
4193
+ loadUsers();
4194
+ } else {
4195
+ setUsers(JSON.parse(cached));
4196
+ }
4197
+ }, [activeBusinessEntity?.id]);
4198
+ const loadUsers = async () => {
4199
+ if (!token) return;
4200
+ try {
4201
+ setLoading(true);
4202
+ const result = await UserServices.getUsers(token);
4203
+ setUsers(result.data);
4204
+ } catch (error) {
4205
+ console.error(error);
4206
+ } finally {
4207
+ setLoading(false);
4208
+ }
4209
+ };
4210
+ const handleRefresh = () => {
4211
+ const cacheKey = `vendors_cache_${activeBusinessEntity?.id || "default"}`;
4212
+ sessionStorage.removeItem(cacheKey);
4213
+ loadUsers();
4214
+ };
4215
+ const userFilterFunction = (option, searchTerm) => {
4216
+ const user = users.find((u) => u.id === option.value);
4217
+ if (!user) return false;
4218
+ const searchLower = searchTerm.toLowerCase();
4219
+ return user.first_name?.toLowerCase().includes(searchLower) || user.last_name?.toLowerCase().includes(searchLower) || user.email?.toLowerCase().includes(searchLower);
4220
+ };
4221
+ const getUserOptions = () => {
4222
+ return users.map((user) => ({
4223
+ value: user.id,
4224
+ label: `${user.first_name} ${user.last_name}`,
4225
+ content: /* @__PURE__ */ jsx21("div", { className: "flex items-center space-x-3", children: /* @__PURE__ */ jsxs17("div", { className: "flex-1", children: [
4226
+ /* @__PURE__ */ jsxs17("div", { className: "font-medium text-gray-900", children: [
4227
+ user.first_name,
4228
+ " ",
4229
+ user.last_name
4230
+ ] }),
4231
+ /* @__PURE__ */ jsx21("div", { className: "text-sm text-gray-500", children: user.email })
4232
+ ] }) })
4233
+ }));
4234
+ };
4235
+ return /* @__PURE__ */ jsxs17("div", { children: [
4236
+ /* @__PURE__ */ jsx21("div", { className: "flex justify-between ", children: /* @__PURE__ */ jsx21("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "S\xE9lectionner un utilisateur" }) }),
4237
+ /* @__PURE__ */ jsx21(
4238
+ SearchableSelect,
4239
+ {
4240
+ value,
4241
+ options: getUserOptions(),
4242
+ placeholder: "S\xE9lectionner un utilisateur ...",
4243
+ searchPlaceholder: "Rechercher...",
4244
+ onSelect,
4245
+ disabled: loading,
4246
+ refresh: handleRefresh
4247
+ },
4248
+ "user" + value
4249
+ ),
4250
+ loading && /* @__PURE__ */ jsx21("p", { className: "text-sm text-gray-500 mt-2", children: "Chargement des utilisateurs..." })
4251
+ ] });
4252
+ };
4253
+ var SelectDepartment = ({
4254
+ value,
4255
+ onSelect
4256
+ }) => {
4257
+ const { token, activeBusinessEntity } = useSession();
4258
+ const [departments, setDepartments] = useState16(() => {
4259
+ const cacheKey = `departments_cache_${activeBusinessEntity?.id || "default"}`;
4260
+ const cached = sessionStorage.getItem(cacheKey);
4261
+ return cached ? JSON.parse(cached) : [];
4262
+ });
4263
+ const [loading, setLoading] = useState16(false);
4264
+ useEffect12(() => {
4265
+ const cacheKey = `departments_cache_${activeBusinessEntity?.id || "default"}`;
4266
+ const cached = sessionStorage.getItem(cacheKey);
4267
+ if (!cached) {
4268
+ loadDepartments();
4269
+ } else {
4270
+ setDepartments(JSON.parse(cached));
4271
+ }
4272
+ }, [activeBusinessEntity?.id]);
4273
+ const loadDepartments = async () => {
4274
+ if (!token) return;
4275
+ try {
4276
+ setLoading(true);
4277
+ const result = await DepartmentServices.list({ business_entity_id: activeBusinessEntity?.id });
4278
+ if (result.success) {
4279
+ setDepartments(result.data);
4280
+ const cacheKey = `departments_cache_${activeBusinessEntity?.id || "default"}`;
4281
+ sessionStorage.setItem(cacheKey, JSON.stringify(result.data));
4282
+ }
4283
+ } catch (error) {
4284
+ console.error(error);
4285
+ } finally {
4286
+ setLoading(false);
4287
+ }
4288
+ };
4289
+ const handleRefresh = () => {
4290
+ const cacheKey = `departments_cache_${activeBusinessEntity?.id || "default"}`;
4291
+ sessionStorage.removeItem(cacheKey);
4292
+ loadDepartments();
4293
+ };
4294
+ const getDepartmentOptions = () => {
4295
+ return departments.map((dept) => ({
4296
+ value: dept.id,
4297
+ label: dept.name
4298
+ }));
4299
+ };
4300
+ return /* @__PURE__ */ jsxs17("div", { children: [
4301
+ /* @__PURE__ */ jsx21("div", { className: "flex justify-between ", children: /* @__PURE__ */ jsx21("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "S\xE9lectionner un d\xE9partement" }) }),
4302
+ /* @__PURE__ */ jsx21(
4303
+ SearchableSelect,
4304
+ {
4305
+ value,
4306
+ options: getDepartmentOptions(),
4307
+ placeholder: "S\xE9lectionner un d\xE9partement ...",
4308
+ searchPlaceholder: "Rechercher...",
4309
+ onSelect,
4310
+ disabled: loading,
4311
+ refresh: handleRefresh
4312
+ },
4313
+ "dept" + value
4314
+ ),
4315
+ loading && /* @__PURE__ */ jsx21("p", { className: "text-sm text-gray-500 mt-2", children: "Chargement des d\xE9partements..." })
4316
+ ] });
4317
+ };
4318
+ var SelectCostCenter = ({
4319
+ value,
4320
+ onSelect
4321
+ }) => {
4322
+ const { token, activeBusinessEntity } = useSession();
4323
+ const [costCenters, setCostCenters] = useState16(() => {
4324
+ const cacheKey = `cost_centers_cache_${activeBusinessEntity?.id || "default"}`;
4325
+ const cached = sessionStorage.getItem(cacheKey);
4326
+ return cached ? JSON.parse(cached) : [];
4327
+ });
4328
+ const [loading, setLoading] = useState16(false);
4329
+ useEffect12(() => {
4330
+ const cacheKey = `cost_centers_cache_${activeBusinessEntity?.id || "default"}`;
4331
+ const cached = sessionStorage.getItem(cacheKey);
4332
+ if (!cached) {
4333
+ loadCostCenters();
4334
+ } else {
4335
+ setCostCenters(JSON.parse(cached));
4336
+ }
4337
+ }, [activeBusinessEntity?.id]);
4338
+ const loadCostCenters = async () => {
4339
+ if (!token) return;
4340
+ try {
4341
+ setLoading(true);
4342
+ const result = await CostServices.list({ business_entity_id: activeBusinessEntity?.id });
4343
+ if (result.success) {
4344
+ setCostCenters(result.data);
4345
+ const cacheKey = `cost_centers_cache_${activeBusinessEntity?.id || "default"}`;
4346
+ sessionStorage.setItem(cacheKey, JSON.stringify(result.data));
4347
+ }
4348
+ } catch (error) {
4349
+ console.error(error);
4350
+ } finally {
4351
+ setLoading(false);
4352
+ }
4353
+ };
4354
+ const handleRefresh = () => {
4355
+ const cacheKey = `cost_centers_cache_${activeBusinessEntity?.id || "default"}`;
4356
+ sessionStorage.removeItem(cacheKey);
4357
+ loadCostCenters();
4358
+ };
4359
+ const getCostCenterOptions = () => {
4360
+ return costCenters.map((center) => ({
4361
+ value: center.id,
4362
+ label: `${center.code ? `[${center.code}] ` : ""}${center.name}`,
4363
+ content: /* @__PURE__ */ jsx21("div", { className: "flex items-center space-x-3", children: /* @__PURE__ */ jsxs17("div", { className: "flex-1", children: [
4364
+ /* @__PURE__ */ jsx21("div", { className: "font-medium text-gray-900", children: center.name }),
4365
+ center.code && /* @__PURE__ */ jsxs17("div", { className: "text-sm text-gray-500", children: [
4366
+ "Code: ",
4367
+ center.code
4368
+ ] })
4369
+ ] }) })
4370
+ }));
4371
+ };
4372
+ return /* @__PURE__ */ jsxs17("div", { children: [
4373
+ /* @__PURE__ */ jsx21("div", { className: "flex justify-between ", children: /* @__PURE__ */ jsx21("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "S\xE9lectionner un centre de co\xFBt" }) }),
4374
+ /* @__PURE__ */ jsx21(
4375
+ SearchableSelect,
4376
+ {
4377
+ value,
4378
+ options: getCostCenterOptions(),
4379
+ placeholder: "S\xE9lectionner un centre de co\xFBt ...",
4380
+ searchPlaceholder: "Rechercher...",
4381
+ onSelect,
4382
+ disabled: loading,
4383
+ refresh: handleRefresh
4384
+ },
4385
+ "cost" + value
4386
+ ),
4387
+ loading && /* @__PURE__ */ jsx21("p", { className: "text-sm text-gray-500 mt-2", children: "Chargement des centres de co\xFBt..." })
4388
+ ] });
4389
+ };
4390
+
4391
+ // src/components/common/Choices.tsx
4392
+ import { jsx as jsx23 } from "react/jsx-runtime";
4393
+ var CHOICES = {
4394
+ INVOICE_TYPES: [
4395
+ { value: "sale", label: { fr: "Vente", en: "Sale", default: "Sale" } },
4396
+ { value: "purchase", label: { fr: "Bordereau d'achat", en: "Purchase slip", default: "Purchase" } }
4397
+ ],
4398
+ PAYMENT_METHODS: [
4399
+ { value: "cash", label: { fr: "Esp\xE8ce", en: "Cash", default: "Cash" } },
4400
+ { value: "card", label: { fr: "Carte bancaire", en: "Card", default: "Card" } },
4401
+ { value: "check", label: { fr: "Ch\xE8que", en: "Check", default: "Check" } },
4402
+ { value: "mobile-money", label: { fr: "Mobile money", en: "Mobile money", default: "Mobile money" } },
4403
+ { value: "transfer", label: { fr: "Virement bancaire", en: "Bank transfer", default: "Transfer" } },
4404
+ { value: "deferred", label: { fr: "\xC0 terme", en: "Deferred", default: "Deferred" } }
4405
+ ],
4406
+ TEMPLATES: [
4407
+ { value: "B2B", label: { fr: "Client entreprise (B2B)", en: "Business client (B2B)", default: "B2B" } },
4408
+ { value: "B2F", label: { fr: "Client international (B2F)", en: "International client (B2F)", default: "B2F" } },
4409
+ { value: "B2G", label: { fr: "Institution gouvernementale (B2G)", en: "Government institution (B2G)", default: "B2G" } },
4410
+ { value: "B2C", label: { fr: "Particulier (B2C)", en: "Individual (B2C)", default: "B2C" } }
4411
+ ],
4412
+ FOREIGN_CURRENCIES: [
4413
+ { value: "XOF", label: { fr: "Franc CFA", en: "CFA Franc", default: "XOF" } },
4414
+ { value: "USD", label: { fr: "Dollar am\xE9ricain", en: "US Dollar", default: "USD" } },
4415
+ { value: "EUR", label: { fr: "Euro", en: "Euro", default: "EUR" } },
4416
+ { value: "JPY", label: { fr: "Yen japonais", en: "Japanese Yen", default: "JPY" } },
4417
+ { value: "CAD", label: { fr: "Dollar canadien", en: "Canadian Dollar", default: "CAD" } },
4418
+ { value: "GBP", label: { fr: "Livre sterling", en: "British Pound", default: "GBP" } },
4419
+ { value: "AUD", label: { fr: "Dollar australien", en: "Australian Dollar", default: "AUD" } },
4420
+ { value: "CNH", label: { fr: "Yuan chinois", en: "Chinese Yuan", default: "CNH" } },
4421
+ { value: "CHF", label: { fr: "Franc suisse", en: "Swiss Franc", default: "CHF" } },
4422
+ { value: "HKD", label: { fr: "Dollar de Hong Kong", en: "Hong Kong Dollar", default: "HKD" } },
4423
+ { value: "NZD", label: { fr: "Dollar n\xE9o-z\xE9landais", en: "New Zealand Dollar", default: "NZD" } }
4424
+ ],
4425
+ TAXES: [
4426
+ { value: "TVA", label: { fr: "TVA 18 %", en: "VAT 18%", default: "VAT 18%" } },
4427
+ { value: "TVAB", label: { fr: "TVA r\xE9duite 9 %", en: "Reduced VAT 9%", default: "VAT 9%" } },
4428
+ { value: "TVAC", label: { fr: "TVA exon\xE9r\xE9e 0 %", en: "Exempt VAT 0%", default: "VAT 0%" } },
4429
+ { value: "TVAD", label: { fr: "TVA exon\xE9r\xE9e TEE/RME 0 %", en: "Exempt VAT TEE/RME 0%", default: "VAT 0%" } }
4430
+ ],
4431
+ LEGAL_FORMS: [
4432
+ { value: "EI", label: { fr: "Entreprise Individuelle (EI)", en: "Sole Proprietorship (EI)", default: "Sole Proprietorship (EI)" } },
4433
+ { value: "SARL", label: { fr: "Soci\xE9t\xE9 \xE0 Responsabilit\xE9 Limit\xE9e (SARL)", en: "Limited Liability Company (LLC)", default: "LLC (SARL)" } },
4434
+ { value: "SUARL", label: { fr: "Soci\xE9t\xE9 Unipersonnelle \xE0 Responsabilit\xE9 Limit\xE9e (SUARL)", en: "Single-Member LLC (SUARL)", default: "Single-Member LLC (SUARL)" } },
4435
+ { value: "SA", label: { fr: "Soci\xE9t\xE9 Anonyme (SA)", en: "Corporation (SA)", default: "Corporation (SA)" } },
4436
+ { value: "SNC", label: { fr: "Soci\xE9t\xE9 en Nom Collectif (SNC)", en: "General Partnership (SNC)", default: "General Partnership (SNC)" } },
4437
+ { value: "SCS", label: { fr: "Soci\xE9t\xE9 en Commandite Simple (SCS)", en: "Limited Partnership (SCS)", default: "Limited Partnership (SCS)" } },
4438
+ { value: "GIE", label: { fr: "Groupement d'Int\xE9r\xEAt \xC9conomique (GIE)", en: "Economic Interest Grouping (GIE)", default: "Economic Interest Grouping (GIE)" } },
4439
+ { value: "COOP", label: { fr: "Soci\xE9t\xE9 Coop\xE9rative", en: "Cooperative Society", default: "Cooperative Society" } },
4440
+ { value: "SC", label: { fr: "Soci\xE9t\xE9 Civile (SC)", en: "Civil Company (SC)", default: "Civil Company (SC)" } }
4441
+ ],
4442
+ COUNTRIES: [
4443
+ { value: "AFG", label: { fr: "Afghanistan", en: "Afghanistan", default: "Afghanistan" } },
4444
+ { value: "ALB", label: { fr: "Albanie", en: "Albania", default: "Albania" } },
4445
+ { value: "DZA", label: { fr: "Alg\xE9rie", en: "Algeria", default: "Algeria" } },
4446
+ { value: "AND", label: { fr: "Andorre", en: "Andorra", default: "Andorra" } },
4447
+ { value: "AGO", label: { fr: "Angola", en: "Angola", default: "Angola" } },
4448
+ { value: "ATG", label: { fr: "Antigua-et-Barbuda", en: "Antigua and Barbuda", default: "Antigua and Barbuda" } },
4449
+ { value: "ARG", label: { fr: "Argentine", en: "Argentina", default: "Argentina" } },
4450
+ { value: "ARM", label: { fr: "Arm\xE9nie", en: "Armenia", default: "Armenia" } },
4451
+ { value: "AUS", label: { fr: "Australie", en: "Australia", default: "Australia" } },
4452
+ { value: "AUT", label: { fr: "Autriche", en: "Austria", default: "Austria" } },
4453
+ { value: "AZE", label: { fr: "Azerba\xEFdjan", en: "Azerbaijan", default: "Azerbaijan" } },
4454
+ { value: "BHS", label: { fr: "Bahamas", en: "Bahamas", default: "Bahamas" } },
4455
+ { value: "BHR", label: { fr: "Bahre\xEFn", en: "Bahrain", default: "Bahrain" } },
4456
+ { value: "BGD", label: { fr: "Bangladesh", en: "Bangladesh", default: "Bangladesh" } },
4457
+ { value: "BRB", label: { fr: "Barbade", en: "Barbados", default: "Barbados" } },
4458
+ { value: "BLR", label: { fr: "Bi\xE9lorussie", en: "Belarus", default: "Belarus" } },
4459
+ { value: "BEL", label: { fr: "Belgique", en: "Belgium", default: "Belgium" } },
4460
+ { value: "BLZ", label: { fr: "Belize", en: "Belize", default: "Belize" } },
4461
+ { value: "BEN", label: { fr: "B\xE9nin", en: "Benin", default: "Benin" } },
4462
+ { value: "BTN", label: { fr: "Bhoutan", en: "Bhutan", default: "Bhutan" } },
4463
+ { value: "BOL", label: { fr: "Bolivie", en: "Bolivia", default: "Bolivia" } },
4464
+ { value: "BIH", label: { fr: "Bosnie-Herz\xE9govine", en: "Bosnia and Herzegovina", default: "Bosnia and Herzegovina" } },
4465
+ { value: "BWA", label: { fr: "Botswana", en: "Botswana", default: "Botswana" } },
4466
+ { value: "BRA", label: { fr: "Br\xE9sil", en: "Brazil", default: "Brazil" } },
4467
+ { value: "BRN", label: { fr: "Brunei", en: "Brunei", default: "Brunei" } },
4468
+ { value: "BGR", label: { fr: "Bulgarie", en: "Bulgaria", default: "Bulgaria" } },
4469
+ { value: "BFA", label: { fr: "Burkina Faso", en: "Burkina Faso", default: "Burkina Faso" } },
4470
+ { value: "BDI", label: { fr: "Burundi", en: "Burundi", default: "Burundi" } },
4471
+ { value: "CPV", label: { fr: "Cap-Vert", en: "Cabo Verde", default: "Cabo Verde" } },
4472
+ { value: "KHM", label: { fr: "Cambodge", en: "Cambodia", default: "Cambodia" } },
4473
+ { value: "CMR", label: { fr: "Cameroun", en: "Cameroon", default: "Cameroon" } },
4474
+ { value: "CAN", label: { fr: "Canada", en: "Canada", default: "Canada" } },
4475
+ { value: "CAF", label: { fr: "R\xE9publique centrafricaine", en: "Central African Republic", default: "Central African Republic" } },
4476
+ { value: "TCD", label: { fr: "Tchad", en: "Chad", default: "Chad" } },
4477
+ { value: "CHL", label: { fr: "Chili", en: "Chile", default: "Chile" } },
4478
+ { value: "CHN", label: { fr: "Chine", en: "China", default: "China" } },
4479
+ { value: "COL", label: { fr: "Colombie", en: "Colombia", default: "Colombia" } },
4480
+ { value: "COM", label: { fr: "Comores", en: "Comoros", default: "Comoros" } },
4481
+ { value: "COG", label: { fr: "Congo", en: "Congo", default: "Congo" } },
4482
+ { value: "CRI", label: { fr: "Costa Rica", en: "Costa Rica", default: "Costa Rica" } },
4483
+ { value: "CIV", label: { fr: "C\xF4te d'Ivoire", en: "Ivory Coast", default: "Ivory Coast" } },
4484
+ { value: "HRV", label: { fr: "Croatie", en: "Croatia", default: "Croatia" } },
4485
+ { value: "CUB", label: { fr: "Cuba", en: "Cuba", default: "Cuba" } },
4486
+ { value: "CYP", label: { fr: "Chypre", en: "Cyprus", default: "Cyprus" } },
4487
+ { value: "CZE", label: { fr: "Tch\xE9quie", en: "Czechia", default: "Czechia" } },
4488
+ { value: "DNK", label: { fr: "Danemark", en: "Denmark", default: "Denmark" } },
4489
+ { value: "DJI", label: { fr: "Djibouti", en: "Djibouti", default: "Djibouti" } },
4490
+ { value: "DMA", label: { fr: "Dominique", en: "Dominica", default: "Dominica" } },
4491
+ { value: "DOM", label: { fr: "R\xE9publique dominicaine", en: "Dominican Republic", default: "Dominican Republic" } },
4492
+ { value: "ECU", label: { fr: "\xC9quateur", en: "Ecuador", default: "Ecuador" } },
4493
+ { value: "EGY", label: { fr: "\xC9gypte", en: "Egypt", default: "Egypt" } },
4494
+ { value: "SLV", label: { fr: "Salvador", en: "El Salvador", default: "El Salvador" } },
4495
+ { value: "GNQ", label: { fr: "Guin\xE9e \xE9quatoriale", en: "Equatorial Guinea", default: "Equatorial Guinea" } },
4496
+ { value: "ERI", label: { fr: "\xC9rythr\xE9e", en: "Eritrea", default: "Eritrea" } },
4497
+ { value: "EST", label: { fr: "Estonie", en: "Estonia", default: "Estonia" } },
4498
+ { value: "SWZ", label: { fr: "Eswatini", en: "Eswatini", default: "Eswatini" } },
4499
+ { value: "ETH", label: { fr: "\xC9thiopie", en: "Ethiopia", default: "Ethiopia" } },
4500
+ { value: "FJI", label: { fr: "Fidji", en: "Fiji", default: "Fiji" } },
4501
+ { value: "FIN", label: { fr: "Finlande", en: "Finland", default: "Finland" } },
4502
+ { value: "FRA", label: { fr: "France", en: "France", default: "France" } },
4503
+ { value: "GAB", label: { fr: "Gabon", en: "Gabon", default: "Gabon" } },
4504
+ { value: "GMB", label: { fr: "Gambie", en: "Gambia", default: "Gambia" } },
4505
+ { value: "GEO", label: { fr: "G\xE9orgie", en: "Georgia", default: "Georgia" } },
4506
+ { value: "DEU", label: { fr: "Allemagne", en: "Germany", default: "Germany" } },
4507
+ { value: "GHA", label: { fr: "Ghana", en: "Ghana", default: "Ghana" } },
4508
+ { value: "GRC", label: { fr: "Gr\xE8ce", en: "Greece", default: "Greece" } },
4509
+ { value: "GRD", label: { fr: "Grenade", en: "Grenada", default: "Grenada" } },
4510
+ { value: "GTM", label: { fr: "Guatemala", en: "Guatemala", default: "Guatemala" } },
4511
+ { value: "GIN", label: { fr: "Guin\xE9e", en: "Guinea", default: "Guinea" } },
4512
+ { value: "GNB", label: { fr: "Guin\xE9e-Bissau", en: "Guinea-Bissau", default: "Guinea-Bissau" } },
4513
+ { value: "GUY", label: { fr: "Guyana", en: "Guyana", default: "Guyana" } },
4514
+ { value: "HTI", label: { fr: "Ha\xEFti", en: "Haiti", default: "Haiti" } },
4515
+ { value: "HND", label: { fr: "Honduras", en: "Honduras", default: "Honduras" } },
4516
+ { value: "HUN", label: { fr: "Hongrie", en: "Hungary", default: "Hungary" } },
4517
+ { value: "ISL", label: { fr: "Islande", en: "Iceland", default: "Iceland" } },
4518
+ { value: "IND", label: { fr: "Inde", en: "India", default: "India" } },
4519
+ { value: "IDN", label: { fr: "Indon\xE9sie", en: "Indonesia", default: "Indonesia" } },
4520
+ { value: "IRN", label: { fr: "Iran", en: "Iran", default: "Iran" } },
4521
+ { value: "IRQ", label: { fr: "Irak", en: "Iraq", default: "Iraq" } },
4522
+ { value: "IRL", label: { fr: "Irlande", en: "Ireland", default: "Ireland" } },
4523
+ { value: "ISR", label: { fr: "Isra\xEBl", en: "Israel", default: "Israel" } },
4524
+ { value: "ITA", label: { fr: "Italie", en: "Italy", default: "Italy" } },
4525
+ { value: "JAM", label: { fr: "Jama\xEFque", en: "Jamaica", default: "Jamaica" } },
4526
+ { value: "JPN", label: { fr: "Japon", en: "Japan", default: "Japan" } },
4527
+ { value: "JOR", label: { fr: "Jordanie", en: "Jordan", default: "Jordan" } },
4528
+ { value: "KAZ", label: { fr: "Kazakhstan", en: "Kazakhstan", default: "Kazakhstan" } },
4529
+ { value: "KEN", label: { fr: "Kenya", en: "Kenya", default: "Kenya" } },
4530
+ { value: "KIR", label: { fr: "Kiribati", en: "Kiribati", default: "Kiribati" } },
4531
+ { value: "PRK", label: { fr: "Cor\xE9e du Nord", en: "North Korea", default: "North Korea" } },
4532
+ { value: "KOR", label: { fr: "Cor\xE9e du Sud", en: "South Korea", default: "South Korea" } },
4533
+ { value: "KWT", label: { fr: "Kowe\xEFt", en: "Kuwait", default: "Kuwait" } },
4534
+ { value: "KGZ", label: { fr: "Kirghizistan", en: "Kyrgyzstan", default: "Kyrgyzstan" } },
4535
+ { value: "LAO", label: { fr: "Laos", en: "Laos", default: "Laos" } },
4536
+ { value: "LVA", label: { fr: "Lettonie", en: "Latvia", default: "Latvia" } },
4537
+ { value: "LBN", label: { fr: "Liban", en: "Lebanon", default: "Lebanon" } },
4538
+ { value: "LSO", label: { fr: "Lesotho", en: "Lesotho", default: "Lesotho" } },
4539
+ { value: "LBR", label: { fr: "Lib\xE9ria", en: "Liberia", default: "Liberia" } },
4540
+ { value: "LBY", label: { fr: "Libye", en: "Libya", default: "Libya" } },
4541
+ { value: "LIE", label: { fr: "Liechtenstein", en: "Liechtenstein", default: "Liechtenstein" } },
4542
+ { value: "LTU", label: { fr: "Lituanie", en: "Lithuania", default: "Lithuania" } },
4543
+ { value: "LUX", label: { fr: "Luxembourg", en: "Luxembourg", default: "Luxembourg" } },
4544
+ { value: "MDG", label: { fr: "Madagascar", en: "Madagascar", default: "Madagascar" } },
4545
+ { value: "MWI", label: { fr: "Malawi", en: "Malawi", default: "Malawi" } },
4546
+ { value: "MYS", label: { fr: "Malaisie", en: "Malaysia", default: "Malaysia" } },
4547
+ { value: "MDV", label: { fr: "Maldives", en: "Maldives", default: "Maldives" } },
4548
+ { value: "MLI", label: { fr: "Mali", en: "Mali", default: "Mali" } },
4549
+ { value: "MLT", label: { fr: "Malte", en: "Malta", default: "Malta" } },
4550
+ { value: "MHL", label: { fr: "\xCEles Marshall", en: "Marshall Islands", default: "Marshall Islands" } },
4551
+ { value: "MRT", label: { fr: "Mauritanie", en: "Mauritania", default: "Mauritania" } },
4552
+ { value: "MUS", label: { fr: "Maurice", en: "Mauritius", default: "Mauritius" } },
4553
+ { value: "MEX", label: { fr: "Mexique", en: "Mexico", default: "Mexico" } },
4554
+ { value: "FSM", label: { fr: "\xC9tats f\xE9d\xE9r\xE9s de Micron\xE9sie", en: "Micronesia", default: "Micronesia" } },
4555
+ { value: "MDA", label: { fr: "Moldavie", en: "Moldova", default: "Moldova" } },
4556
+ { value: "MCO", label: { fr: "Monaco", en: "Monaco", default: "Monaco" } },
4557
+ { value: "MNG", label: { fr: "Mongolie", en: "Mongolia", default: "Mongolia" } },
4558
+ { value: "MNE", label: { fr: "Mont\xE9n\xE9gro", en: "Montenegro", default: "Montenegro" } },
4559
+ { value: "MAR", label: { fr: "Maroc", en: "Morocco", default: "Morocco" } },
4560
+ { value: "MOZ", label: { fr: "Mozambique", en: "Mozambique", default: "Mozambique" } },
4561
+ { value: "MMR", label: { fr: "Myanmar", en: "Myanmar", default: "Myanmar" } },
4562
+ { value: "NAM", label: { fr: "Namibie", en: "Namibia", default: "Namibia" } },
4563
+ { value: "NRU", label: { fr: "Nauru", en: "Nauru", default: "Nauru" } },
4564
+ { value: "NPL", label: { fr: "N\xE9pal", en: "Nepal", default: "Nepal" } },
4565
+ { value: "NLD", label: { fr: "Pays-Bas", en: "Netherlands", default: "Netherlands" } },
4566
+ { value: "NZL", label: { fr: "Nouvelle-Z\xE9lande", en: "New Zealand", default: "New Zealand" } },
4567
+ { value: "NIC", label: { fr: "Nicaragua", en: "Nicaragua", default: "Nicaragua" } },
4568
+ { value: "NER", label: { fr: "Niger", en: "Niger", default: "Niger" } },
4569
+ { value: "NGA", label: { fr: "Nig\xE9ria", en: "Nigeria", default: "Nigeria" } },
4570
+ { value: "MKD", label: { fr: "Mac\xE9doine du Nord", en: "North Macedonia", default: "North Macedonia" } },
4571
+ { value: "NOR", label: { fr: "Norv\xE8ge", en: "Norway", default: "Norway" } },
4572
+ { value: "OMN", label: { fr: "Oman", en: "Oman", default: "Oman" } },
4573
+ { value: "PAK", label: { fr: "Pakistan", en: "Pakistan", default: "Pakistan" } },
4574
+ { value: "PLW", label: { fr: "Palaos", en: "Palau", default: "Palau" } },
4575
+ { value: "PAN", label: { fr: "Panama", en: "Panama", default: "Panama" } },
4576
+ { value: "PNG", label: { fr: "Papouasie-Nouvelle-Guin\xE9e", en: "Papua New Guinea", default: "Papua New Guinea" } },
4577
+ { value: "PRY", label: { fr: "Paraguay", en: "Paraguay", default: "Paraguay" } },
4578
+ { value: "PER", label: { fr: "P\xE9rou", en: "Peru", default: "Peru" } },
4579
+ { value: "PHL", label: { fr: "Philippines", en: "Philippines", default: "Philippines" } },
4580
+ { value: "POL", label: { fr: "Pologne", en: "Poland", default: "Poland" } },
4581
+ { value: "PRT", label: { fr: "Portugal", en: "Portugal", default: "Portugal" } },
4582
+ { value: "QAT", label: { fr: "Qatar", en: "Qatar", default: "Qatar" } },
4583
+ { value: "ROU", label: { fr: "Roumanie", en: "Romania", default: "Romania" } },
4584
+ { value: "RUS", label: { fr: "Russie", en: "Russia", default: "Russia" } },
4585
+ { value: "RWA", label: { fr: "Rwanda", en: "Rwanda", default: "Rwanda" } },
4586
+ { value: "KNA", label: { fr: "Saint-Christophe-et-Ni\xE9v\xE8s", en: "Saint Kitts and Nevis", default: "Saint Kitts and Nevis" } },
4587
+ { value: "LCA", label: { fr: "Sainte-Lucie", en: "Saint Lucia", default: "Saint Lucia" } },
4588
+ { value: "VCT", label: { fr: "Saint-Vincent-et-les-Grenadines", en: "Saint Vincent and the Grenadines", default: "Saint Vincent and the Grenadines" } },
4589
+ { value: "WSM", label: { fr: "Samoa", en: "Samoa", default: "Samoa" } },
4590
+ { value: "SMR", label: { fr: "Saint-Marin", en: "San Marino", default: "San Marino" } },
4591
+ { value: "STP", label: { fr: "Sao Tom\xE9-et-Principe", en: "Sao Tome and Principe", default: "Sao Tome and Principe" } },
4592
+ { value: "SAU", label: { fr: "Arabie saoudite", en: "Saudi Arabia", default: "Saudi Arabia" } },
4593
+ { value: "SEN", label: { fr: "S\xE9n\xE9gal", en: "Senegal", default: "Senegal" } },
4594
+ { value: "SRB", label: { fr: "Serbie", en: "Serbia", default: "Serbia" } },
4595
+ { value: "SYC", label: { fr: "Seychelles", en: "Seychelles", default: "Seychelles" } },
4596
+ { value: "SLE", label: { fr: "Sierra Leone", en: "Sierra Leone", default: "Sierra Leone" } },
4597
+ { value: "SGP", label: { fr: "Singapour", en: "Singapore", default: "Singapore" } },
4598
+ { value: "SVK", label: { fr: "Slovaquie", en: "Slovakia", default: "Slovakia" } },
4599
+ { value: "SVN", label: { fr: "Slov\xE9nie", en: "Slovenia", default: "Slovenia" } },
4600
+ { value: "SLB", label: { fr: "\xCEles Salomon", en: "Solomon Islands", default: "Solomon Islands" } },
4601
+ { value: "SOM", label: { fr: "Somalie", en: "Somalia", default: "Somalia" } },
4602
+ { value: "ZAF", label: { fr: "Afrique du Sud", en: "South Africa", default: "South Africa" } },
4603
+ { value: "SSD", label: { fr: "Soudan du Sud", en: "South Sudan", default: "South Sudan" } },
4604
+ { value: "ESP", label: { fr: "Espagne", en: "Spain", default: "Spain" } },
4605
+ { value: "LKA", label: { fr: "Sri Lanka", en: "Sri Lanka", default: "Sri Lanka" } },
4606
+ { value: "SDN", label: { fr: "Soudan", en: "Sudan", default: "Sudan" } },
4607
+ { value: "SUR", label: { fr: "Suriname", en: "Suriname", default: "Suriname" } },
4608
+ { value: "SWE", label: { fr: "Su\xE8de", en: "Sweden", default: "Sweden" } },
4609
+ { value: "CHE", label: { fr: "Suisse", en: "Switzerland", default: "Switzerland" } },
4610
+ { value: "SYR", label: { fr: "Syrie", en: "Syria", default: "Syria" } },
4611
+ { value: "TWN", label: { fr: "Ta\xEFwan", en: "Taiwan", default: "Taiwan" } },
4612
+ { value: "TJK", label: { fr: "Tadjikistan", en: "Tajikistan", default: "Tajikistan" } },
4613
+ { value: "TZA", label: { fr: "Tanzanie", en: "Tanzania", default: "Tanzania" } },
4614
+ { value: "THA", label: { fr: "Tha\xEFlande", en: "Thailand", default: "Thailand" } },
4615
+ { value: "TLS", label: { fr: "Timor oriental", en: "Timor-Leste", default: "Timor-Leste" } },
4616
+ { value: "TGO", label: { fr: "Togo", en: "Togo", default: "Togo" } },
4617
+ { value: "TON", label: { fr: "Tonga", en: "Tonga", default: "Tonga" } },
4618
+ { value: "TTO", label: { fr: "Trinit\xE9-et-Tobago", en: "Trinidad and Tobago", default: "Trinidad and Tobago" } },
4619
+ { value: "TUN", label: { fr: "Tunisie", en: "Tunisia", default: "Tunisia" } },
4620
+ { value: "TUR", label: { fr: "Turquie", en: "Turkey", default: "Turkey" } },
4621
+ { value: "TKM", label: { fr: "Turkm\xE9nistan", en: "Turkmenistan", default: "Turkmenistan" } },
4622
+ { value: "TUV", label: { fr: "Tuvalu", en: "Tuvalu", default: "Tuvalu" } },
4623
+ { value: "UGA", label: { fr: "Ouganda", en: "Uganda", default: "Uganda" } },
4624
+ { value: "UKR", label: { fr: "Ukraine", en: "Ukraine", default: "Ukraine" } },
4625
+ { value: "ARE", label: { fr: "\xC9mirats arabes unis", en: "United Arab Emirates", default: "United Arab Emirates" } },
4626
+ { value: "GBR", label: { fr: "Royaume-Uni", en: "United Kingdom", default: "United Kingdom" } },
4627
+ { value: "USA", label: { fr: "\xC9tats-Unis", en: "United States", default: "United States" } },
4628
+ { value: "URY", label: { fr: "Uruguay", en: "Uruguay", default: "Uruguay" } },
4629
+ { value: "UZB", label: { fr: "Ouzb\xE9kistan", en: "Uzbekistan", default: "Uzbekistan" } },
4630
+ { value: "VUT", label: { fr: "Vanuatu", en: "Vanuatu", default: "Vanuatu" } },
4631
+ { value: "VAT", label: { fr: "Vatican", en: "Vatican City", default: "Vatican City" } },
4632
+ { value: "VEN", label: { fr: "Venezuela", en: "Venezuela", default: "Venezuela" } },
4633
+ { value: "VNM", label: { fr: "Vietnam", en: "Vietnam", default: "Vietnam" } },
4634
+ { value: "YEM", label: { fr: "Y\xE9men", en: "Yemen", default: "Yemen" } },
4635
+ { value: "ZMB", label: { fr: "Zambie", en: "Zambia", default: "Zambia" } },
4636
+ { value: "ZWE", label: { fr: "Zimbabwe", en: "Zimbabwe", default: "Zimbabwe" } }
4637
+ ]
4638
+ };
4639
+ var Choices_default = CHOICES;
4640
+ var InvoiceTypeSelector = ({
4641
+ value,
4642
+ onSelect,
4643
+ disabled = false,
4644
+ language = "default"
4645
+ }) => {
4646
+ const options = CHOICES.INVOICE_TYPES.map((item) => ({
4647
+ value: item.value,
4648
+ label: item.label[language]
4649
+ }));
4650
+ return /* @__PURE__ */ jsx23(
4651
+ SearchableSelect,
4652
+ {
4653
+ value,
4654
+ options,
4655
+ placeholder: "S\xE9lectionner un type...",
4656
+ searchPlaceholder: "Rechercher...",
4657
+ onSelect,
4658
+ disabled
4659
+ },
4660
+ `invoice-type-${value}`
4661
+ );
4662
+ };
4663
+ var PaymentMethodSelector = ({
4664
+ value,
4665
+ onSelect,
4666
+ disabled = false,
4667
+ language = "default"
4668
+ }) => {
4669
+ const options = CHOICES.PAYMENT_METHODS.map((item) => ({
4670
+ value: item.value,
4671
+ label: item.label[language]
4672
+ }));
4673
+ return /* @__PURE__ */ jsx23(
4674
+ SearchableSelect,
4675
+ {
4676
+ value,
4677
+ options,
4678
+ placeholder: "S\xE9lectionner un mode de paiement...",
4679
+ searchPlaceholder: "Rechercher...",
4680
+ onSelect,
4681
+ disabled
4682
+ },
4683
+ `payment-method-${value}`
4684
+ );
4685
+ };
4686
+ var TemplateFNESelector = ({
4687
+ value,
4688
+ onSelect,
4689
+ disabled = false,
4690
+ language = "default"
4691
+ }) => {
4692
+ const options = CHOICES.TEMPLATES.map((item) => ({
4693
+ value: item.value,
4694
+ label: item.label[language]
4695
+ }));
4696
+ return /* @__PURE__ */ jsx23(
4697
+ SearchableSelect,
4698
+ {
4699
+ value,
4700
+ options,
4701
+ placeholder: "S\xE9lectionner un template...",
4702
+ searchPlaceholder: "Rechercher...",
4703
+ onSelect,
4704
+ disabled
4705
+ },
4706
+ `template-${value}`
4707
+ );
4708
+ };
4709
+ var ForeignCurrencySelector = ({
4710
+ value,
4711
+ onSelect,
4712
+ disabled = false,
4713
+ language = "default"
4714
+ }) => {
4715
+ const options = CHOICES.FOREIGN_CURRENCIES.map((item) => ({
4716
+ value: item.value,
4717
+ label: item.label[language]
4718
+ }));
4719
+ return /* @__PURE__ */ jsx23(
4720
+ SearchableSelect,
4721
+ {
4722
+ value,
4723
+ options,
4724
+ placeholder: "S\xE9lectionner une devise...",
4725
+ searchPlaceholder: "Rechercher...",
4726
+ onSelect,
4727
+ disabled
4728
+ },
4729
+ `currency-${value}`
4730
+ );
4731
+ };
4732
+ var TaxSelector = ({
4733
+ value,
4734
+ onSelect,
4735
+ disabled = false,
4736
+ language = "default",
4737
+ handleChange
4738
+ }) => {
4739
+ const options = CHOICES.TAXES.map((item) => ({
4740
+ value: item.value,
4741
+ label: item.label[language]
4742
+ }));
4743
+ return /* @__PURE__ */ jsx23(
4744
+ SearchableSelect,
4745
+ {
4746
+ value,
4747
+ options,
4748
+ placeholder: "S\xE9lectionner une taxe...",
4749
+ searchPlaceholder: "Rechercher...",
4750
+ onSelect: (option) => {
4751
+ if (handleChange) {
4752
+ handleChange(option.value);
4753
+ }
4754
+ onSelect(option);
4755
+ },
4756
+ disabled
4757
+ },
4758
+ `tax-${value}`
4759
+ );
4760
+ };
4761
+ var LegalFormSelector = ({
4762
+ value,
4763
+ onSelect,
4764
+ disabled = false,
4765
+ language = "default"
4766
+ }) => {
4767
+ const options = CHOICES.LEGAL_FORMS.map((item) => ({
4768
+ value: item.value,
4769
+ label: item.label[language] ?? item.label.default
4770
+ }));
4771
+ return /* @__PURE__ */ jsx23(
4772
+ SearchableSelect,
4773
+ {
4774
+ value,
4775
+ options,
4776
+ placeholder: "S\xE9lectionner une forme juridique...",
4777
+ searchPlaceholder: "Rechercher...",
4778
+ onSelect,
4779
+ disabled
4780
+ },
4781
+ `legal-form-${value}`
4782
+ );
4783
+ };
4784
+ var CountrySelector = ({
4785
+ value,
4786
+ onSelect,
4787
+ disabled = false,
4788
+ language = "default"
4789
+ }) => {
4790
+ const options = CHOICES.COUNTRIES.map((item) => ({
4791
+ value: item.value,
4792
+ label: item.label[language]
4793
+ }));
4794
+ return /* @__PURE__ */ jsx23(
4795
+ SearchableSelect,
4796
+ {
4797
+ value,
4798
+ options,
4799
+ placeholder: "S\xE9lectionner un pays...",
4800
+ searchPlaceholder: "Rechercher...",
4801
+ onSelect,
4802
+ disabled
4803
+ },
4804
+ `country-${value}`
4805
+ );
4806
+ };
3663
4807
  export {
3664
4808
  Alert_default as Alert,
3665
4809
  AlertProvider,
@@ -3667,19 +4811,31 @@ export {
3667
4811
  ApprovalAnswerPage,
3668
4812
  ApprovalPreviewAnswer_default as ApprovalPreviewAnswer,
3669
4813
  ApprovalWorkflow_default as ApprovalWorkflow,
4814
+ Choices_default as CHOICES,
4815
+ CountrySelector,
3670
4816
  DateInput,
3671
4817
  FDrawer,
3672
4818
  FetchApi,
3673
4819
  FileInput,
4820
+ ForeignCurrencySelector,
3674
4821
  InputField,
4822
+ InvoiceTypeSelector,
4823
+ LegalFormSelector,
3675
4824
  Modals_default as Modal,
3676
4825
  NumberInput,
3677
4826
  Pages_default as Pages,
4827
+ PaymentMethodSelector,
3678
4828
  Buttons_default as PrimaryButton,
3679
4829
  ModernDoubleSidebarLayout_default as RewiseLayout,
3680
4830
  SecondaryButton,
4831
+ SelectCostCenter,
4832
+ SelectDepartment,
3681
4833
  SelectInput,
4834
+ SelectUser,
4835
+ SelectVendor,
3682
4836
  SessionProvider,
4837
+ TaxSelector,
4838
+ TemplateFNESelector,
3683
4839
  TextInput,
3684
4840
  ThemeContext_default as ThemeProvider,
3685
4841
  Toast_default as ToastContainer,