const t = "gx-ide-assets/";

const n = "gx-ide-";

const s = "en";

const e = "langs/";

const o = ".lang.";

const c = ".json";

class a {
  static getLang() {
    var t, n;
    const e = (n = (t = document.getElementsByTagName("html")[0].getAttribute("lang")) === null || t === void 0 ? void 0 : t.valueOf()) !== null && n !== void 0 ? n : s;
    // Normalize en-US
        return e === "en-US" ? "en" : e;
  }
  static getStrings(n, s, a) {
    if (a === "") {
      a = `${n}/`;
    }
    const i = `${t}${a}${e}${n}${o}${s}${c}`;
    return new Promise(((t, n) => {
      fetch(i).then((s => {
        if (s.ok) {
          t(s.json());
        } else {
          n();
        }
      }), n);
    }));
  }
  static async getComponentStrings(t, s = "", e = "") {
    if (e === "") {
      e = t.tagName.toLowerCase().replace(n, "");
    }
    const o = a.getLang();
    return await a.getStrings(e, o, s);
  }
  static format(t, n) {
    let s = t;
    n.forEach((t => {
      s = s.replace(`{${n.indexOf(t)}}`, t);
    }));
    return s;
  }
}

a.commonAssetsPath = "";

export { a as L };
//# sourceMappingURL=p-311eedf3.js.map