ptechcore_ui 1.0.18 → 1.0.19

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
@@ -34,7 +34,9 @@ __export(index_exports, {
34
34
  ApprovalAnswerModal: () => ApprovalAnswerModal,
35
35
  ApprovalAnswerPage: () => ApprovalAnswerPage,
36
36
  ApprovalPreviewAnswer: () => ApprovalPreviewAnswer_default,
37
+ ApprovalServices: () => ApprovalServices,
37
38
  ApprovalWorkflow: () => ApprovalWorkflow_default,
39
+ AuthServices: () => AuthServices,
38
40
  CHOICES: () => Choices_default,
39
41
  CountrySelector: () => CountrySelector,
40
42
  DateInput: () => DateInput,
@@ -3755,7 +3757,7 @@ var useAlert = () => {
3755
3757
  };
3756
3758
 
3757
3759
  // src/components/common/CommonSelect.tsx
3758
- var import_react63 = require("react");
3760
+ var import_react76 = require("react");
3759
3761
 
3760
3762
  // src/services/VendorServices.ts
3761
3763
  var VENDORS_API_URL = `${API_URL}/accounting/vendors/`;
@@ -3946,14 +3948,59 @@ var import_jsx_runtime80 = require("react/jsx-runtime");
3946
3948
  var import_react59 = require("react");
3947
3949
  var import_jsx_runtime81 = require("react/jsx-runtime");
3948
3950
  var import_jsx_runtime82 = require("react/jsx-runtime");
3949
- var import_react60 = require("react");
3951
+ var import_react_router_dom21 = require("react-router-dom");
3950
3952
  var import_jsx_runtime83 = require("react/jsx-runtime");
3953
+ var import_react60 = __toESM(require("react"), 1);
3954
+ var import_react_router_dom22 = require("react-router-dom");
3955
+ var import_lucide_react36 = require("lucide-react");
3956
+ var import_clsx6 = require("clsx");
3957
+ var import_tailwind_merge6 = require("tailwind-merge");
3958
+ var import_react61 = require("react");
3951
3959
  var import_jsx_runtime84 = require("react/jsx-runtime");
3960
+ var import_react62 = require("react");
3952
3961
  var import_jsx_runtime85 = require("react/jsx-runtime");
3953
- var import_react61 = require("react");
3962
+ var import_react63 = require("react");
3954
3963
  var import_jsx_runtime86 = require("react/jsx-runtime");
3964
+ var import_react64 = require("react");
3955
3965
  var import_jsx_runtime87 = require("react/jsx-runtime");
3966
+ var import_lucide_react37 = require("lucide-react");
3967
+ var import_react_router_dom23 = require("react-router-dom");
3956
3968
  var import_jsx_runtime88 = require("react/jsx-runtime");
3969
+ var import_jsx_runtime89 = require("react/jsx-runtime");
3970
+ var import_react65 = require("react");
3971
+ var import_lucide_react38 = require("lucide-react");
3972
+ var import_jsx_runtime90 = require("react/jsx-runtime");
3973
+ var import_lucide_react39 = require("lucide-react");
3974
+ var import_react66 = require("react");
3975
+ var import_jsx_runtime91 = require("react/jsx-runtime");
3976
+ var import_react67 = require("react");
3977
+ var import_react_router_dom24 = require("react-router-dom");
3978
+ var import_lucide_react40 = require("lucide-react");
3979
+ var import_jsx_runtime92 = require("react/jsx-runtime");
3980
+ var import_react68 = require("react");
3981
+ var import_react69 = require("react");
3982
+ var import_lucide_react41 = require("lucide-react");
3983
+ var import_jsx_runtime93 = require("react/jsx-runtime");
3984
+ var import_lucide_react42 = require("lucide-react");
3985
+ var import_jsx_runtime94 = require("react/jsx-runtime");
3986
+ var import_react70 = require("react");
3987
+ var import_jsx_runtime95 = require("react/jsx-runtime");
3988
+ var import_jsx_runtime96 = require("react/jsx-runtime");
3989
+ var import_react71 = require("react");
3990
+ var import_jsx_runtime97 = require("react/jsx-runtime");
3991
+ var import_jsx_runtime98 = require("react/jsx-runtime");
3992
+ var import_react72 = require("react");
3993
+ var import_jsx_runtime99 = require("react/jsx-runtime");
3994
+ var import_jsx_runtime100 = require("react/jsx-runtime");
3995
+ var import_jsx_runtime101 = require("react/jsx-runtime");
3996
+ var import_react73 = require("react");
3997
+ var import_jsx_runtime102 = require("react/jsx-runtime");
3998
+ var import_jsx_runtime103 = require("react/jsx-runtime");
3999
+ var import_jsx_runtime104 = require("react/jsx-runtime");
4000
+ var import_react74 = require("react");
4001
+ var import_jsx_runtime105 = require("react/jsx-runtime");
4002
+ var import_jsx_runtime106 = require("react/jsx-runtime");
4003
+ var import_jsx_runtime107 = require("react/jsx-runtime");
3957
4004
  var PrimaryButton2 = ({
3958
4005
  loading = false,
3959
4006
  children,
@@ -4049,8 +4096,9 @@ var APPROVAL_API_URL2 = `${API_URL2}/approvals/cases/`;
4049
4096
  var AlertContext2 = (0, import_react22.createContext)(void 0);
4050
4097
  var VENDORS_API_URL2 = `${API_URL2}/accounting/vendors/`;
4051
4098
  var ThemeContext22 = (0, import_react25.createContext)(void 0);
4052
- var ADDRESS_IP22 = "localhost:8000";
4053
- var ADDRESS_IP_URL22 = `http://${ADDRESS_IP22}/`;
4099
+ var chooseEnv22 = localStorage.getItem("env") ?? "prod";
4100
+ var ADDRESS_IP22 = chooseEnv22 === "prod" ? "back.rewise.praeduim-tech.com" : "localhost:8000";
4101
+ var ADDRESS_IP_URL22 = chooseEnv22 === "prod" ? `https://${ADDRESS_IP22}/` : `http://${ADDRESS_IP22}/`;
4054
4102
  var API_URL22 = `${ADDRESS_IP_URL22}api`;
4055
4103
  var API_BASE_URL32 = `${API_URL22}/core/auth/`;
4056
4104
  var SessionContext22 = (0, import_react26.createContext)(void 0);
@@ -4083,22 +4131,38 @@ var USERS_API_URL2222 = `${API_URL2222}/core/users/`;
4083
4131
  var ToastContext2222 = (0, import_react51.createContext)(void 0);
4084
4132
  var APPROVAL_API_URL2222 = `${API_URL2222}/approvals/cases/`;
4085
4133
  var AlertContext2222 = (0, import_react58.createContext)(void 0);
4086
- var URI = `${API_URL222}/core/departments/`;
4087
- var URI2 = `${API_URL222}/accounting/profit-or-cost-center/`;
4088
- var COST_URI = `${API_URL222}/accounting/cost-center/`;
4089
- var PROFIT_URI = `${API_URL222}/accounting/profit-center/`;
4090
- var URI3 = `${API_URL22}/core/departments/`;
4091
- var URI4 = `${API_URL22}/accounting/profit-or-cost-center/`;
4092
- var COST_URI2 = `${API_URL22}/accounting/cost-center/`;
4093
- var PROFIT_URI2 = `${API_URL22}/accounting/profit-center/`;
4094
- var URI5 = `${API_URL2}/core/departments/`;
4095
- var URI6 = `${API_URL2}/accounting/profit-or-cost-center/`;
4096
- var COST_URI3 = `${API_URL2}/accounting/cost-center/`;
4097
- var PROFIT_URI3 = `${API_URL2}/accounting/profit-center/`;
4134
+ var VENDORS_API_URL2222 = `${API_URL2222}/accounting/vendors/`;
4135
+ var ThemeContext22222 = (0, import_react61.createContext)(void 0);
4136
+ var ADDRESS_IP22222 = "localhost:8000";
4137
+ var ADDRESS_IP_URL22222 = `http://${ADDRESS_IP22222}/`;
4138
+ var API_URL22222 = `${ADDRESS_IP_URL22222}api`;
4139
+ var API_BASE_URL32222 = `${API_URL22222}/core/auth/`;
4140
+ var SessionContext22222 = (0, import_react62.createContext)(void 0);
4141
+ var API_BASE_URL222222 = `${API_URL22222}/core/auth/`;
4142
+ var USERS_API_URL22222 = `${API_URL22222}/core/users/`;
4143
+ var ToastContext22222 = (0, import_react63.createContext)(void 0);
4144
+ var APPROVAL_API_URL22222 = `${API_URL22222}/approvals/cases/`;
4145
+ var AlertContext22222 = (0, import_react70.createContext)(void 0);
4146
+ var URI = `${API_URL2222}/core/departments/`;
4147
+ var URI2 = `${API_URL2222}/accounting/profit-or-cost-center/`;
4148
+ var COST_URI = `${API_URL2222}/accounting/cost-center/`;
4149
+ var PROFIT_URI = `${API_URL2222}/accounting/profit-center/`;
4150
+ var URI3 = `${API_URL222}/core/departments/`;
4151
+ var URI4 = `${API_URL222}/accounting/profit-or-cost-center/`;
4152
+ var COST_URI2 = `${API_URL222}/accounting/cost-center/`;
4153
+ var PROFIT_URI2 = `${API_URL222}/accounting/profit-center/`;
4154
+ var URI5 = `${API_URL22}/core/departments/`;
4155
+ var URI6 = `${API_URL22}/accounting/profit-or-cost-center/`;
4156
+ var COST_URI3 = `${API_URL22}/accounting/cost-center/`;
4157
+ var PROFIT_URI3 = `${API_URL22}/accounting/profit-center/`;
4158
+ var URI7 = `${API_URL2}/core/departments/`;
4159
+ var URI8 = `${API_URL2}/accounting/profit-or-cost-center/`;
4160
+ var COST_URI4 = `${API_URL2}/accounting/cost-center/`;
4161
+ var PROFIT_URI4 = `${API_URL2}/accounting/profit-center/`;
4098
4162
 
4099
4163
  // src/components/common/FormVendor.tsx
4100
- var import_react62 = require("react");
4101
- var import_jsx_runtime89 = require("react/jsx-runtime");
4164
+ var import_react75 = require("react");
4165
+ var import_jsx_runtime108 = require("react/jsx-runtime");
4102
4166
  var MinimalVendorForm = ({
4103
4167
  isOpen,
4104
4168
  onClose,
@@ -4107,13 +4171,13 @@ var MinimalVendorForm = ({
4107
4171
  refresh = () => {
4108
4172
  }
4109
4173
  }) => {
4110
- const [formData, setFormData] = (0, import_react62.useState)(object || {
4174
+ const [formData, setFormData] = (0, import_react75.useState)(object || {
4111
4175
  from_module: from ?? null,
4112
4176
  legal_name: "",
4113
4177
  trading_name: ""
4114
4178
  });
4115
- const [errors, setErrors] = (0, import_react62.useState)({});
4116
- const [loading, setLoading] = (0, import_react62.useState)(false);
4179
+ const [errors, setErrors] = (0, import_react75.useState)({});
4180
+ const [loading, setLoading] = (0, import_react75.useState)(false);
4117
4181
  const { token } = useSession();
4118
4182
  const { success, error: showError } = useToast();
4119
4183
  const handleInputChange = (e) => {
@@ -4172,7 +4236,7 @@ var MinimalVendorForm = ({
4172
4236
  }
4173
4237
  };
4174
4238
  if (!isOpen) return null;
4175
- return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
4239
+ return /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
4176
4240
  Modals_default2,
4177
4241
  {
4178
4242
  title: "Ajouter un fournisseur",
@@ -4180,9 +4244,9 @@ var MinimalVendorForm = ({
4180
4244
  description: ``,
4181
4245
  open: isOpen,
4182
4246
  onClose,
4183
- children: /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("form", { onSubmit: handleSubmit, className: "p-", children: [
4184
- /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("div", { className: "space-y-4", children: /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
4185
- /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
4247
+ children: /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)("form", { onSubmit: handleSubmit, className: "p-", children: [
4248
+ /* @__PURE__ */ (0, import_jsx_runtime108.jsx)("div", { className: "space-y-4", children: /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
4249
+ /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
4186
4250
  TextInput2,
4187
4251
  {
4188
4252
  label: "Raison sociale",
@@ -4194,7 +4258,7 @@ var MinimalVendorForm = ({
4194
4258
  onChange: handleInputChange
4195
4259
  }
4196
4260
  ),
4197
- /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
4261
+ /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
4198
4262
  TextInput2,
4199
4263
  {
4200
4264
  label: "Nom commercial",
@@ -4205,8 +4269,8 @@ var MinimalVendorForm = ({
4205
4269
  }
4206
4270
  )
4207
4271
  ] }) }),
4208
- /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { className: "flex justify-between pt-6 mt-8", children: [
4209
- /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
4272
+ /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)("div", { className: "flex justify-between pt-6 mt-8", children: [
4273
+ /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
4210
4274
  "button",
4211
4275
  {
4212
4276
  type: "button",
@@ -4215,7 +4279,7 @@ var MinimalVendorForm = ({
4215
4279
  children: "Annuler"
4216
4280
  }
4217
4281
  ),
4218
- /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
4282
+ /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
4219
4283
  Buttons_default2,
4220
4284
  {
4221
4285
  type: "button",
@@ -4231,43 +4295,43 @@ var MinimalVendorForm = ({
4231
4295
  };
4232
4296
 
4233
4297
  // src/services/DepartmentServices.ts
4234
- var URI7 = `${API_URL}/core/departments/`;
4298
+ var URI9 = `${API_URL}/core/departments/`;
4235
4299
  var DepartmentServices = {
4236
- create: (data) => FetchApi.post(`${URI7}`, data),
4237
- get: (id) => FetchApi.get(`${URI7}${id}/`),
4238
- list: (params) => FetchApi.get(`${URI7}?${new URLSearchParams(params).toString()}`),
4239
- update: (id, data) => FetchApi.put(`${URI7}${id}/`, data),
4240
- delete: (id) => FetchApi.delete(`${URI7}${id}/`)
4300
+ create: (data) => FetchApi.post(`${URI9}`, data),
4301
+ get: (id) => FetchApi.get(`${URI9}${id}/`),
4302
+ list: (params) => FetchApi.get(`${URI9}?${new URLSearchParams(params).toString()}`),
4303
+ update: (id, data) => FetchApi.put(`${URI9}${id}/`, data),
4304
+ delete: (id) => FetchApi.delete(`${URI9}${id}/`)
4241
4305
  };
4242
4306
 
4243
4307
  // src/services/ProfitCostsServices.ts
4244
- var URI8 = `${API_URL}/accounting/profit-or-cost-center/`;
4245
- var COST_URI4 = `${API_URL}/accounting/cost-center/`;
4308
+ var URI10 = `${API_URL}/accounting/profit-or-cost-center/`;
4309
+ var COST_URI5 = `${API_URL}/accounting/cost-center/`;
4246
4310
  var CostServices = {
4247
- create: (data) => FetchApi.post(`${COST_URI4}`, data),
4248
- get: (id) => FetchApi.get(`${COST_URI4}${id}/`),
4249
- list: (params) => FetchApi.get(`${COST_URI4}?${new URLSearchParams(params).toString()}`),
4250
- update: (id, data) => FetchApi.put(`${COST_URI4}${id}/`, data),
4251
- delete: (id) => FetchApi.delete(`${COST_URI4}${id}/`)
4311
+ create: (data) => FetchApi.post(`${COST_URI5}`, data),
4312
+ get: (id) => FetchApi.get(`${COST_URI5}${id}/`),
4313
+ list: (params) => FetchApi.get(`${COST_URI5}?${new URLSearchParams(params).toString()}`),
4314
+ update: (id, data) => FetchApi.put(`${COST_URI5}${id}/`, data),
4315
+ delete: (id) => FetchApi.delete(`${COST_URI5}${id}/`)
4252
4316
  };
4253
- var PROFIT_URI4 = `${API_URL}/accounting/profit-center/`;
4317
+ var PROFIT_URI5 = `${API_URL}/accounting/profit-center/`;
4254
4318
 
4255
4319
  // src/components/common/CommonSelect.tsx
4256
- var import_jsx_runtime90 = require("react/jsx-runtime");
4320
+ var import_jsx_runtime109 = require("react/jsx-runtime");
4257
4321
  var SelectVendor = ({
4258
4322
  value,
4259
4323
  onSelect
4260
4324
  }) => {
4261
- const [showModal, setShowModal] = (0, import_react63.useState)(false);
4262
- const [selectedVendor, setSelectedVendor] = (0, import_react63.useState)(null);
4325
+ const [showModal, setShowModal] = (0, import_react76.useState)(false);
4326
+ const [selectedVendor, setSelectedVendor] = (0, import_react76.useState)(null);
4263
4327
  const { token, activeBusinessEntity } = useSession();
4264
- const [vendors, setVendors] = (0, import_react63.useState)(() => {
4328
+ const [vendors, setVendors] = (0, import_react76.useState)(() => {
4265
4329
  const cacheKey = `vendors_cache_${activeBusinessEntity?.id || "default"}`;
4266
4330
  const cached = sessionStorage.getItem(cacheKey);
4267
4331
  return cached ? JSON.parse(cached) : [];
4268
4332
  });
4269
- const [loadingVendors, setLoadingVendors] = (0, import_react63.useState)(false);
4270
- (0, import_react63.useEffect)(() => {
4333
+ const [loadingVendors, setLoadingVendors] = (0, import_react76.useState)(false);
4334
+ (0, import_react76.useEffect)(() => {
4271
4335
  const cacheKey = `vendors_cache_${activeBusinessEntity?.id || "default"}`;
4272
4336
  const cached = sessionStorage.getItem(cacheKey);
4273
4337
  if (!cached) {
@@ -4305,9 +4369,9 @@ var SelectVendor = ({
4305
4369
  sessionStorage.removeItem(cacheKey);
4306
4370
  loadVendors();
4307
4371
  };
4308
- return /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { children: [
4309
- /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("div", { className: "flex justify-between ", children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Ajouter un fournisseur" }) }),
4310
- /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
4372
+ return /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)("div", { children: [
4373
+ /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("div", { className: "flex justify-between ", children: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Ajouter un fournisseur" }) }),
4374
+ /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
4311
4375
  SearchableSelect,
4312
4376
  {
4313
4377
  value,
@@ -4323,8 +4387,8 @@ var SelectVendor = ({
4323
4387
  },
4324
4388
  "fourni" + value
4325
4389
  ),
4326
- loadingVendors && /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("p", { className: "text-sm text-gray-500 mt-2", children: "Chargement des fournisseurs..." }),
4327
- showModal && /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
4390
+ loadingVendors && /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("p", { className: "text-sm text-gray-500 mt-2", children: "Chargement des fournisseurs..." }),
4391
+ showModal && /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
4328
4392
  MinimalVendorForm,
4329
4393
  {
4330
4394
  object: selectedVendor,
@@ -4341,13 +4405,13 @@ var SelectUser = ({
4341
4405
  onSelect
4342
4406
  }) => {
4343
4407
  const { token, activeBusinessEntity } = useSession();
4344
- const [users, setUsers] = (0, import_react63.useState)(() => {
4408
+ const [users, setUsers] = (0, import_react76.useState)(() => {
4345
4409
  const cacheKey = `users_cache_${activeBusinessEntity?.id || "default"}`;
4346
4410
  const cached = sessionStorage.getItem(cacheKey);
4347
4411
  return cached ? JSON.parse(cached) : [];
4348
4412
  });
4349
- const [loading, setLoading] = (0, import_react63.useState)(false);
4350
- (0, import_react63.useEffect)(() => {
4413
+ const [loading, setLoading] = (0, import_react76.useState)(false);
4414
+ (0, import_react76.useEffect)(() => {
4351
4415
  const cacheKey = `users_cache_${activeBusinessEntity?.id || "default"}`;
4352
4416
  const cached = sessionStorage.getItem(cacheKey);
4353
4417
  if (!cached) {
@@ -4383,19 +4447,19 @@ var SelectUser = ({
4383
4447
  return users.map((user) => ({
4384
4448
  value: user.id,
4385
4449
  label: `${user.first_name} ${user.last_name}`,
4386
- content: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("div", { className: "flex items-center space-x-3", children: /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: "flex-1", children: [
4387
- /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: "font-medium text-gray-900", children: [
4450
+ content: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("div", { className: "flex items-center space-x-3", children: /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)("div", { className: "flex-1", children: [
4451
+ /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)("div", { className: "font-medium text-gray-900", children: [
4388
4452
  user.first_name,
4389
4453
  " ",
4390
4454
  user.last_name
4391
4455
  ] }),
4392
- /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("div", { className: "text-sm text-gray-500", children: user.email })
4456
+ /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("div", { className: "text-sm text-gray-500", children: user.email })
4393
4457
  ] }) })
4394
4458
  }));
4395
4459
  };
4396
- return /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { children: [
4397
- /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("div", { className: "flex justify-between ", children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "S\xE9lectionner un utilisateur" }) }),
4398
- /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
4460
+ return /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)("div", { children: [
4461
+ /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("div", { className: "flex justify-between ", children: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "S\xE9lectionner un utilisateur" }) }),
4462
+ /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
4399
4463
  SearchableSelect,
4400
4464
  {
4401
4465
  value,
@@ -4408,7 +4472,7 @@ var SelectUser = ({
4408
4472
  },
4409
4473
  "user" + value
4410
4474
  ),
4411
- loading && /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("p", { className: "text-sm text-gray-500 mt-2", children: "Chargement des utilisateurs..." })
4475
+ loading && /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("p", { className: "text-sm text-gray-500 mt-2", children: "Chargement des utilisateurs..." })
4412
4476
  ] });
4413
4477
  };
4414
4478
  var SelectDepartment = ({
@@ -4416,13 +4480,13 @@ var SelectDepartment = ({
4416
4480
  onSelect
4417
4481
  }) => {
4418
4482
  const { token, activeBusinessEntity } = useSession();
4419
- const [departments, setDepartments] = (0, import_react63.useState)(() => {
4483
+ const [departments, setDepartments] = (0, import_react76.useState)(() => {
4420
4484
  const cacheKey = `departments_cache_${activeBusinessEntity?.id || "default"}`;
4421
4485
  const cached = sessionStorage.getItem(cacheKey);
4422
4486
  return cached ? JSON.parse(cached) : [];
4423
4487
  });
4424
- const [loading, setLoading] = (0, import_react63.useState)(false);
4425
- (0, import_react63.useEffect)(() => {
4488
+ const [loading, setLoading] = (0, import_react76.useState)(false);
4489
+ (0, import_react76.useEffect)(() => {
4426
4490
  const cacheKey = `departments_cache_${activeBusinessEntity?.id || "default"}`;
4427
4491
  const cached = sessionStorage.getItem(cacheKey);
4428
4492
  if (!cached) {
@@ -4458,9 +4522,9 @@ var SelectDepartment = ({
4458
4522
  label: dept.name
4459
4523
  }));
4460
4524
  };
4461
- return /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { children: [
4462
- /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("div", { className: "flex justify-between ", children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "S\xE9lectionner un d\xE9partement" }) }),
4463
- /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
4525
+ return /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)("div", { children: [
4526
+ /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("div", { className: "flex justify-between ", children: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "S\xE9lectionner un d\xE9partement" }) }),
4527
+ /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
4464
4528
  SearchableSelect,
4465
4529
  {
4466
4530
  value,
@@ -4473,7 +4537,7 @@ var SelectDepartment = ({
4473
4537
  },
4474
4538
  "dept" + value
4475
4539
  ),
4476
- loading && /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("p", { className: "text-sm text-gray-500 mt-2", children: "Chargement des d\xE9partements..." })
4540
+ loading && /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("p", { className: "text-sm text-gray-500 mt-2", children: "Chargement des d\xE9partements..." })
4477
4541
  ] });
4478
4542
  };
4479
4543
  var SelectCostCenter = ({
@@ -4481,13 +4545,13 @@ var SelectCostCenter = ({
4481
4545
  onSelect
4482
4546
  }) => {
4483
4547
  const { token, activeBusinessEntity } = useSession();
4484
- const [costCenters, setCostCenters] = (0, import_react63.useState)(() => {
4548
+ const [costCenters, setCostCenters] = (0, import_react76.useState)(() => {
4485
4549
  const cacheKey = `cost_centers_cache_${activeBusinessEntity?.id || "default"}`;
4486
4550
  const cached = sessionStorage.getItem(cacheKey);
4487
4551
  return cached ? JSON.parse(cached) : [];
4488
4552
  });
4489
- const [loading, setLoading] = (0, import_react63.useState)(false);
4490
- (0, import_react63.useEffect)(() => {
4553
+ const [loading, setLoading] = (0, import_react76.useState)(false);
4554
+ (0, import_react76.useEffect)(() => {
4491
4555
  const cacheKey = `cost_centers_cache_${activeBusinessEntity?.id || "default"}`;
4492
4556
  const cached = sessionStorage.getItem(cacheKey);
4493
4557
  if (!cached) {
@@ -4521,18 +4585,18 @@ var SelectCostCenter = ({
4521
4585
  return costCenters.map((center) => ({
4522
4586
  value: center.id,
4523
4587
  label: `${center.code ? `[${center.code}] ` : ""}${center.name}`,
4524
- content: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("div", { className: "flex items-center space-x-3", children: /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: "flex-1", children: [
4525
- /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("div", { className: "font-medium text-gray-900", children: center.name }),
4526
- center.code && /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: "text-sm text-gray-500", children: [
4588
+ content: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("div", { className: "flex items-center space-x-3", children: /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)("div", { className: "flex-1", children: [
4589
+ /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("div", { className: "font-medium text-gray-900", children: center.name }),
4590
+ center.code && /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)("div", { className: "text-sm text-gray-500", children: [
4527
4591
  "Code: ",
4528
4592
  center.code
4529
4593
  ] })
4530
4594
  ] }) })
4531
4595
  }));
4532
4596
  };
4533
- return /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { children: [
4534
- /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("div", { className: "flex justify-between ", children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "S\xE9lectionner un centre de co\xFBt" }) }),
4535
- /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
4597
+ return /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)("div", { children: [
4598
+ /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("div", { className: "flex justify-between ", children: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "S\xE9lectionner un centre de co\xFBt" }) }),
4599
+ /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
4536
4600
  SearchableSelect,
4537
4601
  {
4538
4602
  value,
@@ -4545,12 +4609,12 @@ var SelectCostCenter = ({
4545
4609
  },
4546
4610
  "cost" + value
4547
4611
  ),
4548
- loading && /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("p", { className: "text-sm text-gray-500 mt-2", children: "Chargement des centres de co\xFBt..." })
4612
+ loading && /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("p", { className: "text-sm text-gray-500 mt-2", children: "Chargement des centres de co\xFBt..." })
4549
4613
  ] });
4550
4614
  };
4551
4615
 
4552
4616
  // src/components/common/Choices.tsx
4553
- var import_jsx_runtime91 = require("react/jsx-runtime");
4617
+ var import_jsx_runtime110 = require("react/jsx-runtime");
4554
4618
  var CHOICES = {
4555
4619
  INVOICE_TYPES: [
4556
4620
  { value: "sale", label: { fr: "Vente", en: "Sale", default: "Sale" } },
@@ -4808,7 +4872,7 @@ var InvoiceTypeSelector = ({
4808
4872
  value: item.value,
4809
4873
  label: item.label[language]
4810
4874
  }));
4811
- return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
4875
+ return /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(
4812
4876
  SearchableSelect,
4813
4877
  {
4814
4878
  value,
@@ -4831,7 +4895,7 @@ var PaymentMethodSelector = ({
4831
4895
  value: item.value,
4832
4896
  label: item.label[language]
4833
4897
  }));
4834
- return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
4898
+ return /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(
4835
4899
  SearchableSelect,
4836
4900
  {
4837
4901
  value,
@@ -4854,7 +4918,7 @@ var TemplateFNESelector = ({
4854
4918
  value: item.value,
4855
4919
  label: item.label[language]
4856
4920
  }));
4857
- return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
4921
+ return /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(
4858
4922
  SearchableSelect,
4859
4923
  {
4860
4924
  value,
@@ -4877,7 +4941,7 @@ var ForeignCurrencySelector = ({
4877
4941
  value: item.value,
4878
4942
  label: item.label[language]
4879
4943
  }));
4880
- return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
4944
+ return /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(
4881
4945
  SearchableSelect,
4882
4946
  {
4883
4947
  value,
@@ -4901,7 +4965,7 @@ var TaxSelector = ({
4901
4965
  value: item.value,
4902
4966
  label: item.label[language]
4903
4967
  }));
4904
- return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
4968
+ return /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(
4905
4969
  SearchableSelect,
4906
4970
  {
4907
4971
  value,
@@ -4929,7 +4993,7 @@ var LegalFormSelector = ({
4929
4993
  value: item.value,
4930
4994
  label: item.label[language] ?? item.label.default
4931
4995
  }));
4932
- return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
4996
+ return /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(
4933
4997
  SearchableSelect,
4934
4998
  {
4935
4999
  value,
@@ -4952,7 +5016,7 @@ var CountrySelector = ({
4952
5016
  value: item.value,
4953
5017
  label: item.label[language]
4954
5018
  }));
4955
- return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
5019
+ return /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(
4956
5020
  SearchableSelect,
4957
5021
  {
4958
5022
  value,
@@ -4972,7 +5036,9 @@ var CountrySelector = ({
4972
5036
  ApprovalAnswerModal,
4973
5037
  ApprovalAnswerPage,
4974
5038
  ApprovalPreviewAnswer,
5039
+ ApprovalServices,
4975
5040
  ApprovalWorkflow,
5041
+ AuthServices,
4976
5042
  CHOICES,
4977
5043
  CountrySelector,
4978
5044
  DateInput,