chunk-2SJEIKRW.js 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. import {
  2. l,
  3. u
  4. } from "./chunk-PHRSJJ3U.js";
  5. import {
  6. L,
  7. m
  8. } from "./chunk-PIGRDDRG.js";
  9. import {
  10. a
  11. } from "./chunk-MXB2XLKV.js";
  12. import {
  13. U
  14. } from "./chunk-VNFRAYHO.js";
  15. import {
  16. s,
  17. s3 as s2
  18. } from "./chunk-EMJ4ZSM2.js";
  19. import {
  20. r as r2,
  21. t
  22. } from "./chunk-IKP3YN53.js";
  23. import {
  24. r
  25. } from "./chunk-GZT4BVFP.js";
  26. // node_modules/@arcgis/core/intl/substitute.js
  27. var i = s.getLogger("esri.intl");
  28. function s3(t2, r3, n = {}) {
  29. const { format: o2 = {} } = n;
  30. return r2(t2, (t3) => u2(t3, r3, o2));
  31. }
  32. function u2(t2, e, n) {
  33. let o2, i3;
  34. const s6 = t2.indexOf(":");
  35. if (s6 === -1 ? o2 = t2.trim() : (o2 = t2.slice(0, s6).trim(), i3 = t2.slice(s6 + 1).trim()), !o2)
  36. return "";
  37. const u4 = t(o2, e);
  38. if (u4 == null)
  39. return "";
  40. const m2 = n[i3] || n[o2];
  41. return m2 ? c(u4, m2) : i3 ? a2(u4, i3) : f(u4);
  42. }
  43. function c(t2, r3) {
  44. switch (r3.type) {
  45. case "date":
  46. return L(t2, r3.intlOptions);
  47. case "number":
  48. return m(t2, r3.intlOptions);
  49. default:
  50. return i.warn("missing format descriptor for key {key}"), f(t2);
  51. }
  52. }
  53. function a2(t2, r3) {
  54. switch (r3.toLowerCase()) {
  55. case "dateformat":
  56. return L(t2);
  57. case "numberformat":
  58. return m(t2);
  59. default:
  60. return i.warn(`inline format is unsupported since 4.12: ${r3}`), /^(dateformat|datestring)/i.test(r3) ? L(t2) : /^numberformat/i.test(r3) ? m(t2) : f(t2);
  61. }
  62. }
  63. function f(t2) {
  64. switch (typeof t2) {
  65. case "string":
  66. return t2;
  67. case "number":
  68. return m(t2);
  69. case "boolean":
  70. return "" + t2;
  71. default:
  72. return t2 instanceof Date ? L(t2) : "";
  73. }
  74. }
  75. // node_modules/@arcgis/core/intl/t9n.js
  76. async function o(e, n, o2, i3) {
  77. const a5 = n.exec(o2);
  78. if (!a5)
  79. throw new s2("esri-intl:invalid-bundle", `Bundle id "${o2}" is not compatible with the pattern "${n}"`);
  80. const c4 = a5[1] ? `${a5[1]}/` : "", l3 = a5[2], w = u(i3), h2 = `${c4}${l3}.json`, u4 = w ? `${c4}${l3}_${w}.json` : h2;
  81. let f2;
  82. try {
  83. f2 = await s4(e(u4));
  84. } catch (d) {
  85. if (u4 === h2)
  86. throw new s2("intl:unknown-bundle", `Bundle "${o2}" cannot be loaded`, { error: d });
  87. try {
  88. f2 = await s4(e(h2));
  89. } catch (d2) {
  90. throw new s2("intl:unknown-bundle", `Bundle "${o2}" cannot be loaded`, { error: d2 });
  91. }
  92. }
  93. return f2;
  94. }
  95. async function s4(t2) {
  96. if (r(c2.fetchBundleAsset))
  97. return c2.fetchBundleAsset(t2);
  98. const r3 = await U(t2, { responseType: "text" });
  99. return JSON.parse(r3.data);
  100. }
  101. var i2 = class {
  102. constructor({ base: e = "", pattern: t2, location: n = new URL(window.location.href) }) {
  103. let r3;
  104. r3 = typeof n == "string" ? (e2) => new URL(e2, new URL(n, window.location.href)).href : n instanceof URL ? (e2) => new URL(e2, n).href : n, this.pattern = typeof t2 == "string" ? new RegExp(`^${t2}`) : t2, this.getAssetUrl = r3, e = e ? e.endsWith("/") ? e : e + "/" : "", this.matcher = new RegExp(`^${e}(?:(.*)/)?(.*)$`);
  105. }
  106. fetchMessageBundle(e, t2) {
  107. return o(this.getAssetUrl, this.matcher, e, t2);
  108. }
  109. };
  110. function a3(e) {
  111. return new i2(e);
  112. }
  113. var c2 = {};
  114. // node_modules/@arcgis/core/intl.js
  115. l(a3({ pattern: "esri/", location: a }));
  116. export {
  117. s3 as s
  118. };
  119. //# sourceMappingURL=chunk-2SJEIKRW.js.map