@arcgis/core 5.2.0-next.15 → 5.2.0-next.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/applications/Urban/editingSessionUtils.js +1 -1
- package/arcade/featureSetUtils.js +1 -1
- package/arcade/featureset/sources/FeatureLayerDynamic.js +1 -1
- package/arcade/featureset/sources/FeatureLayerParquet.js +2 -0
- package/arcade/featureset/support/FeatureSet.js +1 -1
- package/arcade/featureset/support/shared.js +1 -1
- package/arcade.d.ts +2 -1
- package/arcgisGlobal.d.ts +6 -1
- package/assets/esri/core/t9n/Units_ar.json +1 -1
- package/assets/esri/core/t9n/Units_bg.json +1 -1
- package/assets/esri/core/t9n/Units_bs.json +1 -1
- package/assets/esri/core/t9n/Units_ca.json +1 -1
- package/assets/esri/core/t9n/Units_cs.json +1 -1
- package/assets/esri/core/t9n/Units_da.json +1 -1
- package/assets/esri/core/t9n/Units_de.json +1 -1
- package/assets/esri/core/t9n/Units_el.json +1 -1
- package/assets/esri/core/t9n/Units_es.json +1 -1
- package/assets/esri/core/t9n/Units_et.json +1 -1
- package/assets/esri/core/t9n/Units_fi.json +1 -1
- package/assets/esri/core/t9n/Units_fr.json +1 -1
- package/assets/esri/core/t9n/Units_he.json +1 -1
- package/assets/esri/core/t9n/Units_hr.json +1 -1
- package/assets/esri/core/t9n/Units_hu.json +1 -1
- package/assets/esri/core/t9n/Units_id.json +1 -1
- package/assets/esri/core/t9n/Units_it.json +1 -1
- package/assets/esri/core/t9n/Units_ja.json +1 -1
- package/assets/esri/core/t9n/Units_ko.json +1 -1
- package/assets/esri/core/t9n/Units_lt.json +1 -1
- package/assets/esri/core/t9n/Units_lv.json +1 -1
- package/assets/esri/core/t9n/Units_nl.json +1 -1
- package/assets/esri/core/t9n/Units_no.json +1 -1
- package/assets/esri/core/t9n/Units_pl.json +1 -1
- package/assets/esri/core/t9n/Units_pt-BR.json +1 -1
- package/assets/esri/core/t9n/Units_pt-PT.json +1 -1
- package/assets/esri/core/t9n/Units_ro.json +1 -1
- package/assets/esri/core/t9n/Units_ru.json +1 -1
- package/assets/esri/core/t9n/Units_sk.json +1 -1
- package/assets/esri/core/t9n/Units_sl.json +1 -1
- package/assets/esri/core/t9n/Units_sr.json +1 -1
- package/assets/esri/core/t9n/Units_sv.json +1 -1
- package/assets/esri/core/t9n/Units_th.json +1 -1
- package/assets/esri/core/t9n/Units_tr.json +1 -1
- package/assets/esri/core/t9n/Units_uk.json +1 -1
- package/assets/esri/core/t9n/Units_vi.json +1 -1
- package/assets/esri/core/t9n/Units_zh-CN.json +1 -1
- package/assets/esri/core/t9n/Units_zh-HK.json +1 -1
- package/assets/esri/core/t9n/Units_zh-TW.json +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/007485862ce95928717a.js +1 -0
- package/assets/esri/core/workers/chunks/00bcb04934972179b9ca.js +1 -0
- package/assets/esri/core/workers/chunks/{d9d4754062758789f186.js → 05016e5a1de384994001.js} +2 -2
- package/assets/esri/core/workers/chunks/05b6b2c0b76afb100e33.js +1 -0
- package/assets/esri/core/workers/chunks/{8927fb4aa68f7e541a39.js → 05d597dd117766beadd8.js} +1 -1
- package/assets/esri/core/workers/chunks/073ee52705ea326fecfb.js +1 -0
- package/assets/esri/core/workers/chunks/0a52373c4ba652e0ee0f.js +1 -0
- package/assets/esri/core/workers/chunks/0b522e05668bef729b1b.js +1 -0
- package/assets/esri/core/workers/chunks/0d42322362e76f674d94.js +2 -0
- package/assets/esri/core/workers/chunks/{a442534ac0956a68b769.js → 0e81b6aa64d5491870b2.js} +1 -1
- package/assets/esri/core/workers/chunks/{81e3bd1a0634ddc2b833.js → 0f10d7d592c36ee2d1ea.js} +1 -1
- package/assets/esri/core/workers/chunks/{3526ab3b1f87c24ae6f8.js → 0fb685f385e91d0f0601.js} +1 -1
- package/assets/esri/core/workers/chunks/{cdf6ad970dc1893dac58.js → 110135b0562a3b5708b9.js} +1 -1
- package/assets/esri/core/workers/chunks/11d1af758e2140095b10.js +1 -0
- package/assets/esri/core/workers/chunks/122892f365f5327d290c.js +1 -0
- package/assets/esri/core/workers/chunks/1305690054214a9cf48d.js +1 -0
- package/assets/esri/core/workers/chunks/168c15cf462f9abcbdd2.js +1 -0
- package/assets/esri/core/workers/chunks/169bfafec4d59be2beb0.js +1 -0
- package/assets/esri/core/workers/chunks/1d2609ce6220b5af5526.js +1 -0
- package/assets/esri/core/workers/chunks/1e109a521ca8772fdf04.js +1 -0
- package/assets/esri/core/workers/chunks/1ea840b7ac1ffaa0c389.js +1 -0
- package/assets/esri/core/workers/chunks/1f48438b3055afeb710f.js +1 -0
- package/assets/esri/core/workers/chunks/2353fbc1ff4481dcfb1f.js +1 -0
- package/assets/esri/core/workers/chunks/2509da565e5a2b43ac7f.js +1 -0
- package/assets/esri/core/workers/chunks/255c8e937e7a123ebb04.js +1 -0
- package/assets/esri/core/workers/chunks/256cc116e3be4feee593.js +1 -0
- package/assets/esri/core/workers/chunks/26aa8190ac439f634c5b.js +1 -0
- package/assets/esri/core/workers/chunks/29e6f4b19c3da9129439.js +1 -0
- package/assets/esri/core/workers/chunks/{45b560ca01fb566ba560.js → 2a8d791aef3123e6a3c4.js} +1 -1
- package/assets/esri/core/workers/chunks/2baee42e1797a709fe4b.js +1 -0
- package/assets/esri/core/workers/chunks/2c017eae434254610c8e.js +1 -0
- package/assets/esri/core/workers/chunks/2d7a4b669804d0c5029b.js +1 -0
- package/assets/esri/core/workers/chunks/2f40193d1b2e534c5226.js +1 -0
- package/assets/esri/core/workers/chunks/303e723e829ea7088d43.js +1 -0
- package/assets/esri/core/workers/chunks/31c4128b23968575feca.js +1 -0
- package/assets/esri/core/workers/chunks/35533c8ef541f7643497.js +2 -0
- package/assets/esri/core/workers/chunks/35a508a9311689d8df52.js +1 -0
- package/assets/esri/core/workers/chunks/36913f0f944a9eb82cd3.js +1 -0
- package/assets/esri/core/workers/chunks/3a35779cae6a11cde51b.js +1 -0
- package/assets/esri/core/workers/chunks/3a526e1d18490b99332f.js +1 -0
- package/assets/esri/core/workers/chunks/{cc62e5095e328bed3e01.js → 3aa0a34d2b7dbf2e2c66.js} +1 -1
- package/assets/esri/core/workers/chunks/3d4ad7c728e02aa90551.js +1 -0
- package/assets/esri/core/workers/chunks/3e89f487c5851c954d8b.js +1 -0
- package/assets/esri/core/workers/chunks/436d51b9f1b1b5abc4bc.js +1 -0
- package/assets/esri/core/workers/chunks/43ef6dee2e1d9ed7885e.js +1 -0
- package/assets/esri/core/workers/chunks/442424200e7475e9a08f.js +1 -0
- package/assets/esri/core/workers/chunks/4b96aa2dc5b88846bb53.js +1 -0
- package/assets/esri/core/workers/chunks/4ea325c829d3b82854b1.js +1 -0
- package/assets/esri/core/workers/chunks/50c88e2545380800381f.js +1 -0
- package/assets/esri/core/workers/chunks/51a53011478e0cf96e0b.js +1 -0
- package/assets/esri/core/workers/chunks/51a8a47aac1d8d22ba9d.js +1 -0
- package/assets/esri/core/workers/chunks/5481af25fd46914498df.js +1 -0
- package/assets/esri/core/workers/chunks/54f54623532f633dc0e2.js +1 -0
- package/assets/esri/core/workers/chunks/{bfd1aef8ac795e1ce227.js → 57a6572d440d2c62432b.js} +1 -1
- package/assets/esri/core/workers/chunks/5809e70a8e57e9b05959.js +1 -0
- package/assets/esri/core/workers/chunks/589b31cc5c663a288942.js +1 -0
- package/assets/esri/core/workers/chunks/58ce4bcfb15f378b1b9f.js +1 -0
- package/assets/esri/core/workers/chunks/58e0e50b6c3abaa4798f.js +1 -0
- package/assets/esri/core/workers/chunks/595bc41ff36c77324d01.js +261 -0
- package/assets/esri/core/workers/chunks/599bd80379423c99799d.js +1 -0
- package/assets/esri/core/workers/chunks/5bf01e0eff8a78b65e9e.js +1 -0
- package/assets/esri/core/workers/chunks/5dfeefee96659832398a.js +1 -0
- package/assets/esri/core/workers/chunks/{011a4d4201696fa10408.js → 5ea1113b7bdcf94b2822.js} +1 -1
- package/assets/esri/core/workers/chunks/5fab14c5f1febebb75f1.js +1 -0
- package/assets/esri/core/workers/chunks/60d4a3f770bb1e01cd10.js +1 -0
- package/assets/esri/core/workers/chunks/63858dfcff1177e597e7.js +1 -0
- package/assets/esri/core/workers/chunks/6849282c4a5cd733779d.js +1 -0
- package/assets/esri/core/workers/chunks/686c1a1b794ebe1a0341.js +1 -0
- package/assets/esri/core/workers/chunks/6a21a22b08f968fa8d60.js +1 -0
- package/assets/esri/core/workers/chunks/{11c3b1e8ca21ad62fdd1.js → 6db5ee9c589265b23b60.js} +1 -1
- package/assets/esri/core/workers/chunks/6dc60afb0c39bbb001a3.js +1 -0
- package/assets/esri/core/workers/chunks/{5bfae465872760e7af6d.js → 6f240fe78b299e6c4fcc.js} +1 -1
- package/assets/esri/core/workers/chunks/70cb825bb37f1977d2ab.js +1 -0
- package/assets/esri/core/workers/chunks/71a593fa116770e58832.js +1 -0
- package/assets/esri/core/workers/chunks/71f09e34d56c9fe5c307.js +1 -0
- package/assets/esri/core/workers/chunks/{72cfb186e50537bcdd19.js → 75915f81caaf9e5345a9.js} +1 -1
- package/assets/esri/core/workers/chunks/7832d94f35b79e27ee51.js +1 -0
- package/assets/esri/core/workers/chunks/8104ac2eee69d79ada86.js +1 -0
- package/assets/esri/core/workers/chunks/818a481ce579f519de1c.js +1 -0
- package/assets/esri/core/workers/chunks/831455798b177678720c.js +1 -0
- package/assets/esri/core/workers/chunks/83ce38342796bd6d73ce.js +1 -0
- package/assets/esri/core/workers/chunks/84a0bb53fcbd99b5aa0c.js +1 -0
- package/assets/esri/core/workers/chunks/87b86375f8557418dbe6.js +1 -0
- package/assets/esri/core/workers/chunks/8817d25c7f4cf0e6c6bd.js +1 -0
- package/assets/esri/core/workers/chunks/{0b55fc5050e718371e05.js → 888af532ad48fd86f285.js} +1 -1
- package/assets/esri/core/workers/chunks/{9331969046f2b277d620.js → 8a39dd585742960d3ca2.js} +1 -1
- package/assets/esri/core/workers/chunks/8ade399db21938822a7c.js +1 -0
- package/assets/esri/core/workers/chunks/8c62e2dabd1f1e13d244.js +1 -0
- package/assets/esri/core/workers/chunks/909e88c27d80777b047c.js +1 -0
- package/assets/esri/core/workers/chunks/91c5205d1274c7f190d5.js +1 -0
- package/assets/esri/core/workers/chunks/91c543443cd6768ad6ff.js +1 -0
- package/assets/esri/core/workers/chunks/9230ad807020fc2bbf8e.js +1 -0
- package/assets/esri/core/workers/chunks/92458803531fdfe1557a.js +1 -0
- package/assets/esri/core/workers/chunks/{976ab2be6c244768c08a.js → 940ebb13618d38c6b459.js} +1 -1
- package/assets/esri/core/workers/chunks/987594539981483a7c5e.js +1 -0
- package/assets/esri/core/workers/chunks/99c002015c2127e6cbfc.js +2 -0
- package/assets/esri/core/workers/chunks/9d59cc5c0a63a4e41d99.js +1 -0
- package/assets/esri/core/workers/chunks/{91c0de3950991d81b7f2.js → 9de673a04c70bd47047e.js} +1 -1
- package/assets/esri/core/workers/chunks/a195f569eada3a8736be.js +1 -0
- package/assets/esri/core/workers/chunks/a32651777e4f07df5b6a.js +1 -0
- package/assets/esri/core/workers/chunks/a3393780655152102c45.js +1 -0
- package/assets/esri/core/workers/chunks/a3c5b754a6fa0f4250bf.js +1 -0
- package/assets/esri/core/workers/chunks/{52175ff9e8c2c136f90a.js → a3ecde3794a7db3cf283.js} +1 -1
- package/assets/esri/core/workers/chunks/a59a1fdcd37a875f179b.js +1 -0
- package/assets/esri/core/workers/chunks/a844c4e031e77db11478.js +1 -0
- package/assets/esri/core/workers/chunks/a99ce2f12c8204ee542a.js +1 -0
- package/assets/esri/core/workers/chunks/aba7a053015a9738d8a0.js +1 -0
- package/assets/esri/core/workers/chunks/{c8460bdf60aca749ed05.js → ac16016964be3b684e98.js} +1 -1
- package/assets/esri/core/workers/chunks/adce59e4111bae4225f7.js +1 -0
- package/assets/esri/core/workers/chunks/aeeee92b86554962711e.js +1 -0
- package/assets/esri/core/workers/chunks/af3b060fdfa3b6174340.js +1 -0
- package/assets/esri/core/workers/chunks/b0e4af49fc968b0a910f.js +1 -0
- package/assets/esri/core/workers/chunks/b289c46ce2dc04d32e81.js +1 -0
- package/assets/esri/core/workers/chunks/{c983e5ce0ff952b65d7f.js → b2b342b06d502fc61ea5.js} +1 -1
- package/assets/esri/core/workers/chunks/b466af9019f10420115e.js +1 -0
- package/assets/esri/core/workers/chunks/{67ebde34377f98d17cda.js → b5571e93bc136dac8ee1.js} +1 -1
- package/assets/esri/core/workers/chunks/ba1c4a8794ac55942e35.js +1 -0
- package/assets/esri/core/workers/chunks/bb9232d9f63ec0c32447.js +1 -0
- package/assets/esri/core/workers/chunks/bbcad2fde838819ffc7b.js +1 -0
- package/assets/esri/core/workers/chunks/bd260798b8de09a1eeb2.js +1 -0
- package/assets/esri/core/workers/chunks/{44d0ca9d4c5f1722688c.js → bf67e0f6064fb9d94ac8.js} +1 -1
- package/assets/esri/core/workers/chunks/bf9eca7dd107bdb06614.js +1 -0
- package/assets/esri/core/workers/chunks/c030a974a63155f450e9.js +1 -0
- package/assets/esri/core/workers/chunks/c0b7b9d115dccb2924ff.js +1 -0
- package/assets/esri/core/workers/chunks/c2db773201adca204f95.js +1 -0
- package/assets/esri/core/workers/chunks/c318e6dbb8651433038f.js +2 -0
- package/assets/esri/core/workers/chunks/c4a2ec2e5897300163ac.js +1 -0
- package/assets/esri/core/workers/chunks/c63b315c6b76b4860fc5.js +1 -0
- package/assets/esri/core/workers/chunks/c8091e8fd7ca43a4490a.js +1 -0
- package/assets/esri/core/workers/chunks/{2413b383b7f2bdcd4ced.js → c8672a54c98d472aa24d.js} +1 -1
- package/assets/esri/core/workers/chunks/cbe8adc100582e746a8c.js +1 -0
- package/assets/esri/core/workers/chunks/d0321dd4b5b2d863eecd.js +1 -0
- package/assets/esri/core/workers/chunks/d523af1db620b5381c99.js +1 -0
- package/assets/esri/core/workers/chunks/d5a0e3a73df827dc7b06.js +1 -0
- package/assets/esri/core/workers/chunks/d670e134348954ce465d.js +1 -0
- package/assets/esri/core/workers/chunks/{886ae23a1d8fa21e531f.js → d750e4abeb777caa8c36.js} +1 -1
- package/assets/esri/core/workers/chunks/{bd36c57dd0cd28dee55f.js → d7acbc2ddff4cee8a465.js} +1 -1
- package/assets/esri/core/workers/chunks/{cb8c4d8334fab9bd9a04.js → d90bc34d97bb21c29c40.js} +1 -1
- package/assets/esri/core/workers/chunks/d9fcc63df008f687848a.js +1 -0
- package/assets/esri/core/workers/chunks/db96a0c66578b2d1b715.js +1 -0
- package/assets/esri/core/workers/chunks/{6a1b6f8c868f8edce1d7.js → dd3b0070081eaf805d95.js} +1 -1
- package/assets/esri/core/workers/chunks/dd5dddf7e422216d3806.js +1 -0
- package/assets/esri/core/workers/chunks/de83c177f8a1234a5b2e.js +1 -0
- package/assets/esri/core/workers/chunks/{07ca020796c57cefda62.js → dfb19701b488089874fd.js} +1 -1
- package/assets/esri/core/workers/chunks/e2f33945d838183a2192.js +1 -0
- package/assets/esri/core/workers/chunks/e3ea4b7217df16592def.js +1 -0
- package/assets/esri/core/workers/chunks/{d97c0c18202b8c578f8c.js → e5471373f89fd7cb9844.js} +1 -1
- package/assets/esri/core/workers/chunks/e65d291bab13f7f5323b.js +1 -0
- package/assets/esri/core/workers/chunks/e95ee94027c1934086d8.js +1 -0
- package/assets/esri/core/workers/chunks/ecbf84a1f42e6188faab.js +1 -0
- package/assets/esri/core/workers/chunks/efaa1d05705f6b450e8f.js +1 -0
- package/assets/esri/core/workers/chunks/efaf998d18479a0380ae.js +1 -0
- package/assets/esri/core/workers/chunks/f0573db9a3d3e1499a7e.js +1 -0
- package/assets/esri/core/workers/chunks/f07722efd7fa2b75d4dd.js +1 -0
- package/assets/esri/core/workers/chunks/{520e0e5307eef27becc6.js → f0924613f818dd165ad9.js} +1 -1
- package/assets/esri/core/workers/chunks/{8b0a01ebc86ab226f01f.js → f23351a04643c464be84.js} +1 -1
- package/assets/esri/core/workers/chunks/f3d331da3c61af5c5a2f.js +1 -0
- package/assets/esri/core/workers/chunks/f3fe865506fd7428eb6d.js +1 -0
- package/assets/esri/core/workers/chunks/{3d20c86f1fe877bf884b.js → f59b76fde2cbd17f64b3.js} +1 -1
- package/assets/esri/core/workers/chunks/f6afc597eaf2afa9a4a0.js +1 -0
- package/assets/esri/core/workers/chunks/{ed2a1c371dfc5d4a744e.js → f7f820483e45c05ab9e4.js} +2 -2
- package/assets/esri/core/workers/chunks/f8cfd0045d06aa24beec.js +1 -0
- package/assets/esri/core/workers/chunks/f98bb3885bfc7f18f26c.js +1 -0
- package/assets/esri/core/workers/chunks/f9b44ff9bb4f7a88ab56.js +1 -0
- package/assets/esri/core/workers/chunks/{b102beeeb7a919f68b51.js → fb81705cec1be2431876.js} +1 -1
- package/assets/esri/core/workers/chunks/fd53ef66176ae164e221.js +1 -0
- package/assets/esri/core/workers/chunks/fd956a58787020d610af.js +1 -0
- package/assets/esri/core/workers/chunks/fdec3a2e100688c42e41.js +1 -0
- package/assets/esri/core/workers/chunks/fe6385115d76e16e8da0.js +1 -0
- package/assets/esri/core/workers/chunks/fedbeb488d5d7c07c7dc.js +1 -0
- package/assets/esri/core/workers/chunks/{d9695794cfaa014a55b1.js → ff00ac01f0baaecaa890.js} +1 -1
- package/assets/esri/libs/parquet/pkg/bundle_bg.wasm +0 -0
- package/assets/esri/themes/base/widgets/_BatchAttributeForm.scss +62 -90
- package/assets/esri/themes/base/widgets/_OrientedImageryViewer.scss +0 -2
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_ar.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_bg.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_bs.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_ca.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_cs.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_da.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_de.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_el.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_es.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_et.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_fi.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_fr.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_he.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_hr.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_hu.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_id.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_it.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_ja.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_ko.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_lt.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_lv.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_nl.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_no.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_pl.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_pt-BR.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_pt-PT.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_ro.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_ru.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_sk.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_sl.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_sr.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_sv.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_th.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_tr.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_uk.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_vi.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_zh-CN.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_zh-HK.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_zh-TW.json +1 -1
- package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_ar.json +1 -1
- package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_bg.json +1 -1
- package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_bs.json +1 -1
- package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_ca.json +1 -1
- package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_cs.json +1 -1
- package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_da.json +1 -1
- package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_de.json +1 -1
- package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_el.json +1 -1
- package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_es.json +1 -1
- package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_et.json +1 -1
- package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_fi.json +1 -1
- package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_fr.json +1 -1
- package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_he.json +1 -1
- package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_hr.json +1 -1
- package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_hu.json +1 -1
- package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_id.json +1 -1
- package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_it.json +1 -1
- package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_ja.json +1 -1
- package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_ko.json +1 -1
- package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_lt.json +1 -1
- package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_lv.json +1 -1
- package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_nl.json +1 -1
- package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_no.json +1 -1
- package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_pl.json +1 -1
- package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_pt-BR.json +1 -1
- package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_pt-PT.json +1 -1
- package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_ro.json +1 -1
- package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_ru.json +1 -1
- package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_sk.json +1 -1
- package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_sl.json +1 -1
- package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_sr.json +1 -1
- package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_sv.json +1 -1
- package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_th.json +1 -1
- package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_tr.json +1 -1
- package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_uk.json +1 -1
- package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_vi.json +1 -1
- package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_zh-CN.json +1 -1
- package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_zh-HK.json +1 -1
- package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_zh-TW.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ar.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_bg.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_bs.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ca.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_cs.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_da.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_de.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_el.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_es.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_et.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_fi.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_fr.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_he.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_hr.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_hu.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_id.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_it.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ja.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ko.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_lt.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_lv.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_nl.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_no.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_pl.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_pt-BR.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_pt-PT.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ro.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ru.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sk.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sl.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sr.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sv.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_th.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_tr.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_uk.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_vi.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_zh-CN.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_zh-HK.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_zh-TW.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ar.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_bg.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_bs.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ca.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_cs.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_da.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_de.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_el.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_es.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_et.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_fi.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_fr.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_he.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_hr.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_hu.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_id.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_it.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ja.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ko.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_lt.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_lv.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_nl.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_no.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pl.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pt-BR.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pt-PT.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ro.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ru.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sk.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sl.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sr.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sv.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_th.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_tr.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_uk.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_vi.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-CN.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-HK.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-TW.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ar.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bg.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bs.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ca.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_cs.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_da.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_de.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_el.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_es.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_et.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fi.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fr.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_he.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hr.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hu.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_id.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_it.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ja.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ko.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lt.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lv.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_nl.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_no.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pl.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-BR.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-PT.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ro.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ru.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sk.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sl.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sr.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sv.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_th.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_tr.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_uk.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_vi.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-CN.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-HK.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-TW.json +1 -1
- package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_ar.json +1 -1
- package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_bg.json +1 -1
- package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_bs.json +1 -1
- package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_ca.json +1 -1
- package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_cs.json +1 -1
- package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_da.json +1 -1
- package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_de.json +1 -1
- package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_el.json +1 -1
- package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_es.json +1 -1
- package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_et.json +1 -1
- package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_fi.json +1 -1
- package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_fr.json +1 -1
- package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_he.json +1 -1
- package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_hr.json +1 -1
- package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_hu.json +1 -1
- package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_id.json +1 -1
- package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_it.json +1 -1
- package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_ja.json +1 -1
- package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_ko.json +1 -1
- package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_lt.json +1 -1
- package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_lv.json +1 -1
- package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_nl.json +1 -1
- package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_no.json +1 -1
- package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_pl.json +1 -1
- package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_pt-BR.json +1 -1
- package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_pt-PT.json +1 -1
- package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_ro.json +1 -1
- package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_ru.json +1 -1
- package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_sk.json +1 -1
- package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_sl.json +1 -1
- package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_sr.json +1 -1
- package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_sv.json +1 -1
- package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_th.json +1 -1
- package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_tr.json +1 -1
- package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_uk.json +1 -1
- package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_vi.json +1 -1
- package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_zh-CN.json +1 -1
- package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_zh-HK.json +1 -1
- package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_zh-TW.json +1 -1
- package/chunks/Bufferer-CclWhXVb.js +2 -0
- package/chunks/Distance2DCalculator-DjIp2uQi.js +2 -0
- package/chunks/Envelope.js +1 -1
- package/chunks/Envelope2D.js +1 -1
- package/chunks/GaussianSplatComposition.glsl.js +1 -1
- package/chunks/GeodeticDistanceCalculator-zRp89-dW.js +2 -0
- package/chunks/GeodeticUtils.js +1 -1
- package/chunks/Geometry.js +1 -1
- package/chunks/{GeometryCleaner-BEJM7I4l.js → GeometryCleaner-CIE8Wfmb.js} +1 -1
- package/chunks/GlowComposition.glsl.js +1 -1
- package/chunks/MultiPathImpl.js +1 -1
- package/chunks/OITBlend.glsl.js +1 -1
- package/chunks/OITDimOpaque.glsl.js +1 -1
- package/chunks/OperatorClip.js +1 -1
- package/chunks/OperatorCrosses.js +1 -1
- package/chunks/OperatorCut.js +1 -1
- package/chunks/OperatorDefinitions.js +1 -1
- package/chunks/OperatorDensify.js +1 -1
- package/chunks/OperatorGeneralize.js +1 -1
- package/chunks/OperatorGeodesicBuffer.js +1 -1
- package/chunks/OperatorGeodeticArea.js +1 -1
- package/chunks/OperatorGeodeticDensifyByLength.js +1 -1
- package/chunks/OperatorGeodeticDistance.js +1 -1
- package/chunks/OperatorGeodeticLength.js +1 -1
- package/chunks/OperatorGraphicBuffer.js +2 -0
- package/chunks/OperatorIntegrate.js +1 -1
- package/chunks/OperatorIntersects.js +1 -1
- package/chunks/OperatorMultiPartToSinglePart.js +1 -1
- package/chunks/OperatorOverlaps.js +1 -1
- package/chunks/OperatorProximity.js +1 -1
- package/chunks/OperatorProximityGeodesic.js +1 -1
- package/chunks/OperatorShapePreservingLength.js +1 -1
- package/chunks/OperatorShapePreservingProject.js +1 -1
- package/chunks/OperatorSimplifyOGC.js +1 -1
- package/chunks/OperatorTouches.js +1 -1
- package/chunks/OperatorWithin.js +1 -1
- package/chunks/Point2D.js +1 -1
- package/chunks/ProjectionTransformation.js +1 -1
- package/chunks/{SideCalculator2D-BNwb5gvz.js → SideCalculator2D-DX0718xq.js} +1 -1
- package/chunks/SimpleGeometryCursor.js +1 -1
- package/chunks/SpatialReference.js +1 -1
- package/chunks/Transformation2D.js +1 -1
- package/chunks/centroidOperator.js +1 -1
- package/chunks/containsOperator.js +1 -1
- package/chunks/disjointOperator.js +1 -1
- package/chunks/distanceOperator.js +1 -1
- package/chunks/equalsOperator.js +1 -1
- package/chunks/languageUtils.js +1 -1
- package/config.js +1 -1
- package/core/has.js +1 -1
- package/core/screenUtils.js +1 -1
- package/editing/types.d.ts +22 -2
- package/form/elements/UtilityNetworkAssociationsElement.d.ts +0 -1
- package/geometry/Mesh.d.ts +1 -1
- package/geometry/operators/extendOperator.js +1 -1
- package/geometry/operators/gx/operatorAffineTransform.js +1 -1
- package/geometry/operators/gx/operatorAlphaShape.js +1 -1
- package/geometry/operators/gx/operatorAutoComplete.js +1 -1
- package/geometry/operators/gx/operatorBoundary.js +1 -1
- package/geometry/operators/gx/operatorBuffer.js +1 -1
- package/geometry/operators/gx/operatorConvexHull.js +1 -1
- package/geometry/operators/gx/operatorDifference.js +1 -1
- package/geometry/operators/gx/operatorGraphicBuffer.js +1 -1
- package/geometry/operators/gx/operatorIntersection.js +1 -1
- package/geometry/operators/gx/operatorLabelPoint.js +1 -1
- package/geometry/operators/gx/operatorLinesToPolygons.js +1 -1
- package/geometry/operators/gx/operatorLocateBetween.js +1 -1
- package/geometry/operators/gx/operatorMinimumBoundingCircle.js +1 -1
- package/geometry/operators/gx/operatorOffset.js +1 -1
- package/geometry/operators/gx/operatorPolygonOverlay.js +1 -1
- package/geometry/operators/gx/operatorPolygonSlicer.js +1 -1
- package/geometry/operators/gx/operatorSinglePartToMultiPart.js +1 -1
- package/geometry/operators/gx/operatorSymmetricDifference.js +1 -1
- package/geometry/operators/gx/operatorUnion.js +1 -1
- package/geometry/operators/isNearOperator.js +1 -1
- package/geometry/operators/json/containsOperator.js +1 -1
- package/geometry/operators/json/disjointOperator.js +1 -1
- package/geometry/operators/reshapeOperator.js +1 -1
- package/geometry/operators/support/apiConverter.js +1 -1
- package/geometry/operators/support/initNoPeFactory.js +1 -1
- package/geometry/operators/support/jsonConverter.js +1 -1
- package/geometry/support/aaBoundingRect.js +1 -1
- package/graphic/AnnotationFeatureGraphicOrigin.d.ts +5 -2
- package/graphic/AnnotationFeatureGraphicOrigin.js +1 -1
- package/graphic/DimensionFeatureGraphicOrigin.js +1 -1
- package/graphic/graphicOrigins.js +1 -1
- package/graphic/isAnnotationFeatureGraphicOrigin.d.ts +29 -0
- package/graphic/isAnnotationFeatureGraphicOrigin.js +2 -0
- package/graphic/isDimensionFeatureGraphicOrigin.d.ts +29 -0
- package/graphic/isDimensionFeatureGraphicOrigin.js +2 -0
- package/interfaces.d.ts +3 -3
- package/kernel.js +1 -1
- package/layers/AnnotationFeatureLayer.d.ts +73 -0
- package/layers/AnnotationFeatureLayer.js +1 -1
- package/layers/FeatureLayer.d.ts +7 -4
- package/layers/FeatureLayer.js +1 -1
- package/layers/Lyr3DWasmPerSceneView.js +1 -1
- package/layers/ParquetLayer.js +1 -1
- package/layers/SubtypeGroupLayer.d.ts +7 -4
- package/layers/SubtypeGroupLayer.js +1 -1
- package/layers/graphics/applyEditsUtils.js +1 -1
- package/layers/graphics/data/QueryEngine.js +1 -1
- package/layers/graphics/sources/FeatureLayerSource.js +1 -1
- package/layers/graphics/sources/MemorySource.js +1 -1
- package/layers/graphics/sources/ParquetSource.js +1 -1
- package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
- package/layers/orientedImagery/core/coverageUtils.js +1 -1
- package/layers/orientedImagery/transformations/utils.js +1 -1
- package/layers/support/{AnnotationSublayer.d.ts → AnnotationFeatureSublayer.d.ts} +12 -12
- package/layers/support/AnnotationFeatureSublayer.js +2 -0
- package/layers/support/EditingCapabilities.js +1 -1
- package/layers/support/ParquetPortalItemData.js +1 -1
- package/layers/support/SubtypeSublayer.d.ts +7 -4
- package/layers/support/SubtypeSublayer.js +1 -1
- package/layers/support/featureLayerUtils.js +1 -1
- package/networks/CircuitManager.d.ts +247 -1
- package/networks/UnitIdentifierManager.d.ts +40 -3
- package/networks/UtilityNetwork.d.ts +0 -11
- package/networks/UtilityNetwork.js +1 -1
- package/networks/support/Circuit.d.ts +0 -1
- package/networks/support/CircuitLocation.d.ts +0 -1
- package/networks/support/CircuitPath.d.ts +0 -1
- package/networks/support/CircuitPathConnectivityElement.d.ts +0 -1
- package/networks/support/CircuitSection.d.ts +0 -1
- package/networks/support/NamedTraceConfiguration.d.ts +1 -7
- package/networks/support/Subcircuit.d.ts +0 -1
- package/networks/support/UNTraceConfiguration.d.ts +0 -4
- package/networks/support/jsonTypes.d.ts +1 -1
- package/networks/support/typeUtils.d.ts +10 -1
- package/networks/support/typeUtils.js +1 -1
- package/package.json +3 -3
- package/popup/Feature.d.ts +57 -6
- package/popup/Features.d.ts +86 -7
- package/popup/content/UtilityNetworkAssociationsContent.d.ts +0 -1
- package/popup/support/UtilityNetworkAssociationType.d.ts +0 -1
- package/rest/networks/circuits/support/CircuitTraceResult.d.ts +0 -1
- package/rest/networks/circuits/support/CircuitVerifyResult.d.ts +0 -1
- package/rest/networks/support/TelecomNetworkElement.d.ts +0 -1
- package/rest/networks/support/TraceLocation.d.ts +1 -11
- package/rest/networks/support/TraceParameters.d.ts +1 -7
- package/rest/networks/support/TraceResult.d.ts +0 -2
- package/rest/networks/support/TraverseAssociationsParameters.d.ts +69 -0
- package/rest/networks/support/TraverseAssociationsParameters.js +2 -0
- package/rest/networks/support/TraverseAssociationsResult.d.ts +39 -0
- package/rest/networks/support/TraverseAssociationsResult.js +2 -0
- package/rest/networks/traverseAssociations.d.ts +21 -0
- package/rest/networks/traverseAssociations.js +2 -0
- package/rest/networks/unitIdentifiers/support/UnitQueryResult.d.ts +0 -1
- package/rest/print.js +1 -1
- package/rest/query/operations/query.js +1 -1
- package/smartMapping/renderers/location.js +1 -1
- package/smartMapping/renderers/opacity.js +1 -1
- package/smartMapping/renderers/predominance.js +1 -1
- package/smartMapping/renderers/support/regenerateUtils.js +1 -1
- package/smartMapping/renderers/support/rendererUtils.d.ts +3 -1
- package/smartMapping/renderers/support/rendererUtils.js +1 -1
- package/smartMapping/support/adapters/FeatureLayerAdapter.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/WebStyleSymbol.js +1 -1
- package/symbols/cim/effects/EffectOffset.js +1 -1
- package/symbols/support/symbolUtils.js +1 -1
- package/symbols/support/webStyleSymbolCache.js +2 -0
- package/third-party-notices.txt +0 -32
- package/undoredo/support/ApplySet.js +1 -1
- package/undoredo/support/ApplySetItem.js +1 -1
- package/views/2d/analysis/AreaMeasurement/AreaMeasurementTool.js +1 -1
- package/views/2d/engine/vectorTiles/VectorTileContainer.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/FeatureInstanceStore.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AAnimatedShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/attributes.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriterVertexPack.js +1 -1
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/2d/engine/webgl/util/AnnotationMatcher.js +1 -1
- package/views/2d/layers/features/layerAdapters/AnnotationLayerAdapter.js +1 -1
- package/views/2d/layers/features/sources/strategies/support/queryAdapters.js +1 -1
- package/views/2d/layers/features/support/FeatureMetadata.js +1 -1
- package/views/2d/layers/features/support/FeatureSetReader.js +1 -1
- package/views/2d/layers/features/support/FeatureSetReaderParquet.js +1 -1
- package/views/2d/layers/support/annodime/annotationGraphic.js +1 -1
- package/views/2d/layers/support/annodime/cimAnnotations.js +1 -1
- package/views/2d/layers/support/annodime/utils.js +1 -1
- package/views/2d/support/hitTestUtils.js +1 -1
- package/views/2d/unitBezier.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightPlacementController.js +2 -0
- package/views/3d/analysis/LineOfSight/LineOfSightReshapeTool3D.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightTool2.js +1 -1
- package/views/3d/analysis/LineOfSight/lineOfSightPlacementUtils.js +2 -0
- package/views/3d/analysis/Viewshed/ViewshedDrawToolRenderer.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedPlacementController.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedPlacementPointPlugin.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedPlacementRootPlugin.js +1 -1
- package/views/3d/analysis/Viewshed/placementUtils.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
- package/views/3d/layers/graphics/Graphics3DSymbol.js +1 -1
- package/views/3d/layers/graphics/SymbolComplexity.js +1 -1
- package/views/3d/layers/graphics/defaultSymbolComplexity.js +1 -1
- package/views/3d/support/QualityProfile.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechnique.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/ShaderOutput.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathEvaluate.glsl.js +14 -6
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexPosition.glsl.js +2 -1
- package/views/3d/webgl-engine/core/shaderLibrary/util/EmissionDimming.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/blit/Blit.js +1 -1
- package/views/3d/webgl-engine/effects/glow/Glow.js +1 -1
- package/views/3d/webgl-engine/effects/transparency/OITBlend.js +1 -1
- package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
- package/views/3d/webgl-engine/lib/OrderIndependentTransparency.js +1 -1
- package/views/3d/webgl-engine/lib/PathEvaluator.js +1 -1
- package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
- package/views/3d/webgl-engine/materials/PolygonOffset.js +1 -1
- package/views/3d/webgl-engine/shaders/HUDMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/OutputColorHighlightOLID.glsl.js +6 -7
- package/views/3d/webgl-engine/shaders/ditherNoise.glsl.js +1 -1
- package/views/LinkChartView.d.ts +3 -1
- package/views/View2D.d.ts +3 -1
- package/views/draw/DrawTool.js +1 -1
- package/views/draw/support/editingSessionUtils.js +1 -1
- package/views/interactive/snapping/SnappingManager.js +1 -1
- package/views/interactive/snapping/candidates/dehydrated/{DehydratedVertexSnappingCandidate.js → DehydratedFeatureSnappingCandidate.js} +1 -1
- package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.d.ts +10 -3
- package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
- package/widgets/BatchAttributeForm/attachmentUtils.d.ts +9 -0
- package/widgets/BatchAttributeForm/attachmentUtils.js +1 -1
- package/widgets/BatchAttributeForm/batchAttributeFormUtils.js +1 -1
- package/widgets/BatchAttributeForm/css.js +1 -1
- package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.d.ts +3 -3
- package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.js +1 -1
- package/widgets/BatchAttributeForm/inputs/BatchFormInputs.js +1 -1
- package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
- package/widgets/BatchAttributeForm/inputs/GroupInput.js +1 -1
- package/widgets/BatchAttributeForm/inputs/InputBase.js +1 -1
- package/widgets/BatchAttributeForm/inputs/RelationshipElementInput.js +1 -1
- package/widgets/BatchAttributeForm/inputs/support/attachmentValidationCriteriaState.d.ts +1 -1
- package/widgets/BatchAttributeForm/inputs/support/createBatchFormInputs.js +1 -1
- package/widgets/BatchAttributeForm/interfaceUtils.js +1 -1
- package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
- package/widgets/BatchAttributeForm/templates/support/hashElementTemplate.js +1 -1
- package/widgets/BatchAttributeForm/types.d.ts +92 -7
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
- package/widgets/Editor/CreateFeaturesWorkflowData.js +1 -1
- package/widgets/Editor/EditorViewModel.d.ts +1 -1
- package/widgets/Editor/EditorViewModel.js +1 -1
- package/widgets/Editor/Edits.js +1 -1
- package/widgets/Editor/MergeFeaturesWorkflow.js +1 -1
- package/widgets/Editor/SplitFeatureWorkflow.js +1 -1
- package/widgets/Editor/UpdateFeatureWorkflow.js +1 -1
- package/widgets/Editor/UpdateFeaturesWorkflow.js +1 -1
- package/widgets/Editor/UpdateRecordWorkflow.js +1 -1
- package/widgets/Editor/UpdateWorkflow.js +1 -1
- package/widgets/Editor/UpdateWorkflowData.js +1 -1
- package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
- package/widgets/Editor/support/EditorItem.js +1 -1
- package/widgets/Editor/support/SketchController.js +1 -1
- package/widgets/Editor/support/attachmentUtils.js +2 -0
- package/widgets/Editor/workflowUtils.js +1 -1
- package/widgets/Editor.js +1 -1
- package/widgets/Feature/FeatureViewModel.d.ts +0 -1
- package/widgets/FeatureForm/UtilityNetworkAssociationInput.d.ts +0 -1
- package/widgets/Features/FeaturesViewModel.d.ts +0 -1
- package/widgets/Features/FeaturesViewModel.js +1 -1
- package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/sketch/MeasurementAdapter.js +1 -1
- package/widgets/OrientedImageryViewer/components/OrientedImageryVideoViewModel.js +1 -1
- package/widgets/OrientedImageryViewer.js +1 -1
- package/widgets/Popup.js +1 -1
- package/widgets/Sketch/SketchViewModel.d.ts +10 -1
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/widgets/Sketch.js +1 -1
- package/widgets/UtilityNetworkTrace/UtilityNetworkTraceViewModel.d.ts +3 -2
- package/widgets/UtilityNetworkTrace/UtilityNetworkTraceViewModel.js +1 -1
- package/widgets/UtilityNetworkTrace/support/GeometryHandler.js +1 -1
- package/assets/components/assets/icon/orientedImageryFullSuperimpose16.json +0 -1
- package/assets/components/assets/icon/orientedImageryFullSuperimpose24.json +0 -1
- package/assets/components/assets/icon/orientedImageryFullSuperimpose32.json +0 -1
- package/assets/components/assets/icon/orientedImageryHalfSuperimpose16.json +0 -1
- package/assets/components/assets/icon/orientedImageryHalfSuperimpose24.json +0 -1
- package/assets/components/assets/icon/orientedImageryHalfSuperimpose32.json +0 -1
- package/assets/components/assets/icon/orientedImagerySceneOnly16.json +0 -1
- package/assets/components/assets/icon/orientedImagerySceneOnly24.json +0 -1
- package/assets/components/assets/icon/orientedImagerySceneOnly32.json +0 -1
- package/assets/components/assets/icon/parquetFeatureLayer16.json +0 -1
- package/assets/components/assets/icon/parquetFeatureLayer24.json +0 -1
- package/assets/components/assets/icon/parquetFeatureLayer32.json +0 -1
- package/assets/esri/core/workers/chunks/013708f40f811158d42c.js +0 -1
- package/assets/esri/core/workers/chunks/01ba5319cac3e0f14205.js +0 -1
- package/assets/esri/core/workers/chunks/03354e9256b2f77fd4f2.js +0 -1
- package/assets/esri/core/workers/chunks/0436fe89adc78696251c.js +0 -1
- package/assets/esri/core/workers/chunks/079b412d07d02504f1db.js +0 -1
- package/assets/esri/core/workers/chunks/0826d36dfbfa28442b70.js +0 -1
- package/assets/esri/core/workers/chunks/0bf72e9d0a6deceeb406.js +0 -1
- package/assets/esri/core/workers/chunks/0ded58ccb83f624f1460.js +0 -1
- package/assets/esri/core/workers/chunks/0ecc1bc1686844cdd60e.js +0 -1
- package/assets/esri/core/workers/chunks/152f1c08197955224ad3.js +0 -1
- package/assets/esri/core/workers/chunks/174cc2e69e5b5a13d880.js +0 -1
- package/assets/esri/core/workers/chunks/181e948d076a9a7aae8a.js +0 -1
- package/assets/esri/core/workers/chunks/18e7784f13a57a75585a.js +0 -1
- package/assets/esri/core/workers/chunks/1c8436b27a3d3cde5cfc.js +0 -1
- package/assets/esri/core/workers/chunks/1d81e667a580c5cdeda1.js +0 -262
- package/assets/esri/core/workers/chunks/1dacc0b64bd27ce2de3a.js +0 -1
- package/assets/esri/core/workers/chunks/1eeb1edca0ad5db6917c.js +0 -1
- package/assets/esri/core/workers/chunks/1effde6a39ef0d4af525.js +0 -1
- package/assets/esri/core/workers/chunks/1f289aa69dd6b6be534a.js +0 -1
- package/assets/esri/core/workers/chunks/27c6def22c2b0791ce9e.js +0 -1
- package/assets/esri/core/workers/chunks/2bc4aff77c830061e16e.js +0 -1
- package/assets/esri/core/workers/chunks/2c3fc2805f6de0963789.js +0 -1
- package/assets/esri/core/workers/chunks/2d2895f1fdf44d212a4d.js +0 -1
- package/assets/esri/core/workers/chunks/2e6382d50bf012064eae.js +0 -1
- package/assets/esri/core/workers/chunks/3248001d9dfb9153699e.js +0 -1
- package/assets/esri/core/workers/chunks/33b4f5dfe1a16b59b010.js +0 -1
- package/assets/esri/core/workers/chunks/36dac6ab51d9dbdd091d.js +0 -1
- package/assets/esri/core/workers/chunks/36dd3ad3ef2fbfc15cbd.js +0 -1
- package/assets/esri/core/workers/chunks/39974d1e5d3820ef1680.js +0 -1
- package/assets/esri/core/workers/chunks/3dc6e9494af16f7b8009.js +0 -1
- package/assets/esri/core/workers/chunks/3ecb906322a6a5c8c93b.js +0 -1
- package/assets/esri/core/workers/chunks/3f67162456a1f02190fa.js +0 -1
- package/assets/esri/core/workers/chunks/42e5e00610f281ca8ffa.js +0 -1
- package/assets/esri/core/workers/chunks/4301cb9670fa7c907460.js +0 -1
- package/assets/esri/core/workers/chunks/493a0981e90a5799fb5b.js +0 -1
- package/assets/esri/core/workers/chunks/4c54cb80c4dc9bbbd395.js +0 -1
- package/assets/esri/core/workers/chunks/4cc78493805671708a9b.js +0 -1
- package/assets/esri/core/workers/chunks/4e4419282c4bf7ee4678.js +0 -1
- package/assets/esri/core/workers/chunks/4e788fc6cb2ea936f676.js +0 -1
- package/assets/esri/core/workers/chunks/4efef5fa8bf23aaf34cd.js +0 -1
- package/assets/esri/core/workers/chunks/5100b5a6a506c704dfaf.js +0 -1
- package/assets/esri/core/workers/chunks/5121768c70f1e03b685c.js +0 -1
- package/assets/esri/core/workers/chunks/52afd43bbe23e358efb5.js +0 -1
- package/assets/esri/core/workers/chunks/52f354bf80ee5ab0379a.js +0 -1
- package/assets/esri/core/workers/chunks/5359ff9492383c5bd9b1.js +0 -1
- package/assets/esri/core/workers/chunks/54d7f07e3348ddb6d9a2.js +0 -1
- package/assets/esri/core/workers/chunks/57b7e5fde972d3ad7884.js +0 -1
- package/assets/esri/core/workers/chunks/597aa39cdb5366ef9a74.js +0 -1
- package/assets/esri/core/workers/chunks/5aba23584e0b230c75f5.js +0 -1
- package/assets/esri/core/workers/chunks/5cb1b950249d651f3837.js +0 -1
- package/assets/esri/core/workers/chunks/5cb274e5759f7ca0d4ed.js +0 -1
- package/assets/esri/core/workers/chunks/5d8924fdcdb473d261cd.js +0 -1
- package/assets/esri/core/workers/chunks/62de9e83331fb10aac6a.js +0 -2
- package/assets/esri/core/workers/chunks/62e77e3c5ca9b4887923.js +0 -2
- package/assets/esri/core/workers/chunks/64114a7d2da162987958.js +0 -1
- package/assets/esri/core/workers/chunks/641cddee377599916de2.js +0 -2
- package/assets/esri/core/workers/chunks/65520a443e3811255bea.js +0 -1
- package/assets/esri/core/workers/chunks/65f02eca694cc1c9f5a7.js +0 -1
- package/assets/esri/core/workers/chunks/6821462e5c1e9c76010a.js +0 -1
- package/assets/esri/core/workers/chunks/6a3d207308b29651f397.js +0 -1
- package/assets/esri/core/workers/chunks/6f5a82388a5eb5fcf1b7.js +0 -1
- package/assets/esri/core/workers/chunks/6f5d61f734ec40dafabb.js +0 -1
- package/assets/esri/core/workers/chunks/737de87bfb9b5f5a9c6c.js +0 -1
- package/assets/esri/core/workers/chunks/7748743d4be047094d67.js +0 -1
- package/assets/esri/core/workers/chunks/78c53aeb0a408ab3c80c.js +0 -1
- package/assets/esri/core/workers/chunks/79f2d4b3af5776ec2045.js +0 -1
- package/assets/esri/core/workers/chunks/7a8ed08cd173963b3112.js +0 -1
- package/assets/esri/core/workers/chunks/7b5c1030a7cf0f382cc4.js +0 -1
- package/assets/esri/core/workers/chunks/7cadb872b9ca96eedca5.js +0 -1
- package/assets/esri/core/workers/chunks/7cee81c5aa1e6b7d2452.js +0 -1
- package/assets/esri/core/workers/chunks/7ed3d6c72f23c628df3b.js +0 -1
- package/assets/esri/core/workers/chunks/80f4f686ce403cb2693f.js +0 -1
- package/assets/esri/core/workers/chunks/8351012ceb466f01b8fd.js +0 -1
- package/assets/esri/core/workers/chunks/859bc873e7af911a518f.js +0 -1
- package/assets/esri/core/workers/chunks/8e99f937fd36cf2cd05f.js +0 -1
- package/assets/esri/core/workers/chunks/93bd56396b8cd020f965.js +0 -1
- package/assets/esri/core/workers/chunks/94fac056e14caed09682.js +0 -1
- package/assets/esri/core/workers/chunks/957f7b8de4aecb6f644e.js +0 -1
- package/assets/esri/core/workers/chunks/97d2bdbea39cbcf8fd0f.js +0 -1
- package/assets/esri/core/workers/chunks/99101789035f1787c630.js +0 -1
- package/assets/esri/core/workers/chunks/9c6d34bb666f630d511f.js +0 -1
- package/assets/esri/core/workers/chunks/a0208e35b217808777c4.js +0 -1
- package/assets/esri/core/workers/chunks/a320998f18922a35899f.js +0 -1
- package/assets/esri/core/workers/chunks/a4e9a17dacbb52444d75.js +0 -1
- package/assets/esri/core/workers/chunks/a4f3bcfabd4ad127abf2.js +0 -1
- package/assets/esri/core/workers/chunks/a5abba59e738c3240c22.js +0 -1
- package/assets/esri/core/workers/chunks/a63bba226de6c5e464b0.js +0 -1
- package/assets/esri/core/workers/chunks/a9f29ff36a7ae5bae686.js +0 -1
- package/assets/esri/core/workers/chunks/aae0049c2c3e15a813e8.js +0 -1
- package/assets/esri/core/workers/chunks/adc32f6b45ea3026fc34.js +0 -1
- package/assets/esri/core/workers/chunks/af8ef6701631ed5e5b80.js +0 -1
- package/assets/esri/core/workers/chunks/b045bffb4f2eb9203183.js +0 -1
- package/assets/esri/core/workers/chunks/b590402170ae289290d7.js +0 -1
- package/assets/esri/core/workers/chunks/b666027b9022fa346a79.js +0 -1
- package/assets/esri/core/workers/chunks/b73c146d3e550eaf07eb.js +0 -1
- package/assets/esri/core/workers/chunks/b803e7b0d489bb628d72.js +0 -1
- package/assets/esri/core/workers/chunks/bb24972603fb35dd8dcf.js +0 -1
- package/assets/esri/core/workers/chunks/bcc097271f5cdf0a97a7.js +0 -1
- package/assets/esri/core/workers/chunks/c0cbc50e5afd68bd485c.js +0 -1
- package/assets/esri/core/workers/chunks/c2cd80b712f29e8cbb8d.js +0 -1
- package/assets/esri/core/workers/chunks/c3ff2ff0a86a9143d7a5.js +0 -1
- package/assets/esri/core/workers/chunks/c6d0b4875b6b8d6bc25a.js +0 -1
- package/assets/esri/core/workers/chunks/c9a4601073e1a3eee9d0.js +0 -1
- package/assets/esri/core/workers/chunks/cf41a66fb97c1076fb34.js +0 -1
- package/assets/esri/core/workers/chunks/cf8ce21dc649021e97f6.js +0 -1
- package/assets/esri/core/workers/chunks/d78b7cac322755e87eb8.js +0 -1
- package/assets/esri/core/workers/chunks/dddb57ff637643ccfc87.js +0 -1
- package/assets/esri/core/workers/chunks/df18b0a653b328d8d052.js +0 -1
- package/assets/esri/core/workers/chunks/e1bf87077541da6853c6.js +0 -1
- package/assets/esri/core/workers/chunks/e3b713a590cce6245ee2.js +0 -1
- package/assets/esri/core/workers/chunks/e4406baf206b9e4c7e4f.js +0 -1
- package/assets/esri/core/workers/chunks/e499252cb52f7aed49a0.js +0 -1
- package/assets/esri/core/workers/chunks/e4e2f479c0c45ae1b2c3.js +0 -1
- package/assets/esri/core/workers/chunks/e5f8c73349407c25956b.js +0 -1
- package/assets/esri/core/workers/chunks/e656fd5ecf9ac059a87b.js +0 -1
- package/assets/esri/core/workers/chunks/e92698f50089484c4901.js +0 -1
- package/assets/esri/core/workers/chunks/e9c5c295b6bf10e942a4.js +0 -1
- package/assets/esri/core/workers/chunks/eb91dc957c328674e119.js +0 -1
- package/assets/esri/core/workers/chunks/ed3d16a5b4084ef61f8a.js +0 -1
- package/assets/esri/core/workers/chunks/edcde00495727d506c46.js +0 -1
- package/assets/esri/core/workers/chunks/efb4aa5886730ea377bd.js +0 -1
- package/assets/esri/core/workers/chunks/f0832b413612c77a62ca.js +0 -1
- package/assets/esri/core/workers/chunks/f116331c6eca937aac8e.js +0 -1
- package/assets/esri/core/workers/chunks/f23e995320674b32e142.js +0 -1
- package/assets/esri/core/workers/chunks/f334bf192dff5af10a70.js +0 -1
- package/assets/esri/core/workers/chunks/f518835b2dc89a48cfb1.js +0 -1
- package/assets/esri/core/workers/chunks/f5731ad4cfbbf1cc569a.js +0 -2
- package/assets/esri/core/workers/chunks/f76b1fc36f5606cac2c8.js +0 -1
- package/assets/esri/core/workers/chunks/f7fca88d120d45bb782a.js +0 -1
- package/assets/esri/core/workers/chunks/f819854098d63fe4ccdb.js +0 -1
- package/assets/esri/core/workers/chunks/f98118127469449ca145.js +0 -1
- package/assets/esri/core/workers/chunks/f9e22cf59e2e2782d70f.js +0 -1
- package/assets/esri/core/workers/chunks/fa1336b60278017d2525.js +0 -1
- package/assets/esri/core/workers/chunks/fbe7dae0b4bf2d172487.js +0 -1
- package/assets/esri/core/workers/chunks/fea3b6bef761ef78630e.js +0 -1
- package/chunks/Bufferer-Dw9Qi4T1.js +0 -2
- package/chunks/Distance2DCalculator-CXhBP-8I.js +0 -2
- package/chunks/GeodeticDistanceCalculator-Ce-woMPw.js +0 -2
- package/layers/support/AnnotationSublayer.js +0 -2
- package/views/3d/analysis/LineOfSight/LineOfSightPlacementTool.js +0 -2
- /package/assets/esri/core/workers/chunks/{d9d4754062758789f186.js.LICENSE.txt → 05016e5a1de384994001.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{62e77e3c5ca9b4887923.js.LICENSE.txt → 0d42322362e76f674d94.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{62de9e83331fb10aac6a.js.LICENSE.txt → 35533c8ef541f7643497.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{641cddee377599916de2.js.LICENSE.txt → 99c002015c2127e6cbfc.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{f5731ad4cfbbf1cc569a.js.LICENSE.txt → c318e6dbb8651433038f.js.LICENSE.txt} +0 -0
- /package/chunks/{Centroid-DZi-eb9F.js → Centroid-CA-TwbbN.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[6061,7371],{61691(e,t,s){s.d(t,{G:()=>i});class i{*[Symbol.iterator](){let e=this.next();for(;e;)yield e,e=this.next()}}},76061(e,t,s){s.d(t,{S:()=>r});var i=s(61691);class r extends i.G{m_aGeoms;m_iGeom=-1;constructor(e){super(),this.m_aGeoms=e?e.slice():[]}next(){if(this.m_iGeom<this.m_aGeoms.length-1){const e=this.m_aGeoms[++this.m_iGeom];return this.m_aGeoms[this.m_iGeom]=null,e}return null}tock(){return!1}getGeometryID(){return this.m_iGeom}getRank(){return 1}}},563(e,t,s){s.d(t,{QueueProcessor:()=>l,SharedConcurrency:()=>u});var i=s(97768),r=s(17676),n=s(9775),o=s(32587),a=s(76030),c=s(44794);class l{constructor(e){this._schedule=null,this._deferreds=new o.A,this._controllers=new o.A,this._processingItems=new o.A,this._pausedSignal=(0,c.v)(!1),this.process=e.process,this.concurrency=e.concurrency,this.sharedConcurrency=e.sharedConcurrency??d,this._queue=new n.A(e.peeker)}destroy(){this.clear(),this._schedule=(0,i.xt)(this._schedule)}get updating(){return this.running}get length(){return this._processingItems.size+this._queue.length}get running(){return!this._pausedSignal.value&&this._queue.length>0&&!this.full}get full(){return this._processingItems.size>=this.concurrency||this.sharedConcurrency.full}abort(e){const t=this._controllers.get(e);t?.abort()}clear(){this._queue.clear();const e=Array.from(this._controllers.values());this._controllers.clear(),e.forEach(e=>e.abort()),this.sharedConcurrency.current.value-=this._processingItems.size,this._processingItems.clear(),this._cancelNext()}forEach(e){this._deferreds.forEach((t,s)=>e(s))}_get(e){const t=this._deferreds.get(e);return t?.promise}pause(){this._pausedSignal.value||(this._pausedSignal.value=!0,this._cancelNext())}push(e,t){const s=this._get(e);if(s)return s;const i=new AbortController,n=Promise.withResolvers(),o=t?(0,r.u7)(t,()=>i.abort()):null,a=(0,r.NY)(i.signal,()=>{const t=this._processingItems.get(e);t&&t.controller.abort(),c(),n.reject((0,r.NK)())}),c=()=>{a.remove(),o?.remove(),this._removeItem(e),this._queue.remove(e),this._scheduleNext()};return this._deferreds.set(e,n),this._controllers.set(e,i),n.promise.then(c,c),this._queue.push(e),this._scheduleNext(),n.promise}last(){return this._queue.last()}reset(){const e=Array.from(this._processingItems.values());this.sharedConcurrency.current.value-=this._processingItems.size,this._processingItems.clear();for(const t of e)this._queue.push(t.item),t.controller.abort();this._scheduleNext()}resume(){this._pausedSignal.value&&(this._pausedSignal.value=!1,this._scheduleNext())}takeAll(){const e=[];for(;this._queue.length;)e.push(this._queue.pop());return this.clear(),e}_removeItem(e){this._deferreds.delete(e),this._controllers.delete(e),this._processingItems.has(e)&&(this._processingItems.delete(e),this.sharedConcurrency.current.value-=1)}_scheduleNext(){this._pausedSignal.value||this._schedule||(this._schedule=(0,a._)(()=>{this._schedule=null,this._next()}))}_next(){for(;this._queue.length>0&&this._processingItems.size<this.concurrency&&!this.sharedConcurrency.full;)this._process(this._queue.pop())}_cancelNext(){this._schedule&&(this._schedule.remove(),this._schedule=null)}_processResult(e,t){this._canProcessFulfillment(e)&&(this._scheduleNext(),this._deferreds.get(e.item).resolve(t))}_processError(e,t){this._canProcessFulfillment(e)&&(this._scheduleNext(),this._deferreds.get(e.item).reject(t))}_canProcessFulfillment(e){return!!this._deferreds.get(e.item)&&this._processingItems.get(e.item)===e}_process(e){if(null==e)return;let t;const s=new AbortController,i=new h(e,s);this._processingItems.set(e,i),this.sharedConcurrency.current.value+=1;try{t=this.process(e,s.signal)}catch(e){this._processError(i,e)}(0,r.$X)(t)?(i.promise=t,t.then(e=>this._processResult(i,e),e=>this._processError(i,e))):this._processResult(i,t)}}class h{constructor(e,t){this.item=e,this.controller=t,this.promise=null}}class u{constructor(e){this.limit=e,this.current=(0,c.v)(0)}get full(){return this.current.value>=this.limit}}const d=new u(1/0)},32587(e,t,s){s.d(t,{A:()=>n});var i=s(62788),r=s(95488);class n{constructor(e){this._observable=new r.I,this._notifyPending=!1,this._batchDepth=0,this._map=new Map(e)}get size(){return(0,i.gc)(this._observable),this._map.size}batch(e){try{this._batchDepth++,e()}finally{this._batchDepth--,this._notifyPending&&0===this._batchDepth&&(this._notifyPending=!1,this._notify())}}clear(){this._map.size>0&&(this._map.clear(),this._notify())}delete(e){const t=this._map.delete(e);return t&&this._notify(),t}entries(){return(0,i.gc)(this._observable),this._map.entries()}forEach(e,t){(0,i.gc)(this._observable),this._map.forEach((s,i)=>e.call(t,s,i,this),t)}get(e){return(0,i.gc)(this._observable),this._map.get(e)}has(e){return(0,i.gc)(this._observable),this._map.has(e)}keys(){return(0,i.gc)(this._observable),this._map.keys()}set(e,t){return this._map.set(e,t),this._notify(),this}transformValues(e,t=this._map.keys()){this.batch(()=>{for(const s of t){if(!this._map.has(s))continue;const t=this._map.get(s),i=e(t,s);i!==t&&this.set(s,i)}})}values(){return(0,i.gc)(this._observable),this._map.values()}[Symbol.iterator](){return(0,i.gc)(this._observable),this._map[Symbol.iterator]()}[Symbol.dispose](){this._observable.destroy()}get[Symbol.toStringTag](){return this._map[Symbol.toStringTag]}_notify(){this._batchDepth>0?this._notifyPending=!0:this._observable.notify()}}},67482(e,t,s){function i(e){return null!=a(e)||null!=o(e)}function r(e){return c.test(e)}function n(e){return a(e)??o(e)}function o(e){const t=new Date(e);return function(e,t){if(Number.isNaN(e.getTime()))return!1;let s=!0;if(h&&/\d+\W*$/.test(t)){const e=t.match(/[a-zA-Z]{2,}/);if(e){let t=!1,i=0;for(;!t&&i<=e.length;)t=!l.test(e[i]),i++;s=!t}}return s}(t,e)?Number.isNaN(t.getTime())?null:t.getTime()-6e4*t.getTimezoneOffset():null}function a(e){const t=c.exec(e);if(!t?.groups)return null;const s=t.groups,i=+s.year,r=+s.month-1,n=+s.day,o=+(s.hours??"0"),a=+(s.minutes??"0"),l=+(s.seconds??"0");if(o>23)return null;if(a>59)return null;if(l>59)return null;const h=s.ms??"0",u=h?+h.padEnd(3,"0").slice(0,3):0;let d;if(s.isUTC||!s.offsetSign)d=Date.UTC(i,r,n,o,a,l,u);else{const e=+s.offsetHours,t=+s.offsetMinutes;d=6e4*("+"===s.offsetSign?-1:1)*(60*e+t)+Date.UTC(i,r,n,o,a,l,u)}return Number.isNaN(d)?null:d}s.d(t,{Br:()=>r,Cq:()=>i,_U:()=>n});const c=/^(?:(?<year>-?\d{4,})-(?<month>\d{2})-(?<day>\d{2}))(?:T(?<hours>\d{2}):(?<minutes>\d{2}):(?<seconds>\d{2})(?:\.(?<ms>\d+))?)?(?:(?<isUTC>Z)|(?:(?<offsetSign>\+|-)(?<offsetHours>\d{2}):(?<offsetMinutes>\d{2})))?$/,l=/^((jan(uary)?)|(feb(ruary)?)|(mar(ch)?)|(apr(il)?)|(may)|(jun(e)?)|(jul(y)?)|(aug(ust)?)|(sep(tember)?)|(oct(ober)?)|(nov(ember)?)|(dec(ember)?)|(am)|(pm)|(gmt)|(utc))$/i,h=!Number.isNaN(new Date("technology 10").getTime())},15585(e,t,s){s.d(t,{If:()=>p,O5:()=>y,O9:()=>m,QT:()=>_,l3:()=>f});var i=s(5482),r=s(2741),n=s(49186),o=s(44208),a=s(34727);let c=null,l=null,h=null,u=null;const d=(new Float32Array(0),new Uint32Array(0),new Uint32Array(0),new Uint32Array(0),{vertices:new Float64Array(0),indices:new Uint32Array(0),outlineIndices:new Uint32Array(0),outlineRingLengths:new Uint32Array(0),vertexCount:0,indexCount:0,outlineIndexCount:0,outlineRingCount:0});async function p(){return c??=async function(){const e=await s.e(2997).then(s.bind(s,42997)),t=await e.default({locateFile:e=>(0,r.s)(`esri/core/libs/libtess/${e}`)});h=t}(),c}async function f(){return l??=async function(){const e=await s.e(9134).then(s.bind(s,99134)),t=await e.default({locateFile:e=>(0,r.s)(`esri/core/libs/libtess/${e}`)});u=t}(),l}function m(){return null!==u}function _(e,t,s=2){const r={stack:[],error:void 0,hasError:!1};try{const a=h;if(!a)throw new n.A("libtess:not-loaded","libtessF32 not loaded");const c=(0,i.mS)(r,w.from(a,e),!1),l=(0,i.mS)(r,I.from(a,t),!1),u=e.length/s*4,d=(0,i.mS)(r,new w(a,u*s),!1),p=a.triangulate(c.ptr,l.ptr,l.size,s,d.ptr,u);if((0,o.A)("esri-tessellation-debug")){const e=a.getError();0!==e&&console.warn("libtess:triangulation",S(e))}return{buffer:d.slice(0,p*s),vertexCount:p}}catch(e){r.error=e,r.hasError=!0}finally{(0,i.hk)(r)}}function y(e,t,s=2,r=!0){const c={stack:[],error:void 0,hasError:!1};try{const l=u;if(!l)throw new n.A("libtess:not-loaded","libtessF64 not loaded");const h=(0,i.mS)(c,v.from(l,e),!1),p=(0,i.mS)(c,I.from(l,t),!1),f=(0,i.mS)(c,new I(l,1),!1),m=(0,i.mS)(c,new I(l,1),!1),_=(0,i.mS)(c,new I(l,1),!1),y=(0,i.mS)(c,new I(l,1),!1),{maxVertexCount:g,maxIndexCount:x,maxOutlineIndexCount:w,maxOutlineRingCount:k}=function(e,t){const s=e.reduce((e,t)=>e+t,0),i=e.length,r=Math.max(0,e.length-1),n=Math.max(0,s+2*r-2),o=Math.max(0,Math.ceil(2*s)),c=Math.max(0,Math.ceil(3*n*2)),l=(0,a.mP)(c,3),h=s>0?Math.max(2,Math.ceil(.25*s)):0,u=s>0?Math.max(1,Math.ceil(h/3)):0;return{maxVertexCount:o,maxIndexCount:l,maxOutlineIndexCount:t?Math.max(0,s+i+h):0,maxOutlineRingCount:t?Math.max(0,i+u):0}}(t,r);let M=0,T=0,A=0,P=0,C=0;{const e={stack:[],error:void 0,hasError:!1};try{const t=(0,i.mS)(e,new v(l,g*s),!1),n=(0,i.mS)(e,new I(l,x),!1),o=(0,i.mS)(e,r?new I(l,w):null,!1),a=(0,i.mS)(e,r?new I(l,k):null,!1);if(l.triangulateIndexed(h.ptr,p.ptr,p.size,s,t.ptr,g,s,n.ptr,x,f.ptr,m.ptr,o?.ptr??0,w,a?.ptr??0,k,_.ptr,y.ptr),C=l.getError(),M=b(l)[f.ptr/Int32Array.BYTES_PER_ELEMENT],T=b(l)[m.ptr/Int32Array.BYTES_PER_ELEMENT],A=b(l)[_.ptr/Int32Array.BYTES_PER_ELEMENT],P=b(l)[y.ptr/Int32Array.BYTES_PER_ELEMENT],0===C){const e=t.slice(0,M*s);return{vertices:e,indices:n.slice(0,T),outlineIndices:r&&o?o.slice(0,A):d.outlineIndices,outlineRingLengths:r&&a?a.slice(0,P):d.outlineRingLengths,vertexCount:M,indexCount:T,outlineIndexCount:r?A:0,outlineRingCount:r?P:0}}}catch(t){e.error=t,e.hasError=!0}finally{(0,i.hk)(e)}}if(100903!==C)return(0,o.A)("esri-tessellation-debug")&&console.warn("libtess:triangulation",S(C)),d;const F=(0,i.mS)(c,new v(l,M*s),!1),E=(0,i.mS)(c,new I(l,T),!1),R=(0,i.mS)(c,r?new I(l,A):null,!1),z=(0,i.mS)(c,r?new I(l,P):null,!1);if(l.triangulateIndexed(h.ptr,p.ptr,p.size,s,F.ptr,M,s,E.ptr,T,f.ptr,m.ptr,R?.ptr??0,r?A:0,z?.ptr??0,r?P:0,_.ptr,y.ptr),C=l.getError(),0!==C)return(0,o.A)("esri-tessellation-debug")&&console.warn("libtess:triangulation",S(C)),d;const O=b(l)[f.ptr/Int32Array.BYTES_PER_ELEMENT],L=b(l)[m.ptr/Int32Array.BYTES_PER_ELEMENT],D=b(l)[_.ptr/Int32Array.BYTES_PER_ELEMENT],N=b(l)[y.ptr/Int32Array.BYTES_PER_ELEMENT],q=F.slice(0,O*s);return{vertices:q,indices:E.slice(0,L),outlineIndices:r&&R?R.slice(0,D):d.outlineIndices,outlineRingLengths:r&&z?z.slice(0,N):d.outlineRingLengths,vertexCount:O,indexCount:L,outlineIndexCount:r?D:0,outlineRingCount:r?N:0}}catch(e){c.error=e,c.hasError=!0}finally{(0,i.hk)(c)}}function g(e){return e.HEAPF64}function x(e){return e.HEAPF32}function b(e){return e.HEAP32}class w{static from(e,t){const s=new w(e,t.length);return s.set(t),s}constructor(e,t){this._libtess=e,this.size=t,this.ptr=e.allocateCoordinateArray(t)}destroy(){this._libtess.destroyCoordinateArray(this.ptr)}[Symbol.dispose](){this.destroy()}get bytesPerCoordinate(){return Float32Array.BYTES_PER_ELEMENT}set(e){x(this._libtess).set(e,this.ptr/this.bytesPerCoordinate)}slice(e,t){const s=this.ptr/this.bytesPerCoordinate;return x(this._libtess).slice(s+e,s+t)}}class v{static from(e,t){const s=new v(e,t.length);return s.set(t),s}constructor(e,t){this._libtess=e,this.size=t,this.ptr=e.allocateCoordinateArray(t)}destroy(){this._libtess.destroyCoordinateArray(this.ptr)}[Symbol.dispose](){this.destroy()}get bytesPerCoordinate(){return Float64Array.BYTES_PER_ELEMENT}set(e){g(this._libtess).set(e,this.ptr/this.bytesPerCoordinate)}slice(e,t){const s=this.ptr/this.bytesPerCoordinate;return g(this._libtess).slice(s+e,s+t)}}class I{static from(e,t){const s=new I(e,t.length);return s.set(t),s}constructor(e,t){this._libtess=e,this.size=t,this.ptr=e.allocateLengthsArray(t)}destroy(){this._libtess.destroyLengthsArray(this.ptr)}[Symbol.dispose](){this.destroy()}get bytesPerCoordinate(){return Int32Array.BYTES_PER_ELEMENT}set(e){b(this._libtess).set(e,this.ptr/this.bytesPerCoordinate)}slice(e,t){const s=this.ptr/this.bytesPerCoordinate;return function(e){const t=b(e);return new Uint32Array(t.buffer,t.byteOffset,t.length)}(this._libtess).slice(s+e,s+t)}}function S(e){switch(e){case 100903:return"Insufficient output buffer";case 100902:return"Out of memory";case 100151:return"Missing begin polygon";case 100152:return"Missing begin contour";case 100153:return"Missing end polygon";case 100154:return"Missing end countour";case 100155:return"Coordinates too large";case 100156:return"Missing combine callback";default:return`Unknown: ${e}`}}},77085(e,t,s){s.d(t,{Hh:()=>a,fz:()=>h,g7:()=>c,s1:()=>o,zo:()=>l});var i=s(76061),r=s(83290);let n;function o(){return!!n&&(0,r.i)()}async function a(){if(!o()){const[e,t]=await Promise.all([Promise.all([s.e(3661),s.e(1878),s.e(8885),s.e(5756),s.e(1088)]).then(s.bind(s,31088)),Promise.all([s.e(3661),s.e(1878),s.e(8885),s.e(5756)]).then(s.bind(s,15756)).then(e=>e.aP).then(({injectPe:e})=>e),(0,r.l)()]);n=new e.OperatorGeodeticDensifyByLength,t(r.p)}}function c(e,t,s,i){return n.execute(e,t,s,i,null)}function l(e,t,s,r){const o=n.executeMany(new i.S(e),t,s,r,null);return Array.from(o)}function h(){return n.supportsCurves()}},5808(e,t,s){s.d(t,{O:()=>i});const i={geodesic:0,loxodrome:1,"great-elliptic":2,"normal-section":3,"shape-preserving":4}},89056(e,t,s){s.d(t,{b3:()=>u,jZ:()=>h});var i=s(12195),r=s(19419),n=s(537),o=s(95108),a=s(60408),c=s(80754),l=s(21325);function h(e){return d(e,!0)}function u(e){return d(e,!1)}function d(e,t){if(null==e)return null;const s=e.spatialReference,r=(0,l.Vp)(s),o=(0,i.W)(e)?e.toJSON():e;if(!r)return o;const h=(0,l.K8)(s)?102100:4326,u=c.j7[h].maxX,d=c.j7[h].minX;if((0,a.fT)(o))return f(o,u,d);if((0,a.U9)(o))return o.points=o.points.map(e=>f(e,u,d)),o;if((0,a.ZC)(o))return p(o,r);if((0,a.Bi)(o)||(0,a.Rg)(o)){const e=(0,n.Rg)(b,o),s={xmin:e[0],ymin:e[1],xmax:e[2],ymax:e[3]},i=(0,c.kd)(s.xmin,d)*(2*u),r=0===i?o:(0,c.kS)(o,i);return s.xmin+=i,s.xmax+=i,s.xmax>u?g(r,u,t):s.xmin<d?g(r,d,t):r}return o}function p(e,t){if(!t)return e;const s=function(e,t){const s=[],{ymin:i,ymax:r,xmin:n,xmax:o}=e,a=e.xmax-e.xmin,[c,l]=t.valid,{x:h,frameId:u}=m(e.xmin,t),{x:d,frameId:p}=m(e.xmax,t),f=h===d&&a>0;if(a>2*l){const e={xmin:n<o?h:d,ymin:i,xmax:l,ymax:r},t={xmin:c,ymin:i,xmax:n<o?d:h,ymax:r},a={xmin:0,ymin:i,xmax:l,ymax:r},f={xmin:c,ymin:i,xmax:0,ymax:r},m=[],y=[];_(e,a)&&m.push(u),_(e,f)&&y.push(u),_(t,a)&&m.push(p),_(t,f)&&y.push(p);for(let e=u+1;e<p;e++)m.push(e),y.push(e);s.push(new x(e,[u]),new x(t,[p]),new x(a,m),new x(f,y))}else h>d||f?s.push(new x({xmin:h,ymin:i,xmax:l,ymax:r},[u]),new x({xmin:c,ymin:i,xmax:d,ymax:r},[p])):s.push(new x({xmin:h,ymin:i,xmax:d,ymax:r},[u]));return s}(e,t).map(e=>e.extent);return s.length<2?s[0]||e:s.length>2?(e.xmin=t.valid[0],e.xmax=t.valid[1],e):{rings:s.map(e=>[[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]])}}function f(e,t,s){if(Array.isArray(e)){const i=e[0];if(i>t){const s=(0,c.kd)(i,t);e[0]=i+s*(-2*t)}else if(i<s){const t=(0,c.kd)(i,s);e[0]=i+t*(-2*s)}}else{const i=e.x;if(i>t){const s=(0,c.kd)(i,t);e.x+=s*(-2*t)}else if(i<s){const t=(0,c.kd)(i,s);e.x+=t*(-2*s)}}return e}function m(e,t){const[s,i]=t.valid,r=2*i;let n,o=0;return e>i?(n=Math.ceil(Math.abs(e-i)/r),e-=n*r,o=n):e<s&&(n=Math.ceil(Math.abs(e-s)/r),e+=n*r,o=-n),{x:e,frameId:o}}function _(e,t){const{xmin:s,ymin:i,xmax:r,ymax:n}=t;return y(e,s,i)&&y(e,s,n)&&y(e,r,n)&&y(e,r,i)}function y(e,t,s){return t>=e.xmin&&t<=e.xmax&&s>=e.ymin&&s<=e.ymax}function g(e,t,s=!0){const i=!(0,a.Rg)(e);if(i&&(0,o.m3)(e),s)return(new w).cut(e,t);const r=i?e.rings:e.paths,n=i?4:2,c=r.length,l=-2*t;for(let e=0;e<c;e++){const t=r[e];if(t&&t.length>=n){const e=[];for(const[s,...i]of t)e.push([s+l,...i]);r.push(e)}}return i?e.rings=r:e.paths=r,e}class x{constructor(e,t){this.extent=e,this.frameIds=t}}const b=(0,r.vt)();class w{constructor(){this._linesIn=[],this._linesOut=[]}cut(e,t){let s;if(this._xCut=t,e.rings)this._closed=!0,s=e.rings,this._minPts=4;else{if(!e.paths)return null;this._closed=!1,s=e.paths,this._minPts=2}for(const e of s){if(!e||e.length<this._minPts)continue;let t=!0;for(const s of e)t?(this.moveTo(s),t=!1):this.lineTo(s);this._closed&&this.close()}this._pushLineIn(),this._pushLineOut(),s=[];for(const e of this._linesIn)e&&e.length>=this._minPts&&s.push(e);const i=-2*this._xCut;for(const e of this._linesOut)if(e&&e.length>=this._minPts){for(const t of e)t[0]+=i;s.push(e)}return this._closed?e.rings=s:e.paths=s,e}moveTo(e){this._pushLineIn(),this._pushLineOut(),this._prevSide=this._side(e[0]),this._moveTo(e[0],e[1],this._prevSide),this._prevPt=e,this._firstPt=e}lineTo(e){const t=this._side(e[0]);if(t*this._prevSide===-1){const s=this._intersect(this._prevPt,e);this._lineTo(this._xCut,s,0),this._prevSide=0,this._lineTo(e[0],e[1],t)}else this._lineTo(e[0],e[1],t);this._prevSide=t,this._prevPt=e}close(){const e=this._firstPt,t=this._prevPt;e[0]===t[0]&&e[1]===t[1]||this.lineTo(e),this._checkClosingPt(this._lineIn),this._checkClosingPt(this._lineOut)}_moveTo(e,t,s){this._closed?(this._lineIn.push([s<=0?e:this._xCut,t]),this._lineOut.push([s>=0?e:this._xCut,t])):(s<=0&&this._lineIn.push([e,t]),s>=0&&this._lineOut.push([e,t]))}_lineTo(e,t,s){this._closed?(v(this._lineIn,s<=0?e:this._xCut,t),v(this._lineOut,s>=0?e:this._xCut,t)):s<0?(0===this._prevSide&&this._pushLineOut(),this._lineIn.push([e,t])):s>0?(0===this._prevSide&&this._pushLineIn(),this._lineOut.push([e,t])):this._prevSide<0?(this._lineIn.push([e,t]),this._lineOut.push([e,t])):this._prevSide>0&&(this._lineOut.push([e,t]),this._lineIn.push([e,t]))}_checkClosingPt(e){const t=e.length;t>3&&e[0][0]===this._xCut&&e[t-2][0]===this._xCut&&e[1][0]===this._xCut&&(e[0][1]=e[t-2][1],e.pop())}_side(e){return e<this._xCut?-1:e>this._xCut?1:0}_intersect(e,t){const s=(this._xCut-e[0])/(t[0]-e[0]);return e[1]+s*(t[1]-e[1])}_pushLineIn(){this._lineIn&&this._lineIn.length>=this._minPts&&this._linesIn.push(this._lineIn),this._lineIn=[]}_pushLineOut(){this._lineOut&&this._lineOut.length>=this._minPts&&this._linesOut.push(this._lineOut),this._lineOut=[]}}function v(e,t,s){const i=e.length;i>1&&e[i-1][0]===t&&e[i-2][0]===t?e[i-1][1]=s:e.push([t,s])}},37730(e,t,s){s.d(t,{T:()=>r});var i=s(43334);const r={getObjectId:e=>e.objectId,getAttributes:e=>e.attributes,getAttribute:(e,t)=>e.attributes[t],cloneWithGeometry:(e,t,s)=>new i.Om(t,e.attributes,null,e.objectId,e.displayId,e.distance,e.vertexCount),getGeometry:e=>e.geometry,getCentroid:(e,t)=>e.ensureCentroid(t)}},60986(e,t,s){s.r(t),s.d(t,{createConnection:()=>A});var i=s(11254),r=s(49186),n=s(31464),o=s(9916),a=s(5482),c=s(65529),l=s(91429);let h=class extends c.nJ{destroy(){this.emit("destroy")}get connectionError(){return this.errorString?new r.A("stream-connection",this.errorString):null}onFeature(e){this.emit("data-received",e)}onMessage(e){this.emit("message-received",e)}};(0,a.Cg)([(0,l.MZ)({readOnly:!0})],h.prototype,"connectionError",null),h=(0,a.Cg)([(0,l.$K)("esri.layers.support.StreamConnection")],h);class u extends h{constructor(e,t){super(),this._config=e,this._outSpatialReference=t,this.connectionStatus="connected",this.errorString=null,this._isPolling=!1,this._lastIngestedAt=null,this._pollTimer=null,this._pollRecentData=async()=>{if(!this.destroyed&&!this._isPolling){this._isPolling=!0;try{const e=await this._queryChanges(this._lastIngestedAt);if(this.destroyed)return;this._handleResult(e)}catch(e){this.errorString=e instanceof Error?e.message:"Failed to fetch"}finally{this._isPolling=!1}}},this._initialize()}destroy(){super.destroy(),this._pollTimer&&(clearInterval(this._pollTimer),this._pollTimer=null)}sendMessageToSocket(e){throw new r.A("kusto:unsupported","sendMessageToSocket not supported for Kusto connections")}sendMessageToClient(e){throw new r.A("kusto:unsupported","sendMessageToClient not supported for Kusto connections")}updateCustomParameters(e){throw new r.A("kusto:unsupported","updateCustomParameters not supported for Kusto connections")}async _initialize(){await(0,n.Nk)(this._config.sourceSpatialReference,this._outSpatialReference);try{const e=await this._queryInitial();this._handleResult(e),this._pollTimer=setInterval(this._pollRecentData,6e4*this._config.refreshInterval)}catch{throw new r.A("kusto:connection","Failed to query KQL database")}}async _queryInitial(){const{trackIdField:e}=this._config,t=d(await this._executeQuery(`${(0,o.xw)(this._config.table)} | extend IngestedAt = ingestion_time() | summarize arg_max(IngestedAt, *) by ${(0,o.xw)(e)}`));if(!t)throw new r.A("kusto:connection","Unable to find primaryTable");return{ingestedAt:p(t),table:t}}async _queryChanges(e=null){const t=e??"1970-01-01T00:00:00Z",s=d(await this._executeQuery(`${(0,o.xw)(this._config.table)} | extend IngestedAt = ingestion_time() | where IngestedAt > todatetime('${(0,o.iD)(t)}') | order by IngestedAt asc`));if(!s)throw new r.A("kusto:connection","Unable to find primaryTable");return{ingestedAt:p(s),table:s}}async _executeQuery(e){const t=this._config.database,s=t.properties.queryServiceUri,{data:r}=await(0,i.A)(`${s}/v2/rest/query`,{responseType:"json",method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify({db:t.displayName,csl:e})});return r}_handleResult(e){this._lastIngestedAt=e.ingestedAt;const t=this._createFeatures(e.table);if(null!=t){this.onMessage(t);for(const e of t)this.onFeature(e)}}_createFeatures(e){if(null==e||0===e.Rows.length)return null;const{xField:t,yField:s}=this._config.geometryEncoding,i=e.Columns.findIndex(e=>e.ColumnName===t),r=e.Columns.findIndex(e=>e.ColumnName===s);return e.Rows.map(t=>this._createFeature(e.Columns,i,r,t))}_createFeature(e,t,s,i){const{xField:r,yField:o}=this._config.geometryEncoding,a={};for(let t=0;t<e.length;t++){const s=e[t],n=i[t]??null;s.ColumnName!==o&&s.ColumnName!==r&&(a[s.ColumnName]=n)}let c=null;const l=i[t],h=i[s];return null!=h&&null!=l&&(c=(0,n.Cv)({x:l,y:h},this._config.sourceSpatialReference,this._outSpatialReference)),{attributes:a,geometry:c}}}function d(e){return e.find(e=>"DataTable"===e.FrameType&&"PrimaryResult"===e.TableKind)??null}function p(e){const t=e.Columns.findIndex(e=>"IngestedAt"===e.ColumnName);if(t<0)return null;let s=null;for(const i of e.Rows){const e=i[t];"string"==typeof e&&(null==s||e>s)&&(s=e)}return s}var f=s(53966),m=s(84952),_=s(16930),y=s(65864),g=s(17676),x=s(62815);function b(e,t){if(null==e&&null==t)return null;const s={};return null!=t&&(s.geometry=t),null!=e&&(s.where=e),s}let w=class extends h{constructor(e,t){super({}),this._outSpatialReference=t,this._outstandingMessages=[],this.errorString=null;const{geometryType:s,sourceSpatialReference:i}=e;this._config=e,this._featureZScaler=(0,x.N)(s,i,this._outSpatialReference),this._open()}normalizeCtorArgs(){return{}}async _open(){await this._tryCreateWebSocket(),this.destroyed||await this._handshake()}destroy(){super.destroy(),null!=this._websocket&&(this._websocket.onopen=null,this._websocket.onclose=null,this._websocket.onerror=null,this._websocket.onmessage=null,this._websocket.close()),this._websocket=null}get connectionStatus(){if(null==this._websocket)return"disconnected";switch(this._websocket.readyState){case 0:case 1:return"connected";case 2:case 3:return"disconnected"}}sendMessageToSocket(e){null!=this._websocket?this._websocket.send(JSON.stringify(e)):this._outstandingMessages.push(e)}sendMessageToClient(e){this._onMessage(e)}updateCustomParameters(e){this._config.customParameters=e,null!=this._websocket&&this._websocket.close()}async _tryCreateWebSocket(e=this._config.url.path,t=1e3,s=0){try{if(this.destroyed)return;const t=(0,m.a6)(e,this._config.customParameters??{});this._websocket=await this._createWebSocket(t),this.notifyChange("connectionStatus")}catch(i){const n=t/1e3;return this._config.maxReconnectionAttempts&&s>=this._config.maxReconnectionAttempts?(f.A.getLogger(this).error(new r.A("websocket-connection","Exceeded maxReconnectionAttempts attempts. No further attempts will be made")),void this.destroy()):(f.A.getLogger(this).error(new r.A("websocket-connection",`Failed to connect. Attempting to reconnect in ${n}s`,i)),await(0,g.Pl)(t),this._tryCreateWebSocket(e,Math.min(1.5*t,1e3*this._config.maxReconnectionInterval),s+1))}}_setWebSocketJSONParseHandler(e){e.onmessage=e=>{try{const t=JSON.parse(e.data);this._onMessage(t)}catch(e){return void f.A.getLogger(this).error(new r.A("websocket-connection","Failed to parse message, invalid JSON",{error:e}))}}}_createWebSocket(e){return new Promise((t,s)=>{const i=new WebSocket(e);i.onopen=()=>{if(i.onopen=null,this.destroyed)return i.onclose=null,void i.close();i.onclose=e=>this._onClose(e),i.onerror=e=>this._onError(e),this._setWebSocketJSONParseHandler(i),t(i)},i.onclose=e=>{i.onopen=i.onclose=null,s(e)}})}async _handshake(e=1e4){const t=this._websocket;if(null==t)return;const s=Promise.withResolvers(),i=t.onmessage,n=b(this._config.definitionExpression,this._config.geometryDefinition),{outFields:o}=this._config,a=setTimeout(()=>s.reject(),e),c=()=>{clearTimeout(a),s.reject()};return t.onmessage=e=>{let l=null;try{l=JSON.parse(e.data)}catch(e){}l&&"object"==typeof l||(f.A.getLogger(this).error(new r.A("websocket-connection","Protocol violation. Handshake failed - malformed message",e.data)),c(),this.destroy()),l.spatialReference?.wkid!==this._outSpatialReference?.wkid&&(f.A.getLogger(this).error(new r.A("websocket-connection",`Protocol violation. Handshake failed - expected wkid of ${this._outSpatialReference.wkid}`,e.data)),c(),this.destroy()),"json"!==l.format&&(f.A.getLogger(this).error(new r.A("websocket-connection","Protocol violation. Handshake failed - format is not set",e.data)),c(),this.destroy()),n&&l.filter!==n&&f.A.getLogger(this).error(new r.A("websocket-connection","Tried to set filter, but server doesn't support it")),o&&l.outFields!==o&&f.A.getLogger(this).error(new r.A("websocket-connection","Tried to set outFields, but server doesn't support it")),t.onmessage=i;for(const e of this._outstandingMessages)t.send(JSON.stringify(e));this._outstandingMessages=[],clearTimeout(a),s.resolve()},t.send(JSON.stringify({filter:n,outFields:o,format:"json",spatialReference:{wkid:this._outSpatialReference.wkid}})),s.promise}_onMessage(e){if(this.onMessage(e),"type"in e)switch(e.type){case"features":case"featureResult":for(const t of e.features)null!=this._featureZScaler&&this._featureZScaler(t.geometry),this.onFeature(t)}}_onError(e){const t="Encountered an error over WebSocket connection";this._set("errorString",t),f.A.getLogger(this).error("websocket-connection",t)}_onClose(e){this._websocket=null,this.notifyChange("connectionStatus"),1e3!==e.code&&f.A.getLogger(this).error("websocket-connection",`WebSocket closed unexpectedly with error code ${e.code}`),this.destroyed||this._open()}};(0,a.Cg)([(0,l.MZ)()],w.prototype,"connectionStatus",null),(0,a.Cg)([(0,l.MZ)()],w.prototype,"errorString",void 0),w=(0,a.Cg)([(0,l.$K)("esri.layers.graphics.sources.connections.WebSocketConnection")],w);var v=s(80893),I=s(97552);const S={maxQueryDepth:5,maxRecordCountFactor:3};let k=class extends w{constructor(e,t){super({...S,...e},t),this._buddyServicesQuery=null,this._relatedFeatures=null}async _open(){const e=await this._fetchServiceDefinition(this._config.url);e.timeInfo.trackIdField||f.A.getLogger(this).warn("GeoEvent service was configured without a TrackIdField. This may result in certain functionality being disabled. The purgeOptions.maxObservations property will have no effect.");const t=this._fetchWebSocketUrl(e.streamUrls,this._outSpatialReference);this._buddyServicesQuery||(this._buddyServicesQuery=this._queryBuddyServices()),await this._buddyServicesQuery,await this._tryCreateWebSocket(t);const s=b(this._config.definitionExpression,this._config.geometryDefinition),{outFields:i}=this._config;this.destroyed||this._setFilter(s,i)}_onMessage(e){if("attributes"in e){let t;try{t=this._enrich(e),null!=this._featureZScaler&&this._featureZScaler(t.geometry)}catch(e){return void f.A.getLogger(this).error(new r.A("geoevent-connection","Failed to parse message",e))}this.onFeature(t)}else this.onMessage(e)}async _fetchServiceDefinition(e){const t={f:"json",...this._config.customParameters},s=(0,i.A)(e.path,{query:t,responseType:"json"}),r=(await s).data;return this._serviceDefinition=r,r}_fetchWebSocketUrl(e,t){const s=e[0],{urls:i,token:r}=s,n=this._inferWebSocketBaseUrl(i);return(0,m.a6)(`${n}/subscribe`,{outSR:""+t.wkid,token:r})}_inferWebSocketBaseUrl(e){if(1===e.length)return e[0];for(const t of e)if(t.includes("wss"))return t;return f.A.getLogger(this).error(new r.A("geoevent-connection","Unable to infer WebSocket url",e)),null}async _setFilter(e,t){const s=this._websocket;if(null==s||null==e&&null==t)return;const i=JSON.stringify({filter:this._serializeFilter(e,t)});let n=!1;const o=Promise.withResolvers();return s.onmessage=e=>{const t=JSON.parse(e.data);t.filter&&(t.error&&(f.A.getLogger(this).error(new r.A("geoevent-connection","Failed to set service filter",t.error)),this._set("errorString",`Could not set service filter - ${t.error}`),o.reject(t.error)),this._setWebSocketJSONParseHandler(s),n=!0,o.resolve())},s.send(i),setTimeout(()=>{n||(this.destroyed||this._websocket!==s||f.A.getLogger(this).error(new r.A("geoevent-connection","Server timed out when setting filter")),o.reject())},1e4),o.promise}_serializeFilter(e,t){const s={};if(null==e&&null==t)return s;if(e?.geometry)try{const t=(0,y.rS)(e.geometry);if("extent"!==t.type)throw new r.A("geoevent-connection",`Expected extent but found type ${t.type}`);s.geometry=JSON.stringify(t.shiftCentralMeridian())}catch(e){f.A.getLogger(this).error(new r.A("geoevent-connection","Encountered an error when setting connection geometryDefinition",e))}return e?.where&&"1 = 1"!==e.where&&"1=1"!==e.where&&(s.where=e.where),null!=t&&(s.outFields=t.join(",")),s}_enrich(e){if(!this._relatedFeatures)return e;const t=this._serviceDefinition.relatedFeatures.joinField,s=e.attributes[t],i=this._relatedFeatures.get(s);if(!i)return f.A.getLogger(this).warn("geoevent-connection","Feature join failed. Is the join field configured correctly?",e),e;const{attributes:n,geometry:o}=i;for(const t in n)e.attributes[t]=n[t];return o&&(e.geometry=o),e.geometry||e.centroid||f.A.getLogger(this).error(new r.A("geoevent-connection","Found malformed feature - no geometry found",e)),e}async _queryBuddyServices(){try{const{relatedFeatures:e,keepLatestArchive:t}=this._serviceDefinition,s=this._queryRelatedFeatures(e),i=this._queryArchive(t);await s;const r=await i;if(!r)return;for(const e of r.features)this.onFeature(this._enrich(e))}catch(e){f.A.getLogger(this).error(new r.A("geoevent-connection","Encountered an error when querying buddy services",{error:e}))}}async _queryRelatedFeatures(e){if(!e)return;const t=await this._queryBuddy(e.featuresUrl);this._addRelatedFeatures(t)}async _queryArchive(e){if(e)return this._queryBuddy(e.featuresUrl)}async _queryBuddy(e){const t=new((await Promise.all([s.e(7632),s.e(8278),s.e(7865),s.e(6554),s.e(2869),s.e(3910),s.e(9953),s.e(564),s.e(1214),s.e(2889),s.e(6614),s.e(1017),s.e(4674),s.e(993),s.e(4333),s.e(3781),s.e(812),s.e(1468)]).then(s.bind(s,53781))).default)({url:e}),{capabilities:i}=await t.load(),r=i.query.supportsMaxRecordCountFactor,n=i.query.supportsPagination,o=i.query.supportsCentroid,a=this._config.maxRecordCountFactor,c=t.capabilities.query.maxRecordCount,l=r?c*a:c,h=new I.A;if(h.outFields=this._config.outFields??["*"],h.where=this._config.definitionExpression??"1=1",h.returnGeometry=!0,h.returnExceededLimitFeatures=!0,h.outSpatialReference=_.A.fromJSON(this._outSpatialReference),o&&(h.returnCentroid=!0),r&&(h.maxRecordCountFactor=a),n)return h.num=l,t.destroy(),this._queryPages(e,h);const u=await(0,v.eW)(e,h,this._config.sourceSpatialReference);return t.destroy(),u}async _queryPages(e,t,s=[],i=0){t.start=null!=t.num?i*t.num:null;const r=await(0,v.eW)(e,t,this._config.sourceSpatialReference);return r.exceededTransferLimit&&i<(this._config.maxQueryDepth??0)?(r.features.forEach(e=>s.push(e)),this._queryPages(e,t,s,i+1)):(s.forEach(e=>r.features.push(e)),r)}_addRelatedFeatures(e){const t=new Map,s=e.features,i=this._serviceDefinition.relatedFeatures.joinField;for(const e of s){const s=e.attributes[i];t.set(s,e)}this._relatedFeatures=t}};k=(0,a.Cg)([(0,l.$K)("esri.layers.graphics.sources.connections.GeoEventConnection")],k);var M=s(64108);let T=class extends h{constructor(e,t){super({}),this.connectionStatus="connected",this.errorString=null;const{geometryType:s,sourceSpatialReference:i}=e;this._featureZScaler=(0,x.N)(s,i,t)}normalizeCtorArgs(){return{}}updateCustomParameters(e){}sendMessageToSocket(e){}sendMessageToClient(e){if("type"in e)switch(e.type){case"features":case"featureResult":for(const t of e.features)null!=this._featureZScaler&&this._featureZScaler(t.geometry),this.onFeature(t)}this.onMessage(e)}};function A(e,t){switch(e.type){case"client":return new T(e,t);case"custom":return new w(e,t);case"geoevent":return new k(e,t);case"kusto":return new u(e,t)}}(0,a.Cg)([(0,l.MZ)()],T.prototype,"connectionStatus",void 0),(0,a.Cg)([(0,l.MZ)()],T.prototype,"errorString",void 0),T=(0,a.Cg)([(0,M.$)("esri.layers.support.ClientSideConnection")],T)},85113(e,t,s){s.d(t,{BM:()=>k,bd:()=>M,sO:()=>S,xD:()=>u});var i=s(67482),r=s(49186),n=s(21325),o=s(90708),a=s(43334),c=s(92722),l=s(30524);const h={LineString:"esriGeometryPolyline",MultiLineString:"esriGeometryPolyline",MultiPoint:"esriGeometryMultipoint",Point:"esriGeometryPoint",Polygon:"esriGeometryPolygon",MultiPolygon:"esriGeometryPolygon"};function u(e){return h[e]}function*d(e){switch(e.type){case"Feature":yield e;break;case"FeatureCollection":for(const t of e.features)t&&(yield t)}}function*p(e){if(e)switch(e.type){case"Point":yield e.coordinates;break;case"LineString":case"MultiPoint":yield*e.coordinates;break;case"MultiLineString":case"Polygon":for(const t of e.coordinates)yield*t;break;case"MultiPolygon":for(const t of e.coordinates)for(const e of t)yield*e}}function f(e){for(const t of e)if(t.length>2)return!0;return!1}function m(e){let t=0;for(let s=0;s<e.length;s++){const i=e[s],r=e[(s+1)%e.length];t+=i[0]*r[1]-r[0]*i[1]}return t<=0}function _(e){const t=e[0],s=e[e.length-1];t[0]===s[0]&&t[1]===s[1]&&t[2]===s[2]||e.push(t)}function y(e,t){const{coordinates:s,type:i}=e,r=t.hasZ??!1,n=!0;switch(i){case"Point":return new c.A([],[...s],r,!1);case"LineString":return(0,o.Ap)({paths:[s],hasZ:n},r,!1);case"MultiLineString":return(0,o.Ap)({paths:s,hasZ:n},r,!1);case"MultiPoint":return(0,o.PR)({points:s,hasZ:n},r,!1);case"Polygon":case"MultiPolygon":{const e=new c.A([],[],r,!1);for(const t of"Polygon"===i?[s]:s){g(e,t[0],r);for(let s=1;s<t.length;s++)x(e,t[s],r)}return e}}}function g(e,t,s){_(t),function(e){return!m(e)}(t)?w(e,t,s):b(e,t,s)}function x(e,t,s){_(t),function(e){return m(e)}(t)?w(e,t,s):b(e,t,s)}function b(e,t,s){for(const i of t)v(e,i,s);e.lengths.push(t.length)}function w(e,t,s){for(let i=t.length-1;i>=0;i--)v(e,t[i],s);e.lengths.push(t.length)}function v(e,[t,s,i],r){e.coords.push(t,s),r&&e.coords.push(i||0)}function I(e){switch(typeof e){case"string":return(0,i.Br)(e)?"esriFieldTypeDate":"esriFieldTypeString";case"number":return"esriFieldTypeDouble";default:return"unknown"}}function S(e,t=4326){if(!e)throw new r.A("geojson-layer:empty","GeoJSON data is empty");if("Feature"!==e.type&&"FeatureCollection"!==e.type)throw new r.A("geojson-layer:unsupported-geojson-object","missing or not supported GeoJSON object type",{data:e});const{crs:s}=e;if(!s)return;const i="string"==typeof s?s:"name"===s.type?s.properties.name:"EPSG"===s.type?s.properties.code:null,o=(0,n.oT)({wkid:t})?new RegExp(".*(CRS84H?|4326)$","i"):new RegExp(`.*(${t})$`,"i");if(!i||!o.test(i))throw new r.A("geojson:unsupported-crs","unsupported GeoJSON 'crs' member",{crs:s})}function k(e,t={}){const s=[],i=new Set,r=new Set;let n,o=!1,a=null,c=!1,{geometryType:h=null}=t;for(const t of d(e)){const{geometry:e,properties:d,id:m}=t;if((!e||(h||(h=u(e.type)),u(e.type)===h))&&(o||(o=f(p(e))),c||(c=null!=m,c&&(n=typeof m,d&&(a=Object.keys(d).filter(e=>d[e]===m)))),d&&a&&c&&null!=m&&(a.length>1?a=a.filter(e=>d[e]===m):1===a.length&&(a=d[a[0]]===m?a:[])),d))for(const e in d){if(i.has(e))continue;const t=I(d[e]);if("unknown"===t){r.add(e);continue}r.delete(e),i.add(e);const n=(0,l.rS)(e);n&&s.push({name:n,alias:e,type:t})}}const m=(0,l.rS)(1===a?.length&&a[0]||null)??void 0;if(m)for(const e of s)if(e.name===m&&(0,l.WA)(e)){e.type="esriFieldTypeOID";break}return{fields:s,geometryType:h,hasZ:o,objectIdFieldName:m,objectIdFieldType:n,unknownFields:Array.from(r)}}function M(e,t){return Array.from(function*(e,t={}){const{geometryType:s,objectIdField:i}=t;for(const r of e){const{geometry:e,properties:n,id:o}=r;if(e&&u(e.type)!==s)continue;const c=n||{};let l;i&&(l=c[i],null==o||l||(c[i]=l=o)),yield new a.Om(e&&y(e,t),c,null,l)}}(d(e),t))}},82832(e,t,s){s.d(t,{$1:()=>_,CR:()=>m,MB:()=>d,PC:()=>y,Yx:()=>c,bP:()=>h});var i=s(67482),r=s(21325),n=s(30524);class o{constructor(e){this.description=e,this.code=null}}class a{constructor(e){this.globalId=null,this.objectId=null,this.success=!1,this.uniqueId=null,this.error=new o(e)}}function c(e){return new a(e)}class l{constructor(e){this.globalId=null,this.success=!0,this.objectId=this.uniqueId=e}}function h(e){return new l(e)}const u=new Set;function d(e,t,s,i=!1){u.clear();for(const r in s){const o=e.get(r);if(!o)continue;const a=p(o,s[r]);if(u.add(o.name),o&&(i||o.editable)){const e=(0,n.CJ)(o,a);if(e)return c((0,n.uo)(e,o,a));t[o.name]=a}}for(const t of e.requiredFields??[])if(!u.has(t.name))return c(`missing required field "${t.name}"`);return null}function p(e,t){let s=t;return(0,n.WA)(e)&&"string"==typeof t?s=parseFloat(t):(0,n.yM)(e)&&null!=t&&"string"!=typeof t?s=String(t):(0,n.vE)(e)&&"string"==typeof t&&(s=(0,i._U)(t)),(0,n.WX)(s)}let f;function m(e,t){if(!e||!(0,r.fn)(t))return e;if("rings"in e||"paths"in e){if(null==f)throw new TypeError("geometry engine not loaded");return f.simplify(t,e)}return e}async function _(e,t){!(0,r.fn)(e)||"esriGeometryPolygon"!==t&&"esriGeometryPolyline"!==t||await async function(){return null==f&&(f=await s.e(1023).then(s.bind(s,81023))),f}()}const y={supportsAutoIntervalBin:!0,supportsFixedIntervalBin:!0,supportsFixedBoundariesBin:!0,supportsDateBin:!0,supportsStackBy:!0,supportsSplitBy:!0,supportsNormalization:!0,supportedStatisticTypes:["COUNT","SUM","AVG","VAR","STDDEV","MIN","MAX","PERCENTILE_CONT","PERCENTILE_DISC","CentroidAggregate","EnvelopeAggregate","ConvexHullAggregate"],supportedNormalizationTypes:["field","log","naturalLog","percentOfTotal","squareRoot"]}},75321(e,t,s){s.d(t,{CJ:()=>S,GA:()=>T,GL:()=>I,I:()=>C,J0:()=>A,Ki:()=>M,Px:()=>k,QE:()=>v,bW:()=>P,vJ:()=>w});var i=s(11254),r=s(49186),n=s(53966),o=s(84952),a=s(16930),c=s(21325),l=s(28735),h=s(90708),u=s(58512),d=s(85113),p=s(64714),f=s(82832),m=s(95466),_=s(98453),y=s(98623);const g=()=>n.A.getLogger("esri.layers.ogc.ogcFeatureUtils"),x="startindex",b=new Set([x,"offset"]),w="http://www.opengis.net/def/crs/",v=`${w}OGC/1.3/CRS84`;async function I(e,t,s={},n=5){const{links:a}=e,c=O(a);if(!c)throw new r.A("ogc-feature-layer:missing-items-page","Missing items url");const{apiKey:l,customParameters:h,signal:u}=s,f=(0,o.s2)(c.href,e.landingPage.url),b={limit:n,...h,token:l},w=(0,o.a6)(f,b),{data:v}=await(0,i.A)(w,{signal:u,headers:{accept:"application/geo+json"}}),I=N(w,n,v.links)??x;(0,d.sO)(v);const S=v.numberMatched,k=(0,d.BM)(v,{geometryType:t.geometryType}),M=t.fields||k.fields||[],T=null!=t.hasZ?t.hasZ:k.hasZ,A=k.geometryType,P=t.objectIdField||k.objectIdFieldName||"OBJECTID";let C=t.timeInfo;const F=M.find(({name:e})=>e===P);if(F)F.editable=!1,F.nullable=!1;else{if(!k.objectIdFieldType)throw new r.A("ogc-feature-layer:missing-feature-id","Collection geojson require a feature id as a unique identifier");M.unshift({name:P,alias:P,type:"number"===k.objectIdFieldType?"esriFieldTypeOID":"esriFieldTypeString",editable:!1,nullable:!1})}if(P!==k.objectIdFieldName){const e=M.find(({name:e})=>e===k.objectIdFieldName);e&&(e.type="esriFieldTypeInteger")}M===k.fields&&k.unknownFields.length>0&&g().warn({name:"ogc-feature-layer:unknown-field-types",message:"Some fields types couldn't be inferred from the features and were dropped",details:{unknownFields:k.unknownFields}});for(const e of M){if(e.name??=e.alias,e.alias??=e.name,"esriFieldTypeOID"!==e.type&&"esriFieldTypeGlobalID"!==e.type&&(e.editable??=!0,e.nullable??=!0),!e.name)throw new r.A("ogc-feature-layer:invalid-field-name","field name is missing",{field:e});if(!_.m.jsonValues.includes(e.type))throw new r.A("ogc-feature-layer:invalid-field-type",`invalid type for field "${e.name}"`,{field:e})}if(C){const e=new m.A(M);if(C.startTimeField){const t=e.get(C.startTimeField);t?(C.startTimeField=t.name,t.type="esriFieldTypeDate"):C.startTimeField=null}if(C.endTimeField){const t=e.get(C.endTimeField);t?(C.endTimeField=t.name,t.type="esriFieldTypeDate"):C.endTimeField=null}if(C.trackIdField){const t=e.get(C.trackIdField);t?C.trackIdField=t.name:(C.trackIdField=null,g().warn({name:"ogc-feature-layer:invalid-timeInfo-trackIdField",message:"trackIdField is missing",details:{timeInfo:C}}))}C.timeReference||={timeZoneIANA:y.n$},C.startTimeField||C.endTimeField||(g().warn({name:"ogc-feature-layer:invalid-timeInfo",message:"startTimeField and endTimeField are missing",details:{timeInfo:C}}),C=void 0)}return{drawingInfo:A?(0,p.F0)(A):null,extent:z(e),geometryType:A,fields:M,hasZ:!!T,objectIdField:P,paginationParameter:I,timeInfo:C,featureCount:S}}async function S(e,t={}){const{links:s,url:n}=e,a=L(c=s,"data","application/json")??L(c,"http://www.opengis.net/def/rel/ogc/1.0/data","application/json");var c;if(!a)throw new r.A("ogc-feature-layer:missing-collections-page","Missing collections url");const{apiKey:l,customParameters:h,signal:u}=t,d=(0,o.s2)(a.href,n),{data:p}=await(0,i.A)(d,{signal:u,headers:{accept:"application/json"},query:{...h,token:l}});for(const t of p.collections)t.landingPage=e;return p}async function k(e,t={}){const{links:s,url:n}=e,a=L(c=s,"conformance","application/json")??L(c,"http://www.opengis.net/def/rel/ogc/1.0/conformance","application/json");var c;if(!a)throw new r.A("ogc-feature-layer:missing-conformance-page","Missing conformance url");const{apiKey:l,customParameters:h,signal:u}=t,d=(0,o.s2)(a.href,n),{data:p}=await(0,i.A)(d,{signal:u,headers:{accept:"application/json"},query:{...h,token:l}});return p}async function M(e,t={}){const{apiKey:s,customParameters:r,signal:n}=t,{data:o}=await(0,i.A)(e,{signal:n,headers:{accept:"application/json"},query:{...r,token:s}});return o.url=e,o}async function T(e,t={}){const{links:s,url:r}=e,n=L(s,"service-desc","application/vnd.oai.openapi+json;version=3.0");if(!n)return g().warn("ogc-feature-layer:missing-openapi-page","The OGC API-Features server does not have an OpenAPI page."),null;const{apiKey:a,customParameters:c,signal:l}=t,h=(0,o.s2)(n.href,r),{data:u}=await(0,i.A)(h,{signal:l,headers:{accept:"application/vnd.oai.openapi+json;version=3.0"},query:{...c,token:a}});return u}function A(e){const t=/^http:\/\/www\.opengis.net\/def\/crs\/(?<authority>.*)\/(?<version>.*)\/(?<code>.*)$/i.exec(e),s=t?.groups;if(!s)return null;const{authority:i,code:r}=s;switch(i.toLowerCase()){case"ogc":switch(r.toLowerCase()){case"crs27":return a.A.GCS_NAD_1927.wkid;case"crs83":return 4269;case"crs84":case"crs84h":return a.A.WGS84.wkid;default:return null}case"esri":case"epsg":{const e=Number.parseInt(r,10);return Number.isNaN(e)?null:e}default:return null}}async function P(e,t,s){const i=await C(e,t,s);return(0,h.ZF)(i)}async function C(e,t,s){const{collection:{links:n,landingPage:{url:p}},layerDefinition:_,maxRecordCount:y,queryParameters:{apiKey:g,customParameters:x},spatialReference:b,supportedCrs:w}=e,v=O(n);if(!v)throw new r.A("ogc-feature-layer:missing-items-page","Missing items url");const{geometry:I,num:S,start:k,timeExtent:M,where:T}=t;if(t.objectIds)throw new r.A("ogc-feature-layer:query-by-objectids-not-supported","Queries with object ids are not supported");const A=a.A.fromJSON(b),P=t.outSpatialReference??A,C=P.isWGS84?null:F(P,w),E=R(I,w),z=function(e){if(!e)return null;const{start:t,end:s}=e;return`${null!=t?t.toISOString():".."}/${null!=s?s.toISOString():".."}`}(M),L=(Z=T)&&"1=1"!==Z?Z:null,N=S??(null==k?y:10),q=0===k?void 0:k,{fields:B,geometryType:G,hasZ:j,objectIdField:U,paginationParameter:V}=_,W=(0,o.s2)(v.href,p),{data:Y}=await(0,i.A)(W,{...s,query:{...x,...E,crs:C,datetime:z,query:L,limit:N,[V]:q,token:g},headers:{accept:"application/geo+json"}}),$=(0,d.bd)(Y,{geometryType:G,hasZ:j,objectIdField:U}),H=$.length===N&&!!D(Y.links??[]),Q=new m.A(B);var Z;for(const e of $){const t={};(0,f.MB)(Q,t,e.attributes,!0);for(const e of Q.fields)e.nullable&&!(e.name in t)&&(t[e.name]=null);t[U]=e.attributes[U],e.attributes=t}if(!C&&P.isWebMercator)for(const e of $)if(null!=e.geometry&&null!=G){const t=(0,h.zv)(e.geometry,G,j,!1);t.spatialReference=a.A.WGS84,e.geometry=(0,h.Ux)((0,l.Cv)(t,P))}for(const e of $)e.objectId=e.attributes[U];const X=C||!C&&P.isWebMercator?P.toJSON():c.KK,K=new u.A;return K.exceededTransferLimit=H,K.features=$,K.fields=B,K.geometryType=G,K.hasZ=j,K.spatialReference=X,K}function F(e,t){const{isWebMercator:s,wkid:i,latestWkid:r}=e;if(!i&&!r)return null;const n=s?t[3857]??t[102100]??t[102113]??t[900913]:i&&t[i]||r&&t[r];return n?`${w}${n}`:null}function E(e){if(!e)return"";const{xmin:t,ymin:s,xmax:i,ymax:r}=e;return`${t},${s},${i},${r}`}function R(e,t){if(!function(e){return null!=e&&"extent"===e.type}(e))return null;const{spatialReference:s}=e;if(!s||s.isWGS84)return{bbox:E(e)};const i=F(s,t);return null!=i?{bbox:E(e),"bbox-crs":i}:s.isWebMercator?{bbox:E((0,l.Cv)(e,a.A.WGS84))}:null}function z(e){const t=e.extent?.spatial;if(!t)return null;const s=t.bbox[0],i=4===s.length,[r,n]=s,o=i?void 0:s[2];return{xmin:r,ymin:n,xmax:i?s[2]:s[3],ymax:i?s[3]:s[4],zmin:o,zmax:i?void 0:s[5],spatialReference:a.A.WGS84.toJSON()}}function O(e){return L(e,"items","application/geo+json","http://www.opengis.net/def/profile/ogc/0/rfc7946")??L(e,"http://www.opengis.net/def/rel/ogc/1.0/items","application/geo+json","http://www.opengis.net/def/profile/ogc/0/rfc7946")}function L(e,t,s,i){return i?e.find(({rel:e,type:r,profile:n})=>e===t&&r===s&&n?.includes(i))??e.find(({rel:e,type:i,profile:r})=>e===t&&i===s&&!r):e.find(({rel:e,type:i})=>e===t&&i===s)??e.find(({rel:e,type:s})=>e===t&&!s)}function D(e){return L(e,"next","application/geo+json")}function N(e,t,s){if(!s)return;const i=D(s),r=(0,o.An)(i?.href)?.query;if(!r)return;const n=(0,o.An)(e).query,a=Object.keys(n??{}),c=Object.entries(r).filter(([e])=>!a.includes(e)).find(([e,s])=>b.has(e.toLowerCase())&&Number.parseInt(s,10)===t),l=c?.[0];return l}},39412(e,t,s){s.d(t,{N:()=>n});var i=s(2741);let r=null;async function n(){return r||(r=async function(){const e=await s.e(1687).then(s.bind(s,31687));return await e.default({module_or_path:(0,i.s)("esri/libs/parquet/pkg/bundle_bg.wasm")}),e}()),r}},37615(e,t,s){s.d(t,{A:()=>o});var i=s(49186),r=s(53966),n=s(62577);function o(e,t,s,i,n,o){if(null==e)return null;const a=e.references("geometry")&&o?c(t,i,o):t,l=e.repurposeFeature(a,n);try{return e.evaluate(l,s)}catch(e){return r.A.getLogger("esri.views.2d.support.arcadeOnDemand").warn("Feature arcade evaluation failed:",e),null}}const a=new Map;function c(e,t,s){const{transform:o,hasZ:c,hasM:l}=s;a.has(t)||a.set(t,function(e){const t={};switch(e){case"esriGeometryPoint":return(e,s,i,r)=>(0,n.Tr)(s,t,e,i,r);case"esriGeometryPolygon":return(e,s,i,r)=>(0,n.$X)(s,t,e,i,r);case"esriGeometryPolyline":return(e,s,i,r)=>(0,n.P5)(s,t,e,i,r);case"esriGeometryMultipoint":return(e,s,i,r)=>(0,n.SW)(s,t,e,i,r);default:return r.A.getLogger("esri.views.2d.support.arcadeOnDemand").error(new i.A("mapview-arcade",`Unable to handle geometryType: ${e}`)),e=>e}}(t));const h=a.get(t)(e.geometry,o,c,l);return{...e,geometry:h}}},83773(e,t,s){s.d(t,{i:()=>f});var i=s(76213);function r(e,t){return e.x===t.x&&e.y===t.y}function n(e){if(!e)return;const t=e.length;if(t<=1)return;let s=0;for(let i=1;i<t;i++)r(e[i],e[s])||++s===i||(e[s]=e[i]);e.length=s+1}function o(e,t){return e.x=t.y,e.y=-t.x,e}function a(e,t){return e.x=-t.y,e.y=t.x,e}function c(e,t){return e.x=t.x,e.y=t.y,e}function l(e,t){return e.x=-t.x,e.y=-t.y,e}function h(e){return Math.sqrt(e.x*e.x+e.y*e.y)}function u(e,t){return e.x*t.y-e.y*t.x}function d(e,t){return e.x*t.x+e.y*t.y}function p(e,t,s,i){return e.x=t.x*s+t.y*i,e.y=t.x*i-t.y*s,e}class f{constructor(e,t,s){this._writeVertex=e,this._writeTriangle=t,this._canUseThinTessellation=s,this._prevNormal={x:void 0,y:void 0},this._nextNormal={x:void 0,y:void 0},this._textureNormalLeft={x:0,y:1},this._textureNormalRight={x:0,y:-1},this._textureNormal={x:void 0,y:void 0},this._joinNormal={x:void 0,y:void 0},this._inner={x:void 0,y:void 0},this._outer={x:void 0,y:void 0},this._roundStart={x:void 0,y:void 0},this._roundEnd={x:void 0,y:void 0},this._startBreak={x:void 0,y:void 0},this._endBreak={x:void 0,y:void 0},this._innerPrev={x:void 0,y:void 0},this._innerNext={x:void 0,y:void 0},this._bevelStart={x:void 0,y:void 0},this._bevelEnd={x:void 0,y:void 0},this._bevelMiddle={x:void 0,y:void 0}}tessellate(e,t,s=this._canUseThinTessellation){n(e),s&&t.halfWidth<i.Gh&&!t.offset?this._tessellateThin(e,t):this._tessellate(e,t)}_tessellateThin(e,t){if(e.length<2)return;const s=t.wrapDistance||65535;let i=t.initialDistance||0,r=!1,n=e[0].x,o=e[0].y;const a=e.length;for(let t=1;t<a;++t){r&&(r=!1,i=0);let a=e[t].x,c=e[t].y,l=a-n,h=c-o,u=Math.sqrt(l*l+h*h);if(l/=u,h/=u,i+u>s){r=!0;const e=(s-i)/u;u=s-i,a=(1-e)*n+e*a,c=(1-e)*o+e*c,--t}const d=this._writeVertex(n,o,0,0,l,h,h,-l,0,-1,i),p=this._writeVertex(n,o,0,0,l,h,-h,l,0,1,i);i+=u;const f=this._writeVertex(a,c,0,0,l,h,h,-l,0,-1,i),m=this._writeVertex(a,c,0,0,l,h,-h,l,0,1,i);this._writeTriangle(d,p,f),this._writeTriangle(p,f,m),n=a,o=c}}_tessellate(e,t){const s=e[0],i=e[e.length-1],n=r(s,i),f=n?3:2;if(e.length<f)return;const m=t.pixelCoordRatio,_=null!=t.capType?t.capType:0,y=null!=t.joinType?t.joinType:2,g=null!=t.miterLimit?Math.min(t.miterLimit,4):2,x=null!=t.roundLimit?Math.min(t.roundLimit,1.05):1.05,b=null!=t.halfWidth?t.halfWidth:2,w=!!t.textured;let v,I,S,k=null;const M=this._prevNormal,T=this._nextNormal;let A=-1,P=-1;const C=this._joinNormal;let F,E;const R=this._textureNormalLeft,z=this._textureNormalRight,O=this._textureNormal;let L=-1,D=-1;const N=t.wrapDistance||65535;let q=t.initialDistance||0;const B=this._writeVertex,G=this._writeTriangle,j=(e,t,s,i,r,n)=>{const o=B(I,S,F,E,s,i,e,t,r,n,q);return L>=0&&D>=0&&o>=0&&G(L,D,o),L=D,D=o,o};n&&(v=e[e.length-2],T.x=i.x-v.x,T.y=i.y-v.y,P=h(T),T.x/=P,T.y/=P);let U=!1;for(let t=0;t<e.length;++t){if(U&&(U=!1,q=0),v&&(M.x=-T.x,M.y=-T.y,A=P,q+A>N&&(U=!0)),U){const s=(N-q)/A;A=N-q,v={x:(1-s)*v.x+s*e[t].x,y:(1-s)*v.y+s*e[t].y},--t}else v=e[t];I=v.x,S=v.y;const s=t<=0&&!U,i=t===e.length-1;if(s||(q+=A),k=i?n?e[1]:null:e[t+1],k?(T.x=k.x-I,T.y=k.y-S,P=h(T),T.x/=P,T.y/=P):(T.x=void 0,T.y=void 0),!n){if(s){a(C,T),F=C.x,E=C.y,2===_&&(j(-T.y-T.x,T.x-T.y,T.x,T.y,0,-1),j(T.y-T.x,-T.x-T.y,T.x,T.y,0,1)),1===_&&(j(-T.y-T.x,T.x-T.y,T.x,T.y,-1,-1),j(T.y-T.x,-T.x-T.y,T.x,T.y,-1,1)),1!==_&&0!==_||(j(-T.y,T.x,T.x,T.y,0,-1),j(T.y,-T.x,T.x,T.y,0,1));continue}if(i){o(C,M),F=C.x,E=C.y,1!==_&&0!==_||(j(M.y,-M.x,-M.x,-M.y,0,-1),j(-M.y,M.x,-M.x,-M.y,0,1)),2===_&&(j(M.y-M.x,-M.x-M.y,-M.x,-M.y,0,-1),j(-M.y-M.x,M.x-M.y,-M.x,-M.y,0,1)),1===_&&(j(M.y-M.x,-M.x-M.y,-M.x,-M.y,1,-1),j(-M.y-M.x,M.x-M.y,-M.x,-M.y,1,1));continue}}let r,f,B=-u(M,T);if(Math.abs(B)<.01)d(M,T)>0?(C.x=M.x,C.y=M.y,B=1,r=Number.MAX_VALUE,f=!0):(a(C,T),B=1,r=1,f=!1);else{C.x=(M.x+T.x)/B,C.y=(M.y+T.y)/B,r=h(C);const e=(r-1)*b*m;f=r>4||e>A&&e>P}F=C.x,E=C.y;let G=y;switch(y){case 0:r<1.05&&(G=2);break;case 1:r<x&&(G=2);break;case 2:r>g&&(G=0)}switch(G){case 2:if(j(C.x,C.y,-M.x,-M.y,0,-1),j(-C.x,-C.y,-M.x,-M.y,0,1),i)break;if(w){const e=U?0:q;L=this._writeVertex(I,S,F,E,T.x,T.y,C.x,C.y,0,-1,e),D=this._writeVertex(I,S,F,E,T.x,T.y,-C.x,-C.y,0,1,e)}break;case 0:{const e=B<0;let t,s,r,n;if(e){const e=L;L=D,D=e,t=R,s=z}else t=z,s=R;if(f)r=e?a(this._innerPrev,M):o(this._innerPrev,M),n=e?o(this._innerNext,T):a(this._innerNext,T);else{const t=e?l(this._inner,C):c(this._inner,C);r=t,n=t}const h=e?o(this._bevelStart,M):a(this._bevelStart,M);j(r.x,r.y,-M.x,-M.y,t.x,t.y);const u=j(h.x,h.y,-M.x,-M.y,s.x,s.y);if(i)break;const d=e?a(this._bevelEnd,T):o(this._bevelEnd,T);if(f){const e=this._writeVertex(I,S,F,E,-M.x,-M.y,0,0,0,0,q);L=this._writeVertex(I,S,F,E,T.x,T.y,n.x,n.y,t.x,t.y,q),D=this._writeVertex(I,S,F,E,T.x,T.y,d.x,d.y,s.x,s.y,q),this._writeTriangle(u,e,D)}else{if(w){const e=this._bevelMiddle;e.x=(h.x+d.x)/2,e.y=(h.y+d.y)/2,p(O,e,-M.x,-M.y),j(e.x,e.y,-M.x,-M.y,O.x,O.y),p(O,e,T.x,T.y),L=this._writeVertex(I,S,F,E,T.x,T.y,e.x,e.y,O.x,O.y,q),D=this._writeVertex(I,S,F,E,T.x,T.y,n.x,n.y,t.x,t.y,q)}else{const e=L;L=D,D=e}j(d.x,d.y,T.x,T.y,s.x,s.y)}if(e){const e=L;L=D,D=e}break}case 1:{const e=B<0;let t,s;if(e){const e=L;L=D,D=e,t=R,s=z}else t=z,s=R;const n=e?l(this._inner,C):c(this._inner,C);let h,u;f?(h=e?a(this._innerPrev,M):o(this._innerPrev,M),u=e?o(this._innerNext,T):a(this._innerNext,T)):(h=n,u=n);const m=e?o(this._roundStart,M):a(this._roundStart,M),_=e?a(this._roundEnd,T):o(this._roundEnd,T),y=j(h.x,h.y,-M.x,-M.y,t.x,t.y),g=j(m.x,m.y,-M.x,-M.y,s.x,s.y);if(i)break;const x=this._writeVertex(I,S,F,E,-M.x,-M.y,0,0,0,0,q);f||this._writeTriangle(L,D,x);const b=l(this._outer,n),v=this._writeVertex(I,S,F,E,T.x,T.y,_.x,_.y,s.x,s.y,q);let k,A;const P=r>2;if(P){let t;r!==Number.MAX_VALUE?(b.x/=r,b.y/=r,t=d(M,b),t=(r*(t*t-1)+1)/t):t=-1,k=e?o(this._startBreak,M):a(this._startBreak,M),k.x+=M.x*t,k.y+=M.y*t,A=e?a(this._endBreak,T):o(this._endBreak,T),A.x+=T.x*t,A.y+=T.y*t}p(O,b,-M.x,-M.y);const N=this._writeVertex(I,S,F,E,-M.x,-M.y,b.x,b.y,O.x,O.y,q);p(O,b,T.x,T.y);const G=w?this._writeVertex(I,S,F,E,T.x,T.y,b.x,b.y,O.x,O.y,q):N,U=x,V=w?this._writeVertex(I,S,F,E,T.x,T.y,0,0,0,0,q):x;let W=-1,Y=-1;if(P&&(p(O,k,-M.x,-M.y),W=this._writeVertex(I,S,F,E,-M.x,-M.y,k.x,k.y,O.x,O.y,q),p(O,A,T.x,T.y),Y=this._writeVertex(I,S,F,E,T.x,T.y,A.x,A.y,O.x,O.y,q)),w?P?(this._writeTriangle(U,g,W),this._writeTriangle(U,W,N),this._writeTriangle(V,G,Y),this._writeTriangle(V,Y,v)):(this._writeTriangle(U,g,N),this._writeTriangle(V,G,v)):P?(this._writeTriangle(x,g,W),this._writeTriangle(x,W,Y),this._writeTriangle(x,Y,v)):(this._writeTriangle(x,g,N),this._writeTriangle(x,G,v)),f?(L=this._writeVertex(I,S,F,E,T.x,T.y,u.x,u.y,t.x,t.y,q),D=v):(L=w?this._writeVertex(I,S,F,E,T.x,T.y,u.x,u.y,t.x,t.y,q):y,this._writeTriangle(L,V,v),D=v),e){const e=L;L=D,D=e}break}}}}}},17371(e,t,s){s.r(t),s.d(t,{default:()=>Ec});var i=s(49186),r=s(36563),n=s(44208),o=s(26390),a=s(17676),c=s(87811),l=s(36708),h=s(90629),u=s(8341),d=s(87045),p=s(76213);class f{constructor(e){this._client=e,this.layerView=this._client.createInvokeProxy(""),this.container=this._client.createInvokeProxy("container"),this._eventLog=this._client.createInvokeProxy("eventLog")}onEvent(e){"error"===e.type&&e.error&&"toJSON"in e.error&&(e.error=e.error.toJSON()),(0,u.oV)(this._eventLog.onEvent(e))}}var m=s(97768),_=s(93637),y=s(6797),g=s(62577),x=s(21325),b=s(44159);function w(e,t){return[e,t]}function v(e,t,s){return e[0]=t,e[1]=s,e}const I=new b.A("0/0/0/0");class S{static create(e,t,s=null){const i=(0,x.Vp)(e.spatialReference),r=t.origin||w(e.origin.x,e.origin.y),n=w(e.size[0]*t.resolution,e.size[1]*t.resolution),o=w(-1/0,-1/0),a=w(1/0,1/0),c=w(1/0,1/0);null!=s&&(v(o,Math.max(0,Math.floor((s.xmin-r[0])/n[0])),Math.max(0,Math.floor((r[1]-s.ymax)/n[1]))),v(a,Math.max(0,Math.floor((s.xmax-r[0])/n[0])),Math.max(0,Math.floor((r[1]-s.ymin)/n[1]))),v(c,a[0]-o[0]+1,a[1]-o[1]+1));const{cols:l,rows:h}=t;let u,d,p,f;return!s&&l&&h&&(v(o,l[0],h[0]),v(a,l[1],h[1]),v(c,l[1]-l[0]+1,h[1]-h[0]+1)),e.isWrappable?(u=w(Math.ceil(Math.round((i.valid[1]-i.valid[0])/t.resolution)/e.size[0]),c[1]),d=!0,p=i.origin,f=i.valid):(u=c,d=!1),new S(t.level,t.resolution,t.scale,r,o,a,c,n,u,d,p,f)}constructor(e,t,s,i,r,n,o,a,c,l,h,u){this.level=e,this.resolution=t,this.scale=s,this.origin=i,this.first=r,this.last=n,this.size=o,this.norm=a,this.worldSize=c,this.wrap=l,this._spatialReferenceOrigin=h,this._spatialReferenceValid=u}normalizeCol(e){if(!this.wrap)return e;const t=this.worldSize[0];return e<0?t-1-Math.abs((e+1)%t):e%t}normalizeKey(e){if(!this.wrap)return;const t=this.worldSize[0],s=e.col;s<0?(e.col=s+t,e.world-=1):s>=t&&(e.col=s-t,e.world+=1)}denormalizeCol(e,t){return this.wrap?this.worldSize[0]*t+e:e}getWorldForColumn(e){return this.wrap?Math.floor(e/this.worldSize[0]):0}getFirstColumnForWorld(e){return e*this.worldSize[0]+this.first[0]}getLastColumnForWorld(e){return e*this.worldSize[0]+this.first[0]+this.size[0]-1}getColumnForX(e){return(e-this.origin[0])/this.norm[0]}getXForColumn(e){const t=this.origin[0]+e*this.norm[0],s=this._spatialReferenceOrigin,i=this._spatialReferenceValid;return this.wrap&&s&&i?t===s[0]?i[0]:this.origin[0]===s[0]&&e===this.worldSize[0]?i[1]:t:t}getRowForY(e){return(this.origin[1]-e)/this.norm[1]}getYForRow(e){return this.origin[1]-e*this.norm[1]}getTileBounds(e,t,s=!1){I.set(t);const i=s?I.col:this.denormalizeCol(I.col,I.world),r=I.row;return function(e,t,s,i,r){e[0]=t,e[1]=s,e[2]=i,e[3]=r}(e,this.getXForColumn(i),this.getYForRow(r+1),this.getXForColumn(i+1),this.getYForRow(r)),e}getTileCoords(e,t,s=!1){I.set(t);const i=s?I.col:this.denormalizeCol(I.col,I.world);return Array.isArray(e)?v(e,this.getXForColumn(i),this.getYForRow(I.row)):(e.x=this.getXForColumn(i),e.y=this.getYForRow(I.row)),e}}var k=s(93687);class M{constructor(){this.spans=[]}static{this.pool=new k.A(()=>new M)}acquire(e){this.lodInfo=e}release(){this.lodInfo=null,this.spans.length=0}*keys(){const e=this.lodInfo;for(const{row:t,colFrom:s,colTo:i}of this.spans)for(let r=s;r<=i;r++){const s=e.getWorldForColumn(r);yield new b.A(e.level,t,e.normalizeCol(r),s)}}forEach(e,t){const{spans:s,lodInfo:i}=this,{level:r}=i;if(0!==s.length)for(const{row:n,colFrom:o,colTo:a}of s)for(let s=o;s<=a;s++)e.call(t,r,n,i.normalizeCol(s),i.getWorldForColumn(s))}}class T{constructor(e,t,s){this.row=e,this.colFrom=t,this.colTo=s}}const A=new b.A("0/0/0/0");class P{static create(e,t){e[1]>t[1]&&([e,t]=[t,e]);const[s,i]=e,[r,n]=t,o=r-s,a=n-i,c=0!==a?o/a:0,l=(Math.ceil(i)-i)*c,h=(Math.floor(i)-i)*c;return new P(s,Math.floor(i),Math.ceil(n),c,o<0?l:h,o<0?h:l,o<0?r:s,o<0?s:r)}constructor(e,t,s,i,r,n,o,a){this.x=e,this.ymin=t,this.ymax=s,this.invM=i,this.leftAdjust=r,this.rightAdjust=n,this.leftBound=o,this.rightBound=a}incrRow(){this.x+=this.invM}getLeftCol(){return Math.max(this.x+this.leftAdjust,this.leftBound)}getRightCol(){return Math.min(this.x+this.rightAdjust,this.rightBound)}}const C=[[0,0],[0,0],[0,0],[0,0]];class F{constructor(e,t=null,s=e.lods[0].level,i=e.lods[e.lods.length-1].level){this.tileInfo=e,this.fullExtent=t,this.scales=[],this._infoByScale={},this._infoByLevel={};const r=e.lods.filter(e=>e.level>=s&&e.level<=i);this.minScale=r[0].scale,this.maxScale=r[r.length-1].scale;const n=this._lodInfos=r.map(s=>S.create(e,s,t));r.forEach((e,t)=>{this._infoByLevel[e.level]=n[t],this._infoByScale[e.scale]=n[t],this.scales[t]=e.scale},this),this._wrap=e.isWrappable}get spatialReference(){return this.tileInfo.spatialReference}get origin(){return this.tileInfo.origin}get size(){return this.tileInfo.size}getLODInfoAt(e){return this._infoByLevel["number"==typeof e?e:e.level]}getTileBounds(e,t,s=!1){A.set(t);const i=this._infoByLevel[A.level];return i?i.getTileBounds(e,A,s):e}getTileCoords(e,t,s=!1){A.set(t);const i=this._infoByLevel[A.level];return i?i.getTileCoords(e,A,s):e}getTileCoverage(e,t=192,s=!0,i="closest"){if(!s&&(e.scale>this.minScale||e.scale<this.maxScale))return null;const r="closest"===i?this.getClosestInfoForScale(e.scale):this.getSmallestInfoForScale(e.scale),n=M.pool.acquire(r),o=this._wrap;let a,c,l,h=1/0,u=-1/0;const d=n.spans;C[0][0]=C[0][1]=C[1][1]=C[3][0]=-t,C[1][0]=C[2][0]=e.size[0]+t,C[2][1]=C[3][1]=e.size[1]+t;for(const t of C)e.toMap(t,t),t[0]=r.getColumnForX(t[0]),t[1]=r.getRowForY(t[1]);const p=[];let f=3;for(let e=0;e<4;e++){if(C[e][1]===C[f][1]){f=e;continue}const t=P.create(C[e],C[f]);h=Math.min(t.ymin,h),u=Math.max(t.ymax,u),void 0===p[t.ymin]&&(p[t.ymin]=[]),p[t.ymin].push(t),f=e}if(null==h||null==u||u-h>100)return null;let m=[];for(a=h;a<u;){null!=p[a]&&(m=m.concat(p[a])),c=1/0,l=-1/0;for(let e=m.length-1;e>=0;e--){const t=m[e];c=Math.min(c,t.getLeftCol()),l=Math.max(l,t.getRightCol())}if(c=Math.floor(c),l=Math.floor(l),a>=r.first[1]&&a<=r.last[1])if(o)if(r.size[0]<r.worldSize[0]){const e=Math.floor(l/r.worldSize[0]);for(let t=Math.floor(c/r.worldSize[0]);t<=e;t++)d.push(new T(a,Math.max(r.getFirstColumnForWorld(t),c),Math.min(r.getLastColumnForWorld(t),l)))}else d.push(new T(a,c,l));else c>r.last[0]||l<r.first[0]||(c=Math.max(c,r.first[0]),l=Math.min(l,r.last[0]),d.push(new T(a,c,l)));a+=1;for(let e=m.length-1;e>=0;e--){const t=m[e];t.ymax>=a?t.incrRow():m.splice(e,1)}}return n}getTileParentId(e){A.set(e);const t=this._infoByLevel[A.level],s=this._lodInfos.indexOf(t)-1;return s<0?null:(this._getTileIdAtLOD(A,this._lodInfos[s],A),A.id)}getTileResolution(e){const t=this._infoByLevel["object"==typeof e?e.level:e];return t?t.resolution:-1}getTileScale(e){const t=this._infoByLevel[e.level];return t?t.scale:-1}intersects(e,t){A.set(t);const s=this._infoByLevel[A.level],i=e.lodInfo;if(i.resolution>s.resolution){this._getTileIdAtLOD(A,i,A);const t=i.denormalizeCol(A.col,A.world);for(const s of e.spans)if(s.row===A.row&&s.colFrom<=t&&s.colTo>=t)return!0}if(i.resolution<s.resolution){const[t,r,n,o]=e.spans.reduce((e,t)=>(e[0]=Math.min(e[0],t.row),e[1]=Math.max(e[1],t.row),e[2]=Math.min(e[2],t.colFrom),e[3]=Math.max(e[3],t.colTo),e),[1/0,-1/0,1/0,-1/0]),a=s.denormalizeCol(A.col,A.world),c=i.getColumnForX(s.getXForColumn(a)),l=i.getRowForY(s.getYForRow(A.row)),h=i.getColumnForX(s.getXForColumn(a+1))-1,u=i.getRowForY(s.getYForRow(A.row+1))-1;return!(c>o||h<n||l>r||u<t)}const r=i.denormalizeCol(A.col,A.world);return e.spans.some(e=>e.row===A.row&&e.colFrom<=r&&e.colTo>=r)}normalizeBounds(e,t,s){if(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],this._wrap){const t=(0,x.Vp)(this.tileInfo.spatialReference),i=-s*(t.valid[1]-t.valid[0]);e[0]+=i,e[2]+=i}return e}getSmallestInfoForScale(e){const t=this.scales;if(this._infoByScale[e])return this._infoByScale[e];if(e>t[0])return this._infoByScale[t[0]];for(let s=1;s<t.length-1;s++)if(e>t[s]+1e-6)return this._infoByScale[t[s-1]];return this._infoByScale[t[t.length-1]]}getClosestInfoForScale(e){const t=this.scales;return this._infoByScale[e]||(e=t.reduce((t,s)=>Math.abs(s-e)<Math.abs(t-e)?s:t,t[0])),this._infoByScale[e]}scaleToLevel(e){const t=this.scales;if(this._infoByScale[e])return this._infoByScale[e].level;for(let s=t.length-1;s>=0;s--)if(e<t[s])return s===t.length-1?this._infoByScale[t[t.length-1]].level:this._infoByScale[t[s]].level+(t[s]-e)/(t[s]-t[s+1]);return this._infoByScale[t[0]].level}scaleToZoom(e){return this.tileInfo.scaleToZoom(e)}zoomToScale(e){return this.tileInfo.zoomToScale(e)}_getTileIdAtLOD(e,t,s){const i=this._infoByLevel[s.level];return e.set(s),t.resolution<i.resolution?null:(t.resolution===i.resolution||(e.level=t.level,e.col=Math.floor(s.col*i.resolution/t.resolution+.01),e.row=Math.floor(s.row*i.resolution/t.resolution+.01)),e)}}var E=s(5482),R=s(69622),z=s(91869),O=s(3483),L=s(91429),D=s(37585),N=s(9775),q=s(32587),B=s(76030),G=s(44794);class j{constructor(e,t){this.item=e,this.controller=t,this.promise=null}}class U{constructor(e){this._schedule=null,this._task=null,this._deferreds=new q.A,this._controllers=new q.A,this._processingItems=new q.A,this._pausedSignal=(0,G.v)(!1),this.concurrency=1,e.concurrency&&(this.concurrency=e.concurrency),this._queue=new N.A(e.peeker),this.process=e.process;const t=e.scheduler;e.priority&&t&&(this._task=t.registerTask(e.priority,this))}destroy(){this.clear(),this._schedule=(0,m.xt)(this._schedule),this._task=(0,m.xt)(this._task)}get updating(){return!!this._task?.updating||this.readyToRun}get length(){return this._processingItems.size+this._queue.length}abort(e){const t=this._controllers.get(e);t&&t.abort()}clear(){this._queue.clear();const e=[];this._controllers.forEach(t=>e.push(t)),this._controllers.clear(),e.forEach(e=>e.abort()),this._processingItems.clear(),this._cancelNext()}forEach(e){this._deferreds.forEach((t,s)=>e(s))}get(e){const t=this._deferreds.get(e);return t?t.promise:void 0}isOngoing(e){return this._processingItems.has(e)}has(e){return this._deferreds.has(e)}pause(){this._pausedSignal.value||(this._pausedSignal.value=!0,this._cancelNext())}push(e,t){const s=this.get(e);if(s)return s;const i=new AbortController;let r=null;t&&(r=(0,a.u7)(t,()=>i.abort()));const n=()=>{o.remove(),null!=r&&r.remove(),this._removeItem(e),this._queue.remove(e),this._scheduleNext()},o=(0,a.NY)(i.signal,()=>{const t=this._processingItems.get(e);t&&t.controller.abort(),n(),c.reject((0,a.NK)())}),c=Promise.withResolvers();return this._deferreds.set(e,c),this._controllers.set(e,i),c.promise.then(n,n),this._queue.push(e),this._scheduleNext(),c.promise}last(){return this._queue.last()}lastPromise(){const e=this.last();return e?this.get(e):null}peek(){return this._queue.peek()}popLast(){const e=this._queue.popLast();return e&&(this._deferreds.get(e)?.reject((0,a.NK)()),this._removeItem(e)),e}reset(){const e=Array.from(this._processingItems.values());this._processingItems.clear();for(const t of e)this._queue.push(t.item),t.controller.abort();this._scheduleNext()}resume(){this._pausedSignal.value&&(this._pausedSignal.value=!1,this._scheduleNext())}takeAll(){const e=[];for(;this._queue.length;)e.push(this._queue.pop());return this.clear(),e}get readyToRun(){return!this._pausedSignal.value&&this._queue.length>0&&this._processingItems.size<this.concurrency}runTask(e){for(;!e.done&&this._queue.length>0&&this._processingItems.size<this.concurrency;)this._process(this._queue.pop()),e.madeProgress()}_removeItem(e){this._deferreds.delete(e),this._controllers.delete(e),this._processingItems.delete(e)}_scheduleNext(){this._task||this._pausedSignal.value||this._schedule||(this._schedule=(0,B._)(()=>{this._schedule=null,this._next()}))}_next(){for(;this._queue.length>0&&this._processingItems.size<this.concurrency;)this._process(this._queue.pop())}_cancelNext(){this._schedule&&(this._schedule.remove(),this._schedule=null)}_processResult(e,t){this._canProcessFulfillment(e)&&(this._scheduleNext(),this._deferreds.get(e.item).resolve(t))}_processError(e,t){this._canProcessFulfillment(e)&&(this._scheduleNext(),this._deferreds.get(e.item).reject(t))}_canProcessFulfillment(e){return!!this._deferreds.get(e.item)&&this._processingItems.get(e.item)===e}_process(e){if(null==e)return;let t;const s=new AbortController,i=new j(e,s);this._processingItems.set(e,i);try{t=this.process(e,s.signal)}catch(e){this._processError(i,e)}(0,a.$X)(t)?(i.promise=t,t.then(e=>this._processResult(i,e),e=>this._processError(i,e))):this._processResult(i,t)}get test(){}}const V=[0,0];let W=class extends R.A{constructor(e){super(e),this._keyToItem=new Map,this._tilesByScale=new Map,this.concurrency=6}initialize(){const{concurrency:e,process:t,scheduler:s,priority:i}=this;this._queue=new U({concurrency:e,scheduler:s,priority:i,process:(e,s)=>{const i=this._keyToItem.get(e);return t(i,{signal:s})},peeker:e=>this._peek(e)})}destroy(){this.clear(),this._queue=(0,m.pR)(this._queue)}get length(){return this._queue?this._queue.length:0}abort(e){const t="string"==typeof e?e:e.id;this._queue.abort(t)}clear(){this._queue.clear(),this._keyToItem.clear(),this._tilesByScale.clear()}has(e){return"string"==typeof e?this._keyToItem.has(e):this._keyToItem.has(e.id)}pause(){this._queue.pause()}push(e){const t=e.key.id;if(this._queue.has(t))return this._queue.get(t);const s=this._queue.push(t),i=this.tileInfoView.getTileScale(e.key),r=(0,z.tE)(this._tilesByScale,i,()=>new Set),n=()=>{r.delete(e.key),0===r.size&&this._tilesByScale.delete(i),this._keyToItem.delete(t)};return r.add(e.key),this._keyToItem.set(t,e),s.then(n,n),s}reset(){this._queue.reset()}resume(){this._queue.resume()}_peek(e){if(!this.state)return e.values().next().value;const t=new Set;for(const s of e)t.add(this._keyToItem.get(s).key);const s=this.state.scale;let i,r=Number.POSITIVE_INFINITY;for(const[e,n]of this._tilesByScale)if((0,O.bw)(n,e=>t.has(e))){const t=Math.abs(e-s);t<r&&(i=n,r=t)}return this._getClosestTileKey(i,e).id}_getClosestTileKey(e,t){const s=this.tileInfoView,i=this.state.center;let r,n=Number.POSITIVE_INFINITY;for(const o of e)if(t.has(o.id)){s.getTileCoords(V,o);const e=(0,D.Io)(V,i);e<n&&(n=e,r=o)}return r}};(0,E.Cg)([(0,L.MZ)({constructOnly:!0})],W.prototype,"concurrency",void 0),(0,E.Cg)([(0,L.MZ)({constructOnly:!0})],W.prototype,"priority",void 0),(0,E.Cg)([(0,L.MZ)({constructOnly:!0})],W.prototype,"process",void 0),(0,E.Cg)([(0,L.MZ)({constructOnly:!0})],W.prototype,"scheduler",void 0),(0,E.Cg)([(0,L.MZ)()],W.prototype,"state",void 0),(0,E.Cg)([(0,L.MZ)({constructOnly:!0})],W.prototype,"tileInfoView",void 0),W=(0,E.Cg)([(0,L.$K)("esri.views.2d.tiling.TileQueue")],W);var Y=s(19419);new b.A(0,0,0,0),new Map;class ${static{this.byteSizeHint=7*Uint32Array.BYTES_PER_ELEMENT}static{this.estimatedMemory=40}constructor(e,t,s,i,r,n,o){this.instanceId=e,this.textureKey=t,this.indexStart=s,this.indexCount=i,this.vertexStart=r,this.vertexCount=n,this.overlaps=o}updateBaseOffsets(e){this.vertexStart+=e.vertexFrom,this.indexStart+=e.indexFrom}clone(){return new $(this.instanceId,this.textureKey,this.indexStart,this.indexCount,this.vertexStart,this.vertexCount,this.overlaps)}static write(e,t,s,i,r,n,o,a){e.push(t),e.push(s),e.push(i),e.push(r),e.push(n),e.push(o),e.push(a)}serialize(e){return e.push(this.instanceId),e.push(this.textureKey),e.push(this.indexStart),e.push(this.indexCount),e.push(this.vertexStart),e.push(this.vertexCount),e.push(this.overlaps),e}static deserialize(e){const t=e.readInt32(),s=e.readInt32(),i=e.readInt32(),r=e.readInt32(),n=e.readInt32(),o=e.readInt32(),a=e.readInt32();return new $(t,s,i,r,n,o,a)}}function H(e,t){if(null!==t){e.push(t.length);for(const s of t)s.serialize(e);return e}e.push(0)}function Q(e,t,s){const i=e.readInt32(),r=new Array(i);for(let i=0;i<r.length;i++)r[i]=t.deserialize(e,s);return r}class Z{static{this.byteSizeHint=2*Uint32Array.BYTES_PER_ELEMENT+$.byteSizeHint}static estimateMemory(e){return 24+$.estimatedMemory*e}constructor(e,t){this.id=e,this.sortKey=t,this.records=[]}serialize(e){return e.push(this.id),e.writeF32(this.sortKey),H(e,this.records),e}static deserialize(e){const t=e.readInt32(),s=e.readF32(),i=new Z(t,s);return i.records=Q(e,$)??[],i}}class X{get length(){return this._pos}constructor(e,t){this._pos=0;const s=t?this._roundToNearest(t,e.BYTES_PER_ELEMENT):40;this._array=new ArrayBuffer(s),this._buffer=new e(this._array),this._ctor=e,this._i16View=new Int16Array(this._array)}_roundToNearest(e,t){const s=Math.round(e);return 1===t?s:s+(t-s%t)}_ensureSize(e){if(this._pos+e>=this._buffer.length){const t=this._roundToNearest(1.25*(this._array.byteLength+e*this._buffer.BYTES_PER_ELEMENT),this._buffer.BYTES_PER_ELEMENT),s=new ArrayBuffer(t),i=new this._ctor(s);i.set(this._buffer,0),this._array=s,this._buffer=i,this._i16View=new Int16Array(this._array)}}ensureSize(e){this._ensureSize(e)}writeF32(e){this._ensureSize(1);const t=this._pos;return new Float32Array(this._array,4*this._pos,1)[0]=e,this._pos++,t}push(e){this._ensureSize(1);const t=this._pos;return this._buffer[this._pos++]=e,t}writeFixed(e){this._buffer[this._pos++]=e}setValue(e,t){this._buffer[e]=t}i1616Add(e,t,s){this._i16View[2*e]+=t,this._i16View[2*e+1]+=s}getValue(e){return this._buffer[e]}getValueF32(e){return new Float32Array(this._array,4*e,1)[0]}incr(e){if(this._buffer.length<e)throw new Error("Increment index overflows the target buffer");this._buffer[e]++}decr(e){this._buffer[e]--}writeRegion(e){this._ensureSize(e.length);const t=this._pos;return this._buffer.set(e,this._pos),this._pos+=e.length,t}writeManyFrom(e,t,s){this._ensureSize(s-t);for(let i=t;i!==s;i++)this.writeFixed(e._buffer[i])}buffer(){const e=this._array.slice(0,4*this._pos);return this.destroy(),e}toArray(){return[...this._buffer]}seek(e){this._pos=e}destroy(){this._array=null,this._buffer=null}}class K{constructor(e,t,s=0){const i=6*s*Uint32Array.BYTES_PER_ELEMENT,r=4*s*t.stride,n=t.stride/4,o=t.attributes.find(e=>"pos"===e.name||"position"===e.name);if(!o)throw new Error("InternalError: Unable to find position attribute");this.layout={...t,position:o},this._indices=new X(Uint32Array,i),this._vertices=new X(Uint32Array,r),this._metrics=new X(Uint32Array,0),this._metricCountOffset=this._metrics.push(0),this._strideInt=n,this._instanceId=e}serialize(e){const t=this._indices.buffer(),s=this._vertices.buffer(),i=this._metrics.length?this._metrics.buffer():null;return e.push(t,s),{instanceId:this._instanceId,layout:this.layout,indices:t,vertices:s,metrics:i}}get strideInt(){return this._strideInt}get vertexCount(){return this._vertices.length/this._strideInt}get indexCount(){return this._indices.length}get indexWriter(){return this._indices}get vertexWriter(){return this._vertices}get metricWriter(){return this._metrics}vertexEnsureSize(e){this._vertices.ensureSize(e)}indexEnsureSize(e){this._indices.ensureSize(e)}writeIndex(e){this._indices.push(e)}writeVertex(e){this._vertices.push(e)}writeVertexRegion(e){this._vertices.writeRegion(e)}writeVertexF32(e){this._vertices.writeF32(e)}writeMetric(e){this._metrics.incr(this._metricCountOffset),e.serialize(this._metrics)}}class J{constructor(e,t=0){this._id=e,this._sizeHint=t,this._entityRecordCountOffset=0,this._entityCountOffset=0,this._entityIdIndex=0,this._entitySortKeyIndex=0,this._didEntityStart=!1,this._instanceIdToVertexData=new Map,this._recordIndexStart=0,this._recordIndexCount=0,this._recordVertexStart=0,this._recordVertexCount=0,this._current={metric:null,writer:null,start:0,sortKey:0,instanceId:0,layoutHash:0,indexStart:0,vertexStart:0,textureKey:0,metricBoxLenPointer:0},this._requiresRefresh=!1,this._entities=new X(Uint32Array,this._sizeHint*Z.byteSizeHint),this._entityCountOffset=this._entities.push(0)}get id(){return this._id}serialize(){const e=new Array,t=[],s=this._entities.buffer();for(const s of this._instanceIdToVertexData.values())t.push(s.serialize(e));return{message:{data:t,entities:s},transferList:e}}get requiresRefresh(){return this._requiresRefresh}set requiresRefresh(e){this._requiresRefresh=e}vertexStart(){return this._current.vertexStart??0}vertexCount(){return this._current.writer?.vertexCount??0}indexCount(){return this._current.writer?.indexCount??0}vertexEnsureSize(e){this._current.writer.vertexEnsureSize(e)}indexEnsureSize(e){this._current.writer.indexEnsureSize(e)}vertexWrite(e){this._current.writer.writeVertex(e)}vertexWriteRegion(e){this._current.writer.writeVertexRegion(e)}vertexWriteF32(e){this._current.writer.writeVertexF32(e)}recordBounds(e,t,s,i){}indexWrite(e){this._current.writer.writeIndex(e)}metricStart(e){this._current.metric=e,this._current.metric.recordStart=this.recordCount()}metricEnd(){const e=this._current.writer;this._current.metric&&(this._current.metric.recordCount=this.recordCount()-this._current.metric.recordStart),this._current.metric?.bounds.length&&this._current.metric?.recordCount?(e.writeMetric(this._current.metric),this._current.metric=null):this._current.metric=null}metricBoxWrite(e){this._current.metric.bounds.push(e)}entityStart(e,t=e){this._entityIdIndex=this._entities.push(e),this._entitySortKeyIndex=this._entities.writeF32(t),this._entityRecordCountOffset=this._entities.push(0),this._didEntityStart=!0}entityRecordCount(){return this._entities.getValue(this._entityRecordCountOffset)}entityEnd(){this._didEntityStart&&(0===this.entityRecordCount()?this._entities.seek(this._entityIdIndex):this._entities.incr(this._entityCountOffset),this._didEntityStart=!1)}recordCount(){return this._entities.getValue(this._entityRecordCountOffset)}recordStart(e,t,s=0){this._current.writer=this._getVertexWriter(e,t),this._current.indexStart=this._current.writer.indexCount,this._current.vertexStart=this._current.writer.vertexCount,this._current.instanceId=e,this._current.layoutHash=t.hash,this._current.textureKey=s}recordEnd(e=0){const t=this._current.vertexStart,s=this._current.writer.vertexCount-t;if(!s)return!1;const i=this._current.indexStart,r=this._current.writer.indexCount-i;return this._recordIndexStart=i,this._recordIndexCount=r,this._recordVertexStart=t,this._recordVertexCount=s,this._entities.incr(this._entityRecordCountOffset),$.write(this._entities,this._current.instanceId,this._current.textureKey,i,r,t,s,e),!0}copyLast(e,t){const s=this._recordVertexStart+this._recordVertexCount;this._entities.incr(this._entityRecordCountOffset),$.write(this._entities,this._current.instanceId,this._current.textureKey,this._recordIndexStart+this._recordIndexCount,this._recordIndexCount,s,this._recordVertexCount,0);const i=this._current.writer.indexWriter,r=this._current.writer.vertexWriter,n=this._recordIndexStart+this._recordIndexCount,o=this._recordVertexCount;for(let e=this._recordIndexStart;e!==n;e++){const t=i.getValue(e);i.push(t+o)}const a=this._current.writer.layout.stride/Uint32Array.BYTES_PER_ELEMENT,c=this._recordVertexStart*a,l=(this._recordVertexStart+this._recordVertexCount)*a;for(let e=c;e!==l;e++){const t=r.getValue(e);r.push(t)}const h=this._current.writer.layout.position,u=h.packPrecisionFactor??1,d=h.offset/Uint32Array.BYTES_PER_ELEMENT,p=e*u,f=t*u;for(let e=s*a;e<=r.length;e+=a)r.i1616Add(e+d,p,f)}copyLastFrom(e,t,s){const i=e._entities.getValue(e._entityIdIndex),r=this._entities.getValue(this._entityIdIndex);if(!this._didEntityStart||i!==r){const t=e._entities.getValueF32(e._entitySortKeyIndex);this.entityStart(i,t)}this.recordStart(e._current.instanceId,e._current.writer.layout,e._current.textureKey);const n=this._current.writer.layout.stride/Uint32Array.BYTES_PER_ELEMENT,o=this._current.vertexStart,a=e._current.vertexStart-o,c=this._current.writer.indexWriter,l=this._current.writer.vertexWriter,h=e._current.writer.indexWriter,u=e._current.writer.vertexWriter;for(let t=e._current.indexStart;t!==h.length;t++){const e=h.getValue(t);c.push(e-a)}for(let t=e._current.vertexStart*n;t!==u.length;t++){const e=u.getValue(t);l.push(e)}const d=this._current.writer.layout.position,p=d.packPrecisionFactor??1,f=d.offset/Uint32Array.BYTES_PER_ELEMENT,m=t*p,_=s*p;for(let e=o*n;e<=l.length;e+=n)l.i1616Add(e+f,m,_);this.recordEnd()}_getVertexWriter(e,t){const s=this._instanceIdToVertexData;return s.has(e)||s.set(e,new K(e,t,this._sizeHint)),s.get(e)}}function ee(e){switch(e){case 1:case 8:case 32:return-1;case 2:case 64:return 0;case 4:case 16:case 128:return 1}}function te(e){switch(e){case 1:case 2:case 4:return-1;case 8:case 16:return 0;case 32:case 64:case 128:return 1}}class se{constructor(e,t,s,i,r=0){this.tileKey=e,this._bufferingEnabled=t,this._sizeHint=r,this._meshes={self:new J(this.id,this._sizeHint),neighbors:new Array},this._currentRecordOverlaps=0,this._currentEntityOverlaps=0;const n=i?1:0;this._copyBufferedDataIntoSelf=s&&this._bufferingEnabled&&e.level===n}get id(){return this.tileKey.id}get requiresRefresh(){return this._meshes.self.requiresRefresh||this._meshes.neighbors.some(e=>e.requiresRefresh)}set requiresRefresh(e){this._meshes.self.requiresRefresh=e}vertexStart(){return this._meshes.self.vertexStart()??0}vertexCount(){return this._meshes.self.vertexCount()}indexCount(){return this._meshes.self.indexCount()}indexEnsureSize(e){this._meshes.self.indexEnsureSize(e)}entityStart(e,t=e){this._currentEntityOverlaps=0,this._meshes.self.entityStart(e,t)}entityRecordCount(){return this._meshes.self.entityRecordCount()}entityEnd(){if(this._meshes.self.entityEnd(),this._bufferingEnabled){if(this._copyBufferedDataIntoSelf)return;for(let e=0;e<8;e++){const t=1<<e;this._currentEntityOverlaps&t&&this._meshes.neighbors[e].entityEnd()}}}recordStart(e,t,s){this._currentRecordOverlaps=0,this._meshes.self.recordStart(e,t,s)}recordEnd(e=0){const t=this._meshes.self.recordEnd(this._currentRecordOverlaps);return t&&0!==this._currentRecordOverlaps?(this._copyIntoNeighbors(),this._currentEntityOverlaps|=this._currentRecordOverlaps,!0):t}recordBounds(e,t,s,i){this._bufferingEnabled&&this._addOverlap(e,t,s,i)}recordCount(){return this._meshes.self.recordCount()}metricStart(e){this._meshes.self.metricStart(e)}metricBoxWrite(e){this._meshes.self.metricBoxWrite(e)}metricEnd(){this._meshes.self.metricEnd()}vertexWrite(e){this._meshes.self.vertexWrite(e)}vertexWriteF32(e){this._meshes.self.vertexWriteF32(e)}vertexWriteRegion(e){this._meshes.self.vertexWriteRegion(e)}indexWrite(e){this._meshes.self.indexWrite(e)}serialize(e){const t={message:[],transferList:[]},s=this._meshes.self.serialize();return t.message.push({tileId:this.tileKey.id,requiresRefresh:this.requiresRefresh,...s.message}),t.transferList.push(...s.transferList),this._meshes.neighbors.forEach((s,i)=>{const r=s.serialize(),n=1<<i,o=ee(n),a=te(n),c=new b.A(this.tileKey).getNormalizedNeighbor(o,a,e);t.message.push({tileId:c.id,requiresRefresh:this.requiresRefresh,...r.message}),t.transferList.push(...r.transferList)}),t}_addOverlap(e,t,s,i){const r=Math.min(p.CQ/2,s),n=Math.min(p.CQ/2,i),o=255^((e<0+r?148:e>=p.CQ-r?41:189)|(t<0+n?224:t>=p.CQ-n?7:231));this._currentRecordOverlaps|=o}_copyIntoNeighbors(){for(let e=0;e<8;e++){const t=1<<e;if(this._currentRecordOverlaps&t){if(this._copyBufferedDataIntoSelf){const e=-ee(t)*p.CQ,s=-te(t)*p.CQ;if(0!==s)continue;this._meshes.self.copyLast(e,s);continue}if(!this._meshes.neighbors[e]){const s=Math.floor(this._sizeHint/16);this._meshes.neighbors[e]=new J(t,s)}const s=this._meshes.neighbors[e],i=-ee(t)*p.CQ,r=-te(t)*p.CQ;s.copyLastFrom(this._meshes.self,i,r)}}}}class ie{}var re=s(72691),ne=s(55674),oe=s(50115);class ae{constructor(){this._defaultResult=null,this._backgroundFillResult=null}static async from(e,t){const s=new ae;return s.setDefault(await e.createMeshWriters(t.meshes)),s}size(){return 1}getDefault(){return this._defaultResult}setDefault(e){this._defaultResult=e}getBackgroundFill(){return this._backgroundFillResult}setBackgroundFill(e){this._backgroundFillResult=e}hasArcadeDependency(e){return this._defaultResult?.some(t=>t.hasArcadeDependency(e))??!1}match(e,t,s){const i=this.doMatch(e,t)||this.getDefault();if(i&&i.length>0){const e=this.getBackgroundFill();if(e)return[...e,...i]}return i}cleanup(e,t,s,i,r){}getSortKey(e,t){return 0}doMatch(e,t){return null}async fetchResources(e,t,s,i){}}function ce(e){return he(le(e))}function le(e){if(null==e)return e;if(Array.isArray(e))return e.map(e=>le(e));if("object"==typeof e){if("CIMRGBColor"===e.type){const[t,s,i,r]=e.values;return[t,s,i,255*r/100]}const t={};for(const s in e)t[s]=le(e[s]);return t}return e}function he(e){if(null==e)return e;if(Array.isArray(e))return e.map(e=>he(e));if("object"==typeof e){if("CIMCharacterMarker"===e.type)return{type:"CIMVectorMarker",enable:!0,size:40,colorLocked:!1,anchorPointUnits:"Relative",frame:{xmin:-10,ymin:-10,xmax:10,ymax:10},markerGraphics:[{type:"CIMMarkerGraphic",textString:"■",geometry:{x:0,y:0},symbol:{type:"CIMTextSymbol",underline:!1,blockProgression:"TTB",depth3D:0,extrapolateBaselines:!0,flipAngle:90,fontEffects:"Normal",fontEncoding:"Unicode",haloSize:0,height:8,hinting:"Default",horizontalAlignment:"Center",kerning:!0,letterSpacing:10,letterWidth:100,ligatures:!1,lineGapType:"ExtraLeading",symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:[0,0,0,255]}]},symbol3DProperties:{type:"CIM3DSymbolProperties",dominantSizeAxis3D:"Z",rotationOrder3D:"XYZ",scaleZ:1,scaleY:1},textCase:"Normal",textDirection:"LTR",verticalAlignment:"Center",verticalGlyphOrientation:"Right",wordSpacing:100,billboardMode3D:"FaceNearPlane"}}],scaleSymbolsProportionally:!0,respectFrame:!0};const t={};for(const s in e)t[s]=he(e[s]);return t}return e}let ue=0;class de{}class pe extends de{constructor(e,t){super(),this.kind="feature";const s=`__virtual_fi_${e}`;this.realField={name:s,alias:s,type:t}}addToFeature(e,t){const s=this.getValue(t);e.attributes[this.realField.name]=s}addToSymbol(e){const t=this.findTargetNode(e);let{primitiveName:s}=t;s||(ue++,s=`primitive_${ue}`,t.primitiveName=s);const i={type:"CIMPrimitiveOverride",primitiveName:s,propertyName:this.cimPropertyName,valueExpressionInfo:{type:"CIMExpressionInfo",expression:`return $feature.${this.realField.name};`}};e.primitiveOverrides=e.primitiveOverrides||[],e.primitiveOverrides.push(i)}}class fe extends de{constructor(){super(...arguments),this.kind="symbol"}addToSymbol(e,t){const s=this.getValue(t);null!=s&&(this.findTargetNode(e)[this._fixCase(this.cimPropertyName)]=s)}_fixCase(e){return this.cimPropertyName[0].toLocaleLowerCase()+e.slice(1)}}const me=new class extends pe{constructor(){super("text","esriFieldTypeString"),this.cimPropertyName="TextString"}findTargetNode(e){return e.symbol.symbolLayers[0].markerGraphics[0]}getValue(e){return e.graphic?e.graphic.text:e.text}},_e=new class extends pe{constructor(){super("color","esriFieldTypeString"),this.cimPropertyName="Color"}findTargetNode(e){return e.symbol.symbolLayers[0].markerGraphics[0].symbol.symbol.symbolLayers.find(e=>"CIMSolidFill"===e.type)}getValue(e){const t=e.color||"#000000";if(t.startsWith("#"))return t;if(t.startsWith("rgb"))return t;const s=le(JSON.parse(t));return`rgba(${s[0]}, ${s[1]}, ${s[2]}, ${s[3]/255})`}},ye=new class extends pe{constructor(){super("rotation","esriFieldTypeDouble"),this.cimPropertyName="Rotation"}findTargetNode(e){return e.symbol.symbolLayers[0]}getValue(e){return null!=e.textAngle?-e.textAngle:void 0}},ge=new class extends pe{constructor(){super("offsetX","esriFieldTypeDouble"),this.cimPropertyName="OffsetX"}findTargetNode(e){return e.symbol.symbolLayers[0]}getValue(e){return e.xOffset}},xe=new class extends pe{constructor(){super("offsetY","esriFieldTypeDouble"),this.cimPropertyName="OffsetY"}findTargetNode(e){return e.symbol.symbolLayers[0]}getValue(e){return e.yOffset}},be=new class extends fe{constructor(){super(...arguments),this.cimPropertyName="Height"}findTargetNode(e){return e.symbol.symbolLayers[0].markerGraphics[0].symbol}getValue(e){return e.size}},we=new class extends fe{constructor(){super(...arguments),this.cimPropertyName="Underline"}findTargetNode(e){return e.symbol.symbolLayers[0].markerGraphics[0].symbol}getValue(e){return e.underline}},ve=[me,_e,ye,ge,xe],Ie=[new class extends fe{constructor(){super(...arguments),this.cimPropertyName="HorizontalAlignment"}findTargetNode(e){return e.symbol.symbolLayers[0].markerGraphics[0].symbol}getValue(e){return null==e.horizontalAlignment?null:["Left","Right","Center","Justify"][e.horizontalAlignment]}},new class extends fe{constructor(){super(...arguments),this.cimPropertyName="VerticalAlignment"}findTargetNode(e){return e.symbol.symbolLayers[0].markerGraphics[0].symbol}getValue(e){return null==e.verticalAlignment?null:["Top","Center","Baseline","Bottom"][e.verticalAlignment]}},new class extends fe{constructor(){super(...arguments),this.cimPropertyName="FontFamilyName"}findTargetNode(e){return e.symbol.symbolLayers[0].markerGraphics[0].symbol}getValue(e){return e.fontFamilyName}},new class extends fe{constructor(){super(...arguments),this.cimPropertyName="FontStyleName"}findTargetNode(e){return e.symbol.symbolLayers[0].markerGraphics[0].symbol}getValue(e){return e.fontStyleName}},be,we];function Se(e,t){let s,i;e=ce(e);let r=[];"line"===t?(s="CIMLineSymbol",i={type:"CIMMarkerPlacementOnLine",angleToLine:!0,offset:5,placePerPart:!1,relativeTo:"LineMiddle",startPointOffset:0,keepUpright:!1},r=ve.filter(e=>"Rotation"!==e.cimPropertyName)):"multipoint"===t?(s="CIMLineSymbol",i={type:"PrivatePlacementMultipoint"},r=ve):(s="CIMPointSymbol",i=void 0,r=ve);const n={type:"CIMSymbolReference",primitiveOverrides:[],symbol:{type:s,symbolLayers:[{type:"CIMVectorMarker",markerPlacement:i,enable:!0,size:40,colorLocked:!1,anchorPointUnits:"Relative",frame:{xmin:-20,ymin:-20,xmax:20,ymax:20},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{x:0,y:0},symbol:e}],scaleSymbolsProportionally:!0,respectFrame:!0}]}};for(const e of r)e.addToSymbol(n);return{data:n}}function ke(e){return{point:Se(e,"point"),line:Se(e,"line"),multipoint:Se(e,"multipoint")}}var Me=s(86738),Te=s(92722),Ae=s(31464),Pe=s(51624),Ce=s(65864),Fe=s(26306);function Ee(e){return function(e){return e.replaceAll(/\p{Cc}/gu,"")}(e.getString()||"")}function Re(e){return e?JSON.parse(e):null}function ze(e){if(e?.ga){const t=e?.ga?.map(e=>ze(e)).filter(e=>e);return{type:"geometry-bag",geometries:t}}const t=e?.g?.points;if(t)return{type:"custom-multipoint",points:t};const s=(0,Ce.rS)(e);return!s||"point"!==s.type&&"polyline"!==s.type?void 0:s}function Oe(e,t){if(e&&null!=t){if(1===t){const t=e.split(",").map(e=>parseFloat(e));return{type:"custom-point",x:t[0],y:t[1]}}if(2===t){const t=e.split(";").map(e=>e.split(",").map(e=>parseFloat(e)));return{type:"custom-two-point",from:[t[0][0],t[0][1]],to:[t[1][0],t[1][1]]}}return 3===t?{type:"custom-multipoint",points:e.split(";").map(e=>e.split(",").map(e=>parseFloat(e)))}:ze(JSON.parse(e))}}function Le({scale:e,translate:t},s){return(s-t[0])/e[0]}function De({scale:e,translate:t},s){return(s-t[1])/e[1]}function Ne(e,t,s,i){if("custom-point"===e.type||"point"===e.type){const{x:r,y:n}=e,o=(0,Ae.Cv)(new Me.A({x:r,y:n,spatialReference:t}),t,s);return new Te.A([1],[Le(i,o.x),De(i,o.y)])}if("custom-two-point"===e.type){const[r,n]=e.from,o=(0,Ae.Cv)(new Me.A({x:r,y:n,spatialReference:t}),t,s),[a,c]=e.to,l=(0,Ae.Cv)(new Me.A({x:a,y:c,spatialReference:t}),t,s);return new Te.A([2],[Le(i,o.x),De(i,o.y),Le(i,l.x),De(i,l.y)])}if("custom-multipoint"===e.type){const r=e.points.map(([e,i])=>(0,Ae.Cv)(new Me.A({x:e,y:i,spatialReference:t}),t,s)),n=r.map(({x:e,y:t})=>[Le(i,e),De(i,t)]).flat();return new Te.A([r.length],n)}if("geometry-bag"===e.type){let r=[],n=[],o=!0;for(const a of e.geometries){o||(r.push(2),n.push(0,0,1,1)),o=!1;const e=Ne(a,t,s,i);e&&(r=[...r,...e.lengths],n=[...n,...e.coords])}if(0===r.length||0===n.length)return;return new Te.A(r,n)}if("polyline"===e.type){const[r,n]=e.paths[0][0],o=(0,Ae.Cv)(new Me.A({x:r,y:n,spatialReference:t}),t,s),[a,c]=e.paths[0][1],l=(0,Ae.Cv)(new Me.A({x:a,y:c,spatialReference:t}),t,s);return new Te.A([2],[Le(i,o.x),De(i,o.y),Le(i,l.x),De(i,l.y)])}throw new Error("Unsupported geometry type!")}function qe(e){return function(e){const t={leader:[],anchorPoint:[],fontVariations:[]},s=(0,Fe.M)(e.toString()),i=new Pe.A(new Uint8Array(s),new DataView(s));for(;i.next();)switch(i.tag()){case 1:t.version=Ee(i);break;case 2:t.bloated=i.getBool();break;case 3:t.graphic=Re(Ee(i));break;case 4:t.geometryStorageType=i.getEnum();break;case 5:t.geometry=Oe(Ee(i),t.geometryStorageType);break;case 6:t.text=Ee(i);break;case 7:t.bloated?i.skip():t.symbolID=i.getUInt32();break;case 8:t.textAngle=i.getDouble();break;case 9:t.xOffset=i.getDouble();break;case 10:t.yOffset=i.getDouble();break;case 11:t.horizontalAlignment=i.getEnum();break;case 12:t.verticalAlignment=i.getEnum();break;case 13:t.flipAngle=i.getDouble();break;case 14:i.skip(),t.leader=[];break;case 15:i.skip(),t.anchorPoint=[];break;case 16:t.size=i.getDouble();break;case 17:t.color=Ee(i);break;case 18:t.characterSpacing=i.getDouble();break;case 19:t.characterWidth=i.getDouble();break;case 20:t.wordSpacing=i.getDouble();break;case 21:t.leading=i.getDouble();break;case 22:t.fontFamilyName=Ee(i);break;case 23:t.fontStyleName=Ee(i);break;case 24:t.underline=i.getBool();break;case 25:t.callout=Ee(i);break;case 26:i.skip(),t.fontVariations=[];break;default:i.skip()}return t}(e)}function Be(e,...t){const s={};for(const i of t)s[i]=e[i];return s}function Ge(e,t){return t[function(e,t){const s=e.toLowerCase();for(const e in t)if(s===e.toLowerCase())return e;return e}(e,t)]}class je extends ae{constructor(e,t,s){super(),this._context=e,this._schema=t,this._expression=s,this._meshWriters=new Map}static async fromAnnotationSchema(e,t){const{spatialReference:s}=e.viewParams.tileInfo,i=await(0,ne.Ad)("$feature.ELEMENT",s);return new je(e,t,i)}hasArcadeDependency(){return!0}doMatch(e){const t=this._getGroupCreator(e),{groupKey:s}=t;return this._meshWriters.get(s)}async fetchResources(e,t){const s=t.getCursor();for(;s.next();){const t=this._getGroupCreator(s),{groupKey:i}=t;let r=this._meshWriters.get(i);r||(r=await t.createGroup(this._context,this._schema,e)),this._meshWriters.set(i,r)}}_getGroupCreator(e){const t=qe((0,oe.V4)(this._expression,e,{}));return{get groupKey(){return"Annotation:"+JSON.stringify(Be(t,"horizontalAlignment","verticalAlignment","fontFamilyName","fontStyleName","size","underline","bloated","symbolID","flipAngle"))},async createGroup(e,s,i){const{symbolID:r}=t;let n=!1;for(const e of Ie)n=n||null!=e.getValue(t);const o=function(e){if(e.geometry){if("custom-two-point"===e.geometry.type)return"line";if("custom-multipoint"===e.geometry.type)return"multipoint";if("geometry-bag"===e.geometry.type){if("custom-multipoint"===e.geometry.geometries[0].type)return"multipoint";throw new Error("Unable to determine geometry type from annotation graphic")}if("custom-point"===e.geometry.type)return"point";if("polyline"===e.geometry.type)return"line";if("point"===e.geometry.type)return"point";throw new Error("Unable to determine geometry type from annotation graphic")}if(e.graphic){if("polyline"===e.graphic.geometry.type)return"line";if("point"===e.graphic.geometry.type)return"point";if("multipoint"===e.graphic.geometry.type)return"multipoint";throw new Error("Unable to determine geometry type from annotation graphic")}throw new Error("Unable to determine geometry type from annotation graphic")}(t);if(null==r||n){let n=null;if(null==r){const{graphic:e}=t;if(null!=e){const t=Se(e.symbol,o);n={type:"CIMSymbolReference",primitiveOverrides:[...t.data.primitiveOverrides||[],...e.symbol.primitiveOverrides||[]],symbol:t.data.symbol}}}else{const{symbolCollection:e}=s,t=function(e){const t={};for(const s of e){const e=s.iD??0,{symbol:i}=s,r=ke(i);t[e]=r}return t}(e)[r][o];n=t?.data||null}if(n){for(const e of Ie)e.addToSymbol(n,t);const s=await i.fetchMeshResourceImmediate({type:"mesh-request",symbolReference:n});return Ue(e,s?.meshes||[])}return[]}return Ue(e,s.meshes[r][o])}}}}function Ue(e,t){const s=t.map(e=>({...e}));return e.createMeshWriters(s)}var Ve=s(73681);class We extends ae{static async fromDictionaryRenderer(e,t){const s=await Ve.n.from(t.dictionaryInfo,t.userConfig,t.fieldMap);return new We(e,s)}constructor(e,t){super(),this._context=e,this._evaluator=t,this._controlStringToPromise=new Map,this._controlStringToGroup=new Map}async fetchResources(e,t){const s=t.getCursor(),i=new Set;for(;s.next();){const e=this._evaluateControlString(s);e&&i.add(e)}const r=Array.from(i.values()).map(t=>this._ensureGroup(e,t));await Promise.all(r)}match(e,t){const s=this._evaluateControlString(e);return s?this._controlStringToGroup.get(s):null}_evaluateControlString(e){const t=e.readLegacyFeatureWorldSpace();return this._evaluator.evaluate(t,0,e.fields,null)}_ensureGroup(e,t){let s=this._controlStringToPromise.get(t);return null==s&&(s=this._fetchGroup(e,t),this._controlStringToPromise.set(t,s)),s}async _fetchGroup(e,t){const s=await e.fetchDictionaryResourceImmediate({type:"dictionary-request",controlString:t});if(!s)return;const i=await this._context.createMeshWriters(s.meshes);this._controlStringToGroup.set(t,i)}}var Ye,$e,He=s(34727),Qe=s(48163),Ze=s(60408),Xe=s(95466),Ke=s(93397),Je=s(37615),et=s(18989),tt=s(75434),st=s(90708),it=s(8446),rt=s(57582);function nt(e){const t=(0,Ke.DW)(e),{style:s,weight:i}=(0,Ke._d)(e.fontStyleName);return{family:(0,rt.af)(e.fontFamilyName),decoration:t,style:s,weight:i}}($e=Ye||(Ye={})).objectId="OBJECTID",$e.shape="SHAPE",$e.dimLength="DIMLENGTH",$e.beginX="BEGINX",$e.beginY="BEGINY",$e.endX="ENDX",$e.endY="ENDY",$e.textX="TEXTX",$e.textY="TEXTY",$e.styleId="STYLEID",$e.dimX="DIMX",$e.dimY="DIMY",$e.customLength="CUSTOMLENGTH",$e.useCustomLength="USECUSTOMLENGTH",$e.dimDisplay="DIMDISPLAY",$e.extDisplay="EXTDISPLAY",$e.markerDisplay="MARKERDISPLAY",$e.extAngle="EXTANGLE",$e.dimType="DIMTYPE",$e.textAngle="TEXTANGLE";class ot extends it.K{static fromFeatures(e,t){const{geometryType:s}=t,i=(0,st.Di)([],e,s,!1,!1,t.featureIdInfo);for(let t=0;t<i.length;t++)i[t].displayId=e[t].displayId;return ot.fromOptimizedFeatures(i,t,null)}static fromFeatureSet(e,t){const s=(0,st.q3)(e,t.featureIdInfo);return ot.fromOptimizedFeatureSet(s,t)}static fromOptimizedFeatureSet(e,t){const s=ot.fromOptimizedFeatures(e.features,t,e.transform);return s._exceededTransferLimit=e.exceededTransferLimit,s._fieldsIndex=new Xe.A(e.fields),s}static fromOptimizedFeatures(e,t,s){const i=new ot(e,t);i._fieldsIndex=t.fieldsIndex;const{layerType:r}=t;if(!r)throw new Error("Layer type is required in metadata to read dimension features.");if(!s)throw new Error("Quantization transform is required to read dimension features.");return function(e,t,s){const i=s.spatialReference,r=s.outSpatialReference,n=(0,g.Q1)(t),o={x:0,y:0,spatialReference:i},a={x:0,y:0,spatialReference:i},c={x:0,y:0,spatialReference:i},l={x:0,y:0,spatialReference:i};let h=0;for(const t of e){const{attributes:e}=t;if(o.x=Number(Ge(Ye.beginX,e)),o.y=Number(Ge(Ye.beginY,e)),a.x=Number(Ge(Ye.endX,e)),a.y=Number(Ge(Ye.endY,e)),c.x=Number(Ge(Ye.dimX,e)),c.y=Number(Ge(Ye.dimY,e)),isNaN(o.x)||isNaN(o.y)||isNaN(a.x)||isNaN(a.y)){console.error(`Feature with ${Ye.objectId}=${Ge(Ye.objectId,e)} is missing valid begin, end, or dimension points and will be skipped.`);continue}(isNaN(c.x)||isNaN(c.y))&&(c.x=o.x,c.y=o.y);const s=(0,Ae.Cv)(new Me.A(o),i,r),u=(0,Ae.Cv)(new Me.A(a),i,r),d=[s,u,(0,Ae.Cv)(new Me.A(c),i,r)];h=Math.sqrt((u.x-s.x)*(u.x-s.x)+(u.y-s.y)*(u.y-s.y));const p=u.x-s.x,f=u.y-s.y;let m=Math.PI/2;if(0!==p?m=Math.atan2(f,p):f<0&&(m=-Math.PI/2),null!=e[Ye.textX]&&null!=e[Ye.textY]){l.x=Number(Ge(Ye.textX,e)),l.y=Number(Ge(Ye.textY,e));const t=(0,Ae.Cv)(new Me.A(l),i,r);d.push(t)}const _=d.map(e=>({x:(0,g.IE)(n,e.x),y:(0,g.B2)(n,e.y)})).flatMap(e=>[e.x,e.y]);e.__SYSTEM_LENGTH__=h,e.__DIMENSION_ANGLE__=360-(0,He.KJ)(m),t.geometry=new Te.A([_.length],_)}}(i._features,s,t),i}}function at(e,t,s){const i=t[0]-e[0],r=t[1]-e[1],n=Math.sqrt(i*i+r*r);return 0===n?[e[0],e[1]]:[e[0]+i/n*s,e[1]+r/n*s]}function ct(e,t){return e[0]*t[1]-e[1]*t[0]}var lt=s(69221);class ht{static async create(e,t,s,i){const r=i(e.textSymbol),n=new ht(e,r);return await n.initialize(t,s),n}constructor(e,t){if(this._dimensionStyle=e,this._mosaicItems=t,this._textString=null,this._displayExtLines=!0,this._systemLength=0,this._dimensionAngleRad=0,this._dimensionLength=0,this._extAngleRad=Math.PI/2,this._compiledExpression=null,this._fieldsIndex=null,this._beginBaselinePoint=null,this._endBaselinePoint=null,this._dimensionLinePoint=null,this._beginDimensionPoint=null,this._endDimensionPoint=null,this._beginMarkerPoint=null,this._endMarkerPoint=null,this._beginMarkerRect=null,this._endMarkerRect=null,this._textRect=null,this._textPoint=null,this._dimensionPolyline=null,this._dimensionExtensionLines=null,this._hasTextPoint=!1,this._doMarkersFit=!0,this._dimensionIsEvaluated=!1,null==e)throw new Error("dimension syle must be defined!")}async initialize(e,t){if(!this._dimensionStyle)return;const{attributes:s}=e;if("Expression"===(this._dimensionStyle.textOption??"None")){const{expression:s,expressionParserName:i}=this._dimensionStyle;s&&"arcade"===i.toLocaleLowerCase()&&(this._compiledExpression=await(0,ne.Ad)(s,t),this._fieldsIndex=function(e){const{attributes:t}=e,s=Object.keys(Ye).map(e=>({name:e,alias:e,type:"string"==typeof t[e]?"esriFieldTypeString":"esriFieldTypeDouble"}));return new Xe.A(s)}(e))}const r=Number(Ge(Ye.extAngle,s));this._extAngleRad=isNaN(r)?Math.PI/2:r,this._systemLength=Number(Ge("__SYSTEM_LENGTH__",s));const{geometry:n}=e;if(n&&!(0,Ze.Bi)(n))throw new i.A("dimension-layer","processed geometry must be a valid 'polygon'.");const o=n?.rings[0];if(!o||o.length<3)throw new i.A("dimension-layer","processed geometry must have at least 3 points.");this._hasTextPoint=0!==o[3][0]&&0!==o[3][1]&&void 0!==o[3][0]&&void 0!==o[3][1],this._hasTextPoint&&(this._textPoint=o[3]);const a=this._dimensionStyle.textSymbol;s.__DIMENSION_ANGLE__+=a?.angle??0}getTextString(e){return null==this._textString&&(this._textString=this._getDimensionText(e)),this._textString}get textSymbol(){return this._dimensionStyle.textSymbol??null}get beginBaselinePoint(){return this._beginBaselinePoint}get endBaselinePoint(){return this._endBaselinePoint}get beginDimensionPoint(){return this._beginDimensionPoint}get endDimensionPoint(){return this._endDimensionPoint}get textPoint(){return this._textPoint}get dimensionLine(){return this._dimensionPolyline}get extensionLines(){return this._displayExtLines?this._dimensionExtensionLines:null}evaluateWithGeometry(e,t){this._dimensionIsEvaluated||(this._computeDimensionLineInfo(e,t),this._evaluateDefaultPlacement(t),this._updateExtensionLines(t),this._updateTextPoint(e,t),this._dimensionIsEvaluated=!0)}_updateTextPoint(e,t){if(this._hasTextPoint)return;const{textFit:s}=this._dimensionStyle;let i=!0;if(!this._doMarkersFit){if(this._hasTextPoint)return;if("None"===s||!this._beginMarkerRect||!this._endMarkerRect||!this._textRect)return void(i=!0);if((dt(this._beginMarkerRect,this._textRect)||dt(this._endMarkerRect,this._textRect))&&(i=!1),!i){const e=t*(this._textRect.width/2);"MoveBegin"===s?this._textPoint=at(this._beginMarkerPoint,this._endMarkerPoint,-e):"MoveEnd"===s&&(this._textPoint=at(this._endMarkerPoint,this._beginMarkerPoint,-e))}}if(i){if(!this._dimensionStyle.textSymbol)return;const e=t*(this._textRect.width/2),s=this._dimensionPolyline[0],i=this._dimensionPolyline[1],r=at(s[0],s[1],e),n=at(i[0],i[1],e);this._dimensionPolyline=[[r,s[1]],[n,i[1]]]}}_updateExtensionLines(e){if(!(this._displayExtLines&&this._beginDimensionPoint&&this._dimensionLinePoint&&this._endDimensionPoint))return;const{extensionLineOvershot:t,extensionLineOffset:s}=this._dimensionStyle;let i=this._dimensionLinePoint,r=this._endDimensionPoint;null==t||isNaN(t)||0===t||(i=at(this._dimensionLinePoint,this._beginBaselinePoint,-t*e),r=at(this._endDimensionPoint,this._endBaselinePoint,-t*e));let n=this._beginBaselinePoint,o=this._endBaselinePoint;if(null!=s&&!isNaN(s)&&0!==s){const e=(0,D.xg)(i,this._beginBaselinePoint),t=(0,D.xg)(r,this._endBaselinePoint);n=at(i,this._beginBaselinePoint,e-s),o=at(r,this._endBaselinePoint,t-s)}this._dimensionExtensionLines=[[i,n],[r,o]]}_computeDimensionLineInfo(e,t){if(!e||!(0,Ze.Bi)(e)||e.rings[0].length<3)throw new i.A("DimensionLayerView: bad geometry","Dimension cann't be applied to an empty geometry!");const s=e.rings[0],r=(0,Qe.fA)(s[0][0],s[0][1]),n=(0,Qe.fA)(s[1][0],s[1][1]),o=(0,Qe.fA)(s[2][0],s[2][1]);this._beginBaselinePoint=(0,D.hZ)((0,Qe.vt)(),r[0],r[1]),this._endBaselinePoint=(0,D.hZ)((0,Qe.vt)(),n[0],n[1]),this._dimensionLinePoint=o;let a=this._extAngleRad;if((0,D.aI)(r,o))this._beginDimensionPoint=(0,D.hZ)((0,Qe.vt)(),r[0],r[1]),this._endDimensionPoint=(0,D.hZ)((0,Qe.vt)(),n[0],n[1]),this._displayExtLines=!1;else{const e=function(e){const t=e[0],s=e[1];if(0===t&&0===s)return 0;if(0===t&&s>0)return Math.PI/2;if(0===t&&s<0)return 3*Math.PI/2;if(t<0&&0===s)return Math.PI;if(t>0&&0===s)return 0;let i=Math.atan2(s,t);return i<0&&(i+=2*Math.PI),i}([n[0]-r[0],n[1]-r[1]]),t=(0,He.KJ)(a);t>=-1&&t<=1?a+=(0,He.KJ)(1):t>=179&&t<=181&&(a-=(0,He.KJ)(1));const s=function(e,t,s,i){const r=[Math.cos(t),Math.sin(t)],n=[Math.cos(i),Math.sin(i)],o=[s[0]-e[0],s[1]-e[1]],a=ct(r,n);if(Math.abs(a)<=1e-9)return null;const c=ct(o,n)/a,l=ct(o,r)/a;return c<0||l<0?null:[e[0]+r[0]*c,e[1]+r[1]*c]}(o,e,n,e+a);if(!s)throw new i.A("DimensionLayerView: bad geometry","Failed to construct dimension extension lines!");this._beginDimensionPoint=(0,D.hZ)((0,Qe.vt)(),o[0],o[1]),this._endDimensionPoint=(0,D.hZ)((0,Qe.vt)(),s[0],s[1])}this._dimensionLength=(0,D.xg)(this._beginDimensionPoint,this._endDimensionPoint),this._hasTextPoint||(this._textPoint=at(this._beginDimensionPoint,this._endDimensionPoint,this._dimensionLength/2))}_evaluateDefaultPlacement(e){const{beginMarkerSymbol:t,endMarkerSymbol:s}=this._dimensionStyle,i=this._measureMarkerSymbolSize(t,this._beginDimensionPoint,this._dimensionAngleRad,e),r=this._measureMarkerSymbolSize(s,this._endDimensionPoint,this._dimensionAngleRad+Math.PI,e),n=this._measureDimensionText(this._textString||"",this._textPoint,e);this._textRect=n;const o=e*((i?.width??0)/2),a=e*((r?.width??0)/2);this._beginMarkerPoint=at(this._beginDimensionPoint,this._endDimensionPoint,o),this._endMarkerPoint=at(this._endDimensionPoint,this._beginDimensionPoint,a);const c=[0,0];if(i&&this._beginMarkerPoint){const e=(0,D.Re)(c,this._beginMarkerPoint,this._beginDimensionPoint);i.x+=e[0],i.y+=e[1]}if(r&&this._endMarkerPoint){const e=(0,D.Re)(c,this._endMarkerPoint,this._endDimensionPoint);r.x+=e[0],r.y+=e[1]}if(this._beginMarkerRect=i,this._endMarkerRect=r,this._doMarkersFit=this._checkMarkerFit(i,r,n,e),this._doMarkersFit){const e=at(this._beginDimensionPoint,this._endDimensionPoint,this._dimensionLength/2);this._dimensionPolyline=[[e,this._beginDimensionPoint],[e,this._endDimensionPoint]]}else this._beginMarkerPoint=at(this._beginDimensionPoint,this._endDimensionPoint,-4*o),this._endMarkerPoint=at(this._beginDimensionPoint,this._endDimensionPoint,this._dimensionLength+4*a),this._dimensionPolyline=[[this._beginMarkerPoint,this._beginDimensionPoint],[this._endMarkerPoint,this._endDimensionPoint]]}_checkMarkerFit(e,t,s,i){if(!e||!t)return!1;const{markerFit:r,markerOption:n,markerFitTolerance:o}=this._dimensionStyle;if("None"===r)return!0;let a=!0;if("Tolerance"===r)o*i>=this._dimensionLength&&(a=!1);else{if(this._hasTextPoint&&"Both"!==n)return!0;this._hasTextPoint&&"Both"===n?dt(e,t)&&(a=!1):(dt(e,t)&&(a=!1),a&&s&&(dt(s,e)||dt(s,t))&&(a=!1))}return a||(this._beginMarkerPoint=at(this._beginDimensionPoint,this._endDimensionPoint,-e.width/2),this._endMarkerPoint=at(this._beginDimensionPoint,this._endDimensionPoint,this._dimensionLength+t.width/2)),a}_measureDimensionText(e,t,s){if(null==this._textString||null==t||null==this._mosaicItems)return null;const i=[];for(const t of e)t.codePointAt(0),i.push(this._mosaicItems.glyphs[t.codePointAt(0)]);const r=this._dimensionStyle.textSymbol;if(!r)return null;const n=(0,Ke.Bu)(r.horizontalAlignment),o=(0,Ke.Nl)(r.verticalAlignment),a=(0,Ke.DW)(r),c=(0,lt.hV)(r.height||10),l=r.angle||0,h=c/p.eG,u=(0,lt.Lu)(r.lineWidth),d=p.DY*Math.max(.25,Math.min(c||1,4)),f={...this._mosaicItems,glyphs:i.filter(e=>null!=e)},m=(0,tt.Tl)(f,{scale:h,angle:l,xOffset:0,yOffset:0,horizontalAlignment:n,verticalAlignment:o,decoration:a,lineHeight:d,useCIMAngleBehavior:!0,maxLineWidth:u,hasBackground:!1}),_=t;if(!_)return null;const y=s,g=[m.bounds.blX,m.bounds.trY],x=[m.bounds.trX,m.bounds.trY],b=[m.bounds.blX,m.bounds.blY],w=[m.bounds.trX,m.bounds.blY];return g[0]-=m.bounds.x,g[1]-=m.bounds.y,x[0]-=m.bounds.x,x[1]-=m.bounds.y,b[0]-=m.bounds.x,b[1]-=m.bounds.y,w[0]-=m.bounds.x,w[1]-=m.bounds.y,g[0]*=y,g[1]*=y,x[0]*=y,x[1]*=y,b[0]*=y,b[1]*=y,w[0]*=y,w[1]*=y,g[0]+=_[0],g[1]+=_[1],x[0]+=_[0],x[1]+=_[1],b[0]+=_[0],b[1]+=_[1],w[0]+=_[0],w[1]+=_[1],new et.A(x[0],x[1],1.1*Math.abs(g[0]-x[0]),1.1*Math.abs(w[1]-x[1]))}_measureMarkerSymbolSize(e,t,s,i){return e?new et.A(-16,-16,32,32):null}_getDimensionText(e){const{attributes:t}=e;let s=this._systemLength;1===Number(Ge(Ye.useCustomLength,t))&&(s=Number(Ge(Ye.customLength,t)));let i=this._getDimensionString(s,e);return"number"==typeof i&&(i=i.toString()),t.__COMPUTED_TEXT_STRING__=i,i||""}_getDimensionString(e,t){const{convertUnits:s,displayUnits:i,displayPrecision:r,prefix:n,suffix:o,textOption:a}=this._dimensionStyle;if("None"===a)return null;if("Expression"===a&&this._compiledExpression&&t)return(0,Je.A)(this._compiledExpression,t,{},"esriGeometryPolyline",this._fieldsIndex);let c=(e=null==r||isNaN(r)?parseFloat(e.toString()):parseFloat(e.toFixed(r))).toString();return"Suffix"===a&&(n&&(c=`${n} ${c}`),o&&(c=`${c} ${o}`)),c}}function ut(e){return{left:e.x,right:e.x+e.width,top:e.y+e.height,bottom:e.y}}function dt(e,t){const s=ut(e),i=ut(t),r=s.left<=i.right&&i.left<=s.right,n=s.bottom<=i.top&&i.bottom<=s.top;return r&&n}class pt extends ae{constructor(e,t,s){super(),this._context=e,this._schema=t,this._expression=s,this._meshWriters=new Map,this._dimensionInfos=new Map,this._cachedGlyphsPerFont=new Map}static async fromDimensionSchema(e,t){const{spatialReference:s}=e.viewParams.tileInfo,i=await(0,ne.Ad)("$feature.STYLEID",s);return new pt(e,t,i)}hasArcadeDependency(){return!0}doMatch(e){const t=this._getGroupCreator(e),{groupKey:s}=t;return this._meshWriters.get(s)}async fetchResources(e,t,s,i){const r=t.metadata.outSpatialReference,n=t.getCursor();for(;n.next();){const t=this._getGroupCreator(n),{groupKey:s}=t;let o=this._meshWriters.get(s);o||(o=await t.createGroup(this._context,this._schema,e)),this._meshWriters.set(s,o);const a=`${i}_${n.getObjectId()}`;let c=this._dimensionInfos.get(a);!c&&t.analyze&&(c=await t.analyze(r,this._schema,e),c&&this._dimensionInfos.set(a,c))}}_getGroupCreator(e){const t=(0,oe.V4)(this._expression,e,{}),s={type:"dimension-feature",styleId:parseInt(t,10)};return{get groupKey(){return"Dimension:"+JSON.stringify(Be(s,"styleId"))},analyze:async(t,i,r)=>{const n=e.readLegacyFeatureForDisplay();if(!n)return;const o=await this.getDimensionInfo(s.styleId,n,t,i);return o&&await this._cacheGlyphs(o,n,r),o},createGroup(e,t){const i=t.meshes[s.styleId];return e.createMeshWriters([...i.beginDimensionLine,...i.endDimensionLine,...i.beginExtensionLine,...i.endExtensionLine,...i.textPoint])}}}async getDimensionInfo(e,t,s,i){const r=i.styleCollection.find(t=>(t.iD??0)===e);if(r)return await ht.create(r,t,s,e=>this._getGlyphCacheForSymbol(e))}async _cacheGlyphs(e,t,s){const i=e.getTextString(t);if(!i)return;const r=await s.fetchResourceImmediate({type:"cim-rasterization-info",resource:{type:"text",textString:i||"",font:nt(e.textSymbol)}});if(r&&"glyphs"in r){const t=r.glyphs;if(null!=t){const s=this._getGlyphCacheForSymbol(e.textSymbol);if(!s)return;for(const e of t)e&&!s.glyphs[e.code]&&(s.glyphs[e.code]=e)}}}_getGlyphCacheForSymbol(e){if(!e)return null;const t=function(e){const{style:t}=(0,Ke._d)(e.fontStyleName);return`${(0,rt.af)(e.fontFamilyName)}_${t}`}(e);let s=this._cachedGlyphsPerFont.get(t);return s||(s={type:"glyphs",glyphs:[],isRightToLeft:!1,sdfSize:24,sdfRadius:8,sdfPadding:3},this._cachedGlyphsPerFont.set(t,s)),s}cleanup(e,t,s){const i=`${s}_${t.getObjectId()}`;this._dimensionInfos.delete(i)}getAnalyzedGraphic(e){return this._dimensionInfos.get(e)||null}}class ft extends ae{constructor(e,t){super(),this._intervals=[],this._isMaxInclusive=t,this._field=e}static async fromIntervalSchema(e,t){const s=await e.storage.createComputedField(t),i=new ft(s,t.isMaxInclusive);await Promise.all(t.intervals.map(async t=>{const s=[...await e.createMeshWriters(t.meshes),...await e.createMeshWriters(t.alternateMeshes)];i.add(t,s)}));const r=await e.createMeshWriters(t.defaultSymbol);i.setDefault(r);const n=await e.createMeshWriters(t.backgroundFill);return i.setBackgroundFill(n),i}add(e,t){this._intervals.push({interval:e,result:t}),this._intervals.sort((e,t)=>e.interval.min-t.interval.min)}size(){return super.size()+this._intervals.length}hasArcadeDependency(e){return this._field?.hasArcadeDependency(e)||this._intervals.some(t=>t.result.some(t=>t.hasArcadeDependency(e)))}doMatch(e,t){const s=this._field?.read(e,t);if(null==s||isNaN(s)||s===1/0||s===-1/0)return null;for(let e=0;e<this._intervals.length;e++){const{interval:t,result:i}=this._intervals[e],r=s>=t.min,n=this._isMaxInclusive?s<=t.max:s<t.max;if(r&&n)return i}return null}}class mt extends ae{static async fromLabelSchema(e,t){const s=t.classes.map(async t=>{const s=await e.createMeshWriters(t.meshes);return{minScale:t.minScale,maxScale:t.maxScale,meshes:s,expression:null,where:await e.storage.createWhereClause(t.where)}}),i=await Promise.all(s);return new mt(i)}constructor(e){super(),this._labels=e}match(e,t,s){if(!this._labels.length)return null;const i=this._getLabels(t.$view.scale),r=[];for(const t of i)t.where&&!t.where(e,s)||r.push(...t.meshes);return r}hasArcadeDependency(e){return this._labels.some(t=>t.meshes.some(t=>t.hasArcadeDependency(e)))}_getLabels(e){return this._labels.filter(t=>this._validForTileScale(t,e))}_validForTileScale(e,t){const s=t-t/4,i=t+t/2;return(!e.minScale||e.minScale>=s)&&(!e.maxScale||e.maxScale<=i)}}class _t extends ae{constructor(e,t){super(),this._defaultSymbolSortKey=0,this._nullResult=null,this._resultsMap=new Map,this._fields=[],this._fields=e,this._separator=t||""}static async fromMatcherSchema(e,t){const s=t.expression?[e.storage.createComputedField({expression:t.expression})]:[t.field?e.storage.createComputedField({field:t.field}):null,t.field2?e.storage.createComputedField({field:t.field2}):null,t.field3?e.storage.createComputedField({field:t.field3}):null],i=(await Promise.all(s)).filter(e=>!!e),r=new _t(i,t.fieldDelimiter),n=await e.createMeshWriters(t.defaultSymbol);r.setDefault(n);const o=await e.createMeshWriters(t.backgroundFill);return r.setBackgroundFill(o),await Promise.all(t.map.map(async(t,s)=>{const i=[...await e.createMeshWriters(t.meshes),...await e.createMeshWriters(t.alternateMeshes)];"<Null>"===t.value?r.setNullResult(i):r.add(t.value,i,s+1)})),r}setNullResult(e){this._nullResult=e}getSortKey(e,t){const s=this._getValueFromFields(e,t);if(null==s||""===s||"<Null>"===s)return 0;const i=this._resultsMap.get(s.toString());return i?i.sortKey:this._defaultSymbolSortKey}add(e,t,s){this._resultsMap.set(e.toString(),{meshWriters:t,sortKey:s}),this._defaultSymbolSortKey=Math.max(this._defaultSymbolSortKey,s+1)}size(){return super.size()+this._resultsMap.size}hasArcadeDependency(e){return this._fields.some(t=>t.hasArcadeDependency(e))||[...this._resultsMap.values()].some(t=>t.meshWriters.some(t=>t.hasArcadeDependency(e)))||this._nullResult?.some(t=>t.hasArcadeDependency(e))||!1}doMatch(e,t){const s=this._getValueFromFields(e,t);if(null!==this._nullResult&&(null==s||""===s||"<Null>"===s))return this._nullResult;if(null==s)return null;const i=s.toString();return this._resultsMap.get(i)?.meshWriters}_getValueFromFields(e,t){const s=[];for(const i of this._fields){const r=i.read(e,t);null==r||""===r?s.push("<Null>"):s.push(r)}return s.join(this._separator)}}async function yt(e,t){switch(t.type){case"annotation-feature":return je.fromAnnotationSchema(e,t);case"dimension-feature":return pt.fromDimensionSchema(e,t);case"simple":case"heatmap":case"dot-density":case"pie-chart":return ae.from(e,t);case"interval":return ft.fromIntervalSchema(e,t);case"dictionary":return We.fromDictionaryRenderer(e,t);case"label":return mt.fromLabelSchema(e,t);case"map":return _t.fromMatcherSchema(e,t);case"subtype":return gt.fromSubtypes(e,t);case"cluster":return xt.fromClusterSchema(e,t);case"track":return bt.fromTrackSchema(e,t);default:throw new Error("Impl")}}class gt extends ae{constructor(e,t){super(),this._subMatchers=e,this._subtypeField=t}static async fromSubtypes(e,t){const s=new Map,i=[];for(const r in t.renderers){const n=parseInt(r,10),o=yt(e,t.renderers[r]).then(e=>s.set(n,e));i.push(o)}return await Promise.all(i),new gt(s,t.subtypeField)}match(e,t,s){const i=e.readAttribute(this._subtypeField),r=this._subMatchers.get(i);return r?r.match(e,t,s):null}hasArcadeDependency(e){for(const t of this._subMatchers.values())if(t.hasArcadeDependency(e))return!0;return!1}}class xt extends ae{static async fromClusterSchema(e,t){const[s,i]=await Promise.all([yt(e,t.feature),yt(e,t.cluster)]);return new xt(s,i)}constructor(e,t){super(),this._featureMatcher=e,this._clusterMatcher=t}match(e,t,s){return 1===e.readAttribute("cluster_count")?this._featureMatcher.match(e,t,s):this._clusterMatcher.match(e,t,s)}hasArcadeDependency(e){return this._featureMatcher.hasArcadeDependency(e)||this._clusterMatcher.hasArcadeDependency(e)}}class bt extends ae{static async fromTrackSchema(e,t){const[s,i,r]=await Promise.all([yt(e,t.previousObservation),yt(e,t.latestObservation),yt(e,t.trackLine)]);return new bt(s,i,r)}constructor(e,t,s){super(),this._previousObservationMatcher=e,this._latestObservationMatcher=t,this._trackLineMatcher=s}match(e,t,s){switch(e.readAttribute(re.EA)){case 0:return this._trackLineMatcher.match(e,t,s);case 1:return this._latestObservationMatcher.match(e,t,s);case 2:return this._previousObservationMatcher.match(e,t,s)}return null}hasArcadeDependency(e){return this._trackLineMatcher.hasArcadeDependency(e)||this._latestObservationMatcher.hasArcadeDependency(e)||this._previousObservationMatcher.hasArcadeDependency(e)}}class wt extends ie{static async create(e,t){const s=await yt(e,t.symbology),i=t.labels?await yt(e,t.labels):null;return new wt(s,i)}constructor(e,t){super(),this._symbology=e,this._labels=t}destroy(){}async enqueueMatcherRequests(e,t,s,i){await Promise.all([this._symbology.fetchResources(e,t,s,i),this._labels?.fetchResources(e,t,s,i)])}enqueueWriterRequests(e,t,s,i){const r=this._symbology.match(t,s,i);if(r){for(const i of r)i.enqueueRequest(e,t,s);if(this._labels){const r=this._labels.match(t,s,i);if(!r)return;for(const i of r)i.enqueueRequest(e,t,s)}}}write(e,t,s,i,r,n,o,a){const c=null!=a?a/i.$view.scale:void 0,l=this._symbology.match(s,i,r);if(l){for(const r of l)r.write(e,t,s,i,n,o,c,this._symbology);if(this._symbology.cleanup(t,s,e.id,i,r),e.entityRecordCount()>=1&&this._labels){const a=this._labels.match(s,i,r);if(!a)return;for(const r of a)r.setReferences(l),r.write(e,t,s,i,n,o,c)}}}getSortKey(e,t){return this._symbology.getSortKey(e,t)}hasArcadeDependency(e){return!(!this._symbology.hasArcadeDependency(e)&&!this._labels?.hasArcadeDependency(e))}}var vt=s(799);class It{}class St extends It{constructor(e){super(),this._fetcher=e,this._controller=new AbortController,this._pendingRequests=new Map,this._resourceIdToResource=new Map}destroy(){this._controller.abort()}get _abortOptions(){return{signal:this._controller.signal}}enqueueRequest(e){const t=function(e){return"url"in e&&"urlHash"in e?{...e,url:""}:e}(e.resource),s=(0,vt.xq)(JSON.stringify(t));return this._pendingRequests.has(s)||this._pendingRequests.set(s,e),s}async fetchEnqueuedResources(){const e=Array.from(this._pendingRequests.entries()),t=e.map(e=>e[1]);if(0===t.length)return;const s=await this._fetcher.fetch(t,this._abortOptions);for(let t=0;t<s.length;t++){const i=e[t][0];this._resourceIdToResource.set(i,s[t])}this._pendingRequests.clear()}async fetchResourceImmediate(e){const t=await this._fetcher.fetch([e]);if(1!==t.length)throw new Error("FeaturePipelineResourceProxy: failed to fetch resources");return t[0]}async fetchDictionaryResourceImmediate(e){const t=await this._fetcher.fetchDictionary([e]);if(1!==t.length)throw new Error("FeaturePipelineResourceProxy: failed to fetch dictionary resources");return t[0]}async fetchMeshResourceImmediate(e){const t=await this._fetcher.fetchMesh([e]),[s]=t;if(!s)throw new Error("FeaturePipelineResourceProxy: failed to fetch mesh resources");return s}getResource(e){return this._resourceIdToResource.get(e)}}var kt=s(36745),Mt=s(35521),Tt=s(59409);class At{static getPlacement(e,t,s,i,r){const n=(0,Tt.c)(s);return n?(-1===t&&e.invertY(),n.execute(e,s,i,r)):null}}var Pt=s(68197),Ct=s(53966);function Ft(e,t){return[!!e?.minScale&&t.scaleToZoom(e.minScale)||0,!!e?.maxScale&&t.scaleToZoom(e.maxScale)||100]}function Et(e){return 1<<e}function Rt(e){let t=0;for(const[s,i]of e)i&&(t|=1<<s);return t}function zt(e){let t;if(!e)return[0,0,0,0];if("string"==typeof e){const s=Pt.A.fromString(e);if(!s)return Ct.A.getLogger("esri.views.2d.engine.webgl.shaderGraph.techniques.meshWriterUtils").errorOnce(new i.A("mapview:mesh-processing","Unable to parse string into color",{color:e})),[0,0,0,0];t=s.toArray()}else t=e;const[s,r,n,o]=t;return[s*(o/255),r*(o/255),n*(o/255),o]}function Ot(e){switch(e){case"butt":case"Butt":return 0;case"round":case"Round":return 1;case"square":case"Square":return 2}}function Lt(e){switch(e){case"bevel":case"Bevel":return 0;case"miter":case"Miter":return 2;case"round":case"Round":return 1}}function Dt(e,t){return Math.round(Math.min(Math.sqrt(e*t),255))}function Nt(e,t){return Math.round(e*t)/t}const qt=0,Bt=1,Gt=2,jt=3,Ut=4,Vt=5;var Wt=s(35833),Yt=s(51118);class $t{static executeEffects(e,t,s){let i=new Wt.kT(t);for(const t of e){const e=(0,Tt.A)(t);e&&(i=e.execute(i,t,s))}return i}static applyEffects(e,t){if(!e)return t;const s={geomUnitsPerPoint:1,tileKey:null,maxInflateSize:(0,Ke.ll)(e),scale:null,spatialReference:null,preventClipping:!1};let i,r=new Wt.kT(kt.z.fromJSONCIM(t));for(const t of e){const e=(0,Tt.A)(t);e&&(r=e.execute(r,t,s))}const n=[];let o=null;for(;i=r.next();)n.push(...(0,Yt.x)(i)),o=i.geometryType;return 0===n.length||null===o?null:"esriGeometryPolygon"===o?{rings:n}:{paths:n}}}var Ht=s(89518),Qt=s(68572),Zt=s(63907);class Xt{static fromVertexSpec(e,t){const s=Qt.q.fromVertexSpec(e,t);return new Xt(s)}constructor(e){this._spec=e,this._packed=new Uint8Array(this._spec.stride*this._spec.packVertexCount),this._packedU32View=new Uint32Array(this._packed.buffer),this._dataView=new DataView(this._packed.buffer)}get attributeLayout(){return this._spec.attributeLayout}get stride(){return this._spec.stride}writeVertex(e,t,s,i,r,n){for(let e=0;e<this._spec.packVertexCount;e++){const o=e*this._spec.stride;this._packPosition(s,i,o),this._packId(t,o);const a=this._spec.bitset;if(n){if(a.packTessellation){const e=a.packTessellation(n,r,s,i);this._pack(e,a,o)}for(const e of this._spec.standardAttributes)if(null!=e.packTessellation){const t=e.packTessellation(n,r,s,i);this._pack(t,e,o)}else if(e.packAlternating?.packTessellation){const t=e.packAlternating.packTessellation(n,r,s,i);for(let s=0;s<this._spec.packVertexCount;s++){const i=t[s];this._pack(i,e,s*this._spec.stride)}}}}e.vertexWriteRegion(this._packedU32View)}pack(e,t){for(const s of this._spec.standardAttributes)if(s.pack&&"string"!=typeof s.pack){const i=s.pack(e,t);for(let e=0;e<this._spec.packVertexCount;e++)this._pack(i,s,e*this._spec.stride)}else if(s.packAlternating?.pack){const i=s.packAlternating.pack(e,t);for(let e=0;e<this._spec.packVertexCount;e++){const t=i[e];this._pack(t,s,e*this._spec.stride)}}}_packPosition(e,t,s){const{offset:i}=this._spec.position,r=this._spec.position.packPrecisionFactor??1,n=(0,Ht.lj)(e*r),o=(0,Ht.lj)(t*r),a=(0,Ht.M9)(n,o);this._dataView.setUint32(s+i,a,!0)}_packId(e,t){const s=e*(this._spec.id.packPrecisionFactor??1),i=4278190080&this._dataView.getUint32(t+this._spec.id.offset,!0);this._dataView.setUint32(t+this._spec.id.offset,s|i,!0)}_pack(e,t,s){!function(e,t,s,i){const r=s.packPrecisionFactor??1;switch(s.type){case Zt.pe.BYTE:if(1===s.count)e.setInt8(i+s.offset,t*r);else for(let n=0;n<s.count;n++){const o=n*Int8Array.BYTES_PER_ELEMENT;e.setInt8(i+s.offset+o,t[n]*r)}break;case Zt.pe.UNSIGNED_BYTE:if(1===s.count)e.setUint8(i+s.offset,t*r);else for(let n=0;n<s.count;n++){const o=n*Uint8Array.BYTES_PER_ELEMENT;e.setUint8(i+s.offset+o,t[n]*r)}break;case Zt.pe.SHORT:if(1===s.count)e.setInt16(i+s.offset,t*r,!0);else for(let n=0;n<s.count;n++){const o=n*Int16Array.BYTES_PER_ELEMENT;e.setInt16(i+s.offset+o,t[n]*r,!0)}break;case Zt.pe.UNSIGNED_SHORT:if(1===s.count)e.setUint16(i+s.offset,t*r,!0);else for(let n=0;n<s.count;n++){const o=n*Uint16Array.BYTES_PER_ELEMENT;e.setUint16(i+s.offset+o,t[n]*r,!0)}break;case Zt.pe.INT:if(1===s.count)e.setInt32(i+s.offset,t*r,!0);else for(let n=0;n<s.count;n++){const o=n*Int32Array.BYTES_PER_ELEMENT;e.setInt32(i+s.offset+o,t[n]*r,!0)}break;case Zt.pe.UNSIGNED_INT:if(1===s.count)e.setUint32(i+s.offset,t*r,!0);else for(let n=0;n<s.count;n++){const o=n*Uint32Array.BYTES_PER_ELEMENT;e.setUint32(i+s.offset+o,t[n]*r,!0)}break;case Zt.pe.FLOAT:if(1===s.count)e.setFloat32(i+s.offset,t*r,!0);else for(let n=0;n<s.count;n++){const o=n*Float32Array.BYTES_PER_ELEMENT;e.setFloat32(i+s.offset+o,t[n]*r,!0)}break;case Zt.pe.HALF_FLOAT:if(1===s.count)e.setUint16(i+s.offset,(0,Ht.fw)(t*r),!0);else for(let n=0;n<s.count;n++){const o=n*Uint16Array.BYTES_PER_ELEMENT;e.setUint16(i+s.offset+o,(0,Ht.fw)(t[n]*r),!0)}}}(this._dataView,e,t,s)}}const Kt=96/72;class Jt{constructor(e,t,s,i){this._instanceId=e,this._evaluator=t,this._enabledOptionalAttributes=s,this._viewParams=i,this._evaluator.evaluator=e=>this.vertexSpec.createComputedParams(e)}get _vertexPack(){if(!this._cachedVertexPack){const e=Xt.fromVertexSpec(this.vertexSpec,this._enabledOptionalAttributes);this._evaluator.hasDynamicProperties||e.pack(this._evaluator.evaluatedMeshParams,this._viewParams),this._cachedVertexPack=e}return this._cachedVertexPack}get evaluatedMeshParams(){return this._evaluator.evaluatedMeshParams}get hasEffects(){return!!this.evaluatedMeshParams.effects}get effectInfos(){return this._evaluator.inputMeshParams.effects?.effectInfos}get placementInfo(){return this._evaluator.inputMeshParams.placement}get instanceId(){return this._instanceId}get attributeLayout(){return this._vertexPack.attributeLayout}get _preventEffectClipping(){return!1}setReferences(e){this._references=e}getBoundsInfo(){return null}getTileInfo(){return this._viewParams.tileInfo}async loadDependencies(){for(const{effect:e}of this.effectInfos||[])await(0,Wt.ai)(e);this.placementInfo&&await(0,Wt.g1)(this.placementInfo.placement)}enqueueRequest(e,t,s){this._evaluator.hasDynamicProperties&&this._evaluator.enqueueRequest(e,t,s)}write(e,t,s,i,r,n,o,a){this.ensurePacked(t,s,i);const c=e.id||"",l=this.evaluatedMeshParams.effects,h=this._createEffectExecutionContext(s,i,c,o,a),u={target:s,options:i,level:r,viewExtent:n};if(!l||0===l.length)return void this._write(e,u);const d=this.getEffectCursor(s,l,h);if(!d)return;let p;for(;p=d.next();)p.invertY(),this._write(e,{...u,effectGeometry:p})}ensurePacked(e,t,s){if(!this._evaluator.hasDynamicProperties)return;const i=this._evaluator.evaluateMeshParams(e,t,s);this._vertexPack.pack(i,this._viewParams)}hasArcadeDependency(e){return this._evaluator.hasArcadeDependency(e)}_writeVertex(e,t,s,i,r){const n=this.evaluatedMeshParams;this._vertexPack.writeVertex(e,t,s,i,n,r)}_createEffectExecutionContext(e,t,s,i,r){return{geomUnitsPerPoint:Kt,maxInflateSize:(0,Ke.ll)(this.evaluatedMeshParams.effects),scale:t.$view.scale,spatialReference:e.metadata.outSpatialReference??e.metadata.spatialReference,preventClipping:this._preventEffectClipping,tileKey:s,scaleFactor:i,matcher:r,target:e}}getEffectCursor(e,t,s){null==s.scaleFactor&&(s={...s,scaleFactor:1});const i=e.readGeometryForDisplay()?.clone();if(!i)return;const r=kt.z.fromOptimizedCIM(i,e.geometryType);return r.invertY(),$t.executeEffects(t,r,s)}}class es extends Jt{}var ts=s(13195);function ss(e,t){let s;if("string"==typeof e)s=(0,vt.Wm)(e+`-seed(${t})`);else{let i=12;s=e^t;do{s=107*(s>>8^s)+i|0}while(0!==--i)}return(1+s/(1<<31))/2}function is(e){return Math.floor(ss(e,rs)*ns)}const rs=53290320,ns=10;class os{generateSource(e){const t=[];for(let s=1;s<this.length;s++)t.push(`vec4 atom${s} = texture(${e.animationTexture}, (pointer + 0.5) / size);`),t.push("pointer.x += 1.0;");for(let e=0;e<this.ins;e++)t.push("top--;"),t.push(`vec4 in${this.ins-e-1} = stack[top];`);for(let e=0;e<this.outs;e++)t.push(`vec4 out${e};`);const{microcode:s}=this;for(const e of s)t.push(e);for(let e=0;e<this.outs;e++)t.push(`stack[top] = out${e};`),t.push("top++;"),t.push(`if (top >= ${fs}) { top = ${fs-1}; }`);return t}}let as=128;function cs(e){return[`float duration = clamp(${e.duration}, 0.05, 3600.0);`,`float startTimeOffset = ${e.startTimeOffset};`,`float repeatDelay = ${e.repeatDelay};`,`float timeOriginSelector = ${e.timeOriginSelector};`,`float repeatType = ${e.repeatType};`,`float easing = ${e.easing};`,`float playAnimation = ${e.playAnimation} * (1.0 - step(0.0, -${e.duration}));`,`float reverseAnimation = ${e.reverseAnimation};`,"float time = globalTime - (timeOriginSelector == 1.0 ? localTimeOrigin : 0.0);","time *= playAnimation;","time *= 1.0 - reverseAnimation * 2.0;","float period = duration + repeatDelay;","time += reverseAnimation == 1.0 ? (period - startTimeOffset - 0.001) : startTimeOffset + 0.001;","float omega = time / period;","float oi = floor(omega);","omega = repeatType == 1.0 || repeatType == 3.0 ? omega - oi : omega;","float of = omega * period;","of = (clamp(of, reverseAnimation * repeatDelay, period - (1.0 - reverseAnimation) * repeatDelay) - reverseAnimation * repeatDelay) / duration;","of = easing == 2.0 ? pow(of, 3.0) : of;","of = easing == 3.0 ? 1.0 - pow(1.0 - of, 3.0) : of;","of = easing == 4.0 ? of < 0.5 ? 4.0 * pow(of, 3.0) : 1.0 - pow(-2.0 * of + 2.0, 3.0) / 2.0 : of;","bool oscillate = repeatType == 3.0 && mod(oi, 2.0) == 1.0;",`${e.out} = oscillate ? 1.0 - of : of;`]}const ls={Linear:1,EaseIn:2,EaseOut:3,EaseInOut:4},hs={Loop:1,None:2,Oscillate:3},us={Local:1,Global:2};function ds(e){const t=ls[e.easing],s=hs[e.repeatType],i=us[e.timeOriginSelector];return[[e.duration,e.startTimeOffset,e.repeatDelay,i],[s,t,e.playAnimation,e.reverseAnimation]]}const ps={scalar:new class extends os{constructor(){super(...arguments),this.opcode=++as,this.length=1,this.ins=0,this.outs=1,this.microcode=["out0 = vec4(atom0.y, atom0.y, atom0.y, atom0.y);"]}encode(e){return[[this.opcode,e,0,0]]}},vector3:new class extends os{constructor(){super(...arguments),this.opcode=++as,this.length=1,this.ins=0,this.outs=1,this.microcode=["out0 = vec4(atom0.yzw, 0.0);"]}encode(e){return[[this.opcode,e[0]||0,e[1]||0,e[2]||0]]}},vector4:new class extends os{constructor(){super(...arguments),this.opcode=++as,this.length=2,this.ins=0,this.outs=1,this.microcode=["out0 = atom1;"]}encode(e){return[[this.opcode,0,0,0],e]}},animatedTransform:new class extends os{constructor(){super(...arguments),this.opcode=++as,this.length=10,this.ins=1,this.outs=1,this.microcode=["vec2 fromTranslation = atom1.xy;","vec2 toTranslation = atom1.zw;","float fromRotation = atom2.x;","float toRotation = atom2.y;","float fromScale = atom2.z;","float toScale = atom2.w;","bool relativeTranslation = atom9.x == 1.0;","bool absoluteScale = atom9.y == 1.0;","vec2 translationMultiplier = relativeTranslation ? pixelDimensions : vec2(1.0, 1.0);","float scaleDivisor = absoluteScale ? pixelDimensions.y : 1.0;","float fTranslation;","{",...cs({duration:"atom3.x",startTimeOffset:"atom3.y",repeatDelay:"atom3.z",timeOriginSelector:"atom3.w",repeatType:"atom4.x",easing:"atom4.y",playAnimation:"atom4.z",reverseAnimation:"atom4.w",out:"fTranslation"}),"}","float fRotation;","{",...cs({duration:"atom5.x",startTimeOffset:"atom5.y",repeatDelay:"atom5.z",timeOriginSelector:"atom5.w",repeatType:"atom6.x",easing:"atom6.y",playAnimation:"atom6.z",reverseAnimation:"atom6.w",out:"fRotation"}),"}","float fScale;","{",...cs({duration:"atom7.x",startTimeOffset:"atom7.y",repeatDelay:"atom7.z",timeOriginSelector:"atom7.w",repeatType:"atom8.x",easing:"atom8.y",playAnimation:"atom8.z",reverseAnimation:"atom8.w",out:"fScale"}),"}","vec2 aTranslation = mix(fromTranslation, toTranslation, fTranslation);","float aRotation = mix(fromRotation, toRotation, fRotation);","float aScale = mix(fromScale, toScale, fScale);","vec2 pTranslation = in0.xy;","float pRotation = in0.z;","float pScale = in0.w;","aTranslation *= translationMultiplier;","aScale /= scaleDivisor;","float rotation = pRotation + aRotation;","float scale = pScale * aScale;","float sin1 = sin(pRotation);","float cos1 = cos(pRotation);","float s1 = pScale;","float x1 = pTranslation.x;","float y1 = pTranslation.y;","float x2 = aTranslation.x;","float y2 = aTranslation.y;","\n vec2 translation = vec2(\n cos1 * s1 * x2 - sin1 * s1 * y2 + x1,\n sin1 * s1 * x2 + cos1 * s1 * y2 + y1\n );\n ","out0 = vec4(translation, rotation, scale);"]}encode(e){return[[this.opcode,0,0,0],[e.translation.from[0],e.translation.from[1],e.translation.to[0],e.translation.to[1]],[e.rotation.from,e.rotation.to,e.scale.from,e.scale.to],...ds(e.translation.timing),...ds(e.rotation.timing),...ds(e.scale.timing),[e.relativeTranslation?1:0,e.absoluteScale?1:0,0,0]]}},animatedColor:new class extends os{constructor(){super(...arguments),this.opcode=++as,this.length=7,this.ins=1,this.outs=1,this.microcode=["float fromOpacity = atom0.y;","float toOpacity = atom0.z;","vec4 fromColor = atom1;","vec4 toColor = atom2;","float fColor;","{",...cs({duration:"atom3.x",startTimeOffset:"atom3.y",repeatDelay:"atom3.z",timeOriginSelector:"atom3.w",repeatType:"atom4.x",easing:"atom4.y",playAnimation:"atom4.z",reverseAnimation:"atom4.w",out:"fColor"}),"}","float fOpacity;","{",...cs({duration:"atom5.x",startTimeOffset:"atom5.y",repeatDelay:"atom5.z",timeOriginSelector:"atom5.w",repeatType:"atom6.x",easing:"atom6.y",playAnimation:"atom6.z",reverseAnimation:"atom6.w",out:"fOpacity"}),"}","vec4 aColor = mix(fromColor, toColor, fColor);","aColor.a *= mix(fromOpacity, toOpacity, fOpacity);","vec4 pColor = in0;","out0 = aColor * pColor;"]}encode(e){return[[this.opcode,e.opacity.from,e.opacity.to,0],[e.color.from[0],e.color.from[1],e.color.from[2],e.color.from[3]],[e.color.to[0],e.color.to[1],e.color.to[2],e.color.to[3]],...ds(e.color.timing),...ds(e.opacity.timing)]}},animatedShift:new class extends os{constructor(){super(...arguments),this.opcode=++as,this.length=4,this.ins=1,this.outs=1,this.microcode=["float fromShift = atom0.y;","float toShift = atom0.z;","float duration = atom1.x;","bool multiplyToByLineLength = atom3.x == 1.0;","bool multiplyDurationByLineLength = atom3.y == 1.0;","duration *= multiplyDurationByLineLength ? lineLength : 1.0;","float fShift;","{",...cs({duration:"duration",startTimeOffset:"atom1.y",repeatDelay:"atom1.z",timeOriginSelector:"atom1.w",repeatType:"atom2.x",easing:"atom2.y",playAnimation:"atom2.z",reverseAnimation:"atom2.w",out:"fShift"}),"}","toShift *= multiplyToByLineLength ? lineLength : 1.0;","float aShift = mix(fromShift, toShift, fShift);","vec4 pShift = in0;","out0 = mod(aShift + pShift, lineLength);"]}encode(e){return[[this.opcode,e.shift.from,e.shift.to,0],...ds(e.shift.timing),[e.multiplyToByLineLength?1:0,e.multiplyDurationByLineLength?1:0,0,0]]}},ret:new class extends os{constructor(){super(...arguments),this.opcode=++as,this.length=1,this.ins=0,this.outs=0,this.microcode=["break;"]}encode(){return[[this.opcode,0,0,0]]}}},fs=4;function ms(e){return e instanceof _s?e:"object"==typeof e&&"type"in e?ws[e.type].hydrate(e):new ys(e)}class _s{constructor(e){this.inputs=e}encode(){const e=[];for(const t of this.inputs)e.push(...t.encode());return e.push(...this.instructions),e}}class ys extends _s{constructor(e){super([]),this.value=e}simplify(){return this}get instructions(){if(Array.isArray(this.value)){const[e,t,s,i]=this.value;return null!=i?ps.vector4.encode([e,t||0,s||0,i]):ps.vector3.encode([e,t||0,s||0])}return ps.scalar.encode(this.value)}}class gs extends _s{constructor(e,t){super([t]),this._config=e,this._parent=t}static hydrate(e){return new gs(e,ms(e.parent))}simplify(){if(this._config.relativeTranslation||this._config.absoluteScale)return this;const e=this._parent.simplify();if(!(e instanceof ys))return this;const[t,s,i,r]=e.value,n=this._config.translation.from[0],o=this._config.translation.from[1],a=this._config.rotation.from,c=this._config.scale.from;if(n===this._config.translation.to[0]&&o===this._config.translation.to[1]&&a===this._config.rotation.to&&c===this._config.scale.to){const e=i+a,l=r*c,h=Math.sin(i),u=Math.cos(i);return new ys([u*r*n-h*r*o+t,h*r*n+u*r*o+s,e,l])}return new gs(this._config,e)}get instructions(){return ps.animatedTransform.encode(this._config)}}class xs extends _s{constructor(e,t){super([t]),this._config=e,this._parent=t}static hydrate(e){return new xs(e,ms(e.parent))}simplify(){const e=this._parent.simplify();if(!(e instanceof ys))return this;const[t,s,i,r]=e.value,n=this._config.color.from[0],o=this._config.color.from[1],a=this._config.color.from[2];let c=this._config.color.from[3];const l=this._config.opacity.from;return n===this._config.color.to[0]&&o===this._config.color.to[1]&&a===this._config.color.to[2]&&c===this._config.color.to[3]&&l===this._config.opacity.to?(c*=l,new ys([t*n,s*o,i*a,r*c])):new xs(this._config,e)}get instructions(){return ps.animatedColor.encode(this._config)}}class bs extends _s{constructor(e,t){super([t]),this._config=e,this._parent=t}static hydrate(e){return new bs(e,ms(e.parent))}simplify(){const e=this._parent.simplify();return e instanceof ys?new bs(this._config,e):this}get instructions(){return ps.animatedShift.encode(this._config)}}const ws={AnimatedTransform:gs,AnimatedColor:xs,AnimatedShift:bs};function vs(e){return Ss(e.map(e=>Ms(e)).map(e=>ms(e).simplify()))}function Is(e){const t=[];return t.push(e.transform),t.push(e.fromColor),t.push(e.toColor),t.push(e.colorMix),t.push(e.toOpacity),t.push(e.opacityMix),e?.shift?t.push(e?.shift):t.push([1,1,1,1]),t}function Ss(e){const t=[],s=[];let i=0;for(const r of e){const n=[...r.encode(),...ps.ret.encode()];t.push([i+e.length,0,0,0]),s.push(...n),i+=n.length}return[...t,...s]}async function ks(e,t){const s=e;let i;if("number"==typeof s||"string"==typeof s||"boolean"==typeof s)i=s;else if(Array.isArray(s))i=await Promise.all(s.map(e=>ks(e,t)));else if("object"==typeof s)if("valueExpressionInfo"in s){const{valueExpressionInfo:e}=s,{expression:r}=e;i={...s,computed:await t.createComputedField({expression:r})}}else{i={};for(const e in s)i[e]=await ks(s[e],t)}return i}function Ms(e,t,s){const i=e;let r;if("number"==typeof i||"string"==typeof i||"boolean"==typeof i)r=i;else if(Array.isArray(i))r=i.map(e=>Ms(e,t,s));else if("object"==typeof i)if("type"in i&&null!=i.type&&"Process"===i.type)switch(i.op){case"ArcadeColor":{const e=Ms(i.value,t,s);As(Array.isArray(e)&&4===e.length),r=[e[0]/255,e[1]/255,e[2]/255,e[3]]}break;case"Transparency":{const e=Ms(i.value,t,s);As("number"==typeof e),r=1-e/100}break;case"Divide":case"Multiply":case"Add":{const e=Ms(i.left,t,s);As("number"==typeof e);const n=Ms(i.right,t,s);switch(As("number"==typeof n),i.op){case"Divide":r=e/n;break;case"Multiply":r=e*n;break;case"Add":r=e+n}}break;case"Random":{const e=Ms(i.seed,t,s),n=Ms(i.min,t,s),o=Ms(i.max,t,s);r=n+ss(is(t.getObjectId()||0),e)*(o-n)}break;case"Cond":{const e=Ms(i.condition,t,s),n=Ms(i.ifTrue,t,s),o=Ms(i.ifFalse,t,s);r=e?n:o}break;case"MatchWinding":{const e=Ms(i.sign,t,s);let n=Ms(i.angle,t,s);if(e>0)for(;n<0;)n+=2*Math.PI;else for(;n>0;)n-=2*Math.PI;r=n}}else if("computed"in i)r=function(e){if(!("computed"in e))return e;let i=e.computed.readWithDefault(t,s,[255*e.defaultValue[0],255*e.defaultValue[1],255*e.defaultValue[2],e.defaultValue[3]]);if("string"==typeof i){const e=Pt.A.fromString(i);e&&(i=[e.r,e.g,e.b,e.a])}return i}(i);else{r={};for(const e in i)r[e]=Ms(i[e],t,s)}return r}function*Ts(e){const t=e;if(Array.isArray(t))for(const e of t)yield*Ts(e);else if("object"==typeof t)if("type"in t&&null!=t.type&&"Process"===t.type)switch(t.op){case"ArcadeColor":case"Transparency":yield*Ts(t.value);break;case"Divide":case"Multiply":case"Add":yield*Ts(t.left),yield*Ts(t.right);break;case"Random":yield*Ts(t.seed),yield*Ts(t.min),yield*Ts(t.max);break;case"Cond":yield*Ts(t.condition),yield*Ts(t.ifTrue),yield*Ts(t.ifFalse);break;case"MatchWinding":yield*Ts(t.sign),yield*Ts(t.angle)}else if("computed"in t)yield t.computed;else for(const e in t)yield*Ts(t[e])}function As(e){if(!e)throw new Error("Assertion failed.")}const Ps={type:Zt.pe.HALF_FLOAT,count:2,pack:({scaleInfo:e},{tileInfo:t})=>Ft(e,t)},Cs={type:Zt.pe.FLOAT,count:4,packPrecisionFactor:1,packTessellation:({value1Position2Value2:e})=>(As(e),e)},Fs={type:Zt.pe.FLOAT,count:4,packPrecisionFactor:1,packTessellation:()=>[0,0,0,1]},Es={type:Zt.pe.FLOAT,count:1,packPrecisionFactor:1,pack:()=>0},Rs={type:Zt.pe.FLOAT,count:1,packPrecisionFactor:1,packTessellation:({lineLength:e})=>e},zs={type:Zt.pe.UNSIGNED_SHORT,count:1,packTessellation:({distance:e})=>e},Os={type:Zt.pe.BYTE,count:2,packPrecisionFactor:16,packTessellation:({directionX:e,directionY:t})=>[e,t]},Ls={type:Zt.pe.FLOAT,count:2,packPrecisionFactor:16,packTessellation:({normalX:e,normalY:t})=>[e,t]},Ds={type:Zt.pe.UNSIGNED_BYTE,count:3,pack:"id"},Ns={type:Zt.pe.UNSIGNED_BYTE,count:1,pack:function(e){const{sprite:t,isMapAligned:s,colorLocked:i,scaleSymbolsProportionally:r,isStroke:n}=e;let o=0;return s&&(o|=Et(Bt)),i&&(o|=Et(Ut)),t.sdf&&(o|=Et(qt)),r&&(o|=Et(Gt)),n&&(o|=Et(Vt)),o}},qs={type:Zt.pe.SHORT,count:2,pack:"position",packPrecisionFactor:1},Bs={marker:{type:Zt.pe.FLOAT,count:2,packAlternating:{count:4,pack:({texelDimensions:e})=>[[-.5*e[0],-.5*e[1]],[.5*e[0],-.5*e[1]],[-.5*e[0],.5*e[1]],[.5*e[0],.5*e[1]]]}},line:{type:Zt.pe.FLOAT,count:2,packTessellation:({extrusionOffsetX:e,extrusionOffsetY:t},{baseSize:s})=>[e*s/2,t*s/2]},fill:{type:Zt.pe.FLOAT,count:2,packTessellation:()=>[0,0]}},Gs={marker:{type:Zt.pe.SHORT,count:2,packPrecisionFactor:1,packAlternating:{count:4,packTessellation:({texXmax:e,texXmin:t,texYmax:s,texYmin:i})=>[[t,i],[e,i],[t,s],[e,s]]}}},js={type:Zt.pe.UNSIGNED_SHORT,count:4,pack:({sprite:e})=>{const{rect:t,width:s,height:i}=e,r=t.x+p.hM,n=t.y+p.hM;return[r+1,n+1,r+s-1,n+i-1]}},Us={type:Zt.pe.UNSIGNED_SHORT,count:4,packPrecisionFactor:4,pack:({animations:e,baseSize:t,referenceSize:s})=>[e.dataColumn,e.dataRow,t,s]},Vs={type:Zt.pe.UNSIGNED_SHORT,count:4,packPrecisionFactor:8,pack:({strokeWidth:e,pixelDimensions:t,baseSize:s,sprite:i,sizeRatio:r})=>{const n=Math.max(s*i.width/i.height,s),o=i.sdfDecodeCoeff*n*r;return[t[0],t[1],e,o]}},Ws={type:Zt.pe.BYTE,count:1,packPrecisionFactor:16,packTessellation:({angle:e})=>e},Ys={type:Zt.pe.BYTE,count:1,pack:({angle:e})=>e?e*ts.aA:0},$s={type:Zt.pe.BYTE,count:1,pack:()=>0};function Hs(e){let{pixelDimensions:t,texelDimensions:s,baseSize:i,referenceSize:r,strokeWidth:n,sizeRatio:o}=e;if(t||(t=e.sprite.sdf?[0,0]:[e.sprite.width,e.sprite.height]),s||(s=e.sprite.sdf?[0,0]:t),null!=e.patternHeight){const s=e.patternHeight/t[1];t[1]*=s,t[0]*=s}-1===i&&(i=t[1]),i=(0,h.Lz)(i),r=(0,h.Lz)(r),n=(0,h.Lz)(n);const a=(e.sprite.sdfDecodeCoeff??1)*o;return{...e,pixelDimensions:t,texelDimensions:s,baseSize:i,referenceSize:r,strokeWidth:n,sdfDecodeCoeff:a}}class Qs extends es{get vertexSpec(){return{createComputedParams:Hs,optionalAttributes:{zoomRange:Ps,value1Position2Value2:Cs,lineLength:Rs},attributes:{id:Ds,bitset:Ns,pos:qs,offset:Bs.marker,uv:Gs.marker,animationPointerAndBaseSizeAndReferenceSize:Us,sizing:Vs,angle:Ws}}}_write(e,{target:t,effectGeometry:s}){const i=this.evaluatedMeshParams.sprite,{textureBinding:r}=i;e.recordStart(this.instanceId,this.attributeLayout,r);const n=t.getDisplayId();if(this.shift&&"esriGeometryPolyline"===t.geometryType){if(!s){const s=kt.z.fromFeatureSetReaderCIM(t);s&&this._writeParticles(e,t,s)}}else if(null!=this.evaluatedMeshParams.placement)this._writePlacedMarkers(e,t);else if("esriGeometryPolygon"===t.geometryType){const s=t.readCentroidForDisplay();if(!s)return;const[i,r]=s.coords;this._writeQuad(e,n,i,r)}else if("esriGeometryPoint"===t.geometryType){const s=t.readXForDisplay(),i=t.readYForDisplay();this._writeQuad(e,n,s,i)}else{const s=t.readGeometryForDisplay();s&&s.forEachVertex((t,s)=>{this._writeQuad(e,n,t,s)})}e.recordEnd()}_writePlacedMarkers(e,t){const s=kt.z.fromFeatureSetReaderCIM(t)?.clone();if(!s)return;const i=At.getPlacement(s,-1,this.evaluatedMeshParams.placement,(0,h.Lz)(1),e.id);if(!i)return;const r=t.getDisplayId();let n=i.next(),o=null;for(;null!=n;){const t=n.tx,s=-n.ty;if(Math.abs(t)>Mt.$u||Math.abs(s)>Mt.$u){n=i.next();continue}const a=-n.getAngle();e.recordBounds(t,s,64,64),this.shift?o&&this._writeQuad(e,r,o[0],o[1],void 0,a):this._writeQuad(e,r,t,s,void 0,a),o=[t,s],n=i.next()}}_writeParticles(e,t,s){const i=t.getDisplayId();for(;s.nextPath();){const t=[];for(;s.nextPoint();)t.push([s.x,s.y]);const r=Zs(t);let n=0;for(let e=1;e<t.length;e++){const s=t[e][0]-t[e-1][0],i=t[e][1]-t[e-1][1],r=Math.sqrt(s*s+i*i);n+=r}const o=t=>{for(const s of r){const{a:r,b:o}=s;this._writeQuad(e,i,r.position[0],r.position[1],[r.distance-t,o.position[0],o.position[1],o.distance-t],this.evaluatedMeshParams.angleToLine?Math.atan2(r.direction[1],r.direction[0]):0,n,!0)}},{placement:a}=this.evaluatedMeshParams;if(!a||"placementTemplate"in a||"CIMMarkerPlacementOnVertices"===a.type){let e;if(a&&"CIMMarkerPlacementOnVertices"!==a.type)e=a.placementTemplate;else{e=[0];for(const t of r){const{a:s,b:i}=t,r=s.position[0]-i.position[0],n=s.position[1]-i.position[1],o=Math.sqrt(r*r+n*n);e.push(o)}}let t=-1*n;for(;t<2*n;)for(const s of e)t+=s,o(t)}else"CIMMarkerPlacementAtExtremities"===a.type?"JustBegin"===a.extremityPlacement?o(1):"JustEnd"===a.extremityPlacement?(o(n-1),o(-1)):"Both"===a.extremityPlacement&&(o(1),o(n-1)):"CIMMarkerPlacementOnLine"===a.type&&("LineBeginning"===a.relativeTo?o(1):"LineEnd"===a.relativeTo?(o(n-1),o(-1)):"LineMiddle"===a.relativeTo&&o(n/2))}}_writeQuad(e,t,s,i,r,n=0,o=0,a=!1){const c=this.evaluatedMeshParams.sprite,{rect:l}=c,h=l.x+p.hM,u=l.y+p.hM,d=l.x+l.width-p.hM,f=l.y+l.height-p.hM,m=e.vertexCount();a||e.recordBounds(s,i,64,64);const _={texXmin:h,texYmin:u,texXmax:d,texYmax:f,value1Position2Value2:r,angle:n,lineLength:o};for(let r=0;r<4;r++)this._writeVertex(e,t,s,i,_);e.indexEnsureSize(6),e.indexWrite(m),e.indexWrite(m+1),e.indexWrite(m+2),e.indexWrite(m+1),e.indexWrite(m+3),e.indexWrite(m+2)}}function Zs(e){const t=[];let s=0;for(let i=1;i<e.length;i++){const r=e[i-1],n=e[i],o=n[0]-r[0],a=n[1]-r[1],c=Math.sqrt(o*o+a*a),l=o/c,h=a/c;t.push({a:{position:r,distance:s,direction:[l,h]},b:{position:n,distance:s+c,direction:[l,h]}}),s+=c}return t}class Xs extends Qs{constructor(){super(...arguments),this.shift=!1}}class Ks extends Qs{constructor(){super(...arguments),this.shift=!0}}var Js=s(15585),ei=s(83773),ti=s(6774);function si(e,t,s,i,r,n,o){Mi=0;const a=(i-s)*n,c=r&&r.length,l=c?(r[0]-s)*n:a;let h,u,d,p,f,m=ii(t,s,0,0,l,n,!0);if(m&&m.next!==m.prev){if(c&&(m=function(e,t,s,i,r,n){const o=new Array;for(let r=0,a=i.length;r<a;r++){const c=ii(e,t,0,i[r]*n,r<a-1?i[r+1]*n:s*n,n,!1);c===c.next&&(c.steiner=!0),o.push(hi(c))}o.sort(xi);for(const e of o)r=ui(e,r);return r}(t,s,i,r,m,n)),a>80*n){h=d=t[0+s*n],u=p=t[1+s*n];for(let e=n;e<l;e+=n){const i=t[e+s*n],r=t[e+1+s*n];h=Math.min(h,i),u=Math.min(u,r),d=Math.max(d,i),p=Math.max(p,r)}f=Math.max(d-h,p-u),f=0!==f?1/f:0}ni(m,e,n,h,u,f,o,0)}}function ii(e,t,s,i,r,n,o){let a;if(o===function(e,t,s,i,r,n){let o=0;for(let s=i,a=r-n;s<r;s+=n)o+=(e[a+t*n]-e[s+t*n])*(e[s+1+t*n]+e[a+1+t*n]),a=s;return o}(e,t,0,i,r,n)>0)for(let s=i;s<r;s+=n)a=ci(s+t*n,e[s+t*n],e[s+1+t*n],a);else for(let s=r-n;s>=i;s-=n)a=ci(s+t*n,e[s+t*n],e[s+1+t*n],a);return a&&gi(a,a.next)&&(li(a),a=a.next),a}function ri(e,t=e){if(!e)return e;let s,i=e;do{if(s=!1,i.steiner||!gi(i,i.next)&&0!==pi(i.prev,i,i.next))i=i.next;else{if(li(i),i=t=i.prev,i===i.next)break;s=!0}}while(s||i!==t);return t}function ni(e,t,s,i,r,n,o,a){if(!e)return;!a&&n&&(e=di(e,i,r,n));let c=e;for(;e.prev!==e.next;){const l=e.prev,h=e.next;if(n?ai(e,i,r,n):oi(e))t.push(l.index/s+o),t.push(e.index/s+o),t.push(h.index/s+o),li(e),e=h.next,c=h.next;else if((e=h)===c){a?1===a?ni(e=bi(e,t,s,o),t,s,i,r,n,o,2):2===a&&wi(e,t,s,i,r,n,o):ni(ri(e),t,s,i,r,n,o,1);break}}}function oi(e){const t=e.prev,s=e,i=e.next;if(pi(t,s,i)>=0)return!1;let r=e.next.next;const n=r;let o=0;for(;r!==e.prev&&(0===o||r!==n);){if(o++,mi(t.x,t.y,s.x,s.y,i.x,i.y,r.x,r.y)&&pi(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function ai(e,t,s,i){const r=e.prev,n=e,o=e.next;if(pi(r,n,o)>=0)return!1;const a=r.x<n.x?r.x<o.x?r.x:o.x:n.x<o.x?n.x:o.x,c=r.y<n.y?r.y<o.y?r.y:o.y:n.y<o.y?n.y:o.y,l=r.x>n.x?r.x>o.x?r.x:o.x:n.x>o.x?n.x:o.x,h=r.y>n.y?r.y>o.y?r.y:o.y:n.y>o.y?n.y:o.y,u=yi(a,c,t,s,i),d=yi(l,h,t,s,i);let p=e.prevZ,f=e.nextZ;for(;p&&p.z>=u&&f&&f.z<=d;){if(p!==e.prev&&p!==e.next&&mi(r.x,r.y,n.x,n.y,o.x,o.y,p.x,p.y)&&pi(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,f!==e.prev&&f!==e.next&&mi(r.x,r.y,n.x,n.y,o.x,o.y,f.x,f.y)&&pi(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(;p&&p.z>=u;){if(p!==e.prev&&p!==e.next&&mi(r.x,r.y,n.x,n.y,o.x,o.y,p.x,p.y)&&pi(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;f&&f.z<=d;){if(f!==e.prev&&f!==e.next&&mi(r.x,r.y,n.x,n.y,o.x,o.y,f.x,f.y)&&pi(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function ci(e,t,s,i){const r=Si.create(e,t,s);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function li(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function hi(e){let t=e,s=e;do{(t.x<s.x||t.x===s.x&&t.y<s.y)&&(s=t),t=t.next}while(t!==e);return s}function ui(e,t){const s=function(e,t){let s=t;const i=e.x,r=e.y;let n,o=-1/0;do{if(r<=s.y&&r>=s.next.y&&s.next.y!==s.y){const e=s.x+(r-s.y)*(s.next.x-s.x)/(s.next.y-s.y);if(e<=i&&e>o){if(o=e,e===i){if(r===s.y)return s;if(r===s.next.y)return s.next}n=s.x<s.next.x?s:s.next}}s=s.next}while(s!==t);if(!n)return null;if(i===o)return n.prev;const a=n,c=n.x,l=n.y;let h,u=1/0;for(s=n.next;s!==a;)i>=s.x&&s.x>=c&&i!==s.x&&mi(r<l?i:o,r,c,l,r<l?o:i,r,s.x,s.y)&&(h=Math.abs(r-s.y)/(i-s.x),(h<u||h===u&&s.x>n.x)&&_i(s,e)&&(n=s,u=h)),s=s.next;return n}(e,t);if(!s)return t;const i=Ii(s,e);return ri(i,i.next),ri(s,s.next)}function di(e,t,s,i){let r;for(;r!==e;r=r.next){if(r=r||e,null===r.z&&(r.z=yi(r.x,r.y,t,s,i)),r.prev.next!==r||r.next.prev!==r)return r.prev.next=r,r.next.prev=r,di(e,t,s,i);r.prevZ=r.prev,r.nextZ=r.next}return e.prevZ.nextZ=null,e.prevZ=null,function(e){let t,s=1;for(;;){let i,r=e;e=null,t=null;let n=0;for(;r;){n++,i=r;let o=0;for(;o<s&&i;o++)i=i.nextZ;let a=s;for(;o>0||a>0&&i;){let s;0===o?(s=i,i=i.nextZ,a--):0!==a&&i?r.z<=i.z?(s=r,r=r.nextZ,o--):(s=i,i=i.nextZ,a--):(s=r,r=r.nextZ,o--),t?t.nextZ=s:e=s,s.prevZ=t,t=s}r=i}if(t.nextZ=null,s*=2,n<2)return e}}(e)}function pi(e,t,s){return(t.y-e.y)*(s.x-t.x)-(t.x-e.x)*(s.y-t.y)}function fi(e,t,s,i){return!!(gi(e,t)&&gi(s,i)||gi(e,i)&&gi(s,t))||pi(e,t,s)>0!=pi(e,t,i)>0&&pi(s,i,e)>0!=pi(s,i,t)>0}function mi(e,t,s,i,r,n,o,a){return(r-o)*(t-a)-(e-o)*(n-a)>=0&&(e-o)*(i-a)-(s-o)*(t-a)>=0&&(s-o)*(n-a)-(r-o)*(i-a)>=0}function _i(e,t){return pi(e.prev,e,e.next)<0?pi(e,t,e.next)>=0&&pi(e,e.prev,t)>=0:pi(e,t,e.prev)<0||pi(e,e.next,t)<0}function yi(e,t,s,i,r){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-s)*r)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)*r)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function gi(e,t){return e.x===t.x&&e.y===t.y}function xi(e,t){return e.x-t.x}function bi(e,t,s,i){let r=e;do{const n=r.prev,o=r.next.next;!gi(n,o)&&fi(n,r,r.next,o)&&_i(n,o)&&_i(o,n)&&(t.push(n.index/s+i),t.push(r.index/s+i),t.push(o.index/s+i),li(r),li(r.next),r=e=o),r=r.next}while(r!==e);return r}function wi(e,t,s,i,r,n,o){let a=e;do{let e=a.next.next;for(;e!==a.prev;){if(a.index!==e.index&&vi(a,e)){let c=Ii(a,e);return a=ri(a,a.next),c=ri(c,c.next),ni(a,t,s,i,r,n,o,0),void ni(c,t,s,i,r,n,o,0)}e=e.next}a=a.next}while(a!==e)}function vi(e,t){return e.next.index!==t.index&&e.prev.index!==t.index&&!function(e,t){let s=e;do{if(s.index!==e.index&&s.next.index!==e.index&&s.index!==t.index&&s.next.index!==t.index&&fi(s,s.next,e,t))return!0;s=s.next}while(s!==e);return!1}(e,t)&&_i(e,t)&&_i(t,e)&&function(e,t){let s=e,i=!1;const r=(e.x+t.x)/2,n=(e.y+t.y)/2;do{s.y>n!=s.next.y>n&&s.next.y!==s.y&&r<(s.next.x-s.x)*(n-s.y)/(s.next.y-s.y)+s.x&&(i=!i),s=s.next}while(s!==e);return i}(e,t)}function Ii(e,t){const s=Si.create(e.index,e.x,e.y),i=Si.create(t.index,t.x,t.y),r=e.next,n=t.prev;return e.next=t,t.prev=e,s.next=r,r.prev=s,i.next=s,s.prev=i,n.next=i,i.prev=n,i}class Si{constructor(){this.index=0,this.x=0,this.y=0,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}static create(e,t,s){const i=Mi<ki.length?ki[Mi++]:new Si;return i.index=e,i.x=t,i.y=s,i.prev=null,i.next=null,i.z=null,i.prevZ=null,i.nextZ=null,i.steiner=!1,i}}const ki=[];let Mi=0;for(let e=0;e<8096;e++)ki.push(new Si);const Ti=new ti.O3(0,0,0,1,0),Ai=new ti.O3(0,0,0,1,0);function Pi(e,t,s){let i=0;for(let r=1;r<s;r++){const s=e[2*(t+r-1)],n=e[2*(t+r-1)+1];i+=(e[2*(t+r)]-s)*(e[2*(t+r)+1]+n)}return i}function Ci(e,t,s,i,r){let n=0;for(let o=s;o<i;o+=3){const s=2*(e[o]-r),i=2*(e[o+1]-r),a=2*(e[o+2]-r);n+=Math.abs((t[s]-t[a])*(t[i+1]-t[s+1])-(t[s]-t[i])*(t[a+1]-t[s+1]))}return n}function Fi(e,t){const{coords:s,lengths:i}=t,r=e;let n=0;for(let e=0;e<i.length;){let t=e,o=i[e],a=Pi(s,n,o);const c=[];for(;++t<i.length;){const e=i[t],r=Pi(s,n+o,e);if(!(r>0))break;a+=r,c.push(n+o),o+=e}const l=r.length;si(r,s,n,n+o,c,2,0);const h=Ci(r,s,l,r.length,0),u=Math.abs(a);if(Math.abs((h-u)/Math.max(1e-7,u))>1e-5)return r.length=0,!1;e=t,n+=o}return!0}function Ei(e){const{coords:t,lengths:s}=e,{buffer:i}=(0,Js.QT)(t,s);return i}function Ri(e,t){if(null==e)return null;if(!function(e,t,s){let i=0;for(let t=0;t<e.lengths.length;t++){const r=e.lengths[t];for(let t=0;t<r;t++){const r=e.coords[2*(t+i)],n=e.coords[2*(t+i)+1];if(r<-128||r>s||n<-128||n>s)return!0}i+=r}return!1}(e,0,p.CQ+128))return e;Ti.setPixelMargin(t),Ti.reset(3);const{stride:s,lengths:i,coords:r}=e;let n=0;for(const e of i){const t=n+e*s;for(Ti.moveTo(r[n],r[n+1]),n+=s;n<t;)Ti.lineTo(r[n],r[n+1]),n+=s;Ti.close()}const o=Ti.result(!1);if(!o)return null;const a=new Te.A;for(const e of o){for(const{x:t,y:s}of e)a.coords.push(t,s);a.lengths.push(e.length)}return a}function zi(e,t){Ai.setPixelMargin(t);const s=Ai,i=-t,r=p.CQ+t;let n=[],o=!1;if(!e.nextPath())return null;let a=e.pathLength(),c=!0;for(;c;){e.seekPathStart();const t=[];if(!e.pathSize)return null;s.reset(2),e.nextPoint();let l=e.x,h=e.y;if(o)s.moveTo(l,h);else{if(l<i||l>r||h<i||h>r){o=!0;continue}t.push({x:l,y:h})}let u=!1;for(;e.nextPoint();)if(l=e.x,h=e.y,o)s.lineTo(l,h);else{if(l<i||l>r||h<i||h>r){u=!0;break}t.push({x:l,y:h})}if(u)o=!0;else{if(o){const e=s.resultWithStarts();if(e)for(const t of e)n.push({...t,pathLength:a})}else n.push({line:t,start:0,pathLength:a});c=e.nextPath(),a=c?e.pathLength():0,o=!1}}return n=n.filter(e=>e.line.length>1),0===n.length?null:n}Ti.setExtent(p.CQ),Ai.setExtent(p.CQ);var Oi=s(23304);class Li{constructor(){this.extrusionOffsetX=0,this.extrusionOffsetY=0,this.normalX=0,this.normalY=0,this.directionX=0,this.directionY=0,this.distance=0,this.pathLength=0,this.distanceOffset=0,this.lineLength=0}}const Di={createComputedParams:e=>e,optionalAttributes:{zoomRange:{type:Zt.pe.HALF_FLOAT,count:2,pack:({scaleInfo:e},{tileInfo:t})=>Ft(e,t)}},attributes:{id:{type:Zt.pe.UNSIGNED_BYTE,count:3,pack:"id"},pos:{type:Zt.pe.SHORT,count:2,pack:"position",packPrecisionFactor:10},bitset:{type:Zt.pe.UNSIGNED_BYTE,count:1},color:{type:Zt.pe.UNSIGNED_BYTE,count:4,normalized:!0,pack:({color:e})=>zt(e)},offset:{type:Zt.pe.BYTE,count:2,packPrecisionFactor:16,packTessellation:({extrusionOffsetX:e,extrusionOffsetY:t})=>[Nt(e,16),Nt(t,16)]},normal:{type:Zt.pe.BYTE,count:2,packPrecisionFactor:16,packTessellation:({normalX:e,normalY:t})=>[Nt(e,16),Nt(t,16)]},halfWidth:{type:Zt.pe.HALF_FLOAT,count:1,pack:({width:e})=>(0,h.Lz)(.5*e)},referenceHalfWidth:{type:Zt.pe.HALF_FLOAT,count:1,pack:({referenceWidth:e})=>(0,h.Lz)(.5*e)}}};class Ni{constructor(){this.id=0,this.bitset=0,this.indexCount=0,this.vertexCount=0,this.vertexFrom=0,this.vertexBounds=0,this.pathLength=0,this.distanceOffset=0}}const qi=65535;class Bi extends Jt{constructor(e,t,s,i){super(e,t,s,i),this.vertexSpec=Di,this._currentWrite=new Ni,this._tessellationOptions={halfWidth:0,pixelCoordRatio:1,offset:0,wrapDistance:qi,textured:!1},this._tessParams=new Li,this._initializeTessellator()}writeLineVertices(e,t,s){const i=this._getLines(t);null!=i&&this._writeVertices(e,s,i)}_initializeTessellator(){this._lineTessellator=new ei.i(this._writeTesselatedVertex.bind(this),this._writeTriangle.bind(this),!0)}_write(e,{target:t,effectGeometry:s}){const i=s??kt.z.fromFeatureSetReaderCIM(t);i&&this._writeGeometry(e,t,i)}_writeGeometry(e,t,s,i){e.recordStart(this.instanceId,this.attributeLayout,i),this.writeLineVertices(e,s,t),e.recordEnd()}_getLines(e){return zi(e,(0,Oi.Z0)(this.evaluatedMeshParams))}_writeVertices(e,t,s){const{_currentWrite:i,_tessellationOptions:r,evaluatedMeshParams:n}=this,{width:o,capType:a,joinType:c,miterLimit:l,hasSizeVV:u}=n,d=(0,h.Lz)(.5*o);r.halfWidth=d,r.capType=Ot(a),r.joinType=Lt(c),r.miterLimit=l;const f=!u;i.out=e,i.id=t.getDisplayId(),i.vertexCount=0,i.indexCount=0,i.vertexFrom=e.vertexCount(),i.vertexBounds=f&&d<p.Gh?0:1;for(const{line:e,start:t,pathLength:n}of s)r.initialDistance=t%qi,i.pathLength=n,i.distanceOffset=Math.floor(t/qi)*qi,this._lineTessellator.tessellate(e,r,f)}_writeTesselatedVertex(e,t,s,i,r,n,o,a,c,l,h){const{out:u,id:d,vertexBounds:p,pathLength:f,distanceOffset:m}=this._currentWrite;return this.hasEffects&&u.recordBounds(e,t,p,p),this._tessParams.extrusionOffsetX=o,this._tessParams.extrusionOffsetY=a,this._tessParams.normalX=c,this._tessParams.normalY=l,this._tessParams.directionX=r,this._tessParams.directionY=n,this._tessParams.distance=h,this._tessParams.pathLength=f,this._tessParams.distanceOffset=m,this._writeVertex(u,d,e,t,this._tessParams),this._currentWrite.vertexFrom+this._currentWrite.vertexCount++}_writeTriangle(e,t,s){const{out:i}=this._currentWrite;i.indexEnsureSize(3),i.indexWrite(e),i.indexWrite(t),i.indexWrite(s),this._currentWrite.indexCount+=3}}class Gi extends es{_write(e,{target:t,effectGeometry:s}){const i=s??kt.z.fromFeatureSetReaderCIM(t);if(!i)return;const r=this.evaluatedMeshParams.sprite,{textureBinding:n}=r;e.recordStart(this.instanceId,this.attributeLayout,n);const o=t.getDisplayId();this._writePoly(e,o,i.asOptimized()),e.recordEnd()}}class ji extends Gi{constructor(){super(...arguments),this.vertexSpec={createComputedParams:Hs,attributes:{id:Ds,bitset:Ns,pos:qs,offset:Bs.fill,tlbr:js,animationPointerAndBaseSizeAndReferenceSize:Us,sizing:Vs},optionalAttributes:{zoomRange:Ps,value1Position2Value2:Fs,lineLength:Es,angle:Ys}}}_writePoly(e,t,s){const i=this._clip(s);if(!i)return;s=i;const r=[],n=e.vertexCount();let o;if(Fi(r,s)){if(0===r.length)return;o=0;for(const i of r){const r=s.coords[2*i],n=s.coords[2*i+1];this._writeVertex(e,t,r,n),o++}}else{const{coords:i,lengths:r}=s,n=(0,Js.QT)(i,r);o=n.vertexCount;for(let s=0;s<n.buffer.length/2;s++){const i=n.buffer[2*s],r=n.buffer[2*s+1];this._writeVertex(e,t,i,r)}}if(o>0){e.indexEnsureSize(o);for(let t=0;t<o;t++)e.indexWrite(t+n)}}_clip(e){return Ri(e,this.hasEffects?256:8)}}class Ui{constructor(){this.id=0,this.bitset=0,this.indexCount=0,this.vertexCount=0,this.vertexFrom=0,this.vertexBounds=0,this.pathLength=0}}class Vi extends Gi{constructor(){super(...arguments),this.vertexSpec={createComputedParams:Hs,attributes:{id:Ds,bitset:Ns,pos:qs,offset:Bs.line,tlbr:js,animationPointerAndBaseSizeAndReferenceSize:Us,sizing:Vs,accumulatedDistance:zs,normal:Ls,segmentDirection:Os},optionalAttributes:{zoomRange:Ps,value1Position2Value2:Fs,lineLength:Rs,angle:$s}},this._tessParams=new Li,this._currentWrite=new Ui,this._tessellationOptions={halfWidth:0,pixelCoordRatio:1,offset:0,wrapDistance:65535,textured:!1},this._lineLength=0,this._lineTessellator=new ei.i((e,t,s,i,r,n,o,a,c,l,h)=>this._writeTesselatedVertex(e,t,s,i,r,n,o,a,c,l,h,this._lineLength),this._writeTriangle.bind(this),!1)}_writePoly(e,t,s){const i=zi(kt.z.fromOptimized(s,"esriGeometryPolyline"),64);if(null==i)return;const{_currentWrite:r,_tessellationOptions:n}=this,{baseSize:o,capType:a,joinType:c,miterLimit:l}=this.evaluatedMeshParams,u=(0,h.Lz)(.5*o);n.halfWidth=u,n.capType=Ot(a||"Round"),n.joinType=Lt(c||"Round"),n.miterLimit=l||2,r.out=e,r.id=t,r.vertexCount=0,r.indexCount=0,r.vertexFrom=e.vertexCount(),r.vertexBounds=1;for(const{line:e,start:t,pathLength:s}of i){n.initialDistance=t%65535,r.pathLength=s,this._lineLength=0;for(let t=1;t<e.length;t++){const s=e[t].x-e[t-1].x,i=e[t].y-e[t-1].y;this._lineLength+=Math.sqrt(s*s+i*i)}this._lineTessellator.tessellate(e,n,!1)}}_writeTesselatedVertex(e,t,s,i,r,n,o,a,c,l,h,u){const{out:d,id:p,vertexBounds:f,pathLength:m}=this._currentWrite;return this.hasEffects&&d.recordBounds(e,t,f,f),this._tessParams.extrusionOffsetX=o,this._tessParams.extrusionOffsetY=a,this._tessParams.normalX=c,this._tessParams.normalY=l,this._tessParams.directionX=r,this._tessParams.directionY=n,this._tessParams.distance=h,this._tessParams.pathLength=m,this._tessParams.lineLength=u,this._writeVertex(d,p,e,t,this._tessParams),this._currentWrite.vertexFrom+this._currentWrite.vertexCount++}_writeTriangle(e,t,s){const{out:i}=this._currentWrite;i.indexEnsureSize(3),i.indexWrite(e),i.indexWrite(t),i.indexWrite(s),this._currentWrite.indexCount+=3}}class Wi extends Jt{async loadDependencies(){await Promise.all([super.loadDependencies(),(0,Js.If)()])}_write(e,{target:t,effectGeometry:s}){const i=s?.asOptimized()??t.readGeometryForDisplay(),r=this._clip(i);r&&(e.recordStart(this.instanceId,this.attributeLayout),this._writeGeometry(e,t,r),e.recordEnd())}_clip(e){return e?Ri(e,this.hasEffects?256:8):null}_writeGeometry(e,t,s){const i=function(e){const t=[];return e.maxLength>100||!Fi(t,e)?{indices:null,vertices:Ei(e)}:t.length?{indices:t,vertices:e.coords}:null}(s=s.justXY());if(!i||!i.vertices.length)return;const r=this.createTesselationParams(t);this._writeVertices(e,t,i,r)}_writeVertices(e,t,s,i){const r=t.getDisplayId(),n=e.vertexCount(),o=this.hasEffects,{vertices:a,indices:c}=s;let l=0;if(c)for(const t of c){const s=a[2*t],n=a[2*t+1];o&&e.recordBounds(s,n,0,0),this._writeVertex(e,r,s,n,i),l++}else for(let t=0;t<a.length;t+=2){const s=Math.round(a[t]),n=Math.round(a[t+1]);o&&e.recordBounds(s,n,0,0),this._writeVertex(e,r,s,n,i),l++}e.indexEnsureSize(l);for(let t=0;t<l;t++)e.indexWrite(t+n)}}const Yi={createComputedParams:e=>e,optionalAttributes:{},attributes:{id:{type:Zt.pe.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:Zt.pe.UNSIGNED_BYTE,count:1},pos:{type:Zt.pe.SHORT,count:2,pack:"position",packPrecisionFactor:10},inverseArea:{type:Zt.pe.FLOAT,count:1,packTessellation:({inverseArea:e})=>e}}};class $i extends Wi{constructor(){super(...arguments),this.vertexSpec=Yi}createTesselationParams(e){return{inverseArea:1/e.readGeometryArea()}}}const Hi={createComputedParams:e=>e,optionalAttributes:{zoomRange:{type:Zt.pe.HALF_FLOAT,count:2,pack:({scaleInfo:e},{tileInfo:t})=>Ft(e,t)}},attributes:{id:{type:Zt.pe.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:Zt.pe.UNSIGNED_BYTE,count:1},pos:{type:Zt.pe.SHORT,count:2,pack:"position",packPrecisionFactor:10},color:{type:Zt.pe.UNSIGNED_BYTE,count:4,normalized:!0,pack:({color:e})=>zt(e)}}};class Qi extends Wi{constructor(){super(...arguments),this.vertexSpec=Hi}createTesselationParams(e){return null}}const Zi={createComputedParams:e=>e,optionalAttributes:Hi.optionalAttributes,attributes:{...Hi.attributes,tlbr:{count:4,type:Zt.pe.UNSIGNED_SHORT,pack:({sprite:e})=>{const{rect:t,width:s,height:i}=e,r=t.x+p.hM,n=t.y+p.hM;return[r,n,r+s,n+i]}},inverseRasterizationScale:{count:1,type:Zt.pe.BYTE,packPrecisionFactor:16,pack:({sprite:e})=>1/e.rasterizationScale}}};class Xi extends Qi{constructor(){super(...arguments),this.vertexSpec=Zi}_write(e,{target:t,effectGeometry:s}){const i=s?.asOptimized()??t.readGeometryForDisplay(),r=this._clip(i);if(!r)return;const n=this.evaluatedMeshParams.sprite?.textureBinding;e.recordStart(this.instanceId,this.attributeLayout,n),this._writeGeometry(e,t,r),e.recordEnd()}}function Ki(e){const{sprite:t,aspectRatio:s,scaleProportionally:i}=e,r=(0,h.Lz)(e.height),n=r>0?r:t.height;let o=r*s;return o<=0?o=t.width:i&&(o*=t.width/t.height),{width:o,height:n}}function Ji(e){const{applyRandomOffset:t,sampleAlphaOnly:s}=e;return Rt([[2,t],[4,s]])}const er={createComputedParams:e=>e,optionalAttributes:Zi.optionalAttributes,attributes:{...Zi.attributes,bitset:{count:1,type:Zt.pe.UNSIGNED_BYTE,pack:Ji},width:{count:1,type:Zt.pe.HALF_FLOAT,pack:e=>Ki(e).width},height:{count:1,type:Zt.pe.HALF_FLOAT,pack:e=>Ki(e).height},offset:{count:2,type:Zt.pe.HALF_FLOAT,pack:({offsetX:e,offsetY:t})=>[(0,h.Lz)(e),-(0,h.Lz)(t)]},scale:{count:2,type:Zt.pe.UNSIGNED_BYTE,packPrecisionFactor:16,pack:({scaleX:e,scaleY:t})=>[e,t]},angle:{count:1,type:Zt.pe.UNSIGNED_BYTE,pack:({angle:e})=>(0,ts.wV)(e)}}};class tr extends Xi{constructor(){super(...arguments),this.vertexSpec=er}}const sr={createComputedParams:e=>e,optionalAttributes:Di.optionalAttributes,attributes:{...Di.attributes,bitset:{type:Zt.pe.UNSIGNED_BYTE,count:1,pack:e=>0},color:{type:Zt.pe.UNSIGNED_BYTE,count:4,normalized:!0,pack:({color:e})=>zt(e)}}},ir={createComputedParams:e=>e,optionalAttributes:Di.optionalAttributes,attributes:{...Di.attributes,bitset:{type:Zt.pe.UNSIGNED_BYTE,count:1,pack:e=>Rt([[0,!0],[1,e.outlineUsesColorVV]])},color:{type:Zt.pe.UNSIGNED_BYTE,count:4,normalized:!0,pack:({outlineColor:e})=>zt(e)}}};class rr extends Bi{constructor(){super(...arguments),this.vertexSpec=ir}}class nr extends Qi{constructor(e,t,s,i){super(e,t,s,i),this.vertexSpec=sr,this._lineMeshWriter=this._createOutlineWriter(e,t,s,i)}_createOutlineWriter(e,t,s,i){return new rr(e,t,s,i)}_write(e,{target:t,options:s}){const i=this.evaluatedMeshParams.effects,r=this.evaluatedMeshParams.outlineEffects,n=e.id||"",o=this._createEffectExecutionContext(t,s,n);if(i?.length||r?.length){if(i?.length){const s=this.getEffectCursor(t,i,o);if(s){let i;for(;i=s?.next();)i.invertY(),this._writeFill(e,t,i)}}else this._writeFill(e,t);if(r?.length){const s=this.getEffectCursor(t,r,o);if(s){let i;for(;i=s?.next();)i.invertY(),this._writeOutline(e,t,i)}}else this._writeOutline(e,t)}else this._writeSimpleOutlineFill(e,t)}_writeSimpleOutlineFill(e,t){const s=t.readGeometryForDisplay(),i=this._clip(s);i&&(this._writeGeometry(e,t,i),this._lineMeshWriter.writeLineVertices(e,kt.z.fromOptimizedCIM(i,"esriGeometryPolyline"),t))}_writeFill(e,t,s){const i=s?.asOptimized()??t.readGeometryForDisplay(),r=this._clip(i);r&&this._writeGeometry(e,t,r)}_writeOutline(e,t,s){const i=s?.asOptimized()??t.readGeometryForDisplay(),r=this._clip(i);r&&this._lineMeshWriter.writeLineVertices(e,kt.z.fromOptimizedCIM(r,"esriGeometryPolyline"),t)}_clip(e){return e?Ri(e,(0,Oi.Z0)(this.evaluatedMeshParams)):null}get effectInfos(){return[...this._evaluator.inputMeshParams.effects?.effectInfos??[],...this._evaluator.inputMeshParams.outlineEffects?.effectInfos??[]]}write(e,t,s,i,r){this.ensurePacked(t,s,i),e.recordStart(this.instanceId,this.attributeLayout),this._write(e,{target:s,options:i,level:r}),e.recordEnd()}ensurePacked(e,t,s){super.ensurePacked(e,t,s),this._lineMeshWriter.ensurePacked(e,t,s)}enqueueRequest(e,t,s){super.enqueueRequest(e,t,s),this._lineMeshWriter.enqueueRequest(e,t,s)}async loadDependencies(){await Promise.all([super.loadDependencies(),this._lineMeshWriter.loadDependencies()])}get hasEffects(){return!!this.evaluatedMeshParams.outlineEffects}}const or=er,ar=ir,cr={createComputedParams:e=>e,optionalAttributes:or.optionalAttributes,attributes:{...or.attributes,bitset:{type:Zt.pe.UNSIGNED_BYTE,count:1,pack:e=>Ji(e)},aux1:{count:1,type:Zt.pe.HALF_FLOAT,pack:e=>Ki(e).width},aux2:{count:1,type:Zt.pe.HALF_FLOAT,pack:e=>Ki(e).height},aux3:{count:2,type:Zt.pe.HALF_FLOAT,pack:({offsetX:e,offsetY:t})=>[(0,h.Lz)(e),(0,h.Lz)(t)]},aux4:{count:2,type:Zt.pe.UNSIGNED_BYTE,pack:({scaleX:e,scaleY:t})=>[16*e,16*t]}}},lr={createComputedParams:e=>e,optionalAttributes:or.optionalAttributes,attributes:{...or.attributes,color:ar.attributes.color,bitset:{type:Zt.pe.UNSIGNED_BYTE,count:1,pack:e=>Rt([[0,!0]])},aux1:{count:1,type:Zt.pe.HALF_FLOAT,pack:e=>(0,h.Lz)(.5*e.width)},aux2:{count:1,type:Zt.pe.HALF_FLOAT,pack:e=>(0,h.Lz)(.5*e.referenceWidth)},aux3:{count:2,type:Zt.pe.HALF_FLOAT,packTessellation:({extrusionOffsetX:e,extrusionOffsetY:t})=>[e,t]},aux4:{count:2,type:Zt.pe.UNSIGNED_BYTE,packTessellation:({normalX:e,normalY:t})=>[16*e+128,16*t+128]}}};class hr extends rr{constructor(){super(...arguments),this.vertexSpec=lr}}class ur extends nr{constructor(){super(...arguments),this.vertexSpec=cr}_createOutlineWriter(e,t,s,i){return new hr(e,t,s,i)}write(e,t,s,i,r){this.ensurePacked(t,s,i);const n=this.evaluatedMeshParams.sprite?.textureBinding;e.recordStart(this.instanceId,this.attributeLayout,n),this._write(e,{target:s,options:i,level:r}),e.recordEnd()}ensurePacked(e,t,s){super.ensurePacked(e,t,s),this._lineMeshWriter.ensurePacked(e,t,s)}enqueueRequest(e,t,s){super.enqueueRequest(e,t,s),this._lineMeshWriter.enqueueRequest(e,t,s)}async loadDependencies(){await Promise.all([super.loadDependencies(),this._lineMeshWriter.loadDependencies()])}}var dr=s(13337);class pr{constructor(e,t){this._size=e,this._sizeUnits=t,this._relativeSize=null}get relativeSize(){return this._relativeSize??=this.calculateRelativeSize(),this._relativeSize}calculateRelativeSize(){if(this._sizeUnits===dr.h.Relative){const e=Math.min(this._size/100,1);return[e,e]}return this.calculateRelativeSizeFromAbsolute()}}class fr extends pr{constructor(e,t,s,i){super(t,s),this.rotationMatrix00=1,this.rotationMatrix01=0,this.rotationMatrix10=0,this.rotationMatrix11=1,this.bounds={xmin:1/0,ymin:1/0,xmax:-1/0,ymax:-1/0},this.rotationMatrix00=Math.cos(i),this.rotationMatrix01=-Math.sin(i),this.rotationMatrix10=-this.rotationMatrix01,this.rotationMatrix11=this.rotationMatrix00;const{bounds:r,rotationMatrix00:n,rotationMatrix01:o,rotationMatrix10:a,rotationMatrix11:c}=this;e.forEachVertex((e,t)=>{const s=e*n+t*o,i=e*a+t*c;r.xmin=Math.min(r.xmin,s),r.ymin=Math.min(r.ymin,i),r.xmax=Math.max(r.xmax,s),r.ymax=Math.max(r.ymax,i)}),this.center=[(r.xmin+r.xmax)/2,(r.ymin+r.ymax)/2]}}class mr extends fr{constructor(e,t,s,i){super(e,t,s,i),this.method="linear"}getRelativePosition(e,t){const{rotationMatrix00:s,rotationMatrix01:i,bounds:r}=this,{xmin:n,xmax:o}=r;return[(e*s+t*i-n)/(o-n),0]}calculateRelativeSizeFromAbsolute(){const{_size:e,bounds:t}=this,{xmin:s,xmax:i}=t;return[(0,h.Lz)(e)/(i-s),0]}}class _r extends fr{constructor(e,t,s,i){super(e,t,s,i),this.method="rectangular"}getRelativePosition(e,t){const{bounds:s,center:i,rotationMatrix00:r,rotationMatrix01:n,rotationMatrix10:o,rotationMatrix11:a}=this,c=e*o+t*a,l=e*r+t*n-i[0],h=c-i[1];return[l*(2/(s.xmax-s.xmin)),-h*(2/(s.ymax-s.ymin))]}calculateRelativeSizeFromAbsolute(){const{_size:e,bounds:t}=this,{xmin:s,ymin:i,xmax:r,ymax:n}=t;return[(0,h.Lz)(2*e)/(r-s),(0,h.Lz)(2*e)/(n-i)]}}class yr extends fr{constructor(e,t,s){super(e,t,s,0),this.method="circular";const{xmin:i,xmax:r,ymin:n,ymax:o}=this.bounds,a=r-i,c=o-n;this.radius=Math.sqrt(a*a+c*c)/2}getRelativePosition(e,t){const{center:s,radius:i}=this;return[(e-s[0])/i,-(t-s[1])/i]}calculateRelativeSizeFromAbsolute(){const{_size:e}=this;return[(0,h.Lz)(e)/this.radius,0]}}function gr(e,t){if(null==e)return null;const s=(0,He.kU)(t.angle),i=t.gradientSize,r=t.gradientSizeUnits;switch(t.gradientMethod.toLowerCase()){case"linear":return new mr(e,i,r,s);case"rectangular":return new _r(e,i,r,s);case"circular":return new yr(e,i,r);default:return Ct.A.getLogger("esri.views.2d.engine.webgl.shaderGraph.techniques.fill.GradientSizeHelper").errorOnce(`Gradient fill method "${t.gradientMethod}" currently unsupported.`),null}}const xr={createComputedParams:e=>e,optionalAttributes:Hi.optionalAttributes,attributes:{...Hi.attributes,bitset:{type:Zt.pe.UNSIGNED_BYTE,count:1,pack:({gradientSizeUnits:e,gradientType:t})=>{let s=0;return e===dr.h.Absolute&&(s|=Et(0)),"discrete"===t.toLowerCase()&&(s|=Et(1)),s}},tlbr:{count:4,type:Zt.pe.UNSIGNED_SHORT,pack:({sprite:e})=>{const{rect:t,width:s,height:i}=e,r=t.x+p.hM+p.MZ,n=t.y+p.hM;return[r,n,r+s-2*p.MZ,n+i]}},relativePosition:{count:2,type:Zt.pe.HALF_FLOAT,packTessellation:({gradientStats:e},t,s,i)=>e?.getRelativePosition(s,i)??[0,0]},relativeGradientSize:{count:2,type:Zt.pe.HALF_FLOAT,packTessellation:({gradientStats:e})=>e?.relativeSize??[1,1]},gradientMethod:{count:1,type:Zt.pe.UNSIGNED_BYTE,pack:({gradientMethod:e})=>{switch(e.toLowerCase()){case"rectangular":return 1;case"circular":return 2;default:return 0}}}}};class br extends Wi{constructor(){super(...arguments),this.vertexSpec=xr}get _preventEffectClipping(){return!0}createTesselationParams(e){return{gradientStats:gr(this._unclippedGeometry,this.evaluatedMeshParams)}}_write(e,{target:t,effectGeometry:s}){const i=s?.asOptimized()??t.readGeometryForDisplay();this._unclippedGeometry=i;const r=this._clip(i);if(!r)return void(this._unclippedGeometry=null);const n=this.evaluatedMeshParams.sprite?.textureBinding;e.recordStart(this.instanceId,this.attributeLayout,n),this._writeGeometry(e,t,r),this._unclippedGeometry=null,e.recordEnd()}}const wr={optionalAttributes:Zi.optionalAttributes,createComputedParams:e=>e,attributes:{...Zi.attributes,...sr.attributes}},vr={optionalAttributes:Zi.optionalAttributes,createComputedParams:e=>e,attributes:{...Zi.attributes,...ir.attributes}};class Ir extends rr{constructor(){super(...arguments),this.vertexSpec=vr}}class Sr extends nr{constructor(){super(...arguments),this.vertexSpec=wr}_createOutlineWriter(e,t,s,i){return new Ir(e,t,s,i)}write(e,t,s,i,r){this.ensurePacked(t,s,i);const n=this.evaluatedMeshParams.sprite?.textureBinding;e.recordStart(this.instanceId,this.attributeLayout,n),this._write(e,{target:s,options:i,level:r}),e.recordEnd()}ensurePacked(e,t,s){super.ensurePacked(e,t,s),this._lineMeshWriter.ensurePacked(e,t,s)}enqueueRequest(e,t,s){super.enqueueRequest(e,t,s),this._lineMeshWriter.enqueueRequest(e,t,s)}async loadDependencies(){await Promise.all([super.loadDependencies(),this._lineMeshWriter.loadDependencies()])}}const kr={createComputedParams:e=>e,optionalAttributes:{},attributes:{pos:{type:Zt.pe.SHORT,count:2,pack:"position",packPrecisionFactor:10},id:{type:Zt.pe.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:Zt.pe.UNSIGNED_BYTE,count:1},offset:{type:Zt.pe.BYTE,count:2,packAlternating:{count:4,pack:()=>[[-1,-1],[1,-1],[-1,1],[1,1]]}}}};class Mr extends Jt{constructor(){super(...arguments),this.vertexSpec=kr}_write(e,{target:t}){e.recordStart(this.instanceId,this.attributeLayout);const s=t.getDisplayId();if("esriGeometryPoint"===t.geometryType){const i=t.readXForDisplay(),r=t.readYForDisplay();this._writeQuad(e,s,i,r)}else if("esriGeometryMultipoint"===t.geometryType){const i=t.readGeometryForDisplay();i?.forEachVertex((t,i)=>{t>=0&&t<=512&&i>=0&&i<=512&&this._writeQuad(e,s,t,i)})}e.recordEnd()}_writeQuad(e,t,s,i){const r=e.vertexCount();this._writeVertex(e,t,s,i),e.indexWrite(r+0),e.indexWrite(r+1),e.indexWrite(r+2),e.indexWrite(r+1),e.indexWrite(r+3),e.indexWrite(r+2)}}var Tr=s(16905),Ar=s(85560),Pr=s(88340),Cr=s(87992),Fr=s(32011),Er=s(15660);class Rr{constructor(e,t,s,i,r,n,o,a,c,l,h,u=[],d=0,p=0){this.displayId=e,this.labelClassId=t,this.labelIdHash=s,this.hash=i,this.anchorX=r,this.anchorY=n,this.directionX=o,this.directionY=a,this.maxScale=c,this.minScale=l,this.referenceBounds=h,this.bounds=u,this.recordStart=d,this.recordCount=p,this.priority=0,this._colliders=null,this.uniqueSymbol=null,this.selectedForRendering=!1}get xTile(){return this.anchorX}get yTile(){return this.anchorY}colliders(e){if(!this._colliders){const t=e.attributeView,s=p.C2;let i=this.referenceBounds?.size??0;const r=e.labelingCollisionInfos[0].vvEvaluators[0];if(null!=r){const e=r(t.getVisualVariableData(this.displayId,0));i=isNaN(e)||null==e||e===1/0?i:e}const n=this.minScale?e.tilingScheme.scaleToZoom(this.minScale):0,o=this.maxScale?e.tilingScheme.scaleToZoom(this.maxScale):25,a=this.directionX*(s+i/2),c=this.directionY*(s+i/2);this._colliders=this.bounds.map(e=>({labelId:this.labelIdHash,xTile:this.anchorX,yTile:this.anchorY,dxPixels:e.x-e.halfWidth+a,dyPixels:e.y-e.halfHeight+c,hard:!0,partIndex:1,width:e.width+2,height:e.height+2,angle:0,xScreen:0,yScreen:0,dxScreen:0,dyScreen:0,enabled:!0,minLod:n,maxLod:o}))}return this._colliders}get id(){return this.displayId}serialize(e){e.push(this.displayId),e.push(this.labelClassId),e.push(this.labelIdHash),e.push(this.hash),e.push(this.recordStart),e.push(this.recordCount),e.writeF32(this.anchorX),e.writeF32(this.anchorY),e.writeF32(this.directionX),e.writeF32(this.directionY),e.writeF32(this.maxScale),e.writeF32(this.minScale),this.referenceBounds?(e.writeF32(this.referenceBounds.size),e.writeF32(this.referenceBounds.offsetX),e.writeF32(this.referenceBounds.offsetY)):(e.writeF32(0),e.writeF32(0),e.writeF32(0)),H(e,this.bounds)}static deserialize(e){const t=e.readInt32(),s=e.readInt32(),i=e.readInt32(),r=e.readInt32(),n=e.readInt32(),o=e.readInt32(),a=e.readF32(),c=e.readF32(),l=e.readF32(),h=e.readF32(),u=e.readF32(),d=e.readF32(),p=e.readF32(),f=e.readF32(),m=e.readF32(),_=Q(e,Er.A)??[];return new Rr(t,s,i,r,a,c,l,h,u,d,{size:p,offsetX:f,offsetY:m},_,n,o)}}function zr(e,t,s){return e[0]=t[0]-s[0],e[1]=t[1]-s[1],e}function Or(e,t){return Math.sqrt(e*e+t*t)}function Lr(e){const t=Or(e[0],e[1]);e[0]/=t,e[1]/=t}function Dr(e,t){return Or(e[0]-t[0],e[1]-t[1])}function Nr(e){return e.length-1}function qr(e,t,s=1){let[i,r]=function(e,t){return e[t+1]}(e,t);return[i,r]=[Math.round(i),Math.round(r)],Math.sqrt(i*i+r*r)*s}class Br{constructor(e,t,s,i,r){this._segments=e,this._index=t,this._distance=s,this._xStart=i,this._yStart=r,this._done=!1}static create(e){return new Br(e,0,0,e[0][0],e[0][1])}clone(){return new Br(this._segments,this._index,this._distance,this.xStart,this.yStart)}equals(e){return this._index===e._index||e._index===this._index-1&&(0===this._distance||1===e._distance)||e._index===this._index+1&&(1===this._distance||0===e._distance)}leq(e){return this._index<e._index||this._index===e._index&&this._distance<=e._distance}geq(e){return this._index>e._index||this._index===e._index&&this._distance>=e._distance}get _segment(){return this._segments[this._index+1]}get angle(){const e=this.dy,t=(0*e+-1*-this.dx)/(1*this.length);let s=Math.acos(t);return e>0&&(s=2*Math.PI-s),s}get xStart(){return this._xStart}get yStart(){return this._yStart}get x(){return this.xStart+this.distance*this.dx}get y(){return this.yStart+this.distance*this.dy}get dx(){return this._segment[0]}get dy(){return this._segment[1]}get xMidpoint(){return this.xStart+.5*this.dx}get yMidpoint(){return this.yStart+.5*this.dy}get xEnd(){return this.xStart+this.dx}get yEnd(){return this.yStart+this.dy}get length(){const{dx:e,dy:t}=this;return Math.sqrt(e*e+t*t)}get remainingLength(){return this.length*(1-this._distance)}get backwardLength(){return this.length*this._distance}get distance(){return this._distance}get done(){return this._done}hasPrev(){return this._index-1>=0}hasNext(){return this._index+1<Nr(this._segments)}next(){return this.hasNext()?(this._xStart+=this.dx,this._yStart+=this.dy,this._distance=0,this._index+=1,this):null}prev(){return this.hasPrev()?(this._index-=1,this._xStart-=this.dx,this._yStart-=this.dy,this._distance=1,this):(this._done=!0,null)}_seekBackwards(e,t){const s=this.backwardLength;if(e<=s)return this._distance=(s-e)/this.length,this;let i=this.backwardLength;for(;this.prev();){if(i+this.length>e)return this._seekBackwards(e-i);i+=this.length}return this._distance=0,t?this:null}seek(e,t=!1){if(e<0)return this._seekBackwards(Math.abs(e),t);if(e<=this.remainingLength)return this._distance=(this.backwardLength+e)/this.length,this;let s=this.remainingLength;for(;this.next();){if(s+this.length>e)return this.seek(e-s,t);s+=this.length}return this._distance=1,t?this:null}}function Gr(e,t,s,i=!0){const r=function(e){let t=0;for(let s=0;s<Nr(e);s++)t+=qr(e,s);return t}(e),n=Br.create(e),o=r/2;if(!i)return n.seek(o),void(n.x<p.CQ&&n.y<p.CQ&&n.x>=0&&n.y>=0&&s(n.clone(),0,o+0*t,r));const a=Math.max((r-t)/2,0),c=Math.floor(a/t),l=o-c*t;n.seek(l);for(let e=-c;e<=c;e++)n.x<p.CQ&&n.y<p.CQ&&n.x>=0&&n.y>=0&&s(n.clone(),e,o+e*t,r),n.seek(t)}function jr(e,t){const s=t;for(let t=0;t<e.length;t++){let i=e[t];Ur(i,s);const r=[];r.push(i[0]);for(let e=1;e<i.length;e++){const[t,s]=i[e-1],[n,o]=i[e],a=n-t,c=o-s;r.push([a,c])}e[t]=r,i=r}return e}function Ur(e,t){const s=1e-6;if(t<=0)return;const i=e.length;if(i<3)return;const r=[];let n=0;r.push(0);for(let t=1;t<i;t++)n+=Dr(e[t],e[t-1]),r.push(n);t=Math.min(t,.2*n);const o=[];o.push(e[0][0]),o.push(e[0][1]);const a=e[i-1][0],c=e[i-1][1],l=zr([0,0],e[0],e[1]);Lr(l),e[0][0]+=t*l[0],e[0][1]+=t*l[1],zr(l,e[i-1],e[i-2]),Lr(l),e[i-1][0]+=t*l[0],e[i-1][1]+=t*l[1];for(let e=1;e<i;e++)r[e]+=t;r[i-1]+=t;const h=.5*t;for(let n=1;n<i-1;n++){let a=0,c=0,l=0;for(let i=n-1;i>=0&&!(r[i+1]<r[n]-h);i--){const o=h+r[i+1]-r[n],u=r[i+1]-r[i],d=r[n]-r[i]<h?1:o/u;if(Math.abs(d)<s)break;const p=d*d,f=d*o-.5*p*u,m=d*u/t,_=e[i+1],y=e[i][0]-_[0],g=e[i][1]-_[1];a+=m/f*(_[0]*d*o+.5*p*(o*y-u*_[0])-p*d*u*y/3),c+=m/f*(_[1]*d*o+.5*p*(o*g-u*_[1])-p*d*u*g/3),l+=m}for(let o=n+1;o<i&&!(r[o-1]>r[n]+h);o++){const i=h-r[o-1]+r[n],u=r[o]-r[o-1],d=r[o]-r[n]<h?1:i/u;if(Math.abs(d)<s)break;const p=d*d,f=d*i-.5*p*u,m=d*u/t,_=e[o-1],y=e[o][0]-_[0],g=e[o][1]-_[1];a+=m/f*(_[0]*d*i+.5*p*(i*y-u*_[0])-p*d*u*y/3),c+=m/f*(_[1]*d*i+.5*p*(i*g-u*_[1])-p*d*u*g/3),l+=m}o.push(a/l),o.push(c/l)}o.push(a),o.push(c);for(let t=0,s=0;t<i;t++)e[t][0]=o[s++],e[t][1]=o[s++]}var Vr=s(63933);class Wr{constructor(e){const{offsetX:t,offsetY:s,postAngle:i,fontSize:r,haloSize:n,outlineSize:o,scaleFactor:a,transforms:c}=e;if(this.offsetX=t,this.offsetY=s,this.postAngle=i,this.fontSize=Math.min(r,96),this.haloSize=n??0,this.outlineSize=o??0,this.transforms=c,c&&c.infos.length>1){const e=(0,Ke.zb)(r,i,!1,t,s,c,!1);this.fontSize=Math.min(e.size,96);const n=e.size/r;this.haloSize*=n,this.outlineSize*=n,this.postAngle=e.rotation,this.offsetX=e.offsetX,this.offsetY=e.offsetY}a&&(this.fontSize*=a,this.offsetX*=a,this.offsetY*=a)}}const Yr=28,$r=[4,4],Hr=[16,4],Qr={topLeft:Hr,topRight:Hr,bottomLeft:Hr,bottomRight:Hr},Zr=[4,2],Xr=[4,6],Kr={topLeft:Zr,topRight:Zr,bottomLeft:Xr,bottomRight:Xr},Jr={topLeft:Zr,topRight:Xr,bottomLeft:Zr,bottomRight:Xr},en={topLeft:Xr,topRight:Xr,bottomLeft:$r,bottomRight:$r},tn={topLeft:$r,topRight:$r,bottomLeft:Xr,bottomRight:Xr},sn={topLeft:Xr,topRight:$r,bottomLeft:Xr,bottomRight:$r},rn={topLeft:$r,topRight:Xr,bottomLeft:$r,bottomRight:Xr};function nn(e){return{backgroundColor:e.boxBackgroundColor??e.backgroundColor??null,borderLineColor:e.boxBorderLineColor??e.borderLineColor??null,borderLineSize:e.boxBorderLineSize>0?e.boxBorderLineSize:e.borderLineWidth??0}}const on={createComputedParams:e=>e,optionalAttributes:{zoomRange:{type:Zt.pe.HALF_FLOAT,count:2,packTessellation:({minZoom:e,maxZoom:t})=>[e||0,t||Yr]},clipAngle:{type:Zt.pe.UNSIGNED_BYTE,count:1,packTessellation:({clipAngle:e})=>cn(e||0)},referenceSymbol:{type:Zt.pe.BYTE,count:4,packTessellation:(e,t)=>{const s=e.isLineLabel||!e.referenceBounds,i=(0,Vr.iT)(s?"center":t.horizontalAlignment),r=(0,Vr.Dy)(s?"middle":t.verticalAlignment),{offsetX:n,offsetY:o,size:a}=s?{offsetX:0,offsetY:0,size:0}:e.referenceBounds;return[(0,h.Lz)(n),-(0,h.Lz)(o),Math.round((0,h.Lz)(a)),i+1<<2|r+1]}},visibility:{type:Zt.pe.FLOAT,count:1,otherSource:!0}},attributes:{pos:{type:Zt.pe.SHORT,count:2,pack:"position",packPrecisionFactor:10},id:{type:Zt.pe.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:Zt.pe.UNSIGNED_BYTE,count:1,packTessellation:({isBackground:e,mapAligned:t})=>Rt([[0,e],[3,!!t]])},offset:{type:Zt.pe.SHORT,count:2,packPrecisionFactor:8,packAlternating:{count:4,packTessellation:({offsets:e})=>{const{bottomLeft:t,bottomRight:s,topLeft:i,topRight:r}=e;return[i,r,t,s]}}},textureUV:{type:Zt.pe.UNSIGNED_SHORT,count:2,packAlternating:{count:4,packTessellation:({texcoords:e})=>{const{bottomLeft:t,bottomRight:s,topLeft:i,topRight:r}=e;return[i,r,t,s]}}},color:{type:Zt.pe.UNSIGNED_BYTE,count:4,normalized:!0,packTessellation:({color:e})=>e},fontAndReferenceSize:{type:Zt.pe.UNSIGNED_SHORT,count:4,packPrecisionFactor:4,packTessellation:({fontSize:e,sdfSize:t,sdfRadius:s},{referenceSize:i})=>[Math.round((0,h.Lz)(e)),Math.round((0,h.Lz)(i??e)),t,s]},outlineColor:{type:Zt.pe.UNSIGNED_BYTE,count:4,normalized:!0,pack:({outlineColor:e})=>zt(e)},haloColor:{type:Zt.pe.UNSIGNED_BYTE,count:4,normalized:!0,pack:({haloColor:e})=>zt(e)},outlineAndHaloSize:{type:Zt.pe.UNSIGNED_SHORT,count:2,packPrecisionFactor:4,packTessellation:({outlineSize:e,haloSize:t})=>[Math.round((0,h.Lz)(e)),Math.round((0,h.Lz)(t))]}}};class an extends Jt{constructor(){super(...arguments),this.vertexSpec=on,this._textMeshParamsPropsInitialized=!1}ensurePacked(e,t,s){super.ensurePacked(e,t,s),this._textMeshParamsPropsInitialized&&!this._evaluator.hasDynamicProperties||(this._textMeshTransformProps=new Wr(this.evaluatedMeshParams),this._textMeshParamsPropsInitialized=!0)}_write(e,{target:t,effectGeometry:s}){const i=this._getShaping();if(!i)return;const r=1===this.evaluatedMeshParams.alignment,n=t.getDisplayId(),{placement:o}=this.evaluatedMeshParams;if(null!=o){if("PrivatePlacementMultipoint"!==o.type)this._writePlacedTextMarkers(e,t,i,(0,Ke.oI)(s));else{const s=this._getMultipointShaping();s&&this._writeMultipointText(e,t,s)}return}if(s?.nextPath())return s.nextPoint(),this._writeGlyphs(e,n,s.x,s.y,i,0,void 0,{mapAligned:r});if("esriGeometryPolygon"===t.geometryType){const s=t.readCentroidForDisplay();if(!s)return;const[o,a]=s.coords;return this._writeGlyphs(e,n,o,a,i,0,void 0,{mapAligned:r})}if("esriGeometryMultipoint"===t.geometryType){const s=t.readGeometryForDisplay();return void s?.forEachVertex((t,s)=>this._writeGlyphs(e,n,t,s,i,0,void 0,{mapAligned:r}))}const a=t.readXForDisplay(),c=t.readYForDisplay();return this._writeGlyphs(e,n,a,c,i,0,void 0,{mapAligned:r})}_writePlacedTextMarkers(e,t,s,i){const r=i??kt.z.fromFeatureSetReaderCIM(t);if(!r)return;const n=At.getPlacement(r,-1,this.evaluatedMeshParams.placement,(0,h.Lz)(1),e.id);if(!n)return;const o=t.getDisplayId();let a=n.next();for(;null!=a;){const t=-a.getAngle(),i=a.tx,r=-a.ty;this._writeGlyphs(e,o,i,r,s,t,void 0,{mapAligned:1===this.evaluatedMeshParams.alignment}),a=n.next()}}_writeMultipointText(e,t,s){const i=kt.z.fromFeatureSetReaderCIM(t);if(!i)return;const r=At.getPlacement(i,-1,this.evaluatedMeshParams.placement,(0,h.Lz)(1),e.id);if(!r)return;const n=t.getDisplayId();let o=r.next(),a=0;for(;null!=o;){const t=o.tx,i=-o.ty,c=-o.getAngle();this._writeGlyph(e,n,t,i,s,a,c,void 0,{mapAligned:1===this.evaluatedMeshParams.alignment}),o=r.next(),a++}}_getShaping(e){const t=this._textMeshTransformProps,s=this.evaluatedMeshParams;if(!s.glyphs?.glyphs.length)return null;const i=(0,h.Lz)(t.fontSize),r=(0,h.Lz)(t.offsetX),n=(0,h.Lz)(t.offsetY),o=s.glyphs.sdfSize,a=(0,He.qE)((0,h.Lz)(s.lineWidth),p.GR,p.cp),c=o/24*p.DY*(0,He.qE)(s.lineHeightRatio,.25,4),{backgroundColor:l,borderLineSize:u}=nn(s);return(0,tt.Tl)(s.glyphs,{scale:i/o,angle:t.postAngle,xOffset:r,yOffset:n,horizontalAlignment:s.horizontalAlignment,verticalAlignment:e||s.verticalAlignment,maxLineWidth:a,lineHeight:c,decoration:s.decoration,borderLineSizePx:(0,h.Lz)(u),hasBackground:!!l,useCIMAngleBehavior:s.useCIMAngleBehavior})}_getMultipointShaping(){const e=this._textMeshTransformProps,t=this.evaluatedMeshParams;if(!t.glyphs?.glyphs.length)return null;const s=(0,h.Lz)(e.fontSize),i=(0,h.Lz)(e.offsetX),r=(0,h.Lz)(e.offsetY),n=t.glyphs.sdfSize,o=(0,He.qE)((0,h.Lz)(t.lineWidth),p.GR,p.cp),a=n/24*p.DY*(0,He.qE)(t.lineHeightRatio,.25,4),{backgroundColor:c,borderLineSize:l}=nn(t);return(0,tt.Dj)(t.glyphs,{scale:s/n,angle:e.postAngle,xOffset:i,yOffset:r,horizontalAlignment:t.horizontalAlignment,verticalAlignment:t.verticalAlignment,maxLineWidth:o,lineHeight:a,decoration:t.decoration,borderLineSizePx:(0,h.Lz)(l),hasBackground:!!c,useCIMAngleBehavior:t.useCIMAngleBehavior})}_writeGlyphs(e,t,s,i,r,n,o,a,c=!0){const l=this.evaluatedMeshParams,u=this._textMeshTransformProps,d=(0,h.Lz)(u.fontSize),p=u.haloSize,f=u.outlineSize,m=(0,h.Lz)(u.offsetX),_=(0,h.Lz)(u.offsetY),{sdfSize:y,sdfRadius:g}=l.glyphs,[x,b]=Ft(l.scaleInfo,this.getTileInfo());0!==n&&r.setRotation(n);const w=r.bounds,v=s+w.x+m,I=i+w.y-_,S=2*(l.minPixelBuffer?l.minPixelBuffer/d:1),k=Math.max(w.width,w.height)*S;r.textBox&&(e.recordStart(this.instanceId,this.attributeLayout,r.glyphs[0].textureBinding),c&&e.recordBounds(v,I,k,k),this._writeTextBox(e,t,s,i,r.textBox,o,a),e.recordEnd());for(const n of r.glyphs){e.recordStart(this.instanceId,this.attributeLayout,n.textureBinding),c&&e.recordBounds(v,I,k,k);const{texcoords:r,offsets:h}=n;this._writeQuad(e,t,s,i,{texcoords:r,offsets:h,fontSize:d,haloSize:p,outlineSize:f,sdfSize:y,sdfRadius:g,color:zt(l.color),isBackground:!1,referenceBounds:o,minZoom:x,maxZoom:b,...a}),e.recordEnd()}0!==n&&r.setRotation(-n)}_writeGlyph(e,t,s,i,r,n,o,a,c,l=!0){const u=this.evaluatedMeshParams,d=this._textMeshTransformProps,p=(0,h.Lz)(d.fontSize),f=d.haloSize,m=d.outlineSize,_=(0,h.Lz)(d.offsetX),y=(0,h.Lz)(d.offsetY),{sdfSize:g,sdfRadius:x}=u.glyphs;0!==o&&r.setRotation(o);const b=r.bounds,w=s+b.x+_,v=i+b.y-y,I=2*(u.minPixelBuffer?u.minPixelBuffer/p:1),S=Math.max(b.width,b.height)*I,k=r.glyphs[n];e.recordStart(this.instanceId,this.attributeLayout,k.textureBinding),l&&e.recordBounds(w,v,S,S);const{texcoords:M,offsets:T}=k;this._writeQuad(e,t,s,i,{texcoords:M,offsets:T,fontSize:p,haloSize:f,outlineSize:m,sdfSize:g,sdfRadius:x,color:zt(u.color),isBackground:!1,referenceBounds:a,minZoom:0,maxZoom:30,...c}),e.recordEnd(),0!==o&&r.setRotation(-o)}_writeTextBox(e,t,s,i,r,n,o){const a=this.evaluatedMeshParams,{fontSize:c,haloSize:l,outlineSize:h}=this._textMeshTransformProps,{backgroundColor:u,borderLineColor:d,borderLineSize:p}=nn(a),{sdfSize:f,sdfRadius:m}=a.glyphs,_=!!d&&p>0,y={isBackground:!0,fontSize:c,haloSize:l,outlineSize:h,referenceBounds:n,sdfSize:f,sdfRadius:m,...o};u&&(this._writeQuad(e,t,s,i,{texcoords:Qr,offsets:r.main,color:zt(u),...y}),_||(this._writeQuad(e,t,s,i,{texcoords:en,offsets:r.top,color:zt(u),...y}),this._writeQuad(e,t,s,i,{texcoords:tn,offsets:r.bot,color:zt(u),...y}),this._writeQuad(e,t,s,i,{texcoords:sn,offsets:r.left,color:zt(u),...y}),this._writeQuad(e,t,s,i,{texcoords:rn,offsets:r.right,color:zt(u),...y}))),_&&(this._writeQuad(e,t,s,i,{texcoords:Kr,offsets:r.top,color:zt(d),...y}),this._writeQuad(e,t,s,i,{texcoords:Kr,offsets:r.bot,color:zt(d),...y}),this._writeQuad(e,t,s,i,{texcoords:Jr,offsets:r.left,color:zt(d),...y}),this._writeQuad(e,t,s,i,{texcoords:Jr,offsets:r.right,color:zt(d),...y}))}_writeQuad(e,t,s,i,r){const n=e.vertexCount();this._writeVertex(e,t,s,i,r),e.indexWrite(n+0),e.indexWrite(n+1),e.indexWrite(n+2),e.indexWrite(n+1),e.indexWrite(n+3),e.indexWrite(n+2)}}const cn=e=>Math.round(e*(256/360)),ln=p.CQ*p.CQ/16,hn=(0,Ke.z9)(()=>Promise.all([s.e(3661),s.e(1878),s.e(8885),s.e(5756),s.e(3708)]).then(s.bind(s,33708))),un=(0,Ke.z9)(()=>Promise.all([s.e(3661),s.e(1878),s.e(8885),s.e(4690)]).then(s.bind(s,14690))),dn=(0,z.Bj)(e=>{let t=0;if(0===e)return 1/0;for(;!(e%2);)t++,e/=2;return t});class pn extends an{constructor(){super(...arguments),this._zoomLevel=0}async loadDependencies(){await Promise.all([super.loadDependencies(),hn.getImportPromise(),un.getImportPromise()])}_write(e,{target:t,effectGeometry:s,level:i,viewExtent:r}){if(this._zoomLevel=i,null!=s)throw new Error("InternalError: EffectGeometry not support for LabelMeshWriter");switch(t.geometryType){case"esriGeometryPoint":{const s=t.readXForDisplay(),i=t.readYForDisplay();this._writePoint(e,s,i,0,t);break}case"esriGeometryEnvelope":case"esriGeometryPolygon":this._writePolygon(e,t,r);break;case"esriGeometryMultipoint":{let s=0;const i=kt.z.fromFeatureSetReader(t);if(i?.nextPath())for(;i.nextPoint();)this._writePoint(e,i.x,i.y,s++,t);break}case"esriGeometryPolyline":this._writeLines(e,t)}}_getMetricDir(){const{horizontalAlignment:e,verticalAlignment:t}=this.evaluatedMeshParams;return["center"===e?0:"right"===e?-1:1,"middle"===t?0:"bottom"===t?-1:1]}_createLineLabelMetric(e,t,s,i,r,n){const[o,a]=this._getMetricDir(),c=this.evaluatedMeshParams.scaleInfo?.maxScale??0,l=this.evaluatedMeshParams.scaleInfo?.minScale??0,h=this.evaluatedMeshParams.labelClassId;return new Rr(e,h,t,s,i,r,o,a,c,l,n)}_writePolygon(e,t,s){const i=hn.module,r=un.module.constructFromFlatGeometry,n=t.readGeometryForDisplay(),o=t.readCentroidForDisplay()?.coords,a=n?.area()||0;if(!o)return;const c=a>=ln;e.requiresRefresh||=c;const l=r((0,Cr.ME)(s)),h=r((0,Cr.ME)({x:o[0],y:o[1]})),u=!!i.execute(h,l,null);if(!n||!c||!u)return void this._writePoint(e,o[0],o[1],0,t);const d=r((0,Cr.Nh)("polygon",n,null)),p=i.execute(d,l,null);if(!p)return void this._writePoint(e,o[0],o[1],0,t);const f=(0,Cr.JR)(new Cr.uX(p.toFlatGeometry())),m=kt.z.fromOptimized(f,"esriGeometryPolygon",1),_=(0,Fr.d)(m)??o;this._writePoint(e,_[0],_[1],0,t)}_writePoint(e,t,s,i,r){if(t<0||t>p.CQ||s<0||s>p.CQ)return;const n=this._getShaping();if(!n)return;const o=r.getDisplayId(),a=this.evaluatedMeshParams.labelClassId,c=function(e,t,s){return(0,vt.Wm)(`${e}${t}${s}`)}(this.evaluatedMeshParams.layerId,r.getObjectId(),i),l=function(e,t,s){return(0,vt.Wm)(`${e}${t}${s}`)}(r.getObjectId(),a,i),[h,u]=this._getMetricDir(),d=this.evaluatedMeshParams.scaleInfo?.maxScale??0,f=this.evaluatedMeshParams.scaleInfo?.minScale??0,m=this._getPointReferenceBounds()||{offsetX:0,offsetY:0,size:0};e.metricStart(new Rr(o,a,c,l,t,s,h,u,d,f,m)),this._writeGlyphs(e,o,t,s,n,0,m,void 0,!1),e.metricBoxWrite(n.boundsT),e.metricEnd()}_getPointReferenceBounds(){if(!this._references)return null;for(const e of this._references){const t=e.getBoundsInfo();if(t)return t}return null}_writeLines(e,t){const{scaleInfo:s,verticalAlignment:i}=this.evaluatedMeshParams,r=this.evaluatedMeshParams.repeatLabelDistance||128,n=this._getShaping("middle");if(!n)return;const o=(e,t,s,i)=>this._placeSubdivGlyphs(e,t,s,i),a=(n.bounds.width+r)/2;this._current={out:e,id:t.getDisplayId(),objId:t.getObjectId(),shaping:n,zoomRange:Ft(s,this.getTileInfo()),referenceBounds:this._getPointReferenceBounds()||{offsetX:0,offsetY:0,size:0},offsetDirection:null,pathIndex:0},this._verticalPlacement="bottom"===i?"above":"top"===i?"below":null,this._verticalPlacement?this._writeAboveAndBelowAlong(t,o,a):this._writeCenterAlong(t,o,a)}_writeAboveAndBelowAlong(e,t,s){const{repeatLabel:i}=this.evaluatedMeshParams,{shaping:r}=this._current,n=r.bounds.halfHeight,o=e.readGeometryForDisplay();if(!o)return;const a=(0,st.kz)(o,"esriGeometryPolyline",1)??new Te.A,c=fn(a,n),l=fn(a,-n),h=(0,st.zv)(l,"esriGeometryPolyline",!1,!1),u=jr((0,st.zv)(c,"esriGeometryPolyline",!1,!1).paths,r.bounds.width),d=jr(h.paths,r.bounds.width);this._current.offsetDirection="above";for(let e=0;e<u.length;e++)this._current.pathIndex=e,Gr(u[e],s,t,!!i);this._current.offsetDirection="below";for(let e=0;e<d.length;e++)this._current.pathIndex=e,Gr(d[e],s,t,!!i)}_writeCenterAlong(e,t,s){const{repeatLabel:i}=this.evaluatedMeshParams,{shaping:r}=this._current,n=jr(e.readLegacyGeometryForDisplay().paths,r.bounds.width);for(let e=0;e<n.length;e++)this._current.pathIndex=e,Gr(n[e],s,t,!!i)}_placeSubdivGlyphs(e,t,s,i){const{allowOverrun:r,labelPosition:n,repeatLabelDistance:o,layerId:a,labelClassId:c}=this.evaluatedMeshParams,{objId:l,shaping:h,pathIndex:u}=this._current,d=this._current.zoomRange[0],p=dn(t),f=this._current.shaping.bounds.width/2,m=Math.sqrt(o||128)/2,_=Math.min(s,i-s),y=h.isMultiline?Yr:Math.log2(_/(m+f/2)),g=0===t?y:Math.min(p,y),x=Math.max(d,this._zoomLevel+1-g),b=this._zoomLevel-x,w=h.bounds.width/2*2**b,v=function(e,t,s,i,r){return(0,vt.Wm)(`${e}${t}${s}${i*2**(Yr-r)}`)}(a,l,u,t,this._zoomLevel),I=function(e,t,s,i,r){return(0,vt.Wm)(`${e}${r}${t}${s*2**(Yr-i)}`)}(l,u,t,this._zoomLevel,c);this._current.shaping.isMultiline?0===t&&this._placeStraight(e,x,v,I):r&&b<0?this._placeStraightAlong(e,d,v,I):"parallel"===n?this._placeStraightAlong(e,x,v,I):"curved"===n&&this._placeCurved(e,x,w,v,I)}_placeStraight(e,t,s,i){const{out:r,id:n,shaping:o,referenceBounds:a}=this._current,{x:c,y:l}=e;r.metricStart(this._createLineLabelMetric(n,s,i,c,l)),r.metricBoxWrite(o.boundsT);const h=e.angle*(180/Math.PI)%360,u=(e.angle*(180/Math.PI)+180)%360;if(!this._verticalPlacement||this._verticalPlacement===this._current.offsetDirection){const e={clipAngle:h,mapAligned:!0,isLineLabel:!0,minZoom:t};this._writeGlyphs(r,n,c,l,o,0,a,e,!1)}if(!this._verticalPlacement||this._verticalPlacement!==this._current.offsetDirection){const e={clipAngle:u,mapAligned:!0,isLineLabel:!0,minZoom:t};this._writeGlyphs(r,n,c,l,o,0,a,e,!1)}r.metricEnd()}_placeCurved(e,t,s,i,r){const{out:n,id:o}=this._current;n.metricStart(this._createLineLabelMetric(o,i,r,e.x,e.y));const a=e.clone(),c=e.angle*(180/Math.PI)%360,l=(e.angle*(180/Math.PI)+180)%360;this._verticalPlacement&&this._verticalPlacement!==this._current.offsetDirection||(this._placeFirst(a,t,1,c),this._placeBack(e,a,t,s,1,c),this._placeForward(e,a,t,s,1,c)),this._verticalPlacement&&this._verticalPlacement===this._current.offsetDirection||(this._placeFirst(a,t,0,l),this._placeBack(e,a,t,s,0,l),this._placeForward(e,a,t,s,0,l)),n.metricEnd()}_placeStraightAlong(e,t,s,i){const{out:r,id:n,shaping:o,zoomRange:a,referenceBounds:c}=this._current,{boxBorderLineColor:l,boxBackgroundColor:u}=this.evaluatedMeshParams,d=e.clone(),p=e.angle*(180/Math.PI)%360,f=(e.angle*(180/Math.PI)+180)%360,m=o.glyphs.length>0&&!(!l&&!u);if(r.metricStart(this._createLineLabelMetric(n,s,i,e.x,e.y)),m){const s=Math.max(t,a[0],0),i=Math.min(Yr,a[1]),l=(0,Tr.$0)((0,Ar.vt)(),-e.angle),u={minZoom:s,maxZoom:i,clipAngle:p,mapAligned:!0,isLineLabel:!0},d=(0,h.Lz)(this.evaluatedMeshParams.offsetX),m=(0,h.Lz)(this.evaluatedMeshParams.offsetY);if(!this._verticalPlacement||this._verticalPlacement===this._current.offsetDirection){const t=(0,Pr.fA)(d,-1*m),[s,i]=o.shapeBackground((0,Tr.Tl)((0,Ar.vt)(),l,t));r.recordStart(this.instanceId,this.attributeLayout,o.glyphs[0].textureBinding),this._writeTextBox(r,n,e.x,e.y,i,c,u),r.recordEnd()}if(!this._verticalPlacement||this._verticalPlacement!==this._current.offsetDirection){const t=(0,Pr.fA)(d,m),[s,i]=o.shapeBackground((0,Tr.Tl)((0,Ar.vt)(),l,t));u.clipAngle=f,r.recordStart(this.instanceId,this.attributeLayout,o.glyphs[0].textureBinding),this._writeTextBox(r,n,e.x,e.y,i,c,u),r.recordEnd()}}this._verticalPlacement&&this._verticalPlacement!==this._current.offsetDirection||this._placeFirst(d,t,1,p,!0),this._verticalPlacement&&this._verticalPlacement===this._current.offsetDirection||this._placeFirst(d,t,0,f,!0),r.metricEnd()}_placeBack(e,t,s,i,r,n){const o=e.clone();let a=e.backwardLength+0;for(;o.prev()&&!(a>=i);)this._placeOnSegment(o,t,a,s,-1,r,n),a+=o.length+0}_placeForward(e,t,s,i,r,n){const o=e.clone();let a=e.remainingLength+0;for(;o.next()&&!(a>=i);)this._placeOnSegment(o,t,a,s,1,r,n),a+=o.length+0}_placeFirst(e,t,s,i,r=!1){const{out:n,id:o,shaping:a,zoomRange:c,referenceBounds:l}=this._current,h=a.glyphs,u=this._getBoundsOffset(e.angle);for(const d of h){const h=d.x>a.bounds.x?s:1-s,p=h*e.remainingLength+(1-h)*e.backwardLength,f=Math.abs(d.x+d.width/2-a.bounds.x),m=Math.max(0,this._zoomLevel+Math.log2(f/(p+0))),_=Math.max(t,r?0:m);d.angle=e.angle+(1-s)*Math.PI;const y=[Math.max(c[0],_),Math.min(c[1],Yr)];this._writeLineGlyph(n,o,e.x,e.y,d,y,i,l),this._writeLineGlyphBox(n,d,s,y,u)}}_placeOnSegment(e,t,s,i,r,n,o){const{out:a,id:c,shaping:l,referenceBounds:h}=this._current,u=l.glyphs,d=e.dx/e.length,p=e.dy/e.length,f={x:e.x+s*-r*d,y:e.y+s*-r*p},m=this._getBoundsOffset(e.angle);for(const t of u){const u=t.x>l.bounds.x?n:1-n;if(!(u&&1===r||!u&&-1===r))continue;const d=Math.abs(t.x+t.width/2-l.bounds.x),p=Math.max(0,this._zoomLevel+Math.log2(d/s)-.1),_=Math.max(i,this._zoomLevel+Math.log2(d/(s+e.length+0)));if(0===p)continue;t.angle=e.angle+(1-n)*Math.PI;const y=[_,p];this._writeLineGlyph(a,c,f.x,f.y,t,y,o,h),this._writeLineGlyphBox(a,t,n,y,m)}}_getBoundsOffset(e){const t=(0,h.Lz)(this.evaluatedMeshParams.offsetX),s=(0,h.Lz)(this.evaluatedMeshParams.offsetY),i=(0,Pr.fA)(t,s),r=(0,Tr.$0)((0,Ar.vt)(),-e);return(0,D.l0)(i,i,r)}_writeLineGlyph(e,t,s,i,r,n,o,a){if(s<0||s>p.CQ||i<0||i>p.CQ)return;e.recordStart(this.instanceId,this.attributeLayout,r.textureBinding);const{texcoords:c,offsets:l}=r,{fontSize:h,haloSize:u,outlineSize:d}=this._textMeshTransformProps,{sdfSize:f,sdfRadius:m}=this.evaluatedMeshParams.glyphs;this._writeQuad(e,t,s,i,{sdfSize:f,sdfRadius:m,texcoords:c,offsets:l,fontSize:h,haloSize:u,outlineSize:d,color:zt(this.evaluatedMeshParams.color),isBackground:!1,referenceBounds:a,minZoom:Math.max(this._current.zoomRange[0],n[0]),maxZoom:Math.min(this._current.zoomRange[1],n[1]),clipAngle:o,mapAligned:!0,isLineLabel:!0}),e.recordEnd()}_writeLineGlyphBox(e,t,s,i,r){if((s||this._current.offsetDirection)&&this._isVisible(i)&&t.bounds){const s=t.bounds,i=new Er.A(s.x+r[0],s.y+r[1],s.width,s.height);e.metricBoxWrite(i)}}_isVisible(e){const t=Math.max(this._current.zoomRange[0],e[0]),s=Math.min(this._current.zoomRange[1],e[1]),i=this._zoomLevel;return t<=i&&i<=s}}function fn(e,t){const s=new Te.A,{coords:i,lengths:r}=e,n=(0,Qe.vt)(),o=(0,Qe.vt)(),a=(0,Qe.vt)(),c=(0,Qe.vt)(),l=(0,Qe.vt)(),h=(0,Qe.vt)();let u=0;for(let e=0;e<r.length;e++){const d=r[e];for(let e=0;e<d;e++){const r=2*(e+u-1),p=2*(e+u),f=2*(e+u+1);e>0?(0,D.hZ)(n,i[r],i[r+1]):(0,D.hZ)(n,0,0),(0,D.hZ)(o,i[p],i[p+1]),e<d-1?(0,D.hZ)(a,i[f],i[f+1]):(0,D.hZ)(a,0,0),0===e?(0,D.hZ)(c,0,0):((0,D.jb)(c,o,n),(0,D.S8)(c,c),(0,D.hZ)(c,c[1],-c[0])),e===d-1?(0,D.hZ)(l,0,0):((0,D.jb)(l,a,o),(0,D.S8)(l,l),(0,D.hZ)(l,l[1],-l[0])),(0,D.WQ)(h,c,l),(0,D.S8)(h,h);const m=h[0]*l[0]+h[1]*l[1];0!==m&&(0,D.hs)(h,h,m),(0,D.hs)(h,h,t),s.coords.push(o[0]+h[0],o[1]+h[1])}s.lengths.push(d),u+=d}return s}const mn={createComputedParams:e=>e,optionalAttributes:Di.optionalAttributes,attributes:{...Di.attributes,bitset:{type:Zt.pe.UNSIGNED_BYTE,count:1,pack:({gradientMethod:e,gradientSizeUnits:t,gradientType:s})=>Rt([[0,"alongline"===e.toLowerCase()],[1,t===dr.h.Absolute],[2,"discrete"===s.toLowerCase()]])},tlbr:{type:Zt.pe.UNSIGNED_SHORT,count:4,pack:({sprite:e})=>{const{rect:t,width:s,height:i}=e,r=t.x+p.hM+p.MZ,n=t.y+p.hM;return[r,n,r+s-2*p.MZ,n+i]}},accumulatedDistance:{type:Zt.pe.HALF_FLOAT,count:1,packTessellation:({distance:e,pathLength:t,distanceOffset:s})=>(s+e)/t},gradientSize:{type:Zt.pe.HALF_FLOAT,count:1,pack:({gradientSize:e,gradientSizeUnits:t})=>t===dr.h.Relative?e/100:(0,h.Lz)(e)},totalLength:{type:Zt.pe.HALF_FLOAT,count:1,packTessellation:({pathLength:e})=>e},segmentDirection:{type:Zt.pe.BYTE,count:2,packPrecisionFactor:16,packTessellation:({directionX:e,directionY:t})=>[e,t]}}};class _n extends Bi{get _preventEffectClipping(){return!0}constructor(e,t,s,i){super(e,t,s,i),this.vertexSpec=mn,this._tessellationOptions.textured=!0}_write(e,{target:t,effectGeometry:s}){const i=s??kt.z.fromFeatureSetReaderCIM(t);if(!i)return;const{sprite:r}=this.evaluatedMeshParams;this._writeGeometry(e,t,i,r?.textureBinding)}}const yn={createComputedParams:e=>e,optionalAttributes:Di.optionalAttributes,attributes:{...Di.attributes,bitset:{type:Zt.pe.UNSIGNED_BYTE,count:1,pack:({shouldSampleAlphaOnly:e,shouldScaleDash:t,isSDF:s})=>Rt([[4,e],[2,t],[3,s]])},tlbr:{type:Zt.pe.UNSIGNED_SHORT,count:4,pack:({sprite:e})=>{const{rect:t,width:s,height:i}=e,r=t.x+p.hM,n=t.y+p.hM;return[r,n,r+s,n+i]}},accumulatedDistance:{type:Zt.pe.UNSIGNED_SHORT,count:1,packTessellation:({distance:e})=>e},segmentDirection:{type:Zt.pe.BYTE,count:2,packPrecisionFactor:16,packTessellation:({directionX:e,directionY:t})=>[e,t]},offsetAlongLine:{type:Zt.pe.HALF_FLOAT,count:1,pack:({offsetAlongLine:e})=>(0,h.Lz)(e)},capType:{type:Zt.pe.UNSIGNED_BYTE,count:1,pack:({capType:e})=>{switch(e){case"Butt":case"butt":default:return 0;case"Square":case"square":return 1;case"Round":case"round":return 2}}}}};class gn extends Bi{constructor(e,t,s,i){super(e,t,s,i),this.vertexSpec=yn,this._tessellationOptions.textured=!0}_write(e,{target:t,effectGeometry:s}){const i=s??kt.z.fromFeatureSetReaderCIM(t);if(!i)return;const{sprite:r}=this.evaluatedMeshParams;this._writeGeometry(e,t,i,r?.textureBinding)}}class xn{static from(e){return"width"in e?this.fromSimpleMeshParams(e):this.fromComplexMeshParams(e)}static fromSimpleMeshParams(e){const t=new xn(e.sprite,e.color,e.outlineColor,e.minPixelBuffer,e.placement,e.scaleInfo,e.effects),{type:s,width:i,height:r,angle:n,alignment:o,outlineSize:a,referenceSize:c,sprite:l,overrideOutlineColor:u}=e;return t.rawWidth=(0,h.Lz)(i),t.rawHeight=(0,h.Lz)(r),t.angle=n,t.alignment=o,t.outlineSize=(0,h.Lz)(a),t.referenceSize=(0,h.Lz)(c),t.overrideOutlineColor=u,t.offsetX=(0,h.Lz)(e.offsetX),t.offsetY=(0,h.Lz)(e.offsetY),"simple"!==s||l.sdf||(t.rawWidth=l.width,t.rawHeight=l.height),t._computeSize(e,!1),t}static fromComplexMeshParams(e){const t=new xn(e.sprite,e.color,e.outlineColor,e.minPixelBuffer,e.placement,e.scaleInfo,e.effects);let{alignment:s,transforms:i,size:r,scaleX:n,anchorX:o,anchorY:a,angle:c,colorLocked:l,frameHeight:u,widthRatio:d,offsetX:p,offsetY:f,outlineSize:m,referenceSize:_,scaleFactor:y,sizeRatio:g,isAbsoluteAnchorPoint:x,rotateClockwise:b,scaleSymbolsProportionally:w,sprite:v}=e;if(i&&i.infos.length>0){const e=(0,Ke.zb)(r,c,b,p,f,i);r=e.size,c=e.rotation,p=e.offsetX,f=e.offsetY,b=!1}y&&(r*=y,p*=y,f*=y);const I=n*(v.width/v.height);t.alignment=s,t.rawHeight=(0,h.Lz)(r),t.rawWidth=t.rawHeight*I,t.referenceSize=(0,h.Lz)(_),t.sizeRatio=g,t.sdfDecodeCoeff=(v.sdfDecodeCoeff??1)*g,t.angle=c,t.rotateClockwise=b,t.anchorX=o,t.anchorY=a,t.offsetX=(0,h.Lz)(p),t.offsetY=(0,h.Lz)(f),x&&r&&(v.sdf?t.anchorX=o/(r*d):t.anchorX=o/(r*I),t.anchorY=a/r);const S=w&&u?r/u:1;return t.outlineSize=0===m||isNaN(m)?0:(0,h.Lz)(m)*S,t.scaleSymbolsProportionally=w,t.colorLocked=l,t._computeSize(e,!0),t}constructor(e,t,s,i,r,n,o){this.sprite=e,this.color=t,this.outlineColor=s,this.minPixelBuffer=i,this.placement=r,this.scaleInfo=n,this.effects=o,this.rawWidth=0,this.rawHeight=0,this.angle=0,this.outlineSize=0,this.referenceSize=0,this.sizeRatio=1,this.sdfDecodeCoeff=1,this.alignment=0,this.scaleSymbolsProportionally=!1,this.overrideOutlineColor=!1,this.colorLocked=!1,this.anchorX=0,this.anchorY=0,this.computedWidth=0,this.computedHeight=0,this.texXmin=0,this.texYmin=0,this.texXmax=0,this.texYmax=0,this.offsetX=0,this.offsetY=0,this.rotateClockwise=!0}get boundsInfo(){return{size:Math.max(this.computedHeight,this.computedWidth),offsetX:this.offsetX,offsetY:this.offsetY}}_computeSize(e,t){const{sprite:s,hasSizeVV:i}=e,r=!!s.sdf,n=s.sdfPaddingRatio??.5,{rawWidth:o,rawHeight:a,sizeRatio:c,outlineSize:l}=this,h=s.rect;let u=o*c,d=a*c,f=0,m=0;if(r){const e=1/(1-n);if(u*=e,d*=e,i)this.computedWidth=u,this.computedHeight=d;else{const e=t&&o>a?u:o,i=a,r=l+2;this.computedWidth=Math.min(e+r,u),this.computedHeight=Math.min(i+r,d);const n=Math.max(s.width,s.height)/Math.max(u,d);f=(this.computedWidth-u)*n,m=(this.computedHeight-d)*n}}else this.computedWidth=u*(h.width/s.width),this.computedHeight=d*(h.height/s.height),f=2*p.hM,m=2*p.hM;const _=h.x+p.hM-f/2,y=h.y+p.hM-m/2,g=_+s.width+f,x=y+s.height+m;this.texXmin=bn(_),this.texYmin=bn(y),this.texXmax=wn(g),this.texYmax=wn(x),this.computedWidth*=(this.texXmax-this.texXmin)/(g-_),this.computedHeight*=(this.texYmax-this.texYmin)/(x-y),this.anchorX*=u/this.computedWidth,this.anchorY*=d/this.computedHeight}}function bn(e,t=1e-7){const s=Math.ceil(e);return s-e<t?s:Math.floor(e)}function wn(e,t=1e-7){const s=Math.floor(e);return e-s<t?s:Math.ceil(e)}const vn=128/Math.PI;const In={createComputedParams:e=>xn.from(e),optionalAttributes:{zoomRange:{type:Zt.pe.HALF_FLOAT,count:2,pack:({scaleInfo:e},{tileInfo:t})=>Ft(e,t)}},attributes:{pos:{type:Zt.pe.SHORT,count:2,pack:"position",packPrecisionFactor:10},id:{type:Zt.pe.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:Zt.pe.UNSIGNED_BYTE,count:1,pack:({sprite:e,alignment:t,scaleSymbolsProportionally:s,overrideOutlineColor:i,colorLocked:r})=>{let n=0;return e.sdf&&(n|=Et(qt)),1===t&&(n|=Et(Bt)),s&&(n|=Et(Gt)),i&&(n|=Et(jt)),r&&(n|=Et(Ut)),n}},offset:{type:Zt.pe.HALF_FLOAT,count:2,packAlternating:{count:4,pack:({angle:e,computedWidth:t,computedHeight:s,anchorX:i,anchorY:r,offsetX:n,offsetY:o,rotateClockwise:a})=>{const c=function(e,t,s,i,r=!1){const n=(0,Ar.vt)(),o=r?1:-1;return(0,Tr.D_)(n),(t||s)&&(0,Tr.Tl)(n,n,[t,-s]),i&&(0,Tr.e$)(n,n,.017453292519944444*o*-i),n}(0,n,o,-e,a),l=-(.5+i)*t,h=-(.5-r)*s,u=[l,h],d=[l+t,h],p=[l,h+s],f=[l+t,h+s];return(0,D.l0)(u,u,c),(0,D.l0)(d,d,c),(0,D.l0)(p,p,c),(0,D.l0)(f,f,c),[u,d,p,f]}}},textureUV:{type:Zt.pe.SHORT,count:2,packPrecisionFactor:4,packAlternating:{count:4,pack:({texXmax:e,texXmin:t,texYmax:s,texYmin:i})=>[[t,i],[e,i],[t,s],[e,s]]}},color:{type:Zt.pe.UNSIGNED_BYTE,count:4,normalized:!0,pack:({color:e})=>zt(e)},outlineColor:{type:Zt.pe.UNSIGNED_BYTE,count:4,normalized:!0,pack:({outlineColor:e})=>zt(e)},sizing:{type:Zt.pe.UNSIGNED_BYTE,count:4,pack:({rawWidth:e,rawHeight:t,outlineSize:s,referenceSize:i})=>[Dt(Math.max(e,t),128),Dt(s,128),Dt(i,128),0]},placementAngle:{type:Zt.pe.UNSIGNED_BYTE,count:1,packTessellation:({placementAngle:e})=>function(e){return function(e){return e%=256,Math.abs(e>=0?e:e+256)}(e*vn)}(e)},sdfDecodeCoeff:{type:Zt.pe.UNSIGNED_SHORT,count:1,packPrecisionFactor:64,pack:({sdfDecodeCoeff:e})=>e}}};class Sn extends Jt{constructor(){super(...arguments),this.vertexSpec=In}getBoundsInfo(){return this.evaluatedMeshParams.boundsInfo}_write(e,{target:t,effectGeometry:s}){const i=this.evaluatedMeshParams.sprite?.textureBinding,r=t.getDisplayId();e.recordStart(this.instanceId,this.attributeLayout,i);const n=this.evaluatedMeshParams.minPixelBuffer,o=Math.max(this.evaluatedMeshParams.computedWidth,n),a=Math.max(this.evaluatedMeshParams.computedHeight,n),c=-this.evaluatedMeshParams.anchorX*this.evaluatedMeshParams.computedWidth,l=this.evaluatedMeshParams.anchorY*this.evaluatedMeshParams.computedHeight,h=this.evaluatedMeshParams.offsetX+c,u=-this.evaluatedMeshParams.offsetY+l;if(null!=this.evaluatedMeshParams.placement){let i=null;if(null!=s){const e=Math.max(this.evaluatedMeshParams.computedWidth,this.evaluatedMeshParams.computedHeight);if(i=(0,Wt.qc)(s,2*e,!1),null===i)return}this._writePlacedMarkers(e,t,i,o,a)}else if(s?.nextPath()){s.nextPoint();const t=s.x,i=s.y;e.recordBounds(t+h,i+u,o,a),this._writeQuad(e,r,t,i)}else if("esriGeometryPolygon"===t.geometryType){const s=t.readCentroidForDisplay();if(!s)return;const[i,n]=s.coords;e.recordBounds(i+h,n+u,o,a),this._writeQuad(e,r,i,n)}else if("esriGeometryPoint"===t.geometryType){const s=t.readXForDisplay(),i=t.readYForDisplay();e.recordBounds(s+h,i+u,o,a),this._writeQuad(e,r,s,i)}else{const s=t.readGeometryForDisplay();s?.forEachVertex((t,s)=>{e.recordBounds(t+h,s+u,o,a),Math.abs(t)>Mt.$u||Math.abs(s)>Mt.$u||this._writeQuad(e,r,t,s)})}e.recordEnd()}_writePlacedMarkers(e,t,s,i,r){const n=s??kt.z.fromFeatureSetReaderCIM(t);if(!n)return;const o=At.getPlacement(n,-1,this.evaluatedMeshParams.placement,(0,h.Lz)(1),e.id);if(!o)return;const a=t.getDisplayId();let c=o.next();const l=this.evaluatedMeshParams.offsetX,u=-this.evaluatedMeshParams.offsetY;for(;null!=c;){const t=c.tx,s=-c.ty;if(Math.abs(t)>Mt.$u||Math.abs(s)>Mt.$u){c=o.next();continue}const n=-c.getAngle();e.recordBounds(t+l,s+u,i,r),this._writeQuad(e,a,t,s,n),c=o.next()}}_writeQuad(e,t,s,i,r){const n=e.vertexCount(),o=null==r?null:{placementAngle:r};this._writeVertex(e,t,s,i,o),e.indexWrite(n+0),e.indexWrite(n+1),e.indexWrite(n+2),e.indexWrite(n+1),e.indexWrite(n+3),e.indexWrite(n+2)}}var kn=s(4576),Mn=s(4718);class Tn{destroy(){}}class An extends Tn{constructor(e){super(),this._value=e}resize(e){}read(e,t){return this._value}readWithDefault(e,t,s){return this._value}hasArcadeDependency(e){return!1}}const Pn=()=>Ct.A.getLogger("esri.views.2d.engine.webgl.shaderGraph.techniques.mesh.MeshWriterInputEvaluator");async function Cn(e,t,s,i){const{defaultValue:r,valueExpressionInfo:n,value:o}=t;if(n){if("dictionary-template"===n.type)return{...t,computed:e.createDictionaryTemplateField(n,s),defaultValue:r};const{expression:o}=n,a=await e.createComputedField({expression:o},i);return a?{...t,computed:a,defaultValue:r}:null}return{...t,computed:new An(o),defaultValue:r}}async function Fn(e,t,s){const{valueExpressionInfo:i}=t,r="dictionary-template"===i.type?e.createDictionaryTemplateField(i,s):await e.createComputedField({expression:i.expression});return r?{...t,computed:r}:null}function En(e){return"object"==typeof e&&null!=e&&(!(!("valueExpressionInfo"in e)||!e.valueExpressionInfo)||"type"in e&&"Process"===e.type&&"op"in e&&"Random"===e.op)}function Rn(e){if(Array.isArray(e))for(const t of e)if(Rn(t))return!0;if("object"==typeof e){if(En(e))return!0;for(const t in e)if(Rn(e[t]))return!0}return!1}class zn{static async create(e,t,s,i){const r={},n=new Map,o=new Map,a=new Map,c=new Map,l=new Map,h=new Map;for(const u in s){const d=s[u];if(null!=d&&"object"==typeof d)if(Array.isArray(d)){if("object"==typeof d[0])throw new Error(`InternalError: Cannot handle ${u}. Nested array params are not supported`);r[u]=d}else{if("valueExpressionInfo"in d){if(d.value){r[u]=d.value;continue}const t=await Fn(e,d,i);if(!t){r[u]=d.defaultValue;continue}n.set(u,t),r[u]=null;continue}switch(d.type){case"cim-effect-infos":if(d.effectInfos.some(e=>e.overrides.length)){o.set(u,{effects:await Promise.all(d.effectInfos.map(async t=>{const s=t.overrides.map(t=>Cn(e,t,i,!1));return{effect:t.effect,compiledOverrides:(await Promise.all(s)).filter(kn.Ru)}}))});break}r[u]=d.effectInfos.map(e=>e.effect);break;case"cim-marker-placement-param":d.overrides.length&&a.set(u,{placementInfo:d,compiledOverrides:(await Promise.all(d.overrides.map(t=>Cn(e,t,i,!1)))).filter(kn.Ru)}),r[u]=d.placement;break;case"text-rasterization-param":{if(d.overrides.length){const t=d.overrides.map(t=>Cn(e,t,i,d.useLegacyLabelEvaluationRules??!1));c.set(u,{compiledOverrides:(await Promise.all(t)).filter(kn.Ru),rasterizationParam:d,objectIdToResourceId:new Map});continue}const s={type:"cim-rasterization-info",resource:d.resource};r[u]=await t.fetchResourceImmediate(s)??null;break}case"sprite-rasterization-param":{if(d.overrides.length){const t=d.overrides.map(t=>Cn(e,t,i,!1));c.set(u,{compiledOverrides:(await Promise.all(t)).filter(kn.Ru),rasterizationParam:d,objectIdToResourceId:new Map});continue}if("animated"===d.resource.type){c.set(u,{compiledOverrides:[],rasterizationParam:d,objectIdToResourceId:new Map});continue}const s={type:"cim-rasterization-info",resource:d.resource};r[u]=await t.fetchResourceImmediate(s)??null;break}case"cim-marker-transform-param":{const{params:t}=d;if(Rn(t)){const s={compiledMarkerInfos:[]};await Promise.all(t.map(async t=>{const r={props:{}};for(const s in t)if(En(t[s])){const n=await Fn(e,t[s],i);r.compiledExpressionMap||(r.compiledExpressionMap=new Map);const o=r.compiledExpressionMap;n&&o.set(s,n)}else r.props[s]=t[s];s.compiledMarkerInfos.push(r)})),l.set(u,s)}else r[u]={type:"cim-marker-transform-info",infos:t};break}case"animation-params":{const{params:s}=d,i=Is(s);if(Rn(i)){const t=await Promise.all(i.map(t=>ks(t,e)));h.set(u,{params:t,propertyIdToResourceId:new Map,key:u})}else{const e=vs(i),s=await t.fetchResourceImmediate({type:"animation-info",resource:e});null!=s&&"sprite"===s.type&&(r[u]={dataRow:s.rect.y,dataColumn:s.rect.x})}break}default:r[u]=d}}else r[u]=d}return new zn(s,r,n,o,a,c,l,h)}constructor(e,t,s,i,r,n,o,a){this.inputMeshParams=e,this._resolvedMeshParams=t,this._dynamicProperties=s,this._dynamicEffectProperties=i,this._dynamicPlacementProperties=r,this._dynamicAsyncProperties=n,this._dynamicTransformProperties=o,this._dynamicAsyncAnimations=a,this.evaluator=e=>e,this._arcadeDependencies=new Set;for(const e of this._expressions())(0,ne.QY)(this._arcadeDependencies,e)}get hasDynamicProperties(){return!!(this._dynamicProperties.size||this._dynamicAsyncProperties.size||this._dynamicEffectProperties.size||this._dynamicTransformProperties.size||this._dynamicPlacementProperties.size||this._dynamicAsyncAnimations.size)}get evaluatedMeshParams(){return this._evaluatedMeshParams||(this._evaluatedMeshParams=this.evaluator(this._resolvedMeshParams)),this._evaluatedMeshParams}enqueueRequest(e,t,s){for(const r of this._dynamicAsyncProperties.values()){const n=(0,Mn.o8)(r.rasterizationParam.resource);"animated"===r.rasterizationParam.resource.type&&r.rasterizationParam.resource.randomizeStartTime&&(n.primitiveName="__RESERVED__PRIMITIVE__NAME__",n.startGroup=is(t.getObjectId()||0));for(const{primitiveName:e,propertyName:o,computed:a,defaultValue:c,valueExpressionInfo:l}of r.compiledOverrides)try{const i="animated"===r.rasterizationParam.resource.type?n.primitiveName:e;(0,Oi.Ph)(n,i,o,a,t,s,c)}catch(e){Pn().errorOnce(new i.A("invalid-arcade-expression","Encountered an error when evaluating the arcade expression",{error:e,valueExpressionInfo:l}))}const o=e.enqueueRequest({type:"cim-rasterization-info",resource:n});r.objectIdToResourceId.set(t.getObjectId(),o)}for(const i of this._dynamicAsyncAnimations.values()){const r=i.params.map(e=>Ms(e,t,s)).map(ms).map(e=>e.simplify()),n=Ss(r),o=e.enqueueRequest({type:"animation-info",resource:n});i.propertyIdToResourceId.set(t.getObjectId()+"."+i.key,o)}}evaluateMeshParams(e,t,s){for(const[e,i]of this._dynamicProperties.entries())this._resolvedMeshParams[e]=i.computed.readWithDefault(t,s,i.defaultValue);for(const[e,i]of this._dynamicPlacementProperties.entries())for(const{computed:r,defaultValue:n,propertyName:o}of i.compiledOverrides){const a=r.readWithDefault(t,s,n);i.placementInfo.placement[o]=a,this._resolvedMeshParams[e]=i.placementInfo.placement}for(const[e,i]of this._dynamicEffectProperties.entries())for(const r of i.effects){for(const{computed:e,defaultValue:i,propertyName:n}of r.compiledOverrides){const o=e.readWithDefault(t,s,i);r.effect[n]=o}this._resolvedMeshParams[e]=i.effects.map(e=>e.effect)}for(const[e,i]of this._dynamicTransformProperties.entries()){const r={type:"cim-marker-transform-info",infos:[]};for(const e of i.compiledMarkerInfos){const i={...e.props};if(e.compiledExpressionMap)for(const[r,n]of e.compiledExpressionMap){const e=n.computed.readWithDefault(t,s,n.defaultValue);i[r]="number"==typeof e||"boolean"==typeof e?e:n.defaultValue}r.infos.push(i)}this._resolvedMeshParams[e]=r}for(const[s,i]of this._dynamicAsyncProperties.entries()){const r=i.objectIdToResourceId.get(t.getObjectId());if(null==r)continue;const n=e.getResource(r);this._resolvedMeshParams[s]=n}for(const[s,i]of this._dynamicAsyncAnimations.entries()){const r=i.propertyIdToResourceId.get(t.getObjectId()+"."+s);if(null==r)continue;const n=e.getResource(r);this._resolvedMeshParams[s]={dataRow:n.rect.y,dataColumn:n.rect.x}}return this._evaluatedMeshParams=this.evaluator(this._resolvedMeshParams),this.evaluatedMeshParams}hasArcadeDependency(e){return this._arcadeDependencies.has(e)}*_expressions(){for(const e of this._dynamicProperties.values())yield e.computed;for(const e of this._dynamicEffectProperties.values())for(const t of e.effects)for(const e of t.compiledOverrides)yield e.computed;for(const e of this._dynamicPlacementProperties.values())for(const t of e.compiledOverrides)yield t.computed;for(const e of this._dynamicAsyncProperties.values())for(const t of e.compiledOverrides)yield t.computed;for(const e of this._dynamicTransformProperties.values())for(const t of e.compiledMarkerInfos)if(null!=t.compiledExpressionMap)for(const e of t.compiledExpressionMap.values())yield e.computed;for(const e of this._dynamicAsyncAnimations.values())for(const t of e.params)yield*Ts(t)}}const On={createComputedParams:e=>e,optionalAttributes:{},attributes:{pos:{type:Zt.pe.SHORT,count:2,packPrecisionFactor:10,pack:"position"},id:{type:Zt.pe.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:Zt.pe.UNSIGNED_BYTE,count:1,pack:e=>0},offset:{type:Zt.pe.SHORT,count:2,packPrecisionFactor:16,packAlternating:{count:4,pack:({size:e})=>{const t=(0,h.Lz)(e),s=-t/2,i=-t/2;return[[s,i],[s+t,i],[s,i+t],[s+t,i+t]]}}},texCoords:{type:Zt.pe.SHORT,count:2,packPrecisionFactor:4,packAlternating:{count:4,pack:()=>[[0,1],[1,1],[0,0],[1,0]]}},referenceSize:{type:Zt.pe.UNSIGNED_BYTE,count:1,pack:({size:e})=>(0,h.Lz)(e)},zoomRange:{type:Zt.pe.UNSIGNED_BYTE,count:2,pack:({scaleInfo:e},{tileInfo:t})=>Ft(e,t)}}};class Ln extends Jt{constructor(){super(...arguments),this.vertexSpec=On}_write(e,{target:t}){const s=t.getDisplayId(),i=this.evaluatedMeshParams.minPixelBuffer,r=Math.max((0,h.Lz)(this.evaluatedMeshParams.size),i);let n,o;if("esriGeometryPoint"===t.geometryType)n=t.readXForDisplay(),o=t.readYForDisplay();else{const e=t.readCentroidForDisplay();if(!e)return;n=e?.coords[0],o=e?.coords[1]}e.recordStart(this.instanceId,this.attributeLayout),e.recordBounds(n,o,r,r);const a=e.vertexCount();this._writeVertex(e,s,n,o),e.indexWrite(a+0),e.indexWrite(a+1),e.indexWrite(a+2),e.indexWrite(a+1),e.indexWrite(a+3),e.indexWrite(a+2),e.recordEnd()}}class Dn{async createMeshWriter(e,t,s,i,r){const n=this._getMeshWriter(i.techniqueType),o=await zn.create(e,t,i.inputParams,r),a=new n(i.id,o,i.optionalAttributes,s);return await a.loadDependencies(),a}_getMeshWriter(e){switch(e){case 15:return Qi;case 12:return $i;case 10:return tr;case 28:return Xi;case 16:return br;case 26:return nr;case 29:return Sr;case 11:return ur;case 23:return Sn;case 30:return Ln;case 32:return an;case 21:return Bi;case 33:return gn;case 17:return _n;case 19:return Mr;case 20:return pn;case 2:return Xs;case 3:return Ks;case 0:return ji;case 1:return Vi;default:throw new Error("Internal Error: Mesh writer not in the registry")}}}class Nn{constructor(e,t,s,i,r){this.storage=e,this.proxy=t,this.viewParams=s,this.registry=i,this.fieldsMap=r}async createMeshWriters(e){const t=e.map(e=>this.registry.createMeshWriter(this.storage,this.proxy,this.viewParams,e,this.fieldsMap));return Promise.all(t)}}var qn=s(16930),Bn=s(43334);class Gn{static async create(e,t){if("count"===t.statisticType){const e=new An(1);return new Gn(t.name,t.alias,t.type,t.statisticType,e)}const s=await e.createComputedField({expression:t.onStatisticExpression?.expression,field:t.onStatisticField});return new Gn(t.name,t.alias,t.type,t.statisticType,s)}constructor(e,t,s,i,r){this.name=e,this.alias=t,this.type=s,this.statisticType=i,this.computed=r}}var jn=s(65529),Un=s(70328),Vn=s(37730),Wn=s(75752);class Yn{constructor(e){this.subscription=e,this.handledChunks=new Set,(0,n.A)("esri-2d-update-debug")&&console.debug(`Tile[${e.tile.id}] ASendState.create`)}destroy(){}}class $n{constructor(){this.type="append",this.messages=[]}}class Hn{constructor(){this.type="update",this.messages=[]}}class Qn{constructor(e){this.level=e,this.type="level-replace",this.messages=[]}}class Zn{constructor(e,t,s){this._source=e,this._attributeStore=t,this._sqlOptions=s,this._sendStates=new Map}destroy(){}get enablePixelBuffering(){return!0}get isAggregate(){return!1}get usedMemory(){return 0}onSubscribe(e){const t=this.createState(e);this._sendStates.set(e.key.id,t)}onUnsubscribe(e){this._sendStates.get(e.key.id)?.destroy(),this._sendStates.delete(e.key.id)}get hasSubscribers(){return this._sendStates.size>0}requiresInvalidation(e){return!1}invalidate(){const e=Array.from(this._sendStates.values());this._sendStates.clear();for(const t of e)t.destroy(),this.onSubscribe(t.subscription)}invalidateAttributeData(e){}hasArcadeDependency(e){return!1}getFeatureObjectIdsForAggregate(e){throw new Error("InternalError: AggregateId lookup not supported")}getDisplayIds(e){return this.displayMap(e,e=>e,e=>e)}getDisplayAndObjectIds(e){return this.displayMap(e,e=>e,(e,t,s)=>[e,s])}afterUpdateChunks(){}}class Xn extends Zn{constructor(e,t,s,i,r){super(e,t,r),this.spatialReference=s,this.aggregateFields=i,this._arcadeDependencies=new Set,this.events=new jn.bk,this.featureAdapter=Vn.T;for(const e of i)(0,ne.QY)(this._arcadeDependencies,e.computed)}get aggregateQueryEngine(){return this._aggregateQueryEngine||(this._aggregateQueryEngine=new Wn.do({featureStore:this,fieldsIndex:this._metadata.fieldsIndex,geometryType:this._metadata.geometryType,featureIdInfo:this._metadata.featureIdInfo,spatialReference:this.spatialReference})),this._aggregateQueryEngine}get isAggregate(){return!0}removeChunks(e){}hasArcadeDependency(e){return this._arcadeDependencies.has(e)}forEach(e){return this.forEachAggregateWorldSpace(e)}forEachInBounds(e,t){}forEachBounds(e,t){const s=(0,Un.vt)();for(const i of e){const e=(0,st.jQ)(s,i.geometry);e&&t(e)}}}class Kn{constructor(e,t,s,i){this.subscription=e,this.reader=t,this.end=s,this.debugInfo=i,this.type="append"}get id(){return this.subscription.tile.id}createMessage(e,t,s){return{type:"append",id:this.id,append:e,end:this.end,debugInfo:this.debugInfo,subscriptionVesrion:this.subscription.version,version:t,attributeEpoch:s}}}class Jn{constructor(e,t,s,i,r){this.subscription=e,this.reader=t,this.remove=s,this.end=i,this.debugInfo=r,this.type="update"}get id(){return this.subscription.tile.id}createMessage(e,t,s){return{type:"update",id:this.id,modify:e,debugInfo:this.debugInfo,remove:this.remove,version:t,subscriptionVesrion:this.subscription.version,end:this.end,attributeEpoch:s}}}const eo=8388607,to=e=>e&eo;class so extends Tn{constructor(e){super(),this._field=e}resize(e){throw new Error("Method not implemented.")}read(e,t){return e.readAttribute(this._field)}readWithDefault(e,t){return e.readAttribute(this._field)}hasArcadeDependency(e){return!1}}class io extends Tn{static async create(e,t){const s=await(0,ne.Ad)(e,t.spatialReference),i=(0,vt.Wm)(e);return new io(s,i)}constructor(e,t){super(),this._compiled=e,this._cacheKey=t}resize(e){}read(e,t){return this.hasArcadeDependency("scale")||"system"!==t.$view.timeZone?(0,oe.V4)(this._compiled,e,t):this._readCached(e,t)}readWithDefault(e,t,s){return this.hasArcadeDependency("scale")||"system"!==t.$view.timeZone?(0,oe.OP)(this._compiled,e,t,s):this._readWithDefaultCached(e,t,s)}hasArcadeDependency(e){return this._compiled?.references(e)??!1}_getCacheKey(e){if(!this._compiled?.references("timeProperties"))return this._cacheKey;const{currentStart:t,currentEnd:s}=e.$view.timeProperties;return this._cacheKey+function(e,t){const s=43758.5453*Math.sin(12.9898*e+78.233*t);return s-Math.floor(s)}(t??1,s??1)}_readCached(e,t){if(e.setCache(this._getCacheKey(t)),e.hasCachedValue())return e.getCachedValue();const s=(0,oe.V4)(this._compiled,e,t);return e.setCachedValue(s),s}_readWithDefaultCached(e,t,s){if(e.setCache(this._getCacheKey(t)),e.hasCachedValue())return e.getCachedValue();const i=(0,oe.OP)(this._compiled,e,t,s);return e.setCachedValue(i),i}}var ro=s(39516),no=s(97770),oo=s(18047),ao=s(68463),co=s(30524),lo=s(32730);class ho extends Tn{static async create(e,t){const s=(0,lo.lc)(e);return new ho(e=>s.replaceAll(/{[^}]*}/g,t=>{const s=t.slice(1,-1),i=e.metadata.fieldsIndex.get(s);if(null==i)return t;const r=e.readAttribute(s);return null==r?"":function(e,t){if(null==e)return"";const s=t.domain;if(s)if("codedValue"===s.type||"coded-value"===s.type){const t=e;for(const e of s.codedValues)if(e.code===t)return e.name}else if("range"===s.type){const{max:i,min:r}=(0,ao.A5)(t),n=+e;if(null!=r&&null!=i&&r<=n&&n<=i)return s.name}let i=e;return(0,co.vE)(t)?i=(0,no.Yq)(i,(0,no.J2)("short-date")):(0,co.WA)(t)&&(i=(0,oo.ZV)(+i)),i||""}(r,i)}))}constructor(e){super(),this._evaluator=e}resize(e){}read(e,t){return this._evaluator(e)}readWithDefault(e,t,s){const i=this._evaluator(e);return(0,oe.rZ)(i)?s:i}hasArcadeDependency(e){return!1}}class uo extends Tn{constructor(e,t){super(),this._template=e,this._parts=(0,Ke.gQ)(e.template,t)}resize(e){}read(e,t){return(0,Ke._h)(e,this._parts,this._template.textCase)}readWithDefault(e,t,s){return(0,Ke._h)(e,this._parts,this._template.textCase)}hasArcadeDependency(e){return!1}}class po extends Tn{constructor(e,t){super(),this._field=e,this._normalizationInfo=t}resize(e){throw new Error("Method not implemented.")}read(e,t){return this._readNormalized(e)}readWithDefault(e,t){return this._readNormalized(e)}hasArcadeDependency(e){return!1}_readNormalized(e){const t=e.readAttribute(this._field);if(null==t)return null;const{normalizationField:s,normalizationTotal:i,normalizationType:r}=this._normalizationInfo,n=e.readAttribute(s);switch(r??"esriNormalizeByField"){case"esriNormalizeByField":return n?n?t/n:void 0:null;case"esriNormalizeByLog":return Math.log(t)*Math.LOG10E;case"esriNormalizeByPercentOfTotal":return i?t/i*100:null}}}var fo=s(73250);const mo=()=>Ct.A.getLogger("esri.views.2d.layers.FeatureLayerView2D"),_o={getAttribute:(e,t)=>e.readAttribute(t)};async function yo(e,t){try{const s=await(0,ro.GP)(e,t);return s.isStandardized||mo().error(new i.A("sql-parse-error","expression is not standardized",{where:e})),(t,r)=>{const n=t.readArcadeFeature();try{return s.testFeatureCompiled(n,_o,r.currentUser)}catch(t){return mo().warn(new i.A("sql-runtime-error","Encountered an error when evaluating where clause",{where:e,error:t})),!0}}}catch(t){return mo().warn(new i.A("sql-runtime-error","Encountered an error when evaluating where clause",{where:e,error:t})),e=>!0}}const go=()=>Ct.A.getLogger("esri.views.2d.layers.features.support.ComputedAttributeStorage"),xo=4294967295;function bo(e,t,s){if(!(e.length>t))for(;e.length<=t;)e.push(s)}class wo{constructor(e){this._numerics=[],this._strings=[],this._allocatedSize=256,this._bitsets=[],this._instanceIds=[],this._bounds=[],this._dirtyBitset=this.getBitset(this.createBitset()),this.compilationOptions=e}createBitset(){const e=this._bitsets.length;return this._bitsets.push(fo.y.create(this._allocatedSize,eo)),e+1}createDictionaryTemplateField(e,t){return new uo(e,t)}async createComputedField(e,t=!1){if(e.expression)try{if(!this.compilationOptions)throw new Error("InternalError: Compilation options not defined");return t?await ho.create(e.expression,this.compilationOptions):await io.create(e.expression,this.compilationOptions)}catch(t){const s=new i.A("featurelayer","Failed to compile arcade expression",{error:t,expression:e.expression});return go().error(s),null}if(e.normalizationType||e.normalizationField)return new po(e.field,e);if(e.field)return new so(e.field);const s=new i.A("featurelayer","Unable to create computed field. No expression or field found",{info:e});return go().error(s),null}async createWhereClause(e){return e?yo(e,this.compilationOptions.fields):null}getBitset(e){return this._bitsets[e-1]}getComputedNumeric(e,t){return this.getComputedNumericAtIndex(e&eo,0)}setComputedNumeric(e,t,s){return this.setComputedNumericAtIndex(e&eo,s,0)}getComputedString(e,t){return this.getComputedStringAtIndex(e&eo,0)}setComputedString(e,t,s){return this.setComputedStringAtIndex(e&eo,0,s)}getComputedNumericAtIndex(e,t){const s=e&eo;return this._ensureNumeric(t,s),this._numerics[t][s]}setComputedNumericAtIndex(e,t,s){const i=e&eo;this._ensureNumeric(t,i),this._numerics[t][i]=s}getPackedChunkId(e){const t=e&eo;return this._ensureInstanceId(t),this._instanceIds[t]}setPackedChunkId(e,t){const s=e&eo;this._ensureInstanceId(s),this._instanceIds[s]=t}getComputedStringAtIndex(e,t){const s=e&eo;return this._ensureString(t,s),this._strings[t][s]}setComputedStringAtIndex(e,t,s){const i=e&eo;this._ensureString(t,i),this._strings[t][i]=s}getXMin(e){return this._bounds[4*(e&eo)]}getYMin(e){return this._bounds[4*(e&eo)+1]}getXMax(e){return this._bounds[4*(e&eo)+2]}getYMax(e){return this._bounds[4*(e&eo)+3]}setBounds(e,t,s=!1){const i=e&eo;if(!s&&!this._dirtyBitset.has(e))return this._bounds[4*i]!==xo;this._dirtyBitset.unset(e);const r=t.readGeometryWorldSpace();if(bo(this._bounds,4*i+4,0),!r||!r.coords.length)return this._bounds[4*i]=xo,this._bounds[4*i+1]=xo,this._bounds[4*i+2]=xo,this._bounds[4*i+3]=xo,!1;let n=1/0,o=1/0,a=-1/0,c=-1/0;return r.forEachVertex((e,t)=>{n=Math.min(n,e),o=Math.min(o,t),a=Math.max(a,e),c=Math.max(c,t)}),this._bounds[4*i]=n,this._bounds[4*i+1]=o,this._bounds[4*i+2]=a,this._bounds[4*i+3]=c,!0}getBounds(e,t){const s=this.getXMin(t),i=this.getYMin(t),r=this.getXMax(t),n=this.getYMax(t);return(0,Un.BI)(e,s,i,r,n),s!==xo}_ensureNumeric(e,t){this._numerics[e]||(this._numerics[e]=[]),bo(this._numerics[e],t,0)}_ensureInstanceId(e){bo(this._instanceIds,e,0)}_ensureString(e,t){this._strings[e]||(this._strings[e]=[]),bo(this._strings[e],t,null)}}var vo=s(537),Io=s(58727),So=s(62660),ko=s(86420),Mo=s(97552),To=s(30661);class Ao{constructor(e){this._geometryBounds=(0,Y.vt)(),this._idToVisibility=new Map,this._serviceInfo=e}static async create(e){const t=new Ao(e);return await t.update(e.filterJSON,e.spatialReference),t}get hash(){return this._hash}check(e,t){return this._applyFilter(e,t)}invalidate(){this._idToVisibility.forEach((e,t)=>{this._idToVisibility.set(t,0)})}setKnownIds(e){for(const t of e)this._idToVisibility.set(t,1)}setTrue(e){const t=[],s=[],i=new Set(e);return this._idToVisibility.forEach((e,r)=>{const n=!!(1&this._idToVisibility.get(r)),o=i.has(r);!n&&o?t.push(r):n&&!o&&s.push(r),this._idToVisibility.set(r,o?3:0)}),{show:t,hide:s}}createQuery(){const{geometry:e,spatialRel:t,where:s,timeExtent:i,objectIds:r}=this;return Mo.A.fromJSON({geometry:e,spatialRel:t,where:s,timeExtent:i,objectIds:r})}async update(e,t){this._hash=JSON.stringify(e);const s=await(0,Io.T2)(e,null,t);await Promise.all([this._setGeometryFilter(s),this._setIdFilter(s),this._setAttributeFilter(s),this._setTimeFilter(s)])}async _setAttributeFilter(e){if(!e?.where)return this._clause=null,void(this.where=null);this._clause=await yo(e.where,this._serviceInfo.fieldsIndex),this.where=e.where}_setIdFilter(e){this._idsToShow=e?.objectIds&&new Set(e.objectIds),this._idsToHide=e?.hiddenIds&&new Set(e.hiddenIds),this.objectIds=e?.objectIds}async _setGeometryFilter(e){if(!e?.geometry)return this._spatialQueryOperator=null,this.geometry=null,void(this.spatialRel=null);const t=e.geometry,s=e.spatialRel??"esriSpatialRelIntersects",i=await(0,So.xt)(s,t,this._serviceInfo.geometryType);(0,vo.Rg)(this._geometryBounds,t),this._spatialQueryOperator=i,this.geometry=t,this.spatialRel=s}_setTimeFilter(e){if(this.timeExtent=this._timeOperator=null,e?.timeExtent){if(!this._serviceInfo.timeInfo){const t=new i.A("feature-layer-view:time-filter-not-available","Unable to apply time filter, as layer doesn't have time metadata.",e.timeExtent);return void Ct.A.getLogger("esri.views.2d.layers.features.controllers.FeatureFilter").error(t)}this.timeExtent=e.timeExtent,this._timeOperator=(0,ko.I)(this._serviceInfo.timeInfo,e.timeExtent,To.Z.Shared)}}_applyFilter(e,t){return this._filterByGeometry(e)&&this._filterById(e)&&this._filterByTime(e)&&this._filterByExpression(e,t)}_filterByExpression(e,t){return!this.where||this._clause(e,t)}_filterById(e){return(!this._idsToHide?.size||!this._idsToHide.has(e.getObjectId()))&&(!this._idsToShow?.size||this._idsToShow.has(e.getObjectId()))}_filterByGeometry(e){if(!this.geometry)return!0;const t=e.readGeometryWorldSpace();return!!t&&this._spatialQueryOperator(t)}_filterByTime(e){return null==this._timeOperator||this._timeOperator(e)}}var Po=s(35258);class Co{constructor(e,t=JSON.stringify(e)){this.inner=e,this.hash=t}}class Fo extends Yn{constructor(e,t){super(e),this.bins=new Map,this.featureCache=new Map,this.done=!1,this._store=t}take(){const e=this.bins,t=this.featureCache;return this.bins=new Map,this.featureCache=new Map,{bins:e,featureCache:t}}destroy(){const e=this.subscription.tile.key.level;for(const t of this.featureCache.keys())this._store.releaseDisplayIdForObjectId(`${t}.${e}`);this.bins.clear(),this.featureCache.clear(),this.handledChunks.clear()}get tile(){return this.subscription.tile}*featuresWorldSpace(){for(const e of this.featureCache.values()){const t=e.clone();t.geometry&&(0,st.aQ)(t.geometry,this.subscription.tile.transform),yield t}}}class Eo extends Xn{static async create(e,t,s,i,r){const n=t.metadata.outSpatialReference,o=new wo({spatialReference:n}),a=await Promise.all(e.fields.map(async e=>Gn.create(o,e))),c=e.featureFilter?await Ao.create({geometryType:t.metadata.geometryType,hasM:!1,hasZ:!1,timeInfo:t.metadata.timeInfo,fieldsIndex:t.metadata.fieldsIndex,spatialReference:n,filterJSON:e.featureFilter}):null;return"geohash"===e.index.type&&await(0,Ae.Nk)(n,qn.A.WGS84),new Eo(e,c,i,a,n,t,s,r)}constructor(e,t,s,i,r,n,o,a){super(n,o,r,i,a),this._schema=e,this._featureFilter=t,this._arcadeContextInfo=s,this._handled=new Set,this._invalidated=!1,this._metadata=Po.i.createFeature({geometryType:"esriGeometryPolygon",hasZ:!1,hasM:!1,featureIdInfo:{type:"object-id",fieldName:"aggregateId"},fieldsIndex:new Xe.A(e.fields).toJSON(),globalIdField:null,spatialReference:n.metadata.spatialReference,outSpatialReference:n.metadata.outSpatialReference,subtypeField:null,subtypes:null,timeInfo:null,timeReferenceUnknownClient:null,dateFieldsTimeZone:null,typeIdField:null,types:null}),this._getIndex=this._createGetIndex()}requiresInvalidation(e){for(const e of this._sendStates.values())if(!e.done)return!0;const t=new Set;for(const s of e)t.add(s.chunkId);return!(0,O.aI)(t,this._handled)&&(this._handled=t,!0)}invalidate(){this._invalidated=!0}createState(e){return new Fo(e,this._attributeStore)}async applyOverrideUpdate(e){return null}displayMap(e,t,s){const i=new Map(e.map(e=>[t(e),e])),r=[];for(const e of this._sendStates.values())for(const t of e.featuresWorldSpace()){const{objectId:e,displayId:n}=t,o=i.get(e);if(null!=o){const t=s(n,o,e);r.push(t),i.delete(e)}}return r}getDisplayFeatures(e){const t=new Set(e),s=new Set,i=[];for(const e of this._sendStates.values())for(const r of e.featuresWorldSpace())t.has(r.displayId)&&!s.has(r.objectId)&&(r.geometry&&i.push({...(0,st.oN)(r,this._metadata.geometryType,!1,!1),displayId:r.displayId}),s.add(r.objectId));return{features:[],aggregates:i,tracks:[]}}getFeatureObjectIdsForAggregate(e){for(const t of this._sendStates.values())for(const s of t.bins.values())if(s.id===e){const e=[];for(const t of s.containedObjectIds)for(const s of t.values())e.push(s);return e}return[]}async updateChunks(e,t){if(!this._invalidated)return null;this._invalidated=!1;const s=new Hn;for(const i of this._sendStates.values())s.messages.push(this._update(i,e,t));return s}forEachAggregateWorldSpace(e){const t=new Set;for(const s of this._sendStates.values())for(const i of s.featuresWorldSpace())t.has(i.objectId)||(e(i),t.add(i.objectId))}_createGetIndex(){return(e,t)=>{switch(this._schema.index.type){case"geohash":return e.getGeohashIndex(new Co({type:"geohash",fields:this.aggregateFields,featureFilter:this._featureFilter,geohashLevel:this._schema.index.fixBinLevel,spatialReference:this.spatialReference,arcadeContextInfo:this._arcadeContextInfo,scale:t.scale,sqlOptions:this._sqlOptions}));case"grid":{const s=this._schema.index.fixedBinLevel,i=null!=s?t.tileInfoView.getLODInfoAt(s).scale:t.scale;return e.getGridIndex(new Co({type:"grid",fields:this.aggregateFields,cellSize:this._schema.index.size,featureFilter:this._featureFilter,spatialReference:this.spatialReference,arcadeContextInfo:this._arcadeContextInfo,scale:i,sqlOptions:this._sqlOptions}))}}}}_update(e,t,s){const{subscription:i}=e,r=e.take(),{bins:n,featureCache:o}=e,a=i.tile,c=new Set;for(const s of t)this._getIndex(s,a).putBounded(n,c,e.tile.extent,e.tile.resolution);const l=[],h=i.tile.transform,u=i.tile.key.level;for(const e of n.values()){const t=e.getGeometry(this.spatialReference,h),s=new Bn.Om(t,e.getAttributes(),null,e.id);t||(s.centroid=e.getGeometricCentroid(this.spatialReference,h)),s.displayId=this._attributeStore.createDisplayIdForObjectId(`${s.objectId}.${u}`),o.set(e.id,s),l.push(s)}this.events.emit("changed"),e.done||=!s;const d=it.K.fromOptimizedFeatures(l,this._metadata,h),p=d.getCursor(),f=e.subscription.tile.createArcadeEvaluationOptions(this._arcadeContextInfo);for(;p.next();)this._attributeStore.setAttributeData(p.getDisplayId(),p,f,this._sqlOptions);const m=new Jn(e.subscription,d,[],e.done,{});for(const e of r.featureCache.keys())this._attributeStore.releaseDisplayIdForObjectId(`${e}.${u}`);return m}}var Ro=s(75538),zo=s(24506);class Oo{constructor(e,t){this.inner=e,this.displayId=t}}class Lo extends Yn{constructor(e){super(e),this.didSend=!1,this.done=!1}}class Do{constructor(e,t,s,i,r){this.level=e,this._scale=t,this._indexOptions=s,this._clusterRadius=i,this._store=r,this._statistics=new Map,this._handledChunks=new Set,this._handledIds=new Set,this._cells=new Map,this._clusters=new Map}destroy(){this._clearClusters()}_clearClusters(){for(const e of this._clusters.values())this._store.releaseDisplayIdForObjectId(e.inner.id);this._clusters.clear()}invalidate(){this._cells.clear(),this._handledChunks.clear(),this._handledIds.clear()}*aggregatesWorldSpace(){for(const e of this._clusters.values()){const t=e.inner.getCentroid(null),s=new Bn.Om(t,e.inner.getAttributes(),null,e.inner.id,e.displayId);yield s}}clusters(){return this._clusters.values()}update(e,t){let s=!1;const i=new Co({...this._indexOptions,scale:this._scale});for(const t of e)this._handledChunks.has(t.normalizedChunkId)||(this._handledChunks.add(t.normalizedChunkId),(null==t.lodInfo||t.lodInfo.level===this.level)&&(t.getGridIndex(i).put(this._cells,this._handledIds),s=!0));const r=(0,zo.p)(this._indexOptions.spatialReference,this._scale),n=this._indexOptions.cellSize,o={xMin:1/0,yMin:1/0,xMax:-1/0,yMax:-1/0};for(const{subscription:e}of t){const t=e.tile.bounds,s=Math.floor(t[0]*r/n),i=Math.floor(t[1]*r/n),a=Math.ceil(t[2]*r/n),c=Math.ceil(t[3]*r/n);o.xMin=Math.min(o.xMin,s),o.yMin=Math.min(o.yMin,i),o.xMax=Math.max(o.xMax,a),o.yMax=Math.max(o.yMax,c)}return null!=this._lastCellBounds&&o.xMin===this._lastCellBounds.xMin&&o.xMax===this._lastCellBounds.xMax&&o.yMin===this._lastCellBounds.yMin&&o.yMax===this._lastCellBounds.yMax||(this._lastCellBounds=o,s=!0),s&&this._clusterCells(o),s}_clusterCells(e){const t=this._clusters;this._clusters=new Map;const s=this._clusterRadius*(1/(0,zo.p)(this._indexOptions.spatialReference,this._scale));let i=Array.from(this._cells.values());i=i.sort((e,t)=>t.count-e.count);const r=new Set;for(const t of i){if(r.has(t.id))continue;if(t.gridX<e.xMin||t.gridX>e.xMax||t.gridY<e.yMin||t.gridY>e.yMax)continue;const i=1+this._clusterRadius/this._indexOptions.cellSize,n=this._store.createDisplayIdForObjectId(t.id),o=new Oo(t.clone(),n);r.add(t.id),this._clusters.set(t.id,o);const a=t.centroidXWorld,c=t.centroidYWorld;for(let e=t.gridY-i;e<=t.gridY+i;e++)for(let n=t.gridX-i;n<=t.gridX+i;n++){if(e===t.gridY&&n===t.gridX)continue;const i=this._cells.get(Ro.L.createId(n,e));if(!i||r.has(i.id))continue;const l=Math.abs(i.centroidXWorld-a),h=Math.abs(i.centroidYWorld-c);l<s&&h<s&&(o.inner.merge(i),r.add(i.id))}}for(const e of t.values())this._store.releaseDisplayIdForObjectId(e.inner.id)}async updateStatistics(e){let t=!1;for(const e of this._clusters.values())e.inner.count>1&&(t=this._updateAggregateStatistics(this._statistics,e.inner)||t);if(t){const t=Array.from(this._statistics.entries()).map(([e,t])=>({fieldName:e,minValue:t.minValue,maxValue:t.maxValue}));await e.container.updateStatistics(this.level,t)}}createAggregateFeatures(e,t){const s=e.subscription,i=[],r=s.tile.transform,o=Array.from(this._clusters.values()),a=o.length;for(const e of o){const t=e.inner.getCentroidX(r),s=e.inner.getCentroidY(r),n=1===e.inner.count?e.inner.firstObjectId:e.inner.id,o=e.displayId;if(t<p.CQ+128&&t>=-128&&s<p.CQ+128&&s>=-128){const r=new Te.A([],[t,s]),a=new Bn.Om(r,e.inner.getAttributes(),null,n,o);i.push(a)}}const c=it.K.fromOptimizedFeatures(i,t,s.tile.transform);return(0,n.A)("esri-2d-update-debug")&&console.debug(`Tile[${e.subscription.tile.id}] ClusterStrategy.createAggregateFeatures`,{clusters:c,levelClusterCount:a}),c}_updateAggregateStatistics(e,t){let s=!1;for(const i of t.statistics.values()){if("esriFieldTypeString"===i.field.type)continue;const t=i.value,r=i.field,n=e.get(r.name);if(n){const{minValue:e,maxValue:i}=n,r=Math.min(n.minValue,t),o=Math.max(n.maxValue,t);e===r&&i===o||(n.minValue=r,n.maxValue=o,s=!0);continue}e.set(r.name,{minValue:t,maxValue:t}),s=!0}return s}}class No extends Xn{static async create(e,t,s,i,r,n){const o=s.metadata.outSpatialReference,a=new wo({spatialReference:o}),c={type:"grid",fields:await Promise.all(t.fields.map(async e=>Gn.create(a,e))),spatialReference:o,featureFilter:t.featureFilter?await Ao.create({geometryType:s.metadata.geometryType,hasM:!1,hasZ:!1,timeInfo:s.metadata.timeInfo,fieldsIndex:s.metadata.fieldsIndex,spatialReference:o,filterJSON:t.featureFilter}):null,cellSize:t.clusterRadius/4,arcadeContextInfo:r,sqlOptions:n};return new No(e,t.clusterRadius,c,t.fields,s,i,n)}constructor(e,t,s,i,r,n,o){super(r,n,s.spatialReference,s.fields,o),this._connection=e,this._clusterRadius=t,this._indexOptions=s,this._cellsPerLevel=new Map,this._metadata=Po.i.createFeature({geometryType:"esriGeometryPoint",hasZ:!1,hasM:!1,featureIdInfo:{type:"object-id",fieldName:"aggregateId"},fieldsIndex:new Xe.A([...i,...this._source.metadata.fieldsIndex.fields,{name:"aggregateId",alias:"aggregateId",type:"esriFieldTypeOID"}]).toJSON(),globalIdField:null,spatialReference:r.metadata.spatialReference,outSpatialReference:r.metadata.outSpatialReference,subtypeField:null,subtypes:null,timeInfo:null,timeReferenceUnknownClient:null,dateFieldsTimeZone:null,typeIdField:null,types:null})}get enablePixelBuffering(){return!0}onSubscribe(e){super.onSubscribe(e);const{scale:t,level:s}=e.tile;this._lastSubscribedLodInfo={level:s,scale:t}}requiresInvalidation(e){return!1}invalidate(){for(const e of this._cellsPerLevel.values())e.invalidate()}createState(e){return new Lo(e)}async applyOverrideUpdate(e){for(const e of this._cellsPerLevel.values())e.invalidate();return null}displayMap(e,t,s){const i=new Map(e.map(e=>[t(e),e])),r=[],n=this._getActiveClusterState();if(n)for(const e of n.clusters()){const t=i.get(e.inner.id);if(null!=t){const n=s(e.displayId,t,e.inner.id);r.push(n),i.delete(e.inner.id);continue}if(1===e.inner.count){const{firstObjectId:t}=e.inner,n=t?i.get(t):null;if(null!=n){const o=s(e.displayId,n,t);r.push(o),i.delete(t)}}}return r}getDisplayFeatures(e){const t=new Set(e),s=new Set,i=[],r=[],n=this._getActiveClusterState();if(n)for(const e of n.aggregatesWorldSpace())if(t.has(e.displayId)&&!s.has(e.displayId)){const t=(0,st.oN)(e,this._metadata.geometryType,!1,!1);if(s.add(e.displayId),1===t.attributes.cluster_count){i.push({...t,displayId:e.displayId});continue}r.push({...t,displayId:e.displayId})}return{features:i,aggregates:r,tracks:[]}}getFeatureObjectIdsForAggregate(e){const t=this._getActiveClusterState();if(t)for(const s of t.clusters())if(s.inner.id===e){const e=[];for(const t of s.inner.containedObjectIds)for(const s of t.values())e.push(s);return e}return[]}async updateChunks(e,t){const s=this._lastSubscribedLodInfo;if(!s)return null;const i=this._getOrCreateClusterState(s),r=Array.from(this._sendStates.values()).filter(e=>e.subscription.tile.level===s.level);i.update(e,r);const n=new Qn(s.level);for(const e of r)n.messages.push(this._update(e,i,t));return await i.updateStatistics(this._connection),n}forEachAggregateWorldSpace(e){const t=this._getActiveClusterState();if(t)for(const s of t.aggregatesWorldSpace())e(s)}_getActiveClusterState(){return this._lastSubscribedLodInfo?this._cellsPerLevel.get(this._lastSubscribedLodInfo.level):null}_getOrCreateClusterState(e){if(null==e.level)throw new Error("InternalError: Level and scale must be defined");let t=this._cellsPerLevel.get(e.level);return t||(t=new Do(e.level,e.scale,this._indexOptions,this._clusterRadius,this._attributeStore),this._cellsPerLevel.set(e.level,t)),t}_update(e,t,s){const i=t.createAggregateFeatures(e,this._metadata);this.events.emit("changed"),e.done=e.done||!s;const r=i.getCursor(),o=e.subscription.tile.createArcadeEvaluationOptions(this._indexOptions.arcadeContextInfo);for(;r.next();)this._attributeStore.setAttributeData(r.getDisplayId(),r,o,this._sqlOptions);return(0,n.A)("esri-2d-update-debug")&&console.debug(`Tile[${e.subscription.tile.id}] ClusterStrategy._update`,{done:e.done}),new Kn(e.subscription,i,e.done,{})}}var qo=s(5162),Bo=s(9012);class Go extends Yn{}class jo extends Zn{constructor(e,t,s,i){super(e,t,i),this._arcadeContextInfo=s,this.handledChunks=new Set,this.handledChunksForIdCreation=new Set,this.handledChunksForAttributeData=new Set,this._streamLayerDeferredObjectIdsToRemove=[]}destroy(){super.destroy();for(const e of this._source.chunks())this._cleanupChunkIds(e)}invalidateAttributeData(e){this.handledChunksForAttributeData.clear(),this._arcadeContextInfo=e,null!=this._evalOptions&&(this._evalOptions=(0,Bo.N)(this._evalOptions.$view.scale,e))}onSubscribe(e){super.onSubscribe(e),this._evalOptions=e.tile.createArcadeEvaluationOptions(this._arcadeContextInfo)}createState(e){return new Go(e)}get aggregateQueryEngine(){return null}displayMap(e,t,s){const i=new Map(e.map(e=>[t(e),e])),r=[];for(const e of this._source.chunks()){const t=e.reader.getCursor();for(;t.next();){const e=t.getObjectId(),n=t.getDisplayId(),o=i.get(e);if(null!=o){const t=s(n,o,e);r.push(t),i.delete(e)}}}return r}getDisplayFeatures(e){const t=new Set(e),s=new Set,i=[];for(const e of this._source.chunks()){const r=e.reader.getCursor();for(;r.next();){const e=r.getObjectId(),n=r.getDisplayId();t.has(n)&&!s.has(e)&&(i.push({...r.readLegacyFeatureWorldSpace(),displayId:n}),s.add(e))}}return{features:i,aggregates:[],tracks:[]}}async applyOverrideUpdate(e){const t=new Hn,s=[];for(const t of e.modified.values()){const e=this._attributeStore.createDisplayIdForObjectId(t.objectId);t.displayId=e,s.push(e)}const i=it.K.fromOptimizedFeatures(Array.from(e.modified.values()),this._source.metadata).getCursor();for(;i.next();)this._attributeStore.setAttributeData(i.getDisplayId(),i,this._evalOptions,this._sqlOptions);const r=[];for(const t of e.removed){const e=this._attributeStore.getDisplayIdForObjectId(t);null!=e&&r.push(e)}(0,n.A)("esri-2d-update-debug")&&console.debug("FeatureUpdateStrategy.applyLocalEdit",{message:e,modifiedDisplayIds:s,removedDisplayIds:r});const o=qo.KN.fromFeatures(Array.from(e.modified.values()),this._source.metadata);this.handledChunks.add(o.chunkId),this.handledChunksForAttributeData.add(o.chunkId),this.handledChunksForIdCreation.add(o.chunkId);for(const e of this._sendStates.values())e.handledChunks.add(o.chunkId),t.messages.push(new Jn(e.subscription,null,s,!1,o.queryInfo));for(const e of this._sendStates.values()){const s=o.getTileReader(e.subscription.tile);t.messages.push(new Jn(e.subscription,s,r,!1,o.queryInfo))}for(const t of e.removed)this._attributeStore.releaseDisplayIdForObjectId(t);return t}async updateChunks(e,t){const s=new $n;if(!e.length)return s;this._updateAttributeData();for(const t of this._sendStates.values()){const{subscription:i,handledChunks:r}=t;for(const n of e){const{chunkId:e}=n;if(r.has(e)||!this.handledChunksForIdCreation.has(e)||!this.handledChunksForAttributeData.has(e))continue;r.add(e);const o=n.getTileReader(i.tile);if(!o)continue;const a=new Kn(t.subscription,o,n.end,n.queryInfo);s.messages.push(a)}}return s}removeChunks(e){for(const t of e)this.handledChunks.delete(t.chunkId),this.handledChunksForAttributeData.delete(t.chunkId),this._cleanupChunkIds(t)}afterUpdateChunks(){for(const e of this._streamLayerDeferredObjectIdsToRemove)this._attributeStore.releaseDisplayIdForObjectId(e);this._streamLayerDeferredObjectIdsToRemove=[]}_cleanupChunkIds(e){if(this.handledChunksForIdCreation.has(e.chunkId)){const t=e.reader.getCursor();for(;t.next();){const e=t.getObjectId();this._source.isStream?this._streamLayerDeferredObjectIdsToRemove.push(e):this._attributeStore.releaseDisplayIdForObjectId(e)}this.handledChunksForIdCreation.delete(e.chunkId)}}_updateAttributeData(){for(const e of this._source.chunks()){const{chunkId:t,reader:s}=e;if(!this.handledChunksForIdCreation.has(t)){this.handledChunksForIdCreation.add(t);const e=s.getCursor();for(;e.next();){const t=this._attributeStore.createDisplayIdForObjectId(e.getObjectId());e.setDisplayId(t)}}}for(const e of this._source.chunks())if(this._attributeStore.referencesScale()||!this.handledChunksForAttributeData.has(e.chunkId)){this.handledChunksForAttributeData.add(e.chunkId);const t=e.reader.getCursor();for(;t.next();){const e=t.getDisplayId();this._attributeStore.setAttributeData(e,t,this._evalOptions,this._sqlOptions)}}}}var Uo=s(77085),Vo=s(5808),Wo=s(17136),Yo=s(89056),$o=s(92029),Ho=s(52350);let Qo;class Zo{constructor(e,t,s,i,r){this.chunkIndex=e,this.featureIndex=t,this.objectId=s,this.displayId=i,this.time=r}}class Xo{static getOid(e){return re.xq+e}constructor(e,t,s,i,r,n,o,a){this._schema=e,this.trackId=t,this.objectId=s,this.displayId=i,this._fields=r,this._spatialReference=n,this._metadata=o,this._isStream=a,this._maxDisplayDuration=this._schema.maxDisplayDuration>0?this._schema.maxDisplayDuration:1/0,this._maxDisplayObservationsPerTrack=this._schema.maxDisplayObservationsPerTrack>=1?this._schema.maxDisplayObservationsPerTrack:1/0,this._observationRecords=[],this._nextObservationRecords=[],this._trackLinePath=[],this._bounds=[],this._trackLineGeometry=new Te.A}get _trackLineAttributes(){const e={...this._latestObservationFeature?.attributes,aggregateId:this.objectId,[re.EA]:0};if(null!=this._statistics)for(const t of this._statistics.values())e[t.field.name]=t.value;return e}get _startTimeField(){return this._metadata.timeInfo?.startTimeField}get length(){return this._observationRecords.length}*observations(){yield*this._observationRecords}*previousObservations(){for(let e=0;e<this._observationRecords.length-1;e++)yield this._observationRecords[e]}get latestObservationFeature(){return this._latestObservationFeature}get latestObservationRecord(){return this._latestObservationRecord}stageObservation(e,t){this._nextObservationRecords.push(new Zo(e,t.getIndex(),t.getObjectId(),t.getDisplayId(),null!=this._startTimeField?t.readAttributeAsTimestamp(this._startTimeField):null))}commitObservations(e,t,s){const i=new Set(this._nextObservationRecords.map(e=>e.objectId)),r=this._observationRecords.filter(e=>!i.has(e.objectId)).map(e=>e.objectId);let n,o;switch(this._observationRecords=[],this._trackLinePath=[],this._isStream||null==this._startTimeField||this._nextObservationRecords.sort((e,t)=>{const s=e.time,i=t.time;return null!=s&&null!=i?s-i:0}),this._schema.timeField){case"startTimeField":n=this._metadata.timeInfo?.startTimeField;break;case"endTimeField":n=this._metadata.timeInfo?.endTimeField;break;case"timeReceived":n=this._isStream?re.Aw:null}o=this._isStream?s?.end??Date.now():s?.end??-1/0;const a=t.map(e=>e.reader.getCursor());let c;for(let e=this._nextObservationRecords.length-1;e>=0&&!(this._observationRecords.length>=this._maxDisplayObservationsPerTrack);e--){const t=this._nextObservationRecords[e],s=a[t.chunkIndex];(0,m.Lw)(s),s.setIndex(t.featureIndex);const i=null!=n?s.readAttributeAsTimestamp(n):null;(null!=i?o-i:0)>=this._maxDisplayDuration||(this._commitObservation(t,s),c??=t)}if(null!=c){const{chunkIndex:t,featureIndex:s}=c,i=`${c.objectId}.latest`,n=e.createDisplayIdForObjectId(i),o=a[t];(0,m.Lw)(o),o.setIndex(s);const l=new Bn.Om(o.readGeometryWorldSpace(),{...o.readAttributes(),[re.EA]:1},null,i,n);this._latestObservationFeature&&r.push(this._latestObservationFeature.objectId),this._latestObservationFeature=l,this._latestObservationRecord=c}else this._latestObservationFeature=null;return this._trackLineGeometry=function(e,t){if(e.length<2)return(0,st.Ap)({paths:[e]},!1,!1);if(t.isWrappable){let s=!1;for(let i=1;i<e.length;i++){const r=e[i][0],n=(0,Wo.O7)(r,e[i-1][0],t);r!==n&&(e[i][0]=n,s=!0)}if(s){const s=(0,Yo.b3)({paths:[e],spatialReference:t});if(null!=s)return(0,st.Ap)({paths:s.paths},!1,!1)}return(0,st.Ap)({paths:[e]},!1,!1)}const s=Qo.fromGeometryToGXGeometry({hasM:!1,hasZ:!1,paths:[e]}),i=Qo.fromSpatialReference(t);if(null!=i){const e=(0,Uo.g7)(s,1e6,i,Vo.O.geodesic);if(null!=e){const t=Qo.toGeometry(e,i);if(null!=t&&"paths"in t)return(0,st.Ap)({paths:t.paths},!1,!1)}}return(0,st.Ap)({paths:[e]},!1,!1)}(this._trackLinePath,this._spatialReference),this._bounds=function(e){const{lengths:t,coords:s}=e;if(!t.length)return[(0,Y.Ie)()];const i=[];let r=0;for(let e=0;e<t.length;e++){const n=t[e],o=(0,Y.Ie)();i.push(o);for(let e=0;e<n;e++){const t=s[2*(e+r)],i=s[2*(e+r)+1];(0,Y.tK)(o,[t,i])}r+=n}return i}(this._trackLineGeometry),this._nextObservationRecords=[],r}updateStatistics(e,t){this._statistics=$o.o.create(this._fields);const s=e.map(e=>e.reader.getCursor());for(const{chunkIndex:e,featureIndex:i}of this._observationRecords){const r=s[e];(0,m.Lw)(r),r.setIndex(i),this._statistics.insert(r,t)}}overlapsTile(e){for(const t of this._bounds)if((0,Y.$9)(t,e.bounds,32))return!0;return!1}getLatestObservationFeatureForTile(e){if(null==this._latestObservationFeature)return null;const{objectId:t,displayId:s,geometry:i,attributes:r}=this._latestObservationFeature,n=(0,st.Nl)(i,this._metadata.geometryType,e.subscription.tile.transform)??new Te.A,o=(0,Y.fA)(1/0,1/0,-1/0,-1/0);return function(e,t){const{coords:s,lengths:i}=e;if(!i.length)return void t(s[0],s[1]);let r=0;for(let e=0;e<i.length;e++){const n=i[e];let o=0,a=0;for(let e=0;e<n;e++)o+=s[2*(e+r)],a+=s[2*(e+r)+1],t(o,a);r+=n}}(n,(e,t)=>(0,Y.tK)(o,[e,t])),(0,Y.HY)(o,(0,Y.fA)(0,0,p.CQ,p.CQ))?new Bn.Om(n,r,null,t,s):null}getTrackLineFeatureForTile(e){const t=(0,st.Nl)(this._trackLineGeometry,"esriGeometryPolyline",e.subscription.tile.transform)??new Te.A;return new Bn.Om(t,this._trackLineAttributes,null,this.objectId,this.displayId)}getTrackLineOptimizedFeature(){return new Bn.Om(this._trackLineGeometry,this._trackLineAttributes,null,this.objectId,this.displayId)}getTrackLineDisplayFeature(){const{_trackLineGeometry:e,_trackLineAttributes:t,displayId:s}=this;return{geometry:(0,st.zv)(e,"esriGeometryPolyline",!1,!1),attributes:t,displayId:s}}_commitObservation(e,t){const s=t.readCentroidWorldSpace();let i=s?.coords[0],r=s?.coords[1];null==s&&(i=t.readXWorldSpace(),r=t.readYWorldSpace()),null!=i&&null!=r&&(this._observationRecords.unshift(e),this._trackLinePath.unshift([i,r]))}}class Ko extends Yn{constructor(e){super(e),this.done=!1}}class Jo extends Xn{static async create(e,t,i,r,n){const o=t.metadata.outSpatialReference,a=new wo({spatialReference:o}),c=await Promise.all(e.fields.map(async e=>Gn.create(a,e))),l=e.featureFilter?await Ao.create({geometryType:t.metadata.geometryType,hasM:!1,hasZ:!1,timeInfo:t.metadata.timeInfo,fieldsIndex:t.metadata.fieldsIndex,spatialReference:o,filterJSON:e.featureFilter}):null;return o.isWrappable||(0,Uo.s1)()||await Promise.all([Promise.all([s.e(3661),s.e(1878),s.e(8885),s.e(5756),s.e(3299),s.e(8125)]).then(s.bind(s,78125)),Promise.all([s.e(3661),s.e(1878),s.e(8885),s.e(5756),s.e(3299)]).then(s.bind(s,83299)),(0,Uo.Hh)()]).then(([e,t,s])=>{Qo={fromGeometryToGXGeometry:t.fromGeometryToGXGeometry,toGeometry:t.toGeometry,fromSpatialReference:e.fromSpatialReference}}),new Jo(e,t,i,o,c,l,r,n)}constructor(e,t,s,i,r,n,o,a){super(t,s,i,r,a),this._schema=e,this._featureFilter=n,this._arcadeContextInfo=o,this._tracks=new Map,this._handledChunks=new Set,this._metadata=t.metadata.weakCloneWithAdditionalFields([{name:re.EA,alias:"trackPart",type:"esriFieldTypeSmallInteger"}]),this._trackLineMetadata=Po.i.createFeature({geometryType:"esriGeometryPolyline",featureIdInfo:{type:"object-id",fieldName:"aggregateId"},fieldsIndex:{fields:[...this._source.metadata.fieldsIndex.fields,...this.aggregateFields,{name:re.EA,alias:"trackPart",type:"esriFieldTypeSmallInteger"},{name:"aggregateId",alias:"aggregateId",type:"esriFieldTypeOID"}],timeZoneByFieldName:null},globalIdField:null,spatialReference:t.metadata.spatialReference,outSpatialReference:t.metadata.outSpatialReference,subtypeField:null,subtypes:null,timeInfo:t.metadata.timeInfo,timeReferenceUnknownClient:null,dateFieldsTimeZone:null,typeIdField:null,types:null,hasZ:!1,hasM:!1})}destroy(){super.destroy(),this._clear()}get _isStream(){return this._source.isStream}get enablePixelBuffering(){return!0}get isAggregate(){return!1}requiresInvalidation(){return!0}invalidate(){super.invalidate(),this._clear()}createState(e){return new Ko(e)}async applyOverrideUpdate(e){return Ct.A.getLogger("esri.views.2d.layers.features.processor.TrackStrategy").error("Applying override to tracks is not supported"),null}displayMap(e,t,s){const i=new Map(e.map(e=>[t(e),e])),r=[];for(const e of this._tracks.values()){const t=i.get(e.objectId);if(null!=t){const n=s(e.displayId,t,e.objectId);r.push(n),i.delete(e.objectId);continue}const n=e.latestObservationFeature;if(n?.objectId){const e=i.get(n.objectId);if(null!=e){const t=s(n.displayId,e,n.objectId);r.push(t),i.delete(n.objectId);continue}}for(const t of e.observations()){const e=i.get(t.objectId);if(null!=e){const n=s(t.displayId,e,t.objectId);r.push(n),i.delete(t.objectId)}}}return r}getDisplayFeatures(e){const t=new Set(e),s=[],i=[],r=this._source.chunks().map(e=>e.reader.getCursor());for(const e of this._tracks.values()){if(t.has(e.displayId)&&i.push(e.getTrackLineDisplayFeature()),null!=e.latestObservationFeature&&t.has(e.latestObservationFeature.displayId)){const{displayId:t,chunkIndex:i,featureIndex:n}=e.latestObservationRecord,o=r[i];o.setIndex(n),s.push({displayId:t,...o.readLegacyFeatureWorldSpace()})}for(const{displayId:i,chunkIndex:n,featureIndex:o}of e.observations())if(t.has(i)){const e=r[n];e.setIndex(o),s.push({displayId:i,...e.readLegacyFeatureWorldSpace()})}}return{features:s,aggregates:[],tracks:i}}getFeatureObjectIdsForAggregate(e){for(const t of this._tracks.values())if(t.objectId===e)return Array.from(t.observations(),e=>e.objectId);return[]}async updateChunks(){0===this._handledChunks.size&&this._rebuildTracks();const e=new $n;for(const t of this._sendStates.values())this._update(e,t);return e}forEachAggregateWorldSpace(e){for(const t of this._tracks.values())e(t.getTrackLineOptimizedFeature())}_clear(){for(const e of this._source.chunks())if(this._handledChunks.has(e.chunkId)){const t=e.reader.getCursor();for(;t.next();){const e=t.getObjectId();this._attributeStore.releaseDisplayIdForObjectId(e)}}this._handledChunks.clear();for(const e of this._tracks.values())this._removeTrack(e);this._tracks.clear()}_rebuildTracks(){const e=this._source.chunks();if(!e.length)return;const t=this._metadata.timeInfo?.trackIdField;if(null==t)return;const s=new Set;for(let i=0;i<e.length;i++){const r=e[i];if(this._handledChunks.has(r.chunkId))continue;this._handledChunks.add(r.chunkId);const n=r.reader.getCursor();for(;n.next();){const e=n.getObjectId();n.setDisplayId(this._attributeStore.createDisplayIdForObjectId(e));const r=n.readAttribute(t);if(null!=r&&null!=e&&(null===this._featureFilter||this._featureFilter.check(n,this._sqlOptions))){if(!this._tracks.has(r)){const e=Xo.getOid(r),t=this._attributeStore.createDisplayIdForObjectId(e),s=new Xo(this._schema,r,e,t,this.aggregateFields,this.spatialReference,this._source.metadata,this._isStream);this._tracks.set(r,s)}this._tracks.get(r).stageObservation(i,n),s.add(r)}}}for(const t of this._tracks.values())if(s.has(t.trackId)){const s=t.commitObservations(this._attributeStore,e,this._featureFilter?.timeExtent);for(const e of s)this._attributeStore.releaseDisplayIdForObjectId(e);t.updateStatistics(e,(0,Bo.N)(1,this._arcadeContextInfo))}else this._removeTrack(t)}_removeTrack(e){this._tracks.delete(e.trackId),this._attributeStore.releaseDisplayIdForObjectId(e.objectId),null!=e.latestObservationFeature&&this._attributeStore.releaseDisplayIdForObjectId(e.latestObservationFeature.objectId)}_update(e,t){if(t.done)return;t.done=!this._source.updateTracking.updating;const s=[],i=[];for(const e of this._tracks.values())if(e.length>0){if(this._schema.showLatestObservation){const i=e.getLatestObservationFeatureForTile(t);null!=i&&s.push(i)}this._schema.showTrackLine&&e.overlapsTile(t.subscription.tile)&&i.push(e.getTrackLineFeatureForTile(t))}const r=it.K.fromOptimizedFeatures(s,this._metadata,t.subscription.tile.transform),n=it.K.fromOptimizedFeatures(i,this._trackLineMetadata,t.subscription.tile.transform);let o=[];if(this._schema.showPreviousObservations){const e=this._source.chunks().map(()=>[]);for(const t of this._tracks.values())for(const{chunkIndex:s,featureIndex:i}of t.previousObservations())e[s].push(i);o=this._source.chunks().map((s,i)=>{const r=s.getTileReader(t.subscription.tile);if(null==r)return null;const n=Ho.e.from(r,e[i]);return n.setProcessorAttributes({[re.EA]:2}),"esriGeometryPoint"!==n.geometryType&&null!=n.getInTransform()||n.setTransformForDisplay(t.subscription.tile.transform),n}).filter(kn.Ru)}this.events.emit("changed");const a=t.subscription.tile.createArcadeEvaluationOptions(this._arcadeContextInfo),c=n.getCursor();for(;c.next();)this._attributeStore.setAttributeData(c.getDisplayId(),c,a,this._sqlOptions);for(const e of o){const t=e.getCursor();for(;t.next();)this._attributeStore.setAttributeData(t.getDisplayId(),t,a,this._sqlOptions)}const l=r.getCursor();for(;l.next();)this._attributeStore.setAttributeData(l.getDisplayId(),l,a,this._sqlOptions);e.messages.push(new Kn(t.subscription,n,!1,{}));for(const s of o)e.messages.push(new Kn(t.subscription,s,!1,{}));e.messages.push(new Kn(t.subscription,r,t.done,{}))}}new Map;var ea=s(69397);class ta{constructor(e){this.data=e,this._referenceCount=0}static{this.estimatedMemory=20}increment(){this._referenceCount+=1}decrement(){this._referenceCount-=1}get empty(){return 0===this._referenceCount}}class sa{constructor(){this._freeIdsGenerationA=[],this._freeIdsGenerationB=[],this._idCounter=1,this._freeIds=this._freeIdsGenerationA,this._objectIdToDisplayId=new Map}get usedMemory(){let e=0;return e+=(0,ea.Qf)(this._freeIdsGenerationA),e+=(0,ea.Qf)(this._freeIdsGenerationB),e+=this._objectIdToDisplayId.size*(ta.estimatedMemory+8),e}createIdForObjectId(e){let t=this._objectIdToDisplayId.get(e);return t?t.increment():(t=new ta(function(e){return(0|e)>>>0}(this._getFreeId())),t.increment(),this._objectIdToDisplayId.set(e,t)),t.data}releaseIdForObjectId(e){const t=this._objectIdToDisplayId.get(e);t&&(t.decrement(),t.empty&&(this._objectIdToDisplayId.delete(e),this._freeIds.push(t.data)))}getDisplayIdForObjectId(e){const t=this._objectIdToDisplayId.get(e);return null!=t?t.data:null}releaseAll(){for(const e of this._objectIdToDisplayId.values())this._freeIds.push(e.data);this._objectIdToDisplayId.clear()}incrementGeneration(){this._freeIds=this._freeIds===this._freeIdsGenerationA?this._freeIdsGenerationB:this._freeIdsGenerationA}_getFreeId(){return this._freeIds.length?this._freeIds.pop():this._idCounter++}}const ia=()=>Ct.A.getLogger("esri.views.layers.2d.features.support.AttributeStore"),ra=(ia(),()=>null),na=(0,n.A)("esri-shared-array-buffer");(0,n.A)("esri-atomics");class oa{constructor(e,t,s){this.size=0,this.texelSize=4,this.dirtyStart=0,this.dirtyEnd=0;const{pixelType:i,layout:r,textureOnly:n}=t;this.textureOnly=n||!1,this.pixelType=i,this.layout=r,this._resetRange(),this.size=e,this.isLocal=s,n||(this.data=this._initData(i,e))}get usedMemory(){return this.data?.byteLength??0}get buffer(){return this.data?.buffer}unsetComponentAllTexels(e,t){const s=this.data;for(let i=0;i<this.size*this.size;i++)s[i*this.texelSize+e]&=~t;this.dirtyStart=0,this.dirtyEnd=this.size*this.size-1}setComponentAllTexels(e,t){const s=this.data;for(let i=0;i<this.size*this.size;i++)s[i*this.texelSize+e]|=255&t;this.dirtyStart=0,this.dirtyEnd=this.size*this.size-1}setComponent(e,t,s){const i=this.data;for(const r of s)i[r*this.texelSize+e]|=t,this.dirtyStart=Math.min(this.dirtyStart,r),this.dirtyEnd=Math.max(this.dirtyEnd,r)}setComponentTexel(e,t,s){this.data[s*this.texelSize+e]|=t,this.dirtyStart=Math.min(this.dirtyStart,s),this.dirtyEnd=Math.max(this.dirtyEnd,s)}unsetComponentTexel(e,t,s){this.data[s*this.texelSize+e]&=~t,this.dirtyStart=Math.min(this.dirtyStart,s),this.dirtyEnd=Math.max(this.dirtyEnd,s)}getData(e,t){const s=to(e);return this.data[s*this.texelSize+t]}setData(e,t,s){const i=to(e),r=1<<t;0!==(this.layout&r)?null!=this.data&&(this.data[i*this.texelSize+t]=s,this.dirtyStart=Math.min(this.dirtyStart,i),this.dirtyEnd=Math.max(this.dirtyEnd,i)):ia().error("mapview-attributes-store","Tried to set a value for a texel's readonly component")}expand(e){if(this.size=e,!this.textureOnly){const t=this._initData(this.pixelType,e),s=this.data;t.set(s),this.data=t}}toMessage(){const e=this.dirtyStart,t=this.dirtyEnd,s=this.texelSize;if(e>t)return null;this._resetRange();const i=!this.isLocal,r=this.pixelType,n=this.layout,o=this.data;return{start:e,end:t,data:i&&o.slice(e*s,(t+1)*s)||null,pixelType:r,layout:n}}_initData(e,t){const s=ArrayBuffer,r=function(e){switch(e){case Zt.ld.UNSIGNED_BYTE:return Uint8Array;case Zt.ld.UNSIGNED_SHORT_4_4_4_4:return Uint16Array;case Zt.ld.FLOAT:return Float32Array;default:return void Ct.A.getLogger("esri.views.2d.engine.webgl.Utils").error(new i.A("webgl-utils",`Unable to handle type ${e}`))}}(e),n=new r(new s(t*t*4*r.BYTES_PER_ELEMENT));for(let e=0;e<n.length;e+=4)n[e+1]=255;return n}_resetRange(){this.dirtyStart=2147483647,this.dirtyEnd=0}}class aa{constructor(e){this._client=e,this._filters=[],this._blocks=new Array,this._attributeComputeInfo=null,this._abortController=new AbortController,this._size=p.TB,this._idsToHighlight=new Map,this._arcadeDependencies=new Set,this._initialized=!1,this.version=0,this._idGenerator=new sa,this._epoch=1}destroy(){this._abortController.abort()}_initialize(){if(null!=this._blockDescriptors)return;const e=Zt.ld.FLOAT;ra(`Creating AttributeStore ${na?"with":"without"} shared memory`),this._blockDescriptors=[{pixelType:Zt.ld.UNSIGNED_BYTE,layout:1},{pixelType:Zt.ld.UNSIGNED_BYTE,layout:15,textureOnly:!0},{pixelType:Zt.ld.UNSIGNED_BYTE,layout:15,textureOnly:!0},{pixelType:e,layout:15},{pixelType:e,layout:15},{pixelType:e,layout:15},{pixelType:e,layout:15},{pixelType:Zt.ld.FLOAT,layout:15}],this._blocks=this._blockDescriptors.map(()=>null)}get usedMemory(){let e=0;for(const t of this._blocks)t&&(e+=t.usedMemory);return e+=this._idGenerator.usedMemory,e}get hasHighlight(){return this._idsToHighlight.size>0}createDisplayIdForObjectId(e){return this._idGenerator.createIdForObjectId(e)}releaseDisplayIdForObjectId(e){return this._idGenerator.releaseIdForObjectId(e)}getDisplayIdForObjectId(e){return this._idGenerator.getDisplayIdForObjectId(e)}incrementDisplayIdGeneration(){this._idGenerator.incrementGeneration()}hasArcadeDependency(e){return this._arcadeDependencies.has(e)}releaseAllIds(){this._idGenerator.releaseAll()}async update(e,t,s,i=0){const r=(0,y.Ui)(this._schema,e);if(this.version=i,r&&((0,n.A)("esri-2d-update-debug")&&console.debug(`Version[${i}] AttributeStore.update`,{changed:r}),this._schema=e,this._attributeComputeInfo=null,this._initialize(),null!=e))if(s&&(this._filters=await Promise.all(e.filters.map(e=>e?Ao.create({geometryType:s.geometryType,hasM:!1,hasZ:!1,timeInfo:s.timeInfo,fieldsIndex:s.fieldsIndex,spatialReference:s.outSpatialReference,filterJSON:e}):null))),"multi"!==e.type)this._attributeComputeInfo={type:"feature",map:new Map},await Promise.all(e.bindings.map(async e=>{const s=await this._bind(t,e);this._updateReferences(s)}));else{this._attributeComputeInfo={type:"multi",keyField:e.keyField,map:new Map};for(const s in e.bindings){const i=e.bindings[s];await Promise.all(i.map(async e=>{const i=await this._bind(t,e,parseInt(s,10));this._updateReferences(i)}))}}}setHighlight(e,t){let s=null;0===e.length&&0===t.length&&(s=this._getBlock(0),s.unsetComponentAllTexels(0,(1<<p.U5)-1));for(const{displayId:t,highlightFlags:i}of e){if(null==t||-1===t)continue;s||(s=this._getBlock(0),s.unsetComponentAllTexels(0,(1<<p.U5)-1));const e=to(t);s.setComponent(0,i,[e])}this._idsToHighlight.clear();for(const{objectId:t,highlightFlags:s}of e)this._idsToHighlight.set(t,s);for(const{objectId:e,highlightFlags:s}of t)this._idsToHighlight.set(e,s)}setData(e,t,s,i){const r=to(e);this._ensureSizeForTexel(r),this._getBlock(t).setData(e,s,i)}getData(e,t,s){return this._getBlock(t).getData(e,s)}getHighlightFlags(e){return this._idsToHighlight.get(e)||0}unsetAttributeData(e){const t=to(e);this._getBlock(0).setData(t,0,0)}referencesScale(){const e=this._attributeComputeInfo;if(!e)return!1;if("multi"===e.type){for(const t of e.map.values())for(const{field:e}of t.values())if(e?.hasArcadeDependency("scale"))return!0}else for(const{field:t}of e.map.values())if(t?.hasArcadeDependency("scale"))return!0;return!1}setAttributeData(e,t,s,i){const r=to(e);this._ensureSizeForTexel(r),this._getBlock(0).setData(r,0,this.getFilterFlags(t,i));const n=this._attributeComputeInfo;let o=null;n&&(o="multi"===n.type?n.map.get(t.readAttribute(n.keyField)):n.map,o?.size&&o.forEach((e,i)=>{const n=1*i%4,o=Math.floor(1*i/4),a=this._getBlock(o+3);let c=e.field?.read(t,s);e.valueRepresentation&&(c=function(e,t){if(!e||!t)return e;switch(t){case"radius":case"distance":return 2*e;case"diameter":case"width":return e;case"area":return Math.sqrt(e)}return e}(c,e.valueRepresentation)),(null===c||isNaN(c)||c===1/0||c===-1/0)&&(c=1e-30),a.setData(r,n,c)}))}get epoch(){return this._epoch}sendUpdates(){const e=this._blocks.map(e=>null!=e?e.toMessage():null),t=this._getInitArgs();this._client.update({initArgs:t,blockData:e,version:this.version,sendUpdateEpoch:this._epoch}),this._epoch+=1}_ensureSizeForTexel(e){for(;e>=this._size*this._size;)if(this._expand())return}async _bind(e,t,s){const i=await e.createComputedField(t),{valueRepresentation:r}=t,n=this._attributeComputeInfo;if("multi"===n.type){const e=n.map.get(s)??new Map;e.set(t.binding,{field:i,valueRepresentation:r}),n.map.set(s,e)}else n.map.set(t.binding,{field:i,valueRepresentation:r});return i}_getInitArgs(){return this._initialized?null:(this._initialized=!0,this._getBlock(1),this._getBlock(2),this._getBlock(7),{blockSize:this._size,blockDescriptors:this._blocks.map(e=>null!=e?{textureOnly:e.textureOnly,buffer:e.buffer,pixelType:e.pixelType}:null)})}_getBlock(e){const t=this._blocks[e];if(null!=t)return t;ra(`Initializing AttributeBlock at index ${e}`);const s=new oa(this._size,this._blockDescriptors[e],this._client.isLocal);return this._blocks[e]=s,this._initialized=!1,s}_expand(){if(this._size<this._schema.capabilities.maxTextureSize){const e=this._size<<=1;ra("Expanding block size to",e,this._blocks);for(const t of this._blocks)t?.expand(e);return this._initialized=!1,this._size=e,0}return ia().error(new i.A("mapview-limitations","Maximum number of onscreen features exceeded.")),-1}_updateReferences(e){(0,ne.QY)(this._arcadeDependencies,e)}isVisible(e){return!!(this._getBlock(0).getData(e,0)&1<<p.U5)}getFilterFlags(e,t){let s=0;for(let i=0;i<this._filters.length;i++){const r=this._filters[i];(null==r||r.check(e,t))&&(s|=1<<i)}let i=0;if(this._idsToHighlight.size){const t=e.getObjectId();i=this.getHighlightFlags(t)}return s<<p.U5|i}}class ca{constructor(e,t){this._connection=e,this._source=t,this._version=1,this._registry=new Dn,this._proxy=new St({fetch:(e,t)=>this._connection.layerView.fetch(e,t),fetchDictionary:(e,t)=>this._connection.layerView.fetchDictionary(e,t),fetchMesh:(e,t)=>this._connection.layerView.fetchMesh(e,t)}),this._attributeStore=new aa({isLocal:!1,update:e=>(0,u.oV)(this._connection.container.updateAttributeView(e))})}destroy(){this._proxy.destroy(),this._strategy?.destroy(),this._attributeStore.destroy()}get hasClusters(){return"cluster"===this._schema?.mesh.strategy.type}get aggregateQueryEngine(){return this._strategy?.aggregateQueryEngine}get usedMemory(){let e=0;return e+=this._attributeStore.usedMemory,this._strategy&&(e+=this._strategy.usedMemory),e}get version(){return this._version}getDisplayFeatures(e){return this._strategy?this._strategy.getDisplayFeatures(e):{features:[],aggregates:[],tracks:[]}}getDisplayIds(e){const t={};return this._strategy?(this._strategy.displayMap(e,e=>e,(e,s,i)=>{t[i]=e}),t):t}getFeatureObjectIdsForAggregate(e){return this._strategy?this._strategy.getFeatureObjectIdsForAggregate(e):[]}onSubscribe(e){this._strategy?.onSubscribe(e)}onUnsubscribe(e){this._strategy?.onUnsubscribe(e)}requiresInvalidation(e){return this._strategy?.requiresInvalidation(e)??!1}async update(e,t,s,i,r){const o=e.processor,a=(0,_.i8)(this._schema?.storage,o.storage),c=(0,_.i8)(this._schema?.mesh.properties,o.mesh.properties),l=(0,_.i8)(this._schema?.mesh.factory,o.mesh.factory),h=(0,_.i8)(this._schema?.mesh.strategy,o.mesh.strategy),u=function(e,t){const s=[];return e?.timeExtent?.start===t.timeExtent?.start&&e?.timeExtent?.end===t.timeExtent?.end||s.push("timeProperties"),s}(this._schema?.expressionProperties,o.expressionProperties),d=u.some(e=>this._attributeStore.hasArcadeDependency(e)),p=u.some(e=>this._factory?.hasArcadeDependency(e)??!1),f=u.some(e=>this._strategy?.hasArcadeDependency(e))||this._strategy?.isAggregate&&d,m=p||f,g=c||l||h;if(!(a||g||p||d||f||i))return!1;(0,n.A)("esri-2d-update-debug")&&console.debug(`Version[${this._version}] SymbolProcessor.update`,{changes:(0,y.Ui)(this._schema,o),schema:o}),this._schema=o;const x=new wo({fields:this._source.metadata.fieldsIndex,spatialReference:this._source.metadata.outSpatialReference}),b={currentUser:o.mesh.properties.currentUser};if((a||g||d)&&(await this._attributeStore.update(o.storage,x,this._source.metadata,t),this._strategy?.invalidateAttributeData(la(o))),!i&&!g&&!m)return!1;(h||c||m)&&await this._updateStrategy(o.mesh.strategy,r,la(o),b),this._updateSortKey(x,"sortKey"in o.mesh.properties?o.mesh.properties.sortKey:null);const w="dictionary"===o.mesh.factory.symbology.type?o.mesh.factory.symbology.fieldMap:null,v=new Nn(x,this._proxy,s,this._registry,w);return(l||"dictionary"===o.mesh.factory.symbology.type)&&(this._factory=await wt.create(v,o.mesh.factory)),this._version=t,!0}async applyOverrideUpdate(e,t){if(this._strategy)try{const s=await this._strategy.applyOverrideUpdate(e);s&&await this._process(s,t)}catch(e){}}async updateChunks(e,t,s){await this._doUpdateChunks(e,t,s),this._strategy?.afterUpdateChunks()}async removeChunks(e){this._strategy?.removeChunks(e),this._attributeStore.incrementDisplayIdGeneration()}updateHighlight({highlights:e}){if(!this._strategy||!this._strategy.hasSubscribers)return void this._attributeStore.setHighlight(e.map(({objectId:e,highlightFlags:t})=>({objectId:e,highlightFlags:t,displayId:-1})),e);const t=this._strategy.displayMap(e,({objectId:e})=>e,(e,{highlightFlags:t},s)=>({objectId:s,displayId:e,highlightFlags:t}));this._attributeStore.setHighlight(t,e)}invalidate(){this._strategy&&this._strategy.invalidate()}async _doUpdateChunks(e,t,s){if(this._strategy){try{const i=await this._strategy.updateChunks(e,t);i&&await this._process(i,s)}catch(e){}(0,n.A)("esri-2d-update-debug")&&console.log("SendUpdates"),this._attributeStore.sendUpdates(),(0,n.A)("esri-2d-update-debug")&&console.log("SendUpdates.await")}}async _updateStrategy(e,t,s,i){switch(this._strategy?.destroy(),e.type){case"feature":this._strategy=new jo(this._source,this._attributeStore,s,i);break;case"binning":this._strategy=await Eo.create(e,this._source,this._attributeStore,s,i);break;case"cluster":this._strategy=await No.create(this._connection,e,this._source,this._attributeStore,s,i);break;case"track":this._strategy=await Jo.create(e,this._source,this._attributeStore,s,i)}for(const e of t)this._strategy.onSubscribe(e)}async _updateSortKey(e,t){if(this._sortInfo=(0,m.pR)(this._sortInfo?.computed),null!=t){const s=t.byRenderer?null:await e.createComputedField(t);this._sortInfo={...t,computed:s}}}async _process(e,t){switch(e.type){case"level-replace":return this._processLevelBatch(e,t);case"append":case"update":return this._processStandardBatch(e,t)}}async _processLevelBatch(e,t){const s=await this._connection.container.beginLevelMeshUpdate(e.level);await this._processBatchMessages(e.messages,t),await this._connection.container.applyLevelMeshUpdate(s)}async _processStandardBatch(e,t){return this._processBatchMessages(e.messages,t)}async _processBatchMessages(e,t){for(const s of e){const e=s.subscription;if((0,n.A)("esri-2d-update-debug")){const t=e.tile;console.debug(`Version[${this._version}] Tile[${t.key.id}, end=${s.end}] Processor._process`)}const i={currentUser:this._schema?.mesh.properties.currentUser};await this._fetchResources(s,i),(0,a.Te)(e.signal);const r=await this._write(s,e.tile.createArcadeEvaluationOptions(la(this._schema)),i,t),o=e.tile.tileInfoView.getLODInfoAt(e.tile.key);(0,a.Te)(e.signal);const{message:c,transferList:l}=r.serialize(o),h={objectIdMap:null,inner:s.createMessage(c,this._version,this._attributeStore.epoch)};if(this._schema?.mesh.properties.returnMeshObjectId){h.objectIdMap={};const e=s.reader?.getCursor();if(e)for(;e.next();)h.objectIdMap[e.getDisplayId()]=e.getObjectId()}if((0,a.Te)(e.signal),await this._connection.container.onMessage(h,{signal:e.signal,transferList:l}),this._attributeStore.sendUpdates(),(0,n.A)("esri-2d-update-debug")){const t=e.tile;console.debug(`Version[${this._version}] Tile[${t.key.id}, end=${s.end}] Processor._process.await`)}}}async _fetchResources(e,t){await this._fetchMatcherResources(e),await this._fetchWriterResources(e,t)}async _fetchMatcherResources(e){if(!e.reader)return;const t=e.subscription.tile.createArcadeEvaluationOptions(la(this._schema));return this._factory.enqueueMatcherRequests(this._proxy,e.reader,{scale:t.$view.scale,viewingMode:"2d"},e.id)}async _fetchWriterResources(e,t){if(!e.reader)return;const s=e.reader.getCursor(),i=e.subscription.tile.createArcadeEvaluationOptions(la(this._schema));for(;s.next();)this._factory.enqueueWriterRequests(this._proxy,s,i,t);await this._proxy.fetchEnqueuedResources()}async _write(e,t,s,i){const r=e.subscription.tile,n=e.reader?.getCursor(),o=n?.getSize()??0,c=r.tileInfoView.tileInfo.isWrappable,l=r.tileInfoView.spatialReference.isWGS84,h=this._schema?.mesh.factory.referenceScale,u=new se(r.key,this._strategy.enablePixelBuffering,c,l,o);if(!n)return u;const d=function(e,t){const s=(0,g.Q1)(e),i=[];for(const e of t.rings){const t=[];for(const i of e)t.push([(0,g.IE)(s,i[0]),(0,g.B2)(s,i[1])]);i.push(t)}return{rings:i}}(r.transform,i),p=r.createArcadeEvaluationOptions(la(this._schema));let f=0;for(;n.next();){++f%1e3||(await(0,a.Pl)(0),(0,a.Te)(e.subscription));const i=this._getSortKeyValue(n,t);u.entityStart(n.getDisplayId(),i);try{this._factory.write(u,this._proxy,n,p,s,r.level,d,h)}catch(e){}u.entityEnd()}return u}_getSortKeyValue(e,t){if(!this._sortInfo)return 0;const{computed:s,order:i,byRenderer:r}=this._sortInfo,n=r?this._factory.getSortKey(e,t):s?.read(e,t);return null==n||isNaN(n)?0:n*("asc"===i?-1:1)}}function la(e){const{timeZone:t}=e?.mesh.properties??{},{timeExtent:s}=e?.expressionProperties??{};return{timeZone:t,timeExtent:s}}class ha{static from(e){let t=0,s=0,i=0;return e.forEach(e=>{const r=e._readGeometry();r&&(s+=r.isPoint?1:r.lengths.reduce((e,t)=>e+t,0),i+=r.isPoint?1:r.lengths.length,t+=1)}),new ha(t,s,i)}constructor(e,t,s){this.featureCount=e,this.vertexCount=t,this.ringCount=s}toJSON(){return{featureCount:this.featureCount,ringCount:this.featureCount,vertexCount:this.featureCount}}}let ua=class extends R.A{constructor(e){super(),this._connection=e,this._enabledEventTypes=new Set,this._updateInfo={websocket:0,client:0},this._lastTime=performance.now(),this._queuedCommands=[],this.addHandles([(0,l.wB)(()=>this._strategy?.connectionStatus??"disconnected",e=>{this._layerView.setProperty({propertyName:"pipelineConnectionStatus",value:e})},{initial:!0}),(0,l.wB)(()=>this._strategy?.errorString||null,e=>this._layerView.setProperty({propertyName:"pipelineErrorString",value:e}),{initial:!0})])}destroy(){this._strategy=null,this.removeAllHandles()}get _layerView(){return this._connection.layerView}set strategy(e){null==this._strategy&&this._resetUpdateInfo(performance.now());const t="event-handles";this.removeHandles(t),null!=e&&(this.addHandles([e.events.on("data-received",e=>this._onFeature(e)),e.events.on("message-received",e=>this._onWebSocketMessage(e)),e.events.on("features-updated",e=>this._onUpdate(e)),e.events.on("tick",()=>this._onTick())],t),this._queuedCommands.forEach(t=>t(e)),this._queuedCommands=[]),this._strategy=e}updateCustomParameters(e){null!=e&&this._callOrEnqueue(t=>t.updateCustomParameters(e))}sendMessageToSocket(e){this._callOrEnqueue(t=>t.sendMessageToSocket(e))}sendMessageToClient(e){this._callOrEnqueue(t=>t.sendMessageToClient(e))}enableEvent(e,t){t?this._enabledEventTypes.add(e):this._enabledEventTypes.delete(e)}disconnect(){this._strategy?.disconnect()}connect(){this._strategy?.connect()}clear(){this._strategy?.clear()}_onWebSocketMessage(e){this._enabledEventTypes.has("message-received")&&this._layerView.emitEvent({name:"message-received",event:e})}_onFeature(e){this._updateInfo.websocket++,this._enabledEventTypes.has("data-received")&&this._layerView.emitEvent({name:"data-received",event:{attributes:e.attributes,centroid:e.centroid,geometry:e.geometry}})}_onUpdate(e){this._updateInfo.client+=e}_onTick(){const e=performance.now(),t=e-this._lastTime;if(t>2500){const s=Math.round(this._updateInfo.client/(t/1e3)),i=Math.round(this._updateInfo.websocket/(t/1e3));this._resetUpdateInfo(e),this._layerView.emitEvent({name:"update-rate",event:{client:s,websocket:i}})}}_resetUpdateInfo(e){this._lastTime=e,this._updateInfo.client=0,this._updateInfo.websocket=0}_callOrEnqueue(e){null!=this._strategy?e(this._strategy):this._queuedCommands.push(e)}};(0,E.Cg)([(0,L.MZ)()],ua.prototype,"_strategy",void 0),ua=(0,E.Cg)([(0,L.$K)("esri.views.2d.layers.features.sources.StreamMessenger")],ua);class da{constructor(){this._requiresInvalidation=!1}get requiresInvalidation(){return this._requiresInvalidation}requireInvalidation(){this._requiresInvalidation=!0}}class pa{constructor(e,t,s){this._context=s,this._controller=new AbortController,this.metadata=Po.i.createFeature(e),this._schema=t}destroy(){this._controller.abort(),this.store.destroy()}get store(){return this._context.store}get _connection(){return this._context.connection}get _options(){return{signal:this._controller.signal}}get _signal(){return this._controller.signal}async applyOverride(e){this._onOverride(),await this.store.applyOverride(e)}takeOverrideUpdate(){return this.store.takeOverrideUpdate()}unsafeSetQueryHistoricMoment(e){throw new Error("InternalError: LoadStrategy does not support query info")}async queryByObjectId(e,t){throw new Error("InternalError: LoadStrategy does not support fetching")}prepareCacheUpdate(e,t){}applyCacheUpdate(){return null}}var fa=s(13069),ma=s(28923);class _a{constructor(e,t,s,r){this.store=e,this.queryInfo=t,this._options=s,this._fetch=r,this._nextBatch=new Set,this._fetchFeatures=(0,a.sg)(async()=>{if(0===this._nextBatch.size||this._options.signal?.aborted)return;const e=Array.from(this._nextBatch);this._nextBatch.clear(),e.length>8e3&&Ct.A.getLogger("esri.views.2d.layers.FeatureLayerView2D").warn(new i.A("highlight-too-many-features","highlight is limited to 8000 features on large layers configured with a display filter to avoid performance issues"));const t=this.queryInfo.objectIdsQueryPageSize,s=Math.ceil(8e3/t),r=Math.min(s,Math.ceil(e.length/t)),n=Array.from({length:r},(s,i)=>{const r=i*t,n=Math.min(r+t,e.length);return{num:i,query:this.queryInfo.createObjectIdsQuery(e.slice(r,n))}});try{await async function(e,t,s,r={}){const n=(await Promise.allSettled(s.map(s=>async function(e,t,s,i={}){const r=`${e.chunkPrefix??""}${s.num}`,n=await e.fetch(s.query,i,{chunkId:r}),o=new ma.j(n,s.query.inner.toJSON(),s.num,!1);o.chunkId=o.normalizedChunkId=r,(0,a.Te)(i),t.insert(o)}(e,t,s,r)))).filter(e=>"rejected"===e.status).map(e=>e.reason);if(n.length)throw new i.A("featurelayer-query","Encountered errors when downloading data",{errors:n})}({chunkPrefix:"cache."+(0,fa.lk)(),fetch:this._fetch},this.store,n,this._options)}catch(e){}})}prepareCacheUpdate(e,t){if(t)for(const e of t)this._nextBatch.delete(e);for(const t of e)this._nextBatch.add(t)}applyCacheUpdate(){return 0===this._nextBatch.size||this._options.signal?.aborted?null:this._fetchFeatures().catch(()=>{})}}var ya=s(11254),ga=s(563),xa=s(41560),ba=s(79677);class wa{static create(e,t,s){const i=t.queryScaleRanges,r=t.displayFilterInfo;return new wa(function(e,t,s){const i=function(e){switch(e.type){case"object-id":case"unique-id-simple":return`${e.fieldName} ASC`;case"unique-id-composite":return`${e.fieldNames.join(",")} ASC`}}(s.featureIdInfo);return{returnCentroid:"esriGeometryPolygon"===s.serviceGeometryType&&!e.queryMetadata.supportsCentroidOnDegeneratedQuantizedGeometry&&!e.queryMetadata.supportsDegeneratedQuantizedGeometry,returnGeometry:!0,returnZ:t.returnZ,returnM:t.returnM,timeReferenceUnknownClient:s.timeReferenceUnknownClient??void 0,outSpatialReference:qn.A.fromJSON(e.outSpatialReference),orderByFields:"memory"===e.type?[]:[i],where:t.definitionExpression??"1=1",outFields:t.availableFields,multipatchOption:"esriGeometryMultiPatch"===s.serviceGeometryType?"xyFootprint":null,gdbVersion:t.gdbVersion,historicMoment:t.historicMoment?new Date(t.historicMoment):null,timeExtent:t.timeExtent?ba.A.fromJSON(t.timeExtent):null}}(e,t,s),r,i,s.subtypeField,t.customParameters,s.geometryType,e.queryMetadata)}constructor(e,t,s,i,r,n,o){this._queryParams=e,this._displayFilter=t,this._queryScaleRanges=s,this._subtypeField=i,this._customParameters=r,this._geometryType=n,this._queryMetadata=o}getPageSize(e){if(null==this._queryMetadata)throw new Error("InternalError: Service does not support paged queries");const t=this._queryMetadata.supportsMaxRecordCountFactor?4:null,s=((e?this._queryMetadata.tileMaxRecordCount:this._queryMetadata.maxRecordCount)??this._queryMetadata.maxRecordCount??2e3)*(t??1),i=(0,n.A)("featurelayer-query-max-page-size")??8e3;return Math.min(i,s)}get objectIdsQueryPageSize(){return this._queryMetadata?.maxRecordCount??2e3}updateHistoricMoment(e){this._queryParams.historicMoment=e}updateFields(e){this._queryParams.outFields=e}createPatchFieldsQuery(e,t,s){if(!t.getSize())return null;const i=e.clone();if("*"===this._queryParams.outFields[0]){if("*"===(i.outFields??[])[0])return null;i.outFields=this._queryParams.outFields}else{const e=new Set(this._queryParams.outFields),s=[];for(const i of e)t.hasField(i)||s.push(i);if(0===s.length)return null;i.outFields=s}i.returnGeometry=!1,i.returnCentroid=!1,i.quantizationParameters=null,i.cacheHint=!0;const r={inner:i,customParameters:this._customParameters};if((0,n.A)("esri-tiles-debug")&&null!=s){const e=s.chunkId.toString().replaceAll("/",".");r.customParameters=r.customParameters?{...r.customParameters,chunkId:e}:{chunkId:e}}return r}createQuery(e={}){if(!this._queryParams)throw new Error("InternalError: queryInfo should be defined");return{inner:new Mo.A({...this._queryParams,...e}),customParameters:this._customParameters}}createTileQuery(e,t){if(null==this._queryMetadata)throw new Error("InternalError: Service does not support tile queries");const s=this.createQuery(t),i=s.inner;if(this._queryScaleRanges?.length){const t=this._queryScaleRanges.filter(t=>(!t.minScale||t.minScale>=e.maxScale)&&(!t.maxScale||t.maxScale<=e.minScale)).map(e=>e.subtypeCode);if(t.length){const e=`${this._subtypeField} IN (${t})`;i.where=(0,ro.mA)(i.where,e)}}if(this._displayFilter&&(i.where=(0,ro.mA)(i.where,(0,xa.Ch)(this._displayFilter,e.minScale,e.maxScale))),i.quantizationParameters=t.quantizationParameters??e.getQuantizationParameters(),i.resultType="tile",i.geometry=e.hydratedExtent,this._queryMetadata.supportsQuantization?"esriGeometryPolyline"===this._geometryType&&(i.maxAllowableOffset=e.resolution*(0,n.A)("feature-polyline-generalization-factor")):"esriGeometryPolyline"!==this._geometryType&&"esriGeometryPolygon"!==this._geometryType||(i.maxAllowableOffset=e.resolution,"esriGeometryPolyline"===this._geometryType&&(i.maxAllowableOffset*=(0,n.A)("feature-polyline-generalization-factor"))),i.defaultSpatialReferenceEnabled=this._queryMetadata.supportsDefaultSpatialReference,i.compactGeometryEnabled=this._queryMetadata.supportsCompactGeometry,this._queryMetadata.supportsMaxRecordCountFactor&&(i.maxRecordCountFactor=4),(0,n.A)("esri-tiles-debug")){const t=e.id.replaceAll("/",".");s.customParameters=s.customParameters?{...s.customParameters,tileId:t}:{tileId:t}}return s}createPagedTileQuery(e,t){const s=this.getPageSize(!0);return this.createTileQuery(e,{start:s*t,num:s,returnExceededLimitFeatures:!0})}createPagedQuery(e,t){const s=this.getPageSize(!1);return this.createQuery({start:s*e,num:s,returnExceededLimitFeatures:!0,maxRecordCountFactor:4,quantizationParameters:t,cacheHint:!0})}createObjectIdsQuery(e){return this.createQuery({objectIds:e,outFields:["*"]})}}var va=s(10382),Ia=s(75321),Sa=s(80893);class ka extends it.K{static fromFeatures(e,t){const{geometryType:s}=t,i=(0,st.Di)([],e,s,!1,!1,t.featureIdInfo);for(let t=0;t<i.length;t++)i[t].displayId=e[t].displayId;return ka.fromOptimizedFeatures(i,t,null)}static fromFeatureSet(e,t){const s=(0,st.q3)(e,t.featureIdInfo);return ka.fromOptimizedFeatureSet(s,t)}static fromOptimizedFeatureSet(e,t){const s=ka.fromOptimizedFeatures(e.features,t,e.transform);return s._exceededTransferLimit=e.exceededTransferLimit,s._fieldsIndex=new Xe.A(e.fields),s}static fromOptimizedFeatures(e,t,s){const i=new ka(e,t);i._fieldsIndex=t.fieldsIndex;const{layerType:r}=t;if(!r)throw new Error("Layer type is required in metadata to read annotation features.");if(!s)throw new Error("Quantization transform is required to read annotation features.");return function(e,t,s){const i=s.spatialReference,r=s.outSpatialReference,n=(0,g.Q1)(t);for(const t of e){const e=qe(Ge("element",t.attributes)),s=e.geometry||e.graphic?.geometry;if(s){const o=Ne(s,i,r,n);if(o){t.geometry=o;for(const s of ve)s.addToFeature(t,e)}}}}(i._features,s,t),i}}var Ma=s(97633),Ta=s(99996),Aa=s(53655);const Pa=268435455;class Ca{constructor(){this.hasFeatures=!1,this.exceededTransferLimit=!1,this.hasZ=!1,this.hasM=!1,this.fieldCount=0,this.featureCount=0,this.idFieldIndices=[],this.transform=null,this.vertexCount=0,this.offsets={attributes:new Array,geometry:new Array},this.centroid=new Array,this.byReferenceVertexCounts=new Map}get usedMemory(){let e=0;return e+=(0,ea.Qf)(this.idFieldIndices),e+=(0,ea.Qf)(this.offsets.attributes),e+=(0,ea.Qf)(this.offsets.geometry),e+=(0,ea.Qf)(this.centroid),this.displayIds&&(e+=(0,ea.Qf)(this.displayIds)),this.groupIds&&(e+=(0,ea.Qf)(this.groupIds)),e}get stride(){return 2+Number(this.hasZ)+Number(this.hasM)}}const Fa=128e3,Ea={small:{delta:new Int32Array(128),decoded:new Int32Array(128)},small64:{delta:new Float64Array(0),decoded:new Float64Array(0)},large:{delta:new Int32Array(Fa),decoded:new Int32Array(Fa)},large64:{delta:new Float64Array(0),decoded:new Float64Array(0)}};function Ra(e,t){return t?e<=Ea.small64.delta.length?Ea.small64:(e<=Ea.large64.delta.length||(Ea.large64.delta=new Float64Array(Math.round(1.25*e)),Ea.large64.decoded=new Float64Array(Math.round(1.25*e))),Ea.large64):e<=Ea.small.delta.length?Ea.small:(e<=Ea.large.delta.length||(Ea.large.delta=new Int32Array(Math.round(1.25*e)),Ea.large.decoded=new Int32Array(Math.round(1.25*e))),Ea.large)}function za(e){for(;e.next();){if(1===e.tag())return e.getMessage();e.skip()}return null}function Oa(e,t,s,i,r){return!!e&&0===t*r-i*s&&t*i+s*r>0}class La extends Ta.Y{static fromBuffer(e,t,s=!1){const r=t.geometryType,n=function(e){try{const t=new Pe.A(new Uint8Array(e),new DataView(e));for(;t.next();){if(2===t.tag())return za(t.getMessage());t.skip()}}catch(e){throw new i.A("query:parsing-pbf","Error while parsing FeatureSet PBF payload",{error:e})}return null}(e),o=function(e,t,s){const i=e.asUnsafe(),r=i.pos(),n=new Ca;let o=0,a=0,c=null;const l=[];for(;i.next();)switch(i.tag()){case 12:c=i.processMessage(Aa.ae);break;case 9:n.exceededTransferLimit=i.getBool();break;case 10:n.hasZ=i.getBool();break;case 11:n.hasM=i.getBool();break;case 13:{const e=i.processMessage(Aa.cn);e.index=o++,l.push(e);break}case 15:{const e=i.getPackedEnd(),s=n.offsets.geometry,r=n.centroid;s.push(0);const{stride:o}=n;for(r.push(Pa),r.push(Pa);i.pos()<e&&i.next();)switch(i.tag()){case 1:{n.offsets.attributes.push(i.pos());const e=i.getLength();i.skipLen(e);break}case 2:if(t){const e=i.getPackedEnd();for(;i.pos()<e&&i.next();)switch(i.tag()){case 3:{const e=i.getPackedEnd();let t=a*o;for(;i.pos()<e;)n.centroid[t++]=i.getSInt64();break}default:i.skip()}}else{n.offsets.geometry[a]=i.pos();const e=i.getLength();n.vertexCount+=e,i.skipLen(e)}break;case 4:{const e=i.getLength(),t=i.pos()+e;for(;i.pos()<t&&i.next();)switch(i.tag()){case 3:{const e=i.getPackedEnd();let t=a*o;for(;i.pos()<e;)n.centroid[t++]=i.getSInt64();break}default:i.skip()}break}case 12:{const e=i.getUInt64();n.byReferenceVertexCounts.set(a,e);break}default:i.skip()}a++,n.hasFeatures=!0;break}default:i.skip()}n.fields=new Xe.A(l),n.featureCount=a,n.fieldCount=o;const h=function*(e){switch(e.type){case"object-id":case"unique-id-simple":return void(yield e.fieldName);case"unique-id-composite":return void(yield*e.fieldNames)}}(s);return n.idFieldIndices=Array.from(h,e=>n.fields.get(e)?.index),n.transform=c,n.displayIds=new Uint32Array(n.featureCount),n.groupIds=new Uint16Array(n.featureCount),i.move(r),n}(n,"esriGeometryPoint"===r,t.featureIdInfo);return new La(n,o,t,s)}constructor(e,t,s,i){super(s),this._use64Bit=i,this._hasNext=!1,this._isPoints=!1,this._featureIndex=-1,this._featureOffset=0,this._cache={area:0,unquantGeometry:void 0,geometry:void 0},this._parseCaches=new Array,this._geometryType=s.geometryType,this._reader=e,this._header=t,this._hasNext=t.hasFeatures,this._isPoints="esriGeometryPoint"===s.geometryType}get _size(){return this._header.featureCount}get fields(){return this._header.fields}get geometryType(){return this._geometryType}get hasZ(){return this._header.hasZ}get hasM(){return this._header.hasM}get hasFeatures(){return this._header.hasFeatures}get hasNext(){return this._hasNext}get exceededTransferLimit(){return this._header.exceededTransferLimit}getByReferenceVertexCount(){return this._header.byReferenceVertexCounts.get(this._featureIndex)}getSize(){return this._size}getInTransform(){return this._header.transform}getCursor(){return this.copy()}getIndex(){return this._featureIndex}setIndex(e){this._cache.area=0,this._cache.unquantGeometry=void 0,this._cache.geometry=void 0,this._featureIndex=e}getAttributeHash(){let e="";for(const t of this._header.fields.fields)e+=this._readAttributeAtIndex(t.index)+".";return e}getObjectId(){if(1===this._header.idFieldIndices.length)return this._readAttributeAtIndex(this._header.idFieldIndices[0]);const e=this._header.idFieldIndices.map(e=>this._readAttributeAtIndex(e));return JSON.stringify(e)}getDisplayId(){return this._header.displayIds[this._featureIndex]}setDisplayId(e){this._header.displayIds[this._featureIndex]=e}readGeometryArea(){return this._cache.area||this._readGeometry(!0),this._cache.area}copy(){const e=this._reader.clone(),t=new La(e,this._header,this.metadata,this._use64Bit);return this.copyInto(t),t}next(){for(this._cache.area=0,this._cache.unquantGeometry=void 0,this._cache.geometry=void 0;++this._featureIndex<this._size&&!this._getExists(););return this._featureIndex<this._size}get usedMemory(){return ea.qK+(this._cache.geometry?.usedMemory??0)}get underlyingMemory(){return super.underlyingMemory+this._reader.usedMemory+this._header.usedMemory}_readX(){return this._header.centroid[this._featureIndex*this._header.stride]}_readY(){return this._header.centroid[this._featureIndex*this._header.stride+1]}_readServerCentroid(){const e=new Te.A([],[],this.hasZ,this.hasM),{coords:t,stride:s}=e;for(let e=this._featureIndex*s,i=e+s;e<i;++e)t.push(this._header.centroid[e]);return 268435455===t[0]?null:e}_readGeometry(e=!1){if((this.hasZ||this.hasM)&&(e=!1),void 0===this._cache.geometry){let t=null;if(this._isPoints)t=this._readServerCentroid();else{const s=this._header.offsets.geometry[this._featureIndex],i=this._reader;if(0===s)return null;i.move(s);try{t=e?this._parseGeometryForDisplay(i):this._parseGeometry(i)}catch(e){return null}}return 0===t?.coords.length&&(t=null),this._cache.geometry=t,t}return this._cache.geometry}_readAttribute(e,t){const s=this._header.fields.get(e);if(null==s)return;const i=this._readAttributeAtIndex(s.index),r=this._header.fields.isDateField(s.name);return t?null==i?i:r?new Date(i):i:i}_readAttributes(){const e={};for(const t of this._header.fields.fields)e[t.name]=this._readAttributeAtIndex(t.index);return e}copyInto(e){super.copyInto(e),e._featureIndex=this._featureIndex,e._featureOffset=this._featureOffset,e._hasNext=this._hasNext,e._parseCaches=this._parseCaches}_readAttributeAtIndex(e){let t=this._parseCaches[e];if(t||(t=new Ma.P(this.getSize()),this._parseCaches[e]=t),t.has(this._featureIndex))return t.get(this._featureIndex);const s=this._header.offsets.attributes[this._featureIndex*this._header.fieldCount+e],i=this._reader;i.move(s);const r=function(e){const t=e.getLength(),s=e.pos()+t;for(;e.pos()<s&&e.next();)switch(e.tag()){case 1:return e.getString();case 2:return e.getFloat();case 3:return e.getDouble();case 4:return e.getSInt32();case 5:return e.getUInt32();case 6:return e.getInt64();case 7:return e.getUInt64();case 8:return e.getSInt64();case 9:return e.getBool();default:return e.skip(),null}return null}(i);return t.set(this._featureIndex,r),r}_readGeometryDeltaDecoded(e){if(void 0===this._cache.unquantGeometry){const t=this._readGeometry(e);if(!t)return this._cache.unquantGeometry=void 0,null;const s=this.getInTransform();if(!s)return this._cache.unquantGeometry=t,t;const i=s.scale[2]??1,r=s.translate[2]??1,n=s.scale[3]??1,o=s.translate[3]??1,a=Ra(t.coords.length,this._use64Bit).decoded,c=t.clone(a);this._cache.unquantGeometry=c;const{lengths:l,coords:h,hasZ:u,hasM:d}=c,p=u&&(1!==i||0!==r),f=d&&(1!==n||0!==o);let m=0;for(const e of l){let t=h[m++],s=h[m++];if(p){const e=h[m];h[m++]=i*e+r}if(f){const e=h[m];h[m++]=n*e+o}for(let a=1;a<e;++a){if(t=h[m++]+=t,s=h[m++]+=s,p){const e=h[m];h[m++]=i*e+r}if(f){const e=h[m];h[m++]=n*e+o}}}return c}return this._cache.unquantGeometry}_parseGeometry(e){const t=e.asUnsafe(),s=t.getPackedEnd(),i=[],r=[];for(;t.pos()<s&&t.next();)switch(t.tag()){case 2:{const e=t.getPackedEnd();for(;t.pos()<e;)r.push(t.getUInt32());break}case 3:{const e=t.getPackedEnd();for(;t.pos()<e;)i.push(t.getSInt64());break}default:t.skip()}return new Te.A(r,i,this.hasZ,this.hasM)}_parseGeometryForDisplay(e){const t=e.asUnsafe(),s=t.getLength(),i=t.pos()+s,r=[],n=[];let o=0,a=0,c=null,l=0;const h="esriGeometryPolygon"===this.geometryType,u="esriGeometryPolyline"===this.geometryType,d=h?3:u?2:1,p=h||u;for(;t.pos()<i&&t.next();)switch(t.tag()){case 2:{const e=t.getUInt32(),s=t.pos()+e;for(;t.pos()<s;){const e=t.getUInt32();r.push(e),o+=e}c=Ra(2*o,this._use64Bit).delta;break}case 3:{t.getUInt32();const e=2+(this.hasZ?1:0)+(this.hasM?1:0);(0,m.Lw)(c);for(const s of r){if(a+e*s>c.length){for(let e=0;e<s;e++)t.getSInt64(),t.getSInt64(),this.hasZ&&t.getSInt64(),this.hasM&&t.getSInt64();continue}let i=t.getSInt64(),r=t.getSInt64();this.hasZ&&t.getSInt64(),this.hasM&&t.getSInt64(),c[a++]=i,c[a++]=r;let o=1;for(let e=1;e<s;e++){const e=t.getSInt64(),s=t.getSInt64();this.hasZ&&t.getSInt64(),this.hasM&&t.getSInt64();const n=i+e,h=r+s;l+=-.5*(n-i)*(h+r),i=n,r=h,0===e&&0===s||Oa(p,c[a-2],c[a-1],e,s)?(c[a-2]+=e,c[a-1]+=s):(c[a++]=e,c[a++]=s,o+=1)}o>=d?n.push(o):a-=o*e}break}default:t.skip()}return this._cache.area=l,n.length?new Te.A(n,c):null!=c?this._createDeltaQuantizedExtrudedGeometry(c[0],c[1]):null}}const Da=ve.map(e=>e.realField),Na=[{name:"__SYSTEM_LENGTH__",type:"esriFieldTypeDouble",alias:"__SYSTEM_LENGTH__",defaultValue:0,description:"System generated length of the dimension",editable:!1,nullable:!1},{name:"__COMPUTED_TEXT_STRING__",type:"esriFieldTypeString",alias:"__COMPUTED_TEXT_STRING__",defaultValue:"",description:"System generated text string for the dimension",editable:!1,nullable:!1},{name:"__DIMENSION_ANGLE__",type:"esriFieldTypeDouble",alias:"__DIMENSION_ANGLE__",defaultValue:0,description:"System generated angle for text",editable:!1,nullable:!1}];class qa{constructor(e,t){this.service=e,this._metadata=t}destroy(){}}class Ba extends qa{constructor(e,t,s){super(e,t),this._ports=[],this._loaded=this._load(s)}destroy(){this._loaded.finally(()=>{this._client.close(),this._client=null;for(const e of this._ports)e.close()}).catch(()=>{})}async _load(e){this._ports=await e.layerView.openMemoryPorts(),this._client=await async function(e){const t=new va.A;return await t.open(e,{}),t}(this._ports)}async executeQuery(e,t){await this._loaded;const s=await this._client.invoke("queryFeatures",e.toJSON(),t);let i=this._metadata;return(0,x.aI)(e.outSpatialReference,s.spatialReference)&&(i=i.weakCloneWithResolvedSpatialReference()),it.K.fromFeatureSet(s,i)}}class Ga extends qa{async executeQuery(e,t){const s=await(0,Sa.kS)(this.service.source,e,t),r=!e.quantizationParameters;try{return La.fromBuffer(s,this._metadata,r)}catch(s){const r=await(0,Sa.LT)(this.service.source,e,"pbf",t??{}),{data:{url:n}}=await(0,ya.A)(r.url,{responseType:"native-request-init",...r.options});throw new i.A("featurelayer:query","Failed to parse response",{url:n,error:s,query:e.toJSON()})}}}class ja extends qa{async executeQuery(e,t){const{source:s,queryMetadata:i}=this.service;if(null!=e.quantizationParameters&&!i.supportsQuantization){const i=e.clone(),r=(0,g.VV)(i.quantizationParameters);i.quantizationParameters=null;const n=await(0,Sa.eW)(s,i,null,t),o=(0,st.q3)(n,this._metadata.featureIdInfo);return(0,st.jH)(r,o),it.K.fromOptimizedFeatureSet(o,this._metadata)}const r=await(0,Sa.eW)(s,e,null,t);return"esriGeometryPoint"===this._metadata.geometryType&&(r.features=r.features?.filter(e=>{if(null!=e.geometry){const t=e.geometry;return Number.isFinite(t.x)&&Number.isFinite(t.y)}return!0})),it.K.fromFeatureSet(r,this._metadata)}}class Ua extends qa{constructor(e,t){super(e,t),this._loaded=this._load()}async _load(){await(0,Ae.Nk)(this._metadata.spatialReference,this._metadata.outSpatialReference)}async executeQuery(e,t){await this._loaded;const{source:s}=this.service,i=e.clone(),r=(0,g.VV)(i.quantizationParameters);i.quantizationParameters=null;const n=await(0,Sa.eW)(s,i,this._metadata.spatialReference,t),o=(0,st.q3)(n,this._metadata.featureIdInfo);return o.fields.push(...Da),(0,st.jH)(r,o),ka.fromOptimizedFeatureSet(o,this._metadata)}}class Va extends qa{constructor(e,t){super(e,t),this._loaded=this._load()}async _load(){await(0,Ae.Nk)(this._metadata.spatialReference,this._metadata.outSpatialReference)}async executeQuery(e,t){await this._loaded;const{source:s}=this.service,i=e.clone(),r=(0,g.VV)(i.quantizationParameters);i.quantizationParameters=null;const n=await(0,Sa.eW)(s,i,this._metadata.spatialReference,t),o=(0,st.q3)(n,this._metadata.featureIdInfo);return o.fields.push(...Na),(0,st.jH)(r,o),ot.fromOptimizedFeatureSet(o,this._metadata)}}class Wa extends qa{async executeQuery(e,t){if(e.quantizationParameters&&!this.service.queryMetadata.supportsQuantization){const s=e.clone(),i=(0,g.VV)(s.quantizationParameters);s.quantizationParameters=null;const r=await(0,Ia.I)(this.service.source,e,t);return(0,st.jH)(i,r),it.K.fromOptimizedFeatureSet(r,this._metadata)}const s=await(0,Ia.I)(this.service.source,e,t);return it.K.fromOptimizedFeatureSet(s,this._metadata)}}class Ya extends pa{constructor(e,t,s){super(e.metadata,t,s),this._service=e,this._didApplyOverride=!1,this._queue=new ga.QueueProcessor({concurrency:32,process:async e=>{const t={signal:e.options?.signal,query:e.query.customParameters,useQueue:!0};return this._adapter.executeQuery(e.query.inner,t)}}),this._queryInfo=wa.create(e,{...t.full,...t.partial},this.metadata),this._adapter=function(e,t,s){switch(e.type){case"memory":return new Ba(e,t,s);case"ogc":return new Wa(e,t);case"feature-service":return e.queryMetadata.supportsFormatPBF&&(0,n.A)("featurelayer-pbf")?new Ga(e,t):"annotation-feature"===t.layerType?new Ua(e,t):"dimension-feature"===t.layerType?new Va(e,t):new ja(e,t)}}(e,this.metadata,s.connection),this._lastEditDate=e.queryMetadata.lastEditDate}destroy(){super.destroy(),this._adapter.destroy()}unsafeSetQueryHistoricMoment(e){this._queryInfo.updateHistoricMoment(e)}async tryUpdate(e,t){if((0,_.i8)(this.availableFields,t.availableFields)){if(this._didApplyOverride||await this._queryLastEditDateChanged())return!1;await this._updateFields(t.availableFields)}return this._schema.partial=t,!0}async queryByObjectId(e,t){if(0===e.length)return it.K.empty(this.metadata);const s=this._queryInfo.createQuery({objectIds:e});return s.inner.outFields=t,this._fetch(s,null,null)}get availableFields(){return this._schema.partial.availableFields}get definitionExpression(){return this._schema.full.definitionExpression}_onOverride(){this._didApplyOverride=!0}async _updateFields(e){this._queryInfo.updateFields(e);const t=Array.from(this.store.chunks()).map(async e=>{const t=Mo.A.fromJSON(e.queryInfo.queryJSON);if(t)try{return await this._tryUpdateFields(e.reader,t,{chunkId:e.chunkId}),null}catch(e){return e}}),s=(await Promise.all(t)).filter(e=>e);if(s.length)throw new i.A("featurelayer-query","Encountered errors when downloading fields",{errors:s})}async _fetch(e,t,s){const i=await this._enqueue(e,t);return await this._tryUpdateFields(i,e.inner,s),i}async _queryLastEditDateChanged(){if(null==this._lastEditDate)return!1;if(!("source"in this._service))return!1;const e=this._service.source,t={...e.query,f:"json"},s=(await(0,ya.A)(e.path,{query:t,responseType:"json"})).data.editingInfo.lastEditDate;return s!==this._lastEditDate&&(this._lastEditDate=s,!0)}async _tryUpdateFields(e,t,s){const r=this._queryInfo.createPatchFieldsQuery(t,e,s);if(!r)return;const n=await this._enqueue(r,this._options);n.getSize()===e.getSize()?e.joinAttributes(n):Ct.A.getLogger("esri.views.2d.layers.features.sources.strategies.AFetchLoadStrategy").error(new i.A("featurelayer-query",`Failed to join features. Expected a count of ${e.getSize()} features, but got ${n.getSize()}`,{query:r.inner.toJSON(),debugInfo:s}))}async _enqueue(e,t){return this._connection.onEvent({type:"fetchStart"}),this._queue.push({query:e,options:t}).finally(()=>{this._connection.onEvent({type:"fetchEnd",done:0===this._queue.length})})}}class $a extends Ya{constructor(e,t,s){super(e,t,s),this._chunksById=new Map,this._featureCache=new _a(this.store,this._queryInfo,this._options,this._fetch.bind(this))}prepareCacheUpdate(e,t){return this._featureCache.prepareCacheUpdate(e,t)}applyCacheUpdate(){return this._featureCache.applyCacheUpdate()}unload(e){this._removeChunks(e.tile)}_onRemoveTileChunk(e){}_addChunk(e){const t=e.tile.id;this._chunksById.has(t)||this._chunksById.set(t,[]);const s=e.size();(s||e.first||e.end)&&((0,n.A)("esri-2d-update-debug")&&console.debug(`Chunk[${e.chunkId}] ATileLoadStrategy.addChunk [count=${s}]`),this._chunksById.get(t).push(e),this.store.insert(e))}_removeChunks(e){const t=this._chunksById.get(e.key.id)??[];for(const s of t)(0,n.A)("esri-2d-update-debug")&&console.debug(`Tile[${e.key.id}] Chunk[${s.chunkId}] ATileLoadStrategy.removeChunk`),this._onRemoveTileChunk(s),this.store.remove(s);this._chunksById.delete(e.key.id)}}var Ha=s(70300);class Qa extends Ha.K{constructor(e,t,s,i,r,n){super(),this._reader=e,this._queryJSON=t,this._tile=s,this._sourceTile=i,this._sourceTileDepth=r,this._end=n,this.chunkId=`${this._tile.key.id}.${this._sourceTile?.key.id}${this._end?"e":""}`,this.normalizedChunkId=`${this._tile.key.normalizedId}.${this._sourceTile?.key.normalizedId}${this._end?"e":""}`}get queryInfo(){return{type:"drill-down-tile",chunkId:this.chunkId,tileId:this._tile.key.id,queryJSON:this._queryJSON,sourceTileDepth:this._sourceTileDepth,sourceTileId:this._sourceTile?.key.id,size:this.size(),end:this.end}}get first(){return 0===this._sourceTileDepth}get reader(){return this._reader}get end(){return this._end}get tile(){return this._tile}get lodInfo(){return{level:this.tile.level}}getTileReader(e){return this._tile.key.id===e.key.id?this.reader:null}}const Za=(0,n.A)("featurelayer-query-max-depth");class Xa{constructor(e,t){this.subscription=e,this._tileIdToResult=new Map,this._controller=new AbortController,this._handles=(0,r.vE)([(0,a.u7)(e.signal,()=>this._controller.abort()),(0,a.u7)(t,()=>this._controller.abort())])}destroy(){this._controller.abort(),this._handles.remove()}get(e){return this._tileIdToResult.get(e)}set(e,t){this._tileIdToResult.set(e,t)}get options(){return{signal:this._controller.signal}}}class Ka extends $a{constructor(){super(...arguments),this._loadStates=new Map}destroy(){super.destroy();for(const e of this._loadStates.values())e.destroy();this._loadStates.clear()}get about(){return{willQueryAllFeatures:!1,willQueryFullResolutionGeometry:!1}}async load(e){this._loadStates.has(e.key.id)||this._loadStates.set(e.key.id,new Xa(e,this._options));const t=this._loadStates.get(e.key.id);let s;try{for await(const s of this._fetchChunkInfos(t,e.tile,0)){const{queryJSON:e,reader:i,sourceTile:r,sourceTileDepth:n,tile:o}=s,c=new Qa(i,e,o,r,n,!1);(0,a.Te)(t.options),this._addChunk(c)}}catch(e){s=e}(0,a.Te)(t.options);const i=new Qa(it.K.empty(this.metadata),null,e.tile,null,-1,!0);if(this._addChunk(i),s)throw s}unload(e){super.unload(e),this._loadStates.get(e.key.id)?.destroy(),this._loadStates.delete(e.key.id)}async*_fetchChunkInfos(e,t,s){let i=e.get(t.id);const r=!!i;if(i||(i=await this._fetchChunkInfo(e,t,s),e.set(t.id,i)),i.reader.exceededTransferLimit&&s<(0,n.A)("featurelayer-query-max-depth"))for(const i of t.createChildTiles())yield*this._fetchChunkInfos(e,i,s+1);else r||(yield i)}async _fetchChunkInfo(e,t,s){const i=e.subscription.tile.getQuantizationParameters(),r=this._queryInfo.createTileQuery(t,{returnExceededLimitFeatures:s===Za,quantizationParameters:i});return{reader:await this._fetch(r,e.options,{chunkId:t.id}),queryJSON:r.inner.toJSON(),tile:e.subscription.tile,sourceTile:t,sourceTileDepth:s}}}var Ja=s(27348);class ec extends Ha.K{constructor(e,t){super(),this._reader=e,this._tile=t;const s=this._reader.getCursor();s.next();const i=s.getObjectId();this.chunkId=`${this._tile.key.id}.${i}${this.end?"e":""}`,this.normalizedChunkId=this.chunkId}get reader(){return this._reader}get first(){return!1}get end(){return!1}get queryInfo(){return{type:"snapshot",chunkId:this.chunkId,size:this.size(),end:this.end}}get lodInfo(){return null}get tile(){return this._tile}getTileReader(e){if(this._tile.key.id!==e.key.id)return null;const t=this.queryFeaturesInBounds(e.bounds);return t.setTransformForDisplay(e.transform),t}}class tc extends Ha.K{constructor(e,t,s,i,r){super(),this._reader=e,this._queryJSON=t,this._tile=s,this._page=i,this._end=r,this.chunkId=`${this._tile.key.id}.${this._page}${this.end?"e":""}`,this.normalizedChunkId=`${this._tile.key.normalizedId}.${this._page}${this.end?"e":""}`}get queryInfo(){return{type:"paged-tile",chunkId:this.chunkId,tileId:this._tile.key.id,queryJSON:this._queryJSON,page:this._page,size:this.size(),end:this.end}}get reader(){return this._reader}get first(){return 0===this._page}get end(){return this._end}get page(){return this._page}get tile(){return this._tile}get lodInfo(){return{level:this.tile.level}}getTileReader(e){return this._tile.key.id===e.key.id?this.reader:null}}class sc{constructor(e,t){this.subscription=e,this._pages=new Set,this._controller=new AbortController,this._done=!1,this._handles=(0,r.vE)([(0,a.u7)(e.signal,()=>this._controller.abort()),(0,a.u7)(t,()=>this._controller.abort())])}destroy(){this._controller.abort(),this._handles.remove()}get pageStart(){let e=-1;for(const t of this._pages.values())e=Math.max(e,t);return e+1}get done(){return this._done}get options(){return{signal:this._controller.signal}}add(e,t){this._pages.add(e),this._done=this._done||t}}class ic extends $a{constructor(){super(...arguments),this._loadStates=new Map,this._levels=new Map}destroy(){super.destroy();for(const e of this._loadStates.values())e.destroy();this._loadStates.clear()}get about(){return{willQueryAllFeatures:!1,willQueryFullResolutionGeometry:!1}}async load(e){const t=(0,z.tE)(this._loadStates,e.key.id,()=>new sc(e,this._options));for await(const e of this._fetchPages(t))this._addChunk(e)}unload(e){super.unload(e),this._loadStates.get(e.key.id)?.destroy(),this._loadStates.delete(e.key.id)}_onRemoveTileChunk(e){if(e instanceof ec){const t=e.reader.getCursor(),s=e.tile.resolution;for(;t.next();)this._removeReferenceFeature(t.getObjectId(),s)}}async*_fetchPages(e){let t;try{for await(const t of this._concurrentPageStream(e)){(0,a.Te)(e.options);for(const e of t)0!==e.size()&&(yield e)}}catch(e){t=e}if(t&&(0,a.zf)(t)||(yield new tc(it.K.empty(this.metadata),null,e.subscription.tile,-1,!0)),t)throw t}async*_concurrentPageStream(e){const t=(0,n.A)("featurelayer-query-tile-concurrency"),s=this._pageStreamAll(e),i=[];let r=!1,o=1;for(;!r;){const e=[];for(;!r&&i.length<o;){const t=s.next();if(!t.value){r=!0;break}const n=t.value;n.then(e=>{e.some(e=>e.reader.exceededTransferLimit)||(r=!0)}).catch(e=>{r=!0}).finally(()=>{i.splice(i.indexOf(n),1)}),i.push(n),e.push(n)}for(const t of e)yield t;i.length&&await Promise.race(i),o<t&&(o+=1)}}*_pageStreamAll(e){const t=Math.ceil((0,n.A)("featurelayer-query-tile-max-features")/this._queryInfo.getPageSize(!0));for(let s=0;s<t;s++)yield this._downloadPage(s,e)}async _downloadPage(e,t){(0,a.Te)(t.options);const s=t.subscription.tile,i=this._queryInfo.createPagedTileQuery(s,e);i.inner.returnExceededLimitGeometries=!1;const r=await this._fetch(i,t.options,{chunkId:`${s.id}-${e}`}),n=[],o=r.getCursor();for(;o.next();){const e=o.getByReferenceVertexCount();e&&(n.push({vertexCount:e,objectId:o.getObjectId()}),o.delete())}const c=new tc(r,i.inner.toJSON(),s,e,!1),l=await this._ensureReferenceFeatures(n,s);return(0,a.Te)(t.options),[c,...l]}async _ensureReferenceFeatures(e,t){let s=this._levels.get(t.resolution);return null==s&&(s=new Map,this._levels.set(t.resolution,s)),(await Promise.all(this._ensureReferenceLevelFeatures(s,e,t.resolution))).map(e=>new ec(e,t))}_removeReferenceFeature(e,t){const s=this._levels.get(t);if(null==s)throw new Error("Expected to find reference feature.");this._removeReferenceLevelFeature(s,e)}_ensureReferenceLevelFeatures(e,t,s){const i=[],r=new Ja.A({mode:"view",originPosition:"upper-left",tolerance:s});for(const s of t){let t=e.get(s.objectId);null==t&&(t=new ta(this._queryFeature(s.objectId,r)),e.set(s.objectId,t)),t.increment(),i.push(t.data)}return i}_removeReferenceLevelFeature(e,t){const s=e.get(t);if(null==s)throw new Error("Expected to find reference feature.");s.decrement(),s.empty&&e.delete(t)}async _queryFeature(e,t){const s=this._queryInfo.createQuery({objectIds:[e]});return s.inner.quantizationParameters=t,this._fetch(s,null,null)}}class rc{constructor(e,t){this.subscription=e,this._pages=new Set,this._controller=new AbortController,this._done=!1,this._handles=(0,r.vE)([(0,a.u7)(e.signal,()=>this._controller.abort()),(0,a.u7)(t,()=>this._controller.abort())])}destroy(){this._controller.abort(),this._handles.remove()}get pageStart(){let e=-1;for(const t of this._pages.values())e=Math.max(e,t);return e+1}get done(){return this._done}get options(){return{signal:this._controller.signal}}add(e,t){this._pages.add(e),this._done=this._done||t}}class nc extends $a{constructor(){super(...arguments),this._loadStates=new Map}destroy(){super.destroy();for(const e of this._loadStates.values())e.destroy();this._loadStates.clear()}get about(){return{willQueryAllFeatures:!1,willQueryFullResolutionGeometry:!1}}async load(e){const t=(0,z.tE)(this._loadStates,e.key.id,()=>new rc(e,this._options));for await(const e of this._fetchPages(t))this._addChunk(e)}unload(e){super.unload(e),this._loadStates.get(e.key.id)?.destroy(),this._loadStates.delete(e.key.id)}async*_fetchPages(e){let t;try{for await(const t of this._concurrentPageStream(e))(0,a.Te)(e.options),0!==t.size()&&(yield t)}catch(e){t=e}if(t&&(0,a.zf)(t)||(yield new tc(it.K.empty(this.metadata),null,e.subscription.tile,-1,!0)),t)throw t}async*_concurrentPageStream(e){const t=(0,n.A)("featurelayer-query-tile-concurrency"),s=this._pageStreamAll(e),i=[];let r=!1,o=1;for(;!r;){const e=[];for(;!r&&i.length<o;){const t=s.next();if(!t.value){r=!0;break}const n=t.value;n.then(e=>{e.reader.exceededTransferLimit||(r=!0)}).catch(e=>{r=!0}).finally(()=>{i.splice(i.indexOf(n),1)}),i.push(n),e.push(n)}for(const t of e)yield t;i.length&&await Promise.race(i),o<t&&(o+=1)}}*_pageStreamAll(e){const t=Math.ceil((0,n.A)("featurelayer-query-tile-max-features")/this._queryInfo.getPageSize(!0));for(let s=0;s<t;s++)yield this._downloadPage(s,e)}async _downloadPage(e,t){(0,a.Te)(t.options);const s=t.subscription.tile,i=this._queryInfo.createPagedTileQuery(s,e),r=await this._fetch(i,t.options,{chunkId:`${s.id}-${e}`});return(0,a.Te)(t.options),new tc(r,i.inner.toJSON(),s,e,!1)}}class oc extends Ya{constructor(e,t,s){super(e,t,s)}get about(){return{willQueryAllFeatures:!0,willQueryFullResolutionGeometry:!0}}load(e){return null==this._promise&&(this._promise=this._download()),this._promise}unload(e){}async _download(){const e=this._schema.snapshotInfo.initialTolerance,t=e?new Ja.A({mode:"view",originPosition:"upper-left",tolerance:e}):null;await this._downloadStreaming(t),null!=t&&await this._downloadRefresh()}async _downloadStreaming(e){try{for await(const t of this._fetchPages(e))this.store.insert(t)}catch(e){throw new i.A("featurelayer-query","Encountered error when downloading data",{error:e})}}async _downloadRefresh(){try{const e=[];for await(const t of this._fetchPages(null))e.push(t);this.store.clear();for(const t of e)this.store.insert(t);this.store.refresh()}catch(e){throw new i.A("featurelayer-query","Encountered error when downloading data",{error:e})}}async*_fetchPages(e){let t;try{for await(const t of this._concurrentPageStream(e))0!==t.size()&&(yield t)}catch(e){t=e}if(t&&(0,a.zf)(t)||(yield new ma.j(it.K.empty(this.metadata),null,-1,!0)),t)throw t}async*_concurrentPageStream(e){const t=(0,n.A)("featurelayer-snapshot-concurrency"),s=this._pageStreamAll(e),i=[];let r=!1,o=1;for(;!r;){const e=[];for(;!r&&i.length<o;){const t=s.next();if(!t.value){r=!0;break}const n=t.value;n.then(e=>{e.reader.exceededTransferLimit||(r=!0)}).catch(e=>{r=!0}).finally(()=>{i.splice(i.indexOf(n),1)}),i.push(n),e.push(n)}for(const t of e)yield t;i.length&&await Promise.race(i),o<t&&(o+=1)}}*_pageStreamAll(e){const t=Math.ceil(this._schema.snapshotInfo.maxFeatureCount/this._queryInfo.getPageSize(!1));for(let s=0;s<t;s++)yield this._downloadPage(s,e)}async _downloadPage(e,t){(0,a.Te)(this._options);const s=this._queryInfo.createPagedQuery(e,t),i=await this._fetch(s,this._options,{chunkId:e.toString()}),r=new ma.j(i,s.inner.toJSON(),e,!1);return(0,a.Te)(this._options),r}}var ac=s(29953),cc=s(39412);class lc extends Ha.K{constructor(e,t,s,i,r){super(),this._metadata=e,this._reader=t,this._page=s,this._end=i,this._fileId=r,this.chunkId=`${this._fileId}.${this._page}${this.end?"e":""}`,this.normalizedChunkId=this.chunkId}get reader(){return this._reader??it.K.empty(this._metadata)}get first(){return 0===this._page}get end(){return this._end}get queryInfo(){return{type:"snapshot",chunkId:this.chunkId,page:this._page,size:this.size(),end:this.end}}get lodInfo(){return null}async updateFields(e,t,s){if(null!=this._fileId)return this._reader?.updateFields(e,this._fileId,t,s)}getTileReader(e){const t=this.queryFeaturesInBounds(e.bounds);return t.setTransformForDisplay(e.transform),t}}var hc=s(16630);class uc extends pa{constructor(e,t,s,i){super(e.metadata,t,s),this._service=e,this._loaded=this._load(i)}destroy(){super.destroy(),this._loaded.finally(()=>{this._client.close(),this._client=null;for(const e of this._ports)e.close()}).catch(()=>{})}get about(){return{willQueryAllFeatures:!0,willQueryFullResolutionGeometry:!0}}get availableFields(){return this._schema.partial.availableFields}get definitionExpression(){return this._schema.full.definitionExpression}async tryUpdate(e,t){await this._loaded;let s=!0;return(0,_.i8)(this.availableFields,t.availableFields)&&await this._updateFields(t.availableFields),this._schema.partial.dataSourceHash!==t.dataSourceHash&&(s=!1),this._schema.partial=t,s}async load(e){return this._loaded}unload(e){}_onOverride(){}async _load(e){this._ports=await e.layerView.openMemoryPorts(),this._client=await(0,ac.N1)(this._ports,{maxNumberOfConcurrentJobs:20}),this._proxy=this._client.createInvokeProxy(),this._indexMap=await this._proxy.getIndexMap(),await this._download()}async _updateFields(e){const t=new Set(e),s=(0,O.iv)(t,new Set(this.availableFields));if(null!=this._service.metadata.fieldsIndex&&s.size){const e=Array.from(this.store.insertedChunks()).map(e=>e.updateFields(this._proxy,Array.from(s),this._options));await Promise.all(e)}}async _downloadFiles(){const e=await(0,cc.N)();(0,a.Te)(this._options);const t=await this._proxy.queryStream({type:"snapshot",outFields:Array.from(this.availableFields),returnGeometry:!0,outSpatialReference:this.metadata.outSpatialReference.toJSON(),where:this.definitionExpression},this._options);let s=0;for(;;){const i=await this._proxy.getStreamNext(t,this._options);if((0,a.Te)(this._options),null==i)break;const{fileId:r,buffer:n}=i,o=e.ParquetChunk.deserialize(new Uint8Array(n)),c=new hc.s(this.metadata,this._indexMap,o,r),l=new lc(this.metadata,c,s++,!1,r);this.store.insert(l)}}async _download(){try{await this._downloadFiles();const e=new lc(this.metadata,null,-1,!0,null);this.store.insert(e)}catch(e){throw console.error(e),e}}}class dc extends Ha.K{constructor(e,t,s,i,r,n){super(),this._metadata=e,this._reader=t,this._tile=s,this._fileId=i,this._page=r,this._end=n,this.chunkId=`${this._tile.key.id}.${this._fileId}.${this._page}${this.end?"e":""}`,this.normalizedChunkId=`${this._tile.key.normalizedId}.${this._fileId}.${this._page}${this.end?"e":""}`}get reader(){return this._reader??it.K.empty(this._metadata)}get first(){return 0===this._page}get end(){return this._end}get tile(){return this._tile}get queryInfo(){return{type:"parquet",chunkId:this.chunkId,queryJSON:null,page:this._page,size:this.size(),tileId:this._tile.id,end:this.end}}get lodInfo(){return{level:this._tile.level}}async updateFields(e,t,s){if(null!=this._fileId)return this._reader?.updateFields(e,this._fileId,t,s)}getTileReader(e){return this._tile.key.id===e.key.id?this.reader:null}}class pc{constructor(e,t){this.subscription=e,this.chunks=[],this.ids=[],this._controller=new AbortController,this._handles=(0,r.vE)([(0,a.u7)(e.signal,()=>this._controller.abort()),(0,a.u7)(t,()=>this._controller.abort())])}destroy(){this._controller.abort(),this._handles.remove()}get options(){return{signal:this._controller.signal}}addBinaryData(e){this.chunks.push(e)}addSourceChunkId(e){this.ids.push(e)}}class fc extends pa{constructor(e,t,s,i){if(super(e.metadata,t,s),this._service=e,this._loadStates=new Map,this._queue=new ga.QueueProcessor({concurrency:32,process:e=>this._loadTile(e)}),!e.geometryInfo.displayOptimization)throw new Error("InternalError: ParquetTileLoadStrategy only supports XZ-enabled parquet files");this._loaded=this._load(i)}destroy(){super.destroy(),this._loaded.finally(()=>{this._client.close(),this._client=null;for(const e of this._ports)e.close()}).catch(()=>{})}get about(){return{willQueryAllFeatures:!0,willQueryFullResolutionGeometry:!0}}get availableFields(){return this._schema.partial.availableFields}get definitionExpression(){return this._schema.full.definitionExpression}async tryUpdate(e,t){await this._loaded;let s=!0;return(0,_.i8)(this.availableFields,t.availableFields)&&await this._updateFields(t.availableFields),this._schema.partial.dataSourceHash!==t.dataSourceHash&&(s=!1),this._schema.partial=t,s}async load(e){return await this._loaded,(0,z.tE)(this._loadStates,e.key.id,()=>new pc(e,this._options)),this._queue.push(e)}unload(e){const t=this._loadStates.get(e.tile.id);if(null!=t){for(const e of t.ids)this.store.removeById(e);t.destroy(),this._loadStates.delete(e.tile.id)}}async _load(e){this._ports=await e.layerView.openMemoryPorts(),this._client=await(0,ac.N1)(this._ports,{maxNumberOfConcurrentJobs:20}),this._proxy=this._client.createInvokeProxy(),this._indexMap=await this._proxy.getIndexMap()}_onOverride(){}async _updateFields(e){const t=new Set(e),s=(0,O.iv)(t,new Set(this.availableFields));if(null!=this._service.metadata.fieldsIndex&&s.size){const e=Array.from(this.store.insertedChunks()).map(e=>e.updateFields(this._proxy,Array.from(s),this._options));await Promise.all(e)}}async _loadTile(e){const t=e.tile,s=e.signal,i=this._loadStates.get(t.id);await this._downloadTileData(e),(0,a.Te)(s);const r=new dc(this.metadata,null,t,null,0,!0);i.addSourceChunkId(r.chunkId),this.store.insert(r)}async _downloadTileData(e){const t=await(0,cc.N)(),s=e.tile,i=e.signal,r=this._loadStates.get(s.id),n=await this._proxy.queryStream({type:"tile",extent:s.extent,transform:s.normalizedTransform,outFields:Array.from(this.availableFields),returnGeometry:!0,outSpatialReference:this.metadata.outSpatialReference.toJSON(),scale:s.scale,where:this.definitionExpression},{signal:i});let o=0;for(;;){const e=await this._proxy.getStreamNext(n,{signal:i});if((0,a.Te)(i),null==e)break;const{fileId:c,buffer:l}=e,h=t.ParquetChunk.deserialize(new Uint8Array(l)),u=new hc.s(this.metadata,this._indexMap,h,c,s.transform),d=new dc(this.metadata,u,s,c,o++,!1);r.addBinaryData({data:h,fileId:c}),r.addSourceChunkId(d.chunkId),this.store.insert(d)}}}class mc{constructor(e){this.size=0,this._start=0,this.maxSize=e,this._buffer=new Array(e)}get entries(){return this._buffer}enqueue(e){if(this.size===this.maxSize){const t=this._buffer[this._start];return this._buffer[this._start]=e,this._start=(this._start+1)%this.maxSize,t}return this._buffer[(this._start+this.size++)%this.maxSize]=e,null}dequeue(){if(0===this.size)return null;const e=this._buffer[this._start];return this._buffer[this._start]=null,this.size--,this._start=(this._start+1)%this.maxSize,e}peek(){return 0===this.size?null:this._buffer[this._start]}peekLast(){return 0===this.size?null:this._buffer[(this._start+(this.size-1))%this.maxSize]}find(e){if(0===this.size)return null;for(const t of this._buffer)if(null!=t&&e(t))return t;return null}clear(e){let t=this.dequeue();for(;null!=t;)e&&e(t),t=this.dequeue()}}class _c{constructor(e,t,s,r,n=128){if(this._trackIdToObservations=new Map,this._idCounter=0,this._lastPurge=performance.now(),this._addOrUpdated=new Map,this._removed=[],this._maxAge=0,this._timeInfo=s,this._purgeOptions=r,this.store=e,"unique-id-composite"===t.type)throw new i.A("stream-layer","composite uniqueIds are not supported");this.idField=t.fieldName,this.purgeInterval=n,this._useGeneratedIds=this.idField===re.DN}removeById(e){this._removed.push(e)}removeByTrackId(e){const t=this._trackIdToObservations.get(e);if(t)for(const e of t.entries)this._removed.push(e)}add(e){if(this._useGeneratedIds){const t=this._nextId();e.attributes[this.idField]=t,e.objectId=t}else e.objectId=e.attributes[this.idField];const t=e.objectId;if(this._addOrUpdated.set(t,e),this._maxAge=Math.max(this._maxAge,e.attributes[this._timeInfo.startTimeField]),!this._timeInfo.trackIdField)return null==this._trackIdLessObservations&&(this._trackIdLessObservations=new mc(1e5)),void this._trackIdLessObservations.enqueue(t);const s=e.attributes[this._timeInfo.trackIdField];if(!this._trackIdToObservations.has(s)){const e=null!=this._purgeOptions?.maxObservations?this._purgeOptions.maxObservations:1e3,t=(0,He.qE)(e,0,1e3);this._trackIdToObservations.set(s,new mc(t))}const i=this._trackIdToObservations.get(s),r=i?.enqueue(t);null!=r&&(this._addOrUpdated.has(r)?this._addOrUpdated.delete(r):this._removed.push(r))}checkForUpdates(){const e=this._getToAdd(),t=this._getToRemove(),s=performance.now(),i=s-this._lastPurge,r=Date.now();i>=this.purgeInterval&&(this._purge(s),this._lastPurge=s);const n=[];if(null!=t)for(const e of t){const t=this.store.removeById(e);null!=t&&n.push(t)}const o=[];if(null!=e){const i=new Set(t??[]);for(const t of e)i.has(t.objectId)||(t.attributes[re.Gm]=s,t.attributes[re.Aw]=r,this.store.add(t),o.push(t))}return!(!o.length&&!n?.length||(this.store.update(o,n),0))}_getToAdd(){if(!this._addOrUpdated.size)return null;const e=new Array(this._addOrUpdated.size);let t=0;return this._addOrUpdated.forEach(s=>e[t++]=s),this._addOrUpdated.clear(),e}_getToRemove(){const e=this._removed;return this._removed.length?(this._removed=[],e):null}_nextId(){const e=this._idCounter;return this._idCounter=(this._idCounter+1)%4294967294+1,e}_purge(e){const t=this._purgeOptions;null!=t&&(this._purgeSomeByDisplayCount(t),this._purgeByAge(t),this._purgeByAgeReceived(e,t),this._purgeTracks())}_purgeSomeByDisplayCount(e){if(!e.displayCount)return;let t=this.store.size;if(t>e.displayCount){if(this._timeInfo.trackIdField)for(const s of this._trackIdToObservations.values())if(t>e.displayCount&&s.size){const e=s.dequeue();this._removed.push(e),t--}if(null!=this._trackIdLessObservations){let s=t-e.displayCount;for(;s-- >0;){const e=this._trackIdLessObservations.dequeue();null!=e&&this._removed.push(e)}}}}_purgeByAge(e){const t=this._timeInfo?.startTimeField;if(!e.age||!t)return;const s=60*e.age*1e3,i=this._maxAge-s;this.store.forEach(e=>{e.attributes[t]<i&&this._removed.push(e.objectId)})}_purgeByAgeReceived(e,t){if(!t.ageReceived)return;const s=e-60*t.ageReceived*1e3;this.store.forEach(e=>{e.attributes[re.Gm]<s&&this._removed.push(e.objectId)})}_purgeTracks(){this._trackIdToObservations.forEach((e,t)=>{0===e.size&&this._trackIdToObservations.delete(t)})}}var yc=s(60986),gc=s(10107),xc=s(64108);let bc=class extends R.A{constructor(e){super(e)}get connectionStatus(){return this.connection?.connectionStatus}get errorString(){return this.connection?.errorString}};(0,E.Cg)([(0,gc.MZ)()],bc.prototype,"connection",void 0),(0,E.Cg)([(0,gc.MZ)()],bc.prototype,"connectionStatus",null),(0,E.Cg)([(0,gc.MZ)()],bc.prototype,"errorString",null),bc=(0,E.Cg)([(0,xc.$)("esri.views.2d.layers.features.sources.StreamConnectionState")],bc);class wc{constructor(e,t){this._metadata=e,this._onUpdate=t,this._objectIdToFeature=new Map}get size(){return this._objectIdToFeature.size}get reader(){return it.K.fromFeatures([...this._objectIdToFeature.values()],this._metadata)}add(e){this._objectIdToFeature.set(e.objectId,e)}forEach(e){this._objectIdToFeature.forEach(e)}removeById(e){const t=this._objectIdToFeature.get(e);return t?(this._objectIdToFeature.delete(e),t):null}clear(){this._objectIdToFeature=new Map}update(e,t){this._onUpdate(e?.length??0)}}class vc extends Ha.K{constructor(e){super(),this._reader=e,this.chunkId="stream-chunk",this.normalizedChunkId="stream-chunk"}get reader(){return this._reader}get first(){return!0}get end(){return!0}get queryInfo(){return{type:"stream",chunkId:this.chunkId,size:this.size(),end:this.end}}get lodInfo(){return null}getTileReader(e){const t=this.queryFeaturesInBounds(e.bounds);return t.setTransformForDisplay(e.transform),t}}class Ic extends pa{constructor(e,t,s){super(e.metadata,t,s),this._service=e,this._connectionState=new bc,this._forceRefresh=!1,this.events=new jn.bk;const{timeInfo:i}=this.metadata,{purgeOptions:r}=t.full;this._stagingStore=new wc(this.metadata.weakCloneWithAdditionalFields([{name:re.Aw,alias:"timeReceived",type:"esriFieldTypeDate"}]),e=>this.events.emit("features-updated",e)),this._manager=new _c(this._stagingStore,this.metadata.featureIdInfo,i,r),this.connect()}destroy(){super.destroy(),this.disconnect()}get about(){return{willQueryAllFeatures:!1,willQueryFullResolutionGeometry:!1}}get connectionStatus(){return this._connectionState.connectionStatus}get errorString(){return this._connectionState?.errorString}get availableFields(){return this._schema.full.availableFields}get definitionExpression(){return this._schema.full.definitionExpression}async tryUpdate(e,t){const s=null!=this._chunk;if(t.sourceRefreshVersion!==this._refreshVersion){if(this._refreshVersion=t.sourceRefreshVersion,!this._manager.checkForUpdates()&&s&&!this._forceRefresh)return this.events.emit("tick"),!0;this._chunk&&(this.store.remove(this._chunk),e.requireInvalidation()),this._forceRefresh=!1,this._chunk=new vc(this._stagingStore.reader),this.store.insert(this._chunk),this.events.emit("tick")}return this._schema.partial=t,!0}async load(e){}unload(e){}disconnect(){this._streamConnection=(0,m.pR)(this._streamConnection),this._connectionState.connection=null,this._handlesGroup?.remove()}connect(){null==this._streamConnection&&(this._streamConnection=(0,yc.createConnection)(this._service.source,this.metadata.outSpatialReference),this._handlesGroup=(0,r.vE)([this._streamConnection.on("data-received",e=>this._onFeature(e)),this._streamConnection.on("message-received",e=>this._onWebSocketMessage(e))]),this._connectionState.connection=this._streamConnection)}clear(){this._manager.checkForUpdates(),this._stagingStore.clear(),this._forceRefresh=!0}updateCustomParameters(e){this._streamConnection?.updateCustomParameters(e)}sendMessageToSocket(e){this._streamConnection?.sendMessageToSocket(e)}sendMessageToClient(e){this._streamConnection?.sendMessageToClient(e)}_onOverride(){}_onWebSocketMessage(e){if("type"in e)switch(e.type){case"delete":if(e.objectIds)for(const t of e.objectIds)this._manager.removeById(t);if(e.trackIds)for(const t of e.trackIds)this._manager.removeByTrackId(t);break;case"clear":this.clear()}this.events.emit("message-received",e)}_onFeature(e){try{this._manager.add(e),this.events.emit("data-received",e)}catch(e){}}}var Sc=s(44320),kc=s(79897);let Mc=class extends R.A{constructor(e){super(e),this.debugName="",this._updatingHandles=new kc.U,this._idToUpdatingState=new q.A}destroy(){this._updatingHandles=(0,m.pR)(this._updatingHandles),this._idToUpdatingState.clear()}get updating(){return!this.destroyed&&(this._updatingHandles?.updating||Array.from(this._idToUpdatingState.values()).some(e=>e))}addUpdateTracking(e,t){const s=(0,l.wB)(()=>t.updating,t=>this._idToUpdatingState.set(e,t),{sync:!0});this.addHandles(s)}consumePromise(e){this._updatingHandles.consumePromise(e)}addPromise(e){return this._updatingHandles.addPromise(e)}};(0,E.Cg)([(0,L.MZ)({constructOnly:!0})],Mc.prototype,"debugName",void 0),(0,E.Cg)([(0,L.MZ)({readOnly:!0})],Mc.prototype,"updating",null),Mc=(0,E.Cg)([(0,xc.$)("esri.views.2d.layers.support.UpdateTracking2D")],Mc);class Tc{constructor(e,t,s,i){this._aggregateAdapter=e,this._subscriptions=t,this._connection=s,this._cachedObjectIds=i,this._updateTracking=new Mc({debugName:"FeatureSource"}),this.store=new Sc.I}destroy(){this._strategy?.destroy(),this._streamMessenger?.destroy(),this._updateTracking?.destroy(),this.store.destroy()}get metadata(){return this._strategy.metadata}get streamMessenger(){return null==this._streamMessenger&&this._initStreamMessenger(),this._streamMessenger}get statistics(){return ha.from(this.store)}get updateTracking(){return this._updateTracking}get usedMemory(){return this.store.usedMemory}get queryEngine(){if(!this._queryEngine){if(!this.store||!this._strategy)return null;this._queryEngine=new Wn.do({featureStore:this.store,fieldsIndex:this.metadata.fieldsIndex,geometryType:this.metadata.geometryType,featureIdInfo:this.metadata.featureIdInfo,hasZ:this.metadata.hasZ,hasM:this.metadata.hasM,spatialReference:this.metadata.outSpatialReference,aggregateAdapter:this._aggregateAdapter,timeInfo:this.metadata.timeInfo,definitionExpression:this._strategy?.definitionExpression,availableFields:this._strategy?.availableFields})}return this._queryEngine}get isStream(){return"stream"===this._schema.type}get hasQueryDisplayFilter(){if(!this._schema)return!1;switch(this._schema.type){case"feature":return null!=this._schema.strategy.full.displayFilterInfo;case"parquet":case"stream":return!1}}chunks(){return Array.from(this.store.chunks())}prepareCacheUpdate(e,t){const s=new Set,i=new Set;for(const t of e)this._cachedObjectIds.has(t)||(this._cachedObjectIds.add(t),s.add(t));for(const e of t)this._cachedObjectIds.delete(e),i.add(e);this.hasQueryDisplayFilter&&this._strategy.prepareCacheUpdate(s,i)}async applyCacheUpdate(){this.hasQueryDisplayFilter&&await this._updateTracking.addPromise(this._strategy.applyCacheUpdate())}cleanup(){return this.store.cleanup()}onSubscribe(e){if(this._connection.onEvent({type:"subscribe",tile:e.tile.id}),!this._strategy)return;const t=this._strategy.load(e);t.then(()=>this._connection.onEvent({type:"loaded",tile:e.tile.id})).catch(t=>this._connection.onEvent({type:"error",tile:e.tile.id,error:t})),this._updateTracking.consumePromise(t)}onResume(e){this._updateTracking.consumePromise((0,a.QZ)(this._strategy?.load(e)))}onUnsubscribe(e){this._connection.onEvent({type:"unsubscribe",tile:e.tile.id}),this._strategy?.unload(e)}async applyOverride(e){await(this._strategy?.applyOverride(e))}takeOverrideUpdate(){return this._strategy?.takeOverrideUpdate()}async update(e,t){const s=this._schema;if(this._schema=e,this._queryEngine=(0,m.pR)(this._queryEngine),s&&s.type!==e.type)throw new Error("InternalError: Reconfiguring source types is not supported.");const i=new da;if(!s||(0,_.i8)(s.service,e.service)||s.strategy.type!==e.strategy.type||(0,_.i8)(e.strategy.full,s.strategy.full)||!await this._strategy.tryUpdate(i,e.strategy.partial)){await this._updateStrategyType(this._schema.service,e,t);let s=null;return"postQueryFilter"in this._schema.strategy.full&&this._schema.strategy.full.postQueryFilter&&(s=await Ao.create({geometryType:this.metadata.geometryType,hasM:!1,hasZ:!1,timeInfo:this.metadata.timeInfo,fieldsIndex:this.metadata.fieldsIndex,spatialReference:this.metadata.outSpatialReference,filterJSON:this._schema.strategy.full.postQueryFilter})),await this.store.update({metadata:this.metadata,definitionExpression:this._schema.strategy.full.definitionExpression,postQueryFilter:s}),!0}return i.requiresInvalidation}unsafeSetQueryHistoricMoment(e){"feature"===this._schema.type&&(this._schema.strategy.full.historicMoment=e,this._strategy.unsafeSetQueryHistoricMoment(new Date(e)))}_initStreamMessenger(){null==this._streamMessenger&&(this._streamMessenger=new ua(this._connection))}async normalizeOverrides(e){const t={historicMoment:e.historicMoment,commands:{updateWeak:e.commands.updateWeak.map(Bn.Om.fromJSON),removeWeak:e.commands.removeWeak,update:e.commands.update.map(Bn.Om.fromJSON),remove:e.commands.remove,release:e.commands.release}},s=e.commands.updateByIdWeak,i=await this._queryOptimizedFeatures(s);if(i.length!==s.length){const e=new Set(i.map(e=>e.objectId));for(const i of s)e.has(i)||t.commands.removeWeak.push(i)}return t.commands.updateWeak.push(...i),t}async _queryOptimizedFeatures(e){if(0===e.length)return[];const t=[],s=(await this._strategy.queryByObjectId(e,["*"])).getCursor();for(;s.next();)t.push(s.readOptimizedFeatureWorldSpace());return t}getObjectIdsFromGlobalIds(e){const t=this.metadata.globalIdField;if(null==t)throw new Error("InternalError: Recieved an edit with globalIds, but not supported by the service");const s=this.store.mapObjectIdsFromGlobalIds(e,t).values();return Array.from(s)}async _updateStrategyType(e,t,s){const i=this._createStrategy(e,t);this._connection.onEvent({type:"updateStrategyStart",about:i.about});const r=!!this._strategy;this.store.clear(),this._strategy?.destroy(),this._strategy=i,(0,n.A)("esri-2d-update-debug")&&console.debug(`Version[${s}] FeatureSource.updateStrategy`,{strategy:i});const o=Array.from(this._subscriptions.values());if(!o.length)return void this._connection.onEvent({type:"updateStrategyEnd"});const c=Promise.all(o.map(e=>this._strategy.load(e).then(()=>this._connection.onEvent({type:"loaded",tile:e.tile.id})).catch(t=>this._connection.onEvent({type:"error",tile:e.tile.id,error:t}))));this._updateTracking.consumePromise(c),this._strategy.prepareCacheUpdate(this._cachedObjectIds);try{r&&await c}catch(e){(0,a.jH)(e)}this._connection.onEvent({type:"updateStrategyEnd"}),(0,n.A)("esri-2d-update-debug")&&console.debug(`Version[${s}] FeatureSource.updateStrategyEnd`,{strategy:i})}_createStrategy(e,t){const s={connection:this._connection,store:this.store};switch(t.type){case"feature":return this._createFeatureLoadStrategy(e,t.strategy,s);case"parquet":return this._createParquetLoadStrategy(e,t.strategy,s);case"stream":return this._createStreamLoadStrategy(e,t.strategy,s)}}_createFeatureLoadStrategy(e,t,s){switch(t.type){case"drill-down":return new Ka(e,t,s);case"hybrid-tile":return new ic(e,t,s);case"paged-tile":return new nc(e,t,s);case"snapshot":return new oc(e,t,s)}}_createParquetLoadStrategy(e,t,s){switch(t.type){case"xz":return new fc(e,t,s,this._connection);case"snapshot":return new uc(e,t,s,this._connection)}}_createStreamLoadStrategy(e,t,s){const i=new Ic(e,t,s);return this.streamMessenger.strategy=i,i}}class Ac{constructor(e,t){this.tile=e,this.version=t,this._abortController=new AbortController}get key(){return this.tile.key}get signal(){return this._abortController.signal}abort(){this._abortController.abort()}}var Pc=s(98291);class Cc{constructor(e,t){this.key=new b.A(0,0,0,0),this.bounds=(0,Y.vt)(),this.objectIds=new Set,this.key.set(t);const s=e.getLODInfoAt(this.key);this.tileInfoView=e,this.tileInfoView.getTileBounds(this.bounds,this.key,!0),this.resolution=s.resolution,this.level=s.level,this.scale=s.scale,this.minScale=e.zoomToScale(s.level-1),this.maxScale=e.zoomToScale(s.level+1)}get lod(){return this.tileInfoView.getLODInfoAt(this.key)}get id(){return this.key.id}get extent(){const[e,t,s,i]=this.bounds;return{xmin:e,ymin:t,xmax:s,ymax:i}}get hydratedExtent(){return(0,Y.w1)(this.bounds,this.tileInfoView.spatialReference)}get transform(){return{originPosition:"upperLeft",scale:[this.resolution,this.resolution],translate:[this.bounds[0],this.bounds[3]]}}get normalizedTransform(){return(0,g.Q1)(this.transform)}createArcadeEvaluationOptions(e){return(0,Bo.N)(this.scale,e)}createChildTiles(){const e=this.key.getChildKeys(),t=Pc.A.acquire();for(let s=0;s<e.length;s++)t[s]=new Cc(this.tileInfoView,e[s]);return t}getQuantizationParameters(){return Ja.A.fromJSON({mode:"view",originPosition:"upperLeft",tolerance:this.resolution,extent:{xmin:this.bounds[0],ymin:this.bounds[1],xmax:this.bounds[2],ymax:this.bounds[3],spatialReference:this.tileInfoView.spatialReference}})}}class Fc{constructor(e){this.inner=e,this.resolver=Promise.withResolvers()}}class Ec{constructor(){this._aggregateAdapter={getFeatureObjectIds:e=>this._processor.getFeatureObjectIdsForAggregate(e)},this._subscriptions=new Map,this._cachedObjectIds=new Set,this._updateRequested=!1,this._didSourceRefresh=!1,this._refreshRequested=!0,this._updateSubscriptionRequests=[],this._updateHighlightRequests=[]}destroy(){this._subscriptions.clear(),this._processor?.destroy(),this._source?.destroy(),this._handles?.remove(),this._updateOverridesRequest=null,this._tileInfoView=null}onAttach(e){(0,n.A)("esri-2d-update-debug")&&console.debug("Pipeline.onAttach");const t=this._connection,s=d.A.fromJSON(e.tileInfoJSON);this._tileInfoView=new F(s),this._viewExtent=e.initialViewExtent,this._source=new Tc(this._aggregateAdapter,this._subscriptions,t,this._cachedObjectIds),this._processor=new ca(t,this._source),this._handles=(0,r.vE)([this._source.store.events.on("changed",()=>this._requestUpdate()),this._source.store.events.on("refresh",()=>this._requestRefresh()),(0,l.wB)(()=>this._source.updateTracking.updating,()=>{this._requestUpdate(),(0,a.QZ)(this._connection.layerView.setUpdating({source:this._source.updateTracking.updating,pipeline:!0}))})])}onDetach(){(0,n.A)("esri-2d-update-debug")&&console.debug("Pipeline.onDetach"),this.destroy()}set remoteClient(e){this._connection=new f(e)}get features(){const e=this._source?.queryEngine;if(!e)throw new i.A("no-queryEngine","No query engine defined");return e}get aggregates(){const e=this._processor?.aggregateQueryEngine;if(!e)throw new i.A("no-queryEngine","No aggregate query engine defined");return e}get streamMessenger(){return this._source.streamMessenger}getUsedMemory(){return this._source.usedMemory+this._processor.usedMemory}getDisplayFeatures(e){return this._processor.getDisplayFeatures(e)}getDisplayIds(e){return this._processor.getDisplayIds(e)}getObjectIdsFromGlobalIds(e){return this._source.getObjectIdsFromGlobalIds(e)}updateStationaryExtent(e,t){t&&(this._refreshRequested=!0,this._requestUpdate()),this._viewExtent=e}async updateSchema(e){return(0,n.A)("esri-2d-update-debug")&&this._updateSchemaRequest&&console.error("InternalError: Schema already updating"),this._updateSchemaRequest=new Fc({version:e}),this._requestUpdate(),this._updateSchemaRequest.resolver.promise}updateSubscriptions(e){const t=new Fc(e);return this._updateSubscriptionRequests.push(t),this._requestUpdate(),t.resolver.promise}updateHighlight(e){const t=new Fc(e);return this._updateHighlightRequests.push(t),this._requestUpdate(),t.resolver.promise}async onOverride(e){if(null!=this._updateOverridesRequest)throw new i.A("featurelayer","InternalError - Already processing an edit");this._updateOverridesRequest=new Fc(e);const t=this._updateOverridesRequest.resolver.promise;return this._requestUpdate(),t}queryStatistics(){return this._source.statistics.toJSON()}async queryVisibleFeatures(e,t){return this.features.executeQuery(e,t)}async queryHeatmapStatistics(e){const t=Math.round((0,h.Lz)(e.radius));let s=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;const r="string"==typeof e.fieldOffset,n=e.fieldOffset??0,o=Array.from(this._subscriptions.values()),a=this._source.chunks(),c=t**2,l=3/(Math.PI*c),u=2*t,d=Math.ceil(p.CQ/u);for(const t of o){const o=t.tile,h=new Float64Array(d*d);for(const t of a){const s=t.getTileReader(o);if(!s)continue;const i=s.getCursor();for(;i.next();){let t=1;if(null!=e.field){const s=i.readAttribute(e.field);t=r?-1*+s:+s+n}const s=i.readXForDisplay()/u,o=i.readYForDisplay()/u,a=Math.floor(s),p=Math.floor(o);if(a<0||p<0||a>=d||p>=d)continue;const f=((.5+a-s)*u)**2+((.5+p-o)*u)**2;if(f>c)continue;const m=t*(l*(1-f/c)**2);h[p+a*d]+=m}}for(let e=0;e<h.length;e++)s=Math.min(s,h[e]),i=Math.max(i,h[e])}return{max:i,min:s}}async getSampleFeatures(e){const t=this._source.chunks();if(t.reduce((e,t)=>e+t.size(),0)<=e.minFeatureCount){if(!this._source.updateTracking.updating){const e=[];return this._source.store.forEachUnsafe(t=>e.push(t.readLegacyFeatureWorldSpace())),e}return null}const s=new Set,i=[],r=t.map(e=>e.reader.getCursor()),n=new c.A,o=3*e.sampleSize;for(let a=0;a<o&&i.length<e.sampleSize;a++){const e=r[n.getIntRange(0,t.length-1)];if(0===e.getSize())continue;const o=n.getIntRange(0,e.getSize()-1);e.setIndex(o);const a=e.getObjectId();s.has(a)||(s.add(a),i.push(e.readLegacyFeatureWorldSpace()))}return i.length>=e.sampleSize?i:null}_requestUpdate(){this._updateRequested||(this._updateRequested=!0,(0,o.d)(()=>this._scheduleNextUpdate()))}_requestRefresh(){this._didSourceRefresh=!0,this._requestUpdate()}_scheduleNextUpdate(){this._updateRequested&&(this._ongoingUpdate||(this._ongoingUpdate=(0,u.oV)(this._doUpdate()).finally(()=>{this._ongoingUpdate=null,this._scheduleNextUpdate()}),this._updateRequested=!1))}_subscribe(e){const t=e.tileId;if(this._subscriptions.has(t))return;(0,n.A)("esri-2d-update-debug")&&console.debug(`Tile[${t}] Pipeline.subscribe`);const s=new Cc(this._tileInfoView,t),i=new Ac(s,e.version);this._subscriptions.set(t,i),this._source.onSubscribe(i),this._processor.onSubscribe(i)}_unsubscribe(e){const t=this._subscriptions.get(e);t&&((0,n.A)("esri-2d-update-debug")&&console.debug(`Tile[${e}] Pipeline.unsubscribe`),t.abort(),this._source.onUnsubscribe(t),this._processor.onUnsubscribe(t),this._subscriptions.delete(t.key.id))}async _doUpdate(){if((0,n.A)("esri-2d-update-debug")&&console.debug("Pipeline._doUpdateStart"),await this._connection.layerView.setUpdating({source:this._source.updateTracking.updating,pipeline:!0}),this._updateSubscriptionRequests.length){const e=this._updateSubscriptionRequests;this._updateSubscriptionRequests=[];for(const t of e)this._doUpdateSubscriptions(t.inner),t.resolver.resolve()}if(this._updateHighlightRequests.length){const e=this._updateHighlightRequests,t=new Set,s=new Set;for(const i of e)for(const{objectId:e,highlightFlags:r}of i.inner.highlights)r?(t.add(e),s.delete(e)):(s.add(e),t.delete(e));this._source.prepareCacheUpdate(t,s)}const e=this._updateSchemaRequest;this._updateSchemaRequest=null;let t=!1;if(null!=e){const{version:s}=e.inner,i=await this._connection.layerView.updateSchemaStart();i&&(t=await this._doUpdateSchema(i,s))}const s=this._updateOverridesRequest;if(this._updateOverridesRequest=null,null!=s){(0,n.A)("esri-2d-update-debug")&&console.debug("Pipeline.applyOverride",s.inner),null!=s.inner.historicMoment&&this._source.unsafeSetQueryHistoricMoment(s.inner.historicMoment);const e=await this._source.normalizeOverrides(s.inner);await this._source.applyOverride(e),(0,n.A)("esri-2d-update-debug")&&console.debug("Pipeline.endOverride",s.inner)}await this._source.applyCacheUpdate();const i=this._source.chunks(),r=this._source.updateTracking.updating;if(this._processor.requiresInvalidation(i)&&(t=!0),this._didSourceRefresh&&(t=!0,this._didSourceRefresh=!1),this._refreshRequested&&(this._refreshRequested=!1,t=!0),t&&(this._processor.invalidate(),await this._connection.container.updateRenderState(this._processor.version)),this._updateHighlightRequests.length){const e=this._updateHighlightRequests;this._updateHighlightRequests=[];for(const t of e)this._processor.updateHighlight(t.inner),t.resolver.resolve()}const o=this._source.cleanup();this._processor.removeChunks(o);try{const e=this._source.takeOverrideUpdate();if(null!=e&&this._subscriptions.size){(0,n.A)("esri-2d-update-debug")&&console.debug("Pipeline.applyOverrideChangesStart"),await this._connection.container.lockForOverrides();try{await this._processor.applyOverrideUpdate(e,this._viewExtent)}catch(e){(0,n.A)("esri-2d-update-debug")&&console.debug("InternalError",e)}await this._connection.container.unlockForOverrides(),(0,n.A)("esri-2d-update-debug")&&console.debug("Pipeline.applyOverrideChangesEnd")}this._subscriptions.size&&((0,n.A)("esri-2d-update-debug")&&console.debug("Pipeline.updateChunksStart"),await this._processor.updateChunks(i,r,this._viewExtent),(0,n.A)("esri-2d-update-debug")&&console.debug("Pipeline.updateChunksEnd"))}catch(e){(0,a.jH)(e)}e?await this._connection.layerView.updateSchemaEnd(t):t&&await this._connection.container.swapRenderState(),null!=s&&s.resolver.resolve(),null!=e&&e.resolver.resolve(),this._connection.onEvent({type:"performance",usedMemory:this.getUsedMemory()}),this._updateRequested?((0,n.A)("esri-2d-update-debug")&&console.debug("Pipeline._doUpdateEnd [updateRequested=true]"),await this._connection.layerView.setUpdating({source:this._source.updateTracking.updating,pipeline:!0})):((0,n.A)("esri-2d-update-debug")&&console.debug("Pipeline._doUpdateEnd [updateRequested=false, After flush]"),await this._connection.layerView.setUpdating({source:this._source.updateTracking.updating,pipeline:this._updateRequested}))}async _doUpdateSchema(e,t){(0,n.A)("esri-2d-update-debug")&&console.debug(`Version[${t}] Pipeline.updateStart`,{schema:e});const s={tileInfo:this._tileInfoView?.tileInfo},i=await this._source.update(e.source,t),r=Array.from(this._subscriptions.values()),o=this._processor.update(e,t,s,i,r);return(0,n.A)("esri-2d-update-debug")&&console.debug(`Version[${t}] Pipeline.updateEnd`),o}_doUpdateSubscriptions(e){(0,n.A)("esri-2d-update-debug")&&console.debug("Pipeline.updateSubscriptions",e);for(const t of e.subscribe)this._subscribe(t);for(const t of e.unsubscribe)this._unsubscribe(t)}}},44159(e,t,s){s.d(t,{A:()=>r});var i=s(93687);class r{static{this.pool=new i.A(()=>new r(""),null,null,25,50)}static getId(e,t,s,i){return"object"==typeof e?`${e.level}/${e.row}/${e.col}/${e.world}`:`${e}/${t}/${s}/${i}`}constructor(e,t,s,i){this.set(e,t,s,i)}get key(){return this}get id(){return this.toString()}get normalizedId(){return`${this.level}/${this.row}/${this.col}`}set id(e){this.set(e)}get hash(){const e=4095&this.row,t=4095&this.col,s=63&this.level;return(3&this.world)<<30|t<<22|e<<8|s}acquire(e,t,s,i){this.set(e,t,s,i)}contains(e){const t=e.level-this.level;return t>=0&&this.row===e.row>>t&&this.col===e.col>>t&&this.world===e.world}containsChild(e){const t=e.level-this.level;return t>0&&this.row===e.row>>t&&this.col===e.col>>t&&this.world===e.world}equals(e){return this.level===e.level&&this.row===e.row&&this.col===e.col&&this.world===e.world}clone(){return new r(this)}release(){this.level=0,this.row=0,this.col=0,this.world=0}set(e,t,s,i){if(null==e)this.level=0,this.row=0,this.col=0,this.world=0;else if("object"==typeof e)this.level=e.level||0,this.row=e.row||0,this.col=e.col||0,this.world=e.world||0;else if("string"==typeof e){const[t,s,i,r]=e.split("/");this.level=parseFloat(t),this.row=parseFloat(s),this.col=parseFloat(i),this.world=parseFloat(r)}else this.level=+e,this.row=+t,this.col=+s,this.world=+i||0;return this}toString(){return`${this.level}/${this.row}/${this.col}/${this.world}`}getParentKey(){return this.level<=0?null:new r(this.level-1,this.row>>1,this.col>>1,this.world)}getNormalizedNeighbor(e,t,s){const i=this.clone();return i.col+=e,i.row+=t,s.normalizeKey(i),i}getChildKeys(){const e=this.level+1,t=this.row<<1,s=this.col<<1,i=this.world;return[new r(e,t,s,i),new r(e,t,s+1,i),new r(e,t+1,s,i),new r(e,t+1,s+1,i)]}compareRowMajor(e){return this.row<e.row?-1:this.row>e.row?1:this.col<e.col?-1:this.col>e.col?1:0}}}}]);
|