@prosopo/cli 3.8.17 → 3.8.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build$colon$cjs.log +3 -3
- package/.turbo/turbo-build$colon$tsc.log +31 -31
- package/.turbo/turbo-build.log +4 -4
- package/CHANGELOG.md +23 -0
- package/dist/bundle/i18SharedOptions-CRkwRXkj.js +12 -0
- package/dist/bundle/{i18nBackend-WFIUNZjB.js → i18nBackend-C5Be0TE1.js} +17 -17
- package/dist/bundle/i18nFrontend-CZ7yONJC.js +106 -0
- package/dist/bundle/provider.cli.bundle.js +21195 -21199
- package/dist/bundle/{src-CFhgWFIS.js → src-CVL8EKQE.js} +14 -14
- package/package.json +11 -11
- package/dist/bundle/i18nFrontend-D9lq3aPx.js +0 -856
- package/dist/bundle/i18next-CzgfK_Ir.js +0 -1231
- package/dist/bundle/node-ponyfill-ByScaio2.js +0 -1534
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @prosopo/cli@3.8.
|
|
2
|
+
> @prosopo/cli@3.8.19 build:cjs
|
|
3
3
|
> NODE_ENV=${NODE_ENV:-development}; vite build --config vite.cjs.config.ts --mode $NODE_ENV
|
|
4
4
|
|
|
5
5
|
ViteCommonJSConfig: .
|
|
@@ -31,7 +31,6 @@ ViteCommonJSConfig: .
|
|
|
31
31
|
'/home/runner/work/captcha/captcha/packages/web-bot-auth/tsconfig.json'
|
|
32
32
|
]
|
|
33
33
|
}
|
|
34
|
-
[33mThe plugin "vite-tsconfig-paths" is detected. Vite now supports tsconfig paths resolution natively via the [1mresolve.tsconfigPaths[22m option. You can remove the plugin and set [1mresolve.tsconfigPaths: true[22m in your Vite config instead.[39m
|
|
35
34
|
{
|
|
36
35
|
externals: [
|
|
37
36
|
'@prosopo/api',
|
|
@@ -60,6 +59,7 @@ ViteCommonJSConfig: .
|
|
|
60
59
|
'@prosopo/web-bot-auth'
|
|
61
60
|
]
|
|
62
61
|
}
|
|
62
|
+
[33mThe plugin "vite-tsconfig-paths" is detected. Vite now supports tsconfig paths resolution natively via the [1mresolve.tsconfigPaths[22m option. You can remove the plugin and set [1mresolve.tsconfigPaths: true[22m in your Vite config instead.[39m
|
|
63
63
|
[36mvite v8.1.5 [32mbuilding ssr environment for production...[36m[39m
|
|
64
64
|
Bundle build started
|
|
65
65
|
[2K
|
|
@@ -96,4 +96,4 @@ dist/cjs/RateLimiter.cjs 5.78 kB │ gzip: 0.92 kB
|
|
|
96
96
|
[38;5;240m │[0m ╰─────── This `import.meta` will be replaced with an empty object (`{}`) automatically. If this is desired, you can suppress this warning by adding `transform.define: { 'import.meta': {} }`. If `import.meta` needs to be kept as-is, you need to set the output format to `esm`.
|
|
97
97
|
[38;5;246m────╯[0m
|
|
98
98
|
[39m
|
|
99
|
-
[32m✓ built in
|
|
99
|
+
[32m✓ built in 46ms[39m
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
|
|
2
|
-
> @prosopo/cli@3.8.
|
|
2
|
+
> @prosopo/cli@3.8.19 build:tsc
|
|
3
3
|
> tsc --build --verbose
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
10:41:13 PM - Projects in this build:
|
|
6
6
|
* ../../dev/config/tsconfig.json
|
|
7
|
-
* ../locale/tsconfig.json
|
|
8
7
|
* ../util/tsconfig.json
|
|
8
|
+
* ../locale/tsconfig.json
|
|
9
9
|
* ../util-crypto/tsconfig.json
|
|
10
10
|
* ../types/tsconfig.json
|
|
11
11
|
* ../api/tsconfig.json
|
|
@@ -31,59 +31,59 @@
|
|
|
31
31
|
* ../../dev/workspace/tsconfig.json
|
|
32
32
|
* tsconfig.json
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
10:41:13 PM - Project '../../dev/config/tsconfig.json' is up to date because newest input '../../dev/config/src/webpack/webpack.config.ts' is older than output '../../dev/config/tsconfig.tsbuildinfo'
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
10:41:13 PM - Project '../util/tsconfig.json' is up to date because newest input '../util/src/url.ts' is older than output '../util/tsconfig.tsbuildinfo'
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
10:41:13 PM - Project '../locale/tsconfig.json' is up to date because newest input '../locale/src/process.ts' is older than output '../locale/tsconfig.tsbuildinfo'
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
10:41:13 PM - Project '../util-crypto/tsconfig.json' is up to date because newest input '../util-crypto/src/types.ts' is older than output '../util-crypto/tsconfig.tsbuildinfo'
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
10:41:13 PM - Project '../types/tsconfig.json' is up to date because newest input '../types/src/types.test-d.ts' is older than output '../types/tsconfig.tsbuildinfo'
|
|
43
43
|
|
|
44
|
-
|
|
44
|
+
10:41:13 PM - Project '../api/tsconfig.json' is up to date because newest input '../api/src/index.ts' is older than output '../api/tsconfig.tsbuildinfo'
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
10:41:13 PM - Project '../logger/tsconfig.json' is up to date because newest input '../logger/src/tests/loggerBrowser.unit.test.ts' is older than output '../logger/tsconfig.tsbuildinfo'
|
|
47
47
|
|
|
48
|
-
|
|
48
|
+
10:41:13 PM - Project '../common/tsconfig.json' is up to date because newest input '../common/src/tests/utils/objectUtils.unit.test.ts' is older than output '../common/tsconfig.tsbuildinfo'
|
|
49
49
|
|
|
50
|
-
|
|
50
|
+
10:41:13 PM - Project '../dotenv/tsconfig.json' is up to date because newest input '../dotenv/src/env.ts' is older than output '../dotenv/tsconfig.tsbuildinfo'
|
|
51
51
|
|
|
52
|
-
|
|
52
|
+
10:41:13 PM - Project '../ipinfo/tsconfig.json' is up to date because newest input '../ipinfo/src/index.ts' is older than output '../ipinfo/tsconfig.tsbuildinfo'
|
|
53
53
|
|
|
54
|
-
|
|
54
|
+
10:41:13 PM - Project '../api-route/tsconfig.json' is up to date because newest input '../api-route/src/apiRoutes.ts' is older than output '../api-route/tsconfig.tsbuildinfo'
|
|
55
55
|
|
|
56
|
-
|
|
56
|
+
10:41:13 PM - Project '../redis-client/tsconfig.json' is up to date because newest input '../redis-client/src/index.ts' is older than output '../redis-client/tsconfig.tsbuildinfo'
|
|
57
57
|
|
|
58
|
-
|
|
58
|
+
10:41:13 PM - Project '../user-access-policy/tsconfig.json' is up to date because newest input '../user-access-policy/src/transformRule.ts' is older than output '../user-access-policy/tsconfig.tsbuildinfo'
|
|
59
59
|
|
|
60
|
-
|
|
60
|
+
10:41:13 PM - Project '../types-database/tsconfig.json' is up to date because newest input '../types-database/src/index.ts' is older than output '../types-database/tsconfig.tsbuildinfo'
|
|
61
61
|
|
|
62
|
-
|
|
62
|
+
10:41:13 PM - Project '../database/tsconfig.json' is up to date because newest input '../database/src/tests/unit/captchaLabel.unit.test.ts' is older than output '../database/tsconfig.tsbuildinfo'
|
|
63
63
|
|
|
64
|
-
|
|
64
|
+
10:41:13 PM - Project '../keyring/tsconfig.json' is up to date because newest input '../keyring/src/index.ts' is older than output '../keyring/tsconfig.tsbuildinfo'
|
|
65
65
|
|
|
66
|
-
|
|
66
|
+
10:41:13 PM - Project '../types-env/tsconfig.json' is up to date because newest input '../types-env/src/index.ts' is older than output '../types-env/tsconfig.tsbuildinfo'
|
|
67
67
|
|
|
68
|
-
|
|
68
|
+
10:41:14 PM - Project '../env/tsconfig.json' is up to date because newest input '../env/src/index.ts' is older than output '../env/tsconfig.tsbuildinfo'
|
|
69
69
|
|
|
70
|
-
|
|
70
|
+
10:41:14 PM - Project '../api-express-router/tsconfig.json' is up to date because newest input '../api-express-router/src/middlewares/requestLoggerMiddleware.ts' is older than output '../api-express-router/tsconfig.tsbuildinfo'
|
|
71
71
|
|
|
72
|
-
|
|
72
|
+
10:41:14 PM - Project '../captcha-severity/tsconfig.json' is up to date because newest input '../captcha-severity/src/index.test.ts' is older than output '../captcha-severity/tsconfig.tsbuildinfo'
|
|
73
73
|
|
|
74
|
-
|
|
74
|
+
10:41:14 PM - Project '../datasets/tsconfig.json' is up to date because newest input '../datasets/src/tests/captcha.unit.test.ts' is older than output '../datasets/tsconfig.tsbuildinfo'
|
|
75
75
|
|
|
76
|
-
|
|
76
|
+
10:41:14 PM - Project '../load-balancer/tsconfig.json' is up to date because newest input '../load-balancer/src/balancer.ts' is older than output '../load-balancer/tsconfig.tsbuildinfo'
|
|
77
77
|
|
|
78
|
-
|
|
78
|
+
10:41:14 PM - Project '../puzzle-assets/tsconfig.json' is up to date because newest input '../puzzle-assets/src/background.ts' is older than output '../puzzle-assets/tsconfig.tsbuildinfo'
|
|
79
79
|
|
|
80
|
-
|
|
80
|
+
10:41:14 PM - Project '../web-bot-auth/tsconfig.json' is up to date because newest input '../web-bot-auth/src/base64.ts' is older than output '../web-bot-auth/tsconfig.tsbuildinfo'
|
|
81
81
|
|
|
82
|
-
|
|
82
|
+
10:41:14 PM - Project '../provider/tsconfig.json' is up to date because newest input '../provider/src/utils/devicePlatform.ts' is older than output '../provider/tsconfig.tsbuildinfo'
|
|
83
83
|
|
|
84
|
-
|
|
84
|
+
10:41:14 PM - Project '../../dev/workspace/tsconfig.json' is up to date because newest input '../../dev/workspace/src/index.ts' is older than output '../../dev/workspace/tsconfig.tsbuildinfo'
|
|
85
85
|
|
|
86
|
-
|
|
86
|
+
10:41:14 PM - Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist
|
|
87
87
|
|
|
88
|
-
|
|
88
|
+
10:41:14 PM - Building project '/home/runner/work/captcha/captcha/packages/cli/tsconfig.json'...
|
|
89
89
|
|
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
|
|
2
|
-
> @prosopo/cli@3.8.
|
|
2
|
+
> @prosopo/cli@3.8.19 build
|
|
3
3
|
> npm run build:cross-env -- --mode ${NODE_ENV:-development}
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
> @prosopo/cli@3.8.
|
|
6
|
+
> @prosopo/cli@3.8.19 build:cross-env
|
|
7
7
|
> vite build --config vite.esm.config.ts --mode production
|
|
8
8
|
|
|
9
9
|
ViteEsmConfig: .
|
|
@@ -40,6 +40,7 @@ ViteEsmConfig: .
|
|
|
40
40
|
'@prosopo/api',
|
|
41
41
|
'@prosopo/types',
|
|
42
42
|
'@prosopo/locale',
|
|
43
|
+
[33mThe plugin "vite-tsconfig-paths" is detected. Vite now supports tsconfig paths resolution natively via the [1mresolve.tsconfigPaths[22m option. You can remove the plugin and set [1mresolve.tsconfigPaths: true[22m in your Vite config instead.[39m
|
|
43
44
|
'@prosopo/util',
|
|
44
45
|
'@prosopo/util-crypto',
|
|
45
46
|
'@prosopo/common',
|
|
@@ -63,7 +64,6 @@ ViteEsmConfig: .
|
|
|
63
64
|
'@prosopo/web-bot-auth'
|
|
64
65
|
]
|
|
65
66
|
}
|
|
66
|
-
[33mThe plugin "vite-tsconfig-paths" is detected. Vite now supports tsconfig paths resolution natively via the [1mresolve.tsconfigPaths[22m option. You can remove the plugin and set [1mresolve.tsconfigPaths: true[22m in your Vite config instead.[39m
|
|
67
67
|
[36mvite v8.1.5 [32mbuilding ssr environment for production...[36m[39m
|
|
68
68
|
Bundle build started
|
|
69
69
|
[2K
|
|
@@ -92,4 +92,4 @@ dist/commands/siteKeyRegister.js 3.99 kB │ gzip: 1.24 kB
|
|
|
92
92
|
dist/prosopo.config.js 4.49 kB │ gzip: 1.48 kB
|
|
93
93
|
dist/RateLimiter.js 5.35 kB │ gzip: 0.92 kB
|
|
94
94
|
|
|
95
|
-
[32m✓ built in
|
|
95
|
+
[32m✓ built in 52ms[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# @prosopo/cli
|
|
2
2
|
|
|
3
|
+
## 3.8.19
|
|
4
|
+
### Patch Changes
|
|
5
|
+
|
|
6
|
+
- Updated dependencies [aed164d]
|
|
7
|
+
- @prosopo/provider@5.12.3
|
|
8
|
+
|
|
9
|
+
## 3.8.18
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- Updated dependencies [a9141c3]
|
|
13
|
+
- Updated dependencies [a9141c3]
|
|
14
|
+
- Updated dependencies [a9141c3]
|
|
15
|
+
- @prosopo/locale@3.6.0
|
|
16
|
+
- @prosopo/common@3.1.59
|
|
17
|
+
- @prosopo/types@5.10.0
|
|
18
|
+
- @prosopo/logger@2.1.0
|
|
19
|
+
- @prosopo/util@3.3.11
|
|
20
|
+
- @prosopo/keyring@2.9.95
|
|
21
|
+
- @prosopo/provider@5.12.2
|
|
22
|
+
- @prosopo/env@3.6.62
|
|
23
|
+
- @prosopo/api@4.3.3
|
|
24
|
+
- @prosopo/dotenv@3.0.57
|
|
25
|
+
|
|
3
26
|
## 3.8.17
|
|
4
27
|
### Patch Changes
|
|
5
28
|
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { n as e, t } from "./provider.cli.bundle.js";
|
|
2
|
+
//#endregion
|
|
3
|
+
//#region ../locale/dist/i18SharedOptions.js
|
|
4
|
+
var n = {
|
|
5
|
+
debug: (typeof process < "u" ? process : void 0)?.env?.PROSOPO_LOG_LEVEL === "debug",
|
|
6
|
+
fallbackLng: e.english,
|
|
7
|
+
namespace: "translation",
|
|
8
|
+
supportedLngs: t,
|
|
9
|
+
nonExplicitSupportedLngs: !1
|
|
10
|
+
};
|
|
11
|
+
//#endregion
|
|
12
|
+
export { n as t };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { i as n,
|
|
1
|
+
import { t as e } from "./i18SharedOptions-CRkwRXkj.js";
|
|
2
|
+
import { c as t, i as n, o as r, r as i, s as a } from "./provider.cli.bundle.js";
|
|
3
3
|
import o from "node:path";
|
|
4
4
|
//#region ../locale/dist/util.js
|
|
5
|
-
var s = () => !!(typeof window < "u" && window.document && window.document.createElement), c = () => !s(), l = /* @__PURE__ */
|
|
5
|
+
var s = () => !!(typeof window < "u" && window.document && window.document.createElement), c = () => !s(), l = /* @__PURE__ */ r(((e) => {
|
|
6
6
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.debounce = p, e.defaults = c, e.getPath = _, e.interpolate = y, e.interpolatePath = b, e.isSafeLangSegment = u, e.isSafeNsSegment = d, e.isSafePathSegment = void 0, e.pushPath = g, e.setPath = h;
|
|
7
7
|
function t(e, t) {
|
|
8
8
|
var r = typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
|
|
@@ -155,7 +155,7 @@ var s = () => !!(typeof window < "u" && window.document && window.document.creat
|
|
|
155
155
|
});
|
|
156
156
|
return r ? null : i;
|
|
157
157
|
}
|
|
158
|
-
})), u = /* @__PURE__ */
|
|
158
|
+
})), u = /* @__PURE__ */ r(((e, t) => {
|
|
159
159
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.default = void 0;
|
|
160
160
|
function n(e, t) {
|
|
161
161
|
var n = typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
|
|
@@ -978,7 +978,7 @@ var s = () => !!(typeof window < "u" && window.document && window.document.creat
|
|
|
978
978
|
}
|
|
979
979
|
}
|
|
980
980
|
}, t.exports = e.default;
|
|
981
|
-
})), d = /* @__PURE__ */
|
|
981
|
+
})), d = /* @__PURE__ */ r(((e) => {
|
|
982
982
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.SyntaxKind = e.ScanError = e.ParseErrorCode = void 0, e.applyEdits = ae, e.findNodeAtOffset = e.findNodeAtLocation = e.createScanner = void 0, e.format = re, e.getNodeValue = e.getNodePath = e.getLocation = void 0, e.modify = ie, e.parseTree = e.parse = void 0, e.printParseErrorCode = ne, e.visit = e.stripComments = void 0;
|
|
983
983
|
function t(e, t) {
|
|
984
984
|
var n = Object.keys(e);
|
|
@@ -2048,7 +2048,7 @@ var s = () => !!(typeof window < "u" && window.document && window.document.creat
|
|
|
2048
2048
|
}
|
|
2049
2049
|
return e;
|
|
2050
2050
|
}
|
|
2051
|
-
})), f = /* @__PURE__ */
|
|
2051
|
+
})), f = /* @__PURE__ */ r(((e) => {
|
|
2052
2052
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.types = e.safeLoadAll = e.safeLoad = e.safeDump = e.loadAll = e.load = e.dump = e.default = e.YAMLException = e.Type = e.Schema = e.JSON_SCHEMA = e.FAILSAFE_SCHEMA = e.DEFAULT_SCHEMA = e.CORE_SCHEMA = void 0;
|
|
2053
2053
|
function t(e) {
|
|
2054
2054
|
"@babel/helpers - typeof";
|
|
@@ -3114,11 +3114,11 @@ var s = () => !!(typeof window < "u" && window.document && window.document.creat
|
|
|
3114
3114
|
safeLoadAll: e.safeLoadAll = Un("safeLoadAll", "loadAll"),
|
|
3115
3115
|
safeDump: e.safeDump = Un("safeDump", "dump")
|
|
3116
3116
|
};
|
|
3117
|
-
})), p = /* @__PURE__ */
|
|
3117
|
+
})), p = /* @__PURE__ */ r(((e, t) => {
|
|
3118
3118
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.default = void 0, e.default = function(e) {
|
|
3119
3119
|
if (!(e.indexOf(".") < 0)) return `.${e.split(".").pop()}`;
|
|
3120
3120
|
}, t.exports = e.default;
|
|
3121
|
-
})), m = /* @__PURE__ */
|
|
3121
|
+
})), m = /* @__PURE__ */ r(((e, t) => {
|
|
3122
3122
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.readFile = E, e.readFileSync = T;
|
|
3123
3123
|
var n = s(u()), r = d(), i = s(f()), o = s(p());
|
|
3124
3124
|
function s(e) {
|
|
@@ -3227,7 +3227,7 @@ var s = () => !!(typeof window < "u" && window.document && window.document.creat
|
|
|
3227
3227
|
}).catch(a);
|
|
3228
3228
|
});
|
|
3229
3229
|
}
|
|
3230
|
-
})), h = /* @__PURE__ */
|
|
3230
|
+
})), h = /* @__PURE__ */ r(((e, t) => {
|
|
3231
3231
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.removeFile = j, e.removeFileSync = A, e.writeFile = k, e.writeFileSync = O;
|
|
3232
3232
|
var n = o(u()), r = o(f()), i = o(p());
|
|
3233
3233
|
function o(e) {
|
|
@@ -3329,7 +3329,7 @@ var s = () => !!(typeof window < "u" && window.document && window.document.creat
|
|
|
3329
3329
|
function j(e) {
|
|
3330
3330
|
return (c ? E : s ? S : v)(e);
|
|
3331
3331
|
}
|
|
3332
|
-
})), g = /* @__PURE__ */
|
|
3332
|
+
})), g = /* @__PURE__ */ t((/* @__PURE__ */ r(((e, t) => {
|
|
3333
3333
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.default = void 0;
|
|
3334
3334
|
var n = l(), r = m(), i = h();
|
|
3335
3335
|
function a(e) {
|
|
@@ -3535,24 +3535,24 @@ var s = () => !!(typeof window < "u" && window.document && window.document.creat
|
|
|
3535
3535
|
}();
|
|
3536
3536
|
p.type = "backend", e.default = p, t.exports = e.default;
|
|
3537
3537
|
})))(), 1), _ = `${o.dirname(import.meta.url)}/locales/{{lng}}/{{ns}}.json`.replace("file://", "");
|
|
3538
|
-
function v(
|
|
3539
|
-
if (!
|
|
3538
|
+
function v(t) {
|
|
3539
|
+
if (!n.isInitialized && c()) {
|
|
3540
3540
|
let r = new i(null, { order: [
|
|
3541
3541
|
"header",
|
|
3542
3542
|
"query",
|
|
3543
3543
|
"cookie"
|
|
3544
3544
|
] });
|
|
3545
|
-
|
|
3545
|
+
n.use(g.default).use(r).init({
|
|
3546
3546
|
...e,
|
|
3547
3547
|
ns: ["translation"],
|
|
3548
3548
|
backend: { loadPath: _ }
|
|
3549
3549
|
});
|
|
3550
3550
|
let a = !1;
|
|
3551
|
-
|
|
3552
|
-
a || (a = !0,
|
|
3551
|
+
n.on("loaded", () => {
|
|
3552
|
+
a || (a = !0, t?.(n));
|
|
3553
3553
|
});
|
|
3554
|
-
} else
|
|
3555
|
-
return
|
|
3554
|
+
} else t?.(n);
|
|
3555
|
+
return n;
|
|
3556
3556
|
}
|
|
3557
3557
|
//#endregion
|
|
3558
3558
|
export { v as default, v as initializeI18n };
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { t as e } from "./i18SharedOptions-CRkwRXkj.js";
|
|
2
|
+
import { a as t } from "./provider.cli.bundle.js";
|
|
3
|
+
//#region ../locale/dist/i18nFrontend.js
|
|
4
|
+
var n = "translation", r = e.fallbackLng, i = "i18nextLng", a = "i18next", o = 10080 * 60, s = 1e4, c = e.supportedLngs, l = (e) => {
|
|
5
|
+
let t = import.meta.url;
|
|
6
|
+
return `${t.slice(0, t.lastIndexOf("/"))}/locales/${e}/${n}.json`;
|
|
7
|
+
}, u = (e) => {
|
|
8
|
+
if (!e) return;
|
|
9
|
+
if (c.includes(e)) return e;
|
|
10
|
+
let t = e.split("-")[0];
|
|
11
|
+
return t && c.includes(t) ? t : void 0;
|
|
12
|
+
}, d = () => {
|
|
13
|
+
try {
|
|
14
|
+
let e = document.cookie.match(RegExp(`(?:^|; )${a}=([^;]*)`));
|
|
15
|
+
return e?.[1] ? decodeURIComponent(e[1]) : void 0;
|
|
16
|
+
} catch {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
}, f = () => {
|
|
20
|
+
try {
|
|
21
|
+
return localStorage.getItem(i) ?? void 0;
|
|
22
|
+
} catch {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
}, p = () => {
|
|
26
|
+
try {
|
|
27
|
+
return navigator.languages?.length ? navigator.languages : [navigator.language];
|
|
28
|
+
} catch {
|
|
29
|
+
return [];
|
|
30
|
+
}
|
|
31
|
+
}, m = (e) => {
|
|
32
|
+
try {
|
|
33
|
+
localStorage.setItem(i, e);
|
|
34
|
+
} catch {}
|
|
35
|
+
try {
|
|
36
|
+
document.cookie = `${a}=${encodeURIComponent(e)};max-age=${o};path=/`;
|
|
37
|
+
} catch {}
|
|
38
|
+
}, h = () => {
|
|
39
|
+
let e = [
|
|
40
|
+
d(),
|
|
41
|
+
f(),
|
|
42
|
+
...p()
|
|
43
|
+
];
|
|
44
|
+
for (let t of e) {
|
|
45
|
+
let e = u(t);
|
|
46
|
+
if (e) return e;
|
|
47
|
+
}
|
|
48
|
+
return r;
|
|
49
|
+
}, g = async (e) => {
|
|
50
|
+
let n = new AbortController(), r = setTimeout(() => n.abort(), s);
|
|
51
|
+
try {
|
|
52
|
+
let r = await fetch(l(e), { signal: n.signal });
|
|
53
|
+
if (!r.ok) return {};
|
|
54
|
+
let i = await r.json();
|
|
55
|
+
return typeof i == "object" && i ? t(i) : {};
|
|
56
|
+
} catch {
|
|
57
|
+
return {};
|
|
58
|
+
} finally {
|
|
59
|
+
clearTimeout(r);
|
|
60
|
+
}
|
|
61
|
+
}, _ = (e, t) => t ? e.replace(/\{\{(\w+)\}\}/g, (e, n) => n in t ? String(t[n]) : e) : e, v = (e) => {
|
|
62
|
+
let t = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), a = u(e) ?? h(), o = !1, s = (e) => {
|
|
63
|
+
for (let t of i.get(e) ?? []) t();
|
|
64
|
+
}, c = async (e) => {
|
|
65
|
+
let n = [.../* @__PURE__ */ new Set([e, r])].filter((e) => !t.has(e));
|
|
66
|
+
await Promise.all(n.map(async (e) => {
|
|
67
|
+
t.set(e, await g(e));
|
|
68
|
+
}));
|
|
69
|
+
}, l = (e, n) => t.get(e)?.[n];
|
|
70
|
+
m(a);
|
|
71
|
+
let d = c(a).then(() => {
|
|
72
|
+
o = !0, s("initialized"), s("loaded");
|
|
73
|
+
}), f = {
|
|
74
|
+
get language() {
|
|
75
|
+
return a;
|
|
76
|
+
},
|
|
77
|
+
get isInitialized() {
|
|
78
|
+
return o;
|
|
79
|
+
},
|
|
80
|
+
t: (e, t) => _(l(a, e) ?? l(r, e) ?? t?.defaultValue ?? e, t),
|
|
81
|
+
hasLoadedNamespace: (e) => e === n && t.has(a),
|
|
82
|
+
changeLanguage: async (e) => {
|
|
83
|
+
let t = u(e) ?? r;
|
|
84
|
+
return t !== a && (a = t, m(t), await c(t), s("loaded"), s("languageChanged")), f;
|
|
85
|
+
},
|
|
86
|
+
on: (e, t) => {
|
|
87
|
+
let n = i.get(e) ?? /* @__PURE__ */ new Set();
|
|
88
|
+
n.add(t), i.set(e, n);
|
|
89
|
+
},
|
|
90
|
+
off: (e, t) => {
|
|
91
|
+
i.get(e)?.delete(t);
|
|
92
|
+
},
|
|
93
|
+
ready: async () => (await d, f)
|
|
94
|
+
};
|
|
95
|
+
return f;
|
|
96
|
+
}, y;
|
|
97
|
+
function b(e, t) {
|
|
98
|
+
if (y) e?.(y);
|
|
99
|
+
else {
|
|
100
|
+
let n = v(t);
|
|
101
|
+
y = n, n.ready().then(() => e?.(n));
|
|
102
|
+
}
|
|
103
|
+
return y;
|
|
104
|
+
}
|
|
105
|
+
//#endregion
|
|
106
|
+
export { b as default, b as initializeI18n };
|