@arcgis/core 4.28.0-next.20231003 → 4.28.0-rc.0

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.
Files changed (211) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/02120d192eafd7612475.js +1 -0
  3. package/assets/esri/core/workers/chunks/0beebbb0c6dad0e742d7.js +1 -0
  4. package/assets/esri/core/workers/chunks/112e89da628bdea5355c.js +1 -0
  5. package/assets/esri/core/workers/chunks/{5e9edd06e624f385fa4b.js → 121a9e148509f2fe2210.js} +1 -1
  6. package/assets/esri/core/workers/chunks/1856d16d738f44f58084.js +1 -0
  7. package/assets/esri/core/workers/chunks/{0526d623d0b4c12929bd.js → 18ab9cc85a1a7988fdfd.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{7c960a2694c4c3123acf.js → 1a36703ebe934749646e.js} +1 -1
  9. package/assets/esri/core/workers/chunks/24a0cf405195421c0d06.js +1 -0
  10. package/assets/esri/core/workers/chunks/24ff267cf253feac22de.js +1 -0
  11. package/assets/esri/core/workers/chunks/{3c8613596659801fd6ab.js → 29cab345819ec02ed60a.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{169a61c6e128b8a16021.js → 2c560a075d9ef2069ed1.js} +1 -1
  13. package/assets/esri/core/workers/chunks/2f8e71dac98135bbc3e6.js +1 -0
  14. package/assets/esri/core/workers/chunks/341fb51b2165522963b3.js +1 -0
  15. package/assets/esri/core/workers/chunks/{ad8e0f82cb1feafa9e2f.js → 36ab90fb34b9716a9983.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{2688213bbff536da7917.js → 3ea0b872436fce84b927.js} +1 -1
  17. package/assets/esri/core/workers/chunks/40633064c290dc2af9ea.js +1 -0
  18. package/assets/esri/core/workers/chunks/42ec4c80b0c2944cd65c.js +1 -0
  19. package/assets/esri/core/workers/chunks/44b870cb53ba68b17c32.js +1 -0
  20. package/assets/esri/core/workers/chunks/{8a7fa4e8b0d14da7c9eb.js → 4cc680fe4c9c39d2f853.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{6730c9f0890191a95fdb.js → 4d81aa50d90f5701a343.js} +1 -1
  22. package/assets/esri/core/workers/chunks/4e0bf30da4281070e453.js +1 -0
  23. package/assets/esri/core/workers/chunks/4e6bf1efe3b0b474cbb4.js +1 -0
  24. package/assets/esri/core/workers/chunks/52cef7cd3aaaa4f45c94.js +1 -0
  25. package/assets/esri/core/workers/chunks/5e907ec0ee1565b5fbbc.js +1 -0
  26. package/assets/esri/core/workers/chunks/66ba749ab0a631bbfdec.js +1 -0
  27. package/assets/esri/core/workers/chunks/6b14d89d689a21014aec.js +1 -0
  28. package/assets/esri/core/workers/chunks/6b1856303d1562f05100.js +1 -0
  29. package/assets/esri/core/workers/chunks/{576269fd1f9049876aa1.js → 6b7b5544ed1f9a84623f.js} +1 -1
  30. package/assets/esri/core/workers/chunks/710a6268de62003af825.js +1 -0
  31. package/assets/esri/core/workers/chunks/77923afde29ae1ff10ca.js +1 -0
  32. package/assets/esri/core/workers/chunks/784ffd52315a4d55d683.js +1 -0
  33. package/assets/esri/core/workers/chunks/7cf7f2b991a7cbdad2ce.js +1 -0
  34. package/assets/esri/core/workers/chunks/{70dffbf49b0633b1a5f1.js → 8f3680fee85a05839489.js} +1 -1
  35. package/assets/esri/core/workers/chunks/97aecf210938015cc7a3.js +1 -0
  36. package/assets/esri/core/workers/chunks/{c7ebd5d431fb996bfcee.js → 9f8207c82a17508a87a8.js} +1 -1
  37. package/assets/esri/core/workers/chunks/{557305b91f77569ce664.js → a01ffe03b1465c21b9e6.js} +1 -1
  38. package/assets/esri/core/workers/chunks/a298c9031962951e55a9.js +1 -0
  39. package/assets/esri/core/workers/chunks/{329669a9beda89b028dd.js → a5a7bbdd8298016535bc.js} +1 -1
  40. package/assets/esri/core/workers/chunks/a877a4826cd6a46ec99b.js +1 -0
  41. package/assets/esri/core/workers/chunks/ad38e456a7cee940a165.js +1 -0
  42. package/assets/esri/core/workers/chunks/adfbc168be8c49b51e1b.js +1 -0
  43. package/assets/esri/core/workers/chunks/b0526633a93ef69ec47b.js +1 -0
  44. package/assets/esri/core/workers/chunks/b99bc08a01e9250b0a31.js +1 -0
  45. package/assets/esri/core/workers/chunks/{36c4b4c3eca57417da2c.js → c260ad3434bb00ba64a7.js} +1 -1
  46. package/assets/esri/core/workers/chunks/{39922ce232338de076ae.js → c459c8d8630eb4b955b1.js} +1 -1
  47. package/assets/esri/core/workers/chunks/c92e75b79aff7b505b31.js +1 -0
  48. package/assets/esri/core/workers/chunks/ca85e88dad30b5f2956b.js +1 -0
  49. package/assets/esri/core/workers/chunks/{8e56d40691b6bf75d7cc.js → ce409944221a784ddb61.js} +1 -1
  50. package/assets/esri/core/workers/chunks/d13f75f233cf313e5a1d.js +1 -0
  51. package/assets/esri/core/workers/chunks/d60d5f006375f7fcc88c.js +1 -0
  52. package/assets/esri/core/workers/chunks/{77958089748dc31757cf.js → d6ded127949160103f69.js} +1 -1
  53. package/assets/esri/core/workers/chunks/d8c696da42f8f8919b83.js +1 -0
  54. package/assets/esri/core/workers/chunks/{304c81f6297ecba3a324.js → d95eed98316e59f8f35d.js} +1 -1
  55. package/assets/esri/core/workers/chunks/df7267892b6e0493e1d7.js +1 -0
  56. package/assets/esri/core/workers/chunks/{52dca349e1a45555954d.js → e52d5a48e83d8df36f92.js} +1 -1
  57. package/assets/esri/core/workers/chunks/e8688b6cc3b3c1010b43.js +1 -0
  58. package/assets/esri/core/workers/chunks/e8c7cc974420c0b92d0e.js +1 -0
  59. package/assets/esri/core/workers/chunks/{b6847d68c35e7dbf6004.js → e93442c6d92229f3a4b0.js} +1 -1
  60. package/assets/esri/core/workers/chunks/f2718e260f594537f7fd.js +1 -0
  61. package/assets/esri/core/workers/chunks/f6b7036114b1d754fdd9.js +1 -0
  62. package/assets/esri/core/workers/chunks/{c4631241dc777ca77aaa.js → f6c0680c535c5a3c73ee.js} +1 -1
  63. package/assets/esri/core/workers/chunks/fac3e57784d7f37053af.js +1 -0
  64. package/assets/esri/t9n/common.json +1 -1
  65. package/assets/esri/t9n/common_ar.json +1 -1
  66. package/assets/esri/t9n/common_bg.json +1 -1
  67. package/assets/esri/t9n/common_bs.json +1 -1
  68. package/assets/esri/t9n/common_ca.json +1 -1
  69. package/assets/esri/t9n/common_cs.json +1 -1
  70. package/assets/esri/t9n/common_da.json +1 -1
  71. package/assets/esri/t9n/common_de.json +1 -1
  72. package/assets/esri/t9n/common_el.json +1 -1
  73. package/assets/esri/t9n/common_en.json +1 -1
  74. package/assets/esri/t9n/common_es.json +1 -1
  75. package/assets/esri/t9n/common_et.json +1 -1
  76. package/assets/esri/t9n/common_fi.json +1 -1
  77. package/assets/esri/t9n/common_fr.json +1 -1
  78. package/assets/esri/t9n/common_he.json +1 -1
  79. package/assets/esri/t9n/common_hr.json +1 -1
  80. package/assets/esri/t9n/common_hu.json +1 -1
  81. package/assets/esri/t9n/common_id.json +1 -1
  82. package/assets/esri/t9n/common_it.json +1 -1
  83. package/assets/esri/t9n/common_ja.json +1 -1
  84. package/assets/esri/t9n/common_ko.json +1 -1
  85. package/assets/esri/t9n/common_lt.json +1 -1
  86. package/assets/esri/t9n/common_lv.json +1 -1
  87. package/assets/esri/t9n/common_nb.json +1 -1
  88. package/assets/esri/t9n/common_nl.json +1 -1
  89. package/assets/esri/t9n/common_pl.json +1 -1
  90. package/assets/esri/t9n/common_pt-BR.json +1 -1
  91. package/assets/esri/t9n/common_pt-PT.json +1 -1
  92. package/assets/esri/t9n/common_ro.json +1 -1
  93. package/assets/esri/t9n/common_ru.json +1 -1
  94. package/assets/esri/t9n/common_sk.json +1 -1
  95. package/assets/esri/t9n/common_sl.json +1 -1
  96. package/assets/esri/t9n/common_sr.json +1 -1
  97. package/assets/esri/t9n/common_sv.json +1 -1
  98. package/assets/esri/t9n/common_th.json +1 -1
  99. package/assets/esri/t9n/common_tr.json +1 -1
  100. package/assets/esri/t9n/common_uk.json +1 -1
  101. package/assets/esri/t9n/common_vi.json +1 -1
  102. package/assets/esri/t9n/common_zh-CN.json +1 -1
  103. package/assets/esri/t9n/common_zh-HK.json +1 -1
  104. package/assets/esri/t9n/common_zh-TW.json +1 -1
  105. package/assets/esri/themes/base/widgets/_DirectionalPad.scss +2 -1
  106. package/assets/esri/themes/base/widgets/_FeatureForm.scss +0 -1
  107. package/assets/esri/themes/dark/main.css +1 -1
  108. package/assets/esri/themes/light/main.css +1 -1
  109. package/assets/esri/themes/light/view.css +1 -1
  110. package/config.js +1 -1
  111. package/core/pbf.js +1 -1
  112. package/interfaces.d.ts +0 -32
  113. package/kernel.js +1 -1
  114. package/layers/GroupLayer.js +1 -1
  115. package/layers/SceneLayer.js +1 -1
  116. package/layers/graphics/editingSupport.js +1 -1
  117. package/layers/graphics/sources/WFSSourceWorker.js +1 -1
  118. package/layers/graphics/sources/geojson/GeoJSONSourceWorker.js +1 -1
  119. package/layers/graphics/sources/support/CSVSourceWorker.js +1 -1
  120. package/layers/graphics/sources/support/MemorySourceWorker.js +1 -1
  121. package/layers/mixins/OperationalLayer.js +1 -1
  122. package/layers/save/featureLayerUtils.js +1 -1
  123. package/layers/save/groupLayerUtils.js +5 -0
  124. package/layers/save/utils.js +1 -1
  125. package/layers/support/LayerLoadContext.js +5 -0
  126. package/layers/support/featureLayerUtils.js +1 -1
  127. package/layers/support/labelFormatUtils.js +1 -1
  128. package/layers/support/layersCreator.js +1 -1
  129. package/package.json +1 -1
  130. package/portal/schemas/definitions.js +1 -1
  131. package/portal/support/jsonContext.js +1 -1
  132. package/portal/support/layersLoader.js +1 -1
  133. package/portal/support/loadUtils.js +5 -0
  134. package/portal/support/portalItemUtils.js +1 -1
  135. package/portal/support/portalLayers.js +1 -1
  136. package/renderers/support/RasterSymbolizer.js +1 -1
  137. package/support/basemapUtils.js +1 -1
  138. package/support/revision.js +1 -1
  139. package/symbols/PolygonSymbol3D.js +1 -1
  140. package/views/2d/engine/imagery/RasterBitmap.js +1 -1
  141. package/views/2d/engine/imagery/colorizer/shadedrelief.js +1 -1
  142. package/views/2d/engine/imagery/colorizer/stretch.js +1 -1
  143. package/views/2d/input/handlers/KeyPan.js +1 -1
  144. package/views/2d/input/handlers/KeyRotate.js +1 -1
  145. package/views/2d/layers/features/support/FeatureSetReader.js +1 -1
  146. package/views/2d/layers/features/support/FeatureSetReaderPBFIndirect.js +1 -1
  147. package/views/3d/input/handlers/KeyboardNavigation.js +1 -1
  148. package/views/3d/interactive/visualElements/LineVisualElement.js +1 -1
  149. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  150. package/views/3d/layers/graphics/Graphics3DMeshObject3DGraphicLayer.js +1 -1
  151. package/views/3d/layers/i3s/featureEditing.js +1 -1
  152. package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
  153. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  154. package/views/DOMContainer.js +1 -1
  155. package/views/input/VisibilityChange.js +5 -0
  156. package/webdoc/support/saveUtils.js +1 -1
  157. package/webdoc/webdocSaveUtils.js +1 -1
  158. package/widgets/DirectionalPad/DirectionalPadViewModel.js +1 -1
  159. package/widgets/DirectionalPad/constants.js +1 -1
  160. package/widgets/DirectionalPad.js +1 -1
  161. package/widgets/FeatureForm/FieldInput.js +1 -1
  162. package/widgets/FeatureForm/featureFormUtils.js +1 -1
  163. package/widgets/FeatureForm.js +1 -1
  164. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  165. package/widgets/FeatureTable/FieldColumn.js +1 -1
  166. package/widgets/support/dateUtils.js +1 -1
  167. package/assets/esri/core/workers/chunks/027f8b57565c65fbccda.js +0 -1
  168. package/assets/esri/core/workers/chunks/048265fb5953350e3e33.js +0 -1
  169. package/assets/esri/core/workers/chunks/0b9cf14f8aafb76c578b.js +0 -1
  170. package/assets/esri/core/workers/chunks/10fd951bd296b2beeeba.js +0 -1
  171. package/assets/esri/core/workers/chunks/1224475f3eefdfd59c76.js +0 -1
  172. package/assets/esri/core/workers/chunks/162b0220e24e9ba72655.js +0 -1
  173. package/assets/esri/core/workers/chunks/1e611cad53b745ee146f.js +0 -1
  174. package/assets/esri/core/workers/chunks/29ed31fd4f9d5cf53686.js +0 -1
  175. package/assets/esri/core/workers/chunks/2b6d1c8e4ed759767827.js +0 -1
  176. package/assets/esri/core/workers/chunks/34b44b0fab88f838885c.js +0 -1
  177. package/assets/esri/core/workers/chunks/364f55294a1d7bf163d7.js +0 -1
  178. package/assets/esri/core/workers/chunks/3714ab435dd5ccf9e694.js +0 -1
  179. package/assets/esri/core/workers/chunks/3788009a5ece453011f3.js +0 -1
  180. package/assets/esri/core/workers/chunks/3aafe8160b3bfbaa6935.js +0 -1
  181. package/assets/esri/core/workers/chunks/3e6255ab48b561af131e.js +0 -1
  182. package/assets/esri/core/workers/chunks/41c002e4c42c581cda8d.js +0 -1
  183. package/assets/esri/core/workers/chunks/47be4c75dd6372b96fe4.js +0 -1
  184. package/assets/esri/core/workers/chunks/4e8d1e6051f6654a5e83.js +0 -1
  185. package/assets/esri/core/workers/chunks/53746e9976758630159b.js +0 -1
  186. package/assets/esri/core/workers/chunks/5449fdd69e12e5cbd12a.js +0 -1
  187. package/assets/esri/core/workers/chunks/57ce4ece0147afb0d43c.js +0 -1
  188. package/assets/esri/core/workers/chunks/5e83d21400a5dec05c81.js +0 -1
  189. package/assets/esri/core/workers/chunks/6047f4487dcd37cca98e.js +0 -1
  190. package/assets/esri/core/workers/chunks/6967d2b3721678b38774.js +0 -1
  191. package/assets/esri/core/workers/chunks/6ac5ca7de651e3d672a1.js +0 -1
  192. package/assets/esri/core/workers/chunks/6b7ee9164149428edb9e.js +0 -1
  193. package/assets/esri/core/workers/chunks/6c495077cc79e1898927.js +0 -1
  194. package/assets/esri/core/workers/chunks/6d43648d5326e01b4474.js +0 -1
  195. package/assets/esri/core/workers/chunks/74fb07de0f990d45af89.js +0 -1
  196. package/assets/esri/core/workers/chunks/8e9a52062ce059153a89.js +0 -1
  197. package/assets/esri/core/workers/chunks/919a57d372419785cd5e.js +0 -1
  198. package/assets/esri/core/workers/chunks/939f0a1a7d605e389e45.js +0 -1
  199. package/assets/esri/core/workers/chunks/9932f23ba6589df14a3d.js +0 -1
  200. package/assets/esri/core/workers/chunks/a25a38c9f338e0beffef.js +0 -1
  201. package/assets/esri/core/workers/chunks/a97581e584336b46ede7.js +0 -1
  202. package/assets/esri/core/workers/chunks/b04eb35e06b1c5759ad0.js +0 -1
  203. package/assets/esri/core/workers/chunks/b1cb932cfadc4dc3f1e4.js +0 -1
  204. package/assets/esri/core/workers/chunks/be3fb6113b0b27b94537.js +0 -1
  205. package/assets/esri/core/workers/chunks/c37119f5692e19aa1ce2.js +0 -1
  206. package/assets/esri/core/workers/chunks/c685f16435d9861bbbd0.js +0 -1
  207. package/assets/esri/core/workers/chunks/e6416a2684866d677b3e.js +0 -1
  208. package/assets/esri/core/workers/chunks/eb01f4cdb9b918cc61e7.js +0 -1
  209. package/assets/esri/core/workers/chunks/eb4aed4fdb44495a4fe6.js +0 -1
  210. package/assets/esri/core/workers/chunks/ec8258c9dc1491e97fc8.js +0 -1
  211. package/assets/esri/core/workers/chunks/eeac53da496de4cd4182.js +0 -1
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{urlToObject as r}from"../../core/urlUtils.js";import t from"../Portal.js";function e(e){return{origin:"portal-item",url:r(e.itemUrl),portal:e.portal||t.getDefault(),portalItem:e,readResourcePaths:[]}}function o(e){return{origin:"portal-item",messages:[],writtenProperties:[],url:e.itemUrl?r(e.itemUrl):null,portal:e.portal||t.getDefault(),portalItem:e}}export{e as createForItemRead,o as createForItemWrite};
5
+ import{urlToObject as t}from"../../core/urlUtils.js";import r from"../Portal.js";function e(e){return{origin:"portal-item",url:t(e.itemUrl),portal:e.portal||r.getDefault(),portalItem:e,readResourcePaths:[]}}function l(e){return{origin:"portal-item",messages:[],writtenProperties:[],url:e.itemUrl?t(e.itemUrl):null,portal:e.portal||r.getDefault(),portalItem:e}}function o(e){return{origin:"web-map",url:t(e.itemUrl),portal:e.portal||r.getDefault(),portalItem:e,readResourcePaths:[]}}function a(e){return{origin:"web-map",messages:[],writtenProperties:[],url:e.itemUrl?t(e.itemUrl):null,portal:e.portal||r.getDefault(),portalItem:e}}export{o as createForGroupLayerItemRead,a as createForGroupLayerItemWrite,e as createForItemRead,l as createForItemWrite};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../core/Error.js";import{parse as t}from"../../layers/support/arcgisLayerUrl.js";import{findAssociatedFeatureService as r}from"../../layers/support/associatedFeatureServiceUtils.js";import{fetchFeatureService as a}from"../../layers/support/fetchService.js";import{layerLookupMap as n}from"../../layers/support/lazyLayerLoader.js";import s from"../Portal.js";import{createForItemRead as l}from"./jsonContext.js";import{loadStyleRenderer as o}from"../../renderers/support/styleUtils.js";import{fetchArcGISServiceJSON as i}from"../../support/requestPresets.js";class c{constructor(){this._serviceMetadatas=new Map}async fetchServiceMetadata(e,t){const r=this._serviceMetadatas.get(e);if(r)return r;const a=await i(e,t);return this._serviceMetadatas.set(e,a),a}}async function u(e,t){const r=e.instance.portalItem;if(r?.id)return await r.load(t),p(e),y(e,t)}function p(t){const r=t.instance.portalItem;if(!r?.type||!t.supportedTypes.includes(r.type))throw new e("portal:invalid-layer-item-type","Invalid layer item type '${type}', expected '${expectedType}'",{type:r?.type,expectedType:t.supportedTypes.join(", ")})}async function y(e,t){const r=e.instance,a=r.portalItem;if(!a)return;const{url:n,title:s}=a,i=l(a);if("group"===r.type)return r.read({title:s},i),f(r,e);n&&r.read({url:n},i);const u=new c,p=await g(e,u,t);return p&&r.read(p,i),r.resourceReferences={portalItem:a,paths:i.readResourcePaths??[]},"subtype-group"!==r.type&&r.read({title:s},i),o(r,i)}async function f(t,r){let a;const{portalItem:n}=t;if(!n)return;const s=n.type,l=r.layerModuleTypeMap;switch(s){case"Feature Service":case"Feature Collection":a=l.FeatureLayer;break;case"Stream Service":a=l.StreamLayer;break;case"Scene Service":a=l.SceneLayer;break;default:throw new e("portal:unsupported-item-type-as-group",`The item type '${s}' is not supported as a 'IGroupLayer'`)}const o=new c;let[i,u]=await Promise.all([a(),g(r,o)]),p=()=>i;if("Feature Service"===s){u=n.url?await I(u,n.url,o):{};const e=j(u),r=F(u),a=[];if(e.length||r?.length){e.length&&a.push("SubtypeGroupLayer"),r?.length&&a.push("OrientedImageryLayer");const t=[];for(const e of a){const r=l[e];t.push(r())}const n=await Promise.all(t),s=new Map;a.forEach(((e,t)=>{s.set(e,n[t])})),p=e=>e.layerType?s.get(e.layerType)??i:i}const s=await D(n.url);return await b(t,p,u,s)}return"Scene Service"===s&&n.url&&(u=await d(n,u,o)),T(u)>0?await b(t,p,u):await m(t,p)}async function d(e,t,a){if(!e?.url)return t??{};if(t??={},!t.layers){const r=await a.fetchServiceMetadata(e.url);t.layers=r.layers?.map(h)}const{serverUrl:n,portalItem:s}=await r(e.url,{sceneLayerItem:e}).catch((()=>({serverUrl:null,portalItem:null})));if(null==n)return t.tables=[],t;if(!t.tables&&s){const e=await s.fetchData();if(e?.tables)t.tables=e.tables.map(h);else{const e=await a.fetchServiceMetadata(n);t.tables=e?.tables?.map(h)}}if(t.tables)for(const r of t.tables)r.url=`${n}/${r.id}`;return t}async function m(e,t){const{portalItem:r}=e;if(!r?.url)return;const a=await i(r.url);a&&b(e,t,{layers:a.layers?.map(h),tables:a.tables?.map(h)})}function h(e){const t={id:e.id,name:e.name};return"Oriented Imagery Layer"===e.type&&(t.layerType="OrientedImageryLayer"),t}async function b(e,t,r,a){let s=r.layers||[];const l=r.tables||[];if("Feature Collection"===e.portalItem?.type?(s.forEach(((e,t)=>{e.id=t,"Table"===e?.layerDefinition?.type&&l.push(e)})),s=s.filter((e=>"Table"!==e?.layerDefinition?.type))):(s.reverse(),l.reverse()),s.forEach((n=>{const s=a?.(n);if(s||!a){const a=w(e,t(n),r,n,s);e.add(a)}})),l.length){const t=await n.FeatureLayer();l.forEach((n=>{const s=a?.(n);if(s||!a){const a=w(e,t,r,n,s);e.tables.add(a)}}))}}function w(e,t,r,a,n){const l=e.portalItem,o={portalItem:l.clone(),layerId:a.id};null!=a.url&&(o.url=a.url);const i=new t(o);if("sourceJSON"in i&&(i.sourceJSON=n),"subtype-group"!==i.type&&(i.sublayerTitleMode="service-name"),"Feature Collection"===l.type){const e={origin:"portal-item",portal:l.portal||s.getDefault()};i.read(a,e);const t=r.showLegend;null!=t&&i.read({showLegend:t},e)}return i}async function g(e,t,r){if(!1===e.supportsData)return;const a=e.instance,n=a.portalItem;if(!n)return;let s=null;try{s=await n.fetchData("json",r)}catch(l){}if(M(a)){let e=null;const r=await v(n,s,t);if((s?.layers||s?.tables)&&r>0){if(null==a.layerId){const e=j(s);a.layerId="subtype-group"===a.type?e?.[0]:S(s)}e=L(s,a),e&&null!=s.showLegend&&(e.showLegend=s.showLegend)}return r>1&&"sublayerTitleMode"in a&&"service-name"!==a.sublayerTitleMode&&(a.sublayerTitleMode="item-title-and-service-name"),e}return s}async function v(e,r,a){if(r?.layers&&r?.tables)return T(r);const n=t(e.url);if(!n)return 1;const s=await a.fetchServiceMetadata(n.url.path).catch((()=>null));return(r?.layers?.length??s?.layers?.length??0)+(r?.tables?.length??s?.tables?.length??0)}async function I(e,t,r){if(null==e?.layers||null==e?.tables){const a=await r.fetchServiceMetadata(t);(e=e||{}).layers=e.layers||a?.layers?.map(h),e.tables=e.tables||a?.tables?.map(h)}return e}function S(e){const t=e.layers;if(t?.length)return t[0].id;const r=e.tables;return r?.length?r[0].id:null}function L(e,t){const{layerId:r}=t,a=e.layers?.find((e=>e.id===r))||e.tables?.find((e=>e.id===r));return a&&O(a,t)?a:null}function T(e){return(e?.layers?.length??0)+(e?.tables?.length??0)}function M(e){return"stream"!==e.type&&"layerId"in e}function j(e){const t=[];return e?.layers?.forEach((e=>{"SubtypeGroupLayer"===e.layerType&&t.push(e.id)})),t}function F(e){return e?.layers?.filter((({layerType:e})=>"OrientedImageryLayer"===e)).map((({id:e})=>e))}function O(e,t){return!("feature"===t.type&&"layerType"in e&&"SubtypeGroupLayer"===e.layerType||"subtype-group"===t.type&&!("layerType"in e))}async function D(e){const{layersJSON:t}=await a(e);if(!t)return null;const r=[...t.layers,...t.tables];return e=>r.find((t=>t.id===e.id))}export{c as LayerLoadContext,S as getFirstLayerOrTableId,T as getNumLayersAndTables,F as getOrientedImageryLayerIds,j as getSubtypeGroupLayerIds,u as load,d as populateSceneServiceItemData,I as preprocessFSItemData};
5
+ import e from"../../core/Error.js";import{OriginId as t}from"../../core/accessorSupport/PropertyOrigin.js";import{parse as r}from"../../layers/support/arcgisLayerUrl.js";import{fetchFeatureService as a}from"../../layers/support/fetchService.js";import{LayerLoadContext as n}from"../../layers/support/LayerLoadContext.js";import{populateGroupLayer as o}from"../../layers/support/layersCreator.js";import{layerLookupMap as s}from"../../layers/support/lazyLayerLoader.js";import i from"../Portal.js";import{createForItemRead as l,createForGroupLayerItemRead as p}from"./jsonContext.js";import{preprocessFSItemData as u,getSubtypeGroupLayerIds as c,getOrientedImageryLayerIds as y,populateSceneServiceItemData as f,getNumLayersAndTables as d,createSublayerData as m,getFirstLayerOrTableId as h}from"./loadUtils.js";import{hasTypeKeyword as w}from"./portalItemUtils.js";import{loadStyleRenderer as g}from"../../renderers/support/styleUtils.js";import{fetchArcGISServiceJSON as b}from"../../support/requestPresets.js";async function I(e,t){const r=e.instance.portalItem;if(r?.id)return await r.load(t),L(e),S(e,t)}function L(t){const r=t.instance.portalItem;if(!r?.type||!t.supportedTypes.includes(r.type))throw new e("portal:invalid-layer-item-type","Invalid layer item type '${type}', expected '${expectedType}'",{type:r?.type,expectedType:t.supportedTypes.join(", ")})}async function S(e,t){const r=e.instance,a=r.portalItem;if(!a)return;const{url:o,title:s}=a,i=l(a);if("group"===r.type)return j(r,i,e);o&&r.read({url:o},i);const p=new n,u=await C(e,p,t);return u&&r.read(u,i),r.resourceReferences={portalItem:a,paths:i.readResourcePaths??[]},"subtype-group"!==r.type&&r.read({title:s},i),g(r,i)}async function j(r,a,n){const o=r.portalItem;if(r.originIdOf("portalItem")!==t.USER)return;const{title:s,type:i}=o;if("Group Layer"===i){if(!w(o,"Map"))throw new e("portal:invalid-layer-item-typekeyword","'Group Layer' item without 'Map' type keyword is not supported");return T(r)}return r.read({title:s},a),v(r,n)}async function T(e){const t=e.portalItem,r=await t.fetchData("json");if(!r)return;const a=p(t);e.read(r,a),await o(e,r,{context:a})}async function v(t,r){let a;const{portalItem:o}=t;if(!o)return;const s=o.type,i=r.layerModuleTypeMap;switch(s){case"Feature Service":case"Feature Collection":a=i.FeatureLayer;break;case"Stream Service":a=i.StreamLayer;break;case"Scene Service":a=i.SceneLayer;break;default:throw new e("portal:unsupported-item-type-as-group",`The item type '${s}' is not supported as a 'IGroupLayer'`)}const l=new n;let[p,m]=await Promise.all([a(),C(r,l)]),h=()=>p;if("Feature Service"===s){m=o.url?await u(m,o.url,l):{};const e=c(m),r=y(m),a=[];if(e.length||r?.length){e.length&&a.push("SubtypeGroupLayer"),r?.length&&a.push("OrientedImageryLayer");const t=[];for(const e of a){const r=i[e];t.push(r())}const n=await Promise.all(t),o=new Map;a.forEach(((e,t)=>{o.set(e,n[t])})),h=e=>e.layerType?o.get(e.layerType)??p:p}const n=await k(o.url);return await x(t,h,m,n)}return"Scene Service"===s&&o.url&&(m=await f(o,m,l)),d(m)>0?await x(t,h,m):await M(t,h)}async function M(e,t){const{portalItem:r}=e;if(!r?.url)return;const a=await b(r.url);a&&x(e,t,{layers:a.layers?.map(m),tables:a.tables?.map(m)})}async function x(e,t,r,a){let n=r.layers||[];const o=r.tables||[];if("Feature Collection"===e.portalItem?.type?(n.forEach(((e,t)=>{e.id=t,"Table"===e?.layerDefinition?.type&&o.push(e)})),n=n.filter((e=>"Table"!==e?.layerDefinition?.type))):(n.reverse(),o.reverse()),n.forEach((n=>{const o=a?.(n);if(o||!a){const a=F(e,t(n),r,n,o);e.add(a)}})),o.length){const t=await s.FeatureLayer();o.forEach((n=>{const o=a?.(n);if(o||!a){const a=F(e,t,r,n,o);e.tables.add(a)}}))}}function F(e,t,r,a,n){const o=e.portalItem,s={portalItem:o.clone(),layerId:a.id};null!=a.url&&(s.url=a.url);const l=new t(s);if("sourceJSON"in l&&(l.sourceJSON=n),"subtype-group"!==l.type&&(l.sublayerTitleMode="service-name"),"Feature Collection"===o.type){const e={origin:"portal-item",portal:o.portal||i.getDefault()};l.read(a,e);const t=r.showLegend;null!=t&&l.read({showLegend:t},e)}return l}async function C(e,t,r){if(!1===e.supportsData)return;const a=e.instance,n=a.portalItem;if(!n)return;let o=null;try{o=await n.fetchData("json",r)}catch(s){}if(O(a)){let e=null;const r=await D(n,o,t);if((o?.layers||o?.tables)&&r>0){if(null==a.layerId){const e=c(o);a.layerId="subtype-group"===a.type?e?.[0]:h(o)}e=E(o,a),e&&null!=o.showLegend&&(e.showLegend=o.showLegend)}return r>1&&"sublayerTitleMode"in a&&"service-name"!==a.sublayerTitleMode&&(a.sublayerTitleMode="item-title-and-service-name"),e}return o}async function D(e,t,a){if(t?.layers&&t?.tables)return d(t);const n=r(e.url);if(!n)return 1;const o=await a.fetchServiceMetadata(n.url.path).catch((()=>null));return(t?.layers?.length??o?.layers?.length??0)+(t?.tables?.length??o?.tables?.length??0)}function E(e,t){const{layerId:r}=t,a=e.layers?.find((e=>e.id===r))||e.tables?.find((e=>e.id===r));return a&&P(a,t)?a:null}function O(e){return"stream"!==e.type&&"layerId"in e}function P(e,t){return!("feature"===t.type&&"layerType"in e&&"SubtypeGroupLayer"===e.layerType||"subtype-group"===t.type&&!("layerType"in e))}async function k(e){const{layersJSON:t}=await a(e);if(!t)return null;const r=[...t.layers,...t.tables];return e=>r.find((t=>t.id===e.id))}export{I as load};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
+ */
5
+ import{findAssociatedFeatureService as e}from"../../layers/support/associatedFeatureServiceUtils.js";function t(e){const t={id:e.id,name:e.name};return"Oriented Imagery Layer"===e.type&&(t.layerType="OrientedImageryLayer"),t}async function a(e,a,r){if(null==e?.layers||null==e?.tables){const l=await r.fetchServiceMetadata(a);(e=e||{}).layers=e.layers||l?.layers?.map(t),e.tables=e.tables||l?.tables?.map(t)}return e}function r(e){const t=e.layers;if(t?.length)return t[0].id;const a=e.tables;return a?.length?a[0].id:null}function l(e){return(e?.layers?.length??0)+(e?.tables?.length??0)}function n(e){const t=[];return e?.layers?.forEach((e=>{"SubtypeGroupLayer"===e.layerType&&t.push(e.id)})),t}function s(e){return e?.layers?.filter((({layerType:e})=>"OrientedImageryLayer"===e)).map((({id:e})=>e))}async function i(a,r,l){if(!a?.url)return r??{};if(r??={},!r.layers){const e=await l.fetchServiceMetadata(a.url);r.layers=e.layers?.map(t)}const{serverUrl:n,portalItem:s}=await e(a.url,{sceneLayerItem:a}).catch((()=>({serverUrl:null,portalItem:null})));if(null==n)return r.tables=[],r;if(!r.tables&&s){const e=await s.fetchData();if(e?.tables)r.tables=e.tables.map(t);else{const e=await l.fetchServiceMetadata(n);r.tables=e?.tables?.map(t)}}if(r.tables)for(const e of r.tables)e.url=`${n}/${e.id}`;return r}export{t as createSublayerData,r as getFirstLayerOrTableId,l as getNumLayersAndTables,s as getOrientedImageryLayerIds,n as getSubtypeGroupLayerIds,i as populateSceneServiceItemData,a as preprocessFSItemData};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{initializeProjection as e,project as t}from"../../geometry/projection.js";import r from"../../geometry/SpatialReference.js";import{webMercatorToGeographic as n}from"../../geometry/support/webMercatorUtils.js";async function o(o){const i=o.spatialReference;if(i.isWGS84)return o.clone();if(i.isWebMercator)return n(o);const s=r.WGS84;return await e(i,s),t(o,s)}function i(e,t){if(!s(e,t)){const r=e.typeKeywords;r?r.push(t):e.typeKeywords=[t]}}function s(e,t){return!!e.typeKeywords?.includes(t)}function c(e){return s(e,f.HOSTED_SERVICE)}function u(e,t){const r=e.typeKeywords;if(r){const e=r.indexOf(t);e>-1&&r.splice(e,1)}}function a(e,t,r){r?i(e,t):u(e,t)}async function l(e){const t=e.clone().normalize();let r;if(t.length>1)for(const n of t)r?n.width>r.width&&(r=n):r=n;else r=t[0];return o(r)}const f={DEVELOPER_BASEMAP:"DeveloperBasemap",JSAPI:"ArcGIS API for JavaScript",METADATA:"Metadata",MULTI_LAYER:"Multilayer",SINGLE_LAYER:"Singlelayer",TABLE:"Table",HOSTED_SERVICE:"Hosted Service",LOCAL_SCENE:"ViewingMode-Local",TILED_IMAGERY:"Tiled Imagery"};function p(e){const{portal:t,isOrgItem:r,itemControl:n}=e,o=t.user?.privileges;let i=!o||o.includes("features:user:edit"),s=!!r&&!!o?.includes("features:user:fullEdit");const c="update"===n||"admin"===n;return c?s=i=!0:s&&(i=!0),{features:{edit:i,fullEdit:s},content:{updateItem:c}}}export{f as TypeKeyword,i as addTypeKeyword,p as getUserPrivileges,l as getWGS84ExtentForItem,s as hasTypeKeyword,c as isHostedLayer,u as removeTypeKeyword,a as toggleTypeKeword};
5
+ import{initializeProjection as e,project as t}from"../../geometry/projection.js";import r from"../../geometry/SpatialReference.js";import{webMercatorToGeographic as n}from"../../geometry/support/webMercatorUtils.js";async function o(o){const i=o.spatialReference;if(i.isWGS84)return o.clone();if(i.isWebMercator)return n(o);const s=r.WGS84;return await e(i,s),t(o,s)}function i(e,t){if(!s(e,t)){const r=e.typeKeywords;r?r.push(t):e.typeKeywords=[t]}}function s(e,t){return!!e.typeKeywords?.includes(t)}function c(e){return s(e,f.HOSTED_SERVICE)}function a(e,t){const r=e.typeKeywords;if(r){const e=r.indexOf(t);e>-1&&r.splice(e,1)}}function u(e,t,r){r?i(e,t):a(e,t)}async function l(e){const t=e.clone().normalize();let r;if(t.length>1)for(const n of t)r?n.width>r.width&&(r=n):r=n;else r=t[0];return o(r)}const f={DEVELOPER_BASEMAP:"DeveloperBasemap",JSAPI:"ArcGIS API for JavaScript",METADATA:"Metadata",MULTI_LAYER:"Multilayer",SINGLE_LAYER:"Singlelayer",TABLE:"Table",HOSTED_SERVICE:"Hosted Service",LOCAL_SCENE:"ViewingMode-Local",TILED_IMAGERY:"Tiled Imagery",GROUP_LAYER_MAP:"Map"};function p(e){const{portal:t,isOrgItem:r,itemControl:n}=e,o=t.user?.privileges;let i=!o||o.includes("features:user:edit"),s=!!r&&!!o?.includes("features:user:fullEdit");const c="update"===n||"admin"===n;return c?s=i=!0:s&&(i=!0),{features:{edit:i,fullEdit:s},content:{updateItem:c}}}export{f as TypeKeyword,i as addTypeKeyword,p as getUserPrivileges,l as getWGS84ExtentForItem,s as hasTypeKeyword,c as isHostedLayer,a as removeTypeKeyword,u as toggleTypeKeword};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../core/Error.js";import{findAssociatedFeatureService as a}from"../../layers/support/associatedFeatureServiceUtils.js";import{sceneServiceLayerTypeToClassName as r}from"../../layers/support/layerUtils.js";import{layerLookupMap as t}from"../../layers/support/lazyLayerLoader.js";import n from"../PortalItem.js";import{LayerLoadContext as s,getNumLayersAndTables as c,preprocessFSItemData as i,getSubtypeGroupLayerIds as o,getOrientedImageryLayerIds as u,populateSceneServiceItemData as l,getFirstLayerOrTableId as y}from"./layersLoader.js";import{hasTypeKeyword as m}from"./portalItemUtils.js";async function p(e){!e.portalItem||e.portalItem instanceof n||(e={...e,portalItem:new n(e.portalItem)});const a=await f(e.portalItem);return new(0,a.constructor)({portalItem:e.portalItem,...a.properties})}async function f(e){await e.load();const a=new s;return L(await d(e,a))}async function d(a,r){switch(a.type){case"Map Service":return w(a,r);case"Feature Service":return S(a,r);case"Feature Collection":return I(a);case"Scene Service":return N(a,r);case"Image Service":return v(a,r);case"Stream Service":return M();case"Vector Tile Service":return h();case"GeoJson":return T();case"CSV":return g();case"KML":return j();case"WFS":return F();case"WMTS":return G();case"WMS":return b();case"Feed":return C();default:throw new e("portal:unknown-item-type","Unknown item type '${type}'",{type:a.type})}}async function L(e){const a=e.className,r=t[a];return{constructor:await r(),properties:e.properties}}async function w(e,a){return await V(e,a)?{className:"TileLayer"}:{className:"MapImageLayer"}}async function S(e,a){const r=await W(e,a);if("object"==typeof r){const e={};return null!=r.id&&(e.layerId=r.id),{className:r.className||"FeatureLayer",properties:e}}return{className:"GroupLayer"}}async function N(e,t){const n=await W(e,t,(async()=>{try{if(!e.url)return[];const{serverUrl:r}=await a(e.url,{sceneLayerItem:e}),n=await t.fetchServiceMetadata(r);return n?.tables??[]}catch{return[]}}));if("object"==typeof n){const a={};let s;if(null!=n.id?(a.layerId=n.id,s=`${e.url}/layers/${n.id}`):s=e.url,e.typeKeywords?.length)for(const t of Object.keys(r))if(e.typeKeywords.includes(t))return{className:r[t]};const c=await t.fetchServiceMetadata(s);return{className:r[c?.layerType]||"SceneLayer",properties:a}}if(!1===n){const a=await t.fetchServiceMetadata(e.url);if("Voxel"===a?.layerType)return{className:"VoxelLayer"}}return{className:"GroupLayer"}}async function I(e){await e.load();const a=m(e,"Map Notes"),r=m(e,"Markup");if(a||r)return{className:"MapNotesLayer"};if(m(e,"Route Layer"))return{className:"RouteLayer"};const t=await e.fetchData();return 1===c(t)?{className:"FeatureLayer"}:{className:"GroupLayer"}}async function v(e,a){await e.load();const r=e.typeKeywords?.map((e=>e.toLowerCase()))??[];if(r.includes("elevation 3d layer"))return{className:"ElevationLayer"};if(r.includes("tiled imagery"))return{className:"ImageryTileLayer"};const t=await e.fetchData(),n=t?.layerType;if("ArcGISTiledImageServiceLayer"===n)return{className:"ImageryTileLayer"};if("ArcGISImageServiceLayer"===n)return{className:"ImageryLayer"};const s=await a.fetchServiceMetadata(e.url),c=s.cacheType?.toLowerCase(),i=s.capabilities?.toLowerCase().includes("tilesonly");return"map"===c||i?{className:"ImageryTileLayer"}:{className:"ImageryLayer"}}function M(){return{className:"StreamLayer"}}function h(){return{className:"VectorTileLayer"}}function T(){return{className:"GeoJSONLayer"}}function g(){return{className:"CSVLayer"}}function j(){return{className:"KMLLayer"}}function F(){return{className:"WFSLayer"}}function b(){return{className:"WMSLayer"}}function G(){return{className:"WMTSLayer"}}function C(){return{className:"StreamLayer"}}async function V(e,a){return(await a.fetchServiceMetadata(e.url)).tileInfo}async function W(e,a,r){const t=e.url;if(!t||/\/\d+$/.test(t))return{};await e.load();let n=await e.fetchData();if("Feature Service"===e.type){const e=await i(n,t,a),r=K(e);if("object"==typeof r){const a=o(e),t=u(e);r.className=null!=r.id&&a.includes(r.id)?"SubtypeGroupLayer":null!=r.id&&t?.includes(r.id)?"OrientedImageryLayer":"FeatureLayer"}return r}"Scene Service"===e.type&&(n=await l(e,n,a));if(c(n)>0)return K(n);const s=await a.fetchServiceMetadata(t);return r&&(s.tables=await r()),K(s)}function K(e){return 1===c(e)&&{id:y(e)}}export{p as fromItem,d as selectLayerClassPath};
5
+ import e from"../../core/Error.js";import{findAssociatedFeatureService as a}from"../../layers/support/associatedFeatureServiceUtils.js";import{LayerLoadContext as r}from"../../layers/support/LayerLoadContext.js";import{sceneServiceLayerTypeToClassName as t}from"../../layers/support/layerUtils.js";import{layerLookupMap as n}from"../../layers/support/lazyLayerLoader.js";import s from"../PortalItem.js";import{getNumLayersAndTables as c,preprocessFSItemData as o,getSubtypeGroupLayerIds as i,getOrientedImageryLayerIds as u,populateSceneServiceItemData as l,getFirstLayerOrTableId as y}from"./loadUtils.js";import{hasTypeKeyword as m}from"./portalItemUtils.js";async function p(e){!e.portalItem||e.portalItem instanceof s||(e={...e,portalItem:new s(e.portalItem)});const a=await f(e.portalItem);return new(0,a.constructor)({portalItem:e.portalItem,...a.properties})}async function f(e){await e.load();const a=new r;return d(await L(e,a))}async function L(a,r){switch(a.type){case"Map Service":return w(a,r);case"Feature Service":return S(a,r);case"Feature Collection":return I(a);case"Scene Service":return N(a,r);case"Image Service":return v(a,r);case"Stream Service":return M();case"Vector Tile Service":return h();case"GeoJson":return T();case"CSV":return g();case"KML":return j();case"WFS":return F();case"WMTS":return b();case"WMS":return G();case"Feed":return C();case"Group Layer":return U();default:throw new e("portal:unknown-item-type","Unknown item type '${type}'",{type:a.type})}}async function d(e){const a=e.className,r=n[a];return{constructor:await r(),properties:e.properties}}async function w(e,a){return await V(e,a)?{className:"TileLayer"}:{className:"MapImageLayer"}}async function S(e,a){const r=await W(e,a);if("object"==typeof r){const e={};return null!=r.id&&(e.layerId=r.id),{className:r.className||"FeatureLayer",properties:e}}return{className:"GroupLayer"}}async function N(e,r){const n=await W(e,r,(async()=>{try{if(!e.url)return[];const{serverUrl:t}=await a(e.url,{sceneLayerItem:e}),n=await r.fetchServiceMetadata(t);return n?.tables??[]}catch{return[]}}));if("object"==typeof n){const a={};let s;if(null!=n.id?(a.layerId=n.id,s=`${e.url}/layers/${n.id}`):s=e.url,e.typeKeywords?.length)for(const r of Object.keys(t))if(e.typeKeywords.includes(r))return{className:t[r]};const c=await r.fetchServiceMetadata(s);return{className:t[c?.layerType]||"SceneLayer",properties:a}}if(!1===n){const a=await r.fetchServiceMetadata(e.url);if("Voxel"===a?.layerType)return{className:"VoxelLayer"}}return{className:"GroupLayer"}}async function I(e){await e.load();const a=m(e,"Map Notes"),r=m(e,"Markup");if(a||r)return{className:"MapNotesLayer"};if(m(e,"Route Layer"))return{className:"RouteLayer"};const t=await e.fetchData();return 1===c(t)?{className:"FeatureLayer"}:{className:"GroupLayer"}}async function v(e,a){await e.load();const r=e.typeKeywords?.map((e=>e.toLowerCase()))??[];if(r.includes("elevation 3d layer"))return{className:"ElevationLayer"};if(r.includes("tiled imagery"))return{className:"ImageryTileLayer"};const t=await e.fetchData(),n=t?.layerType;if("ArcGISTiledImageServiceLayer"===n)return{className:"ImageryTileLayer"};if("ArcGISImageServiceLayer"===n)return{className:"ImageryLayer"};const s=await a.fetchServiceMetadata(e.url),c=s.cacheType?.toLowerCase(),o=s.capabilities?.toLowerCase().includes("tilesonly");return"map"===c||o?{className:"ImageryTileLayer"}:{className:"ImageryLayer"}}function M(){return{className:"StreamLayer"}}function h(){return{className:"VectorTileLayer"}}function T(){return{className:"GeoJSONLayer"}}function g(){return{className:"CSVLayer"}}function j(){return{className:"KMLLayer"}}function F(){return{className:"WFSLayer"}}function G(){return{className:"WMSLayer"}}function b(){return{className:"WMTSLayer"}}function C(){return{className:"StreamLayer"}}function U(){return{className:"GroupLayer"}}async function V(e,a){return(await a.fetchServiceMetadata(e.url)).tileInfo}async function W(e,a,r){const t=e.url;if(!t||/\/\d+$/.test(t))return{};await e.load();let n=await e.fetchData();if("Feature Service"===e.type){const e=await o(n,t,a),r=K(e);if("object"==typeof r){const a=i(e),t=u(e);r.className=null!=r.id&&a.includes(r.id)?"SubtypeGroupLayer":null!=r.id&&t?.includes(r.id)?"OrientedImageryLayer":"FeatureLayer"}return r}"Scene Service"===e.type&&(n=await l(e,n,a));if(c(n)>0)return K(n);const s=await a.fetchServiceMetadata(t);return r&&(s.tables=await r()),K(s)}function K(e){return 1===c(e)&&{id:y(e)}}export{p as fromItem,L as selectLayerClassPath};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import{toHSV as t}from"../../core/colorUtils.js";import{JSONSupport as r}from"../../core/JSONSupport.js";import s from"../../core/Logger.js";import{property as a}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import"../../core/arrayUtils.js";import"../../core/has.js";import{subclass as o}from"../../core/accessorSupport/decorators/subclass.js";import n from"../../layers/support/RasterInfo.js";import{colorize as i,remapColor as l,lookupPixels as u,createColormapLUT as c,isValidPixelBlock as p}from"../../layers/support/rasterFunctions/pixelUtils.js";import{stretch as d,getStretchCutoff as h,createStretchLUT as m,computeGammaValues as f,createHistogramEqualizationLUT as y}from"../../layers/support/rasterFunctions/stretchUtils.js";import{hillshade as g,tintHillshade as b,calculateHillshadeParams as S}from"../../layers/support/rasterFunctions/surfaceUtils.js";import{convertColorRampToColormap as k}from"./colorRampUtils.js";import{isUVRendererSupported as R,isColormapRendererSupported as x,isShadedReliefRendererSupported as I}from"./rasterRendererChecks.js";let _=class extends r{constructor(e){super(e)}bind(){const{rendererJSON:e}=this;if(!e)return{success:!1};let t;switch(this.lookup={rendererJSON:{}},e.type){case"uniqueValue":t=this._updateUVRenderer(e);break;case"rasterColormap":t=this._updateColormapRenderer(e);break;case"rasterStretch":t=this._updateStretchRenderer(e);break;case"classBreaks":t=this._updateClassBreaksRenderer(e);break;case"rasterShadedRelief":t=this._updateShadedReliefRenderer(e);break;case"vectorField":t=this._updateVectorFieldRenderer();break;case"flowRenderer":t=this._updateFlowRenderer()}return t}symbolize(e){let t=e?.pixelBlock;if(!C(t))return t;if(e.simpleStretchParams&&"rasterStretch"===this.rendererJSON.type)return this.simpleStretch(t,e.simpleStretchParams);try{let r;switch(t.pixels.length>3&&(t=t.extractBands([0,1,2])),this.rendererJSON.type){case"uniqueValue":case"rasterColormap":r=this._symbolizeColormap(t);break;case"classBreaks":r=this._symbolizeClassBreaks(t);break;case"rasterStretch":r=this._symbolizeStretch(t,e.bandIds);break;case"rasterShadedRelief":{const s=e.extent,a=s.spatialReference.isGeographic,o={x:(s.xmax-s.xmin)/t.width,y:(s.ymax-s.ymin)/t.height};r=this._symbolizeShadedRelief(t,{isGCS:a,resolution:o});break}}return r}catch(r){return s.getLogger(this).error("symbolize",r.message),t}}simpleStretch(e,t){if(!C(e))return e;try{return e.pixels.length>3&&(e=e.extractBands([0,1,2])),d(e,{...t,isRenderer:!0})}catch(r){return s.getLogger(this).error("symbolize",r.message),e}}generateWebGLParameters(e){if(["uniqueValue","rasterColormap","classBreaks"].includes(this.rendererJSON.type)){const{indexedColormap:e,offset:t}=this.lookup.colormapLut||{};return{colormap:e,colormapOffset:t,type:"lut"}}const{pixelBlock:t,isGCS:r,resolution:s,bandIds:a}=e,{rendererJSON:o}=this;return"rasterStretch"===o.type?this._generateStretchWebGLParams(t,o,a):"rasterShadedRelief"===o.type?this._generateShadedReliefWebGLParams(o,r,s??void 0):"vectorField"===o.type?this._generateVectorFieldWebGLParams(o):null}_isLUTChanged(e){if(!this.lookup||!this.lookup.rendererJSON)return!0;if("colorRamp"in this.rendererJSON){const t=this.rendererJSON.colorRamp;return e?JSON.stringify(t)!==JSON.stringify(this.lookup.rendererJSON.colorRamp):(this.rendererJSON,this.lookup.rendererJSON,JSON.stringify(this.rendererJSON)!==JSON.stringify(this.lookup.rendererJSON))}return JSON.stringify(this.rendererJSON)!==JSON.stringify(this.lookup.rendererJSON)}_symbolizeColormap(e){if(this._isLUTChanged()){if(!this.bind().success)return e}return i(e,this.lookup.colormapLut)}_symbolizeClassBreaks(e){const{canUseIndexedLUT:t}=this._analyzeClassBreaks(this.rendererJSON);if(this._isLUTChanged()){if(!this.bind().success)return e}return t?i(e,this.lookup.colormapLut):l(e,this.lookup.remapLut??[])}_symbolizeStretch(e,t){const{rasterInfo:r}=this,{pixelType:s,bandCount:a}=r,o=this.rendererJSON,n=["u8","u16","s8","s16"].includes(s);let l,c;const{dra:p}=o,{gamma:f}=this.lookup;if("histogramEqualization"===o.stretchType){const s=p?null:this.lookup?.histogramLut,a=h(o,{rasterInfo:r,pixelBlock:e,bandIds:t,returnHistogramLut:!s}),n=d(e,{...a,gamma:f,isRenderer:!0});c=u(n,{lut:p?a.histogramLut:s,offset:0})}else if(n){if(p){const a=h(o,{rasterInfo:r,pixelBlock:e,bandIds:t});l=m({pixelType:s,...a,gamma:f,rounding:"floor"})}else if(this._isLUTChanged()){if(!this.bind().success)return e;l=this.lookup?this.lookup.stretchLut:null}else l=this.lookup?this.lookup.stretchLut:null;if(!l)return e;a>1&&null!=t&&t.length===e?.pixels.length&&l?.lut.length===a&&(l={lut:t.map((e=>l.lut[e])),offset:l.offset}),c=u(e,l)}else{const s=h(o,{rasterInfo:r,pixelBlock:e,bandIds:t});c=d(e,{...s,gamma:f,isRenderer:!0})}if(o.colorRamp){if(this._isLUTChanged(!0)){if(!this.bind().success)return e}c=i(c,this.lookup?.colormapLut)}return c}_symbolizeShadedRelief(e,t){const r=this.rendererJSON,s={...r,...t},a=g(e,s);if(!r.colorRamp)return a;let o;if(this._isLUTChanged(!0)){if(!this.bind().success)return a;o=this.lookup?this.lookup.hsvMap:null}else o=this.lookup?this.lookup.hsvMap:null;if(!o)return a;const n=this.rasterInfo.statistics?.[0]??{min:0,max:8e3};return b(a,e,o,n),a}_isVectorFieldData(){const{bandCount:e,dataType:t}=this.rasterInfo;return 2===e&&("vector-magdir"===t||"vector-uv"===t)}_updateVectorFieldRenderer(){return this._isVectorFieldData()?{success:!0}:{success:!1,error:`Unsupported data type "${this.rasterInfo.dataType}"; VectorFieldRenderer only supports "vector-magdir" and "vector-uv".`}}_updateFlowRenderer(){return this._isVectorFieldData()?{success:!0}:{success:!1,error:`Unsupported data type "${this.rasterInfo.dataType}"; FlowRenderer only supports "vector-magdir" and "vector-uv".`}}_updateUVRenderer(e){const{bandCount:t,attributeTable:r,pixelType:s}=this.rasterInfo,a=e.field1;if(!a)return{success:!1,error:"Unsupported renderer; missing UniqueValueRenderer.field."};const o=e.defaultSymbol,n=1===t&&["u8","s8"].includes(s);if(!R(this.rasterInfo,a)&&!n)return{success:!1,error:"Unsupported data; UniqueValueRenderer is only supported on single band data with a valid raster attribute table."};const i=[];if(null!=r){const t=r.fields.find((e=>"value"===e.name.toLowerCase()));if(!t)return{success:!1,error:"Unsupported data; the data's raster attribute table does not have a value field."};r.features.forEach((r=>{const s=e.uniqueValueInfos?.find((e=>String(e.value)===String(r.attributes[a]))),n=s?.symbol?.color;n?i.push([r.attributes[t.name]].concat(n)):o&&i.push([r.attributes[t.name]].concat(o.color))}))}else{if("value"!==a.toLowerCase())return{success:!1,error:'Unsupported renderer; UniqueValueRenderer.field must be "Value" when raster attribute table is not availalbe.'};e.uniqueValueInfos?.forEach((e=>{const t=e?.symbol?.color;t?i.push([parseInt(""+e.value,10)].concat(t)):o&&i.push([parseInt(""+e.value,10)].concat(o?.color))}))}if(0===i.length)return{success:!1,error:"Invalid UniqueValueRenderer. Cannot find matching records in the raster attribute table."};const l=c({colormap:i});return this.lookup={rendererJSON:e,colormapLut:l},this.canRenderInWebGL=!0,{success:!0}}_updateColormapRenderer(e){if(!x(this.rasterInfo))return{success:!1,error:"Unsupported data; the data source does not have a colormap."};const t=e.colormapInfos.map((e=>[e.value].concat(e.color))).sort(((e,t)=>e[0]-t[0]));if(!t||0===t.length)return{success:!1,error:"Unsupported renderer; ColormapRenderer must have meaningful colormapInfos."};const r=c({colormap:t});return this.lookup={rendererJSON:e,colormapLut:r},this.canRenderInWebGL=!0,{success:!0}}_updateShadedReliefRenderer(e){if(!I(this.rasterInfo))return{success:!1,error:`Unsupported data type "${this.rasterInfo.dataType}"; ShadedReliefRenderer only supports "elevation", or single band float/s16 data.`};if(e.colorRamp){const r=k(e.colorRamp,{interpolateAlpha:!0}),s=c({colormap:r}),a=[],o=s.indexedColormap;for(let e=0;e<o.length;e+=4){const r=t({r:o[e],g:o[e+1],b:o[e+2]});a.push([r.h/60,r.s/100,255*r.v/100])}this.lookup={rendererJSON:e,colormapLut:s,hsvMap:a}}else this.lookup=null;return this.canRenderInWebGL=!0,{success:!0}}_analyzeClassBreaks(e){const{attributeTable:t,pixelType:r}=this.rasterInfo,s=null!=t?t.fields.find((e=>"value"===e.name.toLowerCase())):null,a=null!=t?t.fields.find((t=>t.name.toLowerCase()===e.field.toLowerCase())):null,o=null!=s&&null!==a;return{canUseIndexedLUT:["u8","u16","s8","s16"].includes(r)||o,tableValueField:s,tableBreakField:a}}_updateClassBreaksRenderer(e){const{attributeTable:t}=this.rasterInfo,{canUseIndexedLUT:r,tableValueField:s,tableBreakField:a}=this._analyzeClassBreaks(e),o=e.classBreakInfos;if(!o?.length)return{success:!1,error:"Unsupported renderer; missing or invalid ClassBreaksRenderer.classBreakInfos."};const n=o.sort(((e,t)=>e.classMaxValue-t.classMaxValue)),i=n[n.length-1];let l=e.minValue;if(!r){const t=[];for(let e=0;e<n.length;e++)t.push({value:n[e].classMinValue??l,mappedColor:n[e].symbol.color}),l=n[e].classMaxValue;return t.push({value:i.classMaxValue,mappedColor:i.symbol.color}),this.lookup={rendererJSON:e,remapLut:t},this.canRenderInWebGL=!1,{success:!0}}const u=[];if(null!=t&&null!=s&&null!==a&&s!==a){const r=s.name,o=a.name,i=n[n.length-1],{classMaxValue:c}=i;l=e.minValue;for(const e of t.features){const t=e.attributes[r],s=e.attributes[o],a=s===c?i:s<l?null:n.find((({classMaxValue:e})=>e>s));a&&u.push([t].concat(a.symbol.color))}}else{l=Math.floor(e.minValue);for(let e=0;e<n.length;e++){const t=n[e];for(let e=l;e<t.classMaxValue;e++)u.push([e].concat(t.symbol.color));l=Math.ceil(t.classMaxValue)}i.classMaxValue===l&&u.push([i.classMaxValue].concat(i.symbol.color))}const p=c({colormap:u,fillUnspecified:!1});return this.lookup={rendererJSON:e,colormapLut:p},this.canRenderInWebGL=!0,{success:!0}}_isHistogramRequired(e){return"percentClip"===e||"histogramEqualization"===e}_isValidRasterStatistics(e){return null!=e&&e.length>0&&null!=e[0].min&&null!=e[0].max}_updateStretchRenderer(e){let{stretchType:t,dra:r}=e;if(!("none"===t||e.statistics?.length||this._isValidRasterStatistics(this.rasterInfo.statistics)||r))return{success:!1,error:"Unsupported renderer; StretchRenderer.statistics is required when dynamic range adjustment is not used."};const s=e.histograms||this.rasterInfo.histograms;!this._isHistogramRequired(e.stretchType)||s?.length||r||(t="minMax");const{computeGamma:a,useGamma:o,colorRamp:n}=e;let{gamma:i}=e;if(o&&a&&!i?.length){const t=e.statistics?.length?e.statistics:this.rasterInfo.statistics;i=f(this.rasterInfo.pixelType,t)}const l=this.rasterInfo.pixelType,u=!r&&["u8","u16","s8","s16"].includes(l);if("histogramEqualization"===t){const t=s.map((e=>y(e)));this.lookup={rendererJSON:e,histogramLut:t}}else if(u){const t=h(e,{rasterInfo:this.rasterInfo}),r=m({pixelType:l,...t,gamma:o?i:null,rounding:"floor"});this.lookup={rendererJSON:e,stretchLut:r}}if(n){const t=k(n,{interpolateAlpha:!0});this.lookup||(this.lookup={rendererJSON:e}),this.lookup.colormapLut=c({colormap:t}),this.lookup.rendererJSON=e}return this.lookup.gamma=o&&i?.length?i:null,this.canRenderInWebGL=!0,{success:!0}}_generateStretchWebGLParams(e,t,r){let s=null,a=null;const o=this.lookup?.colormapLut;t.colorRamp&&o&&(s=o.indexedColormap,a=o.offset),"histogramEqualization"===t.stretchType&&(t={...t,stretchType:"minMax"});const{gamma:n}=this.lookup,i=!!(t.useGamma&&n&&n.some((e=>1!==e))),{minCutOff:l,maxCutOff:u,outMin:c,outMax:p}=h(t,{rasterInfo:this.rasterInfo,pixelBlock:e,bandIds:r});let d=0;null!=e&&(d=e.getPlaneCount(),2===d&&((e=e.clone()).statistics=[e.statistics[0]],e.pixels=[e.pixels[0]]));const{bandCount:m}=this.rasterInfo,f=Math.min(3,r?.length||d||m,m),y=new Float32Array(f),g=s||i?1:255;let b;for(b=0;b<l.length;b++)y[b]=u[b]===l[b]?0:(p-c)/(u[b]-l[b])/g;const S=new Float32Array(f);if(i&&n)for(b=0;b<f;b++)n[b]>1?n[b]>2?S[b]=6.5+(n[b]-2)**2.5:S[b]=6.5+100*(2-n[b])**4:S[b]=1;return{bandCount:f,outMin:c/g,outMax:p/g,minCutOff:l,maxCutOff:u,factor:y,useGamma:i,gamma:i?n:[1,1,1],gammaCorrection:i?S:[1,1,1],colormap:s,colormapOffset:a,stretchType:t.stretchType,type:"stretch"}}_generateShadedReliefWebGLParams(e,t=!1,r={x:0,y:0}){let s=null,a=null;const o=this.lookup?.colormapLut;e.colorRamp&&o&&(s=o.indexedColormap,a=o.offset);const n={...e,isGCS:t,resolution:r},i=S(n),l=this.rasterInfo.statistics?.[0];return{...i,minValue:l?.min??0,maxValue:l?.max??8e3,hillshadeType:"traditional"===e.hillshadeType?0:1,type:"hillshade",colormap:s,colormapOffset:a}}_generateVectorFieldWebGLParams(e){const{style:t,inputUnit:r,outputUnit:s,visualVariables:a,symbolTileSize:o,flowRepresentation:n}=e;let i;const l=this.rasterInfo.statistics?.[0].min??0,u=this.rasterInfo.statistics?.[0].max??50,c=a?.find((e=>"sizeInfo"===e.type))??{type:"sizeInfo",field:"Magnitude",maxDataValue:u,maxSize:.8*o,minDataValue:l,minSize:.2*o},p=c.minDataValue??l,d=c.maxDataValue??u,h=null!=c.maxSize&&null!=c.minSize?[c.minSize/o,c.maxSize/o]:[.2,.8];if("wind_speed"===t){const e=(h[0]+h[1])/2;h[0]=h[1]=e}const m=null!=p&&null!=d?[p,d]:null;if("classified_arrow"===t)if(null!=p&&null!=d&&null!=c){i=[];const e=(c.maxDataValue-c.minDataValue)/5;for(let t=0;t<6;t++)i.push(c.minDataValue+e*t)}else i=[0,1e-6,3.5,7,10.5,14];const f="flow_to"===n===("ocean_current_kn"===t||"ocean_current_m"===t)?0:Math.PI,y=a?.find((e=>"rotationInfo"===e.type));return{breakValues:i,dataRange:m,inputUnit:r,outputUnit:s,symbolTileSize:o,symbolPercentRange:h,style:t||"single_arrow",rotation:f,rotationType:this.rasterInfo.storageInfo?.tileInfo&&"vector-uv"===this.rasterInfo.dataType?"geographic":y?.rotationType||e.rotationType,type:"vectorField"}}};function C(e){return p(e)&&0!==e.validPixelCount}e([a({json:{write:!0}})],_.prototype,"rendererJSON",void 0),e([a({type:n,json:{write:!0}})],_.prototype,"rasterInfo",void 0),e([a({json:{write:!0}})],_.prototype,"lookup",void 0),e([a()],_.prototype,"canRenderInWebGL",void 0),_=e([o("esri.renderers.support.RasterSymbolizer")],_);const L=_;export{L as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import{toHSV as t}from"../../core/colorUtils.js";import{JSONSupport as r}from"../../core/JSONSupport.js";import s from"../../core/Logger.js";import{property as o}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import"../../core/arrayUtils.js";import"../../core/has.js";import{subclass as a}from"../../core/accessorSupport/decorators/subclass.js";import n from"../../layers/support/RasterInfo.js";import{colorize as i,remapColor as l,lookupPixels as u,createColormapLUT as c,isValidPixelBlock as p}from"../../layers/support/rasterFunctions/pixelUtils.js";import{stretch as d,getStretchCutoff as h,createStretchLUT as m,computeGammaValues as f,createHistogramEqualizationLUT as y}from"../../layers/support/rasterFunctions/stretchUtils.js";import{hillshade as g,tintHillshade as b,calculateHillshadeParams as S}from"../../layers/support/rasterFunctions/surfaceUtils.js";import{convertColorRampToColormap as k}from"./colorRampUtils.js";import{isUVRendererSupported as R,isColormapRendererSupported as x,isShadedReliefRendererSupported as I}from"./rasterRendererChecks.js";let C=class extends r{constructor(e){super(e)}bind(){const{rendererJSON:e}=this;if(!e)return{success:!1};let t;switch(this.lookup={rendererJSON:{}},e.type){case"uniqueValue":t=this._updateUVRenderer(e);break;case"rasterColormap":t=this._updateColormapRenderer(e);break;case"rasterStretch":t=this._updateStretchRenderer(e);break;case"classBreaks":t=this._updateClassBreaksRenderer(e);break;case"rasterShadedRelief":t=this._updateShadedReliefRenderer(e);break;case"vectorField":t=this._updateVectorFieldRenderer();break;case"flowRenderer":t=this._updateFlowRenderer()}return t}symbolize(e){let t=e?.pixelBlock;if(!_(t))return t;if(e.simpleStretchParams&&"rasterStretch"===this.rendererJSON.type)return this.simpleStretch(t,e.simpleStretchParams);try{let r;switch(t.pixels.length>3&&(t=t.extractBands([0,1,2])),this.rendererJSON.type){case"uniqueValue":case"rasterColormap":r=this._symbolizeColormap(t);break;case"classBreaks":r=this._symbolizeClassBreaks(t);break;case"rasterStretch":r=this._symbolizeStretch(t,e.bandIds);break;case"rasterShadedRelief":{const s=e.extent,o=s.spatialReference.isGeographic,a={x:(s.xmax-s.xmin)/t.width,y:(s.ymax-s.ymin)/t.height};r=this._symbolizeShadedRelief(t,{isGCS:o,resolution:a});break}}return r}catch(r){return s.getLogger(this).error("symbolize",r.message),t}}simpleStretch(e,t){if(!_(e))return e;try{return e.pixels.length>3&&(e=e.extractBands([0,1,2])),d(e,{...t,isRenderer:!0})}catch(r){return s.getLogger(this).error("symbolize",r.message),e}}generateWebGLParameters(e){if(["uniqueValue","rasterColormap","classBreaks"].includes(this.rendererJSON.type)){const{indexedColormap:e,offset:t}=this.lookup.colormapLut||{};return{colormap:e,colormapOffset:t,type:"lut"}}const{pixelBlock:t,isGCS:r,resolution:s,bandIds:o}=e,{rendererJSON:a}=this;return"rasterStretch"===a.type?this._generateStretchWebGLParams(t,a,o):"rasterShadedRelief"===a.type?this._generateShadedReliefWebGLParams(a,r,s??void 0):"vectorField"===a.type?this._generateVectorFieldWebGLParams(a):null}_isLUTChanged(e){if(!this.lookup||!this.lookup.rendererJSON)return!0;if("colorRamp"in this.rendererJSON){const t=this.rendererJSON.colorRamp;return e?JSON.stringify(t)!==JSON.stringify(this.lookup.rendererJSON.colorRamp):(this.rendererJSON,this.lookup.rendererJSON,JSON.stringify(this.rendererJSON)!==JSON.stringify(this.lookup.rendererJSON))}return JSON.stringify(this.rendererJSON)!==JSON.stringify(this.lookup.rendererJSON)}_symbolizeColormap(e){if(this._isLUTChanged()){if(!this.bind().success)return e}return i(e,this.lookup.colormapLut)}_symbolizeClassBreaks(e){const{canUseIndexedLUT:t}=this._analyzeClassBreaks(this.rendererJSON);if(this._isLUTChanged()){if(!this.bind().success)return e}return t?i(e,this.lookup.colormapLut):l(e,this.lookup.remapLut??[])}_symbolizeStretch(e,t){const{rasterInfo:r}=this,{pixelType:s,bandCount:o}=r,a=this.rendererJSON,n=["u8","u16","s8","s16"].includes(s);let l,c;const{dra:p}=a,{gamma:f}=this.lookup;if("histogramEqualization"===a.stretchType){const s=p?null:this.lookup?.histogramLut,o=h(a,{rasterInfo:r,pixelBlock:e,bandIds:t,returnHistogramLut:!s}),n=d(e,{...o,gamma:f,isRenderer:!0});c=u(n,{lut:p?o.histogramLut:s,offset:0})}else if(n){if(p){const o=h(a,{rasterInfo:r,pixelBlock:e,bandIds:t});l=m({pixelType:s,...o,gamma:f,rounding:"floor"})}else if(this._isLUTChanged()){if(!this.bind().success)return e;l=this.lookup?this.lookup.stretchLut:null}else l=this.lookup?this.lookup.stretchLut:null;if(!l)return e;o>1&&null!=t&&t.length===e?.pixels.length&&l?.lut.length===o&&(l={lut:t.map((e=>l.lut[e])),offset:l.offset}),c=u(e,l)}else{const s=h(a,{rasterInfo:r,pixelBlock:e,bandIds:t});c=d(e,{...s,gamma:f,isRenderer:!0})}if(a.colorRamp){if(this._isLUTChanged(!0)){if(!this.bind().success)return e}c=i(c,this.lookup?.colormapLut)}return c}_symbolizeShadedRelief(e,t){const r=this.rendererJSON,s={...r,...t},o=g(e,s);if(!r.colorRamp)return o;let a;if(this._isLUTChanged(!0)){if(!this.bind().success)return o;a=this.lookup?this.lookup.hsvMap:null}else a=this.lookup?this.lookup.hsvMap:null;if(!a)return o;const n=this.rasterInfo.statistics?.[0]??{min:0,max:8e3};return b(o,e,a,n),o}_isVectorFieldData(){const{bandCount:e,dataType:t}=this.rasterInfo;return 2===e&&("vector-magdir"===t||"vector-uv"===t)}_updateVectorFieldRenderer(){return this._isVectorFieldData()?{success:!0}:{success:!1,error:`Unsupported data type "${this.rasterInfo.dataType}"; VectorFieldRenderer only supports "vector-magdir" and "vector-uv".`}}_updateFlowRenderer(){return this._isVectorFieldData()?{success:!0}:{success:!1,error:`Unsupported data type "${this.rasterInfo.dataType}"; FlowRenderer only supports "vector-magdir" and "vector-uv".`}}_updateUVRenderer(e){const{bandCount:t,attributeTable:r,pixelType:s}=this.rasterInfo,o=e.field1;if(!o)return{success:!1,error:"Unsupported renderer; missing UniqueValueRenderer.field."};const a=e.defaultSymbol,n=1===t&&["u8","s8"].includes(s);if(!R(this.rasterInfo,o)&&!n)return{success:!1,error:"Unsupported data; UniqueValueRenderer is only supported on single band data with a valid raster attribute table."};const i=[];if(null!=r){const t=r.fields.find((e=>"value"===e.name.toLowerCase()));if(!t)return{success:!1,error:"Unsupported data; the data's raster attribute table does not have a value field."};r.features.forEach((r=>{const s=e.uniqueValueInfos?.find((e=>String(e.value)===String(r.attributes[o]))),n=s?.symbol?.color;n?i.push([r.attributes[t.name]].concat(n)):a&&i.push([r.attributes[t.name]].concat(a.color))}))}else{if("value"!==o.toLowerCase())return{success:!1,error:'Unsupported renderer; UniqueValueRenderer.field must be "Value" when raster attribute table is not availalbe.'};e.uniqueValueInfos?.forEach((e=>{const t=e?.symbol?.color;t?i.push([parseInt(""+e.value,10)].concat(t)):a&&i.push([parseInt(""+e.value,10)].concat(a?.color))}))}if(0===i.length)return{success:!1,error:"Invalid UniqueValueRenderer. Cannot find matching records in the raster attribute table."};const l=c({colormap:i});return this.lookup={rendererJSON:e,colormapLut:l},this.canRenderInWebGL=!0,{success:!0}}_updateColormapRenderer(e){if(!x(this.rasterInfo))return{success:!1,error:"Unsupported data; the data source does not have a colormap."};const t=e.colormapInfos.map((e=>[e.value].concat(e.color))).sort(((e,t)=>e[0]-t[0]));if(!t||0===t.length)return{success:!1,error:"Unsupported renderer; ColormapRenderer must have meaningful colormapInfos."};const r=c({colormap:t});return this.lookup={rendererJSON:e,colormapLut:r},this.canRenderInWebGL=!0,{success:!0}}_updateShadedReliefRenderer(e){if(!I(this.rasterInfo))return{success:!1,error:`Unsupported data type "${this.rasterInfo.dataType}"; ShadedReliefRenderer only supports "elevation", or single band float/s16 data.`};if(e.colorRamp){const r=k(e.colorRamp,{interpolateAlpha:!0}),s=c({colormap:r}),o=[],a=s.indexedColormap;for(let e=0;e<a.length;e+=4){const r=t({r:a[e],g:a[e+1],b:a[e+2]});o.push([r.h/60,r.s/100,255*r.v/100])}this.lookup={rendererJSON:e,colormapLut:s,hsvMap:o}}else this.lookup=null;return this.canRenderInWebGL=!0,{success:!0}}_analyzeClassBreaks(e){const{attributeTable:t,pixelType:r}=this.rasterInfo,s=null!=t?t.fields.find((e=>"value"===e.name.toLowerCase())):null,o=null!=t?t.fields.find((t=>t.name.toLowerCase()===e.field.toLowerCase())):null,a=null!=s&&null!==o;return{canUseIndexedLUT:["u8","u16","s8","s16"].includes(r)||a,tableValueField:s,tableBreakField:o}}_updateClassBreaksRenderer(e){const{attributeTable:t}=this.rasterInfo,{canUseIndexedLUT:r,tableValueField:s,tableBreakField:o}=this._analyzeClassBreaks(e),a=e.classBreakInfos;if(!a?.length)return{success:!1,error:"Unsupported renderer; missing or invalid ClassBreaksRenderer.classBreakInfos."};const n=a.sort(((e,t)=>e.classMaxValue-t.classMaxValue)),i=n[n.length-1];let l=e.minValue;if(!r){const t=[];for(let e=0;e<n.length;e++)t.push({value:n[e].classMinValue??l,mappedColor:n[e].symbol.color}),l=n[e].classMaxValue;return t.push({value:i.classMaxValue,mappedColor:i.symbol.color}),this.lookup={rendererJSON:e,remapLut:t},this.canRenderInWebGL=!1,{success:!0}}const u=[];if(null!=t&&null!=s&&null!==o&&s!==o){const r=s.name,a=o.name,i=n[n.length-1],{classMaxValue:c}=i;l=e.minValue;for(const e of t.features){const t=e.attributes[r],s=e.attributes[a],o=s===c?i:s<l?null:n.find((({classMaxValue:e})=>e>s));o&&u.push([t].concat(o.symbol.color))}}else{l=Math.floor(e.minValue);for(let e=0;e<n.length;e++){const t=n[e];for(let e=l;e<t.classMaxValue;e++)u.push([e].concat(t.symbol.color));l=Math.ceil(t.classMaxValue)}i.classMaxValue===l&&u.push([i.classMaxValue].concat(i.symbol.color))}const p=c({colormap:u,fillUnspecified:!1});return this.lookup={rendererJSON:e,colormapLut:p},this.canRenderInWebGL=!0,{success:!0}}_isHistogramRequired(e){return"percentClip"===e||"histogramEqualization"===e}_isValidRasterStatistics(e){return null!=e&&e.length>0&&null!=e[0].min&&null!=e[0].max}_updateStretchRenderer(e){let{stretchType:t,dra:r}=e;if(!("none"===t||e.statistics?.length||this._isValidRasterStatistics(this.rasterInfo.statistics)||r))return{success:!1,error:"Unsupported renderer; StretchRenderer.statistics is required when dynamic range adjustment is not used."};const s=e.histograms||this.rasterInfo.histograms;!this._isHistogramRequired(e.stretchType)||s?.length||r||(t="minMax");const{computeGamma:o,useGamma:a,colorRamp:n}=e;let{gamma:i}=e;if(a&&o&&!i?.length){const t=e.statistics?.length?e.statistics:this.rasterInfo.statistics;i=f(this.rasterInfo.pixelType,t)}const l=this.rasterInfo.pixelType,u=!r&&["u8","u16","s8","s16"].includes(l);if("histogramEqualization"===t){const t=s.map((e=>y(e)));this.lookup={rendererJSON:e,histogramLut:t}}else if(u){const t=h(e,{rasterInfo:this.rasterInfo}),r=m({pixelType:l,...t,gamma:a?i:null,rounding:"floor"});this.lookup={rendererJSON:e,stretchLut:r}}if(n&&!this._isStretchColorRampNoop(n)){const t=k(n,{interpolateAlpha:!0});this.lookup||(this.lookup={rendererJSON:e}),this.lookup.colormapLut=c({colormap:t}),this.lookup.rendererJSON=e}return this.lookup.gamma=a&&i?.length?i:null,this.canRenderInWebGL=!0,{success:!0}}_isStretchColorRampNoop(e){return"algorithmic"===e.type&&["0,0,0,255","0,0,0"].includes(e.fromColor.join(","))&&["255,255,255,255","255,255,255"].includes(e.toColor.join(","))}_generateStretchWebGLParams(e,t,r){let s=null,o=null;const a=this.lookup?.colormapLut;t.colorRamp&&a&&(s=a.indexedColormap,o=a.offset),"histogramEqualization"===t.stretchType&&(t={...t,stretchType:"minMax"});const{gamma:n}=this.lookup,i=!!(t.useGamma&&n&&n.some((e=>1!==e))),{minCutOff:l,maxCutOff:u,outMin:c,outMax:p}=h(t,{rasterInfo:this.rasterInfo,pixelBlock:e,bandIds:r});let d=0;null!=e&&(d=e.getPlaneCount(),2===d&&((e=e.clone()).statistics=[e.statistics[0]],e.pixels=[e.pixels[0]]));const{bandCount:m}=this.rasterInfo,f=Math.min(3,r?.length||d||m,m),y=new Float32Array(f),g=s||i?1:255;let b;for(b=0;b<l.length;b++)y[b]=u[b]===l[b]?0:(p-c)/(u[b]-l[b])/g;const S=new Float32Array(f);if(i&&n)for(b=0;b<f;b++)n[b]>1?n[b]>2?S[b]=6.5+(n[b]-2)**2.5:S[b]=6.5+100*(2-n[b])**4:S[b]=1;return{bandCount:f,outMin:c/g,outMax:p/g,minCutOff:l,maxCutOff:u,factor:y,useGamma:i,gamma:i?n:[1,1,1],gammaCorrection:i?S:[1,1,1],colormap:s,colormapOffset:o,stretchType:t.stretchType,type:"stretch"}}_generateShadedReliefWebGLParams(e,t=!1,r={x:0,y:0}){let s=null,o=null;const a=this.lookup?.colormapLut;e.colorRamp&&a&&(s=a.indexedColormap,o=a.offset);const n={...e,isGCS:t,resolution:r},i=S(n),l=this.rasterInfo.statistics?.[0];return{...i,minValue:l?.min??0,maxValue:l?.max??8e3,hillshadeType:"traditional"===e.hillshadeType?0:1,type:"hillshade",colormap:s,colormapOffset:o}}_generateVectorFieldWebGLParams(e){const{style:t,inputUnit:r,outputUnit:s,visualVariables:o,symbolTileSize:a,flowRepresentation:n}=e;let i;const l=this.rasterInfo.statistics?.[0].min??0,u=this.rasterInfo.statistics?.[0].max??50,c=o?.find((e=>"sizeInfo"===e.type))??{type:"sizeInfo",field:"Magnitude",maxDataValue:u,maxSize:.8*a,minDataValue:l,minSize:.2*a},p=c.minDataValue??l,d=c.maxDataValue??u,h=null!=c.maxSize&&null!=c.minSize?[c.minSize/a,c.maxSize/a]:[.2,.8];if("wind_speed"===t){const e=(h[0]+h[1])/2;h[0]=h[1]=e}const m=null!=p&&null!=d?[p,d]:null;if("classified_arrow"===t)if(null!=p&&null!=d&&null!=c){i=[];const e=(c.maxDataValue-c.minDataValue)/5;for(let t=0;t<6;t++)i.push(c.minDataValue+e*t)}else i=[0,1e-6,3.5,7,10.5,14];const f="flow_to"===n===("ocean_current_kn"===t||"ocean_current_m"===t)?0:Math.PI,y=o?.find((e=>"rotationInfo"===e.type));return{breakValues:i,dataRange:m,inputUnit:r,outputUnit:s,symbolTileSize:a,symbolPercentRange:h,style:t||"single_arrow",rotation:f,rotationType:this.rasterInfo.storageInfo?.tileInfo&&"vector-uv"===this.rasterInfo.dataType?"geographic":y?.rotationType||e.rotationType,type:"vectorField"}}};function _(e){return p(e)&&0!==e.validPixelCount}e([o({json:{write:!0}})],C.prototype,"rendererJSON",void 0),e([o({type:n,json:{write:!0}})],C.prototype,"rasterInfo",void 0),e([o({json:{write:!0}})],C.prototype,"lookup",void 0),e([o()],C.prototype,"canRenderInWebGL",void 0),C=e([a("esri.renderers.support.RasterSymbolizer")],C);const L=C;export{L as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import e from"../Basemap.js";import r from"../config.js";import t from"../core/Collection.js";import n from"../core/Logger.js";import{destroyMaybe as a,mappedFind as i}from"../core/maybe.js";import{Url as l,makeAbsolute as s,normalize as u}from"../core/urlUtils.js";import{ensureType as c}from"../core/accessorSupport/ensureType.js";import{effectEquals as o}from"../layers/effects/utils.js";import{esriBasemapDefinitions as f}from"./basemapDefinitions.js";const p=n.getLogger("esri.support.basemapUtils");function y(){return{}}function m(e){for(const r in e){const t=e[r];a(t),delete e[r]}}function d(t,n){let a;if("string"==typeof t){const i=t in f,l=!i&&t.includes("/");if(!i&&!l){const e=Object.entries(f).filter((([e,t])=>r.apiKey&&!t.classic&&!t.is3d||!r.apiKey&&t.classic)).map((([e])=>`"${e}"`)).sort().join(", ");return p.warn(`Unable to find basemap definition for: ${t}. Try one of these: ${e}`),null}n&&(a=n[t]),a||(a=i?e.fromId(t):new e({style:{id:t}}),n&&(n[t]=a))}else a=c(e,t);return a?.destroyed&&(p.warn("The provided basemap is already destroyed",{basemap:a}),a=null),a}function b(e){return"Web Scene"===e.portalItem?.type}function L(e,r){return e.basemap?.referenceLayers?.some((e=>e.uid===r))||e.basemap?.baseLayers?.some((e=>e.uid===r))}function S(e,r=null){const t=d(e);if(!t)return null;const n=t.clone();return r&&(n.baseLayers=R(n.baseLayers,r.baseLayers),n.referenceLayers=R(n.referenceLayers,r.referenceLayers)),n}let v;function g(e){if(v)return v(e);let r=null;const t=x(e),n=!t?.baseLayers.length;for(const a in f){const e=B(t,$(f[a]),{mustMatchReferences:n});if("equal"===e){r=a;break}"base-layers-equal"===e&&(r=a)}return r}function h(e){v=e}function I(e,r){if(e===r)return!0;if(null!=e?.portalItem?.id&&e.portalItem.id===r?.portalItem?.id)return!0;return"equal"===B(x(e),x(r),{mustMatchReferences:!0})}function R(e,r){const n=new t;return e.forEach((e=>{const t=r.find((r=>"scene"!==r.type&&N(k(e),k(r))))||e;n.includes(t)?n.push(e):n.push(t)})),n}function T(e){return!!e?.baseLayers.concat(e.referenceLayers).some(j)}function j(e){if(q(e.url))return!0;if("vector-tile"===e.type)for(const r in e.sourceNameToSource){const t=e.sourceNameToSource[r];if(q(t?.sourceUrl))return!0}return!1}function w(e,r){if(null==r||null==e)return{spatialReference:null,updating:!1};if("not-loaded"===r.loadStatus)return r.load(),{spatialReference:null,updating:!0};if(r.spatialReference)return{spatialReference:r.spatialReference,updating:!1};if(0===r.baseLayers.length)return{spatialReference:null,updating:!1};const t=r.baseLayers.at(0);switch(t.loadStatus){case"not-loaded":t.load();case"loading":return{spatialReference:null,updating:!0};case"failed":return{spatialReference:null,updating:!1}}const n=(("supportedSpatialReferences"in t?t.supportedSpatialReferences:null)||["tileInfo"in t?t.tileInfo?.spatialReference:t.spatialReference]).filter(Boolean),a=e.spatialReference;return a?{spatialReference:n.find((e=>a.equals(e)))??n[0]??null,updating:!1}:{spatialReference:n[0],updating:!1}}const U=/^(basemaps|ibasemaps).*-api\.arcgis\.com$/i;function q(e){if(!e)return!1;const r=new l(s(e));return!!r.authority&&U.test(r.authority)}function x(e){return e?!e.loaded&&e.resourceInfo?$(e.resourceInfo.data):{baseLayers:M(e.baseLayers),referenceLayers:M(e.referenceLayers)}:null}function M(e){return(t.isCollection(e)?e.toArray():e).map(k)}function k(e){return{type:e.type,effect:"effect"in e?e.effect:void 0,url:D("urlTemplate"in e&&e.urlTemplate||e.url||"styleUrl"in e&&e.styleUrl||""),minScale:"minScale"in e&&null!=e.minScale?e.minScale:0,maxScale:"maxScale"in e&&null!=e.maxScale?e.maxScale:0,opacity:null!=e.opacity?e.opacity:1,visible:null==e.visible||!!e.visible,sublayers:"map-image"!==e.type&&"wms"!==e.type||null==e.sublayers?void 0:e.sublayers?.map((e=>({id:e.id,visible:e.visible}))),activeLayerId:"wmts"===e.type?e.activeLayer?.id:void 0}}function A(e){return e.isReference||"ArcGISSceneServiceLayer"===e.layerType}function $(e){return e?{baseLayers:C((e.baseMapLayers??[]).filter((e=>!A(e)))),referenceLayers:C((e.baseMapLayers??[]).filter((e=>A(e))))}:null}function C(e){return e.map((e=>G(e)))}function G(e){let r;switch(e.layerType){case"VectorTileLayer":r="vector-tile";break;case"ArcGISTiledMapServiceLayer":r="tile";break;case"ArcGISSceneServiceLayer":r="scene";break;default:r="unknown"}return{type:r,effect:e.effect,url:D(e.templateUrl||e.urlTemplate||e.styleUrl||e.url),minScale:e.minScale??0,maxScale:e.maxScale??0,opacity:e.opacity??1,visible:null==e.visibility||!!e.visibility,sublayers:void 0,activeLayerId:void 0}}function B(e,r,t){if(null!=e!=(null!=r))return"not-equal";if(!e||!r)return"equal";if(!K(e.baseLayers,r.baseLayers))return"not-equal";return K(e.referenceLayers,r.referenceLayers)?"equal":t.mustMatchReferences?"not-equal":"base-layers-equal"}function K(e,r){if(e.length!==r.length)return!1;for(let t=0;t<e.length;t++)if(!N(e[t],r[t]))return!1;return!0}function N(e,r){if(e.type!==r.type||e.url!==r.url||e.minScale!==r.minScale||e.maxScale!==r.maxScale||e.visible!==r.visible||e.opacity!==r.opacity)return!1;if(!o(e.effect,r.effect))return!1;if(null!=e.activeLayerId||null!=r.activeLayerId)return e.activeLayerId===r.activeLayerId;if(null!=e.sublayers||null!=r.sublayers){if(null==e.sublayers||null==r.sublayers||e.sublayers.length!==r.sublayers.length)return!1;for(let t=0;t<e.sublayers.length;t++){const n=e.sublayers.at(t),a=r.sublayers.at(t);if(n?.id!==a?.id||n?.visible!==a?.visible)return!1}}return!0}function D(e){return e?u(e).replace(/^\s*https?:/i,"").toLowerCase():""}function E(e){if(!e)return null;const{thumbnailUrl:r}=e;if(r)return r;const t=g(e);return t?f[t].thumbnailUrl:i(e.baseLayers,O)}function O(e){return"portalItem"in e?e.portalItem?.thumbnailUrl:void 0}export{S as clonePreservingTiledLayers,I as contentEquals,y as createCache,m as destroyCache,d as ensureType,w as findSpatialReference,E as getBasemapThumbnailUrl,g as getWellKnownBasemapId,T as hasDeveloperBasemapLayer,b as isBasemap3D,L as isBasemapLayer,j as isDeveloperBasemapLayer,h as overrideGetWellKnownBasemapId};
5
+ import e from"../Basemap.js";import r from"../config.js";import t from"../core/Collection.js";import n from"../core/Logger.js";import{destroyMaybe as a,mappedFind as i}from"../core/maybe.js";import{Url as l,makeAbsolute as s,normalize as u}from"../core/urlUtils.js";import{ensureType as c}from"../core/accessorSupport/ensureType.js";import{effectEquals as o}from"../layers/effects/utils.js";import{esriBasemapDefinitions as f}from"./basemapDefinitions.js";const p=n.getLogger("esri.support.basemapUtils");function y(){return{}}function m(e){for(const r in e){const t=e[r];a(t),delete e[r]}}function d(t,n){let a;if("string"==typeof t){const i=t in f,l=!i&&t.includes("/");if(!i&&!l){const e=Object.entries(f).filter((([e,t])=>r.apiKey&&!t.classic||!r.apiKey&&(t.classic||t.is3d))).map((([e])=>`"${e}"`)).sort().join(", ");return p.warn(`Unable to find basemap definition for: ${t}. Try one of these: ${e}`),null}n&&(a=n[t]),a||(a=i?e.fromId(t):new e({style:{id:t}}),n&&(n[t]=a))}else a=c(e,t);return a?.destroyed&&(p.warn("The provided basemap is already destroyed",{basemap:a}),a=null),a}function b(e){return"Web Scene"===e.portalItem?.type}function L(e,r){return e.basemap?.referenceLayers?.some((e=>e.uid===r))||e.basemap?.baseLayers?.some((e=>e.uid===r))}function S(e,r=null){const t=d(e);if(!t)return null;const n=t.clone();return r&&(n.baseLayers=R(n.baseLayers,r.baseLayers),n.referenceLayers=R(n.referenceLayers,r.referenceLayers)),n}let v;function g(e){if(v)return v(e);let r=null;const t=x(e),n=!t?.baseLayers.length;for(const a in f){const e=B(t,$(f[a]),{mustMatchReferences:n});if("equal"===e){r=a;break}"base-layers-equal"===e&&(r=a)}return r}function h(e){v=e}function I(e,r){if(e===r)return!0;if(null!=e?.portalItem?.id&&e.portalItem.id===r?.portalItem?.id)return!0;return"equal"===B(x(e),x(r),{mustMatchReferences:!0})}function R(e,r){const n=new t;return e.forEach((e=>{const t=r.find((r=>"scene"!==r.type&&N(k(e),k(r))))||e;n.includes(t)?n.push(e):n.push(t)})),n}function T(e){return!!e?.baseLayers.concat(e.referenceLayers).some(j)}function j(e){if(q(e.url))return!0;if("vector-tile"===e.type)for(const r in e.sourceNameToSource){const t=e.sourceNameToSource[r];if(q(t?.sourceUrl))return!0}return!1}function w(e,r){if(null==r||null==e)return{spatialReference:null,updating:!1};if("not-loaded"===r.loadStatus)return r.load(),{spatialReference:null,updating:!0};if(r.spatialReference)return{spatialReference:r.spatialReference,updating:!1};if(0===r.baseLayers.length)return{spatialReference:null,updating:!1};const t=r.baseLayers.at(0);switch(t.loadStatus){case"not-loaded":t.load();case"loading":return{spatialReference:null,updating:!0};case"failed":return{spatialReference:null,updating:!1}}const n=(("supportedSpatialReferences"in t?t.supportedSpatialReferences:null)||["tileInfo"in t?t.tileInfo?.spatialReference:t.spatialReference]).filter(Boolean),a=e.spatialReference;return a?{spatialReference:n.find((e=>a.equals(e)))??n[0]??null,updating:!1}:{spatialReference:n[0],updating:!1}}const U=/^(basemaps|ibasemaps).*-api\.arcgis\.com$/i;function q(e){if(!e)return!1;const r=new l(s(e));return!!r.authority&&U.test(r.authority)}function x(e){return e?!e.loaded&&e.resourceInfo?$(e.resourceInfo.data):{baseLayers:M(e.baseLayers),referenceLayers:M(e.referenceLayers)}:null}function M(e){return(t.isCollection(e)?e.toArray():e).map(k)}function k(e){return{type:e.type,effect:"effect"in e?e.effect:void 0,url:D("urlTemplate"in e&&e.urlTemplate||e.url||"styleUrl"in e&&e.styleUrl||""),minScale:"minScale"in e&&null!=e.minScale?e.minScale:0,maxScale:"maxScale"in e&&null!=e.maxScale?e.maxScale:0,opacity:null!=e.opacity?e.opacity:1,visible:null==e.visible||!!e.visible,sublayers:"map-image"!==e.type&&"wms"!==e.type||null==e.sublayers?void 0:e.sublayers?.map((e=>({id:e.id,visible:e.visible}))),activeLayerId:"wmts"===e.type?e.activeLayer?.id:void 0}}function A(e){return e.isReference||"ArcGISSceneServiceLayer"===e.layerType}function $(e){return e?{baseLayers:C((e.baseMapLayers??[]).filter((e=>!A(e)))),referenceLayers:C((e.baseMapLayers??[]).filter((e=>A(e))))}:null}function C(e){return e.map((e=>G(e)))}function G(e){let r;switch(e.layerType){case"VectorTileLayer":r="vector-tile";break;case"ArcGISTiledMapServiceLayer":r="tile";break;case"ArcGISSceneServiceLayer":r="scene";break;default:r="unknown"}return{type:r,effect:e.effect,url:D(e.templateUrl||e.urlTemplate||e.styleUrl||e.url),minScale:e.minScale??0,maxScale:e.maxScale??0,opacity:e.opacity??1,visible:null==e.visibility||!!e.visibility,sublayers:void 0,activeLayerId:void 0}}function B(e,r,t){if(null!=e!=(null!=r))return"not-equal";if(!e||!r)return"equal";if(!K(e.baseLayers,r.baseLayers))return"not-equal";return K(e.referenceLayers,r.referenceLayers)?"equal":t.mustMatchReferences?"not-equal":"base-layers-equal"}function K(e,r){if(e.length!==r.length)return!1;for(let t=0;t<e.length;t++)if(!N(e[t],r[t]))return!1;return!0}function N(e,r){if(e.type!==r.type||e.url!==r.url||e.minScale!==r.minScale||e.maxScale!==r.maxScale||e.visible!==r.visible||e.opacity!==r.opacity)return!1;if(!o(e.effect,r.effect))return!1;if(null!=e.activeLayerId||null!=r.activeLayerId)return e.activeLayerId===r.activeLayerId;if(null!=e.sublayers||null!=r.sublayers){if(null==e.sublayers||null==r.sublayers||e.sublayers.length!==r.sublayers.length)return!1;for(let t=0;t<e.sublayers.length;t++){const n=e.sublayers.at(t),a=r.sublayers.at(t);if(n?.id!==a?.id||n?.visible!==a?.visible)return!1}}return!0}function D(e){return e?u(e).replace(/^\s*https?:/i,"").toLowerCase():""}function E(e){if(!e)return null;const{thumbnailUrl:r}=e;if(r)return r;const t=g(e);return t?f[t].thumbnailUrl:i(e.baseLayers,O)}function O(e){return"portalItem"in e?e.portalItem?.thumbnailUrl:void 0}export{S as clonePreservingTiledLayers,I as contentEquals,y as createCache,m as destroyCache,d as ensureType,w as findSpatialReference,E as getBasemapThumbnailUrl,g as getWellKnownBasemapId,T as hasDeveloperBasemapLayer,b as isBasemap3D,L as isBasemapLayer,j as isDeveloperBasemapLayer,h as overrideGetWellKnownBasemapId};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- const a="20231003",d="411ac9fdab20da6ef405080151568a8e4d468d34";export{a as buildDate,d as commitHash};
5
+ const a="20231004",e="7ca212dca3952bea39657e4b12d4e9f5da74aed5";export{a as buildDate,e as commitHash};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{_ as o}from"../chunks/tslib.es6.js";import r from"../core/Collection.js";import{clone as e}from"../core/lang.js";import{property as s}from"../core/accessorSupport/decorators/property.js";import"../core/accessorSupport/ensureType.js";import{enumeration as t}from"../core/accessorSupport/decorators/enumeration.js";import{subclass as l}from"../core/accessorSupport/decorators/subclass.js";import m from"./ExtrudeSymbol3DLayer.js";import y from"./FillSymbol3DLayer.js";import a from"./IconSymbol3DLayer.js";import i from"./LineSymbol3DLayer.js";import p from"./ObjectSymbol3DLayer.js";import n from"./Symbol3D.js";import c from"./TextSymbol3DLayer.js";import b from"./WaterSymbol3DLayer.js";var f;const u=r.ofType({base:null,key:"type",typeMap:{extrude:m,fill:y,icon:a,line:i,object:p,text:c,water:b}});let L=f=class extends n{constructor(o){super(o),this.symbolLayers=new u,this.type="polygon-3d"}clone(){return new f({styleOrigin:e(this.styleOrigin),symbolLayers:e(this.symbolLayers),thumbnail:e(this.thumbnail)})}static fromJSON(o){const r=new f;if(r.read(o),2===r.symbolLayers.length&&"fill"===r.symbolLayers.at(0).type&&"line"===r.symbolLayers.at(1).type){const e=r.symbolLayers.at(0),s=r.symbolLayers.at(1);!s.enabled||o.symbolLayers?.[1]&&!1===o.symbolLayers[1].enable||(e.outline={size:s.size,color:null!=s.material?s.material.color:null}),r.symbolLayers.removeAt(1)}return r}static fromSimpleFillSymbol(o){return new f({symbolLayers:new r([y.fromSimpleFillSymbol(o)])})}};o([s({type:u,json:{write:!0}})],L.prototype,"symbolLayers",void 0),o([t({PolygonSymbol3D:"polygon-3d"},{readOnly:!0})],L.prototype,"type",void 0),L=f=o([l("esri.symbols.PolygonSymbol3D")],L);const S=L;export{S as default};
5
+ import{_ as o}from"../chunks/tslib.es6.js";import e from"../core/Collection.js";import{deprecated as r}from"../core/deprecate.js";import{clone as s}from"../core/lang.js";import t from"../core/Logger.js";import{on as l,sync as y}from"../core/reactiveUtils.js";import{property as m}from"../core/accessorSupport/decorators/property.js";import"../core/accessorSupport/ensureType.js";import{enumeration as a}from"../core/accessorSupport/decorators/enumeration.js";import{subclass as i}from"../core/accessorSupport/decorators/subclass.js";import n from"./ExtrudeSymbol3DLayer.js";import p from"./FillSymbol3DLayer.js";import b from"./IconSymbol3DLayer.js";import c from"./LineSymbol3DLayer.js";import L from"./ObjectSymbol3DLayer.js";import f from"./Symbol3D.js";import S from"./TextSymbol3DLayer.js";import u from"./WaterSymbol3DLayer.js";var d;const j=e.ofType({base:null,key:"type",typeMap:{extrude:n,fill:p,icon:b,line:c,object:L,text:S,water:u}});let g=d=class extends f{constructor(o){super(o),this.symbolLayers=new j,this.type="polygon-3d"}initialize(){const o=o=>{"line"===o.type&&r(t.getLogger(this),"LineSymbol3DLayer can not be used as a SymbolLayer with a PolygonSymbol3D symbol anymore.",{replacement:"Use FillSymbol3DLayer.outline instead.",version:"4.28"}),"text"===o.type&&r(t.getLogger(this),"TextSymbol3DLayer can not be used as a SymbolLayer with a PolygonSymbol3D symbol anymore.",{replacement:"Use Labels instead.",version:"4.28"})};for(const e of this.symbolLayers)o(e);this.addHandles(l((()=>this.symbolLayers),"after-add",(({item:e})=>o(e)),y))}clone(){return new d({styleOrigin:s(this.styleOrigin),symbolLayers:s(this.symbolLayers),thumbnail:s(this.thumbnail)})}static fromJSON(o){const e=new d;if(e.read(o),2===e.symbolLayers.length&&"fill"===e.symbolLayers.at(0).type&&"line"===e.symbolLayers.at(1).type){const r=e.symbolLayers.at(0),s=e.symbolLayers.at(1);!s.enabled||o.symbolLayers?.[1]&&!1===o.symbolLayers[1].enable||(r.outline={size:s.size,color:null!=s.material?s.material.color:null}),e.symbolLayers.removeAt(1)}return e}static fromSimpleFillSymbol(o){return new d({symbolLayers:new e([p.fromSimpleFillSymbol(o)])})}};o([m({type:j,json:{write:!0}})],g.prototype,"symbolLayers",void 0),o([a({PolygonSymbol3D:"polygon-3d"},{readOnly:!0})],g.prototype,"type",void 0),g=d=o([i("esri.symbols.PolygonSymbol3D")],g);const h=g;export{h as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{disposeMaybe as t}from"../../../../core/maybe.js";import{g as e,h as s,r,l as i,m as o}from"../../../../chunks/mat3.js";import{c as a}from"../../../../chunks/mat3f32.js";import{f as u}from"../../../../chunks/vec2f32.js";import{DisplayObject as h}from"../DisplayObject.js";import{TextureSamplingMode as n}from"../../../webgl/enums.js";import{createTransformTexture as l,createRasterTexture as d,createColormapTexture as c}from"../../../webgl/rasterUtils.js";const p={bandCount:3,outMin:0,outMax:1,minCutOff:[0,0,0],maxCutOff:[255,255,255],factor:[1/255,1/255,1/255],useGamma:!1,gamma:[1,1,1],gammaCorrection:[1,1,1],colormap:null,colormapOffset:null,stretchType:"none",type:"stretch"};class _ extends h{constructor(t=null,e=null,s=null){super(),this._textureInvalidated=!0,this._colormapTextureInvalidated=!0,this._rasterTexture=null,this._rasterTextureBandIds=null,this._transformGridTexture=null,this._colormapTexture=null,this._colormap=null,this._supportsBilinearTexture=!0,this._processedTexture=null,this.functionTextures=[],this.projected=!1,this.stencilRef=0,this.coordScale=[1,1],this._processed=!1,this._symbolizerParameters=null,this.height=null,this.isRendereredSource=!1,this.pixelRatio=1,this.resolution=0,this.rotation=0,this._source=null,this.rawPixelData=null,this._suspended=!1,this._bandIds=null,this._interpolation=null,this._transformGrid=null,this.width=null,this.x=0,this.y=0,this.source=t,this.transformGrid=e,this.interpolation=s}destroy(){this._disposeTextures()}get processedTexture(){return this._processedTexture}set processedTexture(t){this._processedTexture!==t&&(this._disposeTextures(!0),this._processedTexture=t)}get rasterTexture(){return this._rasterTexture}set rasterTexture(t){this._rasterTexture!==t&&(this._rasterTexture?.dispose(),this._rasterTexture=t),null==t&&(this.projected=!1)}get processed(){return this._processed}set processed(e){this._processed=e,e||(t(this.processedTexture),this.invalidateTexture())}get symbolizerParameters(){return this._symbolizerParameters||p}set symbolizerParameters(t){this._symbolizerParameters!==t&&(this._symbolizerParameters=t,this._colormapTextureInvalidated=!0,this.commonUniforms=null)}get source(){return this._source}set source(t){this._source!==t&&(this._source=t,this._rasterTexture&&(this._rasterTexture.dispose(),this._rasterTexture=null,this._rasterTextureBandIds=null),this.commonUniforms=null,this.projected=!1,this.invalidateTexture())}get suspended(){return this._suspended}set suspended(t){this._suspended&&!t&&this.stage&&(this.ready(),this.requestRender()),this._suspended=t}get bandIds(){return this._bandIds}set bandIds(t){this._bandIds=t,this._isBandIdschanged(t)&&(this.projected=!1,this.invalidateTexture())}get interpolation(){return this._interpolation||"nearest"}set interpolation(t){this._interpolation=t,this._rasterTexture&&this._rasterTexture.setSamplingMode("bilinear"===this._getTextureSamplingMethod(t||"nearest")?n.LINEAR:n.NEAREST)}get transformGrid(){return this._transformGrid}set transformGrid(e){this._transformGrid!==e&&(this._transformGrid=e,this._transformGridTexture=t(this._transformGridTexture))}invalidateTexture(){this._textureInvalidated||(this._textureInvalidated=!0,this.requestRender())}getRasterTextureSize(t=!1){const e=t||this.projected;return[e?this.width:this.source?.width||this.width,e?this.height:this.source?.height||this.height]}getRasterCellSize(){const t=this.rawPixelData?.srcPixelSize,{projected:e,resolution:s}=this;return t&&!e?[t.x,t.y]:[s,s]}_createTransforms(){return{dvs:a()}}setTransform(t){const a=e(this.transforms.dvs),[h,n]=t.toScreenNoRotation([0,0],[this.x,this.y]),l=this.resolution/this.pixelRatio/t.resolution,d=l*this.width,c=l*this.height,p=Math.PI*this.rotation/180;s(a,a,u(h,n)),s(a,a,u(d/2,c/2)),r(a,a,-p),s(a,a,u(-d/2,-c/2)),i(a,a,u(d,c)),o(this.transforms.dvs,t.displayViewMat3,a)}getTextures({forProcessing:t=!1,useProcessedTexture:e=!1}={}){const s=e?this._processedTexture??this._rasterTexture:this._rasterTexture,r=[],i=[];return s?(this._transformGridTexture&&!this.projected&&(i.push(this._transformGridTexture),r.push("u_transformGrid")),e?(i.push(s),r.push("u_image"),this._colormapTexture&&(i.push(this._colormapTexture),r.push("u_colormap")),{names:r,textures:i}):(i.push(s),r.push("u_image"),this._colormapTexture&&!t&&(i.push(this._colormapTexture),r.push("u_colormap")),{names:r,textures:i})):{names:r,textures:i}}onAttach(){this.invalidateTexture()}onDetach(){this.invalidateTexture()}updateTexture({context:t}){if(!this.stage)return void this._disposeTextures();const e=this._isValidSource(this.source);e&&this._colormapTextureInvalidated&&(this._colormapTextureInvalidated=!1,this._updateColormapTexture(t)),this._textureInvalidated&&(this._textureInvalidated=!1,this._createOrDestroyRasterTexture(t),this._rasterTexture&&(e?this.transformGrid&&!this._transformGridTexture&&(this._transformGridTexture=l(t,this.transformGrid)):this._rasterTexture.setData(null)),this.suspended||(this.ready(),this.requestRender()))}updateProcessedTexture(){const{functionTextures:t}=this;0!==t.length&&(this.processedTexture=t.shift(),t.forEach((t=>t?.dispose())),t.length=0)}_createOrDestroyRasterTexture(t){const e=this.source?.extractBands(this.bandIds);if(!this._isValidSource(e))return void(this._rasterTexture&&(this._rasterTexture.dispose(),this._rasterTextureBandIds=null,this._rasterTexture=null));const s=!this._isBandIdschanged(this.bandIds);if(this._rasterTexture){if(s)return;this._rasterTexture.dispose(),this._rasterTextureBandIds=null,this._rasterTexture=null}this._supportsBilinearTexture=!!t.capabilities.textureFloat?.textureFloatLinear;const r=this._getTextureSamplingMethod(this.interpolation),i=this.isRendereredSource||!t.capabilities.textureFloat?.textureFloat;this._rasterTexture=d(t,e,r,i),this.projected=!1,this._processed=!1,this._rasterTextureBandIds=this.bandIds?[...this.bandIds]:null}_isBandIdschanged(t){const e=this._rasterTextureBandIds;return!(null==e&&null==t||e&&t&&e.join("")===t.join(""))}_isValidSource(t){return null!=t&&t.pixels?.length>0}_getTextureSamplingMethod(t){const{type:e,colormap:s}=this.symbolizerParameters,r="lut"===e||"stretch"===e&&null!=s;return!this._supportsBilinearTexture||r||"bilinear"!==t&&"cubic"!==t?"nearest":"bilinear"}_updateColormapTexture(t){const e=this._colormap,s=this.symbolizerParameters.colormap;return s?e?s.length!==e.length||s.some(((t,s)=>t!==e[s]))?(this._colormapTexture&&(this._colormapTexture.dispose(),this._colormapTexture=null),this._colormapTexture=c(t,s),void(this._colormap=s)):void 0:(this._colormapTexture=c(t,s),void(this._colormap=s)):(this._colormapTexture&&(this._colormapTexture.dispose(),this._colormapTexture=null),void(this._colormap=null))}_disposeTextures(t=!1){!this._transformGridTexture||t&&!this.projected||(this._transformGridTexture.dispose(),this._transformGridTexture=null),!t&&this._colormapTexture&&(this._colormapTexture.dispose(),this._colormapTexture=null,this._colormap=null,this._colormapTextureInvalidated=!0),!t&&this._rasterTexture&&(this._rasterTexture.dispose(),this._rasterTexture=null,this._rasterTextureBandIds=null),this._processedTexture&&(this._processedTexture.dispose(),this._processedTexture=null)}}class x extends _{get source(){return this._source}}function m(t){return null!=t.source}export{_ as RasterBitmap,x as RasterBitmapWithSource,m as hasSource};
5
+ import{disposeMaybe as t}from"../../../../core/maybe.js";import{g as e,h as s,r,l as i,m as o}from"../../../../chunks/mat3.js";import{c as a}from"../../../../chunks/mat3f32.js";import{f as u}from"../../../../chunks/vec2f32.js";import{DisplayObject as h}from"../DisplayObject.js";import{TextureSamplingMode as n}from"../../../webgl/enums.js";import{createTransformTexture as l,createRasterTexture as d,createColormapTexture as c}from"../../../webgl/rasterUtils.js";const _={bandCount:3,outMin:0,outMax:1,minCutOff:[0,0,0],maxCutOff:[255,255,255],factor:[1/255,1/255,1/255],useGamma:!1,gamma:[1,1,1],gammaCorrection:[1,1,1],colormap:null,colormapOffset:null,stretchType:"none",type:"stretch"};class p extends h{constructor(t=null,e=null,s=null){super(),this._textureInvalidated=!0,this._colormapTextureInvalidated=!0,this._rasterTexture=null,this._rasterTextureBandIds=null,this._transformGridTexture=null,this._colormapTexture=null,this._colormap=null,this._supportsBilinearTexture=!0,this._processedTexture=null,this.functionTextures=[],this.projected=!1,this.stencilRef=0,this.coordScale=[1,1],this._processed=!1,this._symbolizerParameters=null,this.height=null,this.isRendereredSource=!1,this.pixelRatio=1,this.resolution=0,this.rotation=0,this._source=null,this.rawPixelData=null,this._suspended=!1,this._bandIds=null,this._interpolation=null,this._transformGrid=null,this.width=null,this.x=0,this.y=0,this.source=t,this.transformGrid=e,this.interpolation=s}destroy(){this._disposeTextures()}get processedTexture(){return this._processedTexture}set processedTexture(t){this._processedTexture!==t&&(this._disposeTextures(!0),this._processedTexture=t)}get rasterTexture(){return this._rasterTexture}set rasterTexture(t){this._rasterTexture!==t&&(this._rasterTexture?.dispose(),this._rasterTexture=t),null==t&&(this.projected=!1)}get processed(){return this._processed}set processed(e){this._processed=e,e||(t(this.processedTexture),this.invalidateTexture())}get symbolizerParameters(){return this._symbolizerParameters||_}set symbolizerParameters(t){this._symbolizerParameters!==t&&(this._symbolizerParameters=t,this._colormapTextureInvalidated=!0,this.commonUniforms=null)}get source(){return this._source}set source(t){this._source!==t&&(this._source=t,this._rasterTexture&&(this._rasterTexture.dispose(),this._rasterTexture=null,this._rasterTextureBandIds=null),this.commonUniforms=null,this.projected=!1,this.invalidateTexture())}get suspended(){return this._suspended}set suspended(t){this._suspended&&!t&&this.stage&&(this.ready(),this.requestRender()),this._suspended=t}get bandIds(){return this._bandIds}set bandIds(t){this._bandIds=t,this._isBandIdschanged(t)&&(this.projected=!1,this.invalidateTexture())}get interpolation(){return this._interpolation||"nearest"}set interpolation(t){this._interpolation=t,this._rasterTexture&&this._rasterTexture.setSamplingMode("bilinear"===this._getTextureSamplingMethod(t||"nearest")?n.LINEAR:n.NEAREST)}get transformGrid(){return this._transformGrid}set transformGrid(e){this._transformGrid!==e&&(this._transformGrid=e,this._transformGridTexture=t(this._transformGridTexture))}invalidateTexture(){this._textureInvalidated||(this._textureInvalidated=!0,this.requestRender())}getRasterTextureSize(t=!1){const e=t||this.projected;return[e?this.width:this.source?.width||this.width,e?this.height:this.source?.height||this.height]}getRasterCellSize(){const t=this.rawPixelData?.srcPixelSize,{projected:e,resolution:s}=this;return t&&!e?[t.x,t.y]:[s,s]}_createTransforms(){return{dvs:a()}}setTransform(t){const a=e(this.transforms.dvs),[h,n]=t.toScreenNoRotation([0,0],[this.x,this.y]),l=this.resolution/this.pixelRatio/t.resolution,d=l*this.width,c=l*this.height,_=Math.PI*this.rotation/180;s(a,a,u(h,n)),s(a,a,u(d/2,c/2)),r(a,a,-_),s(a,a,u(-d/2,-c/2)),i(a,a,u(d,c)),o(this.transforms.dvs,t.displayViewMat3,a)}getTextures({forProcessing:t=!1,useProcessedTexture:e=!1}={}){const s=e?this._processedTexture??this._rasterTexture:this._rasterTexture,r=[],i=[];return s?(this._transformGridTexture&&!this.projected&&(i.push(this._transformGridTexture),r.push("u_transformGrid")),e?(i.push(s),r.push("u_image"),this._colormapTexture&&(i.push(this._colormapTexture),r.push("u_colormap")),{names:r,textures:i}):(i.push(s),r.push("u_image"),this._colormapTexture&&!t&&(i.push(this._colormapTexture),r.push("u_colormap")),{names:r,textures:i})):{names:r,textures:i}}onAttach(){this.invalidateTexture()}onDetach(){this.invalidateTexture()}updateTexture({context:t}){if(!this.stage)return void this._disposeTextures();const e=this._isValidSource(this.source);e&&this._colormapTextureInvalidated&&(this._colormapTextureInvalidated=!1,this._updateColormapTexture(t)),this._textureInvalidated&&(this._textureInvalidated=!1,this._createOrDestroyRasterTexture(t),this._rasterTexture&&(e?this.transformGrid&&!this._transformGridTexture&&(this._transformGridTexture=l(t,this.transformGrid)):this._rasterTexture.setData(null)),this.suspended||(this.ready(),this.requestRender()))}updateProcessedTexture(){const{functionTextures:t}=this;0!==t.length&&(this.processedTexture=t.shift(),t.forEach((t=>t?.dispose())),t.length=0)}_createOrDestroyRasterTexture(t){const e=this.source?.extractBands(this.bandIds);if(!this._isValidSource(e))return void(this._rasterTexture&&(this._rasterTexture.dispose(),this._rasterTextureBandIds=null,this._rasterTexture=null));const s=!this._isBandIdschanged(this.bandIds);if(this._rasterTexture){if(s)return;this._rasterTexture.dispose(),this._rasterTextureBandIds=null,this._rasterTexture=null}this._supportsBilinearTexture=!!t.capabilities.textureFloat?.textureFloatLinear;const r=this._getTextureSamplingMethod(this.interpolation),i=this.isRendereredSource||!t.capabilities.textureFloat?.textureFloat;this._rasterTexture=d(t,e,r,i),this.projected=!1,this._processed=!1,this._rasterTextureBandIds=this.bandIds?[...this.bandIds]:null}_isBandIdschanged(t){const e=this._rasterTextureBandIds;return!(null==e&&null==t||e&&t&&e.join("")===t.join(""))}_isValidSource(t){return null!=t&&t.pixels?.length>0}_getTextureSamplingMethod(t){const{type:e}=this.symbolizerParameters,s="lut"===e||"hillshade"===e||"stretch"===e&&1===this.symbolizerParameters.bandCount;return!this._supportsBilinearTexture||s||"bilinear"!==t&&"cubic"!==t?"nearest":"bilinear"}_updateColormapTexture(t){const e=this._colormap,s=this.symbolizerParameters.colormap;return s?e?s.length!==e.length||s.some(((t,s)=>t!==e[s]))?(this._colormapTexture&&(this._colormapTexture.dispose(),this._colormapTexture=null),this._colormapTexture=c(t,s),void(this._colormap=s)):void 0:(this._colormapTexture=c(t,s),void(this._colormap=s)):(this._colormapTexture&&(this._colormapTexture.dispose(),this._colormapTexture=null),void(this._colormap=null))}_disposeTextures(t=!1){!this._transformGridTexture||t&&!this.projected||(this._transformGridTexture.dispose(),this._transformGridTexture=null),!t&&this._colormapTexture&&(this._colormapTexture.dispose(),this._colormapTexture=null,this._colormap=null,this._colormapTextureInvalidated=!0),!t&&this._rasterTexture&&(this._rasterTexture.dispose(),this._rasterTexture=null,this._rasterTextureBandIds=null),this._processedTexture&&(this._processedTexture.dispose(),this._processedTexture=null)}}class x extends p{get source(){return this._source}}function m(t){return null!=t.source}export{p as RasterBitmap,x as RasterBitmapWithSource,m as hasSource};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{getProjectionDefines as r,getInterpolationDefines as t}from"./utils.js";import{setTextures as o,setUniforms as e,getColormapUniforms as s,getShadedReliefUniforms as a}from"../../../../webgl/rasterUtils.js";const n={vsPath:"raster/common",fsPath:"raster/hillshade",attributes:new Map([["a_position",0],["a_texcoord",1]])};function m(o,e,s){const{colormap:a}=e.symbolizerParameters,m=[...s?[]:r(e.transformGrid),...t(e.interpolation,null!=a,o.context)];null!=a&&m.push("applyColormap");return{defines:m,program:o.painter.materialManager.getProgram(n,m)}}function i(r,t,n,m,i=!1){const{names:l,textures:c}=n.getTextures({useProcessedTexture:i});o(r.context,t,l,c),e(t,m,n.commonUniforms),t.setUniformMatrix3fv("u_dvsMat3",n.transforms.dvs);const f=n.symbolizerParameters,{colormap:u,colormapOffset:p}=f;if(null!=u){const r=s(u,p);e(t,m,r)}const d=a(f);e(t,m,d)}const l={createProgram:m,bindTextureAndUniforms:i};export{l as default};
5
+ import{getProjectionDefines as r,getInterpolationDefines as t}from"./utils.js";import{setTextures as o,setUniforms as e,getColormapUniforms as s,getShadedReliefUniforms as a}from"../../../../webgl/rasterUtils.js";const n={vsPath:"raster/common",fsPath:"raster/hillshade",attributes:new Map([["a_position",0],["a_texcoord",1]])};function m(o,e,s){const{colormap:a}=e.symbolizerParameters,m=[...s?[]:r(e.transformGrid),...t(e.interpolation,!0,o.context)];null!=a&&m.push("applyColormap");return{defines:m,program:o.painter.materialManager.getProgram(n,m)}}function i(r,t,n,m,i=!1){const{names:c,textures:l}=n.getTextures({useProcessedTexture:i});o(r.context,t,c,l),e(t,m,n.commonUniforms),t.setUniformMatrix3fv("u_dvsMat3",n.transforms.dvs);const f=n.symbolizerParameters,{colormap:p,colormapOffset:u}=f;if(null!=p){const r=s(p,u);e(t,m,r)}const d=a(f);e(t,m,d)}const c={createProgram:m,bindTextureAndUniforms:i};export{c as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{getProjectionDefines as r,getInterpolationDefines as t}from"./utils.js";import{setTextures as e,setUniforms as o,getColormapUniforms as s,getStretchUniforms as n}from"../../../../webgl/rasterUtils.js";const a={vsPath:"raster/common",fsPath:"raster/stretch",attributes:new Map([["a_position",0],["a_texcoord",1]])};function m(e,o,s){const{colormap:n}=o.symbolizerParameters,m=[...s?[]:r(o.transformGrid),...t(o.interpolation,null!=n,e.context)];o.isRendereredSource&&!s?m.push("noop"):null!=n&&m.push("applyColormap");return{defines:m,program:e.painter.materialManager.getProgram(a,m)}}function i(r,t,a,m,i=!1){const{names:c,textures:l}=a.getTextures({useProcessedTexture:i});e(r.context,t,c,l),o(t,m,a.commonUniforms),t.setUniformMatrix3fv("u_dvsMat3",a.transforms.dvs);const u=a.symbolizerParameters,{colormap:p,colormapOffset:f}=u;if(null!=p){const r=s(p,f);o(t,m,r)}const d=n(u);o(t,m,d)}const c={createProgram:m,bindTextureAndUniforms:i};export{c as default};
5
+ import{getProjectionDefines as r,getInterpolationDefines as t}from"./utils.js";import{setTextures as o,setUniforms as e,getColormapUniforms as s,getStretchUniforms as n}from"../../../../webgl/rasterUtils.js";const a={vsPath:"raster/common",fsPath:"raster/stretch",attributes:new Map([["a_position",0],["a_texcoord",1]])};function m(o,e,s){const{colormap:n,bandCount:m}=e.symbolizerParameters,i=[...s?[]:r(e.transformGrid),...t(e.interpolation,1===m,o.context)];e.isRendereredSource&&!s?i.push("noop"):null!=n&&i.push("applyColormap");return{defines:i,program:o.painter.materialManager.getProgram(a,i)}}function i(r,t,a,m,i=!1){const{names:c,textures:u}=a.getTextures({useProcessedTexture:i});o(r.context,t,c,u),e(t,m,a.commonUniforms),t.setUniformMatrix3fv("u_dvsMat3",a.transforms.dvs);const l=a.symbolizerParameters,{colormap:p,colormapOffset:f}=l;if(null!=p){const r=s(p,f);e(t,m,r)}const d=n(l);e(t,m,d)}const c={createProgram:m,bindTextureAndUniforms:i};export{c as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{InputHandler as e}from"../../../input/InputHandler.js";class i extends e{constructor(e,i,t){super(!0),this.view=e,this.keys=i,this._pressed=!1,this._keyMap={[i.left]:"left",[i.right]:"right",[i.up]:"up",[i.down]:"down"},this.registerIncoming("key-down",t,(e=>this._handleKeyDown(e))),this.registerIncoming("key-up",t,(e=>this._handleKeyUp(e))),this.registerIncoming("blur",t,(()=>this._handleBlur()))}_handleKeyDown(e){e.data.repeat||this._handleKey(e,!0)}_handleKeyUp(e){this._handleKey(e,!1)}_handleBlur(){this._pressed&&(this._pressed=!1,this.view.mapViewNavigation.stop())}_handleKey(e,i){const t=this._keyMap[e.data.key];if(this._pressed=null!=t,this._pressed){if(i)switch(this.view.mapViewNavigation.begin(),t){case"left":this.view.mapViewNavigation.continousPanLeft();break;case"right":this.view.mapViewNavigation.continousPanRight();break;case"up":this.view.mapViewNavigation.continousPanUp();break;case"down":this.view.mapViewNavigation.continousPanDown()}else this._pressed=!1,this.view.mapViewNavigation.stop();e.stopPropagation()}}}export{i as KeyPan};
5
+ import{InputHandler as i}from"../../../input/InputHandler.js";import{onVisibilityChange as t}from"../../../input/VisibilityChange.js";class e extends i{constructor(i,e,s){super(!0),this.view=i,this.keys=e,this._isSticky=!1,this._pressedKeys=new Set,this._timeout=void 0,this._currentDirection=void 0,this._stickyKeyDuration=200,this._handleKey=i=>{const t=this._keyMap[i.data.key];if(null==t)return;i.stopPropagation(),i.preventDefault();const e="key-down"===i.type;if(this._pressedKeys[e?"add":"delete"](t),e){if(this._direction===t)return;this._direction=t,this._isSticky=!1,this._setTimeout((()=>{this._isSticky&&this._handlePopKey()}))}else{const i=void 0===this._timeout,t=this._pressedKeys.size>0;i||t?this._handlePopKey():this._isSticky=!0}},this._handlePopKey=()=>{this._direction=Array.from(this._pressedKeys).pop(),null==this._direction&&this._stopMovement()},this._stopMovement=()=>{this._isSticky=!1,this._direction=void 0,this._pressedKeys.clear(),this._setTimeout(void 0)},this._keyMap={[e.left]:"left",[e.right]:"right",[e.up]:"up",[e.down]:"down"},this.registerIncoming("key-down",s,this._handleKey),this.registerIncoming("key-up",s,this._handleKey),this.registerIncoming("blur",s,this._stopMovement),this._visibilityHandle=t((i=>i?null:this._stopMovement()))}onUninstall(){this._stopMovement(),this._visibilityHandle?.remove()}get _direction(){return this._currentDirection}set _direction(i){const t=null!=this._currentDirection;if(null!=i){if(t||this.view.mapViewNavigation.begin(),this._currentDirection!==i)switch(i){case"left":this.view.mapViewNavigation.continousPanLeft();break;case"right":this.view.mapViewNavigation.continousPanRight();break;case"up":this.view.mapViewNavigation.continousPanUp();break;case"down":this.view.mapViewNavigation.continousPanDown()}}else t&&this.view.mapViewNavigation.stop();this._currentDirection=i}_setTimeout(i){clearTimeout(this._timeout),this._timeout=void 0===i?void 0:setTimeout((()=>{this._timeout=void 0,i()}),this._stickyKeyDuration)}}export{e as KeyPan};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{InputHandler as e}from"../../../input/InputHandler.js";class i extends e{constructor(e,i,t){super(!0),this.view=e,this.keys=i,this._pressed=!1,this._keyToDirection={[i.clockwiseOption1]:"clockwise",[i.clockwiseOption2]:"clockwise",[i.counterClockwiseOption1]:"counterClockwise",[i.counterClockwiseOption2]:"counterClockwise",[i.resetOption1]:"reset",[i.resetOption2]:"reset"},this.registerIncoming("key-down",t,(e=>this._handleKeyDown(e))),this.registerIncoming("key-up",t,(e=>this._handleKeyUp(e))),this.registerIncoming("blur",t,(()=>this._handleBlur()))}_handleKeyDown(e){e.data.repeat||this._handleKey(e,!0)}_handleKeyUp(e){this._handleKey(e,!1)}_handleBlur(){this._pressed&&(this._pressed=!1,this.view.mapViewNavigation.stop())}_handleKey(e,i){const t=e.modifiers;if(t.size>0&&!t.has("Shift")||!this.view.constraints.rotationEnabled)return;const s=this._keyToDirection[e.data.key];if(this._pressed=null!=s,this._pressed){if(i)switch(this.view.mapViewNavigation.begin(),s){case"clockwise":this.view.mapViewNavigation.continousRotateClockwise();break;case"counterClockwise":this.view.mapViewNavigation.continousRotateCounterclockwise();break;case"reset":this.view.mapViewNavigation.resetRotation()}else this._pressed=!1,this.view.mapViewNavigation.stop();e.stopPropagation()}}}export{i as KeyRotate};
5
+ import{InputHandler as e}from"../../../input/InputHandler.js";import{onVisibilityChange as i}from"../../../input/VisibilityChange.js";class t extends e{constructor(e,t,s){super(!0),this.view=e,this.keys=t,this._pressed=!1,this._keyToDirection={[t.clockwiseOption1]:"clockwise",[t.clockwiseOption2]:"clockwise",[t.counterClockwiseOption1]:"counterClockwise",[t.counterClockwiseOption2]:"counterClockwise",[t.resetOption1]:"reset",[t.resetOption2]:"reset"},this.registerIncoming("key-down",s,(e=>this._handleKeyDown(e))),this.registerIncoming("key-up",s,(e=>this._handleKeyUp(e))),this.registerIncoming("blur",s,(()=>this._handleStop())),this._visibilityHandle=i((e=>e?null:this._handleStop()))}onUninstall(){this._visibilityHandle?.remove(),this._handleStop()}_handleKeyDown(e){e.data.repeat||this._handleKey(e,!0)}_handleKeyUp(e){this._handleKey(e,!1)}_handleStop(){this._pressed&&(this._pressed=!1,this.view.mapViewNavigation.stop())}_handleKey(e,i){const t=e.modifiers;if(t.size>0&&!t.has("Shift")||!this.view.constraints.rotationEnabled)return;const s=this._keyToDirection[e.data.key];if(this._pressed=null!=s,this._pressed){if(e.preventDefault(),i)switch(this.view.mapViewNavigation.begin(),s){case"clockwise":this.view.mapViewNavigation.continousRotateClockwise();break;case"counterClockwise":this.view.mapViewNavigation.continousRotateCounterclockwise();break;case"reset":this.view.mapViewNavigation.resetRotation()}else this._pressed=!1,this.view.mapViewNavigation.stop();e.stopPropagation()}}}export{t as KeyRotate};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import"../../../../../geometry.js";import{ArcadeDate as e}from"../../../../../arcade/ArcadeDate.js";import has from"../../../../../core/has.js";import{assertIsSome as t}from"../../../../../core/maybe.js";import{DateOnly as r}from"../../../../../core/sql/DateOnly.js";import{TimeOnly as s}from"../../../../../core/sql/TimeOnly.js";import{GeometryCursor as i}from"../../../../../geometry/GeometryCursor.js";import{getLabelPoint as a}from"../../../../../geometry/support/labelPoint.js";import{convertToGeometry as n}from"../../../../../layers/graphics/featureConversionUtils.js";import o from"../../../../../layers/graphics/OptimizedGeometry.js";import{system as d,unknown as u}from"../../../../../time/timeZoneUtils.js";import{StaticBitSet as l}from"./StaticBitSet.js";import{fromJSON as m}from"../../../../../geometry/support/jsonUtils.js";let c=0;const h=has("featurelayer-simplify-thresholds")??[.5,.5,.5,.5],y=h[0],f=h[1],p=h[2],g=h[3],_=has("featurelayer-simplify-payload-size-factors")??[1,2,4],A=_[0],x=_[1],I=_[2],b=has("featurelayer-simplify-mobile-factor")??2,T=has("esri-mobile");class S{constructor(e,t){this.type="FeatureSetReader",this.arcadeDeclaredClass="esri.arcade.Feature",this.seen=!1,this.instance=0,this._tx=0,this._ty=0,this._sx=1,this._sy=1,this._deleted=null,this._joined=[],this._objectIdToIndex=null,this._level=0,this.contextTimeZone=null,this.instance=e,this._layerSchema=t}static createInstance(){return c++,c=c>65535?0:c,c}get isEmpty(){return null!=this._deleted&&this._deleted.countSet()===this.getSize()}set level(e){this._level=e}getAreaSimplificationThreshold(e,t){let r=1;const s=T?b:1;t>4e6?r=I*s:t>1e6?r=x*s:t>5e5?r=A*s:t>1e5&&(r=s);let i=0;e>4e3?i=g*r:e>2e3?i=p*r:e>100?i=f:e>15&&(i=y);let a=8;return this._level<4?a=1:this._level<5?a=2:this._level<6&&(a=4),i*a}createQuantizedExtrudedGeometry(e,t){return"esriGeometryPolyline"===this.geometryType?this._createQuantizedExtrudedLine(e,t):this._createQuantizedExtrudedQuad(e,t)}_createQuantizedExtrudedQuad(e,t){return new o([5],[e-1,t,1,-1,1,1,-1,1,-1,-1])}_createQuantizedExtrudedLine(e,t){return new o([2],[e-1,t+1,1,-1])}parseTimestampOffset(e){return e}setArcadeSpatialReference(e){this._arcadeSpatialReference=e}attachStorage(e){this._storage=e}getQuantizationTransform(){throw new Error("Unable to find transform for featureSet")}getStorage(){return this._storage}getComputedNumeric(e){return this.getComputedNumericAtIndex(0)}setComputedNumeric(e,t){return this.setComputedNumericAtIndex(t,0)}getComputedString(e){return this.getComputedStringAtIndex(0)}setComputedString(e,t){return this.setComputedStringAtIndex(0,t)}getComputedNumericAtIndex(e){return this._storage.getComputedNumericAtIndex(this.getDisplayId(),e)}setComputedNumericAtIndex(e,t){this._storage.setComputedNumericAtIndex(this.getDisplayId(),e,t)}getComputedStringAtIndex(e){return this._storage.getComputedStringAtIndex(this.getDisplayId(),e)}setComputedStringAtIndex(e,t){return this._storage.setComputedStringAtIndex(this.getDisplayId(),e,t)}transform(e,t,r,s){const i=this.copy();return i._tx+=e,i._ty+=t,i._sx*=r,i._sy*=s,i}readAttributeAsTimestamp(e){const t=this.readAttribute(e);return"string"==typeof t?new Date(t).getTime():"number"==typeof t||null==t?t:null}readAttribute(e,t=!1){const r=this._readAttribute(e,t);if(void 0!==r)return r;for(const s of this._joined){s.setIndex(this.getIndex());const r=s._readAttribute(e,t);if(void 0!==r)return r}}readAttributes(){const e=this._readAttributes();for(const t of this._joined){t.setIndex(this.getIndex());const r=t._readAttributes();for(const t of Object.keys(r))e[t]=r[t]}return e}joinAttributes(e){this._joined.push(e)}readArcadeFeature(){return this}hasField(e){return this.fields.has(e)}geometry(){const e=this.readHydratedGeometry(),t=n(e,this.geometryType,this.hasZ,this.hasM),r=m(t);return r&&(r.spatialReference=this._arcadeSpatialReference),r}autocastArcadeDate(t,r){return r&&r instanceof Date?this.isUnknownDateTimeField(t)?e.unknownDateJSToArcadeDate(r):e.dateJSAndZoneToArcadeDate(r,this.contextTimeZone??d):r}isUnknownDateTimeField(e){return this._layerSchema.fieldsIndex.getTimeZone(e)===u}field(t){let i=this.fields.get(t);if(i)switch(i.type){case"date-only":case"esriFieldTypeDateOnly":return r.fromReader(this.readAttribute(t,!1));case"time-only":case"esriFieldTypeTimeOnly":return s.fromReader(this.readAttribute(t,!1));case"esriFieldTypeTimestampOffset":case"timestamp-offset":return e.fromReaderAsTimeStampOffset(this.readAttribute(t,!1));case"date":case"esriFieldTypeDate":return this.autocastArcadeDate(t,this.readAttribute(t,!0));default:return this.readAttribute(t,!1)}for(const a of this._joined)if(a.setIndex(this.getIndex()),i=a.fields.get(t),i)switch(i.type){case"date-only":case"esriFieldTypeDateOnly":return r.fromReader(a._readAttribute(t,!1));case"time-only":case"esriFieldTypeTimeOnly":return s.fromReader(a._readAttribute(t,!1));case"esriFieldTypeTimestampOffset":case"timestamp-offset":return e.fromReaderAsTimeStampOffset(a._readAttribute(t,!1));case"date":case"esriFieldTypeDate":return this.autocastArcadeDate(t,a._readAttribute(t,!0));default:return this.readAttribute(t,!1)}throw new Error(`Field ${t} does not exist`)}setField(e,t){throw new Error("Unable to update feature attribute values, feature is readonly")}keys(){return this.fields.fields.map((e=>e.name))}castToText(e=!1){if(!e)return JSON.stringify(this.readLegacyFeature());const t=this.readLegacyFeature();if(!t)return JSON.stringify(null);const r={geometry:t.geometry,attributes:{...t.attributes??{}}};for(const s in r.attributes){const e=r.attributes[s];e instanceof Date&&(r.attributes[s]=e.getTime())}return JSON.stringify(r)}gdbVersion(){return null}fullSchema(){return this._layerSchema}castAsJson(e=null){return{attributes:this._readAttributes(),geometry:!0===e?.keepGeometryType?this.geometry():this.geometry()?.toJSON()??null}}castAsJsonAsync(e=null,t=null){return Promise.resolve(this.castAsJson(t))}removeIds(e){if(null==this._objectIdToIndex){const e=new Map,r=this.getCursor();for(;r.next();){const s=r.getObjectId();t(s),e.set(s,r.getIndex())}this._objectIdToIndex=e}const r=this._objectIdToIndex;for(const t of e)r.has(t)&&this.removeAtIndex(r.get(t))}removeAtIndex(e){null==this._deleted&&(this._deleted=l.create(this.getSize())),this._deleted.set(e)}readGeometryForDisplay(){return this.readUnquantizedGeometry(!0)}readLegacyGeometryForDisplay(){return this.readLegacyGeometry(!0)}*features(){const e=this.getCursor();for(;e.next();)yield e.readOptimizedFeature()}_getExists(){return null==this._deleted||!this._deleted.has(this.getIndex())}_computeCentroid(){if("esriGeometryPolygon"!==this.geometryType)return null;const e=this.readUnquantizedGeometry();if(!e||e.hasIndeterminateRingOrder)return null;const t=i.fromOptimized(e,this.geometryType);t.yFactor*=-1;const r=a(t);return r?(r[1]*=-1,new o([],r)):null}copyInto(e){e.seen=this.seen,e._storage=this._storage,e._arcadeSpatialReference=this._arcadeSpatialReference,e._joined=this._joined,e._tx=this._tx,e._ty=this._ty,e._sx=this._sx,e._sy=this._sy,e._deleted=this._deleted,e._objectIdToIndex=this._objectIdToIndex}}export{S as FeatureSetReader};
5
+ import"../../../../../geometry.js";import{ArcadeDate as e}from"../../../../../arcade/ArcadeDate.js";import has from"../../../../../core/has.js";import{assertIsSome as t}from"../../../../../core/maybe.js";import{DateOnly as r}from"../../../../../core/sql/DateOnly.js";import{TimeOnly as s}from"../../../../../core/sql/TimeOnly.js";import{GeometryCursor as i}from"../../../../../geometry/GeometryCursor.js";import{getLabelPoint as n}from"../../../../../geometry/support/labelPoint.js";import{convertToGeometry as a}from"../../../../../layers/graphics/featureConversionUtils.js";import o from"../../../../../layers/graphics/OptimizedGeometry.js";import{system as d,unknown as u}from"../../../../../time/timeZoneUtils.js";import{StaticBitSet as l}from"./StaticBitSet.js";import{fromJSON as m}from"../../../../../geometry/support/jsonUtils.js";let c=0;const h=has("featurelayer-simplify-thresholds")??[.5,.5,.5,.5],y=h[0],f=h[1],p=h[2],g=h[3],_=has("featurelayer-simplify-payload-size-factors")??[1,2,4],x=_[0],A=_[1],T=_[2],I=has("featurelayer-simplify-mobile-factor")??2,b=has("esri-mobile");class S{constructor(e,t){this.type="FeatureSetReader",this.arcadeDeclaredClass="esri.arcade.Feature",this.seen=!1,this.instance=0,this._tx=0,this._ty=0,this._sx=1,this._sy=1,this._deleted=null,this._joined=[],this._objectIdToIndex=null,this._contextTimeZone=null,this._level=0,this.instance=e,this._layerSchema=t}static createInstance(){return c++,c=c>65535?0:c,c}get isEmpty(){return null!=this._deleted&&this._deleted.countSet()===this.getSize()}get contextTimeZone(){return this._contextTimeZone}set contextTimeZone(e){this._contextTimeZone=e}set level(e){this._level=e}getAreaSimplificationThreshold(e,t){let r=1;const s=b?I:1;t>4e6?r=T*s:t>1e6?r=A*s:t>5e5?r=x*s:t>1e5&&(r=s);let i=0;e>4e3?i=g*r:e>2e3?i=p*r:e>100?i=f:e>15&&(i=y);let n=8;return this._level<4?n=1:this._level<5?n=2:this._level<6&&(n=4),i*n}createQuantizedExtrudedGeometry(e,t){return"esriGeometryPolyline"===this.geometryType?this._createQuantizedExtrudedLine(e,t):this._createQuantizedExtrudedQuad(e,t)}_createQuantizedExtrudedQuad(e,t){return new o([5],[e-1,t,1,-1,1,1,-1,1,-1,-1])}_createQuantizedExtrudedLine(e,t){return new o([2],[e-1,t+1,1,-1])}parseTimestampOffset(e){return e}setArcadeSpatialReference(e){this._arcadeSpatialReference=e}attachStorage(e){this._storage=e}getQuantizationTransform(){throw new Error("Unable to find transform for featureSet")}getStorage(){return this._storage}getComputedNumeric(e){return this.getComputedNumericAtIndex(0)}setComputedNumeric(e,t){return this.setComputedNumericAtIndex(t,0)}getComputedString(e){return this.getComputedStringAtIndex(0)}setComputedString(e,t){return this.setComputedStringAtIndex(0,t)}getComputedNumericAtIndex(e){return this._storage.getComputedNumericAtIndex(this.getDisplayId(),e)}setComputedNumericAtIndex(e,t){this._storage.setComputedNumericAtIndex(this.getDisplayId(),e,t)}getComputedStringAtIndex(e){return this._storage.getComputedStringAtIndex(this.getDisplayId(),e)}setComputedStringAtIndex(e,t){return this._storage.setComputedStringAtIndex(this.getDisplayId(),e,t)}transform(e,t,r,s){const i=this.copy();return i._tx+=e,i._ty+=t,i._sx*=r,i._sy*=s,i}readAttributeAsTimestamp(e){const t=this.readAttribute(e);return"string"==typeof t?new Date(t).getTime():"number"==typeof t||null==t?t:null}readAttribute(e,t=!1){const r=this._readAttribute(e,t);if(void 0!==r)return r;for(const s of this._joined){s.setIndex(this.getIndex());const r=s._readAttribute(e,t);if(void 0!==r)return r}}readAttributes(){const e=this._readAttributes();for(const t of this._joined){t.setIndex(this.getIndex());const r=t._readAttributes();for(const t of Object.keys(r))e[t]=r[t]}return e}joinAttributes(e){this._joined.push(e)}readArcadeFeature(){return this}hasField(e){return this.fields.has(e)}geometry(){const e=this.readHydratedGeometry(),t=a(e,this.geometryType,this.hasZ,this.hasM),r=m(t);return r&&(r.spatialReference=this._arcadeSpatialReference),r}autocastArcadeDate(t,r){return r&&r instanceof Date?this.isUnknownDateTimeField(t)?e.unknownDateJSToArcadeDate(r):e.dateJSAndZoneToArcadeDate(r,this.contextTimeZone??d):r}isUnknownDateTimeField(e){return this._layerSchema.fieldsIndex.getTimeZone(e)===u}field(t){let i=this.fields.get(t);if(i)switch(i.type){case"date-only":case"esriFieldTypeDateOnly":return r.fromReader(this.readAttribute(t,!1));case"time-only":case"esriFieldTypeTimeOnly":return s.fromReader(this.readAttribute(t,!1));case"esriFieldTypeTimestampOffset":case"timestamp-offset":return e.fromReaderAsTimeStampOffset(this.readAttribute(t,!1));case"date":case"esriFieldTypeDate":return this.autocastArcadeDate(t,this.readAttribute(t,!0));default:return this.readAttribute(t,!1)}for(const n of this._joined)if(n.setIndex(this.getIndex()),i=n.fields.get(t),i)switch(i.type){case"date-only":case"esriFieldTypeDateOnly":return r.fromReader(n._readAttribute(t,!1));case"time-only":case"esriFieldTypeTimeOnly":return s.fromReader(n._readAttribute(t,!1));case"esriFieldTypeTimestampOffset":case"timestamp-offset":return e.fromReaderAsTimeStampOffset(n._readAttribute(t,!1));case"date":case"esriFieldTypeDate":return this.autocastArcadeDate(t,n._readAttribute(t,!0));default:return this.readAttribute(t,!1)}throw new Error(`Field ${t} does not exist`)}setField(e,t){throw new Error("Unable to update feature attribute values, feature is readonly")}keys(){return this.fields.fields.map((e=>e.name))}castToText(e=!1){if(!e)return JSON.stringify(this.readLegacyFeature());const t=this.readLegacyFeature();if(!t)return JSON.stringify(null);const r={geometry:t.geometry,attributes:{...t.attributes??{}}};for(const s in r.attributes){const e=r.attributes[s];e instanceof Date&&(r.attributes[s]=e.getTime())}return JSON.stringify(r)}gdbVersion(){return null}fullSchema(){return this._layerSchema}castAsJson(e=null){return{attributes:this._readAttributes(),geometry:!0===e?.keepGeometryType?this.geometry():this.geometry()?.toJSON()??null}}castAsJsonAsync(e=null,t=null){return Promise.resolve(this.castAsJson(t))}removeIds(e){if(null==this._objectIdToIndex){const e=new Map,r=this.getCursor();for(;r.next();){const s=r.getObjectId();t(s),e.set(s,r.getIndex())}this._objectIdToIndex=e}const r=this._objectIdToIndex;for(const t of e)r.has(t)&&this.removeAtIndex(r.get(t))}removeAtIndex(e){null==this._deleted&&(this._deleted=l.create(this.getSize())),this._deleted.set(e)}readGeometryForDisplay(){return this.readUnquantizedGeometry(!0)}readLegacyGeometryForDisplay(){return this.readLegacyGeometry(!0)}*features(){const e=this.getCursor();for(;e.next();)yield e.readOptimizedFeature()}_getExists(){return null==this._deleted||!this._deleted.has(this.getIndex())}_computeCentroid(){if("esriGeometryPolygon"!==this.geometryType)return null;const e=this.readUnquantizedGeometry();if(!e||e.hasIndeterminateRingOrder)return null;const t=i.fromOptimized(e,this.geometryType);t.yFactor*=-1;const r=n(t);return r?(r[1]*=-1,new o([],r)):null}copyInto(e){e.seen=this.seen,e._storage=this._storage,e._arcadeSpatialReference=this._arcadeSpatialReference,e._joined=this._joined,e._tx=this._tx,e._ty=this._ty,e._sx=this._sx,e._sy=this._sy,e._deleted=this._deleted,e._objectIdToIndex=this._objectIdToIndex,e.contextTimeZone=this.contextTimeZone}}export{S as FeatureSetReader};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{FeatureSetReader as e}from"./FeatureSetReader.js";class r extends e{static from(e,t){return new r(e.copy(),t)}constructor(r,t){super(e.createInstance(),r.fullSchema()),this._currentIndex=-1,this._reader=r,this._indices=t}get fields(){return this._reader.fields}get hasNext(){return this._currentIndex+1<this._indices.length}getSize(){return this._indices.length}getCursor(){return this.copy()}copy(){const e=new r(this._reader.copy(),this._indices);return e._currentIndex=this._currentIndex,e}next(){for(;this._nextIndex()&&!this._reader._getExists(););return this._currentIndex<this._indices.length}_nextIndex(){return++this._currentIndex<this._indices.length&&(this._reader.setIndex(this._indices[this._currentIndex]),!0)}setArcadeSpatialReference(e){this._reader.setArcadeSpatialReference(e)}attachStorage(e){this._reader.attachStorage(e)}get geometryType(){return this._reader.geometryType}get hasFeatures(){return this._reader.hasFeatures}get exceededTransferLimit(){return this._reader.exceededTransferLimit}get hasZ(){return this._reader.hasZ}get hasM(){return this._reader.hasM}getStorage(){return this._reader.getStorage()}getComputedNumeric(e){return this._reader.getComputedNumericAtIndex(0)}setComputedNumeric(e,r){return this._reader.setComputedNumericAtIndex(r,0)}getComputedString(e){return this._reader.getComputedStringAtIndex(0)}setComputedString(e,r){return this._reader.setComputedStringAtIndex(0,r)}getComputedNumericAtIndex(e){return this._reader.getComputedNumericAtIndex(e)}setComputedNumericAtIndex(e,r){this._reader.setComputedNumericAtIndex(e,r)}getComputedStringAtIndex(e){return this._reader.getComputedStringAtIndex(e)}setComputedStringAtIndex(e,r){return this._reader.setComputedStringAtIndex(e,r)}transform(e,r,t,d){const a=this.copy();return a._reader=this._reader.transform(e,r,t,d),a}readAttribute(e,r=!1){return this._reader.readAttribute(e,r)}readAttributes(){return this._reader.readAttributes()}joinAttributes(e){return this._reader.joinAttributes(e)}readArcadeFeature(){return this._reader.readArcadeFeature()}geometry(){return this._reader.geometry()}field(e){return this.readAttribute(e,!0)}hasField(e){return this._reader.hasField(e)}setField(e,r){return this._reader.setField(e,r)}keys(){return this._reader.keys()}castToText(e=!1){return this._reader.castToText(e)}getQuantizationTransform(){return this._reader.getQuantizationTransform()}getAttributeHash(){return this._reader.getAttributeHash()}getObjectId(){return this._reader.getObjectId()}getDisplayId(){return this._reader.getDisplayId()}setDisplayId(e){return this._reader.setDisplayId(e)}getGroupId(){return this._reader.getGroupId()}setGroupId(e){return this._reader.setGroupId(e)}getXHydrated(){return this._reader.getXHydrated()}getYHydrated(){return this._reader.getYHydrated()}getX(){return this._reader.getX()}getY(){return this._reader.getY()}setIndex(e){return this._reader.setIndex(e)}getIndex(){return this._reader.getIndex()}readLegacyFeature(){return this._reader.readLegacyFeature()}readOptimizedFeature(){return this._reader.readOptimizedFeature()}readLegacyPointGeometry(){return this._reader.readLegacyPointGeometry()}readLegacyGeometry(){return this._reader.readLegacyGeometry()}readLegacyCentroid(){return this._reader.readLegacyCentroid()}readGeometryArea(){return this._reader.readGeometryArea()}readUnquantizedGeometry(){return this._reader.readUnquantizedGeometry()}readHydratedGeometry(){return this._reader.readHydratedGeometry()}readGeometry(){return this._reader.readGeometry()}readCentroid(){return this._reader.readCentroid()}_readAttribute(e,r){throw new Error("Error: Should not be called. Underlying _reader should be used instead")}_readAttributes(){throw new Error("Error: Should not be called. Underlying _reader should be used instead")}}export{r as FeatureSetReaderIndirect};
5
+ import{FeatureSetReader as e}from"./FeatureSetReader.js";class r extends e{static from(e,t){return new r(e.copy(),t)}constructor(r,t){super(e.createInstance(),r.fullSchema()),this._currentIndex=-1,this._reader=r,this._indices=t}get fields(){return this._reader.fields}get hasNext(){return this._currentIndex+1<this._indices.length}getSize(){return this._indices.length}getCursor(){return this.copy()}copy(){const e=new r(this._reader.copy(),this._indices);return e._currentIndex=this._currentIndex,e}next(){for(;this._nextIndex()&&!this._reader._getExists(););return this._currentIndex<this._indices.length}_nextIndex(){return++this._currentIndex<this._indices.length&&(this._reader.setIndex(this._indices[this._currentIndex]),!0)}setArcadeSpatialReference(e){this._reader.setArcadeSpatialReference(e)}attachStorage(e){this._reader.attachStorage(e)}get geometryType(){return this._reader.geometryType}get hasFeatures(){return this._reader.hasFeatures}get exceededTransferLimit(){return this._reader.exceededTransferLimit}get hasZ(){return this._reader.hasZ}get hasM(){return this._reader.hasM}get contextTimeZone(){return this._reader.contextTimeZone}set contextTimeZone(e){this._reader.contextTimeZone=e}getStorage(){return this._reader.getStorage()}getComputedNumeric(e){return this._reader.getComputedNumericAtIndex(0)}setComputedNumeric(e,r){return this._reader.setComputedNumericAtIndex(r,0)}getComputedString(e){return this._reader.getComputedStringAtIndex(0)}setComputedString(e,r){return this._reader.setComputedStringAtIndex(0,r)}getComputedNumericAtIndex(e){return this._reader.getComputedNumericAtIndex(e)}setComputedNumericAtIndex(e,r){this._reader.setComputedNumericAtIndex(e,r)}getComputedStringAtIndex(e){return this._reader.getComputedStringAtIndex(e)}setComputedStringAtIndex(e,r){return this._reader.setComputedStringAtIndex(e,r)}transform(e,r,t,d){const a=this.copy();return a._reader=this._reader.transform(e,r,t,d),a}readAttribute(e,r=!1){return this._reader.readAttribute(e,r)}readAttributes(){return this._reader.readAttributes()}joinAttributes(e){return this._reader.joinAttributes(e)}readArcadeFeature(){return this._reader.readArcadeFeature()}geometry(){return this._reader.geometry()}field(e){return this.readAttribute(e,!0)}hasField(e){return this._reader.hasField(e)}setField(e,r){return this._reader.setField(e,r)}keys(){return this._reader.keys()}castToText(e=!1){return this._reader.castToText(e)}getQuantizationTransform(){return this._reader.getQuantizationTransform()}getAttributeHash(){return this._reader.getAttributeHash()}getObjectId(){return this._reader.getObjectId()}getDisplayId(){return this._reader.getDisplayId()}setDisplayId(e){return this._reader.setDisplayId(e)}getGroupId(){return this._reader.getGroupId()}setGroupId(e){return this._reader.setGroupId(e)}getXHydrated(){return this._reader.getXHydrated()}getYHydrated(){return this._reader.getYHydrated()}getX(){return this._reader.getX()}getY(){return this._reader.getY()}setIndex(e){return this._reader.setIndex(e)}getIndex(){return this._reader.getIndex()}readLegacyFeature(){return this._reader.readLegacyFeature()}readOptimizedFeature(){return this._reader.readOptimizedFeature()}readLegacyPointGeometry(){return this._reader.readLegacyPointGeometry()}readLegacyGeometry(){return this._reader.readLegacyGeometry()}readLegacyCentroid(){return this._reader.readLegacyCentroid()}readGeometryArea(){return this._reader.readGeometryArea()}readUnquantizedGeometry(){return this._reader.readUnquantizedGeometry()}readHydratedGeometry(){return this._reader.readHydratedGeometry()}readGeometry(){return this._reader.readGeometry()}readCentroid(){return this._reader.readCentroid()}_readAttribute(e,r){throw new Error("Error: Should not be called. Underlying _reader should be used instead")}_readAttributes(){throw new Error("Error: Should not be called. Underlying _reader should be used instead")}}export{r as FeatureSetReaderIndirect};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{ViewingMode as e}from"../../../ViewingMode.js";import{GamepadKeyboardController as t}from"../../state/controllers/GamepadKeyboardController.js";import{InputHandler as r}from"../../../input/InputHandler.js";var a;!function(e){e[e.LEFT=0]="LEFT",e[e.RIGHT=1]="RIGHT",e[e.FORWARD=2]="FORWARD",e[e.BACKWARD=3]="BACKWARD",e[e.UP=4]="UP",e[e.DOWN=5]="DOWN",e[e.HEADINGLEFT=6]="HEADINGLEFT",e[e.HEADINGRIGHT=7]="HEADINGRIGHT",e[e.TILTUP=8]="TILTUP",e[e.TILTDOWN=9]="TILTDOWN",e[e.ZOOMIN=10]="ZOOMIN",e[e.ZOOMOUT=11]="ZOOMOUT"}(a||(a={}));class o extends r{constructor(t,r){super(!0),this._view=t,this._disableMovements={pan:!0,zoom:!1,ascend:!0,rotate:!1,mode:e.Local},this._keyToNumber={[r.left]:a.LEFT,[r.right]:a.RIGHT,[r.forward]:a.FORWARD,[r.backward]:a.BACKWARD,[r.up]:a.UP,[r.down]:a.DOWN,[r.headingLeft]:a.HEADINGLEFT,[r.headingRight]:a.HEADINGRIGHT,[r.tiltUp]:a.TILTUP,[r.tiltDown]:a.TILTDOWN,[r.zoomIn]:a.ZOOMIN,[r.zoomOut]:a.ZOOMOUT},this.registerIncoming("key-down",null,(e=>this._handleKeyDown(e))),this.registerIncoming("key-up",null,(e=>this._handleKeyUp(e))),this.registerIncoming("blur",null,(()=>this._handleBlur()))}_handleKeyDown(e){if(e.data.native.ctrlKey||e.data.native.metaKey)return;const r=this._keyToNumber[e.data.key];null!=r&&(this._cameraControllerKeyboard&&this._cameraControllerKeyboard.active||(this._cameraControllerKeyboard=new t({view:this._view,disableMovements:this._disableMovements}),this._view.state.switchCameraController(this._cameraControllerKeyboard)),this._cameraControllerKeyboard.active&&(this._cameraControllerKeyboard.activateDirection(r),e.stopPropagation()))}_handleBlur(){this._cameraControllerKeyboard&&this._cameraControllerKeyboard.active&&(this._cameraControllerKeyboard.finishController(),this._cameraControllerKeyboard=null)}_handleKeyUp(e){if(e.data.native.ctrlKey||e.data.native.metaKey)return;const t=this._keyToNumber[e.data.key];null!=t&&this._cameraControllerKeyboard&&this._cameraControllerKeyboard.active&&(this._cameraControllerKeyboard.deactivateDirection(t),e.stopPropagation())}}export{o as KeyboardNavigation};
5
+ import{ViewingMode as e}from"../../../ViewingMode.js";import{GamepadKeyboardController as t}from"../../state/controllers/GamepadKeyboardController.js";import{InputHandler as a}from"../../../input/InputHandler.js";import{onVisibilityChange as o}from"../../../input/VisibilityChange.js";var r;!function(e){e[e.LEFT=0]="LEFT",e[e.RIGHT=1]="RIGHT",e[e.FORWARD=2]="FORWARD",e[e.BACKWARD=3]="BACKWARD",e[e.UP=4]="UP",e[e.DOWN=5]="DOWN",e[e.HEADINGLEFT=6]="HEADINGLEFT",e[e.HEADINGRIGHT=7]="HEADINGRIGHT",e[e.TILTUP=8]="TILTUP",e[e.TILTDOWN=9]="TILTDOWN",e[e.ZOOMIN=10]="ZOOMIN",e[e.ZOOMOUT=11]="ZOOMOUT"}(r||(r={}));class i extends a{constructor(t,a){super(!0),this._view=t,this._disableMovements={pan:!0,zoom:!1,ascend:!0,rotate:!1,mode:e.Local},this._keyToNumber={[a.left]:r.LEFT,[a.right]:r.RIGHT,[a.forward]:r.FORWARD,[a.backward]:r.BACKWARD,[a.up]:r.UP,[a.down]:r.DOWN,[a.headingLeft]:r.HEADINGLEFT,[a.headingRight]:r.HEADINGRIGHT,[a.tiltUp]:r.TILTUP,[a.tiltDown]:r.TILTDOWN,[a.zoomIn]:r.ZOOMIN,[a.zoomOut]:r.ZOOMOUT},this.registerIncoming("key-down",null,(e=>this._handleKeyDown(e))),this.registerIncoming("key-up",null,(e=>this._handleKeyUp(e))),this.registerIncoming("blur",null,(()=>this._handleStop())),this._visibilityHandle=o((e=>e?null:this._handleStop()))}onUninstall(){this._visibilityHandle?.remove(),this._handleStop()}_handleKeyDown(e){if(e.data.native.ctrlKey||e.data.native.metaKey)return;const a=this._keyToNumber[e.data.key];null!=a&&(this._cameraControllerKeyboard&&this._cameraControllerKeyboard.active||(this._cameraControllerKeyboard=new t({view:this._view,disableMovements:this._disableMovements}),this._view.state.switchCameraController(this._cameraControllerKeyboard)),this._cameraControllerKeyboard.active&&(this._cameraControllerKeyboard.activateDirection(a),e.stopPropagation()))}_handleStop(){this._cameraControllerKeyboard?.active&&(this._cameraControllerKeyboard.finishController(),this._cameraControllerKeyboard=null)}_handleKeyUp(e){if(e.data.native.ctrlKey||e.data.native.metaKey)return;const t=this._keyToNumber[e.data.key];null!=t&&this._cameraControllerKeyboard&&this._cameraControllerKeyboard.active&&(this._cameraControllerKeyboard.deactivateDirection(t),e.stopPropagation())}}export{i as KeyboardNavigation};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{d as e}from"../../../../chunks/mat4.js";import{a as t}from"../../../../chunks/mat4f64.js";import{s as r,e as s}from"../../../../chunks/vec3.js";import{Z as o,c as i}from"../../../../chunks/vec3f64.js";import{f as a,d as n}from"../../../../chunks/vec4f64.js";import{Object3DVisualElement as l}from"./Object3DVisualElement.js";import{lineStripsToParameters as m,createGeometry as p}from"../../support/engineContent/line.js";import{RenderOccludedFlag as h}from"../../webgl-engine/lib/Material.js";import{RibbonLineMaterial as d}from"../../webgl-engine/materials/RibbonLineMaterial.js";class u extends l{constructor(e,t){super(e),this._hasExternalMaterial=!1,this._hasExternalMaterial=null!=t,this._material=null!=t?t:new d({width:1,color:a(1,0,1,1),stippleOffColor:null,stipplePattern:null,stipplePreferContinuous:!0,isClosed:!1,falloff:0,innerColor:null,innerWidth:1,hasPolygonOffset:!1,renderOccluded:h.OccludeAndTransparent,isDecoration:!!e.isDecoration,writeDepth:!0}),this.applyProperties(e)}setGeometryFromRenderSpacePoint(e,t=1e3){this.geometry=[[[e[0]-t,e[1],e[2]],[e[0]+t,e[1],e[2]]],[[e[0],e[1]-t,e[2]],[e[0],e[1]+t,e[2]]],[[e[0],e[1],e[2]-t],[e[0],e[1],e[2]+t]]]}setGeometryFromExtent(e){const t=this.view.spatialReference,s=i(),o=i(),a=100,n=[];r(s,e[0],e[1],a),this.view.renderCoordsHelper.toRenderCoords(s,t,o),n.push([o[0],o[1],o[2]]),r(s,e[2],e[1],a),this.view.renderCoordsHelper.toRenderCoords(s,t,o),n.push([o[0],o[1],o[2]]),r(s,e[2],e[3],a),this.view.renderCoordsHelper.toRenderCoords(s,t,o),n.push([o[0],o[1],o[2]]),r(s,e[0],e[3],a),this.view.renderCoordsHelper.toRenderCoords(s,t,o),n.push([o[0],o[1],o[2]]),r(s,e[0],e[1],a),this.view.renderCoordsHelper.toRenderCoords(s,t,o),n.push([o[0],o[1],o[2]]),r(s,e[0],e[1],a),this.view.renderCoordsHelper.toRenderCoords(s,t,o),n.push([o[0],o[1],o[2]]),this.geometry=[n]}setGeometryFromFrustum(e){const t=[];e.lines.forEach((e=>{t.push([e.origin[0],e.origin[1],e.origin[2]]),t.push([e.endpoint[0],e.endpoint[1],e.endpoint[2]])})),this.geometry=[t]}setGeometryFromBoundedPlane(e){const t=[],r=e.origin,s=e.basis1,o=e.basis2,a=.5,n=i(),l=i(),m=i(),p=i();n[0]=r[0]-s[0]*a-o[0]*a,n[1]=r[1]-s[1]*a-o[1]*a,n[2]=r[2]-s[2]*a-o[2]*a,l[0]=r[0]-s[0]*a+o[0]*a,l[1]=r[1]-s[1]*a+o[1]*a,l[2]=r[2]-s[2]*a+o[2]*a,m[0]=r[0]+s[0]*a+o[0]*a,m[1]=r[1]+s[1]*a+o[1]*a,m[2]=r[2]+s[2]*a+o[2]*a,p[0]=r[0]+s[0]*a-o[0]*a,p[1]=r[1]+s[1]*a-o[1]*a,p[2]=r[2]+s[2]*a-o[2]*a,t.push([n[0],n[1],n[2]]),t.push([l[0],l[1],l[2]]),t.push([m[0],m[1],m[2]]),t.push([p[0],p[1],p[2]]),t.push([n[0],n[1],n[2]]),this.geometry=[t]}setGeometryFromSegment(t){const r=t.endRenderSpace;this.transform=e(f,r);const{points:s}=t.createRenderGeometry(r,this.view.renderCoordsHelper);this.geometry=[s]}setGeometryFromSegments(t,r=o){this.transform=e(f,r),this.geometry=t.map((e=>e.createRenderGeometry(r,this.view.renderCoordsHelper).points))}getTransformedGeometry(){return null==this._geometry?null:this._geometry.map((e=>e.map((e=>s(i(),e,this.transform)))))}get renderOccluded(){return this._material.parameters.renderOccluded}set renderOccluded(e){this._material.setParameters({renderOccluded:e})}get geometry(){return this._geometry}set geometry(e){this._geometry=e,this.recreateGeometry()}get width(){return this._material.parameters.width}set width(e){this._material.setParameters({width:e})}get color(){return this._material.parameters.color}set color(e){const t=1===e[3];this._material.setParameters({color:n(e),writeDepth:t})}get innerWidth(){return this._material.parameters.innerWidth}set innerWidth(e){this._material.setParameters({innerWidth:e})}get innerColor(){return this._material.parameters.innerColor}set innerColor(e){this._material.setParameters({innerColor:null!=e?n(e):null})}get stipplePattern(){return this._material.parameters.stipplePattern}set stipplePattern(e){null!=this._material&&this._material.setParameters({stipplePattern:e})}get stippleOffColor(){return this._material.parameters.stippleOffColor}set stippleOffColor(e){this._material.setParameters({stippleOffColor:null!=e?n(e):null})}get stipplePreferContinuous(){return this._material.parameters.stipplePreferContinuous}set stipplePreferContinuous(e){this._material.setParameters({stipplePreferContinuous:e})}get falloff(){return this._material.parameters.falloff}set falloff(e){this._material.setParameters({falloff:e})}get polygonOffset(){return this._material.parameters.hasPolygonOffset}set polygonOffset(e){this._material.setParameters({hasPolygonOffset:e})}createExternalResources(){}destroyExternalResources(){}createGeometries(e){for(const t of m(this.geometry)){const r=p(this._material,t);e.addGeometry(r)}}forEachExternalMaterial(e){this._hasExternalMaterial||e(this._material)}}const f=t();export{u as LineVisualElement};
5
+ import{d as e}from"../../../../chunks/mat4.js";import{a as t}from"../../../../chunks/mat4f64.js";import{s as r,e as s}from"../../../../chunks/vec3.js";import{Z as o,c as i}from"../../../../chunks/vec3f64.js";import{f as a,d as n}from"../../../../chunks/vec4f64.js";import{Object3DVisualElement as l}from"./Object3DVisualElement.js";import{lineStripsToParameters as m,createGeometry as p}from"../../support/engineContent/line.js";import{RenderOccludedFlag as h}from"../../webgl-engine/lib/Material.js";import{RibbonLineMaterial as d}from"../../webgl-engine/materials/RibbonLineMaterial.js";class u extends l{constructor(e,t){super(e),this._hasExternalMaterial=!1,this._hasExternalMaterial=null!=t,this._material=null!=t?t:new d({width:1,color:a(1,0,1,1),stippleOffColor:null,stipplePattern:null,stipplePreferContinuous:!0,isClosed:!1,falloff:0,innerColor:null,innerWidth:1,hasPolygonOffset:!1,renderOccluded:h.OccludeAndTransparent,isDecoration:!!e.isDecoration,writeDepth:!0,writeLinearDepth:!1}),this.applyProperties(e)}setGeometryFromRenderSpacePoint(e,t=1e3){this.geometry=[[[e[0]-t,e[1],e[2]],[e[0]+t,e[1],e[2]]],[[e[0],e[1]-t,e[2]],[e[0],e[1]+t,e[2]]],[[e[0],e[1],e[2]-t],[e[0],e[1],e[2]+t]]]}setGeometryFromExtent(e){const t=this.view.spatialReference,s=i(),o=i(),a=100,n=[];r(s,e[0],e[1],a),this.view.renderCoordsHelper.toRenderCoords(s,t,o),n.push([o[0],o[1],o[2]]),r(s,e[2],e[1],a),this.view.renderCoordsHelper.toRenderCoords(s,t,o),n.push([o[0],o[1],o[2]]),r(s,e[2],e[3],a),this.view.renderCoordsHelper.toRenderCoords(s,t,o),n.push([o[0],o[1],o[2]]),r(s,e[0],e[3],a),this.view.renderCoordsHelper.toRenderCoords(s,t,o),n.push([o[0],o[1],o[2]]),r(s,e[0],e[1],a),this.view.renderCoordsHelper.toRenderCoords(s,t,o),n.push([o[0],o[1],o[2]]),r(s,e[0],e[1],a),this.view.renderCoordsHelper.toRenderCoords(s,t,o),n.push([o[0],o[1],o[2]]),this.geometry=[n]}setGeometryFromFrustum(e){const t=[];e.lines.forEach((e=>{t.push([e.origin[0],e.origin[1],e.origin[2]]),t.push([e.endpoint[0],e.endpoint[1],e.endpoint[2]])})),this.geometry=[t]}setGeometryFromBoundedPlane(e){const t=[],r=e.origin,s=e.basis1,o=e.basis2,a=.5,n=i(),l=i(),m=i(),p=i();n[0]=r[0]-s[0]*a-o[0]*a,n[1]=r[1]-s[1]*a-o[1]*a,n[2]=r[2]-s[2]*a-o[2]*a,l[0]=r[0]-s[0]*a+o[0]*a,l[1]=r[1]-s[1]*a+o[1]*a,l[2]=r[2]-s[2]*a+o[2]*a,m[0]=r[0]+s[0]*a+o[0]*a,m[1]=r[1]+s[1]*a+o[1]*a,m[2]=r[2]+s[2]*a+o[2]*a,p[0]=r[0]+s[0]*a-o[0]*a,p[1]=r[1]+s[1]*a-o[1]*a,p[2]=r[2]+s[2]*a-o[2]*a,t.push([n[0],n[1],n[2]]),t.push([l[0],l[1],l[2]]),t.push([m[0],m[1],m[2]]),t.push([p[0],p[1],p[2]]),t.push([n[0],n[1],n[2]]),this.geometry=[t]}setGeometryFromSegment(t){const r=t.endRenderSpace;this.transform=e(f,r);const{points:s}=t.createRenderGeometry(r,this.view.renderCoordsHelper);this.geometry=[s]}setGeometryFromSegments(t,r=o){this.transform=e(f,r),this.geometry=t.map((e=>e.createRenderGeometry(r,this.view.renderCoordsHelper).points))}getTransformedGeometry(){return null==this._geometry?null:this._geometry.map((e=>e.map((e=>s(i(),e,this.transform)))))}get renderOccluded(){return this._material.parameters.renderOccluded}set renderOccluded(e){this._material.setParameters({renderOccluded:e})}get geometry(){return this._geometry}set geometry(e){this._geometry=e,this.recreateGeometry()}get width(){return this._material.parameters.width}set width(e){this._material.setParameters({width:e})}get color(){return this._material.parameters.color}set color(e){const t=1===e[3];this._material.setParameters({color:n(e),writeDepth:t})}get innerWidth(){return this._material.parameters.innerWidth}set innerWidth(e){this._material.setParameters({innerWidth:e})}get innerColor(){return this._material.parameters.innerColor}set innerColor(e){this._material.setParameters({innerColor:null!=e?n(e):null})}get stipplePattern(){return this._material.parameters.stipplePattern}set stipplePattern(e){null!=this._material&&this._material.setParameters({stipplePattern:e})}get stippleOffColor(){return this._material.parameters.stippleOffColor}set stippleOffColor(e){this._material.setParameters({stippleOffColor:null!=e?n(e):null})}get stipplePreferContinuous(){return this._material.parameters.stipplePreferContinuous}set stipplePreferContinuous(e){this._material.setParameters({stipplePreferContinuous:e})}get falloff(){return this._material.parameters.falloff}set falloff(e){this._material.setParameters({falloff:e})}get polygonOffset(){return this._material.parameters.hasPolygonOffset}set polygonOffset(e){this._material.setParameters({hasPolygonOffset:e})}createExternalResources(){}destroyExternalResources(){}createGeometries(e){for(const t of m(this.geometry)){const r=p(this._material,t);e.addGeometry(r)}}forEachExternalMaterial(e){this._hasExternalMaterial||e(this._material)}}const f=t();export{u as LineVisualElement};