chunk-DT4QPJHF.js 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. import {
  2. a,
  3. c as c2
  4. } from "./chunk-4HL6BBWO.js";
  5. import {
  6. p as p3
  7. } from "./chunk-RVCE264D.js";
  8. import {
  9. b,
  10. c as c3,
  11. d,
  12. p,
  13. w
  14. } from "./chunk-HKJ7X3BD.js";
  15. import {
  16. a as a2,
  17. c2 as c4,
  18. p2
  19. } from "./chunk-3Z755LKF.js";
  20. import {
  21. c
  22. } from "./chunk-4ONPMX2F.js";
  23. import {
  24. j as j2
  25. } from "./chunk-LU5IJZB4.js";
  26. import {
  27. Ot,
  28. j
  29. } from "./chunk-VEGAOVMY.js";
  30. import {
  31. s3 as s
  32. } from "./chunk-E5O6P5I2.js";
  33. import {
  34. f,
  35. r
  36. } from "./chunk-YXWMMD76.js";
  37. // node_modules/@arcgis/core/symbols/support/webStyleSymbolUtils.js
  38. function h(t, e, r2, n) {
  39. return t.name ? t.styleName && "Esri2DPointSymbolsStyle" === t.styleName ? U(t, e, n) : c3(t, e, n).then((o) => d2(f(o), t.name, e, r2, n)) : Promise.reject(new s("symbolstyleutils:style-symbol-reference-name-missing", "Missing name in style symbol reference"));
  40. }
  41. function d2(l, f2, g, h2, d3) {
  42. var _a, _b, _c;
  43. const U2 = l.data, N = g && r(g.portal) ? g.portal : j2.getDefault(), w2 = { portal: N, url: j(l.baseUrl), origin: "portal-item" }, S = U2.items.find((t) => t.name === f2);
  44. if (!S) {
  45. const t = `The symbol name '${f2}' could not be found`;
  46. return Promise.reject(new s("symbolstyleutils:symbol-name-not-found", t, { symbolName: f2 }));
  47. }
  48. let D = c(d(S, h2), w2), O = (_b = (_a = S.thumbnail) == null ? void 0 : _a.href) != null ? _b : null;
  49. const P = S.thumbnail && S.thumbnail.imageData;
  50. c2() && (D = (_c = a(D)) != null ? _c : "", O = a(O));
  51. const E = { portal: N, url: j(Ot(D)), origin: "portal-item" };
  52. return b(D, d3).then((e) => {
  53. const r2 = "cimRef" === h2 ? p(e.data) : e.data, o = p3(r2, E);
  54. if (o && c4(o)) {
  55. if (O) {
  56. const t = c(O, w2);
  57. o.thumbnail = new p2({ url: t });
  58. } else
  59. P && (o.thumbnail = new p2({ url: `data:image/png;base64,${P}` }));
  60. l.styleUrl ? o.styleOrigin = new a2({ portal: g.portal, styleUrl: l.styleUrl, name: f2 }) : l.styleName && (o.styleOrigin = new a2({ portal: g.portal, styleName: l.styleName, name: f2 }));
  61. }
  62. return o;
  63. });
  64. }
  65. function U(t, e, r2) {
  66. const o = w.replace(/\{SymbolName\}/gi, t.name), l = r(e.portal) ? e.portal : j2.getDefault();
  67. return b(o, r2).then((t2) => {
  68. const e2 = p(t2.data);
  69. return p3(e2, { portal: l, url: j(Ot(o)), origin: "portal-item" });
  70. });
  71. }
  72. export {
  73. h,
  74. d2 as d
  75. };
  76. //# sourceMappingURL=chunk-DT4QPJHF.js.map