MapImageLayerView2D-QXGPU7JK.js 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581
  1. import {
  2. n as n3
  3. } from "./chunk-2L6YYKXA.js";
  4. import {
  5. oe
  6. } from "./chunk-DTSCAH2R.js";
  7. import "./chunk-B5WNDDCF.js";
  8. import {
  9. a as a2,
  10. s as s5
  11. } from "./chunk-CFZGXSAO.js";
  12. import "./chunk-DXEPL3XQ.js";
  13. import "./chunk-E5TKVDJT.js";
  14. import "./chunk-XYIYXU3I.js";
  15. import "./chunk-T6DJ6UAT.js";
  16. import "./chunk-WOGDHLUJ.js";
  17. import {
  18. v as v4
  19. } from "./chunk-NAWSWIYX.js";
  20. import {
  21. a as a3
  22. } from "./chunk-BFF4N4R7.js";
  23. import "./chunk-O6KMIRUU.js";
  24. import "./chunk-264YGWEE.js";
  25. import {
  26. i as i7
  27. } from "./chunk-YG7DNOY4.js";
  28. import {
  29. u,
  30. y as y3
  31. } from "./chunk-KUAEOLV3.js";
  32. import "./chunk-ZLQP3WDC.js";
  33. import "./chunk-JBMHQ5RK.js";
  34. import "./chunk-WBWQJQK4.js";
  35. import {
  36. d,
  37. s as s4
  38. } from "./chunk-TE2TRGVU.js";
  39. import "./chunk-A22ACVMF.js";
  40. import "./chunk-TDS6IBMU.js";
  41. import "./chunk-DBT4KOKX.js";
  42. import "./chunk-2GP5D74I.js";
  43. import "./chunk-ZELEU5PN.js";
  44. import "./chunk-O7E4VYJT.js";
  45. import "./chunk-AIG57VB7.js";
  46. import "./chunk-PHAKVYRM.js";
  47. import "./chunk-IDINBHDV.js";
  48. import "./chunk-6LE4RPMZ.js";
  49. import "./chunk-67RFR4NT.js";
  50. import "./chunk-WPDBODJM.js";
  51. import "./chunk-5IVP3KUS.js";
  52. import "./chunk-JXYBFGFY.js";
  53. import "./chunk-EPMXCACW.js";
  54. import "./chunk-UCPKJYXN.js";
  55. import "./chunk-KFLNKWNF.js";
  56. import "./chunk-R24MO4IV.js";
  57. import "./chunk-YQBYWPBD.js";
  58. import "./chunk-UWKVAZQ6.js";
  59. import "./chunk-XBFCIW4K.js";
  60. import "./chunk-T2SKWJGU.js";
  61. import "./chunk-UO3LS2M5.js";
  62. import "./chunk-H2VOWDMO.js";
  63. import "./chunk-QISOH77W.js";
  64. import "./chunk-4HL6BBWO.js";
  65. import "./chunk-KUO7OCMN.js";
  66. import "./chunk-XO5VJRK4.js";
  67. import "./chunk-ST53DRNI.js";
  68. import "./chunk-3WXSWAUV.js";
  69. import "./chunk-27YO3FKC.js";
  70. import "./chunk-EQNT4A7P.js";
  71. import "./chunk-4OM3EX6P.js";
  72. import "./chunk-3OFVLRSL.js";
  73. import "./chunk-DMVKVC5I.js";
  74. import "./chunk-VEJPYAE4.js";
  75. import "./chunk-UMUHMVL4.js";
  76. import "./chunk-FZSI6IGI.js";
  77. import "./chunk-YFDOPEEZ.js";
  78. import {
  79. i as i6
  80. } from "./chunk-BVA3U6FJ.js";
  81. import "./chunk-IQBIGNPU.js";
  82. import "./chunk-K7B6OWCU.js";
  83. import "./chunk-LXOC7SMQ.js";
  84. import "./chunk-QU433TMZ.js";
  85. import "./chunk-L5DZVCCW.js";
  86. import "./chunk-WNPL3C7R.js";
  87. import "./chunk-E7ZLMIQ7.js";
  88. import "./chunk-JEA4MMTV.js";
  89. import "./chunk-RG3AHHRL.js";
  90. import "./chunk-XHRNCFJT.js";
  91. import "./chunk-UDYHZLTE.js";
  92. import "./chunk-QC7NCR5N.js";
  93. import "./chunk-VQXMCZYH.js";
  94. import "./chunk-JQUWFKNU.js";
  95. import "./chunk-RWQH5X3O.js";
  96. import "./chunk-6334AFGG.js";
  97. import "./chunk-CC74Y7ET.js";
  98. import "./chunk-TFHLTN6F.js";
  99. import "./chunk-O3JQY77G.js";
  100. import "./chunk-E3G7BRZB.js";
  101. import "./chunk-JKFWEHNK.js";
  102. import "./chunk-IIAN3QNN.js";
  103. import "./chunk-P24XEEHY.js";
  104. import {
  105. v as v3
  106. } from "./chunk-WOXHUQGM.js";
  107. import {
  108. f,
  109. i as i2,
  110. s as s3
  111. } from "./chunk-FMPQIGFA.js";
  112. import "./chunk-EDHROVWI.js";
  113. import "./chunk-3IRT3YKJ.js";
  114. import "./chunk-SAJAEMIJ.js";
  115. import {
  116. c as c2
  117. } from "./chunk-PT5TF6KZ.js";
  118. import {
  119. n as n2
  120. } from "./chunk-OFTOCPN5.js";
  121. import {
  122. i as i4,
  123. r as r4
  124. } from "./chunk-3YTO5A3F.js";
  125. import {
  126. i as i5
  127. } from "./chunk-XO7O5UZJ.js";
  128. import {
  129. t as t3
  130. } from "./chunk-TU7WVKU4.js";
  131. import "./chunk-JAUFBT5U.js";
  132. import "./chunk-ZOO4I2U4.js";
  133. import "./chunk-HZ2WKB3G.js";
  134. import "./chunk-3HCJD762.js";
  135. import "./chunk-RVCE264D.js";
  136. import "./chunk-HKJ7X3BD.js";
  137. import "./chunk-Y74D3LKQ.js";
  138. import "./chunk-PK4W65H4.js";
  139. import {
  140. g
  141. } from "./chunk-7C23ILQ4.js";
  142. import "./chunk-P6VVVEX6.js";
  143. import {
  144. y as y2
  145. } from "./chunk-3Z755LKF.js";
  146. import "./chunk-LTZ5XXDV.js";
  147. import "./chunk-IEU3AM37.js";
  148. import "./chunk-DLMAGHHC.js";
  149. import "./chunk-JOYXMSKE.js";
  150. import "./chunk-YZVAB3DF.js";
  151. import "./chunk-JLYTER4T.js";
  152. import "./chunk-CRHRHOXH.js";
  153. import "./chunk-ZSW35JPD.js";
  154. import "./chunk-JLSNMUQJ.js";
  155. import "./chunk-ECY35CJI.js";
  156. import "./chunk-PT62335L.js";
  157. import "./chunk-PJNBFKPF.js";
  158. import "./chunk-C7742RNZ.js";
  159. import "./chunk-FNA5GLRW.js";
  160. import "./chunk-MCWCB5IY.js";
  161. import "./chunk-TV3CFJQR.js";
  162. import {
  163. a,
  164. l as l2
  165. } from "./chunk-TJV6ODRM.js";
  166. import "./chunk-YLEVJ6UV.js";
  167. import "./chunk-U2WD23Z5.js";
  168. import {
  169. g as g2
  170. } from "./chunk-GLSWDDR3.js";
  171. import "./chunk-DUEMJ5XS.js";
  172. import {
  173. T
  174. } from "./chunk-VRLXUHP2.js";
  175. import "./chunk-3LVSQLWJ.js";
  176. import "./chunk-4ONPMX2F.js";
  177. import "./chunk-CRGY2SDS.js";
  178. import {
  179. i as i3
  180. } from "./chunk-4T5ZGMEN.js";
  181. import "./chunk-3WQOA5CB.js";
  182. import "./chunk-FZQZIM7U.js";
  183. import "./chunk-CZBRZ6SU.js";
  184. import "./chunk-VGWC3IKZ.js";
  185. import "./chunk-2H5MD622.js";
  186. import {
  187. $
  188. } from "./chunk-3RSFVUKZ.js";
  189. import "./chunk-UVVU4UUO.js";
  190. import "./chunk-O6VYMEIX.js";
  191. import "./chunk-X4SA4ELJ.js";
  192. import "./chunk-5N7JLUJJ.js";
  193. import "./chunk-ZAY3CMAZ.js";
  194. import "./chunk-P3XKUGLS.js";
  195. import "./chunk-LU5IJZB4.js";
  196. import "./chunk-7IBV2TRE.js";
  197. import "./chunk-ZLNEXZAN.js";
  198. import "./chunk-5UVJ64RB.js";
  199. import "./chunk-SFEFRQCL.js";
  200. import "./chunk-3GZSQU56.js";
  201. import "./chunk-ZYRIJWLX.js";
  202. import "./chunk-RYY6632W.js";
  203. import "./chunk-DW42UVIT.js";
  204. import "./chunk-YAEIHDJH.js";
  205. import "./chunk-TJNOJH33.js";
  206. import "./chunk-OSHI574D.js";
  207. import {
  208. i
  209. } from "./chunk-ETGAZ7LF.js";
  210. import {
  211. t as t2
  212. } from "./chunk-75U5LM2V.js";
  213. import {
  214. c,
  215. v as v2
  216. } from "./chunk-RMDDCMKS.js";
  217. import "./chunk-VCH45Q2I.js";
  218. import {
  219. j as j2
  220. } from "./chunk-LBW34VZ2.js";
  221. import "./chunk-GSSTTHIT.js";
  222. import "./chunk-YFSLJIO4.js";
  223. import "./chunk-IM3LVQXV.js";
  224. import "./chunk-55RWC67C.js";
  225. import "./chunk-HZRKBTHJ.js";
  226. import {
  227. U
  228. } from "./chunk-DVUG3KID.js";
  229. import "./chunk-FWSQEIAR.js";
  230. import "./chunk-VEGAOVMY.js";
  231. import {
  232. o,
  233. w2 as w
  234. } from "./chunk-6T6G6LCQ.js";
  235. import "./chunk-YEJL5NEF.js";
  236. import {
  237. k2 as k,
  238. r as r3
  239. } from "./chunk-PQFTYGF5.js";
  240. import {
  241. e,
  242. l3 as l,
  243. n5 as n,
  244. y3 as y
  245. } from "./chunk-2Z2TG5CU.js";
  246. import "./chunk-6KZ2LTDA.js";
  247. import "./chunk-U2XHEJM7.js";
  248. import {
  249. r as r2,
  250. v
  251. } from "./chunk-SQOPWYIT.js";
  252. import {
  253. E,
  254. j,
  255. x
  256. } from "./chunk-V6P2MAQQ.js";
  257. import {
  258. s2 as s,
  259. s3 as s2
  260. } from "./chunk-E5O6P5I2.js";
  261. import {
  262. has
  263. } from "./chunk-SPWQ3AWG.js";
  264. import "./chunk-2TIUKVZN.js";
  265. import {
  266. r,
  267. t
  268. } from "./chunk-YXWMMD76.js";
  269. import "./chunk-S5KM4IGW.js";
  270. // node_modules/@arcgis/core/rest/operations/identify.js
  271. var o2 = (e2) => e2.spatialReference.wkid || JSON.stringify(e2.spatialReference);
  272. function l3(r5, i8) {
  273. const { dpi: n4, gdbVersion: s6, geometry: l4, geometryPrecision: f5, height: p2, layerOption: m4, mapExtent: y5, maxAllowableOffset: c3, returnFieldName: u3, returnGeometry: d2, returnUnformattedValues: g3, returnZ: x2, spatialReference: b, timeExtent: h, tolerance: E2, width: O } = r5.toJSON(), { dynamicLayers: S, layerDefs: j3, layerIds: N } = a4(r5), J = i8 && r(i8.geometry) ? i8.geometry : null, R = { geometryPrecision: f5, maxAllowableOffset: c3, returnFieldName: u3, returnGeometry: d2, returnUnformattedValues: g3, returnZ: x2, tolerance: E2 }, $2 = J && J.toJSON() || l4;
  274. if (R.imageDisplay = `${O},${p2},${n4}`, s6 && (R.gdbVersion = s6), $2 && (delete $2.spatialReference, R.geometry = JSON.stringify($2), R.geometryType = c($2)), b ? R.sr = b.wkid || JSON.stringify(b) : $2 && $2.spatialReference ? R.sr = o2($2) : y5 && y5.spatialReference && (R.sr = o2(y5)), R.time = h ? [h.start, h.end].join(",") : null, y5) {
  275. const { xmin: e2, ymin: r6, xmax: t4, ymax: i9 } = y5;
  276. R.mapExtent = `${e2},${r6},${t4},${i9}`;
  277. }
  278. return j3 && (R.layerDefs = j3), S && !j3 && (R.dynamicLayers = S), R.layers = "popup" === m4 ? "visible" : m4, N && !S && (R.layers += `:${N.join(",")}`), R;
  279. }
  280. function a4(r5) {
  281. var _a, _b;
  282. const { mapExtent: t4, floors: o3, width: l4, sublayers: a7, layerIds: p2, layerOption: m4, gdbVersion: y5 } = r5, c3 = (_b = (_a = a7 == null ? void 0 : a7.find((e2) => null != e2.layer)) == null ? void 0 : _a.layer) == null ? void 0 : _b.serviceSublayers, u3 = "popup" === m4, d2 = {}, g3 = i4({ extent: t4, width: l4, spatialReference: t4 == null ? void 0 : t4.spatialReference }), x2 = [], b = (e2) => {
  283. const r6 = 0 === g3, t5 = 0 === e2.minScale || g3 <= e2.minScale, i8 = 0 === e2.maxScale || g3 >= e2.maxScale;
  284. if (e2.visible && (r6 || t5 && i8))
  285. if (e2.sublayers)
  286. e2.sublayers.forEach(b);
  287. else {
  288. if (false === (p2 == null ? void 0 : p2.includes(e2.id)) || u3 && (!e2.popupTemplate || !e2.popupEnabled))
  289. return;
  290. x2.unshift(e2);
  291. }
  292. };
  293. if (a7 == null ? void 0 : a7.forEach(b), a7 && !x2.length)
  294. d2.layerIds = [];
  295. else {
  296. const r6 = i5(x2, c3, y5), t5 = x2.map((e2) => {
  297. const r7 = n2(o3, e2);
  298. return e2.toExportImageJSON(r7);
  299. });
  300. if (r6)
  301. d2.dynamicLayers = JSON.stringify(t5);
  302. else {
  303. if (a7) {
  304. let e2 = x2.map(({ id: e3 }) => e3);
  305. p2 && (e2 = e2.filter((e3) => p2.includes(e3))), d2.layerIds = e2;
  306. } else
  307. (p2 == null ? void 0 : p2.length) && (d2.layerIds = p2);
  308. const r7 = f2(o3, x2);
  309. if (r(r7) && r7.length) {
  310. const e2 = {};
  311. for (const t6 of r7)
  312. t6.definitionExpression && (e2[t6.id] = t6.definitionExpression);
  313. Object.keys(e2).length && (d2.layerDefs = JSON.stringify(e2));
  314. }
  315. }
  316. }
  317. return d2;
  318. }
  319. function f2(e2, t4) {
  320. const i8 = !!(e2 == null ? void 0 : e2.length), s6 = t4.filter((e3) => null != e3.definitionExpression || i8 && null != e3.floorInfo);
  321. return s6.length ? s6.map((t5) => {
  322. const i9 = n2(e2, t5), s7 = t3(i9, t5.definitionExpression);
  323. return { id: t5.id, definitionExpression: s7 };
  324. }) : null;
  325. }
  326. // node_modules/@arcgis/core/rest/support/IdentifyParameters.js
  327. var m;
  328. var a5 = m = class extends l {
  329. constructor(t4) {
  330. super(t4), this.dpi = 96, this.floors = null, this.gdbVersion = null, this.geometry = null, this.geometryPrecision = null, this.height = 400, this.layerIds = null, this.layerOption = "top", this.mapExtent = null, this.maxAllowableOffset = null, this.returnFieldName = true, this.returnGeometry = false, this.returnM = false, this.returnUnformattedValues = true, this.returnZ = false, this.spatialReference = null, this.sublayers = null, this.timeExtent = null, this.tolerance = null, this.width = 400;
  331. }
  332. static from(t4) {
  333. return v(m, t4);
  334. }
  335. };
  336. e([y({ type: Number, json: { write: true } })], a5.prototype, "dpi", void 0), e([y()], a5.prototype, "floors", void 0), e([y({ type: String, json: { write: true } })], a5.prototype, "gdbVersion", void 0), e([y({ types: i, json: { read: v2, write: true } })], a5.prototype, "geometry", void 0), e([y({ type: Number, json: { write: true } })], a5.prototype, "geometryPrecision", void 0), e([y({ type: Number, json: { write: true } })], a5.prototype, "height", void 0), e([y({ type: [Number], json: { write: true } })], a5.prototype, "layerIds", void 0), e([y({ type: ["top", "visible", "all", "popup"], json: { write: true } })], a5.prototype, "layerOption", void 0), e([y({ type: w, json: { write: true } })], a5.prototype, "mapExtent", void 0), e([y({ type: Number, json: { write: true } })], a5.prototype, "maxAllowableOffset", void 0), e([y({ type: Boolean, json: { write: true } })], a5.prototype, "returnFieldName", void 0), e([y({ type: Boolean, json: { write: true } })], a5.prototype, "returnGeometry", void 0), e([y({ type: Boolean, json: { write: true } })], a5.prototype, "returnM", void 0), e([y({ type: Boolean, json: { write: true } })], a5.prototype, "returnUnformattedValues", void 0), e([y({ type: Boolean, json: { write: true } })], a5.prototype, "returnZ", void 0), e([y({ type: k, json: { write: true } })], a5.prototype, "spatialReference", void 0), e([y()], a5.prototype, "sublayers", void 0), e([y({ type: T, json: { write: true } })], a5.prototype, "timeExtent", void 0), e([y({ type: Number, json: { write: true } })], a5.prototype, "tolerance", void 0), e([y({ type: Number, json: { write: true } })], a5.prototype, "width", void 0), a5 = m = e([n("esri.rest.support.IdentifyParameters")], a5);
  337. var u2 = a5;
  338. // node_modules/@arcgis/core/rest/support/IdentifyResult.js
  339. var m2 = class extends l {
  340. constructor(r5) {
  341. super(r5), this.displayFieldName = null, this.feature = null, this.layerId = null, this.layerName = null;
  342. }
  343. readFeature(r5, t4) {
  344. return g.fromJSON({ attributes: { ...t4.attributes }, geometry: { ...t4.geometry } });
  345. }
  346. writeFeature(r5, e2) {
  347. if (!r5)
  348. return;
  349. const { attributes: t4, geometry: s6 } = r5;
  350. t4 && (e2.attributes = { ...t4 }), r(s6) && (e2.geometry = s6.toJSON(), e2.geometryType = t2.toJSON(s6.type));
  351. }
  352. };
  353. e([y({ type: String, json: { write: true } })], m2.prototype, "displayFieldName", void 0), e([y({ type: g })], m2.prototype, "feature", void 0), e([o("feature", ["attributes", "geometry"])], m2.prototype, "readFeature", null), e([r3("feature")], m2.prototype, "writeFeature", null), e([y({ type: Number, json: { write: true } })], m2.prototype, "layerId", void 0), e([y({ type: String, json: { write: true } })], m2.prototype, "layerName", void 0), m2 = e([n("esri.rest.support.IdentifyResult")], m2);
  354. var y4 = m2;
  355. // node_modules/@arcgis/core/rest/identify.js
  356. async function f3(u3, i8, f5) {
  357. const c3 = (i8 = a6(i8)).geometry ? [i8.geometry] : [], l4 = f(u3);
  358. return l4.path += "/identify", v3(c3).then((e2) => {
  359. const t4 = l3(i8, { geometry: e2 && e2[0] }), u4 = s3({ ...l4.query, f: "json", ...t4 }), a7 = i2(u4, f5);
  360. return U(l4.path, a7).then(m3).then((r5) => p(r5, i8.sublayers));
  361. });
  362. }
  363. function m3(r5) {
  364. const e2 = r5.data;
  365. return e2.results = e2.results || [], e2.exceededTransferLimit = Boolean(e2.exceededTransferLimit), e2.results = e2.results.map((r6) => y4.fromJSON(r6)), e2;
  366. }
  367. function a6(r5) {
  368. return r5 = u2.from(r5);
  369. }
  370. function p(r5, e2) {
  371. if (!(e2 == null ? void 0 : e2.length))
  372. return r5;
  373. const t4 = /* @__PURE__ */ new Map();
  374. function o3(r6) {
  375. t4.set(r6.id, r6), r6.sublayers && r6.sublayers.forEach(o3);
  376. }
  377. e2.forEach(o3);
  378. for (const s6 of r5.results)
  379. s6.feature.sourceLayer = t4.get(s6.layerId);
  380. return r5;
  381. }
  382. // node_modules/@arcgis/core/views/layers/MapImageLayerView.js
  383. var _ = null;
  384. var F = (F2) => {
  385. let I = class extends F2 {
  386. constructor() {
  387. super(...arguments), this._featuresResolutions = /* @__PURE__ */ new WeakMap(), this.highlightGraphics = new i6(), this.updateHighlightedFeatures = x(async (e2) => {
  388. this.destroyed || this.updatingHandles.addPromise(this._updateHighlightedFeaturesGeometries(e2).catch(() => {
  389. }));
  390. });
  391. }
  392. initialize() {
  393. this.exportImageParameters = new c2({ layer: this.layer }), this.handles.add([a(() => this.highlightGraphics, "change", (e2) => {
  394. this.updatingHandles.addPromise(this._updateHighlightedFeaturesSymbols(e2.added).catch(() => {
  395. })), this.updateHighlightedFeatures(this._highlightGeometriesResolution);
  396. })]);
  397. }
  398. destroy() {
  399. this.exportImageParameters.destroy(), this.exportImageParameters = null;
  400. }
  401. get exportImageVersion() {
  402. var _a;
  403. return (_a = this.exportImageParameters) == null ? void 0 : _a.commitProperty("version"), this.commitProperty("timeExtent"), (this._get("exportImageVersion") || 0) + 1;
  404. }
  405. async fetchPopupFeatures(e2, r5) {
  406. var _a, _b, _c, _d, _e, _f;
  407. const { layer: s6 } = this;
  408. if (!e2)
  409. throw new s2("mapimagelayer:fetchPopupFeatures", "Nothing to fetch without area", { layer: s6 });
  410. const i8 = (_c = (_b = (_a = this.layer.capabilities) == null ? void 0 : _a.operations) == null ? void 0 : _b.supportsQuery) != null ? _c : true;
  411. if (!(((_f = (_e = (_d = this.layer.capabilities) == null ? void 0 : _d.operations) == null ? void 0 : _e.supportsIdentify) != null ? _f : true) && this.layer.version >= 10.5) && !i8)
  412. throw new s2("mapimagelayer:fetchPopupFeatures-not-supported", "query operation is disabled for this service", { layer: s6 });
  413. return i8 ? this._fetchPopupFeaturesUsingQueries(e2, r5) : this._fetchPopupFeaturesUsingIdentify(e2, r5);
  414. }
  415. canResume() {
  416. var _a;
  417. return !!super.canResume() && !((_a = this.timeExtent) == null ? void 0 : _a.isEmpty);
  418. }
  419. async _updateHighlightedFeaturesSymbols(e2) {
  420. for (const t4 of e2) {
  421. const e3 = "renderer" in t4.sourceLayer && t4.sourceLayer.renderer;
  422. "geometryType" in t4.sourceLayer && "point" === t4.sourceLayer.geometryType && e3 && "getSymbolAsync" in e3 && e3.getSymbolAsync(t4).then(async (r5) => {
  423. var _a;
  424. let s6 = "width" in r5 && "height" in r5 && null != r5.width && null != r5.height ? Math.max(r5.width, r5.height) : "size" in r5 ? r5.size : null;
  425. const i8 = "visualVariables" in e3 && ((_a = e3.visualVariables) == null ? void 0 : _a.find((e4) => "size" === e4.type));
  426. i8 && (_ || (_ = (await import("./visualVariableUtils-2VHWG6DH.js")).getSize), s6 = _(i8, t4, { view: this.view.type, scale: this.view.scale, shape: "simple-marker" === r5.type ? r5.style : null })), this.highlightGraphics.includes(t4) && (t4.symbol = new y2({ style: "square", size: s6, xoffset: "xoffset" in r5 ? r5.xoffset : 0, yoffset: "yoffset" in r5 ? r5.yoffset : 0 }), t4.visible = true, this.highlightGraphicUpdated(t4, "symbol"));
  427. });
  428. }
  429. }
  430. async _updateHighlightedFeaturesGeometries(e2) {
  431. this._highlightGeometriesResolution = e2;
  432. const t4 = this.highlightGraphics;
  433. if (!t4.length || !this.layer.capabilities.operations.supportsQuery)
  434. return;
  435. const s6 = this._getTargetResolution(e2), i8 = /* @__PURE__ */ new Map();
  436. for (const n4 of t4)
  437. if (!this._featuresResolutions.has(n4) || this._featuresResolutions.get(n4) > s6) {
  438. const e3 = n4.sourceLayer;
  439. r2(i8, e3, () => /* @__PURE__ */ new Map()).set(n4.getObjectId(), n4);
  440. }
  441. const o3 = Array.from(i8, ([e3, t5]) => {
  442. const r5 = e3.createQuery();
  443. return r5.objectIds = [...t5.keys()], r5.outFields = [e3.objectIdField], r5.returnGeometry = true, r5.maxAllowableOffset = s6, r5.outSpatialReference = this.view.spatialReference, e3.queryFeatures(r5);
  444. }), a7 = await Promise.all(o3);
  445. if (!this.destroyed)
  446. for (const { features: r5 } of a7)
  447. for (const e3 of r5) {
  448. const t5 = e3.sourceLayer, r6 = i8.get(t5).get(e3.getObjectId());
  449. r6 && this.highlightGraphics.includes(r6) && (r6.geometry = e3.geometry, this.highlightGraphicUpdated(r6, "geometry"), this._featuresResolutions.set(r6, s6));
  450. }
  451. }
  452. _getTargetResolution(e2) {
  453. const t4 = e2 * $(this.view.spatialReference), r5 = t4 / 16;
  454. return r5 <= 10 ? 0 : e2 / t4 * r5;
  455. }
  456. async _fetchPopupFeaturesUsingIdentify(e2, t4) {
  457. const r5 = await this._createIdentifyParameters(e2, t4);
  458. if (t(r5))
  459. return [];
  460. const { results: i8 } = await f3(this.layer.parsedUrl, r5);
  461. return i8.map((e3) => e3.feature);
  462. }
  463. async _createIdentifyParameters(e2, t4) {
  464. const { floors: r5, spatialReference: s6, scale: o3 } = this.view, a7 = r(t4) ? t4.event : null, n4 = await this._collectPopupProviders(this.layer.sublayers, o3, t4);
  465. if (!n4.length)
  466. return null;
  467. await Promise.all(n4.map(({ sublayer: e3 }) => e3.load().catch(() => {
  468. })));
  469. const l4 = Math.min(has("mapimagelayer-popup-identify-max-tolerance"), this.layer.allSublayers.reduce((e3, t5) => t5.renderer ? s5({ renderer: t5.renderer, event: a7 }) : e3, 2)), p2 = this.createFetchPopupFeaturesQueryGeometry(e2, l4), u3 = r4(o3, s6), m4 = Math.round(p2.width / u3), y5 = new w({ xmin: p2.center.x - u3 * m4, ymin: p2.center.y - u3 * m4, xmax: p2.center.x + u3 * m4, ymax: p2.center.y + u3 * m4, spatialReference: p2.spatialReference });
  470. return new u2({ floors: r5, gdbVersion: this.layer.gdbVersion, geometry: e2, height: m4, layerOption: "popup", mapExtent: y5, returnGeometry: true, spatialReference: s6, sublayers: this.layer.sublayers, timeExtent: this.timeExtent, tolerance: l4, width: m4 });
  471. }
  472. async _fetchPopupFeaturesUsingQueries(e2, t4) {
  473. const r5 = await this._collectPopupProviders(this.layer.sublayers, this.view.scale, t4), s6 = r(t4) ? t4.event : null, o3 = r5.map(async ({ sublayer: t5, popupTemplate: r6 }) => {
  474. var _a, _b;
  475. await t5.load().catch(() => {
  476. });
  477. const o4 = t5.createQuery(), a7 = s5({ renderer: t5.renderer, event: s6 }), n4 = this.createFetchPopupFeaturesQueryGeometry(e2, a7);
  478. if (o4.geometry = n4, o4.outFields = await d(t5, r6), o4.timeExtent = this.timeExtent, "floors" in this.view) {
  479. const e3 = (_b = (_a = this.view) == null ? void 0 : _a.floors) == null ? void 0 : _b.clone(), r7 = n2(e3, t5);
  480. r(r7) && (o4.where = o4.where ? `(${o4.where}) AND (${r7})` : r7);
  481. }
  482. const l4 = this._getTargetResolution(n4.width / a7), p2 = await this._loadArcadeModules(r6), u3 = "point" === t5.geometryType || p2 && p2.arcadeUtils.hasGeometryOperations(r6);
  483. u3 || (o4.maxAllowableOffset = l4);
  484. const { features: h } = await t5.queryFeatures(o4), c3 = u3 ? 0 : l4;
  485. for (const e3 of h)
  486. this._featuresResolutions.set(e3, c3);
  487. return h;
  488. });
  489. return (await E(o3)).reverse().reduce((e3, t5) => t5.value ? [...e3, ...t5.value] : e3, []).filter((e3) => null != e3);
  490. }
  491. async _collectPopupProviders(e2, t4, r5) {
  492. const s6 = [], o3 = async (e3) => {
  493. const a8 = 0 === e3.minScale || t4 <= e3.minScale, n4 = 0 === e3.maxScale || t4 >= e3.maxScale;
  494. if (e3.visible && a8 && n4) {
  495. if (e3.sublayers)
  496. e3.sublayers.forEach(o3);
  497. else if (e3.popupEnabled) {
  498. const t5 = s4(e3, { ...r5, defaultPopupTemplateEnabled: false });
  499. r(t5) && s6.unshift({ sublayer: e3, popupTemplate: t5 });
  500. }
  501. }
  502. }, a7 = e2.toArray().reverse().map(o3);
  503. return await Promise.all(a7), s6;
  504. }
  505. _loadArcadeModules(e2) {
  506. var _a;
  507. if (((_a = e2.expressionInfos) == null ? void 0 : _a.length) || Array.isArray(e2.content) && e2.content.some((e3) => "expression" === e3.type))
  508. return i3();
  509. }
  510. };
  511. return e([y()], I.prototype, "highlightGraphics", void 0), e([y()], I.prototype, "exportImageParameters", void 0), e([y({ readOnly: true })], I.prototype, "exportImageVersion", null), e([y()], I.prototype, "layer", void 0), e([y()], I.prototype, "suspended", void 0), e([y(g2)], I.prototype, "timeExtent", void 0), I = e([n("esri.views.layers.MapImageLayerView")], I), I;
  512. };
  513. // node_modules/@arcgis/core/views/2d/layers/MapImageLayerView2D.js
  514. var f4 = class extends F(i7(y3(u))) {
  515. update(e2) {
  516. this.strategy.update(e2).catch((e3) => {
  517. j(e3) || s.getLogger(this.declaredClass).error(e3);
  518. }), e2.stationary && this.updateHighlightedFeatures(e2.state.resolution), this._highlightView.processUpdate(e2);
  519. }
  520. attach() {
  521. const { imageMaxWidth: e2, imageMaxHeight: t4, version: i8 } = this.layer, r5 = i8 >= 10.3, s6 = i8 >= 10;
  522. this._bitmapContainer = new a3(), this.container.addChild(this._bitmapContainer), this._highlightView = new oe({ view: this.view, graphics: this.highlightGraphics, requestUpdateCallback: () => this.requestUpdate(), container: new n3(this.view.featuresTilingScheme) }), this.container.addChild(this._highlightView.container), this.strategy = new v4({ container: this._bitmapContainer, fetchSource: this.fetchImageBitmap.bind(this), requestUpdate: this.requestUpdate.bind(this), imageMaxWidth: e2, imageMaxHeight: t4, imageRotationSupported: r5, imageNormalizationSupported: s6, hidpi: true }), this.handles.add(l2(() => this.exportImageVersion, () => this.requestUpdate()), "exportImageVersion"), this.handles.add(l2(() => {
  523. var _a;
  524. return (_a = this.view) == null ? void 0 : _a.floors;
  525. }, () => this.requestUpdate()), "view.floors"), this.requestUpdate();
  526. }
  527. detach() {
  528. this.handles.remove("exportImageVersion"), this.handles.remove("view.floors"), this.strategy.destroy(), this.container.removeAllChildren(), this._bitmapContainer.removeAllChildren(), this._highlightView.destroy();
  529. }
  530. moveStart() {
  531. }
  532. viewChange() {
  533. }
  534. moveEnd() {
  535. this.requestUpdate();
  536. }
  537. highlight(e2) {
  538. let r5 = null;
  539. if (e2 instanceof g ? r5 = [e2] : j2.isCollection(e2) && e2.length > 0 ? r5 = e2.toArray() : Array.isArray(e2) && e2.length > 0 && (r5 = e2), r5 = r5 == null ? void 0 : r5.filter(Boolean), !r5 || !r5.length)
  540. return { remove: () => {
  541. } };
  542. for (const t4 of r5)
  543. "geometryType" in t4.sourceLayer && "point" === t4.sourceLayer.geometryType && (t4.visible = false);
  544. return this.highlightGraphics.addMany(r5), { remove: () => {
  545. this.highlightGraphics.removeMany(r5);
  546. } };
  547. }
  548. supportsSpatialReference(e2) {
  549. return this.layer.serviceSupportsSpatialReference(e2);
  550. }
  551. createFetchPopupFeaturesQueryGeometry(e2, t4) {
  552. return a2(e2, t4, this.view);
  553. }
  554. async doRefresh() {
  555. this.requestUpdate();
  556. }
  557. isUpdating() {
  558. return this.strategy.updating || this.updateRequested;
  559. }
  560. highlightGraphicUpdated(e2, t4) {
  561. this._highlightView.graphicUpdateHandler({ graphic: e2, property: t4 });
  562. }
  563. fetchImage(e2, t4, i8, r5) {
  564. return this.layer.fetchImage(e2, t4, i8, { timeExtent: this.timeExtent, floors: this.view.floors, ...r5 });
  565. }
  566. fetchImageBitmap(e2, t4, i8, r5) {
  567. return this.layer.fetchImageBitmap(e2, t4, i8, { timeExtent: this.timeExtent, floors: this.view.floors, ...r5 });
  568. }
  569. };
  570. e([y()], f4.prototype, "strategy", void 0), e([y()], f4.prototype, "updating", void 0), f4 = e([n("esri.views.2d.layers.MapImageLayerView2D")], f4);
  571. var v5 = f4;
  572. export {
  573. v5 as default
  574. };
  575. //# sourceMappingURL=MapImageLayerView2D-QXGPU7JK.js.map