chunk-XYIYXU3I.js 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500
  1. import {
  2. e as e2
  3. } from "./chunk-T6DJ6UAT.js";
  4. import {
  5. g,
  6. i as i2
  7. } from "./chunk-WOGDHLUJ.js";
  8. import {
  9. c as c2
  10. } from "./chunk-ZLQP3WDC.js";
  11. import {
  12. l
  13. } from "./chunk-AIG57VB7.js";
  14. import {
  15. t as t2
  16. } from "./chunk-67RFR4NT.js";
  17. import {
  18. re
  19. } from "./chunk-T2SKWJGU.js";
  20. import {
  21. q
  22. } from "./chunk-XO5VJRK4.js";
  23. import {
  24. o
  25. } from "./chunk-ST53DRNI.js";
  26. import {
  27. A,
  28. S
  29. } from "./chunk-EQNT4A7P.js";
  30. import {
  31. d,
  32. m as m2
  33. } from "./chunk-LXOC7SMQ.js";
  34. import {
  35. t as t3
  36. } from "./chunk-TU7WVKU4.js";
  37. import {
  38. c2 as c
  39. } from "./chunk-JAUFBT5U.js";
  40. import {
  41. m
  42. } from "./chunk-IEU3AM37.js";
  43. import {
  44. u
  45. } from "./chunk-2H5MD622.js";
  46. import {
  47. u as u2
  48. } from "./chunk-UVVU4UUO.js";
  49. import {
  50. v2 as v
  51. } from "./chunk-VCH45Q2I.js";
  52. import {
  53. R
  54. } from "./chunk-PQFTYGF5.js";
  55. import {
  56. s2 as s,
  57. s3 as s2
  58. } from "./chunk-E5O6P5I2.js";
  59. import {
  60. has
  61. } from "./chunk-SPWQ3AWG.js";
  62. import {
  63. e,
  64. i,
  65. r,
  66. t
  67. } from "./chunk-YXWMMD76.js";
  68. // node_modules/@arcgis/core/views/2d/engine/webgl/util/vvFlagUtils.js
  69. function e3(e4) {
  70. if (!e4)
  71. return A.NONE;
  72. let r3 = 0;
  73. for (const i3 of e4)
  74. if ("size" === i3.type) {
  75. const t4 = l(i3);
  76. r3 |= t4, "outline" === i3.target && (r3 |= t4 << 4);
  77. } else
  78. "color" === i3.type ? r3 |= A.COLOR : "opacity" === i3.type ? r3 |= A.OPACITY : "rotation" === i3.type && (r3 |= A.ROTATION);
  79. return r3;
  80. }
  81. // node_modules/@arcgis/core/views/2d/layers/graphics/graphicsUtils.js
  82. var c3 = 512;
  83. var g2 = 50;
  84. function p(e4, t4) {
  85. const n4 = R(t4);
  86. if (!n4)
  87. return null;
  88. const [i3, s3] = n4.valid;
  89. return e4[2] > s3 ? [u([e4[0], e4[1], s3, e4[3]]), u([i3, e4[1], i3 + e4[2] - s3, e4[3]])] : e4[0] < i3 ? [u([i3, e4[1], e4[2], e4[3]]), u([s3 - (i3 - e4[0]), e4[1], s3, e4[3]])] : null;
  90. }
  91. function u3(e4) {
  92. return "text" === e4 || "esriTS" === e4;
  93. }
  94. function h(e4) {
  95. return "simple-marker" === e4 || "picture-marker" === e4 || "esriSMS" === e4 || "esriPMS" === e4;
  96. }
  97. function y(e4) {
  98. switch (e(e4.geometry).type) {
  99. case "point":
  100. case "multipoint":
  101. return 0;
  102. case "polyline":
  103. return 1;
  104. case "polygon":
  105. case "extent":
  106. return 2;
  107. }
  108. return 0;
  109. }
  110. function d2(e4) {
  111. if (!e4)
  112. return null;
  113. const { xmin: t4, ymin: n4, xmax: r3, ymax: o2, spatialReference: s3 } = e4;
  114. return new v({ rings: [[[t4, n4], [t4, o2], [r3, o2], [r3, n4], [t4, n4]]], spatialReference: s3 });
  115. }
  116. // node_modules/@arcgis/core/views/2d/layers/features/support/pixelBuffering.js
  117. function m3(t4, e4) {
  118. if (!("visualVariables" in t4))
  119. return 0;
  120. if (!t4.hasVisualVariables("size"))
  121. return 0;
  122. const r3 = t4.getVisualVariablesForType("size");
  123. if (!r3[0])
  124. return 0;
  125. const i3 = r3[0];
  126. if (e4 && "cluster_count" === i3.field && "cluster" === e4.type)
  127. return e4.clusterMaxSize;
  128. if ("outline" === i3.target)
  129. return 0;
  130. if ("stops" === i3.transformationType)
  131. return i3.stops.map((t5) => t5.size).reduce(g3, 0);
  132. if ("clamped-linear" === i3.transformationType) {
  133. let t5 = -1 / 0, e5 = -1 / 0;
  134. return t5 = "number" == typeof i3.maxSize ? i3.maxSize : i3.maxSize.stops.map((t6) => t6.size).reduce(g3, 0), e5 = "number" == typeof i3.minSize ? i3.minSize : i3.minSize.stops.map((t6) => t6.size).reduce(g3, 0), Math.max(t5, e5);
  135. }
  136. return "real-world-size" === i3.transformationType ? 30 : void 0;
  137. }
  138. var y2 = { sdf: true, code: 99, metrics: q.metrics, rect: new t2(0, 0, 24, 24), page: 0, textureBinding: 2 };
  139. function g3(t4, e4) {
  140. return Math.max(t4, e4);
  141. }
  142. // node_modules/@arcgis/core/views/2d/layers/features/schemaUtils.js
  143. var T = s.getLogger("esri.views.2d.layers.features.schemaUtils");
  144. var S2 = "ValidationError";
  145. function E(e4) {
  146. return e4;
  147. }
  148. function w(e4, t4) {
  149. let i3 = 0, n4 = 0, s3 = S.DEFAULT;
  150. if (r(e4)) {
  151. if (n4 = m3(e4, t4), "visualVariables" in e4 && (i3 = e3(e4.visualVariables || []), "dot-density" === e4.type && (s3 = S.DOT_DENSITY)), "heatmap" === e4.type && (s3 = S.HEATMAP), "dictionary" === e4.type)
  152. return { maxVVSize: n4, vvFlags: i3, symbologyType: S.DEFAULT };
  153. if ("pie-chart" === e4.type)
  154. return { maxVVSize: n4, vvFlags: i3, symbologyType: S.PIE_CHART };
  155. if (s3 !== S.DOT_DENSITY && s3 !== S.HEATMAP) {
  156. const t5 = e4.getSymbols();
  157. "backgroundFillSymbol" in e4 && e4.backgroundFillSymbol && t5.push(e4.backgroundFillSymbol);
  158. let r3 = true, i4 = true;
  159. for (const e5 of t5)
  160. if ("cim" === e5.type && (i4 = false), "simple-fill" === e5.type || "picture-fill" === e5.type) {
  161. const t6 = e5.outline, n5 = t6 && "none" !== t6.style && "solid" !== t6.style, s4 = "simple-fill" === e5.type && "none" !== e5.style && "solid" !== e5.style, l2 = "picture-fill" === e5.type || s4 || n5;
  162. n5 && (r3 = false), l2 && (i4 = false);
  163. }
  164. r3 ? s3 = i4 ? S.OUTLINE_FILL_SIMPLE : S.OUTLINE_FILL : i4 && (s3 = S.SIMPLE);
  165. }
  166. }
  167. return { vvFlags: i3, maxVVSize: n4, symbologyType: s3 };
  168. }
  169. var I = null;
  170. function F(e4) {
  171. if (has("esri-2d-update-debug")) {
  172. const t4 = V(e4, true);
  173. console.debug("Created new schema", t4), console.debug("Schema diff", m(I, t4)), I = t4;
  174. }
  175. return V(e4);
  176. }
  177. function V(e4, t4 = false) {
  178. var _a, _b;
  179. try {
  180. const i3 = D(e4, t4), n4 = C(e4), s3 = {};
  181. i3.map((t5) => O(s3, e4, t5));
  182. const l2 = r(e4.subtypeCode) ? `${e4.subtypeField} = ${e4.subtypeCode}` : null, a = t3(e4.definitionExpression, l2);
  183. return { source: { definitionExpression: a, fields: e4.fields.map((e5) => e5.toJSON()), gdbVersion: e4.gdbVersion, historicMoment: (_a = e4.historicMoment) == null ? void 0 : _a.getTime(), outFields: e4.availableFields, pixelBuffer: e4.pixelBuffer, spatialReference: e4.spatialReference.toJSON(), timeExtent: (_b = e4.timeExtent) == null ? void 0 : _b.toJSON(), customParameters: e4.customParameters }, attributes: { fields: {}, indexCount: 0 }, processors: i3, tileRenderer: n4, targets: s3 };
  184. } catch (i3) {
  185. if (i3.fieldName === S2)
  186. return T.error(i3), null;
  187. throw i3;
  188. }
  189. }
  190. function O(t4, r3, i3) {
  191. switch (i3.target) {
  192. case "feature":
  193. return void M(t4, N(r3), i3);
  194. case "aggregate": {
  195. if (!("featureReduction" in r3))
  196. return;
  197. const n4 = r3.featureReduction;
  198. switch (n4.type) {
  199. case "selection":
  200. throw new s2(S2, "Mapview does not support `selection` reduction type", n4);
  201. case "binning":
  202. return M(t4, N(r3), i3), void L(t4, n4, r3.fields.map((e4) => e4.toJSON()), i3);
  203. case "cluster":
  204. return M(t4, N(r3), i3), void R2(t4, n4, r3.fields.map((e4) => e4.toJSON()), i3);
  205. }
  206. }
  207. }
  208. }
  209. function z(e4, t4) {
  210. for (const r3 in t4) {
  211. const i3 = t4[r3];
  212. if (i3.target !== e4.name)
  213. continue;
  214. const n4 = e4.attributes[r3];
  215. n4 ? (n4.context.mesh = n4.context.mesh || i3.context.mesh, n4.context.storage = n4.context.storage || i3.context.storage) : e4.attributes[r3] = i3;
  216. }
  217. return e4;
  218. }
  219. function N(e4) {
  220. var _a, _b, _c, _d, _e;
  221. return [(_b = (_a = e(e4.filter)) == null ? void 0 : _a.toJSON()) != null ? _b : null, (_e = (_d = e((_c = e(e4.featureEffect)) == null ? void 0 : _c.filter)) == null ? void 0 : _d.toJSON()) != null ? _e : null];
  222. }
  223. function M(e4, t4, r3) {
  224. return e4.feature || (e4.feature = { name: "feature", input: "source", filters: t4, attributes: {} }), z(e4.feature, r3.attributes.fields), e4;
  225. }
  226. function j3(t4, r3) {
  227. const { onStatisticExpression: i3, onStatisticField: n4, statisticType: s3 } = t4;
  228. switch (s3) {
  229. case "min":
  230. case "max":
  231. case "avg":
  232. case "avg_angle":
  233. case "sum":
  234. case "count":
  235. return "esriFieldTypeDouble";
  236. case "mode": {
  237. if (i3) {
  238. const { returnType: r4 } = i3;
  239. return r4 ? "string" === r4 ? "esriFieldTypeString" : "esriFieldTypeDouble" : (T.error(new s2(S2, "Unable to infer type of aggregateField with onStatisticExpression. ReturnType is not defined", t4)), "esriFieldTypeString");
  240. }
  241. const s4 = r3.find((e4) => e4.name === n4);
  242. return s4 ? s4.type : (T.error(new s2(S2, "Unable to infer type of aggregateField with onStatisticExpression. ReturnType is not defined", t4)), "esriFieldTypeString");
  243. }
  244. }
  245. }
  246. function L(e4, t4, r3, i3) {
  247. var _a;
  248. return e4.aggregate || (e4.aggregate = { name: "aggregate", type: "bin", filters: null, input: "feature", params: { fixedBinLevel: t4.fixedBinLevel, fields: ((_a = t4.fields) != null ? _a : []).map((e5) => ({ ...e5.toJSON(), type: j3(e5, r3) })) }, attributes: {} }), z(e4.aggregate, i3.attributes.fields), e4;
  249. }
  250. function R2(e4, t4, r3, i3) {
  251. var _a, _b;
  252. return e4.aggregate || (e4.aggregate = { name: "aggregate", type: "cluster", input: "feature", filters: null, attributes: {}, params: { clusterRadius: u2(t4.clusterRadius / 2), clusterPixelBuffer: 64 * Math.ceil(u2(t4.clusterMaxSize) / 64), fields: (_b = (_a = t4.fields) != null ? _a : []) == null ? void 0 : _b.map((e5) => ({ ...e5.toJSON(), type: j3(e5, r3) })) } }), z(e4.aggregate, i3.attributes.fields), e4;
  253. }
  254. function U(e4, t4) {
  255. return t4.field ? B(e4, { ...t4, type: "field", field: t4.field }) : t4.valueExpression ? B(e4, { ...t4, type: "expression", valueExpression: t4.valueExpression }) : { field: null, fieldIndex: null };
  256. }
  257. function B(e4, t4) {
  258. switch (t4.type) {
  259. case "expression": {
  260. const r3 = E(t4.valueExpression);
  261. if (!e4.fields[r3]) {
  262. const i3 = e4.indexCount++;
  263. e4.fields[r3] = { ...t4, name: r3, fieldIndex: i3 };
  264. }
  265. return { fieldIndex: e4.fields[r3].fieldIndex };
  266. }
  267. case "label-expression": {
  268. const r3 = E(JSON.stringify(t4.label));
  269. if (!e4.fields[r3]) {
  270. const i3 = e4.indexCount++;
  271. e4.fields[r3] = { ...t4, name: r3, fieldIndex: i3 };
  272. }
  273. return { fieldIndex: e4.fields[r3].fieldIndex };
  274. }
  275. case "field": {
  276. const r3 = t4.field;
  277. return "aggregate" === t4.target && e4.fields[r3] || (e4.fields[r3] = { ...t4, name: r3 }), { field: r3 };
  278. }
  279. case "statistic":
  280. return e4.fields[t4.name] = { ...t4 }, { field: t4.name };
  281. }
  282. }
  283. function D(e4, t4 = false) {
  284. const r3 = new Array();
  285. let i3 = 0;
  286. return r3.push(A2(e4, i3++, t4)), r3;
  287. }
  288. function P(e4, t4, r3, i3, n4, s3 = false) {
  289. const l2 = B(e4, { type: "label-expression", target: r3, context: { mesh: true }, resultType: "string", label: { labelExpression: t4.labelExpression, labelExpressionInfo: t4.labelExpressionInfo ? { expression: t4.labelExpressionInfo.expression } : null, symbol: !!t4.symbol, where: t4.where } }), { fieldIndex: o2 } = l2;
  290. return { ...o(t4, n4, s3), fieldIndex: o2, target: r3, index: i3 };
  291. }
  292. function k(t4, r3, i3) {
  293. var _a, _b;
  294. const n4 = "featureReduction" in r3 && r3.featureReduction;
  295. if (!n4)
  296. return { fields: [], labels: [], matcher: null, rendererOverride: null };
  297. const s3 = "aggregate", l2 = [];
  298. let o2 = null, a = e2(r3.geometryType), d3 = [], f2 = null;
  299. if (n4)
  300. switch (n4.type) {
  301. case "selection":
  302. return T.error(new s2(S2, "Mapview does not support `selection` reduction type", n4)), { fields: [], labels: [], matcher: null, rendererOverride: null };
  303. case "cluster":
  304. case "binning":
  305. if (l2.push(...(_a = n4.fields) != null ? _a : []), "cluster" === n4.type ? a = "esriGeometryPoint" : "binning" === n4.type && (a = "esriGeometryPolygon"), n4.renderer && !((_b = n4.renderer.authoringInfo) == null ? void 0 : _b.isAutoGenerated)) {
  306. if ("cluster" === n4.type) {
  307. const { renderer: e5 } = m2(n4.renderer, n4, null);
  308. f2 = e5;
  309. } else
  310. f2 = n4.renderer;
  311. const e4 = w(n4.renderer, n4);
  312. o2 = $(null, s3, n4.renderer, e4, i3), d3 = n4 && n4.labelsVisible && n4.labelingInfo || [];
  313. } else if ("cluster" === n4.type) {
  314. if (f2 = d(l2, r3.renderer, n4, null, true), n4.symbol) {
  315. const e4 = w(f2, n4);
  316. o2 = { type: "simple", symbol: o(n4.symbol, e4, i3), symbologyType: e4.symbologyType };
  317. }
  318. d3 = n4 && n4.labelsVisible && n4.labelingInfo || [];
  319. }
  320. }
  321. _(t4, l2);
  322. return { labels: c(d3, "binning" === n4.type ? "esriGeometryPolygon" : a), matcher: o2, fields: l2, rendererOverride: f2 };
  323. }
  324. function A2(t4, i3, n4 = false) {
  325. var _a;
  326. const s3 = { indexCount: 0, fields: {} }, l2 = "featureReduction" in t4 && t4.featureReduction, o2 = l2 ? "aggregate" : "feature";
  327. if ("sublayers" in t4) {
  328. const i4 = { type: "subtype", subtypeField: t4.subtypeField, renderers: {}, symbologyType: S.DEFAULT }, l3 = { type: "subtype", mapping: {}, target: "feature" }, a2 = { type: "subtype", classes: {} }, u4 = { type: "symbol", target: "feature", aggregateFields: [], attributes: s3, storage: l3, mesh: { matcher: i4, aggregateMatcher: null, labels: a2, sortKey: null } }, f3 = /* @__PURE__ */ new Set();
  329. let p3 = 0;
  330. for (const { renderer: c5, subtypeCode: y4, labelingInfo: m5, labelsVisible: g4 } of t4.sublayers) {
  331. const t5 = { symbologyType: S.DEFAULT, vvFlags: 0, maxVVSize: 0 }, u5 = $(s3, o2, c5, t5, n4), b2 = q2(s3, o2, c5), x3 = g4 && m5;
  332. if ("visualVariables" in c5 && c5.visualVariables && c5.visualVariables.length)
  333. throw new s2(S2, "Visual variables are currently not supported for subtype layers");
  334. if ("dictionary" === u5.type)
  335. throw new s2(S2, "Dictionary renderer is not supported in subtype layers");
  336. if ("subtype" === u5.type)
  337. throw new s2(S2, "Nested subtype renderers is not supported");
  338. if (r(b2) && "subtype" === b2.type)
  339. throw new s2(S2, "Nested subtype storage is not supported");
  340. if (r(b2) && r(b2.attributeMapping))
  341. throw new s2(S2, "Non-visual-variable attributes are not supported in subtype layers");
  342. if ("heatmap" === u5.type)
  343. throw new s2(S2, "Heatmaps are not supported in subtype layers");
  344. if ("pie-chart" === u5.type)
  345. throw new s2(S2, "Pie-charts are not supported in subtype layers");
  346. if (f3.has(y4))
  347. throw new s2(S2, "Subtype codes for sublayers must be unique");
  348. f3.add(y4), i4.renderers[y4] = u5, l3.mapping[y4] = b2, x3 && (a2.classes[y4] = x3.map((e4) => P(s3, e4, "feature", p3++, t5, n4)));
  349. }
  350. return u4;
  351. }
  352. if ("heatmap" === t4.renderer.type && "raster" === g()) {
  353. const { radius: e4, fieldOffset: r3, field: i4 } = t4.renderer;
  354. return { type: "heatmap", aggregateFields: [], attributes: s3, target: o2, storage: null, mesh: { radius: e4, fieldOffset: r3, field: U(s3, { target: o2, field: i4, resultType: "numeric" }).field } };
  355. }
  356. const a = k(s3, t4, n4), f2 = e2(t4.geometryType), p2 = (_a = a.rendererOverride) != null ? _a : t4.renderer, c4 = w(p2, l2), y3 = $(s3, o2, p2, c4, n4), m4 = q2(s3, o2, p2), b = J(s3, t4.orderBy, l2), x2 = t4.labelsVisible && t4.labelingInfo || [], h2 = c(x2, f2);
  357. let T2 = 0;
  358. const E2 = [...h2.map((e4) => P(s3, e4, "feature", T2++, c4, n4)), ...a.labels.map((e4) => P(s3, e4, "aggregate", T2++, c4, n4))];
  359. return { type: "symbol", target: o2, attributes: s3, aggregateFields: a.fields, storage: m4, mesh: { matcher: y3, labels: { type: "simple", classes: E2 }, aggregateMatcher: a.matcher, sortKey: b } };
  360. }
  361. function C(e4) {
  362. var _a;
  363. return "heatmap" === ((_a = e4.renderer) == null ? void 0 : _a.type) && "raster" === g() ? { type: "heatmap" } : { type: "symbol" };
  364. }
  365. function J(t4, i3, s3) {
  366. if (r(s3) || t(i3) || !i3.length)
  367. return null;
  368. i3.length > 1 && T.warn(`Layer rendering currently only supports ordering by 1 orderByInfo, but found ${i3.length}. All but the first will be discarded`);
  369. const l2 = i3[0], o2 = "ascending" === l2.order ? "asc" : "desc";
  370. if (l2.field)
  371. return { field: l2.field, order: o2 };
  372. if (l2.valueExpression) {
  373. return { fieldIndex: B(t4, { type: "expression", target: "feature", valueExpression: l2.valueExpression, resultType: "numeric" }).fieldIndex, order: o2 };
  374. }
  375. return T.error(new s2(S2, "Expected to find a field or valueExpression for OrderByInfo", l2)), null;
  376. }
  377. function _(e4, t4) {
  378. const r3 = { mesh: true, storage: true };
  379. for (const i3 of t4) {
  380. const { name: t5, onStatisticField: n4, onStatisticExpression: s3, statisticType: l2 } = i3;
  381. let o2 = null, a = null;
  382. const u4 = "numeric", d3 = "feature";
  383. if (s3) {
  384. a = B(e4, { type: "expression", target: d3, valueExpression: s3.expression, resultType: u4 }).fieldIndex;
  385. } else {
  386. o2 = B(e4, { type: "field", target: d3, field: n4, resultType: u4 }).field;
  387. }
  388. B(e4, { type: "statistic", target: "aggregate", name: t5, context: r3, inField: o2, inFieldIndex: a, statisticType: l2 });
  389. }
  390. }
  391. function q2(e4, t4, r3) {
  392. let i3;
  393. switch (r3.type) {
  394. case "simple":
  395. case "class-breaks":
  396. case "unique-value":
  397. case "dictionary":
  398. i3 = { visualVariables: true, attributes: null };
  399. break;
  400. default:
  401. i3 = c2(r3).getStorageSpec(r3);
  402. }
  403. return G(e4, t4, i3, r3);
  404. }
  405. function G(e4, t4, i3, s3) {
  406. if (t(i3))
  407. return null;
  408. const { visualVariables: l2, attributes: o2 } = i3;
  409. let a = null;
  410. l2 && "visualVariables" in s3 && (a = H(e4, t4, s3.visualVariables));
  411. const u4 = r(a) ? 4 : 0;
  412. let d3 = null;
  413. return r(o2) && (d3 = o2.map((r3, i4) => {
  414. const { field: n4, fieldIndex: s4 } = U(e4, { valueExpression: r3.valueExpression, field: r3.field, resultType: "numeric", target: t4 });
  415. return { binding: i4 + u4, field: n4, fieldIndex: s4 };
  416. })), { type: "simple", target: t4, attributeMapping: d3, vvMapping: a };
  417. }
  418. function H(e4, t4, r3) {
  419. if (!r3 || !r3.length)
  420. return [];
  421. const i3 = { storage: true }, n4 = "numeric";
  422. return i2(r3).map((r4) => {
  423. var _a;
  424. const s3 = re(r4.type), { field: l2, fieldIndex: o2 } = U(e4, { target: t4, valueExpression: r4.valueExpression, field: r4.field, context: i3, resultType: n4 });
  425. switch (r4.type) {
  426. case "size":
  427. return "$view.scale" === r4.valueExpression ? null : { type: "size", binding: s3, field: l2, fieldIndex: o2, normalizationField: U(e4, { target: t4, field: r4.normalizationField, context: i3, resultType: n4 }).field, valueRepresentation: (_a = r4.valueRepresentation) != null ? _a : null };
  428. case "color":
  429. return { type: "color", binding: s3, field: l2, fieldIndex: o2, normalizationField: U(e4, { target: t4, field: r4.normalizationField, context: i3, resultType: n4 }).field };
  430. case "opacity":
  431. return { type: "opacity", binding: s3, field: l2, fieldIndex: o2, normalizationField: U(e4, { target: t4, field: r4.normalizationField, context: i3, resultType: n4 }).field };
  432. case "rotation":
  433. return { type: "rotation", binding: s3, field: l2, fieldIndex: o2 };
  434. }
  435. }).filter((e5) => e5);
  436. }
  437. function $(e4, t4, r3, i3, n4 = false) {
  438. const l2 = i(e4, { indexCount: 0, fields: {} });
  439. switch (r3.type) {
  440. case "simple":
  441. case "dot-density":
  442. return K(l2, r3, i3, n4);
  443. case "class-breaks":
  444. return Q(l2, t4, r3, i3, n4);
  445. case "unique-value":
  446. return W(l2, t4, r3, i3, n4);
  447. case "dictionary":
  448. return X(l2, r3, i3, n4);
  449. case "heatmap":
  450. return Z(l2, r3, i3, n4);
  451. case "pie-chart":
  452. return Y(l2, r3, i3, n4);
  453. }
  454. }
  455. function K(e4, t4, r3, i3 = false) {
  456. const n4 = t4.getSymbols(), s3 = n4.length ? n4[0] : null;
  457. return { type: "simple", symbol: o(s3, r3, i3), symbologyType: r3.symbologyType };
  458. }
  459. function Y(e4, t4, r3, i3 = false) {
  460. const n4 = t4.getSymbols(), s3 = n4[0], l2 = n4.length > 1 ? n4[1] : null;
  461. return { type: "pie-chart", markerSymbol: o(s3, r3, i3), fillSymbol: o(l2, r3, i3), symbologyType: r3.symbologyType };
  462. }
  463. function Q(e4, t4, r3, i3, n4 = false) {
  464. const s3 = { mesh: true, use: "renderer.field" }, l2 = r3.backgroundFillSymbol, { field: o2, fieldIndex: a } = U(e4, { target: t4, field: r3.field, valueExpression: r3.valueExpression, resultType: "numeric", context: s3 }), u4 = r3.normalizationType, d3 = "log" === u4 ? "esriNormalizeByLog" : "percent-of-total" === u4 ? "esriNormalizeByPercentOfTotal" : "field" === u4 ? "esriNormalizeByField" : null, f2 = r3.classBreakInfos.map((e5) => ({ symbol: o(e5.symbol, i3, n4), min: e5.minValue, max: e5.maxValue })).sort((e5, t5) => e5.min - t5.min);
  465. return { type: "interval", attributes: e4.fields, field: o2, fieldIndex: a, backgroundFillSymbol: o(l2, i3, n4), defaultSymbol: o(r3.defaultSymbol, i3, n4), intervals: f2, normalizationField: r3.normalizationField, normalizationTotal: r3.normalizationTotal, normalizationType: d3, isMaxInclusive: r3.isMaxInclusive, symbologyType: i3.symbologyType };
  466. }
  467. function W(t4, r3, i3, n4, s3 = false) {
  468. const l2 = [], o2 = i3.backgroundFillSymbol, a = { target: r3, context: { mesh: true }, resultType: "string" };
  469. if (i3.field && "string" != typeof i3.field)
  470. throw new s2(S2, "Expected renderer.field to be a string", i3);
  471. const { field: u4, fieldIndex: d3 } = U(t4, { ...a, field: i3.field, valueExpression: i3.valueExpression });
  472. for (const e4 of i3.uniqueValueInfos)
  473. l2.push({ value: "" + e4.value, symbol: o(e4.symbol, n4, s3) });
  474. return { type: "map", attributes: t4.fields, field: u4, fieldIndex: d3, field2: U(t4, { ...a, field: i3.field2 }).field, field3: U(t4, { ...a, field: i3.field3 }).field, fieldDelimiter: i3.fieldDelimiter, backgroundFillSymbol: o(o2, n4), defaultSymbol: o(i3.defaultSymbol, n4), map: l2, symbologyType: n4.symbologyType };
  475. }
  476. function X(e4, t4, r3, i3 = false) {
  477. return { type: "dictionary", config: t4.config, fieldMap: t4.fieldMap, scaleExpression: t4.scaleExpression, url: t4.url, symbolOptions: r3, symbologyType: r3.symbologyType };
  478. }
  479. function Z(e4, t4, r3, i3 = false) {
  480. const n4 = t4.getSymbols(), s3 = n4.length ? n4[0] : null;
  481. return { type: "heatmap", symbol: o(s3, r3, i3), symbologyType: r3.symbologyType };
  482. }
  483. export {
  484. c3 as c,
  485. g2 as g,
  486. p,
  487. u3 as u,
  488. h,
  489. y,
  490. d2 as d,
  491. w,
  492. F,
  493. $
  494. };
  495. //# sourceMappingURL=chunk-XYIYXU3I.js.map