@atomsolution/sdk-merchant 1.8.5 → 1.8.7
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/assets/locales/en/file.json.d.ts +4 -2
- package/dist/assets/locales/vi/file.json.d.ts +4 -2
- package/dist/batch-product-creation.cjs +41 -41
- package/dist/batch-product-creation.cjs.map +1 -1
- package/dist/batch-product-creation.esm.js +41 -41
- package/dist/batch-product-creation.esm.js.map +1 -1
- package/dist/batch-product-creation.js +41 -41
- package/dist/batch-product-creation.js.map +1 -1
- package/dist/digistore/NewAccountCreate/index.d.ts +2 -1
- package/dist/digistore/services/createDigistoreAccountService.d.ts +1 -0
- package/dist/digistore.cjs +64 -59
- package/dist/digistore.cjs.map +1 -1
- package/dist/digistore.esm.js +64 -59
- package/dist/digistore.esm.js.map +1 -1
- package/dist/digistore.js +64 -59
- package/dist/digistore.js.map +1 -1
- package/dist/{dropdownMenuAbsolute-t4SPWS3W.cjs → dropdownMenuAbsolute-BYTyDl09.cjs} +2 -2
- package/dist/{dropdownMenuAbsolute-t4SPWS3W.cjs.map → dropdownMenuAbsolute-BYTyDl09.cjs.map} +1 -1
- package/dist/{dropdownMenuAbsolute-0z-SL48l.js → dropdownMenuAbsolute-CvvI2uRj.js} +2 -2
- package/dist/{dropdownMenuAbsolute-0z-SL48l.js.map → dropdownMenuAbsolute-CvvI2uRj.js.map} +1 -1
- package/dist/merchant-profile.cjs +2 -2
- package/dist/merchant-profile.esm.js +2 -2
- package/dist/merchant-profile.js +2 -2
- package/dist/{use-translation-Dpu_N-4j.js → use-translation-CPJMFAae.js} +13 -5
- package/dist/{use-translation-Dpu_N-4j.js.map → use-translation-CPJMFAae.js.map} +1 -1
- package/dist/{use-translation-Ba-GPTbc.cjs → use-translation-m-_wCmHs.cjs} +13 -5
- package/dist/{use-translation-Ba-GPTbc.cjs.map → use-translation-m-_wCmHs.cjs.map} +1 -1
- package/dist/utils/translations.d.ts +4 -0
- package/package.json +1 -1
|
@@ -53,8 +53,8 @@ var __async = (__this, __arguments, generator) => {
|
|
|
53
53
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
54
54
|
const jsxRuntime = require("./jsx-runtime-DV8UmLi4.cjs");
|
|
55
55
|
const React = require("react");
|
|
56
|
-
const dropdownMenuAbsolute = require("./dropdownMenuAbsolute-
|
|
57
|
-
const useTranslation = require("./use-translation-
|
|
56
|
+
const dropdownMenuAbsolute = require("./dropdownMenuAbsolute-BYTyDl09.cjs");
|
|
57
|
+
const useTranslation = require("./use-translation-m-_wCmHs.cjs");
|
|
58
58
|
const usePortalApiConfig_store = require("./use-portal-api-config.store-C8a2gebE.cjs");
|
|
59
59
|
const axios = require("axios");
|
|
60
60
|
var runtime = { exports: {} };
|
|
@@ -51,8 +51,8 @@ var __async = (__this, __arguments, generator) => {
|
|
|
51
51
|
};
|
|
52
52
|
import { j as jsxRuntimeExports } from "./jsx-runtime-ClP9nxnW.js";
|
|
53
53
|
import { useState, useCallback, useEffect, useMemo, useRef, memo } from "react";
|
|
54
|
-
import { c as commonjsRequire, g as getDefaultExportFromCjs, B as Button, D as DropdownMenu, u as useMediaQuery, T as TableSkeleton, R as ReusableTable, a as DropdownMenuAbsolute } from "./dropdownMenuAbsolute-
|
|
55
|
-
import { u as useTranslation } from "./use-translation-
|
|
54
|
+
import { c as commonjsRequire, g as getDefaultExportFromCjs, B as Button, D as DropdownMenu, u as useMediaQuery, T as TableSkeleton, R as ReusableTable, a as DropdownMenuAbsolute } from "./dropdownMenuAbsolute-CvvI2uRj.js";
|
|
55
|
+
import { u as useTranslation } from "./use-translation-CPJMFAae.js";
|
|
56
56
|
import { u as usePortalApiConfig } from "./use-portal-api-config.store-C1UTTpK9.js";
|
|
57
57
|
import axios from "axios";
|
|
58
58
|
var runtime = { exports: {} };
|
package/dist/merchant-profile.js
CHANGED
|
@@ -51,8 +51,8 @@ var __async = (__this, __arguments, generator) => {
|
|
|
51
51
|
};
|
|
52
52
|
import { j as jsxRuntimeExports } from "./jsx-runtime-ClP9nxnW.js";
|
|
53
53
|
import { useState, useCallback, useEffect, useMemo, useRef, memo } from "react";
|
|
54
|
-
import { c as commonjsRequire, g as getDefaultExportFromCjs, B as Button, D as DropdownMenu, u as useMediaQuery, T as TableSkeleton, R as ReusableTable, a as DropdownMenuAbsolute } from "./dropdownMenuAbsolute-
|
|
55
|
-
import { u as useTranslation } from "./use-translation-
|
|
54
|
+
import { c as commonjsRequire, g as getDefaultExportFromCjs, B as Button, D as DropdownMenu, u as useMediaQuery, T as TableSkeleton, R as ReusableTable, a as DropdownMenuAbsolute } from "./dropdownMenuAbsolute-CvvI2uRj.js";
|
|
55
|
+
import { u as useTranslation } from "./use-translation-CPJMFAae.js";
|
|
56
56
|
import { u as usePortalApiConfig } from "./use-portal-api-config.store-C1UTTpK9.js";
|
|
57
57
|
import axios from "axios";
|
|
58
58
|
var runtime = { exports: {} };
|
|
@@ -881,8 +881,10 @@ const systemFields$1 = [
|
|
|
881
881
|
"Danh mục sản phẩm"
|
|
882
882
|
];
|
|
883
883
|
const title$5 = "Tải lên danh sách sản phẩm";
|
|
884
|
-
const instruction1$1 = "
|
|
885
|
-
const instruction2$1 = "Trường hợp danh sách có nhiều hơn số dòng thông tin quy định, hệ thống sẽ lấy theo thứ tự dòng thông tin số 1 đến dòng thông tin số 100 (không bao gồm tiêu đề).";
|
|
884
|
+
const instruction1$1 = "Sau khi hoàn tất định dạng, hãy tải tệp lên đây. Hệ thống sẽ kiểm tra và trả kết quả cần chỉnh sửa trong trường hợp có thông tin không đúng định dạng để nhập vào hệ thống.";
|
|
885
|
+
const instruction2$1 = "Mỗi lượt tải lên danh sách chỉ được tối đa 01 tệp và tối đa 100 dòng thông tin (sản phẩm). Trường hợp danh sách có nhiều hơn số dòng thông tin quy định, hệ thống sẽ lấy theo thứ tự dòng thông tin số 1 đến dòng thông tin số 100 (không bao gồm tiêu đề).";
|
|
886
|
+
const instruction3$1 = "Mỗi lượt tải lên danh sách chỉ được tối đa 01 tệp và tối đa 100 dòng thông tin (sản phẩm).";
|
|
887
|
+
const instruction4$1 = "Trường hợp danh sách có nhiều hơn số dòng thông tin quy định, hệ thống sẽ lấy theo thứ tự dòng thông tin số 1 đến dòng thông tin số 100 (không bao gồm tiêu đề).";
|
|
886
888
|
const deleteFile$1 = "Xóa file";
|
|
887
889
|
const tabs$1 = {
|
|
888
890
|
sampleDownload: "Tải xuống tệp mẫu",
|
|
@@ -924,6 +926,8 @@ const FILE_VI = {
|
|
|
924
926
|
title: title$5,
|
|
925
927
|
instruction1: instruction1$1,
|
|
926
928
|
instruction2: instruction2$1,
|
|
929
|
+
instruction3: instruction3$1,
|
|
930
|
+
instruction4: instruction4$1,
|
|
927
931
|
deleteFile: deleteFile$1,
|
|
928
932
|
tabs: tabs$1,
|
|
929
933
|
setFirstRowAsHeader: setFirstRowAsHeader$1,
|
|
@@ -968,8 +972,10 @@ const systemFields = [
|
|
|
968
972
|
"Product Category"
|
|
969
973
|
];
|
|
970
974
|
const title$4 = "Upload Product List";
|
|
971
|
-
const instruction1 = "
|
|
972
|
-
const instruction2 = "If the list contains more rows than allowed, the system will take rows 1 through 100 in order (excluding the header).";
|
|
975
|
+
const instruction1 = "After formatting is complete, upload the file here. The system will verify the file and return any corrections needed if information is not in the correct format for import into the system.";
|
|
976
|
+
const instruction2 = "Each upload is limited to 1 file and up to 100 rows of information (products). If the list contains more rows than allowed, the system will take rows 1 through 100 in order (excluding the header).";
|
|
977
|
+
const instruction3 = "Each upload is limited to 1 file and up to 100 rows of information (products).";
|
|
978
|
+
const instruction4 = "If the list contains more rows than allowed, the system will take rows 1 through 100 in order (excluding the header).";
|
|
973
979
|
const deleteFile = "Delete file";
|
|
974
980
|
const tabs = {
|
|
975
981
|
sampleDownload: "Download sample file",
|
|
@@ -1011,6 +1017,8 @@ const FILE_VN = {
|
|
|
1011
1017
|
title: title$4,
|
|
1012
1018
|
instruction1,
|
|
1013
1019
|
instruction2,
|
|
1020
|
+
instruction3,
|
|
1021
|
+
instruction4,
|
|
1014
1022
|
deleteFile,
|
|
1015
1023
|
tabs,
|
|
1016
1024
|
setFirstRowAsHeader,
|
|
@@ -1317,4 +1325,4 @@ export {
|
|
|
1317
1325
|
translate as t,
|
|
1318
1326
|
useTranslation as u
|
|
1319
1327
|
};
|
|
1320
|
-
//# sourceMappingURL=use-translation-
|
|
1328
|
+
//# sourceMappingURL=use-translation-CPJMFAae.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-translation-
|
|
1
|
+
{"version":3,"file":"use-translation-CPJMFAae.js","sources":["../src/utils/translations.ts","../src/hooks/use-translation.ts"],"sourcesContent":["import TABLE_VI from '@/assets/locales/vi/table.json';\nimport TABLE_EN from '@/assets/locales/en/table.json';\nimport FORM_VI from '@/assets/locales/vi/form.json';\nimport FORM_EN from '@/assets/locales/en/form.json';\nimport BATCH_CREATE_PRODUCT_VI from '@/assets/locales/vi/merchant-batch-create-form.json';\nimport BATCH_CREATE_PRODUCT_EN from '@/assets/locales/en/merchant-batch-create-form.json';\nimport COMMON_VI from '@/assets/locales/vi/common.json';\nimport COMMON_EN from '@/assets/locales/en/common.json';\nimport FILE_VI from '@/assets/locales/vi/file.json';\nimport FILE_VN from '@/assets/locales/en/file.json';\nimport DOWNLOAD_SAMPLE_VI from '@/assets/locales/vi/download-sample.json';\nimport DOWNLOAD_SAMPLE_EN from '@/assets/locales/en/download-sample.json';\nimport DIGISTORE_ID_VI from '@/assets/locales/vi/digistore-id.json';\nimport DIGISTORE_ID_EN from '@/assets/locales/en/digistore-id.json';\n\nexport const TRANSLATIONS = {\n vi: {\n common: COMMON_VI,\n table: TABLE_VI,\n form: FORM_VI,\n 'batch-create-product': BATCH_CREATE_PRODUCT_VI,\n file: FILE_VI,\n 'download-sample': DOWNLOAD_SAMPLE_VI,\n 'digistore-id': DIGISTORE_ID_VI\n },\n en: {\n common: COMMON_EN,\n table: TABLE_EN,\n form: FORM_EN,\n 'batch-create-product': BATCH_CREATE_PRODUCT_EN,\n file: FILE_VN,\n 'download-sample': DOWNLOAD_SAMPLE_EN,\n 'digistore-id': DIGISTORE_ID_EN\n },\n} as const;\n","import useExternalConfigStore from '@/shared/store/use-external-config.store';\nimport { TRANSLATIONS } from '../utils/translations';\n\nexport type Language = keyof typeof TRANSLATIONS;\ntype Namespace = keyof (typeof TRANSLATIONS)[Language];\n\ninterface UseTranslationReturn {\n translate: (key: string) => string;\n language?: Language;\n}\n\nexport const translate = (\n key: string,\n name_space: Namespace = \"table\",\n language?: Language\n): string => {\n const lang = language || useExternalConfigStore.getState().language;\n const splitKey = key?.split(\":\");\n const [namespace, derivedKey] =\n splitKey.length > 1 ? splitKey : [name_space, key];\n\n const ns = namespace as Namespace;\n const translations = TRANSLATIONS[lang][ns] as any;\n const keys = derivedKey.split('.');\n let value: any = translations;\n for (const k of keys) {\n value = value?.[k];\n }\n\n return value ?? key;\n};\n\nexport const useTranslation = (\n defaultNs: Namespace = 'table',\n manualLanguage?: Language\n): UseTranslationReturn => {\n const language: Language =\n manualLanguage || useExternalConfigStore.getState().language;\n const translateWithDefault = (key: string) =>\n translate(key, defaultNs, language);\n\n return { translate: translateWithDefault, language };\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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B,gBAAgB;AAAA,EAAA;AAAA,EAElB,IAAI;AAAA,IACF,QAAQ;AAAA,IACR,OAAO;AAAA,IACP,MAAM;AAAA,IACN,wBAAwB;AAAA,IACxB,MAAM;AAAA,IACN,mBAAmB;AAAA,IACnB,gBAAgB;AAAA,EAAA;AAEpB;ACvBO,MAAM,YAAY,CACvB,KACA,aAAwB,SACxB,aACW;AACX,QAAM,OAAO,YAAY,uBAAuB,SAAA,EAAW;AAC3D,QAAM,WAAW,2BAAK,MAAM;AAC5B,QAAM,CAAC,WAAW,UAAU,IAC1B,SAAS,SAAS,IAAI,WAAW,CAAC,YAAY,GAAG;AAEnD,QAAM,KAAK;AACX,QAAM,eAAe,aAAa,IAAI,EAAE,EAAE;AAC1C,QAAM,OAAO,WAAW,MAAM,GAAG;AACjC,MAAI,QAAa;AACjB,aAAW,KAAK,MAAM;AACpB,YAAQ,+BAAQ;AAAA,EAClB;AAEA,SAAO,wBAAS;AAClB;AAEO,MAAM,iBAAiB,CAC5B,YAAuB,SACvB,mBACyB;AACzB,QAAM,WACJ,kBAAkB,uBAAuB,SAAA,EAAW;AACtD,QAAM,uBAAuB,CAAC,QAC5B,UAAU,KAAK,WAAW,QAAQ;AAEpC,SAAO,EAAE,WAAW,sBAAsB,SAAA;AAC5C;"}
|
|
@@ -882,8 +882,10 @@ const systemFields$1 = [
|
|
|
882
882
|
"Danh mục sản phẩm"
|
|
883
883
|
];
|
|
884
884
|
const title$5 = "Tải lên danh sách sản phẩm";
|
|
885
|
-
const instruction1$1 = "
|
|
886
|
-
const instruction2$1 = "Trường hợp danh sách có nhiều hơn số dòng thông tin quy định, hệ thống sẽ lấy theo thứ tự dòng thông tin số 1 đến dòng thông tin số 100 (không bao gồm tiêu đề).";
|
|
885
|
+
const instruction1$1 = "Sau khi hoàn tất định dạng, hãy tải tệp lên đây. Hệ thống sẽ kiểm tra và trả kết quả cần chỉnh sửa trong trường hợp có thông tin không đúng định dạng để nhập vào hệ thống.";
|
|
886
|
+
const instruction2$1 = "Mỗi lượt tải lên danh sách chỉ được tối đa 01 tệp và tối đa 100 dòng thông tin (sản phẩm). Trường hợp danh sách có nhiều hơn số dòng thông tin quy định, hệ thống sẽ lấy theo thứ tự dòng thông tin số 1 đến dòng thông tin số 100 (không bao gồm tiêu đề).";
|
|
887
|
+
const instruction3$1 = "Mỗi lượt tải lên danh sách chỉ được tối đa 01 tệp và tối đa 100 dòng thông tin (sản phẩm).";
|
|
888
|
+
const instruction4$1 = "Trường hợp danh sách có nhiều hơn số dòng thông tin quy định, hệ thống sẽ lấy theo thứ tự dòng thông tin số 1 đến dòng thông tin số 100 (không bao gồm tiêu đề).";
|
|
887
889
|
const deleteFile$1 = "Xóa file";
|
|
888
890
|
const tabs$1 = {
|
|
889
891
|
sampleDownload: "Tải xuống tệp mẫu",
|
|
@@ -925,6 +927,8 @@ const FILE_VI = {
|
|
|
925
927
|
title: title$5,
|
|
926
928
|
instruction1: instruction1$1,
|
|
927
929
|
instruction2: instruction2$1,
|
|
930
|
+
instruction3: instruction3$1,
|
|
931
|
+
instruction4: instruction4$1,
|
|
928
932
|
deleteFile: deleteFile$1,
|
|
929
933
|
tabs: tabs$1,
|
|
930
934
|
setFirstRowAsHeader: setFirstRowAsHeader$1,
|
|
@@ -969,8 +973,10 @@ const systemFields = [
|
|
|
969
973
|
"Product Category"
|
|
970
974
|
];
|
|
971
975
|
const title$4 = "Upload Product List";
|
|
972
|
-
const instruction1 = "
|
|
973
|
-
const instruction2 = "If the list contains more rows than allowed, the system will take rows 1 through 100 in order (excluding the header).";
|
|
976
|
+
const instruction1 = "After formatting is complete, upload the file here. The system will verify the file and return any corrections needed if information is not in the correct format for import into the system.";
|
|
977
|
+
const instruction2 = "Each upload is limited to 1 file and up to 100 rows of information (products). If the list contains more rows than allowed, the system will take rows 1 through 100 in order (excluding the header).";
|
|
978
|
+
const instruction3 = "Each upload is limited to 1 file and up to 100 rows of information (products).";
|
|
979
|
+
const instruction4 = "If the list contains more rows than allowed, the system will take rows 1 through 100 in order (excluding the header).";
|
|
974
980
|
const deleteFile = "Delete file";
|
|
975
981
|
const tabs = {
|
|
976
982
|
sampleDownload: "Download sample file",
|
|
@@ -1012,6 +1018,8 @@ const FILE_VN = {
|
|
|
1012
1018
|
title: title$4,
|
|
1013
1019
|
instruction1,
|
|
1014
1020
|
instruction2,
|
|
1021
|
+
instruction3,
|
|
1022
|
+
instruction4,
|
|
1015
1023
|
deleteFile,
|
|
1016
1024
|
tabs,
|
|
1017
1025
|
setFirstRowAsHeader,
|
|
@@ -1316,4 +1324,4 @@ const useTranslation = (defaultNs = "table", manualLanguage) => {
|
|
|
1316
1324
|
};
|
|
1317
1325
|
exports.translate = translate;
|
|
1318
1326
|
exports.useTranslation = useTranslation;
|
|
1319
|
-
//# sourceMappingURL=use-translation-
|
|
1327
|
+
//# sourceMappingURL=use-translation-m-_wCmHs.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-translation-
|
|
1
|
+
{"version":3,"file":"use-translation-m-_wCmHs.cjs","sources":["../src/utils/translations.ts","../src/hooks/use-translation.ts"],"sourcesContent":["import TABLE_VI from '@/assets/locales/vi/table.json';\nimport TABLE_EN from '@/assets/locales/en/table.json';\nimport FORM_VI from '@/assets/locales/vi/form.json';\nimport FORM_EN from '@/assets/locales/en/form.json';\nimport BATCH_CREATE_PRODUCT_VI from '@/assets/locales/vi/merchant-batch-create-form.json';\nimport BATCH_CREATE_PRODUCT_EN from '@/assets/locales/en/merchant-batch-create-form.json';\nimport COMMON_VI from '@/assets/locales/vi/common.json';\nimport COMMON_EN from '@/assets/locales/en/common.json';\nimport FILE_VI from '@/assets/locales/vi/file.json';\nimport FILE_VN from '@/assets/locales/en/file.json';\nimport DOWNLOAD_SAMPLE_VI from '@/assets/locales/vi/download-sample.json';\nimport DOWNLOAD_SAMPLE_EN from '@/assets/locales/en/download-sample.json';\nimport DIGISTORE_ID_VI from '@/assets/locales/vi/digistore-id.json';\nimport DIGISTORE_ID_EN from '@/assets/locales/en/digistore-id.json';\n\nexport const TRANSLATIONS = {\n vi: {\n common: COMMON_VI,\n table: TABLE_VI,\n form: FORM_VI,\n 'batch-create-product': BATCH_CREATE_PRODUCT_VI,\n file: FILE_VI,\n 'download-sample': DOWNLOAD_SAMPLE_VI,\n 'digistore-id': DIGISTORE_ID_VI\n },\n en: {\n common: COMMON_EN,\n table: TABLE_EN,\n form: FORM_EN,\n 'batch-create-product': BATCH_CREATE_PRODUCT_EN,\n file: FILE_VN,\n 'download-sample': DOWNLOAD_SAMPLE_EN,\n 'digistore-id': DIGISTORE_ID_EN\n },\n} as const;\n","import useExternalConfigStore from '@/shared/store/use-external-config.store';\nimport { TRANSLATIONS } from '../utils/translations';\n\nexport type Language = keyof typeof TRANSLATIONS;\ntype Namespace = keyof (typeof TRANSLATIONS)[Language];\n\ninterface UseTranslationReturn {\n translate: (key: string) => string;\n language?: Language;\n}\n\nexport const translate = (\n key: string,\n name_space: Namespace = \"table\",\n language?: Language\n): string => {\n const lang = language || useExternalConfigStore.getState().language;\n const splitKey = key?.split(\":\");\n const [namespace, derivedKey] =\n splitKey.length > 1 ? splitKey : [name_space, key];\n\n const ns = namespace as Namespace;\n const translations = TRANSLATIONS[lang][ns] as any;\n const keys = derivedKey.split('.');\n let value: any = translations;\n for (const k of keys) {\n value = value?.[k];\n }\n\n return value ?? key;\n};\n\nexport const useTranslation = (\n defaultNs: Namespace = 'table',\n manualLanguage?: Language\n): UseTranslationReturn => {\n const language: Language =\n manualLanguage || useExternalConfigStore.getState().language;\n const translateWithDefault = (key: string) =>\n translate(key, defaultNs, language);\n\n return { translate: translateWithDefault, language };\n};\n"],"names":["useExternalConfigStore"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeO,MAAM,eAAe;AAAA,EAC1B,IAAI;AAAA,IACF,QAAQ;AAAA,IACR,OAAO;AAAA,IACP,MAAM;AAAA,IACN,wBAAwB;AAAA,IACxB,MAAM;AAAA,IACN,mBAAmB;AAAA,IACnB,gBAAgB;AAAA,EAAA;AAAA,EAElB,IAAI;AAAA,IACF,QAAQ;AAAA,IACR,OAAO;AAAA,IACP,MAAM;AAAA,IACN,wBAAwB;AAAA,IACxB,MAAM;AAAA,IACN,mBAAmB;AAAA,IACnB,gBAAgB;AAAA,EAAA;AAEpB;ACvBO,MAAM,YAAY,CACvB,KACA,aAAwB,SACxB,aACW;AACX,QAAM,OAAO,YAAYA,+CAAuB,SAAA,EAAW;AAC3D,QAAM,WAAW,2BAAK,MAAM;AAC5B,QAAM,CAAC,WAAW,UAAU,IAC1B,SAAS,SAAS,IAAI,WAAW,CAAC,YAAY,GAAG;AAEnD,QAAM,KAAK;AACX,QAAM,eAAe,aAAa,IAAI,EAAE,EAAE;AAC1C,QAAM,OAAO,WAAW,MAAM,GAAG;AACjC,MAAI,QAAa;AACjB,aAAW,KAAK,MAAM;AACpB,YAAQ,+BAAQ;AAAA,EAClB;AAEA,SAAO,wBAAS;AAClB;AAEO,MAAM,iBAAiB,CAC5B,YAAuB,SACvB,mBACyB;AACzB,QAAM,WACJ,kBAAkBA,+CAAuB,SAAA,EAAW;AACtD,QAAM,uBAAuB,CAAC,QAC5B,UAAU,KAAK,WAAW,QAAQ;AAEpC,SAAO,EAAE,WAAW,sBAAsB,SAAA;AAC5C;;;"}
|
|
@@ -244,6 +244,8 @@ export declare const TRANSLATIONS: {
|
|
|
244
244
|
title: string;
|
|
245
245
|
instruction1: string;
|
|
246
246
|
instruction2: string;
|
|
247
|
+
instruction3: string;
|
|
248
|
+
instruction4: string;
|
|
247
249
|
deleteFile: string;
|
|
248
250
|
tabs: {
|
|
249
251
|
sampleDownload: string;
|
|
@@ -603,6 +605,8 @@ export declare const TRANSLATIONS: {
|
|
|
603
605
|
title: string;
|
|
604
606
|
instruction1: string;
|
|
605
607
|
instruction2: string;
|
|
608
|
+
instruction3: string;
|
|
609
|
+
instruction4: string;
|
|
606
610
|
deleteFile: string;
|
|
607
611
|
tabs: {
|
|
608
612
|
sampleDownload: string;
|