@fctc/interface-logic 4.2.6 → 4.2.8

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/hooks.mjs CHANGED
@@ -1616,9 +1616,9 @@ function applyBinaryOp(ast, context) {
1616
1616
  var DICT = {
1617
1617
  get(...args) {
1618
1618
  const { key, defValue } = parseArgs(args, ["key", "defValue"]);
1619
- const self = this;
1620
- if (key in self) {
1621
- return self[key];
1619
+ const self2 = this;
1620
+ if (key in self2) {
1621
+ return self2[key];
1622
1622
  } else if (defValue !== void 0) {
1623
1623
  return defValue;
1624
1624
  }
@@ -2254,7 +2254,8 @@ var initialState2 = {
2254
2254
  allowed_company_ids: [],
2255
2255
  lang: "vi_VN",
2256
2256
  tz: "Asia/Saigon"
2257
- }
2257
+ },
2258
+ isLocalMode: false
2258
2259
  };
2259
2260
  var envSlice = createSlice2({
2260
2261
  name: "env",
@@ -5796,7 +5797,220 @@ var handleClosingSessionService = (env) => {
5796
5797
 
5797
5798
  // src/services/pos-service/load-data-pos-session.ts
5798
5799
  import { useCallback as useCallback32 } from "react";
5800
+
5801
+ // src/services/filesystem-service/file-service.ts
5802
+ import { Directory, Encoding, Filesystem } from "@capacitor/filesystem";
5803
+ var fileService = {
5804
+ async read(path) {
5805
+ try {
5806
+ const res = await Filesystem.readFile({
5807
+ path,
5808
+ directory: Directory.Data,
5809
+ encoding: Encoding.UTF8
5810
+ });
5811
+ if (typeof res.data === "string") return res.data;
5812
+ if (res.data instanceof Blob) return await res.data.text();
5813
+ return null;
5814
+ } catch {
5815
+ return null;
5816
+ }
5817
+ },
5818
+ async write(path, data) {
5819
+ await Filesystem.writeFile({
5820
+ path,
5821
+ data,
5822
+ directory: Directory.Data,
5823
+ encoding: Encoding.UTF8,
5824
+ recursive: true
5825
+ });
5826
+ },
5827
+ async writeAtomic(path, data) {
5828
+ const tempPath = path + ".tmp";
5829
+ await Filesystem.writeFile({
5830
+ path: tempPath,
5831
+ data,
5832
+ directory: Directory.Data,
5833
+ encoding: Encoding.UTF8,
5834
+ recursive: true
5835
+ });
5836
+ try {
5837
+ await Filesystem.deleteFile({
5838
+ path,
5839
+ directory: Directory.Data
5840
+ });
5841
+ } catch {
5842
+ }
5843
+ await Filesystem.rename({
5844
+ from: tempPath,
5845
+ to: path,
5846
+ directory: Directory.Data
5847
+ });
5848
+ },
5849
+ async delete(path) {
5850
+ try {
5851
+ await Filesystem.deleteFile({
5852
+ path,
5853
+ directory: Directory.Data
5854
+ });
5855
+ } catch {
5856
+ }
5857
+ },
5858
+ async exists(path) {
5859
+ try {
5860
+ await Filesystem.stat({
5861
+ path,
5862
+ directory: Directory.Data
5863
+ });
5864
+ return true;
5865
+ } catch {
5866
+ return false;
5867
+ }
5868
+ },
5869
+ async mkdir(path) {
5870
+ try {
5871
+ await Filesystem.mkdir({
5872
+ path,
5873
+ directory: Directory.Data,
5874
+ recursive: true
5875
+ });
5876
+ } catch (e) {
5877
+ if (!String(e?.message).includes("Exists")) {
5878
+ throw e;
5879
+ }
5880
+ }
5881
+ },
5882
+ async list(path) {
5883
+ return Filesystem.readdir({
5884
+ path,
5885
+ directory: Directory.Data
5886
+ });
5887
+ },
5888
+ async getUri(path) {
5889
+ return Filesystem.getUri({
5890
+ path,
5891
+ directory: Directory.Data
5892
+ });
5893
+ }
5894
+ };
5895
+
5896
+ // src/services/filesystem-service/json-worker.ts
5897
+ self.addEventListener("message", async (ev) => {
5898
+ const { id, cmd, payload } = ev.data;
5899
+ try {
5900
+ if (cmd === "parse") {
5901
+ const parsed = JSON.parse(payload);
5902
+ self.postMessage({ id, ok: true, result: parsed });
5903
+ } else if (cmd === "stringify") {
5904
+ const str = JSON.stringify(payload);
5905
+ self.postMessage({ id, ok: true, result: str });
5906
+ }
5907
+ } catch (err) {
5908
+ self.postMessage({ id, ok: false, error: err?.message || String(err) });
5909
+ }
5910
+ });
5911
+ function spawnParseWorker(raw) {
5912
+ return new Promise((resolve, reject) => {
5913
+ const worker = new Worker(new URL("./json-worker.ts", import.meta.url), {
5914
+ type: "module"
5915
+ });
5916
+ const id = Math.random().toString(36).slice(2);
5917
+ worker.onmessage = (ev) => {
5918
+ const { ok, result, error } = ev.data;
5919
+ if (ok) {
5920
+ resolve(result);
5921
+ } else {
5922
+ reject(new Error(error));
5923
+ }
5924
+ worker.terminate();
5925
+ };
5926
+ worker.postMessage({ id, cmd: "parse", payload: raw });
5927
+ });
5928
+ }
5929
+ function spawnStringifyWorker(obj) {
5930
+ return new Promise((resolve, reject) => {
5931
+ const worker = new Worker(new URL("./json-worker.ts", import.meta.url), {
5932
+ type: "module"
5933
+ });
5934
+ worker.onmessage = (ev) => {
5935
+ const { ok, result, error } = ev.data;
5936
+ if (ok) resolve(result);
5937
+ else reject(new Error(error));
5938
+ worker.terminate();
5939
+ };
5940
+ worker.postMessage({ cmd: "stringify", payload: obj });
5941
+ });
5942
+ }
5943
+
5944
+ // src/services/filesystem-service/memory-cache.ts
5945
+ var MemoryCache = class {
5946
+ map = /* @__PURE__ */ new Map();
5947
+ get(k) {
5948
+ const e = this.map.get(k);
5949
+ if (!e) return null;
5950
+ if (e.ttl && Date.now() - e.t > e.ttl) {
5951
+ this.map.delete(k);
5952
+ return null;
5953
+ }
5954
+ return e.value;
5955
+ }
5956
+ set(k, v, ttl = 5 * 60 * 1e3) {
5957
+ this.map.set(k, { value: v, t: Date.now(), ttl });
5958
+ }
5959
+ del(k) {
5960
+ this.map.delete(k);
5961
+ }
5962
+ clear() {
5963
+ this.map.clear();
5964
+ }
5965
+ };
5966
+ var memoryCache = new MemoryCache();
5967
+
5968
+ // src/services/filesystem-service/model-loader.ts
5969
+ var MODELS_DIR = "pos/models";
5970
+ var MODELS_META_DIR = "pos/models_meta";
5971
+ async function loadData(includeMeta = true) {
5972
+ const listResult = await fileService.list(MODELS_DIR);
5973
+ if (!listResult || !Array.isArray(listResult.files)) {
5974
+ return {};
5975
+ }
5976
+ const result = {};
5977
+ for (const file of listResult.files) {
5978
+ if (file.type !== "file") continue;
5979
+ if (!file.name.endsWith(".json")) continue;
5980
+ const fileName = file.name;
5981
+ const modelName = fileName.replace(/\.json$/, "");
5982
+ const dataPath = `${MODELS_DIR}/${fileName}`;
5983
+ const metaPath = `${MODELS_META_DIR}/${encodeURIComponent(
5984
+ modelName
5985
+ )}.meta.json`;
5986
+ const rawData = await fileService.read(dataPath);
5987
+ if (!rawData) continue;
5988
+ const parsedData = await spawnParseWorker(rawData);
5989
+ const data = Array.isArray(parsedData) ? parsedData : [];
5990
+ if (!includeMeta) {
5991
+ result[modelName] = { data };
5992
+ continue;
5993
+ }
5994
+ const rawMeta = await fileService.read(metaPath);
5995
+ let fields = [];
5996
+ let relations = {};
5997
+ if (rawMeta) {
5998
+ const parsedMeta = await spawnParseWorker(rawMeta);
5999
+ fields = parsedMeta?.fields ?? [];
6000
+ relations = parsedMeta?.relations ?? {};
6001
+ }
6002
+ result[modelName] = {
6003
+ data,
6004
+ fields,
6005
+ relations
6006
+ };
6007
+ }
6008
+ return result;
6009
+ }
6010
+
6011
+ // src/services/pos-service/load-data-pos-session.ts
5799
6012
  var loadDataPosSessionService = (env) => {
6013
+ const isLocalMode = env?.isLocalMode;
5800
6014
  const loadDataPosSession = useCallback32(
5801
6015
  ({
5802
6016
  model,
@@ -5807,6 +6021,9 @@ var loadDataPosSessionService = (env) => {
5807
6021
  modelsToLoad = [],
5808
6022
  searchParams
5809
6023
  }) => {
6024
+ if (isLocalMode) {
6025
+ return loadData();
6026
+ }
5810
6027
  const jsonData = {
5811
6028
  model,
5812
6029
  method: "load_data" /* LOAD_DATA */,
@@ -5833,7 +6050,7 @@ var loadDataPosSessionService = (env) => {
5833
6050
  service
5834
6051
  );
5835
6052
  },
5836
- [env]
6053
+ [env, isLocalMode]
5837
6054
  );
5838
6055
  return {
5839
6056
  loadDataPosSession
@@ -6166,6 +6383,145 @@ var usePosService = () => {
6166
6383
  return service;
6167
6384
  };
6168
6385
 
6386
+ // src/services/filesystem-service/manifest.ts
6387
+ var MANIFEST_PATH = "pos/manifest.json";
6388
+ var MANIFEST_BAK_PATH = "pos/manifest.bak.json";
6389
+ async function writeManifest(manifest) {
6390
+ const oldRaw = await fileService.read(MANIFEST_PATH);
6391
+ if (oldRaw !== null) {
6392
+ await fileService.writeAtomic(MANIFEST_BAK_PATH, oldRaw);
6393
+ }
6394
+ await fileService.writeAtomic(MANIFEST_PATH, JSON.stringify(manifest));
6395
+ try {
6396
+ await fileService.delete(MANIFEST_BAK_PATH);
6397
+ } catch {
6398
+ }
6399
+ }
6400
+
6401
+ // src/services/filesystem-service/import-snapshot.ts
6402
+ var DATA_DIR = "pos";
6403
+ var MODELS_DIR2 = `${DATA_DIR}/models`;
6404
+ var MODELS_META_DIR2 = `${DATA_DIR}/models_meta`;
6405
+ var importSnapshot = async ({ data, onProgress }) => {
6406
+ onProgress?.(1, "Parsing snapshot");
6407
+ const parsed = await spawnParseWorker(data);
6408
+ const modelNames = Object.keys(parsed);
6409
+ const total = modelNames.length;
6410
+ const manifest = { version: (/* @__PURE__ */ new Date()).toISOString(), models: {} };
6411
+ const TMP_PREFIX = `pos/data/tmp_import_${Date.now()}`;
6412
+ await fileService.writeAtomic(`${TMP_PREFIX}/.marker`, "1");
6413
+ let i = 0;
6414
+ for (const model of modelNames) {
6415
+ i++;
6416
+ onProgress?.(
6417
+ Math.round(i / total * 100),
6418
+ `Processing ${model} (${i}/${total})`
6419
+ );
6420
+ const block = parsed[model];
6421
+ const dataPart = block?.data ?? block ?? [];
6422
+ const fields = block?.fields ?? [];
6423
+ const relations = block?.relations ?? {};
6424
+ const serialized = await spawnStringifyWorker(dataPart);
6425
+ const tmpModelPath = `${TMP_PREFIX}/${encodeURIComponent(model)}.json`;
6426
+ await fileService.writeAtomic(tmpModelPath, serialized);
6427
+ const meta = {
6428
+ fields,
6429
+ relations,
6430
+ count: Array.isArray(dataPart) ? dataPart.length : 0,
6431
+ writtenAt: (/* @__PURE__ */ new Date()).toISOString()
6432
+ };
6433
+ const tmpMetaPath = `${TMP_PREFIX}/${encodeURIComponent(model)}.meta.json`;
6434
+ await fileService.writeAtomic(tmpMetaPath, JSON.stringify(meta));
6435
+ manifest.models[model] = {
6436
+ file: `${MODELS_DIR2}/${encodeURIComponent(model)}.json`,
6437
+ metaFile: `${MODELS_META_DIR2}/${encodeURIComponent(model)}.meta.json`,
6438
+ count: meta.count,
6439
+ updatedAt: meta.writtenAt
6440
+ };
6441
+ }
6442
+ onProgress?.(95, "Committing import (moving files)");
6443
+ for (const model of modelNames) {
6444
+ const tmpModelPath = `${TMP_PREFIX}/${encodeURIComponent(model)}.json`;
6445
+ const finalModelPath = `${MODELS_DIR2}/${encodeURIComponent(model)}.json`;
6446
+ const tmpMetaPath = `${TMP_PREFIX}/${encodeURIComponent(model)}.meta.json`;
6447
+ const finalMetaPath = `${MODELS_META_DIR2}/${encodeURIComponent(
6448
+ model
6449
+ )}.meta.json`;
6450
+ const tmpRaw = await fileService.read(tmpModelPath);
6451
+ if (tmpRaw !== null) await fileService.writeAtomic(finalModelPath, tmpRaw);
6452
+ const tmpMetaRaw = await fileService.read(tmpMetaPath);
6453
+ if (tmpMetaRaw !== null)
6454
+ await fileService.writeAtomic(finalMetaPath, tmpMetaRaw);
6455
+ onProgress?.(
6456
+ 95 + Math.round(
6457
+ (Object.keys(manifest.models).indexOf(model) + 1) / modelNames.length * 5
6458
+ ),
6459
+ `Committed ${model}`
6460
+ );
6461
+ }
6462
+ await writeManifest(manifest);
6463
+ try {
6464
+ for (const model of modelNames) {
6465
+ await fileService.delete(
6466
+ `${TMP_PREFIX}/${encodeURIComponent(model)}.json`
6467
+ );
6468
+ await fileService.delete(
6469
+ `${TMP_PREFIX}/${encodeURIComponent(model)}.meta.json`
6470
+ );
6471
+ }
6472
+ await fileService.delete(`${TMP_PREFIX}/.marker`);
6473
+ } catch (e) {
6474
+ console.log("Failed to cleanup tmp import files:", e);
6475
+ }
6476
+ onProgress?.(100, "Import complete");
6477
+ return manifest;
6478
+ };
6479
+ var import_snapshot_default = importSnapshot;
6480
+
6481
+ // src/services/filesystem-service/init-snapshot.ts
6482
+ var isSnapshotReady = async () => {
6483
+ try {
6484
+ const raw = await fileService.read("pos/manifest.json");
6485
+ if (!raw) return false;
6486
+ const manifest = JSON.parse(raw);
6487
+ if (!manifest.models || typeof manifest.models !== "object") {
6488
+ return false;
6489
+ }
6490
+ const modelEntries = Object.values(manifest.models);
6491
+ if (modelEntries.length === 0) return false;
6492
+ const firstModel = modelEntries[0];
6493
+ if (!firstModel.file) return false;
6494
+ const modelExists = await fileService.exists(firstModel.file);
6495
+ return modelExists;
6496
+ } catch {
6497
+ return false;
6498
+ }
6499
+ };
6500
+ async function initSnapshot(onProgress) {
6501
+ const ready = await isSnapshotReady();
6502
+ if (ready) {
6503
+ console.log("skip initialization.");
6504
+ return;
6505
+ }
6506
+ console.log("initializing from data.json...");
6507
+ const jsonData = await fetch("/data.json").then((r) => r.text());
6508
+ if (!jsonData) {
6509
+ console.error("cannot load data.json");
6510
+ return;
6511
+ }
6512
+ await import_snapshot_default({
6513
+ data: jsonData,
6514
+ onProgress
6515
+ });
6516
+ }
6517
+
6518
+ // src/services/filesystem-service/index.ts
6519
+ var useFileSystemService = () => {
6520
+ return {
6521
+ initSnapshot
6522
+ };
6523
+ };
6524
+
6169
6525
  // src/hooks/auth/use-forgot-password.ts
6170
6526
  var useForgotPassword = () => {
6171
6527
  const { forgotPassword } = useAuthService();
@@ -8139,6 +8495,16 @@ var useUpdateOrderStatus = () => {
8139
8495
  });
8140
8496
  };
8141
8497
  var use_update_order_status_default = useUpdateOrderStatus;
8498
+
8499
+ // src/hooks/pos/use-init-snapshot.ts
8500
+ import { useMutation as useMutation86 } from "@tanstack/react-query";
8501
+ var useInitSnapshot = () => {
8502
+ const fileSystem = useFileSystemService();
8503
+ return useMutation86({
8504
+ mutationFn: fileSystem.initSnapshot
8505
+ });
8506
+ };
8507
+ var use_init_snapshot_default = useInitSnapshot;
8142
8508
  export {
8143
8509
  use_add_entity_default as useAddEntity,
8144
8510
  use_button_default as useButton,
@@ -8212,6 +8578,7 @@ export {
8212
8578
  use_handle_close_session_default as useHandleCloseSession,
8213
8579
  use_handle_closing_detail_session_default as useHandleClosingDetailSession,
8214
8580
  use_handle_closing_session_default as useHandleClosingSession,
8581
+ use_init_snapshot_default as useInitSnapshot,
8215
8582
  use_isvalid_token_default as useIsValidToken,
8216
8583
  use_load_action_default as useLoadAction,
8217
8584
  use_load_data_pos_session_default as useLoadDataPosSession,
@@ -0,0 +1,3 @@
1
+ type ProgressCb = (progress: number, message?: string) => void;
2
+
3
+ export type { ProgressCb as P };
@@ -0,0 +1,3 @@
1
+ type ProgressCb = (progress: number, message?: string) => void;
2
+
3
+ export type { ProgressCb as P };
@@ -1,11 +1,12 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { ReactNode } from 'react';
3
3
  import { L as LocalStorageUtilsType } from './local-storage-BPvoMGYJ.mjs';
4
- import { useForgotPassword, useForgotPasswordSSO, useGetProvider, useIsValidToken, useLoginCredential, useLoginSocial, useResetPassword, useResetPasswordSSO, useUpdatePassword, useLogout, useGetAccessByCode, useValidateActionToken, useGetCompanyInfo, useGetCurrentCompany, useGetListCompany, useExecuteImport, useExportExcel, useGetFieldExport, useGetFileExcel, useParsePreview, useUploadFileExcel, useUploadIdFile, useChangeStatus, useDeleteComment, useGetComment, useGetFormView, useGetImage, useSendComment, useUploadImage, useDelete, useGetAll, useGetConversionRate, useGetCurrency, useGetDetail, useGetFieldOnChange, useGetListMyBankAccount, useModel, useOdooDataTransform, useOnChangeForm, useSave, useGetProfile, useGetUser, useSwitchLocale, useButton, useDuplicateRecord, useGet2FAMethods, useGetActionDetail, useGetCalendar, useGetGroups, useGetListData, useGetMenu, useGetPrintReport, useGetProGressBar, useGetResequence, useGetSelection, useGetView, useLoadAction, useLoadMessage, usePrint, useRemoveRow, useRunAction, useSignInSSO, useVerify2FA, useGrantAccess, useRemoveTotpSetup, useRequestSetupTotp, useSettingsWebRead2fa, useVerifyTotp, useUploadFile, useCreateEntity, useGetASession, useCreateSession, useDeleteEntity, useGetList, useGetPos, useHandleClosingSession, useManageSession, useUpdateClosedSession, useUpdateEntity, useLoadDataPosSession, useManageOnChange, useGenSerialNumber, useGetOrderLine, useGetProductImage, useAddEntity, useCheckPayment, useHandleCloseSession, useHandleClosingDetailSession, useCreatePosConfig, useSearchJournal, useGetTenantMapping, useGetToken, useGetPreparationDisplayData, useUpdateOrderStatus, useGetThreadData, useGetThreadMessages, useGetExternalTabs, useProcessOrder, useGeneratePaymentQrInfo, useSavePinCode, useGetPinCode, useReadGroup, useGetNotifications, useGetDataChart, useGetVersion, useCreateEInvoice, useGetCurrentUser, useGetWard, useGetCity, useGetCountry, useGetPartnerTitle, useChangeOrderPreparationState } from './hooks.mjs';
4
+ import { useForgotPassword, useForgotPasswordSSO, useGetProvider, useIsValidToken, useLoginCredential, useLoginSocial, useResetPassword, useResetPasswordSSO, useUpdatePassword, useLogout, useGetAccessByCode, useValidateActionToken, useGetCompanyInfo, useGetCurrentCompany, useGetListCompany, useExecuteImport, useExportExcel, useGetFieldExport, useGetFileExcel, useParsePreview, useUploadFileExcel, useUploadIdFile, useChangeStatus, useDeleteComment, useGetComment, useGetFormView, useGetImage, useSendComment, useUploadImage, useDelete, useGetAll, useGetConversionRate, useGetCurrency, useGetDetail, useGetFieldOnChange, useGetListMyBankAccount, useModel, useOdooDataTransform, useOnChangeForm, useSave, useGetProfile, useGetUser, useSwitchLocale, useButton, useDuplicateRecord, useGet2FAMethods, useGetActionDetail, useGetCalendar, useGetGroups, useGetListData, useGetMenu, useGetPrintReport, useGetProGressBar, useGetResequence, useGetSelection, useGetView, useLoadAction, useLoadMessage, usePrint, useRemoveRow, useRunAction, useSignInSSO, useVerify2FA, useGrantAccess, useRemoveTotpSetup, useRequestSetupTotp, useSettingsWebRead2fa, useVerifyTotp, useUploadFile, useCreateEntity, useGetASession, useCreateSession, useDeleteEntity, useGetList, useGetPos, useHandleClosingSession, useManageSession, useUpdateClosedSession, useUpdateEntity, useLoadDataPosSession, useManageOnChange, useGenSerialNumber, useGetOrderLine, useGetProductImage, useAddEntity, useCheckPayment, useHandleCloseSession, useHandleClosingDetailSession, useCreatePosConfig, useSearchJournal, useGetTenantMapping, useGetToken, useGetPreparationDisplayData, useUpdateOrderStatus, useGetThreadData, useGetThreadMessages, useGetExternalTabs, useProcessOrder, useGeneratePaymentQrInfo, useSavePinCode, useGetPinCode, useReadGroup, useGetNotifications, useGetDataChart, useGetVersion, useCreateEInvoice, useGetCurrentUser, useGetWard, useGetCity, useGetCountry, useGetPartnerTitle, useChangeOrderPreparationState, useInitSnapshot } from './hooks.mjs';
5
5
  import '@tanstack/react-query';
6
6
  import './view-type-CfcWWR0w.mjs';
7
7
  import './base-model-type-DD8uZnDP.mjs';
8
8
  import './models.mjs';
9
+ import './import-snapshot-Ds0gqFFm.mjs';
9
10
 
10
11
  declare const MainProvider: ({ children }: {
11
12
  children: ReactNode;
@@ -42,6 +43,7 @@ interface EnvConfig {
42
43
  user?: any;
43
44
  db?: string;
44
45
  refreshTokenEndpoint?: string;
46
+ isLocalMode?: boolean;
45
47
  localStorageUtils?: LocalStorageUtilsType;
46
48
  sessionStorageUtils?: any;
47
49
  envFile?: any;
@@ -179,6 +181,7 @@ interface ServiceContextType {
179
181
  useGetCountry: typeof useGetCountry;
180
182
  useGetPartnerTitle: typeof useGetPartnerTitle;
181
183
  useChangeOrderPreparationState: typeof useChangeOrderPreparationState;
184
+ useInitSnapshot: typeof useInitSnapshot;
182
185
  }
183
186
  declare const ServiceProvider: ({ children, }: {
184
187
  children: React.ReactNode;
@@ -1,11 +1,12 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { ReactNode } from 'react';
3
3
  import { L as LocalStorageUtilsType } from './local-storage-BPvoMGYJ.js';
4
- import { useForgotPassword, useForgotPasswordSSO, useGetProvider, useIsValidToken, useLoginCredential, useLoginSocial, useResetPassword, useResetPasswordSSO, useUpdatePassword, useLogout, useGetAccessByCode, useValidateActionToken, useGetCompanyInfo, useGetCurrentCompany, useGetListCompany, useExecuteImport, useExportExcel, useGetFieldExport, useGetFileExcel, useParsePreview, useUploadFileExcel, useUploadIdFile, useChangeStatus, useDeleteComment, useGetComment, useGetFormView, useGetImage, useSendComment, useUploadImage, useDelete, useGetAll, useGetConversionRate, useGetCurrency, useGetDetail, useGetFieldOnChange, useGetListMyBankAccount, useModel, useOdooDataTransform, useOnChangeForm, useSave, useGetProfile, useGetUser, useSwitchLocale, useButton, useDuplicateRecord, useGet2FAMethods, useGetActionDetail, useGetCalendar, useGetGroups, useGetListData, useGetMenu, useGetPrintReport, useGetProGressBar, useGetResequence, useGetSelection, useGetView, useLoadAction, useLoadMessage, usePrint, useRemoveRow, useRunAction, useSignInSSO, useVerify2FA, useGrantAccess, useRemoveTotpSetup, useRequestSetupTotp, useSettingsWebRead2fa, useVerifyTotp, useUploadFile, useCreateEntity, useGetASession, useCreateSession, useDeleteEntity, useGetList, useGetPos, useHandleClosingSession, useManageSession, useUpdateClosedSession, useUpdateEntity, useLoadDataPosSession, useManageOnChange, useGenSerialNumber, useGetOrderLine, useGetProductImage, useAddEntity, useCheckPayment, useHandleCloseSession, useHandleClosingDetailSession, useCreatePosConfig, useSearchJournal, useGetTenantMapping, useGetToken, useGetPreparationDisplayData, useUpdateOrderStatus, useGetThreadData, useGetThreadMessages, useGetExternalTabs, useProcessOrder, useGeneratePaymentQrInfo, useSavePinCode, useGetPinCode, useReadGroup, useGetNotifications, useGetDataChart, useGetVersion, useCreateEInvoice, useGetCurrentUser, useGetWard, useGetCity, useGetCountry, useGetPartnerTitle, useChangeOrderPreparationState } from './hooks.js';
4
+ import { useForgotPassword, useForgotPasswordSSO, useGetProvider, useIsValidToken, useLoginCredential, useLoginSocial, useResetPassword, useResetPasswordSSO, useUpdatePassword, useLogout, useGetAccessByCode, useValidateActionToken, useGetCompanyInfo, useGetCurrentCompany, useGetListCompany, useExecuteImport, useExportExcel, useGetFieldExport, useGetFileExcel, useParsePreview, useUploadFileExcel, useUploadIdFile, useChangeStatus, useDeleteComment, useGetComment, useGetFormView, useGetImage, useSendComment, useUploadImage, useDelete, useGetAll, useGetConversionRate, useGetCurrency, useGetDetail, useGetFieldOnChange, useGetListMyBankAccount, useModel, useOdooDataTransform, useOnChangeForm, useSave, useGetProfile, useGetUser, useSwitchLocale, useButton, useDuplicateRecord, useGet2FAMethods, useGetActionDetail, useGetCalendar, useGetGroups, useGetListData, useGetMenu, useGetPrintReport, useGetProGressBar, useGetResequence, useGetSelection, useGetView, useLoadAction, useLoadMessage, usePrint, useRemoveRow, useRunAction, useSignInSSO, useVerify2FA, useGrantAccess, useRemoveTotpSetup, useRequestSetupTotp, useSettingsWebRead2fa, useVerifyTotp, useUploadFile, useCreateEntity, useGetASession, useCreateSession, useDeleteEntity, useGetList, useGetPos, useHandleClosingSession, useManageSession, useUpdateClosedSession, useUpdateEntity, useLoadDataPosSession, useManageOnChange, useGenSerialNumber, useGetOrderLine, useGetProductImage, useAddEntity, useCheckPayment, useHandleCloseSession, useHandleClosingDetailSession, useCreatePosConfig, useSearchJournal, useGetTenantMapping, useGetToken, useGetPreparationDisplayData, useUpdateOrderStatus, useGetThreadData, useGetThreadMessages, useGetExternalTabs, useProcessOrder, useGeneratePaymentQrInfo, useSavePinCode, useGetPinCode, useReadGroup, useGetNotifications, useGetDataChart, useGetVersion, useCreateEInvoice, useGetCurrentUser, useGetWard, useGetCity, useGetCountry, useGetPartnerTitle, useChangeOrderPreparationState, useInitSnapshot } from './hooks.js';
5
5
  import '@tanstack/react-query';
6
6
  import './view-type-CfcWWR0w.js';
7
7
  import './base-model-type-DD8uZnDP.js';
8
8
  import './models.js';
9
+ import './import-snapshot-Ds0gqFFm.js';
9
10
 
10
11
  declare const MainProvider: ({ children }: {
11
12
  children: ReactNode;
@@ -42,6 +43,7 @@ interface EnvConfig {
42
43
  user?: any;
43
44
  db?: string;
44
45
  refreshTokenEndpoint?: string;
46
+ isLocalMode?: boolean;
45
47
  localStorageUtils?: LocalStorageUtilsType;
46
48
  sessionStorageUtils?: any;
47
49
  envFile?: any;
@@ -179,6 +181,7 @@ interface ServiceContextType {
179
181
  useGetCountry: typeof useGetCountry;
180
182
  useGetPartnerTitle: typeof useGetPartnerTitle;
181
183
  useChangeOrderPreparationState: typeof useChangeOrderPreparationState;
184
+ useInitSnapshot: typeof useInitSnapshot;
182
185
  }
183
186
  declare const ServiceProvider: ({ children, }: {
184
187
  children: React.ReactNode;