ptechcore_ui 1.0.36 → 1.0.39

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
@@ -31,6 +31,8 @@ var index_exports = {};
31
31
  __export(index_exports, {
32
32
  ACCOUNT_TYPE_LABELS: () => ACCOUNT_TYPE_LABELS,
33
33
  AccountServices: () => AccountServices,
34
+ AccountingWorkspace: () => AccountingWorkspace_default,
35
+ ActifsPage: () => ActifsPage_default,
34
36
  Alert: () => Alert_default,
35
37
  AlertProvider: () => AlertProvider,
36
38
  ApprovalAnswerModal: () => ApprovalAnswerModal,
@@ -40,9 +42,14 @@ __export(index_exports, {
40
42
  ApprovalWorkflow: () => ApprovalWorkflow_default,
41
43
  AuthServices: () => AuthServices,
42
44
  BALANCE_TYPE_LABELS: () => BALANCE_TYPE_LABELS,
45
+ BudgetPage: () => BudgetPage_default,
43
46
  CHOICES: () => Choices_default,
47
+ CardBody: () => CardBody,
48
+ CardHeader: () => CardHeader,
49
+ ChatEquipePage: () => ChatEquipePage_default,
44
50
  ClientServices: () => ClientServices,
45
51
  CountrySelector: () => CountrySelector,
52
+ CrmWorkspace: () => CrmWorkspace_default,
46
53
  DataTable: () => DataTable,
47
54
  DateInput: () => DateInput,
48
55
  DocumentFooter: () => DocumentFooter,
@@ -50,6 +57,7 @@ __export(index_exports, {
50
57
  EntityFileManager: () => EntityFileManager,
51
58
  FDrawer: () => FDrawer,
52
59
  FROM_MODULE_CHOICES: () => FROM_MODULE_CHOICES,
60
+ FacilityWorkspace: () => FacilityWorkspace_default,
53
61
  FetchApi: () => FetchApi,
54
62
  FileInput: () => FileInput,
55
63
  FileManager: () => FileManager,
@@ -57,21 +65,28 @@ __export(index_exports, {
57
65
  ForeignCurrencySelector: () => ForeignCurrencySelector,
58
66
  FormClient: () => FormClient,
59
67
  FormVendor: () => FormVendor,
68
+ HRConnectPage: () => HRConnectPage_default,
60
69
  InfoBox: () => InfoBox,
61
70
  InputField: () => InputField,
62
71
  InvoiceTypeSelector: () => InvoiceTypeSelector,
63
72
  LegalFormSelector: () => LegalFormSelector,
73
+ MeetingHubPage: () => MeetingHubPage_default,
64
74
  MinimalVendorForm: () => MinimalVendorForm,
65
75
  Modal: () => Modals_default,
76
+ ModernCard: () => ModernCard,
66
77
  NumberInput: () => NumberInput,
67
78
  PRINT_GREEN: () => PRINT_GREEN,
68
79
  Pages: () => Pages_default,
69
80
  PaymentMethodSelector: () => PaymentMethodSelector,
81
+ PlanningPage: () => PlanningPage_default,
70
82
  PrimaryButton: () => Buttons_default,
71
83
  PrintPreview: () => PrintPreview,
72
84
  PrintableDocument: () => PrintableDocument,
85
+ PurchaseRequestsPage: () => PurchaseRequestsPage,
86
+ PurchaseWorkspace: () => PurchaseWorkspace_default,
73
87
  RewiseLayout: () => ModernDoubleSidebarLayout_default,
74
88
  SYSCOHADA_CLASSES: () => SYSCOHADA_CLASSES,
89
+ SearchableSelect: () => SearchableSelect,
75
90
  SecondaryButton: () => SecondaryButton,
76
91
  SelectAccount: () => SelectAccount,
77
92
  SelectClient: () => SelectClient,
@@ -83,7 +98,9 @@ __export(index_exports, {
83
98
  SelectVendor: () => SelectVendor,
84
99
  SessionProvider: () => SessionProvider,
85
100
  SignatureSection: () => SignatureSection,
101
+ StatCard: () => StatCard,
86
102
  TEMPLATE_FNE_CHOICES: () => TEMPLATE_FNE_CHOICES,
103
+ TaskPilot: () => TaskPilot_default,
87
104
  TaxSelector: () => TaxSelector,
88
105
  TemplateFNESelector: () => TemplateFNESelector,
89
106
  TextInput: () => TextInput,
@@ -94,6 +111,9 @@ __export(index_exports, {
94
111
  UnitServices: () => UnitServices,
95
112
  UserServices: () => UserServices,
96
113
  VendorServices: () => VendorServices,
114
+ WorkSpace: () => WorkSpace_default,
115
+ WorkSpaceRoutes: () => WorkSpaceRoutes,
116
+ WorkspaceServices: () => WorkspaceServices,
97
117
  fileManagerApi: () => fileManagerApi,
98
118
  formatCurrency: () => formatCurrency,
99
119
  formatDate: () => formatDate,
@@ -1070,6 +1090,7 @@ var SessionProvider = ({ children }) => {
1070
1090
  setActiveBusinessEntity(result.data.user.centers_access.find((item) => parseInt(item.id) === parseInt(saved_center_id)) || result.data.user.centers_access[0] || null);
1071
1091
  } else {
1072
1092
  setLoggedUser(null);
1093
+ localStorage.removeItem("token");
1073
1094
  }
1074
1095
  }).catch(() => setLoggedUser(null));
1075
1096
  } else {
@@ -1840,8 +1861,8 @@ var getModuleUrls = (token) => {
1840
1861
  var MODULE_CODE_MAP = {
1841
1862
  "CRM": "WiseConnect",
1842
1863
  "MARKETING": "WiseReach",
1843
- "FACILITY": "WiseOps",
1844
- "SECURITY": "WiseGuard",
1864
+ "FACILITY": "WiseFm",
1865
+ "SECURITY": "WiseHSC",
1845
1866
  "THRIVE": "WiseThrive",
1846
1867
  "BI": "WiseView",
1847
1868
  "SOP": "WiseProcess",
@@ -1853,7 +1874,7 @@ var MODULE_CODE_MAP = {
1853
1874
  "PURCHASE": "WiseProcure",
1854
1875
  "HR": "WiseHR"
1855
1876
  };
1856
- var RewiseLayout = ({ children, module_name = "Rewise", module_description = "Description du module", primaryMenuItems, secondaryMenuItems }) => {
1877
+ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "", primaryMenuItems, secondaryMenuItems }) => {
1857
1878
  const location = (0, import_react_router_dom3.useLocation)();
1858
1879
  const navigate = (0, import_react_router_dom3.useNavigate)();
1859
1880
  const { theme, themeType, setTheme } = useTheme();
@@ -2001,7 +2022,7 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
2001
2022
  const isModuleActive = (moduleId) => selectedModule === moduleId;
2002
2023
  const getBreadcrumbs = () => {
2003
2024
  const paths = location.pathname.split("/").filter(Boolean);
2004
- const breadcrumbs = [{ label: "Accueil", path: "/" }];
2025
+ const breadcrumbs = [{ label: "Accueil", path: "/workspace/" }];
2005
2026
  paths.forEach((path, index) => {
2006
2027
  const fullPath = "/" + paths.slice(0, index + 1).join("/");
2007
2028
  const module2 = primaryMenuItems.find((m) => m.id === path);
@@ -2213,6 +2234,9 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
2213
2234
  setSecondaryCollapsed(true);
2214
2235
  } else {
2215
2236
  setSelectedModule(item.id);
2237
+ if (secondaryMenuItems[item.id] && secondaryMenuItems[item.id].length > 0) {
2238
+ setSecondaryCollapsed(false);
2239
+ }
2216
2240
  }
2217
2241
  },
2218
2242
  className: cn(
@@ -2719,7 +2743,7 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
2719
2743
  "button",
2720
2744
  {
2721
2745
  onClick: () => {
2722
- navigate("/settings");
2746
+ window.location.href = "https://core.rewise.praedium-tech.com/parameters/profit-cost-centers/";
2723
2747
  setShowUserMenu(false);
2724
2748
  },
2725
2749
  className: "w-full flex items-center gap-3 px-3 py-2 rounded-lg hover:bg-[var(--color-surface-hover)] transition-colors",
@@ -2834,8 +2858,8 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
2834
2858
  /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "grid grid-cols-2 md:grid-cols-4 gap-3", children: [
2835
2859
  { name: "WiseConnect", icon: crm_blue_default, iconWhite: crmwhite_default, url: moduleUrls.wiseConnect },
2836
2860
  { name: "WiseReach", icon: marketingblue_default, iconWhite: marketingblanc_default, url: moduleUrls.wiseReach },
2837
- { name: "WiseOps", icon: facilityblue_default, iconWhite: facilityblanc_default, url: moduleUrls.wiseOps },
2838
- { name: "WiseGuard", icon: security_managementblue_default, iconWhite: security_managementblanc_default, url: moduleUrls.wiseGuard }
2861
+ { name: "WiseFm", icon: facilityblue_default, iconWhite: facilityblanc_default, url: moduleUrls.wiseOps },
2862
+ { name: "WiseHSE", icon: security_managementblue_default, iconWhite: security_managementblanc_default, url: moduleUrls.wiseGuard }
2839
2863
  ].map((module2) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2840
2864
  "button",
2841
2865
  {
@@ -4804,6 +4828,7 @@ var import_react10 = require("react");
4804
4828
 
4805
4829
  // src/components/common/SearchableSelect.tsx
4806
4830
  var import_react9 = require("react");
4831
+ var import_react_dom2 = require("react-dom");
4807
4832
  var import_lucide_react7 = require("lucide-react");
4808
4833
  var import_jsx_runtime13 = require("react/jsx-runtime");
4809
4834
  var SearchableSelect = ({
@@ -4821,7 +4846,9 @@ var SearchableSelect = ({
4821
4846
  }) => {
4822
4847
  const [isOpen, setIsOpen] = (0, import_react9.useState)(false);
4823
4848
  const [searchTerm, setSearchTerm] = (0, import_react9.useState)("");
4849
+ const [dropdownPosition, setDropdownPosition] = (0, import_react9.useState)({ top: 0, left: 0, width: 0 });
4824
4850
  const dropdownRef = (0, import_react9.useRef)(null);
4851
+ const dropdownMenuRef = (0, import_react9.useRef)(null);
4825
4852
  const inputRef = (0, import_react9.useRef)(null);
4826
4853
  const selectedOption = options.find((option) => option.value === value);
4827
4854
  const defaultFilter = (option, searchTerm2) => {
@@ -4830,9 +4857,22 @@ var SearchableSelect = ({
4830
4857
  const filteredOptions = options.filter(
4831
4858
  (option) => filterFunction ? filterFunction(option, searchTerm) : defaultFilter(option, searchTerm)
4832
4859
  );
4860
+ (0, import_react9.useEffect)(() => {
4861
+ if (isOpen && dropdownRef.current) {
4862
+ const rect = dropdownRef.current.getBoundingClientRect();
4863
+ setDropdownPosition({
4864
+ top: rect.bottom + window.scrollY,
4865
+ left: rect.left + window.scrollX,
4866
+ width: rect.width
4867
+ });
4868
+ }
4869
+ }, [isOpen]);
4833
4870
  (0, import_react9.useEffect)(() => {
4834
4871
  const handleClickOutside = (event) => {
4835
- if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
4872
+ const target = event.target;
4873
+ const isOutsideTrigger = dropdownRef.current && !dropdownRef.current.contains(target);
4874
+ const isOutsideMenu = dropdownMenuRef.current && !dropdownMenuRef.current.contains(target);
4875
+ if (isOutsideTrigger && isOutsideMenu) {
4836
4876
  setIsOpen(false);
4837
4877
  setSearchTerm("");
4838
4878
  }
@@ -4871,17 +4911,17 @@ var SearchableSelect = ({
4871
4911
  ${isOpen ? "ring-2 ring-[#6B7C92] border-transparent" : ""}
4872
4912
  `,
4873
4913
  children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "flex items-center justify-between", children: [
4874
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "flex items-center space-x-2 flex-1", children: selectedOption ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
4914
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "flex items-center space-x-2 flex-1 min-w-0", children: selectedOption ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
4875
4915
  selectedOption.image && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
4876
4916
  "img",
4877
4917
  {
4878
4918
  src: selectedOption.image,
4879
4919
  alt: selectedOption.label,
4880
- className: "w-6 h-6 rounded-full object-cover"
4920
+ className: "w-6 h-6 rounded-full object-cover flex-shrink-0"
4881
4921
  }
4882
4922
  ),
4883
- selectedOption.content || /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "text-gray-900", children: selectedOption.label })
4884
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "text-gray-400", children: placeholder }) }),
4923
+ selectedOption.content || /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "text-gray-900 truncate", children: selectedOption.label })
4924
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "text-gray-400 truncate", children: placeholder }) }),
4885
4925
  /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "flex items-center space-x-2", children: [
4886
4926
  allowClear && selectedOption && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
4887
4927
  "button",
@@ -4903,64 +4943,80 @@ var SearchableSelect = ({
4903
4943
  ] })
4904
4944
  }
4905
4945
  ),
4906
- isOpen && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "absolute z-50 w-full mt-1 bg-white border border-gray-200 rounded-lg shadow-lg", children: [
4907
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "p-3 border-b border-gray-200 flex", children: [
4908
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "relative w-full", children: [
4909
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react7.Search, { className: "absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4" }),
4910
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
4911
- "input",
4912
- {
4913
- ref: inputRef,
4914
- type: "text",
4915
- placeholder: searchPlaceholder,
4916
- value: searchTerm,
4917
- onChange: (e) => setSearchTerm(e.target.value),
4918
- className: "w-full pl-10 pr-4 py-2 border border-gray-200 rounded-lg focus:ring-2 focus:ring-[#6B7C92] focus:border-transparent"
4919
- }
4920
- )
4921
- ] }),
4922
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
4923
- "button",
4924
- {
4925
- type: "button",
4926
- onClick: refresh,
4927
- disabled,
4928
- 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",
4929
- title: "Rafra\xEEchir la liste",
4930
- children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react7.RefreshCw, { className: `w-4 h-4 ${disabled ? "animate-spin" : ""}` })
4931
- }
4932
- ),
4933
- addElement && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
4934
- "button",
4935
- {
4936
- type: "button",
4937
- onClick: addElement,
4938
- 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",
4939
- title: "Rafra\xEEchir la liste",
4940
- children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react7.Plus, { className: "w-4 h-4" })
4941
- }
4942
- )
4943
- ] }),
4944
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "max-h-60 overflow-y-auto", children: filteredOptions.length > 0 ? filteredOptions.map((option) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
4946
+ isOpen && (0, import_react_dom2.createPortal)(
4947
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
4945
4948
  "div",
4946
4949
  {
4947
- onClick: () => handleSelect(option),
4948
- className: "px-4 py-3 hover:bg-gray-50 cursor-pointer flex items-center space-x-3",
4950
+ ref: dropdownMenuRef,
4951
+ className: "fixed bg-white border border-gray-200 rounded-lg shadow-lg",
4952
+ style: {
4953
+ top: dropdownPosition.top,
4954
+ left: dropdownPosition.left,
4955
+ width: dropdownPosition.width,
4956
+ zIndex: 9999
4957
+ },
4949
4958
  children: [
4950
- option.image && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
4951
- "img",
4959
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "p-3 border-b border-gray-200 flex", children: [
4960
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "relative w-full", children: [
4961
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react7.Search, { className: "absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4" }),
4962
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
4963
+ "input",
4964
+ {
4965
+ ref: inputRef,
4966
+ type: "text",
4967
+ placeholder: searchPlaceholder,
4968
+ value: searchTerm,
4969
+ onChange: (e) => setSearchTerm(e.target.value),
4970
+ className: "w-full pl-10 pr-4 py-2 border border-gray-200 rounded-lg focus:ring-2 focus:ring-[#6B7C92] focus:border-transparent"
4971
+ }
4972
+ )
4973
+ ] }),
4974
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
4975
+ "button",
4976
+ {
4977
+ type: "button",
4978
+ onClick: refresh,
4979
+ disabled,
4980
+ 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",
4981
+ title: "Rafra\xEEchir la liste",
4982
+ children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react7.RefreshCw, { className: `w-4 h-4 ${disabled ? "animate-spin" : ""}` })
4983
+ }
4984
+ ),
4985
+ addElement && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
4986
+ "button",
4987
+ {
4988
+ type: "button",
4989
+ onClick: addElement,
4990
+ 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",
4991
+ title: "Ajouter un \xE9l\xE9ment",
4992
+ children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react7.Plus, { className: "w-4 h-4" })
4993
+ }
4994
+ )
4995
+ ] }),
4996
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "max-h-60 overflow-y-auto", children: filteredOptions.length > 0 ? filteredOptions.map((option) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
4997
+ "div",
4952
4998
  {
4953
- src: option.image,
4954
- alt: option.label,
4955
- className: "w-8 h-8 rounded-full object-cover"
4956
- }
4957
- ),
4958
- option.content || /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "text-gray-900", children: option.label })
4999
+ onClick: () => handleSelect(option),
5000
+ className: "px-4 py-3 hover:bg-gray-50 cursor-pointer flex items-center space-x-3",
5001
+ children: [
5002
+ option.image && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
5003
+ "img",
5004
+ {
5005
+ src: option.image,
5006
+ alt: option.label,
5007
+ className: "w-8 h-8 rounded-full object-cover"
5008
+ }
5009
+ ),
5010
+ option.content || /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "text-gray-900", children: option.label })
5011
+ ]
5012
+ },
5013
+ option.value
5014
+ )) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "px-4 py-3 text-gray-500 text-center", children: "Aucun r\xE9sultat trouv\xE9" }) })
4959
5015
  ]
4960
- },
4961
- option.value
4962
- )) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "px-4 py-3 text-gray-500 text-center", children: "Aucun r\xE9sultat trouv\xE9" }) })
4963
- ] })
5016
+ }
5017
+ ),
5018
+ document.body
5019
+ )
4964
5020
  ] });
4965
5021
  };
4966
5022
 
@@ -5028,7 +5084,10 @@ var PROFIT_URI = `${API_URL}/accounting/profit-center/`;
5028
5084
  var import_jsx_runtime14 = require("react/jsx-runtime");
5029
5085
  var SelectVendor = ({
5030
5086
  value,
5031
- onSelect
5087
+ onSelect,
5088
+ allowClear,
5089
+ onRemove,
5090
+ label = "Ajouter un fournisseur"
5032
5091
  }) => {
5033
5092
  const [showModal, setShowModal] = (0, import_react10.useState)(false);
5034
5093
  const [selectedVendor, setSelectedVendor] = (0, import_react10.useState)(null);
@@ -5078,7 +5137,7 @@ var SelectVendor = ({
5078
5137
  loadVendors();
5079
5138
  };
5080
5139
  return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { children: [
5081
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "flex justify-between ", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Ajouter un fournisseur" }) }),
5140
+ label && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "flex justify-between ", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: label }) }),
5082
5141
  /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
5083
5142
  SearchableSelect,
5084
5143
  {
@@ -5091,7 +5150,9 @@ var SelectVendor = ({
5091
5150
  refresh: handleRefresh,
5092
5151
  addElement: () => {
5093
5152
  setShowModal(true);
5094
- }
5153
+ },
5154
+ allowClear,
5155
+ onRemove
5095
5156
  },
5096
5157
  "fourni" + value
5097
5158
  ),
@@ -5110,7 +5171,10 @@ var SelectVendor = ({
5110
5171
  };
5111
5172
  var SelectUser = ({
5112
5173
  value,
5113
- onSelect
5174
+ onSelect,
5175
+ allowClear,
5176
+ onRemove,
5177
+ label = "S\xE9lectionner un utilisateur"
5114
5178
  }) => {
5115
5179
  const { token, activeBusinessEntity } = useSession();
5116
5180
  const [users, setUsers] = (0, import_react10.useState)(() => {
@@ -5166,7 +5230,7 @@ var SelectUser = ({
5166
5230
  }));
5167
5231
  };
5168
5232
  return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { children: [
5169
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "flex justify-between ", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "S\xE9lectionner un utilisateur" }) }),
5233
+ label && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "flex justify-between ", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: label }) }),
5170
5234
  /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
5171
5235
  SearchableSelect,
5172
5236
  {
@@ -5176,7 +5240,9 @@ var SelectUser = ({
5176
5240
  searchPlaceholder: "Rechercher...",
5177
5241
  onSelect,
5178
5242
  disabled: loading,
5179
- refresh: handleRefresh
5243
+ refresh: handleRefresh,
5244
+ allowClear,
5245
+ onRemove
5180
5246
  },
5181
5247
  "user" + value
5182
5248
  ),
@@ -5185,7 +5251,10 @@ var SelectUser = ({
5185
5251
  };
5186
5252
  var SelectDepartment = ({
5187
5253
  value,
5188
- onSelect
5254
+ onSelect,
5255
+ allowClear,
5256
+ onRemove,
5257
+ label = "S\xE9lectionner un d\xE9partement"
5189
5258
  }) => {
5190
5259
  const { token, activeBusinessEntity } = useSession();
5191
5260
  const [departments, setDepartments] = (0, import_react10.useState)(() => {
@@ -5231,7 +5300,7 @@ var SelectDepartment = ({
5231
5300
  }));
5232
5301
  };
5233
5302
  return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { children: [
5234
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "flex justify-between ", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "S\xE9lectionner un d\xE9partement" }) }),
5303
+ label && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "flex justify-between ", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: label }) }),
5235
5304
  /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
5236
5305
  SearchableSelect,
5237
5306
  {
@@ -5241,7 +5310,9 @@ var SelectDepartment = ({
5241
5310
  searchPlaceholder: "Rechercher...",
5242
5311
  onSelect,
5243
5312
  disabled: loading,
5244
- refresh: handleRefresh
5313
+ refresh: handleRefresh,
5314
+ allowClear,
5315
+ onRemove
5245
5316
  },
5246
5317
  "dept" + value
5247
5318
  ),
@@ -5250,7 +5321,10 @@ var SelectDepartment = ({
5250
5321
  };
5251
5322
  var SelectCostCenter = ({
5252
5323
  value,
5253
- onSelect
5324
+ onSelect,
5325
+ allowClear,
5326
+ onRemove,
5327
+ label = "S\xE9lectionner un centre de co\xFBt"
5254
5328
  }) => {
5255
5329
  const { token, activeBusinessEntity } = useSession();
5256
5330
  const [costCenters, setCostCenters] = (0, import_react10.useState)(() => {
@@ -5303,7 +5377,7 @@ var SelectCostCenter = ({
5303
5377
  }));
5304
5378
  };
5305
5379
  return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { children: [
5306
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "flex justify-between ", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "S\xE9lectionner un centre de co\xFBt" }) }),
5380
+ label && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "flex justify-between ", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: label }) }),
5307
5381
  /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
5308
5382
  SearchableSelect,
5309
5383
  {
@@ -5313,7 +5387,9 @@ var SelectCostCenter = ({
5313
5387
  searchPlaceholder: "Rechercher...",
5314
5388
  onSelect,
5315
5389
  disabled: loading,
5316
- refresh: handleRefresh
5390
+ refresh: handleRefresh,
5391
+ allowClear,
5392
+ onRemove
5317
5393
  },
5318
5394
  "cost" + value
5319
5395
  ),
@@ -5322,7 +5398,10 @@ var SelectCostCenter = ({
5322
5398
  };
5323
5399
  var SelectUnit = ({
5324
5400
  value,
5325
- onSelect
5401
+ onSelect,
5402
+ allowClear,
5403
+ onRemove,
5404
+ label = "S\xE9lectionner une unit\xE9"
5326
5405
  }) => {
5327
5406
  const { token, activeBusinessEntity } = useSession();
5328
5407
  const [units, setUnits] = (0, import_react10.useState)(() => {
@@ -5377,7 +5456,7 @@ var SelectUnit = ({
5377
5456
  }));
5378
5457
  };
5379
5458
  return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { children: [
5380
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "flex justify-between ", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "S\xE9lectionner une unit\xE9" }) }),
5459
+ label && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "flex justify-between ", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: label }) }),
5381
5460
  /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
5382
5461
  SearchableSelect,
5383
5462
  {
@@ -5387,7 +5466,9 @@ var SelectUnit = ({
5387
5466
  searchPlaceholder: "Rechercher...",
5388
5467
  onSelect,
5389
5468
  disabled: loading,
5390
- refresh: handleRefresh
5469
+ refresh: handleRefresh,
5470
+ allowClear,
5471
+ onRemove
5391
5472
  },
5392
5473
  "unit" + value
5393
5474
  ),
@@ -5418,7 +5499,9 @@ var SelectAccount = ({
5418
5499
  filterClass,
5419
5500
  filterType,
5420
5501
  showInactive = false,
5421
- label = "Selectionner un compte"
5502
+ label = "Selectionner un compte",
5503
+ allowClear,
5504
+ onRemove
5422
5505
  }) => {
5423
5506
  const { token, activeBusinessEntity } = useSession();
5424
5507
  const [accounts, setAccounts] = (0, import_react10.useState)(() => {
@@ -5585,7 +5668,9 @@ var SelectAccount = ({
5585
5668
  onSelect,
5586
5669
  disabled: loading,
5587
5670
  refresh: handleRefresh,
5588
- addElement: handleOpenModal
5671
+ addElement: handleOpenModal,
5672
+ allowClear,
5673
+ onRemove
5589
5674
  },
5590
5675
  "account" + value
5591
5676
  ),
@@ -5695,7 +5780,10 @@ var SelectAccount = ({
5695
5780
  };
5696
5781
  var SelectClient = ({
5697
5782
  value,
5698
- onSelect
5783
+ onSelect,
5784
+ allowClear,
5785
+ onRemove,
5786
+ label = "S\xE9lectionner un client"
5699
5787
  }) => {
5700
5788
  const { token, activeBusinessEntity } = useSession();
5701
5789
  const [clients, setClients] = (0, import_react10.useState)(() => {
@@ -5745,7 +5833,7 @@ var SelectClient = ({
5745
5833
  loadClients();
5746
5834
  };
5747
5835
  return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { children: [
5748
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "flex justify-between", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "S\xE9lectionner un client" }) }),
5836
+ label && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "flex justify-between", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: label }) }),
5749
5837
  /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
5750
5838
  SearchableSelect,
5751
5839
  {
@@ -5755,7 +5843,9 @@ var SelectClient = ({
5755
5843
  searchPlaceholder: "Rechercher...",
5756
5844
  onSelect,
5757
5845
  disabled: loading,
5758
- refresh: handleRefresh
5846
+ refresh: handleRefresh,
5847
+ allowClear,
5848
+ onRemove
5759
5849
  },
5760
5850
  "client" + value
5761
5851
  ),
@@ -10320,10 +10410,3613 @@ var formatCurrency = (amount, currency = "XOF", showDecimals = false) => {
10320
10410
  maximumFractionDigits: showDecimals ? 2 : 0
10321
10411
  }) + (currency ? ` ${currency}` : "");
10322
10412
  };
10413
+
10414
+ // src/components/common/ModernCard.tsx
10415
+ var import_jsx_runtime32 = require("react/jsx-runtime");
10416
+ var ModernCard = ({
10417
+ children,
10418
+ className,
10419
+ hoverable = false,
10420
+ bordered = true,
10421
+ elevated = false,
10422
+ gradient = false,
10423
+ onClick
10424
+ }) => {
10425
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
10426
+ "div",
10427
+ {
10428
+ onClick,
10429
+ className: cn(
10430
+ "bg-[var(--color-surface)] rounded-xl transition-all duration-300",
10431
+ bordered && "border border-[var(--color-border)]",
10432
+ elevated && "shadow-[var(--shadow-md)]",
10433
+ hoverable && "hover:shadow-[var(--shadow-lg)] hover:-translate-y-1 cursor-pointer",
10434
+ gradient && "bg-gradient-to-br from-[var(--color-surface)] to-[var(--color-surface-hover)]",
10435
+ onClick && "cursor-pointer",
10436
+ className
10437
+ ),
10438
+ children
10439
+ }
10440
+ );
10441
+ };
10442
+ var CardHeader = ({
10443
+ title,
10444
+ subtitle,
10445
+ icon: Icon,
10446
+ action,
10447
+ className,
10448
+ children
10449
+ }) => {
10450
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: cn("p-4 border-b border-[var(--color-border-light)]", className), children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex items-start justify-between", children: [
10451
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex items-start gap-4", children: [
10452
+ Icon && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "p-2 bg-[var(--color-primary-light)] rounded-lg", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Icon, { className: "w-4 h-4 text-[var(--color-primary)]" }) }),
10453
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { children: [
10454
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("h3", { className: "text-lg font-semibold text-[var(--color-text-primary)]", children: title }),
10455
+ subtitle && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("p", { className: "mt-1 text-sm text-[var(--color-text-secondary)]", children: subtitle })
10456
+ ] })
10457
+ ] }),
10458
+ action && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { children: action }),
10459
+ children
10460
+ ] }) });
10461
+ };
10462
+ var CardBody = ({
10463
+ children,
10464
+ className,
10465
+ noPadding = false
10466
+ }) => {
10467
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: cn(!noPadding && "p-4", className), children });
10468
+ };
10469
+ var StatCard = ({
10470
+ title,
10471
+ value,
10472
+ change,
10473
+ icon: Icon,
10474
+ color = "primary",
10475
+ className
10476
+ }) => {
10477
+ const colorClasses = {
10478
+ primary: "bg-[var(--color-primary-light)] text-[var(--color-primary)]",
10479
+ success: "bg-[var(--color-success-light)] text-[var(--color-success)]",
10480
+ warning: "bg-[var(--color-warning-light)] text-[var(--color-warning)]",
10481
+ error: "bg-[var(--color-error-light)] text-[var(--color-error)]",
10482
+ info: "bg-[var(--color-info-light)] text-[var(--color-info)]"
10483
+ };
10484
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(ModernCard, { className: cn("p-4", className), hoverable: true, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex items-start justify-between", children: [
10485
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex-1", children: [
10486
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("p", { className: "text-sm font-medium text-[var(--color-text-secondary)]", children: title }),
10487
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("p", { className: "mt-2 text-3xl font-bold text-[var(--color-text-primary)]", children: value }),
10488
+ change && /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "mt-3 flex items-center gap-2", children: [
10489
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("span", { className: cn(
10490
+ "text-sm font-medium",
10491
+ change.type === "increase" ? "text-[var(--color-success)]" : "text-[var(--color-error)]"
10492
+ ), children: [
10493
+ change.type === "increase" ? "\u2191" : "\u2193",
10494
+ " ",
10495
+ Math.abs(change.value),
10496
+ "%"
10497
+ ] }),
10498
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "text-xs text-[var(--color-text-tertiary)]", children: "vs p\xE9riode pr\xE9c\xE9dente" })
10499
+ ] })
10500
+ ] }),
10501
+ Icon && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: cn("p-2.5 rounded-lg", colorClasses[color]), children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Icon, { className: "w-5 h-5" }) })
10502
+ ] }) });
10503
+ };
10504
+
10505
+ // src/services/WorkspaceServices.ts
10506
+ var WorkspaceServices = {
10507
+ /**
10508
+ * Récupère les données du workspace Procurement (Achats)
10509
+ */
10510
+ getProcurementWorkspace: async (businessEntityId) => {
10511
+ const params = new URLSearchParams();
10512
+ if (businessEntityId) {
10513
+ params.append("business_entity", businessEntityId);
10514
+ }
10515
+ const queryString = params.toString();
10516
+ const url = `${API_URL}/core/workspaces/procurement/${queryString ? `?${queryString}` : ""}`;
10517
+ const response = await FetchApi.get(url);
10518
+ if (!response.success) {
10519
+ throw new Error(response.message || "Erreur lors de la r\xE9cup\xE9ration des donn\xE9es du workspace");
10520
+ }
10521
+ return response.data;
10522
+ }
10523
+ };
10524
+
10525
+ // src/pages/workspaces/WorkSpace.tsx
10526
+ var import_react29 = require("react");
10527
+ var import_lucide_react25 = require("lucide-react");
10528
+
10529
+ // src/pages/workspaces/PurchaseWorkspace.tsx
10530
+ var import_react25 = require("react");
10531
+ var import_lucide_react21 = require("lucide-react");
10532
+ var import_jsx_runtime33 = require("react/jsx-runtime");
10533
+ var formatCurrency2 = (amount) => {
10534
+ return new Intl.NumberFormat("fr-FR", {
10535
+ style: "decimal",
10536
+ minimumFractionDigits: 0,
10537
+ maximumFractionDigits: 0
10538
+ }).format(amount) + " FCFA";
10539
+ };
10540
+ var formatCurrencyShort = (amount) => {
10541
+ if (amount >= 1e6) {
10542
+ return `${(amount / 1e6).toFixed(1)}M FCFA`;
10543
+ } else if (amount >= 1e3) {
10544
+ return `${(amount / 1e3).toFixed(0)}k FCFA`;
10545
+ }
10546
+ return formatCurrency2(amount);
10547
+ };
10548
+ var formatRelativeTime = (timestamp) => {
10549
+ if (!timestamp) return "";
10550
+ const date = new Date(timestamp);
10551
+ const now = /* @__PURE__ */ new Date();
10552
+ const diffMs = now.getTime() - date.getTime();
10553
+ const diffMins = Math.floor(diffMs / 6e4);
10554
+ const diffHours = Math.floor(diffMs / 36e5);
10555
+ const diffDays = Math.floor(diffMs / 864e5);
10556
+ if (diffMins < 1) return "A l'instant";
10557
+ if (diffMins < 60) return `Il y a ${diffMins} min`;
10558
+ if (diffHours < 24) return `Il y a ${diffHours}h`;
10559
+ if (diffDays === 1) return "Hier";
10560
+ if (diffDays < 7) return `Il y a ${diffDays} jours`;
10561
+ return date.toLocaleDateString("fr-FR");
10562
+ };
10563
+ var PurchaseWorkspace = () => {
10564
+ const [stats, setStats] = (0, import_react25.useState)(null);
10565
+ const [recentActivities, setRecentActivities] = (0, import_react25.useState)([]);
10566
+ const [pendingTasks, setPendingTasks] = (0, import_react25.useState)([]);
10567
+ const [loading, setLoading] = (0, import_react25.useState)(true);
10568
+ const [error, setError] = (0, import_react25.useState)(null);
10569
+ (0, import_react25.useEffect)(() => {
10570
+ loadWorkspaceData();
10571
+ }, []);
10572
+ const loadWorkspaceData = async () => {
10573
+ setLoading(true);
10574
+ setError(null);
10575
+ try {
10576
+ const businessEntityId = localStorage.getItem("active_center_id") || void 0;
10577
+ const data = await WorkspaceServices.getProcurementWorkspace(businessEntityId);
10578
+ setStats(data);
10579
+ setRecentActivities(data.recent_activities || []);
10580
+ setPendingTasks(data.pending_tasks || []);
10581
+ } catch (err) {
10582
+ console.error("Erreur lors du chargement du workspace:", err);
10583
+ setError("Impossible de charger les donnees du workspace. Veuillez reessayer.");
10584
+ setStats({
10585
+ purchase_requests: {
10586
+ total: 0,
10587
+ draft: 0,
10588
+ pending_approval: 0,
10589
+ approved: 0,
10590
+ in_sourcing: 0,
10591
+ completed: 0,
10592
+ rejected: 0,
10593
+ trend: 0
10594
+ },
10595
+ rfqs: {
10596
+ total: 0,
10597
+ draft: 0,
10598
+ open: 0,
10599
+ pending_evaluation: 0,
10600
+ closed: 0
10601
+ },
10602
+ purchase_orders: {
10603
+ total: 0,
10604
+ pending_delivery: 0,
10605
+ delivered: 0,
10606
+ total_value: 0,
10607
+ trend: 0
10608
+ },
10609
+ receipts: {
10610
+ total: 0,
10611
+ pending_validation: 0,
10612
+ validated: 0
10613
+ },
10614
+ vendors: {
10615
+ total: 0,
10616
+ active: 0
10617
+ },
10618
+ alerts: {
10619
+ overdue_deliveries: 0,
10620
+ expiring_contracts: 0,
10621
+ pending_approvals: 0
10622
+ },
10623
+ recent_activities: [],
10624
+ pending_tasks: []
10625
+ });
10626
+ } finally {
10627
+ setLoading(false);
10628
+ }
10629
+ };
10630
+ const getPriorityColor = (priority) => {
10631
+ const colors = {
10632
+ low: "bg-[var(--color-border-light)] text-[var(--color-text-secondary)]",
10633
+ medium: "bg-[var(--color-info-light)] text-[var(--color-info)]",
10634
+ high: "bg-[var(--color-warning-light)] text-[var(--color-warning)]",
10635
+ critical: "bg-[var(--color-error-light)] text-[var(--color-error)]"
10636
+ };
10637
+ return colors[priority] || colors.medium;
10638
+ };
10639
+ const getActivityIcon = (type) => {
10640
+ const icons = {
10641
+ pr_created: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react21.FileText, { className: "w-4 h-4" }),
10642
+ rfq_sent: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react21.Send, { className: "w-4 h-4" }),
10643
+ quote_received: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react21.FileCheck, { className: "w-4 h-4" }),
10644
+ po_issued: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react21.ShoppingCart, { className: "w-4 h-4" }),
10645
+ receipt_created: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react21.Package, { className: "w-4 h-4" }),
10646
+ approval_pending: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react21.Clock, { className: "w-4 h-4" })
10647
+ };
10648
+ return icons[type] || /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react21.FileText, { className: "w-4 h-4" });
10649
+ };
10650
+ const getActivityStatusColor = (status) => {
10651
+ const colors = {
10652
+ info: "bg-[var(--color-info-light)] text-[var(--color-info)]",
10653
+ success: "bg-[var(--color-success-light)] text-[var(--color-success)]",
10654
+ warning: "bg-[var(--color-warning-light)] text-[var(--color-warning)]",
10655
+ error: "bg-[var(--color-error-light)] text-[var(--color-error)]"
10656
+ };
10657
+ return colors[status] || colors.info;
10658
+ };
10659
+ if (loading) {
10660
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "flex items-center justify-center h-96", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "text-center", children: [
10661
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react21.RefreshCw, { className: "w-12 h-12 text-[var(--color-primary)] animate-spin mx-auto mb-4" }),
10662
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { className: "text-[var(--color-text-secondary)]", children: "Chargement du workspace Achats..." })
10663
+ ] }) });
10664
+ }
10665
+ if (!stats) return null;
10666
+ const ErrorBanner = error ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "bg-[var(--color-error-light)] border border-[var(--color-error)] rounded-xl p-4 mb-6", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex items-center space-x-3", children: [
10667
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react21.AlertTriangle, { className: "w-5 h-5 text-[var(--color-error)]" }),
10668
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { className: "text-sm text-[var(--color-error)]", children: error }) }),
10669
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
10670
+ "button",
10671
+ {
10672
+ onClick: loadWorkspaceData,
10673
+ className: "text-sm text-[var(--color-error)] hover:underline font-medium",
10674
+ children: "Reessayer"
10675
+ }
10676
+ )
10677
+ ] }) }) : null;
10678
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "space-y-6", children: [
10679
+ ErrorBanner,
10680
+ (stats.alerts.overdue_deliveries > 0 || stats.alerts.expiring_contracts > 0 || stats.alerts.pending_approvals > 0) && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "bg-[var(--color-warning-light)] border border-[var(--color-warning)] rounded-xl p-4", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex items-start space-x-3", children: [
10681
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react21.AlertTriangle, { className: "w-5 h-5 text-[var(--color-warning)] mt-0.5" }),
10682
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex-1", children: [
10683
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("h3", { className: "font-semibold text-[var(--color-text-primary)]", children: "Alertes necessitant votre attention" }),
10684
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "mt-2 flex flex-wrap gap-4", children: [
10685
+ stats.alerts.overdue_deliveries > 0 && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("span", { className: "text-sm text-[var(--color-warning)]", children: [
10686
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("strong", { children: stats.alerts.overdue_deliveries }),
10687
+ " livraisons en retard"
10688
+ ] }),
10689
+ stats.alerts.expiring_contracts > 0 && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("span", { className: "text-sm text-[var(--color-warning)]", children: [
10690
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("strong", { children: stats.alerts.expiring_contracts }),
10691
+ " contrats expirant bientot"
10692
+ ] }),
10693
+ stats.alerts.pending_approvals > 0 && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("span", { className: "text-sm text-[var(--color-warning)]", children: [
10694
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("strong", { children: stats.alerts.pending_approvals }),
10695
+ " approbations en attente"
10696
+ ] })
10697
+ ] })
10698
+ ] })
10699
+ ] }) }),
10700
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6", children: [
10701
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
10702
+ StatCard,
10703
+ {
10704
+ title: "Demandes d'achat",
10705
+ value: stats.purchase_requests.total,
10706
+ icon: import_lucide_react21.FileText,
10707
+ color: "primary",
10708
+ change: stats.purchase_requests.trend !== 0 ? {
10709
+ value: stats.purchase_requests.trend,
10710
+ type: stats.purchase_requests.trend > 0 ? "increase" : "decrease"
10711
+ } : void 0
10712
+ }
10713
+ ),
10714
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
10715
+ StatCard,
10716
+ {
10717
+ title: "Appels d'offres actifs",
10718
+ value: stats.rfqs.open,
10719
+ icon: import_lucide_react21.ClipboardList,
10720
+ color: "info"
10721
+ }
10722
+ ),
10723
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
10724
+ StatCard,
10725
+ {
10726
+ title: "Commandes en cours",
10727
+ value: stats.purchase_orders.pending_delivery,
10728
+ icon: import_lucide_react21.Truck,
10729
+ color: "warning"
10730
+ }
10731
+ ),
10732
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
10733
+ StatCard,
10734
+ {
10735
+ title: "Budget engage",
10736
+ value: formatCurrencyShort(stats.purchase_orders.total_value),
10737
+ icon: import_lucide_react21.Banknote,
10738
+ color: "success",
10739
+ change: stats.purchase_orders.trend !== 0 ? {
10740
+ value: stats.purchase_orders.trend,
10741
+ type: stats.purchase_orders.trend > 0 ? "increase" : "decrease"
10742
+ } : void 0
10743
+ }
10744
+ )
10745
+ ] }),
10746
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "grid grid-cols-1 lg:grid-cols-3 gap-6", children: [
10747
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "lg:col-span-2 space-y-6", children: [
10748
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(ModernCard, { children: [
10749
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
10750
+ CardHeader,
10751
+ {
10752
+ title: "Taches en attente",
10753
+ icon: import_lucide_react21.Clock,
10754
+ action: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("button", { className: "text-sm text-[var(--color-primary)] hover:underline flex items-center", children: [
10755
+ "Voir tout ",
10756
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react21.ArrowRight, { className: "w-4 h-4 ml-1" })
10757
+ ] })
10758
+ }
10759
+ ),
10760
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(CardBody, { noPadding: true, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "divide-y divide-[var(--color-border-light)]", children: pendingTasks.map((task) => /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
10761
+ "div",
10762
+ {
10763
+ className: "p-4 hover:bg-[var(--color-surface-hover)] transition-colors cursor-pointer flex items-center justify-between",
10764
+ children: [
10765
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex items-center space-x-3", children: [
10766
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: `px-2 py-1 text-xs font-medium rounded-full ${getPriorityColor(task.priority)}`, children: task.priority === "critical" ? "Critique" : task.priority === "high" ? "Haute" : task.priority === "medium" ? "Moyenne" : "Basse" }),
10767
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { children: [
10768
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { className: "text-sm font-medium text-[var(--color-text-primary)]", children: task.title }),
10769
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("p", { className: "text-xs text-[var(--color-text-tertiary)]", children: [
10770
+ "Echeance: ",
10771
+ task.dueDate
10772
+ ] })
10773
+ ] })
10774
+ ] }),
10775
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react21.ArrowRight, { className: "w-4 h-4 text-[var(--color-text-tertiary)]" })
10776
+ ]
10777
+ },
10778
+ task.id
10779
+ )) }) })
10780
+ ] }),
10781
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6", children: [
10782
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(ModernCard, { children: [
10783
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(CardHeader, { title: "Demandes d'achat", icon: import_lucide_react21.FileText }),
10784
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(CardBody, { children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "space-y-3", children: [
10785
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex items-center justify-between p-3 bg-[var(--color-surface-hover)] rounded-lg", children: [
10786
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex items-center space-x-2", children: [
10787
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "w-2 h-2 bg-[var(--color-text-tertiary)] rounded-full" }),
10788
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "text-sm text-[var(--color-text-primary)]", children: "Brouillons" })
10789
+ ] }),
10790
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "font-semibold text-[var(--color-text-primary)]", children: stats.purchase_requests.draft })
10791
+ ] }),
10792
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex items-center justify-between p-3 bg-[var(--color-warning-light)] rounded-lg", children: [
10793
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex items-center space-x-2", children: [
10794
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "w-2 h-2 bg-[var(--color-warning)] rounded-full" }),
10795
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "text-sm text-[var(--color-text-primary)]", children: "En attente d'approbation" })
10796
+ ] }),
10797
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "font-semibold text-[var(--color-text-primary)]", children: stats.purchase_requests.pending_approval })
10798
+ ] }),
10799
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex items-center justify-between p-3 bg-[var(--color-success-light)] rounded-lg", children: [
10800
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex items-center space-x-2", children: [
10801
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "w-2 h-2 bg-[var(--color-success)] rounded-full" }),
10802
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "text-sm text-[var(--color-text-primary)]", children: "Approuvees" })
10803
+ ] }),
10804
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "font-semibold text-[var(--color-text-primary)]", children: stats.purchase_requests.approved })
10805
+ ] }),
10806
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex items-center justify-between p-3 bg-[var(--color-info-light)] rounded-lg", children: [
10807
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex items-center space-x-2", children: [
10808
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "w-2 h-2 bg-[var(--color-info)] rounded-full" }),
10809
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "text-sm text-[var(--color-text-primary)]", children: "En sourcing" })
10810
+ ] }),
10811
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "font-semibold text-[var(--color-text-primary)]", children: stats.purchase_requests.in_sourcing })
10812
+ ] })
10813
+ ] }) })
10814
+ ] }),
10815
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(ModernCard, { children: [
10816
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(CardHeader, { title: "Appels d'offres (RFQ)", icon: import_lucide_react21.ClipboardList }),
10817
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(CardBody, { children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "space-y-3", children: [
10818
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex items-center justify-between p-3 bg-[var(--color-info-light)] rounded-lg", children: [
10819
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex items-center space-x-2", children: [
10820
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "w-2 h-2 bg-[var(--color-info)] rounded-full" }),
10821
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "text-sm text-[var(--color-text-primary)]", children: "Ouverts" })
10822
+ ] }),
10823
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "font-semibold text-[var(--color-text-primary)]", children: stats.rfqs.open })
10824
+ ] }),
10825
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex items-center justify-between p-3 bg-[var(--color-secondary)] bg-opacity-10 rounded-lg", children: [
10826
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex items-center space-x-2", children: [
10827
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "w-2 h-2 bg-[var(--color-secondary)] rounded-full" }),
10828
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "text-sm text-[var(--color-text-primary)]", children: "En evaluation" })
10829
+ ] }),
10830
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "font-semibold text-[var(--color-text-primary)]", children: stats.rfqs.pending_evaluation })
10831
+ ] }),
10832
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex items-center justify-between p-3 bg-[var(--color-success-light)] rounded-lg", children: [
10833
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex items-center space-x-2", children: [
10834
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "w-2 h-2 bg-[var(--color-success)] rounded-full" }),
10835
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "text-sm text-[var(--color-text-primary)]", children: "Clotures" })
10836
+ ] }),
10837
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "font-semibold text-[var(--color-text-primary)]", children: stats.rfqs.closed })
10838
+ ] })
10839
+ ] }) })
10840
+ ] })
10841
+ ] })
10842
+ ] }),
10843
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "space-y-6", children: [
10844
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(ModernCard, { children: [
10845
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
10846
+ CardHeader,
10847
+ {
10848
+ title: "Activites recentes",
10849
+ icon: import_lucide_react21.Clock,
10850
+ action: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("button", { className: "text-sm text-[var(--color-primary)] hover:underline", children: "Historique" })
10851
+ }
10852
+ ),
10853
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(CardBody, { noPadding: true, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "divide-y divide-[var(--color-border-light)]", children: recentActivities.map((activity) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
10854
+ "div",
10855
+ {
10856
+ className: "p-4 hover:bg-[var(--color-surface-hover)] transition-colors",
10857
+ children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex items-start space-x-3", children: [
10858
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: `p-2 rounded-lg ${getActivityStatusColor(activity.status)}`, children: getActivityIcon(activity.type) }),
10859
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex-1 min-w-0", children: [
10860
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { className: "text-sm font-medium text-[var(--color-text-primary)]", children: activity.title }),
10861
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { className: "text-xs text-[var(--color-text-secondary)] truncate", children: activity.description }),
10862
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { className: "text-xs text-[var(--color-text-tertiary)] mt-1", children: formatRelativeTime(activity.timestamp) })
10863
+ ] })
10864
+ ] })
10865
+ },
10866
+ activity.id
10867
+ )) }) })
10868
+ ] }),
10869
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(ModernCard, { children: [
10870
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(CardHeader, { title: "Fournisseurs", icon: import_lucide_react21.Users }),
10871
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(CardBody, { children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "text-center py-4", children: [
10872
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { className: "text-4xl font-bold text-[var(--color-text-primary)]", children: stats.vendors.total }),
10873
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { className: "text-sm text-[var(--color-text-secondary)] mt-1", children: "fournisseurs references" }),
10874
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "mt-4 flex justify-center space-x-6", children: [
10875
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { children: [
10876
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { className: "text-lg font-semibold text-[var(--color-success)]", children: stats.vendors.active }),
10877
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { className: "text-xs text-[var(--color-text-tertiary)]", children: "Actifs" })
10878
+ ] }),
10879
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { children: [
10880
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { className: "text-lg font-semibold text-[var(--color-text-tertiary)]", children: stats.vendors.total - stats.vendors.active }),
10881
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { className: "text-xs text-[var(--color-text-tertiary)]", children: "Inactifs" })
10882
+ ] })
10883
+ ] })
10884
+ ] }) })
10885
+ ] }),
10886
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(ModernCard, { children: [
10887
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(CardHeader, { title: "Receptions", icon: import_lucide_react21.Package }),
10888
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(CardBody, { children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "space-y-3", children: [
10889
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex items-center justify-between", children: [
10890
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "text-sm text-[var(--color-text-secondary)]", children: "En attente de validation" }),
10891
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "px-2 py-1 text-xs font-medium bg-[var(--color-warning-light)] text-[var(--color-warning)] rounded-full", children: stats.receipts.pending_validation })
10892
+ ] }),
10893
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex items-center justify-between", children: [
10894
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "text-sm text-[var(--color-text-secondary)]", children: "Validees ce mois" }),
10895
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "px-2 py-1 text-xs font-medium bg-[var(--color-success-light)] text-[var(--color-success)] rounded-full", children: stats.receipts.validated })
10896
+ ] })
10897
+ ] }) })
10898
+ ] })
10899
+ ] })
10900
+ ] })
10901
+ ] });
10902
+ };
10903
+ var PurchaseWorkspace_default = PurchaseWorkspace;
10904
+
10905
+ // src/pages/workspaces/AccountingWorkspace.tsx
10906
+ var import_react26 = require("react");
10907
+ var import_lucide_react22 = require("lucide-react");
10908
+ var import_jsx_runtime34 = require("react/jsx-runtime");
10909
+ var formatCurrency3 = (amount) => {
10910
+ return new Intl.NumberFormat("fr-FR", {
10911
+ style: "decimal",
10912
+ minimumFractionDigits: 0,
10913
+ maximumFractionDigits: 0
10914
+ }).format(amount) + " FCFA";
10915
+ };
10916
+ var formatCurrencyShort2 = (amount) => {
10917
+ if (amount >= 1e6) {
10918
+ return `${(amount / 1e6).toFixed(1)}M FCFA`;
10919
+ } else if (amount >= 1e3) {
10920
+ return `${(amount / 1e3).toFixed(0)}k FCFA`;
10921
+ }
10922
+ return formatCurrency3(amount);
10923
+ };
10924
+ var AccountingWorkspace = () => {
10925
+ const [stats, setStats] = (0, import_react26.useState)(null);
10926
+ const [loading, setLoading] = (0, import_react26.useState)(true);
10927
+ const [error, setError] = (0, import_react26.useState)(null);
10928
+ (0, import_react26.useEffect)(() => {
10929
+ loadWorkspaceData();
10930
+ }, []);
10931
+ const loadWorkspaceData = async () => {
10932
+ setLoading(true);
10933
+ setError(null);
10934
+ try {
10935
+ await new Promise((resolve) => setTimeout(resolve, 500));
10936
+ setStats({
10937
+ journal_entries: {
10938
+ total: 0,
10939
+ draft: 0,
10940
+ pending_validation: 0,
10941
+ validated: 0,
10942
+ trend: 0
10943
+ },
10944
+ invoices: {
10945
+ receivable: 0,
10946
+ payable: 0,
10947
+ overdue_receivable: 0,
10948
+ overdue_payable: 0
10949
+ },
10950
+ cash_flow: {
10951
+ inflow: 0,
10952
+ outflow: 0,
10953
+ balance: 0
10954
+ },
10955
+ bank_reconciliation: {
10956
+ pending: 0,
10957
+ reconciled: 0
10958
+ },
10959
+ alerts: {
10960
+ unbalanced_entries: 0,
10961
+ overdue_invoices: 0,
10962
+ pending_approvals: 0
10963
+ }
10964
+ });
10965
+ } catch (err) {
10966
+ console.error("Erreur lors du chargement du workspace:", err);
10967
+ setError("Impossible de charger les donnees du workspace comptabilite.");
10968
+ } finally {
10969
+ setLoading(false);
10970
+ }
10971
+ };
10972
+ if (loading) {
10973
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "flex items-center justify-center h-96", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "text-center", children: [
10974
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_lucide_react22.RefreshCw, { className: "w-12 h-12 text-[var(--color-primary)] animate-spin mx-auto mb-4" }),
10975
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { className: "text-[var(--color-text-secondary)]", children: "Chargement du workspace Comptabilite..." })
10976
+ ] }) });
10977
+ }
10978
+ if (!stats) return null;
10979
+ const ErrorBanner = error ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "bg-[var(--color-error-light)] border border-[var(--color-error)] rounded-xl p-4 mb-6", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex items-center space-x-3", children: [
10980
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_lucide_react22.AlertTriangle, { className: "w-5 h-5 text-[var(--color-error)]" }),
10981
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { className: "text-sm text-[var(--color-error)]", children: error }) }),
10982
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
10983
+ "button",
10984
+ {
10985
+ onClick: loadWorkspaceData,
10986
+ className: "text-sm text-[var(--color-error)] hover:underline font-medium",
10987
+ children: "Reessayer"
10988
+ }
10989
+ )
10990
+ ] }) }) : null;
10991
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "space-y-6", children: [
10992
+ ErrorBanner,
10993
+ (stats.alerts.unbalanced_entries > 0 || stats.alerts.overdue_invoices > 0 || stats.alerts.pending_approvals > 0) && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "bg-[var(--color-warning-light)] border border-[var(--color-warning)] rounded-xl p-4", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex items-start space-x-3", children: [
10994
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_lucide_react22.AlertTriangle, { className: "w-5 h-5 text-[var(--color-warning)] mt-0.5" }),
10995
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex-1", children: [
10996
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("h3", { className: "font-semibold text-[var(--color-text-primary)]", children: "Alertes comptables" }),
10997
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "mt-2 flex flex-wrap gap-4", children: [
10998
+ stats.alerts.unbalanced_entries > 0 && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("span", { className: "text-sm text-[var(--color-warning)]", children: [
10999
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("strong", { children: stats.alerts.unbalanced_entries }),
11000
+ " ecritures non equilibrees"
11001
+ ] }),
11002
+ stats.alerts.overdue_invoices > 0 && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("span", { className: "text-sm text-[var(--color-warning)]", children: [
11003
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("strong", { children: stats.alerts.overdue_invoices }),
11004
+ " factures en retard"
11005
+ ] }),
11006
+ stats.alerts.pending_approvals > 0 && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("span", { className: "text-sm text-[var(--color-warning)]", children: [
11007
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("strong", { children: stats.alerts.pending_approvals }),
11008
+ " validations en attente"
11009
+ ] })
11010
+ ] })
11011
+ ] })
11012
+ ] }) }),
11013
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6", children: [
11014
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
11015
+ StatCard,
11016
+ {
11017
+ title: "Ecritures comptables",
11018
+ value: stats.journal_entries.total,
11019
+ icon: import_lucide_react22.BookOpen,
11020
+ color: "primary",
11021
+ change: stats.journal_entries.trend !== 0 ? {
11022
+ value: stats.journal_entries.trend,
11023
+ type: stats.journal_entries.trend > 0 ? "increase" : "decrease"
11024
+ } : void 0
11025
+ }
11026
+ ),
11027
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
11028
+ StatCard,
11029
+ {
11030
+ title: "Creances clients",
11031
+ value: formatCurrencyShort2(stats.invoices.receivable),
11032
+ icon: import_lucide_react22.TrendingUp,
11033
+ color: "success"
11034
+ }
11035
+ ),
11036
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
11037
+ StatCard,
11038
+ {
11039
+ title: "Dettes fournisseurs",
11040
+ value: formatCurrencyShort2(stats.invoices.payable),
11041
+ icon: import_lucide_react22.TrendingDown,
11042
+ color: "warning"
11043
+ }
11044
+ ),
11045
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
11046
+ StatCard,
11047
+ {
11048
+ title: "Solde tresorerie",
11049
+ value: formatCurrencyShort2(stats.cash_flow.balance),
11050
+ icon: import_lucide_react22.PiggyBank,
11051
+ color: "info"
11052
+ }
11053
+ )
11054
+ ] }),
11055
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "grid grid-cols-1 lg:grid-cols-3 gap-6", children: [
11056
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "lg:col-span-2 space-y-6", children: [
11057
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(ModernCard, { children: [
11058
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
11059
+ CardHeader,
11060
+ {
11061
+ title: "Ecritures comptables",
11062
+ icon: import_lucide_react22.BookOpen,
11063
+ action: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("button", { className: "text-sm text-[var(--color-primary)] hover:underline flex items-center", children: [
11064
+ "Voir tout ",
11065
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_lucide_react22.ArrowRight, { className: "w-4 h-4 ml-1" })
11066
+ ] })
11067
+ }
11068
+ ),
11069
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(CardBody, { children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "grid grid-cols-3 gap-4", children: [
11070
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "p-4 bg-[var(--color-surface-hover)] rounded-lg text-center", children: [
11071
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { className: "text-2xl font-bold text-[var(--color-text-tertiary)]", children: stats.journal_entries.draft }),
11072
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { className: "text-sm text-[var(--color-text-secondary)]", children: "Brouillons" })
11073
+ ] }),
11074
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "p-4 bg-[var(--color-warning-light)] rounded-lg text-center", children: [
11075
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { className: "text-2xl font-bold text-[var(--color-warning)]", children: stats.journal_entries.pending_validation }),
11076
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { className: "text-sm text-[var(--color-text-secondary)]", children: "A valider" })
11077
+ ] }),
11078
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "p-4 bg-[var(--color-success-light)] rounded-lg text-center", children: [
11079
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { className: "text-2xl font-bold text-[var(--color-success)]", children: stats.journal_entries.validated }),
11080
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { className: "text-sm text-[var(--color-text-secondary)]", children: "Validees" })
11081
+ ] })
11082
+ ] }) })
11083
+ ] }),
11084
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(ModernCard, { children: [
11085
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(CardHeader, { title: "Flux de tresorerie (ce mois)", icon: import_lucide_react22.Banknote }),
11086
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(CardBody, { children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "grid grid-cols-3 gap-4", children: [
11087
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "p-4 bg-[var(--color-success-light)] rounded-lg", children: [
11088
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex items-center space-x-2 mb-2", children: [
11089
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_lucide_react22.TrendingUp, { className: "w-5 h-5 text-[var(--color-success)]" }),
11090
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "text-sm text-[var(--color-text-secondary)]", children: "Entrees" })
11091
+ ] }),
11092
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { className: "text-xl font-bold text-[var(--color-success)]", children: formatCurrencyShort2(stats.cash_flow.inflow) })
11093
+ ] }),
11094
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "p-4 bg-[var(--color-error-light)] rounded-lg", children: [
11095
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex items-center space-x-2 mb-2", children: [
11096
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_lucide_react22.TrendingDown, { className: "w-5 h-5 text-[var(--color-error)]" }),
11097
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "text-sm text-[var(--color-text-secondary)]", children: "Sorties" })
11098
+ ] }),
11099
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { className: "text-xl font-bold text-[var(--color-error)]", children: formatCurrencyShort2(stats.cash_flow.outflow) })
11100
+ ] }),
11101
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "p-4 bg-[var(--color-info-light)] rounded-lg", children: [
11102
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex items-center space-x-2 mb-2", children: [
11103
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_lucide_react22.PiggyBank, { className: "w-5 h-5 text-[var(--color-info)]" }),
11104
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "text-sm text-[var(--color-text-secondary)]", children: "Solde" })
11105
+ ] }),
11106
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { className: "text-xl font-bold text-[var(--color-info)]", children: formatCurrencyShort2(stats.cash_flow.balance) })
11107
+ ] })
11108
+ ] }) })
11109
+ ] })
11110
+ ] }),
11111
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "space-y-6", children: [
11112
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(ModernCard, { children: [
11113
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(CardHeader, { title: "Factures en cours", icon: import_lucide_react22.Receipt }),
11114
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(CardBody, { children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "space-y-4", children: [
11115
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { children: [
11116
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex items-center justify-between mb-2", children: [
11117
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "text-sm text-[var(--color-text-secondary)]", children: "Creances clients" }),
11118
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "font-semibold text-[var(--color-success)]", children: formatCurrencyShort2(stats.invoices.receivable) })
11119
+ ] }),
11120
+ stats.invoices.overdue_receivable > 0 && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "text-xs text-[var(--color-error)] flex items-center space-x-1", children: [
11121
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_lucide_react22.AlertTriangle, { className: "w-3 h-3" }),
11122
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("span", { children: [
11123
+ "Dont ",
11124
+ formatCurrencyShort2(stats.invoices.overdue_receivable),
11125
+ " en retard"
11126
+ ] })
11127
+ ] })
11128
+ ] }),
11129
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "border-t border-[var(--color-border-light)] pt-4", children: [
11130
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex items-center justify-between mb-2", children: [
11131
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "text-sm text-[var(--color-text-secondary)]", children: "Dettes fournisseurs" }),
11132
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "font-semibold text-[var(--color-warning)]", children: formatCurrencyShort2(stats.invoices.payable) })
11133
+ ] }),
11134
+ stats.invoices.overdue_payable > 0 && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "text-xs text-[var(--color-error)] flex items-center space-x-1", children: [
11135
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_lucide_react22.AlertTriangle, { className: "w-3 h-3" }),
11136
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("span", { children: [
11137
+ "Dont ",
11138
+ formatCurrencyShort2(stats.invoices.overdue_payable),
11139
+ " en retard"
11140
+ ] })
11141
+ ] })
11142
+ ] })
11143
+ ] }) })
11144
+ ] }),
11145
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(ModernCard, { children: [
11146
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(CardHeader, { title: "Rapprochement bancaire", icon: import_lucide_react22.CreditCard }),
11147
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(CardBody, { children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "space-y-3", children: [
11148
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex items-center justify-between", children: [
11149
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "text-sm text-[var(--color-text-secondary)]", children: "Operations a pointer" }),
11150
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "px-2 py-1 text-xs font-medium bg-[var(--color-warning-light)] text-[var(--color-warning)] rounded-full", children: stats.bank_reconciliation.pending })
11151
+ ] }),
11152
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex items-center justify-between", children: [
11153
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "text-sm text-[var(--color-text-secondary)]", children: "Operations pointees" }),
11154
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "px-2 py-1 text-xs font-medium bg-[var(--color-success-light)] text-[var(--color-success)] rounded-full", children: stats.bank_reconciliation.reconciled })
11155
+ ] })
11156
+ ] }) })
11157
+ ] })
11158
+ ] })
11159
+ ] })
11160
+ ] });
11161
+ };
11162
+ var AccountingWorkspace_default = AccountingWorkspace;
11163
+
11164
+ // src/pages/workspaces/CrmWorkspace.tsx
11165
+ var import_react27 = require("react");
11166
+ var import_lucide_react23 = require("lucide-react");
11167
+ var import_jsx_runtime35 = require("react/jsx-runtime");
11168
+ var formatCurrencyShort3 = (amount) => {
11169
+ if (amount >= 1e6) {
11170
+ return `${(amount / 1e6).toFixed(1)}M FCFA`;
11171
+ } else if (amount >= 1e3) {
11172
+ return `${(amount / 1e3).toFixed(0)}k FCFA`;
11173
+ }
11174
+ return `${amount.toLocaleString("fr-FR")} FCFA`;
11175
+ };
11176
+ var CrmWorkspace = () => {
11177
+ const [stats, setStats] = (0, import_react27.useState)(null);
11178
+ const [recentContacts, setRecentContacts] = (0, import_react27.useState)([]);
11179
+ const [loading, setLoading] = (0, import_react27.useState)(true);
11180
+ const [error, setError] = (0, import_react27.useState)(null);
11181
+ (0, import_react27.useEffect)(() => {
11182
+ loadWorkspaceData();
11183
+ }, []);
11184
+ const loadWorkspaceData = async () => {
11185
+ setLoading(true);
11186
+ setError(null);
11187
+ try {
11188
+ await new Promise((resolve) => setTimeout(resolve, 500));
11189
+ setStats({
11190
+ clients: {
11191
+ total: 0,
11192
+ active: 0,
11193
+ new_this_month: 0,
11194
+ trend: 0
11195
+ },
11196
+ opportunities: {
11197
+ total: 0,
11198
+ qualified: 0,
11199
+ negotiation: 0,
11200
+ won: 0,
11201
+ lost: 0,
11202
+ total_value: 0
11203
+ },
11204
+ activities: {
11205
+ pending_calls: 0,
11206
+ pending_meetings: 0,
11207
+ pending_emails: 0,
11208
+ overdue: 0
11209
+ },
11210
+ revenue: {
11211
+ monthly: 0,
11212
+ quarterly: 0,
11213
+ trend: 0
11214
+ },
11215
+ alerts: {
11216
+ overdue_activities: 0,
11217
+ expiring_opportunities: 0,
11218
+ inactive_clients: 0
11219
+ }
11220
+ });
11221
+ setRecentContacts([]);
11222
+ } catch (err) {
11223
+ console.error("Erreur lors du chargement du workspace:", err);
11224
+ setError("Impossible de charger les donnees du workspace CRM.");
11225
+ } finally {
11226
+ setLoading(false);
11227
+ }
11228
+ };
11229
+ const getStatusColor = (status) => {
11230
+ const colors = {
11231
+ hot: "bg-[var(--color-error-light)] text-[var(--color-error)]",
11232
+ warm: "bg-[var(--color-warning-light)] text-[var(--color-warning)]",
11233
+ cold: "bg-[var(--color-info-light)] text-[var(--color-info)]"
11234
+ };
11235
+ return colors[status] || colors.cold;
11236
+ };
11237
+ const getStatusLabel = (status) => {
11238
+ const labels = { hot: "Chaud", warm: "Tiede", cold: "Froid" };
11239
+ return labels[status] || status;
11240
+ };
11241
+ if (loading) {
11242
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "flex items-center justify-center h-96", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "text-center", children: [
11243
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_lucide_react23.RefreshCw, { className: "w-12 h-12 text-[var(--color-primary)] animate-spin mx-auto mb-4" }),
11244
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { className: "text-[var(--color-text-secondary)]", children: "Chargement du workspace CRM..." })
11245
+ ] }) });
11246
+ }
11247
+ if (!stats) return null;
11248
+ const ErrorBanner = error ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "bg-[var(--color-error-light)] border border-[var(--color-error)] rounded-xl p-4 mb-6", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex items-center space-x-3", children: [
11249
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_lucide_react23.AlertTriangle, { className: "w-5 h-5 text-[var(--color-error)]" }),
11250
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { className: "text-sm text-[var(--color-error)]", children: error }) }),
11251
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
11252
+ "button",
11253
+ {
11254
+ onClick: loadWorkspaceData,
11255
+ className: "text-sm text-[var(--color-error)] hover:underline font-medium",
11256
+ children: "Reessayer"
11257
+ }
11258
+ )
11259
+ ] }) }) : null;
11260
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "space-y-6", children: [
11261
+ ErrorBanner,
11262
+ (stats.alerts.overdue_activities > 0 || stats.alerts.expiring_opportunities > 0) && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "bg-[var(--color-warning-light)] border border-[var(--color-warning)] rounded-xl p-4", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex items-start space-x-3", children: [
11263
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_lucide_react23.AlertTriangle, { className: "w-5 h-5 text-[var(--color-warning)] mt-0.5" }),
11264
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex-1", children: [
11265
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("h3", { className: "font-semibold text-[var(--color-text-primary)]", children: "Alertes CRM" }),
11266
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "mt-2 flex flex-wrap gap-4", children: [
11267
+ stats.alerts.overdue_activities > 0 && /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("span", { className: "text-sm text-[var(--color-warning)]", children: [
11268
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("strong", { children: stats.alerts.overdue_activities }),
11269
+ " activites en retard"
11270
+ ] }),
11271
+ stats.alerts.expiring_opportunities > 0 && /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("span", { className: "text-sm text-[var(--color-warning)]", children: [
11272
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("strong", { children: stats.alerts.expiring_opportunities }),
11273
+ " opportunites a relancer"
11274
+ ] }),
11275
+ stats.alerts.inactive_clients > 0 && /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("span", { className: "text-sm text-[var(--color-warning)]", children: [
11276
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("strong", { children: stats.alerts.inactive_clients }),
11277
+ " clients inactifs"
11278
+ ] })
11279
+ ] })
11280
+ ] })
11281
+ ] }) }),
11282
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6", children: [
11283
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
11284
+ StatCard,
11285
+ {
11286
+ title: "Clients actifs",
11287
+ value: stats.clients.active,
11288
+ icon: import_lucide_react23.Users,
11289
+ color: "primary",
11290
+ change: stats.clients.trend !== 0 ? {
11291
+ value: stats.clients.trend,
11292
+ type: stats.clients.trend > 0 ? "increase" : "decrease"
11293
+ } : void 0
11294
+ }
11295
+ ),
11296
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
11297
+ StatCard,
11298
+ {
11299
+ title: "Opportunites",
11300
+ value: stats.opportunities.total,
11301
+ icon: import_lucide_react23.Target,
11302
+ color: "info"
11303
+ }
11304
+ ),
11305
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
11306
+ StatCard,
11307
+ {
11308
+ title: "Pipeline",
11309
+ value: formatCurrencyShort3(stats.opportunities.total_value),
11310
+ icon: import_lucide_react23.TrendingUp,
11311
+ color: "success"
11312
+ }
11313
+ ),
11314
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
11315
+ StatCard,
11316
+ {
11317
+ title: "CA mensuel",
11318
+ value: formatCurrencyShort3(stats.revenue.monthly),
11319
+ icon: import_lucide_react23.Banknote,
11320
+ color: "warning",
11321
+ change: stats.revenue.trend !== 0 ? {
11322
+ value: stats.revenue.trend,
11323
+ type: stats.revenue.trend > 0 ? "increase" : "decrease"
11324
+ } : void 0
11325
+ }
11326
+ )
11327
+ ] }),
11328
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "grid grid-cols-1 lg:grid-cols-3 gap-6", children: [
11329
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "lg:col-span-2 space-y-6", children: [
11330
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(ModernCard, { children: [
11331
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
11332
+ CardHeader,
11333
+ {
11334
+ title: "Pipeline commercial",
11335
+ icon: import_lucide_react23.Target,
11336
+ action: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("button", { className: "text-sm text-[var(--color-primary)] hover:underline flex items-center", children: [
11337
+ "Voir tout ",
11338
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_lucide_react23.ArrowRight, { className: "w-4 h-4 ml-1" })
11339
+ ] })
11340
+ }
11341
+ ),
11342
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(CardBody, { children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "grid grid-cols-4 gap-4", children: [
11343
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "p-4 bg-[var(--color-info-light)] rounded-lg text-center", children: [
11344
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { className: "text-2xl font-bold text-[var(--color-info)]", children: stats.opportunities.qualified }),
11345
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { className: "text-sm text-[var(--color-text-secondary)]", children: "Qualifiees" })
11346
+ ] }),
11347
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "p-4 bg-[var(--color-warning-light)] rounded-lg text-center", children: [
11348
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { className: "text-2xl font-bold text-[var(--color-warning)]", children: stats.opportunities.negotiation }),
11349
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { className: "text-sm text-[var(--color-text-secondary)]", children: "Negociation" })
11350
+ ] }),
11351
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "p-4 bg-[var(--color-success-light)] rounded-lg text-center", children: [
11352
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { className: "text-2xl font-bold text-[var(--color-success)]", children: stats.opportunities.won }),
11353
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { className: "text-sm text-[var(--color-text-secondary)]", children: "Gagnees" })
11354
+ ] }),
11355
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "p-4 bg-[var(--color-error-light)] rounded-lg text-center", children: [
11356
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { className: "text-2xl font-bold text-[var(--color-error)]", children: stats.opportunities.lost }),
11357
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { className: "text-sm text-[var(--color-text-secondary)]", children: "Perdues" })
11358
+ ] })
11359
+ ] }) })
11360
+ ] }),
11361
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(ModernCard, { children: [
11362
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
11363
+ CardHeader,
11364
+ {
11365
+ title: "Contacts recents",
11366
+ icon: import_lucide_react23.Users,
11367
+ action: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("button", { className: "text-sm text-[var(--color-primary)] hover:underline flex items-center", children: [
11368
+ "Voir tout ",
11369
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_lucide_react23.ArrowRight, { className: "w-4 h-4 ml-1" })
11370
+ ] })
11371
+ }
11372
+ ),
11373
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(CardBody, { noPadding: true, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "divide-y divide-[var(--color-border-light)]", children: recentContacts.map((contact) => /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
11374
+ "div",
11375
+ {
11376
+ className: "p-4 hover:bg-[var(--color-surface-hover)] transition-colors cursor-pointer flex items-center justify-between",
11377
+ children: [
11378
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex items-center space-x-3", children: [
11379
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "w-10 h-10 bg-[var(--color-primary-light)] rounded-full flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "text-sm font-semibold text-[var(--color-primary)]", children: contact.name.split(" ").map((n) => n[0]).join("") }) }),
11380
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { children: [
11381
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { className: "text-sm font-medium text-[var(--color-text-primary)]", children: contact.name }),
11382
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { className: "text-xs text-[var(--color-text-tertiary)]", children: contact.company })
11383
+ ] })
11384
+ ] }),
11385
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: `px-2 py-1 text-xs font-medium rounded-full ${getStatusColor(contact.status)}`, children: getStatusLabel(contact.status) })
11386
+ ]
11387
+ },
11388
+ contact.id
11389
+ )) }) })
11390
+ ] })
11391
+ ] }),
11392
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "space-y-6", children: [
11393
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(ModernCard, { children: [
11394
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(CardHeader, { title: "Activites a faire", icon: import_lucide_react23.Activity }),
11395
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(CardBody, { children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "space-y-3", children: [
11396
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex items-center justify-between p-3 bg-[var(--color-surface-hover)] rounded-lg", children: [
11397
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex items-center space-x-2", children: [
11398
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_lucide_react23.Phone, { className: "w-4 h-4 text-[var(--color-info)]" }),
11399
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "text-sm text-[var(--color-text-primary)]", children: "Appels" })
11400
+ ] }),
11401
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "px-2 py-1 text-xs font-medium bg-[var(--color-info-light)] text-[var(--color-info)] rounded-full", children: stats.activities.pending_calls })
11402
+ ] }),
11403
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex items-center justify-between p-3 bg-[var(--color-surface-hover)] rounded-lg", children: [
11404
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex items-center space-x-2", children: [
11405
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_lucide_react23.Calendar, { className: "w-4 h-4 text-[var(--color-warning)]" }),
11406
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "text-sm text-[var(--color-text-primary)]", children: "Reunions" })
11407
+ ] }),
11408
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "px-2 py-1 text-xs font-medium bg-[var(--color-warning-light)] text-[var(--color-warning)] rounded-full", children: stats.activities.pending_meetings })
11409
+ ] }),
11410
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex items-center justify-between p-3 bg-[var(--color-surface-hover)] rounded-lg", children: [
11411
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex items-center space-x-2", children: [
11412
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_lucide_react23.Mail, { className: "w-4 h-4 text-[var(--color-success)]" }),
11413
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "text-sm text-[var(--color-text-primary)]", children: "Emails" })
11414
+ ] }),
11415
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "px-2 py-1 text-xs font-medium bg-[var(--color-success-light)] text-[var(--color-success)] rounded-full", children: stats.activities.pending_emails })
11416
+ ] }),
11417
+ stats.activities.overdue > 0 && /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex items-center justify-between p-3 bg-[var(--color-error-light)] rounded-lg", children: [
11418
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex items-center space-x-2", children: [
11419
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_lucide_react23.AlertTriangle, { className: "w-4 h-4 text-[var(--color-error)]" }),
11420
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "text-sm text-[var(--color-text-primary)]", children: "En retard" })
11421
+ ] }),
11422
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "px-2 py-1 text-xs font-medium bg-[var(--color-error)] text-white rounded-full", children: stats.activities.overdue })
11423
+ ] })
11424
+ ] }) })
11425
+ ] }),
11426
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(ModernCard, { children: [
11427
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(CardHeader, { title: "Nouveaux clients", icon: import_lucide_react23.UserPlus }),
11428
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(CardBody, { children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "text-center py-4", children: [
11429
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("p", { className: "text-4xl font-bold text-[var(--color-success)]", children: [
11430
+ "+",
11431
+ stats.clients.new_this_month
11432
+ ] }),
11433
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { className: "text-sm text-[var(--color-text-secondary)] mt-1", children: "ce mois-ci" }),
11434
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "mt-4 pt-4 border-t border-[var(--color-border-light)]", children: [
11435
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { className: "text-2xl font-bold text-[var(--color-text-primary)]", children: stats.clients.total }),
11436
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { className: "text-xs text-[var(--color-text-tertiary)]", children: "clients au total" })
11437
+ ] })
11438
+ ] }) })
11439
+ ] })
11440
+ ] })
11441
+ ] })
11442
+ ] });
11443
+ };
11444
+ var CrmWorkspace_default = CrmWorkspace;
11445
+
11446
+ // src/pages/workspaces/FacilityWorkspace.tsx
11447
+ var import_react28 = require("react");
11448
+ var import_lucide_react24 = require("lucide-react");
11449
+ var import_jsx_runtime36 = require("react/jsx-runtime");
11450
+ var FacilityWorkspace = () => {
11451
+ const [stats, setStats] = (0, import_react28.useState)(null);
11452
+ const [maintenanceTasks, setMaintenanceTasks] = (0, import_react28.useState)([]);
11453
+ const [loading, setLoading] = (0, import_react28.useState)(true);
11454
+ const [error, setError] = (0, import_react28.useState)(null);
11455
+ (0, import_react28.useEffect)(() => {
11456
+ loadWorkspaceData();
11457
+ }, []);
11458
+ const loadWorkspaceData = async () => {
11459
+ setLoading(true);
11460
+ setError(null);
11461
+ try {
11462
+ await new Promise((resolve) => setTimeout(resolve, 500));
11463
+ setStats({
11464
+ sites: {
11465
+ total: 0,
11466
+ active: 0
11467
+ },
11468
+ maintenance: {
11469
+ scheduled: 0,
11470
+ in_progress: 0,
11471
+ completed: 0,
11472
+ overdue: 0
11473
+ },
11474
+ incidents: {
11475
+ open: 0,
11476
+ in_progress: 0,
11477
+ resolved: 0,
11478
+ critical: 0
11479
+ },
11480
+ equipment: {
11481
+ total: 0,
11482
+ operational: 0,
11483
+ under_maintenance: 0,
11484
+ out_of_service: 0
11485
+ },
11486
+ alerts: {
11487
+ critical_incidents: 0,
11488
+ overdue_maintenance: 0,
11489
+ expiring_contracts: 0
11490
+ }
11491
+ });
11492
+ setMaintenanceTasks([]);
11493
+ } catch (err) {
11494
+ console.error("Erreur lors du chargement du workspace:", err);
11495
+ setError("Impossible de charger les donnees du workspace Facility.");
11496
+ } finally {
11497
+ setLoading(false);
11498
+ }
11499
+ };
11500
+ const getPriorityColor = (priority) => {
11501
+ const colors = {
11502
+ low: "bg-[var(--color-border-light)] text-[var(--color-text-secondary)]",
11503
+ medium: "bg-[var(--color-info-light)] text-[var(--color-info)]",
11504
+ high: "bg-[var(--color-warning-light)] text-[var(--color-warning)]",
11505
+ critical: "bg-[var(--color-error-light)] text-[var(--color-error)]"
11506
+ };
11507
+ return colors[priority] || colors.medium;
11508
+ };
11509
+ const getPriorityLabel = (priority) => {
11510
+ const labels = { low: "Basse", medium: "Moyenne", high: "Haute", critical: "Critique" };
11511
+ return labels[priority] || priority;
11512
+ };
11513
+ const getTypeColor = (type) => {
11514
+ return type === "corrective" ? "bg-[var(--color-error-light)] text-[var(--color-error)]" : "bg-[var(--color-info-light)] text-[var(--color-info)]";
11515
+ };
11516
+ if (loading) {
11517
+ return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "flex items-center justify-center h-96", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "text-center", children: [
11518
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_lucide_react24.RefreshCw, { className: "w-12 h-12 text-[var(--color-primary)] animate-spin mx-auto mb-4" }),
11519
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { className: "text-[var(--color-text-secondary)]", children: "Chargement du workspace Facility..." })
11520
+ ] }) });
11521
+ }
11522
+ if (!stats) return null;
11523
+ const ErrorBanner = error ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "bg-[var(--color-error-light)] border border-[var(--color-error)] rounded-xl p-4 mb-6", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex items-center space-x-3", children: [
11524
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_lucide_react24.AlertTriangle, { className: "w-5 h-5 text-[var(--color-error)]" }),
11525
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { className: "text-sm text-[var(--color-error)]", children: error }) }),
11526
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
11527
+ "button",
11528
+ {
11529
+ onClick: loadWorkspaceData,
11530
+ className: "text-sm text-[var(--color-error)] hover:underline font-medium",
11531
+ children: "Reessayer"
11532
+ }
11533
+ )
11534
+ ] }) }) : null;
11535
+ return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "space-y-6", children: [
11536
+ ErrorBanner,
11537
+ (stats.alerts.critical_incidents > 0 || stats.alerts.overdue_maintenance > 0) && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "bg-[var(--color-error-light)] border border-[var(--color-error)] rounded-xl p-4", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex items-start space-x-3", children: [
11538
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_lucide_react24.AlertTriangle, { className: "w-5 h-5 text-[var(--color-error)] mt-0.5" }),
11539
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex-1", children: [
11540
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("h3", { className: "font-semibold text-[var(--color-text-primary)]", children: "Alertes critiques" }),
11541
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "mt-2 flex flex-wrap gap-4", children: [
11542
+ stats.alerts.critical_incidents > 0 && /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("span", { className: "text-sm text-[var(--color-error)]", children: [
11543
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("strong", { children: stats.alerts.critical_incidents }),
11544
+ " incident(s) critique(s)"
11545
+ ] }),
11546
+ stats.alerts.overdue_maintenance > 0 && /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("span", { className: "text-sm text-[var(--color-error)]", children: [
11547
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("strong", { children: stats.alerts.overdue_maintenance }),
11548
+ " maintenance(s) en retard"
11549
+ ] }),
11550
+ stats.alerts.expiring_contracts > 0 && /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("span", { className: "text-sm text-[var(--color-warning)]", children: [
11551
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("strong", { children: stats.alerts.expiring_contracts }),
11552
+ " contrat(s) expirant bientot"
11553
+ ] })
11554
+ ] })
11555
+ ] })
11556
+ ] }) }),
11557
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6", children: [
11558
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
11559
+ StatCard,
11560
+ {
11561
+ title: "Sites actifs",
11562
+ value: stats.sites.active,
11563
+ icon: import_lucide_react24.Building2,
11564
+ color: "primary"
11565
+ }
11566
+ ),
11567
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
11568
+ StatCard,
11569
+ {
11570
+ title: "Maintenances planifiees",
11571
+ value: stats.maintenance.scheduled,
11572
+ icon: import_lucide_react24.Wrench,
11573
+ color: "info"
11574
+ }
11575
+ ),
11576
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
11577
+ StatCard,
11578
+ {
11579
+ title: "Incidents ouverts",
11580
+ value: stats.incidents.open,
11581
+ icon: import_lucide_react24.AlertTriangle,
11582
+ color: "warning"
11583
+ }
11584
+ ),
11585
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
11586
+ StatCard,
11587
+ {
11588
+ title: "Equipements operationnels",
11589
+ value: stats.equipment.total > 0 ? `${Math.round(stats.equipment.operational / stats.equipment.total * 100)}%` : "0%",
11590
+ icon: import_lucide_react24.CheckCircle,
11591
+ color: "success"
11592
+ }
11593
+ )
11594
+ ] }),
11595
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "grid grid-cols-1 lg:grid-cols-3 gap-6", children: [
11596
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "lg:col-span-2 space-y-6", children: [
11597
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(ModernCard, { children: [
11598
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
11599
+ CardHeader,
11600
+ {
11601
+ title: "Maintenances a venir",
11602
+ icon: import_lucide_react24.Wrench,
11603
+ action: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("button", { className: "text-sm text-[var(--color-primary)] hover:underline flex items-center", children: [
11604
+ "Voir tout ",
11605
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_lucide_react24.ArrowRight, { className: "w-4 h-4 ml-1" })
11606
+ ] })
11607
+ }
11608
+ ),
11609
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(CardBody, { noPadding: true, children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "divide-y divide-[var(--color-border-light)]", children: maintenanceTasks.map((task) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
11610
+ "div",
11611
+ {
11612
+ className: "p-4 hover:bg-[var(--color-surface-hover)] transition-colors cursor-pointer",
11613
+ children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex items-center justify-between", children: [
11614
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex items-center space-x-3", children: [
11615
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: `px-2 py-1 text-xs font-medium rounded-full ${getPriorityColor(task.priority)}`, children: getPriorityLabel(task.priority) }),
11616
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { children: [
11617
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { className: "text-sm font-medium text-[var(--color-text-primary)]", children: task.title }),
11618
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex items-center space-x-2 mt-1", children: [
11619
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_lucide_react24.MapPin, { className: "w-3 h-3 text-[var(--color-text-tertiary)]" }),
11620
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "text-xs text-[var(--color-text-tertiary)]", children: task.site })
11621
+ ] })
11622
+ ] })
11623
+ ] }),
11624
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex items-center space-x-3", children: [
11625
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: `px-2 py-1 text-xs rounded ${getTypeColor(task.type)}`, children: task.type === "preventive" ? "Preventive" : "Corrective" }),
11626
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "text-right", children: [
11627
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { className: "text-xs text-[var(--color-text-tertiary)]", children: "Echeance" }),
11628
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { className: "text-sm font-medium text-[var(--color-text-primary)]", children: new Date(task.dueDate).toLocaleDateString("fr-FR") })
11629
+ ] })
11630
+ ] })
11631
+ ] })
11632
+ },
11633
+ task.id
11634
+ )) }) })
11635
+ ] }),
11636
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(ModernCard, { children: [
11637
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(CardHeader, { title: "Etat des maintenances", icon: import_lucide_react24.Calendar }),
11638
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(CardBody, { children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "grid grid-cols-4 gap-4", children: [
11639
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "p-4 bg-[var(--color-info-light)] rounded-lg text-center", children: [
11640
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { className: "text-2xl font-bold text-[var(--color-info)]", children: stats.maintenance.scheduled }),
11641
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { className: "text-sm text-[var(--color-text-secondary)]", children: "Planifiees" })
11642
+ ] }),
11643
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "p-4 bg-[var(--color-warning-light)] rounded-lg text-center", children: [
11644
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { className: "text-2xl font-bold text-[var(--color-warning)]", children: stats.maintenance.in_progress }),
11645
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { className: "text-sm text-[var(--color-text-secondary)]", children: "En cours" })
11646
+ ] }),
11647
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "p-4 bg-[var(--color-success-light)] rounded-lg text-center", children: [
11648
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { className: "text-2xl font-bold text-[var(--color-success)]", children: stats.maintenance.completed }),
11649
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { className: "text-sm text-[var(--color-text-secondary)]", children: "Terminees" })
11650
+ ] }),
11651
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "p-4 bg-[var(--color-error-light)] rounded-lg text-center", children: [
11652
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { className: "text-2xl font-bold text-[var(--color-error)]", children: stats.maintenance.overdue }),
11653
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { className: "text-sm text-[var(--color-text-secondary)]", children: "En retard" })
11654
+ ] })
11655
+ ] }) })
11656
+ ] })
11657
+ ] }),
11658
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "space-y-6", children: [
11659
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(ModernCard, { children: [
11660
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(CardHeader, { title: "Incidents", icon: import_lucide_react24.AlertTriangle }),
11661
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(CardBody, { children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "space-y-3", children: [
11662
+ stats.incidents.critical > 0 && /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex items-center justify-between p-3 bg-[var(--color-error-light)] rounded-lg", children: [
11663
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex items-center space-x-2", children: [
11664
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "w-2 h-2 bg-[var(--color-error)] rounded-full animate-pulse" }),
11665
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "text-sm font-medium text-[var(--color-error)]", children: "Critiques" })
11666
+ ] }),
11667
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "font-bold text-[var(--color-error)]", children: stats.incidents.critical })
11668
+ ] }),
11669
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex items-center justify-between p-3 bg-[var(--color-warning-light)] rounded-lg", children: [
11670
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex items-center space-x-2", children: [
11671
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "w-2 h-2 bg-[var(--color-warning)] rounded-full" }),
11672
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "text-sm text-[var(--color-text-primary)]", children: "Ouverts" })
11673
+ ] }),
11674
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "font-semibold text-[var(--color-text-primary)]", children: stats.incidents.open })
11675
+ ] }),
11676
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex items-center justify-between p-3 bg-[var(--color-info-light)] rounded-lg", children: [
11677
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex items-center space-x-2", children: [
11678
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "w-2 h-2 bg-[var(--color-info)] rounded-full" }),
11679
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "text-sm text-[var(--color-text-primary)]", children: "En cours" })
11680
+ ] }),
11681
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "font-semibold text-[var(--color-text-primary)]", children: stats.incidents.in_progress })
11682
+ ] }),
11683
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex items-center justify-between p-3 bg-[var(--color-success-light)] rounded-lg", children: [
11684
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex items-center space-x-2", children: [
11685
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "w-2 h-2 bg-[var(--color-success)] rounded-full" }),
11686
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "text-sm text-[var(--color-text-primary)]", children: "Resolus" })
11687
+ ] }),
11688
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "font-semibold text-[var(--color-text-primary)]", children: stats.incidents.resolved })
11689
+ ] })
11690
+ ] }) })
11691
+ ] }),
11692
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(ModernCard, { children: [
11693
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(CardHeader, { title: "Equipements", icon: import_lucide_react24.Shield }),
11694
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(CardBody, { children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "text-center py-4", children: [
11695
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { className: "text-4xl font-bold text-[var(--color-text-primary)]", children: stats.equipment.total }),
11696
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { className: "text-sm text-[var(--color-text-secondary)] mt-1", children: "equipements references" }),
11697
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "mt-4 grid grid-cols-3 gap-2", children: [
11698
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "p-2 bg-[var(--color-success-light)] rounded", children: [
11699
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { className: "text-lg font-semibold text-[var(--color-success)]", children: stats.equipment.operational }),
11700
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { className: "text-xs text-[var(--color-text-tertiary)]", children: "OK" })
11701
+ ] }),
11702
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "p-2 bg-[var(--color-warning-light)] rounded", children: [
11703
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { className: "text-lg font-semibold text-[var(--color-warning)]", children: stats.equipment.under_maintenance }),
11704
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { className: "text-xs text-[var(--color-text-tertiary)]", children: "Maint." })
11705
+ ] }),
11706
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "p-2 bg-[var(--color-error-light)] rounded", children: [
11707
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { className: "text-lg font-semibold text-[var(--color-error)]", children: stats.equipment.out_of_service }),
11708
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { className: "text-xs text-[var(--color-text-tertiary)]", children: "HS" })
11709
+ ] })
11710
+ ] })
11711
+ ] }) })
11712
+ ] })
11713
+ ] })
11714
+ ] })
11715
+ ] });
11716
+ };
11717
+ var FacilityWorkspace_default = FacilityWorkspace;
11718
+
11719
+ // src/pages/workspaces/WorkSpace.tsx
11720
+ var import_jsx_runtime37 = require("react/jsx-runtime");
11721
+ var MODULES_CONFIG = [
11722
+ {
11723
+ id: "purchase",
11724
+ label: "Achats",
11725
+ description: "Gestion des achats et approvisionnements",
11726
+ icon: import_lucide_react25.ShoppingCart,
11727
+ color: "text-blue-600",
11728
+ bgColor: "bg-blue-50",
11729
+ component: PurchaseWorkspace_default
11730
+ },
11731
+ {
11732
+ id: "accounting",
11733
+ label: "Comptabilite",
11734
+ description: "Gestion comptable et financiere",
11735
+ icon: import_lucide_react25.Calculator,
11736
+ color: "text-green-600",
11737
+ bgColor: "bg-green-50",
11738
+ component: AccountingWorkspace_default
11739
+ },
11740
+ {
11741
+ id: "crm",
11742
+ label: "CRM",
11743
+ description: "Gestion de la relation client",
11744
+ icon: import_lucide_react25.Users,
11745
+ color: "text-purple-600",
11746
+ bgColor: "bg-purple-50",
11747
+ component: CrmWorkspace_default
11748
+ },
11749
+ {
11750
+ id: "facility",
11751
+ label: "Facility",
11752
+ description: "Gestion des installations et maintenances",
11753
+ icon: import_lucide_react25.Building2,
11754
+ color: "text-orange-600",
11755
+ bgColor: "bg-orange-50",
11756
+ component: FacilityWorkspace_default
11757
+ }
11758
+ ];
11759
+ var WorkSpace = () => {
11760
+ const [activeModule, setActiveModule] = (0, import_react29.useState)(null);
11761
+ const [availableModules, setAvailableModules] = (0, import_react29.useState)([]);
11762
+ const [loading, setLoading] = (0, import_react29.useState)(true);
11763
+ const [showModuleSelector, setShowModuleSelector] = (0, import_react29.useState)(false);
11764
+ (0, import_react29.useEffect)(() => {
11765
+ loadAvailableModules();
11766
+ }, []);
11767
+ const loadAvailableModules = async () => {
11768
+ setLoading(true);
11769
+ try {
11770
+ await new Promise((resolve) => setTimeout(resolve, 300));
11771
+ const userModules = ["purchase", "accounting", "crm", "facility"];
11772
+ setAvailableModules(userModules);
11773
+ if (userModules.length > 0 && !activeModule) {
11774
+ setActiveModule(userModules[0]);
11775
+ }
11776
+ } catch (error) {
11777
+ console.error("Erreur lors du chargement des modules:", error);
11778
+ setAvailableModules(["purchase"]);
11779
+ setActiveModule("purchase");
11780
+ } finally {
11781
+ setLoading(false);
11782
+ }
11783
+ };
11784
+ const filteredModules = (0, import_react29.useMemo)(() => {
11785
+ return MODULES_CONFIG.filter((m) => availableModules.includes(m.id));
11786
+ }, [availableModules]);
11787
+ const currentModule = (0, import_react29.useMemo)(() => {
11788
+ return MODULES_CONFIG.find((m) => m.id === activeModule);
11789
+ }, [activeModule]);
11790
+ const ActiveWorkspaceComponent = currentModule?.component;
11791
+ if (loading) {
11792
+ return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "flex items-center justify-center h-screen bg-[var(--color-background)]", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "text-center", children: [
11793
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_lucide_react25.RefreshCw, { className: "w-12 h-12 text-[var(--color-primary)] animate-spin mx-auto mb-4" }),
11794
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("p", { className: "text-[var(--color-text-secondary)]", children: "Chargement des workspaces..." })
11795
+ ] }) });
11796
+ }
11797
+ if (filteredModules.length === 0) {
11798
+ return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "flex items-center justify-center h-screen bg-[var(--color-background)]", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "text-center", children: [
11799
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_lucide_react25.LayoutDashboard, { className: "w-16 h-16 text-[var(--color-text-tertiary)] mx-auto mb-4" }),
11800
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("h2", { className: "text-xl font-semibold text-[var(--color-text-primary)] mb-2", children: "Aucun workspace disponible" }),
11801
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("p", { className: "text-[var(--color-text-secondary)]", children: "Contactez votre administrateur pour obtenir l'acces aux modules." })
11802
+ ] }) });
11803
+ }
11804
+ return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "min-h-screen bg-[var(--color-background)]", children: [
11805
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "sticky top-0 z-40 bg-[var(--color-surface)] border-b border-[var(--color-border-light)] shadow-sm", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "px-6 py-4", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "flex items-center justify-between", children: [
11806
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "flex items-center space-x-4", children: [
11807
+ currentModule && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: `p-2 rounded-lg ${currentModule.bgColor}`, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(currentModule.icon, { className: `w-6 h-6 ${currentModule.color}` }) }),
11808
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "relative", children: [
11809
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
11810
+ "button",
11811
+ {
11812
+ onClick: () => setShowModuleSelector(!showModuleSelector),
11813
+ className: "flex items-center space-x-2 hover:bg-[var(--color-surface-hover)] px-3 py-2 rounded-lg transition-colors",
11814
+ children: [
11815
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { children: [
11816
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("h1", { className: "text-xl font-bold text-[var(--color-text-primary)]", children: [
11817
+ "Workspace - ",
11818
+ currentModule?.label
11819
+ ] }),
11820
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("p", { className: "text-sm text-[var(--color-text-secondary)]", children: currentModule?.description })
11821
+ ] }),
11822
+ filteredModules.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_lucide_react25.ChevronDown, { className: `w-5 h-5 text-[var(--color-text-tertiary)] transition-transform ${showModuleSelector ? "rotate-180" : ""}` })
11823
+ ]
11824
+ }
11825
+ ),
11826
+ showModuleSelector && filteredModules.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_jsx_runtime37.Fragment, { children: [
11827
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
11828
+ "div",
11829
+ {
11830
+ className: "fixed inset-0 z-10",
11831
+ onClick: () => setShowModuleSelector(false)
11832
+ }
11833
+ ),
11834
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "absolute top-full left-0 mt-2 w-72 bg-[var(--color-surface)] rounded-xl shadow-xl border border-[var(--color-border-light)] z-20 overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "p-2", children: [
11835
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("p", { className: "text-xs font-semibold text-[var(--color-text-tertiary)] uppercase tracking-wide px-3 py-2", children: "Changer de workspace" }),
11836
+ filteredModules.map((module2) => /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
11837
+ "button",
11838
+ {
11839
+ onClick: () => {
11840
+ setActiveModule(module2.id);
11841
+ setShowModuleSelector(false);
11842
+ },
11843
+ className: `
11844
+ w-full flex items-center space-x-3 px-3 py-3 rounded-lg transition-colors
11845
+ ${activeModule === module2.id ? "bg-[var(--color-primary-light)]" : "hover:bg-[var(--color-surface-hover)]"}
11846
+ `,
11847
+ children: [
11848
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: `p-2 rounded-lg ${module2.bgColor}`, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(module2.icon, { className: `w-5 h-5 ${module2.color}` }) }),
11849
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "text-left", children: [
11850
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("p", { className: `font-medium ${activeModule === module2.id ? "text-[var(--color-primary)]" : "text-[var(--color-text-primary)]"}`, children: module2.label }),
11851
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("p", { className: "text-xs text-[var(--color-text-tertiary)]", children: module2.description })
11852
+ ] })
11853
+ ]
11854
+ },
11855
+ module2.id
11856
+ ))
11857
+ ] }) })
11858
+ ] })
11859
+ ] })
11860
+ ] }),
11861
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
11862
+ "button",
11863
+ {
11864
+ onClick: loadAvailableModules,
11865
+ className: "p-2 hover:bg-[var(--color-surface-hover)] rounded-lg transition-colors",
11866
+ title: "Actualiser",
11867
+ children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_lucide_react25.RefreshCw, { className: "w-5 h-5 text-[var(--color-text-tertiary)]" })
11868
+ }
11869
+ )
11870
+ ] }) }) }),
11871
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "p-6", children: ActiveWorkspaceComponent && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(ActiveWorkspaceComponent, {}) })
11872
+ ] });
11873
+ };
11874
+ var WorkSpace_default = WorkSpace;
11875
+
11876
+ // src/pages/workspaces/HRConnectPage.tsx
11877
+ var import_lucide_react26 = require("lucide-react");
11878
+ var import_jsx_runtime38 = require("react/jsx-runtime");
11879
+ var HRConnectPage = () => {
11880
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "h-full flex flex-col", children: [
11881
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "bg-[var(--color-surface)] border-b border-[var(--color-border)] px-6 py-4", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex items-center gap-3", children: [
11882
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "p-2 bg-purple-100 rounded-lg", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_lucide_react26.UserCog, { className: "w-6 h-6 text-purple-600" }) }),
11883
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { children: [
11884
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("h1", { className: "text-xl font-semibold text-[var(--color-text-primary)]", children: "HR Connect" }),
11885
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("p", { className: "text-sm text-[var(--color-text-secondary)]", children: "Gestion des ressources humaines" })
11886
+ ] })
11887
+ ] }) }),
11888
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "flex-1 p-6 bg-[var(--color-background)]", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6", children: [
11889
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "bg-[var(--color-surface)] rounded-xl p-6 border border-[var(--color-border-light)] hover:shadow-md transition-shadow", children: [
11890
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex items-center gap-3 mb-4", children: [
11891
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "p-2 bg-blue-100 rounded-lg", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_lucide_react26.Users, { className: "w-5 h-5 text-blue-600" }) }),
11892
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("h3", { className: "font-medium text-[var(--color-text-primary)]", children: "Employ\xE9s" })
11893
+ ] }),
11894
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("p", { className: "text-sm text-[var(--color-text-secondary)]", children: "G\xE9rer les profils et informations des employ\xE9s" })
11895
+ ] }),
11896
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "bg-[var(--color-surface)] rounded-xl p-6 border border-[var(--color-border-light)] hover:shadow-md transition-shadow", children: [
11897
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex items-center gap-3 mb-4", children: [
11898
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "p-2 bg-green-100 rounded-lg", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_lucide_react26.Calendar, { className: "w-5 h-5 text-green-600" }) }),
11899
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("h3", { className: "font-medium text-[var(--color-text-primary)]", children: "Cong\xE9s" })
11900
+ ] }),
11901
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("p", { className: "text-sm text-[var(--color-text-secondary)]", children: "Suivi des demandes de cong\xE9s et absences" })
11902
+ ] }),
11903
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "bg-[var(--color-surface)] rounded-xl p-6 border border-[var(--color-border-light)] hover:shadow-md transition-shadow", children: [
11904
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex items-center gap-3 mb-4", children: [
11905
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "p-2 bg-orange-100 rounded-lg", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_lucide_react26.FileText, { className: "w-5 h-5 text-orange-600" }) }),
11906
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("h3", { className: "font-medium text-[var(--color-text-primary)]", children: "Documents" })
11907
+ ] }),
11908
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("p", { className: "text-sm text-[var(--color-text-secondary)]", children: "Gestion des documents RH et contrats" })
11909
+ ] }),
11910
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "bg-[var(--color-surface)] rounded-xl p-6 border border-[var(--color-border-light)] hover:shadow-md transition-shadow", children: [
11911
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex items-center gap-3 mb-4", children: [
11912
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "p-2 bg-indigo-100 rounded-lg", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_lucide_react26.TrendingUp, { className: "w-5 h-5 text-indigo-600" }) }),
11913
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("h3", { className: "font-medium text-[var(--color-text-primary)]", children: "Performance" })
11914
+ ] }),
11915
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("p", { className: "text-sm text-[var(--color-text-secondary)]", children: "\xC9valuations et objectifs des employ\xE9s" })
11916
+ ] }),
11917
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "bg-[var(--color-surface)] rounded-xl p-6 border border-[var(--color-border-light)] hover:shadow-md transition-shadow", children: [
11918
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex items-center gap-3 mb-4", children: [
11919
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "p-2 bg-pink-100 rounded-lg", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_lucide_react26.Award, { className: "w-5 h-5 text-pink-600" }) }),
11920
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("h3", { className: "font-medium text-[var(--color-text-primary)]", children: "Formations" })
11921
+ ] }),
11922
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("p", { className: "text-sm text-[var(--color-text-secondary)]", children: "Programmes de formation et d\xE9veloppement" })
11923
+ ] })
11924
+ ] }) })
11925
+ ] });
11926
+ };
11927
+ var HRConnectPage_default = HRConnectPage;
11928
+
11929
+ // src/pages/workspaces/MeetingHubPage.tsx
11930
+ var import_lucide_react27 = require("lucide-react");
11931
+ var import_jsx_runtime39 = require("react/jsx-runtime");
11932
+ var MeetingHubPage = () => {
11933
+ return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "h-full flex flex-col", children: [
11934
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "bg-[var(--color-surface)] border-b border-[var(--color-border)] px-6 py-4", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "flex items-center justify-between", children: [
11935
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "flex items-center gap-3", children: [
11936
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "p-2 bg-blue-100 rounded-lg", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_lucide_react27.Calendar, { className: "w-6 h-6 text-blue-600" }) }),
11937
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { children: [
11938
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("h1", { className: "text-xl font-semibold text-[var(--color-text-primary)]", children: "Meeting Hub" }),
11939
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("p", { className: "text-sm text-[var(--color-text-secondary)]", children: "Planification et gestion des r\xE9unions" })
11940
+ ] })
11941
+ ] }),
11942
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Buttons_default, { children: [
11943
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_lucide_react27.Plus, { className: "w-4 h-4 mr-2" }),
11944
+ "Nouvelle r\xE9union"
11945
+ ] })
11946
+ ] }) }),
11947
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "flex-1 p-6 bg-[var(--color-background)]", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "grid grid-cols-1 lg:grid-cols-3 gap-6", children: [
11948
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "lg:col-span-2 bg-[var(--color-surface)] rounded-xl border border-[var(--color-border-light)]", children: [
11949
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "p-4 border-b border-[var(--color-border-light)]", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("h2", { className: "font-semibold text-[var(--color-text-primary)]", children: "R\xE9unions du jour" }) }),
11950
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "p-4 space-y-4", children: [
11951
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "flex items-start gap-4 p-4 bg-[var(--color-background)] rounded-lg", children: [
11952
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "p-2 bg-blue-100 rounded-lg", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_lucide_react27.Video, { className: "w-5 h-5 text-blue-600" }) }),
11953
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "flex-1", children: [
11954
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("h3", { className: "font-medium text-[var(--color-text-primary)]", children: "Stand-up quotidien" }),
11955
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "flex items-center gap-4 mt-2 text-sm text-[var(--color-text-secondary)]", children: [
11956
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("span", { className: "flex items-center gap-1", children: [
11957
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_lucide_react27.Clock, { className: "w-4 h-4" }),
11958
+ "09:00 - 09:30"
11959
+ ] }),
11960
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("span", { className: "flex items-center gap-1", children: [
11961
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_lucide_react27.Users, { className: "w-4 h-4" }),
11962
+ "8 participants"
11963
+ ] })
11964
+ ] })
11965
+ ] })
11966
+ ] }),
11967
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "flex items-start gap-4 p-4 bg-[var(--color-background)] rounded-lg", children: [
11968
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "p-2 bg-green-100 rounded-lg", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_lucide_react27.MapPin, { className: "w-5 h-5 text-green-600" }) }),
11969
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "flex-1", children: [
11970
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("h3", { className: "font-medium text-[var(--color-text-primary)]", children: "Revue de sprint" }),
11971
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "flex items-center gap-4 mt-2 text-sm text-[var(--color-text-secondary)]", children: [
11972
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("span", { className: "flex items-center gap-1", children: [
11973
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_lucide_react27.Clock, { className: "w-4 h-4" }),
11974
+ "14:00 - 15:30"
11975
+ ] }),
11976
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("span", { className: "flex items-center gap-1", children: [
11977
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_lucide_react27.Users, { className: "w-4 h-4" }),
11978
+ "12 participants"
11979
+ ] })
11980
+ ] })
11981
+ ] })
11982
+ ] }),
11983
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("p", { className: "text-center text-sm text-[var(--color-text-tertiary)] py-4", children: "Aucune autre r\xE9union pr\xE9vue aujourd'hui" })
11984
+ ] })
11985
+ ] }),
11986
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "space-y-6", children: [
11987
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "bg-[var(--color-surface)] rounded-xl p-6 border border-[var(--color-border-light)]", children: [
11988
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("h3", { className: "font-medium text-[var(--color-text-primary)] mb-4", children: "Cette semaine" }),
11989
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "space-y-3", children: [
11990
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "flex justify-between", children: [
11991
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "text-sm text-[var(--color-text-secondary)]", children: "R\xE9unions planifi\xE9es" }),
11992
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "font-semibold text-[var(--color-text-primary)]", children: "12" })
11993
+ ] }),
11994
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "flex justify-between", children: [
11995
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "text-sm text-[var(--color-text-secondary)]", children: "Heures de r\xE9union" }),
11996
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "font-semibold text-[var(--color-text-primary)]", children: "8h" })
11997
+ ] }),
11998
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "flex justify-between", children: [
11999
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "text-sm text-[var(--color-text-secondary)]", children: "Participants uniques" }),
12000
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "font-semibold text-[var(--color-text-primary)]", children: "24" })
12001
+ ] })
12002
+ ] })
12003
+ ] }),
12004
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "bg-[var(--color-surface)] rounded-xl p-6 border border-[var(--color-border-light)]", children: [
12005
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("h3", { className: "font-medium text-[var(--color-text-primary)] mb-4", children: "Salles disponibles" }),
12006
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "space-y-2", children: [
12007
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "flex items-center justify-between p-2 bg-green-50 rounded-lg", children: [
12008
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "text-sm text-[var(--color-text-primary)]", children: "Salle A" }),
12009
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "text-xs px-2 py-1 bg-green-100 text-green-700 rounded", children: "Libre" })
12010
+ ] }),
12011
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "flex items-center justify-between p-2 bg-red-50 rounded-lg", children: [
12012
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "text-sm text-[var(--color-text-primary)]", children: "Salle B" }),
12013
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "text-xs px-2 py-1 bg-red-100 text-red-700 rounded", children: "Occup\xE9e" })
12014
+ ] }),
12015
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "flex items-center justify-between p-2 bg-green-50 rounded-lg", children: [
12016
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "text-sm text-[var(--color-text-primary)]", children: "Salle C" }),
12017
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "text-xs px-2 py-1 bg-green-100 text-green-700 rounded", children: "Libre" })
12018
+ ] })
12019
+ ] })
12020
+ ] })
12021
+ ] })
12022
+ ] }) })
12023
+ ] });
12024
+ };
12025
+ var MeetingHubPage_default = MeetingHubPage;
12026
+
12027
+ // src/pages/workspaces/BudgetPage.tsx
12028
+ var import_lucide_react28 = require("lucide-react");
12029
+ var import_jsx_runtime40 = require("react/jsx-runtime");
12030
+ var BudgetPage = () => {
12031
+ return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "h-full flex flex-col", children: [
12032
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "bg-[var(--color-surface)] border-b border-[var(--color-border)] px-6 py-4", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "flex items-center gap-3", children: [
12033
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "p-2 bg-emerald-100 rounded-lg", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_lucide_react28.CircleDollarSign, { className: "w-6 h-6 text-emerald-600" }) }),
12034
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { children: [
12035
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("h1", { className: "text-xl font-semibold text-[var(--color-text-primary)]", children: "Budget" }),
12036
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("p", { className: "text-sm text-[var(--color-text-secondary)]", children: "Gestion budg\xE9taire et suivi financier" })
12037
+ ] })
12038
+ ] }) }),
12039
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "flex-1 p-6 bg-[var(--color-background)]", children: [
12040
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-6 mb-6", children: [
12041
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "bg-[var(--color-surface)] rounded-xl p-6 border border-[var(--color-border-light)]", children: [
12042
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "flex items-center justify-between mb-4", children: [
12043
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "text-sm text-[var(--color-text-secondary)]", children: "Budget Total" }),
12044
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "p-2 bg-blue-100 rounded-lg", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_lucide_react28.CircleDollarSign, { className: "w-5 h-5 text-blue-600" }) })
12045
+ ] }),
12046
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("p", { className: "text-2xl font-bold text-[var(--color-text-primary)]", children: "1,250,000 \u20AC" }),
12047
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("p", { className: "text-sm text-green-600 mt-2 flex items-center gap-1", children: [
12048
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_lucide_react28.TrendingUp, { className: "w-4 h-4" }),
12049
+ "+12% vs ann\xE9e pr\xE9c\xE9dente"
12050
+ ] })
12051
+ ] }),
12052
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "bg-[var(--color-surface)] rounded-xl p-6 border border-[var(--color-border-light)]", children: [
12053
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "flex items-center justify-between mb-4", children: [
12054
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "text-sm text-[var(--color-text-secondary)]", children: "D\xE9penses YTD" }),
12055
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "p-2 bg-orange-100 rounded-lg", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_lucide_react28.TrendingDown, { className: "w-5 h-5 text-orange-600" }) })
12056
+ ] }),
12057
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("p", { className: "text-2xl font-bold text-[var(--color-text-primary)]", children: "875,000 \u20AC" }),
12058
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("p", { className: "text-sm text-[var(--color-text-secondary)] mt-2", children: "70% du budget utilis\xE9" })
12059
+ ] }),
12060
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "bg-[var(--color-surface)] rounded-xl p-6 border border-[var(--color-border-light)]", children: [
12061
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "flex items-center justify-between mb-4", children: [
12062
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "text-sm text-[var(--color-text-secondary)]", children: "Disponible" }),
12063
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "p-2 bg-green-100 rounded-lg", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_lucide_react28.PieChart, { className: "w-5 h-5 text-green-600" }) })
12064
+ ] }),
12065
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("p", { className: "text-2xl font-bold text-green-600", children: "375,000 \u20AC" }),
12066
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("p", { className: "text-sm text-[var(--color-text-secondary)] mt-2", children: "30% restant" })
12067
+ ] })
12068
+ ] }),
12069
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "grid grid-cols-1 lg:grid-cols-2 gap-6", children: [
12070
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "bg-[var(--color-surface)] rounded-xl border border-[var(--color-border-light)]", children: [
12071
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "p-4 border-b border-[var(--color-border-light)] flex items-center gap-2", children: [
12072
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_lucide_react28.BarChart3, { className: "w-5 h-5 text-[var(--color-text-secondary)]" }),
12073
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("h2", { className: "font-semibold text-[var(--color-text-primary)]", children: "OPEX - D\xE9penses Op\xE9rationnelles" })
12074
+ ] }),
12075
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "p-4 space-y-4", children: [
12076
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { children: [
12077
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "flex justify-between text-sm mb-1", children: [
12078
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "text-[var(--color-text-secondary)]", children: "Salaires" }),
12079
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "text-[var(--color-text-primary)]", children: "450,000 \u20AC" })
12080
+ ] }),
12081
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "w-full bg-[var(--color-border)] rounded-full h-2", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "bg-blue-600 h-2 rounded-full", style: { width: "75%" } }) })
12082
+ ] }),
12083
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { children: [
12084
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "flex justify-between text-sm mb-1", children: [
12085
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "text-[var(--color-text-secondary)]", children: "Fournitures" }),
12086
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "text-[var(--color-text-primary)]", children: "125,000 \u20AC" })
12087
+ ] }),
12088
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "w-full bg-[var(--color-border)] rounded-full h-2", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "bg-green-600 h-2 rounded-full", style: { width: "60%" } }) })
12089
+ ] }),
12090
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { children: [
12091
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "flex justify-between text-sm mb-1", children: [
12092
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "text-[var(--color-text-secondary)]", children: "Services" }),
12093
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "text-[var(--color-text-primary)]", children: "200,000 \u20AC" })
12094
+ ] }),
12095
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "w-full bg-[var(--color-border)] rounded-full h-2", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "bg-purple-600 h-2 rounded-full", style: { width: "80%" } }) })
12096
+ ] })
12097
+ ] })
12098
+ ] }),
12099
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "bg-[var(--color-surface)] rounded-xl border border-[var(--color-border-light)]", children: [
12100
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "p-4 border-b border-[var(--color-border-light)] flex items-center gap-2", children: [
12101
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_lucide_react28.FileText, { className: "w-5 h-5 text-[var(--color-text-secondary)]" }),
12102
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("h2", { className: "font-semibold text-[var(--color-text-primary)]", children: "CAPEX - Investissements" })
12103
+ ] }),
12104
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "p-4 space-y-4", children: [
12105
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { children: [
12106
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "flex justify-between text-sm mb-1", children: [
12107
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "text-[var(--color-text-secondary)]", children: "\xC9quipements IT" }),
12108
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "text-[var(--color-text-primary)]", children: "75,000 \u20AC" })
12109
+ ] }),
12110
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "w-full bg-[var(--color-border)] rounded-full h-2", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "bg-indigo-600 h-2 rounded-full", style: { width: "50%" } }) })
12111
+ ] }),
12112
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { children: [
12113
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "flex justify-between text-sm mb-1", children: [
12114
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "text-[var(--color-text-secondary)]", children: "Mobilier" }),
12115
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "text-[var(--color-text-primary)]", children: "25,000 \u20AC" })
12116
+ ] }),
12117
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "w-full bg-[var(--color-border)] rounded-full h-2", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "bg-pink-600 h-2 rounded-full", style: { width: "30%" } }) })
12118
+ ] }),
12119
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { children: [
12120
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "flex justify-between text-sm mb-1", children: [
12121
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "text-[var(--color-text-secondary)]", children: "V\xE9hicules" }),
12122
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "text-[var(--color-text-primary)]", children: "0 \u20AC" })
12123
+ ] }),
12124
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "w-full bg-[var(--color-border)] rounded-full h-2", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "bg-orange-600 h-2 rounded-full", style: { width: "0%" } }) })
12125
+ ] })
12126
+ ] })
12127
+ ] })
12128
+ ] })
12129
+ ] })
12130
+ ] });
12131
+ };
12132
+ var BudgetPage_default = BudgetPage;
12133
+
12134
+ // src/pages/workspaces/ChatEquipePage.tsx
12135
+ var import_react30 = require("react");
12136
+ var import_lucide_react29 = require("lucide-react");
12137
+ var import_jsx_runtime41 = require("react/jsx-runtime");
12138
+ var ChatEquipePage = () => {
12139
+ const [message, setMessage] = (0, import_react30.useState)("");
12140
+ return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "h-full flex flex-col", children: [
12141
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "bg-[var(--color-surface)] border-b border-[var(--color-border)] px-6 py-4", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "flex items-center gap-3", children: [
12142
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "p-2 bg-indigo-100 rounded-lg", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react29.MessageCircle, { className: "w-6 h-6 text-indigo-600" }) }),
12143
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { children: [
12144
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("h1", { className: "text-xl font-semibold text-[var(--color-text-primary)]", children: "Chat \xC9quipe" }),
12145
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("p", { className: "text-sm text-[var(--color-text-secondary)]", children: "Communication interne et messagerie" })
12146
+ ] })
12147
+ ] }) }),
12148
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "flex-1 flex overflow-hidden bg-[var(--color-background)]", children: [
12149
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "w-80 border-r border-[var(--color-border)] bg-[var(--color-surface)] flex flex-col", children: [
12150
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "p-4 border-b border-[var(--color-border-light)]", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "relative", children: [
12151
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react29.Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-[var(--color-text-tertiary)]" }),
12152
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
12153
+ "input",
12154
+ {
12155
+ type: "text",
12156
+ placeholder: "Rechercher...",
12157
+ className: "w-full pl-9 pr-4 py-2 text-sm border border-[var(--color-border)] rounded-lg\r\n focus:outline-none focus:ring-2 focus:ring-[var(--color-primary)]/20 focus:border-[var(--color-primary)]\r\n bg-[var(--color-background)] text-[var(--color-text-primary)]"
12158
+ }
12159
+ )
12160
+ ] }) }),
12161
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "flex-1 overflow-y-auto", children: [
12162
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "p-2", children: [
12163
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "flex items-center justify-between px-3 py-2", children: [
12164
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "text-xs font-semibold text-[var(--color-text-tertiary)] uppercase", children: "Canaux" }),
12165
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("button", { className: "p-1 hover:bg-[var(--color-surface-hover)] rounded", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react29.Plus, { className: "w-4 h-4 text-[var(--color-text-tertiary)]" }) })
12166
+ ] }),
12167
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("button", { className: "w-full flex items-center gap-3 px-3 py-2 rounded-lg bg-[var(--color-primary-light)] text-[var(--color-primary)]", children: [
12168
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "text-lg", children: "#" }),
12169
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "text-sm font-medium", children: "g\xE9n\xE9ral" }),
12170
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "ml-auto text-xs bg-[var(--color-primary)] text-white px-2 py-0.5 rounded-full", children: "3" })
12171
+ ] }),
12172
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("button", { className: "w-full flex items-center gap-3 px-3 py-2 rounded-lg hover:bg-[var(--color-surface-hover)] text-[var(--color-text-primary)]", children: [
12173
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "text-lg", children: "#" }),
12174
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "text-sm", children: "projets" })
12175
+ ] }),
12176
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("button", { className: "w-full flex items-center gap-3 px-3 py-2 rounded-lg hover:bg-[var(--color-surface-hover)] text-[var(--color-text-primary)]", children: [
12177
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "text-lg", children: "#" }),
12178
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "text-sm", children: "annonces" })
12179
+ ] })
12180
+ ] }),
12181
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "p-2 mt-2", children: [
12182
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "flex items-center justify-between px-3 py-2", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "text-xs font-semibold text-[var(--color-text-tertiary)] uppercase", children: "Messages Directs" }) }),
12183
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("button", { className: "w-full flex items-center gap-3 px-3 py-2 rounded-lg hover:bg-[var(--color-surface-hover)]", children: [
12184
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "w-8 h-8 bg-blue-100 rounded-full flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "text-xs font-medium text-blue-600", children: "JD" }) }),
12185
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "flex-1 text-left", children: [
12186
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "text-sm text-[var(--color-text-primary)]", children: "Jean Dupont" }),
12187
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("p", { className: "text-xs text-[var(--color-text-tertiary)] truncate", children: "D'accord, merci!" })
12188
+ ] })
12189
+ ] }),
12190
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("button", { className: "w-full flex items-center gap-3 px-3 py-2 rounded-lg hover:bg-[var(--color-surface-hover)]", children: [
12191
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "w-8 h-8 bg-green-100 rounded-full flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "text-xs font-medium text-green-600", children: "ML" }) }),
12192
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "flex-1 text-left", children: [
12193
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "text-sm text-[var(--color-text-primary)]", children: "Marie Lambert" }),
12194
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("p", { className: "text-xs text-[var(--color-text-tertiary)] truncate", children: "Le rapport est pr\xEAt" })
12195
+ ] })
12196
+ ] })
12197
+ ] })
12198
+ ] })
12199
+ ] }),
12200
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "flex-1 flex flex-col", children: [
12201
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "bg-[var(--color-surface)] border-b border-[var(--color-border-light)] px-6 py-3 flex items-center justify-between", children: [
12202
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "flex items-center gap-3", children: [
12203
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "text-lg font-medium text-[var(--color-text-primary)]", children: "# g\xE9n\xE9ral" }),
12204
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "text-sm text-[var(--color-text-tertiary)]", children: "|" }),
12205
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "text-sm text-[var(--color-text-secondary)]", children: "Canal de discussion g\xE9n\xE9rale" })
12206
+ ] }),
12207
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "flex items-center gap-2", children: [
12208
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("button", { className: "p-2 hover:bg-[var(--color-surface-hover)] rounded-lg", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react29.Users, { className: "w-5 h-5 text-[var(--color-text-tertiary)]" }) }),
12209
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("button", { className: "p-2 hover:bg-[var(--color-surface-hover)] rounded-lg", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react29.Phone, { className: "w-5 h-5 text-[var(--color-text-tertiary)]" }) }),
12210
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("button", { className: "p-2 hover:bg-[var(--color-surface-hover)] rounded-lg", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react29.Video, { className: "w-5 h-5 text-[var(--color-text-tertiary)]" }) }),
12211
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("button", { className: "p-2 hover:bg-[var(--color-surface-hover)] rounded-lg", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react29.MoreVertical, { className: "w-5 h-5 text-[var(--color-text-tertiary)]" }) })
12212
+ ] })
12213
+ ] }),
12214
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "flex-1 overflow-y-auto p-6 space-y-4", children: [
12215
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "flex gap-3", children: [
12216
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "w-10 h-10 bg-blue-100 rounded-full flex items-center justify-center flex-shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "text-sm font-medium text-blue-600", children: "JD" }) }),
12217
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { children: [
12218
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "flex items-center gap-2", children: [
12219
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "font-medium text-[var(--color-text-primary)]", children: "Jean Dupont" }),
12220
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "text-xs text-[var(--color-text-tertiary)]", children: "10:30" })
12221
+ ] }),
12222
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("p", { className: "text-sm text-[var(--color-text-primary)] mt-1", children: "Bonjour \xE0 tous ! La r\xE9union de ce matin est report\xE9e \xE0 14h." })
12223
+ ] })
12224
+ ] }),
12225
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "flex gap-3", children: [
12226
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "w-10 h-10 bg-green-100 rounded-full flex items-center justify-center flex-shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "text-sm font-medium text-green-600", children: "ML" }) }),
12227
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { children: [
12228
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "flex items-center gap-2", children: [
12229
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "font-medium text-[var(--color-text-primary)]", children: "Marie Lambert" }),
12230
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "text-xs text-[var(--color-text-tertiary)]", children: "10:32" })
12231
+ ] }),
12232
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("p", { className: "text-sm text-[var(--color-text-primary)] mt-1", children: "Bien not\xE9, merci pour l'info !" })
12233
+ ] })
12234
+ ] })
12235
+ ] }),
12236
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "bg-[var(--color-surface)] border-t border-[var(--color-border-light)] p-4", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "flex items-center gap-3", children: [
12237
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
12238
+ "input",
12239
+ {
12240
+ type: "text",
12241
+ placeholder: "\xC9crire un message...",
12242
+ value: message,
12243
+ onChange: (e) => setMessage(e.target.value),
12244
+ className: "flex-1 px-4 py-2 border border-[var(--color-border)] rounded-lg\r\n focus:outline-none focus:ring-2 focus:ring-[var(--color-primary)]/20 focus:border-[var(--color-primary)]\r\n bg-[var(--color-background)] text-[var(--color-text-primary)]"
12245
+ }
12246
+ ),
12247
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("button", { className: "p-2 bg-[var(--color-primary)] text-white rounded-lg hover:bg-[var(--color-primary-dark)] transition-colors", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react29.Send, { className: "w-5 h-5" }) })
12248
+ ] }) })
12249
+ ] })
12250
+ ] })
12251
+ ] });
12252
+ };
12253
+ var ChatEquipePage_default = ChatEquipePage;
12254
+
12255
+ // src/pages/workspaces/ActifsPage.tsx
12256
+ var import_lucide_react30 = require("lucide-react");
12257
+ var import_jsx_runtime42 = require("react/jsx-runtime");
12258
+ var ActifsPage = () => {
12259
+ return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "h-full flex flex-col", children: [
12260
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "bg-[var(--color-surface)] border-b border-[var(--color-border)] px-6 py-4", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "flex items-center justify-between", children: [
12261
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "flex items-center gap-3", children: [
12262
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "p-2 bg-orange-100 rounded-lg", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_lucide_react30.Building2, { className: "w-6 h-6 text-orange-600" }) }),
12263
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { children: [
12264
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("h1", { className: "text-xl font-semibold text-[var(--color-text-primary)]", children: "Actifs" }),
12265
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { className: "text-sm text-[var(--color-text-secondary)]", children: "Gestion des immobilisations et \xE9quipements" })
12266
+ ] })
12267
+ ] }),
12268
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "flex items-center gap-3", children: [
12269
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(SecondaryButton, { variant: "outline", children: [
12270
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_lucide_react30.Filter, { className: "w-4 h-4 mr-2" }),
12271
+ "Filtrer"
12272
+ ] }),
12273
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(Buttons_default, { children: [
12274
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_lucide_react30.Plus, { className: "w-4 h-4 mr-2" }),
12275
+ "Nouvel actif"
12276
+ ] })
12277
+ ] })
12278
+ ] }) }),
12279
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "flex-1 p-6 bg-[var(--color-background)]", children: [
12280
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "mb-6", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "relative max-w-md", children: [
12281
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_lucide_react30.Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-[var(--color-text-tertiary)]" }),
12282
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
12283
+ "input",
12284
+ {
12285
+ type: "text",
12286
+ placeholder: "Rechercher un actif...",
12287
+ className: "w-full pl-9 pr-4 py-2 text-sm border border-[var(--color-border)] rounded-lg\r\n focus:outline-none focus:ring-2 focus:ring-[var(--color-primary)]/20 focus:border-[var(--color-primary)]\r\n bg-[var(--color-surface)] text-[var(--color-text-primary)]"
12288
+ }
12289
+ )
12290
+ ] }) }),
12291
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "grid grid-cols-1 md:grid-cols-4 gap-4 mb-6", children: [
12292
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "bg-[var(--color-surface)] rounded-xl p-4 border border-[var(--color-border-light)]", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "flex items-center gap-3", children: [
12293
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "p-2 bg-blue-100 rounded-lg", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_lucide_react30.Laptop, { className: "w-5 h-5 text-blue-600" }) }),
12294
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { children: [
12295
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { className: "text-2xl font-bold text-[var(--color-text-primary)]", children: "156" }),
12296
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { className: "text-xs text-[var(--color-text-secondary)]", children: "\xC9quipements IT" })
12297
+ ] })
12298
+ ] }) }),
12299
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "bg-[var(--color-surface)] rounded-xl p-4 border border-[var(--color-border-light)]", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "flex items-center gap-3", children: [
12300
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "p-2 bg-green-100 rounded-lg", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_lucide_react30.Truck, { className: "w-5 h-5 text-green-600" }) }),
12301
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { children: [
12302
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { className: "text-2xl font-bold text-[var(--color-text-primary)]", children: "24" }),
12303
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { className: "text-xs text-[var(--color-text-secondary)]", children: "V\xE9hicules" })
12304
+ ] })
12305
+ ] }) }),
12306
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "bg-[var(--color-surface)] rounded-xl p-4 border border-[var(--color-border-light)]", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "flex items-center gap-3", children: [
12307
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "p-2 bg-purple-100 rounded-lg", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_lucide_react30.Package, { className: "w-5 h-5 text-purple-600" }) }),
12308
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { children: [
12309
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { className: "text-2xl font-bold text-[var(--color-text-primary)]", children: "89" }),
12310
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { className: "text-xs text-[var(--color-text-secondary)]", children: "Mobilier" })
12311
+ ] })
12312
+ ] }) }),
12313
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "bg-[var(--color-surface)] rounded-xl p-4 border border-[var(--color-border-light)]", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "flex items-center gap-3", children: [
12314
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "p-2 bg-orange-100 rounded-lg", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_lucide_react30.Wrench, { className: "w-5 h-5 text-orange-600" }) }),
12315
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { children: [
12316
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { className: "text-2xl font-bold text-[var(--color-text-primary)]", children: "12" }),
12317
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { className: "text-xs text-[var(--color-text-secondary)]", children: "En maintenance" })
12318
+ ] })
12319
+ ] }) })
12320
+ ] }),
12321
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "bg-[var(--color-surface)] rounded-xl border border-[var(--color-border-light)] overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "overflow-x-auto", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("table", { className: "w-full", children: [
12322
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("thead", { className: "bg-[var(--color-background)]", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("tr", { children: [
12323
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("th", { className: "px-6 py-3 text-left text-xs font-semibold text-[var(--color-text-secondary)] uppercase", children: "Code" }),
12324
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("th", { className: "px-6 py-3 text-left text-xs font-semibold text-[var(--color-text-secondary)] uppercase", children: "D\xE9signation" }),
12325
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("th", { className: "px-6 py-3 text-left text-xs font-semibold text-[var(--color-text-secondary)] uppercase", children: "Cat\xE9gorie" }),
12326
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("th", { className: "px-6 py-3 text-left text-xs font-semibold text-[var(--color-text-secondary)] uppercase", children: "Localisation" }),
12327
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("th", { className: "px-6 py-3 text-left text-xs font-semibold text-[var(--color-text-secondary)] uppercase", children: "\xC9tat" }),
12328
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("th", { className: "px-6 py-3 text-left text-xs font-semibold text-[var(--color-text-secondary)] uppercase", children: "Valeur" })
12329
+ ] }) }),
12330
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("tbody", { className: "divide-y divide-[var(--color-border-light)]", children: [
12331
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("tr", { className: "hover:bg-[var(--color-surface-hover)]", children: [
12332
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("td", { className: "px-6 py-4 text-sm font-medium text-[var(--color-primary)]", children: "ACT-001" }),
12333
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("td", { className: "px-6 py-4 text-sm text-[var(--color-text-primary)]", children: 'MacBook Pro 16"' }),
12334
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("td", { className: "px-6 py-4", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("span", { className: "inline-flex items-center gap-1 px-2 py-1 text-xs bg-blue-100 text-blue-700 rounded", children: [
12335
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_lucide_react30.Laptop, { className: "w-3 h-3" }),
12336
+ "IT"
12337
+ ] }) }),
12338
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("td", { className: "px-6 py-4 text-sm text-[var(--color-text-secondary)]", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("span", { className: "flex items-center gap-1", children: [
12339
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_lucide_react30.MapPin, { className: "w-3 h-3" }),
12340
+ "Bureau A-201"
12341
+ ] }) }),
12342
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("td", { className: "px-6 py-4", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { className: "px-2 py-1 text-xs bg-green-100 text-green-700 rounded", children: "Actif" }) }),
12343
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("td", { className: "px-6 py-4 text-sm text-[var(--color-text-primary)]", children: "2,499 \u20AC" })
12344
+ ] }),
12345
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("tr", { className: "hover:bg-[var(--color-surface-hover)]", children: [
12346
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("td", { className: "px-6 py-4 text-sm font-medium text-[var(--color-primary)]", children: "ACT-002" }),
12347
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("td", { className: "px-6 py-4 text-sm text-[var(--color-text-primary)]", children: "Bureau ergonomique" }),
12348
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("td", { className: "px-6 py-4", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("span", { className: "inline-flex items-center gap-1 px-2 py-1 text-xs bg-purple-100 text-purple-700 rounded", children: [
12349
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_lucide_react30.Package, { className: "w-3 h-3" }),
12350
+ "Mobilier"
12351
+ ] }) }),
12352
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("td", { className: "px-6 py-4 text-sm text-[var(--color-text-secondary)]", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("span", { className: "flex items-center gap-1", children: [
12353
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_lucide_react30.MapPin, { className: "w-3 h-3" }),
12354
+ "Bureau A-201"
12355
+ ] }) }),
12356
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("td", { className: "px-6 py-4", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { className: "px-2 py-1 text-xs bg-green-100 text-green-700 rounded", children: "Actif" }) }),
12357
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("td", { className: "px-6 py-4 text-sm text-[var(--color-text-primary)]", children: "890 \u20AC" })
12358
+ ] }),
12359
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("tr", { className: "hover:bg-[var(--color-surface-hover)]", children: [
12360
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("td", { className: "px-6 py-4 text-sm font-medium text-[var(--color-primary)]", children: "ACT-003" }),
12361
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("td", { className: "px-6 py-4 text-sm text-[var(--color-text-primary)]", children: "Renault Kangoo" }),
12362
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("td", { className: "px-6 py-4", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("span", { className: "inline-flex items-center gap-1 px-2 py-1 text-xs bg-green-100 text-green-700 rounded", children: [
12363
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_lucide_react30.Truck, { className: "w-3 h-3" }),
12364
+ "V\xE9hicule"
12365
+ ] }) }),
12366
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("td", { className: "px-6 py-4 text-sm text-[var(--color-text-secondary)]", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("span", { className: "flex items-center gap-1", children: [
12367
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_lucide_react30.MapPin, { className: "w-3 h-3" }),
12368
+ "Parking B"
12369
+ ] }) }),
12370
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("td", { className: "px-6 py-4", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { className: "px-2 py-1 text-xs bg-orange-100 text-orange-700 rounded", children: "Maintenance" }) }),
12371
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("td", { className: "px-6 py-4 text-sm text-[var(--color-text-primary)]", children: "18,500 \u20AC" })
12372
+ ] })
12373
+ ] })
12374
+ ] }) }) })
12375
+ ] })
12376
+ ] });
12377
+ };
12378
+ var ActifsPage_default = ActifsPage;
12379
+
12380
+ // src/pages/workspaces/PlanningPage.tsx
12381
+ var import_react31 = require("react");
12382
+ var import_lucide_react31 = require("lucide-react");
12383
+ var import_jsx_runtime43 = require("react/jsx-runtime");
12384
+ var DAYS = ["Lun", "Mar", "Mer", "Jeu", "Ven", "Sam", "Dim"];
12385
+ var MONTHS = ["Janvier", "F\xE9vrier", "Mars", "Avril", "Mai", "Juin", "Juillet", "Ao\xFBt", "Septembre", "Octobre", "Novembre", "D\xE9cembre"];
12386
+ var PlanningPage = () => {
12387
+ const [currentDate] = (0, import_react31.useState)(/* @__PURE__ */ new Date());
12388
+ const currentMonth = MONTHS[currentDate.getMonth()];
12389
+ const currentYear = currentDate.getFullYear();
12390
+ return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "h-full flex flex-col", children: [
12391
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: "bg-[var(--color-surface)] border-b border-[var(--color-border)] px-6 py-4", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "flex items-center justify-between", children: [
12392
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "flex items-center gap-3", children: [
12393
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: "p-2 bg-teal-100 rounded-lg", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_lucide_react31.CalendarClock, { className: "w-6 h-6 text-teal-600" }) }),
12394
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { children: [
12395
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("h1", { className: "text-xl font-semibold text-[var(--color-text-primary)]", children: "Planning" }),
12396
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("p", { className: "text-sm text-[var(--color-text-secondary)]", children: "Planification des ressources et emploi du temps" })
12397
+ ] })
12398
+ ] }),
12399
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(Buttons_default, { children: [
12400
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_lucide_react31.Plus, { className: "w-4 h-4 mr-2" }),
12401
+ "Nouveau planning"
12402
+ ] })
12403
+ ] }) }),
12404
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: "flex-1 p-6 bg-[var(--color-background)]", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "grid grid-cols-1 lg:grid-cols-4 gap-6", children: [
12405
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "lg:col-span-3 bg-[var(--color-surface)] rounded-xl border border-[var(--color-border-light)]", children: [
12406
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "flex items-center justify-between p-4 border-b border-[var(--color-border-light)]", children: [
12407
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "flex items-center gap-4", children: [
12408
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("button", { className: "p-2 hover:bg-[var(--color-surface-hover)] rounded-lg", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_lucide_react31.ChevronLeft, { className: "w-5 h-5 text-[var(--color-text-secondary)]" }) }),
12409
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("h2", { className: "text-lg font-semibold text-[var(--color-text-primary)]", children: [
12410
+ currentMonth,
12411
+ " ",
12412
+ currentYear
12413
+ ] }),
12414
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("button", { className: "p-2 hover:bg-[var(--color-surface-hover)] rounded-lg", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_lucide_react31.ChevronRight, { className: "w-5 h-5 text-[var(--color-text-secondary)]" }) })
12415
+ ] }),
12416
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "flex items-center gap-2", children: [
12417
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("button", { className: "px-3 py-1.5 text-sm bg-[var(--color-primary)] text-white rounded-lg", children: "Aujourd'hui" }),
12418
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("button", { className: "px-3 py-1.5 text-sm border border-[var(--color-border)] rounded-lg hover:bg-[var(--color-surface-hover)]", children: "Semaine" }),
12419
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("button", { className: "px-3 py-1.5 text-sm border border-[var(--color-border)] rounded-lg hover:bg-[var(--color-surface-hover)]", children: "Mois" })
12420
+ ] })
12421
+ ] }),
12422
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "p-4", children: [
12423
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: "grid grid-cols-7 gap-2 mb-2", children: DAYS.map((day) => /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: "text-center text-xs font-semibold text-[var(--color-text-tertiary)] py-2", children: day }, day)) }),
12424
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: "grid grid-cols-7 gap-2", children: Array.from({ length: 35 }, (_, i) => {
12425
+ const dayNum = i - 3;
12426
+ const isCurrentMonth = dayNum >= 0 && dayNum < 31;
12427
+ const isToday = dayNum + 1 === currentDate.getDate();
12428
+ return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
12429
+ "div",
12430
+ {
12431
+ className: `
12432
+ min-h-[80px] p-2 rounded-lg border transition-colors cursor-pointer
12433
+ ${isCurrentMonth ? "border-[var(--color-border-light)] hover:border-[var(--color-primary)]" : "border-transparent"}
12434
+ ${isToday ? "bg-[var(--color-primary-light)] border-[var(--color-primary)]" : ""}
12435
+ `,
12436
+ children: isCurrentMonth && /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_jsx_runtime43.Fragment, { children: [
12437
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { className: `text-sm ${isToday ? "font-bold text-[var(--color-primary)]" : "text-[var(--color-text-primary)]"}`, children: dayNum + 1 }),
12438
+ dayNum === 4 && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: "mt-1 px-1.5 py-0.5 bg-blue-100 text-blue-700 text-xs rounded truncate", children: "R\xE9union \xE9quipe" }),
12439
+ dayNum === 10 && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: "mt-1 px-1.5 py-0.5 bg-green-100 text-green-700 text-xs rounded truncate", children: "Formation" }),
12440
+ dayNum === 15 && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: "mt-1 px-1.5 py-0.5 bg-purple-100 text-purple-700 text-xs rounded truncate", children: "Deadline projet" })
12441
+ ] })
12442
+ },
12443
+ i
12444
+ );
12445
+ }) })
12446
+ ] })
12447
+ ] }),
12448
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "space-y-6", children: [
12449
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "bg-[var(--color-surface)] rounded-xl border border-[var(--color-border-light)]", children: [
12450
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: "p-4 border-b border-[var(--color-border-light)]", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("h3", { className: "font-semibold text-[var(--color-text-primary)]", children: "\xC9v\xE9nements \xE0 venir" }) }),
12451
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "p-4 space-y-3", children: [
12452
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "flex items-start gap-3 p-3 bg-blue-50 rounded-lg", children: [
12453
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: "p-1.5 bg-blue-100 rounded", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_lucide_react31.Clock, { className: "w-4 h-4 text-blue-600" }) }),
12454
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { children: [
12455
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("p", { className: "text-sm font-medium text-[var(--color-text-primary)]", children: "R\xE9union \xE9quipe" }),
12456
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("p", { className: "text-xs text-[var(--color-text-secondary)]", children: "Demain, 09:00" })
12457
+ ] })
12458
+ ] }),
12459
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "flex items-start gap-3 p-3 bg-green-50 rounded-lg", children: [
12460
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: "p-1.5 bg-green-100 rounded", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_lucide_react31.Users, { className: "w-4 h-4 text-green-600" }) }),
12461
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { children: [
12462
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("p", { className: "text-sm font-medium text-[var(--color-text-primary)]", children: "Formation" }),
12463
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("p", { className: "text-xs text-[var(--color-text-secondary)]", children: "15 D\xE9c, 14:00" })
12464
+ ] })
12465
+ ] }),
12466
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "flex items-start gap-3 p-3 bg-purple-50 rounded-lg", children: [
12467
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: "p-1.5 bg-purple-100 rounded", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_lucide_react31.CalendarClock, { className: "w-4 h-4 text-purple-600" }) }),
12468
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { children: [
12469
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("p", { className: "text-sm font-medium text-[var(--color-text-primary)]", children: "Deadline projet" }),
12470
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("p", { className: "text-xs text-[var(--color-text-secondary)]", children: "20 D\xE9c, 18:00" })
12471
+ ] })
12472
+ ] })
12473
+ ] })
12474
+ ] }),
12475
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "bg-[var(--color-surface)] rounded-xl p-4 border border-[var(--color-border-light)]", children: [
12476
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("h3", { className: "font-semibold text-[var(--color-text-primary)] mb-4", children: "Cette semaine" }),
12477
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "space-y-3", children: [
12478
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "flex justify-between items-center", children: [
12479
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { className: "text-sm text-[var(--color-text-secondary)]", children: "R\xE9unions" }),
12480
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { className: "font-semibold text-[var(--color-text-primary)]", children: "8" })
12481
+ ] }),
12482
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "flex justify-between items-center", children: [
12483
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { className: "text-sm text-[var(--color-text-secondary)]", children: "T\xE2ches planifi\xE9es" }),
12484
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { className: "font-semibold text-[var(--color-text-primary)]", children: "15" })
12485
+ ] }),
12486
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "flex justify-between items-center", children: [
12487
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { className: "text-sm text-[var(--color-text-secondary)]", children: "Heures occup\xE9es" }),
12488
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { className: "font-semibold text-[var(--color-text-primary)]", children: "32h" })
12489
+ ] })
12490
+ ] })
12491
+ ] })
12492
+ ] })
12493
+ ] }) })
12494
+ ] });
12495
+ };
12496
+ var PlanningPage_default = PlanningPage;
12497
+
12498
+ // src/pages/workspaces/TaskPilot.tsx
12499
+ var import_react33 = require("react");
12500
+ var import_lucide_react33 = require("lucide-react");
12501
+
12502
+ // src/models/Task.ts
12503
+ var TASK_STATUS_OPTIONS = [
12504
+ { value: "new", label: "\xC0 faire" },
12505
+ { value: "in_progress", label: "En cours" },
12506
+ { value: "in_review", label: "En r\xE9vision" },
12507
+ { value: "done", label: "Termin\xE9" }
12508
+ ];
12509
+ var TASK_PRIORITY_OPTIONS = [
12510
+ { value: "high", label: "Haute", color: "bg-red-100 text-red-700" },
12511
+ { value: "medium", label: "Moyenne", color: "bg-yellow-100 text-yellow-700" },
12512
+ { value: "minimum", label: "Basse", color: "bg-green-100 text-green-700" }
12513
+ ];
12514
+
12515
+ // src/services/TaskServices.ts
12516
+ var URI5 = `${API_URL}/workspace/tasks/`;
12517
+ var TaskServices = {
12518
+ create: (data) => FetchApi.post(`${URI5}`, data),
12519
+ get: (id) => FetchApi.get(`${URI5}${id}/`),
12520
+ list: (params) => FetchApi.get(`${URI5}?${new URLSearchParams(params).toString()}`),
12521
+ update: (id, data) => FetchApi.put(`${URI5}${id}/`, data),
12522
+ patch: (id, data) => FetchApi.patch(`${URI5}${id}/`, data),
12523
+ delete: (id) => FetchApi.delete(`${URI5}${id}/`),
12524
+ updateStatus: (id, status) => FetchApi.patch(`${URI5}${id}/`, { status })
12525
+ };
12526
+
12527
+ // src/pages/workspaces/FormTask.tsx
12528
+ var import_react32 = require("react");
12529
+ var import_lucide_react32 = require("lucide-react");
12530
+ var import_jsx_runtime44 = require("react/jsx-runtime");
12531
+ var FormTask = ({ open, onClose, task, defaultStatus = "new", onSuccess }) => {
12532
+ const { addToast } = useToast();
12533
+ const [loading, setLoading] = (0, import_react32.useState)(false);
12534
+ const [formData, setFormData] = (0, import_react32.useState)({
12535
+ title: "",
12536
+ description: "",
12537
+ status: defaultStatus,
12538
+ priority: "medium",
12539
+ start_date: "",
12540
+ end_date: ""
12541
+ });
12542
+ (0, import_react32.useEffect)(() => {
12543
+ if (task) {
12544
+ setFormData({
12545
+ title: task.title || "",
12546
+ description: task.description || "",
12547
+ status: task.status || defaultStatus,
12548
+ priority: task.priority || "medium",
12549
+ start_date: task.start_date ? task.start_date.split("T")[0] : "",
12550
+ end_date: task.end_date ? task.end_date.split("T")[0] : ""
12551
+ });
12552
+ } else {
12553
+ setFormData({
12554
+ title: "",
12555
+ description: "",
12556
+ status: defaultStatus,
12557
+ priority: "medium",
12558
+ start_date: "",
12559
+ end_date: ""
12560
+ });
12561
+ }
12562
+ }, [task, defaultStatus, open]);
12563
+ const handleInputChange = (e) => {
12564
+ const { name, value } = e.target;
12565
+ setFormData((prev) => ({ ...prev, [name]: value }));
12566
+ };
12567
+ const handleSelectChange = (e) => {
12568
+ const { name, value } = e.target;
12569
+ setFormData((prev) => ({ ...prev, [name]: value }));
12570
+ };
12571
+ const handleTextAreaChange = (e) => {
12572
+ const { name, value } = e.target;
12573
+ setFormData((prev) => ({ ...prev, [name]: value }));
12574
+ };
12575
+ const handleSubmit = async (e) => {
12576
+ e.preventDefault();
12577
+ if (!formData.title.trim()) {
12578
+ addToast({ type: "error", message: "Le titre est obligatoire" });
12579
+ return;
12580
+ }
12581
+ setLoading(true);
12582
+ try {
12583
+ const payload = {
12584
+ ...formData,
12585
+ start_date: formData.start_date || null,
12586
+ end_date: formData.end_date || null
12587
+ };
12588
+ if (task?.id) {
12589
+ await TaskServices.update(task.id, payload);
12590
+ addToast({ type: "success", message: "T\xE2che mise \xE0 jour avec succ\xE8s" });
12591
+ } else {
12592
+ await TaskServices.create(payload);
12593
+ addToast({ type: "success", message: "T\xE2che cr\xE9\xE9e avec succ\xE8s" });
12594
+ }
12595
+ onSuccess?.();
12596
+ onClose();
12597
+ } catch (error) {
12598
+ console.error("Error saving task:", error);
12599
+ addToast({ type: "error", message: "Erreur lors de la sauvegarde" });
12600
+ } finally {
12601
+ setLoading(false);
12602
+ }
12603
+ };
12604
+ return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
12605
+ Modals_default,
12606
+ {
12607
+ open,
12608
+ onClose,
12609
+ title: task ? "Modifier la t\xE2che" : "Nouvelle t\xE2che",
12610
+ description: task ? "Modifiez les d\xE9tails de la t\xE2che" : "Cr\xE9ez une nouvelle t\xE2che",
12611
+ width: "max-w-lg",
12612
+ children: /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("form", { onSubmit: handleSubmit, className: "space-y-5", children: [
12613
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
12614
+ TextInput,
12615
+ {
12616
+ label: "Titre",
12617
+ name: "title",
12618
+ value: formData.title,
12619
+ onChange: handleInputChange,
12620
+ placeholder: "Entrez le titre de la t\xE2che",
12621
+ required: true
12622
+ }
12623
+ ),
12624
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "flex flex-col gap-1 w-full", children: [
12625
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("label", { className: "block text-[var(--color-text-secondary)] text-sm font-medium mb-2", children: "Description" }),
12626
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
12627
+ "textarea",
12628
+ {
12629
+ name: "description",
12630
+ value: formData.description,
12631
+ onChange: handleTextAreaChange,
12632
+ placeholder: "D\xE9crivez la t\xE2che...",
12633
+ rows: 3,
12634
+ className: "w-full px-3 py-2 border border-[var(--color-border)] rounded-lg\r\n focus:ring-2 focus:ring-[var(--color-primary)]/20 focus:border-[var(--color-primary)]\r\n text-sm resize-none bg-[var(--color-surface)] text-[var(--color-text-primary)]"
12635
+ }
12636
+ )
12637
+ ] }),
12638
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "grid grid-cols-2 gap-4", children: [
12639
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
12640
+ SelectInput,
12641
+ {
12642
+ label: "Statut",
12643
+ name: "status",
12644
+ value: formData.status,
12645
+ onChange: handleSelectChange,
12646
+ options: TASK_STATUS_OPTIONS.map((opt) => ({ label: opt.label, value: opt.value }))
12647
+ }
12648
+ ),
12649
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
12650
+ SelectInput,
12651
+ {
12652
+ label: "Priorit\xE9",
12653
+ name: "priority",
12654
+ value: formData.priority,
12655
+ onChange: handleSelectChange,
12656
+ options: TASK_PRIORITY_OPTIONS.map((opt) => ({ label: opt.label, value: opt.value }))
12657
+ }
12658
+ )
12659
+ ] }),
12660
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "grid grid-cols-2 gap-4", children: [
12661
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
12662
+ DateInput,
12663
+ {
12664
+ label: "Date de d\xE9but",
12665
+ name: "start_date",
12666
+ value: formData.start_date,
12667
+ onChange: handleInputChange
12668
+ }
12669
+ ),
12670
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
12671
+ DateInput,
12672
+ {
12673
+ label: "Date de fin",
12674
+ name: "end_date",
12675
+ value: formData.end_date,
12676
+ onChange: handleInputChange
12677
+ }
12678
+ )
12679
+ ] }),
12680
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "flex justify-end gap-3 pt-4 border-t border-[var(--color-border)]", children: [
12681
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
12682
+ SecondaryButton,
12683
+ {
12684
+ type: "button",
12685
+ onClick: onClose,
12686
+ disabled: loading,
12687
+ variant: "outline",
12688
+ children: "Annuler"
12689
+ }
12690
+ ),
12691
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
12692
+ Buttons_default,
12693
+ {
12694
+ type: "submit",
12695
+ disabled: loading,
12696
+ children: [
12697
+ loading && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_lucide_react32.Loader2, { className: "w-4 h-4 animate-spin mr-2" }),
12698
+ task ? "Mettre \xE0 jour" : "Cr\xE9er"
12699
+ ]
12700
+ }
12701
+ )
12702
+ ] })
12703
+ ] })
12704
+ }
12705
+ );
12706
+ };
12707
+ var FormTask_default = FormTask;
12708
+
12709
+ // src/pages/workspaces/TaskPilot.tsx
12710
+ var import_jsx_runtime45 = require("react/jsx-runtime");
12711
+ var COLUMNS = [
12712
+ { id: "new", title: "\xC0 faire", color: "bg-[var(--color-surface)]" },
12713
+ { id: "in_progress", title: "En cours", color: "bg-[var(--color-info-light)]" },
12714
+ { id: "in_review", title: "En r\xE9vision", color: "bg-[var(--color-warning-light)]" },
12715
+ { id: "done", title: "Termin\xE9", color: "bg-[var(--color-success-light)]" }
12716
+ ];
12717
+ var PriorityBadge = ({ priority }) => {
12718
+ const option = TASK_PRIORITY_OPTIONS.find((p) => p.value === priority);
12719
+ if (!option) return null;
12720
+ return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: `px-2 py-0.5 text-xs font-medium rounded ${option.color}`, children: option.label });
12721
+ };
12722
+ var TaskCard = ({ task, isDragging, onDragStart, onDragEnd, onEdit, onDelete }) => {
12723
+ const [showMenu, setShowMenu] = (0, import_react33.useState)(false);
12724
+ return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
12725
+ "div",
12726
+ {
12727
+ draggable: true,
12728
+ onDragStart: (e) => onDragStart(e, task),
12729
+ onDragEnd,
12730
+ className: `
12731
+ bg-[var(--color-surface)] rounded-lg p-4 shadow-sm border border-[var(--color-border-light)]
12732
+ hover:shadow-md transition-all cursor-grab active:cursor-grabbing
12733
+ ${isDragging ? "opacity-50 scale-105 shadow-lg ring-2 ring-[var(--color-primary)]" : ""}
12734
+ `,
12735
+ children: [
12736
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "flex items-start justify-between mb-3", children: [
12737
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: "flex flex-wrap gap-1.5", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(PriorityBadge, { priority: task.priority }) }),
12738
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "flex items-center gap-1 relative", children: [
12739
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_lucide_react33.GripVertical, { className: "w-4 h-4 text-[var(--color-text-tertiary)]" }),
12740
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
12741
+ "button",
12742
+ {
12743
+ onClick: (e) => {
12744
+ e.stopPropagation();
12745
+ setShowMenu(!showMenu);
12746
+ },
12747
+ className: "p-1 hover:bg-[var(--color-surface-hover)] rounded transition-colors",
12748
+ children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_lucide_react33.MoreVertical, { className: "w-4 h-4 text-[var(--color-text-tertiary)]" })
12749
+ }
12750
+ ),
12751
+ showMenu && /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "absolute right-0 top-8 bg-[var(--color-surface)] border border-[var(--color-border)] rounded-lg shadow-lg py-1 z-10 min-w-[120px]", children: [
12752
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
12753
+ "button",
12754
+ {
12755
+ onClick: (e) => {
12756
+ e.stopPropagation();
12757
+ onEdit(task);
12758
+ setShowMenu(false);
12759
+ },
12760
+ className: "w-full px-3 py-2 text-left text-sm text-[var(--color-text-primary)] hover:bg-[var(--color-surface-hover)] flex items-center gap-2",
12761
+ children: [
12762
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_lucide_react33.Edit3, { className: "w-4 h-4" }),
12763
+ "Modifier"
12764
+ ]
12765
+ }
12766
+ ),
12767
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
12768
+ "button",
12769
+ {
12770
+ onClick: (e) => {
12771
+ e.stopPropagation();
12772
+ onDelete(task);
12773
+ setShowMenu(false);
12774
+ },
12775
+ className: "w-full px-3 py-2 text-left text-sm text-[var(--color-error)] hover:bg-[var(--color-error-light)] flex items-center gap-2",
12776
+ children: [
12777
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_lucide_react33.Trash2, { className: "w-4 h-4" }),
12778
+ "Supprimer"
12779
+ ]
12780
+ }
12781
+ )
12782
+ ] })
12783
+ ] })
12784
+ ] }),
12785
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("h3", { className: "font-medium text-[var(--color-text-primary)] text-sm mb-1", children: task.title }),
12786
+ task.description && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("p", { className: "text-xs text-[var(--color-text-secondary)] mb-4 line-clamp-2", children: task.description }),
12787
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "flex items-center justify-between pt-2 text-xs text-[var(--color-text-tertiary)]", children: [
12788
+ task.end_date && /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "flex items-center gap-1", children: [
12789
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_lucide_react33.Calendar, { className: "w-3.5 h-3.5" }),
12790
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { children: new Date(task.end_date).toLocaleDateString("fr-FR") })
12791
+ ] }),
12792
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "flex items-center gap-3", children: [
12793
+ task.comment && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: "flex items-center gap-1", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_lucide_react33.MessageSquare, { className: "w-3.5 h-3.5" }) }),
12794
+ task.file && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: "flex items-center gap-1", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_lucide_react33.Paperclip, { className: "w-3.5 h-3.5" }) })
12795
+ ] })
12796
+ ] })
12797
+ ]
12798
+ }
12799
+ );
12800
+ };
12801
+ var KanbanColumn = ({ column, tasks, onAddTask, draggedTask, onDragStart, onDragEnd, onDragOver, onDrop, isDropTarget, onEditTask, onDeleteTask }) => {
12802
+ return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
12803
+ "div",
12804
+ {
12805
+ onDragOver,
12806
+ onDrop: (e) => onDrop(e, column.id),
12807
+ className: `
12808
+ flex flex-col rounded-xl min-w-[300px] max-w-[300px] transition-all duration-200
12809
+ ${column.color}
12810
+ ${isDropTarget ? "ring-2 ring-[var(--color-primary)] ring-dashed bg-[var(--color-primary-light)]" : ""}
12811
+ `,
12812
+ children: [
12813
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "flex items-center justify-between p-4 pb-3", children: [
12814
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "flex items-center gap-2", children: [
12815
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("h2", { className: "font-semibold text-[var(--color-text-primary)] text-sm", children: column.title }),
12816
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "px-2 py-0.5 text-xs font-medium bg-[var(--color-border)] text-[var(--color-text-secondary)] rounded-full", children: tasks.length })
12817
+ ] }),
12818
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
12819
+ "button",
12820
+ {
12821
+ onClick: () => onAddTask(column.id),
12822
+ className: "p-1 hover:bg-[var(--color-surface-hover)] rounded transition-colors",
12823
+ children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_lucide_react33.Plus, { className: "w-4 h-4 text-[var(--color-text-secondary)]" })
12824
+ }
12825
+ )
12826
+ ] }),
12827
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "flex-1 p-2 pt-0 space-y-3 overflow-y-auto max-h-[calc(100vh-250px)]", children: [
12828
+ tasks.map((task) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
12829
+ TaskCard,
12830
+ {
12831
+ task,
12832
+ isDragging: draggedTask?.id === task.id,
12833
+ onDragStart,
12834
+ onDragEnd,
12835
+ onEdit: onEditTask,
12836
+ onDelete: onDeleteTask
12837
+ },
12838
+ task.id
12839
+ )),
12840
+ tasks.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: `
12841
+ border-2 border-dashed rounded-lg p-8 text-center transition-colors
12842
+ ${isDropTarget ? "border-[var(--color-primary)] bg-[var(--color-primary-light)]" : "border-[var(--color-border)]"}
12843
+ `, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("p", { className: "text-sm text-[var(--color-text-tertiary)]", children: "D\xE9posez une t\xE2che ici" }) })
12844
+ ] })
12845
+ ]
12846
+ }
12847
+ );
12848
+ };
12849
+ var TaskPilot = () => {
12850
+ const { success: showSuccess, error: showError, warning: showWarning, info: showInfo, confirm: confirm2 } = useToast();
12851
+ const [tasks, setTasks] = (0, import_react33.useState)([]);
12852
+ const [loading, setLoading] = (0, import_react33.useState)(true);
12853
+ const [searchQuery, setSearchQuery] = (0, import_react33.useState)("");
12854
+ const [draggedTask, setDraggedTask] = (0, import_react33.useState)(null);
12855
+ const [dropTargetColumn, setDropTargetColumn] = (0, import_react33.useState)(null);
12856
+ const [isFormOpen, setIsFormOpen] = (0, import_react33.useState)(false);
12857
+ const [editingTask, setEditingTask] = (0, import_react33.useState)(null);
12858
+ const [defaultStatus, setDefaultStatus] = (0, import_react33.useState)("new");
12859
+ const loadTasks = (0, import_react33.useCallback)(async () => {
12860
+ try {
12861
+ setLoading(true);
12862
+ const response = await TaskServices.list();
12863
+ const data = response;
12864
+ if (Array.isArray(data)) {
12865
+ setTasks(data);
12866
+ } else if (data.results) {
12867
+ setTasks(data.results);
12868
+ } else if (data.data) {
12869
+ setTasks(data.data);
12870
+ }
12871
+ } catch (error) {
12872
+ console.error("Error loading tasks:", error);
12873
+ showError("Erreur lors du chargement des t\xE2ches");
12874
+ } finally {
12875
+ setLoading(false);
12876
+ }
12877
+ }, [showError]);
12878
+ (0, import_react33.useEffect)(() => {
12879
+ loadTasks();
12880
+ }, [loadTasks]);
12881
+ const getTasksByStatus = (status) => {
12882
+ return tasks.filter((task) => task.status === status).filter(
12883
+ (task) => searchQuery === "" || task.title?.toLowerCase().includes(searchQuery.toLowerCase()) || task.description?.toLowerCase().includes(searchQuery.toLowerCase())
12884
+ );
12885
+ };
12886
+ const handleDragStart = (e, task) => {
12887
+ setDraggedTask(task);
12888
+ e.dataTransfer.effectAllowed = "move";
12889
+ e.dataTransfer.setData("text/plain", String(task.id));
12890
+ };
12891
+ const handleDragEnd = () => {
12892
+ setDraggedTask(null);
12893
+ setDropTargetColumn(null);
12894
+ };
12895
+ const handleDragOver = (e) => {
12896
+ e.preventDefault();
12897
+ e.dataTransfer.dropEffect = "move";
12898
+ };
12899
+ const handleDrop = async (e, columnId) => {
12900
+ e.preventDefault();
12901
+ if (draggedTask && draggedTask.status !== columnId) {
12902
+ setTasks(
12903
+ (prevTasks) => prevTasks.map(
12904
+ (task) => task.id === draggedTask.id ? { ...task, status: columnId } : task
12905
+ )
12906
+ );
12907
+ try {
12908
+ await TaskServices.updateStatus(draggedTask.id, columnId);
12909
+ showSuccess("Statut mis \xE0 jour");
12910
+ } catch (error) {
12911
+ console.error("Error updating status:", error);
12912
+ setTasks(
12913
+ (prevTasks) => prevTasks.map(
12914
+ (task) => task.id === draggedTask.id ? { ...task, status: draggedTask.status } : task
12915
+ )
12916
+ );
12917
+ showError("Erreur lors de la mise \xE0 jour");
12918
+ }
12919
+ }
12920
+ setDraggedTask(null);
12921
+ setDropTargetColumn(null);
12922
+ };
12923
+ const handleColumnDragEnter = (columnId) => {
12924
+ if (draggedTask && draggedTask.status !== columnId) {
12925
+ setDropTargetColumn(columnId);
12926
+ }
12927
+ };
12928
+ const handleColumnDragLeave = () => {
12929
+ setDropTargetColumn(null);
12930
+ };
12931
+ const handleAddTask = (status) => {
12932
+ setEditingTask(null);
12933
+ setDefaultStatus(status);
12934
+ setIsFormOpen(true);
12935
+ };
12936
+ const handleEditTask = (task) => {
12937
+ setEditingTask(task);
12938
+ setDefaultStatus(task.status);
12939
+ setIsFormOpen(true);
12940
+ };
12941
+ const handleDeleteTask = async (task) => {
12942
+ const confirmed = await confirm2("\xCAtes-vous s\xFBr de vouloir supprimer cette t\xE2che ?");
12943
+ if (!confirmed) return;
12944
+ try {
12945
+ await TaskServices.delete(task.id);
12946
+ setTasks((prev) => prev.filter((t) => t.id !== task.id));
12947
+ showSuccess("T\xE2che supprim\xE9e");
12948
+ } catch (error) {
12949
+ console.error("Error deleting task:", error);
12950
+ showError("Erreur lors de la suppression");
12951
+ }
12952
+ };
12953
+ const handleFormSuccess = () => {
12954
+ loadTasks();
12955
+ };
12956
+ if (loading) {
12957
+ return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: "h-full flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_lucide_react33.Loader2, { className: "w-8 h-8 animate-spin text-[var(--color-primary)]" }) });
12958
+ }
12959
+ return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "h-full flex flex-col", children: [
12960
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: "bg-[var(--color-surface)] border-b border-[var(--color-border)] px-6 py-4", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "flex items-center justify-between flex-wrap gap-4", children: [
12961
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("h1", { className: "text-xl font-semibold text-[var(--color-text-primary)]", children: "Task Pilot" }),
12962
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "flex items-center gap-3 flex-wrap", children: [
12963
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "relative", children: [
12964
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_lucide_react33.Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-[var(--color-text-tertiary)]" }),
12965
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
12966
+ "input",
12967
+ {
12968
+ type: "text",
12969
+ placeholder: "Rechercher...",
12970
+ value: searchQuery,
12971
+ onChange: (e) => setSearchQuery(e.target.value),
12972
+ className: "pl-9 pr-4 py-2 text-sm border border-[var(--color-border)] rounded-lg\r\n focus:outline-none focus:ring-2 focus:ring-[var(--color-primary)]/20 focus:border-[var(--color-primary)]\r\n w-64 bg-[var(--color-surface)] text-[var(--color-text-primary)]"
12973
+ }
12974
+ )
12975
+ ] }),
12976
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(SecondaryButton, { variant: "outline", children: [
12977
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_lucide_react33.Filter, { className: "w-4 h-4 mr-2" }),
12978
+ "Filtrer"
12979
+ ] }),
12980
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(Buttons_default, { onClick: () => handleAddTask("new"), children: [
12981
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_lucide_react33.Plus, { className: "w-4 h-4 mr-2" }),
12982
+ "Nouvelle t\xE2che"
12983
+ ] })
12984
+ ] })
12985
+ ] }) }),
12986
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: "flex-1 overflow-x-auto p-6 bg-[var(--color-background)]", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: "flex gap-4 h-full", children: COLUMNS.map((column) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
12987
+ "div",
12988
+ {
12989
+ onDragEnter: () => handleColumnDragEnter(column.id),
12990
+ onDragLeave: handleColumnDragLeave,
12991
+ children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
12992
+ KanbanColumn,
12993
+ {
12994
+ column,
12995
+ tasks: getTasksByStatus(column.id),
12996
+ onAddTask: handleAddTask,
12997
+ draggedTask,
12998
+ onDragStart: handleDragStart,
12999
+ onDragEnd: handleDragEnd,
13000
+ onDragOver: handleDragOver,
13001
+ onDrop: handleDrop,
13002
+ isDropTarget: dropTargetColumn === column.id,
13003
+ onEditTask: handleEditTask,
13004
+ onDeleteTask: handleDeleteTask
13005
+ }
13006
+ )
13007
+ },
13008
+ column.id
13009
+ )) }) }),
13010
+ draggedTask && /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "fixed bottom-4 left-1/2 -translate-x-1/2 bg-[var(--color-primary)] text-[var(--color-text-inverse)] px-4 py-2 rounded-lg shadow-lg text-sm font-medium animate-pulse", children: [
13011
+ 'D\xE9placez "',
13012
+ draggedTask.title?.substring(0, 30),
13013
+ '..." vers une colonne'
13014
+ ] }),
13015
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
13016
+ FormTask_default,
13017
+ {
13018
+ open: isFormOpen,
13019
+ onClose: () => setIsFormOpen(false),
13020
+ task: editingTask,
13021
+ defaultStatus,
13022
+ onSuccess: handleFormSuccess
13023
+ }
13024
+ )
13025
+ ] });
13026
+ };
13027
+ var TaskPilot_default = TaskPilot;
13028
+
13029
+ // src/pages/workspaces/PurchaseRequestsPage.tsx
13030
+ var import_react35 = require("react");
13031
+ var import_lucide_react35 = require("lucide-react");
13032
+
13033
+ // src/pages/workspaces/FormPurchaseRequest.tsx
13034
+ var import_react34 = require("react");
13035
+ var import_lucide_react34 = require("lucide-react");
13036
+
13037
+ // src/services/PurchaseRequestServices.ts
13038
+ var VENDORS_API_URL2 = `${API_URL}/procurement/purchase-requests/`;
13039
+ var PurchaseRequestServices = {
13040
+ createPurchaseRequest: (data, token) => FetchApi.post(`${VENDORS_API_URL2}`, data, token),
13041
+ getPurchaseRequest: (id, token) => FetchApi.get(`${VENDORS_API_URL2}${id}/`, token),
13042
+ getPurchaseRequests: (token) => FetchApi.get(`${VENDORS_API_URL2}`, token),
13043
+ updatePurchaseRequest: (id, data, token) => FetchApi.put(`${VENDORS_API_URL2}${id}/`, data, token),
13044
+ deletePurchaseRequest: (id, token) => FetchApi.delete(`${VENDORS_API_URL2}${id}/`, token)
13045
+ };
13046
+
13047
+ // src/globals.ts
13048
+ var UNITS = [
13049
+ "Pi\xE8ce",
13050
+ "Unit\xE9",
13051
+ "Lot",
13052
+ "Kg",
13053
+ "Gramme",
13054
+ "Tonne",
13055
+ "Litre",
13056
+ "M\xB2",
13057
+ "M\xB3",
13058
+ "M\xE8tre",
13059
+ "Cm",
13060
+ "Heure",
13061
+ "Jour",
13062
+ "Mois"
13063
+ ];
13064
+
13065
+ // src/pages/workspaces/FormPurchaseRequest.tsx
13066
+ var import_jsx_runtime46 = require("react/jsx-runtime");
13067
+ var FormPurchaseRequest = ({
13068
+ isOpen,
13069
+ onClose,
13070
+ object,
13071
+ refresh = () => {
13072
+ }
13073
+ }) => {
13074
+ const [formData, setFormData] = (0, import_react34.useState)(object || {
13075
+ request_number: "",
13076
+ title: "",
13077
+ description: "",
13078
+ category: "",
13079
+ requester: null,
13080
+ department: null,
13081
+ cost_center: null,
13082
+ estimated_amount: 0,
13083
+ currency: "",
13084
+ budget_available: false,
13085
+ urgency: "low",
13086
+ needed_date: "",
13087
+ delivery_address: "",
13088
+ delivery_contact: "",
13089
+ delivery_phone: "",
13090
+ status: "draft",
13091
+ approval_date: null,
13092
+ approved_by: null,
13093
+ created_at: "",
13094
+ updated_at: "",
13095
+ comments: null,
13096
+ vendor: null,
13097
+ evaluation_score: null,
13098
+ evaluation_notes: null,
13099
+ evaluated_by: null,
13100
+ evaluated_at: null,
13101
+ assigned_buyer: null,
13102
+ budget_approval_requested_at: null,
13103
+ items: [
13104
+ { description: "", specifications: "", quantity: 1, unit: "", unit_price: 0, total_price: 0, comments: "" }
13105
+ ]
13106
+ });
13107
+ const [errors, setErrors] = (0, import_react34.useState)({});
13108
+ const [activeTab, setActiveTab] = (0, import_react34.useState)("general");
13109
+ const [loading, setLoading] = (0, import_react34.useState)(false);
13110
+ const { loggedUser, token } = useSession();
13111
+ const { success, error: showError } = useToast();
13112
+ const [budgetInfo, setBudgetInfo] = (0, import_react34.useState)({ totalBudget: 0, totalActual: 0, available: 0, loading: false });
13113
+ const readonly = false;
13114
+ const fetchDepartmentBudget = async (departmentId) => {
13115
+ if (!departmentId) {
13116
+ setBudgetInfo({ totalBudget: 0, totalActual: 0, available: 0, loading: false });
13117
+ return;
13118
+ }
13119
+ setBudgetInfo((prev) => ({ ...prev, loading: true }));
13120
+ try {
13121
+ const currentYear = (/* @__PURE__ */ new Date()).getFullYear();
13122
+ const response = await fetch(
13123
+ `${API_URL}/core/departments/${departmentId}/budget-and-actual/?year=${currentYear}&category=expenses`,
13124
+ {
13125
+ headers: {
13126
+ "Authorization": `Token ${localStorage.getItem("token")}`
13127
+ }
13128
+ }
13129
+ );
13130
+ if (response.ok) {
13131
+ const data = await response.json();
13132
+ const available = (data.totals?.budget || 0) - (data.totals?.actual || 0);
13133
+ setBudgetInfo({
13134
+ totalBudget: data.totals?.budget || 0,
13135
+ totalActual: data.totals?.actual || 0,
13136
+ available,
13137
+ loading: false
13138
+ });
13139
+ } else {
13140
+ setBudgetInfo({ totalBudget: 0, totalActual: 0, available: 0, loading: false });
13141
+ }
13142
+ } catch (error) {
13143
+ console.error("Erreur lors de la r\xE9cup\xE9ration du budget:", error);
13144
+ setBudgetInfo({ totalBudget: 0, totalActual: 0, available: 0, loading: false });
13145
+ }
13146
+ };
13147
+ (0, import_react34.useEffect)(() => {
13148
+ if (formData.department) {
13149
+ fetchDepartmentBudget(formData.department);
13150
+ }
13151
+ }, [formData.department]);
13152
+ const handleInputChange = (e) => {
13153
+ const { name, value } = e.target;
13154
+ setFormData((prev) => ({ ...prev, [name]: value }));
13155
+ if (errors[name]) {
13156
+ setErrors((prev) => {
13157
+ const next = { ...prev };
13158
+ delete next[name];
13159
+ return next;
13160
+ });
13161
+ }
13162
+ };
13163
+ const selectDept = (option) => {
13164
+ setFormData({ ...formData, department: option.value });
13165
+ };
13166
+ const selectCostCenter = (option) => {
13167
+ setFormData({ ...formData, cost_center: option.value });
13168
+ };
13169
+ const handleSelectChange = (e) => {
13170
+ const { name, value } = e.target;
13171
+ setFormData((prev) => ({ ...prev, [name]: value }));
13172
+ };
13173
+ const handleTextareaChange = (e) => {
13174
+ const { name, value } = e.target;
13175
+ setFormData((prev) => ({ ...prev, [name]: value }));
13176
+ };
13177
+ const validateForm = () => {
13178
+ const newErrors = {};
13179
+ if (!formData.title?.trim()) {
13180
+ newErrors.title = "Le titre est obligatoire";
13181
+ }
13182
+ if (!formData.category?.trim()) {
13183
+ newErrors.category = "La cat\xE9gorie est obligatoire";
13184
+ }
13185
+ if (!formData.estimated_amount || formData.estimated_amount <= 0) {
13186
+ newErrors.estimated_amount = "Le montant estim\xE9 doit \xEAtre sup\xE9rieur \xE0 0";
13187
+ }
13188
+ setErrors(newErrors);
13189
+ return Object.keys(newErrors).length === 0;
13190
+ };
13191
+ const handleSavePurchaseRequest = async (entityData) => {
13192
+ try {
13193
+ if (object && object.id) {
13194
+ await PurchaseRequestServices.updatePurchaseRequest(object.id, entityData, token);
13195
+ success("Entit\xE9 modifi\xE9e avec succ\xE8s !");
13196
+ } else {
13197
+ await PurchaseRequestServices.createPurchaseRequest({ ...entityData, requester: loggedUser?.id }, token);
13198
+ success("Entit\xE9 cr\xE9\xE9e avec succ\xE8s !");
13199
+ }
13200
+ refresh();
13201
+ onClose();
13202
+ } catch (error) {
13203
+ console.error(error);
13204
+ showError("Erreur lors de l'enregistrement de l'entit\xE9");
13205
+ }
13206
+ };
13207
+ const selectVendor = (option) => {
13208
+ setFormData({ ...formData, suggered_vendor: Number(option.value) });
13209
+ };
13210
+ const handleSubmit = async (e) => {
13211
+ e.preventDefault();
13212
+ if (!validateForm()) return;
13213
+ setLoading(true);
13214
+ try {
13215
+ await handleSavePurchaseRequest(formData);
13216
+ } finally {
13217
+ setLoading(false);
13218
+ }
13219
+ };
13220
+ const tabs = [
13221
+ { id: "general", label: "G\xE9n\xE9ral", icon: import_lucide_react34.Building2 },
13222
+ { id: "items", label: "Articles", icon: import_lucide_react34.FileText },
13223
+ { id: "vendors", label: "Fournisseurs et Budgets", icon: import_lucide_react34.CreditCard }
13224
+ // { id: 'delivery', label: 'Livraison', icon: MapPin },
13225
+ ];
13226
+ const ajouterLigneAchat = () => {
13227
+ setFormData({ ...formData, items: [...formData.items ?? [], { description: "", specifications: "", quantity: 1, unit: "", unit_price: 0, total_price: 0, comments: "" }] });
13228
+ };
13229
+ const renderTabContent = () => {
13230
+ switch (activeTab) {
13231
+ case "general":
13232
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "space-y-4", children: [
13233
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
13234
+ TextInput,
13235
+ {
13236
+ label: "Num\xE9ro de demande",
13237
+ name: "request_number",
13238
+ value: formData.request_number || "",
13239
+ placeholder: "Num\xE9ro automatique",
13240
+ onChange: handleInputChange,
13241
+ disabled: true
13242
+ }
13243
+ ),
13244
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
13245
+ TextInput,
13246
+ {
13247
+ label: "Titre",
13248
+ name: "title",
13249
+ value: formData.title || "",
13250
+ placeholder: "Titre de la demande d'achat",
13251
+ required: true,
13252
+ error: errors.title,
13253
+ onChange: handleInputChange
13254
+ }
13255
+ ),
13256
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
13257
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
13258
+ TextInput,
13259
+ {
13260
+ label: "Cat\xE9gorie",
13261
+ name: "category",
13262
+ value: formData.category || "",
13263
+ placeholder: "Cat\xE9gorie de produits/services",
13264
+ required: true,
13265
+ error: errors.category,
13266
+ onChange: handleInputChange
13267
+ }
13268
+ ),
13269
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(SelectDepartment, { value: formData.department, onSelect: selectDept }),
13270
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
13271
+ TextInput,
13272
+ {
13273
+ label: "Montant estim\xE9",
13274
+ name: "estimated_amount",
13275
+ value: formData.estimated_amount || "",
13276
+ placeholder: "Montant en devise",
13277
+ error: errors.estimated_amount,
13278
+ onChange: handleInputChange
13279
+ }
13280
+ ),
13281
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { children: [
13282
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Urgence" }),
13283
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
13284
+ "select",
13285
+ {
13286
+ name: "urgency",
13287
+ value: formData.urgency || "low",
13288
+ onChange: handleSelectChange,
13289
+ className: "w-full px-4 py-3 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-[#6B7C92] focus:border-transparent",
13290
+ children: [
13291
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("option", { value: "low", children: "Faible" }),
13292
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("option", { value: "medium", children: "Moyenne" }),
13293
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("option", { value: "high", children: "\xC9lev\xE9e" }),
13294
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("option", { value: "critical", children: "Critique" })
13295
+ ]
13296
+ }
13297
+ )
13298
+ ] }),
13299
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
13300
+ InputField,
13301
+ {
13302
+ label: "Date de besoin",
13303
+ name: "needed_date",
13304
+ type: "date",
13305
+ min: (/* @__PURE__ */ new Date()).toISOString().split("T")[0],
13306
+ value: formData.needed_date || "",
13307
+ onChange: handleInputChange
13308
+ }
13309
+ )
13310
+ ] }),
13311
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { children: [
13312
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Description" }),
13313
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
13314
+ "textarea",
13315
+ {
13316
+ name: "description",
13317
+ value: formData.description || "",
13318
+ onChange: handleTextareaChange,
13319
+ rows: 3,
13320
+ className: "w-full px-4 py-3 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-[#6B7C92] focus:border-transparent placeholder-gray-400",
13321
+ placeholder: "Description d\xE9taill\xE9e de la demande"
13322
+ }
13323
+ )
13324
+ ] }),
13325
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { children: [
13326
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Commentaires" }),
13327
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
13328
+ "textarea",
13329
+ {
13330
+ name: "comments",
13331
+ value: formData.comments || "",
13332
+ onChange: handleTextareaChange,
13333
+ rows: 2,
13334
+ className: "w-full px-4 py-3 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-[#6B7C92] focus:border-transparent placeholder-gray-400",
13335
+ placeholder: "Commentaires additionnels"
13336
+ }
13337
+ )
13338
+ ] })
13339
+ ] });
13340
+ case "delivery":
13341
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "space-y-4", children: [
13342
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { children: [
13343
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Adresse de livraison" }),
13344
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
13345
+ "textarea",
13346
+ {
13347
+ name: "delivery_address",
13348
+ value: formData.delivery_address || "",
13349
+ onChange: handleTextareaChange,
13350
+ rows: 3,
13351
+ className: "w-full px-4 py-3 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-[#6B7C92] focus:border-transparent placeholder-gray-400",
13352
+ placeholder: "Adresse compl\xE8te de livraison"
13353
+ }
13354
+ )
13355
+ ] }),
13356
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
13357
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
13358
+ TextInput,
13359
+ {
13360
+ label: "Contact de livraison",
13361
+ name: "delivery_contact",
13362
+ value: formData.delivery_contact || "",
13363
+ placeholder: "Nom du contact",
13364
+ onChange: handleInputChange
13365
+ }
13366
+ ),
13367
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
13368
+ InputField,
13369
+ {
13370
+ label: "T\xE9l\xE9phone de livraison",
13371
+ name: "delivery_phone",
13372
+ type: "tel",
13373
+ value: formData.delivery_phone || "",
13374
+ placeholder: "+33 1 23 45 67 89",
13375
+ onChange: handleInputChange
13376
+ }
13377
+ )
13378
+ ] })
13379
+ ] });
13380
+ case "vendors":
13381
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "space-y-4", children: [
13382
+ (formData?.items?.reduce((sum, item) => sum + (Number(item?.total_price) || 0), 0) ?? 0) < 3e5 ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_jsx_runtime46.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(SelectVendor, { value: formData.suggered_vendor, onSelect: selectVendor }) }) : /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_jsx_runtime46.Fragment, {}),
13383
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(SelectCostCenter, { value: formData.cost_center, onSelect: selectCostCenter }) }),
13384
+ object && (formData.approval_date || formData.approved_by || formData.evaluation_score) && /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "mt-6 p-4 bg-gray-50 rounded-lg", children: [
13385
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("h4", { className: "text-sm font-medium text-gray-700 mb-3", children: "Informations syst\xE8me (lecture seule)" }),
13386
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
13387
+ formData.approval_date && /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { children: [
13388
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "text-xs text-gray-500", children: "Date d'approbation:" }),
13389
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("p", { className: "text-sm", children: formData.approval_date })
13390
+ ] }),
13391
+ formData.approved_by && /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { children: [
13392
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "text-xs text-gray-500", children: "Approuv\xE9 par:" }),
13393
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("p", { className: "text-sm", children: formData.approved_by })
13394
+ ] }),
13395
+ formData.evaluation_score && /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { children: [
13396
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "text-xs text-gray-500", children: "Note d'\xE9valuation:" }),
13397
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("p", { className: "text-sm", children: formData.evaluation_score })
13398
+ ] }),
13399
+ formData.evaluated_at && /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { children: [
13400
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "text-xs text-gray-500", children: "Date d'\xE9valuation:" }),
13401
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("p", { className: "text-sm", children: formData.evaluated_at })
13402
+ ] })
13403
+ ] }),
13404
+ formData.evaluation_notes && /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "mt-3", children: [
13405
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "text-xs text-gray-500", children: "Notes d'\xE9valuation:" }),
13406
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("p", { className: "text-sm", children: formData.evaluation_notes })
13407
+ ] })
13408
+ ] })
13409
+ ] });
13410
+ case "items":
13411
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "space-y-4", children: [
13412
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "flex justify-between items-center", children: [
13413
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("h3", { className: "text-lg font-medium text-gray-900", children: "Articles demand\xE9s" }),
13414
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
13415
+ Buttons_default,
13416
+ {
13417
+ type: "button",
13418
+ onClick: ajouterLigneAchat,
13419
+ children: [
13420
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_lucide_react34.Plus, { className: "w-4 h-4 mr-2" }),
13421
+ "Ajouter ligne"
13422
+ ]
13423
+ }
13424
+ )
13425
+ ] }),
13426
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "border border-gray-200 rounded-lg p-4", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("table", { className: "w-full", children: [
13427
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("thead", { className: "bg-[#e8eaec]", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("tr", { children: [
13428
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("th", { className: "border border-[#d1d7de] px-2 py-2 text-left text-xs font-semibold text-[#283042] uppercase", children: "D\xE9signation" }),
13429
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("th", { className: "border border-[#d1d7de] px-2 py-2 text-left text-xs font-semibold text-[#283042] uppercase", children: "Unit\xE9" }),
13430
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("th", { className: "border border-[#d1d7de] px-2 py-2 text-right text-xs font-semibold text-[#283042] uppercase", children: "Qt\xE9" }),
13431
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("th", { className: "border border-[#d1d7de] px-2 py-2 text-right text-xs font-semibold text-[#283042] uppercase", children: "Prix U. HT" }),
13432
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("th", { className: "border border-[#d1d7de] px-2 py-2 text-right text-xs font-semibold text-[#283042] uppercase", children: "Mont. HT" }),
13433
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("th", { className: "border border-[#d1d7de] px-2 py-2 text-left text-xs font-semibold text-[#283042] uppercase", children: "Commentaires" }),
13434
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("th", { className: "border border-[#d1d7de] px-2 py-2 text-center text-xs font-semibold text-[#283042] uppercase print:hidden", children: "Actions" })
13435
+ ] }) }),
13436
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("tbody", { className: "divide-y divide-[#E8E8E8]", children: formData?.items?.map((line, index) => /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("tr", { className: index % 2 === 0 ? "bg-white" : "bg-gray-50", children: [
13437
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("td", { className: "border border-[#d1d7de] px-2 py-2", children: !readonly ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
13438
+ "textarea",
13439
+ {
13440
+ value: line.description,
13441
+ onChange: (e) => {
13442
+ const newLignes = [...formData.items ?? []];
13443
+ newLignes[index].description = e.target.value;
13444
+ setFormData({ ...formData, items: newLignes });
13445
+ },
13446
+ rows: 2,
13447
+ className: `w-full px-1 py-1 border rounded text-xs resize-none ${errors[`line_${index}_designation`] ? "border-red-500" : "border-[#d1d7de]"}`,
13448
+ placeholder: "Description d\xE9taill\xE9e *"
13449
+ }
13450
+ ) : /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "text-xs", children: line.description }) }),
13451
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("td", { className: "border border-[#d1d7de] px-2 py-2", children: !readonly ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
13452
+ "select",
13453
+ {
13454
+ value: line.unit,
13455
+ onChange: (e) => {
13456
+ const newLignes = [...formData.items ?? []];
13457
+ newLignes[index].unit = e.target.value;
13458
+ setFormData({ ...formData, items: newLignes });
13459
+ },
13460
+ className: "w-full px-1 py-1 border border-[#d1d7de] rounded text-xs",
13461
+ children: UNITS.map((unit) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("option", { value: unit, children: unit }, unit))
13462
+ }
13463
+ ) : /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "text-xs", children: line.unit }) }),
13464
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("td", { className: "border border-[#d1d7de] px-2 py-2 text-right", children: !readonly ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
13465
+ "input",
13466
+ {
13467
+ type: "number",
13468
+ min: "0",
13469
+ value: line.quantity,
13470
+ onChange: (e) => {
13471
+ const newLignes = [...formData.items ?? []];
13472
+ const quantity = parseFloat(e.target.value) || 0;
13473
+ newLignes[index].quantity = quantity;
13474
+ newLignes[index].total_price = quantity * (newLignes[index].unit_price || 0);
13475
+ setFormData({ ...formData, items: newLignes });
13476
+ },
13477
+ className: `w-full px-1 py-1 border rounded text-xs text-right ${errors[`line_${index}_quantity`] ? "border-red-500" : "border-[#d1d7de]"}`
13478
+ }
13479
+ ) : /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "text-xs font-medium", children: line.quantity.toLocaleString("fr-FR") }) }),
13480
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("td", { className: "border border-[#d1d7de] px-2 py-2 text-right", children: !readonly ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
13481
+ "input",
13482
+ {
13483
+ type: "number",
13484
+ min: "0",
13485
+ value: line.unit_price,
13486
+ onChange: (e) => {
13487
+ const newLignes = [...formData.items ?? []];
13488
+ const unitPrice = parseFloat(e.target.value) || 0;
13489
+ newLignes[index].unit_price = unitPrice;
13490
+ newLignes[index].total_price = (newLignes[index].quantity || 0) * unitPrice;
13491
+ setFormData({ ...formData, items: newLignes });
13492
+ },
13493
+ className: `w-full px-1 py-1 border rounded text-xs text-right ${errors[`line_${index}_price`] ? "border-red-500" : "border-[#d1d7de]"}`
13494
+ }
13495
+ ) : /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "text-xs", children: [
13496
+ line.unit_price?.toFixed(2),
13497
+ " FCFA"
13498
+ ] }) }),
13499
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("td", { className: "border border-[#d1d7de] px-2 py-2 text-right font-medium", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "text-xs", children: [
13500
+ ((line.quantity || 0) * (line.unit_price || 0)).toFixed(2),
13501
+ " FCFA"
13502
+ ] }) }),
13503
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("td", { className: "border border-[#d1d7de] px-2 py-2", children: !readonly ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
13504
+ "textarea",
13505
+ {
13506
+ value: line.comments || "",
13507
+ onChange: (e) => {
13508
+ const newLignes = [...formData.items ?? []];
13509
+ newLignes[index].comments = e.target.value;
13510
+ setFormData({ ...formData, items: newLignes });
13511
+ },
13512
+ rows: 1,
13513
+ className: "w-full px-1 py-1 border border-[#d1d7de] rounded text-xs resize-none",
13514
+ placeholder: "Commentaires"
13515
+ }
13516
+ ) : /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "text-xs", children: line.comments || "-" }) }),
13517
+ !readonly && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("td", { className: "border border-[#d1d7de] px-2 py-2 text-center print:hidden", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
13518
+ Buttons_default,
13519
+ {
13520
+ onClick: () => {
13521
+ const newItems = (formData.items ?? []).filter((_, i) => i !== index);
13522
+ setFormData({ ...formData, items: newItems });
13523
+ },
13524
+ children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_lucide_react34.Trash2, { className: "w-3 h-3" })
13525
+ }
13526
+ ) })
13527
+ ] }, line.id)) })
13528
+ ] }) })
13529
+ ] });
13530
+ default:
13531
+ return null;
13532
+ }
13533
+ };
13534
+ if (!isOpen) return null;
13535
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
13536
+ Modals_default,
13537
+ {
13538
+ title: "Demande d'achat",
13539
+ width: "max-w-4xl",
13540
+ minContentHeight: "450px",
13541
+ description: ``,
13542
+ open: isOpen,
13543
+ onClose,
13544
+ children: [
13545
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "border-b border-gray-200", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("nav", { className: "flex space-x-8 px-6", children: tabs.map((tab) => {
13546
+ const Icon = tab.icon;
13547
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
13548
+ "button",
13549
+ {
13550
+ type: "button",
13551
+ onClick: () => setActiveTab(tab.id),
13552
+ className: `
13553
+ flex items-center space-x-2 py-4 px-2 text-sm font-medium border-b-2 transition-colors
13554
+ ${activeTab === tab.id ? "border-[#6A8A82] text-[#6A8A82]" : "border-transparent text-[#767676] hover:text-[#6A8A82] hover:border-[#6A8A82]/30"}
13555
+ `,
13556
+ children: [
13557
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Icon, { className: "w-4 h-4 inline mr-2" }),
13558
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { children: tab.label })
13559
+ ]
13560
+ },
13561
+ tab.id
13562
+ );
13563
+ }) }) }),
13564
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("form", { onSubmit: handleSubmit, className: "p-6", children: [
13565
+ renderTabContent(),
13566
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "flex justify-between pt-6 border-t border-gray-200 mt-8", children: [
13567
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
13568
+ "button",
13569
+ {
13570
+ type: "button",
13571
+ onClick: onClose,
13572
+ className: "px-6 py-2 border border-gray-300 text-gray-700 rounded-lg hover:bg-gray-50 transition-colors",
13573
+ children: "Annuler"
13574
+ }
13575
+ ),
13576
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
13577
+ Buttons_default,
13578
+ {
13579
+ type: "submit",
13580
+ disabled: loading,
13581
+ children: loading ? "chargement..." : "Enregistrer l'entit\xE9"
13582
+ }
13583
+ )
13584
+ ] })
13585
+ ] })
13586
+ ]
13587
+ }
13588
+ );
13589
+ };
13590
+
13591
+ // src/pages/workspaces/PurchaseRequestsPage.tsx
13592
+ var import_jsx_runtime47 = require("react/jsx-runtime");
13593
+ var PurchaseRequestsPage = () => {
13594
+ const [purchaseRequests, setPurchaseRequests] = (0, import_react35.useState)([]);
13595
+ const [loading, setLoading] = (0, import_react35.useState)(true);
13596
+ const [refreshToggle, setRefreshToggle] = (0, import_react35.useState)(false);
13597
+ const [showModal, setShowModal] = (0, import_react35.useState)(false);
13598
+ const [showModalRFQ, setShowModalRFQ] = (0, import_react35.useState)(false);
13599
+ const [showModalSourcing, setShowModalSourcing] = (0, import_react35.useState)(false);
13600
+ const [selectedPurchaseRequest, setSelectedPurchaseRequest] = (0, import_react35.useState)(null);
13601
+ const { token } = useSession();
13602
+ (0, import_react35.useEffect)(() => {
13603
+ }, []);
13604
+ const loadPurchaseRequests = async () => {
13605
+ setRefreshToggle((prev) => !prev);
13606
+ };
13607
+ const tabs = [
13608
+ { id: "purchase_requests", label: "Demande d'achat", icon: import_lucide_react35.ClipboardCheck },
13609
+ { id: "my_gr_se", label: "My GR-SE", icon: import_lucide_react35.ClipboardCheck }
13610
+ ];
13611
+ const [activeTab, setActiveTab] = (0, import_react35.useState)("purchase_requests");
13612
+ return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
13613
+ Pages_default,
13614
+ {
13615
+ title: "Proculink",
13616
+ description: "G\xE9rez vos demandes d'achat",
13617
+ sideAction: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(Buttons_default, { onClick: () => {
13618
+ setShowModal(true);
13619
+ setSelectedPurchaseRequest(null);
13620
+ }, children: [
13621
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_lucide_react35.Plus, { className: "h-4 w-4 mr-2" }),
13622
+ " Nouvelle demande"
13623
+ ] }),
13624
+ tabs: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("nav", { className: "flex space-x-1 mt-4 overflow-x-auto", children: tabs.map((tab) => {
13625
+ const Icon = tab.icon;
13626
+ return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
13627
+ "button",
13628
+ {
13629
+ onClick: () => setActiveTab(tab.id),
13630
+ className: `px-4 py-2 text-sm rounded-lg transition-all whitespace-nowrap ${activeTab === tab.id ? "bg-[var(--color-primary)] text-white shadow-md" : "text-gray-600 hover:bg-gray-100"}`,
13631
+ children: [
13632
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(Icon, { className: "w-4 h-4 inline mr-2" }),
13633
+ tab.label
13634
+ ]
13635
+ },
13636
+ tab.id
13637
+ );
13638
+ }) }),
13639
+ children: [
13640
+ activeTab === "purchase_requests" && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
13641
+ FDrawer,
13642
+ {
13643
+ apiEndpoint: `/procurement/purchase-requests/myself/`,
13644
+ toggle: refreshToggle,
13645
+ columns: [
13646
+ { key: "request_number", label: "N\xB0 DA", type: "text", filterable: true, sortable: true, search_name: "request_number" },
13647
+ { key: "requested_by_user", label: "Demandeur", type: "text", filterable: true, sortable: false, search_name: "requester__last_name" },
13648
+ { key: "title", label: "Titre", type: "text", filterable: true, sortable: true, search_name: "title" },
13649
+ { key: "amount", label: "Montant", type: "number", filterable: true, sortable: true, search_name: "amount" },
13650
+ { key: "vendor", label: "Fournisseur", type: "text", filterable: true, sortable: true, search_name: "vendor", formule: (item) => item.vendor_info?.legal_name ?? "" },
13651
+ { key: "created_at", label: "Date de cr\xE9ation", type: "date", filterable: true, sortable: true, search_name: "created_at" },
13652
+ { key: "status", label: "Statut", type: "text", filterable: true, sortable: true, search_name: "status" },
13653
+ {
13654
+ key: "sourcing_id",
13655
+ label: "Sourcing",
13656
+ type: "text",
13657
+ filterable: true,
13658
+ sortable: false,
13659
+ search_name: "sourcing_id",
13660
+ formule: (item) => {
13661
+ if (item.sourcing_id) {
13662
+ return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "bg-secondary text-[13px] text-primary px-4 py-1 rounded-[4px]", onClick: () => {
13663
+ }, children: "SSJ" });
13664
+ }
13665
+ if (item.rfq) {
13666
+ return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
13667
+ "span",
13668
+ {
13669
+ className: "bg-secondary text-[13px] text-primary px-4 py-1 rounded-[4px]",
13670
+ onClick: () => {
13671
+ setSelectedPurchaseRequest(item);
13672
+ setShowModalRFQ(true);
13673
+ },
13674
+ children: "appel d'offre"
13675
+ }
13676
+ );
13677
+ }
13678
+ return "N/A";
13679
+ }
13680
+ },
13681
+ {
13682
+ key: "approval_status",
13683
+ label: "",
13684
+ type: "custom",
13685
+ filterable: true,
13686
+ sortable: false,
13687
+ search_name: "approval_status",
13688
+ formule: (item) => {
13689
+ return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
13690
+ ApprovalWorkflow_default,
13691
+ {
13692
+ title: `Approbation de la demande d'achat ${item.request_number} ${item.title}`,
13693
+ process: "PCR-PR",
13694
+ object_id: item.id,
13695
+ CustomBtn: (props) => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(Buttons_default, { className: "rounded-[6px] bg-gray-500 p-1 text-white", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_lucide_react35.ClipboardCheck, {}) }),
13696
+ readOnly: false
13697
+ }
13698
+ );
13699
+ }
13700
+ }
13701
+ ],
13702
+ actions: [
13703
+ {
13704
+ label: "Modifier",
13705
+ permission: "edit_user",
13706
+ onclick: (item) => {
13707
+ setSelectedPurchaseRequest(item);
13708
+ setShowModal(true);
13709
+ }
13710
+ },
13711
+ { label: "Supprimer", permission: "delete_user", onclick: (item) => {
13712
+ } }
13713
+ ],
13714
+ ordering: "title"
13715
+ }
13716
+ ),
13717
+ activeTab === "my_gr_se" && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
13718
+ FDrawer,
13719
+ {
13720
+ apiEndpoint: `/procurement/receipts/search/`,
13721
+ columns: [
13722
+ { key: "created_at", label: "Date de cr\xE9ation", type: "date", filterable: true, sortable: true, search_name: "created_at" },
13723
+ { key: "receipt_number", label: "N\xB0 R\xE9ception", type: "text", filterable: true, sortable: false, search_name: "receipt_number" },
13724
+ { key: "type_of_receipt", label: "Type", type: "text", filterable: true, sortable: false, search_name: "type_of_receipt" },
13725
+ {
13726
+ key: "purchase_order",
13727
+ label: "N\xB0 Commande",
13728
+ type: "text",
13729
+ filterable: true,
13730
+ sortable: false,
13731
+ search_name: "purchase_order__quote_number",
13732
+ formule: (item) => item.purchase_order_info?.quote_number ?? "-"
13733
+ },
13734
+ {
13735
+ key: "vendor",
13736
+ label: "Fournisseur",
13737
+ type: "text",
13738
+ filterable: true,
13739
+ sortable: false,
13740
+ search_name: "purchase_order__vendor__legal_name",
13741
+ formule: (item) => item.purchase_order_info?.vendor_info?.legal_name ?? "-"
13742
+ },
13743
+ { key: "received_at", label: "Date de r\xE9ception", type: "date", filterable: true, sortable: true, search_name: "received_at" },
13744
+ { key: "receipt_address", label: "Lieu", type: "text", filterable: true, sortable: false, search_name: "receipt_address" },
13745
+ {
13746
+ key: "approval_status",
13747
+ label: "",
13748
+ type: "custom",
13749
+ filterable: true,
13750
+ sortable: false,
13751
+ search_name: "approval_status",
13752
+ formule: (item) => {
13753
+ return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
13754
+ ApprovalWorkflow_default,
13755
+ {
13756
+ title: `Approbation de la reception ${item.receipt_number} ${item.purchase_order_info.quote_number}`,
13757
+ process: "PCR-RCPT",
13758
+ object_id: item.id,
13759
+ CustomBtn: (props) => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(Buttons_default, { className: "rounded-[6px] bg-gray-500 p-1 text-white", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_lucide_react35.ClipboardCheck, {}) }),
13760
+ readOnly: false
13761
+ }
13762
+ );
13763
+ }
13764
+ },
13765
+ { key: "status", label: "Statut", type: "text", filterable: true, sortable: false, search_name: "status" }
13766
+ ],
13767
+ actions: [],
13768
+ ordering: "received_at"
13769
+ }
13770
+ ),
13771
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
13772
+ FormPurchaseRequest,
13773
+ {
13774
+ isOpen: showModal,
13775
+ onClose: () => setShowModal(false),
13776
+ refresh: loadPurchaseRequests,
13777
+ object: selectedPurchaseRequest
13778
+ },
13779
+ `PRFORM-${selectedPurchaseRequest?.id}`
13780
+ )
13781
+ ]
13782
+ }
13783
+ );
13784
+ };
13785
+
13786
+ // src/App.tsx
13787
+ var import_react_router_dom21 = require("react-router-dom");
13788
+
13789
+ // src/pages/Home.tsx
13790
+ var import_react36 = require("react");
13791
+ var import_react_router_dom5 = require("react-router-dom");
13792
+ var import_lucide_react36 = require("lucide-react");
13793
+ var import_jsx_runtime48 = require("react/jsx-runtime");
13794
+
13795
+ // src/pages/auth/Login.tsx
13796
+ var import_react37 = require("react");
13797
+ var import_lucide_react37 = require("lucide-react");
13798
+ var import_react_router_dom6 = require("react-router-dom");
13799
+ var import_jsx_runtime49 = require("react/jsx-runtime");
13800
+
13801
+ // src/pages/auth/Register.tsx
13802
+ var import_react38 = require("react");
13803
+ var import_lucide_react38 = require("lucide-react");
13804
+ var import_react_router_dom7 = require("react-router-dom");
13805
+ var import_jsx_runtime50 = require("react/jsx-runtime");
13806
+
13807
+ // src/pages/Dashboard.tsx
13808
+ var import_react39 = require("react");
13809
+ var import_react_router_dom8 = require("react-router-dom");
13810
+ var import_lucide_react39 = require("lucide-react");
13811
+ var import_jsx_runtime51 = require("react/jsx-runtime");
13812
+
13813
+ // src/pages/Analytics.tsx
13814
+ var import_lucide_react40 = require("lucide-react");
13815
+ var import_jsx_runtime52 = require("react/jsx-runtime");
13816
+
13817
+ // src/pages/Team.tsx
13818
+ var import_react40 = require("react");
13819
+ var import_lucide_react41 = require("lucide-react");
13820
+ var import_jsx_runtime53 = require("react/jsx-runtime");
13821
+
13822
+ // src/pages/Profile.tsx
13823
+ var import_react41 = require("react");
13824
+ var import_lucide_react42 = require("lucide-react");
13825
+ var import_jsx_runtime54 = require("react/jsx-runtime");
13826
+
13827
+ // src/pages/Settings.tsx
13828
+ var import_react42 = require("react");
13829
+ var import_lucide_react43 = require("lucide-react");
13830
+ var import_jsx_runtime55 = require("react/jsx-runtime");
13831
+
13832
+ // src/pages/CreateOrganization.tsx
13833
+ var import_react43 = require("react");
13834
+ var import_react_router_dom9 = require("react-router-dom");
13835
+ var import_lucide_react44 = require("lucide-react");
13836
+
13837
+ // src/services/OrganizationServices.ts
13838
+ var ORGANIZATIONS_API_URL = `${API_URL}/core/organizations/`;
13839
+ var ENTITIES_API_URL = `${API_URL}/core/entities/`;
13840
+
13841
+ // src/pages/CreateOrganization.tsx
13842
+ var import_jsx_runtime56 = require("react/jsx-runtime");
13843
+
13844
+ // src/pages/organizations/ListOrganizations.tsx
13845
+ var import_react44 = require("react");
13846
+ var import_react_router_dom10 = require("react-router-dom");
13847
+ var import_lucide_react45 = require("lucide-react");
13848
+ var import_jsx_runtime57 = require("react/jsx-runtime");
13849
+
13850
+ // src/pages/organizations/DetailOrganizations.tsx
13851
+ var import_react46 = require("react");
13852
+ var import_react_router_dom12 = require("react-router-dom");
13853
+ var import_lucide_react47 = require("lucide-react");
13854
+
13855
+ // src/pages/pricings/ListPricing.tsx
13856
+ var import_react45 = require("react");
13857
+ var import_react_router_dom11 = require("react-router-dom");
13858
+ var import_lucide_react46 = require("lucide-react");
13859
+ var import_jsx_runtime58 = require("react/jsx-runtime");
13860
+
13861
+ // src/services/PlanSubscriptionServices.tsx
13862
+ var MODULES_API_URL = `${API_URL}/core/modules/`;
13863
+ var PLANS_API_URL = `${API_URL}/core/plans/`;
13864
+
13865
+ // src/pages/organizations/DetailOrganizations.tsx
13866
+ var import_jsx_runtime59 = require("react/jsx-runtime");
13867
+
13868
+ // src/pages/organizations/DetailEntity.tsx
13869
+ var import_react48 = require("react");
13870
+ var import_react_router_dom13 = require("react-router-dom");
13871
+ var import_lucide_react49 = require("lucide-react");
13872
+
13873
+ // src/forms/UserForm.tsx
13874
+ var import_react47 = require("react");
13875
+
13876
+ // src/services/AuthorizationService.ts
13877
+ var API_BASE_URL3 = `${API_URL}/core/permissions`;
13878
+
13879
+ // src/forms/UserForm.tsx
13880
+ var import_lucide_react48 = require("lucide-react");
13881
+ var import_jsx_runtime60 = require("react/jsx-runtime");
13882
+
13883
+ // src/pages/organizations/DetailEntity.tsx
13884
+ var import_jsx_runtime61 = require("react/jsx-runtime");
13885
+
13886
+ // src/pages/pricings/CartPlan.tsx
13887
+ var import_react49 = require("react");
13888
+ var import_react_router_dom14 = require("react-router-dom");
13889
+ var import_lucide_react50 = require("lucide-react");
13890
+ var import_jsx_runtime62 = require("react/jsx-runtime");
13891
+
13892
+ // src/App.tsx
13893
+ var import_lucide_react65 = require("lucide-react");
13894
+
13895
+ // src/pages/auth/ForgotPassword.tsx
13896
+ var import_react50 = require("react");
13897
+ var import_react_router_dom15 = require("react-router-dom");
13898
+ var import_lucide_react51 = require("lucide-react");
13899
+ var import_jsx_runtime63 = require("react/jsx-runtime");
13900
+
13901
+ // src/pages/auth/ResetPassword.tsx
13902
+ var import_react51 = require("react");
13903
+ var import_react_router_dom16 = require("react-router-dom");
13904
+ var import_lucide_react52 = require("lucide-react");
13905
+ var import_jsx_runtime64 = require("react/jsx-runtime");
13906
+
13907
+ // src/pages/auth/RespondInvitationEmail.tsx
13908
+ var import_react52 = require("react");
13909
+ var import_react_router_dom17 = require("react-router-dom");
13910
+ var import_lucide_react53 = require("lucide-react");
13911
+ var import_jsx_runtime65 = require("react/jsx-runtime");
13912
+
13913
+ // src/pages/parameters/ProfitCostCenterPage.tsx
13914
+ var import_react53 = require("react");
13915
+ var import_react_router_dom18 = require("react-router-dom");
13916
+ var import_lucide_react54 = require("lucide-react");
13917
+ var import_jsx_runtime66 = require("react/jsx-runtime");
13918
+
13919
+ // src/pages/parameters/ParametersPage.tsx
13920
+ var import_react_router_dom19 = require("react-router-dom");
13921
+ var import_lucide_react55 = require("lucide-react");
13922
+ var import_jsx_runtime67 = require("react/jsx-runtime");
13923
+
13924
+ // src/pages/users/UsersPage.tsx
13925
+ var import_react54 = require("react");
13926
+ var import_lucide_react56 = require("lucide-react");
13927
+ var import_jsx_runtime68 = require("react/jsx-runtime");
13928
+
13929
+ // src/pages/onboarding/OnboardingWizard.tsx
13930
+ var import_react59 = require("react");
13931
+ var import_react_router_dom20 = require("react-router-dom");
13932
+ var import_lucide_react62 = require("lucide-react");
13933
+
13934
+ // src/pages/onboarding/components/StepIndicator.tsx
13935
+ var import_react55 = __toESM(require("react"), 1);
13936
+ var import_lucide_react57 = require("lucide-react");
13937
+ var import_jsx_runtime69 = require("react/jsx-runtime");
13938
+
13939
+ // src/pages/onboarding/steps/WelcomeStep.tsx
13940
+ var import_lucide_react58 = require("lucide-react");
13941
+ var import_jsx_runtime70 = require("react/jsx-runtime");
13942
+
13943
+ // src/pages/onboarding/steps/OrganizationStep.tsx
13944
+ var import_react56 = require("react");
13945
+ var import_lucide_react59 = require("lucide-react");
13946
+ var import_jsx_runtime71 = require("react/jsx-runtime");
13947
+
13948
+ // src/pages/onboarding/steps/EntityStep.tsx
13949
+ var import_react57 = require("react");
13950
+ var import_lucide_react60 = require("lucide-react");
13951
+ var import_jsx_runtime72 = require("react/jsx-runtime");
13952
+
13953
+ // src/pages/onboarding/steps/ConfirmationStep.tsx
13954
+ var import_react58 = require("react");
13955
+ var import_lucide_react61 = require("lucide-react");
13956
+ var import_jsx_runtime73 = require("react/jsx-runtime");
13957
+
13958
+ // src/pages/onboarding/OnboardingWizard.tsx
13959
+ var import_jsx_runtime74 = require("react/jsx-runtime");
13960
+
13961
+ // src/pages/parameters/CrmParametersPage.tsx
13962
+ var import_react60 = require("react");
13963
+ var import_lucide_react63 = require("lucide-react");
13964
+
13965
+ // src/services/CrmServices.ts
13966
+ var TARGET_RETAILER_URI = `${API_URL}/crm/target-retailers/`;
13967
+ var DAS_URI = `${API_URL}/crm/das/`;
13968
+ var OTHER_COST_URI = `${API_URL}/crm/other-costs/`;
13969
+ var LEAD_NEED_URI = `${API_URL}/crm/lead-needs/`;
13970
+
13971
+ // src/pages/parameters/CrmParametersPage.tsx
13972
+ var import_jsx_runtime75 = require("react/jsx-runtime");
13973
+
13974
+ // src/pages/organizations/EntitiesPage.tsx
13975
+ var import_react61 = require("react");
13976
+ var import_lucide_react64 = require("lucide-react");
13977
+ var import_jsx_runtime76 = require("react/jsx-runtime");
13978
+
13979
+ // src/App.tsx
13980
+ var import_jsx_runtime77 = require("react/jsx-runtime");
13981
+ var WorkSpaceRoutes = ({ module_name = "Rewise", module_description = "" }) => {
13982
+ const { showAuthModal, setShowAuthModal } = useSession();
13983
+ const primaryMenuItems = [
13984
+ { id: "home", label: "Home", path: "/workspace/", icon: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_lucide_react65.HomeIcon, { className: "w-4 h-4" }) },
13985
+ { id: "task-pilot", label: "Task Pilot", path: "/workspace/task-pilot", icon: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_lucide_react65.Workflow, { className: "w-4 h-4" }) },
13986
+ { id: "proculink", label: "ProcuLink", path: "/workspace/proculink", icon: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_lucide_react65.TrendingUp, { className: "w-4 h-4" }) },
13987
+ { id: "fixitnow", label: "Fix It Now", path: "/workspace/fix-it-now", icon: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_lucide_react65.SettingsIcon, { className: "w-4 h-4" }) },
13988
+ { id: "hr-connect", label: "HR Connect", path: "/workspace/hr-connect", icon: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_lucide_react65.UserCog, { className: "w-4 h-4" }) },
13989
+ { id: "meeting-hub", label: "Meeting Hub", path: "/workspace/meeting-hub", icon: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_lucide_react65.Calendar, { className: "w-4 h-4" }) },
13990
+ { id: "budget", label: "Budget", icon: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_lucide_react65.CircleDollarSign, { className: "w-4 h-4" }) },
13991
+ { id: "chat-equipe", label: "Chat Equipe", path: "/workspace/chat-equipe", icon: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_lucide_react65.MessageCircle, { className: "w-4 h-4" }) },
13992
+ { id: "actifs", label: "Actifs", path: "/workspace/actifs", icon: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_lucide_react65.Building2, { className: "w-4 h-4" }) },
13993
+ { id: "planning", label: "Planning", path: "/workspace/planning", icon: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_lucide_react65.CalendarClock, { className: "w-4 h-4" }) }
13994
+ ];
13995
+ const secondaryMenuItems = {
13996
+ budget: [
13997
+ { id: "opex", label: "OPEX", path: "budget/opex", icon: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_lucide_react65.Eye, { className: "w-4 h-4" }) },
13998
+ { id: "capex", label: "CAPEX", path: "budget/capex", icon: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_lucide_react65.Eye, { className: "w-4 h-4" }) },
13999
+ { id: "car", label: "CAR", path: "budget/car", icon: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_lucide_react65.Eye, { className: "w-4 h-4" }) }
14000
+ ]
14001
+ };
14002
+ return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(ModernDoubleSidebarLayout_default, { module_name, module_description, primaryMenuItems, secondaryMenuItems, children: /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(import_react_router_dom21.Routes, { children: [
14003
+ /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_react_router_dom21.Route, { path: "workspace", element: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(WorkSpace_default, {}) }),
14004
+ /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_react_router_dom21.Route, { path: "task-pilot", element: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(TaskPilot_default, {}) }),
14005
+ /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_react_router_dom21.Route, { path: "proculink", element: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(PurchaseRequestsPage, {}) }),
14006
+ /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_react_router_dom21.Route, { path: "hr-connect", element: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(HRConnectPage_default, {}) }),
14007
+ /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_react_router_dom21.Route, { path: "meeting-hub", element: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(MeetingHubPage_default, {}) }),
14008
+ /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_react_router_dom21.Route, { path: "budget/*", element: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(BudgetPage_default, {}) }),
14009
+ /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_react_router_dom21.Route, { path: "chat-equipe", element: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(ChatEquipePage_default, {}) }),
14010
+ /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_react_router_dom21.Route, { path: "actifs", element: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(ActifsPage_default, {}) }),
14011
+ /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_react_router_dom21.Route, { path: "planning", element: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(PlanningPage_default, {}) })
14012
+ ] }) });
14013
+ };
10323
14014
  // Annotate the CommonJS export names for ESM import in node:
10324
14015
  0 && (module.exports = {
10325
14016
  ACCOUNT_TYPE_LABELS,
10326
14017
  AccountServices,
14018
+ AccountingWorkspace,
14019
+ ActifsPage,
10327
14020
  Alert,
10328
14021
  AlertProvider,
10329
14022
  ApprovalAnswerModal,
@@ -10333,9 +14026,14 @@ var formatCurrency = (amount, currency = "XOF", showDecimals = false) => {
10333
14026
  ApprovalWorkflow,
10334
14027
  AuthServices,
10335
14028
  BALANCE_TYPE_LABELS,
14029
+ BudgetPage,
10336
14030
  CHOICES,
14031
+ CardBody,
14032
+ CardHeader,
14033
+ ChatEquipePage,
10337
14034
  ClientServices,
10338
14035
  CountrySelector,
14036
+ CrmWorkspace,
10339
14037
  DataTable,
10340
14038
  DateInput,
10341
14039
  DocumentFooter,
@@ -10343,6 +14041,7 @@ var formatCurrency = (amount, currency = "XOF", showDecimals = false) => {
10343
14041
  EntityFileManager,
10344
14042
  FDrawer,
10345
14043
  FROM_MODULE_CHOICES,
14044
+ FacilityWorkspace,
10346
14045
  FetchApi,
10347
14046
  FileInput,
10348
14047
  FileManager,
@@ -10350,21 +14049,28 @@ var formatCurrency = (amount, currency = "XOF", showDecimals = false) => {
10350
14049
  ForeignCurrencySelector,
10351
14050
  FormClient,
10352
14051
  FormVendor,
14052
+ HRConnectPage,
10353
14053
  InfoBox,
10354
14054
  InputField,
10355
14055
  InvoiceTypeSelector,
10356
14056
  LegalFormSelector,
14057
+ MeetingHubPage,
10357
14058
  MinimalVendorForm,
10358
14059
  Modal,
14060
+ ModernCard,
10359
14061
  NumberInput,
10360
14062
  PRINT_GREEN,
10361
14063
  Pages,
10362
14064
  PaymentMethodSelector,
14065
+ PlanningPage,
10363
14066
  PrimaryButton,
10364
14067
  PrintPreview,
10365
14068
  PrintableDocument,
14069
+ PurchaseRequestsPage,
14070
+ PurchaseWorkspace,
10366
14071
  RewiseLayout,
10367
14072
  SYSCOHADA_CLASSES,
14073
+ SearchableSelect,
10368
14074
  SecondaryButton,
10369
14075
  SelectAccount,
10370
14076
  SelectClient,
@@ -10376,7 +14082,9 @@ var formatCurrency = (amount, currency = "XOF", showDecimals = false) => {
10376
14082
  SelectVendor,
10377
14083
  SessionProvider,
10378
14084
  SignatureSection,
14085
+ StatCard,
10379
14086
  TEMPLATE_FNE_CHOICES,
14087
+ TaskPilot,
10380
14088
  TaxSelector,
10381
14089
  TemplateFNESelector,
10382
14090
  TextInput,
@@ -10387,6 +14095,9 @@ var formatCurrency = (amount, currency = "XOF", showDecimals = false) => {
10387
14095
  UnitServices,
10388
14096
  UserServices,
10389
14097
  VendorServices,
14098
+ WorkSpace,
14099
+ WorkSpaceRoutes,
14100
+ WorkspaceServices,
10390
14101
  fileManagerApi,
10391
14102
  formatCurrency,
10392
14103
  formatDate,