chunk-3FNKD2EB.js 43 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877
  1. import {
  2. c as c3,
  3. j as j2,
  4. j2 as j3
  5. } from "./chunk-ZOO4I2U4.js";
  6. import {
  7. a as a3
  8. } from "./chunk-JPUFJK2B.js";
  9. import {
  10. p
  11. } from "./chunk-HZ2WKB3G.js";
  12. import {
  13. m as m4
  14. } from "./chunk-RVCE264D.js";
  15. import {
  16. c as c2
  17. } from "./chunk-HKJ7X3BD.js";
  18. import {
  19. M,
  20. S,
  21. f,
  22. g,
  23. h2 as h,
  24. j2 as j
  25. } from "./chunk-3Z755LKF.js";
  26. import {
  27. m as m3
  28. } from "./chunk-IEU3AM37.js";
  29. import {
  30. i as i2
  31. } from "./chunk-JOYXMSKE.js";
  32. import {
  33. a as a2
  34. } from "./chunk-MCWCB5IY.js";
  35. import {
  36. l as l2
  37. } from "./chunk-TJV6ODRM.js";
  38. import {
  39. c,
  40. m as m2
  41. } from "./chunk-4ONPMX2F.js";
  42. import {
  43. S as S2,
  44. w
  45. } from "./chunk-CRGY2SDS.js";
  46. import {
  47. i as i3
  48. } from "./chunk-4T5ZGMEN.js";
  49. import {
  50. r as r3
  51. } from "./chunk-5N7JLUJJ.js";
  52. import {
  53. n as n3,
  54. r as r4
  55. } from "./chunk-P3XKUGLS.js";
  56. import {
  57. j as j4
  58. } from "./chunk-LU5IJZB4.js";
  59. import {
  60. s as s4
  61. } from "./chunk-HZRKBTHJ.js";
  62. import {
  63. o
  64. } from "./chunk-6T6G6LCQ.js";
  65. import {
  66. s as s5
  67. } from "./chunk-YEJL5NEF.js";
  68. import {
  69. r as r2
  70. } from "./chunk-PQFTYGF5.js";
  71. import {
  72. e,
  73. l3 as l,
  74. m,
  75. n5 as n2,
  76. s5 as s3,
  77. t5 as t2,
  78. y3 as y2
  79. } from "./chunk-2Z2TG5CU.js";
  80. import {
  81. T,
  82. a,
  83. b,
  84. u
  85. } from "./chunk-SQOPWYIT.js";
  86. import {
  87. s2 as s,
  88. s3 as s2
  89. } from "./chunk-E5O6P5I2.js";
  90. import {
  91. n,
  92. y
  93. } from "./chunk-SPWQ3AWG.js";
  94. import {
  95. e as e2,
  96. i,
  97. r,
  98. t
  99. } from "./chunk-YXWMMD76.js";
  100. // node_modules/@arcgis/core/renderers/Renderer.js
  101. var n4 = new s4({ simple: "simple", uniqueValue: "unique-value", classBreaks: "class-breaks", heatmap: "heatmap", dotDensity: "dot-density", dictionary: "dictionary", pieChart: "pie-chart" }, { ignoreUnknown: true });
  102. var a4 = class extends l {
  103. constructor(r5) {
  104. super(r5), this.authoringInfo = null, this.type = null;
  105. }
  106. async getRequiredFields(r5) {
  107. if (!this.collectRequiredFields)
  108. return [];
  109. const e4 = /* @__PURE__ */ new Set();
  110. return await this.collectRequiredFields(e4, r5), Array.from(e4).sort();
  111. }
  112. getSymbol(r5, e4) {
  113. }
  114. async getSymbolAsync(r5, e4) {
  115. }
  116. getSymbols() {
  117. return [];
  118. }
  119. getAttributeHash() {
  120. return JSON.stringify(this);
  121. }
  122. getMeshHash() {
  123. return JSON.stringify(this);
  124. }
  125. };
  126. e([y2({ type: j2, json: { write: true } })], a4.prototype, "authoringInfo", void 0), e([y2({ type: n4.apiValues, readOnly: true, json: { type: n4.jsonValues, read: false, write: { writer: n4.write, ignoreOrigin: true } } })], a4.prototype, "type", void 0), a4 = e([n2("esri.renderers.Renderer")], a4);
  127. var p2 = a4;
  128. // node_modules/@arcgis/core/renderers/support/randomRotationExpression.js
  129. function e3(e4) {
  130. var _a, _b, _c;
  131. return (_c = (_b = (_a = e4.match(t3)) == null ? void 0 : _a[1]) == null ? void 0 : _b.replace(/\\'/g, "'")) != null ? _c : null;
  132. }
  133. var t3 = /^hash\(\$feature\['((\\'|[^'])+)'\]\) \* 8\.381e-8$/;
  134. // node_modules/@arcgis/core/renderers/visualVariables/ColorVariable.js
  135. var i4;
  136. var p3 = i4 = class extends c3 {
  137. constructor(t4) {
  138. super(t4), this.type = "color", this.normalizationField = null;
  139. }
  140. get cache() {
  141. return { ipData: this._interpolateData(), hasExpression: !!this.valueExpression, compiledFunc: null };
  142. }
  143. set stops(t4) {
  144. t4 && Array.isArray(t4) && (t4 = t4.filter((t5) => !!t5)).sort((t5, s6) => t5.value - s6.value), this._set("stops", t4);
  145. }
  146. clone() {
  147. return new i4({ field: this.field, normalizationField: this.normalizationField, valueExpression: this.valueExpression, valueExpressionTitle: this.valueExpressionTitle, stops: this.stops && this.stops.map((t4) => t4.clone()), legendOptions: this.legendOptions && this.legendOptions.clone() });
  148. }
  149. getAttributeHash() {
  150. return `${super.getAttributeHash()}-${this.normalizationField}`;
  151. }
  152. _interpolateData() {
  153. return this.stops && this.stops.map((t4) => t4.value || 0);
  154. }
  155. };
  156. e([y2({ readOnly: true })], p3.prototype, "cache", null), e([y2({ type: ["color"], json: { type: ["colorInfo"] } })], p3.prototype, "type", void 0), e([y2({ type: String, json: { write: true } })], p3.prototype, "normalizationField", void 0), e([y2({ type: [a3], json: { write: true } })], p3.prototype, "stops", null), p3 = i4 = e([n2("esri.renderers.visualVariables.ColorVariable")], p3);
  157. var a5 = p3;
  158. // node_modules/@arcgis/core/renderers/visualVariables/support/OpacityStop.js
  159. var l3;
  160. var u2 = l3 = class extends l {
  161. constructor(r5) {
  162. super(r5), this.label = null, this.opacity = null, this.value = null;
  163. }
  164. readOpacity(r5, t4) {
  165. return r4(t4.transparency);
  166. }
  167. writeOpacity(r5, t4, o2) {
  168. t4[o2] = n3(r5);
  169. }
  170. clone() {
  171. return new l3({ label: this.label, opacity: this.opacity, value: this.value });
  172. }
  173. };
  174. e([y2({ type: String, json: { write: true } })], u2.prototype, "label", void 0), e([y2({ type: Number, json: { type: T, write: { target: "transparency" } } })], u2.prototype, "opacity", void 0), e([o("opacity", ["transparency"])], u2.prototype, "readOpacity", null), e([r2("opacity")], u2.prototype, "writeOpacity", null), e([y2({ type: Number, json: { write: true } })], u2.prototype, "value", void 0), u2 = l3 = e([n2("esri.renderers.visualVariables.support.OpacityStop")], u2);
  175. var y3 = u2;
  176. // node_modules/@arcgis/core/renderers/visualVariables/OpacityVariable.js
  177. var i5;
  178. var p4 = i5 = class extends c3 {
  179. constructor(t4) {
  180. super(t4), this.type = "opacity", this.normalizationField = null;
  181. }
  182. get cache() {
  183. return { ipData: this._interpolateData(), hasExpression: !!this.valueExpression, compiledFunc: null };
  184. }
  185. set stops(t4) {
  186. t4 && Array.isArray(t4) && (t4 = t4.filter((t5) => !!t5)).sort((t5, s6) => t5.value - s6.value), this._set("stops", t4);
  187. }
  188. clone() {
  189. return new i5({ field: this.field, normalizationField: this.normalizationField, valueExpression: this.valueExpression, valueExpressionTitle: this.valueExpressionTitle, stops: this.stops && this.stops.map((t4) => t4.clone()), legendOptions: this.legendOptions && this.legendOptions.clone() });
  190. }
  191. getAttributeHash() {
  192. return `${super.getAttributeHash()}-${this.normalizationField}`;
  193. }
  194. _interpolateData() {
  195. return this.stops && this.stops.map((t4) => t4.value || 0);
  196. }
  197. };
  198. e([y2({ readOnly: true })], p4.prototype, "cache", null), e([y2({ type: ["opacity"], json: { type: ["transparencyInfo"] } })], p4.prototype, "type", void 0), e([y2({ type: String, json: { write: true } })], p4.prototype, "normalizationField", void 0), e([y2({ type: [y3], json: { write: true } })], p4.prototype, "stops", null), p4 = i5 = e([n2("esri.renderers.visualVariables.OpacityVariable")], p4);
  199. var a6 = p4;
  200. // node_modules/@arcgis/core/renderers/visualVariables/RotationVariable.js
  201. var p5;
  202. var a7 = p5 = class extends c3 {
  203. constructor(e4) {
  204. super(e4), this.axis = null, this.type = "rotation", this.rotationType = "geographic", this.valueExpressionTitle = null;
  205. }
  206. get cache() {
  207. return { hasExpression: !!this.valueExpression, compiledFunc: null };
  208. }
  209. writeValueExpressionTitleWebScene(e4, s6, o2, r5) {
  210. if (r5 && r5.messages) {
  211. const e5 = `visualVariables[${this.index}]`;
  212. r5.messages.push(new s2("property:unsupported", this.type + "VisualVariable.valueExpressionTitle is not supported in Web Scene. Please remove this property to save the Web Scene.", { instance: this, propertyName: e5 + ".valueExpressionTitle", context: r5 }));
  213. }
  214. }
  215. clone() {
  216. return new p5({ axis: this.axis, rotationType: this.rotationType, field: this.field, valueExpression: this.valueExpression, valueExpressionTitle: this.valueExpressionTitle, legendOptions: this.legendOptions && this.legendOptions.clone() });
  217. }
  218. };
  219. e([y2({ readOnly: true })], a7.prototype, "cache", null), e([y2({ type: ["heading", "tilt", "roll"], json: { origins: { "web-scene": { default: "heading", write: true } } } })], a7.prototype, "axis", void 0), e([y2({ type: ["rotation"], json: { type: ["rotationInfo"] } })], a7.prototype, "type", void 0), e([y2({ type: ["geographic", "arithmetic"], json: { write: true, origins: { "web-document": { write: true, default: "geographic" } } } })], a7.prototype, "rotationType", void 0), e([y2({ type: String, json: { write: true } })], a7.prototype, "valueExpressionTitle", void 0), e([r2("web-scene", "valueExpressionTitle")], a7.prototype, "writeValueExpressionTitleWebScene", null), a7 = p5 = e([n2("esri.renderers.visualVariables.RotationVariable")], a7);
  220. var n5 = a7;
  221. // node_modules/@arcgis/core/renderers/visualVariables/VisualVariableFactory.js
  222. var u3 = { color: a5, size: j3, opacity: a6, rotation: n5 };
  223. var b2 = new s4({ colorInfo: "color", transparencyInfo: "opacity", rotationInfo: "rotation", sizeInfo: "size" });
  224. var h2 = /^\[([^\]]+)\]$/i;
  225. var V = class extends m {
  226. constructor() {
  227. super(...arguments), this.colorVariables = null, this.opacityVariables = null, this.rotationVariables = null, this.sizeVariables = null;
  228. }
  229. set visualVariables(r5) {
  230. if (this._resetVariables(), (r5 = r5 && r5.filter((r6) => !!r6)) && r5.length) {
  231. for (const s6 of r5)
  232. switch (s6.type) {
  233. case "color":
  234. this.colorVariables.push(s6);
  235. break;
  236. case "opacity":
  237. this.opacityVariables.push(s6);
  238. break;
  239. case "rotation":
  240. this.rotationVariables.push(s6);
  241. break;
  242. case "size":
  243. this.sizeVariables.push(s6);
  244. }
  245. if (this.sizeVariables.length) {
  246. this.sizeVariables.some((r6) => !!r6.target) && r5.sort((r6, s6) => {
  247. let e4 = null;
  248. return e4 = r6.target === s6.target ? 0 : r6.target ? 1 : -1, e4;
  249. });
  250. }
  251. for (let s6 = 0; s6 < r5.length; s6++) {
  252. r5[s6].index = s6;
  253. }
  254. this._set("visualVariables", r5);
  255. } else
  256. this._set("visualVariables", r5);
  257. }
  258. readVariables(r5, s6, e4) {
  259. const { rotationExpression: a9, rotationType: i8 } = s6, l7 = a9 && a9.match(h2), n8 = l7 && l7[1];
  260. if (n8 && (r5 || (r5 = []), r5.push({ type: "rotationInfo", rotationType: i8, field: n8 })), r5)
  261. return r5.map((r6) => {
  262. const s7 = b2.read(r6.type), a10 = u3[s7];
  263. a10 || (s.getLogger(this.declaredClass).warn(`Unknown variable type: ${s7}`), e4 && e4.messages && e4.messages.push(new t2("visual-variable:unsupported", `visualVariable of type '${s7}' is not supported`, { definition: r6, context: e4 })));
  264. const i9 = new a10();
  265. return i9.read(r6, e4), i9;
  266. });
  267. }
  268. writeVariables(r5, s6) {
  269. const e4 = [];
  270. for (const o2 of r5) {
  271. const r6 = o2.toJSON(s6);
  272. r6 && e4.push(r6);
  273. }
  274. return e4;
  275. }
  276. _resetVariables() {
  277. this.colorVariables = [], this.opacityVariables = [], this.rotationVariables = [], this.sizeVariables = [];
  278. }
  279. };
  280. e([y2()], V.prototype, "visualVariables", null), V = e([n2("esri.renderers.visualVariables.VisualVariableFactory")], V);
  281. var f2 = V;
  282. // node_modules/@arcgis/core/renderers/mixins/VisualVariablesMixin.js
  283. var v = { base: c3, key: "type", typeMap: { opacity: a6, color: a5, rotation: n5, size: j3 } };
  284. var y4 = (a9) => {
  285. let u6 = class extends a9 {
  286. constructor() {
  287. super(...arguments), this._vvFactory = new f2();
  288. }
  289. set visualVariables(r5) {
  290. this._vvFactory.visualVariables = r5, this._set("visualVariables", this._vvFactory.visualVariables);
  291. }
  292. readVisualVariables(r5, a10, s6) {
  293. return this._vvFactory.readVariables(r5, a10, s6);
  294. }
  295. writeVisualVariables(r5, a10, s6, i8) {
  296. a10[s6] = this._vvFactory.writeVariables(r5, i8);
  297. }
  298. get arcadeRequiredForVisualVariables() {
  299. if (!this.visualVariables)
  300. return false;
  301. for (const r5 of this.visualVariables)
  302. if (r5.arcadeRequired)
  303. return true;
  304. return false;
  305. }
  306. hasVisualVariables(r5, a10) {
  307. return r5 ? this.getVisualVariablesForType(r5, a10).length > 0 : this.getVisualVariablesForType("size", a10).length > 0 || this.getVisualVariablesForType("color", a10).length > 0 || this.getVisualVariablesForType("opacity", a10).length > 0 || this.getVisualVariablesForType("rotation", a10).length > 0;
  308. }
  309. getVisualVariablesForType(r5, a10) {
  310. const s6 = this.visualVariables;
  311. return s6 ? s6.filter((s7) => s7.type === r5 && ("string" == typeof a10 ? s7.target === a10 : false !== a10 || !s7.target)) : [];
  312. }
  313. async collectVVRequiredFields(r5, a10) {
  314. let s6 = [];
  315. this.visualVariables && (s6 = s6.concat(this.visualVariables));
  316. for (const i8 of s6)
  317. i8 && (i8.field && w(r5, a10, i8.field), i8.normalizationField && w(r5, a10, i8.normalizationField), i8.valueExpression && (f3(i8.valueExpression, r5, a10) || await S2(r5, a10, i8.valueExpression)));
  318. }
  319. };
  320. return e([y2({ types: [v], value: null, json: { write: true } })], u6.prototype, "visualVariables", null), e([o("visualVariables", ["visualVariables", "rotationType", "rotationExpression"])], u6.prototype, "readVisualVariables", null), e([r2("visualVariables")], u6.prototype, "writeVisualVariables", null), u6 = e([n2("esri.renderers.mixins.VisualVariablesMixin")], u6), u6;
  321. };
  322. function f3(r5, s6, i8) {
  323. const e4 = e3(r5);
  324. return !!r(e4) && (w(s6, i8, e4), true);
  325. }
  326. // node_modules/@arcgis/core/renderers/support/commonProperties.js
  327. var l4 = { types: M, json: { write: { writer: m4 }, origins: { "web-scene": { types: h, write: { writer: m4 }, read: { reader: s3({ types: h }) } } } } };
  328. var y5 = { types: { base: a2, key: "type", typeMap: { "simple-fill": j.typeMap["simple-fill"], "picture-fill": j.typeMap["picture-fill"], "polygon-3d": j.typeMap["polygon-3d"] } }, json: { write: { writer: m4 }, origins: { "web-scene": { type: S, write: { writer: m4 } } } } };
  329. var m5 = { cast: (e4) => null == e4 || "string" == typeof e4 || "number" == typeof e4 ? e4 : `${e4}`, json: { type: String, write: { writer: (e4, r5) => {
  330. r5.value = e4 == null ? void 0 : e4.toString();
  331. } } } };
  332. // node_modules/@arcgis/core/renderers/support/ClassBreakInfo.js
  333. var i6;
  334. var l5 = i6 = class extends l {
  335. constructor(s6) {
  336. super(s6), this.description = null, this.label = null, this.minValue = null, this.maxValue = 0, this.symbol = null;
  337. }
  338. clone() {
  339. return new i6({ description: this.description, label: this.label, minValue: this.minValue, maxValue: this.maxValue, symbol: this.symbol ? this.symbol.clone() : null });
  340. }
  341. getMeshHash() {
  342. const s6 = JSON.stringify(this.symbol);
  343. return `${this.minValue}.${this.maxValue}.${s6}`;
  344. }
  345. };
  346. e([y2({ type: String, json: { write: true } })], l5.prototype, "description", void 0), e([y2({ type: String, json: { write: true } })], l5.prototype, "label", void 0), e([y2({ type: Number, json: { read: { source: "classMinValue" }, write: { target: "classMinValue" } } })], l5.prototype, "minValue", void 0), e([y2({ type: Number, json: { read: { source: "classMaxValue" }, write: { target: "classMaxValue" } } })], l5.prototype, "maxValue", void 0), e([y2(l4)], l5.prototype, "symbol", void 0), l5 = i6 = e([n2("esri.renderers.support.ClassBreakInfo")], l5);
  347. var a8 = l5;
  348. // node_modules/@arcgis/core/renderers/ClassBreaksRenderer.js
  349. var V2;
  350. var E = "log";
  351. var j5 = "percent-of-total";
  352. var z = "field";
  353. var w2 = new s4({ esriNormalizeByLog: E, esriNormalizeByPercentOfTotal: j5, esriNormalizeByField: z });
  354. var T2 = b(a8);
  355. var C = V2 = class extends y4(p2) {
  356. constructor(e4) {
  357. super(e4), this._compiledValueExpression = { valueExpression: null, compiledFunction: null }, this.backgroundFillSymbol = null, this.classBreakInfos = null, this.defaultLabel = null, this.defaultSymbol = null, this.field = null, this.isMaxInclusive = true, this.legendOptions = null, this.normalizationField = null, this.normalizationTotal = null, this.type = "class-breaks", this.valueExpression = null, this.valueExpressionTitle = null, this._set("classBreakInfos", []);
  358. }
  359. readClassBreakInfos(e4, s6, t4) {
  360. if (!Array.isArray(e4))
  361. return;
  362. let o2 = s6.minValue;
  363. return e4.map((e5) => {
  364. const s7 = new a8();
  365. return s7.read(e5, t4), null == s7.minValue && (s7.minValue = o2), null == s7.maxValue && (s7.maxValue = s7.minValue), o2 = s7.maxValue, s7;
  366. });
  367. }
  368. writeClassBreakInfos(e4, s6, t4, o2) {
  369. const i8 = e4.map((e5) => e5.write({}, o2));
  370. this._areClassBreaksConsecutive() && i8.forEach((e5) => delete e5.classMinValue), s6[t4] = i8;
  371. }
  372. castField(e4) {
  373. return null == e4 ? e4 : "function" == typeof e4 ? (s.getLogger(this.declaredClass).error(".field: field must be a string value"), null) : u(e4);
  374. }
  375. get minValue() {
  376. return this.classBreakInfos && this.classBreakInfos[0] && this.classBreakInfos[0].minValue || 0;
  377. }
  378. get normalizationType() {
  379. let e4 = this._get("normalizationType");
  380. const s6 = !!this.normalizationField, t4 = null != this.normalizationTotal;
  381. return s6 || t4 ? (e4 = s6 && z || t4 && j5 || null, s6 && t4 && s.getLogger(this.declaredClass).warn("warning: both normalizationField and normalizationTotal are set!")) : e4 !== z && e4 !== j5 || (e4 = null), e4;
  382. }
  383. set normalizationType(e4) {
  384. this._set("normalizationType", e4);
  385. }
  386. addClassBreakInfo(e4, t4, i8) {
  387. let r5 = null;
  388. r5 = "number" == typeof e4 ? new a8({ minValue: e4, maxValue: t4, symbol: g(i8) }) : T2(y(e4)), this.classBreakInfos.push(r5), 1 === this.classBreakInfos.length && this.notifyChange("minValue");
  389. }
  390. removeClassBreakInfo(e4, s6) {
  391. const t4 = this.classBreakInfos.length;
  392. for (let o2 = 0; o2 < t4; o2++) {
  393. const t5 = [this.classBreakInfos[o2].minValue, this.classBreakInfos[o2].maxValue];
  394. if (t5[0] === e4 && t5[1] === s6) {
  395. this.classBreakInfos.splice(o2, 1);
  396. break;
  397. }
  398. }
  399. }
  400. getBreakIndex(e4, s6) {
  401. return this.valueExpression && (t(s6) || t(s6.arcade)) && s.getLogger(this.declaredClass).warn(""), this.valueExpression ? this._getBreakIndexForExpression(e4, s6) : this._getBreakIndexForField(e4);
  402. }
  403. async getClassBreakInfo(e4, s6) {
  404. let t4 = s6;
  405. this.valueExpression && (t(s6) || t(s6.arcade)) && (t4 = { ...t4, arcade: await i3() });
  406. const o2 = this.getBreakIndex(e4, t4);
  407. return -1 !== o2 ? this.classBreakInfos[o2] : null;
  408. }
  409. getSymbol(e4, s6) {
  410. if (this.valueExpression && (t(s6) || t(s6.arcade)))
  411. return void s.getLogger(this.declaredClass).error("#getSymbol()", "Please use getSymbolAsync if valueExpression is used");
  412. const t4 = this.getBreakIndex(e4, s6);
  413. return t4 > -1 ? this.classBreakInfos[t4].symbol : this.defaultSymbol;
  414. }
  415. async getSymbolAsync(e4, s6) {
  416. let t4 = s6;
  417. if (this.valueExpression && (t(s6) || t(s6.arcade))) {
  418. const e5 = await i3(), { arcadeUtils: s7 } = e5;
  419. s7.hasGeometryOperations(this.valueExpression) && await s7.enableGeometryOperations(), t4 = { ...t4, arcade: e5 };
  420. }
  421. const o2 = this.getBreakIndex(e4, t4);
  422. return o2 > -1 ? this.classBreakInfos[o2].symbol : this.defaultSymbol;
  423. }
  424. getSymbols() {
  425. const e4 = [];
  426. return this.classBreakInfos.forEach((s6) => {
  427. s6.symbol && e4.push(s6.symbol);
  428. }), this.defaultSymbol && e4.push(this.defaultSymbol), e4;
  429. }
  430. getAttributeHash() {
  431. return this.visualVariables && this.visualVariables.reduce((e4, s6) => e4 + s6.getAttributeHash(), "");
  432. }
  433. getMeshHash() {
  434. const e4 = JSON.stringify(this.backgroundFillSymbol), s6 = JSON.stringify(this.defaultSymbol), t4 = `${this.normalizationField}.${this.normalizationType}.${this.normalizationTotal}`;
  435. return `${e4}.${s6}.${this.classBreakInfos.reduce((e5, s7) => e5 + s7.getMeshHash(), "")}.${t4}.${this.field}.${this.valueExpression}`;
  436. }
  437. get arcadeRequired() {
  438. return this.arcadeRequiredForVisualVariables || !!this.valueExpression;
  439. }
  440. clone() {
  441. return new V2({ field: this.field, backgroundFillSymbol: this.backgroundFillSymbol && this.backgroundFillSymbol.clone(), defaultLabel: this.defaultLabel, defaultSymbol: this.defaultSymbol && this.defaultSymbol.clone(), valueExpression: this.valueExpression, valueExpressionTitle: this.valueExpressionTitle, classBreakInfos: y(this.classBreakInfos), isMaxInclusive: this.isMaxInclusive, normalizationField: this.normalizationField, normalizationTotal: this.normalizationTotal, normalizationType: this.normalizationType, visualVariables: y(this.visualVariables), legendOptions: y(this.legendOptions), authoringInfo: this.authoringInfo && this.authoringInfo.clone() });
  442. }
  443. async collectRequiredFields(e4, s6) {
  444. const t4 = [this.collectVVRequiredFields(e4, s6), this.collectSymbolFields(e4, s6)];
  445. await Promise.all(t4);
  446. }
  447. async collectSymbolFields(e4, s6) {
  448. const t4 = [...this.getSymbols().map((t5) => t5.collectRequiredFields(e4, s6)), S2(e4, s6, this.valueExpression)];
  449. w(e4, s6, this.field), w(e4, s6, this.normalizationField), await Promise.all(t4);
  450. }
  451. _getBreakIndexForExpression(e4, s6) {
  452. const { viewingMode: t4, scale: o2, spatialReference: i8, arcade: r5 } = i(s6, {}), { valueExpression: n8 } = this;
  453. let u6 = this._compiledValueExpression.valueExpression === n8 ? this._compiledValueExpression.compiledFunction : null;
  454. const c6 = e2(r5).arcadeUtils;
  455. if (!u6) {
  456. const e5 = c6.createSyntaxTree(n8);
  457. u6 = c6.createFunction(e5), this._compiledValueExpression.compiledFunction = u6;
  458. }
  459. this._compiledValueExpression.valueExpression = n8;
  460. const p7 = c6.executeFunction(u6, c6.createExecContext(e4, c6.getViewInfo({ viewingMode: t4, scale: o2, spatialReference: i8 })));
  461. return this._getBreakIndexfromInfos(p7);
  462. }
  463. _getBreakIndexForField(e4) {
  464. const s6 = this.field, t4 = e4.attributes, o2 = this.normalizationType;
  465. let i8 = parseFloat(t4[s6]);
  466. if (o2) {
  467. const e5 = this.normalizationTotal, s7 = parseFloat(this.normalizationField ? t4[this.normalizationField] : void 0);
  468. if (o2 === E)
  469. i8 = Math.log(i8) * Math.LOG10E;
  470. else if (o2 !== j5 || null == e5 || isNaN(e5)) {
  471. if (o2 === z && !isNaN(s7)) {
  472. if (isNaN(i8) || isNaN(s7))
  473. return -1;
  474. i8 /= s7;
  475. }
  476. } else
  477. i8 = i8 / e5 * 100;
  478. }
  479. return this._getBreakIndexfromInfos(i8);
  480. }
  481. _getBreakIndexfromInfos(e4) {
  482. const s6 = this.isMaxInclusive;
  483. if (null != e4 && "number" == typeof e4 && !isNaN(e4))
  484. for (let t4 = 0; t4 < this.classBreakInfos.length; t4++) {
  485. const o2 = [this.classBreakInfos[t4].minValue, this.classBreakInfos[t4].maxValue];
  486. if (o2[0] <= e4 && (s6 ? e4 <= o2[1] : e4 < o2[1]))
  487. return t4;
  488. }
  489. return -1;
  490. }
  491. _areClassBreaksConsecutive() {
  492. const e4 = this.classBreakInfos, s6 = e4.length;
  493. for (let t4 = 1; t4 < s6; t4++)
  494. if (e4[t4 - 1].maxValue !== e4[t4].minValue)
  495. return false;
  496. return true;
  497. }
  498. };
  499. e([y2(y5)], C.prototype, "backgroundFillSymbol", void 0), e([y2({ type: [a8] })], C.prototype, "classBreakInfos", void 0), e([o("classBreakInfos")], C.prototype, "readClassBreakInfos", null), e([r2("classBreakInfos")], C.prototype, "writeClassBreakInfos", null), e([y2({ type: String, json: { write: true } })], C.prototype, "defaultLabel", void 0), e([y2(l4)], C.prototype, "defaultSymbol", void 0), e([y2({ type: String, json: { write: true } })], C.prototype, "field", void 0), e([s5("field")], C.prototype, "castField", null), e([y2({ type: Boolean })], C.prototype, "isMaxInclusive", void 0), e([y2({ type: p, json: { write: true } })], C.prototype, "legendOptions", void 0), e([y2({ type: Number, readOnly: true, value: null, json: { read: false, write: { overridePolicy() {
  500. return 0 !== this.classBreakInfos.length && this._areClassBreaksConsecutive() ? { enabled: true } : { enabled: false };
  501. } } } })], C.prototype, "minValue", null), e([y2({ type: String, json: { write: true } })], C.prototype, "normalizationField", void 0), e([y2({ type: Number, cast: (e4) => a(e4), json: { write: true } })], C.prototype, "normalizationTotal", void 0), e([y2({ type: w2.apiValues, value: null, json: { type: w2.jsonValues, read: w2.read, write: w2.write } })], C.prototype, "normalizationType", null), e([r3({ classBreaks: "class-breaks" })], C.prototype, "type", void 0), e([y2({ type: String, json: { write: true } })], C.prototype, "valueExpression", void 0), e([y2({ type: String, json: { write: true } })], C.prototype, "valueExpressionTitle", void 0), C = V2 = e([n2("esri.renderers.ClassBreaksRenderer")], C);
  502. var _ = C;
  503. // node_modules/@arcgis/core/renderers/support/UniqueValue.js
  504. var u4 = class extends i2(l) {
  505. constructor(o2) {
  506. super(o2), this.value = null, this.value2 = null, this.value3 = null;
  507. }
  508. };
  509. e([y2(m5)], u4.prototype, "value", void 0), e([y2(m5)], u4.prototype, "value2", void 0), e([y2(m5)], u4.prototype, "value3", void 0), u4 = e([n2("esri.renderers.support.UniqueValue")], u4);
  510. var c4 = u4;
  511. // node_modules/@arcgis/core/renderers/support/UniqueValueClass.js
  512. var n6 = class extends i2(l) {
  513. constructor(r5) {
  514. super(r5), this.description = null, this.label = null, this.symbol = null, this.values = null;
  515. }
  516. castValues(r5) {
  517. if (null == r5)
  518. return null;
  519. const o2 = typeof (r5 = Array.isArray(r5) ? r5 : [r5])[0];
  520. return "string" === o2 || "number" === o2 ? r5.map((r6) => new c4({ value: r6 })) : "object" === o2 ? r5[0] instanceof c4 ? r5 : r5.map((r6) => new c4(r6)) : null;
  521. }
  522. };
  523. e([y2({ type: String, json: { write: true } })], n6.prototype, "description", void 0), e([y2({ type: String, json: { write: true } })], n6.prototype, "label", void 0), e([y2(l4)], n6.prototype, "symbol", void 0), e([y2({ type: [c4], json: { type: [[String]], read: { reader: (r5) => r5 ? r5.map((r6) => new c4({ value: r6[0], value2: r6[1], value3: r6[2] })) : null }, write: { writer: (r5, o2) => {
  524. const e4 = [];
  525. for (const s6 of r5) {
  526. const r6 = [s6.value, s6.value2, s6.value3].filter(r).map((r7) => r7.toString());
  527. e4.push(r6);
  528. }
  529. o2.values = e4;
  530. } } } })], n6.prototype, "values", void 0), e([s5("values")], n6.prototype, "castValues", null), n6 = e([n2("esri.renderers.support.UniqueValueClass")], n6);
  531. var u5 = n6;
  532. // node_modules/@arcgis/core/renderers/support/UniqueValueGroup.js
  533. var c5 = class extends i2(l) {
  534. constructor(r5) {
  535. super(r5), this.heading = null, this.classes = null;
  536. }
  537. };
  538. e([y2({ type: String, json: { write: true } })], c5.prototype, "heading", void 0), e([y2({ type: [u5], json: { write: true } })], c5.prototype, "classes", void 0), c5 = e([n2("esri.renderers.support.UniqueValueGroup")], c5);
  539. var i7 = c5;
  540. // node_modules/@arcgis/core/renderers/support/UniqueValueInfo.js
  541. var l6;
  542. var p6 = l6 = class extends l {
  543. constructor(o2) {
  544. super(o2), this.description = null, this.label = null, this.symbol = null, this.value = null;
  545. }
  546. clone() {
  547. return new l6({ value: this.value, description: this.description, label: this.label, symbol: this.symbol ? this.symbol.clone() : null });
  548. }
  549. getMeshHash() {
  550. const o2 = JSON.stringify(this.symbol && this.symbol.toJSON());
  551. return `${this.value}.${o2}`;
  552. }
  553. };
  554. e([y2({ type: String, json: { write: true } })], p6.prototype, "description", void 0), e([y2({ type: String, json: { write: true } })], p6.prototype, "label", void 0), e([y2(l4)], p6.prototype, "symbol", void 0), e([y2(m5)], p6.prototype, "value", void 0), p6 = l6 = e([n2("esri.renderers.support.UniqueValueInfo")], p6);
  555. var n7 = p6;
  556. // node_modules/@arcgis/core/renderers/UniqueValueRenderer.js
  557. var R;
  558. var P = "esri.renderers.UniqueValueRenderer";
  559. var $ = s.getLogger(P);
  560. var z2 = "uvInfos-watcher";
  561. var k = "uvGroups-watcher";
  562. var A = ",";
  563. var H = b(n7);
  564. function L(e4) {
  565. const { field1: t4, field2: s6, field3: i8, fieldDelimiter: o2, uniqueValueInfos: l7, valueExpression: r5 } = e4, u6 = !(!t4 || !s6);
  566. return [{ classes: (l7 != null ? l7 : []).map((e5) => {
  567. var _a;
  568. const { symbol: l8, label: n8, value: a9, description: p7 } = e5, [f4, d, c6] = u6 ? ((_a = a9 == null ? void 0 : a9.toString()) == null ? void 0 : _a.split(o2 || "")) || [] : [a9], h3 = [];
  569. return (t4 || r5) && h3.push(f4), s6 && h3.push(d), i8 && h3.push(c6), { symbol: l8, label: n8, values: [h3], description: p7 };
  570. }) }];
  571. }
  572. var T3 = R = class extends y4(p2) {
  573. constructor(e4) {
  574. super(e4), this._valueInfoMap = {}, this._isDefaultSymbolDerived = false, this._isInfosSource = null, this.type = "unique-value", this.backgroundFillSymbol = null, this.valueExpressionTitle = null, this.legendOptions = null, this.defaultLabel = null, this.portal = null, this.styleOrigin = null, this.diff = { uniqueValueInfos(e5, t4) {
  575. if (!e5 && !t4)
  576. return;
  577. if (!e5 || !t4)
  578. return { type: "complete", oldValue: e5, newValue: t4 };
  579. let s6 = false;
  580. const i8 = { type: "collection", added: [], removed: [], changed: [], unchanged: [] };
  581. for (let o2 = 0; o2 < t4.length; o2++) {
  582. const l7 = e5.find((e6) => e6.value === t4[o2].value);
  583. l7 ? m3(l7, t4[o2]) ? (i8.changed.push({ type: "complete", oldValue: l7, newValue: t4[o2] }), s6 = true) : i8.unchanged.push({ oldValue: l7, newValue: t4[o2] }) : (i8.added.push(t4[o2]), s6 = true);
  584. }
  585. for (let o2 = 0; o2 < e5.length; o2++) {
  586. t4.find((t5) => t5.value === e5[o2].value) || (i8.removed.push(e5[o2]), s6 = true);
  587. }
  588. return s6 ? i8 : void 0;
  589. } }, this._set("uniqueValueInfos", []), this._set("uniqueValueGroups", []);
  590. }
  591. get _cache() {
  592. return { compiledFunc: null };
  593. }
  594. set field(e4) {
  595. this._set("field", e4), this._updateFieldDelimiter(), this._updateUniqueValues();
  596. }
  597. castField(e4) {
  598. return null == e4 || "function" == typeof e4 ? e4 : u(e4);
  599. }
  600. writeField(e4, t4, i8, o2) {
  601. "string" == typeof e4 ? t4[i8] = e4 : o2 && o2.messages ? o2.messages.push(new s2("property:unsupported", "UniqueValueRenderer.field set to a function cannot be written to JSON")) : $.error(".field: cannot write field to JSON since it's not a string value");
  602. }
  603. set field2(e4) {
  604. this._set("field2", e4), this._updateFieldDelimiter(), this._updateUniqueValues();
  605. }
  606. set field3(e4) {
  607. this._set("field3", e4), this._updateUniqueValues();
  608. }
  609. set valueExpression(e4) {
  610. this._set("valueExpression", e4), this._updateUniqueValues();
  611. }
  612. set defaultSymbol(e4) {
  613. this._isDefaultSymbolDerived = false, this._set("defaultSymbol", e4);
  614. }
  615. set fieldDelimiter(e4) {
  616. this._set("fieldDelimiter", e4), this._updateUniqueValues();
  617. }
  618. readPortal(e4, t4, s6) {
  619. return s6.portal || j4.getDefault();
  620. }
  621. readStyleOrigin(e4, t4, s6) {
  622. if (t4.styleName)
  623. return Object.freeze({ styleName: t4.styleName });
  624. if (t4.styleUrl) {
  625. const e5 = c(t4.styleUrl, s6);
  626. return Object.freeze({ styleUrl: e5 });
  627. }
  628. }
  629. writeStyleOrigin(e4, t4, s6, i8) {
  630. e4.styleName ? t4.styleName = e4.styleName : e4.styleUrl && (t4.styleUrl = m2(e4.styleUrl, i8));
  631. }
  632. set uniqueValueGroups(e4) {
  633. this.styleOrigin ? $.error("#uniqueValueGroups=", "Cannot modify unique value groups of a UniqueValueRenderer created from a web style") : (this._set("uniqueValueGroups", e4), this._updateInfosFromGroups(), this._isInfosSource = false, this._watchUniqueValueGroups());
  634. }
  635. set uniqueValueInfos(e4) {
  636. this.styleOrigin ? $.error("#uniqueValueInfos=", "Cannot modify unique value infos of a UniqueValueRenderer created from a web style") : (this._set("uniqueValueInfos", e4), this._updateValueInfoMap(), this._updateGroupsFromInfos(), this._isInfosSource = true, this._watchUniqueValueInfos());
  637. }
  638. addUniqueValueInfo(e4, s6) {
  639. var _a;
  640. if (this.styleOrigin)
  641. return void $.error("#addUniqueValueInfo()", "Cannot modify unique value infos of a UniqueValueRenderer created from a web style");
  642. let i8;
  643. i8 = "object" == typeof e4 ? H(e4) : new n7({ value: e4, symbol: g(s6) }), (_a = this.uniqueValueInfos) == null ? void 0 : _a.push(i8), this._valueInfoMap[i8.value] = i8, this._updateGroupsFromInfos(), this._isInfosSource = true, this._watchUniqueValueInfos();
  644. }
  645. removeUniqueValueInfo(e4) {
  646. if (this.styleOrigin)
  647. return void $.error("#removeUniqueValueInfo()", "Cannot modify unique value infos of a UniqueValueRenderer created from a web style");
  648. const t4 = this.uniqueValueInfos;
  649. if (t4)
  650. for (let s6 = 0; s6 < t4.length; s6++) {
  651. if (t4[s6].value === e4 + "") {
  652. delete this._valueInfoMap[e4], t4.splice(s6, 1);
  653. break;
  654. }
  655. }
  656. this._updateGroupsFromInfos(), this._isInfosSource = true, this._watchUniqueValueInfos();
  657. }
  658. async getUniqueValueInfo(e4, t4) {
  659. let s6 = t4;
  660. return this.valueExpression && (t(t4) || t(t4.arcade)) && (s6 = { ...s6, arcade: await i3() }), this._getUniqueValueInfo(e4, s6);
  661. }
  662. getSymbol(e4, t4) {
  663. if (this.valueExpression && (t(t4) || t(t4.arcade)))
  664. return void $.error("#getSymbol()", "Please use getSymbolAsync if valueExpression is used");
  665. const s6 = this._getUniqueValueInfo(e4, t4);
  666. return s6 && s6.symbol || this.defaultSymbol;
  667. }
  668. async getSymbolAsync(e4, t4) {
  669. let s6 = t4;
  670. if (this.valueExpression && (t(s6) || t(s6.arcade))) {
  671. const e5 = await i3(), { arcadeUtils: t5 } = e5;
  672. t5.hasGeometryOperations(this.valueExpression) && await t5.enableGeometryOperations(), s6 = { ...s6, arcade: e5 };
  673. }
  674. const i8 = this._getUniqueValueInfo(e4, s6);
  675. return i8 && i8.symbol || this.defaultSymbol;
  676. }
  677. getSymbols() {
  678. var _a;
  679. const e4 = [];
  680. for (const t4 of (_a = this.uniqueValueInfos) != null ? _a : [])
  681. t4.symbol && e4.push(t4.symbol);
  682. return this.defaultSymbol && e4.push(this.defaultSymbol), e4;
  683. }
  684. getAttributeHash() {
  685. return this.visualVariables && this.visualVariables.reduce((e4, t4) => e4 + t4.getAttributeHash(), "");
  686. }
  687. getMeshHash() {
  688. var _a;
  689. const e4 = JSON.stringify(this.backgroundFillSymbol), t4 = JSON.stringify(this.defaultSymbol), s6 = (_a = this.uniqueValueInfos) == null ? void 0 : _a.reduce((e5, t5) => e5 + t5.getMeshHash(), "");
  690. return `${e4}.${t4}.${s6}.${`${this.field}.${this.field2}.${this.field3}.${this.fieldDelimiter}`}.${this.valueExpression}`;
  691. }
  692. clone() {
  693. const e4 = new R({ field: this.field, field2: this.field2, field3: this.field3, defaultLabel: this.defaultLabel, defaultSymbol: y(this.defaultSymbol), valueExpression: this.valueExpression, valueExpressionTitle: this.valueExpressionTitle, fieldDelimiter: this.fieldDelimiter, visualVariables: y(this.visualVariables), legendOptions: y(this.legendOptions), authoringInfo: this.authoringInfo && this.authoringInfo.clone(), backgroundFillSymbol: y(this.backgroundFillSymbol) });
  694. this._isDefaultSymbolDerived && (e4._isDefaultSymbolDerived = true), e4._set("portal", this.portal);
  695. const t4 = y(this.uniqueValueInfos), s6 = y(this.uniqueValueGroups);
  696. return this.styleOrigin && (e4._set("styleOrigin", Object.freeze(y(this.styleOrigin))), Object.freeze(t4), Object.freeze(s6)), e4._set("uniqueValueInfos", t4), e4._updateValueInfoMap(), e4._set("uniqueValueGroups", s6), e4._isInfosSource = this._isInfosSource, e4._watchUniqueValueInfosAndGroups(), e4;
  697. }
  698. get arcadeRequired() {
  699. return this.arcadeRequiredForVisualVariables || !!this.valueExpression;
  700. }
  701. async collectRequiredFields(e4, t4) {
  702. const s6 = [this.collectVVRequiredFields(e4, t4), this.collectSymbolFields(e4, t4)];
  703. await Promise.all(s6);
  704. }
  705. async collectSymbolFields(e4, t4) {
  706. const s6 = [...this.getSymbols().map((s7) => s7.collectRequiredFields(e4, t4)), S2(e4, t4, this.valueExpression)];
  707. w(e4, t4, this.field), w(e4, t4, this.field2), w(e4, t4, this.field3), await Promise.all(s6);
  708. }
  709. populateFromStyle() {
  710. return c2(this.styleOrigin, { portal: this.portal }).then((e4) => {
  711. var _a;
  712. const t4 = [];
  713. return this._valueInfoMap = {}, e4 && e4.data && Array.isArray(e4.data.items) && e4.data.items.forEach((s6) => {
  714. const i8 = new f({ styleUrl: e4.styleUrl, styleName: e4.styleName, portal: this.portal, name: s6.name });
  715. this.defaultSymbol || s6.name !== e4.data.defaultItem || (this.defaultSymbol = i8, this._isDefaultSymbolDerived = true);
  716. const o2 = new n7({ value: s6.name, symbol: i8 });
  717. t4.push(o2), this._valueInfoMap[s6.name] = o2;
  718. }), this._set("uniqueValueInfos", Object.freeze(t4)), this._updateGroupsFromInfos(true), this._isInfosSource = null, this._watchUniqueValueInfos(), !this.defaultSymbol && ((_a = this.uniqueValueInfos) == null ? void 0 : _a.length) && (this.defaultSymbol = this.uniqueValueInfos[0].symbol, this._isDefaultSymbolDerived = true), this;
  719. });
  720. }
  721. _updateFieldDelimiter() {
  722. this.field && this.field2 && !this.fieldDelimiter && this._set("fieldDelimiter", A);
  723. }
  724. _updateUniqueValues() {
  725. null != this._isInfosSource && (this._isInfosSource ? this._updateGroupsFromInfos() : this._updateInfosFromGroups());
  726. }
  727. _updateValueInfoMap() {
  728. this._valueInfoMap = {};
  729. const { uniqueValueInfos: e4 } = this;
  730. if (e4)
  731. for (const t4 of e4)
  732. this._valueInfoMap[t4.value + ""] = t4;
  733. }
  734. _watchUniqueValueInfosAndGroups() {
  735. this._watchUniqueValueInfos(), this._watchUniqueValueGroups();
  736. }
  737. _watchUniqueValueInfos() {
  738. this.removeHandles(z2);
  739. const { uniqueValueInfos: e4 } = this;
  740. if (e4) {
  741. const t4 = [];
  742. for (const s6 of e4)
  743. t4.push(l2(() => ({ symbol: s6.symbol, value: s6.value, label: s6.label, description: s6.description }), (e5, t5) => {
  744. e5 !== t5 && (this._updateGroupsFromInfos(), this._isInfosSource = true);
  745. }, { sync: true }));
  746. this.addHandles(t4, z2);
  747. }
  748. }
  749. _watchUniqueValueGroups() {
  750. this.removeHandles(k);
  751. const { uniqueValueGroups: e4 } = this;
  752. if (e4) {
  753. const t4 = [];
  754. for (const s6 of e4) {
  755. t4.push(l2(() => ({ classes: s6.classes }), (e5, t5) => {
  756. e5 !== t5 && (this._updateInfosFromGroups(), this._isInfosSource = false);
  757. }, { sync: true }));
  758. for (const e5 of s6.classes)
  759. t4.push(l2(() => ({ symbol: e5.symbol, values: e5.values, label: e5.label, description: e5.description }), (e6, t5) => {
  760. e6 !== t5 && (this._updateInfosFromGroups(), this._isInfosSource = false);
  761. }, { sync: true }));
  762. }
  763. this.addHandles(t4, k);
  764. }
  765. }
  766. _updateInfosFromGroups() {
  767. var _a;
  768. if (!this.uniqueValueGroups)
  769. return this._set("uniqueValueInfos", null), this._updateValueInfoMap(), void this._watchUniqueValueInfos();
  770. const e4 = [], { field: t4, field2: s6, field3: i8, fieldDelimiter: o2, uniqueValueGroups: l7, valueExpression: r5 } = this;
  771. if (!t4 && !r5)
  772. return this._set("uniqueValueInfos", e4), this._updateValueInfoMap(), void this._watchUniqueValueInfos();
  773. const u6 = !(!t4 || !s6);
  774. for (const n8 of l7)
  775. for (const t5 of (_a = n8.classes) != null ? _a : []) {
  776. const { symbol: l8, label: r6, values: n9, description: a9 } = t5;
  777. for (const t6 of n9 != null ? n9 : []) {
  778. const { value: n10, value2: p7, value3: f4 } = t6, d = [n10];
  779. s6 && d.push(p7), i8 && d.push(f4);
  780. const c6 = u6 ? d.join(o2 || "") : d[0];
  781. e4.push(new n7({ symbol: l8, label: r6, value: c6, description: a9 }));
  782. }
  783. }
  784. this._set("uniqueValueInfos", e4), this._updateValueInfoMap(), this._watchUniqueValueInfos();
  785. }
  786. _updateGroupsFromInfos(e4 = false) {
  787. if (!this.uniqueValueInfos)
  788. return this._set("uniqueValueGroups", null), void this._watchUniqueValueGroups();
  789. const { field: t4, field2: s6, valueExpression: i8, fieldDelimiter: o2, uniqueValueInfos: l7 } = this;
  790. if (!t4 && !i8 || !l7.length)
  791. return this._set("uniqueValueGroups", []), void this._watchUniqueValueGroups();
  792. const r5 = !(!t4 || !s6), u6 = l7.map((e5) => {
  793. var _a;
  794. const { symbol: t5, label: s7, value: i9, description: l8 } = e5, [u7, n9, a9] = r5 ? ((_a = i9 == null ? void 0 : i9.toString()) == null ? void 0 : _a.split(o2 || "")) || [] : [i9];
  795. return new u5({ symbol: t5, label: s7, description: l8, values: [new c4({ value: u7, value2: n9, value3: a9 })] });
  796. }), n8 = [new i7({ classes: u6 })];
  797. e4 && Object.freeze(n8), this._set("uniqueValueGroups", n8), this._watchUniqueValueGroups();
  798. }
  799. _getUniqueValueInfo(e4, t4) {
  800. return this.valueExpression ? this._getUnqiueValueInfoForExpression(e4, t4) : this._getUnqiueValueInfoForFields(e4);
  801. }
  802. _getUnqiueValueInfoForExpression(e4, t4) {
  803. const { viewingMode: s6, scale: i8, spatialReference: o2, arcade: l7 } = i(t4, {});
  804. let n8 = this._cache.compiledFunc;
  805. const a9 = e2(l7).arcadeUtils;
  806. if (!n8) {
  807. const e5 = a9.createSyntaxTree(this.valueExpression);
  808. n8 = a9.createFunction(e5), this._cache.compiledFunc = n8;
  809. }
  810. const p7 = a9.executeFunction(n8, a9.createExecContext(e4, a9.getViewInfo({ viewingMode: s6, scale: i8, spatialReference: o2 })));
  811. return this._valueInfoMap[p7 + ""];
  812. }
  813. _getUnqiueValueInfoForFields(e4) {
  814. const t4 = this.field, s6 = e4.attributes;
  815. let i8;
  816. if ("function" != typeof t4 && this.field2) {
  817. const e5 = this.field2, o2 = this.field3, l7 = [];
  818. t4 && l7.push(s6[t4]), e5 && l7.push(s6[e5]), o2 && l7.push(s6[o2]), i8 = l7.join(this.fieldDelimiter || "");
  819. } else
  820. "function" == typeof t4 ? i8 = t4(e4) : t4 && (i8 = s6[t4]);
  821. return this._valueInfoMap[i8 + ""];
  822. }
  823. static fromPortalStyle(e4, t4) {
  824. const s6 = new R(t4 && t4.properties);
  825. s6._set("styleOrigin", Object.freeze({ styleName: e4 })), s6._set("portal", t4 && t4.portal || j4.getDefault());
  826. const i8 = s6.populateFromStyle();
  827. return i8.catch((t5) => {
  828. $.error(`#fromPortalStyle('${e4}'[, ...])`, "Failed to create unique value renderer from style name", t5);
  829. }), i8;
  830. }
  831. static fromStyleUrl(e4, t4) {
  832. const s6 = new R(t4 && t4.properties);
  833. s6._set("styleOrigin", Object.freeze({ styleUrl: e4 }));
  834. const i8 = s6.populateFromStyle();
  835. return i8.catch((t5) => {
  836. $.error(`#fromStyleUrl('${e4}'[, ...])`, "Failed to create unique value renderer from style URL", t5);
  837. }), i8;
  838. }
  839. };
  840. e([y2({ readOnly: true })], T3.prototype, "_cache", null), e([r3({ uniqueValue: "unique-value" })], T3.prototype, "type", void 0), e([y2(y5)], T3.prototype, "backgroundFillSymbol", void 0), e([y2({ value: null, json: { type: String, read: { source: "field1" }, write: { target: "field1" } } })], T3.prototype, "field", null), e([s5("field")], T3.prototype, "castField", null), e([r2("field")], T3.prototype, "writeField", null), e([y2({ type: String, value: null, json: { write: true } })], T3.prototype, "field2", null), e([y2({ type: String, value: null, json: { write: true } })], T3.prototype, "field3", null), e([y2({ type: String, value: null, json: { write: true } })], T3.prototype, "valueExpression", null), e([y2({ type: String, json: { write: true } })], T3.prototype, "valueExpressionTitle", void 0), e([y2({ type: p, json: { write: true } })], T3.prototype, "legendOptions", void 0), e([y2({ type: String, json: { write: true } })], T3.prototype, "defaultLabel", void 0), e([y2(n({ ...l4 }, { json: { write: { overridePolicy() {
  841. return { enabled: !this._isDefaultSymbolDerived };
  842. } }, origins: { "web-scene": { write: { overridePolicy() {
  843. return { enabled: !this._isDefaultSymbolDerived };
  844. } } } } } }))], T3.prototype, "defaultSymbol", null), e([y2({ type: String, value: null, json: { write: true } })], T3.prototype, "fieldDelimiter", null), e([y2({ type: j4, readOnly: true })], T3.prototype, "portal", void 0), e([o("portal", ["styleName"])], T3.prototype, "readPortal", null), e([y2({ readOnly: true, json: { write: { enabled: false, overridePolicy: () => ({ enabled: true }) } } })], T3.prototype, "styleOrigin", void 0), e([o("styleOrigin", ["styleName", "styleUrl"])], T3.prototype, "readStyleOrigin", null), e([r2("styleOrigin", { styleName: { type: String }, styleUrl: { type: String } })], T3.prototype, "writeStyleOrigin", null), e([y2({ type: [i7], json: { read: { source: ["uniqueValueGroups", "uniqueValueInfos"], reader: (e4, t4, s6) => (t4.uniqueValueGroups || L(t4)).map((e5) => i7.fromJSON(e5, s6)) }, write: { overridePolicy() {
  845. return this.styleOrigin ? { enabled: false } : { enabled: true };
  846. } } } })], T3.prototype, "uniqueValueGroups", null), e([y2({ type: [n7], json: { read: false, write: { overridePolicy() {
  847. return this.styleOrigin ? { enabled: false } : { enabled: true };
  848. } } } })], T3.prototype, "uniqueValueInfos", null), T3 = R = e([n2(P)], T3);
  849. var C2 = T3;
  850. export {
  851. p2 as p,
  852. n5 as n,
  853. y4 as y,
  854. l4 as l,
  855. a8 as a,
  856. _,
  857. n7 as n2,
  858. C2 as C
  859. };
  860. //# sourceMappingURL=chunk-3FNKD2EB.js.map