chunk-DX5KJRJR.js 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392
  1. import {
  2. q
  3. } from "./chunk-I26BWYY3.js";
  4. import {
  5. p,
  6. y
  7. } from "./chunk-NDUYF7XW.js";
  8. import {
  9. n as n3
  10. } from "./chunk-JEA4MMTV.js";
  11. import {
  12. c as c2,
  13. e,
  14. i as i2,
  15. n as n2,
  16. o
  17. } from "./chunk-RG3AHHRL.js";
  18. import {
  19. i,
  20. n2 as n
  21. } from "./chunk-GZBNC76D.js";
  22. import {
  23. l
  24. } from "./chunk-X4SA4ELJ.js";
  25. import {
  26. U
  27. } from "./chunk-DVUG3KID.js";
  28. import {
  29. s as s2
  30. } from "./chunk-FWSQEIAR.js";
  31. import {
  32. s3 as s
  33. } from "./chunk-E5O6P5I2.js";
  34. import {
  35. has
  36. } from "./chunk-SPWQ3AWG.js";
  37. import {
  38. c,
  39. f
  40. } from "./chunk-YXWMMD76.js";
  41. // node_modules/@arcgis/core/symbols/support/svgUtils.js
  42. var f2 = "http://www.w3.org/2000/svg";
  43. var c3 = 0;
  44. var d = 0;
  45. var u = has("android");
  46. var y2 = has("chrome") || u && u >= 4 ? "auto" : "optimizeLegibility";
  47. var p2 = { m: 2, l: 2, h: 1, v: 1, c: 6, s: 4, q: 4, t: 2, a: 7, z: 0 };
  48. var g = /([A-DF-Za-df-z])|([-+]?\d*[.]?\d+(?:[eE][-+]?\d+)?)/g;
  49. var m = {};
  50. var x = {};
  51. var w = { solid: "none", shortdash: [4, 1], shortdot: [1, 1], shortdashdot: [4, 1, 1, 1], shortdashdotdot: [4, 1, 1, 1, 1, 1], dot: [1, 3], dash: [4, 3], longdash: [8, 3], dashdot: [4, 3, 1, 3], longdashdot: [8, 3, 1, 3], longdashdotdot: [8, 3, 1, 3, 1, 3] };
  52. var k = Math.PI;
  53. var b = 1;
  54. function j(t, e2) {
  55. const i3 = t * (k / 180);
  56. return Math.abs(e2 * Math.sin(i3)) + Math.abs(e2 * Math.cos(i3));
  57. }
  58. function v(t) {
  59. return t.map((t2) => `${t2.command} ${t2.values.join(" ")}`).join(" ").trim();
  60. }
  61. function M(t, i3, n4, r) {
  62. if (t) {
  63. if ("circle" === t.type)
  64. return n("circle", { fill: i3, "fill-rule": "evenodd", stroke: n4.color, "stroke-width": n4.width, "stroke-linecap": n4.cap, "stroke-linejoin": n4.join, "stroke-dasharray": n4.dashArray, "stroke-dashoffset": n4.dashOffset, "stroke-miterlimit": "4", cx: t.cx, cy: t.cy, r: t.r });
  65. if ("ellipse" === t.type)
  66. return n("ellipse", { fill: i3, "fill-rule": "evenodd", stroke: n4.color, "stroke-width": n4.width, "stroke-linecap": n4.cap, "stroke-linejoin": n4.join, "stroke-dasharray": n4.dashArray, "stroke-miterlimit": "4", cx: t.cx, cy: t.cy, rx: t.rx, ry: t.ry });
  67. if ("rect" === t.type)
  68. return n("rect", { fill: i3, "fill-rule": "evenodd", stroke: n4.color, "stroke-width": n4.width, "stroke-linecap": n4.cap, "stroke-linejoin": n4.join, "stroke-dasharray": n4.dashArray, "stroke-miterlimit": "4", x: t.x, y: t.y, width: t.width, height: t.height });
  69. if ("image" === t.type)
  70. return n("image", { href: t.src, x: t.x, y: t.y, width: t.width, height: t.height, preserveAspectRatio: "none" });
  71. if ("path" === t.type) {
  72. const e2 = "string" != typeof t.path ? v(t.path) : t.path;
  73. return n("path", { fill: i3, "fill-rule": "evenodd", stroke: n4.color, "stroke-width": n4.width, "stroke-linecap": n4.cap, "stroke-linejoin": n4.join, "stroke-dasharray": n4.dashArray, "stroke-miterlimit": "4", d: e2 });
  74. }
  75. if ("text" === t.type)
  76. return c(r), n("text", { "dominant-baseline": r.dominantBaseline, fill: i3, "fill-rule": "evenodd", stroke: n4.color, "stroke-width": n4.width, "stroke-linecap": n4.cap, "stroke-linejoin": n4.join, "stroke-dasharray": n4.dashArray, "stroke-miterlimit": "4", "text-anchor": r.align, "text-decoration": r.decoration, kerning: r.kerning, rotate: r.rotate, "text-rendering": y2, "font-style": r.font.style, "font-variant": r.font.variant, "font-weight": r.font.weight, "font-size": r.font.size, "font-family": r.font.family, x: t.x, y: t.y }, t.text);
  77. }
  78. return null;
  79. }
  80. function A(e2) {
  81. const i3 = { fill: "none", pattern: null, linearGradient: null };
  82. if (e2) {
  83. if ("type" in e2 && "pattern" === e2.type) {
  84. const t = "patternId-" + ++c3;
  85. i3.fill = `url(#${t})`, i3.pattern = { id: t, x: e2.x, y: e2.y, width: e2.width, height: e2.height, image: { x: 0, y: 0, width: e2.width, height: e2.height, href: e2.src } };
  86. } else if ("type" in e2 && "linear" === e2.type) {
  87. const n4 = "linearGradientId-" + ++d;
  88. i3.fill = `url(#${n4})`, i3.linearGradient = { id: n4, x1: e2.x1, y1: e2.y1, x2: e2.x2, y2: e2.y2, stops: e2.colors.map((e3) => ({ offset: e3.offset, color: e3.color && new l(e3.color).toString() })) };
  89. } else if (e2) {
  90. const n4 = new l(e2);
  91. i3.fill = n4.toString();
  92. }
  93. }
  94. return i3;
  95. }
  96. function S(e2) {
  97. var _a;
  98. const i3 = { color: "none", width: 1, cap: "butt", join: "4", dashArray: "none", dashOffset: "0" };
  99. if (e2 && (null != e2.width && (i3.width = e2.width), e2.cap && (i3.cap = e2.cap), e2.join && (i3.join = e2.join.toString()), e2.color && (i3.color = new l(e2.color).toString()), e2.dashArray && (i3.dashArray = e2.dashArray), e2.dashArray && (i3.dashOffset = e2.dashoffset), e2.style)) {
  100. let t = null;
  101. if (e2.style in w && (t = w[e2.style]), Array.isArray(t)) {
  102. t = t.slice(0);
  103. const i4 = (_a = e2.width) != null ? _a : 0;
  104. for (let e3 = 0; e3 < t.length; ++e3)
  105. t[e3] *= i4;
  106. if ("butt" !== e2.cap) {
  107. for (let e3 = 0; e3 < t.length; e3 += 2)
  108. t[e3] -= i4, t[e3] < 1 && (t[e3] = 1);
  109. for (let e3 = 1; e3 < t.length; e3 += 2)
  110. t[e3] += i4;
  111. }
  112. t = t.join(",");
  113. }
  114. i3.dashArray = t;
  115. }
  116. return i3;
  117. }
  118. function $(t, i3) {
  119. const n4 = { align: null, decoration: null, kerning: null, rotate: null, font: { style: null, variant: null, weight: null, size: null, family: null } };
  120. if (t) {
  121. const r = t.alignBaseline, o2 = "baseline" === r ? "auto" : "top" === r ? "text-top" : "bottom" === r ? "hanging" : r;
  122. n4.align = t.align, n4.dominantBaseline = o2, n4.decoration = t.decoration, n4.kerning = t.kerning ? "auto" : "0", n4.rotate = t.rotated ? "90" : "0", c(i3), n4.font.style = i3.style || "normal", n4.font.variant = i3.variant || "normal", n4.font.weight = i3.weight || "normal", n4.font.size = i3.size && i3.size.toString() || "10pt", n4.font.family = i3.family || "serif";
  123. }
  124. return n4;
  125. }
  126. function N(t) {
  127. const { pattern: e2, linearGradient: i3 } = t;
  128. if (e2)
  129. return n("pattern", { id: e2.id, patternUnits: "userSpaceOnUse", x: e2.x, y: e2.y, width: e2.width, height: e2.height }, n("image", { x: e2.image.x, y: e2.image.y, width: e2.image.width, height: e2.image.height, href: e2.image.href }));
  130. if (i3) {
  131. const t2 = i3.stops.map((t3, e3) => n("stop", { key: `${e3}-stop`, offset: t3.offset, "stop-color": t3.color }));
  132. return n("linearGradient", { id: i3.id, gradientUnits: "userSpaceOnUse", x1: i3.x1, y1: i3.y1, x2: i3.x2, y2: i3.y2 }, t2);
  133. }
  134. return null;
  135. }
  136. function G(t, e2) {
  137. if (!t)
  138. return null;
  139. const i3 = [];
  140. for (const n4 of t) {
  141. const { shape: t2, fill: e3, stroke: r, font: o2 } = n4, s4 = A(e3), a = S(r), l3 = "text" === t2.type ? $(t2, o2) : null, h2 = M(t2, s4.fill, a, l3);
  142. h2 && i3.push(h2);
  143. }
  144. return n("mask", { id: e2, maskUnits: "userSpaceOnUse" }, n("g", null, i3));
  145. }
  146. function I(t, e2, i3) {
  147. return i2(t, n2(t), [e2, i3]);
  148. }
  149. function z(t, e2, i3, n4, r) {
  150. return c2(t, n2(t), [e2, i3]), t[4] = t[4] * e2 - n4 * e2 + n4, t[5] = t[5] * i3 - r * i3 + r, t;
  151. }
  152. function B(t, e2, i3, n4) {
  153. const r = e2 % 360 * Math.PI / 180;
  154. e(t, n2(t), r);
  155. const o2 = Math.cos(r), a = Math.sin(r), h2 = t[4], f3 = t[5];
  156. return t[4] = h2 * o2 - f3 * a + n4 * a - i3 * o2 + i3, t[5] = f3 * o2 + h2 * a - i3 * a - n4 * o2 + n4, t;
  157. }
  158. function U2(t, e2) {
  159. m && "left" in m ? (null != m.left && m.left > t && (m.left = t), (null == m.right || m.right < t) && (m.right = t), (null == m.top || m.top > e2) && (m.top = e2), (null == m.bottom || m.bottom < e2) && (m.bottom = e2)) : m = { left: t, bottom: e2, right: t, top: e2 };
  160. }
  161. function F(t) {
  162. const e2 = t.args, i3 = e2.length;
  163. let n4;
  164. switch (t.action) {
  165. case "M":
  166. case "L":
  167. case "C":
  168. case "S":
  169. case "Q":
  170. case "T":
  171. for (n4 = 0; n4 < i3; n4 += 2)
  172. U2(e2[n4], e2[n4 + 1]);
  173. x.x = e2[i3 - 2], x.y = e2[i3 - 1];
  174. break;
  175. case "H":
  176. for (n4 = 0; n4 < i3; ++n4)
  177. U2(e2[n4], x.y);
  178. x.x = e2[i3 - 1];
  179. break;
  180. case "V":
  181. for (n4 = 0; n4 < i3; ++n4)
  182. U2(x.x, e2[n4]);
  183. x.y = e2[i3 - 1];
  184. break;
  185. case "m": {
  186. let t2 = 0;
  187. "x" in x || (U2(x.x = e2[0], x.y = e2[1]), t2 = 2);
  188. for (n4 = t2; n4 < i3; n4 += 2)
  189. U2(x.x += e2[n4], x.y += e2[n4 + 1]);
  190. break;
  191. }
  192. case "l":
  193. case "t":
  194. for (n4 = 0; n4 < i3; n4 += 2)
  195. U2(x.x += e2[n4], x.y += e2[n4 + 1]);
  196. break;
  197. case "h":
  198. for (n4 = 0; n4 < i3; ++n4)
  199. U2(x.x += e2[n4], x.y);
  200. break;
  201. case "v":
  202. for (n4 = 0; n4 < i3; ++n4)
  203. U2(x.x, x.y += e2[n4]);
  204. break;
  205. case "c":
  206. for (n4 = 0; n4 < i3; n4 += 6)
  207. U2(x.x + e2[n4], x.y + e2[n4 + 1]), U2(x.x + e2[n4 + 2], x.y + e2[n4 + 3]), U2(x.x += e2[n4 + 4], x.y += e2[n4 + 5]);
  208. break;
  209. case "s":
  210. case "q":
  211. for (n4 = 0; n4 < i3; n4 += 4)
  212. U2(x.x + e2[n4], x.y + e2[n4 + 1]), U2(x.x += e2[n4 + 2], x.y += e2[n4 + 3]);
  213. break;
  214. case "A":
  215. for (n4 = 0; n4 < i3; n4 += 7)
  216. U2(e2[n4 + 5], e2[n4 + 6]);
  217. x.x = e2[i3 - 2], x.y = e2[i3 - 1];
  218. break;
  219. case "a":
  220. for (n4 = 0; n4 < i3; n4 += 7)
  221. U2(x.x += e2[n4 + 5], x.y += e2[n4 + 6]);
  222. }
  223. }
  224. function O(t, e2, i3) {
  225. const n4 = p2[t.toLowerCase()];
  226. let r;
  227. "number" == typeof n4 && (n4 ? e2.length >= n4 && (r = { action: t, args: e2.slice(0, e2.length - e2.length % n4) }, i3.push(r), F(r)) : (r = { action: t, args: [] }, i3.push(r), F(r)));
  228. }
  229. function T(t) {
  230. const e2 = ("string" != typeof t.path ? v(t.path) : t.path).match(g), i3 = [];
  231. if (m = {}, x = {}, !e2)
  232. return null;
  233. let n4 = "", r = [];
  234. const o2 = e2.length;
  235. for (let a = 0; a < o2; ++a) {
  236. const t2 = e2[a], o3 = parseFloat(t2);
  237. isNaN(o3) ? (n4 && O(n4, r, i3), r = [], n4 = t2) : r.push(o3);
  238. }
  239. O(n4, r, i3);
  240. const s4 = { x: 0, y: 0, width: 0, height: 0 };
  241. return m && "left" in m && (s4.x = m.left, s4.y = m.top, s4.width = m.right - m.left, s4.height = m.bottom - m.top), s4;
  242. }
  243. function E(t) {
  244. const e2 = { x: 0, y: 0, width: 0, height: 0 };
  245. if ("circle" === t.type)
  246. e2.x = t.cx - t.r, e2.y = t.cy - t.r, e2.width = 2 * t.r, e2.height = 2 * t.r;
  247. else if ("ellipse" === t.type)
  248. e2.x = t.cx - t.rx, e2.y = t.cy - t.ry, e2.width = 2 * t.rx, e2.height = 2 * t.ry;
  249. else if ("image" === t.type || "rect" === t.type)
  250. e2.x = t.x, e2.y = t.y, e2.width = t.width, e2.height = t.height;
  251. else if ("path" === t.type) {
  252. const n4 = f(T(t));
  253. e2.x = n4.x, e2.y = n4.y, e2.width = n4.width, e2.height = n4.height;
  254. }
  255. return e2;
  256. }
  257. function V(t) {
  258. const e2 = { x: 0, y: 0, width: 0, height: 0 };
  259. let i3 = null, n4 = Number.NEGATIVE_INFINITY, r = Number.NEGATIVE_INFINITY;
  260. for (const o2 of t)
  261. i3 ? (i3.x = Math.min(i3.x, o2.x), i3.y = Math.min(i3.y, o2.y), n4 = Math.max(n4, o2.x + o2.width), r = Math.max(r, o2.y + o2.height)) : (i3 = e2, i3.x = o2.x, i3.y = o2.y, n4 = o2.x + o2.width, r = o2.y + o2.height);
  262. return i3 && (i3.width = n4 - i3.x, i3.height = r - i3.y), i3;
  263. }
  264. function C(t, e2, i3, o2, s4, a, l3, h2, f3) {
  265. let c4 = (l3 && a ? j(a, e2) : e2) / 2, d3 = (l3 && a ? j(a, i3) : i3) / 2;
  266. if (f3) {
  267. const t2 = f3[0], e3 = f3[1];
  268. c4 = (l3 && a ? j(a, t2) : t2) / 2, d3 = (l3 && a ? j(a, e3) : e3) / 2;
  269. }
  270. const u3 = t.width + o2, y3 = t.height + o2, p3 = n3(), g3 = n3();
  271. let m3 = false;
  272. if (s4 && 0 !== u3 && 0 !== y3) {
  273. const t2 = e2 !== i3 ? e2 / i3 : u3 / y3, n4 = e2 > i3 ? e2 : i3;
  274. let o3 = 1, s5 = 1;
  275. isNaN(n4) || (t2 > 1 ? (o3 = n4 / u3, s5 = n4 / t2 / y3) : (s5 = n4 / y3, o3 = n4 * t2 / u3)), o(g3, g3, z(p3, o3, s5, c4, d3)), m3 = true;
  276. }
  277. const x2 = t.x + (u3 - o2) / 2, w2 = t.y + (y3 - o2) / 2;
  278. if (o(g3, g3, I(p3, c4 - x2, d3 - w2)), !m3 && (u3 > e2 || y3 > i3)) {
  279. const t2 = u3 / e2 > y3 / i3, n4 = (t2 ? e2 : i3) / (t2 ? u3 : y3);
  280. o(g3, g3, z(p3, n4, n4, x2, w2));
  281. }
  282. return a && o(g3, g3, B(p3, a, x2, w2)), h2 && o(g3, g3, I(p3, h2[0], h2[1])), `matrix(${g3[0]},${g3[1]},${g3[2]},${g3[3]},${g3[4]},${g3[5]})`;
  283. }
  284. function D(t, e2, i3) {
  285. const n4 = t == null ? void 0 : t.effects.find((t2) => "bloom" === t2.type);
  286. if (!n4)
  287. return null;
  288. const { strength: r, radius: o2 } = n4, s4 = r > 0 ? o2 : 0, a = (r + s4) * e2, l3 = 4 * r + 1;
  289. return n("filter", { id: `bloom${i3}`, x: "-100%", y: "-100%", width: "300%", height: "300%", filterUnits: "userSpaceOnUse" }, n("feMorphology", { operator: "dilate", radius: (r + 0.5 * s4) * (5 ** (e2 / 100) * (0.4 + e2 / 100)), in: "SourceGraphic", result: "dilate" }), n("feGaussianBlur", { in: "dilate", stdDeviation: a / 25, result: "blur" }), n("feGaussianBlur", { in: "blur", stdDeviation: a / 50, result: "intensityBlur" }), n("feComponentTransfer", { in: "SourceGraphic", result: "intensityBrightness" }, n("feFuncR", { type: "linear", slope: l3 }), n("feFuncG", { type: "linear", slope: l3 }), n("feFuncB", { type: "linear", slope: l3 })), n("feMerge", null, n("feMergeNode", { in: "intensityBlur" }), n("feMergeNode", { in: "intensityBrightness" }), n("feGaussianBlur", { stdDeviation: r / 10 })));
  290. }
  291. function R(t, n4, r, o2 = {}) {
  292. var _a, _b, _c;
  293. const s4 = [], a = [], l3 = ++b, c4 = D(o2.effectView, n4, l3);
  294. let d3 = null;
  295. if (c4) {
  296. const t2 = (_a = o2.effectView) == null ? void 0 : _a.effects.find((t3) => "bloom" === t3.type), e2 = (t2.strength ? t2.strength + t2.radius / 2 : 0) / 3, i3 = n4 + n4 * e2, s5 = r + r * e2;
  297. d3 = [Math.max(i3, 10), Math.max(s5, 10)];
  298. }
  299. for (let e2 = 0; e2 < t.length; e2++) {
  300. const l4 = t[e2], f3 = [], c5 = [];
  301. let u3 = 0, y3 = 0, p3 = 0;
  302. for (const t2 of l4) {
  303. const { shape: e3, fill: i3, stroke: n5, font: r2, offset: a2 } = t2;
  304. o2.ignoreStrokeWidth || (u3 += n5 && n5.width || 0);
  305. const l5 = A(i3), h2 = S(n5), d4 = "text" === e3.type ? $(e3, r2) : null;
  306. s4.push(N(l5)), f3.push(M(e3, l5.fill, h2, d4)), c5.push(E(e3)), a2 && (y3 += a2[0], p3 += a2[1]);
  307. }
  308. const g3 = C(f(V(c5)), n4, r, u3, (_b = o2.scale) != null ? _b : false, o2.rotation, (_c = o2.useRotationSize) != null ? _c : false, [y3, p3], d3);
  309. let m3 = null;
  310. if (o2.masking) {
  311. const t2 = `mask-${e2}`, i3 = o2.masking[e2];
  312. s4.push(G(i3, t2)), m3 = `url(#${t2})`;
  313. }
  314. a.push(m3 ? n("g", { mask: m3 }, n("g", { transform: g3 }, f3)) : n("g", { transform: g3 }, f3));
  315. }
  316. o2.useRotationSize && o2.rotation && (n4 = j(o2.rotation, n4), r = j(o2.rotation, r)), c4 && (c(d3), n4 = d3[0], r = d3[1]);
  317. return n("svg", { xmlns: f2, width: n4, height: r, style: "display: block;" }, c4, n("defs", null, s4), c4 ? n("g", { filter: `url(#bloom${l3})` }, a) : a);
  318. }
  319. // node_modules/@arcgis/core/symbols/support/renderUtils.js
  320. var s3 = i();
  321. function h(t, e2, i3) {
  322. const r = Math.ceil(e2[0]), n4 = Math.ceil(e2[1]);
  323. if (!t.some((t2) => !!t2.length))
  324. return null;
  325. const o2 = i3 && i3.node || document.createElement("div");
  326. return null != i3.opacity && (o2.style.opacity = i3.opacity.toString()), null != i3.effectView && (o2.style.filter = q(i3.effectView)), s3.append(o2, R.bind(null, t, r, n4, i3)), o2;
  327. }
  328. function l2(t, e2) {
  329. t = Math.ceil(t), e2 = Math.ceil(e2);
  330. const i3 = document.createElement("canvas");
  331. i3.width = t, i3.height = e2, i3.style.width = t + "px", i3.style.height = e2 + "px";
  332. const r = i3.getContext("2d");
  333. return r.clearRect(0, 0, t, e2), r;
  334. }
  335. function m2(t, i3, r) {
  336. return t ? U(t, { responseType: "image" }).then((t2) => {
  337. const e2 = t2.data, n4 = e2.width, o2 = e2.height, a = n4 / o2;
  338. let c4 = i3;
  339. if (r) {
  340. const t3 = Math.max(n4, o2);
  341. c4 = Math.min(c4, t3);
  342. }
  343. return { image: e2, width: a <= 1 ? Math.ceil(c4 * a) : c4, height: a <= 1 ? c4 : Math.ceil(c4 / a) };
  344. }) : Promise.reject(new s("renderUtils: imageDataSize", "href not provided."));
  345. }
  346. function g2(t, e2) {
  347. return !(!t || "ignore" === e2) && ("multiply" !== e2 || 255 !== t.r || 255 !== t.g || 255 !== t.b || 1 !== t.a);
  348. }
  349. function u2(t, e2, n4, o2, a) {
  350. switch (a) {
  351. case "multiply":
  352. t[e2 + 0] *= n4[0], t[e2 + 1] *= n4[1], t[e2 + 2] *= n4[2], t[e2 + 3] *= n4[3];
  353. break;
  354. default: {
  355. const a2 = y({ r: t[e2 + 0], g: t[e2 + 1], b: t[e2 + 2] });
  356. a2.h = o2.h, a2.s = o2.s, a2.v = a2.v / 100 * o2.v;
  357. const c4 = p(a2);
  358. t[e2 + 0] = c4.r, t[e2 + 1] = c4.g, t[e2 + 2] = c4.b, t[e2 + 3] *= n4[3];
  359. break;
  360. }
  361. }
  362. }
  363. function d2(e2, r, n4, o2, a) {
  364. return m2(e2, r, a).then((a2) => {
  365. const c4 = a2.width ? a2.width : r, s4 = a2.height ? a2.height : r;
  366. if (a2.image && g2(n4, o2)) {
  367. let t = a2.image.width, r2 = a2.image.height;
  368. has("edge") && /\.svg$/i.test(e2) && (t -= 1, r2 -= 1);
  369. const h2 = l2(c4, s4);
  370. h2.drawImage(a2.image, 0, 0, t, r2, 0, 0, c4, s4);
  371. const m3 = h2.getImageData(0, 0, c4, s4), g3 = [n4.r / 255, n4.g / 255, n4.b / 255, n4.a], d3 = y(n4);
  372. for (let e3 = 0; e3 < m3.data.length; e3 += 4)
  373. u2(m3.data, e3, g3, d3, o2);
  374. h2.putImageData(m3, 0, 0), e2 = h2.canvas.toDataURL("image/png");
  375. } else {
  376. const i3 = s2 && s2.findCredential(e2);
  377. if (i3 && i3.token) {
  378. const t = e2.includes("?") ? "&" : "?";
  379. e2 = `${e2}${t}token=${i3.token}`;
  380. }
  381. }
  382. return { url: e2, width: c4, height: s4 };
  383. }).catch(() => ({ url: e2, width: r, height: r }));
  384. }
  385. export {
  386. h,
  387. d2 as d
  388. };
  389. //# sourceMappingURL=chunk-DX5KJRJR.js.map