chunk-UPD4MTCL.js 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. import {
  2. B
  3. } from "./chunk-4NKD334K.js";
  4. import {
  5. d
  6. } from "./chunk-ATPLLI5W.js";
  7. import {
  8. U
  9. } from "./chunk-VNFRAYHO.js";
  10. import {
  11. F,
  12. Ot
  13. } from "./chunk-VBRY5KJM.js";
  14. import {
  15. w
  16. } from "./chunk-ULGDPLM2.js";
  17. import {
  18. s3 as s
  19. } from "./chunk-EMJ4ZSM2.js";
  20. import {
  21. a,
  22. r
  23. } from "./chunk-GZT4BVFP.js";
  24. // node_modules/@arcgis/core/support/featureFlags.js
  25. var r2 = () => !!a("enable-feature:force-wosr");
  26. // node_modules/@arcgis/core/symbols/support/styleUtils.js
  27. var i = {};
  28. async function u(e, r3) {
  29. try {
  30. return { data: (await j(e, r3)).data, baseUrl: Ot(e), styleUrl: e };
  31. } catch (t) {
  32. return w(t), null;
  33. }
  34. }
  35. function y(e, r3, o) {
  36. const s2 = r(r3.portal) ? r3.portal : B.getDefault();
  37. let n;
  38. const a2 = `${s2.url} - ${s2.user && s2.user.username} - ${e}`;
  39. return i[a2] || (i[a2] = m(e, s2, o).then((e2) => (n = e2, e2.fetchData())).then((r4) => ({ data: r4, baseUrl: n.itemUrl, styleName: e }))), i[a2];
  40. }
  41. function m(e, t, o) {
  42. return t.load(o).then(() => {
  43. const r3 = new d({ disableExtraQuery: true, query: `owner:${w2} AND type:${h} AND typekeywords:"${e}"` });
  44. return t.queryItems(r3, o);
  45. }).then(({ results: t2 }) => {
  46. let s2 = null;
  47. const n = e.toLowerCase();
  48. if (t2 && Array.isArray(t2))
  49. for (const e2 of t2) {
  50. if (e2.typeKeywords.some((e3) => e3.toLowerCase() === n) && e2.type === h && e2.owner === w2) {
  51. s2 = e2;
  52. break;
  53. }
  54. }
  55. if (!s2)
  56. throw new s("symbolstyleutils:style-not-found", `The style '${e}' could not be found`, { styleName: e });
  57. return s2.load(o);
  58. });
  59. }
  60. function c(e, t, o) {
  61. return e.styleUrl ? u(e.styleUrl, o) : e.styleName ? y(e.styleName, t, o) : Promise.reject(new s("symbolstyleutils:style-url-and-name-missing", "Either styleUrl or styleName is required to resolve a style"));
  62. }
  63. function p(e) {
  64. return e === null || e.type === "CIMSymbolReference" ? e : { type: "CIMSymbolReference", symbol: e };
  65. }
  66. function d2(e, r3) {
  67. if (r3 === "cimRef")
  68. return e.cimRef;
  69. if (e.formatInfos && !r2()) {
  70. for (const t of e.formatInfos)
  71. if (t.type === "gltf")
  72. return t.href;
  73. }
  74. return e.webRef;
  75. }
  76. function j(r3, t) {
  77. const o = { responseType: "json", query: { f: "json" }, ...t };
  78. return U(F(r3), o);
  79. }
  80. var w2 = "esri_en";
  81. var h = "Style";
  82. var U2 = "https://cdn.arcgis.com/sharing/rest/content/items/220936cc6ed342c9937abd8f180e7d1e/resources/styles/cim/{SymbolName}.json?f=json";
  83. export {
  84. c,
  85. p,
  86. d2 as d,
  87. j,
  88. U2 as U
  89. };
  90. //# sourceMappingURL=chunk-UPD4MTCL.js.map