123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- import {
- g,
- l
- } from "./chunk-XH7RUGVZ.js";
- import {
- T
- } from "./chunk-ULGDPLM2.js";
- import {
- s3 as s
- } from "./chunk-EMJ4ZSM2.js";
- // node_modules/@arcgis/core/intl/messages.js
- var r = /^([a-z]{2})(?:[-_]([A-Za-z]{2}))?$/;
- var o = { ar: true, bg: true, bs: true, ca: true, cs: true, da: true, de: true, el: true, en: true, es: true, et: true, fi: true, fr: true, he: true, hr: true, hu: true, id: true, it: true, ja: true, ko: true, lt: true, lv: true, nb: true, nl: true, pl: true, "pt-BR": true, "pt-PT": true, ro: true, ru: true, sk: true, sl: true, sr: true, sv: true, th: true, tr: true, uk: true, vi: true, "zh-CN": true, "zh-HK": true, "zh-TW": true };
- function i(t) {
- return o[t] ?? false;
- }
- var a = [];
- var c = new Map();
- function d(t) {
- for (const e of c.keys())
- m(t.pattern, e) && c.delete(e);
- }
- function l2(t) {
- return a.includes(t) || (d(t), a.unshift(t)), { remove() {
- const e = a.indexOf(t);
- e > -1 && (a.splice(e, 1), d(t));
- } };
- }
- async function h(t) {
- const e = l();
- c.has(t) || c.set(t, f(t, e));
- const n = c.get(t);
- return await _.add(n), n;
- }
- function u(t) {
- if (!r.test(t))
- return null;
- const [, e, n] = r.exec(t), s2 = e + (n ? "-" + n.toUpperCase() : "");
- return i(s2) ? s2 : i(e) ? e : null;
- }
- async function f(e, n) {
- const s2 = [];
- for (const t of a)
- if (m(t.pattern, e))
- try {
- return await t.fetchMessageBundle(e, n);
- } catch (r2) {
- s2.push(r2);
- }
- if (s2.length)
- throw new s("intl:message-bundle-error", `Errors occurred while loading "${e}"`, { errors: s2 });
- throw new s("intl:no-message-bundle-loader", `No loader found for message bundle "${e}"`);
- }
- function m(t, e) {
- return typeof t == "string" ? e.startsWith(t) : t.test(e);
- }
- g(() => {
- c.clear();
- });
- var _ = new class {
- constructor() {
- this._numLoading = 0;
- }
- async waitForAll() {
- this._dfd && await this._dfd.promise;
- }
- add(t) {
- return this._increase(), t.then(() => this._decrease(), () => this._decrease()), this.waitForAll();
- }
- _increase() {
- this._numLoading++, this._dfd || (this._dfd = T());
- }
- _decrease() {
- this._numLoading = Math.max(this._numLoading - 1, 0), this._dfd && this._numLoading === 0 && (this._dfd.resolve(), this._dfd = null);
- }
- }();
- export {
- l2 as l,
- h,
- u
- };
- //# sourceMappingURL=chunk-PHRSJJ3U.js.map
|