@esgettext/runtime 1.2.0 → 1.3.1

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.
@@ -1 +1 @@
1
- {"version":3,"file":"esgettext.esm.js","sources":["../src/core/user-locales.ts","../../../node_modules/tslib/tslib.es6.js","../src/transport/http.ts","../src/transport/fs.ts","../src/core/germanic-plural.ts","../src/core/data-viewlet.ts","../src/parser/parse-mo-catalog.ts","../src/parser/parse-mo-json-catalog.ts","../src/parser/parse-json-catalog.ts","../src/core/split-locale.ts","../src/core/catalog-cache.ts","../src/core/explode-locale.ts","../src/core/resolve-impl.ts","../src/core/gettext-impl.ts","../src/core/platform.ts","../src/core/select-locale.ts","../src/core/textdomain.ts","../src/index.ts"],"sourcesContent":["let userLocalesSelected = ['C'];\n\n/*\n * Force an execution environment. By default, the environment (NodeJS or\n * browser) is auto-detected. You can force the library to assume a certain\n * environment with this function.\n *\n * @param browser - whether to assume a browser or not\n * @returns the new setting.\n */\nexport function userLocales(locales?: Array<string>): Array<string> {\n\tif (typeof locales !== 'undefined') {\n\t\tuserLocalesSelected = locales;\n\t}\n\n\treturn userLocalesSelected;\n}\n","/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise, SuppressedError, Symbol */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\r\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\r\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\r\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\r\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\r\n var _, done = false;\r\n for (var i = decorators.length - 1; i >= 0; i--) {\r\n var context = {};\r\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\r\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\r\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\r\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\r\n if (kind === \"accessor\") {\r\n if (result === void 0) continue;\r\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\r\n if (_ = accept(result.get)) descriptor.get = _;\r\n if (_ = accept(result.set)) descriptor.set = _;\r\n if (_ = accept(result.init)) initializers.unshift(_);\r\n }\r\n else if (_ = accept(result)) {\r\n if (kind === \"field\") initializers.unshift(_);\r\n else descriptor[key] = _;\r\n }\r\n }\r\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\r\n done = true;\r\n};\r\n\r\nexport function __runInitializers(thisArg, initializers, value) {\r\n var useValue = arguments.length > 2;\r\n for (var i = 0; i < initializers.length; i++) {\r\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\r\n }\r\n return useValue ? value : void 0;\r\n};\r\n\r\nexport function __propKey(x) {\r\n return typeof x === \"symbol\" ? x : \"\".concat(x);\r\n};\r\n\r\nexport function __setFunctionName(f, name, prefix) {\r\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\r\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\r\n};\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\r\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n\r\nexport function __addDisposableResource(env, value, async) {\r\n if (value !== null && value !== void 0) {\r\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\r\n var dispose, inner;\r\n if (async) {\r\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\r\n dispose = value[Symbol.asyncDispose];\r\n }\r\n if (dispose === void 0) {\r\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\r\n dispose = value[Symbol.dispose];\r\n if (async) inner = dispose;\r\n }\r\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\r\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\r\n env.stack.push({ value: value, dispose: dispose, async: async });\r\n }\r\n else if (async) {\r\n env.stack.push({ async: true });\r\n }\r\n return value;\r\n\r\n}\r\n\r\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\r\n var e = new Error(message);\r\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\r\n};\r\n\r\nexport function __disposeResources(env) {\r\n function fail(e) {\r\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\r\n env.hasError = true;\r\n }\r\n function next() {\r\n while (env.stack.length) {\r\n var rec = env.stack.pop();\r\n try {\r\n var result = rec.dispose && rec.dispose.call(rec.value);\r\n if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\r\n }\r\n catch (e) {\r\n fail(e);\r\n }\r\n }\r\n if (env.hasError) throw env.error;\r\n }\r\n return next();\r\n}\r\n\r\nexport default {\r\n __extends: __extends,\r\n __assign: __assign,\r\n __rest: __rest,\r\n __decorate: __decorate,\r\n __param: __param,\r\n __metadata: __metadata,\r\n __awaiter: __awaiter,\r\n __generator: __generator,\r\n __createBinding: __createBinding,\r\n __exportStar: __exportStar,\r\n __values: __values,\r\n __read: __read,\r\n __spread: __spread,\r\n __spreadArrays: __spreadArrays,\r\n __spreadArray: __spreadArray,\r\n __await: __await,\r\n __asyncGenerator: __asyncGenerator,\r\n __asyncDelegator: __asyncDelegator,\r\n __asyncValues: __asyncValues,\r\n __makeTemplateObject: __makeTemplateObject,\r\n __importStar: __importStar,\r\n __importDefault: __importDefault,\r\n __classPrivateFieldGet: __classPrivateFieldGet,\r\n __classPrivateFieldSet: __classPrivateFieldSet,\r\n __classPrivateFieldIn: __classPrivateFieldIn,\r\n __addDisposableResource: __addDisposableResource,\r\n __disposeResources: __disposeResources,\r\n};\r\n","import { Transport } from './transport.interface';\n\n/* eslint-disable @typescript-eslint/explicit-function-return-type */\n\nexport class TransportHttp implements Transport {\n\tloadFile(url: string): Promise<ArrayBuffer> {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tconst xhr = new XMLHttpRequest();\n\t\t\txhr.responseType = 'arraybuffer';\n\t\t\txhr.open('GET', url, true);\n\t\t\txhr.onload = () => {\n\t\t\t\tif (xhr.readyState === 4 && xhr.status === 200) {\n\t\t\t\t\tresolve(xhr.response as ArrayBuffer);\n\t\t\t\t} else {\n\t\t\t\t\treject(new Error('get failed with status ' + xhr.status));\n\t\t\t\t}\n\t\t\t};\n\t\t\txhr.onerror = err => reject(err);\n\t\t\txhr.send();\n\t\t});\n\t}\n}\n","import { readFile } from 'fs';\nimport { Transport } from './transport.interface';\n\nexport class TransportFs implements Transport {\n\tloadFile(url: string): Promise<ArrayBuffer> {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\treadFile(url, (err, data) => {\n\t\t\t\treturn err ? reject(err) : resolve(data);\n\t\t\t});\n\t\t});\n\t}\n}\n","/*\n * Function for germanic plural. Returns singular (0) for 1 item, and\n * 1 for everything else.\n *\n * @param numItems - number of items\n * @returns the index into the plural translations\n */\nexport function germanicPlural(numItems: number): number {\n\treturn numItems === 1 ? 0 : 1;\n}\n","/*\n * A minimalistic buffer implementation that can only read 32 bit unsigned\n * integers and strings.\n */\nexport class DataViewlet {\n\tprivate decoder: TextDecoder;\n\tprivate _encoding: string;\n\n\t/*\n\t * Create a DataViewlet instance. All encodings that are supported by\n\t * the runtime environments `TextDecoder` interface.\n\t *\n\t * @param array - a `Unit8Array` view on the binary buffer\n\t * @param encoding - encoding of strings, defaults to utf-8\n\t */\n\tconstructor(\n\t\tprivate readonly array: Uint8Array,\n\t\tencoding = 'utf-8',\n\t) {\n\t\tthis.decoder = new TextDecoder(encoding);\n\t\tthis._encoding = encoding;\n\t}\n\n\t/**\n\t * Get the encoding for strings.\n\t *\n\t * @returns the encoding in use\n\t */\n\tget encoding(): string {\n\t\treturn this._encoding;\n\t}\n\n\t/**\n\t * Switch to a new encoding.\n\t *\n\t * @param encoding - new encoding to use\n\t */\n\tset encoding(encoding: string) {\n\t\tthis.decoder = new TextDecoder(encoding);\n\t\tthis._encoding = encoding;\n\t}\n\t/*\n\t * Reads an unsigned 32-bit integer from the buffer at\n\t * the specified offset as big-endian.\n\t *\n\t * @param offset - Number of bytes to skip before starting to read.\n\t * Must satisfy `0 <= offset <= buf.length - 4`.\n\t * Default: 0.\n\t * @returns the 32-bit unsigned integer at position `offset`.s\n\t */\n\treadUInt32BE(offset = 0): number {\n\t\tif (offset + 4 > this.array.byteLength + this.array.byteOffset) {\n\t\t\tthrow new Error('read past array end');\n\t\t}\n\n\t\treturn (\n\t\t\t(((this.array[offset] << 24) >>> 0) |\n\t\t\t\t(this.array[offset + 1] << 16) |\n\t\t\t\t(this.array[offset + 2] << 8) |\n\t\t\t\tthis.array[offset + 3]) >>>\n\t\t\t0\n\t\t);\n\t}\n\n\t/*\n\t * Reads an unsigned 32-bit integer from the buffer at\n\t * the specified offset as little-endian.\n\t *\n\t * @param offset - Number of bytes to skip before starting to read.\n\t * Must satisfy `0 <= offset <= buf.length - 4`.\n\t * Default: 0.\n\t * @returns the 32-bit unsigned integer at position `offset`.s\n\t */\n\treadUInt32LE(offset = 0): number {\n\t\tif (offset + 4 > this.array.byteLength + this.array.byteOffset) {\n\t\t\tthrow new Error('read past array end');\n\t\t}\n\n\t\treturn (\n\t\t\t(((this.array[offset + 3] << 24) >>> 0) |\n\t\t\t\t(this.array[offset + 2] << 16) |\n\t\t\t\t(this.array[offset + 1] << 8) |\n\t\t\t\tthis.array[offset]) >>>\n\t\t\t0\n\t\t);\n\t}\n\n\t/*\n\t * Read a string at a specified offset.\n\t *\n\t * @param offset - to beginning of buffer in bytes\n\t * @param length - of the string to read in bytes or to the end of the\n\t * buffer if not specified.\n\t */\n\treadString(offset = 0, length?: number): string {\n\t\tif (\n\t\t\toffset + (length as number) >\n\t\t\tthis.array.byteLength + this.array.byteOffset\n\t\t) {\n\t\t\tthrow new Error('read past array end');\n\t\t}\n\n\t\tif (typeof length === 'undefined') {\n\t\t\tlength = this.array.byteLength - offset;\n\t\t}\n\n\t\treturn this.decoder.decode(this.array.slice(offset, offset + length));\n\t}\n}\n","import { Catalog } from '../core/catalog';\nimport { germanicPlural } from '../core/germanic-plural';\nimport { DataViewlet } from '../core/data-viewlet';\n\n/* eslint-disable @typescript-eslint/no-explicit-any, no-control-regex, no-bitwise */\n\ninterface POHeader {\n\t[key: string]: string;\n}\n\n/*\n * Parse an MO file.\n *\n * An exception is thrown for invalid data.\n *\n * @param raw - The input as either a binary `String`, any `Array`-like byte\n * storage (`Array`, `Uint8Array`, `Arguments`, `jQuery(Array)`, ...)\n * @returns a Catalog\n */\nexport function parseMoCatalog(raw: ArrayBuffer): Catalog {\n\tconst catalog: Catalog = {\n\t\tmajor: 0,\n\t\tminor: 0,\n\t\tentries: {},\n\t\tpluralFunction: germanicPlural,\n\t};\n\tlet offset = 0;\n\n\tconst blob = new DataViewlet(new Uint8Array(raw), 'ascii');\n\n\tconst magic = blob.readUInt32LE(offset);\n\n\ttype Reader = (buf: DataViewlet, off: number) => number;\n\tlet reader: Reader;\n\tif (magic === 0x950412de) {\n\t\t/* eslint-disable-next-line @typescript-eslint/explicit-function-return-type */\n\t\treader = (buf, off) => buf.readUInt32LE(off);\n\t} else if (magic === 0xde120495) {\n\t\t/* eslint-disable-next-line @typescript-eslint/explicit-function-return-type */\n\t\treader = (buf, off) => buf.readUInt32BE(off);\n\t} else {\n\t\tthrow new Error(`invalid MO magic 0x${magic.toString(16)}`);\n\t}\n\n\toffset += 4;\n\n\t// The revision is encoded in two shorts, major and minor. We don't care\n\t// about the minor revision.\n\tconst major = reader(blob, offset) >> 16;\n\toffset += 4;\n\tif (major > 0) {\n\t\tthrow new Error(`unsupported major revision ${major}`);\n\t}\n\tconst numStrings = reader(blob, offset);\n\toffset += 4;\n\tconst msgidOffset = reader(blob, offset);\n\toffset += 4;\n\tconst msgstrOffset = reader(blob, offset);\n\n\toffset = msgidOffset;\n\tconst origTab = [];\n\tfor (let i = 0; i < numStrings; ++i) {\n\t\tconst l = reader(blob, offset);\n\t\toffset += 4;\n\t\tconst stringOffset = reader(blob, offset);\n\t\toffset += 4;\n\t\torigTab.push([l, stringOffset]);\n\t}\n\n\toffset = msgstrOffset;\n\tconst transTab = [];\n\tfor (let i = 0; i < numStrings; ++i) {\n\t\tconst l = reader(blob, offset);\n\t\toffset += 4;\n\t\tconst stringOffset = reader(blob, offset);\n\t\toffset += 4;\n\t\ttransTab.push([l, stringOffset]);\n\t}\n\n\tconst poHeader: POHeader = {};\n\tfor (let i = 0; i < numStrings; ++i) {\n\t\tconst orig = origTab[i];\n\t\tlet l = orig[0];\n\t\toffset = orig[1];\n\n\t\tconst msgid = blob.readString(offset, l).split('\\u0000')[0];\n\n\t\tconst trans = transTab[i];\n\t\tl = trans[0];\n\t\toffset = trans[1];\n\n\t\tconst msgstr = blob.readString(offset, l).split('\\u0000');\n\n\t\tlet pairs, kv;\n\t\tif (i === 0 && msgid === '') {\n\t\t\tpairs = msgstr[0].split('\\n');\n\t\t\tfor (let j = 0; j < pairs.length; ++j) {\n\t\t\t\tif (pairs[j] !== '') {\n\t\t\t\t\tkv = pairs[j].split(/[ \\t]*:[ \\t]*/);\n\t\t\t\t\tpoHeader[kv[0].toLowerCase()] = kv[1];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (poHeader['content-type'] !== undefined) {\n\t\t\t\tconst enc = poHeader['content-type'].replace(/.*=/, '');\n\t\t\t\tif (enc !== poHeader['content-type']) {\n\t\t\t\t\tblob.encoding = enc;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tcatalog.entries[msgid] = msgstr;\n\t}\n\n\treturn catalog;\n}\n","import { Catalog } from '../core/catalog';\n\nexport function validateMoJsonCatalog(udata: unknown): Catalog {\n\t// We could use ajv but it results in almost 300 k minimized code\n\t// for the browser bundle. This validator instead is absolutely\n\t// minimalistic, and only avoids exceptions that can occur, when\n\t// accessing entries.\n\n\tif (udata === null || typeof udata === 'undefined') {\n\t\tthrow new Error('catalog is either null or undefined');\n\t}\n\n\tconst data = udata as Catalog;\n\tif (data.constructor !== Object) {\n\t\tthrow new Error('catalog must be a dictionary');\n\t}\n\n\t// We don't care about major and minor because they are actually not\n\t// used.\n\n\tif (!Object.prototype.hasOwnProperty.call(data, 'entries')) {\n\t\tthrow new Error('catalog.entries does not exist');\n\t}\n\n\tconst entries = data.entries;\n\tif (entries === null || typeof entries === 'undefined') {\n\t\tthrow new Error('catalog.entries are not defined or null');\n\t}\n\n\tif (entries.constructor !== Object) {\n\t\tthrow new Error('catalog.entries must be a dictionary');\n\t}\n\n\tfor (const [key, value] of Object.entries(entries)) {\n\t\tif (!Array.isArray(value)) {\n\t\t\tthrow new Error(`catalog entry for key '${key}' is not an array`);\n\t\t}\n\t}\n\n\treturn data;\n}\n\nexport function parseMoJsonCatalog(json: ArrayBuffer): Catalog {\n\tconst text = new TextDecoder().decode(json);\n\tconst data = JSON.parse(text) as unknown;\n\n\treturn validateMoJsonCatalog(data);\n}\n","import { Catalog } from '../core/catalog';\n\nexport function validateJsonCatalog(udata: unknown): Catalog {\n\t// We could use ajv but it results in almost 300 k minimized code\n\t// for the browser bundle. This validator instead is absolutely\n\t// minimalistic, and only avoids exceptions that can occur, when\n\t// accessing entries.\n\n\tif (udata === null || typeof udata === 'undefined') {\n\t\tthrow new Error('catalog is either null or undefined');\n\t}\n\n\tconst entries = udata;\n\tif (entries.constructor !== Object) {\n\t\tnew Error('catalog must be a dictionary');\n\t}\n\n\t// Convert to a regular catalog.\n\tconst catalog: Catalog = {\n\t\tmajor: 0,\n\t\tminor: 1,\n\t\tpluralFunction: () => 0,\n\t\tentries: {},\n\t};\n\n\tfor (const [msgid, msgstr] of Object.entries(entries)) {\n\t\t// Just stringify all values but do not complain.\n\t\tcatalog.entries[msgid] = [msgstr.toString()];\n\t}\n\n\treturn catalog;\n}\n\nexport function parseJsonCatalog(json: ArrayBuffer): Catalog {\n\tconst text = new TextDecoder().decode(json);\n\tconst data = JSON.parse(text) as unknown;\n\n\treturn validateJsonCatalog(data);\n}\n","const tagHyphenRegex = new RegExp('^[a-z0-9]+(?:-[a-z0-9]+)*$', 'i');\nconst tagUnderscoreRegex = new RegExp('^[a-z0-9]+(?:_[a-z0-9]+)*$', 'i');\n\nexport interface SplitLocale {\n\ttags: Array<string>;\n\tunderscoreSeparator: boolean;\n\tcharset?: string;\n\tmodifier?: string;\n}\n\nexport function splitLocale(locale: string): SplitLocale | null {\n\tlet charset: string = '',\n\t\tmodifier: string = '';\n\n\tconst underscoreSeparator = locale.includes('_');\n\n\tlocale = locale.replace(/@([a-z]+)$/i, (_, match: string) => {\n\t\tmodifier = match;\n\t\treturn '';\n\t});\n\n\tlocale = locale.replace(/\\.([-0-9a-z]+)$/i, (_, match: string) => {\n\t\tcharset = match;\n\t\treturn '';\n\t});\n\n\tif (underscoreSeparator) {\n\t\tif (!tagUnderscoreRegex.exec(locale)) {\n\t\t\treturn null;\n\t\t}\n\t} else {\n\t\tif (!tagHyphenRegex.exec(locale)) {\n\t\t\treturn null;\n\t\t}\n\t}\n\n\tconst separator = underscoreSeparator ? '_' : '-';\n\tconst tags = locale.split(separator);\n\n\tconst split: SplitLocale = { tags: tags, underscoreSeparator };\n\n\tif (charset.length) {\n\t\tsplit.charset = charset;\n\t}\n\n\tif (modifier.length) {\n\t\tsplit.modifier = modifier;\n\t}\n\n\treturn split;\n}\n","import { validateMoJsonCatalog } from '../parser';\nimport { Catalog } from './catalog';\n\ninterface CatalogCacheInterface {\n\t// Locale Key.\n\t[key: string]: {\n\t\t// Textdomain.\n\t\t[key: string]: Catalog | Promise<Catalog> | null;\n\t};\n}\n\n/*\n * Caches catalog lookups by path, locale, and textdomain.\n *\n * Failed lookups are stored as null values.\n *\n * It is also possible to store a Promise. In that case, if a request is\n * made to bind the textdomain, the promise is settled. Note that this\n * mechanism is never used for message lookup but only for loading the\n * catalog via resolve.\n */\nexport class CatalogCache {\n\tprivate static instance: CatalogCache;\n\tprivate static cache: CatalogCacheInterface = {};\n\n\tprivate constructor() {\n\t\t/* Singleton. */\n\t}\n\n\tstatic getInstance(): CatalogCache {\n\t\tif (!CatalogCache.instance) {\n\t\t\tCatalogCache.instance = new CatalogCache();\n\t\t}\n\n\t\treturn CatalogCache.instance;\n\t}\n\n\tstatic clear(): void {\n\t\tCatalogCache.cache = {};\n\t}\n\n\t/**\n\t * Lookup a Catalog for a given base path, locale, and textdomain.\n\t *\n\t * The locale key is usually the locale identifier (e.g. de-DE or sr\\@latin).\n\t * But it can also be a colon separated list of such locale identifiers.\n\t *\n\t *\n\t * @param localeKey - the locale key\n\t * @param textdomain - the textdomain\n\t * @returns the cached Catalog, a Promise or null for failure\n\t */\n\tpublic static lookup(\n\t\tlocaleKey: string,\n\t\ttextdomain: string,\n\t): Catalog | Promise<Catalog> | null {\n\t\tif (CatalogCache.cache[localeKey]) {\n\t\t\tconst ptr = CatalogCache.cache[localeKey];\n\t\t\tif (Object.prototype.hasOwnProperty.call(ptr, textdomain)) {\n\t\t\t\treturn ptr[textdomain];\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tpublic static store(\n\t\tlocaleKey: string,\n\t\ttextdomain: string,\n\t\tentry: Catalog | Promise<Catalog>,\n\t): void {\n\t\tif (Promise.resolve(entry) !== entry) {\n\t\t\t// Object.\n\t\t\tentry = validateMoJsonCatalog(entry as Catalog);\n\t\t}\n\n\t\tif (!CatalogCache.cache[localeKey]) {\n\t\t\tCatalogCache.cache[localeKey] = {};\n\t\t}\n\t\tCatalogCache.cache[localeKey][textdomain] = entry;\n\t}\n}\n","import { SplitLocale } from './split-locale';\n\nexport type ExplodedLocale = Array<Array<string>>;\n\nexport function explodeLocale(\n\tlocale: SplitLocale,\n\tvary?: boolean,\n): ExplodedLocale {\n\tconst retval: ExplodedLocale = [];\n\tconst lsep = locale.underscoreSeparator ? '_' : '-';\n\tlet i = vary ? 0 : locale.tags.length - 1;\n\tconst hasCharset = typeof locale.charset !== 'undefined';\n\tconst hasModifier = typeof locale.modifier !== 'undefined';\n\n\tconst charsets = hasCharset ? [locale.charset as string] : [''];\n\tif (vary && hasCharset) {\n\t\tconst charset = locale.charset as string;\n\t\tconst ucCharset = charset.toUpperCase();\n\t\tif (ucCharset !== charset) {\n\t\t\tcharsets.push(ucCharset);\n\t\t}\n\t\tcharsets.push('');\n\t}\n\n\tfor (; i < locale.tags.length; ++i) {\n\t\tconst lingua = locale.tags.slice(0, i + 1).join(lsep);\n\t\tconst ids = new Array<string>();\n\n\t\tcharsets.forEach(charset => {\n\t\t\tlet id = charset.length ? lingua + '.' + charset : lingua;\n\t\t\tif (hasModifier) {\n\t\t\t\tid += '@' + locale.modifier;\n\t\t\t}\n\t\t\tids.push(id);\n\t\t});\n\t\tretval.push(ids);\n\t}\n\n\treturn retval;\n}\n","import { TransportHttp } from '../transport/http';\nimport { TransportFs } from '../transport/fs';\nimport { Transport } from '../transport/transport.interface';\nimport {\n\tparseMoJsonCatalog,\n\tparseJsonCatalog,\n\tparseMoCatalog,\n} from '../parser';\nimport { browserEnvironment } from './browser-environment';\nimport { Catalog, CatalogEntries } from './catalog';\nimport { SplitLocale, splitLocale } from './split-locale';\nimport { germanicPlural } from './germanic-plural';\nimport { CatalogCache } from './catalog-cache';\nimport { explodeLocale, ExplodedLocale } from './explode-locale';\nimport { LocaleContainer } from './locale-container';\n\ntype PluralFunction = (numItems: number) => number;\n\nconst isBrowser = process.env.BROWSER_ENV;\n\nasync function loadCatalog(url: string, format: string): Promise<Catalog | null> {\n\tlet transportInstance: Transport;\n\n\tif (!isBrowser) {\n\t\tlet transport;\n\t\t// Check whether this is a valid URL.\n\t\ttry {\n\t\t\tconst parsedURL = new URL(url);\n\t\t\tif (\n\t\t\t\tparsedURL.protocol === 'https:' ||\n\t\t\t\tparsedURL.protocol === 'http:' ||\n\t\t\t\tparsedURL.protocol === 'file:'\n\t\t\t) {\n\t\t\t\ttransport = 'http';\n\t\t\t} else {\n\t\t\t\tthrow new Error(`unsupported scheme ${parsedURL.protocol}`);\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tif (browserEnvironment()) {\n\t\t\t\ttransport = 'http';\n\t\t\t} else {\n\t\t\t\ttransport = 'fs';\n\t\t\t}\n\t\t}\n\n\t\tif (transport === 'http') {\n\t\t\ttransportInstance = new TransportHttp();\n\t\t} else {\n\t\t\ttransportInstance = new TransportFs();\n\t\t}\n\t} else {\n\t\ttransportInstance = new TransportHttp();\n\t}\n\n\ttype Validator = (data: ArrayBuffer) => Catalog;\n\tlet validator: Validator;\n\tif ('mo.json' === format) {\n\t\tvalidator = parseMoJsonCatalog;\n\t} else if ('.json' === format) {\n\t\tvalidator = parseJsonCatalog;\n\t} else {\n\t\tvalidator = parseMoCatalog;\n\t}\n\n\ttry {\n\t\tconst data = await transportInstance.loadFile(url);\n\n\t\treturn validator(data);\n\t} catch {\n\t\treturn null;\n\t}\n}\n\nfunction assemblePath(\n\tbase: string,\n\tid: string,\n\tdomainname: string,\n\textender: string,\n): string {\n\treturn `${base}/${id}/LC_MESSAGES/${domainname}.${extender}`;\n}\n\nasync function loadLanguageFromObject(\n\tids: Array<string>,\n\tbase: LocaleContainer,\n\tdomainname: string,\n): Promise<Catalog | null> {\n\tfor (let i = 0; i < ids.length; ++i) {\n\t\tconst id = ids[i];\n\t\t// Language exists?\n\t\tif (!Object.prototype.hasOwnProperty.call(base, id)) {\n\t\t\tcontinue;\n\t\t}\n\t\t// LC_MESSAGES?\n\t\tif (!Object.prototype.hasOwnProperty.call(base[id], 'LC_MESSAGES')) {\n\t\t\tcontinue;\n\t\t}\n\t\t// Textdomain?\n\t\tif (\n\t\t\t!Object.prototype.hasOwnProperty.call(base[id].LC_MESSAGES, domainname)\n\t\t) {\n\t\t\tcontinue;\n\t\t}\n\n\t\treturn base[id].LC_MESSAGES[domainname];\n\t}\n\n\treturn null;\n}\n\n/*\n * First tries to load a catalog with the specified charset, then with the\n * charset converted to uppercase (if it differs from the original charset),\n * and finally without a charset.\n */\nasync function loadLanguage(\n\tids: Array<string>,\n\tbase: string | LocaleContainer,\n\tdomainname: string,\n\tformat: string,\n): Promise<Catalog | null> {\n\t// Check if `base` is an object (LocaleContainer).\n\tif (typeof base === 'object' && base !== null) {\n\t\treturn loadLanguageFromObject(ids, base, domainname);\n\t}\n\n\tfor (const id of ids) {\n\t\tconst catalog = await loadCatalog(assemblePath(base as string, id, domainname, format), format);\n\t\tif (catalog) {\n\t\t\treturn catalog;\n\t\t}\n\t}\n\n\treturn null;\n}\n\nasync function loadDomain(\n\texploded: ExplodedLocale,\n\tlocaleKey: string,\n\tbase: string | LocaleContainer,\n\tdomainname: string,\n\tformat: string,\n): Promise<Catalog> {\n\tconst entries: CatalogEntries = {};\n\n\tconst catalog: Catalog = {\n\t\tmajor: 0,\n\t\tminor: 0,\n\t\tpluralFunction: germanicPlural,\n\t\tentries,\n\t};\n\n\tconst cacheHit = await CatalogCache.lookup(localeKey, domainname);\n\tif (cacheHit !== null) {\n\t\treturn cacheHit;\n\t}\n\n\tfor (const tries of exploded) {\n\t\tconst result = await loadLanguage(tries, base, domainname, format);\n\t\tif (result) {\n\t\t\tcatalog.major = result.major;\n\t\t\tcatalog.minor = result.minor;\n\t\t\tcatalog.entries = { ...catalog.entries, ...result.entries };\n\t\t}\n\t}\n\n\treturn catalog;\n}\n\nfunction pluralExpression(str: string): PluralFunction {\n\tconst tokens = str\n\t\t.replace(/[ \\t\\r\\013\\014]/g, '')\n\t\t.replace(/;$/, '')\n\t\t// Do NOT allow square brackets here. JSFuck!\n\t\t.split(/[<>!=]=|&&|\\|\\||[-!*/%+<>=?:;]/);\n\n\tfor (let i = 0; i < tokens.length; ++i) {\n\t\tconst token = tokens[i].replace(/^\\(+/, '').replace(/\\)+$/, '');\n\t\tif (\n\t\t\ttoken !== 'nplurals' &&\n\t\t\ttoken !== 'plural' &&\n\t\t\ttoken !== 'n' &&\n\t\t\t// Does not catch invalid octal numbers but the compiler\n\t\t\t// takes care of that.\n\t\t\tnull === /^[0-9]+$/.exec(token)\n\t\t) {\n\t\t\tthrow new Error('invalid plural function');\n\t\t}\n\t}\n\n\tconst code = 'var nplurals = 1, plural = 0;' + str + '; return 0 + plural';\n\n\t// This may throw an exception!\n\t// eslint-disable-next-line @typescript-eslint/no-implied-eval\n\treturn new Function('n', code) as PluralFunction;\n}\n\nfunction setPluralFunction(catalog: Catalog): Catalog {\n\tif (!Object.prototype.hasOwnProperty.call(catalog.entries, '')) {\n\t\treturn catalog;\n\t}\n\n\tconst headers = catalog.entries[''][0].split('\\n');\n\theaders.forEach(header => {\n\t\tconst tokens = header.split(':');\n\t\tif ('plural-forms' === (tokens.shift() as string).toLowerCase()) {\n\t\t\tconst code = tokens.join(':');\n\t\t\ttry {\n\t\t\t\tcatalog.pluralFunction = pluralExpression(code);\n\t\t\t} catch {\n\t\t\t\tcatalog.pluralFunction = germanicPlural;\n\t\t\t}\n\t\t}\n\t});\n\n\treturn catalog;\n}\n\nexport async function resolveImpl(\n\tdomainname: string,\n\tpath: string | LocaleContainer,\n\tformat: string,\n\tlocaleKey: string,\n): Promise<Catalog> {\n\tconst defaultCatalog: Catalog = {\n\t\tmajor: 0,\n\t\tminor: 0,\n\t\tpluralFunction: germanicPlural,\n\t\tentries: {},\n\t};\n\n\tif (localeKey === 'C' || localeKey === 'POSIX') {\n\t\treturn defaultCatalog;\n\t}\n\n\tconst exploded = explodeLocale(splitLocale(localeKey) as SplitLocale, true);\n\tconst catalog = await loadDomain(exploded, localeKey, path, domainname, format);\n\tsetPluralFunction(catalog);\n\tCatalogCache.store(localeKey, domainname, catalog);\n\treturn catalog;\n}\n","import { Catalog } from './catalog';\nimport { germanicPlural } from './germanic-plural';\n\ninterface GettextImplArgs {\n\tmsgid: string;\n\tcatalog: Catalog;\n\tmsgidPlural?: string;\n\tnumItems?: number;\n\tmsgctxt?: string;\n}\n\nexport function gettextImpl(args: GettextImplArgs): string {\n\tconst key =\n\t\ttypeof args.msgctxt === 'undefined'\n\t\t\t? args.msgid\n\t\t\t: args.msgctxt + '\\u0004' + args.msgid;\n\tconst translations = args.catalog.entries[key];\n\tconst numItems = args.numItems ?? 1;\n\n\tif (translations && translations.length) {\n\t\tif (typeof args.msgidPlural === 'undefined') {\n\t\t\treturn translations[0];\n\t\t} else {\n\t\t\tlet pluralForm = args.catalog.pluralFunction(numItems);\n\t\t\tif (pluralForm >= translations.length) {\n\t\t\t\tif (translations.length === 1) {\n\t\t\t\t\treturn translations[0];\n\t\t\t\t} else {\n\t\t\t\t\tpluralForm = germanicPlural(numItems);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn translations[pluralForm];\n\t\t}\n\t} else if (typeof args.msgidPlural !== 'undefined') {\n\t\tconst pluralform = args.catalog.pluralFunction(numItems);\n\t\tif (pluralform === 1) {\n\t\t\treturn args.msgidPlural;\n\t\t}\n\t}\n\n\treturn args.msgid;\n}\n","export const isNode =\n\ttypeof process !== 'undefined' &&\n\tprocess.versions !== null &&\n\tprocess.versions.node !== null;\n\nexport const pathSeparator =\n\tisNode && process.platform === 'win32' ? '\\\\' : '/';\n","import { splitLocale } from './split-locale';\n\nfunction tagsEqual(left: Array<string>, right: Array<string>): boolean {\n\tif (left.length !== right.length) {\n\t\treturn false;\n\t}\n\n\tfor (let i = 0; i < left.length; ++i) {\n\t\tif (left[i].toLowerCase() !== right[i].toLowerCase()) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}\n\nexport function selectLocale(\n\tsupported: Array<string>,\n\trequested: Array<string>,\n): string {\n\tlet languageMatch: string = '';\n\n\tfor (let i = 0; i < requested.length; ++i) {\n\t\tconst wanted = splitLocale(requested[i]);\n\t\tif (!wanted) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tfor (let j = 0; j < supported.length; ++j) {\n\t\t\tconst got = splitLocale(supported[j]);\n\t\t\tif (!got) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (tagsEqual(wanted.tags, got.tags)) {\n\t\t\t\treturn supported[j];\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\t!languageMatch.length &&\n\t\t\t\twanted.tags[0].toLowerCase() === got.tags[0].toLowerCase()\n\t\t\t) {\n\t\t\t\tlanguageMatch = supported[j];\n\t\t\t}\n\t\t}\n\t}\n\n\tif (languageMatch.length) {\n\t\treturn languageMatch;\n\t}\n\n\treturn 'C';\n}\n","import { resolveImpl } from './resolve-impl';\nimport { CatalogCache } from './catalog-cache';\nimport type { Catalog } from './catalog';\nimport { browserEnvironment } from './browser-environment';\nimport { gettextImpl } from './gettext-impl';\nimport { germanicPlural } from './germanic-plural';\nimport { splitLocale } from './split-locale';\nimport { pathSeparator } from './platform';\nimport { userLocales } from './user-locales';\nimport { selectLocale } from './select-locale';\nimport type { LocaleContainer } from './locale-container';\n\n/**\n * Represents a mapping of placeholder strings to the values that they should be replaced with.\n * Placeholders must match the regular expression `/^[_a-zA-Z][_a-zA-Z0-9]*$/`.\n * @remarks\n * Placeholders provide a way to dynamically replace certain strings in a translatable message.\n *\n * @example\n * ```typescript\n * const placeholders: Placeholders = {\n * \t'name': 'John Doe',\n * \t'age': 30,\n * \t// Add more placeholders as needed\n * };\n * ```\n *\n * A typical call would look like this:\n *\n * ```typescript\n * console.log(gtx._x('User {name} is {age} years old.'));\n * ```\n * @public\n */\nexport interface Placeholders {\n\t/* eslint-disable-next-line @typescript-eslint/no-explicit-any */\n\t[placeholder: string]: any;\n}\n\n/**\n * A Textdomain is a container for an esgettext configuration and all loaded\n * LocaleContainer for the textual domain selected.\n *\n * The actual translation methods have quite funny names like `_()` or\n * `_x()`. The purpose of this naming convention is to make the\n * internationalization of your programs as little obtrusive as possible.\n * Most of the times you just have to exchange\n *\n * ```\n * doSomething('Hello, world!');\n * ```\n *\n * with\n *\n * ```\n * doSomething(gtx._('Hello, world!'));\n * ```\n *\n * Besides, depending on the string extractor you are using, it may be useful\n * that the method names do not collide with method names from other packages.\n */\nexport class Textdomain {\n\tprivate static domains: { [key: string]: Textdomain } = {};\n\tprivate static boundDomains: { [key: string]: string | LocaleContainer } = {};\n\tprivate static _locale = 'C';\n\n\tprivate domain: string;\n\tprivate _catalogFormat = 'mo.json';\n\tprivate catalog: Catalog = undefined as unknown as Catalog;\n\n\t/**\n\t * Retrieve a translation for a string.\n\t *\n\t * @param msgid - the string to translate\n\t *\n\t * @returns the translated string\n\t */\n\t_(msgid: string) {\n\t\treturn gettextImpl({ msgid: msgid, catalog: this.catalog });\n\t}\n\n\t/**\n\t * Retrieve a translation for a string containing a possible plural.\n\t * You will almost always want to call {@link _nx} instead so that\n\t * you can interpolate the number of items into the strings.\n\t *\n\t * @param msgid - the string in the singular\n\t * @param msgidPlural - the string in the plural\n\t * @param numItems - the number of items\n\t *\n\t * @returns the translated string\n\t */\n\t_n(msgid: string, msgidPlural: string, numItems: number) {\n\t\treturn gettextImpl({\n\t\t\tmsgid: msgid,\n\t\t\tmsgidPlural: msgidPlural,\n\t\t\tnumItems: numItems,\n\t\t\tcatalog: this.catalog,\n\t\t});\n\t}\n\n\t/**\n\t * Translate a string with a context.\n\t *\n\t * @param msgctxt - the message context\n\t * @param msgid - the string to translate\n\t *\n\t * @returns the translated string\n\t */\n\t_p(msgctxt: string, msgid: string) {\n\t\treturn gettextImpl({\n\t\t\tmsgctxt: msgctxt,\n\t\t\tmsgid: msgid,\n\t\t\tcatalog: this.catalog,\n\t\t});\n\t}\n\n\t/**\n\t * The method `_np()` combines `_n()` with `_p()`.\n\t * You will almost always want to call {@link _npx} instead so that\n\t * you can interpolate the number of items into the strings.\n\n\t *\n\t * @param msgctxt - the message context\n\t * @param msgid - the message id\n\t * @param placeholders - a dictionary with placehoders\n\t * @returns the translated string\n\t */\n\t_np(msgctxt: string, msgid: string, msgidPlural: string, numItems: number) {\n\t\treturn gettextImpl({\n\t\t\tmsgctxt: msgctxt,\n\t\t\tmsgid: msgid,\n\t\t\tmsgidPlural: msgidPlural,\n\t\t\tnumItems: numItems,\n\t\t\tcatalog: this.catalog,\n\t\t});\n\t}\n\n\t/**\n\t * Translate a string with placeholders. The placeholders should be\n\t * wrapped into curly braces and must match the regular expression\n\t * \"[_a-zA-Z][_a-zA-Z0-9]*\".\n\t *\n\t * @param msgid - the msgid to translate\n\t * @param placeholders - an optional dictionary of placeholders\n\t *\n\t * @returns the translated string with placeholders expanded\n\t */\n\t_x(msgid: string, placeholders?: Placeholders) {\n\t\treturn Textdomain.expand(\n\t\t\tgettextImpl({ msgid: msgid, catalog: this.catalog }),\n\t\t\tplaceholders || {},\n\t\t);\n\t}\n\n\t/**\n\t * Translate a string with a plural expression with placeholders.\n\t *\n\t * @param msgid - the string in the singular\n\t * @param msgidPlural - the string in the plural\n\t * @param numItems - the number of items\n\t * @param placeholders - an optional dictionary of placeholders\n\t *\n\t * @returns the translated string\n\t */\n\t_nx(\n\t\tmsgid: string,\n\t\tmsgidPlural: string,\n\t\tnumItems: number,\n\t\tplaceholders?: Placeholders,\n\t) {\n\t\treturn Textdomain.expand(\n\t\t\tgettextImpl({\n\t\t\t\tmsgid: msgid,\n\t\t\t\tmsgidPlural: msgidPlural,\n\t\t\t\tnumItems: numItems,\n\t\t\t\tcatalog: this.catalog,\n\t\t\t}),\n\t\t\tplaceholders || {},\n\t\t);\n\t}\n\n\t/**\n\t * The method `_px()` combines `_p()` with `_x()`.\n\t *\n\t * @param msgctxt - the message context\n\t * @param msgid - the message id\n\t * @param placeholders - an optional dictionary with placehoders\n\t * @returns the translated string\n\t */\n\t_px(msgctxt: string, msgid: string, placeholders?: Placeholders) {\n\t\treturn Textdomain.expand(\n\t\t\tgettextImpl({ msgctxt: msgctxt, msgid: msgid, catalog: this.catalog }),\n\t\t\tplaceholders || {},\n\t\t);\n\t}\n\n\t/**\n\t * The method `_npx()` brings it all together. It combines `_n()` and\n\t * `_p()` and `_x()`.\n\t *\n\t * @param msgctxt - the message context\n\t * @param msgid - the message id\n\t * @param msgidPlural - the plural string\n\t * @param numItems - the number of items\n\t * @param placeholders - an optional dictionary with placehoders\n\t * @returns the translated string\n\t */\n\t_npx(\n\t\tmsgctxt: string,\n\t\tmsgid: string,\n\t\tmsgidPlural: string,\n\t\tnumItems: number,\n\t\tplaceholders?: Placeholders,\n\t) {\n\t\treturn Textdomain.expand(\n\t\t\tgettextImpl({\n\t\t\t\tmsgctxt: msgctxt,\n\t\t\t\tmsgid: msgid,\n\t\t\t\tmsgidPlural: msgidPlural,\n\t\t\t\tnumItems: numItems,\n\t\t\t\tcatalog: this.catalog,\n\t\t\t}),\n\t\t\tplaceholders || {},\n\t\t);\n\t}\n\n\tprivate static getCatalog(locale: string, textdomain: string): Catalog {\n\t\tconst catalog = CatalogCache.lookup(locale, textdomain);\n\t\tif (!catalog || Promise.resolve(catalog) === catalog) {\n\t\t\treturn {\n\t\t\t\tmajor: 0,\n\t\t\t\tminor: 0,\n\t\t\t\tpluralFunction: germanicPlural,\n\t\t\t\tentries: {},\n\t\t\t};\n\t\t}\n\n\t\treturn catalog as Catalog;\n\t}\n\n\t/**\n\t * Retrieve a translation for a string with a fixed locale.\n\t *\n\t * @param locale - the locale identifier\n\t * @param msgid - the string to translate\n\t *\n\t * @returns the translated string\n\t */\n\t_l(locale: string, msgid: string) {\n\t\tconst catalog = Textdomain.getCatalog(locale, this.textdomain());\n\t\treturn gettextImpl({ msgid: msgid, catalog: catalog });\n\t}\n\n\t/**\n\t * Retrieve a translation for a string containing a possible plural with\n\t * a fixed locale.\n\t * You will almost always want to call {@link _nx} instead so that\n\t * you can interpolate the number of items into the strings.\n\t *\n\t * @param locale - the locale identifier\n\t * @param msgid - the string in the singular\n\t * @param msgidPlural - the string in the plural\n\t * @param numItems - the number of items\n\t *\n\t * @returns the translated string\n\t */\n\t_ln(locale: string, msgid: string, msgidPlural: string, numItems: number) {\n\t\tconst catalog = Textdomain.getCatalog(locale, this.textdomain());\n\t\treturn gettextImpl({\n\t\t\tmsgid: msgid,\n\t\t\tmsgidPlural: msgidPlural,\n\t\t\tnumItems: numItems,\n\t\t\tcatalog: catalog,\n\t\t});\n\t}\n\n\t/**\n\t * Translate a string with a context with a fixed locale.\n\t *\n\t * @param locale - the locale identifier\n\t * @param msgctxt - the message context\n\t * @param msgid - the string to translate\n\t *\n\t * @returns the translated string\n\t */\n\t_lp(locale: string, msgctxt: string, msgid: string) {\n\t\tconst catalog = Textdomain.getCatalog(locale, this.textdomain());\n\t\treturn gettextImpl({ msgctxt: msgctxt, msgid: msgid, catalog: catalog });\n\t}\n\n\t/**\n\t * The method `_lnp()` combines `_ln()` with `_lp()`.\n\t * You will almost always want to call {@link _npx} instead so that\n\t * you can interpolate the number of items into the strings.\n\n\t *\n\t * @param locale - the locale identifier\n\t * @param msgctxt - the message context\n\t * @param msgid - the message id\n\t * @param placeholders - a dictionary with placehoders\n\t * @returns the translated string\n\t */\n\t_lnp(\n\t\tlocale: string,\n\t\tmsgctxt: string,\n\t\tmsgid: string,\n\t\tmsgidPlural: string,\n\t\tnumItems: number,\n\t) {\n\t\tconst catalog = Textdomain.getCatalog(locale, this.textdomain());\n\t\treturn gettextImpl({\n\t\t\tmsgctxt: msgctxt,\n\t\t\tmsgid: msgid,\n\t\t\tmsgidPlural: msgidPlural,\n\t\t\tnumItems: numItems,\n\t\t\tcatalog: catalog,\n\t\t});\n\t}\n\n\t/**\n\t * Translate a string with placeholders for a fixed locale.\n\t * The placeholders should be\n\t * wrapped into curly braces and must match the regular expression\n\t * \"[_a-zA-Z][_a-zA-Z0-9]*\".\n\t *\n\t * @param locale - the locale identifier\n\t * @param msgid - the msgid to translate\n\t * @param placeholders - an optional dictionary of placeholders\n\t *\n\t * @returns the translated string with placeholders expanded\n\t */\n\t_lx(locale: string, msgid: string, placeholders?: Placeholders) {\n\t\tconst catalog = Textdomain.getCatalog(locale, this.textdomain());\n\t\treturn Textdomain.expand(\n\t\t\tgettextImpl({ msgid: msgid, catalog: catalog }),\n\t\t\tplaceholders || {},\n\t\t);\n\t}\n\n\t/**\n\t * Translate a string with a plural expression with placeholders into a\n\t * fixed locale.\n\t *\n\t * @param locale - the locale identifier\n\t * @param msgid - the string in the singular\n\t * @param msgidPlural - the string in the plural\n\t * @param numItems - the number of items\n\t * @param placeholders - an optional dictionary of placeholders\n\t *\n\t * @returns the translated string\n\t */\n\t_lnx(\n\t\tlocale: string,\n\t\tmsgid: string,\n\t\tmsgidPlural: string,\n\t\tnumItems: number,\n\t\tplaceholders?: Placeholders,\n\t) {\n\t\tconst catalog = Textdomain.getCatalog(locale, this.textdomain());\n\t\treturn Textdomain.expand(\n\t\t\tgettextImpl({\n\t\t\t\tmsgid: msgid,\n\t\t\t\tmsgidPlural: msgidPlural,\n\t\t\t\tnumItems: numItems,\n\t\t\t\tcatalog: catalog,\n\t\t\t}),\n\t\t\tplaceholders || {},\n\t\t);\n\t}\n\n\t/**\n\t * The method `_lpx()` combines `_lp()` with `_lx()`.\n\t *\n\t * @param locale - the locale identifier\n\t * @param msgctxt - the message context\n\t * @param msgid - the message id\n\t * @param placeholders - an optional dictionary with placehoders\n\t * @returns the translated string\n\t */\n\t_lpx(\n\t\tlocale: string,\n\t\tmsgctxt: string,\n\t\tmsgid: string,\n\t\tplaceholders?: Placeholders,\n\t) {\n\t\tconst catalog = Textdomain.getCatalog(locale, this.textdomain());\n\t\treturn Textdomain.expand(\n\t\t\tgettextImpl({ msgctxt: msgctxt, msgid: msgid, catalog: catalog }),\n\t\t\tplaceholders || {},\n\t\t);\n\t}\n\n\t/**\n\t * The method `_lnpx()` brings it all together. It combines `_ln()` and\n\t * `_lp()` and `_lx()`.\n\t *\n\t * @param locale - the locale identifier\n\t * @param msgctxt - the message context\n\t * @param msgid - the message id\n\t * @param msgidPlural - the plural string\n\t * @param numItems - the number of items\n\t * @param placeholders - an optional dictionary with placehoders\n\t * @returns the translated string\n\t */\n\t_lnpx(\n\t\tlocale: string,\n\t\tmsgctxt: string,\n\t\tmsgid: string,\n\t\tmsgidPlural: string,\n\t\tnumItems: number,\n\t\tplaceholders?: Placeholders,\n\t) {\n\t\tconst catalog = Textdomain.getCatalog(locale, this.textdomain());\n\t\treturn Textdomain.expand(\n\t\t\tgettextImpl({\n\t\t\t\tmsgctxt: msgctxt,\n\t\t\t\tmsgid: msgid,\n\t\t\t\tmsgidPlural: msgidPlural,\n\t\t\t\tnumItems: numItems,\n\t\t\t\tcatalog: catalog,\n\t\t\t}),\n\t\t\tplaceholders || {},\n\t\t);\n\t}\n\n\tprivate static expand(\n\t\tmsg: string,\n\t\tplaceholders: { [key: string]: string },\n\t): string {\n\t\treturn msg.replace(/\\{([a-zA-Z][0-9a-zA-Z]*)\\}/g, (_, match: string) => {\n\t\t\tif (Object.prototype.hasOwnProperty.call(placeholders, match)) {\n\t\t\t\treturn placeholders[match];\n\t\t\t} else {\n\t\t\t\treturn `{${match}}`;\n\t\t\t}\n\t\t});\n\t}\n\n\t/**\n\t * Instantiate a Textdomain object. Textdomain objects are singletons\n\t * for each textdomain identifier.\n\t *\n\t * @param textdomain - the textdomain of your application or library.\n\t *\n\t * @returns a [[`Textdomain`]]\n\t */\n\tstatic getInstance(textdomain: string): Textdomain {\n\t\tif (\n\t\t\ttypeof textdomain === 'undefined' ||\n\t\t\ttextdomain === null ||\n\t\t\ttextdomain === ''\n\t\t) {\n\t\t\tthrow new Error('Cannot instantiate TextDomain without a textdomain');\n\t\t}\n\n\t\tif (Object.prototype.hasOwnProperty.call(Textdomain.domains, textdomain)) {\n\t\t\treturn Textdomain.domains[textdomain];\n\t\t} else {\n\t\t\tconst domain = new Textdomain(textdomain);\n\t\t\tTextdomain.domains[textdomain] = domain;\n\t\t\tdomain.catalog = {\n\t\t\t\tmajor: 0,\n\t\t\t\tminor: 0,\n\t\t\t\tpluralFunction: germanicPlural,\n\t\t\t\tentries: {},\n\t\t\t};\n\n\t\t\treturn domain;\n\t\t}\n\t}\n\n\t/**\n\t * Delete all existing singletons. This method should usually be called\n\t * only, when you want to free memory.\n\t */\n\tstatic clearInstances(): void {\n\t\tTextdomain.boundDomains = {};\n\t}\n\n\t/**\n\t * This method is used for testing. Do not use it yourself!\n\t */\n\tstatic forgetInstances(): void {\n\t\tTextdomain.clearInstances();\n\t\tTextdomain.domains = {};\n\t}\n\n\t/**\n\t * Query the locale in use.\n\t */\n\tstatic get locale(): string {\n\t\treturn Textdomain._locale;\n\t}\n\n\t/**\n\t * Change the locale.\n\t *\n\t * For the web you can use all valid language identifier tags that\n\t * [BCP47](https://tools.ietf.org/html/bcp47) allows\n\t * (and actually a lot more). The tag is always used unmodified.\n\t *\n\t * For server environments, the locale identifier has to match the following\n\t * scheme:\n\t *\n\t * `ll_CC.charset\\@modifier`\n\t *\n\t * * `ll` is the two- or three-letter language code.\n\t * * `CC` is the optional two-letter country code.\n\t * * `charset` is an optional character set (letters, digits, and the hyphen).\n\t * * `modifier` is an optional variant (letters and digits).\n\t *\n\t * The language code is always converted to lowercase, the country code is\n\t * converted to uppercase, variant and charset are used as is.\n\t *\n\t * @param locale - the locale identifier\n\t * @returns the locale in use\n\t */\n\tstatic set locale(locale: string) {\n\t\tconst ucLocale = locale.toUpperCase();\n\n\t\tif (ucLocale === 'POSIX' || ucLocale === 'C') {\n\t\t\tthis._locale = 'POSIX';\n\t\t\treturn;\n\t\t}\n\n\t\tconst split = splitLocale(locale);\n\t\tif (!split) {\n\t\t\tthrow new Error('invalid locale identifier');\n\t\t}\n\n\t\t// The check from splitLocale() is sufficient.\n\t\tif (browserEnvironment()) {\n\t\t\tthis._locale = locale;\n\t\t\treturn;\n\t\t}\n\n\t\t// Node.\n\t\tsplit.tags[0] = split.tags[0].toLowerCase();\n\t\tif (split.tags.length > 1) {\n\t\t\tsplit.tags[1] = split.tags[1].toUpperCase();\n\t\t}\n\n\t\tconst separator = split.underscoreSeparator ? '_' : '-';\n\t\tthis._locale = split.tags.join(separator);\n\n\t\tif (typeof split.charset !== 'undefined') {\n\t\t\tthis._locale += '.' + split.charset;\n\t\t}\n\n\t\tif (typeof split.modifier !== 'undefined') {\n\t\t\tthis._locale += '@' + split.modifier;\n\t\t}\n\t}\n\n\tprivate constructor(domain: string) {\n\t\tthis.domain = domain;\n\n\t\tconst msg = \"The property 'locale' is not an instance property but static. Use 'Textdomain.locale' instead!\";\n\t\tObject.defineProperty(this, 'locale', {\n\t\t\tget: () => {\n\t\t\t\tthrow new Error(msg);\n\t\t\t},\n\t\t\tset: () => {\n\t\t\t\tthrow new Error(msg);\n\t\t\t},\n\t\t\tenumerable: true,\n\t\t\tconfigurable: true,\n\t\t});\n\t}\n\n\t/**\n\t * A textdomain is an identifier for your application or library. It is\n\t * the basename of your translation files which are either\n\t * TEXTDOMAIN.mo.json or TEXTDOMAIN.mo, depending on the format you have\n\t * chosen.\n\t *\n\t * FIXME! This should be a getter!\n\t *\n\t * @returns the textdomain\n\t */\n\tpublic textdomain(): string {\n\t\treturn this.domain;\n\t}\n\n\t/**\n\t * Bind a textdomain to a certain path or queries the path that a\n\t * textdomain is bound to. The catalog file will be searched\n\t * in `${path}/LC_MESSAGES/${domainname}.EXT` where `EXT` is the\n\t * selected catalog format (one of `mo.json`, `mo`, or `json`).\n\t *\n\t * Alternatively, you can pass a [[`LocaleContainer`]] that holds the\n\t * catalogs in memory.\n\t *\n\t * The returned string or `LocaleContainer` is valid until the next\n\t * `bindtextdomain` call with an argument.\n\t *\n\t * @param path - the base path or [[`LocaleContainer`]] for this textdomain\n\t *\n\t * @returns the current base directory or [[`LocaleContainer`]] for this domain, after possibly changing it.\n\t */\n\tbindtextdomain(path?: string | LocaleContainer): string | LocaleContainer {\n\t\tif (typeof path !== 'undefined') {\n\t\t\tTextdomain.boundDomains[this.domain] = path;\n\t\t}\n\n\t\treturn Textdomain.boundDomains[this.domain];\n\t}\n\n\t/**\n\t * Resolve a textdomain, i.e. load the LocaleContainer for this domain and all\n\t * of its dependencies for the currently selected locale or the locale\n\t * specified.\n\t *\n\t * The promise will always resolve. If no catalog was found, an empty\n\t * catalog will be returned that is still usable.\n\t *\n\t * @param locale - an optional locale identifier, defaults to Textdomain.locale\n\t *\n\t * @returns a promise for a Catalog that will always resolve.\n\t */\n\tasync resolve(locale?: string): Promise<Catalog> {\n\t\tconst promises = [this.resolve1(locale)];\n\t\tfor (const td in Textdomain.domains) {\n\t\t\tif (\n\t\t\t\tObject.prototype.hasOwnProperty.call(Textdomain.domains, td) &&\n\t\t\t\tTextdomain.domains[td] !== this\n\t\t\t) {\n\t\t\t\tpromises.push(Textdomain.domains[td].resolve1(locale));\n\t\t\t}\n\t\t}\n\n\t\treturn Promise.all(promises).then(values => {\n\t\t\treturn new Promise(resolve => resolve(values[0]));\n\t\t});\n\t}\n\n\tprivate async resolve1(locale?: string): Promise<Catalog> {\n\t\tlet path = this.bindtextdomain();\n\n\t\tif (typeof path === 'undefined' || path === null) {\n\t\t\tconst parts = browserEnvironment()\n\t\t\t\t? ['', 'assets', 'locale']\n\t\t\t\t: ['.', 'locale'];\n\t\t\tpath = parts.join(pathSeparator);\n\t\t}\n\n\t\tconst resolvedLocale = locale ? locale : Textdomain.locale;\n\t\treturn resolveImpl(\n\t\t\tthis.domain,\n\t\t\tpath,\n\t\t\tthis.catalogFormat,\n\t\t\tresolvedLocale,\n\t\t).then(catalog => {\n\t\t\tif (!locale) {\n\t\t\t\tthis.catalog = catalog;\n\t\t\t}\n\t\t\treturn new Promise(resolve => resolve(catalog));\n\t\t});\n\t}\n\n\t/**\n\t * Get the catalog format in use.\n\t *\n\t * @returns one of 'mo.json' or 'mo' (default is 'mo.json')\n\t */\n\tget catalogFormat(): string {\n\t\treturn this._catalogFormat;\n\t}\n\n\t/**\n\t * Set the catalog format to use.\n\t *\n\t * @param format - one of 'mo.json' or 'mo'\n\t */\n\tset catalogFormat(format: string) {\n\t\tformat = format.toLowerCase();\n\t\tif (format === 'mo.json') {\n\t\t\tthis._catalogFormat = 'mo.json';\n\t\t} else if (format === 'mo') {\n\t\t\tthis._catalogFormat = 'mo';\n\t\t} else {\n\t\t\tthrow new Error(`unsupported format ${format}`);\n\t\t}\n\t}\n\n\t/**\n\t * Queries the user's preferred locales. On the server it queries the\n\t * environment variables `LANGUAGE`, `LC_ALL`, `LANG`, and `LC_MESSAGES`\n\t * (in that order). In the browser, it parses it checks the user preferences\n\t * in the variables `navigator.languages`, `navigator.language`,\n\t * `navigator.userLanguage`, `navigator.browserLanguage`, and\n\t * `navigator.systemLanguage`.\n\t *\n\t * @returns the set of locales in order of preference\n\t *\n\t * Added in \\@runtime 0.1.0.\n\t */\n\tstatic userLocales(): Array<string> {\n\t\treturn userLocales();\n\t}\n\n\t/**\n\t * Select one of the supported locales from a list of locales accepted by\n\t * the user.\n\t *\n\t * @param supported - the list of locales supported by the application\n\t * @param requested - the list of locales accepted by the user\n\t *\n\t * If called with just one argument, then the list of requested locales\n\t * is determined by calling [[Textdomain.userLocales]].\n\t *\n\t * @returns the negotiated locale or 'C' if not possible.\n\t */\n\tstatic selectLocale(\n\t\tsupported: Array<string>,\n\t\trequested?: Array<string>,\n\t): string {\n\t\treturn selectLocale(supported, requested ?? Textdomain.userLocales());\n\t}\n\n\t/**\n\t * A no-op method for string marking.\n\t *\n\t * Sometimes you want to mark strings for translation but do not actually\n\t * want to translate them, at least not at the time of their definition.\n\t * This is often the case, when you have to preserve the original string.\n\t *\n\t * Take this example:\n\t *\n\t * ```\n\t * orangeColors = [gtx.N_('coral'), gtx.N_('tomato'), gtx.N_('orangered'),\n\t * gtx.N_('gold'), gtx.N_('orange'), gtx.N_('darkorange')]\n\t * ```\n\t *\n\t * These are standard CSS colors, and you cannot translate them inside\n\t * CSS styles. But for presentation you may want to translate them later:\n\t *\n\t * ```\n\t * console.log(gtx._x(\"The css color '{color}' is {translated}.\",\n\t * {\n\t * color: orangeColors[2],\n\t * translated: gtx._(orangeColors[2]),\n\t * }\n\t * )\n\t * );\n\t * ```\n\t *\n\t * In other words: The method just marks strings for translation, so that\n\t * the extractor `esgettext-xgettext` finds them but it does not actually\n\t * translate anything.\n\t *\n\t * Similar methods are available for other cases (with placeholder\n\t * expansion, context, or both). They are *not* available for plural\n\t * methods because that would not make sense.\n\t *\n\t * Note that all of these methods are also available as instance methods.\n\t *\n\t * @param msgid - the message id\n\t * @returns the original string\n\t */\n\tstatic N_(msgid: string): string {\n\t\treturn msgid;\n\t}\n\n\t/**\n\t * Does the same as the static method `N_()`.\n\t *\n\t * @param msgid - the message id\n\t * @returns the original string\n\t */\n\tN_(msgid: string): string {\n\t\treturn msgid;\n\t}\n\n\t/**\n\t * Same as `N_()` but with placeholder expansion.\n\t *\n\t * @param msgid - the message id\n\t * @param placeholders - a dictionary of placeholders\n\t * @returns the original string with placeholders expanded\n\t */\n\tN_x(msgid: string, placeholders?: Placeholders): string {\n\t\treturn Textdomain.expand(msgid, placeholders ?? {});\n\t}\n\n\t/**\n\t * Does the same as the static method `N_x()`.\n\t *\n\t * @param msgid - the message id\n\t * @param placeholders - a dictionary of placeholders\n\t * @returns the original string with placeholders expanded\n\t */\n\tstatic N_x(msgid: string, placeholders?: Placeholders): string {\n\t\treturn Textdomain.expand(msgid, placeholders ?? {});\n\t}\n\n\t/**\n\t * Same as `N_()` but with context.\n\t *\n\t * @param _msgctxt - the message context (not used)\n\t * @param msgid - the message id\n\t * @returns the original string\n\t */\n\tN_p(_msgctxt: string, msgid: string): string {\n\t\treturn msgid;\n\t}\n\n\t/**\n\t * Does the same as the static method `N_p()`.\n\t *\n\t * @param _msgctxt - the message context (not used)\n\t * @param msgid - the message id\n\t * @returns the original string with placeholders expanded\n\t */\n\tstatic N_p(_msgctxt: string, msgid: string): string {\n\t\treturn msgid;\n\t}\n\n\t/**\n\t * Same as `N_()` but with context and placeholder expansion.\n\t *\n\t * @param _msgctxt - the message context (not used)\n\t * @param msgid - the message id\n\t * @param placeholders - a dictionary of placeholders\n\t * @returns the original string with placeholders expanded\n\t */\n\tN_px(_msgctxt: string, msgid: string, placeholders?: Placeholders): string {\n\t\treturn Textdomain.expand(msgid, placeholders ?? {});\n\t}\n\n\t/**\n\t * Does the same as the static method `N_px()`.\n\t *\n\t * @param _msgctxt - the message context (not used)\n\t * @param msgid - the message id\n\t * @param placeholders - a dictionary of placeholders\n\t * @returns the original string with placeholders expanded\n\t */\n\tstatic N_px(\n\t\t_msgctxt: string,\n\t\tmsgid: string,\n\t\tplaceholders?: Placeholders,\n\t): string {\n\t\treturn Textdomain.expand(msgid, placeholders ?? {});\n\t}\n}\n","import { userLocales } from './core/user-locales';\n// FIXME! Windows!\nif (typeof process.env.LANGUAGE !== 'undefined') {\n\tuserLocales(process.env.LANGUAGE.split(':'));\n} else if (typeof process.env.LC_ALL !== 'undefined') {\n\tuserLocales([process.env.LC_ALL]);\n} else if (typeof process.env.LANG !== 'undefined') {\n\tuserLocales([process.env.LANG]);\n} else if (typeof process.env.LC_MESSAGES !== 'undefined') {\n\tuserLocales([process.env.LC_MESSAGES]);\n}\n\nexport * from './core';\n\nexport { parseMoCatalog, parseMoJsonCatalog } from './parser';\n"],"names":[],"mappings":";;AAAA,IAAI,mBAAmB,GAAG,CAAC,GAAG,CAAC,CAAC;AAEhC;;;;;;;AAOG;AACG,SAAU,WAAW,CAAC,OAAuB,EAAA;AAClD,IAAA,IAAI,OAAO,OAAO,KAAK,WAAW,EAAE;QACnC,mBAAmB,GAAG,OAAO,CAAC;KAC9B;AAED,IAAA,OAAO,mBAAmB,CAAC;AAC5B;;AChBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAkGA;AACO,SAAS,SAAS,CAAC,OAAO,EAAE,UAAU,EAAE,CAAC,EAAE,SAAS,EAAE;AAC7D,IAAI,SAAS,KAAK,CAAC,KAAK,EAAE,EAAE,OAAO,KAAK,YAAY,CAAC,GAAG,KAAK,GAAG,IAAI,CAAC,CAAC,UAAU,OAAO,EAAE,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE;AAChH,IAAI,OAAO,KAAK,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,EAAE,UAAU,OAAO,EAAE,MAAM,EAAE;AAC/D,QAAQ,SAAS,SAAS,CAAC,KAAK,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE;AACnG,QAAQ,SAAS,QAAQ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,YAAY,KAAZ,IAAA,IAAA,YAAY,KAAZ,KAAA,CAAA,GAAA,YAAY,GAAI,EAAE,CAAC,CAAC;KACpD;AAED;;;;;;;AAOG;AACH,IAAA,OAAO,IAAI,CACV,QAAgB,EAChB,KAAa,EACb,YAA2B,EAAA;AAE3B,QAAA,OAAO,UAAU,CAAC,MAAM,CAAC,KAAK,EAAE,YAAY,KAAZ,IAAA,IAAA,YAAY,KAAZ,KAAA,CAAA,GAAA,YAAY,GAAI,EAAE,CAAC,CAAC;KACpD;;AA/wBc,UAAO,CAAA,OAAA,GAAkC,EAAlC,CAAqC;AAC5C,UAAY,CAAA,YAAA,GAAgD,EAAhD,CAAmD;AAC/D,UAAO,CAAA,OAAA,GAAG,GAAH;;AC/DvB;AACA,IAAI,OAAO,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,WAAW,EAAE;AAChD,IAAA,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;AAC9C,CAAC;KAAM,IAAI,OAAO,OAAO,CAAC,GAAG,CAAC,MAAM,KAAK,WAAW,EAAE;IACrD,WAAW,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;AACnC,CAAC;KAAM,IAAI,OAAO,OAAO,CAAC,GAAG,CAAC,IAAI,KAAK,WAAW,EAAE;IACnD,WAAW,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;AACjC,CAAC;KAAM,IAAI,OAAO,OAAO,CAAC,GAAG,CAAC,WAAW,KAAK,WAAW,EAAE;IAC1D,WAAW,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC;AACxC;;;;","x_google_ignoreList":[1]}
1
+ {"version":3,"file":"esgettext.esm.js","sources":["../src/core/user-locales.ts","../../../node_modules/tslib/tslib.es6.js","../src/transport/http.ts","../src/transport/fs.ts","../src/core/germanic-plural.ts","../src/core/data-viewlet.ts","../src/parser/parse-mo-catalog.ts","../src/parser/parse-mo-json-catalog.ts","../src/parser/parse-json-catalog.ts","../src/core/split-locale.ts","../src/core/catalog-cache.ts","../src/core/explode-locale.ts","../src/core/resolve-impl.ts","../src/core/gettext-impl.ts","../src/core/platform.ts","../src/core/select-locale.ts","../src/core/textdomain.ts","../src/index.ts"],"sourcesContent":["let userLocalesSelected = ['C'];\n\n/*\n * Force an execution environment. By default, the environment (NodeJS or\n * browser) is auto-detected. You can force the library to assume a certain\n * environment with this function.\n *\n * @param browser - whether to assume a browser or not\n * @returns the new setting.\n */\nexport function userLocales(locales?: Array<string>): Array<string> {\n\tif (typeof locales !== 'undefined') {\n\t\tuserLocalesSelected = locales;\n\t}\n\n\treturn userLocalesSelected;\n}\n","/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise, SuppressedError, Symbol */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\r\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\r\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\r\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\r\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\r\n var _, done = false;\r\n for (var i = decorators.length - 1; i >= 0; i--) {\r\n var context = {};\r\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\r\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\r\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\r\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\r\n if (kind === \"accessor\") {\r\n if (result === void 0) continue;\r\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\r\n if (_ = accept(result.get)) descriptor.get = _;\r\n if (_ = accept(result.set)) descriptor.set = _;\r\n if (_ = accept(result.init)) initializers.unshift(_);\r\n }\r\n else if (_ = accept(result)) {\r\n if (kind === \"field\") initializers.unshift(_);\r\n else descriptor[key] = _;\r\n }\r\n }\r\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\r\n done = true;\r\n};\r\n\r\nexport function __runInitializers(thisArg, initializers, value) {\r\n var useValue = arguments.length > 2;\r\n for (var i = 0; i < initializers.length; i++) {\r\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\r\n }\r\n return useValue ? value : void 0;\r\n};\r\n\r\nexport function __propKey(x) {\r\n return typeof x === \"symbol\" ? x : \"\".concat(x);\r\n};\r\n\r\nexport function __setFunctionName(f, name, prefix) {\r\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\r\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\r\n};\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\r\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n\r\nexport function __addDisposableResource(env, value, async) {\r\n if (value !== null && value !== void 0) {\r\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\r\n var dispose, inner;\r\n if (async) {\r\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\r\n dispose = value[Symbol.asyncDispose];\r\n }\r\n if (dispose === void 0) {\r\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\r\n dispose = value[Symbol.dispose];\r\n if (async) inner = dispose;\r\n }\r\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\r\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\r\n env.stack.push({ value: value, dispose: dispose, async: async });\r\n }\r\n else if (async) {\r\n env.stack.push({ async: true });\r\n }\r\n return value;\r\n\r\n}\r\n\r\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\r\n var e = new Error(message);\r\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\r\n};\r\n\r\nexport function __disposeResources(env) {\r\n function fail(e) {\r\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\r\n env.hasError = true;\r\n }\r\n function next() {\r\n while (env.stack.length) {\r\n var rec = env.stack.pop();\r\n try {\r\n var result = rec.dispose && rec.dispose.call(rec.value);\r\n if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\r\n }\r\n catch (e) {\r\n fail(e);\r\n }\r\n }\r\n if (env.hasError) throw env.error;\r\n }\r\n return next();\r\n}\r\n\r\nexport default {\r\n __extends: __extends,\r\n __assign: __assign,\r\n __rest: __rest,\r\n __decorate: __decorate,\r\n __param: __param,\r\n __metadata: __metadata,\r\n __awaiter: __awaiter,\r\n __generator: __generator,\r\n __createBinding: __createBinding,\r\n __exportStar: __exportStar,\r\n __values: __values,\r\n __read: __read,\r\n __spread: __spread,\r\n __spreadArrays: __spreadArrays,\r\n __spreadArray: __spreadArray,\r\n __await: __await,\r\n __asyncGenerator: __asyncGenerator,\r\n __asyncDelegator: __asyncDelegator,\r\n __asyncValues: __asyncValues,\r\n __makeTemplateObject: __makeTemplateObject,\r\n __importStar: __importStar,\r\n __importDefault: __importDefault,\r\n __classPrivateFieldGet: __classPrivateFieldGet,\r\n __classPrivateFieldSet: __classPrivateFieldSet,\r\n __classPrivateFieldIn: __classPrivateFieldIn,\r\n __addDisposableResource: __addDisposableResource,\r\n __disposeResources: __disposeResources,\r\n};\r\n","import { Transport } from './transport.interface';\n\n/* eslint-disable @typescript-eslint/explicit-function-return-type */\n\nexport class TransportHttp implements Transport {\n\tloadFile(url: string): Promise<ArrayBuffer> {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tconst xhr = new XMLHttpRequest();\n\t\t\txhr.responseType = 'arraybuffer';\n\t\t\txhr.open('GET', url, true);\n\t\t\txhr.onload = () => {\n\t\t\t\tif (xhr.readyState === 4 && xhr.status === 200) {\n\t\t\t\t\tresolve(xhr.response as ArrayBuffer);\n\t\t\t\t} else {\n\t\t\t\t\treject(new Error('get failed with status ' + xhr.status));\n\t\t\t\t}\n\t\t\t};\n\t\t\txhr.onerror = err => reject(err);\n\t\t\txhr.send();\n\t\t});\n\t}\n}\n","import { readFile } from 'fs';\nimport { Transport } from './transport.interface';\n\nexport class TransportFs implements Transport {\n\tloadFile(url: string): Promise<ArrayBuffer> {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\treadFile(url, (err, data) => {\n\t\t\t\treturn err ? reject(err) : resolve(data);\n\t\t\t});\n\t\t});\n\t}\n}\n","/*\n * Function for germanic plural. Returns singular (0) for 1 item, and\n * 1 for everything else.\n *\n * @param numItems - number of items\n * @returns the index into the plural translations\n */\nexport function germanicPlural(numItems: number): number {\n\treturn numItems === 1 ? 0 : 1;\n}\n","/*\n * A minimalistic buffer implementation that can only read 32 bit unsigned\n * integers and strings.\n */\nexport class DataViewlet {\n\tprivate decoder: TextDecoder;\n\tprivate _encoding: string;\n\n\t/*\n\t * Create a DataViewlet instance. All encodings that are supported by\n\t * the runtime environments `TextDecoder` interface.\n\t *\n\t * @param array - a `Unit8Array` view on the binary buffer\n\t * @param encoding - encoding of strings, defaults to utf-8\n\t */\n\tconstructor(\n\t\tprivate readonly array: Uint8Array,\n\t\tencoding = 'utf-8',\n\t) {\n\t\tthis.decoder = new TextDecoder(encoding);\n\t\tthis._encoding = encoding;\n\t}\n\n\t/**\n\t * Get the encoding for strings.\n\t *\n\t * @returns the encoding in use\n\t */\n\tget encoding(): string {\n\t\treturn this._encoding;\n\t}\n\n\t/**\n\t * Switch to a new encoding.\n\t *\n\t * @param encoding - new encoding to use\n\t */\n\tset encoding(encoding: string) {\n\t\tthis.decoder = new TextDecoder(encoding);\n\t\tthis._encoding = encoding;\n\t}\n\t/*\n\t * Reads an unsigned 32-bit integer from the buffer at\n\t * the specified offset as big-endian.\n\t *\n\t * @param offset - Number of bytes to skip before starting to read.\n\t * Must satisfy `0 <= offset <= buf.length - 4`.\n\t * Default: 0.\n\t * @returns the 32-bit unsigned integer at position `offset`.s\n\t */\n\treadUInt32BE(offset = 0): number {\n\t\tif (offset + 4 > this.array.byteLength + this.array.byteOffset) {\n\t\t\tthrow new Error('read past array end');\n\t\t}\n\n\t\treturn (\n\t\t\t(((this.array[offset] << 24) >>> 0) |\n\t\t\t\t(this.array[offset + 1] << 16) |\n\t\t\t\t(this.array[offset + 2] << 8) |\n\t\t\t\tthis.array[offset + 3]) >>>\n\t\t\t0\n\t\t);\n\t}\n\n\t/*\n\t * Reads an unsigned 32-bit integer from the buffer at\n\t * the specified offset as little-endian.\n\t *\n\t * @param offset - Number of bytes to skip before starting to read.\n\t * Must satisfy `0 <= offset <= buf.length - 4`.\n\t * Default: 0.\n\t * @returns the 32-bit unsigned integer at position `offset`.s\n\t */\n\treadUInt32LE(offset = 0): number {\n\t\tif (offset + 4 > this.array.byteLength + this.array.byteOffset) {\n\t\t\tthrow new Error('read past array end');\n\t\t}\n\n\t\treturn (\n\t\t\t(((this.array[offset + 3] << 24) >>> 0) |\n\t\t\t\t(this.array[offset + 2] << 16) |\n\t\t\t\t(this.array[offset + 1] << 8) |\n\t\t\t\tthis.array[offset]) >>>\n\t\t\t0\n\t\t);\n\t}\n\n\t/*\n\t * Read a string at a specified offset.\n\t *\n\t * @param offset - to beginning of buffer in bytes\n\t * @param length - of the string to read in bytes or to the end of the\n\t * buffer if not specified.\n\t */\n\treadString(offset = 0, length?: number): string {\n\t\tif (\n\t\t\toffset + (length as number) >\n\t\t\tthis.array.byteLength + this.array.byteOffset\n\t\t) {\n\t\t\tthrow new Error('read past array end');\n\t\t}\n\n\t\tif (typeof length === 'undefined') {\n\t\t\tlength = this.array.byteLength - offset;\n\t\t}\n\n\t\treturn this.decoder.decode(this.array.slice(offset, offset + length));\n\t}\n}\n","import { Catalog } from '../core/catalog';\nimport { germanicPlural } from '../core/germanic-plural';\nimport { DataViewlet } from '../core/data-viewlet';\n\n/* eslint-disable @typescript-eslint/no-explicit-any, no-control-regex, no-bitwise */\n\ninterface POHeader {\n\t[key: string]: string;\n}\n\n/*\n * Parse an MO file.\n *\n * An exception is thrown for invalid data.\n *\n * @param raw - The input as either a binary `String`, any `Array`-like byte\n * storage (`Array`, `Uint8Array`, `Arguments`, `jQuery(Array)`, ...)\n * @returns a Catalog\n */\nexport function parseMoCatalog(raw: ArrayBuffer): Catalog {\n\tconst catalog: Catalog = {\n\t\tmajor: 0,\n\t\tminor: 0,\n\t\tentries: {},\n\t\tpluralFunction: germanicPlural,\n\t};\n\tlet offset = 0;\n\n\tconst blob = new DataViewlet(new Uint8Array(raw), 'ascii');\n\n\tconst magic = blob.readUInt32LE(offset);\n\n\ttype Reader = (buf: DataViewlet, off: number) => number;\n\tlet reader: Reader;\n\tif (magic === 0x950412de) {\n\t\t/* eslint-disable-next-line @typescript-eslint/explicit-function-return-type */\n\t\treader = (buf, off) => buf.readUInt32LE(off);\n\t} else if (magic === 0xde120495) {\n\t\t/* eslint-disable-next-line @typescript-eslint/explicit-function-return-type */\n\t\treader = (buf, off) => buf.readUInt32BE(off);\n\t} else {\n\t\tthrow new Error(`invalid MO magic 0x${magic.toString(16)}`);\n\t}\n\n\toffset += 4;\n\n\t// The revision is encoded in two shorts, major and minor. We don't care\n\t// about the minor revision.\n\tconst major = reader(blob, offset) >> 16;\n\toffset += 4;\n\tif (major > 0) {\n\t\tthrow new Error(`unsupported major revision ${major}`);\n\t}\n\tconst numStrings = reader(blob, offset);\n\toffset += 4;\n\tconst msgidOffset = reader(blob, offset);\n\toffset += 4;\n\tconst msgstrOffset = reader(blob, offset);\n\n\toffset = msgidOffset;\n\tconst origTab = [];\n\tfor (let i = 0; i < numStrings; ++i) {\n\t\tconst l = reader(blob, offset);\n\t\toffset += 4;\n\t\tconst stringOffset = reader(blob, offset);\n\t\toffset += 4;\n\t\torigTab.push([l, stringOffset]);\n\t}\n\n\toffset = msgstrOffset;\n\tconst transTab = [];\n\tfor (let i = 0; i < numStrings; ++i) {\n\t\tconst l = reader(blob, offset);\n\t\toffset += 4;\n\t\tconst stringOffset = reader(blob, offset);\n\t\toffset += 4;\n\t\ttransTab.push([l, stringOffset]);\n\t}\n\n\tconst poHeader: POHeader = {};\n\tfor (let i = 0; i < numStrings; ++i) {\n\t\tconst orig = origTab[i];\n\t\tlet l = orig[0];\n\t\toffset = orig[1];\n\n\t\tconst msgid = blob.readString(offset, l).split('\\u0000')[0];\n\n\t\tconst trans = transTab[i];\n\t\tl = trans[0];\n\t\toffset = trans[1];\n\n\t\tconst msgstr = blob.readString(offset, l).split('\\u0000');\n\n\t\tlet pairs, kv;\n\t\tif (i === 0 && msgid === '') {\n\t\t\tpairs = msgstr[0].split('\\n');\n\t\t\tfor (let j = 0; j < pairs.length; ++j) {\n\t\t\t\tif (pairs[j] !== '') {\n\t\t\t\t\tkv = pairs[j].split(/[ \\t]*:[ \\t]*/);\n\t\t\t\t\tpoHeader[kv[0].toLowerCase()] = kv[1];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (poHeader['content-type'] !== undefined) {\n\t\t\t\tconst enc = poHeader['content-type'].replace(/.*=/, '');\n\t\t\t\tif (enc !== poHeader['content-type']) {\n\t\t\t\t\tblob.encoding = enc;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tcatalog.entries[msgid] = msgstr;\n\t}\n\n\treturn catalog;\n}\n","import { Catalog } from '../core/catalog';\n\nexport function validateMoJsonCatalog(udata: unknown): Catalog {\n\t// We could use ajv but it results in almost 300 k minimized code\n\t// for the browser bundle. This validator instead is absolutely\n\t// minimalistic, and only avoids exceptions that can occur, when\n\t// accessing entries.\n\n\tif (udata === null || typeof udata === 'undefined') {\n\t\tthrow new Error('catalog is either null or undefined');\n\t}\n\n\tconst data = udata as Catalog;\n\tif (data.constructor !== Object) {\n\t\tthrow new Error('catalog must be a dictionary');\n\t}\n\n\t// We don't care about major and minor because they are actually not\n\t// used.\n\n\tif (!Object.prototype.hasOwnProperty.call(data, 'entries')) {\n\t\tthrow new Error('catalog.entries does not exist');\n\t}\n\n\tconst entries = data.entries;\n\tif (entries === null || typeof entries === 'undefined') {\n\t\tthrow new Error('catalog.entries are not defined or null');\n\t}\n\n\tif (entries.constructor !== Object) {\n\t\tthrow new Error('catalog.entries must be a dictionary');\n\t}\n\n\tfor (const [key, value] of Object.entries(entries)) {\n\t\tif (!Array.isArray(value)) {\n\t\t\tthrow new Error(`catalog entry for key '${key}' is not an array`);\n\t\t}\n\t}\n\n\treturn data;\n}\n\nexport function parseMoJsonCatalog(json: ArrayBuffer): Catalog {\n\tconst text = new TextDecoder().decode(json);\n\tconst data = JSON.parse(text) as unknown;\n\n\treturn validateMoJsonCatalog(data);\n}\n","import { Catalog } from '../core/catalog';\n\nexport function validateJsonCatalog(udata: unknown): Catalog {\n\t// We could use ajv but it results in almost 300 k minimized code\n\t// for the browser bundle. This validator instead is absolutely\n\t// minimalistic, and only avoids exceptions that can occur, when\n\t// accessing entries.\n\n\tif (udata === null || typeof udata === 'undefined') {\n\t\tthrow new Error('catalog is either null or undefined');\n\t}\n\n\tconst entries = udata;\n\tif (entries.constructor !== Object) {\n\t\tnew Error('catalog must be a dictionary');\n\t}\n\n\t// Convert to a regular catalog.\n\tconst catalog: Catalog = {\n\t\tmajor: 0,\n\t\tminor: 1,\n\t\tpluralFunction: () => 0,\n\t\tentries: {},\n\t};\n\n\tfor (const [msgid, msgstr] of Object.entries(entries)) {\n\t\t// Just stringify all values but do not complain.\n\t\tcatalog.entries[msgid] = [msgstr.toString()];\n\t}\n\n\treturn catalog;\n}\n\nexport function parseJsonCatalog(json: ArrayBuffer): Catalog {\n\tconst text = new TextDecoder().decode(json);\n\tconst data = JSON.parse(text) as unknown;\n\n\treturn validateJsonCatalog(data);\n}\n","const tagHyphenRegex = new RegExp('^[a-z0-9]+(?:-[a-z0-9]+)*$', 'i');\nconst tagUnderscoreRegex = new RegExp('^[a-z0-9]+(?:_[a-z0-9]+)*$', 'i');\n\nexport interface SplitLocale {\n\ttags: Array<string>;\n\tunderscoreSeparator: boolean;\n\tcharset?: string;\n\tmodifier?: string;\n}\n\nexport function splitLocale(locale: string): SplitLocale | null {\n\tlet charset: string = '',\n\t\tmodifier: string = '';\n\n\tconst underscoreSeparator = locale.includes('_');\n\n\tlocale = locale.replace(/@([a-z]+)$/i, (_, match: string) => {\n\t\tmodifier = match;\n\t\treturn '';\n\t});\n\n\tlocale = locale.replace(/\\.([-0-9a-z]+)$/i, (_, match: string) => {\n\t\tcharset = match;\n\t\treturn '';\n\t});\n\n\tif (underscoreSeparator) {\n\t\tif (!tagUnderscoreRegex.exec(locale)) {\n\t\t\treturn null;\n\t\t}\n\t} else {\n\t\tif (!tagHyphenRegex.exec(locale)) {\n\t\t\treturn null;\n\t\t}\n\t}\n\n\tconst separator = underscoreSeparator ? '_' : '-';\n\tconst tags = locale.split(separator);\n\n\tconst split: SplitLocale = { tags: tags, underscoreSeparator };\n\n\tif (charset.length) {\n\t\tsplit.charset = charset;\n\t}\n\n\tif (modifier.length) {\n\t\tsplit.modifier = modifier;\n\t}\n\n\treturn split;\n}\n","import { validateMoJsonCatalog } from '../parser';\nimport { Catalog } from './catalog';\n\ninterface CatalogCacheInterface {\n\t// Locale Key.\n\t[key: string]: {\n\t\t// Textdomain.\n\t\t[key: string]: Catalog | Promise<Catalog> | null;\n\t};\n}\n\n/*\n * Caches catalog lookups by path, locale, and textdomain.\n *\n * Failed lookups are stored as null values.\n *\n * It is also possible to store a Promise. In that case, if a request is\n * made to bind the textdomain, the promise is settled. Note that this\n * mechanism is never used for message lookup but only for loading the\n * catalog via resolve.\n */\nexport class CatalogCache {\n\tprivate static instance: CatalogCache;\n\tprivate static cache: CatalogCacheInterface = {};\n\n\tprivate constructor() {\n\t\t/* Singleton. */\n\t}\n\n\tstatic getInstance(): CatalogCache {\n\t\tif (!CatalogCache.instance) {\n\t\t\tCatalogCache.instance = new CatalogCache();\n\t\t}\n\n\t\treturn CatalogCache.instance;\n\t}\n\n\tstatic clear(): void {\n\t\tCatalogCache.cache = {};\n\t}\n\n\t/**\n\t * Lookup a Catalog for a given base path, locale, and textdomain.\n\t *\n\t * The locale key is usually the locale identifier (e.g. de-DE or sr\\@latin).\n\t * But it can also be a colon separated list of such locale identifiers.\n\t *\n\t *\n\t * @param localeKey - the locale key\n\t * @param textdomain - the textdomain\n\t * @returns the cached Catalog, a Promise or null for failure\n\t */\n\tpublic static lookup(\n\t\tlocaleKey: string,\n\t\ttextdomain: string,\n\t): Catalog | Promise<Catalog> | null {\n\t\tif (CatalogCache.cache[localeKey]) {\n\t\t\tconst ptr = CatalogCache.cache[localeKey];\n\t\t\tif (Object.prototype.hasOwnProperty.call(ptr, textdomain)) {\n\t\t\t\treturn ptr[textdomain];\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tpublic static store(\n\t\tlocaleKey: string,\n\t\ttextdomain: string,\n\t\tentry: Catalog | Promise<Catalog>,\n\t): void {\n\t\tif (Promise.resolve(entry) !== entry) {\n\t\t\t// Object.\n\t\t\tentry = validateMoJsonCatalog(entry as Catalog);\n\t\t}\n\n\t\tif (!CatalogCache.cache[localeKey]) {\n\t\t\tCatalogCache.cache[localeKey] = {};\n\t\t}\n\t\tCatalogCache.cache[localeKey][textdomain] = entry;\n\t}\n}\n","import { SplitLocale } from './split-locale';\n\nexport type ExplodedLocale = Array<Array<string>>;\n\nexport function explodeLocale(\n\tlocale: SplitLocale,\n\tvary?: boolean,\n): ExplodedLocale {\n\tconst retval: ExplodedLocale = [];\n\tconst lsep = locale.underscoreSeparator ? '_' : '-';\n\tlet i = vary ? 0 : locale.tags.length - 1;\n\tconst hasCharset = typeof locale.charset !== 'undefined';\n\tconst hasModifier = typeof locale.modifier !== 'undefined';\n\n\tconst charsets = hasCharset ? [locale.charset as string] : [''];\n\tif (vary && hasCharset) {\n\t\tconst charset = locale.charset as string;\n\t\tconst ucCharset = charset.toUpperCase();\n\t\tif (ucCharset !== charset) {\n\t\t\tcharsets.push(ucCharset);\n\t\t}\n\t\tcharsets.push('');\n\t}\n\n\tfor (; i < locale.tags.length; ++i) {\n\t\tconst lingua = locale.tags.slice(0, i + 1).join(lsep);\n\t\tconst ids = new Array<string>();\n\n\t\tcharsets.forEach(charset => {\n\t\t\tlet id = charset.length ? lingua + '.' + charset : lingua;\n\t\t\tif (hasModifier) {\n\t\t\t\tid += '@' + locale.modifier;\n\t\t\t}\n\t\t\tids.push(id);\n\t\t});\n\t\tretval.push(ids);\n\t}\n\n\treturn retval;\n}\n","import { TransportHttp } from '../transport/http';\nimport { TransportFs } from '../transport/fs';\nimport { Transport } from '../transport/transport.interface';\nimport {\n\tparseMoJsonCatalog,\n\tparseJsonCatalog,\n\tparseMoCatalog,\n} from '../parser';\nimport { browserEnvironment } from './browser-environment';\nimport { Catalog, CatalogEntries } from './catalog';\nimport { SplitLocale, splitLocale } from './split-locale';\nimport { germanicPlural } from './germanic-plural';\nimport { CatalogCache } from './catalog-cache';\nimport { explodeLocale, ExplodedLocale } from './explode-locale';\nimport { LocaleContainer } from './locale-container';\n\ntype PluralFunction = (numItems: number) => number;\n\nconst isBrowser = process.env.BROWSER_ENV;\n\nasync function loadCatalog(\n\turl: string,\n\tformat: string,\n): Promise<Catalog | null> {\n\tlet transportInstance: Transport;\n\n\tif (!isBrowser) {\n\t\tlet transport;\n\t\t// Check whether this is a valid URL.\n\t\ttry {\n\t\t\tconst parsedURL = new URL(url);\n\t\t\tif (\n\t\t\t\tparsedURL.protocol === 'https:' ||\n\t\t\t\tparsedURL.protocol === 'http:' ||\n\t\t\t\tparsedURL.protocol === 'file:'\n\t\t\t) {\n\t\t\t\ttransport = 'http';\n\t\t\t} else {\n\t\t\t\tthrow new Error(`unsupported scheme ${parsedURL.protocol}`);\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tif (browserEnvironment()) {\n\t\t\t\ttransport = 'http';\n\t\t\t} else {\n\t\t\t\ttransport = 'fs';\n\t\t\t}\n\t\t}\n\n\t\tif (transport === 'http') {\n\t\t\ttransportInstance = new TransportHttp();\n\t\t} else {\n\t\t\ttransportInstance = new TransportFs();\n\t\t}\n\t} else {\n\t\ttransportInstance = new TransportHttp();\n\t}\n\n\ttype Validator = (data: ArrayBuffer) => Catalog;\n\tlet validator: Validator;\n\tif ('mo.json' === format) {\n\t\tvalidator = parseMoJsonCatalog;\n\t} else if ('.json' === format) {\n\t\tvalidator = parseJsonCatalog;\n\t} else {\n\t\tvalidator = parseMoCatalog;\n\t}\n\n\ttry {\n\t\tconst data = await transportInstance.loadFile(url);\n\n\t\treturn validator(data);\n\t} catch {\n\t\treturn null;\n\t}\n}\n\nfunction assemblePath(\n\tbase: string,\n\tid: string,\n\tdomainname: string,\n\textender: string,\n): string {\n\treturn `${base}/${id}/LC_MESSAGES/${domainname}.${extender}`;\n}\n\nasync function loadLanguageFromObject(\n\tids: Array<string>,\n\tbase: LocaleContainer,\n\tdomainname: string,\n): Promise<Catalog | null> {\n\tfor (let i = 0; i < ids.length; ++i) {\n\t\tconst id = ids[i];\n\t\t// Language exists?\n\t\tif (!Object.prototype.hasOwnProperty.call(base, id)) {\n\t\t\tcontinue;\n\t\t}\n\t\t// LC_MESSAGES?\n\t\tif (!Object.prototype.hasOwnProperty.call(base[id], 'LC_MESSAGES')) {\n\t\t\tcontinue;\n\t\t}\n\t\t// Textdomain?\n\t\tif (\n\t\t\t!Object.prototype.hasOwnProperty.call(base[id].LC_MESSAGES, domainname)\n\t\t) {\n\t\t\tcontinue;\n\t\t}\n\n\t\treturn base[id].LC_MESSAGES[domainname];\n\t}\n\n\treturn null;\n}\n\n/*\n * First tries to load a catalog with the specified charset, then with the\n * charset converted to uppercase (if it differs from the original charset),\n * and finally without a charset.\n */\nasync function loadLanguage(\n\tids: Array<string>,\n\tbase: string | LocaleContainer,\n\tdomainname: string,\n\tformat: string,\n): Promise<Catalog | null> {\n\t// Check if `base` is an object (LocaleContainer).\n\tif (typeof base === 'object' && base !== null) {\n\t\treturn loadLanguageFromObject(ids, base, domainname);\n\t}\n\n\tfor (const id of ids) {\n\t\tconst catalog = await loadCatalog(\n\t\t\tassemblePath(base as string, id, domainname, format),\n\t\t\tformat,\n\t\t);\n\t\tif (catalog) {\n\t\t\treturn catalog;\n\t\t}\n\t}\n\n\treturn null;\n}\n\nasync function loadDomain(\n\texploded: ExplodedLocale,\n\tlocaleKey: string,\n\tbase: string | LocaleContainer,\n\tdomainname: string,\n\tformat: string,\n): Promise<Catalog> {\n\tconst entries: CatalogEntries = {};\n\n\tconst catalog: Catalog = {\n\t\tmajor: 0,\n\t\tminor: 0,\n\t\tpluralFunction: germanicPlural,\n\t\tentries,\n\t};\n\n\tconst cacheHit = await CatalogCache.lookup(localeKey, domainname);\n\tif (cacheHit !== null) {\n\t\treturn cacheHit;\n\t}\n\n\tfor (const tries of exploded) {\n\t\tconst result = await loadLanguage(tries, base, domainname, format);\n\t\tif (result) {\n\t\t\tcatalog.major = result.major;\n\t\t\tcatalog.minor = result.minor;\n\t\t\tcatalog.entries = { ...catalog.entries, ...result.entries };\n\t\t}\n\t}\n\n\treturn catalog;\n}\n\nfunction pluralExpression(str: string): PluralFunction {\n\tconst tokens = str\n\t\t.replace(/[ \\t\\r\\013\\014]/g, '')\n\t\t.replace(/;$/, '')\n\t\t// Do NOT allow square brackets here. JSFuck!\n\t\t.split(/[<>!=]=|&&|\\|\\||[-!*/%+<>=?:;]/);\n\n\tfor (let i = 0; i < tokens.length; ++i) {\n\t\tconst token = tokens[i].replace(/^\\(+/, '').replace(/\\)+$/, '');\n\t\tif (\n\t\t\ttoken !== 'nplurals' &&\n\t\t\ttoken !== 'plural' &&\n\t\t\ttoken !== 'n' &&\n\t\t\t// Does not catch invalid octal numbers but the compiler\n\t\t\t// takes care of that.\n\t\t\tnull === /^[0-9]+$/.exec(token)\n\t\t) {\n\t\t\tthrow new Error('invalid plural function');\n\t\t}\n\t}\n\n\tconst code = 'var nplurals = 1, plural = 0;' + str + '; return 0 + plural';\n\n\t// This may throw an exception!\n\t// eslint-disable-next-line @typescript-eslint/no-implied-eval\n\treturn new Function('n', code) as PluralFunction;\n}\n\nfunction setPluralFunction(catalog: Catalog): Catalog {\n\tif (!Object.prototype.hasOwnProperty.call(catalog.entries, '')) {\n\t\treturn catalog;\n\t}\n\n\tconst headers = catalog.entries[''][0].split('\\n');\n\theaders.forEach(header => {\n\t\tconst tokens = header.split(':');\n\t\tif ('plural-forms' === (tokens.shift() as string).toLowerCase()) {\n\t\t\tconst code = tokens.join(':');\n\t\t\ttry {\n\t\t\t\tcatalog.pluralFunction = pluralExpression(code);\n\t\t\t} catch {\n\t\t\t\tcatalog.pluralFunction = germanicPlural;\n\t\t\t}\n\t\t}\n\t});\n\n\treturn catalog;\n}\n\nexport async function resolveImpl(\n\tdomainname: string,\n\tpath: string | LocaleContainer,\n\tformat: string,\n\tlocaleKey: string,\n): Promise<Catalog> {\n\tconst defaultCatalog: Catalog = {\n\t\tmajor: 0,\n\t\tminor: 0,\n\t\tpluralFunction: germanicPlural,\n\t\tentries: {},\n\t};\n\n\tif (localeKey === 'C' || localeKey === 'POSIX') {\n\t\treturn defaultCatalog;\n\t}\n\n\tconst exploded = explodeLocale(splitLocale(localeKey) as SplitLocale, true);\n\tconst catalog = await loadDomain(\n\t\texploded,\n\t\tlocaleKey,\n\t\tpath,\n\t\tdomainname,\n\t\tformat,\n\t);\n\tsetPluralFunction(catalog);\n\tCatalogCache.store(localeKey, domainname, catalog);\n\treturn catalog;\n}\n","import { Catalog } from './catalog';\nimport { germanicPlural } from './germanic-plural';\n\ninterface GettextImplArgs {\n\tmsgid: string;\n\tcatalog: Catalog;\n\tmsgidPlural?: string;\n\tnumItems?: number;\n\tmsgctxt?: string;\n}\n\nexport function gettextImpl(args: GettextImplArgs): string {\n\tconst key =\n\t\ttypeof args.msgctxt === 'undefined'\n\t\t\t? args.msgid\n\t\t\t: args.msgctxt + '\\u0004' + args.msgid;\n\tconst translations = args.catalog.entries[key];\n\tconst numItems = args.numItems ?? 1;\n\n\tif (translations && translations.length) {\n\t\tif (typeof args.msgidPlural === 'undefined') {\n\t\t\treturn translations[0];\n\t\t} else {\n\t\t\tlet pluralForm = args.catalog.pluralFunction(numItems);\n\t\t\tif (pluralForm >= translations.length) {\n\t\t\t\tif (translations.length === 1) {\n\t\t\t\t\treturn translations[0];\n\t\t\t\t} else {\n\t\t\t\t\tpluralForm = germanicPlural(numItems);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn translations[pluralForm];\n\t\t}\n\t} else if (typeof args.msgidPlural !== 'undefined') {\n\t\tconst pluralform = args.catalog.pluralFunction(numItems);\n\t\tif (pluralform === 1) {\n\t\t\treturn args.msgidPlural;\n\t\t}\n\t}\n\n\treturn args.msgid;\n}\n","export const isNode =\n\ttypeof process !== 'undefined' &&\n\tprocess.versions !== null &&\n\tprocess.versions.node !== null;\n\nexport const pathSeparator =\n\tisNode && process.platform === 'win32' ? '\\\\' : '/';\n","import { splitLocale } from './split-locale';\n\nfunction tagsEqual(left: Array<string>, right: Array<string>): boolean {\n\tif (left.length !== right.length) {\n\t\treturn false;\n\t}\n\n\tfor (let i = 0; i < left.length; ++i) {\n\t\tif (left[i].toLowerCase() !== right[i].toLowerCase()) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}\n\nexport function selectLocale(\n\tsupported: Array<string>,\n\trequested: Array<string>,\n): string {\n\tlet languageMatch: string = '';\n\n\tfor (let i = 0; i < requested.length; ++i) {\n\t\tconst wanted = splitLocale(requested[i]);\n\t\tif (!wanted) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tfor (let j = 0; j < supported.length; ++j) {\n\t\t\tconst got = splitLocale(supported[j]);\n\t\t\tif (!got) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (tagsEqual(wanted.tags, got.tags)) {\n\t\t\t\treturn supported[j];\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\t!languageMatch.length &&\n\t\t\t\twanted.tags[0].toLowerCase() === got.tags[0].toLowerCase()\n\t\t\t) {\n\t\t\t\tlanguageMatch = supported[j];\n\t\t\t}\n\t\t}\n\t}\n\n\tif (languageMatch.length) {\n\t\treturn languageMatch;\n\t}\n\n\treturn 'C';\n}\n","import { resolveImpl } from './resolve-impl';\nimport { CatalogCache } from './catalog-cache';\nimport type { Catalog } from './catalog';\nimport { browserEnvironment } from './browser-environment';\nimport { gettextImpl } from './gettext-impl';\nimport { germanicPlural } from './germanic-plural';\nimport { splitLocale } from './split-locale';\nimport { pathSeparator } from './platform';\nimport { userLocales } from './user-locales';\nimport { selectLocale } from './select-locale';\nimport type { LocaleContainer } from './locale-container';\n\n/**\n * Represents a mapping of placeholder strings to the values that they should be replaced with.\n * Placeholders must match the regular expression `/^[_a-zA-Z][_a-zA-Z0-9]*$/`.\n * @remarks\n * Placeholders provide a way to dynamically replace certain strings in a translatable message.\n *\n * @example\n * ```typescript\n * const placeholders: Placeholders = {\n * \t'name': 'John Doe',\n * \t'age': 30,\n * \t// Add more placeholders as needed\n * };\n * ```\n *\n * A typical call would look like this:\n *\n * ```typescript\n * console.log(gtx._x('User {name} is {age} years old.'));\n * ```\n * @public\n */\nexport interface Placeholders {\n\t/* eslint-disable-next-line @typescript-eslint/no-explicit-any */\n\t[placeholder: string]: any;\n}\n\n/**\n * A Textdomain is a container for an esgettext configuration and all loaded\n * LocaleContainer for the textual domain selected.\n *\n * The actual translation methods have quite funny names like `_()` or\n * `_x()`. The purpose of this naming convention is to make the\n * internationalization of your programs as little obtrusive as possible.\n * Most of the times you just have to exchange\n *\n * ```\n * doSomething('Hello, world!');\n * ```\n *\n * with\n *\n * ```\n * doSomething(gtx._('Hello, world!'));\n * ```\n *\n * Besides, depending on the string extractor you are using, it may be useful\n * that the method names do not collide with method names from other packages.\n */\nexport class Textdomain {\n\tprivate static domains: { [key: string]: Textdomain } = {};\n\tprivate static boundDomains: { [key: string]: string | LocaleContainer } = {};\n\tprivate static _locale = 'C';\n\n\tprivate domain: string;\n\tprivate _catalogFormat = 'mo.json';\n\tprivate catalog: Catalog = undefined as unknown as Catalog;\n\n\t/**\n\t * Retrieve a translation for a string.\n\t *\n\t * @param msgid - the string to translate\n\t *\n\t * @returns the translated string\n\t */\n\t_(msgid: string) {\n\t\treturn gettextImpl({ msgid: msgid, catalog: this.catalog });\n\t}\n\n\t/**\n\t * Retrieve a translation for a string containing a possible plural.\n\t * You will almost always want to call {@link _nx} instead so that\n\t * you can interpolate the number of items into the strings.\n\t *\n\t * @param msgid - the string in the singular\n\t * @param msgidPlural - the string in the plural\n\t * @param numItems - the number of items\n\t *\n\t * @returns the translated string\n\t */\n\t_n(msgid: string, msgidPlural: string, numItems: number) {\n\t\treturn gettextImpl({\n\t\t\tmsgid: msgid,\n\t\t\tmsgidPlural: msgidPlural,\n\t\t\tnumItems: numItems,\n\t\t\tcatalog: this.catalog,\n\t\t});\n\t}\n\n\t/**\n\t * Translate a string with a context.\n\t *\n\t * @param msgctxt - the message context\n\t * @param msgid - the string to translate\n\t *\n\t * @returns the translated string\n\t */\n\t_p(msgctxt: string, msgid: string) {\n\t\treturn gettextImpl({\n\t\t\tmsgctxt: msgctxt,\n\t\t\tmsgid: msgid,\n\t\t\tcatalog: this.catalog,\n\t\t});\n\t}\n\n\t/**\n\t * The method `_np()` combines `_n()` with `_p()`.\n\t * You will almost always want to call {@link _npx} instead so that\n\t * you can interpolate the number of items into the strings.\n\n\t *\n\t * @param msgctxt - the message context\n\t * @param msgid - the message id\n\t * @param placeholders - a dictionary with placehoders\n\t * @returns the translated string\n\t */\n\t_np(msgctxt: string, msgid: string, msgidPlural: string, numItems: number) {\n\t\treturn gettextImpl({\n\t\t\tmsgctxt: msgctxt,\n\t\t\tmsgid: msgid,\n\t\t\tmsgidPlural: msgidPlural,\n\t\t\tnumItems: numItems,\n\t\t\tcatalog: this.catalog,\n\t\t});\n\t}\n\n\t/**\n\t * Translate a string with placeholders. The placeholders should be\n\t * wrapped into curly braces and must match the regular expression\n\t * \"[_a-zA-Z][_a-zA-Z0-9]*\".\n\t *\n\t * @param msgid - the msgid to translate\n\t * @param placeholders - an optional dictionary of placeholders\n\t *\n\t * @returns the translated string with placeholders expanded\n\t */\n\t_x(msgid: string, placeholders?: Placeholders) {\n\t\treturn Textdomain.expand(\n\t\t\tgettextImpl({ msgid: msgid, catalog: this.catalog }),\n\t\t\tplaceholders || {},\n\t\t);\n\t}\n\n\t/**\n\t * Translate a string with a plural expression with placeholders.\n\t *\n\t * @param msgid - the string in the singular\n\t * @param msgidPlural - the string in the plural\n\t * @param numItems - the number of items\n\t * @param placeholders - an optional dictionary of placeholders\n\t *\n\t * @returns the translated string\n\t */\n\t_nx(\n\t\tmsgid: string,\n\t\tmsgidPlural: string,\n\t\tnumItems: number,\n\t\tplaceholders?: Placeholders,\n\t) {\n\t\treturn Textdomain.expand(\n\t\t\tgettextImpl({\n\t\t\t\tmsgid: msgid,\n\t\t\t\tmsgidPlural: msgidPlural,\n\t\t\t\tnumItems: numItems,\n\t\t\t\tcatalog: this.catalog,\n\t\t\t}),\n\t\t\tplaceholders || {},\n\t\t);\n\t}\n\n\t/**\n\t * The method `_px()` combines `_p()` with `_x()`.\n\t *\n\t * @param msgctxt - the message context\n\t * @param msgid - the message id\n\t * @param placeholders - an optional dictionary with placehoders\n\t * @returns the translated string\n\t */\n\t_px(msgctxt: string, msgid: string, placeholders?: Placeholders) {\n\t\treturn Textdomain.expand(\n\t\t\tgettextImpl({ msgctxt: msgctxt, msgid: msgid, catalog: this.catalog }),\n\t\t\tplaceholders || {},\n\t\t);\n\t}\n\n\t/**\n\t * The method `_npx()` brings it all together. It combines `_n()` and\n\t * `_p()` and `_x()`.\n\t *\n\t * @param msgctxt - the message context\n\t * @param msgid - the message id\n\t * @param msgidPlural - the plural string\n\t * @param numItems - the number of items\n\t * @param placeholders - an optional dictionary with placehoders\n\t * @returns the translated string\n\t */\n\t_npx(\n\t\tmsgctxt: string,\n\t\tmsgid: string,\n\t\tmsgidPlural: string,\n\t\tnumItems: number,\n\t\tplaceholders?: Placeholders,\n\t) {\n\t\treturn Textdomain.expand(\n\t\t\tgettextImpl({\n\t\t\t\tmsgctxt: msgctxt,\n\t\t\t\tmsgid: msgid,\n\t\t\t\tmsgidPlural: msgidPlural,\n\t\t\t\tnumItems: numItems,\n\t\t\t\tcatalog: this.catalog,\n\t\t\t}),\n\t\t\tplaceholders || {},\n\t\t);\n\t}\n\n\tprivate static getCatalog(locale: string, textdomain: string): Catalog {\n\t\tconst catalog = CatalogCache.lookup(locale, textdomain);\n\t\tif (!catalog || Promise.resolve(catalog) === catalog) {\n\t\t\treturn {\n\t\t\t\tmajor: 0,\n\t\t\t\tminor: 0,\n\t\t\t\tpluralFunction: germanicPlural,\n\t\t\t\tentries: {},\n\t\t\t};\n\t\t}\n\n\t\treturn catalog as Catalog;\n\t}\n\n\t/**\n\t * Retrieve a translation for a string with a fixed locale.\n\t *\n\t * @param locale - the locale identifier\n\t * @param msgid - the string to translate\n\t *\n\t * @returns the translated string\n\t */\n\t_l(locale: string, msgid: string) {\n\t\tconst catalog = Textdomain.getCatalog(locale, this.textdomain());\n\t\treturn gettextImpl({ msgid: msgid, catalog: catalog });\n\t}\n\n\t/**\n\t * Retrieve a translation for a string containing a possible plural with\n\t * a fixed locale.\n\t * You will almost always want to call {@link _nx} instead so that\n\t * you can interpolate the number of items into the strings.\n\t *\n\t * @param locale - the locale identifier\n\t * @param msgid - the string in the singular\n\t * @param msgidPlural - the string in the plural\n\t * @param numItems - the number of items\n\t *\n\t * @returns the translated string\n\t */\n\t_ln(locale: string, msgid: string, msgidPlural: string, numItems: number) {\n\t\tconst catalog = Textdomain.getCatalog(locale, this.textdomain());\n\t\treturn gettextImpl({\n\t\t\tmsgid: msgid,\n\t\t\tmsgidPlural: msgidPlural,\n\t\t\tnumItems: numItems,\n\t\t\tcatalog: catalog,\n\t\t});\n\t}\n\n\t/**\n\t * Translate a string with a context with a fixed locale.\n\t *\n\t * @param locale - the locale identifier\n\t * @param msgctxt - the message context\n\t * @param msgid - the string to translate\n\t *\n\t * @returns the translated string\n\t */\n\t_lp(locale: string, msgctxt: string, msgid: string) {\n\t\tconst catalog = Textdomain.getCatalog(locale, this.textdomain());\n\t\treturn gettextImpl({ msgctxt: msgctxt, msgid: msgid, catalog: catalog });\n\t}\n\n\t/**\n\t * The method `_lnp()` combines `_ln()` with `_lp()`.\n\t * You will almost always want to call {@link _npx} instead so that\n\t * you can interpolate the number of items into the strings.\n\n\t *\n\t * @param locale - the locale identifier\n\t * @param msgctxt - the message context\n\t * @param msgid - the message id\n\t * @param placeholders - a dictionary with placehoders\n\t * @returns the translated string\n\t */\n\t_lnp(\n\t\tlocale: string,\n\t\tmsgctxt: string,\n\t\tmsgid: string,\n\t\tmsgidPlural: string,\n\t\tnumItems: number,\n\t) {\n\t\tconst catalog = Textdomain.getCatalog(locale, this.textdomain());\n\t\treturn gettextImpl({\n\t\t\tmsgctxt: msgctxt,\n\t\t\tmsgid: msgid,\n\t\t\tmsgidPlural: msgidPlural,\n\t\t\tnumItems: numItems,\n\t\t\tcatalog: catalog,\n\t\t});\n\t}\n\n\t/**\n\t * Translate a string with placeholders for a fixed locale.\n\t * The placeholders should be\n\t * wrapped into curly braces and must match the regular expression\n\t * \"[_a-zA-Z][_a-zA-Z0-9]*\".\n\t *\n\t * @param locale - the locale identifier\n\t * @param msgid - the msgid to translate\n\t * @param placeholders - an optional dictionary of placeholders\n\t *\n\t * @returns the translated string with placeholders expanded\n\t */\n\t_lx(locale: string, msgid: string, placeholders?: Placeholders) {\n\t\tconst catalog = Textdomain.getCatalog(locale, this.textdomain());\n\t\treturn Textdomain.expand(\n\t\t\tgettextImpl({ msgid: msgid, catalog: catalog }),\n\t\t\tplaceholders || {},\n\t\t);\n\t}\n\n\t/**\n\t * Translate a string with a plural expression with placeholders into a\n\t * fixed locale.\n\t *\n\t * @param locale - the locale identifier\n\t * @param msgid - the string in the singular\n\t * @param msgidPlural - the string in the plural\n\t * @param numItems - the number of items\n\t * @param placeholders - an optional dictionary of placeholders\n\t *\n\t * @returns the translated string\n\t */\n\t_lnx(\n\t\tlocale: string,\n\t\tmsgid: string,\n\t\tmsgidPlural: string,\n\t\tnumItems: number,\n\t\tplaceholders?: Placeholders,\n\t) {\n\t\tconst catalog = Textdomain.getCatalog(locale, this.textdomain());\n\t\treturn Textdomain.expand(\n\t\t\tgettextImpl({\n\t\t\t\tmsgid: msgid,\n\t\t\t\tmsgidPlural: msgidPlural,\n\t\t\t\tnumItems: numItems,\n\t\t\t\tcatalog: catalog,\n\t\t\t}),\n\t\t\tplaceholders || {},\n\t\t);\n\t}\n\n\t/**\n\t * The method `_lpx()` combines `_lp()` with `_lx()`.\n\t *\n\t * @param locale - the locale identifier\n\t * @param msgctxt - the message context\n\t * @param msgid - the message id\n\t * @param placeholders - an optional dictionary with placehoders\n\t * @returns the translated string\n\t */\n\t_lpx(\n\t\tlocale: string,\n\t\tmsgctxt: string,\n\t\tmsgid: string,\n\t\tplaceholders?: Placeholders,\n\t) {\n\t\tconst catalog = Textdomain.getCatalog(locale, this.textdomain());\n\t\treturn Textdomain.expand(\n\t\t\tgettextImpl({ msgctxt: msgctxt, msgid: msgid, catalog: catalog }),\n\t\t\tplaceholders || {},\n\t\t);\n\t}\n\n\t/**\n\t * The method `_lnpx()` brings it all together. It combines `_ln()` and\n\t * `_lp()` and `_lx()`.\n\t *\n\t * @param locale - the locale identifier\n\t * @param msgctxt - the message context\n\t * @param msgid - the message id\n\t * @param msgidPlural - the plural string\n\t * @param numItems - the number of items\n\t * @param placeholders - an optional dictionary with placehoders\n\t * @returns the translated string\n\t */\n\t_lnpx(\n\t\tlocale: string,\n\t\tmsgctxt: string,\n\t\tmsgid: string,\n\t\tmsgidPlural: string,\n\t\tnumItems: number,\n\t\tplaceholders?: Placeholders,\n\t) {\n\t\tconst catalog = Textdomain.getCatalog(locale, this.textdomain());\n\t\treturn Textdomain.expand(\n\t\t\tgettextImpl({\n\t\t\t\tmsgctxt: msgctxt,\n\t\t\t\tmsgid: msgid,\n\t\t\t\tmsgidPlural: msgidPlural,\n\t\t\t\tnumItems: numItems,\n\t\t\t\tcatalog: catalog,\n\t\t\t}),\n\t\t\tplaceholders || {},\n\t\t);\n\t}\n\n\tprivate static expand(\n\t\tmsg: string,\n\t\tplaceholders: { [key: string]: string },\n\t): string {\n\t\treturn msg.replace(/\\{([a-zA-Z][0-9a-zA-Z]*)\\}/g, (_, match: string) => {\n\t\t\tif (Object.prototype.hasOwnProperty.call(placeholders, match)) {\n\t\t\t\treturn placeholders[match];\n\t\t\t} else {\n\t\t\t\treturn `{${match}}`;\n\t\t\t}\n\t\t});\n\t}\n\n\t/**\n\t * Instantiate a Textdomain object. Textdomain objects are singletons\n\t * for each textdomain identifier.\n\t *\n\t * @param textdomain - the textdomain of your application or library.\n\t *\n\t * @returns a [[`Textdomain`]]\n\t */\n\tstatic getInstance(textdomain: string): Textdomain {\n\t\tif (\n\t\t\ttypeof textdomain === 'undefined' ||\n\t\t\ttextdomain === null ||\n\t\t\ttextdomain === ''\n\t\t) {\n\t\t\tthrow new Error('Cannot instantiate TextDomain without a textdomain');\n\t\t}\n\n\t\tif (Object.prototype.hasOwnProperty.call(Textdomain.domains, textdomain)) {\n\t\t\treturn Textdomain.domains[textdomain];\n\t\t} else {\n\t\t\tconst domain = new Textdomain(textdomain);\n\t\t\tTextdomain.domains[textdomain] = domain;\n\t\t\tdomain.catalog = {\n\t\t\t\tmajor: 0,\n\t\t\t\tminor: 0,\n\t\t\t\tpluralFunction: germanicPlural,\n\t\t\t\tentries: {},\n\t\t\t};\n\n\t\t\treturn domain;\n\t\t}\n\t}\n\n\t/**\n\t * Delete all existing singletons. This method should usually be called\n\t * only, when you want to free memory.\n\t */\n\tstatic clearInstances(): void {\n\t\tTextdomain.boundDomains = {};\n\t}\n\n\t/**\n\t * This method is used for testing. Do not use it yourself!\n\t */\n\tstatic forgetInstances(): void {\n\t\tTextdomain.clearInstances();\n\t\tTextdomain.domains = {};\n\t}\n\n\t/**\n\t * Query the locale in use.\n\t */\n\tstatic get locale(): string {\n\t\treturn Textdomain._locale;\n\t}\n\n\t/**\n\t * Change the locale.\n\t *\n\t * For the web you can use all valid language identifier tags that\n\t * [BCP47](https://tools.ietf.org/html/bcp47) allows\n\t * (and actually a lot more). The tag is always used unmodified.\n\t *\n\t * For server environments, the locale identifier has to match the following\n\t * scheme:\n\t *\n\t * `ll_CC.charset\\@modifier`\n\t *\n\t * * `ll` is the two- or three-letter language code.\n\t * * `CC` is the optional two-letter country code.\n\t * * `charset` is an optional character set (letters, digits, and the hyphen).\n\t * * `modifier` is an optional variant (letters and digits).\n\t *\n\t * The language code is always converted to lowercase, the country code is\n\t * converted to uppercase, variant and charset are used as is.\n\t *\n\t * @param locale - the locale identifier\n\t * @returns the locale in use\n\t */\n\tstatic set locale(locale: string) {\n\t\tconst ucLocale = locale.toUpperCase();\n\n\t\tif (ucLocale === 'POSIX' || ucLocale === 'C') {\n\t\t\tthis._locale = 'POSIX';\n\t\t\treturn;\n\t\t}\n\n\t\tconst split = splitLocale(locale);\n\t\tif (!split) {\n\t\t\tthrow new Error('invalid locale identifier');\n\t\t}\n\n\t\t// The check from splitLocale() is sufficient.\n\t\tif (browserEnvironment()) {\n\t\t\tthis._locale = locale;\n\t\t\treturn;\n\t\t}\n\n\t\t// Node.\n\t\tsplit.tags[0] = split.tags[0].toLowerCase();\n\t\tif (split.tags.length > 1) {\n\t\t\tsplit.tags[1] = split.tags[1].toUpperCase();\n\t\t}\n\n\t\tconst separator = split.underscoreSeparator ? '_' : '-';\n\t\tthis._locale = split.tags.join(separator);\n\n\t\tif (typeof split.charset !== 'undefined') {\n\t\t\tthis._locale += '.' + split.charset;\n\t\t}\n\n\t\tif (typeof split.modifier !== 'undefined') {\n\t\t\tthis._locale += '@' + split.modifier;\n\t\t}\n\t}\n\n\tprivate constructor(domain: string) {\n\t\tthis.domain = domain;\n\n\t\tconst msg =\n\t\t\t\"The property 'locale' is not an instance property but static. Use 'Textdomain.locale' instead!\";\n\t\tObject.defineProperty(this, 'locale', {\n\t\t\tget: () => {\n\t\t\t\tthrow new Error(msg);\n\t\t\t},\n\t\t\tset: () => {\n\t\t\t\tthrow new Error(msg);\n\t\t\t},\n\t\t\tenumerable: true,\n\t\t\tconfigurable: true,\n\t\t});\n\t}\n\n\t/**\n\t * A textdomain is an identifier for your application or library. It is\n\t * the basename of your translation files which are either\n\t * TEXTDOMAIN.mo.json or TEXTDOMAIN.mo, depending on the format you have\n\t * chosen.\n\t *\n\t * FIXME! This should be a getter!\n\t *\n\t * @returns the textdomain\n\t */\n\tpublic textdomain(): string {\n\t\treturn this.domain;\n\t}\n\n\t/**\n\t * Bind a textdomain to a certain path or queries the path that a\n\t * textdomain is bound to. The catalog file will be searched\n\t * in `${path}/LC_MESSAGES/${domainname}.EXT` where `EXT` is the\n\t * selected catalog format (one of `mo.json`, `mo`, or `json`).\n\t *\n\t * Alternatively, you can pass a [[`LocaleContainer`]] that holds the\n\t * catalogs in memory.\n\t *\n\t * The returned string or `LocaleContainer` is valid until the next\n\t * `bindtextdomain` call with an argument.\n\t *\n\t * @param path - the base path or [[`LocaleContainer`]] for this textdomain\n\t *\n\t * @returns the current base directory or [[`LocaleContainer`]] for this domain, after possibly changing it.\n\t */\n\tbindtextdomain(path?: string | LocaleContainer): string | LocaleContainer {\n\t\tif (typeof path !== 'undefined') {\n\t\t\tTextdomain.boundDomains[this.domain] = path;\n\t\t}\n\n\t\treturn Textdomain.boundDomains[this.domain];\n\t}\n\n\t/**\n\t * Resolve a textdomain, i.e. load the LocaleContainer for this domain and all\n\t * of its dependencies for the currently selected locale or the locale\n\t * specified.\n\t *\n\t * The promise will always resolve. If no catalog was found, an empty\n\t * catalog will be returned that is still usable.\n\t *\n\t * @param locale - an optional locale identifier, defaults to Textdomain.locale\n\t *\n\t * @returns a promise for a Catalog that will always resolve.\n\t */\n\tasync resolve(locale?: string): Promise<Catalog> {\n\t\tconst promises = [this.resolve1(locale)];\n\t\tfor (const td in Textdomain.domains) {\n\t\t\tif (\n\t\t\t\tObject.prototype.hasOwnProperty.call(Textdomain.domains, td) &&\n\t\t\t\tTextdomain.domains[td] !== this\n\t\t\t) {\n\t\t\t\tpromises.push(Textdomain.domains[td].resolve1(locale));\n\t\t\t}\n\t\t}\n\n\t\treturn Promise.all(promises).then(values => {\n\t\t\treturn new Promise(resolve => resolve(values[0]));\n\t\t});\n\t}\n\n\tprivate async resolve1(locale?: string): Promise<Catalog> {\n\t\tlet path = this.bindtextdomain();\n\n\t\tif (typeof path === 'undefined' || path === null) {\n\t\t\tconst parts = browserEnvironment()\n\t\t\t\t? ['', 'assets', 'locale']\n\t\t\t\t: ['.', 'locale'];\n\t\t\tpath = parts.join(pathSeparator);\n\t\t}\n\n\t\tconst resolvedLocale = locale ? locale : Textdomain.locale;\n\t\treturn resolveImpl(\n\t\t\tthis.domain,\n\t\t\tpath,\n\t\t\tthis.catalogFormat,\n\t\t\tresolvedLocale,\n\t\t).then(catalog => {\n\t\t\tif (!locale) {\n\t\t\t\tthis.catalog = catalog;\n\t\t\t}\n\t\t\treturn new Promise(resolve => resolve(catalog));\n\t\t});\n\t}\n\n\t/**\n\t * Get the catalog format in use.\n\t *\n\t * @returns one of 'mo.json' or 'mo' (default is 'mo.json')\n\t */\n\tget catalogFormat(): string {\n\t\treturn this._catalogFormat;\n\t}\n\n\t/**\n\t * Set the catalog format to use.\n\t *\n\t * @param format - one of 'mo.json' or 'mo'\n\t */\n\tset catalogFormat(format: string) {\n\t\tformat = format.toLowerCase();\n\t\tif (format === 'mo.json') {\n\t\t\tthis._catalogFormat = 'mo.json';\n\t\t} else if (format === 'mo') {\n\t\t\tthis._catalogFormat = 'mo';\n\t\t} else {\n\t\t\tthrow new Error(`unsupported format ${format}`);\n\t\t}\n\t}\n\n\t/**\n\t * Queries the user's preferred locales. On the server it queries the\n\t * environment variables `LANGUAGE`, `LC_ALL`, `LANG`, and `LC_MESSAGES`\n\t * (in that order). In the browser, it parses it checks the user preferences\n\t * in the variables `navigator.languages`, `navigator.language`,\n\t * `navigator.userLanguage`, `navigator.browserLanguage`, and\n\t * `navigator.systemLanguage`.\n\t *\n\t * @returns the set of locales in order of preference\n\t *\n\t * Added in \\@runtime 0.1.0.\n\t */\n\tstatic userLocales(): Array<string> {\n\t\treturn userLocales();\n\t}\n\n\t/**\n\t * Select one of the supported locales from a list of locales accepted by\n\t * the user.\n\t *\n\t * @param supported - the list of locales supported by the application\n\t * @param requested - the list of locales accepted by the user\n\t *\n\t * If called with just one argument, then the list of requested locales\n\t * is determined by calling [[Textdomain.userLocales]].\n\t *\n\t * @returns the negotiated locale or 'C' if not possible.\n\t */\n\tstatic selectLocale(\n\t\tsupported: Array<string>,\n\t\trequested?: Array<string>,\n\t): string {\n\t\treturn selectLocale(supported, requested ?? Textdomain.userLocales());\n\t}\n\n\t/**\n\t * A no-op method for string marking.\n\t *\n\t * Sometimes you want to mark strings for translation but do not actually\n\t * want to translate them, at least not at the time of their definition.\n\t * This is often the case, when you have to preserve the original string.\n\t *\n\t * Take this example:\n\t *\n\t * ```\n\t * orangeColors = [gtx.N_('coral'), gtx.N_('tomato'), gtx.N_('orangered'),\n\t * gtx.N_('gold'), gtx.N_('orange'), gtx.N_('darkorange')]\n\t * ```\n\t *\n\t * These are standard CSS colors, and you cannot translate them inside\n\t * CSS styles. But for presentation you may want to translate them later:\n\t *\n\t * ```\n\t * console.log(gtx._x(\"The css color '{color}' is {translated}.\",\n\t * {\n\t * color: orangeColors[2],\n\t * translated: gtx._(orangeColors[2]),\n\t * }\n\t * )\n\t * );\n\t * ```\n\t *\n\t * In other words: The method just marks strings for translation, so that\n\t * the extractor `esgettext-xgettext` finds them but it does not actually\n\t * translate anything.\n\t *\n\t * Similar methods are available for other cases (with placeholder\n\t * expansion, context, or both). They are *not* available for plural\n\t * methods because that would not make sense.\n\t *\n\t * Note that all of these methods are also available as instance methods.\n\t *\n\t * @param msgid - the message id\n\t * @returns the original string\n\t */\n\tstatic N_(msgid: string): string {\n\t\treturn msgid;\n\t}\n\n\t/**\n\t * Does the same as the static method `N_()`.\n\t *\n\t * @param msgid - the message id\n\t * @returns the original string\n\t */\n\tN_(msgid: string): string {\n\t\treturn msgid;\n\t}\n\n\t/**\n\t * Same as `N_()` but with placeholder expansion.\n\t *\n\t * @param msgid - the message id\n\t * @param placeholders - a dictionary of placeholders\n\t * @returns the original string with placeholders expanded\n\t */\n\tN_x(msgid: string, placeholders?: Placeholders): string {\n\t\treturn Textdomain.expand(msgid, placeholders ?? {});\n\t}\n\n\t/**\n\t * Does the same as the static method `N_x()`.\n\t *\n\t * @param msgid - the message id\n\t * @param placeholders - a dictionary of placeholders\n\t * @returns the original string with placeholders expanded\n\t */\n\tstatic N_x(msgid: string, placeholders?: Placeholders): string {\n\t\treturn Textdomain.expand(msgid, placeholders ?? {});\n\t}\n\n\t/**\n\t * Same as `N_()` but with context.\n\t *\n\t * @param _msgctxt - the message context (not used)\n\t * @param msgid - the message id\n\t * @returns the original string\n\t */\n\tN_p(_msgctxt: string, msgid: string): string {\n\t\treturn msgid;\n\t}\n\n\t/**\n\t * Does the same as the static method `N_p()`.\n\t *\n\t * @param _msgctxt - the message context (not used)\n\t * @param msgid - the message id\n\t * @returns the original string with placeholders expanded\n\t */\n\tstatic N_p(_msgctxt: string, msgid: string): string {\n\t\treturn msgid;\n\t}\n\n\t/**\n\t * Same as `N_()` but with context and placeholder expansion.\n\t *\n\t * @param _msgctxt - the message context (not used)\n\t * @param msgid - the message id\n\t * @param placeholders - a dictionary of placeholders\n\t * @returns the original string with placeholders expanded\n\t */\n\tN_px(_msgctxt: string, msgid: string, placeholders?: Placeholders): string {\n\t\treturn Textdomain.expand(msgid, placeholders ?? {});\n\t}\n\n\t/**\n\t * Does the same as the static method `N_px()`.\n\t *\n\t * @param _msgctxt - the message context (not used)\n\t * @param msgid - the message id\n\t * @param placeholders - a dictionary of placeholders\n\t * @returns the original string with placeholders expanded\n\t */\n\tstatic N_px(\n\t\t_msgctxt: string,\n\t\tmsgid: string,\n\t\tplaceholders?: Placeholders,\n\t): string {\n\t\treturn Textdomain.expand(msgid, placeholders ?? {});\n\t}\n}\n","import { userLocales } from './core/user-locales';\n// FIXME! Windows!\nif (typeof process.env.LANGUAGE !== 'undefined') {\n\tuserLocales(process.env.LANGUAGE.split(':'));\n} else if (typeof process.env.LC_ALL !== 'undefined') {\n\tuserLocales([process.env.LC_ALL]);\n} else if (typeof process.env.LANG !== 'undefined') {\n\tuserLocales([process.env.LANG]);\n} else if (typeof process.env.LC_MESSAGES !== 'undefined') {\n\tuserLocales([process.env.LC_MESSAGES]);\n}\n\nexport * from './core';\n\nexport { parseMoCatalog, parseMoJsonCatalog } from './parser';\n"],"names":[],"mappings":";;AAAA,IAAI,mBAAmB,GAAG,CAAC,GAAG,CAAC,CAAC;AAEhC;;;;;;;AAOG;AACG,SAAU,WAAW,CAAC,OAAuB,EAAA;AAClD,IAAA,IAAI,OAAO,OAAO,KAAK,WAAW,EAAE;QACnC,mBAAmB,GAAG,OAAO,CAAC;KAC9B;AAED,IAAA,OAAO,mBAAmB,CAAC;AAC5B;;AChBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAkGA;AACO,SAAS,SAAS,CAAC,OAAO,EAAE,UAAU,EAAE,CAAC,EAAE,SAAS,EAAE;AAC7D,IAAI,SAAS,KAAK,CAAC,KAAK,EAAE,EAAE,OAAO,KAAK,YAAY,CAAC,GAAG,KAAK,GAAG,IAAI,CAAC,CAAC,UAAU,OAAO,EAAE,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE;AAChH,IAAI,OAAO,KAAK,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,EAAE,UAAU,OAAO,EAAE,MAAM,EAAE;AAC/D,QAAQ,SAAS,SAAS,CAAC,KAAK,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE;AACnG,QAAQ,SAAS,QAAQ,CAAC,KAAK,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,EAAE,EAAE,MA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