@fctc/interface-logic 1.6.9 → 1.7.2

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.
Files changed (38) hide show
  1. package/dist/{configs.mjs → configs.cjs} +161 -111
  2. package/dist/{configs.d.mts → configs.d.cts} +2 -1
  3. package/dist/configs.d.ts +1 -0
  4. package/dist/configs.js +124 -146
  5. package/dist/{constants.mjs → constants.cjs} +40 -2
  6. package/dist/constants.js +2 -41
  7. package/dist/{environment.mjs → environment.cjs} +2059 -1995
  8. package/dist/environment.d.cts +56 -0
  9. package/dist/environment.d.ts +24 -6
  10. package/dist/environment.js +2126 -2137
  11. package/dist/{hooks.mjs → hooks.cjs} +4023 -3773
  12. package/dist/{hooks.d.mts → hooks.d.cts} +2 -7
  13. package/dist/hooks.d.ts +1 -6
  14. package/dist/hooks.js +3918 -3873
  15. package/dist/{provider.mjs → provider.cjs} +689 -585
  16. package/dist/{provider.d.mts → provider.d.cts} +1 -1
  17. package/dist/provider.d.ts +1 -1
  18. package/dist/provider.js +649 -619
  19. package/dist/{services.mjs → services.cjs} +3835 -3627
  20. package/dist/{services.d.mts → services.d.cts} +1 -2
  21. package/dist/services.d.ts +0 -1
  22. package/dist/services.js +3790 -3668
  23. package/dist/{store.mjs → store.cjs} +149 -33
  24. package/dist/{store.d.mts → store.d.cts} +127 -155
  25. package/dist/store.d.ts +127 -155
  26. package/dist/store.js +44 -134
  27. package/dist/types.cjs +17 -0
  28. package/dist/{types.d.mts → types.d.cts} +1 -1
  29. package/dist/types.js +0 -18
  30. package/dist/{utils.mjs → utils.cjs} +202 -115
  31. package/dist/{utils.d.mts → utils.d.cts} +2 -2
  32. package/dist/utils.d.ts +2 -2
  33. package/dist/utils.js +135 -176
  34. package/package.json +82 -81
  35. package/dist/environment.d.mts +0 -38
  36. package/dist/types.mjs +0 -0
  37. /package/dist/{constants.d.mts → constants.d.cts} +0 -0
  38. /package/dist/{view-type-BGJfDe73.d.mts → view-type-BGJfDe73.d.cts} +0 -0
package/dist/provider.js CHANGED
@@ -1,46 +1,49 @@
1
- "use strict";
2
- var __create = Object.create;
3
1
  var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
7
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __pow = Math.pow;
8
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
9
+ var __spreadValues = (a, b) => {
10
+ for (var prop in b || (b = {}))
11
+ if (__hasOwnProp.call(b, prop))
12
+ __defNormalProp(a, prop, b[prop]);
13
+ if (__getOwnPropSymbols)
14
+ for (var prop of __getOwnPropSymbols(b)) {
15
+ if (__propIsEnum.call(b, prop))
16
+ __defNormalProp(a, prop, b[prop]);
17
+ }
18
+ return a;
11
19
  };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
20
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
21
+ var __async = (__this, __arguments, generator) => {
22
+ return new Promise((resolve, reject) => {
23
+ var fulfilled = (value) => {
24
+ try {
25
+ step(generator.next(value));
26
+ } catch (e) {
27
+ reject(e);
28
+ }
29
+ };
30
+ var rejected = (value) => {
31
+ try {
32
+ step(generator.throw(value));
33
+ } catch (e) {
34
+ reject(e);
35
+ }
36
+ };
37
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
38
+ step((generator = generator.apply(__this, __arguments)).next());
39
+ });
19
40
  };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
-
30
- // src/provider.ts
31
- var provider_exports = {};
32
- __export(provider_exports, {
33
- MainProvider: () => MainProvider,
34
- ReactQueryProvider: () => ReactQueryProvider,
35
- VersionGate: () => VersionGate
36
- });
37
- module.exports = __toCommonJS(provider_exports);
38
41
 
39
42
  // src/provider/react-query-provider.tsx
40
- var import_react_query = require("@tanstack/react-query");
41
- var import_jsx_runtime = require("react/jsx-runtime");
43
+ import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
44
+ import { jsx } from "react/jsx-runtime";
42
45
  var ReactQueryProvider = ({ children }) => {
43
- const queryClient = new import_react_query.QueryClient({
46
+ const queryClient = new QueryClient({
44
47
  defaultOptions: {
45
48
  queries: {
46
49
  // placeholderData: keepPreviousData,
@@ -51,21 +54,21 @@ var ReactQueryProvider = ({ children }) => {
51
54
  }
52
55
  }
53
56
  });
54
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_query.QueryClientProvider, { client: queryClient, children });
57
+ return /* @__PURE__ */ jsx(QueryClientProvider, { client: queryClient, children });
55
58
  };
56
59
 
57
60
  // src/provider/redux-provider.tsx
58
- var import_react_redux2 = require("react-redux");
61
+ import { Provider } from "react-redux";
59
62
 
60
63
  // src/store/index.ts
61
- var import_react_redux = require("react-redux");
64
+ import { useDispatch, useSelector } from "react-redux";
62
65
 
63
66
  // src/store/reducers/breadcrums-slice/index.ts
64
- var import_toolkit = require("@reduxjs/toolkit");
67
+ import { createSlice } from "@reduxjs/toolkit";
65
68
  var initialState = {
66
69
  breadCrumbs: []
67
70
  };
68
- var breadcrumbsSlice = (0, import_toolkit.createSlice)({
71
+ var breadcrumbsSlice = createSlice({
69
72
  name: "breadcrumbs",
70
73
  initialState,
71
74
  reducers: {
@@ -78,16 +81,14 @@ var { setBreadCrumbs } = breadcrumbsSlice.actions;
78
81
  var breadcrums_slice_default = breadcrumbsSlice.reducer;
79
82
 
80
83
  // src/store/reducers/env-slice/index.ts
81
- var import_toolkit2 = require("@reduxjs/toolkit");
84
+ import { createSlice as createSlice2 } from "@reduxjs/toolkit";
82
85
  var initialState2 = {
83
86
  baseUrl: "",
87
+ requests: null,
84
88
  companies: [],
85
89
  user: {},
86
- db: "",
87
- refreshTokenEndpoint: "",
88
90
  config: null,
89
91
  envFile: null,
90
- requests: null,
91
92
  defaultCompany: {
92
93
  id: null,
93
94
  logo: "",
@@ -101,7 +102,7 @@ var initialState2 = {
101
102
  tz: "Asia/Saigon"
102
103
  }
103
104
  };
104
- var envSlice = (0, import_toolkit2.createSlice)({
105
+ var envSlice = createSlice2({
105
106
  name: "env",
106
107
  initialState: initialState2,
107
108
  reducers: {
@@ -148,7 +149,7 @@ var {
148
149
  var env_slice_default = envSlice.reducer;
149
150
 
150
151
  // src/store/reducers/excel-slice/index.ts
151
- var import_toolkit3 = require("@reduxjs/toolkit");
152
+ import { createSlice as createSlice3 } from "@reduxjs/toolkit";
152
153
  var initialState3 = {
153
154
  dataParse: null,
154
155
  idFile: null,
@@ -157,7 +158,7 @@ var initialState3 = {
157
158
  selectedFile: null,
158
159
  errorData: null
159
160
  };
160
- var excelSlice = (0, import_toolkit3.createSlice)({
161
+ var excelSlice = createSlice3({
161
162
  name: "excel",
162
163
  initialState: initialState3,
163
164
  reducers: {
@@ -192,7 +193,7 @@ var {
192
193
  var excel_slice_default = excelSlice.reducer;
193
194
 
194
195
  // src/store/reducers/form-slice/index.ts
195
- var import_toolkit4 = require("@reduxjs/toolkit");
196
+ import { createSlice as createSlice4 } from "@reduxjs/toolkit";
196
197
  var initialState4 = {
197
198
  viewDataStore: {},
198
199
  isShowingModalDetail: false,
@@ -202,7 +203,7 @@ var initialState4 = {
202
203
  listSubject: {},
203
204
  dataUser: {}
204
205
  };
205
- var formSlice = (0, import_toolkit4.createSlice)({
206
+ var formSlice = createSlice4({
206
207
  name: "form",
207
208
  initialState: initialState4,
208
209
  reducers: {
@@ -241,15 +242,15 @@ var {
241
242
  var form_slice_default = formSlice.reducer;
242
243
 
243
244
  // src/store/reducers/header-slice/index.ts
244
- var import_toolkit5 = require("@reduxjs/toolkit");
245
- var headerSlice = (0, import_toolkit5.createSlice)({
245
+ import { createSlice as createSlice5 } from "@reduxjs/toolkit";
246
+ var headerSlice = createSlice5({
246
247
  name: "header",
247
248
  initialState: {
248
249
  value: { allowedCompanyIds: [] }
249
250
  },
250
251
  reducers: {
251
252
  setHeader: (state, action) => {
252
- state.value = { ...state.value, ...action.payload };
253
+ state.value = __spreadValues(__spreadValues({}, state.value), action.payload);
253
254
  },
254
255
  setAllowedCompanyIds: (state, action) => {
255
256
  state.value.allowedCompanyIds = action.payload;
@@ -260,7 +261,7 @@ var { setAllowedCompanyIds, setHeader } = headerSlice.actions;
260
261
  var header_slice_default = headerSlice.reducer;
261
262
 
262
263
  // src/store/reducers/list-slice/index.ts
263
- var import_toolkit6 = require("@reduxjs/toolkit");
264
+ import { createSlice as createSlice6 } from "@reduxjs/toolkit";
264
265
  var initialState5 = {
265
266
  pageLimit: 10,
266
267
  fields: {},
@@ -274,7 +275,7 @@ var initialState5 = {
274
275
  page: 0,
275
276
  domainTable: []
276
277
  };
277
- var listSlice = (0, import_toolkit6.createSlice)({
278
+ var listSlice = createSlice6({
278
279
  name: "list",
279
280
  initialState: initialState5,
280
281
  reducers: {
@@ -325,13 +326,13 @@ var {
325
326
  var list_slice_default = listSlice.reducer;
326
327
 
327
328
  // src/store/reducers/login-slice/index.ts
328
- var import_toolkit7 = require("@reduxjs/toolkit");
329
+ import { createSlice as createSlice7 } from "@reduxjs/toolkit";
329
330
  var initialState6 = {
330
331
  db: "",
331
332
  redirectTo: "/",
332
333
  forgotPasswordUrl: "/"
333
334
  };
334
- var loginSlice = (0, import_toolkit7.createSlice)({
335
+ var loginSlice = createSlice7({
335
336
  name: "login",
336
337
  initialState: initialState6,
337
338
  reducers: {
@@ -350,14 +351,14 @@ var { setDb, setRedirectTo, setForgotPasswordUrl } = loginSlice.actions;
350
351
  var login_slice_default = loginSlice.reducer;
351
352
 
352
353
  // src/store/reducers/navbar-slice/index.ts
353
- var import_toolkit8 = require("@reduxjs/toolkit");
354
+ import { createSlice as createSlice8 } from "@reduxjs/toolkit";
354
355
  var initialState7 = {
355
356
  menuFocus: {},
356
357
  menuAction: {},
357
358
  navbarWidth: 250,
358
359
  menuList: []
359
360
  };
360
- var navbarSlice = (0, import_toolkit8.createSlice)({
361
+ var navbarSlice = createSlice8({
361
362
  name: "navbar",
362
363
  initialState: initialState7,
363
364
  reducers: {
@@ -379,11 +380,11 @@ var { setMenuFocus, setMenuFocusAction, setNavbarWidth, setMenuList } = navbarSl
379
380
  var navbar_slice_default = navbarSlice.reducer;
380
381
 
381
382
  // src/store/reducers/profile-slice/index.ts
382
- var import_toolkit9 = require("@reduxjs/toolkit");
383
+ import { createSlice as createSlice9 } from "@reduxjs/toolkit";
383
384
  var initialState8 = {
384
385
  profile: {}
385
386
  };
386
- var profileSlice = (0, import_toolkit9.createSlice)({
387
+ var profileSlice = createSlice9({
387
388
  name: "profile",
388
389
  initialState: initialState8,
389
390
  reducers: {
@@ -396,7 +397,7 @@ var { setProfile } = profileSlice.actions;
396
397
  var profile_slice_default = profileSlice.reducer;
397
398
 
398
399
  // src/store/reducers/search-slice/index.ts
399
- var import_toolkit10 = require("@reduxjs/toolkit");
400
+ import { createSlice as createSlice10 } from "@reduxjs/toolkit";
400
401
  var initialState9 = {
401
402
  groupByDomain: null,
402
403
  searchBy: [],
@@ -408,7 +409,7 @@ var initialState9 = {
408
409
  filterBy: [],
409
410
  groupBy: []
410
411
  };
411
- var searchSlice = (0, import_toolkit10.createSlice)({
412
+ var searchSlice = createSlice10({
412
413
  name: "search",
413
414
  initialState: initialState9,
414
415
  reducers: {
@@ -482,7 +483,7 @@ var {
482
483
  var search_slice_default = searchSlice.reducer;
483
484
 
484
485
  // src/store/store.ts
485
- var import_toolkit11 = require("@reduxjs/toolkit");
486
+ import { configureStore } from "@reduxjs/toolkit";
486
487
 
487
488
  // node_modules/redux/dist/redux.mjs
488
489
  function formatProdErrorMessage(code) {
@@ -666,7 +667,7 @@ var rootReducer = combineReducers({
666
667
  excel: excel_slice_default,
667
668
  profile: profile_slice_default
668
669
  });
669
- var envStore = (0, import_toolkit11.configureStore)({
670
+ var envStore = configureStore({
670
671
  reducer: rootReducer,
671
672
  middleware: (getDefaultMiddleware) => getDefaultMiddleware({
672
673
  serializableCheck: false
@@ -674,26 +675,26 @@ var envStore = (0, import_toolkit11.configureStore)({
674
675
  });
675
676
 
676
677
  // src/provider/redux-provider.tsx
677
- var import_jsx_runtime2 = require("react/jsx-runtime");
678
+ import { jsx as jsx2 } from "react/jsx-runtime";
678
679
  var ReduxProvider = ({ children }) => {
679
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react_redux2.Provider, { store: envStore, children });
680
+ return /* @__PURE__ */ jsx2(Provider, { store: envStore, children });
680
681
  };
681
682
 
682
683
  // src/provider/main-provider.tsx
683
- var import_jsx_runtime3 = require("react/jsx-runtime");
684
+ import { jsx as jsx3 } from "react/jsx-runtime";
684
685
  var MainProvider = ({ children }) => {
685
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ReduxProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ReactQueryProvider, { children }) });
686
+ return /* @__PURE__ */ jsx3(ReduxProvider, { children: /* @__PURE__ */ jsx3(ReactQueryProvider, { children }) });
686
687
  };
687
688
 
688
689
  // src/provider/version-gate-provider.tsx
689
- var import_react2 = require("react");
690
- var import_react_query2 = require("@tanstack/react-query");
690
+ import { useEffect as useEffect2, useState as useState2 } from "react";
691
+ import { useQueryClient } from "@tanstack/react-query";
691
692
 
692
693
  // src/configs/axios-client.ts
693
- var import_axios = __toESM(require("axios"));
694
+ import axios from "axios";
694
695
 
695
696
  // src/utils/format.ts
696
- var import_moment = __toESM(require("moment"));
697
+ import moment from "moment";
697
698
 
698
699
  // src/utils/domain/py_tokenizer.ts
699
700
  var TokenizerError = class extends Error {
@@ -1773,22 +1774,6 @@ var PyRelativeDelta = class _PyRelativeDelta {
1773
1774
  this.microsecond = params.microsecond;
1774
1775
  this.weekday = params.weekday;
1775
1776
  }
1776
- years;
1777
- months;
1778
- days;
1779
- hours;
1780
- minutes;
1781
- seconds;
1782
- microseconds;
1783
- leapDays;
1784
- year;
1785
- month;
1786
- day;
1787
- hour;
1788
- minute;
1789
- second;
1790
- microsecond;
1791
- weekday;
1792
1777
  negate() {
1793
1778
  return new _PyRelativeDelta(this, -1);
1794
1779
  }
@@ -1903,7 +1888,7 @@ function execOnIterable(iterable, func) {
1903
1888
  if (typeof iterable === "object" && !Array.isArray(iterable) && !(iterable instanceof Set)) {
1904
1889
  iterable = Object.keys(iterable);
1905
1890
  }
1906
- if (typeof iterable?.[Symbol.iterator] !== "function") {
1891
+ if (typeof (iterable == null ? void 0 : iterable[Symbol.iterator]) !== "function") {
1907
1892
  throw new EvaluationError("value not iterable");
1908
1893
  }
1909
1894
  return func(iterable);
@@ -2226,7 +2211,7 @@ function applyBinaryOp(ast, context) {
2226
2211
  }
2227
2212
  return Math.floor(left / right);
2228
2213
  case "**":
2229
- return left ** right;
2214
+ return __pow(left, right);
2230
2215
  case "==":
2231
2216
  return isEqual(left, right);
2232
2217
  case "<>":
@@ -2348,7 +2333,7 @@ function evaluate(ast, context = {}) {
2348
2333
  const dicts = /* @__PURE__ */ new Set();
2349
2334
  let pyContext;
2350
2335
  const evalContext = Object.create(context);
2351
- if (!evalContext?.context) {
2336
+ if (!(evalContext == null ? void 0 : evalContext.context)) {
2352
2337
  Object.defineProperty(evalContext, "context", {
2353
2338
  get() {
2354
2339
  if (!pyContext) {
@@ -2359,17 +2344,18 @@ function evaluate(ast, context = {}) {
2359
2344
  });
2360
2345
  }
2361
2346
  function _innerEvaluate(ast2) {
2362
- switch (ast2?.type) {
2347
+ var _a, _b, _c;
2348
+ switch (ast2 == null ? void 0 : ast2.type) {
2363
2349
  case 0:
2364
2350
  // Number
2365
2351
  case 1:
2366
2352
  return ast2.value;
2367
2353
  case 5:
2368
2354
  if (ast2.value in evalContext) {
2369
- if (typeof evalContext[ast2.value] === "object" && evalContext[ast2.value]?.id) {
2370
- return evalContext[ast2.value]?.id;
2355
+ if (typeof evalContext[ast2.value] === "object" && ((_a = evalContext[ast2.value]) == null ? void 0 : _a.id)) {
2356
+ return (_b = evalContext[ast2.value]) == null ? void 0 : _b.id;
2371
2357
  }
2372
- return evalContext[ast2.value] ?? false;
2358
+ return (_c = evalContext[ast2.value]) != null ? _c : false;
2373
2359
  } else if (ast2.value in BUILTINS) {
2374
2360
  return BUILTINS[ast2.value];
2375
2361
  } else {
@@ -2406,7 +2392,7 @@ function evaluate(ast, context = {}) {
2406
2392
  const args = ast2.args.map(_evaluate);
2407
2393
  const kwargs = {};
2408
2394
  for (const kwarg in ast2.kwargs) {
2409
- kwargs[kwarg] = _evaluate(ast2?.kwargs[kwarg]);
2395
+ kwargs[kwarg] = _evaluate(ast2 == null ? void 0 : ast2.kwargs[kwarg]);
2410
2396
  }
2411
2397
  if (fnValue === PyDate || fnValue === PyDateTime || fnValue === PyTime || fnValue === PyRelativeDelta || fnValue === PyTimeDelta) {
2412
2398
  return fnValue.create(...args, kwargs);
@@ -2485,9 +2471,25 @@ function escapeRegExp(str) {
2485
2471
  var InvalidDomainError = class extends Error {
2486
2472
  };
2487
2473
  var Domain = class _Domain {
2488
- ast = { type: -1, value: null };
2489
- static TRUE;
2490
- static FALSE;
2474
+ constructor(descr = []) {
2475
+ this.ast = { type: -1, value: null };
2476
+ if (descr instanceof _Domain) {
2477
+ return new _Domain(descr.toString());
2478
+ } else {
2479
+ let rawAST;
2480
+ try {
2481
+ rawAST = typeof descr === "string" ? parseExpr(descr) : toAST(descr);
2482
+ } catch (error) {
2483
+ throw new InvalidDomainError(
2484
+ `Invalid domain representation: ${descr}`,
2485
+ {
2486
+ cause: error
2487
+ }
2488
+ );
2489
+ }
2490
+ this.ast = normalizeDomainAST(rawAST);
2491
+ }
2492
+ }
2491
2493
  static combine(domains, operator) {
2492
2494
  if (domains.length === 0) {
2493
2495
  return new _Domain([]);
@@ -2566,24 +2568,6 @@ var Domain = class _Domain {
2566
2568
  processLeaf(d.ast.value, 0, "&", newDomain);
2567
2569
  return newDomain;
2568
2570
  }
2569
- constructor(descr = []) {
2570
- if (descr instanceof _Domain) {
2571
- return new _Domain(descr.toString());
2572
- } else {
2573
- let rawAST;
2574
- try {
2575
- rawAST = typeof descr === "string" ? parseExpr(descr) : toAST(descr);
2576
- } catch (error) {
2577
- throw new InvalidDomainError(
2578
- `Invalid domain representation: ${descr}`,
2579
- {
2580
- cause: error
2581
- }
2582
- );
2583
- }
2584
- this.ast = normalizeDomainAST(rawAST);
2585
- }
2586
- }
2587
2571
  contains(record) {
2588
2572
  const expr = evaluate(this.ast, record);
2589
2573
  return matchDomain(record, expr);
@@ -2602,7 +2586,7 @@ var Domain = class _Domain {
2602
2586
  return evaluatedAsList;
2603
2587
  }
2604
2588
  return this.toString();
2605
- } catch {
2589
+ } catch (e) {
2606
2590
  return this.toString();
2607
2591
  }
2608
2592
  }
@@ -2802,7 +2786,7 @@ function matchDomain(record, domain) {
2802
2786
  }
2803
2787
 
2804
2788
  // src/utils/function.ts
2805
- var import_react = require("react");
2789
+ import { useEffect, useState } from "react";
2806
2790
  var updateTokenParamInOriginalRequest = (originalRequest, newAccessToken) => {
2807
2791
  if (!originalRequest.data) return originalRequest.data;
2808
2792
  if (typeof originalRequest.data === "string") {
@@ -2825,22 +2809,22 @@ var updateTokenParamInOriginalRequest = (originalRequest, newAccessToken) => {
2825
2809
 
2826
2810
  // src/utils/storage/local-storage.ts
2827
2811
  var localStorageUtils = () => {
2828
- const setToken = async (access_token) => {
2812
+ const setToken = (access_token) => __async(null, null, function* () {
2829
2813
  localStorage.setItem("accessToken", access_token);
2830
- };
2831
- const setRefreshToken = async (refresh_token) => {
2814
+ });
2815
+ const setRefreshToken = (refresh_token) => __async(null, null, function* () {
2832
2816
  localStorage.setItem("refreshToken", refresh_token);
2833
- };
2834
- const getAccessToken = async () => {
2817
+ });
2818
+ const getAccessToken = () => __async(null, null, function* () {
2835
2819
  return localStorage.getItem("accessToken");
2836
- };
2837
- const getRefreshToken = async () => {
2820
+ });
2821
+ const getRefreshToken = () => __async(null, null, function* () {
2838
2822
  return localStorage.getItem("refreshToken");
2839
- };
2840
- const clearToken = async () => {
2823
+ });
2824
+ const clearToken = () => __async(null, null, function* () {
2841
2825
  localStorage.removeItem("accessToken");
2842
2826
  localStorage.removeItem("refreshToken");
2843
- };
2827
+ });
2844
2828
  return {
2845
2829
  setToken,
2846
2830
  setRefreshToken,
@@ -2852,9 +2836,9 @@ var localStorageUtils = () => {
2852
2836
 
2853
2837
  // src/utils/storage/session-storage.ts
2854
2838
  var sessionStorageUtils = () => {
2855
- const getBrowserSession = async () => {
2839
+ const getBrowserSession = () => __async(null, null, function* () {
2856
2840
  return sessionStorage.getItem("browserSession");
2857
- };
2841
+ });
2858
2842
  return {
2859
2843
  getBrowserSession
2860
2844
  };
@@ -2863,13 +2847,14 @@ var sessionStorageUtils = () => {
2863
2847
  // src/configs/axios-client.ts
2864
2848
  var axiosClient = {
2865
2849
  init(config) {
2866
- const localStorage2 = config.localStorageUtils ?? localStorageUtils();
2867
- const sessionStorage2 = config.sessionStorageUtils ?? sessionStorageUtils();
2850
+ var _a, _b;
2851
+ const localStorage2 = (_a = config.localStorageUtils) != null ? _a : localStorageUtils();
2852
+ const sessionStorage2 = (_b = config.sessionStorageUtils) != null ? _b : sessionStorageUtils();
2868
2853
  const db = config.db;
2869
2854
  let isRefreshing = false;
2870
2855
  let failedQueue = [];
2871
2856
  const processQueue = (error, token = null) => {
2872
- failedQueue?.forEach((prom) => {
2857
+ failedQueue == null ? void 0 : failedQueue.forEach((prom) => {
2873
2858
  if (error) {
2874
2859
  prom.reject(error);
2875
2860
  } else {
@@ -2878,39 +2863,44 @@ var axiosClient = {
2878
2863
  });
2879
2864
  failedQueue = [];
2880
2865
  };
2881
- const instance = import_axios.default.create({
2882
- adapter: import_axios.default.defaults.adapter,
2866
+ const instance = axios.create({
2867
+ adapter: axios.defaults.adapter,
2883
2868
  baseURL: config.baseUrl,
2884
2869
  timeout: 5e4,
2885
2870
  paramsSerializer: (params) => new URLSearchParams(params).toString()
2886
2871
  });
2887
- instance.interceptors.request.use(async (config2) => {
2888
- const { useRefreshToken, useActionToken, actionToken } = config2;
2889
- if (useActionToken && actionToken) {
2890
- config2.headers["Action-Token"] = actionToken;
2872
+ instance.interceptors.request.use(
2873
+ (config2) => __async(null, null, function* () {
2874
+ const useRefreshToken = config2.useRefreshToken;
2875
+ const token = useRefreshToken ? yield localStorage2.getRefreshToken() : yield localStorage2.getAccessToken();
2876
+ if (token) {
2877
+ config2.headers["Authorization"] = "Bearer " + token;
2878
+ }
2879
+ return config2;
2880
+ }),
2881
+ (error) => {
2882
+ Promise.reject(error);
2891
2883
  }
2892
- const getToken = useRefreshToken ? localStorage2.getRefreshToken : localStorage2.getAccessToken;
2893
- const token = await getToken?.();
2894
- if (token) config2.headers["Authorization"] = `Bearer ${token}`;
2895
- return config2;
2896
- }, Promise.reject);
2884
+ );
2897
2885
  instance.interceptors.response.use(
2898
2886
  (response) => {
2899
2887
  return handleResponse(response);
2900
2888
  },
2901
- async (error) => {
2902
- const handleError3 = async (error2) => {
2889
+ (error) => __async(null, null, function* () {
2890
+ var _a2, _b2, _c;
2891
+ const handleError3 = (error2) => __async(null, null, function* () {
2892
+ var _a3;
2903
2893
  if (!error2.response) {
2904
2894
  return error2;
2905
2895
  }
2906
2896
  const { data } = error2.response;
2907
- if (data && data.code === 400 && ["invalid_grant"].includes(data.data?.error)) {
2908
- await clearAuthToken();
2897
+ if (data && data.code === 400 && ["invalid_grant"].includes((_a3 = data.data) == null ? void 0 : _a3.error)) {
2898
+ yield clearAuthToken();
2909
2899
  }
2910
2900
  return data;
2911
- };
2901
+ });
2912
2902
  const originalRequest = error.config;
2913
- if ((error.response?.status === 403 || error.response?.status === 401 || error.response?.status === 404) && ["TOKEN_EXPIRED", "AUTHEN_FAIL", 401, "ERR_2FA_006"].includes(
2903
+ if ((((_a2 = error.response) == null ? void 0 : _a2.status) === 403 || ((_b2 = error.response) == null ? void 0 : _b2.status) === 401 || ((_c = error.response) == null ? void 0 : _c.status) === 404) && ["TOKEN_EXPIRED", "AUTHEN_FAIL", 401, "ERR_2FA_006"].includes(
2914
2904
  error.response.data.code
2915
2905
  )) {
2916
2906
  if (isRefreshing) {
@@ -2923,18 +2913,19 @@ var axiosClient = {
2923
2913
  token
2924
2914
  );
2925
2915
  return instance.request(originalRequest);
2926
- }).catch(async (err) => {
2927
- if ((err.response?.status === 400 || err.response?.status === 401) && ["invalid_grant"].includes(err.response.data.error)) {
2928
- await clearAuthToken();
2916
+ }).catch((err) => __async(null, null, function* () {
2917
+ var _a3, _b3;
2918
+ if ((((_a3 = err.response) == null ? void 0 : _a3.status) === 400 || ((_b3 = err.response) == null ? void 0 : _b3.status) === 401) && ["invalid_grant"].includes(err.response.data.error)) {
2919
+ yield clearAuthToken();
2929
2920
  }
2930
- });
2921
+ }));
2931
2922
  }
2932
- const browserSession = await sessionStorage2.getBrowserSession();
2933
- const refreshToken = await localStorage2.getRefreshToken();
2934
- const accessTokenExp = await localStorage2.getAccessToken();
2923
+ const browserSession = yield sessionStorage2.getBrowserSession();
2924
+ const refreshToken = yield localStorage2.getRefreshToken();
2925
+ const accessTokenExp = yield localStorage2.getAccessToken();
2935
2926
  isRefreshing = true;
2936
2927
  if (!refreshToken && (!browserSession || browserSession == "unActive")) {
2937
- await clearAuthToken();
2928
+ yield clearAuthToken();
2938
2929
  } else {
2939
2930
  const payload = Object.fromEntries(
2940
2931
  Object.entries({
@@ -2945,8 +2936,9 @@ var axiosClient = {
2945
2936
  }).filter(([_, value]) => !!value)
2946
2937
  );
2947
2938
  return new Promise(function(resolve) {
2948
- import_axios.default.post(
2949
- `${config.baseUrl}${config.refreshTokenEndpoint ?? "/authentication/oauth2/token" /* AUTH_TOKEN_PATH */}`,
2939
+ var _a3;
2940
+ axios.post(
2941
+ `${config.baseUrl}${(_a3 = config.refreshTokenEndpoint) != null ? _a3 : "/authentication/oauth2/token" /* AUTH_TOKEN_PATH */}`,
2950
2942
  payload,
2951
2943
  {
2952
2944
  headers: {
@@ -2954,11 +2946,11 @@ var axiosClient = {
2954
2946
  Authorization: `Bearer ${accessTokenExp}`
2955
2947
  }
2956
2948
  }
2957
- ).then(async (res) => {
2949
+ ).then((res) => __async(null, null, function* () {
2958
2950
  const data = res.data;
2959
- await localStorage2.setToken(data.access_token);
2960
- await localStorage2.setRefreshToken(data.refresh_token);
2961
- import_axios.default.defaults.headers.common["Authorization"] = "Bearer " + data.access_token;
2951
+ yield localStorage2.setToken(data.access_token);
2952
+ yield localStorage2.setRefreshToken(data.refresh_token);
2953
+ axios.defaults.headers.common["Authorization"] = "Bearer " + data.access_token;
2962
2954
  originalRequest.headers["Authorization"] = "Bearer " + data.access_token;
2963
2955
  originalRequest.data = updateTokenParamInOriginalRequest(
2964
2956
  originalRequest,
@@ -2966,25 +2958,26 @@ var axiosClient = {
2966
2958
  );
2967
2959
  processQueue(null, data.access_token);
2968
2960
  resolve(instance.request(originalRequest));
2969
- }).catch(async (err) => {
2970
- if (err && (err?.error_code === "AUTHEN_FAIL" || err?.error_code === "TOKEN_EXPIRED" || err?.error_code === "TOKEN_INCORRECT" || err?.code === "ERR_BAD_REQUEST") || err?.error_code === "ERR_2FA_006") {
2971
- await clearAuthToken();
2961
+ })).catch((err) => __async(null, null, function* () {
2962
+ var _a4;
2963
+ if (err && ((err == null ? void 0 : err.error_code) === "AUTHEN_FAIL" || (err == null ? void 0 : err.error_code) === "TOKEN_EXPIRED" || (err == null ? void 0 : err.error_code) === "TOKEN_INCORRECT" || (err == null ? void 0 : err.code) === "ERR_BAD_REQUEST") || (err == null ? void 0 : err.error_code) === "ERR_2FA_006") {
2964
+ yield clearAuthToken();
2972
2965
  }
2973
2966
  if (err && err.response) {
2974
- const { error_code } = err.response?.data || {};
2967
+ const { error_code } = ((_a4 = err.response) == null ? void 0 : _a4.data) || {};
2975
2968
  if (error_code === "AUTHEN_FAIL") {
2976
- await clearAuthToken();
2969
+ yield clearAuthToken();
2977
2970
  }
2978
2971
  }
2979
2972
  processQueue(err, null);
2980
- }).finally(() => {
2973
+ })).finally(() => {
2981
2974
  isRefreshing = false;
2982
2975
  });
2983
2976
  });
2984
2977
  }
2985
2978
  }
2986
- return Promise.reject(await handleError3(error));
2987
- }
2979
+ return Promise.reject(yield handleError3(error));
2980
+ })
2988
2981
  );
2989
2982
  const handleResponse = (res) => {
2990
2983
  if (res && res.data) {
@@ -2993,6 +2986,7 @@ var axiosClient = {
2993
2986
  return res;
2994
2987
  };
2995
2988
  const handleError2 = (error) => {
2989
+ var _a2, _b2, _c;
2996
2990
  if (error.isAxiosError && error.code === "ECONNABORTED") {
2997
2991
  console.error("Request Timeout Error:", error);
2998
2992
  return "Request Timeout Error";
@@ -3000,17 +2994,17 @@ var axiosClient = {
3000
2994
  console.error("Network Error:", error);
3001
2995
  return "Network Error";
3002
2996
  } else {
3003
- console.error("Other Error:", error?.response);
3004
- const errorMessage = error?.response?.data?.message || "An error occurred";
3005
- return { message: errorMessage, status: error?.response?.status };
2997
+ console.error("Other Error:", error == null ? void 0 : error.response);
2998
+ const errorMessage = ((_b2 = (_a2 = error == null ? void 0 : error.response) == null ? void 0 : _a2.data) == null ? void 0 : _b2.message) || "An error occurred";
2999
+ return { message: errorMessage, status: (_c = error == null ? void 0 : error.response) == null ? void 0 : _c.status };
3006
3000
  }
3007
3001
  };
3008
- const clearAuthToken = async () => {
3009
- await localStorage2.clearToken();
3002
+ const clearAuthToken = () => __async(null, null, function* () {
3003
+ yield localStorage2.clearToken();
3010
3004
  if (typeof window !== "undefined") {
3011
3005
  window.location.href = `/login`;
3012
3006
  }
3013
- };
3007
+ });
3014
3008
  function formatUrl(url, db2) {
3015
3009
  return url + (db2 ? "?db=" + db2 : "");
3016
3010
  }
@@ -3034,555 +3028,592 @@ var axiosClient = {
3034
3028
  };
3035
3029
 
3036
3030
  // src/environment/EnvStore.ts
3037
- var EnvStore = class {
3038
- baseUrl;
3039
- requests;
3040
- context;
3041
- defaultCompany;
3042
- config;
3043
- companies;
3044
- user;
3045
- db;
3046
- localStorageUtils;
3047
- sessionStorageUtils;
3048
- refreshTokenEndpoint;
3049
- constructor(localStorageUtils2, sessionStorageUtils2) {
3031
+ var _EnvStore = class _EnvStore {
3032
+ constructor(envStore2, localStorageUtils2, sessionStorageUtils2) {
3033
+ this.envStore = envStore2;
3050
3034
  this.localStorageUtils = localStorageUtils2;
3051
3035
  this.sessionStorageUtils = sessionStorageUtils2;
3036
+ this.setup();
3037
+ }
3038
+ static getInstance(envStore2, localStorageUtils2, sessionStorageUtils2) {
3039
+ if (!_EnvStore.instance) {
3040
+ _EnvStore.instance = new _EnvStore(
3041
+ envStore2,
3042
+ localStorageUtils2,
3043
+ sessionStorageUtils2
3044
+ );
3045
+ }
3046
+ return _EnvStore.instance;
3052
3047
  }
3053
3048
  setup() {
3054
- const env2 = envStore.getState().env;
3055
- this.baseUrl = env2?.baseUrl;
3056
- this.context = env2?.context;
3057
- this.defaultCompany = env2?.defaultCompany;
3058
- this.config = env2?.config;
3059
- this.companies = env2?.companies || [];
3060
- this.user = env2?.user;
3061
- this.db = env2?.db;
3062
- this.requests = env2?.requests;
3063
- this.refreshTokenEndpoint = env2?.refreshTokenEndpoint;
3049
+ const env = this.envStore.getState().env;
3050
+ this.baseUrl = env == null ? void 0 : env.baseUrl;
3051
+ this.requests = env == null ? void 0 : env.requests;
3052
+ this.context = env == null ? void 0 : env.context;
3053
+ this.defaultCompany = env == null ? void 0 : env.defaultCompany;
3054
+ this.config = env == null ? void 0 : env.config;
3055
+ this.companies = (env == null ? void 0 : env.companies) || [];
3056
+ this.user = env == null ? void 0 : env.user;
3057
+ this.db = env == null ? void 0 : env.db;
3058
+ this.refreshTokenEndpoint = env == null ? void 0 : env.refreshTokenEndpoint;
3059
+ console.log("Env setup:", this);
3064
3060
  }
3065
3061
  setupEnv(envConfig) {
3066
- let env2 = {
3067
- ...envConfig,
3062
+ const dispatch = this.envStore.dispatch;
3063
+ const env = __spreadProps(__spreadValues({}, envConfig), {
3068
3064
  localStorageUtils: this.localStorageUtils,
3069
3065
  sessionStorageUtils: this.sessionStorageUtils
3070
- };
3071
- const requests = axiosClient.init(env2);
3072
- const dispatch = envStore.dispatch;
3073
- dispatch(
3074
- setEnv({
3075
- ...env2,
3076
- requests
3077
- })
3078
- );
3066
+ });
3067
+ const requests = axiosClient.init(env);
3068
+ dispatch(setEnv(__spreadProps(__spreadValues({}, env), { requests })));
3079
3069
  this.setup();
3080
- return { ...env2, requests };
3081
3070
  }
3082
3071
  setUid(uid) {
3083
- const dispatch = envStore.dispatch;
3072
+ const dispatch = this.envStore.dispatch;
3084
3073
  dispatch(setUid(uid));
3085
3074
  this.setup();
3086
3075
  }
3087
3076
  setLang(lang) {
3088
- const dispatch = envStore.dispatch;
3077
+ const dispatch = this.envStore.dispatch;
3089
3078
  dispatch(setLang(lang));
3090
3079
  this.setup();
3091
3080
  }
3092
3081
  setAllowCompanies(allowCompanies) {
3093
- const dispatch = envStore.dispatch;
3082
+ const dispatch = this.envStore.dispatch;
3094
3083
  dispatch(setAllowCompanies(allowCompanies));
3095
3084
  this.setup();
3096
3085
  }
3097
3086
  setCompanies(companies) {
3098
- const dispatch = envStore.dispatch;
3087
+ const dispatch = this.envStore.dispatch;
3099
3088
  dispatch(setCompanies(companies));
3100
3089
  this.setup();
3101
3090
  }
3102
3091
  setDefaultCompany(company) {
3103
- const dispatch = envStore.dispatch;
3092
+ const dispatch = this.envStore.dispatch;
3104
3093
  dispatch(setDefaultCompany(company));
3105
3094
  this.setup();
3106
3095
  }
3107
3096
  setUserInfo(userInfo) {
3108
- const dispatch = envStore.dispatch;
3097
+ const dispatch = this.envStore.dispatch;
3109
3098
  dispatch(setUser(userInfo));
3110
3099
  this.setup();
3111
3100
  }
3112
3101
  };
3113
- var env = null;
3102
+ _EnvStore.instance = null;
3103
+ var EnvStore = _EnvStore;
3114
3104
  function getEnv() {
3115
- if (!env) env = new EnvStore(localStorageUtils(), sessionStorageUtils());
3116
- return env;
3105
+ const instance = EnvStore.getInstance(envStore);
3106
+ if (!instance) {
3107
+ throw new Error("EnvStore has not been initialized \u2014 call initEnv() first");
3108
+ }
3109
+ return instance;
3117
3110
  }
3118
3111
 
3119
3112
  // src/services/view-service/index.ts
3120
3113
  var ViewService = {
3121
- async getView({
3122
- model,
3123
- views,
3124
- context = {},
3125
- options = {},
3126
- aid
3127
- }) {
3128
- const env2 = getEnv();
3129
- const defaultOptions = {
3130
- load_filters: true,
3131
- toolbar: true,
3132
- action_id: aid
3133
- };
3134
- const jsonDataView = {
3114
+ getView(_0) {
3115
+ return __async(this, arguments, function* ({
3135
3116
  model,
3136
- method: "get_fields_view_v2" /* GET_FIELD_VIEW */,
3137
- kwargs: {
3138
- views,
3139
- options: { ...options, ...defaultOptions }
3140
- },
3141
- with_context: context
3142
- };
3143
- return env2?.requests?.post("/call" /* CALL_PATH */, jsonDataView, {
3144
- headers: {
3145
- "Content-Type": "application/json"
3146
- }
3117
+ views,
3118
+ context = {},
3119
+ options = {},
3120
+ aid
3121
+ }) {
3122
+ var _a;
3123
+ const env = getEnv();
3124
+ const defaultOptions = {
3125
+ load_filters: true,
3126
+ toolbar: true,
3127
+ action_id: aid
3128
+ };
3129
+ const jsonDataView = {
3130
+ model,
3131
+ method: "get_fields_view_v2" /* GET_FIELD_VIEW */,
3132
+ kwargs: {
3133
+ views,
3134
+ options: __spreadValues(__spreadValues({}, options), defaultOptions)
3135
+ },
3136
+ with_context: context
3137
+ };
3138
+ return (_a = env == null ? void 0 : env.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, jsonDataView, {
3139
+ headers: {
3140
+ "Content-Type": "application/json"
3141
+ }
3142
+ });
3147
3143
  });
3148
3144
  },
3149
- async getMenu(context) {
3150
- const env2 = getEnv();
3151
- const jsonData = {
3152
- model: "ir.ui.menu" /* MENU */,
3153
- method: "web_search_read" /* WEB_SEARCH_READ */,
3154
- ids: [],
3155
- with_context: context,
3156
- kwargs: {
3157
- specification: {
3158
- active: {},
3159
- name: {},
3160
- is_display: {},
3161
- sequence: {},
3162
- complete_name: {},
3163
- action: {
3164
- fields: {
3165
- display_name: {},
3166
- type: {},
3167
- binding_view_types: {}
3168
- // res_model: {},
3169
- }
3170
- },
3171
- url_icon: {},
3172
- web_icon: {},
3173
- web_icon_data: {},
3174
- groups_id: {
3175
- fields: {
3176
- full_name: {}
3145
+ getMenu(context) {
3146
+ return __async(this, null, function* () {
3147
+ var _a;
3148
+ const env = getEnv();
3149
+ const jsonData = {
3150
+ model: "ir.ui.menu" /* MENU */,
3151
+ method: "web_search_read" /* WEB_SEARCH_READ */,
3152
+ ids: [],
3153
+ with_context: context,
3154
+ kwargs: {
3155
+ specification: {
3156
+ active: {},
3157
+ name: {},
3158
+ is_display: {},
3159
+ sequence: {},
3160
+ complete_name: {},
3161
+ action: {
3162
+ fields: {
3163
+ display_name: {},
3164
+ type: {},
3165
+ binding_view_types: {}
3166
+ // res_model: {},
3167
+ }
3177
3168
  },
3178
- limit: 40,
3179
- order: ""
3180
- },
3181
- display_name: {},
3182
- child_id: {
3183
- fields: {
3184
- active: {},
3185
- name: {},
3186
- is_display: {},
3187
- sequence: {},
3188
- complete_name: {},
3189
- action: {
3190
- fields: {
3191
- display_name: {},
3192
- type: {},
3193
- binding_view_types: {}
3194
- // res_model: {},
3195
- }
3169
+ url_icon: {},
3170
+ web_icon: {},
3171
+ web_icon_data: {},
3172
+ groups_id: {
3173
+ fields: {
3174
+ full_name: {}
3196
3175
  },
3197
- url_icon: {},
3198
- web_icon: {},
3199
- web_icon_data: {},
3200
- groups_id: {
3201
- fields: {
3202
- full_name: {}
3176
+ limit: 40,
3177
+ order: ""
3178
+ },
3179
+ display_name: {},
3180
+ child_id: {
3181
+ fields: {
3182
+ active: {},
3183
+ name: {},
3184
+ is_display: {},
3185
+ sequence: {},
3186
+ complete_name: {},
3187
+ action: {
3188
+ fields: {
3189
+ display_name: {},
3190
+ type: {},
3191
+ binding_view_types: {}
3192
+ // res_model: {},
3193
+ }
3203
3194
  },
3204
- limit: 40,
3205
- order: ""
3206
- },
3207
- display_name: {},
3208
- child_id: {
3209
- fields: {
3210
- active: {},
3211
- name: {},
3212
- is_display: {},
3213
- sequence: {},
3214
- complete_name: {},
3215
- action: {
3216
- fields: {
3217
- display_name: {},
3218
- type: {},
3219
- binding_view_types: {}
3220
- // res_model: {},
3221
- }
3195
+ url_icon: {},
3196
+ web_icon: {},
3197
+ web_icon_data: {},
3198
+ groups_id: {
3199
+ fields: {
3200
+ full_name: {}
3222
3201
  },
3223
- url_icon: {},
3224
- web_icon: {},
3225
- web_icon_data: {},
3226
- groups_id: {
3227
- fields: {
3228
- full_name: {}
3202
+ limit: 40,
3203
+ order: ""
3204
+ },
3205
+ display_name: {},
3206
+ child_id: {
3207
+ fields: {
3208
+ active: {},
3209
+ name: {},
3210
+ is_display: {},
3211
+ sequence: {},
3212
+ complete_name: {},
3213
+ action: {
3214
+ fields: {
3215
+ display_name: {},
3216
+ type: {},
3217
+ binding_view_types: {}
3218
+ // res_model: {},
3219
+ }
3229
3220
  },
3230
- limit: 40,
3231
- order: ""
3232
- },
3233
- display_name: {},
3234
- child_id: {
3235
- fields: {
3236
- active: {},
3237
- name: {},
3238
- is_display: {},
3239
- sequence: {},
3240
- complete_name: {},
3241
- action: {
3242
- fields: {
3243
- display_name: {},
3244
- type: {},
3245
- binding_view_types: {}
3246
- // res_model: {},
3247
- }
3221
+ url_icon: {},
3222
+ web_icon: {},
3223
+ web_icon_data: {},
3224
+ groups_id: {
3225
+ fields: {
3226
+ full_name: {}
3248
3227
  },
3249
- url_icon: {},
3250
- web_icon: {},
3251
- web_icon_data: {},
3252
- groups_id: {
3253
- fields: {
3254
- full_name: {}
3228
+ limit: 40,
3229
+ order: ""
3230
+ },
3231
+ display_name: {},
3232
+ child_id: {
3233
+ fields: {
3234
+ active: {},
3235
+ name: {},
3236
+ is_display: {},
3237
+ sequence: {},
3238
+ complete_name: {},
3239
+ action: {
3240
+ fields: {
3241
+ display_name: {},
3242
+ type: {},
3243
+ binding_view_types: {}
3244
+ // res_model: {},
3245
+ }
3255
3246
  },
3256
- limit: 40,
3257
- order: ""
3247
+ url_icon: {},
3248
+ web_icon: {},
3249
+ web_icon_data: {},
3250
+ groups_id: {
3251
+ fields: {
3252
+ full_name: {}
3253
+ },
3254
+ limit: 40,
3255
+ order: ""
3256
+ },
3257
+ display_name: {},
3258
+ child_id: {
3259
+ fields: {},
3260
+ limit: 40,
3261
+ order: ""
3262
+ }
3258
3263
  },
3259
- display_name: {},
3260
- child_id: {
3261
- fields: {},
3262
- limit: 40,
3263
- order: ""
3264
- }
3265
- },
3266
- limit: 40,
3267
- order: ""
3268
- }
3269
- },
3270
- limit: 40,
3271
- order: ""
3272
- }
3273
- },
3274
- limit: 40,
3275
- order: ""
3276
- }
3277
- },
3278
- domain: [
3279
- "&",
3280
- ["is_display", "=", true],
3281
- "&",
3282
- ["active", "=", true],
3283
- ["parent_id", "=", false]
3284
- ]
3285
- }
3286
- };
3287
- return env2?.requests?.post("/call" /* CALL_PATH */, jsonData, {
3288
- headers: {
3289
- "Content-Type": "application/json"
3290
- }
3264
+ limit: 40,
3265
+ order: ""
3266
+ }
3267
+ },
3268
+ limit: 40,
3269
+ order: ""
3270
+ }
3271
+ },
3272
+ limit: 40,
3273
+ order: ""
3274
+ }
3275
+ },
3276
+ domain: [
3277
+ "&",
3278
+ ["is_display", "=", true],
3279
+ "&",
3280
+ ["active", "=", true],
3281
+ ["parent_id", "=", false]
3282
+ ]
3283
+ }
3284
+ };
3285
+ return (_a = env == null ? void 0 : env.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, jsonData, {
3286
+ headers: {
3287
+ "Content-Type": "application/json"
3288
+ }
3289
+ });
3291
3290
  });
3292
3291
  },
3293
- async getActionDetail(aid, context) {
3294
- const env2 = getEnv();
3295
- const jsonData = {
3296
- model: "ir.actions.act_window" /* WINDOW_ACTION */,
3297
- method: "web_read" /* WEB_READ */,
3298
- ids: [aid],
3299
- with_context: context,
3300
- kwargs: {
3301
- specification: {
3302
- id: {},
3303
- name: {},
3304
- res_model: {},
3305
- views: {},
3306
- view_mode: {},
3307
- mobile_view_mode: {},
3308
- domain: {},
3309
- context: {},
3310
- groups_id: {},
3311
- search_view_id: {}
3292
+ getActionDetail(aid, context) {
3293
+ return __async(this, null, function* () {
3294
+ var _a;
3295
+ const env = getEnv();
3296
+ const jsonData = {
3297
+ model: "ir.actions.act_window" /* WINDOW_ACTION */,
3298
+ method: "web_read" /* WEB_READ */,
3299
+ ids: [aid],
3300
+ with_context: context,
3301
+ kwargs: {
3302
+ specification: {
3303
+ id: {},
3304
+ name: {},
3305
+ res_model: {},
3306
+ views: {},
3307
+ view_mode: {},
3308
+ mobile_view_mode: {},
3309
+ domain: {},
3310
+ context: {},
3311
+ groups_id: {},
3312
+ search_view_id: {}
3313
+ }
3312
3314
  }
3313
- }
3314
- };
3315
- return env2?.requests?.post("/call" /* CALL_PATH */, jsonData, {
3316
- headers: {
3317
- "Content-Type": "application/json"
3318
- }
3315
+ };
3316
+ return (_a = env == null ? void 0 : env.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, jsonData, {
3317
+ headers: {
3318
+ "Content-Type": "application/json"
3319
+ }
3320
+ });
3319
3321
  });
3320
3322
  },
3321
- async getResequence({
3322
- model,
3323
- ids,
3324
- context,
3325
- offset
3326
- }) {
3327
- const env2 = getEnv();
3328
- const jsonData = {
3323
+ getResequence(_0) {
3324
+ return __async(this, arguments, function* ({
3329
3325
  model,
3330
- with_context: context,
3331
3326
  ids,
3332
- field: "sequence",
3333
- ...offset > 0 ? { offset } : {}
3334
- };
3335
- return env2?.requests.post("/web/dataset/resequence", jsonData, {
3336
- headers: {
3337
- "Content-Type": "application/json"
3338
- }
3327
+ context,
3328
+ offset
3329
+ }) {
3330
+ const env = getEnv();
3331
+ const jsonData = __spreadValues({
3332
+ model,
3333
+ with_context: context,
3334
+ ids,
3335
+ field: "sequence"
3336
+ }, offset > 0 ? { offset } : {});
3337
+ return env == null ? void 0 : env.requests.post("/web/dataset/resequence", jsonData, {
3338
+ headers: {
3339
+ "Content-Type": "application/json"
3340
+ }
3341
+ });
3339
3342
  });
3340
3343
  },
3341
- async getSelectionItem({ data }) {
3342
- const env2 = getEnv();
3343
- const jsonData = {
3344
- model: data.model,
3345
- ids: [],
3346
- method: "get_data_select",
3347
- with_context: data.context,
3348
- kwargs: {
3349
- count_limit: 10001,
3350
- domain: data.domain ? data.domain : [],
3351
- offset: 0,
3352
- order: "",
3353
- specification: data?.specification ?? {
3354
- id: {},
3355
- name: {},
3356
- display_name: {}
3344
+ getSelectionItem(_0) {
3345
+ return __async(this, arguments, function* ({ data }) {
3346
+ var _a;
3347
+ const env = getEnv();
3348
+ const jsonData = {
3349
+ model: data.model,
3350
+ ids: [],
3351
+ method: "get_data_select",
3352
+ with_context: data.context,
3353
+ kwargs: {
3354
+ count_limit: 10001,
3355
+ domain: data.domain ? data.domain : [],
3356
+ offset: 0,
3357
+ order: "",
3358
+ specification: (_a = data == null ? void 0 : data.specification) != null ? _a : {
3359
+ id: {},
3360
+ name: {},
3361
+ display_name: {}
3362
+ }
3357
3363
  }
3358
- }
3359
- };
3360
- return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
3361
- headers: {
3362
- "Content-Type": "application/json"
3363
- }
3364
+ };
3365
+ return env == null ? void 0 : env.requests.post("/call" /* CALL_PATH */, jsonData, {
3366
+ headers: {
3367
+ "Content-Type": "application/json"
3368
+ }
3369
+ });
3370
+ });
3371
+ },
3372
+ loadMessages() {
3373
+ return __async(this, null, function* () {
3374
+ const env = getEnv();
3375
+ return env.requests.post(
3376
+ "/load_message_failures" /* LOAD_MESSAGE */,
3377
+ {},
3378
+ {
3379
+ headers: {
3380
+ "Content-Type": "application/json"
3381
+ }
3382
+ }
3383
+ );
3364
3384
  });
3365
3385
  },
3366
- async loadMessages() {
3367
- const env2 = getEnv();
3368
- return env2.requests.post(
3369
- "/load_message_failures" /* LOAD_MESSAGE */,
3370
- {},
3371
- {
3386
+ getVersion() {
3387
+ return __async(this, null, function* () {
3388
+ var _a;
3389
+ const env = getEnv();
3390
+ console.log("env?.requests", env, env == null ? void 0 : env.requests);
3391
+ return (_a = env == null ? void 0 : env.requests) == null ? void 0 : _a.get("", {
3372
3392
  headers: {
3373
3393
  "Content-Type": "application/json"
3374
3394
  }
3375
- }
3376
- );
3377
- },
3378
- async getVersion() {
3379
- const env2 = getEnv();
3380
- return env2?.requests.get("", {
3381
- headers: {
3382
- "Content-Type": "application/json"
3383
- }
3395
+ });
3384
3396
  });
3385
3397
  },
3386
- async get2FAMethods({
3387
- method,
3388
- with_context
3389
- }) {
3390
- const env2 = getEnv();
3391
- const jsonData = {
3398
+ get2FAMethods(_0) {
3399
+ return __async(this, arguments, function* ({
3392
3400
  method,
3393
3401
  with_context
3394
- };
3395
- return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
3396
- headers: {
3397
- "Content-Type": "application/json"
3398
- }
3402
+ }) {
3403
+ const env = getEnv();
3404
+ const jsonData = {
3405
+ method,
3406
+ with_context
3407
+ };
3408
+ return env == null ? void 0 : env.requests.post("/call" /* CALL_PATH */, jsonData, {
3409
+ headers: {
3410
+ "Content-Type": "application/json"
3411
+ }
3412
+ });
3399
3413
  });
3400
3414
  },
3401
- async verify2FA({
3402
- method,
3403
- with_context,
3404
- code,
3405
- device,
3406
- location
3407
- }) {
3408
- const env2 = getEnv();
3409
- const jsonData = {
3415
+ verify2FA(_0) {
3416
+ return __async(this, arguments, function* ({
3410
3417
  method,
3411
- kwargs: {
3412
- vals: {
3413
- code,
3414
- device,
3415
- location
3416
- }
3417
- },
3418
- with_context
3419
- };
3420
- return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
3421
- headers: {
3422
- "Content-Type": "application/json"
3423
- },
3424
- withCredentials: true
3418
+ with_context,
3419
+ code,
3420
+ device,
3421
+ location
3422
+ }) {
3423
+ const env = getEnv();
3424
+ const jsonData = {
3425
+ method,
3426
+ kwargs: {
3427
+ vals: {
3428
+ code,
3429
+ device,
3430
+ location
3431
+ }
3432
+ },
3433
+ with_context
3434
+ };
3435
+ return env == null ? void 0 : env.requests.post("/call" /* CALL_PATH */, jsonData, {
3436
+ headers: {
3437
+ "Content-Type": "application/json"
3438
+ },
3439
+ withCredentials: true
3440
+ });
3425
3441
  });
3426
3442
  },
3427
- async signInSSO({
3428
- redirect_uri,
3429
- state,
3430
- client_id,
3431
- response_type,
3432
- path
3433
- }) {
3434
- const env2 = getEnv();
3435
- const params = new URLSearchParams({
3436
- response_type,
3437
- client_id,
3443
+ signInSSO(_0) {
3444
+ return __async(this, arguments, function* ({
3438
3445
  redirect_uri,
3439
- state
3440
- });
3441
- const url = `${path}?${params.toString()}`;
3442
- return env2?.requests.get(url, {
3443
- headers: {
3444
- "Content-Type": "application/json"
3445
- },
3446
- withCredentials: true
3446
+ state,
3447
+ client_id,
3448
+ response_type,
3449
+ path
3450
+ }) {
3451
+ const env = getEnv();
3452
+ const params = new URLSearchParams({
3453
+ response_type,
3454
+ client_id,
3455
+ redirect_uri,
3456
+ state
3457
+ });
3458
+ const url = `${path}?${params.toString()}`;
3459
+ return env == null ? void 0 : env.requests.get(url, {
3460
+ headers: {
3461
+ "Content-Type": "application/json"
3462
+ },
3463
+ withCredentials: true
3464
+ });
3447
3465
  });
3448
3466
  },
3449
- async grantAccess({
3450
- redirect_uri,
3451
- state,
3452
- client_id,
3453
- scopes
3454
- }) {
3455
- const env2 = getEnv();
3456
- const jsonData = {
3467
+ grantAccess(_0) {
3468
+ return __async(this, arguments, function* ({
3457
3469
  redirect_uri,
3458
3470
  state,
3459
3471
  client_id,
3460
3472
  scopes
3461
- };
3462
- return env2?.requests.post("/grant-access" /* GRANT_ACCESS */, jsonData, {
3463
- headers: {
3464
- "Content-Type": "application/json"
3465
- },
3466
- withCredentials: true
3473
+ }) {
3474
+ const env = getEnv();
3475
+ const jsonData = {
3476
+ redirect_uri,
3477
+ state,
3478
+ client_id,
3479
+ scopes
3480
+ };
3481
+ return env == null ? void 0 : env.requests.post("/grant-access" /* GRANT_ACCESS */, jsonData, {
3482
+ headers: {
3483
+ "Content-Type": "application/json"
3484
+ },
3485
+ withCredentials: true
3486
+ });
3467
3487
  });
3468
3488
  },
3469
- async getFieldsViewSecurity({
3470
- method,
3471
- token,
3472
- views
3473
- }) {
3474
- const env2 = getEnv();
3475
- const jsonData = {
3489
+ getFieldsViewSecurity(_0) {
3490
+ return __async(this, arguments, function* ({
3476
3491
  method,
3477
- kwargs: {
3478
- views
3479
- },
3480
- with_context: {
3481
- token
3482
- }
3483
- };
3484
- return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
3485
- headers: {
3486
- "Content-Type": "application/json"
3487
- }
3492
+ token,
3493
+ views
3494
+ }) {
3495
+ const env = getEnv();
3496
+ const jsonData = {
3497
+ method,
3498
+ kwargs: {
3499
+ views
3500
+ },
3501
+ with_context: {
3502
+ token
3503
+ }
3504
+ };
3505
+ return env == null ? void 0 : env.requests.post("/call" /* CALL_PATH */, jsonData, {
3506
+ headers: {
3507
+ "Content-Type": "application/json"
3508
+ }
3509
+ });
3488
3510
  });
3489
3511
  },
3490
- async settingsWebRead2fa({
3491
- method,
3492
- model,
3493
- kwargs,
3494
- token
3495
- }) {
3496
- const env2 = getEnv();
3497
- const jsonData = {
3512
+ settingsWebRead2fa(_0) {
3513
+ return __async(this, arguments, function* ({
3498
3514
  method,
3499
3515
  model,
3500
3516
  kwargs,
3501
- with_context: {
3502
- token
3503
- }
3504
- };
3505
- return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
3506
- headers: {
3507
- "Content-Type": "application/json"
3508
- }
3517
+ token
3518
+ }) {
3519
+ const env = getEnv();
3520
+ const jsonData = {
3521
+ method,
3522
+ model,
3523
+ kwargs,
3524
+ with_context: {
3525
+ token
3526
+ }
3527
+ };
3528
+ return env == null ? void 0 : env.requests.post("/call" /* CALL_PATH */, jsonData, {
3529
+ headers: {
3530
+ "Content-Type": "application/json"
3531
+ }
3532
+ });
3509
3533
  });
3510
3534
  },
3511
- async requestSetupTotp({ method, token }) {
3512
- const env2 = getEnv();
3513
- const jsonData = {
3514
- method,
3515
- with_context: {
3516
- token
3517
- }
3518
- };
3519
- return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
3520
- headers: {
3521
- "Content-Type": "application/json"
3522
- }
3535
+ requestSetupTotp(_0) {
3536
+ return __async(this, arguments, function* ({ method, token }) {
3537
+ const env = getEnv();
3538
+ const jsonData = {
3539
+ method,
3540
+ with_context: {
3541
+ token
3542
+ }
3543
+ };
3544
+ return env == null ? void 0 : env.requests.post("/call" /* CALL_PATH */, jsonData, {
3545
+ headers: {
3546
+ "Content-Type": "application/json"
3547
+ }
3548
+ });
3523
3549
  });
3524
3550
  },
3525
- async verifyTotp({
3526
- method,
3527
- action_token,
3528
- code
3529
- }) {
3530
- const env2 = getEnv();
3531
- const jsonData = {
3551
+ verifyTotp(_0) {
3552
+ return __async(this, arguments, function* ({
3532
3553
  method,
3533
- kwargs: {
3534
- vals: {
3535
- code
3554
+ action_token,
3555
+ code
3556
+ }) {
3557
+ const env = getEnv();
3558
+ const jsonData = {
3559
+ method,
3560
+ kwargs: {
3561
+ vals: {
3562
+ code
3563
+ }
3564
+ },
3565
+ with_context: {
3566
+ action_token
3536
3567
  }
3537
- },
3538
- with_context: {
3539
- action_token
3540
- }
3541
- };
3542
- return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
3543
- headers: {
3544
- "Content-Type": "application/json"
3545
- }
3568
+ };
3569
+ return env == null ? void 0 : env.requests.post("/call" /* CALL_PATH */, jsonData, {
3570
+ headers: {
3571
+ "Content-Type": "application/json"
3572
+ }
3573
+ });
3546
3574
  });
3547
3575
  },
3548
- async removeTotpSetUp({ method, token }) {
3549
- const env2 = getEnv();
3550
- const jsonData = {
3551
- method,
3552
- with_context: {
3553
- token
3554
- }
3555
- };
3556
- return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
3557
- headers: {
3558
- "Content-Type": "application/json"
3559
- }
3576
+ removeTotpSetUp(_0) {
3577
+ return __async(this, arguments, function* ({ method, token }) {
3578
+ const env = getEnv();
3579
+ const jsonData = {
3580
+ method,
3581
+ with_context: {
3582
+ token
3583
+ }
3584
+ };
3585
+ return env == null ? void 0 : env.requests.post("/call" /* CALL_PATH */, jsonData, {
3586
+ headers: {
3587
+ "Content-Type": "application/json"
3588
+ }
3589
+ });
3560
3590
  });
3561
3591
  }
3562
3592
  };
3563
3593
  var view_service_default = ViewService;
3564
3594
 
3565
3595
  // src/provider/version-gate-provider.tsx
3566
- var import_jsx_runtime4 = require("react/jsx-runtime");
3596
+ import { Fragment, jsx as jsx4 } from "react/jsx-runtime";
3567
3597
  var VersionGate = ({ children }) => {
3568
- const queryClient = (0, import_react_query2.useQueryClient)();
3569
- const [ready, setReady] = (0, import_react2.useState)(false);
3570
- (0, import_react2.useEffect)(() => {
3598
+ const queryClient = useQueryClient();
3599
+ const [ready, setReady] = useState2(false);
3600
+ useEffect2(() => {
3571
3601
  const clearVersion = () => {
3572
3602
  queryClient.clear();
3573
3603
  localStorage.removeItem("__api_version__");
3574
3604
  };
3575
- const validateVersion = async () => {
3576
- const serverVersion = await view_service_default.getVersion();
3605
+ const validateVersion = () => __async(null, null, function* () {
3606
+ const serverVersion = yield view_service_default.getVersion();
3607
+ console.log("serverVersion", serverVersion);
3577
3608
  const cached = localStorage.getItem("__api_version__");
3578
- if (cached !== serverVersion?.api_version) {
3609
+ if (cached !== (serverVersion == null ? void 0 : serverVersion.api_version)) {
3579
3610
  clearVersion();
3580
- localStorage.setItem("__api_version__", serverVersion?.api_version);
3611
+ localStorage.setItem("__api_version__", serverVersion == null ? void 0 : serverVersion.api_version);
3581
3612
  } else {
3582
- console.log("Api version:", serverVersion?.api_version);
3613
+ console.log("Api version:", serverVersion == null ? void 0 : serverVersion.api_version);
3583
3614
  }
3584
3615
  setReady(true);
3585
- };
3616
+ });
3586
3617
  validateVersion();
3587
3618
  if (typeof window !== "undefined") {
3588
3619
  const onKey = (e) => {
@@ -3594,11 +3625,10 @@ var VersionGate = ({ children }) => {
3594
3625
  return () => window.removeEventListener("keydown", onKey);
3595
3626
  }
3596
3627
  }, [queryClient]);
3597
- return ready ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_jsx_runtime4.Fragment, { children }) : null;
3628
+ return ready ? /* @__PURE__ */ jsx4(Fragment, { children }) : null;
3598
3629
  };
3599
- // Annotate the CommonJS export names for ESM import in node:
3600
- 0 && (module.exports = {
3630
+ export {
3601
3631
  MainProvider,
3602
3632
  ReactQueryProvider,
3603
3633
  VersionGate
3604
- });
3634
+ };